diff --git a/index.ts b/index.ts
index bb50f310..abff49ff 100644
--- a/index.ts
+++ b/index.ts
@@ -1,4 +1,4 @@
-const { app, protocol, BrowserWindow, shell, ipcMain } = require("electron")
+import { app, protocol, BrowserWindow, shell, ipcMain } from "electron"
const path = require("path")
const fs = require('fs')
const rename = require('deep-rename-keys')
diff --git a/package.json b/package.json
index f7e268a6..7d6212ca 100644
--- a/package.json
+++ b/package.json
@@ -4,12 +4,13 @@
"main": "dist/index.js",
"license": "MIT",
"dependencies": {
- "deep-rename-keys": "^0.2.1"
+ "deep-rename-keys": "^0.2.1",
+ "node-fetch": "^2.6.0"
},
"devDependencies": {
+ "electron": "^9.1.0",
"electron-packager": "^15.0.0",
- "typescript": "^3.9.2",
- "electron": "^9.1.0"
+ "typescript": "^3.9.2"
},
"scripts": {
"start": "electron ."
diff --git a/packages.json b/packages.json
new file mode 100644
index 00000000..3ef26c92
--- /dev/null
+++ b/packages.json
@@ -0,0 +1,7 @@
+[
+ {
+ "id": "microsoft.bingweather",
+ "url": "http://localhost:8080/",
+ "type": "remote"
+ }
+]
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/AppxManifest.xml b/packages/microsoft.bingweather/AppxManifest.xml
new file mode 100644
index 00000000..285d8243
--- /dev/null
+++ b/packages/microsoft.bingweather/AppxManifest.xml
@@ -0,0 +1,283 @@
+
+
+
+
+
+ ms-resource:BrandedAppTitle
+ ms-resource:AppDescription
+ Microsoft Corporation
+ images\store.png
+
+
+ 6.3.0
+ 6.3.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft.Media.AdaptiveStreaming.dll
+
+
+
+
+
+
+
+
+
+ CLRHost.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft.Media.AdaptiveStreaming.dll
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft.PerfTrack.dll
+
+
+
+
+
+ SqliteWrapper.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/ar.json b/packages/microsoft.bingweather/resources/ar.json
new file mode 100644
index 00000000..b7f50482
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/ar.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "1",
+ "Language_af": "الأفريقانية",
+ "Language_am": "الأمهرية",
+ "Language_ar": "العربية",
+ "Language_arn-Latn": "المابودونجونية",
+ "Language_as": "الأساميزية",
+ "Language_az": "الأذرية (اللاتينية)",
+ "Language_az-Cyrl": "الأذربيجانية (السيريلية)",
+ "Language_az-Latn": "الأذريبجانية (اللاتينية)",
+ "Language_ba-Cyrl": "الباشقورية",
+ "Language_be": "البيلاروسية",
+ "Language_bg": "البلغارية",
+ "Language_bn": "البنغالية",
+ "Language_bn-bd": "البنغالية (بنغلاديش)",
+ "Language_bn-in": "البنغالية (الهند)",
+ "Language_br-Latn": "البريتانية",
+ "Language_bs": "البوسنية (اللاتينية)",
+ "Language_bs-Cyrl": "البوسنية (السيريلية)",
+ "Language_bs-Latn": "البوسنية (اللاتينية)",
+ "Language_ca": "الكتالانية",
+ "Language_ca-ES-valencia": "البلنسية",
+ "Language_chr": "الشيروكي",
+ "Language_chr-Cher": "الشيروكية (شيروكي)",
+ "Language_co-Latn": "الكورسيكانية",
+ "Language_cs": "التشيكية",
+ "Language_cy": "الويلزية",
+ "Language_da": "الدانمركية",
+ "Language_de": "الألمانية",
+ "Language_dsb": "صوربيا السفلى",
+ "Language_dv": "الديفيهية",
+ "Language_el": "اليونانية",
+ "Language_en": "الإنجليزية",
+ "Language_es": "الإسبانية",
+ "Language_et": "الإستونية",
+ "Language_eu": "الباسكية",
+ "Language_fa": "الفارسية",
+ "Language_ff-Latn": "الفولانية",
+ "Language_fi": "الفنلندية",
+ "Language_fil-Latn": "الفلبينية",
+ "Language_fo": "الفاروية",
+ "Language_fr": "الفرنسية",
+ "Language_fy": "الفريزية",
+ "Language_ga": "الأيرلندية",
+ "Language_gd": "الاسكتلندية الغالية",
+ "Language_gd-Latn": "الاسكتلندية الغالية",
+ "Language_gl": "الغليشيانية",
+ "Language_gsw": "الألسشيانية",
+ "Language_gu": "الجيوجاراتية",
+ "Language_ha": "الهاوسا (اللاتينية)",
+ "Language_ha-Latn": "الهاوسا (اللاتينية)",
+ "Language_he": "العبرية",
+ "Language_hi": "الهندية",
+ "Language_hr": "الكرواتية",
+ "Language_hsb": "صوربيا العليا",
+ "Language_hu": "المجرية",
+ "Language_hy": "الأرمنية",
+ "Language_id": "الإندونيسية",
+ "Language_ig": "الإيجبو",
+ "Language_ig-Latn": "الإيجبو",
+ "Language_is": "الأيسلندية",
+ "Language_it": "الإيطالية",
+ "Language_iu-Latn": "الإنكتيتوتية (اللاتينية)",
+ "Language_ja": "اليابانية",
+ "Language_ka": "الجورجية",
+ "Language_kk": "الكازاخية",
+ "Language_kl": "الغرينلاندية",
+ "Language_km": "الخميرية",
+ "Language_kn": "الكانادية",
+ "Language_ko": "الكورية",
+ "Language_kok": "الكونكانية",
+ "Language_ku": "الكردية",
+ "Language_ku-Arab": "الكردية الأوسطية",
+ "Language_ky": "القرغيزية",
+ "Language_ky-Cyrl": "القرغيزية",
+ "Language_lb": "اللكسمبورجية",
+ "Language_lo": "اللاوو",
+ "Language_lt": "الليتوانية",
+ "Language_lv": "اللاتفية",
+ "Language_mi-Latn": "الماورية",
+ "Language_mk": "المقدونية",
+ "Language_ml": "المالايالامية",
+ "Language_mn": "المنغولية (السيريلية)",
+ "Language_mn-Cyrl": "المنغولية (السيريلية)",
+ "Language_mr": "الماراثية",
+ "Language_ms": "الماليزية",
+ "Language_mt": "المالطية",
+ "Language_nb": "النرويجية (بوكمال)",
+ "Language_ne": "النيبالية",
+ "Language_nl": "الهولندية",
+ "Language_nn": "النرويجية (نينورسك)",
+ "Language_nso": "سيسوتو سا ليبوا",
+ "Language_oc-Latn": "الأوكسيتانية",
+ "Language_or": "اللغة الأورية",
+ "Language_pa": "البنجابية (الجورموخية)",
+ "Language_pa-Arab": "البنجابية (العربية)",
+ "Language_pl": "البولندية",
+ "Language_prs": "داري",
+ "Language_prs-arab": "داري",
+ "Language_ps": "الباشتو",
+ "Language_pt": "البرتغالية",
+ "Language_pt-br": "البرتغالية (البرازيل)",
+ "Language_pt-pt": "البرتغالية (البرتغال)",
+ "Language_quc-Latn": "الكيشية",
+ "Language_qut": "الكيشية",
+ "Language_quz-Latn": "الكويتشوا",
+ "Language_ro": "الرومانية",
+ "Language_ru": "الروسية",
+ "Language_rw": "الكينيارواندية",
+ "Language_sa-Deva": "السنسكريتية",
+ "Language_sah-Cyrl": "الساخيّة",
+ "Language_sd-Arab": "السندية (العربية)",
+ "Language_se-Latn": "سامي الشمالية",
+ "Language_si": "السنهالية",
+ "Language_sk": "السلوفاكية",
+ "Language_sl": "السلوفانية",
+ "Language_sma-Latn": "سامي الجنوبية",
+ "Language_smj-Latn": "سامي اللولية",
+ "Language_smn-Latn": "سامي الإنارية",
+ "Language_sms-Latn": "سامي السكولتية",
+ "Language_sq": "الألبانية",
+ "Language_sr-Cyrl": "الصربية (السيريلية)",
+ "Language_sr-cyrl-ba": "الصربية (السيريلية, البوسنة والهرسك)",
+ "Language_sr-Latn": "الصربية (اللاتينية)",
+ "Language_sv": "السويدية",
+ "Language_sw": "السواحيلية",
+ "Language_syr-Syrc": "السريانية",
+ "Language_ta": "التاميلية",
+ "Language_te": "التيلوجو",
+ "Language_tg-Cyrl": "الطاجيكية (السيريلية)",
+ "Language_th": "التايلاندية",
+ "Language_ti": "التيغرينية",
+ "Language_tk-Latn": "التركمانية (اللاتينية)",
+ "Language_tn": "الستسوانا",
+ "Language_tr": "التركية",
+ "Language_tt": "التترية",
+ "Language_tt-Cyrl": "التترية (السيريلية)",
+ "Language_tzm-Latn": "التمازيغية (اللاتينية)",
+ "Language_ug": "الأويغورية",
+ "Language_ug-Arab": "الأويغورية",
+ "Language_uk": "الأوكرانية",
+ "Language_ur": "الأوردية",
+ "Language_uz-Cyrl": "الأوزبكية (السيريلية)",
+ "Language_uz-Latn": "الأوزبكية (اللاتينية)",
+ "Language_vi": "الفيتنامية",
+ "Language_wo-Latn": "الولوفية",
+ "Language_xh": "الخوسا",
+ "Language_yo": "اليوروبا",
+ "Language_yo-Latn": "اليوروبا",
+ "Language_zh-Hans": "الصينية (المبسطة)",
+ "Language_zh-Hant": "الصينية (التقليدية)",
+ "Language_zu": "الزولو",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "أندورا",
+ "Region_Display_AE": "الإمارات العربية المتحدة",
+ "Region_Display_AF": "أفغانستان",
+ "Region_Display_AG": "أنتيغوا وبربودا",
+ "Region_Display_AI": "أنغويلا",
+ "Region_Display_AL": "ألبانيا",
+ "Region_Display_AM": "أرمينيا",
+ "Region_Display_AO": "أنغولا",
+ "Region_Display_AR": "الأرجنتين",
+ "Region_Display_AS": "ساموا الأمريكية",
+ "Region_Display_AT": "النمسا",
+ "Region_Display_AU": "أستراليا",
+ "Region_Display_AW": "أروبا",
+ "Region_Display_AZ": "أذربيجان",
+ "Region_Display_BA": "البوسنة والهرسك",
+ "Region_Display_BB": "بربادوس",
+ "Region_Display_BD": "بنغلاديش",
+ "Region_Display_BE": "بلجيكا",
+ "Region_Display_BF": "بوركينافاسو",
+ "Region_Display_BG": "بلغاريا",
+ "Region_Display_BH": "البحرين",
+ "Region_Display_BI": "بوروندي",
+ "Region_Display_BJ": "بنن",
+ "Region_Display_BM": "برمودا",
+ "Region_Display_BN": "بروناي",
+ "Region_Display_BO": "بوليفيا",
+ "Region_Display_BQ": "بونيه",
+ "Region_Display_BR": "البرازيل",
+ "Region_Display_BS": "البهاما",
+ "Region_Display_BT": "بوتان",
+ "Region_Display_BW": "بوتسوانا",
+ "Region_Display_BY": "بيلاروس",
+ "Region_Display_BZ": "بليز",
+ "Region_Display_CA": "كندا",
+ "Region_Display_CC": "جزر كوكوس كيلنج",
+ "Region_Display_CD": "الكنغو (DRC)",
+ "Region_Display_CF": "جمهورية أفريقيا الوسطى",
+ "Region_Display_CG": "الكونغو",
+ "Region_Display_CH": "سويسرا",
+ "Region_Display_CI": "Côte d'Ivoire \"كوت ديفوار\"",
+ "Region_Display_CK": "جزر كوك",
+ "Region_Display_CL": "تشيلي",
+ "Region_Display_CM": "الكاميرون",
+ "Region_Display_CN": "الصين",
+ "Region_Display_CO": "كولومبيا",
+ "Region_Display_CR": "كوستاريكا",
+ "Region_Display_CS": "صربيا ومونتينيغرو (سابقًا)",
+ "Region_Display_CV": "جزر الرأس الأخضر (Cape Verde)",
+ "Region_Display_CW": "كوراساو",
+ "Region_Display_CX": "جزيرة الكريسماس",
+ "Region_Display_CY": "قبرص",
+ "Region_Display_CZ": "جمهورية التشيك",
+ "Region_Display_DE": "ألمانيا",
+ "Region_Display_DJ": "جيبوتي",
+ "Region_Display_DK": "الدنمارك",
+ "Region_Display_DM": "دومينيكا",
+ "Region_Display_DO": "جمهورية الدومينيكان",
+ "Region_Display_DZ": "الجزائر",
+ "Region_Display_EC": "الإكوادور",
+ "Region_Display_EE": "إستونيا",
+ "Region_Display_EG": "مصر",
+ "Region_Display_ER": "إريتريا",
+ "Region_Display_ES": "أسبانيا",
+ "Region_Display_ET": "أثيوبيا",
+ "Region_Display_FI": "فنلندا",
+ "Region_Display_FK": "جزر فوكلاند (Islas Malvinas)",
+ "Region_Display_FM": "ميكرونيزيا",
+ "Region_Display_FO": "جزر فيرو",
+ "Region_Display_FR": "فرنسا",
+ "Region_Display_GA": "الغابون",
+ "Region_Display_GB": "المملكة المتحدة",
+ "Region_Display_GD": "جرانادا",
+ "Region_Display_GE": "جورجيا",
+ "Region_Display_GF": "جيانا الفرنسية",
+ "Region_Display_GG": "غويرنسي",
+ "Region_Display_GH": "غانا",
+ "Region_Display_GL": "غرينلاند",
+ "Region_Display_GM": "غامبيا",
+ "Region_Display_GN": "غينيا",
+ "Region_Display_GP": "غوادلوب",
+ "Region_Display_GQ": "غينيا الاستوائية",
+ "Region_Display_GR": "اليونان",
+ "Region_Display_GT": "غواتيمالا",
+ "Region_Display_GU": "جوام",
+ "Region_Display_GW": "غينيا بيساو",
+ "Region_Display_GY": "غويانا",
+ "Region_Display_HK": "هونغ كونغ SAR",
+ "Region_Display_HN": "هندوراس",
+ "Region_Display_HR": "كرواتيا",
+ "Region_Display_HT": "هايتي",
+ "Region_Display_HU": "هنغاريا",
+ "Region_Display_ID": "إندونيسيا",
+ "Region_Display_IE": "إيرلندا",
+ "Region_Display_IL": "إسرائيل والسلطة الفلسطينية",
+ "Region_Display_IN": "الهند",
+ "Region_Display_IQ": "العراق",
+ "Region_Display_IR": "إيران",
+ "Region_Display_IS": "أيسلندا",
+ "Region_Display_IT": "إيطاليا",
+ "Region_Display_JE": "جيرسي",
+ "Region_Display_JM": "جامايكا",
+ "Region_Display_JO": "الأردن",
+ "Region_Display_JP": "اليابان",
+ "Region_Display_KE": "كينيا",
+ "Region_Display_KG": "قيرقيزتان",
+ "Region_Display_KH": "كمبوديا",
+ "Region_Display_KI": "كيريباتي",
+ "Region_Display_KM": "جزر القمر",
+ "Region_Display_KN": "سانت كيتس ونيفيس",
+ "Region_Display_KR": "كوريا",
+ "Region_Display_KW": "الكويت",
+ "Region_Display_KY": "جزر كيمان",
+ "Region_Display_KZ": "كازاخستان",
+ "Region_Display_LA": "لاوس",
+ "Region_Display_LB": "لبنان",
+ "Region_Display_LC": "سانت لوشا",
+ "Region_Display_LI": "ليشتنشتاين",
+ "Region_Display_LK": "سريلانكا",
+ "Region_Display_LR": "ليبيريا",
+ "Region_Display_LS": "ليسوتو",
+ "Region_Display_LT": "لتوانيا",
+ "Region_Display_LU": "لكسمبورج",
+ "Region_Display_LV": "لاتفيا",
+ "Region_Display_LY": "ليبيا",
+ "Region_Display_MA": "المغرب",
+ "Region_Display_MC": "موناكو",
+ "Region_Display_MD": "مولدافا",
+ "Region_Display_ME": "مونتينيغرو",
+ "Region_Display_MF": "سان مارتن",
+ "Region_Display_MG": "مدغشقر",
+ "Region_Display_MH": "جزر مارشال",
+ "Region_Display_MK": "جمهورية مقدونيا اليوغسلافية السابقة",
+ "Region_Display_ML": "مالي",
+ "Region_Display_MM": "ميانمار",
+ "Region_Display_MN": "منغوليا",
+ "Region_Display_MO": "ماكاو SAR",
+ "Region_Display_MP": "جزر ماريانا الشمالية",
+ "Region_Display_MQ": "جزر المارتينيك",
+ "Region_Display_MR": "موريتانيا",
+ "Region_Display_MS": "مونتسيرات",
+ "Region_Display_MT": "مالطا",
+ "Region_Display_MU": "موريشيوس",
+ "Region_Display_MV": "جزر المالديف",
+ "Region_Display_MW": "مالاوي",
+ "Region_Display_MX": "المكسيك",
+ "Region_Display_MY": "ماليزيا",
+ "Region_Display_MZ": "موزنبيق",
+ "Region_Display_NA": "ناميبيا",
+ "Region_Display_NC": "كالدونيا الجديدة",
+ "Region_Display_NE": "نيجر",
+ "Region_Display_NF": "جزيرة نورفولك",
+ "Region_Display_NG": "نيجيريا",
+ "Region_Display_NI": "نيكاراجوا",
+ "Region_Display_NL": "هولندا",
+ "Region_Display_NO": "النرويج",
+ "Region_Display_NP": "نيبال",
+ "Region_Display_NR": "ناورو",
+ "Region_Display_NU": "نييوي",
+ "Region_Display_NZ": "نيوزيلندا",
+ "Region_Display_OM": "عُمان",
+ "Region_Display_PA": "بنما",
+ "Region_Display_PE": "بيرو",
+ "Region_Display_PF": "بولينيزيا الفرنسية",
+ "Region_Display_PG": "بابوا غينيا الجديدة",
+ "Region_Display_PH": "الفلبين",
+ "Region_Display_PK": "باكستان",
+ "Region_Display_PL": "بولندا",
+ "Region_Display_PM": "سان بيير ومكويلون",
+ "Region_Display_PN": "جزر بيتكيرن",
+ "Region_Display_PR": "بورتو ريكو",
+ "Region_Display_PT": "البرتغال",
+ "Region_Display_PW": "بالاو",
+ "Region_Display_PY": "باراجواي",
+ "Region_Display_QA": "قطر",
+ "Region_Display_RE": "روينيون",
+ "Region_Display_RO": "رومانيا",
+ "Region_Display_RS": "صربيا",
+ "Region_Display_RU": "روسيا",
+ "Region_Display_RW": "رواندا",
+ "Region_Display_SA": "السعودية",
+ "Region_Display_SB": "جزر سليمان",
+ "Region_Display_SC": "سيشل",
+ "Region_Display_SD": "السودان",
+ "Region_Display_SE": "السويد",
+ "Region_Display_SG": "سنغافورة",
+ "Region_Display_SH": "سانت هيلينا و أسينشين و تريستان دا كونا",
+ "Region_Display_SI": "سلوفينيا",
+ "Region_Display_SK": "سلوفاكيا",
+ "Region_Display_SL": "سيراليون",
+ "Region_Display_SM": "سان مارينو",
+ "Region_Display_SN": "السنغال",
+ "Region_Display_SO": "الصومال",
+ "Region_Display_SR": "سورينام",
+ "Region_Display_SS": "جنوب السودان",
+ "Region_Display_ST": "ساو تومي وبرينسيبي",
+ "Region_Display_SV": "السلفادور",
+ "Region_Display_SX": "سانت مارتن",
+ "Region_Display_SY": "سوريا",
+ "Region_Display_SZ": "سوازيلاند",
+ "Region_Display_TC": "جزر توركس وكايكوس",
+ "Region_Display_TD": "تشاد",
+ "Region_Display_TG": "توجو",
+ "Region_Display_TH": "تايلاند",
+ "Region_Display_TJ": "طاجيكستان",
+ "Region_Display_TK": "توكيلو",
+ "Region_Display_TL": "تيمور ليشتي",
+ "Region_Display_TM": "تركمانستان",
+ "Region_Display_TN": "تونس",
+ "Region_Display_TR": "تركيا",
+ "Region_Display_TT": "ترينداد وتوباجو",
+ "Region_Display_TV": "توفالو",
+ "Region_Display_TW": "تايوان",
+ "Region_Display_TZ": "تنزانيا",
+ "Region_Display_UA": "أوكرانيا",
+ "Region_Display_UG": "أوغندا",
+ "Region_Display_US": "الولايات المتحدة",
+ "Region_Display_UY": "أوروجواي",
+ "Region_Display_UZ": "أوزبكستان",
+ "Region_Display_VA": "هولي سي (مدينة الفاتيكان)",
+ "Region_Display_VC": "سانت فنسنت وجزر غرينادين",
+ "Region_Display_VE": "فنزويلا",
+ "Region_Display_VG": "جزر فيرجن البريطانية",
+ "Region_Display_VI": "جزر فيرجن التابعة للولايات المتحدة",
+ "Region_Display_VN": "فيتنام",
+ "Region_Display_VU": "فانواتو",
+ "Region_Display_WF": "جزر والس وفوتانا",
+ "Region_Display_WS": "ساموا",
+ "Region_Display_XE": "سانت أوستاتيوس",
+ "Region_Display_XS": "سابا",
+ "Region_Display_YE": "اليمن",
+ "Region_Display_YT": "مايوت",
+ "Region_Display_ZA": "جنوب أفريقيا",
+ "Region_Display_ZM": "زامبيا",
+ "Region_Display_ZW": "زمبابوي"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/countryRegionCodes.json b/packages/microsoft.bingweather/resources/countryRegionCodes.json
new file mode 100644
index 00000000..fc10531f
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/countryRegionCodes.json
@@ -0,0 +1,624 @@
+{
+ "United States": "US",
+ "الولايات المتحدة": "US",
+ "Съединени Щати": "US",
+ "Spojené státy": "US",
+ "USA": "US",
+ "Vereinigte Staaten von Amerika": "US",
+ "Estados Unidos": "US",
+ "Ühendriigid": "US",
+ "Yhdysvallat": "US",
+ "États-Unis": "US",
+ "संयुक्त राज्य": "US",
+ "Sjedinjene Države": "US",
+ "Egyesült Államok": "US",
+ "Amerika Serikat": "US",
+ "Bandaríkin": "US",
+ "Stati Uniti d'America": "US",
+ "미국": "US",
+ "Jungtinės Valstijos": "US",
+ "Verenigde Staten": "US",
+ "Stany Zjednoczone": "US",
+ "Statele Unite Ale Americii": "US",
+ "Соединенные Штаты Америки": "US",
+ "Spojené Štáty": "US",
+ "สหรัฐ": "US",
+ "Birleşik Devletler": "US",
+ "美国": "US",
+ "美國": "US",
+ "Zhongguo": "CN",
+ "الصين": "CN",
+ "Китай": "CN",
+ "Čína": "CN",
+ "Kina": "CN",
+ "China": "CN",
+ "Hiina": "CN",
+ "Kiina": "CN",
+ "Chine": "CN",
+ "चीन": "CN",
+ "Kína": "CN",
+ "Cina": "CN",
+ "중국": "CN",
+ "Kinija": "CN",
+ "Chiny": "CN",
+ "中国": "CN",
+ "จีน": "CN",
+ "Çin": "CN",
+ "中國": "CN",
+ "Daehan-minguk": "KR",
+ "كوريا الجنوبية": "KR",
+ "Южна Корея": "KR",
+ "Korejská republika": "KR",
+ "Sydkorea": "KR",
+ "Südkorea": "KR",
+ "South Korea": "KR",
+ "Corea del Sur": "KR",
+ "Lõuna-Korea": "KR",
+ "Etelä-Korea": "KR",
+ "Corée du Sud": "KR",
+ "दक्षिणी कोरिया": "KR",
+ "Južna Koreja": "KR",
+ "Dél-Korea": "KR",
+ "Korea Selatan": "KR",
+ "Suður-Kórea": "KR",
+ "Corea del Sud": "KR",
+ "대한민국": "KR",
+ "Pietų Korėja": "KR",
+ "Zuid-Korea": "KR",
+ "Sør-Korea": "KR",
+ "Korea Południowa": "KR",
+ "Coréia do Sul": "KR",
+ "Coreea de Sud": "KR",
+ "Южная Корея": "KR",
+ "Južná Kórea": "KR",
+ "เกาหลีใต้": "KR",
+ "Güney Kore": "KR",
+ "Південна Корея": "KR",
+ "韩国": "KR",
+ "韓國": "KR",
+ "Nihon": "JP",
+ "اليابان": "JP",
+ "Япония": "JP",
+ "Japonsko": "JP",
+ "Japan": "JP",
+ "Japón": "JP",
+ "Jaapan": "JP",
+ "Japani": "JP",
+ "Japon": "JP",
+ "जापान": "JP",
+ "Japán": "JP",
+ "Jepang": "JP",
+ "Giappone": "JP",
+ "일본": "JP",
+ "Japonija": "JP",
+ "Japonia": "JP",
+ "Japão": "JP",
+ "日本": "JP",
+ "ญี่ปุ่น": "JP",
+ "Japonya": "JP",
+ "Японія": "JP",
+ "Xianggang SAR": "HK",
+ "هونج كونج - الصين": "HK",
+ "Хонг Конг - Китай": "HK",
+ "Hongkong SAR": "HK",
+ "SAR Hongkong": "HK",
+ "Hong Kong SAR": "HK",
+ "Hong Kong (RAE)": "HK",
+ "Hongkong-Hiina": "HK",
+ "Hongkong": "HK",
+ "RAS Hong Kong": "HK",
+ "हाँग काँग-चीन": "HK",
+ "Hong Kong-Kina": "HK",
+ "Hongkong-Kína": "HK",
+ "Hong Kong-Cina": "HK",
+ "Hong Kong-Kína": "HK",
+ "Hong Kong R.A.S.": "HK",
+ "홍콩 특별 행정구": "HK",
+ "Honkongas, Kinija": "HK",
+ "Hongkong - Chiny": "HK",
+ "RAE Hong Kong": "HK",
+ "Hong Kong-China": "HK",
+ "Гонконг (Китай)": "HK",
+ "香港特別行政區": "HK",
+ "ฮ่องกง-จีน": "HK",
+ "Hong Kong-Çin": "HK",
+ "香港特别行政区": "HK",
+ "T’aiwan": "TW",
+ "Tchaj-wan": "TW",
+ "Taiwan": "TW",
+ "Taïwan": "TW",
+ "타이완": "TW",
+ "台灣": "TW",
+ "Aomen SAR": "MO",
+ "ماكاو - الصين": "MO",
+ "Макау - Китай": "MO",
+ "Macao SAR": "MO",
+ "SAR Macao": "MO",
+ "Macao (RAE)": "MO",
+ "Aomen-Hiina": "MO",
+ "Macao": "MO",
+ "RAS Macao": "MO",
+ "मकाऊ-चीन": "MO",
+ "Macau-China": "MO",
+ "Makaó-Kína": "MO",
+ "Makau-Cina": "MO",
+ "Makau-Kína": "MO",
+ "Macao R.A.S.": "MO",
+ "마카오 특별 행정구": "MO",
+ "Makao, Kinija": "MO",
+ "Macau SAR": "MO",
+ "Makau - Chiny": "MO",
+ "RAE Macau": "MO",
+ "Macao-China": "MO",
+ "Макао (Китай)": "MO",
+ "Macao-Čína": "MO",
+ "澳門特別行政區": "MO",
+ "มาเก๊า-จีน": "MO",
+ "Makau-Çin": "MO",
+ "澳门特别行政区": "MO",
+ "American Samoa": "AS",
+ "Americká Samoa": "AS",
+ "Amerikansk Samoa": "AS",
+ "Amerikanisch-Samoa": "AS",
+ "Samoa Americana": "AS",
+ "Amerikan Samoa": "AS",
+ "Samoa américaines": "AS",
+ "Samoa Americane": "AS",
+ "아메리칸사모아": "AS",
+ "Amerikaans Samoa": "AS",
+ "Amerikanska Samoa": "AS",
+ "美屬薩摩亞": "AS",
+ "Guam": "GU",
+ "جوام": "GU",
+ "Гуам": "GU",
+ "गुआम": "GU",
+ "Gúam": "GU",
+ "괌": "GU",
+ "Guamas": "GU",
+ "กวม": "GU",
+ "关岛": "GU",
+ "關島": "GU",
+ "Northern Mariana Islands": "MP",
+ "جزر ماريانا الشمالية": "MP",
+ "Северни Мариански Острови": "MP",
+ "Severní Mariany": "MP",
+ "Nordmarianerne": "MP",
+ "Nördliche Marianen": "MP",
+ "Islas Marianas del Norte": "MP",
+ "Põhja-Mariaanid": "MP",
+ "Pohjois-Mariaanit": "MP",
+ "Mariannes du Nord": "MP",
+ "उत्तरी मेरियाना द्वीपसमूह": "MP",
+ "Sjeverno Marijansko Otočje": "MP",
+ "Északi-Mariana-Szigetek": "MP",
+ "Kepulauan Mariana Utara": "MP",
+ "Norður Maríanaeyjar": "MP",
+ "Isole Marianne Settentrionali": "MP",
+ "북마리아나 제도": "MP",
+ "Marianos Šiaurinės Salos": "MP",
+ "Noordelijke Marianen": "MP",
+ "Nord-Marianene": "MP",
+ "Mariany Północne": "MP",
+ "Marianas": "MP",
+ "Insulele Mariane de Nord": "MP",
+ "Северные Марианские Острова": "MP",
+ "Severné Mariány": "MP",
+ "Nordmarianerna": "MP",
+ "หมู่เกาะมาเรียนาตอนเหนือ": "MP",
+ "Kuzey Mariana Adaları": "MP",
+ "Північні Маріанські Острови": "MP",
+ "北马里亚纳群岛": "MP",
+ "北馬里亞納群島": "MP",
+ "Puerto Rico": "PR",
+ "بورتو ريكو": "PR",
+ "Пуерто Рико": "PR",
+ "Puerto Rico, Canarias, Espanya": "PR",
+ "Portoriko": "PR",
+ "Puerto Rico, Canarias, España": "PR",
+ "Porto Rico": "PR",
+ "प्योर्टो रिको": "PR",
+ "Puerto Riko": "PR",
+ "Púertó Ríkó": "PR",
+ "푸에르토리코": "PR",
+ "Puerto Rikas": "PR",
+ "Portoryko": "PR",
+ "Пуэрто-Рико": "PR",
+ "เปอโตริโก": "PR",
+ "Porto Riko": "PR",
+ "波多黎各": "PR",
+ "波多黎各島": "PR",
+ "U.S. Virgin Islands": "VI",
+ "الجزر العذراء الأمريكية": "VI",
+ "Американски Вирджински Острови": "VI",
+ "Panenské ostrovy USA": "VI",
+ "De Amerikanske Jomfruøer": "VI",
+ "Amerikanische Jungferninseln": "VI",
+ "US Virgin Islands": "VI",
+ "Islas Vírgenes (EE UU)": "VI",
+ "Usa Neitsisaared": "VI",
+ "Yhdysvaltain Neitsytsaaret": "VI",
+ "Îles Vierges des États-Unis": "VI",
+ "यूएस वर्जिन द्वीपसमूह": "VI",
+ "Us Virginsko Otočje": "VI",
+ "Virgin-Szigetek (Usa)": "VI",
+ "Kepulauan Virgin as": "VI",
+ "Bandarísku Jómfrúareyjar": "VI",
+ "Isole Vergini Americane": "VI",
+ "미국령 버진아일랜드": "VI",
+ "Jav Mergelių Salos": "VI",
+ "Amerikaanse Maagdeneilanden": "VI",
+ "Jomfruøyene (USA)": "VI",
+ "Wyspy Dziewicze Usa": "VI",
+ "Ilhas Virgens": "VI",
+ "Insulele Virgine Americane": "VI",
+ "Виргинские Острова (США)": "VI",
+ "Americké Panenské Ostrovy": "VI",
+ "Amerikanska Jungfruöarna": "VI",
+ "หมู่เกาะเวอร์จินของสหรัฐอเมริกา": "VI",
+ "Abd Virjin Adaları": "VI",
+ "美属维尔京群岛": "VI",
+ "美屬維爾京群島": "VI",
+ "Baker Island": "UM",
+ "Ostrov Baker": "UM",
+ "Baker": "UM",
+ "Baker-Insel": "UM",
+ "Isla Baker": "UM",
+ "Bakerinsaari": "UM",
+ "Île Baker": "UM",
+ "베이커 섬": "UM",
+ "Ilha Baker": "UM",
+ "貝克島": "UM",
+ "Bajo Nuevo Bank": "UM",
+ "Bajo Nuevo": "UM",
+ "Howland Island": "UM",
+ "Ostrov Howland": "UM",
+ "Howland": "UM",
+ "Howland-Insel": "UM",
+ "Isla Howland": "UM",
+ "Howlandinsaari": "UM",
+ "하울랜드 섬": "UM",
+ "Ilhas Howland": "UM",
+ "豪蘭島": "UM",
+ "Jarvis Island": "UM",
+ "Ostrov Jarvis": "UM",
+ "Jarvis-Insel": "UM",
+ "Isla Jarvis": "UM",
+ "Jarvisinsaari": "UM",
+ "Île Jarvis": "UM",
+ "Isola Jarvis": "UM",
+ "저비스": "UM",
+ "Jarviseiland": "UM",
+ "Ilha Jarvis": "UM",
+ "加維斯島": "UM",
+ "Johnston Atoll": "UM",
+ "Johnstonův Atol": "UM",
+ "Johnston-Inseln": "UM",
+ "Atolón Johnston": "UM",
+ "Johnstonin atolli": "UM",
+ "Atoll de Johnston": "UM",
+ "Atollo Johnston": "UM",
+ "존스턴 환초": "UM",
+ "Johnston-atol": "UM",
+ "Atol Johnston": "UM",
+ "約翰斯頓群島": "UM",
+ "Kingman Reef": "UM",
+ "Kingman": "UM",
+ "Kingman-Riff": "UM",
+ "Arrecife Kingman": "UM",
+ "Kingmanin riutta": "UM",
+ "Récif Kingman": "UM",
+ "Scoglio Kingman": "UM",
+ "킹맨 환초": "UM",
+ "Recife de Kingman": "UM",
+ "京曼島": "UM",
+ "Midway Island, FL": "UM",
+ "Navassa Island": "UM",
+ "هايتي": "UM",
+ "Хаити": "UM",
+ "Navassa": "UM",
+ "Isla Navassa": "UM",
+ "Haiti": "UM",
+ "हैती": "UM",
+ "Haítí": "UM",
+ "나배사": "UM",
+ "Haitis": "UM",
+ "Ilhas Navassa": "UM",
+ "Гаити": "UM",
+ "ไฮติ": "UM",
+ "海地": "UM",
+ "納瓦薩島": "UM",
+ "Serranilla Bank": "UM",
+ "Isla Serranilla": "UM",
+ "Serranilla": "UM",
+ "جزیره صخره سرانیلا": "UM",
+ "Isola Serranilla": "UM",
+ "Wake Island": "UM",
+ "Ostrov Wake": "UM",
+ "Wake": "UM",
+ "Isla Wake": "UM",
+ "Wakesaari": "UM",
+ "Île de Wake": "UM",
+ "웨이크 섬": "UM",
+ "Wake-eiland": "UM",
+ "Ilha Wake": "UM",
+ "威克島": "UM",
+ "Afghanistan": "AF",
+ "Aforika Borwa": "ZA",
+ "Afrika Borwa": "ZA",
+ "Albania": "AL",
+ "Algeria": "DZ",
+ "ʻAmelika": "US",
+ "An Rìoghachd Aonaichte": "GB",
+ "Aotearoa": "NZ",
+ "Argentina": "AR",
+ "Armenia": "AM",
+ "Australia": "AU",
+ "Austria": "AT",
+ "Azerbaijan": "AZ",
+ "Azərbaycan": "AZ",
+ "Bahrain": "BH",
+ "Bangladesh": "BD",
+ "Belarus": "BY",
+ "België": "BE",
+ "Belgique": "BE",
+ "Belgium": "BE",
+ "Belize": "BZ",
+ "Bolivarian Republic of Venezuela": "VE",
+ "Bolivia": "BO",
+ "Bolivia Suyu": "BO",
+ "Bosna i Hercegovina": "BA",
+ "Bosnia and Herzegovina": "BA",
+ "Botswana": "BW",
+ "Brasil": "BR",
+ "Brazil": "BR",
+ "Brunei Darussalam": "BN",
+ "Bulgaria": "BG",
+ "Cambodia": "KH",
+ "Canada": "CA",
+ "Caribbean": "029",
+ "Česká republika": "CZ",
+ "Chile": "CL",
+ "Colombia": "CO",
+ "Costa Rica": "CR",
+ "Crna Gora": "ME",
+ "Croatia": "HR",
+ "Czech Republic": "CZ",
+ "Danmark": "DK",
+ "Denmark": "DK",
+ "Deutschland": "DE",
+ "Djazaïr": "DZ",
+ "Dominican Republic": "DO",
+ "Ecuador": "EC",
+ "Ecuador Suyu": "EC",
+ "Eesti": "EE",
+ "Egypt": "EG",
+ "Éire": "IE",
+ "El Salvador": "SV",
+ "Eritrea": "ER",
+ "Espainia": "ES",
+ "España": "ES",
+ "espanya": "ES",
+ "Espanya": "ES",
+ "Estonia": "EE",
+ "Ethiopia": "ET",
+ "Faroe Islands": "FO",
+ "Finland": "FI",
+ "Føroyar": "FO",
+ "França": "FR",
+ "France": "FR",
+ "Francia": "FR",
+ "Frànkrisch": "FR",
+ "Frañs": "FR",
+ "Georgia": "GE",
+ "Germany": "DE",
+ "Greece": "GR",
+ "Greenland": "GL",
+ "Guatemala": "GT",
+ "Honduras": "HN",
+ "Hong Kong S.A.R.": "HK",
+ "Hrvatska": "HR",
+ "Hungary": "HU",
+ "Iceland": "IS",
+ "India": "IN",
+ "Indonesia": "ID",
+ "iNingizimu Afrika": "ZA",
+ "Iran": "IR",
+ "Iraq": "IQ",
+ "Ireland": "IE",
+ "Islamic Republic of Pakistan": "PK",
+ "Ísland": "IS",
+ "Israel": "IL",
+ "Italia": "IT",
+ "Italy": "IT",
+ "Jamaica": "JM",
+ "Jordan": "JO",
+ "Kalaallit Nunaat": "GL",
+ "Kanata": "CA",
+ "Kazakhstan": "KZ",
+ "Kenya": "KE",
+ "Korea": "KR",
+ "Kuwait": "KW",
+ "Kyrgyzstan": "KG",
+ "Lää´ddjânnam": "FI",
+ "Lao P.D.R.": "LA",
+ "Latvia": "LV",
+ "Latvija": "LV",
+ "Lebanon": "LB",
+ "Lëtzebuerg": "LU",
+ "Libya": "LY",
+ "Liechtenstein": "LI",
+ "Lietuva": "LT",
+ "Lithuania": "LT",
+ "Luxembourg": "LU",
+ "Luxemburg": "LU",
+ "Macao S.A.R.": "MO",
+ "Macedonia (Former Yugoslav Republic of Macedonia)": "MK",
+ "Magyarország": "HU",
+ "Malaysia": "MY",
+ "Maldives": "MV",
+ "Malta": "MT",
+ "Mexico": "MX",
+ "México": "MX",
+ "Mongolia": "MN",
+ "Montenegro": "ME",
+ "Morocco": "MA",
+ "Nederlân": "NL",
+ "Nederland": "NL",
+ "Němska": "DE",
+ "Nepal": "NP",
+ "Netherlands": "NL",
+ "New Zealand": "NZ",
+ "Nicaragua": "NI",
+ "Nigeria": "NG",
+ "Nijeriya": "NG",
+ "Nimska": "DE",
+ "Nöörje": "NO",
+ "Noreg": "NO",
+ "Norga": "NO",
+ "Norge": "NO",
+ "Norway": "NO",
+ "Oman": "OM",
+ "Österreich": "AT",
+ "O'zbekiston Respublikasi": "UZ",
+ "Panama": "PA",
+ "Panamá": "PA",
+ "Paraguay": "PY",
+ "People's Republic of China": "CN",
+ "Peru": "PE",
+ "Perú": "PE",
+ "Peru Suyu": "PE",
+ "Philippines": "PH",
+ "Pilipinas": "PH",
+ "Poland": "PL",
+ "Polska": "PL",
+ "Portugal": "PT",
+ "Principality of Monaco": "MC",
+ "Principauté de Monaco": "MC",
+ "Qatar": "QA",
+ "Republica Bolivariana de Venezuela": "VE",
+ "República Dominicana": "DO",
+ "Romania": "RO",
+ "România": "RO",
+ "Ruoŧŧa": "SE",
+ "Russia": "RU",
+ "Rwanda": "RW",
+ "Saudi Arabia": "SA",
+ "Schweiz": "CH",
+ "Senegal": "SN",
+ "Sénégal": "SN",
+ "Serbia": "RS",
+ "Serbia and Montenegro (Former)": "CS",
+ "Shqipëria": "AL",
+ "Singapore": "SG",
+ "Slovakia": "SK",
+ "Slovenia": "SI",
+ "Slovenija": "SI",
+ "Slovenská republika": "SK",
+ "South Africa": "ZA",
+ "Spain": "ES",
+ "Srbija": "RS",
+ "Srbija i Crna Gora (Bivša)": "CS",
+ "Sri Lanka": "LK",
+ "Suid Afrika": "ZA",
+ "Suisse": "CH",
+ "Sunugaal": "SN",
+ "Suomâ": "FI",
+ "Suomi": "FI",
+ "Suopma": "FI",
+ "Sveerje": "SE",
+ "Sverige": "SE",
+ "Svierik": "SE",
+ "Svizra": "CH",
+ "Svizzera": "CH",
+ "Sweden": "SE",
+ "Switzerland": "CH",
+ "Syria": "SY",
+ "Tajikistan": "TJ",
+ "Thailand": "TH",
+ "Trinidad and Tobago": "TT",
+ "Tunisia": "TN",
+ "Turkey": "TR",
+ "Türkiye": "TR",
+ "Turkmenistan": "TM",
+ "Türkmenistan": "TM",
+ "U.A.E.": "AE",
+ "Ukraine": "UA",
+ "uMzantsi Afrika": "ZA",
+ "United Kingdom": "GB",
+ "Uruguay": "UY",
+ "Uzbekistan": "UZ",
+ "Việt Nam": "VN",
+ "Vietnam": "VN",
+ "Vuodna": "NO",
+ "Y Deyrnas Unedig": "GB",
+ "Yemen": "YE",
+ "Zimbabwe": "ZW",
+ "Ελλάδα": "GR",
+ "Азәрбајҹан": "AZ",
+ "Беларусь": "BY",
+ "Босна и Херцеговина": "BA",
+ "България": "BG",
+ "Кыргызстан": "KG",
+ "Қазақстан": "KZ",
+ "Македонија": "MK",
+ "Монгол улс": "MN",
+ "Россия": "RU",
+ "Србија": "RS",
+ "Србија и Црна Гора (Бивша)": "CS",
+ "Тоҷикистон": "TJ",
+ "Ўзбекистон Республикаси": "UZ",
+ "Україна": "UA",
+ "Црна Гора": "ME",
+ "Հայաստան": "AM",
+ "საქართველო": "GE",
+ "ישראל": "IL",
+ "افغانستان": "AF",
+ "الأردن": "JO",
+ "الإمارات العربية المتحدة": "AE",
+ "البحرين": "BH",
+ "الجزائر": "DZ",
+ "العراق": "IQ",
+ "الكويت": "KW",
+ "المملكة العربية السعودية": "SA",
+ "المملكة المغربية": "MA",
+ "اليمن": "YE",
+ "ایران": "IR",
+ "پاکستان": "PK",
+ "تونس": "TN",
+ "جۇڭخۇا خەلق جۇمھۇرىيىتى": "CN",
+ "سوريا": "SY",
+ "عمان": "OM",
+ "قطر": "QA",
+ "کوردستان": "IQ",
+ "لبنان": "LB",
+ "ليبيا": "LY",
+ "مصر": "EG",
+ "ܣܘܪܝܐ": "SY",
+ "ދިވެހި ރާއްޖެ": "MV",
+ "नेपाल": "NP",
+ "भारत": "IN",
+ "भारतम्": "IN",
+ "বাংলাদেশ": "BD",
+ "ভারত": "IN",
+ "ভাৰত": "IN",
+ "ਭਾਰਤ": "IN",
+ "ભારત": "IN",
+ "ଭାରତ": "IN",
+ "இந்தியா": "IN",
+ "இலங்கை": "LK",
+ "భారత దేశం": "IN",
+ "ಭಾರತ": "IN",
+ "ഭാരതം": "IN",
+ "ශ්රී ලංකා": "LK",
+ "ไทย": "TH",
+ "ᠪᠦᠭᠦᠳᠡ ᠨᠠᠢᠷᠠᠮᠳᠠᠬᠤ ᠳᠤᠮᠳᠠᠳᠤ ᠠᠷᠠᠳ ᠣᠯᠣᠰ": "CN",
+ "ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།": "CN",
+ "ສປປ ລາວ": "LA",
+ "កម្ពុជា": "KH",
+ "ᑲᓇᑕ": "CA",
+ "ትግርኛ": "ET",
+ "ኢትዮጵያ": "ET",
+ "ꍏꉸꏓꂱꇭꉼꇩ": "CN",
+ "中华人民共和国": "CN",
+ "新加坡": "SG"
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/countryToMapRegion.json b/packages/microsoft.bingweather/resources/countryToMapRegion.json
new file mode 100644
index 00000000..e3343bd6
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/countryToMapRegion.json
@@ -0,0 +1,2256 @@
+{
+ "AF": {
+ "region": "Asia",
+ "bounds": {
+ "North": "38.48",
+ "West": "60.46",
+ "South": "29.37",
+ "East": "74.88"
+ }
+ },
+ "DZ": {
+ "region": "Africa",
+ "bounds": {
+ "North": "37.16",
+ "West": "-8.68",
+ "South": "18.96",
+ "East": "11.98"
+ }
+ },
+ "AO": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-4.37",
+ "West": "11.61",
+ "South": "-18.04",
+ "East": "24.10"
+ }
+ },
+ "BH": {
+ "region": "Asia",
+ "bounds": {
+ "North": "26.42",
+ "West": "50.33",
+ "South": "25.53",
+ "East": "50.85"
+ }
+ },
+ "BJ": {
+ "region": "Africa",
+ "bounds": {
+ "North": "12.42",
+ "West": "0.77",
+ "South": "6.14",
+ "East": "3.85"
+ }
+ },
+ "BW": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-17.69",
+ "West": "20.00",
+ "South": "-26.91",
+ "East": "29.37"
+ }
+ },
+ "BV": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-52.66",
+ "West": "0.66",
+ "South": "-56.38",
+ "East": "5.52"
+ }
+ },
+ "BF": {
+ "region": "Africa",
+ "bounds": {
+ "North": "15.08",
+ "West": "-5.52",
+ "South": "9.40",
+ "East": "2.41"
+ }
+ },
+ "BI": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-2.31",
+ "West": "28.99",
+ "South": "-4.47",
+ "East": "30.86"
+ }
+ },
+ "CM": {
+ "region": "Africa",
+ "bounds": {
+ "North": "13.44",
+ "West": "2.07",
+ "South": "0.73",
+ "East": "22.79"
+ }
+ },
+ "CV": {
+ "region": "Africa",
+ "bounds": {
+ "North": "17.83",
+ "West": "-25.97",
+ "South": "14.42",
+ "East": "-22.30"
+ }
+ },
+ "CF": {
+ "region": "Africa",
+ "bounds": {
+ "North": "11.01",
+ "West": "14.42",
+ "South": "2.22",
+ "East": "27.46"
+ }
+ },
+ "TD": {
+ "region": "Africa",
+ "bounds": {
+ "North": "23.45",
+ "West": "13.47",
+ "South": "7.44",
+ "East": "24.00"
+ }
+ },
+ "KM": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-10.84",
+ "West": "43.05",
+ "South": "-12.71",
+ "East": "44.78"
+ }
+ },
+ "CG": {
+ "region": "Africa",
+ "bounds": {
+ "North": "3.70",
+ "West": "11.17",
+ "South": "-5.05",
+ "East": "18.65"
+ }
+ },
+ "CD": {
+ "region": "Africa",
+ "bounds": {
+ "North": "5.39",
+ "West": "12.18",
+ "South": "-13.46",
+ "East": "31.31"
+ }
+ },
+ "CI": {
+ "region": "Africa",
+ "bounds": {
+ "North": "10.75",
+ "West": "-8.60",
+ "South": "4.29",
+ "East": "-2.49"
+ }
+ },
+ "DJ": {
+ "region": "Africa",
+ "bounds": {
+ "North": "12.71",
+ "West": "41.77",
+ "South": "10.91",
+ "East": "43.48"
+ }
+ },
+ "EG": {
+ "region": "Africa",
+ "bounds": {
+ "North": "31.82",
+ "West": "24.70",
+ "South": "22.00",
+ "East": "36.88"
+ }
+ },
+ "GQ": {
+ "region": "Africa",
+ "bounds": {
+ "North": "3.94",
+ "West": "5.08",
+ "South": "-1.97",
+ "East": "11.34"
+ }
+ },
+ "ER": {
+ "region": "Africa",
+ "bounds": {
+ "North": "18.06",
+ "West": "36.44",
+ "South": "12.36",
+ "East": "43.19"
+ }
+ },
+ "ET": {
+ "region": "Africa",
+ "bounds": {
+ "North": "14.89",
+ "West": "32.98",
+ "South": "3.40",
+ "East": "47.99"
+ }
+ },
+ "TF": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-37.32",
+ "West": "49.24",
+ "South": "-51.59",
+ "East": "78.75"
+ }
+ },
+ "GA": {
+ "region": "Africa",
+ "bounds": {
+ "North": "2.32",
+ "West": "8.67",
+ "South": "-4.04",
+ "East": "14.50"
+ }
+ },
+ "GM": {
+ "region": "Africa",
+ "bounds": {
+ "North": "13.83",
+ "West": "-16.87",
+ "South": "13.04",
+ "East": "-13.80"
+ }
+ },
+ "GH": {
+ "region": "Africa",
+ "bounds": {
+ "North": "11.17",
+ "West": "-3.26",
+ "South": "4.64",
+ "East": "1.23"
+ }
+ },
+ "GN": {
+ "region": "Africa",
+ "bounds": {
+ "North": "12.68",
+ "West": "-15.39",
+ "South": "7.19",
+ "East": "-7.64"
+ }
+ },
+ "GW": {
+ "region": "Africa",
+ "bounds": {
+ "North": "12.68",
+ "West": "-16.77",
+ "South": "10.82",
+ "East": "-13.64"
+ }
+ },
+ "IR": {
+ "region": "Asia",
+ "bounds": {
+ "North": "39.78",
+ "West": "44.03",
+ "South": "25.01",
+ "East": "63.33"
+ }
+ },
+ "IQ": {
+ "region": "Asia",
+ "bounds": {
+ "North": "37.38",
+ "West": "38.79",
+ "South": "29.06",
+ "East": "48.62"
+ }
+ },
+ "IL": {
+ "region": "Asia",
+ "bounds": {
+ "North": "33.33",
+ "West": "34.27",
+ "South": "29.48",
+ "East": "35.90"
+ }
+ },
+ "JO": {
+ "region": "Asia",
+ "bounds": {
+ "North": "33.43",
+ "West": "34.90",
+ "South": "29.18",
+ "East": "39.40"
+ }
+ },
+ "KE": {
+ "region": "Africa",
+ "bounds": {
+ "North": "5.42",
+ "West": "33.91",
+ "South": "-4.76",
+ "East": "41.91"
+ }
+ },
+ "KW": {
+ "region": "Asia",
+ "bounds": {
+ "North": "30.18",
+ "West": "45.98",
+ "South": "28.48",
+ "East": "49.14"
+ }
+ },
+ "LB": {
+ "region": "Asia",
+ "bounds": {
+ "North": "34.71",
+ "West": "34.87",
+ "South": "33.05",
+ "East": "36.64"
+ }
+ },
+ "LS": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-28.57",
+ "West": "27.01",
+ "South": "-30.67",
+ "East": "29.47"
+ }
+ },
+ "LR": {
+ "region": "Africa",
+ "bounds": {
+ "North": "8.55",
+ "West": "-11.56",
+ "South": "4.29",
+ "East": "-7.37"
+ }
+ },
+ "LY": {
+ "region": "Africa",
+ "bounds": {
+ "North": "33.29",
+ "West": "9.38",
+ "South": "19.51",
+ "East": "25.36"
+ }
+ },
+ "MG": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-11.87",
+ "West": "43.12",
+ "South": "-25.64",
+ "East": "50.56"
+ }
+ },
+ "MW": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-9.37",
+ "West": "32.67",
+ "South": "-17.13",
+ "East": "35.92"
+ }
+ },
+ "ML": {
+ "region": "Africa",
+ "bounds": {
+ "North": "25.00",
+ "West": "-12.24",
+ "South": "10.15",
+ "East": "4.24"
+ }
+ },
+ "MR": {
+ "region": "Africa",
+ "bounds": {
+ "North": "27.31",
+ "West": "-17.07",
+ "South": "14.72",
+ "East": "-4.82"
+ }
+ },
+ "MU": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-19.61",
+ "West": "56.44",
+ "South": "-21.02",
+ "East": "58.89"
+ }
+ },
+ "YT": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-12.47",
+ "West": "44.87",
+ "South": "-13.15",
+ "East": "45.42"
+ }
+ },
+ "MA": {
+ "region": "Africa",
+ "bounds": {
+ "North": "36.33",
+ "West": "-25.12",
+ "South": "20.71",
+ "East": "3.64"
+ }
+ },
+ "MZ": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-10.39",
+ "West": "30.21",
+ "South": "-26.87",
+ "East": "40.89"
+ }
+ },
+ "NA": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-16.96",
+ "West": "11.66",
+ "South": "-28.97",
+ "East": "25.26"
+ }
+ },
+ "NE": {
+ "region": "Africa",
+ "bounds": {
+ "North": "23.53",
+ "West": "0.17",
+ "South": "11.70",
+ "East": "16.00"
+ }
+ },
+ "NG": {
+ "region": "Africa",
+ "bounds": {
+ "North": "13.89",
+ "West": "2.67",
+ "South": "4.24",
+ "East": "14.68"
+ }
+ },
+ "OM": {
+ "region": "Asia",
+ "bounds": {
+ "North": "26.57",
+ "West": "52.00",
+ "South": "16.61",
+ "East": "59.89"
+ }
+ },
+ "PK": {
+ "region": "Asia",
+ "bounds": {
+ "North": "37.10",
+ "West": "60.88",
+ "South": "23.56",
+ "East": "79.30"
+ }
+ },
+ "PS": {
+ "region": "Asia",
+ "bounds": {
+ "North": "0.00",
+ "West": "0.00",
+ "South": "0.00",
+ "East": "0.00"
+ }
+ },
+ "QA": {
+ "region": "Asia",
+ "bounds": {
+ "North": "26.28",
+ "West": "50.71",
+ "South": "24.47",
+ "East": "52.50"
+ }
+ },
+ "RE": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-20.45",
+ "West": "54.31",
+ "South": "-21.93",
+ "East": "56.88"
+ }
+ },
+ "RW": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-1.05",
+ "West": "28.86",
+ "South": "-2.84",
+ "East": "30.90"
+ }
+ },
+ "ST": {
+ "region": "Africa",
+ "bounds": {
+ "North": "2.07",
+ "West": "6.18",
+ "South": "-0.28",
+ "East": "7.80"
+ }
+ },
+ "SA": {
+ "region": "Asia",
+ "bounds": {
+ "North": "32.15",
+ "West": "34.41",
+ "South": "15.89",
+ "East": "55.67"
+ }
+ },
+ "SN": {
+ "region": "Africa",
+ "bounds": {
+ "North": "16.69",
+ "West": "-17.60",
+ "South": "12.24",
+ "East": "-11.36"
+ }
+ },
+ "SC": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-3.44",
+ "West": "53.98",
+ "South": "-5.52",
+ "East": "57.36"
+ }
+ },
+ "SL": {
+ "region": "Africa",
+ "bounds": {
+ "North": "10.00",
+ "West": "-13.36",
+ "South": "6.88",
+ "East": "-10.28"
+ }
+ },
+ "SO": {
+ "region": "Africa",
+ "bounds": {
+ "North": "12.05",
+ "West": "40.99",
+ "South": "-1.69",
+ "East": "51.48"
+ }
+ },
+ "ZA": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-21.98",
+ "West": "12.90",
+ "South": "-35.14",
+ "East": "37.14"
+ }
+ },
+ "SS": {
+ "region": "Africa",
+ "bounds": {
+ "North": "12.23",
+ "West": "24.15",
+ "South": "3.49",
+ "East": "35.34"
+ }
+ },
+ "SH": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-7.83",
+ "West": "-14.50",
+ "South": "-8.08",
+ "East": "-14.22"
+ }
+ },
+ "SD": {
+ "region": "Africa",
+ "bounds": {
+ "North": "23.15",
+ "West": "21.84",
+ "South": "8.68",
+ "East": "38.90"
+ }
+ },
+ "SZ": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-25.72",
+ "West": "30.79",
+ "South": "-27.32",
+ "East": "32.14"
+ }
+ },
+ "SY": {
+ "region": "Asia",
+ "bounds": {
+ "North": "37.32",
+ "West": "35.45",
+ "South": "32.31",
+ "East": "42.39"
+ }
+ },
+ "TZ": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-0.98",
+ "West": "29.33",
+ "South": "-11.76",
+ "East": "40.51"
+ }
+ },
+ "TG": {
+ "region": "Africa",
+ "bounds": {
+ "North": "11.14",
+ "West": "-0.15",
+ "South": "6.06",
+ "East": "1.81"
+ }
+ },
+ "TN": {
+ "region": "Africa",
+ "bounds": {
+ "North": "37.60",
+ "West": "7.52",
+ "South": "30.23",
+ "East": "11.61"
+ }
+ },
+ "TR": {
+ "region": "Asia",
+ "bounds": {
+ "North": "42.14",
+ "West": "25.56",
+ "South": "35.81",
+ "East": "44.83"
+ }
+ },
+ "UG": {
+ "region": "Africa",
+ "bounds": {
+ "North": "4.23",
+ "West": "29.57",
+ "South": "-1.48",
+ "East": "35.04"
+ }
+ },
+ "AE": {
+ "region": "Asia",
+ "bounds": {
+ "North": "26.11",
+ "West": "51.42",
+ "South": "22.63",
+ "East": "56.43"
+ }
+ },
+ "YE": {
+ "region": "Asia",
+ "bounds": {
+ "North": "19.00",
+ "West": "41.75",
+ "South": "11.99",
+ "East": "54.80"
+ }
+ },
+ "ZM": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-8.20",
+ "West": "21.99",
+ "South": "-18.08",
+ "East": "33.71"
+ }
+ },
+ "ZW": {
+ "region": "Africa",
+ "bounds": {
+ "North": "-15.61",
+ "West": "25.24",
+ "South": "-22.42",
+ "East": "33.07"
+ }
+ },
+ "AM": {
+ "region": "Asia",
+ "bounds": {
+ "North": "41.30",
+ "West": "43.45",
+ "South": "38.83",
+ "East": "46.63"
+ }
+ },
+ "AZ": {
+ "region": "Asia",
+ "bounds": {
+ "North": "41.93",
+ "West": "44.76",
+ "South": "38.39",
+ "East": "50.91"
+ }
+ },
+ "BD": {
+ "region": "Asia",
+ "bounds": {
+ "North": "26.63",
+ "West": "88.01",
+ "South": "20.54",
+ "East": "92.67"
+ }
+ },
+ "BT": {
+ "region": "Asia",
+ "bounds": {
+ "North": "28.32",
+ "West": "88.76",
+ "South": "26.70",
+ "East": "92.13"
+ }
+ },
+ "IO": {
+ "region": "Asia",
+ "bounds": {
+ "North": "-4.57",
+ "West": "70.12",
+ "South": "-8.02",
+ "East": "73.80"
+ }
+ },
+ "BN": {
+ "region": "Asia",
+ "bounds": {
+ "North": "5.06",
+ "West": "113.81",
+ "South": "3.94",
+ "East": "115.61"
+ }
+ },
+ "KH": {
+ "region": "Asia",
+ "bounds": {
+ "North": "14.69",
+ "West": "102.34",
+ "South": "9.42",
+ "East": "107.63"
+ }
+ },
+ "CN": {
+ "region": "Asia",
+ "bounds": {
+ "North": "55.91",
+ "West": "61.82",
+ "South": "16.49",
+ "East": "140.85"
+ }
+ },
+ "CX": {
+ "region": "Asia",
+ "bounds": {
+ "North": "-9.61",
+ "West": "105.04",
+ "South": "-11.01",
+ "East": "106.05"
+ }
+ },
+ "CC": {
+ "region": "Asia",
+ "bounds": {
+ "North": "-11.44",
+ "West": "96.32",
+ "South": "-12.65",
+ "East": "97.46"
+ }
+ },
+ "GE": {
+ "region": "Asia",
+ "bounds": {
+ "North": "43.59",
+ "West": "40.01",
+ "South": "41.05",
+ "East": "46.74"
+ }
+ },
+ "HK": {
+ "region": "Asia",
+ "bounds": {
+ "North": "22.62",
+ "West": "113.62",
+ "South": "21.83",
+ "East": "114.50"
+ }
+ },
+ "IN": {
+ "region": "Asia",
+ "bounds": {
+ "North": "37.10",
+ "West": "68.10",
+ "South": "8.0",
+ "East": "97.40"
+ }
+ },
+ "ID": {
+ "region": "Asia",
+ "bounds": {
+ "North": "6.37",
+ "West": "94.74",
+ "South": "-11.69",
+ "East": "141.02"
+ }
+ },
+ "JP": {
+ "region": "Asia",
+ "bounds": {
+ "North": "45.72",
+ "West": "114.02",
+ "South": "25.30",
+ "East": "154.62"
+ }
+ },
+ "KZ": {
+ "region": "Asia",
+ "bounds": {
+ "North": "55.44",
+ "West": "46.49",
+ "South": "40.57",
+ "East": "87.32"
+ }
+ },
+ "KR": {
+ "region": "Asia",
+ "bounds": {
+ "North": "38.65",
+ "West": "124.58",
+ "South": "33.10",
+ "East": "131.09"
+ }
+ },
+ "KG": {
+ "region": "Asia",
+ "bounds": {
+ "North": "43.24",
+ "West": "69.28",
+ "South": "39.17",
+ "East": "80.28"
+ }
+ },
+ "LA": {
+ "region": "Asia",
+ "bounds": {
+ "North": "22.50",
+ "West": "100.08",
+ "South": "13.91",
+ "East": "107.70"
+ }
+ },
+ "MO": {
+ "region": "Asia",
+ "bounds": {
+ "North": "22.45",
+ "West": "113.09",
+ "South": "21.93",
+ "East": "114.00"
+ }
+ },
+ "MY": {
+ "region": "Asia",
+ "bounds": {
+ "North": "7.57",
+ "West": "98.78",
+ "South": "0.86",
+ "East": "119.57"
+ }
+ },
+ "MV": {
+ "region": "Asia",
+ "bounds": {
+ "North": "7.49",
+ "West": "71.57",
+ "South": "-1.40",
+ "East": "74.31"
+ }
+ },
+ "MN": {
+ "region": "Asia",
+ "bounds": {
+ "North": "52.15",
+ "West": "87.75",
+ "South": "41.57",
+ "East": "119.92"
+ }
+ },
+ "MM": {
+ "region": "Asia",
+ "bounds": {
+ "North": "28.54",
+ "West": "92.19",
+ "South": "9.52",
+ "East": "101.18"
+ }
+ },
+ "NP": {
+ "region": "Asia",
+ "bounds": {
+ "North": "30.45",
+ "West": "80.06",
+ "South": "26.35",
+ "East": "88.20"
+ }
+ },
+ "KP": {
+ "region": "Asia",
+ "bounds": {
+ "North": "43.01",
+ "West": "124.15",
+ "South": "37.59",
+ "East": "130.72"
+ }
+ },
+ "PH": {
+ "region": "Asia",
+ "bounds": {
+ "North": "18.89",
+ "West": "111.60",
+ "South": "5.39",
+ "East": "133.96"
+ }
+ },
+ "SG": {
+ "region": "Asia",
+ "bounds": {
+ "North": "1.99",
+ "West": "102.73",
+ "South": "0.61",
+ "East": "104.97"
+ }
+ },
+ "LK": {
+ "region": "Asia",
+ "bounds": {
+ "North": "10.15",
+ "West": "79.42",
+ "South": "5.51",
+ "East": "82.30"
+ }
+ },
+ "TW": {
+ "region": "Asia",
+ "bounds": {
+ "North": "26.44",
+ "West": "118.26",
+ "South": "21.83",
+ "East": "122.19"
+ }
+ },
+ "TJ": {
+ "region": "Asia",
+ "bounds": {
+ "North": "41.04",
+ "West": "67.39",
+ "South": "36.67",
+ "East": "75.14"
+ }
+ },
+ "TH": {
+ "region": "Asia",
+ "bounds": {
+ "North": "20.46",
+ "West": "97.34",
+ "South": "5.61",
+ "East": "105.64"
+ }
+ },
+ "TL": {
+ "region": "Asia",
+ "bounds": {
+ "North": "-8.03",
+ "West": "124.03",
+ "South": "-9.59",
+ "East": "127.43"
+ }
+ },
+ "TM": {
+ "region": "Asia",
+ "bounds": {
+ "North": "42.80",
+ "West": "52.42",
+ "South": "35.14",
+ "East": "66.68"
+ }
+ },
+ "UZ": {
+ "region": "Asia",
+ "bounds": {
+ "North": "45.61",
+ "West": "56.00",
+ "South": "37.18",
+ "East": "73.13"
+ }
+ },
+ "VN": {
+ "region": "Asia",
+ "bounds": {
+ "North": "23.39",
+ "West": "102.14",
+ "South": "8.36",
+ "East": "109.52"
+ }
+ },
+ "AS": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-10.92",
+ "West": "-171.19",
+ "South": "-14.69",
+ "East": "-168.05"
+ }
+ },
+ "AU": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-10.68",
+ "West": "101.40",
+ "South": "-44.08",
+ "East": "162.24"
+ }
+ },
+ "CK": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-7.45",
+ "West": "-167.08",
+ "South": "-24.80",
+ "East": "-156.48"
+ }
+ },
+ "FJ": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-16.03",
+ "West": "176.07",
+ "South": "-19.21",
+ "East": "-178.53"
+ }
+ },
+ "PF": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "10.50",
+ "West": "-155.90",
+ "South": "-29.04",
+ "East": "-109.00"
+ }
+ },
+ "GU": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "13.77",
+ "West": "144.17",
+ "South": "13.05",
+ "East": "145.37"
+ }
+ },
+ "HM": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-51.90",
+ "West": "71.34",
+ "South": "-54.93",
+ "East": "75.58"
+ }
+ },
+ "KI": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "12.51",
+ "West": "170.59",
+ "South": "-7.51",
+ "East": "-156.97"
+ }
+ },
+ "MH": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "14.04",
+ "West": "159.90",
+ "South": "5.92",
+ "East": "173.24"
+ }
+ },
+ "FM": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "12.19",
+ "West": "136.69",
+ "South": "0.46",
+ "East": "171.69"
+ }
+ },
+ "NR": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-0.25",
+ "West": "166.61",
+ "South": "-1.04",
+ "East": "167.24"
+ }
+ },
+ "NC": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-17.00",
+ "West": "157.50",
+ "South": "-23.82",
+ "East": "172.65"
+ }
+ },
+ "NZ": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-33.00",
+ "West": "164.80",
+ "South": "-47.60",
+ "East": "178.90"
+ }
+ },
+ "NU": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-17.88",
+ "West": "-170.85",
+ "South": "-20.19",
+ "East": "-168.81"
+ }
+ },
+ "NF": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-28.68",
+ "West": "167.90",
+ "South": "-29.19",
+ "East": "168.36"
+ }
+ },
+ "MP": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "21.38",
+ "West": "142.85",
+ "South": "13.99",
+ "East": "146.90"
+ }
+ },
+ "PW": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "8.15",
+ "West": "133.44",
+ "South": "6.85",
+ "East": "135.56"
+ }
+ },
+ "PG": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "0.50",
+ "West": "140.80",
+ "South": "-12.21",
+ "East": "160.26"
+ }
+ },
+ "PN": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-22.82",
+ "West": "-131.50",
+ "South": "-25.91",
+ "East": "-123.49"
+ }
+ },
+ "WS": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-13.30",
+ "West": "-172.93",
+ "South": "-14.18",
+ "East": "-171.24"
+ }
+ },
+ "SB": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-4.83",
+ "West": "155.02",
+ "South": "-13.00",
+ "East": "171.02"
+ }
+ },
+ "TK": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-6.70",
+ "West": "-174.62",
+ "South": "-12.12",
+ "East": "-169.17"
+ }
+ },
+ "TO": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-14.77",
+ "West": "-177.59",
+ "South": "-22.94",
+ "East": "-171.89"
+ }
+ },
+ "TV": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-3.96",
+ "West": "171.82",
+ "South": "-11.99",
+ "East": "180.00"
+ }
+ },
+ "VU": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-13.00",
+ "West": "163.53",
+ "South": "-22.28",
+ "East": "172.65"
+ }
+ },
+ "WF": {
+ "region": "PacificIslands",
+ "bounds": {
+ "North": "-9.54",
+ "West": "175.90",
+ "South": "-18.06",
+ "East": "-169.90"
+ }
+ },
+ "AX": {
+ "region": "Europe",
+ "bounds": {
+ "North": "60.43",
+ "West": "19.63",
+ "South": "59.97",
+ "East": "20.30"
+ }
+ },
+ "AL": {
+ "region": "Europe",
+ "bounds": {
+ "North": "42.67",
+ "West": "19.23",
+ "South": "39.64",
+ "East": "21.07"
+ }
+ },
+ "AD": {
+ "region": "Europe",
+ "bounds": {
+ "North": "42.66",
+ "West": "1.41",
+ "South": "42.43",
+ "East": "1.79"
+ }
+ },
+ "AT": {
+ "region": "Europe",
+ "bounds": {
+ "North": "49.42",
+ "West": "9.18",
+ "South": "45.96",
+ "East": "17.50"
+ }
+ },
+ "BY": {
+ "region": "Europe",
+ "bounds": {
+ "North": "56.17",
+ "West": "23.18",
+ "South": "51.26",
+ "East": "32.78"
+ }
+ },
+ "BE": {
+ "region": "Europe",
+ "bounds": {
+ "North": "51.51",
+ "West": "2.51",
+ "South": "49.49",
+ "East": "6.41"
+ }
+ },
+ "BA": {
+ "region": "Europe",
+ "bounds": {
+ "North": "45.40",
+ "West": "14.47",
+ "South": "42.38",
+ "East": "21.23"
+ }
+ },
+ "BG": {
+ "region": "Europe",
+ "bounds": {
+ "North": "44.23",
+ "West": "22.36",
+ "South": "41.24",
+ "East": "28.66"
+ }
+ },
+ "HR": {
+ "region": "Europe",
+ "bounds": {
+ "North": "46.55",
+ "West": "13.43",
+ "South": "42.31",
+ "East": "19.45"
+ }
+ },
+ "CY": {
+ "region": "Europe",
+ "bounds": {
+ "North": "35.90",
+ "West": "31.73",
+ "South": "34.39",
+ "East": "34.87"
+ }
+ },
+ "CZ": {
+ "region": "Europe",
+ "bounds": {
+ "North": "51.13",
+ "West": "12.14",
+ "South": "48.45",
+ "East": "18.87"
+ }
+ },
+ "DK": {
+ "region": "Europe",
+ "bounds": {
+ "North": "58.08",
+ "West": "5.63",
+ "South": "54.40",
+ "East": "16.36"
+ }
+ },
+ "EE": {
+ "region": "Europe",
+ "bounds": {
+ "North": "59.74",
+ "West": "21.68",
+ "South": "57.51",
+ "East": "28.21"
+ }
+ },
+ "FO": {
+ "region": "Europe",
+ "bounds": {
+ "North": "62.53",
+ "West": "-7.82",
+ "South": "61.05",
+ "East": "-6.20"
+ }
+ },
+ "FI": {
+ "region": "Europe",
+ "bounds": {
+ "North": "70.10",
+ "West": "19.26",
+ "South": "59.69",
+ "East": "31.59"
+ }
+ },
+ "FR": {
+ "region": "Europe",
+ "bounds": {
+ "North": "51.10",
+ "West": "-5.25",
+ "South": "41.30",
+ "East": "9.60"
+ }
+ },
+ "DE": {
+ "region": "Europe",
+ "bounds": {
+ "North": "55.10",
+ "West": "5.87",
+ "South": "47.27",
+ "East": "15.04"
+ }
+ },
+ "GI": {
+ "region": "Europe",
+ "bounds": {
+ "North": "36.16",
+ "West": "-5.37",
+ "South": "36.11",
+ "East": "-5.33"
+ }
+ },
+ "GR": {
+ "region": "Europe",
+ "bounds": {
+ "North": "41.81",
+ "West": "17.14",
+ "South": "34.89",
+ "East": "31.42"
+ }
+ },
+ "GG": {
+ "region": "Europe",
+ "bounds": {
+ "North": "49.77",
+ "West": "-2.73",
+ "South": "49.38",
+ "East": "-2.13"
+ }
+ },
+ "HU": {
+ "region": "Europe",
+ "bounds": {
+ "North": "48.59",
+ "West": "16.11",
+ "South": "45.74",
+ "East": "22.90"
+ }
+ },
+ "IS": {
+ "region": "Europe",
+ "bounds": {
+ "North": "66.71",
+ "West": "-25.57",
+ "South": "63.25",
+ "East": "-12.32"
+ }
+ },
+ "IE": {
+ "region": "Europe",
+ "bounds": {
+ "North": "55.45",
+ "West": "-10.67",
+ "South": "51.38",
+ "East": "-5.99"
+ }
+ },
+ "IM": {
+ "region": "Europe",
+ "bounds": {
+ "North": "54.45",
+ "West": "-4.86",
+ "South": "54.01",
+ "East": "-4.28"
+ }
+ },
+ "IT": {
+ "region": "Europe",
+ "bounds": {
+ "North": "47.07",
+ "West": "1.23",
+ "South": "36.68",
+ "East": "23.81"
+ }
+ },
+ "SJ": [
+ {
+ "region": "Europe",
+ "bounds": {
+ "North": "71.32",
+ "West": "-9.14",
+ "South": "70.50",
+ "East": "-7.48"
+ }
+ },
+ {
+ "region": "Europe",
+ "bounds": {
+ "North": "82.45",
+ "West": "8.82",
+ "South": "73.57",
+ "East": "36.82"
+ }
+ }
+ ],
+ "JE": {
+ "region": "Europe",
+ "bounds": {
+ "North": "49.33",
+ "West": "-2.32",
+ "South": "49.12",
+ "East": "-1.92"
+ }
+ },
+ "LV": {
+ "region": "Europe",
+ "bounds": {
+ "North": "58.09",
+ "West": "20.91",
+ "South": "55.67",
+ "East": "28.24"
+ }
+ },
+ "LI": {
+ "region": "Europe",
+ "bounds": {
+ "North": "47.27",
+ "West": "9.47",
+ "South": "47.05",
+ "East": "9.64"
+ }
+ },
+ "LT": {
+ "region": "Europe",
+ "bounds": {
+ "North": "56.45",
+ "West": "20.91",
+ "South": "53.90",
+ "East": "26.84"
+ }
+ },
+ "LU": {
+ "region": "Europe",
+ "bounds": {
+ "North": "50.18",
+ "West": "5.73",
+ "South": "49.45",
+ "East": "6.53"
+ }
+ },
+ "MK": {
+ "region": "Europe",
+ "bounds": {
+ "North": "42.37",
+ "West": "20.46",
+ "South": "40.85",
+ "East": "23.04"
+ }
+ },
+ "MT": {
+ "region": "Europe",
+ "bounds": {
+ "North": "36.15",
+ "West": "14.12",
+ "South": "35.70",
+ "East": "14.65"
+ }
+ },
+ "MD": {
+ "region": "Europe",
+ "bounds": {
+ "North": "48.49",
+ "West": "26.62",
+ "South": "45.47",
+ "East": "30.16"
+ }
+ },
+ "MC": {
+ "region": "Europe",
+ "bounds": {
+ "North": "43.76",
+ "West": "7.40",
+ "South": "43.71",
+ "East": "7.47"
+ }
+ },
+ "ME": {
+ "region": "Europe",
+ "bounds": {
+ "North": "43.54",
+ "West": "18.43",
+ "South": "41.79",
+ "East": "20.38"
+ }
+ },
+ "NL": {
+ "region": "Europe",
+ "bounds": {
+ "North": "53.53",
+ "West": "1.61",
+ "South": "50.76",
+ "East": "8.91"
+ }
+ },
+ "NO": {
+ "region": "Europe",
+ "bounds": {
+ "North": "71.28",
+ "West": "-7.00",
+ "South": "58.29",
+ "East": "42.34"
+ }
+ },
+ "PL": {
+ "region": "Europe",
+ "bounds": {
+ "North": "54.89",
+ "West": "14.12",
+ "South": "49.00",
+ "East": "24.15"
+ }
+ },
+ "PT": {
+ "region": "Europe",
+ "bounds": {
+ "North": "42.17",
+ "West": "-13.62",
+ "South": "36.87",
+ "East": "-2.50"
+ }
+ },
+ "RO": {
+ "region": "Europe",
+ "bounds": {
+ "North": "48.27",
+ "West": "20.26",
+ "South": "43.62",
+ "East": "29.76"
+ }
+ },
+ "RU": {
+ "region": "Asia",
+ "bounds": {
+ "North": "78.12",
+ "West": "24.07",
+ "South": "38.35",
+ "East": "178.89"
+ }
+ },
+ "SM": {
+ "region": "Europe",
+ "bounds": {
+ "North": "44.00",
+ "West": "12.40",
+ "South": "43.89",
+ "East": "12.52"
+ }
+ },
+ "RS": {
+ "region": "Europe",
+ "bounds": {
+ "North": "46.28",
+ "West": "15.77",
+ "South": "41.70",
+ "East": "26.05"
+ }
+ },
+ "SK": {
+ "region": "Europe",
+ "bounds": {
+ "North": "50.41",
+ "West": "15.44",
+ "South": "46.95",
+ "East": "23.93"
+ }
+ },
+ "SI": {
+ "region": "Europe",
+ "bounds": {
+ "North": "47.02",
+ "West": "13.30",
+ "South": "45.31",
+ "East": "16.79"
+ }
+ },
+ "ES": {
+ "region": "Europe",
+ "bounds": {
+ "North": "44.06",
+ "West": "-11.45",
+ "South": "35.80",
+ "East": "5.95"
+ }
+ },
+ "SE": {
+ "region": "Europe",
+ "bounds": {
+ "North": "69.23",
+ "West": "-6.77",
+ "South": "55.38",
+ "East": "41.44"
+ }
+ },
+ "CH": {
+ "region": "Europe",
+ "bounds": {
+ "North": "47.81",
+ "West": "5.96",
+ "South": "45.82",
+ "East": "10.49"
+ }
+ },
+ "UA": {
+ "region": "Europe",
+ "bounds": {
+ "North": "52.38",
+ "West": "22.14",
+ "South": "44.32",
+ "East": "40.22"
+ }
+ },
+ "GB": {
+ "region": "Europe",
+ "bounds": {
+ "North": "60.78",
+ "West": "-18.28",
+ "South": "49.96",
+ "East": "12.54"
+ }
+ },
+ "VA": {
+ "region": "Europe",
+ "bounds": {
+ "North": "41.92",
+ "West": "12.43",
+ "South": "41.89",
+ "East": "12.48"
+ }
+ },
+ "AI": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.65",
+ "West": "-63.46",
+ "South": "18.07",
+ "East": "-62.77"
+ }
+ },
+ "AG": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "17.80",
+ "West": "-62.41",
+ "South": "16.86",
+ "East": "-61.60"
+ }
+ },
+ "AW": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "12.76",
+ "West": "-70.41",
+ "South": "12.24",
+ "East": "-69.54"
+ }
+ },
+ "BS": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "27.63",
+ "West": "-81.33",
+ "South": "20.42",
+ "East": "-72.46"
+ }
+ },
+ "BB": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "13.44",
+ "West": "-59.71",
+ "South": "12.97",
+ "East": "-59.38"
+ }
+ },
+ "BZ": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.50",
+ "West": "-89.23",
+ "South": "15.89",
+ "East": "-87.38"
+ }
+ },
+ "BM": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "32.53",
+ "West": "-65.04",
+ "South": "32.16",
+ "East": "-64.56"
+ }
+ },
+ "BQ": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "12.69",
+ "West": "-68.78",
+ "South": "11.86",
+ "East": "-68.01"
+ }
+ },
+ "VG": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.79",
+ "West": "-64.88",
+ "South": "18.30",
+ "East": "-64.20"
+ }
+ },
+ "CA": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "73.00",
+ "West": "-142.10",
+ "South": "40.90",
+ "East": "-51.90"
+ }
+ },
+ "KY": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "19.94",
+ "West": "-81.71",
+ "South": "19.04",
+ "East": "-79.35"
+ }
+ },
+ "CR": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "11.40",
+ "West": "-87.15",
+ "South": "7.88",
+ "East": "-81.37"
+ }
+ },
+ "CU": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "23.74",
+ "West": "-85.30",
+ "South": "19.52",
+ "East": "-73.83"
+ }
+ },
+ "CW": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "12.82",
+ "West": "-69.48",
+ "South": "11.86",
+ "East": "-68.53"
+ }
+ },
+ "DM": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "15.76",
+ "West": "-61.93",
+ "South": "15.07",
+ "East": "-60.77"
+ }
+ },
+ "DO": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "20.01",
+ "West": "-72.01",
+ "South": "17.30",
+ "East": "-68.09"
+ }
+ },
+ "SV": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "14.45",
+ "West": "-90.20",
+ "South": "12.99",
+ "East": "-87.61"
+ }
+ },
+ "GL": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "74.77",
+ "West": "-76.06",
+ "South": "59.32",
+ "East": "-11.97"
+ }
+ },
+ "GD": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "12.56",
+ "West": "-61.90",
+ "South": "11.89",
+ "East": "-61.27"
+ }
+ },
+ "GP": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "16.69",
+ "West": "-61.90",
+ "South": "15.72",
+ "East": "-60.97"
+ }
+ },
+ "GT": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "17.82",
+ "West": "-92.28",
+ "South": "13.65",
+ "East": "-88.17"
+ }
+ },
+ "HT": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "20.33",
+ "West": "-74.63",
+ "South": "17.87",
+ "East": "-71.61"
+ }
+ },
+ "HN": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "17.51",
+ "West": "-89.36",
+ "South": "12.98",
+ "East": "-82.10"
+ }
+ },
+ "JM": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.95",
+ "West": "-78.69",
+ "South": "17.31",
+ "East": "-75.89"
+ }
+ },
+ "MQ": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "14.97",
+ "West": "-61.31",
+ "South": "14.27",
+ "East": "-60.58"
+ }
+ },
+ "MX": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "35.27",
+ "West": "-119.70",
+ "South": "14.49",
+ "East": "-82.64"
+ }
+ },
+ "MS": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "16.87",
+ "West": "-62.28",
+ "South": "16.59",
+ "East": "-62.10"
+ }
+ },
+ "NI": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "15.03",
+ "West": "-87.78",
+ "South": "10.71",
+ "East": "-82.48"
+ }
+ },
+ "PA": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "9.72",
+ "West": "-83.05",
+ "South": "7.08",
+ "East": "-77.16"
+ }
+ },
+ "PR": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.77",
+ "West": "-68.09",
+ "South": "17.74",
+ "East": "-65.16"
+ }
+ },
+ "XS": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "17.73",
+ "West": "-63.34",
+ "South": "17.53",
+ "East": "-63.13"
+ }
+ },
+ "BL": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.10",
+ "West": "-62.98",
+ "South": "17.81",
+ "East": "-62.68"
+ }
+ },
+ "XE": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "17.60",
+ "West": "-63.07",
+ "South": "17.42",
+ "East": "-62.86"
+ }
+ },
+ "SX": [
+ {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.10",
+ "West": "-63.11",
+ "South": "18.04",
+ "East": "-63.03"
+ }
+ },
+ {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.10",
+ "West": "-63.11",
+ "South": "18.04",
+ "East": "-63.03"
+ }
+ }
+ ],
+ "LC": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "14.16",
+ "West": "-61.16",
+ "South": "13.58",
+ "East": "-60.77"
+ }
+ },
+ "MF": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "30.50",
+ "West": "-91.99",
+ "South": "29.70",
+ "East": "-91.09"
+ }
+ },
+ "PM": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "47.23",
+ "West": "-56.73",
+ "South": "46.56",
+ "East": "-55.90"
+ }
+ },
+ "VC": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "13.54",
+ "West": "-61.51",
+ "South": "12.50",
+ "East": "-60.86"
+ }
+ },
+ "TT": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "11.55",
+ "West": "-62.02",
+ "South": "9.95",
+ "East": "-60.34"
+ }
+ },
+ "TC": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "22.11",
+ "West": "-72.62",
+ "South": "20.83",
+ "East": "-70.79"
+ }
+ },
+ "US": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "48.05",
+ "West": "-125.81",
+ "South": "26.56",
+ "East": "-73.69"
+ }
+ },
+ "VI": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "18.46",
+ "West": "-65.13",
+ "South": "17.60",
+ "East": "-64.45"
+ }
+ },
+ "AR": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-21.78",
+ "West": "-74.00",
+ "South": "-55.00",
+ "East": "-40.00"
+ }
+ },
+ "BO": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-9.67",
+ "West": "-69.64",
+ "South": "-22.91",
+ "East": "-57.45"
+ }
+ },
+ "BR": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "5.27",
+ "West": "-73.99",
+ "South": "-33.78",
+ "East": "-27.20"
+ }
+ },
+ "CL": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-17.45",
+ "West": "-108.89",
+ "South": "-55.79",
+ "East": "-31.59"
+ }
+ },
+ "CO": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "16.02",
+ "West": "-82.34",
+ "South": "-4.23",
+ "East": "-66.85"
+ }
+ },
+ "EC": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "1.53",
+ "West": "-83.67",
+ "South": "-5.03",
+ "East": "-73.05"
+ }
+ },
+ "FK": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-50.94",
+ "West": "-61.53",
+ "South": "-52.97",
+ "East": "-57.62"
+ }
+ },
+ "GF": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "6.08",
+ "West": "-54.60",
+ "South": "2.11",
+ "East": "-51.55"
+ }
+ },
+ "GY": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "9.40",
+ "West": "-66.07",
+ "South": "0.39",
+ "East": "-51.44"
+ }
+ },
+ "PY": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-19.29",
+ "West": "-62.65",
+ "South": "-27.61",
+ "East": "-54.26"
+ }
+ },
+ "PE": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-0.01",
+ "West": "-81.40",
+ "South": "-18.39",
+ "East": "-68.65"
+ }
+ },
+ "GS": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-52.23",
+ "West": "-42.79",
+ "South": "-59.95",
+ "East": "-26.00"
+ }
+ },
+ "SR": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "6.31",
+ "West": "-58.07",
+ "South": "1.83",
+ "East": "-53.87"
+ }
+ },
+ "UY": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "-30.08",
+ "West": "-58.49",
+ "South": "-35.63",
+ "East": "-53.07"
+ }
+ },
+ "VE": {
+ "region": "SouthAmerica",
+ "bounds": {
+ "North": "15.72",
+ "West": "-73.38",
+ "South": "0.63",
+ "East": "-59.74"
+ }
+ },
+ "KN": {
+ "region": "NorthAmerica",
+ "bounds": {
+ "North": "17.47",
+ "West": "-62.91",
+ "South": "17.00",
+ "East": "-62.34"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/de-at.json b/packages/microsoft.bingweather/resources/de-at.json
new file mode 100644
index 00000000..8ac4112c
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/de-at.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "3079",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharisch",
+ "Language_ar": "Arabisch",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamesisch",
+ "Language_az": "Aseri (Lateinisch)",
+ "Language_az-Cyrl": "Aserbaidschanisch (Kyrillisch)",
+ "Language_az-Latn": "Aserbaidschanisch (Lateinisch)",
+ "Language_ba-Cyrl": "Baschkirisch",
+ "Language_be": "Belarussisch",
+ "Language_bg": "Bulgarisch",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesch)",
+ "Language_bn-in": "Bangla (Indien)",
+ "Language_br-Latn": "Bretonisch",
+ "Language_bs": "Bosnisch (Lateinisch)",
+ "Language_bs-Cyrl": "Bosnisch (Kyrillisch)",
+ "Language_bs-Latn": "Bosnisch (Lateinisch)",
+ "Language_ca": "Katalanisch",
+ "Language_ca-ES-valencia": "Valencianisch",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Korsisch",
+ "Language_cs": "Tschechisch",
+ "Language_cy": "Walisisch",
+ "Language_da": "Dänisch",
+ "Language_de": "Deutsch",
+ "Language_dsb": "Niedersorbisch",
+ "Language_dv": "Divehi",
+ "Language_el": "Griechisch",
+ "Language_en": "Englisch",
+ "Language_es": "Spanisch",
+ "Language_et": "Estnisch",
+ "Language_eu": "Baskisch",
+ "Language_fa": "Persisch",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnisch",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Färöisch",
+ "Language_fr": "Französisch",
+ "Language_fy": "Friesisch",
+ "Language_ga": "Irisch",
+ "Language_gd": "Schottisch-Gälisch",
+ "Language_gd-Latn": "Schottisch-Gälisch",
+ "Language_gl": "Galicisch",
+ "Language_gsw": "Elsässisch",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Haussa (Lateinisch)",
+ "Language_ha-Latn": "Haussa (Lateinisch)",
+ "Language_he": "Hebräisch",
+ "Language_hi": "Hindi",
+ "Language_hr": "Kroatisch",
+ "Language_hsb": "Obersorbisch",
+ "Language_hu": "Ungarisch",
+ "Language_hy": "Armenisch",
+ "Language_id": "Indonesisch",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Isländisch",
+ "Language_it": "Italienisch",
+ "Language_iu-Latn": "Inuktitut (Lateinisch)",
+ "Language_ja": "Japanisch",
+ "Language_ka": "Georgisch",
+ "Language_kk": "Kasachisch",
+ "Language_kl": "Grönländisch",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Koreanisch",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdisch",
+ "Language_ku-Arab": "Zentralkurdisch",
+ "Language_ky": "Kirgisisch",
+ "Language_ky-Cyrl": "Kirgisisch",
+ "Language_lb": "Luxemburgisch",
+ "Language_lo": "Laotisch",
+ "Language_lt": "Litauisch",
+ "Language_lv": "Lettisch",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Mazedonisch",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolisch (Kyrillisch)",
+ "Language_mn-Cyrl": "Mongolisch (Kyrillisch)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malaiisch",
+ "Language_mt": "Maltesisch",
+ "Language_nb": "Norwegisch (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Niederländisch",
+ "Language_nn": "Norwegisch (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Okzitanisch",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabisch)",
+ "Language_pl": "Polnisch",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashtu",
+ "Language_pt": "Portugiesisch",
+ "Language_pt-br": "Portugiesisch (Brasilien)",
+ "Language_pt-pt": "Portugiesisch (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K’iche’",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Rumänisch",
+ "Language_ru": "Russisch",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sacha",
+ "Language_sd-Arab": "Sindhi (Arabisch)",
+ "Language_se-Latn": "Nordsamisch",
+ "Language_si": "Singhalesisch",
+ "Language_sk": "Slowakisch",
+ "Language_sl": "Slowenisch",
+ "Language_sma-Latn": "Südsamisch",
+ "Language_smj-Latn": "Lule-Samisch",
+ "Language_smn-Latn": "Inari-Samisch",
+ "Language_sms-Latn": "Skolt-Samisch",
+ "Language_sq": "Albanisch",
+ "Language_sr-Cyrl": "Serbisch (Kyrillisch)",
+ "Language_sr-cyrl-ba": "Serbisch (Kyrillisch, Bosnien und Herzegowina)",
+ "Language_sr-Latn": "Serbisch (Lateinisch)",
+ "Language_sv": "Schwedisch",
+ "Language_sw": "Kisuaheli",
+ "Language_syr-Syrc": "Syrisch",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tadschikisch (Kyrillisch)",
+ "Language_th": "Thailändisch",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmenisch (Lateinisch)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Türkisch",
+ "Language_tt": "Tatarisch",
+ "Language_tt-Cyrl": "Tatarisch (Kyrillisch)",
+ "Language_tzm-Latn": "Tamazight (Lateinisch)",
+ "Language_ug": "Uigurisch",
+ "Language_ug-Arab": "Uigurisch",
+ "Language_uk": "Ukrainisch",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Usbekisch (Kyrillisch)",
+ "Language_uz-Latn": "Usbekisch (Lateinisch)",
+ "Language_vi": "Vietnamesisch",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isi Xhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinesisch (vereinfacht)",
+ "Language_zh-Hant": "Chinesisch (traditionell)",
+ "Language_zu": "isi Zulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Vereinigte Arabische Emirate",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua und Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albanien",
+ "Region_Display_AM": "Armenien",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentinien",
+ "Region_Display_AS": "Amerikanisch-Samoa",
+ "Region_Display_AT": "Österreich",
+ "Region_Display_AU": "Australien",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Aserbaidschan",
+ "Region_Display_BA": "Bosnien und Herzegowina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesch",
+ "Region_Display_BE": "Belgien",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgarien",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei Darussalam",
+ "Region_Display_BO": "Bolivien",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasilien",
+ "Region_Display_BS": "Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botsuana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Kanada",
+ "Region_Display_CC": "Kokosinseln",
+ "Region_Display_CD": "Kongo, Demokratische Republik",
+ "Region_Display_CF": "Zentralafrikanische Republik",
+ "Region_Display_CG": "Kongo",
+ "Region_Display_CH": "Schweiz",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Cookinseln",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Kamerun",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Kolumbien",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbien und Montenegro (ehemalig)",
+ "Region_Display_CV": "Kap Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Weihnachtsinsel",
+ "Region_Display_CY": "Zypern",
+ "Region_Display_CZ": "Tschechische Republik",
+ "Region_Display_DE": "Deutschland",
+ "Region_Display_DJ": "Dschibuti",
+ "Region_Display_DK": "Dänemark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominikanische Republik",
+ "Region_Display_DZ": "Algerien",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estland",
+ "Region_Display_EG": "Ägypten",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spanien",
+ "Region_Display_ET": "Äthiopien",
+ "Region_Display_FI": "Finnland",
+ "Region_Display_FK": "Falklandinseln (Malwinen)",
+ "Region_Display_FM": "Mikronesien",
+ "Region_Display_FO": "Färöer",
+ "Region_Display_FR": "Frankreich",
+ "Region_Display_GA": "Gabun",
+ "Region_Display_GB": "Vereinigtes Königreich",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgien",
+ "Region_Display_GF": "Französisch-Guayana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Grönland",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Äquatorialguinea",
+ "Region_Display_GR": "Griechenland",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hongkong (SAR)",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Kroatien",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Ungarn",
+ "Region_Display_ID": "Indonesien",
+ "Region_Display_IE": "Irland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "Indien",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Island",
+ "Region_Display_IT": "Italien",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaika",
+ "Region_Display_JO": "Jordanien",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenia",
+ "Region_Display_KG": "Kirgisistan",
+ "Region_Display_KH": "Kambodscha",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Komoren",
+ "Region_Display_KN": "St. Kitts und Nevis",
+ "Region_Display_KR": "Korea, Republik",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Kaimaninseln",
+ "Region_Display_KZ": "Kasachstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Libanon",
+ "Region_Display_LC": "St. Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Litauen",
+ "Region_Display_LU": "Luxemburg",
+ "Region_Display_LV": "Lettland",
+ "Region_Display_LY": "Libyen",
+ "Region_Display_MA": "Marokko",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Republik Moldau",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "St. Martin",
+ "Region_Display_MG": "Madagaskar",
+ "Region_Display_MH": "Marshallinseln",
+ "Region_Display_MK": "ehemalige jugoslawische Republik Mazedonien",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolei",
+ "Region_Display_MO": "Macau (SAR)",
+ "Region_Display_MP": "Nördliche Marianen",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauretanien",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Malediven",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexiko",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mosambik",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Neukaledonien",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolkinsel",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Niederlande",
+ "Region_Display_NO": "Norwegen",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Neuseeland",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "Französisch-Polynesien",
+ "Region_Display_PG": "Papua-Neuguinea",
+ "Region_Display_PH": "Philippinen",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Polen",
+ "Region_Display_PM": "St. Pierre und Miquelon",
+ "Region_Display_PN": "Pitcairninseln",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Katar",
+ "Region_Display_RE": "Réunion",
+ "Region_Display_RO": "Rumänien",
+ "Region_Display_RS": "Serbien",
+ "Region_Display_RU": "Russische Föderation",
+ "Region_Display_RW": "Ruanda",
+ "Region_Display_SA": "Saudi-Arabien",
+ "Region_Display_SB": "Salomonen",
+ "Region_Display_SC": "Seychellen",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Schweden",
+ "Region_Display_SG": "Singapur",
+ "Region_Display_SH": "St. Helena, Ascension und Tristan da Cunha",
+ "Region_Display_SI": "Slowenien",
+ "Region_Display_SK": "Slowakei",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "Südsudan",
+ "Region_Display_ST": "São Tomé und Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "St. Maarten",
+ "Region_Display_SY": "Syrien",
+ "Region_Display_SZ": "Swasiland",
+ "Region_Display_TC": "Turks- und Caicosinseln",
+ "Region_Display_TD": "Tschad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tadschikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunesien",
+ "Region_Display_TR": "Türkei",
+ "Region_Display_TT": "Trinidad und Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tansania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Vereinigte Staaten",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Usbekistan",
+ "Region_Display_VA": "Heiliger Stuhl (Vatikanstadt)",
+ "Region_Display_VC": "St. Vincent und die Grenadinen",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Britische Jungferninseln",
+ "Region_Display_VI": "Amerikanische Jungferninseln",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis und Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "St. Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Jemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Südafrika",
+ "Region_Display_ZM": "Sambia",
+ "Region_Display_ZW": "Simbabwe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/de-ch.json b/packages/microsoft.bingweather/resources/de-ch.json
new file mode 100644
index 00000000..669d6c3f
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/de-ch.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "2055",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharisch",
+ "Language_ar": "Arabisch",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamesisch",
+ "Language_az": "Aseri (Lateinisch)",
+ "Language_az-Cyrl": "Aserbaidschanisch (Kyrillisch)",
+ "Language_az-Latn": "Aserbaidschanisch (Lateinisch)",
+ "Language_ba-Cyrl": "Baschkirisch",
+ "Language_be": "Belarussisch",
+ "Language_bg": "Bulgarisch",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesch)",
+ "Language_bn-in": "Bangla (Indien)",
+ "Language_br-Latn": "Bretonisch",
+ "Language_bs": "Bosnisch (Lateinisch)",
+ "Language_bs-Cyrl": "Bosnisch (Kyrillisch)",
+ "Language_bs-Latn": "Bosnisch (Lateinisch)",
+ "Language_ca": "Katalanisch",
+ "Language_ca-ES-valencia": "Valencianisch",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Korsisch",
+ "Language_cs": "Tschechisch",
+ "Language_cy": "Walisisch",
+ "Language_da": "Dänisch",
+ "Language_de": "Deutsch",
+ "Language_dsb": "Niedersorbisch",
+ "Language_dv": "Divehi",
+ "Language_el": "Griechisch",
+ "Language_en": "Englisch",
+ "Language_es": "Spanisch",
+ "Language_et": "Estnisch",
+ "Language_eu": "Baskisch",
+ "Language_fa": "Persisch",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnisch",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Färöisch",
+ "Language_fr": "Französisch",
+ "Language_fy": "Friesisch",
+ "Language_ga": "Irisch",
+ "Language_gd": "Schottisch-Gälisch",
+ "Language_gd-Latn": "Schottisch-Gälisch",
+ "Language_gl": "Galicisch",
+ "Language_gsw": "Elsässisch",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Haussa (Lateinisch)",
+ "Language_ha-Latn": "Haussa (Lateinisch)",
+ "Language_he": "Hebräisch",
+ "Language_hi": "Hindi",
+ "Language_hr": "Kroatisch",
+ "Language_hsb": "Obersorbisch",
+ "Language_hu": "Ungarisch",
+ "Language_hy": "Armenisch",
+ "Language_id": "Indonesisch",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Isländisch",
+ "Language_it": "Italienisch",
+ "Language_iu-Latn": "Inuktitut (Lateinisch)",
+ "Language_ja": "Japanisch",
+ "Language_ka": "Georgisch",
+ "Language_kk": "Kasachisch",
+ "Language_kl": "Grönländisch",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Koreanisch",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdisch",
+ "Language_ku-Arab": "Zentralkurdisch",
+ "Language_ky": "Kirgisisch",
+ "Language_ky-Cyrl": "Kirgisisch",
+ "Language_lb": "Luxemburgisch",
+ "Language_lo": "Laotisch",
+ "Language_lt": "Litauisch",
+ "Language_lv": "Lettisch",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Mazedonisch",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolisch (Kyrillisch)",
+ "Language_mn-Cyrl": "Mongolisch (Kyrillisch)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malaiisch",
+ "Language_mt": "Maltesisch",
+ "Language_nb": "Norwegisch (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Niederländisch",
+ "Language_nn": "Norwegisch (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Okzitanisch",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabisch)",
+ "Language_pl": "Polnisch",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashtu",
+ "Language_pt": "Portugiesisch",
+ "Language_pt-br": "Portugiesisch (Brasilien)",
+ "Language_pt-pt": "Portugiesisch (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K’iche’",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Rumänisch",
+ "Language_ru": "Russisch",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sacha",
+ "Language_sd-Arab": "Sindhi (Arabisch)",
+ "Language_se-Latn": "Nordsamisch",
+ "Language_si": "Singhalesisch",
+ "Language_sk": "Slowakisch",
+ "Language_sl": "Slowenisch",
+ "Language_sma-Latn": "Südsamisch",
+ "Language_smj-Latn": "Lule-Samisch",
+ "Language_smn-Latn": "Inari-Samisch",
+ "Language_sms-Latn": "Skolt-Samisch",
+ "Language_sq": "Albanisch",
+ "Language_sr-Cyrl": "Serbisch (Kyrillisch)",
+ "Language_sr-cyrl-ba": "Serbisch (Kyrillisch, Bosnien und Herzegowina)",
+ "Language_sr-Latn": "Serbisch (Lateinisch)",
+ "Language_sv": "Schwedisch",
+ "Language_sw": "Kisuaheli",
+ "Language_syr-Syrc": "Syrisch",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tadschikisch (Kyrillisch)",
+ "Language_th": "Thailändisch",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmenisch (Lateinisch)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Türkisch",
+ "Language_tt": "Tatarisch",
+ "Language_tt-Cyrl": "Tatarisch (Kyrillisch)",
+ "Language_tzm-Latn": "Tamazight (Lateinisch)",
+ "Language_ug": "Uigurisch",
+ "Language_ug-Arab": "Uigurisch",
+ "Language_uk": "Ukrainisch",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Usbekisch (Kyrillisch)",
+ "Language_uz-Latn": "Usbekisch (Lateinisch)",
+ "Language_vi": "Vietnamesisch",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isi Xhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinesisch (vereinfacht)",
+ "Language_zh-Hant": "Chinesisch (traditionell)",
+ "Language_zu": "isi Zulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Vereinigte Arabische Emirate",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua und Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albanien",
+ "Region_Display_AM": "Armenien",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentinien",
+ "Region_Display_AS": "Amerikanisch-Samoa",
+ "Region_Display_AT": "Österreich",
+ "Region_Display_AU": "Australien",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Aserbaidschan",
+ "Region_Display_BA": "Bosnien und Herzegowina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesch",
+ "Region_Display_BE": "Belgien",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgarien",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei Darussalam",
+ "Region_Display_BO": "Bolivien",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasilien",
+ "Region_Display_BS": "Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botsuana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Kanada",
+ "Region_Display_CC": "Kokosinseln",
+ "Region_Display_CD": "Kongo, Demokratische Republik",
+ "Region_Display_CF": "Zentralafrikanische Republik",
+ "Region_Display_CG": "Kongo",
+ "Region_Display_CH": "Schweiz",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Cookinseln",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Kamerun",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Kolumbien",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbien und Montenegro (ehemalig)",
+ "Region_Display_CV": "Kap Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Weihnachtsinsel",
+ "Region_Display_CY": "Zypern",
+ "Region_Display_CZ": "Tschechische Republik",
+ "Region_Display_DE": "Deutschland",
+ "Region_Display_DJ": "Dschibuti",
+ "Region_Display_DK": "Dänemark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominikanische Republik",
+ "Region_Display_DZ": "Algerien",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estland",
+ "Region_Display_EG": "Ägypten",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spanien",
+ "Region_Display_ET": "Äthiopien",
+ "Region_Display_FI": "Finnland",
+ "Region_Display_FK": "Falklandinseln (Malwinen)",
+ "Region_Display_FM": "Mikronesien",
+ "Region_Display_FO": "Färöer",
+ "Region_Display_FR": "Frankreich",
+ "Region_Display_GA": "Gabun",
+ "Region_Display_GB": "Vereinigtes Königreich",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgien",
+ "Region_Display_GF": "Französisch-Guayana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Grönland",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Äquatorialguinea",
+ "Region_Display_GR": "Griechenland",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hongkong (SAR)",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Kroatien",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Ungarn",
+ "Region_Display_ID": "Indonesien",
+ "Region_Display_IE": "Irland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "Indien",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Island",
+ "Region_Display_IT": "Italien",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaika",
+ "Region_Display_JO": "Jordanien",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenia",
+ "Region_Display_KG": "Kirgisistan",
+ "Region_Display_KH": "Kambodscha",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Komoren",
+ "Region_Display_KN": "St. Kitts und Nevis",
+ "Region_Display_KR": "Korea, Republik",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Kaimaninseln",
+ "Region_Display_KZ": "Kasachstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Libanon",
+ "Region_Display_LC": "St. Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Litauen",
+ "Region_Display_LU": "Luxemburg",
+ "Region_Display_LV": "Lettland",
+ "Region_Display_LY": "Libyen",
+ "Region_Display_MA": "Marokko",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Republik Moldau",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "St. Martin",
+ "Region_Display_MG": "Madagaskar",
+ "Region_Display_MH": "Marshallinseln",
+ "Region_Display_MK": "ehemalige jugoslawische Republik Mazedonien",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolei",
+ "Region_Display_MO": "Macau (SAR)",
+ "Region_Display_MP": "Nördliche Marianen",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauretanien",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Malediven",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexiko",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mosambik",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Neukaledonien",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolkinsel",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Niederlande",
+ "Region_Display_NO": "Norwegen",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Neuseeland",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "Französisch-Polynesien",
+ "Region_Display_PG": "Papua-Neuguinea",
+ "Region_Display_PH": "Philippinen",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Polen",
+ "Region_Display_PM": "St. Pierre und Miquelon",
+ "Region_Display_PN": "Pitcairninseln",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Katar",
+ "Region_Display_RE": "Réunion",
+ "Region_Display_RO": "Rumänien",
+ "Region_Display_RS": "Serbien",
+ "Region_Display_RU": "Russische Föderation",
+ "Region_Display_RW": "Ruanda",
+ "Region_Display_SA": "Saudi-Arabien",
+ "Region_Display_SB": "Salomonen",
+ "Region_Display_SC": "Seychellen",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Schweden",
+ "Region_Display_SG": "Singapur",
+ "Region_Display_SH": "St. Helena, Ascension und Tristan da Cunha",
+ "Region_Display_SI": "Slowenien",
+ "Region_Display_SK": "Slowakei",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "Südsudan",
+ "Region_Display_ST": "São Tomé und Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "St. Maarten",
+ "Region_Display_SY": "Syrien",
+ "Region_Display_SZ": "Swasiland",
+ "Region_Display_TC": "Turks- und Caicosinseln",
+ "Region_Display_TD": "Tschad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tadschikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunesien",
+ "Region_Display_TR": "Türkei",
+ "Region_Display_TT": "Trinidad und Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tansania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Vereinigte Staaten",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Usbekistan",
+ "Region_Display_VA": "Heiliger Stuhl (Vatikanstadt)",
+ "Region_Display_VC": "St. Vincent und die Grenadinen",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Britische Jungferninseln",
+ "Region_Display_VI": "Amerikanische Jungferninseln",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis und Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "St. Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Jemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Südafrika",
+ "Region_Display_ZM": "Sambia",
+ "Region_Display_ZW": "Simbabwe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/de.json b/packages/microsoft.bingweather/resources/de.json
new file mode 100644
index 00000000..17dfbc13
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/de.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "7",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharisch",
+ "Language_ar": "Arabisch",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamesisch",
+ "Language_az": "Aseri (Lateinisch)",
+ "Language_az-Cyrl": "Aserbaidschanisch (Kyrillisch)",
+ "Language_az-Latn": "Aserbaidschanisch (Lateinisch)",
+ "Language_ba-Cyrl": "Baschkirisch",
+ "Language_be": "Belarussisch",
+ "Language_bg": "Bulgarisch",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesch)",
+ "Language_bn-in": "Bangla (Indien)",
+ "Language_br-Latn": "Bretonisch",
+ "Language_bs": "Bosnisch (Lateinisch)",
+ "Language_bs-Cyrl": "Bosnisch (Kyrillisch)",
+ "Language_bs-Latn": "Bosnisch (Lateinisch)",
+ "Language_ca": "Katalanisch",
+ "Language_ca-ES-valencia": "Valencianisch",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Korsisch",
+ "Language_cs": "Tschechisch",
+ "Language_cy": "Walisisch",
+ "Language_da": "Dänisch",
+ "Language_de": "Deutsch",
+ "Language_dsb": "Niedersorbisch",
+ "Language_dv": "Divehi",
+ "Language_el": "Griechisch",
+ "Language_en": "Englisch",
+ "Language_es": "Spanisch",
+ "Language_et": "Estnisch",
+ "Language_eu": "Baskisch",
+ "Language_fa": "Persisch",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnisch",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Färöisch",
+ "Language_fr": "Französisch",
+ "Language_fy": "Friesisch",
+ "Language_ga": "Irisch",
+ "Language_gd": "Schottisch-Gälisch",
+ "Language_gd-Latn": "Schottisch-Gälisch",
+ "Language_gl": "Galicisch",
+ "Language_gsw": "Elsässisch",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Haussa (Lateinisch)",
+ "Language_ha-Latn": "Haussa (Lateinisch)",
+ "Language_he": "Hebräisch",
+ "Language_hi": "Hindi",
+ "Language_hr": "Kroatisch",
+ "Language_hsb": "Obersorbisch",
+ "Language_hu": "Ungarisch",
+ "Language_hy": "Armenisch",
+ "Language_id": "Indonesisch",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Isländisch",
+ "Language_it": "Italienisch",
+ "Language_iu-Latn": "Inuktitut (Lateinisch)",
+ "Language_ja": "Japanisch",
+ "Language_ka": "Georgisch",
+ "Language_kk": "Kasachisch",
+ "Language_kl": "Grönländisch",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Koreanisch",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdisch",
+ "Language_ku-Arab": "Zentralkurdisch",
+ "Language_ky": "Kirgisisch",
+ "Language_ky-Cyrl": "Kirgisisch",
+ "Language_lb": "Luxemburgisch",
+ "Language_lo": "Laotisch",
+ "Language_lt": "Litauisch",
+ "Language_lv": "Lettisch",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Mazedonisch",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolisch (Kyrillisch)",
+ "Language_mn-Cyrl": "Mongolisch (Kyrillisch)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malaiisch",
+ "Language_mt": "Maltesisch",
+ "Language_nb": "Norwegisch (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Niederländisch",
+ "Language_nn": "Norwegisch (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Okzitanisch",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabisch)",
+ "Language_pl": "Polnisch",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashtu",
+ "Language_pt": "Portugiesisch",
+ "Language_pt-br": "Portugiesisch (Brasilien)",
+ "Language_pt-pt": "Portugiesisch (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K’iche’",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Rumänisch",
+ "Language_ru": "Russisch",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sacha",
+ "Language_sd-Arab": "Sindhi (Arabisch)",
+ "Language_se-Latn": "Nordsamisch",
+ "Language_si": "Singhalesisch",
+ "Language_sk": "Slowakisch",
+ "Language_sl": "Slowenisch",
+ "Language_sma-Latn": "Südsamisch",
+ "Language_smj-Latn": "Lule-Samisch",
+ "Language_smn-Latn": "Inari-Samisch",
+ "Language_sms-Latn": "Skolt-Samisch",
+ "Language_sq": "Albanisch",
+ "Language_sr-Cyrl": "Serbisch (Kyrillisch)",
+ "Language_sr-cyrl-ba": "Serbisch (Kyrillisch, Bosnien und Herzegowina)",
+ "Language_sr-Latn": "Serbisch (Lateinisch)",
+ "Language_sv": "Schwedisch",
+ "Language_sw": "Kisuaheli",
+ "Language_syr-Syrc": "Syrisch",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tadschikisch (Kyrillisch)",
+ "Language_th": "Thailändisch",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmenisch (Lateinisch)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Türkisch",
+ "Language_tt": "Tatarisch",
+ "Language_tt-Cyrl": "Tatarisch (Kyrillisch)",
+ "Language_tzm-Latn": "Tamazight (Lateinisch)",
+ "Language_ug": "Uigurisch",
+ "Language_ug-Arab": "Uigurisch",
+ "Language_uk": "Ukrainisch",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Usbekisch (Kyrillisch)",
+ "Language_uz-Latn": "Usbekisch (Lateinisch)",
+ "Language_vi": "Vietnamesisch",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isi Xhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinesisch (vereinfacht)",
+ "Language_zh-Hant": "Chinesisch (traditionell)",
+ "Language_zu": "isi Zulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Vereinigte Arabische Emirate",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua und Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albanien",
+ "Region_Display_AM": "Armenien",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentinien",
+ "Region_Display_AS": "Amerikanisch-Samoa",
+ "Region_Display_AT": "Österreich",
+ "Region_Display_AU": "Australien",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Aserbaidschan",
+ "Region_Display_BA": "Bosnien und Herzegowina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesch",
+ "Region_Display_BE": "Belgien",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgarien",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei Darussalam",
+ "Region_Display_BO": "Bolivien",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasilien",
+ "Region_Display_BS": "Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botsuana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Kanada",
+ "Region_Display_CC": "Kokosinseln",
+ "Region_Display_CD": "Kongo, Demokratische Republik",
+ "Region_Display_CF": "Zentralafrikanische Republik",
+ "Region_Display_CG": "Kongo",
+ "Region_Display_CH": "Schweiz",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Cookinseln",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Kamerun",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Kolumbien",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbien und Montenegro (ehemalig)",
+ "Region_Display_CV": "Kap Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Weihnachtsinsel",
+ "Region_Display_CY": "Zypern",
+ "Region_Display_CZ": "Tschechische Republik",
+ "Region_Display_DE": "Deutschland",
+ "Region_Display_DJ": "Dschibuti",
+ "Region_Display_DK": "Dänemark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominikanische Republik",
+ "Region_Display_DZ": "Algerien",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estland",
+ "Region_Display_EG": "Ägypten",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spanien",
+ "Region_Display_ET": "Äthiopien",
+ "Region_Display_FI": "Finnland",
+ "Region_Display_FK": "Falklandinseln (Malwinen)",
+ "Region_Display_FM": "Mikronesien",
+ "Region_Display_FO": "Färöer",
+ "Region_Display_FR": "Frankreich",
+ "Region_Display_GA": "Gabun",
+ "Region_Display_GB": "Vereinigtes Königreich",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgien",
+ "Region_Display_GF": "Französisch-Guayana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Grönland",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Äquatorialguinea",
+ "Region_Display_GR": "Griechenland",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hongkong (SAR)",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Kroatien",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Ungarn",
+ "Region_Display_ID": "Indonesien",
+ "Region_Display_IE": "Irland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "Indien",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Island",
+ "Region_Display_IT": "Italien",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaika",
+ "Region_Display_JO": "Jordanien",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenia",
+ "Region_Display_KG": "Kirgisistan",
+ "Region_Display_KH": "Kambodscha",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Komoren",
+ "Region_Display_KN": "St. Kitts und Nevis",
+ "Region_Display_KR": "Korea, Republik",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Kaimaninseln",
+ "Region_Display_KZ": "Kasachstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Libanon",
+ "Region_Display_LC": "St. Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Litauen",
+ "Region_Display_LU": "Luxemburg",
+ "Region_Display_LV": "Lettland",
+ "Region_Display_LY": "Libyen",
+ "Region_Display_MA": "Marokko",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Republik Moldau",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "St. Martin",
+ "Region_Display_MG": "Madagaskar",
+ "Region_Display_MH": "Marshallinseln",
+ "Region_Display_MK": "ehemalige jugoslawische Republik Mazedonien",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolei",
+ "Region_Display_MO": "Macau (SAR)",
+ "Region_Display_MP": "Nördliche Marianen",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauretanien",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Malediven",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexiko",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mosambik",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Neukaledonien",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolkinsel",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Niederlande",
+ "Region_Display_NO": "Norwegen",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Neuseeland",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "Französisch-Polynesien",
+ "Region_Display_PG": "Papua-Neuguinea",
+ "Region_Display_PH": "Philippinen",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Polen",
+ "Region_Display_PM": "St. Pierre und Miquelon",
+ "Region_Display_PN": "Pitcairninseln",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Katar",
+ "Region_Display_RE": "Réunion",
+ "Region_Display_RO": "Rumänien",
+ "Region_Display_RS": "Serbien",
+ "Region_Display_RU": "Russische Föderation",
+ "Region_Display_RW": "Ruanda",
+ "Region_Display_SA": "Saudi-Arabien",
+ "Region_Display_SB": "Salomonen",
+ "Region_Display_SC": "Seychellen",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Schweden",
+ "Region_Display_SG": "Singapur",
+ "Region_Display_SH": "St. Helena, Ascension und Tristan da Cunha",
+ "Region_Display_SI": "Slowenien",
+ "Region_Display_SK": "Slowakei",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "Südsudan",
+ "Region_Display_ST": "São Tomé und Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "St. Maarten",
+ "Region_Display_SY": "Syrien",
+ "Region_Display_SZ": "Swasiland",
+ "Region_Display_TC": "Turks- und Caicosinseln",
+ "Region_Display_TD": "Tschad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tadschikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunesien",
+ "Region_Display_TR": "Türkei",
+ "Region_Display_TT": "Trinidad und Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tansania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Vereinigte Staaten",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Usbekistan",
+ "Region_Display_VA": "Heiliger Stuhl (Vatikanstadt)",
+ "Region_Display_VC": "St. Vincent und die Grenadinen",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Britische Jungferninseln",
+ "Region_Display_VI": "Amerikanische Jungferninseln",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis und Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "St. Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Jemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Südafrika",
+ "Region_Display_ZM": "Sambia",
+ "Region_Display_ZW": "Simbabwe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/en-au.json b/packages/microsoft.bingweather/resources/en-au.json
new file mode 100644
index 00000000..b2f5cc07
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/en-au.json
@@ -0,0 +1,1429 @@
+{
+ "AppEx.WeatherApp.Services": {
+ "Resources": {
+ "Country": "Country/Region",
+ "KilometresPerHour": "{0} kmph",
+ "MilesPerHour": "{0} mph",
+ "Region": "State/Province",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInInches": "{0} in"
+ }
+ },
+ "Platform": {
+ "aboutLabel": "About",
+ "accept": "Accept",
+ "Add": "Add",
+ "addMoreFilters": "Add/Remove More Filters",
+ "advertisement": "Advertisement",
+ "AppIsPersonalized": "{0} is personalised. ",
+ "appRestart": "(Requires app restart)",
+ "AppTitle": "the app",
+ "appVersion": "Version {0}",
+ "ArticleHeaderSubscriptionMessage": "Subscribe",
+ "ArticleLinkLabelText": "View article",
+ "ArticleSubscriptionMessage": "Subscribe for unlimited access",
+ "ArticleTextSizeLarge": "Large",
+ "ArticleTextSizeMedium": "Medium",
+ "ArticleTextSizeMenuLabel": "Text size",
+ "ArticleTextSizeSmall": "Small",
+ "ArticleTextSizeXLarge": "X-Large",
+ "ArticleTextStyleMenuLabel": "Text style",
+ "ArticleUnavailableOffline": "This article is not available offline.",
+ "AverageMarketCharacterSizePx": "8",
+ "brand": "MSN",
+ "Calendar": "Calendar",
+ "cancel": "Cancel",
+ "catastrophicError": "There is a problem with the application. Please restart.",
+ "changeMarketTo": "{0} ({1})",
+ "changeSettings": "Change Settings",
+ "changesFromAppSettings": "You can make these changes at any time using app settings",
+ "clearFiltersLabel": "Reset Filters",
+ "ClickToOpenL2": "Select to show sub-channel",
+ "close": "Close",
+ "closeAppButton": "Close app",
+ "ConnectMicrosoftAccount": "Connect Microsoft account",
+ "ConnectMyMicrosoftAccount": "Connect my Microsoft account",
+ "ConnectToMicrosoft": "Connect to Microsoft",
+ "createAccountButton": "Create an account >",
+ "credentialMessage": "Enter a username and password to access {0}.",
+ "credentialsInvalid": "Invalid credentials. Please try again.",
+ "creditsLink": "Credits",
+ "DaysAgo": "{0} days ago",
+ "decline": "Decline",
+ "Delete": "Delete",
+ "demoModeTitle": "This feature is not available in demo mode.",
+ "demoMode_label": "DEMO MODE",
+ "demoMode_lastUpdated": "Tour the app in demo mode.",
+ "Dismiss": "Dismiss",
+ "entitlementsInvalid": "Sorry, your subscription does not include this device.",
+ "featured": "Featured",
+ "feedbackButtonLabel": "Feedback",
+ "feedbackCommentQuestion": "What could we do to improve the app?",
+ "feedbackDislikeIcon": "]D83D;]DE29;",
+ "feedbackDislikeLabel": "Dislike",
+ "feedbackLikeIcon": "]D83D;]DE0A;",
+ "feedbackLikeLabel": "Like",
+ "feedbackOfflineMessage": "It looks like you are currently offline. Please connect to the Internet and try again.",
+ "feedbackPrivacyStatementLabel": "Privacy statement",
+ "feedbackQ1option1": "Very good",
+ "feedbackQ1option2": "Good",
+ "feedbackQ1option3": "Average",
+ "feedbackQ1option4": "Poor",
+ "feedbackQ1option5": "Very Poor",
+ "feedbackQ2option1": "Definitely would recommend",
+ "feedbackQ2option2": "Probably would recommend",
+ "feedbackQ2option3": "Might or might not recommend",
+ "feedbackQ2option4": "Probably would not recommend",
+ "feedbackQ2option5": "Definitely would not recommend",
+ "feedbackQuestion1": "How would you rate this app?",
+ "feedbackQuestion2": "How likely would you be to recommend this app to a friend?",
+ "feedbackSubmitButtonLabel": "Submit",
+ "feedbackThankYou": "Thank you for your feedback!",
+ "filmstrip": "Filmstrip",
+ "FilterAll": "Show All",
+ "FilterBy": "Filter By:",
+ "filterMenu": "Filter Menu",
+ "forceUpdate": "This version of {0} is no longer supported. Please update to the latest version.",
+ "forgotPasswordButton": "Forgotten password >",
+ "freeformTextWarning": "Thanks for taking the time to add your feedback. Please take care not to provide any personal information.",
+ "GoBack": "Go back",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "HelpLabel": "Help",
+ "HoursAgo": "{0} hours ago",
+ "imageAttribution": "Image attribution",
+ "ImageCount": "Photo {0} of {1}",
+ "impressum": "Impressum",
+ "invalidEntry": "No results found. Please try again.",
+ "InvalidSubscriptionMessage": "The article that you are trying to read is locked. Please get a valid subscription.",
+ "L2Opened": "Sub-channels Shown",
+ "LabelChangeTheseSettings": "Change these settings",
+ "LabelClickToChange": "Click here to change settings",
+ "LabelModifySettings": "Modify settings",
+ "LabelOff": "Off",
+ "LabelOn": "On",
+ "LabelPrivacyStatement": "Privacy Statement",
+ "LabelTapToChange": "Tap here to change settings",
+ "languageSetting": "Choose edition",
+ "lca_privacy": "Privacy Statement",
+ "lca_serviceAgreement": "Terms of Use",
+ "Loading": "Loading",
+ "LocationCannotBeFound": "Your location cannot be found. Change your permissions to allow News to use your location.",
+ "Login": "Sign In",
+ "loginPrompt": "Enter your {0} account",
+ "loginPromptContentLocked": "The article you are trying to read is locked. Please log in.",
+ "Logout": "Sign Out",
+ "marketChangePrompt": "Please close and reopen the app for your content preference changes to take effect.",
+ "marketError": "This app is not available in your market.",
+ "marketSelDialogMsg": "You are viewing content from {0} ({1}). You can change this option at any time from the settings charm.",
+ "marketSelDialogMsgOpt": "You are viewing content from {0} ({1}). You can change this setting in the app at any time.",
+ "marketSelDialogTitle": "Which content and language would you like to see?",
+ "marketSelDialogTitleOpt": "Where would you like to view content from?",
+ "mediaPlaybackButtonsAriaLabel": "Playback buttons",
+ "mediaPlaybackContentRegionAriaLabel": "Media playback",
+ "mediaPlaybackControlsAriaLabel": "Playback controls",
+ "mediaPlaybackControlsLayerAriaLabel": "Playback controls",
+ "mediaPlaybackEnterFullScreenAriaLabel": "Show Full Screen",
+ "mediaPlaybackLeaveFullScreenAriaLabel": "Exit Full Screen",
+ "mediaPlaybackMinimalAriaLabel": "Currently Playing",
+ "mediaPlaybackNextButtonAriaLabel": "Next",
+ "mediaPlaybackPauseButtonAriaLabel": "Pause",
+ "mediaPlaybackPlayButtonAriaLabel": "Play",
+ "mediaPlaybackPreviousButtonAriaLabel": "Previous",
+ "mediaPlaybackSeekBarAriaLabel": "Seek bar",
+ "mediaPlaybackSeekBarThumbAriaLabel": "Seek bar slider",
+ "mediaPlaybackShareAriaLabel": "Share",
+ "mediaPlaybackTimeIndicatorAriaLabel": "Playback time indicator",
+ "MessageAccessingMSAinfo": "Accessing your Microsoft account information. ",
+ "MessageAccountConnect1": "To enable personalisation and syncing across devices, connect your Microsoft account in PC Settings.",
+ "MessageAccountConnect2": "To enable personalisation and syncing across devices, {0}.",
+ "MessageAdSettingsLocation": "Select “Microsoft Advertising” in Settings to control the personalisation of ads in this app. ",
+ "MessageAdSettingsOff": "You are not receiving personalised ads. Select “Microsoft Advertising” in Settings to get personalised ads.",
+ "MessageAdSettingsOn1": "Microsoft Advertising is using your information to personalise ads. Select “Microsoft Advertising” in Settings to turn this off. ",
+ "MessageAdSettingsOn2": "Microsoft Advertising is using your information to personalise ads. Select “Microsoft Advertising” in Settings to turn off personalised ads. ",
+ "MessageConfiguredMSAinfo": "Configured using your Microsoft account information. ",
+ "MessageConnect": "Connect",
+ "MessageConnectAccount": "Connect account",
+ "MessageConnectMicrosoftAccount": "connect your Microsoft account",
+ "MessageCustomizedMSAinfo": "Customised with your Microsoft account information. ",
+ "MessageMSAConnectionDescription": "This will synchronise information between this app and your Microsoft account to personalise this and other Microsoft experiences across your devices.",
+ "MessageMSASignIn": "To enable personalisation and synchronisation across devices, sign in to your Microsoft account. ",
+ "MessageOptimizedMSAinfo": "Optimised with your Microsoft account information. ",
+ "MessagePersonalize": "Use information from this app and information associated with my Microsoft account to personalise this and other Microsoft experiences.",
+ "MessagePersonalizedMSAinfo": "Personalised with your Microsoft account information. ",
+ "MessagePersonalizeSettings": "Personalise settings",
+ "MessagePrivacySettings": "Privacy settings",
+ "MessagePrivacyUpdateButton": "Learn more",
+ "MessagePrivacyUpdateCloseButton": "Dismiss",
+ "MessagePrivacyUpdated": "We have updated our Privacy Statement.",
+ "MessagePrivacyUpdateLink": "Learn more",
+ "MessagePrivacyUpdateNotif": "We are updating our Privacy Statement.",
+ "MessageRoam": "Sync this app's settings across my devices. ",
+ "MessageTermsAndPrivacyUpdated": "We have updated our Terms of Use and Privacy Statement.",
+ "MessageTermsAndPrivacyUpdateNotif": "We are updating our Terms of Use and Privacy Statement.",
+ "MessageTermsUpdateButton": "Learn more",
+ "MessageTermsUpdateCloseButton": "Dismiss",
+ "MessageTermsUpdated": "We have updated our Terms of Use.",
+ "MessageTermsUpdateLink": "Learn more",
+ "MessageTermsUpdateNotif": "We are updating our Terms of Use.",
+ "MessageUsingMSAinfo": "Using your Microsoft account information. ",
+ "MicrosoftAccount": "Microsoft",
+ "MicrosoftAdvertisingPrivacyLinkText": "Microsoft Advertising Privacy Statement.",
+ "MicrosoftAdvertisingSettingsText": "To control ad personalisation, see the ",
+ "MinsAgo": "{0} mins ago",
+ "More": "More",
+ "MoreArticles": "Upcoming",
+ "MoreFrom": "More from",
+ "MSAccountNameLabel": "Account name",
+ "MSAConnectionRemoveLink": "Remove",
+ "MSAConnectLabel": "Connect",
+ "NextArticle": "Next article",
+ "nextButton": "Next Item",
+ "noInternetButton": "Try Again",
+ "noInternetDescription": "Please check your Internet connection.",
+ "noInternetTitle": "You are not connected to the Internet.",
+ "noThanks": "No, Thanks",
+ "offLabel": "Off",
+ "offline_label": "OFFLINE",
+ "offline_lastUpdated": "Last Updated {0}",
+ "offline_noContent": "This content is not available in offline mode.",
+ "offline_problem": "The application ran into a problem and couldn’t load the content.",
+ "okButton": "Okay",
+ "OneDayAgo": "1 day ago",
+ "OneHourAgo": "1 hour ago",
+ "OneMinAgo": "1 min ago",
+ "open": "Open",
+ "OpenInBrowser": "View in browser",
+ "optionsTitle": "Options",
+ "other": "Other",
+ "otherButton": "Other Markets",
+ "overLimitMessage": "{0} may use a large amount of data for some features. Your metered connection is over the data limit and fees may apply",
+ "Page": "Page {0}",
+ "PageOf": "Page {0} of {1}",
+ "password": "Password",
+ "passwordInput": "Password",
+ "Pause": "Pause",
+ "PaywallCardByAuthor": "By {0}",
+ "PaywallCardDay": "day",
+ "PaywallCardGrowlMessage": "You have used +{0} of {1}+ free token(s) from {2} {3}.",
+ "PaywallCardHour": "hour",
+ "PaywallCardMonth": "month",
+ "PaywallCardQuotaReachedMessage": "You can continue to enjoy up to {0} free token(s) per {1} or subscribe for unlimited access.",
+ "PaywallcardReadArticle": "Read article",
+ "PaywallCardSignIn": "Sign In",
+ "PaywallCardSubscribe": "Subscribe",
+ "PaywallCardThisHour": "this hour",
+ "PaywallCardThisMonth": "this month",
+ "PaywallCardThisWeek": "this week",
+ "PaywallCardThisYear": "this year",
+ "PaywallCardToday": "today",
+ "PaywallCardUnlimitedAccess": "Subscribe for Unlimited Access",
+ "PaywallCardWeek": "week",
+ "PaywallCardYear": "year",
+ "PhotosynthControlsHiddenAriaLabel": "Panorama controls hidden",
+ "PhotosynthControlsVisibleAriaLabel": "Panorama controls visible",
+ "pinToStart": "Pin to Start",
+ "Play": "Play",
+ "poweredBy": "Powered by {0}",
+ "PreviousArticle": "Previous article",
+ "previousButton": "Previous Item",
+ "privacyPolicy": "Privacy Policy",
+ "progressAlertAriaLabel": "Alert",
+ "readingList": "Saved",
+ "refresh": "Refresh",
+ "RegionCurrentLocation": "Current Location",
+ "RegionSelectLabel": "Update regional sources for your city",
+ "RegionSelectNone": "(None)",
+ "RelatedArticles": "Related",
+ "Resources": {
+ "LanguageID": "3081",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharic",
+ "Language_ar": "Arabic",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamese",
+ "Language_az": "Azeri (Latin)",
+ "Language_az-Cyrl": "Azerbaijani (Cyrillic)",
+ "Language_az-Latn": "Azerbaijani (Latin)",
+ "Language_ba-Cyrl": "Bashkir",
+ "Language_be": "Belarusian",
+ "Language_bg": "Bulgarian",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesh)",
+ "Language_bn-in": "Bangla (India)",
+ "Language_br-Latn": "Breton",
+ "Language_bs": "Bosnian (Latin)",
+ "Language_bs-Cyrl": "Bosnian (Cyrillic)",
+ "Language_bs-Latn": "Bosnian (Latin)",
+ "Language_ca": "Catalan",
+ "Language_ca-ES-valencia": "Valencian",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Corsican",
+ "Language_cs": "Czech",
+ "Language_cy": "Welsh",
+ "Language_da": "Danish",
+ "Language_de": "German",
+ "Language_dsb": "Lower Sorbian",
+ "Language_dv": "Divehi",
+ "Language_el": "Greek",
+ "Language_en": "English",
+ "Language_es": "Spanish",
+ "Language_et": "Estonian",
+ "Language_eu": "Basque",
+ "Language_fa": "Persian",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnish",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Faroese",
+ "Language_fr": "French",
+ "Language_fy": "Frisian",
+ "Language_ga": "Irish",
+ "Language_gd": "Scottish Gaelic",
+ "Language_gd-Latn": "Scottish Gaelic",
+ "Language_gl": "Galician",
+ "Language_gsw": "Alsatian",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Hausa (Latin)",
+ "Language_ha-Latn": "Hausa (Latin)",
+ "Language_he": "Hebrew",
+ "Language_hi": "Hindi",
+ "Language_hr": "Croatian",
+ "Language_hsb": "Upper Sorbian",
+ "Language_hu": "Hungarian",
+ "Language_hy": "Armenian",
+ "Language_id": "Indonesian",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Icelandic",
+ "Language_it": "Italian",
+ "Language_iu-Latn": "Inuktitut (Latin)",
+ "Language_ja": "Japanese",
+ "Language_ka": "Georgian",
+ "Language_kk": "Kazakh",
+ "Language_kl": "Greenlandic",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Korean",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdish",
+ "Language_ku-Arab": "Central Kurdish",
+ "Language_ky": "Kyrgyz",
+ "Language_ky-Cyrl": "Kyrgyz",
+ "Language_lb": "Luxembourgish",
+ "Language_lo": "Lao",
+ "Language_lt": "Lithuanian",
+ "Language_lv": "Latvian",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Macedonian",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolian (Cyrillic)",
+ "Language_mn-Cyrl": "Mongolian (Cyrillic)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malay",
+ "Language_mt": "Maltese",
+ "Language_nb": "Norwegian (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Dutch",
+ "Language_nn": "Norwegian (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Occitan",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabic)",
+ "Language_pl": "Polish",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashto",
+ "Language_pt": "Portuguese",
+ "Language_pt-br": "Portuguese (Brazil)",
+ "Language_pt-pt": "Portuguese (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Romanian",
+ "Language_ru": "Russian",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sakha",
+ "Language_sd-Arab": "Sindhi (Arabic)",
+ "Language_se-Latn": "Northern Sami",
+ "Language_si": "Sinhala",
+ "Language_sk": "Slovak",
+ "Language_sl": "Slovenian",
+ "Language_sma-Latn": "Southern Sami",
+ "Language_smj-Latn": "Lule Sami",
+ "Language_smn-Latn": "Inari Sami",
+ "Language_sms-Latn": "Skolt Sami",
+ "Language_sq": "Albanian",
+ "Language_sr-Cyrl": "Serbian (Cyrillic)",
+ "Language_sr-cyrl-ba": "Serbian (Cyrillic, Bosnia and Herzegovina)",
+ "Language_sr-Latn": "Serbian (Latin)",
+ "Language_sv": "Swedish",
+ "Language_sw": "Kiswahili",
+ "Language_syr-Syrc": "Syriac",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tajik (Cyrillic)",
+ "Language_th": "Thai",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmen (Latin)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Turkish",
+ "Language_tt": "Tatar",
+ "Language_tt-Cyrl": "Tatar (Cyrillic)",
+ "Language_tzm-Latn": "Tamazight (Latin)",
+ "Language_ug": "Uyghur",
+ "Language_ug-Arab": "Uyghur",
+ "Language_uk": "Ukrainian",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Uzbek (Cyrillic)",
+ "Language_uz-Latn": "Uzbek (Latin)",
+ "Language_vi": "Vietnamese",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinese (Simplified)",
+ "Language_zh-Hant": "Chinese (Traditional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} – {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "United Arab Emirates",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua and Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "American Samoa",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaijan",
+ "Region_Display_BA": "Bosnia and Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgium",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brazil",
+ "Region_Display_BS": "The Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos (Keeling) Islands",
+ "Region_Display_CD": "Congo (DRC)",
+ "Region_Display_CF": "Central African Republic",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Switzerland",
+ "Region_Display_CI": "Côte d’Ivoire",
+ "Region_Display_CK": "Cook Islands",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Cameroon",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia and Montenegro (Former)",
+ "Region_Display_CV": "Cape Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas Island",
+ "Region_Display_CY": "Cyprus",
+ "Region_Display_CZ": "Czech Republic",
+ "Region_Display_DE": "Germany",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Denmark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominican Republic",
+ "Region_Display_DZ": "Algeria",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egypt",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spain",
+ "Region_Display_ET": "Ethiopia",
+ "Region_Display_FI": "Finland",
+ "Region_Display_FK": "Falkland Islands (Islas Malvinas)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Faroe Islands",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "United Kingdom",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "French Guiana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Greenland",
+ "Region_Display_GM": "The Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Equatorial Guinea",
+ "Region_Display_GR": "Greece",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong SAR",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatia",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Hungary",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Ireland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Iraq",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Iceland",
+ "Region_Display_IT": "Italy",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordan",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kyrgyzstan",
+ "Region_Display_KH": "Cambodia",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoros",
+ "Region_Display_KN": "Saint Kitts and Nevis",
+ "Region_Display_KR": "Korea",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Cayman Islands",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Lebanon",
+ "Region_Display_LC": "Saint Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lithuania",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Latvia",
+ "Region_Display_LY": "Libya",
+ "Region_Display_MA": "Morocco",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "Saint Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall Islands",
+ "Region_Display_MK": "Macedonia, FYRO",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao SAR",
+ "Region_Display_MP": "Northern Mariana Islands",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexico",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "New Caledonia",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk Island",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Netherlands",
+ "Region_Display_NO": "Norway",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "New Zealand",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "French Polynesia",
+ "Region_Display_PG": "Papua New Guinea",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Poland",
+ "Region_Display_PM": "Saint Pierre and Miquelon",
+ "Region_Display_PN": "Pitcairn Islands",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Reunion",
+ "Region_Display_RO": "Romania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Russia",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Saudi Arabia",
+ "Region_Display_SB": "Solomon Islands",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Sweden",
+ "Region_Display_SG": "Singapore",
+ "Region_Display_SH": "Saint Helena, Ascension and Tristan da Cunha",
+ "Region_Display_SI": "Slovenia",
+ "Region_Display_SK": "Slovakia",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "South Sudan",
+ "Region_Display_ST": "São Tomé and Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Syria",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks and Caicos Islands",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tajikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunisia",
+ "Region_Display_TR": "Turkey",
+ "Region_Display_TT": "Trinidad and Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "United States",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistan",
+ "Region_Display_VA": "Holy See (Vatican City)",
+ "Region_Display_VC": "Saint Vincent and the Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "British Virgin Islands",
+ "Region_Display_VI": "U.S. Virgin Islands",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis and Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Sint Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "South Africa",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabwe"
+ },
+ "restart": "Restart",
+ "retry": "Try Again",
+ "roamingMessage": "{0} may use a large amount of data for some features. You are currently roaming and data fees may apply.",
+ "row": "Row",
+ "scrollLeftAriaLabel": "Scroll Left",
+ "scrollRightAriaLabel": "Scroll Right",
+ "semanticZoomContainer": "Semantic Zoom Container",
+ "sendFeedbackButtonLabel": "Send Feedback",
+ "ShareArticleHeader": "Share",
+ "ShareArticleText": "Share this article",
+ "Slide": "Image",
+ "Slideshow": "Slideshow",
+ "SnappedMessage": "Snap mode is coming soon.",
+ "SortBy": "SORT BY",
+ "sortLabel": "Sort",
+ "sortText": "Sort",
+ "sponsoredBy": "Sponsored by",
+ "standardErrorButton": "Try Again",
+ "standardErrorDescription": "There was a problem. Please try again.",
+ "standardErrorTitle": "This page failed to load.",
+ "submit": "Submit",
+ "subscribeButton": "Subscribe",
+ "subscribeInstructions": "Enter username and password",
+ "subscribeNow": "Subscribe now and get:",
+ "subscribePanoButton": "Subscribe for Unlimited Access",
+ "subscribePrompt": "Content for subscribers only",
+ "swipeDownToolTip": "Swipe down to select",
+ "swipeLeftToolTip": "Swipe left to select",
+ "swipeRightToolTip": "Swipe right to select",
+ "TermsOfUse": "Terms of Use",
+ "TextStylePrimary": "Primary",
+ "TextStyleSecondary": "Secondary",
+ "timeIndicatorTextFormat": "{0} / {1}",
+ "TitleAccountSettings": "Account",
+ "TitleAccountsSettings": "Account",
+ "TitleAdSettings": "Advertising settings",
+ "TitleConfiguration": "Configuration",
+ "TitleCustomization": "Customisation",
+ "TitleMicrosoftAccount": "Microsoft account",
+ "TitleMSAConnectedDescription": "Connected to your Microsoft account",
+ "TitleMSAConnectionDescription": "Connect your Microsoft account",
+ "TitlePersonalization": "Personalisation",
+ "TitlePersonalizationSettings": "Personalisation",
+ "TitlePersonalize": "Personalise",
+ "TitlePersonalizedAdSettings": "Personalised Ad Settings",
+ "TitlePersonalizedAdvertisingSettings": "Personalised Advertising Settings",
+ "TitlePersonalizeSettings": "Personalisation settings",
+ "TitlePrivacySettings": "Privacy",
+ "TitlePrivacyStatementNew": "Privacy Statement (new)",
+ "TitleRoam": "Sync across devices",
+ "TitleTermsNew": "Terms of Use (new)",
+ "unpinFromStart": "Unpin from Start",
+ "Unsnap": "Unsnap",
+ "update": "Update Now",
+ "updateMessage": "A new version of {0} is available. Update now to take advantage of the latest changes",
+ "updateMessage_button1": "Update",
+ "updateMessage_button2": "Later",
+ "updateTitle": "Update Available",
+ "userName": "Username",
+ "userNameInput": "Your email address or username",
+ "validateError": "We are unable to log you in. Please try again later.",
+ "videoClusterLabel": "Featured Videos",
+ "videoConnectErrorText": "Please connect to the Internet and try again",
+ "videoCountdownText": "Up next in {0}",
+ "videoGeoErrorText": "Video is not available for current location",
+ "videoItemLabel": "Video",
+ "videoLoadErrorText": "We're having problems loading this video, please try again later",
+ "VideosClusterLabel": "Videos",
+ "viewing": "Viewing",
+ "WeekNum": "Week {0}",
+ "win8Brand": "Windows 8",
+ "win8Share": "If you have {0} or {1}, {2}",
+ "win8ShareBrowser": " Otherwise, {0}",
+ "win8ShareBrowserLink": "click here.",
+ "win8ShareLink": "open this in {0}.",
+ "win8ShareTitle": "{0} – {1}",
+ "winPhone8Brand": "Windows Phone 8"
+ },
+ "resources": {
+ "24Hour": "24 hour",
+ "About": "About",
+ "Accumulation24HoursMap": "Accumulation 24 hours",
+ "AccumulationMap": "Accumulation",
+ "AccuWeather": "AccuWeather",
+ "accuweatherUrl": "http://www.accuweather.com",
+ "AcresOpen": "Open Acres",
+ "ActiveAlertsMap": "Active alerts",
+ "AddAnotherLocSearchPage": "Try a different location",
+ "AddButtonTitle": "Add",
+ "AddNewLocationString": "Add a new location",
+ "AddressHeader": "Address",
+ "AddTileAriaText": "Add another location to favourites",
+ "AdvancedRuns": "Advanced Runs",
+ "AdvisoryAlertSubType": "Advisory",
+ "Africa": "Africa",
+ "Afternoon Cloudy": "Afternoon Cloudy",
+ "Afternoon Ice ": {
+ " Snow": "PM Ice / Snow"
+ },
+ "Afternoon Rain": "Afternoon Rain",
+ "Afternoon Snow": "Afternoon Snow",
+ "AirAlertType": "Air",
+ "Alert Bar Heading": "Alert",
+ "alertsFlyoutAriaText": "alert",
+ "AlertShort": "ALERT {0}",
+ "AlertShortWithCount": "ALERT {0} {1} {2} more",
+ "AlertsMap": "Alerts",
+ "AlertWarning": "ALERT {0} from {1} to {2}",
+ "AlertWarningWithCount": "ALERT {0} from {1} to {2} {3} {4} more",
+ "AllFavoritesHeading": "All Favourites",
+ "AM Thunderstorms": "AM Storms",
+ "AppDescription": "Weather App",
+ "appFeedbackTitle": "Weather Application Feedback",
+ "AppIntroductionText": "Check the weather close to home and around the world",
+ "AppTitle": "Weather",
+ "AriaTextC": "Celsius",
+ "AriaTextF": "Fahrenheit",
+ "Asia": "Asia/Middle East",
+ "AverageRainfall": "Average Rainfall",
+ "AverageSnow": "Average Snow",
+ "Barometer": "Barometer",
+ "Base": "Base",
+ "BaseDepth": "Base Depth",
+ "BeaufortScale": "{0} bft",
+ "BeaufortScaleAriaText": "{0} Beaufort",
+ "BeginnerRuns": "Beginner Runs",
+ "Blizzard": "Blizzard",
+ "BlizzardCredits": "Blizzard {0}",
+ "Blowing dust": "Blowing Dust",
+ "Blowing sand": "Blowing Sand",
+ "Blowing Snow": "Blowing Snow",
+ "BlowingSnowCredits": "Blowing Snow {0}",
+ "Boarding": "Boarding",
+ "BrandedAppTitle": "MSN Weather",
+ "C": "C",
+ "CamsPanorama": "Cams and 360° Panoramas",
+ "CanadaRadarAttribution": "Canadian radar data courtesy of Environment Canada",
+ "CCDailyAttribution": "Current conditions, daily forecasts by",
+ "CCDailyAttribution1Provider": "Current conditions, daily forecasts by {0}",
+ "CCDailyAttribution2Providers": "Current conditions, daily forecasts by {0}, {1}",
+ "CCDailyMapsAttribution": "Current conditions, daily forecasts and maps by",
+ "CelsiusSetting": "Celsius",
+ "ChanceOfPrecipitationMap": "Chance of precipitation",
+ "ChangeHomeButtonTitle": "Change Home",
+ "ChangeHomeTileAriaText": "Change the home location",
+ "ChangeRegion": "Change region",
+ "ChangeUnitToCButtonTitle": "Change to Celsius",
+ "ChangeUnitToFButtonTitle": "Change to Fahrenheit",
+ "Clear": "Clear",
+ "ClearButtonTitle": "Clear",
+ "ClearCredits": "Clear {0}",
+ "clearSearchHistoryButton": "Clear weather searches",
+ "ClearSelectionButtonTitle": "Clear selection",
+ "CloseButtonLabel": "Close",
+ "CloudCover": "Cloud Cover",
+ "CloudForecastMap": "Cloud Forecast",
+ "CloudMap": "Cloud",
+ "Cloudy": "Cloudy",
+ "Cloudy ": {
+ " Afternoon Sun": "Cloudy / PM Sun",
+ " Windy": "Cloudy / Windy"
+ },
+ "CloudyCredits": "Cloudy {0}",
+ "ConfirmButtonTitle": "Confirm",
+ "CouldNotLoadDataMsg": "Data cannot be refreshed. Please try again later.",
+ "CountryRegionFilterText": "Country/Region",
+ "CrossCountry": "Cross-country",
+ "Current": "MSN Weather",
+ "currentConditionsAriaText": "today {0}, current condition {1}, feels like {2}, source {3}",
+ "CurrentHomeNarratorString": "Current Home {0}",
+ "CurrentLocationButtonTitle": "Current Location",
+ "CurrentLocationFetchErrorMsg": "Your location cannot be detected. Try again later.",
+ "CurrentLocDataNotAvailable": "Weather data is not available for your location. Please try again later.",
+ "CustomTitle": "Custom",
+ "DailyDrilldownHourlyForecastAriaText": "{0}, {1} {2}, precipitation {3}",
+ "dailyForecast": "{0}, high {1} low {2}, {3}, precipitation {4}",
+ "dailyForecastExpanded1": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}",
+ "dailyForecastExpanded2": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}, high {8} low {9} source {10}",
+ "dailyForecastMinMax": "{0}, low {1} high {2}, {3}, precipitation {4}",
+ "dailyForecastMinMaxExpanded1": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}",
+ "dailyForecastMinMaxExpanded2": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}, low {8} high {9} source {10}",
+ "DataAttribution": "Data provided by",
+ "DayHeading": "Day",
+ "DealsNews": "Deals & News",
+ "defaultECVErrorAction": "Retry",
+ "defaultECVErrorDescription": "We're sorry, something happened while fulfilling your request. Please retry",
+ "defaultECVErrorTitle": "Oops!",
+ "DefaultShortNameForPinFlyout": "Weather",
+ "Dewpoint": "Dew Point",
+ "DismissText": "Remove this panel. Go to Next Steps for more content and Help tips.",
+ "DismissTitle": "Close",
+ "DisplayUnits": "Units",
+ "DistanceText": "Distance",
+ "DopplerRadar": "Doppler Radar",
+ "Drifting sand": "Drifting Sand",
+ "Drifting snow": "Drifting Snow",
+ "Drizzle": "Drizzle",
+ "DrizzleCredits": "Drizzle {0}",
+ "DustCloudyCredits": "Dust Cloudy {0}",
+ "Duststorm": "Dust Storm",
+ "Duststorms": "Dust Storms",
+ "DustyClearCredits": "Dusty Clear {0}",
+ "ECVNoResultsActionFilters": "Clear filters",
+ "ECVNoResultsActionNoFilters": "Go Back",
+ "ECVNoResultsDescriptionFilters": "Your search produced no results. Clear your filters and try again.",
+ "ECVNoResultsDescriptionNoFilters": "Your search produced no results. Please try again.",
+ "ECVNoResultsIcon": "⚊",
+ "ECVNoResultsTitle": "No results found",
+ "England": "England",
+ "EnterLocation": "Enter Location",
+ "Europe": "Europe",
+ "ExpertRuns": "Expert Runs",
+ "ExtremeTempAlertType": "Extreme Temperature",
+ "F": "F",
+ "FahrenheitSetting": "Fahrenheit",
+ "Fair": "Fair",
+ "favHighLowText": "High/Low",
+ "favLowHighText": "Low/High",
+ "Favorites": "Favourites",
+ "FeelsLike": "Feels Like {0}",
+ "Feet": "ft",
+ "FilterShow": "Show",
+ "FilterValueDeals": "Deals",
+ "FilterValueFav": "Favourites",
+ "FilterValueOpen": "Open Only",
+ "FloodAlertType": "Flood",
+ "Flurries": "Flurries",
+ "Fog": "Fog",
+ "FogCredits": "Fog {0}",
+ "Foreca": "Foreca",
+ "ForecastHeader": "Today's Forecast",
+ "ForecastMapSubType": "Forecast",
+ "forecaUrl": "http://www.foreca.com",
+ "Freezing": "Freezing",
+ "Freezing Drizzle": "Freezing Drizzle",
+ "Freezing fog": "Freezing Fog",
+ "Freezing Rain": "Freezing Rain",
+ "FreezingRainCredits": "Freezing Rain {0}",
+ "FREOfflineMessage": "You are viewing sample weather data. Please connect to the Internet to see weather for your town/city.",
+ "FreshSnow": "Fresh Snow",
+ "FrigidCredits": "Frigid {0}",
+ "FromText": "From",
+ "FromToText": "From {0} to {1}",
+ "GenericSkiHeroImageText": "This is a generic image and does not represent the actual ski resort.",
+ "GettingStartedClusterTitle": "Getting Started",
+ "GraphDays": "{0} days",
+ "GraphHoursPerDay": "{0} hrs/day",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "Hail": "Hail",
+ "Haze": "Haze",
+ "Hazy Sunshine": "Hazy Sunshine",
+ "Heavy drizzle": "Heavy Drizzle",
+ "Heavy rain": "Heavy Rain",
+ "Heavy snow": "Heavy Snow",
+ "Heavy thunderstorms": "Heavy Storms",
+ "HeavyLegend": "Heavy",
+ "HeavyRainCredits": "Heavy Rain {0}",
+ "HectaresOpen": "Open Hectares",
+ "HighestLegend": "Highest",
+ "HighLowText": "{0}/{1}",
+ "HighMapSubType": "High",
+ "HighTemperatureMap": "High Temperature Forecast",
+ "HistoricalStringForRAIN": "In the past {0} years, it rained {1} out of {2} times on this day",
+ "HistoricalStringForSNOW": "In the past {0} years, it snowed {1} out of {2} times on this day",
+ "HistoricalStringForTHUNDER": "In the past {0} years, it thundered {1} out of {2} times on this day",
+ "HistoricalWeather": "Historical Weather",
+ "HistoricLengthWithUnit": "{0} {1}",
+ "holiday weatherUrl": "http://www.holiday-weather.com",
+ "HolidayWeather.com": "HolidayWeather.com",
+ "Home": "Home",
+ "Hot and Humid": "Hot and Humid",
+ "HourlyForecast": "Hourly Forecast",
+ "hourlyForecastAriaText": "{0}, {1} {2}, feels like {3}, precipitation {4}",
+ "HourlyForecastFeelsLikeTitle": "Feels like",
+ "HourlyForecastForecastTitle": "Forecast",
+ "hourlyForecastHeaderAriaText": "Read today's hourly forecast",
+ "HourlyForecastPrecipChanceTitle": "Precip. Chance",
+ "HourlyForecastTimeTitle": "Time",
+ "HourlyForecastWindTitle": "Wind",
+ "Humidity": "Humidity",
+ "HWAttribution": "Historical Weather by",
+ "Ice ": {
+ " Snow": "Ice / Snow"
+ },
+ "Ice pellets": "Ice Pellets",
+ "ImageCredits": "Image Credits",
+ "iMap Weather": "WDT",
+ "imap weatherUrl": "http://bit.ly/wdtconsumer",
+ "inPerHour": "in/hr",
+ "IntermediateRuns": "Intermediate Runs",
+ "Introduction": "Introduction",
+ "inUnit": "inches",
+ "Isolated Thunderstorms": "Isolated Storms",
+ "Japan": "Japan",
+ "JWSAttribution": "Japan daily forecasts by",
+ "JWSAttributionValue": "© Weather Service, Ltd",
+ "KilometresPerHour": "{0} kmph",
+ "KilometresPerHourAriaText": "{0} kilometres per hour",
+ "kWeather": "KWeather",
+ "KWeatherAttribution": "Korea Weather data by",
+ "kWeatherUrl": "http://www.kweather.co.kr",
+ "LastUpdatedDataTime": "Last updated {0}",
+ "LeftText": "Light",
+ "LegendName": "Precipitation",
+ "lessDailyConditionsAriaText": "Read the forecast from a single source",
+ "lessDailyConditionsDataText": "Less",
+ "LiftOpen": "Lifts Open",
+ "Light drizzle": "Light Drizzle",
+ "Light fog": "Light Fog",
+ "Light freezing drizzle": "Freezing Drizzle",
+ "Light freezing rain": "Freezing Rain",
+ "Light hail": "Light Hail",
+ "Light rain": "Light Rain",
+ "Light rain and snow": "Rain / Snow",
+ "Light rain and snow shower": "Rain / Snow",
+ "Light rain shower": "Light Rain",
+ "Light Showers": "Light Showers",
+ "Light snow": "Light Snow",
+ "Light snow shower": "Light Snow",
+ "LightLegend": "Light",
+ "LightShowersCredits": "Light Showers {0}",
+ "loading": "Loading",
+ "LocationDetectionFailed": "Your location cannot be detected. Try entering your location manually.",
+ "LocationDisabledError": "Your location cannot be found. Change your Permissions to allow Weather to use your location.",
+ "LocationNameLongFormat": "{0}, {1}, {2}",
+ "LocationNameShortFormat": "{0}, {1}",
+ "LocationPinnedToStart": "Unpin this location from the Start screen before setting it as your default location.",
+ "LocationSearchFetchError": "There was a problem. Please try your search again.",
+ "LocDetectionUnknownError": "A problem occurred while detecting your location. Please try again later.",
+ "London": "London",
+ "LowestLegend": "Lowest",
+ "LowMapSubType": "Low",
+ "LowTemperatureMap": "Low Temperature Forecast",
+ "MapFlyoutAltText": "Map animation",
+ "MapFlyoutAriaText": "map animation. {0} {1} on {2}",
+ "MapImageAltText": "Map",
+ "Maps": "Maps",
+ "MapsUnavailable": "Maps are currently unavailable. Please try again.",
+ "MarineAlertType": "Marine",
+ "MaxFavoritesLimitReached": "Your Favourites list is full. Please remove a location before adding a new one.",
+ "MaximumRecordedRainfall": "Record rainfall",
+ "MaximumRecordedSnow": "Record snow level",
+ "MaxPinnedLocationsLimitReached": "You have pinned the maximum number of locations. Please unpin a location before pinning a new one.",
+ "MeterPerSecond": "{0} m/s",
+ "MeterPerSecondAriaText": "{0} metres per second",
+ "Metres": "m",
+ "MilesPerHour": "{0} mph",
+ "MilesPerHourAriaText": "{0} miles per hour",
+ "MiscAlertType": "Miscellaneous",
+ "MixLegend": "Mix",
+ "mmPerHour": "mm/hr",
+ "MonthlyAvgBaseDepth": "Average Base Depth",
+ "MonthlyAvgSnowfall": "Average Snowfall",
+ "MonthlyDayLight": "Daylight",
+ "MonthlyMaxTemp": "Average High",
+ "MonthlyMinTemp": "Average Low",
+ "MonthlyRainfall": "Rainfall",
+ "MonthlyRainyDays": "Rainy Days",
+ "MonthlyRdBaseDepth": "Record Max. Base depth",
+ "MonthlyRdSnowfall": "Record High Snowfall",
+ "MonthlyRecordedHighTemp": "Record High",
+ "MonthlyRecordedLowTemp": "Record Low",
+ "MonthlySeaTemp": "Sea Temp.",
+ "MonthlySnowDays": "Snow Days",
+ "MonthlySunshine": "Sunshine",
+ "More Alerts": "More",
+ "moreDailyConditionsAriaText": "Read forecasts from multiple sources",
+ "moreDailyConditionsDataText": "More",
+ "MoreText": "More",
+ "Morning Fog ": {
+ " Afternoon Sun": "AM Fog / PM Sun",
+ " Cloudy": "AM Fog / Cloudy"
+ },
+ "Morning Ice ": {
+ " Snow": "AM Ice / Snow"
+ },
+ "Morning Rain": "Morning Rain",
+ "Morning Snow": "Morning Snow",
+ "Mostly clear": "Mostly Clear",
+ "Mostly Cloudy": "Mostly Cloudy",
+ "Mostly Sunny": "Mostly Sunny",
+ "MostlyCloudyCredits": "Mostly Cloudy {0}",
+ "Multiple Alerts Heading": "Alerts",
+ "MyPlaces": "Places",
+ "MyPlacesText": "My Places",
+ "N": "No",
+ "NameHeader": "Name",
+ "National": "National",
+ "NearbySkiResorts": "Nearby Ski Resorts",
+ "NearbyText": "Nearby",
+ "News": "News",
+ "NewSnowHeader": "New Snow",
+ "nextDailyConditionsDataText": "Read the forecast for more days",
+ "NextStepsClusterTitle": "Next Steps",
+ "NightHeading": "Night",
+ "NoInternetConnectionError": "You are not connected to the Internet. Please check your Internet connection and try again.",
+ "NoInternetOnSettingChange": "Your settings have been updated. Connect to the Internet to confirm your changes.",
+ "NoResortsFoundErrorText": "No resorts were found. Please change your filters and try again.",
+ "NorthAmerica": "North America",
+ "NorthAmericaRegion": "North/Central America",
+ "NoSearchResults": "No results matched your search.",
+ "ObservationMapSubType": "Observation",
+ "Oceania": "Australia/Pacific",
+ "ofText": "{0} of {1}",
+ "OnTheSnow": "On The Snow",
+ "OnTheSnowUrl": "http://www.onthesnow.com",
+ "OpenLiftsHeader": "Lifts Open",
+ "OpenTrailsHeader": "Pistes Open",
+ "OthersAlertType": "Others",
+ "Overview": "OVERVIEW",
+ "PacificIslands": "Pacific Islands",
+ "PanoramaControlsHiddenOnAriaLabel": "Panorama controls hidden",
+ "PanoramaControlsVisibleOnAriaLabel": "Panorama controls visible",
+ "Partly Cloudy": "Partly Cloudy",
+ "PartlyCloudyCredits": "Partly Cloudy {0}",
+ "Patchy fog": "Patchy Fog",
+ "pause": "Pause",
+ "PersonalizeText": "It's easy to follow the weather in places that you choose.",
+ "PersonalizeTitle": "Add your favourite places",
+ "PinButtonTitle": "Pin",
+ "play": "Play",
+ "PM Thunderstorms": "PM Storms",
+ "Precipitation": "Precipitation",
+ "PrecipitationAccumulationMap": "Precipitation Accumulation",
+ "precipitationAltText": "Precipitation",
+ "PrecipitationForecastMap": "Precipitation Forecast",
+ "PrecipitationMap": "Precipitation",
+ "PrecipitationObservationMap": "Precipitation Observation",
+ "prevDailyConditionsDataText": "Go back and read the forecast for previous days",
+ "Publisher": "Microsoft Corporation",
+ "RadarForecastMap": "Radar Forecast",
+ "RadarMap": "Radar",
+ "RadarObservationMap": "Radar Observation",
+ "Rain": "Rain",
+ "Rain ": {
+ " Snow": "Rain / Snow",
+ " Windy": "Rain / Windy"
+ },
+ "Rain and snow": "Rain / Snow",
+ "Rain and snow shower": "Rain / Snow",
+ "Rain showers": "Rain Showers",
+ "Rain turning to Snow": "Rain to Snow",
+ "RainAlertType": "Rain",
+ "RainCredits": "Rain {0}",
+ "RainfallAriaText": "Average monthly rainfall",
+ "RainfallFilter": "Rainfall",
+ "RainfallMap": "Rainfall",
+ "RainForecastMap": "Rain forecast",
+ "RainLegend": "Rain",
+ "RainSnowCredits": "Rain and Snow {0}",
+ "RecentSearches": "Recent Searches",
+ "RecommendedForFamiliesString": "Recommended for Families: {0}",
+ "RecordSnowfallYear": "{0} ({1})",
+ "RecordTemperatureYear": "{0}° ({1})",
+ "RefreshButtonTitle": "Refresh",
+ "Regional": "Regional",
+ "RelatedResorts": "Related Ski Resorts",
+ "RemoveButtonTitle": "Remove",
+ "ResortStatusClosed": "Closed",
+ "ResortStatusOpen": "Open",
+ "ResortStatusTemporarilyClosed": "Temporarily Closed",
+ "ResortStatusWeekendsOnly": "Weekends Only",
+ "RetryButtonLabel": "Try again",
+ "Reviews": "Reviews",
+ "RightText": "Heavy",
+ "SampleDataHeader": "{0} (Sample Data)",
+ "Satellite": "Satellite",
+ "SatelliteMap": "Satellite",
+ "Scattered Flurries": "Scattered Flurries",
+ "Scattered Thunderstorms": "Scattered Storms",
+ "ScatteredCloudsCredits": "Scattered Clouds {0}",
+ "ScatteredFlurriesCredits": "Scattered Flurries {0}",
+ "searchboxInvalidEntry": "Invalid location",
+ "searchboxPlaceHolderTest": "Search for a town or city",
+ "searchBoxText": "Search for a Town, City or Postcode",
+ "SearchButtonTitle": "Search",
+ "SearchHistory": "Search History",
+ "SearchPageHeaderSubTitle": "Search Results",
+ "SearchPageHeaderTitle": "”{0}”",
+ "SearchResultsAriaLabel": "Search Results",
+ "SearchResultsHeader": "{0} search results",
+ "SearchTypeText": "Search Type",
+ "SeeMoreTruncatedText": "See more...",
+ "Seoul": "Seoul",
+ "SetDefaultButtonTitle": "Set as Home",
+ "SetDefaultMaxLimitReached": "Your Favourites list is full. Please remove a location before setting a new one as your default location.",
+ "SetHomeLocationTitle": "Set Home Location",
+ "Settings": "Settings",
+ "Severe duststorm": "Severe Dust Storm",
+ "ShareDataDesc": "Get the complete forecast for places you care about with the Weather app, available in the Windows Store.",
+ "ShareDataNotAvailableError": "Weather data is not available for this location. Please try again later.",
+ "ShareDataUrl": "http://apps.microsoft.com/webpdp/app/421ba874-f903-4965-9b82-d60f3ba3cae0",
+ "ShareInvalidSharePageMessage": "Select a town or city and try again.",
+ "ShareLocationNotAvailableMessage": "This location is currently not available to share.",
+ "SharePageTitle": "{0} - MSN Weather",
+ "ShareSnippet": "Detailed weather conditions and forecast for {0}.",
+ "ShareWeatherUpdates": "Weather updates",
+ "ShortDateTimeFormatString": "{0} {1}",
+ "Showers": "Showers",
+ "Showers ": {
+ " Clear": "Showers / Clear"
+ },
+ "Single Alert Heading": "Alert",
+ "skiCurrentConditionsAriaText": "new snow {0}, base depth {1}, source {2}",
+ "SkiDataAttribution": "Ski resort and snow data provided by {0}",
+ "SkiDetailsImageAttribution": "Image provided by {0}",
+ "SkiResorts": "Ski Resorts",
+ "SkiResortsECVShareError": "There is nothing to share right now. Select a resort and try again.",
+ "SkiResortWebsiteString": "Resort Website",
+ "SkiReviewDateFormat": "{0} {1}, {2}",
+ "SkiReviewFamilyFriendly": "Family Friendly",
+ "SkiReviewFiveStarsText": "5 Stars",
+ "SkiReviewFourStarsText": "4 Stars",
+ "SkiReviewOverAllRating": "{0}/5",
+ "SkiReviewOverAllText": "Overall",
+ "SkiReviewRatings": "Ratings ({0})",
+ "SkiReviewThreeStarsText": "3 Stars",
+ "SkiReviewTwoStarsText": "2 & under",
+ "Sleet": "Sleet",
+ "Smoke": "Smoke",
+ "SnapTime": "{0} Local Time",
+ "Snow": "Snow",
+ "Snow ": {
+ " Windy": "Snow / Windy"
+ },
+ "Snow Showers": "Snow Showers",
+ "Snow Showers ": {
+ " Sun": "Snow / Sun"
+ },
+ "Snow turning to Rain": "Snow to Rain",
+ "SnowAccumulationMap": "Snow Accumulation",
+ "SnowAlertType": "Snow",
+ "SnowAriaText": "Average monthly snow",
+ "SnowCredits": "Snow {0}",
+ "SnowDataAttribution": "Snow data provided by {0}",
+ "SnowDaysFilter": "Snow days",
+ "SnowDepth": "Snow Depth",
+ "SnowDepthHeader": "Base Depth",
+ "SnowForecastMap": "Snow Forecast",
+ "SnowForecastMap.comment": "Snow Forecast map title",
+ "SnowLegend": "Snow",
+ "SnowMap": "Snow",
+ "SnowObservationMap": "Snow Observation",
+ "South Korea": "South Korea",
+ "SouthAmerica": "South America",
+ "SpeedUnitsInBFTWithDirection": "{0} {1} bft",
+ "SpeedUnitsInBFTWithDirectionAriaText": "{0} {1} Beaufort",
+ "SpeedUnitsInKMPHWithDirection": "{0} {1} kmph",
+ "SpeedUnitsInKMPHWithDirectionAriaText": "{0} {1} kilometres per hour",
+ "SpeedUnitsInMPHWithDirection": "{0} {1} mph",
+ "SpeedUnitsInMPHWithDirectionAriaText": "{0} {1} miles per hour",
+ "SpeedUnitsInMPSWithDirection": "{0} {1} m/s",
+ "SpeedUnitsInMPSWithDirectionAriaText": "{0} {1} metres per second",
+ "Squalls": "Squalls",
+ "StatementAlertSubType": "Statement",
+ "Status": "Resort Status",
+ "StatusHeader": "Status",
+ "StormAlertType": "Storm",
+ "Summit": "Summit",
+ "Sunny ": {
+ " Windy": "Sunny / Windy"
+ },
+ "Sunny (Clear)": "Sunny (Clear)",
+ "Sunrise": "Sunrise",
+ "Sunset": "Sunset",
+ "SunshineAndSeaTempAttribution": "Sunshine & Sea temp. by",
+ "SunshineAndSeaTempAttributionAriaText": "Sunshine & Sea temperature by {0}",
+ "SunshineAriaText": "Average monthly sunshine",
+ "SunshineAttribution": "Sunshine by",
+ "SunshineAttributionAriaText": "Sunshine by {0}",
+ "SunshineFilter": "Sunshine",
+ "SunshineSeaTempAttribution": "Sunshine & Sea temperature data by",
+ "Taipei": "Taipei",
+ "Taiwan": "Taiwan",
+ "TakeATourText": "Get more out of MSN Weather with great maps and in-depth data.",
+ "TakeATourTitle": "Take a tour",
+ "TempClosed": "Temp. Closed",
+ "Temperature": "Temperature",
+ "TemperatureAriaText": "Average monthly temperature",
+ "TemperatureFilter": "Temperature",
+ "TemperatureForecastMap": "Temperature Forecast",
+ "TemperatureMap": "Temperature",
+ "TemperatureWithDegreeCelsius": "{0}°C",
+ "TemperatureWithDegreeFahrenheit": "{0}°F",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "Thunderstorms": "Thunderstorms",
+ "ThunderstormsCredits": "Thunderstorms {0}",
+ "TianQiAttribution": "Daily forecasts by",
+ "Today": "Today",
+ "TodayMapSubType": "Today",
+ "Tokyo": "Tokyo",
+ "ToolTipTextC": "Click to change to Celsius",
+ "ToolTipTextF": "Click to change to Fahrenheit",
+ "ToText": "to",
+ "TrailmapAttribution": "Trail map provided by {0}",
+ "Trailmapimage": "Trail map image",
+ "TrailsOpen": "Pistes Open",
+ "Travel": "Travel",
+ "Tubing": "Tubing",
+ "United Kingdom": "United Kingdom",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInDay": "{0} day",
+ "UnitInDays": "{0} days",
+ "UnitInHectorPascal": "{0} hp",
+ "UnitInHectorPascalAriaText": "{0} hectopascals",
+ "UnitInHourPerDay": "{0} hr/day",
+ "UnitInHoursPerDay": "{0} hrs/day",
+ "UnitInInches": "{0} in",
+ "UnitInKilometres": "{0} km",
+ "UnitInMiles": "{0} mi",
+ "UnitInMillibars": "{0} mb",
+ "UnitInMillibarsAriaText": "{0} millibars",
+ "UnitInMillimeters": "{0} mm",
+ "UnitInMillimetersHg": "{0} mmHg",
+ "UnitInMillimetersHgAriaText": "{0} millimetres Hg",
+ "UnitInPercentage": "{0}%",
+ "UnknownCredits": "Unknown {0}",
+ "UnpinButtonTitle": "Unpin",
+ "UntilText": "until",
+ "UvExtreme": "{0} (Extreme)",
+ "UvHigh": "{0} (High)",
+ "UvIndex": "UV Index",
+ "UvLow": "{0} (Low)",
+ "UvModerate": "{0} (Moderate)",
+ "UvVeryHigh": "{0} (Very High)",
+ "VerticalDrop": "Vertical Drop",
+ "Visibility": "Visibility",
+ "WarningAlertSubType": "Warning",
+ "WatchAlertSubType": "Watch",
+ "weather undergroundUrl": "http://www.wunderground.com",
+ "Weather.com": "weather.com",
+ "weather.comUrl": "http://www.weather.com",
+ "Weather2Travel": "Weather2Travel",
+ "weather2travelUrl": "http://www.weather2travel.com",
+ "WeatherAlertsMap": "Weather alerts",
+ "WeatherDataNotAvailable": "Weather data is not available for this location. Please try again later or enter a different location.",
+ "WeatherDotComForecastAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-tenday",
+ "WeatherDotComMapsAttribution": "View interactive maps at {0}",
+ "WeatherDotComMapsAttributionUrlPrefix": "http://bing.weather.com/weather/map/interactive/",
+ "WeatherDotComMapsAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-Imap",
+ "WeatherDotComSeeMoreText": "See more from weather.com",
+ "WeatherMaps": "Weather Maps",
+ "WebsiteHeader": "Website",
+ "Wind": "Wind",
+ "WindAlertType": "Wind",
+ "WindHeader": "Wind",
+ "WindSpeedUnitForE": "E",
+ "WindSpeedUnitForENE": "ENE",
+ "WindSpeedUnitForESE": "ESE",
+ "WindSpeedUnitForN": "N",
+ "WindSpeedUnitForNE": "NE",
+ "WindSpeedUnitForNNE": "NNE",
+ "WindSpeedUnitForNNW": "NNW",
+ "WindSpeedUnitForNW": "NW",
+ "WindSpeedUnitForS": "S",
+ "WindSpeedUnitForSE": "SE",
+ "WindSpeedUnitForSSE": "SSE",
+ "WindSpeedUnitForSSW": "SSW",
+ "WindSpeedUnitForSW": "SW",
+ "WindSpeedunitForW": "W",
+ "WindSpeedUnitForWNW": "WNW",
+ "WindSpeedUnitForWSW": "WSW",
+ "Windy": "Windy",
+ "WindyCredits": "Windy {0}",
+ "WithinText": "Within",
+ "Wolfram Alpha": "Wolfram Alpha",
+ "wolfram alphaUrl": "http://www.wolframalpha.com",
+ "Wolfram|Alpha": "Wolfram Alpha",
+ "wolfram|alphaUrl": "http://www.wolframalpha.com",
+ "WorldHeading": "World",
+ "WorldMapAltText": "World map",
+ "WorldWeather": "World Weather",
+ "WorldWeatherContinent": "World weather {0}",
+ "WorldWeatherTitle": "World Weather",
+ "WWHighLowSeperator": "/",
+ "Y": "Yes"
+ },
+ "worldweather": {
+ "Addis Ababa": "Addis Ababa",
+ "Adelaide": "Adelaide",
+ "Alexandria": "Alexandria",
+ "ALGERIA": "Algeria",
+ "Algiers": "Algiers",
+ "Amsterdam": "Amsterdam",
+ "Arawa": "Arawa",
+ "ARGENTINA": "Argentina",
+ "Asunción": "Asunción",
+ "Athens": "Athens",
+ "Auckland": "Auckland",
+ "AUSTRALIA": "Australia",
+ "AUSTRIA": "Austria",
+ "Baghdad": "Baghdad",
+ "Bangkok": "Bangkok",
+ "Barcelona": "Barcelona",
+ "Beijing": "Beijing",
+ "Berlin": "Berlin",
+ "Bogota": "Bogota",
+ "BOLIVIA": "Bolivia",
+ "Brasília": "Brasília",
+ "BRAZIL": "Brazil",
+ "Brisbane": "Brisbane",
+ "Buenos Aires": "Buenos Aires",
+ "Cairo": "Cairo",
+ "CANADA": "Canada",
+ "Cancún": "Cancún",
+ "Cape Town": "Cape Town",
+ "Caracas": "Caracas",
+ "Casablanca": "Casablanca",
+ "Chicago": "Chicago",
+ "CHILE": "Chile",
+ "CHINA": "China",
+ "COLOMBIA": "Colombia",
+ "Colombo": "Colombo",
+ "Darwin": "Darwin",
+ "Dubai": "Dubai",
+ "Dublin": "Dublin",
+ "Durban": "Durban",
+ "ECUADOR": "Ecuador",
+ "EGYPT": "Egypt",
+ "ETHIOPIA": "Ethiopia",
+ "FIJI": "Fiji",
+ "FINLAND": "Finland",
+ "FRANCE": "France",
+ "Georgetown": "Georgetown",
+ "GERMANY": "Germany",
+ "GREECE": "Greece",
+ "GUYANA": "Guyana",
+ "Helsinki": "Helsinki",
+ "Hobart": "Hobart",
+ "Ibadan": "Ibadan",
+ "INDIA": "India",
+ "IRAQ": "Iraq",
+ "IRELAND": "Ireland",
+ "Istanbul": "Istanbul",
+ "ITALY": "Italy",
+ "JAPAN": "Japan",
+ "Juneau": "Juneau",
+ "Kampala": "Kampala",
+ "KENYA": "Kenya",
+ "KOREA": "Korea",
+ "Kyiv": "Kyiv",
+ "La Paz": "La Paz",
+ "Lagos": "Lagos",
+ "Lima": "Lima",
+ "London": "London",
+ "Los Angeles": "Los Angeles",
+ "Melbourne": "Melbourne",
+ "MEXICO": "Mexico",
+ "Mexico City": "Mexico City",
+ "Miami": "Miami",
+ "MOROCCO": "Morocco",
+ "Moscow": "Moscow",
+ "Mumbai": "Mumbai",
+ "Nairobi": "Nairobi",
+ "NETHERLANDS": "Netherlands",
+ "New Delhi": "New Delhi",
+ "New York City": "New York",
+ "NEW ZEALAND": "New Zealand",
+ "NIGERIA": "Nigeria",
+ "PAPUA NEW GUINEA": "Papua New Guinea",
+ "PARAGUAY": "Paraguay",
+ "Paris": "Paris",
+ "Perth": "Perth",
+ "PERU": "Peru",
+ "Port Moresby": "Port Moresby",
+ "Quito": "Quito",
+ "Rio de Janeiro": "Rio de Janeiro",
+ "Rio Gallegos": "Rio Gallegos",
+ "Riyadh": "Riyadh",
+ "Rome": "Rome",
+ "RUSSIA": "Russia",
+ "San Francisco": "San Francisco",
+ "Santiago": "Santiago",
+ "SAUDI ARABIA": "Saudi Arabia",
+ "Seattle": "Seattle",
+ "Seoul": "Seoul",
+ "Shanghai": "Shanghai",
+ "Singapore": "Singapore",
+ "SINGAPORE_CAPS": "Singapore",
+ "SOUTH AFRICA": "South Africa",
+ "SPAIN": "Spain",
+ "SRI LANKA": "Sri Lanka",
+ "Suva": "Suva",
+ "Sydney": "Sydney",
+ "THAILAND": "Thailand",
+ "Tokyo": "Tokyo",
+ "Toronto": "Toronto",
+ "TURKEY": "Turkey",
+ "UGANDA": "Uganda",
+ "UKRAINE": "Ukraine",
+ "UNITED ARAB EMIRATES": "United Arab Emirates",
+ "UNITED KINGDOM": "United Kingdom",
+ "UNITED STATES": "United States",
+ "Vancouver": "Vancouver",
+ "VENEZUELA": "Venezuela",
+ "Victoria Falls": "Victoria Falls",
+ "Vienna": "Vienna",
+ "Washington D.C.": "Washington, D.C.",
+ "Wellington": "Wellington",
+ "ZIMBABWE": "Zimbabwe"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/en-ca.json b/packages/microsoft.bingweather/resources/en-ca.json
new file mode 100644
index 00000000..046059f6
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/en-ca.json
@@ -0,0 +1,1429 @@
+{
+ "AppEx.WeatherApp.Services": {
+ "Resources": {
+ "Country": "Country/Region",
+ "KilometresPerHour": "{0} kmph",
+ "MilesPerHour": "{0} mph",
+ "Region": "State/Province",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInInches": "{0} in"
+ }
+ },
+ "Platform": {
+ "aboutLabel": "About",
+ "accept": "Accept",
+ "Add": "Add",
+ "addMoreFilters": "Add/Remove More Filters",
+ "advertisement": "Advertisement",
+ "AppIsPersonalized": "{0} is personalized. ",
+ "appRestart": "(Requires app restart)",
+ "AppTitle": "the app",
+ "appVersion": "Version {0}",
+ "ArticleHeaderSubscriptionMessage": "Subscribe",
+ "ArticleLinkLabelText": "View article",
+ "ArticleSubscriptionMessage": "Subscribe for unlimited access",
+ "ArticleTextSizeLarge": "Large",
+ "ArticleTextSizeMedium": "Medium",
+ "ArticleTextSizeMenuLabel": "Text size",
+ "ArticleTextSizeSmall": "Small",
+ "ArticleTextSizeXLarge": "X-Large",
+ "ArticleTextStyleMenuLabel": "Text style",
+ "ArticleUnavailableOffline": "This article is not available offline.",
+ "AverageMarketCharacterSizePx": "8",
+ "brand": "MSN",
+ "Calendar": "Calendar",
+ "cancel": "Cancel",
+ "catastrophicError": "There is a problem with the application. Please restart.",
+ "changeMarketTo": "{0} ({1})",
+ "changeSettings": "Change Settings",
+ "changesFromAppSettings": "You can make these changes at any time using app settings",
+ "clearFiltersLabel": "Reset Filters",
+ "ClickToOpenL2": "Select to show sub-channel",
+ "close": "Close",
+ "closeAppButton": "Close app",
+ "ConnectMicrosoftAccount": "Connect Microsoft account",
+ "ConnectMyMicrosoftAccount": "Connect my Microsoft account",
+ "ConnectToMicrosoft": "Connect to Microsoft",
+ "createAccountButton": "Create an account >",
+ "credentialMessage": "Enter a username and password to access {0}.",
+ "credentialsInvalid": "Invalid credentials. Please try again.",
+ "creditsLink": "Credits",
+ "DaysAgo": "{0} days ago",
+ "decline": "Decline",
+ "Delete": "Delete",
+ "demoModeTitle": "This feature is not available in demo mode.",
+ "demoMode_label": "DEMO MODE",
+ "demoMode_lastUpdated": "Tour the app in demo mode.",
+ "Dismiss": "Dismiss",
+ "entitlementsInvalid": "Sorry, your subscription does not include this device.",
+ "featured": "Featured",
+ "feedbackButtonLabel": "Feedback",
+ "feedbackCommentQuestion": "What could we do to improve the app?",
+ "feedbackDislikeIcon": "]D83D;]DE29;",
+ "feedbackDislikeLabel": "Dislike",
+ "feedbackLikeIcon": "]D83D;]DE0A;",
+ "feedbackLikeLabel": "Like",
+ "feedbackOfflineMessage": "It looks like you are currently offline. Please connect to the Internet and try again.",
+ "feedbackPrivacyStatementLabel": "Privacy statement",
+ "feedbackQ1option1": "Very good",
+ "feedbackQ1option2": "Good",
+ "feedbackQ1option3": "Average",
+ "feedbackQ1option4": "Poor",
+ "feedbackQ1option5": "Very Poor",
+ "feedbackQ2option1": "Definitely would recommend",
+ "feedbackQ2option2": "Probably would recommend",
+ "feedbackQ2option3": "Might or might not recommend",
+ "feedbackQ2option4": "Probably would not recommend",
+ "feedbackQ2option5": "Definitely would not recommend",
+ "feedbackQuestion1": "How would you rate this app?",
+ "feedbackQuestion2": "How likely would you be to recommend this app to a friend?",
+ "feedbackSubmitButtonLabel": "Submit",
+ "feedbackThankYou": "Thank you for your feedback!",
+ "filmstrip": "Filmstrip",
+ "FilterAll": "Show All",
+ "FilterBy": "Filter By:",
+ "filterMenu": "Filter Menu",
+ "forceUpdate": "This version of {0} is no longer supported. Please update to the latest version.",
+ "forgotPasswordButton": "Forgotten password >",
+ "freeformTextWarning": "Thanks for taking the time to add your feedback. Please take care not to provide any personal information.",
+ "GoBack": "Go back",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "HelpLabel": "Help",
+ "HoursAgo": "{0} hours ago",
+ "imageAttribution": "Image attribution",
+ "ImageCount": "Photo {0} of {1}",
+ "impressum": "Impressum",
+ "invalidEntry": "No results found. Please try again.",
+ "InvalidSubscriptionMessage": "The article that you are trying to read is locked. Please get a valid subscription.",
+ "L2Opened": "Sub-channels Shown",
+ "LabelChangeTheseSettings": "Change these settings",
+ "LabelClickToChange": "Click here to change settings",
+ "LabelModifySettings": "Modify settings",
+ "LabelOff": "Off",
+ "LabelOn": "On",
+ "LabelPrivacyStatement": "Privacy Statement",
+ "LabelTapToChange": "Tap here to change settings",
+ "languageSetting": "Choose edition",
+ "lca_privacy": "Privacy Statement",
+ "lca_serviceAgreement": "Terms of Use",
+ "Loading": "Loading",
+ "LocationCannotBeFound": "Your location cannot be found. Change your permissions to allow News to use your location.",
+ "Login": "Sign In",
+ "loginPrompt": "Enter your {0} account",
+ "loginPromptContentLocked": "The article you are trying to read is locked. Please log in.",
+ "Logout": "Sign Out",
+ "marketChangePrompt": "Please close and reopen the app for your content preference changes to take effect.",
+ "marketError": "This app is not available in your market.",
+ "marketSelDialogMsg": "You are viewing content from {0} ({1}). You can change this option at any time from the settings charm.",
+ "marketSelDialogMsgOpt": "You are viewing content from {0} ({1}). You can change this setting in the app at any time.",
+ "marketSelDialogTitle": "Which content and language would you like to see?",
+ "marketSelDialogTitleOpt": "Where would you like to view content from?",
+ "mediaPlaybackButtonsAriaLabel": "Playback buttons",
+ "mediaPlaybackContentRegionAriaLabel": "Media playback",
+ "mediaPlaybackControlsAriaLabel": "Playback controls",
+ "mediaPlaybackControlsLayerAriaLabel": "Playback controls",
+ "mediaPlaybackEnterFullScreenAriaLabel": "Show Full Screen",
+ "mediaPlaybackLeaveFullScreenAriaLabel": "Exit Full Screen",
+ "mediaPlaybackMinimalAriaLabel": "Currently Playing",
+ "mediaPlaybackNextButtonAriaLabel": "Next",
+ "mediaPlaybackPauseButtonAriaLabel": "Pause",
+ "mediaPlaybackPlayButtonAriaLabel": "Play",
+ "mediaPlaybackPreviousButtonAriaLabel": "Previous",
+ "mediaPlaybackSeekBarAriaLabel": "Seek bar",
+ "mediaPlaybackSeekBarThumbAriaLabel": "Seek bar slider",
+ "mediaPlaybackShareAriaLabel": "Share",
+ "mediaPlaybackTimeIndicatorAriaLabel": "Playback time indicator",
+ "MessageAccessingMSAinfo": "Accessing your Microsoft account information. ",
+ "MessageAccountConnect1": "To enable personalization and syncing across devices, connect your Microsoft account in PC Settings.",
+ "MessageAccountConnect2": "To enable personalization and syncing across devices, {0}.",
+ "MessageAdSettingsLocation": "Select “Microsoft Advertising” in Settings to control the personalization of ads in this app. ",
+ "MessageAdSettingsOff": "You are not receiving personalized ads. Select “Microsoft Advertising” in Settings to get personalized ads.",
+ "MessageAdSettingsOn1": "Microsoft Advertising is using your information to personalize ads. Select “Microsoft Advertising” in Settings to turn this off. ",
+ "MessageAdSettingsOn2": "Microsoft Advertising is using your information to personalize ads. Select “Microsoft Advertising” in Settings to turn off personalized ads. ",
+ "MessageConfiguredMSAinfo": "Configured using your Microsoft account information. ",
+ "MessageConnect": "Connect",
+ "MessageConnectAccount": "Connect account",
+ "MessageConnectMicrosoftAccount": "connect your Microsoft account",
+ "MessageCustomizedMSAinfo": "Customized with your Microsoft account information. ",
+ "MessageMSAConnectionDescription": "This will synchronize information between this app and your Microsoft account to personalize this and other Microsoft experiences across your devices.",
+ "MessageMSASignIn": "To enable personalization and synchronization across devices, sign in to your Microsoft account. ",
+ "MessageOptimizedMSAinfo": "Optimized with your Microsoft account information. ",
+ "MessagePersonalize": "Use information from this app and associated with my Microsoft account to personalize this and other Microsoft experiences.",
+ "MessagePersonalizedMSAinfo": "Personalized with your Microsoft account information. ",
+ "MessagePersonalizeSettings": "Personalize settings",
+ "MessagePrivacySettings": "Privacy settings",
+ "MessagePrivacyUpdateButton": "Learn more",
+ "MessagePrivacyUpdateCloseButton": "Dismiss",
+ "MessagePrivacyUpdated": "We have updated our Privacy Statement.",
+ "MessagePrivacyUpdateLink": "Learn more",
+ "MessagePrivacyUpdateNotif": "We are updating our Privacy Statement.",
+ "MessageRoam": "Sync this app's settings across my devices. ",
+ "MessageTermsAndPrivacyUpdated": "We have updated our Terms of Use and Privacy Statement.",
+ "MessageTermsAndPrivacyUpdateNotif": "We are updating our Terms of Use and Privacy Statement.",
+ "MessageTermsUpdateButton": "Learn more",
+ "MessageTermsUpdateCloseButton": "Dismiss",
+ "MessageTermsUpdated": "We have updated our Terms of Use.",
+ "MessageTermsUpdateLink": "Learn more",
+ "MessageTermsUpdateNotif": "We are updating our Terms of Use.",
+ "MessageUsingMSAinfo": "Using your Microsoft account information. ",
+ "MicrosoftAccount": "Microsoft",
+ "MicrosoftAdvertisingPrivacyLinkText": "Microsoft Advertising Privacy Statement.",
+ "MicrosoftAdvertisingSettingsText": "To control ad personalization, see the ",
+ "MinsAgo": "{0} mins ago",
+ "More": "More",
+ "MoreArticles": "Upcoming",
+ "MoreFrom": "More from",
+ "MSAccountNameLabel": "Account name",
+ "MSAConnectionRemoveLink": "Remove",
+ "MSAConnectLabel": "Connect",
+ "NextArticle": "Next article",
+ "nextButton": "Next Item",
+ "noInternetButton": "Try Again",
+ "noInternetDescription": "Please check your Internet connection.",
+ "noInternetTitle": "You are not connected to the Internet.",
+ "noThanks": "No, Thanks",
+ "offLabel": "Off",
+ "offline_label": "OFFLINE",
+ "offline_lastUpdated": "Last Updated {0}",
+ "offline_noContent": "This content is not available in offline mode.",
+ "offline_problem": "The application ran into a problem and couldn’t load the content.",
+ "okButton": "OK",
+ "OneDayAgo": "1 day ago",
+ "OneHourAgo": "1 hour ago",
+ "OneMinAgo": "1 min ago",
+ "open": "Open",
+ "OpenInBrowser": "View in browser",
+ "optionsTitle": "Options",
+ "other": "Other",
+ "otherButton": "Other Markets",
+ "overLimitMessage": "{0} may use a large amount of data for some features. Your metered connection is over the data limit and fees may apply",
+ "Page": "Page {0}",
+ "PageOf": "Page {0} of {1}",
+ "password": "Password",
+ "passwordInput": "Password",
+ "Pause": "Pause",
+ "PaywallCardByAuthor": "By {0}",
+ "PaywallCardDay": "day",
+ "PaywallCardGrowlMessage": "You have used +{0} of {1}+ free token(s) from {2} {3}.",
+ "PaywallCardHour": "hour",
+ "PaywallCardMonth": "month",
+ "PaywallCardQuotaReachedMessage": "You can continue to enjoy up to {0} free token(s) per {1} or subscribe for unlimited access.",
+ "PaywallcardReadArticle": "Read article",
+ "PaywallCardSignIn": "Sign In",
+ "PaywallCardSubscribe": "Subscribe",
+ "PaywallCardThisHour": "this hour",
+ "PaywallCardThisMonth": "this month",
+ "PaywallCardThisWeek": "this week",
+ "PaywallCardThisYear": "this year",
+ "PaywallCardToday": "today",
+ "PaywallCardUnlimitedAccess": "Subscribe for Unlimited Access",
+ "PaywallCardWeek": "week",
+ "PaywallCardYear": "year",
+ "PhotosynthControlsHiddenAriaLabel": "Panorama controls hidden",
+ "PhotosynthControlsVisibleAriaLabel": "Panorama controls visible",
+ "pinToStart": "Pin to Start",
+ "Play": "Play",
+ "poweredBy": "Powered by {0}",
+ "PreviousArticle": "Previous article",
+ "previousButton": "Previous Item",
+ "privacyPolicy": "Privacy Policy",
+ "progressAlertAriaLabel": "Alert",
+ "readingList": "Saved",
+ "refresh": "Refresh",
+ "RegionCurrentLocation": "Current Location",
+ "RegionSelectLabel": "Update regional sources for your city",
+ "RegionSelectNone": "(None)",
+ "RelatedArticles": "Related",
+ "Resources": {
+ "LanguageID": "4105",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharic",
+ "Language_ar": "Arabic",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamese",
+ "Language_az": "Azeri (Latin)",
+ "Language_az-Cyrl": "Azerbaijani (Cyrillic)",
+ "Language_az-Latn": "Azerbaijani (Latin)",
+ "Language_ba-Cyrl": "Bashkir",
+ "Language_be": "Belarusian",
+ "Language_bg": "Bulgarian",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesh)",
+ "Language_bn-in": "Bangla (India)",
+ "Language_br-Latn": "Breton",
+ "Language_bs": "Bosnian (Latin)",
+ "Language_bs-Cyrl": "Bosnian (Cyrillic)",
+ "Language_bs-Latn": "Bosnian (Latin)",
+ "Language_ca": "Catalan",
+ "Language_ca-ES-valencia": "Valencian",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Corsican",
+ "Language_cs": "Czech",
+ "Language_cy": "Welsh",
+ "Language_da": "Danish",
+ "Language_de": "German",
+ "Language_dsb": "Lower Sorbian",
+ "Language_dv": "Divehi",
+ "Language_el": "Greek",
+ "Language_en": "English",
+ "Language_es": "Spanish",
+ "Language_et": "Estonian",
+ "Language_eu": "Basque",
+ "Language_fa": "Persian",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnish",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Faroese",
+ "Language_fr": "French",
+ "Language_fy": "Frisian",
+ "Language_ga": "Irish",
+ "Language_gd": "Scottish Gaelic",
+ "Language_gd-Latn": "Scottish Gaelic",
+ "Language_gl": "Galician",
+ "Language_gsw": "Alsatian",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Hausa (Latin)",
+ "Language_ha-Latn": "Hausa (Latin)",
+ "Language_he": "Hebrew",
+ "Language_hi": "Hindi",
+ "Language_hr": "Croatian",
+ "Language_hsb": "Upper Sorbian",
+ "Language_hu": "Hungarian",
+ "Language_hy": "Armenian",
+ "Language_id": "Indonesian",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Icelandic",
+ "Language_it": "Italian",
+ "Language_iu-Latn": "Inuktitut (Latin)",
+ "Language_ja": "Japanese",
+ "Language_ka": "Georgian",
+ "Language_kk": "Kazakh",
+ "Language_kl": "Greenlandic",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Korean",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdish",
+ "Language_ku-Arab": "Central Kurdish",
+ "Language_ky": "Kyrgyz",
+ "Language_ky-Cyrl": "Kyrgyz",
+ "Language_lb": "Luxembourgish",
+ "Language_lo": "Lao",
+ "Language_lt": "Lithuanian",
+ "Language_lv": "Latvian",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Macedonian",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolian (Cyrillic)",
+ "Language_mn-Cyrl": "Mongolian (Cyrillic)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malay",
+ "Language_mt": "Maltese",
+ "Language_nb": "Norwegian (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Dutch",
+ "Language_nn": "Norwegian (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Occitan",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabic)",
+ "Language_pl": "Polish",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashto",
+ "Language_pt": "Portuguese",
+ "Language_pt-br": "Portuguese (Brazil)",
+ "Language_pt-pt": "Portuguese (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Romanian",
+ "Language_ru": "Russian",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sakha",
+ "Language_sd-Arab": "Sindhi (Arabic)",
+ "Language_se-Latn": "Northern Sami",
+ "Language_si": "Sinhala",
+ "Language_sk": "Slovak",
+ "Language_sl": "Slovenian",
+ "Language_sma-Latn": "Southern Sami",
+ "Language_smj-Latn": "Lule Sami",
+ "Language_smn-Latn": "Inari Sami",
+ "Language_sms-Latn": "Skolt Sami",
+ "Language_sq": "Albanian",
+ "Language_sr-Cyrl": "Serbian (Cyrillic)",
+ "Language_sr-cyrl-ba": "Serbian (Cyrillic, Bosnia and Herzegovina)",
+ "Language_sr-Latn": "Serbian (Latin)",
+ "Language_sv": "Swedish",
+ "Language_sw": "Kiswahili",
+ "Language_syr-Syrc": "Syriac",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tajik (Cyrillic)",
+ "Language_th": "Thai",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmen (Latin)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Turkish",
+ "Language_tt": "Tatar",
+ "Language_tt-Cyrl": "Tatar (Cyrillic)",
+ "Language_tzm-Latn": "Tamazight (Latin)",
+ "Language_ug": "Uyghur",
+ "Language_ug-Arab": "Uyghur",
+ "Language_uk": "Ukrainian",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Uzbek (Cyrillic)",
+ "Language_uz-Latn": "Uzbek (Latin)",
+ "Language_vi": "Vietnamese",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinese (Simplified)",
+ "Language_zh-Hant": "Chinese (Traditional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "United Arab Emirates",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua and Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "American Samoa",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaijan",
+ "Region_Display_BA": "Bosnia and Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgium",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brazil",
+ "Region_Display_BS": "The Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos (Keeling) Islands",
+ "Region_Display_CD": "Congo (DRC)",
+ "Region_Display_CF": "Central African Republic",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Switzerland",
+ "Region_Display_CI": "Côte d’Ivoire",
+ "Region_Display_CK": "Cook Islands",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Cameroon",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia and Montenegro (Former)",
+ "Region_Display_CV": "Cape Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas Island",
+ "Region_Display_CY": "Cyprus",
+ "Region_Display_CZ": "Czech Republic",
+ "Region_Display_DE": "Germany",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Denmark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominican Republic",
+ "Region_Display_DZ": "Algeria",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egypt",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spain",
+ "Region_Display_ET": "Ethiopia",
+ "Region_Display_FI": "Finland",
+ "Region_Display_FK": "Falkland Islands (Islas Malvinas)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Faroe Islands",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "United Kingdom",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "French Guiana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Greenland",
+ "Region_Display_GM": "The Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Equatorial Guinea",
+ "Region_Display_GR": "Greece",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong SAR",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatia",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Hungary",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Ireland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Iraq",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Iceland",
+ "Region_Display_IT": "Italy",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordan",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kyrgyzstan",
+ "Region_Display_KH": "Cambodia",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoros",
+ "Region_Display_KN": "Saint Kitts and Nevis",
+ "Region_Display_KR": "Korea",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Cayman Islands",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Lebanon",
+ "Region_Display_LC": "Saint Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lithuania",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Latvia",
+ "Region_Display_LY": "Libya",
+ "Region_Display_MA": "Morocco",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "Saint Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall Islands",
+ "Region_Display_MK": "Macedonia, FYRO",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao SAR",
+ "Region_Display_MP": "Northern Mariana Islands",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexico",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "New Caledonia",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk Island",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Netherlands",
+ "Region_Display_NO": "Norway",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "New Zealand",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "French Polynesia",
+ "Region_Display_PG": "Papua New Guinea",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Poland",
+ "Region_Display_PM": "Saint Pierre and Miquelon",
+ "Region_Display_PN": "Pitcairn Islands",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Reunion",
+ "Region_Display_RO": "Romania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Russia",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Saudi Arabia",
+ "Region_Display_SB": "Solomon Islands",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Sweden",
+ "Region_Display_SG": "Singapore",
+ "Region_Display_SH": "Saint Helena, Ascension and Tristan da Cunha",
+ "Region_Display_SI": "Slovenia",
+ "Region_Display_SK": "Slovakia",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "South Sudan",
+ "Region_Display_ST": "São Tomé and Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Syria",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks and Caicos Islands",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tajikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunisia",
+ "Region_Display_TR": "Turkey",
+ "Region_Display_TT": "Trinidad and Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "United States",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistan",
+ "Region_Display_VA": "Holy See (Vatican City)",
+ "Region_Display_VC": "Saint Vincent and the Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "British Virgin Islands",
+ "Region_Display_VI": "U.S. Virgin Islands",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis and Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Sint Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "South Africa",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabwe"
+ },
+ "restart": "Restart",
+ "retry": "Try Again",
+ "roamingMessage": "{0} may use a large amount of data for some features. You are currently roaming and data fees may apply.",
+ "row": "Row",
+ "scrollLeftAriaLabel": "Scroll Left",
+ "scrollRightAriaLabel": "Scroll Right",
+ "semanticZoomContainer": "Semantic Zoom Container",
+ "sendFeedbackButtonLabel": "Send Feedback",
+ "ShareArticleHeader": "Share",
+ "ShareArticleText": "Share this article",
+ "Slide": "Image",
+ "Slideshow": "Slideshow",
+ "SnappedMessage": "Snap mode is coming soon.",
+ "SortBy": "SORT BY",
+ "sortLabel": "Sort",
+ "sortText": "Sort",
+ "sponsoredBy": "Sponsored by",
+ "standardErrorButton": "Try Again",
+ "standardErrorDescription": "There was a problem. Please try again.",
+ "standardErrorTitle": "This page failed to load.",
+ "submit": "Submit",
+ "subscribeButton": "Subscribe",
+ "subscribeInstructions": "Enter username and password",
+ "subscribeNow": "Subscribe now and get:",
+ "subscribePanoButton": "Subscribe for Unlimited Access",
+ "subscribePrompt": "Content for subscribers only",
+ "swipeDownToolTip": "Swipe down to select",
+ "swipeLeftToolTip": "Swipe left to select",
+ "swipeRightToolTip": "Swipe right to select",
+ "TermsOfUse": "Terms of Use",
+ "TextStylePrimary": "Primary",
+ "TextStyleSecondary": "Secondary",
+ "timeIndicatorTextFormat": "{0} / {1}",
+ "TitleAccountSettings": "Account",
+ "TitleAccountsSettings": "Account",
+ "TitleAdSettings": "Advertising settings",
+ "TitleConfiguration": "Configuration",
+ "TitleCustomization": "Customization",
+ "TitleMicrosoftAccount": "Microsoft account",
+ "TitleMSAConnectedDescription": "Connected to your Microsoft account",
+ "TitleMSAConnectionDescription": "Connect your Microsoft account",
+ "TitlePersonalization": "Personalization",
+ "TitlePersonalizationSettings": "Personalization",
+ "TitlePersonalize": "Personalize",
+ "TitlePersonalizedAdSettings": "Personalized Ad Settings",
+ "TitlePersonalizedAdvertisingSettings": "Personalized Advertising Settings",
+ "TitlePersonalizeSettings": "Personalization settings",
+ "TitlePrivacySettings": "Privacy",
+ "TitlePrivacyStatementNew": "Privacy Statement (new)",
+ "TitleRoam": "Sync across devices",
+ "TitleTermsNew": "Terms of Use (new)",
+ "unpinFromStart": "Unpin from Start",
+ "Unsnap": "Unsnap",
+ "update": "Update Now",
+ "updateMessage": "A new version of {0} is available. Update now to take advantage of the latest changes",
+ "updateMessage_button1": "Update",
+ "updateMessage_button2": "Later",
+ "updateTitle": "Update Available",
+ "userName": "Username",
+ "userNameInput": "Your email address or username",
+ "validateError": "We are unable to log you in. Please try again later.",
+ "videoClusterLabel": "Featured Videos",
+ "videoConnectErrorText": "Please connect to the Internet and try again",
+ "videoCountdownText": "Up next in {0}",
+ "videoGeoErrorText": "Video is not available for current location",
+ "videoItemLabel": "Video",
+ "videoLoadErrorText": "We're having problems loading this video, please try again later",
+ "VideosClusterLabel": "Videos",
+ "viewing": "Viewing",
+ "WeekNum": "Week {0}",
+ "win8Brand": "Windows 8",
+ "win8Share": "If you have {0} or {1}, {2}",
+ "win8ShareBrowser": " Otherwise, {0}",
+ "win8ShareBrowserLink": "click here.",
+ "win8ShareLink": "open this in {0}.",
+ "win8ShareTitle": "{0} - {1}",
+ "winPhone8Brand": "Windows Phone 8"
+ },
+ "resources": {
+ "24Hour": "24 hour",
+ "About": "About",
+ "Accumulation24HoursMap": "Accumulation 24 hours",
+ "AccumulationMap": "Accumulation",
+ "AccuWeather": "AccuWeather",
+ "accuweatherUrl": "http://www.accuweather.com",
+ "AcresOpen": "Open Acres",
+ "ActiveAlertsMap": "Active alerts",
+ "AddAnotherLocSearchPage": "Try a different location",
+ "AddButtonTitle": "Add",
+ "AddNewLocationString": "Add a new location",
+ "AddressHeader": "Address",
+ "AddTileAriaText": "Add another location to favourites",
+ "AdvancedRuns": "Advanced Runs",
+ "AdvisoryAlertSubType": "Advisory",
+ "Africa": "Africa",
+ "Afternoon Cloudy": "Afternoon Cloudy",
+ "Afternoon Ice ": {
+ " Snow": "PM Ice/Snow"
+ },
+ "Afternoon Rain": "Afternoon Rain",
+ "Afternoon Snow": "Afternoon Snow",
+ "AirAlertType": "Air",
+ "Alert Bar Heading": "Alert",
+ "alertsFlyoutAriaText": "alert",
+ "AlertShort": "ALERT {0}",
+ "AlertShortWithCount": "ALERT {0} {1} {2} more",
+ "AlertsMap": "Alerts",
+ "AlertWarning": "ALERT {0} from {1} to {2}",
+ "AlertWarningWithCount": "ALERT {0} from {1} to {2} {3} {4} more",
+ "AllFavoritesHeading": "All Favourites",
+ "AM Thunderstorms": "AM Storms",
+ "AppDescription": "Weather App",
+ "appFeedbackTitle": "Weather Application Feedback",
+ "AppIntroductionText": "Check the weather close to home and around the world",
+ "AppTitle": "Weather",
+ "AriaTextC": "Celsius",
+ "AriaTextF": "Fahrenheit",
+ "Asia": "Asia/Middle East",
+ "AverageRainfall": "Average Rainfall",
+ "AverageSnow": "Average Snow",
+ "Barometer": "Barometer",
+ "Base": "Base",
+ "BaseDepth": "Base Depth",
+ "BeaufortScale": "{0} bft",
+ "BeaufortScaleAriaText": "{0} Beaufort",
+ "BeginnerRuns": "Beginner Runs",
+ "Blizzard": "Blizzard",
+ "BlizzardCredits": "Blizzard {0}",
+ "Blowing dust": "Blowing Dust",
+ "Blowing sand": "Blowing Sand",
+ "Blowing Snow": "Blowing Snow",
+ "BlowingSnowCredits": "Blowing Snow {0}",
+ "Boarding": "Boarding",
+ "BrandedAppTitle": "MSN Weather",
+ "C": "C",
+ "CamsPanorama": "Cams and 360° Panoramas",
+ "CanadaRadarAttribution": "Canadian radar data courtesy of Environment Canada",
+ "CCDailyAttribution": "Current conditions, daily forecasts by",
+ "CCDailyAttribution1Provider": "Current conditions, daily forecasts by {0}",
+ "CCDailyAttribution2Providers": "Current conditions, daily forecasts by {0}, {1}",
+ "CCDailyMapsAttribution": "Current conditions, daily forecasts and maps by",
+ "CelsiusSetting": "Celsius",
+ "ChanceOfPrecipitationMap": "Chance of precipitation",
+ "ChangeHomeButtonTitle": "Change Home",
+ "ChangeHomeTileAriaText": "Change the home location",
+ "ChangeRegion": "Change region",
+ "ChangeUnitToCButtonTitle": "Change to Celsius",
+ "ChangeUnitToFButtonTitle": "Change to Fahrenheit",
+ "Clear": "Clear",
+ "ClearButtonTitle": "Clear",
+ "ClearCredits": "Clear {0}",
+ "clearSearchHistoryButton": "Clear weather searches",
+ "ClearSelectionButtonTitle": "Clear selection",
+ "CloseButtonLabel": "Close",
+ "CloudCover": "Cloud Cover",
+ "CloudForecastMap": "Cloud Forecast",
+ "CloudMap": "Cloud",
+ "Cloudy": "Cloudy",
+ "Cloudy ": {
+ " Afternoon Sun": "Cloudy/PM Sun",
+ " Windy": "Cloudy/Windy"
+ },
+ "CloudyCredits": "Cloudy {0}",
+ "ConfirmButtonTitle": "Confirm",
+ "CouldNotLoadDataMsg": "Data cannot be refreshed. Please try again later.",
+ "CountryRegionFilterText": "Country/Region",
+ "CrossCountry": "Cross-country",
+ "Current": "MSN Weather",
+ "currentConditionsAriaText": "today {0}, current condition {1}, feels like {2}, source {3}",
+ "CurrentHomeNarratorString": "Current Home {0}",
+ "CurrentLocationButtonTitle": "Current Location",
+ "CurrentLocationFetchErrorMsg": "Your location cannot be detected. Try again later.",
+ "CurrentLocDataNotAvailable": "Weather data is not available for your location. Please try again later.",
+ "CustomTitle": "Custom",
+ "DailyDrilldownHourlyForecastAriaText": "{0}, {1} {2}, precipitation {3}",
+ "dailyForecast": "{0}, high {1} low {2}, {3}, precipitation {4}",
+ "dailyForecastExpanded1": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}",
+ "dailyForecastExpanded2": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}, high {8} low {9} source {10}",
+ "dailyForecastMinMax": "{0}, low {1} high {2}, {3}, precipitation {4}",
+ "dailyForecastMinMaxExpanded1": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}",
+ "dailyForecastMinMaxExpanded2": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}, low {8} high {9} source {10}",
+ "DataAttribution": "Data provided by",
+ "DayHeading": "Day",
+ "DealsNews": "Deals & News",
+ "defaultECVErrorAction": "Retry",
+ "defaultECVErrorDescription": "We're sorry, something happened while fulfilling your request. Please retry",
+ "defaultECVErrorTitle": "Oops!",
+ "DefaultShortNameForPinFlyout": "Weather",
+ "Dewpoint": "Dew Point",
+ "DismissText": "Remove this panel. Go to Next Steps for more content and Help tips.",
+ "DismissTitle": "Close",
+ "DisplayUnits": "Units",
+ "DistanceText": "Distance",
+ "DopplerRadar": "Doppler Radar",
+ "Drifting sand": "Drifting Sand",
+ "Drifting snow": "Drifting Snow",
+ "Drizzle": "Drizzle",
+ "DrizzleCredits": "Drizzle {0}",
+ "DustCloudyCredits": "Dust Cloudy {0}",
+ "Duststorm": "Dust Storm",
+ "Duststorms": "Dust Storms",
+ "DustyClearCredits": "Dusty Clear {0}",
+ "ECVNoResultsActionFilters": "Clear filters",
+ "ECVNoResultsActionNoFilters": "Go Back",
+ "ECVNoResultsDescriptionFilters": "Your search produced no results. Clear your filters and try again.",
+ "ECVNoResultsDescriptionNoFilters": "Your search produced no results. Please try again.",
+ "ECVNoResultsIcon": "⚊",
+ "ECVNoResultsTitle": "No results found",
+ "England": "England",
+ "EnterLocation": "Enter Location",
+ "Europe": "Europe",
+ "ExpertRuns": "Expert Runs",
+ "ExtremeTempAlertType": "Extreme Temperature",
+ "F": "F",
+ "FahrenheitSetting": "Fahrenheit",
+ "Fair": "Fair",
+ "favHighLowText": "High/Low",
+ "favLowHighText": "Low/High",
+ "Favorites": "Favourites",
+ "FeelsLike": "Feels Like {0}",
+ "Feet": "ft",
+ "FilterShow": "Show",
+ "FilterValueDeals": "Deals",
+ "FilterValueFav": "Favourites",
+ "FilterValueOpen": "Open Only",
+ "FloodAlertType": "Flood",
+ "Flurries": "Flurries",
+ "Fog": "Fog",
+ "FogCredits": "Fog {0}",
+ "Foreca": "Foreca",
+ "ForecastHeader": "Today's Forecast",
+ "ForecastMapSubType": "Forecast",
+ "forecaUrl": "http://www.foreca.com",
+ "Freezing": "Freezing",
+ "Freezing Drizzle": "Freezing Drizzle",
+ "Freezing fog": "Freezing Fog",
+ "Freezing Rain": "Freezing Rain",
+ "FreezingRainCredits": "Freezing Rain {0}",
+ "FREOfflineMessage": "You are viewing sample weather data. Please connect to the Internet to see weather for your city.",
+ "FreshSnow": "Fresh Snow",
+ "FrigidCredits": "Frigid {0}",
+ "FromText": "From",
+ "FromToText": "From {0} to {1}",
+ "GenericSkiHeroImageText": "This is a generic image and does not represent the actual ski resort.",
+ "GettingStartedClusterTitle": "Getting Started",
+ "GraphDays": "{0} days",
+ "GraphHoursPerDay": "{0} hrs/day",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "Hail": "Hail",
+ "Haze": "Haze",
+ "Hazy Sunshine": "Hazy Sunshine",
+ "Heavy drizzle": "Heavy Drizzle",
+ "Heavy rain": "Heavy Rain",
+ "Heavy snow": "Heavy Snow",
+ "Heavy thunderstorms": "Heavy Storms",
+ "HeavyLegend": "Heavy",
+ "HeavyRainCredits": "Heavy Rain {0}",
+ "HectaresOpen": "Open Hectares",
+ "HighestLegend": "Highest",
+ "HighLowText": "{0}/{1}",
+ "HighMapSubType": "High",
+ "HighTemperatureMap": "High Temperature Forecast",
+ "HistoricalStringForRAIN": "In the past {0} years, it rained {1} out of {2} times on this day",
+ "HistoricalStringForSNOW": "In the past {0} years, it snowed {1} out of {2} times on this day",
+ "HistoricalStringForTHUNDER": "In the past {0} years, it thundered {1} out of {2} times on this day",
+ "HistoricalWeather": "Historical Weather",
+ "HistoricLengthWithUnit": "{0} {1}",
+ "holiday weatherUrl": "http://www.holiday-weather.com",
+ "HolidayWeather.com": "HolidayWeather.com",
+ "Home": "Home",
+ "Hot and Humid": "Hot and Humid",
+ "HourlyForecast": "Hourly Forecast",
+ "hourlyForecastAriaText": "{0}, {1} {2}, feels like {3}, precipitation {4}",
+ "HourlyForecastFeelsLikeTitle": "Feels like",
+ "HourlyForecastForecastTitle": "Forecast",
+ "hourlyForecastHeaderAriaText": "Read today's hourly forecast",
+ "HourlyForecastPrecipChanceTitle": "Precip. Chance",
+ "HourlyForecastTimeTitle": "Time",
+ "HourlyForecastWindTitle": "Wind",
+ "Humidity": "Humidity",
+ "HWAttribution": "Historical Weather by",
+ "Ice ": {
+ " Snow": "Ice/Snow"
+ },
+ "Ice pellets": "Ice Pellets",
+ "ImageCredits": "Image Credits",
+ "iMap Weather": "WDT",
+ "imap weatherUrl": "http://bit.ly/wdtconsumer",
+ "inPerHour": "in/hr",
+ "IntermediateRuns": "Intermediate Runs",
+ "Introduction": "Introduction",
+ "inUnit": "inches",
+ "Isolated Thunderstorms": "Isolated Storms",
+ "Japan": "Japan",
+ "JWSAttribution": "Japan daily forecasts by",
+ "JWSAttributionValue": "© Weather Service, Ltd",
+ "KilometresPerHour": "{0} kmph",
+ "KilometresPerHourAriaText": "{0} kilometres per hour",
+ "kWeather": "KWeather",
+ "KWeatherAttribution": "Korea Weather data by",
+ "kWeatherUrl": "http://www.kweather.co.kr",
+ "LastUpdatedDataTime": "Last updated {0}",
+ "LeftText": "Light",
+ "LegendName": "Precipitation",
+ "lessDailyConditionsAriaText": "Read the forecast from a single source",
+ "lessDailyConditionsDataText": "Less",
+ "LiftOpen": "Lifts Open",
+ "Light drizzle": "Light Drizzle",
+ "Light fog": "Light Fog",
+ "Light freezing drizzle": "Freezing Drizzle",
+ "Light freezing rain": "Freezing Rain",
+ "Light hail": "Light Hail",
+ "Light rain": "Light Rain",
+ "Light rain and snow": "Rain/Snow",
+ "Light rain and snow shower": "Rain/Snow",
+ "Light rain shower": "Light Rain",
+ "Light Showers": "Light Showers",
+ "Light snow": "Light Snow",
+ "Light snow shower": "Light Snow",
+ "LightLegend": "Light",
+ "LightShowersCredits": "Light Showers {0}",
+ "loading": "Loading",
+ "LocationDetectionFailed": "Your location cannot be detected. Try entering your location manually.",
+ "LocationDisabledError": "Your location cannot be found. Change your Permissions to allow Weather to use your location.",
+ "LocationNameLongFormat": "{0}, {1}, {2}",
+ "LocationNameShortFormat": "{0}, {1}",
+ "LocationPinnedToStart": "Unpin this location from the Start screen before setting it as your default location.",
+ "LocationSearchFetchError": "There was a problem. Please try your search again.",
+ "LocDetectionUnknownError": "A problem occurred while detecting your location. Please try again later.",
+ "London": "London",
+ "LowestLegend": "Lowest",
+ "LowMapSubType": "Low",
+ "LowTemperatureMap": "Low Temperature Forecast",
+ "MapFlyoutAltText": "Map animation",
+ "MapFlyoutAriaText": "map animation. {0} {1} on {2}",
+ "MapImageAltText": "Map",
+ "Maps": "Maps",
+ "MapsUnavailable": "Maps are currently unavailable. Please try again.",
+ "MarineAlertType": "Marine",
+ "MaxFavoritesLimitReached": "Your Favourites list is full. Please remove a location before adding a new one.",
+ "MaximumRecordedRainfall": "Record rainfall",
+ "MaximumRecordedSnow": "Record snow level",
+ "MaxPinnedLocationsLimitReached": "You have pinned the maximum number of locations. Please unpin a location before pinning a new one.",
+ "MeterPerSecond": "{0} m/s",
+ "MeterPerSecondAriaText": "{0} metres per second",
+ "Metres": "m",
+ "MilesPerHour": "{0} mph",
+ "MilesPerHourAriaText": "{0} miles per hour",
+ "MiscAlertType": "Miscellaneous",
+ "MixLegend": "Mix",
+ "mmPerHour": "mm/hr",
+ "MonthlyAvgBaseDepth": "Average Base Depth",
+ "MonthlyAvgSnowfall": "Average Snowfall",
+ "MonthlyDayLight": "Daylight",
+ "MonthlyMaxTemp": "Average High",
+ "MonthlyMinTemp": "Average Low",
+ "MonthlyRainfall": "Rainfall",
+ "MonthlyRainyDays": "Rainy Days",
+ "MonthlyRdBaseDepth": "Record Max. Base depth",
+ "MonthlyRdSnowfall": "Record High Snowfall",
+ "MonthlyRecordedHighTemp": "Record High",
+ "MonthlyRecordedLowTemp": "Record Low",
+ "MonthlySeaTemp": "Sea Temp.",
+ "MonthlySnowDays": "Snow Days",
+ "MonthlySunshine": "Sunshine",
+ "More Alerts": "More",
+ "moreDailyConditionsAriaText": "Read forecasts from multiple sources",
+ "moreDailyConditionsDataText": "More",
+ "MoreText": "More",
+ "Morning Fog ": {
+ " Afternoon Sun": "AM Fog/PM Sun",
+ " Cloudy": "AM Fog/Cloudy"
+ },
+ "Morning Ice ": {
+ " Snow": "AM Ice/Snow"
+ },
+ "Morning Rain": "Morning Rain",
+ "Morning Snow": "Morning Snow",
+ "Mostly clear": "Mostly Clear",
+ "Mostly Cloudy": "Mostly Cloudy",
+ "Mostly Sunny": "Mostly Sunny",
+ "MostlyCloudyCredits": "Mostly Cloudy {0}",
+ "Multiple Alerts Heading": "Alerts",
+ "MyPlaces": "Places",
+ "MyPlacesText": "My Places",
+ "N": "No",
+ "NameHeader": "Name",
+ "National": "National",
+ "NearbySkiResorts": "Nearby Ski Resorts",
+ "NearbyText": "Nearby",
+ "News": "News",
+ "NewSnowHeader": "New Snow",
+ "nextDailyConditionsDataText": "Read the forecast for more days",
+ "NextStepsClusterTitle": "Next Steps",
+ "NightHeading": "Night",
+ "NoInternetConnectionError": "You are not connected to the Internet. Please check your Internet connection and try again.",
+ "NoInternetOnSettingChange": "Your settings have been updated. Connect to the Internet to confirm your changes.",
+ "NoResortsFoundErrorText": "No resorts were found. Please change your filters and try again.",
+ "NorthAmerica": "North America",
+ "NorthAmericaRegion": "North/Central America",
+ "NoSearchResults": "No results matched your search.",
+ "ObservationMapSubType": "Observation",
+ "Oceania": "Australia/Pacific",
+ "ofText": "{0} of {1}",
+ "OnTheSnow": "On The Snow",
+ "OnTheSnowUrl": "http://www.onthesnow.com",
+ "OpenLiftsHeader": "Lifts Open",
+ "OpenTrailsHeader": "Pistes Open",
+ "OthersAlertType": "Others",
+ "Overview": "OVERVIEW",
+ "PacificIslands": "Pacific Islands",
+ "PanoramaControlsHiddenOnAriaLabel": "Panorama controls hidden",
+ "PanoramaControlsVisibleOnAriaLabel": "Panorama controls visible",
+ "Partly Cloudy": "Partly Cloudy",
+ "PartlyCloudyCredits": "Partly Cloudy {0}",
+ "Patchy fog": "Patchy Fog",
+ "pause": "Pause",
+ "PersonalizeText": "It's easy to follow the weather in places that you choose.",
+ "PersonalizeTitle": "Add your favourite places",
+ "PinButtonTitle": "Pin",
+ "play": "Play",
+ "PM Thunderstorms": "PM Storms",
+ "Precipitation": "Precipitation",
+ "PrecipitationAccumulationMap": "Precipitation Accumulation",
+ "precipitationAltText": "Precipitation",
+ "PrecipitationForecastMap": "Precipitation Forecast",
+ "PrecipitationMap": "Precipitation",
+ "PrecipitationObservationMap": "Precipitation Observation",
+ "prevDailyConditionsDataText": "Go back and read the forecast for previous days",
+ "Publisher": "Microsoft Corporation",
+ "RadarForecastMap": "Radar Forecast",
+ "RadarMap": "Radar",
+ "RadarObservationMap": "Radar Observation",
+ "Rain": "Rain",
+ "Rain ": {
+ " Snow": "Rain/Snow",
+ " Windy": "Rain/Windy"
+ },
+ "Rain and snow": "Rain/Snow",
+ "Rain and snow shower": "Rain/Snow",
+ "Rain showers": "Rain Showers",
+ "Rain turning to Snow": "Rain to Snow",
+ "RainAlertType": "Rain",
+ "RainCredits": "Rain {0}",
+ "RainfallAriaText": "Average monthly rainfall",
+ "RainfallFilter": "Rainfall",
+ "RainfallMap": "Rainfall",
+ "RainForecastMap": "Rain forecast",
+ "RainLegend": "Rain",
+ "RainSnowCredits": "Rain and Snow {0}",
+ "RecentSearches": "Recent Searches",
+ "RecommendedForFamiliesString": "Recommended for Families: {0}",
+ "RecordSnowfallYear": "{0} ({1})",
+ "RecordTemperatureYear": "{0}° ({1})",
+ "RefreshButtonTitle": "Refresh",
+ "Regional": "Regional",
+ "RelatedResorts": "Related Ski Resorts",
+ "RemoveButtonTitle": "Remove",
+ "ResortStatusClosed": "Closed",
+ "ResortStatusOpen": "Open",
+ "ResortStatusTemporarilyClosed": "Temporarily Closed",
+ "ResortStatusWeekendsOnly": "Weekends Only",
+ "RetryButtonLabel": "Try again",
+ "Reviews": "Reviews",
+ "RightText": "Heavy",
+ "SampleDataHeader": "{0} (Sample Data)",
+ "Satellite": "Satellite",
+ "SatelliteMap": "Satellite",
+ "Scattered Flurries": "Scattered Flurries",
+ "Scattered Thunderstorms": "Scattered Storms",
+ "ScatteredCloudsCredits": "Scattered Clouds {0}",
+ "ScatteredFlurriesCredits": "Scattered Flurries {0}",
+ "searchboxInvalidEntry": "Invalid location",
+ "searchboxPlaceHolderTest": "Search for a city",
+ "searchBoxText": "Search for a City or Postal code",
+ "SearchButtonTitle": "Search",
+ "SearchHistory": "Search History",
+ "SearchPageHeaderSubTitle": "Search Results",
+ "SearchPageHeaderTitle": "”{0}”",
+ "SearchResultsAriaLabel": "Search Results",
+ "SearchResultsHeader": "{0} search results",
+ "SearchTypeText": "Search Type",
+ "SeeMoreTruncatedText": "See more...",
+ "Seoul": "Seoul",
+ "SetDefaultButtonTitle": "Set as Home",
+ "SetDefaultMaxLimitReached": "Your Favourites list is full. Please remove a location before setting a new one as your default location.",
+ "SetHomeLocationTitle": "Set Home Location",
+ "Settings": "Settings",
+ "Severe duststorm": "Severe Dust Storm",
+ "ShareDataDesc": "Get the complete forecast for places you care about with the Weather app, available in the Windows Store.",
+ "ShareDataNotAvailableError": "Weather data is not available for this location. Please try again later.",
+ "ShareDataUrl": "http://apps.microsoft.com/webpdp/app/421ba874-f903-4965-9b82-d60f3ba3cae0",
+ "ShareInvalidSharePageMessage": "Select a city and try again.",
+ "ShareLocationNotAvailableMessage": "This location is currently not available to share.",
+ "SharePageTitle": "{0} - MSN Weather",
+ "ShareSnippet": "Detailed weather conditions and forecast for {0}.",
+ "ShareWeatherUpdates": "Weather updates",
+ "ShortDateTimeFormatString": "{0} {1}",
+ "Showers": "Showers",
+ "Showers ": {
+ " Clear": "Showers/Clear"
+ },
+ "Single Alert Heading": "Alert",
+ "skiCurrentConditionsAriaText": "new snow {0}, base depth {1}, source {2}",
+ "SkiDataAttribution": "Ski resort and snow data provided by {0}",
+ "SkiDetailsImageAttribution": "Image provided by {0}",
+ "SkiResorts": "Ski Resorts",
+ "SkiResortsECVShareError": "There is nothing to share right now. Select a resort and try again.",
+ "SkiResortWebsiteString": "Resort Website",
+ "SkiReviewDateFormat": "{0} {1}, {2}",
+ "SkiReviewFamilyFriendly": "Family Friendly",
+ "SkiReviewFiveStarsText": "5 Stars",
+ "SkiReviewFourStarsText": "4 Stars",
+ "SkiReviewOverAllRating": "{0}/5",
+ "SkiReviewOverAllText": "Overall",
+ "SkiReviewRatings": "Ratings ({0})",
+ "SkiReviewThreeStarsText": "3 Stars",
+ "SkiReviewTwoStarsText": "2 & under",
+ "Sleet": "Sleet",
+ "Smoke": "Smoke",
+ "SnapTime": "{0} Local Time",
+ "Snow": "Snow",
+ "Snow ": {
+ " Windy": "Snow/Windy"
+ },
+ "Snow Showers": "Snow Showers",
+ "Snow Showers ": {
+ " Sun": "Snow/Sun"
+ },
+ "Snow turning to Rain": "Snow to Rain",
+ "SnowAccumulationMap": "Snow Accumulation",
+ "SnowAlertType": "Snow",
+ "SnowAriaText": "Average monthly snow",
+ "SnowCredits": "Snow {0}",
+ "SnowDataAttribution": "Snow data provided by {0}",
+ "SnowDaysFilter": "Snow days",
+ "SnowDepth": "Snow Depth",
+ "SnowDepthHeader": "Base Depth",
+ "SnowForecastMap": "Snow Forecast",
+ "SnowForecastMap.comment": "Snow Forecast map title",
+ "SnowLegend": "Snow",
+ "SnowMap": "Snow",
+ "SnowObservationMap": "Snow Observation",
+ "South Korea": "South Korea",
+ "SouthAmerica": "South America",
+ "SpeedUnitsInBFTWithDirection": "{0} {1} bft",
+ "SpeedUnitsInBFTWithDirectionAriaText": "{0} {1} Beaufort",
+ "SpeedUnitsInKMPHWithDirection": "{0} {1} kmph",
+ "SpeedUnitsInKMPHWithDirectionAriaText": "{0} {1} kilometres per hour",
+ "SpeedUnitsInMPHWithDirection": "{0} {1} mph",
+ "SpeedUnitsInMPHWithDirectionAriaText": "{0} {1} miles per hour",
+ "SpeedUnitsInMPSWithDirection": "{0} {1} m/s",
+ "SpeedUnitsInMPSWithDirectionAriaText": "{0} {1} metres per second",
+ "Squalls": "Squalls",
+ "StatementAlertSubType": "Statement",
+ "Status": "Resort Status",
+ "StatusHeader": "Status",
+ "StormAlertType": "Storm",
+ "Summit": "Summit",
+ "Sunny ": {
+ " Windy": "Sunny/Windy"
+ },
+ "Sunny (Clear)": "Sunny (Clear)",
+ "Sunrise": "Sunrise",
+ "Sunset": "Sunset",
+ "SunshineAndSeaTempAttribution": "Sunshine & Sea temp. by",
+ "SunshineAndSeaTempAttributionAriaText": "Sunshine & Sea temperature by {0}",
+ "SunshineAriaText": "Average monthly sunshine",
+ "SunshineAttribution": "Sunshine by",
+ "SunshineAttributionAriaText": "Sunshine by {0}",
+ "SunshineFilter": "Sunshine",
+ "SunshineSeaTempAttribution": "Sunshine & Sea temperature data by",
+ "Taipei": "Taipei",
+ "Taiwan": "Taiwan",
+ "TakeATourText": "Get more out of MSN Weather with great maps and in-depth data.",
+ "TakeATourTitle": "Take a tour",
+ "TempClosed": "Temp. Closed",
+ "Temperature": "Temperature",
+ "TemperatureAriaText": "Average monthly temperature",
+ "TemperatureFilter": "Temperature",
+ "TemperatureForecastMap": "Temperature Forecast",
+ "TemperatureMap": "Temperature",
+ "TemperatureWithDegreeCelsius": "{0}°C",
+ "TemperatureWithDegreeFahrenheit": "{0}°F",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "Thunderstorms": "Thunderstorms",
+ "ThunderstormsCredits": "Thunderstorms {0}",
+ "TianQiAttribution": "Daily forecasts by",
+ "Today": "Today",
+ "TodayMapSubType": "Today",
+ "Tokyo": "Tokyo",
+ "ToolTipTextC": "Click to change to Celsius",
+ "ToolTipTextF": "Click to change to Fahrenheit",
+ "ToText": "to",
+ "TrailmapAttribution": "Trail map provided by {0}",
+ "Trailmapimage": "Trail map image",
+ "TrailsOpen": "Pistes Open",
+ "Travel": "Travel",
+ "Tubing": "Tubing",
+ "United Kingdom": "United Kingdom",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInDay": "{0} day",
+ "UnitInDays": "{0} days",
+ "UnitInHectorPascal": "{0} hp",
+ "UnitInHectorPascalAriaText": "{0} hectopascals",
+ "UnitInHourPerDay": "{0} hr/day",
+ "UnitInHoursPerDay": "{0} hrs/day",
+ "UnitInInches": "{0} in",
+ "UnitInKilometres": "{0} km",
+ "UnitInMiles": "{0} mi",
+ "UnitInMillibars": "{0} mb",
+ "UnitInMillibarsAriaText": "{0} millibars",
+ "UnitInMillimeters": "{0} mm",
+ "UnitInMillimetersHg": "{0} mmHg",
+ "UnitInMillimetersHgAriaText": "{0} millimetres Hg",
+ "UnitInPercentage": "{0}%",
+ "UnknownCredits": "Unknown {0}",
+ "UnpinButtonTitle": "Unpin",
+ "UntilText": "until",
+ "UvExtreme": "{0} (Extreme)",
+ "UvHigh": "{0} (High)",
+ "UvIndex": "UV Index",
+ "UvLow": "{0} (Low)",
+ "UvModerate": "{0} (Moderate)",
+ "UvVeryHigh": "{0} (Very High)",
+ "VerticalDrop": "Vertical Drop",
+ "Visibility": "Visibility",
+ "WarningAlertSubType": "Warning",
+ "WatchAlertSubType": "Watch",
+ "weather undergroundUrl": "http://www.wunderground.com",
+ "Weather.com": "weather.com",
+ "weather.comUrl": "http://www.weather.com",
+ "Weather2Travel": "Weather2Travel",
+ "weather2travelUrl": "http://www.weather2travel.com",
+ "WeatherAlertsMap": "Weather alerts",
+ "WeatherDataNotAvailable": "Weather data is not available for this location. Please try again later or enter a different location.",
+ "WeatherDotComForecastAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-tenday",
+ "WeatherDotComMapsAttribution": "View interactive maps at {0}",
+ "WeatherDotComMapsAttributionUrlPrefix": "http://bing.weather.com/weather/map/interactive/",
+ "WeatherDotComMapsAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-Imap",
+ "WeatherDotComSeeMoreText": "See more from weather.com",
+ "WeatherMaps": "Weather Maps",
+ "WebsiteHeader": "Website",
+ "Wind": "Wind",
+ "WindAlertType": "Wind",
+ "WindHeader": "Wind",
+ "WindSpeedUnitForE": "E",
+ "WindSpeedUnitForENE": "ENE",
+ "WindSpeedUnitForESE": "ESE",
+ "WindSpeedUnitForN": "N",
+ "WindSpeedUnitForNE": "NE",
+ "WindSpeedUnitForNNE": "NNE",
+ "WindSpeedUnitForNNW": "NNW",
+ "WindSpeedUnitForNW": "NW",
+ "WindSpeedUnitForS": "S",
+ "WindSpeedUnitForSE": "SE",
+ "WindSpeedUnitForSSE": "SSE",
+ "WindSpeedUnitForSSW": "SSW",
+ "WindSpeedUnitForSW": "SW",
+ "WindSpeedunitForW": "W",
+ "WindSpeedUnitForWNW": "WNW",
+ "WindSpeedUnitForWSW": "WSW",
+ "Windy": "Windy",
+ "WindyCredits": "Windy {0}",
+ "WithinText": "Within",
+ "Wolfram Alpha": "Wolfram Alpha",
+ "wolfram alphaUrl": "http://www.wolframalpha.com",
+ "Wolfram|Alpha": "Wolfram Alpha",
+ "wolfram|alphaUrl": "http://www.wolframalpha.com",
+ "WorldHeading": "World",
+ "WorldMapAltText": "World map",
+ "WorldWeather": "World Weather",
+ "WorldWeatherContinent": "World weather {0}",
+ "WorldWeatherTitle": "World Weather",
+ "WWHighLowSeperator": "/",
+ "Y": "Yes"
+ },
+ "worldweather": {
+ "Addis Ababa": "Addis Ababa",
+ "Adelaide": "Adelaide",
+ "Alexandria": "Alexandria",
+ "ALGERIA": "Algeria",
+ "Algiers": "Algiers",
+ "Amsterdam": "Amsterdam",
+ "Arawa": "Arawa",
+ "ARGENTINA": "Argentina",
+ "Asunción": "Asunción",
+ "Athens": "Athens",
+ "Auckland": "Auckland",
+ "AUSTRALIA": "Australia",
+ "AUSTRIA": "Austria",
+ "Baghdad": "Baghdad",
+ "Bangkok": "Bangkok",
+ "Barcelona": "Barcelona",
+ "Beijing": "Beijing",
+ "Berlin": "Berlin",
+ "Bogota": "Bogota",
+ "BOLIVIA": "Bolivia",
+ "Brasília": "Brasília",
+ "BRAZIL": "Brazil",
+ "Brisbane": "Brisbane",
+ "Buenos Aires": "Buenos Aires",
+ "Cairo": "Cairo",
+ "CANADA": "Canada",
+ "Cancún": "Cancún",
+ "Cape Town": "Cape Town",
+ "Caracas": "Caracas",
+ "Casablanca": "Casablanca",
+ "Chicago": "Chicago",
+ "CHILE": "Chile",
+ "CHINA": "China",
+ "COLOMBIA": "Colombia",
+ "Colombo": "Colombo",
+ "Darwin": "Darwin",
+ "Dubai": "Dubai",
+ "Dublin": "Dublin",
+ "Durban": "Durban",
+ "ECUADOR": "Ecuador",
+ "EGYPT": "Egypt",
+ "ETHIOPIA": "Ethiopia",
+ "FIJI": "Fiji",
+ "FINLAND": "Finland",
+ "FRANCE": "France",
+ "Georgetown": "Georgetown",
+ "GERMANY": "Germany",
+ "GREECE": "Greece",
+ "GUYANA": "Guyana",
+ "Helsinki": "Helsinki",
+ "Hobart": "Hobart",
+ "Ibadan": "Ibadan",
+ "INDIA": "India",
+ "IRAQ": "Iraq",
+ "IRELAND": "Ireland",
+ "Istanbul": "Istanbul",
+ "ITALY": "Italy",
+ "JAPAN": "Japan",
+ "Juneau": "Juneau",
+ "Kampala": "Kampala",
+ "KENYA": "Kenya",
+ "KOREA": "Korea",
+ "Kyiv": "Kyiv",
+ "La Paz": "La Paz",
+ "Lagos": "Lagos",
+ "Lima": "Lima",
+ "London": "London",
+ "Los Angeles": "Los Angeles",
+ "Melbourne": "Melbourne",
+ "MEXICO": "Mexico",
+ "Mexico City": "Mexico City",
+ "Miami": "Miami",
+ "MOROCCO": "Morocco",
+ "Moscow": "Moscow",
+ "Mumbai": "Mumbai",
+ "Nairobi": "Nairobi",
+ "NETHERLANDS": "Netherlands",
+ "New Delhi": "New Delhi",
+ "New York City": "New York",
+ "NEW ZEALAND": "New Zealand",
+ "NIGERIA": "Nigeria",
+ "PAPUA NEW GUINEA": "Papua New Guinea",
+ "PARAGUAY": "Paraguay",
+ "Paris": "Paris",
+ "Perth": "Perth",
+ "PERU": "Peru",
+ "Port Moresby": "Port Moresby",
+ "Quito": "Quito",
+ "Rio de Janeiro": "Rio de Janeiro",
+ "Rio Gallegos": "Rio Gallegos",
+ "Riyadh": "Riyadh",
+ "Rome": "Rome",
+ "RUSSIA": "Russia",
+ "San Francisco": "San Francisco",
+ "Santiago": "Santiago",
+ "SAUDI ARABIA": "Saudi Arabia",
+ "Seattle": "Seattle",
+ "Seoul": "Seoul",
+ "Shanghai": "Shanghai",
+ "Singapore": "Singapore",
+ "SINGAPORE_CAPS": "Singapore",
+ "SOUTH AFRICA": "South Africa",
+ "SPAIN": "Spain",
+ "SRI LANKA": "Sri Lanka",
+ "Suva": "Suva",
+ "Sydney": "Sydney",
+ "THAILAND": "Thailand",
+ "Tokyo": "Tokyo",
+ "Toronto": "Toronto",
+ "TURKEY": "Turkey",
+ "UGANDA": "Uganda",
+ "UKRAINE": "Ukraine",
+ "UNITED ARAB EMIRATES": "United Arab Emirates",
+ "UNITED KINGDOM": "United Kingdom",
+ "UNITED STATES": "United States",
+ "Vancouver": "Vancouver",
+ "VENEZUELA": "Venezuela",
+ "Victoria Falls": "Victoria Falls",
+ "Vienna": "Vienna",
+ "Washington D.C.": "Washington, D.C.",
+ "Wellington": "Wellington",
+ "ZIMBABWE": "Zimbabwe"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/en-gb.json b/packages/microsoft.bingweather/resources/en-gb.json
new file mode 100644
index 00000000..60eaf62c
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/en-gb.json
@@ -0,0 +1,1448 @@
+{
+ "AppEx.WeatherApp.Services": {
+ "Resources": {
+ "Country": "Country/Region",
+ "KilometresPerHour": "{0} kmph",
+ "MilesPerHour": "{0} mph",
+ "Region": "State/Province",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInInches": "{0} in"
+ }
+ },
+ "MicrosoftAdvertising": {
+ "UIStrings": {
+ "AdSettings_CommandText": "Microsoft Advertising",
+ "AdSettings_Flyout_OptedOut_Message1": "You have opted out of personalised advertising from Microsoft. Click ",
+ "AdSettings_Flyout_OptedOut_Message2": " to learn more about your choices.",
+ "AdSettings_Flyout_OptedOut_Message_Here": "here",
+ "AdSettings_Flyout_OptInSwitch_Header": "Let Microsoft Advertising use my information to personalise ads in this app.",
+ "AdSettings_Flyout_OptInSwitch_Off": "No",
+ "AdSettings_Flyout_OptInSwitch_On": "Yes",
+ "AdSettings_Flyout_Privacy": "Privacy Statement",
+ "AdSettings_Flyout_SectionName": "Advertising Settings",
+ "AdSettings_Flyout_SignInPrompt1": "You are currently signed out. ",
+ "AdSettings_Flyout_SignInPrompt2": " to enable personalised advertising in this app.",
+ "AdSettings_Flyout_SignInPrompt_SignIn": "Sign in",
+ "AdSettings_Flyout_SignInPrompt_SignOut": "Sign out",
+ "AdSettings_Flyout_StatusUnknown_Message": "Your Microsoft account information is currently unavailable.",
+ "AdSettings_Flyout_Title": "Advertising"
+ }
+ },
+ "Platform": {
+ "aboutLabel": "About",
+ "accept": "Accept",
+ "Add": "Add",
+ "addMoreFilters": "Add/Remove More Filters",
+ "advertisement": "Advertisement",
+ "AppIsPersonalized": "{0} is personalised. ",
+ "appRestart": "(Requires app restart)",
+ "AppTitle": "the app",
+ "appVersion": "Version {0}",
+ "ArticleHeaderSubscriptionMessage": "Subscribe",
+ "ArticleLinkLabelText": "View article",
+ "ArticleSubscriptionMessage": "Subscribe for unlimited access",
+ "ArticleTextSizeLarge": "Large",
+ "ArticleTextSizeMedium": "Medium",
+ "ArticleTextSizeMenuLabel": "Text size",
+ "ArticleTextSizeSmall": "Small",
+ "ArticleTextSizeXLarge": "X-Large",
+ "ArticleTextStyleMenuLabel": "Text style",
+ "ArticleUnavailableOffline": "This article is not available offline.",
+ "AverageMarketCharacterSizePx": "8",
+ "brand": "MSN",
+ "Calendar": "Calendar",
+ "cancel": "Cancel",
+ "catastrophicError": "There is a problem with the application. Please restart.",
+ "changeMarketTo": "{0} ({1})",
+ "changeSettings": "Change Settings",
+ "changesFromAppSettings": "You can make these changes at any time using app settings",
+ "clearFiltersLabel": "Reset Filters",
+ "ClickToOpenL2": "Select to show sub-channel",
+ "close": "Close",
+ "closeAppButton": "Close app",
+ "ConnectMicrosoftAccount": "Connect Microsoft account",
+ "ConnectMyMicrosoftAccount": "Connect my Microsoft account",
+ "ConnectToMicrosoft": "Connect to Microsoft",
+ "createAccountButton": "Create an account >",
+ "credentialMessage": "Enter a username and password to access {0}.",
+ "credentialsInvalid": "Invalid credentials. Please try again.",
+ "creditsLink": "Credits",
+ "DaysAgo": "{0} days ago",
+ "decline": "Decline",
+ "Delete": "Delete",
+ "demoModeTitle": "This feature is not available in demo mode.",
+ "demoMode_label": "DEMO MODE",
+ "demoMode_lastUpdated": "Tour the app in demo mode.",
+ "Dismiss": "Dismiss",
+ "entitlementsInvalid": "Sorry, your subscription does not include this device.",
+ "featured": "Featured",
+ "feedbackButtonLabel": "Feedback",
+ "feedbackCommentQuestion": "What could we do to improve the app?",
+ "feedbackDislikeIcon": "]D83D;]DE29;",
+ "feedbackDislikeLabel": "Dislike",
+ "feedbackLikeIcon": "]D83D;]DE0A;",
+ "feedbackLikeLabel": "Like",
+ "feedbackOfflineMessage": "It looks like you are currently offline. Please connect to the Internet and try again.",
+ "feedbackPrivacyStatementLabel": "Privacy statement",
+ "feedbackQ1option1": "Very good",
+ "feedbackQ1option2": "Good",
+ "feedbackQ1option3": "Average",
+ "feedbackQ1option4": "Poor",
+ "feedbackQ1option5": "Very Poor",
+ "feedbackQ2option1": "Definitely would recommend",
+ "feedbackQ2option2": "Probably would recommend",
+ "feedbackQ2option3": "Might or might not recommend",
+ "feedbackQ2option4": "Probably would not recommend",
+ "feedbackQ2option5": "Definitely would not recommend",
+ "feedbackQuestion1": "How would you rate this app?",
+ "feedbackQuestion2": "How likely would you be to recommend this app to a friend?",
+ "feedbackSubmitButtonLabel": "Submit",
+ "feedbackThankYou": "Thank you for your feedback!",
+ "filmstrip": "Filmstrip",
+ "FilterAll": "Show All",
+ "FilterBy": "Filter By:",
+ "filterMenu": "Filter Menu",
+ "forceUpdate": "This version of {0} is no longer supported. Please update to the latest version.",
+ "forgotPasswordButton": "Forgotten password >",
+ "freeformTextWarning": "Thanks for taking the time to add your feedback. Please take care not to provide any personal information.",
+ "GoBack": "Go back",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "HelpLabel": "Help",
+ "HoursAgo": "{0} hours ago",
+ "imageAttribution": "Image attribution",
+ "ImageCount": "Photo {0} of {1}",
+ "impressum": "Impressum",
+ "invalidEntry": "No results found. Please try again.",
+ "InvalidSubscriptionMessage": "The article that you are trying to read is locked. Please get a valid subscription.",
+ "L2Opened": "Sub-channels Shown",
+ "LabelChangeTheseSettings": "Change these settings",
+ "LabelClickToChange": "Click here to change settings",
+ "LabelModifySettings": "Modify settings",
+ "LabelOff": "Off",
+ "LabelOn": "On",
+ "LabelPrivacyStatement": "Privacy Statement",
+ "LabelTapToChange": "Tap here to change settings",
+ "languageSetting": "Choose edition",
+ "lca_privacy": "Privacy Statement",
+ "lca_serviceAgreement": "Terms of Use",
+ "Loading": "Loading",
+ "LocationCannotBeFound": "Your location cannot be found. Change your permissions to allow News to use your location.",
+ "Login": "Sign In",
+ "loginPrompt": "Enter your {0} account",
+ "loginPromptContentLocked": "The article you are trying to read is locked. Please log in.",
+ "Logout": "Sign out",
+ "marketChangePrompt": "Please close and reopen the app for your content preference changes to take effect.",
+ "marketError": "This app is not available in your market.",
+ "marketSelDialogMsg": "You are viewing content from {0} ({1}). You can change this option at any time from the settings charm.",
+ "marketSelDialogMsgOpt": "You are viewing content from {0} ({1}). You can change this setting in the app at any time.",
+ "marketSelDialogTitle": "Which content and language would you like to see?",
+ "marketSelDialogTitleOpt": "Where would you like to view content from?",
+ "mediaPlaybackButtonsAriaLabel": "Playback buttons",
+ "mediaPlaybackContentRegionAriaLabel": "Media playback",
+ "mediaPlaybackControlsAriaLabel": "Playback controls",
+ "mediaPlaybackControlsLayerAriaLabel": "Playback controls",
+ "mediaPlaybackEnterFullScreenAriaLabel": "Show Full Screen",
+ "mediaPlaybackLeaveFullScreenAriaLabel": "Exit Full Screen",
+ "mediaPlaybackMinimalAriaLabel": "Currently Playing",
+ "mediaPlaybackNextButtonAriaLabel": "Next",
+ "mediaPlaybackPauseButtonAriaLabel": "Pause",
+ "mediaPlaybackPlayButtonAriaLabel": "Play",
+ "mediaPlaybackPreviousButtonAriaLabel": "Previous",
+ "mediaPlaybackSeekBarAriaLabel": "Seek bar",
+ "mediaPlaybackSeekBarThumbAriaLabel": "Seek bar slider",
+ "mediaPlaybackShareAriaLabel": "Share",
+ "mediaPlaybackTimeIndicatorAriaLabel": "Playback time indicator",
+ "MessageAccessingMSAinfo": "Accessing your Microsoft account information. ",
+ "MessageAccountConnect1": "To enable personalisation and syncing across devices, connect your Microsoft account in PC Settings.",
+ "MessageAccountConnect2": "To enable personalisation and syncing across devices, {0}.",
+ "MessageAdSettingsLocation": "Select “Microsoft Advertising” in Settings to control the personalisation of ads in this app. ",
+ "MessageAdSettingsOff": "You are not receiving personalised ads. Select “Microsoft Advertising” in Settings to get personalised ads.",
+ "MessageAdSettingsOn1": "Microsoft Advertising is using your information to personalise ads. Select “Microsoft Advertising” in Settings to turn this off. ",
+ "MessageAdSettingsOn2": "Microsoft Advertising is using your information to personalise ads. Select “Microsoft Advertising” in Settings to turn off personalised ads. ",
+ "MessageConfiguredMSAinfo": "Configured using your Microsoft account information. ",
+ "MessageConnect": "Connect",
+ "MessageConnectAccount": "Connect account",
+ "MessageConnectMicrosoftAccount": "connect your Microsoft account",
+ "MessageCustomizedMSAinfo": "Customised with your Microsoft account information. ",
+ "MessageMSAConnectionDescription": "This will synchronise information between this app and your Microsoft account to personalise this and other Microsoft experiences across your devices.",
+ "MessageMSASignIn": "To enable personalisation and syncing across devices, sign in to your Microsoft account. ",
+ "MessageOptimizedMSAinfo": "Optimised with your Microsoft account information. ",
+ "MessagePersonalize": "Use information from this app and associated with my Microsoft account to personalise this and other Microsoft experiences.",
+ "MessagePersonalizedMSAinfo": "Personalised with your Microsoft account information. ",
+ "MessagePersonalizeSettings": "Personalise settings",
+ "MessagePrivacySettings": "Privacy settings",
+ "MessagePrivacyUpdateButton": "Learn more",
+ "MessagePrivacyUpdateCloseButton": "Dismiss",
+ "MessagePrivacyUpdated": "We have updated our Privacy Statement.",
+ "MessagePrivacyUpdateLink": "Learn more",
+ "MessagePrivacyUpdateNotif": "We are updating our Privacy Statement.",
+ "MessageRoam": "Sync this app's settings across my devices. ",
+ "MessageTermsAndPrivacyUpdated": "We have updated our Terms of Use and Privacy Statement.",
+ "MessageTermsAndPrivacyUpdateNotif": "We are updating our Terms of Use and Privacy Statement.",
+ "MessageTermsUpdateButton": "Learn more",
+ "MessageTermsUpdateCloseButton": "Dismiss",
+ "MessageTermsUpdated": "We have updated our Terms of Use.",
+ "MessageTermsUpdateLink": "Learn more",
+ "MessageTermsUpdateNotif": "We are updating our Terms of Use.",
+ "MessageUsingMSAinfo": "Using your Microsoft account information. ",
+ "MicrosoftAccount": "Microsoft",
+ "MicrosoftAdvertisingPrivacyLinkText": "Microsoft Advertising Privacy Statement.",
+ "MicrosoftAdvertisingSettingsText": "To control ad personalisation, see the ",
+ "MinsAgo": "{0} mins ago",
+ "More": "More",
+ "MoreArticles": "Upcoming",
+ "MoreFrom": "More from",
+ "MSAccountNameLabel": "Account name",
+ "MSAConnectionRemoveLink": "Remove",
+ "MSAConnectLabel": "Connect",
+ "NextArticle": "Next article",
+ "nextButton": "Next Item",
+ "noInternetButton": "Try Again",
+ "noInternetDescription": "Please check your Internet connection.",
+ "noInternetTitle": "You are not connected to the Internet.",
+ "noThanks": "No, Thanks",
+ "offLabel": "Off",
+ "offline_label": "OFFLINE",
+ "offline_lastUpdated": "Last Updated {0}",
+ "offline_noContent": "This content is not available in offline mode.",
+ "offline_problem": "The application ran into a problem and couldn’t load the content.",
+ "okButton": "OK",
+ "OneDayAgo": "1 day ago",
+ "OneHourAgo": "1 hour ago",
+ "OneMinAgo": "1 min ago",
+ "open": "Open",
+ "OpenInBrowser": "View in browser",
+ "optionsTitle": "Options",
+ "other": "Other",
+ "otherButton": "Other Markets",
+ "overLimitMessage": "{0} may use a large amount of data for some features. Your metered connection is over the data limit and fees may apply",
+ "Page": "Page {0}",
+ "PageOf": "Page {0} of {1}",
+ "password": "Password",
+ "passwordInput": "Password",
+ "Pause": "Pause",
+ "PaywallCardByAuthor": "By {0}",
+ "PaywallCardDay": "day",
+ "PaywallCardGrowlMessage": "You have used {0} of {1} free token(s) from {2} {3}.",
+ "PaywallCardHour": "hour",
+ "PaywallCardMonth": "month",
+ "PaywallCardQuotaReachedMessage": "You can continue to enjoy up to {0} free token(s) per {1} or subscribe for unlimited access.",
+ "PaywallcardReadArticle": "Read article",
+ "PaywallCardSignIn": "Sign in",
+ "PaywallCardSubscribe": "Subscribe",
+ "PaywallCardThisHour": "this hour",
+ "PaywallCardThisMonth": "this month",
+ "PaywallCardThisWeek": "this week",
+ "PaywallCardThisYear": "this year",
+ "PaywallCardToday": "today",
+ "PaywallCardUnlimitedAccess": "Subscribe for Unlimited Access",
+ "PaywallCardWeek": "week",
+ "PaywallCardYear": "year",
+ "PhotosynthControlsHiddenAriaLabel": "Panorama controls hidden",
+ "PhotosynthControlsVisibleAriaLabel": "Panorama controls visible",
+ "pinToStart": "Pin to Start",
+ "Play": "Play",
+ "poweredBy": "Powered by {0}",
+ "PreviousArticle": "Previous article",
+ "previousButton": "Previous Item",
+ "privacyPolicy": "Privacy Policy",
+ "progressAlertAriaLabel": "Alert",
+ "readingList": "Saved",
+ "refresh": "Refresh",
+ "RegionCurrentLocation": "Current Location",
+ "RegionSelectLabel": "Update regional sources for your city",
+ "RegionSelectNone": "(None)",
+ "RelatedArticles": "Related",
+ "Resources": {
+ "LanguageID": "2057",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharic",
+ "Language_ar": "Arabic",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamese",
+ "Language_az": "Azeri (Latin)",
+ "Language_az-Cyrl": "Azerbaijani (Cyrillic)",
+ "Language_az-Latn": "Azerbaijani (Latin)",
+ "Language_ba-Cyrl": "Bashkir",
+ "Language_be": "Belarusian",
+ "Language_bg": "Bulgarian",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesh)",
+ "Language_bn-in": "Bangla (India)",
+ "Language_br-Latn": "Breton",
+ "Language_bs": "Bosnian (Latin)",
+ "Language_bs-Cyrl": "Bosnian (Cyrillic)",
+ "Language_bs-Latn": "Bosnian (Latin)",
+ "Language_ca": "Catalan",
+ "Language_ca-ES-valencia": "Valencian",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Corsican",
+ "Language_cs": "Czech",
+ "Language_cy": "Welsh",
+ "Language_da": "Danish",
+ "Language_de": "German",
+ "Language_dsb": "Lower Sorbian",
+ "Language_dv": "Divehi",
+ "Language_el": "Greek",
+ "Language_en": "English",
+ "Language_es": "Spanish",
+ "Language_et": "Estonian",
+ "Language_eu": "Basque",
+ "Language_fa": "Persian",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnish",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Faroese",
+ "Language_fr": "French",
+ "Language_fy": "Frisian",
+ "Language_ga": "Irish",
+ "Language_gd": "Scottish Gaelic",
+ "Language_gd-Latn": "Scottish Gaelic",
+ "Language_gl": "Galician",
+ "Language_gsw": "Alsatian",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Hausa (Latin)",
+ "Language_ha-Latn": "Hausa (Latin)",
+ "Language_he": "Hebrew",
+ "Language_hi": "Hindi",
+ "Language_hr": "Croatian",
+ "Language_hsb": "Upper Sorbian",
+ "Language_hu": "Hungarian",
+ "Language_hy": "Armenian",
+ "Language_id": "Indonesian",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Icelandic",
+ "Language_it": "Italian",
+ "Language_iu-Latn": "Inuktitut (Latin)",
+ "Language_ja": "Japanese",
+ "Language_ka": "Georgian",
+ "Language_kk": "Kazakh",
+ "Language_kl": "Greenlandic",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Korean",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdish",
+ "Language_ku-Arab": "Central Kurdish",
+ "Language_ky": "Kyrgyz",
+ "Language_ky-Cyrl": "Kyrgyz",
+ "Language_lb": "Luxembourgish",
+ "Language_lo": "Lao",
+ "Language_lt": "Lithuanian",
+ "Language_lv": "Latvian",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Macedonian",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolian (Cyrillic)",
+ "Language_mn-Cyrl": "Mongolian (Cyrillic)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malay",
+ "Language_mt": "Maltese",
+ "Language_nb": "Norwegian (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Dutch",
+ "Language_nn": "Norwegian (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Occitan",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabic)",
+ "Language_pl": "Polish",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashto",
+ "Language_pt": "Portuguese",
+ "Language_pt-br": "Portuguese (Brazil)",
+ "Language_pt-pt": "Portuguese (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Romanian",
+ "Language_ru": "Russian",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sakha",
+ "Language_sd-Arab": "Sindhi (Arabic)",
+ "Language_se-Latn": "Northern Sami",
+ "Language_si": "Sinhala",
+ "Language_sk": "Slovak",
+ "Language_sl": "Slovenian",
+ "Language_sma-Latn": "Southern Sami",
+ "Language_smj-Latn": "Lule Sami",
+ "Language_smn-Latn": "Inari Sami",
+ "Language_sms-Latn": "Skolt Sami",
+ "Language_sq": "Albanian",
+ "Language_sr-Cyrl": "Serbian (Cyrillic)",
+ "Language_sr-cyrl-ba": "Serbian (Cyrillic, Bosnia and Herzegovina)",
+ "Language_sr-Latn": "Serbian (Latin)",
+ "Language_sv": "Swedish",
+ "Language_sw": "Kiswahili",
+ "Language_syr-Syrc": "Syriac",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tajik (Cyrillic)",
+ "Language_th": "Thai",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmen (Latin)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Turkish",
+ "Language_tt": "Tatar",
+ "Language_tt-Cyrl": "Tatar (Cyrillic)",
+ "Language_tzm-Latn": "Tamazight (Latin)",
+ "Language_ug": "Uyghur",
+ "Language_ug-Arab": "Uyghur",
+ "Language_uk": "Ukrainian",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Uzbek (Cyrillic)",
+ "Language_uz-Latn": "Uzbek (Latin)",
+ "Language_vi": "Vietnamese",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinese (Simplified)",
+ "Language_zh-Hant": "Chinese (Traditional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "United Arab Emirates",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua and Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "American Samoa",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaijan",
+ "Region_Display_BA": "Bosnia and Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgium",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brazil",
+ "Region_Display_BS": "The Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos (Keeling) Islands",
+ "Region_Display_CD": "Congo (DRC)",
+ "Region_Display_CF": "Central African Republic",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Switzerland",
+ "Region_Display_CI": "Côte d’Ivoire",
+ "Region_Display_CK": "Cook Islands",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Cameroon",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia and Montenegro (Former)",
+ "Region_Display_CV": "Cape Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas Island",
+ "Region_Display_CY": "Cyprus",
+ "Region_Display_CZ": "Czech Republic",
+ "Region_Display_DE": "Germany",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Denmark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominican Republic",
+ "Region_Display_DZ": "Algeria",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egypt",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spain",
+ "Region_Display_ET": "Ethiopia",
+ "Region_Display_FI": "Finland",
+ "Region_Display_FK": "Falkland Islands (Islas Malvinas)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Faroe Islands",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "United Kingdom",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "French Guiana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Greenland",
+ "Region_Display_GM": "The Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Equatorial Guinea",
+ "Region_Display_GR": "Greece",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong SAR",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatia",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Hungary",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Ireland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Iraq",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Iceland",
+ "Region_Display_IT": "Italy",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordan",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kyrgyzstan",
+ "Region_Display_KH": "Cambodia",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoros",
+ "Region_Display_KN": "Saint Kitts and Nevis",
+ "Region_Display_KR": "Korea",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Cayman Islands",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Lebanon",
+ "Region_Display_LC": "Saint Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lithuania",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Latvia",
+ "Region_Display_LY": "Libya",
+ "Region_Display_MA": "Morocco",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "Saint Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall Islands",
+ "Region_Display_MK": "Macedonia, FYRO",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao SAR",
+ "Region_Display_MP": "Northern Mariana Islands",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexico",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "New Caledonia",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk Island",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Netherlands",
+ "Region_Display_NO": "Norway",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "New Zealand",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "French Polynesia",
+ "Region_Display_PG": "Papua New Guinea",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Poland",
+ "Region_Display_PM": "Saint Pierre and Miquelon",
+ "Region_Display_PN": "Pitcairn Islands",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Reunion",
+ "Region_Display_RO": "Romania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Russia",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Saudi Arabia",
+ "Region_Display_SB": "Solomon Islands",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Sweden",
+ "Region_Display_SG": "Singapore",
+ "Region_Display_SH": "Saint Helena, Ascension and Tristan da Cunha",
+ "Region_Display_SI": "Slovenia",
+ "Region_Display_SK": "Slovakia",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "South Sudan",
+ "Region_Display_ST": "São Tomé and Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Syria",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks and Caicos Islands",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tajikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunisia",
+ "Region_Display_TR": "Turkey",
+ "Region_Display_TT": "Trinidad and Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "United States",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistan",
+ "Region_Display_VA": "Holy See (Vatican City)",
+ "Region_Display_VC": "Saint Vincent and the Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "British Virgin Islands",
+ "Region_Display_VI": "U.S. Virgin Islands",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis and Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Sint Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "South Africa",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabwe"
+ },
+ "restart": "Restart",
+ "retry": "Try Again",
+ "roamingMessage": "{0} may use a large amount of data for some features. You are currently roaming and data fees may apply.",
+ "row": "Row",
+ "scrollLeftAriaLabel": "Scroll Left",
+ "scrollRightAriaLabel": "Scroll Right",
+ "semanticZoomContainer": "Semantic Zoom Container",
+ "sendFeedbackButtonLabel": "Send Feedback",
+ "ShareArticleHeader": "Share",
+ "ShareArticleText": "Share this article",
+ "Slide": "Image",
+ "Slideshow": "Slideshow",
+ "SnappedMessage": "Snap mode is coming soon.",
+ "SortBy": "SORT BY",
+ "sortLabel": "Sort",
+ "sortText": "Sort",
+ "sponsoredBy": "Sponsored by",
+ "standardErrorButton": "Try Again",
+ "standardErrorDescription": "There was a problem. Please try again.",
+ "standardErrorTitle": "This page failed to load.",
+ "submit": "Submit",
+ "subscribeButton": "Subscribe",
+ "subscribeInstructions": "Enter username and password",
+ "subscribeNow": "Subscribe now and get:",
+ "subscribePanoButton": "Subscribe for Unlimited Access",
+ "subscribePrompt": "Content for subscribers only",
+ "swipeDownToolTip": "Swipe down to select",
+ "swipeLeftToolTip": "Swipe left to select",
+ "swipeRightToolTip": "Swipe right to select",
+ "TermsOfUse": "Terms of Use",
+ "TextStylePrimary": "Primary",
+ "TextStyleSecondary": "Secondary",
+ "timeIndicatorTextFormat": "{0} / {1}",
+ "TitleAccountSettings": "Account",
+ "TitleAccountsSettings": "Account",
+ "TitleAdSettings": "Advertising settings",
+ "TitleConfiguration": "Configuration",
+ "TitleCustomization": "Customisation",
+ "TitleMicrosoftAccount": "Microsoft account",
+ "TitleMSAConnectedDescription": "Connected to your Microsoft account",
+ "TitleMSAConnectionDescription": "Connect your Microsoft account",
+ "TitlePersonalization": "Personalisation",
+ "TitlePersonalizationSettings": "Personalisation",
+ "TitlePersonalize": "Personalise",
+ "TitlePersonalizedAdSettings": "Personalised Ad Settings",
+ "TitlePersonalizedAdvertisingSettings": "Personalised Advertising Settings",
+ "TitlePersonalizeSettings": "Personalisation settings",
+ "TitlePrivacySettings": "Privacy",
+ "TitlePrivacyStatementNew": "Privacy Statement (new)",
+ "TitleRoam": "Sync across devices",
+ "TitleTermsNew": "Terms of Use (new)",
+ "unpinFromStart": "Unpin from Start",
+ "Unsnap": "Unsnap",
+ "update": "Update Now",
+ "updateMessage": "A new version of {0} is available. Update now to take advantage of the latest changes",
+ "updateMessage_button1": "Update",
+ "updateMessage_button2": "Later",
+ "updateTitle": "Update Available",
+ "userName": "Username",
+ "userNameInput": "Your email address or username",
+ "validateError": "We are unable to log you in. Please try again later.",
+ "videoClusterLabel": "Featured Videos",
+ "videoConnectErrorText": "Please connect to the Internet and try again",
+ "videoCountdownText": "Up next in {0}",
+ "videoGeoErrorText": "Video is not available for current location",
+ "videoItemLabel": "Video",
+ "videoLoadErrorText": "We're having problems loading this video, please try again later",
+ "VideosClusterLabel": "Videos",
+ "viewing": "Viewing",
+ "WeekNum": "Week {0}",
+ "win8Brand": "Windows 8",
+ "win8Share": "If you have {0} or {1}, {2}",
+ "win8ShareBrowser": " Otherwise, {0}",
+ "win8ShareBrowserLink": "click here.",
+ "win8ShareLink": "open this in {0}.",
+ "win8ShareTitle": "{0} - {1}",
+ "winPhone8Brand": "Windows Phone 8"
+ },
+ "resources": {
+ "24Hour": "24 hour",
+ "About": "About",
+ "Accumulation24HoursMap": "Accumulation 24 hours",
+ "AccumulationMap": "Accumulation",
+ "AccuWeather": "AccuWeather",
+ "accuweatherUrl": "http://www.accuweather.com",
+ "AcresOpen": "Open Miles",
+ "ActiveAlertsMap": "Active alerts",
+ "AddAnotherLocSearchPage": "Try a different location",
+ "AddButtonTitle": "Add",
+ "AddNewLocationString": "Add a new location",
+ "AddressHeader": "Address",
+ "AddTileAriaText": "Add another location to favourites",
+ "AdvancedRuns": "Advanced Runs",
+ "AdvisoryAlertSubType": "Advisory",
+ "Africa": "Africa",
+ "Afternoon Cloudy": "Afternoon Cloudy",
+ "Afternoon Ice ": {
+ " Snow": "PM Ice / Snow"
+ },
+ "Afternoon Rain": "Afternoon Rain",
+ "Afternoon Snow": "Afternoon Snow",
+ "AirAlertType": "Air",
+ "Alert Bar Heading": "Alert",
+ "alertsFlyoutAriaText": "alert",
+ "AlertShort": "ALERT {0}",
+ "AlertShortWithCount": "ALERT {0} {1} {2} more",
+ "AlertsMap": "Alerts",
+ "AlertWarning": "ALERT {0} from {1} to {2}",
+ "AlertWarningWithCount": "ALERT {0} from {1} to {2} {3} {4} more",
+ "AllFavoritesHeading": "All Favourites",
+ "AM Thunderstorms": "AM Storms",
+ "AppDescription": "Weather App",
+ "appFeedbackTitle": "Weather Application Feedback",
+ "AppIntroductionText": "Check the weather close to home and around the world",
+ "AppTitle": "Weather",
+ "AriaTextC": "Celsius",
+ "AriaTextF": "Fahrenheit",
+ "Asia": "Asia / Middle East",
+ "AverageRainfall": "Average Rainfall",
+ "AverageSnow": "Average Snow",
+ "Barometer": "Barometer",
+ "Base": "Base",
+ "BaseDepth": "Base Depth",
+ "BeaufortScale": "{0} bft",
+ "BeaufortScaleAriaText": "{0} Beaufort",
+ "BeginnerRuns": "Beginner Runs",
+ "Blizzard": "Blizzard",
+ "BlizzardCredits": "Blizzard {0}",
+ "Blowing dust": "Blowing Dust",
+ "Blowing sand": "Blowing Sand",
+ "Blowing Snow": "Blowing Snow",
+ "BlowingSnowCredits": "Blowing Snow {0}",
+ "Boarding": "Boarding",
+ "BrandedAppTitle": "MSN Weather",
+ "C": "C",
+ "CamsPanorama": "Cams and 360° Panoramas",
+ "CanadaRadarAttribution": "Canadian radar data courtesy of Environment Canada",
+ "CCDailyAttribution": "Current conditions, daily forecasts by",
+ "CCDailyAttribution1Provider": "Current conditions, daily forecasts by {0}",
+ "CCDailyAttribution2Providers": "Current conditions, daily forecasts by {0} , {1}",
+ "CCDailyMapsAttribution": "Current conditions, daily forecasts and maps by",
+ "CelsiusSetting": "Celsius",
+ "ChanceOfPrecipitationMap": "Chance of precipitation",
+ "ChangeHomeButtonTitle": "Change Home",
+ "ChangeHomeTileAriaText": "Change the home location",
+ "ChangeRegion": "Change region",
+ "ChangeUnitToCButtonTitle": "Change to Celsius",
+ "ChangeUnitToFButtonTitle": "Change to Fahrenheit",
+ "Clear": "Clear",
+ "ClearButtonTitle": "Clear",
+ "ClearCredits": "Clear {0}",
+ "clearSearchHistoryButton": "Clear weather searches",
+ "ClearSelectionButtonTitle": "Clear selection",
+ "CloseButtonLabel": "Close",
+ "CloudCover": "Cloud Cover",
+ "CloudForecastMap": "Cloud Forecast",
+ "CloudMap": "Cloud",
+ "Cloudy": "Cloudy",
+ "Cloudy ": {
+ " Afternoon Sun": "Cloudy / PM Sun",
+ " Windy": "Cloudy / Windy"
+ },
+ "CloudyCredits": "Cloudy {0}",
+ "ConfirmButtonTitle": "Confirm",
+ "CouldNotLoadDataMsg": "Data cannot be refreshed. Please try again later.",
+ "CountryRegionFilterText": "Country/Region",
+ "CrossCountry": "Cross Country",
+ "Current": "MSN Weather",
+ "currentConditionsAriaText": "today {0}, current condition {1}, feels like {2}, source {3}",
+ "CurrentHomeNarratorString": "Current Home {0}",
+ "CurrentLocationButtonTitle": "Current Location",
+ "CurrentLocationFetchErrorMsg": "Your location cannot be detected. Try again later.",
+ "CurrentLocDataNotAvailable": "Weather data is not available for your location. Please try again later.",
+ "CustomTitle": "Custom",
+ "DailyDrilldownHourlyForecastAriaText": "{0}, {1} {2}, precipitation {3}",
+ "dailyForecast": "{0}, high {1} low {2}, {3}, precipitation {4}",
+ "dailyForecastExpanded1": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}",
+ "dailyForecastExpanded2": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}, high {8} low {9} source {10}",
+ "dailyForecastMinMax": "{0}, low {1} high {2}, {3}, precipitation {4}",
+ "dailyForecastMinMaxExpanded1": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}",
+ "dailyForecastMinMaxExpanded2": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}, low {8} high {9} source {10}",
+ "DataAttribution": "Data provided by",
+ "DayHeading": "Day",
+ "DealsNews": "Deals & News",
+ "defaultECVErrorAction": "Retry",
+ "defaultECVErrorDescription": "We're sorry, something happened while fulfilling your request. Please retry",
+ "defaultECVErrorTitle": "Oops!",
+ "DefaultShortNameForPinFlyout": "Weather",
+ "Dewpoint": "Dew Point",
+ "DismissText": "Remove this panel. Go to Next Steps for more content and Help tips.",
+ "DismissTitle": "Close",
+ "DisplayUnits": "Units",
+ "DistanceText": "Distance",
+ "DopplerRadar": "Doppler Radar",
+ "Drifting sand": "Drifting Sand",
+ "Drifting snow": "Drifting Snow",
+ "Drizzle": "Drizzle",
+ "DrizzleCredits": "Drizzle {0}",
+ "DustCloudyCredits": "Dust Cloudy {0}",
+ "Duststorm": "Dust Storm",
+ "Duststorms": "Dust Storms",
+ "DustyClearCredits": "Dusty Clear {0}",
+ "ECVNoResultsActionFilters": "Clear filters",
+ "ECVNoResultsActionNoFilters": "Go Back",
+ "ECVNoResultsDescriptionFilters": "Your search produced no results. Clear your filters and try again.",
+ "ECVNoResultsDescriptionNoFilters": "Your search produced no results. Please try again.",
+ "ECVNoResultsIcon": "⚊",
+ "ECVNoResultsTitle": "No results found",
+ "England": "England",
+ "EnterLocation": "Enter Location",
+ "Europe": "Europe",
+ "ExpertRuns": "Expert Runs",
+ "ExtremeTempAlertType": "Extreme Temperature",
+ "F": "F",
+ "FahrenheitSetting": "Fahrenheit",
+ "Fair": "Fair",
+ "favHighLowText": "High / Low",
+ "favLowHighText": "Low/High",
+ "Favorites": "Favourites",
+ "FeelsLike": "Feels Like {0}",
+ "Feet": "ft",
+ "FilterShow": "Show",
+ "FilterValueDeals": "Deals",
+ "FilterValueFav": "Favourites",
+ "FilterValueOpen": "Open Only",
+ "FloodAlertType": "Flood",
+ "Flurries": "Flurries",
+ "Fog": "Fog",
+ "FogCredits": "Fog {0}",
+ "Foreca": "Foreca",
+ "ForecastHeader": "Today's Forecast",
+ "ForecastMapSubType": "Forecast",
+ "forecaUrl": "http://www.foreca.com",
+ "Freezing": "Freezing",
+ "Freezing Drizzle": "Freezing Drizzle",
+ "Freezing fog": "Freezing Fog",
+ "Freezing Rain": "Freezing Rain",
+ "FreezingRainCredits": "Freezing Rain {0}",
+ "FREOfflineMessage": "You are viewing sample weather data. Please connect to the Internet to see weather for your town/city.",
+ "FreshSnow": "Fresh Snow",
+ "FrigidCredits": "Frigid {0}",
+ "FromText": "From",
+ "FromToText": "From {0} to {1}",
+ "GenericSkiHeroImageText": "This is a generic image and does not represent the actual ski resort.",
+ "GettingStartedClusterTitle": "Getting Started",
+ "GraphDays": "{0} days",
+ "GraphHoursPerDay": "{0} hrs/day",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "Hail": "Hail",
+ "Haze": "Haze",
+ "Hazy Sunshine": "Hazy Sunshine",
+ "Heavy drizzle": "Heavy Drizzle",
+ "Heavy rain": "Heavy Rain",
+ "Heavy snow": "Heavy Snow",
+ "Heavy thunderstorms": "Heavy Storms",
+ "HeavyLegend": "Heavy",
+ "HeavyRainCredits": "Heavy Rain {0}",
+ "HectaresOpen": "Open Kilometres",
+ "HighestLegend": "Highest",
+ "HighLowText": "{0} / {1}",
+ "HighMapSubType": "High",
+ "HighTemperatureMap": "High Temperature Forecast",
+ "HistoricalStringForRAIN": "In the past {0} years, it rained {1} out of {2} times on this day",
+ "HistoricalStringForSNOW": "In the past {0} years, it snowed {1} out of {2} times on this day",
+ "HistoricalStringForTHUNDER": "In the past {0} years, it thundered {1} out of {2} times on this day",
+ "HistoricalWeather": "Historical Weather",
+ "HistoricLengthWithUnit": "{0} {1}",
+ "holiday weatherUrl": "http://www.holiday-weather.com",
+ "HolidayWeather.com": "HolidayWeather.com",
+ "Home": "Home",
+ "Hot and Humid": "Hot and Humid",
+ "HourlyForecast": "Hourly Forecast",
+ "hourlyForecastAriaText": "{0}, {1} {2}, feels like {3}, precipitation {4}",
+ "HourlyForecastFeelsLikeTitle": "Feels like",
+ "HourlyForecastForecastTitle": "Forecast",
+ "hourlyForecastHeaderAriaText": "Read today's hourly forecast",
+ "HourlyForecastPrecipChanceTitle": "Precip. Chance",
+ "HourlyForecastTimeTitle": "Time",
+ "HourlyForecastWindTitle": "Wind",
+ "Humidity": "Humidity",
+ "HWAttribution": "Historical Weather by",
+ "Ice ": {
+ " Snow": "Ice / Snow"
+ },
+ "Ice pellets": "Ice Pellets",
+ "ImageCredits": "Image Credits",
+ "iMap Weather": "WDT",
+ "imap weatherUrl": "http://bit.ly/wdtconsumer",
+ "inPerHour": "in/hr",
+ "IntermediateRuns": "Intermediate Runs",
+ "Introduction": "Introduction",
+ "inUnit": "inches",
+ "Isolated Thunderstorms": "Isolated Storms",
+ "Japan": "Japan",
+ "JWSAttribution": "Japan daily forecasts by",
+ "JWSAttributionValue": "© Weather Service, Ltd",
+ "KilometresPerHour": "{0} kmph",
+ "KilometresPerHourAriaText": "{0} kilometres per hour",
+ "kWeather": "KWeather",
+ "KWeatherAttribution": "Korea Weather data by",
+ "kWeatherUrl": "http://www.kweather.co.kr",
+ "LastUpdatedDataTime": "Last updated {0}",
+ "LeftText": "Light",
+ "LegendName": "Precipitation",
+ "lessDailyConditionsAriaText": "Read the forecast from a single source",
+ "lessDailyConditionsDataText": "Less",
+ "LiftOpen": "Lifts Open",
+ "Light drizzle": "Light Drizzle",
+ "Light fog": "Light Fog",
+ "Light freezing drizzle": "Freezing Drizzle",
+ "Light freezing rain": "Freezing Rain",
+ "Light hail": "Light Hail",
+ "Light rain": "Light Rain",
+ "Light rain and snow": "Rain / Snow",
+ "Light rain and snow shower": "Rain / Snow",
+ "Light rain shower": "Light Rain",
+ "Light Showers": "Light Showers",
+ "Light snow": "Light Snow",
+ "Light snow shower": "Light Snow",
+ "LightLegend": "Light",
+ "LightShowersCredits": "Light Showers {0}",
+ "loading": "Loading",
+ "LocationDetectionFailed": "Your location cannot be detected. Try entering your location manually.",
+ "LocationDisabledError": "Your location cannot be found. Change your Permissions to allow Weather to use your location.",
+ "LocationNameLongFormat": "{0}, {1}, {2}",
+ "LocationNameShortFormat": "{0}, {1}",
+ "LocationPinnedToStart": "Unpin this location from the Start screen before setting it as your default location.",
+ "LocationSearchFetchError": "There was a problem. Please try your search again.",
+ "LocDetectionUnknownError": "A problem occurred while detecting your location. Please try again later.",
+ "London": "London",
+ "LowestLegend": "Lowest",
+ "LowMapSubType": "Low",
+ "LowTemperatureMap": "Low Temperature Forecast",
+ "MapFlyoutAltText": "Map animation",
+ "MapFlyoutAriaText": "map animation. {0} {1} on {2}",
+ "MapImageAltText": "Map",
+ "Maps": "Maps",
+ "MapsUnavailable": "Maps are currently unavailable. Please try again.",
+ "MarineAlertType": "Marine",
+ "MaxFavoritesLimitReached": "Your Favourites list is full. Please remove a location before adding a new one.",
+ "MaximumRecordedRainfall": "Record rainfall",
+ "MaximumRecordedSnow": "Record snow level",
+ "MaxPinnedLocationsLimitReached": "You have pinned the maximum number of locations. Please unpin a location before pinning a new one.",
+ "MeterPerSecond": "{0} m/s",
+ "MeterPerSecondAriaText": "{0} metres per second",
+ "Metres": "m",
+ "MilesPerHour": "{0} mph",
+ "MilesPerHourAriaText": "{0} miles per hour",
+ "MiscAlertType": "Miscellaneous",
+ "MixLegend": "Mix",
+ "mmPerHour": "mm/hr",
+ "MonthlyAvgBaseDepth": "Average Base Depth",
+ "MonthlyAvgSnowfall": "Average Snowfall",
+ "MonthlyDayLight": "Daylight",
+ "MonthlyMaxTemp": "Average High",
+ "MonthlyMinTemp": "Average Low",
+ "MonthlyRainfall": "Rainfall",
+ "MonthlyRainyDays": "Rainy Days",
+ "MonthlyRdBaseDepth": "Record Max. Base depth",
+ "MonthlyRdSnowfall": "Record High Snowfall",
+ "MonthlyRecordedHighTemp": "Record High",
+ "MonthlyRecordedLowTemp": "Record Low",
+ "MonthlySeaTemp": "Sea Temp.",
+ "MonthlySnowDays": "Snow Days",
+ "MonthlySunshine": "Sunshine",
+ "More Alerts": "More",
+ "moreDailyConditionsAriaText": "Read forecasts from multiple sources",
+ "moreDailyConditionsDataText": "More",
+ "MoreText": "More",
+ "Morning Fog ": {
+ " Afternoon Sun": "AM Fog / PM Sun",
+ " Cloudy": "AM Fog / Cloudy"
+ },
+ "Morning Ice ": {
+ " Snow": "AM Ice / Snow"
+ },
+ "Morning Rain": "Morning Rain",
+ "Morning Snow": "Morning Snow",
+ "Mostly clear": "Mostly Clear",
+ "Mostly Cloudy": "Mostly Cloudy",
+ "Mostly Sunny": "Mostly Sunny",
+ "MostlyCloudyCredits": "Mostly Cloudy {0}",
+ "Multiple Alerts Heading": "Alerts",
+ "MyPlaces": "Places",
+ "MyPlacesText": "My Places",
+ "N": "No",
+ "NameHeader": "Name",
+ "National": "National",
+ "NearbySkiResorts": "Nearby Ski Resorts",
+ "NearbyText": "Nearby",
+ "News": "News",
+ "NewSnowHeader": "New Snow",
+ "nextDailyConditionsDataText": "Read the forecast for more days",
+ "NextStepsClusterTitle": "Next Steps",
+ "NightHeading": "Night",
+ "NoInternetConnectionError": "You are not connected to the Internet. Please check your Internet connection and try again.",
+ "NoInternetOnSettingChange": "Your settings have been updated. Connect to the Internet to confirm your changes.",
+ "NoResortsFoundErrorText": "No resorts were found. Please change your filters and try again.",
+ "NorthAmerica": "North America",
+ "NorthAmericaRegion": "North/Central America",
+ "NoSearchResults": "No results matched your search.",
+ "ObservationMapSubType": "Observation",
+ "Oceania": "Australia / Pacific",
+ "ofText": "{0} of {1}",
+ "OnTheSnow": "On The Snow",
+ "OnTheSnowUrl": "http://www.onthesnow.com",
+ "OpenLiftsHeader": "Lifts Open",
+ "OpenTrailsHeader": "Pistes Open",
+ "OthersAlertType": "Others",
+ "Overview": "OVERVIEW",
+ "PacificIslands": "Pacific Islands",
+ "PanoramaControlsHiddenOnAriaLabel": "Panorama controls hidden",
+ "PanoramaControlsVisibleOnAriaLabel": "Panorama controls visible",
+ "Partly Cloudy": "Partly Cloudy",
+ "PartlyCloudyCredits": "Partly Cloudy {0}",
+ "Patchy fog": "Patchy Fog",
+ "pause": "Pause",
+ "PersonalizeText": "It's easy to follow the weather in places that you choose.",
+ "PersonalizeTitle": "Add your favourite places",
+ "PinButtonTitle": "Pin",
+ "play": "Play",
+ "PM Thunderstorms": "PM Storms",
+ "Precipitation": "Precipitation",
+ "PrecipitationAccumulationMap": "Precipitation Accumulation",
+ "precipitationAltText": "Precipitation",
+ "PrecipitationForecastMap": "Precipitation Forecast",
+ "PrecipitationMap": "Precipitation",
+ "PrecipitationObservationMap": "Precipitation Observation",
+ "prevDailyConditionsDataText": "Go back and read the forecast for previous days",
+ "Publisher": "Microsoft Corporation",
+ "RadarForecastMap": "Radar Forecast",
+ "RadarMap": "Radar",
+ "RadarObservationMap": "Radar Observation",
+ "Rain": "Rain",
+ "Rain ": {
+ " Snow": "Rain / Snow",
+ " Windy": "Rain / Windy"
+ },
+ "Rain and snow": "Rain / Snow",
+ "Rain and snow shower": "Rain / Snow",
+ "Rain showers": "Rain Showers",
+ "Rain turning to Snow": "Rain to Snow",
+ "RainAlertType": "Rain",
+ "RainCredits": "Rain {0}",
+ "RainfallAriaText": "Average monthly rainfall",
+ "RainfallFilter": "Rainfall",
+ "RainfallMap": "Rainfall",
+ "RainForecastMap": "Rain forecast",
+ "RainLegend": "Rain",
+ "RainSnowCredits": "Rain and Snow {0}",
+ "RecentSearches": "Recent Searches",
+ "RecommendedForFamiliesString": "Recommended for Families: {0}",
+ "RecordSnowfallYear": "{0} ({1})",
+ "RecordTemperatureYear": "{0}° ({1})",
+ "RefreshButtonTitle": "Refresh",
+ "Regional": "Regional",
+ "RelatedResorts": "Related Ski Resorts",
+ "RemoveButtonTitle": "Remove",
+ "ResortStatusClosed": "Closed",
+ "ResortStatusOpen": "Open",
+ "ResortStatusTemporarilyClosed": "Temporarily Closed",
+ "ResortStatusWeekendsOnly": "Weekends Only",
+ "RetryButtonLabel": "Try again",
+ "Reviews": "Reviews",
+ "RightText": "Heavy",
+ "SampleDataHeader": "{0} (Sample Data)",
+ "Satellite": "Satellite",
+ "SatelliteMap": "Satellite",
+ "Scattered Flurries": "Scattered Flurries",
+ "Scattered Thunderstorms": "Scattered Storms",
+ "ScatteredCloudsCredits": "Scattered Clouds {0}",
+ "ScatteredFlurriesCredits": "Scattered Flurries {0}",
+ "searchboxInvalidEntry": "Invalid location",
+ "searchboxPlaceHolderTest": "Search for a city",
+ "searchBoxText": "Search for a Town or Postcode",
+ "SearchButtonTitle": "Search",
+ "SearchHistory": "Search History",
+ "SearchPageHeaderSubTitle": "Search Results",
+ "SearchPageHeaderTitle": "”{0}”",
+ "SearchResultsAriaLabel": "Search Results",
+ "SearchResultsHeader": "{0} search results",
+ "SearchTypeText": "Search Type",
+ "SeeMoreTruncatedText": "See more...",
+ "Seoul": "Seoul",
+ "SetDefaultButtonTitle": "Set as Home",
+ "SetDefaultMaxLimitReached": "Your Favourites list is full. Please remove a location before setting a new one as your default location.",
+ "SetHomeLocationTitle": "Set Home Location",
+ "Settings": "Settings",
+ "Severe duststorm": "Severe Dust Storm",
+ "ShareDataDesc": "Get the complete forecast for places you care about with the Weather app, available in the Windows Store.",
+ "ShareDataNotAvailableError": "Weather data is not available for this location. Please try again later.",
+ "ShareDataUrl": "http://apps.microsoft.com/webpdp/app/421ba874-f903-4965-9b82-d60f3ba3cae0",
+ "ShareInvalidSharePageMessage": "Select a city and try again.",
+ "ShareLocationNotAvailableMessage": "This location is currently not available to share.",
+ "SharePageTitle": "{0} - MSN Weather",
+ "ShareSnippet": "Detailed weather conditions and forecast for {0}.",
+ "ShareWeatherUpdates": "Weather updates",
+ "ShortDateTimeFormatString": "{0} {1}",
+ "Showers": "Showers",
+ "Showers ": {
+ " Clear": "Showers / Clear"
+ },
+ "Single Alert Heading": "Alert",
+ "skiCurrentConditionsAriaText": "new snow {0}, base depth {1}, source {2}",
+ "SkiDataAttribution": "Ski resort and snow data provided by {0}",
+ "SkiDetailsImageAttribution": "Image provided by {0}",
+ "SkiResorts": "Ski Resorts",
+ "SkiResortsECVShareError": "There is nothing to share right now. Select a resort and try again.",
+ "SkiResortWebsiteString": "Resort Website",
+ "SkiReviewDateFormat": "{0} {1}, {2}",
+ "SkiReviewFamilyFriendly": "Family Friendly",
+ "SkiReviewFiveStarsText": "5 Stars",
+ "SkiReviewFourStarsText": "4 Stars",
+ "SkiReviewOverAllRating": "{0} / 5",
+ "SkiReviewOverAllText": "Overall",
+ "SkiReviewRatings": "Ratings ({0})",
+ "SkiReviewThreeStarsText": "3 Stars",
+ "SkiReviewTwoStarsText": "2 & under",
+ "Sleet": "Sleet",
+ "Smoke": "Smoke",
+ "SnapTime": "{0} Local Time",
+ "Snow": "Snow",
+ "Snow ": {
+ " Windy": "Snow / Windy"
+ },
+ "Snow Showers": "Snow Showers",
+ "Snow Showers ": {
+ " Sun": "Snow / Sun"
+ },
+ "Snow turning to Rain": "Snow to Rain",
+ "SnowAccumulationMap": "Snow Accumulation",
+ "SnowAlertType": "Snow",
+ "SnowAriaText": "Average monthly snow",
+ "SnowCredits": "Snow {0}",
+ "SnowDataAttribution": "Snow data provided by {0}",
+ "SnowDaysFilter": "Snow days",
+ "SnowDepth": "Snow Depth",
+ "SnowDepthHeader": "Base Depth",
+ "SnowForecastMap": "Snow Forecast",
+ "SnowForecastMap.comment": "Snow Forecast map title",
+ "SnowLegend": "Snow",
+ "SnowMap": "Snow",
+ "SnowObservationMap": "Snow Observation",
+ "South Korea": "South Korea",
+ "SouthAmerica": "South America",
+ "SpeedUnitsInBFTWithDirection": "{0} {1} bft",
+ "SpeedUnitsInBFTWithDirectionAriaText": "{0} {1} Beaufort",
+ "SpeedUnitsInKMPHWithDirection": "{0} {1} kmph",
+ "SpeedUnitsInKMPHWithDirectionAriaText": "{0} {1} kilometres per hour",
+ "SpeedUnitsInMPHWithDirection": "{0} {1} mph",
+ "SpeedUnitsInMPHWithDirectionAriaText": "{0} {1} miles per hour",
+ "SpeedUnitsInMPSWithDirection": "{0} {1} m/s",
+ "SpeedUnitsInMPSWithDirectionAriaText": "{0} {1} metres per second",
+ "Squalls": "Squalls",
+ "StatementAlertSubType": "Statement",
+ "Status": "Resort Status",
+ "StatusHeader": "Status",
+ "StormAlertType": "Storm",
+ "Summit": "Summit",
+ "Sunny ": {
+ " Windy": "Sunny / Windy"
+ },
+ "Sunny (Clear)": "Sunny (Clear)",
+ "Sunrise": "Sunrise",
+ "Sunset": "Sunset",
+ "SunshineAndSeaTempAttribution": "Sunshine & Sea temp. by",
+ "SunshineAndSeaTempAttributionAriaText": "Sunshine & Sea temperature by {0}",
+ "SunshineAriaText": "Average monthly sunshine",
+ "SunshineAttribution": "Sunshine by",
+ "SunshineAttributionAriaText": "Sunshine by {0}",
+ "SunshineFilter": "Sunshine",
+ "SunshineSeaTempAttribution": "Sunshine & Sea temperature data by",
+ "Taipei": "Taipei",
+ "Taiwan": "Taiwan",
+ "TakeATourText": "Get more out of MSN Weather with great maps and in-depth data.",
+ "TakeATourTitle": "Take a tour",
+ "TempClosed": "Temp. Closed",
+ "Temperature": "Temperature",
+ "TemperatureAriaText": "Average monthly temperature",
+ "TemperatureFilter": "Temperature",
+ "TemperatureForecastMap": "Temperature Forecast",
+ "TemperatureMap": "Temperature",
+ "TemperatureWithDegreeCelsius": "{0}°C",
+ "TemperatureWithDegreeFahrenheit": "{0}°F",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "Thunderstorms": "Thunderstorms",
+ "ThunderstormsCredits": "Thunderstorms {0}",
+ "TianQiAttribution": "Daily forecasts by",
+ "Today": "Today",
+ "TodayMapSubType": "Today",
+ "Tokyo": "Tokyo",
+ "ToolTipTextC": "Click to change to Celsius",
+ "ToolTipTextF": "Click to change to Fahrenheit",
+ "ToText": "to",
+ "TrailmapAttribution": "Trail map provided by {0}",
+ "Trailmapimage": "Trail map image",
+ "TrailsOpen": "Pistes Open",
+ "Travel": "Travel",
+ "Tubing": "Tubing",
+ "United Kingdom": "United Kingdom",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInDay": "{0} day",
+ "UnitInDays": "{0} days",
+ "UnitInHectorPascal": "{0} hp",
+ "UnitInHectorPascalAriaText": "{0} hectopascals",
+ "UnitInHourPerDay": "{0} hr/day",
+ "UnitInHoursPerDay": "{0} hrs/day",
+ "UnitInInches": "{0} in",
+ "UnitInKilometres": "{0} km",
+ "UnitInMiles": "{0} m",
+ "UnitInMillibars": "{0} mb",
+ "UnitInMillibarsAriaText": "{0} millibars",
+ "UnitInMillimeters": "{0} mm",
+ "UnitInMillimetersHg": "{0} mm Hg",
+ "UnitInMillimetersHgAriaText": "{0} millimetres Hg",
+ "UnitInPercentage": "{0}%",
+ "UnknownCredits": "Unknown {0}",
+ "UnpinButtonTitle": "Unpin",
+ "UntilText": "until",
+ "UvExtreme": "{0} (Extreme)",
+ "UvHigh": "{0} (High)",
+ "UvIndex": "UV Index",
+ "UvLow": "{0} (Low)",
+ "UvModerate": "{0} (Moderate)",
+ "UvVeryHigh": "{0} (Very High)",
+ "VerticalDrop": "Vertical Drop",
+ "Visibility": "Visibility",
+ "WarningAlertSubType": "Warning",
+ "WatchAlertSubType": "Watch",
+ "weather undergroundUrl": "http://www.wunderground.com",
+ "Weather.com": "weather.com",
+ "weather.comUrl": "http://www.weather.com",
+ "Weather2Travel": "Weather2Travel",
+ "weather2travelUrl": "http://www.weather2travel.com",
+ "WeatherAlertsMap": "Weather alerts",
+ "WeatherDataNotAvailable": "Weather data is not available for this location. Please try again later or enter a different location.",
+ "WeatherDotComForecastAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-tenday",
+ "WeatherDotComMapsAttribution": "View interactive maps at {0}",
+ "WeatherDotComMapsAttributionUrlPrefix": "http://bing.weather.com/weather/map/interactive/",
+ "WeatherDotComMapsAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-Imap",
+ "WeatherDotComSeeMoreText": "See more from weather.com",
+ "WeatherMaps": "Weather Maps",
+ "WebsiteHeader": "Website",
+ "Wind": "Wind",
+ "WindAlertType": "Wind",
+ "WindHeader": "Wind",
+ "WindSpeedUnitForE": "E",
+ "WindSpeedUnitForENE": "ENE",
+ "WindSpeedUnitForESE": "ESE",
+ "WindSpeedUnitForN": "N",
+ "WindSpeedUnitForNE": "NE",
+ "WindSpeedUnitForNNE": "NNE",
+ "WindSpeedUnitForNNW": "NNW",
+ "WindSpeedUnitForNW": "NW",
+ "WindSpeedUnitForS": "S",
+ "WindSpeedUnitForSE": "SE",
+ "WindSpeedUnitForSSE": "SSE",
+ "WindSpeedUnitForSSW": "SSW",
+ "WindSpeedUnitForSW": "SW",
+ "WindSpeedunitForW": "W",
+ "WindSpeedUnitForWNW": "WNW",
+ "WindSpeedUnitForWSW": "WSW",
+ "Windy": "Windy",
+ "WindyCredits": "Windy {0}",
+ "WithinText": "Within",
+ "Wolfram Alpha": "Wolfram Alpha",
+ "wolfram alphaUrl": "http://www.wolframalpha.com",
+ "Wolfram|Alpha": "Wolfram Alpha",
+ "wolfram|alphaUrl": "http://www.wolframalpha.com",
+ "WorldHeading": "World",
+ "WorldMapAltText": "World map",
+ "WorldWeather": "World Weather",
+ "WorldWeatherContinent": "World weather {0}",
+ "WorldWeatherTitle": "World Weather",
+ "WWHighLowSeperator": "/",
+ "Y": "Yes"
+ },
+ "worldweather": {
+ "Addis Ababa": "Addis Ababa",
+ "Adelaide": "Adelaide",
+ "Alexandria": "Alexandria",
+ "ALGERIA": "Algeria",
+ "Algiers": "Algiers",
+ "Amsterdam": "Amsterdam",
+ "Arawa": "Arawa",
+ "ARGENTINA": "Argentina",
+ "Asunción": "Asunción",
+ "Athens": "Athens",
+ "Auckland": "Auckland",
+ "AUSTRALIA": "Australia",
+ "AUSTRIA": "Austria",
+ "Baghdad": "Baghdad",
+ "Bangkok": "Bangkok",
+ "Barcelona": "Barcelona",
+ "Beijing": "Beijing",
+ "Berlin": "Berlin",
+ "Bogota": "Bogota",
+ "BOLIVIA": "Bolivia",
+ "Brasília": "Brasília",
+ "BRAZIL": "Brazil",
+ "Brisbane": "Brisbane",
+ "Buenos Aires": "Buenos Aires",
+ "Cairo": "Cairo",
+ "CANADA": "Canada",
+ "Cancún": "Cancún",
+ "Cape Town": "Cape Town",
+ "Caracas": "Caracas",
+ "Casablanca": "Casablanca",
+ "Chicago": "Chicago",
+ "CHILE": "Chile",
+ "CHINA": "China",
+ "COLOMBIA": "Colombia",
+ "Colombo": "Colombo",
+ "Darwin": "Darwin",
+ "Dubai": "Dubai",
+ "Dublin": "Dublin",
+ "Durban": "Durban",
+ "ECUADOR": "Ecuador",
+ "EGYPT": "Egypt",
+ "ETHIOPIA": "Ethiopia",
+ "FIJI": "Fiji",
+ "FINLAND": "Finland",
+ "FRANCE": "France",
+ "Georgetown": "Georgetown",
+ "GERMANY": "Germany",
+ "GREECE": "Greece",
+ "GUYANA": "Guyana",
+ "Helsinki": "Helsinki",
+ "Hobart": "Hobart",
+ "Ibadan": "Ibadan",
+ "INDIA": "India",
+ "IRAQ": "Iraq",
+ "IRELAND": "Ireland",
+ "Istanbul": "Istanbul",
+ "ITALY": "Italy",
+ "JAPAN": "Japan",
+ "Juneau": "Juneau",
+ "Kampala": "Kampala",
+ "KENYA": "Kenya",
+ "KOREA": "Korea",
+ "Kyiv": "Kyiv",
+ "La Paz": "La Paz",
+ "Lagos": "Lagos",
+ "Lima": "Lima",
+ "London": "London",
+ "Los Angeles": "Los Angeles",
+ "Melbourne": "Melbourne",
+ "MEXICO": "Mexico",
+ "Mexico City": "Mexico City",
+ "Miami": "Miami",
+ "MOROCCO": "Morocco",
+ "Moscow": "Moscow",
+ "Mumbai": "Mumbai",
+ "Nairobi": "Nairobi",
+ "NETHERLANDS": "Netherlands",
+ "New Delhi": "New Delhi",
+ "New York City": "New York",
+ "NEW ZEALAND": "New Zealand",
+ "NIGERIA": "Nigeria",
+ "PAPUA NEW GUINEA": "Papua New Guinea",
+ "PARAGUAY": "Paraguay",
+ "Paris": "Paris",
+ "Perth": "Perth",
+ "PERU": "Peru",
+ "Port Moresby": "Port Moresby",
+ "Quito": "Quito",
+ "Rio de Janeiro": "Rio de Janeiro",
+ "Rio Gallegos": "Rio Gallegos",
+ "Riyadh": "Riyadh",
+ "Rome": "Rome",
+ "RUSSIA": "Russia",
+ "San Francisco": "San Francisco",
+ "Santiago": "Santiago",
+ "SAUDI ARABIA": "Saudi Arabia",
+ "Seattle": "Seattle",
+ "Seoul": "Seoul",
+ "Shanghai": "Shanghai",
+ "Singapore": "Singapore",
+ "SINGAPORE_CAPS": "Singapore",
+ "SOUTH AFRICA": "South Africa",
+ "SPAIN": "Spain",
+ "SRI LANKA": "Sri Lanka",
+ "Suva": "Suva",
+ "Sydney": "Sydney",
+ "THAILAND": "Thailand",
+ "Tokyo": "Tokyo",
+ "Toronto": "Toronto",
+ "TURKEY": "Turkey",
+ "UGANDA": "Uganda",
+ "UKRAINE": "Ukraine",
+ "UNITED ARAB EMIRATES": "United Arab Emirates",
+ "UNITED KINGDOM": "United Kingdom",
+ "UNITED STATES": "United States",
+ "Vancouver": "Vancouver",
+ "VENEZUELA": "Venezuela",
+ "Victoria Falls": "Victoria Falls",
+ "Vienna": "Vienna",
+ "Washington D.C.": "Washington, D.C.",
+ "Wellington": "Wellington",
+ "ZIMBABWE": "Zimbabwe"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/en-in.json b/packages/microsoft.bingweather/resources/en-in.json
new file mode 100644
index 00000000..c3b0759b
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/en-in.json
@@ -0,0 +1,1429 @@
+{
+ "AppEx.WeatherApp.Services": {
+ "Resources": {
+ "Country": "Country/Region",
+ "KilometresPerHour": "{0} kmph",
+ "MilesPerHour": "{0} mph",
+ "Region": "State/Province",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInInches": "{0} in"
+ }
+ },
+ "Platform": {
+ "aboutLabel": "About",
+ "accept": "Accept",
+ "Add": "Add",
+ "addMoreFilters": "Add/Remove More Filters",
+ "advertisement": "Advertisement",
+ "AppIsPersonalized": "{0} is personalized. ",
+ "appRestart": "(Requires app restart)",
+ "AppTitle": "the app",
+ "appVersion": "Version {0}",
+ "ArticleHeaderSubscriptionMessage": "Subscribe",
+ "ArticleLinkLabelText": "View article",
+ "ArticleSubscriptionMessage": "Subscribe for unlimited access",
+ "ArticleTextSizeLarge": "Large",
+ "ArticleTextSizeMedium": "Medium",
+ "ArticleTextSizeMenuLabel": "Text size",
+ "ArticleTextSizeSmall": "Small",
+ "ArticleTextSizeXLarge": "X-Large",
+ "ArticleTextStyleMenuLabel": "Text style",
+ "ArticleUnavailableOffline": "This article is not available offline.",
+ "AverageMarketCharacterSizePx": "8",
+ "brand": "MSN",
+ "Calendar": "Calendar",
+ "cancel": "Cancel",
+ "catastrophicError": "There is a problem with the application. Please restart.",
+ "changeMarketTo": "{0} ({1})",
+ "changeSettings": "Change Settings",
+ "changesFromAppSettings": "You can make these changes at any time using app settings",
+ "clearFiltersLabel": "Reset Filters",
+ "ClickToOpenL2": "Select to show sub-channel",
+ "close": "Close",
+ "closeAppButton": "Close app",
+ "ConnectMicrosoftAccount": "Connect Microsoft account",
+ "ConnectMyMicrosoftAccount": "Connect my Microsoft account",
+ "ConnectToMicrosoft": "Connect to Microsoft",
+ "createAccountButton": "Create an account >",
+ "credentialMessage": "Enter a username and password to access {0}.",
+ "credentialsInvalid": "Invalid credentials. Please try again.",
+ "creditsLink": "Credits",
+ "DaysAgo": "{0} days ago",
+ "decline": "Decline",
+ "Delete": "Delete",
+ "demoModeTitle": "This feature is not available in demo mode.",
+ "demoMode_label": "DEMO MODE",
+ "demoMode_lastUpdated": "Tour the app in demo mode.",
+ "Dismiss": "Dismiss",
+ "entitlementsInvalid": "Sorry, your subscription does not include this device.",
+ "featured": "Featured",
+ "feedbackButtonLabel": "Feedback",
+ "feedbackCommentQuestion": "What could we do to improve the app?",
+ "feedbackDislikeIcon": "]D83D;]DE29;",
+ "feedbackDislikeLabel": "Dislike",
+ "feedbackLikeIcon": "]D83D;]DE0A;",
+ "feedbackLikeLabel": "Like",
+ "feedbackOfflineMessage": "It looks like you are currently offline. Please connect to the Internet and try again.",
+ "feedbackPrivacyStatementLabel": "Privacy statement",
+ "feedbackQ1option1": "Very good",
+ "feedbackQ1option2": "Good",
+ "feedbackQ1option3": "Average",
+ "feedbackQ1option4": "Poor",
+ "feedbackQ1option5": "Very Poor",
+ "feedbackQ2option1": "Definitely would recommend",
+ "feedbackQ2option2": "Probably would recommend",
+ "feedbackQ2option3": "Might or might not recommend",
+ "feedbackQ2option4": "Probably would not recommend",
+ "feedbackQ2option5": "Definitely would not recommend",
+ "feedbackQuestion1": "How would you rate this app?",
+ "feedbackQuestion2": "How likely would you be recommending this app to a friend?",
+ "feedbackSubmitButtonLabel": "Submit",
+ "feedbackThankYou": "Thank you for your feedback!",
+ "filmstrip": "Filmstrip",
+ "FilterAll": "Show All",
+ "FilterBy": "Filter By:",
+ "filterMenu": "Filter Menu",
+ "forceUpdate": "This version of {0} is no longer supported. Please update to the latest version.",
+ "forgotPasswordButton": "Forgotten password >",
+ "freeformTextWarning": "Thanks for taking the time to add your feedback. Please take care not to provide any personal information.",
+ "GoBack": "Go back",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "HelpLabel": "Help",
+ "HoursAgo": "{0} hours ago",
+ "imageAttribution": "Image attribution",
+ "ImageCount": "Photo {0} of {1}",
+ "impressum": "Impressum",
+ "invalidEntry": "No results found. Please try again.",
+ "InvalidSubscriptionMessage": "The article that you are trying to read is locked. Please get a valid subscription.",
+ "L2Opened": "Sub-channels Shown",
+ "LabelChangeTheseSettings": "Change these settings",
+ "LabelClickToChange": "Click here to change settings",
+ "LabelModifySettings": "Modify settings",
+ "LabelOff": "Off",
+ "LabelOn": "On",
+ "LabelPrivacyStatement": "Privacy Statement",
+ "LabelTapToChange": "Tap here to change settings",
+ "languageSetting": "Choose edition",
+ "lca_privacy": "Privacy Statement",
+ "lca_serviceAgreement": "Terms of Use",
+ "Loading": "Loading",
+ "LocationCannotBeFound": "Your location cannot be found. Change your permissions to allow News to use your location.",
+ "Login": "Sign In",
+ "loginPrompt": "Enter your {0} account",
+ "loginPromptContentLocked": "The article you are trying to read is locked. Please log in.",
+ "Logout": "Sign out",
+ "marketChangePrompt": "Please close and reopen the app for your content preference changes to take effect.",
+ "marketError": "This app is not available in your market.",
+ "marketSelDialogMsg": "You are viewing content from {0} ({1}). You can change this option at any time from the settings charm.",
+ "marketSelDialogMsgOpt": "You are viewing content from {0} ({1}). You can change this setting in the app at any time.",
+ "marketSelDialogTitle": "Which content and language would you like to see?",
+ "marketSelDialogTitleOpt": "Where would you like to view content from?",
+ "mediaPlaybackButtonsAriaLabel": "Playback buttons",
+ "mediaPlaybackContentRegionAriaLabel": "Media playback",
+ "mediaPlaybackControlsAriaLabel": "Playback controls",
+ "mediaPlaybackControlsLayerAriaLabel": "Playback controls",
+ "mediaPlaybackEnterFullScreenAriaLabel": "Show Full Screen",
+ "mediaPlaybackLeaveFullScreenAriaLabel": "Exit Full Screen",
+ "mediaPlaybackMinimalAriaLabel": "Currently Playing",
+ "mediaPlaybackNextButtonAriaLabel": "Next",
+ "mediaPlaybackPauseButtonAriaLabel": "Pause",
+ "mediaPlaybackPlayButtonAriaLabel": "Play",
+ "mediaPlaybackPreviousButtonAriaLabel": "Previous",
+ "mediaPlaybackSeekBarAriaLabel": "Seek bar",
+ "mediaPlaybackSeekBarThumbAriaLabel": "Seek bar slider",
+ "mediaPlaybackShareAriaLabel": "Share",
+ "mediaPlaybackTimeIndicatorAriaLabel": "Playback time indicator",
+ "MessageAccessingMSAinfo": "Accessing your Microsoft account information. ",
+ "MessageAccountConnect1": "To enable personalization and syncing across devices, connect your Microsoft account in PC Settings.",
+ "MessageAccountConnect2": "To enable personalisation and syncing across devices, {0}.",
+ "MessageAdSettingsLocation": "Select “Microsoft Advertising” in Settings to control the personalization of ads in this app. ",
+ "MessageAdSettingsOff": "You are not receiving personalized ads. Select “Microsoft Advertising” in Settings to get personalised ads.",
+ "MessageAdSettingsOn1": "Microsoft Advertising is using your information to personalize ads. Select “Microsoft Advertising” in Settings to turn this off. ",
+ "MessageAdSettingsOn2": "Microsoft Advertising is using your information to personalize ads. Select “Microsoft Advertising” in Settings to turn off personalized ads. ",
+ "MessageConfiguredMSAinfo": "Configured using your Microsoft account information. ",
+ "MessageConnect": "Connect",
+ "MessageConnectAccount": "Connect account",
+ "MessageConnectMicrosoftAccount": "connect your Microsoft account",
+ "MessageCustomizedMSAinfo": "Customized with your Microsoft account information. ",
+ "MessageMSAConnectionDescription": "This will synchronize information between this app and your Microsoft account to personalize this and other Microsoft experiences across your devices.",
+ "MessageMSASignIn": "To enable personalization and syncing across devices, sign in to your Microsoft account. ",
+ "MessageOptimizedMSAinfo": "Optimised with your Microsoft account information. ",
+ "MessagePersonalize": "Use information from this app and associated with my Microsoft account to personalize this and other Microsoft experiences.",
+ "MessagePersonalizedMSAinfo": "Personalized with your Microsoft account information. ",
+ "MessagePersonalizeSettings": "Personalise settings",
+ "MessagePrivacySettings": "Privacy settings",
+ "MessagePrivacyUpdateButton": "Learn more",
+ "MessagePrivacyUpdateCloseButton": "Dismiss",
+ "MessagePrivacyUpdated": "We have updated our Privacy Statement.",
+ "MessagePrivacyUpdateLink": "Learn more",
+ "MessagePrivacyUpdateNotif": "We are updating our Privacy Statement.",
+ "MessageRoam": "Sync this app's settings across my devices. ",
+ "MessageTermsAndPrivacyUpdated": "We have updated our Terms of Use and Privacy Statement.",
+ "MessageTermsAndPrivacyUpdateNotif": "We are updating our Terms of Use and Privacy Statement.",
+ "MessageTermsUpdateButton": "Learn more",
+ "MessageTermsUpdateCloseButton": "Dismiss",
+ "MessageTermsUpdated": "We have updated our Terms of Use.",
+ "MessageTermsUpdateLink": "Learn more",
+ "MessageTermsUpdateNotif": "We are updating our Terms of Use.",
+ "MessageUsingMSAinfo": "Using your Microsoft account information. ",
+ "MicrosoftAccount": "Microsoft",
+ "MicrosoftAdvertisingPrivacyLinkText": "Microsoft Advertising Privacy Statement.",
+ "MicrosoftAdvertisingSettingsText": "To control ad personalization, see the ",
+ "MinsAgo": "{0} mins ago",
+ "More": "More",
+ "MoreArticles": "Upcoming",
+ "MoreFrom": "More from",
+ "MSAccountNameLabel": "Account name",
+ "MSAConnectionRemoveLink": "Remove",
+ "MSAConnectLabel": "Connect",
+ "NextArticle": "Next article",
+ "nextButton": "Next Item",
+ "noInternetButton": "Try Again",
+ "noInternetDescription": "Please check your Internet connection.",
+ "noInternetTitle": "You are not connected to the Internet.",
+ "noThanks": "No, Thanks",
+ "offLabel": "Off",
+ "offline_label": "OFFLINE",
+ "offline_lastUpdated": "Last Updated {0}",
+ "offline_noContent": "This content is not available in offline mode.",
+ "offline_problem": "The application ran into a problem and couldn’t load the content.",
+ "okButton": "OK",
+ "OneDayAgo": "1 day ago",
+ "OneHourAgo": "1 hour ago",
+ "OneMinAgo": "1 min ago",
+ "open": "Open",
+ "OpenInBrowser": "View in browser",
+ "optionsTitle": "Options",
+ "other": "Other",
+ "otherButton": "Other Markets",
+ "overLimitMessage": "{0} may use a large amount of data for some features. Your metered connection is over the data limit and fees may apply",
+ "Page": "Page {0}",
+ "PageOf": "Page {0} of {1}",
+ "password": "Password",
+ "passwordInput": "Password",
+ "Pause": "Pause",
+ "PaywallCardByAuthor": "By {0}",
+ "PaywallCardDay": "day",
+ "PaywallCardGrowlMessage": "You have used {0} of {1} free token(s) from {2} {3}.",
+ "PaywallCardHour": "hour",
+ "PaywallCardMonth": "month",
+ "PaywallCardQuotaReachedMessage": "You can continue to enjoy up to {0} free token(s) per {1} or subscribe for unlimited access.",
+ "PaywallcardReadArticle": "Read article",
+ "PaywallCardSignIn": "Sign in",
+ "PaywallCardSubscribe": "Subscribe",
+ "PaywallCardThisHour": "this hour",
+ "PaywallCardThisMonth": "this month",
+ "PaywallCardThisWeek": "this week",
+ "PaywallCardThisYear": "this year",
+ "PaywallCardToday": "today",
+ "PaywallCardUnlimitedAccess": "Subscribe for Unlimited Access",
+ "PaywallCardWeek": "week",
+ "PaywallCardYear": "year",
+ "PhotosynthControlsHiddenAriaLabel": "Panorama controls hidden",
+ "PhotosynthControlsVisibleAriaLabel": "Panorama controls visible",
+ "pinToStart": "Pin to Start",
+ "Play": "Play",
+ "poweredBy": "Powered by {0}",
+ "PreviousArticle": "Previous article",
+ "previousButton": "Previous Item",
+ "privacyPolicy": "Privacy Policy",
+ "progressAlertAriaLabel": "Alert",
+ "readingList": "Saved",
+ "refresh": "Refresh",
+ "RegionCurrentLocation": "Current Location",
+ "RegionSelectLabel": "Update regional sources for your city",
+ "RegionSelectNone": "(None)",
+ "RelatedArticles": "Related",
+ "Resources": {
+ "LanguageID": "16393",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharic",
+ "Language_ar": "Arabic",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamese",
+ "Language_az": "Azeri (Latin)",
+ "Language_az-Cyrl": "Azerbaijani (Cyrillic)",
+ "Language_az-Latn": "Azerbaijani (Latin)",
+ "Language_ba-Cyrl": "Bashkir",
+ "Language_be": "Belarusian",
+ "Language_bg": "Bulgarian",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesh)",
+ "Language_bn-in": "Bangla (India)",
+ "Language_br-Latn": "Breton",
+ "Language_bs": "Bosnian (Latin)",
+ "Language_bs-Cyrl": "Bosnian (Cyrillic)",
+ "Language_bs-Latn": "Bosnian (Latin)",
+ "Language_ca": "Catalan",
+ "Language_ca-ES-valencia": "Valencian",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Corsican",
+ "Language_cs": "Czech",
+ "Language_cy": "Welsh",
+ "Language_da": "Danish",
+ "Language_de": "German",
+ "Language_dsb": "Lower Sorbian",
+ "Language_dv": "Divehi",
+ "Language_el": "Greek",
+ "Language_en": "English",
+ "Language_es": "Spanish",
+ "Language_et": "Estonian",
+ "Language_eu": "Basque",
+ "Language_fa": "Persian",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnish",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Faroese",
+ "Language_fr": "French",
+ "Language_fy": "Frisian",
+ "Language_ga": "Irish",
+ "Language_gd": "Scottish Gaelic",
+ "Language_gd-Latn": "Scottish Gaelic",
+ "Language_gl": "Galician",
+ "Language_gsw": "Alsatian",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Hausa (Latin)",
+ "Language_ha-Latn": "Hausa (Latin)",
+ "Language_he": "Hebrew",
+ "Language_hi": "Hindi",
+ "Language_hr": "Croatian",
+ "Language_hsb": "Upper Sorbian",
+ "Language_hu": "Hungarian",
+ "Language_hy": "Armenian",
+ "Language_id": "Indonesian",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Icelandic",
+ "Language_it": "Italian",
+ "Language_iu-Latn": "Inuktitut (Latin)",
+ "Language_ja": "Japanese",
+ "Language_ka": "Georgian",
+ "Language_kk": "Kazakh",
+ "Language_kl": "Greenlandic",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Korean",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdish",
+ "Language_ku-Arab": "Central Kurdish",
+ "Language_ky": "Kyrgyz",
+ "Language_ky-Cyrl": "Kyrgyz",
+ "Language_lb": "Luxembourgish",
+ "Language_lo": "Lao",
+ "Language_lt": "Lithuanian",
+ "Language_lv": "Latvian",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Macedonian",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolian (Cyrillic)",
+ "Language_mn-Cyrl": "Mongolian (Cyrillic)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malay",
+ "Language_mt": "Maltese",
+ "Language_nb": "Norwegian (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Dutch",
+ "Language_nn": "Norwegian (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Occitan",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabic)",
+ "Language_pl": "Polish",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashto",
+ "Language_pt": "Portuguese",
+ "Language_pt-br": "Portuguese (Brazil)",
+ "Language_pt-pt": "Portuguese (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Romanian",
+ "Language_ru": "Russian",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sakha",
+ "Language_sd-Arab": "Sindhi (Arabic)",
+ "Language_se-Latn": "Northern Sami",
+ "Language_si": "Sinhala",
+ "Language_sk": "Slovak",
+ "Language_sl": "Slovenian",
+ "Language_sma-Latn": "Southern Sami",
+ "Language_smj-Latn": "Lule Sami",
+ "Language_smn-Latn": "Inari Sami",
+ "Language_sms-Latn": "Skolt Sami",
+ "Language_sq": "Albanian",
+ "Language_sr-Cyrl": "Serbian (Cyrillic)",
+ "Language_sr-cyrl-ba": "Serbian (Cyrillic, Bosnia and Herzegovina)",
+ "Language_sr-Latn": "Serbian (Latin)",
+ "Language_sv": "Swedish",
+ "Language_sw": "Kiswahili",
+ "Language_syr-Syrc": "Syriac",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tajik (Cyrillic)",
+ "Language_th": "Thai",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmen (Latin)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Turkish",
+ "Language_tt": "Tatar",
+ "Language_tt-Cyrl": "Tatar (Cyrillic)",
+ "Language_tzm-Latn": "Tamazight (Latin)",
+ "Language_ug": "Uyghur",
+ "Language_ug-Arab": "Uyghur",
+ "Language_uk": "Ukrainian",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Uzbek (Cyrillic)",
+ "Language_uz-Latn": "Uzbek (Latin)",
+ "Language_vi": "Vietnamese",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinese (Simplified)",
+ "Language_zh-Hant": "Chinese (Traditional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "United Arab Emirates",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua and Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "American Samoa",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaijan",
+ "Region_Display_BA": "Bosnia and Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgium",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brazil",
+ "Region_Display_BS": "The Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos (Keeling) Islands",
+ "Region_Display_CD": "Congo (DRC)",
+ "Region_Display_CF": "Central African Republic",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Switzerland",
+ "Region_Display_CI": "Côte d’Ivoire",
+ "Region_Display_CK": "Cook Islands",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Cameroon",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia and Montenegro (Former)",
+ "Region_Display_CV": "Cape Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas Island",
+ "Region_Display_CY": "Cyprus",
+ "Region_Display_CZ": "Czech Republic",
+ "Region_Display_DE": "Germany",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Denmark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominican Republic",
+ "Region_Display_DZ": "Algeria",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egypt",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spain",
+ "Region_Display_ET": "Ethiopia",
+ "Region_Display_FI": "Finland",
+ "Region_Display_FK": "Falkland Islands (Islas Malvinas)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Faroe Islands",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "United Kingdom",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "French Guiana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Greenland",
+ "Region_Display_GM": "The Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Equatorial Guinea",
+ "Region_Display_GR": "Greece",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong SAR",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatia",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Hungary",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Ireland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Iraq",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Iceland",
+ "Region_Display_IT": "Italy",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordan",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kyrgyzstan",
+ "Region_Display_KH": "Cambodia",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoros",
+ "Region_Display_KN": "Saint Kitts and Nevis",
+ "Region_Display_KR": "Korea",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Cayman Islands",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Lebanon",
+ "Region_Display_LC": "Saint Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lithuania",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Latvia",
+ "Region_Display_LY": "Libya",
+ "Region_Display_MA": "Morocco",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "Saint Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall Islands",
+ "Region_Display_MK": "Macedonia, FYRO",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao SAR",
+ "Region_Display_MP": "Northern Mariana Islands",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexico",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "New Caledonia",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk Island",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Netherlands",
+ "Region_Display_NO": "Norway",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "New Zealand",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "French Polynesia",
+ "Region_Display_PG": "Papua New Guinea",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Poland",
+ "Region_Display_PM": "Saint Pierre and Miquelon",
+ "Region_Display_PN": "Pitcairn Islands",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Reunion",
+ "Region_Display_RO": "Romania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Russia",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Saudi Arabia",
+ "Region_Display_SB": "Solomon Islands",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Sweden",
+ "Region_Display_SG": "Singapore",
+ "Region_Display_SH": "Saint Helena, Ascension and Tristan da Cunha",
+ "Region_Display_SI": "Slovenia",
+ "Region_Display_SK": "Slovakia",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "South Sudan",
+ "Region_Display_ST": "São Tomé and Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Syria",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks and Caicos Islands",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tajikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunisia",
+ "Region_Display_TR": "Turkey",
+ "Region_Display_TT": "Trinidad and Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "United States",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistan",
+ "Region_Display_VA": "Holy See (Vatican City)",
+ "Region_Display_VC": "Saint Vincent and the Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "British Virgin Islands",
+ "Region_Display_VI": "U.S. Virgin Islands",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis and Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Sint Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "South Africa",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabwe"
+ },
+ "restart": "Restart",
+ "retry": "Try Again",
+ "roamingMessage": "{0} may use a large amount of data for some features. You are currently roaming and data fees may apply.",
+ "row": "Row",
+ "scrollLeftAriaLabel": "Scroll Left",
+ "scrollRightAriaLabel": "Scroll Right",
+ "semanticZoomContainer": "Semantic Zoom Container",
+ "sendFeedbackButtonLabel": "Send Feedback",
+ "ShareArticleHeader": "Share",
+ "ShareArticleText": "Share this article",
+ "Slide": "Image",
+ "Slideshow": "Slideshow",
+ "SnappedMessage": "Snap mode is coming soon.",
+ "SortBy": "SORT BY",
+ "sortLabel": "Sort",
+ "sortText": "Sort",
+ "sponsoredBy": "Sponsored by",
+ "standardErrorButton": "Try Again",
+ "standardErrorDescription": "There was a problem. Please try again.",
+ "standardErrorTitle": "This page failed to load.",
+ "submit": "Submit",
+ "subscribeButton": "Subscribe",
+ "subscribeInstructions": "Enter username and password",
+ "subscribeNow": "Subscribe now and get:",
+ "subscribePanoButton": "Subscribe for Unlimited Access",
+ "subscribePrompt": "Content for subscribers only",
+ "swipeDownToolTip": "Swipe down to select",
+ "swipeLeftToolTip": "Swipe left to select",
+ "swipeRightToolTip": "Swipe right to select",
+ "TermsOfUse": "Terms of Use",
+ "TextStylePrimary": "Primary",
+ "TextStyleSecondary": "Secondary",
+ "timeIndicatorTextFormat": "{0} / {1}",
+ "TitleAccountSettings": "Account",
+ "TitleAccountsSettings": "Account",
+ "TitleAdSettings": "Advertising settings",
+ "TitleConfiguration": "Configuration",
+ "TitleCustomization": "Customization",
+ "TitleMicrosoftAccount": "Microsoft account",
+ "TitleMSAConnectedDescription": "Connected to your Microsoft account",
+ "TitleMSAConnectionDescription": "Connect your Microsoft account",
+ "TitlePersonalization": "Personalization",
+ "TitlePersonalizationSettings": "Personalization",
+ "TitlePersonalize": "Personalize",
+ "TitlePersonalizedAdSettings": "Personalized Ad Settings",
+ "TitlePersonalizedAdvertisingSettings": "Personalized Advertising Settings",
+ "TitlePersonalizeSettings": "Personalization settings",
+ "TitlePrivacySettings": "Privacy",
+ "TitlePrivacyStatementNew": "Privacy Statement (new)",
+ "TitleRoam": "Sync across devices",
+ "TitleTermsNew": "Terms of Use (new)",
+ "unpinFromStart": "Unpin from Start",
+ "Unsnap": "Unsnap",
+ "update": "Update Now",
+ "updateMessage": "A new version of {0} is available. Update now to take advantage of the latest changes",
+ "updateMessage_button1": "Update",
+ "updateMessage_button2": "Later",
+ "updateTitle": "Update Available",
+ "userName": "Username",
+ "userNameInput": "Your email address or username",
+ "validateError": "We are unable to log you in. Please try again later.",
+ "videoClusterLabel": "Featured Videos",
+ "videoConnectErrorText": "Please connect to the Internet and try again",
+ "videoCountdownText": "Up next in {0}",
+ "videoGeoErrorText": "Video is not available for current location",
+ "videoItemLabel": "Video",
+ "videoLoadErrorText": "We're having problems loading this video, please try again later",
+ "VideosClusterLabel": "Videos",
+ "viewing": "Viewing",
+ "WeekNum": "Week {0}",
+ "win8Brand": "Windows 8",
+ "win8Share": "If you have {0} or {1}, {2}",
+ "win8ShareBrowser": " Otherwise, {0}",
+ "win8ShareBrowserLink": "click here.",
+ "win8ShareLink": "open this in {0}.",
+ "win8ShareTitle": "{0} - {1}",
+ "winPhone8Brand": "Windows Phone 8"
+ },
+ "resources": {
+ "24Hour": "24 hour",
+ "About": "About",
+ "Accumulation24HoursMap": "Accumulation 24 hours",
+ "AccumulationMap": "Accumulation",
+ "AccuWeather": "AccuWeather",
+ "accuweatherUrl": "http://www.accuweather.com",
+ "AcresOpen": "Open Miles",
+ "ActiveAlertsMap": "Active alerts",
+ "AddAnotherLocSearchPage": "Try a different location",
+ "AddButtonTitle": "Add",
+ "AddNewLocationString": "Add a new location",
+ "AddressHeader": "Address",
+ "AddTileAriaText": "Add another location to favourites",
+ "AdvancedRuns": "Advanced Runs",
+ "AdvisoryAlertSubType": "Advisory",
+ "Africa": "Africa",
+ "Afternoon Cloudy": "Afternoon Cloudy",
+ "Afternoon Ice ": {
+ " Snow": "PM Ice / Snow"
+ },
+ "Afternoon Rain": "Afternoon Rain",
+ "Afternoon Snow": "Afternoon Snow",
+ "AirAlertType": "Air",
+ "Alert Bar Heading": "Alert",
+ "alertsFlyoutAriaText": "alert",
+ "AlertShort": "ALERT {0}",
+ "AlertShortWithCount": "ALERT {0} {1} {2} more",
+ "AlertsMap": "Alerts",
+ "AlertWarning": "ALERT {0} from {1} to {2}",
+ "AlertWarningWithCount": "ALERT {0} from {1} to {2} {3} {4} more",
+ "AllFavoritesHeading": "All Favourites",
+ "AM Thunderstorms": "AM Storms",
+ "AppDescription": "Weather App",
+ "appFeedbackTitle": "Weather Application Feedback",
+ "AppIntroductionText": "Check the weather close to home and around the world",
+ "AppTitle": "Weather",
+ "AriaTextC": "Celsius",
+ "AriaTextF": "Fahrenheit",
+ "Asia": "Asia / Middle East",
+ "AverageRainfall": "Average Rainfall",
+ "AverageSnow": "Average Snow",
+ "Barometer": "Barometer",
+ "Base": "Base",
+ "BaseDepth": "Base Depth",
+ "BeaufortScale": "{0} bft",
+ "BeaufortScaleAriaText": "{0} Beaufort",
+ "BeginnerRuns": "Beginner Runs",
+ "Blizzard": "Blizzard",
+ "BlizzardCredits": "Blizzard {0}",
+ "Blowing dust": "Blowing Dust",
+ "Blowing sand": "Blowing Sand",
+ "Blowing Snow": "Blowing Snow",
+ "BlowingSnowCredits": "Blowing Snow {0}",
+ "Boarding": "Boarding",
+ "BrandedAppTitle": "MSN Weather",
+ "C": "C",
+ "CamsPanorama": "Cams and 360° Panoramas",
+ "CanadaRadarAttribution": "Canadian radar data courtesy of Environment Canada",
+ "CCDailyAttribution": "Current conditions, daily forecasts by",
+ "CCDailyAttribution1Provider": "Current conditions, daily forecasts by {0}",
+ "CCDailyAttribution2Providers": "Current conditions, daily forecasts by {0} , {1}",
+ "CCDailyMapsAttribution": "Current conditions, daily forecasts and maps by",
+ "CelsiusSetting": "Celsius",
+ "ChanceOfPrecipitationMap": "Chance of precipitation",
+ "ChangeHomeButtonTitle": "Change Home",
+ "ChangeHomeTileAriaText": "Change the home location",
+ "ChangeRegion": "Change region",
+ "ChangeUnitToCButtonTitle": "Change to Celsius",
+ "ChangeUnitToFButtonTitle": "Change to Fahrenheit",
+ "Clear": "Clear",
+ "ClearButtonTitle": "Clear",
+ "ClearCredits": "Clear {0}",
+ "clearSearchHistoryButton": "Clear weather searches",
+ "ClearSelectionButtonTitle": "Clear selection",
+ "CloseButtonLabel": "Close",
+ "CloudCover": "Cloud Cover",
+ "CloudForecastMap": "Cloud Forecast",
+ "CloudMap": "Cloud",
+ "Cloudy": "Cloudy",
+ "Cloudy ": {
+ " Afternoon Sun": "Cloudy / PM Sun",
+ " Windy": "Cloudy / Windy"
+ },
+ "CloudyCredits": "Cloudy {0}",
+ "ConfirmButtonTitle": "Confirm",
+ "CouldNotLoadDataMsg": "Data cannot be refreshed. Please try again later.",
+ "CountryRegionFilterText": "Country/Region",
+ "CrossCountry": "Cross Country",
+ "Current": "MSN Weather",
+ "currentConditionsAriaText": "today {0}, current condition {1}, feels like {2}, source {3}",
+ "CurrentHomeNarratorString": "Current Home {0}",
+ "CurrentLocationButtonTitle": "Current Location",
+ "CurrentLocationFetchErrorMsg": "Your location cannot be detected. Try again later.",
+ "CurrentLocDataNotAvailable": "Weather data is not available for your location. Please try again later.",
+ "CustomTitle": "Custom",
+ "DailyDrilldownHourlyForecastAriaText": "{0}, {1} {2}, precipitation {3}",
+ "dailyForecast": "{0}, high {1} low {2}, {3}, precipitation {4}",
+ "dailyForecastExpanded1": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}",
+ "dailyForecastExpanded2": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}, high {8} low {9} source {10}",
+ "dailyForecastMinMax": "{0}, low {1} high {2}, {3}, precipitation {4}",
+ "dailyForecastMinMaxExpanded1": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}",
+ "dailyForecastMinMaxExpanded2": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}, low {8} high {9} source {10}",
+ "DataAttribution": "Data provided by",
+ "DayHeading": "Day",
+ "DealsNews": "Deals & News",
+ "defaultECVErrorAction": "Retry",
+ "defaultECVErrorDescription": "We're sorry, something happened while fulfilling your request. Please retry",
+ "defaultECVErrorTitle": "Oops!",
+ "DefaultShortNameForPinFlyout": "Weather",
+ "Dewpoint": "Dew Point",
+ "DismissText": "Remove this panel. Go to Next Steps for more content and Help tips.",
+ "DismissTitle": "Close",
+ "DisplayUnits": "Units",
+ "DistanceText": "Distance",
+ "DopplerRadar": "Doppler Radar",
+ "Drifting sand": "Drifting Sand",
+ "Drifting snow": "Drifting Snow",
+ "Drizzle": "Drizzle",
+ "DrizzleCredits": "Drizzle {0}",
+ "DustCloudyCredits": "Dust Cloudy {0}",
+ "Duststorm": "Dust Storm",
+ "Duststorms": "Dust Storms",
+ "DustyClearCredits": "Dusty Clear {0}",
+ "ECVNoResultsActionFilters": "Clear filters",
+ "ECVNoResultsActionNoFilters": "Go Back",
+ "ECVNoResultsDescriptionFilters": "Your search produced no results. Clear your filters and try again.",
+ "ECVNoResultsDescriptionNoFilters": "Your search produced no results. Please try again.",
+ "ECVNoResultsIcon": "⚊",
+ "ECVNoResultsTitle": "No results found",
+ "England": "England",
+ "EnterLocation": "Enter Location",
+ "Europe": "Europe",
+ "ExpertRuns": "Expert Runs",
+ "ExtremeTempAlertType": "Extreme Temperature",
+ "F": "F",
+ "FahrenheitSetting": "Fahrenheit",
+ "Fair": "Fair",
+ "favHighLowText": "High / Low",
+ "favLowHighText": "Low/High",
+ "Favorites": "Favourites",
+ "FeelsLike": "Feels Like {0}",
+ "Feet": "ft",
+ "FilterShow": "Show",
+ "FilterValueDeals": "Deals",
+ "FilterValueFav": "Favourites",
+ "FilterValueOpen": "Open Only",
+ "FloodAlertType": "Flood",
+ "Flurries": "Flurries",
+ "Fog": "Fog",
+ "FogCredits": "Fog {0}",
+ "Foreca": "Foreca",
+ "ForecastHeader": "Today's Forecast",
+ "ForecastMapSubType": "Forecast",
+ "forecaUrl": "http://www.foreca.com",
+ "Freezing": "Freezing",
+ "Freezing Drizzle": "Freezing Drizzle",
+ "Freezing fog": "Freezing Fog",
+ "Freezing Rain": "Freezing Rain",
+ "FreezingRainCredits": "Freezing Rain {0}",
+ "FREOfflineMessage": "You are viewing sample weather data. Please connect to the Internet to see weather for your town/city.",
+ "FreshSnow": "Fresh Snow",
+ "FrigidCredits": "Frigid {0}",
+ "FromText": "From",
+ "FromToText": "From {0} to {1}",
+ "GenericSkiHeroImageText": "This is a generic image and does not represent the actual ski resort.",
+ "GettingStartedClusterTitle": "Getting Started",
+ "GraphDays": "{0} days",
+ "GraphHoursPerDay": "{0} hrs/day",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "Hail": "Hail",
+ "Haze": "Haze",
+ "Hazy Sunshine": "Hazy Sunshine",
+ "Heavy drizzle": "Heavy Drizzle",
+ "Heavy rain": "Heavy Rain",
+ "Heavy snow": "Heavy Snow",
+ "Heavy thunderstorms": "Heavy T-Storms",
+ "HeavyLegend": "Heavy",
+ "HeavyRainCredits": "Heavy Rain {0}",
+ "HectaresOpen": "Open Kilometres",
+ "HighestLegend": "Highest",
+ "HighLowText": "{0} / {1}",
+ "HighMapSubType": "High",
+ "HighTemperatureMap": "High Temperature Forecast",
+ "HistoricalStringForRAIN": "In the past {0} years, it rained {1} out of {2} times on this day",
+ "HistoricalStringForSNOW": "In the past {0} years, it snowed {1} out of {2} times on this day",
+ "HistoricalStringForTHUNDER": "In the past {0} years, it thundered {1} out of {2} times on this day",
+ "HistoricalWeather": "Historical Weather",
+ "HistoricLengthWithUnit": "{0} {1}",
+ "holiday weatherUrl": "http://www.holiday-weather.com",
+ "HolidayWeather.com": "HolidayWeather.com",
+ "Home": "Home",
+ "Hot and Humid": "Hot and Humid",
+ "HourlyForecast": "Hourly Forecast",
+ "hourlyForecastAriaText": "{0}, {1} {2}, feels like {3}, precipitation {4}",
+ "HourlyForecastFeelsLikeTitle": "Feels like",
+ "HourlyForecastForecastTitle": "Forecast",
+ "hourlyForecastHeaderAriaText": "Read today's hourly forecast",
+ "HourlyForecastPrecipChanceTitle": "Precip. Chance",
+ "HourlyForecastTimeTitle": "Time",
+ "HourlyForecastWindTitle": "Wind",
+ "Humidity": "Humidity",
+ "HWAttribution": "Historical Weather by",
+ "Ice ": {
+ " Snow": "Ice / Snow"
+ },
+ "Ice pellets": "Ice Pellets",
+ "ImageCredits": "Image Credits",
+ "iMap Weather": "WDT",
+ "imap weatherUrl": "http://bit.ly/wdtconsumer",
+ "inPerHour": "in/hr",
+ "IntermediateRuns": "Intermediate Runs",
+ "Introduction": "Introduction",
+ "inUnit": "inches",
+ "Isolated Thunderstorms": "Isolated Storms",
+ "Japan": "Japan",
+ "JWSAttribution": "Japan daily forecasts by",
+ "JWSAttributionValue": "© Weather Service, Ltd",
+ "KilometresPerHour": "{0} kmph",
+ "KilometresPerHourAriaText": "{0} kilometres per hour",
+ "kWeather": "KWeather",
+ "KWeatherAttribution": "Korea Weather data by",
+ "kWeatherUrl": "http://www.kweather.co.kr",
+ "LastUpdatedDataTime": "Last updated {0}",
+ "LeftText": "Light",
+ "LegendName": "Precipitation",
+ "lessDailyConditionsAriaText": "Read the forecast from a single source",
+ "lessDailyConditionsDataText": "Less",
+ "LiftOpen": "Lifts Open",
+ "Light drizzle": "Light Drizzle",
+ "Light fog": "Light Fog",
+ "Light freezing drizzle": "Freezing Drizzle",
+ "Light freezing rain": "Freezing Rain",
+ "Light hail": "Light Hail",
+ "Light rain": "Light Rain",
+ "Light rain and snow": "Rain / Snow",
+ "Light rain and snow shower": "Rain / Snow",
+ "Light rain shower": "Light Rain",
+ "Light Showers": "Light Showers",
+ "Light snow": "Light Snow",
+ "Light snow shower": "Light Snow",
+ "LightLegend": "Light",
+ "LightShowersCredits": "Light Showers {0}",
+ "loading": "Loading",
+ "LocationDetectionFailed": "Your location cannot be detected. Try entering your location manually.",
+ "LocationDisabledError": "Your location cannot be found. Change your Permissions to allow Weather to use your location.",
+ "LocationNameLongFormat": "{0}, {1}, {2}",
+ "LocationNameShortFormat": "{0}, {1}",
+ "LocationPinnedToStart": "Unpin this location from the Start screen before setting it as your default location.",
+ "LocationSearchFetchError": "There was a problem. Please try your search again.",
+ "LocDetectionUnknownError": "A problem occurred while detecting your location. Please try again later.",
+ "London": "London",
+ "LowestLegend": "Lowest",
+ "LowMapSubType": "Low",
+ "LowTemperatureMap": "Low Temperature Forecast",
+ "MapFlyoutAltText": "Map animation",
+ "MapFlyoutAriaText": "map animation. {0} {1} on {2}",
+ "MapImageAltText": "Map",
+ "Maps": "Maps",
+ "MapsUnavailable": "Maps are currently unavailable. Please try again.",
+ "MarineAlertType": "Marine",
+ "MaxFavoritesLimitReached": "Your Favourites list is full. Please remove a location before adding a new one.",
+ "MaximumRecordedRainfall": "Record rainfall",
+ "MaximumRecordedSnow": "Record snow level",
+ "MaxPinnedLocationsLimitReached": "You have pinned the maximum number of locations. Please unpin a location before pinning a new one.",
+ "MeterPerSecond": "{0} m/s",
+ "MeterPerSecondAriaText": "{0} metres per second",
+ "Metres": "m",
+ "MilesPerHour": "{0} mph",
+ "MilesPerHourAriaText": "{0} miles per hour",
+ "MiscAlertType": "Miscellaneous",
+ "MixLegend": "Mix",
+ "mmPerHour": "mm/hr",
+ "MonthlyAvgBaseDepth": "Average Base Depth",
+ "MonthlyAvgSnowfall": "Average Snowfall",
+ "MonthlyDayLight": "Daylight",
+ "MonthlyMaxTemp": "Average High",
+ "MonthlyMinTemp": "Average Low",
+ "MonthlyRainfall": "Rainfall",
+ "MonthlyRainyDays": "Rainy Days",
+ "MonthlyRdBaseDepth": "Record Max. Base depth",
+ "MonthlyRdSnowfall": "Record High Snowfall",
+ "MonthlyRecordedHighTemp": "Record High",
+ "MonthlyRecordedLowTemp": "Record Low",
+ "MonthlySeaTemp": "Sea Temp.",
+ "MonthlySnowDays": "Snow Days",
+ "MonthlySunshine": "Sunshine",
+ "More Alerts": "More",
+ "moreDailyConditionsAriaText": "Read forecasts from multiple sources",
+ "moreDailyConditionsDataText": "More",
+ "MoreText": "More",
+ "Morning Fog ": {
+ " Afternoon Sun": "AM Fog / PM Sun",
+ " Cloudy": "AM Fog / Cloudy"
+ },
+ "Morning Ice ": {
+ " Snow": "AM Ice / Snow"
+ },
+ "Morning Rain": "Morning Rain",
+ "Morning Snow": "Morning Snow",
+ "Mostly clear": "Mostly Clear",
+ "Mostly Cloudy": "Mostly Cloudy",
+ "Mostly Sunny": "Mostly Sunny",
+ "MostlyCloudyCredits": "Mostly Cloudy {0}",
+ "Multiple Alerts Heading": "Alerts",
+ "MyPlaces": "Places",
+ "MyPlacesText": "My Places",
+ "N": "No",
+ "NameHeader": "Name",
+ "National": "National",
+ "NearbySkiResorts": "Nearby Ski Resorts",
+ "NearbyText": "Nearby",
+ "News": "News",
+ "NewSnowHeader": "New Snow",
+ "nextDailyConditionsDataText": "Read the forecast for more days",
+ "NextStepsClusterTitle": "Next Steps",
+ "NightHeading": "Night",
+ "NoInternetConnectionError": "You are not connected to the Internet. Please check your Internet connection and try again.",
+ "NoInternetOnSettingChange": "Your settings have been updated. Connect to the Internet to confirm your changes.",
+ "NoResortsFoundErrorText": "No resorts were found. Please change your filters and try again.",
+ "NorthAmerica": "North America",
+ "NorthAmericaRegion": "North/Central America",
+ "NoSearchResults": "No results matched your search.",
+ "ObservationMapSubType": "Observation",
+ "Oceania": "Australia / Pacific",
+ "ofText": "{0} of {1}",
+ "OnTheSnow": "On The Snow",
+ "OnTheSnowUrl": "http://www.onthesnow.com",
+ "OpenLiftsHeader": "Lifts Open",
+ "OpenTrailsHeader": "Pistes Open",
+ "OthersAlertType": "Others",
+ "Overview": "OVERVIEW",
+ "PacificIslands": "Pacific Islands",
+ "PanoramaControlsHiddenOnAriaLabel": "Panorama controls hidden",
+ "PanoramaControlsVisibleOnAriaLabel": "Panorama controls visible",
+ "Partly Cloudy": "Partly Cloudy",
+ "PartlyCloudyCredits": "Partly Cloudy {0}",
+ "Patchy fog": "Patchy Fog",
+ "pause": "Pause",
+ "PersonalizeText": "It's easy to follow the weather in places that you choose.",
+ "PersonalizeTitle": "Add your favourite places",
+ "PinButtonTitle": "Pin",
+ "play": "Play",
+ "PM Thunderstorms": "PM Storms",
+ "Precipitation": "Precipitation",
+ "PrecipitationAccumulationMap": "Precipitation Accumulation",
+ "precipitationAltText": "Precipitation",
+ "PrecipitationForecastMap": "Precipitation Forecast",
+ "PrecipitationMap": "Precipitation",
+ "PrecipitationObservationMap": "Precipitation Observation",
+ "prevDailyConditionsDataText": "Go back and read the forecast for previous days",
+ "Publisher": "Microsoft Corporation",
+ "RadarForecastMap": "Radar Forecast",
+ "RadarMap": "Radar",
+ "RadarObservationMap": "Radar Observation",
+ "Rain": "Rain",
+ "Rain ": {
+ " Snow": "Rain / Snow",
+ " Windy": "Rain / Windy"
+ },
+ "Rain and snow": "Rain / Snow",
+ "Rain and snow shower": "Rain / Snow",
+ "Rain showers": "Rain Showers",
+ "Rain turning to Snow": "Rain to Snow",
+ "RainAlertType": "Rain",
+ "RainCredits": "Rain {0}",
+ "RainfallAriaText": "Average monthly rainfall",
+ "RainfallFilter": "Rainfall",
+ "RainfallMap": "Rainfall",
+ "RainForecastMap": "Rain forecast",
+ "RainLegend": "Rain",
+ "RainSnowCredits": "Rain and Snow {0}",
+ "RecentSearches": "Recent Searches",
+ "RecommendedForFamiliesString": "Recommended for Families: {0}",
+ "RecordSnowfallYear": "{0} ({1})",
+ "RecordTemperatureYear": "{0}° ({1})",
+ "RefreshButtonTitle": "Refresh",
+ "Regional": "Regional",
+ "RelatedResorts": "Related Ski Resorts",
+ "RemoveButtonTitle": "Remove",
+ "ResortStatusClosed": "Closed",
+ "ResortStatusOpen": "Open",
+ "ResortStatusTemporarilyClosed": "Temporarily Closed",
+ "ResortStatusWeekendsOnly": "Weekends Only",
+ "RetryButtonLabel": "Try again",
+ "Reviews": "Reviews",
+ "RightText": "Heavy",
+ "SampleDataHeader": "{0} (Sample Data)",
+ "Satellite": "Satellite",
+ "SatelliteMap": "Satellite",
+ "Scattered Flurries": "Scattered Flurries",
+ "Scattered Thunderstorms": "Scattered Storms",
+ "ScatteredCloudsCredits": "Scattered Clouds {0}",
+ "ScatteredFlurriesCredits": "Scattered Flurries {0}",
+ "searchboxInvalidEntry": "Invalid location",
+ "searchboxPlaceHolderTest": "Search for a city",
+ "searchBoxText": "Search for a Town or Postcode",
+ "SearchButtonTitle": "Search",
+ "SearchHistory": "Search History",
+ "SearchPageHeaderSubTitle": "Search Results",
+ "SearchPageHeaderTitle": "”{0}”",
+ "SearchResultsAriaLabel": "Search Results",
+ "SearchResultsHeader": "{0} search results",
+ "SearchTypeText": "Search Type",
+ "SeeMoreTruncatedText": "See more...",
+ "Seoul": "Seoul",
+ "SetDefaultButtonTitle": "Set as Home",
+ "SetDefaultMaxLimitReached": "Your Favourites list is full. Please remove a location before setting a new one as your default location.",
+ "SetHomeLocationTitle": "Set Home Location",
+ "Settings": "Settings",
+ "Severe duststorm": "Severe Dust Storm",
+ "ShareDataDesc": "Get the complete forecast for places you care about with the Weather app, available in the Windows Store.",
+ "ShareDataNotAvailableError": "Weather data is not available for this location. Please try again later.",
+ "ShareDataUrl": "http://apps.microsoft.com/webpdp/app/421ba874-f903-4965-9b82-d60f3ba3cae0",
+ "ShareInvalidSharePageMessage": "Select a city and try again.",
+ "ShareLocationNotAvailableMessage": "This location is currently not available to share.",
+ "SharePageTitle": "{0} - MSN Weather",
+ "ShareSnippet": "Detailed weather conditions and forecast for {0}.",
+ "ShareWeatherUpdates": "Weather updates",
+ "ShortDateTimeFormatString": "{0} {1}",
+ "Showers": "Showers",
+ "Showers ": {
+ " Clear": "Showers / Clear"
+ },
+ "Single Alert Heading": "Alert",
+ "skiCurrentConditionsAriaText": "new snow {0}, base depth {1}, source {2}",
+ "SkiDataAttribution": "Ski resort and snow data provided by {0}",
+ "SkiDetailsImageAttribution": "Image provided by {0}",
+ "SkiResorts": "Ski Resorts",
+ "SkiResortsECVShareError": "There is nothing to share right now. Select a resort and try again.",
+ "SkiResortWebsiteString": "Resort Website",
+ "SkiReviewDateFormat": "{0} {1}, {2}",
+ "SkiReviewFamilyFriendly": "Family Friendly",
+ "SkiReviewFiveStarsText": "5 Stars",
+ "SkiReviewFourStarsText": "4 Stars",
+ "SkiReviewOverAllRating": "{0} / 5",
+ "SkiReviewOverAllText": "Overall",
+ "SkiReviewRatings": "Ratings ({0})",
+ "SkiReviewThreeStarsText": "3 Stars",
+ "SkiReviewTwoStarsText": "2 & under",
+ "Sleet": "Sleet",
+ "Smoke": "Smoke",
+ "SnapTime": "{0} Local Time",
+ "Snow": "Snow",
+ "Snow ": {
+ " Windy": "Snow / Windy"
+ },
+ "Snow Showers": "Snow Showers",
+ "Snow Showers ": {
+ " Sun": "Snow / Sun"
+ },
+ "Snow turning to Rain": "Snow to Rain",
+ "SnowAccumulationMap": "Snow Accumulation",
+ "SnowAlertType": "Snow",
+ "SnowAriaText": "Average monthly snow",
+ "SnowCredits": "Snow {0}",
+ "SnowDataAttribution": "Snow data provided by {0}",
+ "SnowDaysFilter": "Snow days",
+ "SnowDepth": "Snow Depth",
+ "SnowDepthHeader": "Base Depth",
+ "SnowForecastMap": "Snow Forecast",
+ "SnowForecastMap.comment": "Snow Forecast map title",
+ "SnowLegend": "Snow",
+ "SnowMap": "Snow",
+ "SnowObservationMap": "Snow Observation",
+ "South Korea": "South Korea",
+ "SouthAmerica": "South America",
+ "SpeedUnitsInBFTWithDirection": "{0} {1} bft",
+ "SpeedUnitsInBFTWithDirectionAriaText": "{0} {1} Beaufort",
+ "SpeedUnitsInKMPHWithDirection": "{0} {1} kmph",
+ "SpeedUnitsInKMPHWithDirectionAriaText": "{0} {1} kilometres per hour",
+ "SpeedUnitsInMPHWithDirection": "{0} {1} mph",
+ "SpeedUnitsInMPHWithDirectionAriaText": "{0} {1} miles per hour",
+ "SpeedUnitsInMPSWithDirection": "{0} {1} m/s",
+ "SpeedUnitsInMPSWithDirectionAriaText": "{0} {1} metres per second",
+ "Squalls": "Squalls",
+ "StatementAlertSubType": "Statement",
+ "Status": "Resort Status",
+ "StatusHeader": "Status",
+ "StormAlertType": "Storm",
+ "Summit": "Summit",
+ "Sunny ": {
+ " Windy": "Sunny / Windy"
+ },
+ "Sunny (Clear)": "Sunny (Clear)",
+ "Sunrise": "Sunrise",
+ "Sunset": "Sunset",
+ "SunshineAndSeaTempAttribution": "Sunshine & Sea temp. by",
+ "SunshineAndSeaTempAttributionAriaText": "Sunshine & Sea temperature by {0}",
+ "SunshineAriaText": "Average monthly sunshine",
+ "SunshineAttribution": "Sunshine by",
+ "SunshineAttributionAriaText": "Sunshine by {0}",
+ "SunshineFilter": "Sunshine",
+ "SunshineSeaTempAttribution": "Sunshine & Sea temperature data by",
+ "Taipei": "Taipei",
+ "Taiwan": "Taiwan",
+ "TakeATourText": "Get more out of MSN Weather with great maps and in-depth data.",
+ "TakeATourTitle": "Take a tour",
+ "TempClosed": "Temp. Closed",
+ "Temperature": "Temperature",
+ "TemperatureAriaText": "Average monthly temperature",
+ "TemperatureFilter": "Temperature",
+ "TemperatureForecastMap": "Temperature Forecast",
+ "TemperatureMap": "Temperature",
+ "TemperatureWithDegreeCelsius": "{0}°C",
+ "TemperatureWithDegreeFahrenheit": "{0}°F",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "Thunderstorms": "Thunderstorms",
+ "ThunderstormsCredits": "Thunderstorms {0}",
+ "TianQiAttribution": "Daily forecasts by",
+ "Today": "Today",
+ "TodayMapSubType": "Today",
+ "Tokyo": "Tokyo",
+ "ToolTipTextC": "Click to change to Celsius",
+ "ToolTipTextF": "Click to change to Fahrenheit",
+ "ToText": "to",
+ "TrailmapAttribution": "Trail map provided by {0}",
+ "Trailmapimage": "Trail map image",
+ "TrailsOpen": "Pistes Open",
+ "Travel": "Travel",
+ "Tubing": "Tubing",
+ "United Kingdom": "United Kingdom",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInDay": "{0} day",
+ "UnitInDays": "{0} days",
+ "UnitInHectorPascal": "{0} hp",
+ "UnitInHectorPascalAriaText": "{0} hectopascals",
+ "UnitInHourPerDay": "{0} hr/day",
+ "UnitInHoursPerDay": "{0} hrs/day",
+ "UnitInInches": "{0} in",
+ "UnitInKilometres": "{0} km",
+ "UnitInMiles": "{0} m",
+ "UnitInMillibars": "{0} mb",
+ "UnitInMillibarsAriaText": "{0} millibars",
+ "UnitInMillimeters": "{0} mm",
+ "UnitInMillimetersHg": "{0} mm Hg",
+ "UnitInMillimetersHgAriaText": "{0} millimetres Hg",
+ "UnitInPercentage": "{0}%",
+ "UnknownCredits": "Unknown {0}",
+ "UnpinButtonTitle": "Unpin",
+ "UntilText": "until",
+ "UvExtreme": "{0} (Extreme)",
+ "UvHigh": "{0} (High)",
+ "UvIndex": "UV Index",
+ "UvLow": "{0} (Low)",
+ "UvModerate": "{0} (Moderate)",
+ "UvVeryHigh": "{0} (Very High)",
+ "VerticalDrop": "Vertical Drop",
+ "Visibility": "Visibility",
+ "WarningAlertSubType": "Warning",
+ "WatchAlertSubType": "Watch",
+ "weather undergroundUrl": "http://www.wunderground.com",
+ "Weather.com": "weather.com",
+ "weather.comUrl": "http://www.weather.com",
+ "Weather2Travel": "Weather2Travel",
+ "weather2travelUrl": "http://www.weather2travel.com",
+ "WeatherAlertsMap": "Weather alerts",
+ "WeatherDataNotAvailable": "Weather data is not available for this location. Please try again later or enter a different location.",
+ "WeatherDotComForecastAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-tenday",
+ "WeatherDotComMapsAttribution": "View interactive maps at {0}",
+ "WeatherDotComMapsAttributionUrlPrefix": "http://bing.weather.com/weather/map/interactive/",
+ "WeatherDotComMapsAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-Imap",
+ "WeatherDotComSeeMoreText": "See more from weather.com",
+ "WeatherMaps": "Weather Maps",
+ "WebsiteHeader": "Website",
+ "Wind": "Wind",
+ "WindAlertType": "Wind",
+ "WindHeader": "Wind",
+ "WindSpeedUnitForE": "E",
+ "WindSpeedUnitForENE": "ENE",
+ "WindSpeedUnitForESE": "ESE",
+ "WindSpeedUnitForN": "N",
+ "WindSpeedUnitForNE": "NE",
+ "WindSpeedUnitForNNE": "NNE",
+ "WindSpeedUnitForNNW": "NNW",
+ "WindSpeedUnitForNW": "NW",
+ "WindSpeedUnitForS": "S",
+ "WindSpeedUnitForSE": "SE",
+ "WindSpeedUnitForSSE": "SSE",
+ "WindSpeedUnitForSSW": "SSW",
+ "WindSpeedUnitForSW": "SW",
+ "WindSpeedunitForW": "W",
+ "WindSpeedUnitForWNW": "WNW",
+ "WindSpeedUnitForWSW": "WSW",
+ "Windy": "Windy",
+ "WindyCredits": "Windy {0}",
+ "WithinText": "Within",
+ "Wolfram Alpha": "Wolfram Alpha",
+ "wolfram alphaUrl": "http://www.wolframalpha.com",
+ "Wolfram|Alpha": "Wolfram Alpha",
+ "wolfram|alphaUrl": "http://www.wolframalpha.com",
+ "WorldHeading": "World",
+ "WorldMapAltText": "World map",
+ "WorldWeather": "World Weather",
+ "WorldWeatherContinent": "World weather {0}",
+ "WorldWeatherTitle": "World Weather",
+ "WWHighLowSeperator": "/",
+ "Y": "Yes"
+ },
+ "worldweather": {
+ "Addis Ababa": "Addis Ababa",
+ "Adelaide": "Adelaide",
+ "Alexandria": "Alexandria",
+ "ALGERIA": "Algeria",
+ "Algiers": "Algiers",
+ "Amsterdam": "Amsterdam",
+ "Arawa": "Arawa",
+ "ARGENTINA": "Argentina",
+ "Asunción": "Asunción",
+ "Athens": "Athens",
+ "Auckland": "Auckland",
+ "AUSTRALIA": "Australia",
+ "AUSTRIA": "Austria",
+ "Baghdad": "Baghdad",
+ "Bangkok": "Bangkok",
+ "Barcelona": "Barcelona",
+ "Beijing": "Beijing",
+ "Berlin": "Berlin",
+ "Bogota": "Bogota",
+ "BOLIVIA": "Bolivia",
+ "Brasília": "Brasília",
+ "BRAZIL": "Brazil",
+ "Brisbane": "Brisbane",
+ "Buenos Aires": "Buenos Aires",
+ "Cairo": "Cairo",
+ "CANADA": "Canada",
+ "Cancún": "Cancún",
+ "Cape Town": "Cape Town",
+ "Caracas": "Caracas",
+ "Casablanca": "Casablanca",
+ "Chicago": "Chicago",
+ "CHILE": "Chile",
+ "CHINA": "China",
+ "COLOMBIA": "Colombia",
+ "Colombo": "Colombo",
+ "Darwin": "Darwin",
+ "Dubai": "Dubai",
+ "Dublin": "Dublin",
+ "Durban": "Durban",
+ "ECUADOR": "Ecuador",
+ "EGYPT": "Egypt",
+ "ETHIOPIA": "Ethiopia",
+ "FIJI": "Fiji",
+ "FINLAND": "Finland",
+ "FRANCE": "France",
+ "Georgetown": "Georgetown",
+ "GERMANY": "Germany",
+ "GREECE": "Greece",
+ "GUYANA": "Guyana",
+ "Helsinki": "Helsinki",
+ "Hobart": "Hobart",
+ "Ibadan": "Ibadan",
+ "INDIA": "India",
+ "IRAQ": "Iraq",
+ "IRELAND": "Ireland",
+ "Istanbul": "Istanbul",
+ "ITALY": "Italy",
+ "JAPAN": "Japan",
+ "Juneau": "Juneau",
+ "Kampala": "Kampala",
+ "KENYA": "Kenya",
+ "KOREA": "Korea",
+ "Kyiv": "Kyiv",
+ "La Paz": "La Paz",
+ "Lagos": "Lagos",
+ "Lima": "Lima",
+ "London": "London",
+ "Los Angeles": "Los Angeles",
+ "Melbourne": "Melbourne",
+ "MEXICO": "Mexico",
+ "Mexico City": "Mexico City",
+ "Miami": "Miami",
+ "MOROCCO": "Morocco",
+ "Moscow": "Moscow",
+ "Mumbai": "Mumbai",
+ "Nairobi": "Nairobi",
+ "NETHERLANDS": "Netherlands",
+ "New Delhi": "New Delhi",
+ "New York City": "New York",
+ "NEW ZEALAND": "New Zealand",
+ "NIGERIA": "Nigeria",
+ "PAPUA NEW GUINEA": "Papua New Guinea",
+ "PARAGUAY": "Paraguay",
+ "Paris": "Paris",
+ "Perth": "Perth",
+ "PERU": "Peru",
+ "Port Moresby": "Port Moresby",
+ "Quito": "Quito",
+ "Rio de Janeiro": "Rio de Janeiro",
+ "Rio Gallegos": "Rio Gallegos",
+ "Riyadh": "Riyadh",
+ "Rome": "Rome",
+ "RUSSIA": "Russia",
+ "San Francisco": "San Francisco",
+ "Santiago": "Santiago",
+ "SAUDI ARABIA": "Saudi Arabia",
+ "Seattle": "Seattle",
+ "Seoul": "Seoul",
+ "Shanghai": "Shanghai",
+ "Singapore": "Singapore",
+ "SINGAPORE_CAPS": "Singapore",
+ "SOUTH AFRICA": "South Africa",
+ "SPAIN": "Spain",
+ "SRI LANKA": "Sri Lanka",
+ "Suva": "Suva",
+ "Sydney": "Sydney",
+ "THAILAND": "Thailand",
+ "Tokyo": "Tokyo",
+ "Toronto": "Toronto",
+ "TURKEY": "Turkey",
+ "UGANDA": "Uganda",
+ "UKRAINE": "Ukraine",
+ "UNITED ARAB EMIRATES": "United Arab Emirates",
+ "UNITED KINGDOM": "United Kingdom",
+ "UNITED STATES": "United States",
+ "Vancouver": "Vancouver",
+ "VENEZUELA": "Venezuela",
+ "Victoria Falls": "Victoria Falls",
+ "Vienna": "Vienna",
+ "Washington D.C.": "Washington, D.C.",
+ "Wellington": "Wellington",
+ "ZIMBABWE": "Zimbabwe"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/en-us.json b/packages/microsoft.bingweather/resources/en-us.json
new file mode 100644
index 00000000..61ca5bbf
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/en-us.json
@@ -0,0 +1,1517 @@
+{
+ "AppEx.WeatherApp.Services": {
+ "Resources": {
+ "Country": "Country/Region",
+ "KilometresPerHour": "{0} kmph",
+ "MilesPerHour": "{0} mph",
+ "Region": "State/Province",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInInches": "{0} in"
+ }
+ },
+ "Files": {
+ "MicrosoftAdvertising": {
+ "IntelliSense": {
+ "AdErrorEventArgs.xml": "MicrosoftAdvertising\\IntelliSense\\en-US\\AdErrorEventArgs.xml",
+ "ErrorCode.xml": "MicrosoftAdvertising\\IntelliSense\\en-US\\ErrorCode.xml"
+ }
+ }
+ },
+ "MicrosoftAdvertising": {
+ "ExceptionMessages": {
+ "AdGameComponentAlreadyInitialized": "AdGameComponent has already been initialized.",
+ "AdGameComponentHasNotBeenInitialized": "AdGameComponent has not been initialized.",
+ "AdManagerNotInitialized": "AdManager has not been initialized.",
+ "AdMangerAlreadyInitialized": "AdManager has already been initialized with a different ApplicationId.",
+ "AdUnitIdAlreadySet": "AdUnitId has already been set.",
+ "AdUnitIdIsRequired": "adUnitId is required.",
+ "AllActionsMalformed": "All found actions were malformed.",
+ "ApplicationIdIsRequired": "applicationId is required.",
+ "AssetNodeIsSingleEntry": "Asset node is a single entry.",
+ "AutoRefreshStateAlreadySet": "Refresh state has already been set.",
+ "BannerInformationNotFound": "Banner information is not found.",
+ "CannotRefreshWhenAdControlUninitialized": "Refresh may not be called when AdControl is uninitialised.",
+ "CannotRefreshWhenAdIsEngaged": "Refresh may not be called when AdControl is engaged.",
+ "CannotRefreshWhenNotVisible": "Refresh may not be called when AdControl is not visible to the user.",
+ "CannotRefreshWhenSuspended": "Refresh may not be called when AdControl is suspended.",
+ "CapabilitiesMissing": "Required capabilities are missing from manifest ({0}): {1}.",
+ "ClickToRichUrlWithoutReferralNotWellFormed": "Click to rich media url without referral is not well formed: {0}.",
+ "ClickToRichUrlWithReferralNotWellFormed": "Click to rich media url with referral is not well formed: {0}.",
+ "CouldNotFindProperty": "Could not find property: {0}.",
+ "DecodingEscapedCharactersFailed": "Decoding escaped characters failed, more output characters than expected.",
+ "DidNotParseToEnd": "Did not parse until the end.",
+ "ExtractedPropertyNotAString": "Extracted property not of string type: {0}.",
+ "FontDoesNotSupportCharacter": "Font does not support character: {0}.",
+ "GeoDataNotAvailable": "No latitude and longitude data available.",
+ "IncompleteInit": "ApplicationId and AdUnitId need to be set before using this control.",
+ "InternalError": "Internal error encountered.",
+ "InvalidAction": "Invalid action param: {0}.",
+ "InvalidDataFormat": "Invalid data format: {0}.",
+ "InvalidJsonResponse": "Invalid JSON response: {0}.",
+ "InvalidLocation": "The Location value is out of range.",
+ "InvalidParameterMissingItemSeparator": "Invalid Parameter, missing item separator.",
+ "InvalidRefresh": "Refresh cannot be used when auto refresh is enabled.",
+ "InvalidSize": "The rectangle dimensions do not meet the minimum size requirements ({0}x{1}).",
+ "JsonDoesntStartWithObjectOrArray": "Server JSON response does not start with object/array.",
+ "JsonIntegerParseOverflow": "Number being parsed is too big: {0}.",
+ "JsonNodeIsNotADictionary": "Json node is not a dictionary.",
+ "JsonResponseTypeInvalid": "Invalid JSON response type.",
+ "JsonStringValueNotWellFormed": "Json string value not well formed.",
+ "LoadContentNotCalled": "LoadContent has not been called before Update/Draw.",
+ "NonPremiumWithNoApplicationId": "Non-premium ads require the manager to be created with a non-null, non-empty applicationID.",
+ "ObjectShouldHaveNoElements": "Object should have no elements yet, but it does.",
+ "ParameterIsLessThanPermittedLength": "Parameter is less than permitted length: {0} < {1}.",
+ "ParameterNullOrEmpty": "Parameter is null or empty.",
+ "ParseStackNotEmpty": "Parsing stack not empty, some nodes not parsed completely.",
+ "ParseStringNotANumber": "Not a valid number to be parsed.",
+ "RectangleHeightNotSufficient": "Rectangle height not sufficient for a single line of text. Height should be at least: {0}.",
+ "RefreshCalledToSoon": "Refresh may not be called more than once every {0} seconds.",
+ "RefreshWhileEngaged": "Manual refresh not permitted while ad is engaged.",
+ "RefreshWhileRequestInProgress": "Refresh was triggered but another request is already in progress.",
+ "RequestDataHasNullDataItem": "httpRequestData or its URL is null.",
+ "RichMediaInfoNotFound": "Rich media information not found.",
+ "StringContainsInvalidEscapeSequence": "String contains invalid escape sequences.",
+ "TextAdTitleNotFound": "Mandatory title for text ad not found.",
+ "TooManyImpressionUrls": "Number of impression entries exceeds the limit: {0}.",
+ "UnableToFitText": "Unable to fit text in the given space.",
+ "UnicodeCharacterTruncated": "Unicode character is truncated.",
+ "UnknownAdType": "Unknown ad type: {0}.",
+ "UnknownJsonToken": "Unknown token encountered: {0}.",
+ "UnknownRichMediaMimeType": "Unknown rich media mime type recieved: {0}."
+ },
+ "UIStrings": {
+ "AdSettings_CommandText": "Microsoft Advertising",
+ "AdSettings_Flyout_OptedOut_Message1": "You are currently opted out of personalized advertising from Microsoft. Click",
+ "AdSettings_Flyout_OptedOut_Message2": "to learn more about your choices.",
+ "AdSettings_Flyout_OptedOut_Message_Here": "here",
+ "AdSettings_Flyout_OptInSwitch_Header": "Let Microsoft Advertising use my information to personalize ads in this app.",
+ "AdSettings_Flyout_OptInSwitch_Off": "No",
+ "AdSettings_Flyout_OptInSwitch_On": "Yes",
+ "AdSettings_Flyout_Privacy": "Privacy Statement",
+ "AdSettings_Flyout_SectionName": "Advertising settings",
+ "AdSettings_Flyout_SignInPrompt1": "You are currently signed out.",
+ "AdSettings_Flyout_SignInPrompt2": "to enable personalized advertising in this app.",
+ "AdSettings_Flyout_SignInPrompt_SignIn": "Sign-in",
+ "AdSettings_Flyout_SignInPrompt_SignOut": "Sign-out",
+ "AdSettings_Flyout_StatusUnknown_Message": "Your Microsoft account information is currently unavailable.",
+ "AdSettings_Flyout_Title": "Advertising"
+ }
+ },
+ "Platform": {
+ "aboutLabel": "About",
+ "accept": "Accept",
+ "Add": "Add",
+ "addMoreFilters": "Add/Remove More Filters",
+ "advertisement": "Advertisement",
+ "AppIsPersonalized": "{0} is personalized. ",
+ "appRestart": "(Requires App restart)",
+ "AppTitle": "the app",
+ "appVersion": "Version {0}",
+ "ArticleHeaderSubscriptionMessage": "Subscribe",
+ "ArticleLinkLabelText": "View article",
+ "ArticleSubscriptionMessage": "Subscribe for unlimited access",
+ "ArticleTextSizeLarge": "Large",
+ "ArticleTextSizeMedium": "Medium",
+ "ArticleTextSizeMenuLabel": "Text size",
+ "ArticleTextSizeSmall": "Small",
+ "ArticleTextSizeXLarge": "X-Large",
+ "ArticleTextStyleMenuLabel": "Text style",
+ "ArticleUnavailableOffline": "This article is not available offline.",
+ "AverageMarketCharacterSizePx": "8",
+ "brand": "MSN",
+ "Calendar": "Calendar",
+ "cancel": "Cancel",
+ "catastrophicError": "There is a problem with the application. Please restart.",
+ "changeMarketTo": "{0} ({1})",
+ "changeSettings": "Change Settings",
+ "changesFromAppSettings": "You can make these changes at any time using app settings",
+ "clearFiltersLabel": "Reset Filters",
+ "ClickToOpenL2": "Select to show subChannel",
+ "close": "Close",
+ "closeAppButton": "Close app",
+ "ConnectMicrosoftAccount": "Connect Microsoft account",
+ "ConnectMyMicrosoftAccount": "Connect my Microsoft account",
+ "ConnectToMicrosoft": "Connect to Microsoft",
+ "createAccountButton": "Create an account >",
+ "credentialMessage": "Enter a user name and password to access {0}.",
+ "credentialsInvalid": "Invalid credentials. Please try again.",
+ "creditsLink": "Credits",
+ "DaysAgo": "{0} days ago",
+ "decline": "Decline",
+ "Delete": "Delete",
+ "demoModeTitle": "This feature is not available in demo mode.",
+ "demoMode_label": "DEMO MODE",
+ "demoMode_lastUpdated": "Tour the app in demo mode.",
+ "Dismiss": "Dismiss",
+ "entitlementsInvalid": "Sorry, your subscription does not include this device.",
+ "featured": "Featured",
+ "feedbackButtonLabel": "Feedback",
+ "feedbackCommentQuestion": "What could we do to improve the app?",
+ "feedbackDislikeIcon": "😩",
+ "feedbackDislikeLabel": "Dislike",
+ "feedbackLikeIcon": "😊",
+ "feedbackLikeLabel": "Like",
+ "feedbackOfflineMessage": "It looks like you are currently offline. Please connect to the Internet and try again.",
+ "feedbackPrivacyStatementLabel": "Privacy statement",
+ "feedbackQ1option1": "Very good",
+ "feedbackQ1option2": "Good",
+ "feedbackQ1option3": "Average",
+ "feedbackQ1option4": "Poor",
+ "feedbackQ1option5": "Very Poor",
+ "feedbackQ2option1": "Definitely would recommend",
+ "feedbackQ2option2": "Probably would recommend",
+ "feedbackQ2option3": "Might or might not recommend",
+ "feedbackQ2option4": "Probably would not recommend",
+ "feedbackQ2option5": "Definitely would not recommend",
+ "feedbackQuestion1": "How would you rate this app?",
+ "feedbackQuestion2": "How likely would you be to recommend this app to a friend?",
+ "feedbackSubmitButtonLabel": "Submit",
+ "feedbackThankYou": "Thank you for your feedback!",
+ "filmstrip": "Filmstrip",
+ "FilterAll": "Show All",
+ "FilterBy": "Filter By:",
+ "filterMenu": "Filter Menu",
+ "forceUpdate": "This version of {0} is no longer supported. Please update to the latest version.",
+ "forgotPasswordButton": "Forgot password >",
+ "freeformTextWarning": "Thanks for taking the time to add your feedback. Please take care not to provide any personal information.",
+ "GoBack": "Go back",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "HelpLabel": "Help",
+ "HoursAgo": "{0} hours ago",
+ "imageAttribution": "Image attribution",
+ "ImageCount": "Photo {0} of {1}",
+ "impressum": "Impressum",
+ "invalidEntry": "No results found. Please try again.",
+ "InvalidSubscriptionMessage": "The article you are trying to read is locked. Please get a valid subscription.",
+ "L2Opened": "SubChannels Shown",
+ "LabelChangeTheseSettings": "Change these settings",
+ "LabelClickToChange": "Click here to change settings",
+ "LabelModifySettings": "Modify settings",
+ "LabelOff": "Off",
+ "LabelOn": "On",
+ "LabelPrivacyStatement": "Privacy Statement",
+ "LabelTapToChange": "Tap here to change settings",
+ "languageSetting": "Choose edition",
+ "lca_privacy": "Privacy Statement",
+ "lca_serviceAgreement": "Terms of Use",
+ "Loading": "Loading",
+ "LocationCannotBeFound": "Your location cannot be found. Change your permissions to allow News to use your location.",
+ "Login": "Sign In",
+ "loginPrompt": "Enter your {0} account",
+ "loginPromptContentLocked": "The article you are trying to read is locked. Please login.",
+ "Logout": "Sign Out",
+ "marketChangePrompt": "Please close and re-open the app for your content preference changes to take effect.",
+ "marketError": "This app is not available in your market.",
+ "marketSelDialogMsg": "You are viewing content from {0} ({1}). You can change this option anytime from the settings charm.",
+ "marketSelDialogMsgOpt": "You are viewing content from {0} ({1}). You can change this setting in the app anytime.",
+ "marketSelDialogTitle": "Which content and language would you like to see?",
+ "marketSelDialogTitleOpt": "Where would you like to view content from?",
+ "mediaPlaybackButtonsAriaLabel": "Playback buttons",
+ "mediaPlaybackContentRegionAriaLabel": "Media playback",
+ "mediaPlaybackControlsAriaLabel": "Playback controls",
+ "mediaPlaybackControlsLayerAriaLabel": "Playback controls",
+ "mediaPlaybackEnterFullScreenAriaLabel": "Show Full Screen",
+ "mediaPlaybackLeaveFullScreenAriaLabel": "Exit Full Screen",
+ "mediaPlaybackMinimalAriaLabel": "Currently Playing",
+ "mediaPlaybackNextButtonAriaLabel": "Next",
+ "mediaPlaybackPauseButtonAriaLabel": "Pause",
+ "mediaPlaybackPlayButtonAriaLabel": "Play",
+ "mediaPlaybackPreviousButtonAriaLabel": "Previous",
+ "mediaPlaybackSeekBarAriaLabel": "Seek bar",
+ "mediaPlaybackSeekBarThumbAriaLabel": "Seek bar slider",
+ "mediaPlaybackShareAriaLabel": "Share",
+ "mediaPlaybackTimeIndicatorAriaLabel": "Playback time indicator",
+ "MessageAccessingMSAinfo": "Accessing your Microsoft account information. ",
+ "MessageAccountConnect1": "To enable personalization and syncing across devices, connect your Microsoft account in PC Settings.",
+ "MessageAccountConnect2": "To enable personalization and syncing across devices, {0}.",
+ "MessageAdSettingsLocation": "Select “Microsoft Advertising” in Settings to control the personalization of ads in this app. ",
+ "MessageAdSettingsOff": "You are not receiving personalized ads. Select “Microsoft Advertising” in Settings to get personalized ads.",
+ "MessageAdSettingsOn1": "Microsoft Advertising is using your information to personalize ads. Select “Microsoft Advertising” in Settings to turn this off. ",
+ "MessageAdSettingsOn2": "Microsoft Advertising is using your information to personalize ads. Select “Microsoft Advertising” in Settings to turn off personalized ads. ",
+ "MessageConfiguredMSAinfo": "Configured using your Microsoft account information. ",
+ "MessageConnect": "Connect",
+ "MessageConnectAccount": "Connect account",
+ "MessageConnectMicrosoftAccount": "connect your Microsoft account",
+ "MessageCustomizedMSAinfo": "Customized with your Microsoft account information. ",
+ "MessageMSAConnectionDescription": "This will synchronize information between this app and your Microsoft account to personalize this and other Microsoft experiences across your devices.",
+ "MessageMSASignIn": "To enable personalization and syncing across devices, sign in to your Microsoft account. ",
+ "MessageOptimizedMSAinfo": "Optimized with your Microsoft account information. ",
+ "MessagePersonalize": "Use information from this app and associated with my Microsoft account to personalize this and other Microsoft experiences.",
+ "MessagePersonalizedMSAinfo": "Personalized with your Microsoft account information. ",
+ "MessagePersonalizeSettings": "Personalize settings",
+ "MessagePrivacySettings": "Privacy settings",
+ "MessagePrivacyUpdateButton": "Learn more",
+ "MessagePrivacyUpdateCloseButton": "Dismiss",
+ "MessagePrivacyUpdated": "We have updated our Privacy Statement.",
+ "MessagePrivacyUpdateLink": "Learn more",
+ "MessagePrivacyUpdateNotif": "We are updating our Privacy Statement.",
+ "MessageRoam": "Sync this app’s settings across my devices. ",
+ "MessageTermsAndPrivacyUpdated": "We have updated our Terms of Use and Privacy Statement.",
+ "MessageTermsAndPrivacyUpdateNotif": "We are updating our Terms of Use and Privacy Statement.",
+ "MessageTermsUpdateButton": "Learn more",
+ "MessageTermsUpdateCloseButton": "Dismiss",
+ "MessageTermsUpdated": "We have updated our Terms of Use.",
+ "MessageTermsUpdateLink": "Learn more",
+ "MessageTermsUpdateNotif": "We are updating our Terms of Use.",
+ "MessageUsingMSAinfo": "Using your Microsoft account information. ",
+ "MicrosoftAccount": "Microsoft",
+ "MicrosoftAdvertisingPrivacyLinkText": "Microsoft Advertising Privacy Statement.",
+ "MicrosoftAdvertisingSettingsText": "To control ad personalization, see the ",
+ "MinsAgo": "{0} mins ago",
+ "More": "More",
+ "MoreArticles": "Upcoming",
+ "MoreFrom": "More from",
+ "MSAccountNameLabel": "Account name",
+ "MSAConnectionRemoveLink": "Remove",
+ "MSAConnectLabel": "Connect",
+ "NextArticle": "Next article",
+ "nextButton": "Next Item",
+ "noInternetButton": "Try Again",
+ "noInternetDescription": "Please check your Internet connection.",
+ "noInternetTitle": "You are not connected to the Internet.",
+ "noThanks": "No Thanks",
+ "offLabel": "Off",
+ "offline_label": "OFFLINE",
+ "offline_lastUpdated": "Last Updated {0}",
+ "offline_noContent": "This content is not available in offline mode.",
+ "offline_problem": "The application ran into a problem and couldn’t load the content.",
+ "okButton": "OK",
+ "OneDayAgo": "1 day ago",
+ "OneHourAgo": "1 hour ago",
+ "OneMinAgo": "1 min ago",
+ "open": "Open",
+ "OpenInBrowser": "View in browser",
+ "optionsTitle": "Options",
+ "other": "Other",
+ "otherButton": "Other Markets",
+ "overLimitMessage": "{0} may use a large amount of data for some features. Your metered connection is over the data limit and fees may apply",
+ "Page": "Page {0}",
+ "PageOf": "Page {0} of {1}",
+ "password": "Password",
+ "passwordInput": "Password",
+ "Pause": "Pause",
+ "PaywallCardByAuthor": "By {0}",
+ "PaywallCardDay": "day",
+ "PaywallCardGrowlMessage": "You have used +{0} of {1}+ free token(s) from {2} {3}.",
+ "PaywallCardHour": "hour",
+ "PaywallCardMonth": "month",
+ "PaywallCardQuotaReachedMessage": "You can continue to enjoy up to {0} free token(s) per {1} or subscribe for unlimited access.",
+ "PaywallcardReadArticle": "Read article",
+ "PaywallCardSignIn": "Sign In",
+ "PaywallCardSubscribe": "Subscribe",
+ "PaywallCardThisHour": "this hour",
+ "PaywallCardThisMonth": "this month",
+ "PaywallCardThisWeek": "this week",
+ "PaywallCardThisYear": "this year",
+ "PaywallCardToday": "today",
+ "PaywallCardUnlimitedAccess": "Subscribe for Unlimited Access",
+ "PaywallCardWeek": "week",
+ "PaywallCardYear": "year",
+ "PhotosynthControlsHiddenAriaLabel": "Panorama controls hidden",
+ "PhotosynthControlsVisibleAriaLabel": "Panorama controls visible",
+ "pinToStart": "Pin to Start",
+ "Play": "Play",
+ "poweredBy": "Powered by {0}",
+ "PreviousArticle": "Previous article",
+ "previousButton": "Previous Item",
+ "privacyPolicy": "Privacy Policy",
+ "progressAlertAriaLabel": "Alert",
+ "readingList": "Saved",
+ "refresh": "Refresh",
+ "RegionCurrentLocation": "Current Location",
+ "RegionSelectLabel": "Update regional sources for your city",
+ "RegionSelectNone": "(None)",
+ "RelatedArticles": "Related",
+ "Resources": {
+ "LanguageID": "1033",
+ "Language_af": "Afrikaans",
+ "Language_am": "Amharic",
+ "Language_ar": "Arabic",
+ "Language_arn-Latn": "Mapudungun",
+ "Language_as": "Assamese",
+ "Language_az": "Azeri (Latin)",
+ "Language_az-Cyrl": "Azerbaijani (Cyrillic)",
+ "Language_az-Latn": "Azerbaijani (Latin)",
+ "Language_ba-Cyrl": "Bashkir",
+ "Language_be": "Belarusian",
+ "Language_bg": "Bulgarian",
+ "Language_bn": "Bangla",
+ "Language_bn-bd": "Bangla (Bangladesh)",
+ "Language_bn-in": "Bangla (India)",
+ "Language_br-Latn": "Breton",
+ "Language_bs": "Bosnian (Latin)",
+ "Language_bs-Cyrl": "Bosnian (Cyrillic)",
+ "Language_bs-Latn": "Bosnian (Latin)",
+ "Language_ca": "Catalan",
+ "Language_ca-ES-valencia": "Valencian",
+ "Language_chr": "Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Corsican",
+ "Language_cs": "Czech",
+ "Language_cy": "Welsh",
+ "Language_da": "Danish",
+ "Language_de": "German",
+ "Language_dsb": "Lower Sorbian",
+ "Language_dv": "Divehi",
+ "Language_el": "Greek",
+ "Language_en": "English",
+ "Language_es": "Spanish",
+ "Language_et": "Estonian",
+ "Language_eu": "Basque",
+ "Language_fa": "Persian",
+ "Language_ff-Latn": "Fulah",
+ "Language_fi": "Finnish",
+ "Language_fil-Latn": "Filipino",
+ "Language_fo": "Faroese",
+ "Language_fr": "French",
+ "Language_fy": "Frisian",
+ "Language_ga": "Irish",
+ "Language_gd": "Scottish Gaelic",
+ "Language_gd-Latn": "Scottish Gaelic",
+ "Language_gl": "Galician",
+ "Language_gsw": "Alsatian",
+ "Language_gu": "Gujarati",
+ "Language_ha": "Hausa (Latin)",
+ "Language_ha-Latn": "Hausa (Latin)",
+ "Language_he": "Hebrew",
+ "Language_hi": "Hindi",
+ "Language_hr": "Croatian",
+ "Language_hsb": "Upper Sorbian",
+ "Language_hu": "Hungarian",
+ "Language_hy": "Armenian",
+ "Language_id": "Indonesian",
+ "Language_ig": "Igbo",
+ "Language_ig-Latn": "Igbo",
+ "Language_is": "Icelandic",
+ "Language_it": "Italian",
+ "Language_iu-Latn": "Inuktitut (Latin)",
+ "Language_ja": "Japanese",
+ "Language_ka": "Georgian",
+ "Language_kk": "Kazakh",
+ "Language_kl": "Greenlandic",
+ "Language_km": "Khmer",
+ "Language_kn": "Kannada",
+ "Language_ko": "Korean",
+ "Language_kok": "Konkani",
+ "Language_ku": "Kurdish",
+ "Language_ku-Arab": "Central Kurdish",
+ "Language_ky": "Kyrgyz",
+ "Language_ky-Cyrl": "Kyrgyz",
+ "Language_lb": "Luxembourgish",
+ "Language_lo": "Lao",
+ "Language_lt": "Lithuanian",
+ "Language_lv": "Latvian",
+ "Language_mi-Latn": "Maori",
+ "Language_mk": "Macedonian",
+ "Language_ml": "Malayalam",
+ "Language_mn": "Mongolian (Cyrillic)",
+ "Language_mn-Cyrl": "Mongolian (Cyrillic)",
+ "Language_mr": "Marathi",
+ "Language_ms": "Malay",
+ "Language_mt": "Maltese",
+ "Language_nb": "Norwegian (Bokmål)",
+ "Language_ne": "Nepali",
+ "Language_nl": "Dutch",
+ "Language_nn": "Norwegian (Nynorsk)",
+ "Language_nso": "Sesotho sa Leboa",
+ "Language_oc-Latn": "Occitan",
+ "Language_or": "Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arabic)",
+ "Language_pl": "Polish",
+ "Language_prs": "Dari",
+ "Language_prs-arab": "Dari",
+ "Language_ps": "Pashto",
+ "Language_pt": "Portuguese",
+ "Language_pt-br": "Portuguese (Brazil)",
+ "Language_pt-pt": "Portuguese (Portugal)",
+ "Language_quc-Latn": "K’iche’",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "Quechua",
+ "Language_ro": "Romanian",
+ "Language_ru": "Russian",
+ "Language_rw": "Kinyarwanda",
+ "Language_sa-Deva": "Sanskrit",
+ "Language_sah-Cyrl": "Sakha",
+ "Language_sd-Arab": "Sindhi (Arabic)",
+ "Language_se-Latn": "Northern Sami",
+ "Language_si": "Sinhala",
+ "Language_sk": "Slovak",
+ "Language_sl": "Slovenian",
+ "Language_sma-Latn": "Southern Sami",
+ "Language_smj-Latn": "Lule Sami",
+ "Language_smn-Latn": "Inari Sami",
+ "Language_sms-Latn": "Skolt Sami",
+ "Language_sq": "Albanian",
+ "Language_sr-Cyrl": "Serbian (Cyrillic)",
+ "Language_sr-cyrl-ba": "Serbian (Cyrillic, Bosnia and Herzegovina)",
+ "Language_sr-Latn": "Serbian (Latin)",
+ "Language_sv": "Swedish",
+ "Language_sw": "Kiswahili",
+ "Language_syr-Syrc": "Syriac",
+ "Language_ta": "Tamil",
+ "Language_te": "Telugu",
+ "Language_tg-Cyrl": "Tajik (Cyrillic)",
+ "Language_th": "Thai",
+ "Language_ti": "Tigrinya",
+ "Language_tk-Latn": "Turkmen (Latin)",
+ "Language_tn": "Setswana",
+ "Language_tr": "Turkish",
+ "Language_tt": "Tatar",
+ "Language_tt-Cyrl": "Tatar (Cyrillic)",
+ "Language_tzm-Latn": "Tamazight (Latin)",
+ "Language_ug": "Uyghur",
+ "Language_ug-Arab": "Uyghur",
+ "Language_uk": "Ukrainian",
+ "Language_ur": "Urdu",
+ "Language_uz-Cyrl": "Uzbek (Cyrillic)",
+ "Language_uz-Latn": "Uzbek (Latin)",
+ "Language_vi": "Vietnamese",
+ "Language_wo-Latn": "Wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "Yoruba",
+ "Language_yo-Latn": "Yoruba",
+ "Language_zh-Hans": "Chinese (Simplified)",
+ "Language_zh-Hant": "Chinese (Traditional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "United Arab Emirates",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua and Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "American Samoa",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaijan",
+ "Region_Display_BA": "Bosnia and Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgium",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brazil",
+ "Region_Display_BS": "The Bahamas",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos (Keeling) Islands",
+ "Region_Display_CD": "Congo (DRC)",
+ "Region_Display_CF": "Central African Republic",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Switzerland",
+ "Region_Display_CI": "Côte d’Ivoire",
+ "Region_Display_CK": "Cook Islands",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Cameroon",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia and Montenegro (Former)",
+ "Region_Display_CV": "Cape Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas Island",
+ "Region_Display_CY": "Cyprus",
+ "Region_Display_CZ": "Czech Republic",
+ "Region_Display_DE": "Germany",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Denmark",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "Dominican Republic",
+ "Region_Display_DZ": "Algeria",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egypt",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spain",
+ "Region_Display_ET": "Ethiopia",
+ "Region_Display_FI": "Finland",
+ "Region_Display_FK": "Falkland Islands (Islas Malvinas)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Faroe Islands",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "United Kingdom",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "French Guiana",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Greenland",
+ "Region_Display_GM": "The Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Equatorial Guinea",
+ "Region_Display_GR": "Greece",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong SAR",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatia",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Hungary",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Ireland",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Iraq",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Iceland",
+ "Region_Display_IT": "Italy",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordan",
+ "Region_Display_JP": "Japan",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kyrgyzstan",
+ "Region_Display_KH": "Cambodia",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoros",
+ "Region_Display_KN": "Saint Kitts and Nevis",
+ "Region_Display_KR": "Korea",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Cayman Islands",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Lebanon",
+ "Region_Display_LC": "Saint Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lithuania",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Latvia",
+ "Region_Display_LY": "Libya",
+ "Region_Display_MA": "Morocco",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "Saint Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall Islands",
+ "Region_Display_MK": "Macedonia, FYRO",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao SAR",
+ "Region_Display_MP": "Northern Mariana Islands",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexico",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "New Caledonia",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk Island",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Netherlands",
+ "Region_Display_NO": "Norway",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "New Zealand",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "French Polynesia",
+ "Region_Display_PG": "Papua New Guinea",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Poland",
+ "Region_Display_PM": "Saint Pierre and Miquelon",
+ "Region_Display_PN": "Pitcairn Islands",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Reunion",
+ "Region_Display_RO": "Romania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Russia",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Saudi Arabia",
+ "Region_Display_SB": "Solomon Islands",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Sweden",
+ "Region_Display_SG": "Singapore",
+ "Region_Display_SH": "Saint Helena, Ascension and Tristan da Cunha",
+ "Region_Display_SI": "Slovenia",
+ "Region_Display_SK": "Slovakia",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "South Sudan",
+ "Region_Display_ST": "São Tomé and Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Syria",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks and Caicos Islands",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tajikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunisia",
+ "Region_Display_TR": "Turkey",
+ "Region_Display_TT": "Trinidad and Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "United States",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistan",
+ "Region_Display_VA": "Holy See (Vatican City)",
+ "Region_Display_VC": "Saint Vincent and the Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "British Virgin Islands",
+ "Region_Display_VI": "U.S. Virgin Islands",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis and Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Sint Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "South Africa",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabwe"
+ },
+ "restart": "Restart",
+ "retry": "Try Again",
+ "roamingMessage": "{0} may use a large amount of data for some features. You are currently roaming and data fees may apply.",
+ "row": "Row",
+ "scrollLeftAriaLabel": "Scroll Left",
+ "scrollRightAriaLabel": "Scroll Right",
+ "semanticZoomContainer": "Semantic Zoom Container",
+ "sendFeedbackButtonLabel": "Send Feedback",
+ "ShareArticleHeader": "Share",
+ "ShareArticleText": "Share this article",
+ "Slide": "Image",
+ "Slideshow": "Slideshow",
+ "SnappedMessage": "Snap mode is coming soon.",
+ "SortBy": "SORT BY",
+ "sortLabel": "Sort",
+ "sortText": "Sort",
+ "sponsoredBy": "Sponsored by",
+ "standardErrorButton": "Try Again",
+ "standardErrorDescription": "There was a problem. Please try again.",
+ "standardErrorTitle": "This page failed to load.",
+ "submit": "Submit",
+ "subscribeButton": "Subscribe",
+ "subscribeInstructions": "Enter username and password",
+ "subscribeNow": "Subscribe Now and Get:",
+ "subscribePanoButton": "Subscribe for Unlimited Access",
+ "subscribePrompt": "Subscriber Only Content",
+ "swipeDownToolTip": "Swipe down to select",
+ "swipeLeftToolTip": "Swipe left to select",
+ "swipeRightToolTip": "Swipe right to select",
+ "TermsOfUse": "Terms of Use",
+ "TextStylePrimary": "Primary",
+ "TextStyleSecondary": "Secondary",
+ "timeIndicatorTextFormat": "{0} / {1}",
+ "TitleAccountSettings": "Account",
+ "TitleAccountsSettings": "Account",
+ "TitleAdSettings": "Advertising settings",
+ "TitleConfiguration": "Configuration",
+ "TitleCustomization": "Customization",
+ "TitleMicrosoftAccount": "Microsoft account",
+ "TitleMSAConnectedDescription": "Connected to your Microsoft account",
+ "TitleMSAConnectionDescription": "Connect your Microsoft account",
+ "TitlePersonalization": "Personalization",
+ "TitlePersonalizationSettings": "Personalization",
+ "TitlePersonalize": "Personalize",
+ "TitlePersonalizedAdSettings": "Personalized Ad Settings",
+ "TitlePersonalizedAdvertisingSettings": "Personalized Advertising Settings",
+ "TitlePersonalizeSettings": "Personalization settings",
+ "TitlePrivacySettings": "Privacy",
+ "TitlePrivacyStatementNew": "Privacy Statement (new)",
+ "TitleRoam": "Sync across devices",
+ "TitleTermsNew": "Terms of Use (new)",
+ "unpinFromStart": "Unpin from Start",
+ "Unsnap": "Unsnap",
+ "update": "Update Now",
+ "updateMessage": "There is a new version of {0} available. Update now to take advantage of the latest changes",
+ "updateMessage_button1": "Update",
+ "updateMessage_button2": "Later",
+ "updateTitle": "Update Available",
+ "userName": "User name",
+ "userNameInput": "Your Email address or username",
+ "validateError": "We are unable to log you in. Please try again later.",
+ "videoClusterLabel": "Featured Videos",
+ "videoConnectErrorText": "Please connect to the internet and try again",
+ "videoCountdownText": "Up next in {0}",
+ "videoGeoErrorText": "Video is not available for current location",
+ "videoItemLabel": "Video",
+ "videoLoadErrorText": "We're having problems loading this video, please try again later",
+ "VideosClusterLabel": "Videos",
+ "viewing": "Viewing",
+ "WeekNum": "Week {0}",
+ "win8Brand": "Windows 8",
+ "win8Share": "If you have {0} or {1}, {2}",
+ "win8ShareBrowser": " Otherwise, {0}",
+ "win8ShareBrowserLink": "click here.",
+ "win8ShareLink": "open this in {0}.",
+ "win8ShareTitle": "{0} - {1}",
+ "winPhone8Brand": "Windows Phone 8"
+ },
+ "resources": {
+ "24Hour": "24 hour",
+ "About": "About",
+ "Accumulation24HoursMap": "Accumulation 24 hours",
+ "AccumulationMap": "Accumulation",
+ "AccuWeather": "AccuWeather",
+ "accuweatherUrl": "http://www.accuweather.com",
+ "AcresOpen": "Open Acres",
+ "ActiveAlertsMap": "Active alerts",
+ "AddAnotherLocSearchPage": "Try a different location",
+ "AddButtonTitle": "Add",
+ "AddNewLocationString": "Add a new location",
+ "AddressHeader": "Address",
+ "AddTileAriaText": "Add another location to favorites",
+ "AdvancedRuns": "Advanced Runs",
+ "AdvisoryAlertSubType": "Advisory",
+ "Africa": "Africa",
+ "Afternoon Cloudy": "Afternoon Cloudy",
+ "Afternoon Ice ": {
+ " Snow": "Aft. Ice/Snow"
+ },
+ "Afternoon Rain": "Afternoon Rain",
+ "Afternoon Snow": "Afternoon Snow",
+ "AirAlertType": "Air",
+ "Alert Bar Heading": "Alert",
+ "alertsFlyoutAriaText": "alert",
+ "AlertShort": "ALERT {0}",
+ "AlertShortWithCount": "ALERT {0} {1} {2} more",
+ "AlertsMap": "Alerts",
+ "AlertWarning": "ALERT {0} from {1} to {2}",
+ "AlertWarningWithCount": "ALERT {0} from {1} to {2} {3} {4} more",
+ "AllFavoritesHeading": "All Favorites",
+ "AM Thunderstorms": "AM T-Storms",
+ "AppDescription": "Weather App",
+ "appFeedbackTitle": "Weather Application Feedback",
+ "AppIntroductionText": "Check the weather close to home and around the world",
+ "AppTitle": "Weather",
+ "AriaTextC": "Celsius",
+ "AriaTextF": "Fahrenheit",
+ "Asia": "Asia/Middle East",
+ "AverageRainfall": "Average Rainfall",
+ "AverageSnow": "Average Snow",
+ "Barometer": "Barometer",
+ "Base": "Base",
+ "BaseDepth": "Base Depth",
+ "BeaufortScale": "{0} bft",
+ "BeaufortScaleAriaText": "{0} Beaufort",
+ "BeginnerRuns": "Beginner Runs",
+ "Blizzard": "Blizzard",
+ "BlizzardCredits": "Blizzard {0}",
+ "Blowing dust": "Blowing Dust",
+ "Blowing sand": "Blowing Sand",
+ "Blowing Snow": "Blowing Snow",
+ "BlowingSnowCredits": "Blowing Snow {0}",
+ "Boarding": "Boarding",
+ "BrandedAppTitle": "MSN Weather",
+ "C": "C",
+ "CamsPanorama": "Cams and 360° Panoramas",
+ "CanadaRadarAttribution": "Canadian radar data courtesy of Environment Canada",
+ "CCDailyAttribution": "Current conditions, daily forecasts by",
+ "CCDailyAttribution1Provider": "Current conditions, daily forecasts by {0}",
+ "CCDailyAttribution2Providers": "Current conditions, daily forecasts by {0} , {1}",
+ "CCDailyMapsAttribution": "Current conditions, daily forecasts and maps by",
+ "CelsiusSetting": "Celsius",
+ "ChanceOfPrecipitationMap": "Chance of precipitation",
+ "ChangeHomeButtonTitle": "Change Home",
+ "ChangeHomeTileAriaText": "Change the home location",
+ "ChangeRegion": "Change region",
+ "ChangeUnitToCButtonTitle": "Change to Celsius",
+ "ChangeUnitToFButtonTitle": "Change to Fahrenheit",
+ "Clear": "Clear",
+ "ClearButtonTitle": "Clear",
+ "ClearCredits": "Clear {0}",
+ "clearSearchHistoryButton": "Clear weather searches",
+ "ClearSelectionButtonTitle": "Clear selection",
+ "CloseButtonLabel": "Close",
+ "CloudCover": "Cloud Cover",
+ "CloudForecastMap": "Cloud Forecast",
+ "CloudMap": "Cloud",
+ "Cloudy": "Cloudy",
+ "Cloudy ": {
+ " Afternoon Sun": "Cloudy/Aft. Sun",
+ " Windy": "Cloudy / Windy"
+ },
+ "CloudyCredits": "Cloudy {0}",
+ "ConfirmButtonTitle": "Confirm",
+ "CouldNotLoadDataMsg": "Data cannot be refreshed. Please try again later.",
+ "CountryRegionFilterText": "Country/Region",
+ "CrossCountry": "Cross Country",
+ "Current": "MSN Weather",
+ "currentConditionsAriaText": "today {0}, current condition {1}, feels like {2}, source {3}",
+ "CurrentHomeNarratorString": "Current Home {0}",
+ "CurrentLocationButtonTitle": "Current Location",
+ "CurrentLocationFetchErrorMsg": "Your location cannot be detected. Try again later.",
+ "CurrentLocDataNotAvailable": "Weather data is not available for your location. Please try again later.",
+ "CustomTitle": "Custom",
+ "DailyDrilldownHourlyForecastAriaText": "{0}, {1} {2}, precipitation {3}",
+ "dailyForecast": "{0}, high {1} low {2}, {3}, precipitation {4}",
+ "dailyForecastExpanded1": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}",
+ "dailyForecastExpanded2": "{0}, high {1} low {2}, {3}, precipitation {4}, high {5} low {6} source {7}, high {8} low {9} source {10}",
+ "dailyForecastMinMax": "{0}, low {1} high {2}, {3}, precipitation {4}",
+ "dailyForecastMinMaxExpanded1": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}",
+ "dailyForecastMinMaxExpanded2": "{0}, low {1} high {2}, {3}, precipitation {4}, low {5} high {6} source {7}, low {8} high {9} source {10}",
+ "DataAttribution": "Data provided by",
+ "DayHeading": "Day",
+ "DealsNews": "Deals & News",
+ "defaultECVErrorAction": "Retry",
+ "defaultECVErrorDescription": "We're sorry, something happened while fufilling your request. Please retry",
+ "defaultECVErrorTitle": "Oops!",
+ "DefaultShortNameForPinFlyout": "Weather",
+ "Dewpoint": "Dew Point",
+ "DismissText": "Remove this panel. Head to Next Steps for more content and Help tips.",
+ "DismissTitle": "Close",
+ "DisplayUnits": "Units",
+ "DistanceText": "Distance",
+ "DopplerRadar": "Doppler Radar",
+ "Drifting sand": "Drifting Sand",
+ "Drifting snow": "Drifting Snow",
+ "Drizzle": "Drizzle",
+ "DrizzleCredits": "Drizzle {0}",
+ "DustCloudyCredits": "Dust Cloudy {0}",
+ "Duststorm": "Duststorm",
+ "Duststorms": "Dust Storms",
+ "DustyClearCredits": "Dusty Clear {0}",
+ "ECVNoResultsActionFilters": "Clear filters",
+ "ECVNoResultsActionNoFilters": "Go Back",
+ "ECVNoResultsDescriptionFilters": "Your search produced no results. Clear your filters and try again.",
+ "ECVNoResultsDescriptionNoFilters": "Your search produced no results. Please try again.",
+ "ECVNoResultsIcon": "⚊",
+ "ECVNoResultsTitle": "No results found",
+ "England": "England",
+ "EnterLocation": "Enter Location",
+ "Europe": "Europe",
+ "ExpertRuns": "Expert Runs",
+ "ExtremeTempAlertType": "Extreme Temperature",
+ "F": "F",
+ "FahrenheitSetting": "Fahrenheit",
+ "Fair": "Fair",
+ "favHighLowText": "High/Low",
+ "favLowHighText": "Low/High",
+ "Favorites": "Favorites",
+ "FeelsLike": "Feels Like {0}",
+ "Feet": "ft",
+ "FilterShow": "Show",
+ "FilterValueDeals": "Deals",
+ "FilterValueFav": "Favorites",
+ "FilterValueOpen": "Open Only",
+ "FloodAlertType": "Flood",
+ "Flurries": "Flurries",
+ "Fog": "Fog",
+ "FogCredits": "Fog {0}",
+ "Foreca": "Foreca",
+ "ForecastHeader": "Today's Forecast",
+ "ForecastMapSubType": "Forecast",
+ "forecaUrl": "http://www.foreca.com",
+ "Freezing": "Freezing",
+ "Freezing Drizzle": "Freezing Drizzle",
+ "Freezing fog": "Freezing Fog",
+ "Freezing Rain": "Freezing Rain",
+ "FreezingRainCredits": "Freezing Rain {0}",
+ "FREOfflineMessage": "You are viewing sample weather data. Please connect to the internet to see weather for your city.",
+ "FreshSnow": "Fresh Snow",
+ "FrigidCredits": "Frigid {0}",
+ "FromText": "From",
+ "FromToText": "From {0} to {1}",
+ "GenericSkiHeroImageText": "This is a generic image and does not represent the actual ski resort.",
+ "GettingStartedClusterTitle": "Getting Started",
+ "GraphDays": "{0} days",
+ "GraphHoursPerDay": "{0} hrs/day",
+ "GyrometerOffAriaLabel": "Automatic sensor panning off",
+ "GyrometerOnAriaLabel": "Automatic sensor panning on",
+ "Hail": "Hail",
+ "Haze": "Haze",
+ "Hazy Sunshine": "Hazy Sunshine",
+ "Heavy drizzle": "Heavy Drizzle",
+ "Heavy rain": "Heavy Rain",
+ "Heavy snow": "Heavy Snow",
+ "Heavy thunderstorms": "Heavy T-Storms",
+ "HeavyLegend": "Heavy",
+ "HeavyRainCredits": "Heavy Rain {0}",
+ "HectaresOpen": "Open Hectares",
+ "HighestLegend": "Highest",
+ "HighLowText": "{0}/{1}",
+ "HighMapSubType": "High",
+ "HighTemperatureMap": "High Temperature Forecast",
+ "HistoricalStringForRAIN": "In the past {0} years, it rained {1} out of {2} times on this day",
+ "HistoricalStringForSNOW": "In the past {0} years, it snowed {1} out of {2} times on this day",
+ "HistoricalStringForTHUNDER": "In the past {0} years, it thundered {1} out of {2} times on this day",
+ "HistoricalWeather": "Historical Weather",
+ "HistoricLengthWithUnit": "{0} {1}",
+ "holiday weatherUrl": "http://www.holiday-weather.com",
+ "HolidayWeather.com": "HolidayWeather.com",
+ "Home": "Home",
+ "Hot and Humid": "Hot and Humid",
+ "HourlyForecast": "Hourly Forecast",
+ "hourlyForecastAriaText": "{0}, {1} {2}, feels like {3}, precipitation {4}",
+ "HourlyForecastFeelsLikeTitle": "Feels like",
+ "HourlyForecastForecastTitle": "Forecast",
+ "hourlyForecastHeaderAriaText": "Read today's hourly forecast",
+ "HourlyForecastPrecipChanceTitle": "Precip. Chance",
+ "HourlyForecastTimeTitle": "Time",
+ "HourlyForecastWindTitle": "Wind",
+ "Humidity": "Humidity",
+ "HWAttribution": "Historical Weather by",
+ "Ice ": {
+ " Snow": "Ice/Snow"
+ },
+ "Ice pellets": "Ice Pellets",
+ "ImageCredits": "Image Credits",
+ "iMap Weather": "WDT",
+ "imap weatherUrl": "http://bit.ly/wdtconsumer",
+ "inPerHour": "in/hr",
+ "IntermediateRuns": "Intermediate Runs",
+ "Introduction": "Introduction",
+ "inUnit": "inches",
+ "Isolated Thunderstorms": "Isolated T-Storms",
+ "Japan": "Japan",
+ "JWSAttribution": "Japan daily forecasts by",
+ "JWSAttributionValue": "© Weather Service, Ltd",
+ "KilometresPerHour": "{0} kmph",
+ "KilometresPerHourAriaText": "{0} kilometers per hour",
+ "kWeather": "KWeather",
+ "KWeatherAttribution": "Korea Weather data by",
+ "kWeatherUrl": "http://www.kweather.co.kr",
+ "LastUpdatedDataTime": "Last updated {0}",
+ "LeftText": "Light",
+ "LegendName": "Precipitation",
+ "lessDailyConditionsAriaText": "Read the forecast from a single source",
+ "lessDailyConditionsDataText": "Less",
+ "LiftOpen": "Lifts Open",
+ "Light drizzle": "Light Drizzle",
+ "Light fog": "Light Fog",
+ "Light freezing drizzle": "Freezing Drizzle",
+ "Light freezing rain": "Freezing Rain",
+ "Light hail": "Light Hail",
+ "Light rain": "Light Rain",
+ "Light rain and snow": "Rain/Snow",
+ "Light rain and snow shower": "Rain/Snow",
+ "Light rain shower": "Light Rain",
+ "Light Showers": "Light Showers",
+ "Light snow": "Light Snow",
+ "Light snow shower": "Light Snow",
+ "LightLegend": "Light",
+ "LightShowersCredits": "Light Showers {0}",
+ "loading": "Loading",
+ "LocationDetectionFailed": "Your location cannot be detected. Try entering your location manually.",
+ "LocationDisabledError": "Your location cannot be found. Change your Permissions to allow Weather to use your location.",
+ "LocationNameLongFormat": "{0}, {1}, {2}",
+ "LocationNameShortFormat": "{0}, {1}",
+ "LocationPinnedToStart": "Unpin this location from the Start screen before setting it as your default location.",
+ "LocationSearchFetchError": "There was a problem. Please try your search again.",
+ "LocDetectionUnknownError": "A problem occurred while detecting your location. Please try again later.",
+ "London": "London",
+ "LowestLegend": "Lowest",
+ "LowMapSubType": "Low",
+ "LowTemperatureMap": "Low Temperature Forecast",
+ "MapFlyoutAltText": "Map animation",
+ "MapFlyoutAriaText": "map animation. {0} {1} on {2}",
+ "MapImageAltText": "Map",
+ "Maps": "Maps",
+ "MapsUnavailable": "Maps are currently unavailable. Please try again.",
+ "MarineAlertType": "Marine",
+ "MaxFavoritesLimitReached": "Your Favorites list is full. Please remove a location before adding a new one.",
+ "MaximumRecordedRainfall": "Record Rainfall",
+ "MaximumRecordedSnow": "Record Snow",
+ "MaxPinnedLocationsLimitReached": "You have pinned the maximum number of locations. Please unpin a location before pinning a new one.",
+ "MeterPerSecond": "{0} m/s",
+ "MeterPerSecondAriaText": "{0} Meter per second",
+ "Metres": "m",
+ "MilesPerHour": "{0} mph",
+ "MilesPerHourAriaText": "{0} miles per hour",
+ "MiscAlertType": "Miscellaneous",
+ "MixLegend": "Mix",
+ "mmPerHour": "mm/hr",
+ "MonthlyAvgBaseDepth": "Average Base Depth",
+ "MonthlyAvgSnowfall": "Average Snowfall",
+ "MonthlyDayLight": "Day Light",
+ "MonthlyMaxTemp": "Average High",
+ "MonthlyMinTemp": "Average Low",
+ "MonthlyRainfall": "Rainfall",
+ "MonthlyRainyDays": "Rainy Days",
+ "MonthlyRdBaseDepth": "Record Max Basedepth",
+ "MonthlyRdSnowfall": "Record High Snowfall",
+ "MonthlyRecordedHighTemp": "Record High",
+ "MonthlyRecordedLowTemp": "Record Low",
+ "MonthlySeaTemp": "Sea Temp.",
+ "MonthlySnowDays": "Snow Days",
+ "MonthlySunshine": "Sunshine",
+ "More Alerts": "More",
+ "moreDailyConditionsAriaText": "Read forecasts from multiple sources",
+ "moreDailyConditionsDataText": "More",
+ "MoreText": "More",
+ "Morning Fog ": {
+ " Afternoon Sun": "AM Fog/Aft. Sun",
+ " Cloudy": "AM Fog/Cloudy"
+ },
+ "Morning Ice ": {
+ " Snow": "AM Ice/Snow"
+ },
+ "Morning Rain": "Morning Rain",
+ "Morning Snow": "Morning Snow",
+ "Mostly clear": "Mostly Clear",
+ "Mostly Cloudy": "Mostly Cloudy",
+ "Mostly Sunny": "Mostly Sunny",
+ "MostlyCloudyCredits": "Mostly Cloudy {0}",
+ "Multiple Alerts Heading": "Alerts",
+ "MyPlaces": "Places",
+ "MyPlacesText": "My Places",
+ "N": "No",
+ "NameHeader": "Name",
+ "National": "National",
+ "NearbySkiResorts": "Nearby Ski Resorts",
+ "NearbyText": "Nearby",
+ "News": "News",
+ "NewSnowHeader": "New Snow",
+ "nextDailyConditionsDataText": "Read the forecast for more days",
+ "NextStepsClusterTitle": "Next Steps",
+ "NightHeading": "Night",
+ "NoInternetConnectionError": "You are not connected to the Internet. Please check your Internet connection and try again.",
+ "NoInternetOnSettingChange": "Your settings have been updated. Connect to the Internet to confirm your changes.",
+ "NoResortsFoundErrorText": "No resorts were found. Please change your filters and try again.",
+ "NorthAmerica": "North America",
+ "NorthAmericaRegion": "North/Central America",
+ "NoSearchResults": "No results matched your search.",
+ "ObservationMapSubType": "Observation",
+ "Oceania": "Australia/Pacific",
+ "ofText": "{0} of {1}",
+ "OnTheSnow": "On The Snow",
+ "OnTheSnowUrl": "http://www.onthesnow.com",
+ "OpenLiftsHeader": "Lifts Open",
+ "OpenTrailsHeader": "Trails Open",
+ "OthersAlertType": "Others",
+ "Overview": "OVERVIEW",
+ "PacificIslands": "Pacific Islands",
+ "PanoramaControlsHiddenOnAriaLabel": "Panorama controls hidden",
+ "PanoramaControlsVisibleOnAriaLabel": "Panorama controls visible",
+ "Partly Cloudy": "Partly Cloudy",
+ "PartlyCloudyCredits": "Partly Cloudy {0}",
+ "Patchy fog": "Patchy Fog",
+ "pause": "Pause",
+ "PersonalizeText": "It's easy to follow the weather in places you choose.",
+ "PersonalizeTitle": "Add your favorite places",
+ "PinButtonTitle": "Pin",
+ "play": "Play",
+ "PM Thunderstorms": "PM T-Storms",
+ "Precipitation": "Precipitation",
+ "PrecipitationAccumulationMap": "Precipitation Accumulation",
+ "precipitationAltText": "Precipitation",
+ "PrecipitationForecastMap": "Precipitation Forecast",
+ "PrecipitationMap": "Precipitation",
+ "PrecipitationObservationMap": "Precipitation Observation",
+ "prevDailyConditionsDataText": "Go back and read the forecast for previous days",
+ "Publisher": "Microsoft Corporation",
+ "RadarForecastMap": "Radar Forecast",
+ "RadarMap": "Radar",
+ "RadarObservationMap": "Radar Observation",
+ "Rain": "Rain",
+ "Rain ": {
+ " Snow": "Rain/Snow",
+ " Windy": "Rain/Windy"
+ },
+ "Rain and snow": "Rain/Snow",
+ "Rain and snow shower": "Rain/Snow",
+ "Rain showers": "Rain Showers",
+ "Rain turning to Snow": "Rain to Snow",
+ "RainAlertType": "Rain",
+ "RainCredits": "Rain {0}",
+ "RainfallAriaText": "Average monthly rainfall",
+ "RainfallFilter": "Rainfall",
+ "RainfallMap": "Rainfall",
+ "RainForecastMap": "Rain forecast",
+ "RainLegend": "Rain",
+ "RainSnowCredits": "Rain and Snow {0}",
+ "RecentSearches": "Recent Searches",
+ "RecommendedForFamiliesString": "Recommended for Families: {0}",
+ "RecordSnowfallYear": "{0} ({1})",
+ "RecordTemperatureYear": "{0}° ({1})",
+ "RefreshButtonTitle": "Refresh",
+ "Regional": "Regional",
+ "RelatedResorts": "Related Ski Resorts",
+ "RemoveButtonTitle": "Remove",
+ "ResortStatusClosed": "Closed",
+ "ResortStatusOpen": "Open",
+ "ResortStatusTemporarilyClosed": "Temporarily Closed",
+ "ResortStatusWeekendsOnly": "Weekends Only",
+ "RetryButtonLabel": "Try again",
+ "Reviews": "Reviews",
+ "RightText": "Heavy",
+ "SampleDataHeader": "{0} (Sample Data)",
+ "Satellite": "Satellite",
+ "SatelliteMap": "Satellite",
+ "Scattered Flurries": "Scattered Flurries",
+ "Scattered Thunderstorms": "Scatt'd T-Storms",
+ "ScatteredCloudsCredits": "Scattered Clouds {0}",
+ "ScatteredFlurriesCredits": "Scattered Flurries {0}",
+ "searchboxInvalidEntry": "Invalid location",
+ "searchboxPlaceHolderTest": "Search for a city",
+ "searchBoxText": "Search for a City or Zipcode",
+ "SearchButtonTitle": "Search",
+ "SearchHistory": "Search History",
+ "SearchPageHeaderSubTitle": "Search Results",
+ "SearchPageHeaderTitle": "”{0}”",
+ "SearchResultsAriaLabel": "Search Results",
+ "SearchResultsHeader": "{0} search results",
+ "SearchTypeText": "Search Type",
+ "SeeMoreTruncatedText": "See more...",
+ "Seoul": "Seoul",
+ "SetDefaultButtonTitle": "Set as Home",
+ "SetDefaultMaxLimitReached": "Your Favorites list is full. Please remove a location before setting a new one as your default location.",
+ "SetHomeLocationTitle": "Set Home Location",
+ "Settings": "Settings",
+ "Severe duststorm": "Severe Duststorm",
+ "ShareDataDesc": "Get complete forecast for places you care about with the Weather app, available in the Windows Store.",
+ "ShareDataNotAvailableError": "Weather data is not available for this location. Please try again later.",
+ "ShareDataUrl": "http://apps.microsoft.com/webpdp/app/421ba874-f903-4965-9b82-d60f3ba3cae0",
+ "ShareInvalidSharePageMessage": "Select a city and try again.",
+ "ShareLocationNotAvailableMessage": "This location is currently not available to share.",
+ "SharePageTitle": "{0} - MSN Weather",
+ "ShareSnippet": "Detailed weather conditions and forecast for {0}.",
+ "ShareWeatherUpdates": "Weather updates",
+ "ShortDateTimeFormatString": "{0} {1}",
+ "Showers": "Showers",
+ "Showers ": {
+ " Clear": "Showers/Clear"
+ },
+ "Single Alert Heading": "Alert",
+ "skiCurrentConditionsAriaText": "new snow {0}, base depth {1}, source {2}",
+ "SkiDataAttribution": "Ski resort and Snow data provided by {0}",
+ "SkiDetailsImageAttribution": "Image provided by {0}",
+ "SkiResorts": "Ski Resorts",
+ "SkiResortsECVShareError": "There is nothing to share right now. Select a resort and try again.",
+ "SkiResortWebsiteString": "Resort Website",
+ "SkiReviewDateFormat": "{0} {1}, {2}",
+ "SkiReviewFamilyFriendly": "Family Friendly",
+ "SkiReviewFiveStarsText": "5 Stars",
+ "SkiReviewFourStarsText": "4 Stars",
+ "SkiReviewOverAllRating": "{0} / 5",
+ "SkiReviewOverAllText": "Overall",
+ "SkiReviewRatings": "Ratings ({0})",
+ "SkiReviewThreeStarsText": "3 Stars",
+ "SkiReviewTwoStarsText": "2 & Under",
+ "Sleet": "Sleet",
+ "Smoke": "Smoke",
+ "SnapTime": "{0} Local Time",
+ "Snow": "Snow",
+ "Snow ": {
+ " Windy": "Snow/Windy"
+ },
+ "Snow Showers": "Snow Showers",
+ "Snow Showers ": {
+ " Sun": "Snow/Sun"
+ },
+ "Snow turning to Rain": "Snow to Rain",
+ "SnowAccumulationMap": "Snow Accumulation",
+ "SnowAlertType": "Snow",
+ "SnowAriaText": "Average monthly snow",
+ "SnowCredits": "Snow {0}",
+ "SnowDataAttribution": "Snow data provided by {0}",
+ "SnowDaysFilter": "Snow days",
+ "SnowDepth": "Snow Depth",
+ "SnowDepthHeader": "Base Depth",
+ "SnowForecastMap": "Snow Forecast",
+ "SnowForecastMap.comment": "Snow Forecast map title",
+ "SnowLegend": "Snow",
+ "SnowMap": "Snow",
+ "SnowObservationMap": "Snow Observation",
+ "South Korea": "South Korea",
+ "SouthAmerica": "South America",
+ "SpeedUnitsInBFTWithDirection": "{0} {1} bft",
+ "SpeedUnitsInBFTWithDirectionAriaText": "{0} {1} Beaufort",
+ "SpeedUnitsInKMPHWithDirection": "{0} {1} kmph",
+ "SpeedUnitsInKMPHWithDirectionAriaText": "{0} {1} kilometer per hour",
+ "SpeedUnitsInMPHWithDirection": "{0} {1} mph",
+ "SpeedUnitsInMPHWithDirectionAriaText": "{0} {1} miles per hour",
+ "SpeedUnitsInMPSWithDirection": "{0} {1} m/s",
+ "SpeedUnitsInMPSWithDirectionAriaText": "{0} {1} meter per second",
+ "Squalls": "Squalls",
+ "StatementAlertSubType": "Statement",
+ "Status": "Resort Status",
+ "StatusHeader": "Status",
+ "StormAlertType": "Storm",
+ "Summit": "Summit",
+ "Sunny ": {
+ " Windy": "Sunny/Windy"
+ },
+ "Sunny (Clear)": "Sunny (Clear)",
+ "Sunrise": "Sunrise",
+ "Sunset": "Sunset",
+ "SunshineAndSeaTempAttribution": "Sunshine & Sea temp. by",
+ "SunshineAndSeaTempAttributionAriaText": "Sunshine & Sea temperature by {0}",
+ "SunshineAriaText": "Average monthly sunshine",
+ "SunshineAttribution": "Sunshine by",
+ "SunshineAttributionAriaText": "Sunshine by {0}",
+ "SunshineFilter": "Sunshine",
+ "SunshineSeaTempAttribution": "Sunshine & Sea temperature data by",
+ "Taipei": "Taipei",
+ "Taiwan": "Taiwan",
+ "TakeATourText": "Get more out of MSN Weather with great maps and in-depth data.",
+ "TakeATourTitle": "Take a tour",
+ "TempClosed": "Temp. Closed",
+ "Temperature": "Temperature",
+ "TemperatureAriaText": "Average monthly temperature",
+ "TemperatureFilter": "Temperature",
+ "TemperatureForecastMap": "Temperature Forecast",
+ "TemperatureMap": "Temperature",
+ "TemperatureWithDegreeCelsius": "{0}°C",
+ "TemperatureWithDegreeFahrenheit": "{0}°F",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "Thunderstorms": "Thunderstorms",
+ "ThunderstormsCredits": "Thunderstorms {0}",
+ "TianQiAttribution": "Daily forecasts by",
+ "Today": "Today",
+ "TodayMapSubType": "Today",
+ "Tokyo": "Tokyo",
+ "ToolTipTextC": "Click to change to Celsius",
+ "ToolTipTextF": "Click to change to Fahrenheit",
+ "ToText": "to",
+ "TrailmapAttribution": "Trail map provided by {0}",
+ "Trailmapimage": "Trail map image",
+ "TrailsOpen": "Trails Open",
+ "Travel": "Travel",
+ "Tubing": "Tubing",
+ "United Kingdom": "United Kingdom",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInDay": "{0} day",
+ "UnitInDays": "{0} days",
+ "UnitInHectorPascal": "{0} hp",
+ "UnitInHectorPascalAriaText": "{0} hecto pascal",
+ "UnitInHourPerDay": "{0} hr/day",
+ "UnitInHoursPerDay": "{0} hrs/day",
+ "UnitInInches": "{0} in",
+ "UnitInKilometres": "{0} km",
+ "UnitInMiles": "{0} mi",
+ "UnitInMillibars": "{0} mb",
+ "UnitInMillibarsAriaText": "{0} millibars",
+ "UnitInMillimeters": "{0} mm",
+ "UnitInMillimetersHg": "{0} mm Hg",
+ "UnitInMillimetersHgAriaText": "{0} millimeter Hg",
+ "UnitInPercentage": "{0}%",
+ "UnknownCredits": "Unknown {0}",
+ "UnpinButtonTitle": "Unpin",
+ "UntilText": "until",
+ "UvExtreme": "{0} (Extreme)",
+ "UvHigh": "{0} (High)",
+ "UvIndex": "UV Index",
+ "UvLow": "{0} (Low)",
+ "UvModerate": "{0} (Moderate)",
+ "UvVeryHigh": "{0} (Very High)",
+ "VerticalDrop": "Vertical Drop",
+ "Visibility": "Visibility",
+ "WarningAlertSubType": "Warning",
+ "WatchAlertSubType": "Watch",
+ "weather undergroundUrl": "http://www.wunderground.com",
+ "Weather.com": "weather.com",
+ "weather.comUrl": "http://www.weather.com",
+ "Weather2Travel": "Weather2Travel",
+ "weather2travelUrl": "http://www.weather2travel.com",
+ "WeatherAlertsMap": "Weather alerts",
+ "WeatherDataNotAvailable": "Weather data is not available for this location. Please try again later or enter a different location.",
+ "WeatherDotComForecastAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-tenday",
+ "WeatherDotComMapsAttribution": "View interactive maps at {0}",
+ "WeatherDotComMapsAttributionUrlPrefix": "http://bing.weather.com/weather/map/interactive/",
+ "WeatherDotComMapsAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-Imap",
+ "WeatherDotComSeeMoreText": "See more from weather.com",
+ "WeatherMaps": "Weather Maps",
+ "WebsiteHeader": "Website",
+ "Wind": "Wind",
+ "WindAlertType": "Wind",
+ "WindHeader": "Wind",
+ "WindSpeedUnitForE": "E",
+ "WindSpeedUnitForENE": "ENE",
+ "WindSpeedUnitForESE": "ESE",
+ "WindSpeedUnitForN": "N",
+ "WindSpeedUnitForNE": "NE",
+ "WindSpeedUnitForNNE": "NNE",
+ "WindSpeedUnitForNNW": "NNW",
+ "WindSpeedUnitForNW": "NW",
+ "WindSpeedUnitForS": "S",
+ "WindSpeedUnitForSE": "SE",
+ "WindSpeedUnitForSSE": "SSE",
+ "WindSpeedUnitForSSW": "SSW",
+ "WindSpeedUnitForSW": "SW",
+ "WindSpeedunitForW": "W",
+ "WindSpeedUnitForWNW": "WNW",
+ "WindSpeedUnitForWSW": "WSW",
+ "Windy": "Windy",
+ "WindyCredits": "Windy {0}",
+ "WithinText": "Within",
+ "Wolfram Alpha": "Wolfram Alpha",
+ "wolfram alphaUrl": "http://www.wolframalpha.com",
+ "Wolfram|Alpha": "Wolfram Alpha",
+ "wolfram|alphaUrl": "http://www.wolframalpha.com",
+ "WorldHeading": "World",
+ "WorldMapAltText": "World map",
+ "WorldWeather": "World Weather",
+ "WorldWeatherContinent": "World weather {0}",
+ "WorldWeatherTitle": "World Weather",
+ "WWHighLowSeperator": "/",
+ "Y": "Yes"
+ },
+ "worldweather": {
+ "Addis Ababa": "Addis Ababa",
+ "Adelaide": "Adelaide",
+ "Alexandria": "Alexandria",
+ "ALGERIA": "Algeria",
+ "Algiers": "Algiers",
+ "Amsterdam": "Amsterdam",
+ "Arawa": "Arawa",
+ "ARGENTINA": "Argentina",
+ "Asunción": "Asunción",
+ "Athens": "Athens",
+ "Auckland": "Auckland",
+ "AUSTRALIA": "Australia",
+ "AUSTRIA": "Austria",
+ "Baghdad": "Baghdad",
+ "Bangkok": "Bangkok",
+ "Barcelona": "Barcelona",
+ "Beijing": "Beijing",
+ "Berlin": "Berlin",
+ "Bogota": "Bogota",
+ "BOLIVIA": "Bolivia",
+ "Brasília": "Brasília",
+ "BRAZIL": "Brazil",
+ "Brisbane": "Brisbane",
+ "Buenos Aires": "Buenos Aires",
+ "Cairo": "Cairo",
+ "CANADA": "Canada",
+ "Cancún": "Cancún",
+ "Cape Town": "Cape Town",
+ "Caracas": "Caracas",
+ "Casablanca": "Casablanca",
+ "Chicago": "Chicago",
+ "CHILE": "Chile",
+ "CHINA": "China",
+ "COLOMBIA": "Colombia",
+ "Colombo": "Colombo",
+ "Darwin": "Darwin",
+ "Dubai": "Dubai",
+ "Dublin": "Dublin",
+ "Durban": "Durban",
+ "ECUADOR": "Ecuador",
+ "EGYPT": "Egypt",
+ "ETHIOPIA": "Ethiopia",
+ "FIJI": "Fiji",
+ "FINLAND": "Finland",
+ "FRANCE": "France",
+ "Georgetown": "Georgetown",
+ "GERMANY": "Germany",
+ "GREECE": "Greece",
+ "GUYANA": "Guyana",
+ "Helsinki": "Helsinki",
+ "Hobart": "Hobart",
+ "Ibadan": "Ibadan",
+ "INDIA": "India",
+ "IRAQ": "Iraq",
+ "IRELAND": "Ireland",
+ "Istanbul": "Istanbul",
+ "ITALY": "Italy",
+ "JAPAN": "Japan",
+ "Juneau": "Juneau",
+ "Kampala": "Kampala",
+ "KENYA": "Kenya",
+ "KOREA": "Korea",
+ "Kyiv": "Kyiv",
+ "La Paz": "La Paz",
+ "Lagos": "Lagos",
+ "Lima": "Lima",
+ "London": "London",
+ "Los Angeles": "Los Angeles",
+ "Melbourne": "Melbourne",
+ "MEXICO": "Mexico",
+ "Mexico City": "Mexico City",
+ "Miami": "Miami",
+ "MOROCCO": "Morocco",
+ "Moscow": "Moscow",
+ "Mumbai": "Mumbai",
+ "Nairobi": "Nairobi",
+ "NETHERLANDS": "Netherlands",
+ "New Delhi": "New Delhi",
+ "New York City": "New York City",
+ "NEW ZEALAND": "New Zealand",
+ "NIGERIA": "Nigeria",
+ "PAPUA NEW GUINEA": "Papua New Guinea",
+ "PARAGUAY": "Paraguay",
+ "Paris": "Paris",
+ "Perth": "Perth",
+ "PERU": "Peru",
+ "Port Moresby": "Port Moresby",
+ "Quito": "Quito",
+ "Rio de Janeiro": "Rio de Janeiro",
+ "Rio Gallegos": "Rio Gallegos",
+ "Riyadh": "Riyadh",
+ "Rome": "Rome",
+ "RUSSIA": "Russia",
+ "San Francisco": "San Francisco",
+ "Santiago": "Santiago",
+ "SAUDI ARABIA": "Saudi Arabia",
+ "Seattle": "Seattle",
+ "Seoul": "Seoul",
+ "Shanghai": "Shanghai",
+ "Singapore": "Singapore",
+ "SINGAPORE_CAPS": "Singapore",
+ "SOUTH AFRICA": "South Africa",
+ "SPAIN": "Spain",
+ "SRI LANKA": "Sri Lanka",
+ "Suva": "Suva",
+ "Sydney": "Sydney",
+ "THAILAND": "Thailand",
+ "Tokyo": "Tokyo",
+ "Toronto": "Toronto",
+ "TURKEY": "Turkey",
+ "UGANDA": "Uganda",
+ "UKRAINE": "Ukraine",
+ "UNITED ARAB EMIRATES": "United Arab Emirates",
+ "UNITED KINGDOM": "United Kingdom",
+ "UNITED STATES": "United States",
+ "Vancouver": "Vancouver",
+ "VENEZUELA": "Venezuela",
+ "Victoria Falls": "Victoria Falls",
+ "Vienna": "Vienna",
+ "Washington D.C.": "Washington, D.C.",
+ "Wellington": "Wellington",
+ "ZIMBABWE": "Zimbabwe"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/en.json b/packages/microsoft.bingweather/resources/en.json
new file mode 100644
index 00000000..19f828e2
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/en.json
@@ -0,0 +1,213 @@
+{
+ "Bing.Maps.Javascript": {
+ "resources": {
+ "L_AddStop_Text": "add destination",
+ "L_aerialEnableTilt_Text": "show angled view",
+ "L_aerialShowLabels_Text": "show labels",
+ "L_ApproximateLocation_Text": "Location is approximate",
+ "L_AtleastTwoWaypointsRequiredError_Text": "At least two waypoints are required to calculate directions.",
+ "L_AvoidHighways_Text": "Avoid highways",
+ "L_AvoidMotorways_Text": "Avoid motorways",
+ "L_AvoidTolls_Text": "Avoid toll roads",
+ "L_BingLogoTooltip_Text": "Bing Maps",
+ "L_BingSearchGoTooltip_Text": "Search on Bing",
+ "L_BingSearchWatermark_Text": "Search on Bing",
+ "L_BuyTickets_Text": "Buy Tickets from {0}",
+ "L_CalendarDays_Text": "S,M,T,W,T,F,S",
+ "L_CalendarMonths_Text": "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
+ "L_CarModeToolTip_Text": "Driving",
+ "L_Clear_Text": "Clear",
+ "L_compassHeadingLabels_Text": "N~|~NE~|~E~|~SE~|~S~|~SW~|~W~|~NW~|",
+ "L_compassNorthLabel_Text": "N",
+ "L_compassTooltip_Text": "Click to pan in any direction",
+ "L_CongestionChargeZoneEnterTwo_Text": " ,Applies Monday to Friday - 7am to 6pm.",
+ "L_CongestionChargeZoneEnter_Text": "Entering Congestion Charge Zone.",
+ "L_CongestionChargeZoneExit_Text": "Leaving Congestion Charge Zone.",
+ "L_CongestionChargeZoneTooltip_Text": "Entering Congestion Charge Zone. Applies Monday to Friday - 7am to 6pm.",
+ "L_coverageInfoBoxClickBlue_Text": "Click inside the blue area",
+ "L_coverageInfoBoxNotAvailable_Text": "Streetside is not available here",
+ "L_coverageInfoBoxZoomOut_Text": "Zoom out to see Streetside coverage",
+ "L_currentIconTooltip_Text": "Return to last location",
+ "L_DirectionsAddressCityLocation_Text": "Business, address, or landmark",
+ "L_DirectionsDisclaimer_Text": "These directions are subject to the {0} and for informational purposes only. No guarantee is made regarding their completeness or accuracy. Construction projects, traffic, or other events may cause actual conditions to differ from these results. Map and traffic data © {year} NAVTEQ™.",
+ "L_DirectionsGetDirections_Text": "Go",
+ "L_DirectionsMenuReverse_Text": "Reverse",
+ "L_DirectionsMenuRoundtrip_Text": "Round-trip",
+ "L_DirectionsTaskTitle_Text": "Directions",
+ "L_DirectionsTripLengthTooLong_Text": "Driving directions are not available for a route of this length.",
+ "L_DisambiguationGeneralMessageb2b_Text": "By \"{0}\", did you mean:",
+ "L_DisambiguationGeneralMessage_Text": "Did you mean:",
+ "L_DisambiguationMessageFromMbing_Text": "Did you mean from:",
+ "L_DisambiguationMessageToMbing_Text": "Did you mean to:",
+ "L_DistanceUnitFeetShort_Text": "ft",
+ "L_DistanceUnitKm_Text": "km",
+ "L_DistanceUnitMeters_Text": "m",
+ "L_DistanceUnitMilesShortText_Text": "mi",
+ "L_DragSummaryToolTip_Text": "{0} ({1} {2} / {3})",
+ "L_DragToolTip_Text": "Drag to modify your route",
+ "L_DrivingDirectionNotAvailable_Text": "We can't find a driving route for the locations you entered. Check the locations you entered, and try again.",
+ "L_ellipsis_Text": "…",
+ "L_EmptyWaypointError_Text": "One or more waypoints have a missing address or location.",
+ "L_ExceedMaxTransitWaypointLimitError_Text": "The maximum waypoint limit of 2 for transit routes has been exceeded.",
+ "L_ExceedMaxWaypointLimitError_Text": "The maximum waypoint limit of {0} has been exceeded.",
+ "L_exitButton_Text": "Exit",
+ "L_FirstOrLastStoppointIsViaError_Text": "Either the first or last waypoint is a via point, which is not allowed.",
+ "L_GoBackToThePreviousRoute_Text": "go back to the previous route",
+ "L_HideOptions_Text": "hide options",
+ "L_HighConfidenceSingularTeaserMessage_Text": "We found {0} more result for ",
+ "L_HighConfidenceTeaserMessage_Text": "We found {0} more results for ",
+ "L_invalidcredentials_text": "The specified credentials are invalid. You can sign up for a free developer account at http://www.bingmapsportal.com",
+ "L_KmSettings_Text": "Km",
+ "L_loadingError_Text": "There was an error loading streetside.",
+ "L_mapTypeAerialDescription_Text": "A detailed look from above",
+ "L_mapTypeAerialName_Text": "Aerial",
+ "L_mapTypeAutoDescription_Text": "Switches to the best map style as you zoom",
+ "L_mapTypeAutoName_Text": "Automatic",
+ "L_mapTypeBirdsEyeDescription_Text": "A better angle of aerial photography",
+ "L_mapTypeBirdsEyeName_Text": "Bird's eye",
+ "L_mapTypeCollinsBartDescription_Text": "Detailed maps for Greater London",
+ "L_mapTypeCollinsBartName_Text": "London Street Map",
+ "L_mapTypeOrdnanceSurveyDescription_Text": "Maps for outdoor life",
+ "L_mapTypeOrdnanceSurveyName_Text": "Ordnance Survey Map",
+ "L_mapTypeRoadDescription_Text": "A standard road map",
+ "L_mapTypeRoadName_Text": "Road",
+ "L_microsoftcopyright_text": "© {year} Microsoft Corporation",
+ "L_MilesSettings_Text": "Miles",
+ "L_Next_Text": "Next",
+ "L_OneClickDirectionsHeader_Text": "Or, choose a highway:",
+ "L_OrDragTheRoute_Text": " ,or drag the route",
+ "L_PopupEmail_Text": "Email",
+ "L_Previous_Text": "Previous",
+ "L_privacyReporting_Text": "Report",
+ "L_RemoveVia_Text": "Remove",
+ "L_RerouteBasedOnTraffic_Text": "rerouted based on traffic",
+ "L_RideAndExitAt_Text": "Ride for {0} and exit at",
+ "L_rotateLeftTooltip_Text": "Rotate left",
+ "L_rotateRightTooltip_Text": "Rotate right",
+ "L_RouteErrorServerBusy_Text": "Driving directions are temporarily unavailable. Please try again",
+ "L_RouteOptions_Text": "Options",
+ "L_RouteOverviewDriving_Text": "{0}, {1} driving",
+ "L_RouteOverviewOther_Text": "{0}, {1}",
+ "L_RouteOverviewWalking_Text": "{0}, {1} walking",
+ "L_RouteSummaryLink_Text": "{0} to {1}: ",
+ "L_RouteTimeInCurrentTrafficCondition_Text": "{0} with traffic ",
+ "L_SaveYourDestinationHistory_Text": "Save your destination history",
+ "L_scaleBarFeet_Text": "{num} feet",
+ "L_scaleBarKilometers_Text": "{num} km",
+ "L_scaleBarMeters_Text": "{num} m",
+ "L_scaleBarMiles_Text": "{num} miles",
+ "L_scaleBarYards_Text": "{num} yds",
+ "L_ScheduledArrival_Text": "{0}, arrival",
+ "L_ScheduledDeparture_Text": "{0}, departure",
+ "L_SeeTrafficBasedRoute_Text": "view route based on traffic",
+ "L_SelectDisambiguation_Text": "Select",
+ "L_SendMobile_Text": "Mobile",
+ "L_SendTo_Text": "Send to",
+ "L_ShowOptions_Text": "show options",
+ "L_TakeBus_Text": "Take the bus",
+ "L_TakeTrain_Text": "Take the train",
+ "L_TakeTube_Text": "Take the tube",
+ "L_TermsOfUse_Text": "Microsoft® Service Agreement",
+ "L_TimeAM_Text": "am",
+ "L_TimeInHr_Text": "{0} hr",
+ "L_TimeLessThanOneHr_Text": "{0} min",
+ "L_TimeLessThanOneMin_Text": "< 1 min",
+ "L_TimeMoreThanOneHr_Text": "{0} hr {1} min",
+ "L_TimePM_Text": "pm",
+ "L_TrafficAccident_Text": "Accident",
+ "L_TrafficCongestion_Text": "Congestion",
+ "L_TrafficDisabledVehicle_Text": "Disabled Vehicle",
+ "L_TrafficLegendFast_Text": "Fast",
+ "L_TrafficLegendSlow_Text": "Slow",
+ "L_TrafficMassTransit_Text": "Mass Transit",
+ "L_TrafficMiscellaneous_Text": "Miscellaneous",
+ "L_TrafficNotAvailableInOblique_Text": "Traffic isn't available in bird's eye view",
+ "L_TrafficOtherNews_Text": "Other News",
+ "L_TrafficPlannedEvent_Text": "Planned Event",
+ "L_TrafficPopupCenterMapHere_Text": "Center map here",
+ "L_TrafficPopupDateFormat_Text": "M/d/yyyy h:mm tt",
+ "L_TrafficPopupDescription_Text": "Description",
+ "L_TrafficPopupDetour_Text": "Detour",
+ "L_TrafficPopupEstEndTime_Text": "Est. end time",
+ "L_TrafficPopupLane_Text": "Lane",
+ "L_TrafficPopupLocation_Text": "Location",
+ "L_TrafficPopupSeverity_Text": "Severity",
+ "L_TrafficPopupStartTime_Text": "Start time",
+ "L_TrafficPopupZoomToIncident_Text": "Zoom to incident",
+ "L_TrafficRoadHazard_Text": "Road Hazard",
+ "L_TrafficScheduledConstruction_Text": "Scheduled Construction",
+ "L_TrafficSeverityMinor_Text": "Minor",
+ "L_TrafficSeverityModerate_Text": "Moderate",
+ "L_TrafficSeveritySerious_Text": "Serious",
+ "L_TrafficUnavailable_Text": "Traffic is temporarily unavailable",
+ "L_TrafficUnScheduledContruction_Text": "Unscheduled Construction",
+ "L_TrafficUpdatedTimeFormat_Text": "HH:mm:ss",
+ "L_TrafficUpdated_Text": "Updated",
+ "L_TrafficWeather_Text": "Weather",
+ "L_TrafficZoomIn_Text": "Zoom in for traffic details",
+ "L_TransitCostWithCurrency_Text": "${0}",
+ "L_TransitDefaultTitle_Text": "Transit Schedule",
+ "L_TransitDirectionNoAvailableTransitTrip_Text": "We can't find a transit route for the locations you entered. Check the locations you entered or try a different date/time.",
+ "L_TransitDirectionNoSolution_Text": "We can't find a transit route for the locations you entered. Check the locations you entered, and try again.",
+ "L_TransitDirectionNotAvailable_Text": "We can't find a transit route for the locations you entered. Check the locations you entered, and try again.",
+ "L_TransitDirectionOutOfTransitBounds_Text": "We can't find a transit route between the locations you entered.",
+ "L_TransitDirectionTooClose_Text": "The transit trip is too short. Try using walking directions instead.",
+ "L_TransitDisclaimer_Text": "These directions are subject to the Microsoft® Service Agreement and for informational purposes only. No guarantee is made regarding their completeness or accuracy. Contains public sector information licensed under the Open Government License v.1.0.",
+ "L_TransitExcludeAirLineLabel_Text": "Exclude Air Line",
+ "L_TransitExcludeBulletTrain_Text": "Exclude Bullet Train",
+ "L_TransitExcludeExpressLabel_Text": "Exclude Express Train",
+ "L_TransitIncludeBulletTrain_Text": "Include Bullet Train",
+ "L_TransitItineraryTitle_Text": "TRANSIT ROUTE {0}",
+ "L_TransitModeToolTip_Text": "Transit",
+ "L_TransitNotAvailableWarning_Text": "There's no transit information for this location. Please choose another method of transportation.",
+ "L_TransitOptionArriveBy_Text": "Arrive by",
+ "L_TransitOptionDepartAt_Text": "Depart at",
+ "L_TransitOptionLastTrain_Text": "Last train",
+ "L_TransitOptionsTitle_Text": "ROUTES",
+ "L_TransitRouteErrorServerBusy_Text": "Transit directions are temporarily unavailable. Please try again",
+ "L_transitRouteLabel_Text": "Route: ",
+ "L_transitRoutesLabel_Text": "Routes: ",
+ "L_TransitRouteToolTipTransfer_Text": "Transfer: {0}",
+ "L_TransitRouteToolTipWalking_Text": "Walking: {0} ",
+ "L_TransitScheduleDeparts_Text": "DEPARTS",
+ "L_TransitScheduleRoutes_Text": "ROUTE",
+ "L_TransitScheduleUnavailable_Text": "Schedule information is unavailable at this stop for the time specified.",
+ "L_TransitSortByLabel_Text": "Sort by:",
+ "L_TransitSortByOptionMinimizeMoney_Text": "Cheapest fare",
+ "L_TransitSortByOptionMinimizeTime_Text": "Quickest route",
+ "L_TransitSortByOptionMinimizeTransfers_Text": "Fewest transfers",
+ "L_TransitStopFormat_Text": "{0} - {1}",
+ "L_TransitSummaryStartEndTime_Text": "{0} - {1}",
+ "L_TransitTrainLineCom_Text": "www.thetrainline.com",
+ "L_TransitTripLengthTooLong_Text": "Transit directions are not available for a route of this length.",
+ "L_TransitUpdateSchedule_Text": "Update",
+ "L_TubeModeToolTip_Text": "Transport: Now with Tube!",
+ "L_VenueMapExplorerTooltip_Text": "View {0} Map",
+ "L_VenueMaps_Directory_Text": "DIRECTORY",
+ "L_VenueMaps_HideCategories_Text": "Hide Categories",
+ "L_VenueMaps_Other_Text": "Other",
+ "L_VenueMaps_ShowCategories_Text": "Show Categories",
+ "L_VenueMaps_SortByAlpha_Text": "Businesses A-Z",
+ "L_VenueMaps_SortByLevel_Text": "Level",
+ "L_VenueMaps_ToolTip_Text": "View {0} map",
+ "L_VersionMismatchMessage_Text": "A new version of Bing Maps SDK is available",
+ "L_VersionNotSupportedMessage_Text": "This version of Bing Maps SDK is not supported",
+ "L_ViaList_Text": "via {0} ",
+ "L_viewAllButton_Text": "view all businesses",
+ "L_WalkingDirectionNotAvailable_Text": "We can't find a walking route for the locations you entered. Check the locations you entered, and try again.",
+ "L_WalkingDirectionsSidewalkWarning_Text": "Caution: This route may not contain sidewalks or pedestrian paths.",
+ "L_WalkingDirectionsTripLengthTooLong_Text": "Walking directions are not available for a route of this length. Try driving directions instead.",
+ "L_WalkingDistanceFrom_Text": "Walk {0} ",
+ "L_WalkingInstruction_Text": "to {0}",
+ "L_WalkingModeToolTip_Text": "Walking",
+ "L_WalkingRouteErrorServerBusy_Text": "Walking directions are temporarily unavailable. Please try again",
+ "L_WaypointDisambiguationError_Text": "One or more waypoints need to be disambiguated.",
+ "L_WaypointViaEro_Text": "Via ",
+ "L_WebsiteLink_Text": "Website",
+ "L_world_Text": "World",
+ "L_zoomInTooltip_Text": "Zoom in",
+ "L_zoomOutTooltip_Text": "Zoom out",
+ "L_zoomSliderTooltip_Text": "Move slider to zoom in or out"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/es-ar.json b/packages/microsoft.bingweather/resources/es-ar.json
new file mode 100644
index 00000000..0c86e5a4
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/es-ar.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "11274",
+ "Language_af": "afrikáans",
+ "Language_am": "amárico",
+ "Language_ar": "árabe",
+ "Language_arn-Latn": "mapuche",
+ "Language_as": "asamés",
+ "Language_az": "azerí (latino)",
+ "Language_az-Cyrl": "azerbaiyano (cirílico)",
+ "Language_az-Latn": "azerbaiyano (latino)",
+ "Language_ba-Cyrl": "baskir",
+ "Language_be": "bielorruso",
+ "Language_bg": "búlgaro",
+ "Language_bn": "bangla",
+ "Language_bn-bd": "bangla (Bangladesh)",
+ "Language_bn-in": "bangla (India)",
+ "Language_br-Latn": "bretón",
+ "Language_bs": "bosnio (latino)",
+ "Language_bs-Cyrl": "bosnio (cirílico)",
+ "Language_bs-Latn": "bosnio (latino)",
+ "Language_ca": "catalán",
+ "Language_ca-ES-valencia": "valenciano",
+ "Language_chr": "cheroqui",
+ "Language_chr-Cher": "Cheroqui (cheroqui)",
+ "Language_co-Latn": "corso",
+ "Language_cs": "checo",
+ "Language_cy": "galés",
+ "Language_da": "danés",
+ "Language_de": "alemán",
+ "Language_dsb": "bajo sorbio",
+ "Language_dv": "divehi",
+ "Language_el": "griego",
+ "Language_en": "inglés",
+ "Language_es": "español",
+ "Language_et": "estonio",
+ "Language_eu": "euskera",
+ "Language_fa": "persa",
+ "Language_ff-Latn": "fula",
+ "Language_fi": "finés",
+ "Language_fil-Latn": "filipino",
+ "Language_fo": "feroés",
+ "Language_fr": "francés",
+ "Language_fy": "frisón",
+ "Language_ga": "irlandés",
+ "Language_gd": "gaélico escocés",
+ "Language_gd-Latn": "gaélico escocés",
+ "Language_gl": "gallego",
+ "Language_gsw": "alsaciano",
+ "Language_gu": "gujarati",
+ "Language_ha": "hausa (latino)",
+ "Language_ha-Latn": "hausa (latino)",
+ "Language_he": "hebreo",
+ "Language_hi": "hindi",
+ "Language_hr": "croata",
+ "Language_hsb": "alto sorbio",
+ "Language_hu": "húngaro",
+ "Language_hy": "armenio",
+ "Language_id": "indonesio",
+ "Language_ig": "igbo",
+ "Language_ig-Latn": "igbo",
+ "Language_is": "islandés",
+ "Language_it": "italiano",
+ "Language_iu-Latn": "inuktitut (latino)",
+ "Language_ja": "japonés",
+ "Language_ka": "georgiano",
+ "Language_kk": "kazajo",
+ "Language_kl": "groenlandés",
+ "Language_km": "khmer",
+ "Language_kn": "kannada",
+ "Language_ko": "coreano",
+ "Language_kok": "konkani",
+ "Language_ku": "kurdo",
+ "Language_ku-Arab": "kurdo central",
+ "Language_ky": "kirguís",
+ "Language_ky-Cyrl": "kirguís",
+ "Language_lb": "luxemburgués",
+ "Language_lo": "lao",
+ "Language_lt": "lituano",
+ "Language_lv": "letón",
+ "Language_mi-Latn": "maorí",
+ "Language_mk": "macedonio",
+ "Language_ml": "malayalam",
+ "Language_mn": "mongol (cirílico)",
+ "Language_mn-Cyrl": "mongol (cirílico)",
+ "Language_mr": "marathi",
+ "Language_ms": "malayo",
+ "Language_mt": "maltés",
+ "Language_nb": "noruego (Bokmål)",
+ "Language_ne": "nepalí",
+ "Language_nl": "neerlandés",
+ "Language_nn": "noruego (Nynorsk)",
+ "Language_nso": "sesotho sa leboa",
+ "Language_oc-Latn": "occitano",
+ "Language_or": "odia",
+ "Language_pa": "Punyabí (Gurmukhi)",
+ "Language_pa-Arab": "Punyabí (árabe)",
+ "Language_pl": "polaco",
+ "Language_prs": "dari",
+ "Language_prs-arab": "dari",
+ "Language_ps": "pashto",
+ "Language_pt": "portugués",
+ "Language_pt-br": "portugués (Brasil)",
+ "Language_pt-pt": "portugués (Portugal)",
+ "Language_quc-Latn": "quiché",
+ "Language_qut": "quiché",
+ "Language_quz-Latn": "quechua",
+ "Language_ro": "rumano",
+ "Language_ru": "ruso",
+ "Language_rw": "kinyarwanda",
+ "Language_sa-Deva": "sánscrito",
+ "Language_sah-Cyrl": "sakha",
+ "Language_sd-Arab": "sindhi (árabe)",
+ "Language_se-Latn": "sami septentrional",
+ "Language_si": "sinhala",
+ "Language_sk": "eslovaco",
+ "Language_sl": "esloveno",
+ "Language_sma-Latn": "sami meridional",
+ "Language_smj-Latn": "sami lule",
+ "Language_smn-Latn": "sami inari",
+ "Language_sms-Latn": "sami skolt",
+ "Language_sq": "albanés",
+ "Language_sr-Cyrl": "serbio (cirílico)",
+ "Language_sr-cyrl-ba": "serbio (cirílico, Bosnia y Herzegovina)",
+ "Language_sr-Latn": "serbio (latino)",
+ "Language_sv": "sueco",
+ "Language_sw": "suajili",
+ "Language_syr-Syrc": "siríaco",
+ "Language_ta": "tamil",
+ "Language_te": "telugu",
+ "Language_tg-Cyrl": "tayiko (cirílico)",
+ "Language_th": "tailandés",
+ "Language_ti": "tigriña",
+ "Language_tk-Latn": "turcomano (latino)",
+ "Language_tn": "setsuana",
+ "Language_tr": "turco",
+ "Language_tt": "tártaro",
+ "Language_tt-Cyrl": "tártaro (cirílico)",
+ "Language_tzm-Latn": "tamazight (latino)",
+ "Language_ug": "uigur",
+ "Language_ug-Arab": "uigur",
+ "Language_uk": "ucraniano",
+ "Language_ur": "urdu",
+ "Language_uz-Cyrl": "uzbeko (cirílico)",
+ "Language_uz-Latn": "uzbeko (latino)",
+ "Language_vi": "vietnamita",
+ "Language_wo-Latn": "wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "yoruba",
+ "Language_yo-Latn": "yoruba",
+ "Language_zh-Hans": "chino (simplificado)",
+ "Language_zh-Hant": "chino (tradicional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Emiratos Árabes Unidos",
+ "Region_Display_AF": "Afganistán",
+ "Region_Display_AG": "Antigua y Barbuda",
+ "Region_Display_AI": "Anguila",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "Samoa Americana",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaiyán",
+ "Region_Display_BA": "Bosnia y Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Bélgica",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Baréin",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benín",
+ "Region_Display_BM": "Bermudas",
+ "Region_Display_BN": "Brunéi",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasil",
+ "Region_Display_BS": "Bahamas",
+ "Region_Display_BT": "Bután",
+ "Region_Display_BW": "Botsuana",
+ "Region_Display_BY": "Belarús",
+ "Region_Display_BZ": "Belice",
+ "Region_Display_CA": "Canadá",
+ "Region_Display_CC": "Islas Cocos",
+ "Region_Display_CD": "Congo (RDC)",
+ "Region_Display_CF": "República Centroafricana",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Suiza",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Islas Cook",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Camerún",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia y Montenegro (exrepública)",
+ "Region_Display_CV": "Cabo Verde",
+ "Region_Display_CW": "Curazao",
+ "Region_Display_CX": "Isla Christmas",
+ "Region_Display_CY": "Chipre",
+ "Region_Display_CZ": "República Checa",
+ "Region_Display_DE": "Alemania",
+ "Region_Display_DJ": "Yibuti",
+ "Region_Display_DK": "Dinamarca",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "República Dominicana",
+ "Region_Display_DZ": "Argelia",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egipto",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "España",
+ "Region_Display_ET": "Etiopía",
+ "Region_Display_FI": "Finlandia",
+ "Region_Display_FK": "Islas Malvinas (Falkland Islands)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Islas Feroe",
+ "Region_Display_FR": "Francia",
+ "Region_Display_GA": "Gabón",
+ "Region_Display_GB": "Reino Unido",
+ "Region_Display_GD": "Granada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "Guayana Francesa",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Groenlandia",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadalupe",
+ "Region_Display_GQ": "Guinea Ecuatorial",
+ "Region_Display_GR": "Grecia",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong RAE",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croacia",
+ "Region_Display_HT": "Haití",
+ "Region_Display_HU": "Hungría",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Irlanda",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Irán",
+ "Region_Display_IS": "Islandia",
+ "Region_Display_IT": "Italia",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordania",
+ "Region_Display_JP": "Japón",
+ "Region_Display_KE": "Kenia",
+ "Region_Display_KG": "Kirguistán",
+ "Region_Display_KH": "Camboya",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoras",
+ "Region_Display_KN": "San Cristóbal y Nieves",
+ "Region_Display_KR": "Corea del Sur",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Islas Caimán",
+ "Region_Display_KZ": "Kazajistán",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Líbano",
+ "Region_Display_LC": "Santa Lucía",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesoto",
+ "Region_Display_LT": "Lituania",
+ "Region_Display_LU": "Luxemburgo",
+ "Region_Display_LV": "Letonia",
+ "Region_Display_LY": "Libia",
+ "Region_Display_MA": "Marruecos",
+ "Region_Display_MC": "Mónaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "San Martín",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Islas Marshall",
+ "Region_Display_MK": "Ex-República Yugoslava de Macedonia",
+ "Region_Display_ML": "Malí",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao RAE",
+ "Region_Display_MP": "Islas Marianas del Norte",
+ "Region_Display_MQ": "Martinica",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauricio",
+ "Region_Display_MV": "Maldivas",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "México",
+ "Region_Display_MY": "Malasia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Nueva Caledonia",
+ "Region_Display_NE": "Níger",
+ "Region_Display_NF": "Isla Norfolk",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Países Bajos",
+ "Region_Display_NO": "Noruega",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Nueva Zelanda",
+ "Region_Display_OM": "Omán",
+ "Region_Display_PA": "Panamá",
+ "Region_Display_PE": "Perú",
+ "Region_Display_PF": "Polinesia Francesa",
+ "Region_Display_PG": "Papúa Nueva Guinea",
+ "Region_Display_PH": "Filipinas",
+ "Region_Display_PK": "Pakistán",
+ "Region_Display_PL": "Polonia",
+ "Region_Display_PM": "San Pedro y Miquelón",
+ "Region_Display_PN": "Islas Pitcairn",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palaos",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Catar",
+ "Region_Display_RE": "Reunión",
+ "Region_Display_RO": "Rumania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Rusia",
+ "Region_Display_RW": "Ruanda",
+ "Region_Display_SA": "Arabia Saudí",
+ "Region_Display_SB": "Islas Salomón",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudán",
+ "Region_Display_SE": "Suecia",
+ "Region_Display_SG": "Singapur",
+ "Region_Display_SH": "Santa Elena, Ascensión y Tristán de Acuña",
+ "Region_Display_SI": "Eslovenia",
+ "Region_Display_SK": "Eslovaquia",
+ "Region_Display_SL": "Sierra Leona",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Surinam",
+ "Region_Display_SS": "Sudán del Sur",
+ "Region_Display_ST": "Santo Tomé y Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Siria",
+ "Region_Display_SZ": "Suazilandia",
+ "Region_Display_TC": "Islas Turcas y Caicos",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Tailandia",
+ "Region_Display_TJ": "Tayikistán",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistán",
+ "Region_Display_TN": "Túnez",
+ "Region_Display_TR": "Turquía",
+ "Region_Display_TT": "Trinidad y Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwán",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ucrania",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Estados Unidos",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistán",
+ "Region_Display_VA": "Santa Sede (Ciudad del Vaticano)",
+ "Region_Display_VC": "San Vicente y las Granadinas",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Islas Vírgenes Británicas",
+ "Region_Display_VI": "Islas Vírgenes de los Estados Unidos",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis y Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "San Eustaquio",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Sudáfrica",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabue"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/es-es.json b/packages/microsoft.bingweather/resources/es-es.json
new file mode 100644
index 00000000..cb09e369
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/es-es.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "3082",
+ "Language_af": "afrikáans",
+ "Language_am": "amárico",
+ "Language_ar": "árabe",
+ "Language_arn-Latn": "mapuche",
+ "Language_as": "asamés",
+ "Language_az": "azerí (latino)",
+ "Language_az-Cyrl": "azerbaiyano (cirílico)",
+ "Language_az-Latn": "azerbaiyano (latino)",
+ "Language_ba-Cyrl": "baskir",
+ "Language_be": "bielorruso",
+ "Language_bg": "búlgaro",
+ "Language_bn": "bangla",
+ "Language_bn-bd": "bangla (Bangladesh)",
+ "Language_bn-in": "bangla (India)",
+ "Language_br-Latn": "bretón",
+ "Language_bs": "bosnio (latino)",
+ "Language_bs-Cyrl": "bosnio (cirílico)",
+ "Language_bs-Latn": "bosnio (latino)",
+ "Language_ca": "catalán",
+ "Language_ca-ES-valencia": "valenciano",
+ "Language_chr": "cheroqui",
+ "Language_chr-Cher": "Cheroqui (cheroqui)",
+ "Language_co-Latn": "corso",
+ "Language_cs": "checo",
+ "Language_cy": "galés",
+ "Language_da": "danés",
+ "Language_de": "alemán",
+ "Language_dsb": "bajo sorbio",
+ "Language_dv": "divehi",
+ "Language_el": "griego",
+ "Language_en": "inglés",
+ "Language_es": "español",
+ "Language_et": "estonio",
+ "Language_eu": "euskera",
+ "Language_fa": "persa",
+ "Language_ff-Latn": "fula",
+ "Language_fi": "finés",
+ "Language_fil-Latn": "filipino",
+ "Language_fo": "feroés",
+ "Language_fr": "francés",
+ "Language_fy": "frisón",
+ "Language_ga": "irlandés",
+ "Language_gd": "gaélico escocés",
+ "Language_gd-Latn": "gaélico escocés",
+ "Language_gl": "gallego",
+ "Language_gsw": "alsaciano",
+ "Language_gu": "gujarati",
+ "Language_ha": "hausa (latino)",
+ "Language_ha-Latn": "hausa (latino)",
+ "Language_he": "hebreo",
+ "Language_hi": "hindi",
+ "Language_hr": "croata",
+ "Language_hsb": "alto sorbio",
+ "Language_hu": "húngaro",
+ "Language_hy": "armenio",
+ "Language_id": "indonesio",
+ "Language_ig": "igbo",
+ "Language_ig-Latn": "igbo",
+ "Language_is": "islandés",
+ "Language_it": "italiano",
+ "Language_iu-Latn": "inuktitut (latino)",
+ "Language_ja": "japonés",
+ "Language_ka": "georgiano",
+ "Language_kk": "kazajo",
+ "Language_kl": "groenlandés",
+ "Language_km": "khmer",
+ "Language_kn": "kannada",
+ "Language_ko": "coreano",
+ "Language_kok": "konkani",
+ "Language_ku": "kurdo",
+ "Language_ku-Arab": "kurdo central",
+ "Language_ky": "kirguís",
+ "Language_ky-Cyrl": "kirguís",
+ "Language_lb": "luxemburgués",
+ "Language_lo": "lao",
+ "Language_lt": "lituano",
+ "Language_lv": "letón",
+ "Language_mi-Latn": "maorí",
+ "Language_mk": "macedonio",
+ "Language_ml": "malayalam",
+ "Language_mn": "mongol (cirílico)",
+ "Language_mn-Cyrl": "mongol (cirílico)",
+ "Language_mr": "marathi",
+ "Language_ms": "malayo",
+ "Language_mt": "maltés",
+ "Language_nb": "noruego (Bokmål)",
+ "Language_ne": "nepalí",
+ "Language_nl": "neerlandés",
+ "Language_nn": "noruego (Nynorsk)",
+ "Language_nso": "sesotho sa leboa",
+ "Language_oc-Latn": "occitano",
+ "Language_or": "odia",
+ "Language_pa": "Punyabí (Gurmukhi)",
+ "Language_pa-Arab": "Punyabí (árabe)",
+ "Language_pl": "polaco",
+ "Language_prs": "dari",
+ "Language_prs-arab": "dari",
+ "Language_ps": "pashto",
+ "Language_pt": "portugués",
+ "Language_pt-br": "portugués (Brasil)",
+ "Language_pt-pt": "portugués (Portugal)",
+ "Language_quc-Latn": "quiché",
+ "Language_qut": "Quiché",
+ "Language_quz-Latn": "quechua",
+ "Language_ro": "rumano",
+ "Language_ru": "ruso",
+ "Language_rw": "kinyarwanda",
+ "Language_sa-Deva": "sánscrito",
+ "Language_sah-Cyrl": "sakha",
+ "Language_sd-Arab": "Sindhi (árabe)",
+ "Language_se-Latn": "sami septentrional",
+ "Language_si": "sinhala",
+ "Language_sk": "eslovaco",
+ "Language_sl": "esloveno",
+ "Language_sma-Latn": "sami meridional",
+ "Language_smj-Latn": "sami lule",
+ "Language_smn-Latn": "sami inari",
+ "Language_sms-Latn": "sami skolt",
+ "Language_sq": "albanés",
+ "Language_sr-Cyrl": "serbio (cirílico)",
+ "Language_sr-cyrl-ba": "serbio (cirílico, Bosnia y Herzegovina)",
+ "Language_sr-Latn": "serbio (latino)",
+ "Language_sv": "sueco",
+ "Language_sw": "suajili",
+ "Language_syr-Syrc": "siríaco",
+ "Language_ta": "tamil",
+ "Language_te": "telugu",
+ "Language_tg-Cyrl": "Tayiko (cirílico)",
+ "Language_th": "tailandés",
+ "Language_ti": "tigriña",
+ "Language_tk-Latn": "Turcomano (latino)",
+ "Language_tn": "setsuana",
+ "Language_tr": "turco",
+ "Language_tt": "tártaro",
+ "Language_tt-Cyrl": "Tártaro (cirílico)",
+ "Language_tzm-Latn": "Tamazight (latino)",
+ "Language_ug": "uigur",
+ "Language_ug-Arab": "uigur",
+ "Language_uk": "ucraniano",
+ "Language_ur": "urdu",
+ "Language_uz-Cyrl": "uzbeko (cirílico)",
+ "Language_uz-Latn": "uzbeko (latino)",
+ "Language_vi": "vietnamita",
+ "Language_wo-Latn": "wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "yoruba",
+ "Language_yo-Latn": "yoruba",
+ "Language_zh-Hans": "chino (simplificado)",
+ "Language_zh-Hant": "chino (tradicional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Emiratos Árabes Unidos",
+ "Region_Display_AF": "Afganistán",
+ "Region_Display_AG": "Antigua y Barbuda",
+ "Region_Display_AI": "Anguila",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "Samoa Americana",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaiyán",
+ "Region_Display_BA": "Bosnia y Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Bélgica",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Baréin",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benín",
+ "Region_Display_BM": "Bermudas",
+ "Region_Display_BN": "Brunéi",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasil",
+ "Region_Display_BS": "Bahamas",
+ "Region_Display_BT": "Bután",
+ "Region_Display_BW": "Botsuana",
+ "Region_Display_BY": "Belarús",
+ "Region_Display_BZ": "Belice",
+ "Region_Display_CA": "Canadá",
+ "Region_Display_CC": "Islas Cocos",
+ "Region_Display_CD": "Congo (RDC)",
+ "Region_Display_CF": "República Centroafricana",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Suiza",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Islas Cook",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Camerún",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia y Montenegro (Ex-República)",
+ "Region_Display_CV": "Cabo Verde",
+ "Region_Display_CW": "Curazao",
+ "Region_Display_CX": "Isla Christmas",
+ "Region_Display_CY": "Chipre",
+ "Region_Display_CZ": "República Checa",
+ "Region_Display_DE": "Alemania",
+ "Region_Display_DJ": "Yibuti",
+ "Region_Display_DK": "Dinamarca",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "República Dominicana",
+ "Region_Display_DZ": "Argelia",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egipto",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "España",
+ "Region_Display_ET": "Etiopía",
+ "Region_Display_FI": "Finlandia",
+ "Region_Display_FK": "Islas Malvinas (Falkland Islands)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Islas Feroe",
+ "Region_Display_FR": "Francia",
+ "Region_Display_GA": "Gabón",
+ "Region_Display_GB": "Reino Unido",
+ "Region_Display_GD": "Granada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "Guayana Francesa",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Groenlandia",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadalupe",
+ "Region_Display_GQ": "Guinea Ecuatorial",
+ "Region_Display_GR": "Grecia",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong RAE",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croacia",
+ "Region_Display_HT": "Haití",
+ "Region_Display_HU": "Hungría",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Irlanda",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Irán",
+ "Region_Display_IS": "Islandia",
+ "Region_Display_IT": "Italia",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordania",
+ "Region_Display_JP": "Japón",
+ "Region_Display_KE": "Kenia",
+ "Region_Display_KG": "Kirguistán",
+ "Region_Display_KH": "Camboya",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoras",
+ "Region_Display_KN": "San Cristóbal y Nieves",
+ "Region_Display_KR": "Corea del Sur",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Islas Caimán",
+ "Region_Display_KZ": "Kazajistán",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Líbano",
+ "Region_Display_LC": "Santa Lucía",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesoto",
+ "Region_Display_LT": "Lituania",
+ "Region_Display_LU": "Luxemburgo",
+ "Region_Display_LV": "Letonia",
+ "Region_Display_LY": "Libia",
+ "Region_Display_MA": "Marruecos",
+ "Region_Display_MC": "Mónaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "San Martín",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Islas Marshall",
+ "Region_Display_MK": "Ex-República Yugoslava de Macedonia",
+ "Region_Display_ML": "Malí",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao RAE",
+ "Region_Display_MP": "Islas Marianas del Norte",
+ "Region_Display_MQ": "Martinica",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauricio",
+ "Region_Display_MV": "Maldivas",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "México",
+ "Region_Display_MY": "Malasia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Nueva Caledonia",
+ "Region_Display_NE": "Níger",
+ "Region_Display_NF": "Isla Norfolk",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Países Bajos",
+ "Region_Display_NO": "Noruega",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Nueva Zelanda",
+ "Region_Display_OM": "Omán",
+ "Region_Display_PA": "Panamá",
+ "Region_Display_PE": "Perú",
+ "Region_Display_PF": "Polinesia Francesa",
+ "Region_Display_PG": "Papúa Nueva Guinea",
+ "Region_Display_PH": "Filipinas",
+ "Region_Display_PK": "Pakistán",
+ "Region_Display_PL": "Polonia",
+ "Region_Display_PM": "San Pedro y Miquelón",
+ "Region_Display_PN": "Islas Pitcairn",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palaos",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Reunión",
+ "Region_Display_RO": "Rumania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Rusia",
+ "Region_Display_RW": "Ruanda",
+ "Region_Display_SA": "Arabia Saudí",
+ "Region_Display_SB": "Islas Salomón",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudán",
+ "Region_Display_SE": "Suecia",
+ "Region_Display_SG": "Singapur",
+ "Region_Display_SH": "Santa Elena, Ascensión y Tristán de Acuña",
+ "Region_Display_SI": "Eslovenia",
+ "Region_Display_SK": "Eslovaquia",
+ "Region_Display_SL": "Sierra Leona",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Surinam",
+ "Region_Display_SS": "Sudán del Sur",
+ "Region_Display_ST": "Santo Tomé y Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Siria",
+ "Region_Display_SZ": "Suazilandia",
+ "Region_Display_TC": "Islas Turcas y Caicos",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Tailandia",
+ "Region_Display_TJ": "Tayikistán",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistán",
+ "Region_Display_TN": "Túnez",
+ "Region_Display_TR": "Turquía",
+ "Region_Display_TT": "Trinidad y Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwán",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ucrania",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Estados Unidos",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistán",
+ "Region_Display_VA": "Santa Sede (Ciudad del Vaticano)",
+ "Region_Display_VC": "San Vicente y las Granadinas",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Islas Vírgenes Británicas",
+ "Region_Display_VI": "Islas Vírgenes de los Estados Unidos",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis y Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "San Eustaquio",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Sudáfrica",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabue"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/es-mx.json b/packages/microsoft.bingweather/resources/es-mx.json
new file mode 100644
index 00000000..7b716f94
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/es-mx.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "2058",
+ "Language_af": "afrikáans",
+ "Language_am": "amárico",
+ "Language_ar": "árabe",
+ "Language_arn-Latn": "mapuche",
+ "Language_as": "asamés",
+ "Language_az": "azerí (latino)",
+ "Language_az-Cyrl": "azerbaiyano (cirílico)",
+ "Language_az-Latn": "azerbaiyano (latino)",
+ "Language_ba-Cyrl": "baskir",
+ "Language_be": "bielorruso",
+ "Language_bg": "búlgaro",
+ "Language_bn": "bangla",
+ "Language_bn-bd": "bangla (Bangladesh)",
+ "Language_bn-in": "bangla (India)",
+ "Language_br-Latn": "bretón",
+ "Language_bs": "bosnio (latino)",
+ "Language_bs-Cyrl": "bosnio (cirílico)",
+ "Language_bs-Latn": "bosnio (latino)",
+ "Language_ca": "catalán",
+ "Language_ca-ES-valencia": "valenciano",
+ "Language_chr": "cheroqui",
+ "Language_chr-Cher": "Cheroqui (cheroqui)",
+ "Language_co-Latn": "corso",
+ "Language_cs": "checo",
+ "Language_cy": "galés",
+ "Language_da": "danés",
+ "Language_de": "alemán",
+ "Language_dsb": "bajo sorbio",
+ "Language_dv": "divehi",
+ "Language_el": "griego",
+ "Language_en": "inglés",
+ "Language_es": "español",
+ "Language_et": "estonio",
+ "Language_eu": "euskera",
+ "Language_fa": "persa",
+ "Language_ff-Latn": "fula",
+ "Language_fi": "finés",
+ "Language_fil-Latn": "filipino",
+ "Language_fo": "feroés",
+ "Language_fr": "francés",
+ "Language_fy": "frisón",
+ "Language_ga": "irlandés",
+ "Language_gd": "gaélico escocés",
+ "Language_gd-Latn": "gaélico escocés",
+ "Language_gl": "gallego",
+ "Language_gsw": "alsaciano",
+ "Language_gu": "gujarati",
+ "Language_ha": "hausa (latino)",
+ "Language_ha-Latn": "hausa (latino)",
+ "Language_he": "hebreo",
+ "Language_hi": "hindi",
+ "Language_hr": "croata",
+ "Language_hsb": "alto sorbio",
+ "Language_hu": "húngaro",
+ "Language_hy": "armenio",
+ "Language_id": "indonesio",
+ "Language_ig": "igbo",
+ "Language_ig-Latn": "igbo",
+ "Language_is": "islandés",
+ "Language_it": "italiano",
+ "Language_iu-Latn": "inuktitut (latino)",
+ "Language_ja": "japonés",
+ "Language_ka": "georgiano",
+ "Language_kk": "kazajo",
+ "Language_kl": "groenlandés",
+ "Language_km": "khmer",
+ "Language_kn": "kannada",
+ "Language_ko": "coreano",
+ "Language_kok": "konkani",
+ "Language_ku": "kurdo",
+ "Language_ku-Arab": "kurdo central",
+ "Language_ky": "kirguís",
+ "Language_ky-Cyrl": "kirguís",
+ "Language_lb": "luxemburgués",
+ "Language_lo": "lao",
+ "Language_lt": "lituano",
+ "Language_lv": "letón",
+ "Language_mi-Latn": "maorí",
+ "Language_mk": "macedonio",
+ "Language_ml": "malayalam",
+ "Language_mn": "mongol (cirílico)",
+ "Language_mn-Cyrl": "mongol (cirílico)",
+ "Language_mr": "marathi",
+ "Language_ms": "malayo",
+ "Language_mt": "maltés",
+ "Language_nb": "noruego (Bokmål)",
+ "Language_ne": "nepalí",
+ "Language_nl": "neerlandés",
+ "Language_nn": "noruego (Nynorsk)",
+ "Language_nso": "sesotho sa leboa",
+ "Language_oc-Latn": "occitano",
+ "Language_or": "odia",
+ "Language_pa": "Punyabí (Gurmukhi)",
+ "Language_pa-Arab": "Punyabí (árabe)",
+ "Language_pl": "polaco",
+ "Language_prs": "dari",
+ "Language_prs-arab": "dari",
+ "Language_ps": "pashto",
+ "Language_pt": "portugués",
+ "Language_pt-br": "portugués (Brasil)",
+ "Language_pt-pt": "portugués (Portugal)",
+ "Language_quc-Latn": "quiché",
+ "Language_qut": "quiché",
+ "Language_quz-Latn": "quechua",
+ "Language_ro": "rumano",
+ "Language_ru": "ruso",
+ "Language_rw": "kinyarwanda",
+ "Language_sa-Deva": "sánscrito",
+ "Language_sah-Cyrl": "sakha",
+ "Language_sd-Arab": "sindhi (árabe)",
+ "Language_se-Latn": "sami septentrional",
+ "Language_si": "sinhala",
+ "Language_sk": "eslovaco",
+ "Language_sl": "esloveno",
+ "Language_sma-Latn": "sami meridional",
+ "Language_smj-Latn": "sami lule",
+ "Language_smn-Latn": "sami inari",
+ "Language_sms-Latn": "sami skolt",
+ "Language_sq": "albanés",
+ "Language_sr-Cyrl": "serbio (cirílico)",
+ "Language_sr-cyrl-ba": "serbio (cirílico, Bosnia y Herzegovina)",
+ "Language_sr-Latn": "serbio (latino)",
+ "Language_sv": "sueco",
+ "Language_sw": "suajili",
+ "Language_syr-Syrc": "siríaco",
+ "Language_ta": "tamil",
+ "Language_te": "telugu",
+ "Language_tg-Cyrl": "tayiko (cirílico)",
+ "Language_th": "tailandés",
+ "Language_ti": "tigriña",
+ "Language_tk-Latn": "turcomano (latino)",
+ "Language_tn": "setsuana",
+ "Language_tr": "turco",
+ "Language_tt": "tártaro",
+ "Language_tt-Cyrl": "tártaro (cirílico)",
+ "Language_tzm-Latn": "tamazight (latino)",
+ "Language_ug": "uigur",
+ "Language_ug-Arab": "uigur",
+ "Language_uk": "ucraniano",
+ "Language_ur": "urdu",
+ "Language_uz-Cyrl": "uzbeko (cirílico)",
+ "Language_uz-Latn": "uzbeko (latino)",
+ "Language_vi": "vietnamita",
+ "Language_wo-Latn": "wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "yoruba",
+ "Language_yo-Latn": "yoruba",
+ "Language_zh-Hans": "chino (simplificado)",
+ "Language_zh-Hant": "chino (tradicional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Emiratos Árabes Unidos",
+ "Region_Display_AF": "Afganistán",
+ "Region_Display_AG": "Antigua y Barbuda",
+ "Region_Display_AI": "Anguila",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "Samoa Americana",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaiyán",
+ "Region_Display_BA": "Bosnia y Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Bélgica",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Baréin",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benín",
+ "Region_Display_BM": "Bermudas",
+ "Region_Display_BN": "Brunéi",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasil",
+ "Region_Display_BS": "Bahamas",
+ "Region_Display_BT": "Bután",
+ "Region_Display_BW": "Botsuana",
+ "Region_Display_BY": "Belarús",
+ "Region_Display_BZ": "Belice",
+ "Region_Display_CA": "Canadá",
+ "Region_Display_CC": "Islas Cocos",
+ "Region_Display_CD": "Congo (RDC)",
+ "Region_Display_CF": "República Centroafricana",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Suiza",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Islas Cook",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Camerún",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia y Montenegro (exrepública)",
+ "Region_Display_CV": "Cabo Verde",
+ "Region_Display_CW": "Curazao",
+ "Region_Display_CX": "Isla Christmas",
+ "Region_Display_CY": "Chipre",
+ "Region_Display_CZ": "República Checa",
+ "Region_Display_DE": "Alemania",
+ "Region_Display_DJ": "Yibuti",
+ "Region_Display_DK": "Dinamarca",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "República Dominicana",
+ "Region_Display_DZ": "Argelia",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egipto",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "España",
+ "Region_Display_ET": "Etiopía",
+ "Region_Display_FI": "Finlandia",
+ "Region_Display_FK": "Islas Malvinas (Falkland Islands)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Islas Feroe",
+ "Region_Display_FR": "Francia",
+ "Region_Display_GA": "Gabón",
+ "Region_Display_GB": "Reino Unido",
+ "Region_Display_GD": "Granada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "Guayana Francesa",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Groenlandia",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadalupe",
+ "Region_Display_GQ": "Guinea Ecuatorial",
+ "Region_Display_GR": "Grecia",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong RAE",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croacia",
+ "Region_Display_HT": "Haití",
+ "Region_Display_HU": "Hungría",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Irlanda",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Irán",
+ "Region_Display_IS": "Islandia",
+ "Region_Display_IT": "Italia",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordania",
+ "Region_Display_JP": "Japón",
+ "Region_Display_KE": "Kenia",
+ "Region_Display_KG": "Kirguistán",
+ "Region_Display_KH": "Camboya",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoras",
+ "Region_Display_KN": "San Cristóbal y Nieves",
+ "Region_Display_KR": "Corea del Sur",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Islas Caimán",
+ "Region_Display_KZ": "Kazajistán",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Líbano",
+ "Region_Display_LC": "Santa Lucía",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesoto",
+ "Region_Display_LT": "Lituania",
+ "Region_Display_LU": "Luxemburgo",
+ "Region_Display_LV": "Letonia",
+ "Region_Display_LY": "Libia",
+ "Region_Display_MA": "Marruecos",
+ "Region_Display_MC": "Mónaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "San Martín",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Islas Marshall",
+ "Region_Display_MK": "Ex-República Yugoslava de Macedonia",
+ "Region_Display_ML": "Malí",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao RAE",
+ "Region_Display_MP": "Islas Marianas del Norte",
+ "Region_Display_MQ": "Martinica",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauricio",
+ "Region_Display_MV": "Maldivas",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "México",
+ "Region_Display_MY": "Malasia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Nueva Caledonia",
+ "Region_Display_NE": "Níger",
+ "Region_Display_NF": "Isla Norfolk",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Países Bajos",
+ "Region_Display_NO": "Noruega",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Nueva Zelanda",
+ "Region_Display_OM": "Omán",
+ "Region_Display_PA": "Panamá",
+ "Region_Display_PE": "Perú",
+ "Region_Display_PF": "Polinesia Francesa",
+ "Region_Display_PG": "Papúa Nueva Guinea",
+ "Region_Display_PH": "Filipinas",
+ "Region_Display_PK": "Pakistán",
+ "Region_Display_PL": "Polonia",
+ "Region_Display_PM": "San Pedro y Miquelón",
+ "Region_Display_PN": "Islas Pitcairn",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palaos",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Catar",
+ "Region_Display_RE": "Reunión",
+ "Region_Display_RO": "Rumania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Rusia",
+ "Region_Display_RW": "Ruanda",
+ "Region_Display_SA": "Arabia Saudí",
+ "Region_Display_SB": "Islas Salomón",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudán",
+ "Region_Display_SE": "Suecia",
+ "Region_Display_SG": "Singapur",
+ "Region_Display_SH": "Santa Elena, Ascensión y Tristán de Acuña",
+ "Region_Display_SI": "Eslovenia",
+ "Region_Display_SK": "Eslovaquia",
+ "Region_Display_SL": "Sierra Leona",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Surinam",
+ "Region_Display_SS": "Sudán del Sur",
+ "Region_Display_ST": "Santo Tomé y Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Siria",
+ "Region_Display_SZ": "Suazilandia",
+ "Region_Display_TC": "Islas Turcas y Caicos",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Tailandia",
+ "Region_Display_TJ": "Tayikistán",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistán",
+ "Region_Display_TN": "Túnez",
+ "Region_Display_TR": "Turquía",
+ "Region_Display_TT": "Trinidad y Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwán",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ucrania",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Estados Unidos",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistán",
+ "Region_Display_VA": "Santa Sede (Ciudad del Vaticano)",
+ "Region_Display_VC": "San Vicente y las Granadinas",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Islas Vírgenes Británicas",
+ "Region_Display_VI": "Islas Vírgenes de los Estados Unidos",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis y Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "San Eustaquio",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Sudáfrica",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabue"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/es.json b/packages/microsoft.bingweather/resources/es.json
new file mode 100644
index 00000000..85da7bf2
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/es.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "10",
+ "Language_af": "afrikáans",
+ "Language_am": "amárico",
+ "Language_ar": "árabe",
+ "Language_arn-Latn": "mapuche",
+ "Language_as": "asamés",
+ "Language_az": "azerí (latino)",
+ "Language_az-Cyrl": "azerbaiyano (cirílico)",
+ "Language_az-Latn": "azerbaiyano (latino)",
+ "Language_ba-Cyrl": "baskir",
+ "Language_be": "bielorruso",
+ "Language_bg": "búlgaro",
+ "Language_bn": "bangla",
+ "Language_bn-bd": "bangla (Bangladesh)",
+ "Language_bn-in": "bangla (India)",
+ "Language_br-Latn": "bretón",
+ "Language_bs": "bosnio (latino)",
+ "Language_bs-Cyrl": "bosnio (cirílico)",
+ "Language_bs-Latn": "bosnio (latino)",
+ "Language_ca": "catalán",
+ "Language_ca-ES-valencia": "valenciano",
+ "Language_chr": "cheroqui",
+ "Language_chr-Cher": "Cheroqui (cheroqui)",
+ "Language_co-Latn": "corso",
+ "Language_cs": "checo",
+ "Language_cy": "galés",
+ "Language_da": "danés",
+ "Language_de": "alemán",
+ "Language_dsb": "bajo sorbio",
+ "Language_dv": "divehi",
+ "Language_el": "griego",
+ "Language_en": "inglés",
+ "Language_es": "español",
+ "Language_et": "estonio",
+ "Language_eu": "euskera",
+ "Language_fa": "persa",
+ "Language_ff-Latn": "fula",
+ "Language_fi": "finés",
+ "Language_fil-Latn": "filipino",
+ "Language_fo": "feroés",
+ "Language_fr": "francés",
+ "Language_fy": "frisón",
+ "Language_ga": "irlandés",
+ "Language_gd": "gaélico escocés",
+ "Language_gd-Latn": "gaélico escocés",
+ "Language_gl": "gallego",
+ "Language_gsw": "alsaciano",
+ "Language_gu": "gujarati",
+ "Language_ha": "hausa (latino)",
+ "Language_ha-Latn": "hausa (latino)",
+ "Language_he": "hebreo",
+ "Language_hi": "hindi",
+ "Language_hr": "croata",
+ "Language_hsb": "alto sorbio",
+ "Language_hu": "húngaro",
+ "Language_hy": "armenio",
+ "Language_id": "indonesio",
+ "Language_ig": "igbo",
+ "Language_ig-Latn": "igbo",
+ "Language_is": "islandés",
+ "Language_it": "italiano",
+ "Language_iu-Latn": "inuktitut (latino)",
+ "Language_ja": "japonés",
+ "Language_ka": "georgiano",
+ "Language_kk": "kazajo",
+ "Language_kl": "groenlandés",
+ "Language_km": "khmer",
+ "Language_kn": "kannada",
+ "Language_ko": "coreano",
+ "Language_kok": "konkani",
+ "Language_ku": "kurdo",
+ "Language_ku-Arab": "kurdo central",
+ "Language_ky": "kirguís",
+ "Language_ky-Cyrl": "kirguís",
+ "Language_lb": "luxemburgués",
+ "Language_lo": "lao",
+ "Language_lt": "lituano",
+ "Language_lv": "letón",
+ "Language_mi-Latn": "maorí",
+ "Language_mk": "macedonio",
+ "Language_ml": "malayalam",
+ "Language_mn": "mongol (cirílico)",
+ "Language_mn-Cyrl": "mongol (cirílico)",
+ "Language_mr": "marathi",
+ "Language_ms": "malayo",
+ "Language_mt": "maltés",
+ "Language_nb": "noruego (Bokmål)",
+ "Language_ne": "nepalí",
+ "Language_nl": "neerlandés",
+ "Language_nn": "noruego (Nynorsk)",
+ "Language_nso": "sesotho sa leboa",
+ "Language_oc-Latn": "occitano",
+ "Language_or": "odia",
+ "Language_pa": "Punyabí (Gurmukhi)",
+ "Language_pa-Arab": "Punyabí (árabe)",
+ "Language_pl": "polaco",
+ "Language_prs": "dari",
+ "Language_prs-arab": "dari",
+ "Language_ps": "pashto",
+ "Language_pt": "portugués",
+ "Language_pt-br": "portugués (Brasil)",
+ "Language_pt-pt": "portugués (Portugal)",
+ "Language_quc-Latn": "quiché",
+ "Language_qut": "quiché",
+ "Language_quz-Latn": "quechua",
+ "Language_ro": "rumano",
+ "Language_ru": "ruso",
+ "Language_rw": "kinyarwanda",
+ "Language_sa-Deva": "sánscrito",
+ "Language_sah-Cyrl": "sakha",
+ "Language_sd-Arab": "sindhi (árabe)",
+ "Language_se-Latn": "sami septentrional",
+ "Language_si": "sinhala",
+ "Language_sk": "eslovaco",
+ "Language_sl": "esloveno",
+ "Language_sma-Latn": "sami meridional",
+ "Language_smj-Latn": "sami lule",
+ "Language_smn-Latn": "sami inari",
+ "Language_sms-Latn": "sami skolt",
+ "Language_sq": "albanés",
+ "Language_sr-Cyrl": "serbio (cirílico)",
+ "Language_sr-cyrl-ba": "serbio (cirílico, Bosnia y Herzegovina)",
+ "Language_sr-Latn": "serbio (latino)",
+ "Language_sv": "sueco",
+ "Language_sw": "suajili",
+ "Language_syr-Syrc": "siríaco",
+ "Language_ta": "tamil",
+ "Language_te": "telugu",
+ "Language_tg-Cyrl": "tayiko (cirílico)",
+ "Language_th": "tailandés",
+ "Language_ti": "tigriña",
+ "Language_tk-Latn": "turcomano (latino)",
+ "Language_tn": "setsuana",
+ "Language_tr": "turco",
+ "Language_tt": "tártaro",
+ "Language_tt-Cyrl": "tártaro (cirílico)",
+ "Language_tzm-Latn": "tamazight (latino)",
+ "Language_ug": "uigur",
+ "Language_ug-Arab": "uigur",
+ "Language_uk": "ucraniano",
+ "Language_ur": "urdu",
+ "Language_uz-Cyrl": "uzbeko (cirílico)",
+ "Language_uz-Latn": "uzbeko (latino)",
+ "Language_vi": "vietnamita",
+ "Language_wo-Latn": "wolof",
+ "Language_xh": "isiXhosa",
+ "Language_yo": "yoruba",
+ "Language_yo-Latn": "yoruba",
+ "Language_zh-Hans": "chino (simplificado)",
+ "Language_zh-Hant": "chino (tradicional)",
+ "Language_zu": "isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Emiratos Árabes Unidos",
+ "Region_Display_AF": "Afganistán",
+ "Region_Display_AG": "Antigua y Barbuda",
+ "Region_Display_AI": "Anguila",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "Samoa Americana",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaiyán",
+ "Region_Display_BA": "Bosnia y Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Bélgica",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Baréin",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benín",
+ "Region_Display_BM": "Bermudas",
+ "Region_Display_BN": "Brunéi",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasil",
+ "Region_Display_BS": "Bahamas",
+ "Region_Display_BT": "Bután",
+ "Region_Display_BW": "Botsuana",
+ "Region_Display_BY": "Belarús",
+ "Region_Display_BZ": "Belice",
+ "Region_Display_CA": "Canadá",
+ "Region_Display_CC": "Islas Cocos",
+ "Region_Display_CD": "Congo (RDC)",
+ "Region_Display_CF": "República Centroafricana",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Suiza",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Islas Cook",
+ "Region_Display_CL": "Chile",
+ "Region_Display_CM": "Camerún",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Colombia",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbia y Montenegro (exrepública)",
+ "Region_Display_CV": "Cabo Verde",
+ "Region_Display_CW": "Curazao",
+ "Region_Display_CX": "Isla Christmas",
+ "Region_Display_CY": "Chipre",
+ "Region_Display_CZ": "República Checa",
+ "Region_Display_DE": "Alemania",
+ "Region_Display_DJ": "Yibuti",
+ "Region_Display_DK": "Dinamarca",
+ "Region_Display_DM": "Dominica",
+ "Region_Display_DO": "República Dominicana",
+ "Region_Display_DZ": "Argelia",
+ "Region_Display_EC": "Ecuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Egipto",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "España",
+ "Region_Display_ET": "Etiopía",
+ "Region_Display_FI": "Finlandia",
+ "Region_Display_FK": "Islas Malvinas (Falkland Islands)",
+ "Region_Display_FM": "Micronesia",
+ "Region_Display_FO": "Islas Feroe",
+ "Region_Display_FR": "Francia",
+ "Region_Display_GA": "Gabón",
+ "Region_Display_GB": "Reino Unido",
+ "Region_Display_GD": "Granada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "Guayana Francesa",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Groenlandia",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadalupe",
+ "Region_Display_GQ": "Guinea Ecuatorial",
+ "Region_Display_GR": "Grecia",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong RAE",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croacia",
+ "Region_Display_HT": "Haití",
+ "Region_Display_HU": "Hungría",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Irlanda",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Irán",
+ "Region_Display_IS": "Islandia",
+ "Region_Display_IT": "Italia",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaica",
+ "Region_Display_JO": "Jordania",
+ "Region_Display_JP": "Japón",
+ "Region_Display_KE": "Kenia",
+ "Region_Display_KG": "Kirguistán",
+ "Region_Display_KH": "Camboya",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comoras",
+ "Region_Display_KN": "San Cristóbal y Nieves",
+ "Region_Display_KR": "Corea del Sur",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Islas Caimán",
+ "Region_Display_KZ": "Kazajistán",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Líbano",
+ "Region_Display_LC": "Santa Lucía",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesoto",
+ "Region_Display_LT": "Lituania",
+ "Region_Display_LU": "Luxemburgo",
+ "Region_Display_LV": "Letonia",
+ "Region_Display_LY": "Libia",
+ "Region_Display_MA": "Marruecos",
+ "Region_Display_MC": "Mónaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "San Martín",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Islas Marshall",
+ "Region_Display_MK": "Ex-República Yugoslava de Macedonia",
+ "Region_Display_ML": "Malí",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Macao RAE",
+ "Region_Display_MP": "Islas Marianas del Norte",
+ "Region_Display_MQ": "Martinica",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauricio",
+ "Region_Display_MV": "Maldivas",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "México",
+ "Region_Display_MY": "Malasia",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Nueva Caledonia",
+ "Region_Display_NE": "Níger",
+ "Region_Display_NF": "Isla Norfolk",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Países Bajos",
+ "Region_Display_NO": "Noruega",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Nueva Zelanda",
+ "Region_Display_OM": "Omán",
+ "Region_Display_PA": "Panamá",
+ "Region_Display_PE": "Perú",
+ "Region_Display_PF": "Polinesia Francesa",
+ "Region_Display_PG": "Papúa Nueva Guinea",
+ "Region_Display_PH": "Filipinas",
+ "Region_Display_PK": "Pakistán",
+ "Region_Display_PL": "Polonia",
+ "Region_Display_PM": "San Pedro y Miquelón",
+ "Region_Display_PN": "Islas Pitcairn",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palaos",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Catar",
+ "Region_Display_RE": "Reunión",
+ "Region_Display_RO": "Rumania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Rusia",
+ "Region_Display_RW": "Ruanda",
+ "Region_Display_SA": "Arabia Saudí",
+ "Region_Display_SB": "Islas Salomón",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudán",
+ "Region_Display_SE": "Suecia",
+ "Region_Display_SG": "Singapur",
+ "Region_Display_SH": "Santa Elena, Ascensión y Tristán de Acuña",
+ "Region_Display_SI": "Eslovenia",
+ "Region_Display_SK": "Eslovaquia",
+ "Region_Display_SL": "Sierra Leona",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Surinam",
+ "Region_Display_SS": "Sudán del Sur",
+ "Region_Display_ST": "Santo Tomé y Príncipe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Siria",
+ "Region_Display_SZ": "Suazilandia",
+ "Region_Display_TC": "Islas Turcas y Caicos",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Tailandia",
+ "Region_Display_TJ": "Tayikistán",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistán",
+ "Region_Display_TN": "Túnez",
+ "Region_Display_TR": "Turquía",
+ "Region_Display_TT": "Trinidad y Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwán",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ucrania",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Estados Unidos",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistán",
+ "Region_Display_VA": "Santa Sede (Ciudad del Vaticano)",
+ "Region_Display_VC": "San Vicente y las Granadinas",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Islas Vírgenes Británicas",
+ "Region_Display_VI": "Islas Vírgenes de los Estados Unidos",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis y Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "San Eustaquio",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yemen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Sudáfrica",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabue"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/fr-be.json b/packages/microsoft.bingweather/resources/fr-be.json
new file mode 100644
index 00000000..f7fd442b
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/fr-be.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "2060",
+ "Language_af": "afrikaans",
+ "Language_am": "amharique",
+ "Language_ar": "arabe",
+ "Language_arn-Latn": "mapudungun",
+ "Language_as": "assamais",
+ "Language_az": "azéri (latin)",
+ "Language_az-Cyrl": "azerbaïdjanais (cyrillique)",
+ "Language_az-Latn": "azerbaïdjanais (latin)",
+ "Language_ba-Cyrl": "bachkir",
+ "Language_be": "biélorusse",
+ "Language_bg": "bulgare",
+ "Language_bn": "bangla",
+ "Language_bn-bd": "bangla (Bangladesh)",
+ "Language_bn-in": "bangla (Inde)",
+ "Language_br-Latn": "breton",
+ "Language_bs": "bosniaque (latin)",
+ "Language_bs-Cyrl": "bosniaque (cyrillique)",
+ "Language_bs-Latn": "bosniaque (latin)",
+ "Language_ca": "catalan",
+ "Language_ca-ES-valencia": "valencien",
+ "Language_chr": "cherokee",
+ "Language_chr-Cher": "cherokee (cherokee)",
+ "Language_co-Latn": "corse",
+ "Language_cs": "tchèque",
+ "Language_cy": "gallois",
+ "Language_da": "danois",
+ "Language_de": "allemand",
+ "Language_dsb": "bas-sorabe",
+ "Language_dv": "maldivien",
+ "Language_el": "grec",
+ "Language_en": "anglais",
+ "Language_es": "espagnol",
+ "Language_et": "estonien",
+ "Language_eu": "basque",
+ "Language_fa": "persan",
+ "Language_ff-Latn": "peul",
+ "Language_fi": "finnois",
+ "Language_fil-Latn": "filipino",
+ "Language_fo": "féroïen",
+ "Language_fr": "français",
+ "Language_fy": "frison",
+ "Language_ga": "irlandais",
+ "Language_gd": "gaélique écossais",
+ "Language_gd-Latn": "gaélique écossais",
+ "Language_gl": "galicien",
+ "Language_gsw": "alsacien",
+ "Language_gu": "goudjrati",
+ "Language_ha": "haoussa",
+ "Language_ha-Latn": "haoussa",
+ "Language_he": "hébreu",
+ "Language_hi": "hindi",
+ "Language_hr": "croate",
+ "Language_hsb": "haut-sorabe",
+ "Language_hu": "hongrois",
+ "Language_hy": "arménien",
+ "Language_id": "indonésien",
+ "Language_ig": "igbo",
+ "Language_ig-Latn": "igbo",
+ "Language_is": "islandais",
+ "Language_it": "italien",
+ "Language_iu-Latn": "inuktitut (latin)",
+ "Language_ja": "japonais",
+ "Language_ka": "géorgien",
+ "Language_kk": "kazakh",
+ "Language_kl": "groenlandais",
+ "Language_km": "khmer",
+ "Language_kn": "kannada",
+ "Language_ko": "coréen",
+ "Language_kok": "konkani",
+ "Language_ku": "kurde",
+ "Language_ku-Arab": "kurde central",
+ "Language_ky": "kirghiz",
+ "Language_ky-Cyrl": "kirghiz",
+ "Language_lb": "luxembourgeois",
+ "Language_lo": "lao",
+ "Language_lt": "lituanien",
+ "Language_lv": "letton",
+ "Language_mi-Latn": "maori",
+ "Language_mk": "macédonien",
+ "Language_ml": "malayalam",
+ "Language_mn": "mongol (cyrillique)",
+ "Language_mn-Cyrl": "mongol (cyrillique)",
+ "Language_mr": "marathe",
+ "Language_ms": "malais",
+ "Language_mt": "maltais",
+ "Language_nb": "norvégien (bokmål)",
+ "Language_ne": "népalais",
+ "Language_nl": "néerlandais",
+ "Language_nn": "norvégien (nynorsk)",
+ "Language_nso": "sesotho sa leboa",
+ "Language_oc-Latn": "occitan",
+ "Language_or": "odia",
+ "Language_pa": "pendjabi (gurmukhi)",
+ "Language_pa-Arab": "pendjabi (arabe)",
+ "Language_pl": "polonais",
+ "Language_prs": "dari",
+ "Language_prs-arab": "dari",
+ "Language_ps": "pachto",
+ "Language_pt": "portugais",
+ "Language_pt-br": "portugais (Brésil)",
+ "Language_pt-pt": "portugais (Portugal)",
+ "Language_quc-Latn": "quiché",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "quechua",
+ "Language_ro": "roumain",
+ "Language_ru": "russe",
+ "Language_rw": "kinyarwanda",
+ "Language_sa-Deva": "sanskrit",
+ "Language_sah-Cyrl": "iakoute",
+ "Language_sd-Arab": "sindhi (arabe)",
+ "Language_se-Latn": "same du Nord",
+ "Language_si": "cinghalais",
+ "Language_sk": "slovaque",
+ "Language_sl": "slovène",
+ "Language_sma-Latn": "same du Sud",
+ "Language_smj-Latn": "same de Lule",
+ "Language_smn-Latn": "same d'Inari",
+ "Language_sms-Latn": "same de Skolt",
+ "Language_sq": "albanais",
+ "Language_sr-Cyrl": "serbe (cyrillique)",
+ "Language_sr-cyrl-ba": "serbe (cyrillique, Bosnie-Herzégovine)",
+ "Language_sr-Latn": "serbe (latin)",
+ "Language_sv": "suédois",
+ "Language_sw": "kiswahili",
+ "Language_syr-Syrc": "syriaque",
+ "Language_ta": "tamoul",
+ "Language_te": "telugu",
+ "Language_tg-Cyrl": "tadjik (cyrillique)",
+ "Language_th": "thaï",
+ "Language_ti": "tigrigna",
+ "Language_tk-Latn": "turkmène (latin)",
+ "Language_tn": "tswana",
+ "Language_tr": "turc",
+ "Language_tt": "tatar",
+ "Language_tt-Cyrl": "tatar (cyrillique)",
+ "Language_tzm-Latn": "tamazight (latin)",
+ "Language_ug": "ouïgour",
+ "Language_ug-Arab": "ouïgour",
+ "Language_uk": "ukrainien",
+ "Language_ur": "ourdou",
+ "Language_uz-Cyrl": "ouszbek (cyrillique)",
+ "Language_uz-Latn": "ouszbek (latin)",
+ "Language_vi": "vietnamien",
+ "Language_wo-Latn": "wolof",
+ "Language_xh": "xhosa",
+ "Language_yo": "yorouba",
+ "Language_yo-Latn": "yorouba",
+ "Language_zh-Hans": "chinois (simplifié)",
+ "Language_zh-Hant": "chinois (traditionnel)",
+ "Language_zu": "zoulou",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorre",
+ "Region_Display_AE": "Émirats arabes unis",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua-et-Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albanie",
+ "Region_Display_AM": "Arménie",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentine",
+ "Region_Display_AS": "Samoa américaines",
+ "Region_Display_AT": "Autriche",
+ "Region_Display_AU": "Australie",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaïdjan",
+ "Region_Display_BA": "Bosnie-Herzégovine",
+ "Region_Display_BB": "Barbade",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgique",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgarie",
+ "Region_Display_BH": "Bahreïn",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Bénin",
+ "Region_Display_BM": "Bermudes",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivie",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brésil",
+ "Region_Display_BS": "Les Bahamas",
+ "Region_Display_BT": "Bhoutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Bélarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos (Keeling) (îles)",
+ "Region_Display_CD": "Congo (République démocratique du)",
+ "Region_Display_CF": "République centrafricaine",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Suisse",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Cook (îles)",
+ "Region_Display_CL": "Chili",
+ "Region_Display_CM": "Cameroun",
+ "Region_Display_CN": "Chine",
+ "Region_Display_CO": "Colombie",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbie et Monténégro (Ancien)",
+ "Region_Display_CV": "Cabo Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas (île)",
+ "Region_Display_CY": "Chypre",
+ "Region_Display_CZ": "République tchèque",
+ "Region_Display_DE": "Allemagne",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Danemark",
+ "Region_Display_DM": "Dominique",
+ "Region_Display_DO": "République dominicaine",
+ "Region_Display_DZ": "Algérie",
+ "Region_Display_EC": "Équateur",
+ "Region_Display_EE": "Estonie",
+ "Region_Display_EG": "Égypte",
+ "Region_Display_ER": "Érythrée",
+ "Region_Display_ES": "Espagne",
+ "Region_Display_ET": "Éthiopie",
+ "Region_Display_FI": "Finlande",
+ "Region_Display_FK": "Falkland (îles Falkland ou Malouines)",
+ "Region_Display_FM": "Micronésie",
+ "Region_Display_FO": "Féroé (îles)",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "Royaume-Uni",
+ "Region_Display_GD": "Grenade",
+ "Region_Display_GE": "Géorgie",
+ "Region_Display_GF": "Guyane française",
+ "Region_Display_GG": "Guernesey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Groenland",
+ "Region_Display_GM": "Gambie",
+ "Region_Display_GN": "Guinée",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Guinée équatoriale",
+ "Region_Display_GR": "Grèce",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinée-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong (R.A.S.)",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatie",
+ "Region_Display_HT": "Haïti",
+ "Region_Display_HU": "Hongrie",
+ "Region_Display_ID": "Indonésie",
+ "Region_Display_IE": "Irlande",
+ "Region_Display_IL": "Israël",
+ "Region_Display_IN": "Inde",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Islande",
+ "Region_Display_IT": "Italie",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaïque",
+ "Region_Display_JO": "Jordanie",
+ "Region_Display_JP": "Japon",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kirghizistan",
+ "Region_Display_KH": "Cambodge",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comores",
+ "Region_Display_KN": "Saint-Kitts-et-Nevis",
+ "Region_Display_KR": "Corée du Sud",
+ "Region_Display_KW": "Koweït",
+ "Region_Display_KY": "Caïman (îles)",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Liban",
+ "Region_Display_LC": "Sainte-Lucie",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lituanie",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Lettonie",
+ "Region_Display_LY": "Libye",
+ "Region_Display_MA": "Maroc",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Monténégro",
+ "Region_Display_MF": "Saint-Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall (îles)",
+ "Region_Display_MK": "Ex-République yougoslave de Macédoine",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolie",
+ "Region_Display_MO": "Macao (R.A.S.)",
+ "Region_Display_MP": "Mariannes du Nord (îles)",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritanie",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malte",
+ "Region_Display_MU": "Maurice",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexique",
+ "Region_Display_MY": "Malaisie",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibie",
+ "Region_Display_NC": "Nouvelle-Calédonie",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk (île)",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Pays-Bas",
+ "Region_Display_NO": "Norvège",
+ "Region_Display_NP": "Népal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Nouvelle-Zélande",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Pérou",
+ "Region_Display_PF": "Polynésie française",
+ "Region_Display_PG": "Papouasie-Nouvelle-Guinée",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Pologne",
+ "Region_Display_PM": "Saint-Pierre-et-Miquelon",
+ "Region_Display_PN": "Pitcairn (îles)",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Réunion",
+ "Region_Display_RO": "Roumanie",
+ "Region_Display_RS": "Serbie",
+ "Region_Display_RU": "Russie",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Arabie saoudite",
+ "Region_Display_SB": "Salomon (îles)",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Soudan",
+ "Region_Display_SE": "Suède",
+ "Region_Display_SG": "Singapour",
+ "Region_Display_SH": "Sainte-Hélène, Ascension et Tristan da Cunha",
+ "Region_Display_SI": "Slovénie",
+ "Region_Display_SK": "Slovaquie",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "Saint-Marin",
+ "Region_Display_SN": "Sénégal",
+ "Region_Display_SO": "Somalie",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "Soudan du Sud",
+ "Region_Display_ST": "São Tomé et Príncipe",
+ "Region_Display_SV": "Salvador",
+ "Region_Display_SX": "Saint-Martin (Royaume des Pays-Bas)",
+ "Region_Display_SY": "Syrie",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks et Caicos (îles)",
+ "Region_Display_TD": "Tchad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thaïlande",
+ "Region_Display_TJ": "Tadjikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor oriental",
+ "Region_Display_TM": "Turkménistan",
+ "Region_Display_TN": "Tunisie",
+ "Region_Display_TR": "Turquie",
+ "Region_Display_TT": "Trinité-et-Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taïwan",
+ "Region_Display_TZ": "Tanzanie",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Ouganda",
+ "Region_Display_US": "États-Unis",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Ouzbékistan",
+ "Region_Display_VA": "Saint-Siège (Cité du Vatican)",
+ "Region_Display_VC": "Saint-Vincent-et-les Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Îles Vierges britanniques",
+ "Region_Display_VI": "Îles Vierges américaines",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis-et-Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Saint-Eustache",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yémen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Afrique du Sud",
+ "Region_Display_ZM": "Zambie",
+ "Region_Display_ZW": "Zimbabwe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/fr-ca.json b/packages/microsoft.bingweather/resources/fr-ca.json
new file mode 100644
index 00000000..ed19af8e
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/fr-ca.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "3084",
+ "Language_af": "afrikaans",
+ "Language_am": "amharique",
+ "Language_ar": "arabe",
+ "Language_arn-Latn": "mapudungun",
+ "Language_as": "assamais",
+ "Language_az": "azéri (latin)",
+ "Language_az-Cyrl": "azerbaïdjanais (cyrillique)",
+ "Language_az-Latn": "azerbaïdjanais (latin)",
+ "Language_ba-Cyrl": "bachkir",
+ "Language_be": "bélarusse",
+ "Language_bg": "bulgare",
+ "Language_bn": "bangla",
+ "Language_bn-bd": "bangla (Bangladesh)",
+ "Language_bn-in": "bangla (Inde)",
+ "Language_br-Latn": "breton",
+ "Language_bs": "bosniaque (latin)",
+ "Language_bs-Cyrl": "bosniaque (cyrillique)",
+ "Language_bs-Latn": "bosniaque (latin)",
+ "Language_ca": "catalan",
+ "Language_ca-ES-valencia": "valencien",
+ "Language_chr": "cherokee",
+ "Language_chr-Cher": "cherokee (cherokee)",
+ "Language_co-Latn": "corse",
+ "Language_cs": "tchèque",
+ "Language_cy": "gallois",
+ "Language_da": "danois",
+ "Language_de": "allemand",
+ "Language_dsb": "bas-sorabe",
+ "Language_dv": "maldivien",
+ "Language_el": "grec",
+ "Language_en": "anglais",
+ "Language_es": "espagnol",
+ "Language_et": "estonien",
+ "Language_eu": "basque",
+ "Language_fa": "persan",
+ "Language_ff-Latn": "peul",
+ "Language_fi": "finnois",
+ "Language_fil-Latn": "filipino",
+ "Language_fo": "féroïen",
+ "Language_fr": "français",
+ "Language_fy": "frison",
+ "Language_ga": "irlandais",
+ "Language_gd": "gaélique écossais",
+ "Language_gd-Latn": "gaélique écossais",
+ "Language_gl": "galicien",
+ "Language_gsw": "alsacien",
+ "Language_gu": "goudjrati",
+ "Language_ha": "haoussa",
+ "Language_ha-Latn": "haoussa",
+ "Language_he": "hébreu",
+ "Language_hi": "hindi",
+ "Language_hr": "croate",
+ "Language_hsb": "haut-sorabe",
+ "Language_hu": "hongrois",
+ "Language_hy": "arménien",
+ "Language_id": "indonésien",
+ "Language_ig": "igbo",
+ "Language_ig-Latn": "igbo",
+ "Language_is": "islandais",
+ "Language_it": "italien",
+ "Language_iu-Latn": "inuktitut (latin)",
+ "Language_ja": "japonais",
+ "Language_ka": "géorgien",
+ "Language_kk": "kazakh",
+ "Language_kl": "groenlandais",
+ "Language_km": "khmer",
+ "Language_kn": "kannada",
+ "Language_ko": "coréen",
+ "Language_kok": "konkani",
+ "Language_ku": "kurde",
+ "Language_ku-Arab": "kurde central",
+ "Language_ky": "kirghiz",
+ "Language_ky-Cyrl": "kirghiz",
+ "Language_lb": "luxembourgeois",
+ "Language_lo": "lao",
+ "Language_lt": "lituanien",
+ "Language_lv": "letton",
+ "Language_mi-Latn": "maori",
+ "Language_mk": "macédonien",
+ "Language_ml": "malayalam",
+ "Language_mn": "mongol (cyrillique)",
+ "Language_mn-Cyrl": "mongol (cyrillique)",
+ "Language_mr": "marathe",
+ "Language_ms": "malais",
+ "Language_mt": "maltais",
+ "Language_nb": "norvégien (bokmål)",
+ "Language_ne": "népalais",
+ "Language_nl": "néerlandais",
+ "Language_nn": "norvégien (nynorsk)",
+ "Language_nso": "sesotho sa leboa",
+ "Language_oc-Latn": "occitan",
+ "Language_or": "odia",
+ "Language_pa": "pendjabi (gurmukhi)",
+ "Language_pa-Arab": "pendjabi (arabe)",
+ "Language_pl": "polonais",
+ "Language_prs": "dari",
+ "Language_prs-arab": "dari",
+ "Language_ps": "pachto",
+ "Language_pt": "portugais",
+ "Language_pt-br": "portugais (Brésil)",
+ "Language_pt-pt": "portugais (Portugal)",
+ "Language_quc-Latn": "quiché",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "quechua",
+ "Language_ro": "roumain",
+ "Language_ru": "russe",
+ "Language_rw": "kinyarwanda",
+ "Language_sa-Deva": "sanskrit",
+ "Language_sah-Cyrl": "iakoute",
+ "Language_sd-Arab": "sindhi (arabe)",
+ "Language_se-Latn": "same du Nord",
+ "Language_si": "cinghalais",
+ "Language_sk": "slovaque",
+ "Language_sl": "slovène",
+ "Language_sma-Latn": "same du Sud",
+ "Language_smj-Latn": "same de Lule",
+ "Language_smn-Latn": "same d'Inari",
+ "Language_sms-Latn": "same de Skolt",
+ "Language_sq": "albanais",
+ "Language_sr-Cyrl": "serbe (cyrillique)",
+ "Language_sr-cyrl-ba": "serbe (cyrillique, Bosnie-Herzégovine)",
+ "Language_sr-Latn": "serbe (latin)",
+ "Language_sv": "suédois",
+ "Language_sw": "kiswahili",
+ "Language_syr-Syrc": "syriaque",
+ "Language_ta": "tamoul",
+ "Language_te": "telugu",
+ "Language_tg-Cyrl": "tadjik (cyrillique)",
+ "Language_th": "thaï",
+ "Language_ti": "tigrigna",
+ "Language_tk-Latn": "turkmène (latin)",
+ "Language_tn": "tswana",
+ "Language_tr": "turc",
+ "Language_tt": "tatar",
+ "Language_tt-Cyrl": "tatar (cyrillique)",
+ "Language_tzm-Latn": "tamazight (latin)",
+ "Language_ug": "ouïgour",
+ "Language_ug-Arab": "ouïgour",
+ "Language_uk": "ukrainien",
+ "Language_ur": "ourdou",
+ "Language_uz-Cyrl": "ouszbek (cyrillique)",
+ "Language_uz-Latn": "ouszbek (latin)",
+ "Language_vi": "vietnamien",
+ "Language_wo-Latn": "wolof",
+ "Language_xh": "xhosa",
+ "Language_yo": "yorouba",
+ "Language_yo-Latn": "yorouba",
+ "Language_zh-Hans": "chinois (simplifié)",
+ "Language_zh-Hant": "chinois (traditionnel)",
+ "Language_zu": "zoulou",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorre",
+ "Region_Display_AE": "Émirats arabes unis",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua-et-Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albanie",
+ "Region_Display_AM": "Arménie",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentine",
+ "Region_Display_AS": "Samoa américaines",
+ "Region_Display_AT": "Autriche",
+ "Region_Display_AU": "Australie",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaïdjan",
+ "Region_Display_BA": "Bosnie-Herzégovine",
+ "Region_Display_BB": "Barbade",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgique",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgarie",
+ "Region_Display_BH": "Bahreïn",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Bénin",
+ "Region_Display_BM": "Bermudes",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivie",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brésil",
+ "Region_Display_BS": "Les Bahamas",
+ "Region_Display_BT": "Bhoutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Bélarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos-Keeling (îles)",
+ "Region_Display_CD": "Congo (République démocratique du)",
+ "Region_Display_CF": "République centrafricaine",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Suisse",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Cook (îles)",
+ "Region_Display_CL": "Chili",
+ "Region_Display_CM": "Cameroun",
+ "Region_Display_CN": "Chine",
+ "Region_Display_CO": "Colombie",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbie et Monténégro (Ancien)",
+ "Region_Display_CV": "Cabo Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas (île)",
+ "Region_Display_CY": "Chypre",
+ "Region_Display_CZ": "République tchèque",
+ "Region_Display_DE": "Allemagne",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Danemark",
+ "Region_Display_DM": "Dominique",
+ "Region_Display_DO": "République dominicaine",
+ "Region_Display_DZ": "Algérie",
+ "Region_Display_EC": "Équateur",
+ "Region_Display_EE": "Estonie",
+ "Region_Display_EG": "Égypte",
+ "Region_Display_ER": "Érythrée",
+ "Region_Display_ES": "Espagne",
+ "Region_Display_ET": "Éthiopie",
+ "Region_Display_FI": "Finlande",
+ "Region_Display_FK": "Falkland (îles Falkland ou Malouines)",
+ "Region_Display_FM": "Micronésie",
+ "Region_Display_FO": "Féroé (îles)",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "Royaume-Uni",
+ "Region_Display_GD": "Grenade",
+ "Region_Display_GE": "Géorgie",
+ "Region_Display_GF": "Guyane française",
+ "Region_Display_GG": "Guernesey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Groenland",
+ "Region_Display_GM": "Gambie",
+ "Region_Display_GN": "Guinée",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Guinée équatoriale",
+ "Region_Display_GR": "Grèce",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinée-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong (R.A.S.)",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatie",
+ "Region_Display_HT": "Haïti",
+ "Region_Display_HU": "Hongrie",
+ "Region_Display_ID": "Indonésie",
+ "Region_Display_IE": "Irlande",
+ "Region_Display_IL": "Israël",
+ "Region_Display_IN": "Inde",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Islande",
+ "Region_Display_IT": "Italie",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaïque",
+ "Region_Display_JO": "Jordanie",
+ "Region_Display_JP": "Japon",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kirghizistan",
+ "Region_Display_KH": "Cambodge",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comores",
+ "Region_Display_KN": "Saint-Kitts-et-Nevis",
+ "Region_Display_KR": "Corée du Sud",
+ "Region_Display_KW": "Koweït",
+ "Region_Display_KY": "Cayman (îles)",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Liban",
+ "Region_Display_LC": "Sainte-Lucie",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lituanie",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Lettonie",
+ "Region_Display_LY": "Libye",
+ "Region_Display_MA": "Maroc",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Monténégro",
+ "Region_Display_MF": "Saint-Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall (îles)",
+ "Region_Display_MK": "Ex-République yougoslave de Macédoine",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolie",
+ "Region_Display_MO": "Macao (R.A.S.)",
+ "Region_Display_MP": "Mariannes du Nord (îles)",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritanie",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malte",
+ "Region_Display_MU": "Maurice",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexique",
+ "Region_Display_MY": "Malaisie",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibie",
+ "Region_Display_NC": "Nouvelle-Calédonie",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk (île)",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Pays-Bas",
+ "Region_Display_NO": "Norvège",
+ "Region_Display_NP": "Népal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Nouvelle-Zélande",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Pérou",
+ "Region_Display_PF": "Polynésie française",
+ "Region_Display_PG": "Papouasie-Nouvelle-Guinée",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Pologne",
+ "Region_Display_PM": "Saint-Pierre-et-Miquelon",
+ "Region_Display_PN": "Pitcairn (îles)",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Réunion",
+ "Region_Display_RO": "Roumanie",
+ "Region_Display_RS": "Serbie",
+ "Region_Display_RU": "Russie",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Arabie saoudite",
+ "Region_Display_SB": "Salomon (îles)",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Soudan",
+ "Region_Display_SE": "Suède",
+ "Region_Display_SG": "Singapour",
+ "Region_Display_SH": "Sainte-Hélène, Ascension et Tristan da Cunha",
+ "Region_Display_SI": "Slovénie",
+ "Region_Display_SK": "Slovaquie",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "Saint-Marin",
+ "Region_Display_SN": "Sénégal",
+ "Region_Display_SO": "Somalie",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "Soudan du Sud",
+ "Region_Display_ST": "São Tomé et Príncipe",
+ "Region_Display_SV": "Salvador",
+ "Region_Display_SX": "Saint-Martin (Royaume des Pays-Bas)",
+ "Region_Display_SY": "Syrie",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks et Caicos (îles)",
+ "Region_Display_TD": "Tchad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thaïlande",
+ "Region_Display_TJ": "Tadjikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkménistan",
+ "Region_Display_TN": "Tunisie",
+ "Region_Display_TR": "Turquie",
+ "Region_Display_TT": "Trinité-et-Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzanie",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Ouganda",
+ "Region_Display_US": "États-Unis",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Ouzbékistan",
+ "Region_Display_VA": "Saint-Siège (Cité du Vatican)",
+ "Region_Display_VC": "Saint-Vincent-et-les Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Îles Vierges britanniques",
+ "Region_Display_VI": "Îles Vierges américaines",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis-et-Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Saint-Eustache",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yémen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Afrique du Sud",
+ "Region_Display_ZM": "Zambie",
+ "Region_Display_ZW": "Zimbabwe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/fr.json b/packages/microsoft.bingweather/resources/fr.json
new file mode 100644
index 00000000..5a00e228
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/fr.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "12",
+ "Language_af": "afrikaans",
+ "Language_am": "amharique",
+ "Language_ar": "arabe",
+ "Language_arn-Latn": "mapudungun",
+ "Language_as": "assamais",
+ "Language_az": "azéri (latin)",
+ "Language_az-Cyrl": "azerbaïdjanais (cyrillique)",
+ "Language_az-Latn": "azerbaïdjanais (latin)",
+ "Language_ba-Cyrl": "bachkir",
+ "Language_be": "bélarusse",
+ "Language_bg": "bulgare",
+ "Language_bn": "bangla",
+ "Language_bn-bd": "bangla (Bangladesh)",
+ "Language_bn-in": "bangla (Inde)",
+ "Language_br-Latn": "breton",
+ "Language_bs": "bosniaque (latin)",
+ "Language_bs-Cyrl": "bosniaque (cyrillique)",
+ "Language_bs-Latn": "bosniaque (latin)",
+ "Language_ca": "catalan",
+ "Language_ca-ES-valencia": "valencien",
+ "Language_chr": "cherokee",
+ "Language_chr-Cher": "cherokee (cherokee)",
+ "Language_co-Latn": "corse",
+ "Language_cs": "tchèque",
+ "Language_cy": "gallois",
+ "Language_da": "danois",
+ "Language_de": "allemand",
+ "Language_dsb": "bas-sorabe",
+ "Language_dv": "maldivien",
+ "Language_el": "grec",
+ "Language_en": "anglais",
+ "Language_es": "espagnol",
+ "Language_et": "estonien",
+ "Language_eu": "basque",
+ "Language_fa": "persan",
+ "Language_ff-Latn": "peul",
+ "Language_fi": "finnois",
+ "Language_fil-Latn": "filipino",
+ "Language_fo": "féroïen",
+ "Language_fr": "français",
+ "Language_fy": "frison",
+ "Language_ga": "irlandais",
+ "Language_gd": "gaélique écossais",
+ "Language_gd-Latn": "gaélique écossais",
+ "Language_gl": "galicien",
+ "Language_gsw": "alsacien",
+ "Language_gu": "goudjrati",
+ "Language_ha": "haoussa",
+ "Language_ha-Latn": "haoussa",
+ "Language_he": "hébreu",
+ "Language_hi": "hindi",
+ "Language_hr": "croate",
+ "Language_hsb": "haut-sorabe",
+ "Language_hu": "hongrois",
+ "Language_hy": "arménien",
+ "Language_id": "indonésien",
+ "Language_ig": "igbo",
+ "Language_ig-Latn": "igbo",
+ "Language_is": "islandais",
+ "Language_it": "italien",
+ "Language_iu-Latn": "inuktitut (latin)",
+ "Language_ja": "japonais",
+ "Language_ka": "géorgien",
+ "Language_kk": "kazakh",
+ "Language_kl": "groenlandais",
+ "Language_km": "khmer",
+ "Language_kn": "kannada",
+ "Language_ko": "coréen",
+ "Language_kok": "konkani",
+ "Language_ku": "kurde",
+ "Language_ku-Arab": "kurde central",
+ "Language_ky": "kirghiz",
+ "Language_ky-Cyrl": "kirghiz",
+ "Language_lb": "luxembourgeois",
+ "Language_lo": "lao",
+ "Language_lt": "lituanien",
+ "Language_lv": "letton",
+ "Language_mi-Latn": "maori",
+ "Language_mk": "macédonien",
+ "Language_ml": "malayalam",
+ "Language_mn": "mongol (cyrillique)",
+ "Language_mn-Cyrl": "mongol (cyrillique)",
+ "Language_mr": "marathe",
+ "Language_ms": "malais",
+ "Language_mt": "maltais",
+ "Language_nb": "norvégien (bokmål)",
+ "Language_ne": "népalais",
+ "Language_nl": "néerlandais",
+ "Language_nn": "norvégien (nynorsk)",
+ "Language_nso": "sesotho sa leboa",
+ "Language_oc-Latn": "occitan",
+ "Language_or": "odia",
+ "Language_pa": "pendjabi (gurmukhi)",
+ "Language_pa-Arab": "pendjabi (arabe)",
+ "Language_pl": "polonais",
+ "Language_prs": "dari",
+ "Language_prs-arab": "dari",
+ "Language_ps": "pachto",
+ "Language_pt": "portugais",
+ "Language_pt-br": "portugais (Brésil)",
+ "Language_pt-pt": "portugais (Portugal)",
+ "Language_quc-Latn": "quiché",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "quechua",
+ "Language_ro": "roumain",
+ "Language_ru": "russe",
+ "Language_rw": "kinyarwanda",
+ "Language_sa-Deva": "sanskrit",
+ "Language_sah-Cyrl": "iakoute",
+ "Language_sd-Arab": "sindhi (arabe)",
+ "Language_se-Latn": "same du Nord",
+ "Language_si": "cinghalais",
+ "Language_sk": "slovaque",
+ "Language_sl": "slovène",
+ "Language_sma-Latn": "same du Sud",
+ "Language_smj-Latn": "same de Lule",
+ "Language_smn-Latn": "same d'Inari",
+ "Language_sms-Latn": "same de Skolt",
+ "Language_sq": "albanais",
+ "Language_sr-Cyrl": "serbe (cyrillique)",
+ "Language_sr-cyrl-ba": "serbe (cyrillique, Bosnie-Herzégovine)",
+ "Language_sr-Latn": "serbe (latin)",
+ "Language_sv": "suédois",
+ "Language_sw": "kiswahili",
+ "Language_syr-Syrc": "syriaque",
+ "Language_ta": "tamoul",
+ "Language_te": "telugu",
+ "Language_tg-Cyrl": "tadjik (cyrillique)",
+ "Language_th": "thaï",
+ "Language_ti": "tigrigna",
+ "Language_tk-Latn": "turkmène (latin)",
+ "Language_tn": "tswana",
+ "Language_tr": "turc",
+ "Language_tt": "tatar",
+ "Language_tt-Cyrl": "tatar (cyrillique)",
+ "Language_tzm-Latn": "tamazight (latin)",
+ "Language_ug": "ouïgour",
+ "Language_ug-Arab": "ouïgour",
+ "Language_uk": "ukrainien",
+ "Language_ur": "ourdou",
+ "Language_uz-Cyrl": "ouszbek (cyrillique)",
+ "Language_uz-Latn": "ouszbek (latin)",
+ "Language_vi": "vietnamien",
+ "Language_wo-Latn": "wolof",
+ "Language_xh": "xhosa",
+ "Language_yo": "yorouba",
+ "Language_yo-Latn": "yorouba",
+ "Language_zh-Hans": "chinois (simplifié)",
+ "Language_zh-Hant": "chinois (traditionnel)",
+ "Language_zu": "zoulou",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorre",
+ "Region_Display_AE": "Émirats arabes unis",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua-et-Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albanie",
+ "Region_Display_AM": "Arménie",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentine",
+ "Region_Display_AS": "Samoa américaines",
+ "Region_Display_AT": "Autriche",
+ "Region_Display_AU": "Australie",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaïdjan",
+ "Region_Display_BA": "Bosnie-Herzégovine",
+ "Region_Display_BB": "Barbade",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgique",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgarie",
+ "Region_Display_BH": "Bahreïn",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Bénin",
+ "Region_Display_BM": "Bermudes",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivie",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brésil",
+ "Region_Display_BS": "Les Bahamas",
+ "Region_Display_BT": "Bhoutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Bélarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Canada",
+ "Region_Display_CC": "Cocos-Keeling (îles)",
+ "Region_Display_CD": "Congo (République démocratique du)",
+ "Region_Display_CF": "République centrafricaine",
+ "Region_Display_CG": "Congo",
+ "Region_Display_CH": "Suisse",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "Cook (îles)",
+ "Region_Display_CL": "Chili",
+ "Region_Display_CM": "Cameroun",
+ "Region_Display_CN": "Chine",
+ "Region_Display_CO": "Colombie",
+ "Region_Display_CR": "Costa Rica",
+ "Region_Display_CS": "Serbie et Monténégro (Ancien)",
+ "Region_Display_CV": "Cabo Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Christmas (île)",
+ "Region_Display_CY": "Chypre",
+ "Region_Display_CZ": "République tchèque",
+ "Region_Display_DE": "Allemagne",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Danemark",
+ "Region_Display_DM": "Dominique",
+ "Region_Display_DO": "République dominicaine",
+ "Region_Display_DZ": "Algérie",
+ "Region_Display_EC": "Équateur",
+ "Region_Display_EE": "Estonie",
+ "Region_Display_EG": "Égypte",
+ "Region_Display_ER": "Érythrée",
+ "Region_Display_ES": "Espagne",
+ "Region_Display_ET": "Éthiopie",
+ "Region_Display_FI": "Finlande",
+ "Region_Display_FK": "Falkland (îles Falkland ou Malouines)",
+ "Region_Display_FM": "Micronésie",
+ "Region_Display_FO": "Féroé (îles)",
+ "Region_Display_FR": "France",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "Royaume-Uni",
+ "Region_Display_GD": "Grenade",
+ "Region_Display_GE": "Géorgie",
+ "Region_Display_GF": "Guyane française",
+ "Region_Display_GG": "Guernesey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Groenland",
+ "Region_Display_GM": "Gambie",
+ "Region_Display_GN": "Guinée",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Guinée équatoriale",
+ "Region_Display_GR": "Grèce",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinée-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Hong Kong (R.A.S.)",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Croatie",
+ "Region_Display_HT": "Haïti",
+ "Region_Display_HU": "Hongrie",
+ "Region_Display_ID": "Indonésie",
+ "Region_Display_IE": "Irlande",
+ "Region_Display_IL": "Israël",
+ "Region_Display_IN": "Inde",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Islande",
+ "Region_Display_IT": "Italie",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaïque",
+ "Region_Display_JO": "Jordanie",
+ "Region_Display_JP": "Japon",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kirghizistan",
+ "Region_Display_KH": "Cambodge",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Comores",
+ "Region_Display_KN": "Saint-Kitts-et-Nevis",
+ "Region_Display_KR": "Corée du Sud",
+ "Region_Display_KW": "Koweït",
+ "Region_Display_KY": "Cayman (îles)",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Liban",
+ "Region_Display_LC": "Sainte-Lucie",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lituanie",
+ "Region_Display_LU": "Luxembourg",
+ "Region_Display_LV": "Lettonie",
+ "Region_Display_LY": "Libye",
+ "Region_Display_MA": "Maroc",
+ "Region_Display_MC": "Monaco",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Monténégro",
+ "Region_Display_MF": "Saint-Martin",
+ "Region_Display_MG": "Madagascar",
+ "Region_Display_MH": "Marshall (îles)",
+ "Region_Display_MK": "Ex-République yougoslave de Macédoine",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolie",
+ "Region_Display_MO": "Macao (R.A.S.)",
+ "Region_Display_MP": "Mariannes du Nord (îles)",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritanie",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malte",
+ "Region_Display_MU": "Maurice",
+ "Region_Display_MV": "Maldives",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Mexique",
+ "Region_Display_MY": "Malaisie",
+ "Region_Display_MZ": "Mozambique",
+ "Region_Display_NA": "Namibie",
+ "Region_Display_NC": "Nouvelle-Calédonie",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Norfolk (île)",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nicaragua",
+ "Region_Display_NL": "Pays-Bas",
+ "Region_Display_NO": "Norvège",
+ "Region_Display_NP": "Népal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Nouvelle-Zélande",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Pérou",
+ "Region_Display_PF": "Polynésie française",
+ "Region_Display_PG": "Papouasie-Nouvelle-Guinée",
+ "Region_Display_PH": "Philippines",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Pologne",
+ "Region_Display_PM": "Saint-Pierre-et-Miquelon",
+ "Region_Display_PN": "Pitcairn (îles)",
+ "Region_Display_PR": "Puerto Rico",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Réunion",
+ "Region_Display_RO": "Roumanie",
+ "Region_Display_RS": "Serbie",
+ "Region_Display_RU": "Russie",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Arabie saoudite",
+ "Region_Display_SB": "Salomon (îles)",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Soudan",
+ "Region_Display_SE": "Suède",
+ "Region_Display_SG": "Singapour",
+ "Region_Display_SH": "Sainte-Hélène, Ascension et Tristan da Cunha",
+ "Region_Display_SI": "Slovénie",
+ "Region_Display_SK": "Slovaquie",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "Saint-Marin",
+ "Region_Display_SN": "Sénégal",
+ "Region_Display_SO": "Somalie",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "Soudan du Sud",
+ "Region_Display_ST": "São Tomé et Príncipe",
+ "Region_Display_SV": "Salvador",
+ "Region_Display_SX": "Saint-Martin (Royaume des Pays-Bas)",
+ "Region_Display_SY": "Syrie",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Turks et Caicos (îles)",
+ "Region_Display_TD": "Tchad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thaïlande",
+ "Region_Display_TJ": "Tadjikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkménistan",
+ "Region_Display_TN": "Tunisie",
+ "Region_Display_TR": "Turquie",
+ "Region_Display_TT": "Trinité-et-Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzanie",
+ "Region_Display_UA": "Ukraine",
+ "Region_Display_UG": "Ouganda",
+ "Region_Display_US": "États-Unis",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Ouzbékistan",
+ "Region_Display_VA": "Saint-Siège (Cité du Vatican)",
+ "Region_Display_VC": "Saint-Vincent-et-les Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Îles Vierges britanniques",
+ "Region_Display_VI": "Îles Vierges américaines",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis-et-Futuna",
+ "Region_Display_WS": "Samoa",
+ "Region_Display_XE": "Saint-Eustache",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yémen",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Afrique du Sud",
+ "Region_Display_ZM": "Zambie",
+ "Region_Display_ZW": "Zimbabwe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/generic.json b/packages/microsoft.bingweather/resources/generic.json
new file mode 100644
index 00000000..3c83c1dd
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/generic.json
@@ -0,0 +1,1096 @@
+{
+ "Bing.Maps.Javascript": {
+ "resources": {
+ "L_AddStop_Text": "add destination",
+ "L_aerialEnableTilt_Text": "show angled view",
+ "L_aerialShowLabels_Text": "show labels",
+ "L_ApproximateLocation_Text": "Location is approximate",
+ "L_AtleastTwoWaypointsRequiredError_Text": "At least two waypoints are required to calculate directions.",
+ "L_AvoidHighways_Text": "Avoid highways",
+ "L_AvoidMotorways_Text": "Avoid motorways",
+ "L_AvoidTolls_Text": "Avoid toll roads",
+ "L_BingLogoTooltip_Text": "Bing Maps",
+ "L_BingSearchGoTooltip_Text": "Search on Bing",
+ "L_BingSearchWatermark_Text": "Search on Bing",
+ "L_BuyTickets_Text": "Buy Tickets from {0}",
+ "L_CalendarDays_Text": "S,M,T,W,T,F,S",
+ "L_CalendarMonths_Text": "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
+ "L_CarModeToolTip_Text": "Driving",
+ "L_Clear_Text": "Clear",
+ "L_compassHeadingLabels_Text": "N~|~NE~|~E~|~SE~|~S~|~SW~|~W~|~NW~|",
+ "L_compassNorthLabel_Text": "N",
+ "L_compassTooltip_Text": "Click to pan in any direction",
+ "L_CongestionChargeZoneEnterTwo_Text": " ,Applies Monday to Friday - 7am to 6pm.",
+ "L_CongestionChargeZoneEnter_Text": "Entering Congestion Charge Zone.",
+ "L_CongestionChargeZoneExit_Text": "Leaving Congestion Charge Zone.",
+ "L_CongestionChargeZoneTooltip_Text": "Entering Congestion Charge Zone. Applies Monday to Friday - 7am to 6pm.",
+ "L_coverageInfoBoxClickBlue_Text": "Click inside the blue area",
+ "L_coverageInfoBoxNotAvailable_Text": "Streetside is not available here",
+ "L_coverageInfoBoxZoomOut_Text": "Zoom out to see Streetside coverage",
+ "L_currentIconTooltip_Text": "Return to last location",
+ "L_DirectionsAddressCityLocation_Text": "Business, address, or landmark",
+ "L_DirectionsDisclaimer_Text": "These directions are subject to the {0} and for informational purposes only. No guarantee is made regarding their completeness or accuracy. Construction projects, traffic, or other events may cause actual conditions to differ from these results. Map and traffic data © {year} NAVTEQ™.",
+ "L_DirectionsGetDirections_Text": "Go",
+ "L_DirectionsMenuReverse_Text": "Reverse",
+ "L_DirectionsMenuRoundtrip_Text": "Round-trip",
+ "L_DirectionsTaskTitle_Text": "Directions",
+ "L_DirectionsTripLengthTooLong_Text": "Driving directions are not available for a route of this length.",
+ "L_DisambiguationGeneralMessageb2b_Text": "By \"{0}\", did you mean:",
+ "L_DisambiguationGeneralMessage_Text": "Did you mean:",
+ "L_DisambiguationMessageFromMbing_Text": "Did you mean from:",
+ "L_DisambiguationMessageToMbing_Text": "Did you mean to:",
+ "L_DistanceUnitFeetShort_Text": "ft",
+ "L_DistanceUnitKm_Text": "km",
+ "L_DistanceUnitMeters_Text": "m",
+ "L_DistanceUnitMilesShortText_Text": "mi",
+ "L_DragSummaryToolTip_Text": "{0} ({1} {2} / {3})",
+ "L_DragToolTip_Text": "Drag to modify your route",
+ "L_DrivingDirectionNotAvailable_Text": "We can't find a driving route for the locations you entered. Check the locations you entered, and try again.",
+ "L_ellipsis_Text": "…",
+ "L_EmptyWaypointError_Text": "One or more waypoints have a missing address or location.",
+ "L_ExceedMaxTransitWaypointLimitError_Text": "The maximum waypoint limit of 2 for transit routes has been exceeded.",
+ "L_ExceedMaxWaypointLimitError_Text": "The maximum waypoint limit of {0} has been exceeded.",
+ "L_exitButton_Text": "Exit",
+ "L_FirstOrLastStoppointIsViaError_Text": "Either the first or last waypoint is a via point, which is not allowed.",
+ "L_GoBackToThePreviousRoute_Text": "go back to the previous route",
+ "L_HideOptions_Text": "hide options",
+ "L_HighConfidenceSingularTeaserMessage_Text": "We found {0} more result for ",
+ "L_HighConfidenceTeaserMessage_Text": "We found {0} more results for ",
+ "L_invalidcredentials_text": "Invalid Credentials. Sign up for a developer account at: http://www.microsoft.com/maps/developers",
+ "L_KmSettings_Text": "Km",
+ "L_loadingError_Text": "There was an error loading streetside.",
+ "L_mapTypeAerialDescription_Text": "A detailed look from above",
+ "L_mapTypeAerialName_Text": "Aerial",
+ "L_mapTypeAutoDescription_Text": "Switches to the best map style as you zoom",
+ "L_mapTypeAutoName_Text": "Automatic",
+ "L_mapTypeBirdsEyeDescription_Text": "A better angle of aerial photography",
+ "L_mapTypeBirdsEyeName_Text": "Bird's eye",
+ "L_mapTypeCollinsBartDescription_Text": "Detailed maps for Greater London",
+ "L_mapTypeCollinsBartName_Text": "London Street Map",
+ "L_mapTypeOrdnanceSurveyDescription_Text": "Maps for outdoor life",
+ "L_mapTypeOrdnanceSurveyName_Text": "Ordnance Survey Map",
+ "L_mapTypeRoadDescription_Text": "A standard road map",
+ "L_mapTypeRoadName_Text": "Road",
+ "L_microsoftcopyright_text": "© {year} Microsoft Corporation",
+ "L_MilesSettings_Text": "Miles",
+ "L_Next_Text": "Next",
+ "L_OneClickDirectionsHeader_Text": "Or, choose a highway:",
+ "L_OrDragTheRoute_Text": " ,or drag the route",
+ "L_PopupEmail_Text": "Email",
+ "L_Previous_Text": "Previous",
+ "L_privacyReporting_Text": "Report",
+ "L_RemoveVia_Text": "Remove",
+ "L_RerouteBasedOnTraffic_Text": "rerouted based on traffic",
+ "L_RideAndExitAt_Text": "Ride for {0} and exit at",
+ "L_rotateLeftTooltip_Text": "Rotate left",
+ "L_rotateRightTooltip_Text": "Rotate right",
+ "L_RouteErrorServerBusy_Text": "Driving directions are temporarily unavailable. Please try again",
+ "L_RouteOptions_Text": "Options",
+ "L_RouteOverviewDriving_Text": "{0}, {1} driving",
+ "L_RouteOverviewOther_Text": "{0}, {1}",
+ "L_RouteOverviewWalking_Text": "{0}, {1} walking",
+ "L_RouteSummaryLink_Text": "{0} to {1}: ",
+ "L_RouteTimeInCurrentTrafficCondition_Text": "{0} with traffic ",
+ "L_SaveYourDestinationHistory_Text": "Save your destination history",
+ "L_scaleBarFeet_Text": "{num} feet",
+ "L_scaleBarKilometers_Text": "{num} km",
+ "L_scaleBarMeters_Text": "{num} m",
+ "L_scaleBarMiles_Text": "{num} miles",
+ "L_scaleBarYards_Text": "{num} yds",
+ "L_ScheduledArrival_Text": "{0}, arrival",
+ "L_ScheduledDeparture_Text": "{0}, departure",
+ "L_SeeTrafficBasedRoute_Text": "view route based on traffic",
+ "L_SelectDisambiguation_Text": "Select",
+ "L_SendMobile_Text": "Mobile",
+ "L_SendTo_Text": "Send to",
+ "L_ShowOptions_Text": "show options",
+ "L_TakeBus_Text": "Take the bus",
+ "L_TakeTrain_Text": "Take the train",
+ "L_TakeTube_Text": "Take the tube",
+ "L_TermsOfUse_Text": "Microsoft® Service Agreement",
+ "L_TimeAM_Text": "am",
+ "L_TimeInHr_Text": "{0} hr",
+ "L_TimeLessThanOneHr_Text": "{0} min",
+ "L_TimeLessThanOneMin_Text": "< 1 min",
+ "L_TimeMoreThanOneHr_Text": "{0} hr {1} min",
+ "L_TimePM_Text": "pm",
+ "L_TrafficAccident_Text": "Accident",
+ "L_TrafficCongestion_Text": "Congestion",
+ "L_TrafficDisabledVehicle_Text": "Disabled Vehicle",
+ "L_TrafficLegendFast_Text": "Fast",
+ "L_TrafficLegendSlow_Text": "Slow",
+ "L_TrafficMassTransit_Text": "Mass Transit",
+ "L_TrafficMiscellaneous_Text": "Miscellaneous",
+ "L_TrafficNotAvailableInOblique_Text": "Traffic isn't available in bird's eye view",
+ "L_TrafficOtherNews_Text": "Other News",
+ "L_TrafficPlannedEvent_Text": "Planned Event",
+ "L_TrafficPopupCenterMapHere_Text": "Center map here",
+ "L_TrafficPopupDateFormat_Text": "M/d/yyyy h:mm tt",
+ "L_TrafficPopupDescription_Text": "Description",
+ "L_TrafficPopupDetour_Text": "Detour",
+ "L_TrafficPopupEstEndTime_Text": "Est. end time",
+ "L_TrafficPopupLane_Text": "Lane",
+ "L_TrafficPopupLocation_Text": "Location",
+ "L_TrafficPopupSeverity_Text": "Severity",
+ "L_TrafficPopupStartTime_Text": "Start time",
+ "L_TrafficPopupZoomToIncident_Text": "Zoom to incident",
+ "L_TrafficRoadHazard_Text": "Road Hazard",
+ "L_TrafficScheduledConstruction_Text": "Scheduled Construction",
+ "L_TrafficSeverityMinor_Text": "Minor",
+ "L_TrafficSeverityModerate_Text": "Moderate",
+ "L_TrafficSeveritySerious_Text": "Serious",
+ "L_TrafficUnavailable_Text": "Traffic is temporarily unavailable",
+ "L_TrafficUnScheduledContruction_Text": "Unscheduled Construction",
+ "L_TrafficUpdatedTimeFormat_Text": "HH:mm:ss",
+ "L_TrafficUpdated_Text": "Updated",
+ "L_TrafficWeather_Text": "Weather",
+ "L_TrafficZoomIn_Text": "Zoom in for traffic details",
+ "L_TransitCostWithCurrency_Text": "${0}",
+ "L_TransitDefaultTitle_Text": "Transit Schedule",
+ "L_TransitDirectionNoAvailableTransitTrip_Text": "We can't find a transit route for the locations you entered. Check the locations you entered or try a different date/time.",
+ "L_TransitDirectionNoSolution_Text": "We can't find a transit route for the locations you entered. Check the locations you entered, and try again.",
+ "L_TransitDirectionNotAvailable_Text": "We can't find a transit route for the locations you entered. Check the locations you entered, and try again.",
+ "L_TransitDirectionOutOfTransitBounds_Text": "We can't find a transit route between the locations you entered.",
+ "L_TransitDirectionTooClose_Text": "The transit trip is too short. Try using walking directions instead.",
+ "L_TransitDisclaimer_Text": "These directions are subject to the Microsoft® Service Agreement and for informational purposes only. No guarantee is made regarding their completeness or accuracy. Contains public sector information licensed under the Open Government License v.1.0.",
+ "L_TransitExcludeAirLineLabel_Text": "Exclude Air Line",
+ "L_TransitExcludeBulletTrain_Text": "Exclude Bullet Train",
+ "L_TransitExcludeExpressLabel_Text": "Exclude Express Train",
+ "L_TransitIncludeBulletTrain_Text": "Include Bullet Train",
+ "L_TransitItineraryTitle_Text": "TRANSIT ROUTE {0}",
+ "L_TransitModeToolTip_Text": "Transit",
+ "L_TransitNotAvailableWarning_Text": "There's no transit information for this location. Please choose another method of transportation.",
+ "L_TransitOptionArriveBy_Text": "Arrive by",
+ "L_TransitOptionDepartAt_Text": "Depart at",
+ "L_TransitOptionLastTrain_Text": "Last train",
+ "L_TransitOptionsTitle_Text": "ROUTES",
+ "L_TransitRouteErrorServerBusy_Text": "Transit directions are temporarily unavailable. Please try again",
+ "L_transitRouteLabel_Text": "Route: ",
+ "L_transitRoutesLabel_Text": "Routes: ",
+ "L_TransitRouteToolTipTransfer_Text": "Transfer: {0}",
+ "L_TransitRouteToolTipWalking_Text": "Walking: {0} ",
+ "L_TransitScheduleDeparts_Text": "DEPARTS",
+ "L_TransitScheduleRoutes_Text": "ROUTE",
+ "L_TransitScheduleUnavailable_Text": "Schedule information is unavailable at this stop for the time specified.",
+ "L_TransitSortByLabel_Text": "Sort by:",
+ "L_TransitSortByOptionMinimizeMoney_Text": "Cheapest fare",
+ "L_TransitSortByOptionMinimizeTime_Text": "Quickest route",
+ "L_TransitSortByOptionMinimizeTransfers_Text": "Fewest transfers",
+ "L_TransitStopFormat_Text": "{0} - {1}",
+ "L_TransitSummaryStartEndTime_Text": "{0} - {1}",
+ "L_TransitTrainLineCom_Text": "www.thetrainline.com",
+ "L_TransitTripLengthTooLong_Text": "Transit directions are not available for a route of this length.",
+ "L_TransitUpdateSchedule_Text": "Update",
+ "L_TubeModeToolTip_Text": "Transport: Now with Tube!",
+ "L_VenueMapExplorerTooltip_Text": "View {0} Map",
+ "L_VenueMaps_Directory_Text": "DIRECTORY",
+ "L_VenueMaps_HideCategories_Text": "Hide Categories",
+ "L_VenueMaps_Other_Text": "Other",
+ "L_VenueMaps_ShowCategories_Text": "Show Categories",
+ "L_VenueMaps_SortByAlpha_Text": "Businesses A-Z",
+ "L_VenueMaps_SortByLevel_Text": "Level",
+ "L_VenueMaps_ToolTip_Text": "View {0} map",
+ "L_VersionMismatchMessage_Text": "A new version of Bing Maps SDK is available",
+ "L_VersionNotSupportedMessage_Text": "This version of Bing Maps SDK is not supported",
+ "L_ViaList_Text": "via {0} ",
+ "L_viewAllButton_Text": "view all businesses",
+ "L_WalkingDirectionNotAvailable_Text": "We can't find a walking route for the locations you entered. Check the locations you entered, and try again.",
+ "L_WalkingDirectionsSidewalkWarning_Text": "Caution: This route may not contain sidewalks or pedestrian paths.",
+ "L_WalkingDirectionsTripLengthTooLong_Text": "Walking directions are not available for a route of this length. Try driving directions instead.",
+ "L_WalkingDistanceFrom_Text": "Walk {0} ",
+ "L_WalkingInstruction_Text": "to {0}",
+ "L_WalkingModeToolTip_Text": "Walking",
+ "L_WalkingRouteErrorServerBusy_Text": "Walking directions are temporarily unavailable. Please try again",
+ "L_WaypointDisambiguationError_Text": "One or more waypoints need to be disambiguated.",
+ "L_WaypointViaEro_Text": "Via ",
+ "L_WebsiteLink_Text": "Website",
+ "L_world_Text": "World",
+ "L_zoomInTooltip_Text": "Zoom in",
+ "L_zoomOutTooltip_Text": "Zoom out",
+ "L_zoomSliderTooltip_Text": "Move slider to zoom in or out"
+ }
+ },
+ "Files": {
+ "AppConfiguration.xml": "AppConfiguration.xml",
+ "AppFeatures.xml": "AppFeatures.xml",
+ "common": {
+ "ArticleReader": {
+ "css": {
+ "Content.css": "common\\ArticleReader\\css\\Content.css"
+ },
+ "html": {
+ "ArticleReaderPage.html": "common\\ArticleReader\\html\\ArticleReaderPage.html"
+ }
+ },
+ "css": {
+ "common.css": "common\\css\\common.css",
+ "delayedCommon.css": "common\\css\\delayedCommon.css",
+ "dynamicpano.css": "common\\css\\dynamicpano.css",
+ "photosynthview.css": "common\\css\\photosynthview.css"
+ },
+ "DynamicPano": {
+ "html": {
+ "DynamicPano.html": "common\\DynamicPano\\html\\DynamicPano.html",
+ "PaywallCard.html": "common\\DynamicPano\\html\\PaywallCard.html"
+ }
+ },
+ "EntityCollection": {
+ "html": {
+ "EntityCollectionFragment.html": "common\\EntityCollection\\html\\EntityCollectionFragment.html"
+ },
+ "providers": {
+ "RichBrowse": {
+ "EntityCollection.html": "common\\EntityCollection\\providers\\RichBrowse\\EntityCollection.html"
+ }
+ }
+ },
+ "FeaturedCluster": {
+ "html": {
+ "FeaturedClusterTemplates.html": "common\\FeaturedCluster\\html\\FeaturedClusterTemplates.html"
+ }
+ },
+ "fonts": {
+ "AppExSymbol-Regular.ttf": "Common\\fonts\\AppExSymbol-Regular.ttf"
+ },
+ "Hero": {
+ "html": {
+ "HeroLayouts.html": "common\\Hero\\html\\HeroLayouts.html"
+ }
+ },
+ "html": {
+ "bdiReportFragment.html": "Common\\html\\bdiReportFragment.html",
+ "configurationFragment.html": "Common\\html\\configurationFragment.html",
+ "feedbackFragment.html": "Common\\html\\feedbackFragment.html",
+ "platform.html": "Common\\html\\platform.html",
+ "PrivacySettings.html": "Common\\html\\PrivacySettings.html"
+ },
+ "images": {
+ "app_update.png": "Common\\images\\app_update.png",
+ "beak_nav_asset.png": "Common\\images\\beak_nav_asset.scale-100.png",
+ "customizationItemLarge.png": "Common\\images\\customizationItemLarge.png",
+ "customizationItemMedium.png": "Common\\images\\customizationItemMedium.png",
+ "customizationItemSmall.png": "Common\\images\\customizationItemSmall.png",
+ "imagePlaceHolder_dark.svg": "Common\\images\\imagePlaceHolder_dark.svg",
+ "imagePlaceHolder_light.svg": "Common\\images\\imagePlaceHolder_light.svg",
+ "key.svg": "Common\\images\\key.svg",
+ "keyHCBlack.svg": "Common\\images\\keyHCBlack.svg",
+ "keyHCWhite.svg": "Common\\images\\keyHCWhite.svg",
+ "mic.png": "Common\\images\\mic.png",
+ "Microsoft_Logo.png": "Common\\images\\Microsoft_Logo.png",
+ "Pattern_15x15.png": "Common\\images\\Pattern_15x15.png",
+ "snap_placeholder.png": "Common\\images\\snap_placeholder.png",
+ "tilePlaceHolder_dark.svg": "Common\\images\\tilePlaceHolder_dark.svg",
+ "tilePlaceHolder_light.svg": "Common\\images\\tilePlaceHolder_light.svg",
+ "update.png": "Common\\images\\update.png",
+ "world_dark.png": "Common\\images\\world_dark.png",
+ "wsj_key.svg": "Common\\images\\wsj_key.svg"
+ },
+ "js": {
+ "ads.js": "common\\js\\ads.js",
+ "articlereader.js": "common\\js\\articlereader.js",
+ "autosuggest.js": "common\\js\\autosuggest.js",
+ "collection.js": "common\\js\\collection.js",
+ "controls.js": "common\\js\\controls.js",
+ "dynamicArticleReader.js": "common\\js\\dynamicArticleReader.js",
+ "dynamicpano.js": "common\\js\\dynamicpano.js",
+ "dynamicPanoDataProvider.js": "common\\js\\dynamicPanoDataProvider.js",
+ "ecv.js": "common\\js\\ecv.js",
+ "feedbackFragment.js": "common\\js\\feedbackFragment.js",
+ "filters.js": "common\\js\\filters.js",
+ "mediaplayback.js": "common\\js\\mediaplayback.js",
+ "navigation.js": "common\\js\\navigation.js",
+ "newscluster.js": "common\\js\\newscluster.js",
+ "photosynthview.js": "common\\js\\photosynthview.js",
+ "search.js": "common\\js\\search.js",
+ "services.js": "common\\js\\services.js",
+ "slideshow.js": "common\\js\\slideshow.js",
+ "table.js": "common\\js\\table.js",
+ "uiconfig.js": "common\\js\\uiconfig.js",
+ "utilities.js": "common\\js\\utilities.js",
+ "utils.js": "common\\js\\utils.js"
+ },
+ "MediaPlayback": {
+ "html": {
+ "MediaPlayback.html": "common\\MediaPlayback\\html\\MediaPlayback.html",
+ "ThirdPartyPlayerPage.html": "common\\MediaPlayback\\html\\ThirdPartyPlayerPage.html"
+ },
+ "Resources": {
+ "black.mp4": "common\\MediaPlayback\\Resources\\black.mp4",
+ "GripperHover_fullscreen.svg": "common\\MediaPlayback\\Resources\\GripperHover_fullscreen.svg",
+ "GripperHover_inline.svg": "common\\MediaPlayback\\Resources\\GripperHover_inline.svg",
+ "GripperPressed_fullscreen.svg": "common\\MediaPlayback\\Resources\\GripperPressed_fullscreen.svg",
+ "GripperPressed_inline.svg": "common\\MediaPlayback\\Resources\\GripperPressed_inline.svg",
+ "GripperRest_fullscreen.svg": "common\\MediaPlayback\\Resources\\GripperRest_fullscreen.svg",
+ "GripperRest_inline.svg": "common\\MediaPlayback\\Resources\\GripperRest_inline.svg"
+ }
+ },
+ "PhotosynthView": {
+ "PhotosynthView.html": "common\\PhotosynthView\\PhotosynthView.html"
+ },
+ "SlideShow": {
+ "html": {
+ "GenericSlideshowPage.html": "common\\SlideShow\\html\\GenericSlideshowPage.html",
+ "ImageModuleTemplates.html": "common\\SlideShow\\html\\ImageModuleTemplates.html",
+ "SlideshowPage.html": "common\\SlideShow\\html\\SlideshowPage.html"
+ }
+ },
+ "Table": {
+ "html": {
+ "TableTemplates.html": "common\\Table\\html\\TableTemplates.html"
+ }
+ },
+ "WebPicks": {
+ "html": {
+ "GroupPage.html": "common\\WebPicks\\html\\GroupPage.html",
+ "Templates.html": "common\\WebPicks\\html\\Templates.html"
+ }
+ },
+ "WebWorkers": {
+ "PlatformWebWorker.js": "Common\\WebWorkers\\PlatformWebWorker.js"
+ }
+ },
+ "Configuration": {
+ "configuration.sqlite": "Configuration\\configuration.sqlite"
+ },
+ "css": {
+ "default.css": "css\\default.css",
+ "historical.css": "css\\historical.css",
+ "interactivemaps.css": "css\\interactivemaps.css",
+ "mapsflyout.css": "css\\mapsflyout.css",
+ "secondaryPanos.css": "css\\secondaryPanos.css",
+ "skipano.css": "css\\skipano.css",
+ "skiResortsECV.css": "css\\skiResortsECV.css",
+ "tianQiStyles.css": "css\\tianQiStyles.css"
+ },
+ "default.html": "default.html",
+ "html": {
+ "aboutFlyout.html": "html\\aboutFlyout.html",
+ "delayedTemplate.html": "html\\delayedTemplate.html",
+ "mapsTemplate.html": "html\\mapsTemplate.html",
+ "secondaryTemplates.html": "html\\secondaryTemplates.html",
+ "settingsFlyout.html": "html\\settingsFlyout.html",
+ "templates.html": "html\\templates.html"
+ },
+ "images": {
+ "autoSuggest": {
+ "search.png": "images\\autoSuggest\\search.png",
+ "searchCharm.png": "images\\autoSuggest\\searchCharm.png",
+ "searchCharmSki.png": "images\\autoSuggest\\searchCharmSki.png"
+ },
+ "badge.png": "images\\badge.scale-100.png",
+ "heroraindrop.png": "images\\heroraindrop.png",
+ "largelogo.png": "images\\largelogo.scale-100.png",
+ "logo.png": "images\\logo.scale-100.png",
+ "mapsFlyout": {
+ "a_clear.gif": "images\\mapsFlyout\\a_clear.gif",
+ "dopplerlegend.png": "images\\mapsFlyout\\dopplerlegend.png",
+ "preciplegend.png": "images\\mapsFlyout\\preciplegend.png"
+ },
+ "panoramaBackgrounds": {
+ "11.jpg": "images\\panoramaBackgrounds\\11.jpg"
+ },
+ "providerLogos": {
+ "accuweather.png": "images\\providerLogos\\accuweather.png",
+ "foreca.png": "images\\providerLogos\\foreca.png",
+ "holidayWeather.png": "images\\providerLogos\\holidayWeather.png",
+ "kweather.png": "images\\providerLogos\\kweather.png",
+ "wdt.png": "images\\providerLogos\\wdt.png",
+ "weather2travel.png": "images\\providerLogos\\weather2travel.png",
+ "weatherdotcom.png": "images\\providerLogos\\weatherdotcom.png",
+ "weathertrends.png": "images\\providerLogos\\weathertrends.png",
+ "wolframalpha.png": "images\\providerLogos\\wolframalpha.png"
+ },
+ "raindrop.png": "images\\raindrop.png",
+ "skiElevationTriangles.svg": "images\\skiElevationTriangles.svg",
+ "skiResorts": {
+ "genericNearbyResortImage.jpg": "images\\skiResorts\\genericNearbyResortImage.jpg"
+ },
+ "skycodes": {
+ "30x30": {
+ "1.png": "images\\skycodes\\30x30\\1.png",
+ "11.png": "images\\skycodes\\30x30\\11.png",
+ "12.png": "images\\skycodes\\30x30\\12.png",
+ "13_41_46.png": "images\\skycodes\\30x30\\13_41_46.png",
+ "17.png": "images\\skycodes\\30x30\\17.png",
+ "19.png": "images\\skycodes\\30x30\\19.png",
+ "19b.png": "images\\skycodes\\30x30\\19b.png",
+ "19c.png": "images\\skycodes\\30x30\\19c.png",
+ "1b.png": "images\\skycodes\\30x30\\1b.png",
+ "20.png": "images\\skycodes\\30x30\\20.png",
+ "20b.png": "images\\skycodes\\30x30\\20b.png",
+ "20c.png": "images\\skycodes\\30x30\\20c.png",
+ "23.png": "images\\skycodes\\30x30\\23.png",
+ "25.png": "images\\skycodes\\30x30\\25.png",
+ "25b.png": "images\\skycodes\\30x30\\25b.png",
+ "26.png": "images\\skycodes\\30x30\\26.png",
+ "27.png": "images\\skycodes\\30x30\\27.png",
+ "27b.png": "images\\skycodes\\30x30\\27b.png",
+ "29.png": "images\\skycodes\\30x30\\29.png",
+ "29b.png": "images\\skycodes\\30x30\\29b.png",
+ "31.png": "images\\skycodes\\30x30\\31.png",
+ "31b.png": "images\\skycodes\\30x30\\31b.png",
+ "34_33.png": "images\\skycodes\\30x30\\34_33.png",
+ "40.png": "images\\skycodes\\30x30\\40.png",
+ "43.png": "images\\skycodes\\30x30\\43.png",
+ "44.png": "images\\skycodes\\30x30\\44.png",
+ "5.png": "images\\skycodes\\30x30\\5.png",
+ "7.png": "images\\skycodes\\30x30\\7.png",
+ "9.png": "images\\skycodes\\30x30\\9.png",
+ "9b.png": "images\\skycodes\\30x30\\9b.png",
+ "9c.png": "images\\skycodes\\30x30\\9c.png"
+ },
+ "48x48": {
+ "1.png": "images\\skycodes\\48x48\\1.png",
+ "11.png": "images\\skycodes\\48x48\\11.png",
+ "12.png": "images\\skycodes\\48x48\\12.png",
+ "13_41_46.png": "images\\skycodes\\48x48\\13_41_46.png",
+ "17.png": "images\\skycodes\\48x48\\17.png",
+ "19.png": "images\\skycodes\\48x48\\19.png",
+ "19b.png": "images\\skycodes\\48x48\\19b.png",
+ "19c.png": "images\\skycodes\\48x48\\19c.png",
+ "1b.png": "images\\skycodes\\48x48\\1b.png",
+ "20.png": "images\\skycodes\\48x48\\20.png",
+ "20b.png": "images\\skycodes\\48x48\\20b.png",
+ "20c.png": "images\\skycodes\\48x48\\20c.png",
+ "23.png": "images\\skycodes\\48x48\\23.png",
+ "25.png": "images\\skycodes\\48x48\\25.png",
+ "25b.png": "images\\skycodes\\48x48\\25b.png",
+ "26.png": "images\\skycodes\\48x48\\26.png",
+ "27.png": "images\\skycodes\\48x48\\27.png",
+ "27b.png": "images\\skycodes\\48x48\\27b.png",
+ "29.png": "images\\skycodes\\48x48\\29.png",
+ "29b.png": "images\\skycodes\\48x48\\29b.png",
+ "31.png": "images\\skycodes\\48x48\\31.png",
+ "31b.png": "images\\skycodes\\48x48\\31b.png",
+ "34_33.png": "images\\skycodes\\48x48\\34_33.png",
+ "40.png": "images\\skycodes\\48x48\\40.png",
+ "43.png": "images\\skycodes\\48x48\\43.png",
+ "44.png": "images\\skycodes\\48x48\\44.png",
+ "5.png": "images\\skycodes\\48x48\\5.png",
+ "7.png": "images\\skycodes\\48x48\\7.png",
+ "9.png": "images\\skycodes\\48x48\\9.png",
+ "9b.png": "images\\skycodes\\48x48\\9b.png",
+ "9c.png": "images\\skycodes\\48x48\\9c.png"
+ },
+ "66x62": {
+ "1.png": "images\\skycodes\\66x62\\1.png",
+ "11.png": "images\\skycodes\\66x62\\11.png",
+ "12.png": "images\\skycodes\\66x62\\12.png",
+ "13_41_46.png": "images\\skycodes\\66x62\\13_41_46.png",
+ "17.png": "images\\skycodes\\66x62\\17.png",
+ "19.png": "images\\skycodes\\66x62\\19.png",
+ "19b.png": "images\\skycodes\\66x62\\19b.png",
+ "19c.png": "images\\skycodes\\66x62\\19c.png",
+ "1b.png": "images\\skycodes\\66x62\\1b.png",
+ "20.png": "images\\skycodes\\66x62\\20.png",
+ "20b.png": "images\\skycodes\\66x62\\20b.png",
+ "20c.png": "images\\skycodes\\66x62\\20c.png",
+ "23.png": "images\\skycodes\\66x62\\23.png",
+ "25.png": "images\\skycodes\\66x62\\25.png",
+ "25b.png": "images\\skycodes\\66x62\\25b.png",
+ "26.png": "images\\skycodes\\66x62\\26.png",
+ "27.png": "images\\skycodes\\66x62\\27.png",
+ "27b.png": "images\\skycodes\\66x62\\27b.png",
+ "29.png": "images\\skycodes\\66x62\\29.png",
+ "29b.png": "images\\skycodes\\66x62\\29b.png",
+ "31.png": "images\\skycodes\\66x62\\31.png",
+ "31b.png": "images\\skycodes\\66x62\\31b.png",
+ "34_33.png": "images\\skycodes\\66x62\\34_33.png",
+ "40.png": "images\\skycodes\\66x62\\40.png",
+ "43.png": "images\\skycodes\\66x62\\43.png",
+ "44.png": "images\\skycodes\\66x62\\44.png",
+ "5.png": "images\\skycodes\\66x62\\5.png",
+ "7.png": "images\\skycodes\\66x62\\7.png",
+ "9.png": "images\\skycodes\\66x62\\9.png",
+ "9b.png": "images\\skycodes\\66x62\\9b.png",
+ "9c.png": "images\\skycodes\\66x62\\9c.png"
+ },
+ "89x89": {
+ "1.png": "images\\skycodes\\89x89\\1.png",
+ "11.png": "images\\skycodes\\89x89\\11.png",
+ "12.png": "images\\skycodes\\89x89\\12.png",
+ "13_41_46.png": "images\\skycodes\\89x89\\13_41_46.png",
+ "17.png": "images\\skycodes\\89x89\\17.png",
+ "19.png": "images\\skycodes\\89x89\\19.png",
+ "19b.png": "images\\skycodes\\89x89\\19b.png",
+ "19c.png": "images\\skycodes\\89x89\\19c.png",
+ "1b.png": "images\\skycodes\\89x89\\1b.png",
+ "20.png": "images\\skycodes\\89x89\\20.png",
+ "20b.png": "images\\skycodes\\89x89\\20b.png",
+ "20c.png": "images\\skycodes\\89x89\\20c.png",
+ "23.png": "images\\skycodes\\89x89\\23.png",
+ "25.png": "images\\skycodes\\89x89\\25.png",
+ "25b.png": "images\\skycodes\\89x89\\25b.png",
+ "26.png": "images\\skycodes\\89x89\\26.png",
+ "27.png": "images\\skycodes\\89x89\\27.png",
+ "27b.png": "images\\skycodes\\89x89\\27b.png",
+ "29.png": "images\\skycodes\\89x89\\29.png",
+ "29b.png": "images\\skycodes\\89x89\\29b.png",
+ "31.png": "images\\skycodes\\89x89\\31.png",
+ "31b.png": "images\\skycodes\\89x89\\31b.png",
+ "34_33.png": "images\\skycodes\\89x89\\34_33.png",
+ "40.png": "images\\skycodes\\89x89\\40.png",
+ "43.png": "images\\skycodes\\89x89\\43.png",
+ "44.png": "images\\skycodes\\89x89\\44.png",
+ "5.png": "images\\skycodes\\89x89\\5.png",
+ "7.png": "images\\skycodes\\89x89\\7.png",
+ "9.png": "images\\skycodes\\89x89\\9.png",
+ "9b.png": "images\\skycodes\\89x89\\9b.png",
+ "9c.png": "images\\skycodes\\89x89\\9c.png"
+ }
+ },
+ "smalllogo.png": "images\\smalllogo.scale-100.png",
+ "splash.png": "images\\splash.scale-100.png",
+ "store.png": "images\\store.scale-100.png",
+ "tinylogo.png": "images\\tinylogo.scale-100.png",
+ "weathermaps": {
+ "maps_thumb.png": "images\\weathermaps\\maps_thumb.png",
+ "maps_thumb_active.png": "images\\weathermaps\\maps_thumb_active.png",
+ "maps_thumb_hover.png": "images\\weathermaps\\maps_thumb_hover.png",
+ "pushpin.png": "images\\weathermaps\\pushpin.png"
+ },
+ "weather_placeholder.png": "images\\weather_placeholder.png",
+ "widelogo.png": "images\\widelogo.scale-100.png",
+ "worldweather": {
+ "arrow-bottomright.png": "images\\worldweather\\arrow-bottomright.png",
+ "arrow-topleft.png": "images\\worldweather\\arrow-topleft.png",
+ "landscape": {
+ "africa-ltr.png": "images\\worldweather\\landscape\\africa-ltr.png",
+ "africa-rtl.png": "images\\worldweather\\landscape\\africa-rtl.png",
+ "asia-ltr.png": "images\\worldweather\\landscape\\asia-ltr.png",
+ "asia-rtl.png": "images\\worldweather\\landscape\\asia-rtl.png",
+ "europe-ltr.png": "images\\worldweather\\landscape\\europe-ltr.png",
+ "europe-rtl.png": "images\\worldweather\\landscape\\europe-rtl.png",
+ "northamerica-ltr.png": "images\\worldweather\\landscape\\northamerica-ltr.png",
+ "northamerica-rtl.png": "images\\worldweather\\landscape\\northamerica-rtl.png",
+ "oceania-ltr.png": "images\\worldweather\\landscape\\oceania-ltr.png",
+ "oceania-rtl.png": "images\\worldweather\\landscape\\oceania-rtl.png",
+ "southamerica-ltr.png": "images\\worldweather\\landscape\\southamerica-ltr.png",
+ "southamerica-rtl.png": "images\\worldweather\\landscape\\southamerica-rtl.png",
+ "worldmap.png": "images\\worldweather\\landscape\\worldmap.png"
+ },
+ "portrait": {
+ "africa.png": "images\\worldweather\\portrait\\africa.png",
+ "asia.png": "images\\worldweather\\portrait\\asia.png",
+ "europe.png": "images\\worldweather\\portrait\\europe.png",
+ "northamerica.png": "images\\worldweather\\portrait\\northamerica.png",
+ "oceania.png": "images\\worldweather\\portrait\\oceania.png",
+ "southamerica.png": "images\\worldweather\\portrait\\southamerica.png",
+ "worldmap.png": "images\\worldweather\\portrait\\worldmap.png"
+ }
+ }
+ },
+ "js": {
+ "app.js": "js\\app.js",
+ "chart.js": "js\\chart.js",
+ "default.js": "js\\default.js",
+ "delayedBasePage.js": "js\\delayedBasePage.js",
+ "dummyTask.js": "js\\dummyTask.js",
+ "errorCodes.js": "js\\errorCodes.js",
+ "freutility.js": "js\\freutility.js",
+ "geocodeCache.js": "js\\geocodeCache.js",
+ "geocodeLocation.js": "js\\geocodeLocation.js",
+ "geocodePolygonSearch.js": "js\\geocodePolygonSearch.js",
+ "jquery.js1": "js\\jquery.js1",
+ "jqueryuiAll_c.js1": "js\\jqueryuiAll_c.js1",
+ "locationSuggest.js": "js\\locationSuggest.js",
+ "locationTracking.js": "js\\locationTracking.js",
+ "mapsFlyoutUI.js": "js\\mapsFlyoutUI.js",
+ "predict.js": "js\\predict.js",
+ "processListener.js": "js\\processListener.js",
+ "search.js": "js\\search.js",
+ "settingsManager.js": "js\\settingsManager.js",
+ "settingsUI.js": "js\\settingsUI.js",
+ "share.js": "js\\share.js",
+ "topEdgy.js": "js\\topEdgy.js",
+ "weather.js": "js\\weather.js",
+ "weatherConfigs.js": "js\\weatherConfigs.js",
+ "weatherServices.js": "js\\weatherServices.js",
+ "weatherUtilities.js": "js\\weatherUtilities.js"
+ },
+ "lib": {
+ "UserInteractionCrunched.js": "lib\\UserInteractionCrunched.js"
+ },
+ "MarketConfiguration.xml": "MarketConfiguration.xml",
+ "Microsoft.Bing.AppEx.Telemetry": {
+ "Doc.Platform.Telemetry.xml": "Microsoft.Bing.AppEx.Telemetry\\Doc.Platform.Telemetry.xml"
+ },
+ "MicrosoftAdvertising.ini": "MicrosoftAdvertising.ini",
+ "panoramas": {
+ "articlereader": {
+ "articleReaderPage.html": "panoramas\\articlereader\\articleReaderPage.html",
+ "articleReaderPage.js": "panoramas\\articlereader\\articleReaderPage.js"
+ },
+ "dailyforecast": {
+ "dailyForecast.html": "panoramas\\dailyforecast\\dailyForecast.html",
+ "dailyForecast.js": "panoramas\\dailyforecast\\dailyForecast.js"
+ },
+ "home": {
+ "home.html": "panoramas\\home\\home.html",
+ "home.js": "panoramas\\home\\home.js"
+ },
+ "myplaces": {
+ "favoritesTemplate.html": "panoramas\\myplaces\\favoritesTemplate.html",
+ "MyPlaces.html": "panoramas\\myplaces\\MyPlaces.html",
+ "MyPlaces.js": "panoramas\\myplaces\\MyPlaces.js"
+ },
+ "photosynthviewer": {
+ "photosynthViewer.html": "panoramas\\photosynthviewer\\photosynthViewer.html",
+ "photosynthViewer.js": "panoramas\\photosynthviewer\\photosynthViewer.js"
+ },
+ "search": {
+ "searchPage.html": "panoramas\\search\\searchPage.html",
+ "searchPage.js": "panoramas\\search\\searchPage.js"
+ },
+ "SkiResorts": {
+ "SkiResorts.html": "panoramas\\SkiResorts\\SkiResorts.html",
+ "SkiResorts.js": "panoramas\\SkiResorts\\SkiResorts.js"
+ },
+ "slideshow": {
+ "SlideshowPage.html": "panoramas\\slideshow\\SlideshowPage.html",
+ "SlideshowPage.js": "panoramas\\slideshow\\SlideshowPage.js"
+ },
+ "tianqi": {
+ "template.html": "panoramas\\tianqi\\template.html"
+ },
+ "weathermaps": {
+ "BaseMap": {
+ "baseMap.js": "panoramas\\weathermaps\\BaseMap\\baseMap.js",
+ "baseMapController.js": "panoramas\\weathermaps\\BaseMap\\baseMapController.js"
+ },
+ "Common": {
+ "mapUtilities.js": "panoramas\\weathermaps\\Common\\mapUtilities.js"
+ },
+ "MapControls": {
+ "Legend.js": "panoramas\\weathermaps\\MapControls\\Legend.js",
+ "MapsTopBar.js": "panoramas\\weathermaps\\MapControls\\MapsTopBar.js",
+ "SeekBar.js": "panoramas\\weathermaps\\MapControls\\SeekBar.js",
+ "TimeStamp.js": "panoramas\\weathermaps\\MapControls\\TimeStamp.js",
+ "ZoomControl.js": "panoramas\\weathermaps\\MapControls\\ZoomControl.js"
+ },
+ "MapLayers": {
+ "CanvasLayer": {
+ "CanvasDataManager.js": "panoramas\\weathermaps\\MapLayers\\CanvasLayer\\CanvasDataManager.js",
+ "CanvasImageRenderer.js": "panoramas\\weathermaps\\MapLayers\\CanvasLayer\\CanvasImageRenderer.js",
+ "CanvasLayer.js": "panoramas\\weathermaps\\MapLayers\\CanvasLayer\\CanvasLayer.js"
+ },
+ "LabelsLayer": {
+ "LabelsTileLayer.js": "panoramas\\weathermaps\\MapLayers\\LabelsLayer\\LabelsTileLayer.js"
+ },
+ "MapLayer.js": "panoramas\\weathermaps\\MapLayers\\MapLayer.js"
+ },
+ "WeatherMaps.html": "panoramas\\weathermaps\\WeatherMaps.html",
+ "WeatherMaps.js": "panoramas\\weathermaps\\WeatherMaps.js"
+ },
+ "worldweather": {
+ "locationGroups.json": "panoramas\\worldweather\\locationGroups.json",
+ "mapsTemplate.html": "panoramas\\worldweather\\mapsTemplate.html",
+ "WorldWeather.html": "panoramas\\worldweather\\WorldWeather.html",
+ "WorldWeather.js": "panoramas\\worldweather\\WorldWeather.js"
+ }
+ },
+ "photosynth": {
+ "css": {
+ "style.css": "photosynth\\css\\style.css"
+ },
+ "js": {
+ "jspanoviewer.js": "photosynth\\js\\jspanoviewer.js"
+ }
+ },
+ "Platform": {
+ "PlatformConfiguration.xml": "Platform\\PlatformConfiguration.xml"
+ },
+ "resources": {
+ "countryRegionCodes.json": "resources\\countryRegionCodes.json",
+ "countryToMapRegion.json": "resources\\countryToMapRegion.json",
+ "sampledata": {
+ "beijing": {
+ "c": {
+ "historicalWeather.json": "resources\\sampledata\\beijing\\c\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\beijing\\c\\overview.json"
+ }
+ },
+ "london": {
+ "c": {
+ "historicalWeather.json": "resources\\sampledata\\london\\c\\historicalWeather.json",
+ "images": {
+ "basemapAerial.jpg": "resources\\sampledata\\london\\c\\images\\basemapAerial.jpg",
+ "basemapWeatherLight.jpg": "resources\\sampledata\\london\\c\\images\\basemapWeatherLight.jpg",
+ "clouds.png": "resources\\sampledata\\london\\c\\images\\clouds.png",
+ "labelsWeatherDark.png": "resources\\sampledata\\london\\c\\images\\labelsWeatherDark.png",
+ "labelsWeatherLight.png": "resources\\sampledata\\london\\c\\images\\labelsWeatherLight.png",
+ "precipitation.png": "resources\\sampledata\\london\\c\\images\\precipitation.png",
+ "satellite.png": "resources\\sampledata\\london\\c\\images\\satellite.png",
+ "temperature.png": "resources\\sampledata\\london\\c\\images\\temperature.png"
+ },
+ "interactiveMapsResponse.json": "resources\\sampledata\\london\\c\\interactiveMapsResponse.json",
+ "overview.json": "resources\\sampledata\\london\\c\\overview.json"
+ },
+ "f": {
+ "historicalWeather.json": "resources\\sampledata\\london\\f\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\london\\f\\overview.json"
+ }
+ },
+ "seoul": {
+ "c": {
+ "historicalWeather.json": "resources\\sampledata\\seoul\\c\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\seoul\\c\\overview.json"
+ },
+ "f": {
+ "historicalWeather.json": "resources\\sampledata\\seoul\\f\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\seoul\\f\\overview.json"
+ }
+ },
+ "taipei": {
+ "c": {
+ "historicalWeather.json": "resources\\sampledata\\taipei\\c\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\taipei\\c\\overview.json"
+ },
+ "f": {
+ "historicalWeather.json": "resources\\sampledata\\taipei\\f\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\taipei\\f\\overview.json"
+ }
+ },
+ "tokyo": {
+ "c": {
+ "historicalWeather.json": "resources\\sampledata\\tokyo\\c\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\tokyo\\c\\overview.json"
+ },
+ "f": {
+ "historicalWeather.json": "resources\\sampledata\\tokyo\\f\\historicalWeather.json",
+ "overview.json": "resources\\sampledata\\tokyo\\f\\overview.json"
+ }
+ }
+ }
+ },
+ "sqlite3.dll": "sqlite3.dll",
+ "WeatherControls": {
+ "clusters": {
+ "entityClusterProvider.js": "WeatherControls\\clusters\\entityClusterProvider.js",
+ "heroClusterControl.js": "WeatherControls\\clusters\\heroClusterControl.js",
+ "interactiveMapsClusterControl.js": "WeatherControls\\clusters\\interactiveMapsClusterControl.js"
+ },
+ "core": {
+ "ClusterControls.js": "WeatherControls\\core\\ClusterControls.js",
+ "Models.js": "WeatherControls\\core\\Models.js",
+ "Utilities.js": "WeatherControls\\core\\Utilities.js",
+ "ViewBlocks.js": "WeatherControls\\core\\ViewBlocks.js",
+ "ViewControls.js": "WeatherControls\\core\\ViewControls.js",
+ "weatherBasePage.js": "WeatherControls\\core\\weatherBasePage.js"
+ },
+ "views": {
+ "mapsViewBlock.js": "WeatherControls\\views\\mapsViewBlock.js",
+ "secondaryViews.js": "WeatherControls\\views\\secondaryViews.js"
+ }
+ }
+ },
+ "MicrosoftAdvertising": {
+ "UIStrings": {
+ "AdSettings_CommandText": "Microsoft Advertising",
+ "AdSettings_Flyout_OptedOut_Message1": "Tha thu a' diùltadh sanasachd phearsantaichte o Microsoft an-dràsta fhèin. Briog ",
+ "AdSettings_Flyout_OptedOut_Message2": " airson barrachd fiosrachaidh air na roghainnean.",
+ "AdSettings_Flyout_OptedOut_Message_Here": "an-seo",
+ "AdSettings_Flyout_OptInSwitch_Header": "Cleachdaidh Microsoft Advertising am fiosrachadh agam ach am faigh mi sanasachd phearsantaichte san aplacaid seo.",
+ "AdSettings_Flyout_OptInSwitch_Off": "Chan eil",
+ "AdSettings_Flyout_OptInSwitch_On": "Tha",
+ "AdSettings_Flyout_Privacy": "Aithris na prìobhaideachd",
+ "AdSettings_Flyout_SectionName": "Roghainnean na sanasachd",
+ "AdSettings_Flyout_SignInPrompt1": "Chan eil thu clàraichte a-staigh an-dràsta fhèin. ",
+ "AdSettings_Flyout_SignInPrompt2": " airson sanasachd phearsantaichte a chur an comas san aplacaid seo.",
+ "AdSettings_Flyout_SignInPrompt_SignIn": "Clàraich a-steach",
+ "AdSettings_Flyout_SignInPrompt_SignOut": "Clàraich a-mach",
+ "AdSettings_Flyout_StatusUnknown_Message": "Chan eil fiosrachadh a' chunntais Microsoft agad ri làimh an-dràsta fhèin.",
+ "AdSettings_Flyout_Title": "Sanasachd"
+ }
+ },
+ "resources": {
+ "About": "About",
+ "AccuWeather": "AccuWeather",
+ "accuweatherUrl": "http://www.accuweather.com",
+ "AddButtonTitle": "Add",
+ "Africa": "Africa",
+ "Afternoon Cloudy": "Afternoon Cloudy",
+ "Afternoon Ice ": {
+ " Snow": "Aft. Ice/Snow"
+ },
+ "Afternoon Rain": "Afternoon Rain",
+ "Afternoon Snow": "Afternoon Snow",
+ "AirportImpact": "Кашњење летова",
+ "Alert Bar Heading": "Alert",
+ "AlertShort": "ALERT {0}",
+ "AlertShortWithCount": "ALERT {0} {1} more",
+ "AlertWarning": "ALERT {0} from {1} to {2}",
+ "AlertWarningWithCount": "ALERT {0} from {1} to {2} {3} more",
+ "AM Thunderstorms": "AM T-Storms",
+ "appFeedbackTitle": "Weather Application Feedback",
+ "AppTitle": "Време",
+ "Asia": "Asia/Middle East",
+ "Barometer": "Барометар",
+ "BingAttribution": "Powered by",
+ "Blizzard": "Blizzard",
+ "BlizzardCredits": "Blizzard {0}",
+ "Blowing Snow": "Blowing Snow",
+ "BlowingSnowCredits": "Blowing Snow {0}",
+ "C": "C",
+ "CCDailyAttribution": "Current conditions, daily forecasts by",
+ "CCDailyMapsAttribution": "Current conditions, daily forecasts and maps by",
+ "CelsiusSetting": "Celsius",
+ "Clear": "Clear",
+ "ClearButtonTitle": "Clear",
+ "ClearCredits": "Clear {0}",
+ "clearSearchHistoryButton": "Clear History",
+ "CloseButtonLabel": "Close",
+ "CloudCover": "Облачност",
+ "Cloudy": "Cloudy",
+ "Cloudy ": {
+ " Afternoon Sun": "Cloudy/Aft. Sun",
+ " Windy": "Cloudy / Windy"
+ },
+ "CloudyCredits": "Cloudy {0}",
+ "CouldNotLoadAlertsData": "Unable to fetch alerts data.",
+ "CouldNotLoadDataMsg": "Unable to refresh data.",
+ "Current": "Bing Време",
+ "CurrentLocDataNotAvailable": "Weather data not available for your current location. Please enter your location manually or try again later.",
+ "DataAttribution": "Data provided by",
+ "DefaultShortNameForPinFlyout": "Време",
+ "Dewpoint": "Dew Point",
+ "DisplayUnits": "Units",
+ "DopplerRadar": "Доплер радар",
+ "Drizzle": "Drizzle",
+ "DrizzleCredits": "Drizzle {0}",
+ "DustCloudyCredits": "Dust Cloudy {0}",
+ "Duststorms": "Duststorms",
+ "DustyClearCredits": "Dusty Clear {0}",
+ "EnterLocation": "Enter Location",
+ "ErrorInFRE": "Unable to get weather data for your current location. Please try again later.",
+ "Europe": "Europe",
+ "F": "F",
+ "FahrenheitSetting": "Фаренхајт",
+ "Fair": "Fair",
+ "favHighLowText": "High / Low",
+ "Favorites": "Favorites",
+ "FavoriteTileErrorMsg": "There was a problem. Please try again.",
+ "FeelsLike": "Feels like {0}",
+ "Flurries": "Flurries",
+ "Fog": "Fog",
+ "FogCredits": "Fog {0}",
+ "Foreca": "Foreca",
+ "forecaUrl": "http://www.foreca.com",
+ "Freezing": "Freezing",
+ "Freezing Drizzle": "Freezing Drizzle",
+ "Freezing Rain": "Freezing Rain",
+ "FreezingRainCredits": "Freezing Rain {0}",
+ "FrigidCredits": "Frigid {0}",
+ "FromText": "From",
+ "FromToText": "From {0} to {1}",
+ "GraphDays": "{0} days",
+ "GraphHoursPerDay": "{0} сати/дан",
+ "Hazy Sunshine": "Hazy Sunshine",
+ "HeavyRainCredits": "Heavy Rain {0}",
+ "HighLowText": "{0}/{1}",
+ "HistoricalWeather": "Historical Weather",
+ "HistoricDataAttribution": "Historic conditions by",
+ "HistoricLengthWithUnit": "{0} {1}",
+ "Home": "Home",
+ "Hot and Humid": "Hot and Humid",
+ "HourlyForecast": "Прогноза на сат",
+ "HourlyForecastFeelsLikeTitle": "Субјективни осећај",
+ "HourlyForecastForecastTitle": "Временска прогноза",
+ "HourlyForecastPrecipChanceTitle": "Могућност падавина",
+ "HourlyForecastTimeTitle": "Време",
+ "Humidity": "Âëŕćíîńň ",
+ "HWAttribution": "Historical Weather by",
+ "Ice ": {
+ " Snow": "Ice / Snow"
+ },
+ "ImageCredits": "Image Credits",
+ "iMap Weather": "WDT",
+ "imap weatherUrl": "http://www.wdtinc.com",
+ "InterstateForecast": "Стање на путевима",
+ "Isolated Thunderstorms": "Isolated T-Storms",
+ "KilometresPerHour": "{0} km/h",
+ "LastUpdatedDataTime": "Last Updated at {0}",
+ "LeftText": "Light",
+ "LegendName": "Падавине",
+ "lessDailyConditionsDataText": "Less",
+ "Light Showers": "Light Showers",
+ "LightShowersCredits": "Light Showers {0}",
+ "LocalTime": "Локално време",
+ "LocationDetectionFailed": "Unable to detect your current location. Try entering your location manually.",
+ "LocationDisabledError": "Location detection is turned off. Use the Settings menu to turn it on.",
+ "LocationPinnedToStart": "Unpin the location from the Start screen before setting it as default.",
+ "LocationSearchFetchError": "Error querying location suggestions.",
+ "LocDetectionUnknownError": "An unknown error occurred while detecting your location. Please try again later.",
+ "Maps": "Мапе",
+ "MaxFavoritesLimitReached": "Your Favorites list is full. Please remove a location before adding a new one.",
+ "MaxPinnedLocationsLimitReached": "You have pinned the maximum number of locations. Please unpin a location before pinning a new one.",
+ "MilesPerHour": "{0} м/сат",
+ "Month1": "јануар",
+ "Month10": "октобар",
+ "Month11": "новембар",
+ "Month12": "децембар",
+ "Month2": "фебруар",
+ "Month3": "март",
+ "Month4": "април",
+ "Month5": "мај",
+ "Month6": "јун",
+ "Month7": "јул",
+ "Month8": "август",
+ "Month9": "септембар",
+ "MonthlyMaxTemp": "Max. Temp.",
+ "MonthlyMinTemp": "Min. Temp.",
+ "MonthlyRainfall": "Киша",
+ "MonthlyRainyDays": "Rainy Days",
+ "MonthlySeaTemp": "Темп. мора",
+ "MonthlySnowDays": "Снежни дани",
+ "MonthlySunshine": "Сунчано",
+ "MonthShort1": "ЈАН",
+ "MonthShort10": "ОКТ",
+ "MonthShort11": "НОВ",
+ "MonthShort12": "ДЕЦ",
+ "MonthShort2": "ФЕБ",
+ "MonthShort3": "МАР",
+ "MonthShort4": "АПР",
+ "MonthShort5": "мај",
+ "MonthShort6": "ЈУН",
+ "MonthShort7": "ЈУЛ",
+ "MonthShort8": "АВГ",
+ "MonthShort9": "СЕП",
+ "More Alerts": "још",
+ "moreDailyConditionsDataText": "Још",
+ "Morning Fog ": {
+ " Afternoon Sun": "AM Fog/Aft. Sun",
+ " Cloudy": "AM Fog/Cloudy"
+ },
+ "Morning Ice ": {
+ " Snow": "AM Ice/Snow"
+ },
+ "Morning Rain": "Morning Rain",
+ "Morning Snow": "Morning Snow",
+ "Mostly Cloudy": "Mostly Cloudy",
+ "Mostly Sunny": "Mostly Sunny",
+ "MostlyCloudyCredits": "Mostly Cloudy {0}",
+ "Multiple Alerts Heading": "Упозорења",
+ "MyPlaces": "Places",
+ "National": "Национална",
+ "nextDailyConditionsDataText": "Next",
+ "NoInternetConnectionError": "You are not connected to the Internet. Please check your Internet connection and try again.",
+ "NoInternetConnectionInfo": "Internet connection is unavailable.",
+ "NoInternetOnSettingChange": "Settings updated. Please connect to the Internet to confirm your changes.",
+ "NorthAmerica": "North America",
+ "NoSearchResults": "No results matched your search.",
+ "Oceania": "Australia/Pacific",
+ "Overview": "OVERVIEW",
+ "Partly Cloudy": "Partly Cloudy",
+ "PartlyCloudyCredits": "Partly Cloudy {0}",
+ "PinButtonTitle": "Pin",
+ "PM Thunderstorms": "PM T-Storms",
+ "Precipitation": "Падавине",
+ "prevDailyConditionsDataText": "Previous",
+ "PrivacyStatement": "Privacy Statement",
+ "Publisher": "Microsoft Corporation",
+ "Rain": "Киша",
+ "Rain ": {
+ " Snow": "Rain / Snow",
+ " Windy": "Rain / Windy"
+ },
+ "Rain turning to Snow": "Rain to Snow",
+ "RainCredits": "Rain {0}",
+ "RainfallFilter": "Киша",
+ "RainSnowCredits": "Rain and Snow {0}",
+ "RecentSearches": "Recent Searches",
+ "Regional": "Регионална",
+ "RemoveButtonTitle": "Remove",
+ "RemoveLocButtonTitle": "Remove Location",
+ "RetryButtonLabel": "Retry",
+ "RightText": "Heavy",
+ "Satellite": "Сателитска",
+ "Scattered Flurries": "Scattered Flurries",
+ "Scattered Thunderstorms": "Scatt'd T-Storms",
+ "ScatteredCloudsCredits": "Scattered Clouds {0}",
+ "ScatteredFlurriesCredits": "Scattered Flurries {0}",
+ "searchboxInvalidEntry": "Invalid location",
+ "searchboxPlaceHolderTest": "Enter location",
+ "SearchHistory": "Search History",
+ "SeeMoreTruncatedText": "See more...",
+ "SetDefaultButtonTitle": "Set as Default",
+ "SetDefaultMaxLimitReached": "Your Favorites list is full. Please remove a location before setting a new one as your default.",
+ "Settings": "Settings",
+ "SevereWeatherAlerts": "Упозорења на временске непогоде",
+ "Showers": "Showers",
+ "Showers ": {
+ " Clear": "Showers/Clear"
+ },
+ "Single Alert Heading": "Alert",
+ "Sleet": "Sleet",
+ "Smoke": "Smoke",
+ "SnappedAppTitle": "Bing Време",
+ "SnapTime": "{0} Local Time",
+ "Snow": "Снег",
+ "Snow ": {
+ " Windy": "Snow / Windy"
+ },
+ "Snow Showers": "Snow Showers",
+ "Snow Showers ": {
+ " Sun": "Snow/Sun"
+ },
+ "Snow turning to Rain": "Snow to Rain",
+ "SnowCredits": "Snow {0}",
+ "SnowDaysFilter": "Снежни дани",
+ "SouthAmerica": "South America",
+ "SpeedUnitsInKMPHWithDirection": "{0} {1} kmph",
+ "SpeedUnitsInMPHWithDirection": "{0} {1} mph",
+ "Sunny ": {
+ " Windy": "Sunny / Windy"
+ },
+ "Sunny (Clear)": "Sunny (Clear)",
+ "SunshineAndSeaTempAttribution": "Sunshine & Sea temp by",
+ "SunshineAttribution": "Sunshine by",
+ "SunshineFilter": "Сунчано",
+ "SunshineSeaTempAttribution": "Sunshine & Sea temperature data by",
+ "Temperature": "Температурна",
+ "TemperatureFilter": "Температурна",
+ "TemperatureWithDegreeCelsius": "{0}°C",
+ "TemperatureWithDegreeFahrenheit": "{0}°F",
+ "TemperatureWithDegreeFahrenheit.comment": "temperature value with degree symbol and fahrenheit unit",
+ "TemperatureWithDegreeUnit": "{0}°",
+ "TermsOfUse": "Terms of Use",
+ "Thunderstorms": "Thunderstorms",
+ "ThunderstormsCredits": "Thunderstorms {0}",
+ "ToText": "to",
+ "Travel": "Туристичка",
+ "UnitInCentimetres": "{0} cm",
+ "UnitInDays": "{0} days",
+ "UnitInHourPerDay": "{0} hr/day",
+ "UnitInHoursPerDay": "{0} сати/дан",
+ "UnitInInches": "{0} у",
+ "UnitInKilometres": "{0} км",
+ "UnitInMiles": "{0} mi",
+ "UnitInMillibars": "{0} mb",
+ "UnitInPercentage": "{0}%",
+ "UnknownCredits": "Unknown {0}",
+ "UnpinButtonTitle": "Unpin",
+ "UntilText": "until",
+ "UvIndex": "УВ индекс",
+ "Visibility": "Видљивост",
+ "Weather Underground": "Weather Underground",
+ "weather undergroundUrl": "http://www.wunderground.com",
+ "Weather.com": "weather.com",
+ "weather.comUrl": "http://www.weather.com",
+ "weather2travelUrl": "http://www.weather2travel.com",
+ "WeatherDataNotAvailable": "Weather data not available for this location. Please try again later or enter a different location.",
+ "WeatherDotComForecastAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-tenday",
+ "WeatherDotComMapsAttribution": "View interactive maps at {0}",
+ "WeatherDotComMapsAttributionUrlPrefix": "http://bing.weather.com/weather/map/interactive/",
+ "WeatherDotComMapsAttributionUrlSuffix": "?par=bing&site=winapp8&cm_ven=bing&cm_cat=winapp8&cm_pla=search-us&cm_ite=wx-Imap",
+ "WeatherDotComSeeMoreText": "See more from weather.com",
+ "Wind": "Ветар",
+ "Windy": "Windy",
+ "WindyCredits": "Windy {0}",
+ "Wolfram|Alpha": "Wolfram|Alpha",
+ "wolfram|alphaUrl": "http://www.wolframalpha.com",
+ "World": "World",
+ "WorldWeather": "World Weather",
+ "WorldWeatherTitle": "World Weather"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/id.json b/packages/microsoft.bingweather/resources/id.json
new file mode 100644
index 00000000..3b45318e
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/id.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "33",
+ "Language_af": "Bahasa Afrikaans",
+ "Language_am": "Bahasa Amhar",
+ "Language_ar": "Bahasa Arab",
+ "Language_arn-Latn": "Bahasa Mapudungan",
+ "Language_as": "Bahasa Assam",
+ "Language_az": "Azeri (Latin)",
+ "Language_az-Cyrl": "Azerbaijan (Sirilik)",
+ "Language_az-Latn": "Azerbaijan (Latin)",
+ "Language_ba-Cyrl": "Bahasa Bashkir",
+ "Language_be": "Bahasa Belarus",
+ "Language_bg": "Bahasa Bulgaria",
+ "Language_bn": "Bahasa Bangla",
+ "Language_bn-bd": "Bangla (Bangladesh)",
+ "Language_bn-in": "Bangla (India)",
+ "Language_br-Latn": "Bahasa Breton",
+ "Language_bs": "Bosnia (Latin)",
+ "Language_bs-Cyrl": "Bosnia (Sirilik)",
+ "Language_bs-Latn": "Bosnia (Latin)",
+ "Language_ca": "Bahasa Katalan",
+ "Language_ca-ES-valencia": "Bahasa Valencia",
+ "Language_chr": "Bahasa Cherokee",
+ "Language_chr-Cher": "Cherokee (Cherokee)",
+ "Language_co-Latn": "Bahasa Korsika",
+ "Language_cs": "Bahasa Ceko",
+ "Language_cy": "Bahasa Wales",
+ "Language_da": "Bahasa Denmark",
+ "Language_de": "Bahasa Jerman",
+ "Language_dsb": "Bahasa Sorbia Hilir",
+ "Language_dv": "Bahasa Divehi",
+ "Language_el": "Bahasa Yunani",
+ "Language_en": "Bahasa Inggris",
+ "Language_es": "Bahasa Spanyol",
+ "Language_et": "Bahasa Estonia",
+ "Language_eu": "Bahasa Basque",
+ "Language_fa": "Bahasa Persia",
+ "Language_ff-Latn": "Bahasa Fula",
+ "Language_fi": "Bahasa Finlandia",
+ "Language_fil-Latn": "Bahasa Filipino",
+ "Language_fo": "Bahasa Faroe",
+ "Language_fr": "Bahasa Prancis",
+ "Language_fy": "Bahasa Frisia",
+ "Language_ga": "Bahasa Irlandia",
+ "Language_gd": "Bahasa Gaelik Skotlandia",
+ "Language_gd-Latn": "Bahasa Gaelik Skotlandia",
+ "Language_gl": "Bahasa Galisia",
+ "Language_gsw": "Bahasa Alsatian",
+ "Language_gu": "Bahasa Gujarat",
+ "Language_ha": "Hausa (Latin)",
+ "Language_ha-Latn": "Hausa (Latin)",
+ "Language_he": "Bahasa Ibrani",
+ "Language_hi": "Bahasa Hindi",
+ "Language_hr": "Bahasa Kroasia",
+ "Language_hsb": "Bahasa Sorbia Hulu",
+ "Language_hu": "Bahasa Hongaria",
+ "Language_hy": "Bahasa Armenia",
+ "Language_id": "Bahasa Indonesia",
+ "Language_ig": "Bahasa Igbo",
+ "Language_ig-Latn": "Bahasa Igbo",
+ "Language_is": "Bahasa Islandia",
+ "Language_it": "Bahasa Italia",
+ "Language_iu-Latn": "Inuktitut (Latin)",
+ "Language_ja": "Bahasa Jepang",
+ "Language_ka": "Bahasa Georgia",
+ "Language_kk": "Bahasa Kazakh",
+ "Language_kl": "Bahasa Kalaallisut",
+ "Language_km": "Bahasa Khmer",
+ "Language_kn": "Bahasa Kannada",
+ "Language_ko": "Bahasa Korea",
+ "Language_kok": "Bahasa Konkani",
+ "Language_ku": "Bahasa Kurdi",
+ "Language_ku-Arab": "Bahasa Kurdi Tengah",
+ "Language_ky": "Bahasa Kirgiz",
+ "Language_ky-Cyrl": "Bahasa Kirgiz",
+ "Language_lb": "Bahasa Luksemburg",
+ "Language_lo": "Bahasa Laos",
+ "Language_lt": "Bahasa Lithuania",
+ "Language_lv": "Bahasa Latvia",
+ "Language_mi-Latn": "Bahasa Maori",
+ "Language_mk": "Bahasa Makedonia",
+ "Language_ml": "Bahasa Malayalam",
+ "Language_mn": "Mongolia (Sirilik)",
+ "Language_mn-Cyrl": "Mongolia (Sirilik)",
+ "Language_mr": "Bahasa Marathi",
+ "Language_ms": "Bahasa Malaysia",
+ "Language_mt": "Bahasa Malta",
+ "Language_nb": "Norwegia (Bokmål)",
+ "Language_ne": "Bahasa Nepal",
+ "Language_nl": "Bahasa Belanda",
+ "Language_nn": "Norwegia (Nynorsk)",
+ "Language_nso": "Bahasa Sesotho sa Leboa",
+ "Language_oc-Latn": "Bahasa Ositania",
+ "Language_or": "Bahasa Odia",
+ "Language_pa": "Punjabi (Gurmukhi)",
+ "Language_pa-Arab": "Punjabi (Arab)",
+ "Language_pl": "Bahasa Polandia",
+ "Language_prs": "Bahasa Dari",
+ "Language_prs-arab": "Bahasa Dari",
+ "Language_ps": "Bahasa Pashto",
+ "Language_pt": "Bahasa Portugis",
+ "Language_pt-br": "Portugis (Brasil)",
+ "Language_pt-pt": "Portugis (Portugal)",
+ "Language_quc-Latn": "Bahasa K'iche'",
+ "Language_qut": "K'iche",
+ "Language_quz-Latn": "Bahasa Quechua",
+ "Language_ro": "Bahasa Rumania",
+ "Language_ru": "Bahasa Rusia",
+ "Language_rw": "Bahasa Kinyarwanda",
+ "Language_sa-Deva": "Bahasa Sansekerta",
+ "Language_sah-Cyrl": "Bahasa Sakha",
+ "Language_sd-Arab": "Sindhi (Arab)",
+ "Language_se-Latn": "Bahasa Sami Utara",
+ "Language_si": "Bahasa Sinhala",
+ "Language_sk": "Bahasa Slowakia",
+ "Language_sl": "Bahasa Slovenia",
+ "Language_sma-Latn": "Bahasa Sami Selatan",
+ "Language_smj-Latn": "Bahasa Sami Lule",
+ "Language_smn-Latn": "Bahasa Sami Inari",
+ "Language_sms-Latn": "Bahasa Sami Skolt",
+ "Language_sq": "Bahasa Albania",
+ "Language_sr-Cyrl": "Serbia (Sirilik)",
+ "Language_sr-cyrl-ba": "Serbia (Sirilik, Bosnia-Herzegovina)",
+ "Language_sr-Latn": "Serbia (Latin)",
+ "Language_sv": "Bahasa Swedia",
+ "Language_sw": "Bahasa Kiswahili",
+ "Language_syr-Syrc": "Bahasa Suryani",
+ "Language_ta": "Bahasa Tamil",
+ "Language_te": "Bahasa Telugu",
+ "Language_tg-Cyrl": "Tajik (Sirilik)",
+ "Language_th": "Bahasa Thai",
+ "Language_ti": "Bahasa Tigrinya",
+ "Language_tk-Latn": "Turkmen (Latin)",
+ "Language_tn": "Bahasa Setswana",
+ "Language_tr": "Bahasa Turki",
+ "Language_tt": "Bahasa Tatar",
+ "Language_tt-Cyrl": "Tatar (Sirilik)",
+ "Language_tzm-Latn": "Tamazight (Latin)",
+ "Language_ug": "Bahasa Uighur",
+ "Language_ug-Arab": "Bahasa Uighur",
+ "Language_uk": "Bahasa Ukraina",
+ "Language_ur": "Bahasa Urdu",
+ "Language_uz-Cyrl": "Uzbek (Sirilik)",
+ "Language_uz-Latn": "Uzbek (Latin)",
+ "Language_vi": "Bahasa Vietnam",
+ "Language_wo-Latn": "Bahasa Wolof",
+ "Language_xh": "Bahasa isiXhosa",
+ "Language_yo": "Bahasa Yoruba",
+ "Language_yo-Latn": "Bahasa Yoruba",
+ "Language_zh-Hans": "Cina(Modern)",
+ "Language_zh-Hant": "China (Tradisional)",
+ "Language_zu": "Bahasa isiZulu",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "Andorra",
+ "Region_Display_AE": "Uni Emirat Arab",
+ "Region_Display_AF": "Afghanistan",
+ "Region_Display_AG": "Antigua dan Barbuda",
+ "Region_Display_AI": "Anguilla",
+ "Region_Display_AL": "Albania",
+ "Region_Display_AM": "Armenia",
+ "Region_Display_AO": "Angola",
+ "Region_Display_AR": "Argentina",
+ "Region_Display_AS": "Samoa Amerika",
+ "Region_Display_AT": "Austria",
+ "Region_Display_AU": "Australia",
+ "Region_Display_AW": "Aruba",
+ "Region_Display_AZ": "Azerbaijan",
+ "Region_Display_BA": "Bosnia dan Herzegovina",
+ "Region_Display_BB": "Barbados",
+ "Region_Display_BD": "Bangladesh",
+ "Region_Display_BE": "Belgia",
+ "Region_Display_BF": "Burkina Faso",
+ "Region_Display_BG": "Bulgaria",
+ "Region_Display_BH": "Bahrain",
+ "Region_Display_BI": "Burundi",
+ "Region_Display_BJ": "Benin",
+ "Region_Display_BM": "Bermuda",
+ "Region_Display_BN": "Brunei",
+ "Region_Display_BO": "Bolivia",
+ "Region_Display_BQ": "Bonaire",
+ "Region_Display_BR": "Brasil",
+ "Region_Display_BS": "Bahama",
+ "Region_Display_BT": "Bhutan",
+ "Region_Display_BW": "Botswana",
+ "Region_Display_BY": "Belarus",
+ "Region_Display_BZ": "Belize",
+ "Region_Display_CA": "Kanada",
+ "Region_Display_CC": "Kepulauan Cocos (Keeling)",
+ "Region_Display_CD": "Kongo (RDK)",
+ "Region_Display_CF": "Republik Afrika Tengah",
+ "Region_Display_CG": "Kongo",
+ "Region_Display_CH": "Swiss",
+ "Region_Display_CI": "Pantai Gading (Côte d’Ivoire)",
+ "Region_Display_CK": "Kepulauan Cook",
+ "Region_Display_CL": "Chili",
+ "Region_Display_CM": "Kamerun",
+ "Region_Display_CN": "China",
+ "Region_Display_CO": "Kolombia",
+ "Region_Display_CR": "Kosta Rika",
+ "Region_Display_CS": "Serbia dan Montenegro (Bekas)",
+ "Region_Display_CV": "Tanjung Verde",
+ "Region_Display_CW": "Curaçao",
+ "Region_Display_CX": "Pulau Natal",
+ "Region_Display_CY": "Siprus",
+ "Region_Display_CZ": "Republik Ceko",
+ "Region_Display_DE": "Jerman",
+ "Region_Display_DJ": "Djibouti",
+ "Region_Display_DK": "Denmark",
+ "Region_Display_DM": "Dominika",
+ "Region_Display_DO": "Republik Dominika",
+ "Region_Display_DZ": "Aljazair",
+ "Region_Display_EC": "Ekuador",
+ "Region_Display_EE": "Estonia",
+ "Region_Display_EG": "Mesir",
+ "Region_Display_ER": "Eritrea",
+ "Region_Display_ES": "Spanyol",
+ "Region_Display_ET": "Ethiopia",
+ "Region_Display_FI": "Finlandia",
+ "Region_Display_FK": "Kepulauan Falkland (Islas Malvinas)",
+ "Region_Display_FM": "Mikronesia",
+ "Region_Display_FO": "Kepulauan Faroe",
+ "Region_Display_FR": "Prancis",
+ "Region_Display_GA": "Gabon",
+ "Region_Display_GB": "Kerajaan Inggris Bersatu",
+ "Region_Display_GD": "Grenada",
+ "Region_Display_GE": "Georgia",
+ "Region_Display_GF": "Guyana Prancis",
+ "Region_Display_GG": "Guernsey",
+ "Region_Display_GH": "Ghana",
+ "Region_Display_GL": "Tanah Hijau",
+ "Region_Display_GM": "Gambia",
+ "Region_Display_GN": "Guinea",
+ "Region_Display_GP": "Guadeloupe",
+ "Region_Display_GQ": "Guinea Khatulistiwa",
+ "Region_Display_GR": "Yunani",
+ "Region_Display_GT": "Guatemala",
+ "Region_Display_GU": "Guam",
+ "Region_Display_GW": "Guinea-Bissau",
+ "Region_Display_GY": "Guyana",
+ "Region_Display_HK": "Daerah Administratif Khusus Hong Kong",
+ "Region_Display_HN": "Honduras",
+ "Region_Display_HR": "Kroasia",
+ "Region_Display_HT": "Haiti",
+ "Region_Display_HU": "Hongaria",
+ "Region_Display_ID": "Indonesia",
+ "Region_Display_IE": "Irlandia",
+ "Region_Display_IL": "Israel",
+ "Region_Display_IN": "India",
+ "Region_Display_IQ": "Irak",
+ "Region_Display_IR": "Iran",
+ "Region_Display_IS": "Islandia",
+ "Region_Display_IT": "Italia",
+ "Region_Display_JE": "Jersey",
+ "Region_Display_JM": "Jamaika",
+ "Region_Display_JO": "Yordania",
+ "Region_Display_JP": "Jepang",
+ "Region_Display_KE": "Kenya",
+ "Region_Display_KG": "Kirgizstan",
+ "Region_Display_KH": "Kamboja",
+ "Region_Display_KI": "Kiribati",
+ "Region_Display_KM": "Komoro",
+ "Region_Display_KN": "Saint Kitts dan Nevis",
+ "Region_Display_KR": "Korea",
+ "Region_Display_KW": "Kuwait",
+ "Region_Display_KY": "Kepulauan Cayman",
+ "Region_Display_KZ": "Kazakhstan",
+ "Region_Display_LA": "Laos",
+ "Region_Display_LB": "Lebanon",
+ "Region_Display_LC": "Saint Lucia",
+ "Region_Display_LI": "Liechtenstein",
+ "Region_Display_LK": "Sri Lanka",
+ "Region_Display_LR": "Liberia",
+ "Region_Display_LS": "Lesotho",
+ "Region_Display_LT": "Lithuania",
+ "Region_Display_LU": "Luksemburg",
+ "Region_Display_LV": "Latvia",
+ "Region_Display_LY": "Libya",
+ "Region_Display_MA": "Maroko",
+ "Region_Display_MC": "Monako",
+ "Region_Display_MD": "Moldova",
+ "Region_Display_ME": "Montenegro",
+ "Region_Display_MF": "Saint Martin",
+ "Region_Display_MG": "Madagaskar",
+ "Region_Display_MH": "Kepulauan Marshall",
+ "Region_Display_MK": "Republik Makedonia Bekas Yugoslavia",
+ "Region_Display_ML": "Mali",
+ "Region_Display_MM": "Myanmar",
+ "Region_Display_MN": "Mongolia",
+ "Region_Display_MO": "Daerah Administratif Khusus Makau",
+ "Region_Display_MP": "Kepulauan Mariana Utara",
+ "Region_Display_MQ": "Martinique",
+ "Region_Display_MR": "Mauritania",
+ "Region_Display_MS": "Montserrat",
+ "Region_Display_MT": "Malta",
+ "Region_Display_MU": "Mauritius",
+ "Region_Display_MV": "Maladewa",
+ "Region_Display_MW": "Malawi",
+ "Region_Display_MX": "Meksiko",
+ "Region_Display_MY": "Malaysia",
+ "Region_Display_MZ": "Mozambik",
+ "Region_Display_NA": "Namibia",
+ "Region_Display_NC": "Kaledonia Baru",
+ "Region_Display_NE": "Niger",
+ "Region_Display_NF": "Pulau Norfolk",
+ "Region_Display_NG": "Nigeria",
+ "Region_Display_NI": "Nikaragua",
+ "Region_Display_NL": "Belanda",
+ "Region_Display_NO": "Norwegia",
+ "Region_Display_NP": "Nepal",
+ "Region_Display_NR": "Nauru",
+ "Region_Display_NU": "Niue",
+ "Region_Display_NZ": "Selandia Baru",
+ "Region_Display_OM": "Oman",
+ "Region_Display_PA": "Panama",
+ "Region_Display_PE": "Peru",
+ "Region_Display_PF": "Polinesia Prancis",
+ "Region_Display_PG": "Papua Nugini",
+ "Region_Display_PH": "Filipina",
+ "Region_Display_PK": "Pakistan",
+ "Region_Display_PL": "Polandia",
+ "Region_Display_PM": "Saint Pierre dan Miquelon",
+ "Region_Display_PN": "Kepulauan Pitcairn",
+ "Region_Display_PR": "Puerto Riko",
+ "Region_Display_PT": "Portugal",
+ "Region_Display_PW": "Palau",
+ "Region_Display_PY": "Paraguay",
+ "Region_Display_QA": "Qatar",
+ "Region_Display_RE": "Reunion",
+ "Region_Display_RO": "Rumania",
+ "Region_Display_RS": "Serbia",
+ "Region_Display_RU": "Rusia",
+ "Region_Display_RW": "Rwanda",
+ "Region_Display_SA": "Arab Saudi",
+ "Region_Display_SB": "Kepulauan Solomon",
+ "Region_Display_SC": "Seychelles",
+ "Region_Display_SD": "Sudan",
+ "Region_Display_SE": "Swedia",
+ "Region_Display_SG": "Singapura",
+ "Region_Display_SH": "Saint Helena, Ascension dan Tristan da Cunha",
+ "Region_Display_SI": "Slovenia",
+ "Region_Display_SK": "Slowakia",
+ "Region_Display_SL": "Sierra Leone",
+ "Region_Display_SM": "San Marino",
+ "Region_Display_SN": "Senegal",
+ "Region_Display_SO": "Somalia",
+ "Region_Display_SR": "Suriname",
+ "Region_Display_SS": "Sudan Selatan",
+ "Region_Display_ST": "Sao Tome dan Principe",
+ "Region_Display_SV": "El Salvador",
+ "Region_Display_SX": "Sint Maarten",
+ "Region_Display_SY": "Suriah",
+ "Region_Display_SZ": "Swaziland",
+ "Region_Display_TC": "Kepulauan Turks dan Caicos",
+ "Region_Display_TD": "Chad",
+ "Region_Display_TG": "Togo",
+ "Region_Display_TH": "Thailand",
+ "Region_Display_TJ": "Tajikistan",
+ "Region_Display_TK": "Tokelau",
+ "Region_Display_TL": "Timor-Leste",
+ "Region_Display_TM": "Turkmenistan",
+ "Region_Display_TN": "Tunisia",
+ "Region_Display_TR": "Turki",
+ "Region_Display_TT": "Trinidad dan Tobago",
+ "Region_Display_TV": "Tuvalu",
+ "Region_Display_TW": "Taiwan",
+ "Region_Display_TZ": "Tanzania",
+ "Region_Display_UA": "Ukraina",
+ "Region_Display_UG": "Uganda",
+ "Region_Display_US": "Amerika Serikat",
+ "Region_Display_UY": "Uruguay",
+ "Region_Display_UZ": "Uzbekistan",
+ "Region_Display_VA": "Tahta Suci (Kota Vatikan)",
+ "Region_Display_VC": "Saint Vincent dan Grenadines",
+ "Region_Display_VE": "Venezuela",
+ "Region_Display_VG": "Kepulauan Virgin Britania Raya",
+ "Region_Display_VI": "Kepulauan Virgin AS",
+ "Region_Display_VN": "Vietnam",
+ "Region_Display_VU": "Vanuatu",
+ "Region_Display_WF": "Wallis dan Futuna",
+ "Region_Display_WS": "Negara Merdeka Samoa",
+ "Region_Display_XE": "Sint Eustatius",
+ "Region_Display_XS": "Saba",
+ "Region_Display_YE": "Yaman",
+ "Region_Display_YT": "Mayotte",
+ "Region_Display_ZA": "Afrika Selatan",
+ "Region_Display_ZM": "Zambia",
+ "Region_Display_ZW": "Zimbabwe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/resources.pri b/packages/microsoft.bingweather/resources/resources.pri
new file mode 100644
index 00000000..469c1ccb
Binary files /dev/null and b/packages/microsoft.bingweather/resources/resources.pri differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/beijing/c/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/beijing/c/historicalWeather.json
new file mode 100644
index 00000000..c10a3dd2
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/beijing/c/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"C","WindUnit":"KM","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":3,"MonthSeason":"Best","BestSeasonMonths":[3,4,5,9,10,11],"AvoidSeasonMonths":[1,2,7,8,12],"MonthlyAggregatedData":[{"AvgTemp":1,"MaxTemp":3,"MinTemp":-2,"MinRecordedTemp":-11,"MaxRecordedTemp":14,"MinRecordedTempDate":117726048000000000,"MaxRecordedTempDate":126545760000000000,"Humidity":41,"Precipitation":0.409999,"Visibility":10,"Windspeed":10,"AvgSunshineHours":6,"FoggyDayCount":1,"RainyDayCount":0,"SnowyDayCount":3,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":1},{"AvgTemp":2,"MaxTemp":5,"MinTemp":1,"MinRecordedTemp":-6,"MaxRecordedTemp":20,"MinRecordedTempDate":118680768000000000,"MaxRecordedTempDate":124686432000000000,"Humidity":41,"Precipitation":0.719999,"Visibility":10,"Windspeed":10,"AvgSunshineHours":7,"FoggyDayCount":1,"RainyDayCount":0,"SnowyDayCount":3,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":2},{"AvgTemp":6,"MaxTemp":12,"MinTemp":0,"MinRecordedTemp":-4,"MaxRecordedTemp":30,"MinRecordedTempDate":112709664000000000,"MaxRecordedTempDate":128818080000000000,"Humidity":42,"Precipitation":1.409999,"Visibility":10,"Windspeed":11,"AvgSunshineHours":8,"FoggyDayCount":1,"RainyDayCount":4,"SnowyDayCount":2,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":3},{"AvgTemp":14,"MaxTemp":20,"MinTemp":7,"MinRecordedTemp":3,"MaxRecordedTemp":32,"MinRecordedTempDate":118418976000000000,"MaxRecordedTempDate":123794784000000000,"Humidity":43,"Precipitation":2.919999,"Visibility":10,"Windspeed":12,"AvgSunshineHours":8,"FoggyDayCount":0,"RainyDayCount":6,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":4},{"AvgTemp":20,"MaxTemp":26,"MinTemp":13,"MinRecordedTemp":3,"MaxRecordedTemp":35,"MinRecordedTempDate":118444896000000000,"MaxRecordedTempDate":126347040000000000,"Humidity":49,"Precipitation":3.649999,"Visibility":11,"Windspeed":10,"AvgSunshineHours":9,"FoggyDayCount":0,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":5},{"AvgTemp":25,"MaxTemp":30,"MinTemp":18,"MinRecordedTemp":9,"MaxRecordedTemp":38,"MinRecordedTempDate":123842304000000000,"MaxRecordedTempDate":113743008000000000,"Humidity":59,"Precipitation":7.769999,"Visibility":9,"Windspeed":9,"AvgSunshineHours":9,"FoggyDayCount":1,"RainyDayCount":12,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":6,"Key":6},{"AvgTemp":26,"MaxTemp":31,"MinTemp":22,"MinRecordedTemp":12,"MaxRecordedTemp":38,"MinRecordedTempDate":119130048000000000,"MaxRecordedTempDate":125772480000000000,"Humidity":74,"Precipitation":19.66,"Visibility":9,"Windspeed":7,"AvgSunshineHours":8,"FoggyDayCount":1,"RainyDayCount":16,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":7,"Key":7},{"AvgTemp":25,"MaxTemp":30,"MinTemp":20,"MinRecordedTemp":12,"MaxRecordedTemp":37,"MinRecordedTempDate":119492064000000000,"MaxRecordedTempDate":122016672000000000,"Humidity":76,"Precipitation":18.44,"Visibility":9,"Windspeed":6,"AvgSunshineHours":8,"FoggyDayCount":2,"RainyDayCount":13,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":6,"Key":8},{"AvgTemp":20,"MaxTemp":26,"MinTemp":14,"MinRecordedTemp":4,"MaxRecordedTemp":34,"MinRecordedTempDate":119829888000000000,"MaxRecordedTempDate":113190912000000000,"Humidity":66,"Precipitation":5.509999,"Visibility":9,"Windspeed":7,"AvgSunshineHours":8,"FoggyDayCount":2,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":9},{"AvgTemp":13,"MaxTemp":19,"MinTemp":7,"MinRecordedTemp":1,"MaxRecordedTemp":31,"MinRecordedTempDate":108817344000000000,"MaxRecordedTempDate":128043936000000000,"Humidity":58,"Precipitation":3.209999,"Visibility":9,"Windspeed":8,"AvgSunshineHours":7,"FoggyDayCount":3,"RainyDayCount":6,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":10},{"AvgTemp":5,"MaxTemp":10,"MinTemp":1,"MinRecordedTemp":-6,"MaxRecordedTemp":24,"MinRecordedTempDate":109156032000000000,"MaxRecordedTempDate":117974880000000000,"Humidity":53,"Precipitation":0.959999,"Visibility":9,"Windspeed":9,"AvgSunshineHours":6,"FoggyDayCount":3,"RainyDayCount":3,"SnowyDayCount":1,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":11},{"AvgTemp":2,"MaxTemp":5,"MinTemp":-1,"MinRecordedTemp":-7,"MaxRecordedTemp":20,"MinRecordedTempDate":129066048000000000,"MaxRecordedTempDate":122731200000000000,"Humidity":47,"Precipitation":0.409999,"Visibility":9,"Windspeed":9,"AvgSunshineHours":6,"FoggyDayCount":2,"RainyDayCount":0,"SnowyDayCount":3,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":12,"NumWindspeedEntities":12,"NumSnowDepthEntities":0,"NumSeaTempEntities":0,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":12,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":12,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":12,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/beijing/c/overview.json b/packages/microsoft.bingweather/resources/sampledata/beijing/c/overview.json
new file mode 100644
index 00000000..d0c0b46a
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/beijing/c/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"Responses":[{"CurrentConditionLink":{"Url":""},"CurrentConditionProvider":"","CurrentWeather":{"Caption":"阵雨","Humidity":28,"Icon":"/s/weather/89x89/11.png","IconCode":"11","ProviderCaption":"雨夹雪","Temperature":10,"WindDirection":"东风","WindSpeed":"4-5级"},"DailyForecast":[{"DailyConditions":[{"Caption":"阴","Date":130090320000000000,"IconCode":"26","NightCaption":"雨夹雪","NightIconCode":"17","NightWindDirection":"微风","NightWindSpeed":"小于3级","TempHigh":11,"TempLow":5,"WindDirection":"微风","WindSpeed":"小于3级"},{"Caption":"阴","Date":130091184000000000,"IconCode":"26","NightCaption":"晴","NightIconCode":"31b","NightWindDirection":"微风","NightWindSpeed":"小于3级","TempHigh":10,"TempLow":4,"WindDirection":"微风","WindSpeed":"小于3级"},{"Caption":"晴","Date":130092048000000000,"IconCode":"31","NightCaption":"阴","NightIconCode":"26","NightWindDirection":"微风","NightWindSpeed":"小于3级","TempHigh":15,"TempLow":6,"WindDirection":"微风","WindSpeed":"小于3级"},{"Caption":"多云","Date":130092912000000000,"IconCode":"27","NightCaption":"晴","NightIconCode":"31b","NightWindDirection":"微风","NightWindSpeed":"小于3级","TempHigh":17,"TempLow":6,"WindDirection":"微风","WindSpeed":"小于3级"},{"Caption":"晴","Date":130093776000000000,"IconCode":"31","NightCaption":"多云","NightIconCode":"27b","NightWindDirection":"微风","NightWindSpeed":"小于3级","TempHigh":17,"TempLow":6,"WindDirection":"微风","WindSpeed":"小于3级"},{"Caption":"多云","Date":130094640000000000,"IconCode":"27","NightCaption":"小雨","NightIconCode":"9c","NightWindDirection":"微风","NightWindSpeed":"小于3级","TempHigh":17,"TempLow":6,"WindDirection":"微风","WindSpeed":"小于3级"},{"Caption":"阴","Date":130095504000000000,"IconCode":"26","NightCaption":"无","NightIconCode":"0","NightWindDirection":"微风","NightWindSpeed":"小于3级","TempHigh":13,"WindDirection":"微风","WindSpeed":"小于3级"}]}],"HourlyListPerProvider":[{"HourlyConditionList":[{"Caption":"阴","IconCode":"26","TempHigh":11.3,"TempLow":6.8,"Time":130090608000000000,"WindDirection":"东南风","WindSpeed":"小于3级"},{"Caption":"阴","IconCode":"26","TempHigh":6.8,"TempLow":4,"Time":130090716000000000,"WindDirection":"东风","WindSpeed":"小于3级"},{"Caption":"小雨","IconCode":"9c","TempHigh":6,"TempLow":3,"Time":130090824000000000,"WindDirection":"东风","WindSpeed":"小于3级"},{"Caption":"小雨","IconCode":"9c","TempHigh":5,"TempLow":3,"Time":130090932000000000,"WindDirection":"东北风","WindSpeed":"小于3级"},{"Caption":"小雨","IconCode":"9c","TempHigh":5,"TempLow":3,"Time":130091040000000000,"WindDirection":"东北风","WindSpeed":"小于3级"},{"Caption":"阴","IconCode":"26","TempHigh":6.7,"TempLow":3.2,"Time":130091148000000000,"WindDirection":"东北风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27","TempHigh":10.5,"TempLow":6.7,"Time":130091256000000000,"WindDirection":"东风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27","TempHigh":10.6,"TempLow":10.5,"Time":130091364000000000,"WindDirection":"东风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27b","TempHigh":11,"TempLow":6,"Time":130091472000000000,"WindDirection":"东南风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27b","TempHigh":7,"TempLow":4,"Time":130091580000000000,"WindDirection":"东南风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27b","TempHigh":5,"TempLow":3,"Time":130091688000000000,"WindDirection":"南风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27b","TempHigh":4,"TempLow":3,"Time":130091796000000000,"WindDirection":"南风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27","TempHigh":6,"TempLow":4,"Time":130091904000000000,"WindDirection":"南风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27","TempHigh":9.8,"TempLow":4,"Time":130092012000000000,"WindDirection":"南风","WindSpeed":"小于3级"},{"Caption":"多云","IconCode":"27","TempHigh":14.4,"TempLow":9.8,"Time":130092120000000000,"WindDirection":"南风","WindSpeed":"小于3级"},{"Caption":"阴","IconCode":"26","TempHigh":15.7,"TempLow":14.4,"Time":130092228000000000,"WindDirection":"南风","WindSpeed":"小于3级"}]}],"IsHourlyForecastByDayAvailable":false,"IsMapsAvailable":false,"IsTripPlanAvailable":true,"TempUnit":"C"}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/london/c/historicalWeather.json
new file mode 100644
index 00000000..862e755b
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/london/c/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"London, United Kingdom","ExtractedLocationName":"London, United Kingdom","TempUnit":"C","WindUnit":"KM","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":6,"MonthSeason":"Best","BestSeasonMonths":[5,6,7,8,9],"OffSeasonMonths":[1,2,3,4,10,11,12],"MonthlyAggregatedData":[{"AvgTemp":8,"MaxTemp":12,"MinTemp":6,"MinRecordedTemp":-4,"MaxRecordedTemp":15,"MinRecordedTempDate":127828800000000000,"MaxRecordedTempDate":117718272000000000,"Humidity":84,"Precipitation":4.519999,"Visibility":10,"Windspeed":16,"SnowDepth":21.539999,"AvgSunshineHours":4,"FoggyDayCount":6,"RainyDayCount":15,"SnowyDayCount":3,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":1},{"AvgTemp":8,"MaxTemp":12,"MinTemp":3,"MinRecordedTemp":-5,"MaxRecordedTemp":19,"MinRecordedTempDate":128781792000000000,"MaxRecordedTempDate":125318016000000000,"Humidity":81,"Precipitation":3.66,"Visibility":10,"Windspeed":15,"SnowDepth":11.71,"AvgSunshineHours":4,"FoggyDayCount":4,"RainyDayCount":18,"SnowyDayCount":4,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":2},{"AvgTemp":10,"MaxTemp":13,"MinTemp":5,"MinRecordedTemp":-3,"MaxRecordedTemp":22,"MinRecordedTempDate":127869408000000000,"MaxRecordedTempDate":122821056000000000,"Humidity":77,"Precipitation":3.77,"Visibility":10,"Windspeed":15,"SnowDepth":2.47,"AvgSunshineHours":5,"FoggyDayCount":4,"RainyDayCount":20,"SnowyDayCount":2,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":3},{"AvgTemp":9,"MaxTemp":14,"MinTemp":4,"MinRecordedTemp":-1,"MaxRecordedTemp":27,"MinRecordedTempDate":127891008000000000,"MaxRecordedTempDate":109908576000000000,"Humidity":71,"Precipitation":3.6,"Visibility":10,"Windspeed":14,"SnowDepth":4.98,"AvgSunshineHours":5,"FoggyDayCount":1,"RainyDayCount":18,"SnowyDayCount":1,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":4},{"AvgTemp":13,"MaxTemp":18,"MinTemp":8,"MinRecordedTemp":-1,"MaxRecordedTemp":30,"MinRecordedTempDate":128557152000000000,"MaxRecordedTempDate":111204576000000000,"Humidity":70,"Precipitation":4.139999,"Visibility":11,"Windspeed":14,"SnowDepth":7.87,"AvgSunshineHours":6,"FoggyDayCount":1,"RainyDayCount":18,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":5},{"AvgTemp":16,"MaxTemp":21,"MinTemp":11,"MinRecordedTemp":-1,"MaxRecordedTemp":30,"MinRecordedTempDate":127948032000000000,"MaxRecordedTempDate":118490688000000000,"Humidity":69,"Precipitation":3.74,"Visibility":11,"Windspeed":13,"AvgSunshineHours":7,"FoggyDayCount":1,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":6},{"AvgTemp":18,"MaxTemp":23,"MinTemp":13,"MinRecordedTemp":0,"MaxRecordedTemp":36,"MinRecordedTempDate":128922624000000000,"MaxRecordedTempDate":127977408000000000,"Humidity":69,"Precipitation":4.099999,"Visibility":11,"Windspeed":14,"AvgSunshineHours":6,"FoggyDayCount":1,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":7},{"AvgTemp":18,"MaxTemp":23,"MinTemp":13,"MinRecordedTemp":0,"MaxRecordedTemp":36,"MinRecordedTempDate":128630592000000000,"MaxRecordedTempDate":127049472000000000,"Humidity":71,"Precipitation":5.12,"Visibility":11,"Windspeed":13,"AvgSunshineHours":6,"FoggyDayCount":2,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":8},{"AvgTemp":15,"MaxTemp":20,"MinTemp":10,"MinRecordedTemp":1,"MaxRecordedTemp":31,"MinRecordedTempDate":127724256000000000,"MaxRecordedTempDate":110031264000000000,"Humidity":76,"Precipitation":4.139999,"Visibility":11,"Windspeed":13,"SnowDepth":15.24,"AvgSunshineHours":5,"FoggyDayCount":3,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":9},{"AvgTemp":11,"MaxTemp":15,"MinTemp":7,"MinRecordedTemp":-2,"MaxRecordedTemp":27,"MinRecordedTempDate":128697984000000000,"MaxRecordedTempDate":121414464000000000,"Humidity":81,"Precipitation":5.959999,"Visibility":11,"Windspeed":13,"SnowDepth":42.42,"AvgSunshineHours":3,"FoggyDayCount":6,"RainyDayCount":19,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":10},{"AvgTemp":8,"MaxTemp":11,"MinTemp":4,"MinRecordedTemp":-1,"MaxRecordedTemp":23,"MinRecordedTempDate":128395584000000000,"MaxRecordedTempDate":118615968000000000,"Humidity":85,"Precipitation":4.86,"Visibility":10,"Windspeed":14,"SnowDepth":64.67,"AvgSunshineHours":2,"FoggyDayCount":6,"RainyDayCount":21,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":11},{"AvgTemp":6,"MaxTemp":8,"MinTemp":3,"MinRecordedTemp":-2,"MaxRecordedTemp":16,"MinRecordedTempDate":120215232000000000,"MaxRecordedTempDate":121468032000000000,"Humidity":86,"Precipitation":4.75,"Visibility":10,"Windspeed":15,"SnowDepth":11.599999,"AvgSunshineHours":1,"FoggyDayCount":6,"RainyDayCount":21,"SnowyDayCount":2,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":12,"NumWindspeedEntities":12,"NumSnowDepthEntities":9,"NumSeaTempEntities":0,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":12,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":12,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":12,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/basemapAerial.jpg b/packages/microsoft.bingweather/resources/sampledata/london/c/images/basemapAerial.jpg
new file mode 100644
index 00000000..31cc517c
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/basemapAerial.jpg differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/basemapWeatherLight.jpg b/packages/microsoft.bingweather/resources/sampledata/london/c/images/basemapWeatherLight.jpg
new file mode 100644
index 00000000..987e399d
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/basemapWeatherLight.jpg differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/clouds.png b/packages/microsoft.bingweather/resources/sampledata/london/c/images/clouds.png
new file mode 100644
index 00000000..ade06d55
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/clouds.png differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/labelsWeatherDark.png b/packages/microsoft.bingweather/resources/sampledata/london/c/images/labelsWeatherDark.png
new file mode 100644
index 00000000..bdafa3dc
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/labelsWeatherDark.png differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/labelsWeatherLight.png b/packages/microsoft.bingweather/resources/sampledata/london/c/images/labelsWeatherLight.png
new file mode 100644
index 00000000..2e6e23e0
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/labelsWeatherLight.png differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/precipitation.png b/packages/microsoft.bingweather/resources/sampledata/london/c/images/precipitation.png
new file mode 100644
index 00000000..2b468013
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/precipitation.png differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/satellite.png b/packages/microsoft.bingweather/resources/sampledata/london/c/images/satellite.png
new file mode 100644
index 00000000..242ff6ce
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/satellite.png differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/images/temperature.png b/packages/microsoft.bingweather/resources/sampledata/london/c/images/temperature.png
new file mode 100644
index 00000000..f91730a8
Binary files /dev/null and b/packages/microsoft.bingweather/resources/sampledata/london/c/images/temperature.png differ
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/interactiveMapsResponse.json b/packages/microsoft.bingweather/resources/sampledata/london/c/interactiveMapsResponse.json
new file mode 100644
index 00000000..b00d0365
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/london/c/interactiveMapsResponse.json
@@ -0,0 +1,69 @@
+{
+ "MapTypes": [
+ {
+ "Alpha": "1",
+ "Height": "272",
+ "MapBounds": {
+ "East": "16.0",
+ "North": "58.0",
+ "South": "43.0",
+ "West": "-16.0"
+ },
+ "MapSubType": "today",
+ "MapType": "temperature",
+ "PredictionTime": "030713060000",
+ "SnapTime": "030713120000",
+ "Url": "ms-appx:///resources/sampledata/london/c/images/temperature.png",
+ "Width": "364"
+ },
+ {
+ "Alpha": "0.8",
+ "Height": "272",
+ "MapBounds": {
+ "East": "16.0",
+ "North": "58.0",
+ "South": "43.0",
+ "West": "-16.0"
+ },
+ "MapSubType": "forecast",
+ "MapType": "precipitation",
+ "PredictionTime": "030713060000",
+ "SnapTime": "030713120000",
+ "Url": "ms-appx:///resources/sampledata/london/c/images/precipitation.png",
+ "Width": "364"
+ },
+ {
+ "Alpha": "1",
+ "Height": "543",
+ "MapBounds": {
+ "East": "16.0",
+ "North": "58.0",
+ "South": "43.0",
+ "West": "-16.0"
+ },
+ "MapSubType": "observation",
+ "MapType": "satellite",
+ "PredictionTime": "030713090100",
+ "SnapTime": "030713030100",
+ "Url": "ms-appx:///resources/sampledata/london/c/images/satellite.png",
+ "Width": "728"
+ },
+ {
+ "Alpha": "1",
+ "Height": "272",
+ "MapBounds": {
+ "East": "16.0",
+ "North": "58.0",
+ "South": "43.0",
+ "West": "-16.0"
+ },
+ "MapSubType": "forecast",
+ "MapType": "clouds",
+ "PredictionTime": "030713060000",
+ "SnapTime": "030713120000",
+ "Url": "ms-appx:///resources/sampledata/london/c/images/clouds.png",
+ "Width": "364"
+ }
+ ],
+ "RegionName": "europe"
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/c/overview.json b/packages/microsoft.bingweather/resources/sampledata/london/c/overview.json
new file mode 100644
index 00000000..dffab112
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/london/c/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"London, United Kingdom","ExtractedLocationName":"London, United Kingdom","TempUnit":"C","CurrentWeather":{"Temperature":14,"FeelsLike":16,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":14,"WindDirection":"W","Humidity":76,"Barometer":1016,"Visibility":16},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":96.799999,"DailyConditions":[{"Date":129844944000000000,"TempHigh":19,"TempLow":9,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":70},{"Date":129845808000000000,"TempHigh":19,"TempLow":8,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":17},{"Date":129846672000000000,"TempHigh":22,"TempLow":13,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":82},{"Date":129847536000000000,"TempHigh":19,"TempLow":11,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100},{"Date":129848400000000000,"TempHigh":18,"TempLow":12,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","PrecipChance":88},{"Date":129849264000000000,"TempHigh":19,"TempLow":12,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":75},{"Date":129850128000000000,"TempHigh":19,"TempLow":9,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95},{"Date":129850992000000000,"TempHigh":19,"TempLow":12,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":81},{"Date":129851856000000000,"TempHigh":22,"TempLow":13,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":94},{"Date":129852720000000000,"TempHigh":23,"TempLow":13,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":96}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":94.099999,"DailyConditions":[{"Date":129845304000000000,"TempHigh":22,"TempLow":12,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":50},{"Date":129846168000000000,"TempHigh":22,"TempLow":11,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":60},{"Date":129847032000000000,"TempHigh":24,"TempLow":12,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129847896000000000,"TempHigh":18,"TempLow":12,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":40},{"Date":129848760000000000,"TempHigh":18,"TempLow":12,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129849624000000000,"TempHigh":20,"TempLow":12,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":40},{"Date":129850488000000000,"TempHigh":17,"TempLow":12,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":0},{"Date":129851352000000000,"TempHigh":20,"TempLow":12,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":20},{"Date":129852216000000000,"TempHigh":18,"TempLow":12,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":20},{"Date":129853080000000000,"TempHigh":17,"TempLow":12,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":40}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":97.4,"DailyConditions":[{"Date":129844512000000000,"TempHigh":19,"TempLow":9,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":99,"WindSpeed":17,"WindDirection":"WNW","Humidity":49,"UV":7,"Sunrise":129844681200000000,"Sunset":129845280000000000},{"Date":129845376000000000,"TempHigh":19,"TempLow":9,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":45,"WindSpeed":10,"WindDirection":"WSW","Humidity":49,"UV":7,"Sunrise":129845545200000000,"Sunset":129846144600000000},{"Date":129846240000000000,"TempHigh":21,"TempLow":12,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":30,"WindSpeed":17,"WindDirection":"ENE","Humidity":52,"UV":7,"Sunrise":129846409200000000,"Sunset":129847008600000000},{"Date":129847104000000000,"TempHigh":18,"TempLow":11,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":98,"WindSpeed":28,"WindDirection":"SW","Humidity":81,"UV":7,"Sunrise":129847273800000000,"Sunset":129847872600000000},{"Date":129847968000000000,"TempHigh":15,"TempLow":11,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95,"WindSpeed":36,"WindDirection":"WSW","Humidity":77,"Sunrise":129848137800000000,"Sunset":129848736600000000},{"Date":129848832000000000,"TempHigh":19,"TempLow":11,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":70,"WindSpeed":24,"WindDirection":"W","Humidity":48,"Sunrise":129849001800000000,"Sunset":129849600600000000},{"Date":129849696000000000,"TempHigh":19,"TempLow":11,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":70,"WindSpeed":16,"WindDirection":"WNW","Humidity":67,"Sunrise":129849866400000000,"Sunset":129850464600000000},{"Date":129850560000000000,"TempHigh":20,"TempLow":11,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":60,"WindSpeed":17,"WindDirection":"WNW","Humidity":60,"Sunrise":129850730400000000,"Sunset":129851328600000000},{"Date":129851424000000000,"TempHigh":20,"TempLow":12,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":65,"WindSpeed":15,"WindDirection":"W","Humidity":64,"Sunrise":129851594400000000,"Sunset":129852192600000000},{"Date":129852288000000000,"TempHigh":20,"TempLow":12,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":70,"WindSpeed":17,"WindDirection":"SW","Humidity":65,"Sunrise":129852459000000000,"Sunset":129853056600000000}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":6,"DefaultProvider":"","WindUnit":"KM","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":16,"FeelsLike":16,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":9,"WindDirection":"WSW","DewPoint":10,"Barometer":1015,"Visibility":10}},{"ProviderName":"","CurrentCondition":{"Temperature":15,"FeelsLike":15,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":13,"WindDirection":"W","UV":6,"Humidity":72,"DewPoint":10,"Barometer":1016,"Visibility":10}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129844872000000000,"Temp":14,"FeelsLike":14,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","WindSpeed":14,"WindDirection":"W","UV":4,"Humidity":71,"PrecipChance":99},{"Time":129844980000000000,"Temp":17,"FeelsLike":17,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":17,"WindDirection":"W","UV":7,"Humidity":59,"PrecipChance":95},{"Time":129845088000000000,"Temp":18,"FeelsLike":18,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":15,"WindDirection":"WSW","UV":4,"Humidity":56,"PrecipChance":60},{"Time":129845196000000000,"Temp":17,"FeelsLike":17,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":12,"WindDirection":"WSW","UV":1,"Humidity":57,"PrecipChance":5},{"Time":129845304000000000,"Temp":14,"FeelsLike":14,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":11,"WindDirection":"SW","UV":0,"Humidity":70,"PrecipChance":2},{"Time":129845412000000000,"Temp":11,"FeelsLike":11,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":9,"WindDirection":"SW","UV":0,"Humidity":85,"PrecipChance":2},{"Time":129845520000000000,"Temp":9,"FeelsLike":9,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":6,"WindDirection":"SW","UV":0,"Humidity":92,"PrecipChance":2},{"Time":129845628000000000,"Temp":12,"FeelsLike":12,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","WindSpeed":7,"WindDirection":"SW","UV":1,"Humidity":87,"PrecipChance":2},{"Time":129845736000000000,"Temp":16,"FeelsLike":16,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":11,"WindDirection":"SW","UV":4,"Humidity":64,"PrecipChance":5},{"Time":129845844000000000,"Temp":18,"FeelsLike":18,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","WindSpeed":9,"WindDirection":"WSW","UV":7,"Humidity":54,"PrecipChance":40},{"Time":129845952000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":5,"WindDirection":"WSW","UV":3,"Humidity":50,"PrecipChance":40},{"Time":129846060000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":1,"WindDirection":"ESE","UV":1,"Humidity":48,"PrecipChance":3},{"Time":129846168000000000,"Temp":15,"FeelsLike":15,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":8,"WindDirection":"ESE","UV":0,"Humidity":72,"PrecipChance":2},{"Time":129846276000000000,"Temp":12,"FeelsLike":12,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":8,"WindDirection":"ESE","UV":0,"Humidity":84,"PrecipChance":2},{"Time":129846384000000000,"Temp":10,"FeelsLike":10,"Icon":"/s/weather/55x45/27b.png","IconCode":"27b","Caption":"Mostly Cloudy","WindSpeed":7,"WindDirection":"NE","UV":0,"Humidity":90,"PrecipChance":2},{"Time":129846492000000000,"Temp":13,"FeelsLike":13,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":12,"WindDirection":"NE","UV":1,"Humidity":77,"PrecipChance":4}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":false}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/f/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/london/f/historicalWeather.json
new file mode 100644
index 00000000..420dbd24
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/london/f/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"London, United Kingdom","ExtractedLocationName":"London, United Kingdom","TempUnit":"F","WindUnit":"M","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":6,"MonthSeason":"Best","BestSeasonMonths":[5,6,7,8,9],"OffSeasonMonths":[1,2,3,4,10,11,12],"MonthlyAggregatedData":[{"AvgTemp":46,"MaxTemp":55,"MinTemp":42,"MinRecordedTemp":27,"MaxRecordedTemp":61,"MinRecordedTempDate":127828800000000000,"MaxRecordedTempDate":117718272000000000,"Humidity":84,"Precipitation":1.78,"Visibility":6,"Windspeed":10,"SnowDepth":8.48,"AvgSunshineHours":4,"FoggyDayCount":6,"RainyDayCount":15,"SnowyDayCount":3,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":1},{"AvgTemp":46,"MaxTemp":55,"MinTemp":38,"MinRecordedTemp":25,"MaxRecordedTemp":65,"MinRecordedTempDate":128781792000000000,"MaxRecordedTempDate":125318016000000000,"Humidity":81,"Precipitation":1.439999,"Visibility":6,"Windspeed":9,"SnowDepth":4.61,"AvgSunshineHours":4,"FoggyDayCount":4,"RainyDayCount":18,"SnowyDayCount":4,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":2},{"AvgTemp":45,"MaxTemp":52,"MinTemp":37,"MinRecordedTemp":28,"MaxRecordedTemp":72,"MinRecordedTempDate":127869408000000000,"MaxRecordedTempDate":122821056000000000,"Humidity":77,"Precipitation":1.479999,"Visibility":6,"Windspeed":9,"SnowDepth":0.969999,"AvgSunshineHours":5,"FoggyDayCount":4,"RainyDayCount":20,"SnowyDayCount":2,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":3},{"AvgTemp":49,"MaxTemp":57,"MinTemp":40,"MinRecordedTemp":30,"MaxRecordedTemp":81,"MinRecordedTempDate":127891008000000000,"MaxRecordedTempDate":109908576000000000,"Humidity":71,"Precipitation":1.419999,"Visibility":6,"Windspeed":9,"SnowDepth":1.959999,"AvgSunshineHours":5,"FoggyDayCount":1,"RainyDayCount":18,"SnowyDayCount":1,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":4},{"AvgTemp":55,"MaxTemp":64,"MinTemp":46,"MinRecordedTemp":30,"MaxRecordedTemp":89,"MinRecordedTempDate":128557152000000000,"MaxRecordedTempDate":111204576000000000,"Humidity":70,"Precipitation":1.629999,"Visibility":7,"Windspeed":9,"SnowDepth":3.1,"AvgSunshineHours":6,"FoggyDayCount":1,"RainyDayCount":18,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":5},{"AvgTemp":61,"MaxTemp":69,"MinTemp":52,"MinRecordedTemp":30,"MaxRecordedTemp":90,"MinRecordedTempDate":127948032000000000,"MaxRecordedTempDate":118490688000000000,"Humidity":69,"Precipitation":1.469999,"Visibility":7,"Windspeed":8,"AvgSunshineHours":7,"FoggyDayCount":1,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":6},{"AvgTemp":64,"MaxTemp":73,"MinTemp":56,"MinRecordedTemp":32,"MaxRecordedTemp":96,"MinRecordedTempDate":128922624000000000,"MaxRecordedTempDate":127977408000000000,"Humidity":69,"Precipitation":1.62,"Visibility":7,"Windspeed":9,"AvgSunshineHours":6,"FoggyDayCount":1,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":7},{"AvgTemp":64,"MaxTemp":73,"MinTemp":55,"MinRecordedTemp":31,"MaxRecordedTemp":96,"MinRecordedTempDate":128630592000000000,"MaxRecordedTempDate":127049472000000000,"Humidity":71,"Precipitation":2.02,"Visibility":7,"Windspeed":8,"AvgSunshineHours":6,"FoggyDayCount":2,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":8},{"AvgTemp":59,"MaxTemp":67,"MinTemp":51,"MinRecordedTemp":35,"MaxRecordedTemp":88,"MinRecordedTempDate":127724256000000000,"MaxRecordedTempDate":110031264000000000,"Humidity":76,"Precipitation":1.629999,"Visibility":7,"Windspeed":8,"SnowDepth":6,"AvgSunshineHours":5,"FoggyDayCount":3,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":9},{"AvgTemp":53,"MaxTemp":59,"MinTemp":45,"MinRecordedTemp":30,"MaxRecordedTemp":81,"MinRecordedTempDate":128697984000000000,"MaxRecordedTempDate":121414464000000000,"Humidity":81,"Precipitation":2.35,"Visibility":7,"Windspeed":8,"SnowDepth":16.699999,"AvgSunshineHours":3,"FoggyDayCount":6,"RainyDayCount":19,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":10},{"AvgTemp":46,"MaxTemp":52,"MinTemp":39,"MinRecordedTemp":30,"MaxRecordedTemp":73,"MinRecordedTempDate":128395584000000000,"MaxRecordedTempDate":118615968000000000,"Humidity":85,"Precipitation":1.909999,"Visibility":6,"Windspeed":8,"SnowDepth":25.46,"AvgSunshineHours":2,"FoggyDayCount":6,"RainyDayCount":21,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":11},{"AvgTemp":42,"MaxTemp":47,"MinTemp":37,"MinRecordedTemp":28,"MaxRecordedTemp":61,"MinRecordedTempDate":120215232000000000,"MaxRecordedTempDate":121468032000000000,"Humidity":86,"Precipitation":1.87,"Visibility":6,"Windspeed":9,"SnowDepth":4.57,"AvgSunshineHours":1,"FoggyDayCount":6,"RainyDayCount":21,"SnowyDayCount":2,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":12,"NumWindspeedEntities":12,"NumSnowDepthEntities":9,"NumSeaTempEntities":0,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":12,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":12,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":12,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/london/f/overview.json b/packages/microsoft.bingweather/resources/sampledata/london/f/overview.json
new file mode 100644
index 00000000..0351e23f
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/london/f/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"London, United Kingdom","ExtractedLocationName":"London, United Kingdom","TempUnit":"F","CurrentWeather":{"Temperature":61,"FeelsLike":61,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":6,"WindDirection":"WSW","DewPoint":50,"Barometer":30,"Visibility":6},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":94.099999,"DailyConditions":[{"Date":129845304000000000,"TempHigh":72,"TempLow":54,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":70},{"Date":129846168000000000,"TempHigh":70,"TempLow":52,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":60},{"Date":129847032000000000,"TempHigh":73,"TempLow":52,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129847896000000000,"TempHigh":68,"TempLow":54,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":70},{"Date":129848760000000000,"TempHigh":68,"TempLow":54,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129849624000000000,"TempHigh":64,"TempLow":54,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":20},{"Date":129850488000000000,"TempHigh":61,"TempLow":46,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":20},{"Date":129851352000000000,"TempHigh":63,"TempLow":54,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":20},{"Date":129852216000000000,"TempHigh":63,"TempLow":54,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129853080000000000,"TempHigh":63,"TempLow":54,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":30}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":97.4,"DailyConditions":[{"Date":129844512000000000,"TempHigh":66,"TempLow":47,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":99,"WindSpeed":11,"WindDirection":"WNW","Humidity":49,"UV":7,"Sunrise":129844681200000000,"Sunset":129845280000000000},{"Date":129845376000000000,"TempHigh":67,"TempLow":48,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":45,"WindSpeed":6,"WindDirection":"WSW","Humidity":49,"UV":7,"Sunrise":129845545200000000,"Sunset":129846144600000000},{"Date":129846240000000000,"TempHigh":70,"TempLow":54,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":30,"WindSpeed":11,"WindDirection":"ENE","Humidity":52,"UV":7,"Sunrise":129846409200000000,"Sunset":129847008600000000},{"Date":129847104000000000,"TempHigh":64,"TempLow":52,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":98,"WindSpeed":17,"WindDirection":"SW","Humidity":81,"UV":7,"Sunrise":129847273800000000,"Sunset":129847872600000000},{"Date":129847968000000000,"TempHigh":58,"TempLow":52,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95,"WindSpeed":23,"WindDirection":"WSW","Humidity":77,"Sunrise":129848137800000000,"Sunset":129848736600000000},{"Date":129848832000000000,"TempHigh":67,"TempLow":51,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":70,"WindSpeed":15,"WindDirection":"W","Humidity":48,"Sunrise":129849001800000000,"Sunset":129849600600000000},{"Date":129849696000000000,"TempHigh":66,"TempLow":51,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":70,"WindSpeed":10,"WindDirection":"WNW","Humidity":67,"Sunrise":129849866400000000,"Sunset":129850464600000000},{"Date":129850560000000000,"TempHigh":67,"TempLow":52,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":60,"WindSpeed":10,"WindDirection":"WNW","Humidity":60,"Sunrise":129850730400000000,"Sunset":129851328600000000},{"Date":129851424000000000,"TempHigh":67,"TempLow":53,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":65,"WindSpeed":9,"WindDirection":"W","Humidity":64,"Sunrise":129851594400000000,"Sunset":129852192600000000},{"Date":129852288000000000,"TempHigh":68,"TempLow":53,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":70,"WindSpeed":11,"WindDirection":"SW","Humidity":65,"Sunrise":129852459000000000,"Sunset":129853056600000000}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":96.799999,"DailyConditions":[{"Date":129844944000000000,"TempHigh":67,"TempLow":47,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":17},{"Date":129845808000000000,"TempHigh":71,"TempLow":56,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":82},{"Date":129846672000000000,"TempHigh":67,"TempLow":51,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100},{"Date":129847536000000000,"TempHigh":65,"TempLow":53,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","PrecipChance":88},{"Date":129848400000000000,"TempHigh":67,"TempLow":53,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":75},{"Date":129849264000000000,"TempHigh":66,"TempLow":48,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95},{"Date":129850128000000000,"TempHigh":67,"TempLow":54,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":81},{"Date":129850992000000000,"TempHigh":72,"TempLow":56,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":94},{"Date":129851856000000000,"TempHigh":73,"TempLow":56,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":96}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":6,"DefaultProvider":"","WindUnit":"M","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":57,"FeelsLike":57,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":9,"WindDirection":"W","UV":4,"Humidity":77,"DewPoint":50,"Barometer":30,"Visibility":6}},{"ProviderName":"","CurrentCondition":{"Temperature":57,"FeelsLike":61,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":9,"WindDirection":"W","Humidity":76,"Barometer":30,"Visibility":10}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129844872000000000,"Temp":58,"FeelsLike":58,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","WindSpeed":9,"WindDirection":"W","UV":4,"Humidity":71,"PrecipChance":99},{"Time":129844980000000000,"Temp":62,"FeelsLike":62,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":10,"WindDirection":"W","UV":7,"Humidity":59,"PrecipChance":95},{"Time":129845088000000000,"Temp":64,"FeelsLike":64,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":9,"WindDirection":"WSW","UV":4,"Humidity":56,"PrecipChance":60},{"Time":129845196000000000,"Temp":63,"FeelsLike":63,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":7,"WindDirection":"WSW","UV":1,"Humidity":57,"PrecipChance":5},{"Time":129845304000000000,"Temp":57,"FeelsLike":57,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":7,"WindDirection":"SW","UV":0,"Humidity":70,"PrecipChance":2},{"Time":129845412000000000,"Temp":51,"FeelsLike":51,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":5,"WindDirection":"SW","UV":0,"Humidity":85,"PrecipChance":2},{"Time":129845520000000000,"Temp":48,"FeelsLike":48,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":4,"WindDirection":"SW","UV":0,"Humidity":92,"PrecipChance":2},{"Time":129845628000000000,"Temp":53,"FeelsLike":53,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","WindSpeed":4,"WindDirection":"SW","UV":1,"Humidity":87,"PrecipChance":2},{"Time":129845736000000000,"Temp":61,"FeelsLike":61,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":7,"WindDirection":"SW","UV":4,"Humidity":64,"PrecipChance":5},{"Time":129845844000000000,"Temp":65,"FeelsLike":65,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","WindSpeed":6,"WindDirection":"WSW","UV":7,"Humidity":54,"PrecipChance":40},{"Time":129845952000000000,"Temp":66,"FeelsLike":66,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":3,"WindDirection":"WSW","UV":3,"Humidity":50,"PrecipChance":40},{"Time":129846060000000000,"Temp":66,"FeelsLike":66,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":1,"WindDirection":"ESE","UV":1,"Humidity":48,"PrecipChance":3},{"Time":129846168000000000,"Temp":59,"FeelsLike":59,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":5,"WindDirection":"ESE","UV":0,"Humidity":72,"PrecipChance":2},{"Time":129846276000000000,"Temp":53,"FeelsLike":53,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":5,"WindDirection":"ESE","UV":0,"Humidity":84,"PrecipChance":2},{"Time":129846384000000000,"Temp":50,"FeelsLike":50,"Icon":"/s/weather/55x45/27b.png","IconCode":"27b","Caption":"Mostly Cloudy","WindSpeed":4,"WindDirection":"NE","UV":0,"Humidity":90,"PrecipChance":2},{"Time":129846492000000000,"Temp":55,"FeelsLike":55,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":7,"WindDirection":"NE","UV":1,"Humidity":77,"PrecipChance":4}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":false}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/seoul/c/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/seoul/c/historicalWeather.json
new file mode 100644
index 00000000..f1f227b2
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/seoul/c/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"Seoul, South Korea","ExtractedLocationName":"Seoul, South Korea","TempUnit":"C","WindUnit":"KM","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":4,"MonthSeason":"Best","BestSeasonMonths":[4,5,6,9,10],"AvoidSeasonMonths":[7,8],"OffSeasonMonths":[1,2,11,12],"MonthlyAggregatedData":[{"AvgTemp":1,"MaxTemp":3,"MinTemp":-1,"MinRecordedTemp":-1,"MaxRecordedTemp":5,"MinRecordedTempDate":114253632000000000,"MaxRecordedTempDate":126555264000000000,"Humidity":64,"Precipitation":1.939999,"Visibility":12,"Windspeed":9,"SnowDepth":65.799999,"AvgSunshineHours":6,"FoggyDayCount":3,"RainyDayCount":3,"SnowyDayCount":7,"HailDayCount":0,"TornadoDayCount":0,"Key":1},{"AvgTemp":2,"MaxTemp":4,"MinTemp":1,"MinRecordedTemp":-1,"MaxRecordedTemp":15,"MinRecordedTempDate":116159616000000000,"MaxRecordedTempDate":127217088000000000,"Humidity":62,"Precipitation":2.229999,"Visibility":12,"Windspeed":10,"SnowDepth":30.91,"AvgSunshineHours":6,"FoggyDayCount":2,"RainyDayCount":3,"SnowyDayCount":5,"HailDayCount":0,"TornadoDayCount":0,"Key":2},{"AvgTemp":5,"MaxTemp":10,"MinTemp":3,"MinRecordedTemp":1,"MaxRecordedTemp":20,"MinRecordedTempDate":127857312000000000,"MaxRecordedTempDate":116202816000000000,"Humidity":62,"Precipitation":4.12,"Visibility":11,"Windspeed":10,"SnowDepth":26.089999,"AvgSunshineHours":7,"FoggyDayCount":3,"RainyDayCount":7,"SnowyDayCount":2,"HailDayCount":0,"TornadoDayCount":0,"Key":3},{"AvgTemp":12,"MaxTemp":18,"MinTemp":7,"MinRecordedTemp":4,"MaxRecordedTemp":28,"MinRecordedTempDate":127254240000000000,"MaxRecordedTempDate":127592928000000000,"Humidity":61,"Precipitation":5.23,"Visibility":12,"Windspeed":10,"AvgSunshineHours":8,"FoggyDayCount":3,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":4},{"AvgTemp":18,"MaxTemp":23,"MinTemp":13,"MinRecordedTemp":2,"MaxRecordedTemp":30,"MinRecordedTempDate":128231424000000000,"MaxRecordedTempDate":114049728000000000,"Humidity":64,"Precipitation":8.56,"Visibility":11,"Windspeed":9,"AvgSunshineHours":8,"FoggyDayCount":3,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":5},{"AvgTemp":22,"MaxTemp":27,"MinTemp":18,"MinRecordedTemp":6,"MaxRecordedTemp":32,"MinRecordedTempDate":122579136000000000,"MaxRecordedTempDate":112808160000000000,"Humidity":70,"Precipitation":10.669999,"Visibility":10,"Windspeed":9,"AvgSunshineHours":7,"FoggyDayCount":4,"RainyDayCount":12,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":6},{"AvgTemp":25,"MaxTemp":29,"MinTemp":22,"MinRecordedTemp":8,"MaxRecordedTemp":35,"MinRecordedTempDate":127669824000000000,"MaxRecordedTempDate":124194816000000000,"Humidity":80,"Precipitation":31.76,"Visibility":9,"Windspeed":8,"AvgSunshineHours":6,"FoggyDayCount":5,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":7},{"AvgTemp":26,"MaxTemp":30,"MinTemp":22,"MinRecordedTemp":13,"MaxRecordedTemp":35,"MinRecordedTempDate":127688832000000000,"MaxRecordedTempDate":126415296000000000,"Humidity":76,"Precipitation":28.14,"Visibility":12,"Windspeed":8,"AvgSunshineHours":6,"FoggyDayCount":4,"RainyDayCount":14,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":8},{"AvgTemp":21,"MaxTemp":26,"MinTemp":16,"MinRecordedTemp":4,"MaxRecordedTemp":34,"MinRecordedTempDate":127717344000000000,"MaxRecordedTempDate":118237536000000000,"Humidity":71,"Precipitation":12.99,"Visibility":13,"Windspeed":7,"AvgSunshineHours":7,"FoggyDayCount":3,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":9},{"AvgTemp":14,"MaxTemp":20,"MinTemp":9,"MinRecordedTemp":3,"MaxRecordedTemp":30,"MinRecordedTempDate":112915296000000000,"MaxRecordedTempDate":116052480000000000,"Humidity":66,"Precipitation":5.169999,"Visibility":12,"Windspeed":7,"SnowDepth":6.469999,"AvgSunshineHours":7,"FoggyDayCount":4,"RainyDayCount":7,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":10},{"AvgTemp":7,"MaxTemp":12,"MinTemp":2,"MinRecordedTemp":1,"MaxRecordedTemp":25,"MinRecordedTempDate":115470144000000000,"MaxRecordedTempDate":118294560000000000,"Humidity":66,"Precipitation":4.469999,"Visibility":12,"Windspeed":8,"SnowDepth":11.259999,"AvgSunshineHours":5,"FoggyDayCount":3,"RainyDayCount":8,"SnowyDayCount":1,"HailDayCount":0,"TornadoDayCount":0,"Key":11},{"AvgTemp":0,"MaxTemp":4,"MinTemp":-1,"MinRecordedTemp":-1,"MaxRecordedTemp":20,"MinRecordedTempDate":115810560000000000,"MaxRecordedTempDate":116109504000000000,"Humidity":65,"Precipitation":1.81,"Visibility":13,"Windspeed":9,"SnowDepth":10.669999,"AvgSunshineHours":5,"FoggyDayCount":3,"RainyDayCount":5,"SnowyDayCount":5,"HailDayCount":0,"TornadoDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":12,"NumWindspeedEntities":12,"NumSnowDepthEntities":6,"NumSeaTempEntities":0,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":12,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":12,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":0,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/seoul/c/overview.json b/packages/microsoft.bingweather/resources/sampledata/seoul/c/overview.json
new file mode 100644
index 00000000..fb2321a8
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/seoul/c/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"C","CurrentWeather":{"Temperature":16,"FeelsLike":16,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":9,"WindDirection":"NNW","UV":0,"Humidity":59,"DewPoint":8,"Barometer":1011,"Visibility":9},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":97.299999,"DailyConditions":[{"Date":129822912000000000,"TempHigh":25,"TempLow":14,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":5,"WindSpeed":13,"WindDirection":"WNW","Humidity":39,"UV":7,"Sunrise":129823101600000000,"Sunset":129823621200000000},{"Date":129823776000000000,"TempHigh":27,"TempLow":13,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","PrecipChance":2,"WindSpeed":14,"WindDirection":"WNW","Humidity":27,"UV":9,"Sunrise":129823965000000000,"Sunset":129824485200000000},{"Date":129824640000000000,"TempHigh":27,"TempLow":13,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"WindSpeed":13,"WindDirection":"W","Humidity":18,"UV":8,"Sunrise":129824828400000000,"Sunset":129825349800000000},{"Date":129825504000000000,"TempHigh":26,"TempLow":14,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","PrecipChance":2,"WindSpeed":16,"WindDirection":"WSW","Humidity":41,"UV":7,"Sunrise":129825692400000000,"Sunset":129826214400000000},{"Date":129826368000000000,"TempHigh":29,"TempLow":17,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","PrecipChance":20,"WindSpeed":12,"WindDirection":"E","Humidity":24,"UV":8,"Sunrise":129826555800000000,"Sunset":129827079000000000},{"Date":129827232000000000,"TempHigh":28,"TempLow":17,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":10,"WindSpeed":13,"WindDirection":"W","Humidity":35,"Sunrise":129827419800000000,"Sunset":129827943000000000},{"Date":129828096000000000,"TempHigh":26,"TempLow":14,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":45,"WindSpeed":11,"WindDirection":"W","Humidity":53,"Sunrise":129828283200000000,"Sunset":129828807600000000},{"Date":129828960000000000,"TempHigh":24,"TempLow":15,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":70,"WindSpeed":10,"WindDirection":"E","Humidity":38,"Sunrise":129829147200000000,"Sunset":129829672200000000},{"Date":129829824000000000,"TempHigh":26,"TempLow":15,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":45,"WindSpeed":10,"WindDirection":"W","Humidity":31,"Sunrise":129830011200000000,"Sunset":129830536200000000},{"Date":129830688000000000,"TempHigh":26,"TempLow":15,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":40,"WindSpeed":11,"WindDirection":"WSW","Humidity":32,"Sunrise":129830874600000000,"Sunset":129831400800000000}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":96.099999,"DailyConditions":[{"Date":129823344000000000,"TempHigh":23,"TempLow":11,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":13},{"Date":129824208000000000,"TempHigh":26,"TempLow":12,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Mostly Sunny","PrecipChance":26},{"Date":129825072000000000,"TempHigh":26,"TempLow":13,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":1},{"Date":129825936000000000,"TempHigh":26,"TempLow":14,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Mostly Sunny","PrecipChance":1},{"Date":129826800000000000,"TempHigh":26,"TempLow":13,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Mostly Sunny","PrecipChance":25},{"Date":129827664000000000,"TempHigh":27,"TempLow":14,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":12},{"Date":129828528000000000,"TempHigh":31,"TempLow":13,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":9},{"Date":129829392000000000,"TempHigh":25,"TempLow":13,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":26},{"Date":129830256000000000,"TempHigh":27,"TempLow":15,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":7},{"Date":129831120000000000,"TempHigh":27,"TempLow":17,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":2}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":83.9,"DailyConditions":[{"Date":129823668000000000,"TempHigh":26,"TempLow":17,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129824532000000000,"TempHigh":27,"TempLow":12,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129825396000000000,"TempHigh":27,"TempLow":11,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129826260000000000,"TempHigh":27,"TempLow":12,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129827124000000000,"TempHigh":29,"TempLow":12,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129827988000000000,"TempHigh":28,"TempLow":13,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129828852000000000,"TempHigh":28,"TempLow":13,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":0},{"Date":129829716000000000,"TempHigh":29,"TempLow":16,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129830580000000000,"TempHigh":28,"TempLow":13,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","PrecipChance":0},{"Date":129831444000000000,"TempHigh":29,"TempLow":12,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","PrecipChance":0}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":5,"DefaultProvider":"","WindUnit":"KM","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":18,"FeelsLike":19,"Icon":"/s/weather/89x89/29b.png","IconCode":"29b","Caption":"Partly Cloudy","WindSpeed":5,"WindDirection":"WNW","Humidity":50,"Barometer":1011,"Visibility":18}},{"ProviderName":"","CurrentCondition":{"Temperature":19,"FeelsLike":19,"Icon":"/s/weather/89x89/31.png","IconCode":"31","Caption":"Clear","WindSpeed":0,"DewPoint":12,"Barometer":1013,"Visibility":9}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129823668000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/29b.png","IconCode":"29b","Caption":"Partly Cloudy","WindSpeed":5,"WindDirection":"W","UV":0,"Humidity":51,"PrecipChance":2},{"Time":129823776000000000,"Temp":16,"FeelsLike":16,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":6,"WindDirection":"WSW","UV":0,"Humidity":64,"PrecipChance":2},{"Time":129823884000000000,"Temp":15,"FeelsLike":15,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":5,"WindDirection":"WSW","UV":0,"Humidity":73,"PrecipChance":2},{"Time":129823992000000000,"Temp":15,"FeelsLike":15,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":1,"WindDirection":"ESE","UV":0,"Humidity":74,"PrecipChance":2},{"Time":129824100000000000,"Temp":20,"FeelsLike":20,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":3,"WindDirection":"WSW","UV":4,"Humidity":55,"PrecipChance":2},{"Time":129824208000000000,"Temp":25,"FeelsLike":25,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":9,"WindDirection":"WNW","UV":9,"Humidity":31,"PrecipChance":2},{"Time":129824316000000000,"Temp":26,"FeelsLike":26,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","WindSpeed":14,"WindDirection":"W","UV":6,"Humidity":27,"PrecipChance":2},{"Time":129824424000000000,"Temp":25,"FeelsLike":25,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":13,"WindDirection":"WSW","UV":1,"Humidity":32,"PrecipChance":2},{"Time":129824532000000000,"Temp":18,"FeelsLike":18,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":5,"WindDirection":"WSW","UV":0,"Humidity":64,"PrecipChance":2},{"Time":129824640000000000,"Temp":15,"FeelsLike":15,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":6,"WindDirection":"SSW","UV":0,"Humidity":72,"PrecipChance":2},{"Time":129824748000000000,"Temp":15,"FeelsLike":15,"Icon":"/s/weather/55x45/29b.png","IconCode":"29b","Caption":"Partly Cloudy","WindSpeed":3,"WindDirection":"SSE","UV":0,"Humidity":77,"PrecipChance":2},{"Time":129824856000000000,"Temp":14,"FeelsLike":14,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","WindSpeed":6,"WindDirection":"SW","UV":0,"Humidity":79,"PrecipChance":10},{"Time":129824964000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":3,"WindDirection":"W","UV":3,"Humidity":53,"PrecipChance":15},{"Time":129825072000000000,"Temp":24,"FeelsLike":24,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":6,"WindDirection":"SW","UV":8,"Humidity":29,"PrecipChance":20},{"Time":129825180000000000,"Temp":26,"FeelsLike":26,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":13,"WindDirection":"WSW","UV":6,"Humidity":18,"PrecipChance":5},{"Time":129825288000000000,"Temp":25,"FeelsLike":25,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":11,"WindDirection":"WSW","UV":1,"Humidity":24,"PrecipChance":2}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":false}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/seoul/f/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/seoul/f/historicalWeather.json
new file mode 100644
index 00000000..f1634a0a
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/seoul/f/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"Seoul, South Korea","ExtractedLocationName":"Seoul, South Korea","TempUnit":"F","WindUnit":"M","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":4,"MonthSeason":"Best","BestSeasonMonths":[4,5,6,9,10],"AvoidSeasonMonths":[7,8],"OffSeasonMonths":[1,2,11,12],"MonthlyAggregatedData":[{"AvgTemp":26,"MaxTemp":34,"MinTemp":22,"MinRecordedTemp":22,"MaxRecordedTemp":56,"MinRecordedTempDate":114253632000000000,"MaxRecordedTempDate":126555264000000000,"Humidity":64,"Precipitation":0.759999,"Visibility":8,"Windspeed":6,"SnowDepth":25.91,"AvgSunshineHours":6,"FoggyDayCount":3,"RainyDayCount":3,"SnowyDayCount":7,"HailDayCount":0,"TornadoDayCount":0,"Key":1},{"AvgTemp":31,"MaxTemp":40,"MinTemp":25,"MinRecordedTemp":22,"MaxRecordedTemp":66,"MinRecordedTempDate":116159616000000000,"MaxRecordedTempDate":127217088000000000,"Humidity":62,"Precipitation":0.88,"Visibility":7,"Windspeed":6,"SnowDepth":12.169999,"AvgSunshineHours":6,"FoggyDayCount":2,"RainyDayCount":3,"SnowyDayCount":5,"HailDayCount":0,"TornadoDayCount":0,"Key":2},{"AvgTemp":41,"MaxTemp":50,"MinTemp":33,"MinRecordedTemp":28,"MaxRecordedTemp":63,"MinRecordedTempDate":127857312000000000,"MaxRecordedTempDate":116202816000000000,"Humidity":62,"Precipitation":1.62,"Visibility":7,"Windspeed":6,"SnowDepth":10.269999,"AvgSunshineHours":7,"FoggyDayCount":3,"RainyDayCount":7,"SnowyDayCount":2,"HailDayCount":0,"TornadoDayCount":0,"Key":3},{"AvgTemp":54,"MaxTemp":64,"MinTemp":44,"MinRecordedTemp":40,"MaxRecordedTemp":80,"MinRecordedTempDate":127254240000000000,"MaxRecordedTempDate":127592928000000000,"Humidity":61,"Precipitation":2.06,"Visibility":7,"Windspeed":6,"AvgSunshineHours":8,"FoggyDayCount":3,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":4},{"AvgTemp":64,"MaxTemp":74,"MinTemp":55,"MinRecordedTemp":40,"MaxRecordedTemp":85,"MinRecordedTempDate":128231424000000000,"MaxRecordedTempDate":114049728000000000,"Humidity":64,"Precipitation":3.37,"Visibility":7,"Windspeed":6,"AvgSunshineHours":8,"FoggyDayCount":3,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":5},{"AvgTemp":71,"MaxTemp":80,"MinTemp":64,"MinRecordedTemp":42,"MaxRecordedTemp":90,"MinRecordedTempDate":122579136000000000,"MaxRecordedTempDate":112808160000000000,"Humidity":70,"Precipitation":4.2,"Visibility":6,"Windspeed":5,"AvgSunshineHours":7,"FoggyDayCount":4,"RainyDayCount":12,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":6},{"AvgTemp":77,"MaxTemp":84,"MinTemp":71,"MinRecordedTemp":46,"MaxRecordedTemp":92,"MinRecordedTempDate":127669824000000000,"MaxRecordedTempDate":124194816000000000,"Humidity":80,"Precipitation":12.5,"Visibility":6,"Windspeed":5,"AvgSunshineHours":6,"FoggyDayCount":5,"RainyDayCount":17,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":7},{"AvgTemp":78,"MaxTemp":86,"MinTemp":72,"MinRecordedTemp":55,"MaxRecordedTemp":94,"MinRecordedTempDate":127688832000000000,"MaxRecordedTempDate":126415296000000000,"Humidity":76,"Precipitation":11.08,"Visibility":8,"Windspeed":5,"AvgSunshineHours":6,"FoggyDayCount":4,"RainyDayCount":14,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":8},{"AvgTemp":70,"MaxTemp":79,"MinTemp":62,"MinRecordedTemp":39,"MaxRecordedTemp":90,"MinRecordedTempDate":127717344000000000,"MaxRecordedTempDate":118237536000000000,"Humidity":71,"Precipitation":5.11,"Visibility":8,"Windspeed":5,"AvgSunshineHours":7,"FoggyDayCount":3,"RainyDayCount":9,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":9},{"AvgTemp":58,"MaxTemp":68,"MinTemp":49,"MinRecordedTemp":35,"MaxRecordedTemp":85,"MinRecordedTempDate":112915296000000000,"MaxRecordedTempDate":116052480000000000,"Humidity":66,"Precipitation":2.029999,"Visibility":8,"Windspeed":5,"SnowDepth":2.549999,"AvgSunshineHours":7,"FoggyDayCount":4,"RainyDayCount":7,"SnowyDayCount":0,"HailDayCount":0,"TornadoDayCount":0,"Key":10},{"AvgTemp":44,"MaxTemp":53,"MinTemp":36,"MinRecordedTemp":32,"MaxRecordedTemp":82,"MinRecordedTempDate":115470144000000000,"MaxRecordedTempDate":118294560000000000,"Humidity":66,"Precipitation":1.759999,"Visibility":8,"Windspeed":5,"SnowDepth":4.429999,"AvgSunshineHours":5,"FoggyDayCount":3,"RainyDayCount":8,"SnowyDayCount":1,"HailDayCount":0,"TornadoDayCount":0,"Key":11},{"AvgTemp":32,"MaxTemp":39,"MinTemp":30,"MinRecordedTemp":30,"MaxRecordedTemp":67,"MinRecordedTempDate":115810560000000000,"MaxRecordedTempDate":116109504000000000,"Humidity":65,"Precipitation":0.709999,"Visibility":8,"Windspeed":5,"SnowDepth":4.2,"AvgSunshineHours":5,"FoggyDayCount":3,"RainyDayCount":5,"SnowyDayCount":5,"HailDayCount":0,"TornadoDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":12,"NumWindspeedEntities":12,"NumSnowDepthEntities":6,"NumSeaTempEntities":0,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":12,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":12,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":0,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/seoul/f/overview.json b/packages/microsoft.bingweather/resources/sampledata/seoul/f/overview.json
new file mode 100644
index 00000000..8f11bab7
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/seoul/f/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"F","CurrentWeather":{"Temperature":61,"FeelsLike":61,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":6,"WindDirection":"NNW","UV":0,"Humidity":59,"DewPoint":46,"Barometer":30,"Visibility":6},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":97.299999,"DailyConditions":[{"Date":129822912000000000,"TempHigh":77,"TempLow":58,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":5,"WindSpeed":8,"WindDirection":"WNW","Humidity":39,"UV":7,"Sunrise":129823101600000000,"Sunset":129823621200000000},{"Date":129823776000000000,"TempHigh":81,"TempLow":56,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","PrecipChance":2,"WindSpeed":9,"WindDirection":"WNW","Humidity":27,"UV":9,"Sunrise":129823965000000000,"Sunset":129824485200000000},{"Date":129824640000000000,"TempHigh":80,"TempLow":55,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"WindSpeed":8,"WindDirection":"W","Humidity":18,"UV":8,"Sunrise":129824828400000000,"Sunset":129825349800000000},{"Date":129825504000000000,"TempHigh":79,"TempLow":58,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","PrecipChance":2,"WindSpeed":10,"WindDirection":"WSW","Humidity":41,"UV":7,"Sunrise":129825692400000000,"Sunset":129826214400000000},{"Date":129826368000000000,"TempHigh":85,"TempLow":62,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","PrecipChance":20,"WindSpeed":7,"WindDirection":"E","Humidity":24,"UV":8,"Sunrise":129826555800000000,"Sunset":129827079000000000},{"Date":129827232000000000,"TempHigh":82,"TempLow":62,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":10,"WindSpeed":8,"WindDirection":"W","Humidity":35,"Sunrise":129827419800000000,"Sunset":129827943000000000},{"Date":129828096000000000,"TempHigh":79,"TempLow":58,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":45,"WindSpeed":7,"WindDirection":"W","Humidity":53,"Sunrise":129828283200000000,"Sunset":129828807600000000},{"Date":129828960000000000,"TempHigh":75,"TempLow":59,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":70,"WindSpeed":6,"WindDirection":"E","Humidity":38,"Sunrise":129829147200000000,"Sunset":129829672200000000},{"Date":129829824000000000,"TempHigh":79,"TempLow":59,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":45,"WindSpeed":6,"WindDirection":"W","Humidity":31,"Sunrise":129830011200000000,"Sunset":129830536200000000},{"Date":129830688000000000,"TempHigh":80,"TempLow":59,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":40,"WindSpeed":7,"WindDirection":"WSW","Humidity":32,"Sunrise":129830874600000000,"Sunset":129831400800000000}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":96.099999,"DailyConditions":[{"Date":129823344000000000,"TempHigh":74,"TempLow":52,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":13},{"Date":129824208000000000,"TempHigh":79,"TempLow":53,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Mostly Sunny","PrecipChance":26},{"Date":129825072000000000,"TempHigh":79,"TempLow":55,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":1},{"Date":129825936000000000,"TempHigh":79,"TempLow":58,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Mostly Sunny","PrecipChance":1},{"Date":129826800000000000,"TempHigh":79,"TempLow":56,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Mostly Sunny","PrecipChance":25},{"Date":129827664000000000,"TempHigh":80,"TempLow":58,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":12},{"Date":129828528000000000,"TempHigh":88,"TempLow":56,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":9},{"Date":129829392000000000,"TempHigh":77,"TempLow":55,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":26},{"Date":129830256000000000,"TempHigh":80,"TempLow":59,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":7},{"Date":129831120000000000,"TempHigh":81,"TempLow":62,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":2}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":83.9,"DailyConditions":[{"Date":129823668000000000,"TempHigh":79,"TempLow":63,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129824532000000000,"TempHigh":81,"TempLow":54,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129825396000000000,"TempHigh":81,"TempLow":52,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129826260000000000,"TempHigh":81,"TempLow":54,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129827124000000000,"TempHigh":84,"TempLow":54,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":0},{"Date":129827988000000000,"TempHigh":82,"TempLow":55,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129828852000000000,"TempHigh":82,"TempLow":55,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","PrecipChance":0},{"Date":129829716000000000,"TempHigh":84,"TempLow":61,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129830580000000000,"TempHigh":82,"TempLow":55,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","PrecipChance":0},{"Date":129831444000000000,"TempHigh":84,"TempLow":54,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","PrecipChance":0}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":5,"DefaultProvider":"","WindUnit":"M","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":65,"FeelsLike":67,"Icon":"/s/weather/89x89/29b.png","IconCode":"29b","Caption":"Partly Cloudy","WindSpeed":3,"WindDirection":"WNW","Humidity":50,"Barometer":30,"Visibility":11}},{"ProviderName":"","CurrentCondition":{"Temperature":66,"FeelsLike":66,"Icon":"/s/weather/89x89/31.png","IconCode":"31","Caption":"Clear","WindSpeed":0,"DewPoint":54,"Barometer":30,"Visibility":6}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129823668000000000,"Temp":66,"FeelsLike":66,"Icon":"/s/weather/55x45/29b.png","IconCode":"29b","Caption":"Partly Cloudy","WindSpeed":3,"WindDirection":"W","UV":0,"Humidity":51,"PrecipChance":2},{"Time":129823776000000000,"Temp":60,"FeelsLike":60,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":4,"WindDirection":"WSW","UV":0,"Humidity":64,"PrecipChance":2},{"Time":129823884000000000,"Temp":59,"FeelsLike":59,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":3,"WindDirection":"WSW","UV":0,"Humidity":73,"PrecipChance":2},{"Time":129823992000000000,"Temp":59,"FeelsLike":59,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":1,"WindDirection":"ESE","UV":0,"Humidity":74,"PrecipChance":2},{"Time":129824100000000000,"Temp":68,"FeelsLike":68,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":2,"WindDirection":"WSW","UV":4,"Humidity":55,"PrecipChance":2},{"Time":129824208000000000,"Temp":78,"FeelsLike":78,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":6,"WindDirection":"WNW","UV":9,"Humidity":31,"PrecipChance":2},{"Time":129824316000000000,"Temp":79,"FeelsLike":79,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","WindSpeed":9,"WindDirection":"W","UV":6,"Humidity":27,"PrecipChance":2},{"Time":129824424000000000,"Temp":76,"FeelsLike":76,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":8,"WindDirection":"WSW","UV":1,"Humidity":32,"PrecipChance":2},{"Time":129824532000000000,"Temp":64,"FeelsLike":64,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":3,"WindDirection":"WSW","UV":0,"Humidity":64,"PrecipChance":2},{"Time":129824640000000000,"Temp":59,"FeelsLike":59,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Clear","WindSpeed":4,"WindDirection":"SSW","UV":0,"Humidity":72,"PrecipChance":2},{"Time":129824748000000000,"Temp":59,"FeelsLike":59,"Icon":"/s/weather/55x45/29b.png","IconCode":"29b","Caption":"Partly Cloudy","WindSpeed":2,"WindDirection":"SSE","UV":0,"Humidity":77,"PrecipChance":2},{"Time":129824856000000000,"Temp":57,"FeelsLike":57,"Icon":"/s/weather/55x45/26.png","IconCode":"26","Caption":"Cloudy","WindSpeed":4,"WindDirection":"SW","UV":0,"Humidity":79,"PrecipChance":10},{"Time":129824964000000000,"Temp":67,"FeelsLike":67,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":2,"WindDirection":"W","UV":3,"Humidity":53,"PrecipChance":15},{"Time":129825072000000000,"Temp":75,"FeelsLike":75,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":4,"WindDirection":"SW","UV":8,"Humidity":29,"PrecipChance":20},{"Time":129825180000000000,"Temp":79,"FeelsLike":79,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":8,"WindDirection":"WSW","UV":6,"Humidity":18,"PrecipChance":5},{"Time":129825288000000000,"Temp":76,"FeelsLike":76,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Clear","WindSpeed":7,"WindDirection":"WSW","UV":1,"Humidity":24,"PrecipChance":2}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":false}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/taipei/c/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/taipei/c/historicalWeather.json
new file mode 100644
index 00000000..f813f8c2
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/taipei/c/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"C","WindUnit":"KM","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":4,"MonthSeason":"Best","BestSeasonMonths":[4,5,6,9,10],"AvoidSeasonMonths":[7,8],"OffSeasonMonths":[1,2,11,12],"MonthlyAggregatedData":[{"AvgTemp":16,"MaxTemp":19,"MinTemp":13,"MinRecordedTemp":4,"MaxRecordedTemp":31,"MinRecordedTempDate":120879648000000000,"MaxRecordedTempDate":121510368000000000,"Humidity":79,"Precipitation":2.709999,"Windspeed":11,"AvgSunshineHours":3,"RainyDayCount":15,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":1},{"AvgTemp":16,"MaxTemp":19,"MinTemp":13,"MinRecordedTemp":5,"MaxRecordedTemp":30,"MinRecordedTempDate":118695456000000000,"MaxRecordedTempDate":118377504000000000,"Humidity":80,"Precipitation":6.839999,"Windspeed":11,"AvgSunshineHours":3,"RainyDayCount":15,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":2},{"AvgTemp":18,"MaxTemp":22,"MinTemp":15,"MinRecordedTemp":4,"MaxRecordedTemp":32,"MinRecordedTempDate":121546656000000000,"MaxRecordedTempDate":118395648000000000,"Humidity":80,"Precipitation":7.769999,"Windspeed":11,"AvgSunshineHours":3,"RainyDayCount":17,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":3},{"AvgTemp":22,"MaxTemp":26,"MinTemp":19,"MinRecordedTemp":10,"MaxRecordedTemp":33,"MinRecordedTempDate":124729632000000000,"MaxRecordedTempDate":125378496000000000,"Humidity":78,"Precipitation":6.639999,"Windspeed":11,"AvgSunshineHours":4,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":4},{"AvgTemp":25,"MaxTemp":28,"MinTemp":22,"MinRecordedTemp":15,"MaxRecordedTemp":35,"MinRecordedTempDate":119403936000000000,"MaxRecordedTempDate":121620960000000000,"Humidity":79,"Precipitation":8.83,"Windspeed":10,"AvgSunshineHours":4,"RainyDayCount":14,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":5},{"AvgTemp":27,"MaxTemp":32,"MinTemp":24,"MinRecordedTemp":18,"MaxRecordedTemp":36,"MinRecordedTempDate":122257728000000000,"MaxRecordedTempDate":118806912000000000,"Humidity":77,"Precipitation":7.929999,"Windspeed":9,"AvgSunshineHours":6,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":3,"Key":6},{"AvgTemp":29,"MaxTemp":34,"MinTemp":26,"MinRecordedTemp":21,"MaxRecordedTemp":36,"MinRecordedTempDate":118498464000000000,"MaxRecordedTempDate":125452800000000000,"Humidity":73,"Precipitation":5.379999,"Windspeed":9,"AvgSunshineHours":8,"RainyDayCount":10,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":4,"Key":7},{"AvgTemp":29,"MaxTemp":33,"MinTemp":26,"MinRecordedTemp":14,"MaxRecordedTemp":37,"MinRecordedTempDate":120755232000000000,"MaxRecordedTempDate":122946336000000000,"Humidity":74,"Precipitation":8.98,"Windspeed":10,"AvgSunshineHours":7,"RainyDayCount":11,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":3,"Key":8},{"AvgTemp":27,"MaxTemp":31,"MinTemp":24,"MinRecordedTemp":18,"MaxRecordedTemp":38,"MinRecordedTempDate":124253568000000000,"MaxRecordedTempDate":118572768000000000,"Humidity":75,"Precipitation":11.82,"Windspeed":11,"AvgSunshineHours":6,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":9},{"AvgTemp":24,"MaxTemp":27,"MinTemp":22,"MinRecordedTemp":10,"MaxRecordedTemp":35,"MinRecordedTempDate":123012864000000000,"MaxRecordedTempDate":120784608000000000,"Humidity":75,"Precipitation":5.4,"Windspeed":13,"AvgSunshineHours":5,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":10},{"AvgTemp":21,"MaxTemp":24,"MinTemp":19,"MinRecordedTemp":10,"MaxRecordedTemp":33,"MinRecordedTempDate":118623744000000000,"MaxRecordedTempDate":119235456000000000,"Humidity":75,"Precipitation":2.759999,"Windspeed":13,"AvgSunshineHours":4,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":11},{"AvgTemp":18,"MaxTemp":21,"MinTemp":15,"MinRecordedTemp":4,"MaxRecordedTemp":31,"MinRecordedTempDate":117706176000000000,"MaxRecordedTempDate":122418432000000000,"Humidity":76,"Precipitation":2.77,"Windspeed":11,"AvgSunshineHours":3,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":0,"NumWindspeedEntities":12,"NumSnowDepthEntities":0,"NumSeaTempEntities":0,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":0,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":0,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":12,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/taipei/c/overview.json b/packages/microsoft.bingweather/resources/sampledata/taipei/c/overview.json
new file mode 100644
index 00000000..a70d9822
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/taipei/c/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"C","CurrentWeather":{"Temperature":29,"FeelsLike":33,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":20,"WindDirection":"E","UV":11,"Humidity":70,"DewPoint":23,"Barometer":1010,"Visibility":10},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":97,"DailyConditions":[{"Date":129827232000000000,"TempHigh":29,"TempLow":24,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129827414700000000,"Sunset":129827903040000000},{"Date":129828096000000000,"TempHigh":31,"TempLow":22,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129828278580000000,"Sunset":129828767320000000},{"Date":129828960000000000,"TempHigh":29,"TempLow":21,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129829142470000000,"Sunset":129829631600000000},{"Date":129829824000000000,"TempHigh":28,"TempLow":21,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129830006380000000,"Sunset":129830495870000000},{"Date":129830688000000000,"TempHigh":27,"TempLow":21,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129830870290000000,"Sunset":129831360140000000},{"Date":129831552000000000,"TempHigh":27,"TempLow":21,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129831734220000000,"Sunset":129832224400000000},{"Date":129832416000000000,"TempHigh":28,"TempLow":21,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129832598170000000,"Sunset":129833088660000000}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":94.7,"DailyConditions":[{"Date":129828060000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129828924000000000,"TempHigh":30,"TempLow":24,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129829788000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129830652000000000,"TempHigh":28,"TempLow":22,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":20},{"Date":129831516000000000,"TempHigh":30,"TempLow":22,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":70},{"Date":129832380000000000,"TempHigh":28,"TempLow":22,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":50},{"Date":129833244000000000,"TempHigh":29,"TempLow":22,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":40},{"Date":129834108000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":20},{"Date":129834972000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129835836000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":40}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":96.599999,"DailyConditions":[{"Date":129827232000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":98,"WindSpeed":22,"WindDirection":"ESE","Humidity":63,"UV":11,"Sunrise":129827414400000000,"Sunset":129827902800000000},{"Date":129828096000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":98,"WindSpeed":6,"WindDirection":"WNW","Humidity":68,"UV":11,"Sunrise":129828278400000000,"Sunset":129828766800000000},{"Date":129828960000000000,"TempHigh":28,"TempLow":24,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":97,"WindSpeed":9,"WindDirection":"N","Humidity":75,"UV":5,"Sunrise":129829142400000000,"Sunset":129829631400000000},{"Date":129829824000000000,"TempHigh":29,"TempLow":25,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":95,"WindSpeed":18,"WindDirection":"E","Humidity":74,"UV":11,"Sunrise":129830005800000000,"Sunset":129830495400000000},{"Date":129830688000000000,"TempHigh":30,"TempLow":23,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":97,"WindSpeed":16,"WindDirection":"E","Humidity":70,"UV":3,"Sunrise":129830869800000000,"Sunset":129831360000000000},{"Date":129831552000000000,"TempHigh":26,"TempLow":23,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","PrecipChance":98,"WindSpeed":22,"WindDirection":"ENE","Humidity":81,"Sunrise":129831733800000000,"Sunset":129832224000000000},{"Date":129832416000000000,"TempHigh":28,"TempLow":22,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","PrecipChance":98,"WindSpeed":16,"WindDirection":"ENE","Humidity":75,"Sunrise":129832597800000000,"Sunset":129833088600000000},{"Date":129833280000000000,"TempHigh":28,"TempLow":23,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":85,"WindSpeed":15,"WindDirection":"ENE","Humidity":75,"Sunrise":129833461800000000,"Sunset":129833952600000000},{"Date":129834144000000000,"TempHigh":29,"TempLow":22,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":75,"WindSpeed":13,"WindDirection":"ENE","Humidity":71,"Sunrise":129834325800000000,"Sunset":129834816600000000},{"Date":129835008000000000,"TempHigh":30,"TempLow":25,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":65,"WindSpeed":8,"WindDirection":"ESE","Humidity":68,"Sunrise":129835189800000000,"Sunset":129835681200000000}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":5,"DefaultProvider":"","WindUnit":"KM","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":30,"FeelsLike":32,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":11,"WindDirection":"SW","DewPoint":24,"Barometer":1008,"Visibility":10}},{"ProviderName":"","CurrentCondition":{"Temperature":29,"FeelsLike":33,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":20,"WindDirection":"E","UV":11,"Humidity":70,"DewPoint":23,"Barometer":1010,"Visibility":10}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129827628000000000,"Temp":27,"FeelsLike":27,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","WindSpeed":18,"WindDirection":"ESE","UV":11,"Humidity":75,"PrecipChance":97},{"Time":129827736000000000,"Temp":30,"FeelsLike":30,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":22,"WindDirection":"ESE","UV":8,"Humidity":63,"PrecipChance":90},{"Time":129827844000000000,"Temp":28,"FeelsLike":29,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","WindSpeed":16,"WindDirection":"ESE","UV":1,"Humidity":70,"PrecipChance":80},{"Time":129827952000000000,"Temp":26,"FeelsLike":27,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":13,"WindDirection":"ESE","UV":0,"Humidity":73,"PrecipChance":50},{"Time":129828060000000000,"Temp":25,"FeelsLike":26,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":7,"WindDirection":"ESE","UV":0,"Humidity":76,"PrecipChance":35},{"Time":129828168000000000,"Temp":24,"FeelsLike":24,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":5,"WindDirection":"SE","UV":0,"Humidity":82,"PrecipChance":45},{"Time":129828276000000000,"Temp":24,"FeelsLike":25,"Icon":"/s/weather/55x45/27b.png","IconCode":"27b","Caption":"Mostly Cloudy","WindSpeed":3,"WindDirection":"SE","UV":0,"Humidity":83,"PrecipChance":40},{"Time":129828384000000000,"Temp":27,"FeelsLike":27,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":4,"WindDirection":"SSE","UV":3,"Humidity":77,"PrecipChance":30},{"Time":129828492000000000,"Temp":29,"FeelsLike":29,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":2,"WindDirection":"SSW","UV":10,"Humidity":68,"PrecipChance":90},{"Time":129828600000000000,"Temp":28,"FeelsLike":28,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","WindSpeed":6,"WindDirection":"WNW","UV":8,"Humidity":78,"PrecipChance":97},{"Time":129828708000000000,"Temp":26,"FeelsLike":26,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","WindSpeed":3,"WindDirection":"W","UV":1,"Humidity":83,"PrecipChance":98},{"Time":129828816000000000,"Temp":26,"FeelsLike":27,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":3,"WindDirection":"SE","UV":0,"Humidity":82,"PrecipChance":90},{"Time":129828924000000000,"Temp":25,"FeelsLike":25,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":0,"UV":0,"Humidity":84,"PrecipChance":60},{"Time":129829032000000000,"Temp":24,"FeelsLike":24,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":4,"WindDirection":"W","UV":0,"Humidity":87,"PrecipChance":60},{"Time":129829140000000000,"Temp":24,"FeelsLike":24,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":3,"WindDirection":"SSW","UV":0,"Humidity":89,"PrecipChance":60},{"Time":129829248000000000,"Temp":26,"FeelsLike":26,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":4,"WindDirection":"NNW","UV":1,"Humidity":84,"PrecipChance":90}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":false}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/taipei/f/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/taipei/f/historicalWeather.json
new file mode 100644
index 00000000..9b0e54ef
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/taipei/f/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"F","WindUnit":"M","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":4,"MonthSeason":"Best","BestSeasonMonths":[4,5,6,9,10],"AvoidSeasonMonths":[7,8],"OffSeasonMonths":[1,2,11,12],"MonthlyAggregatedData":[{"AvgTemp":60,"MaxTemp":66,"MinTemp":56,"MinRecordedTemp":38,"MaxRecordedTemp":80,"MinRecordedTempDate":120879648000000000,"MaxRecordedTempDate":121510368000000000,"Humidity":79,"Precipitation":1.07,"Windspeed":7,"AvgSunshineHours":3,"RainyDayCount":15,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":1},{"AvgTemp":61,"MaxTemp":67,"MinTemp":56,"MinRecordedTemp":41,"MaxRecordedTemp":82,"MinRecordedTempDate":118695456000000000,"MaxRecordedTempDate":118377504000000000,"Humidity":80,"Precipitation":2.689999,"Windspeed":7,"AvgSunshineHours":3,"RainyDayCount":15,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":2},{"AvgTemp":64,"MaxTemp":71,"MinTemp":59,"MinRecordedTemp":40,"MaxRecordedTemp":88,"MinRecordedTempDate":121546656000000000,"MaxRecordedTempDate":118395648000000000,"Humidity":80,"Precipitation":3.06,"Windspeed":7,"AvgSunshineHours":3,"RainyDayCount":17,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":3},{"AvgTemp":71,"MaxTemp":78,"MinTemp":66,"MinRecordedTemp":50,"MaxRecordedTemp":86,"MinRecordedTempDate":124729632000000000,"MaxRecordedTempDate":125378496000000000,"Humidity":78,"Precipitation":2.609999,"Windspeed":7,"AvgSunshineHours":4,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":4},{"AvgTemp":76,"MaxTemp":83,"MinTemp":71,"MinRecordedTemp":59,"MaxRecordedTemp":89,"MinRecordedTempDate":119403936000000000,"MaxRecordedTempDate":121620960000000000,"Humidity":79,"Precipitation":3.479999,"Windspeed":6,"AvgSunshineHours":4,"RainyDayCount":14,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":1,"Key":5},{"AvgTemp":81,"MaxTemp":89,"MinTemp":76,"MinRecordedTemp":64,"MaxRecordedTemp":92,"MinRecordedTempDate":122257728000000000,"MaxRecordedTempDate":118806912000000000,"Humidity":77,"Precipitation":3.12,"Windspeed":5,"AvgSunshineHours":6,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":3,"Key":6},{"AvgTemp":85,"MaxTemp":93,"MinTemp":78,"MinRecordedTemp":70,"MaxRecordedTemp":90,"MinRecordedTempDate":118498464000000000,"MaxRecordedTempDate":125452800000000000,"Humidity":73,"Precipitation":2.12,"Windspeed":5,"AvgSunshineHours":8,"RainyDayCount":10,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":4,"Key":7},{"AvgTemp":84,"MaxTemp":92,"MinTemp":78,"MinRecordedTemp":58,"MaxRecordedTemp":90,"MinRecordedTempDate":120755232000000000,"MaxRecordedTempDate":122946336000000000,"Humidity":74,"Precipitation":3.54,"Windspeed":6,"AvgSunshineHours":7,"RainyDayCount":11,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":3,"Key":8},{"AvgTemp":81,"MaxTemp":88,"MinTemp":76,"MinRecordedTemp":64,"MaxRecordedTemp":95,"MinRecordedTempDate":124253568000000000,"MaxRecordedTempDate":118572768000000000,"Humidity":75,"Precipitation":4.66,"Windspeed":7,"AvgSunshineHours":6,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":2,"Key":9},{"AvgTemp":76,"MaxTemp":81,"MinTemp":71,"MinRecordedTemp":51,"MaxRecordedTemp":92,"MinRecordedTempDate":123012864000000000,"MaxRecordedTempDate":120784608000000000,"Humidity":75,"Precipitation":2.12,"Windspeed":8,"AvgSunshineHours":5,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":10},{"AvgTemp":70,"MaxTemp":75,"MinTemp":65,"MinRecordedTemp":50,"MaxRecordedTemp":91,"MinRecordedTempDate":118623744000000000,"MaxRecordedTempDate":119235456000000000,"Humidity":75,"Precipitation":1.09,"Windspeed":8,"AvgSunshineHours":4,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":11},{"AvgTemp":64,"MaxTemp":70,"MinTemp":60,"MinRecordedTemp":39,"MaxRecordedTemp":88,"MinRecordedTempDate":117706176000000000,"MaxRecordedTempDate":122418432000000000,"Humidity":76,"Precipitation":1.09,"Windspeed":7,"AvgSunshineHours":3,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"ThunderDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":0,"NumWindspeedEntities":12,"NumSnowDepthEntities":0,"NumSeaTempEntities":0,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":0,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":0,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":12,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/taipei/f/overview.json b/packages/microsoft.bingweather/resources/sampledata/taipei/f/overview.json
new file mode 100644
index 00000000..25f4e2fd
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/taipei/f/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"F","CurrentWeather":{"Temperature":84,"FeelsLike":91,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":13,"WindDirection":"E","UV":11,"Humidity":70,"DewPoint":73,"Barometer":30,"Visibility":6},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":97,"DailyConditions":[{"Date":129827232000000000,"TempHigh":84,"TempLow":75,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129827414700000000,"Sunset":129827903040000000},{"Date":129828096000000000,"TempHigh":88,"TempLow":72,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129828278580000000,"Sunset":129828767320000000},{"Date":129828960000000000,"TempHigh":84,"TempLow":70,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129829142470000000,"Sunset":129829631600000000},{"Date":129829824000000000,"TempHigh":82,"TempLow":70,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129830006380000000,"Sunset":129830495870000000},{"Date":129830688000000000,"TempHigh":81,"TempLow":70,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129830870290000000,"Sunset":129831360140000000},{"Date":129831552000000000,"TempHigh":81,"TempLow":70,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129831734220000000,"Sunset":129832224400000000},{"Date":129832416000000000,"TempHigh":82,"TempLow":71,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","Sunrise":129832598170000000,"Sunset":129833088660000000}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":94.7,"DailyConditions":[{"Date":129828060000000000,"TempHigh":85,"TempLow":73,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129828924000000000,"TempHigh":86,"TempLow":75,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129829788000000000,"TempHigh":86,"TempLow":74,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":50},{"Date":129830652000000000,"TempHigh":82,"TempLow":72,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":20},{"Date":129831516000000000,"TempHigh":85,"TempLow":72,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":70},{"Date":129832380000000000,"TempHigh":82,"TempLow":72,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":50},{"Date":129833244000000000,"TempHigh":84,"TempLow":72,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":40},{"Date":129834108000000000,"TempHigh":85,"TempLow":73,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":20},{"Date":129834972000000000,"TempHigh":86,"TempLow":74,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":0},{"Date":129835836000000000,"TempHigh":86,"TempLow":73,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":40}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":96.599999,"DailyConditions":[{"Date":129827232000000000,"TempHigh":87,"TempLow":74,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":98,"WindSpeed":13,"WindDirection":"ESE","Humidity":63,"UV":11,"Sunrise":129827414400000000,"Sunset":129827902800000000},{"Date":129828096000000000,"TempHigh":87,"TempLow":74,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":98,"WindSpeed":4,"WindDirection":"WNW","Humidity":68,"UV":11,"Sunrise":129828278400000000,"Sunset":129828766800000000},{"Date":129828960000000000,"TempHigh":83,"TempLow":75,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":97,"WindSpeed":6,"WindDirection":"N","Humidity":75,"UV":5,"Sunrise":129829142400000000,"Sunset":129829631400000000},{"Date":129829824000000000,"TempHigh":84,"TempLow":76,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":95,"WindSpeed":11,"WindDirection":"E","Humidity":74,"UV":11,"Sunrise":129830005800000000,"Sunset":129830495400000000},{"Date":129830688000000000,"TempHigh":87,"TempLow":73,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","PrecipChance":97,"WindSpeed":10,"WindDirection":"E","Humidity":70,"UV":3,"Sunrise":129830869800000000,"Sunset":129831360000000000},{"Date":129831552000000000,"TempHigh":78,"TempLow":73,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","PrecipChance":98,"WindSpeed":13,"WindDirection":"ENE","Humidity":81,"Sunrise":129831733800000000,"Sunset":129832224000000000},{"Date":129832416000000000,"TempHigh":82,"TempLow":72,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","PrecipChance":98,"WindSpeed":10,"WindDirection":"ENE","Humidity":75,"Sunrise":129832597800000000,"Sunset":129833088600000000},{"Date":129833280000000000,"TempHigh":83,"TempLow":73,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":85,"WindSpeed":9,"WindDirection":"ENE","Humidity":75,"Sunrise":129833461800000000,"Sunset":129833952600000000},{"Date":129834144000000000,"TempHigh":84,"TempLow":74,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":75,"WindSpeed":8,"WindDirection":"ENE","Humidity":71,"Sunrise":129834325800000000,"Sunset":129834816600000000},{"Date":129835008000000000,"TempHigh":88,"TempLow":77,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":65,"WindSpeed":5,"WindDirection":"ESE","Humidity":68,"Sunrise":129835189800000000,"Sunset":129835681200000000}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":5,"DefaultProvider":"","WindUnit":"M","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":85,"FeelsLike":95,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":7,"WindDirection":"SW","DewPoint":75,"Barometer":30,"Visibility":6}},{"ProviderName":"","CurrentCondition":{"Temperature":84,"FeelsLike":89,"Icon":"/s/weather/89x89/27.png","IconCode":"27","Caption":"Mostly Cloudy","WindSpeed":15,"WindDirection":"E","UV":11,"Humidity":66,"DewPoint":72,"Barometer":30,"Visibility":6}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129827628000000000,"Temp":80,"FeelsLike":80,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","WindSpeed":11,"WindDirection":"ESE","UV":11,"Humidity":75,"PrecipChance":97},{"Time":129827736000000000,"Temp":85,"FeelsLike":85,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","WindSpeed":13,"WindDirection":"ESE","UV":8,"Humidity":63,"PrecipChance":90},{"Time":129827844000000000,"Temp":82,"FeelsLike":82,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Fair","WindSpeed":10,"WindDirection":"ESE","UV":1,"Humidity":70,"PrecipChance":80},{"Time":129827952000000000,"Temp":79,"FeelsLike":79,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":8,"WindDirection":"ESE","UV":0,"Humidity":73,"PrecipChance":50},{"Time":129828060000000000,"Temp":77,"FeelsLike":77,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":4,"WindDirection":"ESE","UV":0,"Humidity":76,"PrecipChance":35},{"Time":129828168000000000,"Temp":76,"FeelsLike":76,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":3,"WindDirection":"SE","UV":0,"Humidity":82,"PrecipChance":45},{"Time":129828276000000000,"Temp":75,"FeelsLike":75,"Icon":"/s/weather/55x45/27b.png","IconCode":"27b","Caption":"Mostly Cloudy","WindSpeed":2,"WindDirection":"SE","UV":0,"Humidity":83,"PrecipChance":40},{"Time":129828384000000000,"Temp":80,"FeelsLike":80,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":3,"WindDirection":"SSE","UV":3,"Humidity":77,"PrecipChance":30},{"Time":129828492000000000,"Temp":84,"FeelsLike":84,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":1,"WindDirection":"SSW","UV":10,"Humidity":68,"PrecipChance":90},{"Time":129828600000000000,"Temp":82,"FeelsLike":82,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","WindSpeed":4,"WindDirection":"WNW","UV":8,"Humidity":78,"PrecipChance":97},{"Time":129828708000000000,"Temp":79,"FeelsLike":79,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","WindSpeed":2,"WindDirection":"W","UV":1,"Humidity":83,"PrecipChance":98},{"Time":129828816000000000,"Temp":78,"FeelsLike":78,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":2,"WindDirection":"SE","UV":0,"Humidity":82,"PrecipChance":90},{"Time":129828924000000000,"Temp":77,"FeelsLike":77,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":0,"UV":0,"Humidity":84,"PrecipChance":60},{"Time":129829032000000000,"Temp":76,"FeelsLike":76,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":2,"WindDirection":"W","UV":0,"Humidity":87,"PrecipChance":60},{"Time":129829140000000000,"Temp":76,"FeelsLike":76,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":2,"WindDirection":"SSW","UV":0,"Humidity":89,"PrecipChance":60},{"Time":129829248000000000,"Temp":78,"FeelsLike":78,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":2,"WindDirection":"NNW","UV":1,"Humidity":84,"PrecipChance":90}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":false}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/tokyo/c/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/tokyo/c/historicalWeather.json
new file mode 100644
index 00000000..521202f2
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/tokyo/c/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"Tokyo, Japan","ExtractedLocationName":"Tokyo, Japan","TempUnit":"C","WindUnit":"KM","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SeaTempProvider":{"ProviderName":"","ProviderUrl":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":4,"MonthSeason":"Best","BestSeasonMonths":[3,4,5,9,10,11],"AvoidSeasonMonths":[6,7,8],"OffSeasonMonths":[1,2,12],"MonthlyAggregatedData":[{"AvgTemp":6,"MaxTemp":10,"MinTemp":2,"MinRecordedTemp":1,"MaxRecordedTemp":22,"MinRecordedTempDate":119613888000000000,"MaxRecordedTempDate":120241152000000000,"Humidity":52,"Precipitation":5.79,"Visibility":15,"Windspeed":13,"SnowDepth":27.149999,"SeaTemp":17,"AvgSunshineHours":6,"RainyDayCount":6,"HailDayCount":0,"TornadoDayCount":0,"Key":1},{"AvgTemp":6,"MaxTemp":10,"MinTemp":2,"MinRecordedTemp":-1,"MaxRecordedTemp":25,"MinRecordedTempDate":120898656000000000,"MaxRecordedTempDate":128790432000000000,"Humidity":54,"Precipitation":6.309999,"Visibility":14,"Windspeed":13,"SnowDepth":19.339999,"SeaTemp":16,"AvgSunshineHours":6,"RainyDayCount":7,"HailDayCount":0,"TornadoDayCount":0,"Key":2},{"AvgTemp":9,"MaxTemp":13,"MinTemp":5,"MinRecordedTemp":1,"MaxRecordedTemp":21,"MinRecordedTempDate":118709280000000000,"MaxRecordedTempDate":119983680000000000,"Humidity":59,"Precipitation":13.779999,"Visibility":14,"Windspeed":14,"SnowDepth":6.66,"SeaTemp":16,"AvgSunshineHours":6,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"Key":3},{"AvgTemp":14,"MaxTemp":18,"MinTemp":10,"MinRecordedTemp":1,"MaxRecordedTemp":28,"MinRecordedTempDate":122209344000000000,"MaxRecordedTempDate":127592064000000000,"Humidity":65,"Precipitation":13.88,"Visibility":13,"Windspeed":14,"SnowDepth":5.08,"SeaTemp":17,"AvgSunshineHours":5,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"Key":4},{"AvgTemp":18,"MaxTemp":22,"MinTemp":15,"MinRecordedTemp":8,"MaxRecordedTemp":30,"MinRecordedTempDate":123807744000000000,"MaxRecordedTempDate":125720640000000000,"Humidity":69,"Precipitation":14.47,"Visibility":13,"Windspeed":13,"SeaTemp":20,"AvgSunshineHours":6,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"Key":5},{"AvgTemp":21,"MaxTemp":25,"MinTemp":18,"MinRecordedTemp":9,"MaxRecordedTemp":32,"MinRecordedTempDate":117841824000000000,"MaxRecordedTempDate":127643904000000000,"Humidity":77,"Precipitation":17.839999,"Visibility":12,"Windspeed":12,"SeaTemp":22,"AvgSunshineHours":4,"RainyDayCount":14,"HailDayCount":0,"TornadoDayCount":0,"Key":6},{"AvgTemp":25,"MaxTemp":29,"MinTemp":22,"MinRecordedTemp":13,"MaxRecordedTemp":32,"MinRecordedTempDate":118495008000000000,"MaxRecordedTempDate":127348416000000000,"Humidity":78,"Precipitation":15.33,"Visibility":13,"Windspeed":11,"SeaTemp":24,"AvgSunshineHours":5,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"Key":7},{"AvgTemp":26,"MaxTemp":30,"MinTemp":24,"MinRecordedTemp":17,"MaxRecordedTemp":31,"MinRecordedTempDate":119806560000000000,"MaxRecordedTempDate":120745728000000000,"Humidity":76,"Precipitation":14.769999,"Visibility":13,"Windspeed":12,"SeaTemp":26,"AvgSunshineHours":6,"RainyDayCount":10,"HailDayCount":0,"TornadoDayCount":0,"Key":8},{"AvgTemp":23,"MaxTemp":27,"MinTemp":20,"MinRecordedTemp":13,"MaxRecordedTemp":32,"MinRecordedTempDate":119834208000000000,"MaxRecordedTempDate":123600384000000000,"Humidity":76,"Precipitation":20.51,"Visibility":13,"Windspeed":12,"SeaTemp":25,"AvgSunshineHours":4,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"Key":9},{"AvgTemp":18,"MaxTemp":21,"MinTemp":14,"MinRecordedTemp":6,"MaxRecordedTemp":28,"MinRecordedTempDate":118599552000000000,"MaxRecordedTempDate":119520576000000000,"Humidity":71,"Precipitation":19.55,"Visibility":13,"Windspeed":12,"SeaTemp":23,"AvgSunshineHours":4,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"Key":10},{"AvgTemp":13,"MaxTemp":17,"MinTemp":9,"MinRecordedTemp":2,"MaxRecordedTemp":26,"MinRecordedTempDate":118626336000000000,"MaxRecordedTempDate":122073696000000000,"Humidity":64,"Precipitation":10.73,"Visibility":13,"Windspeed":12,"SeaTemp":21,"AvgSunshineHours":5,"RainyDayCount":9,"HailDayCount":0,"TornadoDayCount":0,"Key":11},{"AvgTemp":8,"MaxTemp":12,"MinTemp":4,"MinRecordedTemp":2,"MaxRecordedTemp":24,"MinRecordedTempDate":118652256000000000,"MaxRecordedTempDate":127466784000000000,"Humidity":56,"Precipitation":4.37,"Visibility":15,"Windspeed":12,"SnowDepth":2.029999,"SeaTemp":19,"AvgSunshineHours":6,"RainyDayCount":6,"HailDayCount":0,"TornadoDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":12,"NumWindspeedEntities":12,"NumSnowDepthEntities":5,"NumSeaTempEntities":12,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":0,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":0,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":0,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/tokyo/c/overview.json b/packages/microsoft.bingweather/resources/sampledata/tokyo/c/overview.json
new file mode 100644
index 00000000..fdd80817
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/tokyo/c/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"C","CurrentWeather":{"Temperature":18,"FeelsLike":18,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":11,"WindDirection":"ENE","UV":0,"Humidity":93,"DewPoint":17,"Barometer":1008,"Visibility":6},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":97.099999,"DailyConditions":[{"Date":129803904000000000,"TempHigh":23,"TempLow":17,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100,"Sunrise":129804076600000000,"Sunset":129804569110000000},{"Date":129804768000000000,"TempHigh":22,"TempLow":17,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100,"Sunrise":129804939970000000,"Sunset":129805433620000000},{"Date":129805632000000000,"TempHigh":24,"TempLow":17,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129805803360000000,"Sunset":129806298120000000},{"Date":129806496000000000,"TempHigh":25,"TempLow":17,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":30,"Sunrise":129806666750000000,"Sunset":129807162620000000},{"Date":129807360000000000,"TempHigh":24,"TempLow":17,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129807530160000000,"Sunset":129808027110000000},{"Date":129808224000000000,"TempHigh":23,"TempLow":16,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129808393580000000,"Sunset":129808891610000000},{"Date":129809088000000000,"TempHigh":22,"TempLow":14,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129809257010000000,"Sunset":129809756110000000},{"Date":129809952000000000,"TempHigh":22,"TempLow":15,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"Sunrise":129810120460000000,"Sunset":129810620600000000}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":91.9,"DailyConditions":[{"Date":129804336000000000,"TempHigh":20,"TempLow":15,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100},{"Date":129805200000000000,"TempHigh":22,"TempLow":16,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100},{"Date":129806064000000000,"TempHigh":23,"TempLow":14,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":69},{"Date":129806928000000000,"TempHigh":25,"TempLow":15,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Sunny (Clear)","PrecipChance":2},{"Date":129807792000000000,"TempHigh":24,"TempLow":14,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":44},{"Date":129808656000000000,"TempHigh":23,"TempLow":13,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":6},{"Date":129809520000000000,"TempHigh":24,"TempLow":14,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":10},{"Date":129810384000000000,"TempHigh":23,"TempLow":15,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":66},{"Date":129811248000000000,"TempHigh":22,"TempLow":16,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":40},{"Date":129812112000000000,"TempHigh":23,"TempLow":13,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":78}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":96.799999,"DailyConditions":[{"Date":129803904000000000,"TempHigh":20,"TempLow":18,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95,"WindSpeed":26,"WindDirection":"SE","Humidity":75,"UV":3,"Sunrise":129804076200000000,"Sunset":129804568800000000},{"Date":129804768000000000,"TempHigh":20,"TempLow":17,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95,"WindSpeed":35,"WindDirection":"NW","Humidity":85,"UV":7,"Sunrise":129804939600000000,"Sunset":129805433400000000},{"Date":129805632000000000,"TempHigh":22,"TempLow":18,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":75,"WindSpeed":15,"WindDirection":"NNW","Humidity":63,"UV":8,"Sunrise":129805803000000000,"Sunset":129806298000000000},{"Date":129806496000000000,"TempHigh":23,"TempLow":16,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"WindSpeed":33,"WindDirection":"NW","Humidity":47,"UV":9,"Sunrise":129806666400000000,"Sunset":129807162600000000},{"Date":129807360000000000,"TempHigh":24,"TempLow":16,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"WindSpeed":44,"WindDirection":"SW","Humidity":62,"UV":8,"Sunrise":129807529800000000,"Sunset":129808026600000000},{"Date":129808224000000000,"TempHigh":23,"TempLow":14,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":30,"WindSpeed":17,"WindDirection":"N","Humidity":50,"Sunrise":129808393200000000,"Sunset":129808891200000000},{"Date":129809088000000000,"TempHigh":22,"TempLow":15,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":55,"WindSpeed":9,"WindDirection":"N","Humidity":46,"Sunrise":129809256600000000,"Sunset":129809755800000000},{"Date":129809952000000000,"TempHigh":21,"TempLow":16,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":55,"WindSpeed":10,"WindDirection":"S","Humidity":55,"Sunrise":129810120000000000,"Sunset":129810620400000000},{"Date":129810816000000000,"TempHigh":21,"TempLow":15,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":80,"WindSpeed":12,"WindDirection":"W","Humidity":61,"Sunrise":129810983400000000,"Sunset":129811485000000000},{"Date":129811680000000000,"TempHigh":21,"TempLow":16,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":40,"WindSpeed":14,"WindDirection":"N","Humidity":45,"Sunrise":129811846800000000,"Sunset":129812349000000000}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":5,"DefaultProvider":"","WindUnit":"KM","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":17,"FeelsLike":19,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Rain","WindSpeed":39,"WindDirection":"E","Humidity":93,"Barometer":1007,"Visibility":6}},{"ProviderName":"","CurrentCondition":{"Temperature":18,"FeelsLike":18,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Rain","WindSpeed":14,"WindDirection":"ENE","UV":0,"Humidity":92,"DewPoint":17,"Barometer":1009,"Visibility":6}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129804660000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":35,"WindDirection":"E","UV":0,"Humidity":88,"PrecipChance":95},{"Time":129804768000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":31,"WindDirection":"E","UV":0,"Humidity":86,"PrecipChance":95},{"Time":129804876000000000,"Temp":18,"FeelsLike":19,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":32,"WindDirection":"ENE","UV":0,"Humidity":84,"PrecipChance":95},{"Time":129804984000000000,"Temp":18,"FeelsLike":18,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":35,"WindDirection":"NE","UV":0,"Humidity":86,"PrecipChance":95},{"Time":129805092000000000,"Temp":20,"FeelsLike":20,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":15,"WindDirection":"ESE","UV":2,"Humidity":89,"PrecipChance":95},{"Time":129805200000000000,"Temp":20,"FeelsLike":19,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":7,"WindDirection":"WSW","UV":7,"Humidity":91,"PrecipChance":95},{"Time":129805308000000000,"Temp":20,"FeelsLike":20,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":10,"WindDirection":"NW","UV":3,"Humidity":89,"PrecipChance":95},{"Time":129805416000000000,"Temp":20,"FeelsLike":20,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":15,"WindDirection":"NW","UV":0,"Humidity":85,"PrecipChance":95},{"Time":129805524000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/9b.png","IconCode":"9b","Caption":"Showers / Clear","WindSpeed":12,"WindDirection":"WSW","UV":0,"Humidity":84,"PrecipChance":65},{"Time":129805632000000000,"Temp":19,"FeelsLike":19,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":12,"WindDirection":"SSW","UV":0,"Humidity":85,"PrecipChance":30},{"Time":129805740000000000,"Temp":18,"FeelsLike":18,"Icon":"/s/weather/55x45/9b.png","IconCode":"9b","Caption":"Showers / Clear","WindSpeed":8,"WindDirection":"SW","UV":0,"Humidity":86,"PrecipChance":40},{"Time":129805848000000000,"Temp":18,"FeelsLike":18,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","WindSpeed":13,"WindDirection":"WSW","UV":0,"Humidity":86,"PrecipChance":70},{"Time":129805956000000000,"Temp":18,"FeelsLike":18,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":10,"WindDirection":"WSW","UV":3,"Humidity":75,"PrecipChance":75},{"Time":129806064000000000,"Temp":21,"FeelsLike":21,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":9,"WindDirection":"SW","UV":8,"Humidity":68,"PrecipChance":65},{"Time":129806172000000000,"Temp":22,"FeelsLike":22,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":9,"WindDirection":"SSW","UV":3,"Humidity":63,"PrecipChance":55},{"Time":129806280000000000,"Temp":21,"FeelsLike":21,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":15,"WindDirection":"NNW","UV":0,"Humidity":73,"PrecipChance":65}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/tokyo/f/historicalWeather.json b/packages/microsoft.bingweather/resources/sampledata/tokyo/f/historicalWeather.json
new file mode 100644
index 00000000..942f2da8
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/tokyo/f/historicalWeather.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"Tokyo, Japan","ExtractedLocationName":"Tokyo, Japan","TempUnit":"F","WindUnit":"M","IsCurrentWeatherAvailable":true,"DataAttributions":{"DefaultDataProvider":{"ProviderName":""},"SeaTempProvider":{"ProviderName":"","ProviderUrl":""},"SunshineHrsProvider":{"ProviderName":"","ProviderUrl":""}},"CurrentMonth":4,"MonthSeason":"Best","BestSeasonMonths":[3,4,5,9,10,11],"AvoidSeasonMonths":[6,7,8],"OffSeasonMonths":[1,2,12],"MonthlyAggregatedData":[{"AvgTemp":42,"MaxTemp":50,"MinTemp":35,"MinRecordedTemp":32,"MaxRecordedTemp":71,"MinRecordedTempDate":119613888000000000,"MaxRecordedTempDate":120241152000000000,"Humidity":52,"Precipitation":2.279999,"Visibility":9,"Windspeed":8,"SnowDepth":10.689999,"SeaTemp":63,"AvgSunshineHours":6,"RainyDayCount":6,"HailDayCount":0,"TornadoDayCount":0,"Key":1},{"AvgTemp":43,"MaxTemp":50,"MinTemp":36,"MinRecordedTemp":30,"MaxRecordedTemp":77,"MinRecordedTempDate":120898656000000000,"MaxRecordedTempDate":128790432000000000,"Humidity":54,"Precipitation":2.49,"Visibility":9,"Windspeed":8,"SnowDepth":7.61,"SeaTemp":61,"AvgSunshineHours":6,"RainyDayCount":7,"HailDayCount":0,"TornadoDayCount":0,"Key":2},{"AvgTemp":48,"MaxTemp":55,"MinTemp":41,"MinRecordedTemp":32,"MaxRecordedTemp":88,"MinRecordedTempDate":118709280000000000,"MaxRecordedTempDate":119983680000000000,"Humidity":59,"Precipitation":5.419999,"Visibility":9,"Windspeed":9,"SnowDepth":2.62,"SeaTemp":61,"AvgSunshineHours":6,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"Key":3},{"AvgTemp":58,"MaxTemp":65,"MinTemp":50,"MinRecordedTemp":36,"MaxRecordedTemp":83,"MinRecordedTempDate":122209344000000000,"MaxRecordedTempDate":127592064000000000,"Humidity":65,"Precipitation":5.459999,"Visibility":8,"Windspeed":8,"SnowDepth":2,"SeaTemp":63,"AvgSunshineHours":5,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"Key":4},{"AvgTemp":65,"MaxTemp":72,"MinTemp":58,"MinRecordedTemp":46,"MaxRecordedTemp":87,"MinRecordedTempDate":123807744000000000,"MaxRecordedTempDate":125720640000000000,"Humidity":69,"Precipitation":5.7,"Visibility":8,"Windspeed":8,"SeaTemp":68,"AvgSunshineHours":6,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"Key":5},{"AvgTemp":71,"MaxTemp":77,"MinTemp":65,"MinRecordedTemp":48,"MaxRecordedTemp":96,"MinRecordedTempDate":117841824000000000,"MaxRecordedTempDate":127643904000000000,"Humidity":77,"Precipitation":7.019999,"Visibility":7,"Windspeed":7,"SeaTemp":72,"AvgSunshineHours":4,"RainyDayCount":14,"HailDayCount":0,"TornadoDayCount":0,"Key":6},{"AvgTemp":77,"MaxTemp":83,"MinTemp":72,"MinRecordedTemp":55,"MaxRecordedTemp":98,"MinRecordedTempDate":118495008000000000,"MaxRecordedTempDate":127348416000000000,"Humidity":78,"Precipitation":6.03,"Visibility":8,"Windspeed":7,"SeaTemp":75,"AvgSunshineHours":5,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"Key":7},{"AvgTemp":80,"MaxTemp":87,"MinTemp":74,"MinRecordedTemp":63,"MaxRecordedTemp":97,"MinRecordedTempDate":119806560000000000,"MaxRecordedTempDate":120745728000000000,"Humidity":76,"Precipitation":5.809999,"Visibility":8,"Windspeed":8,"SeaTemp":79,"AvgSunshineHours":6,"RainyDayCount":10,"HailDayCount":0,"TornadoDayCount":0,"Key":8},{"AvgTemp":74,"MaxTemp":80,"MinTemp":68,"MinRecordedTemp":55,"MaxRecordedTemp":96,"MinRecordedTempDate":119834208000000000,"MaxRecordedTempDate":123600384000000000,"Humidity":76,"Precipitation":8.08,"Visibility":8,"Windspeed":8,"SeaTemp":77,"AvgSunshineHours":4,"RainyDayCount":13,"HailDayCount":0,"TornadoDayCount":0,"Key":9},{"AvgTemp":64,"MaxTemp":71,"MinTemp":58,"MinRecordedTemp":43,"MaxRecordedTemp":88,"MinRecordedTempDate":118599552000000000,"MaxRecordedTempDate":119520576000000000,"Humidity":71,"Precipitation":7.7,"Visibility":8,"Windspeed":8,"SeaTemp":73,"AvgSunshineHours":4,"RainyDayCount":12,"HailDayCount":0,"TornadoDayCount":0,"Key":10},{"AvgTemp":55,"MaxTemp":62,"MinTemp":48,"MinRecordedTemp":32,"MaxRecordedTemp":79,"MinRecordedTempDate":118626336000000000,"MaxRecordedTempDate":122073696000000000,"Humidity":64,"Precipitation":4.23,"Visibility":8,"Windspeed":7,"SeaTemp":70,"AvgSunshineHours":5,"RainyDayCount":9,"HailDayCount":0,"TornadoDayCount":0,"Key":11},{"AvgTemp":47,"MaxTemp":54,"MinTemp":40,"MinRecordedTemp":27,"MaxRecordedTemp":74,"MinRecordedTempDate":118652256000000000,"MaxRecordedTempDate":127466784000000000,"Humidity":56,"Precipitation":1.719999,"Visibility":9,"Windspeed":7,"SnowDepth":0.8,"SeaTemp":66,"AvgSunshineHours":6,"RainyDayCount":6,"HailDayCount":0,"TornadoDayCount":0,"Key":12}],"MonthlyAggregatedDataStats":{"NumMinRecordedTempEntities":12,"NumMaxRecordedTempEntities":12,"NumMinRecordedTempDateEntities":12,"NumMaxRecordedTempDateEntities":12,"NumHumidityEntities":12,"NumPrecipitationEntities":12,"NumVisibilityEntities":12,"NumWindspeedEntities":12,"NumSnowDepthEntities":5,"NumSeaTempEntities":12,"NumAvgSunshineHoursEntities":12,"NumAvgDaylightHoursEntities":0,"NumFoggyDayCountEntities":0,"NumRainyDayCountEntities":12,"NumSnowyDayCountEntities":0,"NumHailDayCountEntities":12,"NumTornadoDayCountEntities":12,"NumThunderDayCountEntities":0,"NumHurricaneRiskMonths":0,"NumTornadoRiskMonths":0,"NumCycloneRiskMonths":0,"NumFloodRiskMonths":0,"NumThunderstormRiskMonths":0},"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/sampledata/tokyo/f/overview.json b/packages/microsoft.bingweather/resources/sampledata/tokyo/f/overview.json
new file mode 100644
index 00000000..c6d5e873
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/sampledata/tokyo/f/overview.json
@@ -0,0 +1 @@
+{"BdiGeneric_BingResponse_1_0":{"AppNS":"AppEx","Responses":[{"AppNS":"AppEx","LocationName":"","ExtractedLocationName":"","TempUnit":"F","CurrentWeather":{"Temperature":64,"FeelsLike":64,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Showers","WindSpeed":7,"WindDirection":"ENE","UV":0,"Humidity":93,"DewPoint":62,"Barometer":30,"Visibility":4},"CurrentConditionProvider":"","CurrentConditionLink":{"K":4,"Url":""},"DailyForecast":[{"Provider":"","Confidence":97.099999,"DailyConditions":[{"Date":129803904000000000,"TempHigh":73,"TempLow":63,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100,"Sunrise":129804076600000000,"Sunset":129804569110000000},{"Date":129804768000000000,"TempHigh":72,"TempLow":63,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100,"Sunrise":129804939970000000,"Sunset":129805433620000000},{"Date":129805632000000000,"TempHigh":75,"TempLow":63,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129805803360000000,"Sunset":129806298120000000},{"Date":129806496000000000,"TempHigh":77,"TempLow":63,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":30,"Sunrise":129806666750000000,"Sunset":129807162620000000},{"Date":129807360000000000,"TempHigh":75,"TempLow":63,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129807530160000000,"Sunset":129808027110000000},{"Date":129808224000000000,"TempHigh":73,"TempLow":61,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129808393580000000,"Sunset":129808891610000000},{"Date":129809088000000000,"TempHigh":72,"TempLow":57,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":30,"Sunrise":129809257010000000,"Sunset":129809756110000000},{"Date":129809952000000000,"TempHigh":72,"TempLow":59,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"Sunrise":129810120460000000,"Sunset":129810620600000000}],"DailyLink":{"K":5,"Url":""},"CurrentLink":{"K":6,"Url":""}},{"Provider":"","Confidence":91.9,"DailyConditions":[{"Date":129804336000000000,"TempHigh":68,"TempLow":59,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100},{"Date":129805200000000000,"TempHigh":71,"TempLow":60,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":100},{"Date":129806064000000000,"TempHigh":73,"TempLow":58,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":69},{"Date":129806928000000000,"TempHigh":77,"TempLow":61,"Icon":"/s/weather/55x45/31.png","IconCode":"31","Caption":"Sunny (Clear)","PrecipChance":2},{"Date":129807792000000000,"TempHigh":76,"TempLow":58,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":44},{"Date":129808656000000000,"TempHigh":73,"TempLow":56,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":6},{"Date":129809520000000000,"TempHigh":75,"TempLow":57,"Icon":"/s/weather/55x45/27.png","IconCode":"27","Caption":"Mostly Cloudy","PrecipChance":10},{"Date":129810384000000000,"TempHigh":74,"TempLow":59,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":66},{"Date":129811248000000000,"TempHigh":72,"TempLow":61,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":40},{"Date":129812112000000000,"TempHigh":73,"TempLow":55,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":78}],"DailyLink":{"K":7,"Url":""},"CurrentLink":{"K":8,"Url":""}},{"Provider":"","Confidence":96.799999,"DailyConditions":[{"Date":129803904000000000,"TempHigh":68,"TempLow":64,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95,"WindSpeed":16,"WindDirection":"SE","Humidity":75,"UV":3,"Sunrise":129804076200000000,"Sunset":129804568800000000},{"Date":129804768000000000,"TempHigh":69,"TempLow":63,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","PrecipChance":95,"WindSpeed":22,"WindDirection":"NW","Humidity":85,"UV":7,"Sunrise":129804939600000000,"Sunset":129805433400000000},{"Date":129805632000000000,"TempHigh":72,"TempLow":64,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","PrecipChance":75,"WindSpeed":9,"WindDirection":"NNW","Humidity":63,"UV":8,"Sunrise":129805803000000000,"Sunset":129806298000000000},{"Date":129806496000000000,"TempHigh":73,"TempLow":60,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"WindSpeed":21,"WindDirection":"NW","Humidity":47,"UV":9,"Sunrise":129806666400000000,"Sunset":129807162600000000},{"Date":129807360000000000,"TempHigh":75,"TempLow":60,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":20,"WindSpeed":27,"WindDirection":"SW","Humidity":62,"UV":8,"Sunrise":129807529800000000,"Sunset":129808026600000000},{"Date":129808224000000000,"TempHigh":73,"TempLow":57,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":30,"WindSpeed":10,"WindDirection":"N","Humidity":50,"Sunrise":129808393200000000,"Sunset":129808891200000000},{"Date":129809088000000000,"TempHigh":72,"TempLow":60,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":55,"WindSpeed":6,"WindDirection":"N","Humidity":46,"Sunrise":129809256600000000,"Sunset":129809755800000000},{"Date":129809952000000000,"TempHigh":70,"TempLow":60,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":55,"WindSpeed":6,"WindDirection":"S","Humidity":55,"Sunrise":129810120000000000,"Sunset":129810620400000000},{"Date":129810816000000000,"TempHigh":69,"TempLow":59,"Icon":"/s/weather/55x45/9.png","IconCode":"9","Caption":"Showers / Clear","PrecipChance":80,"WindSpeed":7,"WindDirection":"W","Humidity":61,"Sunrise":129810983400000000,"Sunset":129811485000000000},{"Date":129811680000000000,"TempHigh":70,"TempLow":60,"Icon":"/s/weather/55x45/29.png","IconCode":"29","Caption":"Partly Cloudy","PrecipChance":40,"WindSpeed":9,"WindDirection":"N","Humidity":45,"Sunrise":129811846800000000,"Sunset":129812349000000000}],"DailyLink":{"K":9,"Url":""},"CurrentLink":{"K":10,"Url":""}}],"CurrentMonth":5,"DefaultProvider":"","WindUnit":"M","CurrentConditionListPerProvider":[{"ProviderName":"","CurrentCondition":{"Temperature":63,"FeelsLike":64,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Rain","WindSpeed":24,"WindDirection":"E","Humidity":93,"Barometer":30,"Visibility":4}},{"ProviderName":"","CurrentCondition":{"Temperature":64,"FeelsLike":64,"Icon":"/s/weather/89x89/11.png","IconCode":"11","Caption":"Rain","WindSpeed":9,"WindDirection":"ENE","UV":0,"Humidity":92,"DewPoint":62,"Barometer":30,"Visibility":4}}],"HourlyListPerProvider":[{"ProviderName":"","HourlyTimeInterval":3,"HourlyConditionList":[{"Time":129804660000000000,"Temp":66,"FeelsLike":64,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":22,"WindDirection":"E","UV":0,"Humidity":88,"PrecipChance":95},{"Time":129804768000000000,"Temp":66,"FeelsLike":66,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":19,"WindDirection":"E","UV":0,"Humidity":86,"PrecipChance":95},{"Time":129804876000000000,"Temp":64,"FeelsLike":62,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":20,"WindDirection":"ENE","UV":0,"Humidity":84,"PrecipChance":95},{"Time":129804984000000000,"Temp":65,"FeelsLike":65,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":22,"WindDirection":"NE","UV":0,"Humidity":86,"PrecipChance":95},{"Time":129805092000000000,"Temp":67,"FeelsLike":67,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":9,"WindDirection":"ESE","UV":2,"Humidity":89,"PrecipChance":95},{"Time":129805200000000000,"Temp":68,"FeelsLike":68,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":4,"WindDirection":"WSW","UV":7,"Humidity":91,"PrecipChance":95},{"Time":129805308000000000,"Temp":69,"FeelsLike":68,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Rain","WindSpeed":6,"WindDirection":"NW","UV":3,"Humidity":89,"PrecipChance":95},{"Time":129805416000000000,"Temp":68,"FeelsLike":68,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":9,"WindDirection":"NW","UV":0,"Humidity":85,"PrecipChance":95},{"Time":129805524000000000,"Temp":67,"FeelsLike":67,"Icon":"/s/weather/55x45/9b.png","IconCode":"9b","Caption":"Showers / Clear","WindSpeed":7,"WindDirection":"WSW","UV":0,"Humidity":84,"PrecipChance":65},{"Time":129805632000000000,"Temp":67,"FeelsLike":67,"Icon":"/s/weather/55x45/31b.png","IconCode":"31b","Caption":"Fair","WindSpeed":7,"WindDirection":"SSW","UV":0,"Humidity":85,"PrecipChance":30},{"Time":129805740000000000,"Temp":65,"FeelsLike":65,"Icon":"/s/weather/55x45/9b.png","IconCode":"9b","Caption":"Showers / Clear","WindSpeed":5,"WindDirection":"SW","UV":0,"Humidity":86,"PrecipChance":40},{"Time":129805848000000000,"Temp":64,"FeelsLike":64,"Icon":"/s/weather/55x45/1b.png","IconCode":"1b","Caption":"Thunderstorms","WindSpeed":8,"WindDirection":"WSW","UV":0,"Humidity":86,"PrecipChance":70},{"Time":129805956000000000,"Temp":65,"FeelsLike":65,"Icon":"/s/weather/55x45/11.png","IconCode":"11","Caption":"Showers","WindSpeed":6,"WindDirection":"WSW","UV":3,"Humidity":75,"PrecipChance":75},{"Time":129806064000000000,"Temp":69,"FeelsLike":69,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":5,"WindDirection":"SW","UV":8,"Humidity":68,"PrecipChance":65},{"Time":129806172000000000,"Temp":72,"FeelsLike":72,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":6,"WindDirection":"SSW","UV":3,"Humidity":63,"PrecipChance":55},{"Time":129806280000000000,"Temp":70,"FeelsLike":70,"Icon":"/s/weather/55x45/9c.png","IconCode":"9c","Caption":"Light Showers","WindSpeed":9,"WindDirection":"NNW","UV":0,"Humidity":73,"PrecipChance":65}]}],"IsMostAccurate":false,"AlertsCount":0,"IsTripPlanAvailable":true,"IsMapsAvailable":true}]}}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/th.json b/packages/microsoft.bingweather/resources/th.json
new file mode 100644
index 00000000..6d645fd3
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/th.json
@@ -0,0 +1,392 @@
+{
+ "Platform": {
+ "Resources": {
+ "LanguageID": "30",
+ "Language_af": "แอฟริกานส์, แอฟริกา",
+ "Language_am": "อัมฮาริก",
+ "Language_ar": "อาหรับ",
+ "Language_arn-Latn": "มาปุดุงกุน",
+ "Language_as": "อัสสัม",
+ "Language_az": "อาเซอร์รี (ละติน)",
+ "Language_az-Cyrl": "อาเซอร์ไบจาน (ซิริลลิก)",
+ "Language_az-Latn": "อาเซอร์ไบจาน (ละติน)",
+ "Language_ba-Cyrl": "บัชคีร์",
+ "Language_be": "เบลารุส",
+ "Language_bg": "บัลแกเรีย",
+ "Language_bn": "บังคลา",
+ "Language_bn-bd": "บังคลา (บังคลาเทศ)",
+ "Language_bn-in": "บังคลา (อินเดีย)",
+ "Language_br-Latn": "เบรอตง",
+ "Language_bs": "บอสเนีย (ละติน)",
+ "Language_bs-Cyrl": "บอสเนีย (ซิริลลิก)",
+ "Language_bs-Latn": "บอสเนีย (ละติน)",
+ "Language_ca": "คาตาลัน",
+ "Language_ca-ES-valencia": "วาเลนเชียน",
+ "Language_chr": "เชอโรกี",
+ "Language_chr-Cher": "เชอโรกี (เชอโรกี)",
+ "Language_co-Latn": "คอร์ซิกา",
+ "Language_cs": "เช็ก",
+ "Language_cy": "เวลช์",
+ "Language_da": "เดนมาร์ก",
+ "Language_de": "เยอรมัน",
+ "Language_dsb": "ซอร์เบียตอนล่าง",
+ "Language_dv": "ดิเวฮี",
+ "Language_el": "กรีก",
+ "Language_en": "อังกฤษ",
+ "Language_es": "สเปน",
+ "Language_et": "เอสโตเนีย",
+ "Language_eu": "บาสก์",
+ "Language_fa": "เปอร์เซีย",
+ "Language_ff-Latn": "ฟูลาห์",
+ "Language_fi": "ฟินแลนด์",
+ "Language_fil-Latn": "ฟิลิปิโน",
+ "Language_fo": "ฟาโร",
+ "Language_fr": "ฝรั่งเศส",
+ "Language_fy": "ฟรีเซีย",
+ "Language_ga": "ไอริช",
+ "Language_gd": "เกลิกสกอต",
+ "Language_gd-Latn": "เกลิกสกอต",
+ "Language_gl": "เกลิเซียน",
+ "Language_gsw": "อัลซาส",
+ "Language_gu": "คุชราตี",
+ "Language_ha": "เฮาซา (ละติน)",
+ "Language_ha-Latn": "เฮาซา (ละติน)",
+ "Language_he": "ฮิบรู",
+ "Language_hi": "ฮินดี",
+ "Language_hr": "โครเอเชีย",
+ "Language_hsb": "ซอร์เบียตอนบน",
+ "Language_hu": "ฮังการี",
+ "Language_hy": "อาร์เมเนีย",
+ "Language_id": "อินโดนีเซีย",
+ "Language_ig": "อิกโบ",
+ "Language_ig-Latn": "อิกโบ",
+ "Language_is": "ไอซ์แลนด์",
+ "Language_it": "อิตาลี",
+ "Language_iu-Latn": "อินุกติตัต (ละติน)",
+ "Language_ja": "ญี่ปุ่น",
+ "Language_ka": "จอร์เจีย",
+ "Language_kk": "คาซัคสถาน",
+ "Language_kl": "กรีนแลนด์",
+ "Language_km": "เขมร",
+ "Language_kn": "กัณณาท",
+ "Language_ko": "เกาหลี",
+ "Language_kok": "คอนคานี",
+ "Language_ku": "ภาษาเคิร์ด",
+ "Language_ku-Arab": "ภาษาเคิร์ดตอนกลาง",
+ "Language_ky": "คีร์กีซ",
+ "Language_ky-Cyrl": "คีร์กีซ",
+ "Language_lb": "ลักเซมเบิร์ก",
+ "Language_lo": "ลาว",
+ "Language_lt": "ลิทัวเนีย",
+ "Language_lv": "ลัตเวีย",
+ "Language_mi-Latn": "เมารี",
+ "Language_mk": "มาซิโดเนีย",
+ "Language_ml": "มะละยาลัม",
+ "Language_mn": "มองโกเลีย (ซิริลลิก)",
+ "Language_mn-Cyrl": "มองโกเลีย (ซิริลลิก)",
+ "Language_mr": "มาราฐี",
+ "Language_ms": "มลายู",
+ "Language_mt": "มอลตา",
+ "Language_nb": "นอร์เวย์ (บอกมัล)",
+ "Language_ne": "เนปาล",
+ "Language_nl": "ดัตช์",
+ "Language_nn": "นอร์เวย์ (ไนนอสก์)",
+ "Language_nso": "เซโซโทซาเลบาว",
+ "Language_oc-Latn": "อ็อกซิทาเนีย",
+ "Language_or": "โอเดีย",
+ "Language_pa": "ปัญจาบ (คุรุมุขคี)",
+ "Language_pa-Arab": "ปัญจาบ (อาหรับ)",
+ "Language_pl": "โปแลนด์",
+ "Language_prs": "ดารี",
+ "Language_prs-arab": "ดารี",
+ "Language_ps": "พาชโต",
+ "Language_pt": "โปรตุเกส",
+ "Language_pt-br": "โปรตุเกส (บราซิล)",
+ "Language_pt-pt": "โปรตุเกส (โปรตุเกส)",
+ "Language_quc-Latn": "คีเช",
+ "Language_qut": "คีเช",
+ "Language_quz-Latn": "เคชวา",
+ "Language_ro": "โรมาเนีย",
+ "Language_ru": "รัสเซีย",
+ "Language_rw": "คินยาร์วานดา",
+ "Language_sa-Deva": "สันสกฤต",
+ "Language_sah-Cyrl": "ซาคา",
+ "Language_sd-Arab": "สินธิ (อาหรับ)",
+ "Language_se-Latn": "เซมีเหนือ",
+ "Language_si": "สิงอะลา",
+ "Language_sk": "สโลวัก",
+ "Language_sl": "สโลวีเนีย",
+ "Language_sma-Latn": "เซมีใต้",
+ "Language_smj-Latn": "ลูล เซมี",
+ "Language_smn-Latn": "อินารี เซมี",
+ "Language_sms-Latn": "สโคลต์ เซมี",
+ "Language_sq": "แอลเบเนีย",
+ "Language_sr-Cyrl": "เซอร์เบีย (ซิริลลิก)",
+ "Language_sr-cyrl-ba": "เซอร์เบีย (ซิริลลิก, บอสเนียและเฮอร์เซโกวีนา)",
+ "Language_sr-Latn": "เซอร์เบีย (ละติน)",
+ "Language_sv": "สวีเดน",
+ "Language_sw": "กีสวาฮีลี",
+ "Language_syr-Syrc": "ภาษาซีเรีย",
+ "Language_ta": "ทมิฬ",
+ "Language_te": "เตลุคู",
+ "Language_tg-Cyrl": "ทาจิก (ซิริลลิก)",
+ "Language_th": "ไทย",
+ "Language_ti": "ติกรินยา",
+ "Language_tk-Latn": "เติร์ก (ละติน)",
+ "Language_tn": "เซซวานา",
+ "Language_tr": "ตุรกี",
+ "Language_tt": "ตาตาร์",
+ "Language_tt-Cyrl": "ตาตาร์ (ซิริลลิก)",
+ "Language_tzm-Latn": "ทามาไซท์ (ละติน)",
+ "Language_ug": "อยูเหอ",
+ "Language_ug-Arab": "อยูเหอ",
+ "Language_uk": "ยูเครน",
+ "Language_ur": "อูรดู",
+ "Language_uz-Cyrl": "อุซเบก (ซิริลลิก)",
+ "Language_uz-Latn": "อุซเบก (ละติน)",
+ "Language_vi": "เวียดนาม",
+ "Language_wo-Latn": "โวลอฟ",
+ "Language_xh": "อีซีโซซา",
+ "Language_yo": "โยรูบา",
+ "Language_yo-Latn": "โยรูบา",
+ "Language_zh-Hans": "จีน (ประยุกต์)",
+ "Language_zh-Hant": "จีน (ดั้งเดิม)",
+ "Language_zu": "อีซีซูลู",
+ "MarketInfoDisplayNameFormat": "{0} - {1}",
+ "Region_Display_AD": "อันดอร์รา",
+ "Region_Display_AE": "สหรัฐอาหรับเอมิเรตส์",
+ "Region_Display_AF": "อัฟกานิสถาน",
+ "Region_Display_AG": "แอนติกาและบาร์บูดา",
+ "Region_Display_AI": "แองกวิลลา",
+ "Region_Display_AL": "แอลเบเนีย",
+ "Region_Display_AM": "อาร์เมเนีย",
+ "Region_Display_AO": "แองโกลา",
+ "Region_Display_AR": "อาร์เจนตินา",
+ "Region_Display_AS": "อเมริกันซามัว",
+ "Region_Display_AT": "ออสเตรีย",
+ "Region_Display_AU": "ออสเตรเลีย",
+ "Region_Display_AW": "อารูบา",
+ "Region_Display_AZ": "อาเซอร์ไบจาน",
+ "Region_Display_BA": "บอสเนียและเฮอร์เซโกวีนา",
+ "Region_Display_BB": "บาร์เบโดส",
+ "Region_Display_BD": "บังกลาเทศ",
+ "Region_Display_BE": "เบลเยียม",
+ "Region_Display_BF": "บูร์กินาฟาโซ",
+ "Region_Display_BG": "บัลแกเรีย",
+ "Region_Display_BH": "บาห์เรน",
+ "Region_Display_BI": "บุรุนดี",
+ "Region_Display_BJ": "เบนิน",
+ "Region_Display_BM": "เบอร์มิวดา",
+ "Region_Display_BN": "บรูไน",
+ "Region_Display_BO": "โบลิเวีย",
+ "Region_Display_BQ": "โบแนร์",
+ "Region_Display_BR": "บราซิล",
+ "Region_Display_BS": "บาฮามาส",
+ "Region_Display_BT": "ภูฏาน",
+ "Region_Display_BW": "บอตสวานา",
+ "Region_Display_BY": "เบลารุส",
+ "Region_Display_BZ": "เบลีช",
+ "Region_Display_CA": "แคนาดา",
+ "Region_Display_CC": "หมู่เกาะโคคอส (คีลลิง)",
+ "Region_Display_CD": "คองโก (DRC)",
+ "Region_Display_CF": "สาธารณรัฐแอฟริกากลาง",
+ "Region_Display_CG": "คองโก",
+ "Region_Display_CH": "สวิตเซอร์แลนด์",
+ "Region_Display_CI": "Côte d'Ivoire",
+ "Region_Display_CK": "หมู่เกาะคุก",
+ "Region_Display_CL": "ชิลี",
+ "Region_Display_CM": "แคเมอรูน",
+ "Region_Display_CN": "จีน",
+ "Region_Display_CO": "โคลัมเบีย",
+ "Region_Display_CR": "คอสตาริกา",
+ "Region_Display_CS": "เซอร์เบียและมอนเตเนโกร (เดิม)",
+ "Region_Display_CV": "เคปเวิร์ด",
+ "Region_Display_CW": "คูราเซา",
+ "Region_Display_CX": "เกาะคริสต์มาส",
+ "Region_Display_CY": "ไซปรัส",
+ "Region_Display_CZ": "สาธารณรัฐเช็ก",
+ "Region_Display_DE": "เยอรมนี",
+ "Region_Display_DJ": "จิบูตี",
+ "Region_Display_DK": "เดนมาร์ก",
+ "Region_Display_DM": "โดมินิกา",
+ "Region_Display_DO": "สาธารณรัฐโดมินิกัน",
+ "Region_Display_DZ": "แอลจีเรีย",
+ "Region_Display_EC": "เอกวาดอร์",
+ "Region_Display_EE": "เอสโตเนีย",
+ "Region_Display_EG": "อียิปต์",
+ "Region_Display_ER": "เอริเทรีย",
+ "Region_Display_ES": "สเปน",
+ "Region_Display_ET": "เอธิโอเปีย",
+ "Region_Display_FI": "ฟินแลนด์",
+ "Region_Display_FK": "หมู่เกาะฟอล์กแลนด์ (หมู่เกาะมัลวินัส)",
+ "Region_Display_FM": "ไมโครนีเซีย",
+ "Region_Display_FO": "หมู่เกาะแฟโร",
+ "Region_Display_FR": "ฝรั่งเศส",
+ "Region_Display_GA": "กาบอง",
+ "Region_Display_GB": "สหราชอาณาจักร",
+ "Region_Display_GD": "เกรเนดา",
+ "Region_Display_GE": "จอร์เจีย",
+ "Region_Display_GF": "เฟรนช์กียานา",
+ "Region_Display_GG": "เกอร์นเซย์",
+ "Region_Display_GH": "กานา",
+ "Region_Display_GL": "กรีนแลนด์",
+ "Region_Display_GM": "แกมเบีย",
+ "Region_Display_GN": "กินี",
+ "Region_Display_GP": "กวาเดอลูป",
+ "Region_Display_GQ": "อิเควทอเรียลกินี",
+ "Region_Display_GR": "กรีซ",
+ "Region_Display_GT": "กัวเตมาลา",
+ "Region_Display_GU": "กวม",
+ "Region_Display_GW": "กินีบิสเซา",
+ "Region_Display_GY": "กายอานา",
+ "Region_Display_HK": "ฮ่องกง SAR",
+ "Region_Display_HN": "ฮอนดูรัส",
+ "Region_Display_HR": "โครเอเชีย",
+ "Region_Display_HT": "เฮติ",
+ "Region_Display_HU": "ฮังการี",
+ "Region_Display_ID": "อินโดนีเซีย",
+ "Region_Display_IE": "ไอร์แลนด์",
+ "Region_Display_IL": "อิสราเอล",
+ "Region_Display_IN": "อินเดีย",
+ "Region_Display_IQ": "อิรัก",
+ "Region_Display_IR": "อิหร่าน",
+ "Region_Display_IS": "ไอซ์แลนด์",
+ "Region_Display_IT": "อิตาลี",
+ "Region_Display_JE": "เจอร์ซี",
+ "Region_Display_JM": "จาเมกา",
+ "Region_Display_JO": "จอร์แดน",
+ "Region_Display_JP": "ญี่ปุ่น",
+ "Region_Display_KE": "เคนยา",
+ "Region_Display_KG": "คีร์กีซสถาน",
+ "Region_Display_KH": "กัมพูชา",
+ "Region_Display_KI": "คิริบาส",
+ "Region_Display_KM": "คอโมโรส",
+ "Region_Display_KN": "เซนต์คิตส์และเนวิส",
+ "Region_Display_KR": "เกาหลี",
+ "Region_Display_KW": "คูเวต",
+ "Region_Display_KY": "หมู่เกาะเคย์แมน",
+ "Region_Display_KZ": "คาซัคสถาน",
+ "Region_Display_LA": "ลาว",
+ "Region_Display_LB": "เลบานอน",
+ "Region_Display_LC": "เซนต์ลูเซีย",
+ "Region_Display_LI": "ลิกเตนสไตน์",
+ "Region_Display_LK": "ศรีลังกา",
+ "Region_Display_LR": "ไลบีเรีย",
+ "Region_Display_LS": "เลโซโท",
+ "Region_Display_LT": "ลิทัวเนีย",
+ "Region_Display_LU": "ลักเซมเบิร์ก",
+ "Region_Display_LV": "ลัตเวีย",
+ "Region_Display_LY": "ลิเบีย",
+ "Region_Display_MA": "โมร็อกโก",
+ "Region_Display_MC": "โมนาโก",
+ "Region_Display_MD": "มอลโดวา",
+ "Region_Display_ME": "มอนเตเนโกร",
+ "Region_Display_MF": "เซนต์มาร์ติน",
+ "Region_Display_MG": "มาดากัสการ์",
+ "Region_Display_MH": "หมู่เกาะมาร์แชลล์",
+ "Region_Display_MK": "สาธารณรัฐมาซิโดเนีย (ยูโกสลาเวียเดิม)",
+ "Region_Display_ML": "มาลี",
+ "Region_Display_MM": "พม่า",
+ "Region_Display_MN": "มองโกเลีย",
+ "Region_Display_MO": "มาเก๊า SAR",
+ "Region_Display_MP": "หมู่เกาะนอร์เทิร์นมาเรียนา",
+ "Region_Display_MQ": "มาร์ตินีก",
+ "Region_Display_MR": "มอริเตเนีย",
+ "Region_Display_MS": "มอนต์เซอร์รัต",
+ "Region_Display_MT": "มอลตา",
+ "Region_Display_MU": "มอริเชียส",
+ "Region_Display_MV": "มัลดีฟส์",
+ "Region_Display_MW": "มาลาวี",
+ "Region_Display_MX": "เม็กซิโก",
+ "Region_Display_MY": "มาเลเซีย",
+ "Region_Display_MZ": "โมซัมบิก",
+ "Region_Display_NA": "นามิเบีย",
+ "Region_Display_NC": "นิวแคลิโดเนีย",
+ "Region_Display_NE": "ไนเจอร์",
+ "Region_Display_NF": "เกาะนอร์ฟอล์ก",
+ "Region_Display_NG": "ไนจีเรีย",
+ "Region_Display_NI": "นิการากัว",
+ "Region_Display_NL": "เนเธอร์แลนด์",
+ "Region_Display_NO": "นอร์เวย์",
+ "Region_Display_NP": "เนปาล",
+ "Region_Display_NR": "นาอูรู",
+ "Region_Display_NU": "นีอูเอ",
+ "Region_Display_NZ": "นิวซีแลนด์",
+ "Region_Display_OM": "โอมาน",
+ "Region_Display_PA": "ปานามา",
+ "Region_Display_PE": "เปรู",
+ "Region_Display_PF": "เฟรนช์โปลินีเซีย",
+ "Region_Display_PG": "ปาปัวนิวกีนี",
+ "Region_Display_PH": "ฟิลิปปินส์",
+ "Region_Display_PK": "ปากีสถาน",
+ "Region_Display_PL": "โปแลนด์",
+ "Region_Display_PM": "แซงปีแยร์และมีเกอลง",
+ "Region_Display_PN": "หมู่เกาะพิตแคร์น",
+ "Region_Display_PR": "เปอร์โตริโก",
+ "Region_Display_PT": "โปรตุเกส",
+ "Region_Display_PW": "ปาเลา",
+ "Region_Display_PY": "ปารากวัย",
+ "Region_Display_QA": "กาตาร์",
+ "Region_Display_RE": "เรอูเนียง",
+ "Region_Display_RO": "โรมาเนีย",
+ "Region_Display_RS": "เซอร์เบีย",
+ "Region_Display_RU": "รัสเซีย",
+ "Region_Display_RW": "รวันดา",
+ "Region_Display_SA": "ซาอุดิอาราเบีย",
+ "Region_Display_SB": "หมู่เกาะโซโลมอน",
+ "Region_Display_SC": "เซเชลส์",
+ "Region_Display_SD": "ซูดาน",
+ "Region_Display_SE": "สวีเดน",
+ "Region_Display_SG": "สิงคโปร์",
+ "Region_Display_SH": "เซนต์เฮเลนา แอสเซนชัน และทริสตันดาคูนา",
+ "Region_Display_SI": "สโลวีเนีย",
+ "Region_Display_SK": "สโลวัก",
+ "Region_Display_SL": "เซียร์ราลีโอน",
+ "Region_Display_SM": "ซานมาริโน",
+ "Region_Display_SN": "เซเนกัล",
+ "Region_Display_SO": "โซมาเลีย",
+ "Region_Display_SR": "ซูรินาเม",
+ "Region_Display_SS": "เซาท์ซูดาน",
+ "Region_Display_ST": "เซาโตเมและปรินซิเป",
+ "Region_Display_SV": "เอลซัลวาดอร์",
+ "Region_Display_SX": "ซินท์มาร์เทิน",
+ "Region_Display_SY": "ซีเรีย",
+ "Region_Display_SZ": "สวาซิแลนด์",
+ "Region_Display_TC": "หมู่เกาะเติกส์และเคคอส",
+ "Region_Display_TD": "ชาด",
+ "Region_Display_TG": "โตโก",
+ "Region_Display_TH": "ไทย",
+ "Region_Display_TJ": "ทาจิกิสถาน",
+ "Region_Display_TK": "โตเกเลา",
+ "Region_Display_TL": "ติมอร์-เลสเต",
+ "Region_Display_TM": "เติร์กเมนิสถาน",
+ "Region_Display_TN": "ตูนิเซีย",
+ "Region_Display_TR": "ตุรกี",
+ "Region_Display_TT": "ตรินิแดดและโตเบโก",
+ "Region_Display_TV": "ตูวาลู",
+ "Region_Display_TW": "ไต้หวัน",
+ "Region_Display_TZ": "แทนซาเนีย",
+ "Region_Display_UA": "ยูเครน",
+ "Region_Display_UG": "ยูกันดา",
+ "Region_Display_US": "สหรัฐ",
+ "Region_Display_UY": "อุรุกวัย",
+ "Region_Display_UZ": "อุซเบกิสถาน",
+ "Region_Display_VA": "สันตะสำนัก (นครวาติกัน)",
+ "Region_Display_VC": "เซนต์วินเซนต์และเกรนาดีนส์",
+ "Region_Display_VE": "เวเนซุเอลา",
+ "Region_Display_VG": "หมู่เกาะบริติชเวอร์จิน",
+ "Region_Display_VI": "หมู่เกาะเวอร์จิน, สหรัฐฯ",
+ "Region_Display_VN": "เวียดนาม",
+ "Region_Display_VU": "วานูอาตู",
+ "Region_Display_WF": "วาลลิสและฟุตูนา",
+ "Region_Display_WS": "ซามัว",
+ "Region_Display_XE": "ซินท์อุสตาทิอุส",
+ "Region_Display_XS": "ซาบา",
+ "Region_Display_YE": "เยเมน",
+ "Region_Display_YT": "มายอต",
+ "Region_Display_ZA": "แอฟริกาใต้",
+ "Region_Display_ZM": "แซมเบีย",
+ "Region_Display_ZW": "ซิมบับเว"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.bingweather/resources/und.json b/packages/microsoft.bingweather/resources/und.json
new file mode 100644
index 00000000..2fb0fe2b
--- /dev/null
+++ b/packages/microsoft.bingweather/resources/und.json
@@ -0,0 +1,9 @@
+{
+ "Files": {
+ "common": {
+ "images": {
+ "binglogo.png": "Common\\images\\und\\binglogo.png"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.windowscommunicationsapps.shim/src/Microsoft/WindowsLive/Platform/Account.ts b/packages/microsoft.windowscommunicationsapps.shim/src/Microsoft/WindowsLive/Platform/Account.ts
index 22f90b43..7ae5a7a9 100644
--- a/packages/microsoft.windowscommunicationsapps.shim/src/Microsoft/WindowsLive/Platform/Account.ts
+++ b/packages/microsoft.windowscommunicationsapps.shim/src/Microsoft/WindowsLive/Platform/Account.ts
@@ -8,6 +8,7 @@ import { Enumerable, Uri } from "winrt-node/Windows.Foundation"
import { ShimProxyHandler } from "winrt-node/ShimProxyHandler"
import { AccountServerConnectionSettings } from "./AccountServerConnectionSettings"
import { Windows } from "winrt-node"
+import { Person } from "./Person"
export class Account extends PlatformObject {
constructor(id: string) {
@@ -61,6 +62,7 @@ export class Account extends PlatformObject {
public get meContact(): Contact {
let cont = new Contact(null);
cont.objectId = "sakodkaspd";
+ cont.person = new Person();
return cont;
}
diff --git a/packages/microsoft.zunemusic/AlbumDetailsPage_merged.js b/packages/microsoft.zunemusic/AlbumDetailsPage_merged.js
new file mode 100644
index 00000000..bb22d0e8
--- /dev/null
+++ b/packages/microsoft.zunemusic/AlbumDetailsPage_merged.js
@@ -0,0 +1,723 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/controls/music1/albumdetailsview.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var AlbumDetailsView = (function(_super) {
+ __extends(AlbumDetailsView, _super);
+ function AlbumDetailsView(element, options) {
+ _super.call(this, element, options);
+ MS.Entertainment.UI.Framework.processDeclarativeControlContainer(this)
+ }
+ AlbumDetailsView.prototype.onShowAllTracksInvoked = function(event) {
+ var viewModel = this.dataContext;
+ this.invokeActionForEvent(event, function() {
+ return viewModel && viewModel.clearFilter()
+ })
+ };
+ AlbumDetailsView.prototype.onBuyAlbumInvoked = function(event) {
+ var viewModel = this.dataContext;
+ this.invokeActionForEvent(event, function() {
+ return viewModel && viewModel.invokePurchaseAlbum()
+ })
+ };
+ AlbumDetailsView.prototype.onNavigateAlbumInvoked = function(event) {
+ var viewModel = this.dataContext;
+ this.invokeActionForEvent(event, function() {
+ return viewModel && viewModel.invokeCatalogAlbum()
+ })
+ };
+ return AlbumDetailsView
+ })(Controls.PageViewBase);
+ Controls.AlbumDetailsView = AlbumDetailsView
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.AlbumDetailsView)
+})();
+/* >>>>>>/viewmodels/music/albumdetailsviewmodelbase.js:56 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ (function(AlbumDetailsViewModelModuleKeys) {
+ AlbumDetailsViewModelModuleKeys[AlbumDetailsViewModelModuleKeys["songsModule"] = 0] = "songsModule";
+ AlbumDetailsViewModelModuleKeys[AlbumDetailsViewModelModuleKeys["musicVideosModule"] = 1] = "musicVideosModule";
+ AlbumDetailsViewModelModuleKeys[AlbumDetailsViewModelModuleKeys["count"] = 2] = "count"
+ })(ViewModels.AlbumDetailsViewModelModuleKeys || (ViewModels.AlbumDetailsViewModelModuleKeys = {}));
+ var AlbumDetailsViewModelModuleKeys = ViewModels.AlbumDetailsViewModelModuleKeys;
+ var AlbumDetailsViewModelBase = (function(_super) {
+ __extends(AlbumDetailsViewModelBase, _super);
+ function AlbumDetailsViewModelBase(album, filter, queryAlbumId, queryTrack) {
+ _super.call(this);
+ this._hasCatalogVersion = false;
+ this._hasNavigatedToCatalogVersion = false;
+ this._initialInvokedTrack = null;
+ this._shouldHydrateAlbumReview = false;
+ this.applyGlobalNotifications = true;
+ this._ensureAlbum(album, filter, queryAlbumId, queryTrack)
+ }
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "album", {
+ get: function() {
+ return this.mediaItem
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "hasCatalogVersion", {
+ get: function() {
+ return this._hasCatalogVersion
+ }, set: function(value) {
+ if (value !== this._hasCatalogVersion) {
+ this._updatePurchaseDetails();
+ this.updateAndNotify("hasCatalogVersion", value)
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "hasLocalTracks", {
+ get: function() {
+ return this.album && this.album.localTracksCount > 0
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "purchaseDetails", {
+ get: function() {
+ return this._purchaseDetails
+ }, set: function(value) {
+ this.updateAndNotify("purchaseDetails", value);
+ this._purchaseDetails = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "songsModule", {
+ get: function() {
+ return this.modules && this.modules[0]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "musicVideosModule", {
+ get: function() {
+ return this.modules && this.modules[1]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "viewStateViewModel", {
+ get: function() {
+ if (!this._viewStateViewModel)
+ this._viewStateViewModel = this.createViewStateModel();
+ return this._viewStateViewModel
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AlbumDetailsViewModelBase.prototype, "_musicRights", {
+ get: function() {
+ return this._albumRights
+ }, enumerable: true, configurable: true
+ });
+ AlbumDetailsViewModelBase.prototype.createViewStateModel = function() {
+ var viewStateItems = new Array;
+ viewStateItems[-2] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_OFFLINE_HEADER), String.load(String.id.IDS_MUSIC_OFFLINE_DETAILS), []);
+ viewStateItems[-1] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_ERROR_HEADER), String.load(String.id.IDS_MUSIC_ERROR_DETAILS), []);
+ return new ViewModels.ViewStateViewModel(viewStateItems)
+ };
+ AlbumDetailsViewModelBase.prototype.dispose = function() {
+ this._releaseModuleBindings();
+ if (this.songsModule)
+ this.songsModule.dispose();
+ if (this.musicVideosModule)
+ this.musicVideosModule.dispose();
+ _super.prototype.dispose.call(this)
+ };
+ AlbumDetailsViewModelBase.prototype.delayInitialize = function() {
+ _super.prototype.delayInitialize.call(this);
+ this._updatePurchaseDetails()
+ };
+ AlbumDetailsViewModelBase.prototype.invokeCatalogAlbum = function() {
+ this._navigateToMarketplaceAlbum()
+ };
+ AlbumDetailsViewModelBase.prototype.invokePurchaseAlbum = function() {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var purchaseAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.albumPurchase);
+ purchaseAction.automationId = Entertainment.UI.AutomationIds.albumPurchase;
+ purchaseAction.parameter = this.album;
+ purchaseAction.execute()
+ };
+ AlbumDetailsViewModelBase.prototype.isShowing = function(mediaItemId) {
+ var isShowing = false;
+ if (this.album)
+ if (Entertainment.Utilities.isValidLibraryId(mediaItemId))
+ isShowing = this.album.libraryId === mediaItemId;
+ else
+ isShowing = this.album.serviceId === mediaItemId;
+ return isShowing
+ };
+ AlbumDetailsViewModelBase.prototype.loadModules = function() {
+ if (!this.isOnline && !this.inCollection) {
+ this.viewStateViewModel.viewState = -2;
+ return
+ }
+ var isLocalAlbum = this.inCollection;
+ var isCatalogAlbum = this.hasServiceId;
+ if (!isLocalAlbum && !isCatalogAlbum) {
+ this.viewStateViewModel.viewState = -1;
+ ViewModels.fail("AlbumDetailsViewModelBase::loadModules. Album does not have an id.");
+ return
+ }
+ this.viewStateViewModel.viewState = 1;
+ if (isLocalAlbum)
+ this.viewStateViewModel.suppressLoadingSpinner = true;
+ this._cancelMediaItemHydration();
+ this._mediaItemHydratePromise = this.album.hydrate({
+ listenForDBUpdates: this.inCollection, skipTracks: true
+ });
+ this._createSmartBuyStateEngine();
+ this._hydrateAlbum();
+ if (!this._delayInitializeSmartBuyEngine)
+ this._initializeSmartBuyStateEngine(false)
+ };
+ AlbumDetailsViewModelBase.prototype.navigatedBackTo = function() {
+ if (this.inCollection && this._hasNavigatedToCatalogVersion) {
+ var navigation = Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ navigation.navigateToMoniker("mymusic", true, true);
+ this._hasNavigatedToCatalogVersion = false
+ }
+ if (this.songsModule)
+ this.songsModule.refreshItems()
+ };
+ AlbumDetailsViewModelBase.prototype._initializeModules = function() {
+ var _this = this;
+ this._releaseModuleBindings();
+ var songsView = this.inCollection ? 2 : 3;
+ this.modules = new Array(2);
+ this.modules[0] = new ViewModels.SongsModule(songsView, {defaultTrack: this._initialInvokedTrack});
+ this.listenForModuleViewStateChanges();
+ this._songsModuleViewStateBinding = Entertainment.UI.Framework.addEventHandlers(this.songsModule, {
+ moduleStateChanged: this._onSongsModuleViewStateChanged.bind(this), editMetadata: this._onEditMetadata.bind(this), findAlbumInfo: this._onEditMetadata.bind(this), purchaseTrackCompleted: this._updatePurchaseDetails.bind(this)
+ });
+ this.songsModule.onTrackAddedOrRemoved = function(newCount) {
+ if (newCount === 0)
+ _this._navigateBack();
+ else {
+ _this._updateFilterDetails();
+ _this._updateCatalogDetails()
+ }
+ };
+ this._songsModuleItemsBinding = WinJS.Binding.bind(this.songsModule, {itemsChanged: function() {
+ return _this._updateTrackBinding()
+ }});
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicVideosEnabled)) {
+ var musicVideosView = this.inCollection ? 9 : 8;
+ this.modules[1] = new ViewModels.MusicVideosModule(musicVideosView);
+ this.musicVideosModule.isExcludedFromPageState = true;
+ this.musicVideosModule.lockModuleState();
+ this._musicVideosModuleItemsBinding = WinJS.Binding.bind(this.musicVideosModule, {itemsChanged: function() {
+ return _this._updateMusicVideosBinding()
+ }})
+ }
+ };
+ AlbumDetailsViewModelBase.prototype._onNetworkStatusChanged = function() {
+ this._updateCatalogDetails();
+ this._updatePurchaseDetails();
+ _super.prototype._onNetworkStatusChanged.call(this)
+ };
+ AlbumDetailsViewModelBase.prototype._getContainingMediaContextOptions = function() {
+ return {
+ playbackItemSource: this.mediaItem, playbackOffset: 0, dontUseTrackListForPlayback: true
+ }
+ };
+ AlbumDetailsViewModelBase.prototype._getSmartBuyEngineAppBarHandlers = function() {
+ return {
+ deleteMedia: this._onMediaItemDeletion.bind(this), subscriptionAddToMyMusic: this._refreshHeaderAndItems.bind(this), addToMyMusic: this._refreshHeaderAndItems.bind(this), addToPlaylist: this._refreshHeaderAndItems.bind(this), editMetadata: this._onEditMetadata.bind(this), findAlbumInfo: this._onEditMetadata.bind(this), purchase: this._refreshHeaderAndItems.bind(this)
+ }
+ };
+ AlbumDetailsViewModelBase.prototype._getSmartBuyEngineEventHandler = function() {
+ return this._onAlbumDetailsStateChanged.bind(this)
+ };
+ AlbumDetailsViewModelBase.prototype._getSmartBuyEngineButtons = function() {
+ ViewModels.fail("AlbumDetailsViewModelBase::_getSmartBuyEngineButtons. No buttons specified for the Smart Buy Engine.")
+ };
+ AlbumDetailsViewModelBase.prototype._getTracksForSmartBuyEngine = function() {
+ return this.songsModule.items
+ };
+ AlbumDetailsViewModelBase.prototype._initializeLocalNotifications = function() {
+ var notifications = [];
+ var signInService = Entertainment.ServiceLocator.getService(Entertainment.Services.signIn);
+ var userHasExplicitPrivilege = signInService.isSignedIn && signInService.hasExplicitPrivilege;
+ if (this.album && this.album.isExplicit && !userHasExplicitPrivilege && this._appState && this._appState.isExplicitBlocked) {
+ var explicitNotification = new Entertainment.UI.Notification;
+ explicitNotification.category = Entertainment.UI.NotificationCategoryEnum.explicitPrivileges;
+ explicitNotification.icon = explicitNotification.category.icon;
+ explicitNotification.subTitle = String.empty;
+ explicitNotification.dismissIcon = String.empty;
+ explicitNotification.actions = [Entertainment.UI.Actions.ActionIdentifiers.externalNavigate];
+ explicitNotification.actionParamsArray = [{
+ parameter: {
+ link: Entertainment.Endpoint.load(Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/Account/Settings", automationId: Entertainment.UI.AutomationIds.settingsAccountPrivacy
+ }, title: String.load(String.id.IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_BODY)
+ }];
+ if (this._albumRights.allTracksExplicit) {
+ explicitNotification.title = String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE);
+ explicitNotification.automationId = Entertainment.UI.AutomationIds.explicitAlbumNotification
+ }
+ else {
+ explicitNotification.title = String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_PARTIAL_BANNER_NOTIFICATION_TITLE);
+ explicitNotification.automationId = Entertainment.UI.AutomationIds.explicitAlbumMixedNotification
+ }
+ notifications.push(explicitNotification)
+ }
+ return WinJS.Promise.as(notifications)
+ };
+ AlbumDetailsViewModelBase.prototype._refreshDetailString = function() {
+ if (!this.album)
+ return;
+ var metadataLines = [];
+ if (this.album.artistName)
+ metadataLines.push(this.album.artistName);
+ if (this.album.releaseDate) {
+ var formattedYear = Entertainment.ServiceLocator.getService(Entertainment.Services.dateTimeFormatters).year;
+ metadataLines.push(formattedYear.format(this.album.releaseDate))
+ }
+ if (this.album.primaryGenreName)
+ metadataLines.push(this.album.primaryGenreName);
+ else if (this.album.genreName)
+ metadataLines.push(this.album.genreName);
+ if (this.album.label)
+ metadataLines.push(this.album.label);
+ this.mediaItemDetails = metadataLines.join(String.load(String.id.IDS_DETAILS_METADATA_SEPERATOR))
+ };
+ AlbumDetailsViewModelBase.prototype._reloadFilteredModules = function() {
+ if (this.songsModule)
+ this.songsModule.load()
+ };
+ AlbumDetailsViewModelBase.prototype._updateCatalogDetails = function() {
+ var _this = this;
+ if (this.inCollection && this.hasServiceId && this.isOnline) {
+ var marketplaceTrackCount = 0;
+ var libraryTrackCount = 0;
+ var albumSongsQuery = new Entertainment.Data.Query.Music.AlbumWithTracks;
+ albumSongsQuery.id = this.album.serviceId;
+ albumSongsQuery.idType = this.album.serviceIdType;
+ albumSongsQuery.execute().done(function(queryResult) {
+ albumSongsQuery.dispose();
+ marketplaceTrackCount = WinJS.Utilities.getMember("result.item.tracks.count", queryResult);
+ libraryTrackCount = _this.songsModule && _this.songsModule.count;
+ _this.hasCatalogVersion = marketplaceTrackCount > libraryTrackCount
+ }, function(error) {
+ albumSongsQuery.dispose();
+ _this.hasCatalogVersion = false
+ })
+ }
+ else
+ this.hasCatalogVersion = false
+ };
+ AlbumDetailsViewModelBase.prototype._updateFilterDetails = function() {
+ var _this = this;
+ if (!this.album || !this.inCollection || !this.songsModule || this.collectionFilter === Microsoft.Entertainment.Platform.MediaAvailability.available) {
+ this.updateAndNotify("filterDetails", String.empty);
+ return
+ }
+ var unfilteredQuery = new Entertainment.Data.Query.libraryTracks;
+ unfilteredQuery.albumId = this.album.libraryId;
+ unfilteredQuery.executeCount().done(function(unfilteredTrackCount) {
+ unfilteredQuery.dispose();
+ var currentTrackCount = _this.songsModule && _this.songsModule.count;
+ if (unfilteredTrackCount > currentTrackCount) {
+ var filter;
+ switch (_this.collectionFilter) {
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableOffline:
+ filter = String.load(String.id.IDS_DETAILS_FILTER_AVAILABLE_OFFLINE);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloud:
+ filter = String.load(String.id.IDS_DETAILS_FILTER_IN_CLOUD);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloudOnly:
+ filter = String.load(String.id.IDS_DETAILS_FILTER_STREAMING);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.musicPass:
+ filter = String.load(String.id.IDS_DETAILS_FILTER_FROM_XBOX_MUSIC);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.oneDrive:
+ filter = String.load(String.id.IDS_DETAILS_FILTER_ON_ONEDRIVE);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.thisDeviceOnly:
+ filter = String.load(String.id.IDS_DETAILS_FILTER_ON_PC);
+ break;
+ default:
+ filter = String.empty;
+ break
+ }
+ _this.updateAndNotify("filterDetails", filter)
+ }
+ }, function(error) {
+ unfilteredQuery.dispose();
+ Entertainment.UI.assert(!error || WinJS.Promise.isCanceledError(error), "AlbumDetailsViewModelBaseBase::_updateFilterDetails. Failed to executeCount. Error message: " + (error && error.message), String.empty, Entertainment.UI.Debug.errorLevel.low)
+ })
+ };
+ AlbumDetailsViewModelBase.prototype._updatePurchaseDetails = function() {
+ var _this = this;
+ if (!this.hasServiceId || !this.isOnline || !this.isDelayInitialized) {
+ this.purchaseDetails = String.empty;
+ return
+ }
+ ViewModels.SmartBuyStateEngine.getMarketplaceFileAccessAsync(this.album).done(function(albumProperties) {
+ var mediaIds = albumProperties.mediaIds;
+ var tracksAvailable = albumProperties.mediaIds ? albumProperties.mediaIds.length : 0;
+ var tracksPurchased = albumProperties.hasPurchased ? albumProperties.hasPurchased : 0;
+ if (tracksPurchased < tracksAvailable) {
+ var matchingRights = ViewModels.SmartBuyStateHandlers.getMatchingRights(_this.album, Entertainment.Utilities.defaultClientTypeFromApp, [ViewModels.SmartBuyStateHandlers.MarketplaceRight.AlbumPurchase], {
+ freeOnly: false, excludeFree: false
+ });
+ if (matchingRights && matchingRights[0]) {
+ var offer = matchingRights[0];
+ if (offer && offer.displayPrice)
+ if (offer.price === 0)
+ _this.purchaseDetails = String.load(String.id.IDS_MUSIC_DTO_BUY_FREE_TEXT);
+ else
+ _this.purchaseDetails = String.load(String.id.IDS_MUSIC_DTO_BUY_ALBUM_TEXT).format(offer.displayPrice)
+ }
+ }
+ else
+ _this.purchaseDetails = String.empty
+ }, function(error) {
+ _this.purchaseDetails = String.empty
+ })
+ };
+ AlbumDetailsViewModelBase.prototype._ensureAlbum = function(album, filter, queryAlbumId, queryTrack) {
+ var _this = this;
+ if (!queryAlbumId && queryTrack && queryTrack.album)
+ queryAlbumId = queryTrack.album.inCollection ? queryTrack.album.libraryId : queryTrack.album.zuneId;
+ if (queryAlbumId && Entertainment.Utilities.isValidGuid(queryAlbumId)) {
+ if (queryTrack)
+ this._initialInvokedTrack = queryTrack;
+ var albumQuery = new Entertainment.Data.Query.Music.AlbumDetails;
+ albumQuery.id = queryAlbumId;
+ albumQuery.idType = Entertainment.Data.Query.edsIdType.zuneCatalog;
+ this.mediaItemPromise = albumQuery.execute().then(function(response) {
+ albumQuery.dispose();
+ if (response.result.item)
+ _this.mediaItem = response.result.item.clone();
+ else
+ ViewModels.fail("AlbumDetailsViewModelBase::_ensureAlbum. Failed to get an album media item using the service id " + queryAlbumId)
+ }, function(error) {
+ albumQuery.dispose();
+ ViewModels.fail("AlbumDetailsViewModelBase::_ensureAlbum. Failed to get an album media item. Error message: " + (error && error.message))
+ })
+ }
+ else if (queryAlbumId && Entertainment.Utilities.isValidLibraryId(queryAlbumId)) {
+ if (queryTrack)
+ this._initialInvokedTrack = queryTrack;
+ var localAlbumQuery = new Entertainment.Data.Query.libraryAlbums;
+ localAlbumQuery.albumId = queryAlbumId;
+ localAlbumQuery.chunkSize = 1;
+ localAlbumQuery.chunked = false;
+ this.mediaItemPromise = localAlbumQuery.execute().then(function(response) {
+ localAlbumQuery.dispose();
+ if (response.result.primaryAlbum)
+ _this.mediaItem = response.result.primaryAlbum;
+ else
+ ViewModels.fail("AlbumDetailsViewModelBase::_ensureAlbum. Failed to get an album media item using the library id " + queryAlbumId)
+ }, function(error) {
+ localAlbumQuery.dispose();
+ ViewModels.fail("AlbumDetailsViewModelBase::_ensureAlbum. Failed to get an album media item. Error message: " + (error && error.message))
+ })
+ }
+ else if (queryTrack)
+ this.mediaItemPromise = queryTrack.hydrate({forceUpdate: true}).then(function(hydratedTrack) {
+ if (!hydratedTrack)
+ ViewModels.fail("AlbumDetailsViewModelBase::_ensureAlbum. Hydration of track failed.");
+ else {
+ _this._initialInvokedTrack = hydratedTrack;
+ var album = hydratedTrack.album;
+ if (album) {
+ _this.mediaItem = album.clone();
+ if (hydratedTrack.inCollection)
+ _this.album.libraryId = album.libraryId
+ }
+ else
+ ViewModels.fail("AlbumDetailsViewModelBase::_ensureAlbum. Album not found on hydrated track.")
+ }
+ }, function(error) {
+ ViewModels.fail("AlbumDetailsViewModelBase::_ensureAlbum. Failed to get an album media item from track. Error message: " + (error && error.message))
+ });
+ else {
+ ViewModels.assert(album, "AlbumDetailsViewModelBase::_ensureAlbum. An album media item is required.");
+ this.mediaItem = album.clone()
+ }
+ this.mediaItemPromise = this.mediaItemPromise.then(function() {
+ _this._initializeModules();
+ _this.collectionFilter = filter;
+ _this._updatePurchaseDetails()
+ })
+ };
+ AlbumDetailsViewModelBase.prototype._hydrateAlbum = function() {
+ var _this = this;
+ var albumPromise;
+ var isLocalAlbum = this.inCollection;
+ if (isLocalAlbum || (this.album.hasCanonicalId && this.album.hydrated))
+ albumPromise = WinJS.Promise.as(this.album);
+ else
+ albumPromise = this._mediaItemHydratePromise;
+ albumPromise.then(function(hydratedAlbum) {
+ if (!hydratedAlbum || hydratedAlbum.isFailed)
+ return WinJS.Promise.wrapError(new Error("AlbumDetailsViewModelBase::_hydrateAlbum. Hydration failed."));
+ _this.mediaItem = hydratedAlbum;
+ if (isLocalAlbum)
+ _this.songsModule.parentMediaId = _this.album.libraryId;
+ else if (_this.album.hasCanonicalId) {
+ _this.songsModule.parentMediaId = _this.album.canonicalId;
+ _this.songsModule.parentMediaServiceIdType = Entertainment.Data.Query.edsIdType.canonical
+ }
+ else
+ return WinJS.Promise.wrapError(new Error("AlbumDetailsViewModelBase::_hydrateAlbum. Album does not have a library or canonical id."));
+ _this.songsModule.load();
+ if (_this.musicVideosModule) {
+ _this.musicVideosModule.parentMediaItem = hydratedAlbum;
+ _this.musicVideosModule.load()
+ }
+ }, function(error) {
+ return WinJS.Promise.wrapError(new Error("AlbumDetailsViewModelBase::_hydrateAlbum. Album hydrate query failed with the following error: " + (error && error.message)))
+ }).then(function() {
+ if (_this._shouldHydrateAlbumReview)
+ return _this._hydrateAlbumReview()
+ }).done(null, function(error) {
+ _this.viewStateViewModel.viewState = -1;
+ ViewModels.fail("AlbumDetailsViewModelBase::_hydrateAlbum. Unexpected error: " + (error && error.message))
+ })
+ };
+ AlbumDetailsViewModelBase.prototype._hydrateAlbumReview = function() {
+ var _this = this;
+ var returnPromise;
+ if (!this.album.criticReview) {
+ var reviewQuery = new MS.Entertainment.Data.Query.Music.AlbumReview;
+ reviewQuery.id = this.mediaItem.serviceId;
+ reviewQuery.impressionGuid = this.mediaItem.impressionGuid;
+ reviewQuery.idType = this.mediaItem.serviceIdType;
+ returnPromise = reviewQuery.execute().then(function(q) {
+ reviewQuery.dispose();
+ if (q.result.item) {
+ _this.album.criticReview = q.result.item.criticReview;
+ _this.album.criticReviewNoTags = q.result.item.criticReviewNoTags
+ }
+ }, function(error) {
+ reviewQuery.dispose();
+ return error
+ })
+ }
+ return WinJS.Promise.as(returnPromise)
+ };
+ AlbumDetailsViewModelBase.prototype._navigateBack = function() {
+ var navigationService;
+ if (Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.navigation))
+ navigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.navigation);
+ else if (Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.winJSNavigation))
+ navigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ Entertainment.UI.assert(navigationService, "No navigation service registered.");
+ if (navigationService) {
+ this._disposeSmartBuyStateEngine();
+ this.songsModule.onTrackAddedOrRemoved = null;
+ navigationService.navigateBack()
+ }
+ };
+ AlbumDetailsViewModelBase.prototype._navigateToMarketplaceAlbum = function() {
+ if (!this.hasServiceId)
+ return;
+ var navigation = Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ navigation.navigateToMoniker("explore", true, true);
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var albumDetailsNavigateAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate);
+ albumDetailsNavigateAction.parameter = {
+ data: this.album.serviceId, forceNavigation: true, location: Entertainment.Data.ItemLocation.marketplace
+ };
+ albumDetailsNavigateAction.execute();
+ this._hasNavigatedToCatalogVersion = true
+ };
+ AlbumDetailsViewModelBase.prototype._onAlbumDetailsStateChanged = function(engine, stateInfo) {
+ var _this = this;
+ this._appState = ViewModels._MusicState.getCurrentState(engine.media, stateInfo);
+ var playabilityCounts = WinJS.Utilities.getMember("collection.playability.counts", stateInfo);
+ this._updateTrackLocationValues(playabilityCounts);
+ ViewModels.MusicSmartBuyStateHandlers.getAlbumRights(engine.media).then(function(rights) {
+ _this._albumRights = rights
+ }, function(error) {
+ ViewModels.fail("AlbumDetailsViewModelBase::_onAlbumDetailsStateChanged. Failed to get album rights. Error:" + error && error.message)
+ }).done(function() {
+ _this._reinitializeNotificationList()
+ }, function(error) {
+ ViewModels.fail("AlbumDetailsViewModelBase::_onAlbumDetailsStateChanged. Failed to get album rights. Error:" + error && error.message)
+ });
+ var musicStateHandler = Entertainment.ServiceLocator.getService(Entertainment.Services.musicStateHandler);
+ return musicStateHandler.onAlbumDetailsStateChanged(engine, stateInfo)
+ };
+ AlbumDetailsViewModelBase.prototype._onEditMetadata = function() {
+ var _this = this;
+ if (this.album && this.album.fromCollection) {
+ var query = new Entertainment.Data.Query.Music.LibraryAlbum;
+ query.albumId = this.album.libraryId;
+ query.execute().then(function() {
+ if (query.result) {
+ _this.mediaItem = query.result.item;
+ _this.loadModules()
+ }
+ }, function(error) {
+ ViewModels.fail("AlbumDetailsViewModelBase::_onEditMetadata. Updating album metadata after edit failed. error: " + (error && error.message))
+ }).done(function() {
+ query.dispose()
+ })
+ }
+ };
+ AlbumDetailsViewModelBase.prototype._onMediaItemDeletion = function(deletionEvent) {
+ if (deletionEvent.detail && deletionEvent.detail.deleted && deletionEvent.detail.removedItem && deletionEvent.detail.removedItem.isEqual(this.album))
+ this._navigateBack()
+ };
+ AlbumDetailsViewModelBase.prototype._onSongsModuleViewStateChanged = function(event) {
+ var viewState = event.detail.newValue;
+ if (viewState === 2 && this._delayInitialized)
+ this._initializeSmartBuyStateEngine(false);
+ else if (!this._delayInitializeSmartBuyEngine)
+ this._applyPropertiesToHydratedMedia();
+ if (Entertainment.Utilities.ViewState.isStateCompleted(this.songsModule.moduleState) && this.musicVideosModule)
+ this.musicVideosModule.unLockModuleState()
+ };
+ AlbumDetailsViewModelBase.prototype._refreshHeaderAndItems = function(appBarActionId) {
+ if (this.songsModule)
+ this.songsModule.refreshItems();
+ if (appBarActionId && appBarActionId.type === Entertainment.UI.Actions.ActionIdentifiers.purchase)
+ this.purchaseDetails = String.empty
+ };
+ AlbumDetailsViewModelBase.prototype._releaseModuleBindings = function() {
+ if (this._songsModuleItemsBinding) {
+ this._songsModuleItemsBinding.cancel();
+ this._songsModuleItemsBinding = null
+ }
+ if (this._songsModuleViewStateBinding) {
+ this._songsModuleViewStateBinding.cancel();
+ this._songsModuleViewStateBinding = null
+ }
+ if (this._musicVideosModuleItemsBinding) {
+ this._musicVideosModuleItemsBinding.cancel();
+ this._musicVideosModuleItemsBinding = null
+ }
+ };
+ AlbumDetailsViewModelBase.prototype._updateTrackBinding = function() {
+ this.dispatchChangeAndNotify("songsModule", this.songsModule, this.songsModule)
+ };
+ AlbumDetailsViewModelBase.prototype._updateMusicVideosBinding = function() {
+ this.dispatchChangeAndNotify("musicVideosModule", this.musicVideosModule, this.musicVideosModule)
+ };
+ return AlbumDetailsViewModelBase
+ })(ViewModels.MusicDetailsPageViewModelBase);
+ ViewModels.AlbumDetailsViewModelBase = AlbumDetailsViewModelBase;
+ var AlbumDetailsViewModelBaseFactory = (function() {
+ function AlbumDetailsViewModelBaseFactory(){}
+ AlbumDetailsViewModelBaseFactory.create = function(options) {
+ var mediaItem = options.mediaItem;
+ var queryAlbumId;
+ var queryTrack;
+ if (options.isTrack)
+ queryTrack = mediaItem;
+ else if (Entertainment.Utilities.isValidGuid(mediaItem) || Entertainment.Utilities.isValidLibraryId(mediaItem))
+ queryAlbumId = mediaItem;
+ return new ViewModels.AlbumDetailsViewModel(mediaItem, options.filter, queryAlbumId, queryTrack)
+ };
+ return AlbumDetailsViewModelBaseFactory
+ })();
+ ViewModels.AlbumDetailsViewModelBaseFactory = AlbumDetailsViewModelBaseFactory
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/albumdetailsviewmodel.js:655 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var AlbumDetailsViewModel = (function(_super) {
+ __extends(AlbumDetailsViewModel, _super);
+ function AlbumDetailsViewModel() {
+ _super.apply(this, arguments)
+ }
+ AlbumDetailsViewModel.prototype.delayInitialize = function() {
+ this._mediaRightsConditions = new ViewModels.AlbumRestrictionCollection;
+ _super.prototype.delayInitialize.call(this)
+ };
+ AlbumDetailsViewModel.prototype._initializeLocalNotifications = function() {
+ var _this = this;
+ var album = this.mediaItem;
+ return _super.prototype._initializeLocalNotifications.call(this).then(function(notifications) {
+ if (!_this.isOnline && album && album.inCollection && _this.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.availableOffline && !_this._allTracksLocal) {
+ var offlineNotification;
+ if (_this._allTracksStreaming) {
+ offlineNotification = Entertainment.UI.ListNotification.createNotification(Entertainment.UI.NotificationCategoryEnum.networkStatus, String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE), String.load(String.id.IDS_MUSIC_DETAILS_OFFLINE_BANNER_NOTIFICATION_BODY));
+ offlineNotification.automationId = Entertainment.UI.AutomationIds.offlineFullyStreamingAlbumNotification;
+ notifications.push(offlineNotification)
+ }
+ else if (_this._someTracksStreamingSomeLocal) {
+ offlineNotification = Entertainment.UI.ListNotification.createNotification(Entertainment.UI.NotificationCategoryEnum.networkStatus, String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE), String.empty, [Entertainment.UI.Actions.ActionIdentifiers.notificationDetailsNetworkStatus], [{title: String.load(String.id.IDS_MUSIC_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_BODY)}]);
+ offlineNotification.automationId = Entertainment.UI.AutomationIds.offlinePartiallyStreamingAlbumNotification;
+ notifications.push(offlineNotification)
+ }
+ }
+ var bestCondition;
+ var bestConditionNotification = new Entertainment.UI.Notification;
+ if (_this._mediaRightsConditions)
+ bestCondition = _this._mediaRightsConditions.getLeastRestrictive(_this.mediaItem, _this._musicRights);
+ if (bestCondition && bestCondition.title) {
+ bestConditionNotification = Entertainment.UI.ListNotification.createNotification(Entertainment.UI.NotificationCategoryEnum.playbackPrivileges, bestCondition.title, bestCondition.description, Entertainment.UI.AutomationIds.offlinePartiallyStreamingAlbumNotification);
+ bestConditionNotification.icon = bestCondition.actionIcon;
+ bestConditionNotification.actions = [bestCondition.actionId];
+ bestConditionNotification.actionParamsArray = [bestCondition.getActionOptions(_this.mediaItem)];
+ notifications.push(bestConditionNotification)
+ }
+ return notifications
+ })
+ };
+ AlbumDetailsViewModel.prototype._getSmartBuyEngineButtons = function() {
+ return ViewModels.SmartBuyButtons.getAlbumDetailsButtonsLX(this.album, Entertainment.UI.Actions.ExecutionLocation.canvas, this._genericPlayButton)
+ };
+ return AlbumDetailsViewModel
+ })(ViewModels.AlbumDetailsViewModelBase);
+ ViewModels.AlbumDetailsViewModel = AlbumDetailsViewModel
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
diff --git a/packages/microsoft.zunemusic/AppxBlockMap.xml b/packages/microsoft.zunemusic/AppxBlockMap.xml
new file mode 100644
index 00000000..bd7b80ef
--- /dev/null
+++ b/packages/microsoft.zunemusic/AppxBlockMap.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/AppxManifest.xml b/packages/microsoft.zunemusic/AppxManifest.xml
new file mode 100644
index 00000000..a96703a8
--- /dev/null
+++ b/packages/microsoft.zunemusic/AppxManifest.xml
@@ -0,0 +1,291 @@
+
+
+
+
+
+
+
+
+ false
+ ms-resource:IDS_MANIFEST_MUSIC_APP_NAME
+ Microsoft Corporation
+ ms-resource:IDS_MANIFEST_MUSIC_APP_DESCRIPTION
+ images\Tiles\XBL_MUSIC_50x50_A.png
+
+
+
+
+ 6.3.0
+ 6.3.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Images\Tiles\MusicIcon.png
+
+ .aac
+ .adt
+ .adts
+ .m4a
+ .mp3
+ .mpa
+ .wav
+ .wma
+ .zpl
+ .wpl
+ .m3u
+ .flac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EntPlat.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EntCommon.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft.Entertainment.Instrumentation.Providers.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft.PerfTrack.dll
+
+
+
+
+
+
+ entplat.dll
+
+
+
+
+
+
+ Microsoft.Media.AdaptiveStreaming.dll
+
+
+
+
+
+
+
+
+ Microsoft.Media.AdaptiveStreaming.dll
+
+
+
+
+
+
+
+
+
+ MicrosoftAdvertising.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/AppxMetadata/CodeIntegrity.cat b/packages/microsoft.zunemusic/AppxMetadata/CodeIntegrity.cat
new file mode 100644
index 00000000..973b53f3
Binary files /dev/null and b/packages/microsoft.zunemusic/AppxMetadata/CodeIntegrity.cat differ
diff --git a/packages/microsoft.zunemusic/ArtistDetailsPage_merged.js b/packages/microsoft.zunemusic/ArtistDetailsPage_merged.js
new file mode 100644
index 00000000..52184a70
--- /dev/null
+++ b/packages/microsoft.zunemusic/ArtistDetailsPage_merged.js
@@ -0,0 +1,632 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/controls/music1/artistdetailsview.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ var ArtistDetailsView = (function(_super) {
+ __extends(ArtistDetailsView, _super);
+ function ArtistDetailsView(element, options) {
+ var _this = this;
+ _super.call(this, element, options);
+ UI.Framework.processDeclarativeControlContainer(this).done(function() {
+ _this._eventHandlers = Entertainment.Utilities.addEventHandlers(_this.domElement, {imageLoadComplete: _this._onImageLoadComplete.bind(_this)});
+ _this._selfEventHandlers = Entertainment.Utilities.addEventHandlers(_this, {dataContextChanged: _this._onDataContextChanged.bind(_this)});
+ _this._onDataContextChanged()
+ }, function(error) {
+ MS.Entertainment.UI.Controls.fail("ArtistDetailsView() Unexcepted processDeclarativeControlContainer failure. error: " + (error && error.message))
+ });
+ if (this.enableAutoScroll)
+ this._enableFocusEventHandlers("details-layoutRoot")
+ }
+ ArtistDetailsView.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ if (this._selfEventHandlers) {
+ this._selfEventHandlers.cancel();
+ this._selfEventHandlers = null
+ }
+ };
+ ArtistDetailsView.prototype._onImageLoadComplete = function(args) {
+ if (!this.domElement)
+ return;
+ var loadedImage = args && args.detail && args.detail.loaded;
+ if (!loadedImage)
+ WinJS.Utilities.addClass(this.domElement, "state_artistArtNone");
+ else
+ WinJS.Utilities.removeClass(this.domElement, "state_artistArtNone")
+ };
+ ArtistDetailsView.prototype._onDataContextChanged = function() {
+ if (this._getHasNoPossibleHeaderImage())
+ WinJS.Utilities.addClass(this.domElement, "state_artistArtNone")
+ };
+ ArtistDetailsView.prototype._getHasNoPossibleHeaderImage = function() {
+ var hasNoPossibleHeaderImage = false;
+ if (this.dataContext && this.dataContext instanceof Entertainment.ViewModels.ArtistDetailsViewModelBase)
+ hasNoPossibleHeaderImage = this.dataContext.hasNoPossibleHeaderImage;
+ return hasNoPossibleHeaderImage
+ };
+ return ArtistDetailsView
+ })(Controls.PageViewBase);
+ Controls.ArtistDetailsView = ArtistDetailsView
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.ArtistDetailsView)
+})();
+/* >>>>>>/viewmodels/music/artistdetailsviewmodelbase.js:78 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ (function(ArtistDetailsViewModelModuleKeys) {
+ ArtistDetailsViewModelModuleKeys[ArtistDetailsViewModelModuleKeys["marketplaceAlbumsModule"] = 0] = "marketplaceAlbumsModule";
+ ArtistDetailsViewModelModuleKeys[ArtistDetailsViewModelModuleKeys["topSongsModule"] = 1] = "topSongsModule";
+ ArtistDetailsViewModelModuleKeys[ArtistDetailsViewModelModuleKeys["relatedArtistsModule"] = 2] = "relatedArtistsModule"
+ })(ViewModels.ArtistDetailsViewModelModuleKeys || (ViewModels.ArtistDetailsViewModelModuleKeys = {}));
+ var ArtistDetailsViewModelModuleKeys = ViewModels.ArtistDetailsViewModelModuleKeys;
+ var ArtistDetailsViewModelBase = (function(_super) {
+ __extends(ArtistDetailsViewModelBase, _super);
+ function ArtistDetailsViewModelBase(artist, collectionFilter) {
+ _super.call(this);
+ this._moduleViewStateListener = null;
+ this._mediaItemLibraryIdBinding = null;
+ this._viewStateViewModel = null;
+ this._biography = String.empty;
+ MS.Entertainment.ViewModels.assert(artist, "An artist media item is required.");
+ this._collectionFilter = collectionFilter;
+ this._featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this._mediaItem = artist.clone();
+ this.hasNoPossibleHeaderImage = !this._mediaItem || !this._mediaItem.imageResizeUri;
+ this._initializeModules();
+ this._localAlbumsQuery = new Entertainment.Data.Query.libraryAlbums;
+ this._localTracksQuery = new Entertainment.Data.Query.libraryTracks
+ }
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "collectionFilter", {
+ get: function() {
+ return this._collectionFilter
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "localAlbums", {
+ get: function() {
+ return this._localAlbums
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "marketplaceAlbums", {
+ get: function() {
+ return this.modules && this.modules[0]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "topSongs", {
+ get: function() {
+ return this.modules && this.modules[1]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "relatedArtists", {
+ get: function() {
+ return this.modules && this.modules[2]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "mediaItem", {
+ get: function() {
+ return this._mediaItem
+ }, set: function(value) {
+ if (value !== this.mediaItem) {
+ this.updateAndNotify("mediaItem", value);
+ this._shareMediaItem();
+ this.hasNoPossibleHeaderImage = !value || !value.imageResizeUri
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "primaryHeaderButtons", {
+ get: function() {
+ return this._primaryHeaderButtons
+ }, set: function(value) {
+ this.updateAndNotify("primaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "myAlbumsButtons", {
+ get: function() {
+ return this._myAlbumsButtons
+ }, set: function(value) {
+ this.updateAndNotify("myAlbumsButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "topSongsButtons", {
+ get: function() {
+ return this._topSongsButtons
+ }, set: function(value) {
+ this.updateAndNotify("topSongsButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "hasNoPossibleHeaderImage", {
+ get: function() {
+ return this._hasNoPossibleHeaderImage
+ }, set: function(value) {
+ this.updateAndNotify("hasNoPossibleHeaderImage", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "headerImage", {
+ get: function() {
+ return this._headerImage
+ }, set: function(value) {
+ this.updateAndNotify("headerImage", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "biography", {
+ get: function() {
+ return this._biography
+ }, set: function(value) {
+ this.updateAndNotify("biography", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "viewStateViewModel", {
+ get: function() {
+ if (!this._viewStateViewModel) {
+ var viewStateItems = new Array;
+ viewStateItems[-2] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_OFFLINE_HEADER), String.load(String.id.IDS_MUSIC_OFFLINE_DETAILS), []);
+ viewStateItems[-1] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_ERROR_HEADER), String.load(String.id.IDS_MUSIC_ERROR_DETAILS), []);
+ this._viewStateViewModel = new ViewModels.ViewStateViewModel(viewStateItems)
+ }
+ return this._viewStateViewModel
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "skipListRendersForContentComplete", {
+ get: function() {
+ return !this._isMusicMarketplaceEnabled || !this.isOnline
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "filterDetails", {
+ get: function() {
+ return this._filterDetails
+ }, set: function(value) {
+ this.updateAndNotify("filterDetails", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "inCollection", {
+ get: function() {
+ return this.mediaItem && (this.mediaItem.inCollection || this.mediaItem.hasLibraryId)
+ }, enumerable: true, configurable: true
+ });
+ ArtistDetailsViewModelBase.prototype.dispose = function() {
+ this._disposeSmartBuyStateEngine();
+ this._disposeViewStateListeners();
+ this._releaseModules();
+ this._unshareMediaItem();
+ if (this._localAlbumsQuery)
+ this._localAlbumsQuery.dispose();
+ if (this._localTracksQuery)
+ this._localTracksQuery.dispose();
+ _super.prototype.dispose.call(this)
+ };
+ ArtistDetailsViewModelBase.prototype.loadModules = function() {
+ var _this = this;
+ if (!this.isOnline) {
+ this.viewStateViewModel.viewState = -2;
+ this.mediaItem.hydrate().done(function(artist) {
+ if (artist.isFailed) {
+ _this.localAlbums.moduleState = -1;
+ MS.Entertainment.ViewModels.fail("ArtistDetailsViewModelBase::loadModules: Failed to hydate mediaItem.")
+ }
+ else {
+ _this.localAlbums.updateQuery({artistId: _this.mediaItem.libraryId});
+ _this.localAlbums.load()
+ }
+ }, function(error) {
+ _this.localAlbums.moduleState = -1;
+ MS.Entertainment.ViewModels.fail("ArtistDetailsViewModelBase::loadModules: Failed to hydate mediaItem. Error message: " + (error && error.message))
+ });
+ return
+ }
+ this.viewStateViewModel.viewState = 1;
+ this.mediaItem = ViewModels.MediaItemModel.augment(this.mediaItem);
+ this.headerImage = Entertainment.UI.Shell.ImageLoader.getNewImageServiceUri(this.mediaItem, ArtistDetailsViewModelBase.DEFAULT_HEADER_IMAGE_SIZE.width, ArtistDetailsViewModelBase.DEFAULT_HEADER_IMAGE_SIZE.height, Entertainment.ImageSource.noAutoGenerated);
+ var getMediaIdPromise;
+ if (this.mediaItem.inCollection || this.mediaItem.hasCanonicalId)
+ getMediaIdPromise = WinJS.Promise.as(this.mediaItem);
+ else
+ getMediaIdPromise = this.mediaItem.hydrate();
+ var isLocalAlbumsLoaded = false;
+ getMediaIdPromise.then(function(artist) {
+ if (_this.mediaItem.inCollection) {
+ _this.localAlbums.updateQuery({artistId: _this.mediaItem.libraryId});
+ _this.localAlbums.reload();
+ isLocalAlbumsLoaded = true
+ }
+ if (_this._isMusicMarketplaceEnabled) {
+ _this.marketplaceAlbums.updateQuery({artistId: _this.mediaItem.canonicalId});
+ _this.marketplaceAlbums.moduleOptions.moduleActionFactoryParameter = _this.mediaItem;
+ _this.marketplaceAlbums.updateModuleAction();
+ _this.marketplaceAlbums.reload();
+ _this.topSongs.parentMediaId = _this.mediaItem.canonicalId;
+ _this.topSongs.parentMediaItem = _this.mediaItem;
+ _this.topSongs.trackLimit = ArtistDetailsViewModelBase.TOP_SONGS_LIMIT;
+ _this.topSongs.load()
+ }
+ return Entertainment.Utilities.schedulePromiseBelowNormal()
+ }).then(function() {
+ if (_this._isMusicMarketplaceEnabled) {
+ _this.relatedArtists.parentMediaItem = _this.mediaItem;
+ _this.relatedArtists.load()
+ }
+ return _this.mediaItem.hydrate({forceUpdate: true})
+ }).then(function() {
+ _this._shareMediaItem();
+ if (!isLocalAlbumsLoaded) {
+ _this.localAlbums.updateQuery({artistId: _this.mediaItem.libraryId});
+ _this.localAlbums.reload()
+ }
+ _this.biography = _this.mediaItem.description || String.empty
+ }, function(error) {
+ _this.viewStateViewModel.viewState = -1;
+ MS.Entertainment.ViewModels.fail("Failed to load ArtistDetails modules. Error message: " + (error && error.message))
+ })
+ };
+ ArtistDetailsViewModelBase.prototype._isNeededForPageReady = function(module) {
+ var result = _super.prototype._isNeededForPageReady.call(this, module);
+ result = result && (module !== this.relatedArtists) && (!this.mediaItem || !this.mediaItem.inCollection || module !== this.localAlbums);
+ return result
+ };
+ ArtistDetailsViewModelBase.prototype.delayInitialize = function() {
+ _super.prototype.delayInitialize.call(this);
+ this._delayInitialized = true;
+ if (this.topSongs && this.topSongs.items)
+ this.mediaItem.tracks = this.topSongs.items;
+ if (!this._smartBuyStateEngine)
+ this._initializeSmartBuyStateEngine();
+ if (this.localAlbums)
+ this.localAlbums.delayInitialize();
+ if (this.topSongs)
+ this.topSongs.delayInitialize();
+ if (this.marketplaceAlbums)
+ this.marketplaceAlbums.delayInitialize();
+ this._shareMediaItem()
+ };
+ ArtistDetailsViewModelBase.prototype.navigatedBackTo = function() {
+ ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this._mediaItem);
+ this.modules.forEach(function(detailsModule) {
+ detailsModule.refreshItems()
+ })
+ };
+ ArtistDetailsViewModelBase.prototype.invokeShowAllCollectionAlbums = function() {
+ this._updateCollectionFilter(Microsoft.Entertainment.Platform.MediaAvailability.available);
+ this.localAlbums.reload();
+ this.filterDetails = String.empty
+ };
+ Object.defineProperty(ArtistDetailsViewModelBase.prototype, "_isMusicMarketplaceEnabled", {
+ get: function() {
+ return this._featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)
+ }, enumerable: true, configurable: true
+ });
+ ArtistDetailsViewModelBase.prototype._initializeModules = function() {
+ this._localAlbums = ViewModels.AlbumsModuleFactory.createArtistLocalAlbumsModule(this.mediaItem, this._collectionFilter);
+ if (this._isMusicMarketplaceEnabled) {
+ var albumOptions = {shouldHydrateLibraryId: true};
+ this.modules = [ViewModels.AlbumsModuleFactory.createArtistAlbumsModule(this.mediaItem), new ViewModels.SongsModule(1), new ViewModels.ArtistsModule(1)];
+ this.listenForModuleViewStateChanges();
+ this._moduleViewStateListener = Entertainment.UI.Framework.addEventHandlers(this.topSongs, {moduleStateChanged: this._onTopSongsViewStateChanged.bind(this)})
+ }
+ this._moduleViewStateListener = Entertainment.UI.Framework.addEventHandlers(this._localAlbums, {moduleStateChanged: this._onLocalAlbumsViewStateChanged.bind(this)})
+ };
+ ArtistDetailsViewModelBase.prototype._initializeSmartBuyStateEngine = function() {
+ var _this = this;
+ this._disposeSmartBuyStateEngine();
+ var pageButtonSet = ViewModels.SmartBuyButtons.getArtistDetailsHeaderButtons(this.mediaItem, Entertainment.UI.Actions.ExecutionLocation.canvas);
+ var topSongsButtonSet = ViewModels.SmartBuyButtons.getArtistTopSongsButtons(this.mediaItem, Entertainment.UI.Actions.ExecutionLocation.canvas);
+ pageButtonSet = Entertainment.Utilities.uniteObjects(pageButtonSet, topSongsButtonSet);
+ if (this.mediaItem.inCollection)
+ pageButtonSet = Entertainment.Utilities.uniteObjects(pageButtonSet, this._getLocalAlbumsHeaderButtons(this.mediaItem.libraryId));
+ this._smartBuyStateEngine = new ViewModels.SmartBuyStateEngine;
+ var appBarService = Entertainment.ServiceLocator.getService(Entertainment.Services.appToolbar);
+ var mediaContext = appBarService.pushMediaContext(this.mediaItem, null, this._smartBuyStateEngine.currentAppbarActions, {executeLocation: Entertainment.UI.Actions.ExecutionLocation.canvas});
+ this._mediaContext = mediaContext;
+ mediaContext.collectionFilter = this._collectionFilter || Microsoft.Entertainment.Platform.MediaAvailability.available;
+ if (this.topSongs)
+ this.topSongs.mediaContext = mediaContext;
+ this._updateLocalAlbumFilter(mediaContext.collectionFilter);
+ this._smartBuyStateEngine.initialize(this.mediaItem, pageButtonSet, ViewModels.MusicLXStateHandlers.onArtistDetailsStateChanged, {invokeHandlerAsStatic: true});
+ this._smartBuyStateEngineBinding = WinJS.Binding.bind(this._smartBuyStateEngine, {currentAppbarActions: function() {
+ return _this._artistAppbarActionsChanged()
+ }});
+ this._mediaItemLibraryIdBinding = WinJS.Binding.bind(this._mediaItem, {libraryId: function() {
+ return _this._mediaCollectionStateChanged()
+ }});
+ this.primaryHeaderButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.ArtistDetailsActionLocations.primaryHeader);
+ this.myAlbumsButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.ArtistDetailsActionLocations.localAlbums);
+ this.topSongsButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.ArtistDetailsActionLocations.topSongs)
+ };
+ ArtistDetailsViewModelBase.prototype._artistAppbarActionsChanged = function() {
+ if (!this.disposed && this._mediaContext)
+ this._mediaContext.setToolbarActions(this._smartBuyStateEngine.currentAppbarActions)
+ };
+ ArtistDetailsViewModelBase.prototype._mediaCollectionStateChanged = function() {
+ if (!this.disposed && this._mediaItemLibraryIdBinding)
+ this._initializeSmartBuyStateEngine()
+ };
+ ArtistDetailsViewModelBase.prototype._unshareMediaItem = function() {
+ if (this._shareOperation) {
+ this._shareOperation.cancel();
+ this._shareOperation = null
+ }
+ };
+ ArtistDetailsViewModelBase.prototype._shareMediaItem = function() {
+ this._unshareMediaItem();
+ if (this.mediaItem && this._delayInitialized) {
+ var sender = Entertainment.ServiceLocator.getService(Entertainment.Services.shareSender);
+ this._shareOperation = sender.pendingShare(this.mediaItem)
+ }
+ };
+ ArtistDetailsViewModelBase.prototype._disposeViewStateListeners = function() {
+ if (this._moduleViewStateListener) {
+ this._moduleViewStateListener.cancel();
+ this._moduleViewStateListener = null
+ }
+ };
+ ArtistDetailsViewModelBase.prototype._disposeSmartBuyStateEngine = function() {
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ this._primaryHeaderButtons = null;
+ this._myAlbumsButtons = null;
+ if (this._smartBuyStateEngineBinding) {
+ this._smartBuyStateEngineBinding.cancel();
+ this._smartBuyStateEngineBinding = null
+ }
+ if (this._mediaItemLibraryIdBinding) {
+ this._mediaItemLibraryIdBinding.cancel();
+ this._mediaItemLibraryIdBinding = null
+ }
+ if (this._smartBuyStateEngine) {
+ this._smartBuyStateEngine.unload();
+ this._smartBuyStateEngine = null
+ }
+ };
+ ArtistDetailsViewModelBase.prototype._releaseModules = function() {
+ if (this.localAlbums) {
+ this.localAlbums.dispose();
+ this.localAlbums = null
+ }
+ if (this.marketplaceAlbums) {
+ this.marketplaceAlbums.dispose();
+ this.marketplaceAlbums = null
+ }
+ if (this.topSongs) {
+ this.topSongs.dispose();
+ this.topSongs = null
+ }
+ if (this.relatedArtists) {
+ this.relatedArtists.dispose();
+ this.relatedArtists = null
+ }
+ };
+ ArtistDetailsViewModelBase.prototype._onTopSongsViewStateChanged = function() {
+ if (this.isFirstLocationLoaded && this.topSongs.items) {
+ this.mediaItem.tracks = this.topSongs.items;
+ this._initializeSmartBuyStateEngine()
+ }
+ };
+ ArtistDetailsViewModelBase.prototype._onLocalAlbumsViewStateChanged = function() {
+ if (!this._isMusicMarketplaceEnabled)
+ this.viewStateViewModel.viewState = this._localAlbums.moduleState;
+ if (this._localAlbums.moduleState === 2)
+ this._updateFilterDetailString()
+ };
+ ArtistDetailsViewModelBase.prototype._updateCollectionFilter = function(filter) {
+ this._collectionFilter = filter;
+ this._updateLocalAlbumFilter(filter);
+ if (this._mediaContext)
+ this._mediaContext.collectionFilter = filter
+ };
+ ArtistDetailsViewModelBase.prototype._updateLocalAlbumFilter = function(filter) {
+ this._localAlbumsQuery.mediaAvailability = filter;
+ this._localTracksQuery.mediaAvailability = filter;
+ if (this.localAlbums)
+ this.localAlbums.updateQuery({mediaAvailability: filter})
+ };
+ ArtistDetailsViewModelBase.prototype._updateFilterDetailString = function() {
+ var _this = this;
+ if (!this.mediaItem || !this.inCollection || this._collectionFilter === Microsoft.Entertainment.Platform.MediaAvailability.available) {
+ this.filterDetails = String.empty;
+ return
+ }
+ var libraryAlbumsQuery = new Entertainment.Data.Query.libraryAlbums;
+ libraryAlbumsQuery.mediaAvailability = Microsoft.Entertainment.Platform.MediaAvailability.available;
+ libraryAlbumsQuery.artistId = this.mediaItem.libraryId;
+ libraryAlbumsQuery.executeCount().done(function(totalAlbumCount) {
+ if (totalAlbumCount > _this.localAlbums.count)
+ switch (_this._collectionFilter) {
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableOffline:
+ _this.filterDetails = String.load(String.id.IDS_DETAILS_FILTER_AVAILABLE_OFFLINE);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloud:
+ _this.filterDetails = String.load(String.id.IDS_DETAILS_FILTER_IN_CLOUD);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloudOnly:
+ _this.filterDetails = String.load(String.id.IDS_DETAILS_FILTER_STREAMING);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.musicPass:
+ _this.filterDetails = String.load(String.id.IDS_DETAILS_FILTER_FROM_XBOX_MUSIC);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.oneDrive:
+ _this.filterDetails = String.load(String.id.IDS_DETAILS_FILTER_ON_ONEDRIVE);
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.thisDeviceOnly:
+ _this.filterDetails = String.load(String.id.IDS_DETAILS_FILTER_ON_PC);
+ break;
+ default:
+ _this.filterDetails = String.empty;
+ break
+ }
+ libraryAlbumsQuery.dispose()
+ }, function(error) {
+ ViewModels.fail("ArtistDetailsViewModelBase::_updateFilterDetailString: Failed to execute library albums query with the following error: " + error && error.message);
+ libraryAlbumsQuery.dispose()
+ })
+ };
+ ArtistDetailsViewModelBase.prototype._getLocalAlbumsHeaderButtons = function(artistId) {
+ this._localAlbumsQuery.artistId = artistId;
+ this._localAlbumsQuery.sort = Microsoft.Entertainment.Queries.AlbumsSortBy.titleAscending;
+ this._localAlbumsQuery.isLive = false;
+ this._localAlbumsQuery.acquisitionData = new Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist);
+ this._localTracksQuery.artistId = artistId;
+ this._localTracksQuery.sort = Microsoft.Entertainment.Queries.TracksSortBy.albumTitleDiscNumberNumberAscending;
+ this._localTracksQuery.isLive = false;
+ this._localTracksQuery.acquisitionData = new Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist);
+ return ViewModels.SmartBuyButtons.getArtistDetailsLocalAlbumsButtons(this._localAlbumsQuery.clone(), this._localTracksQuery.clone(), Entertainment.UI.Actions.ExecutionLocation.canvas)
+ };
+ ArtistDetailsViewModelBase.TOP_SONGS_LIMIT = 5;
+ ArtistDetailsViewModelBase.DEFAULT_HEADER_IMAGE_SIZE = {
+ width: 400, height: 300
+ };
+ return ArtistDetailsViewModelBase
+ })(ViewModels.PageViewModelBase);
+ ViewModels.ArtistDetailsViewModelBase = ArtistDetailsViewModelBase
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/controls/music1/moduleviewcontrol.js:524 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var ModuleViewControl = (function(_super) {
+ __extends(ModuleViewControl, _super);
+ function ModuleViewControl(element, options) {
+ _super.call(this, element, options);
+ UI.Framework.processDeclarativeControlContainer(this)
+ }
+ Object.defineProperty(ModuleViewControl.prototype, "dataContext", {
+ get: function() {
+ return this._dataContext
+ }, set: function(value) {
+ this.updateAndNotify("dataContext", value)
+ }, enumerable: true, configurable: true
+ });
+ ModuleViewControl.prototype.onModuleItemInvoked = function(event) {
+ var element = event.srcElement;
+ while (element && element !== this.domElement) {
+ if (element.clickDataContext) {
+ this.invokeModuleAction(element.clickDataContext);
+ event.stopPropagation();
+ break
+ }
+ element = element.parentElement
+ }
+ };
+ ModuleViewControl.prototype.onModuleHeaderInvoked = function(event) {
+ if (!event.keyCode || event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space) {
+ var element = event.srcElement;
+ var viewModel = this.dataContext;
+ while (element && element !== this.domElement) {
+ var moduleAction = WinJS.Utilities.getMember("moduleDataContext.moduleAction", element);
+ if (moduleAction) {
+ moduleAction.execute();
+ event.stopPropagation();
+ break
+ }
+ element = element.parentElement
+ }
+ }
+ };
+ ModuleViewControl.prototype.invokeModuleAction = function(item) {
+ if (!WinJS.Utilities.getMember("actionId", item))
+ if (WinJS.Utilities.getMember("data.actionId", item))
+ item = item.data;
+ else
+ return;
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var actionToExecute = actionService.getAction(item.actionId);
+ if (actionToExecute) {
+ actionToExecute.parameter = item.actionParameter;
+ if (item.automationId)
+ actionToExecute.automationId = item.automationId;
+ actionToExecute.requeryCanExecute();
+ if (actionToExecute.isEnabled)
+ actionToExecute.execute()
+ }
+ };
+ ModuleViewControl.prototype.onShowAllCollectionAlbumsInvoked = function(event) {
+ if (!event.keyCode || event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space) {
+ var viewModel = this.dataContext;
+ if (viewModel) {
+ viewModel.invokeShowAllCollectionAlbums();
+ event.stopPropagation()
+ }
+ }
+ };
+ ModuleViewControl.prototype.freeze = function() {
+ _super.prototype.freeze.call(this);
+ if (this.dataContext)
+ this.dataContext.freeze()
+ };
+ ModuleViewControl.prototype.thaw = function() {
+ _super.prototype.thaw.call(this);
+ if (this.dataContext)
+ this.dataContext.thaw()
+ };
+ ModuleViewControl.prototype.unload = function() {
+ _super.prototype.unload.call(this)
+ };
+ ModuleViewControl.isDeclarativeControlContainer = true;
+ return ModuleViewControl
+ })(UI.Framework.UserControl);
+ Controls.ModuleViewControl = ModuleViewControl
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.ModuleViewControl)
+})();
diff --git a/packages/microsoft.zunemusic/CollectionPageDelayedScripts_merged.js b/packages/microsoft.zunemusic/CollectionPageDelayedScripts_merged.js
new file mode 100644
index 00000000..08f53bc0
--- /dev/null
+++ b/packages/microsoft.zunemusic/CollectionPageDelayedScripts_merged.js
@@ -0,0 +1,2213 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/controls/managefoldersview.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var FolderItem = (function(_super) {
+ __extends(FolderItem, _super);
+ function FolderItem(folder) {
+ _super.call(this);
+ if (folder) {
+ this._isAddFolderButton = false;
+ this._name = folder.name;
+ this._path = folder.path;
+ this._folder = folder
+ }
+ else
+ this._isAddFolderButton = true
+ }
+ Object.defineProperty(FolderItem.prototype, "name", {
+ get: function() {
+ return this._name
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(FolderItem.prototype, "path", {
+ get: function() {
+ return this._path
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(FolderItem.prototype, "isAddFolderButton", {
+ get: function() {
+ return this._isAddFolderButton
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(FolderItem.prototype, "folder", {
+ get: function() {
+ return this._folder
+ }, enumerable: true, configurable: true
+ });
+ return FolderItem
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ var ManageFoldersDialog = (function(_super) {
+ __extends(ManageFoldersDialog, _super);
+ function ManageFoldersDialog(element, options) {
+ this.templateStorage = "/Controls/ManageFoldersPage.html";
+ this.templateName = "dialogTemplate";
+ _super.call(this, element, options)
+ }
+ ManageFoldersDialog.show = function() {
+ if (ManageFoldersDialog._dialog && ManageFoldersDialog._dialog.visible)
+ return;
+ var options = {
+ width: "60%", height: "100%", buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_MANAGE_FOLDERS_DONE_BUTTON), execute: function execute_done(dialog) {
+ dialog.hide();
+ ManageFoldersDialog._dialog = null
+ }
+ })], defaultButtonIndex: 0, title: MS.Entertainment.Utilities.isVideoApp1 ? String.load(String.id.IDS_VIDEO1_MANAGE_FOLDERS_TITLE) : String.load(String.id.IDS_MUSIC_MANAGE_FOLDERS_TITLE), userControl: "MS.Entertainment.UI.Controls.ManageFolders", userControlOptions: {}, persistOnNavigate: false
+ };
+ if (!ManageFoldersDialog._dialog)
+ ManageFoldersDialog._dialog = new MS.Entertainment.UI.Controls.ManageFoldersDialog(document.createElement("div"), options);
+ if (!ManageFoldersDialog._dialog.visible)
+ ManageFoldersDialog._dialog.show()
+ };
+ ManageFoldersDialog.hide = function() {
+ var returnValue = ManageFoldersDialog._dialog.hide();
+ ManageFoldersDialog._dialog = null;
+ return returnValue
+ };
+ return ManageFoldersDialog
+ })(MS.Entertainment.UI.Controls.Dialog);
+ Controls.ManageFoldersDialog = ManageFoldersDialog;
+ var ManageFolders = (function(_super) {
+ __extends(ManageFolders, _super);
+ function ManageFolders(element, options) {
+ this.templateStorage = "/Controls/ManageFoldersPage.html";
+ this.templateName = "manageFoldersTemplate";
+ _super.call(this, element, options)
+ }
+ Object.defineProperty(ManageFolders.prototype, "items", {
+ get: function() {
+ return this._items
+ }, set: function(value) {
+ this.updateAndNotify("items", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ManageFolders.prototype, "itemCounts", {
+ get: function() {
+ return this._itemCounts
+ }, enumerable: true, configurable: true
+ });
+ ManageFolders.prototype._load = function() {
+ var _this = this;
+ var addFolderItem = new Array;
+ var itemsInLibrary = new Array;
+ var libraryId;
+ libraryId = MS.Entertainment.Utilities.isVideoApp1 ? Windows.Storage.KnownLibraryId.videos : Windows.Storage.KnownLibraryId.music;
+ addFolderItem.push(new FolderItem(null));
+ Windows.Storage.StorageLibrary.getLibraryAsync(libraryId).then(function(library) {
+ if (library)
+ library.folders.forEach(function(folder) {
+ itemsInLibrary.push(new FolderItem(folder))
+ })
+ }).done(function() {
+ _this._itemCounts = itemsInLibrary.length;
+ if (_this._itemCounts > 0)
+ itemsInLibrary.reverse();
+ _this.items = new MS.Entertainment.ObservableArray(addFolderItem.concat(itemsInLibrary))
+ }, function(error) {
+ MS.Entertainment.Utilities.assertError("ManageFolders::_load() failed to get library items.", error)
+ })
+ };
+ ManageFolders.prototype.initialize = function() {
+ this._load()
+ };
+ ManageFolders.showLastFolderDialog = function() {
+ return MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE), String.load(String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT), {
+ width: "60%", height: "100%", buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_CLOSE_BUTTON), execute: function execute_done(dialog) {
+ dialog.hide()
+ }
+ })], defaultButtonIndex: 0
+ })
+ };
+ ManageFolders.folderTemplateSelector = function(item) {
+ function loadItemTemplate(itemTemplate) {
+ return MS.Entertainment.UI.Framework.loadTemplate(itemTemplate, null, true).then(function(templateControl) {
+ return templateControl
+ })
+ }
+ if (item.isAddFolderButton)
+ return loadItemTemplate("/Controls/ManageFoldersPage.html#addFolderItemTemplate");
+ else
+ return loadItemTemplate("/Controls/ManageFoldersPage.html#removeFolderItemTemplate")
+ };
+ ManageFolders.prototype.onModuleItemClicked = function(event) {
+ var element = event.srcElement;
+ while (element && element !== this.domElement) {
+ if (element.clickDataContext) {
+ this._invokeModuleItem(element.clickDataContext);
+ event.stopPropagation();
+ break
+ }
+ element = element.parentElement
+ }
+ };
+ ManageFolders.prototype._invokeModuleItem = function(item) {
+ var _this = this;
+ if (!item)
+ return;
+ var libraryId;
+ libraryId = MS.Entertainment.Utilities.isVideoApp1 ? Windows.Storage.KnownLibraryId.videos : Windows.Storage.KnownLibraryId.music;
+ if (item.isAddFolderButton)
+ Windows.Storage.StorageLibrary.getLibraryAsync(libraryId).then(function(library) {
+ return library.requestAddFolderAsync()
+ }).done(function() {
+ _this._load()
+ }, function(error) {
+ MS.Entertainment.fail("AddFolder Failed: " + (error && error.message))
+ });
+ else
+ Windows.Storage.StorageLibrary.getLibraryAsync(libraryId).then(function(library) {
+ MS.Entertainment.UI.Controls.ManageFoldersDialog.hide();
+ if (_this.itemCounts === 1)
+ return MS.Entertainment.UI.Controls.ManageFolders.showLastFolderDialog();
+ else
+ return library.requestRemoveFolderAsync(item.folder)
+ }).done(function() {
+ MS.Entertainment.UI.Controls.ManageFoldersDialog.show()
+ }, function(error) {
+ MS.Entertainment.fail("RemoveFolder Failed: " + (error && error.message))
+ })
+ };
+ return ManageFolders
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.ManageFolders = ManageFolders;
+ WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.ManageFolders.folderTemplateSelector)
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/components/music/cloudgrovelinfo.js:199 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Music");
+ WinJS.Namespace.define("MS.Entertainment.Music", {cloudGrovelInfo: MS.Entertainment.UI.Framework.defineUserControl("Components/Music/CloudGrovelInfo.html#cloudGrovelInfoTemplate", function cloudGrovelInfo(element, options) {
+ this._nextButton = WinJS.Binding.as({
+ title: String.load(String.id.IDS_FAI_NEXT_BUTTON), isEnabled: true, isAvailable: true, execute: function onNext() {
+ this._onNext()
+ }.bind(this)
+ });
+ this._finishButton = WinJS.Binding.as({
+ title: String.load(String.id.IDS_CLOSE_BUTTON), isEnabled: true, isAvailable: true, execute: function onFinish() {
+ this._onFinish()
+ }.bind(this)
+ });
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser.isSubscription) {
+ this.subHeaderString = String.load(String.id.IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_XMP);
+ this.streamIconParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_XMP);
+ this.streamIconParagraphTwoText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_XMP);
+ this.cloudIconParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_XMP)
+ }
+ else {
+ this.subHeaderString = String.load(String.id.IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_FREE);
+ this.streamIconParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_FREE);
+ this.streamIconParagraphTwoText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_FREE);
+ this.cloudIconParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_FREE)
+ }
+ }, {
+ _nextButton: null, _finishButton: null, _container: null, _currentPage: 0, _dialogContainer: null, subHeaderString: String.empty, streamIconParagraphOneText: String.empty, streamIconParagraphTwoText: String.empty, cloudIconParagraphOneText: String.empty, initialize: function initialize() {
+ this.xboxMusicPassWebLink.domElement.href = MS.Entertainment.UI.FWLink.cloudGrovelLearnMore;
+ this._dialogContainer = document.querySelector(".dialogContainerBackground")
+ }, setOverlay: function setOverlay(container) {
+ this._container = container;
+ container.buttons = [this._nextButton, this._finishButton];
+ container.backClickHandler = this._onBack.bind(this);
+ var featureEnablement = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.featureEnablement);
+ var devicesEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.devicesEnabled);
+ if (devicesEnabled)
+ WinJS.Utilities.addClass(this.iconColumn2, "removeFromDisplay");
+ this._updateState()
+ }, _onNext: function _onNext() {
+ this._currentPage = 1;
+ this._updateState()
+ }, _onBack: function _onBack() {
+ this._currentPage = 0;
+ this._updateState()
+ }, _onFinish: function _onFinish() {
+ this._container.hide()
+ }, _updateState: function _updateState() {
+ this._showElement(this.cloudInfoDialogPage1, this._currentPage === 0);
+ this._showElement(this.cloudInfoDialogPage2, this._currentPage === 1);
+ this._showElement(this._container._backButton, this._currentPage !== 0);
+ this._container.defaultButtonIndex = (this._currentPage === 0) ? 0 : 1;
+ this._nextButton.isAvailable = this._currentPage === 0;
+ if (this._dialogContainer)
+ if (this._currentPage === 0) {
+ WinJS.Utilities.addClass(this._dialogContainer, "page1");
+ WinJS.Utilities.removeClass(this._dialogContainer, "page2")
+ }
+ else {
+ WinJS.Utilities.addClass(this._dialogContainer, "page2");
+ WinJS.Utilities.removeClass(this._dialogContainer, "page1")
+ }
+ }, _showElement: function _showElement(element, show) {
+ if (element.domElement)
+ element = element.domElement;
+ if (show)
+ WinJS.Utilities.removeClass(element, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(element, "removeFromDisplay")
+ }, _sendTelemetryEvent: function _sendTelemetryEvent(event) {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(event)
+ }
+ }, {}, {})});
+ WinJS.Namespace.define("MS.Entertainment.Music", {cloudGrovelInfoDialog: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Dialog", "Components/Music/CloudGrovelInfo.html#dialogTemplate", null, {
+ backClickHandler: null, onBackClick: function onBackClick(event) {
+ if (this.backClickHandler)
+ this.backClickHandler(event)
+ }
+ }, null, {show: function show() {
+ var options = {
+ width: "900px", height: "700px", cancelButtonIndex: 2, defaultButtonIndex: 0, title: String.load(String.id.IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE), userControl: "MS.Entertainment.Music.cloudGrovelInfo", userControlOptions: {}, persistOnNavigate: false
+ };
+ var dialog = new MS.Entertainment.Music.cloudGrovelInfoDialog(document.createElement("div"), options);
+ return dialog.show()
+ }})})
+})()
+})();
+/* >>>>>>/controls/appbar/removeoverlay.js:290 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {RemoveOverlay: MS.Entertainment.UI.Framework.defineUserControl("/Controls/AppBar/RemoveOverlay.html#removeOverlayTemplate", function removeOverlayConstructor(element, options) {
+ this._inputItems = options.items;
+ MS.Entertainment.UI.Controls.assert(this._inputItems, "Need item(s) for deletion in RemoveOverlay!");
+ this._inputItems = this._inputItems || []
+ }, {
+ items: null, collectionFilter: null, deleteLocalFilesOnly: false, removed: false, _inputItems: null, _dialog: null, _okEnabled: true, _cancelEnabled: true, _mediaType: null, _ids: null, initialize: function initialize() {
+ this._waitCursor.isBusy = true;
+ this._setOKEnabled(false);
+ var length = 0;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isCloudCollectionV2Enabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled);
+ return this._getCount().then(function gotCount(count) {
+ length = count;
+ if (isCloudCollectionV2Enabled)
+ return MS.Entertainment.Data.List.listToArray(this._inputItems, 0, MS.Entertainment.UI.Controls.RemoveOverlay.DELETE_CONFIRMATION_VERIFICATION_LIMIT);
+ else
+ return MS.Entertainment.Data.List.listToArray(this._inputItems, 0, 3)
+ }.bind(this)).then(function copiedItems(arrayMediaItems) {
+ this._waitCursor.isBusy = false;
+ this._setOKEnabled(true);
+ var mediaItem = arrayMediaItems ? arrayMediaItems[0] : null;
+ var mediaAvailability = this.collectionFilter || Microsoft.Entertainment.Platform.MediaAvailability.available;
+ var isFilteredToMusicPass = mediaAvailability === Microsoft.Entertainment.Platform.MediaAvailability.musicPass;
+ if (!mediaItem || !mediaItem.isRemovable) {
+ MS.Entertainment.UI.Controls.fail("Item is invalid or has mediaType not supported for deletion.");
+ this._hide()
+ }
+ else if (length === 1) {
+ var isAlbum = mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album;
+ var isTrack = mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track;
+ var hasLocalFiles = mediaItem.localTracksCount && mediaItem.localTracksCount > 0;
+ if (!mediaItem.name && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this._removeDescription.text = String.load(String.id.IDS_DELETE_DESCRIPTION_LOCAL_SINGLE).format(mediaItem.seriesTitle);
+ else if (isTrack || isAlbum)
+ if (isFilteredToMusicPass)
+ if (hasLocalFiles)
+ if (isTrack)
+ this._removeDescription.text = String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK_WITH_LOCAL);
+ else
+ this._removeDescription.text = String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM_WITH_LOCAL);
+ else if (isTrack)
+ this._removeDescription.text = String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK);
+ else
+ this._removeDescription.text = String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM);
+ else if (isCloudCollectionV2Enabled && (mediaItem.inCloudCollectionV2 || mediaItem.roamingViaOneDriveTrackCount > 0)) {
+ this._removeDescription.text = String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_ONEDRIVE).format(mediaItem.name);
+ MS.Entertainment.Utilities.displayElement(this._oneDriveIcon)
+ }
+ else
+ this._removeDescription.text = String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_LIBRARY).format(mediaItem.name);
+ else
+ this._removeDescription.text = String.load(String.id.IDS_DELETE_DESCRIPTION_LOCAL_SINGLE).format(mediaItem.name)
+ }
+ else if (length !== 0) {
+ var decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ decimalFormatter.fractionDigits = 0;
+ var decimalFormattedNumber = decimalFormatter.format(length);
+ var messageId = String.id.IDS_DELETE_DESCRIPTION_LOCAL_PLURAL;
+ var isAlbum = mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album;
+ var isTrack = mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track;
+ var hasLocalFiles = mediaItem.localTracksCount && mediaItem.localTracksCount > 0;
+ if (isTrack || isAlbum)
+ if (isFilteredToMusicPass)
+ if (isTrack)
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_TRACKS_PLURAL;
+ else
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_ALBUMS_PLURAL;
+ else if (isCloudCollectionV2Enabled)
+ if (length <= MS.Entertainment.UI.Controls.RemoveOverlay.DELETE_CONFIRMATION_VERIFICATION_LIMIT) {
+ var mixedContent = false;
+ for (var i = 1; i < length; i++)
+ if (arrayMediaItems[i - 1].inCloudCollectionV2 !== arrayMediaItems[i].inCloudCollectionV2) {
+ mixedContent = true;
+ break
+ }
+ if (!mixedContent)
+ if (mediaItem.inCloudCollectionV2) {
+ if (isTrack)
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_ONEDRIVE_PLURAL;
+ else
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_ONEDRIVE_PLURAL;
+ MS.Entertainment.Utilities.displayElement(this._oneDriveIcon)
+ }
+ else if (isTrack)
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL;
+ else
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL;
+ else {
+ if (isTrack)
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_MIXED_PLURAL;
+ else
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_MIXED_PLURAL;
+ MS.Entertainment.Utilities.displayElement(this._oneDriveIcon)
+ }
+ }
+ else {
+ if (isTrack)
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_MIXED_PLURAL;
+ else
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_MIXED_PLURAL;
+ MS.Entertainment.Utilities.displayElement(this._oneDriveIcon)
+ }
+ else if (isTrack)
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL;
+ else
+ messageId = String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL;
+ this._removeDescription.text = MS.Entertainment.Utilities.Pluralization.getPluralizedString(messageId, length).format(decimalFormattedNumber)
+ }
+ else {
+ MS.Entertainment.UI.Controls.fail("Need item(s) for deletion in RemoveOverlay! List was empty");
+ this._hide()
+ }
+ this._mediaType = mediaItem ? mediaItem.mediaType : null
+ }.bind(this), function copiedFailed() {
+ MS.Entertainment.UI.Controls.fail("Error occured when attempting to get items to delete.");
+ this._waitCursor.isBusy = false;
+ this._hide()
+ }.bind(this))
+ }, setOverlay: function setOverlay(overlay) {
+ this._dialog = overlay;
+ this._setOKEnabled(this._okEnabled);
+ this._setCanceledEnabled(this._cancelEnabled)
+ }, submit: function submit() {
+ this._setOKEnabled(false);
+ this._setCanceledEnabled(false);
+ this.removed = true;
+ this._waitCursor.isBusy = true;
+ return this._getIds().then(function deleteItems() {
+ return this._deleteItems()
+ }.bind(this))
+ }, _hide: function _hide() {
+ if (this._dialog)
+ this._dialog.hide()
+ }, _setOKEnabled: function _setOKEnabled(enabled) {
+ if (this._dialog && this._dialog.buttons && (this._dialog.buttons.length > 0))
+ this._dialog.buttons[0].isEnabled = enabled;
+ this._okEnabled = enabled
+ }, _setCanceledEnabled: function _setCanceledEnabled(enabled) {
+ if (this._dialog && this._dialog.buttons && (this._dialog.buttons.length > 1))
+ this._dialog.buttons[1].isEnabled = enabled;
+ this._cancelEnabled = enabled
+ }, _getCount: function _getCount() {
+ var promise;
+ if (Array.isArray(this._inputItems))
+ promise = this._inputItems.length;
+ else if (MS.Entertainment.Data.List.isList(this._inputItems))
+ promise = this._inputItems.getCount();
+ else if (this._inputItems)
+ promise = 1;
+ else
+ promise = 0;
+ return WinJS.Promise.as(promise)
+ }, _clearCurrentMediaIfMatch: function _clearCurrentMediaIfMatch(playbackSession, id) {
+ if (playbackSession) {
+ if (playbackSession.isMediaCurrentlyLoaded(id)) {
+ var removeItemIfMatch = function removeItemIfMatch(item) {
+ if (item && item.data && item.data.libraryId === id) {
+ playbackSession.mediaCollection.remove(item.key);
+ if (MS.Entertainment.Utilities.useModalNowPlaying) {
+ playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService.currentPage && navigationService.currentPage.iaNode && navigationService.currentPage.iaNode.moniker === "immersiveDetails")
+ navigationService.navigateBack()
+ }
+ }
+ return WinJS.Promise.wrap()
+ };
+ MS.Entertainment.Platform.Playback.Playlist.PlaylistCore.forEachItemSequentially(playbackSession.mediaCollection, removeItemIfMatch, null, null)
+ }
+ if (MS.Entertainment.Utilities.useModalNowPlaying && playbackSession.lastPlayedMedia && playbackSession.lastPlayedMedia.libraryId === id)
+ playbackSession.setLastPlayedMedia(null)
+ }
+ }, _getIds: function _getIds() {
+ var ids = [];
+ var promise = ids;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ this._ids = ids;
+ if (Array.isArray(this._inputItems))
+ this._inputItems.forEach(function iteration(item) {
+ if (MS.Entertainment.Utilities.isValidLibraryId(item.libraryId)) {
+ ids.push(item.libraryId);
+ this._clearCurrentMediaIfMatch(playbackSession, item.libraryId)
+ }
+ }, this);
+ else if (MS.Entertainment.Data.List.isList(this._inputItems))
+ promise = this._inputItems.forEachAll(function iteration(args) {
+ if (args.item && args.item.data && MS.Entertainment.Utilities.isValidLibraryId(args.item.data.libraryId)) {
+ ids.push(args.item.data.libraryId);
+ this._clearCurrentMediaIfMatch(playbackSession, args.item.data.libraryId)
+ }
+ }.bind(this)).then(null, function ignoreErrors(){}).then(function returnIds() {
+ return ids
+ });
+ else if (this._inputItems && MS.Entertainment.Utilities.isValidLibraryId(this._inputItems.libraryId)) {
+ ids.push(this._inputItems.libraryId);
+ this._clearCurrentMediaIfMatch(playbackSession, this._inputItems.libraryId)
+ }
+ return WinJS.Promise.as(promise)
+ }, _deleteItems: function _deleteItems() {
+ var handleDeleteSuccess = this._handleDeleteSuccess.bind(this);
+ var handleDeleteFailure = this._handleDeleteCompleted.bind(this);
+ if (!this._ids || !this._ids.length || !this._mediaType) {
+ handleDeleteFailure();
+ return WinJS.Promise.wrapError(new Error("Ids are invalid or has mediaType not supported for deletion."))
+ }
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ var mediaProvider = mediaStore.mediaProvider;
+ var playlistProvider = mediaStore.playlistProvider;
+ var mediaAvailability = this.collectionFilter || Microsoft.Entertainment.Platform.MediaAvailability.available;
+ switch (this._mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ return playlistProvider.deletePlaylistAsync(this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (this.deleteLocalFilesOnly)
+ return mediaProvider.deleteFilesForMediaAsync(this._mediaType, this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ return mediaProvider.deleteMediaAsync(this._mediaType, this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ default:
+ this._waitCursor.isBusy = true;
+ var deletePromises = [];
+ var ids = [];
+ var mediaType = null;
+ this._ids.forEach(function deleteItem(collectionId) {
+ deletePromises.push(this._getIdsFromQuery(collectionId, this._mediaType).then(function addIds(deleteIds) {
+ ids = ids.concat(deleteIds.ids);
+ mediaType = deleteIds.mediaType
+ }))
+ }.bind(this));
+ return WinJS.Promise.join(deletePromises).then(function deleteQueryItems() {
+ if (ids.length === 0)
+ return WinJS.Promise.wrapError("No items to delete");
+ if (this.deleteLocalFilesOnly)
+ return mediaProvider.deleteFilesForMediaAsync(this._mediaType, this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ return mediaProvider.deleteMediaAsync(mediaType, ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure)
+ }.bind(this))
+ }
+ }, _handleDeleteSuccess: function _handleDeleteSuccess() {
+ return this._clearLibraryIds().then(this._handleDeleteCompleted.bind(this))
+ }, _handleDeleteCompleted: function _handleDeleteCompleted() {
+ this._waitCursor.isBusy = false;
+ this._hide()
+ }, _clearLibraryId: function _clearLibraryId(item) {
+ if (item && !item.fromCollection && MS.Entertainment.Utilities.isValidLibraryId(item.libraryId))
+ item.libraryId = MS.Entertainment.Utilities.invalidateLibraryId
+ }, _clearLibraryIds: function _clearLibraryIds() {
+ var promise;
+ if (Array.isArray(this._inputItems))
+ this._inputItems.forEach(this._clearLibraryId, this);
+ else if (MS.Entertainment.Data.List.isList(this._inputItems))
+ promise = this._inputItems.forEachAll(function iteration(args) {
+ this._clearLibraryId(args.item && args.item.data)
+ }.bind(this)).then(null, function ignoreErrors(error) {
+ MS.Entertainment.UI.Controls.fail("Failed to clear all library ids after delete. Error message: " + error && error.message)
+ });
+ else
+ this._clearLibraryId(this._inputItems);
+ return WinJS.Promise.as(promise)
+ }, _getIdsFromQuery: function _getIdsFromQuery(libraryId, mediaType) {
+ var currentId;
+ var ids = [];
+ var childMediaType = null;
+ var itemsPromise = WinJS.Promise.wrap();
+ var queryComplete = function queryComplete(q) {
+ return q.result.items.itemsFromIndex(0).then(function processItems(dataContext) {
+ for (var x = 0; x < dataContext.items.length; x++) {
+ currentId = dataContext.items[x].data.libraryId;
+ if (MS.Entertainment.Utilities.isValidLibraryId(currentId))
+ ids.push(currentId)
+ }
+ })
+ };
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ childMediaType = Microsoft.Entertainment.Queries.ObjectType.track;
+ var tracksQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ tracksQuery.albumId = libraryId;
+ tracksQuery.mediaAvailability = this.collectionFilter;
+ itemsPromise = tracksQuery.execute().then(queryComplete);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ childMediaType = Microsoft.Entertainment.Queries.ObjectType.video;
+ var episodeQuery = new MS.Entertainment.Data.Query.libraryVideoTV;
+ episodeQuery.seasonId = libraryId;
+ itemsPromise = episodeQuery.execute().then(queryComplete);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ childMediaType = Microsoft.Entertainment.Queries.ObjectType.video;
+ var seriesEpisodesQuery = new MS.Entertainment.Data.Query.libraryVideoTV;
+ seriesEpisodesQuery.seriesId = libraryId;
+ itemsPromise = seriesEpisodesQuery.execute().then(queryComplete);
+ break
+ }
+ return itemsPromise.then(function returnIds() {
+ return {
+ ids: ids, mediaType: childMediaType
+ }
+ })
+ }
+ }, {}, {
+ _isRemoveOverlayOpen: false, DELETE_CONFIRMATION_VERIFICATION_LIMIT: 25, show: function show(dataSource, collectionFilter, deleteLocalFilesOnly) {
+ if (MS.Entertainment.UI.Controls.RemoveOverlay._isRemoveOverlayOpen)
+ return WinJS.Promise.wrap();
+ MS.Entertainment.UI.Controls.RemoveOverlay._isRemoveOverlayOpen = true;
+ return MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_DELETE_LABEL), "MS.Entertainment.UI.Controls.RemoveOverlay", {
+ userControlOptions: {
+ items: dataSource, collectionFilter: collectionFilter, deleteLocalFilesOnly: deleteLocalFilesOnly
+ }, width: "40%", height: "310px", buttons: [WinJS.Binding.as({
+ isEnabled: true, title: String.load(String.id.IDS_DELETE_BUTTON), execute: function execute_submit(dialog) {
+ WinJS.Promise.as(dialog.userControlInstance.submit()).done(null, function(error) {
+ MS.Entertainment.UI.Controls.fail("Submit failed in the delete dialog. Error message: " + error && error.message)
+ })
+ }
+ }), WinJS.Binding.as({
+ isEnabled: true, title: String.load(String.id.IDS_CANCEL_BUTTON_TC), execute: function execute_cancel(dialog) {
+ dialog.hide()
+ }
+ })], defaultButtonIndex: 0, cancelButtonIndex: 1
+ }).then(function onDismiss(overlay) {
+ if (overlay)
+ MS.Entertainment.UI.Controls.RemoveOverlay._isRemoveOverlayOpen = false;
+ return overlay
+ })
+ }
+ })})
+})()
+})();
+/* >>>>>>/viewmodels/music1/metadataeditcommon.js:625 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var Framework = MS.Entertainment.UI.Framework;
+ var MetadataSavable = (function(_super) {
+ __extends(MetadataSavable, _super);
+ function MetadataSavable(destination) {
+ _super.call(this);
+ this._disposed = false;
+ this._destination = destination
+ }
+ Object.defineProperty(MetadataSavable.prototype, "isValid", {
+ get: function() {
+ return !this._lastError
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataSavable.prototype, "hasError", {
+ get: function() {
+ return !!this._lastError
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataSavable.prototype, "lastError", {
+ get: function() {
+ return this._lastError
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataSavable.prototype, "destination", {
+ get: function() {
+ return this._destination
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataSavable.prototype, "disposed", {
+ get: function() {
+ return this._disposed
+ }, enumerable: true, configurable: true
+ });
+ MetadataSavable.prototype.dispose = function() {
+ this._disposed = true
+ };
+ MetadataSavable.prototype.validate = function() {
+ MS.Entertainment.ViewModels.fail("MetadataSavable::validate is undefined")
+ };
+ MetadataSavable.prototype.cancel = function() {
+ MS.Entertainment.ViewModels.fail("MetadataSavable::cancel is undefined")
+ };
+ MetadataSavable.prototype.save = function() {
+ MS.Entertainment.ViewModels.fail("MetadataSavable::save is undefined");
+ return null
+ };
+ MetadataSavable.prototype._setLastError = function(value) {
+ var wasValid = this.isValid;
+ this.updateAndNotify("lastError", value);
+ if (wasValid !== !value) {
+ this.dispatchChangeAndNotify("isValid", !value, wasValid);
+ this.dispatchChangeAndNotify("hasError", !!value, !wasValid)
+ }
+ };
+ return MetadataSavable
+ })(Framework.ObservableBase);
+ ViewModels.MetadataSavable = MetadataSavable
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataeditfields.js:706 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var Framework = MS.Entertainment.UI.Framework;
+ var Utilities = MS.Entertainment.Utilities;
+ var MetadataValueFieldType = (function() {
+ function MetadataValueFieldType(regexp, converter, maxLength) {
+ this._converter = null;
+ this._regexp = regexp;
+ this._converter = converter;
+ this._maxLength = null;
+ if (maxLength && typeof(maxLength) === "number")
+ if (maxLength > 0)
+ this._maxLength = maxLength;
+ else
+ MS.Entertainment.ViewModels.fail("Positive number expected for max field length")
+ }
+ Object.defineProperty(MetadataValueFieldType.prototype, "regexp", {
+ get: function() {
+ return this._regexp
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataValueFieldType.prototype, "maxLength", {
+ get: function() {
+ return this._maxLength
+ }, enumerable: true, configurable: true
+ });
+ MetadataValueFieldType.prototype.validate = function(value) {
+ var error = null;
+ if (this.maxLength && value && value.length > this.maxLength)
+ error = new ViewModels.MetadataError(null, null, "Value entered is too long for the given type. Maximum length: " + this.maxLength + "\" Value: \"" + value + "\"");
+ if (!error && this.regexp) {
+ this.regexp.lastIndex = 0;
+ if (!this.regexp.test(value))
+ error = new ViewModels.MetadataError(null, null, "Value can't be converted to given type. Type: \"" + this.regexp.toString() + "\" Value: \"" + value + "\"")
+ }
+ return error
+ };
+ MetadataValueFieldType.prototype.convert = function(value) {
+ if (this._converter)
+ return this._converter(value);
+ else
+ return null
+ };
+ return MetadataValueFieldType
+ })();
+ ViewModels.MetadataValueFieldType = MetadataValueFieldType;
+ var MetadataValueField = (function(_super) {
+ __extends(MetadataValueField, _super);
+ function MetadataValueField(originalValue, stringId, destination) {
+ _super.call(this, destination);
+ this.allowEmpty = false;
+ if (stringId)
+ this._displayName = String.load(stringId);
+ else
+ this._displayName = String.empty;
+ originalValue = Utilities.trimCharacterDirection(originalValue);
+ var validOriginalValue = true;
+ this._valueDestination = destination;
+ if (this.destination)
+ validOriginalValue = !this.destination.validate(originalValue);
+ if (!validOriginalValue)
+ originalValue = String.empty;
+ this._originalValue = originalValue;
+ this._value = originalValue
+ }
+ Object.defineProperty(MetadataValueField.prototype, "destination", {
+ get: function() {
+ return this._valueDestination
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataValueField.prototype, "displayName", {
+ get: function() {
+ return this._displayName
+ }, set: function(value) {
+ this.updateAndNotify("displayName", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataValueField.prototype, "displayValue", {
+ get: function() {
+ return MS.Entertainment.Data.Factory.appendCharacterDirection(this.value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataValueField.prototype, "value", {
+ get: function() {
+ return this._value
+ }, set: function(value) {
+ value = Utilities.trimCharacterDirection(value);
+ if (value !== this.value) {
+ var oldDisplayValue = this.displayValue;
+ this.updateAndNotify("value", value);
+ this.dispatchChangeAndNotify("displayValue", this.displayValue, oldDisplayValue)
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataValueField.prototype, "savedValue", {
+ get: function() {
+ return this._savedValue
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataValueField.prototype, "originalValue", {
+ get: function() {
+ return this._originalValue
+ }, set: function(value) {
+ this.updateAndNotify("originalValue", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataValueField.prototype, "maxLength", {
+ get: function() {
+ return this.destination.type.maxLength
+ }, enumerable: true, configurable: true
+ });
+ MetadataValueField.prototype.validate = function() {
+ var error = null;
+ if ((this.value || this.allowEmpty) && this.destination)
+ error = this.destination.validate(this.value);
+ this._setLastError(error)
+ };
+ MetadataValueField.prototype.cancel = function() {
+ this.value = this.originalValue;
+ this._setLastError(null)
+ };
+ MetadataValueField.prototype.save = function() {
+ var result = null;
+ this.validate();
+ if (!this.isValid)
+ result = WinJS.Promise.wrapError(this.lastError);
+ else if ((this.value || this.allowEmpty) && (this.value !== this.originalValue)) {
+ this._savedValue = this.value;
+ if (this.destination)
+ result = WinJS.Promise.as(this.destination.convert(this.value))
+ }
+ return WinJS.Promise.as(result)
+ };
+ return MetadataValueField
+ })(ViewModels.MetadataSavable);
+ ViewModels.MetadataValueField = MetadataValueField;
+ var MetadataMultipleValuesField = (function(_super) {
+ __extends(MetadataMultipleValuesField, _super);
+ function MetadataMultipleValuesField(originalValue, possibleValues, stringId, customizeStringId, destination) {
+ _super.call(this, originalValue, stringId, destination);
+ this._selectionManager = null;
+ this._possibleValues = possibleValues || [];
+ this._customizeStringId = customizeStringId;
+ this._initializeSelectionManager()
+ }
+ Object.defineProperty(MetadataMultipleValuesField.prototype, "selectionManager", {
+ get: function() {
+ return this._selectionManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataMultipleValuesField.prototype, "allowCustomValue", {
+ get: function() {
+ return !!this._customizeStringId
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataMultipleValuesField.prototype, "valueInOriginalPossibleValues", {
+ get: function() {
+ var possibleValueIndex = this._possibleValues.indexOf(this.value);
+ var isPossibleValue = possibleValueIndex >= 0;
+ return isPossibleValue
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataMultipleValuesField.prototype, "customIndex", {
+ get: function() {
+ var customIndex = -1;
+ if (this.allowCustomValue && this.dataSource)
+ customIndex = this.dataSource.length - 1;
+ return customIndex
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataMultipleValuesField.prototype, "totalPossibleValues", {
+ get: function() {
+ var total = this.dataSource ? this.dataSource.length : 0;
+ if (total > 2 && this.allowCustomValue)
+ total -= 2;
+ return total
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataMultipleValuesField.prototype, "dataSource", {
+ get: function() {
+ var dataSource = null;
+ dataSource = this.selectionManager.dataSource;
+ return dataSource
+ }, enumerable: true, configurable: true
+ });
+ MetadataMultipleValuesField.prototype.dispose = function() {
+ _super.prototype.dispose.call(this);
+ if (this._selectionManagerHandlers) {
+ this._selectionManagerHandlers.cancel();
+ this._selectionManagerHandlers = null
+ }
+ };
+ MetadataMultipleValuesField.prototype._initializeSelectionManager = function() {
+ if (!this._selectionManager && !this.disposed) {
+ var dataSource;
+ if (this.allowCustomValue) {
+ dataSource = this._possibleValues.slice(0);
+ dataSource.push(null);
+ dataSource.push(String.load(this._customizeStringId))
+ }
+ else
+ dataSource = this._possibleValues;
+ this._selectionManager = new Framework.SelectionManager;
+ this._selectionManager.dataSource = new MS.Entertainment.ObservableArray(dataSource);
+ this._selectionManagerHandlers = Utilities.addEventHandlers(this._selectionManager, {selectedIndexChanged: this._onSelectionChanged.bind(this)});
+ Utilities.addEventHandlers(this, {valueChanged: this._onValueChanged.bind(this)});
+ this._onValueChanged()
+ }
+ };
+ MetadataMultipleValuesField.prototype._onValueChanged = function() {
+ if (this._selectionManager.selectedIndex < 0 || this._selectionManager.selectedItem !== this.value) {
+ var possibleValueIndex = this.dataSource.indexOf(this.value);
+ var isPossibleValue = possibleValueIndex >= 0 && possibleValueIndex < this.totalPossibleValues;
+ if (isPossibleValue)
+ this._selectionManager.selectedIndex = possibleValueIndex;
+ else if (this.allowCustomValue && (!!this.value || this.allowEmpty)) {
+ this.dataSource.splice(this.totalPossibleValues, 0, this.value);
+ this.dispatchChangeAndNotify("customIndex", this.customIndex, this.customIndex - 1);
+ this._selectionManager.selectedIndex = this.totalPossibleValues - 1
+ }
+ else if (this._selectionManager.selectedIndex >= 0 && this._selectionManager.selectedIndex < this.totalPossibleValues)
+ this.value = this._selectionManager.selectedItem;
+ else
+ this.value = this.originalValue
+ }
+ };
+ MetadataMultipleValuesField.prototype._onSelectionChanged = function(args) {
+ if (!this.allowCustomValue || this._selectionManager.selectedIndex !== this.customIndex)
+ this.value = this._selectionManager.selectedItem
+ };
+ return MetadataMultipleValuesField
+ })(MetadataValueField);
+ ViewModels.MetadataMultipleValuesField = MetadataMultipleValuesField
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataeditcollection.js:961 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var MetadataSavableCollection = (function(_super) {
+ __extends(MetadataSavableCollection, _super);
+ function MetadataSavableCollection(destination) {
+ _super.call(this, destination);
+ this._collectionDestination = destination
+ }
+ Object.defineProperty(MetadataSavableCollection.prototype, "destination", {
+ get: function() {
+ return this._collectionDestination
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataSavableCollection.prototype, "dataSource", {
+ get: function() {
+ this._dataSource = this._dataSource || [];
+ return this._dataSource
+ }, enumerable: true, configurable: true
+ });
+ MetadataSavableCollection.prototype.validate = function() {
+ var childErrors = [];
+ this.dataSource.forEach(function(item) {
+ if (item) {
+ item.validate();
+ if (!item.isValid)
+ childErrors.push(item.lastError)
+ }
+ });
+ var error = null;
+ if (childErrors && childErrors.length)
+ error = new ViewModels.MetadataError(this, null, "Invalid data in children", childErrors);
+ this._setLastError(error)
+ };
+ MetadataSavableCollection.prototype.cancel = function() {
+ this.dataSource.forEach(function(item, index, source) {
+ if (item)
+ item.cancel()
+ });
+ this._setLastError(null)
+ };
+ MetadataSavableCollection.prototype.save = function() {
+ var _this = this;
+ var result = null;
+ var childChanged = false;
+ var childPromises;
+ this.validate();
+ if (!this.isValid)
+ result = WinJS.Promise.wrapError(this.lastError);
+ else {
+ childPromises = this.dataSource.map(function(item, index, source) {
+ var childPromise = null;
+ if (item)
+ childPromise = item.save().then(function(childFieldDestination) {
+ if (childFieldDestination)
+ childChanged = true;
+ return childFieldDestination
+ });
+ return WinJS.Promise.as(childPromise)
+ });
+ result = WinJS.Promise.join(childPromises).then(function(childFieldDestinations) {
+ var fieldDestination = null;
+ if (_this.destination && childChanged)
+ fieldDestination = _this.destination.convert(childFieldDestinations);
+ return WinJS.Promise.as(fieldDestination)
+ })
+ }
+ return result
+ };
+ return MetadataSavableCollection
+ })(ViewModels.MetadataSavable);
+ ViewModels.MetadataSavableCollection = MetadataSavableCollection
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataediterror.js:1054 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var Framework = MS.Entertainment.UI.Framework;
+ var MetadataError = (function(_super) {
+ __extends(MetadataError, _super);
+ function MetadataError(field, displayMessageId, message, childErrors) {
+ _super.call(this);
+ this._field = field;
+ if (displayMessageId)
+ this._displayMessage = String.load(displayMessageId);
+ else
+ this._displayMessage = String.empty;
+ if (message !== null && message !== undefined) {
+ this.name = message;
+ this.message = message
+ }
+ else {
+ this.name = this._displayMessage;
+ this.message = this._displayMessage
+ }
+ }
+ Object.defineProperty(MetadataError.prototype, "field", {
+ get: function() {
+ return this._field
+ }, set: function(value) {
+ this.updateAndNotify("field", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataError.prototype, "childErrors", {
+ get: function() {
+ this._childErrors = this._childErrors || [];
+ return this._childErrors
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataError.prototype, "displayMessage", {
+ get: function() {
+ return this._displayMessage
+ }, enumerable: true, configurable: true
+ });
+ return MetadataError
+ })(Framework.ObservableBase);
+ ViewModels.MetadataError = MetadataError
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataediteditors.js:1118 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var MetadataEditor = (function(_super) {
+ __extends(MetadataEditor, _super);
+ function MetadataEditor(destination) {
+ _super.call(this, destination);
+ this._parentDestination = destination;
+ this._items = {}
+ }
+ Object.defineProperty(MetadataEditor.prototype, "items", {
+ get: function() {
+ return this._items
+ }, set: function(value) {
+ this.updateAndNotify("items", value || {})
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataEditor.prototype, "destination", {
+ get: function() {
+ return this._parentDestination
+ }, enumerable: true, configurable: true
+ });
+ MetadataEditor.prototype._forAllItems = function(callback) {
+ MS.Entertainment.ViewModels.assert(callback, "Callback must be supplied to call to _forAllItems.");
+ if (this.items && callback)
+ for (var key in this.items)
+ callback(this.items[key], key)
+ };
+ MetadataEditor.prototype.validate = function() {
+ var childErrors = [];
+ this._forAllItems(function(item) {
+ if (item) {
+ item.validate();
+ if (!item.isValid)
+ childErrors.push(item.lastError)
+ }
+ });
+ var error = null;
+ var numErrors = childErrors ? childErrors.length : 0;
+ if (numErrors)
+ error = new ViewModels.MetadataError(this, String.id.IDS_MUSIC_EDIT_METADATA_MULTI_ERROR_MESSAGE, "Metadata edit failed.", childErrors);
+ this._setLastError(error)
+ };
+ MetadataEditor.prototype.cancel = function() {
+ this._forAllItems(function(item, key) {
+ if (item)
+ item.cancel()
+ });
+ this._setLastError(null)
+ };
+ MetadataEditor.prototype.save = function() {
+ var _this = this;
+ var result = null;
+ var childPromises;
+ var childChanged = !!this.allowUnchangedSaved;
+ this.validate();
+ if (!this.isValid)
+ result = WinJS.Promise.wrapError(this.lastError);
+ else if (this.destination) {
+ childPromises = [];
+ this.destination.start();
+ this._forAllItems(function(item, key) {
+ if (item)
+ childPromises.push(item.save().then(function(fieldDestination) {
+ if (fieldDestination) {
+ childChanged = true;
+ _this.destination.write(fieldDestination)
+ }
+ }))
+ });
+ result = WinJS.Promise.join(childPromises).then(function() {
+ if (childChanged)
+ return _this.destination.end();
+ else {
+ _this.destination.cancel();
+ return null
+ }
+ })
+ }
+ return WinJS.Promise.as(result)
+ };
+ MetadataEditor.prototype.load = function() {
+ return WinJS.Promise.as()
+ };
+ return MetadataEditor
+ })(ViewModels.MetadataSavable);
+ ViewModels.MetadataEditor = MetadataEditor
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataeditmediaviewmodel.js:1226 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var Queries = Microsoft.Entertainment.Queries;
+ var Factory = MS.Entertainment.Data.Factory;
+ var MediaMetadataEditor = (function(_super) {
+ __extends(MediaMetadataEditor, _super);
+ function MediaMetadataEditor(destination) {
+ _super.call(this, destination)
+ }
+ Object.defineProperty(MediaMetadataEditor.prototype, "viewStateViewModel", {
+ get: function() {
+ if (!this._viewStateViewModel)
+ this._viewStateViewModel = new ViewModels.ViewStateViewModel([]);
+ return this._viewStateViewModel
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaMetadataEditor.prototype, "mediaItem", {
+ get: function() {
+ return this._mediaItem
+ }, set: function(value) {
+ this.updateAndNotify("mediaItem", value)
+ }, enumerable: true, configurable: true
+ });
+ MediaMetadataEditor.prototype.load = function() {
+ var _this = this;
+ this.viewStateViewModel.viewState = 1;
+ return this._onLoad().then(function() {
+ _this.viewStateViewModel.viewState = 2
+ }, function(error) {
+ _this.viewStateViewModel.viewState = -1;
+ return WinJS.Promise.wrapError(error)
+ })
+ };
+ MediaMetadataEditor.prototype._onLoad = function() {
+ MS.Entertainment.ViewModels.fail("MediaMetadataEditor::_onLoad not implemented");
+ return WinJS.Promise.as()
+ };
+ MediaMetadataEditor.prototype._blockOnItemsChange = function() {
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ var binding = WinJS.Binding.bind(this, {items: function() {
+ if (binding) {
+ signal.complete();
+ binding.cancel();
+ binding = null
+ }
+ }});
+ return signal.promise
+ };
+ return MediaMetadataEditor
+ })(ViewModels.MetadataEditor);
+ ViewModels.MediaMetadataEditor = MediaMetadataEditor;
+ var MusicMetadataEditor = (function(_super) {
+ __extends(MusicMetadataEditor, _super);
+ function MusicMetadataEditor(destination) {
+ _super.call(this, destination);
+ this._genres = null;
+ this._showSorts = false
+ }
+ Object.defineProperty(MusicMetadataEditor.prototype, "genres", {
+ get: function() {
+ return this._genres
+ }, set: function(value) {
+ this.updateAndNotify("genres", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MusicMetadataEditor.prototype, "showSorts", {
+ get: function() {
+ return this._showSorts
+ }, set: function(value) {
+ if (value !== this._showSorts) {
+ this.updateAndNotify("showSorts", value);
+ this._onShowSortsChanged()
+ }
+ }, enumerable: true, configurable: true
+ });
+ MusicMetadataEditor.prototype.loadGenres = function(mediaType) {
+ var _this = this;
+ var resultPromise;
+ if (this.genres)
+ resultPromise = WinJS.Promise.as(this.genres);
+ else
+ resultPromise = this.executeGenresQuery(mediaType).then(function(genres) {
+ _this.genres = genres;
+ return genres
+ });
+ return resultPromise
+ };
+ MusicMetadataEditor.prototype.executeGenresQuery = function(mediaType) {
+ var query = new MS.Entertainment.Data.Query.libraryGenres;
+ query.sort = Queries.GenresSortBy.nameAscending;
+ query.mediaType = mediaType;
+ query.chunked = false;
+ query.chunkSize = 1000;
+ return query.execute().then(function() {
+ var genres = [];
+ if (query.result && query.result.itemsArray)
+ genres = query.result.itemsArray.map(function(genre, index, source) {
+ return genre.name
+ });
+ return genres
+ }, function(error) {
+ MS.Entertainment.ViewModels.fail("MusicMetadataEditor::executeGenresQuery failed to load genred. Error: " + (error && error.message));
+ return []
+ }).then(function(genres) {
+ query.dispose();
+ return genres
+ })
+ };
+ MusicMetadataEditor.prototype._onShowSortsChanged = function(){};
+ return MusicMetadataEditor
+ })(MediaMetadataEditor);
+ ViewModels.MusicMetadataEditor = MusicMetadataEditor;
+ var MediaMetadataType = (function() {
+ function MediaMetadataType(){}
+ Object.defineProperty(MediaMetadataType, "stringValue", {
+ get: function() {
+ return new ViewModels.MetadataValueFieldType(/^.*$/, Factory.string)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaMetadataType, "year", {
+ get: function() {
+ return new ViewModels.MetadataValueFieldType(/^(175[3-9]|17[5-9][0-9]|1[8-9][0-9]{2}|[2-9][0-9]{3})$/, Factory.databaseDateFromYear, 4)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaMetadataType, "numberValue", {
+ get: function() {
+ return new ViewModels.MetadataValueFieldType(/^[0-9]+$/, Factory.intNumber)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaMetadataType, "discNumber", {
+ get: function() {
+ return new ViewModels.MetadataValueFieldType(/^[0-9]+$/, Factory.intNumber, 2)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaMetadataType, "trackNumber", {
+ get: function() {
+ return new ViewModels.MetadataValueFieldType(/^[0-9]+$/, Factory.intNumber, 3)
+ }, enumerable: true, configurable: true
+ });
+ return MediaMetadataType
+ })();
+ ViewModels.MediaMetadataType = MediaMetadataType;
+ var MediaMetadataDestination = (function() {
+ function MediaMetadataDestination(value, propertyName, propertyFieldMask) {
+ this._value = value;
+ this._propertyName = propertyName;
+ this._propertyFieldMask = propertyFieldMask
+ }
+ Object.defineProperty(MediaMetadataDestination.prototype, "value", {
+ get: function() {
+ return this._value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaMetadataDestination.prototype, "propertyName", {
+ get: function() {
+ return this._propertyName
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaMetadataDestination.prototype, "propertyFieldMask", {
+ get: function() {
+ return this._propertyFieldMask
+ }, enumerable: true, configurable: true
+ });
+ return MediaMetadataDestination
+ })();
+ ViewModels.MediaMetadataDestination = MediaMetadataDestination;
+ var MediaDestinationConverterBase = (function() {
+ function MediaDestinationConverterBase(propertyName, propertyFieldMask) {
+ this._propertyName = propertyName;
+ this._propertyFieldMask = propertyFieldMask
+ }
+ Object.defineProperty(MediaDestinationConverterBase.prototype, "propertyName", {
+ get: function() {
+ return this._propertyName
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaDestinationConverterBase.prototype, "propertyFieldMask", {
+ get: function() {
+ return this._propertyFieldMask
+ }, enumerable: true, configurable: true
+ });
+ return MediaDestinationConverterBase
+ })();
+ ViewModels.MediaDestinationConverterBase = MediaDestinationConverterBase;
+ var MediaMetadataFieldConverter = (function(_super) {
+ __extends(MediaMetadataFieldConverter, _super);
+ function MediaMetadataFieldConverter(type, propertyName, propertyFieldMask) {
+ _super.call(this, propertyName, propertyFieldMask);
+ this._type = null;
+ this._type = type
+ }
+ Object.defineProperty(MediaMetadataFieldConverter.prototype, "type", {
+ get: function() {
+ return this._type
+ }, enumerable: true, configurable: true
+ });
+ MediaMetadataFieldConverter.prototype.validate = function(value) {
+ var error = null;
+ if (this.type)
+ error = this.type.validate(value);
+ return error
+ };
+ MediaMetadataFieldConverter.prototype.convert = function(value) {
+ var result = null;
+ if (this.type)
+ result = new MediaMetadataDestination(this.type.convert(value), this.propertyName, this.propertyFieldMask);
+ return result
+ };
+ return MediaMetadataFieldConverter
+ })(MediaDestinationConverterBase);
+ ViewModels.MediaMetadataFieldConverter = MediaMetadataFieldConverter;
+ var MediaMetadataCollectionConverter = (function(_super) {
+ __extends(MediaMetadataCollectionConverter, _super);
+ function MediaMetadataCollectionConverter(propertyName, propertyFieldMask) {
+ _super.call(this, propertyName, propertyFieldMask)
+ }
+ MediaMetadataCollectionConverter.prototype.convert = function(value) {
+ var array = [];
+ value = value || [];
+ value.forEach(function(fieldDestination, index, source) {
+ if (fieldDestination)
+ array.push(fieldDestination.value)
+ });
+ return new MediaMetadataDestination(array, this.propertyName, this.propertyFieldMask)
+ };
+ return MediaMetadataCollectionConverter
+ })(MediaDestinationConverterBase);
+ ViewModels.MediaMetadataCollectionConverter = MediaMetadataCollectionConverter;
+ var MediaMetadataEditorConverter = (function() {
+ function MediaMetadataEditorConverter(){}
+ Object.defineProperty(MediaMetadataEditorConverter.prototype, "_destination", {
+ get: function() {
+ return this.__destination
+ }, set: function(value) {
+ this.__destination = value
+ }, enumerable: true, configurable: true
+ });
+ MediaMetadataEditorConverter.prototype.start = function() {
+ if (!this._destination)
+ this._onStart()
+ };
+ MediaMetadataEditorConverter.prototype._onStart = function() {
+ MS.Entertainment.ViewModels.fail("MediaMetadataEditorConverter::_onStart is not defined")
+ };
+ MediaMetadataEditorConverter.prototype.write = function(field) {
+ if (this._destination && this._destination.value && field && field instanceof MediaMetadataDestination) {
+ var mediaFieldDestination = field;
+ var value = this._destination.value;
+ value[mediaFieldDestination.propertyName] = mediaFieldDestination.value;
+ value.editedFields |= mediaFieldDestination.propertyFieldMask
+ }
+ };
+ MediaMetadataEditorConverter.prototype.end = function() {
+ var _this = this;
+ var promise = null;
+ if (this._destination)
+ promise = this._onEnd().then(function() {
+ var result = _this._destination;
+ _this._destination = null;
+ return result
+ });
+ return WinJS.Promise.as(promise)
+ };
+ MediaMetadataEditorConverter.prototype._onEnd = function() {
+ MS.Entertainment.ViewModels.fail("MediaMetadataEditorConverter::_onEnd is not defined");
+ return WinJS.Promise.as()
+ };
+ MediaMetadataEditorConverter.prototype.cancel = function() {
+ this._destination = null
+ };
+ return MediaMetadataEditorConverter
+ })();
+ ViewModels.MediaMetadataEditorConverter = MediaMetadataEditorConverter
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataeditimagefields.js:1521 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var Framework = MS.Entertainment.UI.Framework;
+ var MetadataImageValueField = (function(_super) {
+ __extends(MetadataImageValueField, _super);
+ function MetadataImageValueField(originalValue, stringId) {
+ this._imageConverter = new MetadataImageFieldValueConverter("imageUrl", Microsoft.Entertainment.Platform.FieldMask.image_URL_BIT_MASK);
+ _super.call(this, this._imageConverter);
+ if (stringId)
+ this._displayName = String.load(stringId);
+ else
+ this._displayName = String.empty;
+ this._originalValue = originalValue;
+ if (this._originalValue)
+ this.value = this._originalValue.copy()
+ }
+ Object.defineProperty(MetadataImageValueField.prototype, "destination", {
+ get: function() {
+ return this._imageConverter
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValueField.prototype, "value", {
+ get: function() {
+ return this._value
+ }, set: function(value) {
+ var _this = this;
+ if (value !== this.value) {
+ this.updateAndNotify("value", value);
+ var imagePromise = WinJS.Promise.as(value && value.resolveFullFilePath());
+ imagePromise.done(function(fullFilePath) {
+ if (value === _this.value) {
+ _this.displayValue = fullFilePath;
+ _this._setLastError(null)
+ }
+ }, function(error) {
+ _this._setLastError(new ViewModels.MetadataError(_this, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LOAD_ERROR, error && error.message))
+ })
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValueField.prototype, "savedValue", {
+ get: function() {
+ return this._savedValue
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValueField.prototype, "originalValue", {
+ get: function() {
+ return this._originalValue
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValueField.prototype, "displayName", {
+ get: function() {
+ return this._displayName
+ }, set: function(value) {
+ this.updateAndNotify("displayName", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValueField.prototype, "displayValue", {
+ get: function() {
+ return this._displayValue
+ }, set: function(value) {
+ this.updateAndNotify("displayValue", value)
+ }, enumerable: true, configurable: true
+ });
+ MetadataImageValueField.prototype.validate = function() {
+ var error = this.destination.validate(this.value);
+ this._setLastError(error)
+ };
+ MetadataImageValueField.prototype.cancel = function() {
+ this.value = this.originalValue
+ };
+ MetadataImageValueField.prototype.save = function() {
+ var _this = this;
+ var promise = null;
+ if (this.value && !this.value.isEqual(this.originalValue))
+ promise = this.value.getTemporaryImage().then(function(mediaImage) {
+ return _this.destination.convert(_this.value)
+ });
+ this.savedValue = this.value;
+ return WinJS.Promise.as(promise)
+ };
+ return MetadataImageValueField
+ })(ViewModels.MetadataSavable);
+ ViewModels.MetadataImageValueField = MetadataImageValueField;
+ var MetadataImageFieldValueConverter = (function(_super) {
+ __extends(MetadataImageFieldValueConverter, _super);
+ function MetadataImageFieldValueConverter(propertyName, propertyFieldMask) {
+ _super.call(this, propertyName, propertyFieldMask);
+ this._type = new MetadataImageFieldValueType
+ }
+ Object.defineProperty(MetadataImageFieldValueConverter.prototype, "type", {
+ get: function() {
+ return this._type
+ }, enumerable: true, configurable: true
+ });
+ MetadataImageFieldValueConverter.prototype.validate = function(value) {
+ return this.type.validate(value)
+ };
+ MetadataImageFieldValueConverter.prototype.convert = function(value) {
+ return new ViewModels.MediaMetadataDestination(this.type.convert(value), this.propertyName, this.propertyFieldMask)
+ };
+ return MetadataImageFieldValueConverter
+ })(ViewModels.MediaDestinationConverterBase);
+ ViewModels.MetadataImageFieldValueConverter = MetadataImageFieldValueConverter;
+ var MetadataImageFieldValueType = (function() {
+ function MetadataImageFieldValueType(){}
+ MetadataImageFieldValueType.prototype.validate = function(value) {
+ var error = null;
+ if (!value)
+ error = new ViewModels.MetadataError(null, null, "MetadataImageFieldValueType::validate() - Invalid input value");
+ else if (!value.fullFilePath && !value.storageFile)
+ error = new ViewModels.MetadataError(null, null, "MetadataImageFieldValueType::validate() - Invalid storage file and image path");
+ else if (!value.mediaItem || !value.mediaItem.inCollection)
+ error = new ViewModels.MetadataError(null, null, "MetadataImageFieldValueType::validate() - Invalid media item");
+ return error
+ };
+ MetadataImageFieldValueType.prototype.convert = function(value) {
+ return value && value.storedImage.filePath
+ };
+ return MetadataImageFieldValueType
+ })();
+ ViewModels.MetadataImageFieldValueType = MetadataImageFieldValueType;
+ var MetadataImageValue = (function(_super) {
+ __extends(MetadataImageValue, _super);
+ function MetadataImageValue() {
+ _super.apply(this, arguments)
+ }
+ Object.defineProperty(MetadataImageValue.prototype, "storageFile", {
+ get: function() {
+ return this._storageFile
+ }, set: function(value) {
+ if (value !== this._storageFile) {
+ this.updateAndNotify("storageFile", value);
+ this._loadTemporaryImage()
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValue.prototype, "fullFilePath", {
+ get: function() {
+ return this.storedImage ? this.storedImage.url : String.empty
+ }, set: function(value) {
+ this.storedImage = {
+ url: value, filePath: String.empty
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValue.prototype, "storedImage", {
+ get: function() {
+ return this._storedImage
+ }, set: function(value) {
+ if (value != this._storedImage) {
+ var oldFullFilePath = this.fullFilePath;
+ this.updateAndNotify("storedImage", value);
+ this.dispatchChangeAndNotify("fullFilePath", this.fullFilePath, oldFullFilePath)
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MetadataImageValue.prototype, "mediaItem", {
+ get: function() {
+ return this._mediaItem
+ }, set: function(value) {
+ this.updateAndNotify("mediaItem", value)
+ }, enumerable: true, configurable: true
+ });
+ MetadataImageValue.prototype.getTemporaryImage = function() {
+ return WinJS.Promise.as(this._temporaryImage)
+ };
+ MetadataImageValue.prototype.resolveFullFilePath = function() {
+ var _this = this;
+ return this.getTemporaryImage().then(function() {
+ return _this.fullFilePath
+ })
+ };
+ MetadataImageValue.prototype.copy = function() {
+ var copy = new MetadataImageValue;
+ copy.mediaItem = this.mediaItem;
+ copy.storedImage = this.storedImage;
+ copy.storageFile = this.storageFile;
+ return copy
+ };
+ MetadataImageValue.prototype.isEqual = function(value) {
+ return value && value.fullFilePath === this.fullFilePath
+ };
+ MetadataImageValue.prototype._loadTemporaryImage = function() {
+ var _this = this;
+ if (this._temporaryImage) {
+ this._temporaryImage.cancel();
+ this._temporaryImage = null
+ }
+ if (this.mediaItem && this.mediaItem.inCollection && this.storageFile) {
+ var imageManager = new Microsoft.Entertainment.ImageManager;
+ var innerPromise = imageManager.copyFileToImageStoreAsync(this.storageFile);
+ this._temporaryImage = new WinJS.Promise(function(c, e, p) {
+ if (MetadataImageValue.forceFailures)
+ c = e;
+ innerPromise.done(c, e)
+ }, function() {
+ innerPromise.cancel()
+ });
+ this._temporaryImage.done(function(result) {
+ _this.storedImage = result
+ }, function(error) {
+ if (!error || error.name !== "Canceled") {
+ _this.storedImage = null;
+ _this.storageFile = null
+ }
+ })
+ }
+ };
+ MetadataImageValue.createFromAlbum = function(album) {
+ var value = new MetadataImageValue;
+ if (album) {
+ if (album.imageResizeUri)
+ value.fullFilePath = MS.Entertainment.UI.Shell.ImageLoader.appendResizeParameters(album.imageResizeUri, MetadataImageValue.displayWidth, MetadataImageValue.displayHeight);
+ else
+ value.fullFilePath = album.imageUri || MS.Entertainment.UI.ImagePaths.missingAlbum150;
+ value.mediaItem = album
+ }
+ return value
+ };
+ MetadataImageValue.displayWidth = 120;
+ MetadataImageValue.displayHeight = 120;
+ MetadataImageValue.forceFailures = false;
+ return MetadataImageValue
+ })(Framework.ObservableBase);
+ ViewModels.MetadataImageValue = MetadataImageValue
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataeditalbumviewmodel.js:1769 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var Platform = Microsoft.Entertainment.Platform;
+ var Queries = Microsoft.Entertainment.Queries;
+ var Utilities = MS.Entertainment.Utilities;
+ var Query = MS.Entertainment.Data.Query;
+ var AlbumMetadataEditor = (function(_super) {
+ __extends(AlbumMetadataEditor, _super);
+ function AlbumMetadataEditor(source) {
+ _super.call(this, new AlbumMetadataEditorConverter(source && source.libraryId));
+ this._source = null;
+ this._source = source
+ }
+ Object.defineProperty(AlbumMetadataEditor.prototype, "album", {
+ get: function() {
+ return this._source
+ }, enumerable: true, configurable: true
+ });
+ AlbumMetadataEditor.prototype.dispose = function() {
+ _super.prototype.dispose.call(this);
+ this._disposeImageFieldHandlers()
+ };
+ AlbumMetadataEditor.prototype._disposeImageFieldHandlers = function() {
+ if (this._imageFieldHandlers) {
+ this._imageFieldHandlers.cancel();
+ this._imageFieldHandlers = null
+ }
+ };
+ AlbumMetadataEditor.prototype._onShowSortsChanged = function() {
+ _super.prototype._onShowSortsChanged.call(this);
+ var showSortsEnabled = this.showSorts;
+ var trackEditors = WinJS.Utilities.getMember("items.tracks.dataSource", this);
+ if (trackEditors)
+ trackEditors.forEach(function(trackEditor) {
+ trackEditor.showSorts = showSortsEnabled
+ })
+ };
+ AlbumMetadataEditor.prototype._onLoad = function() {
+ var _this = this;
+ var loadPromise = null;
+ if (this._source && Utilities.isValidLibraryId(this._source.libraryId)) {
+ var album;
+ var query = new Query.Music.LibraryAlbumWithTracks;
+ var albumGenres = [];
+ var trackGenres = [];
+ var tracksField;
+ query.id = this._source.libraryId;
+ loadPromise = this.loadGenres(Queries.GenresQueryMediaType.album).then(function(genresResult) {
+ albumGenres = genresResult;
+ return _this.executeGenresQuery(Queries.GenresQueryMediaType.track)
+ }).then(function(genresResult) {
+ trackGenres = genresResult;
+ return query.execute()
+ }).then(function() {
+ var tracks = [];
+ album = (query.result && query.result.item);
+ _this.mediaItem = album;
+ if (album && album.tracks)
+ tracks = album.tracks.toArrayAll();
+ return tracks
+ }).then(function(tracks) {
+ var trackLoadPromises = [];
+ tracks = tracks || [];
+ tracksField = new ViewModels.MetadataSavableCollection(new ViewModels.MediaMetadataCollectionConverter("trackMetadata", Platform.FieldMask.tracks_BIT_MASK));
+ tracks.forEach(function(track, index, source) {
+ var albumTrackEditor = new ViewModels.AlbumTrackMetadataEditor(track);
+ albumTrackEditor.genres = trackGenres;
+ trackLoadPromises.push(albumTrackEditor.load());
+ tracksField.dataSource.push(albumTrackEditor)
+ });
+ return WinJS.Promise.join(trackLoadPromises)
+ }).then(function() {
+ var itemsChangedPromise = _this._blockOnItemsChange();
+ _this._disposeImageFieldHandlers();
+ _this.items = {
+ name: new ViewModels.MetadataValueField(album.name, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_TITLE, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "title", Platform.FieldMask.title_BIT_MASK)), sortName: new ViewModels.MetadataValueField(album.sortName, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_TITLE, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "sortTitle", Platform.FieldMask.sort_TITLE_BIT_MASK)), artistName: new ViewModels.MetadataValueField(album.artist ? album.artist.name : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_ARTIST, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "artist", Platform.FieldMask.artist_BIT_MASK)), sortArtist: new ViewModels.MetadataValueField(album.artist ? album.artist.sortName : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_ARTIST, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "sortArtist", Platform.FieldMask.sort_ARTIST_BIT_MASK)), genre: new ViewModels.MetadataMultipleValuesField(album.genreName, albumGenres, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE_CUSTOM, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "genre", Platform.FieldMask.genre_BIT_MASK)), year: new ViewModels.MetadataValueField(album.releaseDate ? album.releaseDate.getUTCFullYear() + String.empty : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_RELEASE_YEAR, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.year, "releaseDate", Platform.FieldMask.release_DATE_BIT_MASK)), image: new ViewModels.MetadataImageValueField(ViewModels.MetadataImageValue.createFromAlbum(album), String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LABEL), tracks: tracksField, firstTrack: tracksField && tracksField.dataSource[0]
+ };
+ _this._imageFieldHandlers = MS.Entertainment.Utilities.addEventHandlers(_this.items.image, {lastErrorChanged: _this._handleImageErrorChanged.bind(_this)});
+ query.dispose();
+ return itemsChangedPromise
+ }, function(error) {
+ query.dispose();
+ return WinJS.Promise.wrapError(error)
+ })
+ }
+ return WinJS.Promise.as(loadPromise)
+ };
+ AlbumMetadataEditor.prototype._handleImageErrorChanged = function() {
+ var field = this.items && this.items.image;
+ var error = field && field.lastError;
+ if (error)
+ this._setLastError(error);
+ else if (this.lastError && this.lastError.field === field)
+ this._setLastError(null)
+ };
+ return AlbumMetadataEditor
+ })(ViewModels.MusicMetadataEditor);
+ ViewModels.AlbumMetadataEditor = AlbumMetadataEditor;
+ var AlbumMetadataEditorConverter = (function(_super) {
+ __extends(AlbumMetadataEditorConverter, _super);
+ function AlbumMetadataEditorConverter(libraryId) {
+ _super.call(this);
+ this._libraryId = libraryId
+ }
+ AlbumMetadataEditorConverter.prototype._onStart = function() {
+ var albumMetadata = new Platform.AlbumMetadata;
+ this._destination = new ViewModels.MediaMetadataDestination(albumMetadata)
+ };
+ AlbumMetadataEditorConverter.prototype._onEnd = function() {
+ var promise = null;
+ if (Utilities.isValidLibraryId(this._libraryId) && this._destination && this._destination instanceof ViewModels.MediaMetadataDestination) {
+ var destination = this._destination;
+ var mediaStore = new Platform.MediaStore;
+ var albumProvider = mediaStore.albumProvider;
+ promise = albumProvider.updateAlbumMetadataAsync(destination.value, Platform.RequestType.userEditRequest, this._libraryId).then(function(){})
+ }
+ return WinJS.Promise.as(promise)
+ };
+ return AlbumMetadataEditorConverter
+ })(ViewModels.MediaMetadataEditorConverter);
+ ViewModels.AlbumMetadataEditorConverter = AlbumMetadataEditorConverter
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataedittrackviewmodel.js:1912 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var Platform = Microsoft.Entertainment.Platform;
+ var Queries = Microsoft.Entertainment.Queries;
+ var Utilities = MS.Entertainment.Utilities;
+ var Query = MS.Entertainment.Data.Query;
+ var AlbumTrackMetadataEditor = (function(_super) {
+ __extends(AlbumTrackMetadataEditor, _super);
+ function AlbumTrackMetadataEditor(source) {
+ _super.call(this, new TrackMetadataEditorConverter(source && source.libraryId));
+ this._source = null;
+ this._source = source
+ }
+ AlbumTrackMetadataEditor.prototype._onLoad = function() {
+ var _this = this;
+ var loadPromise;
+ this.mediaItem = this._source;
+ if (this._source)
+ loadPromise = this.loadGenres(Queries.GenresQueryMediaType.track).then(function(trackGenres) {
+ var track = _this._source;
+ var itemsChangedPromise = _this._blockOnItemsChange();
+ _this.items = {
+ trackNumber: new ViewModels.MetadataValueField(track.trackNumber + String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_NUMBER, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.trackNumber, "trackNumber", Platform.FieldMask.track_NUMBER_BIT_MASK)), name: new ViewModels.MetadataValueField(track.name, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_TITLE, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "title", Platform.FieldMask.title_BIT_MASK)), sortName: new ViewModels.MetadataValueField(track.sortName, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_TITLE, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "sortTitle", Platform.FieldMask.sort_TITLE_BIT_MASK)), artistName: new ViewModels.MetadataValueField(track.artist ? track.artist.name : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_ARTIST, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "artist", Platform.FieldMask.artist_BIT_MASK)), sortArtist: new ViewModels.MetadataValueField(track.artist ? track.artist.sortName : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_ARTIST, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "sortArtist", Platform.FieldMask.sort_ARTIST_BIT_MASK)), genre: new ViewModels.MetadataMultipleValuesField(track.genreName, trackGenres, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_GENRE, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE_CUSTOM, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "genre", Platform.FieldMask.genre_BIT_MASK)), disc: new ViewModels.MetadataValueField(track.discNumber + String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_DISC_NUMBER, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.discNumber, "discNumber", Platform.FieldMask.disc_NUMBER_BIT_MASK)), year: new ViewModels.MetadataValueField(track.releaseDate ? track.releaseDate.getUTCFullYear() + String.empty : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_RELEASE_YEAR, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.year, "releaseDate", Platform.FieldMask.release_DATE_BIT_MASK))
+ };
+ return itemsChangedPromise
+ });
+ return WinJS.Promise.as(loadPromise)
+ };
+ return AlbumTrackMetadataEditor
+ })(ViewModels.MusicMetadataEditor);
+ ViewModels.AlbumTrackMetadataEditor = AlbumTrackMetadataEditor;
+ var TrackMetadataEditor = (function(_super) {
+ __extends(TrackMetadataEditor, _super);
+ function TrackMetadataEditor(source) {
+ _super.call(this, new TrackToAlbumMetadataEditorConverter(source && source.libraryId));
+ this._source = null;
+ this._source = source
+ }
+ TrackMetadataEditor.prototype._onShowSortsChanged = function() {
+ _super.prototype._onShowSortsChanged.call(this);
+ var showSortsEnabled = this.showSorts;
+ var trackEditor = WinJS.Utilities.getMember("items.track", this);
+ if (trackEditor)
+ trackEditor.showSorts = showSortsEnabled
+ };
+ TrackMetadataEditor.prototype._onLoad = function() {
+ var _this = this;
+ var loadPromise;
+ this.mediaItem = this._source;
+ if (this._source && Utilities.isValidLibraryId(this._source.libraryId)) {
+ var track;
+ var album;
+ var trackQuery = new Query.Music.LibraryTrack;
+ var albumQuery = new Query.Music.LibraryAlbum;
+ var albumGenres = [];
+ var trackGenres = [];
+ var tracksField;
+ trackQuery.trackId = this._source.libraryId;
+ loadPromise = this.loadGenres(Queries.GenresQueryMediaType.album).then(function(genresResult) {
+ albumGenres = genresResult;
+ return _this.executeGenresQuery(Queries.GenresQueryMediaType.track)
+ }).then(function(genresResult) {
+ trackGenres = genresResult;
+ return trackQuery.execute()
+ }).then(function() {
+ track = (trackQuery.result && trackQuery.result.item);
+ albumQuery.albumId = track && track.album && track.album.libraryId;
+ return albumQuery.execute()
+ }).then(function() {
+ album = (albumQuery.result && albumQuery.result.item);
+ tracksField = new ViewModels.MetadataSavableCollection(new ViewModels.MediaMetadataCollectionConverter("trackMetadata", Platform.FieldMask.tracks_BIT_MASK));
+ var albumTrackEditor = new AlbumTrackMetadataEditor(track);
+ albumTrackEditor.genres = trackGenres;
+ albumTrackEditor.allowUnchangedSaved = true;
+ tracksField.dataSource.push(albumTrackEditor);
+ return albumTrackEditor.load()
+ }).then(function() {
+ var itemsChangedPromise = _this._blockOnItemsChange();
+ var trackField = tracksField.dataSource[0];
+ _this.items = {
+ albumName: new ViewModels.MetadataValueField(album.name, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_TITLE, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "title", Platform.FieldMask.title_BIT_MASK)), albumSortName: new ViewModels.MetadataValueField(album.sortName, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_TITLE, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "sortTitle", Platform.FieldMask.sort_TITLE_BIT_MASK)), albumArtistName: new ViewModels.MetadataValueField(album.artist ? album.artist.name : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_ARTIST, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "artist", Platform.FieldMask.artist_BIT_MASK)), albumArtistSortName: new ViewModels.MetadataValueField(album.artist ? album.artist.sortName : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_ARTIST, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "sortArtist", Platform.FieldMask.sort_ARTIST_BIT_MASK)), albumYear: new ViewModels.MetadataValueField(album.releaseDate ? album.releaseDate.getUTCFullYear() + String.empty : String.empty, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_RELEASE_YEAR, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.year, "releaseDate", Platform.FieldMask.release_DATE_BIT_MASK)), albumGenre: new ViewModels.MetadataMultipleValuesField(album.genreName, albumGenres, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE, String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE_CUSTOM, new ViewModels.MediaMetadataFieldConverter(ViewModels.MediaMetadataType.stringValue, "genre", Platform.FieldMask.genre_BIT_MASK)), tracks: tracksField, track: trackField
+ };
+ trackQuery.dispose();
+ albumQuery.dispose();
+ return itemsChangedPromise
+ }, function(error) {
+ trackQuery.dispose();
+ albumQuery.dispose();
+ return WinJS.Promise.wrapError(error)
+ })
+ }
+ return WinJS.Promise.as(loadPromise)
+ };
+ return TrackMetadataEditor
+ })(ViewModels.MusicMetadataEditor);
+ ViewModels.TrackMetadataEditor = TrackMetadataEditor;
+ var TrackMetadataEditorConverter = (function(_super) {
+ __extends(TrackMetadataEditorConverter, _super);
+ function TrackMetadataEditorConverter(libraryId) {
+ _super.call(this);
+ this._libraryId = libraryId
+ }
+ TrackMetadataEditorConverter.prototype._onStart = function() {
+ var trackMetadata = new Platform.TrackMetadata;
+ trackMetadata.requestId = this._libraryId + String.empty;
+ this._destination = new ViewModels.MediaMetadataDestination(trackMetadata)
+ };
+ TrackMetadataEditorConverter.prototype._onEnd = function() {
+ return WinJS.Promise.as()
+ };
+ return TrackMetadataEditorConverter
+ })(ViewModels.MediaMetadataEditorConverter);
+ ViewModels.TrackMetadataEditorConverter = TrackMetadataEditorConverter;
+ var TrackToAlbumMetadataEditorConverter = (function(_super) {
+ __extends(TrackToAlbumMetadataEditorConverter, _super);
+ function TrackToAlbumMetadataEditorConverter(libraryId) {
+ _super.call(this);
+ this._libraryId = libraryId
+ }
+ TrackToAlbumMetadataEditorConverter.prototype._onStart = function() {
+ var albumMetadata = new Platform.AlbumMetadata;
+ this._destination = new ViewModels.MediaMetadataDestination(albumMetadata)
+ };
+ TrackToAlbumMetadataEditorConverter.prototype._onEnd = function() {
+ var promise = null;
+ if (Utilities.isValidLibraryId(this._libraryId) && this._destination && this._destination instanceof ViewModels.MediaMetadataDestination) {
+ var destination = this._destination;
+ var mediaStore = new Platform.MediaStore;
+ var trackProvider = mediaStore.trackProvider;
+ promise = trackProvider.updateTracksMetadataAsync(destination.value, Platform.RequestType.userEditRequest).then(function(){})
+ }
+ return WinJS.Promise.as(promise)
+ };
+ return TrackToAlbumMetadataEditorConverter
+ })(ViewModels.MediaMetadataEditorConverter);
+ ViewModels.TrackToAlbumMetadataEditorConverter = TrackToAlbumMetadataEditorConverter
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/components/music1/musicmetadataeditdialog.js:2070 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var MusicMetadataEditDialogContent = (function(_super) {
+ __extends(MusicMetadataEditDialogContent, _super);
+ function MusicMetadataEditDialogContent() {
+ _super.apply(this, arguments)
+ }
+ MusicMetadataEditDialogContent.prototype.initialize = function() {
+ var _this = this;
+ _super.prototype.initialize.call(this);
+ var sortToggleSwitchElement = this.domElement.querySelector(".sortToggleSwitch-toggleSwitch");
+ if (sortToggleSwitchElement) {
+ this._sortToggleSwitch = sortToggleSwitchElement.winControl;
+ this._sortToggleSwitchEventHandler = MS.Entertainment.Utilities.addEventHandlers(sortToggleSwitchElement, {change: function() {
+ return _this._updateSortsEnabled()
+ }})
+ }
+ var metadataList = this.domElement.querySelector("[data-ent-type='metadataList']");
+ if (metadataList)
+ this._list = metadataList.winControl
+ };
+ Object.defineProperty(MusicMetadataEditDialogContent.prototype, "dataContext", {
+ get: function() {
+ return this._dataContext
+ }, set: function(value) {
+ this.updateAndNotify("dataContext", value)
+ }, enumerable: true, configurable: true
+ });
+ MusicMetadataEditDialogContent.prototype._updateSortsEnabled = function() {
+ var _this = this;
+ if (this.dataContext && this._sortToggleSwitch)
+ this.dataContext.showSorts = this._sortToggleSwitch.checked;
+ if (this._list) {
+ this._list.recalculateSize();
+ WinJS.Promise.timeout().done(function() {
+ _this._list.recalculateSize()
+ })
+ }
+ };
+ return MusicMetadataEditDialogContent
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.MusicMetadataEditDialogContent = MusicMetadataEditDialogContent
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MusicMetadataEditDialogContent)
+})();
+/* >>>>>>/components/music1/albummetadataeditdialog.js:2138 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var AlbumMetadataEditDialogContent = (function(_super) {
+ __extends(AlbumMetadataEditDialogContent, _super);
+ function AlbumMetadataEditDialogContent(element, options) {
+ this.templateStorage = "/Components/Music1/AlbumMetadataEditDialog.html";
+ this.templateName = "templateid-metadataEditorDialogContent";
+ _super.call(this, element, options)
+ }
+ return AlbumMetadataEditDialogContent
+ })(Controls.MusicMetadataEditDialogContent);
+ Controls.AlbumMetadataEditDialogContent = AlbumMetadataEditDialogContent
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.AlbumMetadataEditDialogContent)
+})();
+/* >>>>>>/components/music1/trackmetadataeditdialog.js:2176 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var TrackMetadataEditDialogContent = (function(_super) {
+ __extends(TrackMetadataEditDialogContent, _super);
+ function TrackMetadataEditDialogContent(element, options) {
+ this.templateStorage = "/Components/Music1/TrackMetadataEditDialog.html";
+ this.templateName = "templateid-metadataEditorDialogContent";
+ _super.call(this, element, options)
+ }
+ return TrackMetadataEditDialogContent
+ })(Controls.MusicMetadataEditDialogContent);
+ Controls.TrackMetadataEditDialogContent = TrackMetadataEditDialogContent
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.TrackMetadataEditDialogContent)
+})();
diff --git a/packages/microsoft.zunemusic/CollectionPageTemplate_merged.js b/packages/microsoft.zunemusic/CollectionPageTemplate_merged.js
new file mode 100644
index 00000000..b215988d
--- /dev/null
+++ b/packages/microsoft.zunemusic/CollectionPageTemplate_merged.js
@@ -0,0 +1,60 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/components/music/cloudmatchicondialog.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Music");
+ WinJS.Namespace.define("MS.Entertainment.Music", {CloudMatchIcon: MS.Entertainment.UI.Framework.defineUserControl("Components/Music/CloudMatchIconDialog.html#cloudMatchIconTemplate", function cloudMatchIcon(element, options) {
+ this._closeButton = WinJS.Binding.as({
+ title: String.load(String.id.IDS_MUSIC_CLOUD_ICON_CLOSE_BUTTON), isEnabled: true, isAvailable: true, execute: function onClose() {
+ this._onClose()
+ }.bind(this)
+ });
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser.isSubscription) {
+ this.streamingParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_XMP);
+ this.streamingParagraphTwoText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_XMP);
+ this.noneParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_NONE_PARA_1);
+ this.cloudParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_XMP)
+ }
+ else {
+ this.streamingParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_FREE);
+ this.streamingParagraphTwoText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_FREE);
+ this.streamingMoreInfoLink = String.load(String.id.IDS_MUSIC_CLOUD_ICON_STREAM_LINK);
+ this.noneParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_NONE_PARA_1);
+ this.cloudParagraphOneText = String.load(String.id.IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_FREE)
+ }
+ var featureEnablement = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.featureEnablement);
+ var devicesEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.devicesEnabled);
+ var cloudEnabledRegion = (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection)).isAvailable;
+ this._hideCloud = !cloudEnabledRegion || devicesEnabled;
+ if (this._hideCloud)
+ this.streamingParagraphTwoText = String.empty
+ }, {
+ _closeButton: null, _container: null, _hideCloud: false, streamingParagraphOneText: String.empty, streamingParagraphTwoText: String.empty, noneParagraphOneText: String.empty, cloudParagraphOneText: String.empty, setOverlay: function setOverlay(container) {
+ this._container = container;
+ container.buttons = [this._closeButton];
+ if (this._hideCloud)
+ WinJS.Utilities.addClass(this.iconColumn2, "removeFromDisplay")
+ }, _onClose: function _onClose() {
+ this._container.hide()
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Music", {cloudMatchIconDialog: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Dialog", "Components/Music/CloudMatchIconDialog.html#dialogTemplate", null, {}, null, {
+ _dialog: null, show: function show() {
+ var options = {
+ width: "900px", height: "700px", cancelButtonIndex: 0, defaultButtonIndex: 0, title: String.load(String.id.IDS_MUSIC_CLOUD_ICON_HEADER), userControl: "MS.Entertainment.Music.CloudMatchIcon", userControlOptions: {}, persistOnNavigate: false
+ };
+ if (!this._dialog) {
+ this._dialog = new MS.Entertainment.Music.cloudMatchIconDialog(document.createElement("div"), options);
+ return this._dialog.show().then(function dialogClosed() {
+ this._dialog = null
+ }.bind(this))
+ }
+ else
+ return WinJS.Promise.wrap()
+ }
+ })})
+})()
+})();
diff --git a/packages/microsoft.zunemusic/Components/Accounts/AcceptTermsOfService.js b/packages/microsoft.zunemusic/Components/Accounts/AcceptTermsOfService.js
new file mode 100644
index 00000000..c04402e1
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Accounts/AcceptTermsOfService.js
@@ -0,0 +1,33 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.Accounts", {AcceptTermsOfService: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.WebHostExperience", function AcceptTermsOfService_constructor() {
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.constructor.call(this)
+ }, {
+ startListener: function startListener() {
+ if (!this.disposed)
+ this.eventProvider.traceAcceptTermsOfService_Start("");
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.startListener.apply(this, arguments)
+ }, messageReceived: function messageReceived(messageStruct, webHost, sendMessageFunc) {
+ if (!this.disposed)
+ switch (messageStruct.verb) {
+ case"CLOSE_DIALOG":
+ if (messageStruct.reason === "SUCCESS")
+ this.eventProvider.traceAcceptTermsOfService_Finish("");
+ else if (messageStruct.reason === "CANCEL")
+ this.eventProvider.traceAcceptTermsOfService_Cancel("");
+ break
+ }
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.messageReceived.apply(this, arguments)
+ }
+ }, {doAcceptTermsOfService: function doAcceptTermsOfService() {
+ var url = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_ModernPurchase) + "/acceptTou?client=x13";
+ var experience = new MS.Entertainment.Accounts.AcceptTermsOfService;
+ return MS.Entertainment.UI.Shell.showWebHostDialog("TOS", {
+ desiredLeft: "0%", desiredTop: null, desiredHeight: (new Microsoft.Entertainment.Configuration.ConfigurationManager).service.modernWebBlendHeight, showBackButton: false, showCancelButton: false, desiredZIndex: 1002
+ }, {
+ sourceUrl: "", signInOverride: true, authenticatedSourceUrl: url, webHostExperience: experience, taskId: MS.Entertainment.UI.Controls.WebHost.TaskId.TOU, isDialog: true
+ })
+ }})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Accounts/AccountProvisioningDialog.html b/packages/microsoft.zunemusic/Components/Accounts/AccountProvisioningDialog.html
new file mode 100644
index 00000000..29b8b5f9
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Accounts/AccountProvisioningDialog.html
@@ -0,0 +1,48 @@
+
+
+
+
+ Account Provisioning Dialog Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Accounts/AccountProvisioningDialog.js b/packages/microsoft.zunemusic/Components/Accounts/AccountProvisioningDialog.js
new file mode 100644
index 00000000..4fbde250
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Accounts/AccountProvisioningDialog.js
@@ -0,0 +1,192 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var Accounts;
+ (function(Accounts) {
+ var AccountProvisioningDialog = (function(_super) {
+ __extends(AccountProvisioningDialog, _super);
+ function AccountProvisioningDialog(element, options) {
+ this.templateStorage = "/Components/Accounts/AccountProvisioningDialog.html";
+ this.templateName = "accountProvisioningDialog";
+ this._actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ _super.call(this, element, options)
+ }
+ AccountProvisioningDialog.prototype.initialize = function() {
+ var _this = this;
+ this._emailAccountContainer.textContent = String.load(String.id.IDS_PROVISIONING_USER_EMAIL).format(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).getToBeProvisionedUserName());
+ WinJS.Promise.timeout(100).done(function() {
+ MS.Entertainment.UI.Framework.focusElement(_this._alreadyHaveAccountButton)
+ })
+ };
+ AccountProvisioningDialog.prototype.setOverlay = function(dialog) {
+ this._hostDialog = dialog
+ };
+ AccountProvisioningDialog.prototype.alreadyHaveAccountClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ this._xboxAccountExplanation.textContent = String.load(String.id.IDS_PROVISIONING_ALREADY_HAVE_DESC);
+ WinJS.Utilities.removeClass(this._xboxAccountExplanation, "removeFromDisplay")
+ };
+ AccountProvisioningDialog.prototype.termsOfServiceLinkClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var externalNavigationAction = this._actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBox) + "/legal/LiveTOU";
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.accountProvisioningTOS;
+ externalNavigationAction.execute()
+ };
+ AccountProvisioningDialog.prototype.privacyStatementClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var externalNavigationAction = this._actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = "http://go.microsoft.com/fwlink/?LinkID=259655";
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.accountProvisioningPrivacy;
+ externalNavigationAction.execute()
+ };
+ AccountProvisioningDialog.prototype.acceptClicked = function() {
+ if (this._hostDialog && this._hostDialog.buttons && this._hostDialog.buttons.length === 2) {
+ this._hostDialog.buttons[0].isEnabled = false;
+ this._hostDialog.buttons[1].isEnabled = false;
+ this._hostDialog.buttons[0].isDisabled = true;
+ this._hostDialog.buttons[1].isDisabled = true
+ }
+ if (this.progressSpinner)
+ WinJS.Utilities.removeClass(this.progressSpinner, "removeFromDisplay")
+ };
+ AccountProvisioningDialog.showAccountProvisioningDialog = function() {
+ var completionSignal = new MS.Entertainment.UI.Framework.Signal;
+ var controlOptions = {
+ defaultButtonIndex: -1, cancelButtonIndex: 1, persistOnNavigate: true, buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_PROVISIONING_ACCEPT_BUTTON), execute: function(d) {
+ if (d && d.overlayContent && d.overlayContent.winControl) {
+ if (d.overlayContent.winControl._dismissPromiseCompleting)
+ return;
+ d.overlayContent.winControl.acceptClicked();
+ d.overlayContent.winControl._dismissPromiseCompleting = true
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).provisionUserAccount().done(function() {
+ AccountProvisioningDialog.sendTelemetry("SUCCESS");
+ d.hide();
+ completionSignal.complete()
+ }, function(error) {
+ AccountProvisioningDialog.sendTelemetry("ERROR", error);
+ d.hide();
+ completionSignal.error(error)
+ })
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_PROVISIONING_CANCEL_BUTTON), execute: function(d) {
+ AccountProvisioningDialog.sendTelemetry("CANCEL");
+ if (d && d.overlayContent && d.overlayContent.winControl) {
+ if (d.overlayContent.winControl._dismissPromiseCompleting)
+ return;
+ d.overlayContent.winControl._dismissPromiseCompleting = true
+ }
+ d.hide();
+ completionSignal.complete()
+ }
+ })]
+ };
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_PROVISIONING_TITLE), "MS.Entertainment.Accounts.AccountProvisioningDialog", controlOptions).done(null, function(error) {
+ MS.Entertainment.fail("Error showing Account Provisioning Dialog: " + (error && error.message));
+ completionSignal.complete()
+ });
+ return completionSignal.promise
+ };
+ AccountProvisioningDialog.sendTelemetry = function(result, error) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Result, parameterValue: result
+ }];
+ if (error && error.number)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, parameterValue: error.number
+ });
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.AccountCreation, telemetryParameterArray)
+ };
+ return AccountProvisioningDialog
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Accounts.AccountProvisioningDialog = AccountProvisioningDialog;
+ var ChildAccountProvisioningDialog = (function(_super) {
+ __extends(ChildAccountProvisioningDialog, _super);
+ function ChildAccountProvisioningDialog(element, options) {
+ this.templateStorage = "/Components/Accounts/AccountProvisioningDialog.html";
+ this.templateName = "childAccountProvisioningDialog";
+ this._actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ _super.call(this, element, options)
+ }
+ ChildAccountProvisioningDialog.prototype.initialize = function() {
+ var _this = this;
+ var decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ decimalFormatter.fractionDigits = 0;
+ var numberOne = decimalFormatter.format(1);
+ var numberTwo = decimalFormatter.format(2);
+ var numberThree = decimalFormatter.format(3);
+ this._xboxSiteLink.textContent = String.load(String.id.IDS_PROVISIONING_CHILD_LIST_XBOX_LINK).format(numberOne);
+ this._comeBackText.textContent = String.load(String.id.IDS_PROVISIONING_CHILD_LIST_COMEBACK).format(numberTwo);
+ this._signInLink.textContent = String.load(String.id.IDS_PROVISIONING_CHILD_LIST_SIGNIN).format(numberThree);
+ WinJS.Promise.timeout(100).done(function() {
+ MS.Entertainment.UI.Framework.focusElement(_this._xboxSiteLink)
+ })
+ };
+ ChildAccountProvisioningDialog.prototype.setOverlay = function(dialog) {
+ this._hostDialog = dialog
+ };
+ ChildAccountProvisioningDialog.prototype.xboxSiteLinkClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var webLink = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/Flows/BeginFlow.ashx?workflow=AccountCreation";
+ var externalNavigationAction = this._actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = webLink;
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.accountProvisioningChildWebLink;
+ externalNavigationAction.execute();
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: this._xboxSiteLink}, {
+ uri: "childAccountProvisioningInfoDialog", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ }, {
+ uri: webLink, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.WebPage
+ })
+ };
+ ChildAccountProvisioningDialog.prototype.signInClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: this._signInLink}, {
+ uri: "childAccountProvisioningInfoDialog", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ });
+ this._hostDialog.hide()
+ };
+ ChildAccountProvisioningDialog.showChildAccountProvisioningDialog = function() {
+ var completionSignal = new MS.Entertainment.UI.Framework.Signal;
+ var controlOptions = {
+ defaultButtonIndex: -1, cancelButtonIndex: 0, persistOnNavigate: true, buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_PROVISIONING_CANCEL_BUTTON), execute: function(d) {
+ d.hide()
+ }
+ })]
+ };
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_PROVISIONING_CHILD_TITLE), "MS.Entertainment.Accounts.ChildAccountProvisioningDialog", controlOptions).done(function() {
+ completionSignal.complete()
+ }, function(error) {
+ MS.Entertainment.fail("Error showing Account Provisioning Dialog: " + (error && error.message));
+ completionSignal.complete()
+ });
+ return completionSignal.promise
+ };
+ return ChildAccountProvisioningDialog
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Accounts.ChildAccountProvisioningDialog = ChildAccountProvisioningDialog;
+ WinJS.Utilities.markSupportedForProcessing(ChildAccountProvisioningDialog);
+ WinJS.Utilities.markSupportedForProcessing(AccountProvisioningDialog)
+ })(Accounts = Entertainment.Accounts || (Entertainment.Accounts = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunemusic/Components/BaseTransferNotificationHandler.js b/packages/microsoft.zunemusic/Components/BaseTransferNotificationHandler.js
new file mode 100644
index 00000000..8d3db62a
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/BaseTransferNotificationHandler.js
@@ -0,0 +1,165 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/FileTransferNotificationService.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {BaseFileTransferNotificationHandlers: MS.Entertainment.UI.Framework.define(function BaseFileTransferNotificationHandlersConstructor() {
+ this.errorPopoverMediaId = null;
+ this.currentDownloads = {};
+ this.trackDownloads = 0;
+ this.currentPaused = {};
+ this.trackPaused = 0;
+ this.downloadErrorsEncountered = false;
+ this.updateTimer = null;
+ this.preventMoreDownloadPausedNotification = false
+ }, {
+ trackDownloadUpdate: function trackDownloadUpdate(eventInfo) {
+ MS.Entertainment.UI.assert(!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.mediaId) || eventInfo.task.libraryId > 0, "task object had an invalid identifiers: mediaId: {0}, libraryId {1}".format(eventInfo.task.mediaId, eventInfo.task.libraryId));
+ var mediaIdentifier = this._getMediaIdentifierFromTask(eventInfo.task);
+ var itemIsDownloading = false;
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ switch (eventInfo.task.taskStatus) {
+ case Microsoft.Entertainment.FileTransferStatus.error:
+ case Microsoft.Entertainment.FileTransferStatus.canceled:
+ case Microsoft.Entertainment.FileTransferStatus.completed:
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--
+ }
+ if (this.currentPaused[mediaIdentifier]) {
+ delete this.currentPaused[mediaIdentifier];
+ this.trackPaused--
+ }
+ itemIsDownloading = false;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.paused:
+ case Microsoft.Entertainment.FileTransferStatus.pausedCostedNetwork:
+ case Microsoft.Entertainment.FileTransferStatus.pausedNoNetwork:
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--
+ }
+ if (!this.currentPaused[mediaIdentifier]) {
+ this.currentPaused[mediaIdentifier] = true;
+ this.trackPaused++
+ }
+ itemIsDownloading = true;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.running:
+ if (this.trackDownloads === 0)
+ this.downloadErrorsEncountered = false;
+ if (!this.currentDownloads[mediaIdentifier]) {
+ this.currentDownloads[mediaIdentifier] = true;
+ this.trackDownloads++
+ }
+ itemIsDownloading = true;
+ break
+ }
+ fileTransferNotifications.setItemError(mediaIdentifier, 0);
+ fileTransferNotifications.setItemTransferState(mediaIdentifier, MS.Entertainment.UI.FileTransferNotificationService.Event.download, itemIsDownloading);
+ this._startNotificationTimer()
+ }, trackDownloadError: function trackDownloadError(eventInfo) {
+ MS.Entertainment.UI.assert(!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.mediaId) || eventInfo.task.libraryId > 0, "task object had an invalid identifiers: mediaId: {0}, libraryId {1}".format(eventInfo.task.mediaId, eventInfo.task.libraryId));
+ this.downloadErrorsEncountered = true;
+ this._setDownloadErrorEventInfo(eventInfo);
+ if (eventInfo.task.isClosed)
+ this._clearDownloadEventInfo(eventInfo)
+ }, startTransferListener: function startTransferListener() {
+ var trackDownloadNotifiers = {
+ add: this.trackDownloadUpdate.bind(this), cancel: this.trackDownloadUpdate.bind(this), complete: this.trackDownloadUpdate.bind(this), update: this.trackDownloadUpdate.bind(this), error: this.trackDownloadError.bind(this)
+ };
+ var trackTaskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true);
+ var handler = {
+ notifier: trackDownloadNotifiers, taskKeyGetter: trackTaskKeyGetter
+ };
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ fileTransferNotifications.startListening(handler)
+ }, _clearDownloadEventInfo: function _clearDownloadEventInfo(eventInfo) {
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ var appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.mediaId)) {
+ fileTransferNotifications.setItemTransferState(eventInfo.task.mediaId, MS.Entertainment.UI.FileTransferNotificationService.Event.download, false);
+ fileTransferNotifications.setItemError(eventInfo.task.mediaId, 0)
+ }
+ if (eventInfo.task.libraryId >= 0) {
+ fileTransferNotifications.setItemTransferState(eventInfo.task.libraryId, MS.Entertainment.UI.FileTransferNotificationService.Event.download, false);
+ fileTransferNotifications.setItemError(eventInfo.task.libraryId, 0)
+ }
+ }, _setDownloadErrorEventInfo: function _setDownloadErrorEventInfo(eventInfo) {
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ var mediaIdentifier = this._getMediaIdentifierFromTask(eventInfo.task);
+ fileTransferNotifications.setItemTransferState(mediaIdentifier, MS.Entertainment.UI.FileTransferNotificationService.Event.download, false);
+ fileTransferNotifications.setItemError(mediaIdentifier, eventInfo.task.responseCode);
+ var startNotificationTimer = false;
+ if (this.currentPaused[mediaIdentifier]) {
+ delete this.currentPaused[mediaIdentifier];
+ this.trackPaused--;
+ startNotificationTimer = true
+ }
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--;
+ startNotificationTimer = true
+ }
+ if (startNotificationTimer)
+ this._startNotificationTimer()
+ }, _getMediaIdentifierFromTask: function _getMediaIdentifierFromTask(transferTask) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(transferTask.mediaId) ? transferTask.mediaId : transferTask.libraryId
+ }, _startNotificationTimer: function _startNotificationTimer() {
+ if (!this.updateTimer)
+ this.updateTimer = WinJS.Promise.timeout(1000).then(function updateTrackNotifications() {
+ this._updateTrackDownloadNotification();
+ this.updateTimer = null
+ }.bind(this))
+ }, _updateTrackDownloadNotification: function _updateTrackDownloadNotification() {
+ var appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ var removeNotification = false;
+ var notification;
+ var notificationType = MS.Entertainment.UI.Notification.Type.Informational;
+ var title = String.empty;
+ var subTitle = String.empty;
+ var icon = WinJS.UI.AppBarIcon.download;
+ var category = this.Type.TrackDownloadInformational;
+ var isPersistent = false;
+ var skipNotification = false;
+ var clickAction = (MS.Entertainment.Utilities.isVideoApp1 ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showVideoDownloadManager) : null);
+ var currentDownloads = this.trackDownloads;
+ var currentPaused = this.trackPaused;
+ if (currentDownloads > 0) {
+ var numberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var formattedCount = numberFormatter.format(currentDownloads);
+ title = this._downloadNotification;
+ subTitle = MS.Entertainment.Utilities.Pluralization.getPluralizedString(this._downloadInProgressString, currentDownloads).format(formattedCount);
+ isPersistent = true;
+ this.preventMoreDownloadPausedNotification = false
+ }
+ else if (currentPaused > 0)
+ if (this.preventMoreDownloadPausedNotification)
+ skipNotification = true;
+ else {
+ title = String.load(String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT);
+ this.preventMoreDownloadPausedNotification = true
+ }
+ else {
+ title = this._downloadComplete;
+ removeNotification = this.downloadErrorsEncountered;
+ this.downloadErrorsEncountered = false;
+ this.preventMoreDownloadPausedNotification = false;
+ if (MS.Entertainment.UI.CollectionChangeNotifierService) {
+ MS.Entertainment.UI.CollectionChangeNotifierService.blockGlobalCollectionChangeEvents = false;
+ MS.Entertainment.UI.CollectionChangeNotifierService.blockGlobalCollectionUpSyncEvents = false
+ }
+ }
+ if (!skipNotification) {
+ notification = new MS.Entertainment.UI.Notification({
+ notificationType: notificationType, title: title, subTitle: subTitle, icon: icon, category: category, isPersistent: isPersistent, action: clickAction, dismissOnSignOut: true
+ });
+ if (!removeNotification)
+ appNotificationService.send(notification);
+ else
+ appNotificationService.removeNotificationByCategory(notification.category)
+ }
+ }, Type: {
+ TrackDownloadInformational: "TrackDownloadInformational", AlbumDownloadError: "AlbumDownloadError"
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Immersive.html b/packages/microsoft.zunemusic/Components/Immersive/Immersive.html
new file mode 100644
index 00000000..dbf76907
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Immersive.html
@@ -0,0 +1,109 @@
+
+
+
+
+ Immersive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Immersive.js b/packages/microsoft.zunemusic/Components/Immersive/Immersive.js
new file mode 100644
index 00000000..e2ab0145
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Immersive.js
@@ -0,0 +1,385 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/corefx.js", "/Framework/serviceLocator.js", "/Framework/utilities.js", "/ViewModels/MediaItemModel.js");
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {Immersive: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Immersive.html#immersiveTemplate", function immersiveConstructor(element, options) {
+ this._navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._page = this._navigationService.currentPage;
+ this.options = this._page.options || {};
+ this.options.panelOptions = this.options.panelOptions || {};
+ this.options.initialFrame = -1;
+ this.options.completeCallback = this.options.completeCallback || null;
+ var mediaItem = this.options.mediaItem;
+ if (mediaItem) {
+ if (mediaItem.serviceType === MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem)
+ mediaItem = MS.Entertainment.Utilities.convertEditorialItem(mediaItem);
+ this.mediaItem = Array.isArray(mediaItem) ? mediaItem : MS.Entertainment.ViewModels.MediaItemModel.augment(mediaItem)
+ }
+ this._uiStateService.nowPlayingInset = !this.options.startFullScreen;
+ this._uiStateService.nowPlayingVisible = this.options.startFullScreen || !!this.options.sessionId;
+ if (MS.Entertainment.Utilities.isApp2) {
+ this._previousVoicePhrase = String.load(String.id.IDS_PREVIOUS_PAGE_VUI_ALM);
+ this._previousVoicePhoneticPhrase = String.load(String.id.IDS_PREVIOUS_PAGE_VUI_PRON);
+ this._previousVoiceConfidence = String.load(String.id.IDS_PREVIOUS_PAGE_VUI_CONF);
+ this._nextVoicePhrase = String.load(String.id.IDS_NEXT_PAGE_VUI_ALM);
+ this._nextVoicePhoneticPhrase = String.load(String.id.IDS_NEXT_PAGE_VUI_PRON);
+ this._nextVoiceConfidence = String.load(String.id.IDS_NEXT_PAGE_VUI_CONF)
+ }
+ }, {
+ _initialized: false, _playbackSessionBindings: null, _bindings: null, _page: null, _playbackSession: null, _initialFocusSet: false, _navigationBindings: null, _selectionEventBindings: null, _galleryEventBindings: null, _selectionManager: null, _hideFirstPivot: false, _navigationService: null, _uiStateService: null, _restorePlaybackState: null, _previousVoiceConfidence: null, _previousVoicePhrase: null, _previousVoicePhoneticPhrase: null, _nextVoiceConfidence: null, _nextVoicePhrase: null, _nextVoicePhoneticPhrase: null, _maxVoiceScrollStyle: "maxScrolled", _scrollEventHandler: null, initialize: function initialize() {
+ var createPageTitle = this.mediaItem && (MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isMusicApp2);
+ var createSecondaryTitle = this.mediaItem && MS.Entertainment.Utilities.isVideoApp;
+ if (createPageTitle)
+ this._createPageTitle();
+ if (createSecondaryTitle)
+ this._createSecondaryTitle();
+ if (MS.Entertainment.Utilities.isMusicApp1 && !this._selectionManager)
+ this._selectionManager = new MS.Entertainment.UI.Controls.AppBarSelectionManager(this.domElement);
+ var hubStripVisibleEvent = document.createEvent("Event");
+ hubStripVisibleEvent.initEvent("HubStripVisible", true, true);
+ if (this.domElement)
+ this.domElement.dispatchEvent(hubStripVisibleEvent);
+ if (this.mediaItem)
+ this._updateMetaData(this.mediaItem);
+ else if (!this._uiStateService.isSnapped)
+ MS.Entertainment.UI.Controls.assert(false, "Immersive details not supplied with a mediaItem.");
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ this._scrollEventHandler = MS.Entertainment.UI.Framework.addEventHandlers(this._scroller, {scroll: function immersive_scroll() {
+ if (this._uiStateService.isSnapped)
+ this._scroller.scrollLeft = 0
+ }.bind(this)});
+ this._bindings = WinJS.Binding.bind(this, {
+ _uiStateService: {
+ nowPlayingInset: function nowPlayingInsetChanged(newVal, oldVal) {
+ if (!this.frozen) {
+ if (!newVal && oldVal !== undefined)
+ this._bringFrameIntoView(0, true);
+ else if (newVal && !oldVal && oldVal !== undefined && !this._uiStateService.nowPlayingVisible) {
+ var frame = this.frameViewModel.frames.item(1);
+ if (frame)
+ this._focusFrame(frame)
+ }
+ if (newVal) {
+ WinJS.Utilities.removeClass(this.immersiveControl.domElement, "immersiveDetailsHubStripNoScroll");
+ WinJS.Utilities.removeClass(this.immersiveControl.domElement, "hideBackground")
+ }
+ else {
+ WinJS.Utilities.addClass(this.immersiveControl.domElement, "immersiveDetailsHubStripNoScroll");
+ WinJS.Utilities.addClass(this.immersiveControl.domElement, "hideBackground")
+ }
+ }
+ }.bind(this), isSnapped: function isSnappedChanged(newVal, oldVal) {
+ if (newVal) {
+ this.immersiveControl.domElement.style.overflow = "hidden";
+ this._scroller.style.overflow = "hidden";
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this._bringFrameIntoView(0, true);
+ this._clearItemControlSelection()
+ }
+ else if (oldVal !== undefined) {
+ this.immersiveControl.domElement.style.overflow = String.empty;
+ this._scroller.style.overflow = String.empty
+ }
+ }.bind(this)
+ }, _page: {options: this._pageOptionsChanged.bind(this)}
+ });
+ if (MS.Entertainment.Utilities.isApp2)
+ this._attachApp2Handlers();
+ if (this.options.sessionId) {
+ this._playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).getSession(this.options.sessionId);
+ this._playbackSessionBindings = WinJS.Binding.bind(this, {_playbackSession: {currentMedia: function onCurrentMediaChanged(currentMedia, oldMedia) {
+ if (currentMedia && oldMedia && !currentMedia.isEqual(oldMedia) && MS.Entertainment.Platform.PlaybackHelpers.isAnyMusic(currentMedia))
+ this._updateMetaData(currentMedia)
+ }.bind(this)}})
+ }
+ this._initialized = true
+ }, _clearItemControlSelection: function _clearItemControlSelection() {
+ if (this._selectionManager)
+ this._selectionManager.clearSelection()
+ }, _detachBindings: function _detachBindings() {
+ this._detachPlaybackSessionBindings();
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }, _detachPlaybackSessionBindings: function _detachPlaybackSessionBindings() {
+ if (this._playbackSessionBindings) {
+ this._playbackSessionBindings.cancel();
+ this._playbackSessionBindings = null
+ }
+ }, unload: function unload() {
+ this._detachBindings();
+ if (this._scrollEventHandler) {
+ this._scrollEventHandler.cancel();
+ this._scrollEventHandler = null
+ }
+ if (this._pageScroller) {
+ this._pageScroller.dispose();
+ this._pageScroller = null
+ }
+ this._unshareMediaItem();
+ if (this.mediaItem) {
+ if (this.mediaItem.liveQuery && this.mediaItem.liveQuery.dispose)
+ this.mediaItem.liveQuery.dispose();
+ this.mediaItem.liveQuery = null
+ }
+ if (this.frameViewModel && this.frameViewModel.dispose)
+ this.frameViewModel.dispose();
+ if (this._selectionManager) {
+ this._selectionManager.dispose();
+ this._selectionManager = null
+ }
+ if (this._galleryEventBindings) {
+ this._galleryEventBindings.cancel();
+ this._galleryEventBindings = null
+ }
+ if (this._navigationBindings) {
+ this._navigationBindings.cancel();
+ this._navigationBindings = null
+ }
+ this._clearItemControlSelection();
+ if (this._restorePlaybackState)
+ this._restorePlaybackState.cancel();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function immersive_freeze() {
+ var appBar;
+ this.frozen = true;
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible)
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible = false;
+ appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.repossessNowPlaying)
+ appBar.repossessNowPlaying()
+ }
+ if (this.frameViewModel && this.frameViewModel.freeze)
+ this.frameViewModel.freeze();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function immersive_thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this.frozen = false;
+ if (this.frameViewModel && this.frameViewModel.thaw)
+ this.frameViewModel.thaw()
+ }, _createPageTitle: function _createPageTitle() {
+ var pageTitleContainer = document.createElement("div");
+ WinJS.Utilities.addClass(pageTitleContainer, "immersivePageTitle");
+ this._titleContainer.appendChild(pageTitleContainer);
+ var templateName = MS.Entertainment.Utilities.isVideoApp ? "/Components/Immersive/Immersive.html#immersivePageTitle" : "/Components/Immersive/Immersive.html#immersiveMediaPageTitle";
+ MS.Entertainment.UI.Framework.loadTemplate(templateName).then(function(template) {
+ return template.render(this, pageTitleContainer)
+ }.bind(this))
+ }, _createSecondaryTitle: function _createSecondaryTitle() {
+ var secondaryTitleContainer = document.createElement("div");
+ WinJS.Utilities.addClass(secondaryTitleContainer, "immersivePageTitle");
+ this._scroller.appendChild(secondaryTitleContainer);
+ var templateName = "/Components/Immersive/Immersive.html#immersiveSecondaryPageTitle";
+ MS.Entertainment.UI.Framework.loadTemplate(templateName).then(function(template) {
+ return template.render(this, secondaryTitleContainer)
+ }.bind(this))
+ }, _heroScreenRatio: 0.66, _backButtonSize: 60, _pivotOffset: 40, _attachApp2Handlers: function _attachApp2Handlers() {
+ WinJS.Utilities.removeClass(this.nextPageScroller, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.previousPageScroller, "removeFromDisplay");
+ if (this._scroller && this.immersiveControl && this.immersiveControl.domElement) {
+ this._pageScroller = new MS.Entertainment.UI.Controls.PageScroller(this._scroller, this.nextPageScroller, this.previousPageScroller, this.immersiveControl.domElement);
+ this._pageScroller.logicalContainerSelector = "[data-ent-type~='pageScrollerFrame']"
+ }
+ }, _pageOptionsChanged: function _pageOptionsChanged(newVal, oldVal) {
+ if (oldVal && ((oldVal.mediaItem.isEqual && oldVal.mediaItem.isEqual(newVal.mediaItem)) || (newVal.mediaItem.isChildOf && newVal.mediaItem.isChildOf(oldVal.mediaItem)) || (Array.isArray(newVal.mediaItem) || newVal.mediaItem.execute)))
+ if (this.frameViewModel) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset = !newVal.startFullScreen;
+ this.frameViewModel.sessionId = newVal.sessionId;
+ WinJS.Promise.timeout(250).then(function _delayLoad() {
+ this._bringFrameIntoView(0, true)
+ }.bind(this))
+ }
+ }, _updateMetaData: function _updateMetaData(mediaItem) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPart, parameterValue: MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Immersive
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPath, parameterValue: this._navigationService.getUserLocation()
+ }];
+ this.metadataMediaItem = mediaItem;
+ if (Array.isArray(mediaItem) || mediaItem.execute) {
+ if (Array.isArray(mediaItem) && mediaItem.length > 0)
+ this._updateMetaData(mediaItem[0]);
+ else if (mediaItem.execute) {
+ var queryComplete = function executeSuccess(q) {
+ if (q.result.items)
+ q.result.items.toArray().then(function(items) {
+ this._updateMetaData(items)
+ }.bind(this))
+ }.bind(this);
+ mediaItem.execute().then(queryComplete.bind(this), function queryFailed(error){})
+ }
+ return
+ }
+ var isNewViewModel = true;
+ switch (mediaItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ MS.Entertainment.UI.Controls.assert(false, "We don't support games anymore");
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(mediaItem))
+ this.frameViewModel = new MS.Entertainment.ViewModels.TvImmersiveViewModel;
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(mediaItem) && mediaItem.artist) {
+ this._convertToArtist(mediaItem);
+ return
+ }
+ else {
+ this.frameViewModel = new MS.Entertainment.ViewModels.MovieImmersiveViewModel;
+ this._hideFirstPivot = true;
+ if (mediaItem.hasZuneId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZuneId, parameterValue: mediaItem.zuneId
+ });
+ else if (mediaItem.hasCanonicalId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanonicalId, parameterValue: mediaItem.canonicalId
+ })
+ }
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ this.frameViewModel = new MS.Entertainment.ViewModels.TvImmersiveViewModel;
+ if (mediaItem.seriesId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SeriesId, parameterValue: mediaItem.seriesId
+ });
+ else if (mediaItem.hasZuneId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZuneId, parameterValue: mediaItem.zuneId
+ });
+ else if (mediaItem.hasCanonicalId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanonicalId, parameterValue: mediaItem.canonicalId
+ });
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ if (mediaItem.artistServiceId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ArtistServiceId, parameterValue: mediaItem.artistServiceId
+ });
+ else if (mediaItem.hasZuneId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZuneId, parameterValue: mediaItem.zuneId
+ });
+ else if (mediaItem.hasCanonicalId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanonicalId, parameterValue: mediaItem.canonicalId
+ });
+ if (!this.frameViewModel)
+ this.frameViewModel = new MS.Entertainment.ViewModels.ArtistImmersiveViewModel;
+ else
+ isNewViewModel = false;
+ break
+ }
+ MS.Entertainment.UI.Controls.assert(this.frameViewModel, "Immersive details didn't get a valid viewmodel.");
+ if (!this.frameViewModel || !this.frameViewModel.updateMetaData) {
+ this._navigationService.navigateToDefaultPage();
+ return
+ }
+ var hydratePromise = this.frameViewModel.updateMetaData(mediaItem, this.options.startFullScreen);
+ MS.Entertainment.UI.Controls.assert(this.frameViewModel.frames.length > 0, "Immersive details viewmodel didn't create any frames.");
+ if (!this.frameViewModel.frames.length) {
+ this._navigationService.navigateToDefaultPage();
+ return
+ }
+ if (this.frameViewModel.frames.item(0).isFullScreen === undefined)
+ this.frameViewModel.frames.item(0).addProperty("isFullScreen", this.options.startFullScreen);
+ hydratePromise.then(function mediaHydrated(mediaItem) {
+ if (mediaItem && !mediaItem.isFailed) {
+ if (this.frameViewModel.backgroundImageUri)
+ this._loadBackgroundImage(this.frameViewModel.backgroundImageUri);
+ WinJS.Promise.timeout().done(function shareMediaAfterTimeout() {
+ this._shareMediaItem(mediaItem)
+ }.bind(this));
+ this.mediaName = mediaItem.name;
+ if (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ var nameOverride = mediaItem.seriesTitle || mediaItem.primaryText || mediaItem.name;
+ if (nameOverride)
+ this.mediaName = nameOverride
+ }
+ }
+ if (this.options)
+ this.options.mediaItem = mediaItem
+ }.bind(this));
+ this.frameViewModel.sessionId = this.options.sessionId;
+ if (isNewViewModel)
+ this.frameViewModel.frames.addChangeListener(this._handleFramesChanged.bind(this));
+ this._handleFramesChanged();
+ if (this.options.completeCallback)
+ if (this.frameViewModel.handleNavigationCompleteCallback)
+ this.frameViewModel.navigationCompleteCallback = this.options.completeCallback;
+ else
+ this.options.completeCallback(true);
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ImmersiveDetailsMetaDataUpdated, telemetryParameterArray)
+ }, _handleFramesChanged: function _handleFramesChanged() {
+ WinJS.Promise.timeout().then(function() {
+ if (this.options.hub || this.options.initialFrame > 0) {
+ for (var i = 0; i < this.frameViewModel.frames.length; i++)
+ if (this.frameViewModel.frames.item(i).moniker === this.options.hub)
+ this.options.initialFrame = i;
+ if (this.options.initialFrame > -1 && this.options.initialFrame < this.frameViewModel.frames.length)
+ this._bringFrameIntoView(this.options.initialFrame, true)
+ }
+ else if (!this._initialFocusSet && this.immersiveControl && this.immersiveControl.dataSource && this.frameViewModel.frames.length > 1 && this.frameViewModel.skipInitialFocus !== true)
+ if (this._focusFrame(this.frameViewModel.frames.item(0)))
+ this._initialFocusSet = true
+ }.bind(this))
+ }, _focusFrame: function _focusFrame(frame, frameIndex) {
+ var element = this.immersiveControl.getElementForItem(frame);
+ if (element)
+ MS.Entertainment.UI.Framework.waitForControlToInitialize(element).then(function() {
+ return WinJS.Promise.timeout(700)
+ }).then(function() {
+ if (!this._scroller.isAnimatingScroll)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(element);
+ if (frameIndex !== undefined && frameIndex === this.options.initialFrame && this.options.showInitialFrameViewMore && frame.showViewMore)
+ frame.showViewMore()
+ }.bind(this));
+ return element
+ }, _bringFrameIntoView: function _bringFrameIntoView(frameIndex, focusAfterScrolling) {
+ if (this.immersiveControl && this.frameViewModel && this.frameViewModel.frames.length > 0)
+ this.immersiveControl.bringItemIntoView(this.frameViewModel.frames.item(frameIndex), {bringOnMinimally: true}).then(function() {
+ if (focusAfterScrolling)
+ this._focusFrame(this.frameViewModel.frames.item(frameIndex), frameIndex)
+ }.bind(this))
+ }, _convertToArtist: function _convertToArtist(mediaItem) {
+ mediaItem = mediaItem.artist || {};
+ mediaItem = MS.Entertainment.ViewModels.MediaItemModel.augment(mediaItem);
+ this._updateMetaData(mediaItem)
+ }, _shareMediaItem: function _shareMediaItem(overrideMediaItem) {
+ var sender = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ if (sender) {
+ overrideMediaItem = overrideMediaItem || this.mediaItem;
+ if (!this.nowPlayingVisible && overrideMediaItem) {
+ this._unshareMediaItem();
+ this._shareOperation = sender.pendingShare(overrideMediaItem)
+ }
+ }
+ }, _unshareMediaItem: function _unshareMediaItem() {
+ if (this._shareOperation) {
+ this._shareOperation.cancel();
+ this._shareOperation = null
+ }
+ }, _loadBackgroundImage: function _loadBackgroundImage(backgroundImageUri) {
+ if (backgroundImageUri)
+ MS.Entertainment.UI.Shell.ImageLoader.cacheImage(backgroundImageUri, String.empty).done(function cacheImage(url) {
+ this.backgroundImageUri = url
+ }.bind(this))
+ }
+ }, {
+ backgroundImageUri: String.empty, frameViewModel: null, options: null, mediaItem: null, metadataMediaItem: null, mediaName: String.empty, frozen: false
+ }, {makeFrame: function makeFrame(heading, columnSpan, control, viewMoreContentUrl, moniker, disableHeaderButton) {
+ if (!heading && MS.Entertainment.Utilities.isVideoApp2)
+ heading = String.load(String.id.IDS_HOME_PIVOT);
+ return WinJS.Binding.as({
+ heading: heading, visible: false, viewMoreHeading: heading, disableHeaderButton: disableHeaderButton, viewMoreSubHeading: null, title: heading, columnSpan: columnSpan, getData: null, viewMoreInfo: {
+ icon: MS.Entertainment.UI.Icon.nowPlayingNext, title: String.load(String.id.IDS_DETAILS_VIEW_MORE)
+ }, hideViewMoreIfEnoughSpace: false, overviewConstructor: control, viewMoreTemplate: viewMoreContentUrl, moniker: moniker
+ })
+ }})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/ImmersiveNavStub.html b/packages/microsoft.zunemusic/Components/Immersive/ImmersiveNavStub.html
new file mode 100644
index 00000000..0b254344
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/ImmersiveNavStub.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Immersive Details Page
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Music/ArtistOverview.html b/packages/microsoft.zunemusic/Components/Immersive/Music/ArtistOverview.html
new file mode 100644
index 00000000..90a7f2e1
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Music/ArtistOverview.html
@@ -0,0 +1,111 @@
+
+
+
+
+
+ Games Immersive Overview
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Music/ArtistOverview.js b/packages/microsoft.zunemusic/Components/Immersive/Music/ArtistOverview.js
new file mode 100644
index 00000000..4c7d40e9
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Music/ArtistOverview.js
@@ -0,0 +1,94 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/ViewModels/MediaItemModel.js", "/Components/Immersive/Shared/BaseImmersiveSummary.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ArtistImmersiveOverviewSummary: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Music/ArtistOverview.html#ImmersiveOverview", function immersiveOverview(){}, {initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.initialize.apply(this, arguments);
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("contentready", true, false);
+ this.domElement.dispatchEvent(domEvent)
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ArtistImmersiveHeroSummary: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Music/ArtistOverview.html#ImmersiveHeroSummary", function immersiveOverview(){}, {
+ _dataContextBindings: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.initialize.apply(this, arguments);
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("contentready", true, false);
+ this.domElement.dispatchEvent(domEvent);
+ this.viewMoreAction = this._getViewMoreAction();
+ this.viewMoreAction.parameter = {onExecuted: function() {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._container)
+ }.bind(this)};
+ this._scrollViewer._SMALL_SCROLL_AMOUNT = 300;
+ var scrollViewerSounds = WinJS.Utilities.getMember("XboxJS.UI.ScrollViewer._sounds");
+ if (scrollViewerSounds && scrollViewerSounds.selectButtonClick)
+ scrollViewerSounds.selectButtonClick = null;
+ this.frame.getData().done(function bindData(dataContext) {
+ this._dataContextBindings = WinJS.Binding.bind(dataContext, {description: function updateScroller() {
+ this._scrollViewer.refresh()
+ }.bind(this)})
+ }.bind(this))
+ }, unload: function unload() {
+ if (this._dataContextBindings) {
+ this._dataContextBindings.cancel();
+ this._dataContextBindings = null
+ }
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.unload.call(this)
+ }, _dismissScrollViewer: function _dismissScrollViewer() {
+ WinJS.Utilities.removeClass(this._container, "focused");
+ if (WinJS.Utilities.getMember("_scrollViewer._scrollingContainer.msZoomTo", this))
+ this._scrollViewer._scrollingContainer.msZoomTo({
+ contentX: 0, contentY: 0
+ });
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("keyup", true, true);
+ domEvent.key = "Esc";
+ this._scrollViewer.element.dispatchEvent(domEvent);
+ if (this._scrollViewer && !this._scrollViewer._isActive && this._scrollViewer._previousFocusRoot && !WinJS.UI.AutomaticFocus.focusRoot)
+ MS.Entertainment.UI.Framework.setFocusRoot(this._scrollViewer._previousFocusRoot)
+ }, _onFocusIn: function _onFocusIn() {
+ WinJS.Utilities.addClass(this._container, "focused");
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("keyup", true, true);
+ domEvent.key = "Enter";
+ this._scrollViewer.element.dispatchEvent(domEvent)
+ }, _onFocusOut: function _onFocusOut() {
+ this._dismissScrollViewer()
+ }, _onPointerOut: function _onPointerOut(e) {
+ if (e.srcElement === this._container || e.srcElement === this._bioBackground)
+ this._dismissScrollViewer()
+ }, _onKeyDown: function _onKeyDown(evt) {
+ switch (evt.keyCode) {
+ case WinJS.Utilities.Key.rightArrow:
+ case WinJS.Utilities.Key.rArrow:
+ case WinJS.Utilities.Key.rOtherArrow:
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("keyup", true, true);
+ domEvent.key = "Esc";
+ this._scrollViewer.element.dispatchEvent(domEvent);
+ break
+ }
+ }, _getViewMoreAction: function _getViewMoreAction() {
+ var viewMoreButtonAction = MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function viewMoreButtonAction() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.unsnapButtonAction, executed: function executed(parameter) {
+ if (parameter && parameter.onExecuted)
+ parameter.onExecuted();
+ WinJS.Promise.timeout(600).done(function refreshVui() {
+ XboxJS.UI.Voice.refreshVoiceElements()
+ })
+ }, canExecute: function canExecute(parameter) {
+ return true
+ }
+ });
+ var action = new viewMoreButtonAction;
+ if (action.isVoiceEnabled) {
+ action.voicePhrase = String.load(String.id.IDS_MUSIC2_ARTIST_DETAILS_VIEW_BIO_VUI_ALM);
+ action.voicePhoneticPhrase = String.load(String.id.IDS_MUSIC2_ARTIST_DETAILS_VIEW_BIO_VUI_PRON);
+ action.voiceConfidence = String.load(String.id.IDS_MUSIC2_ARTIST_DETAILS_VIEW_BIO_VUI_CONF)
+ }
+ return action
+ }
+ }, {viewMoreAction: null})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ArtistImmersiveOverviewGenericSummary: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ArtistImmersiveOverviewSummary", "/Components/Immersive/Music/ArtistOverview.html#ImmersiveOverviewGeneric")})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistAlbums.html b/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistAlbums.html
new file mode 100644
index 00000000..68de1dcc
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistAlbums.html
@@ -0,0 +1,27 @@
+
+
+
+
+ Music Immersive Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistOverview.html b/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistOverview.html
new file mode 100644
index 00000000..648e0514
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistOverview.html
@@ -0,0 +1,26 @@
+
+
+
+
+ More Artist Overview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistOverviewGeneric.html b/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistOverviewGeneric.html
new file mode 100644
index 00000000..8db467a6
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Music/MoreArtistOverviewGeneric.html
@@ -0,0 +1,27 @@
+
+
+
+
+ Music Immersive Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/BaseImmersiveOverviewSummary.js b/packages/microsoft.zunemusic/Components/Immersive/Shared/BaseImmersiveOverviewSummary.js
new file mode 100644
index 00000000..15147fe4
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/BaseImmersiveOverviewSummary.js
@@ -0,0 +1,25 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js", "/Components/Immersive/Shared/BaseImmersiveSummary.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BaseImmersiveOverviewSummary: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", null, function baseImmersiveOverviewSummary() {
+ if (this.usesSmartBuyStateEngine)
+ this.smartBuyStateEngine = this._createSmartBuyStateEngine()
+ }, {
+ controlName: "ImmersiveOverviewSummary", usesSmartBuyStateEngine: true, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.initialize.apply(this, arguments);
+ if (MS.Entertainment.UI.Controls.UserFeedbackDialog)
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.inlineDetailsItem = this.dataContext
+ }, unload: function unload() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.unload();
+ this.smartBuyStateEngine = null
+ }
+ if (MS.Entertainment.UI.Controls.UserFeedbackDialog)
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.inlineDetailsItem = null;
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.unload.call(this)
+ }, _createSmartBuyStateEngine: function _createSmartBuyStateEngine() {
+ return new MS.Entertainment.ViewModels.SmartBuyStateEngine
+ }
+ }, {smartBuyStateEngine: null})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/BaseImmersiveSummary.js b/packages/microsoft.zunemusic/Components/Immersive/Shared/BaseImmersiveSummary.js
new file mode 100644
index 00000000..d815a0af
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/BaseImmersiveSummary.js
@@ -0,0 +1,8 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/ViewModels/MediaItemModel.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BaseImmersiveSummary: MS.Entertainment.UI.Framework.defineUserControl(null, function baseImmersiveSummary(){}, {
+ controlName: "BaseImmersiveSummary", initialize: function initialize(){}
+ }, {dataContext: null})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/Hero.html b/packages/microsoft.zunemusic/Components/Immersive/Shared/Hero.html
new file mode 100644
index 00000000..3724d58a
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/Hero.html
@@ -0,0 +1,53 @@
+
+
+
+
+ Immersive Hero
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/Hero.js b/packages/microsoft.zunemusic/Components/Immersive/Shared/Hero.js
new file mode 100644
index 00000000..1734803e
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/Hero.js
@@ -0,0 +1,325 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Components/Immersive/Shared/BaseImmersiveSummary.js");
+(function() {
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImmersiveHero: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Shared/Hero.html#ImmersiveHero", function immersiveHero() {
+ this.uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)
+ }, {
+ controlName: "ImmersiveHero", _eventHandler: null, _playbackSessionBindings: null, _bindings: null, _dataContextHandlers: null, _uiStateServiceHandlers: null, _nowPlayingControl: null, _nowPlayingRemoveTimeout: 2000, uiStateService: null, pendingImage: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.initialize.call(this);
+ if (this.dataContext.sessionId)
+ this._createNowPlayingControl();
+ this._uiStateServiceHandlers = MS.Entertainment.Utilities.addEvents(this.uiStateService, {nowPlayingInsetChanged: this.onNowPlayingInsetChanged.bind(this)});
+ this.onNowPlayingInsetChanged({detail: {newValue: this.uiStateService.nowPlayingInset}});
+ this._bindings = WinJS.Binding.bind(this, {
+ backgroundVisible: this._backgroundVisibleChangedHandler.bind(this), dataContext: {sessionId: this._sessionIdChanged.bind(this)}, uiStateService: {nowPlayingVisible: function nowPlayingVisibleChanged(newVal, oldVal) {
+ var showNowPlaying = (newVal || MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)) && !!this.dataContext.sessionId;
+ var showHeroContent = !showNowPlaying;
+ if (!this.frozen && !this.backgroundVisible && (!newVal || this.dataContext.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.remoteLRC || (this.playbackSession && this.playbackSession.isRemoteSession()))) {
+ this._loadBackgroundImage();
+ this._updateSecondaryText()
+ }
+ if (!this.frozen) {
+ if (this.nowPlayingControlContainer)
+ this.nowPlayingControlContainer.visibility = showNowPlaying;
+ this._heroContent.visibility = showHeroContent;
+ if (showNowPlaying)
+ this._checkNowPlaying();
+ else
+ this._removeNowPlayingControl()
+ }
+ }.bind(this)}
+ });
+ this._dataContextHandlers = MS.Entertainment.Utilities.addEvents(this.dataContext, {showplaylist: this._showPlaylist.bind(this)});
+ this.uiStateService.nowPlayingVisible = this._shouldShowNowPlaying()
+ }, freeze: function immersiveHero_freeze() {
+ this.frozen = true;
+ if (this.uiStateService.isAppVisible) {
+ this.backgroundVisible = false;
+ this.playbackSession = null;
+ this._playbackSessionChanged();
+ this.uiStateService.nowPlayingVisible = false
+ }
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.freeze.call(this)
+ }, thaw: function immersiveHero_thaw() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.thaw.call(this);
+ if (this.backgroundImageUri || this.backgroundFallbackImageUri)
+ this.backgroundVisible = true;
+ this.frozen = false;
+ if (this.dataContext.sessionId)
+ this._sessionIdChanged(this.dataContext.sessionId);
+ this.uiStateService.nowPlayingVisible = this._shouldShowNowPlaying();
+ if (!this.uiStateService.nowPlayingVisible) {
+ this._loadBackgroundImage();
+ this._updateSecondaryText();
+ this._removeNowPlayingControl()
+ }
+ }, unload: function unload() {
+ if (this.dataContext.dispose)
+ this.dataContext.dispose();
+ if (this._uiStateServiceHandlers) {
+ this._uiStateServiceHandlers.cancel();
+ this._uiStateServiceHandlers = null
+ }
+ if (this._dataContextHandlers) {
+ this._dataContextHandlers.cancel();
+ this._dataContextHandlers = null
+ }
+ this._detachBindings();
+ if (this.dataContext.sessionId)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).releaseNowPlayingControl(this.dataContext.sessionId);
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.unload.call(this)
+ }, onNowPlayingInsetChanged: function onNowPlayingInsetChanged(e) {
+ var newVal = e.detail.newValue;
+ var oldVal = e.detail.oldValue;
+ if (!this.frozen) {
+ this.frame.isFullScreen = !newVal;
+ if (newVal && this.playbackSession && this.playbackSession.currentMedia && !this.playbackSession.currentMedia.hasServiceId && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ if (this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ this.uiStateService.nowPlayingInset = false;
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack();
+ if (newVal) {
+ if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ WinJS.Utilities.removeClass(this.nowPlayingControlContainer.domElement, "fullScreen")
+ }
+ else if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ WinJS.Utilities.addClass(this.nowPlayingControlContainer.domElement, "fullScreen")
+ }
+ }, _showPlaylist: function _showPlaylist() {
+ if (!this.playlistHost.visibility) {
+ var text = this.dataContext.isMarketplace ? String.load(String.id.IDS_DETAILS_TOP_SONGS) : String.load(String.id.IDS_MUSIC_SONGS_IN_COLLECTION);
+ var framePosition = WinJS.Utilities.getPosition(this.playlistHost.domElement);
+ var showPopOverResult = MS.Entertainment.UI.Controls.ImmersiveViewMore.showPopOver({
+ frame: {
+ columnStyle: "immersivePlaylist", heading: text, viewMoreHeading: text
+ }, framePosition: framePosition, userControl: "MS.Entertainment.UI.Controls.NowPlayingPlaylist", userControlOptions: {
+ dataSource: this.dataContext.playlist, playbackItemSource: this.dataContext.playbackItemSource, galleryTemplate: MS.Entertainment.UI.Controls.NowPlayingPlaylistTemplates.nowPlaying
+ }
+ });
+ var uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {isSnappedChanged: function isSnappedChanged(e) {
+ if (e.detail.newValue && showPopOverResult && showPopOverResult.viewMore)
+ showPopOverResult.viewMore.hide()
+ }});
+ showPopOverResult.completionPromise.then(null, function ignoreError(){}).done(function viewMorePopoverHidden() {
+ if (uiStateEventHandler) {
+ uiStateEventHandler.cancel();
+ uiStateEventHandler = null
+ }
+ showPopOverResult = null
+ }.bind(this))
+ }
+ }, _removeNowPlayingControl: function _removeNowPlayingControl() {
+ if (!this._nowPlayingControl)
+ return;
+ if (this.dataContext.sessionId)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).releaseNowPlayingControl(this.dataContext.sessionId);
+ if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ MS.Entertainment.Utilities.empty(this.nowPlayingControlContainer.domElement);
+ this.uiStateService.nowPlayingVisible = false;
+ this._nowPlayingControl = null;
+ this.frame.isFullScreen = false
+ }, _sessionIdChanged: function _sessionIdChanged(newVal, oldVal) {
+ if (!newVal)
+ return;
+ if (oldVal) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).releaseNowPlayingControl(oldVal);
+ this._nowPlayingControl = null
+ }
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.playbackSession = sessionMgr.getSession(this.dataContext.sessionId);
+ this._playbackSessionChanged()
+ }, _detachBindings: function _detachBindings() {
+ this._detachPlaybackSessionBindings();
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }, _detachPlaybackSessionBindings: function _detachPlaybackSessionBindings() {
+ if (this._playbackSessionBindings) {
+ this._playbackSessionBindings.cancel();
+ this._playbackSessionBindings = null
+ }
+ }, _playbackSessionChanged: function playbackSessionChanged() {
+ this._detachPlaybackSessionBindings();
+ if (this.playbackSession)
+ this._playbackSessionBindings = WinJS.Binding.bind(this, {playbackSession: {
+ currentMedia: this._mediaStateChanged.bind(this), currentTransportState: this._mediaStateChanged.bind(this), canControlMedia: this._mediaStateChanged.bind(this), playerState: this._playerStateChanged.bind(this)
+ }});
+ else
+ this._removeNowPlayingControl()
+ }, _createNowPlayingControl: function _createNowPlayingControl() {
+ if (this._nowPlayingControl || !this.nowPlayingControlContainer)
+ return false;
+ this._nowPlayingControl = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).getNowPlayingControl(this.dataContext.sessionId);
+ this.nowPlayingControlContainer.domElement.appendChild(this._nowPlayingControl.domElement);
+ return true
+ }, _startNowPlaying: function _startNowPlaying() {
+ if (this._nowPlayingControl && this._nowPlayingControl.initialized) {
+ this._nowPlayingControl.playbackSession = this.playbackSession;
+ this._nowPlayingControl.repossessNowPlaying();
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ sessionMgr.setPrimarySession(this.dataContext.sessionId);
+ if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ WinJS.Utilities.removeClass(this.nowPlayingControlContainer.domElement, "hideFromDisplay");
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia)) {
+ if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ WinJS.Utilities.addClass(this.nowPlayingControlContainer.domElement, "musicTrack")
+ }
+ else if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ WinJS.Utilities.removeClass(this.nowPlayingControlContainer.domElement, "musicTrack")
+ }
+ }, _checkNowPlaying: function _checkNowPlaying() {
+ var shouldShowNowPlaying = this._shouldShowNowPlaying();
+ if (this.playbackSession && (this._isPreloadedMedia() || this.playbackSession.playerState !== MS.Entertainment.Platform.Playback.PlayerState.notReady) && shouldShowNowPlaying) {
+ this.uiStateService.nowPlayingVisible = true;
+ if (this._createNowPlayingControl() || (this._nowPlayingControl && !this._nowPlayingControl.initialized))
+ this._nowPlayingControl.bind("initialized", function initializedChanged(newVal) {
+ if (newVal) {
+ this._startNowPlaying();
+ this._updateNowPlaying(shouldShowNowPlaying);
+ this.onNowPlayingInsetChanged({detail: {newValue: this.uiStateService.nowPlayingInset}})
+ }
+ }.bind(this));
+ else {
+ this._startNowPlaying();
+ this._updateNowPlaying(shouldShowNowPlaying);
+ this.onNowPlayingInsetChanged({detail: {newValue: this.uiStateService.nowPlayingInset}})
+ }
+ }
+ }, _updateNowPlaying: function _updateNowPlaying(shouldShowNowPlaying) {
+ if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ if (this.playbackSession && MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ WinJS.Utilities.addClass(this.nowPlayingControlContainer.domElement, "musicTrack");
+ else if (this.nowPlayingControlContainer && this.nowPlayingControlContainer.domElement)
+ WinJS.Utilities.removeClass(this.nowPlayingControlContainer.domElement, "musicTrack");
+ if (this.uiStateService.nowPlayingVisible && !shouldShowNowPlaying)
+ WinJS.Promise.timeout(this._nowPlayingRemoveTimeout).then(function _delay() {
+ if (!this.frozen)
+ this.uiStateService.nowPlayingVisible = this._shouldShowNowPlaying()
+ }.bind(this));
+ else
+ this.uiStateService.nowPlayingVisible = shouldShowNowPlaying
+ }, _playerStateChanged: function _playerStateChanged(newVal, oldVal) {
+ if (!newVal || this.frozen || this.uiStateService.isSnapped)
+ return;
+ if (newVal === MS.Entertainment.Platform.Playback.PlayerState.error && oldVal !== undefined) {
+ if (!this.uiStateService.isSnapped)
+ this.uiStateService.nowPlayingInset = true;
+ this.frame.isFullScreen = false
+ }
+ else if (newVal === MS.Entertainment.Platform.Playback.PlayerState.notReady && oldVal !== undefined)
+ WinJS.Promise.timeout(this._nowPlayingRemoveTimeout).then(function _delay() {
+ if (!this.frozen && this.playbackSession && this.playbackSession.playerState === newVal === MS.Entertainment.Platform.Playback.PlayerState.notReady)
+ this._removeNowPlayingControl()
+ }.bind(this));
+ else
+ this._checkNowPlaying()
+ }, _mediaStateChanged: function _mediaStateChanged(newVal, oldVal) {
+ if (!newVal || this.frozen)
+ return;
+ this._checkNowPlaying()
+ }, _backgroundVisibleChangedHandler: function _backgroundVisibleChangedHandler(newVal, oldVal) {
+ if (this._heroContent)
+ if (newVal && !this.uiStateService.nowPlayingVisible)
+ MS.Entertainment.Utilities.showElement(this._heroContent.domElement);
+ else
+ MS.Entertainment.Utilities.hideElement(this._heroContent.domElement)
+ }, _shouldShowNowPlaying: function _shouldShowNowPlaying() {
+ var setNowPlayingVisible = false;
+ var isMusicTrack = this.playbackSession && (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia) && (MS.Entertainment.Platform.PlaybackHelpers.isMusicOrMusicVideo(this.dataContext.mediaItem) || MS.Entertainment.Platform.PlaybackHelpers.isMusicArtist(this.dataContext.mediaItem)));
+ var validNowPlayingTransportState = this.playbackSession && (this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.starting || (this.playbackSession.targetTransportState !== MS.Entertainment.Platform.Playback.TransportState.stopped && this.playbackSession.playerState !== MS.Entertainment.Platform.Playback.PlayerState.notReady));
+ var useNewMusicPage = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation);
+ if (this.playbackSession && this.playbackSession.currentMedia)
+ if (isMusicTrack && (this.uiStateService.isSnapped || this._isPreloadedMedia() || validNowPlayingTransportState || useNewMusicPage))
+ setNowPlayingVisible = true;
+ else if (this.playbackSession.canControlMedia)
+ if (this.playbackSession.currentMedia.isEqual(this.dataContext.mediaItem))
+ setNowPlayingVisible = true;
+ return setNowPlayingVisible && !this.frozen
+ }, _loadFallbackBackgroundImage: function _loadFallbackBackgroundImage() {
+ this.backgroundImageUri = null
+ }, _loadBackgroundImage: function _loadBackgroundImage() {
+ var promise;
+ if (this.dataContext.mediaItem.hydrate)
+ promise = this.dataContext.mediaItem.hydrate();
+ else
+ promise = WinJS.Promise.as();
+ promise.done(function onMediaItemHydrate() {
+ if (this.dataContext.mediaItem.backgroundImageUri) {
+ var imageUrl = MS.Entertainment.Utilities.UriFactory.appendQuery(this.dataContext.mediaItem.backgroundImageUri, {format: MS.Entertainment.ImageFormat.png});
+ MS.Entertainment.UI.Shell.ImageLoader.cacheImage(imageUrl, String.empty).done(function cacheImage(url) {
+ this.backgroundImageUri = url
+ }.bind(this), function useDefaultImage() {
+ this.backgroundImageUri = String.empty
+ }.bind(this))
+ }
+ else
+ this._loadFallbackBackgroundImage();
+ if (this.dataContext.mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.person)
+ this.mediaTypeClassName = "mediatype-artist";
+ else
+ this.mediaTypeClassName = String.empty;
+ if (this.domElement)
+ WinJS.Utilities.addClass(this.domElement, this.mediaTypeClassName)
+ }.bind(this), this._loadFallbackBackgroundImage.bind(this))
+ }, _updateSecondaryText: function _updateSecondaryText() {
+ if (this.dataContext.mediaItem.primaryGenre)
+ this.secondaryText = this.dataContext.mediaItem.primaryGenre;
+ else if (this.dataContext.mediaItem.genre)
+ this.secondaryText = MS.Entertainment.Formatters.formatGenre(this.dataContext.mediaItem);
+ else
+ this.secondaryText = String.empty
+ }, _isPreloadedMedia: function _isPreloadedMedia() {
+ return (MS.Entertainment.Utilities.isMusicApp && this.playbackSession.currentMedia !== null && this.playbackSession.currentOrdinal === null)
+ }, _handleActionsReady: function _handleActionsReady(event) {
+ if (MS.Entertainment.Utilities.isApp2 && MS.Entertainment.UI.Framework.canMoveFocus(event.srcElement))
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(event.srcElement)
+ }
+ }, {
+ backgroundImageUri: String.empty, backgroundFallbackImageUri: null, backgroundVisible: false, mediaTypeClassName: String.empty, showStartingAnimation: false, secondaryText: "", playbackSession: null, frozen: false, showGenericIcon: false, smartBuyStateEngine: null
+ }, {loadBackgroundImage: MS.Entertainment.Utilities.weakElementBindingInitializer(function loadBackgroundImage(value, destination, destinationProperty, source) {
+ if (source.backgroundImageUri === String.empty) {
+ source.backgroundVisible = false;
+ return
+ }
+ MS.Entertainment.Utilities.empty(destination);
+ source.pendingImage = new Image;
+ var events;
+ var doAddImage = function doAddImage(imageUri) {
+ destination.setAttribute("src", imageUri);
+ source.backgroundVisible = true;
+ source.pendingImage = null;
+ events.cancel()
+ };
+ var handleFailedImage = function handleFailedImage() {
+ WinJS.Utilities.addClass(destination, "hidden");
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(source.dataContext.mediaItem).then(function getUrl(url) {
+ switch (url) {
+ case MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.artist:
+ url = MS.Entertainment.UI.ImagePaths.genericMusicL3Hero;
+ source.showGenericIcon = true;
+ break;
+ default:
+ source.showGenericIcon = false;
+ break
+ }
+ source.backgroundFallbackImageUri = "url(" + url + ")";
+ source.backgroundVisible = true;
+ source.pendingImage = null
+ }.bind(this))
+ };
+ var events = MS.Entertainment.Utilities.addEvents(source.pendingImage, {
+ load: function imageLoaded() {
+ if (source.pendingImage.width >= source.pendingImage.height && source.pendingImage.width >= 500)
+ doAddImage(source.pendingImage.src);
+ else
+ handleFailedImage()
+ }, error: function imageFailed() {
+ handleFailedImage()
+ }
+ });
+ source.pendingImage.setAttribute("src", source.backgroundImageUri)
+ })})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/MoreGalleryControl.html b/packages/microsoft.zunemusic/Components/Immersive/Shared/MoreGalleryControl.html
new file mode 100644
index 00000000..cff2f754
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/MoreGalleryControl.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/MoreGalleryControl.js b/packages/microsoft.zunemusic/Components/Immersive/Shared/MoreGalleryControl.js
new file mode 100644
index 00000000..3d96de77
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/MoreGalleryControl.js
@@ -0,0 +1,62 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {DynamicMoreGalleryControl: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Shared/MoreGalleryControl.html#dynamicMoreGalleryControlTemplate", function moreGalleryControlBase(element, options) {
+ this.dataContext = MS.Entertainment.UI.Controls.DynamicMoreGalleryControl.emptyDataContext
+ }, {
+ initialize: function initialize() {
+ if (this.dataContext && this.dataContext.begin)
+ this.dataContext.begin();
+ this._initializeSelectionHandlers()
+ }, _initializeSelectionHandlers: function _initializeSelectionHandlers() {
+ if (this._gallery.selectionMode !== MS.Entertainment.UI.Controls.GalleryControl.SelectionMode.none) {
+ var defaultSelectionHandlers = MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers(this._clearSelection.bind(this));
+ this._gallery.addSelectionHandlers(defaultSelectionHandlers);
+ this._gallery.addSelectionHandlers({deleteMedia: this._handleItemDeleted.bind(this)})
+ }
+ }, _handleItemDeleted: function _handleItemDeleted(deleted) {
+ if (deleted)
+ this._clearSelection()
+ }, _clearSelection: function _clearSelection() {
+ this._gallery.clearSelection()
+ }
+ }, {dataContext: null}, {emptyDataContext: {
+ view: null, items: null, selectedTemplate: null, modifierSelectionManager: null
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MoreGalleryControl: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Shared/MoreGalleryControl.html#MoreGalleryControl", function moreGalleryControlConstructor(element, options)
+ {
+ this.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(null, 0)
+ }, {
+ _bindings: null, _skipReloadOnBind: false, initialize: function initialize() {
+ if (this.dataContext.getModifierDataSource)
+ this.dataContext.getModifierDataSource().then(function getModifierFromDataContext(modifierItems) {
+ this.modifierSelectionManager.dataSource = new MS.Entertainment.ObservableArray(modifierItems)
+ }.bind(this));
+ else
+ this.reload();
+ if (this.dataContext.defaultSelectionIndex)
+ this.modifierSelectionManager.selectedIndex = this.dataContext.defaultSelectionIndex;
+ this._skipReloadOnBind = true;
+ this._bindings = WinJS.Binding.bind(this, {modifierSelectionManager: {selectedIndex: this.reload.bind(this)}});
+ this._skipReloadOnBind = false
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this.dataContext && this.dataContext.defaultSelectionIndex)
+ this.dataContext.defaultSelectionIndex = 0;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, reload: function reload(newIndex, oldIndex) {
+ if (!this._skipReloadOnBind)
+ this.dataContext.getItems(this.modifierSelectionManager.selectedItem).then(function getItemsFromDataContext(items) {
+ this.galleryItems = items
+ }.bind(this)).then(function _setFocus() {
+ this._gallery.focusFirstItemOnPageLoad = true
+ }.bind(this))
+ }
+ }, {
+ dataContext: null, galleryItems: null, modifierSelectionManager: null, itemTemplate: String.empty, panelTemplate: String.empty, inlineExtraData: null
+ })})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedGridItems.html b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedGridItems.html
new file mode 100644
index 00000000..d1a829e2
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedGridItems.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedGridItems.js b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedGridItems.js
new file mode 100644
index 00000000..7788e002
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedGridItems.js
@@ -0,0 +1,41 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImmersiveRelatedGridItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Shared/RelatedGridItems.html#ImmersiveRelatedGridItems", function immersiveRelatedGridItems(element, options) {
+ this.dataContext = options.dataContext || MS.Entertainment.UI.Controls.ImmersiveRelatedGridItems.emptyDataContext
+ }, {
+ className: null, fixedColumnCount: null, fixedRowCount: null, rowLayout: false, itemSize: null, itemTemplates: [], propertyName: null, initialize: function initialize() {
+ if (this.dataContext.selectedTemplate) {
+ this.className = this.dataContext.selectedTemplate.className || this.className;
+ this._grid.fixedColumnCount = this.dataContext.selectedTemplate.fixedColumnCount || this.fixedColumnCount;
+ this._grid.fixedRowCount = this.dataContext.selectedTemplate.fixedRowCount || this.fixedRowCount;
+ this._grid.rowLayout = this.dataContext.selectedTemplate.rowLayout || this.rowLayout;
+ this._grid.itemSize = this.dataContext.selectedTemplate.itemSize || this.itemSize;
+ this._grid.itemTemplates = this.dataContext.selectedTemplate.itemTemplates || this.itemTemplates;
+ this._grid.propertyName = this.dataContext.selectedTemplate.propertyName || this.propertyName
+ }
+ this._grid.dataSource = this.dataContext.items;
+ var promise = this.dataContext.previousSignal ? WinJS.Binding.unwrap(this.dataContext.previousSignal).promise : WinJS.Promise.wrap();
+ promise.done(function showFrame() {
+ this.visible = true;
+ if (this.dataContext.visibleSignal)
+ WinJS.Binding.unwrap(this.dataContext.visibleSignal).complete();
+ WinJS.Promise.timeout(1000).done(function() {
+ this.setInitialTabIndex()
+ }.bind(this))
+ }.bind(this))
+ }, setInitialTabIndex: function setInitialTabIndex() {
+ var querySelectorString = ".win-focusable";
+ var firstListItem = this.domElement && this.domElement.querySelector(querySelectorString);
+ if (firstListItem)
+ firstListItem.tabIndex = 0;
+ else
+ WinJS.Promise.timeout(1000).then(function() {
+ this.setInitialTabIndex()
+ }.bind(this))
+ }
+ }, {items: null}, {emptyDataContext: {
+ selectedTemplate: {}, items: null
+ }})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedItems.html b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedItems.html
new file mode 100644
index 00000000..6b276fe6
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedItems.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedItems.js b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedItems.js
new file mode 100644
index 00000000..8646e754
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Immersive/Shared/RelatedItems.js
@@ -0,0 +1,122 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ImmersiveRelatedItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Shared/RelatedItems.html#ImmersiveRelatedItemsTemplate", function moreGalleryControlBase(element, options) {
+ this.dataContext = options.dataContext || MS.Entertainment.UI.Controls.ImmersiveRelatedItems.emptyDataContext;
+ if (this.dataContext.selectedTemplate) {
+ this.panelTemplate = this.dataContext.selectedTemplate.panelTemplateUrl || this.panelTemplate;
+ this.panelOptions = this.dataContext.selectedTemplate.panelOptions || this.panelOptions;
+ this.itemTemplate = this.dataContext.selectedTemplate.templateUrl || this.itemTemplate;
+ this.className = this.dataContext.selectedTemplate.className || this.className
+ }
+ }, {
+ className: null, initialize: function initialize() {
+ var thumbnailButton = this.domElement.querySelector(".relatedHeroItem");
+ if (thumbnailButton) {
+ thumbnailButton.tabIndex = 0;
+ WinJS.Utilities.addClass(thumbnailButton, "acc-keyboardFocusTarget");
+ WinJS.Utilities.addClass(thumbnailButton, "win-focusable");
+ thumbnailButton.addEventListener("click", this.onItemClick.bind(this));
+ thumbnailButton.addEventListener("keydown", this.onKeyDown.bind(this))
+ }
+ var querySelectorString = ".control-immersiveListViewItem";
+ var firstListItem = this.domElement.querySelector(querySelectorString);
+ if (firstListItem)
+ firstListItem.tabIndex = 0
+ }, onKeyDown: function onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onItemClick(event)
+ }, onItemClick: function onItemClick(event) {
+ var popOverParameters = {itemConstructor: this.panelTemplate};
+ popOverParameters.dataContext = {
+ data: this.dataContext.heroActionItem, location: MS.Entertainment.Data.ItemLocation.marketplace
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ }, {
+ itemTemplate: null, panelTemplate: null
+ }, {emptyDataContext: {
+ selectedTemplate: {templateUrl: null}, heroItem: {
+ name: null, description: null
+ }, items: null
+ }}), ImmersiveRelatedTileItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Shared/RelatedItems.html#ImmersiveRelatedTilesTemplate", function moreGalleryControlBase(element, options) {
+ this.dataContext = options.dataContext || MS.Entertainment.UI.Controls.ImmersiveRelatedItems.emptyDataContext;
+ if (this.dataContext.selectedTemplate) {
+ this.invokeBehavior = this.dataContext.selectedTemplate.invokeBehavior || this.invokeBehavior;
+ this.actionOptions = this.dataContext.selectedTemplate.actionOptions || this.actionOptions;
+ this.itemTemplate = this.dataContext.selectedTemplate.templateUrl || this.itemTemplate;
+ this.className = this.dataContext.selectedTemplate.className || this.className;
+ this.panelTemplate = this.dataContext.selectedTemplate.panelTemplateUrl || this.panelTemplate;
+ this.panelOptions = this.dataContext.selectedTemplate.panelOptions || this.panelOptions
+ }
+ }, {
+ initialize: function initialize() {
+ if (this.domElement) {
+ this.domElement.addEventListener("click", this.onItemClick.bind(this));
+ this.domElement.addEventListener("keypress", this.onKeyPress.bind(this))
+ }
+ }, onKeyPress: function onKeyPress(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onItemClick(event)
+ }, onItemClick: function onItemClick(event) {
+ var listItem = event.target;
+ if (!WinJS.Utilities.hasClass(listItem, "horizontalListItem"))
+ listItem = MS.Entertainment.Utilities.findParentElementByClassName(listItem, "horizontalListItem");
+ if (!listItem) {
+ listItem = event.target;
+ while (listItem && listItem !== this.domElement) {
+ if (listItem.dataContext)
+ break;
+ listItem = listItem.parentElement
+ }
+ {}
+ }
+ if (listItem && listItem.dataContext)
+ if (listItem.dataContext.action)
+ listItem.dataContext.action.execute();
+ else if (this.invokeBehavior === MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.action) {
+ Trace.assert(this.actionOptions, "RelatedItems: invokeBehavior is set as action, but there are no actionOptions");
+ Trace.assert(this.actionOptions.id, "RelatedItems: invokeBehavior is set as action, but there is no action id defined");
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var itemAction = actionService.getAction(this.actionOptions.id);
+ itemAction.parameter = this.actionOptions.parameter || {};
+ itemAction.parameter.data = listItem.dataContext;
+ itemAction.execute()
+ }
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(listItem.dataContext)) {
+ var smartBuyStateEngine;
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ var mediaContext = appBarService.pushMediaContext(listItem.dataContext, null, [], {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.invokeInline});
+ smartBuyStateEngine = new MS.Entertainment.ViewModels.SmartBuyStateEngine;
+ smartBuyStateEngine.initialize(listItem.dataContext, MS.Entertainment.ViewModels.SmartBuyButtons.getMusicVideoInlineDetailsButtons(mediaContext), MS.Entertainment.ViewModels.MusicStateHandlers.onMusicVideoInlineDetailsStateChanged);
+ var setAppbarActions = function setAppBarActions() {
+ mediaContext.setToolbarActions(smartBuyStateEngine.currentAppbarActions)
+ };
+ var smartStateEngineBindings = WinJS.Binding.bind(smartBuyStateEngine, {currentAppbarActions: setAppbarActions.bind(this)});
+ var contextualData = {
+ title: listItem.dataContext.title, subTitle: listItem.dataContext.artistName
+ };
+ listItem.dataContext.hydrate();
+ MS.Entertainment.UI.Controls.CommandingPopOver.showContextualCommands(contextualData).then(function hideComplete() {
+ smartStateEngineBindings.cancel();
+ smartStateEngineBindings = null
+ })
+ }
+ else {
+ var popOverParameters = {itemConstructor: this.panelTemplate};
+ var location = listItem.dataContext.fromCollection ? MS.Entertainment.Data.ItemLocation.collection : MS.Entertainment.Data.ItemLocation.marketplace;
+ popOverParameters.dataContext = {
+ data: listItem.dataContext, location: location
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ }
+ }, {
+ className: null, itemTemplate: null, panelTemplate: null, actionOptions: null, invokeBehavior: null
+ }, {emptyDataContext: {
+ selectedTemplate: {templateUrl: null}, items: null
+ }})
+ })
+})()
diff --git a/packages/microsoft.zunemusic/Components/ImmersiveDetails/InformationArchitecture.js b/packages/microsoft.zunemusic/Components/ImmersiveDetails/InformationArchitecture.js
new file mode 100644
index 00000000..553f53d8
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/ImmersiveDetails/InformationArchitecture.js
@@ -0,0 +1,28 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/iaservice.js", "/Framework/serviceLocator.js", "/Monikers.js");
+(function() {
+ "use strict";
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.informationArchitecture)) {
+ Trace.fail("InformationArchitecture - Information Architecture not registered. This should be impossible, but is always fatal");
+ throw new Error("Information Architecture - Information Architecture not registered");
+ }
+ var ia = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ var createImmersiveDetailsIA = function createImmersiveDetailsIA() {
+ var Viewability = MS.Entertainment.InformationArchitecture.Viewability;
+ var immersiveDetails = ia.createNode("", MS.Entertainment.UI.Monikers.immersiveDetails, null, {hub: Viewability.hidden}, false);
+ immersiveDetails.getPage = (function() {
+ var oldGetPage = immersiveDetails.getPage;
+ return function customImmersiveDetailsGetPage() {
+ var page = oldGetPage.call(this);
+ page.overrideFragmentUrl = "/Components/Immersive/ImmersiveNavStub.html";
+ return page
+ }
+ })();
+ Object.defineProperty(immersiveDetails, "showNotifications", {get: function() {
+ return true
+ }});
+ ia.rootNode.addChild(immersiveDetails)
+ };
+ createImmersiveDetailsIA();
+ ia.addIAHandler(createImmersiveDetailsIA, true)
+})()
diff --git a/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedDetails.html b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedDetails.html
new file mode 100644
index 00000000..eb1dd411
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedDetails.html
@@ -0,0 +1,32 @@
+
+
+
+
+ Snapped Details Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedDetails.js b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedDetails.js
new file mode 100644
index 00000000..64859468
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedDetails.js
@@ -0,0 +1,84 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/corefx.js", "/Framework/serviceLocator.js", "/Framework/utilities.js", "/ViewModels/MediaItemModel.js");
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SnappedDetails: MS.Entertainment.UI.Framework.defineUserControl("/Components/ImmersiveDetails/SnappedDetails.html#snappedDetailsTemplate", function immersiveDetailsConstructor(element, options) {
+ this.modelItem = {}
+ }, {
+ _initialized: false, _sessionMgr: null, _currentDetailsTemplatePath: null, _detailsDataContext: null, _uiStateEventHandler: null, initialize: function initialize() {
+ this.delayInitialize()
+ }, _delayInitialized: function delayInitialized() {
+ if (this._uiStateEventHandler) {
+ this._uiStateEventHandler.cancel();
+ this._uiStateEventHandler = null
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.detailsReady = true;
+ this._initialized = true
+ }
+ else
+ this._uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {stageThreeActivatedChanged: function stageThreeActivatedChanged(e) {
+ if (e.detail.newValue)
+ this._delayInitialized()
+ }.bind(this)})
+ }, updateModelItem: function updateModelItem(newModel) {
+ if (newModel && newModel !== this.modelItem && (!this.modelItem || !this.modelItem.isEqual || !this.modelItem.isEqual(newModel)))
+ this._updateMetaData(MS.Entertainment.ViewModels.MediaItemModel.augment(newModel))
+ }, _convertToTvSeries: function _convertToTvSeries(modelItem) {
+ var seriesMediaItem = MS.Entertainment.Data.augment({
+ id: modelItem.seriesId, libraryId: modelItem.seriesLibraryId, title: {$value: modelItem.seriesTitle}
+ }, MS.Entertainment.Data.Augmenter.Marketplace.TVSeries);
+ if (!this.modelItem || modelItem.seriesId !== this.modelItem.serviceId)
+ this._updateMetaData(MS.Entertainment.ViewModels.MediaItemModel.augment(seriesMediaItem))
+ }, _convertToArtist: function _convertToArtist(modelItem) {
+ var artistMediaItem = MS.Entertainment.Data.augment({
+ id: modelItem.artistServiceId, libraryId: modelItem.artistId, name: modelItem.artistName
+ }, MS.Entertainment.Data.Augmenter.Marketplace.Music.Artist);
+ this._updateMetaData(MS.Entertainment.ViewModels.MediaItemModel.augment(artistMediaItem))
+ }, _updateMetaData: function _updateMetaData(modelItem) {
+ var defaultIndex = 0;
+ if (!modelItem || !modelItem.mediaType)
+ return;
+ if (!this.modelItem)
+ MS.Entertainment.Utilities.empty(this.detailsContentContainer);
+ switch (modelItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ return;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(modelItem) && modelItem.hasServiceId) {
+ this._convertToArtist(modelItem);
+ return
+ }
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(modelItem))
+ this.setDetailsTemplate("/Components/ImmersiveDetails/SnappedTvEpisodeDetails.html#tvEpisodeOverviewTemplate", {modelItem: modelItem});
+ else
+ this.setDetailsTemplate("/Components/ImmersiveDetails/SnappedMovieDetails.html#movieOverviewTemplate", {modelItem: modelItem});
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ return;
+ default:
+ this.setDetailsTemplate("/Components/ImmersiveDetails/SnappedMovieDetails.html#movieOverviewTemplate", {modelItem: modelItem});
+ break
+ }
+ if (modelItem.hydrate)
+ modelItem.hydrate();
+ this.modelItem = modelItem
+ }, setDetailsTemplate: function setDetailsTemplate(templatePath, modelItem) {
+ if (this._currentDetailsTemplatePath !== templatePath) {
+ this._currentDetailsTemplatePath = templatePath;
+ MS.Entertainment.Utilities.empty(this.detailsContentContainer);
+ MS.Entertainment.UI.Framework.loadTemplate(templatePath).then(function renderControl(controlInstance) {
+ this._detailsDataContext = WinJS.Binding.as({dataContext: modelItem});
+ return controlInstance.render(this._detailsDataContext, this.detailsContentContainer)
+ }.bind(this))
+ }
+ else
+ this._detailsDataContext.dataContext.modelItem = modelItem.modelItem
+ }
+ }, {
+ modelItem: null, playbackSession: null, detailsReady: false
+ })})
+})()
diff --git a/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedMovieDetails.html b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedMovieDetails.html
new file mode 100644
index 00000000..459e8303
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedMovieDetails.html
@@ -0,0 +1,54 @@
+
+
+
+
+ Snapped Movie Details Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedMovieDetails.js b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedMovieDetails.js
new file mode 100644
index 00000000..7aa0661c
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/ImmersiveDetails/SnappedMovieDetails.js
@@ -0,0 +1,71 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {SnappedMovieDetailsOverview: MS.Entertainment.UI.Framework.defineUserControl("Components/ImmersiveDetails/SnappedMovieDetails.html#movieDetailsOverviewTemplate", function movieDetailsOverviewConstructor() {
+ this._bindingsToDetach = [];
+ this.smartBuyStateEngine = new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine
+ }, {
+ _bindingsToDetach: null, initialize: function initialize() {
+ this.bind("mediaItem", this._modelChanged.bind(this));
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._initializeBinding(uiStateService, "nowPlayingVisible", function nowPlayingVisibleChanged() {
+ this.nowPlayingVisible = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible
+ }.bind(this));
+ this._initializeBinding(uiStateService, "nowPlayingInset", function nowPlayingInsetChanged() {
+ this.nowPlayingInset = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset
+ }.bind(this));
+ this.bind("showPlayFeatured", this._updatePlayTrailerVisible.bind(this));
+ this.bind("featuredInfoVisible", this._updatePlayTrailerVisible.bind(this));
+ if (this.mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie || this.mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ this.smartBuyStateEngine.initialize(this.mediaItem, MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.canvas), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoDetailsTwoButtonStateChanged);
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement)
+ }, _updatePlayTrailerVisible: function _updatePlayTrailerVisible() {
+ this.playTrailerVisible = this.showPlayFeatured && this.featuredInfoVisible
+ }, _detachBindings: function _detachBindings() {
+ this._bindingsToDetach.forEach(function(e) {
+ e.source.unbind(e.name, e.action)
+ });
+ this._bindingsToDetach = []
+ }, _initializeBinding: function _initializeBinding(source, name, action) {
+ source.bind(name, action);
+ this._bindingsToDetach.push({
+ source: source, name: name, action: action
+ })
+ }, unload: function unload() {
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.unload();
+ this._detachBindings();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _modelChanged: function _modelChanged() {
+ if (this.mediaItem) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this.showPlayFeatured = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace) && this.mediaItem.hasZuneId && MS.Entertainment.ViewModels.SmartBuyStateHandlers._mediaHasAnyRight(this.mediaItem, MS.Entertainment.Utilities.defaultClientTypeFromApp, [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Preview, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.PreviewStream]);
+ if (this.mediaItem.serviceId && !MS.Entertainment.Utilities.isEmptyGuid(this.mediaItem.serviceId))
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(this.mediaItem).done(function imageUrl(url) {
+ this.boxArtImageUri = url
+ }.bind(this));
+ else if (this.mediaItem.imageUri) {
+ this.backgroundImageUri = this.mediaItem.imageUri;
+ this.boxArtImageUri = this.mediaItem.imageUri
+ }
+ }
+ else {
+ this.showPlayFeatured = false;
+ this.backgroundImageUri = null;
+ this.boxArtImageUri = null
+ }
+ }
+ }, {
+ mediaItem: null, smartBuyStateEngine: null, backgroundImageUri: null, boxArtImageUri: null, onPlayClicked: null, playTrailerVisible: false, featuredInfoVisible: true, nowPlayingVisible: false, nowPlayingInset: false, overviewVisible: false, showPlayFeatured: true, sessionId: null, hidePlayTrailer: false, playTrailerClick: function playTrailerClick() {
+ MS.Entertainment.Utilities.Telemetry.logPlayPreview(this.mediaItem, false);
+ if (this.onPlayClicked) {
+ MS.Entertainment.UI.Controls.assert(this.mediaItem, "playTrailerClick. this.mediaItem is not valid");
+ if (this.mediaItem) {
+ this.mediaItem.playPreviewOnly = true;
+ this.onPlayClicked()
+ }
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/ActionButtonsControl.html b/packages/microsoft.zunemusic/Components/InlineDetails/ActionButtonsControl.html
new file mode 100644
index 00000000..47650ea5
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/ActionButtonsControl.html
@@ -0,0 +1,122 @@
+
+
+
+
+ Action Buttons Control
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/MusicAlbumInlineDetails.html b/packages/microsoft.zunemusic/Components/InlineDetails/MusicAlbumInlineDetails.html
new file mode 100644
index 00000000..a943164a
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/MusicAlbumInlineDetails.html
@@ -0,0 +1,219 @@
+
+
+
+
+ Music Album Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/MusicArtistInlineDetails.html b/packages/microsoft.zunemusic/Components/InlineDetails/MusicArtistInlineDetails.html
new file mode 100644
index 00000000..4fbbac76
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/MusicArtistInlineDetails.html
@@ -0,0 +1,202 @@
+
+
+
+
+ Music Artist Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/MusicInlineDetailsDemo.html b/packages/microsoft.zunemusic/Components/InlineDetails/MusicInlineDetailsDemo.html
new file mode 100644
index 00000000..47736389
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/MusicInlineDetailsDemo.html
@@ -0,0 +1,137 @@
+
+
+
+
+ Music Demo Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/MusicInlineDetailsDemo.js b/packages/microsoft.zunemusic/Components/InlineDetails/MusicInlineDetailsDemo.js
new file mode 100644
index 00000000..513b161b
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/MusicInlineDetailsDemo.js
@@ -0,0 +1,31 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {
+ MusicInlineDetailsSpotlightDemo: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", "Components/InlineDetails/MusicInlineDetailsDemo.html#musicSpotlightInlineDetailsDemoTemplate", function MusicInlineDetailsDemo(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.apply(this, arguments)
+ }, unload: function unload() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }
+ }), MusicInlineDetailsSpotlightNoStreamingDemo: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", "Components/InlineDetails/MusicInlineDetailsDemo.html#musicSpotlightInlineDetailsNoStreamingDemoTemplate", function MusicInlineDetailsNoStreamingDemo(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.apply(this, arguments)
+ }, unload: function unload() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }
+ }), MusicInlineDetailsMarketplaceDemo: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", "Components/InlineDetails/MusicInlineDetailsDemo.html#musicMarketplaceInlineDetailsDemoTemplate", function MusicInlineDetailsMarketplaceDemo(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.apply(this, arguments)
+ }, unload: function unload() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }
+ }), MusicInlineDetailsMarketplaceNoStreamingDemo: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", "Components/InlineDetails/MusicInlineDetailsDemo.html#musicMarketplaceInlineDetailsNoStreamingDemoTemplate", function MusicInlineDetailsNoStreamingDemo(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.apply(this, arguments)
+ }, unload: function unload() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }
+ })
+ })
+})()
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/MusicPlaylistInlineDetails.html b/packages/microsoft.zunemusic/Components/InlineDetails/MusicPlaylistInlineDetails.html
new file mode 100644
index 00000000..5c05d441
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/MusicPlaylistInlineDetails.html
@@ -0,0 +1,262 @@
+
+
+
+
+ Music Playlist Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/MusicPlaylistInlineDetails.js b/packages/microsoft.zunemusic/Components/InlineDetails/MusicPlaylistInlineDetails.js
new file mode 100644
index 00000000..b3f5f7c6
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/MusicPlaylistInlineDetails.js
@@ -0,0 +1,401 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Pages");
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MusicPlaylistInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", null, function musicPlaylistInlineDetails(element, options) {
+ this.templateStorage = "/Components/InlineDetails/MusicPlaylistInlineDetails.html";
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ this.templateName = "musicPlaylistInlineDetailsTemplate";
+ else
+ this.templateName = "music2PlaylistInlineDetailsTemplate";
+ this.moveUpAction = new MS.Entertainment.UI.Actions.Playlists.MoveTrackUpAction;
+ this.moveDownAction = new MS.Entertainment.UI.Actions.Playlists.MoveTrackDownAction;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this.playlistSize = {
+ width: 532, height: 532
+ };
+ this._supportsReorder = false
+ }
+ }, {
+ playlistSize: {
+ width: 215, height: 215
+ }, tracks: null, _songCount: 0, _queryResults: null, _lastInvokedIndex: -1, _currentMoveUpButton: null, _currentMoveDownButton: null, eventHandlers: null, _playlistQuery: null, _disableActionsOnListSelection: true, _browseAlbumsButtonFocused: false, _enableCurrentButtonsBinding: true, _currentFilterZeroSongs: false, _localTrackQuery: null, _supportsReorder: true, _updateImmediately: false, _smartBuyStateEngineBindings: null, initialize: function initialize() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this, arguments);
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._list.ensureNextItemVisibleCount = 2;
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("playlist")
+ });
+ this.moveUpAction.playlist = this.media;
+ this.moveDownAction.playlist = this.media;
+ this.moveUpAction.bind("isEnabled", this._onMoveUpEnabled.bind(this));
+ this.moveDownAction.bind("isEnabled", this._onMoveDownEnabled.bind(this));
+ MS.Entertainment.UI.assert(this.originalLocation === MS.Entertainment.Data.ItemLocation.collection, "playlists not supported in marketplace view");
+ MS.Entertainment.UI.assert(this.media.inCollection, "media item in collection view is not in collection");
+ this._showPanel(true);
+ this._setupSmartBuy();
+ var removeItemCallback = this._removeItem.bind(this);
+ this._list.invocationHelper.addInvocationHandlers({removeFromPlaylist: removeItemCallback});
+ WinJS.Promise.timeout().then(function() {
+ if (!this.smartBuyStateEngine)
+ return;
+ this._loadLocalTracks()
+ }.bind(this));
+ this._formatDetailString();
+ this._formatPlaylistName();
+ this._formatPlaylistDuration();
+ this._formatPlaylistSubtitle();
+ this._setupPlaylistChangedListener();
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ this._list.addSelectionHandlers({removeFromPlaylist: removeItemCallback});
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.domElement, {iteminvoked: this._itemInvoked.bind(this)});
+ this._shareModel()
+ }
+ else
+ this._updateImmediately = true
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ if (this._playlistQuery && this._playlistQuery.pause)
+ this._playlistQuery.pause()
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._playlistQuery && this._playlistQuery.unpause)
+ this._playlistQuery.unpause();
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this._loadLocalTracks();
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._actionColumn)
+ }
+ }, _setupPlaylistChangedListener: function _setupPlaylistChangedListener() {
+ this._playlistQuery = new MS.Entertainment.Data.Query.libraryPlaylists;
+ this._playlistQuery.isLive = true;
+ this._playlistQuery.playlistId = this.media.libraryId;
+ this._playlistQuery.execute().done(function getResults(results) {
+ var recentResults = results;
+ recentResults.result.items.setNotificationHandler(new MS.Entertainment.UI.Actions.Playlists.playlistDataNotificationHandler(null, this._handleRecentPlaylistDataNotifications.bind(this)))
+ }.bind(this), function onError(){})
+ }, _handleRecentPlaylistDataNotifications: function _handleRecentPlaylistDataNotifications(newItems, oldItems) {
+ var currentIndex = newItems.length ? newItems.length - 1 : -1;
+ var newItem = currentIndex >= 0 ? newItems[currentIndex] : null;
+ while (currentIndex > 0 && newItem && newItem.data.libraryId !== this.media.libraryId) {
+ currentIndex--;
+ newItem = newItems[currentIndex]
+ }
+ {};
+ if (!newItem || newItem.data.libraryId !== this.media.libraryId)
+ return;
+ MS.Entertainment.Utilities.copyAugmentedProperties(newItem.data, this.media);
+ this.media.tracks = this.tracks;
+ var countPromise = WinJS.Promise.wrap(newItem.data.count);
+ if (this._list.dataSource && MS.Entertainment.Utilities.isMusicApp1)
+ countPromise = this._list.dataSource.getCount();
+ countPromise.done(function updateCount(count) {
+ if (count === 0 && this.media.count) {
+ count = this.media.count;
+ this._showTracks(true)
+ }
+ if (this._songCount !== count)
+ this.smartBuyStateEngine.updateState();
+ this._songCount = count;
+ this._formatDetailString(this._songCount);
+ this._formatPlaylistName();
+ this._formatPlaylistDuration();
+ this.playlistDuration = newItem.data.duration ? MS.Entertainment.Utilities.formatTimeString(newItem.data.duration) : String.empty;
+ if (this._songCount === 0)
+ this._showTracks(false)
+ }.bind(this), function handlerError(error) {
+ MS.Entertainment.Pages.fail("Failed to get count. Error message: " + error && error.message)
+ })
+ }, _handleActionsReady: function _handleActionsReady(event) {
+ if (MS.Entertainment.Utilities.isMusicApp2 && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).overlayVisible && MS.Entertainment.UI.Framework.canMoveFocus(event.srcElement) && this._songCount)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(event.srcElement)
+ }, _setupSmartBuy: function _setupSmartBuy() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getPlaylistInlineDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.popover), function onPlaylistPopoverStateChanged(stateInfo) {
+ if (stateInfo && this.originalLocation !== MS.Entertainment.Data.ItemLocation.collection || (!this.media.inCollection && !stateInfo.canPlay) || this.media.count <= 0)
+ this._showTracks(false);
+ var buttons;
+ if (this.smartBuyStateEngine)
+ buttons = MS.Entertainment.ViewModels.MusicStateHandlers.onPlaylistPopoverStateChanged.call(this.smartBuyStateEngine, stateInfo);
+ else
+ buttons = WinJS.Promise.wrap([]);
+ return buttons
+ }.bind(this), {updateImmediately: this._updateImmediately});
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._smartBuyStateEngineBindings = WinJS.Binding.bind(this.smartBuyStateEngine, {currentButtons: function updateButtons(newValue) {
+ if (newValue && newValue.length) {
+ this.actionButtons = new MS.Entertainment.ObservableArray(newValue).bindableItems;
+ if (!this.domElement.contains(document.activeElement))
+ WinJS.Promise.timeout(50).done(function setFocus() {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._actionColumn)
+ }.bind(this))
+ }
+ }.bind(this)})
+ }
+ }, unload: function unload() {
+ if (this._eventHandlers)
+ this._eventHandlers.cancel();
+ if (this._playlistQuery) {
+ this._playlistQuery.dispose();
+ this._playlistQuery = null
+ }
+ if (this._localTrackQuery) {
+ this._localTrackQuery.dispose();
+ this._localTrackQuery = null
+ }
+ if (this._smartBuyStateEngineBindings) {
+ this._smartBuyStateEngineBindings.cancel();
+ this._smartBuyStateEngineBindings = null
+ }
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }, _buttonChangedHandler: function _buttonChangedHandler() {
+ this._setTrackDataSource()
+ }, _setTrackDataSource: function _setTrackDataSource() {
+ this._list.dataSource = this.tracks;
+ this._showTracks(this._songCount > 0)
+ }, _itemInvoked: function _itemInvoked(event) {
+ event.detail.itemPromise.then(function getItemData(data) {
+ if (this._lastInvokedIndex !== data.index || event.detail.rerender) {
+ this._updateParameters(data.data.playlistItemId, data.index);
+ var trackDomElement = this._list.getElementAtIndex(data.index);
+ var buttonContainer = trackDomElement.querySelector(".inlineDetailsMoveTrackUpButton");
+ var moveUpControl = buttonContainer ? buttonContainer.winControl : null;
+ MS.Entertainment.UI.assert(moveUpControl, "the move track up button is missing");
+ if (moveUpControl) {
+ this._currentMoveUpButton = moveUpControl;
+ this._setControlOptions(moveUpControl, this.moveUpAction)
+ }
+ buttonContainer = trackDomElement.querySelector(".inlineDetailsMoveTrackDownButton");
+ var moveDownControl = buttonContainer ? buttonContainer.winControl : null;
+ MS.Entertainment.UI.assert(moveDownControl, "the move track down button is missing");
+ if (moveDownControl) {
+ this._currentMoveDownButton = moveDownControl;
+ this._setControlOptions(moveDownControl, this.moveDownAction)
+ }
+ this._lastInvokedIndex = data.index
+ }
+ else {
+ this._currentMoveUpButton = null;
+ this._currentMoveDownButton = null;
+ this._lastInvokedIndex = -1
+ }
+ }.bind(this));
+ event.stopPropagation()
+ }, _updateParameters: function _updateParameters(playlistItemId, index) {
+ var parameter = {
+ playlistContentId: playlistItemId, index: index, postExecute: this._swapItems.bind(this)
+ };
+ this.moveUpAction.parameter = parameter;
+ this.moveDownAction.parameter = parameter
+ }, _onMoveUpEnabled: function _onMoveUpEnabled(enabled) {
+ if (this._currentMoveUpButton)
+ this._currentMoveUpButton.isDisabled = !enabled
+ }, _onMoveDownEnabled: function _onMoveDownEnabled(enabled) {
+ if (this._currentMoveDownButton)
+ this._currentMoveDownButton.isDisabled = !enabled
+ }, _onFocusIn: function _onFocusIn() {
+ WinJS.Utilities.addClass(this._list.domElement, "focused")
+ }, _onFocusOut: function _onFocusOut() {
+ WinJS.Utilities.removeClass(this._list.domElement, "focused")
+ }, _setControlOptions: function _setControlOptions(control, action) {
+ if (control) {
+ control.action = action;
+ control.text = action.title;
+ control.icon = action.iconInfo.icon;
+ control.isDisabled = !action.isEnabled;
+ control.tabIndex = action.tabIndex;
+ control.automationId = action.automationId
+ }
+ }, _swapItems: function _swapItems(index, insertBefore) {
+ var key = null;
+ if (this._list && this._list.dataSource)
+ key = this._list.dataSource.keyFromIndex(index);
+ MS.Entertainment.Pages.assert(!!key, "Key not found for index: " + index);
+ if (key) {
+ var insertIndex = insertBefore < this._songCount ? insertBefore : insertBefore - 1;
+ var nextKey = this._list.dataSource.keyFromIndex(insertIndex);
+ MS.Entertainment.Pages.assert(!!nextKey, "Key not found for index: " + insertIndex);
+ if (nextKey) {
+ if (insertBefore < this._songCount)
+ this._list.internalDataSource.moveBefore(key, nextKey);
+ else
+ this._list.internalDataSource.moveAfter(key, nextKey);
+ this._list.getFirstVisibleIndex().then(function updateIndex(firstIndex) {
+ if (insertBefore <= firstIndex) {
+ if (firstIndex > 0)
+ this._list.setFirstVisibleIndex(firstIndex - 1)
+ }
+ else
+ this._list.getLastVisibleIndex().then(function updateIndex(lastIndex) {
+ if (insertBefore > lastIndex - 1)
+ this._list.ensureVisible(insertBefore);
+ else
+ this._list.setFirstVisibleIndex(firstIndex)
+ }.bind(this))
+ }.bind(this));
+ var newIndex = insertBefore < index ? insertBefore : insertBefore - 1;
+ var oldParameter = this.moveUpAction.parameter;
+ this._updateParameters(oldParameter.playlistitemId, newIndex);
+ this._lastInvokedIndex = newIndex
+ }
+ }
+ }, _removeItem: function _removeItem(eventArgs) {
+ if (!this._supportsReorder) {
+ this._localTrackQuery.forceLiveRefresh();
+ this._playlistQuery.forceLiveRefresh();
+ return
+ }
+ var removedIndices = (eventArgs.detail && eventArgs.detail.removedIndices) || [];
+ var complete = eventArgs.detail && eventArgs.detail.complete;
+ var returnValues = eventArgs.detail && eventArgs.detail.returnValues;
+ if (complete) {
+ var removedItems = 0;
+ removedIndices.forEach(function removeItem(index) {
+ if (index === this._lastInvokedIndex)
+ this._lastInvokedIndex = -1;
+ this._list.dataSource.removeAt(index - removedItems);
+ removedItems++
+ }.bind(this));
+ this._list.clearSelection()
+ }
+ else {
+ if (returnValues)
+ returnValues.updatedIndex = this._lastInvokedIndex;
+ {};
+ return this._lastInvokedIndex
+ }
+ }, _resetReorderControl: function _resetReorderControl() {
+ if (this._lastInvokedIndex === -1)
+ return;
+ var trackDomElement = this._list.getElementAtIndex(this._lastInvokedIndex);
+ var invokedContainer = MS.Entertainment.Utilities.findParentElementByClassName(trackDomElement, "invoked");
+ if (invokedContainer)
+ WinJS.Utilities.removeClass(invokedContainer, "invoked");
+ this._lastInvokedIndex = -1
+ }, _selectedIndicesChanged: function _selectedIndicesChanged(newValue, oldValue) {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._selectedIndicesChanged.call(this, newValue, oldValue);
+ if (newValue.length > 0) {
+ this._resetReorderControl();
+ this._lastInvokedIndex = -1
+ }
+ }, _onClearedFilters: function _onClearedFilters() {
+ this._loadLocalTracks()
+ }, _loadLocalTracks: function loadLocalTracks() {
+ var query = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ query.playlistId = this.media.libraryId;
+ query.mediaAvailability = this.collectionFilter;
+ query.isLive = false;
+ if (!this._supportsReorder) {
+ query.isLive = true;
+ this._localTrackQuery = query
+ }
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.playlist, MS.Entertainment.Utilities.isValidServiceId(this.media.cloudSyncItemId) ? this.media.cloudSyncItemId : String.empty);
+ this._list.mediaContext.containingMedia = {
+ playbackItemSource: query.clone(), playbackOffset: 0
+ };
+ query.execute().then(function queryComplete(q) {
+ this._queryResults = q.result.items;
+ this._songCount = this._queryResults.count;
+ this._formatDetailString(this._songCount);
+ this.tracks = q.result.items;
+ this._currentFilterZeroSongs = false;
+ if (this._loadedButtons)
+ this._setTrackDataSource();
+ if (this._songCount > 0 || MS.Entertainment.Utilities.isMusicApp2)
+ this._subTitleText.removeAttribute("tabindex");
+ else
+ this._subTitleText.setAttribute("tabindex", 0);
+ if (this.collectionFilter && this.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available) {
+ var unfilteredQuery = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ unfilteredQuery.playlistId = this.media.libraryId;
+ unfilteredQuery.executeCount().done(function unfilteredQueryComplete(unfilteredTrackCount) {
+ if (unfilteredTrackCount > this._songCount) {
+ this._showCollectionFilter();
+ if (this._songCount === 0) {
+ this._subTitleText.removeAttribute("tabindex");
+ this.detailString = String.empty;
+ this._currentFilterZeroSongs = true;
+ this._showTracks(false)
+ }
+ }
+ }.bind(this), function unfilteredQueryError() {
+ this._showCollectionFilter()
+ }.bind(this))
+ }
+ }.bind(this))
+ }, _formatDetailString: function _formatDetailString(count) {
+ if (count === null || count === undefined)
+ count = this.media.count;
+ var details;
+ var formattedCount;
+ if (count === 1)
+ details = String.load(String.id.IDS_DETAILS_PLAYLIST_SONG_COUNT);
+ else if (count > 1) {
+ formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(count);
+ details = String.load(String.id.IDS_DETAILS_PLAYLIST_SONGS_COUNT).format(formattedCount)
+ }
+ else if (MS.Entertainment.Utilities.isMusicApp1)
+ details = String.load(String.id.IDS_MUSIC_EMPTY_PLAYLIST);
+ else
+ details = String.load(String.id.IDS_MUSIC2_EMPTY_PLAYLIST);
+ this.detailString = details;
+ this._formatPlaylistSubtitle()
+ }, _formatPlaylistDuration: function _formatDurationString() {
+ this.playlistDuration = this.media.duration ? MS.Entertainment.Utilities.formatTimeString(this.media.duration) : String.empty
+ }, _formatPlaylistName: function _formatPlaylistName() {
+ this.playlistName = this.media.name || String.load(String.id.IDS_MUSIC_PLAYLIST_LABEL)
+ }, _formatPlaylistSubtitle: function _formatPlaylistSubtitle() {
+ if (this.playlistDuration)
+ this.playlistSubtitle = String.load(String.id.IDS_COMMA_SEPARATOR).format(this.detailString, this.playlistDuration);
+ else
+ this.playlistSubtitle = this.detailString
+ }, _showTracks: function _showTracks(show) {
+ if (show) {
+ this._showElement(this._tracksPanel, true);
+ this._showElement(this._emptyPanel, false)
+ }
+ else {
+ this._showElement(this._tracksPanel, false);
+ if (this._currentFilterZeroSongs) {
+ WinJS.Utilities.removeClass(this._currentFilterZeroSongsText, "removeFromDisplay");
+ WinJS.Utilities.addClass(this._browseLinks, "removeFromDisplay")
+ }
+ else {
+ WinJS.Utilities.addClass(this._currentFilterZeroSongsText, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._browseLinks, "removeFromDisplay");
+ if (!this._browseAlbumsButtonFocused)
+ WinJS.Promise.timeout(250).done(function setFocus() {
+ MS.Entertainment.UI.Framework.focusElement(this._browseAlbumsButton);
+ this._browseAlbumsButtonFocused = true;
+ this._focusOverriden = true
+ }.bind(this))
+ }
+ this._showElement(this._emptyPanel, true);
+ MS.Entertainment.Utilities.showElement(this._emptyPanel)
+ }
+ }, onBrowseAlbums: function onBrowseAlbums(event) {
+ this._sendTelemetryEvent("MusicPlaylistInlineDetails_BrowseAlbums");
+ this._makeActivePlaylist();
+ if (this._overlay && MS.Entertainment.Utilities.isMusicApp1)
+ this._overlay.hide();
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.musicCollection, MS.Entertainment.UI.Monikers.musicCollectionByAlbum, null, {
+ selectHub: true, disableSavingSelectedHub: true
+ })
+ }, onBrowseAllMusic: function onBrowseAllMusic(event) {
+ this._sendTelemetryEvent("MusicPlaylistInlineDetails_BrowseAllMusic");
+ this._makeActivePlaylist();
+ if (this._overlay && MS.Entertainment.Utilities.isMusicApp1)
+ this._overlay.hide();
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.musicMarketplace, MS.Entertainment.UI.Monikers.musicMarketplaceAlbums)
+ }, _sendTelemetryEvent: function _sendTelemetryEvent(event) {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(event)
+ }, _makeActivePlaylist: function _makeActivePlaylist() {
+ var playlistProvider = (new Microsoft.Entertainment.Platform.MediaStore).playlistProvider;
+ playlistProvider.setPlaylistDateEditedToNowAsync(this.media.libraryId)
+ }
+ }, {
+ moveUpAction: null, moveDownAction: null, playlistDuration: null, playlistName: null, playlistSubtitle: null, actionButtons: null
+ })})
+})()
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/TvEpisodeInlineDetails.html b/packages/microsoft.zunemusic/Components/InlineDetails/TvEpisodeInlineDetails.html
new file mode 100644
index 00000000..48a1c060
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/TvEpisodeInlineDetails.html
@@ -0,0 +1,61 @@
+
+
+
+
+ Music Albums Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/TvEpisodeInlineDetails.js b/packages/microsoft.zunemusic/Components/InlineDetails/TvEpisodeInlineDetails.js
new file mode 100644
index 00000000..15b100fd
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/TvEpisodeInlineDetails.js
@@ -0,0 +1,33 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {TvEpisodeInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", "/Components/InlineDetails/TvEpisodeInlineDetails.html#tvEpisodeInlineDetailsTemplate", function tvEpisodeInlineDetails(){}, {
+ initialize: function initialize() {
+ MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this.media).done(function libraryInfoHydrated() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this);
+ this._finalizeInitialize()
+ }.bind(this), function libraryInfoHydrateFailed(error) {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this);
+ this._finalizeInitialize()
+ }.bind(this))
+ }, _finalizeInitialize: function _finalizeInitialize() {
+ this.media = MS.Entertainment.ViewModels.MediaItemModel.augment(this.media);
+ this._showPanel(true);
+ WinJS.Promise.timeout().then(function() {
+ if (!this.smartBuyStateEngine)
+ return;
+ var hydrateIfPossible = function hydrateIfPossible(hasServiceId) {
+ if (hasServiceId)
+ this._hydrateMedia();
+ else
+ this._showPanel()
+ };
+ var binding = WinJS.Binding.bind(this.media, {hasServiceId: hydrateIfPossible.bind(this)});
+ this.mediaBindings.push(binding);
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.invokeInline), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoDetailsTwoButtonStateChanged)
+ }.bind(this))
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/TvSeriesInlineDetails.html b/packages/microsoft.zunemusic/Components/InlineDetails/TvSeriesInlineDetails.html
new file mode 100644
index 00000000..567853bf
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/TvSeriesInlineDetails.html
@@ -0,0 +1,211 @@
+
+
+
+
+ tvSeriess Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/InlineDetails/TvSeriesInlineDetails.js b/packages/microsoft.zunemusic/Components/InlineDetails/TvSeriesInlineDetails.js
new file mode 100644
index 00000000..cc8b37c6
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/InlineDetails/TvSeriesInlineDetails.js
@@ -0,0 +1,597 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js", "/ViewModels/MediaItemModel.js", "/Components/InlineDetails/ActionButtonsControl.js", "/Components/InlineDetails/BaseInlineDetails.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {TvSeriesInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", "/Components/InlineDetails/TvSeriesInlineDetails.html#tvSeriesInlineDetailsTemplate", function tvSeriesInlineDetails(element, options) {
+ this._episodeHeight = options.episodeHeight;
+ this._inlineHeight = options.inlineHeight;
+ this._onBackFromEpisodeClickCallback = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._backFromEpisode, this);
+ this._onEpisodeListItemClickCallback = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._onEpisodeListItemClick, this)
+ }, {
+ _episodeHeight: 0, _inlineHeight: 0, _fileTransferListenerId: null, _detailStringBindingComplete: false, _detailEpisodeStringBindingComplete: false, _modifierBinding: null, _selectedEpisodeIndex: 0, _activeEpisodeList: null, _episodesPanel: null, _currentPage: null, initialize: function initialize() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._currentPage = WinJS.Binding.unwrap(navigationService.currentPage);
+ if (this._currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.navigationPopover)
+ this._currentPage.onNavigateTo = function onNavigateTo(fromPage) {
+ if (navigationService.navigationDirection === MS.Entertainment.Navigation.NavigationDirection.backward) {
+ var fromPageMoniker = WinJS.Utilities.getMember("iaNode.moniker", fromPage);
+ if (fromPageMoniker === MS.Entertainment.UI.Monikers.fullScreenNowPlaying) {
+ WinJS.Utilities.addClass(this.domElement, "hideFromDisplay");
+ WinJS.Promise.timeout(1).done(function delayBackNavigate() {
+ navigationService.navigateBack()
+ })
+ }
+ }
+ }.bind(this);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer))
+ this._fileTransferListenerId = "TVSeriesInlineDetails_" + MS.Entertainment.Utilities.getSessionUniqueInteger();
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-season")
+ });
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries)
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-series")
+ });
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media))
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-episode")
+ });
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries) {
+ var handleBackPress = function(event) {
+ var goBackToEpisodeList = false;
+ if (this.showEpisode)
+ switch (event.type) {
+ case"MSPointerUp":
+ case"pointerup":
+ goBackToEpisodeList = (event.button === 3);
+ break;
+ case"keydown":
+ goBackToEpisodeList = (event.keyCode === WinJS.Utilities.Key.backspace);
+ break
+ }
+ if (goBackToEpisodeList)
+ this._backFromEpisode()
+ };
+ var handleBackPressFunc = handleBackPress.bind(this);
+ this.domElement.addEventListener("keydown", handleBackPressFunc, true);
+ this.domElement.addEventListener("MSPointerUp", handleBackPressFunc, true);
+ this.domElement.addEventListener("pointerup", handleBackPressFunc, true)
+ }
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media))
+ this.episode = this.media;
+ if (Microsoft.Entertainment.Queries.ObjectType.tvSeries === this.media.mediaType)
+ this.series = this.media;
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this, arguments);
+ this._formatDetailString();
+ this._showPanel(true)
+ }, unload: function unload() {
+ if (this._fileTransferListenerId) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ var listenerId = this._fileTransferListenerId;
+ if (!this.showEpisode)
+ listenerId = listenerId + "_season";
+ fileTransferService.unregisterListener(listenerId)
+ }
+ if (this._currentPage && this._currentPage.onNavigateTo)
+ this._currentPage.onNavigateTo = null;
+ this._currentPage = null;
+ if (this._modifierBinding)
+ this._modifierBinding.cancel();
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }, _createSmartBuyStateEngine: function _createSmartBuyStateEngine() {
+ return new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine
+ }, _onHydrateCompleted: function _onHydrateCompleted() {
+ if (this.media.isFailed)
+ this._handleError();
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.applicationStateManager)) {
+ var applicationStateManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.applicationStateManager);
+ applicationStateManager.saveDetailsState(this.media)
+ }
+ }, _fragmentContainerShown: function _fragmentContainerShown() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._fragmentContainerShown.call(this);
+ if (this.series)
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-series");
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-season");
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-episode")
+ }, _modifierSelectedItemChangedCallback: function _modifierSelectedItemChangedCallback() {
+ if (this.series && (this.series.seasons || this.series.librarySeasons) && this.modifierSelectionManager.selectedItem && this.modifierSelectionManager.selectedItem.media) {
+ MS.Entertainment.Framework.assert(this.modifierSelectionManager.selectedItem.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason, "Non-season used in the season drop down in tv series inline details");
+ if (this.modifierSelectionManager.selectedItem.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this._setMedia(this.modifierSelectionManager.selectedItem.media)
+ }
+ }, _setSeasonFromSeries: function _setSeasonFromSeries(media) {
+ media = MS.Entertainment.ViewModels.MediaItemModel.augment(media);
+ this.series = media;
+ this._hydrateMedia().then(function seriesHydrated() {
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries) {
+ this._formatDetailString();
+ var seasons = media.seasons ? media.seasons : media.librarySeasons;
+ if (seasons)
+ seasons.toArrayAll().then(function(items) {
+ this.seasonSelections = [];
+ items.forEach(function(season) {
+ var item = {
+ media: season, label: MS.Entertainment.Formatters.formatTVSeasonNumberInt(season.seasonNumber)
+ };
+ this.seasonSelections.push(item)
+ }.bind(this));
+ media = items[items.length - 1];
+ this.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(this.seasonSelections, items.length - 1);
+ var binding = WinJS.Binding.bind(this.modifierSelectionManager, {selectedItem: this._modifierSelectedItemChangedCallback.bind(this)})
+ }.bind(this))
+ }
+ }.bind(this))
+ }, _setMedia: function _setMedia(media) {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._setMedia.apply(this, arguments);
+ if (Microsoft.Entertainment.Queries.ObjectType.tvSeries === this.media.mediaType || (MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem === this.media.serviceType && MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series === this.media.type)) {
+ this._setSeasonFromSeries(this.media);
+ return
+ }
+ if (Microsoft.Entertainment.Queries.ObjectType.tvSeason === this.media.mediaType || (MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem === this.media.serviceType && MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season === this.media.type))
+ this.season = this.media;
+ this.media = MS.Entertainment.ViewModels.MediaItemModel.augment(this.media);
+ this.showEpisode = (this.episode && this.episode === this.media);
+ this._updateShowBackButton();
+ this._hideShowEpisodeList();
+ this._hydrateMedia();
+ if (this._fileTransferListenerId && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer)) {
+ if (!this.media.contentNotifications)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(this.media, "contentNotifications", new MS.Entertainment.UI.ContentNotification.ObservableNotificationArray);
+ else
+ this.media.contentNotifications.clear();
+ var mediaKey = this.showEpisode ? null : this.media.seriesId.toLowerCase() + "_s" + this.media.seasonNumber;
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ var getTaskKey = null;
+ var listenerId = this._fileTransferListenerId;
+ if (this.showEpisode)
+ getTaskKey = function getTaskKey(task) {
+ return (task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && task.libraryId === media.libraryId) ? task.libraryId : null
+ };
+ else {
+ getTaskKey = function getTaskKey(task) {
+ if (task && task.seriesMediaId && !MS.Entertainment.Utilities.isEmptyGuid(task.seriesMediaId)) {
+ var taskKey = task.seriesMediaId.toLowerCase() + "_s" + task.seasonNumber;
+ if (taskKey === mediaKey)
+ return mediaKey
+ }
+ return null
+ };
+ listenerId = listenerId + "_season"
+ }
+ fileTransferService.registerListener(listenerId, getTaskKey, this.media, this.showEpisode ? MS.Entertainment.UI.FileTransferNotifiers.genericFile : MS.Entertainment.UI.FileTransferNotifiers.episodeCollection);
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.media)
+ }
+ var binding;
+ if (!this.series || this.media.mediaType !== Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this.description = String.empty;
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason && this.media.hasSeriesId) {
+ var updateEpisodes = function updateEpisodes() {
+ if (!this.media.episodesQueryFailed)
+ this._parseEpisodes(this.media.episodes);
+ else
+ this._parseEpisodes(null);
+ this._hideShowEpisodeList()
+ };
+ var episodesQueryFailed = function episodesQueryFailed() {
+ if (this.media.episodesQueryFailed)
+ this._loadLocalEpisodes()
+ };
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this._loadSeriesInfo();
+ binding = WinJS.Binding.bind(this.media, {
+ episodeCount: this._formatDetailString.bind(this), genre: this._formatDetailString.bind(this), episodes: updateEpisodes.bind(this), episodesQueryFailed: episodesQueryFailed.bind(this)
+ });
+ if (this.series)
+ this.mediaBindings.push(WinJS.Binding.bind(this.series, {description: this._formatDetailString.bind(this)}));
+ else
+ this.mediaBindings.push(WinJS.Binding.bind(this.media, {description: this._formatDetailString.bind(this)}));
+ this._detailStringBindingComplete = true
+ }
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ this._loadLocalSeriesInfo();
+ binding = WinJS.Binding.bind(this.media, {description: this._formatDetailString.bind(this)});
+ this._detailStringBindingComplete = true
+ }
+ else if (this.media === this.episode || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media)) {
+ binding = WinJS.Binding.bind(this.media, {
+ rightsHydrated: this._formatDetailString.bind(this), description: this._formatDetailString.bind(this), libraryDefinitions: this._formatDetailString.bind(this)
+ });
+ this._detailEpisodeStringBindingComplete = true
+ }
+ if (binding)
+ this.mediaBindings.push(binding);
+ this._formatDetailString();
+ this._setupSmartBuy();
+ var animations = [];
+ var episodeShown = !WinJS.Utilities.hasClass(this._episodeContent, "hideFromDisplay");
+ if (this.showEpisode) {
+ if (!episodeShown)
+ animations.push(MS.Entertainment.Utilities.showElement(this._episodeContent))
+ }
+ else if (episodeShown)
+ animations.push(MS.Entertainment.Utilities.hideElement(this._episodeContent));
+ WinJS.Promise.join(animations).done(function animationsComplete() {
+ if (this.showEpisode) {
+ if (this._actionButtons.restoreFocus)
+ this._actionButtons.restoreFocus(true);
+ else
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._actionButtons.domElement);
+ var lists = [this._latestEpisodeList, this._episodeList, this._extraEpisodeList];
+ lists.forEach(function(list) {
+ if (list) {
+ var item = list.getCurrentItem();
+ if (item && item.hasFocus) {
+ this._activeEpisodeList = list;
+ this._selectedEpisodeIndex = item.index
+ }
+ }
+ }.bind(this))
+ }
+ else {
+ var activeEpisodeList = this._activeEpisodeList;
+ var indexToFocus = this._selectedEpisodeIndex;
+ if (!this._activeEpisodeList) {
+ activeEpisodeList = this.showLatestEpisodes ? this._latestEpisodeList : this._episodeList;
+ indexToFocus = 0
+ }
+ activeEpisodeList.setCurrentItem({
+ index: indexToFocus, hasFocus: true, showFocus: MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus
+ })
+ }
+ }.bind(this))
+ }, _releaseMedia: function _releaseMedia() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._releaseMedia.apply(this, arguments);
+ if (this._episodeListHooked) {
+ this._episodeList.domElement.removeEventListener("iteminvoked", this._onEpisodeListItemClickCallback);
+ this._episodeListHooked = false
+ }
+ if (this._latestEpisodeListHooked) {
+ this._latestEpisodeList.domElement.removeEventListener("iteminvoked", this._onEpisodeListItemClickCallback);
+ this._latestEpisodeListHooked = false
+ }
+ if (this._extraEpisodeListHooked) {
+ this._extraEpisodeList.domElement.removeEventListener("iteminvoked", this._onEpisodeListItemClickCallback);
+ this._extraEpisodeListHooked = false
+ }
+ if (this.episodesQuery) {
+ this.episodesQuery.dispose();
+ this.episodesQuery = null
+ }
+ if (this._fileTransferListenerId) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ var listenerId = this._fileTransferListenerId;
+ if (!this.showEpisode)
+ listenerId = listenerId + "_season";
+ fileTransferService.unregisterListener(listenerId)
+ }
+ }, _setupSmartBuy: function _setupSmartBuy() {
+ if (this.showEpisode) {
+ var that = this;
+ var smartBuyButtonsChanged = function smartButtonsChanged(stateInfo) {
+ return MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoInlineDetailsStateChanged.call(this, stateInfo).then(function refreshedButtons(buttons) {
+ if (that._actionButtons.restoreFocus)
+ that._actionButtons.restoreFocus(true);
+ else
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(that._actionButtons.domElement);
+ return buttons
+ })
+ };
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getEpisodeDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.popover), smartBuyButtonsChanged)
+ }
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getTVSeasonInlineDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.popover), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onTVSeasonInlineDetailsStateChanged)
+ }, _handleError: function _handleError() {
+ if (this.media.inCollection)
+ this._loadLocalSeriesInfo();
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._handleError.apply(this, arguments)
+ }, _loadLocalSeriesInfo: function _loadLocalSeriesInfo() {
+ var loadEpisodesPromise = this._loadLocalEpisodes();
+ var loadSeriesPromise = this._loadSeriesInfo();
+ WinJS.Promise.join([loadEpisodesPromise, loadSeriesPromise]).then(function() {
+ this._showPanel()
+ }.bind(this))
+ }, _loadLocalEpisodes: function loadLocalEpisodes() {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ if (!this.media.inCollection || this.showEpisode) {
+ completion();
+ return
+ }
+ var query = new MS.Entertainment.Data.Query.libraryVideoTV;
+ query.seasonId = this.media.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.VideosSortBy.seriesTitleSeasonNumberEpisodeNumber;
+ query.isLive = true;
+ query.execute().then(function queryComplete(q) {
+ if (!this.episodes) {
+ this._parseEpisodes(q.result.items);
+ this.episodesQuery = query;
+ this._hideShowEpisodeList()
+ }
+ completion()
+ }.bind(this));
+ return promise
+ }, _hasVideoRating: function hasVideoRating(rating) {
+ var lowerCased = rating && rating.toLowerCase();
+ if (!lowerCased)
+ return false;
+ switch (lowerCased) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.edsVideoRating.nr:
+ case MS.Entertainment.Data.Augmenter.Marketplace.edsVideoRating.notRated:
+ case MS.Entertainment.Data.Augmenter.Marketplace.edsVideoRating.unrated:
+ return false
+ }
+ return true
+ }, _loadSeriesInfo: function _loadSeriesInfo() {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason && !this._isOnline) {
+ this._loadLocalEpisodes();
+ completion()
+ }
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason && this.media.seriesId && this.media.seriesId !== MS.Entertainment.Utilities.EMPTY_GUID) {
+ var series = this.series;
+ if (!series) {
+ series = new MS.Entertainment.Data.Augmenter.Marketplace.Video.EdsTVSeries;
+ series.serviceId = this.media.seriesId;
+ series.serviceIdType = this.media.seriesIdType
+ }
+ series.hydrate().done(function populateSeriesInfo() {
+ this.media.genre = series.genre;
+ if (!this._hasVideoRating(this.media.rating))
+ this.media.rating = series.rating;
+ if (this.media.seasonNumber > 0 && series.seasons)
+ series.seasons.itemsFromIndex(0).done(function processItems(args) {
+ for (var x = 0; x < args.items.length; x++)
+ if (this.media.seasonNumber === args.items[x].data.seasonNumber) {
+ this.media.releaseDate = this.media.releaseDate || args.items[x].data.releaseDate;
+ this.media.episodeCount = this.media.episodeCount || args.items[x].data.episodeCount;
+ this.media.description = this.media.description || args.items[x].data.description;
+ this.media.rights = this.media.rights || args.items[x].data.rights;
+ this.media.isComplete = this.media.isComplete || args.items[x].data.isComplete;
+ break
+ }
+ if (this.showEpisode)
+ this._formatDetailString();
+ completion()
+ }.bind(this));
+ else {
+ this._formatDetailString();
+ completion()
+ }
+ }.bind(this), function seriesInfoError() {
+ this._loadLocalEpisodes();
+ completion()
+ }.bind(this))
+ }
+ return promise
+ }, _onEpisodeListItemClick: function TVSeriesInlineDetails_onEpisodeListItemClick(event) {
+ this.description = String.empty;
+ MS.Entertainment.Utilities.hideElement(this._seasonContent).done(function loadEpisode() {
+ event.detail.itemPromise.then(function getItemData(data) {
+ this.episode = data.data;
+ this._setMedia(this.episode);
+ MS.Entertainment.Utilities.showElement(this._episodeContent)
+ }.bind(this))
+ }.bind(this))
+ }, _backFromEpisode: function _backFromEpisode() {
+ this.episode = null;
+ this._seasonContent.setAttribute("data-ent-showanimation", "enterPage");
+ this.description = String.empty;
+ MS.Entertainment.Utilities.hideElement(this._episodeContent).done(function loadSeason() {
+ this._setMedia(this.season);
+ MS.Entertainment.Utilities.showElement(this._seasonContent)
+ }.bind(this))
+ }, _canNavigateBackfromEpisode: function _canNavigateBackfromEpisode() {
+ return this.showEpisode && (this.season || this.series)
+ }, _updateShowBackButton: function _updateShowBackButton() {
+ var showBackButton = this._canNavigateBackfromEpisode() && MS.Entertainment.Utilities.isApp1;
+ if (showBackButton !== this.showBackButton)
+ this.showBackButton = showBackButton
+ }, _formatDetailString: function formatDetailString() {
+ if (this.showEpisode)
+ return this._formatEpisodeDetailString();
+ if (this.series)
+ return this._formatSeriesDetailString();
+ return this._formatSeasonDetailString()
+ }, _formatSeasonDetailString: function formatDetailString() {
+ if (!this._detailStringBindingComplete)
+ return;
+ if (!this.media.rightsHydrated)
+ return;
+ var values = [];
+ var releaseDate = this._getReleaseDate();
+ if (releaseDate)
+ values.push(releaseDate);
+ if (this.media.rating)
+ values.push(this.media.rating);
+ var genres = this._getGenres();
+ if (genres)
+ values.push(genres);
+ var episodesLabel = this._getEpisodeCountLabel();
+ if (episodesLabel)
+ values.push(episodesLabel);
+ var detailString = values.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR));
+ if (this.detailString !== detailString)
+ this.detailString = detailString;
+ if (!this.detailString)
+ this.detailString = " ";
+ this._updateDescription()
+ }, _formatSeriesDetailString: function _formatSeriesDetailString() {
+ if (!this._detailStringBindingComplete)
+ return;
+ if (!this.series.rightsHydrated && this.series.mediaType !== Microsoft.Entertainment.Queries.ObjectType.tvSeries)
+ return;
+ var values = [];
+ if (this.originalLocation === MS.Entertainment.Data.ItemLocation.collection && this.series.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ if (this.series.seasonNumber <= 0)
+ values.push(String.load(String.id.IDS_TV_SEASON_0_NAME));
+ else
+ values.push(String.load(String.id.IDS_TV_SEASON_NAME).format(this.series.seasonNumber));
+ var genres = this._getGenres();
+ if (genres)
+ values.push(genres);
+ if (this.series.rating)
+ values.push(this.series.rating);
+ var seasonsLabel = this._getSeasonCountLabel();
+ if (seasonsLabel)
+ values.push(seasonsLabel);
+ var seriesDetailString = values.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR));
+ if (this.seriesDetailString !== seriesDetailString)
+ this.seriesDetailString = seriesDetailString;
+ if (!this.seriesDetailString)
+ this.seriesDetailString = " ";
+ this._updateDescription()
+ }, _formatEpisodeDetailString: function formatEpisodeDetailString() {
+ if (!this._detailEpisodeStringBindingComplete)
+ return;
+ if (!this.media.rightsHydrated)
+ return;
+ var episodeDetailString = MS.Entertainment.Formatters.formatEpisodeMetadata(this.media, {
+ releaseDate: true, genres: true, network: true, languages: true, rating: true, videoDefinition: true, duration: true
+ });
+ if (this.episodeDetailString !== episodeDetailString)
+ this.episodeDetailString = episodeDetailString;
+ if (!this.episodeDetailString)
+ this.episodeDetailString = " ";
+ var seasonNumberEpisodeNumberString = MS.Entertainment.Formatters.formatTVSeasonEpisodeNumberInt(this.media);
+ if (this.seasonNumberEpisodeNumberString !== seasonNumberEpisodeNumberString)
+ this.seasonNumberEpisodeNumberString = seasonNumberEpisodeNumberString;
+ if (!this.seasonNumberEpisodeNumberString)
+ this.seasonNumberEpisodeNumberString = " ";
+ this._updateDescription()
+ }, _updateDescription: function _updateDescription() {
+ if (this.showEpisode) {
+ if (this.description !== this.media.description && this.episodeDetailString && this.episodeDetailString !== " ")
+ this.description = this.media.description
+ }
+ else if (this.series) {
+ if (this.description !== this.series.description && this.seriesDetailString && this.seriesDetailString !== " ")
+ this.description = this.series.description
+ }
+ else if (this.description !== this.media.description && this.detailString && this.detailString !== " ")
+ this.description = MS.Entertainment.Utilities.isVideoApp1 ? this.media.description : null
+ }, _hideShowEpisodeList: function _hideShowEpisodeList() {
+ if (!this.showEpisode && this.episodes && this.episodes.length > 0) {
+ this._episodeList.domElement.addEventListener("iteminvoked", this._onEpisodeListItemClickCallback, false);
+ this._episodeListHooked = true;
+ this._showElement(this._episodesPanel, true)
+ }
+ else
+ this._showElement(this._episodesPanel, false);
+ if (!this.showEpisode && this.latestEpisodes && this.latestEpisodes.length > 0) {
+ this._latestEpisodeList.domElement.addEventListener("iteminvoked", this._onEpisodeListItemClickCallback, false);
+ this._latestEpisodeListHooked = true;
+ this._showElement(this._latestEpisodesPanel, true)
+ }
+ else
+ this._showElement(this._latestEpisodesPanel, false);
+ if (!this.showEpisode && this.extraEpisodes && this.extraEpisodes.length > 0) {
+ this._extraEpisodeList.domElement.addEventListener("iteminvoked", this._onEpisodeListItemClickCallback, false);
+ this._extraEpisodeListHooked = true;
+ this._showElement(this._extraEpisodesPanel, true)
+ }
+ else
+ this._showElement(this._extraEpisodesPanel, false)
+ }, _parseEpisodes: function _parseEpisodes(episodes) {
+ this.episodes = episodes === null ? null : [];
+ this.extraEpisodes = episodes === null ? null : [];
+ if (episodes && episodes.count > 0) {
+ var sevenDaysInMilliseconds = MS.Entertainment.Formatters.milliSecondsFromTimeSpan(7);
+ episodes.itemsFromIndex(0, 0, episodes.count).done(function gotLatestEpisode(latestEpisodes) {
+ var latestEpisode = null;
+ if (latestEpisodes && latestEpisodes.items && latestEpisodes.items.length > 0) {
+ var foundLatestAired = false;
+ var index = latestEpisodes.items.length - 1;
+ while (index >= 0) {
+ latestEpisode = latestEpisodes.items[index].data;
+ if (MS.Entertainment.Utilities.isVideoApp2 || latestEpisode.episodeNumber > 0)
+ this.episodes.unshift(latestEpisode);
+ else
+ this.extraEpisodes.unshift(latestEpisode);
+ if (!foundLatestAired) {
+ var todayDateOnly = new Date;
+ todayDateOnly.setTime(Date.now());
+ todayDateOnly.setHours(0, 0, 0, 0);
+ var latestEpisodeDateOnly = new Date;
+ latestEpisodeDateOnly.setTime(latestEpisode.releaseDate);
+ latestEpisodeDateOnly.setHours(0, 0, 0, 0);
+ var deltaDates = todayDateOnly - latestEpisodeDateOnly;
+ if (latestEpisode && (deltaDates >= 0 && deltaDates <= sevenDaysInMilliseconds))
+ this.latestEpisodes = [latestEpisode];
+ else
+ this.latestEpisodes = [];
+ foundLatestAired = deltaDates >= 0
+ }
+ index--
+ }
+ }
+ else
+ this.latestEpisodes = [];
+ this.showLatestEpisodes = MS.Entertainment.Utilities.isVideoApp1 && this.latestEpisodes.length > 0;
+ this.showExtraEpisodes = MS.Entertainment.Utilities.isVideoApp1 && this.extraEpisodes.length > 0;
+ this.showEpisodes = this.episodes.length > 0
+ }.bind(this))
+ }
+ else {
+ this.latestEpisodes = [];
+ this.showEpisodes = false;
+ this.showLatestEpisodes = false;
+ this.showExtraEpisodes = false
+ }
+ }, _getReleaseDate: function getReleaseDate() {
+ var releaseDate = null;
+ if (this.media.releaseDate) {
+ var formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media))
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).shortDate;
+ var date = new Date(this.media.releaseDate);
+ releaseDate = formatter.format(date)
+ }
+ return releaseDate
+ }, _getGenres: function getGenres() {
+ var genres = null;
+ if (this.media.genre)
+ if (Array.isArray(this.media.genre)) {
+ var genreNames = [];
+ this.media.genre.forEach(function(genre) {
+ if (genre)
+ genreNames.push(genre.name)
+ });
+ genres = genreNames.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else
+ genres = this.media.genre;
+ else if (this.media.genreName)
+ genres = this.media.genreName;
+ return genres
+ }, _getSeasonCountLabel: function getSeasonCountLabel() {
+ var label = null;
+ if (this.series.seasonCount && this.series.seasonCount > 0)
+ label = MS.Entertainment.Formatters.seasonCountText(this.series.seasonCount);
+ return label
+ }, _getEpisodeCountLabel: function getEpisodeCountLabel() {
+ var label = null;
+ var formattedNum;
+ if (this.media.episodeCount && this.media.episodeCount > 0) {
+ var stringId = String.id.IDS_TV_EPISODES_LABEL;
+ if (this.media.episodeCount === 1)
+ stringId = String.id.IDS_TV_EPISODE_LABEL;
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(this.media.episodeCount);
+ label = String.load(stringId).format(formattedNum)
+ }
+ return label
+ }
+ }, {
+ _episodeList: null, _latestEpisodeList: null, _extraEpisodeList: null, _onEpisodeListItemClickCallback: null, _onBackFromEpisodeClickCallback: null, _episodeListHooked: false, _latestEpisodeListHooked: false, _extraEpisodeListHooked: false, episodes: null, showEpisodes: false, latestEpisodes: null, showLatestEpisodes: false, extraEpisodes: null, showExtraEpisodes: false, episodeDetailString: null, seasonNumberEpisodeNumberString: null, seriesDetailString: null, description: null, episodesQuery: null, episode: null, showEpisode: false, showBackButton: false, season: null, series: null, seasonSelections: null, modifierSelectionManager: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {TvSeriesInlineDetailsFullScreen: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.TvSeriesInlineDetails", "/Components/InlineDetails/TvSeriesInlineDetails.html#tvSeriesInlineDetailsFullScreenTemplate", function TvSeriesInlineDetailsFullScreen(){}, {}, {})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Marketplace.html b/packages/microsoft.zunemusic/Components/Marketplace.html
new file mode 100644
index 00000000..9dd67810
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Marketplace.html
@@ -0,0 +1,59 @@
+
+
+
+
+ Marketplace Page Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Marketplace.js b/packages/microsoft.zunemusic/Components/Marketplace.js
new file mode 100644
index 00000000..aebcbec0
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Marketplace.js
@@ -0,0 +1,337 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MarketplaceBase: MS.Entertainment.UI.Framework.defineUserControl("/Components/Marketplace.html#marketplaceTemplate", function marketplaceBaseConstructor(element, options){}, {
+ view: null, templateSelectorConstructor: MS.Entertainment.UI.Controls.GalleryTemplateSelector, allowEmpty: false, clearItemsDuringQuery: false, usePageScroller: true, usePageScrollerChildAsAnimationRoot: false, pageScrollerAnimationRootSelectors: null, _pageScroller: null, _bindings: null, _viewModelEventHandlers: null, _currentGalleryClass: String.empty, _scrollerPadding: 175, selectedTemplate: {get: function() {
+ return (this._viewModel) ? this._viewModel.selectedTemplate : null
+ }}, initialize: function initialize() {
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRender() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioMarketplaceGalleryRequestToLoad()
+ });
+ this.bind("_viewModel", this._initializePage.bind(this));
+ this._bindings = WinJS.Binding.bind(this, {dataContext: this._updateViewModel.bind(this)});
+ MS.Entertainment.UI.Framework.UserControl.prototype.initialize.call(this)
+ }, unload: function unload() {
+ if (this._viewModel && this._viewModel.dispose)
+ this._viewModel.dispose();
+ if (this._viewModel && this._viewModel.unregisterServices)
+ this._viewModel.unregisterServices();
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._pageScroller) {
+ this._pageScroller.dispose();
+ this._pageScroller = null
+ }
+ this._uninitializePage();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ if (this._viewModel && this._viewModel.freeze)
+ this._viewModel.freeze();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._viewModel && this._viewModel.thaw)
+ this._viewModel.thaw();
+ if (this._pageScroller)
+ this._pageScroller.refreshScrollPosition()
+ }, _uninitializePage: function _uninitializePage() {
+ if (this._viewModelEventHandlers) {
+ this._viewModelEventHandlers.cancel();
+ this._viewModelEventHandlers = null
+ }
+ }, _updateViewModel: function _updateViewModel(newValue) {
+ if (newValue)
+ this._viewModel = newValue.viewModel
+ }, _initializePage: function initializePage() {
+ this._uninitializePage();
+ this._viewModelEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel, {
+ itemsChanged: this._setGalleryItems.bind(this), isFailedChanged: this._setFailedEvent.bind(this), largeItemIndexChanged: this._updateGalleryLargeItemIndex.bind(this)
+ });
+ this._setGalleryItems();
+ this._setFailedEvent();
+ this._updateGalleryLargeItemIndex()
+ }, _setPageScollerAnimationRoots: function _setPageScollerAnimationRoots() {
+ var rootElements = [];
+ if (!this._pageScroller || !Array.isArray(this.pageScrollerAnimationRootSelectors))
+ return;
+ this.pageScrollerAnimationRootSelectors.reduce(function(data, selector) {
+ var element = this.domElement.querySelector(selector);
+ if (element)
+ data.push(element);
+ return data
+ }.bind(this), rootElements);
+ this._pageScroller.animationRoots = rootElements
+ }, _setGalleryItems: function setGalleryItems() {
+ var node = this.selectedTemplate;
+ if (this._unloaded || !node || !this._viewModel.items || (!this._viewModel.items.count && (!this.allowEmpty && !node.allowEmpty && (this._viewModel.isCurrentQuery() || !this.clearItemsDuringQuery))) || (!this._viewModel.isCurrentQuery() && !this.clearItemsDuringQuery)) {
+ this._galleryView.dataSource = null;
+ return
+ }
+ if (this._galleryView.useItemsControlInGallery) {
+ this._initializeSelectionHandlers();
+ var items = new MS.Entertainment.Data.ObservableArrayVirtualListAdapter;
+ items.initialize(this._viewModel.items, function adapterFactory(item) {
+ return item
+ });
+ this._galleryView.dataSource = items;
+ if (this.usePageScroller) {
+ if (!this._pageScroller) {
+ this._pageScroller = new MS.Entertainment.UI.Controls.PageScroller(this._galleryScrollContainer, this._nextPageScroller, this._previousPageScroller);
+ this._pageScroller.leftScrollPadding = this._scrollerPadding;
+ this._pageScroller.rightScrollPadding = this._scrollerPadding;
+ this._pageScroller.logicalContainerSelector = ".marketplaceGalleryFlex";
+ this._pageScroller.useFirstChildAsAnimationRoot = this.usePageScrollerChildAsAnimationRoot;
+ this._setPageScollerAnimationRoots()
+ }
+ this._pageScroller.resetScrollPosition()
+ }
+ return
+ }
+ this._galleryView.headerType = node.headerType || MS.Entertainment.UI.Controls.GalleryControl.HeaderType.auto;
+ this._galleryView.largeItemSize = node.largeItemSize || this._galleryView.largeItemSize;
+ this._galleryView.multiSize = node.multiSize || false;
+ this._galleryView.maxRows = node.maxRows || -1;
+ this._galleryView.startNewColumnOnHeaders = node.startNewColumnOnHeaders || false;
+ this._galleryView.slotSize = node.slotSize;
+ this._galleryView.itemMargin = node.itemMargin;
+ this._galleryView.itemSize = node.itemSize;
+ this._galleryView.itemTemplate = node.templateUrl;
+ this._galleryView.panelTemplate = node.panelTemplateUrl;
+ this._galleryView.panelOptions = node.panelOptions;
+ this._galleryView.actionTemplate = node.actionTemplateUrl;
+ this._galleryView.mediaType = node.mediaType;
+ this._galleryView.headerClass = node.headerClass || null;
+ this._galleryView.horizontal = node.horizontal || false;
+ this._galleryView.grouped = node.grouped;
+ this._galleryView.layout = node.layout || MS.Entertainment.UI.Controls.GalleryControl.Layout.grid;
+ this._galleryView.invokeBehavior = node.invokeBehavior || MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.popOver;
+ this._galleryView.invokeHelperFactory = node.invokeHelperFactory || null;
+ this._galleryView.headerTemplate = node.groupTemplate || this._galleryView.headerTemplate || null;
+ this._galleryView.forceInteractive = node.forceInteractive || false;
+ this._galleryView.backdropColor = node.backdropColor;
+ this._galleryView.raisePanelResetEvents = node.raisePanelResetEvents || true;
+ this._galleryView.actionOptions = node.actionOptions || null;
+ this._galleryView.emptyGalleryTemplate = (!this._viewModel.isCurrentQuery() && this.clearItemsDuringQuery) ? null : node.emptyGalleryTemplate;
+ this._galleryView.emptyGalleryModel = this._viewModel.emptyGalleryModel || null;
+ this._galleryView.delayHydrateLibraryId = node.delayHydrateLibraryId || false;
+ this._galleryView.minimumListLength = node.minimumListLength;
+ this._galleryView.panelTemplateTypeMappings = node.panelTemplateTypeMappings;
+ this._galleryView.selectionStyleFilled = node.selectionStyleFilled || false;
+ this._galleryView.maxSelectionCount = node.maxSelectionCount;
+ this._galleryView.restoreFocusOnDataChanges = node.restoreFocusOnDataChanges || false;
+ if (node.selectionMode)
+ this._galleryView.selectionMode = node.selectionMode;
+ if (node.swipeBehavior)
+ this._galleryView.swipeBehavior = node.swipeBehavior;
+ this._galleryView.grouperItemThreshold = -1;
+ if (node.groupHeaderPosition)
+ this._galleryView.headerPosition = node.groupHeaderPosition;
+ if (this._galleryView.grouped) {
+ this._galleryView.grouperType = node.grouperType;
+ this._galleryView.grouper.keyPropertyName = node.grouperField;
+ this._galleryView.grouper.useKeyAsData = (node.grouperKeyAsData !== undefined) ? node.grouperKeyAsData : true
+ }
+ else
+ this._galleryView.grouperType = null;
+ if (this._currentGalleryClass)
+ WinJS.Utilities.removeClass(this._galleryView.domElement, this._currentGalleryClass);
+ if (node.galleryClass) {
+ WinJS.Utilities.addClass(this._galleryView.domElement, node.galleryClass);
+ this._currentGalleryClass = node.galleryClass
+ }
+ this._initializeSelectionHandlers();
+ this._galleryView.dataSource = this._viewModel.items
+ }, _initializeSelectionHandlers: function _initializeSelectionHandlers() {
+ if (this._galleryView.selectionMode !== MS.Entertainment.UI.Controls.GalleryControl.SelectionMode.none) {
+ var defaultSelectionHandlers = MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers(this._clearSelection.bind(this));
+ this._galleryView.addSelectionHandlers(defaultSelectionHandlers);
+ this._galleryView.addSelectionHandlers({deleteMedia: this._handleItemDeleted.bind(this)})
+ }
+ }, _handleItemDeleted: function _handleItemDeleted(eventArgs) {
+ var deleted = eventArgs.detail && eventArgs.detail.deleted;
+ if (deleted)
+ this._clearSelection()
+ }, _clearSelection: function _clearSelection() {
+ this._galleryView.clearSelection()
+ }, _setFailedEvent: function updateFailed() {
+ if (this._viewModel.isFailed)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement, true, this._viewModel.failedGalleryModel)
+ }, _updateGalleryLargeItemIndex: function updateGalleryLargeItemIndex() {
+ if (this._unloaded)
+ return;
+ this._galleryView.largeItemIndex = this._viewModel.largeItemIndex
+ }, _mergeGroupItems: function mergeGroupItems(lessSignificantGroupItem, moreSignificantGroupItem) {
+ if (lessSignificantGroupItem && moreSignificantGroupItem) {
+ var combinedItem = {};
+ for (var property in lessSignificantGroupItem)
+ combinedItem[property] = lessSignificantGroupItem[property];
+ for (property in moreSignificantGroupItem)
+ combinedItem[property] = moreSignificantGroupItem[property];
+ return combinedItem
+ }
+ else if (lessSignificantGroupItem)
+ return lessSignificantGroupItem;
+ else if (moreSignificantGroupItem)
+ return moreSignificantGroupItem
+ }
+ }, {
+ _viewModel: null, dataContext: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Marketplace: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MarketplaceBase", "/Components/Marketplace.html#marketplaceTemplate", function marketplaceConstructor(element, options){}, {
+ _galleryImageChangedCallback: null, _heroImageChangedCallback: null, _modifierSelectedItemChangedCallback: null, _marketplaceViewModelEventHandlers: null, _modifierEventHandlers: null, _secondaryModifierEventHandlers: null, _updatingSecondaryFilter: false, selectedTemplate: {get: function() {
+ return (!this.combinedQueryOptions) ? null : this._mergeGroupItems(this._viewModel.Templates[this.combinedQueryOptions.template], this.combinedQueryOptions)
+ }}, primaryFilterSelectedItem: {get: function() {
+ return this._viewModel && this._viewModel.modifierSelectionManager ? this._viewModel.modifierSelectionManager.selectedItem : null
+ }}, secondaryFilterSelectedItem: {get: function() {
+ return this._viewModel && this._viewModel.secondaryModifierSelectionManager ? this._viewModel.secondaryModifierSelectionManager.selectedItem : null
+ }}, primaryFilterDataSource: {
+ get: function() {
+ return this._viewModel && this._viewModel.modifierSelectionManager ? this._viewModel.modifierSelectionManager.dataSource : null
+ }, set: function(value) {
+ if (this._viewModel && this._viewModel.modifierSelectionManager)
+ this._viewModel.modifierSelectionManager.dataSource = value
+ }
+ }, secondaryFilterDataSource: {
+ get: function() {
+ return this._viewModel && this._viewModel.secondaryModifierSelectionManager ? this._viewModel.secondaryModifierSelectionManager.dataSource : null
+ }, set: function(value) {
+ if (this._viewModel && this._viewModel.secondaryModifierSelectionManager)
+ this._viewModel.secondaryModifierSelectionManager.dataSource = value
+ }
+ }, initialize: function initialize() {
+ this._galleryImageChangedCallback = this._setGalleryImage.bind(this);
+ this._heroImageChangedCallback = this._setHeroImage.bind(this);
+ this._modifierSelectedItemChangedCallback = this._modifierSelectionChanged.bind(this);
+ this._modifierChanged = this._modifierChanged.bind(this);
+ this._secondaryModifierChanged = this._secondaryModifierChanged.bind(this);
+ MS.Entertainment.Pages.MarketplaceBase.prototype.initialize.apply(this, arguments)
+ }, addEventHandlers: function addEventHandlers() {
+ this._marketplaceViewModelEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel, {
+ galleryImageUrlChanged: this._galleryImageChangedCallback, heroImageUrlChanged: this._heroImageChangedCallback, modifierChanged: this._modifierChanged, secondaryModifierChanged: this._secondaryModifierChanged
+ })
+ }, cancelEventHandlers: function cancelEventHandlers() {
+ if (this._marketplaceViewModelEventHandlers) {
+ this._marketplaceViewModelEventHandlers.cancel();
+ this._marketplaceViewModelEventHandlers = null
+ }
+ this._cancelModifierEventHandlers();
+ this._cancelSecondaryModifierEventHandlers()
+ }, _cancelModifierEventHandlers: function _cancelModifierEventHandlers() {
+ if (this._modifierEventHandlers) {
+ this._modifierEventHandlers.cancel();
+ this._modifierEventHandlers = null
+ }
+ }, _cancelSecondaryModifierEventHandlers: function _cancelSecondaryModifierEventHandlers() {
+ if (this._secondaryModifierEventHandlers) {
+ this._secondaryModifierEventHandlers.cancel();
+ this._secondaryModifierEventHandlers = null
+ }
+ }, unload: function unload() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype.unload.call(this)
+ }, _uninitializePage: function _uninitializePage() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype._uninitializePage.apply(this, arguments);
+ this.cancelEventHandlers()
+ }, _initializePage: function initializePage() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype._initializePage.apply(this, arguments);
+ this.addEventHandlers();
+ this._galleryImageChangedCallback();
+ if (!this.primaryFilterDataSource || this.primaryFilterDataSource.length === 0 || !this.primaryFilterSelectedItem)
+ this._viewModel.populatePrimaryFilter();
+ else
+ this._modifierSelectedItemChangedCallback()
+ }, _setGalleryImage: function setGalleryImage() {
+ this._hubImage = this._viewModel.galleryImageUrl
+ }, _setHeroImage: function setHeroImage() {
+ if (this._heroImageContainer && this._viewModel && this._viewModel.heroImageUrl) {
+ this._heroImageContainer.target = this._viewModel.heroImageUrl;
+ if (this._heroPrimaryTextContainer && this._viewModel.heroPrimaryText)
+ MS.Entertainment.Utilities.showElement(this._heroPrimaryTextContainer);
+ if (this._heroSecondaryTextContainer && this._viewModel.heroSecondaryText)
+ MS.Entertainment.Utilities.showElement(this._heroSecondaryTextContainer);
+ this.usePageScrollerChildAsAnimationRoot = false;
+ this.pageScrollerAnimationRootSelectors = [".marketplaceGallery-image", ".marketplaceGalleryFlex"];
+ this._setPageScollerAnimationRoots();
+ if (this._pageScroller && this._pageScroller.useFirstChildAsAnimationRoot)
+ this._pageScroller.useFirstChildAsAnimationRoot = this.usePageScrollerChildAsAnimationRoot
+ }
+ }, _updateSecondaryFilter: function updateSecondaryFilter(primaryFilterItem) {
+ if (primaryFilterItem && !this._updatingSecondaryFilter) {
+ var secondaryFilterUpdated = false;
+ this._updatingSecondaryFilter = true;
+ if (!primaryFilterItem.secondaryFilter && this.secondaryFilterDataSource && this.secondaryFilterDataSource.length !== 0) {
+ this.secondaryFilterDataSource = [];
+ secondaryFilterUpdated = true
+ }
+ else if (primaryFilterItem.secondaryFilter !== undefined && (this.combinedQueryOptions === undefined || primaryFilterItem.secondaryFilter !== this.combinedQueryOptions.secondaryFilter)) {
+ this._viewModel.populateSecondaryFilter(this.primaryFilterSelectedItem);
+ secondaryFilterUpdated = true
+ }
+ this._updatingSecondaryFilter = false;
+ this.combinedQueryOptions = primaryFilterItem;
+ return secondaryFilterUpdated
+ }
+ }, _updateGalleryItems: function updateGalleryItems(combinedQueryOptions) {
+ if (combinedQueryOptions && combinedQueryOptions.query) {
+ var imageQuery = null;
+ var galleryImage = null;
+ var contentQuery = new combinedQueryOptions.query;
+ this.combinedQueryOptions = combinedQueryOptions;
+ this._viewModel.combinedQueryOptions = combinedQueryOptions;
+ if (combinedQueryOptions.serviceId !== undefined)
+ contentQuery.serviceId = combinedQueryOptions.serviceId;
+ if (combinedQueryOptions.genre !== undefined)
+ contentQuery.genre = combinedQueryOptions.genre;
+ if (combinedQueryOptions.studio !== undefined)
+ contentQuery.studio = combinedQueryOptions.studio;
+ if (combinedQueryOptions.network !== undefined)
+ contentQuery.network = combinedQueryOptions.network;
+ if (combinedQueryOptions.impressionGuid !== undefined)
+ contentQuery.impressionGuid = combinedQueryOptions.impressionGuid;
+ if (combinedQueryOptions.orderBy !== undefined)
+ contentQuery.orderBy = combinedQueryOptions.orderBy;
+ if (combinedQueryOptions.sort !== undefined)
+ contentQuery.sort = combinedQueryOptions.sort;
+ if (combinedQueryOptions.startsWith !== undefined)
+ contentQuery.startsWith = combinedQueryOptions.startsWith;
+ if (combinedQueryOptions.imageUri !== undefined)
+ galleryImage = combinedQueryOptions.imageUri;
+ if (combinedQueryOptions.galleryImage !== undefined && combinedQueryOptions.serviceId !== undefined) {
+ imageQuery = new combinedQueryOptions.galleryImage;
+ imageQuery.id = combinedQueryOptions.serviceId
+ }
+ if (combinedQueryOptions.desiredMediaItemTypes !== undefined)
+ contentQuery.desiredMediaItemTypes = combinedQueryOptions.desiredMediaItemTypes;
+ if (combinedQueryOptions.playlistId !== undefined)
+ contentQuery.playlistId = combinedQueryOptions.playlistId;
+ if (combinedQueryOptions.mediaItemObjectType !== undefined)
+ contentQuery.mediaItemObjectType = combinedQueryOptions.mediaItemObjectType;
+ this._viewModel.beginQuery(contentQuery, imageQuery, galleryImage)
+ }
+ }, _modifierChanged: function _modifierChanged() {
+ this._cancelModifierEventHandlers();
+ if (this._viewModel.modifierSelectionManager) {
+ this._modifierEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel.modifierSelectionManager, {selectedItemChanged: this._modifierSelectedItemChangedCallback});
+ this._modifierSelectionChanged()
+ }
+ }, _secondaryModifierChanged: function _secondaryModifierChanged() {
+ this._cancelSecondaryModifierEventHandlers();
+ if (this._viewModel.secondaryModifierSelectionManager) {
+ this._secondaryModifierEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel.secondaryModifierSelectionManager, {selectedItemChanged: this._modifierSelectedItemChangedCallback});
+ this._modifierSelectionChanged()
+ }
+ }, _modifierSelectionChanged: function modifierSelectionChanged() {
+ var primaryFilterSelectedItem = this.primaryFilterSelectedItem;
+ if (primaryFilterSelectedItem !== null)
+ if (!this._updateSecondaryFilter(primaryFilterSelectedItem)) {
+ this._galleryView.emptyGalleryTemplate = null;
+ this._galleryView.dataSource = null;
+ var mergedItem = this._mergeGroupItems(primaryFilterSelectedItem, this.secondaryFilterSelectedItem);
+ this._updateGalleryItems(mergedItem)
+ }
+ }
+ }, {_hubImage: null}, {})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MarketplaceListViewModelGallery: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MarketplaceBase", "/Components/Marketplace.html#marketplaceListViewModelGalleryTemplate", function marketplaceListViewModelGalleryConstructor(element, options){})})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/AppServices.js b/packages/microsoft.zunemusic/Components/Music/AppServices.js
new file mode 100644
index 00000000..331c1c0d
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/AppServices.js
@@ -0,0 +1,6 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.purchaseFlowProvider, MS.Entertainment.Purchase.MusicPurchaseFlowProvider.factory)
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/CloudGrovelInfo.html b/packages/microsoft.zunemusic/Components/Music/CloudGrovelInfo.html
new file mode 100644
index 00000000..bffab0a1
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/CloudGrovelInfo.html
@@ -0,0 +1,117 @@
+
+
+
+
+ Cloud Grovel Info
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/CloudMatchIconDialog.html b/packages/microsoft.zunemusic/Components/Music/CloudMatchIconDialog.html
new file mode 100644
index 00000000..b694c689
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/CloudMatchIconDialog.html
@@ -0,0 +1,82 @@
+
+
+
+
+ Cloud Match Icon Dialog
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/CloudMatchOptInDialog.html b/packages/microsoft.zunemusic/Components/Music/CloudMatchOptInDialog.html
new file mode 100644
index 00000000..cd2088e6
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/CloudMatchOptInDialog.html
@@ -0,0 +1,54 @@
+
+
+
+
+ Cloud Match Opt In Dialog
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/FeaturedMusicAdFreeView1.html b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicAdFreeView1.html
new file mode 100644
index 00000000..1f497687
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicAdFreeView1.html
@@ -0,0 +1,392 @@
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/FeaturedMusicAdFreeView2.html b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicAdFreeView2.html
new file mode 100644
index 00000000..b21ac6bf
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicAdFreeView2.html
@@ -0,0 +1,395 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/FeaturedMusicView1.html b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicView1.html
new file mode 100644
index 00000000..56b79bda
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicView1.html
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/FeaturedMusicView2.html b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicView2.html
new file mode 100644
index 00000000..ed71cf4c
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicView2.html
@@ -0,0 +1,284 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/FeaturedMusicViewDemo.html b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicViewDemo.html
new file mode 100644
index 00000000..a5accb73
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/FeaturedMusicViewDemo.html
@@ -0,0 +1,85 @@
+
+
+
+
+ Music Demo Featured
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/FindAlbumInfo.html b/packages/microsoft.zunemusic/Components/Music/FindAlbumInfo.html
new file mode 100644
index 00000000..e6cf589c
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/FindAlbumInfo.html
@@ -0,0 +1,198 @@
+
+
+
+
+ Find Album Info
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/IMusicStateHandlers.js b/packages/microsoft.zunemusic/Components/Music/IMusicStateHandlers.js
new file mode 100644
index 00000000..c5363180
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/IMusicStateHandlers.js
@@ -0,0 +1,2 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
diff --git a/packages/microsoft.zunemusic/Components/Music/LocalGrovelInfo.html b/packages/microsoft.zunemusic/Components/Music/LocalGrovelInfo.html
new file mode 100644
index 00000000..f7a70d1f
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/LocalGrovelInfo.html
@@ -0,0 +1,54 @@
+
+
+
+
+ Local Grovel Info
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/Music.html b/packages/microsoft.zunemusic/Components/Music/Music.html
new file mode 100644
index 00000000..51a1973d
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/Music.html
@@ -0,0 +1,95 @@
+
+
+
+
+ Music Hub Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicBrandDialog.html b/packages/microsoft.zunemusic/Components/Music/MusicBrandDialog.html
new file mode 100644
index 00000000..59734bd9
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicBrandDialog.html
@@ -0,0 +1,56 @@
+
+
+
+
+ Music Branded Dialog
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicCollection.js b/packages/microsoft.zunemusic/Components/Music/MusicCollection.js
new file mode 100644
index 00000000..8920bcbc
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicCollection.js
@@ -0,0 +1,606 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {
+ MusicCollection: MS.Entertainment.UI.Framework.defineUserControl(null, function musicCollectionConstructor(element, options) {
+ var gallery = document.createElement("div");
+ gallery.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.GalleryControl");
+ gallery.className = "collectionMusicGalleryView collectionMusic collectionGallery";
+ this._galleryView = new MS.Entertainment.UI.Controls.GalleryControl(gallery, {
+ tap: MS.Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly, selectionMode: MS.Entertainment.UI.Controls.GalleryControl.SelectionMode.multi, templateSelectorConstructor: MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector, swipeBehavior: MS.Entertainment.UI.Controls.GalleryControl.swipeBehavior.select, focusFirstItemOnPageLoad: true, selectionStyleFilled: true
+ });
+ element.appendChild(gallery)
+ }, {
+ _viewModel: null, _galleryView: null, _songClickedHandler: null, _artistClickedHandler: null, _currentClickHandler: null, _selectedSong: null, _bindings: null, _uiStateBindings: null, _viewModelEvents: null, _appBarService: null, view: null, canZoom: {get: function() {
+ return this._galleryView && this._galleryView.canZoom
+ }}, isZoomReady: {get: function() {
+ return this._galleryView && this._galleryView.isZoomReady
+ }}, isZoomedOut: {
+ get: function() {
+ return this._galleryView && this._galleryView.isZoomedOut
+ }, set: function(newValue) {
+ if (this._galleryView) {
+ this._galleryView.isZoomedOut = newValue;
+ this.updateAndNotify("isZoomedOut", newValue)
+ }
+ }
+ }, initialize: function initialize() {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRender() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchToCollection();
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioCollectionGalleryRequestToLoad()
+ });
+ this._songClickedHandler = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._songClicked, this);
+ this._bindings = WinJS.Binding.bind(this, {
+ dataContext: this._initializePage.bind(this), _galleryView: {
+ canZoom: function notifyCanZoom(newValue) {
+ this.notify("canZoom", newValue, false)
+ }.bind(this), isZoomedOut: function setIsZoomedOut(newValue) {
+ this.updateAndNotify("isZoomedOut", newValue)
+ }.bind(this)
+ }
+ });
+ this._uiStateBindings = WinJS.Binding.bind(uiState, {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ var updateGallery = this._updateGallery.bind(this);
+ var clearSelection = this._clearSelection.bind(this);
+ var removeItem = this._removeItemCompleted.bind(this);
+ var defaultSelectionHandlers = MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers(clearSelection, removeItem);
+ this._galleryView.addSelectionHandlers(defaultSelectionHandlers);
+ this._galleryView.addSelectionHandlers({
+ createNewPlaylist: updateGallery, renamePlaylist: updateGallery, deleteMedia: removeItem, findAlbumInfo: clearSelection
+ })
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._binding = null
+ }
+ if (this._uiStateBindings) {
+ this._uiStateBindings.cancel();
+ this._uiStateBindings = null
+ }
+ if (this._galleryView)
+ this._galleryView.clearSelectionHandlers();
+ this._disposeViewModel();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._selectedSong) {
+ var control = this._selectedSong.querySelector("[data-win-control], .ent-control").winControl;
+ control.expand(this._selectedSong);
+ control.panelClickHandler = this._inPlacePanelClick.bind(this);
+ control.domElement.addEventListener("click", control.panelClickHandler, false)
+ }
+ }, _disposeViewModel: function _disposeViewModel() {
+ if (this._viewModel)
+ this._viewModel.dispose();
+ if (this._viewModelEvents) {
+ this._viewModelEvents.cancel();
+ this._viewModelEvents = null
+ }
+ }, _setClickHandler: function setClickHandler(handler) {
+ if (this._currentClickHandler)
+ this._galleryView.domElement.removeEventListener("iteminvoked", this._currentClickHandler);
+ this._currentClickHandler = handler;
+ this._galleryView.domElement.addEventListener("iteminvoked", this._currentClickHandler, false)
+ }, _initializePage: function initializePage() {
+ if (!this.dataContext)
+ return;
+ this._disposeViewModel();
+ this._viewModel = this.dataContext.viewModel;
+ this._viewModel.view = this.view;
+ this._initializeGalleryView();
+ this._viewModelEvents = MS.Entertainment.Utilities.addEventHandlers(this._viewModel, {
+ itemsChanged: this._viewModelDataChanged.bind(this), isFailedChanged: this._viewModelFailedChanged.bind(this), notificationsChanged: this._onNotificationsChanged.bind(this)
+ });
+ this._viewModelDataChanged()
+ }, _initializeGalleryView: function initializeGalleryView() {
+ var node = this._viewModel.selectedTemplate;
+ this._galleryView.queryToPause = null;
+ this._galleryView.mediaType = this.view;
+ this._galleryView.emptyGalleryTemplate = node.emptyGalleryTemplate || "Controls/GalleryControl.html#listViewEmptyGalleryWithNotificationsTemplate";
+ this._galleryView.emptyGalleryModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ this.dataContext.hideShadow = node.hideShadow
+ }, _viewModelFailedChanged: function _viewModelFailedChanged() {
+ if (this._viewModel && this._viewModel.errorModel)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement, true, this._viewModel.errorModel)
+ }, _viewModelDataChanged: function viewModelDataChanged() {
+ if (!this._viewModel.items || !this._viewModel.isCurrentQuery())
+ return;
+ var node = this._viewModel.selectedTemplate;
+ if (node.headerTemplate)
+ this._galleryView.headerTemplate = node.headerTemplate;
+ else
+ this._galleryView.headerTemplate = null;
+ if (node.panelTemplate) {
+ this._galleryView.panelTemplate = node.panelTemplate ? node.panelTemplate : null;
+ this._galleryView.panelOptions = node.panelOptions ? node.panelOptions : null;
+ this._galleryView.itemSize = node.itemSize ? node.itemSize : null;
+ this._galleryView.slotSize = node.slotSize ? node.slotSize : null
+ }
+ else {
+ this._galleryView.panelTemplate = null;
+ this._galleryView.panelOptions = null;
+ this._galleryView.itemSize = null;
+ this._galleryView.slotSize = null
+ }
+ this._galleryView.headerType = node.headerType || MS.Entertainment.UI.Controls.GalleryControl.HeaderType.auto;
+ this._galleryView.invokeBehavior = node.invokeBehavior || MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.popOver;
+ this._galleryView.actionOptions = node.actionOptions || null;
+ this._galleryView.invokeHelperFactory = node.invokeHelperFactory || null;
+ this._updateEmptyModel();
+ this._galleryView.itemTemplate = node.template;
+ this._galleryView.zoomedOutTemplate = node.zoomedOutTemplate;
+ this._galleryView.actionTemplate = node.actionTemplate;
+ this._galleryView.itemClass = node.itemClass || null;
+ this._galleryView.headerClass = node.headerClass || null;
+ this._galleryView.layout = node.layout || MS.Entertainment.UI.Controls.GalleryControl.Layout.grid;
+ this._galleryView.tap = node.tap || MS.Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly;
+ this._galleryView.headerPosition = node.groupHeaderPosition || null;
+ this._galleryView.forceInteractive = node.forceInteractive || false;
+ this._galleryView.grouperItemThreshold = node.grouperItemThreshold;
+ this._updateMinimumListLength();
+ this._galleryView.userGatedGallery = node.userGatedGallery || false;
+ this._galleryView.userGatedGalleryTemplate = node.userGatedGalleryTemplate || "Controls/GalleryControl.html#listViewEmptyGalleryWithNotificationsTemplate";
+ this._updateUserGatedModel();
+ this._galleryView.syncScreen = node.syncScreen || false;
+ this._galleryView.syncScreenTemplate = node.syncScreenTemplate || null;
+ this._updateSyncScreenModel();
+ this._galleryView.restoreFocusOnDataChanges = node.restoreFocusOnDataChanges || false;
+ this._galleryView.backdropColor = node.backdropColor;
+ this._galleryView.selectionHelperOptions = node.selectionHelperOptions || null;
+ this._galleryView.allowSelectAll = node.allowSelectAll || false;
+ this._galleryView.allowHeaders = node.allowHeaders === undefined ? true : node.allowHeaders;
+ this._galleryView.allowZoom = node.allowZoom || false;
+ this._galleryView.maxSelectionCount = node.maxSelectionCount;
+ if (!this._galleryView.mediaContext)
+ this._galleryView.mediaContext = this._appBarService.pushDefaultContext();
+ var clonedQuery = this._viewModel.cloneCurrentQuery();
+ if (clonedQuery)
+ clonedQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.playAll);
+ this._galleryView.mediaContext.containingMedia = {
+ playbackItemSource: clonedQuery, playbackOffset: 0
+ };
+ var collectionFilter = this._getCollectionFilter();
+ this._galleryView.mediaContext.collectionFilter = collectionFilter;
+ this._galleryView.mediaContext.setToolbarActions(node.getAppBarActions ? node.getAppBarActions() : []);
+ if (node.grouped || (node.grouperType && node.allowZoom)) {
+ this._galleryView.grouperType = node.grouperType;
+ this._galleryView.grouper.keyPropertyName = node.grouperField;
+ this._galleryView.grouper.parentKeyPropertyName = node.grouperParentKeyPropertyName;
+ this._galleryView.grouper.titlePropertyName = node.grouperTitlePropertyName;
+ this._galleryView.grouper.useKeyAsData = (node.grouperKeyAsData !== undefined) ? node.grouperKeyAsData : true
+ }
+ else
+ this._galleryView.grouperType = null;
+ if (this._currentGalleryClass) {
+ WinJS.Utilities.removeClass(this._galleryView.domElement, this._currentGalleryClass);
+ this._currentGalleryClass = String.empty
+ }
+ if (node.galleryClass) {
+ WinJS.Utilities.addClass(this._galleryView.domElement, node.galleryClass);
+ this._currentGalleryClass = node.galleryClass
+ }
+ this._galleryView.queryToPause = this._viewModel.pausableQuery;
+ this._galleryView.dataSource = this._viewModel.items;
+ if (collectionFilter && collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ WinJS.Utilities.addClass(this._galleryView.domElement, "collectionFiltered");
+ else
+ WinJS.Utilities.removeClass(this._galleryView.domElement, "collectionFiltered");
+ this._selectedSong = null;
+ this._inPlacePanelAnimating = false
+ }, _getCollectionFilter: function _getCollectionFilter() {
+ var collectionFilter;
+ var selectedFilter;
+ if (this._viewModel && this._viewModel.filterSelectionManager)
+ selectedFilter = WinJS.Binding.unwrap(this._viewModel.filterSelectionManager.selectedItem);
+ if (selectedFilter && selectedFilter.value && selectedFilter.value.queryOptions)
+ collectionFilter = selectedFilter.value.queryOptions.mediaAvailability;
+ return collectionFilter
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged() {
+ if (this._uiStateBindings)
+ this._updateEmptyModel()
+ }, _onNotificationsChanged: function _onNotificationsChanged() {
+ if (this._viewModelEvents) {
+ this._updateMinimumListLength();
+ this._updateEmptyModel()
+ }
+ }, _updateMinimumListLength: function _updateMinimumListLength() {
+ var notifications = this._viewModel.createNotificationActionCells ? this._viewModel.createNotificationActionCells() : null;
+ var numNotifications = (notifications && notifications.length) || 0;
+ this._galleryView.minimumListLength = numNotifications + this._viewModel.selectedTemplate.minimumListLength
+ }, _updateEmptyModel: function _updateEmptyModel() {
+ if (!this._viewModel.items || !this._viewModel.isCurrentQuery())
+ return;
+ var titleId;
+ var descriptionId;
+ var details;
+ switch (this._viewModel._view) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists:
+ titleId = String.id.IDS_PLAYLIST_NO_CONTENT_TITLE;
+ details = this._getEmptyPlaylistCollectionDetails();
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.smartDJs:
+ titleId = String.id.IDS_RADIO_EMPTY_GALLERY_TITLE;
+ details = MS.Entertainment.Pages.MusicCollection.getEmptySmartDJCollectionDetails();
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ titleId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_EMPTY_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_EMPTY_DESC;
+ details = this._getEmptyPlaylistCollectionDetails();
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.musicVideos:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_MUSIC_VIDEOS_EMPTY_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_COLLECTION_MUSIC_VIDEOS_EMPTY_DESC;
+ details = this._getEmptyCollectionDetails();
+ break;
+ default:
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ titleId = String.id.IDS_COLLECTION_MUSIC_EMPTY;
+ else {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled))
+ titleId = String.id.IDS_MUSIC2_COLLECTION_EMPTY_TITLE_CLOUDV2_ALL;
+ else
+ titleId = String.id.IDS_MUSIC2_COLLECTION_EMPTY_TITLE
+ }
+ descriptionId = MS.Entertainment.Utilities.isMusicApp1 ? null : String.id.IDS_MUSIC2_COLLECTION_EMPTY_DESC;
+ details = this._getEmptyCollectionDetails();
+ break
+ }
+ var filter = this._getCollectionFilter();
+ if (filter && filter !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ details = details.concat(this._getEmptyFilteredDetails());
+ var notifications = this._viewModel.createNotificationActionCells ? this._viewModel.createNotificationActionCells() : null;
+ if (this._galleryView && this._galleryView.emptyGalleryModel) {
+ this._galleryView.emptyGalleryModel.primaryStringId = titleId;
+ this._galleryView.emptyGalleryModel.secondaryStringId = descriptionId;
+ this._galleryView.emptyGalleryModel.details = details;
+ this._galleryView.emptyGalleryModel.notifications = notifications
+ }
+ }, _getEmptyCollectionDetails: function _getEmptyCollectionDetails() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var details = [];
+ var filter = this._getCollectionFilter();
+ if (MS.Entertainment.Utilities.isMusicApp1 && filter !== Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloud) {
+ var onMoreAboutLibrariesAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showLocalGrovelInfoDialog);
+ details = [{
+ stringId: String.id.IDS_COLLECTION_MUSIC_EMPTY_2, linkStringId: String.id.IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK, linkAction: onMoreAboutLibrariesAction, linkIcon: MS.Entertainment.UI.Icon.search
+ }]
+ }
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ var navigateToMusicMarketplace = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateToMusicMarketplace.parameter = MS.Entertainment.UI.Monikers.musicMarketplace;
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ details.push({
+ stringId: String.id.IDS_MUSIC_COLLECTION_EMPTY_DESC, linkStringId: String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK, linkAction: navigateToMusicMarketplace, linkIcon: MS.Entertainment.UI.Icon.flexhub
+ });
+ else {
+ details.push({
+ linkStringId: String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_GUI, linkAction: navigateToMusicMarketplace, linkIcon: MS.Entertainment.UI.Icon.flexhub, voicePhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_CONF)
+ });
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled)) {
+ var learnMoreAction = new MS.Entertainment.UI.Actions.Action;
+ learnMoreAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardHomeUpsellPanelLearnMore;
+ learnMoreAction.canExecute = function canExecute(params) {
+ return true
+ };
+ learnMoreAction.executed = function executed() {
+ var cloudCollectionV2Url = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_CloudCollectionV2);
+ Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(cloudCollectionV2Url))
+ };
+ details.push({
+ linkStringId: String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_GUI, linkAction: learnMoreAction, linkIcon: MS.Entertainment.UI.Icon.flexhub, voicePhrase: String.load(String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_CONF)
+ })
+ }
+ }
+ }
+ return details
+ }, _getEmptyPlaylistCollectionDetails: function _getEmptyPlaylistCollectionDetails() {
+ var details = [];
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var createPlaylistAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.createPlaylist);
+ createPlaylistAction.automationId = MS.Entertainment.UI.AutomationIds.collectionCreatePlaylist;
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ details.push({
+ stringId: String.id.IDS_PLAYLIST_CREATE_PLAYLIST_DESC_TEXT, linkStringId: String.id.IDS_PLAYLIST_CREATE_PLAYLIST_LINK, linkAction: createPlaylistAction, linkIcon: WinJS.UI.AppBarIcon.add
+ });
+ var importPlaylistsAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.importPlaylists);
+ importPlaylistsAction.automationId = MS.Entertainment.UI.AutomationIds.collectionImportPlaylist;
+ details.push({
+ stringId: String.id.IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_DESC_TEXT, linkStringId: String.id.IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_LINK, linkAction: importPlaylistsAction, linkIcon: WinJS.UI.AppBarIcon.importall
+ })
+ }
+ else {
+ details.push({
+ linkStringId: String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_GUI, linkAction: createPlaylistAction, linkIcon: WinJS.UI.AppBarIcon.add, voicePhrase: String.load(String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_CONF)
+ });
+ var navigateToMusicMarketplace = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateToMusicMarketplace.parameter = MS.Entertainment.UI.Monikers.musicMarketplace;
+ details.push({
+ linkStringId: String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_GUI, linkAction: navigateToMusicMarketplace, linkIcon: MS.Entertainment.UI.Icon.flexhub, voicePhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_CONF)
+ })
+ }
+ return details
+ }, _getEmptyFilteredDetails: function _getEmptyFilteredDetails() {
+ var clearFilterAction = new MS.Entertainment.UI.Actions.Action;
+ clearFilterAction.automationId = MS.Entertainment.UI.AutomationIds.collectionEmptyShowAllMusicLink;
+ clearFilterAction.canExecute = function canExecute() {
+ return true
+ };
+ clearFilterAction.executed = function executed() {
+ if (this._viewModel && this._viewModel.clearFilter)
+ this._viewModel.clearFilter()
+ }.bind(this);
+ return [{
+ stringId: String.id.IDS_COLLECTION_FILTER_MUSIC_EMPTY_TEXT, linkStringId: String.id.IDS_COLLECTION_FILTER_MUSIC_EMPTY_LINK, linkAction: clearFilterAction, linkIcon: WinJS.UI.AppBarIcon.filter
+ }]
+ }, _updateUserGatedModel: function _updateUserGatedModel() {
+ if (this._galleryView && this._galleryView.userGatedGallery) {
+ var titleId;
+ var descriptionId;
+ var details;
+ switch (this._viewModel._view) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ titleId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_EMPTY_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_GATED_DESC;
+ details = this._getUserGatedMusic2PlaylistCollectionDetails();
+ this._galleryView.userGatedGalleryModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.newlyAdded:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.musicVideos:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_GATED_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_COLLECTION_GATED_DESC;
+ details = this._getUserGatedMusic2CollectionDetails();
+ this._galleryView.userGatedGalleryModel = new MS.Entertainment.UI.Controls.FailedPanelWithQueryModel;
+ this._galleryView.userGatedGalleryModel.query = this._createRecentAlbumsQuery();
+ this._galleryView.userGatedGalleryModel.itemTemplate = "/Components/Shell/Music2WelcomeDialog.html#welcomeDialogAlbumTemplate";
+ break;
+ default:
+ MS.Entertainment.Pages.fail("Unsupported user gated view: " + this._viewModel._view);
+ break
+ }
+ this._galleryView.userGatedGalleryModel.primaryStringId = titleId;
+ this._galleryView.userGatedGalleryModel.secondaryStringId = descriptionId;
+ this._galleryView.userGatedGalleryModel.details = details;
+ this._galleryView.userGatedGalleryModel.className = MS.Entertainment.Pages.MusicCollection.userGatedClass
+ }
+ }, _updateSyncScreenModel: function _updateSyncScreenModel() {
+ if (this._galleryView && this._galleryView.syncScreen) {
+ var titleId;
+ var descriptionId;
+ var action;
+ switch (this._viewModel._view) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ titleId = String.id.IDS_MUSIC2_PLAYLISTS_SYNC_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_PLAYLISTS_SYNC_DESC;
+ action = this._createSyncWaitAction(this._viewModel._view);
+ this._galleryView.syncScreenModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.newlyAdded:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.albums2:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.artists2:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.musicVideos:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_SYNC_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_COLLECTION_SYNC_DESC;
+ action = this._createSyncWaitAction(this._viewModel._view);
+ this._galleryView.syncScreenModel = new MS.Entertainment.UI.Controls.FailedPanelWithQueryModel;
+ this._galleryView.syncScreenModel.query = this._createRecentAlbumsQuery();
+ this._galleryView.syncScreenModel.itemTemplate = "/Components/Shell/Music2WelcomeDialog.html#welcomeDialogAlbumTemplate";
+ break;
+ default:
+ MS.Entertainment.Pages.fail("Unsupported playlist/collection syncing view: " + this._viewModel._view);
+ break
+ }
+ this._galleryView.syncScreenModel.primaryStringId = titleId;
+ this._galleryView.syncScreenModel.secondaryStringId = descriptionId;
+ this._galleryView.syncScreenModel.details = null;
+ this._galleryView.syncScreenModel.action = action;
+ this._galleryView.syncScreenModel.showLoadingRing = true;
+ this._galleryView.syncScreenModel.className = MS.Entertainment.Pages.MusicCollection.syncScreenClass
+ }
+ }, _createRecentAlbumsQuery: function _createRecentAlbumsQuery() {
+ var albumsQuery = new MS.Entertainment.Data.Query.Music.RecentList;
+ return {getItems: function getItems() {
+ return albumsQuery.execute().then(function gotRecentAlbums(q) {
+ var albums = q && q.result && q.result.itemsArray.filter(function imageFilter(item) {
+ return item.mediaType === Microsoft.Entertainment.Queries.ObjectType.album && !!item.imageResizeUri
+ });
+ if (albums.length >= MS.Entertainment.Pages.MusicCollection.recentAlbumsToDisplay)
+ return WinJS.Promise.wrap(albums.slice(0, MS.Entertainment.Pages.MusicCollection.recentAlbumsToDisplay));
+ return WinJS.Promise.wrap()
+ }.bind(this), function onError(error) {
+ MS.Entertainment.Music.fail("Failed to complete albums query: " + error && error.message);
+ return WinJS.Promise.wrapError(error)
+ })
+ }}
+ }, _getUserGatedMusic2CollectionDetails: function _getUserGatedMusic2CollectionDetails() {
+ return [{
+ linkStringId: String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_GUI, linkAction: this._createDismissAction(MS.Entertainment.Utilities.UserConfigurationValues.collectionDialogXuids), linkIcon: WinJS.UI.AppBarIcon.filter, voicePhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_CONF)
+ }]
+ }, _getUserGatedMusic2PlaylistCollectionDetails: function _getUserGatedMusic2PlaylistCollectionDetails() {
+ return [{
+ linkStringId: String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_GUI, linkAction: this._createDismissAction(MS.Entertainment.Utilities.UserConfigurationValues.playlistDialogXuids), linkIcon: WinJS.UI.AppBarIcon.filter, voicePhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_CONF)
+ }]
+ }, _createDismissAction: function _createDismissAction(configurationValue) {
+ var dismissAction = new MS.Entertainment.UI.Actions.Action;
+ dismissAction.automationId = MS.Entertainment.UI.AutomationIds.collectionEmptyShowAllMusicLink;
+ dismissAction.canExecute = function canExecute() {
+ return true
+ };
+ dismissAction.executed = function executed() {
+ MS.Entertainment.Utilities.setUserConfigurationValue(configurationValue, true);
+ if (this._galleryView.syncScreen && this._viewModel.selectedTemplate.syncScreen) {
+ this._galleryView.userGatedGalleryModel.updateProperty("primaryStringId", this._galleryView.syncScreenModel.primaryStringId);
+ this._galleryView.userGatedGalleryModel.updateProperty("secondaryStringId", this._galleryView.syncScreenModel.secondaryStringId);
+ this._galleryView.userGatedGalleryModel.updateProperty("details", this._galleryView.syncScreenModel.details);
+ this._galleryView.userGatedGalleryModel.updateProperty("showLoadingRing", this._galleryView.syncScreenModel.showLoadingRing);
+ this._galleryView.userGatedGalleryModel.updateProperty("className", this._galleryView.syncScreenModel.className);
+ if (this._galleryView.syncScreenModel)
+ this._galleryView.syncScreenModel.action.execute()
+ }
+ else
+ this._viewModel.refresh()
+ }.bind(this);
+ return dismissAction
+ }, _setSyncScreenDisplayed: function _setSyncScreenDisplayed(viewType) {
+ if (!viewType)
+ MS.Entertainment.fail();
+ var userConfigurationValue = null;
+ switch (viewType) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ userConfigurationValue = MS.Entertainment.Utilities.UserConfigurationValues.playlistSyncScreenDismissed;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.newlyAdded:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.albums2:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.artists2:
+ userConfigurationValue = MS.Entertainment.Utilities.UserConfigurationValues.albumArtistSyncScreenDismissed;
+ break;
+ default:
+ MS.Entertainment.Pages.fail("_setSyncScreenDisplayed: Invalid viewType defined " + viewType);
+ return
+ }
+ MS.Entertainment.Utilities.setUserConfigurationValue(userConfigurationValue, true)
+ }, _createSyncWaitAction: function _createSyncWaitAction(viewType) {
+ var syncWaitAction = new MS.Entertainment.UI.Actions.Action;
+ syncWaitAction.automationId = MS.Entertainment.UI.AutomationIds.collectionEmptyShowAllMusicLink;
+ syncWaitAction.canExecute = function canExecute() {
+ return true
+ };
+ syncWaitAction.executed = function executed() {
+ if (this._viewModel.pausableQuery)
+ this._viewModel.pausableQuery.unpause();
+ var canDismissSync = new WinJS.Promise(function waitToDismissSync(complete) {
+ var viewModelBinding;
+ var dismissSyncIfReady = function dismissSyncIfReady() {
+ if (this._viewModel.totalCount >= 1 || !this._viewModel.selectedTemplate.syncScreen) {
+ this._setSyncScreenDisplayed(viewType);
+ complete();
+ if (viewModelBinding) {
+ viewModelBinding.cancel();
+ viewModelBinding = null
+ }
+ }
+ }.bind(this);
+ viewModelBinding = WinJS.Binding.bind(this._viewModel, {
+ totalCountString: dismissSyncIfReady, selectedTemplate: {syncScreen: dismissSyncIfReady}
+ })
+ }.bind(this));
+ var dismissSyncPromise = WinJS.Promise.join([WinJS.Promise.timeout(MS.Entertainment.Pages.MusicCollection.SYNC_SCREEN_WAIT_TIME_MS), canDismissSync]);
+ WinJS.Promise.as(dismissSyncPromise).done(function refreshViewModel() {
+ this._viewModel.refresh()
+ }.bind(this))
+ }.bind(this);
+ return syncWaitAction
+ }, _songClicked: function songClicked(event) {
+ if (!this._inPlacePanelAnimating) {
+ var element = this._galleryView.getElementAtIndex(event.detail.itemIndex, true);
+ var item = element.querySelector("[data-win-control], .ent-control").winControl;
+ this._handlePanelClick(element, item, event.detail.itemIndex)
+ }
+ }, _inPlacePanelClick: function inPlacePanelClick(event) {
+ if (event.srcElement.type !== "button" && !this._inPlacePanelAnimating) {
+ var element = MS.Entertainment.Utilities.findParentElementByClassName(event.srcElement, "win-item");
+ var item = element.querySelector("[data-win-control], .ent-control").winControl;
+ this._handlePanelClick(element, item)
+ }
+ }, _handlePanelClick: function handlePanelClick(element, item, itemIndex) {
+ var promises = [];
+ this._inPlacePanelAnimating = true;
+ if (element === this._selectedSong) {
+ item.domElement.removeEventListener("click", item.panelClickHandler);
+ promises.push(item.collapse(this._selectedSong));
+ this._selectedSong = null
+ }
+ else if (item) {
+ if (this._selectedSong) {
+ var control = this._selectedSong.querySelector("[data-win-control], .ent-control");
+ if (control && control.winControl) {
+ var oldItem = control.winControl;
+ oldItem.domElement.removeEventListener("click", oldItem.panelClickHandler);
+ if (oldItem.isSelected)
+ promises.push(oldItem.collapse(this._selectedSong))
+ }
+ }
+ this._galleryView.ensureVisible(itemIndex);
+ WinJS.Promise.timeout().then(function() {
+ item.panelClickHandler = this._inPlacePanelClick.bind(this);
+ item.domElement.addEventListener("click", item.panelClickHandler, false)
+ }.bind(this));
+ promises.push(item.expand(element));
+ this._selectedSong = element
+ }
+ WinJS.Promise.join(promises).then(function doneAnimating() {
+ this._inPlacePanelAnimating = false
+ }.bind(this))
+ }, _removeItemCompleted: function _removeItemCompleted(eventArgs) {
+ var removed = eventArgs.detail && eventArgs.detail.deleted;
+ var removedItem = eventArgs.detail && eventArgs.detail.removedItem;
+ if (removed) {
+ this._clearSelection();
+ if (this._viewModel) {
+ if (this._viewModel.removeItemCompleted)
+ this._viewModel.removeItemCompleted(removedItem);
+ if (this._viewModel.pausableQuery && this._viewModel.pausableQuery.forceLiveRefresh)
+ this._viewModel.pausableQuery.forceLiveRefresh()
+ }
+ }
+ }, _updateGallery: function _updateGallery() {
+ this._clearSelection();
+ if (this._viewModel && this._viewModel.updateQuery)
+ this._viewModel.updateQuery()
+ }, _clearSelection: function _clearSelection() {
+ this._galleryView.clearSelection()
+ }, showingDialog: false
+ }, {dataContext: null}, {
+ getEmptySmartDJCollectionDetails: function _getEmptySmartDJCollectionDetails(completeAction) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var playSmartDJAction;
+ var details;
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ playSmartDJAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.selectArtist);
+ playSmartDJAction.automationId = MS.Entertainment.UI.AutomationIds.appBarPlaySmartDJ;
+ playSmartDJAction.parameter = {
+ isSmartDJ: true, successCallback: completeAction
+ };
+ details = [{
+ linkStringId: String.id.IDS_SMARTDJ_PAGE_CREATE_SMARTDJ_ACTION, linkAction: playSmartDJAction, linkIcon: MS.Entertainment.UI.Icon.smartDj, linkIconPressed: MS.Entertainment.UI.Icon.smartDjPressed, linkHideDefaultRing: true
+ }]
+ }
+ else {
+ playSmartDJAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.searchArtist);
+ playSmartDJAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardSmartDJSearchArtist;
+ playSmartDJAction.parameter = {
+ hasSmartDJ: true, galleryClass: "smartDjActionGallery"
+ };
+ details = [{
+ linkStringId: String.id.IDS_MUSIC2_RADIO_START_PANEL_VUI_GUI, linkAction: playSmartDJAction, linkIcon: MS.Entertainment.UI.Icon.smartDj, linkIconPressed: MS.Entertainment.UI.Icon.smartDjPressed, linkHideDefaultRing: true
+ }]
+ }
+ return details
+ }, userGatedClass: "userGatedGallery", recentAlbumsToDisplay: 6, SYNC_SCREEN_WAIT_TIME_MS: 6000
+ }), MusicCollectionGalleryItemTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryTemplateSelector", function galleryTemplateSelector() {
+ MS.Entertainment.UI.Controls.TemplateSelectorBase.prototype.constructor.call(this);
+ this.notificationDefaultTemplate = "Components/Music/MusicCollectionTemplates.html#verticalNotificationActionTemplate"
+ }, {
+ notificationDefaultTemplate: {
+ get: function() {
+ return this.getTemplate(MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector.templateType.notificationDefault)
+ }, set: function(value) {
+ this.addTemplate(MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector.templateType.notificationDefault, value)
+ }
+ }, onSelectTemplate: function onSelectTemplate(item) {
+ if (item && item.data && item.data.isNotification)
+ return this.getTemplateProvider(MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector.templateType.notificationDefault);
+ else
+ return MS.Entertainment.UI.Controls.GalleryTemplateSelector.prototype.onSelectTemplate.apply(this, arguments)
+ }
+ }, {templateType: {notificationDefault: "notificationDefault"}})
+ })
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicCollectionTemplates.html b/packages/microsoft.zunemusic/Components/Music/MusicCollectionTemplates.html
new file mode 100644
index 00000000..89856ba8
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicCollectionTemplates.html
@@ -0,0 +1,817 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicDashboardTemplates.html b/packages/microsoft.zunemusic/Components/Music/MusicDashboardTemplates.html
new file mode 100644
index 00000000..e607558c
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicDashboardTemplates.html
@@ -0,0 +1,309 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicDemoModel.js b/packages/microsoft.zunemusic/Components/Music/MusicDemoModel.js
new file mode 100644
index 00000000..4b03d4ce
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicDemoModel.js
@@ -0,0 +1,23 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Music.MusicDemo", {
+ musicSpotlightClick: function musicSpotlightClick() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var popOverParameters = null;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay))
+ popOverParameters = {itemConstructor: "MS.Entertainment.Pages.MusicInlineDetailsSpotlightDemo"};
+ else
+ popOverParameters = {itemConstructor: "MS.Entertainment.Pages.MusicInlineDetailsSpotlightNoStreamingDemo"};
+ MS.Entertainment.UI.Controls.PopOver.showNonMediaPopOver(popOverParameters)
+ }, musicFeaturedClick: function musicFeaturedClick() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var popOverParameters = null;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay))
+ popOverParameters = {itemConstructor: "MS.Entertainment.Pages.MusicInlineDetailsMarketplaceDemo"};
+ else
+ popOverParameters = {itemConstructor: "MS.Entertainment.Pages.MusicInlineDetailsMarketplaceNoStreamingDemo"};
+ MS.Entertainment.UI.Controls.PopOver.showNonMediaPopOver(popOverParameters)
+ }
+ })
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicFeatures.js b/packages/microsoft.zunemusic/Components/Music/MusicFeatures.js
new file mode 100644
index 00000000..fcf04cb7
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicFeatures.js
@@ -0,0 +1,6 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment", {Features: {appFeatures: [Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSignInAvailable, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicVideosMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplaceEditorial, Microsoft.Entertainment.FeatureEnablement.FeatureItem.smartDJMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSubscription, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay]}})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicFullScreenNowPlaying.html b/packages/microsoft.zunemusic/Components/Music/MusicFullScreenNowPlaying.html
new file mode 100644
index 00000000..4d678864
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicFullScreenNowPlaying.html
@@ -0,0 +1,19 @@
+
+
+
+
+
+ Full screen Now Playing
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicPageHost.html b/packages/microsoft.zunemusic/Components/Music/MusicPageHost.html
new file mode 100644
index 00000000..e41917fc
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicPageHost.html
@@ -0,0 +1,29 @@
+
+
+
+
+ Music Pages Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicPages.js b/packages/microsoft.zunemusic/Components/Music/MusicPages.js
new file mode 100644
index 00000000..1509cee9
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicPages.js
@@ -0,0 +1,610 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js", "/Framework/selectionManager.js", "/Controls/pivotControls.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Music", {MusicPage: MS.Entertainment.UI.Framework.defineUserControl(null, function MusicPage(element, options) {
+ var appbar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appbar && appbar.suspendActionListChanges)
+ appbar.suspendActionListChanges();
+ this._resetPage();
+ this._hubsSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(null, 0);
+ var container = element.querySelector("[data-ent-member='_container']");
+ WinJS.UI.processAll(container).done(function() {
+ WinJS.Binding.processAll(container, this)
+ }.bind(this))
+ }, {
+ processChildren: true, controlName: "MusicPages", _hubsSelectionManager: null, _pivotsSourcePath: null, _modifierSourcePath: null, _page: null, _complexBindings: null, _eventHandlers: null, _loadedHub: null, _initialized: false, _pageReadyOnce: false, _pageLoadedOnce: false, _title: null, _loadedOnce: false, _isFailed: false, _isLoading: true, _signedInUserBindings: null, _uiStateBindings: null, _uiStateEventHandlers: null, _itemControlAppBarSelection: null, _lastChangeWasNavigate: true, title: {
+ get: function() {
+ return this._title
+ }, set: function(value) {
+ if (value !== this._title) {
+ var oldValue = this._title;
+ this._title = value;
+ this.notify("title", value, oldValue);
+ if (this._initialized && !this._unloaded)
+ this._titleContainer.textContent = value
+ }
+ }
+ }, loadedOnce: {
+ get: function() {
+ return this._loadedOnce
+ }, set: function(value) {
+ if (value !== this._title) {
+ var oldValue = this._loadedOnce;
+ this._loadedOnce = value;
+ this.notify("loadedOnce", value, oldValue);
+ if (this._initialized && !this._unloaded)
+ this._bodyContainer.visibility = value
+ }
+ }
+ }, isFailed: {
+ get: function() {
+ return this._isFailed
+ }, set: function(value) {
+ if (value !== this._isFailed) {
+ var oldValue = this._isFailed;
+ this._isFailed = value;
+ this.notify("isFailed", value, oldValue);
+ this._isFailedChanged(value, oldValue)
+ }
+ }
+ }, isLoading: {
+ get: function() {
+ return this._isLoading
+ }, set: function(value) {
+ if (value !== this._isLoading) {
+ var oldValue = this._isLoading;
+ this._isLoading = value;
+ this.notify("isLoading", value, oldValue);
+ this._isLoadingChanged(value, oldValue)
+ }
+ }
+ }, currentHub: {get: function() {
+ return (this._hubsSelectionManager && this._hubsSelectionManager.selectedItem) ? this._hubsSelectionManager.selectedItem : MS.Entertainment.Music.MusicHub.empty
+ }}, isCurrentHubEmpty: {get: function() {
+ return MS.Entertainment.Music.MusicHub.isEmpty(this.currentHub)
+ }}, currentHubId: {get: function() {
+ return this.currentHub.id
+ }}, pivotsUsePanels: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.pivotsUsePanels : false
+ }}, modifiersUsePanels: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.modifiersUsePanels : false
+ }}, hideLoadingPanel: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.hideLoadingPanel : false
+ }}, hideNavigationContainer: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.hideNavigationContainer : false
+ }}, hideSidebar: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.hideSidebar : false
+ }}, hidePivotsOnFailed: {get: function() {
+ return (this.currentHub.dataContext && this.currentHub.dataContext.hidePivotsOnFailed !== undefined) ? this.currentHub.dataContext.hidePivotsOnFailed : true
+ }}, initialize: function initialize() {
+ window.msWriteProfilerMark("ent:MusicPage.Initialized");
+ if (this._unloaded)
+ return;
+ this._eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._hubsSelectionManager, {selectedItemChanged: this._onSelectionChanged.bind(this)});
+ this._onSelectionChanged();
+ MS.Entertainment.Framework.AccUtils.createAriaLinkId(this.hubContainer);
+ if (this._pivotControl)
+ this._pivotControl.setTabPanelId(this.hubContainer.id);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var musicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (!musicMarketplaceEnabled)
+ WinJS.Utilities.addClass(this.domElement, "marketplaceDisabled");
+ this._initialized = true;
+ if (this.dataContext && this.dataContext.pageIsFlexHub)
+ if (this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel)
+ this.currentHub.dataContext.viewModel.queryTitleCallback = this._setPageTitleCallBack.bind(this);
+ if (this._titleContainer)
+ this._titleContainer.textContent = this.title;
+ if (this._bodyContainer)
+ this._bodyContainer.visibility = this.loadedOnce;
+ this._isLoadingChanged(this.isLoading);
+ this._isFailedChanged(this.isFailed)
+ }, _setPageTitleCallBack: function _setPageTitleCallBack(title) {
+ this.title = title
+ }, unload: function unload() {
+ this._resetPage();
+ this._uninitializeSidebar();
+ if (this._signedInUserBindings) {
+ this._signedInUserBindings.cancel();
+ this._signedInUserBindings = null
+ }
+ if (this._hubsSelectionManager && this._hubsSelectionManager.dataSource)
+ this._hubsSelectionManager.dataSource.forEach(function(item) {
+ item.dispose()
+ });
+ if (this._hubsSelectionManager) {
+ this._hubsSelectionManager.dispose();
+ this._hubsSelectionManager = null
+ }
+ if (this._complexBindings) {
+ this._complexBindings.cancel();
+ this._complexBindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ if (this._loadedHub && this._loadedHub.dispose) {
+ this._loadedHub.dispose();
+ this._loadedHub = null
+ }
+ if (this.dataContext) {
+ if (this.dataContext.viewModel && this.dataContext.viewModel.dispose)
+ this.dataContext.viewModel.dispose();
+ this.dataContext = null
+ }
+ if (this._itemControlAppBarSelection) {
+ this._itemControlAppBarSelection.dispose();
+ this._itemControlAppBarSelection = null
+ }
+ this._page = null;
+ this.modifierDescriptionFormatter = null;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, handlePanelReady: function handlePanelReady(event) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (event.failed || (!event.failed && this.isFailed)) {
+ this.failedModel = event.model;
+ this.isFailed = event.failed
+ }
+ event.panelId = this.currentHubId;
+ this.isLoading = false;
+ eventProvider.tracePanel_Ready(this.currentHubId || "");
+ eventProvider.traceHub_Ready(this.currentHubId || "");
+ this._invokePageReadyOnce()
+ }, handlePanelReset: function handlePanelReset() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (!this.isLoading) {
+ this.failedModel = null;
+ this.isFailed = false;
+ this.isLoading = true;
+ eventProvider.tracePanel_Load_Start(this.currentHubId || "");
+ eventProvider.traceHub_Load_Start(this.currentHubId || "")
+ }
+ }, handleGalleryFirstPage: function handleGalleryFirstPage() {
+ WinJS.Promise.timeout().then(function musicPageResumeActionListChanges() {
+ window.msWriteProfilerMark("ent:MusicPages.ResumeActionListChanges");
+ var appbar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appbar && appbar.resumeActionListChanges)
+ appbar.resumeActionListChanges()
+ })
+ }, onNavigateTo: function onNavigateTo(page, hub, panel) {
+ var pageDataContext;
+ var modifierSelectionManager;
+ var pivotSelectionManager;
+ var dataContext;
+ window.msWriteProfilerMark("ent:MusicPage.NavigateTo");
+ this._lastChangeWasNavigate = true;
+ if (this.id !== page.iaNode.moniker) {
+ dataContext = page.getDataContext();
+ this.id = page.iaNode.moniker;
+ this._resetPage();
+ this._page = page;
+ this._changeHubSelection(page, hub, dataContext);
+ this.title = page.title;
+ this.dataContext = dataContext;
+ this._invokePageLoadStart()
+ }
+ else if (this._hubsSelectionManager.selectedItem.id !== hub.iaNode.moniker)
+ this._changeHubSelection(page, hub);
+ if (this.dataContext && this.dataContext.pageIsFlexHub)
+ this.hidePivots = true
+ }, _changeHubSelection: function _changeHubSelection(page, hub, dataContext) {
+ this._hubsSelectionManager.dataSource = null;
+ this._hubsSelectionManager.settingsKey = (dataContext && dataContext.preventHubSelectionSave) ? null : this.id + "_viewSelection";
+ this._hubsSelectionManager.dataSource = this._mapHubs(this._page.hubs);
+ if (hub && this._hubsSelectionManager.dataSource && page.options && page.options.selectHub)
+ for (var hubIndex = 0; hubIndex < this._hubsSelectionManager.dataSource.length; hubIndex++)
+ if (hub.iaNode.moniker === this._hubsSelectionManager.dataSource[hubIndex].id) {
+ this._hubsSelectionManager.selectedIndex = hubIndex;
+ break
+ }
+ this._startViewModelQuery()
+ }, _startViewModelQuery: function _startViewModelQuery() {
+ if (this.currentHub.dataContext.viewModel && this.currentHub.dataContext.viewModel.begin)
+ this.currentHub.dataContext.viewModel.begin()
+ }, _setIsFailed: function _setIsFailed(newValue) {
+ this.isFailed = newValue
+ }, _isFailedChanged: function _isFailedChanged(value, oldValue) {
+ if (this._initialized && !this._unloaded)
+ if (value) {
+ WinJS.Utilities.addClass(this.loadingControl, "removeFromDisplay");
+ MS.Entertainment.Utilities.hideElement(this.hubContainer);
+ MS.Entertainment.Utilities.showElement(this.failedControl);
+ var newControl = document.createElement("div");
+ newControl.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.FailedPanel");
+ this.failedControl.appendChild(newControl);
+ WinJS.UI.process(newControl).then(function setModel() {
+ newControl.winControl.model = this.failedModel
+ }.bind(this));
+ if (this.panelAction) {
+ var panelAction = WinJS.Binding.unwrap(this.panelAction);
+ if (panelAction && panelAction.action)
+ panelAction.action.isEnabled = false
+ }
+ if (this.hidePivotsOnFailed) {
+ WinJS.Utilities.addClass(this._modifierControl.domElement, "removeFromDisplayOnError");
+ if (this._secondaryModifierControl)
+ WinJS.Utilities.addClass(this._secondaryModifierControl.domElement, "removeFromDisplayOnError");
+ if (this._filterControl)
+ WinJS.Utilities.addClass(this._filterControl.domElement, "removeFromDisplayOnError");
+ WinJS.Utilities.addClass(this._pivotControl.domElement, "removeFromDisplayOnError")
+ }
+ }
+ else {
+ MS.Entertainment.Utilities.hideElement(this.failedControl);
+ if (oldValue) {
+ MS.Entertainment.Utilities.showElement(this.hubContainer);
+ WinJS.Utilities.addClass(this.loadingControl, "removeFromDisplay")
+ }
+ WinJS.Utilities.removeClass(this._modifierControl.domElement, "removeFromDisplayOnError");
+ if (this._secondaryModifierControl)
+ WinJS.Utilities.removeClass(this._secondaryModifierControl.domElement, "removeFromDisplayOnError");
+ if (this._filterControl)
+ WinJS.Utilities.removeClass(this._filterControl.domElement, "removeFromDisplayOnError");
+ WinJS.Utilities.removeClass(this._pivotControl.domElement, "removeFromDisplayOnError")
+ }
+ }, _isLoadingChanged: function _isLoadingChanged(value, oldValue) {
+ if (this._initialized && !this._unloaded)
+ if (!value || this.hideLoadingPanel) {
+ WinJS.Utilities.addClass(this.loadingControl, "removeFromDisplay");
+ if (!this.isFailed)
+ MS.Entertainment.Utilities.showElement(this.hubContainer);
+ MS.Entertainment.Utilities.empty(this.loadingControl)
+ }
+ else {
+ MS.Entertainment.Utilities.hideElement(this.hubContainer);
+ WinJS.Utilities.removeClass(this.loadingControl, "removeFromDisplay");
+ var ring = document.createElement("progress");
+ ring.className = "win-medium win-ring galleryProgress";
+ this.loadingControl.appendChild(ring)
+ }
+ }, _minModifierItemsChanged: function _minModifierItemsChanged(newValue, oldValue) {
+ if (this._initialized && !this._unloaded)
+ this._modifierControl.minItems = newValue
+ }, _modifierDescriptionChanged: function _modifierDescriptionChanged(newValue, oldValue) {
+ if (this._initialized && !this._unloaded)
+ if (this._filterControl && this._filterControl.items) {
+ this._filterControl.descriptionLabelText = newValue;
+ this._modifierControl.descriptionLabelText = String.load(String.id.IDS_FILTER_SORTED_BY)
+ }
+ else
+ this._modifierControl.descriptionLabelText = newValue
+ }, _titleOverrideChanged: function _titleOverrideChanged(newValue, oldValue) {
+ if (newValue !== null && newValue !== undefined)
+ this.title = newValue;
+ else if (this._page)
+ this.title = this._page.title;
+ else
+ this.title = String.empty
+ }, _pivotSelectedIndexOverrideChanged: function _pivotSelectedIndexOverrideChanged(newValue, oldValue) {
+ if (this._hubsSelectionManager && newValue !== null && newValue !== undefined)
+ this._hubsSelectionManager.selectedIndex = newValue
+ }, _refreshModifierSelectionManagers: function _refreshModifierSelectionManagers() {
+ if (this._complexBindings) {
+ var modifierSelectionManager;
+ var secondaryModifierSelectionManager;
+ if (this.modifiersUsePanels) {
+ modifierSelectionManager = this._hubsSelectionManager;
+ secondaryModifierSelectionManager = null
+ }
+ else if (this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel) {
+ modifierSelectionManager = this.currentHub.dataContext.viewModel.modifierSelectionManager;
+ secondaryModifierSelectionManager = this.currentHub.dataContext.viewModel.secondaryModifierSelectionManager
+ }
+ modifierSelectionManager = modifierSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ secondaryModifierSelectionManager = secondaryModifierSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ this._modifierControl.selectionManager = this.modifierSelectionManager = modifierSelectionManager;
+ if (this._secondaryModifierControl) {
+ this._secondaryModifierControl.selectionManager = this.secondaryModifierSelectionManager = secondaryModifierSelectionManager;
+ this._secondaryModifierControl.items = secondaryModifierSelectionManager ? secondaryModifierSelectionManager.dataSource : null
+ }
+ }
+ }, _refreshFilterSelectionManagers: function _refreshFilterSelectionManagers() {
+ if (this._complexBindings && this._filterControl) {
+ var filterSelectionManager;
+ if (!this.modifiersUsePanels && this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel)
+ filterSelectionManager = this.currentHub.dataContext.viewModel.filterSelectionManager;
+ filterSelectionManager = filterSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ this._filterControl.selectionManager = this.filterSelectionManager = filterSelectionManager
+ }
+ }, _refreshPivotSelectionManagers: function _refreshPivotSelectionManagers() {
+ if (this._complexBindings) {
+ var pivotsSelectionManager;
+ if (this.pivotsUsePanels)
+ pivotsSelectionManager = this._hubsSelectionManager;
+ else if (this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel)
+ pivotsSelectionManager = this.currentHub.dataContext.viewModel.pivotsSelectionManager;
+ pivotsSelectionManager = pivotsSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ this._pivotControl.selectionManager = this.pivotsSelectionManager = pivotsSelectionManager
+ }
+ }, _mapHubs: function _mapHubs(hubs) {
+ var result;
+ if (hubs)
+ result = hubs.map(function mapHubToHub(hub) {
+ return new MS.Entertainment.Music.MusicHub({
+ page: this._page, hub: hub
+ })
+ }, this);
+ else
+ result = [];
+ return result
+ }, _resetPage: function _resetPage() {
+ this.hubs = [];
+ this.dataContext = {};
+ this.title = null;
+ this._page = {};
+ if (this._loadedHub && this._loadedHub.dispose)
+ this._loadedHub.dispose();
+ this._loadedHub = MS.Entertainment.Music.MusicHub.empty
+ }, _onSelectionChanged: function _onSelectionChanged(args) {
+ if (this._complexBindings) {
+ this._complexBindings.cancel();
+ this._complexBindings = null
+ }
+ if (this._pageReadyOnce && MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).lastNavigationWasPage = false;
+ if (this.currentHub)
+ this._loadHub()
+ }, _loadHub: function _loadHub() {
+ var currentHub = this.currentHub;
+ if (MS.Entertainment.Music.MusicHub.isEmpty(currentHub) || currentHub === this._loadedHub)
+ return;
+ if (this._loadedHub && this._loadedHub.clearDataContext) {
+ this._loadedHub.clearDataContext();
+ this._loadedHub = null
+ }
+ this.handlePanelReset();
+ this._loadedHub = currentHub;
+ if (currentHub.options) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.currentHub = currentHub.options.hub
+ }
+ MS.Entertainment.Utilities.empty(this.hubContainer);
+ window.msWriteProfilerMark("ent:MusicPage.LoadHubTemplate,StartTM");
+ MS.Entertainment.UI.Framework.loadTemplate(currentHub.fragmentUrl, null, true).then(function renderHub(controlInstance) {
+ if (this._loadedHub === currentHub)
+ return this._renderHub(controlInstance, currentHub)
+ }.bind(this)).then(function finalizeHub() {
+ this.loadedOnce = true
+ }.bind(this));
+ MS.Entertainment.UI.Framework.assert(!this._complexBindings, "bindings should have been cleared");
+ if (!this._lastChangeWasNavigate)
+ this._startViewModelQuery();
+ this._lastChangeWasNavigate = false;
+ var viewModelBindings = {
+ modifierDescriptionFormatter: {result: this._modifierDescriptionChanged.bind(this)}, isFailed: this._setIsFailed.bind(this), titleOverride: this._titleOverrideChanged.bind(this), pivotSelectedIndexOverride: this._pivotSelectedIndexOverrideChanged.bind(this)
+ };
+ if (!this.modifiersUsePanels) {
+ viewModelBindings["modifierSelectionManager"] = {dataSource: this._refreshModifierSelectionManagers.bind(this)};
+ viewModelBindings["filterSelectionManager"] = {dataSource: this._refreshFilterSelectionManagers.bind(this)};
+ viewModelBindings["secondaryModifierSelectionManager"] = {dataSource: this._refreshModifierSelectionManagers.bind(this)}
+ }
+ if (!this.pivotsUsePanels)
+ viewModelBindings["pivotsSelectionManager"] = {dataSource: this._refreshPivotSelectionManagers.bind(this)};
+ if (this.hideNavigationContainer)
+ WinJS.Utilities.addClass(this._pivotControl.domElement, "removeFromDisplay");
+ this._complexBindings = WinJS.Binding.bind(currentHub, {dataContext: {
+ viewModel: viewModelBindings, minModifierItems: this._minModifierItemsChanged.bind(this)
+ }});
+ this._refreshModifierSelectionManagers();
+ this._refreshFilterSelectionManagers();
+ this._refreshPivotSelectionManagers()
+ }, _renderHub: function _renderHub(controlInstance, musicHub) {
+ return controlInstance.render(musicHub, this.hubContainer).then(function raiseEvent() {
+ if (this._loadedHub !== musicHub)
+ return;
+ window.msWriteProfilerMark("ent:MusicPage.LoadHubTemplate,StopTM");
+ if (musicHub.id)
+ this.hubContainer.setAttribute("data-win-automationid", musicHub.id);
+ else
+ this.hubContainer.removeAttribute("data-win-automationid");
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelLoadingStarted", true, true);
+ this.hubContainer.dispatchEvent(domEvent);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.tracePanel_Load_End(musicHub.id || "");
+ eventProvider.traceHub_Load_End(musicHub.id || "");
+ this._invokePageLoadedOnce();
+ if (!musicHub || !musicHub.dataContext || !musicHub.dataContext.doNotRaisePanelReady) {
+ window.msWriteProfilerMark("ent:MusicPages.RaisePanelReady");
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.hubContainer)
+ }
+ }.bind(this))
+ }, _uninitializeSidebar: function _uninitializeSidebar() {
+ if (this._uiStateBindings) {
+ this._uiStateBindings.cancel();
+ this._uiStateBindings = null
+ }
+ if (this._uiStateEventHandlers) {
+ this._uiStateEventHandlers.cancel();
+ this._uiStateEventHandlers = null
+ }
+ }, _initializeSidebar: function _initializeSidebar() {
+ this._uninitializeSidebar();
+ if (!this.hideSidebar) {
+ var loadSidebar = this._loadSidebar.bind(this);
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this._uiStateEventHandlers = MS.Entertainment.Utilities.addEventHandlers(uiState, {windowresize: loadSidebar});
+ this._uiStateBindings = WinJS.Binding.bind(uiState, {isSnapped: loadSidebar});
+ this._signedInUserBindings = WinJS.Binding.bind(signedInUser, {isSubscription: loadSidebar});
+ this._loadSidebar()
+ }
+ }, _loadSidebar: function _loadSidebar() {
+ if (this._uiStateEventHandlers && this._uiStateBindings && this._signedInUserBindings && this._sidebarHost) {
+ MS.Entertainment.Utilities.empty(this._sidebarHost);
+ var viewModel = this.currentHub.dataContext.viewModel;
+ if (viewModel.getSidebarItems) {
+ var sidebarItems = viewModel.getSidebarItems(viewModel.view);
+ if (sidebarItems)
+ for (var i = 0; i < sidebarItems.length; i++)
+ this._sidebarHost.appendChild(sidebarItems[i])
+ }
+ if (this._sidebarHost.children.length > 0)
+ WinJS.Utilities.addClass(this.domElement, "sidebarEnabled");
+ else
+ WinJS.Utilities.removeClass(this.domElement, "sidebarEnabled")
+ }
+ }, _invokePageLoadStart: function _invokePageLoadStart() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Load_Start(this.id || "");
+ this._pageLoadedOnce = false;
+ this._pageReadyOnce = false
+ }, _invokePageLoadedOnce: function _invokePageLoadedOnce() {
+ if (!this._pageLoadedOnce) {
+ this._pageLoadedOnce = true;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Load_End(this.id);
+ var visibleEvent = document.createEvent("Event");
+ visibleEvent.initEvent("HubStripVisible", true, false);
+ this.domElement.dispatchEvent(visibleEvent)
+ }
+ }, _invokePageReadyOnce: function _invokePageReadyOnce() {
+ if (!this._pageReadyOnce) {
+ this._pageReadyOnce = true;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Ready(this.id);
+ var readyEvent = document.createEvent("Event");
+ readyEvent.initEvent("HubStripLoaded", true, false);
+ this.domElement.dispatchEvent(readyEvent);
+ var readyEvent = document.createEvent("Event");
+ readyEvent.initEvent("HubStripReady", true, false);
+ this.domElement.dispatchEvent(readyEvent);
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiState.isHubStripVisible = true;
+ this._initializeSidebar()
+ }
+ }
+ }, {
+ modifierSelectionManager: null, filterSelectionManager: null, secondaryModifierSelectionManager: null, pivotsSelectionManager: null, dataContext: null, id: null, hidePivots: false, showSideContentContainer: false
+ }, {
+ empty: {}, applyGetPage: function applyGetPage(iaNode) {
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(iaNode, "Components/Music/MusicPageHost.html")
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Music", {MusicHub: MS.Entertainment.defineOptionalObservable(function MusicHubInstance(options) {
+ this.options = options;
+ if (options && options.hub) {
+ this.id = options.hub.iaNode.moniker;
+ this.fragmentUrl = options.hub.overrideFragmentUrl;
+ if (options.hub.titleProviderFactory) {
+ this._titleProvider = options.hub.titleProviderFactory();
+ this._titleProviderBindings = WinJS.Binding.bind(this._titleProvider, {title: this._titleProviderTitleChanged.bind(this)})
+ }
+ else
+ this.label = options.hub.title
+ }
+ }, {
+ _dataContext: null, _disposed: false, _titleProvider: null, _titleProviderBindings: null, dispose: function dispose() {
+ this._disposed = true;
+ this.clearDataContext();
+ if (this._titleProviderBindings) {
+ this._titleProviderBindings.cancel();
+ this._titleProviderBindings = null
+ }
+ if (this._titleProvider && this._titleProvider.dispose) {
+ this._titleProvider.dispose();
+ this._titleProvider = null
+ }
+ }, _titleProviderTitleChanged: function _titleProviderTitleChanged(title) {
+ if (title) {
+ this.label = title;
+ this.isDisabled = false
+ }
+ else {
+ this.label = String.empty;
+ this.isDisabled = true
+ }
+ }, clearDataContext: function clearDataContext() {
+ if (this._dataContextBinds) {
+ this._dataContextBinds.cancel();
+ this._dataContextBinds = null
+ }
+ if (this._dataContext) {
+ if (this._dataContext.viewModel && this._dataContext.viewModel.dispose)
+ this._dataContext.viewModel.dispose();
+ this._dataContext = null
+ }
+ if (this.options && this.options.hub)
+ this.options.hub.clearDataContext()
+ }, instance: {get: function() {
+ return this
+ }}, dataContext: {get: function() {
+ var original = this._dataContext;
+ if (!this._disposed) {
+ if (!this._dataContext && this.options && this.options.hub)
+ this._dataContext = this.options.hub.getDataContext();
+ if (!this._dataContext && this.options && this.options.page)
+ this._dataContext = this.options.page.getDataContext()
+ }
+ return this._dataContext
+ }}
+ }, {
+ id: null, selected: false, label: null, isDisabled: false, titleOverride: null, pivotSelectedIndexOverride: null, fragmentUrl: null, options: null, isRoot: true
+ }, {
+ empty: {
+ dataContext: null, selected: false, id: null, fragmentUrl: null, options: null
+ }, isEmpty: function isEmpty(value) {
+ return WinJS.Binding.unwrap(value) === MS.Entertainment.Music.MusicHub.empty
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {SearchResultsPivotTitleProvider: MS.Entertainment.defineObservable(function searchResultsPivotTitleProviderConstructor(defaultStringId, formatStringId, countProperty, hideOnZero) {
+ this._defaultString = String.load(defaultStringId);
+ this._formatString = String.load(formatStringId);
+ this._hideOnZero = hideOnZero;
+ var binding = {};
+ binding[countProperty] = this._onCountChange.bind(this);
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ this._bindings = WinJS.Binding.bind(searchResultCounts, binding)
+ }, {
+ title: String.empty, _defaultString: null, _formatString: null, _bindings: null, _hideOnZero: false, _onCountChange: function onCountChange(count) {
+ var formattedCount;
+ if (count === -1)
+ this.title = this._defaultString;
+ else if (this._hideOnZero && count === 0)
+ this.title = null;
+ else {
+ formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(count);
+ this.title = this._formatString.format(formattedCount)
+ }
+ }, dispose: function dispose() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {MusicSearchResultCounts: MS.Entertainment.defineObservable(function searchResultCountsConstructor(){}, {
+ clearOnRestore: false, allCount: -1, artistsCount: 0, albumsCount: 0, songsCount: 0, playlistsCount: 0, musicVideosCount: 0, backup: function backup() {
+ this.clearOnRestore = false;
+ return {
+ allCount: this.allCount, artistsCount: this.artistsCount, albumsCount: this.albumsCount, songsCount: this.songsCount, playlistsCount: this.playlistsCount, musicVideosCount: this.musicVideosCount
+ }
+ }, restore: function restore(savedSearchResultCounts) {
+ if (!this.clearOnRestore) {
+ this.allCount = savedSearchResultCounts.allCount;
+ this.artistsCount = savedSearchResultCounts.artistsCount;
+ this.albumsCount = savedSearchResultCounts.albumsCount;
+ this.songsCount = savedSearchResultCounts.songsCount;
+ this.playlistsCount = savedSearchResultCounts.playlistsCount;
+ this.musicVideosCount = savedSearchResultCounts.musicVideosCount
+ }
+ else {
+ this.clearCounts();
+ this.clearOnRestore = false
+ }
+ }, clearCounts: function clearCounts() {
+ this.allCount = -1;
+ this.artistsCount = 0;
+ this.albumsCount = 0;
+ this.songsCount = 0;
+ this.playlistsCount = 0;
+ this.musicVideosCount = 0
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.searchResultCounts, function getSearchResultCountsService() {
+ return new MS.Entertainment.ViewModels.MusicSearchResultCounts
+ })
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicPagesVertical.html b/packages/microsoft.zunemusic/Components/Music/MusicPagesVertical.html
new file mode 100644
index 00000000..f19365d3
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicPagesVertical.html
@@ -0,0 +1,104 @@
+
+
+
+
+
+ Music Vertical Page Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicPanels.html b/packages/microsoft.zunemusic/Components/Music/MusicPanels.html
new file mode 100644
index 00000000..1a99e7ad
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicPanels.html
@@ -0,0 +1,123 @@
+
+
+
+
+
+ Music Panels
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicSharedTemplates.html b/packages/microsoft.zunemusic/Components/Music/MusicSharedTemplates.html
new file mode 100644
index 00000000..7279c783
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicSharedTemplates.html
@@ -0,0 +1,3136 @@
+
+
+
+
+ Music Shared Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicSharedTemplatesControls.js b/packages/microsoft.zunemusic/Components/Music/MusicSharedTemplatesControls.js
new file mode 100644
index 00000000..fe72d9c5
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicSharedTemplatesControls.js
@@ -0,0 +1,6 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {AlbumThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "Components/Music/MusicSharedTemplates.html#albumThumbnailButtonTemplate")});
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ArtistCardlessThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "Components/Music/MusicSharedTemplates.html#artistCardlessThumbnailButtonTemplate")});
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SongThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "Components/Music/MusicSharedTemplates.html#songThumbnailButtonTemplate")});
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VerticalAlbumSummaryThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MediaItemThumbnail", "Components/Music/MusicSharedTemplates.html#verticalAlbumSummaryThumbnailTemplate")})
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicSpotlightView1.html b/packages/microsoft.zunemusic/Components/Music/MusicSpotlightView1.html
new file mode 100644
index 00000000..c4002c21
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicSpotlightView1.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicSpotlightView2.html b/packages/microsoft.zunemusic/Components/Music/MusicSpotlightView2.html
new file mode 100644
index 00000000..e31c1281
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicSpotlightView2.html
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicSpotlightViewDemo.html b/packages/microsoft.zunemusic/Components/Music/MusicSpotlightViewDemo.html
new file mode 100644
index 00000000..057fe2e1
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicSpotlightViewDemo.html
@@ -0,0 +1,83 @@
+
+
+
+
+
Music Demo Spotlight
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicUtilities.js b/packages/microsoft.zunemusic/Components/Music/MusicUtilities.js
new file mode 100644
index 00000000..87382fb7
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicUtilities.js
@@ -0,0 +1,84 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/utilities.js", "/Framework/debug.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Shell", {
+ _convertError: function _convertError(errorCode) {
+ switch (errorCode) {
+ case MS.Entertainment.Platform.Playback.Error.MF_E_UNSUPPORTED_CONTENT_PROTECTION_SYSTEM.code:
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ errorCode = signIn.isSignedIn ? errorCode : MS.Entertainment.Platform.Playback.Error.NS_E_WMP_DRM_LICENSE_NOTACQUIRED.code;
+ return errorCode;
+ default:
+ return errorCode
+ }
+ {}
+ }, oldShowError: MS.Entertainment.UI.Shell.showError, showError: function showError(caption, error, subTitle, postpendedText) {
+ var errorPromise;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var displayError = !uiStateService.isSnapped;
+ if (uiStateService.isSnapped && error === MS.Entertainment.Platform.Playback.Error.E_MDS_UNAUTHENTICATED_TRACK_LIMIT.code) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlayAnonAds))
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits)) {
+ var appView = Windows.UI.ViewManagement.ApplicationView;
+ appView.tryUnsnap();
+ displayError = true
+ }
+ }
+ if (displayError) {
+ error = MS.Entertainment.UI.Shell._convertError(error);
+ errorPromise = MS.Entertainment.UI.Shell._handleSpecificError(error);
+ if (!errorPromise)
+ errorPromise = MS.Entertainment.UI.Shell.oldShowError(caption, error, subTitle, postpendedText)
+ }
+ return WinJS.Promise.as(errorPromise)
+ }, _handleSpecificError: function _handleSpecificError(errorCode) {
+ var showDialogPromise;
+ switch (errorCode) {
+ case MS.Entertainment.Platform.Playback.Error.E_MDS_AUTHENTICATED_TRACK_LIMIT.code:
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits)) {
+ var freePlayLimits = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits);
+ showDialogPromise = freePlayLimits.showMonthlyFreeLimitExceededDialog()
+ }
+ break;
+ case MS.Entertainment.Platform.Playback.Error.E_MDS_UNAUTHENTICATED_TRACK_LIMIT.code:
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits)) {
+ var freePlayLimits = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits);
+ showDialogPromise = freePlayLimits.showUnauthenticatedFreeLimitExceededDialog()
+ }
+ break;
+ case MS.Entertainment.Platform.Playback.Error.E_MDS_INDIVIDUAL_TRACK_LIMIT.code:
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits)) {
+ var freePlayLimits = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits);
+ showDialogPromise = freePlayLimits.showFreeTrackLimitExceededDialog()
+ }
+ break;
+ case MS.Entertainment.Platform.Playback.Error.E_MDS_ROAMING_LIMIT.code:
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits)) {
+ var freePlayLimits = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits);
+ showDialogPromise = freePlayLimits.showTravelLimitExceededDialog()
+ }
+ break;
+ case MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code:
+ showDialogPromise = MS.Entertainment.Music.MusicBrandDialog.showOfflineDialog();
+ break;
+ case MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_NOT_LOCAL.code:
+ showDialogPromise = WinJS.Promise.wrap();
+ break;
+ default:
+ break
+ }
+ return showDialogPromise
+ }, smartDjDashboardItemSize: {get: function() {
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ return {
+ width: 316, height: 316
+ };
+ else
+ return {
+ width: 135, height: 135
+ }
+ }}
+ })
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicWelcomeView.html b/packages/microsoft.zunemusic/Components/Music/MusicWelcomeView.html
new file mode 100644
index 00000000..cc01ec0b
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicWelcomeView.html
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/MusicWelcomeView.js b/packages/microsoft.zunemusic/Components/Music/MusicWelcomeView.js
new file mode 100644
index 00000000..44f2be94
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/MusicWelcomeView.js
@@ -0,0 +1,55 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+this.scriptValidator();
+var MS;
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var MusicWelcomeView = (function() {
+ function MusicWelcomeView(){}
+ MusicWelcomeView.initialize = function() {
+ this.viewModel = this.dataContext;
+ this.closeButton.textContent = MS.Entertainment.UI.Icon.close;
+ this.closeButton.setAttribute("aria-label", String.load(String.id.IDS_CLOSE_BUTTON));
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._uiStateEventHandlers = MS.Entertainment.Utilities.addEventHandlers(uiStateService, {servicesEnabledChanged: this.onServiceEnabledChange.bind(this)});
+ this.viewModel.onActionButtonChange = function(newActionText) {
+ this.welcomePanelButton.textContent = newActionText
+ }
+ };
+ MusicWelcomeView.unload = function() {
+ if (this._uiStateEventHandlers) {
+ this._uiStateEventHandlers.cancel();
+ this._uiStateEventHandlers = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ };
+ MusicWelcomeView.closeButtonClicked = function() {
+ MS.Entertainment.UI.Framework.assert(this.viewModel, "Cannot close the welcome panel without a view model.");
+ this.viewModel.acknowledgeDismissal();
+ var rootElement = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "welcomePanel");
+ if (rootElement && rootElement.parentElement)
+ WinJS.UI.Animation.fadeOut(rootElement).done(function removeElementFromParent() {
+ if (rootElement && rootElement.parentElement)
+ rootElement.parentElement.removeChild(rootElement)
+ })
+ };
+ MusicWelcomeView.welcomePanelButtonClicked = function() {
+ MS.Entertainment.UI.Framework.assert(this.viewModel, "Cannot act on the welcome panel without a view model.");
+ this.viewModel.signOrDiveIn()
+ };
+ MusicWelcomeView.onServiceEnabledChange = function(args) {
+ if (args.detail && !args.detail.newValue)
+ this.closeButtonClicked()
+ };
+ return MusicWelcomeView
+ })();
+ Controls.MusicWelcomeView = MusicWelcomeView
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MusicWelcomeView: MS.Entertainment.UI.Framework.defineUserControl("/Components/Music/MusicWelcomeView.html#welcomePanelTwoColumnTemplate", null, MS.Entertainment.UI.Controls.MusicWelcomeView)})
diff --git a/packages/microsoft.zunemusic/Components/Music/PlayPlaylist.html b/packages/microsoft.zunemusic/Components/Music/PlayPlaylist.html
new file mode 100644
index 00000000..3923fb8c
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/PlayPlaylist.html
@@ -0,0 +1,158 @@
+
+
+
+
+
Play Playlist Overplay
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music/PurchaseMusic.js b/packages/microsoft.zunemusic/Components/Music/PurchaseMusic.js
new file mode 100644
index 00000000..547ff614
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/PurchaseMusic.js
@@ -0,0 +1,131 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Purchase");
+ WinJS.Namespace.define("MS.Entertainment.Purchase", {
+ MusicPurchaseFlowProvider: MS.Entertainment.UI.Framework.define(null, {getPurchaseFlow: function getPurchaseFlow(mediaItem, serviceId, target, purchaseType, offerId, returnUri, gamerTag) {
+ var purchaseUrl = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_ModernPurchase) + "/Purchase?client=x13";
+ var taskId = MS.Entertainment.UI.Controls.WebHost.TaskId.MUSIC;
+ var purchaseExp;
+ if (mediaItem.mediaType === MS.Entertainment.Data.Query.edsMediaType.subscription)
+ purchaseExp = new MS.Entertainment.Purchase.PurchaseSubscription;
+ else
+ purchaseExp = new MS.Entertainment.Purchase.PurchaseMusic;
+ return {
+ purchaseExp: purchaseExp, purchaseUrl: purchaseUrl, taskId: taskId
+ }
+ }}, {factory: function factory() {
+ return new MS.Entertainment.Purchase.MusicPurchaseFlowProvider
+ }}), PurchaseMusic: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.WebHostExperience", function PurchaseMusic_constructor() {
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.constructor.call(this);
+ this.addMedia = MS.Entertainment.Platform.PurchaseHelpers.addMedia;
+ this.downloadMedia = MS.Entertainment.Platform.PurchaseHelpers.downloadMedia
+ }, {
+ mediaItem: null, offerIds: null, addMedia: null, downloadMedia: null, startListener: function startListener() {
+ var trace = String.empty;
+ if (!this.disposed)
+ this.eventProvider.tracePurchaseFlowMusic_Start(trace);
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.startListener.apply(this, arguments)
+ }, _onPurchaseSuccess: function _onPurchaseSuccess(messageStruct) {
+ MS.Entertainment.UI.assert(messageStruct.receipt, "Success message doesn't contain a valid receipt");
+ var offerIds = this.offerIds;
+ if (messageStruct.offerIds && messageStruct.offerIds.length > 0)
+ offerIds = messageStruct.offerIds;
+ var mediaAddedEventHandler = this.onMediaAddedEvent;
+ MS.Entertainment.UI.assert(this.mediaItem, "Purchase Flow got a null mediaItem");
+ if (this.mediaItem) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ if (actionService.isRegistered(MS.Entertainment.UI.Actions.ActionIdentifiers.showPurchaseConfirmationFlyout)) {
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showPurchaseConfirmationFlyout);
+ action.execute()
+ }
+ var serviceId = this.mediaItem.serviceId;
+ this.eventProvider.tracePurchaseFlowMusic_Finish(serviceId);
+ var that = this;
+ this.addMedia(that.mediaItem, offerIds, true).then(function addComplete(dbItems) {
+ if (dbItems) {
+ if (mediaAddedEventHandler)
+ mediaAddedEventHandler();
+ var containsMusicTracks = false;
+ var containsMusicVideos = false;
+ for (var i = 0; i < dbItems.dbMediaTypes.length; i++)
+ if (dbItems.dbMediaTypes[i] === Microsoft.Entertainment.Queries.ObjectType.video)
+ containsMusicVideos = true;
+ else if (dbItems.dbMediaTypes[i] === Microsoft.Entertainment.Queries.ObjectType.track)
+ containsMusicTracks = true;
+ var isBundleAlbum = containsMusicTracks && containsMusicVideos;
+ that.downloadMedia(that.mediaItem, dbItems.dbMediaIds, dbItems.dbMediaTypes, isBundleAlbum, true)
+ }
+ })
+ }
+ }, messageReceived: function messageReceived(messageStruct, webHost, sendMessageFunc) {
+ var offerId = String.empty;
+ var errorCode = String.empty;
+ if (!this.disposed)
+ switch (messageStruct.verb) {
+ case"CLOSE_DIALOG":
+ switch (messageStruct.reason) {
+ case"CANCEL":
+ this.eventProvider.tracePurchaseFlowMusic_Cancel(String.empty);
+ break;
+ case"ERROR":
+ this.eventProvider.tracePurchaseFlowMusic_Error(String.empty, messageStruct.errorCode);
+ break;
+ case"REJECTION":
+ this.eventProvider.tracePurchaseFlowMusic_Rejection(String.empty, messageStruct.errorCode);
+ break
+ }
+ break;
+ case"done":
+ switch (messageStruct.status) {
+ case"cancel":
+ this.eventProvider.tracePurchaseFlowMusic_Cancel(String.empty);
+ break;
+ case"success":
+ if (messageStruct.receipt)
+ this._onPurchaseSuccess(messageStruct);
+ break
+ }
+ break;
+ case"CONTENT_ADDED":
+ this._onPurchaseSuccess(messageStruct);
+ break
+ }
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.messageReceived.apply(this, arguments)
+ }
+ }, {factory: function factory() {
+ return new MS.Entertainment.Purchase.PurchaseMusic
+ }}), PurchaseSubscription: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.WebHostExperience", function PurchaseSubscription_constructor() {
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.constructor.call(this)
+ }, {
+ mediaItem: null, startListener: function startListener() {
+ if (!this.disposed)
+ this.eventProvider.traceSubscriptionSignup_Start(String.empty);
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.startListener.apply(this, arguments)
+ }, messageReceived: function messageReceived(messageStruct, webHost, sendMessageFunc) {
+ if (!this.disposed)
+ switch (messageStruct.verb) {
+ case"done":
+ switch (messageStruct.status) {
+ case"cancel":
+ this.eventProvider.traceSubscriptionSignup_Cancel(String.empty);
+ break;
+ case"success":
+ this.eventProvider.traceSubscriptionSignup_Finish(String.empty);
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.refreshSignInState();
+ MS.Entertainment.Utilities.Telemetry.logSubscriptionSignupPurchaseMade(this.mediaItem);
+ break;
+ default:
+ break
+ }
+ break;
+ default:
+ break
+ }
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.messageReceived.apply(this, arguments)
+ }
+ })
+ })
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/ResetCloudCollection.html b/packages/microsoft.zunemusic/Components/Music/ResetCloudCollection.html
new file mode 100644
index 00000000..704e9ebd
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/ResetCloudCollection.html
@@ -0,0 +1,89 @@
+
+
+
+
+
Reset Cloud Collection Dialog
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/Components/Music/ResetCloudCollection.js b/packages/microsoft.zunemusic/Components/Music/ResetCloudCollection.js
new file mode 100644
index 00000000..7c5dfcdd
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/ResetCloudCollection.js
@@ -0,0 +1,193 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var Music;
+ (function(Music) {
+ var ResetCloudCollectionDialogContent = (function(_super) {
+ __extends(ResetCloudCollectionDialogContent, _super);
+ function ResetCloudCollectionDialogContent(element, options) {
+ this.templateStorage = "/Components/Music/ResetCloudCollection.html";
+ this.templateName = "dialogContentTemplate";
+ _super.call(this, element, options)
+ }
+ Object.defineProperty(ResetCloudCollectionDialogContent.prototype, "isChecked", {
+ get: function() {
+ return this._isChecked
+ }, set: function(value) {
+ this.updateAndNotify("isChecked", value)
+ }, enumerable: true, configurable: true
+ });
+ ResetCloudCollectionDialogContent.prototype.initialize = function() {
+ var _this = this;
+ var catalogCountQuery = new Entertainment.Data.Query.libraryTracks;
+ catalogCountQuery.mediaAvailability = Microsoft.Entertainment.Platform.MediaAvailability.musicPass;
+ catalogCountQuery.execute().done(function(result) {
+ catalogCountQuery.dispose();
+ var catalogCount = result && result.result && result.result.totalCount;
+ _this._deleteMusicPassLabel.innerText = Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_PLURAL, catalogCount).format(catalogCount)
+ }, function(error) {
+ catalogCountQuery.dispose();
+ Music.fail("ResetCloudCollectionDialogContent::initialize() Library tracks query failed for music pass conent." + (error && error.message))
+ });
+ var purchasedCountQuery = new Entertainment.Data.Query.libraryTracks;
+ purchasedCountQuery.mediaAvailability = Microsoft.Entertainment.Platform.MediaAvailability.purchased;
+ purchasedCountQuery.execute().done(function(result) {
+ purchasedCountQuery.dispose();
+ var purchasedCount = result && result.result && result.result.totalCount;
+ _this._deletePurchasedLabel.innerText = Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_PLURAL, purchasedCount).format(purchasedCount)
+ }, function(error) {
+ purchasedCountQuery.dispose();
+ Music.fail("ResetCloudCollectionDialogContent::initialize() Library tracks query failed for purchased conent." + (error && error.message))
+ });
+ var playlistCountQuery = new Entertainment.Data.Query.libraryPlaylists;
+ playlistCountQuery.execute().done(function(result) {
+ playlistCountQuery.dispose();
+ var playlistCount = result && result.result && result.result.totalCount;
+ _this._deletePlaylistsLabel.innerText = Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_PLURAL, playlistCount).format(playlistCount)
+ }, function(error) {
+ playlistCountQuery.dispose();
+ Music.fail("ResetCloudCollectionDialogContent::initialize() Library playlists query failed!" + (error && error.message))
+ })
+ };
+ ResetCloudCollectionDialogContent.prototype._onCheckBoxClicked = function(event) {
+ this.isChecked = this._deleteMusicPassOption.checked || this._deletePurchasedOption.checked || this._deletePlaylistsOption.checked
+ };
+ return ResetCloudCollectionDialogContent
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Music.ResetCloudCollectionDialogContent = ResetCloudCollectionDialogContent;
+ var ResetCloudCollectionDialog = (function(_super) {
+ __extends(ResetCloudCollectionDialog, _super);
+ function ResetCloudCollectionDialog(element, options) {
+ _super.call(this, element, options);
+ this._checkBoxBindings = null;
+ this.templateStorage = "/Components/Music/ResetCloudCollection.html";
+ this.templateName = "dialogTemplate"
+ }
+ ResetCloudCollectionDialog.prototype.initialize = function() {
+ var _this = this;
+ _super.prototype.initialize.call(this);
+ this.buttons = [new ResetButton, this._createCancelButton()];
+ this._checkBoxBindings = Entertainment.Utilities.addEventHandlers(this.overlayContent.winControl, {isCheckedChanged: function() {
+ return _this._onCheckBoxChanged()
+ }})
+ };
+ ResetCloudCollectionDialog.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ if (this._checkBoxBindings) {
+ this._checkBoxBindings.cancel();
+ this._checkBoxBindings = null
+ }
+ };
+ ResetCloudCollectionDialog.showDialog = function() {
+ var options = {
+ title: String.load(String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_TITLE), userControl: "MS.Entertainment.Music.ResetCloudCollectionDialogContent", userControlOptions: {}
+ };
+ var dialog = new ResetCloudCollectionDialog(document.createElement("div"), options);
+ return dialog.show()
+ };
+ ResetCloudCollectionDialog.prototype._createCancelButton = function() {
+ return {
+ title: String.load(String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_CANCEL), execute: function(dialog) {
+ return dialog.hide()
+ }
+ }
+ };
+ ResetCloudCollectionDialog.prototype._onCheckBoxChanged = function() {
+ if (this.buttons && this.buttons.length > 0 && this.overlayContent && this.overlayContent.winControl) {
+ this.buttons[0].isEnabled = this.overlayContent.winControl.isChecked;
+ this.buttons[0].isDisabled = !this.overlayContent.winControl.isChecked
+ }
+ };
+ return ResetCloudCollectionDialog
+ })(MS.Entertainment.UI.Controls.Dialog);
+ Music.ResetCloudCollectionDialog = ResetCloudCollectionDialog;
+ var ResetButton = (function(_super) {
+ __extends(ResetButton, _super);
+ function ResetButton() {
+ _super.apply(this, arguments);
+ this._isDisabled = true;
+ this.isEnabled = false;
+ this.title = String.load(String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_DELETE)
+ }
+ Object.defineProperty(ResetButton.prototype, "isDisabled", {
+ get: function() {
+ return this._isDisabled
+ }, set: function(value) {
+ this.updateAndNotify("isDisabled", value)
+ }, enumerable: true, configurable: true
+ });
+ ResetButton.prototype.execute = function(dialog) {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var resetAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.resetCloudCollection);
+ resetAction.parameter = {
+ deleteMusicPassContent: dialog.userControlInstance._deleteMusicPassOption.checked, deletePurchasedContent: dialog.userControlInstance._deletePurchasedOption.checked, deletePlaylists: dialog.userControlInstance._deletePlaylistsOption.checked
+ };
+ resetAction.execute();
+ dialog.hide()
+ };
+ return ResetButton
+ })(Entertainment.UI.Framework.ObservableBase);
+ Music.ResetButton = ResetButton
+ })(Music = Entertainment.Music || (Entertainment.Music = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.Music.ResetCloudCollectionDialog);
+var MS;
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Actions;
+ (function(Actions) {
+ var Settings;
+ (function(Settings) {
+ var ResetCloudCollectionAction = (function(_super) {
+ __extends(ResetCloudCollectionAction, _super);
+ function ResetCloudCollectionAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.resetCloudCollection
+ }
+ ResetCloudCollectionAction.prototype.executed = function(param) {
+ Actions.assert(param, "ResetCloudCollectionAction::executed() param cannot be null.");
+ var resetQuery = new Entertainment.Data.Query.Music.ResetCloudCollection;
+ resetQuery.deleteMusicPassContent = param.deleteMusicPassContent;
+ resetQuery.deletePurchasedContent = param.deletePurchasedContent;
+ resetQuery.deletePlaylists = param.deletePlaylists;
+ resetQuery.execute().done(function() {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ if (actionService.isRegistered(UI.Actions.ActionIdentifiers.showResetCloudCollectionFlyout)) {
+ var action = actionService.getAction(UI.Actions.ActionIdentifiers.showResetCloudCollectionFlyout);
+ action.execute()
+ }
+ }, function(error) {
+ Actions.fail("ResetCloudCollectionAction::executed() failed. Error:" + error && error.message)
+ })
+ };
+ ResetCloudCollectionAction.prototype.canExecute = function(param) {
+ return param && (param.deleteMusicPassContent || param.deletePurchasedContent || param.deletePlaylists)
+ };
+ return ResetCloudCollectionAction
+ })(MS.Entertainment.UI.Actions.Action);
+ Settings.ResetCloudCollectionAction = ResetCloudCollectionAction;
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ actionService.register(UI.Actions.ActionIdentifiers.resetCloudCollection, function() {
+ return new UI.Actions.Settings.ResetCloudCollectionAction
+ })
+ })(Settings = Actions.Settings || (Actions.Settings = {}))
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunemusic/Components/Music/TransferNotificationHandler.js b/packages/microsoft.zunemusic/Components/Music/TransferNotificationHandler.js
new file mode 100644
index 00000000..393bb068
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/TransferNotificationHandler.js
@@ -0,0 +1,80 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/FileTransferNotificationService.js", "/Components/BaseTransferNotificationHandler.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {FileTransferNotificationHandlers: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.BaseFileTransferNotificationHandlers", function FileTransferNotificationHandlersConstructor() {
+ MS.Entertainment.UI.BaseFileTransferNotificationHandlers.prototype.constructor.call(this)
+ }, {
+ _createAlbumNotificationCategory: function _createAlbumNotificationCategory(albumMediaId) {
+ return this.Type.AlbumDownloadError + "_" + albumMediaId
+ }, _clearDownloadEventInfo: function _clearDownloadEventInfo(eventInfo) {
+ var appNotificationService;
+ MS.Entertainment.UI.BaseFileTransferNotificationHandlers.prototype._clearDownloadEventInfo.apply(this, arguments);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.albumMediaId)) {
+ appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ appNotificationService.removeNotificationByCategory(this._createAlbumNotificationCategory(eventInfo.task.albumMediaId))
+ }
+ }, _setDownloadErrorEventInfo: function _setDownloadErrorEventInfo(eventInfo) {
+ MS.Entertainment.UI.BaseFileTransferNotificationHandlers.prototype._setDownloadErrorEventInfo.apply(this, arguments);
+ if (eventInfo && eventInfo.task && !MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.albumMediaId) && this.errorPopoverMediaId !== eventInfo.task.albumMediaId && MS.Entertainment.UI.FileTransferService.showErrorNotificationsForTask(eventInfo.task)) {
+ var appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ var notification;
+ var title = String.load(String.id.IDS_MUSIC_DOWNLOAD_ERROR);
+ var subTitle = String.load(String.id.IDS_MUSIC_DOWNLOAD_VIEW_ALBUM);
+ var icon = MS.Entertainment.UI.Icon.inlineError;
+ var category = this._createAlbumNotificationCategory(eventInfo.task.albumMediaId);
+ var action;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation))
+ action = function navigateToAlbumDetails() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var actionToExecute = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate);
+ var hasLibraryId = MS.Entertainment.Utilities.isValidLibraryId(eventInfo.task.albumLibraryId);
+ actionToExecute.parameter = {
+ data: hasLibraryId ? eventInfo.task.albumLibraryId : eventInfo.task.albumMediaId, location: hasLibraryId ? MS.Entertainment.Data.ItemLocation.collection : MS.Entertainment.Data.ItemLocation.marketplace
+ };
+ actionToExecute.execute()
+ }.bind(this);
+ else
+ action = function showErrorPopover() {
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ var query = new MS.Entertainment.Data.Query.libraryAlbums;
+ query.albumId = eventInfo.task.albumLibraryId;
+ var sender;
+ var notifications = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true));
+ sender = notifications.createSender();
+ notifications.modifyQuery(query);
+ query.execute().done(function displayPopOver(q) {
+ if (q.result.totalCount > 0) {
+ var listenerId = "AlbumDownloadErrorListenerId_" + Math.random();
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener(listenerId, MS.Entertainment.UI.FileTransferService.keyFromProperty("albumMediaId", false, true), sender, MS.Entertainment.UI.FileTransferNotifiers.trackCollection);
+ q.result.items.itemsFromIndex(0).then(function itemsFromIndex_complete(items) {
+ var item = items.items[0].data;
+ item.listenerId = listenerId;
+ var popOverParameters = {itemConstructor: "MS.Entertainment.Pages.MusicAlbumInlineDetails"};
+ popOverParameters.dataContext = {
+ data: item, location: MS.Entertainment.Data.ItemLocation.collection
+ };
+ this.errorPopoverMediaId = eventInfo.task.albumMediaId;
+ var onPopoverClosed = function onPopoverClosed() {
+ this.errorPopoverMediaId = null
+ }.bind(this);
+ MS.Entertainment.UI.Controls.PopOver.showPopOver(popOverParameters).done(onPopoverClosed, onPopoverClosed)
+ }.bind(this))
+ }
+ }.bind(this))
+ }.bind(this);
+ notification = new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Critical, title: title, subTitle: subTitle, icon: icon, action: action, category: category, isPersistent: true, dismissOnSignOut: true
+ });
+ appNotificationService.send(notification)
+ }
+ }, _downloadNotification: {get: function() {
+ return String.load(String.id.IDS_MUSIC_DOWNLOAD_NOTIFICATION)
+ }}, _downloadInProgressString: {get: function() {
+ return String.id.IDS_MUSIC_DOWNLOAD_PROGRESS_SONGS_PLURAL
+ }}, _downloadComplete: {get: function() {
+ return String.load(String.id.IDS_MUSIC_DOWNLOAD_COMPLETE)
+ }}
+ })})
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music/musicia.js b/packages/microsoft.zunemusic/Components/Music/musicia.js
new file mode 100644
index 00000000..14e84cd7
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music/musicia.js
@@ -0,0 +1,338 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/iaservice.js", "/Framework/serviceLocator.js", "/Monikers.js", "/ViewModels/Music/MusicSpotlight.js", "/ViewModels/Music/MusicHubMusicPanel.js");
+(function() {
+ "use strict";
+ var createMusicIA = function createMusicIA(iaService) {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var musicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var musicMarketplaceEditorialEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplaceEditorial);
+ var musicSmartDJEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.smartDJMarketplace);
+ var subscriptionEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSubscription);
+ var freeStreamEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay);
+ var demoMode = configManager.shell.retailExperience;
+ var usingNewMusicPage = configManager.shell.useNewMusicPage || window.onNewMusicPage;
+ var hiddenPanel = {panel: MS.Entertainment.InformationArchitecture.Viewability.hidden};
+ var hiddenHub = {hub: MS.Entertainment.InformationArchitecture.Viewability.hidden};
+ var musicPage = "Components/Music/MusicPagesVertical.html";
+ var templateMusicHubSpotlightPanel = "Components/Music/MusicDashboardTemplates.html#musicHubSpotlightPanelTemplate";
+ var templateMusicHubMarketplacePanel = "Components/Music/Music.html#musicHubMusicMarketplacePanelTemplate";
+ var templateMusicHubNewReleasesPanel = "Components/Music/Music.html#musicHubNewReleasesPanelTemplate";
+ var templateTopMusic = "Components/Music/Music.html#musicHubTopMusicPanelTemplate";
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ scriptValidator("/ViewModels/Music/MusicWelcomeViewModel.js");
+ function createMusicCollectionGetDataContext(view) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.MusicCollection(view), minModifierItems: 0, doNotRaisePanelReady: true, pivotsUsePanels: true, modifiersUsePanels: false, hideLoadingPanel: true, hideShadow: false, hideSidebar: true
+ }
+ }
+ {};
+ function createMusicPlaylistCollectionGetDataContext() {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.MusicPlaylistCollection, minModifierItems: 0, doNotRaisePanelReady: true, pivotsUsePanels: true, modifiersUsePanels: false, hideLoadingPanel: true, hideShadow: false, hideSidebar: true
+ }
+ }
+ {};
+ function createMusicSmartDJCollectionGetDataContext() {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.MusicSmartDJCollection, minModifierItems: 0, doNotRaisePanelReady: true, pivotsUsePanels: true, modifiersUsePanels: false, hideLoadingPanel: false, hideShadow: false, hidePivotsOnFailed: false, hideSidebar: true
+ }
+ }
+ {};
+ function createMusicSearchDataContext(viewType) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.MusicSearchViewModel(viewType, musicMarketplaceEnabled), minModifierItems: 0, doNotRaisePanelReady: true, pivotsUsePanels: true, modifiersUsePanels: false, hideLoadingPanel: false, hideShadow: false, hideSidebar: true
+ }
+ }
+ {};
+ function createArtistAlbumsDataContext(viewType) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.ArtistAlbums(viewType), minModifierItems: 0, doNotRaisePanelReady: true, pivotsUsePanels: true, modifiersUsePanels: false, hideLoadingPanel: false, hideShadow: false, hideSidebar: true
+ }
+ }
+ {};
+ function createArtistActionSearchContext(viewType) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.ArtistActionSearchViewModel(viewType), minModifierItems: 0, doNotRaisePanelReady: true, pivotsUsePanels: false, modifiersUsePanels: false, hideLoadingPanel: false, hideShadow: false, hideSidebar: true
+ }
+ }
+ {};
+ function createSelectPlaylistContext(viewType) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.SelectPlaylistViewModel(viewType), minModifierItems: 0, doNotRaisePanelReady: true, pivotsUsePanels: false, modifiersUsePanels: false, hideLoadingPanel: false, hideShadow: false, hideSidebar: true
+ }
+ }
+ {};
+ var nowPlaying = iaService.createNode(String.load(String.id.IDS_HOME_NOW_PLAYING), MS.Entertainment.UI.Monikers.fullScreenNowPlaying);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(nowPlaying, "Components/Music/MusicFullScreenNowPlaying.html");
+ nowPlaying.getDataContext = null;
+ var artistAlbums = iaService.createNode(String.load(String.id.IDS_MUSIC_ALBUMS_PIVOT), MS.Entertainment.UI.Monikers.artistAlbums);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(artistAlbums, musicPage);
+ artistAlbums.getDataContext = function getMusicCollectionDataContext() {
+ return {preventHubSelectionSave: true}
+ };
+ var collectionArtistAlbums = iaService.createNode(String.load(String.id.IDS_MUSIC_COLLECTION_PIVOT), MS.Entertainment.UI.Monikers.artistAlbumsCollection, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(collectionArtistAlbums, "Components/Music/MusicPanels.html#artistAlbums");
+ collectionArtistAlbums.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createArtistAlbumsDataContext("collection");
+ return dataContext
+ };
+ artistAlbums.addChild(collectionArtistAlbums);
+ var marketplaceArtistAlbums = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_PIVOT), MS.Entertainment.UI.Monikers.artistAlbumsMarketplace, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(marketplaceArtistAlbums, "Components/Music/MusicPanels.html#artistAlbums");
+ marketplaceArtistAlbums.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createArtistAlbumsDataContext("marketplace");
+ return dataContext
+ };
+ artistAlbums.addChild(marketplaceArtistAlbums);
+ var musicSearch = iaService.createNode(String.load(String.id.IDS_SEARCH_SEARCHSTARTED), MS.Entertainment.UI.Monikers.searchPage);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(musicSearch, musicPage);
+ musicSearch.getDataContext = function getMusicCollectionDataContext() {
+ return {preventHubSelectionSave: true}
+ };
+ var allMusicSearch = iaService.createNode(String.load(String.id.IDS_SEARCH_FILTER_ALL), MS.Entertainment.UI.Monikers.allMusicSearch, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(allMusicSearch, "Components/Music/MusicPanels.html#musicSearchTemplate");
+ allMusicSearch.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicSearchDataContext(MS.Entertainment.ViewModels.MusicSearchViewModel.ViewTypes.allMusic);
+ return dataContext
+ };
+ allMusicSearch.titleProviderFactory = function getSearchResultsPivotTitleProvider() {
+ return new MS.Entertainment.ViewModels.SearchResultsPivotTitleProvider(String.id.IDS_SEARCH_FILTER_ALL, String.id.IDS_SEARCH_ALL_PIVOT_LABEL, "allCount", false)
+ };
+ musicSearch.addChild(allMusicSearch);
+ var artistsSearch = iaService.createNode(String.load(String.id.IDS_MUSIC_TYPE_ARTIST_TITLE_TC), MS.Entertainment.UI.Monikers.artistsSearch, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(artistsSearch, "Components/Music/MusicPanels.html#musicSearchTemplate");
+ artistsSearch.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicSearchDataContext(MS.Entertainment.ViewModels.MusicSearchViewModel.ViewTypes.artists);
+ return dataContext
+ };
+ artistsSearch.titleProviderFactory = function getSearchResultsPivotTitleProvider() {
+ return new MS.Entertainment.ViewModels.SearchResultsPivotTitleProvider(String.id.IDS_MUSIC_TYPE_ARTIST_TITLE_TC, String.id.IDS_SEARCH_ARTISTS_PIVOT_LABEL, "artistsCount", true)
+ };
+ musicSearch.addChild(artistsSearch);
+ var albumsSearch = iaService.createNode(String.load(String.id.IDS_MUSIC_TYPE_ALBUM_TITLE_TC), MS.Entertainment.UI.Monikers.albumsSearch, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(albumsSearch, "Components/Music/MusicPanels.html#musicSearchTemplate");
+ albumsSearch.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicSearchDataContext(MS.Entertainment.ViewModels.MusicSearchViewModel.ViewTypes.albums);
+ return dataContext
+ };
+ albumsSearch.titleProviderFactory = function getSearchResultsPivotTitleProvider() {
+ return new MS.Entertainment.ViewModels.SearchResultsPivotTitleProvider(String.id.IDS_MUSIC_TYPE_ALBUM_TITLE_TC, String.id.IDS_SEARCH_ALBUMS_PIVOT_LABEL, "albumsCount", true)
+ };
+ musicSearch.addChild(albumsSearch);
+ var tracksSearch = iaService.createNode(String.load(String.id.IDS_MUSIC_TYPE_TRACK_TITLE_TC), MS.Entertainment.UI.Monikers.tracksSearch, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(tracksSearch, "Components/Music/MusicPanels.html#musicSearchTemplate");
+ tracksSearch.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicSearchDataContext(MS.Entertainment.ViewModels.MusicSearchViewModel.ViewTypes.tracks);
+ return dataContext
+ };
+ tracksSearch.titleProviderFactory = function getSearchResultsPivotTitleProvider() {
+ return new MS.Entertainment.ViewModels.SearchResultsPivotTitleProvider(String.id.IDS_MUSIC_TYPE_TRACK_TITLE_TC, String.id.IDS_SEARCH_SONGS_PIVOT_LABEL, "songsCount", true)
+ };
+ musicSearch.addChild(tracksSearch);
+ var playlistsSearch = iaService.createNode(String.load(String.id.IDS_MUSIC_TYPE_PLAYLIST_TITLE_TC), MS.Entertainment.UI.Monikers.playlistsSearch, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(playlistsSearch, "Components/Music/MusicPanels.html#musicSearchTemplate");
+ playlistsSearch.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicSearchDataContext(MS.Entertainment.ViewModels.MusicSearchViewModel.ViewTypes.playlists);
+ return dataContext
+ };
+ playlistsSearch.titleProviderFactory = function getSearchResultsPivotTitleProvider() {
+ return new MS.Entertainment.ViewModels.SearchResultsPivotTitleProvider(String.id.IDS_MUSIC_TYPE_PLAYLIST_TITLE_TC, String.id.IDS_SEARCH_PLAYLISTS_PIVOT_LABEL, "playlistsCount", true)
+ };
+ musicSearch.addChild(playlistsSearch);
+ var artistActionSearch = iaService.createNode(String.load(String.id.IDS_SEARCH_SEARCHSTARTED), MS.Entertainment.UI.Monikers.artistSearchAction);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(artistActionSearch, musicPage);
+ artistActionSearch.getDataContext = function getMusicCollectionDataContext() {
+ return {preventHubSelectionSave: true}
+ };
+ var artistActionSearchPivot = iaService.createNode(String.load(String.id.IDS_MUSIC_COLLECTION_PIVOT), MS.Entertainment.UI.Monikers.artistSearchActionPivot, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(artistActionSearchPivot, "Components/Music/MusicPanels.html#artistActionSearch");
+ artistActionSearchPivot.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createArtistActionSearchContext("artistActionSearch");
+ return dataContext
+ };
+ artistActionSearch.addChild(artistActionSearchPivot);
+ var musicCollection = iaService.createNode(String.load(musicMarketplaceEnabled ? String.id.IDS_MUSIC_COLLECTION_PIVOT : String.id.IDS_MUSIC_APP_TITLE), MS.Entertainment.UI.Monikers.musicCollection);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(musicCollection, musicPage);
+ musicCollection.perfTrackStartPoint = MS.Entertainment.Instrumentation.PerfTrack.StartPoints.CollectionGalleryRequest;
+ if (usingNewMusicPage) {
+ var emptyHome = iaService.createNode(String.load(String.id.IDS_HOME_PIVOT), MS.Entertainment.UI.Monikers.homeHub);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(emptyHome, "/Components/Music1/EmptyHome.html");
+ iaService.rootNode = emptyHome
+ }
+ if (musicMarketplaceEnabled || usingNewMusicPage)
+ iaService.rootNode.addChild(musicCollection);
+ else
+ iaService.rootNode = musicCollection;
+ var musicCollectionByAlbum = iaService.createNode(String.load(String.id.IDS_COLLECTION_BY_ALBUM_TITLE), MS.Entertainment.UI.Monikers.musicCollectionByAlbum, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicCollectionByAlbum, "Components/Music/MusicPanels.html#musicCollectionAlbumsTemplate");
+ musicCollectionByAlbum.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicCollectionGetDataContext("albums");
+ return dataContext
+ };
+ musicCollection.addChild(musicCollectionByAlbum);
+ var musicCollectionByArtist = iaService.createNode(String.load(String.id.IDS_COLLECTION_BY_ARTIST_TITLE), MS.Entertainment.UI.Monikers.musicCollectionByArtist, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicCollectionByArtist, "Components/Music/MusicPanels.html#musicCollectionArtistsTemplate");
+ musicCollectionByArtist.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicCollectionGetDataContext("artists");
+ return dataContext
+ };
+ musicCollection.addChild(musicCollectionByArtist);
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ var musicCollectionBySong = iaService.createNode(String.load(String.id.IDS_COLLECTION_BY_SONG_TITLE), MS.Entertainment.UI.Monikers.musicCollectionBySong, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicCollectionBySong, "Components/Music/MusicPanels.html#musicCollectionSongsTemplate");
+ musicCollectionBySong.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicCollectionGetDataContext("songs");
+ return dataContext
+ };
+ musicCollection.addChild(musicCollectionBySong)
+ }
+ var musicCollectionPlaylists = iaService.createNode(String.load(String.id.IDS_PLAYLIST_COLLECTION_TITLE), MS.Entertainment.UI.Monikers.musicCollectionPlaylists, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicCollectionPlaylists, "Components/Music/MusicPanels.html#musicCollectionPlaylistsTemplate");
+ musicCollectionPlaylists.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicPlaylistCollectionGetDataContext("playlists");
+ return dataContext
+ };
+ musicCollection.addChild(musicCollectionPlaylists);
+ if (musicMarketplaceEnabled && (subscriptionEnabled || freeStreamEnabled) && musicSmartDJEnabled) {
+ var musicCollectionSmartDJs = iaService.createNode(String.load(String.id.IDS_SMARTDJ_COLLECTION_TITLE), MS.Entertainment.UI.Monikers.musicCollectionSmartDJs, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicCollectionSmartDJs, "Components/Music/MusicPanels.html#musicCollectionSmartDJsTemplate");
+ musicCollectionSmartDJs.getDataContext = function getMusicCollectionDataContext() {
+ var dataContext = createMusicSmartDJCollectionGetDataContext("smartDJs");
+ return dataContext
+ };
+ musicCollection.addChild(musicCollectionSmartDJs)
+ }
+ var selectPlaylist = iaService.createNode(String.load(String.id.IDS_MUSIC_ENGAGE_PLAYLIST_PLAY_TITLE_UC), MS.Entertainment.UI.Monikers.selectPlaylist);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(selectPlaylist, musicPage);
+ selectPlaylist.getDataContext = function getMusicCollectionDataContext() {
+ return {preventHubSelectionSave: true}
+ };
+ var selectPlaylistPivot = iaService.createNode(String.load(String.id.IDS_MUSIC_COLLECTION_PIVOT), MS.Entertainment.UI.Monikers.selectPlaylistPivot, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(selectPlaylistPivot, "Components/Music/MusicPanels.html#selectPlaylist");
+ selectPlaylistPivot.getDataContext = function getSelectPlaylistContext() {
+ var dataContext = createSelectPlaylistContext("playlists");
+ return dataContext
+ };
+ selectPlaylist.addChild(selectPlaylistPivot);
+ if (musicMarketplaceEnabled)
+ if (!demoMode) {
+ if (!usingNewMusicPage) {
+ var home = iaService.createNode(String.load(String.id.IDS_HOME_PIVOT), MS.Entertainment.UI.Monikers.homeHub);
+ home.getDataContext = function homeGetDataContext() {
+ return new MS.Entertainment.ViewModels.MusicSpotlight
+ };
+ var spotlightPanel = iaService.createNode(String.load(String.id.IDS_HOME_NOW_PLAYING_LC), MS.Entertainment.UI.Monikers.homeSpotlight, templateMusicHubSpotlightPanel);
+ iaService.rootNode.addChild(home);
+ iaService.rootNode.defaultChild = home;
+ home.addChild(spotlightPanel)
+ }
+ var createMusicMarketplaceGetDataContext = function createMusicMarketplaceGetDataContext(view) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.MusicMarketplace(view), minModifierItems: 1, doNotRaisePanelReady: true, pivotsUsePanels: false, modifiersUsePanels: false, hideLoadingPanel: false, hideShadow: true, hideSidebar: false
+ }
+ };
+ var createMusicFlexHubGetDataContext = function createMusicFlexHubGetDataContext(view) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.MusicFlexHub(view), minModifierItems: 0, pivotsUsePanels: false, modifiersUsePanels: false, hideLoadingPanel: false, hideShadow: true, hideSidebar: false
+ }
+ };
+ var welcomeAcknowledged = configManager.music.welcomeAcknowledged;
+ if (MS.Entertainment.Utilities.isMusicApp1 && !welcomeAcknowledged && freeStreamEnabled && (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)).servicesEnabled) {
+ var welcomeHub = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.welcomeHub);
+ welcomeHub.getDataContext = function welcomeHubGetDataContext() {
+ return new MS.Entertainment.ViewModels.MusicWelcomeViewModel
+ };
+ var welcomePanel = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.welcomePanel, "Components/Music/Music.html#musicHubWelcomePanelTemplate");
+ iaService.rootNode.addChild(welcomeHub);
+ welcomeHub.addChild(welcomePanel)
+ }
+ var featuredNewReleasesHub;
+ if (musicMarketplaceEditorialEnabled) {
+ featuredNewReleasesHub = iaService.createNode(String.load(String.id.IDS_MUSIC_MARKETPLACE_GALLERY_TITLE), MS.Entertainment.UI.Monikers.musicMarketplace, null, null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ featuredNewReleasesHub.perfTrackStartPoint = MS.Entertainment.Instrumentation.PerfTrack.StartPoints.MarketplaceGalleryRequest;
+ featuredNewReleasesHub.getDataContext = function getMusicCollectionDataContext() {
+ return {
+ doNotRaisePanelReady: true, hideLoadingPanel: true, hideShadow: false
+ }
+ }
+ }
+ else
+ featuredNewReleasesHub = iaService.createNode(String.load(String.id.IDS_MUSIC_MARKETPLACE_GALLERY_TITLE), MS.Entertainment.UI.Monikers.musicNewReleases, null, null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(featuredNewReleasesHub, musicPage);
+ iaService.rootNode.addChild(featuredNewReleasesHub);
+ var featuredNewReleasesPanel;
+ if (musicMarketplaceEditorialEnabled) {
+ featuredNewReleasesPanel = iaService.createNode(String.load(String.id.IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE), MS.Entertainment.UI.Monikers.musicMarketplacePanel, templateMusicHubMarketplacePanel, {hub: MS.Entertainment.InformationArchitecture.Viewability.hidden}, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ featuredNewReleasesPanel.getDataContext = function musicMarketplaceGetDataContext() {
+ return new MS.Entertainment.ViewModels.MusicHubMusicPanel
+ }
+ }
+ else {
+ featuredNewReleasesPanel = iaService.createNode(String.load(String.id.IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE), MS.Entertainment.UI.Monikers.musicNewReleasesPanel, templateMusicHubNewReleasesPanel, {hub: MS.Entertainment.InformationArchitecture.Viewability.hidden}, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ featuredNewReleasesPanel.getDataContext = function newReleasesGetDataContext() {
+ return new MS.Entertainment.ViewModels.MusicHubNewReleasesPanel
+ }
+ }
+ featuredNewReleasesHub.addChild(featuredNewReleasesPanel);
+ var musicMarketplaceNewReleasesHub = iaService.createNode(String.load(String.id.IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE), MS.Entertainment.UI.Monikers.musicNewReleasesGallery, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var newView = (MS.Entertainment.Utilities.isMusicApp1) ? MS.Entertainment.ViewModels.MusicMarketplace.ViewTypes.newReleases : MS.Entertainment.ViewModels.MusicMarketplace.ViewTypes.newReleasesHorizontal;
+ musicMarketplaceNewReleasesHub.getDataContext = function getFeaturedContext() {
+ return createMusicMarketplaceGetDataContext(newView)
+ };
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicMarketplaceNewReleasesHub, "Components/Music/MusicPanels.html#musicMarketplaceTemplate");
+ featuredNewReleasesHub.addChild(musicMarketplaceNewReleasesHub);
+ var topAlbums = iaService.createNode(String.load(String.id.IDS_MUSIC_MOST_POPULAR_PANEL_HEADER), MS.Entertainment.UI.Monikers.musicTopMusic, null, null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ topAlbums.perfTrackStartPoint = MS.Entertainment.Instrumentation.PerfTrack.StartPoints.MarketplaceGalleryRequest;
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(topAlbums, musicPage);
+ iaService.rootNode.addChild(topAlbums);
+ var topAlbumsPanel = iaService.createNode(String.load(String.id.IDS_MUSIC_MOST_POPULAR_PANEL_HEADER), MS.Entertainment.UI.Monikers.musicTopAlbumsPanel, "Components/Music/Music.html#musicHubTopAlbumsPanelTemplate", {hub: MS.Entertainment.InformationArchitecture.Viewability.hidden}, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ topAlbumsPanel.getDataContext = function topAlbumsGetDataContext() {
+ return new MS.Entertainment.ViewModels.MusicHubTopAlbumsPanel
+ };
+ topAlbums.addChild(topAlbumsPanel);
+ var topArtistPanel = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.musicTopArtistsPanel, "Components/Music/Music.html#musicHubTopArtistPanelTemplate", {hub: MS.Entertainment.InformationArchitecture.Viewability.hidden}, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ topArtistPanel.getDataContext = function topAlbumsGetDataContext() {
+ return new MS.Entertainment.ViewModels.MusicHubTopArtistPanel
+ };
+ topAlbums.addChild(topArtistPanel);
+ var musicMarketplacePopularGallery = iaService.createNode(String.load(String.id.IDS_MUSIC_MOST_POPULAR_PANEL_HEADER), MS.Entertainment.UI.Monikers.musicPopularGallery, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var popularView = (MS.Entertainment.Utilities.isMusicApp1) ? MS.Entertainment.ViewModels.MusicMarketplace.ViewTypes.popular : MS.Entertainment.ViewModels.MusicMarketplace.ViewTypes.popularHorizontal;
+ musicMarketplacePopularGallery.getDataContext = function getFeaturedContext() {
+ return createMusicMarketplaceGetDataContext(popularView)
+ };
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicMarketplacePopularGallery, "Components/Music/MusicPanels.html#musicMarketplaceTemplate");
+ topAlbums.addChild(musicMarketplacePopularGallery);
+ var musicFlexHubPage = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.flexHubPage);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(musicFlexHubPage, musicPage);
+ musicFlexHubPage.getDataContext = function getMusicFlexHubDataContext() {
+ return {
+ preventHubSelectionSave: true, pageIsFlexHub: true
+ }
+ };
+ var musicFlexHub = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.flexHub, null, hiddenPanel);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(musicFlexHub, "Components/Music/MusicPanels.html#musicFlexHubTemplate");
+ musicFlexHub.getDataContext = function getFeaturedContext() {
+ return createMusicFlexHubGetDataContext(MS.Entertainment.ViewModels.MusicFlexHub.ViewTypes.flexHub)
+ };
+ musicFlexHubPage.addChild(musicFlexHub)
+ }
+ else if (!window.onNewMusicPage) {
+ var home = iaService.createNode(String.load(String.id.IDS_HOME_PIVOT), MS.Entertainment.UI.Monikers.homeHub);
+ var spotlightPanel = iaService.createNode(String.load(String.id.IDS_MUSIC_SPOTLIGHT_PANEL_HEADER), MS.Entertainment.UI.Monikers.homeSpotlight, "Components/Music/MusicSpotlightViewDemo.html#musicSpotlightViewDemoTemplate");
+ iaService.rootNode.addChild(home);
+ iaService.rootNode.defaultChild = home;
+ home.addChild(spotlightPanel);
+ var featuredNewReleasesHubDemo = iaService.createNode(String.load(String.id.IDS_MUSIC_MARKETPLACE_GALLERY_TITLE), MS.Entertainment.UI.Monikers.musicMarketplace, null, null, null);
+ iaService.rootNode.addChild(featuredNewReleasesHubDemo);
+ var featuredNewReleasesPanelDemo = iaService.createNode(String.load(String.id.IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE), MS.Entertainment.UI.Monikers.musicMarketplacePanel, "Components/Music/FeaturedMusicViewDemo.html#featuredMusicViewDemoTemplate", hiddenHub);
+ featuredNewReleasesHubDemo.addChild(featuredNewReleasesPanelDemo)
+ }
+ };
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.informationArchitecture)) {
+ Trace.fail("MusicIA - Information Architecture not registered. This should be impossible, but is always fatal");
+ throw new Error("MusicIA - Information Architecture not registered");
+ }
+ var ia = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ ia.addIAHandler(createMusicIA)
+})()
diff --git a/packages/microsoft.zunemusic/Components/Music1/AlbumDetailsPage.html b/packages/microsoft.zunemusic/Components/Music1/AlbumDetailsPage.html
new file mode 100644
index 00000000..ccfe695c
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music1/AlbumDetailsPage.html
@@ -0,0 +1,266 @@
+
+
+
+
+
Music Album Details Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/Components/Music1/AlbumMetadataEditDialog.html b/packages/microsoft.zunemusic/Components/Music1/AlbumMetadataEditDialog.html
new file mode 100644
index 00000000..dea04365
--- /dev/null
+++ b/packages/microsoft.zunemusic/Components/Music1/AlbumMetadataEditDialog.html
@@ -0,0 +1,312 @@
+
+
+
+
+
Album metadata edit dialog
+
+
+
+
+
+
+
+
", _optionFormat: "
"
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Music", {FindAlbumInfo: MS.Entertainment.UI.Framework.defineUserControl("Components/Music/FindAlbumInfo.html#findAlbumInfoTemplate", function findAlbumInfo(element, options) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this._musicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ this._storeSyncEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.storeSync);
+ this._nextButton = WinJS.Binding.as({
+ title: String.load(String.id.IDS_FAI_NEXT_BUTTON), isEnabled: true, isAvailable: true, execute: function onNext(dialog, event) {
+ this._onNext(event, this._createTelemetryActionData("findAlbumInfoNavBar", "nextButton", this._containerButtons.indexOf(this._nextButton)))
+ }.bind(this)
+ });
+ this._finishButton = WinJS.Binding.as({
+ title: String.load(String.id.IDS_FAI_FINISH_BUTTON), isEnabled: true, isAvailable: true, execute: function onFinish(dialog, event) {
+ this._onFinish(event, this._createTelemetryActionData("findAlbumInfoNavBar", "finishButton", this._containerButtons.indexOf(this._finishButton)))
+ }.bind(this)
+ });
+ this._cancelButton = WinJS.Binding.as({
+ title: String.load(String.id.IDS_FAI_CANCEL_BUTTON), isEnabled: true, isAvailable: true, execute: function onCancel(dialog, event) {
+ this._onCancel(event, this._createTelemetryActionData("findAlbumInfoNavBar", "cancelButton", this._containerButtons.indexOf(this._cancelButton)))
+ }.bind(this)
+ });
+ this._containerButtons = [this._nextButton, this._finishButton, this._cancelButton];
+ this._queryWatcher = new MS.Entertainment.Framework.QueryWatcher("findAlbumInfo");
+ this._pageBackStack = []
+ }, {
+ collectionUpdated: false, _originalAlbum: null, _originalTracks: null, _keywords: null, _selectedAlbum: null, _selectedAlbumIndex: -1, _tracksMatch: false, _setFocusOnPage: true, _pageBackStack: null, _musicMarketplaceEnabled: false, _storeSyncEnabled: false, _nextButton: null, _finishButton: null, _cancelButton: null, _container: null, _containerButtons: null, _queryWatcher: null, _matchedTracks: null, _navigating: false, _unmatchedTracks: null, _albums: null, _matchMode: null, _matchSource: null, _signedInUser: null, _cloudCollectionService: null, _currentPage: null, _lastXCorrelationId: null, _page: {
+ get: function() {
+ return this._currentPage
+ }, set: function(value) {
+ if (value !== this._currentPage) {
+ var currentPageData;
+ if (this._currentPage)
+ currentPageData = {
+ uri: this._currentPage, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popover
+ };
+ else
+ currentPageData = {
+ uri: MS.Entertainment.Utilities.getCurrentUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown
+ };
+ MS.Entertainment.Utilities.Telemetry.logPageView(this.domElement, {
+ uri: "findAlbumInfo/" + value, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popover
+ }, currentPageData);
+ this._currentPage = value;
+ this._setFocusOnPage = true
+ }
+ }
+ }, initialize: function initialize() {
+ MS.Entertainment.Music.assert(this._matchMode, "_matchMode must be specified in the options");
+ this._keywords = this._getInitialKeywords();
+ this._page = MS.Entertainment.Music.FindAlbumInfo.Page.selectAlbum;
+ if (this._originalAlbum.libraryId === -1) {
+ if (this._originalAlbum.tracks)
+ this._originalAlbum.tracks.toArrayAll().done(function(tracks) {
+ this._originalTracks = tracks;
+ this.tracks = tracks
+ }.bind(this), function handleError(error) {
+ MS.Entertainment.Music.fail("Getting all tracks failed. Error: " + error && error.message)
+ })
+ }
+ else
+ this._queryLibraryTracks();
+ this._showElement(this._trackColumnHeader, false);
+ this._showElement(this._trackList, false);
+ this._queryAlbums();
+ this._sendTelemetryEvent("FindAlbumInfo_Begin");
+ this._albumList.selectionHelperFactory = function selectionHelperFactory() {
+ return new MS.Entertainment.UI.Controls.DoNothingSelectionHelper
+ };
+ this._signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this._cloudCollectionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection)
+ }, onSearch: function onSearch() {
+ if (this._keywords !== this._keywordsEdit.value) {
+ this._sendTelemetryPageAction(this._searchIcon, this._currentPage);
+ this._keywords = this._keywordsEdit.value;
+ this._queryAlbums();
+ this._sendTelemetryEvent("FindAlbumInfo_NewSearch")
+ }
+ }, onSearchKeyDown: function onSearchKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter)
+ this.onSearch()
+ }, onSearchFocus: function onSearchFocus(event) {
+ if (this._searchContainer)
+ WinJS.Utilities.addClass(this._searchContainer, "searchFocused")
+ }, onSearchBlur: function onSearchBlur(event) {
+ if (this._searchContainer)
+ WinJS.Utilities.removeClass(this._searchContainer, "searchFocused")
+ }, unload: function unload() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, setOverlay: function setOverlay(container) {
+ this._container = container;
+ container.buttons = this._containerButtons;
+ container.backClickHandler = this.onBackClick.bind(this);
+ container.searchAlbumsClickHandler = this.onSearchAlbumsClick.bind(this);
+ container.bulkMatchClickHandler = this.onBulkMatchClick.bind(this);
+ this._updateState()
+ }, onAlbumSelected: function onAlbumSelected(event) {
+ if (this._navigating)
+ return;
+ if (event && event.target && event.target.winControl && event.target.winControl.selection) {
+ var indices = event.target.winControl.selection.getIndices();
+ if (indices && indices.length > 0)
+ this._albumList.dataSource.itemsFromIndex(indices[0], 0, 0).done(function albumSelected(args) {
+ var mediaResult = args.items[args.offset];
+ var media;
+ if (mediaResult && mediaResult.data)
+ media = mediaResult.data;
+ this._sendTelemetryPageAction(event.target, this._currentPage, media);
+ this.albumSelectionHandler(media, indices[0])
+ }.bind(this), function handleError(error) {
+ MS.Entertainment.Music.fail("Failed to get selected album. Error: " + (error && error.message))
+ });
+ else if (this._selectedAlbumIndex >= 0)
+ this.albumSelectionHandler(null, this._selectedAlbumIndex)
+ }
+ else
+ MS.Entertainment.Music.fail("selectionchanged event invalid. Unable to cloud match album")
+ }, albumSelectionHandler: function albumSelectionHandler(mediaItem, itemIndex) {
+ if (this._selectedAlbum && this._selectedAlbumIndex === itemIndex) {
+ this._selectedAlbum = null;
+ this._selectedAlbumIndex = -1;
+ this._updateState()
+ }
+ else if (mediaItem) {
+ this._selectedAlbum = mediaItem;
+ this._selectedAlbumIndex = itemIndex;
+ this._queryTracks(mediaItem)
+ }
+ else
+ MS.Entertainment.Music.fail("Invalid selection state. Unable to cloud match album")
+ }, onSearchAlbumsClick: function onSearchAlbumsClick(event) {
+ this._sendTelemetryPageAction(event.target, MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums);
+ var telemetryParameterArray = [];
+ if (this._lastXCorrelationId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.XCorrelationId, parameterValue: this._lastXCorrelationId
+ });
+ this._sendTelemetryEvent("FindAlbumInfo_Search", telemetryParameterArray);
+ this._pageBackStack.push(this._page);
+ this._page = MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums;
+ this._updateState();
+ if (this._musicMarketplaceEnabled)
+ this._queryAlbums();
+ this.tracks = this._originalTracks
+ }, onBulkMatchClick: function onBulkMatchClick(event) {
+ MS.Entertainment.Music.cloudMatchOptInDialog.show()
+ }, _onNext: function _onNext(event, pageContentDataObject) {
+ this._sendTelemetryPageAction(event.target, MS.Entertainment.Music.FindAlbumInfo.Page.matchTracks, null, pageContentDataObject);
+ this._navigating = true;
+ this._pageBackStack.push(this._page);
+ this._page = MS.Entertainment.Music.FindAlbumInfo.Page.matchTracks;
+ this._updateState();
+ this._navigating = false
+ }, onBackClick: function onBackClick(event) {
+ this._navigating = true;
+ if (this._pageBackStack.length > 0) {
+ this._sendTelemetryPageAction(event.target, this._pageBackStack[this._pageBackStack.length - 1]);
+ this._page = this._pageBackStack.pop();
+ this._updateState();
+ if (this._pageBackStack.length === 0 && (this._musicMarketplaceEnabled || this._keywords !== this._getInitialKeywords())) {
+ this._keywords = this._getInitialKeywords();
+ this._queryAlbums()
+ }
+ }
+ this._navigating = false
+ }, _onCancel: function _onCancel(event, pageContentDataObject) {
+ var domElement = event ? event.target : null;
+ this._sendTelemetryPageAction(domElement, null, null, pageContentDataObject);
+ var telemetryParameterArray = [];
+ if (this._lastXCorrelationId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.XCorrelationId, parameterValue: this._lastXCorrelationId
+ });
+ this._sendTelemetryEvent("FindAlbumInfo_Cancel", telemetryParameterArray);
+ this._container.hide()
+ }, _getInitialKeywords: function _getInitialKeywords() {
+ var keywords = this._originalAlbum.name;
+ if (this._originalAlbum.artistName !== String.load(String.id.IDS_MEDIASTORE_VARIOUS_ARTISTS))
+ keywords += " " + this._originalAlbum.artistName;
+ return keywords
+ }, _isCloudMatch: {get: function get_isCloudMatch() {
+ return this._matchMode === MS.Entertainment.Music.FindAlbumInfo.MatchMode.cloud
+ }}, _isLibraryMatch: {get: function get_isLibraryMatch() {
+ return this._matchMode === MS.Entertainment.Music.FindAlbumInfo.MatchMode.library
+ }}, _queryLibraryTracks: function _queryLibraryTracks() {
+ var query = new MS.Entertainment.Data.Query.libraryTracks;
+ query.albumId = this._originalAlbum.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.TracksSortBy.numberAscending;
+ this._queryWatcher.registerQuery(query);
+ query.execute().done(function querySuccess(q) {
+ q.result.items.toArrayAll().done(function(tracks) {
+ this._originalTracks = tracks;
+ this.tracks = tracks
+ }.bind(this))
+ }.bind(this), function queryError(q) {
+ MS.Entertainment.Music.fail("library tracks query failed!")
+ })
+ }, _queryAlbums: function _queryAlbums() {
+ this._matchSource = null;
+ this._albums = null;
+ this.tracks = null;
+ this._tracksMatch = false;
+ this._selectedAlbum = null;
+ this._selectedAlbumIndex = -1;
+ if (this._tracksLoadingControl)
+ this._tracksLoadingControl.reset();
+ if (this._albumsLoadingControl)
+ this._albumsLoadingControl.reset();
+ this._showElement(this._noAlbumsLabel, false);
+ if (this._albumsLoadingControl)
+ this._albumsLoadingControl.isBusy = true;
+ this._updateState();
+ var keywords = this._keywords;
+ if (keywords) {
+ if (keywords.length > MS.Entertainment.Music.FindAlbumInfo._maxSearchTextLength)
+ keywords = keywords.slice(0, MS.Entertainment.Music.FindAlbumInfo._maxSearchTextLength);
+ var query;
+ var matchSource;
+ if (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.selectAlbum) {
+ matchSource = MS.Entertainment.Music.FindAlbumInfo.MatchSource.musicMatch;
+ query = new MS.Entertainment.Data.Query.Music.MusicMatch.AlbumSearch;
+ query.albumLibraryId = this._originalAlbum.libraryId
+ }
+ else {
+ matchSource = MS.Entertainment.Music.FindAlbumInfo.MatchSource.eds;
+ query = new MS.Entertainment.Data.Query.Music.AlbumSearch;
+ query.inflateParentItems = true
+ }
+ query.search = keywords;
+ this._queryWatcher.registerQuery(query);
+ query.execute().done(function querySuccess(q) {
+ if (this.domElement) {
+ if (q.result.xCorrelationId)
+ this._lastXCorrelationId = q.result.xCorrelationId;
+ this._matchSource = matchSource;
+ this._albums = q.result.items;
+ if (!this._albums || !this._albums.count)
+ if (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums)
+ this._showElement(this._noAlbumsLabel, true);
+ else {
+ this._page = MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums;
+ this._queryAlbums()
+ }
+ if (this._albumsLoadingControl)
+ this._albumsLoadingControl.isBusy = false;
+ this._updateState()
+ }
+ }.bind(this), function queryError(q) {
+ if (this.domElement)
+ if (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums) {
+ if (this._albumsLoadingControl)
+ this._albumsLoadingControl.isOffline = true
+ }
+ else {
+ this._page = MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums;
+ this._queryAlbums()
+ }
+ }.bind(this))
+ }
+ }, _queryTracks: function _queryTracks(album) {
+ this.tracks = null;
+ if (this._tracksLoadingControl)
+ this._tracksLoadingControl.reset();
+ this._tracksMatch = null;
+ var query;
+ var promise = WinJS.Promise.as();
+ var matchUsingRequestId = false;
+ if (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.selectAlbum) {
+ matchUsingRequestId = true;
+ query = {result: album}
+ }
+ else {
+ query = new MS.Entertainment.Data.Query.Music.AlbumSongs;
+ query.id = album.canonicalId
+ }
+ function loadPages(promise) {
+ return promise.then(function complete(query) {
+ var result = query.result;
+ if (result.tracks && result.tracks.count < result.total)
+ return loadPages(query.loadNextChunk())
+ })
+ }
+ {};
+ if (query.execute) {
+ query.idType = album.serviceIdType;
+ this._queryWatcher.registerQuery(query);
+ if (this._tracksLoadingControl)
+ this._tracksLoadingControl.isBusy = true;
+ promise = loadPages(query.execute())
+ }
+ var result;
+ promise.then(function queryComplete() {
+ if (query.result.item)
+ result = query.result.item;
+ else
+ result = query.result;
+ if (!result)
+ return WinJS.Promise.as();
+ var tracks = result.tracks;
+ if (tracks) {
+ var trackArray = Array.isArray(tracks) ? tracks : null;
+ if (trackArray)
+ return WinJS.Promise.wrap(trackArray);
+ return MS.Entertainment.Data.List.listToArray(tracks)
+ }
+ }).done(function gotTrackArray(trackArray) {
+ var tracks = [];
+ if (trackArray && trackArray.length > 0)
+ if (this._isCloudMatch) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var hasSubscription = signInService.isSignedIn && signedInUserService.isSubscription;
+ trackArray.forEach(function filterTracks(track) {
+ if ((track.isInMusicCatalog && MS.Entertainment.Utilities.isValidServiceId(track.actionableMediaId)) || track.canFreeStream || (hasSubscription && track.canSubscriptionStream))
+ tracks.push(track)
+ })
+ }
+ else
+ tracks = trackArray;
+ MS.Entertainment.Utilities.forceFullLayout();
+ tracks.sort(function(track0, track1) {
+ return track0.trackNumber - track1.trackNumber
+ });
+ this.tracks = tracks;
+ if (matchUsingRequestId)
+ this._tracksMatch = this._matchTracksUsingRequestId();
+ else
+ this._tracksMatch = this._matchTracks();
+ this._updateState();
+ if (result) {
+ if (result.uniqueFileId)
+ album.uniqueFileId = result.uniqueFileId;
+ if (result.imageUri)
+ album.imageUri = result.imageUri
+ }
+ if (this._tracksLoadingControl)
+ this._tracksLoadingControl.isBusy = false
+ }.bind(this), function queryError(q) {
+ if (this._tracksLoadingControl)
+ this._tracksLoadingControl.isOffline = true
+ }.bind(this))
+ }, _matchTracksUsingRequestId: function _matchTracksUsingRequestId() {
+ this._matchedTracks = [];
+ this._unmatchedTracks = [];
+ var i;
+ var originalTrack;
+ var matchedTrack;
+ var returnedTrack;
+ var tracksMap = [];
+ for (i = 0; i < this.tracks.length; i++) {
+ returnedTrack = this.tracks[i];
+ returnedTrack.isMatched = false;
+ if (returnedTrack.requestId)
+ tracksMap[returnedTrack.requestId] = returnedTrack
+ }
+ if (this._originalTracks)
+ for (i = 0; i < this._originalTracks.length; i++) {
+ originalTrack = this._originalTracks[i];
+ matchedTrack = tracksMap[originalTrack.libraryId.toString()];
+ if (matchedTrack) {
+ matchedTrack.isMatched = true;
+ matchedTrack.libraryId = originalTrack.libraryId;
+ this._matchedTracks.push(matchedTrack)
+ }
+ else
+ this._unmatchedTracks.push({
+ originalTrack: originalTrack, availableTracks: this.tracks, selectedTrack: null
+ })
+ }
+ return (this._unmatchedTracks.length === 0)
+ }, _matchTracks: function _matchTracks() {
+ this._matchedTracks = [];
+ this._unmatchedTracks = [];
+ var key = function key(trackName, trackNumber) {
+ return trackName.toLowerCase() + "/" + trackNumber
+ };
+ var i;
+ var tracksMap = [];
+ for (i = 0; i < this.tracks.length; i++) {
+ var track = this.tracks[i];
+ track.isMatched = false;
+ if (track.name)
+ tracksMap[key(track.name, track.trackNumber)] = track;
+ if (track.mainTitle)
+ tracksMap[key(track.mainTitle, track.trackNumber)] = track
+ }
+ if (this._originalTracks)
+ for (i = 0; i < this._originalTracks.length; i++) {
+ var originalTrack = this._originalTracks[i];
+ var matchedTrack = tracksMap[key(originalTrack.name, originalTrack.trackNumber)];
+ if (matchedTrack) {
+ matchedTrack.isMatched = true;
+ matchedTrack.libraryId = originalTrack.libraryId;
+ this._matchedTracks.push(matchedTrack)
+ }
+ else
+ this._unmatchedTracks.push({
+ originalTrack: originalTrack, availableTracks: this.tracks, selectedTrack: null
+ })
+ }
+ return (this._unmatchedTracks.length === 0)
+ }, _updateState: function _updateState() {
+ if (this._unloaded)
+ return;
+ var selectAlbum = (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.selectAlbum);
+ var searchAlbums = (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums);
+ var matchTracks = (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.matchTracks);
+ var showSelectAlbumsPage;
+ var isAlbumSelected = !!this._selectedAlbum;
+ if (this._container) {
+ var titleStringId,
+ subTitleStringId;
+ switch (this._page) {
+ case MS.Entertainment.Music.FindAlbumInfo.Page.selectAlbum:
+ if (this._isCloudMatch) {
+ titleStringId = String.id.IDS_FAI_ADD_ALBUM_CLOUD_TITLE;
+ subTitleStringId = String.id.IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE
+ }
+ else
+ titleStringId = (this._musicMarketplaceEnabled && this._storeSyncEnabled) ? String.id.IDS_FAI_CHOOSE_ALBUM_CLOUD_TITLE : String.id.IDS_FAI_CHOOSE_ALBUM_TITLE;
+ this._showElement(this._trackColumnHeader, isAlbumSelected);
+ this._showElement(this._trackList, isAlbumSelected);
+ break;
+ case MS.Entertainment.Music.FindAlbumInfo.Page.searchAlbums:
+ titleStringId = String.id.IDS_FAI_SEARCH_ALBUM_TITLE;
+ this._showElement(this._trackColumnHeader, isAlbumSelected);
+ this._showElement(this._trackList, isAlbumSelected);
+ break;
+ case MS.Entertainment.Music.FindAlbumInfo.Page.matchTracks:
+ titleStringId = String.id.IDS_FAI_MATCH_SONGS_TITLE;
+ if (this._isCloudMatch)
+ subTitleStringId = String.id.IDS_FAI_MATCH_SONGS_SUBTITLE;
+ break;
+ default:
+ MS.Entertainment.Music.fail("Invalid PageType")
+ }
+ this._container.title = String.load(titleStringId);
+ if (subTitleStringId)
+ this.subTitle = String.load(subTitleStringId);
+ else
+ this.subTitle = String.empty;
+ var showBulkMatchLink = matchTracks && this._isCloudMatch && !this._cloudCollectionService.isCloudMatchOptedIn && !this._cloudCollectionService.isCloudMatchOptedOut;
+ this._showElement(this._container._searchAlbumsLink, selectAlbum && this._albumsLoadingControl && !this._albumsLoadingControl.isBusy);
+ this._showElement(this._container._bulkMatchLink, showBulkMatchLink);
+ this._showElement(this._container._backButton, this._pageBackStack.length > 0);
+ if (!this._albumList.selection || this._albumList.selection._selected._itemsCount <= 0) {
+ this.tracks = this._originalTracks;
+ this._trackColumnHeader.textContent = String.load(String.id.IDS_FAI_SONG_COLUMN_TITLE)
+ }
+ else {
+ this._showElement(this._noCloudMatchText, this.tracks);
+ this._trackColumnHeader.textContent = String.load(String.id.IDS_FAI_MATCH_COLUMN_TITLE)
+ }
+ }
+ this._finishButton.isEnabled = (this._tracksMatch && this._selectedAlbum) || matchTracks;
+ this._nextButton.isAvailable = this.tracks && this.tracks.length && !this._tracksMatch && this._selectedAlbum && (selectAlbum || searchAlbums);
+ this._finishButton.isAvailable = !this._nextButton.isAvailable;
+ showSelectAlbumsPage = selectAlbum || searchAlbums;
+ if (showSelectAlbumsPage)
+ this._albumList.dataSource = this._albums;
+ else
+ this._albumList.dataSource = null;
+ this._showElement(this._matchTracksPage, matchTracks);
+ this._showElement(this._selectAlbumsPages, showSelectAlbumsPage);
+ if (selectAlbum || searchAlbums) {
+ this._keywordsEdit.value = this._keywords;
+ this._showElement(this._searchIcon, searchAlbums);
+ this._showElement(this._keywordsEdit, searchAlbums);
+ if (searchAlbums) {
+ MS.Entertainment.Utilities.forceFullLayout();
+ WinJS.Utilities.addClass(this._albumList.domElement, "searchAlbums")
+ }
+ else
+ WinJS.Utilities.removeClass(this._albumList.domElement, "searchAlbums");
+ this._unmatchedTracksList.dataSource = null;
+ this._matchedTrackList.dataSource = null;
+ this._showElement(this._noCloudMatchText, this._selectedAlbum && this.tracks && this.tracks.length === 0)
+ }
+ else if (matchTracks) {
+ this._showElement(this._noAlbumsLabel, false);
+ this._showElement(this._matchedTrackList, this._matchedTracks && this._matchedTracks.length);
+ this._showElement(this._matchedTrackHeader, (this._matchedTracks && this._matchedTracks.length));
+ this._unmatchedTracksList.dataSource = this._unmatchedTracks;
+ this._matchedTrackList.dataSource = this._matchedTracks
+ }
+ if (this._setFocusOnPage) {
+ this._setFocusOnPage = false;
+ if (selectAlbum) {
+ this._albumList.focusFirstItemOnPageLoad = selectAlbum;
+ if (!(this._albums && this._albums.count > 0))
+ this._setFocusOnPage = true
+ }
+ else if (searchAlbums)
+ MS.Entertainment.UI.Framework.focusElement(this._keywordsEdit);
+ else if (matchTracks)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._unmatchedTracksList.domElement)
+ }
+ }, _showElement: function _showElement(element, show) {
+ if (!element)
+ return;
+ if (element.domElement)
+ element = element.domElement;
+ if (show)
+ WinJS.Utilities.removeClass(element, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(element, "removeFromDisplay")
+ }, _onFinish: function _onFinish(event, pageContentDataObject) {
+ this._sendTelemetryPageAction(event.target, null, null, pageContentDataObject);
+ var albumMetadata = new Microsoft.Entertainment.Platform.AlbumMetadata;
+ var selectedAlbum = this._selectedAlbum;
+ albumMetadata.editedFields = Microsoft.Entertainment.Platform.FieldMask.empty_BIT_MASK;
+ if (selectedAlbum.name) {
+ albumMetadata.title = selectedAlbum.name;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.title_BIT_MASK
+ }
+ if (selectedAlbum.artistName) {
+ albumMetadata.artist = selectedAlbum.artistName;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.artist_BIT_MASK
+ }
+ if (selectedAlbum.primaryGenreName) {
+ albumMetadata.genre = selectedAlbum.primaryGenreName;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.genre_BIT_MASK
+ }
+ if (selectedAlbum.releaseDate) {
+ albumMetadata.releaseDate = MS.Entertainment.Formatters.formatDatabaseDataFromReleaseDate(selectedAlbum.releaseDate);
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.release_DATE_BIT_MASK
+ }
+ if (selectedAlbum.imageUri) {
+ albumMetadata.imageUrl = selectedAlbum.imageUri;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.image_URL_BIT_MASK
+ }
+ if (selectedAlbum.trackCount) {
+ albumMetadata.trackCount = selectedAlbum.trackCount;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.track_COUNT_BIT_MASK
+ }
+ if (selectedAlbum.hasSmartDJ !== undefined)
+ if (selectedAlbum.hasSmartDJ)
+ albumMetadata.canSmartDJ = Microsoft.Entertainment.Platform.SmartDJState.canSmartDJ;
+ else
+ albumMetadata.canSmartDJ = Microsoft.Entertainment.Platform.SmartDJState.cannotSmartDJ;
+ else
+ albumMetadata.canSmartDJ = Microsoft.Entertainment.Platform.SmartDJState.unknown;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.can_SMARTDJ_BIT_MASK;
+ if (selectedAlbum.hasSmartVJ !== undefined)
+ if (selectedAlbum.hasSmartVJ)
+ albumMetadata.canSmartVJ = Microsoft.Entertainment.Platform.SmartVJState.canSmartVJ;
+ else
+ albumMetadata.canSmartVJ = Microsoft.Entertainment.Platform.SmartVJState.cannotSmartVJ;
+ else
+ albumMetadata.canSmartVJ = Microsoft.Entertainment.Platform.SmartVJState.unknown;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.can_SMARTVJ_BIT_MASK;
+ if (selectedAlbum.label) {
+ albumMetadata.label = selectedAlbum.label;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.lable_BIT_MASK
+ }
+ if (MS.Entertainment.Utilities.isValidServiceId(selectedAlbum.canonicalId)) {
+ albumMetadata.albumBingId = selectedAlbum.canonicalId;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.album_BINGID_BIT_MASK
+ }
+ else
+ albumMetadata.albumBingId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (MS.Entertainment.Utilities.isValidServiceId(selectedAlbum.zuneId)) {
+ albumMetadata.albumMediaId = selectedAlbum.zuneId;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.album_MEDIAID_BIT_MASK
+ }
+ else
+ albumMetadata.albumMediaId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (selectedAlbum.artist && MS.Entertainment.Utilities.isValidServiceId(selectedAlbum.artist.canonicalId)) {
+ albumMetadata.artistBingId = selectedAlbum.artist.canonicalId;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.artist_BINGID_BIT_MASK
+ }
+ if (selectedAlbum.artist && MS.Entertainment.Utilities.isValidServiceId(selectedAlbum.artist.zuneId)) {
+ albumMetadata.artistMediaId = selectedAlbum.artist.zuneId;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.artist_MEDIAID_BIT_MASK
+ }
+ var i;
+ var tracks = [];
+ if (this._matchedTracks)
+ for (i = 0; i < this._matchedTracks.length; i++) {
+ var matchedTrack = this._matchedTracks[i];
+ if (MS.Entertainment.Utilities.isValidLibraryId(matchedTrack.libraryId)) {
+ var trackMetadata = new Microsoft.Entertainment.Platform.TrackMetadata;
+ trackMetadata.requestId = matchedTrack.libraryId;
+ this._populateTrackMetadata(trackMetadata, matchedTrack, selectedAlbum);
+ tracks.push(trackMetadata)
+ }
+ }
+ var matchTracksSelected = false;
+ if (this._unmatchedTracks)
+ for (i = 0; i < this._unmatchedTracks.length; i++) {
+ var unmatchedTrack = this._unmatchedTracks[i];
+ if (unmatchedTrack.selectedTrack && MS.Entertainment.Utilities.isValidLibraryId(unmatchedTrack.originalTrack.libraryId)) {
+ var trackMetadata = new Microsoft.Entertainment.Platform.TrackMetadata;
+ trackMetadata.requestId = unmatchedTrack.originalTrack.libraryId;
+ this._populateTrackMetadata(trackMetadata, unmatchedTrack.selectedTrack, selectedAlbum);
+ tracks.push(trackMetadata);
+ matchTracksSelected = true
+ }
+ }
+ if (tracks.length) {
+ albumMetadata.trackMetadata = tracks;
+ albumMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.tracks_BIT_MASK
+ }
+ this._sendTelemetryEvent("FindAlbumInfo_Finish");
+ var telemetryParameterArray = [];
+ if (this._lastXCorrelationId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.XCorrelationId, parameterValue: this._lastXCorrelationId
+ });
+ if (selectedAlbum.hasZuneId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZuneId, parameterValue: selectedAlbum.zuneId
+ });
+ switch (this._matchSource) {
+ case MS.Entertainment.Music.FindAlbumInfo.MatchSource.wmis:
+ this._sendTelemetryEvent("FindAlbumInfo_updateFromWMIS", telemetryParameterArray);
+ break;
+ case MS.Entertainment.Music.FindAlbumInfo.MatchSource.eds:
+ this._sendTelemetryEvent("FindAlbumInfo_updateFromEDS", telemetryParameterArray);
+ break;
+ case MS.Entertainment.Music.FindAlbumInfo.MatchSource.musicMatch:
+ this._sendTelemetryEvent("FindAlbumInfo_updateFromMusicMatch", telemetryParameterArray);
+ break
+ }
+ if (this._page === MS.Entertainment.Music.FindAlbumInfo.Page.selectAlbum)
+ this._sendTelemetryEvent("FindAlbumInfo_FinishFromFirstPage");
+ if (matchTracksSelected)
+ this._sendTelemetryEvent("FindAlbumInfo_MatchTracksSelected");
+ var albumId = this._originalAlbum.libraryId;
+ var requestType = Microsoft.Entertainment.Platform.RequestType.wmisalbumIDRequest;
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ mediaStore.albumProvider.updateAlbumMetadataAsync(albumMetadata, requestType, albumId).done(function onUpdateAlbumMetadataCompete(result) {
+ if (this._isCloudMatch || (this._cloudCollectionService.isCloudMatchOptedIn && selectedAlbum.hasZuneId))
+ mediaStore.mediaProvider.addMediaToCloudAsync(Microsoft.Entertainment.Queries.ObjectType.album, [result.libraryId]);
+ this.collectionUpdated = true;
+ this._container.hide()
+ }.bind(this), function onUpdateAlbumMetadataError(errorCode) {
+ if (errorCode && errorCode.number)
+ errorCode = errorCode.number;
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_MEDIA_ERROR_CAPTION), errorCode)
+ }.bind(this))
+ }, _populateTrackMetadata: function _populateTrackMetadata(trackMetadata, track, album) {
+ trackMetadata.editedFields = Microsoft.Entertainment.Platform.FieldMask.empty_BIT_MASK;
+ trackMetadata.discNumber = 1;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.disc_NUMBER_BIT_MASK;
+ if (track.name) {
+ trackMetadata.title = track.name;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.title_BIT_MASK
+ }
+ if (track.trackNumber) {
+ trackMetadata.trackNumber = track.trackNumber;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.track_NUMBER_BIT_MASK
+ }
+ if (track.releaseDate) {
+ trackMetadata.releaseDate = MS.Entertainment.Formatters.formatDatabaseDataFromReleaseDate(track.releaseDate);
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.release_DATE_BIT_MASK
+ }
+ else if (album.releaseDate) {
+ trackMetadata.releaseDate = MS.Entertainment.Formatters.formatDatabaseDataFromReleaseDate(album.releaseDate);
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.release_DATE_BIT_MASK
+ }
+ if (album.artistName) {
+ trackMetadata.artist = album.artistName;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.artist_BIT_MASK
+ }
+ if (album.primaryGenreName) {
+ trackMetadata.genre = album.primaryGenreName;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.genre_BIT_MASK
+ }
+ if (MS.Entertainment.Utilities.isValidServiceId(track.zuneId)) {
+ trackMetadata.trackMediaId = track.zuneId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.track_MEDIAID_BIT_MASK
+ }
+ else {
+ trackMetadata.trackMediaId = MS.Entertainment.Utilities.EMPTY_GUID;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.track_MEDIAID_BIT_MASK
+ }
+ if (MS.Entertainment.Utilities.isValidServiceId(track.actionableMediaId)) {
+ trackMetadata.actionableMediaId = track.actionableMediaId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.actionable_MEDIAID_BIT_MASK
+ }
+ else
+ trackMetadata.actionableMediaId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (MS.Entertainment.Utilities.isValidServiceId(album.zuneId)) {
+ trackMetadata.albumMediaId = album.zuneId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.album_MEDIAID_BIT_MASK
+ }
+ else
+ trackMetadata.albumMediaId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (album.artist && MS.Entertainment.Utilities.isValidServiceId(album.artist.zuneId)) {
+ trackMetadata.artistMediaId = album.artist.zuneId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.artist_MEDIAID_BIT_MASK
+ }
+ if (MS.Entertainment.Utilities.isValidServiceId(track.canonicalId)) {
+ trackMetadata.trackBingId = track.canonicalId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.track_BINGID_BIT_MASK
+ }
+ else
+ trackMetadata.trackBingId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (MS.Entertainment.Utilities.isValidServiceId(album.canonicalId)) {
+ trackMetadata.albumBingId = album.canonicalId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.album_BINGID_BIT_MASK
+ }
+ else
+ trackMetadata.albumBingId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (album.artist && MS.Entertainment.Utilities.isValidServiceId(album.artist.canonicalId)) {
+ trackMetadata.artistBingId = album.artist.canonicalId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.artist_BINGID_BIT_MASK
+ }
+ if (album.uniqueFileId && track.uniqueFileId) {
+ var uniqueFileId = "{0};{1}".format(album.uniqueFileId, track.uniqueFileId);
+ trackMetadata.uniqueFileId = uniqueFileId;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.unique_FILEID_BIT_MASK
+ }
+ trackMetadata.unblockFromCloud = this._isCloudMatch;
+ trackMetadata.editedFields |= Microsoft.Entertainment.Platform.FieldMask.unblock_FROM_CLOUD_BIT_MASK
+ }, _sendTelemetryEvent: function _sendTelemetryEvent(event, telemetryParameterArray) {
+ if (Array.isArray(telemetryParameterArray) && telemetryParameterArray.length > 0)
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(event, telemetryParameterArray);
+ else
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(event)
+ }, _sendTelemetryPageAction: function _sendTelemetryPageAction(domElement, targetPage, media, pageContentDataObject) {
+ var targetPageData;
+ if (targetPage !== this._currentPage)
+ targetPageData = targetPage ? {
+ uri: "findAlbumInfo/" + targetPage, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popover
+ } : {
+ uri: MS.Entertainment.Utilities.getCurrentUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown
+ };
+ if (!pageContentDataObject)
+ pageContentDataObject = {
+ domElement: domElement, itemPropertyBag: media
+ };
+ MS.Entertainment.Utilities.Telemetry.logPageAction(pageContentDataObject, {
+ uri: "findAlbumInfo/" + this._currentPage, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popover
+ }, targetPageData)
+ }, _createTelemetryActionData: function _createTelemetryActionData(areaName, automationId, slot) {
+ return {
+ slot: slot, areaName: areaName, contentId: automationId, contentCatalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.App, contentSourceId: MS.Entertainment.Utilities.Telemetry.ContentSourceId.App, contentTypeId: MS.Entertainment.Utilities.Telemetry.ContentTypeId.App, contentName: automationId
+ }
+ }
+ }, {
+ tracks: null, subTitle: String.empty
+ }, {
+ Page: {
+ selectAlbum: "selectAlbum", searchAlbums: "searchAlbums", matchTracks: "matchTracks"
+ }, MatchMode: {
+ library: "library", cloud: "cloud"
+ }, MatchSource: {
+ eds: "eds", wmis: "wmis", musicMatch: "musicMatch"
+ }, _maxSearchTextLength: 100
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Music", {FindAlbumInfoLoadingControl: MS.Entertainment.UI.Framework.defineUserControl("Components/Music/FindAlbumInfo.html#loadingControlTemplate", null, {
+ initialize: function initialize() {
+ this.bind("isBusy", function isBusyChanged(isBusy) {
+ if (this._loadingProgress)
+ this._loadingProgress.isBusy = isBusy
+ }.bind(this));
+ this.bind("isOffline", function isOfflineChanged(isOffline) {
+ this._loadingOffline.visibility = isOffline;
+ if (isOffline)
+ this.isBusy = false
+ }.bind(this))
+ }, reset: function reset() {
+ this.isBusy = false;
+ this.isOffline = false
+ }
+ }, {
+ isBusy: false, isOffline: false
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Music", {FindAlbumInfoDialog: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Dialog", "Components/Music/FindAlbumInfo.html#dialogTemplate", null, {
+ backClickHandler: null, searchAlbumsClickHandler: null, bulkMatchClickHandler: null, onBackClick: function onBackClick(event) {
+ if (this.backClickHandler)
+ this.backClickHandler(event)
+ }, onSearchAlbumsClick: function onSearchAlbumsClick(event) {
+ if (this.searchAlbumsClickHandler)
+ this.searchAlbumsClickHandler(event)
+ }, onBulkMatchClick: function onBulkMatchClick(event) {
+ if (this.bulkMatchClickHandler)
+ this.bulkMatchClickHandler(event)
+ }
+ }, null, {
+ _dialog: null, canShow: function canShow() {
+ return !this._dialog
+ }, show: function show(album, mode) {
+ var options = {
+ width: "900px", height: "700px", cancelButtonIndex: 2, defaultButtonIndex: -1, title: String.load(String.id.IDS_FAI_CHOOSE_ALBUM_TITLE), userControl: "MS.Entertainment.Music.FindAlbumInfo", userControlOptions: {
+ _originalAlbum: album, _matchMode: mode
+ }, persistOnNavigate: false
+ };
+ var showPromise;
+ if (!this._dialog) {
+ this._dialog = new MS.Entertainment.Music.FindAlbumInfoDialog(document.createElement("div"), options);
+ showPromise = this._dialog.show().then(function onDialogCompleted(result) {
+ this._dialog = null;
+ return result
+ }.bind(this), function onDialogError(error) {
+ this._dialog = null;
+ return WinJS.Promise.wrapError(error)
+ }.bind(this))
+ }
+ return WinJS.Promise.as(showPromise)
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {FindAlbumInfoAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function findAlbumInfoAction() {
+ this.base()
+ }, {
+ executed: function executed(param) {
+ var mediaItems = MS.Entertainment.UI.Actions.extractMediaItemFromParam(param);
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ var options = mediaContext.options || {};
+ if (!mediaItems)
+ mediaItems = mediaContext.mediaItem;
+ MS.Entertainment.Data.List.getData(mediaItems, 0).then(function showFindAlbumInfoDialog(album) {
+ var mode = MS.Entertainment.Music.FindAlbumInfo.MatchMode.library;
+ var cloudCollectionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection);
+ if (cloudCollectionService.isEnabled && !cloudCollectionService.isV2Enabled && album.remoteTracksCount > 0) {
+ mode = MS.Entertainment.Music.FindAlbumInfo.MatchMode.cloud;
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ return MS.Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_ADD_TO_MY_MUSIC_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC), null, [MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.signUp, MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.cancel])
+ }
+ return MS.Entertainment.Music.FindAlbumInfoDialog.show(album, mode)
+ }.bind(this)).done(function findAlbumInfoDialogClosed(dialog) {
+ if (dialog && dialog.userControlInstance && dialog.userControlInstance.collectionUpdated && mediaContext)
+ mediaContext.dispatchEvent(MS.Entertainment.UI.AppBarActions.findAlbumInfo)
+ }, function findAlbumInfoDialogError(error) {
+ MS.Entertainment.ViewModels.fail("FindAlbumInfo Dialog Failure: " + (error && error.message))
+ })
+ }, canExecute: function canExecute(parameter) {
+ return MS.Entertainment.Music.FindAlbumInfoDialog.canShow()
+ }
+ })});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.findAlbumInfo, function() {
+ return new MS.Entertainment.ViewModels.FindAlbumInfoAction
+ })
+})()
+})();
+/* >>>>>>/components/music/localgrovelinfo.js:20414 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Music");
+ WinJS.Namespace.define("MS.Entertainment.Music", {localGrovelInfo: MS.Entertainment.UI.Framework.defineUserControl("Components/Music/LocalGrovelInfo.html#localGrovelInfoTemplate", function localGrovelInfo(element, options) {
+ this._cancelButton = WinJS.Binding.as({
+ title: String.load(String.id.IDS_CLOSE_BUTTON), isEnabled: true, isAvailable: true, execute: function onCancel() {
+ this._onCancel()
+ }.bind(this)
+ });
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace))
+ this.addMusicDialogBodyText = String.load(String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX);
+ else
+ this.addMusicDialogBodyText = String.load(String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY)
+ }, {
+ _cancelButton: null, _container: null, addMusicDialogBodyText: String.empty, initialize: function initialize(){}, setOverlay: function setOverlay(container) {
+ this._container = container;
+ container.buttons = [this._cancelButton];
+ this._updateState()
+ }, _onCancel: function _onCancel() {
+ this._sendTelemetryEvent("LocalGrovelInfo_Cancel");
+ this._container.hide()
+ }, _updateState: function _updateState() {
+ this.moreAboutLibrariesWebLink.domElement.href = MS.Entertainment.UI.FWLink.musicLibraries
+ }, _showElement: function _showElement(element, show) {
+ if (element.domElement)
+ element = element.domElement;
+ if (show)
+ WinJS.Utilities.removeClass(element, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(element, "removeFromDisplay")
+ }, _sendTelemetryEvent: function _sendTelemetryEvent(event) {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(event)
+ }
+ }, {}, {})});
+ WinJS.Namespace.define("MS.Entertainment.Music", {localGrovelInfoDialog: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Dialog", "Components/Music/LocalGrovelInfo.html#dialogTemplate", null, {}, null, {show: function show() {
+ var options = {
+ width: "900px", height: "500px", cancelButtonIndex: 0, defaultButtonIndex: 0, title: String.load(String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE), userControl: "MS.Entertainment.Music.localGrovelInfo", userControlOptions: {}, persistOnNavigate: false
+ };
+ var dialog = new MS.Entertainment.Music.localGrovelInfoDialog(document.createElement("div"), options);
+ return dialog.show()
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.Music", {ShowLocalGrovelInfoDialogAction: MS.Entertainment.deferredDerive(MS.Entertainment.UI.Actions.Action, null, {
+ automationId: MS.Entertainment.UI.AutomationIds.showLocalGrovelInfoDialog, executed: function executed(param) {
+ if (WinJS.Utilities.getMember("Windows.Storage.StorageLibrary"))
+ return MS.Entertainment.UI.Controls.ManageFoldersDialog.show();
+ else
+ return MS.Entertainment.Music.localGrovelInfoDialog.show()
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })});
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.showLocalGrovelInfoDialog, function getLocalGrovelInfoDialogAction() {
+ return new MS.Entertainment.Music.ShowLocalGrovelInfoDialogAction
+ })
+})()
+})();
+/* >>>>>>/controls/videoad.js:20474 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VideoAd: MS.Entertainment.UI.Framework.defineUserControl("/Controls/VideoAd.html#videoAdTemplate", function videoAdConstructor(element, options) {
+ this._eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ this._playText = String.load(String.id.IDS_PLAY_BUTTON_VIDEO);
+ this._pauseText = String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON);
+ this.adReasonClickUrl = MS.Entertainment.UI.FWLink.advertisementReason
+ }, {
+ adClickUrl: null, adReasonClickUrl: null, adVideoUrl: null, adClickCallback: null, adCompleted: false, adErrorOccurred: false, playbackStartedCallback: null, _mediaContext: null, _eventProvider: null, _container: null, _resumePlayOnThaw: false, _overlayTimer: null, _playbackCheckTimer: null, _uiSettings: new Windows.UI.ViewManagement.UISettings, _lastTimeDuration: null, _volumeService: null, _volumeControllerBindings: null, _signIn: null, _signedInUser: null, _signInBinding: null, _subscriptionBinding: null, _uiStateBinding: null, tagMuted: true, tagVolume: null, initialize: function initialize() {
+ this._updateState();
+ this.overlay.domElement.setAttribute("aria-label", String.load(String.id.IDS_MUSIC_STREAMING_AD_LABEL));
+ this._signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this._signInBinding = WinJS.Binding.bind(this._signIn, {isSignedIn: this._onUserStatusChanged.bind(this)});
+ this._subscriptionBinding = WinJS.Binding.bind(this._signedInUser, {isSubscription: this._onUserStatusChanged.bind(this)});
+ this._volumeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this._volumeControllerBindings = WinJS.Binding.bind(this._volumeService, {
+ volume: this._onVolumeValueStateChange.bind(this), mute: this._onVolumeValueStateChange.bind(this)
+ });
+ this._uiStateBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {isSnapped: this._onSnappedChanged.bind(this)});
+ this._playbackCheckTimer = WinJS.Promise.timeout(MS.Entertainment.UI.Controls.VideoAd._playbackCheckTimeoutMS).then(function _playbackCheckTimeout() {
+ if (!this.playing)
+ this.onPlaybackError()
+ }.bind(this));
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._mediaContext = appBarService.pushDefaultContext([]);
+ var appBarControl = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBarControl)
+ appBarControl.hide()
+ }, unload: function unload() {
+ if (this._playbackCheckTimer) {
+ this._playbackCheckTimer.cancel();
+ this._playbackCheckTimer = null
+ }
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ if (this.playbackStartedCallback)
+ this.playbackStartedCallback = null;
+ if (this._volumeControllerBindings) {
+ this._volumeControllerBindings.cancel();
+ this._volumeControllerBindings = null
+ }
+ if (this.video && this.video.src)
+ this.video.src = String.empty;
+ if (this._signInBinding) {
+ this._signInBinding.cancel();
+ this._signInBinding = null
+ }
+ if (this._subscriptionBinding) {
+ this._subscriptionBinding.cancel();
+ this._subscriptionBinding = null
+ }
+ if (this._uiStateBinding) {
+ this._uiStateBinding.cancel();
+ this._uiStateBinding = null
+ }
+ this._clearOverlayTimer();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ if (this._initialized) {
+ this._hideOverlay();
+ this._resumePlayOnThaw = !this.video.paused;
+ if (this._resumePlayOnThaw)
+ this.video.pause()
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._initialized) {
+ this._showOverlay();
+ if (this._resumePlayOnThaw)
+ this.video.play()
+ }
+ }, setOverlay: function setOverlay(container) {
+ WinJS.Utilities.addClass(container.domElement, "videoAdContainer");
+ this._container = container
+ }, onPointerDown: function onPointerDown() {
+ if (!this.overlay.visibility)
+ this._showOverlay();
+ else
+ this._hideOverlay()
+ }, onKeyDown: function onKeyDown(e) {
+ if (e.keyCode === WinJS.Utilities.Key.escape)
+ this._hideOverlay();
+ else
+ this._showOverlay()
+ }, onPointerMove: function onPointerMove(e) {
+ if (e.pointerType !== e.MSPOINTER_TYPE_TOUCH && e.pointerType !== "touch")
+ this._showOverlay()
+ }, onPlayPauseClick: function onPlayPauseClick(event) {
+ if (this.video.paused)
+ this.video.play();
+ else
+ this.video.pause();
+ this._updateState();
+ this._showOverlay();
+ event.cancelBubble = true
+ }, onPlaybackTimeUpdate: function onPlaybackTimeUpdate() {
+ this._updateState()
+ }, onPlaybackPlaying: function onPlaybackPlaying() {
+ if (!this.playing) {
+ this.playing = true;
+ if (this._playbackCheckTimer) {
+ this._playbackCheckTimer.cancel();
+ this._playbackCheckTimer = null
+ }
+ if (this.playbackStartedCallback) {
+ this.playbackStartedCallback();
+ this.playbackStartedCallback = null
+ }
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdStart);
+ this._eventProvider.traceVideo_Ad_Started(this.adVideoUrl, this.adClickUrl)
+ }
+ this._showOverlay()
+ }, onPlaybackEnded: function onPlaybackEnded() {
+ this.adCompleted = true;
+ this._container.hide();
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdComplete);
+ this._eventProvider.traceVideo_Ad_Completed(this.adVideoUrl, this.adClickUrl)
+ }, onPlaybackError: function onPlaybackError() {
+ this.adCompleted = true;
+ this.adErrorOccurred = true;
+ this._container.hide();
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdError);
+ this._eventProvider.traceVideo_Ad_Error(this.adVideoUrl, this.adClickUrl)
+ }, onCloseClick: function onCloseClick() {
+ this.adCompleted = false;
+ this._container.hide();
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdClosed);
+ this._eventProvider.traceVideo_Ad_Skipped(this.adVideoUrl, this.adClickUrl)
+ }, onClickLearnMore: function onClickLearnMore() {
+ if (this.adClickCallback) {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdClickThru);
+ this.adClickCallback()
+ }
+ }, onKeyDownLearnMore: function onKeyDownLearnMore(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onClickLearnMore()
+ }, onClickAdReason: function onClickAdReason() {
+ var adService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ adService.sendVideoAdReasonClickTelemetryInfo()
+ }, onClickUpSell: function onClickUpSell() {
+ this.video.pause();
+ this._updateState();
+ this._hideOverlay();
+ this._eventProvider.traceVideo_Ad_UpSell(this.adVideoUrl, this.adClickUrl);
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.musicPassUpsellVideoAdInvoked);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionSignup);
+ action.automationId = MS.Entertainment.UI.AutomationIds.videoAdSubscriptionSignup;
+ action.execute().done(function signUpComplete() {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser.isSubscription) {
+ this.adCompleted = true;
+ this._container.hide()
+ }
+ else {
+ this._showOverlay();
+ MS.Entertainment.UI.Framework.tryAndFocusElementInSubTreeWithTimer(this.upsellButton.domElement, 0)
+ }
+ }.bind(this), function signUpError(){})
+ }, _onUserStatusChanged: function _onUserStatusChanged() {
+ if (this._signIn.isSignedIn && this._signedInUser.isSubscription && this._initialized && !this._unloaded) {
+ this.adCompleted = true;
+ this._container.hide()
+ }
+ }, _onSnappedChanged: function _onSnappedChanged(newVal) {
+ if (newVal) {
+ this.video.pause();
+ MS.Entertainment.Framework.ScriptUtilities.waitForSnappedIfNeeded(true).done(function unsnappedCompleted() {
+ this.video.play()
+ }.bind(this), function unsnappedError(error) {
+ MS.Entertainment.UI.Controls.assert(WinJS.Promise.isCanceledError(error), "VideoAd::_onSnappedChanged: Failed to wait to snapped. Error:" + error + ": " + error.message)
+ })
+ }
+ }, _updateState: function _updateState() {
+ if (this.video.duration > 0) {
+ var secondsRemaining = Math.max(1, Math.ceil(this.video.duration - this.video.currentTime));
+ if (this._lastTimeDuration !== secondsRemaining) {
+ this.timeRemaining = String.load(String.id.IDS_VIDEO_AD_PROGRESS).format(secondsRemaining);
+ this.timeLabel.setAttribute("aria-label", this.timeRemaining);
+ this._lastTimeDuration = secondsRemaining
+ }
+ }
+ this.paused = this.video.paused;
+ this.playPauseButton.text = this.paused ? this._playText : this._pauseText
+ }, _clearOverlayTimer: function _clearOverlayTimer() {
+ if (this._overlayTimer) {
+ window.clearTimeout(this._overlayTimer);
+ this._overlayTimer = null
+ }
+ }, _hideOverlay: function _hideOverlay() {
+ this.overlay.visibility = false;
+ this._clearOverlayTimer()
+ }, _showOverlay: function _showOverlay() {
+ this.overlay.visibility = true;
+ this._clearOverlayTimer();
+ this._overlayTimer = window.setTimeout(function() {
+ if (!this._unloaded) {
+ this.overlay.visibility = false;
+ this._overlayTimer = null
+ }
+ }.bind(this), this._uiSettings.messageDuration * 1000)
+ }, _onVolumeValueStateChange: function _onVolumeValueStateChange() {
+ this.video.muted = this._volumeService.mute;
+ this.video.volume = this._volumeService.volume
+ }
+ }, {
+ timeRemaining: null, playing: false, paused: false
+ }, {
+ showVideoAd: function showVideoAd(adVideoUrl, adClickUrl, adClickCallback, playbackStartedCallback) {
+ if (!adVideoUrl)
+ throw"showVideoAd: adUrl parameter is mandatory";
+ var volumeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ var videoAdOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.VideoAd", {
+ adVideoUrl: adVideoUrl, adClickUrl: adClickUrl, adClickCallback: adClickCallback, playbackStartedCallback: playbackStartedCallback, tagMuted: volumeService.mute, tagVolume: volumeService.volume
+ }, {
+ left: "0px", top: "0px", right: "0px", bottom: "0px"
+ });
+ return videoAdOverlay.show()
+ }, _playbackCheckTimeoutMS: 10000
+ })})
+})()
+})();
+/* >>>>>>/components/music/addtoaction.js:20704 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {AddTo: MS.Entertainment.deferredDerive(MS.Entertainment.UI.Actions.Action, function addTo() {
+ this.base();
+ this.maxFlyoutItems = MS.Entertainment.Utilities.isApp2 ? 6 : -1;
+ Object.defineProperty(this, "referenceContainer", {
+ get: this._getReferenceContainer, set: this._setReferenceContainer
+ })
+ }, {
+ deferredSubActions: null, hasSubActions: true, subMenuIds: null, maxFlyoutItems: 0, _executedPromise: null, _populateSubMenuPromise: null, _referenceContainer: null, _lastPlaylistRevisionNum: -1, _getReferenceContainer: function _getReferenceContainer() {
+ return this._referenceContainer
+ }, _setReferenceContainer: function _setReferenceContainer(value) {
+ if (this._referenceContainer !== value) {
+ this._referenceContainer = value;
+ this._updateReferenceContainer()
+ }
+ }, executed: function executed(param, referenceElement) {
+ if (this._executedPromise)
+ return WinJS.Promise.unwrap(this._executedPromise);
+ var mediaItem = this.parameter.mediaItem;
+ if (!mediaItem) {
+ var appToolbarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ mediaItem = appToolbarService.currentMediaContext.mediaItem
+ }
+ if (referenceElement)
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: referenceElement}, {
+ uri: MS.Entertainment.Utilities.getCurrentUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ if (this._hasPlaylistQueryRefreshed()) {
+ var populateSubMenuPromise = WinJS.Binding.unwrap(this._populateSubMenuPromise);
+ if (populateSubMenuPromise) {
+ populateSubMenuPromise.cancel();
+ populateSubMenuPromise = null
+ }
+ this._populateSubMenuPromise = this.populateSubMenu(this.subMenuIds)
+ }
+ MS.Entertainment.UI.Actions.assert(this._populateSubMenuPromise, "execute called before subActions were set");
+ var populateSubMenuPromise = WinJS.Binding.unwrap(this._populateSubMenuPromise).then(function updateList() {
+ if (this.deferredSubActions) {
+ this.subActions = this.deferredSubActions;
+ this.deferredSubActions = null
+ }
+ }.bind(this));
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._executedPromise = populateSubMenuPromise.then(function populated() {
+ if (this.subActions.length === 0) {
+ var closeAction = MS.Entertainment.ViewModels.SmartAppbarActions.createCloseCommandingPopoverAction();
+ this.subActions.push(closeAction)
+ }
+ for (var i = 0; i < this.subActions.length; i++) {
+ if (!this.subActions[i].skipOnCompletedHandler)
+ this.subActions[i].action.onComplete = MS.Entertainment.UI.Actions.AddTo.onCompleteHandler;
+ if (this.parameter.completeAction)
+ this.subActions[i].action.parameter.completeAction = this.parameter.completeAction
+ }
+ var mediaItemTitle = mediaItem.primaryText || mediaItem.title || mediaItem.name;
+ var mediaItemSubTitle = String.empty;
+ if (this.subActions[0].action.automationId === MS.Entertainment.UI.AutomationIds.appBarCloseCommandingPopover)
+ mediaItemSubTitle = String.load(String.id.IDS_MUSIC2_PANEL_ADD_ERROR);
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(mediaItem))
+ mediaItemSubTitle = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_ADD_SONG_TO_LIST_TITLE_PLURAL, 1);
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicAlbum(mediaItem))
+ mediaItemSubTitle = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_ADD_ALBUM_TO_LIST_TITLE_PLURAL, 1);
+ else
+ mediaItemSubTitle = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_ADD_SONG_TO_LIST_TITLE_PLURAL, 2);
+ var contextualData = {
+ title: mediaItemTitle, subTitle: mediaItemSubTitle, commands: this.subActions
+ };
+ return MS.Entertainment.UI.Controls.CommandingPopOver.showContextualCommands(contextualData)
+ }.bind(this), function onError(error) {
+ MS.Entertainment.UI.Actions.fail("populateSubMenuItemsPromise failed: " + error && error.message)
+ });
+ else {
+ for (var i = 0; this.subActions && i < this.subActions.length; i++)
+ if (this.subActions[i])
+ this.subActions[i].action.onExecuting = MS.Entertainment.UI.Actions.AddTo.onExecutingHandler;
+ this._executedPromise = populateSubMenuPromise
+ }
+ return WinJS.Binding.unwrap(this._executedPromise).then(function onAddToCompleted() {
+ this._executedPromise = null
+ }.bind(this))
+ }, canExecute: function canExecute(param) {
+ return true
+ }, setSubActions: function setSubActions(subMenuIds) {
+ var populateSubMenuPromise = WinJS.Binding.unwrap(this._populateSubMenuPromise);
+ if (populateSubMenuPromise) {
+ populateSubMenuPromise.cancel();
+ populateSubMenuPromise = null;
+ this._populateSubMenuPromise = null
+ }
+ this.subMenuIds = subMenuIds;
+ this._populateSubMenuPromise = this.populateSubMenu(subMenuIds)
+ }, populateSubMenu: function populateSubMenu(subMenuIds) {
+ var mediaItems = this.parameter.mediaItem;
+ var param = this.parameter;
+ if (!mediaItems) {
+ var appToolbarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ mediaItems = appToolbarService.currentMediaContext.mediaItem
+ }
+ var initializeMediaItemsPromise = WinJS.Promise.as();
+ if (MS.Entertainment.Data.MainQuery.isQuery(mediaItems))
+ initializeMediaItemsPromise = mediaItems.getItems().then(function gotItems(items) {
+ mediaItems = items
+ }, function queryFailed(error) {
+ MS.Entertainment.UI.assert(WinJS.Promise.isCanceledError(error), "Media query failed: " + (error && error.message));
+ mediaItems = null
+ });
+ return initializeMediaItemsPromise.then(MS.Entertainment.UI.Actions.AddTo.getRecentPlaylists).then(function gotRecentPlaylists() {
+ return mediaItems ? MS.Entertainment.Data.List.listToArray(mediaItems) : WinJS.Promise.as([])
+ }).then(function populateSubMenu(mediaItemArray) {
+ var subItems = [];
+ var actionsToAdd = {};
+ var playlistLibraryId = -1;
+ var addOtherPlaylistAction = false;
+ var recentPlaylists;
+ var isPopoverOpen;
+ var addSeperators;
+ this._lastPlaylistRevisionNum = -1;
+ if (mediaItemArray.length > 0 && mediaItemArray[0])
+ if (mediaItemArray[0].mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist)
+ playlistLibraryId = mediaItemArray[0].libraryId;
+ else if (mediaItemArray[0].mediaType === Microsoft.Entertainment.Queries.ObjectType.track && mediaItemArray[0].playlistItemId >= 0)
+ playlistLibraryId = mediaItemArray[0].playlistId;
+ addSeperators = MS.Entertainment.Utilities.isMusicApp1;
+ subMenuIds.forEach(function addId(id) {
+ MS.Entertainment.UI.assert(id, "Missing action Id");
+ actionsToAdd[id] = true
+ });
+ if (actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToCloud])
+ subItems.push(MS.Entertainment.UI.Actions.AddTo.createAddToCloud(mediaItems));
+ if (actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToMyMusic])
+ subItems.push(MS.Entertainment.UI.Actions.AddTo.createAddToMyMusicAction(mediaItems));
+ if (subMenuIds.length > 1 && subItems.length > 0)
+ if (subItems.length > 0 && addSeperators)
+ subItems.push(MS.Entertainment.UI.Controls.ActionList.getSeparatorAction());
+ if (actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying]) {
+ MS.Entertainment.UI.assert(!actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addLocalArtistToNowPlaying], "Conflicting action added to subMenu");
+ MS.Entertainment.UI.assert(!actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addMarketplaceArtistToNowPlaying], "Conflicting action added to subMenu");
+ subItems.push(MS.Entertainment.UI.Actions.AddTo.createAddToNowPlayingAction(mediaItems))
+ }
+ if (actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addLocalArtistToNowPlaying]) {
+ MS.Entertainment.UI.assert(!actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying], "Conflicting action added to subMenu");
+ MS.Entertainment.UI.assert(!actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addMarketplaceArtistToNowPlaying], "Conflicting action added to subMenu");
+ subItems.push(MS.Entertainment.UI.Actions.AddTo.createAddLocalArtistToNowPlayingAction(mediaItems))
+ }
+ if (actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addMarketplaceArtistToNowPlaying]) {
+ MS.Entertainment.UI.assert(!actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying], "Conflicting action added to subMenu");
+ MS.Entertainment.UI.assert(!actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addLocalArtistToNowPlaying], "Conflicting action added to subMenu");
+ var addMarketplaceArtistToNowPlayingAction = MS.Entertainment.UI.Actions.AddTo.createAddMarketplaceArtistToNowPlayingAction(mediaItems);
+ addMarketplaceArtistToNowPlayingAction.action.parameter.shouldUseTopSongsForArtistAddTo = param.shouldUseTopSongsForArtistAddTo;
+ subItems.push(addMarketplaceArtistToNowPlayingAction)
+ }
+ if (actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToPlaylist] || actionsToAdd[MS.Entertainment.UI.Actions.AddTo.subMenuIds.addTrackToPlaylist]) {
+ var createNewPlaylist = MS.Entertainment.UI.Actions.Playlists.getCreatePlaylistFlyoutAction(mediaItems, function disableCommandingPopover() {
+ MS.Entertainment.UI.Actions.AddTo.onCompleteHandler()
+ });
+ createNewPlaylist.action.parameter.shouldUseTopSongsForArtistAddTo = param.shouldUseTopSongsForArtistAddTo;
+ createNewPlaylist.skipOnCompletedHandler = true;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ createNewPlaylist.action.title = String.load(String.id.IDS_MUSIC2_ADD_TO_NEW_PLAYLIST_BUTTON_VUI_GUI);
+ createNewPlaylist.action.voicePhraseStringId = String.id.IDS_MUSIC2_ADD_TO_NEW_PLAYLIST_BUTTON_VUI_ALM;
+ createNewPlaylist.action.voicePhoneticPhraseStringId = String.id.IDS_MUSIC2_ADD_TO_NEW_PLAYLIST_BUTTON_VUI_PRON;
+ createNewPlaylist.action.icon = WinJS.UI.AppBarIcon.add
+ }
+ subItems.push(createNewPlaylist);
+ recentPlaylists = MS.Entertainment.UI.Actions.AddTo.recentPlaylists || [];
+ isPopoverOpen = MS.Entertainment.UI.Controls.PopOver.isPopoverOpen || MS.Entertainment.UI.Controls.NavigationPopover.isPopoverOpen;
+ this._lastPlaylistRevisionNum = MS.Entertainment.UI.Actions.AddTo.playlistQueryRevisionNum;
+ for (var i = 0; i < recentPlaylists.length; i++) {
+ var playlist = recentPlaylists[i];
+ if (!isPopoverOpen || playlist.libraryId !== playlistLibraryId) {
+ var addToPlaylist = MS.Entertainment.UI.Actions.Playlists.getAddToPlaylistMenuAction(playlist, playlist.name, null, mediaItems);
+ addToPlaylist.action.parameter.shouldUseTopSongsForArtistAddTo = param.shouldUseTopSongsForArtistAddTo;
+ subItems.push(addToPlaylist)
+ }
+ }
+ if (MS.Entertainment.UI.Actions.AddTo.recentPlaylistsGreaterThanMax)
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ addOtherPlaylistAction = true;
+ else {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ addOtherPlaylistAction = !uiStateService.isSnapped
+ }
+ if (this.maxFlyoutItems > 0) {
+ var startValue = this.maxFlyoutItems;
+ var itemsToRemove;
+ if (addOtherPlaylistAction)
+ startValue--;
+ itemsToRemove = subItems.length - startValue;
+ subItems.splice(startValue, itemsToRemove)
+ }
+ if (addOtherPlaylistAction) {
+ var anotherPlaylistAction = MS.Entertainment.UI.Actions.AddTo.createAnotherPlaylistAction(mediaItems);
+ anotherPlaylistAction.action.parameter = {
+ mediaItem: mediaItems, shouldUseTopSongsForArtistAddTo: param.shouldUseTopSongsForArtistAddTo
+ };
+ subItems.push(anotherPlaylistAction)
+ }
+ }
+ this.deferredSubActions = subItems;
+ this._updateReferenceContainer()
+ }.bind(this))
+ }, _hasPlaylistQueryRefreshed: function _hasPlaylistQueryRefreshed() {
+ return (this._lastPlaylistRevisionNum > 0 && this._lastPlaylistRevisionNum !== MS.Entertainment.UI.Actions.AddTo.playlistQueryRevisionNum)
+ }, _updateReferenceContainer: function _updateReferenceContainer() {
+ if (this.subActions)
+ this.subActions.forEach(function(subItem) {
+ if (subItem && subItem.action)
+ subItem.action.referenceContainer = this.referenceContainer
+ }, this)
+ }
+ }, {
+ createAddToMyMusicAction: function createAddToMyMusicAction(mediaItems) {
+ var addToMyMusicAction = MS.Entertainment.ViewModels.SmartAppbarActions.createAddToMyMusicAppbarAction();
+ addToMyMusicAction.action.parameter = addToMyMusicAction.action.parameter || {};
+ addToMyMusicAction.action.parameter.mediaItem = mediaItems;
+ addToMyMusicAction.action.parameter.isFlyoutAction = true;
+ return addToMyMusicAction
+ }, createAddToNowPlayingAction: function createAddToNowPlayingAction(mediaItems) {
+ var addToNowPlayingAction = MS.Entertainment.ViewModels.SmartAppbarActions.createAddToNowPlayingAppbarAction();
+ addToNowPlayingAction.action.parameter = addToNowPlayingAction.action.parameter || {};
+ addToNowPlayingAction.action.parameter.mediaItem = mediaItems;
+ addToNowPlayingAction.action.parameter.isFlyoutAction = true;
+ return addToNowPlayingAction
+ }, createAddLocalArtistToNowPlayingAction: function createAddLocalArtistToNowPlayingAction(mediaItems) {
+ var addToNowPlayingAction = MS.Entertainment.ViewModels.SmartAppbarActions.createAddToNowPlayingAppbarAction(MS.Entertainment.UI.AppBarActions.addLocalArtistToNowPlaying);
+ addToNowPlayingAction.action.parameter = addToNowPlayingAction.action.parameter || {};
+ addToNowPlayingAction.action.parameter.mediaItem = mediaItems;
+ addToNowPlayingAction.action.parameter.isFlyoutAction = true;
+ return addToNowPlayingAction
+ }, createAddMarketplaceArtistToNowPlayingAction: function createAddMarketplaceArtistToNowPlayingAction(mediaItems) {
+ var addToNowPlayingAction = MS.Entertainment.ViewModels.SmartAppbarActions.createAddToNowPlayingAppbarAction(MS.Entertainment.UI.AppBarActions.addMarketplaceArtistToNowPlaying);
+ addToNowPlayingAction.action.parameter = addToNowPlayingAction.action.parameter || {};
+ addToNowPlayingAction.action.parameter.mediaItem = mediaItems;
+ addToNowPlayingAction.action.parameter.isFlyoutAction = true;
+ return addToNowPlayingAction
+ }, createAddToCloud: function createAddToCloud(mediaItems) {
+ var addToCloudAction = MS.Entertainment.ViewModels.SmartAppbarActions.createAddToCloudAppbarAction();
+ addToCloudAction.action.parameter = addToCloudAction.action.parameter || {};
+ addToCloudAction.action.parameter.mediaItem = mediaItems;
+ return addToCloudAction
+ }, createAnotherPlaylistAction: function createAnotherPlaylistAction(mediaItems) {
+ var pickPlaylistAction;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ pickPlaylistAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.pickPlaylist);
+ pickPlaylistAction.title = String.load(String.id.IDS_MUSIC_ADD_TO_LIST_PLAYLIST_ACTION)
+ }
+ else {
+ pickPlaylistAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.selectPlaylist);
+ pickPlaylistAction.action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.addToPlaylist);
+ pickPlaylistAction.galleryClass = "addToActionGallery";
+ pickPlaylistAction.action.callback = function navigateBack() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateBack()
+ };
+ pickPlaylistAction.action.canExecute = function alwaysEnabled() {
+ return true
+ };
+ pickPlaylistAction.title = String.load(String.id.IDS_MUSIC2_ADD_TO_ANOTHER_PLAYLIST_BUTTON_VUI_GUI);
+ pickPlaylistAction.voicePhraseStringId = String.id.IDS_MUSIC2_ADD_TO_ANOTHER_PLAYLIST_BUTTON_VUI_ALM;
+ pickPlaylistAction.voicePhoneticPhraseStringId = String.id.IDS_MUSIC2_ADD_TO_ANOTHER_PLAYLIST_BUTTON_VUI_PRON
+ }
+ pickPlaylistAction.automationId = MS.Entertainment.UI.AutomationIds.flyoutOtherPlaylist;
+ pickPlaylistAction.icon = MS.Entertainment.UI.Icon.addToPlaylist;
+ pickPlaylistAction.id = MS.Entertainment.UI.AppBarActions.addToOtherPlaylist;
+ pickPlaylistAction.parameter = {mediaItem: mediaItems};
+ return {action: pickPlaylistAction}
+ }, onExecutingHandler: function onExecutingHandler() {
+ var appBarControl = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBarControl)
+ appBarControl.hide();
+ return WinJS.Promise.timeout()
+ }, onCompleteHandler: function onCompleteHandler() {
+ if (MS.Entertainment.UI.Controls.CommandingPopOver) {
+ var addingLabel = String.load(String.id.IDS_MUSIC2_PANEL_ADD_ADDING);
+ MS.Entertainment.UI.Controls.CommandingPopOver.disableCurrentCommandingPopover(addingLabel)
+ }
+ }, unload: function unload() {
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylists = [];
+ if (MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise) {
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise.cancel();
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise = null
+ }
+ if (MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryResults)
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryResults = null
+ }, getRecentPlaylists: function getRecentPlaylists() {
+ if (MS.Entertainment.UI.Actions.AddTo.recentPlaylists)
+ return WinJS.Promise.wrap(MS.Entertainment.UI.Actions.AddTo.recentPlaylists);
+ if (MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise)
+ return MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise;
+ var recentPlaylistQuery = new MS.Entertainment.Data.Query.libraryPlaylists;
+ recentPlaylistQuery.isLive = true;
+ recentPlaylistQuery.sort = Microsoft.Entertainment.Queries.PlaylistsSortBy.dateEditedDescending;
+ recentPlaylistQuery.chunkSize = MS.Entertainment.UI.Actions.AddTo.maxRecentPlaylists * 2;
+ recentPlaylistQuery.chunked = false;
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise = recentPlaylistQuery.getItems().then(function getResults(items) {
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryResults = items;
+ var handlePlaylistListNotifications = MS.Entertainment.UI.Actions.AddTo._handleRecentPlaylistsListNotifications;
+ var handlePlaylistsChangedNotifications = MS.Entertainment.UI.Actions.AddTo._handleRecentPlaylistsDataChangeNotifications;
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryResults.setNotificationHandler(new MS.Entertainment.UI.Actions.Playlists.playlistDataNotificationHandler(handlePlaylistListNotifications, handlePlaylistsChangedNotifications));
+ return MS.Entertainment.UI.Actions.AddTo._refreshRecentPlaylistArray()
+ }, function onError(error) {
+ if (!error || error.message !== "Canceled")
+ MS.Entertainment.UI.fail("library playlist query failed: " + (error && error.message));
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise = null;
+ return []
+ });
+ return WinJS.Promise.as(MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise)
+ }, playlistQueryRevisionNum: 0, recentPlaylists: null, recentPlaylistQueryPromise: null, recentPlaylistQueryResults: null, recentPlaylistsGreaterThanMax: false, maxRecentPlaylists: 4, _handleRecentPlaylistsListNotifications: function _handleRecentPlaylistsListNotifications(indices) {
+ for (var i = 0; i < indices.length; i++)
+ if (indices[i] < MS.Entertainment.UI.Actions.AddTo.maxRecentPlaylists) {
+ WinJS.Promise.timeout(50).done(function delay() {
+ MS.Entertainment.UI.Actions.AddTo._refreshRecentPlaylistArray()
+ });
+ return
+ }
+ }, _handleRecentPlaylistsDataChangeNotifications: function _handleRecentPlaylistsDataChangeNotifications(changedItems) {
+ for (var i = 0; i < changedItems.length; i++)
+ for (var j = 0; j < MS.Entertainment.UI.Actions.AddTo.recentPlaylists.length; j++)
+ if (MS.Entertainment.UI.Actions.AddTo.recentPlaylists[j] && changedItems[i] && MS.Entertainment.UI.Actions.AddTo.recentPlaylists[j].libraryId === changedItems[i].data.libraryId && MS.Entertainment.UI.Actions.AddTo.recentPlaylists[j].name !== changedItems[i].data.name)
+ MS.Entertainment.UI.Actions.AddTo._refreshRecentPlaylistArray()
+ }, _refreshRecentPlaylistArray: function _refreshRecentPlaylistArray() {
+ if (!MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryResults)
+ return WinJS.Promise.wrap();
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistsGreaterThanMax = MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryResults.count > MS.Entertainment.UI.Actions.AddTo.maxRecentPlaylists;
+ return MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryResults.toArrayAll(0, MS.Entertainment.UI.Actions.AddTo.maxRecentPlaylists).then(function gotArray(playlistItems) {
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylists = playlistItems;
+ MS.Entertainment.UI.Actions.AddTo.playlistQueryRevisionNum++;
+ MS.Entertainment.UI.Actions.AddTo.recentPlaylistQueryPromise = null;
+ return MS.Entertainment.UI.Actions.AddTo.recentPlaylists
+ }, function onError(error) {
+ var message = error && error.message;
+ MS.Entertainment.UI.fail("toArray failed: " + message);
+ return []
+ })
+ }, subMenuIds: {
+ addToMyMusic: "addToMyMusic", addTrackToPlaylist: "addTrackToPlaylist", addToPlaylist: "addToPlaylist", addToNowPlaying: "addToNowPlaying", addLocalArtistToNowPlaying: "addLocalArtistToNowPlaying", addMarketplaceArtistToNowPlaying: "addMarketplaceArtistToNowPlaying", addToCloud: "addToCloud"
+ }
+ })});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.addTo, function() {
+ return new MS.Entertainment.UI.Actions.AddTo
+ })
+})()
+})();
+/* >>>>>>/viewmodels/music1/usagerightrestrictions.js:21055 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var UsageRightRestriction = (function() {
+ function UsageRightRestriction(name) {
+ this._name = name
+ }
+ Object.defineProperty(UsageRightRestriction.prototype, "name", {
+ get: function() {
+ return this._name
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(UsageRightRestriction.prototype, "title", {
+ get: function() {
+ return this.titleStringId ? String.load(this.titleStringId) : String.empty
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(UsageRightRestriction.prototype, "description", {
+ get: function() {
+ return this.descriptionStringId ? String.load(this.descriptionStringId) : String.empty
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(UsageRightRestriction.prototype, "actionIcon", {
+ get: function() {
+ return this._actionIcon
+ }, set: function(value) {
+ this._actionIcon = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(UsageRightRestriction.prototype, "actionId", {
+ get: function() {
+ return this._actionId
+ }, set: function(value) {
+ this._actionId = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(UsageRightRestriction.prototype, "actionOptions", {
+ get: function() {
+ return this._actionOptions || {}
+ }, set: function(value) {
+ this._actionOptions = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(UsageRightRestriction.prototype, "isUnavailable", {
+ get: function() {
+ return this._isUnavailable
+ }, set: function(value) {
+ this._isUnavailable = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(UsageRightRestriction.prototype, "isUnplayable", {
+ get: function() {
+ return this._isUnplayable
+ }, set: function(value) {
+ this._isUnplayable = value
+ }, enumerable: true, configurable: true
+ });
+ UsageRightRestriction.prototype.getActionOptions = function(mediaItem) {
+ var result = {parameter: {}};
+ WinJS.UI.setOptions(result, this.actionOptions);
+ if (this.actionParameterMediaItemPropertyPath)
+ result.parameter = Entertainment.Utilities.setFromPropertyPath(result.parameter, this.actionParameterMediaItemPropertyPath, mediaItem);
+ else if (this.actionParameterMediaItemPropertyPath === String.empty)
+ result.parameter = mediaItem;
+ return result
+ };
+ UsageRightRestriction.prototype.getLeastRestrictive = function(mediaItem, rights) {
+ return null
+ };
+ return UsageRightRestriction
+ })();
+ ViewModels.UsageRightRestriction = UsageRightRestriction;
+ var MediaUsageRightRestriction = (function(_super) {
+ __extends(MediaUsageRightRestriction, _super);
+ function MediaUsageRightRestriction(options) {
+ _super.call(this, options.name);
+ this.mediaState = options.mediaState;
+ this.rightsState = options.rightsState;
+ this.titleStringId = options.titleStringId;
+ this.descriptionStringId = options.descriptionStringId;
+ this.actionIcon = options.actionIcon || Entertainment.UI.Icon.inlineNotification;
+ this.actionId = options.actionId;
+ this.actionOptions = options.actionOptions;
+ this.actionParameterMediaItemPropertyPath = options.actionParameterMediaItemPropertyPath;
+ this.isUnavailable = options.isUnavailable;
+ this.isUnplayable = options.isUnplayable
+ }
+ Object.defineProperty(MediaUsageRightRestriction.prototype, "mediaState", {
+ get: function() {
+ return this._mediaState
+ }, set: function(value) {
+ this._mediaState = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MediaUsageRightRestriction.prototype, "rightsState", {
+ get: function() {
+ return this._rightsState
+ }, set: function(value) {
+ this._rightsState = value
+ }, enumerable: true, configurable: true
+ });
+ MediaUsageRightRestriction.prototype.getLeastRestrictive = function(mediaItem, rights) {
+ var mediaItemStateMet = (!!this.mediaState && !!mediaItem) || (!this.mediaState);
+ var rightsStateMet = (!!this.rightsState && !!rights) || (!this.rightsState);
+ var mediaState = this.mediaState || [];
+ if (!Array.isArray(mediaState))
+ mediaState = [mediaState];
+ var rightsState = this.rightsState || [];
+ if (!Array.isArray(rightsState))
+ rightsState = [rightsState];
+ var currentMediaStateMet = false;
+ for (var i = 0; i < mediaState.length && mediaItemStateMet && rightsStateMet && !currentMediaStateMet; i++) {
+ var currentMediaState = mediaState[i];
+ currentMediaStateMet = !!currentMediaState;
+ if (currentMediaStateMet)
+ for (var key in currentMediaState)
+ if (!!mediaItem[key] !== currentMediaState[key]) {
+ currentMediaStateMet = false;
+ break
+ }
+ }
+ mediaItemStateMet = mediaItemStateMet && (currentMediaStateMet || mediaState.length === 0);
+ var currentRightsMet = false;
+ for (var j = 0; j < rightsState.length && mediaItemStateMet && rightsStateMet && !currentRightsMet; j++) {
+ var currentRightsState = rightsState[j];
+ var currentRightsMet = !!currentRightsState;
+ if (currentRightsMet)
+ for (var key in currentRightsState)
+ if (!!rights[key] !== currentRightsState[key]) {
+ currentRightsMet = false;
+ break
+ }
+ }
+ rightsStateMet = rightsStateMet && (currentRightsMet || rightsState.length === 0);
+ return mediaItemStateMet && rightsStateMet ? this : null
+ };
+ return MediaUsageRightRestriction
+ })(UsageRightRestriction);
+ ViewModels.MediaUsageRightRestriction = MediaUsageRightRestriction;
+ var UsageRightRestrictionCollection = (function(_super) {
+ __extends(UsageRightRestrictionCollection, _super);
+ function UsageRightRestrictionCollection(name) {
+ _super.call(this, name);
+ this.clear()
+ }
+ UsageRightRestrictionCollection.prototype.addRightsCondition = function(condition) {
+ if (!condition) {
+ ViewModels.fail("Adding a null right condition");
+ return condition
+ }
+ if (!condition.name) {
+ ViewModels.fail("Adding a right condition with no name");
+ return condition
+ }
+ var name = condition.name;
+ if (!(name in this._rights)) {
+ this._rights[name] = condition;
+ this._rightsPriority.push(condition)
+ }
+ else
+ ViewModels.fail("Adding a right condition that already exists. Name: " + name);
+ return condition
+ };
+ UsageRightRestrictionCollection.prototype.getRightsCondition = function(name) {
+ return this._rights[name]
+ };
+ UsageRightRestrictionCollection.prototype.clear = function() {
+ this._rights = {};
+ this._rightsPriority = []
+ };
+ UsageRightRestrictionCollection.prototype.getLeastRestrictive = function(mediaItem, rights) {
+ var getLeastRestrictive = null;
+ this._rightsPriority.some(function(condition) {
+ getLeastRestrictive = condition.getLeastRestrictive(mediaItem, rights);
+ return !!getLeastRestrictive
+ });
+ return getLeastRestrictive
+ };
+ return UsageRightRestrictionCollection
+ })(UsageRightRestriction);
+ ViewModels.UsageRightRestrictionCollection = UsageRightRestrictionCollection
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/usagerightrestrictionsmusic.js:21256 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var FeatureEnablement = Microsoft.Entertainment.FeatureEnablement;
+ (function(AlbumUsageRightsRestriction) {
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["genric"] = 0] = "genric";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["notAvailableAll"] = 1] = "notAvailableAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["notAvailableMix"] = 2] = "notAvailableMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseAlbumAll"] = 3] = "purchaseAlbumAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseAlbumMix"] = 4] = "purchaseAlbumMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseOrPremiumAll"] = 5] = "purchaseOrPremiumAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseOrPremiumMix"] = 6] = "purchaseOrPremiumMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseAll"] = 7] = "purchaseAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseMix"] = 8] = "purchaseMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseTrackAll"] = 9] = "purchaseTrackAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["purchaseTrackMix"] = 10] = "purchaseTrackMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumAll"] = 11] = "premiumAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumMix"] = 12] = "premiumMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumStreamAll"] = 13] = "premiumStreamAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumStreamMix"] = 14] = "premiumStreamMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumStreamCollectionAll"] = 15] = "premiumStreamCollectionAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumStreamCollectionMix"] = 16] = "premiumStreamCollectionMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumDownloadAll"] = 17] = "premiumDownloadAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumDownloadMix"] = 18] = "premiumDownloadMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumDownloadCollectionAll"] = 19] = "premiumDownloadCollectionAll";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["premiumDownloadCollectionMix"] = 20] = "premiumDownloadCollectionMix";
+ AlbumUsageRightsRestriction[AlbumUsageRightsRestriction["takenDown"] = 21] = "takenDown"
+ })(ViewModels.AlbumUsageRightsRestriction || (ViewModels.AlbumUsageRightsRestriction = {}));
+ var AlbumUsageRightsRestriction = ViewModels.AlbumUsageRightsRestriction;
+ (function(TrackUsageRight) {
+ TrackUsageRight[TrackUsageRight["albumPurchaseOnly"] = 0] = "albumPurchaseOnly";
+ TrackUsageRight[TrackUsageRight["cantPlay"] = 1] = "cantPlay";
+ TrackUsageRight[TrackUsageRight["cantPlayForFree"] = 2] = "cantPlayForFree";
+ TrackUsageRight[TrackUsageRight["takenDown"] = 3] = "takenDown";
+ TrackUsageRight[TrackUsageRight["notAvailable"] = 4] = "notAvailable";
+ TrackUsageRight[TrackUsageRight["notAvailableInCollection"] = 5] = "notAvailableInCollection";
+ TrackUsageRight[TrackUsageRight["passOnly"] = 6] = "passOnly";
+ TrackUsageRight[TrackUsageRight["passOrPurchaseOnly"] = 7] = "passOrPurchaseOnly";
+ TrackUsageRight[TrackUsageRight["purchaseOnly"] = 8] = "purchaseOnly";
+ TrackUsageRight[TrackUsageRight["subscriptionDownloadOnly"] = 9] = "subscriptionDownloadOnly";
+ TrackUsageRight[TrackUsageRight["subscriptionStreamOnly"] = 10] = "subscriptionStreamOnly"
+ })(ViewModels.TrackUsageRight || (ViewModels.TrackUsageRight = {}));
+ var TrackUsageRight = ViewModels.TrackUsageRight;
+ (function(CloudRightsRestriction) {
+ CloudRightsRestriction[CloudRightsRestriction["catalogAlbumFreeStreamOnly"] = 0] = "catalogAlbumFreeStreamOnly";
+ CloudRightsRestriction[CloudRightsRestriction["catalogTrackFreeStreamOnly"] = 1] = "catalogTrackFreeStreamOnly";
+ CloudRightsRestriction[CloudRightsRestriction["catalogAlbumMusicPassOnly"] = 2] = "catalogAlbumMusicPassOnly";
+ CloudRightsRestriction[CloudRightsRestriction["catalogTrackMusicPassOnly"] = 3] = "catalogTrackMusicPassOnly";
+ CloudRightsRestriction[CloudRightsRestriction["purchaseOnly"] = 4] = "purchaseOnly"
+ })(ViewModels.CloudRightsRestriction || (ViewModels.CloudRightsRestriction = {}));
+ var CloudRightsRestriction = ViewModels.CloudRightsRestriction;
+ var MusicRestrictionCollection = (function(_super) {
+ __extends(MusicRestrictionCollection, _super);
+ function MusicRestrictionCollection() {
+ _super.call(this, String.empty)
+ }
+ Object.defineProperty(MusicRestrictionCollection.prototype, "featureSet", {
+ get: function() {
+ var currentFeatureSet;
+ var featureEnablementService = Entertainment.ServiceLocator.getService(Entertainment.Services.featureEnablement);
+ if (featureEnablementService.isEnabled(FeatureEnablement.FeatureItem.musicFreePlay))
+ currentFeatureSet = FeatureEnablement.FeatureItem.musicFreePlay;
+ else if (featureEnablementService.isEnabled(FeatureEnablement.FeatureItem.musicSubscription))
+ currentFeatureSet = FeatureEnablement.FeatureItem.musicSubscription;
+ else if (featureEnablementService.isEnabled(FeatureEnablement.FeatureItem.musicMarketplace))
+ currentFeatureSet = FeatureEnablement.FeatureItem.musicMarketplace;
+ return currentFeatureSet
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MusicRestrictionCollection.prototype, "isPremiumUser", {
+ get: function() {
+ var signedInUser = Entertainment.ServiceLocator.getService(Entertainment.Services.signedInUser);
+ return signedInUser.isSubscription
+ }, enumerable: true, configurable: true
+ });
+ MusicRestrictionCollection.prototype.getLeastRestrictive = function(mediaItem, rights) {
+ this.refreshUserRights();
+ return _super.prototype.getLeastRestrictive.call(this, mediaItem, rights)
+ };
+ MusicRestrictionCollection.prototype.refreshUserRights = function(forceRefresh) {
+ var featureSet = this.featureSet;
+ var isPremiumUser = this.isPremiumUser;
+ if (this._lastRegion !== featureSet || this._lastIsPremiumUser !== isPremiumUser) {
+ this._lastRegion = featureSet;
+ this._lastIsPremiumUser = isPremiumUser;
+ this.clear();
+ if (this._lastRegion === FeatureEnablement.FeatureItem.musicFreePlay && this._lastIsPremiumUser)
+ this._addPremiumUserRights();
+ else if (this._lastRegion === FeatureEnablement.FeatureItem.musicFreePlay && !this._lastIsPremiumUser)
+ this._addFreeUserRights();
+ else if (this._lastRegion === FeatureEnablement.FeatureItem.musicSubscription && this._lastIsPremiumUser)
+ this._addPremiumUserRights();
+ else if (this._lastRegion === FeatureEnablement.FeatureItem.musicSubscription && !this._lastIsPremiumUser)
+ this._addPurchaseUserRights();
+ else if (this._lastRegion === FeatureEnablement.FeatureItem.musicMarketplace)
+ this._addPurchaseOnlyUserRights()
+ }
+ };
+ MusicRestrictionCollection.prototype._addPurchaseOnlyUserRights = function(){};
+ MusicRestrictionCollection.prototype._addPurchaseUserRights = function(){};
+ MusicRestrictionCollection.prototype._addFreeUserRights = function(){};
+ MusicRestrictionCollection.prototype._addPremiumUserRights = function(){};
+ return MusicRestrictionCollection
+ })(ViewModels.UsageRightRestrictionCollection);
+ ViewModels.MusicRestrictionCollection = MusicRestrictionCollection;
+ var AlbumRestrictionCollection = (function(_super) {
+ __extends(AlbumRestrictionCollection, _super);
+ function AlbumRestrictionCollection() {
+ _super.apply(this, arguments)
+ }
+ AlbumRestrictionCollection.prototype._addPurchaseOnlyUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[3], rightsState: {
+ allAlbumPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[4], rightsState: {
+ allAlbumPurchaseOnly: false, albumPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[0], rightsState: {
+ allTrackPurchase: false, albumPurchaseOnly: true
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE, descriptionStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY
+ }))
+ };
+ AlbumRestrictionCollection.prototype._addPurchaseUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[3], rightsState: {
+ allAlbumPurchase: true, trackPurchase: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[4], rightsState: [{
+ albumPurchaseAndSubscriptionOnly: true, trackUnactionable: false
+ }, {
+ albumPurchaseOnly: true, trackUnactionable: false
+ }], mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[11], rightsState: {
+ allSubscriptionOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionWithSignIn, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[12], rightsState: {
+ allSubscriptionOnly: false, subscriptionOnly: true, albumPurchaseOnly: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, succestTitleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionWithSignIn, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[0], rightsState: [{
+ allTrackPurchase: false, albumPurchaseOnly: true
+ }, {
+ allTrackPurchase: false, subscriptionOnly: true
+ }], mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE, descriptionStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY
+ }));
+ this._insertCommonAlbumConditions(this)
+ };
+ AlbumRestrictionCollection.prototype._addFreeUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[3], rightsState: {
+ allAlbumPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[9], rightsState: {
+ allTrackPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[7], rightsState: {
+ allPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[4], rightsState: {
+ allAlbumPurchaseOnlyOrFreeStream: true, allAlbumPurchaseOnly: false, allFreeSteam: false, albumPurchaseOnly: true, trackPurchaseOnly: false, subscriptionOnly: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[10], rightsState: {
+ allTrackPurchaseOnlyOrFreeStream: true, allTrackPurchaseOnly: false, allFreeStream: false, trackPurchaseOnly: true, albumPurchaseOnly: false, subscriptionOnly: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[8], rightsState: {
+ allPurchaseOnlyOrFreeStream: true, allPurchaseOnly: false, allFreeStream: false, purchaseOnly: true, subscriptionOnly: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[5], rightsState: {
+ freeStream: false, allNonFreeStream: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionWithSignIn, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[6], rightsState: {
+ freeStream: true, allFreeStream: false, allNonFreeStreamOrFreeStream: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionWithSignIn, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[11], rightsState: {
+ freeStream: false, allSubscriptionOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionWithSignIn, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[12], rightsState: {
+ freeStream: true, allFreeStream: false, subscriptionOnly: true, purchaseOnly: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, succestTitleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionWithSignIn, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[0], rightsState: [{
+ allFreeStream: false, purchaseOnly: true
+ }, {
+ allFreeStream: false, subscriptionOnly: true
+ }], mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE, descriptionStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[21], mediaState: {
+ fromCollection: true, hasTakenedDown: true
+ }, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_TITLE
+ }));
+ this._insertCommonAlbumConditions(this)
+ };
+ AlbumRestrictionCollection.prototype._addPremiumUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[3], rightsState: {
+ allAlbumPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[9], rightsState: {
+ allTrackPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[7], rightsState: {
+ allPurchaseOnly: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[4], rightsState: {
+ allSubscription: false, allAlbumPurchaseOnly: false, albumPurchaseOnly: true, subscriptionLimited: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.albumPurchase, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[10], rightsState: {
+ allSubscription: false, allTrackPurchaseOnly: false, trackPurchaseOnly: true, subscriptionLimited: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[8], rightsState: {
+ allSubscription: false, allPurchaseOnly: false, purchaseOnly: true, subscriptionLimited: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[13], rightsState: {
+ allSubscriptionStream: true, subscriptionDownload: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[14], rightsState: {
+ allSubscriptionStream: true, allSubscriptionDownload: false, subscriptionDownload: true, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[15], mediaState: {
+ fromCollection: true, hasLocalTracks: false, hasSubscriptionTracks: true, canDownload: false
+ }, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_BANNER_NOTIFICATION_TITLE
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[17], rightsState: {
+ allSubscriptionDownload: true, subscriptionStream: false, trackUnactionable: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionDownload, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[18], rightsState: {
+ allSubscriptionDownload: false, allSubscriptionStream: false, subscriptionStream: true, trackUnactionable: false
+ }, mediaState: {fromCollection: true}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionDownload, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[19], mediaState: {
+ fromCollection: true, hasAllRemoteOnlyTracks: true, hasSubscriptionTracks: true, canSubscriptionStream: false
+ }, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionDownload, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[20], mediaState: {
+ fromCollection: true, hasRemoteOnlyTracks: true, hasSubscriptionTracks: true, canSubscriptionStream: false
+ }, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE, actionId: Entertainment.UI.Actions.ActionIdentifiers.subscriptionDownload, actionParameterMediaItemPropertyPath: String.empty, actionOptions: {title: String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY)}
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[0], rightsState: [{purchaseOnly: true}, {subscriptionStreamOnly: true}, {subscriptionDownloadOnly: true}], mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE, descriptionStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[21], mediaState: {
+ fromCollection: true, hasTakenedDown: true
+ }, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_TITLE
+ }));
+ this._insertCommonAlbumConditions(this)
+ };
+ AlbumRestrictionCollection.prototype._insertCommonAlbumConditions = function(rightsConditions) {
+ if (!rightsConditions)
+ return null;
+ rightsConditions.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[1], rightsState: {
+ freeStream: false, albumPurchase: false, subscriptionDownload: false, subscriptionStream: false, trackPurchase: false
+ }, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_BANNER_NOTIFICATION_TITLE
+ }));
+ rightsConditions.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: AlbumUsageRightsRestriction[2], rightsState: {trackUnactionable: true}, mediaState: {fromCollection: false}, titleStringId: String.id.IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_PARTIAL_BANNER_NOTIFICATION_TITLE
+ }));
+ return rightsConditions
+ };
+ return AlbumRestrictionCollection
+ })(MusicRestrictionCollection);
+ ViewModels.AlbumRestrictionCollection = AlbumRestrictionCollection;
+ var TrackRestrictionCollection = (function(_super) {
+ __extends(TrackRestrictionCollection, _super);
+ function TrackRestrictionCollection() {
+ _super.apply(this, arguments)
+ }
+ TrackRestrictionCollection.prototype._addFreeUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[3], mediaState: {
+ hasTakenDown: true, canPurchase: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseAlbum: false, canPlayLocally: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_TAKEDOWN_FLYOUT_BODY, isUnavailable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[8], mediaState: {
+ fromCollection: false, canPurchase: true, canFreeStream: false, canSubscriptionStream: false, canSubscriptionDownload: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PURCHASE_ONLY_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[6], mediaState: {
+ canPurchase: false, canFreeStream: false, canSubscriptionStream: true, roamingViaOneDrive: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PASS_ONLY_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[7], mediaState: {
+ fromCollection: false, canPurchase: true, canFreeStream: false, canSubscriptionStream: true, canSubscriptionDownload: true
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PASS_PURCHASE_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[0], mediaState: {
+ fromCollection: false, canPurchase: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseAlbum: true
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[9], mediaState: {
+ fromCollection: false, canPurchase: true, canFreeStream: false, canSubscriptionStream: false, canSubscriptionDownload: true
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PASS_PURCHASE_FLYOUT_BODY, isUnplayable: true
+ }));
+ this._insertCommonTrackConditions(this)
+ };
+ TrackRestrictionCollection.prototype._addPremiumUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[3], mediaState: {
+ hasTakenDown: true, canPurchase: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseAlbum: false, canPlayLocally: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_TAKEDOWN_FLYOUT_BODY, isUnavailable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[8], mediaState: {
+ fromCollection: false, canSubscriptionDownload: false, canPurchase: true, canSubscriptionStream: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PURCHASE_ONLY_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[0], mediaState: {
+ fromCollection: false, canSubscriptionDownload: false, canPurchase: false, canSubscriptionStream: false, canPurchaseAlbum: true
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[9], mediaState: {
+ canSubscriptionDownload: true, canSubscriptionStream: false, canPlayLocally: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_DOWNLOAD_ONLY_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[10], mediaState: {
+ fromCollection: false, canSubscriptionDownload: false, canSubscriptionStream: true
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_STREAMING_ONLY_FLYOUT_BODY
+ }));
+ this._insertCommonTrackConditions(this)
+ };
+ TrackRestrictionCollection.prototype._addPurchaseUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[3], mediaState: {
+ hasTakenDown: true, canPurchase: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseAlbum: false, canPlayLocally: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_TAKEDOWN_FLYOUT_BODY, isUnavailable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[0], mediaState: {
+ fromCollection: false, canPurchase: false, canFreeStream: false, canPurchaseAlbum: true
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[6], mediaState: {
+ fromCollection: false, canPurchase: false, canFreeStream: false, canSubscriptionStream: true, roamingViaOneDrive: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PASS_ONLY_FLYOUT_BODY, isUnplayable: true
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[2], mediaState: {
+ fromCollection: true, canPlayLocally: false, canFreeStream: false, canPurchaseStream: false, canStreamFromCloudStorage: false, roamingViaOneDrive: false, hasServiceId: true
+ }, descriptionStringId: String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER, isUnavailable: true
+ }));
+ this._insertCommonTrackConditions(this)
+ };
+ TrackRestrictionCollection.prototype._addPurchaseOnlyUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[0], mediaState: {
+ canPurchase: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseAlbum: true
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY, isUnplayable: true
+ }));
+ this._insertCommonTrackConditions(this)
+ };
+ TrackRestrictionCollection.prototype._insertCommonTrackConditions = function(rightsConditions) {
+ if (!rightsConditions)
+ return null;
+ rightsConditions.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[4], mediaState: {
+ fromCollection: false, canPurchase: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseAlbum: false, canPurchaseStream: false, canPurchaseDownload: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_UNAVAILABLE_FLYOUT_BODY, isUnavailable: true
+ }));
+ rightsConditions.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[5], mediaState: {
+ fromCollection: true, canPurchase: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseAlbum: false, canPlayLocally: false, isFromPlaylist: false, hasTakenDown: false, canPurchaseStream: false, canPurchaseDownload: false, canStreamFromCloudStorage: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_UNAVAILABLE_FLYOUT_BODY, isUnavailable: true
+ }));
+ rightsConditions.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: TrackUsageRight[1], mediaState: {
+ fromCollection: true, canPlayLocally: false, canFreeStream: false, canSubscriptionStream: false, canPurchaseStream: false, canPurchaseDownload: false, isFromPlaylist: true, canStreamFromCloudStorage: false, hasServiceId: false
+ }, descriptionStringId: String.id.IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_FLYOUT_BODY, isUnavailable: true
+ }));
+ return rightsConditions
+ };
+ return TrackRestrictionCollection
+ })(MusicRestrictionCollection);
+ ViewModels.TrackRestrictionCollection = TrackRestrictionCollection;
+ var CloudRestrictionCollection = (function(_super) {
+ __extends(CloudRestrictionCollection, _super);
+ function CloudRestrictionCollection() {
+ _super.apply(this, arguments)
+ }
+ Object.defineProperty(CloudRestrictionCollection.prototype, "featureSet", {
+ get: function() {
+ var currentFeatureSet;
+ var featureEnablementService = Entertainment.ServiceLocator.getService(Entertainment.Services.featureEnablement);
+ if (featureEnablementService.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled))
+ if (featureEnablementService.isEnabled(FeatureEnablement.FeatureItem.musicFreePlay))
+ currentFeatureSet = FeatureEnablement.FeatureItem.musicFreePlay;
+ else if (featureEnablementService.isEnabled(FeatureEnablement.FeatureItem.musicSubscription))
+ currentFeatureSet = FeatureEnablement.FeatureItem.musicSubscription;
+ return currentFeatureSet
+ }, enumerable: true, configurable: true
+ });
+ CloudRestrictionCollection.prototype._addFreeUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: CloudRightsRestriction[0], mediaState: {
+ fromCollection: true, hasRemoteOnlyTracks: true, inCollection: true, isAlbum: true
+ }, descriptionStringId: String.id.IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_FREE_FLYOUT_BODY, actionId: Entertainment.UI.Actions.ActionIdentifiers.mediaStatusSubscriptionSignupAction
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: CloudRightsRestriction[1], mediaState: {
+ canFreeStream: true, canPlayLocally: false, canStreamFromCloudStorage: false, fromCollection: true, isTrack: true
+ }, descriptionStringId: String.id.IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_BODY, actionId: Entertainment.UI.Actions.ActionIdentifiers.mediaStatusSubscriptionSignupAction
+ }));
+ this._insertCommonConditions()
+ };
+ CloudRestrictionCollection.prototype._addPremiumUserRights = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: CloudRightsRestriction[2], mediaState: {
+ fromCollection: true, inCollection: true, isAlbum: true, isCloudMatched: true
+ }, descriptionStringId: String.id.IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_PASS_FLYOUT_BODY
+ }));
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: CloudRightsRestriction[3], mediaState: {
+ canStreamFromCloudStorage: false, fromCollection: true, isCloudMatched: true, isTrack: true
+ }, descriptionStringId: String.id.IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PASS_FLYOUT_BODY
+ }));
+ this._insertCommonConditions()
+ };
+ CloudRestrictionCollection.prototype._insertCommonConditions = function() {
+ this.addRightsCondition(new ViewModels.MediaUsageRightRestriction({
+ name: CloudRightsRestriction[4], mediaState: {
+ canPurchaseStream: true, canStreamFromCloudStorage: false, fromCollection: true, hasPurchased: true, isTrack: true, roamingViaOneDrive: false
+ }, descriptionStringId: String.id.IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PURCHASED_FLYOUT_BODY
+ }))
+ };
+ return CloudRestrictionCollection
+ })(MusicRestrictionCollection);
+ ViewModels.CloudRestrictionCollection = CloudRestrictionCollection;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.trackRestrictionCollection, function() {
+ return new TrackRestrictionCollection
+ })
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/controls/imagecollage.js:21768 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ var fileScope = {
+ CELL_USED: 1, CELL_BAD_IMAGE: 2
+ };
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImageCollageCell: MS.Entertainment.UI.Framework.define(function(){}, {
+ domElement: null, _imageLoader: null, _svgImageElement: null, _colorOverlay: null, x: 0, y: 0, width: 0, height: 0, urlIndex: -1, _artUri: null, _loaded: false, _initialized: false, _pendingShow: false, _pendingToggle: false, _overlayListenerAdded: false, _transitionPromise: null, cellDefinition: null, initialize: function initialize(blockOffset, cellDefinition, cellSize, filter, backgroundColor) {
+ var that = this;
+ var cellSpacing = MS.Entertainment.Utilities.isMusicApp1 ? 2 : 0;
+ this.cellDefinition = cellDefinition;
+ this.x = blockOffset.x + cellDefinition.x * cellSize.x;
+ this.y = blockOffset.y + cellDefinition.y * cellSize.y;
+ this.width = cellDefinition.size * cellSize.x;
+ this.height = cellDefinition.size * cellSize.y;
+ var svgNS = "http://www.w3.org/2000/svg";
+ var svgElement = document.createElementNS(svgNS, "svg");
+ this._svgImageElement = document.createElementNS(svgNS, "image");
+ this._svgImageElement.setAttribute("x", cellSpacing);
+ this._svgImageElement.setAttribute("y", cellSpacing);
+ this._svgImageElement.setAttribute("width", this.width - (2 * cellSpacing));
+ this._svgImageElement.setAttribute("height", this.height - (2 * cellSpacing));
+ this._svgImageElement.setAttribute("preserveAspectRatio", "none");
+ this._svgImageElement.setAttribute("focusable", "false");
+ svgElement.setAttribute("focusable", "false");
+ this._loaded = false;
+ svgElement.appendChild(this._svgImageElement);
+ this._colorOverlay = document.createElement("div");
+ this._colorOverlay.className = "imageCollageCellColorOverlay";
+ this.domElement = document.createElement("div");
+ this.domElement.style.left = this.x + "px";
+ this.domElement.style.top = this.y + "px";
+ this.domElement.style.width = this.width + "px";
+ this.domElement.style.height = this.height + "px";
+ this.domElement.style.backgroundColor = backgroundColor ? backgroundColor : "#000000";
+ this.domElement.className = "imageCollageCell tranFadeShort";
+ this.domElement.appendChild(svgElement);
+ this.domElement.appendChild(this._colorOverlay);
+ this._cellTransitionEnd = this._cellTransitionEnd.bind(this);
+ this.domElement.addEventListener("transitionend", this._cellTransitionEnd, false)
+ }, unload: function unload() {
+ this.domElement.removeEventListener("transitionend", this._cellTransitionEnd, false);
+ if (this._transitionPromise) {
+ this._transitionPromise.cancel();
+ this._transitionPromise = null
+ }
+ }, setOverlay: function setOverlay(color, alpha, delay) {
+ var transitionEnd = function() {
+ this._colorOverlay.style.msTransitionDelay = String.empty;
+ this._colorOverlay.style.opacity = alpha
+ };
+ if (delay) {
+ this._colorOverlay.style.msTransitionDelay = delay;
+ if (!this._overlayListenerAdded) {
+ this._colorOverlay.addEventListener("transitionend", transitionEnd.bind(this), false);
+ this._overlayListenerAdded = true
+ }
+ }
+ else
+ this._colorOverlay.style.opacity = alpha;
+ this._colorOverlay.style.backgroundColor = color
+ }, setArt: function setArt(artUri) {
+ this._initialized = true;
+ var wasLoaded = this._loaded;
+ this._artUri = artUri;
+ this._loaded = false;
+ if (wasLoaded) {
+ this._pendingShow = true;
+ if (this._transitionPromise)
+ this._transitionPromise.cancel();
+ this._transitionPromise = WinJS.Promise.timeout(600).then(function showCell() {
+ if (this._pendingShow) {
+ this._pendingShow = false;
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ }
+ }.bind(this));
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.hide);
+ return
+ }
+ if (this._pendingToggle) {
+ this._pendingToggle = false;
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ }
+ }, toggleCell: function toggleCell(show, delay) {
+ if (!this._initialized) {
+ this._pendingToggle = (show === MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ return
+ }
+ if (show === MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show) {
+ if (!this._loaded) {
+ this._loaded = true;
+ var uri = this._artUri;
+ if (!uri)
+ uri = MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album;
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", uri)
+ }
+ if (delay)
+ this.domElement.style.msTransitionDelay = delay + "ms";
+ this.domElement.style.opacity = 1
+ }
+ else {
+ this._loaded = false;
+ if (delay)
+ this.domElement.style.msTransitionDelay = delay + "ms";
+ this.domElement.style.opacity = 0
+ }
+ }, _cellTransitionEnd: function _cellTransitionEnd() {
+ if (this._transitionPromise) {
+ this._transitionPromise.cancel();
+ this._transitionPromise = null
+ }
+ this.domElement.style.msTransitionDelay = String.empty;
+ if (this._pendingShow) {
+ this._pendingShow = false;
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ }
+ }
+ }, {
+ showDelay: 750, toggleCellState: {
+ show: "show", hide: "hide"
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LargeWallArt: MS.Entertainment.UI.Framework.define(function(){}, {
+ domElement: null, svgElement: null, currentImageUrl: null, _imageLoader: null, _svgImageElement: null, _svgColorElement: null, _svgBlackElement: null, _loaded: false, _x: 0, _y: 0, _width: 0, _height: 0, _colorOverlay: null, _blackOverlay: null, _animationOffsets: null, _lastAnimationOffset: -1, _hideArtDelayPromise: null, _artDelay: 0, initialize: function initialize(domElement, x, y, w, h, backgroundColor, filter, artDelay) {
+ var that = this;
+ if (window.clientInformation && window.clientInformation.cpuClass === "ARM")
+ this.disableScaling = true;
+ this._artDelay = artDelay !== null ? artDelay : MS.Entertainment.UI.Controls.LargeWallArt.showDelay;
+ this.domElement = domElement;
+ this._animationOffsets = ["25% 25%", "50% 25%", "75% 25%", "25% 50%", "50% 50%", "75% 50%"];
+ var svgNS = "http://www.w3.org/2000/svg";
+ this.svgElement = document.createElementNS(svgNS, "svg");
+ this.svgElement.style.zIndex = 1;
+ this._svgImageElement = document.createElementNS(svgNS, "image");
+ this._svgImageElement.style.zIndex = 0;
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", MS.Entertainment.UI.ImagePaths.imageNotFound);
+ this._svgImageElement.setAttribute("x", 0);
+ this._svgImageElement.setAttribute("y", 0);
+ this._svgImageElement.setAttribute("width", "100%");
+ this._svgImageElement.setAttribute("height", "100%");
+ this._svgImageElement.setAttribute("focusable", "false");
+ this._svgImageElement.setAttribute("preserveAspectRatio", "xMidYMid slice");
+ this.svgElement.setAttribute("focusable", "false");
+ this.svgElement.appendChild(this._svgImageElement);
+ if (filter && !this._svgColorElement) {
+ this._colorOverlay = document.createElement("div");
+ this._colorOverlay.className = "nowPlayingLargeArtColorOverlay tranFadeLong";
+ this._colorOverlay.style.zIndex = 2;
+ this._blackOverlay = document.createElement("div");
+ this._blackOverlay.className = "nowPlayingLargeArtBlackOverlay";
+ this._blackOverlay.style.zIndex = 3
+ }
+ this._imageLoader = new Image;
+ this._imageLoader.addEventListener("load", function imageLoaded(event) {
+ this._loaded = true;
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", this._imageLoader.src);
+ if (this._pendingShow)
+ this.showArt()
+ }.bind(this), false);
+ this._imageLoader.addEventListener("error", function imageError(event) {
+ this._pendingShow = false;
+ this._loaded = true;
+ this.toggleArt(MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.hide)
+ }.bind(this), false);
+ this.domElement.style.backgroundColor = backgroundColor ? backgroundColor : "#000000";
+ this.domElement.style.position = "absolute";
+ this.domElement.style.left = x;
+ this.domElement.style.top = y;
+ this.domElement.style.width = w;
+ this.domElement.style.height = h;
+ this.domElement.style.opacity = "1.0";
+ if (filter && !this._svgColorElement) {
+ this.domElement.appendChild(this._colorOverlay);
+ this.domElement.appendChild(this._blackOverlay)
+ }
+ this.domElement.appendChild(this.svgElement)
+ }, setOverlay: function setOverlay(color, alpha) {
+ if (this._svgColorElement)
+ this._svgColorElement.setAttribute("flood-color", color);
+ else if (color === this._colorOverlay.style.backgroundColor)
+ this._colorOverlay.style.opacity = alpha;
+ else {
+ this._colorOverlay.style.backgroundColor = color;
+ this._colorOverlay.style.opacity = alpha
+ }
+ }, showArt: function showArt() {
+ if (this._hideArtDelayPromise) {
+ this._hideArtDelayPromise.cancel();
+ this._hideArtDelayPromise = null
+ }
+ this.domElement.style.display = String.empty;
+ this.toggleArt(MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.show);
+ var index = Math.floor(Math.random() * this._animationOffsets.length);
+ while (index === this._lastAnimationOffset)
+ index = Math.floor(Math.random() * this._animationOffsets.length);
+ this._lastAnimationOffset = index;
+ this.domElement.className = String.empty;
+ this.domElement.style.transformOrigin = this._animationOffsets[index];
+ if (!this.disableScaling)
+ WinJS.Utilities.addClass(this.domElement, "imageCollageLargeArt");
+ WinJS.Utilities.addClass(this.domElement, "tranFadeVeryShort")
+ }, hideArt: function hideArt() {
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible) {
+ this.domElement.className = String.empty;
+ this.domElement.style.display = "none";
+ this._hideArtDelayPromise = WinJS.Promise.wrap()
+ }
+ else {
+ this.toggleArt(MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.hide);
+ if (this._imageLoader && this._imageLoader.src)
+ this._hideArtDelayPromise = WinJS.Promise.timeout(this._artDelay).then(function _delay() {
+ if (this._hideArtDelayPromise) {
+ this.domElement.className = String.empty;
+ this.domElement.style.display = "none";
+ this._hideArtDelayPromise = null
+ }
+ }.bind(this));
+ else
+ this._hideArtDelayPromise = WinJS.Promise.wrap()
+ }
+ return this._hideArtDelayPromise
+ }, clearArt: function clearArt() {
+ this.hideArt().done(function clearArtUrl() {
+ this.currentImageUrl = null;
+ if (this._svgImageElement)
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", String.empty)
+ }.bind(this), function onError(){})
+ }, setArt: function setArt(artUri) {
+ var wasLoaded = this._loaded;
+ this._loaded = false;
+ this.hideArt();
+ if (!String.isString(artUri))
+ return;
+ return WinJS.Promise.timeout(wasLoaded ? this._artDelay : 0).then(function _delay() {
+ if (this._hideArtDelayPromise) {
+ this._hideArtDelayPromise.cancel();
+ this._hideArtDelayPromise = null
+ }
+ if (artUri) {
+ this.currentImageUrl = artUri;
+ this._imageLoader.setAttribute("src", artUri);
+ this.showArt()
+ }
+ else {
+ this.currentImageUrl = null;
+ this._pendingShow = false;
+ this.domElement.style.opacity = 0;
+ this._loaded = true
+ }
+ }.bind(this))
+ }, toggleArt: function toggleArt(show) {
+ if (show === MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.show || this._pendingShow)
+ if (this._loaded) {
+ this._pendingShow = false;
+ this.domElement.style.opacity = 1
+ }
+ else
+ this._pendingShow = true;
+ else
+ this.domElement.style.opacity = 0
+ }
+ }, {
+ showDelay: 2000, colorShowDelay: 2000, toggleArtState: {
+ show: "show", hide: "hide"
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImageCollage: MS.Entertainment.UI.Framework.defineUserControl("Controls/ImageCollage.html#Template", function ImageCollage(element, options) {
+ this._cells = [];
+ this._cellDefinitions = [];
+ this._renderLoop = this._renderLoop.bind(this)
+ }, {
+ _initialized: false, _blockCountX: 0, _blockCountY: 0, _largeArt: null, _timerEnabled: false, _animationPaused: false, _frozen: false, _cells: null, _blockSizeInPixels: 0, _blockSizeInCells: 0, _cellSizeInPixels: 0, _artIndex: -1, _lastArtShow: 0, _lastArtSwap: 0, _lastCellSwap: 0, _lastColorChange: 0, _lastTimerTick: 0, _cellUsedList: null, _cellUsedCount: 0, _cellOffsetInPixels: 0, _resizeTimeoutPromise: null, _timerPromise: null, _minCellsForTimer: 10, _maxSearchCount: 20, _uiStateService: null, _renderLoopQueued: false, _lastWidth: 0, timerTickInterval: 1000, timerDelayPeriod: 3000, cellAddPeriod: 0, cellRepeatBuffer: 5, cellSwapPeriod: 5000, artShowPeriod: 30000, artSwapPeriod: 11000, artVisiblePeriod: 30000, colorChangePeriod: 0, cellDefinitions: null, cellFilter: null, backgroundColor: "#000000", largeArtDelay: null, initialize: function initialize(element, options, dom) {
+ this._updateSize = this._updateSize.bind(this);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)
+ }, _delayInitialized: function _delayInitialized() {
+ this.bind("cellIdList", this._onCellIdListChanged.bind(this));
+ this.bind("largeArtUrls", this._updateArt.bind(this));
+ MS.Entertainment.Utilities.attachResizeEvent(this.domElement, this._updateSize)
+ }, unload: function unload() {
+ MS.Entertainment.Utilities.detachResizeEvent(this.domElement, this._updateSize);
+ this._timerEnabled = false;
+ this._clearCells();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._frozen = false;
+ if (this._timerEnabled && !this._renderLoopQueued)
+ this._startRenderLoop();
+ this.play()
+ }, pause: function pause() {
+ this._animationPaused = true;
+ if (this._largeArt)
+ this._largeArt.hideArt()
+ }, play: function play() {
+ this._animationPaused = false;
+ if (this._largeArt && this.artVisible)
+ this._largeArt.showArt()
+ }, freeze: function freeze() {
+ this._frozen = true;
+ this.pause();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, _updateSize: function _updateSize() {
+ if (this.domElement.clientWidth > 0 && this._lastWidth === this.domElement.clientWidth)
+ return;
+ this._lastWidth = this.domElement.clientWidth;
+ if (this._resizeTimeoutPromise)
+ this._resizeTimeoutPromise.cancel();
+ this._resizeTimeoutPromise = WinJS.Promise.timeout(500).then(function updateCells() {
+ if (this.cellIdList)
+ this._setCellImages(true)
+ }.bind(this))
+ }, _clearCells: function _clearCells() {
+ if (!this.wallContainer)
+ this._timerEnabled = false;
+ else {
+ MS.Entertainment.Utilities.empty(this.wallContainer);
+ this._cells = [];
+ this._cellUsedList = []
+ }
+ }, _onCellIdListChanged: function _onCellIdListChanged(newValue) {
+ if (newValue)
+ this._setCellImages(false)
+ }, _setCellImages: function _setCellImages(clearCells) {
+ if (!this._cells || !this._cells.length || clearCells || !this.cellIdList || !this.cellIdList.length)
+ this._clearCells();
+ if (!this.cellIdList || !this.cellIdList.length || this._unloaded)
+ return;
+ if (this._cells && this._cells.length > 0) {
+ this._cellUsedCount = 0;
+ this._cellUsedList = [];
+ this._cellUsedList.length = this.cellIdList.length;
+ this._updateCellArts();
+ return
+ }
+ if (!this._cellUsedList)
+ this._cellUsedList = [];
+ this._cellUsedList.length = this.cellIdList.length;
+ var defaultWidth = (this.size && this.size.width) ? this.size.width : window.screen.width;
+ var defaultHeight = (this.size && this.size.height) ? this.size.height : window.screen.height;
+ var elementWidth = this.domElement.clientWidth ? this.domElement.clientWidth : defaultWidth;
+ var elementHeight = this.domElement.clientHeight ? this.domElement.clientHeight : defaultHeight;
+ this._blockCountX = Math.ceil(elementWidth / this._blockSizeInPixels.x);
+ this._blockCountY = Math.ceil(elementHeight / this._blockSizeInPixels.y);
+ this._lastWidth = elementWidth;
+ this._toggleStartTime = 0;
+ var color = this.backdropColor;
+ if (this.colorChangePeriod > 0) {
+ var randomColor = this._randomizeLayerColor();
+ color = "rgba(" + randomColor.r + "," + randomColor.g + "," + randomColor.b + "," + randomColor.a + ")"
+ }
+ var cellCount = this._blockCountX * this._blockCountY * this.cellDefinitions.length;
+ for (var i = 0; i < cellCount; i++) {
+ var newCell = this._initCell(i, elementWidth, elementHeight, color);
+ if (newCell)
+ this._cells.push(newCell)
+ }
+ if (!this.artVisible)
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ if (!this._timerEnabled && ((this.largeArtUrls && this.largeArtUrls.length > 0) || ((this.cellIdList && this.cellIdList.length > this._cells.length) || this._cells.length >= this._minCellsForTimer))) {
+ this._timerEnabled = true;
+ this._startRenderLoop()
+ }
+ else if (this._timerEnabled && ((!this.largeArtUrls || this.largeArtUrls.length === 0) && ((!this.cellIdList || this.cellIdList.length <= this._cells.length) && this._cells.length < this._minCellsForTimer)))
+ this._timerEnabled = false
+ }, _updateArt: function _updateArt(newVal, oldVal) {
+ if (oldVal === undefined || !this.artContainer)
+ return;
+ this._artIndex = -1;
+ if (!this.largeArtUrls) {
+ this._setArtVisible(false);
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ if (this._largeArt)
+ this._setLargeArt(null);
+ return
+ }
+ if (!this._largeArt) {
+ this._largeArt = new MS.Entertainment.UI.Controls.LargeWallArt;
+ this._largeArt.initialize(this.artContainer.domElement, 0, 0, "100%", "100%", this.backgroundColor, this.largeArtFilter, this.largeArtDelay);
+ if (this.colorChangePeriod > 0)
+ this._randomizeLayerColors()
+ }
+ if (!this.largeArtUrls)
+ this._setLargeArt(null);
+ if (this.largeArtUrls && (!this._timerEnabled || this.artVisible)) {
+ this._randomizeArt();
+ this._setArtVisible(true);
+ this._lastArtSwap = 0
+ }
+ else {
+ this._artIndex = -1;
+ this._setArtVisible(false)
+ }
+ if (!this._timerEnabled && (this.largeArtUrls.length > 1 || (this.largeArtUrls.length === 1 && this.largeArtUrls[0] === String.empty))) {
+ this._timerEnabled = true;
+ this._startRenderLoop()
+ }
+ this._lastArtShow = this.artShowPeriod - this.timerDelayPeriod
+ }, _initCell: function _initCell(cellIndex, maxWidth, maxHeight, color) {
+ var that = this;
+ var cell = new MS.Entertainment.UI.Controls.ImageCollageCell;
+ var blockSet = Math.floor(cellIndex / this.cellDefinitions.length);
+ var blockOffsetX = (blockSet % this._blockCountX) * this._blockSizeInCells.x * this._cellSizeInPixels.x - this._cellSizeInPixels.x * this._cellOffsetInPixels;
+ var blockOffsetY = (Math.floor(blockSet / this._blockCountX)) * this._blockSizeInCells.y * this._cellSizeInPixels.y - this._cellSizeInPixels.y * this._cellOffsetInPixels;
+ var cellDefinition = this.cellDefinitions[cellIndex % this.cellDefinitions.length];
+ if ((blockOffsetX + (cellDefinition.x * this._cellSizeInPixels.x) + (cellDefinition.size * this._cellSizeInPixels.x)) <= 0 || (blockOffsetX + (cellDefinition.x * this._cellSizeInPixels.x)) > maxWidth || (blockOffsetY + (cellDefinition.y * this._cellSizeInPixels.y) + (cellDefinition.size * this._cellSizeInPixels.y)) <= 0 || (blockOffsetY + (cellDefinition.y * this._cellSizeInPixels.y)) > maxHeight)
+ return null;
+ cell.initialize({
+ x: blockOffsetX, y: blockOffsetY
+ }, cellDefinition, this._cellSizeInPixels, this.cellFilter, this.backgroundColor);
+ cell.setOverlay(color, 0.5);
+ this._setCellArt(cell);
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement) || !this.wallContainer)
+ return null;
+ else
+ this.wallContainer.appendChild(cell.domElement);
+ return cell
+ }, _setCellArt: function _setCellArt(cell) {
+ if (!cell || !this.cellIdList || !this.cellIdList.length || this._unloaded)
+ return;
+ if (cell.urlIndex > 0 && cell.urlIndex < this.cellIdList.length - 1)
+ if (this._cellUsedList[cell.urlIndex]) {
+ if (this._cellUsedList[cell.urlIndex] < fileScope.CELL_BAD_IMAGE)
+ this._cellUsedList[cell.urlIndex] = 0;
+ if (this._cellUsedCount > 0)
+ this._cellUsedCount--
+ }
+ var random = -1;
+ var loopCount = 0;
+ var lastNonDefault = -1;
+ while (random < 0) {
+ var testIndex = Math.floor(Math.random() * this.cellIdList.length);
+ if (this._cellUsedList[testIndex] < fileScope.CELL_BAD_IMAGE)
+ lastNonDefault = testIndex;
+ if (!this._cellUsedList[testIndex] || loopCount > this._maxSearchCount || this._cellUsedCount >= this.cellIdList.length - this.cellRepeatBuffer)
+ random = testIndex;
+ loopCount++
+ }
+ if (this._cellUsedList[random] === fileScope.CELL_BAD_IMAGE && lastNonDefault >= 0)
+ random = lastNonDefault;
+ if (!this._cellUsedList[random]) {
+ this._cellUsedCount++;
+ this._cellUsedList[random] = fileScope.CELL_USED
+ }
+ cell.urlIndex = random;
+ WinJS.Promise.as(this._setUrlFromCellId(this.cellIdList[random], cell)).done(function checkIfSet(imageUrl) {
+ if (!imageUrl)
+ WinJS.Promise.timeout().done(function() {
+ this._cellUsedList[random] = fileScope.CELL_BAD_IMAGE;
+ this._setCellArt(cell)
+ }.bind(this))
+ }.bind(this))
+ }, _setUrlFromCellId: function _getUrlFromCellId(cellId, cell) {
+ return cell.setArt(cellId)
+ }, _setArtVisible: function _setArtVisible(visible) {
+ if (this.artVisible !== visible) {
+ this.artVisible = visible;
+ if (this._largeArt)
+ if (visible)
+ this._largeArt.showArt();
+ else
+ this._largeArt.hideArt()
+ }
+ }, _timerTick: function _timerTick() {
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement))
+ this._unloaded = true;
+ if (this._timerEnabled && !this._unloaded)
+ if (this._uiStateService.isAppVisible && !this._frozen) {
+ if (this._lastArtShow >= this.artShowPeriod && this._largeArt && this.largeArtUrls) {
+ if (!this.artVisible) {
+ this._lastArtSwap = 0;
+ this._randomizeArt();
+ this._setArtVisible(true);
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.hide)
+ }
+ else if (this.artVisible && this._lastArtSwap >= this.artSwapPeriod) {
+ this._lastArtSwap = 0;
+ this._randomizeArt()
+ }
+ else if (this.artVisible && this._cells && this._cells.length > 0 && this._lastArtShow >= this.artShowPeriod + this.artVisiblePeriod) {
+ this._setArtVisible(false);
+ this._lastCellSwap = 0;
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ this._lastArtShow = 0;
+ this._lastArtSwap = 0
+ }
+ }
+ else if (this._cells && this._cells.length > 0 && !this.artVisible && this._lastCellSwap >= this.cellSwapPeriod) {
+ this._lastCellSwap = 0;
+ var randomCell = this._cells[Math.floor(Math.random() * this._cells.length)];
+ this._setCellArt(randomCell)
+ }
+ if (this.colorChangePeriod > 0 && this._lastColorChange > this.colorChangePeriod) {
+ this._lastColorChange = 0;
+ this._randomizeLayerColors()
+ }
+ }
+ }, _startRenderLoop: function _startRenderLoop() {
+ this._lastInterval = (new Date).getTime();
+ window.requestAnimationFrame(this._renderLoop)
+ }, _lastInterval: 0, _renderLoop: function _renderLoop() {
+ this._renderLoopQueued = false;
+ if (this._frozen || this._unloaded || !this._timerEnabled)
+ return;
+ var elapsedTime = ((new Date).getTime()) - this._lastInterval;
+ if (elapsedTime > 20) {
+ this._lastInterval = (new Date).getTime();
+ if (!this._animationPaused) {
+ this._lastTimerTick += elapsedTime;
+ if (this._lastTimerTick > this.timerTickInterval) {
+ this._updateTimerValues();
+ this._timerTick();
+ this._lastTimerTick = 0
+ }
+ this._updateStartTime += elapsedTime;
+ if (this._cellsToUpdate && this._cellsToUpdate.length > 0) {
+ var updateInfo = this._cellsToUpdate[0];
+ if (updateInfo.sleep <= this._updateStartTime) {
+ this._setCellArt(updateInfo.cell);
+ this._cellsToUpdate.shift()
+ }
+ }
+ }
+ }
+ window.requestAnimationFrame(this._renderLoop);
+ this._renderLoopQueued = true
+ }, _updateTimerValues: function _updateTimerValues() {
+ this._lastArtShow += this.timerTickInterval;
+ this._lastArtSwap += this.timerTickInterval;
+ this._lastCellSwap += this.timerTickInterval;
+ this._lastColorChange += this.timerTickInterval
+ }, _toggleCells: function _toggleCells(show) {
+ this._cells.forEach(function(cell, index) {
+ var sleep = (cell.x + cell.x + cell.width + cell.y + cell.y + cell.height) / 2;
+ cell.toggleCell(show, sleep)
+ }.bind(this))
+ }, _cellsToUpdate: null, _updateStartTime: 0, _updateCellArts: function _updateCellArts() {
+ if (this._cellsToUpdate && this._cellsToUpdate.length > 0)
+ return;
+ this._cellsToUpdate = [];
+ this._cells.forEach(function(cell, index) {
+ var sleep = (cell.x + cell.x + cell.width + cell.y + cell.y + cell.height) / 2;
+ this._cellsToUpdate.push({
+ sleep: sleep, cell: cell
+ })
+ }.bind(this))
+ }, _randomizeLayerColor: function _randomizeLayerColor() {
+ var r1 = Math.floor(Math.random() * 255);
+ var g1 = Math.floor(Math.random() * 255);
+ var b1 = Math.floor(Math.random() * 255);
+ var a1 = 1;
+ return {
+ r: r1, g: g1, b: b1, a: a1
+ }
+ }, _randomizeLayerColors: function _randomizeLayerColors() {
+ var color = this._randomizeLayerColor();
+ var newColor = "rgba(" + color.r + "," + color.g + "," + color.b + "," + color.a + ")";
+ if (this.backgroundColor)
+ this.backdropColor = "rgba(" + color.r + "," + color.g + "," + color.b + ", .3)";
+ this._colorsToUpdate = [];
+ this._cells.forEach(function(cell, index) {
+ var sleep = (cell.x + cell.x + cell.width + cell.y + cell.y + cell.height) / 2;
+ cell.setOverlay(newColor, 0.5, sleep + "ms")
+ }.bind(this));
+ if (this._largeArt)
+ this._largeArt.setOverlay(newColor, 0.3)
+ }, _randomizeArt: function _randomizeArt() {
+ if (this.largeArtUrls) {
+ if (this._artIndex < 0)
+ this._artIndex = Math.floor(Math.random() * this.largeArtUrls.length);
+ else {
+ if (this.largeArtUrls.length === 1 && this._largeArt.currentImageUrl)
+ return false;
+ this._artIndex++;
+ if (this._artIndex >= this.largeArtUrls.length)
+ this._artIndex = 0
+ }
+ var imageUrl = this.largeArtUrls[this._artIndex];
+ this._setLargeArt(imageUrl);
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.hide);
+ return true
+ }
+ else {
+ this._setLargeArt(null);
+ return false
+ }
+ }, _setLargeArt: function _setLargeArt(art) {
+ if (this._largeArt)
+ this._largeArt.setArt(art)
+ }
+ }, {
+ cellIdList: null, largeArtUrls: null, wallVisible: true, artVisible: false, backdropColor: "rgba(0,0,0,0.3)"
+ })})
+})()
+})();
+/* >>>>>>/controls/mediaimagecollage.js:22366 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MediaImageCollage: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ImageCollage", null, function mediaImageCollageConstructor(element, options) {
+ this.timerTickInterval = 10000;
+ this.timerDelayPeriod = 10 + Math.floor(Math.random() * 60000);
+ this.cellAddPeriod = 0;
+ this.cellSwapPeriod = 10000;
+ this.artShowPeriod = 20000;
+ this.artSwapPeriod = 40000;
+ this.artVisiblePeriod = 40000;
+ this.colorChangePeriod = 0;
+ this.cellRepeatBuffer = 0;
+ this._cellDefinitions = [];
+ this._cellDefinitions.push(this._6x6CellDefinitions1);
+ this._cellDefinitions.push(this._6x6CellDefinitions2);
+ this._cellDefinitions.push(this._6x6CellDefinitions3);
+ this._cellDefinitions.push(this._6x6CellDefinitions4);
+ if (MS.Entertainment.Utilities.isApp2)
+ this.backgroundColor = "#333333";
+ else
+ this.backgroundColor = "#ffffff"
+ }, {
+ _cellDefinitions: null, _4x4CellDefinitions: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 0, y: 1, size: 1
+ }, {
+ ordinal: 3, x: 1, y: 0, size: 1
+ }, {
+ ordinal: 4, x: 1, y: 1, size: 1
+ }, ], _6x6CellDefinitions1: [{
+ ordinal: 1, x: 0, y: 0, size: 2
+ }, {
+ ordinal: 2, x: 2, y: 0, size: 1
+ }, {
+ ordinal: 3, x: 2, y: 1, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 2, size: 1
+ }, {
+ ordinal: 5, x: 1, y: 2, size: 1
+ }, {
+ ordinal: 6, x: 2, y: 2, size: 1
+ }, ], _6x6CellDefinitions2: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 1, y: 0, size: 1
+ }, {
+ ordinal: 3, x: 2, y: 0, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 1, size: 2
+ }, {
+ ordinal: 5, x: 2, y: 1, size: 1
+ }, {
+ ordinal: 6, x: 2, y: 2, size: 1
+ }, ], _6x6CellDefinitions3: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 1, y: 0, size: 2
+ }, {
+ ordinal: 3, x: 0, y: 1, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 2, size: 1
+ }, {
+ ordinal: 5, x: 1, y: 2, size: 1
+ }, {
+ ordinal: 6, x: 2, y: 2, size: 1
+ }, ], _6x6CellDefinitions4: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 1, y: 0, size: 1
+ }, {
+ ordinal: 3, x: 2, y: 0, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 1, size: 1
+ }, {
+ ordinal: 5, x: 1, y: 1, size: 2
+ }, {
+ ordinal: 6, x: 0, y: 2, size: 1
+ }, ], _queryPromise: null, _imageCachePromises: null, _maxCellWidth: 0, _maxCellHeight: 0, _uiStateService: null, _networkStatusBinding: null, _delayInitializeFailed: false, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.initialize.apply(this, arguments);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._imageCachePromises = [];
+ this.artVisible = false;
+ if (this._delayInitializeFailed)
+ this._delayInitialized()
+ }, _delayInitialized: function _delayInitialized() {
+ if (!this._initialized) {
+ this._delayInitializeFailed = true;
+ return
+ }
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._delayInitialized.apply(this, arguments);
+ this.bind("media", this._mediaChanged.bind(this))
+ }, unload: function unload() {
+ if (this._queryPromise)
+ this._queryPromise.cancel();
+ if (this._imageCachePromises)
+ for (var i = 0; i < this._imageCachePromises.length; i++)
+ this._imageCachePromises[i].cancel();
+ this.cellIdList = null;
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.unload.call(this)
+ }, _mediaChanged: function _mediaChanged() {
+ if (!this._networkStatusBinding)
+ switch (this._uiStateService.networkStatus) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._networkStatusChanged.bind(this)});
+ break
+ }
+ this._loadImages()
+ }, _networkStatusChanged: function _networkStatusChanged(newValue, oldValue) {
+ if (oldValue === undefined)
+ return;
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ this._mediaChanged()
+ }, _loadImages: function _loadImages() {
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement))
+ return
+ }, _setCellDefinitions: function _setCellDefinitions(count) {
+ if (count > 6 && this.useDynamicLayouts) {
+ this.rows = 3;
+ this.columns = 3;
+ var definitionIndex = Math.floor(Math.random() * this._cellDefinitions.length);
+ this.cellDefinitions = this._cellDefinitions[definitionIndex];
+ this._maxCellWidth = this.size.width / 3 * 2;
+ this._maxCellHeight = this.size.height / 3 * 2
+ }
+ else {
+ this.rows = 2;
+ this.columns = 2;
+ this.cellDefinitions = this._4x4CellDefinitions;
+ this._maxCellWidth = this.size.width / 2;
+ this._maxCellHeight = this.size.height / 2
+ }
+ this._blockSizeInPixels = {
+ x: this.size.width, y: this.size.height
+ };
+ this._blockSizeInCells = {
+ x: this.columns, y: this.rows
+ };
+ this._cellSizeInPixels = {
+ x: this.size.width / this.columns, y: this.size.height / this.rows
+ };
+ this._cellOffsetInPixels = this.cellOffset
+ }, _setUrlFromCellId: function _getUrlFromCellId(media, cell) {
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement)) {
+ this.unload();
+ return
+ }
+ if (typeof media === "string") {
+ if (cell)
+ cell.setArt(media);
+ return media
+ }
+ if (media.cachedImageUrl) {
+ if (cell)
+ cell.setArt(media.cachedImageUrl);
+ return media.cachedImageUrl
+ }
+ var expectedWidth = Math.max(this._maxCellWidth, this.minimumSize.width);
+ var expectedHeight = Math.max(this._maxCellHeight, this.minimumSize.height);
+ var imageCachePromise = MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(media, expectedWidth, expectedHeight).then(function checkResult(url) {
+ media.cachedImageUrl = url;
+ if (url === MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album)
+ return null;
+ if (cell)
+ cell.setArt(media.cachedImageUrl);
+ return media.cachedImageUrl
+ });
+ if (imageCachePromise) {
+ this._imageCachePromises.push(imageCachePromise);
+ return imageCachePromise
+ }
+ }
+ }, {
+ media: null, size: {
+ width: 135, height: 135
+ }, minimumSize: {
+ width: 0, height: 0
+ }, columns: 2, rows: 2, useDynamicLayouts: true, cellOffset: 0
+ })})
+})()
+})();
+/* >>>>>>/controls/music/playlistimagecollage.js:22560 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {PlaylistImageCollage: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MediaImageCollage", null, null, {
+ _albumResultsLength: -1, _frozen: false, _mediaItemBinding: null, _focused: false, _unfocusedArt: null, _savedAlbums: null, _focusBindings: null, _focusInPromise: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.initialize.apply(this, arguments);
+ if (this.changeOnFocus) {
+ var focusedItem = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "win-focusable");
+ if (document.activeElement === focusedItem)
+ this._onFocusIn();
+ else
+ this._onFocusOut();
+ this._focusBindings = MS.Entertainment.Utilities.addEventHandlers(focusedItem, {
+ focusin: this._onFocusIn.bind(this), focusout: this._onFocusOut.bind(this)
+ })
+ }
+ this.timerTickInterval = 30000;
+ this.timerDelayPeriod = Math.floor(Math.random() * this.timerTickInterval);
+ this.cellAddPeriod = 0;
+ this.cellSwapPeriod = 20 + Math.floor(Math.random() * this.timerTickInterval - 20);
+ this.artShowPeriod = 30000;
+ this.artSwapPeriod = 11000;
+ this.artVisiblePeriod = 30000;
+ this.colorChangePeriod = 0;
+ this.cellRepeatBuffer = 0;
+ this.minimumSize = {
+ width: 60, height: 60
+ };
+ if (this.media && this.media.libraryId === -1)
+ this._mediaItemBinding = WinJS.Binding.bind(this.media, {libraryId: function libraryIdChanged() {
+ if (this.media.libraryId !== -1) {
+ this._mediaItemBinding.cancel();
+ this._mediaItemBinding = null;
+ if (!this._frozen)
+ this._loadImages()
+ }
+ }.bind(this)})
+ }, unload: function unload() {
+ if (this._focusBindings) {
+ this._focusBindings.cancel();
+ this._focusBindings = null
+ }
+ if (this._mediaItemBinding) {
+ this._mediaItemBinding.cancel();
+ this._mediaItemBinding = null
+ }
+ if (this._focusInPromise) {
+ this._focusInPromise.cancel();
+ this._focusInPromise = null
+ }
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._frozen = true;
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ this._frozen = false;
+ if (this.media && MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId) && (this._albumResultsLength <= 0 || this.refreshOnThaw))
+ this._loadImages();
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.thaw.call(this)
+ }, _loadImages: function _loadImages() {
+ if (!this.media)
+ return;
+ var hydratePromise = WinJS.Promise.as();
+ if (!MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId) && this.media.hydrate)
+ hydratePromise = this.media.hydrate();
+ hydratePromise.then(function renderAlbums() {
+ return WinJS.Promise.timeout(this.loadDelay)
+ }.bind(this)).done(function getAlbums() {
+ if (this._unloaded || (!MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId) && !this.media.hasServiceId))
+ return;
+ if (this._queryPromise) {
+ this._queryPromise.cancel();
+ this._queryPromise = null
+ }
+ if (MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId)) {
+ var localAlbumQuery;
+ localAlbumQuery = new MS.Entertainment.Data.Query.libraryAlbums;
+ localAlbumQuery.aggregateChunks = false;
+ localAlbumQuery.chunkSize = 8;
+ localAlbumQuery.playlistId = this.media.libraryId;
+ this._queryPromise = localAlbumQuery.execute().then(function returnItems(q) {
+ if (q.result && q.result.items)
+ return q.result.items.toArray(0, 8);
+ return null
+ })
+ }
+ else if (this.media.albumImages)
+ this._queryPromise = WinJS.Promise.as(this.media.albumImages);
+ if (this._queryPromise)
+ this._queryPromise.done(function(itemArray) {
+ if (itemArray) {
+ if (this._unloaded)
+ return;
+ if (this._savedAlbums) {
+ if (this._savedAlbums.length === itemArray.length) {
+ var sameAlbums = true;
+ for (var j = 0; j < itemArray.length; j++)
+ if (!itemArray[j].isEqual || !itemArray[j].isEqual(this._savedAlbums[j])) {
+ sameAlbums = false;
+ break
+ }
+ if (sameAlbums)
+ return
+ }
+ this._clearCells();
+ this._cellUsedCount = 0;
+ this._unfocusedArt = null
+ }
+ if (this.refreshOnThaw)
+ this._savedAlbums = itemArray;
+ this._albumResultsLength = itemArray.length;
+ this._setCellDefinitions(itemArray.length);
+ if (itemArray.length === 0 && this.useDefaultImages)
+ if (this.size.width > 316 && this.size.height > 316 || this.changeOnFocus)
+ itemArray.push(MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.playlistLarge);
+ else
+ itemArray.push(MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.playlist);
+ if (itemArray.length < 4) {
+ var modifiedAlbums = [];
+ switch (itemArray.length) {
+ case 1:
+ modifiedAlbums.push(itemArray[0]);
+ break;
+ case 2:
+ modifiedAlbums.push(itemArray[0]);
+ modifiedAlbums.push(itemArray[0]);
+ modifiedAlbums.push(itemArray[1]);
+ modifiedAlbums.push(itemArray[1]);
+ break;
+ case 3:
+ modifiedAlbums.push(itemArray[0]);
+ modifiedAlbums.push(itemArray[1]);
+ modifiedAlbums.push(itemArray[2]);
+ modifiedAlbums.push(itemArray[0]);
+ break
+ }
+ this.cellIdList = modifiedAlbums
+ }
+ else
+ this.cellIdList = itemArray
+ }
+ else
+ this.cellIdList = [MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.playlist];
+ this._queryPromise = null
+ }.bind(this))
+ }.bind(this))
+ }, _setCellImages: function _setCellImages() {
+ var getUnfocusedImageUrl = WinJS.Promise.as();
+ if (this._albumResultsLength >= 0) {
+ if (this.domElement && this.domElement.clientWidth && this.domElement.clientHeight)
+ this.size = {
+ width: this.domElement.clientWidth, height: this.domElement.clientHeight
+ };
+ if (this.changeOnFocus && !this._unfocusedArt) {
+ this._maxCellWidth = this.size.width;
+ this._maxCellHeight = this.size.height;
+ if (this.cellIdList && this.cellIdList.length)
+ getUnfocusedImageUrl = WinJS.Promise.as(this._setUrlFromCellId(this.cellIdList[0]))
+ }
+ this._setCellDefinitions(this._albumResultsLength)
+ }
+ var originalArguments = arguments;
+ getUnfocusedImageUrl.done(function setUnfocusedImage(imageUrl) {
+ if (imageUrl)
+ this._unfocusedArt = imageUrl;
+ else if (imageUrl === null && !this._unfocusedArt)
+ this._unfocusedArt = MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album;
+ if (!this._focused && this._unfocusedArt) {
+ if (!this.largeArtUrls || this.largeArtUrls[0] !== this._unfocusedArt)
+ this.largeArtUrls = [this._unfocusedArt]
+ }
+ else
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._setCellImages.apply(this, originalArguments)
+ }.bind(this), function error() {
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._setCellImages.apply(this, originalArguments)
+ }.bind(this))
+ }, _onFocusIn: function _onFocusIn() {
+ if (this._focusInPromise || this._albumResultsLength === 0)
+ return;
+ this._focusInPromise = WinJS.Promise.timeout(250).then(function updateFocus() {
+ this._focused = true;
+ WinJS.Utilities.removeClass(this.wallContainer, "hideFromDisplay");
+ this._setArtVisible(false);
+ this._timerEnabled = false;
+ if (!this._cells || this._cells.length === 0)
+ this._setCellImages();
+ this._focusInPromise = null
+ }.bind(this))
+ }, _onFocusOut: function _onFocusOut() {
+ if (this._focusInPromise) {
+ this._focusInPromise.cancel();
+ this._focusInPromise = null
+ }
+ this._focused = false;
+ if (this._unfocusedArt) {
+ if (!this.largeArtUrls)
+ this.largeArtUrls = [this._unfocusedArt];
+ WinJS.Utilities.addClass(this.wallContainer, "hideFromDisplay")
+ }
+ this._setArtVisible(true)
+ }, _toggleCells: function _toggleCells(show) {
+ if (this.changeOnFocus) {
+ if (show === MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ this._cells.forEach(function(cell) {
+ var sleep = (cell.width + cell.height) / 4;
+ cell.toggleCell(show, sleep)
+ }.bind(this))
+ }
+ else
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._toggleCells.apply(this, arguments)
+ }
+ }, {
+ size: {
+ width: 135, height: 135
+ }, columns: 2, rows: 2, changeOnFocus: false, refreshOnThaw: false, cellOffset: 0, useDefaultImages: true, loadDelay: 500
+ })})
+})()
+})();
diff --git a/packages/microsoft.zunemusic/group_3_merged.js b/packages/microsoft.zunemusic/group_3_merged.js
new file mode 100644
index 00000000..bf123818
--- /dev/null
+++ b/packages/microsoft.zunemusic/group_3_merged.js
@@ -0,0 +1,2113 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/components/music1/musiclxstatehandlers.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var ArtistDetailsActionLocations = (function() {
+ function ArtistDetailsActionLocations(){}
+ ArtistDetailsActionLocations.primaryHeader = "primaryHeader";
+ ArtistDetailsActionLocations.localAlbums = "myAlbums";
+ ArtistDetailsActionLocations.topSongs = "topSongs";
+ return ArtistDetailsActionLocations
+ })();
+ ViewModels.ArtistDetailsActionLocations = ArtistDetailsActionLocations;
+ var MusicLXStateHandlers = (function() {
+ function MusicLXStateHandlers(){}
+ MusicLXStateHandlers._getPinTile = function(appState, mediaItem) {
+ var pinTilePromise = null;
+ if (appState && appState.canPinToStartScreen) {
+ var pinToStartScreenService = Entertainment.ServiceLocator.getService(Entertainment.Services.pinToStartScreen);
+ pinTilePromise = pinToStartScreenService.getTileForMediaAsync(mediaItem)
+ }
+ return WinJS.Promise.as(pinTilePromise)
+ };
+ MusicLXStateHandlers._pushPinButton = function(existingPin, appState, buttons, engineButtons) {
+ if (appState && appState.canPinToStartScreen && buttons && engineButtons)
+ if (!existingPin)
+ buttons.push(engineButtons.pinToStartScreen);
+ else
+ buttons.push(engineButtons.unpinFromStartScreen)
+ };
+ MusicLXStateHandlers.createButtonListOverflow = function(engine, buttons, maxButtonListLength) {
+ if (buttons && buttons.smartButtons && buttons.smartButtons.length >= maxButtonListLength) {
+ engine.buttons.more.setSubActions(buttons.smartButtons.slice(maxButtonListLength - 1).map(function(item) {
+ return {action: item}
+ }));
+ buttons.smartButtons = buttons.smartButtons.slice(0, maxButtonListLength - 1).concat(engine.buttons.more)
+ }
+ return buttons
+ };
+ MusicLXStateHandlers.onPlaylistDetailsStateChanged = function(engine, stateInfo) {
+ var buttons = [];
+ var addToSubActions = [];
+ var appState = ViewModels._MusicState.getCurrentState(engine.media, stateInfo);
+ var pinTilePromise = MusicLXStateHandlers._getPinTile(appState, engine.media);
+ return pinTilePromise.then(function(existingTile) {
+ if ((stateInfo.collection.canPlayLocally || (appState.isOnline && stateInfo.collection.canPlayLocallyOrStreamFromCloud)) && engine.media.count > 0) {
+ engine.buttons.genericPlay.wrap(engine.buttons.play);
+ buttons.push(engine.buttons.genericPlay);
+ if (appState.canAddToNowPlaying)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying);
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToPlaylist)
+ }
+ else {
+ engine.buttons.genericPlay.wrap(engine.buttons.playDisabled);
+ buttons.push(engine.buttons.genericPlay)
+ }
+ if (addToSubActions.length > 0) {
+ engine.buttons.addTo.setSubActions(addToSubActions);
+ buttons.push(engine.buttons.addTo)
+ }
+ buttons.push(engine.buttons.renamePlaylist);
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, buttons, engine.buttons);
+ buttons.push(engine.buttons.deleteMedia);
+ buttons = buttons.concat(ViewModels.MusicStateHelpers._getDownloadButtons(appState, engine.buttons, stateInfo, engine.media));
+ var requestButtons = MusicLXStateHandlers.createButtonListOverflow(engine, {
+ smartButtons: buttons, appbarActions: []
+ }, ViewModels.PlaylistDetailsViewModelBase.HEADER_BUTTON_LIST_LENGTH);
+ return WinJS.Promise.as(requestButtons)
+ })
+ };
+ MusicLXStateHandlers._getButtonsForAlbumDownloading = function(appState, stateInfo, isfromCollection, hasAddToMyMusicRights, albumButtons, media) {
+ MS.Entertainment.UI.assert(appState, "appState is required!");
+ MS.Entertainment.UI.assert(stateInfo, "stateInfo is required!");
+ MS.Entertainment.UI.assert(albumButtons, "albumButtons is required!");
+ var buttons = [];
+ var pinTilePromise = MusicLXStateHandlers._getPinTile(appState, media);
+ return pinTilePromise.then(function(existingTile) {
+ if (isfromCollection || hasAddToMyMusicRights)
+ if (stateInfo.canPlay)
+ albumButtons.genericPlay.wrap(albumButtons.play);
+ else
+ albumButtons.genericPlay.wrap(albumButtons.playDisabled);
+ else if (appState.isDTOMarket)
+ albumButtons.genericPlay.wrap(albumButtons.playDisabled);
+ else
+ albumButtons.genericPlay.wrap(albumButtons.albumPlayPreview);
+ buttons.push(albumButtons.genericPlay);
+ albumButtons.addTo.setSubActions(ViewModels.MusicStateHandlers._getAddToSubActionsForAlbum(appState, stateInfo, hasAddToMyMusicRights));
+ buttons.push(albumButtons.addTo);
+ if (appState.showArtistDetailsButton)
+ buttons.push(albumButtons.artistDetails);
+ if (appState.canPlaySmartDJ)
+ buttons.push(albumButtons.playArtistSmartDJ);
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, buttons, albumButtons);
+ return {
+ smartButtons: buttons, appbarActions: []
+ }
+ })
+ };
+ MusicLXStateHandlers._getButtonsForAlbumDownloadFailed = function(appState, stateInfo, isfromCollection, hasAddToMyMusicRights, albumButtons, media) {
+ MS.Entertainment.UI.assert(appState, "appState is required!");
+ MS.Entertainment.UI.assert(stateInfo, "stateInfo is required!");
+ MS.Entertainment.UI.assert(albumButtons, "albumButtons is required!");
+ var buttons = [];
+ var pinTilePromise = MusicLXStateHandlers._getPinTile(appState, media);
+ return pinTilePromise.then(function(existingTile) {
+ if (isfromCollection || hasAddToMyMusicRights) {
+ if (stateInfo.canPlay) {
+ albumButtons.genericPlay.wrap(albumButtons.play);
+ buttons.push(albumButtons.genericPlay)
+ }
+ }
+ else {
+ albumButtons.genericPlay.wrap(albumButtons.albumPlayPreview);
+ buttons.push(albumButtons.genericPlay)
+ }
+ albumButtons.addTo.setSubActions(ViewModels.MusicStateHandlers._getAddToSubActionsForAlbum(appState, stateInfo, hasAddToMyMusicRights));
+ buttons.push(albumButtons.addTo);
+ if (stateInfo.download.hasRetryable)
+ buttons.push(albumButtons.tryAgain);
+ else
+ buttons.push(albumButtons.remove);
+ if (appState.showArtistDetailsButton)
+ buttons.push(albumButtons.artistDetails);
+ if (appState.canPlaySmartDJ) {
+ albumButtons.genericPlay.wrap(albumButtons.playArtistSmartDJ);
+ buttons.push(albumButtons.genericPlay)
+ }
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, buttons, albumButtons);
+ if (appState.canDelete)
+ buttons.push(albumButtons.deleteMedia);
+ return {
+ smartButtons: buttons, appbarActions: []
+ }
+ })
+ };
+ MusicLXStateHandlers._getButtonsForAlbumDownloadPending = function(appState, stateInfo, isfromCollection, hasAddToMyMusicRights, albumButtons, media) {
+ MS.Entertainment.UI.assert(appState, "appState is required!");
+ MS.Entertainment.UI.assert(stateInfo, "stateInfo is required!");
+ MS.Entertainment.UI.assert(albumButtons, "albumButtons is required!");
+ var buttons = [];
+ var pinTilePromise = MusicLXStateHandlers._getPinTile(appState, media);
+ return pinTilePromise.then(function(existingTile) {
+ if (isfromCollection || hasAddToMyMusicRights) {
+ if (stateInfo.canPlay) {
+ albumButtons.genericPlay.wrap(albumButtons.play);
+ buttons.push(albumButtons.genericPlay)
+ }
+ }
+ else {
+ albumButtons.genericPlay.wrap(albumButtons.albumPlayPreview);
+ buttons.push(albumButtons.genericPlay)
+ }
+ albumButtons.addTo.setSubActions(ViewModels.MusicStateHandlers._getAddToSubActionsForAlbum(appState, stateInfo, hasAddToMyMusicRights));
+ buttons.push(albumButtons.addTo);
+ buttons.push(albumButtons.download);
+ if (appState.showArtistDetailsButton)
+ buttons.push(albumButtons.artistDetails);
+ if (appState.canPlaySmartDJ)
+ buttons.push(albumButtons.playArtistSmartDJ);
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, buttons, albumButtons);
+ return {
+ smartButtons: buttons, appbarActions: []
+ }
+ })
+ };
+ MusicLXStateHandlers._getButtonsForMarketplaceAlbum = function(appState, stateInfo, albumButtons, rights, media) {
+ var buttons = [];
+ var addToSubActions = [];
+ var allowSubscriptionActions = appState.musicSubscriptionEnabled && appState.signedInUserHasSubscription;
+ var allowFreeStreamActions = appState.canFreeStream;
+ var allowSubscriptionOrFreeStreamActions = (allowSubscriptionActions || allowFreeStreamActions);
+ var hasSubscriptionDownloadRights = allowSubscriptionActions && rights.subscriptionDownload;
+ var hasSubscriptionStreamingRights = allowSubscriptionActions && rights.subscriptionStream;
+ var hasFreeStreamingRights = allowFreeStreamActions && rights.freeStream;
+ var hasAddToMyMusicRights = hasSubscriptionStreamingRights || hasFreeStreamingRights || hasSubscriptionDownloadRights;
+ var showMusicPassOptions = allowSubscriptionActions && (hasSubscriptionStreamingRights || hasSubscriptionDownloadRights);
+ var showFreeStreamOptions = allowFreeStreamActions && hasFreeStreamingRights;
+ var isContentBlocked = appState.isExplicitBlocked && rights.allTracksExplicit;
+ var canCollectionPlayLocally = stateInfo && stateInfo.collection && stateInfo.collection.canPlayLocally;
+ var canCollectionPlayFromCloud = stateInfo && stateInfo.collection && stateInfo.collection.canStreamFromCloud;
+ var pinTilePromise = MusicLXStateHandlers._getPinTile(appState, media);
+ return pinTilePromise.then(function(existingTile) {
+ if (showMusicPassOptions) {
+ if ((rights.subscriptionStream && appState.isOnline && !isContentBlocked) || (media.inCollection && canCollectionPlayLocally) || (media.inCollection && canCollectionPlayFromCloud && appState.isOnline)) {
+ albumButtons.genericPlay.wrap(albumButtons.play);
+ buttons.push(albumButtons.genericPlay)
+ }
+ else
+ buttons.push(albumButtons.playDisabled);
+ if (appState.canAddToMyMusic && hasAddToMyMusicRights)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToMyMusic);
+ if (appState.canAddToPlaylist && appState.isSignedIn)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToPlaylist);
+ if (appState.canAddToNowPlaying)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying)
+ }
+ else if (showFreeStreamOptions) {
+ if (appState.isOnline && !isContentBlocked) {
+ albumButtons.genericPlay.wrap(albumButtons.play);
+ buttons.push(albumButtons.genericPlay)
+ }
+ else
+ buttons.push(albumButtons.playDisabled);
+ if (appState.canAddToMyMusic && hasAddToMyMusicRights)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToMyMusic);
+ if (appState.canAddToPlaylist && appState.isSignedIn)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToPlaylist);
+ if (appState.canAddToNowPlaying && appState.isSignedIn)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying)
+ }
+ else {
+ if (stateInfo.collection.canPlayLocallyOrStreamFromCloud || (stateInfo.marketplace.canStream && appState.isOnline && !isContentBlocked)) {
+ albumButtons.genericPlay.wrap(albumButtons.play);
+ buttons.push(albumButtons.genericPlay)
+ }
+ else if (!appState.isOnline || isContentBlocked)
+ buttons.push(albumButtons.playDisabled);
+ else if (rights.preview) {
+ albumButtons.genericPlay.wrap(albumButtons.albumPlayPreview);
+ buttons.push(albumButtons.genericPlay)
+ }
+ if (stateInfo.marketplace.hasPurchased && appState.cloudServiceEnabled)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToMyMusic)
+ }
+ if (addToSubActions.length > 0 && !isContentBlocked) {
+ albumButtons.addTo.setSubActions(addToSubActions);
+ buttons.push(albumButtons.addTo)
+ }
+ if (appState.showArtistDetailsButton)
+ buttons.push(albumButtons.artistDetails);
+ if (appState.canDownloadPurchasedMedia && !isContentBlocked)
+ buttons.push(albumButtons.download);
+ else if (showMusicPassOptions && rights.subscriptionDownload && !appState.downloadOnAddToMyMusicCloud)
+ buttons.push(albumButtons.subscriptionDownload);
+ if (appState.canPlaySmartDJ)
+ buttons.push(albumButtons.playArtistSmartDJ);
+ if (!buttons.length)
+ buttons.push(albumButtons.contentNotAvailable);
+ if (!isContentBlocked)
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, buttons, albumButtons);
+ return WinJS.Promise.as({
+ smartButtons: buttons, appbarActions: []
+ })
+ })
+ };
+ MusicLXStateHandlers._getAlbumDetailsButtons = function(engine, stateInfo) {
+ MS.Entertainment.UI.assert(engine.media, "engine.media should be defined!");
+ var appState = ViewModels._MusicState.getCurrentState(engine.media, stateInfo);
+ var showCollectionDetails = ViewModels.MusicStateHandlers.shouldShowCollectionDetails(engine.media, stateInfo);
+ var buttons = [];
+ var addToSubActions = [];
+ var pinTilePromise = MusicLXStateHandlers._getPinTile(appState, engine.media);
+ return pinTilePromise.then(function(existingTile) {
+ if (stateInfo.download.hasActive)
+ return ViewModels.MusicStateHandlers._getAddToMyMusicRights(appState, engine.media).then(function(hasAddToMyMusicRights) {
+ return MusicLXStateHandlers._getButtonsForAlbumDownloading(appState, stateInfo, engine.media && engine.media.fromCollection, hasAddToMyMusicRights, engine.buttons, engine.media)
+ });
+ else if (showCollectionDetails && (stateInfo.collection.canPlayLocallyOrStreamFromCloud || appState.isFreeLimitsExceeded)) {
+ if (stateInfo.collection.canPlayLocally || (appState.isOnline && stateInfo.collection.canPlayLocallyOrStreamFromCloud))
+ engine.buttons.genericPlay.wrap(engine.buttons.play);
+ else
+ engine.buttons.genericPlay.wrap(engine.buttons.playDisabled);
+ buttons.push(engine.buttons.genericPlay);
+ if (appState.canAddToCloud)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToCloud);
+ if (appState.canAddToNowPlaying)
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying);
+ addToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToPlaylist);
+ engine.buttons.addTo.setSubActions(addToSubActions);
+ buttons.push(engine.buttons.addTo);
+ if (appState.showArtistDetailsButton)
+ buttons.push(engine.buttons.artistDetails);
+ if (appState.canPlaySmartDJ)
+ buttons.push(engine.buttons.playArtistSmartDJ);
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, buttons, engine.buttons);
+ if (appState.canDelete)
+ buttons.push(engine.buttons.deleteMedia);
+ if (appState.canEdit)
+ buttons.push(engine.buttons.editMetadata);
+ if (appState.canFindAlbumInfo)
+ buttons.push(engine.buttons.findAlbumInfo);
+ buttons = buttons.concat(ViewModels.MusicStateHelpers._getDownloadButtons(appState, engine.buttons, stateInfo, engine.media))
+ }
+ else if (stateInfo.download.hasFailed)
+ return ViewModels.MusicStateHandlers._getAddToMyMusicRights(appState, engine.media).then(function(hasAddToMyMusicRights) {
+ return MusicLXStateHandlers._getButtonsForAlbumDownloadFailed(appState, stateInfo, engine.media && engine.media.fromCollection, hasAddToMyMusicRights, engine.buttons, engine.media)
+ });
+ else if (stateInfo.download.hasPending)
+ return ViewModels.MusicStateHandlers._getAddToMyMusicRights(appState, engine.media).then(function(hasAddToMyMusicRights) {
+ return MusicLXStateHandlers._getButtonsForAlbumDownloadPending(appState, stateInfo, engine.media && engine.media.fromCollection, hasAddToMyMusicRights, engine.buttons, engine.media)
+ });
+ else if (engine.media.location === Entertainment.Data.ItemLocation.collection) {
+ if (appState.showArtistDetailsButton)
+ buttons.push(engine.buttons.artistDetails);
+ if (appState.canPlaySmartDJ)
+ buttons.push(engine.buttons.playArtistSmartDJ);
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, buttons, engine.buttons);
+ if (appState.canDelete)
+ buttons.push(engine.buttons.deleteMedia)
+ }
+ else {
+ if (!engine.media.hydrated || !engine.media.tracks)
+ return WinJS.Promise.as(null);
+ return ViewModels.MusicSmartBuyStateHandlers.getAlbumRights(engine.media).then(function(rights) {
+ return MusicLXStateHandlers._getButtonsForMarketplaceAlbum(appState, stateInfo, engine.buttons, rights, engine.media)
+ })
+ }
+ return WinJS.Promise.as({
+ smartButtons: buttons, appbarActions: []
+ })
+ })
+ };
+ MusicLXStateHandlers.albumDetailsTestHandler = function(engine, stateInfo) {
+ return WinJS.Promise.as({
+ smartButtons: [engine.buttons.play, engine.buttons.addTo, engine.buttons.download, engine.buttons.tryAgain, engine.buttons.remove], appbarActions: []
+ }).then(function(buttons) {
+ return MusicLXStateHandlers.createButtonListOverflow(engine, buttons, ViewModels.AlbumDetailsViewModel.HEADER_BUTTON_LIST_LENGTH)
+ })
+ };
+ MusicLXStateHandlers.onAlbumDetailsStateChanged = function(engine, stateInfo) {
+ return MusicLXStateHandlers._getAlbumDetailsButtons(engine, stateInfo).then(function(buttons) {
+ return MusicLXStateHandlers.createButtonListOverflow(engine, buttons, ViewModels.AlbumDetailsViewModel.HEADER_BUTTON_LIST_LENGTH)
+ })
+ };
+ MusicLXStateHandlers.onArtistDetailsStateChanged = function(engine, stateInfo) {
+ var addLocalAlbumsToSubActions = [];
+ var locationSpecificButtons = {};
+ var topSongsAddToSubActions = [];
+ var detailsHeader = locationSpecificButtons[ArtistDetailsActionLocations.primaryHeader] = [];
+ var myAlbumsHeader = locationSpecificButtons[ArtistDetailsActionLocations.localAlbums] = [];
+ var topSongsHeader = locationSpecificButtons[ArtistDetailsActionLocations.topSongs] = [];
+ var appState = ViewModels._MusicState.getCurrentState(engine.media, stateInfo);
+ var pinTilePromise = MusicLXStateHandlers._getPinTile(appState, engine.media);
+ return pinTilePromise.then(function(existingTile) {
+ if (appState.canPlaySmartDJ)
+ detailsHeader.push(engine.buttons.playArtistSmartDJ);
+ else if (appState.smartDJEnabled && appState.hasSmartDJ)
+ detailsHeader.push(engine.buttons.playArtistSmartDJDisabled);
+ MusicLXStateHandlers._pushPinButton(existingTile, appState, detailsHeader, engine.buttons);
+ if (stateInfo.collection.canPlayLocallyOrStreamFromCloud && engine.buttons.playLocalAlbums && engine.buttons.addLocalAlbumsTo) {
+ if (appState.isOnline || engine.media.localTracksCount > 0)
+ myAlbumsHeader.push(engine.buttons.playLocalAlbums);
+ else
+ myAlbumsHeader.push(engine.buttons.playDisabled);
+ if (appState.canAddToNowPlaying)
+ addLocalAlbumsToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToNowPlaying);
+ addLocalAlbumsToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToPlaylist);
+ engine.buttons.addLocalAlbumsTo.setSubActions(addLocalAlbumsToSubActions);
+ myAlbumsHeader.push(engine.buttons.addLocalAlbumsTo)
+ }
+ var canFreeStream = appState.canFreeStream;
+ var canSubscriptionStream = (appState.signedInUserHasSubscription && appState.musicSubscriptionEnabled);
+ if (canFreeStream || canSubscriptionStream)
+ topSongsHeader.push(engine.buttons.playTopSongs);
+ else
+ topSongsHeader.push(engine.buttons.previewTopSongs);
+ if (!appState.isDTOMarket && appState.canAddToNowPlaying)
+ topSongsAddToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addMarketplaceArtistToNowPlaying);
+ if (!appState.isDTOMarket && appState.canAddToPlaylist && appState.isSignedIn)
+ topSongsAddToSubActions.push(Entertainment.UI.Actions.AddTo.subMenuIds.addToPlaylist);
+ if (topSongsAddToSubActions.length > 0) {
+ engine.buttons.addTopSongsTo.setSubActions(topSongsAddToSubActions);
+ topSongsHeader.push(engine.buttons.addTopSongsTo)
+ }
+ return WinJS.Promise.as({
+ appbarActions: [], locationSpecificButtons: locationSpecificButtons
+ })
+ })
+ };
+ return MusicLXStateHandlers
+ })();
+ ViewModels.MusicLXStateHandlers = MusicLXStateHandlers
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.musicStateHandler, function() {
+ var useAlbumDetailsDownloadTestHandler = (new Microsoft.Entertainment.Configuration.ConfigurationManager).music.useAlbumDetailsDownloadTestHandler;
+ return {
+ onAlbumDetailsStateChanged: useAlbumDetailsDownloadTestHandler ? MS.Entertainment.ViewModels.MusicLXStateHandlers.albumDetailsTestHandler : MS.Entertainment.ViewModels.MusicLXStateHandlers.onAlbumDetailsStateChanged, onPlaylistDetailsStateChanged: MS.Entertainment.ViewModels.MusicLXStateHandlers.onPlaylistDetailsStateChanged
+ }
+})
+})();
+/* >>>>>>/framework/searchaction.js:389 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {SearchAutomationIds: {
+ search: "search", searchByContext: "searchByContext", resetSearchFilter: "resetSearchFilter"
+ }});
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ SearchByContextAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function searchByContextActionConstructor() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.searchByContext, executed: function executed(param) {
+ if (this.canExecute(param)) {
+ var moniker = param.moniker;
+ if (moniker !== MS.Entertainment.UI.Monikers.searchPage)
+ if (MS.Entertainment.Utilities.isMusicApp)
+ if (moniker === MS.Entertainment.UI.Monikers.musicCollection)
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.localCollection;
+ else
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.all;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ if (param.defaultModifierIndex)
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = param.defaultModifierIndex;
+ else
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.all
+ }
+ }, canExecute: function canExecute(param) {
+ return param != null && param != undefined && param.moniker != null
+ }
+ }), SearchAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function searchAction() {
+ this.base()
+ }, {
+ defaultModifierIndex: null, automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.search, executed: function execute(param) {
+ if (MS.Entertainment.Utilities.isApp2 && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped)
+ return;
+ param = param || {};
+ var defaultModifierIndex = this.defaultModifierIndex || param.defaultModifierIndex || 0;
+ MS.Entertainment.UI.Actions.SearchAction.lastDefaultModifierIndex = defaultModifierIndex;
+ if (param && param.queryText) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSubmitted({
+ queryText: param.queryText, defaultModifierIndex: defaultModifierIndex
+ })
+ }
+ else {
+ var commandingPopOver = MS.Entertainment.UI.Controls.CommandingPopOver;
+ var searchActionCommandingPopoverHidden = function() {
+ var existingQuery = String.empty;
+ if (this.startWithExistingQuery) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService.checkUserLocation(MS.Entertainment.UI.Monikers.searchPage))
+ existingQuery = MS.Entertainment.ViewModels.SearchContractViewModel.current.lastSearchedTerm
+ }
+ if (!MS.Entertainment.ViewModels.SearchContractViewModel.showSearchPane(existingQuery))
+ MS.Entertainment.UI.Controls.TextInputOverlay.getTextInput({
+ submitText: String.load(String.id.IDS_GLOBAL_COMMAND_SEARCH), watermark: String.load(String.id.IDS_GLOBAL_COMMAND_SEARCH), initialText: existingQuery || null
+ }).done(function(query) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSubmitted({
+ queryText: query, defaultModifierIndex: defaultModifierIndex
+ })
+ }.bind(this), function searchCancelled(){})
+ }.bind(this);
+ if (commandingPopOver)
+ commandingPopOver.hideCurrentCommandingPopover().done(searchActionCommandingPopoverHidden);
+ else
+ searchActionCommandingPopoverHidden()
+ }
+ }, canExecute: function canExecute() {
+ return true
+ }, startWithExistingQuery: false
+ }, {lastDefaultModifierIndex: 0})
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {ResetSearchFilterAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function resetSearchFilterActionConstructor() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.resetSearchFilter, executed: function executed(param) {
+ if (this.canExecute(param)) {
+ var viewModel = param.viewModel;
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.all;
+ viewModel.modifierSelectionManager.selectedIndex = MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter
+ }
+ }, canExecute: function canExecute(param) {
+ return param !== null && param !== undefined && param.viewModel !== null
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {ResetSearchHubAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function resetSearchFilterActionConstructor() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.resetSearchFilter, executed: function executed(param) {
+ if (this.canExecute(param)) {
+ var viewModel = param.viewModel;
+ if (viewModel)
+ viewModel.pivotSelectedIndexOverride = 0
+ }
+ }, canExecute: function canExecute(param) {
+ return param && param.viewModel !== null
+ }
+ })});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.search, function() {
+ return new MS.Entertainment.UI.Actions.SearchAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.searchByContext, function() {
+ return new MS.Entertainment.UI.Actions.SearchByContextAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.resetSearchFilter, function() {
+ return new MS.Entertainment.UI.Actions.ResetSearchFilterAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.resetSearchHub, function() {
+ return new MS.Entertainment.UI.Actions.ResetSearchHubAction
+ })
+})()
+})();
+/* >>>>>>/framework/data/virtuallistchangehandler.js:506 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var Data;
+ (function(Data) {
+ var VirtualListChangeHandler = (function() {
+ function VirtualListChangeHandler(virtualList) {
+ this._virtualList = virtualList;
+ this._eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._virtualList, {
+ itemChanged: this.onChanged.bind(this), itemInserted: this.onInserted.bind(this), itemMoved: this.onMoved.bind(this), itemRemoved: this.onRemoved.bind(this)
+ })
+ }
+ VirtualListChangeHandler.prototype.dispose = function() {
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ this._virtualList = null
+ };
+ Object.defineProperty(VirtualListChangeHandler.prototype, "virtualList", {
+ get: function() {
+ return this._virtualList
+ }, enumerable: true, configurable: true
+ });
+ VirtualListChangeHandler.prototype.onChanged = function(result){};
+ VirtualListChangeHandler.prototype.onMoved = function(result){};
+ VirtualListChangeHandler.prototype.onInserted = function(result){};
+ VirtualListChangeHandler.prototype.onRemoved = function(result){};
+ return VirtualListChangeHandler
+ })();
+ Data.VirtualListChangeHandler = VirtualListChangeHandler
+ })(Data = Entertainment.Data || (Entertainment.Data = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/components/moreaction.js:545 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Actions;
+ (function(Actions) {
+ var MoreAction = (function(_super) {
+ __extends(MoreAction, _super);
+ function MoreAction() {
+ _super.call(this);
+ this.hasSubActions = true
+ }
+ MoreAction.prototype.executed = function(param, referenceElement) {
+ if (referenceElement)
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: referenceElement}, {
+ uri: MS.Entertainment.Utilities.getCurrentUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ })
+ };
+ MoreAction.prototype.canExecute = function(param) {
+ return true
+ };
+ return MoreAction
+ })(MS.Entertainment.UI.Actions.Action);
+ Actions.MoreAction = MoreAction
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+(function() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.more, function() {
+ return new MS.Entertainment.UI.Actions.MoreAction
+ })
+})()
+})();
+/* >>>>>>/viewmodels/detailspageviewmodelbase.js:595 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var DetailsPageViewModelBase = (function(_super) {
+ __extends(DetailsPageViewModelBase, _super);
+ function DetailsPageViewModelBase() {
+ _super.apply(this, arguments);
+ this._delayInitialized = false;
+ this._delayInitializeSmartBuyEngine = true;
+ this._mediaItemHydratePromise = null;
+ this._viewStateViewModel = null;
+ this._smartBuyStateEngineType = ViewModels.SmartBuyStateEngine;
+ this._smartBuyStateEngineInitialized = false
+ }
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "mediaItem", {
+ get: function() {
+ return this._mediaItem
+ }, set: function(value) {
+ if (value !== this._mediaItem) {
+ this.updateAndNotify("mediaItem", value);
+ this._shareMediaItem()
+ }
+ this._refreshDetailString()
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "mediaItemDetails", {
+ get: function() {
+ return this._mediaItemDetails
+ }, set: function(value) {
+ this.updateAndNotify("mediaItemDetails", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "mediaItemPurchaseDetails", {
+ get: function() {
+ return this._mediaItemPurchaseDetails
+ }, set: function(value) {
+ this.updateAndNotify("mediaItemPurchaseDetails", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "collectionFilter", {
+ get: function() {
+ return this._collectionFilter
+ }, set: function(value) {
+ this._collectionFilter = value;
+ this._applyValueToModules("filterValue", value);
+ if (this._mediaContext)
+ this._mediaContext.collectionFilter = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "inCollection", {
+ get: function() {
+ return this.mediaItem && (this.mediaItem.inCollection || this.mediaItem.hasLibraryId)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "hasServiceId", {
+ get: function() {
+ return this.mediaItem && this.mediaItem.hasServiceId
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "smartBuyButtons", {
+ get: function() {
+ return this._smartBuyButtons
+ }, set: function(value) {
+ this.updateAndNotify("smartBuyButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DetailsPageViewModelBase.prototype, "filterDetails", {
+ get: function() {
+ return this._filterDetails
+ }, enumerable: true, configurable: true
+ });
+ DetailsPageViewModelBase.prototype.dispose = function() {
+ _super.prototype.dispose.call(this);
+ this._disposeSmartBuyStateEngine();
+ this._unshareMediaItem();
+ this._cancelMediaItemHydration()
+ };
+ DetailsPageViewModelBase.prototype.delayInitialize = function() {
+ _super.prototype.delayInitialize.call(this);
+ if (this._delayInitializeSmartBuyEngine)
+ this._initializeSmartBuyStateEngine(false);
+ this.modules.forEach(function(detailsModule) {
+ if (detailsModule.delayInitialize)
+ detailsModule.delayInitialize()
+ });
+ this._delayInitialized = true;
+ this._shareMediaItem()
+ };
+ DetailsPageViewModelBase.prototype.clearFilter = function() {
+ this.applyFilter(Microsoft.Entertainment.Platform.MediaAvailability.available)
+ };
+ DetailsPageViewModelBase.prototype.applyFilter = function(newFilter) {
+ this.collectionFilter = newFilter;
+ this._createSmartBuyStateEngine();
+ this._reloadFilteredModules();
+ this._updateFilterDetails();
+ this._reinitializeNotificationList()
+ };
+ DetailsPageViewModelBase.prototype._getContainingMediaContextOptions = function() {
+ return null
+ };
+ DetailsPageViewModelBase.prototype._getSmartBuyEngineAppBarHandlers = function() {
+ ViewModels.fail("_getSmartBuyEngineAppBarHandlers() should be overridden by the subclass.");
+ return null
+ };
+ DetailsPageViewModelBase.prototype._getSmartBuyEngineEventHandler = function() {
+ ViewModels.fail("_getSmartBuyEngineEventHandler() should be overridden by the subclass.");
+ return null
+ };
+ DetailsPageViewModelBase.prototype._getSmartBuyEngineButtons = function() {
+ ViewModels.fail("_getSmartBuyEngineButtons() should be overridden by the subclass.");
+ return null
+ };
+ DetailsPageViewModelBase.prototype._getSmartBuyEngineOptions = function() {
+ return {invokeHandlerAsStatic: true}
+ };
+ DetailsPageViewModelBase.prototype._refreshDetailString = function() {
+ ViewModels.fail("_refreshDetailString() should be overridden by the subclass.")
+ };
+ DetailsPageViewModelBase.prototype._refreshPurchaseDetailsString = function(stateInfo){};
+ DetailsPageViewModelBase.prototype._reloadFilteredModules = function() {
+ ViewModels.fail("_reloadFilteredModules() should be overridden by the subclass.")
+ };
+ DetailsPageViewModelBase.prototype._updateFilterDetails = function() {
+ ViewModels.fail("_updateFilterDetails() should be overridden by the subclass.")
+ };
+ DetailsPageViewModelBase.prototype._updateCatalogDetails = function(){};
+ DetailsPageViewModelBase.prototype._cancelMediaItemHydration = function() {
+ if (this._mediaItemHydratePromise) {
+ this._mediaItemHydratePromise.cancel();
+ this._mediaItemHydratePromise = null
+ }
+ };
+ DetailsPageViewModelBase.prototype._disposeSmartBuyStateEngine = function() {
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ if (this._smartBuyStateEngineBinding) {
+ this._smartBuyStateEngineBinding.cancel();
+ this._smartBuyStateEngineBinding = null
+ }
+ if (this._smartBuyStateEngine) {
+ this._smartBuyStateEngine.unload();
+ this._smartBuyStateEngine = null;
+ this._smartBuyStateEngineInitialized = false
+ }
+ };
+ DetailsPageViewModelBase.prototype._getGenericSmartBuyButtons = function() {
+ return null
+ };
+ DetailsPageViewModelBase.prototype._createSmartBuyStateEngine = function() {
+ var _this = this;
+ this._disposeSmartBuyStateEngine();
+ if (!this.mediaItem)
+ return;
+ var buttons = this._getGenericSmartBuyButtons();
+ this._smartBuyStateEngine = new this._smartBuyStateEngineType(buttons);
+ this._smartBuyStateEngineBinding = WinJS.Binding.bind(this._smartBuyStateEngine, {
+ currentAppbarActions: function() {
+ return _this._onAppbarActionsChanged()
+ }, currentButtons: function() {
+ return _this._onButtonsChanged()
+ }
+ })
+ };
+ DetailsPageViewModelBase.prototype._checkCanInitializeSmartBuyStateEngine = function() {
+ return true
+ };
+ DetailsPageViewModelBase.prototype._applyPropertiesToHydratedMedia = function(){};
+ DetailsPageViewModelBase.prototype._initializeSmartBuyStateEngine = function(initializeImmediately) {
+ var _this = this;
+ if (!initializeImmediately && !this._mediaItemHydratePromise || !this._checkCanInitializeSmartBuyStateEngine())
+ return;
+ if (!Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.appToolbar)) {
+ ViewModels.fail("DetailsPageViewModelBase::_initializeSmartBuyStateEngine. Appbar service not registered");
+ return
+ }
+ var hydratePromise = this._mediaItemHydratePromise;
+ if (initializeImmediately)
+ hydratePromise = WinJS.Promise.as();
+ hydratePromise.done(function(hydratedMediaItem) {
+ if (_this.disposed)
+ return;
+ _this.mediaItem = hydratedMediaItem;
+ _this._applyPropertiesToHydratedMedia();
+ var appBarService = Entertainment.ServiceLocator.getService(Entertainment.Services.appToolbar);
+ var mediaContext = appBarService.pushMediaContext(_this.mediaItem, _this._getSmartBuyEngineAppBarHandlers(), _this._smartBuyStateEngine.currentAppbarActions, {executeLocation: Entertainment.UI.Actions.ExecutionLocation.canvas});
+ mediaContext.collectionFilter = _this.collectionFilter || Microsoft.Entertainment.Platform.MediaAvailability.available;
+ var containingMediaContextOptions = _this._getContainingMediaContextOptions();
+ if (containingMediaContextOptions)
+ mediaContext.containingMedia = containingMediaContextOptions;
+ _this._mediaContext = mediaContext;
+ _this._applyValueToModules("mediaContext", mediaContext);
+ _this._smartBuyStateEngine.initialize(_this.mediaItem, _this._getSmartBuyEngineButtons(), _this._getSmartBuyEngineEventHandler(), _this._getSmartBuyEngineOptions());
+ _this._smartBuyStateEngineInitialized = true;
+ _this._updateFilterDetails();
+ _this._updateCatalogDetails()
+ }, function(error) {
+ _this.viewStateViewModel.viewState = -1;
+ ViewModels.fail("DetailsPageViewModelBase::_initializeSmartBuyStateEngine. Hydration failed. Error message: " + (error && error.message))
+ })
+ };
+ DetailsPageViewModelBase.prototype._unshareMediaItem = function() {
+ if (this._shareOperation) {
+ this._shareOperation.cancel();
+ this._shareOperation = null
+ }
+ };
+ DetailsPageViewModelBase.prototype._shareMediaItem = function() {
+ if (!Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.shareSender))
+ return;
+ this._unshareMediaItem();
+ if (this.mediaItem && this._delayInitialized) {
+ var sender = Entertainment.ServiceLocator.getService(Entertainment.Services.shareSender);
+ this._shareOperation = sender.pendingShare(this.mediaItem)
+ }
+ };
+ DetailsPageViewModelBase.prototype._applyValueToModules = function(propertyName, newValue) {
+ if (this.disposed || !this.modules)
+ return;
+ this.modules.forEach(function(detailsModule) {
+ var oldValue = WinJS.Utilities.getMember(propertyName, detailsModule);
+ if (oldValue !== undefined)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(detailsModule, propertyName, newValue)
+ })
+ };
+ DetailsPageViewModelBase.prototype._onAppbarActionsChanged = function() {
+ if (!this.disposed && this._mediaContext && this._smartBuyStateEngine)
+ this._mediaContext.setToolbarActions(this._smartBuyStateEngine.currentAppbarActions)
+ };
+ DetailsPageViewModelBase.prototype._onButtonsChanged = function() {
+ if (!this.disposed && this._smartBuyStateEngine)
+ this.smartBuyButtons = this._smartBuyStateEngine.currentButtons
+ };
+ DetailsPageViewModelBase.HEADER_BUTTON_LIST_LENGTH = 4;
+ return DetailsPageViewModelBase
+ })(ViewModels.PageViewModelBase);
+ ViewModels.DetailsPageViewModelBase = DetailsPageViewModelBase
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music/musicdetailspageviewmodelbase.js:854 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var MusicDetailsPageViewModelBase = (function(_super) {
+ __extends(MusicDetailsPageViewModelBase, _super);
+ function MusicDetailsPageViewModelBase() {
+ _super.apply(this, arguments);
+ this._genericPlayButton = null;
+ this._allTracksLocal = false;
+ this._allTracksStreaming = false;
+ this._someTracksStreamingSomeLocal = false
+ }
+ MusicDetailsPageViewModelBase.prototype._getGenericSmartBuyButtons = function() {
+ if (!this._genericPlayButton)
+ this._genericPlayButton = ViewModels.SmartBuyButtons.createGenericPlayButton();
+ var enablePlayButton = this.inCollection || this.isOnline;
+ return (enablePlayButton) ? [this._genericPlayButton] : null
+ };
+ MusicDetailsPageViewModelBase.prototype._applyPropertiesToHydratedMedia = function() {
+ this.mediaItem.tracks = this._getTracksForSmartBuyEngine()
+ };
+ MusicDetailsPageViewModelBase.prototype._getTracksForSmartBuyEngine = function() {
+ ViewModels.fail("_getTracksForSmartBuyEngine() should be overridden by the subclass.");
+ return null
+ };
+ MusicDetailsPageViewModelBase.prototype._updateTrackLocationValues = function(playabilityCounts) {
+ if (playabilityCounts) {
+ this._allTracksLocal = playabilityCounts.localOnly > 0 && playabilityCounts.localOnly === playabilityCounts.localOrCloud;
+ this._allTracksStreaming = playabilityCounts.cloudOnly > 0 && playabilityCounts.cloudOnly === playabilityCounts.localOrCloud;
+ this._someTracksStreamingSomeLocal = playabilityCounts.cloudOnly > 0 && playabilityCounts.cloudOnly !== playabilityCounts.localOrCloud
+ }
+ };
+ return MusicDetailsPageViewModelBase
+ })(ViewModels.DetailsPageViewModelBase);
+ ViewModels.MusicDetailsPageViewModelBase = MusicDetailsPageViewModelBase
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music/listeditactions.js:909 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var EditListAction = (function(_super) {
+ __extends(EditListAction, _super);
+ function EditListAction() {
+ _super.apply(this, arguments);
+ this.__executing = false
+ }
+ Object.defineProperty(EditListAction.prototype, "action", {
+ get: function() {
+ return this
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditListAction.prototype, "title", {
+ get: function() {
+ return String.load(this.titleStringId)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditListAction.prototype, "_executing", {
+ get: function() {
+ return this.__executing
+ }, set: function(value) {
+ if (this.__executing !== value) {
+ this.__executing = value;
+ this.requeryCanExecute()
+ }
+ }, enumerable: true, configurable: true
+ });
+ EditListAction.prototype.canExecute = function(param) {
+ var list = this._extractList();
+ var hasList = !!list;
+ var hasIndex = this._isValidIndex(this._extractIndex(), list);
+ this._updateListHandler(list);
+ return hasList && hasIndex && !this._executing
+ };
+ EditListAction.prototype._extractList = function() {
+ var list;
+ if (this.parameter && this.parameter.listViewModel && this.parameter.listViewModel.items && this.parameter.listViewModel.items instanceof MS.Entertainment.Data.VirtualList)
+ list = this.parameter.listViewModel.items;
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appToolbar)) {
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ if (mediaContext && mediaContext.options && mediaContext.options.containingMedia && mediaContext.options.containingMedia instanceof MS.Entertainment.UI.EditableContainingMedia)
+ list = (mediaContext.options.containingMedia).editableItemSource
+ }
+ if (list && !(list instanceof MS.Entertainment.Data.VirtualList)) {
+ MS.Entertainment.ViewModels.fail("List edit action only supports virtual lists");
+ list = null
+ }
+ return list
+ };
+ EditListAction.prototype._extractKey = function() {
+ var key = null;
+ if (this.parameter && this.parameter.key)
+ key = this.parameter.key;
+ return key
+ };
+ EditListAction.prototype._extractIndex = function() {
+ var index = -1;
+ var key = this._extractKey();
+ var list;
+ if (key)
+ list = this._extractList();
+ if (key && list && list.indexFromKey)
+ index = list.indexFromKey(key);
+ else if (this.parameter && this.parameter.index >= 0)
+ index = this.parameter.index;
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appToolbar)) {
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ index = mediaContext && mediaContext.options && mediaContext.options.containingMedia && mediaContext.options.containingMedia.playbackOffset
+ }
+ if (typeof index !== "number" || isNaN(index))
+ index = -1;
+ return index
+ };
+ EditListAction.prototype._extractMultiSelection = function() {
+ var mediaContext;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appToolbar))
+ mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ var selection = mediaContext && mediaContext.options && mediaContext.options.containingMedia && mediaContext.options.containingMedia.playbackSelectionRanges;
+ if (!Array.isArray(selection) || selection.length === 0)
+ selection = null;
+ return selection
+ };
+ EditListAction.prototype._dispatchAction = function() {
+ var mediaContext;
+ if (Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.appToolbar))
+ mediaContext = Entertainment.ServiceLocator.getService(Entertainment.Services.appToolbar).currentMediaContext;
+ if (mediaContext && mediaContext.dispatchEvent)
+ mediaContext.dispatchEvent(this.id)
+ };
+ EditListAction.prototype._dispatchExecutingAction = function() {
+ var mediaContext;
+ if (Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.appToolbar))
+ mediaContext = Entertainment.ServiceLocator.getService(Entertainment.Services.appToolbar).currentMediaContext;
+ if (mediaContext && mediaContext.dispatchEvent)
+ mediaContext.dispatchEvent(this.id + "Executing")
+ };
+ EditListAction.prototype._isValidIndex = function(index, list) {
+ MS.Entertainment.ViewModels.fail("Abstract method, _isValidIndex, must be defined");
+ return false
+ };
+ EditListAction.prototype._updateListHandler = function(list) {
+ if (this._listHandler) {
+ this._listHandler.cancel();
+ this._listHandler = null
+ }
+ if (list) {
+ var requeryCanExecute = this.requeryCanExecute.bind(this);
+ this._listHandler = MS.Entertainment.Utilities.addEventHandlers(list, {
+ itemInserted: requeryCanExecute, itemMoved: requeryCanExecute, itemRemoved: requeryCanExecute
+ })
+ }
+ };
+ return EditListAction
+ })(MS.Entertainment.UI.Actions.Action);
+ ViewModels.EditListAction = EditListAction;
+ var DeleteListItem = (function(_super) {
+ __extends(DeleteListItem, _super);
+ function DeleteListItem() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_PLAYLIST_REMOVE;
+ this.icon = WinJS.UI.AppBarIcon.remove;
+ this.id = MS.Entertainment.UI.AppBarActions.removeFromList;
+ this.automationId = MS.Entertainment.UI.AutomationIds.removeFromList
+ }
+ DeleteListItem.prototype.canExecute = function(param) {
+ var returnValue = false;
+ if (!!this._extractMultiSelection())
+ returnValue = !!this._extractList() && !this._executing;
+ else
+ returnValue = _super.prototype.canExecute.call(this, param);
+ return returnValue
+ };
+ DeleteListItem.prototype.executed = function(param) {
+ var selection = this._extractMultiSelection();
+ if (selection)
+ this._executeMultiSelection(param, selection);
+ else
+ this._executeSingleSelection(param)
+ };
+ DeleteListItem.prototype._onDeletionCompleted = function(param, indexToRemove, removed) {
+ if (param && param.postExecute)
+ param.postExecute(indexToRemove, removed);
+ var mediaContext;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appToolbar))
+ mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ if (mediaContext)
+ mediaContext.dispatchEvent(this.id, {
+ removedIndices: indexToRemove, complete: removed
+ })
+ };
+ DeleteListItem.prototype._executeMultiSelection = function(param, selection) {
+ var _this = this;
+ var list = this._extractList();
+ if (list && selection) {
+ this._executing = true;
+ list.removeRanges(selection).done(function() {
+ _this._executing = false;
+ _this._onDeletionCompleted(param, -1, true)
+ }, function(error) {
+ MS.Entertainment.ViewModels.fail("Remove from selection failed. error: " + (error && error.message));
+ _this._executing = false;
+ _this._onDeletionCompleted(param, -1, false)
+ })
+ }
+ else
+ this._onDeletionCompleted(param, -1, false)
+ };
+ DeleteListItem.prototype._executeSingleSelection = function(param) {
+ var _this = this;
+ var list = this._extractList();
+ var oldIndex = this._extractIndex();
+ if (list && this._isValidIndex(oldIndex, list)) {
+ this._executing = true;
+ list.removeAt(oldIndex).done(function() {
+ _this._executing = false;
+ _this._onDeletionCompleted(param, oldIndex, true)
+ }, function(error) {
+ MS.Entertainment.ViewModels.fail("Remove failed. index: " + oldIndex + " error: " + (error && error.message));
+ _this._executing = false;
+ _this._onDeletionCompleted(param, oldIndex, false)
+ })
+ }
+ else
+ this._onDeletionCompleted(param, oldIndex, false)
+ };
+ DeleteListItem.prototype._isValidIndex = function(index, list) {
+ var count = list && list.count;
+ return index >= 0 && index <= count
+ };
+ return DeleteListItem
+ })(EditListAction);
+ ViewModels.DeleteListItem = DeleteListItem;
+ var MoveListItem = (function(_super) {
+ __extends(MoveListItem, _super);
+ function MoveListItem() {
+ _super.apply(this, arguments)
+ }
+ MoveListItem.prototype.executed = function(param) {
+ var _this = this;
+ var list = this._extractList();
+ var oldIndex = this._extractIndex();
+ var newIndex = this._getNewIndex(oldIndex);
+ var postAction = param && param.postExecute;
+ if (list && this._isValidIndex(oldIndex, list)) {
+ this._executing = true;
+ this._dispatchExecutingAction();
+ list.moveAt(oldIndex, newIndex).done(function(moveResult) {
+ MS.Entertainment.ViewModels.assert(moveResult && moveResult.data, "Move didn't return a valid result");
+ _this._dispatchAction();
+ _this._executing = false;
+ if (postAction)
+ postAction(oldIndex, moveResult && moveResult.itemIndex)
+ }, function(error) {
+ MS.Entertainment.ViewModels.fail("Move failed. old index: " + oldIndex + " new index: " + newIndex + " error: " + (error && error.message));
+ _this._executing = false;
+ if (postAction)
+ postAction(oldIndex, oldIndex)
+ })
+ }
+ else if (postAction)
+ postAction(oldIndex, oldIndex)
+ };
+ MoveListItem.prototype._getNewIndex = function(index) {
+ MS.Entertainment.ViewModels.fail("Abstract method, _getNewIndex, must be defined");
+ return index
+ };
+ return MoveListItem
+ })(EditListAction);
+ ViewModels.MoveListItem = MoveListItem;
+ var MoveListItemUp = (function(_super) {
+ __extends(MoveListItemUp, _super);
+ function MoveListItemUp() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_PLAYLIST_MOVE_UP_SC;
+ this.icon = MS.Entertainment.UI.Icon.chevronUp;
+ this.id = MS.Entertainment.UI.AppBarActions.moveListItemUp;
+ this.automationId = MS.Entertainment.UI.AutomationIds.moveListItemUp
+ }
+ MoveListItemUp.prototype._isValidIndex = function(index, list) {
+ var count = list && list.count;
+ return index > 0 && index <= count
+ };
+ MoveListItemUp.prototype._getNewIndex = function(index) {
+ return index - 1
+ };
+ return MoveListItemUp
+ })(MoveListItem);
+ ViewModels.MoveListItemUp = MoveListItemUp;
+ var MoveListItemToBottom = (function(_super) {
+ __extends(MoveListItemToBottom, _super);
+ function MoveListItemToBottom() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_PLAYLIST_MOVE_TO_BOTTOM_SC;
+ this.icon = MS.Entertainment.UI.Icon.moveToBottom;
+ this.iconInfo = {className: "icon-moveToBottom"};
+ this.id = MS.Entertainment.UI.AppBarActions.moveListItemToBottom;
+ this.automationId = MS.Entertainment.UI.AutomationIds.moveListItemToBottom
+ }
+ MoveListItemToBottom.prototype._isValidIndex = function(index, list) {
+ var count = list && list.count;
+ return index >= 0 && index < count - 1
+ };
+ MoveListItemToBottom.prototype._getNewIndex = function(index) {
+ var list = this._extractList();
+ return list.count
+ };
+ return MoveListItemToBottom
+ })(MoveListItem);
+ ViewModels.MoveListItemToBottom = MoveListItemToBottom;
+ var MoveListItemToTop = (function(_super) {
+ __extends(MoveListItemToTop, _super);
+ function MoveListItemToTop() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_PLAYLIST_MOVE_TO_TOP_SC;
+ this.icon = MS.Entertainment.UI.Icon.moveToTop;
+ this.iconInfo = {className: "icon-moveToTop"};
+ this.id = MS.Entertainment.UI.AppBarActions.moveListItemToTop;
+ this.automationId = MS.Entertainment.UI.AutomationIds.moveListItemToTop
+ }
+ MoveListItemToTop.prototype._isValidIndex = function(index, list) {
+ var count = list && list.count;
+ return index > 0 && index <= count
+ };
+ MoveListItemToTop.prototype._getNewIndex = function(index) {
+ return 0
+ };
+ return MoveListItemToTop
+ })(MoveListItem);
+ ViewModels.MoveListItemToTop = MoveListItemToTop;
+ var MoveListItemDown = (function(_super) {
+ __extends(MoveListItemDown, _super);
+ function MoveListItemDown() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_PLAYLIST_MOVE_DOWN_SC;
+ this.icon = MS.Entertainment.UI.Icon.chevronDown;
+ this.id = MS.Entertainment.UI.AppBarActions.moveListItemDown;
+ this.automationId = MS.Entertainment.UI.AutomationIds.moveListItemDown
+ }
+ MoveListItemDown.prototype._isValidIndex = function(index, list) {
+ var count = list && list.count;
+ return index >= 0 && index < count - 1
+ };
+ MoveListItemDown.prototype._getNewIndex = function(index) {
+ return index + 2
+ };
+ return MoveListItemDown
+ })(MoveListItem);
+ ViewModels.MoveListItemDown = MoveListItemDown;
+ var DeletePlaylistItem = (function(_super) {
+ __extends(DeletePlaylistItem, _super);
+ function DeletePlaylistItem() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.playlistRemoveFromPlaylist
+ }
+ return DeletePlaylistItem
+ })(DeleteListItem);
+ ViewModels.DeletePlaylistItem = DeletePlaylistItem;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.removeFromList, function() {
+ return new DeleteListItem
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.moveListItemDown, function() {
+ return new MoveListItemDown
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.moveListItemToBottom, function() {
+ return new MoveListItemToBottom
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.moveListItemToTop, function() {
+ return new MoveListItemToTop
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.moveListItemUp, function() {
+ return new MoveListItemUp
+ })
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music1/metadataeditactions.js:1264 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Actions;
+ (function(Actions) {
+ var ViewModels = MS.Entertainment.ViewModels;
+ var MetadataEditedDetail = (function() {
+ function MetadataEditedDetail(editedMediaItem) {
+ this.editedMediaItem = editedMediaItem
+ }
+ return MetadataEditedDetail
+ })();
+ Actions.MetadataEditedDetail = MetadataEditedDetail;
+ var EditMetadata = (function(_super) {
+ __extends(EditMetadata, _super);
+ function EditMetadata() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_MUSIC_EDIT_METADATA_ALBUM_ACTION;
+ this.icon = WinJS.UI.AppBarIcon.edit;
+ this.id = MS.Entertainment.UI.AppBarActions.editMetadata;
+ this.automationId = MS.Entertainment.UI.AutomationIds.editMetadata
+ }
+ Object.defineProperty(EditMetadata.prototype, "action", {
+ get: function() {
+ return this
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditMetadata.prototype, "title", {
+ get: function() {
+ return String.load(this.titleStringId)
+ }, enumerable: true, configurable: true
+ });
+ EditMetadata.prototype.canExecute = function(param) {
+ var mediaItem = this._extractMediaItem(param);
+ return mediaItem && (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ };
+ EditMetadata.prototype.executed = function(param) {
+ var _this = this;
+ var mediaItem = this._extractMediaItem(param);
+ if (this._metadataEditor)
+ this._metadataEditor.dispose();
+ var showDialogPromise;
+ switch (mediaItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ showDialogPromise = this._showAlbumDialog(mediaItem);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ showDialogPromise = this._showTrackDialog(mediaItem);
+ break;
+ default:
+ showDialogPromise = WinJS.Promise.wrapError(new Error("EditMetadata::executed() Invalid media type. Please check canExecute, as we shouldn't have gotten here. mediaType " + mediaItem.mediaType))
+ }
+ showDialogPromise.then(null, function(error) {
+ MS.Entertainment.UI.Actions.fail("EditMetadata::executed() Something went really wrong when showing the metadata edit dialog. " + "Error: " + (error && error.message))
+ }).done(function() {
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ if (_this._metadataEditor) {
+ _this._metadataEditor.dispose();
+ _this._metadataEditor = null
+ }
+ if (mediaContext)
+ mediaContext.dispatchEvent(_this.id, new MetadataEditedDetail(mediaItem))
+ })
+ };
+ EditMetadata.prototype._showAlbumDialog = function(mediaItem) {
+ this._metadataEditor = new ViewModels.AlbumMetadataEditor(mediaItem);
+ this._metadataEditor.load().done(null, function(error) {
+ MS.Entertainment.UI.Actions.fail("EditMetadata::_showAlbumDialog() failed to load metadata. Error: " + (error && error.message))
+ });
+ return MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_MUSIC_EDIT_METADATA_ALBUM_DIALOG_TITLE), "MS.Entertainment.UI.Controls.AlbumMetadataEditDialogContent", {
+ width: "100%", height: "410px", defaultButtonIndex: 0, buttons: [this._createSaveButton(), this._createCancelButton()], userControlOptions: {dataContext: this._metadataEditor}
+ }).then(null, function(error) {
+ MS.Entertainment.UI.Actions.fail("EditMetadata::_showAlbumDialog. Failed to save metadata changed. Error: " + (error && error.message))
+ })
+ };
+ EditMetadata.prototype._showTrackDialog = function(mediaItem) {
+ this._metadataEditor = new ViewModels.TrackMetadataEditor(mediaItem);
+ this._metadataEditor.load().done(null, function(error) {
+ MS.Entertainment.UI.Actions.fail("EditMetadata::_showTrackDialog() failed to load metadata. Error: " + (error && error.message))
+ });
+ return MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_MUSIC_EDIT_METADATA_SONG_DIALOG_TITLE), "MS.Entertainment.UI.Controls.TrackMetadataEditDialogContent", {
+ width: "100%", height: "410px", defaultButtonIndex: 0, buttons: [this._createSaveButton(), this._createCancelButton()], userControlOptions: {dataContext: this._metadataEditor}
+ }).then(null, function(error) {
+ MS.Entertainment.UI.Actions.fail("EditMetadata::_showTrackDialog. Failed to save metadata changed. Error: " + (error && error.message))
+ })
+ };
+ EditMetadata.prototype._extractMediaItem = function(param) {
+ var mediaItem = null;
+ if (param && param.mediaItem)
+ mediaItem = param.mediaItem;
+ else {
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ if (mediaContext && mediaContext.mediaItem instanceof MS.Entertainment.Data.VirtualList) {
+ var list = mediaContext.mediaItem;
+ if (list.count)
+ list.itemsFromIndex(0, 0, 0).done(function(args) {
+ mediaItem = args.items && args.items[0] && args.items[0].data
+ }, function(){})
+ }
+ else if (mediaContext && mediaContext.mediaItem)
+ mediaItem = (mediaContext.mediaItem)
+ }
+ if (Array.isArray(mediaItem))
+ mediaItem = mediaItem[0];
+ else if (MS.Entertainment.Data.List.isList(mediaItem)) {
+ var synchronous = false;
+ MS.Entertainment.Data.List.getData(mediaItem, 0).done(function(data) {
+ synchronous = true;
+ mediaItem = data
+ }, function(){});
+ MS.Entertainment.UI.Actions.assert(synchronous, "EditMetadata::_extractMediaItem() Getting list data was not synchronous")
+ }
+ return mediaItem
+ };
+ EditMetadata.prototype._createCancelButton = function() {
+ return {
+ title: String.load(String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_CANCEL), execute: this._onCancel.bind(this)
+ }
+ };
+ EditMetadata.prototype._createSaveButton = function() {
+ return {
+ title: String.load(String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_SAVE), execute: this._onSave.bind(this)
+ }
+ };
+ EditMetadata.prototype._onCancel = function(dialog) {
+ if (this._metadataEditor)
+ this._metadataEditor.cancel();
+ dialog.hide()
+ };
+ EditMetadata.prototype._onSave = function(dialog) {
+ if (this._metadataEditor) {
+ this._metadataEditor.validate();
+ if (this._metadataEditor.isValid)
+ this._metadataEditor.save().then(null, function(error) {
+ MS.Entertainment.UI.Actions.fail("EditMetadata::_onSave failed to save metadata. Error: " + (error && error.message))
+ }).done(function() {
+ dialog.hide()
+ })
+ }
+ };
+ return EditMetadata
+ })(Actions.Action);
+ Actions.EditMetadata = EditMetadata;
+ var EditMetadataImage = (function(_super) {
+ __extends(EditMetadataImage, _super);
+ function EditMetadataImage() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_BUTTON;
+ this.id = MS.Entertainment.UI.AppBarActions.editMetadataImage;
+ this.automationId = MS.Entertainment.UI.AutomationIds.editMetadataImage
+ }
+ Object.defineProperty(EditMetadataImage.prototype, "action", {
+ get: function() {
+ return this
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditMetadataImage.prototype, "title", {
+ get: function() {
+ return String.load(this.titleStringId)
+ }, enumerable: true, configurable: true
+ });
+ EditMetadataImage.prototype.canExecute = function(param) {
+ var field = this._extractMetadataField(param);
+ return !!(field && field.value)
+ };
+ EditMetadataImage.prototype.executed = function(param) {
+ var openPicker = new Windows.Storage.Pickers.FileOpenPicker;
+ openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail;
+ openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
+ var field = this._extractMetadataField(param);
+ openPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg", ".jpe", ".jfif", ".bmp", ".dip", ".gif", ".tif", ".tiff", ".mp3", ".wma"]);
+ return openPicker.pickSingleFileAsync().then(function(file) {
+ if (file) {
+ var newValue = field.value.copy();
+ newValue.storageFile = file;
+ field.value = newValue
+ }
+ }, function(){})
+ };
+ EditMetadataImage.prototype._extractMetadataField = function(param) {
+ var field = null;
+ if (param && param instanceof ViewModels.MetadataImageValueField)
+ field = param;
+ else if (param && param.field)
+ field = param.field;
+ return field
+ };
+ return EditMetadataImage
+ })(MS.Entertainment.UI.Actions.Action);
+ Actions.EditMetadataImage = EditMetadataImage;
+ var EditMetadataMatchAlbumInfo = (function(_super) {
+ __extends(EditMetadataMatchAlbumInfo, _super);
+ function EditMetadataMatchAlbumInfo() {
+ _super.apply(this, arguments);
+ this.titleStringId = String.id.IDS_MATCH_ALBUM_INFO_COMMAND;
+ this.id = MS.Entertainment.UI.AppBarActions.editMetadataMatchAlbumInfo;
+ this.automationId = MS.Entertainment.UI.AutomationIds.editMetadataMatchAlbumInfo
+ }
+ Object.defineProperty(EditMetadataMatchAlbumInfo.prototype, "_matchAlbumInfoAction", {
+ get: function() {
+ if (!this.__matchAlbumInfoAction) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ this.__matchAlbumInfoAction = actionService.getAction(Actions.ActionIdentifiers.findAlbumInfo)
+ }
+ return this.__matchAlbumInfoAction
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditMetadataMatchAlbumInfo.prototype, "action", {
+ get: function() {
+ return this
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditMetadataMatchAlbumInfo.prototype, "title", {
+ get: function() {
+ return String.load(this.titleStringId)
+ }, enumerable: true, configurable: true
+ });
+ EditMetadataMatchAlbumInfo.prototype.canExecute = function(param) {
+ return this._matchAlbumInfoAction.canExecute(param)
+ };
+ EditMetadataMatchAlbumInfo.prototype.executed = function(param) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("dismissoverlay", true, true);
+ var metadataEditDialog = WinJS.Binding.unwrap(param.referenceElement);
+ MS.Entertainment.UI.assert(metadataEditDialog, "Expected metadata editor in the DOM for this action.");
+ if (metadataEditDialog)
+ metadataEditDialog.dispatchEvent(domEvent);
+ this._matchAlbumInfoAction.executed(param)
+ };
+ return EditMetadataMatchAlbumInfo
+ })(Actions.Action);
+ Actions.EditMetadataMatchAlbumInfo = EditMetadataMatchAlbumInfo;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ if (actionService) {
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.editMetadata, function() {
+ return new MS.Entertainment.UI.Actions.EditMetadata
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.editMetadataImage, function() {
+ return new MS.Entertainment.UI.Actions.EditMetadataImage
+ });
+ actionService.register(Actions.ActionIdentifiers.editMetadataMatchAlbumInfo, function() {
+ return new MS.Entertainment.UI.Actions.EditMetadataMatchAlbumInfo
+ })
+ }
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/mediastoreservice.js:1530 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var MediaStoreService = (function() {
+ function MediaStoreService(){}
+ MediaStoreService.createMediaStoreService = function() {
+ return new MediaStoreService
+ };
+ MediaStoreService.prototype.getPlaylistProvider = function() {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ return mediaStore.playlistProvider
+ };
+ return MediaStoreService
+ })();
+ ViewModels.MediaStoreService = MediaStoreService
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.mediaStore, MS.Entertainment.ViewModels.MediaStoreService.createMediaStoreService)
+})();
+/* >>>>>>/viewmodels/syncmanagerservice.js:1557 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var SyncManagerService = (function() {
+ function SyncManagerService(){}
+ SyncManagerService.createSyncManager = function() {
+ return new SyncManagerService
+ };
+ SyncManagerService.prototype.getSyncManager = function() {
+ return new Microsoft.Entertainment.Sync.SyncManager
+ };
+ return SyncManagerService
+ })();
+ ViewModels.SyncManagerService = SyncManagerService
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.syncManager, MS.Entertainment.ViewModels.SyncManagerService.createSyncManager)
+})();
+/* >>>>>>/components/music/freeplaylimits.js:1583 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var Music;
+ (function(Music) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Music");
+ var FreePlayLimits = (function() {
+ function FreePlayLimits() {
+ this._musicLimitsManager = null;
+ this._listeners = {};
+ this._collectionFilterListeners = [];
+ this._isMonthlyFreeLimitExceeded = false;
+ this._isFreeTrialCompleted = false;
+ this._eventBindings = null;
+ this._queuedCollectionFilterEvent = null;
+ this._signInBindings = null;
+ this._signedInUserBindings = null;
+ this._initialized = false;
+ this._initializedTimeout = null;
+ this._sessionManager = null
+ }
+ FreePlayLimits.prototype.initialize = function() {
+ var _this = this;
+ if (!this._initialized) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay)) {
+ this._initialized = true;
+ this._musicLimitsManager = Microsoft.Entertainment.Limits.MusicLimitsManager;
+ this._isMonthlyFreeLimitExceeded = this._musicLimitsManager.isMonthlyFreeLimitExceeded;
+ this._isFreeTrialCompleted = this._musicLimitsManager.isFreeTrialCompleted;
+ this._sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signInBindings = WinJS.Binding.bind(signIn, {isSignedIn: function() {
+ return _this._onSignInStateChanged()
+ }});
+ this._initializedTimeout = WinJS.Promise.timeout(3000)
+ }
+ }
+ };
+ FreePlayLimits.prototype._currentMediaChanged = function() {
+ if (!WinJS.Utilities.getMember("MS.Entertainment.Music2.UpsellDialogOverlay") || !WinJS.Utilities.getMember("_sessionManager.primarySession.currentMedia", this))
+ return;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser.xuid && !signedInUser.isSubscription)
+ this.getLimits().done(function(limits) {
+ var tracksLeft = limits.totalUnauthenticatedTrackAllowance - limits.totalUnauthenticatedTracksUsed;
+ if (tracksLeft > 0)
+ MS.Entertainment.Music2.UpsellDialogOverlay.showTracksLeft(tracksLeft)
+ }, function(error) {
+ MS.Entertainment.Music.fail("getLimits query failed " + (error && error.message))
+ })
+ };
+ FreePlayLimits.prototype.dispose = function() {
+ if (this._signInBindings) {
+ this._signInBindings.cancel();
+ this._signInBindings = null
+ }
+ if (this._signedInUserBindings) {
+ this._signedInUserBindings.cancel();
+ this._signedInUserBindings = null
+ }
+ };
+ Object.defineProperty(FreePlayLimits.prototype, "isMonthlyFreeLimitExceeded", {
+ get: function() {
+ return this._isMonthlyFreeLimitExceeded
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(FreePlayLimits.prototype, "isFreeTrialCompleted", {
+ get: function() {
+ return this._isFreeTrialCompleted
+ }, enumerable: true, configurable: true
+ });
+ FreePlayLimits.prototype.attachListener = function(serviceMediaId, listener) {
+ MS.Entertainment.Music.assert(!MS.Entertainment.Utilities.isEmptyGuid(serviceMediaId), "serviceMediaId param not valid");
+ MS.Entertainment.Music.assert(listener instanceof Function, "listener param is not a function");
+ var listeners = this._listeners[serviceMediaId];
+ if (!listeners)
+ this._listeners[serviceMediaId] = [listener];
+ else
+ listeners.push(listener)
+ };
+ FreePlayLimits.prototype.detachListener = function(serviceMediaId, listener) {
+ MS.Entertainment.Music.assert(!MS.Entertainment.Utilities.isEmptyGuid(serviceMediaId), "serviceMediaId param not valid");
+ MS.Entertainment.Music.assert(listener instanceof Function, "listener param is not a function");
+ var listeners = this._listeners[serviceMediaId];
+ if (listeners)
+ if (listeners.length === 1) {
+ MS.Entertainment.Music.assert(listeners[0] === listener, "listener not attached");
+ if (listeners[0] === listener)
+ delete this._listeners[serviceMediaId]
+ }
+ else {
+ var index = listeners.indexOf(listener);
+ MS.Entertainment.Music.assert(index >= 0, "listener not attached");
+ if (index >= 0)
+ listeners.splice(index, 1)
+ }
+ };
+ FreePlayLimits.prototype.addCollectionFilterListener = function(listener) {
+ var _this = this;
+ MS.Entertainment.Music.assert(listener instanceof Function, "listener param is not a function");
+ MS.Entertainment.Music.assert(this._collectionFilterListeners.indexOf(listener) === -1, "listener already attached");
+ this._collectionFilterListeners.push(listener);
+ if (this._queuedCollectionFilterEvent) {
+ this._sendCollectionFilterEvent(this._queuedCollectionFilterEvent);
+ this._queuedCollectionFilterEvent = null
+ }
+ return {cancel: function() {
+ var index = _this._collectionFilterListeners.indexOf(listener);
+ if (index >= 0)
+ _this._collectionFilterListeners.splice(index, 1)
+ }}
+ };
+ FreePlayLimits.prototype.showFreeTrackLimitExceededDialog = function(mediaItem) {
+ var _this = this;
+ return this._hydrateMedia(mediaItem).then(function() {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.freeTrackLimitExceeded);
+ var streamingTrackLimitDialogTitle = String.empty;
+ var streamingTrackLimitDialogBody = String.empty;
+ var purchasableMediaItem = null;
+ var actions = _this._getMediaItemActions(mediaItem);
+ var freeIndividualTrackAllowance = _this._musicLimitsManager.freeIndividualTrackAllowance;
+ var includeTrackAllowanceText = freeIndividualTrackAllowance > 0;
+ if (mediaItem && mediaItem.name && mediaItem.artistName && (actions.canBuyTrack || actions.canBuyAlbum)) {
+ streamingTrackLimitDialogTitle = String.load(String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_TITLE).format(mediaItem.name, mediaItem.artistName);
+ streamingTrackLimitDialogBody = includeTrackAllowanceText ? String.load(String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY).format(freeIndividualTrackAllowance) : String.load(String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY_NO_COUNT);
+ purchasableMediaItem = actions.mediaItem
+ }
+ else {
+ streamingTrackLimitDialogTitle = String.load(String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_TITLE);
+ streamingTrackLimitDialogBody = includeTrackAllowanceText ? String.load(String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY).format(freeIndividualTrackAllowance) : String.load(String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY_NO_COUNT)
+ }
+ return MS.Entertainment.Music.MusicBrandDialog.show(streamingTrackLimitDialogTitle, streamingTrackLimitDialogBody, null, actions.buttons, null, purchasableMediaItem)
+ })
+ };
+ FreePlayLimits.prototype.showMonthlyFreeLimitExceededDialog = function(mediaItem) {
+ var _this = this;
+ return this._hydrateMedia(mediaItem).then(function() {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.monthlyFreeLimitExceeded);
+ var contentLink = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ contentLink = {
+ title: String.load(String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_PC_FILTER_LINK), accessabilityTitle: String.load(String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_PC_FILTER_LINK), isEnabled: true, canExecute: function canExecute() {
+ return true
+ }, execute: function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var currentPage = navigationService.currentPage;
+ var event = MS.Entertainment.ViewModels.MusicCollectionAutomationIds.collectionFilterAvailableOffline;
+ if (currentPage && currentPage.iaNode && currentPage.iaNode.moniker !== MS.Entertainment.UI.Monikers.musicCollection) {
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.musicCollection, MS.Entertainment.UI.Monikers.musicCollectionByAlbum, null, {selectHub: true});
+ _this._queueCollectionFilterEvent(event)
+ }
+ else
+ _this._sendCollectionFilterEvent(event)
+ }
+ };
+ var actions = _this._getMediaItemActions(mediaItem);
+ var monthlyFreeHoursAllowance = _this._getMonthlyFreeHoursAllowance();
+ var dateFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).dayMonthYear;
+ var nextMonthlyFreeLimitResetDate = String.empty;
+ try {
+ nextMonthlyFreeLimitResetDate = dateFormatter.format(new Date(_this._musicLimitsManager.nextMonthlyFreeLimitResetDate))
+ }
+ catch(error) {
+ MS.Entertainment.Music.fail("showMonthlyFreeLimitExceededDialog has failed because date parse failed. Error message = " + (error && error.message))
+ }
+ var monthlyHoursPluralFormatString = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_PLURAL, monthlyFreeHoursAllowance);
+ return MS.Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_TITLE), monthlyHoursPluralFormatString.format(monthlyFreeHoursAllowance, nextMonthlyFreeLimitResetDate), contentLink, actions.buttons, null, actions.mediaItem)
+ })
+ };
+ FreePlayLimits.prototype.showTravelLimitExceededDialog = function() {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.travelLimitReached);
+ return MS.Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_TRAVEL_LIMIT_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_TRAVEL_LIMIT_DESC), null, [MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.subscribe, MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.ok])
+ };
+ FreePlayLimits.prototype.showUnauthenticatedFreeLimitExceededDialog = function() {
+ if (WinJS.Utilities.getMember("MS.Entertainment.Music2.UpsellDialogOverlay")) {
+ var music2 = MS.Entertainment;
+ music2 = music2.Music2;
+ return music2.UpsellDialogOverlay.showTracksLeft(0)
+ }
+ else {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.unauthenticatedTrackLimitExceeded);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlayAnonymous))
+ return MS.Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC), null, [MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.signUp, MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.cancel]);
+ else if (configurationManager.service.lastSignedInUserXuid)
+ return MS.Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC), null, [MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.signInNowForExistingUser, MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.cancel]);
+ else {
+ var adService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ var showMusicBrandDialog = function showBrandedDialog() {
+ return MS.Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC), null, [MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.signInNowForNewUser, MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.cancel])
+ };
+ if (!configurationManager.music.anonymousLimitReachedVideoShown && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlayAnonAds)) {
+ configurationManager.music.anonymousLimitReachedVideoShown = true;
+ var showAdPromise;
+ var uiStateChanged;
+ var uiStateServiceBindings;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ uiStateChanged = function uiStateChanged() {
+ if (uiStateService.isSnapped || !uiStateService.isAppVisible)
+ return;
+ if (uiStateServiceBindings) {
+ uiStateServiceBindings.cancel();
+ uiStateServiceBindings = null
+ }
+ signal.complete()
+ };
+ showAdPromise = function showAdPromise() {
+ return adService.playVideoAd().then(function onAdPlayed(isSignedIn) {
+ var returnPromise;
+ var signinService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (!signinService.isSignedIn)
+ returnPromise = showMusicBrandDialog();
+ return WinJS.Promise.as(returnPromise)
+ })
+ };
+ if (uiStateService.isSnapped || !uiStateService.isAppVisible) {
+ uiStateServiceBindings = WinJS.Binding.bind(uiStateService, {
+ isSnapped: uiStateChanged, isAppVisible: uiStateChanged
+ });
+ return signal.promise.then(showAdPromise)
+ }
+ else
+ return showAdPromise()
+ }
+ else
+ return showMusicBrandDialog()
+ }
+ }
+ };
+ FreePlayLimits.prototype.getLimits = function() {
+ if (!this._initialized)
+ this.initialize();
+ if (!this._musicLimitsManager)
+ return WinJS.Promise.wrapError();
+ return this._initializedTimeout.then(function() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (!signIn.isSignedIn)
+ return WinJS.Promise.wrapError()
+ }).then(this._musicLimitsManager.getLimitsAsync).then(function(limits) {
+ try {
+ limits = JSON.parse(limits).result
+ }
+ catch(error) {
+ MS.Entertainment.Music.fail("getLimitsAsync has failed because JSON.parse failed. error message = " + (error && error.message) + " json = " + limits);
+ return WinJS.Promise.wrapError(error)
+ }
+ try {
+ limits.nextMonthlyFreeLimitResetDate = MS.Entertainment.Data.Factory.date(limits.nextMonthlyFreeLimitResetDate)
+ }
+ catch(error) {
+ MS.Entertainment.Music.fail("getLimitsAsync has failed because date parse failed. error message = " + (error && error.message) + " json = " + limits);
+ return WinJS.Promise.wrapError(error)
+ }
+ return limits
+ })
+ };
+ FreePlayLimits.prototype.clearAppNotifications = function() {
+ var appNotification = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ appNotification.removeNotificationByCategory(MS.Entertainment.Music.FreePlayLimits._notificationCategory)
+ };
+ FreePlayLimits.prototype._onSignInStateChanged = function() {
+ var _this = this;
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signIn.isSignedIn && !signedInUser.isSubscription) {
+ if (!this._eventBindings) {
+ this._eventBindings = [];
+ this._eventBindings.push(MS.Entertainment.Utilities.addEventHandlers(this._musicLimitsManager, {
+ monthlyfreelimitexceeded: this._onMonthlyFreeLimitExceeded.bind(this), monthlyfreelimitreset: this._onMonthlyFreeLimitReset.bind(this), freetrialstarted: this._onFreeTrialStarted.bind(this), freetrialcompleted: this._onFreeTrialCompleted.bind(this), trackfreelimitexceeded: this._onFreeTrackLimitExceeded.bind(this), trackfreelimitsreset: this._onFreeTrackLimitReset.bind(this)
+ }));
+ this._eventBindings.push(MS.Entertainment.Utilities.addEventHandlers(this._sessionManager.primarySession, {currentMediaChanged: this._currentMediaChanged.bind(this)}))
+ }
+ this._isMonthlyFreeLimitExceeded = this._musicLimitsManager.isMonthlyFreeLimitExceeded;
+ this._isFreeTrialCompleted = this._musicLimitsManager.isFreeTrialCompleted
+ }
+ else {
+ if (this._eventBindings) {
+ this._eventBindings.forEach(function(eventBinding) {
+ eventBinding.cancel()
+ });
+ this._eventBindings = null
+ }
+ this._isMonthlyFreeLimitExceeded = false;
+ this._isFreeTrialCompleted = false
+ }
+ if (this._signedInUserBindings) {
+ this._signedInUserBindings.cancel();
+ this._signedInUserBindings = null
+ }
+ if (signIn.isSignedIn) {
+ this._musicLimitsManager.getLimitsAsync();
+ if (!signedInUser.isSubscription)
+ this._signedInUserBindings = WinJS.Binding.bind(signedInUser, {isSubscription: function(newValue, oldValue) {
+ if (oldValue !== undefined)
+ _this._onSignInStateChanged()
+ }})
+ }
+ this._dispatchEvent(this.isMonthlyFreeLimitExceeded ? MS.Entertainment.Music.Freeplay.Events.monthlyFreeLimitExceeded : MS.Entertainment.Music.Freeplay.Events.monthlyFreeLimitReset)
+ };
+ FreePlayLimits.prototype._onMonthlyFreeLimitExceeded = function() {
+ var _this = this;
+ this._isMonthlyFreeLimitExceeded = true;
+ this._sendAppNotification(String.load(String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE1), String.load(String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE2), MS.Entertainment.UI.Icon.notification, function() {
+ _this.showMonthlyFreeLimitExceededDialog()
+ });
+ this._dispatchEvent(MS.Entertainment.Music.Freeplay.Events.monthlyFreeLimitExceeded)
+ };
+ FreePlayLimits.prototype._onMonthlyFreeLimitReset = function() {
+ this._isMonthlyFreeLimitExceeded = false;
+ var monthlyFreeHoursAllowance = this._getMonthlyFreeHoursAllowance();
+ if (monthlyFreeHoursAllowance > 0)
+ this._sendAppNotification(String.load(String.id.IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE1), String.load(String.id.IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2).format(monthlyFreeHoursAllowance), MS.Entertainment.UI.Icon.notification);
+ this._dispatchEvent(MS.Entertainment.Music.Freeplay.Events.monthlyFreeLimitReset)
+ };
+ FreePlayLimits.prototype._onFreeTrialStarted = function() {
+ this._isFreeTrialCompleted = false;
+ this._dispatchEvent(MS.Entertainment.Music.Freeplay.Events.freeTrialStarted)
+ };
+ FreePlayLimits.prototype._onFreeTrialCompleted = function() {
+ var _this = this;
+ this._isFreeTrialCompleted = true;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appNotification))
+ this._sendAppNotification(String.load(String.id.IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE1), String.load(String.id.IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE2), MS.Entertainment.UI.Icon.notification, WinJS.Utilities.markSupportedForProcessing(function() {
+ _this._showFreeTrialCompletedDialog()
+ }));
+ this._dispatchEvent(MS.Entertainment.Music.Freeplay.Events.freeTrialCompleted)
+ };
+ FreePlayLimits.prototype._onFreeTrackLimitExceeded = function(serviceMediaId) {
+ this._dispatchEvent(MS.Entertainment.Music.Freeplay.Events.freeTrackLimitExceeded, serviceMediaId)
+ };
+ FreePlayLimits.prototype._onFreeTrackLimitReset = function() {
+ this._dispatchEvent(MS.Entertainment.Music.Freeplay.Events.freeTrackLimitReset)
+ };
+ FreePlayLimits.prototype._dispatchEvent = function(event, serviceMediaId) {
+ var _this = this;
+ var dispatchEvent = function(serviceMediaId) {
+ var listeners = _this._listeners[serviceMediaId];
+ if (listeners)
+ listeners.forEach(function(listener) {
+ listener(event)
+ })
+ };
+ if (serviceMediaId)
+ dispatchEvent(serviceMediaId);
+ else
+ for (var listener in this._listeners)
+ dispatchEvent(listener)
+ };
+ FreePlayLimits.prototype._sendAppNotification = function(title, subTitle, icon, action) {
+ var appNotification = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ appNotification.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Critical, title: title, subTitle: subTitle, moreDetails: null, icon: icon, action: action, category: MS.Entertainment.Music.FreePlayLimits._notificationCategory, isPersistent: true, dismissOnSignOut: true
+ }))
+ };
+ FreePlayLimits.prototype._queueCollectionFilterEvent = function(event) {
+ this._queuedCollectionFilterEvent = event
+ };
+ FreePlayLimits.prototype._sendCollectionFilterEvent = function(event) {
+ this._collectionFilterListeners.forEach(function sendCollectionFilterEvent(listener) {
+ listener(event)
+ })
+ };
+ FreePlayLimits.prototype._showFreeTrialCompletedDialog = function() {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.freeTrialCompleted);
+ var monthlyFreeHoursAllowance = this._getMonthlyFreeHoursAllowance();
+ return MS.Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_TRIAL_END_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_TRIAL_END_BODY).format(monthlyFreeHoursAllowance), null, [MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.subscribe, MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.ok])
+ };
+ FreePlayLimits.prototype._getMediaItemActions = function(mediaItem) {
+ var canBuyTrack = false;
+ var canBuyAlbum = false;
+ if (mediaItem && mediaItem.rights)
+ for (var i = 0; i < mediaItem.rights.length; i++) {
+ var right = mediaItem.rights[i];
+ if (right.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Purchase) {
+ canBuyTrack = true;
+ break
+ }
+ else if (right.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.AlbumPurchase)
+ canBuyAlbum = true
+ }
+ var buttons = [];
+ if (canBuyTrack)
+ buttons.push(MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.buyTrack);
+ else if (canBuyAlbum)
+ buttons.push(MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.buyAlbum);
+ buttons.push(MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.subscribe);
+ buttons.push(MS.Entertainment.Music.MusicBrandDialog.dialogButtonIds.ok);
+ return {
+ canBuyTrack: canBuyTrack, canBuyAlbum: canBuyAlbum, buttons: buttons, mediaItem: (mediaItem && canBuyAlbum) ? mediaItem.album : mediaItem
+ }
+ };
+ FreePlayLimits.prototype._getMonthlyFreeHoursAllowance = function() {
+ return Math.max(Math.floor(this._musicLimitsManager.monthlyFreeMinutesAllowance / 60), 0)
+ };
+ FreePlayLimits.prototype._hydrateMedia = function(mediaItem) {
+ var promise = WinJS.Promise.as();
+ if (mediaItem) {
+ var isOnline;
+ switch (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).networkStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ isOnline = true;
+ break;
+ case 4:
+ case 5:
+ isOnline = false;
+ break;
+ default:
+ MS.Entertainment.Music.fail("unexpected network status value");
+ break
+ }
+ if (isOnline && mediaItem.hydrate)
+ promise = mediaItem.hydrate({forceUpdate: true})
+ }
+ return promise
+ };
+ FreePlayLimits.isFreeStreamingTrack = function(mediaItem) {
+ return !!(mediaItem && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && (mediaItem.canFreeStream || mediaItem.isFreeStreamRestrictedByIndividualLimit || mediaItem.isFreeStreamRestrictedByMonthlyLimit) && !mediaItem.hasPurchased && !mediaItem.canPlayLocally && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).isSubscription)
+ };
+ FreePlayLimits.factory = function() {
+ return new MS.Entertainment.Music.FreePlayLimits
+ };
+ FreePlayLimits._notificationCategory = "AuthenticatedFreeStreamNotification";
+ return FreePlayLimits
+ })();
+ Music.FreePlayLimits = FreePlayLimits
+ })(Music = Entertainment.Music || (Entertainment.Music = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.freePlayLimits, MS.Entertainment.Music.FreePlayLimits.factory)
+})();
+/* >>>>>>/controls/music/mediapropertiesflyout.js:2023 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MediaPropertiesFlyout: MS.Entertainment.UI.Framework.defineUserControl("Controls/Music/MediaPropertiesFlyout.html#mediaPropertiesFlyoutTemplate", function mediaPropertiesFlyoutConstructor(){}, {
+ _dialog: null, _eventHandlers: null, mediaItem: null, overrideActionFunction: null, initialize: function initialize() {
+ this._eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {
+ keypress: function onKeyPress(event) {
+ if (event.keyCode === WinJS.Utilities.Key.escape)
+ this._dialog.hide()
+ }.bind(this), keydown: function onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.dismissButton) {
+ event.stopPropagation();
+ this._dialog.hide()
+ }
+ }.bind(this)
+ });
+ if (!(new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience)
+ this.showBuyLink = this.mediaItem.hasNonMarketplaceImage;
+ var streamingSource = String.empty;
+ this.getCollectionState().then(function getCollectionState(state) {
+ if (state !== null && state !== undefined) {
+ this.cloudIcon = MS.Entertainment.Data.Factory.toCloudIcon(state);
+ this.cloudIconOpacity = MS.Entertainment.Data.Factory.toCloudIconOpacity(state);
+ this.cloudIconTooltip = MS.Entertainment.Data.Factory.toCloudIconTooltip(state);
+ streamingSource = MS.Entertainment.Data.Factory.toCloudStreamingSource(state)
+ }
+ }.bind(this), function getCollectionStateError(error) {
+ return WinJS.Promise.wrapError("Failed to get collection state. Error: " + (error && error.message))
+ }).then(function getTrackFiles() {
+ return this.getTrackFiles()
+ }.bind(this)).done(function getTrackFilesSuccess(trackFilesArray) {
+ if (trackFilesArray && trackFilesArray.length > 0) {
+ this.trackFiles = trackFilesArray;
+ this.showLocation = true
+ }
+ else {
+ var trackFileInfoArray = new Array;
+ var trackFile = {};
+ trackFile.url = streamingSource;
+ trackFile.hideCopyButton = true;
+ trackFileInfoArray[0] = trackFile;
+ this.trackFiles = trackFileInfoArray;
+ this.showLocation = (streamingSource !== String.empty)
+ }
+ }.bind(this), function getTrackFilesError(error) {
+ MS.Entertainment.UI.Controls.fail("Failed to get track files. Error: " + (error && error.message))
+ })
+ }, getCollectionState: function getCollectionState() {
+ var promise;
+ if (this.mediaItem.inCollection && (this.mediaItem.collectionState === null || this.mediaItem.collectionState === undefined)) {
+ var trackQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ trackQuery.trackId = this.mediaItem.libraryId;
+ trackQuery.chunkSize = 1;
+ trackQuery.aggregateChunks = false;
+ promise = trackQuery.getItemsArrayAndIgnoreErrors().then(function getTrack(trackArray) {
+ if (trackArray) {
+ MS.Entertainment.UI.Actions.assert(trackArray.length <= 1, "libraryTracks query using trackId should not return more then 1 items");
+ if (trackArray.length === 1)
+ return trackArray[0].collectionState
+ }
+ })
+ }
+ else
+ promise = WinJS.Promise.as(this.mediaItem.collectionState);
+ return promise
+ }, getTrackFiles: function getTrackFiles() {
+ var promise;
+ var getTrackFilesQuery = new MS.Entertainment.Data.Query.LibraryTrackFiles;
+ getTrackFilesQuery.trackId = this.mediaItem.libraryId;
+ promise = getTrackFilesQuery.execute().then(function getTrackFiles(queryResult) {
+ return queryResult.result && queryResult.result.itemsArray
+ });
+ return promise
+ }, unload: function unload() {
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, setOverlay: function setOverlay(dialog) {
+ this._dialog = dialog;
+ dialog.setAccessibilityTitle(String.load(String.id.IDS_MUSIC_PROPERTIES_DIALOG_TEXT))
+ }
+ }, {
+ showBuyLink: false, cloudIcon: null, cloudIconOpacity: null, cloudIconTooltip: null, trackFiles: null, showLocation: false
+ })})
+})()
+})();
diff --git a/packages/microsoft.zunemusic/group_4_merged.js b/packages/microsoft.zunemusic/group_4_merged.js
new file mode 100644
index 00000000..2ac57adf
--- /dev/null
+++ b/packages/microsoft.zunemusic/group_4_merged.js
@@ -0,0 +1,405 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/controls/music1/searchresultsview.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ var SearchResultsView = (function(_super) {
+ __extends(SearchResultsView, _super);
+ function SearchResultsView(element, options) {
+ _super.call(this, element, options);
+ UI.Framework.processDeclarativeControlContainer(this)
+ }
+ SearchResultsView.prototype.initialize = function() {
+ if (SearchResultsView._searchPageRefCount === 0)
+ WinJS.Utilities.addClass(document.body, "activepage-search");
+ if (this.enableAutoScroll)
+ this._enableFocusEventHandlers("details-layoutRoot");
+ SearchResultsView._searchPageRefCount++;
+ this._dataContextChangedEvents = Entertainment.Utilities.addEventHandlers(this, {dataContextChanged: this._onDataContextChanged.bind(this)}, true)
+ };
+ SearchResultsView.prototype._onDataContextChanged = function() {
+ if (this._pivotChangedEvents) {
+ this._pivotChangedEvents.cancel();
+ this._pivotChangedEvents
+ }
+ var viewModel = this.dataContext;
+ if (viewModel)
+ this._pivotChangedEvents = Entertainment.Utilities.addEventHandlers(viewModel.pivotsSelectionManager, {selectedItemChanged: this._onPivotChanged.bind(this)}, true)
+ };
+ SearchResultsView.prototype._onPivotChanged = function() {
+ this._refreshSelectionManager()
+ };
+ SearchResultsView.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ SearchResultsView._searchPageRefCount--;
+ if (SearchResultsView._searchPageRefCount === 0)
+ WinJS.Utilities.removeClass(document.body, "activepage-search");
+ if (this._pivotChangedEvents) {
+ this._pivotChangedEvents.cancel();
+ this._pivotChangedEvents
+ }
+ if (this._dataContextChangedEvents) {
+ this._dataContextChangedEvents.cancel();
+ this._dataContextChangedEvents
+ }
+ };
+ SearchResultsView.prototype.onAlbumsHeaderInvoked = function(event) {
+ var viewModel = this.dataContext;
+ this._executeModuleHeaderAction(viewModel.albums, event.target)
+ };
+ SearchResultsView.prototype.onArtistsHeaderInvoked = function(event) {
+ var viewModel = this.dataContext;
+ this._executeModuleHeaderAction(viewModel.artists, event.target)
+ };
+ SearchResultsView.prototype.onSongsHeaderInvoked = function(event) {
+ var viewModel = this.dataContext;
+ this._executeModuleHeaderAction(viewModel.songs, event.target)
+ };
+ SearchResultsView.prototype._executeModuleHeaderAction = function(invokedModule, referenceElement) {
+ var action = invokedModule && invokedModule.moduleAction;
+ if (action)
+ if (!event.keyCode || event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space) {
+ action.requeryCanExecute();
+ if (action.isEnabled)
+ action.execute(referenceElement)
+ }
+ };
+ SearchResultsView._searchPageRefCount = 0;
+ return SearchResultsView
+ })(Controls.PageViewBase);
+ Controls.SearchResultsView = SearchResultsView
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.SearchResultsView)
+})();
+/* >>>>>>/viewmodels/searchviewmodelbase.js:95 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ (function(SearchResultsScopes) {
+ SearchResultsScopes[SearchResultsScopes["collection"] = 0] = "collection";
+ SearchResultsScopes[SearchResultsScopes["catalog"] = 1] = "catalog"
+ })(ViewModels.SearchResultsScopes || (ViewModels.SearchResultsScopes = {}));
+ var SearchResultsScopes = ViewModels.SearchResultsScopes;
+ var SearchViewModelBase = (function(_super) {
+ __extends(SearchViewModelBase, _super);
+ function SearchViewModelBase(searchText, searchScope) {
+ _super.call(this);
+ this._catalogHeaderPivot = null;
+ this._catalogModules = [];
+ this._collectionHeaderPivot = null;
+ this._collectionModules = [];
+ this._bindings = [];
+ this._isMarketplaceEnabled = true;
+ this._pivotsSelectionManager = null;
+ this._searchText = String.empty;
+ this._searchResultText = String.empty;
+ this._searchScope = 0;
+ this._viewStateViewModel = null;
+ this._searchText = searchText;
+ this.searchResultsText = searchText;
+ this._searchScope = searchScope
+ }
+ Object.defineProperty(SearchViewModelBase.prototype, "isCatalogScope", {
+ get: function() {
+ return this._searchScope === 1
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "isCollectionScope", {
+ get: function() {
+ return this._searchScope === 0
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "isMarketplaceEnabled", {
+ get: function() {
+ return this._isMarketplaceEnabled
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "pivotsSelectionManager", {
+ get: function() {
+ return this._pivotsSelectionManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "searchResultsText", {
+ get: function() {
+ return this._searchResultText
+ }, set: function(value) {
+ this._searchResultText = String.load(SearchViewModelBase.RESULTS_STRING_FORMAT).format(value);
+ this.updateAndNotify("searchResultsText", this._searchResultText)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "searchScope", {
+ get: function() {
+ return this._searchScope
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "searchText", {
+ get: function() {
+ return this._searchText
+ }, enumerable: true, configurable: true
+ });
+ SearchViewModelBase.prototype.scheduledDelayInitialize = function() {
+ this.modules.forEach(function(searchModule) {
+ searchModule.delayInitialize()
+ })
+ };
+ SearchViewModelBase.prototype.dispose = function() {
+ this._bindings.forEach(function(binding) {
+ binding.cancel();
+ binding = null
+ });
+ if (this._pivotsSelectionManager) {
+ this._pivotsSelectionManager.dispose();
+ this._pivotsSelectionManager = null
+ }
+ _super.prototype.dispose.call(this)
+ };
+ SearchViewModelBase.prototype.navigatedBackTo = function() {
+ this.modules.forEach(function(searchModule) {
+ searchModule.refreshItems()
+ })
+ };
+ SearchViewModelBase.prototype.loadModules = function() {
+ if (!this.isOnline && this.isMarketplaceEnabled) {
+ this._searchScope = 0;
+ this._pivotsSelectionManager.selectedItem = this._collectionHeaderPivot
+ }
+ this._updateModuleSearchScope();
+ this.modules.forEach(function(searchModule) {
+ searchModule.load()
+ })
+ };
+ SearchViewModelBase.prototype._initializeModules = function() {
+ this.listenForModuleViewStateChanges()
+ };
+ SearchViewModelBase.prototype._addBinding = function(binding) {
+ this._bindings.push(binding)
+ };
+ SearchViewModelBase.prototype._addBindings = function(bindings) {
+ this._bindings = this._bindings.concat(bindings)
+ };
+ SearchViewModelBase.prototype._addCatalogModule = function(searchModule) {
+ this._catalogModules.push(searchModule);
+ this.modules = this._collectionModules.concat(this._catalogModules)
+ };
+ SearchViewModelBase.prototype._addCollectionModule = function(searchModule) {
+ this._collectionModules.push(searchModule);
+ this.modules = this._collectionModules.concat(this._catalogModules)
+ };
+ SearchViewModelBase.prototype._onPivotChanged = function() {
+ this.delayInitialize();
+ this._searchScope = this._collectionHeaderPivot.selected ? 0 : 1;
+ this._updateModuleSearchScope();
+ this._refreshEmptyViewState();
+ this.viewStateViewModel.viewState = -3
+ };
+ SearchViewModelBase.prototype._updateModuleSearchScope = function() {
+ var _this = this;
+ this._collectionModules.forEach(function(collectionModule) {
+ collectionModule.isExcludedFromPageState = _this.isCatalogScope
+ });
+ this._catalogModules.forEach(function(catalogModule) {
+ catalogModule.isExcludedFromPageState = _this.isCollectionScope
+ })
+ };
+ SearchViewModelBase.prototype._updatePivotCount = function(pivot, modules) {
+ var modulesCountable = modules.every(function(module) {
+ return module.moduleState === 2 || module.moduleState === 0
+ });
+ if (modulesCountable)
+ pivot.count = modules.map(function(module) {
+ return module.count
+ }).reduce(function(total, currentValue) {
+ return (total + currentValue)
+ });
+ else {
+ var isLoadCompleted = Entertainment.Utilities.ViewState.isStateCompleted(this.viewStateViewModel.viewState);
+ if (isLoadCompleted)
+ pivot.count = 0
+ }
+ };
+ SearchViewModelBase.prototype._updatePivotCounts = function() {
+ this._updatePivotCount(this._collectionHeaderPivot, this._collectionModules);
+ if (this.isMarketplaceEnabled)
+ this._updatePivotCount(this._catalogHeaderPivot, this._catalogModules)
+ };
+ SearchViewModelBase.CATALOG_PIVOT_ID = "catalog";
+ SearchViewModelBase.CATALOG_RESULT_COUNT_MAX_THRESHOLD = 1000;
+ SearchViewModelBase.COLLECTION_PIVOT_ID = "collection";
+ SearchViewModelBase.COLLECTION_RESULT_COUNT_MAX_THRESHOLD = 1000;
+ SearchViewModelBase.RESULTS_STRING_FORMAT = String.id.IDS_SEARCH_RESULT_TITLE_TC;
+ return SearchViewModelBase
+ })(ViewModels.PageViewModelBase);
+ ViewModels.SearchViewModelBase = SearchViewModelBase;
+ var SearchResultHeaderPivotItem = (function(_super) {
+ __extends(SearchResultHeaderPivotItem, _super);
+ function SearchResultHeaderPivotItem(labelWithoutCountStringId, labelWithCountStringId, labelWithMaxCountStringId, maxCount, id) {
+ _super.call(this);
+ this._selected = false;
+ this._labelWithoutCount = String.empty;
+ this._labelWithCount = String.empty;
+ this._labelWithMaxCount = String.empty;
+ this._maxCount = 0;
+ this._label = String.empty;
+ this._id = String.empty;
+ this._label = this._labelWithoutCount = String.load(labelWithoutCountStringId);
+ this._labelWithCount = String.load(labelWithCountStringId);
+ this._labelWithMaxCount = String.load(labelWithMaxCountStringId).format(maxCount);
+ this._maxCount = maxCount;
+ this._id = id
+ }
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "label", {
+ get: function() {
+ return this._label
+ }, set: function(value) {
+ this.updateAndNotify("label", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "selected", {
+ get: function() {
+ return this._selected
+ }, set: function(value) {
+ this.updateAndNotify("selected", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "id", {
+ get: function() {
+ return this._id
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "count", {
+ set: function(value) {
+ MS.Entertainment.ViewModels.assert(value >= 0, "Negative count values are not valid in a search pivot.");
+ var decimalNumberFormatter = Entertainment.ServiceLocator.getService(Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var formattedCount = decimalNumberFormatter.format(value);
+ var label = this._labelWithoutCount;
+ if (value >= 0 && value < this._maxCount)
+ label = this._labelWithCount.format(formattedCount);
+ else if (value >= this._maxCount)
+ label = this._labelWithMaxCount;
+ this.label = label
+ }, enumerable: true, configurable: true
+ });
+ return SearchResultHeaderPivotItem
+ })(Entertainment.UI.Framework.ObservableBase);
+ ViewModels.SearchResultHeaderPivotItem = SearchResultHeaderPivotItem
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/music/musicsearchviewmodelbase.js:325 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var ViewModels;
+ (function(ViewModels) {
+ var MusicSearchViewModelBase = (function(_super) {
+ __extends(MusicSearchViewModelBase, _super);
+ function MusicSearchViewModelBase(searchText, searchScope) {
+ _super.call(this, searchText, searchScope);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this._isMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ this.modules = [];
+ this._initializeModules();
+ this._initializePivots()
+ }
+ Object.defineProperty(MusicSearchViewModelBase.prototype, "viewStateViewModel", {
+ get: function() {
+ if (!this._viewStateViewModel) {
+ var viewStateItems = new Array;
+ viewStateItems[-2] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_OFFLINE_HEADER), String.load(String.id.IDS_MUSIC_OFFLINE_DETAILS), []);
+ viewStateItems[-1] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_ERROR_HEADER), String.load(String.id.IDS_MUSIC_ERROR_DETAILS), []);
+ viewStateItems[0] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_TITLE), String.load(String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_DESC), []);
+ this._viewStateViewModel = new ViewModels.ViewStateViewModel(viewStateItems)
+ }
+ return this._viewStateViewModel
+ }, enumerable: true, configurable: true
+ });
+ MusicSearchViewModelBase.prototype._initializePivots = function() {
+ var _this = this;
+ if (this.isMarketplaceEnabled) {
+ this._collectionHeaderPivot = new ViewModels.SearchResultHeaderPivotItem(String.id.IDS_MUSIC_SEARCH_COLLECTION_FILTER_NO_COUNT, String.id.IDS_MUSIC_SEARCH_COLLECTION_FILTER, String.id.IDS_MUSIC_SEARCH_COLLECTION_FILTER_MAX_RESULTS, ViewModels.MusicSearchHubViewModelBase.COLLECTION_RESULT_COUNT_MAX_THRESHOLD, ViewModels.MusicSearchHubViewModelBase.COLLECTION_PIVOT_ID);
+ this._catalogHeaderPivot = new ViewModels.SearchResultHeaderPivotItem(String.id.IDS_MUSIC_SEARCH_CATALOG_FILTER_NO_COUNT, String.id.IDS_MUSIC_SEARCH_CATALOG_FILTER, String.id.IDS_MUSIC_SEARCH_CATALOG_FILTER_MAX_RESULTS, ViewModels.MusicSearchHubViewModelBase.CATALOG_RESULT_COUNT_MAX_THRESHOLD, ViewModels.MusicSearchHubViewModelBase.CATALOG_PIVOT_ID);
+ this._pivotsSelectionManager = new Entertainment.UI.Framework.SelectionManager([this._collectionHeaderPivot, this._catalogHeaderPivot]);
+ this._pivotsSelectionManager.selectedItem = (this._searchScope === 0) ? this._collectionHeaderPivot : this._catalogHeaderPivot;
+ var selectionBinding = Entertainment.UI.Framework.addEventHandlers(this._pivotsSelectionManager, {selectedItemChanged: this._onPivotChanged.bind(this)});
+ this._addBinding(selectionBinding);
+ var countChangeBindings = this.modules.map(function(searchModule) {
+ return WinJS.Binding.bind(searchModule, {count: function() {
+ return _this._updatePivotCounts()
+ }})
+ });
+ this._addBindings(countChangeBindings)
+ }
+ };
+ MusicSearchViewModelBase.prototype._refreshEmptyViewState = function() {
+ if (this.isMarketplaceEnabled)
+ if (this.modules.map(function(m) {
+ return m.moduleState
+ }).every(function(state) {
+ return state === 0
+ })) {
+ this.viewStateViewModel.viewState = -3;
+ this.viewStateViewModel.viewStateItems[0] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE), String.load(String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_DESC), []);
+ this.viewStateViewModel.viewState = 0
+ }
+ else
+ this.viewStateViewModel.viewStateItems[0] = new ViewModels.ViewStateItem(String.load(this.isCollectionScope ? String.id.IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE : String.id.IDS_MUSIC_SEARCH_CATALOG_EMPTY_TITLE), String.load(this.isCollectionScope ? String.id.IDS_MUSIC_SEARCH_COLLECTION_EMPTY_DESC : String.id.IDS_MUSIC_SEARCH_CATALOG_EMPTY_DESC), []);
+ else
+ this.viewStateViewModel.viewStateItems[0] = new ViewModels.ViewStateItem(String.load(String.id.IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG), String.load(String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_DESC), [])
+ };
+ return MusicSearchViewModelBase
+ })(ViewModels.SearchViewModelBase);
+ ViewModels.MusicSearchViewModelBase = MusicSearchViewModelBase
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
diff --git a/packages/microsoft.zunemusic/group_unique_merged.js b/packages/microsoft.zunemusic/group_unique_merged.js
new file mode 100644
index 00000000..b57d5b43
--- /dev/null
+++ b/packages/microsoft.zunemusic/group_unique_merged.js
@@ -0,0 +1,312 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/controls/music1/metadataeditcontrols.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var MetadataField = (function(_super) {
+ __extends(MetadataField, _super);
+ function MetadataField(element, options) {
+ _super.call(this, element, options);
+ this._child = null;
+ this._dataContext = null;
+ this._dataContextHandlers = null;
+ this._domEventHandlers = null;
+ this._child = element.querySelector("[data-ent-type=metadataField]")
+ }
+ Object.defineProperty(MetadataField.prototype, "dataContext", {
+ get: function() {
+ return this._dataContext
+ }, set: function(value) {
+ this.updateAndNotify("dataContext", value)
+ }, enumerable: true, configurable: true
+ });
+ MetadataField.prototype.initialize = function() {
+ _super.prototype.initialize.call(this);
+ MS.Entertainment.Utilities.addEventHandlers(this, {dataContextChanged: this._onDataContextChanged.bind(this)});
+ this._domEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {focusout: this._onBlur.bind(this)});
+ this._onDataContextChanged()
+ };
+ MetadataField.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ this._releaseDataContextHandlers();
+ if (this._domEventHandlers) {
+ this._domEventHandlers.cancel();
+ this._domEventHandlers = null
+ }
+ };
+ MetadataField.prototype._onBlur = function() {
+ if (this._unloaded || !this.dataContext || !this._child)
+ return;
+ this.dataContext.value = this._child.winControl ? this._child.winControl.value : this._child.value
+ };
+ MetadataField.prototype._releaseDataContextHandlers = function() {
+ if (this._dataContextHandlers) {
+ this._dataContextHandlers.cancel();
+ this._dataContextHandlers = null
+ }
+ };
+ MetadataField.prototype._onDataContextChanged = function() {
+ if (this._unloaded)
+ return;
+ this._releaseDataContextHandlers();
+ if (this._dataContext) {
+ this._dataContextHandlers = MS.Entertainment.Utilities.addEventHandlers(this._dataContext, {displayValueChanged: this._onDataContextValueChanged.bind(this)});
+ this._onDataContextValueChanged()
+ }
+ };
+ MetadataField.prototype._onDataContextValueChanged = function() {
+ if (this._unloaded || !this.dataContext || !this._child)
+ return;
+ this._child.value = this.dataContext.displayValue
+ };
+ return MetadataField
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.MetadataField = MetadataField;
+ var MetadataItemsControl = (function(_super) {
+ __extends(MetadataItemsControl, _super);
+ function MetadataItemsControl(element, options) {
+ this.tallThreshold = 57;
+ this.tallerClassName = "metadataItemsControl-tallerItems";
+ _super.call(this, element, options);
+ this.repeaterContainer = element.querySelector("[data-ent-type=repeaterContainer]") || element
+ }
+ MetadataItemsControl.prototype.initialize = function() {
+ _super.prototype.initialize.call(this);
+ if (this.domElement)
+ this._domEventHandler = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {mselementresize: this.recalculateSize.bind(this)})
+ };
+ MetadataItemsControl.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ if (this._domEventHandler) {
+ this._domEventHandler.cancel();
+ this._domEventHandler = null
+ }
+ };
+ MetadataItemsControl.prototype.itemsRendered = function() {
+ this.recalculateSize()
+ };
+ MetadataItemsControl.prototype.recalculateSize = function() {
+ if (!this.repeaterContainer || !this.domElement || this._unloaded)
+ return;
+ var firstChild = this.repeaterContainer.firstElementChild;
+ var firstChildHeight = 0;
+ if (firstChild)
+ firstChildHeight = firstChild.clientHeight;
+ if (firstChildHeight > this.tallThreshold)
+ WinJS.Utilities.addClass(this.domElement, this.tallerClassName);
+ else
+ WinJS.Utilities.removeClass(this.domElement, this.tallerClassName)
+ };
+ return MetadataItemsControl
+ })(MS.Entertainment.UI.Controls.ItemsControl);
+ Controls.MetadataItemsControl = MetadataItemsControl;
+ WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MetadataField);
+ WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MetadataItemsControl)
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
+/* >>>>>>/controls/music1/editablecombobox.js:127 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ var Entertainment;
+ (function(Entertainment) {
+ var UI;
+ (function(UI) {
+ var Controls;
+ (function(Controls) {
+ var Utilities = MS.Entertainment.Utilities;
+ var EditableComboBox = (function(_super) {
+ __extends(EditableComboBox, _super);
+ function EditableComboBox(element, options) {
+ this.editModeIndex = -1;
+ this._hideClass = "removeFromDisplay";
+ this._inEditMode = false;
+ this._comboBox = element.querySelector("select");
+ this._editBox = element.querySelector("input");
+ _super.call(this, element, options);
+ this.repeaterContainer = this._comboBox || this.domElement
+ }
+ Object.defineProperty(EditableComboBox.prototype, "value", {
+ get: function() {
+ return this._value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditableComboBox.prototype, "dataContext", {
+ get: function() {
+ return this._dataContext
+ }, set: function(value) {
+ this.updateAndNotify("dataContext", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EditableComboBox.prototype, "inEditMode", {
+ get: function() {
+ return this._inEditMode
+ }, set: function(value) {
+ this.updateAndNotify("inEditMode", value)
+ }, enumerable: true, configurable: true
+ });
+ EditableComboBox.prototype.initialize = function() {
+ _super.prototype.initialize.call(this);
+ this._onDataContextChanged();
+ this._onEditModeChanged();
+ MS.Entertainment.Utilities.addEventHandlers(this, {
+ inEditModeChanged: this._onEditModeChanged.bind(this), dataContextChanged: this._onDataContextChanged.bind(this)
+ });
+ if (this._comboBox)
+ this._comboBoxEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._comboBox, {change: this._onComboBoxSelection.bind(this)});
+ if (this._editBox)
+ this._editBoxEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._editBox, {focusout: this._onBlur.bind(this)})
+ };
+ EditableComboBox.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ this._releaseDataContextHandlers();
+ if (this._comboBoxEventHandlers) {
+ this._comboBoxEventHandlers.cancel();
+ this._comboBoxEventHandlers = null
+ }
+ if (this._editBoxEventHandlers) {
+ this._editBoxEventHandlers.cancel();
+ this._editBoxEventHandlers = null
+ }
+ };
+ EditableComboBox.prototype.selectTemplate = function(item) {
+ var completePromise;
+ if (!this.isDivider(item))
+ completePromise = _super.prototype.selectTemplate.call(this, item);
+ else
+ completePromise = this.loadDividerTemplate();
+ return completePromise
+ };
+ EditableComboBox.prototype.loadDividerTemplate = function() {
+ var _this = this;
+ var completePromise;
+ if (!this._dividerTemplateProvider)
+ completePromise = this._loadTemplate(this.dividerItemTemplate);
+ else
+ completePromise = WinJS.Promise.wrap(this._dividerTemplateProvider);
+ completePromise = completePromise || WinJS.Promise.wrapError(new Error("No divider template provided"));
+ return completePromise.then(function(template) {
+ _this._dividerTemplateProvider = template;
+ return template
+ })
+ };
+ EditableComboBox.prototype.isDivider = function(item) {
+ return !item
+ };
+ EditableComboBox.prototype.applyItemTemplate = function(container, item, index) {
+ if (container)
+ if (this.isDivider(item)) {
+ container.disabled = true;
+ WinJS.Utilities.addClass(container, "editableComboBox-divider")
+ }
+ else
+ container.setAttribute("value", item && item.toString());
+ return container
+ };
+ EditableComboBox.prototype._setValue = function(value) {
+ this.updateAndNotify("value", value)
+ };
+ EditableComboBox.prototype._releaseDataContextHandlers = function() {
+ if (this._dataContextHandlers) {
+ this._dataContextHandlers.cancel();
+ this._dataContextHandlers = null
+ }
+ };
+ EditableComboBox.prototype._onDataContextChanged = function() {
+ if (this._unloaded)
+ return;
+ this._releaseDataContextHandlers();
+ if (this.dataContext) {
+ this.dataSource = this.dataContext.dataSource;
+ this._dataContextHandlers = MS.Entertainment.Utilities.addEventHandlers(this.dataContext, {selectedIndexChanged: this._onSelectionChanged.bind(this)})
+ }
+ else
+ this.dataSource = null;
+ this._onSelectionChanged()
+ };
+ EditableComboBox.prototype._onEditModeChanged = function() {
+ var _this = this;
+ if (this._unloaded)
+ return;
+ if (this.inEditMode)
+ WinJS.Promise.timeout().done(function() {
+ if (_this.inEditMode && !_this._unloaded) {
+ Utilities.safeAddClass(_this._comboBox, _this._hideClass);
+ Utilities.safeRemoveClass(_this._editBox, _this._hideClass);
+ if (_this._editBox) {
+ _this._editBox.disabled = false;
+ _this._editBox.focus()
+ }
+ }
+ });
+ else {
+ Utilities.safeAddClass(this._editBox, this._hideClass);
+ Utilities.safeRemoveClass(this._comboBox, this._hideClass);
+ if (this._editBox)
+ this._editBox.disabled = true
+ }
+ };
+ EditableComboBox.prototype._onComboBoxSelection = function() {
+ if (this._unloaded || !this._comboBox || !this.dataContext || !this.dataSource)
+ return;
+ if (this.isDivider(this.dataSource.item(this._comboBox.selectedIndex)))
+ this._comboBox.selectedIndex = this.dataContext ? this.dataContext.selectedIndex : 0;
+ else if (this._comboBox.selectedIndex >= 0 && this._comboBox.selectedIndex < this.dataContext.dataSource.length)
+ this.dataContext.selectedIndex = this._comboBox.selectedIndex
+ };
+ EditableComboBox.prototype._onBlur = function() {
+ if (this.inEditMode && this._editBox) {
+ this._setValue(this._editBox.value);
+ this.inEditMode = false
+ }
+ };
+ EditableComboBox.prototype._onSelectionChanged = function() {
+ if (this._unloaded || !this.dataContext)
+ return;
+ if (this.dataContext.selectedIndex === this.editModeIndex)
+ this.inEditMode = true;
+ if (this._comboBox && this.dataContext.selectedIndex >= 0 && this.dataContext.selectedIndex < this._comboBox.children.length)
+ this._comboBox.selectedIndex = this.dataContext.selectedIndex;
+ if (!this.inEditMode)
+ this._setValue(this.dataContext.selectedItem)
+ };
+ return EditableComboBox
+ })(MS.Entertainment.UI.Controls.ItemsControl);
+ Controls.EditableComboBox = EditableComboBox;
+ WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.EditableComboBox)
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+})(MS || (MS = {}))
+})();
diff --git a/packages/microsoft.zunemusic/launchToCollectionStartup.html b/packages/microsoft.zunemusic/launchToCollectionStartup.html
new file mode 100644
index 00000000..ad047de4
--- /dev/null
+++ b/packages/microsoft.zunemusic/launchToCollectionStartup.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/main.html b/packages/microsoft.zunemusic/main.html
new file mode 100644
index 00000000..41ba5c41
--- /dev/null
+++ b/packages/microsoft.zunemusic/main.html
@@ -0,0 +1,576 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/main.js b/packages/microsoft.zunemusic/main.js
new file mode 100644
index 00000000..7b1123d3
--- /dev/null
+++ b/packages/microsoft.zunemusic/main.js
@@ -0,0 +1,969 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.strictProcessing();
+ WinJS.Binding.optimizeBindingReferences = true;
+ scriptValidator();
+ MS.Entertainment.Utilities.updateHtmlDirectionAttribute();
+ MS.Entertainment.UI.Framework.unblockCriticalPreloading();
+ MS.Entertainment.UI.Framework.enableAutoControlCleanup();
+ MS.Entertainment.UI.Framework.enableSetImmediateBatching();
+ var appDisplayName = "";
+ if (window.usingNewMusicPage)
+ return;
+ var applicationLifetimeManager = null;
+ var commonEventProvider = null;
+ var tileManager = null;
+ var initialized = false;
+ var alreadyHandledLaunch = false;
+ var startPlaybackOnLaunch = false;
+ var stageTwoInitialized = false;
+ var stageThreePromise = null;
+ var stageFourPromise = null;
+ var stageFourDelay = 5000;
+ var shouldShowAppBar = false;
+ var showAppBarDelay = 0;
+ var wasRecentlyResumed = false;
+ var isPrelaunched = false;
+ if (window.clientInformation && window.clientInformation.cpuClass === "ARM")
+ showAppBarDelay = 5000;
+ WinJS.Application.onerror = MS.Entertainment.UI.Debug.unhandledPromiseErrorHandler;
+ WinJS.Namespace.define("MS.Entertainment.UI.Application", {Activation: MS.Entertainment.UI.Framework.define(null, null, {
+ handlePrelaunch: function handlePrelaunch(args) {
+ isPrelaunched = true;
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ var delayedStageThreePath = "/delayedStageThreeStartup.html";
+ if (window.useNewVideoPage)
+ delayedStageThreePath = "/Classic" + delayedStageThreePath;
+ MS.Entertainment.Utilities.loadHtmlPage(delayedStageThreePath, "delayedStartupContainer");
+ var activationArgsClone = MS.Entertainment.Utilities.cloneActivationArguments(args);
+ var madeVisibleCount = 0;
+ var documentEvents = MS.Entertainment.UI.Framework.addEventHandlers(document, {visibilitychange: function() {
+ if (document.hidden)
+ return;
+ isPrelaunched = false;
+ documentEvents.cancel();
+ MS.Entertainment.Utilities.resetPerfTrackStartTime();
+ MS.Entertainment.UI.Application.Activation.activated(activationArgsClone, false, true)
+ }})
+ }, activated: function activated(activationArgs, isNonRootActivationHandler, preLaunched) {
+ if (window.sessionStorage["HardBlockEnabled"] === "true") {
+ WinJS.Promise.timeout().then(function _delay() {
+ window.location.href = "UpdateApp.html"
+ });
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ if (activationArgs.prelaunchActivated) {
+ MS.Entertainment.UI.Application.Activation.handlePrelaunch(activationArgs);
+ return
+ }
+ if (!isNonRootActivationHandler) {
+ if (activationArgs.arguments === MS.Entertainment.Utilities.retailExperienceArgument)
+ MS.Entertainment.Utilities.setRetailExperienceState(true);
+ WinJS.Application.start();
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceProcessInitializeEventStart();
+ var startTime = new Date;
+ if (!applicationLifetimeManager)
+ applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ if (!preLaunched)
+ applicationLifetimeManager.raiseActivated(activationArgs)
+ }
+ var isFirstRun = !initialized;
+ var isSupported = true;
+ if (!initialized) {
+ var className;
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData = [];
+ if (!isNonRootActivationHandler) {
+ var demoModeAppStateReset = MS.Entertainment.Utilities.resetAppStateForRetailExperienceIfNeeded();
+ (new Microsoft.Entertainment.Application.Application).init(Microsoft.Entertainment.Application.ExecMode.foreground);
+ if (demoModeAppStateReset)
+ MS.Entertainment.Utilities.removeAllPlaylistsIfDemoMode()
+ }
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var currentPackage = Windows.ApplicationModel.Package.current;
+ var currentVersion = currentPackage.id.version;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var minVersionSupported;
+ var minServiceVersionSupported;
+ if (MS.Entertainment.Utilities.valueFromPropertyPathFragments(Windows, ["ApplicationModel", "Search", "SearchPane", "hideThisApplication"]))
+ Windows.ApplicationModel.Search.SearchPane.hideThisApplication();
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ appDisplayName = String.load(String.id.IDS_MANIFEST_MUSIC_APP_NAME);
+ className = "music music2 app2";
+ stateService.applicationTitle = String.load(String.id.IDS_XBOX_MUSIC2_APP_TITLE);
+ minVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.fue.minMusicAppSupportedVersion);
+ minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.service.minMusicServiceSupportedVersion)
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp) {
+ appDisplayName = String.load(String.id.IDS_MANIFEST_VIDEO_APP_NAME);
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ className = "video video1 app1";
+ stateService.applicationTitle = String.load(String.id.IDS_XBOX_VIDEO_APP_TITLE)
+ }
+ else {
+ className = "video video2 app2";
+ stateService.applicationTitle = String.load(String.id.IDS_XBOX_VIDEO2_APP_TITLE)
+ }
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) && !featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace))
+ className += " " + MS.Entertainment.Utilities.noMarketplaceRootClassName;
+ minVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.fue.minVideoAppSupportedVersion);
+ minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.service.minVideoServiceSupportedVersion)
+ }
+ else if (MS.Entertainment.Utilities.isTestApp) {
+ appDisplayName = "test";
+ className = "test";
+ minVersionSupported = MS.Entertainment.Utilities.parseVersionString("1.0.0.0");
+ minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString("1.0.0.0")
+ }
+ else
+ className = String.empty;
+ if (configurationManager.shell.retailExperience)
+ className += " demo";
+ var versionSupported = (MS.Entertainment.Utilities.compareVersions(currentVersion, minVersionSupported) >= 0);
+ stateService.servicesEnabled = (MS.Entertainment.Utilities.compareVersions(currentVersion, minServiceVersionSupported) >= 0);
+ if (!versionSupported) {
+ WinJS.Promise.timeout().then(function _delay() {
+ window.location.href = "UpdateApp.html"
+ });
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ WinJS.Utilities.addClass(document.documentElement, className);
+ MS.Entertainment.UI.Framework.flags.attachCookieToRemovedDomElements = configurationManager.shell.attachCookieToRemovedDomElements;
+ MS.Entertainment.UI.Framework.flags.attachLargeObjectToUnloadedControl = configurationManager.shell.attachLargeObjectToUnloadedControl;
+ if (MS.Entertainment.Utilities.isApp2) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation))
+ MS.Entertainment.ServiceLocator.unregister(MS.Entertainment.Services.winJSNavigation);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoQueryCacheService)) {
+ var videoQueryCacheService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoQueryCacheService);
+ videoQueryCacheService.startQueries()
+ }
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signInApp2User();
+ if (!MS.Entertainment.isAppModeOverride);
+ document.body.addEventListener("keyup", function(e) {
+ if (e.keyCode === WinJS.Utilities.Key.invokeButton || (!e.altKey && e.keyCode === WinJS.Utilities.Key.enter && !MS.Entertainment.Utilities.doesElementSupportKeyboardInput(e.target))) {
+ if (document.activeElement && document.activeElement.click && e.target && e.target.tagName && e.target.tagName.toLowerCase() !== "button") {
+ MS.Entertainment.Utilities.playSelectButtonClick();
+ document.activeElement.click();
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }
+ else if ((e.keyCode === WinJS.Utilities.Key.resetFocus || (e.altKey && e.keyCode === WinJS.Utilities.Key.f)) && !document.activeElement)
+ MS.Entertainment.UI.Framework.resetFocusToTopMostContent();
+ else if (e.altKey && e.keyCode === WinJS.Utilities.Key.m);
+ }, false)
+ }
+ if (MS.Entertainment.Utilities.isMusicApp)
+ MS.Entertainment.Utilities.useRadioStrings();
+ initialized = true
+ }
+ else
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ if (!isNonRootActivationHandler) {
+ var stopTime = new Date;
+ var duration = stopTime.valueOf() - startTime.valueOf();
+ commonEventProvider.traceProcessInitializeEventStop(duration)
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appActivated();
+ var doActivate = function doActivate(evt) {
+ var navigationService;
+ var eventKind;
+ var deeplinkUri;
+ var launchArgs;
+ var previousExecutionState;
+ var PlatLog = Microsoft.Entertainment.Platform.Logging;
+ var dataPoint = new PlatLog.DataPoint(PlatLog.LoggingLevel.telemetry, PlatLog.TelemetryAuthMethod.unauthenticated);
+ dataPoint.appendEventName("X8Run");
+ dataPoint.appendParameter("ClientResolution", screen.width + "x" + screen.height);
+ try {
+ eventKind = evt.kind;
+ previousExecutionState = evt.previousExecutionState
+ }
+ catch(e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception;
+ MS.Entertainment.fail("Exception while trying to acquire activation arguments. Error exception was:" + description + "." + "\n Error was:" + error);
+ return
+ }
+ try {
+ if (evt && evt.uri && evt.uri.rawUri)
+ deeplinkUri = new Windows.Foundation.Uri(evt.uri.rawUri)
+ }
+ catch(e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception;
+ MS.Entertainment.fail("Could not access activation event URI. Error exception was: " + description + "." + "\n Error was " + error)
+ }
+ try {
+ if (evt && evt.arguments)
+ launchArgs = evt.arguments
+ }
+ catch(e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception;
+ MS.Entertainment.fail("Could not access activation event arguments. Error exception was: " + description + "." + "\n Error was " + error)
+ }
+ if (eventKind === Windows.ApplicationModel.Activation.ActivationKind.launch && !deeplinkUri && launchArgs)
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.protocol;
+ else if (eventKind === Windows.ApplicationModel.Activation.ActivationKind.protocol && deeplinkUri && (!deeplinkUri.host || deeplinkUri.host === "default" || deeplinkUri.host === "media-default") && (!deeplinkUri.query || !alreadyHandledLaunch))
+ if (deeplinkUri.schemeName && deeplinkUri.schemeName.toLowerCase().indexOf("playto") !== -1)
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.protocol;
+ else
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.launch;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.applicationStateManager)) {
+ var applicationStateManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.applicationStateManager);
+ var previousStateDeeplinkUri = applicationStateManager.getPreviousApplicationStateDeeplink(previousExecutionState, eventKind);
+ var appAndMachineRegionMatch = !MS.Entertainment.Utilities.isVideoApp2 || MS.Entertainment.Utilities.appRegionMatchesMachineRegion();
+ var isSnapped = MS.Entertainment.Utilities.getWindowWidth() <= 480;
+ if (!deeplinkUri && appAndMachineRegionMatch && previousStateDeeplinkUri && !isSnapped) {
+ deeplinkUri = previousStateDeeplinkUri;
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.protocol
+ }
+ else
+ applicationStateManager.clearPreviousApplicationState()
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind = eventKind;
+ switch (eventKind) {
+ case Windows.ApplicationModel.Activation.ActivationKind.protocol:
+ alreadyHandledLaunch = true;
+ var deepLinkProcessed = false;
+ var preProcessPromise = WinJS.Promise.as();
+ var finishInitializing = function finishInitializing(){};
+ var processStageTwo = function processStageTwo() {
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isSnapped && !(deeplinkUri && deeplinkUri.host === "media-playback"))
+ MS.Entertainment.UI.Components.Shell.getUnsnapAction().execute()
+ };
+ if (MS.Entertainment.Utilities.isApp1) {
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ processStageTwo();
+ preProcessPromise = MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }
+ else {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ processStageTwo();
+ finishInitializing = function finishInitializing() {
+ processStageTwo();
+ MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }
+ }
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signInOnStart();
+ preProcessPromise.done(function preProcessFinished() {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ var playToUris = {
+ microsoftMusic: new Windows.Foundation.Uri("microsoftmusic://playto?"), microsoftVideo: new Windows.Foundation.Uri("microsoftvideo://playto?")
+ };
+ var playToStartedFrom = {
+ xboxVideo: "PlayTo-XboxVideo", xboxMusic: "PlayTo-XboxMusic", uknown: "PlayTo-Unknown"
+ };
+ if (!deeplinkUri && launchArgs)
+ dataPoint.appendParameter("StartedFrom", "Deeplink");
+ else if (MS.Entertainment.Utilities.isApp2 && deeplinkUri.schemeName && deeplinkUri.schemeName.toLowerCase().indexOf("playto") !== -1)
+ switch (deeplinkUri.schemeName.toLowerCase()) {
+ case"ms-playto-audio":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.uknown);
+ deeplinkUri = playToUris.microsoftMusic;
+ break;
+ case"ms-playtoapp-xboxmusic":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.xboxMusic);
+ deeplinkUri = playToUris.microsoftMusic;
+ break;
+ case"ms-playto-video":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.uknown);
+ deeplinkUri = playToUris.microsoftVideo;
+ break;
+ case"ms-playtoapp-xboxvideo":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.xboxVideo);
+ deeplinkUri = playToUris.microsoftVideo;
+ break;
+ default:
+ break
+ }
+ else
+ dataPoint.appendParameter("StartedFrom", "Tile");
+ if (!deepLinkProcessed)
+ WinJS.Promise.join({
+ validDeepLink: (deeplinkUri), showWelcomeDialog: MS.Entertainment.UI.Application.Helpers.shouldShowWelcomeDialog(), isLocationDeeplink: (deeplinkUri && deeplinkUri.host === "location"), isTestDeeplink: (deeplinkUri && deeplinkUri.host === "runTest"), isTunerConfigDeeplink: (deeplinkUri && deeplinkUri.host === "tunerConfig")
+ }).then(function(result) {
+ var showWelcomeDialog = result.validDeepLink && result.validDeepLink !== playToUris.microsoftVideo && result.showWelcomeDialog && !result.isTestDeeplink;
+ MS.Entertainment.UI.Application.Helpers.appConfig.showWelcomeDialog = showWelcomeDialog;
+ var stage3Promise = WinJS.Promise.as();
+ if (result.isLocationDeeplink || result.isTunerConfigDeeplink || result.isTestDeeplink) {
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ if (result.isTestDeeplink)
+ stage3Promise = MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }
+ if (showWelcomeDialog)
+ return stage3Promise.then(function() {
+ return MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen()
+ });
+ else
+ return stage3Promise
+ }).done(function processDeeplink() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!MS.Entertainment.UI.DeepLink.processProtocol((deeplinkUri && deeplinkUri.rawUri), dataPoint, launchArgs)) {
+ finishInitializing();
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ navigationService.clearBackStackOnNextNavigate(false);
+ if (!navigationService.currentPage)
+ navigationService.init();
+ else
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ var title = MS.Entertainment.Utilities.isVideoApp ? String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE) : String.load(String.id.IDS_MUSIC_DEEPLINK_ERROR_GENERIC_TITLE);
+ var description = MS.Entertainment.Utilities.isVideoApp ? String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC) : String.load(String.id.IDS_MUSIC_DEEPLINK_ERROR_GENERIC_DESC);
+ WinJS.Promise.timeout(1).done(function showErrorDialog() {
+ MS.Entertainment.UI.Shell.showMessageBox(title, description)
+ })
+ }
+ else {
+ finishInitializing();
+ var forceExitToSystemOnBack = true;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.applicationStateManager)) {
+ var applicationStateManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.applicationStateManager);
+ if (applicationStateManager.previousApplicationState && applicationStateManager.previousApplicationState.hasBackStack)
+ forceExitToSystemOnBack = false
+ }
+ navigationService.forceExitToSystemOnBack = forceExitToSystemOnBack;
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ if (isFirstRun)
+ if ((MS.Entertainment.Utilities.isVideoApp) || (MS.Entertainment.Utilities.isMusicApp))
+ if (deeplinkUri && deeplinkUri.host && deeplinkUri.host === "play")
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayProtectedContent()
+ }
+ })
+ });
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.file:
+ MS.Entertainment.UI.Application.Helpers.waitForDatabaseUpdated();
+ if (isFirstRun && !isNonRootActivationHandler)
+ if ((MS.Entertainment.Utilities.isVideoApp) || (MS.Entertainment.Utilities.isMusicApp)) {
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayNonProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayProtectedContent()
+ }
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ var loadFileActivationHtmlPromise = null;
+ if (MS.Entertainment.Utilities.isApp1)
+ loadFileActivationHtmlPromise = MS.Entertainment.Utilities.loadHtmlPage("/fileActivationStartup.html", "delayedStartupContainer");
+ else
+ loadFileActivationHtmlPromise = WinJS.Promise.wrap();
+ loadFileActivationHtmlPromise.done(function loadFileActivationFiles() {
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.none;
+ var suppressNavigateToImmersive = false;
+ var beginPlaybackPromise = new WinJS.Promise.as;
+ if (!isNonRootActivationHandler)
+ beginPlaybackPromise = MS.Entertainment.Activation.fileActivationHandler(evt, !isFirstRun, suppressNavigateToImmersive);
+ beginPlaybackPromise.then(function continueStageTwo() {
+ if (!suppressNavigateToImmersive)
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.startup;
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ if (isFirstRun && suppressNavigateToImmersive) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!isNonRootActivationHandler && !preLaunched)
+ navigationService.skipEnterAnimationOnNextNavigation = true;
+ navigationService.init()
+ }
+ else
+ MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }, function onError() {
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).init()
+ })
+ });
+ dataPoint.appendParameter("StartedFrom", "File");
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.launch:
+ if (alreadyHandledLaunch)
+ return;
+ alreadyHandledLaunch = true;
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ if (deeplinkUri && deeplinkUri.query && deeplinkUri.host === "default")
+ try {
+ var playState = deeplinkUri.queryParsed.getFirstValueByName("PlayState");
+ startPlaybackOnLaunch = playState && playState.toLowerCase() === MS.Entertainment.UI.DeepLink.PlayStateType.play
+ }
+ catch(e) {
+ startPlaybackOnLaunch = false
+ }
+ else
+ startPlaybackOnLaunch = MS.Entertainment.Utilities.isMusicApp2;
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var defaultLaunchSetting = String.Empty;
+ var moniker = String.empty;
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ defaultLaunchSetting = Windows.Storage.ApplicationData.current.roamingSettings.values["launchLocation"];
+ moniker = MS.Entertainment.UI.Monikers[defaultLaunchSetting]
+ }
+ if (!defaultLaunchSetting || !moniker)
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ MS.Entertainment.ViewModels.VideoSpotlight.startupVideoSpotlight = new MS.Entertainment.ViewModels.VideoSpotlight
+ }
+ navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!isNonRootActivationHandler && !preLaunched)
+ navigationService.skipEnterAnimationOnNextNavigation = true;
+ navigationService.init();
+ dataPoint.appendParameter("StartedFrom", "Tile");
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.search:
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ MS.Entertainment.UI.Application.Activation.activateStageThree().done(function stageThreeActivated() {
+ var handled = false;
+ if (evt && evt.queryText) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ if (MS.Entertainment.ViewModels.SearchContractViewModel.current)
+ handled = MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSubmitted(evt)
+ }
+ if (!handled)
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).init();
+ dataPoint.appendParameter("StartedFrom", "Deeplink");
+ dataPoint.appendParameter("DeeplinkSource", "Search")
+ });
+ break
+ }
+ {};
+ if (!isNonRootActivationHandler)
+ MS.Entertainment.Utilities.Telemetry.closeDataPoint(dataPoint)
+ };
+ doActivate(activationArgs)
+ }, resuming: function resuming(e) {
+ if (isPrelaunched)
+ return;
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceProcessResumeEventStart();
+ var startTime = new Date;
+ if (!applicationLifetimeManager)
+ applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ applicationLifetimeManager.raiseResuming();
+ if (tileManager && MS.Entertainment.Utilities.isApp1)
+ tileManager.updateTile();
+ commonEventProvider.traceProcessResumeTelemetryStart();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appResumed();
+ commonEventProvider.traceProcessResumeTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onResuming();
+ wasRecentlyResumed = true;
+ var stopTime = new Date;
+ var duration = stopTime.valueOf() - startTime.valueOf();
+ commonEventProvider.traceProcessResumeEventStop(duration);
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Platform.PlayTo.initPlayToReceiver().done(null, function onInitPlayToReceiverError(){})
+ }, suspending: function suspending(e) {
+ if (isPrelaunched)
+ return;
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceProcessSuspendEventStart();
+ var startTime = new Date;
+ if (!applicationLifetimeManager)
+ applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ applicationLifetimeManager.raiseSuspending();
+ commonEventProvider.traceProcessSuspendTelemetryStart();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appSuspended();
+ commonEventProvider.traceProcessSuspendTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onSuspending();
+ var stopTime = new Date;
+ var duration = stopTime.valueOf() - startTime.valueOf();
+ commonEventProvider.traceProcessSuspendEventStop(duration);
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Platform.PlayTo.stopPlayToReceiver(e.suspendingOperation.getDeferral()).done(function onStopPlayToReceiver(){}, function onStopPlayToReceiverError(){})
+ }, unload: function unload(e) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionMgr)
+ sessionMgr.displayRequestRelease()
+ }
+ var app = new Microsoft.Entertainment.Application.Application;
+ app.shutdownAsync();
+ window.removeEventListener("unload", MS.Entertainment.UI.Application.Activation.unload)
+ }, activateStageTwo: function activateStageTwo() {
+ if (stageTwoInitialized)
+ return;
+ stageTwoInitialized = true;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService).initialize();
+ MS.Entertainment.UI.Components.Shell.initializeSnappedMode();
+ if (MS.Entertainment.Utilities.isApp2) {
+ WinJS.Utilities.addClass(document.body, "showKeyboardFocus");
+ MS.Entertainment.Platform.PlayTo.initPlayToReceiver().done(null, function onInitPlayToReceiverError(){})
+ }
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var attemptedReload = false;
+ if (startPlaybackOnLaunch) {
+ signIn.signInOnStart();
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ attemptedReload = true;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).preloadNowPlayingControls();
+ if (signedInUser && signedInUser.gamerTag === configurationManager.service.lastSignedInUserGamerTag)
+ MS.Entertainment.Platform.PlaybackHelpers.reloadNowPlaying(true);
+ else
+ attemptedReload = false
+ }
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.reloadNowPlaying(false);
+ var binding = MS.Entertainment.Utilities.addEventHandlers(signIn, {isSignedInChanged: function onSignInChange(event) {
+ var isSignedIn = event.detail.newValue;
+ if (isSignedIn) {
+ if (startPlaybackOnLaunch && !attemptedReload) {
+ MS.Entertainment.Platform.PlaybackHelpers.reloadNowPlaying(true);
+ attemptedReload = true
+ }
+ }
+ else {
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ if (playbackSession) {
+ playbackSession.setDataSource(null);
+ playbackSession.currentMedia = null;
+ playbackSession.pendingOrdinal = null;
+ MS.Entertainment.Platform.PlaybackHelpers.playActionInitiated = false
+ }
+ attemptedReload = false;
+ playbackSession = null
+ }
+ }})
+ }
+ var iaService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ iaService.initialize();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus);
+ if (MS.Entertainment.FeatureEnablement)
+ MS.Entertainment.FeatureEnablement.initialize()
+ }, activateStageThree: function activateStageThree() {
+ var _delayTimerMS = 50;
+ if (shouldShowAppBar && !window.onNewMusicPage)
+ WinJS.Promise.timeout(showAppBarDelay).done(function() {
+ var appBarControl = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBarControl)
+ appBarControl.show(MS.Entertainment.UI.Controls.BottomAppBar.defaultHideTimeoutMS);
+ shouldShowAppBar = false;
+ showAppBarDelay = 0
+ });
+ if (stageThreePromise)
+ return stageThreePromise;
+ var delayedStageThreePath = "/delayedStageThreeStartup.html";
+ if (window.onNewVideoPage)
+ delayedStageThreePath = "/Classic" + delayedStageThreePath;
+ stageThreePromise = MS.Entertainment.Utilities.loadHtmlPage(delayedStageThreePath, "delayedStartupContainer").then(function loadStageThreeFiles() {
+ if (MS.Entertainment.UI.Application.Helpers.activationTelemetryData && MS.Entertainment.UI.Application.Helpers.activationTelemetryData.length > 0) {
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData.forEach(function itemIterator(dataPoint) {
+ dataPoint.write()
+ });
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData = null
+ }
+ if (MS.Entertainment.UI.FileTransferNotificationHandlers) {
+ MS.Entertainment.UI.fileTransferNotificationHandler = new MS.Entertainment.UI.FileTransferNotificationHandlers;
+ MS.Entertainment.UI.fileTransferNotificationHandler.startTransferListener()
+ }
+ if (MS.Entertainment.Utilities.isMusicApp)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits).initialize();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dashboardRefresher).initialize();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.backButton);
+ if (!window.onNewVideoPage) {
+ var pointerUpHandler = function mouseClickHandler(event) {
+ if (event.button === 3) {
+ var navigateBackAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateBackAction.automationId = MS.Entertainment.UI.AutomationIds.mouseNavigateBack;
+ navigateBackAction.parameter = MS.Entertainment.UI.Actions.navigate.NavigateLocation.back;
+ navigateBackAction.execute()
+ }
+ };
+ document.addEventListener("MSPointerUp", pointerUpHandler);
+ document.addEventListener("pointerup", pointerUpHandler)
+ }
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ if (MS.Entertainment.ViewModels.SearchContractViewModel.current)
+ MS.Entertainment.ViewModels.SearchContractViewModel.current.loadSearchObject();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.typeToSearch))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).enableTypeToSearch();
+ if (MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp)
+ MS.Entertainment.Utilities.DRM.individualizationAsync();
+ if (!window.onNewVideoPage) {
+ MS.Entertainment.Framework.KeyboardInteractionListener.init();
+ MS.Entertainment.Framework.KeyboardShortcutHandler.instance.initialize();
+ MS.Entertainment.UI.Shell.createShellKeyboardShortcuts()
+ }
+ if (MS.Entertainment.UI.Shell.createShellVoiceShortcuts)
+ MS.Entertainment.UI.Shell.createShellVoiceShortcuts();
+ if (MS.Entertainment.UI.App2 && MS.Entertainment.UI.App2.registerForVoiceEvents)
+ MS.Entertainment.UI.App2.registerForVoiceEvents();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.pinnedList))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.pinnedList);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender)) {
+ var sender = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ sender.setDefaultEmptyMessage()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionStateHandler))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionStateHandler).initialize();
+ MS.Entertainment.UI.PurchaseHistoryService.initialize();
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ var cloudCollectionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection);
+ cloudCollectionService.startListening()
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).bind("isSignedIn", function onSignInChange(isSignedIn) {
+ if (isSignedIn) {
+ MS.Entertainment.Utilities.Telemetry.ensureKeystoneStarted();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoCloudCollection)) {
+ var videoCloudCollection = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoCloudCollection);
+ videoCloudCollection.startSync()
+ }
+ if (Microsoft.Entertainment.FileTransferManager)
+ Microsoft.Entertainment.FileTransferManager.scheduleProgressCheck()
+ }
+ });
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.systemMTCMetadataUpdater))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.systemMTCMetadataUpdater);
+ var appNotificationInitPromise = WinJS.Promise.as();
+ if (!MS.Entertainment.Utilities.isApp2)
+ appNotificationInitPromise = WinJS.Promise.timeout(_delayTimerMS).then(function delay1() {
+ return WinJS.UI.process(MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appInfoNotification))
+ }).then(function initializeControl(control) {
+ if (control)
+ control.delayedInitialize()
+ }).then(function loadCriticalNotification() {
+ return WinJS.UI.process(MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appCriticalNotification)).then(function(control) {
+ control.delayedInitialize()
+ })
+ });
+ return appNotificationInitPromise.then(function delay() {
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification).send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_DEMO_IN_DEMO_MODE), subTitle: "", moreDetails: "", action: null, category: "demo", isPersistent: true
+ }));
+ if (MS.Entertainment.Utilities.isVideoApp2 && WinJS.Utilities.getMember("Microsoft.Entertainment.BackgroundTasks.EpgChannelUpdateTask"))
+ WinJS.Promise.timeout(2000).then(function() {
+ var epg = new Microsoft.Entertainment.BackgroundTasks.EpgChannelUpdateTask;
+ epg.scheduleBackgroundTask();
+ epg.updateChannelsNow()
+ });
+ return WinJS.Promise.timeout(_delayTimerMS).then(function processAppBar() {
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ var processAppBarPromise = WinJS.Promise.wrap();
+ if (bottomAppBar && bottomAppBar.domElement === undefined)
+ processAppBarPromise = WinJS.UI.processAll(bottomAppBar);
+ processAppBarPromise.done(function loadAppBar() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.tileManager) && MS.Entertainment.Utilities.isApp1)
+ tileManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.tileManager);
+ if (!MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar).deferredInit();
+ else
+ MS.Entertainment.UI.Controls.CommandingPopOver.enableEdgeGlobalCommands();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).stageThreeActivated = true
+ }.bind(this))
+ }).then(function delay3() {
+ return WinJS.Promise.timeout(_delayTimerMS).then(function signIn() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return signIn.signInOnStart()
+ })
+ }).then(function delay4() {
+ return WinJS.Promise.timeout(_delayTimerMS).then(function initializePlaybackErrorDisplayService() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService).initialize()
+ })
+ }).then(function delay5() {
+ var stageFourTimer = WinJS.Promise.timeout(stageFourDelay).then(MS.Entertainment.UI.Application.Activation.activateStageFour);
+ return stageFourTimer
+ })
+ })
+ });
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ var isSnappedBinding = WinJS.Binding.bind(uiStateService, {isSnapped: function _isSnappedChanged(isSnapped) {
+ if (isSnapped)
+ return MS.Entertainment.Video.Video2WelcomeDialog.hide();
+ else
+ return MS.Entertainment.Video.Video2WelcomeDialog.show()
+ }});
+ return stageThreePromise
+ }, activateStageFour: function activateStageFour() {
+ if (stageFourPromise)
+ return stageFourPromise;
+ stageFourPromise = MS.Entertainment.Utilities.loadHtmlPage("/delayedStageFourStartup.html", "delayedStartupContainer").then(function stageFourLoadFiles() {
+ if (MS.Entertainment.UI.Actions.ImportPlaylists)
+ MS.Entertainment.UI.Actions.ImportPlaylists.resumeLastPlaylistImport();
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.idleApplicationService).initialize();
+ MS.Entertainment.UI.Application.Helpers.loadNavigateToNowPlayingOnIdleService()
+ }
+ if (MS.Entertainment.Utilities.isApp1 && MS.Entertainment.Framework.UpgradeToBlueNotification)
+ MS.Entertainment.Framework.UpgradeToBlueNotification.showNotification();
+ if (!MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.UI.Framework.unblockPreloading();
+ if (MS.Entertainment.Utilities.isVideoApp)
+ MS.Entertainment.Data.Query.Video.requestFields.cacheRequestFields()
+ });
+ return stageFourPromise
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Application.Helpers", {
+ splashScreenCleared: function splashScreenCleared() {
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceSplashScreen_Removed()
+ }, activationTelemetryData: null, windowResizeSplashScreenHandler: null, showExtendedSplashScreen: function showExtendedSplashScreen(splashDetails) {
+ var splashScreenImage = document.querySelector(".extendedSplashScreenImage");
+ var splashScreenProgressContainer = document.querySelector(".extendedSplashScreenProgressContainer");
+ if (!splashScreenImage)
+ return;
+ if (!splashDetails) {
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ return
+ }
+ MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler = function() {
+ try {
+ var imageLocation = splashDetails.imageLocation;
+ splashScreenImage.style.top = imageLocation.y + "px";
+ splashScreenImage.style.left = imageLocation.x + "px";
+ splashScreenImage.style.height = imageLocation.height + "px";
+ splashScreenImage.style.width = imageLocation.width + "px";
+ splashScreenProgressContainer.style.marginTop = imageLocation.y + imageLocation.height + 32 + "px"
+ }
+ catch(e) {
+ MS.Entertainment.fail("Exception trying to get splash screen information: " + e.toString())
+ }
+ };
+ MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler();
+ window.addEventListener("resize", MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler)
+ }, updateExtendedSplashScreenMessage: function updateExtendedSplashScreenMessage(title, message) {
+ var splashScreenTitle = document.querySelector(".extendedSplashScreenTitle");
+ var splashScreenMessage = document.querySelector(".extendedSplashScreenMessage");
+ if (splashScreenTitle)
+ splashScreenTitle.innerText = title;
+ if (splashScreenMessage)
+ splashScreenMessage.innerText = message
+ }, waitForDatabaseUpdated: function waitForDatabaseUpdated() {
+ var mediaStore;
+ var promise;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ if (mediaStore && mediaStore.databaseNeedsUpgrade) {
+ var query;
+ var waitTitle = String.load(String.id.IDS_APP_UPDATE_SPLASH_TITLE);
+ var waitMessage = String.load(String.id.IDS_APP_UPDATE_SPLASH_SUBTITLE);
+ MS.Entertainment.UI.Application.Helpers.updateExtendedSplashScreenMessage(waitTitle, waitMessage);
+ promise = mediaStore.ensureDatabaseOpenedAsync().then(null, function ignoreError(){})
+ }
+ return WinJS.Promise.as(promise)
+ }, _inProgressRemoveExtendedSplashScreen: false, removeExtendedSplashScreenDOM: function removeExtendedSplashScreenDOM() {
+ var extendedSplashScreen = document.querySelector(".extendedSplashScreen");
+ if (!extendedSplashScreen)
+ return;
+ window.removeEventListener("resize", MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler);
+ MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler = null;
+ MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen = false;
+ if (extendedSplashScreen.parentElement)
+ extendedSplashScreen.parentElement.removeChild(extendedSplashScreen);
+ if (isPrelaunched) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.skipEnterAnimationOnNextNavigation = false;
+ var unsnappedElement = document.getElementById("htmlUnsnapped");
+ if (unsnappedElement)
+ WinJS.Utilities.removeClass(unsnappedElement, "hideFromDisplay")
+ }
+ }, removeExtendedSplashScreen: function removeExtendedSplashScreen() {
+ if (MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen)
+ return WinJS.Promise.as();
+ if (isPrelaunched) {
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreenDOM();
+ return WinJS.Promise.as()
+ }
+ MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen = true;
+ return MS.Entertainment.UI.Application.Helpers.waitForDatabaseUpdated().then(function databaseUpdateFinishedOrNotNeeded() {
+ return MS.Entertainment.Utilities.loadDemoScripts()
+ }).then(function demoScriptsLoaded() {
+ var extendedSplashScreen = document.querySelector(".extendedSplashScreen");
+ var welcomeScreenDisplayed = WinJS.Promise.as();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService))
+ welcomeScreenDisplayed = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.welcomeDialogService).initialize();
+ if (!extendedSplashScreen) {
+ MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen = false;
+ return
+ }
+ welcomeScreenDisplayed.done(MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreenDOM, MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreenDOM);
+ var unsnappedElement = document.getElementById("htmlUnsnapped");
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (unsnappedElement && !uiStateService.isSnapped)
+ WinJS.Utilities.removeClass(unsnappedElement, "hideFromDisplay");
+ if (MS.Entertainment.Utilities.isApp2)
+ WinJS.Utilities.addClass(document.body, "showKeyboardFocus");
+ var currentPage = document.querySelector(".pageContainer.currentPage");
+ if (currentPage) {
+ MS.Entertainment.Utilities.enterElement(currentPage).done(function() {
+ MS.Entertainment.UI.Framework.setFocusRoot(currentPage)
+ });
+ if (MS.Entertainment.Utilities.isApp2 && document.activeElement)
+ WinJS.Utilities.addClass(document.activeElement, "acc-keyboardFocusTarget")
+ }
+ else {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.skipEnterAnimationOnNextNavigation = false
+ }
+ return MS.Entertainment.UI.Application.Helpers.shouldShowWelcomeDialog().then(function(shouldShowWelcomeDialog) {
+ if (!shouldShowWelcomeDialog)
+ return;
+ MS.Entertainment.assert(MS.Entertainment.Utilities.isApp2, "Only allowed in App2");
+ var showPromise = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.welcomeDialogService).show() : MS.Entertainment.Video.Video2WelcomeDialog.show();
+ var onDialogDismissed = function onDialogDismissed() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService))
+ MS.Entertainment.UI.Application.Helpers.setShowWelcomeDialogState(false);
+ if (unsnappedElement && !uiStateService.isSnapped) {
+ var dashboardElement = document.querySelector(".currentPage .navigationHost.dashboardHost");
+ if (dashboardElement && dashboardElement.winControl && dashboardElement.winControl.focusHome)
+ dashboardElement.winControl.focusHome()
+ }
+ };
+ return showPromise.then(onDialogDismissed, onDialogDismissed)
+ })
+ })
+ }, appConfig: {get: function get() {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return MS.Entertainment.Utilities.isMusicApp ? configManager.music : configManager.video
+ }}, shouldShowWelcomeDialog: function shouldShowWelcomeDialog() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return WinJS.Promise.as(false);
+ var showWelcomeDialog = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService) || MS.Entertainment.UI.Application.Helpers.appConfig.showWelcomeDialog;
+ var welcomeDialogRequired;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService))
+ welcomeDialogRequired = MS.Entertainment.UI.WelcomeDialogService.isWelcomeScreenRequired();
+ else if (MS.Entertainment.Utilities.isVideoApp2) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var hasMarketplace = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ showWelcomeDialog = (!uiStateService.isSnapped && !hasMarketplace)
+ }
+ else if (!MS.Entertainment.isAppModeOverride && MS.Entertainment.Utilities.supportsProtectedContent)
+ showWelcomeDialog = false;
+ return WinJS.Promise.join({
+ shouldShowWelcomeDialog: showWelcomeDialog, welcomeDialogRequired: welcomeDialogRequired || showWelcomeDialog
+ }).then(function(result) {
+ return result.shouldShowWelcomeDialog && WinJS.Utilities.getMember("welcomeDialogRequired.shouldDisplayWelcomeScreen", result)
+ })
+ }, setShowWelcomeDialogState: function setShowWelcomeDialogState(value) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ MS.Entertainment.UI.Application.Helpers.appConfig.showWelcomeDialog = value
+ }, visibilityChanged: function visibilityChanged() {
+ var isVisible = !document.hidden;
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceAppVisibilityChanged(isVisible);
+ var freezeThawTargets = [];
+ var pageContainer;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.isAppVisible = !document.hidden;
+ var freezeThawPageContainer = function freezeThawPageContainer() {
+ pageContainer = document.getElementById("pageContainer");
+ if (pageContainer && pageContainer.childElementCount > 0)
+ (function() {
+ var target = document.querySelector("#pageContainer .currentPage");
+ MS.Entertainment.assert(target, "Didn't find the current page to thaw");
+ if (target)
+ freezeThawTargets.push(target)
+ })();
+ var overlays = document.querySelectorAll(".overlayAnchor");
+ if (overlays)
+ Array.prototype.forEach.call(overlays, function(overlay) {
+ freezeThawTargets.push(overlay)
+ })
+ };
+ if (!uiStateService.isSnapped)
+ freezeThawPageContainer();
+ else
+ (function() {
+ var target = document.querySelector("#htmlSnapped");
+ if (WinJS.Utilities.hasClass(target, "hideFromDisplay"))
+ freezeThawPageContainer();
+ else {
+ MS.Entertainment.assert(target, "Didn't find the current page to thaw");
+ freezeThawTargets.push(target)
+ }
+ })();
+ if (freezeThawTargets && freezeThawTargets.length)
+ if (document.hidden)
+ freezeThawTargets.forEach(function(freezeThawTarget) {
+ MS.Entertainment.Utilities.freezeControlsInSubtree(freezeThawTarget)
+ });
+ else {
+ freezeThawTargets.forEach(function(freezeThawTarget) {
+ MS.Entertainment.Utilities.thawControlsInSubtree(freezeThawTarget)
+ });
+ if (WinJS.Utilities.getMember("Microsoft.PerfTrack.PerfTrackTimePoint.responsive"))
+ if (wasRecentlyResumed)
+ MS.Entertainment.Instrumentation.PerfTrack.getLogger().writeResumeStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive)
+ }
+ wasRecentlyResumed = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appVisibilityChanged();
+ if (isVisible && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.richPresence)) {
+ var richPresenceService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.richPresence);
+ richPresenceService.refreshRichPresence()
+ }
+ try {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ mediaStore.prepareDatabaseForSuspend(!isVisible)
+ }
+ catch(e) {}
+ if (isVisible && MS.Entertainment.Utilities.isVideoApp2 && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoCloudCollection)) {
+ var videoCloudCollection = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoCloudCollection);
+ videoCloudCollection.startSync()
+ }
+ }, handleDashboardVisible: function handleDashboardVisible() {
+ if (!MS.Entertainment.Utilities.isApp2) {
+ var appBar = document.querySelector(".bottomAppBar");
+ WinJS.Utilities.removeClass(appBar, "removeFromDisplay")
+ }
+ document.removeEventListener("HubStripVisible", MS.Entertainment.UI.Application.Helpers.handleDashboardVisible);
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ WinJS.Promise.timeout(1).done(function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunch()
+ })
+ }, handleDashboardReady: function handleDashboardReady() {
+ document.removeEventListener("HubStripReady", MS.Entertainment.UI.Application.Helpers.handleDashboardReady);
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.normal;
+ WinJS.Promise.timeout().then(function _delayHandleDashboardReady() {
+ MS.Entertainment.UI.Application.Activation.activateStageThree()
+ })
+ }, rejectImageDrags: function rejectImageDrags(event) {
+ if (event.target.tagName === "IMG")
+ event.preventDefault()
+ }, navigateBack: function navigateBack() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack()
+ }, loadNavigateToNowPlayingOnIdleService: function loadNavigateToNowPlayingOnIdleService() {
+ var idleApplicationService = new MS.Entertainment.Framework.IdleApplicationService;
+ idleApplicationService.initialize();
+ idleApplicationService.setIdleTime(60000);
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ idleApplicationService.addEventListener(idleApplicationService.applicationIdleEvent, function navigateToNowPlaying() {
+ if (uiStateService && !uiStateService.isSnapped && !uiStateService.nowPlayingVisible && !uiStateService.isSearchPaneVisible && !uiStateService.overlayVisible && !uiStateService.activeListening && !uiStateService.nuiEngaged && playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing && playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.ready)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: playbackSession.sessionId, startFullScreen: false
+ })
+ })
+ }
+ });
+ if (!MS.Entertainment.Utilities.systemAppListenersAttached) {
+ Windows.UI.WebUI.WebUIApplication.addEventListener("activated", MS.Entertainment.UI.Application.Activation.activated);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", MS.Entertainment.UI.Application.Activation.resuming);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", MS.Entertainment.UI.Application.Activation.suspending);
+ window.addEventListener("unload", MS.Entertainment.UI.Application.Activation.unload, false);
+ document.addEventListener("dragstart", MS.Entertainment.UI.Application.Helpers.rejectImageDrags, true);
+ MS.Entertainment.Utilities.systemAppListenersAttached = true
+ }
+ document.addEventListener("visibilitychange", MS.Entertainment.UI.Application.Helpers.visibilityChanged, false);
+ document.addEventListener("HubStripVisible", MS.Entertainment.UI.Application.Helpers.handleDashboardVisible);
+ document.addEventListener("HubStripReady", MS.Entertainment.UI.Application.Helpers.handleDashboardReady);
+ MS.Entertainment.Utilities.processAllOnDocumentLoaded().then(function mainLoaded() {
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceFinish_ProcessAll()
+ })
+})()
diff --git a/packages/microsoft.zunemusic/main_merged.js b/packages/microsoft.zunemusic/main_merged.js
new file mode 100644
index 00000000..c47c8246
--- /dev/null
+++ b/packages/microsoft.zunemusic/main_merged.js
@@ -0,0 +1,50499 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+const App2 = null;
+const XboxJS = null;
+
+(function () {
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ scriptMappings: {
+ "/winrttemplateproviderstubs.js": "/main_merged.js",
+ "/components/perftrack/perftrack.js": "/main_merged.js",
+ "/framework/commonstringids.js": "/main_merged.js",
+ "/framework/nativestringids.js": "/main_merged.js",
+ "/framework/lockedstringids.js": "/main_merged.js",
+ "/framework/musicstringids.js": "/main_merged.js",
+ "/framework/music1stringids.js": "/main_merged.js",
+ "/framework/corefx.js": "/main_merged.js",
+ "/framework/scriptvalidator.js": "/main_merged.js",
+ "/framework/debug.js": "/main_merged.js",
+ "/framework/utilities.js": "/main_merged.js",
+ "/framework/servicelocator.js": "/main_merged.js",
+ "/framework/musicserviceidentifiers.js": "/main_merged.js",
+ "/framework/telemetryutilities.js": "/main_merged.js",
+ "/framework/usertimetelemetrymanager.js": "/main_merged.js",
+ "/framework/uistateservice.js": "/main_merged.js",
+ "/framework/observablearray.js": "/main_merged.js",
+ "/framework/data/factory.js": "/main_merged.js",
+ "/framework/data/ranges.js": "/main_merged.js",
+ "/framework/data/grouper.js": "/main_merged.js",
+ "/framework/data/list.js": "/main_merged.js",
+ "/framework/data/virtuallist.js": "/main_merged.js",
+ "/framework/data/query.js": "/main_merged.js",
+ "/framework/keyboardnavigationmanager.js": "/main_merged.js",
+ "/framework/querywatcher.js": "/main_merged.js",
+ "/framework/actionidentifiers.js": "/main_merged.js",
+ "/framework/musicactionidentifiers.js": "/main_merged.js",
+ "/framework/automationidentifiers.js": "/main_merged.js",
+ "/framework/musicautomationidentifiers.js": "/main_merged.js",
+ "/framework/action.js": "/main_merged.js",
+ "/controls/listcontrols.js": "/main_merged.js",
+ "/controls/droptargetcontainer.js": "/main_merged.js",
+ "/framework/selectionmanager.js": "/main_merged.js",
+ "/framework/data/augmenters/commonaugmenters.js": "/main_merged.js",
+ "/controls/pivotcontrols.js": "/main_merged.js",
+ "/components/music/playplaylist.js": "/main_merged.js",
+ "/viewmodels/music/playlistsviewmodel.js": "/main_merged.js",
+ "/framework/winjsnavigation.js": "/main_merged.js",
+ "/components/shell/appnotification.js": "/main_merged.js",
+ "/components/shell/listnotification.js": "/main_merged.js",
+ "/components/shell/dragdataservice.js": "/main_merged.js",
+ "/components/signin/signinerrors.js": "/main_merged.js",
+ "/components/signin/signin.js": "/main_merged.js",
+ "/components/playback/playbackhelpers.js": "/main_merged.js",
+ "/framework/endpoints.js": "/main_merged.js",
+ "/components/music/cloudcollectionservice.js": "/main_merged.js",
+ "/framework/accutils.js": "/main_merged.js",
+ "/framework/pluralizationutilities.js": "/main_merged.js",
+ "/framework/formatters.js": "/main_merged.js",
+ "/framework/music1/collectionchangenotifier.js": "/main_merged.js",
+ "/framework/navigatetopageaction.js": "/main_merged.js",
+ "/framework/music1/navigateactions.js": "/main_merged.js",
+ "/framework/deeplink.js": "/main_merged.js",
+ "/framework/music1/musicdeeplinks.js": "/main_merged.js",
+ "/framework/music1/musicdeeplinksactions.js": "/main_merged.js",
+ "/framework/music1/musicflyoutactions.js": "/main_merged.js",
+ "/framework/shortcutmanager.js": "/main_merged.js",
+ "/framework/keyboardshortcuthandler.js": "/main_merged.js",
+ "/framework/data/augmenters/commonhydrators.js": "/main_merged.js",
+ "/framework/data/augmenters/musichydrators.js": "/main_merged.js",
+ "/framework/data/augmenters/musicaugmenters.js": "/main_merged.js",
+ "/framework/data/queries/libraryqueries.js": "/main_merged.js",
+ "/framework/data/observablearrayvirtuallistadapter.js": "/main_merged.js",
+ "/framework/fileactivationhandler.js": "/main_merged.js",
+ "/components/search/typetosearchservice.js": "/main_merged.js",
+ "/components/music1/anonymousfreeplay.js": "/main_merged.js",
+ "/components/playback/playbackstates.js": "/main_merged.js",
+ "/components/playback/playbackeventnotifications.js": "/main_merged.js",
+ "/components/playback/playbackerrors.js": "/main_merged.js",
+ "/components/playback/playlist/playlist.js": "/main_merged.js",
+ "/components/playback/controls/mediaplayer.js": "/main_merged.js",
+ "/components/playback/controls/xplayer.js": "/main_merged.js",
+ "/components/playback/playbacktrace.js": "/main_merged.js",
+ "/components/playback/volumecontroller.js": "/main_merged.js",
+ "/components/playback/playlog.js": "/main_merged.js",
+ "/components/playback/session/playbacksession.js": "/main_merged.js",
+ "/framework/networkstatusservice.js": "/main_merged.js",
+ "/components/playback/mediainstance.js": "/main_merged.js",
+ "/components/playback/controls/playbackcontroller.js": "/main_merged.js",
+ "/components/playback/controls/playbackcontrollermusic.js": "/main_merged.js",
+ "/components/playback/controls/playbackcontrollermusic1.js": "/main_merged.js",
+ "/components/playback/controls/playbackcontrol.js": "/main_merged.js",
+ "/controls/transportcontrols/transportcontrols.js": "/main_merged.js",
+ "/components/session/sessionmgr.js": "/main_merged.js",
+ "/controls/transportcontrols/seekbar.js": "/main_merged.js",
+ "/controls/transportcontrols/musictransportcontrols.js": "/main_merged.js",
+ "/components/music/playlistflyoutactions.js": "/main_merged.js",
+ "/controls/messagebox.js": "/main_merged.js",
+ "/controls/errordialog.js": "/main_merged.js",
+ "/framework/managefoldersaction.js": "/main_merged.js",
+ "/coreapplication.js": "/main_merged.js",
+ "/musicwinmain.js": "/main_merged.js",
+ "/framework/abtests.js": "/explorepage_merged.js",
+ "/framework/abtestingutilities.js": "/explorepage_merged.js",
+ "/framework/scriptutilities.js": "/group_2_merged.js",
+ "/framework/filetransfernotificationservice.js": "/group_1_merged.js",
+ "/framework/filetransferservice.js": "/group_1_merged.js",
+ "/components/shell/apptoolbarservice.js": "/group_2_merged.js",
+ "/controls/overlay.js": "/group_1_merged.js",
+ "/framework/shell.js": "/group_1_merged.js",
+ "/components/shell/openfileaction.js": "/group_2_merged.js",
+ "/controls/popover.js": "/group_1_merged.js",
+ "/components/shell/adcontrol.js": "/group_2_merged.js",
+ "/controls/videoad.js": "/group_2_merged.js",
+ "/controls/flyout.js": "/group_2_merged.js",
+ "/controls/iconbutton.js": "/group_1_merged.js",
+ "/framework/disabled.js": "/group_2_merged.js",
+ "/controls/dialog.js": "/group_2_merged.js",
+ "/framework/imageidtypes.js": "/group_1_merged.js",
+ "/framework/urifactory.js": "/group_1_merged.js",
+ "/framework/data/augmenters/edsaugmenters.js": "/group_2_merged.js",
+ "/framework/data/augmenters/spotlightaugmenters.js": "/group_2_merged.js",
+ "/framework/data/queries/marketplacequeries.js": "/group_2_merged.js",
+ "/framework/data/queries/edsqueries.js": "/group_2_merged.js",
+ "/framework/data/queries/musicqueries.js": "/group_2_merged.js",
+ "/controls/webhostexperience.js": "/group_2_merged.js",
+ "/components/shell/purchasehelpers.js": "/group_2_merged.js",
+ "/controls/actionlist.js": "/group_1_merged.js",
+ "/viewmodels/social/sharefactory.js": "/group_2_merged.js",
+ "/viewmodels/social/sharesender.js": "/group_2_merged.js",
+ "/viewmodels/social/sharehost.js": "/group_2_merged.js",
+ "/components/inlinedetails/actionbuttonscontrol.js": "/group_1_merged.js",
+ "/framework/featureenablementservice.js": "/group_1_merged.js",
+ "/components/music/importplaylists.js": "/group_2_merged.js",
+ "/components/music/adservice.js": "/group_2_merged.js",
+ "/controls/music/createplaylistflyout.js": "/group_2_merged.js",
+ "/components/music/subscriptionsignup.js": "/group_2_merged.js",
+ "/components/music1/subscriptionsignup.js": "/group_2_merged.js",
+ "/components/music/musicbranddialog.js": "/group_2_merged.js",
+ "/components/music/freeplaylimits.js": "/group_3_merged.js",
+ "/framework/interactionnotifier.js": "/group_1_merged.js",
+ "/framework/upgradereminderdisplayer.js": "/group_2_merged.js",
+ "/components/music/playlistactions.js": "/group_2_merged.js",
+ "/framework/acquisitiondata.js": "/group_1_merged.js",
+ "/viewmodels/queryviewmodel.js": "/group_1_merged.js",
+ "/viewmodels/music/musicviewmodel.js": "/group_1_merged.js",
+ "/viewmodels/music/musiccollectionviewmodel.js": "/group_1_merged.js",
+ "/viewmodels/mediaitemmodel.js": "/group_1_merged.js",
+ "/framework/imageloader.js": "/group_1_merged.js",
+ "/framework/externalnavigateaction.js": "/explorepage_merged.js",
+ "/viewmodels/purchaseflow/smartbuybuttons.js": "/group_2_merged.js",
+ "/controls/appbar/removeoverlay.js": "/collectionpagedelayedscripts_merged.js",
+ "/controls/music1/notificationflyout.js": "/group_2_merged.js",
+ "/controls/music1/mediastatusflyout.js": "/group_2_merged.js",
+ "/controls/label.js": "/group_1_merged.js",
+ "/animations/galleryanimations.js": "/group_2_merged.js",
+ "/controls/gallerycontrol.js": "/group_1_merged.js",
+ "/framework/downloadaction.js": "/group_2_merged.js",
+ "/components/inlinedetails/baseinlinedetails.js": "/group_2_merged.js",
+ "/controls/nowplaying/nowplayingplaylistmusic1templates.js": "/nowplaying_merged.js",
+ "/components/music/purchaseactions.js": "/group_1_merged.js",
+ "/viewmodels/purchaseflow/smartbuystateengine.js": "/group_2_merged.js",
+ "/framework/navigateaction.js": "/group_1_merged.js",
+ "/controls/link.js": "/group_1_merged.js",
+ "/viewmodels/purchaseflow/musicsmartbuystatehandlers.js": "/group_2_merged.js",
+ "/controls/tooltipcontrol.js": "/group_1_merged.js",
+ "/components/inlinedetails/musicalbuminlinedetails.js": "/group_2_merged.js",
+ "/components/shell/contentnotificationlist.js": "/group_1_merged.js",
+ "/controls/imagecollage.js": "/group_2_merged.js",
+ "/controls/mediaimagecollage.js": "/group_2_merged.js",
+ "/components/inlinedetails/musicartistinlinedetails.js": "/group_2_merged.js",
+ "/controls/music/playlistimagecollage.js": "/group_2_merged.js",
+ "/components/music/cloudmatchoptindialog.js": "/group_2_merged.js",
+ "/framework/contentnotification.js": "/group_1_merged.js",
+ "/viewmodels/purchaseflow/smartappbaractions.js": "/group_2_merged.js",
+ "/controls/music/mediapropertiesflyout.js": "/group_3_merged.js",
+ "/controls/music/selectartistflyout.js": "/radiopagetemplate_merged.js",
+ "/controls/modifier.js": "/group_1_merged.js",
+ "/viewmodels/music1/music1collectionviewmodel.js": "/group_1_merged.js",
+ "/controls/gallerygrouper.js": "/group_1_merged.js",
+ "/framework/downloadinfo.js": "/group_1_merged.js",
+ "/framework/moduleselectionmanager.js": "/group_1_merged.js",
+ "/components/music/musicappstate.js": "/group_2_merged.js",
+ "/components/playback/concurrentstreamingrestriction.js": "/group_1_merged.js",
+ "/components/shell/ipintostartscreeninterop.js": "/group_2_merged.js",
+ "/components/shell/pintostartscreeninterop.js": "/group_2_merged.js",
+ "/components/shell/pintostartscreen.js": "/group_2_merged.js",
+ "/components/music/music1statehandlers.js": "/group_2_merged.js",
+ "/components/music1/musiclxstatehandlers.js": "/group_3_merged.js",
+ "/controls/userfeedbackdialog.js": "/group_2_merged.js",
+ "/controls/pageviewbase.js": "/group_1_merged.js",
+ "/controls/headercontrol.js": "/group_1_merged.js",
+ "/controls/galleryhost.js": "/group_1_merged.js",
+ "/components/music/appbaractions.js": "/group_2_merged.js",
+ "/controls/mediastatusicon.js": "/group_1_merged.js",
+ "/controls/music1/musicmediastatusicon.js": "/group_1_merged.js",
+ "/components/immersivedetails/showimmersivedetailsaction.js": "/group_2_merged.js",
+ "/framework/music1/listnotificationactions.js": "/group_2_merged.js",
+ "/viewmodels/music/musiccollectionverticaltemplates.js": "/group_2_merged.js",
+ "/components/social/sharetemplates.js": "/group_2_merged.js",
+ "/components/playback/addtonowplayingaction.js": "/group_2_merged.js",
+ "/framework/deleteaction.js": "/group_2_merged.js",
+ "/framework/searchaction.js": "/group_3_merged.js",
+ "/components/music/findalbuminfo.js": "/group_2_merged.js",
+ "/components/music/localgrovelinfo.js": "/group_2_merged.js",
+ "/components/music/addtoaction.js": "/group_2_merged.js",
+ "/controls/shrinkandstayheadercontrol.js": "/group_1_merged.js",
+ "/controls/shrinkandstaylistviewlayout.js": "/group_1_merged.js",
+ "/framework/data/virtuallistchangehandler.js": "/group_3_merged.js",
+ "/components/moreaction.js": "/group_3_merged.js",
+ "/components/shell/mediacontext.js": "/group_2_merged.js",
+ "/viewmodels/pageviewmodelbase.js": "/group_2_merged.js",
+ "/viewmodels/viewstateviewmodel.js": "/group_1_merged.js",
+ "/controls/viewstatecontrol.js": "/group_1_merged.js",
+ "/controls/music1/albumdetailsview.js": "/albumdetailspage_merged.js",
+ "/viewmodels/detailspageviewmodelbase.js": "/group_3_merged.js",
+ "/viewmodels/music/musicdetailspageviewmodelbase.js": "/group_3_merged.js",
+ "/viewmodels/music/albumdetailsviewmodelbase.js": "/albumdetailspage_merged.js",
+ "/viewmodels/music1/albumdetailsviewmodel.js": "/albumdetailspage_merged.js",
+ "/viewmodels/music/songsmodule.js": "/group_2_merged.js",
+ "/viewmodels/music/listeditactions.js": "/group_3_merged.js",
+ "/viewmodels/music1/metadataeditactions.js": "/group_3_merged.js",
+ "/viewmodels/mediastoreservice.js": "/group_3_merged.js",
+ "/viewmodels/syncmanagerservice.js": "/group_3_merged.js",
+ "/viewmodels/music1/usagerightrestrictions.js": "/group_2_merged.js",
+ "/viewmodels/music1/usagerightrestrictionsmusic.js": "/group_2_merged.js",
+ "/controls/simpleactionbutton.js": "/group_1_merged.js",
+ "/controls/music1/metadataeditcontrols.js": "/group_unique_merged.js",
+ "/controls/music1/editablecombobox.js": "/group_unique_merged.js",
+ "/controls/delayablecontrol.js": "/group_2_merged.js",
+ "/controls/music1/artistdetailsview.js": "/artistdetailspage_merged.js",
+ "/viewmodels/music/musicmarketplacepivottypes.js": "/group_2_merged.js",
+ "/viewmodels/modulebase.js": "/group_2_merged.js",
+ "/viewmodels/coremodulebase.js": "/group_2_merged.js",
+ "/viewmodels/music/musicmodulebase.js": "/group_2_merged.js",
+ "/viewmodels/music/albumsmodulefactory.js": "/group_2_merged.js",
+ "/viewmodels/music/artistdetailsviewmodelbase.js": "/artistdetailspage_merged.js",
+ "/viewmodels/music/artistsmodule.js": "/group_2_merged.js",
+ "/controls/music1/moduleviewcontrol.js": "/artistdetailspage_merged.js",
+ "/controls/managefoldersview.js": "/collectionpagedelayedscripts_merged.js",
+ "/components/music/cloudgrovelinfo.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataeditcommon.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataeditfields.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataeditcollection.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataediterror.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataediteditors.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataeditmediaviewmodel.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataeditimagefields.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataeditalbumviewmodel.js": "/collectionpagedelayedscripts_merged.js",
+ "/viewmodels/music1/metadataedittrackviewmodel.js": "/collectionpagedelayedscripts_merged.js",
+ "/components/music1/musicmetadataeditdialog.js": "/collectionpagedelayedscripts_merged.js",
+ "/components/music1/albummetadataeditdialog.js": "/collectionpagedelayedscripts_merged.js",
+ "/components/music1/trackmetadataeditdialog.js": "/collectionpagedelayedscripts_merged.js",
+ "/framework/data/listgrouper.js": "/group_1_merged.js",
+ "/components/music/cloudmatchicondialog.js": "/collectionpagetemplate_merged.js",
+ "/controls/signincontrol.js": "/group_2_merged.js",
+ "/controls/music1/devicespageview.js": "/devicespage_merged.js",
+ "/viewmodels/music1/devicegallerymodulebase.js": "/devicespage_merged.js",
+ "/viewmodels/music1/devicepagebase.js": "/devicespage_merged.js",
+ "/viewmodels/music1/devicegallerymodule.js": "/devicespage_merged.js",
+ "/viewmodels/music1/deviceshubviewmodel.js": "/devicespage_merged.js",
+ "/viewmodels/music1/devicesalbumdetailsviewmodel.js": "/devicespage_merged.js",
+ "/viewmodels/music1/devicesalbumdetailsgalleryviewmodel.js": "/devicespage_merged.js",
+ "/viewmodels/music/upsellviewmodel.js": "/group_2_merged.js",
+ "/framework/data/queries/spotlightqueries.js": "/explorepage_merged.js",
+ "/viewmodels/music/radiocollectionviewmodelbase.js": "/group_2_merged.js",
+ "/controls/carousel.js": "/explorepage_merged.js",
+ "/controls/music1/explorehub.js": "/group_2_merged.js",
+ "/viewmodels/music/explorehubviewmodelbase.js": "/group_2_merged.js",
+ "/viewmodels/music/heromodule.js": "/explorepage_merged.js",
+ "/monikers.js": "/explorepage_merged.js",
+ "/viewmodels/music1/playbackprivileges.js": "/explorepage_merged.js",
+ "/controls/music1/fuepage.js": "/fuepagetemplate_merged.js",
+ "/viewmodels/music1/fuepageviewmodel.js": "/fuepagetemplate_merged.js",
+ "/viewmodels/music/musicmarketplaceviewmodelbase.js": "/musicmarketplacepagetemplate_merged.js",
+ "/viewmodels/music1/newmusicmarketplaceviewmodel.js": "/musicmarketplacepagetemplate_merged.js",
+ "/viewmodels/music1/topmusicmarketplaceviewmodel.js": "/musicmarketplacepagetemplate_merged.js",
+ "/viewmodels/music/artistmediaviewmodel.js": "/musicmarketplacepagetemplate_merged.js",
+ "/controls/music1/playlistdetailsview.js": "/playlistdetailspage_merged.js",
+ "/viewmodels/music/virtualplaylistchangehandler.js": "/playlistdetailspage_merged.js",
+ "/viewmodels/music/playlistdetailsviewmodelbase.js": "/playlistdetailspage_merged.js",
+ "/viewmodels/music1/playlistdetailsviewmodel.js": "/playlistdetailspage_merged.js",
+ "/controls/music1/radiopageview.js": "/radiopagetemplate_merged.js",
+ "/controls/music1/searchresultsview.js": "/group_4_merged.js",
+ "/viewmodels/searchviewmodelbase.js": "/group_4_merged.js",
+ "/viewmodels/music/musicsearchviewmodelbase.js": "/group_4_merged.js",
+ "/viewmodels/music/musicsearchhubviewmodelbase.js": "/searchresultshubpage_merged.js",
+ "/viewmodels/searchgalleryviewmodelbase.js": "/searchresultspage_merged.js",
+ "/viewmodels/searchmodule.js": "/searchresultspage_merged.js",
+ "/viewmodels/music/musicsearchgalleryviewmodelbase.js": "/searchresultspage_merged.js",
+ "/viewmodels/music/musicsearchmodule.js": "/searchresultspage_merged.js",
+ "/controls/nowplaying/nowplayingoverlays.js": "/nowplaying_merged.js",
+ }
+ });
+})();
+/* >>>>>>/winrttemplateproviderstubs.js:290 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function initMicrosoft_Zune_Common(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Common = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.CommonTemplate
+ };
+ var proto = ns.Common.prototype;
+ proto.is_ShipAssertEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.trace_ShipAssert = function (id, param, message, hResult, functionName, file, line) {
+ providerTemplates.traceTemplate_qqzdzzq(0, id, param, message, hResult, functionName, file, line)
+ };
+ proto.isBusinessIntelligenceScalarDataPointEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceBusinessIntelligenceScalarDataPoint = function (id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qjiqqtzq(1, id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterName, parameterValue)
+ };
+ proto.isBusinessIntelligenceStreamDataPointEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceBusinessIntelligenceStreamDataPoint = function (id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterCount) {
+ providerTemplates.traceTemplate_qjiqqtq(2, id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterCount)
+ };
+ proto.isBusinessIntelligenceStreamIntParameterEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceBusinessIntelligenceStreamIntParameter = function (id, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qzq(3, id, parameterName, parameterValue)
+ };
+ proto.isBusinessIntelligenceStreamBooleanParameterEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceBusinessIntelligenceStreamBooleanParameter = function (id, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qzt(4, id, parameterName, parameterValue)
+ };
+ proto.isBusinessIntelligenceStreamStringParameterEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceBusinessIntelligenceStreamStringParameter = function (id, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qzz(5, id, parameterName, parameterValue)
+ };
+ proto.isClientLaunchEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceClientLaunch = function () {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isClientShutdownEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceClientShutdown = function (code) {
+ providerTemplates.traceTemplate_d(7, code)
+ };
+ proto.isEventSystemErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceEventSystemError = function (errorCode, provider, eventChannel, eventId, eventKeywords, eventLevel, eventOpcode, eventTask, eventVersion) {
+ providerTemplates.traceTemplate_qjqqxqqqq(8, errorCode, provider, eventChannel, eventId, eventKeywords, eventLevel, eventOpcode, eventTask, eventVersion)
+ };
+ proto.isZuneHostLaunchEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceZuneHostLaunch = function (isElevated, parameter) {
+ providerTemplates.traceTemplate_tz(9, isElevated, parameter)
+ };
+ proto.isZuneHostShutdownEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceZuneHostShutdown = function (code) {
+ providerTemplates.traceTemplate_d(10, code)
+ };
+ proto.isLogFileUploadedToWatsonEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceLogFileUploadedToWatson = function (filePath) {
+ providerTemplates.traceTemplate_z(11, filePath)
+ };
+ proto.isProcessInitializeEventStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceProcessInitializeEventStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isProcessInitializeEventStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceProcessInitializeEventStop = function (durationMsec) {
+ providerTemplates.traceTemplate_q(13, durationMsec)
+ };
+ proto.isProcessSuspendEventStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceProcessSuspendEventStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isProcessSuspendEventStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceProcessSuspendEventStop = function (durationMsec) {
+ providerTemplates.traceTemplate_q(15, durationMsec)
+ };
+ proto.isProcessResumeEventStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceProcessResumeEventStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(16)
+ };
+ proto.isProcessResumeEventStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceProcessResumeEventStop = function (durationMsec) {
+ providerTemplates.traceTemplate_q(17, durationMsec)
+ };
+ proto.isProcessSuspendEventSingletonStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceProcessSuspendEventSingletonStart = function (singletonEnumValue) {
+ providerTemplates.traceTemplate_q(18, singletonEnumValue)
+ };
+ proto.isProcessSuspendEventSingletonStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceProcessSuspendEventSingletonStop = function (singletonEnumValue) {
+ providerTemplates.traceTemplate_q(19, singletonEnumValue)
+ };
+ proto.isProcessResumeEventSingletonStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceProcessResumeEventSingletonStart = function (singletonEnumValue) {
+ providerTemplates.traceTemplate_q(20, singletonEnumValue)
+ };
+ proto.isProcessResumeEventSingletonStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceProcessResumeEventSingletonStop = function (singletonEnumValue) {
+ providerTemplates.traceTemplate_q(21, singletonEnumValue)
+ };
+ proto.isProcessSuspendTelemetryStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceProcessSuspendTelemetryStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isProcessSuspendTelemetryStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceProcessSuspendTelemetryStop = function () {
+ providerTemplates.traceTemplateEventDescriptor(23)
+ };
+ proto.isProcessResumeTelemetryStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceProcessResumeTelemetryStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(24)
+ };
+ proto.isProcessResumeTelemetryStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceProcessResumeTelemetryStop = function () {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isSingletonInitializationStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceSingletonInitializationStarted = function (singletonEnumValue) {
+ providerTemplates.traceTemplate_q(26, singletonEnumValue)
+ };
+ proto.isSingletonInitializationCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceSingletonInitializationCompleted = function (singletonEnumValue) {
+ providerTemplates.traceTemplate_q(27, singletonEnumValue)
+ };
+ proto.isFileTransferManagerInitializationStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceFileTransferManagerInitializationStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(28)
+ };
+ proto.isFileTransferManagerInitializationStopEnabled = function () {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceFileTransferManagerInitializationStop = function () {
+ providerTemplates.traceTemplateEventDescriptor(29)
+ };
+ proto.isFileTransferBackgroundTransferStartFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceFileTransferBackgroundTransferStartFailed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(30, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferAttachFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceFileTransferBackgroundTransferAttachFailed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(31, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceFileTransferBackgroundTransferCompleted = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(32, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceFileTransferBackgroundTransferError = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(33, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferCanceledEnabled = function () {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceFileTransferBackgroundTransferCanceled = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(34, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferMoveToLibraryFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceFileTransferMoveToLibraryFailed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(35, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferDownloadInfoFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceFileTransferDownloadInfoFailed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(36, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferQueuedEnabled = function () {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceFileTransferQueued = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(37, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceFileTransferFailed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(38, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferStart_SuccessedEnabled = function () {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceFileTransferStart_Successed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(39, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferStart_FailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceFileTransferStart_Failed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(40, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceFileTransferCompleted = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(41, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferClosedEnabled = function () {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceFileTransferClosed = function (hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(42, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isClosedCaptionDownloadStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceClosedCaptionDownloadStarted = function (hResult, path, url, isXHR) {
+ providerTemplates.traceTemplate_dzzt(43, hResult, path, url, isXHR)
+ };
+ proto.isClosedCaptionDownloadFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceClosedCaptionDownloadFailed = function (hResult, path, url, isXHR) {
+ providerTemplates.traceTemplate_dzzt(44, hResult, path, url, isXHR)
+ };
+ proto.isClosedCaptionDownloadCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceClosedCaptionDownloadCompleted = function (hResult, path, url, isXHR) {
+ providerTemplates.traceTemplate_dzzt(45, hResult, path, url, isXHR)
+ };
+ proto.isAppVisibilityChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceAppVisibilityChanged = function (appVisible) {
+ providerTemplates.traceTemplate_t(46, appVisible)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Library(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Library = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.LibraryTemplate
+ };
+ var proto = ns.Library.prototype;
+ proto.isEasyTransferIterationStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceEasyTransferIterationStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(0)
+ };
+ proto.isEasyTransferFoundConfigEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceEasyTransferFoundConfig = function () {
+ providerTemplates.traceTemplateEventDescriptor(1)
+ };
+ proto.isEasyTransferNoConfigEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceEasyTransferNoConfig = function () {
+ providerTemplates.traceTemplateEventDescriptor(2)
+ };
+ proto.isEasyTransferParsingConfigEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceEasyTransferParsingConfig = function () {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isEasyTransferConfigParseFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceEasyTransferConfigParseFailed = function () {
+ providerTemplates.traceTemplateEventDescriptor(4)
+ };
+ proto.isEasyTransferConfigParseSucceededEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceEasyTransferConfigParseSucceeded = function () {
+ providerTemplates.traceTemplateEventDescriptor(5)
+ };
+ proto.isEasyTransferAddingPathsEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceEasyTransferAddingPaths = function () {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isEasyTransferNoPathsToAddEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceEasyTransferNoPathsToAdd = function () {
+ providerTemplates.traceTemplateEventDescriptor(7)
+ };
+ proto.isEasyTransferBeginImportingMetadataEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceEasyTransferBeginImportingMetadata = function () {
+ providerTemplates.traceTemplateEventDescriptor(8)
+ };
+ proto.isEasyTransferCompletedImportingMetadataEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceEasyTransferCompletedImportingMetadata = function () {
+ providerTemplates.traceTemplateEventDescriptor(9)
+ };
+ proto.isEasyTransferBeginImportingPlaylistsEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceEasyTransferBeginImportingPlaylists = function () {
+ providerTemplates.traceTemplateEventDescriptor(10)
+ };
+ proto.isEasyTransferCompletedImportingPlaylistsEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceEasyTransferCompletedImportingPlaylists = function () {
+ providerTemplates.traceTemplateEventDescriptor(11)
+ };
+ proto.isEasyTransferIterationCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceEasyTransferIterationComplete = function () {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isEasyTransferCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceEasyTransferComplete = function () {
+ providerTemplates.traceTemplateEventDescriptor(13)
+ };
+ proto.isEasyTransferIterationFailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceEasyTransferIterationFailed = function () {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isEasyTransferParseErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceEasyTransferParseError = function (line, column, message) {
+ providerTemplates.traceTemplate_qqz(15, line, column, message)
+ };
+ proto.isEasyTransferImportedMetadataEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceEasyTransferImportedMetadata = function (mediaId, rating, playCount) {
+ providerTemplates.traceTemplate_qqq(16, mediaId, rating, playCount)
+ };
+ proto.isEasyTransferImportedPlaylistEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceEasyTransferImportedPlaylist = function (name, trackCount, imported) {
+ providerTemplates.traceTemplate_zqt(17, name, trackCount, imported)
+ };
+ proto.isEasyTransferLocatingMediaItemEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceEasyTransferLocatingMediaItem = function (location) {
+ providerTemplates.traceTemplate_z(18, location)
+ };
+ proto.isEasyTransferLocatedMediaItemEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceEasyTransferLocatedMediaItem = function (mediaId, created) {
+ providerTemplates.traceTemplate_qt(19, mediaId, created)
+ };
+ proto.isEasyTransferStateChangeEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceEasyTransferStateChange = function (oldState, newState) {
+ providerTemplates.traceTemplate_qq(20, oldState, newState)
+ };
+ proto.isEasyTransferFailedToLocateMediaItemEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceEasyTransferFailedToLocateMediaItem = function (hResult) {
+ providerTemplates.traceTemplate_d(21, hResult)
+ };
+ proto.isEasyTransferMatchedByFileUrlEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceEasyTransferMatchedByFileUrl = function () {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isGrovelerScanStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceGrovelerScanStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(23)
+ };
+ proto.isGrovelerScanCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceGrovelerScanCompleted = function (fileCount) {
+ providerTemplates.traceTemplate_q(24, fileCount)
+ };
+ proto.isGrovelerQuickScanStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceGrovelerQuickScanStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isGrovelerQuickScanCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceGrovelerQuickScanCompleted = function (receivedFileCount, modifiedFileCount) {
+ providerTemplates.traceTemplate_qq(26, receivedFileCount, modifiedFileCount)
+ };
+ proto.isGrovelerDeleteScanStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceGrovelerDeleteScanStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isGrovelerDeleteScanCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceGrovelerDeleteScanCompleted = function (fileCount) {
+ providerTemplates.traceTemplate_q(28, fileCount)
+ };
+ proto.isGrovelerPlaylistScanStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceGrovelerPlaylistScanStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(29)
+ };
+ proto.isGrovelerPlaylistScanCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceGrovelerPlaylistScanCompleted = function (fileCount) {
+ providerTemplates.traceTemplate_q(30, fileCount)
+ };
+ proto.isGrovelerAdditionScanStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceGrovelerAdditionScanStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isGrovelerAdditionScanCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceGrovelerAdditionScanCompleted = function (fileCount) {
+ providerTemplates.traceTemplate_q(32, fileCount)
+ };
+ proto.isGrovelerFullScanSkippedEnabled = function () {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceGrovelerFullScanSkipped = function () {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isGrovelerTopLevelFolderAddedEnabled = function () {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceGrovelerTopLevelFolderAdded = function () {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ };
+ proto.isGrovelerNotificationReceivedEnabled = function () {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceGrovelerNotificationReceived = function () {
+ providerTemplates.traceTemplateEventDescriptor(35)
+ };
+ proto.isGrovelerNetworkConnectedEnabled = function () {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceGrovelerNetworkConnected = function () {
+ providerTemplates.traceTemplateEventDescriptor(36)
+ };
+ proto.isGrovelerNetworkShareAccessedEnabled = function () {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceGrovelerNetworkShareAccessed = function () {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isGrovelerMasterRatingFileDirtySetEnabled = function () {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceGrovelerMasterRatingFileDirtySet = function () {
+ providerTemplates.traceTemplateEventDescriptor(38)
+ };
+ proto.isGrovelerWriteMasterRatingFileTriggeredEnabled = function () {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceGrovelerWriteMasterRatingFileTriggered = function () {
+ providerTemplates.traceTemplateEventDescriptor(39)
+ };
+ proto.isGrovelerWriteMasterRatingFileStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceGrovelerWriteMasterRatingFileStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(40)
+ };
+ proto.isGrovelerWriteMasterRatingFileCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceGrovelerWriteMasterRatingFileCompleted = function (hResult, ratingCount) {
+ providerTemplates.traceTemplate_dq(41, hResult, ratingCount)
+ };
+ proto.isGrovelerReadMasterRatingFileTriggeredEnabled = function () {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceGrovelerReadMasterRatingFileTriggered = function () {
+ providerTemplates.traceTemplateEventDescriptor(42)
+ };
+ proto.isGrovelerReadMasterRatingFileStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceGrovelerReadMasterRatingFileStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isGrovelerReadMasterRatingFileCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceGrovelerReadMasterRatingFileCompleted = function (hResult, ratingCount) {
+ providerTemplates.traceTemplate_dq(44, hResult, ratingCount)
+ };
+ proto.isGrovelerQueryIndexerDiffEnabled = function () {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceGrovelerQueryIndexerDiff = function (timestamp) {
+ providerTemplates.traceTemplate_z(45, timestamp)
+ };
+ proto.isGrovelerIsQuickGrovelNeededEnabled = function () {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceGrovelerIsQuickGrovelNeeded = function (currentCount, changedCount, quickScanNeeded) {
+ providerTemplates.traceTemplate_qqt(46, currentCount, changedCount, quickScanNeeded)
+ };
+ proto.isGrovelerGetFilesAsyncRetryEnabled = function () {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceGrovelerGetFilesAsyncRetry = function (hResult, retryCount) {
+ providerTemplates.traceTemplate_dq(47, hResult, retryCount)
+ };
+ proto.isGrovelerWaitForCompletionRetryEnabled = function () {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceGrovelerWaitForCompletionRetry = function (hResult, retryCount) {
+ providerTemplates.traceTemplate_dq(48, hResult, retryCount)
+ };
+ proto.isGrovelerGetResultsErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceGrovelerGetResultsError = function (hResult) {
+ providerTemplates.traceTemplate_d(49, hResult)
+ };
+ proto.isGrovelerGetEmptyItemListEnabled = function () {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceGrovelerGetEmptyItemList = function (hResult) {
+ providerTemplates.traceTemplate_d(50, hResult)
+ };
+ proto.isGrovelerRefreshLicenseStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceGrovelerRefreshLicenseStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(51)
+ };
+ proto.isGrovelerRefreshLicenseCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceGrovelerRefreshLicenseCompleted = function (hResult) {
+ providerTemplates.traceTemplate_d(52, hResult)
+ };
+ proto.isGrovelerDefinitionChangedNotificationReceivedEnabled = function () {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceGrovelerDefinitionChangedNotificationReceived = function () {
+ providerTemplates.traceTemplateEventDescriptor(53)
+ };
+ proto.isGrovelerRetriesExhaustedEnabled = function () {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceGrovelerRetriesExhausted = function (hResult, fileCount) {
+ providerTemplates.traceTemplate_dq(54, hResult, fileCount)
+ };
+ proto.isGrovelerAddFileEnabled = function () {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceGrovelerAddFile = function (hResult, fileUrl) {
+ providerTemplates.traceTemplate_dz(55, hResult, fileUrl)
+ };
+ proto.isGrovelerSetFileAvailableEnabled = function () {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceGrovelerSetFileAvailable = function (fileUrl) {
+ providerTemplates.traceTemplate_z(56, fileUrl)
+ };
+ proto.isGrovelerSetFileUnavailableEnabled = function () {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.traceGrovelerSetFileUnavailable = function (fileUrl) {
+ providerTemplates.traceTemplate_z(57, fileUrl)
+ };
+ proto.isGrovelerSecondScanStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.traceGrovelerSecondScanStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(58)
+ };
+ proto.isGrovelerSecondScanCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.traceGrovelerSecondScanCompleted = function (fileCount, unindexedFileCount, unknownFileCount) {
+ providerTemplates.traceTemplate_qqq(59, fileCount, unindexedFileCount, unknownFileCount)
+ };
+ proto.isMDLCStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.traceMDLCStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(60)
+ };
+ proto.isMDLCCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.traceMDLCCompleted = function () {
+ providerTemplates.traceTemplateEventDescriptor(61)
+ };
+ proto.isDatabaseOpenStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceDatabaseOpenStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(62)
+ };
+ proto.isDatabaseOpenCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceDatabaseOpenCompleted = function () {
+ providerTemplates.traceTemplateEventDescriptor(63)
+ };
+ proto.isDatabaseCloseStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceDatabaseCloseStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(64)
+ };
+ proto.isDatabaseCloseCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceDatabaseCloseCompleted = function () {
+ providerTemplates.traceTemplateEventDescriptor(65)
+ };
+ proto.isDbCleanupOnUserSignedOutStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.traceDbCleanupOnUserSignedOutStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(66)
+ };
+ proto.isDbCleanupOnUserSignedOutCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.traceDbCleanupOnUserSignedOutCompleted = function () {
+ providerTemplates.traceTemplateEventDescriptor(67)
+ };
+ proto.isQueryStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.traceQueryStarted = function (queryObjectInstanceId, queryType, actionName) {
+ providerTemplates.traceTemplate_dzz(68, queryObjectInstanceId, queryType, actionName)
+ };
+ proto.isQueryCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(69)
+ };
+ proto.traceQueryCompleted = function (queryObjectInstanceId, queryType, actionName) {
+ providerTemplates.traceTemplate_dzz(69, queryObjectInstanceId, queryType, actionName)
+ };
+ proto.isPlaylistIOStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(70)
+ };
+ proto.tracePlaylistIOStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(70)
+ };
+ proto.isPlaylistIOCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(71)
+ };
+ proto.tracePlaylistIOCompleted = function (readFileCount) {
+ providerTemplates.traceTemplate_q(71, readFileCount)
+ };
+ proto.isBackgroundWorkLock_RequestedEnabled = function () {
+ return !!providerTemplates.eventEnabled(72)
+ };
+ proto.traceBackgroundWorkLock_Requested = function (requestor) {
+ providerTemplates.traceTemplate_z(72, requestor)
+ };
+ proto.isBackgroundWorkLock_AcquiredEnabled = function () {
+ return !!providerTemplates.eventEnabled(73)
+ };
+ proto.traceBackgroundWorkLock_Acquired = function (requestor) {
+ providerTemplates.traceTemplate_z(73, requestor)
+ };
+ proto.isBackgroundWorkLock_ReleasedEnabled = function () {
+ return !!providerTemplates.eventEnabled(74)
+ };
+ proto.traceBackgroundWorkLock_Released = function (requestor) {
+ providerTemplates.traceTemplate_z(74, requestor)
+ };
+ proto.isCollectionBuildingBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(75)
+ };
+ proto.traceCollectionBuildingBegin = function (eventSource) {
+ providerTemplates.traceTemplate_q(75, eventSource)
+ };
+ proto.isCollectionBuildingEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(76)
+ };
+ proto.traceCollectionBuildingEnd = function (eventSource, itemsAdded, itemsTotal, errorState) {
+ providerTemplates.traceTemplate_qqqq(76, eventSource, itemsAdded, itemsTotal, errorState)
+ };
+ proto.isCollectionBuildingProgressEnabled = function () {
+ return !!providerTemplates.eventEnabled(77)
+ };
+ proto.traceCollectionBuildingProgress = function (itemsProcessed) {
+ providerTemplates.traceTemplate_q(77, itemsProcessed)
+ };
+ proto.isCollectionBuildingMediaSyncedEnabled = function () {
+ return !!providerTemplates.eventEnabled(78)
+ };
+ proto.traceCollectionBuildingMediaSynced = function () {
+ providerTemplates.traceTemplateEventDescriptor(78)
+ };
+ proto.isCollectionBuildingMissingMetadataEnabled = function () {
+ return !!providerTemplates.eventEnabled(79)
+ };
+ proto.traceCollectionBuildingMissingMetadata = function () {
+ providerTemplates.traceTemplateEventDescriptor(79)
+ };
+ proto.isCollectionBuildingMDLCProgressEnabled = function () {
+ return !!providerTemplates.eventEnabled(80)
+ };
+ proto.traceCollectionBuildingMDLCProgress = function (itemsProcessed) {
+ providerTemplates.traceTemplate_q(80, itemsProcessed)
+ };
+ proto.isCollectionBuildingCloudCollectionV2FirstTrackAddedEnabled = function () {
+ return !!providerTemplates.eventEnabled(81)
+ };
+ proto.traceCollectionBuildingCloudCollectionV2FirstTrackAdded = function () {
+ providerTemplates.traceTemplateEventDescriptor(81)
+ };
+ proto.isFingerprintingStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(82)
+ };
+ proto.traceFingerprintingStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(82)
+ };
+ proto.isFingerprintingCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(83)
+ };
+ proto.traceFingerprintingComplete = function (hResult, canceled, processedFileCount, remainingFileCount, failedFileCount) {
+ providerTemplates.traceTemplate_dtqqq(83, hResult, canceled, processedFileCount, remainingFileCount, failedFileCount)
+ };
+ proto.isProcessRemainingFilesStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(84)
+ };
+ proto.traceProcessRemainingFilesStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(84)
+ };
+ proto.isProcessRemainingFilesCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(85)
+ };
+ proto.traceProcessRemainingFilesComplete = function (hResult) {
+ providerTemplates.traceTemplate_d(85, hResult)
+ };
+ proto.isFileProcessedEnabled = function () {
+ return !!providerTemplates.eventEnabled(86)
+ };
+ proto.traceFileProcessed = function (fileId, foreground, allowGracenoteId, hResult) {
+ providerTemplates.traceTemplate_qttd(86, fileId, foreground, allowGracenoteId, hResult)
+ };
+ proto.isFingerprintIdFoundEnabled = function () {
+ return !!providerTemplates.eventEnabled(87)
+ };
+ proto.traceFingerprintIdFound = function (fileId, fileUrl) {
+ providerTemplates.traceTemplate_qz(87, fileId, fileUrl)
+ };
+ proto.isFingerprintComputedEnabled = function () {
+ return !!providerTemplates.eventEnabled(88)
+ };
+ proto.traceFingerprintComputed = function (fileId, fileUrl) {
+ providerTemplates.traceTemplate_qz(88, fileId, fileUrl)
+ };
+ proto.isFingerprintGeneration_InternalErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(89)
+ };
+ proto.traceFingerprintGeneration_InternalError = function (fileUrl, error) {
+ providerTemplates.traceTemplate_zd(89, fileUrl, error)
+ };
+ proto.isFingerprintGeneration_EndOfStreamReachedEnabled = function () {
+ return !!providerTemplates.eventEnabled(90)
+ };
+ proto.traceFingerprintGeneration_EndOfStreamReached = function (fileUrl) {
+ providerTemplates.traceTemplate_z(90, fileUrl)
+ };
+ proto.isFingerprintGeneration_SourceReaderErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(91)
+ };
+ proto.traceFingerprintGeneration_SourceReaderError = function (fileUrl, flags) {
+ providerTemplates.traceTemplate_zq(91, fileUrl, flags)
+ };
+ proto.isFingerprintGeneration_FingerprintRetrievedEnabled = function () {
+ return !!providerTemplates.eventEnabled(92)
+ };
+ proto.traceFingerprintGeneration_FingerprintRetrieved = function (fileUrl, qualities) {
+ providerTemplates.traceTemplate_zq(92, fileUrl, qualities)
+ };
+ proto.isGetImmediateFingerprintsStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(93)
+ };
+ proto.traceGetImmediateFingerprintsStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(93)
+ };
+ proto.isGetImmediateFingerprintsCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(94)
+ };
+ proto.traceGetImmediateFingerprintsComplete = function (processedFileCount) {
+ providerTemplates.traceTemplate_q(94, processedFileCount)
+ };
+ proto.isImmediateFingerprintRetrievedEnabled = function () {
+ return !!providerTemplates.eventEnabled(95)
+ };
+ proto.traceImmediateFingerprintRetrieved = function (fileId, hResult, resultType) {
+ providerTemplates.traceTemplate_qdd(95, fileId, hResult, resultType)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Pipeline(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Pipeline = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.PipelineTemplate
+ };
+ var proto = ns.Pipeline.prototype;
+ proto.isMBR_Pause_EnterEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceMBR_Pause_Enter = function (currentStreamTimeHns) {
+ providerTemplates.traceTemplate_x(0, currentStreamTimeHns)
+ };
+ proto.isMBR_Pause_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceMBR_Pause_Exit = function (currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(1, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_Run_EnterEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceMBR_Run_Enter = function (startTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_xx(2, startTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_Run_LockEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceMBR_Run_Lock = function (currentStreamTimeHns) {
+ providerTemplates.traceTemplate_x(3, currentStreamTimeHns)
+ };
+ proto.isMBR_Run_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceMBR_Run_Exit = function (currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(4, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_Seek_EnterEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceMBR_Seek_Enter = function (possitionHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_ix(5, possitionHns, currentStreamTimeHns)
+ };
+ proto.isMBR_Seek_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceMBR_Seek_Exit = function (currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(6, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_Stop_EnterEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceMBR_Stop_Enter = function (currentStreamTimeHns) {
+ providerTemplates.traceTemplate_x(7, currentStreamTimeHns)
+ };
+ proto.isMBR_Stop_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceMBR_Stop_Exit = function (currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(8, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_SourceState_ChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceMBR_SourceState_Changed = function (filterState, oldState, newState) {
+ providerTemplates.traceTemplate_ddd(9, filterState, oldState, newState)
+ };
+ proto.isMBR_PinPumpState_ChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceMBR_PinPumpState_Changed = function (streamType, oldState, newState) {
+ providerTemplates.traceTemplate_qdd(10, streamType, oldState, newState)
+ };
+ proto.isMBR_EOSEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceMBR_EOS = function (streamType, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qx(11, streamType, currentStreamTimeHns)
+ };
+ proto.isMBR_Preroll_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceMBR_Preroll_Exit = function (streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns) {
+ providerTemplates.traceTemplate_dxxx(12, streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns)
+ };
+ proto.isMBR_Preroll_Forced_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceMBR_Preroll_Forced_Exit = function (streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns) {
+ providerTemplates.traceTemplate_dxxx(13, streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns)
+ };
+ proto.isMBR_PinBeginFlush_EnterEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceMBR_PinBeginFlush_Enter = function (streamType, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qx(14, streamType, currentStreamTimeHns)
+ };
+ proto.isMBR_PinBeginFlush_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceMBR_PinBeginFlush_Exit = function (streamType, currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_qxd(15, streamType, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_PinEndFlush_EnterEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceMBR_PinEndFlush_Enter = function (streamType, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qx(16, streamType, currentStreamTimeHns)
+ };
+ proto.isMBR_PinEndFlush_ExitEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceMBR_PinEndFlush_Exit = function (streamType, currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_qxd(17, streamType, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_GotNewSampleEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceMBR_GotNewSample = function (streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(18, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_SamplePushedToPinPumpEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceMBR_SamplePushedToPinPump = function (streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(19, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_SamplePushedDownStream_BeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceMBR_SamplePushedDownStream_Begin = function (streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(20, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_SamplePushedDownStream_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceMBR_SamplePushedDownStream_End = function (streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(21, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_BufferStatusEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceMBR_BufferStatus = function (currentStreamTimeHns, bufferSizeMs) {
+ providerTemplates.traceTemplate_xx(22, currentStreamTimeHns, bufferSizeMs)
+ };
+ proto.isMBR_DropFrameEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceMBR_DropFrame = function (totalFramesDropped, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(23, totalFramesDropped, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_PinDecompress_BeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceMBR_PinDecompress_Begin = function (streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(24, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_PinDecompress_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceMBR_PinDecompress_End = function (streamType, frameSizeInBytes, durationHns) {
+ providerTemplates.traceTemplate_qqx(25, streamType, frameSizeInBytes, durationHns)
+ };
+ proto.isMBR_PinDecompress_CallEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceMBR_PinDecompress_Call = function (streamType) {
+ providerTemplates.traceTemplate_q(26, streamType)
+ };
+ proto.isMBR_PinDecompress_ReturnEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceMBR_PinDecompress_Return = function (streamType) {
+ providerTemplates.traceTemplate_q(27, streamType)
+ };
+ proto.isMBR_Transcrypt_BeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceMBR_Transcrypt_Begin = function (streamType) {
+ providerTemplates.traceTemplate_q(28, streamType)
+ };
+ proto.isMBR_Transcrypt_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceMBR_Transcrypt_End = function (streamType) {
+ providerTemplates.traceTemplate_q(29, streamType)
+ };
+ proto.isMBR_DMO_ProcessInput_ReturnEnabled = function () {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceMBR_DMO_ProcessInput_Return = function (streamType, sampleTimeHns, hResult) {
+ providerTemplates.traceTemplate_qxd(30, streamType, sampleTimeHns, hResult)
+ };
+ proto.isMBR_DMO_ProcessOutput_ReturnEnabled = function () {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceMBR_DMO_ProcessOutput_Return = function (streamType, hResult, durationHns) {
+ providerTemplates.traceTemplate_qdx(31, streamType, hResult, durationHns)
+ };
+ proto.isMBR_NextChunkEnabled = function () {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceMBR_NextChunk = function (streamType, chunkIndex, bitrateBps, sampleTimeHns, durationHns, sizeInBytes, quality, targetQuality, totalBandwidthBps, targetBandwidthBps, bufferSizeMs) {
+ providerTemplates.traceTemplate_qdqxxqqqqqq(32, streamType, chunkIndex, bitrateBps, sampleTimeHns, durationHns, sizeInBytes, quality, targetQuality, totalBandwidthBps, targetBandwidthBps, bufferSizeMs)
+ };
+ proto.isMBR_ManifestStreamEnabled = function () {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceMBR_ManifestStream = function (streamType, iD, bitrate, width, height, channels) {
+ providerTemplates.traceTemplate_qqqqqq(33, streamType, iD, bitrate, width, height, channels)
+ };
+ proto.isTranscoding_JobTypeEnabled = function () {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceTranscoding_JobType = function (jobType) {
+ providerTemplates.traceTemplate_d(34, jobType)
+ };
+ proto.isTranscoding_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceTranscoding_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(35)
+ };
+ proto.isTranscoding_CompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceTranscoding_Complete = function (hResult) {
+ providerTemplates.traceTemplate_d(36, hResult)
+ };
+ proto.isTranscoding_MF_DShow_FallbackEnabled = function () {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceTranscoding_MF_DShow_Fallback = function () {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isTranscoding_MF_HW_SW_FallbackEnabled = function () {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceTranscoding_MF_HW_SW_Fallback = function () {
+ providerTemplates.traceTemplateEventDescriptor(38)
+ };
+ proto.isTranscoding_MF_HW_StatusEnabled = function () {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceTranscoding_MF_HW_Status = function (hW_Status) {
+ providerTemplates.traceTemplate_t(39, hW_Status)
+ };
+ proto.isTranscoding_Crash_StatusEnabled = function () {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceTranscoding_Crash_Status = function (crashCount, maxCrashCount, hW_Status, isConfirmed, hResult) {
+ providerTemplates.traceTemplate_qqttd(40, crashCount, maxCrashCount, hW_Status, isConfirmed, hResult)
+ };
+ proto.isTranscoding_Disable_HW_AccelerationEnabled = function () {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceTranscoding_Disable_HW_Acceleration = function () {
+ providerTemplates.traceTemplateEventDescriptor(41)
+ };
+ proto.isTranscoding_Reenable_HW_AccelerationEnabled = function () {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceTranscoding_Reenable_HW_Acceleration = function () {
+ providerTemplates.traceTemplateEventDescriptor(42)
+ };
+ proto.isTranscoding_SW_Retranscode_After_CrashEnabled = function () {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceTranscoding_SW_Retranscode_After_Crash = function () {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isPresenter_DownresEnabled = function () {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.tracePresenter_Downres = function (width, height) {
+ providerTemplates.traceTemplate_qq(44, width, height)
+ };
+ proto.isPresenter_Native_Video_SizeEnabled = function () {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.tracePresenter_Native_Video_Size = function (width, height) {
+ providerTemplates.traceTemplate_qq(45, width, height)
+ };
+ proto.isPresenter_Target_Video_SizeEnabled = function () {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.tracePresenter_Target_Video_Size = function (width, height) {
+ providerTemplates.traceTemplate_qq(46, width, height)
+ };
+ proto.isPresenter_Display_Video_SizeEnabled = function () {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.tracePresenter_Display_Video_Size = function (width, height) {
+ providerTemplates.traceTemplate_qq(47, width, height)
+ };
+ proto.isPresenter_FrameTimesEnabled = function () {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.tracePresenter_FrameTimes = function (frameNumber, timestampStream, timestampQPC, systime100ns, streamtime100ns, freqQPC) {
+ providerTemplates.traceTemplate_xxxxxx(48, frameNumber, timestampStream, timestampQPC, systime100ns, streamtime100ns, freqQPC)
+ };
+ proto.isPresenter_FrameDroppedEnabled = function () {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.tracePresenter_FrameDropped = function (framesDropped) {
+ providerTemplates.traceTemplate_q(49, framesDropped)
+ };
+ proto.isPresenter_OperationEnabled = function () {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.tracePresenter_Operation = function (op, lastPTS, splashOwnedFrameCount, stepCount, state, connectedState) {
+ providerTemplates.traceTemplate_zxqqdd(50, op, lastPTS, splashOwnedFrameCount, stepCount, state, connectedState)
+ };
+ proto.isLEQ_EnabledEnabled = function () {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceLEQ_Enabled = function (enabled) {
+ providerTemplates.traceTemplate_t(51, enabled)
+ };
+ proto.isLEQ_SetFormatEnabled = function () {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceLEQ_SetFormat = function (format, channels, samplesPerChannel, action, hResult) {
+ providerTemplates.traceTemplate_qqqqd(52, format, channels, samplesPerChannel, action, hResult)
+ };
+ proto.isLEQ_Process_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceLEQ_Process_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(53)
+ };
+ proto.isLEQ_Process_CompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceLEQ_Process_Complete = function (passthrough, hResult) {
+ providerTemplates.traceTemplate_td(54, passthrough, hResult)
+ };
+ proto.isPlaybackInterop_PlayerStateChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.tracePlaybackInterop_PlayerStateChanged = function (state) {
+ providerTemplates.traceTemplate_q(55, state)
+ };
+ proto.isPlaybackInterop_PositionChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.tracePlaybackInterop_PositionChanged = function (position, minSeekPosition, maxSeekPosition, endOfMedia, canSeek) {
+ providerTemplates.traceTemplate_xxxtt(56, position, minSeekPosition, maxSeekPosition, endOfMedia, canSeek)
+ };
+ proto.isPlaybackInterop_TransportStateChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.tracePlaybackInterop_TransportStateChanged = function (state) {
+ providerTemplates.traceTemplate_q(57, state)
+ };
+ proto.isPlaybackInterop_TrickPlayStateChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.tracePlaybackInterop_TrickPlayStateChanged = function (state) {
+ providerTemplates.traceTemplate_q(58, state)
+ };
+ proto.isPlayback_MCPlayerAdapter_CreateInstanceEnabled = function () {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.tracePlayback_MCPlayerAdapter_CreateInstance = function (hResult) {
+ providerTemplates.traceTemplate_d(59, hResult)
+ };
+ proto.isPlayback_MFPlayer_CreateInstanceEnabled = function () {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.tracePlayback_MFPlayer_CreateInstance = function (hResult) {
+ providerTemplates.traceTemplate_d(60, hResult)
+ };
+ proto.isPlayback_ControlInitializedEnabled = function () {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.tracePlayback_ControlInitialized = function () {
+ providerTemplates.traceTemplateEventDescriptor(61)
+ };
+ proto.isPlayback_SessionInitializedEnabled = function () {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.tracePlayback_SessionInitialized = function () {
+ providerTemplates.traceTemplateEventDescriptor(62)
+ };
+ proto.isPlayback_PlayerStateChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.tracePlayback_PlayerStateChanged = function (newState, oldState) {
+ providerTemplates.traceTemplate_zz(63, newState, oldState)
+ };
+ proto.isPlayback_TransportStateChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.tracePlayback_TransportStateChanged = function (newState, oldState) {
+ providerTemplates.traceTemplate_zz(64, newState, oldState)
+ };
+ proto.isPlayback_SetMediaEnabled = function () {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.tracePlayback_SetMedia = function (source, mediaType, protectionState, startPosition, cookie, durationMsec) {
+ providerTemplates.traceTemplate_zzzqqq(65, source, mediaType, protectionState, startPosition, cookie, durationMsec)
+ };
+ proto.isPlayback_SetNextMediaEnabled = function () {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.tracePlayback_SetNextMedia = function (readyForNext, source, mediaType, protectionState, startPosition, cookie) {
+ providerTemplates.traceTemplate_tzzzqq(66, readyForNext, source, mediaType, protectionState, startPosition, cookie)
+ };
+ proto.isPlayback_CurrentMediaLoadedEnabled = function () {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.tracePlayback_CurrentMediaLoaded = function (source, mediaType, protectionState, startPosition, cookie, durationMsec) {
+ providerTemplates.traceTemplate_zzzqqq(67, source, mediaType, protectionState, startPosition, cookie, durationMsec)
+ };
+ proto.isPlayback_NextMediaLoadedEnabled = function () {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.tracePlayback_NextMediaLoaded = function (source, mediaType, protectionState, startPosition, cookie, durationMsec) {
+ providerTemplates.traceTemplate_zzzqqq(68, source, mediaType, protectionState, startPosition, cookie, durationMsec)
+ };
+ proto.isPlayback_SwitchingToNextMediaEnabled = function () {
+ return !!providerTemplates.eventEnabled(69)
+ };
+ proto.tracePlayback_SwitchingToNextMedia = function (source) {
+ providerTemplates.traceTemplate_z(69, source)
+ };
+ proto.isPlayback_NextMediaStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(70)
+ };
+ proto.tracePlayback_NextMediaStarted = function (source) {
+ providerTemplates.traceTemplate_z(70, source)
+ };
+ proto.isPlayback_ErrorOccurredEnabled = function () {
+ return !!providerTemplates.eventEnabled(71)
+ };
+ proto.tracePlayback_ErrorOccurred = function (errorCode, extendedCode, context) {
+ providerTemplates.traceTemplate_qqz(71, errorCode, extendedCode, context)
+ };
+ proto.isPlayback_EnableTimeUpdateEnabled = function () {
+ return !!providerTemplates.eventEnabled(72)
+ };
+ proto.tracePlayback_EnableTimeUpdate = function (currentPositionMsec) {
+ providerTemplates.traceTemplate_q(72, currentPositionMsec)
+ };
+ proto.isPlayback_DisableTimeUpdateEnabled = function () {
+ return !!providerTemplates.eventEnabled(73)
+ };
+ proto.tracePlayback_DisableTimeUpdate = function (currentPositionMsec) {
+ providerTemplates.traceTemplate_q(73, currentPositionMsec)
+ };
+ proto.isPlayback_ForceTimeUpdateEnabled = function () {
+ return !!providerTemplates.eventEnabled(74)
+ };
+ proto.tracePlayback_ForceTimeUpdate = function (currentPositionMsec) {
+ providerTemplates.traceTemplate_q(74, currentPositionMsec)
+ };
+ proto.isPlayback_PBMSoundLevelChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(75)
+ };
+ proto.tracePlayback_PBMSoundLevelChanged = function (soundLevel, currentTransportState) {
+ providerTemplates.traceTemplate_zz(75, soundLevel, currentTransportState)
+ };
+ proto.isPlayback_TargetTransportStateSetEnabled = function () {
+ return !!providerTemplates.eventEnabled(76)
+ };
+ proto.tracePlayback_TargetTransportStateSet = function (wannaBe, current) {
+ providerTemplates.traceTemplate_zz(76, wannaBe, current)
+ };
+ proto.isPlaylist_SetDataSourceBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(77)
+ };
+ proto.tracePlaylist_SetDataSourceBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(77)
+ };
+ proto.isPlaylist_SetDataSourceEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(78)
+ };
+ proto.tracePlaylist_SetDataSourceEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(78)
+ };
+ proto.isPlaylist_InterpretingDataEnabled = function () {
+ return !!providerTemplates.eventEnabled(79)
+ };
+ proto.tracePlaylist_InterpretingData = function () {
+ providerTemplates.traceTemplateEventDescriptor(79)
+ };
+ proto.isPlaylist_ActivateEnabled = function () {
+ return !!providerTemplates.eventEnabled(80)
+ };
+ proto.tracePlaylist_Activate = function (index, startPosition, shuffle, repeat) {
+ providerTemplates.traceTemplate_qqtt(80, index, startPosition, shuffle, repeat)
+ };
+ proto.isPlaylist_SetMediaEnabled = function () {
+ return !!providerTemplates.eventEnabled(81)
+ };
+ proto.tracePlaylist_SetMedia = function (source, mediaType, protectionState, startPosition, cookie) {
+ providerTemplates.traceTemplate_zzzqq(81, source, mediaType, protectionState, startPosition, cookie)
+ };
+ proto.isPlaylist_SetNextMediaEnabled = function () {
+ return !!providerTemplates.eventEnabled(82)
+ };
+ proto.tracePlaylist_SetNextMedia = function (source, mediaType, protectionState, startPosition, cookie) {
+ providerTemplates.traceTemplate_zzzqq(82, source, mediaType, protectionState, startPosition, cookie)
+ };
+ proto.isPlaylist_CreatedEnabled = function () {
+ return !!providerTemplates.eventEnabled(83)
+ };
+ proto.tracePlaylist_Created = function () {
+ providerTemplates.traceTemplateEventDescriptor(83)
+ };
+ proto.isPlaylog_BookmarkLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(84)
+ };
+ proto.tracePlaylog_BookmarkLoad = function (positionMS, playFromBookmark) {
+ providerTemplates.traceTemplate_qt(84, positionMS, playFromBookmark)
+ };
+ proto.isPlaylog_BookmarkSaveEnabled = function () {
+ return !!providerTemplates.eventEnabled(85)
+ };
+ proto.tracePlaylog_BookmarkSave = function (positionMS) {
+ providerTemplates.traceTemplate_q(85, positionMS)
+ };
+ proto.isPlaylog_PlayCountLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(86)
+ };
+ proto.tracePlaylog_PlayCountLoad = function (playCount) {
+ providerTemplates.traceTemplate_q(86, playCount)
+ };
+ proto.isPlaylog_PlayCountSaveEnabled = function () {
+ return !!providerTemplates.eventEnabled(87)
+ };
+ proto.tracePlaylog_PlayCountSave = function (playCount) {
+ providerTemplates.traceTemplate_q(87, playCount)
+ };
+ proto.isPlaylog_PlayedLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(88)
+ };
+ proto.tracePlaylog_PlayedLoad = function (played) {
+ providerTemplates.traceTemplate_t(88, played)
+ };
+ proto.isPlaylog_PlayedSaveEnabled = function () {
+ return !!providerTemplates.eventEnabled(89)
+ };
+ proto.tracePlaylog_PlayedSave = function (played) {
+ providerTemplates.traceTemplate_t(89, played)
+ };
+ proto.isDRM_RootLicenseRefresh_AccountEnabled = function () {
+ return !!providerTemplates.eventEnabled(90)
+ };
+ proto.traceDRM_RootLicenseRefresh_Account = function (subscription, tunerActivated) {
+ providerTemplates.traceTemplate_tt(90, subscription, tunerActivated)
+ };
+ proto.isDRM_RootLicenseRefresh_DetailsEnabled = function () {
+ return !!providerTemplates.eventEnabled(91)
+ };
+ proto.traceDRM_RootLicenseRefresh_Details = function (now, lastRefresh, spanMs) {
+ providerTemplates.traceTemplate_zzx(91, now, lastRefresh, spanMs)
+ };
+ proto.isDRM_RootLicenseRefresh_InvokedEnabled = function () {
+ return !!providerTemplates.eventEnabled(92)
+ };
+ proto.traceDRM_RootLicenseRefresh_Invoked = function () {
+ providerTemplates.traceTemplateEventDescriptor(92)
+ };
+ proto.isDRM_RootLicenseRefresh_CompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(93)
+ };
+ proto.traceDRM_RootLicenseRefresh_Completed = function (status) {
+ providerTemplates.traceTemplate_z(93, status)
+ };
+ proto.isDRM_ReportMetering_AccountEnabled = function () {
+ return !!providerTemplates.eventEnabled(94)
+ };
+ proto.traceDRM_ReportMetering_Account = function (subscription, tunerActivated, meteringCertificate) {
+ providerTemplates.traceTemplate_ttz(94, subscription, tunerActivated, meteringCertificate)
+ };
+ proto.isDRM_ReportMetering_InvokedEnabled = function () {
+ return !!providerTemplates.eventEnabled(95)
+ };
+ proto.traceDRM_ReportMetering_Invoked = function () {
+ providerTemplates.traceTemplateEventDescriptor(95)
+ };
+ proto.isDRM_ReportMetering_CompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(96)
+ };
+ proto.traceDRM_ReportMetering_Completed = function (status) {
+ providerTemplates.traceTemplate_z(96, status)
+ };
+ proto.isDRM_ReportMetering_NoDataToReportEnabled = function () {
+ return !!providerTemplates.eventEnabled(97)
+ };
+ proto.traceDRM_ReportMetering_NoDataToReport = function () {
+ providerTemplates.traceTemplateEventDescriptor(97)
+ };
+ proto.isDRM_DeleteLicense_InvokedEnabled = function () {
+ return !!providerTemplates.eventEnabled(98)
+ };
+ proto.traceDRM_DeleteLicense_Invoked = function (kid) {
+ providerTemplates.traceTemplate_z(98, kid)
+ };
+ proto.isDRM_DeleteLicense_CompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(99)
+ };
+ proto.traceDRM_DeleteLicense_Completed = function (kid, hResult) {
+ providerTemplates.traceTemplate_zd(99, kid, hResult)
+ };
+ proto.isClosedCaptions_RendererGetTTMLFilepathEnabled = function () {
+ return !!providerTemplates.eventEnabled(100)
+ };
+ proto.traceClosedCaptions_RendererGetTTMLFilepath = function (state, smid, miid, lcid, filepath) {
+ providerTemplates.traceTemplate_zzzqz(100, state, smid, miid, lcid, filepath)
+ };
+ proto.isClosedCaptions_RendererLoadTTMLFileEnabled = function () {
+ return !!providerTemplates.eventEnabled(101)
+ };
+ proto.traceClosedCaptions_RendererLoadTTMLFile = function (state, filepath) {
+ providerTemplates.traceTemplate_zz(101, state, filepath)
+ };
+ proto.isClosedCaptions_EnterRenderingLoopEnabled = function () {
+ return !!providerTemplates.eventEnabled(102)
+ };
+ proto.traceClosedCaptions_EnterRenderingLoop = function (currentPosition, transportState) {
+ providerTemplates.traceTemplate_qz(102, currentPosition, transportState)
+ };
+ proto.isClosedCaptions_ExitRenderingLoopEnabled = function () {
+ return !!providerTemplates.eventEnabled(103)
+ };
+ proto.traceClosedCaptions_ExitRenderingLoop = function (currentPosition, transportState, closedCaptionsOn) {
+ providerTemplates.traceTemplate_qzt(103, currentPosition, transportState, closedCaptionsOn)
+ };
+ proto.isClosedCaptions_OnEnabled = function () {
+ return !!providerTemplates.eventEnabled(104)
+ };
+ proto.traceClosedCaptions_On = function (enabled) {
+ providerTemplates.traceTemplate_t(104, enabled)
+ };
+ proto.isClosedCaptions_DroppedFrameEnabled = function () {
+ return !!providerTemplates.eventEnabled(105)
+ };
+ proto.traceClosedCaptions_DroppedFrame = function (generatedAt, validUntil, currentPosition) {
+ providerTemplates.traceTemplate_qqq(105, generatedAt, validUntil, currentPosition)
+ };
+ proto.isFastStartMediaSource_CreatedEnabled = function () {
+ return !!providerTemplates.eventEnabled(106)
+ };
+ proto.traceFastStartMediaSource_Created = function () {
+ providerTemplates.traceTemplateEventDescriptor(106)
+ };
+ proto.isFastStartMediaSource_ReceivedUrlEnabled = function () {
+ return !!providerTemplates.eventEnabled(107)
+ };
+ proto.traceFastStartMediaSource_ReceivedUrl = function (info) {
+ providerTemplates.traceTemplate_z(107, info)
+ };
+ proto.isFastStartMediaSource_PlaybackStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(108)
+ };
+ proto.traceFastStartMediaSource_PlaybackStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(108)
+ };
+ proto.isPlayback_WPPEnabled = function () {
+ return !!providerTemplates.eventEnabled(109)
+ };
+ proto.tracePlayback_WPP = function (info) {
+ providerTemplates.traceTemplate_z(109, info)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Service(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.ServiceEventProvider = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProviderTemplate
+ };
+ var proto = ns.ServiceEventProvider.prototype;
+ proto.isServiceSignInErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceServiceSignInError = function (hResult) {
+ providerTemplates.traceTemplate_d(0, hResult)
+ };
+ proto.isServiceGetTicketStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceServiceGetTicketStarted = function (message) {
+ providerTemplates.traceTemplate_z(1, message)
+ };
+ proto.isServiceGetTicketCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceServiceGetTicketCompleted = function (message) {
+ providerTemplates.traceTemplate_z(2, message)
+ };
+ proto.isServiceGetTicketErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceServiceGetTicketError = function (hResult) {
+ providerTemplates.traceTemplate_d(3, hResult)
+ };
+ proto.isServiceSignOutStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceServiceSignOutStarted = function (message) {
+ providerTemplates.traceTemplate_z(4, message)
+ };
+ proto.isServiceSignOutCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceServiceSignOutCompleted = function (message) {
+ providerTemplates.traceTemplate_z(5, message)
+ };
+ proto.isServiceZestSignInStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceServiceZestSignInStarted = function (message) {
+ providerTemplates.traceTemplate_z(6, message)
+ };
+ proto.isServiceZestSignInCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceServiceZestSignInCompleted = function (message) {
+ providerTemplates.traceTemplate_z(7, message)
+ };
+ proto.isServiceRefreshSignInStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceServiceRefreshSignInStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(8)
+ };
+ proto.isServiceRefreshSignInCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceServiceRefreshSignInCompleted = function () {
+ providerTemplates.traceTemplateEventDescriptor(9)
+ };
+ proto.isServiceAuthHeaderEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceServiceAuthHeader = function (message) {
+ providerTemplates.traceTemplate_z(10, message)
+ };
+ proto.isServiceUserProfilePropertyEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceServiceUserProfileProperty = function (name, value) {
+ providerTemplates.traceTemplate_zz(11, name, value)
+ };
+ proto.isServiceUserProfileStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceServiceUserProfileStarted = function (message) {
+ providerTemplates.traceTemplate_z(12, message)
+ };
+ proto.isServiceUserProfileCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceServiceUserProfileCompleted = function (message) {
+ providerTemplates.traceTemplate_z(13, message)
+ };
+ proto.isFamilyUserPropertyEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceFamilyUserProperty = function (name, value) {
+ providerTemplates.traceTemplate_zz(14, name, value)
+ };
+ proto.isServiceFamilyUserStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceServiceFamilyUserStarted = function (message) {
+ providerTemplates.traceTemplate_z(15, message)
+ };
+ proto.isServiceFamilyUserCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceServiceFamilyUserCompleted = function (message) {
+ providerTemplates.traceTemplate_z(16, message)
+ };
+ proto.isSubscriptionInfoPropertyEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceSubscriptionInfoProperty = function (name, value) {
+ providerTemplates.traceTemplate_zz(17, name, value)
+ };
+ proto.isServiceSubscriptionInfoStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceServiceSubscriptionInfoStarted = function (message) {
+ providerTemplates.traceTemplate_z(18, message)
+ };
+ proto.isServiceSubscriptionInfoCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceServiceSubscriptionInfoCompleted = function (message) {
+ providerTemplates.traceTemplate_z(19, message)
+ };
+ proto.isServiceUserChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceServiceUserChanged = function (message) {
+ providerTemplates.traceTemplate_z(20, message)
+ };
+ proto.isServiceForgetUserInformationStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceServiceForgetUserInformationStarted = function (message) {
+ providerTemplates.traceTemplate_z(21, message)
+ };
+ proto.isServiceForgetUserInformationCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceServiceForgetUserInformationCompleted = function (message) {
+ providerTemplates.traceTemplate_z(22, message)
+ };
+ proto.isServiceSignInStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceServiceSignInStarted = function (message) {
+ providerTemplates.traceTemplate_z(23, message)
+ };
+ proto.isServiceSignInCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceServiceSignInCompleted = function (message) {
+ providerTemplates.traceTemplate_z(24, message)
+ };
+ proto.isServiceAuthHeaderErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceServiceAuthHeaderError = function (hResult) {
+ providerTemplates.traceTemplate_d(25, hResult)
+ };
+ proto.isPurchaseHistoryGrovelStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.tracePurchaseHistoryGrovelStarted = function () {
+ providerTemplates.traceTemplateEventDescriptor(26)
+ };
+ proto.isPurchaseHistoryGrovelCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.tracePurchaseHistoryGrovelCompleted = function (hResult) {
+ providerTemplates.traceTemplate_d(27, hResult)
+ };
+ proto.isPurchaseHistoryGrovelErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.tracePurchaseHistoryGrovelError = function (hResult) {
+ providerTemplates.traceTemplate_d(28, hResult)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Shell(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Shell = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.ShellTemplate
+ };
+ var proto = ns.Shell.prototype;
+ proto.isNavigable_Loading_DoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceNavigable_Loading_Done = function (moniker) {
+ providerTemplates.traceTemplate_z(0, moniker)
+ };
+ proto.isQueries_BeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceQueries_Begin = function (moniker) {
+ providerTemplates.traceTemplate_z(1, moniker)
+ };
+ proto.isQueries_CompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceQueries_Complete = function (moniker) {
+ providerTemplates.traceTemplate_z(2, moniker)
+ };
+ proto.isJavascript_Load_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceJavascript_Load_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isSplashScreen_RemovedEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceSplashScreen_Removed = function () {
+ providerTemplates.traceTemplateEventDescriptor(4)
+ };
+ proto.isJavascript_Load_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceJavascript_Load_End = function () {
+ providerTemplates.traceTemplateEventDescriptor(5)
+ };
+ proto.isDom_Content_LoadedEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceDom_Content_Loaded = function () {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isFinish_ProcessAllEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceFinish_ProcessAll = function () {
+ providerTemplates.traceTemplateEventDescriptor(7)
+ };
+ proto.isNavigation_StartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceNavigation_Started = function (moniker) {
+ providerTemplates.traceTemplate_z(8, moniker)
+ };
+ proto.isLocation_ChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceLocation_Changed = function (pageMoniker, hubMoniker, panelMoniker) {
+ providerTemplates.traceTemplate_zzz(9, pageMoniker, hubMoniker, panelMoniker)
+ };
+ proto.isOverlay_ShownEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceOverlay_Shown = function (templateId) {
+ providerTemplates.traceTemplate_z(10, templateId)
+ };
+ proto.isOverlay_DismissedEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceOverlay_Dismissed = function (templateId) {
+ providerTemplates.traceTemplate_z(11, templateId)
+ };
+ proto.isAction_InvokedEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceAction_Invoked = function (actionId) {
+ providerTemplates.traceTemplate_z(12, actionId)
+ };
+ proto.isDeepLink_Protocol_InvokedEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceDeepLink_Protocol_Invoked = function (url) {
+ providerTemplates.traceTemplate_z(13, url)
+ };
+ proto.isDeepLink_Protocol_FailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceDeepLink_Protocol_Failed = function (url) {
+ providerTemplates.traceTemplate_z(14, url)
+ };
+ proto.isDeepLink_Tile_InvokedEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceDeepLink_Tile_Invoked = function (arguments) {
+ providerTemplates.traceTemplate_z(15, arguments)
+ };
+ proto.isDeepLink_Tile_FailedEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceDeepLink_Tile_Failed = function (arguments) {
+ providerTemplates.traceTemplate_z(16, arguments)
+ };
+ proto.isSearch_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceSearch_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(17)
+ };
+ proto.isSearch_CompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceSearch_Completed = function () {
+ providerTemplates.traceTemplateEventDescriptor(18)
+ };
+ proto.isWebExperience_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceWebExperience_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(19, templateId)
+ };
+ proto.isWebExperience_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceWebExperience_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(20, templateId)
+ };
+ proto.isWebExperience_CancelEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceWebExperience_Cancel = function (templateId) {
+ providerTemplates.traceTemplate_z(21, templateId)
+ };
+ proto.isWebExperience_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceWebExperience_Error = function (templateId) {
+ providerTemplates.traceTemplate_z(22, templateId)
+ };
+ proto.isWebExperience_PageLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceWebExperience_PageLoad = function (templateId) {
+ providerTemplates.traceTemplate_z(23, templateId)
+ };
+ proto.isTest_Event_ResultEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceTest_Event_Result = function (result, message) {
+ providerTemplates.traceTemplate_tz(24, result, message)
+ };
+ proto.isTest_Event_TraceEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceTest_Event_Trace = function (id, message) {
+ providerTemplates.traceTemplate_dz(25, id, message)
+ };
+ proto.isTest_Event_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceTest_Event_Error = function (id, message) {
+ providerTemplates.traceTemplate_dz(26, id, message)
+ };
+ proto.isHubStrip_Load_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceHubStrip_Load_Start = function (moniker) {
+ providerTemplates.traceTemplate_z(27, moniker)
+ };
+ proto.isHubStrip_Load_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceHubStrip_Load_End = function (moniker) {
+ providerTemplates.traceTemplate_z(28, moniker)
+ };
+ proto.isHub_Load_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceHub_Load_Start = function (moniker) {
+ providerTemplates.traceTemplate_z(29, moniker)
+ };
+ proto.isHub_Load_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceHub_Load_End = function (moniker) {
+ providerTemplates.traceTemplate_z(30, moniker)
+ };
+ proto.isPanel_Load_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.tracePanel_Load_Start = function (moniker) {
+ providerTemplates.traceTemplate_z(31, moniker)
+ };
+ proto.isPanel_Load_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.tracePanel_Load_End = function (moniker) {
+ providerTemplates.traceTemplate_z(32, moniker)
+ };
+ proto.isHubStrip_ReadyEnabled = function () {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceHubStrip_Ready = function (moniker) {
+ providerTemplates.traceTemplate_z(33, moniker)
+ };
+ proto.isHub_ReadyEnabled = function () {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceHub_Ready = function (moniker) {
+ providerTemplates.traceTemplate_z(34, moniker)
+ };
+ proto.isPanel_ReadyEnabled = function () {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.tracePanel_Ready = function (moniker) {
+ providerTemplates.traceTemplate_z(35, moniker)
+ };
+ proto.isHubStrip_MoveToCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceHubStrip_MoveToComplete = function (moniker) {
+ providerTemplates.traceTemplate_z(36, moniker)
+ };
+ proto.isCreateAccount_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceCreateAccount_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(37, templateId)
+ };
+ proto.isCreateAccount_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceCreateAccount_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(38, templateId)
+ };
+ proto.isCreateAccount_CancelEnabled = function () {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceCreateAccount_Cancel = function (templateId) {
+ providerTemplates.traceTemplate_z(39, templateId)
+ };
+ proto.isCreateAccount_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceCreateAccount_Error = function (templateId) {
+ providerTemplates.traceTemplate_z(40, templateId)
+ };
+ proto.isAcceptTermsOfService_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceAcceptTermsOfService_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(41, templateId)
+ };
+ proto.isAcceptTermsOfService_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceAcceptTermsOfService_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(42, templateId)
+ };
+ proto.isAcceptTermsOfService_CancelEnabled = function () {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceAcceptTermsOfService_Cancel = function (templateId) {
+ providerTemplates.traceTemplate_z(43, templateId)
+ };
+ proto.isSignInResultEnabled = function () {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceSignInResult = function (templateId) {
+ providerTemplates.traceTemplate_z(44, templateId)
+ };
+ proto.isSettingsHome_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceSettingsHome_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(45, templateId)
+ };
+ proto.isSettingsHome_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceSettingsHome_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(46, templateId)
+ };
+ proto.isSettingsAccount_LaunchEnabled = function () {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceSettingsAccount_Launch = function (templateId) {
+ providerTemplates.traceTemplate_z(47, templateId)
+ };
+ proto.isSettingsAccount_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceSettingsAccount_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(48, templateId)
+ };
+ proto.isSettingsAccount_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceSettingsAccount_Error = function (templateId) {
+ providerTemplates.traceTemplate_z(49, templateId)
+ };
+ proto.isSettingsPreferences_LaunchEnabled = function () {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceSettingsPreferences_Launch = function (templateId) {
+ providerTemplates.traceTemplate_z(50, templateId)
+ };
+ proto.isSettingsAbout_LaunchEnabled = function () {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceSettingsAbout_Launch = function (templateId) {
+ providerTemplates.traceTemplate_z(51, templateId)
+ };
+ proto.isSettingsFeedback_LaunchEnabled = function () {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceSettingsFeedback_Launch = function (templateId) {
+ providerTemplates.traceTemplate_z(52, templateId)
+ };
+ proto.isSettingsCaptions_LaunchEnabled = function () {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceSettingsCaptions_Launch = function (templateId) {
+ providerTemplates.traceTemplate_z(53, templateId)
+ };
+ proto.isSettingsPopulate_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceSettingsPopulate_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(54, templateId)
+ };
+ proto.isSettingsWinJSPopulate_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceSettingsWinJSPopulate_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(55, templateId)
+ };
+ proto.isSettingsPopulate_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceSettingsPopulate_End = function (templateId) {
+ providerTemplates.traceTemplate_z(56, templateId)
+ };
+ proto.isPurchaseFlowGames_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.tracePurchaseFlowGames_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(57, templateId)
+ };
+ proto.isPurchaseFlowGames_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.tracePurchaseFlowGames_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(58, templateId)
+ };
+ proto.isPurchaseFlowGames_CancelEnabled = function () {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.tracePurchaseFlowGames_Cancel = function (templateId) {
+ providerTemplates.traceTemplate_z(59, templateId)
+ };
+ proto.isPurchaseFlowGames_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.tracePurchaseFlowGames_Error = function (templateId) {
+ providerTemplates.traceTemplate_z(60, templateId)
+ };
+ proto.isPurchaseFlowGames_RejectionEnabled = function () {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.tracePurchaseFlowGames_Rejection = function (templateId) {
+ providerTemplates.traceTemplate_z(61, templateId)
+ };
+ proto.isMarketplaceBrowse_PageLoadStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceMarketplaceBrowse_PageLoadStart = function (templateId) {
+ providerTemplates.traceTemplate_z(62, templateId)
+ };
+ proto.isServiceQuery_QueryStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceServiceQuery_QueryStart = function (templateId) {
+ providerTemplates.traceTemplate_z(63, templateId)
+ };
+ proto.isServiceQuery_QueryReturnEnabled = function () {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceServiceQuery_QueryReturn = function (templateId) {
+ providerTemplates.traceTemplate_z(64, templateId)
+ };
+ proto.isServiceQuery_ParseCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceServiceQuery_ParseComplete = function (templateId) {
+ providerTemplates.traceTemplate_z(65, templateId)
+ };
+ proto.isSettingsAccount_LaunchCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.traceSettingsAccount_LaunchComplete = function (templateId) {
+ providerTemplates.traceTemplate_z(66, templateId)
+ };
+ proto.isSettingsPreferences_LaunchCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.traceSettingsPreferences_LaunchComplete = function (templateId) {
+ providerTemplates.traceTemplate_z(67, templateId)
+ };
+ proto.isSettingsAbout_LaunchCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.traceSettingsAbout_LaunchComplete = function (templateId) {
+ providerTemplates.traceTemplate_z(68, templateId)
+ };
+ proto.isSettings_BackToHomeEnabled = function () {
+ return !!providerTemplates.eventEnabled(69)
+ };
+ proto.traceSettings_BackToHome = function (templateId) {
+ providerTemplates.traceTemplate_z(69, templateId)
+ };
+ proto.isSettingsFeedback_LaunchCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(70)
+ };
+ proto.traceSettingsFeedback_LaunchComplete = function (templateId) {
+ providerTemplates.traceTemplate_z(70, templateId)
+ };
+ proto.isSettingsCaptions_LaunchCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(71)
+ };
+ proto.traceSettingsCaptions_LaunchComplete = function (templateId) {
+ providerTemplates.traceTemplate_z(71, templateId)
+ };
+ proto.isHomeHub_Load_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(72)
+ };
+ proto.traceHomeHub_Load_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(72)
+ };
+ proto.isHomeHub_Load_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(73)
+ };
+ proto.traceHomeHub_Load_End = function () {
+ providerTemplates.traceTemplateEventDescriptor(73)
+ };
+ proto.isHomeHub_ReadyEnabled = function () {
+ return !!providerTemplates.eventEnabled(74)
+ };
+ proto.traceHomeHub_Ready = function () {
+ providerTemplates.traceTemplateEventDescriptor(74)
+ };
+ proto.isPurchaseFlowMusic_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(75)
+ };
+ proto.tracePurchaseFlowMusic_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(75, templateId)
+ };
+ proto.isPurchaseFlowMusic_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(76)
+ };
+ proto.tracePurchaseFlowMusic_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(76, templateId)
+ };
+ proto.isPurchaseFlowMusic_CancelEnabled = function () {
+ return !!providerTemplates.eventEnabled(77)
+ };
+ proto.tracePurchaseFlowMusic_Cancel = function (templateId) {
+ providerTemplates.traceTemplate_z(77, templateId)
+ };
+ proto.isPurchaseFlowMusic_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(78)
+ };
+ proto.tracePurchaseFlowMusic_Error = function (templateId) {
+ providerTemplates.traceTemplate_z(78, templateId)
+ };
+ proto.isPurchaseFlowMusic_RejectionEnabled = function () {
+ return !!providerTemplates.eventEnabled(79)
+ };
+ proto.tracePurchaseFlowMusic_Rejection = function (templateId) {
+ providerTemplates.traceTemplate_z(79, templateId)
+ };
+ proto.isPurchaseFlowVideo_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(80)
+ };
+ proto.tracePurchaseFlowVideo_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(80, templateId)
+ };
+ proto.isPurchaseFlowVideo_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(81)
+ };
+ proto.tracePurchaseFlowVideo_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(81, templateId)
+ };
+ proto.isPurchaseFlowVideo_CancelEnabled = function () {
+ return !!providerTemplates.eventEnabled(82)
+ };
+ proto.tracePurchaseFlowVideo_Cancel = function (templateId) {
+ providerTemplates.traceTemplate_z(82, templateId)
+ };
+ proto.isPurchaseFlowVideo_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(83)
+ };
+ proto.tracePurchaseFlowVideo_Error = function (templateId) {
+ providerTemplates.traceTemplate_z(83, templateId)
+ };
+ proto.isPurchaseFlowVideo_Start_Bandwidth_TestEnabled = function () {
+ return !!providerTemplates.eventEnabled(84)
+ };
+ proto.tracePurchaseFlowVideo_Start_Bandwidth_Test = function (templateId) {
+ providerTemplates.traceTemplate_z(84, templateId)
+ };
+ proto.isPurchaseFlowVideo_DownloadEnabled = function () {
+ return !!providerTemplates.eventEnabled(85)
+ };
+ proto.tracePurchaseFlowVideo_Download = function (templateId) {
+ providerTemplates.traceTemplate_z(85, templateId)
+ };
+ proto.isPurchaseFlowVideo_StreamEnabled = function () {
+ return !!providerTemplates.eventEnabled(86)
+ };
+ proto.tracePurchaseFlowVideo_Stream = function (templateId) {
+ providerTemplates.traceTemplate_z(86, templateId)
+ };
+ proto.isPurchaseFlowVideo_DoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(87)
+ };
+ proto.tracePurchaseFlowVideo_Done = function (templateId) {
+ providerTemplates.traceTemplate_z(87, templateId)
+ };
+ proto.isPurchaseFlowVideo_RejectionEnabled = function () {
+ return !!providerTemplates.eventEnabled(88)
+ };
+ proto.tracePurchaseFlowVideo_Rejection = function (templateId) {
+ providerTemplates.traceTemplate_z(88, templateId)
+ };
+ proto.isGalleryControl_Load_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(89)
+ };
+ proto.traceGalleryControl_Load_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(89)
+ };
+ proto.isGalleryControl_Load_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(90)
+ };
+ proto.traceGalleryControl_Load_End = function () {
+ providerTemplates.traceTemplateEventDescriptor(90)
+ };
+ proto.isGalleryControl_InLine_Open_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(91)
+ };
+ proto.traceGalleryControl_InLine_Open_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(91)
+ };
+ proto.isGalleryControl_InLine_Open_EndEnabled = function () {
+ return !!providerTemplates.eventEnabled(92)
+ };
+ proto.traceGalleryControl_InLine_Open_End = function () {
+ providerTemplates.traceTemplateEventDescriptor(92)
+ };
+ proto.isGalleryControl_InLine_Open_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(93)
+ };
+ proto.traceGalleryControl_InLine_Open_Error = function () {
+ providerTemplates.traceTemplateEventDescriptor(93)
+ };
+ proto.isGalleryControl_InLine_CloseEnabled = function () {
+ return !!providerTemplates.eventEnabled(94)
+ };
+ proto.traceGalleryControl_InLine_Close = function () {
+ providerTemplates.traceTemplateEventDescriptor(94)
+ };
+ proto.isGalleryControl_LoadingState_ChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(95)
+ };
+ proto.traceGalleryControl_LoadingState_Changed = function (newState) {
+ providerTemplates.traceTemplate_z(95, newState)
+ };
+ proto.isModifierControl_SelectionChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(96)
+ };
+ proto.traceModifierControl_SelectionChanged = function (value, source) {
+ providerTemplates.traceTemplate_zz(96, value, source)
+ };
+ proto.isModifierControl_PopupOpenedEnabled = function () {
+ return !!providerTemplates.eventEnabled(97)
+ };
+ proto.traceModifierControl_PopupOpened = function (templateId) {
+ providerTemplates.traceTemplate_z(97, templateId)
+ };
+ proto.isModifierControl_PopupClosedEnabled = function () {
+ return !!providerTemplates.eventEnabled(98)
+ };
+ proto.traceModifierControl_PopupClosed = function (templateId) {
+ providerTemplates.traceTemplate_z(98, templateId)
+ };
+ proto.isActionListControl_ItemAddedEnabled = function () {
+ return !!providerTemplates.eventEnabled(99)
+ };
+ proto.traceActionListControl_ItemAdded = function (templateId) {
+ providerTemplates.traceTemplate_z(99, templateId)
+ };
+ proto.isActionListControl_ItemRemovedEnabled = function () {
+ return !!providerTemplates.eventEnabled(100)
+ };
+ proto.traceActionListControl_ItemRemoved = function (templateId) {
+ providerTemplates.traceTemplate_z(100, templateId)
+ };
+ proto.isActionListControl_ItemsChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(101)
+ };
+ proto.traceActionListControl_ItemsChanged = function (templateId) {
+ providerTemplates.traceTemplate_z(101, templateId)
+ };
+ proto.isControlFramework_ControlConstructedEnabled = function () {
+ return !!providerTemplates.eventEnabled(102)
+ };
+ proto.traceControlFramework_ControlConstructed = function (templateId) {
+ providerTemplates.traceTemplate_z(102, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationQueuedEnabled = function () {
+ return !!providerTemplates.eventEnabled(103)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationQueued = function (templateId) {
+ providerTemplates.traceTemplate_z(103, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationRequeuedEnabled = function () {
+ return !!providerTemplates.eventEnabled(104)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationRequeued = function (templateId) {
+ providerTemplates.traceTemplate_z(104, templateId)
+ };
+ proto.isControlFramework_ControlInitializationStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(105)
+ };
+ proto.traceControlFramework_ControlInitializationStarted = function (templateId) {
+ providerTemplates.traceTemplate_z(105, templateId)
+ };
+ proto.isControlFramework_UserInitializationStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(106)
+ };
+ proto.traceControlFramework_UserInitializationStarted = function (templateId) {
+ providerTemplates.traceTemplate_z(106, templateId)
+ };
+ proto.isControlFramework_ControlTemplateLoadStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(107)
+ };
+ proto.traceControlFramework_ControlTemplateLoadStarted = function (templateId) {
+ providerTemplates.traceTemplate_z(107, templateId)
+ };
+ proto.isControlFramework_ControlTemplateLoadCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(108)
+ };
+ proto.traceControlFramework_ControlTemplateLoadCompleted = function (templateId) {
+ providerTemplates.traceTemplate_z(108, templateId)
+ };
+ proto.isControlFramework_TemplateLoadStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(109)
+ };
+ proto.traceControlFramework_TemplateLoadStarted = function (templateId) {
+ providerTemplates.traceTemplate_z(109, templateId)
+ };
+ proto.isControlFramework_TemplateLoadFragmentStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(110)
+ };
+ proto.traceControlFramework_TemplateLoadFragmentStarted = function (templateId) {
+ providerTemplates.traceTemplate_z(110, templateId)
+ };
+ proto.isControlFramework_TemplateLoadFragmentCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(111)
+ };
+ proto.traceControlFramework_TemplateLoadFragmentCompleted = function (templateId) {
+ providerTemplates.traceTemplate_z(111, templateId)
+ };
+ proto.isControlFramework_TemplateLoadTemplateExtractedEnabled = function () {
+ return !!providerTemplates.eventEnabled(112)
+ };
+ proto.traceControlFramework_TemplateLoadTemplateExtracted = function (templateId) {
+ providerTemplates.traceTemplate_z(112, templateId)
+ };
+ proto.isControlFramework_TemplateLoadCompletedFromCacheEnabled = function () {
+ return !!providerTemplates.eventEnabled(113)
+ };
+ proto.traceControlFramework_TemplateLoadCompletedFromCache = function (templateId) {
+ providerTemplates.traceTemplate_z(113, templateId)
+ };
+ proto.isControlFramework_TemplateLoadCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(114)
+ };
+ proto.traceControlFramework_TemplateLoadCompleted = function (templateId) {
+ providerTemplates.traceTemplate_z(114, templateId)
+ };
+ proto.isControlFramework_ControlInitializationCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(115)
+ };
+ proto.traceControlFramework_ControlInitializationCompleted = function (templateId) {
+ providerTemplates.traceTemplate_z(115, templateId)
+ };
+ proto.isControlFramework_UserInitializationCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(116)
+ };
+ proto.traceControlFramework_UserInitializationCompleted = function (templateId) {
+ providerTemplates.traceTemplate_z(116, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationQueuedForRootEnabled = function () {
+ return !!providerTemplates.eventEnabled(117)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationQueuedForRoot = function (templateId) {
+ providerTemplates.traceTemplate_z(117, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationDequeuedForRootEnabled = function () {
+ return !!providerTemplates.eventEnabled(118)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationDequeuedForRoot = function (templateId) {
+ providerTemplates.traceTemplate_z(118, templateId)
+ };
+ proto.isSubscriptionSignup_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(119)
+ };
+ proto.traceSubscriptionSignup_Start = function (templateId) {
+ providerTemplates.traceTemplate_z(119, templateId)
+ };
+ proto.isSubscriptionSignup_FinishEnabled = function () {
+ return !!providerTemplates.eventEnabled(120)
+ };
+ proto.traceSubscriptionSignup_Finish = function (templateId) {
+ providerTemplates.traceTemplate_z(120, templateId)
+ };
+ proto.isSubscriptionSignup_CancelEnabled = function () {
+ return !!providerTemplates.eventEnabled(121)
+ };
+ proto.traceSubscriptionSignup_Cancel = function (templateId) {
+ providerTemplates.traceTemplate_z(121, templateId)
+ };
+ proto.isSubscriptionSignup_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(122)
+ };
+ proto.traceSubscriptionSignup_Error = function (templateId) {
+ providerTemplates.traceTemplate_z(122, templateId)
+ };
+ proto.isNotification_NotificationArrivedEnabled = function () {
+ return !!providerTemplates.eventEnabled(123)
+ };
+ proto.traceNotification_NotificationArrived = function (templateId) {
+ providerTemplates.traceTemplate_z(123, templateId)
+ };
+ proto.isNotification_PageSelectedEnabled = function () {
+ return !!providerTemplates.eventEnabled(124)
+ };
+ proto.traceNotification_PageSelected = function (templateId) {
+ providerTemplates.traceTemplate_z(124, templateId)
+ };
+ proto.isNotification_NotificationClickedEnabled = function () {
+ return !!providerTemplates.eventEnabled(125)
+ };
+ proto.traceNotification_NotificationClicked = function (templateId) {
+ providerTemplates.traceTemplate_z(125, templateId)
+ };
+ proto.isAd_Companion_ShownEnabled = function () {
+ return !!providerTemplates.eventEnabled(126)
+ };
+ proto.traceAd_Companion_Shown = function (linkUrl, imageUrl) {
+ providerTemplates.traceTemplate_zz(126, linkUrl, imageUrl)
+ };
+ proto.isAd_Companion_HiddenEnabled = function () {
+ return !!providerTemplates.eventEnabled(127)
+ };
+ proto.traceAd_Companion_Hidden = function (linkUrl, imageUrl) {
+ providerTemplates.traceTemplate_zz(127, linkUrl, imageUrl)
+ };
+ proto.isVideo_Ad_StartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(128)
+ };
+ proto.traceVideo_Ad_Started = function (videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(128, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_CompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(129)
+ };
+ proto.traceVideo_Ad_Completed = function (videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(129, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_SkippedEnabled = function () {
+ return !!providerTemplates.eventEnabled(130)
+ };
+ proto.traceVideo_Ad_Skipped = function (videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(130, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(131)
+ };
+ proto.traceVideo_Ad_Error = function (videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(131, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_UpSellEnabled = function () {
+ return !!providerTemplates.eventEnabled(132)
+ };
+ proto.traceVideo_Ad_UpSell = function (videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(132, videoUrl, clickUrl)
+ };
+ proto.isAdControl_RefreshedEnabled = function () {
+ return !!providerTemplates.eventEnabled(133)
+ };
+ proto.traceAdControl_Refreshed = function (applicationId, unitId) {
+ providerTemplates.traceTemplate_zz(133, applicationId, unitId)
+ };
+ proto.isAdService_InitializedEnabled = function () {
+ return !!providerTemplates.eventEnabled(134)
+ };
+ proto.traceAdService_Initialized = function () {
+ providerTemplates.traceTemplateEventDescriptor(134)
+ };
+ proto.isAdService_UnloadedEnabled = function () {
+ return !!providerTemplates.eventEnabled(135)
+ };
+ proto.traceAdService_Unloaded = function () {
+ providerTemplates.traceTemplateEventDescriptor(135)
+ };
+ proto.isAdService_AudioAdRefreshingEnabled = function () {
+ return !!providerTemplates.eventEnabled(136)
+ };
+ proto.traceAdService_AudioAdRefreshing = function () {
+ providerTemplates.traceTemplateEventDescriptor(136)
+ };
+ proto.isAdService_AudioAdRefreshedEnabled = function () {
+ return !!providerTemplates.eventEnabled(137)
+ };
+ proto.traceAdService_AudioAdRefreshed = function () {
+ providerTemplates.traceTemplateEventDescriptor(137)
+ };
+ proto.isAdService_VideoAdRefreshingEnabled = function () {
+ return !!providerTemplates.eventEnabled(138)
+ };
+ proto.traceAdService_VideoAdRefreshing = function () {
+ providerTemplates.traceTemplateEventDescriptor(138)
+ };
+ proto.isAdService_VideoAdRefreshedEnabled = function () {
+ return !!providerTemplates.eventEnabled(139)
+ };
+ proto.traceAdService_VideoAdRefreshed = function () {
+ providerTemplates.traceTemplateEventDescriptor(139)
+ };
+ proto.isAdService_AudioAdPlayingEnabled = function () {
+ return !!providerTemplates.eventEnabled(140)
+ };
+ proto.traceAdService_AudioAdPlaying = function () {
+ providerTemplates.traceTemplateEventDescriptor(140)
+ };
+ proto.isAdService_AudioAdPlayedEnabled = function () {
+ return !!providerTemplates.eventEnabled(141)
+ };
+ proto.traceAdService_AudioAdPlayed = function () {
+ providerTemplates.traceTemplateEventDescriptor(141)
+ };
+ proto.isAdService_StreamingTrackPlayingEnabled = function () {
+ return !!providerTemplates.eventEnabled(142)
+ };
+ proto.traceAdService_StreamingTrackPlaying = function () {
+ providerTemplates.traceTemplateEventDescriptor(142)
+ };
+ proto.isAdService_StreamingTrackPlayedEnabled = function () {
+ return !!providerTemplates.eventEnabled(143)
+ };
+ proto.traceAdService_StreamingTrackPlayed = function () {
+ providerTemplates.traceTemplateEventDescriptor(143)
+ };
+ proto.isAdService_TrackPlayingEnabled = function () {
+ return !!providerTemplates.eventEnabled(144)
+ };
+ proto.traceAdService_TrackPlaying = function () {
+ providerTemplates.traceTemplateEventDescriptor(144)
+ };
+ proto.isMediaStateEngine_InitializedEnabled = function () {
+ return !!providerTemplates.eventEnabled(145)
+ };
+ proto.traceMediaStateEngine_Initialized = function (mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(145, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_UnloadedEnabled = function () {
+ return !!providerTemplates.eventEnabled(146)
+ };
+ proto.traceMediaStateEngine_Unloaded = function (mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(146, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_UpdateStateEnabled = function () {
+ return !!providerTemplates.eventEnabled(147)
+ };
+ proto.traceMediaStateEngine_UpdateState = function (mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(147, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_ButtonsChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(148)
+ };
+ proto.traceMediaStateEngine_ButtonsChanged = function (mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(148, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_ActionsChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(149)
+ };
+ proto.traceMediaStateEngine_ActionsChanged = function (mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(149, mediaType, serviceId, libraryId)
+ };
+ proto.isWinJSNavigation_ContentCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(150)
+ };
+ proto.traceWinJSNavigation_ContentComplete = function (location) {
+ providerTemplates.traceTemplate_z(150, location)
+ };
+ proto.isShrinkAndStayHeader_ShownEnabled = function () {
+ return !!providerTemplates.eventEnabled(151)
+ };
+ proto.traceShrinkAndStayHeader_Shown = function () {
+ providerTemplates.traceTemplateEventDescriptor(151)
+ };
+ proto.isShrinkAndStayHeader_DismissedEnabled = function () {
+ return !!providerTemplates.eventEnabled(152)
+ };
+ proto.traceShrinkAndStayHeader_Dismissed = function () {
+ providerTemplates.traceTemplateEventDescriptor(152)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(153)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchCompleted = function (durationMsec) {
+ providerTemplates.traceTemplate_q(153, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToCollectionCompletedEnabled = function () {
+ return !!providerTemplates.eventEnabled(154)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToCollectionCompleted = function (durationMsec) {
+ providerTemplates.traceTemplate_q(154, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchPlayNonProtectedContentEnabled = function () {
+ return !!providerTemplates.eventEnabled(155)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchPlayNonProtectedContent = function (durationMsec) {
+ providerTemplates.traceTemplate_q(155, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchPlayProtectedContentEnabled = function () {
+ return !!providerTemplates.eventEnabled(156)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchPlayProtectedContent = function (durationMsec) {
+ providerTemplates.traceTemplate_q(156, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PlayProtectedInAppPlaybackStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(157)
+ };
+ proto.tracePerfTrack_Trigger_PlayProtectedInAppPlaybackStarted = function (durationMsec) {
+ providerTemplates.traceTemplate_q(157, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PlayNonProtectedInAppPlaybackStartedEnabled = function () {
+ return !!providerTemplates.eventEnabled(158)
+ };
+ proto.tracePerfTrack_Trigger_PlayNonProtectedInAppPlaybackStarted = function (durationMsec) {
+ providerTemplates.traceTemplate_q(158, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_CollectionGalleryRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(159)
+ };
+ proto.tracePerfTrack_Trigger_CollectionGalleryRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(159, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchGalleryRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(160)
+ };
+ proto.tracePerfTrack_Trigger_SearchGalleryRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(160, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PopoverRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(161)
+ };
+ proto.tracePerfTrack_Trigger_PopoverRequestToLoad = function (name, durationMsec) {
+ providerTemplates.traceTemplate_zq(161, name, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MarketplaceGalleryRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(162)
+ };
+ proto.tracePerfTrack_Trigger_MarketplaceGalleryRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(162, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_WebBlendRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(163)
+ };
+ proto.tracePerfTrack_Trigger_WebBlendRequestToLoad = function (url, durationMsec) {
+ providerTemplates.traceTemplate_zq(163, url, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ExplorePageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(164)
+ };
+ proto.tracePerfTrack_Trigger_ExplorePageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(164, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_RadioPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(165)
+ };
+ proto.tracePerfTrack_Trigger_RadioPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(165, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToExploreCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(166)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToExploreComplete = function (durationMsec) {
+ providerTemplates.traceTemplate_q(166, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToRadioCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(167)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToRadioComplete = function (durationMsec) {
+ providerTemplates.traceTemplate_q(167, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TVDetailsRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(168)
+ };
+ proto.tracePerfTrack_Trigger_TVDetailsRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(168, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MovieDetailsRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(169)
+ };
+ proto.tracePerfTrack_Trigger_MovieDetailsRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(169, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AlbumDetailsRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(170)
+ };
+ proto.tracePerfTrack_Trigger_AlbumDetailsRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(170, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ArtistDetailsRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(171)
+ };
+ proto.tracePerfTrack_Trigger_ArtistDetailsRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(171, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PlaylistDetailsRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(172)
+ };
+ proto.tracePerfTrack_Trigger_PlaylistDetailsRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(172, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_DevicesPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(173)
+ };
+ proto.tracePerfTrack_Trigger_DevicesPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(173, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_NowPlayingPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(174)
+ };
+ proto.tracePerfTrack_Trigger_NowPlayingPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(174, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MoviesStorePageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(175)
+ };
+ proto.tracePerfTrack_Trigger_MoviesStorePageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(175, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TvStorePageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(176)
+ };
+ proto.tracePerfTrack_Trigger_TvStorePageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(176, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_VideoCollectionPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(177)
+ };
+ proto.tracePerfTrack_Trigger_VideoCollectionPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(177, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ShopBooksPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(178)
+ };
+ proto.tracePerfTrack_Trigger_ShopBooksPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(178, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ShopMagsPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(179)
+ };
+ proto.tracePerfTrack_Trigger_ShopMagsPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(179, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToShopBooksCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(180)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToShopBooksComplete = function (durationMsec) {
+ providerTemplates.traceTemplate_q(180, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToShopMagsCompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(181)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToShopMagsComplete = function (durationMsec) {
+ providerTemplates.traceTemplate_q(181, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToOOBECompleteEnabled = function () {
+ return !!providerTemplates.eventEnabled(182)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToOOBEComplete = function (durationMsec) {
+ providerTemplates.traceTemplate_q(182, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_CategoryGalleryRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(183)
+ };
+ proto.tracePerfTrack_Trigger_CategoryGalleryRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(183, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_IssuesGalleryRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(184)
+ };
+ proto.tracePerfTrack_Trigger_IssuesGalleryRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(184, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_StandardGalleryRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(185)
+ };
+ proto.tracePerfTrack_Trigger_StandardGalleryRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(185, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_BookDetailsRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(186)
+ };
+ proto.tracePerfTrack_Trigger_BookDetailsRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(186, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MagDetailsRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(187)
+ };
+ proto.tracePerfTrack_Trigger_MagDetailsRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(187, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchLibraryRequestToQueryResultsEnabled = function () {
+ return !!providerTemplates.eventEnabled(188)
+ };
+ proto.tracePerfTrack_Trigger_SearchLibraryRequestToQueryResults = function (durationMsec) {
+ providerTemplates.traceTemplate_q(188, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchCatalogRequestToQueryResultsEnabled = function () {
+ return !!providerTemplates.eventEnabled(189)
+ };
+ proto.tracePerfTrack_Trigger_SearchCatalogRequestToQueryResults = function (durationMsec) {
+ providerTemplates.traceTemplate_q(189, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchAutoCompleteResultsReceivedEnabled = function () {
+ return !!providerTemplates.eventEnabled(190)
+ };
+ proto.tracePerfTrack_Trigger_SearchAutoCompleteResultsReceived = function (durationMsec) {
+ providerTemplates.traceTemplate_q(190, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_BNDeviceRegistrationRequestSucceededEnabled = function () {
+ return !!providerTemplates.eventEnabled(191)
+ };
+ proto.tracePerfTrack_Trigger_BNDeviceRegistrationRequestSucceeded = function (durationMsec) {
+ providerTemplates.traceTemplate_q(191, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_BNLoginRequestSucceededEnabled = function () {
+ return !!providerTemplates.eventEnabled(192)
+ };
+ proto.tracePerfTrack_Trigger_BNLoginRequestSucceeded = function (durationMsec) {
+ providerTemplates.traceTemplate_q(192, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToMoviesStoreEnabled = function () {
+ return !!providerTemplates.eventEnabled(193)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToMoviesStore = function (durationMsec) {
+ providerTemplates.traceTemplate_q(193, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToTvStoreEnabled = function () {
+ return !!providerTemplates.eventEnabled(194)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToTvStore = function (durationMsec) {
+ providerTemplates.traceTemplate_q(194, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToVideoCollectionEnabled = function () {
+ return !!providerTemplates.eventEnabled(195)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToVideoCollection = function (durationMsec) {
+ providerTemplates.traceTemplate_q(195, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MoviesCollectionPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(196)
+ };
+ proto.tracePerfTrack_Trigger_MoviesCollectionPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(196, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TvCollectionPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(197)
+ };
+ proto.tracePerfTrack_Trigger_TvCollectionPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(197, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PersonalCollectionPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(198)
+ };
+ proto.tracePerfTrack_Trigger_PersonalCollectionPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(198, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_FeaturedMoviesPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(199)
+ };
+ proto.tracePerfTrack_Trigger_FeaturedMoviesPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(199, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_NewMoviesPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(200)
+ };
+ proto.tracePerfTrack_Trigger_NewMoviesPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(200, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TopSellingMoviesPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(201)
+ };
+ proto.tracePerfTrack_Trigger_TopSellingMoviesPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(201, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_FeaturedTvPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(202)
+ };
+ proto.tracePerfTrack_Trigger_FeaturedTvPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(202, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_NewTvPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(203)
+ };
+ proto.tracePerfTrack_Trigger_NewTvPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(203, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_LastNightsTvPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(204)
+ };
+ proto.tracePerfTrack_Trigger_LastNightsTvPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(204, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TopSellingTvPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(205)
+ };
+ proto.tracePerfTrack_Trigger_TopSellingTvPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(205, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_FlexHubPageRequestToLoadEnabled = function () {
+ return !!providerTemplates.eventEnabled(206)
+ };
+ proto.tracePerfTrack_Trigger_FlexHubPageRequestToLoad = function (durationMsec) {
+ providerTemplates.traceTemplate_q(206, durationMsec)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Sync(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.SyncEventProvider = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.SyncEventProviderTemplate
+ };
+ var proto = ns.SyncEventProvider.prototype;
+ proto.isCloudSync_Engine_Sync_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceCloudSync_Engine_Sync_Start = function (requestSyncOption) {
+ providerTemplates.traceTemplate_q(0, requestSyncOption)
+ };
+ proto.isCloudSync_Engine_Sync_StopEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceCloudSync_Engine_Sync_Stop = function (hResult) {
+ providerTemplates.traceTemplate_d(1, hResult)
+ };
+ proto.isCloudSync_Engine_BlockSync_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceCloudSync_Engine_BlockSync_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(2)
+ };
+ proto.isCloudSync_Engine_BlockSync_StopEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceCloudSync_Engine_BlockSync_Stop = function () {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isCloudSync_Engine_RequestSyncEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceCloudSync_Engine_RequestSync = function (requestSyncOption, cookieNextCompleteSync) {
+ providerTemplates.traceTemplate_qq(4, requestSyncOption, cookieNextCompleteSync)
+ };
+ proto.isCloudSync_Engine_SyncErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceCloudSync_Engine_SyncError = function (hResult) {
+ providerTemplates.traceTemplate_d(5, hResult)
+ };
+ proto.isCloudSync_Engine_SyncEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceCloudSync_Engine_SyncEnd = function (hResult, changes, cookieCompleteSync) {
+ providerTemplates.traceTemplate_dtq(6, hResult, changes, cookieCompleteSync)
+ };
+ proto.isCloudSync_Engine_ScheduleSyncEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceCloudSync_Engine_ScheduleSync = function (delayTimeMS) {
+ providerTemplates.traceTemplate_q(7, delayTimeMS)
+ };
+ proto.isCloudSync_Engine_CancelSyncEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceCloudSync_Engine_CancelSync = function (hResult) {
+ providerTemplates.traceTemplate_d(8, hResult)
+ };
+ proto.isCloudSync_Engine_NotificationEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceCloudSync_Engine_Notification = function (syncPointId) {
+ providerTemplates.traceTemplate_z(9, syncPointId)
+ };
+ proto.isCloudSync_LibraryProvider_LoadItemEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceCloudSync_LibraryProvider_LoadItem = function (syncType, mediaId) {
+ providerTemplates.traceTemplate_qd(10, syncType, mediaId)
+ };
+ proto.isCloudSync_LibraryProvider_AddItemEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceCloudSync_LibraryProvider_AddItem = function (syncType, mediaId) {
+ providerTemplates.traceTemplate_qd(11, syncType, mediaId)
+ };
+ proto.isCloudSync_LibraryProvider_UpdateItemEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceCloudSync_LibraryProvider_UpdateItem = function (syncType, mediaIdIn, mediaIdOut) {
+ providerTemplates.traceTemplate_qdd(12, syncType, mediaIdIn, mediaIdOut)
+ };
+ proto.isCloudSync_LibraryProvider_DeleteItemEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceCloudSync_LibraryProvider_DeleteItem = function (syncType, mediaId) {
+ providerTemplates.traceTemplate_qd(13, syncType, mediaId)
+ };
+ proto.isCloudSync_LibraryProvider_DirtyItemsEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceCloudSync_LibraryProvider_DirtyItems = function (syncType, dirtyItems) {
+ providerTemplates.traceTemplate_qz(14, syncType, dirtyItems)
+ };
+ proto.isCloudSync_LibraryProvider_DeletedItemsEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceCloudSync_LibraryProvider_DeletedItems = function (syncType, deletedItems) {
+ providerTemplates.traceTemplate_qz(15, syncType, deletedItems)
+ };
+ proto.isCloudSync_LibraryProvider_InvalidItemsEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceCloudSync_LibraryProvider_InvalidItems = function (syncType, invalidItems) {
+ providerTemplates.traceTemplate_qz(16, syncType, invalidItems)
+ };
+ proto.isCloudSync_LibraryProvider_IsDirtyEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceCloudSync_LibraryProvider_IsDirty = function (isDirty) {
+ providerTemplates.traceTemplate_t(17, isDirty)
+ };
+ proto.isCloudSync_LibraryProvider_IsAvailableEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceCloudSync_LibraryProvider_IsAvailable = function (isAvailable) {
+ providerTemplates.traceTemplate_t(18, isAvailable)
+ };
+ proto.isCloudSync_LibraryProvider_ContentChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceCloudSync_LibraryProvider_ContentChanged = function (notifyDelayMS) {
+ providerTemplates.traceTemplate_q(19, notifyDelayMS)
+ };
+ proto.isCloudSync_LibraryProvider_UpdateMetadata_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceCloudSync_LibraryProvider_UpdateMetadata_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(20)
+ };
+ proto.isCloudSync_LibraryProvider_UpdateMetadata_StopEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceCloudSync_LibraryProvider_UpdateMetadata_Stop = function () {
+ providerTemplates.traceTemplateEventDescriptor(21)
+ };
+ proto.isCloudSync_CloudProvider_ApplyItem_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyItem_Error = function (syncType, cloudId, hResult) {
+ providerTemplates.traceTemplate_qzd(22, syncType, cloudId, hResult)
+ };
+ proto.isCloudSync_CloudProvider_ApplyItem_SkippedEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyItem_Skipped = function (syncType, cloudId) {
+ providerTemplates.traceTemplate_qz(23, syncType, cloudId)
+ };
+ proto.isCloudSync_CloudProvider_LoadItem_ErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceCloudSync_CloudProvider_LoadItem_Error = function (syncType, cloudId, hResult) {
+ providerTemplates.traceTemplate_qzd(24, syncType, cloudId, hResult)
+ };
+ proto.isCloudSync_CloudProvider_IsDirtyEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceCloudSync_CloudProvider_IsDirty = function (isDirty, dirtyReason) {
+ providerTemplates.traceTemplate_tq(25, isDirty, dirtyReason)
+ };
+ proto.isCloudSync_CloudProvider_IsAvailableEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceCloudSync_CloudProvider_IsAvailable = function (availability) {
+ providerTemplates.traceTemplate_q(26, availability)
+ };
+ proto.isCloudSync_CloudProvider_ContentChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceCloudSync_CloudProvider_ContentChanged = function () {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isCloudSync_CloudProvider_FindChangesEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceCloudSync_CloudProvider_FindChanges = function (anchor, requestedBatchSize, hasMoreData) {
+ providerTemplates.traceTemplate_zqt(28, anchor, requestedBatchSize, hasMoreData)
+ };
+ proto.isCloudSync_CloudProvider_FoundChangeEnabled = function () {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceCloudSync_CloudProvider_FoundChange = function (syncType, cloudId, changeType) {
+ providerTemplates.traceTemplate_qzq(29, syncType, cloudId, changeType)
+ };
+ proto.isCloudSync_CloudProvider_TakeDownEnabled = function () {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceCloudSync_CloudProvider_TakeDown = function (cloudId) {
+ providerTemplates.traceTemplate_z(30, cloudId)
+ };
+ proto.isCloudSync_CloudProvider_UpdateMetadata_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceCloudSync_CloudProvider_UpdateMetadata_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isCloudSync_CloudProvider_UpdateMetadata_StopEnabled = function () {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceCloudSync_CloudProvider_UpdateMetadata_Stop = function () {
+ providerTemplates.traceTemplateEventDescriptor(32)
+ };
+ proto.isCloudSync_CloudProvider_ApplyBatch_StartEnabled = function () {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyBatch_Start = function () {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isCloudSync_CloudProvider_ApplyBatch_StopEnabled = function () {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyBatch_Stop = function () {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ }
+ })(this);
+ (function initMicrosoft_Zune_LegacyPerfTrace(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.LegacyPerfTrace = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.LegacyPerfTraceTemplate
+ };
+ var proto = ns.LegacyPerfTrace.prototype;
+ proto.isLegacyPerfTraceHttpEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceLegacyPerfTraceHttpEvent = function (httpEvent, url) {
+ providerTemplates.traceTemplate_qz(0, httpEvent, url)
+ };
+ proto.isLegacyPerfTraceClientEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceLegacyPerfTraceClientEvent = function (reporterTag, actionType, reason) {
+ providerTemplates.traceTemplate_qqq(1, reporterTag, actionType, reason)
+ };
+ proto.isLegacyPerfTraceWMPPlaybackEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceLegacyPerfTraceWMPPlaybackEvent = function (type, fileName, graphType, lastHR) {
+ providerTemplates.traceTemplate_qzqd(2, type, fileName, graphType, lastHR)
+ };
+ proto.isLegacyPerfTraceDBMutexEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceLegacyPerfTraceDBMutexEvent = function (dBMutexEvent, threadId, time) {
+ providerTemplates.traceTemplate_qqq(3, dBMutexEvent, threadId, time)
+ };
+ proto.isLegacyPerfTraceLaunchEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceLegacyPerfTraceLaunchEvent = function (launchEvent, launchEventData) {
+ providerTemplates.traceTemplate_qq(4, launchEvent, launchEventData)
+ };
+ proto.isLegacyPerfTraceSyncEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceLegacyPerfTraceSyncEvent = function (syncEvent, syncEventData) {
+ providerTemplates.traceTemplate_qq(5, syncEvent, syncEventData)
+ };
+ proto.isLegacyPerfTraceQRSEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceLegacyPerfTraceQRSEvent = function (qRSEvent, qRSEventData) {
+ providerTemplates.traceTemplate_qq(6, qRSEvent, qRSEventData)
+ };
+ proto.isLegacyPerfTraceGenericEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceLegacyPerfTraceGenericEvent = function (reporterTag, type, action) {
+ providerTemplates.traceTemplate_qqq(7, reporterTag, type, action)
+ };
+ proto.isLegacyPerfTraceDriverEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceLegacyPerfTraceDriverEvent = function (driverEvent, driverEventData) {
+ providerTemplates.traceTemplate_qq(8, driverEvent, driverEventData)
+ };
+ proto.isLegacyPerfTraceCollectionEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceLegacyPerfTraceCollectionEvent = function (collectionEvent, detail) {
+ providerTemplates.traceTemplate_qz(9, collectionEvent, detail)
+ };
+ proto.isLegacyPerfTraceQuickMixEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceLegacyPerfTraceQuickMixEvent = function (quickMixEvent, quickMixEventData) {
+ providerTemplates.traceTemplate_qq(10, quickMixEvent, quickMixEventData)
+ };
+ proto.isLegacyPerfTraceDownloadEventEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceLegacyPerfTraceDownloadEvent = function (downloadEvent, id) {
+ providerTemplates.traceTemplate_qz(11, downloadEvent, id)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Social(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Social = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.SocialTemplate
+ };
+ var proto = ns.Social.prototype;
+ proto.isAvatarRendererFrameStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceAvatarRendererFrameStart = function (id) {
+ providerTemplates.traceTemplate_z(0, id)
+ };
+ proto.isAvatarRendererFrameEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceAvatarRendererFrameEnd = function (id, duration) {
+ providerTemplates.traceTemplate_zf(1, id, duration)
+ };
+ proto.isAvatarRendererShutdownEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceAvatarRendererShutdown = function (id) {
+ providerTemplates.traceTemplate_z(2, id)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Xbox(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Xbox = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.XboxTemplate
+ };
+ var proto = ns.Xbox.prototype;
+ proto.isXboxSessionStateChangeEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceXboxSessionStateChange = function (newState, oldState) {
+ providerTemplates.traceTemplate_zz(0, newState, oldState)
+ };
+ proto.isXboxTransportControlsLRCStateChangeEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceXboxTransportControlsLRCStateChange = function (newState, oldState) {
+ providerTemplates.traceTemplate_zz(1, newState, oldState)
+ };
+ proto.isXboxSigninTMFServiceSigninEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceXboxSigninTMFServiceSignin = function (tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(2, tag, hResult, errorText)
+ };
+ proto.isXboxSigninJoinSessionEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceXboxSigninJoinSession = function (tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(3, tag, hResult, errorText)
+ };
+ proto.isXboxSigninX8AppSigninEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceXboxSigninX8AppSignin = function (tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(4, tag, hResult, errorText)
+ };
+ proto.isXboxSigninNoUserSessionsEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceXboxSigninNoUserSessions = function (tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(5, tag, hResult, errorText)
+ };
+ proto.isXboxControlCommandSentEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceXboxControlCommandSent = function (controlKey, executionTimeMilliseconds) {
+ providerTemplates.traceTemplate_qf(6, controlKey, executionTimeMilliseconds)
+ };
+ proto.isXboxControlCommandErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceXboxControlCommandError = function (controlKey, executionTimeMilliseconds, responseCode) {
+ providerTemplates.traceTemplate_qfq(7, controlKey, executionTimeMilliseconds, responseCode)
+ };
+ proto.isXboxControlSeekCommandSentEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceXboxControlSeekCommandSent = function (seekPosition, executionTimeMilliseconds) {
+ providerTemplates.traceTemplate_xf(8, seekPosition, executionTimeMilliseconds)
+ };
+ proto.isXboxControlSeekCommandErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceXboxControlSeekCommandError = function (seekPosition, executionTimeMilliseconds, responseCode) {
+ providerTemplates.traceTemplate_xfq(9, seekPosition, executionTimeMilliseconds, responseCode)
+ };
+ proto.isXboxBogusMediaStateMessageIgnoredEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceXboxBogusMediaStateMessageIgnored = function (position, transportState, positionBeforeLastSeek, lastSeekPosition) {
+ providerTemplates.traceTemplate_xqxx(10, position, transportState, positionBeforeLastSeek, lastSeekPosition)
+ };
+ proto.isXboxGetMediaStateErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceXboxGetMediaStateError = function (executionTimeMilliseconds, responseCode) {
+ providerTemplates.traceTemplate_fq(11, executionTimeMilliseconds, responseCode)
+ };
+ proto.isXboxShowXboxControlsEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceXboxShowXboxControls = function () {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isXboxShowXboxControlsSetVisibleEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceXboxShowXboxControlsSetVisible = function () {
+ providerTemplates.traceTemplateEventDescriptor(13)
+ };
+ proto.isXboxHideXboxControlsEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceXboxHideXboxControls = function () {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isXboxOnlinePresenceBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceXboxOnlinePresenceBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(15)
+ };
+ proto.isXboxOnlinePresenceReceivedEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceXboxOnlinePresenceReceived = function (titleId, mediaAssetId) {
+ providerTemplates.traceTemplate_qz(16, titleId, mediaAssetId)
+ };
+ proto.isXboxOnlinePresenceErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceXboxOnlinePresenceError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(17, hResult, errorMessage)
+ };
+ proto.isXboxGetActiveTitleInformationBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceXboxGetActiveTitleInformationBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(18)
+ };
+ proto.isXboxGetActiveTitleInformationDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceXboxGetActiveTitleInformationDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(19)
+ };
+ proto.isXboxGetActiveTitleInformationErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceXboxGetActiveTitleInformationError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(20, hResult, errorMessage)
+ };
+ proto.isXboxEstablishTitleChannelBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceXboxEstablishTitleChannelBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(21)
+ };
+ proto.isXboxEstablishTitleChannelDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceXboxEstablishTitleChannelDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isXboxEstablishTitleChannelErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceXboxEstablishTitleChannelError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(23, hResult, errorMessage)
+ };
+ proto.isXboxSendTouchPointsBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceXboxSendTouchPointsBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(24)
+ };
+ proto.isXboxSendTouchPointsDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceXboxSendTouchPointsDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isXboxSendTouchPointsErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceXboxSendTouchPointsError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(26, hResult, errorMessage)
+ };
+ proto.isXboxGetKeyboardBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceXboxGetKeyboardBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isXboxGetKeyboardDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceXboxGetKeyboardDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(28)
+ };
+ proto.isXboxGetKeyboardErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceXboxGetKeyboardError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(29, hResult, errorMessage)
+ };
+ proto.isXboxGetKeyboardStateBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceXboxGetKeyboardStateBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(30)
+ };
+ proto.isXboxGetKeyboardStateDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceXboxGetKeyboardStateDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isXboxGetKeyboardStateErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceXboxGetKeyboardStateError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(32, hResult, errorMessage)
+ };
+ proto.isXboxGetKeyboardTextBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceXboxGetKeyboardTextBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isXboxGetKeyboardTextDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceXboxGetKeyboardTextDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ };
+ proto.isXboxGetKeyboardTextErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceXboxGetKeyboardTextError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(35, hResult, errorMessage)
+ };
+ proto.isXboxSetKeyboardTextBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceXboxSetKeyboardTextBegin = function (text) {
+ providerTemplates.traceTemplate_z(36, text)
+ };
+ proto.isXboxSetKeyboardTextDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceXboxSetKeyboardTextDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isXboxSetKeyboardTextErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceXboxSetKeyboardTextError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(38, hResult, errorMessage)
+ };
+ proto.isXboxSetKeyboardTextAndSelectionBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceXboxSetKeyboardTextAndSelectionBegin = function (text, selectionStart, selectionLength) {
+ providerTemplates.traceTemplate_zqq(39, text, selectionStart, selectionLength)
+ };
+ proto.isXboxSetKeyboardTextAndSelectionDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceXboxSetKeyboardTextAndSelectionDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(40)
+ };
+ proto.isXboxSetKeyboardTextAndSelectionErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceXboxSetKeyboardTextAndSelectionError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(41, hResult, errorMessage)
+ };
+ proto.isXboxSendTitleMessageBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceXboxSendTitleMessageBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(42)
+ };
+ proto.isXboxSendTitleMessageDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceXboxSendTitleMessageDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isXboxSendTitleMessageErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceXboxSendTitleMessageError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(44, hResult, errorMessage)
+ };
+ proto.isXboxDisconnectSessionBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceXboxDisconnectSessionBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(45)
+ };
+ proto.isXboxDisconnectSessionDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceXboxDisconnectSessionDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(46)
+ };
+ proto.isXboxDisconnectSessionErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceXboxDisconnectSessionError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(47, hResult, errorMessage)
+ };
+ proto.isXboxNewSessionObjectAssignedEnabled = function () {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceXboxNewSessionObjectAssigned = function () {
+ providerTemplates.traceTemplateEventDescriptor(48)
+ };
+ proto.isXboxSessionObjectReassignedEnabled = function () {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceXboxSessionObjectReassigned = function () {
+ providerTemplates.traceTemplateEventDescriptor(49)
+ };
+ proto.isXboxSessionObjectResetToNullEnabled = function () {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceXboxSessionObjectResetToNull = function () {
+ providerTemplates.traceTemplateEventDescriptor(50)
+ };
+ proto.isXboxTitleChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceXboxTitleChanged = function (titleId) {
+ providerTemplates.traceTemplate_q(51, titleId)
+ };
+ proto.isXboxTitleMessagingConfigChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceXboxTitleMessagingConfigChanged = function (titleId, titlePort, enabled) {
+ providerTemplates.traceTemplate_qqt(52, titleId, titlePort, enabled)
+ };
+ proto.isXboxTitleChannelStatusChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceXboxTitleChannelStatusChanged = function (status, titleId, titlePort, hResult) {
+ providerTemplates.traceTemplate_qqqd(53, status, titleId, titlePort, hResult)
+ };
+ proto.isXboxStreamingModeChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceXboxStreamingModeChanged = function (clientExclusiveModeStatus, consoleExclusiveModeStatus) {
+ providerTemplates.traceTemplate_qq(54, clientExclusiveModeStatus, consoleExclusiveModeStatus)
+ };
+ proto.isXboxLocalTransportStateChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceXboxLocalTransportStateChanged = function (localTransportConnected) {
+ providerTemplates.traceTemplate_t(55, localTransportConnected)
+ };
+ proto.isXboxSessionStatusChangedEnabled = function () {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceXboxSessionStatusChanged = function (sessionState) {
+ providerTemplates.traceTemplate_q(56, sessionState)
+ };
+ proto.isXboxAcquireExclusiveModeBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.traceXboxAcquireExclusiveModeBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(57)
+ };
+ proto.isXboxAcquireExclusiveModeDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.traceXboxAcquireExclusiveModeDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(58)
+ };
+ proto.isXboxAcquireExclusiveModeErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.traceXboxAcquireExclusiveModeError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(59, hResult, errorMessage)
+ };
+ proto.isXboxHeartBeatPingErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.traceXboxHeartBeatPingError = function (hResult, errorMessage, sessionState, isCurrentWinRTSessionReassigned, isCurrentWinRTSessionNull) {
+ providerTemplates.traceTemplate_dzztt(60, hResult, errorMessage, sessionState, isCurrentWinRTSessionReassigned, isCurrentWinRTSessionNull)
+ };
+ proto.isXboxSessionConnectCallEnabled = function () {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.traceXboxSessionConnectCall = function (sessionState, isRetry) {
+ providerTemplates.traceTemplate_zt(61, sessionState, isRetry)
+ };
+ proto.isXboxLaunchTitleCallEnabled = function () {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceXboxLaunchTitleCall = function (titleId, startTimeMilliseconds, firstAction) {
+ providerTemplates.traceTemplate_qfz(62, titleId, startTimeMilliseconds, firstAction)
+ };
+ proto.isXboxReleaseExclusiveModeBeginEnabled = function () {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceXboxReleaseExclusiveModeBegin = function () {
+ providerTemplates.traceTemplateEventDescriptor(63)
+ };
+ proto.isXboxReleaseExclusiveModeDoneEnabled = function () {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceXboxReleaseExclusiveModeDone = function () {
+ providerTemplates.traceTemplateEventDescriptor(64)
+ };
+ proto.isXboxReleaseExclusiveModeErrorEnabled = function () {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceXboxReleaseExclusiveModeError = function (hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(65, hResult, errorMessage)
+ }
+ })(this);
+ (function initMicrosoft_Zune_Providers(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Providers = function () {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.ProvidersTemplate
+ };
+ var proto = ns.Providers.prototype;
+ proto.isAddMediaStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceAddMediaStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(0)
+ };
+ proto.isAddMediaEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceAddMediaEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(1)
+ };
+ proto.isAddTrackStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceAddTrackStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(2)
+ };
+ proto.isAddTrackEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceAddTrackEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isAddAlbumAndFindTrackIdStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceAddAlbumAndFindTrackIdStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(4)
+ };
+ proto.isAddAlbumAndFindTrackIdEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceAddAlbumAndFindTrackIdEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(5)
+ };
+ proto.isFindTrackIdAndAlbumBasedOnTrackSmidStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceFindTrackIdAndAlbumBasedOnTrackSmidStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isFindTrackIdAndAlbumBasedOnTrackSmidEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceFindTrackIdAndAlbumBasedOnTrackSmidEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(7)
+ };
+ proto.isAddAlbumAndFindTrackIdBasedOnMetadataStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceAddAlbumAndFindTrackIdBasedOnMetadataStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(8)
+ };
+ proto.isAddAlbumAndFindTrackIdBasedOnMetadataEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceAddAlbumAndFindTrackIdBasedOnMetadataEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(9)
+ };
+ proto.isAddAudioAlbumStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceAddAudioAlbumStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(10)
+ };
+ proto.isAddAudioAlbumEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceAddAudioAlbumEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(11)
+ };
+ proto.isFindArtistAndAlbumStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceFindArtistAndAlbumStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isFindArtistAndAlbumEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceFindArtistAndAlbumEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(13)
+ };
+ proto.isUpdateCurrentAudioAlbumStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceUpdateCurrentAudioAlbumStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isUpdateCurrentAudioAlbumEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceUpdateCurrentAudioAlbumEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(15)
+ };
+ proto.isAddPersonLinksStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceAddPersonLinksStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(16)
+ };
+ proto.isAddPersonLinksEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceAddPersonLinksEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(17)
+ };
+ proto.isAddPersonStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceAddPersonStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(18)
+ };
+ proto.isAddPersonEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceAddPersonEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(19)
+ };
+ proto.isAddPersonLinkStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceAddPersonLinkStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(20)
+ };
+ proto.isAddPersonLinkEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceAddPersonLinkEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(21)
+ };
+ proto.isFindAndGetAudioTrackStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceFindAndGetAudioTrackStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isFindAndGetAudioTrackEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceFindAndGetAudioTrackEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(23)
+ };
+ proto.isUpdateCurrentTrackStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceUpdateCurrentTrackStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(24)
+ };
+ proto.isUpdateCurrentTrackEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceUpdateCurrentTrackEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isRecomputeAlbumReleaseYearStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceRecomputeAlbumReleaseYearStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(26)
+ };
+ proto.isRecomputeAlbumReleaseYearEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceRecomputeAlbumReleaseYearEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isAddTrackFileStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceAddTrackFileStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(28)
+ };
+ proto.isAddTrackFileEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceAddTrackFileEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(29)
+ };
+ proto.isReflectTrackFilesStateStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceReflectTrackFilesStateStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(30)
+ };
+ proto.isReflectTrackFilesStateEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceReflectTrackFilesStateEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isAddFileStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceAddFileStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(32)
+ };
+ proto.isAddFileEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceAddFileEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isUpdateFileStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceUpdateFileStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ };
+ proto.isUpdateFileEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceUpdateFileEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(35)
+ };
+ proto.isAddFolderStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceAddFolderStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(36)
+ };
+ proto.isAddFolderEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceAddFolderEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isUpdatePlaylistContentsStartEnabled = function () {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceUpdatePlaylistContentsStart = function () {
+ providerTemplates.traceTemplateEventDescriptor(38)
+ };
+ proto.isUpdatePlaylistContentsEndEnabled = function () {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceUpdatePlaylistContentsEnd = function () {
+ providerTemplates.traceTemplateEventDescriptor(39)
+ };
+ proto.isFoundTrackBySmidEnabled = function () {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceFoundTrackBySmid = function () {
+ providerTemplates.traceTemplateEventDescriptor(40)
+ };
+ proto.isFoundTrackAndAlbumEnabled = function () {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceFoundTrackAndAlbum = function (albumId, artistId, trackId) {
+ providerTemplates.traceTemplate_qqq(41, albumId, artistId, trackId)
+ };
+ proto.isPromotingTrackArtistEnabled = function () {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.tracePromotingTrackArtist = function (albumTitle) {
+ providerTemplates.traceTemplate_z(42, albumTitle)
+ };
+ proto.isAlbumAsVariousArtistsEnabled = function () {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceAlbumAsVariousArtists = function () {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isAddingAlbumEnabled = function () {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceAddingAlbum = function (albumName) {
+ providerTemplates.traceTemplate_z(44, albumName)
+ };
+ proto.isAddAlbumWithTitleArtistEnabled = function () {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceAddAlbumWithTitleArtist = function (albumTitle, artistId) {
+ providerTemplates.traceTemplate_zq(45, albumTitle, artistId)
+ };
+ proto.isUpdatingAlbumEnabled = function () {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceUpdatingAlbum = function () {
+ providerTemplates.traceTemplateEventDescriptor(46)
+ };
+ proto.isAddingPersonEnabled = function () {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceAddingPerson = function (personName) {
+ providerTemplates.traceTemplate_z(47, personName)
+ };
+ proto.isUpdatingPersonEnabled = function () {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceUpdatingPerson = function (personName) {
+ providerTemplates.traceTemplate_z(48, personName)
+ };
+ proto.isAddingPersonLinkEnabled = function () {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceAddingPersonLink = function (personId, mediaId) {
+ providerTemplates.traceTemplate_qq(49, personId, mediaId)
+ };
+ proto.isAddingTrackEntryEnabled = function () {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceAddingTrackEntry = function (albumId, trackTitle, trackNumber) {
+ providerTemplates.traceTemplate_qzq(50, albumId, trackTitle, trackNumber)
+ };
+ proto.isTrackIsAudioBookEnabled = function () {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceTrackIsAudioBook = function () {
+ providerTemplates.traceTemplateEventDescriptor(51)
+ };
+ proto.isFoundExistingTrackEnabled = function () {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceFoundExistingTrack = function (trackId) {
+ providerTemplates.traceTemplate_q(52, trackId)
+ };
+ proto.isAddingUnknownArtistEnabled = function () {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceAddingUnknownArtist = function () {
+ providerTemplates.traceTemplateEventDescriptor(53)
+ };
+ proto.isUpdateAlbumSetGenreEnabled = function () {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceUpdateAlbumSetGenre = function (genreId) {
+ providerTemplates.traceTemplate_q(54, genreId)
+ };
+ proto.isSetUnknownGenreEnabled = function () {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceSetUnknownGenre = function () {
+ providerTemplates.traceTemplateEventDescriptor(55)
+ };
+ proto.isAddingTrackEnabled = function () {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceAddingTrack = function (trackName) {
+ providerTemplates.traceTemplate_z(56, trackName)
+ };
+ proto.isUpdatingTrackEnabled = function () {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.traceUpdatingTrack = function (trackName) {
+ providerTemplates.traceTemplate_z(57, trackName)
+ };
+ proto.isSetTrackRatingFromFileEnabled = function () {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.traceSetTrackRatingFromFile = function (trackTitle, rating) {
+ providerTemplates.traceTemplate_zq(58, trackTitle, rating)
+ };
+ proto.isSplitExistingFileEnabled = function () {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.traceSplitExistingFile = function (oldTrackId, newTrackId) {
+ providerTemplates.traceTemplate_qq(59, oldTrackId, newTrackId)
+ };
+ proto.isAddingFolderEnabled = function () {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.traceAddingFolder = function (folderPath) {
+ providerTemplates.traceTemplate_z(60, folderPath)
+ };
+ proto.isAddingFileEnabled = function () {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.traceAddingFile = function (filename) {
+ providerTemplates.traceTemplate_z(61, filename)
+ };
+ proto.isUpdatingFileEnabled = function () {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceUpdatingFile = function (filename) {
+ providerTemplates.traceTemplate_z(62, filename)
+ };
+ proto.isUpdatingFileCountsEnabled = function () {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceUpdatingFileCounts = function () {
+ providerTemplates.traceTemplateEventDescriptor(63)
+ };
+ proto.isUpdateOldAlbumVisibilityEnabled = function () {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceUpdateOldAlbumVisibility = function (albumId) {
+ providerTemplates.traceTemplate_q(64, albumId)
+ };
+ proto.isUpdateAlbumVisibilityEnabled = function () {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceUpdateAlbumVisibility = function (albumId) {
+ providerTemplates.traceTemplate_q(65, albumId)
+ };
+ proto.isUpdatingTrackAcquisitionDateEnabled = function () {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.traceUpdatingTrackAcquisitionDate = function (trackId) {
+ providerTemplates.traceTemplate_q(66, trackId)
+ };
+ proto.isUpdatingAlbumAcquisitionDateEnabled = function () {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.traceUpdatingAlbumAcquisitionDate = function (albumId) {
+ providerTemplates.traceTemplate_q(67, albumId)
+ };
+ proto.isUpdatingPlaylistItemWithMediaIdEnabled = function () {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.traceUpdatingPlaylistItemWithMediaId = function (playlistContentId, mediaId) {
+ providerTemplates.traceTemplate_qq(68, playlistContentId, mediaId)
+ }
+ })(this)
+})();
+/* >>>>>>/components/perftrack/perftrack.js:4608 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Instrumentation", {
+ PerfTrack: WinJS.Class.define(null, {}, {
+ triggerLog: [], StartPoints: {
+ AppLaunch: "AppLaunch", PlayCommand: "PlayCommand", CollectionGalleryRequest: "CollectionGalleryRequest", SearchGalleryRequest: "SearchGalleryRequest", PopoverRequest: "PopoverRequest", MarketplaceGalleryRequest: "MarketplaceGalleryRequest", WebBlendRequest: "WebBlendRequest", ExplorePageRequest: "ExplorePageRequest", RadioPageRequest: "RadioPageRequest", TVDetailsRequest: "TVDetailsRequest", MovieDetailsRequest: "MovieDetailsRequest", AlbumDetailsRequest: "AlbumDetailsRequest", ArtistDetailsRequest: "ArtistDetailsRequest", PlaylistDetailsRequest: "PlaylistDetailsRequest", DevicesPageRequest: "DevicesPageRequest", NowPlayingPageRequest: "NowPlayingPageRequest", MoviesStorePageRequest: "MoviesStorePageRequest", TvStorePageRequest: "TvStorePageRequest", VideoCollectionPageRequest: "VideoCollectionPageRequest", ShopBooksPageRequest: "ShopBooksPageRequest", ShopMagsPageRequest: "ShopMagsPageRequest", CategoryGalleryRequest: "CategoryGalleryRequest", IssuesGalleryRequest: "IssuesGalleryRequest", StandardGalleryRequest: "StandardGalleryRequest", BookDetailsRequest: "BookDetailsRequest", MagDetailsRequest: "MagDetailsRequest", SearchLibraryRequest: "SearchLibraryRequest", SearchCatalogRequest: "SearchCatalogRequest", SearchAutoCompleteRequest: "SearchAutoCompleteRequest", BNDeviceRegistrationRequest: "BNDeviceRegistrationRequest", BNLoginRequest: "BNLoginRequest", AppLaunchToMoviesStore: "AppLaunchToMoviesStore", AppLaunchToTvStore: "AppLaunchToTvStore", AppLaunchToVideoCollection: "AppLaunchToVideoCollection", MoviesCollectionPageRequest: "MoviesCollectionPageRequest", PersonalCollectionPageRequest: "PersonalCollectionPageRequest", FeaturedMoviesPageRequest: "FeaturedMoviesPageRequest", NewMoviesPageRequest: "NewMoviesPageRequest", TopSellingMoviesPageRequest: "TopSellingMoviesPageRequest", FeaturedTvPageRequest: "FeaturedTvPageRequest", NewTvPageRequest: "NewTvPageRequest", LastNightsTvPageRequest: "LastNightsTvPageRequest", TopSellingTvPageRequest: "TopSellingTvPageRequest", FlexHubPageRequest: "FlexHubPageRequest", TvCollectionPageRequest: "TvCollectionPageRequest"
+ }, logTrigger: function logTrigger(scenarioName) {
+ var text = scenarioName;
+ for (var i = 1; i < arguments.length; i++)
+ text += "\t" + arguments[i];
+ MS.Entertainment.Instrumentation.PerfTrack.triggerLog.push(text)
+ }, getLogger: (function _perfTrack_getLoggerClosure() {
+ var logger = null;
+ return function _perfTrack_getLoggerWorker() {
+ if (!logger)
+ logger = new Microsoft.PerfTrack.PerfTrackLogger(Microsoft.PerfTrack.PerfTrackLogger.windowsDataUploadEnabled);
+ return logger
+ }
+ })(), _truncateString: function _perfTrack_truncateString(s) {
+ var result = s;
+ if (result && typeof (result) === "string" && result.length > 120)
+ result = result.substr(0, 120) + "[...]";
+ return result
+ }, _getState: (function _perfTrack_getStateClosure() {
+ var startedScenarios = {};
+ var fireOnceScenarios = {};
+ var disabledScenarios = {};
+ var disabledScenariosByDefault = {};
+ var startTimes = {};
+ var applicationStartTime = null;
+ disabledScenariosByDefault[1318] = true;
+ disabledScenariosByDefault[1319] = true;
+ disabledScenariosByDefault[1320] = true;
+ disabledScenariosByDefault[1321] = true;
+ disabledScenariosByDefault[1322] = true;
+ disabledScenariosByDefault[1712] = true;
+ disabledScenariosByDefault[1713] = true;
+ disabledScenariosByDefault[1711] = true;
+ disabledScenariosByDefault[1582] = true;
+ disabledScenariosByDefault[1583] = true;
+ disabledScenariosByDefault[1591] = true;
+ disabledScenariosByDefault[1592] = true;
+ disabledScenariosByDefault[1593] = true;
+ var actions = {
+ isStarted: function _perfTrack_getState_isStarted(scenarioId, matchKey) {
+ var result = true;
+ var result = startedScenarios.hasOwnProperty(scenarioId);
+ if (result && (matchKey !== undefined))
+ result = startedScenarios[scenarioId].hasOwnProperty(matchKey);
+ return result
+ }, onBegin: function _perfTrack_getState_onBegin(scenarioId, matchKey) {
+ if (!startedScenarios[scenarioId])
+ startedScenarios[scenarioId] = {};
+ if (matchKey !== undefined)
+ startedScenarios[scenarioId][matchKey] = true
+ }, onEnd: function _perfTrack_getState_onEnd(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (startedScenarios[scenarioId])
+ delete startedScenarios[scenarioId][matchKey]
+ }
+ else
+ delete startedScenarios[scenarioId]
+ }, isFiredOnce: function _perfTrack_getState_isFiredOnce(scenarioId, matchKey) {
+ var result = true;
+ var result = fireOnceScenarios.hasOwnProperty(scenarioId);
+ if (result && (matchKey !== undefined))
+ result = fireOnceScenarios[scenarioId].hasOwnProperty(matchKey);
+ return result
+ }, onFiredOnce: function _perfTrack_getState_onFiredOnce(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (!fireOnceScenarios[scenarioId])
+ fireOnceScenarios[scenarioId] = {};
+ fireOnceScenarios[scenarioId][matchKey] = true
+ }
+ else
+ fireOnceScenarios[scenarioId] = true
+ }, isDisabled: function _perfTrack_getState_isDisabled(scenarioId, matchKey) {
+ var result = null;
+ if (matchKey !== undefined) {
+ if (disabledScenarios[scenarioId])
+ result = disabledScenarios[scenarioId][matchKey]
+ }
+ else
+ result = disabledScenarios[scenarioId];
+ if (result === null || result === undefined)
+ result = (disabledScenariosByDefault[scenarioId] || false);
+ return result
+ }, disableScenario: function _perfTrack_getState_disableScenario(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (!disabledScenarios[scenarioId])
+ disabledScenarios[scenarioId] = {};
+ disabledScenarios[scenarioId][matchKey] = true
+ }
+ else
+ disabledScenarios[scenarioId] = true
+ }, enableScenario: function _perfTrack_getState_enableScenario(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (!disabledScenarios[scenarioId])
+ disabledScenarios[scenarioId] = {};
+ disabledScenarios[scenarioId][matchKey] = false
+ }
+ else
+ disabledScenarios[scenarioId] = false
+ }, cleanupDynamicEnabledDisabledFlag: function _perfTrack_getState_cleanupDynamicEnabledDisabledFlag(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (disabledScenarios[scenarioId])
+ delete disabledScenarios[scenarioId][matchKey]
+ }
+ else
+ delete disabledScenarios[scenarioId]
+ }, setStartTime: function _perfTrack_getState_setStartTime(startPoint, matchKey) {
+ if (startPoint)
+ if (matchKey !== undefined) {
+ if (!startTimes[startPoint])
+ startTimes[startPoint] = {};
+ startTimes[startPoint][matchKey] = new Date
+ }
+ else
+ startTimes[startPoint] = new Date
+ }, deleteStartTime: function _perfTrack_getState_deleteStartTime(startPoint, matchKey) {
+ if (startPoint)
+ if (matchKey !== undefined) {
+ if (startTimes[startPoint])
+ delete startTimes[startPoint][matchKey]
+ }
+ else
+ delete startTimes[startPoint]
+ }, getStartTime: function _perfTrack_getState_getStartTime(startPoint, matchKey) {
+ var result = null;
+ if (startPoint) {
+ if (matchKey !== undefined) {
+ if (startTimes[startPoint])
+ result = startTimes[startPoint][matchKey]
+ }
+ else
+ result = startTimes[startPoint];
+ if (!result)
+ if (startPoint === "AppLaunch")
+ if (applicationStartTime)
+ result = applicationStartTime;
+ else if (PerfTrack && PerfTrack.LaunchInformation && PerfTrack.LaunchInformation.getStartTime) {
+ applicationStartTime = PerfTrack.LaunchInformation.getStartTime();
+ result = applicationStartTime
+ }
+ }
+ return result
+ }, resetStartPoints: function _perfTrack_resetStartPoints() {
+ startTimes = {}
+ }
+ };
+ return function _perfTrack_getStateWorker() {
+ return actions
+ }
+ })(), setStartTime: function _perfTrack_setStartTime(startPoint, matchKey) {
+ var state = MS.Entertainment.Instrumentation.PerfTrack._getState();
+ state.setStartTime(startPoint, matchKey)
+ }, getStartTime: function _perfTrack_getStartTime(startPoint, matchKey) {
+ var state = MS.Entertainment.Instrumentation.PerfTrack._getState();
+ return state.getStartTime(startPoint, matchKey)
+ }, getShellEventProvider: (function _perfTrack_getShellEventProviderClosure() {
+ var eventProvider = null;
+ return function _perfTrack_getShellEventProviderWorker() {
+ if (!eventProvider)
+ eventProvider = new Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ return eventProvider
+ }
+ })(), enableScenarioAppLaunch: function _perfTrack_enableScenarioAppLaunch() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1317)
+ }, disableScenarioAppLaunch: function _perfTrack_disableScenarioAppLaunch() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1317)
+ }, triggerScenarioAppLaunch: function _perfTrack_triggerScenarioAppLaunch(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1317) && !state.isFiredOnce(1317)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchCompleted(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1317, "XBLW-AppLaunch", duration);
+ PT.logTrigger("XBLW-AppLaunch", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1317);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToCollection: function _perfTrack_enableScenarioAppLaunchToCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1318)
+ }, disableScenarioAppLaunchToCollection: function _perfTrack_disableScenarioAppLaunchToCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1318)
+ }, triggerScenarioAppLaunchToCollection: function _perfTrack_triggerScenarioAppLaunchToCollection(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1318) && !state.isFiredOnce(1318)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToCollectionCompleted(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1318, "XBLW-AppLaunchToCollection", duration);
+ PT.logTrigger("XBLW-AppLaunchToCollection", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1318);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchPlayNonProtectedContent: function _perfTrack_enableScenarioAppLaunchPlayNonProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1319)
+ }, disableScenarioAppLaunchPlayNonProtectedContent: function _perfTrack_disableScenarioAppLaunchPlayNonProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1319)
+ }, triggerScenarioAppLaunchPlayNonProtectedContent: function _perfTrack_triggerScenarioAppLaunchPlayNonProtectedContent(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1319) && !state.isFiredOnce(1319)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchPlayNonProtectedContent(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1319, "XBLW-AppLaunchPlayNonProtectedContent", duration);
+ PT.logTrigger("XBLW-AppLaunchPlayNonProtectedContent", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1319);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchPlayProtectedContent: function _perfTrack_enableScenarioAppLaunchPlayProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1320)
+ }, disableScenarioAppLaunchPlayProtectedContent: function _perfTrack_disableScenarioAppLaunchPlayProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1320)
+ }, triggerScenarioAppLaunchPlayProtectedContent: function _perfTrack_triggerScenarioAppLaunchPlayProtectedContent(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1320) && !state.isFiredOnce(1320)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchPlayProtectedContent(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1320, "XBLW-AppLaunchPlayProtectedContent", duration);
+ PT.logTrigger("XBLW-AppLaunchPlayProtectedContent", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1320);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioPlayProtectedInApp: function _perfTrack_enableScenarioPlayProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1321)
+ }, disableScenarioPlayProtectedInApp: function _perfTrack_disableScenarioPlayProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1321)
+ }, triggerScenarioPlayProtectedInApp: function _perfTrack_triggerScenarioPlayProtectedInApp(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1321)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PlayCommand");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PlayProtectedInAppPlaybackStarted(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1321, "XBLW-PlayProtectedInApp", duration);
+ PT.logTrigger("XBLW-PlayProtectedInApp", DurationMsec)
+ }
+ state.deleteStartTime("PlayCommand")
+ }
+ }
+ }, enableScenarioPlayNonProtectedInApp: function _perfTrack_enableScenarioPlayNonProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1322)
+ }, disableScenarioPlayNonProtectedInApp: function _perfTrack_disableScenarioPlayNonProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1322)
+ }, triggerScenarioPlayNonProtectedInApp: function _perfTrack_triggerScenarioPlayNonProtectedInApp(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1322)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PlayCommand");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PlayNonProtectedInAppPlaybackStarted(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1322, "XBLW-PlayNonProtectedInApp", duration);
+ PT.logTrigger("XBLW-PlayNonProtectedInApp", DurationMsec)
+ }
+ state.deleteStartTime("PlayCommand")
+ }
+ }
+ }, enableScenarioCollectionGalleryRequestToLoad: function _perfTrack_enableScenarioCollectionGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1325)
+ }, disableScenarioCollectionGalleryRequestToLoad: function _perfTrack_disableScenarioCollectionGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1325)
+ }, triggerScenarioCollectionGalleryRequestToLoad: function _perfTrack_triggerScenarioCollectionGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1325)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("CollectionGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_CollectionGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1325, "XBLW-CollectionGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-CollectionGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("CollectionGalleryRequest")
+ }
+ }
+ }, enableScenarioSearchGalleryRequestToLoad: function _perfTrack_enableScenarioSearchGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1326)
+ }, disableScenarioSearchGalleryRequestToLoad: function _perfTrack_disableScenarioSearchGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1326)
+ }, triggerScenarioSearchGalleryRequestToLoad: function _perfTrack_triggerScenarioSearchGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1326)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1326, "XBLW-SearchGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-SearchGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("SearchGalleryRequest")
+ }
+ }
+ }, enableScenarioPopoverRequestToLoad: function _perfTrack_enableScenarioPopoverRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1327)
+ }, disableScenarioPopoverRequestToLoad: function _perfTrack_disableScenarioPopoverRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1327)
+ }, triggerScenarioPopoverRequestToLoad: function _perfTrack_triggerScenarioPopoverRequestToLoad(name, DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1327)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PopoverRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PopoverRequestToLoad(name, DurationMsec);
+ PT.getLogger().writeTriggerEventWithMetadata(1327, "XBLW-PopoverRequestToLoad", duration, 0, 0, 0, 0, 0, PT._truncateString(name), "");
+ PT.logTrigger("XBLW-PopoverRequestToLoad", name, DurationMsec)
+ }
+ state.deleteStartTime("PopoverRequest")
+ }
+ }
+ }, enableScenarioMarketplaceGalleryRequestToLoad: function _perfTrack_enableScenarioMarketplaceGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1333)
+ }, disableScenarioMarketplaceGalleryRequestToLoad: function _perfTrack_disableScenarioMarketplaceGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1333)
+ }, triggerScenarioMarketplaceGalleryRequestToLoad: function _perfTrack_triggerScenarioMarketplaceGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1333)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MarketplaceGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MarketplaceGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1333, "XBLW-MarketplaceGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-MarketplaceGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MarketplaceGalleryRequest")
+ }
+ }
+ }, enableScenarioWebBlendRequestToLoad: function _perfTrack_enableScenarioWebBlendRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1339)
+ }, disableScenarioWebBlendRequestToLoad: function _perfTrack_disableScenarioWebBlendRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1339)
+ }, triggerScenarioWebBlendRequestToLoad: function _perfTrack_triggerScenarioWebBlendRequestToLoad(url, DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1339)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("WebBlendRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_WebBlendRequestToLoad(url, DurationMsec);
+ PT.getLogger().writeTriggerEventWithMetadata(1339, "XBLW-WebBlendRequestToLoad", duration, 0, 0, 0, 0, 0, PT._truncateString(url), "");
+ PT.logTrigger("XBLW-WebBlendRequestToLoad", url, DurationMsec)
+ }
+ state.deleteStartTime("WebBlendRequest")
+ }
+ }
+ }, enableScenarioExplorePageRequestToLoad: function _perfTrack_enableScenarioExplorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1580)
+ }, disableScenarioExplorePageRequestToLoad: function _perfTrack_disableScenarioExplorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1580)
+ }, triggerScenarioExplorePageRequestToLoad: function _perfTrack_triggerScenarioExplorePageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1580)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ExplorePageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ExplorePageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1580, "XBLW-ExplorePageRequestToLoad", duration);
+ PT.logTrigger("XBLW-ExplorePageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ExplorePageRequest")
+ }
+ }
+ }, enableScenarioRadioPageRequestToLoad: function _perfTrack_enableScenarioRadioPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1581)
+ }, disableScenarioRadioPageRequestToLoad: function _perfTrack_disableScenarioRadioPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1581)
+ }, triggerScenarioRadioPageRequestToLoad: function _perfTrack_triggerScenarioRadioPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1581)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("RadioPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_RadioPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1581, "XBLW-RadioPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-RadioPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("RadioPageRequest")
+ }
+ }
+ }, enableScenarioDevicesPageRequestToLoad: function _perfTrack_enableScenarioDevicesPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1674)
+ }, disableScenarioDevicesPageRequestToLoad: function _perfTrack_disableScenarioDevicesPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1674)
+ }, triggerScenarioDevicesPageRequestToLoad: function _perfTrack_triggerScenarioDevicesPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1674)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("DevicesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_DevicesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1674, "XBLW-DevicesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-DevicesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("DevicesPageRequest")
+ }
+ }
+ }, enableScenarioNowPlayingPageRequestToLoad: function _perfTrack_enableScenarioNowPlayingPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1683)
+ }, disableScenarioNowPlayingPageRequestToLoad: function _perfTrack_disableScenarioNowPlayingPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1683)
+ }, triggerScenarioNowPlayingPageRequestToLoad: function _perfTrack_triggerScenarioNowPlayingPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1683)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("NowPlayingPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_NowPlayingPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1683, "XBLW-NowPlayingPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-NowPlayingPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("NowPlayingPageRequest")
+ }
+ }
+ }, enableScenarioMoviesStorePageRequestToLoad: function _perfTrack_enableScenarioMoviesStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1701)
+ }, disableScenarioMoviesStorePageRequestToLoad: function _perfTrack_disableScenarioMoviesStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1701)
+ }, triggerScenarioMoviesStorePageRequestToLoad: function _perfTrack_triggerScenarioMoviesStorePageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1701)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MoviesStorePageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MoviesStorePageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1701, "XBLW-MoviesStorePageRequestToLoad", duration);
+ PT.logTrigger("XBLW-MoviesStorePageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MoviesStorePageRequest")
+ }
+ }
+ }, enableScenarioTvStorePageRequestToLoad: function _perfTrack_enableScenarioTvStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1702)
+ }, disableScenarioTvStorePageRequestToLoad: function _perfTrack_disableScenarioTvStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1702)
+ }, triggerScenarioTvStorePageRequestToLoad: function _perfTrack_triggerScenarioTvStorePageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1702)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TvStorePageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TvStorePageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1702, "XBLW-TvStorePageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TvStorePageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TvStorePageRequest")
+ }
+ }
+ }, enableScenarioVideoCollectionPageRequestToLoad: function _perfTrack_enableScenarioVideoCollectionPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1703)
+ }, disableScenarioVideoCollectionPageRequestToLoad: function _perfTrack_disableScenarioVideoCollectionPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1703)
+ }, triggerScenarioVideoCollectionPageRequestToLoad: function _perfTrack_triggerScenarioVideoCollectionPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1703)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("VideoCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_VideoCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1703, "XBLW-VideoCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-VideoCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("VideoCollectionPageRequest")
+ }
+ }
+ }, enableScenarioAppLaunchToMoviesStore: function _perfTrack_enableScenarioAppLaunchToMoviesStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1712)
+ }, disableScenarioAppLaunchToMoviesStore: function _perfTrack_disableScenarioAppLaunchToMoviesStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1712)
+ }, triggerScenarioAppLaunchToMoviesStore: function _perfTrack_triggerScenarioAppLaunchToMoviesStore(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1712) && !state.isFiredOnce(1712)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToMoviesStore(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1712, "XBLW-AppLaunchToMoviesStore", duration);
+ PT.logTrigger("XBLW-AppLaunchToMoviesStore", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1712);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToTvStore: function _perfTrack_enableScenarioAppLaunchToTvStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1713)
+ }, disableScenarioAppLaunchToTvStore: function _perfTrack_disableScenarioAppLaunchToTvStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1713)
+ }, triggerScenarioAppLaunchToTvStore: function _perfTrack_triggerScenarioAppLaunchToTvStore(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1713) && !state.isFiredOnce(1713)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToTvStore(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1713, "XBLW-AppLaunchToTvStore", duration);
+ PT.logTrigger("XBLW-AppLaunchToTvStore", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1713);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToVideoCollection: function _perfTrack_enableScenarioAppLaunchToVideoCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1711)
+ }, disableScenarioAppLaunchToVideoCollection: function _perfTrack_disableScenarioAppLaunchToVideoCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1711)
+ }, triggerScenarioAppLaunchToVideoCollection: function _perfTrack_triggerScenarioAppLaunchToVideoCollection(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1711) && !state.isFiredOnce(1711)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToVideoCollection(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1711, "XBLW-AppLaunchToVideoCollection", duration);
+ PT.logTrigger("XBLW-AppLaunchToVideoCollection", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1711);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioMoviesCollectionPageRequest: function _perfTrack_enableScenarioMoviesCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1721)
+ }, disableScenarioMoviesCollectionPageRequest: function _perfTrack_disableScenarioMoviesCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1721)
+ }, triggerScenarioMoviesCollectionPageRequest: function _perfTrack_triggerScenarioMoviesCollectionPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1721)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MoviesCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MoviesCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1721, "XBLW-MoviesCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-MoviesCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MoviesCollectionPageRequest")
+ }
+ }
+ }, enableScenarioTvCollectionPageRequest: function _perfTrack_enableScenarioTvCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1722)
+ }, disableScenarioTvCollectionPageRequest: function _perfTrack_disableScenarioTvCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1722)
+ }, triggerScenarioTvCollectionPageRequest: function _perfTrack_triggerScenarioTvCollectionPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1722)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TvCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TvCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1722, "XBLW-TvCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TvCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TvCollectionPageRequest")
+ }
+ }
+ }, enableScenarioPersonalCollectionPageRequest: function _perfTrack_enableScenarioPersonalCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1723)
+ }, disableScenarioPersonalCollectionPageRequest: function _perfTrack_disableScenarioPersonalCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1723)
+ }, triggerScenarioPersonalCollectionPageRequest: function _perfTrack_triggerScenarioPersonalCollectionPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1723)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PersonalCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PersonalCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1723, "XBLW-PersonalCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-PersonalCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("PersonalCollectionPageRequest")
+ }
+ }
+ }, enableScenarioFeaturedMoviesPageRequest: function _perfTrack_enableScenarioFeaturedMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1715)
+ }, disableScenarioFeaturedMoviesPageRequest: function _perfTrack_disableScenarioFeaturedMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1715)
+ }, triggerScenarioFeaturedMoviesPageRequest: function _perfTrack_triggerScenarioFeaturedMoviesPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1715)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("FeaturedMoviesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_FeaturedMoviesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1715, "XBLW-FeaturedMoviesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-FeaturedMoviesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("FeaturedMoviesPageRequest")
+ }
+ }
+ }, enableScenarioNewMoviesPageRequest: function _perfTrack_enableScenarioNewMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1714)
+ }, disableScenarioNewMoviesPageRequest: function _perfTrack_disableScenarioNewMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1714)
+ }, triggerScenarioNewMoviesPageRequest: function _perfTrack_triggerScenarioNewMoviesPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1714)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("NewMoviesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_NewMoviesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1714, "XBLW-NewMoviesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-NewMoviesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("NewMoviesPageRequest")
+ }
+ }
+ }, enableScenarioTopSellingMoviesPageRequest: function _perfTrack_enableScenarioTopSellingMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1716)
+ }, disableScenarioTopSellingMoviesPageRequest: function _perfTrack_disableScenarioTopSellingMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1716)
+ }, triggerScenarioTopSellingMoviesPageRequest: function _perfTrack_triggerScenarioTopSellingMoviesPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1716)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TopSellingMoviesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TopSellingMoviesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1716, "XBLW-TopSellingMoviesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TopSellingMoviesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TopSellingMoviesPageRequest")
+ }
+ }
+ }, enableScenarioFeaturedTvPageRequest: function _perfTrack_enableScenarioFeaturedTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1718)
+ }, disableScenarioFeaturedTvPageRequest: function _perfTrack_disableScenarioFeaturedTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1718)
+ }, triggerScenarioFeaturedTvPageRequest: function _perfTrack_triggerScenarioFeaturedTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1718)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("FeaturedTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_FeaturedTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1718, "XBLW-FeaturedTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-FeaturedTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("FeaturedTvPageRequest")
+ }
+ }
+ }, enableScenarioNewTvPageRequest: function _perfTrack_enableScenarioNewTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1717)
+ }, disableScenarioNewTvPageRequest: function _perfTrack_disableScenarioNewTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1717)
+ }, triggerScenarioNewTvPageRequest: function _perfTrack_triggerScenarioNewTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1717)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("NewTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_NewTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1717, "XBLW-NewTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-NewTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("NewTvPageRequest")
+ }
+ }
+ }, enableScenarioLastNightsTvPageRequest: function _perfTrack_enableScenarioLastNightsTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1719)
+ }, disableScenarioLastNightsTvPageRequest: function _perfTrack_disableScenarioLastNightsTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1719)
+ }, triggerScenarioLastNightsTvPageRequest: function _perfTrack_triggerScenarioLastNightsTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1719)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("LastNightsTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_LastNightsTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1719, "XBLW-LastNightsTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-LastNightsTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("LastNightsTvPageRequest")
+ }
+ }
+ }, enableScenarioTopSellingTvPageRequest: function _perfTrack_enableScenarioTopSellingTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1720)
+ }, disableScenarioTopSellingTvPageRequest: function _perfTrack_disableScenarioTopSellingTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1720)
+ }, triggerScenarioTopSellingTvPageRequest: function _perfTrack_triggerScenarioTopSellingTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1720)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TopSellingTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TopSellingTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1720, "XBLW-TopSellingTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TopSellingTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TopSellingTvPageRequest")
+ }
+ }
+ }, enableScenarioFlexHubPageRequest: function _perfTrack_enableScenarioFlexHubPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1724)
+ }, disableScenarioFlexHubPageRequest: function _perfTrack_disableScenarioFlexHubPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1724)
+ }, triggerScenarioFlexHubPageRequest: function _perfTrack_triggerScenarioFlexHubPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1724)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("FlexHubPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_FlexHubPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1724, "XBLW-FlexHubPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-FlexHubPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("FlexHubPageRequest")
+ }
+ }
+ }, enableScenarioAppLaunchToExplore: function _perfTrack_enableScenarioAppLaunchToExplore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1582)
+ }, disableScenarioAppLaunchToExplore: function _perfTrack_disableScenarioAppLaunchToExplore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1582)
+ }, triggerScenarioAppLaunchToExplore: function _perfTrack_triggerScenarioAppLaunchToExplore(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1582) && !state.isFiredOnce(1582)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToExploreComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1582, "XBLW-AppLaunchToExplore", duration);
+ PT.logTrigger("XBLW-AppLaunchToExplore", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1582);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToRadio: function _perfTrack_enableScenarioAppLaunchToRadio() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1583)
+ }, disableScenarioAppLaunchToRadio: function _perfTrack_disableScenarioAppLaunchToRadio() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1583)
+ }, triggerScenarioAppLaunchToRadio: function _perfTrack_triggerScenarioAppLaunchToRadio(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1583) && !state.isFiredOnce(1583)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToRadioComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1583, "XBLW-AppLaunchToRadio", duration);
+ PT.logTrigger("XBLW-AppLaunchToRadio", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1583);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioTVDetailsRequest: function _perfTrack_enableScenarioTVDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1584)
+ }, disableScenarioTVDetailsRequest: function _perfTrack_disableScenarioTVDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1584)
+ }, triggerScenarioTVDetailsRequest: function _perfTrack_triggerScenarioTVDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1584)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TVDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TVDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1584, "XBLW-TVDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-TVDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TVDetailsRequest")
+ }
+ }
+ }, enableScenarioMovieDetailsRequest: function _perfTrack_enableScenarioMovieDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1585)
+ }, disableScenarioMovieDetailsRequest: function _perfTrack_disableScenarioMovieDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1585)
+ }, triggerScenarioMovieDetailsRequest: function _perfTrack_triggerScenarioMovieDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1585)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MovieDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MovieDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1585, "XBLW-MovieDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-MovieDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MovieDetailsRequest")
+ }
+ }
+ }, enableScenarioAlbumDetailsRequest: function _perfTrack_enableScenarioAlbumDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1586)
+ }, disableScenarioAlbumDetailsRequest: function _perfTrack_disableScenarioAlbumDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1586)
+ }, triggerScenarioAlbumDetailsRequest: function _perfTrack_triggerScenarioAlbumDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1586)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AlbumDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AlbumDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1586, "XBLW-AlbumDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-AlbumDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("AlbumDetailsRequest")
+ }
+ }
+ }, enableScenarioArtistDetailsRequest: function _perfTrack_enableScenarioArtistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1587)
+ }, disableScenarioArtistDetailsRequest: function _perfTrack_disableScenarioArtistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1587)
+ }, triggerScenarioArtistDetailsRequest: function _perfTrack_triggerScenarioArtistDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1587)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ArtistDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ArtistDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1587, "XBLW-ArtistDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-ArtistDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ArtistDetailsRequest")
+ }
+ }
+ }, enableScenarioPlaylistDetailsRequest: function _perfTrack_enableScenarioPlaylistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1588)
+ }, disableScenarioPlaylistDetailsRequest: function _perfTrack_disableScenarioPlaylistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1588)
+ }, triggerScenarioPlaylistDetailsRequest: function _perfTrack_triggerScenarioPlaylistDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1588)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PlaylistDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PlaylistDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1588, "XBLW-PlaylistDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-PlaylistDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("PlaylistDetailsRequest")
+ }
+ }
+ }, enableScenarioShopBooksPageRequestToLoad: function _perfTrack_enableScenarioShopBooksPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1589)
+ }, disableScenarioShopBooksPageRequestToLoad: function _perfTrack_disableScenarioShopBooksPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1589)
+ }, triggerScenarioShopBooksPageRequestToLoad: function _perfTrack_triggerScenarioShopBooksPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1589)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ShopBooksPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ShopBooksPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1589, "XBLW-ShopBooksPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-ShopBooksPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ShopBooksPageRequest")
+ }
+ }
+ }, enableScenarioShopMagsPageRequestToLoad: function _perfTrack_enableScenarioShopMagsPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1590)
+ }, disableScenarioShopMagsPageRequestToLoad: function _perfTrack_disableScenarioShopMagsPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1590)
+ }, triggerScenarioShopMagsPageRequestToLoad: function _perfTrack_triggerScenarioShopMagsPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1590)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ShopMagsPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ShopMagsPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1590, "XBLW-ShopMagsPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-ShopMagsPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ShopMagsPageRequest")
+ }
+ }
+ }, enableScenarioAppLaunchToShopBooks: function _perfTrack_enableScenarioAppLaunchToShopBooks() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1591)
+ }, disableScenarioAppLaunchToShopBooks: function _perfTrack_disableScenarioAppLaunchToShopBooks() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1591)
+ }, triggerScenarioAppLaunchToShopBooks: function _perfTrack_triggerScenarioAppLaunchToShopBooks(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1591) && !state.isFiredOnce(1591)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToShopBooksComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1591, "XBLW-AppLaunchToShopBooks", duration);
+ PT.logTrigger("XBLW-AppLaunchToShopBooks", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1591);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToShopMags: function _perfTrack_enableScenarioAppLaunchToShopMags() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1592)
+ }, disableScenarioAppLaunchToShopMags: function _perfTrack_disableScenarioAppLaunchToShopMags() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1592)
+ }, triggerScenarioAppLaunchToShopMags: function _perfTrack_triggerScenarioAppLaunchToShopMags(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1592) && !state.isFiredOnce(1592)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToShopMagsComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1592, "XBLW-AppLaunchToShopMags", duration);
+ PT.logTrigger("XBLW-AppLaunchToShopMags", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1592);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToOOBEComplete: function _perfTrack_enableScenarioAppLaunchToOOBEComplete() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1593)
+ }, disableScenarioAppLaunchToOOBEComplete: function _perfTrack_disableScenarioAppLaunchToOOBEComplete() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1593)
+ }, triggerScenarioAppLaunchToOOBEComplete: function _perfTrack_triggerScenarioAppLaunchToOOBEComplete(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1593) && !state.isFiredOnce(1593)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToOOBEComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1593, "XBLW-AppLaunchToOOBEComplete", duration);
+ PT.logTrigger("XBLW-AppLaunchToOOBEComplete", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1593);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioCategoryGalleryRequestToLoad: function _perfTrack_enableScenarioCategoryGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1594)
+ }, disableScenarioCategoryGalleryRequestToLoad: function _perfTrack_disableScenarioCategoryGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1594)
+ }, triggerScenarioCategoryGalleryRequestToLoad: function _perfTrack_triggerScenarioCategoryGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1594)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("CategoryGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_CategoryGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1594, "XBLW-CategoryGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-CategoryGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("CategoryGalleryRequest")
+ }
+ }
+ }, enableScenarioIssuesGalleryRequestToLoad: function _perfTrack_enableScenarioIssuesGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1595)
+ }, disableScenarioIssuesGalleryRequestToLoad: function _perfTrack_disableScenarioIssuesGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1595)
+ }, triggerScenarioIssuesGalleryRequestToLoad: function _perfTrack_triggerScenarioIssuesGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1595)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("IssuesGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_IssuesGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1595, "XBLW-IssuesGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-IssuesGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("IssuesGalleryRequest")
+ }
+ }
+ }, enableScenarioStandardGalleryRequestToLoad: function _perfTrack_enableScenarioStandardGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1596)
+ }, disableScenarioStandardGalleryRequestToLoad: function _perfTrack_disableScenarioStandardGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1596)
+ }, triggerScenarioStandardGalleryRequestToLoad: function _perfTrack_triggerScenarioStandardGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1596)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("StandardGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_StandardGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1596, "XBLW-StandardGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-StandardGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("StandardGalleryRequest")
+ }
+ }
+ }, enableScenarioBookDetailsRequestToLoad: function _perfTrack_enableScenarioBookDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1597)
+ }, disableScenarioBookDetailsRequestToLoad: function _perfTrack_disableScenarioBookDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1597)
+ }, triggerScenarioBookDetailsRequestToLoad: function _perfTrack_triggerScenarioBookDetailsRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1597)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("BookDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_BookDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1597, "XBLW-BookDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-BookDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("BookDetailsRequest")
+ }
+ }
+ }, enableScenarioMagDetailsRequestToLoad: function _perfTrack_enableScenarioMagDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1598)
+ }, disableScenarioMagDetailsRequestToLoad: function _perfTrack_disableScenarioMagDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1598)
+ }, triggerScenarioMagDetailsRequestToLoad: function _perfTrack_triggerScenarioMagDetailsRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1598)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MagDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MagDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1598, "XBLW-MagDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-MagDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MagDetailsRequest")
+ }
+ }
+ }, enableScenarioSearchLibraryRequestToQueryResults: function _perfTrack_enableScenarioSearchLibraryRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1599)
+ }, disableScenarioSearchLibraryRequestToQueryResults: function _perfTrack_disableScenarioSearchLibraryRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1599)
+ }, triggerScenarioSearchLibraryRequestToQueryResults: function _perfTrack_triggerScenarioSearchLibraryRequestToQueryResults(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1599)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchLibraryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchLibraryRequestToQueryResults(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1599, "XBLW-SearchLibraryRequestToQueryResults", duration);
+ PT.logTrigger("XBLW-SearchLibraryRequestToQueryResults", DurationMsec)
+ }
+ state.deleteStartTime("SearchLibraryRequest")
+ }
+ }
+ }, enableScenarioSearchCatalogRequestToQueryResults: function _perfTrack_enableScenarioSearchCatalogRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1600)
+ }, disableScenarioSearchCatalogRequestToQueryResults: function _perfTrack_disableScenarioSearchCatalogRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1600)
+ }, triggerScenarioSearchCatalogRequestToQueryResults: function _perfTrack_triggerScenarioSearchCatalogRequestToQueryResults(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1600)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchCatalogRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchCatalogRequestToQueryResults(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1600, "XBLW-SearchCatalogRequestToQueryResults", duration);
+ PT.logTrigger("XBLW-SearchCatalogRequestToQueryResults", DurationMsec)
+ }
+ state.deleteStartTime("SearchCatalogRequest")
+ }
+ }
+ }, enableScenarioSearchAutoCompleteResultsReceived: function _perfTrack_enableScenarioSearchAutoCompleteResultsReceived() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1601)
+ }, disableScenarioSearchAutoCompleteResultsReceived: function _perfTrack_disableScenarioSearchAutoCompleteResultsReceived() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1601)
+ }, triggerScenarioSearchAutoCompleteResultsReceived: function _perfTrack_triggerScenarioSearchAutoCompleteResultsReceived(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1601)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchAutoCompleteRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchAutoCompleteResultsReceived(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1601, "XBLW-SearchAutoCompleteResultsReceived", duration);
+ PT.logTrigger("XBLW-SearchAutoCompleteResultsReceived", DurationMsec)
+ }
+ state.deleteStartTime("SearchAutoCompleteRequest")
+ }
+ }
+ }, enableScenarioBNDeviceRegistrationRequestSucceeded: function _perfTrack_enableScenarioBNDeviceRegistrationRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1602)
+ }, disableScenarioBNDeviceRegistrationRequestSucceeded: function _perfTrack_disableScenarioBNDeviceRegistrationRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1602)
+ }, triggerScenarioBNDeviceRegistrationRequestSucceeded: function _perfTrack_triggerScenarioBNDeviceRegistrationRequestSucceeded(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1602)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("BNDeviceRegistrationRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_BNDeviceRegistrationRequestSucceeded(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1602, "XBLW-BNDeviceRegistrationRequestSucceeded", duration);
+ PT.logTrigger("XBLW-BNDeviceRegistrationRequestSucceeded", DurationMsec)
+ }
+ state.deleteStartTime("BNDeviceRegistrationRequest")
+ }
+ }
+ }, enableScenarioBNLoginRequestSucceeded: function _perfTrack_enableScenarioBNLoginRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1603)
+ }, disableScenarioBNLoginRequestSucceeded: function _perfTrack_disableScenarioBNLoginRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1603)
+ }, triggerScenarioBNLoginRequestSucceeded: function _perfTrack_triggerScenarioBNLoginRequestSucceeded(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1603)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("BNLoginRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_BNLoginRequestSucceeded(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1603, "XBLW-BNLoginRequestSucceeded", duration);
+ PT.logTrigger("XBLW-BNLoginRequestSucceeded", DurationMsec)
+ }
+ state.deleteStartTime("BNLoginRequest")
+ }
+ }
+ }, disableAllStartupScenarios: function _perfTrack_disableAllStartupScenarios() {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ PT.disableScenarioAppLaunch();
+ PT.disableScenarioAppLaunchToCollection();
+ PT.disableScenarioAppLaunchPlayNonProtectedContent();
+ PT.disableScenarioAppLaunchPlayProtectedContent();
+ PT.disableScenarioAppLaunchToMoviesStore();
+ PT.disableScenarioAppLaunchToTvStore();
+ PT.disableScenarioAppLaunchToVideoCollection();
+ PT.disableScenarioAppLaunchToExplore();
+ PT.disableScenarioAppLaunchToRadio();
+ PT.disableScenarioAppLaunchToShopBooks();
+ PT.disableScenarioAppLaunchToShopMags();
+ PT.disableScenarioAppLaunchToOOBEComplete()
+ }, onSuspending: function _perfTrack_onSuspending() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().resetStartPoints();
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios()
+ }, onResuming: function _perfTrack_onResuming() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().resetStartPoints()
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/commonstringids.js:5958 */
+(function () {
+ /////////////////////////////////////////////////////////////////////////////
+ //
+ // commonStringIds.js
+ //
+ // This file was generated by the Stringer tool. Do not edit it!
+ //
+ // Copyright (C) Microsoft Corporation. All rights reserved.
+ //
+ /////////////////////////////////////////////////////////////////////////////
+
+ (function () {
+
+ String.id = String.id || {}
+
+ String.id.IDS_ACC_BACK_BUTTON = "IDS_ACC_BACK_BUTTON";
+ String.id.IDS_ACC_HOME_BUTTON = "IDS_ACC_HOME_BUTTON";
+ String.id.IDS_ACC_REFRESH_BUTTON = "IDS_ACC_REFRESH_BUTTON";
+ String.id.IDS_ACTIVATION_LIMIT_EXCEEDED_DTO = "IDS_ACTIVATION_LIMIT_EXCEEDED_DTO";
+ String.id.IDS_ADVERTISEMENT = "IDS_ADVERTISEMENT";
+ String.id.IDS_APP1_MODULE_VIEW_ALL = "IDS_APP1_MODULE_VIEW_ALL";
+ String.id.IDS_APP1_MODULE_VIEW_ALL_LABEL = "IDS_APP1_MODULE_VIEW_ALL_LABEL";
+ String.id.IDS_APP2_FILTER_SORTED_BY = "IDS_APP2_FILTER_SORTED_BY";
+ String.id.IDS_APP2_PAGE_TITLE_PRIMARY = "IDS_APP2_PAGE_TITLE_PRIMARY";
+ String.id.IDS_APP2_PAGE_TITLE_PRIMARY_SECONDARY = "IDS_APP2_PAGE_TITLE_PRIMARY_SECONDARY";
+ String.id.IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT = "IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT";
+ String.id.IDS_APP2_PARENTAL_NO_CONTENT_TITLE = "IDS_APP2_PARENTAL_NO_CONTENT_TITLE";
+ String.id.IDS_BETA_TOS_ACCEPT_MESSAGE = "IDS_BETA_TOS_ACCEPT_MESSAGE";
+ String.id.IDS_BETA_TOS_BUTTON_ACCEPT = "IDS_BETA_TOS_BUTTON_ACCEPT";
+ String.id.IDS_BETA_TOS_BUTTON_DECLINE = "IDS_BETA_TOS_BUTTON_DECLINE";
+ String.id.IDS_BETA_TOS_TITLE = "IDS_BETA_TOS_TITLE";
+ String.id.IDS_BROWSE_ACTION_TITLE = "IDS_BROWSE_ACTION_TITLE";
+ String.id.IDS_BUY_BUTTON = "IDS_BUY_BUTTON";
+ String.id.IDS_BUY_BUTTON_VIDEO = "IDS_BUY_BUTTON_VIDEO";
+ String.id.IDS_CANCEL_BUTTON = "IDS_CANCEL_BUTTON";
+ String.id.IDS_CANCEL_BUTTON_TC = "IDS_CANCEL_BUTTON_TC";
+ String.id.IDS_CHILD_AGE_GATING_MESSAGE = "IDS_CHILD_AGE_GATING_MESSAGE";
+ String.id.IDS_CHILD_AGE_GATING_TITLE = "IDS_CHILD_AGE_GATING_TITLE";
+ String.id.IDS_CLEAR_DOWNLOAD_ERROR_BUTTON = "IDS_CLEAR_DOWNLOAD_ERROR_BUTTON";
+ String.id.IDS_CLEAR_SELECTION = "IDS_CLEAR_SELECTION";
+ String.id.IDS_CLOSE_BUTTON = "IDS_CLOSE_BUTTON";
+ String.id.IDS_CLOSE_BUTTON_LC = "IDS_CLOSE_BUTTON_LC";
+ String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE = "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER = "IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER";
+ String.id.IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE = "IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER = "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER";
+ String.id.IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT = "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL = "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE = "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE = "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER = "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER";
+ String.id.IDS_COLLECTION_ALL_VIDEO_EMPTY = "IDS_COLLECTION_ALL_VIDEO_EMPTY";
+ String.id.IDS_COLLECTION_CLOUD_MATCHED_ARIA = "IDS_COLLECTION_CLOUD_MATCHED_ARIA";
+ String.id.IDS_COLLECTION_CLOUD_SYNC_PENDING = "IDS_COLLECTION_CLOUD_SYNC_PENDING";
+ String.id.IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA = "IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA";
+ String.id.IDS_COLLECTION_HEADER_ZOOM_IN = "IDS_COLLECTION_HEADER_ZOOM_IN";
+ String.id.IDS_COLLECTION_HEADER_ZOOM_OUT = "IDS_COLLECTION_HEADER_ZOOM_OUT";
+ String.id.IDS_COLLECTION_IN_CLOUD = "IDS_COLLECTION_IN_CLOUD";
+ String.id.IDS_COLLECTION_IN_CLOUD_FREE = "IDS_COLLECTION_IN_CLOUD_FREE";
+ String.id.IDS_COLLECTION_IN_CLOUD_MATCHED = "IDS_COLLECTION_IN_CLOUD_MATCHED";
+ String.id.IDS_COLLECTION_MOVIE_EMPTY = "IDS_COLLECTION_MOVIE_EMPTY";
+ String.id.IDS_COLLECTION_MOVIE_EMPTY_LINK = "IDS_COLLECTION_MOVIE_EMPTY_LINK";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY = "IDS_COLLECTION_MUSIC_EMPTY";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_2 = "IDS_COLLECTION_MUSIC_EMPTY_2";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK = "IDS_COLLECTION_MUSIC_EMPTY_LINK";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM = "IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM = "IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE = "IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_TITLE = "IDS_COLLECTION_MUSIC_EMPTY_TITLE";
+ String.id.IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT = "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT";
+ String.id.IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE = "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE";
+ String.id.IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE = "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE";
+ String.id.IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE = "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE";
+ String.id.IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK = "IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK";
+ String.id.IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK = "IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK";
+ String.id.IDS_COLLECTION_MUSIC_SETTINGS_TITLE = "IDS_COLLECTION_MUSIC_SETTINGS_TITLE";
+ String.id.IDS_COLLECTION_NOT_IN_CLOUD = "IDS_COLLECTION_NOT_IN_CLOUD";
+ String.id.IDS_COLLECTION_OPEN_FILES_LINK = "IDS_COLLECTION_OPEN_FILES_LINK";
+ String.id.IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE = "IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE";
+ String.id.IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE = "IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE";
+ String.id.IDS_COLLECTION_PIVOT = "IDS_COLLECTION_PIVOT";
+ String.id.IDS_COLLECTION_PIVOT_TC = "IDS_COLLECTION_PIVOT_TC";
+ String.id.IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD = "IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD";
+ String.id.IDS_COLLECTION_PURCHASES_RESTORE = "IDS_COLLECTION_PURCHASES_RESTORE";
+ String.id.IDS_COLLECTION_PURCHASES_RESTORE_TEXT = "IDS_COLLECTION_PURCHASES_RESTORE_TEXT";
+ String.id.IDS_COLLECTION_SONG_NOT_AVAILABLE = "IDS_COLLECTION_SONG_NOT_AVAILABLE";
+ String.id.IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE = "IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE";
+ String.id.IDS_COLLECTION_STREAMING_FROM_CLOUD = "IDS_COLLECTION_STREAMING_FROM_CLOUD";
+ String.id.IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE = "IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE";
+ String.id.IDS_COLLECTION_THIS_DEVICE_ONLY = "IDS_COLLECTION_THIS_DEVICE_ONLY";
+ String.id.IDS_COLLECTION_TOOLTIP_CANT_PLAY_ONEDRIVE_TRACK = "IDS_COLLECTION_TOOLTIP_CANT_PLAY_ONEDRIVE_TRACK";
+ String.id.IDS_COLLECTION_TOOLTIP_CLOUD_STATUS = "IDS_COLLECTION_TOOLTIP_CLOUD_STATUS";
+ String.id.IDS_COLLECTION_TOOLTIP_LEARN_MORE = "IDS_COLLECTION_TOOLTIP_LEARN_MORE";
+ String.id.IDS_COLLECTION_TOOLTIP_MATCHED = "IDS_COLLECTION_TOOLTIP_MATCHED";
+ String.id.IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD = "IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD";
+ String.id.IDS_COLLECTION_TOOLTIP_STREAMING = "IDS_COLLECTION_TOOLTIP_STREAMING";
+ String.id.IDS_COLLECTION_TOOLTIP_UNMATCHED = "IDS_COLLECTION_TOOLTIP_UNMATCHED";
+ String.id.IDS_COLLECTION_TV_EMPTY = "IDS_COLLECTION_TV_EMPTY";
+ String.id.IDS_COLLECTION_VIDEO_EMPTY = "IDS_COLLECTION_VIDEO_EMPTY";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY = "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2 = "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE = "IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT = "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE = "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE";
+ String.id.IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK = "IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK";
+ String.id.IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK = "IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK";
+ String.id.IDS_COLLECTION_VIDEO_SETTINGS_TITLE = "IDS_COLLECTION_VIDEO_SETTINGS_TITLE";
+ String.id.IDS_COMMA_SEPARATOR = "IDS_COMMA_SEPARATOR";
+ String.id.IDS_COMPANION_HOME_NOW_PLAYING_EMPTY = "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY";
+ String.id.IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE = "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE";
+ String.id.IDS_COMPOSE_MESSAGE_SEND = "IDS_COMPOSE_MESSAGE_SEND";
+ String.id.IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL = "IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL";
+ String.id.IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL = "IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL";
+ String.id.IDS_CONTROLLER_DISMISS_KEYBOARD = "IDS_CONTROLLER_DISMISS_KEYBOARD";
+ String.id.IDS_CONTROLLER_EXCLUSIVE_WARNING = "IDS_CONTROLLER_EXCLUSIVE_WARNING";
+ String.id.IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON = "IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON";
+ String.id.IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE = "IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE";
+ String.id.IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL = "IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL";
+ String.id.IDS_CONTROLLER_INVOKE_KEYBOARD = "IDS_CONTROLLER_INVOKE_KEYBOARD";
+ String.id.IDS_CONTROLLER_SAME_WIRELESS_NETWORK = "IDS_CONTROLLER_SAME_WIRELESS_NETWORK";
+ String.id.IDS_CONTROLLER_SEPARATE_NETWORKS = "IDS_CONTROLLER_SEPARATE_NETWORKS";
+ String.id.IDS_CONTROLLER_SLOW_CONNECTION = "IDS_CONTROLLER_SLOW_CONNECTION";
+ String.id.IDS_CONTROLLER_SLOW_CONNECTION_BUTTON = "IDS_CONTROLLER_SLOW_CONNECTION_BUTTON";
+ String.id.IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO = "IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO";
+ String.id.IDS_CONTROLLER_SWITCHER_BROWSER = "IDS_CONTROLLER_SWITCHER_BROWSER";
+ String.id.IDS_CONTROLLER_SWITCHER_BUTTON = "IDS_CONTROLLER_SWITCHER_BUTTON";
+ String.id.IDS_CONTROLLER_SWITCHER_CONTROLLER = "IDS_CONTROLLER_SWITCHER_CONTROLLER";
+ String.id.IDS_CONTROLLER_SWITCHER_GUIDE = "IDS_CONTROLLER_SWITCHER_GUIDE";
+ String.id.IDS_CONTROLLER_SWITCHER_KEYBOARD = "IDS_CONTROLLER_SWITCHER_KEYBOARD";
+ String.id.IDS_CONTROLLER_TUTORIAL_SWIPE = "IDS_CONTROLLER_TUTORIAL_SWIPE";
+ String.id.IDS_CONTROLLER_TUTORIAL_TAP = "IDS_CONTROLLER_TUTORIAL_TAP";
+ String.id.IDS_CONTROLLER_WEB_HUB_BUTTON = "IDS_CONTROLLER_WEB_HUB_BUTTON";
+ String.id.IDS_CREATEACCOUNT_TITLE = "IDS_CREATEACCOUNT_TITLE";
+ String.id.IDS_DELETE_BUTTON = "IDS_DELETE_BUTTON";
+ String.id.IDS_DELETE_DESCRIPTION_LOCAL_PLURAL = "IDS_DELETE_DESCRIPTION_LOCAL_PLURAL";
+ String.id.IDS_DELETE_DESCRIPTION_LOCAL_SINGLE = "IDS_DELETE_DESCRIPTION_LOCAL_SINGLE";
+ String.id.IDS_DELETE_LABEL = "IDS_DELETE_LABEL";
+ String.id.IDS_DEMO_CONFIGURATION_COMPLETE = "IDS_DEMO_CONFIGURATION_COMPLETE";
+ String.id.IDS_DEMO_IN_DEMO_MODE = "IDS_DEMO_IN_DEMO_MODE";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER = "IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER = "IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_HEADER = "IDS_DEMO_MUSIC_EXPLORE_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1 = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2 = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3 = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER = "IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_SUBTITLE = "IDS_DEMO_MUSIC_EXPLORE_SUBTITLE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE = "IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE = "IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE";
+ String.id.IDS_DEMO_MUSIC_RADIO_HEADER = "IDS_DEMO_MUSIC_RADIO_HEADER";
+ String.id.IDS_DEMO_MUSIC_RADIO_MESSAGE_1 = "IDS_DEMO_MUSIC_RADIO_MESSAGE_1";
+ String.id.IDS_DEMO_MUSIC_RADIO_MESSAGE_2 = "IDS_DEMO_MUSIC_RADIO_MESSAGE_2";
+ String.id.IDS_DEMO_MUSIC_RADIO_MESSAGE_3 = "IDS_DEMO_MUSIC_RADIO_MESSAGE_3";
+ String.id.IDS_DEMO_MUSIC_RADIO_SUBTITLE = "IDS_DEMO_MUSIC_RADIO_SUBTITLE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE = "IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE = "IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE = "IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE = "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE = "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE = "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF = "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON = "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV = "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV";
+ String.id.IDS_DETAILS_ADD_TO_NOW_PLAYING = "IDS_DETAILS_ADD_TO_NOW_PLAYING";
+ String.id.IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION = "IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION";
+ String.id.IDS_DETAILS_ALL_EPISODES_LABEL = "IDS_DETAILS_ALL_EPISODES_LABEL";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS = "IDS_DETAILS_ARTIST_ALBUMS";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_ALL = "IDS_DETAILS_ARTIST_ALBUMS_ALL";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_ALL_LC = "IDS_DETAILS_ARTIST_ALBUMS_ALL_LC";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_LOCAL = "IDS_DETAILS_ARTIST_ALBUMS_LOCAL";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC = "IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL = "IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL";
+ String.id.IDS_DETAILS_AUDIO_LANGUAGE = "IDS_DETAILS_AUDIO_LANGUAGE";
+ String.id.IDS_DETAILS_BUY_ALBUM_LABEL = "IDS_DETAILS_BUY_ALBUM_LABEL";
+ String.id.IDS_DETAILS_BUY_BUNDLE = "IDS_DETAILS_BUY_BUNDLE";
+ String.id.IDS_DETAILS_BUY_EPISODE_LABEL = "IDS_DETAILS_BUY_EPISODE_LABEL";
+ String.id.IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL = "IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL";
+ String.id.IDS_DETAILS_BUY_EXTRA = "IDS_DETAILS_BUY_EXTRA";
+ String.id.IDS_DETAILS_BUY_SEASON_CURRENT_LABEL = "IDS_DETAILS_BUY_SEASON_CURRENT_LABEL";
+ String.id.IDS_DETAILS_BUY_SEASON_LABEL = "IDS_DETAILS_BUY_SEASON_LABEL";
+ String.id.IDS_DETAILS_BUY_SONG_LABEL = "IDS_DETAILS_BUY_SONG_LABEL";
+ String.id.IDS_DETAILS_COLLECTION_ALBUM_COUNT = "IDS_DETAILS_COLLECTION_ALBUM_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL = "IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL";
+ String.id.IDS_DETAILS_COLLECTION_ALBUMS_COUNT = "IDS_DETAILS_COLLECTION_ALBUMS_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_NO_SONGS = "IDS_DETAILS_COLLECTION_NO_SONGS";
+ String.id.IDS_DETAILS_COLLECTION_SONG_COUNT = "IDS_DETAILS_COLLECTION_SONG_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_SONGS_COUNT = "IDS_DETAILS_COLLECTION_SONGS_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_SONGS_PLURAL = "IDS_DETAILS_COLLECTION_SONGS_PLURAL";
+ String.id.IDS_DETAILS_CURRENT_MEDIA_LABEL = "IDS_DETAILS_CURRENT_MEDIA_LABEL";
+ String.id.IDS_DETAILS_DEMO_PURCHASED_LABEL = "IDS_DETAILS_DEMO_PURCHASED_LABEL";
+ String.id.IDS_DETAILS_DESCRIPTION_LABEL = "IDS_DETAILS_DESCRIPTION_LABEL";
+ String.id.IDS_DETAILS_DEVELOPER_LABEL = "IDS_DETAILS_DEVELOPER_LABEL";
+ String.id.IDS_DETAILS_DOWNLOAD_FREE_EXTRA = "IDS_DETAILS_DOWNLOAD_FREE_EXTRA";
+ String.id.IDS_DETAILS_DOWNLOAD_LABEL = "IDS_DETAILS_DOWNLOAD_LABEL";
+ String.id.IDS_DETAILS_DOWNLOAD_LABEL_HD = "IDS_DETAILS_DOWNLOAD_LABEL_HD";
+ String.id.IDS_DETAILS_DOWNLOAD_LABEL_SD = "IDS_DETAILS_DOWNLOAD_LABEL_SD";
+ String.id.IDS_DETAILS_DURATION_HOURS_FORMAT = "IDS_DETAILS_DURATION_HOURS_FORMAT";
+ String.id.IDS_DETAILS_DURATION_LABEL = "IDS_DETAILS_DURATION_LABEL";
+ String.id.IDS_DETAILS_DURATION_MINS_FORMAT = "IDS_DETAILS_DURATION_MINS_FORMAT";
+ String.id.IDS_DETAILS_DURATION_MINSEC_FORMAT = "IDS_DETAILS_DURATION_MINSEC_FORMAT";
+ String.id.IDS_DETAILS_EPISODES_LABEL = "IDS_DETAILS_EPISODES_LABEL";
+ String.id.IDS_DETAILS_EPISODES_LABEL_LC = "IDS_DETAILS_EPISODES_LABEL_LC";
+ String.id.IDS_DETAILS_EPISODES_LABEL_UC = "IDS_DETAILS_EPISODES_LABEL_UC";
+ String.id.IDS_DETAILS_EXPLICIT_LABEL = "IDS_DETAILS_EXPLICIT_LABEL";
+ String.id.IDS_DETAILS_EXPLICIT_LABEL_UC = "IDS_DETAILS_EXPLICIT_LABEL_UC";
+ String.id.IDS_DETAILS_EXTRA_EPISODE_LABEL = "IDS_DETAILS_EXTRA_EPISODE_LABEL";
+ String.id.IDS_DETAILS_EXTRA_EPISODE_LABEL_LC = "IDS_DETAILS_EXTRA_EPISODE_LABEL_LC";
+ String.id.IDS_DETAILS_EXTRA_EPISODE_LABEL_UC = "IDS_DETAILS_EXTRA_EPISODE_LABEL_UC";
+ String.id.IDS_DETAILS_EXTRA_FOR_GAME = "IDS_DETAILS_EXTRA_FOR_GAME";
+ String.id.IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL = "IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL";
+ String.id.IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON = "IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON";
+ String.id.IDS_DETAILS_EXTRA_PURCHASED_LABEL = "IDS_DETAILS_EXTRA_PURCHASED_LABEL";
+ String.id.IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL = "IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL";
+ String.id.IDS_DETAILS_FEATURED_TRAILER_TITLE = "IDS_DETAILS_FEATURED_TRAILER_TITLE";
+ String.id.IDS_DETAILS_FEATURED_WATCH_TRAILER = "IDS_DETAILS_FEATURED_WATCH_TRAILER";
+ String.id.IDS_DETAILS_FILE_OPEN_LABEL = "IDS_DETAILS_FILE_OPEN_LABEL";
+ String.id.IDS_DETAILS_GAME_PURCHASED_LABEL = "IDS_DETAILS_GAME_PURCHASED_LABEL";
+ String.id.IDS_DETAILS_GENRE_LABEL = "IDS_DETAILS_GENRE_LABEL";
+ String.id.IDS_DETAILS_HUB_MUSIC_ALBUMS = "IDS_DETAILS_HUB_MUSIC_ALBUMS";
+ String.id.IDS_DETAILS_HUB_TV_SEASONS = "IDS_DETAILS_HUB_TV_SEASONS";
+ String.id.IDS_DETAILS_INFO_SEPERATOR = "IDS_DETAILS_INFO_SEPERATOR";
+ String.id.IDS_DETAILS_LATEST_EPISODE_LABEL = "IDS_DETAILS_LATEST_EPISODE_LABEL";
+ String.id.IDS_DETAILS_METADATA_SEPERATOR = "IDS_DETAILS_METADATA_SEPERATOR";
+ String.id.IDS_DETAILS_MORE_ACTION = "IDS_DETAILS_MORE_ACTION";
+ String.id.IDS_DETAILS_MY_ALBUMS = "IDS_DETAILS_MY_ALBUMS";
+ String.id.IDS_DETAILS_NETWORK_LABEL = "IDS_DETAILS_NETWORK_LABEL";
+ String.id.IDS_DETAILS_NEW_EPISODE_LABEL = "IDS_DETAILS_NEW_EPISODE_LABEL";
+ String.id.IDS_DETAILS_NOT_RATED_LABEL = "IDS_DETAILS_NOT_RATED_LABEL";
+ String.id.IDS_DETAILS_NOT_RATED_LONG_LABEL = "IDS_DETAILS_NOT_RATED_LONG_LABEL";
+ String.id.IDS_DETAILS_OVERVIEW = "IDS_DETAILS_OVERVIEW";
+ String.id.IDS_DETAILS_PERC_WATCHED_LABEL = "IDS_DETAILS_PERC_WATCHED_LABEL";
+ String.id.IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE = "IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE";
+ String.id.IDS_DETAILS_PLATFORM_LABEL = "IDS_DETAILS_PLATFORM_LABEL";
+ String.id.IDS_DETAILS_PLAY_ALBUM_BUTTON = "IDS_DETAILS_PLAY_ALBUM_BUTTON";
+ String.id.IDS_DETAILS_PLAY_NOW_LABEL = "IDS_DETAILS_PLAY_NOW_LABEL";
+ String.id.IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL = "IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL";
+ String.id.IDS_DETAILS_PLAY_ON_XBOX_LABEL = "IDS_DETAILS_PLAY_ON_XBOX_LABEL";
+ String.id.IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL = "IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL";
+ String.id.IDS_DETAILS_PLAY_SEASON_BUTTON = "IDS_DETAILS_PLAY_SEASON_BUTTON";
+ String.id.IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL = "IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL";
+ String.id.IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL = "IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL";
+ String.id.IDS_DETAILS_PLAY_TRAILER_LABEL = "IDS_DETAILS_PLAY_TRAILER_LABEL";
+ String.id.IDS_DETAILS_PLAYLIST_NO_SONGS = "IDS_DETAILS_PLAYLIST_NO_SONGS";
+ String.id.IDS_DETAILS_PLAYLIST_SONG_COUNT = "IDS_DETAILS_PLAYLIST_SONG_COUNT";
+ String.id.IDS_DETAILS_PLAYLIST_SONGS_COUNT = "IDS_DETAILS_PLAYLIST_SONGS_COUNT";
+ String.id.IDS_DETAILS_PLAYLIST_SONGS_PLURAL = "IDS_DETAILS_PLAYLIST_SONGS_PLURAL";
+ String.id.IDS_DETAILS_PREVIEW_ALBUM_LABEL = "IDS_DETAILS_PREVIEW_ALBUM_LABEL";
+ String.id.IDS_DETAILS_PREVIEW_ARTIST_LABEL = "IDS_DETAILS_PREVIEW_ARTIST_LABEL";
+ String.id.IDS_DETAILS_PREVIEW_EPISODE_LABEL = "IDS_DETAILS_PREVIEW_EPISODE_LABEL";
+ String.id.IDS_DETAILS_PREVIEW_SONG_LABEL = "IDS_DETAILS_PREVIEW_SONG_LABEL";
+ String.id.IDS_DETAILS_PUBLISHER_LABEL = "IDS_DETAILS_PUBLISHER_LABEL";
+ String.id.IDS_DETAILS_QUALITY_LABEL = "IDS_DETAILS_QUALITY_LABEL";
+ String.id.IDS_DETAILS_RATING_LABEL = "IDS_DETAILS_RATING_LABEL";
+ String.id.IDS_DETAILS_RATING_USERRATED = "IDS_DETAILS_RATING_USERRATED";
+ String.id.IDS_DETAILS_RATINGS_PLURAL = "IDS_DETAILS_RATINGS_PLURAL";
+ String.id.IDS_DETAILS_RECENT_ALBUMS = "IDS_DETAILS_RECENT_ALBUMS";
+ String.id.IDS_DETAILS_RELATED_ARTISTS = "IDS_DETAILS_RELATED_ARTISTS";
+ String.id.IDS_DETAILS_RELEASE_DATE_LABEL = "IDS_DETAILS_RELEASE_DATE_LABEL";
+ String.id.IDS_DETAILS_REVIEW_LABEL = "IDS_DETAILS_REVIEW_LABEL";
+ String.id.IDS_DETAILS_SEASONS_LABEL = "IDS_DETAILS_SEASONS_LABEL";
+ String.id.IDS_DETAILS_SHUFFLE_ALL = "IDS_DETAILS_SHUFFLE_ALL";
+ String.id.IDS_DETAILS_SIMILAR_MOVIES = "IDS_DETAILS_SIMILAR_MOVIES";
+ String.id.IDS_DETAILS_SLASH_SEPERATOR = "IDS_DETAILS_SLASH_SEPERATOR";
+ String.id.IDS_DETAILS_START_DOWNLOAD_LABEL = "IDS_DETAILS_START_DOWNLOAD_LABEL";
+ String.id.IDS_DETAILS_STUDIO_LABEL = "IDS_DETAILS_STUDIO_LABEL";
+ String.id.IDS_DETAILS_TITLE_NAR = "IDS_DETAILS_TITLE_NAR";
+ String.id.IDS_DETAILS_TOP_SONGS = "IDS_DETAILS_TOP_SONGS";
+ String.id.IDS_DETAILS_TRACK_NUM_FORMAT = "IDS_DETAILS_TRACK_NUM_FORMAT";
+ String.id.IDS_DETAILS_TRACKS_LABEL = "IDS_DETAILS_TRACKS_LABEL";
+ String.id.IDS_DETAILS_TRY_AGAIN_LABEL = "IDS_DETAILS_TRY_AGAIN_LABEL";
+ String.id.IDS_DETAILS_TRY_AGAIN_LABEL_HD = "IDS_DETAILS_TRY_AGAIN_LABEL_HD";
+ String.id.IDS_DETAILS_TRY_AGAIN_LABEL_SD = "IDS_DETAILS_TRY_AGAIN_LABEL_SD";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS = "IDS_DETAILS_TVSERIES_SEASONS";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS_ALL = "IDS_DETAILS_TVSERIES_SEASONS_ALL";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS_LOCAL = "IDS_DETAILS_TVSERIES_SEASONS_LOCAL";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL = "IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL";
+ String.id.IDS_DETAILS_UNRATED_LABEL = "IDS_DETAILS_UNRATED_LABEL";
+ String.id.IDS_DETAILS_UNRATED_LONG_LABEL = "IDS_DETAILS_UNRATED_LONG_LABEL";
+ String.id.IDS_DETAILS_VIDEO_HUB_RELATED = "IDS_DETAILS_VIDEO_HUB_RELATED";
+ String.id.IDS_DETAILS_VIDEO_HUB_RELATED_UC = "IDS_DETAILS_VIDEO_HUB_RELATED_UC";
+ String.id.IDS_DETAILS_VIEW_FULL_APP = "IDS_DETAILS_VIEW_FULL_APP";
+ String.id.IDS_DETAILS_VIEW_FULL_ARTIST = "IDS_DETAILS_VIEW_FULL_ARTIST";
+ String.id.IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR = "IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR";
+ String.id.IDS_DETAILS_VIEW_FULL_GAME = "IDS_DETAILS_VIEW_FULL_GAME";
+ String.id.IDS_DETAILS_VIEW_FULL_MOVIE = "IDS_DETAILS_VIEW_FULL_MOVIE";
+ String.id.IDS_DETAILS_VIEW_FULL_SEASON = "IDS_DETAILS_VIEW_FULL_SEASON";
+ String.id.IDS_DETAILS_VIEW_FULL_SERIES = "IDS_DETAILS_VIEW_FULL_SERIES";
+ String.id.IDS_DETAILS_VIEW_MORE = "IDS_DETAILS_VIEW_MORE";
+ String.id.IDS_DETAILS_WATCH_NOW_LABEL = "IDS_DETAILS_WATCH_NOW_LABEL";
+ String.id.IDS_DETAILS_WATCH_ON_XBOX_LABEL = "IDS_DETAILS_WATCH_ON_XBOX_LABEL";
+ String.id.IDS_DETAILS_WATCH_TRAILER_LABEL = "IDS_DETAILS_WATCH_TRAILER_LABEL";
+ String.id.IDS_DIALOG_ERROR_CODE = "IDS_DIALOG_ERROR_CODE";
+ String.id.IDS_DIALOG_ERROR_FEEDBACKLINK = "IDS_DIALOG_ERROR_FEEDBACKLINK";
+ String.id.IDS_DIALOG_ERROR_MORE_INFO = "IDS_DIALOG_ERROR_MORE_INFO";
+ String.id.IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE = "IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE";
+ String.id.IDS_DIALOG_SESSION_TIMED_OUT_TITLE = "IDS_DIALOG_SESSION_TIMED_OUT_TITLE";
+ String.id.IDS_DIALOG_UNEXPECTED_ERROR_CAPTION = "IDS_DIALOG_UNEXPECTED_ERROR_CAPTION";
+ String.id.IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD = "IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD";
+ String.id.IDS_DOWNLOAD_ERROR_CAPTION = "IDS_DOWNLOAD_ERROR_CAPTION";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL = "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD = "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS = "IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS = "IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS = "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD = "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD";
+ String.id.IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER = "IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER";
+ String.id.IDS_DOWNLOAD_LABEL = "IDS_DOWNLOAD_LABEL";
+ String.id.IDS_EDIT_BUTTON = "IDS_EDIT_BUTTON";
+ String.id.IDS_EDITBOX_ERROR_NUMBER = "IDS_EDITBOX_ERROR_NUMBER";
+ String.id.IDS_EDITBOX_REMAINING_PLURAL = "IDS_EDITBOX_REMAINING_PLURAL";
+ String.id.IDS_EMPTY_SYMBOL = "IDS_EMPTY_SYMBOL";
+ String.id.IDS_EMPTY_VIEW = "IDS_EMPTY_VIEW";
+ String.id.IDS_FAILED_PANEL_HEADER = "IDS_FAILED_PANEL_HEADER";
+ String.id.IDS_FAILED_PANEL_LABEL = "IDS_FAILED_PANEL_LABEL";
+ String.id.IDS_FAILED_PANEL_OFFLINE_DESC = "IDS_FAILED_PANEL_OFFLINE_DESC";
+ String.id.IDS_FAILED_PANEL_OFFLINE_HEADER = "IDS_FAILED_PANEL_OFFLINE_HEADER";
+ String.id.IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE = "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE";
+ String.id.IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE = "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE";
+ String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER = "IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER";
+ String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED = "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED";
+ String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED = "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADED = "IDS_FILE_TRANSFER_DOWNLOADED";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT";
+ String.id.IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG = "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG";
+ String.id.IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT = "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT";
+ String.id.IDS_FILTER_ALL = "IDS_FILTER_ALL";
+ String.id.IDS_FILTER_ALL_GENRES = "IDS_FILTER_ALL_GENRES";
+ String.id.IDS_FILTER_ALL_GENRES_SC = "IDS_FILTER_ALL_GENRES_SC";
+ String.id.IDS_FILTER_ALL_SUBGENRES_SC = "IDS_FILTER_ALL_SUBGENRES_SC";
+ String.id.IDS_FILTER_BY = "IDS_FILTER_BY";
+ String.id.IDS_FILTER_IN = "IDS_FILTER_IN";
+ String.id.IDS_FILTER_SORTED_BY = "IDS_FILTER_SORTED_BY";
+ String.id.IDS_GLOBAL_COMMAND_HELP = "IDS_GLOBAL_COMMAND_HELP";
+ String.id.IDS_GLOBAL_COMMAND_HOME = "IDS_GLOBAL_COMMAND_HOME";
+ String.id.IDS_GLOBAL_COMMAND_NOW_PLAYING = "IDS_GLOBAL_COMMAND_NOW_PLAYING";
+ String.id.IDS_GLOBAL_COMMAND_RESTORE_PURCHASES = "IDS_GLOBAL_COMMAND_RESTORE_PURCHASES";
+ String.id.IDS_GLOBAL_COMMAND_SEARCH = "IDS_GLOBAL_COMMAND_SEARCH";
+ String.id.IDS_HHMMSS_DURATION = "IDS_HHMMSS_DURATION";
+ String.id.IDS_HOME_NOW_PLAYING = "IDS_HOME_NOW_PLAYING";
+ String.id.IDS_HOME_NOW_PLAYING_EPISODE = "IDS_HOME_NOW_PLAYING_EPISODE";
+ String.id.IDS_HOME_NOW_PLAYING_JUMP_IN = "IDS_HOME_NOW_PLAYING_JUMP_IN";
+ String.id.IDS_HOME_NOW_PLAYING_LC = "IDS_HOME_NOW_PLAYING_LC";
+ String.id.IDS_HOME_NOW_PLAYING_RESUME = "IDS_HOME_NOW_PLAYING_RESUME";
+ String.id.IDS_HOME_NOW_PLAYING_RESUME_ARIA = "IDS_HOME_NOW_PLAYING_RESUME_ARIA";
+ String.id.IDS_HOME_NOW_PLAYING_XBOX = "IDS_HOME_NOW_PLAYING_XBOX";
+ String.id.IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED = "IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED";
+ String.id.IDS_HOME_PIVOT = "IDS_HOME_PIVOT";
+ String.id.IDS_HOME_TILE_PAUSED_LABEL = "IDS_HOME_TILE_PAUSED_LABEL";
+ String.id.IDS_LOADING_STATUS_LABEL = "IDS_LOADING_STATUS_LABEL";
+ String.id.IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR = "IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR";
+ String.id.IDS_MANAGE_FOLDERS_DESCRIPTION = "IDS_MANAGE_FOLDERS_DESCRIPTION";
+ String.id.IDS_MANAGE_FOLDERS_DONE_BUTTON = "IDS_MANAGE_FOLDERS_DONE_BUTTON";
+ String.id.IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR = "IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR";
+ String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT = "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT";
+ String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE = "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE";
+ String.id.IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION = "IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION = "IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION = "IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MUSIC_APP_DESCRIPTION = "IDS_MANIFEST_MUSIC_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MUSIC_APP_NAME = "IDS_MANIFEST_MUSIC_APP_NAME";
+ String.id.IDS_MANIFEST_TEST_APP_DESCRIPTION = "IDS_MANIFEST_TEST_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_TEST_APP_NAME = "IDS_MANIFEST_TEST_APP_NAME";
+ String.id.IDS_MANIFEST_TEST_APP_SHORT_NAME = "IDS_MANIFEST_TEST_APP_SHORT_NAME";
+ String.id.IDS_MANIFEST_VIDEO_APP_DESCRIPTION = "IDS_MANIFEST_VIDEO_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_VIDEO_APP_NAME = "IDS_MANIFEST_VIDEO_APP_NAME";
+ String.id.IDS_MARKETPLACE_BY_PLAYRANK = "IDS_MARKETPLACE_BY_PLAYRANK";
+ String.id.IDS_MARKETPLACE_PIVOT = "IDS_MARKETPLACE_PIVOT";
+ String.id.IDS_MARKETPLACE_REGION_EMPTY = "IDS_MARKETPLACE_REGION_EMPTY";
+ String.id.IDS_MARKETPLACE_SORT_BEST_SELLING = "IDS_MARKETPLACE_SORT_BEST_SELLING";
+ String.id.IDS_MARKETPLACE_SORT_CRITIC_RATING = "IDS_MARKETPLACE_SORT_CRITIC_RATING";
+ String.id.IDS_MARKETPLACE_SORT_PLAY_RANK = "IDS_MARKETPLACE_SORT_PLAY_RANK";
+ String.id.IDS_MARKETPLACE_SORT_POPULARITY = "IDS_MARKETPLACE_SORT_POPULARITY";
+ String.id.IDS_MARKETPLACE_SORT_RELEASE_DATE = "IDS_MARKETPLACE_SORT_RELEASE_DATE";
+ String.id.IDS_MARKETPLACE_SORT_SALES_RANK = "IDS_MARKETPLACE_SORT_SALES_RANK";
+ String.id.IDS_MARKETPLACE_SORT_TITLE = "IDS_MARKETPLACE_SORT_TITLE";
+ String.id.IDS_MARKETPLACE_SORT_TOP_RENTED = "IDS_MARKETPLACE_SORT_TOP_RENTED";
+ String.id.IDS_MARKETPLACE_SORT_TOP_SELLING = "IDS_MARKETPLACE_SORT_TOP_SELLING";
+ String.id.IDS_MARKETPLACE_SORT_USER_RATING = "IDS_MARKETPLACE_SORT_USER_RATING";
+ String.id.IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION = "IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION";
+ String.id.IDS_MEDIA_ERROR_CAPTION = "IDS_MEDIA_ERROR_CAPTION";
+ String.id.IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON = "IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON";
+ String.id.IDS_MEDIA_STATUS_DOWNLOADING_ICON = "IDS_MEDIA_STATUS_DOWNLOADING_ICON";
+ String.id.IDS_MEDIA_STATUS_INLINE_STREAMING_ICON = "IDS_MEDIA_STATUS_INLINE_STREAMING_ICON";
+ String.id.IDS_MEDIA_STATUS_NOW_PLAYING_ICON = "IDS_MEDIA_STATUS_NOW_PLAYING_ICON";
+ String.id.IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON = "IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON";
+ String.id.IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON = "IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON";
+ String.id.IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON = "IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON";
+ String.id.IDS_MEDIATYPE_ALBUM = "IDS_MEDIATYPE_ALBUM";
+ String.id.IDS_MEDIATYPE_ARTIST = "IDS_MEDIATYPE_ARTIST";
+ String.id.IDS_MEDIATYPE_GAME = "IDS_MEDIATYPE_GAME";
+ String.id.IDS_MEDIATYPE_GAME_WINDOWS = "IDS_MEDIATYPE_GAME_WINDOWS";
+ String.id.IDS_MEDIATYPE_MOVIE = "IDS_MEDIATYPE_MOVIE";
+ String.id.IDS_MEDIATYPE_PLAYLIST = "IDS_MEDIATYPE_PLAYLIST";
+ String.id.IDS_MEDIATYPE_SONG = "IDS_MEDIATYPE_SONG";
+ String.id.IDS_MEDIATYPE_TVEPISODE = "IDS_MEDIATYPE_TVEPISODE";
+ String.id.IDS_MEDIATYPE_TVSEASON = "IDS_MEDIATYPE_TVSEASON";
+ String.id.IDS_MEDIATYPE_TVSERIES = "IDS_MEDIATYPE_TVSERIES";
+ String.id.IDS_MMSS_DURATION = "IDS_MMSS_DURATION";
+ String.id.IDS_MODIFIER_PREFIX_SORTBY = "IDS_MODIFIER_PREFIX_SORTBY";
+ String.id.IDS_MODIFIER_PREFIX_VIEW = "IDS_MODIFIER_PREFIX_VIEW";
+ String.id.IDS_MODIFIER_PREFIX_VIEWBY = "IDS_MODIFIER_PREFIX_VIEWBY";
+ String.id.IDS_MOGO_NOW_PLAYING = "IDS_MOGO_NOW_PLAYING";
+ String.id.IDS_MOGO_NOW_PLAYING_XBOXMUSIC = "IDS_MOGO_NOW_PLAYING_XBOXMUSIC";
+ String.id.IDS_MOGO_NOW_PLAYING_XBOXVIDEO = "IDS_MOGO_NOW_PLAYING_XBOXVIDEO";
+ String.id.IDS_MOGO_RESUME = "IDS_MOGO_RESUME";
+ String.id.IDS_MOGO_XBOX_MUSIC_XENON = "IDS_MOGO_XBOX_MUSIC_XENON";
+ String.id.IDS_MOGO_XBOX_VIDEO_XENON = "IDS_MOGO_XBOX_VIDEO_XENON";
+ String.id.IDS_MUSIC_ALBUMS_PIVOT = "IDS_MUSIC_ALBUMS_PIVOT";
+ String.id.IDS_MUSIC_ALBUMS_PIVOT_TC = "IDS_MUSIC_ALBUMS_PIVOT_TC";
+ String.id.IDS_MUSIC_APP_TITLE = "IDS_MUSIC_APP_TITLE";
+ String.id.IDS_MUSIC_APP_TITLE_TC = "IDS_MUSIC_APP_TITLE_TC";
+ String.id.IDS_MUSIC_ARTISTS_PIVOT = "IDS_MUSIC_ARTISTS_PIVOT";
+ String.id.IDS_MUSIC_ARTISTS_PIVOT_TC = "IDS_MUSIC_ARTISTS_PIVOT_TC";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL = "IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL = "IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE = "IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE";
+ String.id.IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1 = "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1";
+ String.id.IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2 = "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2";
+ String.id.IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE = "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC = "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC = "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC = "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT = "IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_INFO_ACTION_DESC = "IDS_MUSIC_CLOUD_INFO_ACTION_DESC";
+ String.id.IDS_MUSIC_CLOUD_INFO_ACTION_TITLE = "IDS_MUSIC_CLOUD_INFO_ACTION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_INFO_DIALOG_BODY = "IDS_MUSIC_CLOUD_INFO_DIALOG_BODY";
+ String.id.IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK = "IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK";
+ String.id.IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE = "IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1 = "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1 = "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG = "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS = "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL = "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1 = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2 = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3 = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL = "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2 = "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_DESC = "IDS_MUSIC_COLLECTION_EMPTY_DESC";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_TITLE = "IDS_MUSIC_COLLECTION_EMPTY_TITLE";
+ String.id.IDS_MUSIC_COLLECTION_PIVOT = "IDS_MUSIC_COLLECTION_PIVOT";
+ String.id.IDS_MUSIC_COLLECTION_PIVOT_TC = "IDS_MUSIC_COLLECTION_PIVOT_TC";
+ String.id.IDS_MUSIC_DEVICES_PIVOT = "IDS_MUSIC_DEVICES_PIVOT";
+ String.id.IDS_MUSIC_DEVICES_PIVOT_TC = "IDS_MUSIC_DEVICES_PIVOT_TC";
+ String.id.IDS_MUSIC_EXPLORE_PIVOT = "IDS_MUSIC_EXPLORE_PIVOT";
+ String.id.IDS_MUSIC_EXPLORE_PIVOT_TC = "IDS_MUSIC_EXPLORE_PIVOT_TC";
+ String.id.IDS_MUSIC_FEATURED_PIVOT = "IDS_MUSIC_FEATURED_PIVOT";
+ String.id.IDS_MUSIC_GENRES_PIVOT = "IDS_MUSIC_GENRES_PIVOT";
+ String.id.IDS_MUSIC_LOCATION_DMZ = "IDS_MUSIC_LOCATION_DMZ";
+ String.id.IDS_MUSIC_MARKETPLACE_EMPTY_DESC = "IDS_MUSIC_MARKETPLACE_EMPTY_DESC";
+ String.id.IDS_MUSIC_MARKETPLACE_EMPTY_TITLE = "IDS_MUSIC_MARKETPLACE_EMPTY_TITLE";
+ String.id.IDS_MUSIC_MARKETPLACE_PIVOT = "IDS_MUSIC_MARKETPLACE_PIVOT";
+ String.id.IDS_MUSIC_NEW_RELEASES_PIVOT = "IDS_MUSIC_NEW_RELEASES_PIVOT";
+ String.id.IDS_MUSIC_PIVOT = "IDS_MUSIC_PIVOT";
+ String.id.IDS_MUSIC_RADIO_PIVOT = "IDS_MUSIC_RADIO_PIVOT";
+ String.id.IDS_MUSIC_RADIO_PIVOT_TC = "IDS_MUSIC_RADIO_PIVOT_TC";
+ String.id.IDS_MUSIC_SMARTDJ_PIVOT = "IDS_MUSIC_SMARTDJ_PIVOT";
+ String.id.IDS_MUSIC_SMARTDJ_PIVOT_TC = "IDS_MUSIC_SMARTDJ_PIVOT_TC";
+ String.id.IDS_MUSIC_SONGS_PIVOT_TC = "IDS_MUSIC_SONGS_PIVOT_TC";
+ String.id.IDS_MUSIC_STORE_PIVOT = "IDS_MUSIC_STORE_PIVOT";
+ String.id.IDS_MUSIC_STORE_PIVOT_TC = "IDS_MUSIC_STORE_PIVOT_TC";
+ String.id.IDS_MUSIC_TOP_ALBUMS_PIVOT = "IDS_MUSIC_TOP_ALBUMS_PIVOT";
+ String.id.IDS_MUSIC_VIEW_PLAYLIST = "IDS_MUSIC_VIEW_PLAYLIST";
+ String.id.IDS_MY_MUSIC_BUTTON_DESC = "IDS_MY_MUSIC_BUTTON_DESC";
+ String.id.IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE = "IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE";
+ String.id.IDS_N_FILTER_IN = "IDS_N_FILTER_IN";
+ String.id.IDS_N_SORTED_BY = "IDS_N_SORTED_BY";
+ String.id.IDS_NAV_PANE_HIDE_MENU = "IDS_NAV_PANE_HIDE_MENU";
+ String.id.IDS_NAV_PANE_SHOW_MENU = "IDS_NAV_PANE_SHOW_MENU";
+ String.id.IDS_NETWORK_STATUS_HEADER = "IDS_NETWORK_STATUS_HEADER";
+ String.id.IDS_NETWORK_STATUS_LOCAL_ONLY = "IDS_NETWORK_STATUS_LOCAL_ONLY";
+ String.id.IDS_NETWORK_STATUS_NONE = "IDS_NETWORK_STATUS_NONE";
+ String.id.IDS_NETWORK_STATUS_OVER_THE_LIMIT = "IDS_NETWORK_STATUS_OVER_THE_LIMIT";
+ String.id.IDS_NETWORK_STATUS_ROAMING = "IDS_NETWORK_STATUS_ROAMING";
+ String.id.IDS_NETWORK_STATUS_THROTTLED = "IDS_NETWORK_STATUS_THROTTLED";
+ String.id.IDS_NETWORK_STATUS_UNRESTRICTED = "IDS_NETWORK_STATUS_UNRESTRICTED";
+ String.id.IDS_NEXT_BUTTON = "IDS_NEXT_BUTTON";
+ String.id.IDS_NO_BUTTON = "IDS_NO_BUTTON";
+ String.id.IDS_NOT_AVAILABLE_OFFLINE = "IDS_NOT_AVAILABLE_OFFLINE";
+ String.id.IDS_NOW_PLAYING_DETAILS_BUTTON = "IDS_NOW_PLAYING_DETAILS_BUTTON";
+ String.id.IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION = "IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_ADD_SONG_ACTION = "IDS_NOW_PLAYING_OP_ADD_SONG_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_BIO_ACTION = "IDS_NOW_PLAYING_OP_BIO_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION = "IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_RADIO_ACTION = "IDS_NOW_PLAYING_OP_RADIO_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION = "IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_SHARE_ACTION = "IDS_NOW_PLAYING_OP_SHARE_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_SMARTDJ_ACTION = "IDS_NOW_PLAYING_OP_SMARTDJ_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION = "IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION = "IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION";
+ String.id.IDS_NOW_PLAYING_PANEL_TITLE_LC = "IDS_NOW_PLAYING_PANEL_TITLE_LC";
+ String.id.IDS_NOW_PLAYING_PLAYLIST_BUTTON = "IDS_NOW_PLAYING_PLAYLIST_BUTTON";
+ String.id.IDS_NOW_PLAYING_REMOVE_TRACK_ACTION = "IDS_NOW_PLAYING_REMOVE_TRACK_ACTION";
+ String.id.IDS_NUMBER_SYMBOL = "IDS_NUMBER_SYMBOL";
+ String.id.IDS_OK_BUTTON = "IDS_OK_BUTTON";
+ String.id.IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE = "IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE";
+ String.id.IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE = "IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE";
+ String.id.IDS_PIN_TO_START_LINK_ERROR_TEXT = "IDS_PIN_TO_START_LINK_ERROR_TEXT";
+ String.id.IDS_PIN_TO_START_SCREEN_BUTTON = "IDS_PIN_TO_START_SCREEN_BUTTON";
+ String.id.IDS_PLAY_ALL = "IDS_PLAY_ALL";
+ String.id.IDS_PLAY_ALL_DESC = "IDS_PLAY_ALL_DESC";
+ String.id.IDS_PLAY_ALL_LABEL = "IDS_PLAY_ALL_LABEL";
+ String.id.IDS_PLAY_ALL_SHUFFLED = "IDS_PLAY_ALL_SHUFFLED";
+ String.id.IDS_PLAY_BUTTON = "IDS_PLAY_BUTTON";
+ String.id.IDS_PLAY_BUTTON_VIDEO = "IDS_PLAY_BUTTON_VIDEO";
+ String.id.IDS_PLAYBACK_DURATION_PROGRESS = "IDS_PLAYBACK_DURATION_PROGRESS";
+ String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE = "IDS_PLAYBACK_ERROR_MESSAGE_TITLE";
+ String.id.IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE = "IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE";
+ String.id.IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE = "IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE";
+ String.id.IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED = "IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED";
+ String.id.IDS_PLAYLIST_BUTTON_DESC = "IDS_PLAYLIST_BUTTON_DESC";
+ String.id.IDS_PREVIEW_APP_SUBTITLE = "IDS_PREVIEW_APP_SUBTITLE";
+ String.id.IDS_PROGRESS_NAR = "IDS_PROGRESS_NAR";
+ String.id.IDS_PROVISIONING_ACCEPT_BUTTON = "IDS_PROVISIONING_ACCEPT_BUTTON";
+ String.id.IDS_PROVISIONING_ACCEPTANCE_DESC = "IDS_PROVISIONING_ACCEPTANCE_DESC";
+ String.id.IDS_PROVISIONING_ALREADY_HAVE_BUTTON = "IDS_PROVISIONING_ALREADY_HAVE_BUTTON";
+ String.id.IDS_PROVISIONING_ALREADY_HAVE_DESC = "IDS_PROVISIONING_ALREADY_HAVE_DESC";
+ String.id.IDS_PROVISIONING_CANCEL_BUTTON = "IDS_PROVISIONING_CANCEL_BUTTON";
+ String.id.IDS_PROVISIONING_CHILD_LIST_COMEBACK = "IDS_PROVISIONING_CHILD_LIST_COMEBACK";
+ String.id.IDS_PROVISIONING_CHILD_LIST_SIGNIN = "IDS_PROVISIONING_CHILD_LIST_SIGNIN";
+ String.id.IDS_PROVISIONING_CHILD_LIST_TITLE = "IDS_PROVISIONING_CHILD_LIST_TITLE";
+ String.id.IDS_PROVISIONING_CHILD_LIST_XBOX_LINK = "IDS_PROVISIONING_CHILD_LIST_XBOX_LINK";
+ String.id.IDS_PROVISIONING_CHILD_SUBTITLE = "IDS_PROVISIONING_CHILD_SUBTITLE";
+ String.id.IDS_PROVISIONING_CHILD_TITLE = "IDS_PROVISIONING_CHILD_TITLE";
+ String.id.IDS_PROVISIONING_EXPLANATION = "IDS_PROVISIONING_EXPLANATION";
+ String.id.IDS_PROVISIONING_PRIVACY_LINK = "IDS_PROVISIONING_PRIVACY_LINK";
+ String.id.IDS_PROVISIONING_TITLE = "IDS_PROVISIONING_TITLE";
+ String.id.IDS_PROVISIONING_TOS_LINK = "IDS_PROVISIONING_TOS_LINK";
+ String.id.IDS_PROVISIONING_USER_EMAIL = "IDS_PROVISIONING_USER_EMAIL";
+ String.id.IDS_PURCHASE_ERROR_CAPTION = "IDS_PURCHASE_ERROR_CAPTION";
+ String.id.IDS_PURCHASE_ERROR_MESSAGE = "IDS_PURCHASE_ERROR_MESSAGE";
+ String.id.IDS_PURCHASE_ERROR_MESSAGE_TITLE = "IDS_PURCHASE_ERROR_MESSAGE_TITLE";
+ String.id.IDS_RADIO_ERROR_CAPTION = "IDS_RADIO_ERROR_CAPTION";
+ String.id.IDS_READ_LESS = "IDS_READ_LESS";
+ String.id.IDS_READ_MORE = "IDS_READ_MORE";
+ String.id.IDS_RECENT_LAST_WEEK = "IDS_RECENT_LAST_WEEK";
+ String.id.IDS_RECENT_THIS_MONTH = "IDS_RECENT_THIS_MONTH";
+ String.id.IDS_RECENT_THIS_WEEK = "IDS_RECENT_THIS_WEEK";
+ String.id.IDS_REMOVE_BUTTON = "IDS_REMOVE_BUTTON";
+ String.id.IDS_RENT_BUTTON = "IDS_RENT_BUTTON";
+ String.id.IDS_RESTART_BUTTON = "IDS_RESTART_BUTTON";
+ String.id.IDS_RESUME_BUTTON = "IDS_RESUME_BUTTON";
+ String.id.IDS_SAVE_BUTTON = "IDS_SAVE_BUTTON";
+ String.id.IDS_SEARCH_ALBUMLOCAL_LABEL = "IDS_SEARCH_ALBUMLOCAL_LABEL";
+ String.id.IDS_SEARCH_ALBUMMARKETPLACE_LABEL = "IDS_SEARCH_ALBUMMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL = "IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_ALBUMS_PIVOT_LABEL = "IDS_SEARCH_ALBUMS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_ALBUMS_RESULT_TITLE = "IDS_SEARCH_ALBUMS_RESULT_TITLE";
+ String.id.IDS_SEARCH_ALL_PIVOT_LABEL = "IDS_SEARCH_ALL_PIVOT_LABEL";
+ String.id.IDS_SEARCH_ARTISTLOCAL_LABEL = "IDS_SEARCH_ARTISTLOCAL_LABEL";
+ String.id.IDS_SEARCH_ARTISTMARKETPLACE_LABEL = "IDS_SEARCH_ARTISTMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL = "IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_ARTISTS_PIVOT_LABEL = "IDS_SEARCH_ARTISTS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_ARTISTS_RESULT_TITLE = "IDS_SEARCH_ARTISTS_RESULT_TITLE";
+ String.id.IDS_SEARCH_BUTTON = "IDS_SEARCH_BUTTON";
+ String.id.IDS_SEARCH_FILTER_ALL = "IDS_SEARCH_FILTER_ALL";
+ String.id.IDS_SEARCH_FILTER_COLLECTION = "IDS_SEARCH_FILTER_COLLECTION";
+ String.id.IDS_SEARCH_FILTER_MARKETPLACE = "IDS_SEARCH_FILTER_MARKETPLACE";
+ String.id.IDS_SEARCH_FILTER_MARKETPLACE_VIDEO = "IDS_SEARCH_FILTER_MARKETPLACE_VIDEO";
+ String.id.IDS_SEARCH_HCR_WITH_KEYWORD_NAR = "IDS_SEARCH_HCR_WITH_KEYWORD_NAR";
+ String.id.IDS_SEARCH_INMYVIDEOS_LABEL = "IDS_SEARCH_INMYVIDEOS_LABEL";
+ String.id.IDS_SEARCH_MODIFIER_PIVOT_LABEL = "IDS_SEARCH_MODIFIER_PIVOT_LABEL";
+ String.id.IDS_SEARCH_MOVIELOCAL_LABEL = "IDS_SEARCH_MOVIELOCAL_LABEL";
+ String.id.IDS_SEARCH_MOVIEMARKETPLACE_LABEL = "IDS_SEARCH_MOVIEMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_MUSICHUB_TITLE = "IDS_SEARCH_MUSICHUB_TITLE";
+ String.id.IDS_SEARCH_NORESULT_TITLE = "IDS_SEARCH_NORESULT_TITLE";
+ String.id.IDS_SEARCH_NORESULT_TITLE_TC = "IDS_SEARCH_NORESULT_TITLE_TC";
+ String.id.IDS_SEARCH_NOTSIGNEDIN = "IDS_SEARCH_NOTSIGNEDIN";
+ String.id.IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL = "IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL";
+ String.id.IDS_SEARCH_PIVOT = "IDS_SEARCH_PIVOT";
+ String.id.IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL = "IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_PLAYLISTS_PIVOT_LABEL = "IDS_SEARCH_PLAYLISTS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_RESULT_TITLE = "IDS_SEARCH_RESULT_TITLE";
+ String.id.IDS_SEARCH_RESULT_TITLE_TC = "IDS_SEARCH_RESULT_TITLE_TC";
+ String.id.IDS_SEARCH_SEARCHSTARTED = "IDS_SEARCH_SEARCHSTARTED";
+ String.id.IDS_SEARCH_SONGLOCAL_LABEL = "IDS_SEARCH_SONGLOCAL_LABEL";
+ String.id.IDS_SEARCH_SONGMARKETPLACE_LABEL = "IDS_SEARCH_SONGMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_SONGS_GROUP_HEADER_LABEL = "IDS_SEARCH_SONGS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_SONGS_PIVOT_LABEL = "IDS_SEARCH_SONGS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_TRACKS_RESULT_TITLE = "IDS_SEARCH_TRACKS_RESULT_TITLE";
+ String.id.IDS_SEARCH_TVSERIESLOCAL_LABEL = "IDS_SEARCH_TVSERIESLOCAL_LABEL";
+ String.id.IDS_SEARCH_TVSERIESMARKETPLACE_LABEL = "IDS_SEARCH_TVSERIESMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_VIDEOHUB_TITLE = "IDS_SEARCH_VIDEOHUB_TITLE";
+ String.id.IDS_SEE_ALL_BUTTON = "IDS_SEE_ALL_BUTTON";
+ String.id.IDS_SEE_LESS_BUTTON = "IDS_SEE_LESS_BUTTON";
+ String.id.IDS_SEE_MORE_BUTTON = "IDS_SEE_MORE_BUTTON";
+ String.id.IDS_SERVICE_UNAVAILABLE_CAPTION = "IDS_SERVICE_UNAVAILABLE_CAPTION";
+ String.id.IDS_SET_BUTTON = "IDS_SET_BUTTON";
+ String.id.IDS_SETTINGS_ABOUT_ABOUT_ADS = "IDS_SETTINGS_ABOUT_ABOUT_ADS";
+ String.id.IDS_SETTINGS_ABOUT_CODE_CONDUCT = "IDS_SETTINGS_ABOUT_CODE_CONDUCT";
+ String.id.IDS_SETTINGS_ABOUT_DESCRIPTION = "IDS_SETTINGS_ABOUT_DESCRIPTION";
+ String.id.IDS_SETTINGS_ABOUT_LEARN_MORE = "IDS_SETTINGS_ABOUT_LEARN_MORE";
+ String.id.IDS_SETTINGS_ABOUT_ONLINE_CONTENT = "IDS_SETTINGS_ABOUT_ONLINE_CONTENT";
+ String.id.IDS_SETTINGS_ABOUT_PRERELEASE_VERSION = "IDS_SETTINGS_ABOUT_PRERELEASE_VERSION";
+ String.id.IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT = "IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT";
+ String.id.IDS_SETTINGS_ABOUT_SUPPORT = "IDS_SETTINGS_ABOUT_SUPPORT";
+ String.id.IDS_SETTINGS_ABOUT_SUPPORT_WEB_LINK = "IDS_SETTINGS_ABOUT_SUPPORT_WEB_LINK";
+ String.id.IDS_SETTINGS_ABOUT_TITLE = "IDS_SETTINGS_ABOUT_TITLE";
+ String.id.IDS_SETTINGS_ABOUT_TOS = "IDS_SETTINGS_ABOUT_TOS";
+ String.id.IDS_SETTINGS_ABOUT_VERSION_FORMAT = "IDS_SETTINGS_ABOUT_VERSION_FORMAT";
+ String.id.IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC = "IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC = "IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC = "IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_CURRENT_USER = "IDS_SETTINGS_ACCOUNT_CURRENT_USER";
+ String.id.IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC = "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC = "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC = "IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC = "IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC = "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC = "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC = "IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_TITLE = "IDS_SETTINGS_ACCOUNT_TITLE";
+ String.id.IDS_SETTINGS_ACCOUNT_TITLE_TC = "IDS_SETTINGS_ACCOUNT_TITLE_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC = "IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC";
+ String.id.IDS_SETTINGS_CAPTIONS_AUTO_MUTED = "IDS_SETTINGS_CAPTIONS_AUTO_MUTED";
+ String.id.IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR = "IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR";
+ String.id.IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY = "IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY";
+ String.id.IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR = "IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR";
+ String.id.IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY = "IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY";
+ String.id.IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE = "IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_BLACK = "IDS_SETTINGS_CAPTIONS_COLOR_BLACK";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_BLUE = "IDS_SETTINGS_CAPTIONS_COLOR_BLUE";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_CYAN = "IDS_SETTINGS_CAPTIONS_COLOR_CYAN";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_GREEN = "IDS_SETTINGS_CAPTIONS_COLOR_GREEN";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA = "IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_RED = "IDS_SETTINGS_CAPTIONS_COLOR_RED";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_WHITE = "IDS_SETTINGS_CAPTIONS_COLOR_WHITE";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_YELLOW = "IDS_SETTINGS_CAPTIONS_COLOR_YELLOW";
+ String.id.IDS_SETTINGS_CAPTIONS_DEFAULT = "IDS_SETTINGS_CAPTIONS_DEFAULT";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE = "IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED = "IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_DROP = "IDS_SETTINGS_CAPTIONS_EDGE_DROP";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_NONE = "IDS_SETTINGS_CAPTIONS_EDGE_NONE";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_RAISED = "IDS_SETTINGS_CAPTIONS_EDGE_RAISED";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED = "IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_CASUAL = "IDS_SETTINGS_CAPTIONS_FONT_CASUAL";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_CURSIVE = "IDS_SETTINGS_CAPTIONS_FONT_CURSIVE";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS = "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF = "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS = "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF = "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS = "IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_STYLE = "IDS_SETTINGS_CAPTIONS_FONT_STYLE";
+ String.id.IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE = "IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE";
+ String.id.IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT = "IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT";
+ String.id.IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT = "IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT";
+ String.id.IDS_SETTINGS_CAPTIONS_PREVIEW = "IDS_SETTINGS_CAPTIONS_PREVIEW";
+ String.id.IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE = "IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE";
+ String.id.IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT = "IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_100 = "IDS_SETTINGS_CAPTIONS_SIZE_100";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_150 = "IDS_SETTINGS_CAPTIONS_SIZE_150";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_200 = "IDS_SETTINGS_CAPTIONS_SIZE_200";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_50 = "IDS_SETTINGS_CAPTIONS_SIZE_50";
+ String.id.IDS_SETTINGS_CAPTIONS_TITLE = "IDS_SETTINGS_CAPTIONS_TITLE";
+ String.id.IDS_SETTINGS_CAPTIONS_WINDOW_COLOR = "IDS_SETTINGS_CAPTIONS_WINDOW_COLOR";
+ String.id.IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY = "IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY";
+ String.id.IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE = "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE";
+ String.id.IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE = "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGMUSIC = "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGVIDEO = "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS = "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_CANCEL = "IDS_SETTINGS_FEEDBACK_CANCEL";
+ String.id.IDS_SETTINGS_FEEDBACK_CANTSIGNIN = "IDS_SETTINGS_FEEDBACK_CANTSIGNIN";
+ String.id.IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS = "IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW = "IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW";
+ String.id.IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION = "IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION";
+ String.id.IDS_SETTINGS_FEEDBACK_CONNECTED = "IDS_SETTINGS_FEEDBACK_CONNECTED";
+ String.id.IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS = "IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT = "IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT";
+ String.id.IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK = "IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK";
+ String.id.IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY = "IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY";
+ String.id.IDS_SETTINGS_FEEDBACK_DESCRIPTION = "IDS_SETTINGS_FEEDBACK_DESCRIPTION";
+ String.id.IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG = "IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG";
+ String.id.IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC = "IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO = "IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY = "IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY";
+ String.id.IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS = "IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_GENERALERRORS = "IDS_SETTINGS_FEEDBACK_GENERALERRORS";
+ String.id.IDS_SETTINGS_FEEDBACK_GHOSTTEXT = "IDS_SETTINGS_FEEDBACK_GHOSTTEXT";
+ String.id.IDS_SETTINGS_FEEDBACK_GREATAPP = "IDS_SETTINGS_FEEDBACK_GREATAPP";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICFORMAT = "IDS_SETTINGS_FEEDBACK_MUSICFORMAT";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS = "IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICMETADATA = "IDS_SETTINGS_FEEDBACK_MUSICMETADATA";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS = "IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_NOCONNECTION = "IDS_SETTINGS_FEEDBACK_NOCONNECTION";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE = "IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE = "IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION = "IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE = "IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_LIKE = "IDS_SETTINGS_FEEDBACK_OPTION_LIKE";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC = "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO = "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS = "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS = "IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS = "IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_REQUESTCONTENT = "IDS_SETTINGS_FEEDBACK_REQUESTCONTENT";
+ String.id.IDS_SETTINGS_FEEDBACK_SAS_TEXT = "IDS_SETTINGS_FEEDBACK_SAS_TEXT";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC = "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO = "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS = "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_SUBMIT = "IDS_SETTINGS_FEEDBACK_SUBMIT";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION = "IDS_SETTINGS_FEEDBACK_SUGGESTION";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS = "IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS = "IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC = "IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO = "IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC = "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO = "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_SYNC = "IDS_SETTINGS_FEEDBACK_SYNC";
+ String.id.IDS_SETTINGS_FEEDBACK_TITLE = "IDS_SETTINGS_FEEDBACK_TITLE";
+ String.id.IDS_SETTINGS_FEEDBACK_TRAILER = "IDS_SETTINGS_FEEDBACK_TRAILER";
+ String.id.IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS = "IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO = "IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_VIDEOFORMAT = "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT";
+ String.id.IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS = "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_WRONGMUSIC = "IDS_SETTINGS_FEEDBACK_WRONGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_WRONGVIDEO = "IDS_SETTINGS_FEEDBACK_WRONGVIDEO";
+ String.id.IDS_SETTINGS_FORGET_ME = "IDS_SETTINGS_FORGET_ME";
+ String.id.IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE = "IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE";
+ String.id.IDS_SETTINGS_HELP_TITLE = "IDS_SETTINGS_HELP_TITLE";
+ String.id.IDS_SETTINGS_IMPRINT_LEGAL_LINK_TITLE = "IDS_SETTINGS_IMPRINT_LEGAL_LINK_TITLE";
+ String.id.IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_SUBTITLE = "IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_SUBTITLE";
+ String.id.IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_TITLE = "IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_TITLE";
+ String.id.IDS_SETTINGS_ONEDRIVE_TITLE = "IDS_SETTINGS_ONEDRIVE_TITLE";
+ String.id.IDS_SETTINGS_PREFERENCE_ACCOUNT = "IDS_SETTINGS_PREFERENCE_ACCOUNT";
+ String.id.IDS_SETTINGS_PREFERENCE_TITLE = "IDS_SETTINGS_PREFERENCE_TITLE";
+ String.id.IDS_SETTINGS_PROMPT_TOGGLE_TITLE = "IDS_SETTINGS_PROMPT_TOGGLE_TITLE";
+ String.id.IDS_SETTINGS_RESET_CLOUD_SUBTITLE = "IDS_SETTINGS_RESET_CLOUD_SUBTITLE";
+ String.id.IDS_SETTINGS_RESET_CLOUD_TITLE = "IDS_SETTINGS_RESET_CLOUD_TITLE";
+ String.id.IDS_SETTINGS_SWITCH_USER = "IDS_SETTINGS_SWITCH_USER";
+ String.id.IDS_SETTINGS_SWITCH_USER_DESCRIPTION = "IDS_SETTINGS_SWITCH_USER_DESCRIPTION";
+ String.id.IDS_SETTINGS_TITLE = "IDS_SETTINGS_TITLE";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_ALBUM = "IDS_SHARE_EMPTY_MESSAGE_ALBUM";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_ARTIST = "IDS_SHARE_EMPTY_MESSAGE_ARTIST";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_MOVIE = "IDS_SHARE_EMPTY_MESSAGE_MOVIE";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_MUSIC = "IDS_SHARE_EMPTY_MESSAGE_MUSIC";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO = "IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TRACK = "IDS_SHARE_EMPTY_MESSAGE_TRACK";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE = "IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TV_SEASON = "IDS_SHARE_EMPTY_MESSAGE_TV_SEASON";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TV_SERIES = "IDS_SHARE_EMPTY_MESSAGE_TV_SERIES";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_VIDEO = "IDS_SHARE_EMPTY_MESSAGE_VIDEO";
+ String.id.IDS_SHARE_FILES_MUSIC_DESCRIPTION = "IDS_SHARE_FILES_MUSIC_DESCRIPTION";
+ String.id.IDS_SHARE_FRIEND_REQUEST = "IDS_SHARE_FRIEND_REQUEST";
+ String.id.IDS_SHARE_FRIEND_REQUEST_LINK = "IDS_SHARE_FRIEND_REQUEST_LINK";
+ String.id.IDS_SHARE_GAME_TEXT = "IDS_SHARE_GAME_TEXT";
+ String.id.IDS_SHARE_LEADER_BOARD_TEXT = "IDS_SHARE_LEADER_BOARD_TEXT";
+ String.id.IDS_SHARE_MORE_MICROSOFT_DOT_COM = "IDS_SHARE_MORE_MICROSOFT_DOT_COM";
+ String.id.IDS_SHARE_MORE_XBOX_DOT_COM = "IDS_SHARE_MORE_XBOX_DOT_COM";
+ String.id.IDS_SHARE_MORE_XBOXVIDEO_DOT_COM = "IDS_SHARE_MORE_XBOXVIDEO_DOT_COM";
+ String.id.IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL = "IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL";
+ String.id.IDS_SHARE_MUSIC_CONCATENATION = "IDS_SHARE_MUSIC_CONCATENATION";
+ String.id.IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL = "IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL";
+ String.id.IDS_SHARE_MUSIC_SONG_COUNT_PLURAL = "IDS_SHARE_MUSIC_SONG_COUNT_PLURAL";
+ String.id.IDS_SHARE_PROFILE = "IDS_SHARE_PROFILE";
+ String.id.IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT = "IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT";
+ String.id.IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT = "IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT";
+ String.id.IDS_SHARE_TELL_FRIEND_ADD = "IDS_SHARE_TELL_FRIEND_ADD";
+ String.id.IDS_SHOW_ALL_MODIFIER = "IDS_SHOW_ALL_MODIFIER";
+ String.id.IDS_SHOW_FEATURED_MODIFIER = "IDS_SHOW_FEATURED_MODIFIER";
+ String.id.IDS_SIGNIN_COMPLETE = "IDS_SIGNIN_COMPLETE";
+ String.id.IDS_SIGNIN_ERROR = "IDS_SIGNIN_ERROR";
+ String.id.IDS_SIGNIN_ERROR_CAPTION = "IDS_SIGNIN_ERROR_CAPTION";
+ String.id.IDS_SIGNIN_ERROR_MORE_INFO = "IDS_SIGNIN_ERROR_MORE_INFO";
+ String.id.IDS_SIGNIN_MIXED_REGION_ERROR_DESC = "IDS_SIGNIN_MIXED_REGION_ERROR_DESC";
+ String.id.IDS_SIGNIN_MIXED_REGION_ERROR_TITLE = "IDS_SIGNIN_MIXED_REGION_ERROR_TITLE";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT = "IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE = "IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT = "IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE = "IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE";
+ String.id.IDS_SIGNIN_PROGRESS = "IDS_SIGNIN_PROGRESS";
+ String.id.IDS_SIGNIN_RETRY = "IDS_SIGNIN_RETRY";
+ String.id.IDS_SMARTDJ_ERROR_CAPTION = "IDS_SMARTDJ_ERROR_CAPTION";
+ String.id.IDS_SNAPPED_DETAILS_OVERVIEW_TITLE = "IDS_SNAPPED_DETAILS_OVERVIEW_TITLE";
+ String.id.IDS_SNAPPED_DETAILS_PLAYLIST_TITLE = "IDS_SNAPPED_DETAILS_PLAYLIST_TITLE";
+ String.id.IDS_SNAPPED_DETAILS_POSTROLL_TITLE = "IDS_SNAPPED_DETAILS_POSTROLL_TITLE";
+ String.id.IDS_SNAPPED_DETAILS_RECOMMEND_LABEL = "IDS_SNAPPED_DETAILS_RECOMMEND_LABEL";
+ String.id.IDS_SNAPPED_DETAILS_REPLAY_LABEL = "IDS_SNAPPED_DETAILS_REPLAY_LABEL";
+ String.id.IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL = "IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL";
+ String.id.IDS_SNAPPED_GO_FULLSCREEN_MESSAGE = "IDS_SNAPPED_GO_FULLSCREEN_MESSAGE";
+ String.id.IDS_SNAPPED_MUSIC_GO_FULLSCREEN_TITLE = "IDS_SNAPPED_MUSIC_GO_FULLSCREEN_TITLE";
+ String.id.IDS_SNAPPED_MUSIC_HEADER = "IDS_SNAPPED_MUSIC_HEADER";
+ String.id.IDS_SNAPPED_MUSIC_UNSNAP_TEXT = "IDS_SNAPPED_MUSIC_UNSNAP_TEXT";
+ String.id.IDS_SNAPPED_VIDEO_GO_FULLSCREEN_TITLE = "IDS_SNAPPED_VIDEO_GO_FULLSCREEN_TITLE";
+ String.id.IDS_SNAPPED_VIDEO_UNSNAP_TEXT = "IDS_SNAPPED_VIDEO_UNSNAP_TEXT";
+ String.id.IDS_SOCIAL_PIVOT = "IDS_SOCIAL_PIVOT";
+ String.id.IDS_SORT_FILTER_CONTROL_ACC_FILTER = "IDS_SORT_FILTER_CONTROL_ACC_FILTER";
+ String.id.IDS_SORT_FILTER_CONTROL_ACC_SORT = "IDS_SORT_FILTER_CONTROL_ACC_SORT";
+ String.id.IDS_SORTED_BY = "IDS_SORTED_BY";
+ String.id.IDS_SWIPE_HORIZONTALLY_TO_SELECT = "IDS_SWIPE_HORIZONTALLY_TO_SELECT";
+ String.id.IDS_SWIPE_VERTICALLY_TO_SELECT = "IDS_SWIPE_VERTICALLY_TO_SELECT";
+ String.id.IDS_TIME_ARIA_ZERO = "IDS_TIME_ARIA_ZERO";
+ String.id.IDS_TIME_DISPLAY_ZERO = "IDS_TIME_DISPLAY_ZERO";
+ String.id.IDS_TITLE_SUBTITLE = "IDS_TITLE_SUBTITLE";
+ String.id.IDS_TOS_ACCEPT_BUTTON = "IDS_TOS_ACCEPT_BUTTON";
+ String.id.IDS_TOS_ACCEPT_CHECKBOX = "IDS_TOS_ACCEPT_CHECKBOX";
+ String.id.IDS_TOS_ACCEPT_ERROR = "IDS_TOS_ACCEPT_ERROR";
+ String.id.IDS_TOS_CANCEL = "IDS_TOS_CANCEL";
+ String.id.IDS_TOS_TEXT_HEADER = "IDS_TOS_TEXT_HEADER";
+ String.id.IDS_TOS_TITLE = "IDS_TOS_TITLE";
+ String.id.IDS_TOS_UPDATE_DESC = "IDS_TOS_UPDATE_DESC";
+ String.id.IDS_TOS_UPDATE_HEADER = "IDS_TOS_UPDATE_HEADER";
+ String.id.IDS_TOUCHPAD_SUBTITLE1 = "IDS_TOUCHPAD_SUBTITLE1";
+ String.id.IDS_TOUCHPAD_SUBTITLE2 = "IDS_TOUCHPAD_SUBTITLE2";
+ String.id.IDS_TOUCHPAD_TITLE = "IDS_TOUCHPAD_TITLE";
+ String.id.IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL = "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE = "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE";
+ String.id.IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON = "IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_MUTE_LABEL = "IDS_TRANSPORT_CONTROLS_MUTE_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_NEXT_BUTTON = "IDS_TRANSPORT_CONTROLS_NEXT_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON = "IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAY_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAY_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON = "IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON = "IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON = "IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL = "IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON = "IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL = "IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON = "IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON = "IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL = "IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON = "IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON";
+ String.id.IDS_TV_SEASON_NAME = "IDS_TV_SEASON_NAME";
+ String.id.IDS_TV_SEASON_NAME_LC = "IDS_TV_SEASON_NAME_LC";
+ String.id.IDS_UNKNOWN_VALUE = "IDS_UNKNOWN_VALUE";
+ String.id.IDS_UNPIN_FROM_START_SCREEN_BUTTON = "IDS_UNPIN_FROM_START_SCREEN_BUTTON";
+ String.id.IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION = "IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION";
+ String.id.IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT = "IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT";
+ String.id.IDS_VERSION_CHECK_SERVICE_TITLE = "IDS_VERSION_CHECK_SERVICE_TITLE";
+ String.id.IDS_VERSION_CHECK_SIGNIN_TEXT = "IDS_VERSION_CHECK_SIGNIN_TEXT";
+ String.id.IDS_VERSION_CHECK_UPGRADE_CAPTION = "IDS_VERSION_CHECK_UPGRADE_CAPTION";
+ String.id.IDS_VERSION_CHECK_UPGRADE_LINK = "IDS_VERSION_CHECK_UPGRADE_LINK";
+ String.id.IDS_VERSION_CHECK_UPGRADE_TEXT = "IDS_VERSION_CHECK_UPGRADE_TEXT";
+ String.id.IDS_VIDEO_APP_TITLE = "IDS_VIDEO_APP_TITLE";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY = "IDS_VIDEO_COLLECTION_EMPTY";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK = "IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK = "IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK";
+ String.id.IDS_VIDEO_FEATURED_PIVOT = "IDS_VIDEO_FEATURED_PIVOT";
+ String.id.IDS_VIDEO_GENRES_PIVOT = "IDS_VIDEO_GENRES_PIVOT";
+ String.id.IDS_VIDEO_NETWORKS_PIVOT = "IDS_VIDEO_NETWORKS_PIVOT";
+ String.id.IDS_VIDEO_NEW_RELEASES_PIVOT = "IDS_VIDEO_NEW_RELEASES_PIVOT";
+ String.id.IDS_VIDEO_PIVOT = "IDS_VIDEO_PIVOT";
+ String.id.IDS_VIDEO_STUDIOS_PIVOT = "IDS_VIDEO_STUDIOS_PIVOT";
+ String.id.IDS_VIDEO_TOP_SELLING_PIVOT = "IDS_VIDEO_TOP_SELLING_PIVOT";
+ String.id.IDS_VIDEO_TV_FREE_EPISODES_PIVOT = "IDS_VIDEO_TV_FREE_EPISODES_PIVOT";
+ String.id.IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT = "IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT";
+ String.id.IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK = "IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK";
+ String.id.IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK = "IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK";
+ String.id.IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK = "IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK";
+ String.id.IDS_VIEW_ALL = "IDS_VIEW_ALL";
+ String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT = "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT";
+ String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION = "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION";
+ String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE = "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE";
+ String.id.IDS_WEBHOST_RESIZE_WINDOW_BODY = "IDS_WEBHOST_RESIZE_WINDOW_BODY";
+ String.id.IDS_WEBHOST_RESIZE_WINDOW_TITLE = "IDS_WEBHOST_RESIZE_WINDOW_TITLE";
+ String.id.IDS_WEBHOST_ROTATE_BODY = "IDS_WEBHOST_ROTATE_BODY";
+ String.id.IDS_WEBHOST_ROTATE_OR_RESIZE_BODY = "IDS_WEBHOST_ROTATE_OR_RESIZE_BODY";
+ String.id.IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY = "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY";
+ String.id.IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE = "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE";
+ String.id.IDS_WEBHOST_ROTATE_TITLE = "IDS_WEBHOST_ROTATE_TITLE";
+ String.id.IDS_WHATSNEW_NOTIFICATION_SUBTITLE = "IDS_WHATSNEW_NOTIFICATION_SUBTITLE";
+ String.id.IDS_WHATSNEW_POPUP_LINK = "IDS_WHATSNEW_POPUP_LINK";
+ String.id.IDS_WILD_CARD_SYMBOL = "IDS_WILD_CARD_SYMBOL";
+ String.id.IDS_XBOX_GET_FOR_XBOX = "IDS_XBOX_GET_FOR_XBOX";
+ String.id.IDS_XBOX_MUSIC_APP_TITLE = "IDS_XBOX_MUSIC_APP_TITLE";
+ String.id.IDS_XBOX_MUSIC2_APP_TITLE = "IDS_XBOX_MUSIC2_APP_TITLE";
+ String.id.IDS_XBOX_PLAY_TO_DEVICE = "IDS_XBOX_PLAY_TO_DEVICE";
+ String.id.IDS_XBOX_VIDEO_APP_TITLE = "IDS_XBOX_VIDEO_APP_TITLE";
+ String.id.IDS_XBOX_VIDEO2_APP_TITLE = "IDS_XBOX_VIDEO2_APP_TITLE";
+ String.id.IDS_YES_BUTTON = "IDS_YES_BUTTON";
+
+ })();
+})();
+/* >>>>>>/framework/nativestringids.js:6967 */
+(function () {
+ /////////////////////////////////////////////////////////////////////////////
+ //
+ // nativeStringIds.js
+ //
+ // This file was generated by the Stringer tool. Do not edit it!
+ //
+ // Copyright (C) Microsoft Corporation. All rights reserved.
+ //
+ /////////////////////////////////////////////////////////////////////////////
+
+ (function () {
+
+ String.id = String.id || {}
+
+ String.id.IDS_MEDIASTORE_UNKNOWN_TRACK_FORMAT = "101";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ALBUM_FORMAT = "102";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ALBUM_PREFIX = "103";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ARTIST = "104";
+ String.id.IDS_MEDIASTORE_UNKNOWN_TRACK_PREFIX = "105";
+ String.id.IDS_MEDIASTORE_IGNORED_ARTICLE_LIST = "106";
+ String.id.IDS_MEDIASTORE_VARIOUS_ARTISTS = "108";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ALBUM = "109";
+ String.id.IDS_MEDIASTORE_UNKNOWN_GENRE = "110";
+ String.id.IDS_CDMDRCD_FORMAT_STRING = "213";
+ String.id.IDS_SERVICE_UNKNOWNTRACK = "250";
+ String.id.IDS_SERVICE_UNKNOWNARTIST = "251";
+ String.id.IDS_SERVICE_UNKNOWNALBUM = "252";
+ String.id.IDS_SERVICE_FILENAME_FORMAT_NO_DISC = "256";
+ String.id.IDS_SERVICE_FILENAME_FORMAT_WITH_DISC = "257";
+ String.id.IDS_SERVICE_UNKNOWNSERIES = "258";
+ String.id.IDS_SERVICE_UNKNOWNVIDEO = "259";
+ String.id.IDS_SERIES_UNKNOWNSERIES_TITLE = "260";
+ String.id.IDS_SERIES_UNKNOWNSERIES_DESCRIPTION = "261";
+ String.id.IDS_SERIES_GROVELLED_SERIES_DESCRIPTION = "262";
+ String.id.IDS_PLAYLISTFOLDERNAME = "27";
+ String.id.IDS_TEMPORARY_MUSIC_FOLDER_SUFFIX = "30";
+ String.id.IDS_DOWNLOAD_FOLDER_MUSIC = "320";
+ String.id.IDS_DOWNLOAD_FOLDER_TV = "321";
+ String.id.IDS_DOWNLOAD_FOLDER_TV_SHORT = "322";
+ String.id.IDS_DOWNLOAD_FOLDER_FORMAT_TV_SEASON = "323";
+ String.id.IDS_DOWNLOAD_FOLDER_MOVIES = "324";
+ String.id.IDS_DOWNLOAD_FOLDER_SUBSCRIPTION = "325";
+ String.id.IDS_DOWNLOAD_FOLDER_PURCHASES = "326";
+ String.id.IDS_DOWNLOAD_FOLDER_XBOX_MUSIC = "327";
+ String.id.IDS_DOWNLOAD_FOLDER_OFFLINE_CONTENT = "328";
+ String.id.IDS_DOWNLOAD_FOLDER_NAME = "329";
+ String.id.IDS_TITLE_SUBTITLE_NATIVE = "33";
+ String.id.IDS_CHANNEL_PLAYLIST_NAME_FORMAT = "360";
+ String.id.IDS_GENRE_AUDIOBOOK_0 = "361";
+ String.id.IDS_GENRE_AUDIOBOOK_1 = "362";
+ String.id.IDS_GENRE_COMEDY_SPOKEN_WORD = "363";
+ String.id.IDS_GENRE_PODCAST = "364";
+ String.id.IDS_SUBSTRING_KARAOKE = "365";
+ String.id.IDS_UAC_DIALOG_LOG_LEVELS_DESCRIPTION = "5000";
+ String.id.IDS_JUMP_LIST_QUICKMIX_CATEGORY = "607";
+ String.id.IDS_JUMP_LIST_RESUME_NOWPLAYING = "609";
+ String.id.IDS_JUMP_LIST_SHUFFLE_ALL = "610";
+ String.id.IDS_PODCAST_LIBRARY_NAME = "611";
+ String.id.IDS_PODCAST_LIBRARY_DESC = "612";
+ String.id.IDS_PODCAST_LIBRARY_TOOLTIP = "613";
+ String.id.IDS_CONVERSION_CACHE_NAME = "618";
+ String.id.IDS_ONEDRIVE_CACHE_FOLDER_NAME = "619";
+
+ })();
+})();
+/* >>>>>>/framework/lockedstringids.js:7034 */
+(function () {
+ /////////////////////////////////////////////////////////////////////////////
+ //
+ // lockedStringIds.js
+ //
+ // This file was generated by the Stringer tool. Do not edit it!
+ //
+ // Copyright (C) Microsoft Corporation. All rights reserved.
+ //
+ /////////////////////////////////////////////////////////////////////////////
+
+ (function () {
+
+ String.id = String.id || {}
+
+ String.id.IDS_MUSIC_ONEDRIVE_ANNOUNCEMENT = "IDS_MUSIC_ONEDRIVE_ANNOUNCEMENT";
+
+ })();
+})();
+/* >>>>>>/framework/musicstringids.js:7054 */
+(function () {
+ /////////////////////////////////////////////////////////////////////////////
+ //
+ // musicStringIds.js
+ //
+ // This file was generated by the Stringer tool. Do not edit it!
+ //
+ // Copyright (C) Microsoft Corporation. All rights reserved.
+ //
+ /////////////////////////////////////////////////////////////////////////////
+
+ (function () {
+
+ String.id = String.id || {}
+
+ String.id.IDS_APP_UPDATE_SPLASH_SUBTITLE = "IDS_APP_UPDATE_SPLASH_SUBTITLE";
+ String.id.IDS_APP_UPDATE_SPLASH_TITLE = "IDS_APP_UPDATE_SPLASH_TITLE";
+ String.id.IDS_COLLECTION_BY_ALBUM_TITLE = "IDS_COLLECTION_BY_ALBUM_TITLE";
+ String.id.IDS_COLLECTION_BY_ARTIST_TITLE = "IDS_COLLECTION_BY_ARTIST_TITLE";
+ String.id.IDS_COLLECTION_BY_SONG_TITLE = "IDS_COLLECTION_BY_SONG_TITLE";
+ String.id.IDS_COLLECTION_FILTER_ALL = "IDS_COLLECTION_FILTER_ALL";
+ String.id.IDS_COLLECTION_FILTER_ALL_MUSIC = "IDS_COLLECTION_FILTER_ALL_MUSIC";
+ String.id.IDS_COLLECTION_FILTER_ALL_SC = "IDS_COLLECTION_FILTER_ALL_SC";
+ String.id.IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE = "IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE";
+ String.id.IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE_SC = "IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE_SC";
+ String.id.IDS_COLLECTION_FILTER_FLYOUT_CLOUDV2 = "IDS_COLLECTION_FILTER_FLYOUT_CLOUDV2";
+ String.id.IDS_COLLECTION_FILTER_FLYOUT_OFFLINE = "IDS_COLLECTION_FILTER_FLYOUT_OFFLINE";
+ String.id.IDS_COLLECTION_FILTER_FROM_XBOX_MUSIC = "IDS_COLLECTION_FILTER_FROM_XBOX_MUSIC";
+ String.id.IDS_COLLECTION_FILTER_IN_CLOUD = "IDS_COLLECTION_FILTER_IN_CLOUD";
+ String.id.IDS_COLLECTION_FILTER_IN_CLOUD_SC = "IDS_COLLECTION_FILTER_IN_CLOUD_SC";
+ String.id.IDS_COLLECTION_FILTER_MUSIC_EMPTY_LINK = "IDS_COLLECTION_FILTER_MUSIC_EMPTY_LINK";
+ String.id.IDS_COLLECTION_FILTER_MUSIC_EMPTY_TEXT = "IDS_COLLECTION_FILTER_MUSIC_EMPTY_TEXT";
+ String.id.IDS_COLLECTION_FILTER_ON_ONEDRIVE = "IDS_COLLECTION_FILTER_ON_ONEDRIVE";
+ String.id.IDS_COLLECTION_FILTER_ON_ONEDRIVE_SC = "IDS_COLLECTION_FILTER_ON_ONEDRIVE_SC";
+ String.id.IDS_COLLECTION_FILTER_ONLY_ON_PC = "IDS_COLLECTION_FILTER_ONLY_ON_PC";
+ String.id.IDS_COLLECTION_FILTER_ONLY_ON_PC_SC = "IDS_COLLECTION_FILTER_ONLY_ON_PC_SC";
+ String.id.IDS_COLLECTION_FILTER_OWNED_MUSIC = "IDS_COLLECTION_FILTER_OWNED_MUSIC";
+ String.id.IDS_COLLECTION_FILTER_PURCHASED = "IDS_COLLECTION_FILTER_PURCHASED";
+ String.id.IDS_COLLECTION_FILTER_PURCHASED_SC = "IDS_COLLECTION_FILTER_PURCHASED_SC";
+ String.id.IDS_COLLECTION_FILTER_STREAMING = "IDS_COLLECTION_FILTER_STREAMING";
+ String.id.IDS_COLLECTION_FILTER_STREAMING_SC = "IDS_COLLECTION_FILTER_STREAMING_SC";
+ String.id.IDS_DETAILS_FILTER_AVAILABLE_OFFLINE = "IDS_DETAILS_FILTER_AVAILABLE_OFFLINE";
+ String.id.IDS_DETAILS_FILTER_FROM_XBOX_MUSIC = "IDS_DETAILS_FILTER_FROM_XBOX_MUSIC";
+ String.id.IDS_DETAILS_FILTER_IN_CLOUD = "IDS_DETAILS_FILTER_IN_CLOUD";
+ String.id.IDS_DETAILS_FILTER_ON_ONEDRIVE = "IDS_DETAILS_FILTER_ON_ONEDRIVE";
+ String.id.IDS_DETAILS_FILTER_ON_PC = "IDS_DETAILS_FILTER_ON_PC";
+ String.id.IDS_DETAILS_FILTER_PURCHASED = "IDS_DETAILS_FILTER_PURCHASED";
+ String.id.IDS_DETAILS_FILTER_STREAMING = "IDS_DETAILS_FILTER_STREAMING";
+ String.id.IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE = "IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE";
+ String.id.IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE_FREE = "IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE_FREE";
+ String.id.IDS_FAI_ADD_ALBUM_CLOUD_TITLE = "IDS_FAI_ADD_ALBUM_CLOUD_TITLE";
+ String.id.IDS_FAI_ADD_ALBUM_LEARN_MORE = "IDS_FAI_ADD_ALBUM_LEARN_MORE";
+ String.id.IDS_FAI_ALBUM_COLUMN_TITLE = "IDS_FAI_ALBUM_COLUMN_TITLE";
+ String.id.IDS_FAI_ALBUM_SUMMARY_2 = "IDS_FAI_ALBUM_SUMMARY_2";
+ String.id.IDS_FAI_ALBUM_SUMMARY_3 = "IDS_FAI_ALBUM_SUMMARY_3";
+ String.id.IDS_FAI_ALBUM_SUMMARY_3_PLURAL = "IDS_FAI_ALBUM_SUMMARY_3_PLURAL";
+ String.id.IDS_FAI_ALBUM_SUMMARY_4_PLURAL = "IDS_FAI_ALBUM_SUMMARY_4_PLURAL";
+ String.id.IDS_FAI_AVAILABLE_TRACKS = "IDS_FAI_AVAILABLE_TRACKS";
+ String.id.IDS_FAI_CANCEL_BUTTON = "IDS_FAI_CANCEL_BUTTON";
+ String.id.IDS_FAI_CHOOSE_ALBUM_CLOUD_TITLE = "IDS_FAI_CHOOSE_ALBUM_CLOUD_TITLE";
+ String.id.IDS_FAI_CHOOSE_ALBUM_TITLE = "IDS_FAI_CHOOSE_ALBUM_TITLE";
+ String.id.IDS_FAI_CLOUD_MATCH_BULK_LINK = "IDS_FAI_CLOUD_MATCH_BULK_LINK";
+ String.id.IDS_FAI_CLOUD_MATCH_SUBTEXT = "IDS_FAI_CLOUD_MATCH_SUBTEXT";
+ String.id.IDS_FAI_FINISH_BUTTON = "IDS_FAI_FINISH_BUTTON";
+ String.id.IDS_FAI_MATCH = "IDS_FAI_MATCH";
+ String.id.IDS_FAI_MATCH_ALBUM_COMMAND = "IDS_FAI_MATCH_ALBUM_COMMAND";
+ String.id.IDS_FAI_MATCH_COLUMN_TITLE = "IDS_FAI_MATCH_COLUMN_TITLE";
+ String.id.IDS_FAI_MATCH_SONGS_SUBTITLE = "IDS_FAI_MATCH_SONGS_SUBTITLE";
+ String.id.IDS_FAI_MATCH_SONGS_TITLE = "IDS_FAI_MATCH_SONGS_TITLE";
+ String.id.IDS_FAI_MATCHED_SONGS = "IDS_FAI_MATCHED_SONGS";
+ String.id.IDS_FAI_NEXT_BUTTON = "IDS_FAI_NEXT_BUTTON";
+ String.id.IDS_FAI_NO_ALBUM_FOUND_ERROR = "IDS_FAI_NO_ALBUM_FOUND_ERROR";
+ String.id.IDS_FAI_NO_SONGS_MATCHED_ERROR = "IDS_FAI_NO_SONGS_MATCHED_ERROR";
+ String.id.IDS_FAI_NO_STREAMS_MATCHED_ERROR = "IDS_FAI_NO_STREAMS_MATCHED_ERROR";
+ String.id.IDS_FAI_ORIGINAL_TRACK = "IDS_FAI_ORIGINAL_TRACK";
+ String.id.IDS_FAI_SEARCH_ALBUM_HINT = "IDS_FAI_SEARCH_ALBUM_HINT";
+ String.id.IDS_FAI_SEARCH_ALBUM_TITLE = "IDS_FAI_SEARCH_ALBUM_TITLE";
+ String.id.IDS_FAI_SONG_COLUMN_TITLE = "IDS_FAI_SONG_COLUMN_TITLE";
+ String.id.IDS_FAI_UNMATCHED_SONGS = "IDS_FAI_UNMATCHED_SONGS";
+ String.id.IDS_FIND_ALBUM_INFO_COMMAND = "IDS_FIND_ALBUM_INFO_COMMAND";
+ String.id.IDS_MARKETPLACE_BY_ALBUM = "IDS_MARKETPLACE_BY_ALBUM";
+ String.id.IDS_MARKETPLACE_BY_ARTIST = "IDS_MARKETPLACE_BY_ARTIST";
+ String.id.IDS_MARKETPLACE_BY_RELEASE_DATE = "IDS_MARKETPLACE_BY_RELEASE_DATE";
+ String.id.IDS_MARKETPLACE_SORT_PREFIX = "IDS_MARKETPLACE_SORT_PREFIX";
+ String.id.IDS_MATCH_ALBUM_INFO_COMMAND = "IDS_MATCH_ALBUM_INFO_COMMAND";
+ String.id.IDS_MUSIC_ABOUT_PANEL_TEXT = "IDS_MUSIC_ABOUT_PANEL_TEXT";
+ String.id.IDS_MUSIC_ABOUT_PANEL_TEXT_LC = "IDS_MUSIC_ABOUT_PANEL_TEXT_LC";
+ String.id.IDS_MUSIC_ADD_ALBUM_TO_LIST_TITLE_PLURAL = "IDS_MUSIC_ADD_ALBUM_TO_LIST_TITLE_PLURAL";
+ String.id.IDS_MUSIC_ADD_MUSIC_VIDEO_TO_LIST_TITLE_PLURAL = "IDS_MUSIC_ADD_MUSIC_VIDEO_TO_LIST_TITLE_PLURAL";
+ String.id.IDS_MUSIC_ADD_PLAYLIST_TO_LIST_TITLE = "IDS_MUSIC_ADD_PLAYLIST_TO_LIST_TITLE";
+ String.id.IDS_MUSIC_ADD_SONG_TO_LIST_TITLE_PLURAL = "IDS_MUSIC_ADD_SONG_TO_LIST_TITLE_PLURAL";
+ String.id.IDS_MUSIC_ADD_TO_COLLECTION_BUTTON = "IDS_MUSIC_ADD_TO_COLLECTION_BUTTON";
+ String.id.IDS_MUSIC_ADD_TO_LIST_BUTTON = "IDS_MUSIC_ADD_TO_LIST_BUTTON";
+ String.id.IDS_MUSIC_ADD_TO_LIST_CLOUD_ACTION = "IDS_MUSIC_ADD_TO_LIST_CLOUD_ACTION";
+ String.id.IDS_MUSIC_ADD_TO_LIST_CLOUD_COLLECTION_ACTION = "IDS_MUSIC_ADD_TO_LIST_CLOUD_COLLECTION_ACTION";
+ String.id.IDS_MUSIC_ADD_TO_LIST_COLLECTION_ACTION = "IDS_MUSIC_ADD_TO_LIST_COLLECTION_ACTION";
+ String.id.IDS_MUSIC_ADD_TO_LIST_DEVICES_ACTION = "IDS_MUSIC_ADD_TO_LIST_DEVICES_ACTION";
+ String.id.IDS_MUSIC_ADD_TO_LIST_NEW_PLAYLIST_ACTION = "IDS_MUSIC_ADD_TO_LIST_NEW_PLAYLIST_ACTION";
+ String.id.IDS_MUSIC_ADD_TO_LIST_NOW_PLAYING_ACTION = "IDS_MUSIC_ADD_TO_LIST_NOW_PLAYING_ACTION";
+ String.id.IDS_MUSIC_ADD_TO_LIST_PLAYLIST_ACTION = "IDS_MUSIC_ADD_TO_LIST_PLAYLIST_ACTION";
+ String.id.IDS_MUSIC_ADD_TO_LIST_TITLE = "IDS_MUSIC_ADD_TO_LIST_TITLE";
+ String.id.IDS_MUSIC_ADD_TO_MY_MUSIC_BUTTON = "IDS_MUSIC_ADD_TO_MY_MUSIC_BUTTON";
+ String.id.IDS_MUSIC_ADD_TO_PLAYLIST_TITLE = "IDS_MUSIC_ADD_TO_PLAYLIST_TITLE";
+ String.id.IDS_MUSIC_ALBUM_BY_ARTIST = "IDS_MUSIC_ALBUM_BY_ARTIST";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_ONLY_PURCHASE_TEXT = "IDS_MUSIC_ALBUM_ONLY_PURCHASE_TEXT";
+ String.id.IDS_MUSIC_ALBUM_SORT = "IDS_MUSIC_ALBUM_SORT";
+ String.id.IDS_MUSIC_ALBUMS_IN_COLLECTION = "IDS_MUSIC_ALBUMS_IN_COLLECTION";
+ String.id.IDS_MUSIC_ARTIST_BIO_TITLE = "IDS_MUSIC_ARTIST_BIO_TITLE";
+ String.id.IDS_MUSIC_ARTIST_BIO_TITLE_TC = "IDS_MUSIC_ARTIST_BIO_TITLE_TC";
+ String.id.IDS_MUSIC_BUY_TEXT = "IDS_MUSIC_BUY_TEXT";
+ String.id.IDS_MUSIC_BY_ARTIST = "IDS_MUSIC_BY_ARTIST";
+ String.id.IDS_MUSIC_CLOUD_COLLECTION_ICON_HEADER = "IDS_MUSIC_CLOUD_COLLECTION_ICON_HEADER";
+ String.id.IDS_MUSIC_CLOUD_ICON_CLOSE_BUTTON = "IDS_MUSIC_CLOUD_ICON_CLOSE_BUTTON";
+ String.id.IDS_MUSIC_CLOUD_ICON_CLOUD_HEADER = "IDS_MUSIC_CLOUD_ICON_CLOUD_HEADER";
+ String.id.IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_FREE = "IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_FREE";
+ String.id.IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_XMP = "IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_XMP";
+ String.id.IDS_MUSIC_CLOUD_ICON_HEADER = "IDS_MUSIC_CLOUD_ICON_HEADER";
+ String.id.IDS_MUSIC_CLOUD_ICON_LEARN_MORE_TEXT = "IDS_MUSIC_CLOUD_ICON_LEARN_MORE_TEXT";
+ String.id.IDS_MUSIC_CLOUD_ICON_NONE_HEADER = "IDS_MUSIC_CLOUD_ICON_NONE_HEADER";
+ String.id.IDS_MUSIC_CLOUD_ICON_NONE_PARA_1 = "IDS_MUSIC_CLOUD_ICON_NONE_PARA_1";
+ String.id.IDS_MUSIC_CLOUD_ICON_NONE_PARA_1_ALT = "IDS_MUSIC_CLOUD_ICON_NONE_PARA_1_ALT";
+ String.id.IDS_MUSIC_CLOUD_ICON_STREAM_HEADER = "IDS_MUSIC_CLOUD_ICON_STREAM_HEADER";
+ String.id.IDS_MUSIC_CLOUD_ICON_STREAM_LINK = "IDS_MUSIC_CLOUD_ICON_STREAM_LINK";
+ String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_FREE = "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_FREE";
+ String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_XMP = "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_XMP";
+ String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_FREE = "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_FREE";
+ String.id.IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_XMP = "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_XMP";
+ String.id.IDS_MUSIC_CLOUD_ICON_SUB_HEADER = "IDS_MUSIC_CLOUD_ICON_SUB_HEADER";
+ String.id.IDS_MUSIC_CLOUD_MATCH_ACCEPT_BUTTON = "IDS_MUSIC_CLOUD_MATCH_ACCEPT_BUTTON";
+ String.id.IDS_MUSIC_CLOUD_MATCH_CANCEL_BUTTON = "IDS_MUSIC_CLOUD_MATCH_CANCEL_BUTTON";
+ String.id.IDS_MUSIC_CLOUD_MATCH_FOOTER_ALT_FREE = "IDS_MUSIC_CLOUD_MATCH_FOOTER_ALT_FREE";
+ String.id.IDS_MUSIC_CLOUD_MATCH_FOOTER_FREE = "IDS_MUSIC_CLOUD_MATCH_FOOTER_FREE";
+ String.id.IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_ALT_FREE = "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_ALT_FREE";
+ String.id.IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_FREE = "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_FREE";
+ String.id.IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_XMP = "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_XMP";
+ String.id.IDS_MUSIC_CLOUD_MATCH_FOOTER_XMP = "IDS_MUSIC_CLOUD_MATCH_FOOTER_XMP";
+ String.id.IDS_MUSIC_CLOUD_MATCH_HEADER = "IDS_MUSIC_CLOUD_MATCH_HEADER";
+ String.id.IDS_MUSIC_CLOUD_MATCH_PARA_1_FREE = "IDS_MUSIC_CLOUD_MATCH_PARA_1_FREE";
+ String.id.IDS_MUSIC_CLOUD_MATCH_PARA_1_XMP = "IDS_MUSIC_CLOUD_MATCH_PARA_1_XMP";
+ String.id.IDS_MUSIC_CLOUD_MATCH_PARA_2_FREE = "IDS_MUSIC_CLOUD_MATCH_PARA_2_FREE";
+ String.id.IDS_MUSIC_CLOUD_MATCH_PARA_2_XMP = "IDS_MUSIC_CLOUD_MATCH_PARA_2_XMP";
+ String.id.IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_FREE = "IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_FREE";
+ String.id.IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_XMP = "IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_XMP";
+ String.id.IDS_MUSIC_CLOUD_SETTINGS_ICON_INFO_LINK_TEXT = "IDS_MUSIC_CLOUD_SETTINGS_ICON_INFO_LINK_TEXT";
+ String.id.IDS_MUSIC_CLOUD_SETTINGS_MATCH_INFO_LINK_TEXT = "IDS_MUSIC_CLOUD_SETTINGS_MATCH_INFO_LINK_TEXT";
+ String.id.IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC = "IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC";
+ String.id.IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC_ALT = "IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC_ALT";
+ String.id.IDS_MUSIC_COLLECTION_ALPHA_SORT = "IDS_MUSIC_COLLECTION_ALPHA_SORT";
+ String.id.IDS_MUSIC_COLLECTION_ARTIST_SORT = "IDS_MUSIC_COLLECTION_ARTIST_SORT";
+ String.id.IDS_MUSIC_COLLECTION_DATEADDED_SORT = "IDS_MUSIC_COLLECTION_DATEADDED_SORT";
+ String.id.IDS_MUSIC_COLLECTION_DATEEDITED_SORT = "IDS_MUSIC_COLLECTION_DATEEDITED_SORT";
+ String.id.IDS_MUSIC_COLLECTION_DATEPLAYED_SORT = "IDS_MUSIC_COLLECTION_DATEPLAYED_SORT";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_HEADING = "IDS_MUSIC_COLLECTION_EMPTY_HEADING";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING1 = "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING1";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING2 = "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING2";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING3 = "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING3";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT1 = "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT1";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT2 = "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT2";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT3 = "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT3";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_TEXT = "IDS_MUSIC_COLLECTION_EMPTY_TEXT";
+ String.id.IDS_MUSIC_COLLECTION_EXPLORE_ALBUM = "IDS_MUSIC_COLLECTION_EXPLORE_ALBUM";
+ String.id.IDS_MUSIC_COLLECTION_GROVEL_HEADING = "IDS_MUSIC_COLLECTION_GROVEL_HEADING";
+ String.id.IDS_MUSIC_COLLECTION_GROVEL_TEXT = "IDS_MUSIC_COLLECTION_GROVEL_TEXT";
+ String.id.IDS_MUSIC_COLLECTION_RATING_SORT = "IDS_MUSIC_COLLECTION_RATING_SORT";
+ String.id.IDS_MUSIC_COLLECTION_RELEASEYEAR_SORT = "IDS_MUSIC_COLLECTION_RELEASEYEAR_SORT";
+ String.id.IDS_MUSIC_COLLECTION_SONGS_PANEL_TEXT_LC = "IDS_MUSIC_COLLECTION_SONGS_PANEL_TEXT_LC";
+ String.id.IDS_MUSIC_COLLECTION_TITLE = "IDS_MUSIC_COLLECTION_TITLE";
+ String.id.IDS_MUSIC_COLLECTION_TITLE_LC = "IDS_MUSIC_COLLECTION_TITLE_LC";
+ String.id.IDS_MUSIC_CONTENT_NOT_AVAILABLE_BUTTON = "IDS_MUSIC_CONTENT_NOT_AVAILABLE_BUTTON";
+ String.id.IDS_MUSIC_CREATE_PLAYLIST = "IDS_MUSIC_CREATE_PLAYLIST";
+ String.id.IDS_MUSIC_DATA_PROVIDER_BANDPAGE = "IDS_MUSIC_DATA_PROVIDER_BANDPAGE";
+ String.id.IDS_MUSIC_DATA_PROVIDER_ECHONEST = "IDS_MUSIC_DATA_PROVIDER_ECHONEST";
+ String.id.IDS_MUSIC_DATA_PROVIDER_GRACENOTE = "IDS_MUSIC_DATA_PROVIDER_GRACENOTE";
+ String.id.IDS_MUSIC_DATA_PROVIDER_ROVI = "IDS_MUSIC_DATA_PROVIDER_ROVI";
+ String.id.IDS_MUSIC_DATE_CHANGED_TEXT = "IDS_MUSIC_DATE_CHANGED_TEXT";
+ String.id.IDS_MUSIC_DEEPLINK_ERROR_GENERIC_DESC = "IDS_MUSIC_DEEPLINK_ERROR_GENERIC_DESC";
+ String.id.IDS_MUSIC_DEEPLINK_ERROR_GENERIC_TITLE = "IDS_MUSIC_DEEPLINK_ERROR_GENERIC_TITLE";
+ String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_DESC = "IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_DESC";
+ String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_TITLE = "IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_TITLE";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_MIXED_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_MIXED_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_ONEDRIVE_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_ONEDRIVE_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_MIXED_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_MIXED_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_ONEDRIVE_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_ONEDRIVE_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_ALBUMS_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_ALBUMS_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM = "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM_WITH_LOCAL = "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM_WITH_LOCAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK = "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK_WITH_LOCAL = "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK_WITH_LOCAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_TRACKS_PLURAL = "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_TRACKS_PLURAL";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_LIBRARY = "IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_LIBRARY";
+ String.id.IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_ONEDRIVE = "IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_ONEDRIVE";
+ String.id.IDS_MUSIC_DELETE_DIALOG_HEADING_MULTIPLE = "IDS_MUSIC_DELETE_DIALOG_HEADING_MULTIPLE";
+ String.id.IDS_MUSIC_DELETE_DIALOG_HEADING_SINGLE = "IDS_MUSIC_DELETE_DIALOG_HEADING_SINGLE";
+ String.id.IDS_MUSIC_DISCOGRAPHY_TITLE = "IDS_MUSIC_DISCOGRAPHY_TITLE";
+ String.id.IDS_MUSIC_DONT_SHOW_AGAIN_MESSAGE = "IDS_MUSIC_DONT_SHOW_AGAIN_MESSAGE";
+ String.id.IDS_MUSIC_DOWNLOAD_COMPLETE = "IDS_MUSIC_DOWNLOAD_COMPLETE";
+ String.id.IDS_MUSIC_DOWNLOAD_ERROR = "IDS_MUSIC_DOWNLOAD_ERROR";
+ String.id.IDS_MUSIC_DOWNLOAD_ERROR_NOTIFICATION = "IDS_MUSIC_DOWNLOAD_ERROR_NOTIFICATION";
+ String.id.IDS_MUSIC_DOWNLOAD_NOTIFICATION = "IDS_MUSIC_DOWNLOAD_NOTIFICATION";
+ String.id.IDS_MUSIC_DOWNLOAD_PROGRESS_SONGS_PLURAL = "IDS_MUSIC_DOWNLOAD_PROGRESS_SONGS_PLURAL";
+ String.id.IDS_MUSIC_DOWNLOAD_VIEW_ALBUM = "IDS_MUSIC_DOWNLOAD_VIEW_ALBUM";
+ String.id.IDS_MUSIC_ECHONEST_ALT_TEXT = "IDS_MUSIC_ECHONEST_ALT_TEXT";
+ String.id.IDS_MUSIC_EMPTY_PLAYLIST = "IDS_MUSIC_EMPTY_PLAYLIST";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_ENTER = "IDS_MUSIC_ENGAGE_ARTIST_ENTER";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_ENTER_BUTTON_UC = "IDS_MUSIC_ENGAGE_ARTIST_ENTER_BUTTON_UC";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_PLAY = "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_PLAY";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_RADIO = "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_RADIO";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_SMARTDJ = "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_SMARTDJ";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_TEXT = "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_TEXT";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_NONE_UC = "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_NONE_UC";
+ String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_UC = "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_UC";
+ String.id.IDS_MUSIC_ENGAGE_FREE_STREAM_DESC = "IDS_MUSIC_ENGAGE_FREE_STREAM_DESC";
+ String.id.IDS_MUSIC_ENGAGE_FREE_STREAM_TITLE = "IDS_MUSIC_ENGAGE_FREE_STREAM_TITLE";
+ String.id.IDS_MUSIC_ENGAGE_NEW_RADIO_ACTION = "IDS_MUSIC_ENGAGE_NEW_RADIO_ACTION";
+ String.id.IDS_MUSIC_ENGAGE_NEW_RADIO_FREE_DESC = "IDS_MUSIC_ENGAGE_NEW_RADIO_FREE_DESC";
+ String.id.IDS_MUSIC_ENGAGE_NEW_SMARTDJ_ACTION = "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_ACTION";
+ String.id.IDS_MUSIC_ENGAGE_NEW_SMARTDJ_DESC = "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_DESC";
+ String.id.IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_DESC = "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_DESC";
+ String.id.IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_TITLE = "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_TITLE";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION = "IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION_FREE = "IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION_FREE";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_ARTIST_DESC = "IDS_MUSIC_ENGAGE_PLAY_ARTIST_DESC";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_DESC = "IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_DESC";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_TITLE = "IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_TITLE";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_ACTION = "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_ACTION";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_DESC = "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_DESC";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_DESC = "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_DESC";
+ String.id.IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_TITLE = "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_TITLE";
+ String.id.IDS_MUSIC_ENGAGE_PLAYLIST_ADD_TITLE_UC = "IDS_MUSIC_ENGAGE_PLAYLIST_ADD_TITLE_UC";
+ String.id.IDS_MUSIC_ENGAGE_PLAYLIST_MANAGE = "IDS_MUSIC_ENGAGE_PLAYLIST_MANAGE";
+ String.id.IDS_MUSIC_ENGAGE_PLAYLIST_PLAY_TITLE_UC = "IDS_MUSIC_ENGAGE_PLAYLIST_PLAY_TITLE_UC";
+ String.id.IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_ACTION = "IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_ACTION";
+ String.id.IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_DESC = "IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_DESC";
+ String.id.IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_ACTION = "IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_ACTION";
+ String.id.IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_DESC = "IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_DESC";
+ String.id.IDS_MUSIC_GENRE_SORT = "IDS_MUSIC_GENRE_SORT";
+ String.id.IDS_MUSIC_GET_A_SUBSCRIPTION_TEXT = "IDS_MUSIC_GET_A_SUBSCRIPTION_TEXT";
+ String.id.IDS_MUSIC_IN_COLLECTION_LABEL = "IDS_MUSIC_IN_COLLECTION_LABEL";
+ String.id.IDS_MUSIC_IN_LIBRARY_LABEL = "IDS_MUSIC_IN_LIBRARY_LABEL";
+ String.id.IDS_MUSIC_IN_MY_MUSIC_LABEL = "IDS_MUSIC_IN_MY_MUSIC_LABEL";
+ String.id.IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_PLURAL = "IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_PLURAL";
+ String.id.IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_TEXT = "IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_TEXT";
+ String.id.IDS_MUSIC_INFLUENCING_ARTISTS_TEXT = "IDS_MUSIC_INFLUENCING_ARTISTS_TEXT";
+ String.id.IDS_MUSIC_INTRO_BROWSE_BUTTON_AUTHED = "IDS_MUSIC_INTRO_BROWSE_BUTTON_AUTHED";
+ String.id.IDS_MUSIC_INTRO_BROWSE_BUTTON_NONAUTHED = "IDS_MUSIC_INTRO_BROWSE_BUTTON_NONAUTHED";
+ String.id.IDS_MUSIC_INTRO_DETAILS = "IDS_MUSIC_INTRO_DETAILS";
+ String.id.IDS_MUSIC_INTRO_DETAILS_RADIO = "IDS_MUSIC_INTRO_DETAILS_RADIO";
+ String.id.IDS_MUSIC_INTRO_HEADER = "IDS_MUSIC_INTRO_HEADER";
+ String.id.IDS_MUSIC_INTRO_PLAY_BUTTON_AUTHED = "IDS_MUSIC_INTRO_PLAY_BUTTON_AUTHED";
+ String.id.IDS_MUSIC_INTRO_PLAY_BUTTON_NONAUTHED = "IDS_MUSIC_INTRO_PLAY_BUTTON_NONAUTHED";
+ String.id.IDS_MUSIC_LATEST_ALBUM = "IDS_MUSIC_LATEST_ALBUM";
+ String.id.IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE = "IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE";
+ String.id.IDS_MUSIC_MARKETPLACE_GALLERY_TITLE = "IDS_MUSIC_MARKETPLACE_GALLERY_TITLE";
+ String.id.IDS_MUSIC_MARKETPLACE_MOST_PLAYTED_SORT = "IDS_MUSIC_MARKETPLACE_MOST_PLAYTED_SORT";
+ String.id.IDS_MUSIC_MARKETPLACE_POPULARITY_SORT = "IDS_MUSIC_MARKETPLACE_POPULARITY_SORT";
+ String.id.IDS_MUSIC_MARKETPLACE_RELEASEDATE_SORT = "IDS_MUSIC_MARKETPLACE_RELEASEDATE_SORT";
+ String.id.IDS_MUSIC_MARKETPLACE_TITLE_LC = "IDS_MUSIC_MARKETPLACE_TITLE_LC";
+ String.id.IDS_MUSIC_MARKETPLACE_TITLE_SORT = "IDS_MUSIC_MARKETPLACE_TITLE_SORT";
+ String.id.IDS_MUSIC_MATCH_GRACENOTE_SERVICE = "IDS_MUSIC_MATCH_GRACENOTE_SERVICE";
+ String.id.IDS_MUSIC_MAX_DEVICES_NOTIFICATION = "IDS_MUSIC_MAX_DEVICES_NOTIFICATION";
+ String.id.IDS_MUSIC_MODIFIER_GENRE = "IDS_MUSIC_MODIFIER_GENRE";
+ String.id.IDS_MUSIC_MODIFIER_GENRE_ALL = "IDS_MUSIC_MODIFIER_GENRE_ALL";
+ String.id.IDS_MUSIC_MODIFIER_SUBGENRE = "IDS_MUSIC_MODIFIER_SUBGENRE";
+ String.id.IDS_MUSIC_MODIFIER_SUBGENRE_NONE = "IDS_MUSIC_MODIFIER_SUBGENRE_NONE";
+ String.id.IDS_MUSIC_MOST_POPULAR_PANEL_HEADER = "IDS_MUSIC_MOST_POPULAR_PANEL_HEADER";
+ String.id.IDS_MUSIC_MY_PLAYLISTS_HEADER = "IDS_MUSIC_MY_PLAYLISTS_HEADER";
+ String.id.IDS_MUSIC_NEW_RELEASES_TITLE_LC = "IDS_MUSIC_NEW_RELEASES_TITLE_LC";
+ String.id.IDS_MUSIC_NOTIFICATION_1_ALBUM_ADDED = "IDS_MUSIC_NOTIFICATION_1_ALBUM_ADDED";
+ String.id.IDS_MUSIC_NOTIFICATION_1_ARTIST_ADDED = "IDS_MUSIC_NOTIFICATION_1_ARTIST_ADDED";
+ String.id.IDS_MUSIC_NOTIFICATION_1_TRACK_ADDED = "IDS_MUSIC_NOTIFICATION_1_TRACK_ADDED";
+ String.id.IDS_MUSIC_NOTIFICATION_ADD_ERROR = "IDS_MUSIC_NOTIFICATION_ADD_ERROR";
+ String.id.IDS_MUSIC_NOTIFICATION_ADD_SONGS_ERROR = "IDS_MUSIC_NOTIFICATION_ADD_SONGS_ERROR";
+ String.id.IDS_MUSIC_NOTIFICATION_ADDED_TO_COLLECTION = "IDS_MUSIC_NOTIFICATION_ADDED_TO_COLLECTION";
+ String.id.IDS_MUSIC_NOTIFICATION_ADDED_TO_MY_MUSIC = "IDS_MUSIC_NOTIFICATION_ADDED_TO_MY_MUSIC";
+ String.id.IDS_MUSIC_NOTIFICATION_ADDED_TO_NOW_PLAYING = "IDS_MUSIC_NOTIFICATION_ADDED_TO_NOW_PLAYING";
+ String.id.IDS_MUSIC_NOTIFICATION_ADDED_TO_PLAYLIST = "IDS_MUSIC_NOTIFICATION_ADDED_TO_PLAYLIST";
+ String.id.IDS_MUSIC_NOTIFICATION_ADDING_TO_COLLECTION = "IDS_MUSIC_NOTIFICATION_ADDING_TO_COLLECTION";
+ String.id.IDS_MUSIC_NOTIFICATION_ADDING_TO_NOW_PLAYING = "IDS_MUSIC_NOTIFICATION_ADDING_TO_NOW_PLAYING";
+ String.id.IDS_MUSIC_NOTIFICATION_ADDING_TO_PLAYLIST = "IDS_MUSIC_NOTIFICATION_ADDING_TO_PLAYLIST";
+ String.id.IDS_MUSIC_NOTIFICATION_ALBUMS_ADDED_PLURAL = "IDS_MUSIC_NOTIFICATION_ALBUMS_ADDED_PLURAL";
+ String.id.IDS_MUSIC_NOTIFICATION_ARTISTS_ADDED_PLURAL = "IDS_MUSIC_NOTIFICATION_ARTISTS_ADDED_PLURAL";
+ String.id.IDS_MUSIC_NOTIFICATION_MUSIC_PASS_ONLY = "IDS_MUSIC_NOTIFICATION_MUSIC_PASS_ONLY";
+ String.id.IDS_MUSIC_NOTIFICATION_N_ALBUMS_ADDED = "IDS_MUSIC_NOTIFICATION_N_ALBUMS_ADDED";
+ String.id.IDS_MUSIC_NOTIFICATION_N_ARTISTS_ADDED = "IDS_MUSIC_NOTIFICATION_N_ARTISTS_ADDED";
+ String.id.IDS_MUSIC_NOTIFICATION_N_TRACKS_ADDED = "IDS_MUSIC_NOTIFICATION_N_TRACKS_ADDED";
+ String.id.IDS_MUSIC_NOTIFICATION_PURCHASE_ONLY = "IDS_MUSIC_NOTIFICATION_PURCHASE_ONLY";
+ String.id.IDS_MUSIC_NOTIFICATION_RADIO_LOCKED = "IDS_MUSIC_NOTIFICATION_RADIO_LOCKED";
+ String.id.IDS_MUSIC_NOTIFICATION_TRACKS_ADDED_PLURAL = "IDS_MUSIC_NOTIFICATION_TRACKS_ADDED_PLURAL";
+ String.id.IDS_MUSIC_NOW_PLAYING_DEFAULT_LIST_NAME = "IDS_MUSIC_NOW_PLAYING_DEFAULT_LIST_NAME";
+ String.id.IDS_MUSIC_NOW_PLAYING_NEXT_SONG_DESC = "IDS_MUSIC_NOW_PLAYING_NEXT_SONG_DESC";
+ String.id.IDS_MUSIC_NOW_PLAYING_PANEL_HEADER_UC = "IDS_MUSIC_NOW_PLAYING_PANEL_HEADER_UC";
+ String.id.IDS_MUSIC_NOW_PLAYING_PREVIOUS_SONG_DESC = "IDS_MUSIC_NOW_PLAYING_PREVIOUS_SONG_DESC";
+ String.id.IDS_MUSIC_NOW_PLAYING_SMART_DJ_LIST_NAME = "IDS_MUSIC_NOW_PLAYING_SMART_DJ_LIST_NAME";
+ String.id.IDS_MUSIC_NOW_PLAYING_TOP_SONGS_LIST_NAME = "IDS_MUSIC_NOW_PLAYING_TOP_SONGS_LIST_NAME";
+ String.id.IDS_MUSIC_OFFLINE_DRM_DESC = "IDS_MUSIC_OFFLINE_DRM_DESC";
+ String.id.IDS_MUSIC_OFFLINE_DRM_TITLE = "IDS_MUSIC_OFFLINE_DRM_TITLE";
+ String.id.IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_ACTION = "IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_ACTION";
+ String.id.IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_BODY = "IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_BODY";
+ String.id.IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_NO = "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_NO";
+ String.id.IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_YES = "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_YES";
+ String.id.IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_BODY = "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_BODY";
+ String.id.IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_TITLE = "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_TITLE";
+ String.id.IDS_MUSIC_PLAY_ALBUM_LABEL = "IDS_MUSIC_PLAY_ALBUM_LABEL";
+ String.id.IDS_MUSIC_PLAY_ALL_BUTTON = "IDS_MUSIC_PLAY_ALL_BUTTON";
+ String.id.IDS_MUSIC_PLAY_SELECTION_ACTION = "IDS_MUSIC_PLAY_SELECTION_ACTION";
+ String.id.IDS_MUSIC_PLAY_TO_DISABLED_TEXT = "IDS_MUSIC_PLAY_TO_DISABLED_TEXT";
+ String.id.IDS_MUSIC_PLAY_TO_LABEL = "IDS_MUSIC_PLAY_TO_LABEL";
+ String.id.IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR_TEXT = "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR_TEXT";
+ String.id.IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR2_TEXT = "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR2_TEXT";
+ String.id.IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR3_TEXT = "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR3_TEXT";
+ String.id.IDS_MUSIC_PLAY_TO_STREAMING_ERROR_TEXT = "IDS_MUSIC_PLAY_TO_STREAMING_ERROR_TEXT";
+ String.id.IDS_MUSIC_PLAY_TOP_SONGS_BUTTON = "IDS_MUSIC_PLAY_TOP_SONGS_BUTTON";
+ String.id.IDS_MUSIC_PLAYLIST_LABEL = "IDS_MUSIC_PLAYLIST_LABEL";
+ String.id.IDS_MUSIC_PLAYLIST_SEARCH_NAME_DESC = "IDS_MUSIC_PLAYLIST_SEARCH_NAME_DESC";
+ String.id.IDS_MUSIC_PLAYLIST_SEARCH_NAME_LABEL = "IDS_MUSIC_PLAYLIST_SEARCH_NAME_LABEL";
+ String.id.IDS_MUSIC_PLAYLISTS_BROWSE_COLLECTION = "IDS_MUSIC_PLAYLISTS_BROWSE_COLLECTION";
+ String.id.IDS_MUSIC_PLAYLISTS_BROWSE_MARKETPLACE = "IDS_MUSIC_PLAYLISTS_BROWSE_MARKETPLACE";
+ String.id.IDS_MUSIC_PREVIEW_SELECTION_ACTION = "IDS_MUSIC_PREVIEW_SELECTION_ACTION";
+ String.id.IDS_MUSIC_PREVIEW_TOP_SONGS_BUTTON = "IDS_MUSIC_PREVIEW_TOP_SONGS_BUTTON";
+ String.id.IDS_MUSIC_PROPERTIES_ALBUM_ARTIST_LABEL = "IDS_MUSIC_PROPERTIES_ALBUM_ARTIST_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_ALBUM_TITLE_LABEL = "IDS_MUSIC_PROPERTIES_ALBUM_TITLE_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_MULTIPLE_LOCATIONS = "IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_MULTIPLE_LOCATIONS";
+ String.id.IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_ONEDRIVE = "IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_ONEDRIVE";
+ String.id.IDS_MUSIC_PROPERTIES_AVAILABLE_ON_THIS_PC = "IDS_MUSIC_PROPERTIES_AVAILABLE_ON_THIS_PC";
+ String.id.IDS_MUSIC_PROPERTIES_BIT_RATE_LABEL = "IDS_MUSIC_PROPERTIES_BIT_RATE_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_COPYRIGHT_LABEL = "IDS_MUSIC_PROPERTIES_COPYRIGHT_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_DIALOG_TEXT = "IDS_MUSIC_PROPERTIES_DIALOG_TEXT";
+ String.id.IDS_MUSIC_PROPERTIES_DISC_LABEL = "IDS_MUSIC_PROPERTIES_DISC_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_DRM_LABEL = "IDS_MUSIC_PROPERTIES_DRM_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_FILE_SIZE_LABEL = "IDS_MUSIC_PROPERTIES_FILE_SIZE_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_FOLDER_PATH_COPY_LINK = "IDS_MUSIC_PROPERTIES_FOLDER_PATH_COPY_LINK";
+ String.id.IDS_MUSIC_PROPERTIES_FOLDER_PATH_LABEL = "IDS_MUSIC_PROPERTIES_FOLDER_PATH_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_FOLDER_PATH_ONEDRIVE = "IDS_MUSIC_PROPERTIES_FOLDER_PATH_ONEDRIVE";
+ String.id.IDS_MUSIC_PROPERTIES_FOLDER_PATH_STREAMING = "IDS_MUSIC_PROPERTIES_FOLDER_PATH_STREAMING";
+ String.id.IDS_MUSIC_PROPERTIES_GENRE_LABEL = "IDS_MUSIC_PROPERTIES_GENRE_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_LENGTH_LABEL = "IDS_MUSIC_PROPERTIES_LENGTH_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_MEDIA_TYPE_LABEL = "IDS_MUSIC_PROPERTIES_MEDIA_TYPE_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_RELEASE_YEAR_LABEL = "IDS_MUSIC_PROPERTIES_RELEASE_YEAR_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_SONG_ARTIST_LABEL = "IDS_MUSIC_PROPERTIES_SONG_ARTIST_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_SONG_TITLE_LABEL = "IDS_MUSIC_PROPERTIES_SONG_TITLE_LABEL";
+ String.id.IDS_MUSIC_PROPERTIES_TRACK_LABEL = "IDS_MUSIC_PROPERTIES_TRACK_LABEL";
+ String.id.IDS_MUSIC_RECENT_PANEL_HEADER_UC = "IDS_MUSIC_RECENT_PANEL_HEADER_UC";
+ String.id.IDS_MUSIC_RECENT_PLAYLIST_DIALOG_TEXT = "IDS_MUSIC_RECENT_PLAYLIST_DIALOG_TEXT";
+ String.id.IDS_MUSIC_RELATED_ARTISTS_COUNT_PLURAL = "IDS_MUSIC_RELATED_ARTISTS_COUNT_PLURAL";
+ String.id.IDS_MUSIC_RELATED_ARTISTS_COUNT_TEXT = "IDS_MUSIC_RELATED_ARTISTS_COUNT_TEXT";
+ String.id.IDS_MUSIC_RELATED_ARTISTS_LINK = "IDS_MUSIC_RELATED_ARTISTS_LINK";
+ String.id.IDS_MUSIC_RELATED_ARTISTS_TEXT = "IDS_MUSIC_RELATED_ARTISTS_TEXT";
+ String.id.IDS_MUSIC_RELATED_GENRES_PLURAL = "IDS_MUSIC_RELATED_GENRES_PLURAL";
+ String.id.IDS_MUSIC_RELATED_PANEL_FORMAT = "IDS_MUSIC_RELATED_PANEL_FORMAT";
+ String.id.IDS_MUSIC_RELATED_PANEL_TEXT = "IDS_MUSIC_RELATED_PANEL_TEXT";
+ String.id.IDS_MUSIC_RENAME_PLAYLIST = "IDS_MUSIC_RENAME_PLAYLIST";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_CANCEL = "IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_CANCEL";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_DELETE = "IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_DELETE";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_DESCRIPTION = "IDS_MUSIC_RESET_COLLECTION_DIALOG_DESCRIPTION";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_NOTE = "IDS_MUSIC_RESET_COLLECTION_DIALOG_NOTE";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_PLURAL = "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_PLURAL";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_SINGLE = "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_SINGLE";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_PLURAL = "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_PLURAL";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_SINGLE = "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_SINGLE";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_PLURAL = "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_PLURAL";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_SINGLE = "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_SINGLE";
+ String.id.IDS_MUSIC_RESET_COLLECTION_DIALOG_TITLE = "IDS_MUSIC_RESET_COLLECTION_DIALOG_TITLE";
+ String.id.IDS_MUSIC_RESET_COLLECTION_FLYOUT_BODY = "IDS_MUSIC_RESET_COLLECTION_FLYOUT_BODY";
+ String.id.IDS_MUSIC_RESET_COLLECTION_FLYOUT_TITLE = "IDS_MUSIC_RESET_COLLECTION_FLYOUT_TITLE";
+ String.id.IDS_MUSIC_SAVE_AS_PLAYLIST = "IDS_MUSIC_SAVE_AS_PLAYLIST";
+ String.id.IDS_MUSIC_SAVE_NAME_PLAYLIST = "IDS_MUSIC_SAVE_NAME_PLAYLIST";
+ String.id.IDS_MUSIC_SAVE_NOW_PLAYING_ACTION = "IDS_MUSIC_SAVE_NOW_PLAYING_ACTION";
+ String.id.IDS_MUSIC_SAVE_THIS_AS_PLAYLIST = "IDS_MUSIC_SAVE_THIS_AS_PLAYLIST";
+ String.id.IDS_MUSIC_SCAN_MATCH_0_SONGS_SCANNED_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_0_SONGS_SCANNED_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_FREE = "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_FREE";
+ String.id.IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_PREMIUM = "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_PREMIUM";
+ String.id.IDS_MUSIC_SCAN_MATCH_1_SONG_SCANNED_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_1_SONG_SCANNED_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_MATCHED_NOTIFICATION = "IDS_MUSIC_SCAN_MATCH_MATCHED_NOTIFICATION";
+ String.id.IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_FREE = "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_FREE";
+ String.id.IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_PREMIUM = "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_PREMIUM";
+ String.id.IDS_MUSIC_SCAN_MATCH_N_SONGS_SCANNED_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_N_SONGS_SCANNED_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_NO_SONGS_MATCHED_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_NO_SONGS_MATCHED_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_1 = "IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_1";
+ String.id.IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_SCANNING_NOTIFICATION = "IDS_MUSIC_SCAN_MATCH_SCANNING_NOTIFICATION";
+ String.id.IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_1 = "IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_1";
+ String.id.IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_2 = "IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_2";
+ String.id.IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_1 = "IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_1";
+ String.id.IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_2_PLURAL = "IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_2_PLURAL";
+ String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_DESC = "IDS_MUSIC_SEARCH_ALL_EMPTY_DESC";
+ String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_LINK = "IDS_MUSIC_SEARCH_ALL_EMPTY_LINK";
+ String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_TITLE = "IDS_MUSIC_SEARCH_ALL_EMPTY_TITLE";
+ String.id.IDS_MUSIC_SEARCH_BEST_MATCH = "IDS_MUSIC_SEARCH_BEST_MATCH";
+ String.id.IDS_MUSIC_SEARCH_CATALOG_EMPTY_DESC = "IDS_MUSIC_SEARCH_CATALOG_EMPTY_DESC";
+ String.id.IDS_MUSIC_SEARCH_CATALOG_EMPTY_TITLE = "IDS_MUSIC_SEARCH_CATALOG_EMPTY_TITLE";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE = "IDS_MUSIC_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_EMPTY_DESC = "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_DESC";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE = "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG = "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG";
+ String.id.IDS_MUSIC_SEARCH_LOCATION_COLLECTION_STORE = "IDS_MUSIC_SEARCH_LOCATION_COLLECTION_STORE";
+ String.id.IDS_MUSIC_SEARCH_LOCATION_NOT_AVAILABLE = "IDS_MUSIC_SEARCH_LOCATION_NOT_AVAILABLE";
+ String.id.IDS_MUSIC_SEARCH_LOCATION_STORE = "IDS_MUSIC_SEARCH_LOCATION_STORE";
+ String.id.IDS_MUSIC_SEARCH_MY_EMPTY_DESC = "IDS_MUSIC_SEARCH_MY_EMPTY_DESC";
+ String.id.IDS_MUSIC_SEARCH_MY_EMPTY_LINK = "IDS_MUSIC_SEARCH_MY_EMPTY_LINK";
+ String.id.IDS_MUSIC_SEARCH_MY_EMPTY_TITLE = "IDS_MUSIC_SEARCH_MY_EMPTY_TITLE";
+ String.id.IDS_MUSIC_SEARCH_TOP_RESULT = "IDS_MUSIC_SEARCH_TOP_RESULT";
+ String.id.IDS_MUSIC_SEE_MORE_BUTTON = "IDS_MUSIC_SEE_MORE_BUTTON";
+ String.id.IDS_MUSIC_SETTINGS_AUTOMATIC_DOWNLOAD = "IDS_MUSIC_SETTINGS_AUTOMATIC_DOWNLOAD";
+ String.id.IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ALT_DESCRIPTION = "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ALT_DESCRIPTION";
+ String.id.IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_OFF_DESCRIPTION = "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_OFF_DESCRIPTION";
+ String.id.IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ON_DESCRIPTION = "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ON_DESCRIPTION";
+ String.id.IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_TITLE = "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_TITLE";
+ String.id.IDS_MUSIC_SETTINGS_CLOUD_DEVICES_TITLE = "IDS_MUSIC_SETTINGS_CLOUD_DEVICES_TITLE";
+ String.id.IDS_MUSIC_SETTINGS_CLOUD_MUSIC_TITLE = "IDS_MUSIC_SETTINGS_CLOUD_MUSIC_TITLE";
+ String.id.IDS_MUSIC_SETTINGS_MEDIA_INFO_DESC = "IDS_MUSIC_SETTINGS_MEDIA_INFO_DESC";
+ String.id.IDS_MUSIC_SETTINGS_MEDIA_INFO_LABEL = "IDS_MUSIC_SETTINGS_MEDIA_INFO_LABEL";
+ String.id.IDS_MUSIC_SETTINGS_METADATA_SAVE_DESC = "IDS_MUSIC_SETTINGS_METADATA_SAVE_DESC";
+ String.id.IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_DESCRIPTION = "IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_DESCRIPTION";
+ String.id.IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_TITLE = "IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_TITLE";
+ String.id.IDS_MUSIC_SETTINGS_SHOW_CLOUD_GROVEL_INFO_DESC = "IDS_MUSIC_SETTINGS_SHOW_CLOUD_GROVEL_INFO_DESC";
+ String.id.IDS_MUSIC_SETTINGS_STARTUP_VIEW_DESC = "IDS_MUSIC_SETTINGS_STARTUP_VIEW_DESC";
+ String.id.IDS_MUSIC_SETTINGS_STARTUP_VIEW_LABEL = "IDS_MUSIC_SETTINGS_STARTUP_VIEW_LABEL";
+ String.id.IDS_MUSIC_SHOW_ALBUMS = "IDS_MUSIC_SHOW_ALBUMS";
+ String.id.IDS_MUSIC_SHOW_ARTISTS = "IDS_MUSIC_SHOW_ARTISTS";
+ String.id.IDS_MUSIC_SHOW_PLAYLISTS = "IDS_MUSIC_SHOW_PLAYLISTS";
+ String.id.IDS_MUSIC_SHOW_SONGS = "IDS_MUSIC_SHOW_SONGS";
+ String.id.IDS_MUSIC_SIMILAR_ALBUMS_PLURAL = "IDS_MUSIC_SIMILAR_ALBUMS_PLURAL";
+ String.id.IDS_MUSIC_SIMILAR_ARTISTS_TEXT = "IDS_MUSIC_SIMILAR_ARTISTS_TEXT";
+ String.id.IDS_MUSIC_SONGS_IN_COLLECTION = "IDS_MUSIC_SONGS_IN_COLLECTION";
+ String.id.IDS_MUSIC_SPOTLIGHT_ITEM_NAR = "IDS_MUSIC_SPOTLIGHT_ITEM_NAR";
+ String.id.IDS_MUSIC_SPOTLIGHT_PANEL_HEADER = "IDS_MUSIC_SPOTLIGHT_PANEL_HEADER";
+ String.id.IDS_MUSIC_STREAMING_NOTIFICATION = "IDS_MUSIC_STREAMING_NOTIFICATION";
+ String.id.IDS_MUSIC_SUBSCRIPTION_SIGN_IN_DESC = "IDS_MUSIC_SUBSCRIPTION_SIGN_IN_DESC";
+ String.id.IDS_MUSIC_SUBSCRIPTION_SIGN_IN_TITLE = "IDS_MUSIC_SUBSCRIPTION_SIGN_IN_TITLE";
+ String.id.IDS_MUSIC_SUBSCRIPTION_UPSELL_TEXT = "IDS_MUSIC_SUBSCRIPTION_UPSELL_TEXT";
+ String.id.IDS_MUSIC_TOP_ALBUM_TITLE_LC = "IDS_MUSIC_TOP_ALBUM_TITLE_LC";
+ String.id.IDS_MUSIC_TOP_SONGS_PANEL_TEXT = "IDS_MUSIC_TOP_SONGS_PANEL_TEXT";
+ String.id.IDS_MUSIC_TOP_SONGS_PANEL_TEXT_LC = "IDS_MUSIC_TOP_SONGS_PANEL_TEXT_LC";
+ String.id.IDS_MUSIC_TRACKS_LABEL_PLURAL = "IDS_MUSIC_TRACKS_LABEL_PLURAL";
+ String.id.IDS_MUSIC_TYPE_ALBUM_PLURAL = "IDS_MUSIC_TYPE_ALBUM_PLURAL";
+ String.id.IDS_MUSIC_TYPE_ALBUM_TITLE_TC = "IDS_MUSIC_TYPE_ALBUM_TITLE_TC";
+ String.id.IDS_MUSIC_TYPE_ARTIST_PLURAL = "IDS_MUSIC_TYPE_ARTIST_PLURAL";
+ String.id.IDS_MUSIC_TYPE_ARTIST_TITLE_TC = "IDS_MUSIC_TYPE_ARTIST_TITLE_TC";
+ String.id.IDS_MUSIC_TYPE_PLAYLIST_PLURAL = "IDS_MUSIC_TYPE_PLAYLIST_PLURAL";
+ String.id.IDS_MUSIC_TYPE_PLAYLIST_TITLE_TC = "IDS_MUSIC_TYPE_PLAYLIST_TITLE_TC";
+ String.id.IDS_MUSIC_TYPE_RADIO_PLURAL = "IDS_MUSIC_TYPE_RADIO_PLURAL";
+ String.id.IDS_MUSIC_TYPE_TRACK_PLURAL = "IDS_MUSIC_TYPE_TRACK_PLURAL";
+ String.id.IDS_MUSIC_TYPE_TRACK_TITLE_TC = "IDS_MUSIC_TYPE_TRACK_TITLE_TC";
+ String.id.IDS_MUSIC_VIDEO_MARKETPLACE_TITLE = "IDS_MUSIC_VIDEO_MARKETPLACE_TITLE";
+ String.id.IDS_MUSIC_VIDEO_MARKETPLACE_TITLE_LC = "IDS_MUSIC_VIDEO_MARKETPLACE_TITLE_LC";
+ String.id.IDS_MUSIC2_ARTIST_DETAILS_HERO_PANEL_TITLE_UC = "IDS_MUSIC2_ARTIST_DETAILS_HERO_PANEL_TITLE_UC";
+ String.id.IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_EMPTY = "IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_EMPTY";
+ String.id.IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_TITLE = "IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_TITLE";
+ String.id.IDS_MUSIC2_GALLERY_JUMP_TO_DATE = "IDS_MUSIC2_GALLERY_JUMP_TO_DATE";
+ String.id.IDS_MUSIC2_GALLERY_JUMP_TO_LETTER = "IDS_MUSIC2_GALLERY_JUMP_TO_LETTER";
+ String.id.IDS_MUSIC2_TOP_ALBUMS_HEADER_NO_GENRE_UC = "IDS_MUSIC2_TOP_ALBUMS_HEADER_NO_GENRE_UC";
+ String.id.IDS_MUSIC2_TOP_SONGS_PANEL_TEXT = "IDS_MUSIC2_TOP_SONGS_PANEL_TEXT";
+ String.id.IDS_PICK_PLAYLIST_OVERLAY_TITLE = "IDS_PICK_PLAYLIST_OVERLAY_TITLE";
+ String.id.IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALBUMS = "IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALBUMS";
+ String.id.IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALL_MUSIC = "IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALL_MUSIC";
+ String.id.IDS_PLAY_PLAYLIST_OVERLAY_EMPTY_DESC = "IDS_PLAY_PLAYLIST_OVERLAY_EMPTY_DESC";
+ String.id.IDS_PLAY_PLAYLIST_OVERLAY_IMPORT_DESC = "IDS_PLAY_PLAYLIST_OVERLAY_IMPORT_DESC";
+ String.id.IDS_PLAY_PLAYLIST_OVERLAY_MANAGE_PLAYLIST = "IDS_PLAY_PLAYLIST_OVERLAY_MANAGE_PLAYLIST";
+ String.id.IDS_PLAY_PLAYLIST_OVERLAY_TITLE = "IDS_PLAY_PLAYLIST_OVERLAY_TITLE";
+ String.id.IDS_PLAYLIST_ADD = "IDS_PLAYLIST_ADD";
+ String.id.IDS_PLAYLIST_ADD_ACTIVE = "IDS_PLAYLIST_ADD_ACTIVE";
+ String.id.IDS_PLAYLIST_ADD_SONG = "IDS_PLAYLIST_ADD_SONG";
+ String.id.IDS_PLAYLIST_ADD_SONG_ACTIVE = "IDS_PLAYLIST_ADD_SONG_ACTIVE";
+ String.id.IDS_PLAYLIST_ADDED_TO_PLAYLIST = "IDS_PLAYLIST_ADDED_TO_PLAYLIST";
+ String.id.IDS_PLAYLIST_ADDED_TO_PLAYLIST_ITEMS_PLURAL = "IDS_PLAYLIST_ADDED_TO_PLAYLIST_ITEMS_PLURAL";
+ String.id.IDS_PLAYLIST_BAD_CHARACTERS_ERROR = "IDS_PLAYLIST_BAD_CHARACTERS_ERROR";
+ String.id.IDS_PLAYLIST_CHANGED_ON = "IDS_PLAYLIST_CHANGED_ON";
+ String.id.IDS_PLAYLIST_COLLECTION_TITLE = "IDS_PLAYLIST_COLLECTION_TITLE";
+ String.id.IDS_PLAYLIST_CREATE_DUPLICATE_MESSAGE = "IDS_PLAYLIST_CREATE_DUPLICATE_MESSAGE";
+ String.id.IDS_PLAYLIST_CREATE_LABEL = "IDS_PLAYLIST_CREATE_LABEL";
+ String.id.IDS_PLAYLIST_CREATE_PLAYLIST_ACTION_TEXT = "IDS_PLAYLIST_CREATE_PLAYLIST_ACTION_TEXT";
+ String.id.IDS_PLAYLIST_CREATE_PLAYLIST_DESC_TEXT = "IDS_PLAYLIST_CREATE_PLAYLIST_DESC_TEXT";
+ String.id.IDS_PLAYLIST_CREATE_PLAYLIST_LINK = "IDS_PLAYLIST_CREATE_PLAYLIST_LINK";
+ String.id.IDS_PLAYLIST_CREATE_REPLACE = "IDS_PLAYLIST_CREATE_REPLACE";
+ String.id.IDS_PLAYLIST_DEFAULT_NAME = "IDS_PLAYLIST_DEFAULT_NAME";
+ String.id.IDS_PLAYLIST_EXISTING_NAME = "IDS_PLAYLIST_EXISTING_NAME";
+ String.id.IDS_PLAYLIST_IMPORT_COMPLETED = "IDS_PLAYLIST_IMPORT_COMPLETED";
+ String.id.IDS_PLAYLIST_IMPORT_COMPLETED_NONE_FOUND = "IDS_PLAYLIST_IMPORT_COMPLETED_NONE_FOUND";
+ String.id.IDS_PLAYLIST_IMPORT_DIALOG_DESC_TEXT = "IDS_PLAYLIST_IMPORT_DIALOG_DESC_TEXT";
+ String.id.IDS_PLAYLIST_IMPORT_DIALOG_TITLE = "IDS_PLAYLIST_IMPORT_DIALOG_TITLE";
+ String.id.IDS_PLAYLIST_IMPORT_DIALOG_TITLE_NO_MARKETPLACE = "IDS_PLAYLIST_IMPORT_DIALOG_TITLE_NO_MARKETPLACE";
+ String.id.IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_DESC_TEXT = "IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_DESC_TEXT";
+ String.id.IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_LINK = "IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_LINK";
+ String.id.IDS_PLAYLIST_IMPORT_FAILURE_DETAIL = "IDS_PLAYLIST_IMPORT_FAILURE_DETAIL";
+ String.id.IDS_PLAYLIST_IMPORT_FAILURE_OCCURRED = "IDS_PLAYLIST_IMPORT_FAILURE_OCCURRED";
+ String.id.IDS_PLAYLIST_IMPORT_FAILURE_SUBTITLE = "IDS_PLAYLIST_IMPORT_FAILURE_SUBTITLE";
+ String.id.IDS_PLAYLIST_IMPORT_IN_PROGRESS = "IDS_PLAYLIST_IMPORT_IN_PROGRESS";
+ String.id.IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_DESC_TEXT = "IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_DESC_TEXT";
+ String.id.IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_TITLE = "IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_TITLE";
+ String.id.IDS_PLAYLIST_IMPORT_PLAYLIST_BUTTON = "IDS_PLAYLIST_IMPORT_PLAYLIST_BUTTON";
+ String.id.IDS_PLAYLIST_ITEM_BUTTON_NOT_AVAILABLE = "IDS_PLAYLIST_ITEM_BUTTON_NOT_AVAILABLE";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NO_MATCH_XBOX_MUSIC_CLOUD = "IDS_PLAYLIST_ITEM_DIALOG_NO_MATCH_XBOX_MUSIC_CLOUD";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE = "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_DTO_ONLY_MARKETPLACE_ENABLED = "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_DTO_ONLY_MARKETPLACE_ENABLED";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER = "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_ACTION = "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_ACTION";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_TITLE = "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_TITLE";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_ENABLED = "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_ENABLED";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_NOT_ENABLED = "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_NOT_ENABLED";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_FOUND_MARKETPLACE_NOT_ENABLED = "IDS_PLAYLIST_ITEM_DIALOG_NOT_FOUND_MARKETPLACE_NOT_ENABLED";
+ String.id.IDS_PLAYLIST_ITEM_DIALOG_NOT_MATCHED_MARKETPLACE_ENABLED = "IDS_PLAYLIST_ITEM_DIALOG_NOT_MATCHED_MARKETPLACE_ENABLED";
+ String.id.IDS_PLAYLIST_MORE = "IDS_PLAYLIST_MORE";
+ String.id.IDS_PLAYLIST_MOVE_DOWN = "IDS_PLAYLIST_MOVE_DOWN";
+ String.id.IDS_PLAYLIST_MOVE_DOWN_SC = "IDS_PLAYLIST_MOVE_DOWN_SC";
+ String.id.IDS_PLAYLIST_MOVE_TO_BOTTOM = "IDS_PLAYLIST_MOVE_TO_BOTTOM";
+ String.id.IDS_PLAYLIST_MOVE_TO_BOTTOM_SC = "IDS_PLAYLIST_MOVE_TO_BOTTOM_SC";
+ String.id.IDS_PLAYLIST_MOVE_TO_TOP = "IDS_PLAYLIST_MOVE_TO_TOP";
+ String.id.IDS_PLAYLIST_MOVE_TO_TOP_SC = "IDS_PLAYLIST_MOVE_TO_TOP_SC";
+ String.id.IDS_PLAYLIST_MOVE_UP = "IDS_PLAYLIST_MOVE_UP";
+ String.id.IDS_PLAYLIST_MOVE_UP_SC = "IDS_PLAYLIST_MOVE_UP_SC";
+ String.id.IDS_PLAYLIST_NAME = "IDS_PLAYLIST_NAME";
+ String.id.IDS_PLAYLIST_NAME_TITLE = "IDS_PLAYLIST_NAME_TITLE";
+ String.id.IDS_PLAYLIST_NO_CONTENT_TITLE = "IDS_PLAYLIST_NO_CONTENT_TITLE";
+ String.id.IDS_PLAYLIST_PAGE_EMPTY_BROWSE_TITLE = "IDS_PLAYLIST_PAGE_EMPTY_BROWSE_TITLE";
+ String.id.IDS_PLAYLIST_PAGE_EMPTY_TEXT = "IDS_PLAYLIST_PAGE_EMPTY_TEXT";
+ String.id.IDS_PLAYLIST_PAGE_EMPTY_TITLE = "IDS_PLAYLIST_PAGE_EMPTY_TITLE";
+ String.id.IDS_PLAYLIST_PLAYLISTS_ADDED_PLURAL = "IDS_PLAYLIST_PLAYLISTS_ADDED_PLURAL";
+ String.id.IDS_PLAYLIST_REMOVE = "IDS_PLAYLIST_REMOVE";
+ String.id.IDS_POPUP_FILTER_CLOUD_ZERO_SONGS = "IDS_POPUP_FILTER_CLOUD_ZERO_SONGS";
+ String.id.IDS_POPUP_FILTER_SHOW_ALL_LINK = "IDS_POPUP_FILTER_SHOW_ALL_LINK";
+ String.id.IDS_RADIO_ARTIST_NOT_FOUND = "IDS_RADIO_ARTIST_NOT_FOUND";
+ String.id.IDS_RADIO_ARTIST_RESULTS = "IDS_RADIO_ARTIST_RESULTS";
+ String.id.IDS_RADIO_CARD_LABEL = "IDS_RADIO_CARD_LABEL";
+ String.id.IDS_RADIO_CARD_LABEL_LC = "IDS_RADIO_CARD_LABEL_LC";
+ String.id.IDS_RADIO_COLLECTION_TITLE = "IDS_RADIO_COLLECTION_TITLE";
+ String.id.IDS_RADIO_CREATE_ACTION = "IDS_RADIO_CREATE_ACTION";
+ String.id.IDS_RADIO_CREATE_ACTION_LC = "IDS_RADIO_CREATE_ACTION_LC";
+ String.id.IDS_RADIO_EMPTY_GALLERY_ACTION = "IDS_RADIO_EMPTY_GALLERY_ACTION";
+ String.id.IDS_RADIO_EMPTY_GALLERY_TITLE = "IDS_RADIO_EMPTY_GALLERY_TITLE";
+ String.id.IDS_RADIO_FREE_USER_ACTION = "IDS_RADIO_FREE_USER_ACTION";
+ String.id.IDS_RADIO_FREE_USER_SUBTITLE = "IDS_RADIO_FREE_USER_SUBTITLE";
+ String.id.IDS_RADIO_FREE_USER_TITLE = "IDS_RADIO_FREE_USER_TITLE";
+ String.id.IDS_RADIO_LOADING_TEXT = "IDS_RADIO_LOADING_TEXT";
+ String.id.IDS_RADIO_NONSMARTDJ_ARTIST = "IDS_RADIO_NONSMARTDJ_ARTIST";
+ String.id.IDS_RADIO_OFFINE_ERROR_TITLE = "IDS_RADIO_OFFINE_ERROR_TITLE";
+ String.id.IDS_RADIO_PAGE_CREATE_RADIO_ACTION = "IDS_RADIO_PAGE_CREATE_RADIO_ACTION";
+ String.id.IDS_RADIO_PAGE_EMPTY_SUBTITLE = "IDS_RADIO_PAGE_EMPTY_SUBTITLE";
+ String.id.IDS_RADIO_PAGE_EMPTY_TITLE = "IDS_RADIO_PAGE_EMPTY_TITLE";
+ String.id.IDS_RADIO_PAGE_ERROR_GALLERY_TITLE = "IDS_RADIO_PAGE_ERROR_GALLERY_TITLE";
+ String.id.IDS_RADIO_PAGE_SIGN_IN_SUBTITLE = "IDS_RADIO_PAGE_SIGN_IN_SUBTITLE";
+ String.id.IDS_RADIO_PAGE_SUBTITLE_LINE1 = "IDS_RADIO_PAGE_SUBTITLE_LINE1";
+ String.id.IDS_RADIO_PAGE_SUBTITLE_LINE2 = "IDS_RADIO_PAGE_SUBTITLE_LINE2";
+ String.id.IDS_RADIO_PLAY_FROM_MEDIA_ACTION = "IDS_RADIO_PLAY_FROM_MEDIA_ACTION";
+ String.id.IDS_RADIO_PLAY_FROM_MEDIA_ACTION_LC = "IDS_RADIO_PLAY_FROM_MEDIA_ACTION_LC";
+ String.id.IDS_RADIO_PLAYING_TEXT = "IDS_RADIO_PLAYING_TEXT";
+ String.id.IDS_RADIO_PLAYING_TEXT_LC = "IDS_RADIO_PLAYING_TEXT_LC";
+ String.id.IDS_SMARTDJ_1_FEATURED_ARTIST = "IDS_SMARTDJ_1_FEATURED_ARTIST";
+ String.id.IDS_SMARTDJ_2_FEATURED_ARTISTS = "IDS_SMARTDJ_2_FEATURED_ARTISTS";
+ String.id.IDS_SMARTDJ_ARTIST_NOT_FOUND = "IDS_SMARTDJ_ARTIST_NOT_FOUND";
+ String.id.IDS_SMARTDJ_ARTIST_RESULTS = "IDS_SMARTDJ_ARTIST_RESULTS";
+ String.id.IDS_SMARTDJ_CARD_LABEL = "IDS_SMARTDJ_CARD_LABEL";
+ String.id.IDS_SMARTDJ_CARD_LABEL_LC = "IDS_SMARTDJ_CARD_LABEL_LC";
+ String.id.IDS_SMARTDJ_COLLECTION_TITLE = "IDS_SMARTDJ_COLLECTION_TITLE";
+ String.id.IDS_SMARTDJ_CREATE_ACTION = "IDS_SMARTDJ_CREATE_ACTION";
+ String.id.IDS_SMARTDJ_CREATE_ACTION_LC = "IDS_SMARTDJ_CREATE_ACTION_LC";
+ String.id.IDS_SMARTDJ_EMPTY_GALLERY_ACTION = "IDS_SMARTDJ_EMPTY_GALLERY_ACTION";
+ String.id.IDS_SMARTDJ_LOADING_TEXT = "IDS_SMARTDJ_LOADING_TEXT";
+ String.id.IDS_SMARTDJ_NONSMARTDJ_ARTIST = "IDS_SMARTDJ_NONSMARTDJ_ARTIST";
+ String.id.IDS_SMARTDJ_NONSMARTDJ_ARTIST_RESULTS = "IDS_SMARTDJ_NONSMARTDJ_ARTIST_RESULTS";
+ String.id.IDS_SMARTDJ_OFFINE_ERROR_DESC = "IDS_SMARTDJ_OFFINE_ERROR_DESC";
+ String.id.IDS_SMARTDJ_OFFINE_ERROR_TITLE = "IDS_SMARTDJ_OFFINE_ERROR_TITLE";
+ String.id.IDS_SMARTDJ_PAGE_CREATE_SMARTDJ_ACTION = "IDS_SMARTDJ_PAGE_CREATE_SMARTDJ_ACTION";
+ String.id.IDS_SMARTDJ_PAGE_ERROR_GALLERY_TITLE = "IDS_SMARTDJ_PAGE_ERROR_GALLERY_TITLE";
+ String.id.IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION = "IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION";
+ String.id.IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION_LC = "IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION_LC";
+ String.id.IDS_SMARTDJ_PLAYING_TEXT = "IDS_SMARTDJ_PLAYING_TEXT";
+ String.id.IDS_SMARTDJ_PLAYING_TEXT_LC = "IDS_SMARTDJ_PLAYING_TEXT_LC";
+ String.id.IDS_SMARTDJ_POPULAR_ARTISTS_DIALOG_TITLE = "IDS_SMARTDJ_POPULAR_ARTISTS_DIALOG_TITLE";
+ String.id.IDS_SMARTDJ_POPULAR_ARTISTS_ENTRY_TEXT = "IDS_SMARTDJ_POPULAR_ARTISTS_ENTRY_TEXT";
+ String.id.IDS_SMARTDJ_PREMIUM_TRACK_ERROR_ACTION = "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_ACTION";
+ String.id.IDS_SMARTDJ_PREMIUM_TRACK_ERROR_DESC = "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_DESC";
+ String.id.IDS_SMARTDJ_PREMIUM_TRACK_ERROR_TITLE = "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_TITLE";
+ String.id.IDS_WHATSNEW_ABOUT_MUSIC_POPUP_TITLE = "IDS_WHATSNEW_ABOUT_MUSIC_POPUP_TITLE";
+ String.id.IDS_WHATSNEW_ABOUT_XBOX_MUSIC_POPUP_TITLE = "IDS_WHATSNEW_ABOUT_XBOX_MUSIC_POPUP_TITLE";
+ String.id.IDS_WHATSNEW_MUSIC_NOTIFICATION_TITLE = "IDS_WHATSNEW_MUSIC_NOTIFICATION_TITLE";
+ String.id.IDS_WHATSNEW_MUSIC_POPUP_TITLE = "IDS_WHATSNEW_MUSIC_POPUP_TITLE";
+ String.id.IDS_WHATSNEW_XBOX_MUSIC_NOTIFICATION_TITLE = "IDS_WHATSNEW_XBOX_MUSIC_NOTIFICATION_TITLE";
+ String.id.IDS_WHATSNEW_XBOX_MUSIC_POPUP_TITLE = "IDS_WHATSNEW_XBOX_MUSIC_POPUP_TITLE";
+
+ })();
+})();
+/* >>>>>>/framework/music1stringids.js:7642 */
+(function () {
+ /////////////////////////////////////////////////////////////////////////////
+ //
+ // music1StringIds.js
+ //
+ // This file was generated by the Stringer tool. Do not edit it!
+ //
+ // Copyright (C) Microsoft Corporation. All rights reserved.
+ //
+ /////////////////////////////////////////////////////////////////////////////
+
+ (function () {
+
+ String.id = String.id || {}
+
+ String.id.IDS_COLLECTION_CLOUDV2_BANNER1_ACTION = "IDS_COLLECTION_CLOUDV2_BANNER1_ACTION";
+ String.id.IDS_COLLECTION_CLOUDV2_BANNER1_ACTION2 = "IDS_COLLECTION_CLOUDV2_BANNER1_ACTION2";
+ String.id.IDS_COLLECTION_CLOUDV2_BANNER1_TITLE = "IDS_COLLECTION_CLOUDV2_BANNER1_TITLE";
+ String.id.IDS_COLLECTION_CLOUDV2_BANNER2_ACTION = "IDS_COLLECTION_CLOUDV2_BANNER2_ACTION";
+ String.id.IDS_COLLECTION_CLOUDV2_BANNER2_TITLE = "IDS_COLLECTION_CLOUDV2_BANNER2_TITLE";
+ String.id.IDS_MUSIC_ACTION_TRY_FOR_FREE = "IDS_MUSIC_ACTION_TRY_FOR_FREE";
+ String.id.IDS_MUSIC_ACTION_VIEW_UNPLAYABLE = "IDS_MUSIC_ACTION_VIEW_UNPLAYABLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_ITEM_EXPLICIT_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_ITEM_EXPLICIT_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_ALBUM_NOT_AVAILABLE_BANNER_FREE_USER = "IDS_MUSIC_ALBUM_NOT_AVAILABLE_BANNER_FREE_USER";
+ String.id.IDS_MUSIC_ARTIST_ALL_ALBUMS_TITLE = "IDS_MUSIC_ARTIST_ALL_ALBUMS_TITLE";
+ String.id.IDS_MUSIC_ARTIST_DETAILS_COLLECTION_ALBUMS_TITLE = "IDS_MUSIC_ARTIST_DETAILS_COLLECTION_ALBUMS_TITLE";
+ String.id.IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_BODY = "IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_BODY";
+ String.id.IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_TITLE = "IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_TITLE";
+ String.id.IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_OFF_TOOLTIP = "IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_OFF_TOOLTIP";
+ String.id.IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_ON_TOOLTIP = "IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_ON_TOOLTIP";
+ String.id.IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_FREE_FLYOUT_BODY = "IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_FREE_FLYOUT_BODY";
+ String.id.IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_PASS_FLYOUT_BODY = "IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_PASS_FLYOUT_BODY";
+ String.id.IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_ACTION = "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_ACTION";
+ String.id.IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_BODY = "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_BODY";
+ String.id.IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PASS_FLYOUT_BODY = "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PASS_FLYOUT_BODY";
+ String.id.IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PURCHASED_FLYOUT_BODY = "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PURCHASED_FLYOUT_BODY";
+ String.id.IDS_MUSIC_COLLECTION_BY_ALBUM_SORT = "IDS_MUSIC_COLLECTION_BY_ALBUM_SORT";
+ String.id.IDS_MUSIC_COLLECTION_BY_ALPHA_SORT = "IDS_MUSIC_COLLECTION_BY_ALPHA_SORT";
+ String.id.IDS_MUSIC_COLLECTION_BY_ALPHA_SORT_LC = "IDS_MUSIC_COLLECTION_BY_ALPHA_SORT_LC";
+ String.id.IDS_MUSIC_COLLECTION_BY_ARTIST_SORT = "IDS_MUSIC_COLLECTION_BY_ARTIST_SORT";
+ String.id.IDS_MUSIC_COLLECTION_BY_DATEADDED_SORT = "IDS_MUSIC_COLLECTION_BY_DATEADDED_SORT";
+ String.id.IDS_MUSIC_COLLECTION_BY_GENRE_SORT = "IDS_MUSIC_COLLECTION_BY_GENRE_SORT";
+ String.id.IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT = "IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT";
+ String.id.IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT_LC = "IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT_LC";
+ String.id.IDS_MUSIC_COLLECTION_BY_RELEASEYEAR_SORT = "IDS_MUSIC_COLLECTION_BY_RELEASEYEAR_SORT";
+ String.id.IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_DETAILS_CLEAR_DOWNLOAD_ERROR_ACTION = "IDS_MUSIC_DETAILS_CLEAR_DOWNLOAD_ERROR_ACTION";
+ String.id.IDS_MUSIC_DETAILS_OFFLINE_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_DETAILS_OFFLINE_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_DETAILS_RETRY_DOWNLOAD_ACTION = "IDS_MUSIC_DETAILS_RETRY_DOWNLOAD_ACTION";
+ String.id.IDS_MUSIC_DEVICES_CATEGORY1_FREE = "IDS_MUSIC_DEVICES_CATEGORY1_FREE";
+ String.id.IDS_MUSIC_DEVICES_CATEGORY2_FREE = "IDS_MUSIC_DEVICES_CATEGORY2_FREE";
+ String.id.IDS_MUSIC_DEVICES_EMPTY_ERROR_BODY = "IDS_MUSIC_DEVICES_EMPTY_ERROR_BODY";
+ String.id.IDS_MUSIC_DEVICES_EMPTY_ERROR_HEADER = "IDS_MUSIC_DEVICES_EMPTY_ERROR_HEADER";
+ String.id.IDS_MUSIC_DEVICES_EMPTY_MATCHING_BODY = "IDS_MUSIC_DEVICES_EMPTY_MATCHING_BODY";
+ String.id.IDS_MUSIC_DEVICES_EMPTY_MATCHING_HEADER = "IDS_MUSIC_DEVICES_EMPTY_MATCHING_HEADER";
+ String.id.IDS_MUSIC_DEVICES_EMPTY_MATCHING_LINK = "IDS_MUSIC_DEVICES_EMPTY_MATCHING_LINK";
+ String.id.IDS_MUSIC_DEVICES_SUBTITLE_LINE1_FREE = "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_FREE";
+ String.id.IDS_MUSIC_DEVICES_SUBTITLE_LINE1_PASS = "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_PASS";
+ String.id.IDS_MUSIC_DEVICES_SUBTITLE_LINE1_UNAUTH = "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_UNAUTH";
+ String.id.IDS_MUSIC_DEVICES_SUBTITLE_LINE2_FREE = "IDS_MUSIC_DEVICES_SUBTITLE_LINE2_FREE";
+ String.id.IDS_MUSIC_DEVICES_TITLE = "IDS_MUSIC_DEVICES_TITLE";
+ String.id.IDS_MUSIC_DEVICES_UPSELL_HEADER = "IDS_MUSIC_DEVICES_UPSELL_HEADER";
+ String.id.IDS_MUSIC_DEVICES_UPSELL_LINK = "IDS_MUSIC_DEVICES_UPSELL_LINK";
+ String.id.IDS_MUSIC_DEVICES_UPSELL_LINK_GENERIC = "IDS_MUSIC_DEVICES_UPSELL_LINK_GENERIC";
+ String.id.IDS_MUSIC_DEVICES_VIEW_ALBUM_LINK = "IDS_MUSIC_DEVICES_VIEW_ALBUM_LINK";
+ String.id.IDS_MUSIC_DEVICES_VIEW_ARTIST_LINK = "IDS_MUSIC_DEVICES_VIEW_ARTIST_LINK";
+ String.id.IDS_MUSIC_DTO_BUY_ALBUM_TEXT = "IDS_MUSIC_DTO_BUY_ALBUM_TEXT";
+ String.id.IDS_MUSIC_DTO_BUY_FREE_TEXT = "IDS_MUSIC_DTO_BUY_FREE_TEXT";
+ String.id.IDS_MUSIC_DTO_BUY_TRACK_TEXT = "IDS_MUSIC_DTO_BUY_TRACK_TEXT";
+ String.id.IDS_MUSIC_DTO_CANT_BUY_TEXT = "IDS_MUSIC_DTO_CANT_BUY_TEXT";
+ String.id.IDS_MUSIC_DTO_CONFIRM_FLYOUT_BODY = "IDS_MUSIC_DTO_CONFIRM_FLYOUT_BODY";
+ String.id.IDS_MUSIC_DTO_CONFIRM_FLYOUT_TITLE = "IDS_MUSIC_DTO_CONFIRM_FLYOUT_TITLE";
+ String.id.IDS_MUSIC_DTO_VIEW_ALBUM_TEXT = "IDS_MUSIC_DTO_VIEW_ALBUM_TEXT";
+ String.id.IDS_MUSIC_EDIT_METADATA_ALBUM_ACTION = "IDS_MUSIC_EDIT_METADATA_ALBUM_ACTION";
+ String.id.IDS_MUSIC_EDIT_METADATA_ALBUM_DIALOG_TITLE = "IDS_MUSIC_EDIT_METADATA_ALBUM_DIALOG_TITLE";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_CANCEL = "IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_CANCEL";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_SAVE = "IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_SAVE";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_BUTTON = "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_BUTTON";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LABEL = "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LABEL";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LOAD_ERROR = "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LOAD_ERROR";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_ARTIST = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_ARTIST";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE_CUSTOM = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE_CUSTOM";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_ARTIST = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_ARTIST";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_TITLE = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_TITLE";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_TITLE = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_TITLE";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_DISC_NUMBER = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_DISC_NUMBER";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_RELEASE_YEAR = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_RELEASE_YEAR";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_ARTIST = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_ARTIST";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_GENRE = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_GENRE";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_ARTIST = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_ARTIST";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_TITLE = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_TITLE";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_NUMBER = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_NUMBER";
+ String.id.IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_TITLE = "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_TITLE";
+ String.id.IDS_MUSIC_EDIT_METADATA_ERROR_DESCRIPTION = "IDS_MUSIC_EDIT_METADATA_ERROR_DESCRIPTION";
+ String.id.IDS_MUSIC_EDIT_METADATA_ERROR_TITLE = "IDS_MUSIC_EDIT_METADATA_ERROR_TITLE";
+ String.id.IDS_MUSIC_EDIT_METADATA_MULTI_ERROR_MESSAGE = "IDS_MUSIC_EDIT_METADATA_MULTI_ERROR_MESSAGE";
+ String.id.IDS_MUSIC_EDIT_METADATA_SINGLE_ERROR_MESSAGE = "IDS_MUSIC_EDIT_METADATA_SINGLE_ERROR_MESSAGE";
+ String.id.IDS_MUSIC_EDIT_METADATA_SONG_ACTION = "IDS_MUSIC_EDIT_METADATA_SONG_ACTION";
+ String.id.IDS_MUSIC_EDIT_METADATA_SONG_DIALOG_TITLE = "IDS_MUSIC_EDIT_METADATA_SONG_DIALOG_TITLE";
+ String.id.IDS_MUSIC_EDIT_METADATA_TOGGLE_SORT_FIELDS = "IDS_MUSIC_EDIT_METADATA_TOGGLE_SORT_FIELDS";
+ String.id.IDS_MUSIC_ERROR_DETAILS = "IDS_MUSIC_ERROR_DETAILS";
+ String.id.IDS_MUSIC_ERROR_HEADER = "IDS_MUSIC_ERROR_HEADER";
+ String.id.IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_FEATURED_TITLE = "IDS_MUSIC_FEATURED_TITLE";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_ACTION = "IDS_MUSIC_FREE_STREAM_CHANGED_ACTION";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_BODY = "IDS_MUSIC_FREE_STREAM_CHANGED_BODY";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_ACTION = "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_ACTION";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_BODY = "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_BODY";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_TITLE = "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_TITLE";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_ACTION = "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_ACTION";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_BODY = "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_BODY";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_TITLE = "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_TITLE";
+ String.id.IDS_MUSIC_FREE_STREAM_CHANGED_TITLE = "IDS_MUSIC_FREE_STREAM_CHANGED_TITLE";
+ String.id.IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_ACTION = "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_ACTION";
+ String.id.IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_BODY = "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_BODY";
+ String.id.IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_TITLE = "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_TITLE";
+ String.id.IDS_MUSIC_FREEBIES_TITLE = "IDS_MUSIC_FREEBIES_TITLE";
+ String.id.IDS_MUSIC_HIDE_MENU = "IDS_MUSIC_HIDE_MENU";
+ String.id.IDS_MUSIC_MANAGE_FOLDERS_TITLE = "IDS_MUSIC_MANAGE_FOLDERS_TITLE";
+ String.id.IDS_MUSIC_MODULE_SHOW_ALL_GENRES = "IDS_MUSIC_MODULE_SHOW_ALL_GENRES";
+ String.id.IDS_MUSIC_MODULE_SHOW_ALL_LABEL = "IDS_MUSIC_MODULE_SHOW_ALL_LABEL";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_ALBUMS = "IDS_MUSIC_MODULE_VIEW_ALL_ALBUMS";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_ARTISTS = "IDS_MUSIC_MODULE_VIEW_ALL_ARTISTS";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_LATEST_ALBUMS = "IDS_MUSIC_MODULE_VIEW_ALL_LATEST_ALBUMS";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_NEW_ALBUMS = "IDS_MUSIC_MODULE_VIEW_ALL_NEW_ALBUMS";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_SONGS = "IDS_MUSIC_MODULE_VIEW_ALL_SONGS";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_TOP_ALBUMS = "IDS_MUSIC_MODULE_VIEW_ALL_TOP_ALBUMS";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_TOP_ARTISTS = "IDS_MUSIC_MODULE_VIEW_ALL_TOP_ARTISTS";
+ String.id.IDS_MUSIC_MODULE_VIEW_ALL_TOP_SONGS = "IDS_MUSIC_MODULE_VIEW_ALL_TOP_SONGS";
+ String.id.IDS_MUSIC_MODULE_VIEWALL = "IDS_MUSIC_MODULE_VIEWALL";
+ String.id.IDS_MUSIC_NEW_ALBUMS_TITLE = "IDS_MUSIC_NEW_ALBUMS_TITLE";
+ String.id.IDS_MUSIC_NOW_PLAYING_ARTIST_RADIO = "IDS_MUSIC_NOW_PLAYING_ARTIST_RADIO";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION = "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION_DESC = "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION_DESC";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE = "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE_DESC = "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE_DESC";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO = "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO_DESC = "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO_DESC";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_SUBTITLE = "IDS_MUSIC_NOW_PLAYING_EMPTY_SUBTITLE";
+ String.id.IDS_MUSIC_NOW_PLAYING_EMPTY_TITLE = "IDS_MUSIC_NOW_PLAYING_EMPTY_TITLE";
+ String.id.IDS_MUSIC_NOW_PLAYING_ENTER_FULLSCREEN_ACTION = "IDS_MUSIC_NOW_PLAYING_ENTER_FULLSCREEN_ACTION";
+ String.id.IDS_MUSIC_NOW_PLAYING_EXIT_FULLSCREEN_ACTION = "IDS_MUSIC_NOW_PLAYING_EXIT_FULLSCREEN_ACTION";
+ String.id.IDS_MUSIC_NOW_PLAYING_SC = "IDS_MUSIC_NOW_PLAYING_SC";
+ String.id.IDS_MUSIC_NOW_PLAYING_UNHIDE_BUTTONS_NARRATOR = "IDS_MUSIC_NOW_PLAYING_UNHIDE_BUTTONS_NARRATOR";
+ String.id.IDS_MUSIC_OFFLINE_DETAILS = "IDS_MUSIC_OFFLINE_DETAILS";
+ String.id.IDS_MUSIC_OFFLINE_HEADER = "IDS_MUSIC_OFFLINE_HEADER";
+ String.id.IDS_MUSIC_PIN_RADIO_TILE_NAME = "IDS_MUSIC_PIN_RADIO_TILE_NAME";
+ String.id.IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_BODY = "IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE = "IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_RELEASE_NOTE_BUGS = "IDS_MUSIC_RELEASE_NOTE_BUGS";
+ String.id.IDS_MUSIC_SAVE_NOW_PLAYING_PLAYLIST = "IDS_MUSIC_SAVE_NOW_PLAYING_PLAYLIST";
+ String.id.IDS_MUSIC_SEARCH_ALBUM_RESULTS = "IDS_MUSIC_SEARCH_ALBUM_RESULTS";
+ String.id.IDS_MUSIC_SEARCH_ARTIST_RESULTS = "IDS_MUSIC_SEARCH_ARTIST_RESULTS";
+ String.id.IDS_MUSIC_SEARCH_CATALOG_FILTER = "IDS_MUSIC_SEARCH_CATALOG_FILTER";
+ String.id.IDS_MUSIC_SEARCH_CATALOG_FILTER_ACTION_PLURAL = "IDS_MUSIC_SEARCH_CATALOG_FILTER_ACTION_PLURAL";
+ String.id.IDS_MUSIC_SEARCH_CATALOG_FILTER_MAX_RESULTS = "IDS_MUSIC_SEARCH_CATALOG_FILTER_MAX_RESULTS";
+ String.id.IDS_MUSIC_SEARCH_CATALOG_FILTER_NO_COUNT = "IDS_MUSIC_SEARCH_CATALOG_FILTER_NO_COUNT";
+ String.id.IDS_MUSIC_SEARCH_CATALOG_PLACEHOLDER = "IDS_MUSIC_SEARCH_CATALOG_PLACEHOLDER";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_FILTER = "IDS_MUSIC_SEARCH_COLLECTION_FILTER";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_FILTER_ACTION_PLURAL = "IDS_MUSIC_SEARCH_COLLECTION_FILTER_ACTION_PLURAL";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_FILTER_MAX_RESULTS = "IDS_MUSIC_SEARCH_COLLECTION_FILTER_MAX_RESULTS";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_FILTER_NO_COUNT = "IDS_MUSIC_SEARCH_COLLECTION_FILTER_NO_COUNT";
+ String.id.IDS_MUSIC_SEARCH_COLLECTION_PLACEHOLDER = "IDS_MUSIC_SEARCH_COLLECTION_PLACEHOLDER";
+ String.id.IDS_MUSIC_SEARCH_SONG_RESULTS = "IDS_MUSIC_SEARCH_SONG_RESULTS";
+ String.id.IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_HOURS_PLURAL = "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_HOURS_PLURAL";
+ String.id.IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_NO_DATE = "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_NO_DATE";
+ String.id.IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_PLURAL = "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_PLURAL";
+ String.id.IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_REACHED = "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_REACHED";
+ String.id.IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_TITLE = "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_TITLE";
+ String.id.IDS_MUSIC_SHARE_ALTERNATIVES_TEXT = "IDS_MUSIC_SHARE_ALTERNATIVES_TEXT";
+ String.id.IDS_MUSIC_SHARE_CHARM_TEXT = "IDS_MUSIC_SHARE_CHARM_TEXT";
+ String.id.IDS_MUSIC_SHARE_CREATE_PLAYLIST_LABEL = "IDS_MUSIC_SHARE_CREATE_PLAYLIST_LABEL";
+ String.id.IDS_MUSIC_SHARE_FEATURE_COMING_SOON = "IDS_MUSIC_SHARE_FEATURE_COMING_SOON";
+ String.id.IDS_MUSIC_SHARE_FEEDBACK = "IDS_MUSIC_SHARE_FEEDBACK";
+ String.id.IDS_MUSIC_SHARE_FREE_USER_TITLE = "IDS_MUSIC_SHARE_FREE_USER_TITLE";
+ String.id.IDS_MUSIC_SHARE_LOADING_CREATING_PLAYLIST = "IDS_MUSIC_SHARE_LOADING_CREATING_PLAYLIST";
+ String.id.IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC = "IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC";
+ String.id.IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC_SUB = "IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC_SUB";
+ String.id.IDS_MUSIC_SHARE_NO_ARTIST_FOUND = "IDS_MUSIC_SHARE_NO_ARTIST_FOUND";
+ String.id.IDS_MUSIC_SHARE_NO_ARTIST_FOUND_SUB = "IDS_MUSIC_SHARE_NO_ARTIST_FOUND_SUB";
+ String.id.IDS_MUSIC_SHARE_PARTNERS_LABEL = "IDS_MUSIC_SHARE_PARTNERS_LABEL";
+ String.id.IDS_MUSIC_SHARE_PREVIEW = "IDS_MUSIC_SHARE_PREVIEW";
+ String.id.IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED = "IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED";
+ String.id.IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED_SUB = "IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED_SUB";
+ String.id.IDS_MUSIC_SHARE_REMOVE_ARTIST_LABEL = "IDS_MUSIC_SHARE_REMOVE_ARTIST_LABEL";
+ String.id.IDS_MUSIC_SHARE_REMOVE_TRACK_BY_ARTIST_LABEL = "IDS_MUSIC_SHARE_REMOVE_TRACK_BY_ARTIST_LABEL";
+ String.id.IDS_MUSIC_SHARE_SAS_FEEDBACK_COMMENTS = "IDS_MUSIC_SHARE_SAS_FEEDBACK_COMMENTS";
+ String.id.IDS_MUSIC_SHARE_SAS_FEEDBACK_TYPE = "IDS_MUSIC_SHARE_SAS_FEEDBACK_TYPE";
+ String.id.IDS_MUSIC_SHARE_SAS_FEEDBACK_URL_NOTE = "IDS_MUSIC_SHARE_SAS_FEEDBACK_URL_NOTE";
+ String.id.IDS_MUSIC_SHARE_SERVICE_DOWN = "IDS_MUSIC_SHARE_SERVICE_DOWN";
+ String.id.IDS_MUSIC_SHARE_SERVICE_DOWN_SUB = "IDS_MUSIC_SHARE_SERVICE_DOWN_SUB";
+ String.id.IDS_MUSIC_SHOW_MENU = "IDS_MUSIC_SHOW_MENU";
+ String.id.IDS_MUSIC_SONG_CANT_PLAY_FLYOUT_BODY = "IDS_MUSIC_SONG_CANT_PLAY_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_DOWNLOAD_ONLY_FLYOUT_BODY = "IDS_MUSIC_SONG_DOWNLOAD_ONLY_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_NOT_AVAILABLE_BANNER_FREE_USER = "IDS_MUSIC_SONG_NOT_AVAILABLE_BANNER_FREE_USER";
+ String.id.IDS_MUSIC_SONG_PASS_ONLY_FLYOUT_BODY = "IDS_MUSIC_SONG_PASS_ONLY_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_PASS_PURCHASE_FLYOUT_BODY = "IDS_MUSIC_SONG_PASS_PURCHASE_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_FLYOUT_BODY = "IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_UNROAMED_FLYOUT_BODY = "IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_UNROAMED_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_PRE_RELEASE_FLYOUT_BODY = "IDS_MUSIC_SONG_PRE_RELEASE_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY = "IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_PURCHASE_ONLY_FLYOUT_BODY = "IDS_MUSIC_SONG_PURCHASE_ONLY_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_STREAMING_ONLY_FLYOUT_BODY = "IDS_MUSIC_SONG_STREAMING_ONLY_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_TAKEDOWN_FLYOUT_BODY = "IDS_MUSIC_SONG_TAKEDOWN_FLYOUT_BODY";
+ String.id.IDS_MUSIC_SONG_UNAVAILABLE_FLYOUT_BODY = "IDS_MUSIC_SONG_UNAVAILABLE_FLYOUT_BODY";
+ String.id.IDS_MUSIC_STREAMING_AD_DESC_LINK = "IDS_MUSIC_STREAMING_AD_DESC_LINK";
+ String.id.IDS_MUSIC_STREAMING_AD_LABEL = "IDS_MUSIC_STREAMING_AD_LABEL";
+ String.id.IDS_MUSIC_STREAMING_ADD_TO_MY_MUSIC_TITLE = "IDS_MUSIC_STREAMING_ADD_TO_MY_MUSIC_TITLE";
+ String.id.IDS_MUSIC_STREAMING_CANT_PLAY_DESC = "IDS_MUSIC_STREAMING_CANT_PLAY_DESC";
+ String.id.IDS_MUSIC_STREAMING_CANT_PLAY_TITLE = "IDS_MUSIC_STREAMING_CANT_PLAY_TITLE";
+ String.id.IDS_MUSIC_STREAMING_EMPTY_ROOM_DESC = "IDS_MUSIC_STREAMING_EMPTY_ROOM_DESC";
+ String.id.IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE1 = "IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE2 = "IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE2";
+ String.id.IDS_MUSIC_STREAMING_EMPTY_ROOM_PLAY_ACTION = "IDS_MUSIC_STREAMING_EMPTY_ROOM_PLAY_ACTION";
+ String.id.IDS_MUSIC_STREAMING_EMPTY_ROOM_PREMIUM_ACITON = "IDS_MUSIC_STREAMING_EMPTY_ROOM_PREMIUM_ACITON";
+ String.id.IDS_MUSIC_STREAMING_EMPTY_ROOM_TITLE = "IDS_MUSIC_STREAMING_EMPTY_ROOM_TITLE";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_ACTION = "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_ACTION";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_DESC = "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_DESC";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_TITLE = "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_TITLE";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_ACTION = "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_ACTION";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_DESC = "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_DESC";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_TITLE = "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_TITLE";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE1 = "IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE2 = "IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE2";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_HOURS_PLURAL = "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_HOURS_PLURAL";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_NO_DATE = "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_NO_DATE";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_PLURAL = "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_PLURAL";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE1 = "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE2 = "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE2";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_PC_FILTER_LINK = "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_PC_FILTER_LINK";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_LIMIT_TITLE = "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_TITLE";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE1 = "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2 = "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2";
+ String.id.IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2_PLURAL = "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2_PLURAL";
+ String.id.IDS_MUSIC_STREAMING_NEXT_SONG_LABEL = "IDS_MUSIC_STREAMING_NEXT_SONG_LABEL";
+ String.id.IDS_MUSIC_STREAMING_NO_DOWNLOAD_DESC = "IDS_MUSIC_STREAMING_NO_DOWNLOAD_DESC";
+ String.id.IDS_MUSIC_STREAMING_NO_DOWNLOAD_PREMIUM_ACTION = "IDS_MUSIC_STREAMING_NO_DOWNLOAD_PREMIUM_ACTION";
+ String.id.IDS_MUSIC_STREAMING_NO_DOWNLOAD_PURCHASE_ACTION = "IDS_MUSIC_STREAMING_NO_DOWNLOAD_PURCHASE_ACTION";
+ String.id.IDS_MUSIC_STREAMING_NO_DOWNLOAD_TITLE = "IDS_MUSIC_STREAMING_NO_DOWNLOAD_TITLE";
+ String.id.IDS_MUSIC_STREAMING_PLAY_LIMIT_DESC = "IDS_MUSIC_STREAMING_PLAY_LIMIT_DESC";
+ String.id.IDS_MUSIC_STREAMING_PLAY_LIMIT_PREMIUM_ACTION = "IDS_MUSIC_STREAMING_PLAY_LIMIT_PREMIUM_ACTION";
+ String.id.IDS_MUSIC_STREAMING_PLAY_LIMIT_TITLE = "IDS_MUSIC_STREAMING_PLAY_LIMIT_TITLE";
+ String.id.IDS_MUSIC_STREAMING_SIGN_IN_ACTION = "IDS_MUSIC_STREAMING_SIGN_IN_ACTION";
+ String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC = "IDS_MUSIC_STREAMING_SIGN_IN_DESC";
+ String.id.IDS_MUSIC_STREAMING_SIGN_IN_TITLE = "IDS_MUSIC_STREAMING_SIGN_IN_TITLE";
+ String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY = "IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY";
+ String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY_NO_COUNT = "IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY_NO_COUNT";
+ String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_BUY_ACTION = "IDS_MUSIC_STREAMING_TRACK_LIMIT_BUY_ACTION";
+ String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY = "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY";
+ String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY_NO_COUNT = "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY_NO_COUNT";
+ String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_TITLE = "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_TITLE";
+ String.id.IDS_MUSIC_STREAMING_TRACK_LIMIT_TITLE = "IDS_MUSIC_STREAMING_TRACK_LIMIT_TITLE";
+ String.id.IDS_MUSIC_STREAMING_TRAVEL_LIMIT_DESC = "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_DESC";
+ String.id.IDS_MUSIC_STREAMING_TRAVEL_LIMIT_PREMIUM_ACTION = "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_PREMIUM_ACTION";
+ String.id.IDS_MUSIC_STREAMING_TRAVEL_LIMIT_TITLE = "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_TITLE";
+ String.id.IDS_MUSIC_STREAMING_TRIAL_END_BODY = "IDS_MUSIC_STREAMING_TRIAL_END_BODY";
+ String.id.IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE1 = "IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE2 = "IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE2";
+ String.id.IDS_MUSIC_STREAMING_TRIAL_END_PREMIUM_LINK = "IDS_MUSIC_STREAMING_TRIAL_END_PREMIUM_LINK";
+ String.id.IDS_MUSIC_STREAMING_TRIAL_END_TITLE = "IDS_MUSIC_STREAMING_TRIAL_END_TITLE";
+ String.id.IDS_MUSIC_STREAMING_UPSELL_LABEL = "IDS_MUSIC_STREAMING_UPSELL_LABEL";
+ String.id.IDS_MUSIC_TOP_ARTISTS_TITLE = "IDS_MUSIC_TOP_ARTISTS_TITLE";
+ String.id.IDS_MUSIC_TOP_MUSIC_TITLE = "IDS_MUSIC_TOP_MUSIC_TITLE";
+ String.id.IDS_MUSIC_TOP_SONGS_TITLE = "IDS_MUSIC_TOP_SONGS_TITLE";
+ String.id.IDS_MUSIC_TOPALBUMS_TITLE = "IDS_MUSIC_TOPALBUMS_TITLE";
+ String.id.IDS_MUSIC_TRANSFER_CANCEL_TOOLTIP = "IDS_MUSIC_TRANSFER_CANCEL_TOOLTIP";
+ String.id.IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_LABEL = "IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_LABEL";
+ String.id.IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_PROGRESS = "IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_PROGRESS";
+ String.id.IDS_MUSIC_TRANSFER_UPLOAD_GROUP_LABEL = "IDS_MUSIC_TRANSFER_UPLOAD_GROUP_LABEL";
+ String.id.IDS_MUSIC_TRANSFER_UPLOAD_GROUP_PROGRESS = "IDS_MUSIC_TRANSFER_UPLOAD_GROUP_PROGRESS";
+ String.id.IDS_MUSIC_UPSELL_BANNER_LEARN_MORE = "IDS_MUSIC_UPSELL_BANNER_LEARN_MORE";
+ String.id.IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION = "IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION";
+ String.id.IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION2 = "IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION2";
+ String.id.IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION = "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION";
+ String.id.IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION_ASTERISK = "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION_ASTERISK";
+ String.id.IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2 = "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2";
+ String.id.IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2_ASTERISK = "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2_ASTERISK";
+ String.id.IDS_MUSIC_UPSELL_BANNER_TEXT = "IDS_MUSIC_UPSELL_BANNER_TEXT";
+ String.id.IDS_MUSIC_UPSELL_BANNER_TEXT2 = "IDS_MUSIC_UPSELL_BANNER_TEXT2";
+ String.id.IDS_MUSIC_UPSELL_BANNER_TEXT3 = "IDS_MUSIC_UPSELL_BANNER_TEXT3";
+ String.id.IDS_MUSIC_UPSELL_BANNER_TEXT4 = "IDS_MUSIC_UPSELL_BANNER_TEXT4";
+ String.id.IDS_MUSIC_UPSELL_BANNER_TEXT5 = "IDS_MUSIC_UPSELL_BANNER_TEXT5";
+ String.id.IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT = "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT";
+ String.id.IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_NO_TRENDING = "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_NO_TRENDING";
+ String.id.IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_TRENDING = "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_TRENDING";
+ String.id.IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT2 = "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT2";
+ String.id.IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT3 = "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT3";
+ String.id.IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT4 = "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT4";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_ACTION = "IDS_MUSIC_UPSELL_DIALOG_ACTION";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_DISCLAIMER = "IDS_MUSIC_UPSELL_DIALOG_DISCLAIMER";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_LINE1 = "IDS_MUSIC_UPSELL_DIALOG_LINE1";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_LINE2 = "IDS_MUSIC_UPSELL_DIALOG_LINE2";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_LINE3 = "IDS_MUSIC_UPSELL_DIALOG_LINE3";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_MUSIC_PASS_DISCLAIMER = "IDS_MUSIC_UPSELL_DIALOG_MUSIC_PASS_DISCLAIMER";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_REDEEM_BUTTON = "IDS_MUSIC_UPSELL_DIALOG_REDEEM_BUTTON";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_TITLE = "IDS_MUSIC_UPSELL_DIALOG_TITLE";
+ String.id.IDS_MUSIC_UPSELL_DIALOG_TITLE_ALT = "IDS_MUSIC_UPSELL_DIALOG_TITLE_ALT";
+ String.id.IDS_MUSIC_WELCOME_CLOUDV2_BUTTON = "IDS_MUSIC_WELCOME_CLOUDV2_BUTTON";
+ String.id.IDS_MUSIC_WELCOME_CLOUDV2_SUBTITLE = "IDS_MUSIC_WELCOME_CLOUDV2_SUBTITLE";
+ String.id.IDS_MUSIC_WELCOME_CLOUDV2_TITLE = "IDS_MUSIC_WELCOME_CLOUDV2_TITLE";
+ String.id.IDS_MUSIC_WELCOME_COLLECTION_BUTTON = "IDS_MUSIC_WELCOME_COLLECTION_BUTTON";
+ String.id.IDS_MUSIC_WELCOME_COLLECTION_SUBTITLE = "IDS_MUSIC_WELCOME_COLLECTION_SUBTITLE";
+ String.id.IDS_MUSIC_WELCOME_COLLECTION_TITLE = "IDS_MUSIC_WELCOME_COLLECTION_TITLE";
+ String.id.IDS_MUSIC_WELCOME_EXPLORE_BUTTON = "IDS_MUSIC_WELCOME_EXPLORE_BUTTON";
+ String.id.IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE = "IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE";
+ String.id.IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE_2 = "IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE_2";
+ String.id.IDS_MUSIC_WELCOME_EXPLORE_TITLE = "IDS_MUSIC_WELCOME_EXPLORE_TITLE";
+ String.id.IDS_MUSIC_WELCOME_GO_PREMIUM_BUTTON = "IDS_MUSIC_WELCOME_GO_PREMIUM_BUTTON";
+ String.id.IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE = "IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE";
+ String.id.IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE2 = "IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE2";
+ String.id.IDS_MUSIC_WELCOME_GO_PREMIUM_TITLE = "IDS_MUSIC_WELCOME_GO_PREMIUM_TITLE";
+ String.id.IDS_MUSIC_WELCOME_PAGE_SUBTITLE = "IDS_MUSIC_WELCOME_PAGE_SUBTITLE";
+ String.id.IDS_MUSIC_WELCOME_PAGE_TITLE = "IDS_MUSIC_WELCOME_PAGE_TITLE";
+ String.id.IDS_MUSIC_WELCOME_RADIO_BUTTON = "IDS_MUSIC_WELCOME_RADIO_BUTTON";
+ String.id.IDS_MUSIC_WELCOME_RADIO_SUBTITLE = "IDS_MUSIC_WELCOME_RADIO_SUBTITLE";
+ String.id.IDS_MUSIC_WELCOME_RADIO_TITLE = "IDS_MUSIC_WELCOME_RADIO_TITLE";
+ String.id.IDS_VIDEO_AD_LEARN_MORE = "IDS_VIDEO_AD_LEARN_MORE";
+ String.id.IDS_VIDEO_AD_PROGRESS = "IDS_VIDEO_AD_PROGRESS";
+ String.id.IDS_VIDEO_AD_UPSELL_LINE_1 = "IDS_VIDEO_AD_UPSELL_LINE_1";
+ String.id.IDS_VIDEO_AD_UPSELL_LINE_2 = "IDS_VIDEO_AD_UPSELL_LINE_2";
+
+ })();
+})();
+/* >>>>>>/framework/corefx.js:8000 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ var isInUnitTest = window.isInUnitTest;
+ var controlId = 0;
+ var pendedControlsWeakRefTable;
+ var pendingCleanup = [];
+ var pendingElementRemovals = [];
+ var pendingCleanupTimer = null;
+ var alreadyHandlingElementRemove = false;
+ var templateCache = {};
+ var fragmentCache = {};
+ var garbageCollectPromise = null;
+ var queuedTemplatesToPreload = [];
+ var queuedCriticalTemplatesToPreload = [];
+ var currentTextDirection = "";
+ var placeholderCssProperties = {
+ fontWeight: "font-weight", color: "color", fontSize: "font-size", letterSpacing: "letter-spacing", overflow: "overflow", textOverflow: "-ms-text-overflow", lineHeight: "line-height", whiteSpace: "white-space", backgroundColor: "background-color"
+ };
+ var bindingElementTargetWeakRefTable;
+ function getBindingTargetWeakRefTable() {
+ if (!bindingElementTargetWeakRefTable)
+ bindingElementTargetWeakRefTable = new MS.Entertainment.UI.Framework.WeakRefTable("about://bindingElementTarget");
+ return bindingElementTargetWeakRefTable
+ }
+ function patchWindowAlert() {
+ var alertsToShow = [];
+ var dialogVisible = false;
+ function showPendingAlerts() {
+ if (dialogVisible || !alertsToShow.length)
+ return;
+ dialogVisible = true;
+ new Windows.UI.Popups.MessageDialog(alertsToShow.shift()).showAsync().done(function () {
+ dialogVisible = false;
+ showPendingAlerts()
+ })
+ }
+ window.alert = function (message) {
+ if (window.console && window.console.log)
+ window.console.log(message);
+ if (!isInUnitTest) {
+ alertsToShow.push(message);
+ showPendingAlerts()
+ }
+ }
+ }
+ if (!window.alert)
+ patchWindowAlert();
+ var fxassert = function fixupAssertHelper() {
+ var existingAssert = WinJS.Utilities.getMember("MS.Entertainment.UI.Framework.assert");
+ if (existingAssert)
+ fxassert = existingAssert;
+ else
+ fxassert = localFxassert;
+ fxassert.apply(null, arguments)
+ };
+ function localFxassert(assertion, message) {
+ if (assertion)
+ return;
+ debugger
+ }
+ { };
+ var EventMixinEvent = WinJS.Class.define(function EventMixinEvent_ctor(type, detail, target) {
+ this.detail = detail;
+ this.target = target;
+ this.srcElement = target;
+ this.timeStamp = Date.now();
+ this.type = type
+ }, {
+ bubbles: {
+ value: false, writable: false
+ }, cancelable: {
+ value: false, writable: false
+ }, currentTarget: {
+ get: function () {
+ return this.target
+ }
+ }, defaultPrevented: {
+ get: function () {
+ return this._preventDefaultCalled
+ }
+ }, trusted: {
+ value: false, writable: false
+ }, eventPhase: {
+ value: 0, writable: false
+ }, target: null, srcElement: null, timeStamp: null, type: null, preventDefault: function () {
+ this._preventDefaultCalled = true
+ }, stopImmediatePropagation: function () {
+ this._stopImmediatePropagationCalled = true
+ }, stopPropagation: function () { }
+ }, { supportedForProcessing: false });
+ var eventMixin = {
+ _eventListeners: null, addEventListener: function (type, listener, useCapture) {
+ useCapture = useCapture || false;
+ this._eventListeners = this._eventListeners || {};
+ var eventListeners = (this._eventListeners[type] = this._eventListeners[type] || []);
+ for (var i = 0, len = eventListeners.length; i < len; i++) {
+ var l = eventListeners[i];
+ if (l.useCapture === useCapture && l.listener === listener)
+ return
+ }
+ eventListeners.push({
+ listener: listener, useCapture: useCapture
+ })
+ }, dispatchEvent: function (type, details) {
+ var listeners = this._eventListeners && this._eventListeners[type];
+ if (listeners) {
+ var eventValue = new EventMixinEvent(type, details, this);
+ listeners = listeners.slice(0, listeners.length);
+ for (var i = 0, len = listeners.length; i < len && !eventValue._stopImmediatePropagationCalled; i++)
+ listeners[i].listener(eventValue);
+ return eventValue.defaultPrevented || false
+ }
+ return false
+ }, removeEventListener: function (type, listener, useCapture) {
+ useCapture = useCapture || false;
+ var listeners = this._eventListeners && this._eventListeners[type];
+ if (listeners)
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ var l = listeners[i];
+ if (l.listener === listener && l.useCapture === useCapture) {
+ listeners.splice(i, 1);
+ if (listeners.length === 0)
+ delete this._eventListeners[type];
+ break
+ }
+ }
+ }
+ };
+ var updatePropertyMixin = {
+ updateAndNotify: function updateAndNotifyProperty(name, newValue) {
+ var storageName = "_" + name;
+ var oldValue = this[storageName];
+ if (oldValue === newValue)
+ return WinJS.Promise.wrap();
+ this[storageName] = newValue;
+ return this.dispatchChangeAndNotify(name, newValue, oldValue)
+ }, dispatchChangeAndNotify: function dispatchChangeAndNotify(name, newValue, oldValue) {
+ this.dispatchEvent(name + "Changed", {
+ newValue: newValue, oldValue: oldValue
+ });
+ return this.notify(name, newValue, oldValue)
+ }
+ };
+ var scriptTagCache = {};
+ var baseAppUriLength = (window.location.protocol + "//" + window.location.host).length;
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ derive: function derive(baseClass, constructor, instanceMembers, staticMembers) {
+ var value;
+ return {
+ get: function derive_getter() {
+ if (value)
+ return value;
+ if (typeof baseClass === "string") {
+ var baseClassName = baseClass;
+ baseClass = WinJS.Utilities.getMember(baseClass);
+ fxassert(baseClass, "Could not resolve baseClass named " + baseClassName)
+ }
+ fxassert(baseClass, "Base class was not valid. Can't derive without something to derive from");
+ instanceMembers = instanceMembers || {};
+ if (!instanceMembers.base && baseClass instanceof Function)
+ instanceMembers.base = function () {
+ var original = this.base;
+ this.base = baseClass.prototype.base;
+ baseClass.apply(this, arguments);
+ this.base = original
+ };
+ value = WinJS.Class.derive(baseClass, constructor, instanceMembers, staticMembers);
+ return value
+ }, set: function derive_setter(v) {
+ value = v
+ }, configurable: true
+ }
+ }, define: function define(constructor, instanceMembers, staticMembers) {
+ var value;
+ return {
+ get: function define_getter() {
+ if (value)
+ return value;
+ value = WinJS.Class.define(constructor, instanceMembers, staticMembers);
+ return value
+ }, set: function define_setter(v) {
+ value = v
+ }
+ }
+ }, lazyDefine: function lazyDefine(work) {
+ var value;
+ return {
+ get: function lazyDefine_getter() {
+ if (value)
+ return value;
+ value = work();
+ return value
+ }, set: function lazyDefine_setter(v) {
+ value = v
+ }, configurable: true
+ }
+ }, _loadScriptsWork: function _loadScriptsWork(lazyLoad, fileList) {
+ var scriptsToLoad = Array.prototype.map.call(fileList, function (item) {
+ item = item.toLowerCase();
+ if (item.charAt(0) !== "/")
+ throw new Error("Must use absolute path: " + item);
+ return item
+ });
+ var refreshedCache = false;
+ var scriptsLoaded = scriptsToLoad.reduce(function (data, script) {
+ if (MS.Entertainment.UI.Framework.scriptMappings) {
+ var mappedScript = MS.Entertainment.UI.Framework.scriptMappings[script.toLowerCase()];
+ if (mappedScript)
+ script = mappedScript
+ }
+ if (scriptTagCache.hasOwnProperty(script))
+ return data;
+ if (!refreshedCache) {
+ MS.Entertainment.UI.Framework._refreshScriptLoaderCache();
+ refreshedCache = true
+ }
+ if (scriptTagCache.hasOwnProperty(script))
+ return data;
+ var complete = WinJS.Promise.as();
+ if (WinJS.Utilities.Scheduler && WinJS.Promise.is(data))
+ complete = data.then(function () {
+ return WinJS.Utilities.Scheduler.schedulePromiseNormal(null, "MS.Entertainment_LazyScriptLoader:" + script)
+ });
+ complete = complete.then(function () {
+ if (scriptTagCache.hasOwnProperty(script))
+ return;
+ var scriptTag = document.createElement("script");
+ scriptTag.setAttribute("async", "false");
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ var oncompleted = signal.complete.bind(signal);
+ scriptTag.addEventListener("error", oncompleted);
+ scriptTag.addEventListener("load", oncompleted);
+ scriptTagCache[script] = null;
+ scriptTag.setAttribute("src", script);
+ document.head.appendChild(scriptTag);
+ return signal.promise
+ });
+ if (Array.isArray(data))
+ data.push(complete);
+ else
+ data = complete;
+ return data
+ }, (lazyLoad ? WinJS.Promise.as() : []));
+ return (WinJS.Promise.is(scriptsLoaded) ? scriptsLoaded : WinJS.Promise.join(scriptsLoaded))
+ }, loadScripts: function loadScripts() {
+ return MS.Entertainment.UI.Framework._loadScriptsWork.call(this, false, arguments)
+ }, lazyLoadScripts: function lazyLoadScripts() {
+ return MS.Entertainment.UI.Framework._loadScriptsWork.call(this, true, arguments)
+ }, _refreshScriptLoaderCache: function _refreshScriptLoaderCache() {
+ var documentScripts = document.head.querySelectorAll("script[src]");
+ var scriptsLength = Object.keys(scriptTagCache).length;
+ var documentScriptsLength = documentScripts.length;
+ for (var i = scriptsLength; i < documentScriptsLength; i++)
+ scriptTagCache[documentScripts[i].src.substr(baseAppUriLength).toLowerCase()] = null
+ }, _clearScriptLoaderCache: function _clearScriptLoaderCache() {
+ scriptTagCache = {}
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ RIGHT_MOUSEBUTTON: 2, POINTER_TYPE_TOUCH: 2, flags: {
+ attachLargeObjectToUnloadedControl: false, attachCookieToRemovedDomElements: false, dontPendControlUnloadCleanup: false
+ }, enableSetImmediateBatching: function enableSetImmediateBatching() {
+ if (WinJS.Utilities.Scheduler)
+ return;
+ if (window.setImmediatePatched)
+ return;
+ var queue = [];
+ var originalSetImmediate = window.setImmediate;
+ var setImmediateCallback = function setImmediateCallback() {
+ var timeNow = Date.now();
+ do {
+ try {
+ queue[0].callback(queue[0].args)
+ }
+ catch (e) {
+ WinJS.Application.onerror(e)
+ }
+ queue.shift()
+ } while (queue.length && (Date.now() - timeNow) < MS.Entertainment.UI.Framework._setImmediateTimeSlice);
+ if (queue.length)
+ originalSetImmediate(setImmediateCallback)
+ };
+ window.setImmediate = function _setImmediate(callback, args) {
+ if (MS.Entertainment.UI.Framework._setImmediateTimeSlice) {
+ queue.push({
+ callback: callback, args: args
+ });
+ if (queue.length === 1)
+ originalSetImmediate(setImmediateCallback)
+ }
+ else
+ originalSetImmediate(callback, args)
+ };
+ window.setImmediatePatched = true;
+ if (!isInUnitTest)
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.startup
+ }, setImmediateMode: {
+ set: function setImmediateMode(value) {
+ MS.Entertainment.UI.Framework._setImmediateTimeSlice = value
+ }
+ }, setImmediateModes: {
+ startup: 300, normal: 100, panning: 0, none: 0
+ }, _setImmediateTimeSlice: 0, ObservableBase: WinJS.Class.mix(function observableBaseConstructor() { }, eventMixin, updatePropertyMixin, WinJS.Binding.mixin), PropertyChangedEventArgs: WinJS.Class.define(function ObservablePropertyChangeEventArgs(newValue, oldValue) {
+ this.detail = {
+ newValue: newValue, oldValue: oldValue
+ }
+ }, { detail: null }), EventMixin: eventMixin, UpdatePropertyMixin: updatePropertyMixin, observableProperty: function observableProperty(name, value, makeValueObservable) {
+ var storageName = "_" + name;
+ return {
+ get: function getter() {
+ if (!(storageName in this))
+ return value;
+ var currentValue = this[storageName];
+ if (makeValueObservable)
+ currentValue = WinJS.Binding.as(currentValue);
+ return currentValue
+ }, set: function setter(newValue) {
+ if (makeValueObservable)
+ newValue = WinJS.Binding.unwrap(newValue);
+ this.updateAndNotify(name, newValue)
+ }
+ }
+ }, preloadEnabled: false, preloadCriticalEnabled: false, preloadTemplate: function preloadTemplate(template, critical) {
+ if (critical && !MS.Entertainment.UI.Framework.preloadCriticalEnabled)
+ queuedCriticalTemplatesToPreload.push(template);
+ else if (!critical && !MS.Entertainment.UI.Framework.preloadEnabled)
+ queuedTemplatesToPreload.push(template);
+ else
+ MS.Entertainment.UI.Framework.loadTemplate(template, null, true)
+ }, unblockCriticalPreloading: function unblockCriticalPreloading() {
+ MS.Entertainment.UI.Framework.preloadCriticalEnabled = true;
+ var preloads = queuedCriticalTemplatesToPreload;
+ queuedCriticalTemplatesToPreload = [];
+ preloads.forEach(function (template) {
+ MS.Entertainment.UI.Framework.loadTemplate(template, null, true)
+ })
+ }, unblockPreloading: function unblockPreloading() {
+ MS.Entertainment.UI.Framework.preloadEnabled = true;
+ var preloads = queuedTemplatesToPreload;
+ queuedTemplatesToPreload = [];
+ preloads.forEach(function (template) {
+ MS.Entertainment.UI.Framework.loadTemplate(template, null, true)
+ })
+ }, parseTemplate: function parseTemplate(templatePath) {
+ if (!templatePath)
+ throw new Error("No valid template path supplied");
+ var parts = templatePath.split("#", 2);
+ var result = {
+ path: parts[0], id: ""
+ };
+ if (parts.length > 1)
+ result.id = parts[1];
+ return result
+ }, loadTemplate: function loadTemplate(templatePath, templateId, skipDefer) {
+ var templateParts;
+ var templateName;
+ var cacheKey;
+ if (!templatePath)
+ return WinJS.Promise.as();
+ if (!templateId) {
+ templateParts = MS.Entertainment.UI.Framework.parseTemplate(templatePath);
+ templatePath = templateParts.path;
+ templateId = templateParts.id
+ }
+ if (!templateId)
+ throw new Error("Couldn't find a templateid in the provided path: " + templatePath);
+ cacheKey = templatePath + "#" + templateId;
+ window.msWriteProfilerMark("corefx:LoadTemplate:" + cacheKey + ",StartTM");
+ function getTemplate() {
+ var cachedControl = templateCache[cacheKey];
+ if (cachedControl) {
+ window.msWriteProfilerMark("corefx:LoadTemplate:CompletedFromCache");
+ window.msWriteProfilerMark("corefx:LoadTemplate:" + cacheKey + ",StopTM");
+ return cachedControl
+ }
+ var fragmentPromise = fragmentCache[templatePath];
+ window.msWriteProfilerMark("corefx:LoadTemplate:NotInCache");
+ if (!fragmentPromise) {
+ try {
+ fragmentPromise = WinJS.UI.Fragments.renderCopy(templatePath)
+ }
+ catch (e) {
+ MS.Entertainment.UI.Framework.fail("Failed to renderCopy for " + templatePath + " Error: " + e.toString());
+ return
+ }
+ fragmentCache[templatePath] = fragmentPromise
+ }
+ return fragmentPromise.then(function renderFragment(v) {
+ window.msWriteProfilerMark("corefx:LoadTemplate:FragmentLoaded");
+ var elements = v.querySelectorAll("[data-ent-templateid]");
+ var requestedTemplatePromise;
+ Array.prototype.forEach.call(elements, function instantiateAllTemplatesInFragment(template) {
+ var control = WinJS.UI.process(template);
+ var controlId = template.getAttribute("data-ent-templateid");
+ if (controlId === templateId)
+ requestedTemplatePromise = control;
+ control.then(function insertTemplateIntoCache(templateInstance) {
+ if (templateInstance)
+ templateInstance.disableOptimizedProcessing = true;
+ return templateCache[templatePath + "#" + controlId] = templateInstance
+ })
+ });
+ if (!requestedTemplatePromise)
+ throw "Could not locate template: " + templateId;
+ window.msWriteProfilerMark("corefx:LoadTemplate:TemplateExtracted");
+ return requestedTemplatePromise
+ }).then(function (processedControl) {
+ fxassert(processedControl, "Template found was not a control");
+ processedControl.disableOptimizedProcessing = true;
+ window.msWriteProfilerMark("corefx:LoadTemplate:" + cacheKey + ",StopTM");
+ return (templateCache[cacheKey] = processedControl)
+ }).then(null, function (e) {
+ fragmentCache[templatePath] = null;
+ WinJS.UI.Fragments.clearCache(templatePath);
+ return WinJS.Promise.wrapError(e)
+ })
+ }
+ if (skipDefer)
+ return WinJS.Promise.as(getTemplate());
+ else
+ return WinJS.Promise.timeout().then(getTemplate)
+ }, unloadAndAssertIfFails: function unloadAndAssertIfFails(instance) {
+ if (instance._unloadBaseCalled)
+ return;
+ try {
+ instance._unloadBaseCalled = false;
+ instance.unload();
+ fxassert(instance._unloadBaseCalled, "base unload() not called for: " + instance.templateName || instance.itemTemplate || instance.controlName)
+ }
+ catch (e) {
+ fxassert(false, "Exception unloading control: " + e)
+ }
+ }, cleanupSingleControl: function cleanupSingleControl(controlToCleanup) {
+ if (!controlToCleanup || controlToCleanup._unloaded)
+ return;
+ if (controlToCleanup.unload && (controlToCleanup.unload !== MS.Entertainment.UI.Framework._UserControl.prototype.unload))
+ MS.Entertainment.UI.Framework.unloadAndAssertIfFails(controlToCleanup);
+ controlToCleanup._unloaded = true;
+ if (controlToCleanup._cleanupAttachedEvents)
+ controlToCleanup._cleanupAttachedEvents();
+ if (!MS.Entertainment.UI.Framework.flags.dontPendControlUnloadCleanup)
+ pendingCleanup.push(pendedControlsWeakRefTable.set(controlToCleanup))
+ }, domElementRemovedHandler: function (evt) {
+ if (evt.target.nodeType !== 1)
+ return;
+ var element = evt.target;
+ var suppressUnload = element.suppressUnload || (element.winControl && element.winControl.suppressUnload);
+ var isAppBar = element.winControl instanceof WinJS.UI.AppBar;
+ var isListViewItem = element.listViewReset || element.listViewItemContainer;
+ var isDirectChildOfSemanticZoom;
+ var isDirectChildOfScrollViewer;
+ var isDirectChildOfItemContainer;
+ var parentElement = element.parentElement;
+ if (parentElement) {
+ isDirectChildOfSemanticZoom = WinJS.Utilities.hasClass(parentElement, "win-semanticzoom");
+ isDirectChildOfScrollViewer = WinJS.Utilities.hasClass(parentElement, "win-scrollviewer");
+ isDirectChildOfItemContainer = WinJS.Utilities.hasClass(parentElement, "win-itemcontainer")
+ }
+ if (suppressUnload || isAppBar || isListViewItem || isDirectChildOfSemanticZoom || isDirectChildOfScrollViewer || isDirectChildOfItemContainer)
+ return;
+ if (element.unloadTimeout > 0) {
+ MS.Entertainment.UI.Framework.delayedControlCleanup(element, element.unloadTimeout, function cleanupCallback(element) {
+ MS.Entertainment.UI.Framework.unloadControlTree(element)
+ });
+ return
+ }
+ var listViewItem = null;
+ if (element && WinJS.Utilities.hasClass(element, "win-item"))
+ listViewItem = element;
+ else {
+ var confirmedListViewItemParent = null;
+ var possibleListViewItemParent = element;
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-itemscontainer")) {
+ confirmedListViewItemParent = possibleListViewItemParent;
+ possibleListViewItemParent = possibleListViewItemParent.firstElementChild
+ }
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-itemsblock")) {
+ confirmedListViewItemParent = possibleListViewItemParent;
+ possibleListViewItemParent = possibleListViewItemParent.firstElementChild
+ }
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-container")) {
+ confirmedListViewItemParent = possibleListViewItemParent;
+ possibleListViewItemParent = possibleListViewItemParent.firstElementChild
+ }
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-itembox"))
+ confirmedListViewItemParent = possibleListViewItemParent;
+ if (confirmedListViewItemParent && confirmedListViewItemParent.firstElementChild)
+ if (WinJS.Utilities.hasClass(confirmedListViewItemParent.firstElementChild, "win-item"))
+ listViewItem = confirmedListViewItemParent.firstElementChild;
+ else
+ listViewItem = confirmedListViewItemParent.querySelector(".win-item")
+ }
+ if (listViewItem && (listViewItem.listViewReset || listViewItem.listViewItemContainer))
+ return;
+ if (alreadyHandlingElementRemove) {
+ pendingElementRemovals.push(element);
+ return
+ }
+ alreadyHandlingElementRemove = true;
+ while (element) {
+ MS.Entertainment.UI.Framework.unloadControlTree(element);
+ element = pendingElementRemovals.shift()
+ }
+ alreadyHandlingElementRemove = false
+ }, unloadControlTree: function unloadControlTree(element) {
+ if (!element)
+ return;
+ if (element.firstElementChild && !WinJS.Utilities.hasClass(element, "win-profilepicker-usertile"))
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "img", function cleanUpImages(item) {
+ if (item.winControl && item.winControl.unloadTimeout > 0)
+ MS.Entertainment.UI.Framework.delayedControlCleanup(item, item.winControl.unloadTimeout, function cleanupCallback(element) {
+ element.src = String.empty;
+ element.setAttribute("src", String.empty)
+ });
+ else if (!(item.winControl && item.winControl.suppressSourceClear)) {
+ item.src = String.empty;
+ item.setAttribute("src", String.empty)
+ }
+ });
+ else if (element.tagName && element.tagName === "IMG")
+ if (!(element.winControl && element.winControl.suppressSourceClear)) {
+ element.src = String.empty;
+ element.setAttribute("src", String.empty)
+ }
+ var nodes = element.querySelectorAll("[data-win-control], .ent-control");
+ for (var i = nodes.length - 1; i > -1; i--) {
+ var node = nodes[i];
+ var control = node.winControl;
+ if (!control || control.suppressUnload)
+ continue;
+ if (control.unloadTimeout > 0)
+ MS.Entertainment.UI.Framework.delayedControlCleanup(node, control.unloadTimout, function cleanupSingleControlDelayed() {
+ MS.Entertainment.UI.Framework.cleanupSingleControl(control)
+ });
+ else
+ MS.Entertainment.UI.Framework.cleanupSingleControl(control)
+ }
+ if (element.winControl)
+ MS.Entertainment.UI.Framework.cleanupSingleControl(element.winControl);
+ if (!MS.Entertainment.UI.Framework.flags.dontPendControlUnloadCleanup) {
+ element.isTree = true;
+ pendingCleanup.push(pendedControlsWeakRefTable.set(element));
+ if (pendingCleanupTimer)
+ clearTimeout(pendingCleanupTimer);
+ pendingCleanupTimer = setTimeout(function () {
+ pendingCleanup.forEach(function (item) {
+ var control = pendedControlsWeakRefTable.get(item);
+ if (!control)
+ return;
+ if (control._cleanupSetMembers)
+ control._cleanupSetMembers();
+ if (control._parent)
+ control._parent = null;
+ if (WinJS.Utilities.disposeSubTree) {
+ if (control.isTree)
+ WinJS.Utilities.disposeSubTree(control);
+ if (control.domElement && !WinJS.Utilities.hasClass(control.domElement, "win-disposable"))
+ control.domElement = null
+ }
+ else
+ control.domElement = null
+ });
+ pendingCleanup = []
+ }, MS.Entertainment.UI.Framework.autoCleanupTimeout)
+ }
+ }, enableAutoControlCleanup: function enableAutoControlCleanup() {
+ pendedControlsWeakRefTable = new MS.Entertainment.UI.Framework.WeakRefTable("about://pendingCleanup");
+ document.addEventListener("DOMNodeRemoved", MS.Entertainment.UI.Framework.domElementRemovedHandler)
+ }, disableAutoControlCleanup: function disableAutoControlCleanup() {
+ document.removeEventListener("DOMNodeRemoved", MS.Entertainment.UI.Framework.domElementRemovedHandler)
+ }, autoCleanupTimeout: 5000, delayedControlCleanup: function delayedControlCleanup(element, unloadTimeout, cleanupCallback) {
+ WinJS.Promise.timeout(unloadTimeout).done(function cleanUpControlIfStillNotInDom() {
+ if (element && !element._unloaded && !document.body.contains(element))
+ cleanupCallback(element)
+ })
+ }, Placeholder: MS.Entertainment.UI.Framework.define(function placeholderConstructor(template, replacements) {
+ this._template = template;
+ this._replacements = replacements
+ }, {
+ _replacements: null, _template: null, render: function render(container, data) {
+ var renderedPlaceholder = this._replacements.reduce(function replaceTokensInPlaceholder(placeholder, item, index) {
+ var content = WinJS.Utilities.getMember(item, data) || String.empty;
+ if (content)
+ content = MS.Entertainment.Utilities.simpleEscapeHTML(content);
+ return placeholder.replace("{" + index + "}", content)
+ }, this._template);
+ container.innerHTML = renderedPlaceholder
+ }
+ }), getPlaceholderForElement: function getPlaceholderForElement(element) {
+ var placeholders = element.querySelectorAll(".placeholderItem");
+ if (placeholders.length === 0)
+ return null;
+ var template = "
";
+ var replacements = [];
+ template = Array.prototype.reduce.call(placeholders, function (currentTemplate, item, index) {
+ var style = window.getComputedStyle(item);
+ var pos = MS.Entertainment.Utilities.getRelativeOffset(item, element);
+ var width = WinJS.Utilities.getContentWidth(item);
+ var height = WinJS.Utilities.getContentHeight(item);
+ var memberPath = item.getAttribute("data-ent-placeholderdatapath");
+ var extractedStyles = Object.keys(placeholderCssProperties).reduce(function (styleString, property) {
+ var styleValue = style[property];
+ if (styleValue)
+ styleString += placeholderCssProperties[property] + ": " + styleValue + "; ";
+ return styleString
+ }, String.empty);
+ currentTemplate += "
";
+ if (memberPath) {
+ currentTemplate += "{" + replacements.length + "}";
+ replacements.push(memberPath)
+ }
+ currentTemplate += "
";
+ return currentTemplate
+ }, template);
+ template += "
";
+ return new MS.Entertainment.UI.Framework.Placeholder(template, replacements)
+ }, WeakRefTable: MS.Entertainment.UI.Framework.define(function (anchorUri) {
+ fxassert(anchorUri, "No anchor URI supplied");
+ this._anchor = new Windows.Foundation.Uri(anchorUri)
+ }, {
+ _anchor: null, _nextKey: 0, set: function set(item, customKey) {
+ var key = customKey || ++this._nextKey;
+ fxassert(item, "Actually need an item to store in the weak ref table");
+ if (!item)
+ return key;
+ if (msSetWeakWinRTProperty)
+ msSetWeakWinRTProperty(this._anchor, key, item);
+ else
+ key = { key: item };
+ return key
+ }, get: function get(key) {
+ fxassert(key, "You need to supply a key");
+ if (!key)
+ return null;
+ if (msGetWeakWinRTProperty)
+ return msGetWeakWinRTProperty(this._anchor, key);
+ return key.item
+ }
+ }), ReferenceMap: MS.Entertainment.UI.Framework.define(function () {
+ this._references = [];
+ this._values = []
+ }, {
+ _references: null, _values: null, set: function set(reference, value) {
+ var index = this._references.indexOf(reference);
+ if (index < 0)
+ index = this._references.push(reference) - 1;
+ this._values[index] = value
+ }, get: function get(reference) {
+ var index = this._references.indexOf(reference);
+ if (index < 0)
+ return;
+ { };
+ return this._values[index]
+ }, remove: function remove(reference) {
+ var index = this._references.indexOf(reference);
+ if (index < 0)
+ return;
+ this._references.splice(index, 1);
+ this._values.splice(index, 1)
+ }
+ }), bindWorker: function bindWorker(bindable, sourceProperties, handler) {
+ if (sourceProperties.length > 1) {
+ var root = {};
+ var current = root;
+ for (var i = 0, length = sourceProperties.length - 1; i < length; i++)
+ current = current[sourceProperties[i]] = {};
+ current[sourceProperties[sourceProperties.length - 1]] = handler;
+ return WinJS.Binding.bind(bindable, root, true)
+ }
+ else if (sourceProperties.length === 1) {
+ bindable.bind(sourceProperties[0], handler, true);
+ return {
+ cancel: function () {
+ bindable.unbind(sourceProperties[0], handler);
+ this.cancel = function () { }
+ }
+ }
+ }
+ }, weakElementBindingInitializer: function weakElementBindingInitializer(handler) {
+ var elementTargetedHandler = function (source, sourceProperties, dest, destProperties) {
+ var weakRefTable = getBindingTargetWeakRefTable();
+ var id = weakRefTable.set(dest);
+ var propertyPath = destProperties.concat([]);
+ var bindResult;
+ var bindingHandler = function bindingHandler(value) {
+ var targetElement = getBindingTargetWeakRefTable().get(id);
+ if (targetElement)
+ handler(value, targetElement, propertyPath, source);
+ else if (bindResult) {
+ bindResult.cancel();
+ bindResult = null
+ }
+ };
+ bindResult = MS.Entertainment.Utilities.bindWorker(WinJS.Binding.as(source), sourceProperties, bindingHandler);
+ return bindResult
+ };
+ return WinJS.Utilities.markSupportedForProcessing(elementTargetedHandler)
+ }, thawControlsInSubtree: function thawControlsInSubtree(element) {
+ var promisesToWaitOn = [];
+ fxassert(element, "No element supplied");
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[data-win-control], .ent-control", function thawControl(candidateControl) {
+ if (!candidateControl.winControl || !candidateControl.winControl.thaw || (candidateControl.winControl.thaw === MS.Entertainment.UI.Framework._UserControl.prototype.thaw))
+ return;
+ var instance = candidateControl.winControl;
+ instance._thawBaseCalled = false;
+ var thawResult = instance.thaw();
+ fxassert(instance._thawBaseCalled, "base thaw() not called!");
+ if (WinJS.Promise.is(thawResult))
+ promisesToWaitOn.push(thawResult)
+ });
+ if (promisesToWaitOn.length > 0)
+ return WinJS.Promise.any(promisesToWaitOn);
+ else
+ return WinJS.Promise.timeout()
+ }, freezeControlsInSubtree: function freezeControlsInSubtree(element) {
+ var promises = [];
+ fxassert(element, "No element supplied");
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[data-win-control], .ent-control", function freezeControl(candidateControl) {
+ if (!candidateControl.winControl || !candidateControl.winControl.freeze || (candidateControl.winControl.freeze === MS.Entertainment.UI.Framework._UserControl.prototype.freeze))
+ return;
+ var instance = candidateControl.winControl;
+ instance._freezeBaseCalled = false;
+ var freezeResult = instance.freeze();
+ fxassert(instance._freezeBaseCalled, "base freeze() not called!");
+ if (WinJS.Promise.is(freezeResult))
+ promises.push(freezeResult)
+ });
+ if (promises.length > 0)
+ return WinJS.Promise.any(promises);
+ else
+ return WinJS.Promise.wrap()
+ }, applyWithSelector: function (root, query, operation, includeRoot) {
+ if (!root || !root.querySelectorAll) {
+ fxassert(false, "No valid root element provided");
+ return
+ }
+ if (includeRoot)
+ operation(root);
+ WinJS.Utilities.query(query, root).forEach(operation)
+ }, parseEventAttributes: function parse(input, handlerSource) {
+ var pairs;
+ var results = [];
+ fxassert(input, "No input specified");
+ if (!input)
+ return;
+ fxassert(handlerSource, "No handler source provided");
+ if (!handlerSource)
+ throw "No Handler source provided";
+ pairs = input.split(";");
+ if (!pairs || pairs.length < 1)
+ return;
+ pairs.forEach(function processEventItems(item) {
+ var eventName;
+ var handler;
+ var handlerMember;
+ if (!item)
+ return;
+ var pair = item.split(":");
+ if (!pair || (pair.length !== 2)) {
+ fxassert(false, "Pair couldn't be parsed: " + item);
+ return
+ }
+ handler = pair[1].trim();
+ if (handlerSource) {
+ handlerMember = WinJS.Utilities.getMember(handler, handlerSource);
+ if (handlerMember)
+ handler = handlerMember
+ }
+ eventName = pair[0].trim();
+ results.push({
+ event: eventName, handler: handler
+ })
+ });
+ return results
+ }, processDeclEvents: function processDeclEvents(elementToProcess) {
+ fxassert(elementToProcess, "Element was not supplied");
+ var control = elementToProcess.winControl;
+ if (!control)
+ return;
+ var attachedEventsToCleanup = [];
+ MS.Entertainment.UI.Framework.applyWithSelector(elementToProcess, "[data-ent-event]", function processDeclEventElement(elementToInspect) {
+ if (elementToInspect.alreadyProcessedForEntEvent)
+ return;
+ var eventAttributeData = elementToInspect.getAttribute("data-ent-event");
+ if (!eventAttributeData)
+ return;
+ elementToInspect.alreadyProcessedForEntEvent = true;
+ var eventsToBind = MS.Entertainment.UI.Framework.parseEventAttributes(eventAttributeData, control);
+ if (!eventsToBind || eventsToBind.length < 1)
+ return;
+ eventsToBind.forEach(function bindEvents(eventInfo) {
+ if (!eventInfo.handler)
+ return;
+ if (typeof eventInfo.handler === "string") {
+ var message = "Unable to find '" + eventInfo.handler + "' on '" + control.toString() + "'";
+ fxassert(false, message);
+ return
+ }
+ var domEventWrapper = function domEventWrapperHandler(evt) {
+ eventInfo.handler.call(control, evt)
+ };
+ elementToInspect.addEventListener(eventInfo.event, domEventWrapper);
+ attachedEventsToCleanup.push({
+ element: elementToInspect, eventName: eventInfo.event, handler: domEventWrapper
+ });
+ var additionalEventToAttach = null;
+ if (eventInfo.event === "pointerdown")
+ additionalEventToAttach = "MSPointerDown";
+ else if (eventInfo.event === "pointermove")
+ additionalEventToAttach = "MSPointerMove";
+ if (additionalEventToAttach) {
+ elementToInspect.addEventListener(additionalEventToAttach, domEventWrapper);
+ attachedEventsToCleanup.push({
+ element: elementToInspect, eventName: additionalEventToAttach, handler: domEventWrapper
+ })
+ }
+ })
+ });
+ if (attachedEventsToCleanup && attachedEventsToCleanup.length)
+ control._attachedEventsToCleanup = attachedEventsToCleanup
+ }, delayInitializeChildren: function delayInitializeChildren(container, requireDelayInitialization) {
+ if (!container)
+ return;
+ var itemsInDelayInitializeBlock = null;
+ var inDelayInitializeBlock = function inDelayInitializeBlock(element) {
+ var containsElement = false;
+ itemsInDelayInitializeBlock = itemsInDelayInitializeBlock || WinJS.Utilities.query(".ent-delayInitializeBlock", container) || [];
+ for (var i = 0; i < itemsInDelayInitializeBlock.length && !containsElement; i++)
+ containsElement = itemsInDelayInitializeBlock[i].contains(element);
+ return containsElement
+ };
+ MS.Entertainment.UI.Framework.applyWithSelector(container, ".ent-delayInitialize, [data-win-control], .ent-control", function executeDelayInitialize(element) {
+ var currentControl = element.winControl;
+ if (currentControl && currentControl.enableDelayInitialization && currentControl.delayInitialize && !inDelayInitializeBlock(element))
+ if (currentControl.isInitialized || !currentControl.initialize)
+ currentControl.delayInitialize();
+ else
+ currentControl.enableDelayInitialization = false
+ })
+ }, processDeclMembers: function (root, target, overwriteExistingMembers) {
+ fxassert(target, "No target instance supplied");
+ var setMembers = [];
+ MS.Entertainment.UI.Framework.applyWithSelector(root, "[data-ent-member]", function processDeclMemberElement(element) {
+ if (element.alreadyProcessedForEntMember)
+ return;
+ var targetMemberName = element.getAttribute("data-ent-member");
+ if (!targetMemberName)
+ return;
+ element.alreadyProcessedForEntMember = true;
+ if (target[targetMemberName] && !overwriteExistingMembers) {
+ fxassert(false, "Target already has a property named '" + targetMemberName + "', skipping");
+ return
+ }
+ var elementOnly = MS.Entertainment.UI.Framework.checkIsElementOnly(element);
+ var valueToSet = null;
+ if (elementOnly)
+ valueToSet = element;
+ else
+ valueToSet = element.winControl || element;
+ target[targetMemberName] = valueToSet;
+ setMembers.push(targetMemberName)
+ });
+ target._setMembers = setMembers
+ }, processDeclarativeControlContainer: function processDeclarativeControlContainer(winControl) {
+ var promise;
+ fxassert(winControl && winControl.domElement && winControl.domElement.children.length === 1, "A valid winControl with just one child container needs to be supplied");
+ if (winControl && winControl.domElement && winControl.domElement.firstElementChild)
+ promise = WinJS.UI.processAll(winControl.domElement.firstElementChild).then(function () {
+ WinJS.Binding.processAll(winControl.domElement.firstElementChild, winControl);
+ MS.Entertainment.UI.Framework.processDeclEvents(winControl.domElement);
+ MS.Entertainment.UI.Framework.processDeclMembers(winControl.domElement, winControl)
+ });
+ return WinJS.Promise.as(promise)
+ }, animationsEnabled: {
+ get: function () {
+ return WinJS.UI.isAnimationEnabled()
+ }
+ }, TextDirections: {
+ LeftToRight: "ltr", RightToLeft: "rtl"
+ }, updateHtmlDirectionAttribute: function updateHtmlDirectionAttribute() {
+ var element = document.getElementsByTagName("html")[0];
+ fxassert(element, "Where did HTML go? We should have at least one");
+ var currentAttributeValue = element.getAttribute("dir");
+ var currentStyleValue = MS.Entertainment.UI.Framework.getTextDirectionForElement(element);
+ if (currentAttributeValue !== currentStyleValue)
+ element.setAttribute("dir", currentStyleValue);
+ currentTextDirection = currentStyleValue
+ }, getTextDirection: function getTextDirection() {
+ return currentTextDirection
+ }, getTextDirectionForElement: function getTextDirectionForElement(element) {
+ fxassert(element, "No Element provided to determine text direction");
+ if (!element)
+ return MS.Entertainment.UI.Framework.TextDirections.LeftToRight;
+ var currentStyleValue = element.currentStyle && element.currentStyle.direction;
+ return currentStyleValue
+ }, checkIsElementOnly: function checkIsElementOnly(element) {
+ var elementOnly = element.getAttribute("data-ent-elementonly") || String.empty;
+ elementOnly = elementOnly.toLowerCase();
+ if (elementOnly === "true")
+ return true;
+ return false
+ }, markFunctionsOfObjectAsSupportedForProcessing: function markFunctionsOfObjectAsSupportedForProcessing(instance) {
+ for (var m in instance)
+ if (instance.hasOwnProperty(m) && (instance[m] instanceof Function))
+ instance[m] = WinJS.Utilities.markSupportedForProcessing(instance[m]);
+ return instance
+ }, waitForControlToInitialize: function waitForControlToInitialize(elementToWaitOn) {
+ var complete;
+ var initializedPromise = new WinJS.Promise(function (c, e, p) {
+ complete = c
+ });
+ var cleanupAndComplete = function cleanupAndComplete() {
+ elementToWaitOn.removeEventListener("UserControlInitialized", handleControlInitialized);
+ complete()
+ };
+ fxassert(elementToWaitOn, "Element needs to be supplied");
+ var handleControlInitialized = function handleControlInitialized(event) {
+ if (elementToWaitOn.winControl) {
+ if (elementToWaitOn.winControl === event.userControl)
+ cleanupAndComplete()
+ }
+ else
+ cleanupAndComplete()
+ };
+ if (elementToWaitOn.winControl && elementToWaitOn.winControl._initialized)
+ complete();
+ else
+ elementToWaitOn.addEventListener("UserControlInitialized", handleControlInitialized);
+ return initializedPromise
+ }, checkIfInDom: function checkIfInDom(element) {
+ var inDom = document.compareDocumentPosition(element) & document.DOCUMENT_POSITION_CONTAINED_BY;
+ return !!inDom
+ }, forceFullLayout: function forceFullLayout() {
+ var forceRelayout = document.body.offsetHeight
+ }, empty: function (element) {
+ if (!element)
+ return;
+ element.innerHTML = String.empty
+ }, addEventHandlers: function addEventHandlers(eventSource, events, capture) {
+ if (eventSource && events && eventSource.addEventListener)
+ for (var key in events)
+ eventSource.addEventListener(key, events[key], capture || false);
+ return {
+ cancel: function () {
+ MS.Entertainment.UI.Framework.removeEvents(eventSource, events, capture);
+ eventSource = null;
+ events = null
+ }
+ }
+ }, removeEvents: function removeEvents(eventSource, events, capture) {
+ if (eventSource && events && eventSource.removeEventListener)
+ for (var key in events)
+ eventSource.removeEventListener(key, events[key], capture || false)
+ }, scrollIntoViewWithAnimation: function _performScroll(scroller, scrollLeft, ignoreMissingStarts, animationRoots) {
+ if (scrollLeft < 0)
+ scrollLeft = 0;
+ if (!MS.Entertainment.UI.Framework.animationsEnabled) {
+ scroller.scrollLeft = scrollLeft;
+ return WinJS.Promise.as()
+ }
+ var scrollLeftDelta = (scroller.scrollLeft - scrollLeft);
+ if ((-scrollLeftDelta) + scroller.scrollLeft < 0)
+ scrollLeftDelta = 0 - scroller.scrollLeft;
+ if (MS.Entertainment.UI.Framework.getTextDirection() === MS.Entertainment.UI.Framework.TextDirections.RightToLeft)
+ scrollLeftDelta = -(scroller.scrollLeft - scrollLeft);
+ var animationChildren = [];
+ if (animationRoots && Array.isArray(animationRoots))
+ for (var i = 0; i < animationRoots.length; i++)
+ animationChildren = animationChildren.concat(Array.prototype.slice.call(animationRoots[i].children));
+ else
+ animationChildren = scroller.children;
+ var scrollComplete = scroller.isAnimatingScroll;
+ if (!scrollComplete)
+ scrollComplete = MS.Entertainment.UI.Framework.waitForStartedTransitionsToComplete(scroller, ignoreMissingStarts, "scrollAnimation").then(function () {
+ Array.prototype.forEach.call(animationChildren, function (item) {
+ WinJS.Utilities.removeClass(item, "scrollAnimation");
+ item.style.msTransform = ""
+ });
+ scroller.scrollLeft = scroller.targetScrollLeft;
+ scroller.targetScrollLeft = null;
+ scroller.isAnimatingScroll = null
+ }.bind(this));
+ else if (scroller.targetScrollLeft !== scrollLeft)
+ MS.Entertainment.UI.Framework.resetStartedTransitionCount(scroller);
+ if (scroller.targetScrollLeft !== scrollLeft) {
+ Array.prototype.forEach.call(animationChildren, function (item) {
+ WinJS.Utilities.addClass(item, "scrollAnimation");
+ if (WinJS.Utilities.hasClass(item, "fixed"))
+ return;
+ var transformStyle = "translateX(" + scrollLeftDelta + "px)";
+ item.style.msTransform = transformStyle
+ });
+ scroller.targetScrollLeft = scrollLeft;
+ scroller.isAnimatingScroll = scrollComplete
+ }
+ return scrollComplete
+ }, resetStartedTransitionCount: function resetStartedTransitionCount(element) {
+ element.startedTransitions = 0
+ }, waitForStartedTransitionsToComplete: function waitForStartedTransitionsToComplete(element, ignoreMissingStarts, className) {
+ fxassert(element, "Need an element to work with");
+ MS.Entertainment.UI.Framework.resetStartedTransitionCount(element);
+ var complete;
+ var allTransitionsComplete = new WinJS.Promise(function (c, e, p) {
+ complete = c
+ });
+ var startHandler = function waitForStartedTransitionsToCompleteStartedHandler(e) {
+ if (className && !WinJS.Utilities.hasClass(e.target, className))
+ return;
+ element.startedTransitions++
+ };
+ element.addEventListener("transitionstart", startHandler);
+ var endHandler = function waitForStartedTransitionsToCompleteEndedHandler(e) {
+ if (className && !WinJS.Utilities.hasClass(e.target, className))
+ return;
+ if (!ignoreMissingStarts)
+ fxassert(element.startedTransitions, "Expected something to have started before we end");
+ element.startedTransitions--;
+ if (element.startedTransitions > 0)
+ return;
+ element.removeEventListener("transitionstart", startHandler);
+ element.removeEventListener("transitionend", endHandler);
+ complete()
+ };
+ element.addEventListener("transitionend", endHandler);
+ return allTransitionsComplete
+ }, Signal: WinJS.Class.mix(WinJS.Class.define(function () {
+ var that = this;
+ this._wrappedPromise = new WinJS.Promise(function (c, e, p) {
+ that._complete = c;
+ that._error = e;
+ that._progress = p
+ }, this._handleCancelled.bind(this))
+ }, {
+ _wrappedPromise: null, _complete: null, _completed: false, _error: null, _progress: null, _handleCancelled: function _handleCancelled(e) {
+ this.dispatchEvent("cancelled", { signal: this })
+ }, promise: {
+ get: function () {
+ return this._wrappedPromise
+ }
+ }, complete: function signal_complete(value) {
+ if (this._completed)
+ throw new Error("Cannot complete an already completed promise");
+ this._complete(value);
+ this._completed = true
+ }, error: function signal_error(errorInfo) {
+ this._error(errorInfo)
+ }, progress: function signal_progress(progressInfo) {
+ this._progress(progressInfo)
+ }
+ }), WinJS.Utilities.eventMixin), BackOffTimer: WinJS.Class.define(function () { }, {
+ _disposed: false, _timer: null, _lastExecute: 0, _callback: null, _currentDelay: 0, initialDelay: 500, maxDelay: 4000, delayIncreaseFactor: 2, currentDelay: {
+ get: function get_currentDelay() {
+ return this._currentDelay
+ }
+ }, callback: {
+ get: function get_callback() {
+ return this._callback
+ }, set: function set_callback(value) {
+ if (!this._disposed && value !== this._callback) {
+ this._callback = value;
+ if (this._timer) {
+ this._timer.cancel();
+ this._timer = null
+ }
+ }
+ }
+ }, dispose: function dispose() {
+ this._disposed = true;
+ if (this._timer) {
+ this._timer.cancel();
+ this._timer = null
+ }
+ this._callback = null
+ }, execute: function execute() {
+ var result = null;
+ var time = Date.now();
+ if (this._lastExecute && time - this._lastExecute > this._currentDelay)
+ this._currentDelay = 0;
+ this._lastExecute = time;
+ var refreshSynchronously = this._currentDelay <= 0 && !this._timer;
+ if (refreshSynchronously) {
+ this._currentDelay = Math.min(this.maxDelay, this.initialDelay);
+ this._execute()
+ }
+ else if (!this._timer)
+ this._timer = new WinJS.Promise.timeout(this._currentDelay).then(function () {
+ this._currentDelay = this._currentDelay * this.delayIncreaseFactor;
+ this._currentDelay = Math.min(this.maxDelay, this._currentDelay);
+ this._execute()
+ }.bind(this), function () { }).then(function () {
+ this._timer = null
+ }.bind(this));
+ return WinJS.Promise.as(this._timer)
+ }, _execute: function _execute() {
+ if (this.callback)
+ this.callback()
+ }
+ }), clearCaches: function clearCaches(skipListViewClear) {
+ templateCache = {};
+ fragmentCache = {};
+ WinJS.UI._disposeControls();
+ WinJS.UI.Fragments.clearCache();
+ if (!skipListViewClear) {
+ var fakeListView = document.createElement("div");
+ fakeListView.style.display = "none";
+ fakeListView.id = "fakeListView";
+ document.body.appendChild(fakeListView);
+ (new WinJS.UI.ListView(fakeListView));
+ WinJS.Promise.timeout(1000).done(function () {
+ if (fakeListView.winControl && fakeListView.winControl.dispose)
+ fakeListView.winControl.dispose();
+ fakeListView.parentElement.removeChild(fakeListView)
+ })
+ }
+ if (garbageCollectPromise) {
+ garbageCollectPromise.cancel();
+ garbageCollectPromise = null
+ }
+ var collectGarbageFn = function collectGarbageFn() {
+ CollectGarbage();
+ return WinJS.Promise.timeout(1000)
+ };
+ garbageCollectPromise = WinJS.Promise.timeout(3000).then(collectGarbageFn).then(collectGarbageFn).then(function updateMemoryCounter() { });
+ return garbageCollectPromise
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ _UserControl: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function userControlConstructor(element, options) {
+ fxassert(!element.winControl, "This element has already had the control initialized for it. It shouldn't be happening again");
+ fxassert(this !== window, "Invoked against global object. Bad");
+ this._controlId = ++controlId;
+ this.domElement = element;
+ this._controlsPendingInitialization = [];
+ this._userControlConstructedHandler = this._userControlConstructedHandler.bind(this);
+ this.domElement.addEventListener("UserControlConstructed", this._userControlConstructedHandler);
+ this._userControlConstructedInitialized = this._userControlConstructedInitialized.bind(this);
+ this.domElement.addEventListener("UserControlInitialized", this._userControlConstructedInitialized);
+ WinJS.UI.setOptions(this, options);
+ element.winControl = this;
+ if (this.templateStorage) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("UserControlConstructed", true, false);
+ domEvent.userControl = this;
+ this.domElement.dispatchEvent(domEvent)
+ }
+ }, {
+ _beginInitializeCount: 0, _childControlHandlersAdded: false, _controlId: -1, _controlsPendingInitialization: null, templateStorage: null, templateName: null, domElement: null, _attachedEventsToCleanup: null, _setMembers: null, visibility: {
+ get: function () {
+ if (!this.domElement || !this.domElement.style)
+ return false;
+ var currentStyle = this.domElement.currentStyle;
+ return (currentStyle && currentStyle.visibility !== "hidden" && currentStyle.display !== "none" && currentStyle.opacity !== 0.0)
+ }, set: function (value) {
+ if (!this.domElement)
+ return;
+ var oldValue = this.visibility;
+ if (value)
+ MS.Entertainment.Utilities.showElement(this.domElement);
+ else
+ MS.Entertainment.Utilities.hideElement(this.domElement);
+ if (value !== oldValue)
+ this.notify("visibility", value, oldValue)
+ }, enumerable: true, configurable: false
+ }, action: null, _unloadBaseCalled: false, _freezeBaseCalled: false, _thawBaseCalled: false, preventHideDuringInitialize: false, allowAnimations: true, _initialized: false, _isDelayInitialized: false, _unloaded: false, unload: function unload() {
+ this._unloadBaseCalled = true
+ }, freeze: function freeze() {
+ this._freezeBaseCalled = true
+ }, thaw: function thaw() {
+ this._thawBaseCalled = true
+ }, dispose: function () {
+ if (this.domElement)
+ WinJS.Utilities.disposeSubTree(this.domElement);
+ MS.Entertainment.UI.Framework.cleanupSingleControl(this);
+ if (this.domElement)
+ this.domElement = null
+ }, _userControlConstructedHandler: function _userControlConstructedHandler(e) {
+ fxassert(e, "No event args provided to constructor handler");
+ fxassert(e.userControl, "No user control instance provided on event args for control construction");
+ if (e.userControl === this)
+ return;
+ e.stopPropagation();
+ fxassert(!e.userControl._parent, "This control already had a parent set. That doesn't seem right");
+ fxassert(e.userControl !== this, "Why are we hearing about this for ourselves?");
+ e.userControl._parent = this;
+ if (this.ignoreChildrenInitialization)
+ return;
+ fxassert(this._controlsPendingInitialization.indexOf(e.userControl) === -1, "Control was already pending it's initialization");
+ this._controlsPendingInitialization.push(e.userControl)
+ }, _userControlConstructedInitialized: function _userControlConstructedInitialized(e) {
+ fxassert(e, "No event args provided to constructor handler");
+ fxassert(e.userControl, "No user control instance provided on event args for control construction");
+ if (e.userControl === this)
+ return;
+ e.stopPropagation();
+ if (this._unloaded)
+ return;
+ if (this.ignoreChildrenInitialization)
+ return;
+ var index = this._controlsPendingInitialization.indexOf(e.userControl);
+ if (index === -1)
+ return;
+ this._controlsPendingInitialization.splice(index, 1);
+ this._completeInitialize()
+ }, initialize: function () { }, isInitialized: {
+ get: function UserControl_getIsInitialized() {
+ return this._initialized
+ }
+ }, delayInitialize: function delayInitialize() {
+ fxassert(!this.isDelayInitialized, "The user control has already been delay initialized.");
+ if (!this.isDelayInitialized) {
+ this._isDelayInitialized = true;
+ if (this.supportsDelayInitialization)
+ this._delayInitialized()
+ }
+ }, isDelayInitialized: {
+ get: function get_isDelayInitialized() {
+ return this._isDelayInitialized
+ }
+ }, supportsDelayInitialization: {
+ get: function get_supportsDelayInitialization() {
+ return !!this._delayInitialized
+ }
+ }, _completeInitialize: function _completeInitialize() {
+ if ((this._controlsPendingInitialization.length > 0) || (this.templateStorage && !this._templateLoaded))
+ return;
+ if (this._unloaded)
+ return;
+ this.domElement.removeEventListener("UserControlConstructed", this._userControlConstructedHandler);
+ this.domElement.removeEventListener("UserControlInitialized", this._userControlConstructedInitialized);
+ this._initialized = true;
+ var actionName = this.domElement.getAttribute("data-ent-action");
+ if (actionName) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(WinJS.Utilities.getMember(actionName));
+ this.action = action;
+ this.domElement.removeAttribute("data-ent-action")
+ }
+ if (this.templateStorage || this.processChildren) {
+ MS.Entertainment.UI.Framework.processDeclEvents(this.domElement);
+ MS.Entertainment.UI.Framework.processDeclMembers(this.domElement, this)
+ }
+ if (!this.preventHideDuringInitialize)
+ WinJS.Utilities.removeClass(this.domElement, "hideDuringInitialize");
+ if (this.initialize) {
+ var controlName = ((this.templateStorage && this.templateName) ? this.templateStorage + "#" + this.templateName : this.controlName) + ":" + this._controlId;
+ window.msWriteProfilerMark("corefx:UserControlUserInitialization:" + controlName + ",StartTM");
+ this.initialize();
+ window.msWriteProfilerMark("corefx:UserControlUserInitialization:" + controlName + ",StopTM")
+ }
+ if (!this.enableDelayInitialization)
+ this.delayInitialize();
+ if (this.allowAnimations && MS.Entertainment.UI.Framework.beginShowAnimations)
+ MS.Entertainment.UI.Framework.beginShowAnimations(this.domElement);
+ fxassert(this._controlsPendingInitialization.length === 0, "There were controls pending initialization when this one called it's initializer");
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("UserControlInitialized", true, false);
+ domEvent.userControl = this;
+ this.domElement.dispatchEvent(domEvent)
+ }, _beginInitialize: function _beginInitialize() {
+ var controlTraceString = (this.controlName || "Non templated control without control name") + ":" + this._controlId;
+ var templateTraceString = this.templateStorage + "#" + this.templateName + ":" + this._controlId;
+ if ((!this.templateStorage) && (this.initialize)) {
+ window.msWriteProfilerMark("corefx:UserControlInitialization: " + controlTraceString + ",StartTM");
+ if (this.deferInitialization) {
+ WinJS.Promise.timeout().then(this._completeInitialize.bind(this));
+ return
+ }
+ this._completeInitialize();
+ window.msWriteProfilerMark("corefx:UserControlInitialization: " + controlTraceString + ",StopTM");
+ return
+ }
+ window.msWriteProfilerMark("corefx:UserControlInitialization: " + controlTraceString + ",StartTM");
+ if (!this.templateStorage)
+ return;
+ window.msWriteProfilerMark("corefx:UserControlInitializationTemplateLoading:" + templateTraceString + ",StartTM");
+ MS.Entertainment.UI.Framework.loadTemplate(this.templateStorage, this.templateName, this._skipDefer).then(function renderControl(controlInstance) {
+ if (this._unloaded)
+ return WinJS.Promise.wrapError({ controlUnloaded: true });
+ return controlInstance.render(this, this.domElement)
+ }.bind(this)).then(function appendAndInit(renderedElement) {
+ var targetElement = this.domElement;
+ if (!targetElement.getAttribute("data-win-automationId"))
+ targetElement.setAttribute("data-win-automationId", this.templateName);
+ this._templateLoaded = true;
+ window.msWriteProfilerMark("corefx:UserControlInitializationTemplateLoading:" + templateTraceString + ",StopTM");
+ this._completeInitialize()
+ }.bind(this)).done(null, function error(errorObject) {
+ if (errorObject.controlUnloaded)
+ return;
+ fxassert(false, "Failure loading template: '" + this.templateStorage + "#" + this.templateName + "'");
+ return WinJS.Promise.wrapError(errorObject)
+ }.bind(this))
+ }, _cleanupAttachedEvents: function _cleanupAttachedEvents() {
+ if (!this._attachedEventsToCleanup || !this._attachedEventsToCleanup.length)
+ return;
+ this._attachedEventsToCleanup.forEach(function (item) {
+ item.element.removeEventListener(item.eventName, item.handler)
+ });
+ this._attachedEventsToCleanup = []
+ }, _cleanupSetMembers: function _cleanupSetMembers() {
+ if (!this._setMembers || !this._setMembers.length)
+ return;
+ this._setMembers.forEach(function (member) {
+ this[member] = null
+ }.bind(this));
+ this._setMembers = []
+ }
+ }), deriveUserControl: function (userControl, template, constructor, members, observableMembers, statics) {
+ var value;
+ var templateParts;
+ if (template) {
+ templateParts = MS.Entertainment.UI.Framework.parseTemplate(template);
+ members = members || {};
+ if (!members.templateName || !members.templateStorage) {
+ members.templateStorage = templateParts.path;
+ if (templateParts.id)
+ members.templateName = templateParts.id
+ }
+ if (members.templateName)
+ MS.Entertainment.UI.Framework.preloadTemplate(template, members.criticalTemplate)
+ }
+ return {
+ get: function () {
+ if (!value)
+ value = MS.Entertainment.UI.Framework.deriveUserControlWork(userControl, template, constructor, members, observableMembers, statics);
+ return value
+ }
+ }
+ }, deriveUserControlWork: function (userControl, template, constructor, members, observableMembers, statics) {
+ if (typeof userControl === "string") {
+ var controlMemberName = userControl;
+ userControl = WinJS.Utilities.getMember(userControl);
+ fxassert(userControl, "Could not resolve user control named " + controlMemberName)
+ }
+ fxassert(userControl, "User Control was not valid. Can't derive without something to derive from");
+ if (members)
+ MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(members);
+ if (statics)
+ MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(statics);
+ var type = WinJS.Class.derive(userControl, function defineUserControlWrapperConstructor(element, options) {
+ if (this === window)
+ throw new Error("Need to use 'new' to invoke the constructor");
+ element = element || document.createElement("div");
+ if (!this.preventHideDuringInitialize && (!options || !options.preventHideDuringInitialize))
+ WinJS.Utilities.addClass(element, "hideDuringInitialize");
+ if (observableMembers)
+ if (!this._backingData)
+ this._initObservable(Object.create(observableMembers));
+ else {
+ var item;
+ for (item in observableMembers)
+ if (!(item in this._backingData))
+ this._backingData[item] = observableMembers[item]
+ }
+ this._beginInitializeCount++;
+ userControl.call(this, element, options);
+ this._beginInitializeCount--;
+ if (typeof constructor === "function") {
+ window.msWriteProfilerMark("corefx:UserControlConstructed:" + (template || this.controlName || "No-template name") + ":" + this._controlId);
+ constructor.call(this, element, options)
+ }
+ if (this._beginInitializeCount === 0)
+ this._beginInitialize()
+ }, members, statics);
+ if (observableMembers)
+ type = WinJS.Class.mix(type, WinJS.Binding.expandProperties(observableMembers));
+ return type
+ }, defineUserControl: function (template, constructor, members, observableMembers, statics) {
+ return MS.Entertainment.UI.Framework.deriveUserControl(MS.Entertainment.UI.Framework._UserControl, template, constructor, members, observableMembers, statics)
+ }
+ });
+ var _emptySourcePath;
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ BindingBlock: MS.Entertainment.UI.Framework.define(function () { }, {}, { isDeclarativeControlContainer: true }), UserControl: MS.Entertainment.UI.Framework.defineUserControl(null, function () { }), ImageControl: MS.Entertainment.UI.Framework.defineUserControl(null, function (element, options) {
+ this._handleError = this._handleError.bind(this);
+ this._handleLoaded = this._handleLoaded.bind(this);
+ if (MS.Entertainment.Utilities.isApp2)
+ this._removeEventHandlersOnError = false
+ }, {
+ loadDelay: false, disableLazyDecode: false, clearSrcOnEmptyTarget: false, controlName: "ImageControl", desiredImageSize: null, defaultImagePath: null, errorImage: null, imageIdType: null, bindTargetProperties: false, applyImageAsBackground: false, propagateImageLoadCompleteEvent: false, imageLoadCompleteEventFired: false, parentStyleIfNotEmpty: null, skipImageResetOnThaw: false, _target: null, _enabled: false, _loadPromise: null, _removeEventHandlersOnError: true, _frozen: false, _emptySourcePath: {
+ get: function imageControl_emptySourcePath_get() {
+ if (!_emptySourcePath)
+ _emptySourcePath = window.location.protocol + "//" + window.location.host + "/";
+ return _emptySourcePath
+ }
+ }, _previousSrc: null, _previousBackgroundImage: null, _freezePromise: null, _transparentImage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.UI.ImagePaths.transparent
+ }), freeze: function () {
+ if (!this._frozen) {
+ this._frozen = true;
+ if (!document.hidden || MS.Entertainment.Utilities.isApp2)
+ this._freezePromise = WinJS.Promise.timeout(167).then(function clearImagesAfterFreeze() {
+ if (this._unloaded || !this._frozen)
+ return;
+ var currentSrc = this.domElement.src;
+ if (currentSrc && this._emptySourcePath !== currentSrc) {
+ this._previousSrc = currentSrc;
+ this.domElement.src = String.empty
+ }
+ if (this.domElement.style.backgroundImage) {
+ this._previousBackgroundImage = this.domElement.style.backgroundImage;
+ this.domElement.style.backgroundImage = String.empty
+ }
+ if (this.disableLazyDecode)
+ var touchImage = this.domElement.complete;
+ this._freezePromise = null
+ }.bind(this))
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function () {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._frozen && !this._unloaded) {
+ this._frozen = false;
+ if (this._freezePromise) {
+ this._freezePromise.cancel();
+ this._freezePromise = null
+ }
+ if (this._previousSrc && (!this.domElement.src || this.domElement.src === this._emptySourcePath) && !this.skipImageResetOnThaw)
+ this.domElement.src = this._previousSrc;
+ this._previousSrc = String.empty;
+ if (this._previousBackgroundImage && !this.domElement.style.backgroundImage && !this.skipImageResetOnThaw)
+ this.domElement.style.backgroundImage = this._previousBackgroundImage;
+ this._previousBackgroundImage = String.empty;
+ if (this.disableLazyDecode)
+ var touchImage = this.domElement.complete
+ }
+ }, _handleError: function _handleError(error) {
+ if (WinJS.Utilities.getMember("domElement.complete", this))
+ return;
+ if (!error || error.message !== "Canceled")
+ if (this.domElement) {
+ this.domElement.removeEventListener("error", this._handleError);
+ if (this.errorImage) {
+ if (this.applyImageAsBackground) {
+ this.domElement.style.backgroundImage = "url(" + this.errorImage + ")";
+ this._setImgSrc(this._transparentImage)
+ }
+ else
+ this._setImgSrc(this.errorImage);
+ this.domElement.setAttribute("imageLoaded", String.empty)
+ }
+ else {
+ if (this._removeEventHandlersOnError)
+ this.domElement.removeEventListener("load", this._handleLoaded);
+ this.hide(this.domElement);
+ this.domElement.removeAttribute("imageLoaded");
+ this._propagateImageLoadCompleteEventIfNeeded()
+ }
+ }
+ }, _handleLoaded: function _handleLoaded() {
+ if (this.domElement) {
+ this.domElement.removeEventListener("error", this._handleError);
+ this.domElement.removeEventListener("load", this._handleLoaded);
+ this.domElement.setAttribute("imageLoaded", String.empty);
+ var transparentImage = this._transparentImage;
+ if (this.applyImageAsBackground && this.domElement.src && this.domElement.src.indexOf(transparentImage, this.domElement.src.length - transparentImage.length) < 0) {
+ this.domElement.style.backgroundImage = "url(" + this.domElement.src.toString() + ")";
+ this._setImgSrc(transparentImage)
+ }
+ this._propagateImageLoadCompleteEventIfNeeded();
+ this.show(this.domElement)
+ }
+ }, _propagateImageLoadCompleteEventIfNeeded: function _propagateImageLoadCompleteEventIfNeeded() {
+ if (this.propagateImageLoadCompleteEvent) {
+ var imageLoadCompleteEvent = document.createEvent("Event");
+ imageLoadCompleteEvent.initEvent("imageLoadComplete", true, true);
+ imageLoadCompleteEvent.detail = { loaded: this.domElement ? this.domElement.hasAttribute("imageLoaded") : false };
+ this.domElement._naturalWidth = this.naturalWidth;
+ this.domElement._naturalHeight = this.naturalHeight;
+ this.domElement.dispatchEvent(imageLoadCompleteEvent);
+ this.imageLoadCompleteEventFired = true
+ }
+ }, loadImage: function loadImage(target) {
+ return WinJS.Promise.as(target)
+ }, _setImgSrc: function _setImgSrc(url) {
+ this.domElement.src = url;
+ if (this.disableLazyDecode)
+ var touchImage = this.domElement.complete;
+ if (this.domElement && this.domElement.parentElement && this.parentStyleIfNotEmpty)
+ if (url)
+ WinJS.Utilities.addClass(this.domElement.parentElement, this.parentStyleIfNotEmpty);
+ else
+ WinJS.Utilities.removeClass(this.domElement.parentElement, this.parentStyleIfNotEmpty)
+ }, _loadImage: function _loadImage(target) {
+ if (!this._enabled || !this.domElement)
+ return;
+ this.hide(this.domElement);
+ if (!target) {
+ if (this.clearSrcOnEmptyTarget) {
+ if (this.applyImageAsBackground)
+ this.domElement.style.backgroundImage = String.empty;
+ this._setImgSrc(String.empty)
+ }
+ return
+ }
+ if (this._loadPromise) {
+ this._loadPromise.cancel();
+ this._loadPromise = null
+ }
+ this._loadPromise = this.loadImage(target).done(function (result) {
+ if (this.domElement) {
+ this.domElement.addEventListener("load", this._handleLoaded);
+ this.domElement.addEventListener("error", this._handleError);
+ result = result || this.defaultImagePath;
+ if (!this.domElement.hasAttribute("imageLoaded") || result !== this.defaultImagePath)
+ try {
+ this._setImgSrc(result)
+ }
+ catch (e) {
+ fxassert(false, "Error setting image URL: " + result);
+ this._handleError()
+ }
+ }
+ this._loadPromise = null
+ }.bind(this), this._handleError.bind(this))
+ }, hide: function hide(element) { }, show: function show(element) { }, _delayInitialized: function _delayInitialized() {
+ if (!this._enabled) {
+ this._enabled = true;
+ this._loadImage(this.target)
+ }
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._loadPromise) {
+ this._loadPromise.cancel();
+ this._loadPromise = null
+ }
+ if (this._freezePromise) {
+ this._freezePromise.cancel();
+ this._freezePromise = null
+ }
+ this._previousSrc = null;
+ this._previousBackgroundImage = null;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, target: {
+ get: function target_get() {
+ return this._target
+ }, set: function target_set(value) {
+ if (this.target !== value) {
+ this._target = value;
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._target && this.bindTargetProperties)
+ this._bindings = WinJS.Binding.bind(this, {
+ target: {
+ imageUri: function () {
+ this._loadImage(value)
+ }.bind(this)
+ }
+ });
+ else
+ this._loadImage(value)
+ }
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ ReferenceDisposer: MS.Entertainment.UI.Framework.define(function ReferenceDisposer(classInstance) {
+ fxassert(classInstance, "Must provide a class to define properties with");
+ this._classInstance = classInstance;
+ this._attachedReferences = []
+ }, {
+ _attachedReferences: null, _classInstance: null, _disposeReference: function _disposeReference(reference) {
+ if (reference) {
+ if (Array.isArray(reference))
+ while (reference.length > 0)
+ this._disposeReference(reference.pop());
+ if (reference.cancel)
+ reference.cancel();
+ if (reference.dispose)
+ reference.dispose()
+ }
+ }, createReference: function createReference(variableName) {
+ var referenceNumber = null;
+ var initialVariableValue = this._classInstance[variableName];
+ Object.defineProperty(this._classInstance, variableName, {
+ set: function setReference(value) {
+ if (referenceNumber === null || referenceNumber >= this._attachedReferences.length) {
+ referenceNumber = this._attachedReferences.push(value) - 1;
+ initialVariableValue = null
+ }
+ else {
+ this._disposeReference(this._attachedReferences[referenceNumber]);
+ this._attachedReferences[referenceNumber] = value
+ }
+ }.bind(this), get: function getReference() {
+ return this._attachedReferences[referenceNumber]
+ }.bind(this)
+ });
+ return initialVariableValue
+ }, dispose: function dispose() {
+ while (this._attachedReferences.length > 0)
+ this._disposeReference(this._attachedReferences.pop())
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/scriptvalidator.js:9580 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ var skipValidation = true;
+ if (!skipValidation) {
+ var baseLength = (window.location.protocol + "//" + window.location.host).length;
+ var isInUnitTest = (window.isInUnitTest);
+ var existingScripts = [];
+ var scriptsAfterMainChecked = false
+ }
+ function getCurrentScripts(currentScripts, headScripts) {
+ if (skipValidation)
+ return [];
+ var scripts = currentScripts || [];
+ var documentScripts = headScripts || document.head.querySelectorAll("script[src]");
+ var scriptsLength = scripts.length;
+ var documentScriptsLength = documentScripts.length;
+ for (var i = scriptsLength; i < documentScriptsLength; i++)
+ scripts.push(documentScripts[i].src.substr(baseLength).toLowerCase());
+ return scripts
+ }
+ function scriptValidator(files) {
+ if (isInUnitTest || skipValidation || window.loadingMergedJsFile)
+ return;
+ if (!existingScripts.length)
+ existingScripts = getCurrentScripts(existingScripts, headScripts);
+ var scriptsToCheck = Array.prototype.map.call(arguments, function (item) {
+ return item.toLowerCase()
+ });
+ scriptsToCheck.forEach(function (path) {
+ if (MS && MS.Entertainment && MS.Entertainment.UI && MS.Entertainment.UI.Framework && MS.Entertainment.UI.Framework.scriptMappings && MS.Entertainment.UI.Framework.scriptMappings[path])
+ path = MS.Entertainment.UI.Framework.scriptMappings[path];
+ var isAbsolute = (path.charAt(0) === "/");
+ if (!isAbsolute)
+ fail("File: " + path + " was not an absolute path");
+ validateScriptIncluded(path, existingScripts);
+ if (existingScripts.indexOf(path) < 0)
+ existingScripts.push(path)
+ });
+ var headScripts = document.head.querySelectorAll("script[src]");
+ if (headScripts.length !== existingScripts.length)
+ existingScripts = getCurrentScripts(existingScripts, headScripts)
+ }
+ { };
+ Object.defineProperty(window, "scriptValidator", {
+ value: scriptValidator, writable: false, enumerable: true, configurable: false
+ });
+ window.scriptValidator.getUnreferencedScripts = function getUnreferencedScripts() {
+ var unreferencedScripts = [];
+ getCurrentScripts().forEach(function (item) {
+ if (existingScripts.indexOf(item) < 0)
+ unreferencedScripts.push(item)
+ });
+ return unreferencedScripts
+ };
+ function validateScriptIncluded(script, currentScripts) {
+ var foundAt = currentScripts.indexOf(script);
+ if (foundAt < 0) {
+ fail("Script: " + script + " was not found in the script tags");
+ return
+ }
+ }
+ function fail(message) {
+ if (MS && MS.Entertainment && MS.Entertainment.assert)
+ MS.Entertainment.assert(false, message);
+ else {
+ alert(message);
+ debugger
+ }
+ }
+ })()
+})();
+/* >>>>>>/framework/debug.js:9654 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ var e = WinJS.Promise.wrapError();
+ var d = Object.getPrototypeOf(e).done;
+ Object.getPrototypeOf(e).done = function (c, e, p) {
+ e = e || function (v) {
+ if (!(v instanceof Error)) {
+ var description;
+ try {
+ if (v && Object.keys(v).length === 0)
+ description = "Empty object: " + JSON.stringify(v);
+ else
+ description = JSON.stringify(v)
+ }
+ catch (e) {
+ description = "[unknown]"
+ }
+ v = {
+ number: 0, stack: "", description: description
+ }
+ }
+ else if (v.name === "Canceled")
+ return;
+ debugger;
+ MSApp.terminateApp(v)
+ };
+ d.call(this, c, e, p)
+ };
+ var c = WinJS.Promise.wrap();
+ Object.getPrototypeOf(c).done = function (c) {
+ this.then(c).then(null, function (v) {
+ if (!(v instanceof Error)) {
+ var description;
+ try {
+ description = JSON.stringify(v)
+ }
+ catch (e) {
+ description = "[unknown]"
+ }
+ v = {
+ number: 0, stack: "", description: description
+ }
+ }
+ else if (v.name === "Canceled")
+ return;
+ debugger;
+ MSApp.terminateApp(v)
+ })
+ };
+ var isInUnitTest = window.isInUnitTest;
+ var alertsToShow = [];
+ var dialogVisible = false;
+ var showPendingAlerts = function showPendingAlerts() {
+ if (dialogVisible || !alertsToShow.length)
+ return;
+ dialogVisible = true;
+ if (!MS.Entertainment.Utilities.isApp2Platform)
+ new Windows.UI.Popups.MessageDialog(alertsToShow.shift()).showAsync().done(function () {
+ dialogVisible = false;
+ showPendingAlerts()
+ })
+ };
+ window.alert = function (message) {
+ if (window.console && window.console.log)
+ window.console.log(message);
+ if (!isInUnitTest) {
+ alertsToShow.push(message);
+ showPendingAlerts()
+ }
+ }
+ })();
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Debug", {
+ write: (function () {
+ var debugUtility = null;
+ var console = window.console;
+ return function write(text) {
+ text = (new Date).toLocaleTimeString() + ": " + text;
+ if (console && console.log)
+ console.log(text);
+ if (!debugUtility)
+ debugUtility = new Microsoft.Entertainment.Util.Debug;
+ debugUtility.outputDebugString(text)
+ }
+ })(), writeLine: function writeLine(text) {
+ MS.Entertainment.UI.Debug.write(text + "\n")
+ }, defineAssert: function defineAssert(ns) {
+ var resolvedNamespace = WinJS.Utilities.getMember(ns);
+ if (resolvedNamespace && resolvedNamespace.assert)
+ return;
+ WinJS.Namespace.define(ns, {
+ assert: function assert(condition, message, optional_parameter, optional_errorLevel) {
+ optional_errorLevel = optional_errorLevel || MS.Entertainment.UI.Debug.errorLevel.high;
+ return MS.Entertainment.UI.Debug._doAssert(condition, ns, message, optional_parameter, optional_errorLevel)
+ }, fail: function fail(message, optional_parameter, optional_errorLevel) {
+ WinJS.Utilities.getMember(ns).assert(false, message, optional_parameter, optional_errorLevel)
+ }
+ })
+ }, errorLevel: {
+ high: 0, low: 10
+ }, getStackTrace: function getStackTrace() {
+ var stackTrace = "";
+ try {
+ throw new Error;
+ }
+ catch (e) {
+ stackTrace = e.stack
+ }
+ return stackTrace
+ }, unhandledPromiseErrorHandler: function unhandledPromiseErrorHandler(error) {
+ try {
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios()
+ }
+ catch (e) { }
+ if (MS.Entertainment.handleError && MS.Entertainment.handleError(error))
+ return true;
+ else if (error.detail && error.detail.promise) {
+ var errorString = String.empty;
+ try {
+ errorString = JSON.stringify(error.detail)
+ }
+ catch (e) { }
+ if (error.detail.exception && error.detail.exception.stack)
+ MS.Entertainment.fail("Unhandled error in a promise. Error exception was:" + error.detail.exception + ".\n " + "Stack: " + error.detail.exception.stack + ".\n " + "Detailed Error Info was: " + errorString);
+ else {
+ var detailedErrorInfo;
+ if (error.detail.error) {
+ detailedErrorInfo = {
+ errorCode: error.detail.error.errorCode, description: error.detail.error.description
+ };
+ if (error.detail.error.asyncOpSource)
+ detailedErrorInfo.asyncOpSourceStack = error.detail.error.asyncOpSource.stack
+ }
+ var detailedErrorInfoString = String.empty;
+ try {
+ detailedErrorInfoString = JSON.stringify(detailedErrorInfo)
+ }
+ catch (e) { }
+ MS.Entertainment.fail("Unhandled error in a promise. Error exception was:" + error.detail.exception + ".\n " + "Error was:" + error.detail.error + ".\n " + "Detailed Error Info was: " + detailedErrorInfoString + ".\n " + "Additional Error Data: " + errorString)
+ }
+ return true
+ }
+ return false
+ }, handleAssert: function handleAssert(condition, area, message, parameter, errorLevel) {
+ if (MS.Entertainment.UI.Debug._configurationManager === null)
+ MS.Entertainment.UI.Debug._configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var ignoreLowPriorityAsserts;
+ if (MS.Entertainment.UI.Debug._configurationManager && MS.Entertainment.UI.Debug._configurationManager.shell)
+ ignoreLowPriorityAsserts = MS.Entertainment.UI.Debug._configurationManager.shell.ignoreLowPriorityAsserts;
+ else
+ ignoreLowPriorityAsserts = false;
+ if (errorLevel !== MS.Entertainment.UI.Debug.errorLevel.low || !ignoreLowPriorityAsserts)
+ return false;
+ else
+ return true
+ }, _doAssert: (function () {
+ var shipAssertProvider;
+ return function _doAssert(condition, area, message, parameter, errorLevel) {
+ if (!(condition) && (!MS.Entertainment.UI.Debug.handleAssert || !MS.Entertainment.UI.Debug.handleAssert(condition, area, message, parameter, errorLevel))) {
+ var stack = MS.Entertainment.UI.Debug.getStackTrace();
+ var signature = MS.Entertainment.UI.Debug._getFunctionSignature(stack);
+ try {
+ if (!shipAssertProvider)
+ shipAssertProvider = new Microsoft.Entertainment.Infrastructure.ShipAssertProvider;
+ shipAssertProvider.shipAssert(area, signature, stack, message, parameter)
+ }
+ catch (e) { }
+ }
+ }
+ })(), _getFunctionSignature: function _getFunctionSignature(stackTrace) {
+ var fnString = stackTrace.split("\n")[4];
+ var signature = fnString.substring(fnString.indexOf("at ") + 3, fnString.indexOf("(") - 1).trim();
+ return signature
+ }, _configurationManager: null
+ })
+ })();
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Application.Helpers", {
+ animationsRunning: 0, failedAnimations: 0
+ });
+ var dumpElementInformation = function dumpElementInformation(message, element) {
+ if (console && console.msIsIndependentlyComposed)
+ console.log(message + element.id + ", classes: " + element.className + ", independent: " + console.msIsIndependentlyComposed(element) + ", control: " + element.getAttribute("data-win-control"))
+ };
+ var dumpHiddenInfo = function dumpHiddenInfo(element) {
+ var computedStyle;
+ var workingElement = element;
+ while (workingElement) {
+ computedStyle = window.getComputedStyle(workingElement);
+ if (workingElement.className.indexOf && workingElement.className.indexOf("hideFromDisplay") >= 0)
+ dumpElementInformation("Element has the 'hideFromDisplay' class applied. ID:", workingElement);
+ else if (workingElement.currentStyle && workingElement.currentStyle.visibility && workingElement.currentStyle.visibility === "hidden")
+ dumpElementInformation("Element has visibility set directly. visibility: " + workingElement.currentStyle.visibility + " ID:", workingElement);
+ else if (computedStyle["visibility"] && computedStyle["visibility"] === "hidden")
+ dumpElementInformation("Element, or parent is hidden. visibility: " + workingElement.style.visibility + " ID:", workingElement);
+ else if (computedStyle["display"] === "none")
+ dumpElementInformation("Element, or parent is display: none. ID:", workingElement);
+ if (computedStyle["opacity"] === 0)
+ dumpElementInformation("Element, or parent has an opacity of 0. ID:", workingElement);
+ if (computedStyle["z-index"] < 0)
+ dumpElementInformation("Element, or parent has a negative z-index. ID:", workingElement);
+ workingElement = workingElement.parentElement
+ }
+ };
+ window.addEventListener("animationstart", function animationsStartedTracing(e) {
+ if (console && console.msIsIndependentlyComposed) {
+ if (!console.msIsIndependentlyComposed(e.srcElement)) {
+ dumpElementInformation("****animation not independently composed:" + e.animationName + ", ", e.srcElement);
+ dumpHiddenInfo(e.srcElement);
+ MS.Entertainment.UI.Application.Helpers.failedAnimations++
+ }
+ }
+ else
+ MS.Entertainment.UI.Application.Helpers.failedAnimations = "N/A";
+ MS.Entertainment.UI.Application.Helpers.animationsRunning++
+ });
+ window.addEventListener("animationend", function animationsStartedTracing(e) {
+ MS.Entertainment.UI.Application.Helpers.animationsRunning--
+ });
+ window.addEventListener("transitionstart", function transitionsStartedTracing(e) {
+ if (console && console.msIsIndependentlyComposed && !console.msIsIndependentlyComposed(e.srcElement)) {
+ dumpElementInformation("****transition not independently composed:" + e.propertyName + ", ", e.srcElement);
+ dumpHiddenInfo(e.srcElement);
+ MS.Entertainment.UI.Application.Helpers.failedAnimations++
+ }
+ { }
+ });
+ MS.Entertainment.UI.Debug.defineAssert("Trace")
+ })()
+})();
+/* >>>>>>/framework/utilities.js:9890 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment");
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI");
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Framework");
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Utilities");
+ (function () {
+ "use strict";
+ Object.defineProperty(Array.prototype, 'unique', {
+ value: function () {
+ var isUnique = function isUnique(element, index, array) {
+ return array.indexOf(element) === index
+ };
+ return this.filter(isUnique)
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'merge', {
+ value: function () {
+ var result = [];
+ if (this && this.length > 0)
+ this.forEach(function (array) {
+ result = result.concat(array)
+ });
+ return result
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'interleave', {
+ value: function () {
+ var result = [];
+ if (this && this.length > 0) {
+ var maxLength = -1;
+ this.forEach(function (array) {
+ if (!isNaN(array.length))
+ maxLength = Math.max(maxLength, array.length)
+ });
+ for (var i = 0; i < maxLength; i++)
+ this.forEach(function (array) {
+ if (!isNaN(array.length) && i < array.length)
+ result.push(array[i])
+ })
+ }
+ return result
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'spliceArray', {
+ value: function (index, deleteCount, items) {
+ var args = [index, deleteCount].concat(items);
+ return this.splice.apply(this, args)
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'clone', {
+ value: function () {
+ return this.slice(0)
+ }, enumerable: false
+ });
+ (function () {
+ if (String['load'])
+ throw "String function already has a load function defined";
+ else if (String.prototype['format'])
+ throw "String prototype already has a format function defined";
+ if (!String.empty)
+ Object.defineProperty(String, "empty", {
+ value: "", writable: false, enumerable: true
+ });
+ if (!String.isString)
+ Object.defineProperty(String, "isString", {
+ value: function (value) {
+ return typeof value === "string"
+ }, writable: false, enumerable: true
+ });
+ if (!String.nbsp)
+ Object.defineProperty(String, "nbsp", {
+ value: "\u00A0", writable: false, enumerable: true
+ });
+ if (!String.ltrm)
+ Object.defineProperty(String, "ltrm", {
+ value: "\u200E", writable: false, enumerable: true
+ });
+ if (!String.ltrmCode)
+ Object.defineProperty(String, "ltrmCode", {
+ value: 0x200E, writable: false, enumerable: true
+ });
+ if (!String.rtlm)
+ Object.defineProperty(String, "rtlm", {
+ value: "\u200F", writable: false, enumerable: true
+ });
+ if (!String.rtlmCode)
+ Object.defineProperty(String, "rtlmCode", {
+ value: 0x200F, writable: false, enumerable: true
+ });
+ var resourceLoader;
+ try {
+ resourceLoader = new Windows.ApplicationModel.Resources.ResourceLoader
+ }
+ catch (err) {
+ MS.Entertainment.fail("Windows.ApplicationModel.Resources.ResourceLoader failed with error: " + err)
+ }
+ String.idOverride = [];
+ String.load = function loadString(stringId, skipIdVision) {
+ if (!resourceLoader)
+ return String.empty;
+ if (String.idOverride[stringId])
+ stringId = String.idOverride[stringId];
+ MS.Entertainment.assert(stringId, "Can't find stringId: '" + stringId + "'");
+ var loadedString = resourceLoader.getString(stringId);
+ MS.Entertainment.assert(loadedString, "String lookup failed: '" + stringId + "'");
+ return loadedString
+ }
+ })();
+ String.prototype.format = function formatString() {
+ var argumentList = arguments;
+ var matchNum = this.match(/{(\d+)}/g);
+ if (!matchNum) {
+ MS.Entertainment.assert(false, "string value, '" + this.toString() + "', has no placeholders to allow for replacement");
+ return this.toString()
+ }
+ if (matchNum.length !== argumentList.length) {
+ MS.Entertainment.assert(false, "Incorrect number of arguments passed into format function. String: {0} Expected: {1}; Received: {2}".format(this.toString(), matchNum.length, argumentList.length));
+ return String.empty
+ }
+ return this.replace(/{(\d+)}/g, function (placeholder, index) {
+ return argumentList[index] !== undefined ? argumentList[index] : placeholder
+ })
+ };
+ String.prototype.editDistanceFrom = function editDistanceFrom(targetString) {
+ if (!targetString)
+ return -1;
+ var editMatrix = new Array(this.length + 1);
+ for (var i = 0; i <= this.length; i++)
+ editMatrix[i] = new Array(targetString.length + 1);
+ for (var i = 0; i <= this.length; i++)
+ editMatrix[i][0] = i;
+ for (var j = 0; j <= targetString.length; j++)
+ editMatrix[0][j] = j;
+ for (var j = 0; j < targetString.length; j++)
+ for (var i = 0; i < this.length; i++)
+ if (this[i] === targetString[j])
+ editMatrix[i + 1][j + 1] = editMatrix[i][j];
+ else {
+ var deleteDistance = editMatrix[i][j + 1] + 1;
+ var insertDistance = editMatrix[i + 1][j] + 1;
+ var substituteDistance = editMatrix[i][j] + 1;
+ editMatrix[i + 1][j + 1] = Math.min(deleteDistance, insertDistance, substituteDistance)
+ }
+ return editMatrix[this.length][targetString.length]
+ };
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ useRadioStrings: function useRadioStrings() {
+ String.idOverride[String.id.IDS_MUSIC_SMARTDJ_PIVOT] = String.id.IDS_MUSIC_RADIO_PIVOT;
+ String.idOverride[String.id.IDS_MUSIC_SMARTDJ_PIVOT_TC] = String.id.IDS_MUSIC_RADIO_PIVOT_TC;
+ String.idOverride[String.id.IDS_SMARTDJ_ERROR_CAPTION] = String.id.IDS_RADIO_ERROR_CAPTION;
+ String.idOverride[String.id.IDS_MUSIC_INTRO_DETAILS] = String.id.IDS_MUSIC_INTRO_DETAILS_RADIO;
+ String.idOverride[String.id.IDS_SMARTDJ_COLLECTION_TITLE] = String.id.IDS_RADIO_COLLECTION_TITLE;
+ String.idOverride[String.id.IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION] = String.id.IDS_RADIO_PLAY_FROM_MEDIA_ACTION;
+ String.idOverride[String.id.IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION_LC] = String.id.IDS_RADIO_PLAY_FROM_MEDIA_ACTION_LC;
+ String.idOverride[String.id.IDS_SMARTDJ_PLAYING_TEXT] = String.id.IDS_RADIO_PLAYING_TEXT;
+ String.idOverride[String.id.IDS_SMARTDJ_PLAYING_TEXT_LC] = String.id.IDS_RADIO_PLAYING_TEXT_LC;
+ String.idOverride[String.id.IDS_SMARTDJ_CARD_LABEL] = String.id.IDS_RADIO_CARD_LABEL;
+ String.idOverride[String.id.IDS_SMARTDJ_CARD_LABEL_LC] = String.id.IDS_RADIO_CARD_LABEL_LC;
+ String.idOverride[String.id.IDS_SMARTDJ_CREATE_ACTION] = String.id.IDS_RADIO_CREATE_ACTION;
+ String.idOverride[String.id.IDS_SMARTDJ_CREATE_ACTION_LC] = String.id.IDS_RADIO_CREATE_ACTION_LC;
+ String.idOverride[String.id.IDS_SMARTDJ_ARTIST_NOT_FOUND] = String.id.IDS_RADIO_ARTIST_NOT_FOUND;
+ String.idOverride[String.id.IDS_SMARTDJ_NONSMARTDJ_ARTIST] = String.id.IDS_RADIO_NONSMARTDJ_ARTIST;
+ String.idOverride[String.id.IDS_SMARTDJ_LOADING_TEXT] = String.id.IDS_RADIO_LOADING_TEXT;
+ String.idOverride[String.id.IDS_SMARTDJ_OFFINE_ERROR_TITLE] = String.id.IDS_RADIO_OFFINE_ERROR_TITLE;
+ String.idOverride[String.id.IDS_SMARTDJ_EMPTY_GALLERY_ACTION] = String.id.IDS_RADIO_EMPTY_GALLERY_ACTION;
+ String.idOverride[String.id.IDS_SMARTDJ_ARTIST_RESULTS] = String.id.IDS_RADIO_ARTIST_RESULTS;
+ String.idOverride[String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_SMARTDJ] = String.id.IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_RADIO;
+ String.idOverride[String.id.IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL] = String.id.IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL;
+ String.idOverride[String.id.IDS_NOW_PLAYING_OP_SMARTDJ_ACTION] = String.id.IDS_NOW_PLAYING_OP_RADIO_ACTION;
+ String.idOverride[String.id.IDS_MUSIC_ENGAGE_NEW_SMARTDJ_ACTION] = String.id.IDS_MUSIC_ENGAGE_NEW_RADIO_ACTION;
+ String.idOverride[String.id.IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_DESC] = String.id.IDS_MUSIC_ENGAGE_NEW_RADIO_FREE_DESC;
+ String.idOverride[String.id.IDS_SMARTDJ_PAGE_CREATE_SMARTDJ_ACTION] = String.id.IDS_RADIO_PAGE_CREATE_RADIO_ACTION;
+ String.idOverride[String.id.IDS_SMARTDJ_PAGE_ERROR_GALLERY_TITLE] = String.id.IDS_RADIO_PAGE_ERROR_GALLERY_TITLE
+ }, useCollectionStrings: function useCollectionStrings() {
+ String.idOverride[String.id.IDS_MUSIC_ADD_TO_LIST_CLOUD_ACTION] = String.id.IDS_MUSIC_ADD_TO_LIST_CLOUD_COLLECTION_ACTION;
+ String.idOverride[String.id.IDS_MUSIC_ADD_TO_MY_MUSIC_BUTTON] = String.id.IDS_MUSIC_ADD_TO_COLLECTION_BUTTON;
+ String.idOverride[String.id.IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE] = String.id.IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE;
+ String.idOverride[String.id.IDS_MUSIC_SETTINGS_CLOUD_MUSIC_TITLE] = String.id.IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_TITLE;
+ String.idOverride[String.id.IDS_MUSIC_CLOUD_ICON_HEADER] = String.id.IDS_MUSIC_CLOUD_COLLECTION_ICON_HEADER
+ }, useDTOOnlyStrings: function useDTOOnlyStrings() {
+ String.idOverride[String.id.IDS_MUSIC_EXPLORE_PIVOT_TC] = String.id.IDS_MUSIC_STORE_PIVOT_TC
+ }
+ });
+ (function () {
+ if (WinJS && WinJS.Promise && !WinJS.Promise.isCanceledError)
+ Object.defineProperty(WinJS.Promise, "isCanceledError", {
+ value: function isCanceled(error) {
+ return (error && error.name === "Canceled")
+ }, writable: false, enumerable: true
+ })
+ })();
+ (function () {
+ var secondMS = 1000;
+ var minuteMS = 60 * secondMS;
+ var hourMS = 60 * minuteMS;
+ var dayMS = 24 * hourMS;
+ Date.minValue = new Date(0);
+ Date.getTimeUTC = function toUTC(date) {
+ return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())
+ };
+ Date.subtract = function subtract(date1, date2) {
+ var delta = Date.getTimeUTC(date1) - Date.getTimeUTC(date2);
+ var result = {
+ days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0
+ };
+ result.days = Math.floor(delta / dayMS);
+ delta = delta - (result.days * dayMS);
+ result.hours = Math.floor(delta / hourMS);
+ delta = delta - (result.hours * hourMS);
+ result.minutes = Math.floor(delta / minuteMS);
+ delta = delta - (result.minutes * minuteMS);
+ result.seconds = Math.floor(delta / secondMS);
+ delta = delta - (result.seconds * secondMS);
+ result.milliseconds = delta;
+ return result
+ };
+ Date.isValidExpirationDate = function isValidExpirationDate(date) {
+ var now = new Date;
+ if (date.getFullYear() - now.getFullYear() < 100)
+ return true;
+ else
+ return false
+ };
+ function getNewConstructorFunction() {
+ return function () {
+ if (this === window)
+ throw new Error("Need to use 'new' to invoke the constructor");
+ this.base()
+ }
+ }
+ WinJS.Namespace.define("MS.Entertainment", {
+ derive: function derive(baseClass, constructor, instanceMembers, staticMembers) {
+ return MS.Entertainment.deferredDerive(baseClass, constructor, instanceMembers, staticMembers).get()
+ }, deferredDerive: function deferredDerive(baseClass, constructor, instanceMembers, staticMembers) {
+ var value;
+ return {
+ get: function entertainmentDerive_getter() {
+ if (value)
+ return value;
+ if (typeof baseClass === "string") {
+ var baseClassName = baseClass;
+ baseClass = WinJS.Utilities.getMember(baseClass);
+ MS.Entertainment.Utilities.assert(baseClass, "Could not resolve baseClass named " + baseClassName)
+ }
+ MS.Entertainment.Utilities.assert(baseClass, "Base class was not valid. Can't derive without something to derive from");
+ if (!constructor)
+ constructor = getNewConstructorFunction();
+ if (instanceMembers.base)
+ throw "Deriving requires that there is no existing 'base' property";
+ var localInstanceMembers = MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(instanceMembers);
+ var helperConstructor = function () { };
+ if (baseClass.prototype._initObservable && !baseClass.prototype._preventObservableInheritance) {
+ localInstanceMembers = WinJS.Binding.expandProperties(instanceMembers);
+ helperConstructor = function () {
+ MS.Entertainment.assert(this._backingData, "We thought this was observable. It's not, reconsider...");
+ for (var member in instanceMembers)
+ if (instanceMembers.hasOwnProperty(member))
+ this._backingData[member] = instanceMembers[member]
+ }
+ }
+ var baseConstructors = [function () {
+ baseClass.prototype.constructor.apply(this, arguments);
+ helperConstructor.call(this)
+ }];
+ if (baseClass.prototype._baseConstructors)
+ baseConstructors = baseClass.prototype._baseConstructors.concat(baseConstructors);
+ localInstanceMembers._baseConstructors = baseConstructors;
+ localInstanceMembers.base = function () {
+ if (this._baseConstructors === baseConstructors)
+ this._baseConstructors = this._baseConstructors.concat();
+ var baseConstructor = this._baseConstructors.pop();
+ if (baseConstructor)
+ baseConstructor.apply(this, arguments)
+ };
+ value = WinJS.Class.derive(baseClass, constructor, localInstanceMembers, MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(staticMembers));
+ return value
+ }, configurable: true
+ }
+ }
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment", {
+ defineObservable: function (constructor, instanceMembers, staticMembers) {
+ return MS.Entertainment.UI.Framework.derive(WinJS.Binding.define(instanceMembers), function defineObservableConstructor() {
+ this._initObservable(Object.create(MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(instanceMembers)));
+ constructor.apply(this, arguments)
+ }, null, MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(staticMembers))
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment", {
+ defineOptionalObservable: function (constructor, instanceMembers, observableMembers, staticMembers) {
+ return MS.Entertainment.UI.Framework.derive(WinJS.Binding.define(observableMembers), function defineOptionalObservableConstructor() {
+ if (this === window)
+ throw new Error("Need to use 'new' to invoke the constructor");
+ if (observableMembers)
+ this._initObservable(Object.create(observableMembers));
+ constructor.apply(this, arguments)
+ }, instanceMembers, MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(staticMembers))
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment", {
+ _appMode: null, appMode: {
+ get: function () {
+ if (this._appMode === null)
+ this._appMode = 0;
+ return this._appMode
+ }, set: function (value) {
+ this._appMode = value
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ EventSource: MS.Entertainment.UI.Framework.define(function eventSource() {
+ this._eventhandlers = [];
+ this._eventSource = new MS.Entertainment.UI.Framework.ObservableBase
+ }, {
+ _eventSource: null, _eventhandlers: null, addEventHandlers: function addEventHandlers(events) {
+ MS.Entertainment.UI.assert(!Array.isArray(events), "Events passed in cannot be an array");
+ var eventHandlers;
+ eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._eventSource, events);
+ this._eventhandlers.push(eventHandlers);
+ return eventHandlers
+ }, dispose: function dispose() {
+ for (var i = 0; i < this._eventhandlers.length; i++)
+ this._eventhandlers[i].cancel();
+ this._eventhandlers = []
+ }, dispatchEvent: function dispatchEvent(eventName, parameters) {
+ this._eventSource.dispatchEvent(eventName, parameters)
+ }
+ })
+ });
+ var isNetworkAvailable = function isNetworkAvailable() {
+ try {
+ return MS.Entertainment.UI.NetworkStatusService.isOnline()
+ }
+ catch (ex) {
+ MS.Entertainment.fail("Exception in isNetworkAvailable, make sure uiState service has been registered prior playback attempt: " + MS.Entertainment.Utilities.stringify(ex));
+ return true
+ }
+ };
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ playabilityTest: function (mediaItem, options) {
+ var mediaRightsConditions = null;
+ var returnObj = { notificationText: null };
+ if (!mediaItem)
+ return returnObj;
+ var ServiceLocator = MS.Entertainment.ServiceLocator;
+ var Services = MS.Entertainment.Services;
+ if (options.cloudRights && ServiceLocator.isServiceRegistered(Services.cloudRestrictionCollection))
+ mediaRightsConditions = ServiceLocator.getService(Services.cloudRestrictionCollection);
+ var leastRestrictiveRights;
+ if (!mediaItem.fileItem) {
+ if (!mediaRightsConditions && ServiceLocator.isServiceRegistered(Services.trackRestrictionCollection) && options.mediaRights)
+ mediaRightsConditions = ServiceLocator.getService(Services.trackRestrictionCollection);
+ if (mediaRightsConditions)
+ leastRestrictiveRights = mediaRightsConditions.getLeastRestrictive(mediaItem, options.rights);
+ if (leastRestrictiveRights && leastRestrictiveRights.description) {
+ returnObj.notificationText = leastRestrictiveRights.description;
+ returnObj.isUnplayable = leastRestrictiveRights.isUnplayable;
+ returnObj.isUnavailable = !!leastRestrictiveRights.isUnavailable;
+ returnObj.leastRestrictiveRights = leastRestrictiveRights;
+ if (leastRestrictiveRights.actionId) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ returnObj.notificationAction = actionService.getAction(leastRestrictiveRights.actionId)
+ }
+ }
+ }
+ else {
+ returnObj.isUnavailable = !mediaItem.fileItem.isAvailable;
+ returnObj.isPlayable = !returnObj.isUnavailable;
+ mediaItem.canPlayLocally = returnObj.isPlayable;
+ return returnObj
+ }
+ var shouldSkipItem = !mediaItem.playPreviewOnly && (returnObj.isUnavailable || returnObj.isUnplayable);
+ returnObj.notConnected = false;
+ if (!shouldSkipItem && !mediaItem.canPlayLocally && !isNetworkAvailable()) {
+ returnObj.notConnected = true;
+ shouldSkipItem = true
+ }
+ returnObj.explicitAllowed = true;
+ if (options.checkExplicit && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ if (mediaItem.isExplicit && !mediaItem.inCollection && mediaItem.libraryId === -1) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var canPlayExplicit = signedInUser.hasExplicitPrivilege;
+ if ((signInService.isSignedIn && !canPlayExplicit) || !signInService.isSignedIn) {
+ returnObj.explicitAllowed = false;
+ returnObj.notificationText = String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_ITEM_EXPLICIT_BANNER_NOTIFICATION_TITLE);
+ shouldSkipItem = true
+ }
+ }
+ returnObj.isPlayable = !shouldSkipItem;
+ return returnObj
+ }, playabilityTestAsync: (function playabilityTestAsync_closure() {
+ function shouldQueryMediaState(playability) {
+ return !playability.isPlayable && !playability.notConnected && playability.explicitAllowed
+ }
+ return function playabilityTestAsync(mediaItem, options) {
+ var hydrateLibraryInfoPromise;
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ hydrateLibraryInfoPromise = MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(mediaItem);
+ else
+ hydrateLibraryInfoPromise = WinJS.Promise.as(mediaItem);
+ return hydrateLibraryInfoPromise.then(function onCompleted(mediaItem) {
+ var playability = MS.Entertainment.Utilities.playabilityTest(mediaItem, options);
+ if (shouldQueryMediaState(playability))
+ return MS.Entertainment.ViewModels.SmartBuyStateEngine.queryMediaStateAsync(mediaItem, null).then(function onMediaState(state) {
+ if (state.canPlay)
+ playability.isPlayable = true;
+ return playability
+ }, function queryStateFailed(error) {
+ return playability
+ });
+ else
+ return WinJS.Promise.wrap(playability)
+ })
+ }
+ })()
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities.DRM", {
+ individualizationAsync: function () {
+ if (MS.Entertainment.Platform.Playback.drmIndividualizationPromise)
+ return MS.Entertainment.Platform.Playback.drmIndividualizationPromise;
+ var drmIndivSignal = new MS.Entertainment.UI.Framework.Signal;
+ var versionCheckPromise = drmIndivSignal.promise;
+ MS.Entertainment.Platform.Playback.individualizationWorker = new Worker("/Components/Playback/IndivWorker.js");
+ MS.Entertainment.Platform.Playback.individualizationWorker.onmessage = function (event) {
+ drmIndivSignal.complete(event.data)
+ };
+ MS.Entertainment.Platform.Playback.drmIndividualizationPromise = versionCheckPromise.then(function checkComplete(individualizedAlready) {
+ if (individualizedAlready)
+ return true;
+ try {
+ var individualizationRequest = new Microsoft.Media.PlayReadyClient.PlayReadyIndividualizationServiceRequest;
+ return individualizationRequest.beginServiceRequest().then(function individualizationRequest_success() {
+ return true
+ }, function individualizationRequest_failure() {
+ return false
+ })
+ }
+ catch (ex) {
+ return false
+ }
+ }).then(function (isIndividualized) {
+ MS.Entertainment.Utilities.isDrmIndividualized = isIndividualized;
+ var status = isIndividualized ? "Success" : "Failure";
+ MS.Entertainment.Utilities.Telemetry.logDRMIndividualization(status);
+ return isIndividualized
+ });
+ return MS.Entertainment.Platform.Playback.drmIndividualizationPromise
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment", {
+ ProxyHelpers: MS.Entertainment.UI.Framework.define(null, {}, {
+ proxyObservables: function (outerObject, innerObject, observables) {
+ observables.forEach(function (observable) {
+ var externalSet = function (v) {
+ var oldValue = outerObject[observable];
+ outerObject.setProperty(observable, v);
+ if (outerObject.dispatchEvent)
+ outerObject.dispatchEvent(observable + "Changed", {
+ newValue: v, oldValue: oldValue
+ })
+ };
+ innerObject.bind(observable, externalSet);
+ Object.defineProperty(outerObject, observable, {
+ set: function (v) {
+ innerObject[observable] = v
+ }, get: function () {
+ return innerObject[observable]
+ }, enumerable: true, configurable: false
+ })
+ })
+ }, proxyProperties: function (outerObject, innerObject, properties) {
+ properties.forEach(function (property) {
+ Object.defineProperty(outerObject, property, {
+ set: function (v) {
+ innerObject[property] = v
+ }, get: function () {
+ return innerObject[property]
+ }, enumerable: true, configurable: false
+ })
+ })
+ }, delegateFunctions: function (outerObject, innerObject, methods) {
+ methods.forEach(function (method) {
+ Object.defineProperty(outerObject, method, {
+ value: function () {
+ return innerObject[method].apply(innerObject, arguments)
+ }, enumerable: true, configurable: false
+ })
+ })
+ }
+ })
+ });
+ (function () {
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ bindWorker: MS.Entertainment.UI.Framework.bindWorker, weakElementBindingInitializer: MS.Entertainment.UI.Framework.weakElementBindingInitializer, checkIfInDom: MS.Entertainment.UI.Framework.checkIfInDom, forceFullLayout: MS.Entertainment.UI.Framework.forceFullLayout, thawControlsInSubtree: MS.Entertainment.UI.Framework.thawControlsInSubtree, freezeControlsInSubtree: MS.Entertainment.UI.Framework.freezeControlsInSubtree, empty: MS.Entertainment.UI.Framework.empty, addEventHandlers: MS.Entertainment.UI.Framework.addEventHandlers, removeEvents: MS.Entertainment.UI.Framework.removeEvents
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ EventInvoker: WinJS.Class.mix(function () {
+ this._initObservable()
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin), assertError: function assertError(message, error) {
+ if (!error)
+ return;
+ MS.Entertainment.Utilities.assert(WinJS.Promise.isCanceledError(error), "{0} [Error Number: {1}] [Error Code: {2}] [Error Async Type: {3}] [Error Async Causality: {4}] [Error Message: {5}] [Error Stack: {6}]".format(message, error.number, error.errorCode, error.asyncOpType, error.asyncOpCausalityId, error.message, error.stack))
+ }, attachResizeEvent: function attachEvent(object, callback) {
+ if (object.attachEvent)
+ object.attachEvent("onresize", callback);
+ else
+ object.addEventListener("mselementresize", callback);
+ return {
+ cancel: function () {
+ MS.Entertainment.Utilities.detachResizeEvent(object, callback)
+ }
+ }
+ }, detachResizeEvent: function detachEvent(object, callback) {
+ if (object.detachEvent)
+ object.detachEvent("onresize", callback);
+ else
+ object.removeEventListener("mselementresize", callback)
+ }, attachPropertyChangeEvent: function attachPropertyChangeEvent(object, callback) {
+ if (object.attachEvent)
+ object.attachEvent("onpropertychange", callback);
+ else {
+ var callbackWrapper = function callbackWrapper(evt) {
+ var element = null;
+ var propertyName = null;
+ if (evt && evt[0]) {
+ element = evt[0].target;
+ propertyName = evt[0].attributeName
+ }
+ callback({
+ srcElement: element, propertyName: propertyName
+ })
+ };
+ return new MutationObserver(callbackWrapper).observe(object, {
+ attributes: true, attributeFilter: ["aria-selected", "aria-pressed"]
+ })
+ }
+ }, detachPropertyChangeEvent: function detachPropertyChangeEvent(object, callback) {
+ if (object.detachEvent)
+ object.detachEvent("onpropertychange", callback)
+ }, waitForDomEvent: function waitForDomEvent(eventName, element, capture) {
+ return MS.Entertainment.Utilities.waitForDomEventMultipleTimes(eventName, element, 1, capture)
+ }, waitForDomEventMultipleTimes: function waitForDomEventMultipleTimes(eventName, element, numEvents, capture) {
+ if (!element || !element.addEventListener || !eventName)
+ throw new Error("Invalid args: eventName: {0}, element: {1}".format(eventName, element && JSON.stringify(element)));
+ numEvents = numEvents || 1;
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ var onEvent = function onEvent(event) {
+ numEvents--;
+ if (numEvents === 0) {
+ element.removeEventListener(eventName, onEvent, capture);
+ signal.complete(event)
+ }
+ };
+ element.addEventListener(eventName, onEvent, capture);
+ return signal.promise.then(function onComplete(result) {
+ return result
+ }, function onError(err) {
+ element.removeEventListener(eventName, onEvent, capture);
+ return err
+ })
+ }, waitForPropertyValue: function waitForPropertyValue(source, propertyName, propertyValueToWaitFor) {
+ Trace.assert(source, "waitForPropertyValue - no source specified.");
+ Trace.assert(propertyName, "waitForPropertyValue - no propertyName specified.");
+ if (source[propertyName] === propertyValueToWaitFor)
+ return WinJS.Promise.as();
+ var bindings;
+ var bindingMap = {};
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ var onPropertyChanged = function onPropertyChanged(value) {
+ if (value === propertyValueToWaitFor)
+ signal.complete()
+ };
+ var cancelBindings = function cancelBindings() {
+ if (bindings) {
+ bindings.cancel();
+ bindings = null
+ }
+ };
+ bindingMap[propertyName] = onPropertyChanged;
+ bindings = WinJS.Binding.bind(source, bindingMap);
+ return signal.promise.then(cancelBindings, cancelBindings)
+ }, validateIsMemberOrThrow: function validateIsMemberOrThrow(value, object) {
+ var member = "";
+ for (member in object)
+ if (object.hasOwnProperty(member) && value === object[member])
+ return;
+ throw "validateIsMemberOrThrow: Value not found in object.";
+ }, loadHtmlPage: function loadHtmlPage(filePath, targetElement, dataContext) {
+ MS.Entertainment.Utilities.assert(targetElement, "No destination element was passed");
+ var container;
+ var load;
+ return WinJS.UI.Fragments.renderCopy(filePath).then(function placeHtmlPageInDom(fragment) {
+ var loadName;
+ var loadTags;
+ if (typeof targetElement === "string")
+ container = document.getElementById(targetElement);
+ else
+ container = targetElement;
+ MS.Entertainment.Utilities.assert(container, "Page container supplied couldn't be found");
+ MS.Entertainment.Utilities.empty(container);
+ loadTags = fragment.querySelectorAll("[data-ent-fragmentLoad]");
+ if (loadTags && loadTags.length > 0)
+ for (var i = 0, l = loadTags.length; i < l; i++)
+ if (loadTags[i].nodeName !== "BODY") {
+ loadName = loadTags[i].getAttribute("data-ent-fragmentLoad");
+ break
+ }
+ if (loadName) {
+ load = WinJS.Utilities.getMember(loadName);
+ MS.Entertainment.Utilities.assert(load, "Load function was not located: " + loadName)
+ }
+ container.appendChild(fragment)
+ }).then(function waitOnData() {
+ return dataContext
+ }).then(function (data) {
+ dataContext = data;
+ return WinJS.UI.processAll(container)
+ }).then(function () {
+ return WinJS.Binding.processAll(container, dataContext)
+ }).then(function callCallbacks() {
+ if (load)
+ load(container.children[0])
+ })
+ }, documentAlreadyProcessed: false, systemAppListenersAttached: false, processAllOnDocumentLoaded: function processAllOnDocumentLoaded(element, dataContext) {
+ if (MS.Entertainment.Utilities.documentAlreadyProcessed)
+ return WinJS.Promise.timeout();
+ MS.Entertainment.Utilities.documentAlreadyProcessed = true;
+ return WinJS.Utilities.ready().then(function processAllAfterDocumentReady() {
+ return WinJS.UI.processAll(element)
+ }).then(function bindingProcessAllAfterControlProcessAll() {
+ return WinJS.Binding.processAll(element, dataContext)
+ })
+ }, isAboveMemoryCleanupThreshold: function isAboveMemoryCleanupThreshold() {
+ return MS.Entertainment.Utilities.isApp2 && MS.Entertainment.Utilities.isAboveMemoryThreshold(App2.ApplicationModel.MemoryCleanupThreshold)
+ }, isAboveMemoryThreshold: function isAboveMemoryThreshold(thresholdPercentage) {
+ MS.Entertainment.Utilities.assert(thresholdPercentage > 0.0 && thresholdPercentage <= 1.0, "thresholdPercentage must be between 0.0 and 1.0");
+ var isAboveThreshold = false;
+ var resourceLimitsObject = WinJS.Utilities.getMember("App2.ApplicationModel.ApplicationResourceLimits");
+ if (!resourceLimitsObject || thresholdPercentage <= 0.0 || thresholdPercentage > 1.0)
+ return false;
+ try {
+ var currentMemoryUsageInKB = Math.max((resourceLimitsObject.currentMemoryUsage / 1024) | 0, 1);
+ var currentPercentage = (currentMemoryUsageInKB / App2.ApplicationModel.MemoryThresholdInKB);
+ isAboveThreshold = (thresholdPercentage < currentPercentage && !isNaN(currentPercentage))
+ }
+ catch (e) {
+ MS.Entertainment.Utilities.fail("isAboveMemoryThreshold failed: " + e)
+ }
+ return isAboveThreshold
+ }, _backgroundLinkHrefCache: [], enterRestrictedBackground: function enterRestrictedBackground() {
+ var navigatonService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigatonService.clearAllNavigationState();
+ WinJS.Promise.timeout(MS.Entertainment.UI.Framework.autoCleanupTimeout + 100).then(function () {
+ MS.Entertainment.UI.Framework.currentContentContainer = null;
+ var cssLinkElements = WinJS.Utilities.query("link[href$='css']", document.head);
+ MS.Entertainment.Utilities._backgroundLinkHrefCache = cssLinkElements.map(function getLinkHref(element) {
+ element.parentElement.removeChild(element);
+ return element.href
+ });
+ MS.Entertainment.UI.Framework.clearCaches();
+ MS.Entertainment.ServiceLocator.cleanupNonCriticalServices();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isInRestrictedBackground = true
+ })
+ }, leaveRestrictedBackground: function leaveRestrictedBackground() {
+ MS.Entertainment.Utilities._backgroundLinkHrefCache.forEach(function createLink(hrefValue) {
+ var linkElement = document.createElement("link");
+ linkElement.setAttribute("href", hrefValue);
+ linkElement.setAttribute("rel", "stylesheet");
+ linkElement.setAttribute("type", "text/css");
+ document.head.appendChild(linkElement)
+ });
+ MS.Entertainment.Utilities._backgroundLinkHrefCache = [];
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isInRestrictedBackground = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateToDefaultPage()
+ }, multiStateToggleClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function multiStateToggleClassNameHelper(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var maxStates = 5;
+ for (var i = 1; i < maxStates; i++)
+ WinJS.Utilities.removeClass(targetElement, cssClassName + "_" + i);
+ if (sourceValue)
+ WinJS.Utilities.addClass(targetElement, cssClassName + "_" + sourceValue)
+ }), toggleTabIndex: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleTabIndex(sourceValue, targetElement) {
+ if (sourceValue)
+ targetElement.setAttribute("tabIndex", 0);
+ else
+ targetElement.removeAttribute("tabIndex")
+ }), toggleTabIndexNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleTabIndexNegate(sourceValue, targetElement) {
+ if (!sourceValue)
+ targetElement.setAttribute("tabIndex", 0);
+ else
+ targetElement.removeAttribute("tabIndex")
+ }), toggleClassNameOnObservableArrayLength: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLength(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length === 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), toggleClassNameOnObservableArrayLengthNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLengthNegate(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length === 0)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), toggleClassNameOnObservableArrayLengthMoreThanOne: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLengthMoreThanOne(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length > 1)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), toggleClassNameOnObservableArrayLengthMoreThanOneNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLengthMoreThanOneNegate(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length > 1)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), setAttributeValue: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassName(sourceValue, targetElement, attributeName) {
+ if (!attributeName || !targetElement)
+ return;
+ if (Array.isArray(attributeName))
+ attributeName = attributeName[0];
+ switch (attributeName) {
+ case "dataWinAutomationId":
+ attributeName = "data-win-automationId";
+ break;
+ default:
+ break
+ }
+ if (sourceValue)
+ targetElement.setAttribute(attributeName, sourceValue);
+ else if (targetElement.hasAttribute(attributeName))
+ targetElement.removeAttribute(attributeName)
+ }), toggleClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassName(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameNegate(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (!sourceValue)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleShowHideElement: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElement(sourceValue, targetElement, cssClassName) {
+ if (sourceValue)
+ MS.Entertainment.Utilities.showElement(targetElement);
+ else
+ MS.Entertainment.Utilities.hideElement(targetElement)
+ }), toggleShowHideElementNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElementNegate(sourceValue, targetElement, cssClassName) {
+ if (!sourceValue)
+ MS.Entertainment.Utilities.showElement(targetElement);
+ else
+ MS.Entertainment.Utilities.hideElement(targetElement)
+ }), getConfigValueOneTime: WinJS.Utilities.markSupportedForProcessing(function getConfigValueOneTime(source, sourceProperties, dest, destProperties) {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var configurationValue = MS.Entertainment.Utilities.valueFromPropertyPathFragments(configManager, sourceProperties);
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, configurationValue)
+ }), formatDirection: MS.Entertainment.Utilities.weakElementBindingInitializer(function formatDirection(sourceValue, targetElement) {
+ if (sourceValue) {
+ var textDirection = MS.Entertainment.Utilities.detectStringDirection(sourceValue);
+ if (textDirection && textDirection !== MS.Entertainment.Utilities.getTextDirection())
+ switch (textDirection) {
+ case MS.Entertainment.UI.Framework.TextDirections.LeftToRight:
+ WinJS.Utilities.addClass(targetElement, "ui-direction-ltr");
+ break;
+ case MS.Entertainment.UI.Framework.TextDirections.RightToLeft:
+ WinJS.Utilities.addClass(targetElement, "ui-direction-rtl");
+ break
+ }
+ else
+ WinJS.Utilities.removeClass(targetElement, "ui-direction-ltr ui-direction-rtl")
+ }
+ }), toggleClassNameViewStateNotReady: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameViewStateNotReady(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== MS.Entertainment.UI.ViewState.ready)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleShowHideElementViewStateNotReady: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElementViewStateReady(sourceValue, targetElement, cssClassName) {
+ if (sourceValue !== MS.Entertainment.UI.ViewState.ready)
+ MS.Entertainment.Utilities.hideElement(targetElement);
+ else
+ MS.Entertainment.Utilities.showElement(targetElement)
+ }), toggleShowHideElementVIewStateNotComplete: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElementVIewStateNotComplete(sourceValue, targetElement, cssClassName) {
+ if (sourceValue !== MS.Entertainment.UI.ViewState.loading)
+ MS.Entertainment.Utilities.showElement(targetElement);
+ else
+ MS.Entertainment.Utilities.hideElement(targetElement)
+ }), toggleClassNameViewStateNotLoading: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameViewStateNotLoading(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== MS.Entertainment.UI.ViewState.loading)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameViewStateError: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameViewStateError(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue === MS.Entertainment.UI.ViewState.error)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnFeatureDisabledAndNoSubscription: WinJS.Utilities.markSupportedForProcessing(function toggleClassNameOnFeatureDisabledAndNoSubscription(source, sourceProperty, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var featureItem;
+ if (sourceProperty && sourceProperty[0])
+ featureItem = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Utilities.assert(!!featureItem, "Feature enablement feature item not defined. featureItem: " + featureItem + ", sourceProperty: " + sourceProperty + ", targetElement: " + targetElement);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!MS.Entertainment.Utilities.currentOrLastUserSubscriptionEnabled() && featureItem && !featureEnablement.isEnabled(featureItem))
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnFeatureDisabled: WinJS.Utilities.markSupportedForProcessing(function toggleClassNameOnFeatureDisabled(source, sourceProperty, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var featureItem;
+ if (sourceProperty && sourceProperty[0])
+ featureItem = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Utilities.assert(!!featureItem, "Feature enablement feature item not defined. featureItem: " + featureItem + ", sourceProperty: " + sourceProperty + ", targetElement: " + targetElement);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureItem && !featureEnablement.isEnabled(featureItem))
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnEmptyGuid: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnEmptyGuid(smid, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (!smid || smid === MS.Entertainment.Utilities.EMPTY_GUID)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnNonNegativeNumber: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNonNegativeNumber(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue && (typeof (sourceValue) === "number") && sourceValue >= 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnNegativeNumber: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNegativeNumber(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var sourceValueIsNumber = (sourceValue || sourceValue === 0) && (typeof (sourceValue) === "number");
+ if ((sourceValueIsNumber && sourceValue < 0) || !sourceValueIsNumber)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnNonPositiveNumber: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNonPositiveNumber(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue === undefined || sourceValue === null || typeof (sourceValue) !== "number" || sourceValue <= 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnEmptyString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnEmptyString(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== null && sourceValue !== undefined)
+ sourceValue += String.empty;
+ if (sourceValue && sourceValue.length > 0)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ }), toggleClassNameOnEmptyOrBlankString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnEmptyOrBlankString(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== null && sourceValue !== undefined)
+ sourceValue += String.empty;
+ if (sourceValue && sourceValue.trim().length > 0)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ }), toggleClassNameOnNonEmptyString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNonEmptyString(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== null && sourceValue !== undefined)
+ sourceValue += String.empty;
+ if (sourceValue && sourceValue.length > 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleTextContentOrEmptyString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleTextContentOrEmptyString(toggleValue, targetElement, stringID) {
+ if (toggleValue && stringID && stringID[0])
+ targetElement.innerText = String.load(stringID[0]);
+ else
+ targetElement.innerText = String.empty
+ }), appendClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function appendClassName(sourceValue, targetElement, targetProperty) {
+ if (!sourceValue)
+ return;
+ var sourceValueArray = sourceValue.split(" ");
+ for (var i = 0; i < sourceValueArray.length; i++)
+ if (sourceValueArray[i] && !WinJS.Utilities.hasClass(targetElement, sourceValueArray[i]))
+ WinJS.Utilities.addClass(targetElement, sourceValueArray[i])
+ }), removeClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function removeClassName(sourceValue, targetElement, targetProperty) {
+ if (sourceValue && WinJS.Utilities.hasClass(targetElement, sourceValue))
+ WinJS.Utilities.removeClass(targetElement, sourceValue)
+ }), limitClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function limitClassName(sourceValue, targetElement, targetProperty) {
+ if (!sourceValue || !targetElement)
+ return;
+ for (var i = 0; i < targetElement.classList.length;) {
+ var className = targetElement.classList[i];
+ if (className && className.indexOf(targetProperty) === 0)
+ WinJS.Utilities.removeClass(targetElement, className);
+ else
+ i++
+ }
+ var sourceValueArray = sourceValue.split(" ");
+ for (var i = 0; i < sourceValueArray.length; i++) {
+ var className = sourceValueArray[i];
+ if (className && !WinJS.Utilities.hasClass(targetElement, className))
+ WinJS.Utilities.addClass(targetElement, className)
+ }
+ }), toggleMediaTypeClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleMediaTypeClassName(sourceValue, targetElement, cssClassName) {
+ if (!targetElement)
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var i;
+ var cssPrefix = cssClassName.toLowerCase() + "-";
+ var classList = targetElement.classList || [];
+ var mediaClasses = [];
+ for (i = 0; i < classList.length; ++i) {
+ var className = classList[i];
+ if (className.indexOf(cssPrefix) === 0)
+ mediaClasses.push(className)
+ }
+ for (i = 0; i < mediaClasses.length; ++i)
+ WinJS.Utilities.removeClass(targetElement, mediaClasses[i]);
+ if (sourceValue && sourceValue.mediaType) {
+ var mediaTypeString = MS.Entertainment.Data.Factory.Marketplace.edsMediaTypeFromDatabaseType(sourceValue.mediaType);
+ if (mediaTypeString)
+ WinJS.Utilities.addClass(targetElement, (cssPrefix + mediaTypeString).toLowerCase())
+ }
+ }), appendMediaTypeClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function appendMediaTypeClassName(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue && sourceValue.mediaType) {
+ var mediaTypeString = MS.Entertainment.Data.Factory.Marketplace.edsMediaTypeFromDatabaseType(sourceValue.mediaType);
+ if (mediaTypeString)
+ WinJS.Utilities.addClass(targetElement, (cssClassName + "-" + mediaTypeString).toLowerCase())
+ }
+ }), toggleBoolean: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function toggleBoolean(sourceValue) {
+ return !sourceValue
+ })), toggleHideOnElement: WinJS.Utilities.markSupportedForProcessing(function toggleHideOnElement(element, switchToHidden) {
+ if (switchToHidden)
+ WinJS.Utilities.addClass(element, "removeFromDisplay");
+ else
+ WinJS.Utilities.removeClass(element, "removeFromDisplay")
+ }), useShowHideAnimationsOnValueChange: MS.Entertainment.Utilities.weakElementBindingInitializer(function useShowHideAnimationsOnValueChange(sourceValue, targetElement, elementProperty) {
+ if (sourceValue === targetElement[elementProperty])
+ return;
+ var hidePromise = null;
+ if (!WinJS.Utilities.hasClass(targetElement, "hideFromDisplay"))
+ hidePromise = MS.Entertainment.Utilities.hideElement(targetElement);
+ else
+ hidePromise = WinJS.Promise.wrap();
+ hidePromise.then(function elementHidden() {
+ targetElement[elementProperty] = sourceValue;
+ MS.Entertainment.Utilities.showElement(targetElement)
+ })
+ }), forceShowAnimationOnLoad: MS.Entertainment.Utilities.weakElementBindingInitializer(function forceShowAnimationOnLoad(sourceValue, targetElement, elementProperty) {
+ if (sourceValue && !(Array.isArray(sourceValue) && sourceValue.length === 0))
+ MS.Entertainment.Utilities.showElement(targetElement)
+ }), toggleClassOnElement: WinJS.Utilities.markSupportedForProcessing(function toggleHideOnElement(element, switchOn, className) {
+ if (Array.isArray(className))
+ className = className[0];
+ if (switchOn)
+ WinJS.Utilities.addClass(element, className);
+ else
+ WinJS.Utilities.removeClass(element, className)
+ }), toggleVoiceTarget: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassName(sourceValue, targetElement) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (sourceValue)
+ WinJS.Utilities.addClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle);
+ else
+ WinJS.Utilities.removeClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle)
+ }), toggleVoiceTargetNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameNegate(sourceValue, targetElement) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (!sourceValue)
+ WinJS.Utilities.addClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle);
+ else
+ WinJS.Utilities.removeClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle)
+ }), createActionFromBind: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function createActionFromBind(value) {
+ var action = value;
+ if (String.isString(action))
+ action = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(value);
+ return action
+ })), bindAndMarkSupportedForProcessing: function (fn, thisPointer) {
+ var boundFunction = fn.bind(thisPointer);
+ return WinJS.Utilities.markSupportedForProcessing(boundFunction)
+ }, findParentElementByClassName: function findParentElementByClassName(childElement, className) {
+ var parent = childElement.parentElement;
+ while (parent) {
+ if (WinJS.Utilities.hasClass(parent, className))
+ return parent;
+ parent = parent.parentElement
+ }
+ }, isNumeric: function Utilities_isNumeric(sourceString) {
+ if (sourceString === null || sourceString === undefined || typeof sourceString === "object")
+ return false;
+ var validChars = "0123456789.";
+ for (var i = sourceString.length - 1; i >= 0; i--)
+ if (validChars.indexOf(sourceString.charAt(i)) === -1)
+ return false;
+ return true
+ }, simpleEscapeHTML: function simpleEscapeHtml(text) {
+ if (text.indexOf("<") !== -1)
+ text = text.replace(/") !== -1)
+ text = text.replace(/>/g, ">");
+ return text
+ }, escapeHTML: (function escapeHTML(text) {
+ var element = null;
+ return function escapeHTML(text) {
+ if (!element)
+ element = document.createElement("div");
+ element.textContent = text;
+ return element.innerHTML
+ }
+ })(), unEscapeHTML: (function unEscapeHTML(html) {
+ var element = null;
+ return function unEscapeHTML(html) {
+ if (!element)
+ element = document.createElement("div");
+ element.innerHTML = html;
+ return element.textContent
+ }
+ })(), getChildControl: function Utilities_getChildControl(dom, name) {
+ var element;
+ try {
+ element = dom.querySelector("[data-ent-id='" + name + "']");
+ if (element && (element.winControl !== null && element.winControl !== undefined))
+ element = element.winControl
+ }
+ catch (error) {
+ MS.Entertainment.fail("Exception in getChildControl. error: " + error + " name: " + name);
+ element = null
+ }
+ return element
+ }, _millisecondsToDate: function millisecondsToDate(milliseconds) {
+ var seconds = Math.floor(milliseconds / 1000);
+ milliseconds = milliseconds % 1000;
+ var minutes = Math.floor(seconds / 60);
+ seconds = seconds % 60;
+ var hours = Math.floor(minutes / 60);
+ minutes = minutes % 60;
+ return new Date(null, null, null, hours, minutes, seconds, milliseconds)
+ }, millisecondsToTimeCode: function millisecondsToTimeCode(duration) {
+ var durationType = typeof duration;
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.dateTimeFormatters))
+ return String.empty;
+ else if (durationType === "number")
+ if (duration < 0)
+ return String.empty;
+ else
+ duration = MS.Entertainment.Utilities._millisecondsToDate(duration);
+ else if (durationType === "string")
+ duration = MS.Entertainment.Utilities._millisecondsToDate(parseInt(duration));
+ else if (!duration)
+ return String.empty;
+ var formatter;
+ var hoursString;
+ var minutesString;
+ var secondsString;
+ var hours = duration.getHours();
+ var minutes = duration.getMinutes();
+ var seconds = duration.getSeconds();
+ if (isNaN(hours))
+ hours = 0;
+ if (isNaN(minutes))
+ minutes = 0;
+ if (isNaN(seconds))
+ seconds = 0;
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var timeString;
+ if (hours > 0) {
+ hoursString = formatter.format(hours);
+ formatter.integerDigits = 2;
+ minutesString = formatter.format(minutes);
+ secondsString = formatter.format(seconds);
+ timeString = String.load(String.id.IDS_HHMMSS_DURATION).format(hoursString, minutesString, secondsString)
+ }
+ else {
+ minutesString = formatter.format(minutes);
+ formatter.integerDigits = 2;
+ secondsString = formatter.format(seconds);
+ timeString = String.load(String.id.IDS_MMSS_DURATION).format(minutesString, secondsString)
+ }
+ formatter.integerDigits = MS.Entertainment.Formatters.DateTimeFormatters.defaultDecimalDigits;
+ return timeString
+ }, formatTimeString: function formatTimeString(duration, options) {
+ if (typeof duration === "number" && duration < 0)
+ return String.empty;
+ var formatter;
+ var hoursString;
+ var minutesString;
+ var secondsString;
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var timeString = String.empty;
+ var hours = 0;
+ var minutes = 0;
+ var seconds = 0;
+ options = options || {};
+ var excludeSeconds = options.excludeSeconds || false;
+ if (typeof duration === "number") {
+ hours = Math.floor(duration / (1000 * 60 * 60));
+ duration = duration - (hours * 1000 * 60 * 60);
+ minutes = Math.floor(duration / (1000 * 60));
+ duration = duration - (minutes * 1000 * 60);
+ seconds = Math.floor(duration / 1000)
+ }
+ else if (duration) {
+ hours = duration.getHours();
+ minutes = duration.getMinutes();
+ seconds = duration.getSeconds()
+ }
+ if (hours > 0) {
+ hoursString = formatter.format(hours);
+ minutesString = formatter.format(minutes);
+ timeString = String.load(String.id.IDS_DETAILS_DURATION_HOURS_FORMAT).format(hoursString, minutesString)
+ }
+ else {
+ minutesString = formatter.format(minutes);
+ secondsString = formatter.format(seconds);
+ if (!excludeSeconds)
+ timeString = String.load(String.id.IDS_DETAILS_DURATION_MINSEC_FORMAT).format(minutesString, secondsString);
+ else
+ timeString = String.load(String.id.IDS_DETAILS_DURATION_MINS_FORMAT).format(minutesString)
+ }
+ return timeString
+ }, getTotalMinutesFromDate: function getTotalMinutesFromDate(date) {
+ var minutes = 0;
+ if (date)
+ minutes = date.getHours() * 60 + date.getMinutes();
+ return minutes
+ }, millisecondsFromTimeSpan: function millisecondsFromTimeSpan(timeSpan) {
+ var milliSeconds = 0;
+ if (timeSpan && timeSpan instanceof Date) {
+ var zero = new Date(0, 0, 0, 0, 0, 0, 0);
+ milliSeconds = timeSpan.getTime() - zero.getTime()
+ }
+ return milliSeconds
+ }, secondsFromTimeSpan: function secondsFromTimeSpan(timeSpan) {
+ var seconds = MS.Entertainment.Utilities.millisecondsFromTimeSpan(timeSpan) / 1000;
+ return seconds
+ }, removeFileExtension: function removeFileExtension(fileName) {
+ if (!fileName)
+ return String.empty;
+ return fileName.replace(/\.[^\.\s]+$/, String.empty)
+ }, ensureDurationIsNumber: function ensureDurationIsNumber(duration) {
+ var ms = 0;
+ if (typeof duration === "number")
+ ms = duration;
+ else if (duration.getHours) {
+ ms += duration.getHours() * 60 * 60 * 1000;
+ ms += duration.getMinutes() * 60 * 1000;
+ ms += duration.getSeconds() * 1000;
+ ms += duration.getMilliseconds()
+ }
+ else
+ MS.Entertainment.Utilities.fail("Expected number or date");
+ return ms
+ }, isBlobUrl: function isBlobUrl(url) {
+ var blobUrlRegex = /^blob:/i;
+ return blobUrlRegex.test(url)
+ }, handleSearchInput: function handleSearchInput(input) {
+ if (!input)
+ return null;
+ var result = String.empty;
+ var trimmed = input.trim();
+ if (trimmed)
+ for (var i = 0; i < trimmed.length; i++) {
+ var ch = trimmed[i];
+ switch (ch) {
+ case "%":
+ case ";":
+ case "(":
+ case ")":
+ case "{":
+ case "}":
+ case "!":
+ case "\r":
+ case "\t":
+ case "\n":
+ case ">":
+ case "<":
+ case "+":
+ case "&":
+ case "-":
+ result = result + " ";
+ break;
+ default:
+ result = result + ch;
+ break
+ }
+ }
+ return result.trim()
+ }, processServiceLinks: function processServiceLinks(text, linkMappings) {
+ var ignoreTags = ["
", "", "", "", "", "", "", ""];
+ var isIgnorableTag = function isIgnoreableTag(tagStart, isClosingTag) {
+ var ignore = false;
+ for (var i = 0; i < ignoreTags.length; i++)
+ if (tagStart.lastIndexOf(ignoreTags[i], 0) === 0) {
+ ignore = true;
+ break
+ }
+ return ignore
+ };
+ var skipLinkClose = false;
+ return MS.Entertainment.Utilities.processServiceTextBlob(text, function handleTag(tagStart) {
+ tagStart = tagStart || String.empty;
+ if (isIgnorableTag(tagStart))
+ return String.empty;
+ var result = String.empty;
+ var match = /^\
/.exec(tagStart);
+ if (match) {
+ if (match[1] && match[2]) {
+ var stringFormat = linkMappings[match[1]];
+ if (stringFormat)
+ result = stringFormat.format(match[2])
+ }
+ skipLinkClose = (result === String.empty)
+ }
+ else if (tagStart.indexOf("") === 0 && !skipLinkClose)
+ result = linkMappings["$close"];
+ return result
+ })
+ }, processServiceTextBlob: function processServiceTextBlob(textBlob, tagCallback) {
+ var buff = "";
+ var lastCh = "";
+ if (textBlob) {
+ var inTag = false;
+ for (var i = 0; i < textBlob.length; i++) {
+ var ch = textBlob[i];
+ if (ch === "<")
+ inTag = true;
+ if (!inTag)
+ if (ch === "\n") {
+ if (lastCh !== "\n")
+ buff = buff + "
"
+ }
+ else if (ch === ">")
+ buff = buff + ">";
+ else
+ buff = buff + ch;
+ else if (ch === "<" && tagCallback)
+ buff = buff + tagCallback(textBlob.substr(i));
+ if (ch === ">")
+ inTag = false;
+ lastCh = ch
+ }
+ }
+ return buff
+ }, getMediaTypeName: function getMediaTypeName(mediaType, videoType, gameType, downloadTypeText) {
+ var name;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ name = String.load(String.id.IDS_MEDIATYPE_TVEPISODE);
+ else
+ name = String.load(String.id.IDS_MEDIATYPE_MOVIE);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ name = String.load(String.id.IDS_MEDIATYPE_TVSERIES);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ name = String.load(String.id.IDS_MEDIATYPE_TVSEASON);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ name = String.load(String.id.IDS_MEDIATYPE_ARTIST);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ name = String.load(String.id.IDS_MEDIATYPE_ALBUM);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ name = String.load(String.id.IDS_MEDIATYPE_SONG);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ name = String.load(String.id.IDS_MEDIATYPE_PLAYLIST);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ if (gameType === MS.Entertainment.Data.Augmenter.GamePlatform.Modern)
+ name = String.load(String.id.IDS_MEDIATYPE_GAME_WINDOWS);
+ else {
+ name = downloadTypeText;
+ if (!name)
+ name = String.load(String.id.IDS_MEDIATYPE_GAME)
+ }
+ break;
+ default:
+ name = String.load(String.id.IDS_UNKNOWN_VALUE);
+ break
+ }
+ return name
+ }, getMediaTypeNameFromMedia: function getMediaTypeNameFromMedia(media) {
+ return MS.Entertainment.Utilities.getMediaTypeName(media.mediaType, media.videoType, media.defaultPlatformType, media.downloadTypeText)
+ }, isEDSAuthRequired: function isEDSAuthRequired() {
+ var isAuthRequired = false;
+ var edsUri = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_EDSSearch);
+ isAuthRequired = edsUri.toLowerCase().substr(0, 8) === "https://";
+ return isAuthRequired
+ }, isTouchDevicePresent: function isTouchDevicePresent() {
+ var touchCapabilities = new Windows.Devices.Input.TouchCapabilities;
+ return touchCapabilities && touchCapabilities.touchPresent
+ }, EMPTY_GUID: "00000000-0000-0000-0000-000000000000", isEmptyGuid: function isEmptyGuid(guid) {
+ return !guid || guid === MS.Entertainment.Utilities.EMPTY_GUID
+ }, isValidGuid: function isValidGuid(guid) {
+ return guid && typeof guid === "string" && guid.match(/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/)
+ }, trimGuid: function trimGuid(guid) {
+ var trimmed = guid.replace('{', '');
+ trimmed = trimmed.replace('}', '');
+ return trimmed
+ }, isSameGuid: function isSameGuid(guid1, guid2) {
+ if (!MS.Entertainment.Utilities.isValidGuid(guid1) || !MS.Entertainment.Utilities.isValidGuid(guid2))
+ return false;
+ return MS.Entertainment.Utilities.trimGuid(guid1).trim().toLowerCase() === MS.Entertainment.Utilities.trimGuid(guid2).trim().toLowerCase()
+ }, isValidServiceId: function isValidServiceId(guid) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(guid) && MS.Entertainment.Utilities.isValidGuid(guid)
+ }, isValidLibraryId: function isValidLibraryId(id) {
+ return id > 0
+ }, isValidWatchlistId: function isValidWatchlistId(id) {
+ return isFinite(id) && id >= 0
+ }, invalidateLibraryId: -1, _executeQueryAndGetMediaItemAsync: function _executeQueryAndGetMediaItemAsync(query) {
+ var media;
+ return query.getItems().then(function queryGetItems_success(virtualList) {
+ if (virtualList.count !== 1)
+ return WinJS.Promise.wrap();
+ return virtualList.itemsFromIndex(0, 0, 0)
+ }).then(function itemsFromIndex_complete(args) {
+ if (args) {
+ media = args.items[0].data;
+ MS.Entertainment.ViewModels.MediaItemModel.augment(media);
+ if (media.hydrate)
+ return media.hydrate()
+ }
+ return WinJS.Promise.wrap()
+ }).then(function hydrate_complete() {
+ return WinJS.Promise.wrap(media)
+ }, function _executeQueryAndGetMediaItemAsync_error() {
+ return WinJS.Promise.wrap()
+ })
+ }, createMediaItemByLibraryInfo: function createMediaItemByLibraryInfo(libraryId, mediaType) {
+ var query;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ return MS.Entertainment.UI.Actions.Playlists.queryPlaylistById(libraryId);
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ var query = new MS.Entertainment.Data.Query.libraryTracks;
+ query.trackId = libraryId;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ var query = new MS.Entertainment.Data.Query.libraryAlbums;
+ query.albumId = libraryId;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.album);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ var query = new MS.Entertainment.Data.Query.libraryArtists;
+ query.personId = libraryId;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ var query = new MS.Entertainment.Data.Query.libraryVideos;
+ query.objectIds = [libraryId];
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ var query = new MS.Entertainment.Data.Query.libraryTVSeasons;
+ query.tvSeasonId = libraryId;
+ break;
+ default:
+ return WinJS.Promise.wrap()
+ }
+ return MS.Entertainment.Utilities._executeQueryAndGetMediaItemAsync(query)
+ }, convertToHexString: function convertToHexString(value) {
+ if (!value)
+ value = 0;
+ else if (value < 0)
+ value += 0xFFFFFFFF + 1;
+ return "0x" + value.toString(16)
+ }, getSpotlightItemAugmentation: function getSpotlightItemAugmentation(spotlightType) {
+ var augmentation = null;
+ switch (spotlightType) {
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Movie:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightMovie;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Artist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.SpotlightArtist;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.SpotlightAlbum;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Playlist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.SpotlightPlaylist;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Series:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightTVSeries;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Season:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightTVSeason;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Episode:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightTVEpisode;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.None:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Web:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.WebBlend:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.ZuneFlexHub:
+ augmentation = MS.Entertainment.Data.Augmenter.Spotlight.SpotlightItem;
+ break;
+ default:
+ var shipAssertProvider = new Microsoft.Entertainment.Infrastructure.ShipAssertProvider;
+ shipAssertProvider.shipAssert("MS.Entertainment.UI.Controls", "getSpotlightItemAugmentation()", MS.Entertainment.UI.Debug.getStackTrace(), "Message: " + "Unsupported spotlight media type. Could not find augmentation for type: " + spotlightType, "");
+ break
+ }
+ { };
+ return augmentation
+ }, getEditorialItemAugmentation: function getEditorialItemAugmentation(editorialType) {
+ var augmentation = null;
+ switch (editorialType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialMovie;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ augmentation = MS.Entertainment.Utilities.isMusicApp2 ? MS.Entertainment.Data.Augmenter.Marketplace.EditorialMusicHub : MS.Entertainment.Data.Augmenter.Marketplace.EditorialHub;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialTVSeries;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialTVSeason;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialEpisode;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialAlbum;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Artist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialArtist;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Track:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialTrack;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MusicVideo:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialMusicVideo;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Playlist:
+ break;
+ default:
+ MS.Entertainment.UI.Controls.fail("Unsupported editorial media type. Could not find augmentation for type: " + editorialType);
+ break
+ }
+ { };
+ return augmentation
+ }, getPinnedItemAugmentation: function getPinnedItemAugmentation(pinnedType) {
+ var augmentation = null;
+ switch (pinnedType) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicPlaylist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedPlaylist;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedAlbum;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.musicArtist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedArtist;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.movie:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedMovie;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeason:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedTvSeason;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeries:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedTvSeries;
+ break;
+ default:
+ break
+ }
+ { };
+ return augmentation
+ }, getRecentItemAugmentation: function getRecentItemAugmentation(recentType, acquisitionContext) {
+ var augmentation = null;
+ switch (recentType) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicPlaylist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentPlaylist;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentAlbum;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.musicArtist:
+ switch (acquisitionContext) {
+ case MS.Entertainment.Utilities.AcquisitionContext.SmartDJ:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentSmartDJ;
+ break;
+ default:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentArtist;
+ break
+ }
+ break;
+ default:
+ break
+ }
+ { };
+ return augmentation
+ }, isSupportedVideoEditorialType: function isSupportedVideoEditorialType(item, editorialType) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var showMovieTrailers = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoShowMovieTrailers);
+ var featuredSetsEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoFeaturedSetsEnabled);
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var showEditorialEpisodes = config.video.supportsEditorialTVEpisodes;
+ switch (editorialType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer:
+ return showMovieTrailers;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ return showEditorialEpisodes;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ return MS.Entertainment.Utilities.isValidServiceId(item.seriesId);
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ return featuredSetsEnabled;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ return true;
+ default:
+ break
+ }
+ return false
+ }, convertEditorialItem: function convertEditorialItem(mediaItem) {
+ var newMediaItem = mediaItem;
+ var augmenter;
+ if (mediaItem && !mediaItem.mediaType)
+ augmenter = MS.Entertainment.Utilities.getEditorialItemAugmentation(mediaItem && mediaItem.type);
+ if (augmenter) {
+ var oldItem = WinJS.Binding.unwrap(mediaItem);
+ newMediaItem = MS.Entertainment.Data.augment(MS.Entertainment.Data.deflate(oldItem), augmenter);
+ if (oldItem.contentNotifications)
+ newMediaItem.contentNotifications = oldItem.contentNotifications
+ }
+ return newMediaItem
+ }, uninitializeChildControls: function disposeChildControls(dom) {
+ var element = dom.querySelector("[data-win-control], .ent-control");
+ var controls = dom.querySelectorAll("[data-win-control], .ent-control");
+ if (controls && controls.length > 0)
+ for (var i = 0, l = controls.length; i < l; i++)
+ if (controls[i] && controls[i].winControl && controls[i].winControl.uninitialize)
+ controls[i].winControl.uninitialize()
+ }, runVoiceControlMixins: function runVoiceMixins(classConstructor) {
+ Trace.assert(classConstructor, "runVoiceControlMixins: classConstructor not defined");
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.App2.VoicePropertyMixin"))
+ WinJS.Class.mix(classConstructor, MS.Entertainment.UI.App2.VoiceControlMixin);
+ else
+ Trace.assert(!WinJS.UI.AutomaticFocus, "MS.Entertainment.UI.App2.VoicePropertyMixin not defined. Make sure VoiceControl.js is loaded before the class constructor's file.")
+ }, runVoicePropertyMixins: function runVoiceMixins(classConstructor) {
+ Trace.assert(classConstructor, "runVoicePropertyMixins: classConstructor not defined");
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.App2.VoicePropertyMixin"))
+ WinJS.Class.mix(classConstructor, MS.Entertainment.UI.App2.VoicePropertyMixin);
+ else
+ Trace.assert(!WinJS.UI.AutomaticFocus, "MS.Entertainment.UI.App2.VoicePropertyMixin not defined. Make sure VoiceControl.js is loaded before the class constructor's file.")
+ }, searchArray: function searchArray(array, predicate) {
+ var index = 0;
+ var candidate = null;
+ for (index = 0; index < array.length; index++) {
+ candidate = array[index];
+ if (predicate(candidate))
+ return candidate
+ }
+ return null
+ }, getPropertyPathFragments: function getPropertyPathFragments(propertyPath) {
+ var propertyPathFragments = (propertyPath) ? propertyPath.split(/(?:\]\.)|\.|\[|\]/) : [];
+ if (propertyPathFragments[propertyPathFragments.length - 1] === String.empty)
+ propertyPathFragments.pop();
+ if (propertyPathFragments[0] === String.empty)
+ propertyPathFragments.splice(0, 1);
+ return propertyPathFragments
+ }, valueFromPropertyPath: function valueFromPropertyPath(data, propertyPath) {
+ return MS.Entertainment.Utilities.valueFromPropertyPathFragments(data, MS.Entertainment.Utilities.getPropertyPathFragments(propertyPath))
+ }, valuesFromPropertyPath: function valuesFromPropertyPath(item, propertyPath) {
+ var result = [];
+ if (item && propertyPath)
+ if (Array.isArray(item) && item.length > 0)
+ result = item.map(function (element) {
+ return MS.Entertainment.Utilities.valuesFromPropertyPath(element, propertyPath)
+ }.bind(this)).reduce(function (a, b) {
+ if (Array.isArray(a))
+ return a.concat(b);
+ else
+ return [a, b]
+ });
+ else {
+ var pathSeperatorIndex = propertyPath.indexOf(".");
+ if (pathSeperatorIndex === -1) {
+ if (propertyPath in item)
+ result = item[propertyPath]
+ }
+ else {
+ var pathSegment = propertyPath.substr(0, pathSeperatorIndex);
+ if (pathSegment) {
+ propertyPath = propertyPath.substr(pathSeperatorIndex + 1);
+ if (pathSegment in item) {
+ var property = item[pathSegment];
+ result = MS.Entertainment.Utilities.valuesFromPropertyPath(property, propertyPath)
+ }
+ }
+ }
+ }
+ return result
+ }, valueFromPropertyPathFragments: function valueFromPropertyPathFragments(data, propertyPath, max) {
+ var max = isNaN(max) ? propertyPath.length : max;
+ for (var i = 0; i < max && data; i++)
+ try {
+ data = data[propertyPath[i]]
+ }
+ catch (e) {
+ MS.Entertainment.fail("Exception in valueFromPropertyPathFragments: " + e.toString() + " Property: " + propertyPath.toString())
+ }
+ return data
+ }, hasPropertyPath: function hasProperty(data, propertyPath) {
+ return MS.Entertainment.Utilities.hasPropertyPathFragments(data, MS.Entertainment.Utilities.getPropertyPathFragments(propertyPath))
+ }, hasPropertyPathFragments: function hasPropertyPathFragments(data, propertyPath) {
+ var len = propertyPath.length - 1;
+ for (var i = 0; i < len && data; i++)
+ data = data[propertyPath[i]];
+ return data && (len < 0 || (typeof data === "object" && propertyPath[len] in data))
+ }, setFromPropertyPath: function setFromPropertyPath(data, propertyPath, value) {
+ return MS.Entertainment.Utilities.setFromPropertyPathFragments(data, MS.Entertainment.Utilities.getPropertyPathFragments(propertyPath), value)
+ }, setFromPropertyPathFragments: function setFromPropertyPathFragments(data, propertyPath, value) {
+ for (var i = 0, len = propertyPath.length - 1; i < len && data; i++) {
+ if (!(propertyPath[i] in data))
+ data[propertyPath[i]] = {};
+ data = data[propertyPath[i]]
+ }
+ data[propertyPath[len]] = value;
+ return data
+ }, random: function random(min, max) {
+ return Math.floor(Math.random() * (max - min + 1)) + min
+ }, getRelativeOffset: function getRelativeOffset(element, parent) {
+ MS.Entertainment.Utilities.assert(element, "No element provided");
+ MS.Entertainment.Utilities.assert(parent, "No parent provided");
+ if (!element || !parent)
+ return {
+ top: 0, left: 0
+ };
+ var left = 0;
+ var top = 0;
+ var e = element;
+ while (e && parent && (e.offsetParent !== parent.offsetParent)) {
+ left += e.offsetLeft;
+ top += e.offsetTop;
+ e = e.offsetParent;
+ if (!e)
+ return {
+ left: left, top: top
+ }
+ }
+ left += (e.offsetLeft - parent.offsetLeft);
+ top += (e.offsetTop - parent.offsetTop);
+ return {
+ left: left, top: top
+ }
+ }, onRootPage: function onRootPage() {
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ return currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.root
+ }, isElementInViewportOfParent: function isElementInViewportOfParent(item, parent) {
+ return MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(item, parent) && MS.Entertainment.Utilities.isElementInVerticalViewportOfParent(item, parent)
+ }, isElementInHorizontalViewportOfParent: function isElementInHorizontalViewportOfParent(item, parent, adjustmentFactor) {
+ adjustmentFactor = adjustmentFactor || 0;
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(item, parent);
+ if (relativePosition && item) {
+ var leftEdge = (relativePosition.left - adjustmentFactor) >= parent.scrollLeft;
+ var rightEdge = Math.min(parent.scrollWidth, relativePosition.left + item.offsetWidth + adjustmentFactor) <= (parent.offsetWidth + parent.scrollLeft);
+ return leftEdge && rightEdge
+ }
+ else
+ return false
+ }, isElementInVerticalViewportOfParent: function isElementInVerticalViewportOfParent(item, parent) {
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(item, parent);
+ if (relativePosition) {
+ var topEdge = relativePosition.top >= (parent.scrollTop);
+ var bottomEdge = (relativePosition.top + item.offsetHeight) <= (parent.offsetHeight + parent.scrollTop);
+ return topEdge && bottomEdge
+ }
+ else
+ return false
+ }, getEdgeWithinViewport: function getEdgeWithinViewport(desiredEdgePosition, size, viewportSize) {
+ var edgePosition = Math.min(desiredEdgePosition, viewportSize - size);
+ return Math.max(edgePosition, 0)
+ }, parseVersionString: function parseVersionString(inputString) {
+ MS.Entertainment.Utilities.assert(inputString, "Empty input string");
+ var versionArray = inputString.split(".");
+ MS.Entertainment.Utilities.assert(versionArray.length === 4, "Version string should have four parts");
+ return {
+ major: parseInt(versionArray[0]), minor: parseInt(versionArray[1]), build: parseInt(versionArray[2]), revision: parseInt(versionArray[3])
+ }
+ }, compareVersions: function compareVersions(ver1, ver2) {
+ var properties = ["major", "minor", "build", "revision"];
+ MS.Entertainment.Utilities.assert((ver1.major >= 0) && (ver1.minor >= 0) && (ver1.build >= 0) && (ver1.revision >= 0), " Input version1 is invalid");
+ MS.Entertainment.Utilities.assert((ver2.major >= 0) && (ver2.minor >= 0) && (ver2.build >= 0) && (ver2.revision >= 0), " Input version2 is invalid");
+ for (var i = 0; i < properties.length; i++)
+ if (ver1[properties[i]] < ver2[properties[i]])
+ return -1;
+ else if (ver1[properties[i]] > ver2[properties[i]])
+ return 1;
+ return 0
+ }, getClientVersionString: function getClientVersionString() {
+ var ver = Windows.ApplicationModel.Package.current.id.version;
+ return [ver.major, ver.minor, ver.build, ver.revision].join(".")
+ }, getVersionString: function getVersionString() {
+ return WinJS.xhr({ url: "version.json" }).then(function (data) {
+ var versionInformation = JSON.parse(data.responseText);
+ return versionInformation.version
+ })
+ }, navigateToUrl: function navigateToUrl(url, automationId) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var externalNavigationAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = url;
+ externalNavigationAction.automationId = automationId;
+ externalNavigationAction.execute()
+ }, launchStoreUpdatePage: function launchStoreUpdatePage() {
+ var launchInfo = "ms-windows-store:Updates";
+ var appAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ appAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppStoreUpgrade;
+ appAction.parameter = {
+ uri: launchInfo, appendSource: true, appendGamerTag: false
+ };
+ appAction.execute()
+ }, doesElementSupportKeyboardInput: function doesElementSupportKeyboardInput(element) {
+ var result = false;
+ if (!element)
+ return result;
+ if (element.tagName === "TEXTAREA" || element.tagName === "SELECT")
+ result = true;
+ else if (element.tagName === "INPUT")
+ switch (element.getAttribute("type")) {
+ case "text":
+ case "password":
+ case "number":
+ case "email":
+ case "tel":
+ case "url":
+ case "search":
+ result = true;
+ break
+ }
+ return result
+ }, suppressSubtreeKeyboardFocus: function suppressSubtreeKeyboardFocus(element) {
+ var suppressed = [];
+ if (element) {
+ var elements = element.querySelectorAll("*[tabindex]");
+ if (elements)
+ for (var i = 0; i < elements.length; i++) {
+ var element = elements[i];
+ var tabIndex = element.getAttribute("tabindex");
+ if (tabIndex && tabIndex !== -1) {
+ suppressed.push({
+ element: element, tabIndex: tabIndex
+ });
+ element.setAttribute("tabindex", -1)
+ }
+ }
+ }
+ return suppressed
+ }, restoreSubtreeKeyboardFocus: function restoreSubtreeKeyboardFocus(suppressedList) {
+ if (suppressedList)
+ for (var i = 0; i < suppressedList.length; i++) {
+ var suppressedItem = suppressedList[i];
+ suppressedItem.element.setAttribute("tabindex", suppressedItem.tabIndex)
+ }
+ }, isHighResolution: function isHighResolution() {
+ var screenHeight = MS.Entertainment.Utilities.getWindowHeight();
+ var isHighResolution = MS.Entertainment.Utilities.isVideoApp ? (screenHeight >= MS.Entertainment.Utilities.VIEW1_VIDEO_VERTICAL_HEIGHT_LIMIT) : (screenHeight >= MS.Entertainment.Utilities.VIEW1_VERTICAL_HEIGHT_LIMIT);
+ return isHighResolution
+ }, getRowCountForResolution: function getRowCountForResolution() {
+ var screenHeight = MS.Entertainment.Utilities.getWindowHeight();
+ var standardResolutionRows = MS.Entertainment.Utilities.isVideoApp ? MS.Entertainment.Utilities.STANDARD_RESOLUTION_VIDEO_ROWS : MS.Entertainment.Utilities.STANDARD_RESOLUTION_ROWS;
+ var highResolutionRows = MS.Entertainment.Utilities.isVideoApp ? MS.Entertainment.Utilities.HIGH_RESOLUTION_VIDEO_ROWS : MS.Entertainment.Utilities.HIGH_RESOLUTION_ROWS;
+ var highResolutionHeight = MS.Entertainment.Utilities.isVideoApp ? MS.Entertainment.Utilities.VIEW1_VIDEO_VERTICAL_HEIGHT_LIMIT : MS.Entertainment.Utilities.VIEW1_VERTICAL_HEIGHT_LIMIT;
+ var rowCount = standardResolutionRows;
+ if (screenHeight >= highResolutionHeight)
+ rowCount = highResolutionRows;
+ return rowCount
+ }, getLandscapeScreenSize: function getLandscapeScreenSize() {
+ var size = {
+ width: 0, height: 0
+ };
+ if (window.screen)
+ if (window.screen.msOrientation === "portrait-primary" || window.screen.msOrientation === "portrait-secondary") {
+ size.width = window.screen.height;
+ size.height = window.screen.width
+ }
+ else {
+ size.width = window.screen.width;
+ size.height = window.screen.height
+ }
+ return size
+ }, getWindowHeight: function getWindowHeight() {
+ var heightProperty = "outerHeight";
+ if (!document.attachEvent)
+ heightProperty = "innerHeight";
+ return window[heightProperty]
+ }, getWindowWidth: function getWindowWidth() {
+ var widthProperty = "outerWidth";
+ if (!document.attachEvent)
+ widthProperty = "innerWidth";
+ return window[widthProperty]
+ }, getDisplayProperties: function getDisplayProperties() {
+ var hasDisplayInformation = MS.Entertainment.Utilities.valueFromPropertyPathFragments(Windows, ["Graphics", "Display", "DisplayInformation"]);
+ if (hasDisplayInformation)
+ return Windows.Graphics.Display.DisplayInformation.getForCurrentView();
+ return Windows.Graphics.Display.DisplayProperties
+ }, isMusicApp1: {
+ get: function getIsMusicApp1() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music
+ }
+ }, isMusicApp2: {
+ get: function getIsMusicApp2() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music2
+ }
+ }, isMusicApp: {
+ get: function getIsMusicApp() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music2
+ }
+ }, isAmsterdamApp: {
+ get: function getIsAmsterdamApp() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.amsterdam
+ }
+ }, isVideoApp1: {
+ get: function getIsVideoApp1() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video
+ }
+ }, isVideoApp2: {
+ get: function getIsVideoApp2() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video2
+ }
+ }, isVideoApp: {
+ get: function getIsVideoApp() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video2
+ }
+ }, isTestApp: {
+ get: function getIsTestApp() {
+ return true;
+ }
+ }, isApp1: {
+ get: function getIsApp1() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video
+ }
+ }, isApp2: {
+ get: function getIsApp2() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music2 || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video2 || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.amsterdam
+ }
+ }, _isApp2Platform: false, isApp2Platform: {
+ get: function isApp2Platform() {
+ return !MS.Entertainment.isAppModeOverride && (MS.Entertainment.Utilities._isApp2Platform || MS.Entertainment.Utilities.isApp2)
+ }, set: function isApp2Platform(value) {
+ MS.Entertainment.Utilities._isApp2Platform = value
+ }
+ },
+ isWindowsBlue: {
+ get: function getIsWindowsBlue() {
+ return !!Windows.UI.ViewManagement.ViewSizePreference
+ }
+ }, isMain: {
+ get: function getIsMain() {
+ var mainString = "main.html";
+ var href = window.location.href;
+ return href.indexOf(mainString, href.length - mainString.length) >= 0
+ }
+ }, titleId: {
+ get: function getTitleId() {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ return "0x3D705025";
+ else if (MS.Entertainment.Utilities.isMusicApp2)
+ return "0x18FFC9F4";
+ else
+ return null
+ }
+ }, shortTitleId: {
+ get: function getTitleId() {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ return "3D705025";
+ else if (MS.Entertainment.Utilities.isMusicApp2)
+ return "18FFC9F4";
+ else
+ return null
+ }
+ }, supportsProtectedContent: {
+ get: function getSupportsProtectedContent() {
+ try {
+ return Microsoft.Media.PlayReadyClient.PlayReadyStatics.playReadyCertificateSecurityLevel === 2000
+ }
+ catch (e) {
+ return false
+ }
+ }
+ }, _isDrmIndividualized: false, isDrmIndividualized: {
+ get: function get_isDrmIndividualized() {
+ return MS.Entertainment.Utilities._isDrmIndividualized
+ }, set: function set_isDrmIndividualized(newValue) {
+ MS.Entertainment.Utilities._isDrmIndividualized = newValue
+ }
+ }, clientSupportsFreeJustPlays: {
+ get: function getClientSupportsFreeJustPlays() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.service.enableFreeJustPlays
+ }
+ }, isRightFree: function isRightFree(right) {
+ var retVal = false;
+ if (right.acceptablePaymentInstrumentTypes)
+ for (var i = 0; i < right.acceptablePaymentInstrumentTypes.length; i++)
+ if (right.acceptablePaymentInstrumentTypes[i] === MS.Entertainment.Data.Augmenter.Marketplace.edsAcceptedPaymentTypes.none)
+ retVal = true;
+ return retVal
+ }, useModalNowPlaying: {
+ get: function getUseModalNowPlaying() {
+ return MS.Entertainment.Utilities.isVideoApp
+ }
+ }, noMarketplaceRootClassName: {
+ get: function noMarketplaceRootClassName() {
+ return "noMarketplace"
+ }
+ }, isLaunchToCollectionSettingEnabled: {
+ get: function getIsLaunchToCollectionSettingEnabled() {
+ var moniker = null;
+ try {
+ var defaultLaunchSetting = Windows.Storage.ApplicationData.current.roamingSettings.values["launchLocation"];
+ moniker = MS.Entertainment.UI.Monikers[defaultLaunchSetting]
+ }
+ catch (e) { }
+ return (moniker === "videoCollection")
+ }
+ }, getMediaByServiceId: function getMediaByServiceId(serviceId, idType) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return new WinJS.Promise(function (c, e, p) {
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicVideosMarketplace)) {
+ var contentTypeQuery = new MS.Entertainment.Data.Query.GenericDetails;
+ contentTypeQuery.serviceId = serviceId;
+ contentTypeQuery.idType = (idType && idType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsIdType.canonical.toLocaleLowerCase()) ? MS.Entertainment.Data.Query.edsIdType.canonical : MS.Entertainment.Data.Query.edsIdType.zuneCatalog;
+ contentTypeQuery.execute().then(function contentTypeQuerySuccess(query) {
+ var mediaItemQuery = null;
+ if (query.result.item)
+ switch (query.result.item.contentType) {
+ case "Movie":
+ if (query.result.item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer) {
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailMovie;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ }
+ else if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailMovie;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ break;
+ case "MovieTrailer":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailMovie;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ break;
+ case "Track":
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.SongDetails;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.track)
+ }
+ break;
+ case "Album":
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.AlbumWithTracks;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.album)
+ }
+ break;
+ case "Artist":
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.ArtistDetails;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.artist)
+ }
+ break;
+ case "MusicVideo":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.MusicVideoDetails;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid
+ }
+ break;
+ case "Episode":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailTVEpisode;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid
+ }
+ break;
+ case "Series":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailTVSeries;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ break;
+ case "Season":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailTVSeason;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid
+ }
+ break;
+ default:
+ break
+ }
+ if (mediaItemQuery)
+ mediaItemQuery.execute().then(function mediaItemQuerySuccess(query) {
+ c(query.result.item)
+ }, function mediaItemQueryError(error) {
+ e(error.errorCode)
+ });
+ else
+ e()
+ }, function contentTypeQueryError(error) {
+ e(error.errorCode)
+ })
+ }
+ else
+ e()
+ })
+ }, isMovie: function isMovie(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie);
+ return isType
+ }, isTVEpisode: function isTVEpisode(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode);
+ return isType
+ }, isTVSeason: function isTVSeason(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = Microsoft.Entertainment.Queries.ObjectType.tvSeason === mediaItem.mediaType || (MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem === mediaItem.serviceType && MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season === mediaItem.type);
+ return isType
+ }, isTVSeries: function isTVSeries(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries);
+ return isType
+ }, isAnyTV: function isAnyTV(mediaItem) {
+ if (mediaItem)
+ return this.isTVEpisode(mediaItem) || this.isTVSeason(mediaItem) || this.isTVSeries(mediaItem)
+ }, isVideo: function isVideo(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType !== Microsoft.Entertainment.Queries.VideoType.musicVideo);
+ return isType
+ }, isBundle: function isBundle(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = mediaItem.isBundle && (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie);
+ return isType
+ }, raisePanelReadyTest: function raisePanelReadyTest(element, failed, model) {
+ if (!element)
+ return;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelReadyTest", true, true);
+ domEvent.failed = failed;
+ domEvent.model = model;
+ element.dispatchEvent(domEvent)
+ }, raisePanelReady: function raisePanelReady(element, failed, model) {
+ if (!element)
+ return;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelReady", true, true);
+ domEvent.failed = failed;
+ domEvent.model = model;
+ element.dispatchEvent(domEvent)
+ }, raiseDomEvent: function raiseDomEvent(element, eventName) {
+ if (!element || !eventName)
+ return;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent(eventName, true, true);
+ element.dispatchEvent(domEvent)
+ }, raisePanelReset: function raisePanelReset(element) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelReset", true, true);
+ element.dispatchEvent(domEvent)
+ }, resetPerfTrackStartTime: function resetPerfTrackStartTime() {
+ window.PerfTrack = {
+ LaunchInformation: {
+ getStartTime: (function _perfTrackLaunchInformation_getStartTimeClosure() {
+ var startTime = new Date;
+ return function _perfTrackLaunchInformation_getStartTimeWorker() {
+ return startTime
+ }
+ })()
+ }
+ }
+ }, cloneActivationArguments: function cloneActivationArguments(args) {
+ var copy = {};
+ for (var name in args)
+ switch (name) {
+ case "activatedOperation":
+ case "prelaunchActivated":
+ case "splashScreen":
+ case "detail":
+ case "linguisticDetails":
+ continue;
+ default:
+ copy[name] = args[name];
+ break
+ }
+ return copy
+ }, getDirectionFromGlobalKeyInput: function getDirectionFromGlobalKeyInput(e) {
+ MS.Entertainment.Utilities.assert(e, "Need an event to decide which direction to go in");
+ if (!e)
+ return;
+ var direction;
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rGlobal:
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.right;
+ break;
+ case WinJS.Utilities.Key.lGlobal:
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.left;
+ break;
+ case WinJS.Utilities.Key.pageUp:
+ if (e.altKey)
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.right;
+ break;
+ case WinJS.Utilities.Key.pageDown:
+ if (e.altKey)
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.left;
+ break
+ }
+ return direction
+ }, GlobalKeyDirection: {
+ left: "left", right: "right"
+ }, isInvocationEvent: function isInvocationEvent(eventArgs) {
+ var keyCode = eventArgs && eventArgs.keyCode;
+ if (!keyCode)
+ return true;
+ var isInvocationEvent = false;
+ switch (keyCode) {
+ case WinJS.Utilities.Key.enter:
+ case WinJS.Utilities.Key.space:
+ case WinJS.Utilities.Key.invokeButton:
+ isInvocationEvent = true;
+ break
+ }
+ return isInvocationEvent
+ }, defaultClientTypeFromApp: {
+ get: function defaultClientTypeFromApp() {
+ var tuner = MS.Entertainment.Data.Augmenter.Marketplace.Tuner.Windows;
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride)
+ tuner = MS.Entertainment.Data.Augmenter.Marketplace.Tuner.XboxOne;
+ return tuner
+ }
+ }, _defaultEdsTargetDeviceTypeFromApp: null, defaultEdsTargetDeviceTypeFromApp: {
+ get: function defaultEdsDeviceTypeFromApp() {
+ if (!MS.Entertainment.Utilities._defaultEdsTargetDeviceTypeFromApp) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.Utilities._defaultEdsTargetDeviceTypeFromApp = configuration.service.defaultTargetDeviceType
+ }
+ return MS.Entertainment.Utilities._defaultEdsTargetDeviceTypeFromApp
+ }
+ }, _defaultEdsHeaderDeviceTypeFromApp: null, defaultEdsHeaderDeviceTypeFromApp: {
+ get: function defaultEdsDeviceTypeFromApp() {
+ if (!MS.Entertainment.Utilities._defaultEdsHeaderDeviceTypeFromApp) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.Utilities._defaultEdsHeaderDeviceTypeFromApp = configuration.service.defaultHeaderDeviceType
+ }
+ return MS.Entertainment.Utilities._defaultEdsHeaderDeviceTypeFromApp
+ }
+ }, rightSupportsTuner: function rightSupportsTuner(right, tuner) {
+ var foundTuner = false;
+ if (right.clientTypes && right.clientTypes.length > 0)
+ for (var k = 0; k < right.clientTypes.length; k++)
+ if (tuner === right.clientTypes[k] || right.clientTypes[k] === MS.Entertainment.Data.Augmenter.Marketplace.Tuner.All) {
+ foundTuner = true;
+ break
+ }
+ return foundTuner
+ }, optionsAppTypeTabIndexHelper: {
+ get: function optionsAppTypeTabIndexHelper() {
+ return MS.Entertainment.Utilities.isApp2 ? 0 : -1
+ }
+ }, bindingAppTypeTabIndexHelper: WinJS.Utilities.markSupportedForProcessing(function bindingAppTypeTabIndexHelper(source, sourceProperties, destination, destinationProperties) {
+ destination.tabIndex = MS.Entertainment.Utilities.optionsAppTypeTabIndexHelper
+ }), toggleClass: function toggleClass(element, className, classEnabled) {
+ if (classEnabled)
+ WinJS.Utilities.addClass(element, className);
+ else
+ WinJS.Utilities.removeClass(element, className)
+ }, SNAPPED_MODE_WIDTH: 480, STANDARD_RESOLUTION_VIDEO_ROWS: 2, HIGH_RESOLUTION_VIDEO_ROWS: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return 2;
+ else
+ return 3
+ }
+ }, STANDARD_RESOLUTION_ROWS: 3, HIGH_RESOLUTION_ROWS: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return 3;
+ else
+ return 4
+ }
+ }, VIEW1_VERTICAL_HEIGHT_LIMIT: 900, VIEW1_VIDEO_VERTICAL_HEIGHT_LIMIT: 1050, popOverDefaultSize: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isVideoApp && !MS.Entertainment.Utilities.getRetailExperienceState())
+ return {
+ width: 470, height: 550
+ };
+ else
+ return {
+ width: 730, height: 530
+ }
+ }
+ }, cardItemSizeWithMargin: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return {
+ width: 476, height: 240
+ };
+ else
+ return {
+ width: 300, height: 170
+ }
+ }
+ }, tileImageSize: {
+ get: function () {
+ return {
+ width: 316, height: 316
+ }
+ }
+ }, immersiveBackgroundArtSize: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return {
+ width: 1080, height: 1080
+ };
+ else
+ return {
+ width: 1366, height: 768
+ }
+ }
+ }, playlistPinImageSize: {
+ get: function () {
+ return {
+ width: 240, height: 240
+ }
+ }
+ }, VARIOUS_LANGUAGES_CODE: "zz-ZZ"
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ FlipViewUnloadHelper: MS.Entertainment.UI.Framework.defineUserControl(null, function FlipViewUnloadHelper(element) {
+ if (element && element.parentElement)
+ element.parentElement.unloadTimeout = 3000
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ User: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function user_constructor(userXuidOrNativeUser, gamerTag) {
+ if (isNaN(userXuidOrNativeUser))
+ this.nativeUserModel = [userXuidOrNativeUser || null];
+ else
+ this.nativeUserModel = this._createNativeUserModel(userXuidOrNativeUser, gamerTag)
+ }, {
+ nativeUserModel: null, getIsValid: function getIsValid() {
+ return Array.isArray(this.nativeUserModel) && this.nativeUserModel[0]
+ }, _createNativeUserModel: function _createNativeUserModel(userXuid, gamerTag) {
+ return [MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.xboxLive).createUser(userXuid, gamerTag)]
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities.BindingAgnostic", {
+ setProperty: function setProperty(target, property, value) {
+ if (!(property in target) && target._backingData)
+ target.addProperty(property, value);
+ else
+ target[property] = value
+ }, setProperties: function setProperties(target, source) {
+ var key;
+ if (source)
+ for (key in source)
+ if (key.indexOf("_") !== 0 && key !== "instance" && key !== "constructor")
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(target, key, source[key])
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ showElementNoAnimation: WinJS.Utilities.markSupportedForProcessing(function showElementNoAnimation(element) {
+ WinJS.Utilities.removeClass(element, "hideFromDisplay")
+ }), hideElementNoAnimation: WinJS.Utilities.markSupportedForProcessing(function hideElementNoAnimation(element) {
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ }), showElement: function showElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ if (!element)
+ return WinJS.Promise.as();
+ var result;
+ element.hideFromDisplay = false;
+ WinJS.Utilities.removeClass(element, "hideFromDisplay");
+ result = MS.Entertainment.UI.Framework.beginShowAnimations(element, overrideOldSelector, overrideNewSelector);
+ return WinJS.Promise.as(result)
+ }, hideElement: function hideElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ var hidePromise = null;
+ var timeoutPromise = null;
+ if (!element)
+ return WinJS.Promise.wrap();
+ element.hideFromDisplay = true;
+ if (timeoutMS)
+ timeoutPromise = WinJS.Promise.timeout(timeoutMS).then(function cancelHide() {
+ if (hidePromise) {
+ hidePromise.cancel();
+ hidePromise = null
+ }
+ if (element.hideFromDisplay)
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ });
+ hidePromise = MS.Entertainment.UI.Framework.beginHideAnimations(element, overrideOldSelector, overrideNewSelector).then(function hideAnimationsComplete() {
+ if (timeoutPromise) {
+ timeoutPromise.cancel();
+ timeoutPromise = null
+ }
+ if (element.hideFromDisplay)
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ });
+ return hidePromise
+ }, displayElement: function displayElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ if (!element)
+ return WinJS.Promise.as();
+ element.removeFromDisplay = false;
+ WinJS.Utilities.removeClass(element, "removeFromDisplay");
+ return MS.Entertainment.UI.Framework.beginShowAnimations(element, overrideOldSelector, overrideNewSelector)
+ }, collapseElement: function collapseElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ var removePromise = null;
+ var timeoutPromise = null;
+ if (!element)
+ return WinJS.Promise.wrap();
+ element.removeFromDisplay = true;
+ if (timeoutMS)
+ timeoutPromise = WinJS.Promise.timeout(timeoutMS).then(function cancelHide() {
+ if (removePromise) {
+ removePromise.cancel();
+ removePromise = null
+ }
+ });
+ removePromise = MS.Entertainment.UI.Framework.beginHideAnimations(element, overrideOldSelector, overrideNewSelector).then(function hideAnimationsComplete() {
+ if (timeoutPromise) {
+ timeoutPromise.cancel();
+ timeoutPromise = null
+ }
+ if (element.removeFromDisplay)
+ WinJS.Utilities.addClass(element, "removeFromDisplay")
+ });
+ return removePromise
+ }, toggleDisplayCollapseElement: function toggleDisplayCollapseElement(element, makeVisible) {
+ var timeout = 500;
+ var domElement = element;
+ if (element && element.domElement)
+ domElement = element.domElement;
+ if (!domElement)
+ return WinJS.Promise.as();
+ if (makeVisible)
+ return MS.Entertainment.Utilities.displayElement(domElement);
+ else
+ return MS.Entertainment.Utilities.collapseElement(domElement, timeout).then(null, function onTimeout() {
+ WinJS.Utilities.addClass(domElement, "removeFromDisplay")
+ })
+ }, enterElement: function enterElement(element) {
+ if (!element)
+ return WinJS.Promise.as();
+ var result;
+ element.hideFromDisplay = false;
+ WinJS.Utilities.removeClass(element, "hideFromDisplay");
+ result = MS.Entertainment.UI.Framework.beginEnterAnimations(element);
+ return WinJS.Promise.as(result)
+ }, exitElement: function exitElement(element) {
+ if (!element)
+ return WinJS.Promise.as();
+ element.hideFromDisplay = true;
+ return MS.Entertainment.UI.Framework.beginExitAnimations(element).then(function hideAnimationsComplete() {
+ if (element.hideFromDisplay)
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ })
+ }, appendChild: function appendChild(parent, child, hidden) {
+ parent.appendChild(child);
+ if (!hidden)
+ return MS.Entertainment.Utilities.showElement(child);
+ else {
+ WinJS.Utilities.addClass(child, "hideFromDisplay");
+ return WinJS.Promise.wrap()
+ }
+ }, insertBefore: function insertBefore(parent, newChild, refChild, hidden) {
+ parent.insertBefore(newChild, refChild);
+ if (!hidden)
+ return MS.Entertainment.Utilities.showElement(newChild);
+ else {
+ WinJS.Utilities.addClass(newChild, "hideFromDisplay");
+ return WinJS.Promise.wrap()
+ }
+ }, removeChild: function removeChild(parent, child, skipHideElement) {
+ var remove = function remove() {
+ if (child.parentElement) {
+ MS.Entertainment.UI.Framework.assert(child.parentElement === parent, "Supplied parent was not childs direct parent");
+ child.parentElement.removeChild(child)
+ }
+ };
+ if (skipHideElement) {
+ remove();
+ return WinJS.Promise.wrap()
+ }
+ else
+ return MS.Entertainment.Utilities.hideElement(child).then(function hideElementCompletes() {
+ remove()
+ })
+ }, replaceChild: function replaceChild(parent, newChild, oldChild, hidden) {
+ return MS.Entertainment.UI.Framework.beginHideAnimations(oldChild).then(function beginHideAnimationsCompletes() {
+ parent.replaceChild(newChild, oldChild);
+ if (!hidden)
+ MS.Entertainment.Utilities.showElement(newChild);
+ else {
+ WinJS.Utilities.addClass(newChild, "hideFromDisplay");
+ return WinJS.Promise.wrap()
+ }
+ })
+ }, isElementVisible: function isElementVisible(element) {
+ var style = window.getComputedStyle(element);
+ return !(style.display === "none" || style.visibility === "hidden" || style.opacity === 0.0)
+ }, safeAddClass: function safeAddClass(element, className) {
+ if (element)
+ WinJS.Utilities.addClass(element, className)
+ }, safeRemoveClass: function safeRemoveClass(element, className) {
+ if (element)
+ WinJS.Utilities.removeClass(element, className)
+ }, addEvents: function addEvents(element, events, capture) {
+ element = (element && element.domElement) ? element.domElement : element;
+ return MS.Entertainment.Utilities.addEventHandlers(element, events, capture)
+ }, waitForStartedTransitionsToComplete: MS.Entertainment.UI.Framework.waitForStartedTransitionsToComplete, redirectPromise: function redirectPromise(promise, value) {
+ return WinJS.Promise.as(promise).then(function redirectPromise() {
+ return value
+ })
+ }, _schedulePromise: function _schedulePromise(promiseFunction, promiseValue, jobName) {
+ var result;
+ if (WinJS.Utilities.Scheduler)
+ result = WinJS.Utilities.Scheduler[promiseFunction](promiseValue, jobName);
+ else {
+ jobName = jobName || String.empty;
+ msWriteProfilerMark("ent:_schedulePromise:" + promiseFunction + ":" + jobName + ",StartTM");
+ result = WinJS.Promise.timeout(1).then(function () {
+ msWriteProfilerMark("ent:_schedulePromise:" + promiseFunction + ":" + jobName + ",StopTM");
+ return promiseValue
+ })
+ }
+ return result
+ }, schedulePromiseHigh: function schedulePromiseHigh(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseHigh", promiseValue, jobName)
+ }, schedulePromiseAboveNormal: function schedulePromiseAboveNormal(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseAboveNormal", promiseValue, jobName)
+ }, schedulePromiseNormal: function schedulePromiseNormal(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseNormal", promiseValue, jobName)
+ }, schedulePromiseBelowNormal: function schedulePromiseNormal(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseBelowNormal", promiseValue, jobName)
+ }, schedulePromiseIdle: function schedulePromiseIdle(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseIdle", promiseValue, jobName)
+ }, setAccessibilityTextFromStringId: function setAccessibilityTextFromStringId(element, stringId) {
+ MS.Entertainment.Utilities.setAccessibilityText(element, String.load(stringId))
+ }, setAccessibilityText: function setAccessibilityText(element, text) {
+ element = (element && element.domElement) ? element.domElement : element;
+ if (element)
+ if (text)
+ element.setAttribute("aria-label", text);
+ else
+ element.removeAttribute("aria-label")
+ }, setAccessibilityTextFromElement: function setAccessibilityTextFromElement(destinationElement, sourceElement) {
+ destinationElement = (destinationElement && destinationElement.domElement) ? destinationElement.domElement : destinationElement;
+ sourceElement = (sourceElement && sourceElement.domElement) ? sourceElement.domElement : sourceElement;
+ if (destinationElement) {
+ MS.Entertainment.Utilities.assert(!sourceElement || sourceElement.id, "A source element was provided, but the element did not have an id. For aria-labelledby to work an id is required.");
+ if (sourceElement && sourceElement.id)
+ destinationElement.setAttribute("aria-labelledby", sourceElement.id);
+ else
+ destinationElement.removeAttribute("aria-labelledby")
+ }
+ }, copyAugmentedProperties: function copyAugmentedProperties(from, to) {
+ var originalFrom = from;
+ var property;
+ var propertyDescriptor;
+ function copyAugmentedPropertiesEx(from, to) {
+ if (from && to) {
+ from = MS.Entertainment.Data.augmentationShape(WinJS.Binding.unwrap(from));
+ Object.getOwnPropertyNames(from).forEach(function (property) {
+ if (property.indexOf("_") !== 0 && property !== "instance")
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(to, property, originalFrom[property])
+ });
+ to.hydrated = originalFrom.hydrated
+ }
+ }
+ copyAugmentedPropertiesEx(from, to)
+ }, uniteObjects: function uniteObjects(lessSignificant, moreSignificant) {
+ if (lessSignificant && moreSignificant) {
+ var combinedItem = {};
+ for (var property in lessSignificant)
+ combinedItem[property] = lessSignificant[property];
+ for (property in moreSignificant)
+ combinedItem[property] = moreSignificant[property];
+ return combinedItem
+ }
+ else if (lessSignificant)
+ return lessSignificant;
+ else if (moreSignificant)
+ return moreSignificant;
+ else
+ return {}
+ }, clone: function clone(object) {
+ var result = null;
+ if (!object)
+ result = object;
+ else if (object.clone)
+ result = object.clone();
+ else if (object instanceof Array) {
+ result = [];
+ object.forEach(function (item) {
+ result.push(MS.Entertainment.Utilities.clone(item))
+ })
+ }
+ else if (object instanceof Object) {
+ result = {};
+ for (var key in object)
+ result[key] = object[key]
+ }
+ return result
+ }, doNothing: WinJS.Utilities.markSupportedForProcessing(function doNothing() { }), getAccountLocale: function getAccountLocale() {
+ var locale;
+ var signedInUser = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser))
+ signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser && signedInUser.locale)
+ locale = signedInUser.locale;
+ else {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (config.service.lastSignedInUserAccountLocale)
+ locale = config.service.lastSignedInUserAccountLocale;
+ else
+ locale = MS.Entertainment.Utilities.getResourceLanguage()
+ }
+ return locale
+ }, appRegionMatchesMachineRegion: function doesAccountRegionMatchMachineRegion() {
+ var appRegion = (new Microsoft.Entertainment.Util.GlobalizationManager).getRegion();
+ var machineRegion = (new Windows.Globalization.GeographicRegion).codeTwoLetter;
+ return (appRegion === machineRegion)
+ }, getResourceLanguage: function getResourceLanguage() {
+ var resourceLanguage;
+ try {
+ var resourceContext = new Windows.ApplicationModel.Resources.Core.ResourceContext;
+ resourceLanguage = resourceContext.languages[0]
+ }
+ catch (e) {
+ Trace.fail("Unexpected error retrieving resource locale")
+ }
+ if (!resourceLanguage)
+ resourceLanguage = "en-US";
+ return resourceLanguage
+ }, getDisplayLanguageFromLanguageCode: function getDisplayLanguageFromLanguageCode(languageCode) {
+ if (!languageCode)
+ return String.empty;
+ var index = languageCode.lastIndexOf("-");
+ var language = (index > 0) ? languageCode.substr(0, index) : languageCode;
+ var languageObject = new Windows.Globalization.Language(language);
+ return languageObject.displayName ? languageObject.displayName : String.empty
+ }, getValueFromCsvList: function getValueFromCsvList(nameValuePairList, name) {
+ var value;
+ var regularExpression = "(^|,)\\s*" + name + "\\s*=\\s*([^=,\\s]+)";
+ var result = new RegExp(regularExpression).exec(nameValuePairList);
+ if (result)
+ value = result[2];
+ return value
+ }, getRegionCodeFromLocale: function getRegionCodeFromLocale(localeName) {
+ var regionCode = String.empty;
+ var lastDashIndex = localeName.lastIndexOf("-");
+ if (lastDashIndex >= 0)
+ regionCode = localeName.slice(lastDashIndex + 1);
+ return regionCode.toUpperCase()
+ }, getLanguageCodeFromLocale: function getLanguageCodeFromLocale(localeName) {
+ var languageCode;
+ var lastDashIndex = localeName.lastIndexOf("-");
+ if (lastDashIndex >= 0)
+ languageCode = localeName.slice(0, lastDashIndex);
+ else
+ languageCode = localeName;
+ return languageCode
+ }, instantiateControl: function instantiateControl(control, options, host) {
+ options = options || {};
+ var UserControlConstructor = control;
+ var controlAttribute;
+ if (typeof UserControlConstructor === "string") {
+ UserControlConstructor = WinJS.Utilities.getMember(control);
+ controlAttribute = control
+ }
+ else
+ controlAttribute = "MS.Entertainment.UI.Framework.UserControl";
+ if (!options.hasOwnProperty("_skipDefer"))
+ options._skipDefer = true;
+ MS.Entertainment.UI.Controls.assert(typeof UserControlConstructor === "function", "Overlay: " + control + " is not a function");
+ host.setAttribute("data-win-control", controlAttribute);
+ return new UserControlConstructor(host, options)
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities.DateFormatters", {
+ formatDay: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDay(sourceValue) {
+ if (sourceValue)
+ return sourceValue.getDate();
+ else
+ return String.empty
+ })), formatMonthAbbreviation: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatMonthAbbreviation(sourceValue) {
+ if (sourceValue) {
+ var superShortMonthPattern = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).abbreviatedMonth;
+ return superShortMonthPattern.format(sourceValue)
+ }
+ else
+ return String.empty
+ })), formatMonthAbbreviationYear: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatMonthAbbreviationYear(sourceValue) {
+ if (sourceValue) {
+ var superShortMonthPattern = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).abbreviatedMonthYear;
+ return superShortMonthPattern.format(sourceValue)
+ }
+ else
+ return String.empty
+ })), formatYearMonthDayLong: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatYearMonthDayLong(sourceValue) {
+ if (sourceValue) {
+ var longdate = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).dayMonthYear;
+ return longdate.format(sourceValue)
+ }
+ else
+ return String.empty
+ }))
+ });
+ WinJS.Namespace.define("MS.Entertainment.globalControls", {
+ GlobalControl: {
+ appBar: "BottomAppBar", appInfoNotification: "AppInfoNotification", appCriticalNotification: "AppCriticalNotification", bottomProgressBar: "BottomProgressBar", backButton: "BackButton", backButtonBling: "BackButtonBling", immersiveDetails: "ImmersiveDetails", mainHeader: "MainHeader", navigationWrapper: "NavigationWrapper", xboxControls: "xboxControls", musicTransportControls: "MusicTransportControls", profilePicker: "ProfilePicker", profilePickerContainer: "ProfilePickerContainer"
+ }, getControl: function getControl(identifier) {
+ return MS.Entertainment.Utilities.getChildControl(document.body, identifier)
+ }
+ });
+ (function () {
+ var currentOverlayContainers = [];
+ function sortOnTabIndex(a, b) {
+ if (a.tabIndex < b.tabIndex) {
+ if (a.tabIndex === -1)
+ return 1;
+ return -1
+ }
+ else if (a.tabIndex > b.tabIndex)
+ return 1;
+ else
+ return 0
+ }
+ function excludeNonFocusableElements(element) {
+ if (!element.getAttribute)
+ return false;
+ var disabledAttribute = element.getAttribute("disabled");
+ var currentStyle = element.currentStyle;
+ var isVisible = currentStyle && currentStyle.visibility !== "hidden" && currentStyle.display !== "none" && disabledAttribute !== "disabled" && disabledAttribute !== "";
+ if (!isVisible)
+ return false;
+ var tagName = element.tagName;
+ var isFocusableElementType = /INPUT|SELECT|TEXTAREA|BUTTON|IFRAME/.test(tagName);
+ var isFocusableLink = (tagName === "A" && element.href);
+ var actuallyHasTabStop = false;
+ var tabIndexAttribute = element.getAttribute("tabindex");
+ if (tabIndexAttribute && !isNaN(tabIndexAttribute))
+ actuallyHasTabStop = (tabIndexAttribute !== "-1");
+ else if ((isFocusableElementType || isFocusableLink) && element.tabIndex > -1)
+ actuallyHasTabStop = true;
+ var isKeyboardNavigationManagerFocusable = WinJS.Utilities.hasClass(element, "win-focusable");
+ return (isFocusableElementType && actuallyHasTabStop) || (isFocusableLink && actuallyHasTabStop) || actuallyHasTabStop || isKeyboardNavigationManagerFocusable
+ }
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ TabConstrainer: MS.Entertainment.UI.Framework.define(function (element, options) {
+ this.domElement = element;
+ if (options)
+ WinJS.UI.setOptions(this, options);
+ var firstDiv = document.createElement("div");
+ firstDiv.className = MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass;
+ firstDiv.setAttribute("role", "menuitem");
+ firstDiv.setAttribute("aria-hidden", "true");
+ if (this.enabled)
+ firstDiv.setAttribute("tabindex", 0);
+ firstDiv.addEventListener("focus", this._focusLandsOnFirstElement.bind(this), false);
+ element.insertAdjacentElement("AfterBegin", firstDiv);
+ var lastDiv = document.createElement("div");
+ lastDiv.className = MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass;
+ lastDiv.setAttribute("role", "menuitem");
+ lastDiv.setAttribute("aria-hidden", "true");
+ if (this.enabled)
+ lastDiv.setAttribute("tabindex", this.assumeTabIndexIsZero ? 0 : 10000);
+ lastDiv.addEventListener("focus", this._focusLandsOnLastElement.bind(this), false);
+ element.appendChild(lastDiv);
+ if (!this.assumeTabIndexIsZero)
+ this._fixUpLastDivTabIndexes()
+ }, {
+ assumeTabIndexIsZero: false, _enabled: true, enabled: {
+ get: function tabConstrainer_get() {
+ return this._enabled
+ }, set: function tabConstrainer_set(value) {
+ if (this._enabled === value)
+ return;
+ this._enabled = value;
+ if (this.enabled) {
+ this.domElement.firstElementChild.setAttribute("tabindex", 0);
+ this.domElement.lastElementChild.setAttribute("tabindex", this.assumeTabIndexIsZero ? 0 : 10000);
+ if (!this.assumeTabIndexIsZero)
+ this._fixUpLastDivTabIndexes()
+ }
+ else {
+ this.domElement.firstElementChild.removeAttribute("tabindex");
+ this.domElement.lastElementChild.removeAttribute("tabindex")
+ }
+ }
+ }, _focusLandsOnLastElement: function _focusLandsOnLastElement() {
+ if (!this.enabled)
+ return;
+ if (!WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass))
+ return;
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && this.includeAppBarOnLastTab && appBar.visible)
+ appBar.focusAppBar(this.domElement);
+ else
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.domElement, this.excludeEndPointElements)
+ }, _focusLandsOnFirstElement: function _focusLandsOnFirstElement() {
+ if (!this.enabled)
+ return;
+ if (document.activeElement)
+ if (!WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass))
+ return;
+ if (this.domElement)
+ MS.Entertainment.UI.Framework.focusLastInSubTree(this.domElement)
+ }, _fixUpLastDivTabIndexes: function _fixUpLastDivTabIndexes() {
+ var otherLastItems = document.querySelectorAll("." + MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass);
+ var nextTabIndex = 10001;
+ if (otherLastItems && otherLastItems.length > 0)
+ Array.prototype.forEach.call(otherLastItems, function (item) {
+ if (this.domElement.lastElementChild === item) {
+ item.tabIndex = 10000;
+ return
+ }
+ if (item.parentElement && item.parentElement.winControl && item.parentElement.winControl.enabled) {
+ item.tabIndex = nextTabIndex;
+ nextTabIndex = item.tabIndex + 10000
+ }
+ }.bind(this))
+ }, excludeEndPointElements: true, includeAppBarOnLastTab: false
+ }, {
+ firstDivClass: "ent-firstdiv", lastDivClass: "ent-lastdiv"
+ }), focusLastInSubTree: function focusLastInSubTree(element) {
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(element))
+ return;
+ var children = element.getElementsByTagName("*");
+ var sorted = Array.prototype.filter.call(children, excludeNonFocusableElements).sort(sortOnTabIndex);
+ for (var i = (sorted.length - 1); i > -1; i--) {
+ var elementToFocus = sorted[i];
+ if (WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass) || WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass))
+ continue;
+ elementToFocus.focus();
+ if (elementToFocus === document.activeElement || MS.Entertainment.UI.Framework.focusedItemInContainer(element))
+ break
+ }
+ }, focusFirstInSubTree: function focusFirstInSubTree(element, excludeEndpointElements, force, skipScroll) {
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(element))
+ return false;
+ if (!force && MS.Entertainment.UI.Framework.focusedItemInContainer(element))
+ return true;
+ var successfullyFocused = false;
+ var firstDiv = null;
+ var children = element.getElementsByTagName("*");
+ var sorted = Array.prototype.filter.call(children, excludeNonFocusableElements).sort(sortOnTabIndex);
+ for (var i = 0; i < sorted.length; i++) {
+ var elementToFocus = sorted[i];
+ if (excludeEndpointElements)
+ if (WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass)) {
+ firstDiv = elementToFocus;
+ continue
+ }
+ else if (WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass))
+ continue;
+ MS.Entertainment.UI.Framework.focusElement(elementToFocus, skipScroll, false, force);
+ if (elementToFocus === document.activeElement || MS.Entertainment.UI.Framework.focusedItemInContainer(element)) {
+ successfullyFocused = true;
+ break
+ }
+ }
+ if (!successfullyFocused)
+ if (firstDiv) {
+ MS.Entertainment.UI.Framework.focusElement(firstDiv, skipScroll, false, force);
+ successfullyFocused = (firstDiv === document.activeElement)
+ }
+ return successfullyFocused
+ }, tryAndFocusElementInSubTreeWithTimer: function tryAndFocusElementInSubTreeWithTimer(tree, timeout) {
+ MS.Entertainment.UI.Framework.assert(timeout > -1, "Invalid timeout provided to try and set focus");
+ MS.Entertainment.UI.Framework.assert(tree, "Need a valid tree to try and set focus");
+ if (timeout < 0)
+ return WinJS.Promise.as();
+ if (!tree)
+ return WinJS.Promise.as();
+ return WinJS.Promise.timeout(timeout).then(function trySetFocusOnTimeoutComplete() {
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(tree))
+ return;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(tree)
+ })
+ }, tryAndFocusElementInSubTreeWithRetry: function tryAndFocusElementInSubTreeWithRetry(tree, retryDelay, numberOfRetries) {
+ Trace.assert(typeof numberOfRetries === "number", "tryAndFocusElementInSubTreeWithRetry: numberOfRetries expected to be a number");
+ Trace.assert(typeof retryDelay === "number", "tryAndFocusElementInSubTreeWithRetry: retryDelay expected to be a number");
+ Trace.assert(retryDelay > -1, "tryAndFocusElementInSubTreeWithRetry: Invalid timeout delay");
+ Trace.assert(tree, "tryAndFocusElementInSubTreeWithRetry: Need a valid tree to try and set focus");
+ var isElementFocused = MS.Entertainment.UI.Framework.focusFirstInSubTree(tree);
+ if (isElementFocused || numberOfRetries <= 0)
+ return WinJS.Promise.as(isElementFocused);
+ else
+ return WinJS.Promise.timeout(retryDelay).then(function delayComplete() {
+ return MS.Entertainment.UI.Framework.tryAndFocusElementInSubTreeWithRetry(tree, retryDelay, numberOfRetries - 1)
+ })
+ }, tryAndFocusElementWithRetry: function tryAndFocusElementWithRetry(element, retryDelay, numberOfRetries) {
+ Trace.assert(typeof numberOfRetries === "number", "tryAndFocusElementWithRetry: numberOfRetries expected to be a number");
+ Trace.assert(typeof retryDelay === "number", "tryAndFocusElementWithRetry: retryDelay expected to be a number");
+ Trace.assert(retryDelay > -1, "tryAndFocusElementWithRetry: Invalid timeout delay");
+ Trace.assert(element, "tryAndFocusElementWithRetry: Need a valid element to try and set focus");
+ MS.Entertainment.UI.Framework.focusElement(element);
+ var isElementFocused = document.activeElement === element;
+ if (isElementFocused || numberOfRetries <= 0)
+ return WinJS.Promise.as(isElementFocused);
+ else
+ return WinJS.Promise.timeout(retryDelay).then(function delayComplete() {
+ return MS.Entertainment.UI.Framework.tryAndFocusElementWithRetry(element, retryDelay, numberOfRetries - 1)
+ })
+ }, focusedItemInContainer: function focusedItemInContainer(container) {
+ if (document.activeElement)
+ if (container.contains(document.activeElement) && !(WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass) || WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass)))
+ return true;
+ return false
+ }, focusFirstFocusableAncestor: function focusFirstFocusableAncestor(element, skipScroll) {
+ var ancestor = element;
+ do {
+ if (ancestor.domElement)
+ ancestor = ancestor.domElement;
+ if (excludeNonFocusableElements(ancestor)) {
+ MS.Entertainment.UI.Framework.focusElement(ancestor, skipScroll);
+ break
+ }
+ ancestor = ancestor.parentNode
+ } while (ancestor)
+ }, focusElement: function focusElement(elementToFocus, skipScroll, skipInputElementCheck, force) {
+ if (!force && !MS.Entertainment.UI.Framework.canMoveFocus(elementToFocus, skipInputElementCheck))
+ return;
+ if (skipScroll)
+ try {
+ elementToFocus.setActive()
+ }
+ catch (error) {
+ MS.Entertainment.Utilities.fail("Failed to set active element. Classes: " + elementToFocus.className + ", Error: " + (error && error.message), MS.Entertainment.UI.Debug.errorLevel.low)
+ }
+ else
+ elementToFocus.focus()
+ }, focusedElementHasClass: function focusedElementHasClass(classList) {
+ var hasClass = false;
+ if (document.activeElement && classList) {
+ if (!Array.isArray(classList))
+ classList = [classList];
+ for (var i = 0, l = classList.length; i < l; i++)
+ if (WinJS.Utilities.hasClass(document.activeElement, classList[i])) {
+ hasClass = true;
+ break
+ }
+ }
+ return hasClass
+ }, currentContentContainer: null, currentOverlayContainer: {
+ get: function currentOverlayContainer_get() {
+ var currentIndex = currentOverlayContainers.length - 1;
+ return currentOverlayContainers[currentIndex]
+ }
+ }, currentFocusContainer: {
+ get: function currentFocusContainer_get() {
+ var focusableOverlay = MS.Entertainment.UI.Framework.currentOverlayContainer;
+ if (focusableOverlay && focusableOverlay.currentStyle && focusableOverlay.currentStyle.display === "none")
+ focusableOverlay = null;
+ return focusableOverlay || MS.Entertainment.UI.Framework.currentContentContainer
+ }
+ }, addOverlayContainer: function addOverlayContainer(container) {
+ if (MS.Entertainment.UI.Framework.currentOverlayContainer && MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute)
+ MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute("aria-hidden", "true");
+ currentOverlayContainers.push(container)
+ }, removeOverlayContainer: function removeOverlayContainer(container) {
+ var indexOfItemToRemove = currentOverlayContainers.indexOf(container);
+ if (indexOfItemToRemove < 0)
+ return;
+ currentOverlayContainers.splice(indexOfItemToRemove, 1);
+ if (MS.Entertainment.UI.Framework.currentOverlayContainer && MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute)
+ MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute("aria-hidden", "false")
+ }, getVisibleFlyoutElement: function isFlyoutVisible() {
+ var flyouts = document.querySelectorAll(".win-flyout");
+ for (var i = 0; i < flyouts.length; i++) {
+ var flyout = flyouts[i];
+ if (flyout && flyout.winControl && !flyout.winControl.hidden)
+ return flyout
+ }
+ }, isFlyoutVisible: function isFlyoutVisible() {
+ return !!MS.Entertainment.UI.Framework.getVisibleFlyoutElement()
+ }, canMoveFocus: function canMoveFocus(targetContainer, skipInputElementCheck) {
+ if (!targetContainer)
+ return false;
+ var focusContainer = MS.Entertainment.UI.Framework.currentFocusContainer;
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ var targetingAppBar = false;
+ if (bottomAppBar && bottomAppBar.domElement)
+ targetingAppBar = bottomAppBar.domElement.contains(targetContainer);
+ if (focusContainer && !focusContainer.contains(targetContainer) && !targetingAppBar)
+ return false;
+ var flyout = MS.Entertainment.UI.Framework.getVisibleFlyoutElement();
+ if (flyout && !flyout.contains(targetContainer))
+ return false;
+ if (!skipInputElementCheck && MS.Entertainment.Utilities.isApp1 && document.activeElement && MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement))
+ return false;
+ return true
+ }, setFocusRoot: function setFocusRoot(prospectiveFocusRoot) {
+ var currentContentContainer = MS.Entertainment.UI.Framework.currentContentContainer || document.querySelector(".pageContainer.currentPage");
+ if (!prospectiveFocusRoot || !MS.Entertainment.UI.Framework.checkIfInDom(prospectiveFocusRoot) || (currentContentContainer !== prospectiveFocusRoot) || !currentContentContainer.contains(prospectiveFocusRoot))
+ prospectiveFocusRoot = currentContentContainer;
+ var overlay = MS.Entertainment.UI.Framework.currentOverlayContainer;
+ if (overlay && !overlay.contains(prospectiveFocusRoot))
+ prospectiveFocusRoot = overlay;
+ MS.Entertainment.UI.Framework.assert(prospectiveFocusRoot, "Somehow, we ended up without a focus root to set when we expected one");
+ if (WinJS.UI.AutomaticFocus && prospectiveFocusRoot)
+ WinJS.UI.AutomaticFocus.focusRoot = prospectiveFocusRoot
+ }, resetFocusToTopMostContent: function resetFocusToTopMostContent() {
+ var focusTarget = MS.Entertainment.UI.Framework.currentContentContainer;
+ if (MS.Entertainment.UI.Framework.currentOverlayContainer)
+ focusTarget = MS.Entertainment.UI.Framework.currentOverlayContainer;
+ var currentFocusedElementDetails = "No Focused element";
+ if (document.activeElement)
+ currentFocusedElementDetails = "ClassName: " + document.activeElement.className + ", " + "ID: " + document.activeElement.id;
+ MS.Entertainment.UI.Framework.fail("User manually reset focus. Focus was in this location: " + currentFocusedElementDetails);
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(focusTarget)
+ }, scrollViewerFocusHelper: function scrollViewerFocusHelper(scrollViewer) {
+ if (!scrollViewer)
+ return;
+ if (!WinJS.Utilities.hasClass(scrollViewer, "win-scrollviewer-scrollmode-list"))
+ return;
+ var scrollContainer = scrollViewer.querySelector(".win-scrollviewer-contentelement");
+ if (!scrollContainer)
+ return;
+ scrollContainer.addEventListener("focus", function (evt) {
+ if (evt.target)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(evt.target, true, true)
+ })
+ }, setButtonListFocusOverrides: function setButtonListFocusOverrides(domElement, queryString) {
+ if (!domElement || !queryString)
+ return;
+ var noOp = ".currentPage :focus";
+ var actionButtons = domElement.querySelectorAll(queryString);
+ for (var i = 0; i < actionButtons.length; i++)
+ actionButtons[i].removeAttribute("data-win-focus");
+ if (actionButtons.length === 1)
+ actionButtons[0].setAttribute("data-win-focus", JSON.stringify({
+ up: noOp, down: noOp
+ }));
+ else if (actionButtons.length > 1) {
+ actionButtons[0].setAttribute("data-win-focus", JSON.stringify({ up: noOp }));
+ actionButtons[actionButtons.length - 1].setAttribute("data-win-focus", JSON.stringify({ down: noOp }))
+ }
+ }
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ VirtualizedDataSource: MS.Entertainment.UI.Framework.derive(WinJS.UI.VirtualizedDataSource, function (listDataAdapter, options) {
+ if (listDataAdapter && listDataAdapter.createListAdaptor)
+ listDataAdapter = listDataAdapter.createListAdaptor();
+ this._baseDataSourceConstructor(listDataAdapter, options)
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getRetailExperienceState: function getRetailExperienceState() {
+ return (new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience
+ }, setRetailExperienceState: function setRetailExperienceState(isEnabled) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configuration.shell.retailExperience = isEnabled;
+ configuration.fue.showLXFUE = !isEnabled;
+ WinJS.Promise.timeout(10 * 1000).done(function retailExperienceInformCustomer() {
+ MSApp.terminateApp(new Error("Retail experience mode changed"))
+ })
+ }, resetAppStateForRetailExperienceIfNeeded: function resetAppStateForRetailExperienceIfNeeded() {
+ if (!MS.Entertainment.Utilities.getRetailExperienceState())
+ return false;
+ var previousExecutionDate = Windows.Storage.ApplicationData.current.localSettings[MS.Entertainment.Utilities.lastRunDemoModeDateKey];
+ var currentExecutionDate = (new Date).toLocaleDateString();
+ var wasReset = false;
+ if (previousExecutionDate && (previousExecutionDate !== currentExecutionDate)) {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configManager.groveler.fullGrovelCompleted = false;
+ wasReset = true
+ }
+ Windows.Storage.ApplicationData.current.localSettings[MS.Entertainment.Utilities.lastRunDemoModeDateKey] = currentExecutionDate;
+ return wasReset
+ }, loadDemoScripts: function loadDemoScripts() {
+ var loadPromise;
+ if (MS.Entertainment.Utilities.isVideoApp1 && MS.Entertainment.Utilities.getRetailExperienceState())
+ loadPromise = MS.Entertainment.UI.Framework.loadScripts("/components/video/DemoDashboardViewModel.js", "/components/inlinedetails/VideoInlineDetailsDemo.js");
+ return WinJS.Promise.as(loadPromise)
+ }, removeAllPlaylistsIfDemoMode: function removeAllPlayListsIfDemoMode() {
+ if (!MS.Entertainment.Utilities.getRetailExperienceState() || !MS.Entertainment.Utilities.isMusicApp)
+ return;
+ var playlistsToDelete = [];
+ var query = new MS.Entertainment.Data.Query.libraryPlaylists;
+ query.sort = Microsoft.Entertainment.Queries.PlaylistsSortBy.dateEditedDescending;
+ query.getItems().then(function demoModePlaylistQuery(playlists) {
+ return playlists.forEachAll(function demoModePlaylistForEach(playlist) {
+ var id = WinJS.Utilities.getMember("item.data.libraryId", playlist);
+ if (id < 1)
+ return;
+ playlistsToDelete.push(id)
+ })
+ }).then(function demoModePlaylistDeletePlaylists() {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ var playlistProvider = mediaStore.playlistProvider;
+ return playlistProvider.deletePlaylistAsync(playlistsToDelete, Microsoft.Entertainment.Platform.MediaAvailability.available)
+ }).done(null, function demoModePlaylistFailure(e) {
+ MS.Entertainment.Utilities.fail("Failure deleting playlists in demo mode: " + (e && e.message))
+ })
+ }, retailExperienceArgument: "RetailExperience", lastRunDemoModeDateKey: "RetailDemoMode"
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getCurrentUserLocation: function getCurrentUserLocation() {
+ var classicNavServiceCurrentPage = String.empty;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ classicNavServiceCurrentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).getUserLocation();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation) && (classicNavServiceCurrentPage.indexOf("homeHub") === 0 || !classicNavServiceCurrentPage)) {
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ return navigationJournal ? navigationJournal.location : String.empty
+ }
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ return classicNavServiceCurrentPage;
+ else
+ return String.empty
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ wasNavigatedToDashboard: false, assertIfCalledBeforeCriticalWorkCompleted: function assertIfCalledBeforeCriticalWorkCompleted() {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var isFirstLocationLoaded = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation).isFirstLocationLoaded;
+ var wasNavigatedToDashboard = !MS.Entertainment.Utilities.wasNavigatedToDashboard || uiStateService.isHubStripVisible;
+ MS.Entertainment.UI.Framework.assert(isFirstLocationLoaded || wasNavigatedToDashboard, "Function was called before all start-up critical work has been completed")
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ updateHtmlDirectionAttribute: MS.Entertainment.UI.Framework.updateHtmlDirectionAttribute, getTextDirection: MS.Entertainment.UI.Framework.getTextDirection, TextDirections: MS.Entertainment.UI.Framework.TextDirections, TriggerSequence: function (keyArray, continuityTimeout, callback) {
+ var state = 0;
+ var lastTime = null;
+ this.inSequence = function () {
+ return state > 0
+ };
+ this.keyIn = function (key) {
+ if (lastTime === null || ((new Date) - lastTime) > continuityTimeout)
+ state = 0;
+ lastTime = new Date;
+ if (keyArray[state] === key)
+ state++;
+ else
+ lastTime = null;
+ if (lastTime !== null && state === keyArray.length) {
+ callback();
+ lastTime = null;
+ return true
+ }
+ return false
+ }
+ }, trimCharacterDirection: function trimCharacterDirection(string) {
+ if (string) {
+ var start = 0;
+ var end = string.length;
+ var firstChar = string.charCodeAt(0);
+ var lastChar = string.charCodeAt(end - 1);
+ if (firstChar === String.rtlmCode || firstChar === String.ltrmCode)
+ start++;
+ if (lastChar === String.rtlmCode || lastChar === String.ltrmCode)
+ end--;
+ if (start !== 0 || end !== string.length)
+ string = string.substr(start, end)
+ }
+ return string
+ }, detectCharacterDirection: function detectCharacterDirection(ch) {
+ if (ch < 0x249C) {
+ if (ch < 0x200E) {
+ if (ch >= 0x0041 && ch <= 0x005A || ch >= 0x0061 && ch <= 0x007A || ch >= 0x00C0 && ch <= 0x02B8 || ch >= 0x0370 && ch <= 0x0589 || ch >= 0x0900 && ch <= 0x1FFC)
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ else if (ch >= 0x0591 && ch <= 0x085E)
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft
+ }
+ else if (ch >= 0x2090 && ch <= 0x209C || ch >= 0x210A && ch <= 0x2188 || ch >= 0x2336 && ch <= 0x237A || ch === String.ltrmCode)
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ else if (ch === String.rtlmCode)
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft
+ }
+ else if (ch < 0xFD50) {
+ if (ch <= 0x24E9 || (ch >= 0x2800 && ch <= 0x28FF) || (ch >= 0x2C00 && ch <= 0x2DFF) || (ch >= 0x3021 && ch <= 0x4DB5) || (ch >= 0x4E00 && ch <= 0xFB17))
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ else if (ch >= 0xFB1D && ch <= 0xFD3D)
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft
+ }
+ else if (ch <= 0xFDFC || (ch >= 0xFE70 && ch <= 0xFEFC))
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft;
+ else if ((ch >= 0xFF21 && ch <= 0xFF3A) || (ch >= 0xFF41 && ch <= 0xFF5A) || (ch >= 0xFF65 && ch <= 0xFFDC))
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ return null
+ }, detectStringDirection: function detectStringDirection(value, min, max) {
+ var char;
+ var characterDirection;
+ max = isNaN(max) ? value.length : max;
+ for (var i = isNaN(min) ? 0 : min; i < max; i++) {
+ char = value.charCodeAt(i);
+ if (char !== 0x0020 && char !== 0x0009 && char !== 0x000A && char !== 0x000D) {
+ characterDirection = MS.Entertainment.Utilities.detectCharacterDirection(char);
+ if (characterDirection)
+ return characterDirection
+ }
+ }
+ return MS.Entertainment.Utilities.getTextDirection()
+ }, needsNormalizedBaseline: function needsNormalizedBaseline(value, min, max) {
+ var char;
+ max = isNaN(max) ? value.length : max;
+ min = isNaN(min) ? 0 : min;
+ for (var i = min; i < max; i++) {
+ char = value.charCodeAt(i);
+ if ((char < 0xAC00 || char > 0xD7AF) && (char !== 0x0020))
+ return false
+ }
+ return (max - min) ? true : false
+ }, verifyUrl: function verifyUrl(value, requireHttps) {
+ var requiredHttpsExpression = /^https:\/\//i;
+ var anyHttpExpression = /^http[s]?:\/\//i;
+ if (requireHttps)
+ return requiredHttpsExpression.test(value);
+ else
+ return anyHttpExpression.test(value)
+ }, sanitizeString: function sanitizeString(dirtyString) {
+ return dirtyString ? dirtyString.toLowerCase().replace(/[^\w\s]/g, String.empty) : String.empty
+ }, isStreamingUrl: function (url) {
+ return (url && url.match && url.match(/^zest:/i))
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ _cachedConfigurationXuid: null, _cachedConfigurationValues: null, _loadUserConfigurationValues: function _loadUserConfigurationValues(xuid) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!xuid)
+ MS.Entertainment.fail("loadUserConfigurationValues: xuid not defined");
+ try {
+ var setting = Windows.Storage.ApplicationData.current.localSettings.values[xuid];
+ var values = {};
+ if (setting)
+ try {
+ values = JSON.parse(setting)
+ }
+ catch (error) {
+ MS.Entertainment.UI.fail("Failed to parse user configuration values: " + error && error.message);
+ Windows.Storage.ApplicationData.current.localSettings.values[xuid] = null
+ }
+ MS.Entertainment.Utilities._cachedConfigurationXuid = xuid;
+ MS.Entertainment.Utilities._cachedConfigurationValues = values
+ }
+ catch (error) { }
+ }, getUserConfigurationValue: function getUserConfigurationValue(configurationKey) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var xuid = configurationManager.service.lastSignedInUserXuid;
+ if (!xuid)
+ xuid = "UnauthenticatedUser";
+ if (MS.Entertainment.Utilities.isApp2 && xuid !== MS.Entertainment.Utilities._cachedConfigurationXuid)
+ MS.Entertainment.Utilities._loadUserConfigurationValues(xuid);
+ return MS.Entertainment.Utilities._cachedConfigurationValues && MS.Entertainment.Utilities._cachedConfigurationValues[configurationKey]
+ }, setUserConfigurationValue: function setUserConfigurationValue(configurationKey, value) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var xuid = configurationManager.service.lastSignedInUserXuid;
+ if (!xuid)
+ xuid = "UnauthenticatedUser";
+ if (MS.Entertainment.Utilities.isApp2 && xuid !== MS.Entertainment.Utilities._cachedConfigurationXuid)
+ MS.Entertainment.Utilities._loadUserConfigurationValues(xuid);
+ if (MS.Entertainment.Utilities.isApp2)
+ try {
+ var values = MS.Entertainment.Utilities._cachedConfigurationValues || {};
+ var oldValue = values[configurationKey];
+ if (value === undefined)
+ delete values[configurationKey];
+ else
+ values[configurationKey] = value;
+ if (value !== oldValue)
+ Windows.Storage.ApplicationData.current.localSettings.values[xuid] = JSON.stringify(values);
+ MS.Entertainment.Utilities._cachedConfigurationValues = values
+ }
+ catch (error) { }
+ }, deleteUserConfigurationValue: function deleteUserConfigurationValue(configurationKey) {
+ MS.Entertainment.Utilities.setUserConfigurationValue(configurationKey, undefined)
+ }, UserConfigurationValues: {
+ albumArtistSyncScreenDismissed: "albumArtistSyncScreenDismissed", cachedGenre1: "cachedGenre1", cachedGenre2: "cachedGenre2", collectionDialogXuids: "collectionDialogXuids", homeEducationXuids: "homeEducationXuids", minimumListensForEducationPanelsReachedXuids: "minimumListensForEducationPanelsReachedXuids", musicVideosOpt: "musicVideosOpt", notInterestedRecommendations: "notInterestedRecommendations", nowPlayingEducationXuids: "nowPlayingEducationXuids", playlistDialogXuids: "playlistDialogXuids", playlistSyncScreenDismissed: "playlistSyncScreenDismissed", previousApplicationState: "previousApplicationState", welcomeDialogOverride: "welcomeDialogOverride"
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ isFileTypeInList: function isFileTypeInList(fileTypeList, fileType) {
+ if (!fileType || !fileTypeList)
+ return false;
+ var searchPattern = new RegExp("(^|;)" + fileType + ";", "i");
+ return fileTypeList.match(searchPattern) !== null
+ }, getMediaFileContentType: function getMediaFileContentType(media) {
+ var fileContentType = String.empty;
+ var fileSubContentType = String.empty;
+ try {
+ var contentTypeString = (media && media.contentType) || String.empty;
+ var typeParts = contentTypeString.split("/");
+ fileContentType = typeParts[0].toLowerCase();
+ fileSubContentType = typeParts.length > 0 ? typeParts[1].toLowerCase() : String.empty
+ }
+ catch (e) { }
+ if (fileContentType === "application" || fileContentType === "text") {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (MS.Entertainment.Utilities.isFileTypeInList(configurationManager.amsterdam.videoContentTypes, fileSubContentType))
+ fileContentType = "video";
+ else if (MS.Entertainment.Utilities.isFileTypeInList(configurationManager.amsterdam.musicContentTypes, fileSubContentType))
+ fileContentType = "audio"
+ }
+ return fileContentType
+ }, getMediaFileFileType: function getMediaFileFileType(media) {
+ var mediaFileType = String.empty;
+ try {
+ mediaFileType = (media && media.fileType) || String.empty
+ }
+ catch (e) {
+ if (e.number === MS.Entertainment.Platform.Playback.Error.E_NOTIMPL.code) {
+ var uri = new Windows.Foundation.Uri(media.path);
+ mediaFileType = uri.extension
+ }
+ }
+ return mediaFileType.toLowerCase()
+ }, getApp2OSVersion: function getApp2OSVersion() {
+ var developmentKitProperties = WinJS.Utilities.getMember("Windows.Xbox.System.Internal.DevelopmentKit.DevelopmentKitProperties");
+ var shellVersion = null;
+ if (developmentKitProperties)
+ shellVersion = developmentKitProperties["shellVersion"];
+ if (shellVersion) {
+ var versionNumberArrayUnformatted = shellVersion.match(/_\d\d\d\d\./);
+ if (versionNumberArrayUnformatted.length > 0)
+ return +versionNumberArrayUnformatted[0].substr(1, 4)
+ }
+ }, isDlnaSupported: function isDlnaSupported() {
+ if (MS.Entertainment.Utilities.isTestApp)
+ return true;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.amsterdam.minimumDlnaSupportedBuild > 0 && MS.Entertainment.Utilities.getApp2OSVersion() >= configurationManager.amsterdam.minimumDlnaSupportedBuild
+ }, isSetBackgroundImageSupported: function isSetBackgroundImageSupported() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.amsterdam.minimumSetBackgroundImageSupportedBuild > 0 && MS.Entertainment.Utilities.getApp2OSVersion() >= configurationManager.amsterdam.minimumSetBackgroundImageSupportedBuild && !!WinJS.Utilities.getMember("Windows.Xbox.System.Internal.UserSettings.UserSettings.setUserBackgroundImageAsync")
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getUserRoamingSetting: function getUserRoamingSetting(configurationKey) {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.Utilities.getUserConfigurationValue(configurationKey);
+ else
+ return Windows.Storage.ApplicationData.current.roamingSettings.values[configurationKey]
+ }, setUserRoamingSetting: function setUserRoamingSetting(configurationKey, value) {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Utilities.setUserConfigurationValue(configurationKey, value);
+ else
+ Windows.Storage.ApplicationData.current.roamingSettings.values[configurationKey] = value
+ }, deleteUserRoamingSetting: function deleteUserRoamingSetting(configurationKey) {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Utilities.deleteUserConfigurationValue(configurationKey);
+ else
+ Windows.Storage.ApplicationData.current.roamingSettings.values.remove(configurationKey)
+ }
+ });
+ (function () {
+ var uniqueInteger = -1;
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getSessionUniqueInteger: function getSessionUniqueInteger() {
+ uniqueInteger++;
+ return uniqueInteger
+ }
+ })
+ })();
+ (function () {
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ beginShowAnimations: function beginShowAnimations(element, overrideOldSelector, overrideNewSelector) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, overrideOldSelector || "data-ent-hideanimation", overrideNewSelector || "data-ent-showanimation")
+ }, beginHideAnimations: function beginHideAnimations(element, overrideOldSelector, overrideNewSelector) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, overrideOldSelector || "data-ent-showanimation", overrideNewSelector || "data-ent-hideanimation")
+ }, clearHideAnimations: function clearHideAnimations(element) {
+ return MS.Entertainment.UI.Framework._clearAnimations(element, "data-ent-hideanimation")
+ }, clearShowAnimations: function clearShowAnimations(element) {
+ return MS.Entertainment.UI.Framework._clearAnimations(element, "data-ent-showanimation")
+ }, beginEnterAnimations: function beginShowAnimations(element) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, "data-ent-exitanimation", "data-ent-enteranimation")
+ }, beginExitAnimations: function beginHideAnimations(element) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, "data-ent-enteranimation", "data-ent-exitanimation")
+ }, _clearAnimations: function _clearAnimations(element, oldSelector) {
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled)
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[" + oldSelector + "]", function (subElement) {
+ var animationClasses = subElement.getAttribute(oldSelector);
+ if (animationClasses)
+ animationClasses.split(" ").forEach(function (animationClass) {
+ WinJS.Utilities.removeClass(subElement, animationClass)
+ })
+ }, true)
+ }, _beginAnimations: function _beginAnimations(element, oldSelector, newSelector) {
+ var hasAnimations = false;
+ var promises = [];
+ var animationsEnabled = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState))
+ animationsEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled;
+ if (animationsEnabled) {
+ MS.Entertainment.UI.Framework._clearAnimations(element, oldSelector);
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[" + newSelector + "]", function (subElement) {
+ if (MS.Entertainment.Utilities.isElementVisible(subElement)) {
+ var animationClasses = subElement.getAttribute(newSelector);
+ if (animationClasses) {
+ var complete;
+ var promise = new WinJS.Promise(function (c, e, p) {
+ complete = c
+ });
+ promises.push(promise);
+ var processAnimationAndComplete = function processAnimationAndComplete(animationName) {
+ var index = animationNames.indexOf(animationName);
+ if (index > -1) {
+ animationNames.splice(index, 1);
+ if (animationNames.length === 0) {
+ subElement.removeEventListener("animationend", animationComplete);
+ complete()
+ }
+ return true
+ }
+ else
+ return false
+ };
+ var animationNames = [];
+ var animationComplete = function animationComplete(event) {
+ if (event.srcElement !== subElement)
+ return;
+ if (!processAnimationAndComplete(event.animationName))
+ if (subElement.currentStyle && subElement.currentStyle.animationName) {
+ animationNames = subElement.currentStyle.animationName.split(",").map(function (animationName) {
+ return animationName.trim()
+ });
+ if (!processAnimationAndComplete(event.animationName));
+ hasAnimations = true
+ }
+ };
+ subElement.addEventListener("animationend", animationComplete);
+ animationClasses.split(" ").forEach(function (animationClass) {
+ if (!WinJS.Utilities.hasClass(subElement, animationClass))
+ WinJS.Utilities.addClass(subElement, animationClass)
+ });
+ animationNames = subElement.currentStyle.msAnimationName.split(",").map(function (animationName) {
+ return animationName.trim()
+ });
+ if (animationNames.length <= 0 || (animationNames.length === 1 && animationNames[0] === "none")) {
+ subElement.removeEventListener("animationend", animationComplete);
+ complete()
+ }
+ else
+ hasAnimations = true;
+ if (!hasAnimations);
+ if (!hasAnimations) {
+ var transitionProperties = subElement.currentStyle.msTransitionProperty.split(",").map(function (transitionProperty) {
+ return transitionProperty.trim()
+ });
+ if (transitionProperties.length > 0) {
+ var transitionComplete = function transitionComplete(event) {
+ var index = transitionProperties.indexOf(event.propertyName);
+ if (index > -1) {
+ transitionProperties.splice(index, 1);
+ if (transitionProperties.length === 0) {
+ subElement.removeEventListener("transitionend", transitionComplete);
+ complete()
+ }
+ }
+ };
+ subElement.addEventListener("transitionend", transitionComplete);
+ hasAnimations = true
+ }
+ }
+ }
+ }
+ }, true)
+ }
+ if (promises.length)
+ return WinJS.Promise.join(promises);
+ else
+ return WinJS.Promise.wrap()
+ }
+ })
+ })();
+ (function () {
+ var lazyDefine = MS.Entertainment.UI.Framework.lazyDefine;
+ var imageExtension = "png";
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getPackageImageFileExtension: function () {
+ return imageExtension
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.ImagePaths", {
+ transparent: lazyDefine(function () {
+ return "ms-appx:///Images/transparent." + imageExtension
+ }), imageNotFound: lazyDefine(function () {
+ return "ms-appx:///Images/img_not_found." + imageExtension
+ }), genericMusicLarge: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/ico_74x_GenericMusic_large." + imageExtension
+ }), genericMusicSmall: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/ico_74x_GenericMusic_Small." + imageExtension
+ }), genericMusicL2: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/ico_74x_GenericMusic_L2." + imageExtension
+ }), genericMusic252x265: lazyDefine(function () {
+ return "ms-appx:///Images/ico_252x265_GenericMusic." + imageExtension
+ }), genericMusicL3Hero: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/ico_GenericMusic_L3_Hero." + imageExtension
+ }), missingAlbum75: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/Music8_1/Missing_Album_75." + imageExtension
+ }), missingAlbum150: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/Music8_1/Missing_Album_150." + imageExtension
+ }), missingAlbum210: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/Music8_1/Missing_Album_210." + imageExtension
+ }), missingArtist75: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/Music8_1/Missing_Artist_75." + imageExtension
+ }), missingArtist150: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/Music8_1/Missing_Artist_150." + imageExtension
+ }), missingArtNowPlaying: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/Music8_1/Missing_Art_Now_Playing." + imageExtension
+ }), musicDemoSpotlightHero: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_spotlightHero." + imageExtension
+ }), musicDemoSpotlightSmall1: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_spotlightSmall1." + imageExtension
+ }), musicDemoSpotlightSmall2: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_spotlightSmall2." + imageExtension
+ }), musicDemoSpotlightSmall3: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_spotlightSmall3." + imageExtension
+ }), musicDemoFeaturedHero: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_featuredHero." + imageExtension
+ }), musicDemoFeaturedSmall1: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_featuredSmall1." + imageExtension
+ }), musicDemoFeaturedSmall2: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_featuredSmall2." + imageExtension
+ }), musicDemoFeaturedSmall3: lazyDefine(function () {
+ return "ms-appx:///Images/Demo/music_featuredSmall3." + imageExtension
+ }), music2MissingArt100x100: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_100x100." + imageExtension
+ }), music2MissingArt158x158: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_158x158." + imageExtension
+ }), music2MissingArt208x208: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_208x208." + imageExtension
+ }), music2MissingArt316x316: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_316x316." + imageExtension
+ }), music2MissingArt320x320: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_320x320." + imageExtension
+ }), music2MissingArt426x426: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_426x426." + imageExtension
+ }), music2MissingArt532x532: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_532x532." + imageExtension
+ }), music2MissingArt640x640: lazyDefine(function () {
+ return "ms-appx:///Images/GenericIcons/music2/music2_missing_art_fallback_640x640." + imageExtension
+ }), musicUpsellSignIn: lazyDefine(function () {
+ return "ms-appx:///Images/ExploreUpsell/sign-in." + imageExtension
+ }), musicUpsellOffline: lazyDefine(function () {
+ return "ms-appx:///Images/ExploreUpsell/offline." + imageExtension
+ }), musicUpsellDevices: lazyDefine(function () {
+ return "ms-appx:///Images/ExploreUpsell/devices." + imageExtension
+ })
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ onlineUserSubscriptionEnabled: function onlineUserSubscriptionEnabled() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser))
+ return false;
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ return signIn.isSignedIn && signedInUser.isSubscription
+ }, currentOrLastUserSubscriptionEnabled: function currentOrLastUserSubscriptionEnabled() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return MS.Entertainment.Utilities.onlineUserSubscriptionEnabled() || configurationManager.service.lastSignedInUserSubscription
+ }, dashboardPlaylistCollageSize: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ return {
+ width: 135, height: 135
+ };
+ else
+ return {
+ width: 236, height: 236
+ }
+ }
+ }, wideTileImageSize: {
+ get: function () {
+ return {
+ width: 632, height: 316
+ }
+ }
+ }, horizontalBigTileImageSize: {
+ get: function () {
+ return {
+ width: 480, height: 480
+ }
+ }
+ }, trackInlineSize: { height: 70 }, getTryAgainDynamicText: function getTryAgainDynamicText() {
+ var stringId = String.id.IDS_DETAILS_TRY_AGAIN_LABEL;
+ if (MS.Entertainment.Utilities.isVideoApp)
+ if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd)
+ stringId = String.id.IDS_DETAILS_TRY_AGAIN_LABEL_HD;
+ else if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd)
+ stringId = String.id.IDS_DETAILS_TRY_AGAIN_LABEL_SD;
+ return stringId
+ }, getDownloadDynamicText: function getDownloadDynamicText() {
+ var stringId = String.id.IDS_DETAILS_DOWNLOAD_LABEL;
+ if (MS.Entertainment.Utilities.isVideoApp)
+ if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd)
+ stringId = String.id.IDS_DETAILS_DOWNLOAD_LABEL_HD;
+ else if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd)
+ stringId = String.id.IDS_DETAILS_DOWNLOAD_LABEL_SD;
+ return stringId
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Icon", {
+ achievements: "\uE288", actionLinkArrow: "\uE26B", actionLinkArrowRTL: "\uE26C", addToCollection: "\uE2B3", addToNowPlaying: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.addToNowPlaying2;
+ else
+ return MS.Entertainment.UI.Icon.addToNowPlaying1
+ }
+ }, addToNowPlaying1: "\uE2AE", addToNowPlaying2: "\uE2E0", addToPlaylist: "\uE2B1", arrowNext: "\uE2EF", arrowPrevious: "\uE2EE", avatarItem: "\uE27B", background: "\uE39B", book: "\uE2EA", bookStore: "\uE2F8", bullet: "\u16EB", invokeButton: "\uE3CE", camera: "\uE41C", chevronDown: "\uE3AF", chevronDownLight: "\E09D", chevronUp: "\uE3B0", cloud: "\uE2C1", cloudNotAvailable: "\uE2BF", cloudSyncing: "\uE2DD", close: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE409";
+ else
+ return "\u2715"
+ }
+ }, closedCaption: "\uE437", colorable: "\uE292", computer: "\uE39E", devices: "\uE2ED", details: "\uE28F", downloading: "\uE2BC", downloadingArrowPart: "\uE2BE", downloadingBasePart: "\uE2BD", downChevron: "\uE0A1", feedback: "\uE2E4", flexhub: "\uE2DE", friend: "\uE287", friendPending: "\uE2DC", friendRespond: "\uE289", friendRemove: "\uE28A", friendAdd: "\uE28B", genericVideo: "\uE29D", genericGame: "\uE29E", genericMusic: "\uE29F", game: "\uE279", gameAddon: "\uE277", gameCompare: "\uE286", gameDemo: "\uE276", gameJoin: "\uE278", hd: "\uE33F", home: "\uE274", info: "\uE2B6", inlineAchievements: "\uE2A1", inlineAwarded: "\uE2A2", inlineBeacon: "\uE2A3", inlineColorable: "\uE2A4", inlineFriend: "\uE2A8", inlineGame: "\uE2A5", inlineGamerScore: "\uE2A9", inlineError: "\uE2A6", inlineNotification: "\uE2E2", inlineLink: "\uE2A7", inlineLock: "\uE2A0", inlineNowPlaying: "\uE2B4", inlinePoints: "\uE2AA", inlineStreaming: "\uE2AB", list: "\uE331", magazine: "\uE2F7", magazineStore: "\uE2F9", modifierAvatarItem: "\uE295", modifierFriend: "\uE296", modifierXbox: "\uE297", modifierPlaylist: "\uE298", modifierAddRing: "\uE299", modifierAddRingPressed: "\uE29A", modifierRemoveRing: "\uE29B", modifierRemoveRingPressed: "\uE29C", moveToBottom: "\uE2FB", moveToTop: "\uE2FA", movies: "\uE410", musicInCollection: "\uE300", menu: "\uE27C", next: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE402";
+ else
+ return WinJS.UI.AppBarIcon.next
+ }
+ }, noSelection: "\uE294", notification: "\uE2E5", nowPlayingNext: "\uE097", nowPlayingPrev: "\uE096", oneDrive: "\uE306", playlist: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE43E";
+ else
+ return "\uE28F"
+ }
+ }, photo: "\uE282", previous: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE403";
+ else
+ return WinJS.UI.AppBarIcon.previous
+ }
+ }, profile: "\uE285", related: "\uE280", repeat: "\uE290", repeatOnce: "\uE291", radio: "\uE2FD", readingCollection: "\uE2F5", readingSubscription: "\uE2EB", screenFull: "\uE272", fullScreen: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE45A";
+ else
+ return MS.Entertainment.UI.Icon.screenFull
+ }
+ }, screenNormal: "\uE273", semanticZoom: "\uE2E7", shop: "\uE275", smartDj: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjWithRing
+ }
+ }, smartDjPressed: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjPressedWithRing
+ }
+ }, smartDjPressedWithRing: "\uE283", smartDjWithRing: "\uE284", smartDjAppbar: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjAppbarWithRing
+ }
+ }, smartDjAppbarPressed: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjAppbarPressedWithRing
+ }
+ }, smartDjAppbarWithRing: "\uE2BB", smartDjAppbarPressedWithRing: "\uE2BA", smartDjNoRing: "\uE2DF", smartGlassTablet: "\uE34E", streaming: "\uE2E3", smiley: "\uE293", subtitle: "\uE44D", switchDefinition: "\uE3C7", switchLanguage: "\uE413", tvMonitor: "\uE39D", themes: "\uE281", upChevron: "\uE0A0", usbDevice: "\uE377", video11: "\uE33E", sendToXbox: "\uE2AC", sendToXboxAdorner: "\uE2AD", sendToXboxAdornerAppbar: "\uE2B9", takeFromXbox: "\uE2AF", takeFromXboxAdorner: "\uE2B0", takeFromXboxAdornerAppbar: "\uE2B8", xbox: "\uE28C", xboxConnect: "\uE28D", xboxConnected: "\uE28E", xboxXenonLogo: "\uE3E3", videoCollection: "\uE2EA", joystickUp: "\uE2C2", joystickRight: "\uE2C3", joystickDown: "\uE2C4", joystickLeft: "\uE2C5", triggerRight: "\uE2C6", bumperRight: "\uE2C7", bumperLeft: "\uE2C8", triggerLeft: "\uE2C9", clear: "\uE2CA", webHub: "\uE2CB", swap: "\uE2CC", smartGlassGem: "\uE2B7", smartGlassConsole: "\uE2CD", smartGlassSlate: "\uE2CE", buttonBottomRight: "\uE2CF", buttonBottomLeft: "\uE2D0", buttonTopRight: "\uE2D1", buttonTopLeft: "\uE2D2", dpadLeft: "\uE2D3", dpadDown: "\uE2D4", dpadUp: "\uE2D5", dpadRight: "\uE2D6", fileFolder: "\uE3F5", keyboard: "\uE2D7", touchGuide: "\uE2D8", onscreenCursor: "\uE2D9", xenon: "\uE2DA", addTo: "\uE444", explore: "\uE42F", folder: "\uE188", help: "\uE405", mediaMusic: "\uE386", menuButton: "\uE3EC", moreActions: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE34B";
+ else
+ return WinJS.UI.AppBarIcon.more
+ }
+ }, music: "\uE41A", nowPlaying: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE335";
+ else
+ return MS.Entertainment.UI.Icon.inlineNowPlaying
+ }
+ }, pause: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE40C";
+ else
+ return "\uE103"
+ }
+ }, play: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE40D";
+ else
+ return "\uE102"
+ }
+ }, player: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE301";
+ else
+ return WinJS.UI.AppBarIcon.contact
+ }
+ }, playerSignIn: "\uE2FC", playlistMusic: "\uE2E9", playlistImport: "\uE3CA", restart: "\uE3C0", toggleMenu: "\uE332", shuffleOn: "\uE3C9", store: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE3A0";
+ else
+ return WinJS.UI.AppBarIcon.shop
+ }
+ }, refresh: "\uE3C3", "delete": {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE359";
+ else
+ return WinJS.UI.AppBarIcon.delete
+ }
+ }, search: {
+ get: function () {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE3F7";
+ else
+ return WinJS.UI.AppBarIcon.find
+ }
+ }, volumeDisabled: "\uE2E6", watchlist: "\uE2E9", fixupIcons: function fixupIcons() {
+ if (WinJS.UI.AppBarIcon.previous.indexOf("ms") !== -1)
+ (function () {
+ delete WinJS.UI.AppBarIcon;
+ WinJS.Namespace.define("WinJS.UI.AppBarIcon", {
+ previous: "", next: "", play: "", pause: "", edit: "", save: "", clear: "", "delete": "", remove: "", add: "", cancel: "", accept: "", more: "", redo: "", undo: "", home: "", up: "", forward: "", right: "", back: "", left: "", favorite: "", camera: "", settings: "", video: "", sync: "", download: "", mail: "", find: "", help: "", upload: "", emoji: "", twopage: "", leavechat: "", mailforward: "", clock: "", send: "", crop: "", rotatecamera: "", people: "", closepane: "", openpane: "", world: "", flag: "", previewlink: "", globe: "", trim: "", attachcamera: "", zoomin: "", bookmarks: "", document: "", protecteddocument: "", page: "", bullets: "", comment: "", mail2: "", contactinfo: "", hangup: "", viewall: "", mappin: "", phone: "", videochat: "", "switch": "", contact: "", rename: "", pin: "", musicinfo: "", go: "", keyboard: "", dockleft: "", dockright: "", dockbottom: "", remote: "", refresh: "", rotate: "", shuffle: "", list: "", shop: "", selectall: "", orientation: "", "import": "", importall: "", browsephotos: "", webcam: "", pictures: "", savelocal: "", caption: "", stop: "", showresults: "", volume: "", repair: "", message: "", page2: "", calendarday: "", calendarweek: "", calendar: "", characters: "", mailreplyall: "", read: "", link: "", accounts: "", showbcc: "", hidebcc: "", cut: "", attach: "", paste: "", filter: "", copy: "", emoji2: "", important: "", mailreply: "", slideshow: "", sort: "", manage: "", allapps: "", disconnectdrive: "", mapdrive: "", newwindow: "", openwith: "", contactpresence: "", priority: "", uploadskydrive: "", gototoday: "", font: "", fontcolor: "", contact2: "", folder: "", audio: "", placeholder: "", view: "", setlockscreen: "", settile: "", cc: "", stopslideshow: "", permissions: "", highlight: "", disableupdates: "", unfavorite: "", unpin: "", openlocal: "", mute: "", italic: "", underline: "", bold: "", movetofolder: "", likedislike: "", dislike: "", like: "", alignright: "", aligncenter: "", alignleft: "", zoom: "", zoomout: "", openfile: "", otheruser: "", admin: "", street: "", map: "", clearselection: "", fontdecrease: "", fontincrease: "", fontsize: "", cellphone: "", reshare: "", tag: "", repeatone: "", repeatall: "", outlinestar: "", solidstar: "", calculator: "", directions: "", target: "", library: "", phonebook: "", memo: "", microphone: "", postupdate: "", backtowindow: "", fullscreen: "", newfolder: "", calendarreply: "", unsyncfolder: "", reporthacked: "", syncfolder: "", blockcontact: "", switchapps: "", addfriend: "", touchpointer: "", gotostart: "", zerobars: "", onebar: "", twobars: "", threebars: "", fourbars: ""
+ })
+ })()
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI", {
+ FWLink: {
+ musicLibraries: "http://go.microsoft.com/fwlink/?LinkId=231829", videoLibraries: "http://go.microsoft.com/fwlink/?LinkId=267525", learnMore: "http://go.microsoft.com/fwlink/?LinkId=267489", cloudGrovelLearnMore: "http://go.microsoft.com/fwlink/?LinkId=280203", cloudGrovelPartialMatchLearnMore: "http://go.microsoft.com/fwlink/?LinkId=286257", cloudContentV2GetMoreInfo: "http://go.microsoft.com/fwlink/?LinkId=512463", advertisementReason: "http://go.microsoft.com/fwlink/?LinkID=282137", musicIntro: "http://go.microsoft.com/fwlink/?LinkID=285375"
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ _sounds: {
+ initialized: false, backButtonClick: null, disabledButtonClick: null, elementFocus1: null, elementFocus2: null, elementFocus3: null, elementFocus4: null, overlayIn: null, overlayOut: null, pageTransitionLeft: null, pageTransitionRight: null, selectButtonClick: null, selectButtonPressingKinect: null, virtualKeyboardFocus: null, virtualKeyboardSelect: null
+ }, initializeSounds: function initializeSounds() {
+ if (MS.Entertainment.Utilities.isApp2 && App2 && App2.SoundClips.Audio && !MS.Entertainment.Utilities._sounds.initialized) {
+ MS.Entertainment.Utilities._sounds.backButtonClick = App2.SoundClips.BackButtonClick;
+ MS.Entertainment.Utilities._sounds.disabledButtonClick = App2.SoundClips.DisabledButtonClick;
+ MS.Entertainment.Utilities._sounds.elementFocus1 = App2.SoundClips.ElementFocus1;
+ MS.Entertainment.Utilities._sounds.elementFocus2 = App2.SoundClips.ElementFocus2;
+ MS.Entertainment.Utilities._sounds.elementFocus3 = App2.SoundClips.ElementFocus3;
+ MS.Entertainment.Utilities._sounds.elementFocus4 = App2.SoundClips.ElementFocus4;
+ MS.Entertainment.Utilities._sounds.overlayIn = App2.SoundClips.OverlayIn;
+ MS.Entertainment.Utilities._sounds.overlayOut = App2.SoundClips.OverlayOut;
+ MS.Entertainment.Utilities._sounds.pageTransitionLeft = App2.SoundClips.PageTransitionLeft;
+ MS.Entertainment.Utilities._sounds.pageTransitionRight = App2.SoundClips.PageTransitionRight;
+ MS.Entertainment.Utilities._sounds.selectButtonClick = App2.SoundClips.SelectButtonClick;
+ MS.Entertainment.Utilities._sounds.initialized = true
+ }
+ }, playBackButtonClick: function playBackButtonClick() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.backButtonClick)
+ MS.Entertainment.Utilities._sounds.backButtonClick.play()
+ }, playDisabledButtonClick: function playDisabledButtonClick() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.disabledButtonClick)
+ MS.Entertainment.Utilities._sounds.disabledButtonClick.play()
+ }, playElementFocus1: function playElementFocus1() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus1)
+ MS.Entertainment.Utilities._sounds.elementFocus1.play()
+ }, playElementFocus2: function playElementFocus2() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus2)
+ MS.Entertainment.Utilities._sounds.elementFocus2.play()
+ }, playElementFocus3: function playElementFocus3() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus3)
+ MS.Entertainment.Utilities._sounds.elementFocus3.play()
+ }, playElementFocus4: function playElementFocus4() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus4)
+ MS.Entertainment.Utilities._sounds.elementFocus4.play()
+ }, playOverlayIn: function playOverlayIn() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.overlayIn)
+ MS.Entertainment.Utilities._sounds.overlayIn.play()
+ }, playOverlayOut: function playOverlayOut() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.overlayOut)
+ MS.Entertainment.Utilities._sounds.overlayOut.play()
+ }, playPageTransitionLeft: function playPageTransitionLeft() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.pageTransitionLeft)
+ MS.Entertainment.Utilities._sounds.pageTransitionLeft.play()
+ }, playPageTransitionRight: function playPageTransitionRight() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.pageTransitionRight)
+ MS.Entertainment.Utilities._sounds.pageTransitionRight.play()
+ }, playSelectButtonClick: function playSelectButtonClick() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.selectButtonClick)
+ MS.Entertainment.Utilities._sounds.selectButtonClick.play()
+ }, playRandomFocusSound: function playRandomFocusSound() {
+ MS.Entertainment.Utilities.initializeSounds();
+ var indexOfFocusSoundToPlay = Math.ceil(Math.random() * 4);
+ switch (indexOfFocusSoundToPlay) {
+ case 1:
+ MS.Entertainment.Utilities.playElementFocus1();
+ break;
+ case 2:
+ MS.Entertainment.Utilities.playElementFocus2();
+ break;
+ case 3:
+ MS.Entertainment.Utilities.playElementFocus3();
+ break;
+ case 4:
+ MS.Entertainment.Utilities.playElementFocus4();
+ break;
+ default:
+ MS.Entertainment.Utilities.playElementFocus1();
+ break
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ stringify: function stringify(obj) {
+ try {
+ return JSON.stringify(obj)
+ }
+ catch (ex) {
+ return obj.toString()
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ MediaSubtypeIds: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return {
+ "00000016-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB32",
+ "00000015-0000-0010-8000-00AA00389B71": "MFVideoFormat_ARGB32",
+ "00000014-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB24",
+ "00000018-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB555",
+ "00000017-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB565",
+ "00000029-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB8",
+ "34344941-0000-0010-8000-00AA00389B71": "MFVideoFormat_AI44",
+ "56555941-0000-0010-8000-00AA00389B71": "MFVideoFormat_AYUV",
+ "32595559-0000-0010-8000-00AA00389B71": "MFVideoFormat_YUY2",
+ "55595659-0000-0010-8000-00AA00389B71": "MFVideoFormat_YVYU",
+ "39555659-0000-0010-8000-00AA00389B71": "MFVideoFormat_YVU9",
+ "59565955-0000-0010-8000-00AA00389B71": "MFVideoFormat_UYVY",
+ "3131564E-0000-0010-8000-00AA00389B71": "MFVideoFormat_NV11",
+ "3231564E-0000-0010-8000-00AA00389B71": "MFVideoFormat_NV12",
+ "32315659-0000-0010-8000-00AA00389B71": "MFVideoFormat_YV12",
+ "30323449-0000-0010-8000-00AA00389B71": "MFVideoFormat_I420",
+ "56555949-0000-0010-8000-00AA00389B71": "MFVideoFormat_IYUV",
+ "30313259-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y210",
+ "36313259-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y216",
+ "30313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y410",
+ "36313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y416",
+ "50313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y41P",
+ "54313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y41T",
+ "54323459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y42T",
+ "30313250-0000-0010-8000-00AA00389B71": "MFVideoFormat_P210",
+ "36313250-0000-0010-8000-00AA00389B71": "MFVideoFormat_P216",
+ "30313050-0000-0010-8000-00AA00389B71": "MFVideoFormat_P010",
+ "36313050-0000-0010-8000-00AA00389B71": "MFVideoFormat_P016",
+ "30313276-0000-0010-8000-00AA00389B71": "MFVideoFormat_v210",
+ "36313276-0000-0010-8000-00AA00389B71": "MFVideoFormat_v216",
+ "30313476-0000-0010-8000-00AA00389B71": "MFVideoFormat_v410",
+ "3334504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MP43",
+ "5334504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MP4S",
+ "3253344D-0000-0010-8000-00AA00389B71": "MFVideoFormat_M4S2",
+ "5634504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MP4V",
+ "31564D57-0000-0010-8000-00AA00389B71": "MFVideoFormat_WMV1",
+ "32564D57-0000-0010-8000-00AA00389B71": "MFVideoFormat_WMV2",
+ "33564D57-0000-0010-8000-00AA00389B71": "MFVideoFormat_WMV3",
+ "31435657-0000-0010-8000-00AA00389B71": "MFVideoFormat_WVC1",
+ "3153534D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MSS1",
+ "3253534D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MSS2",
+ "3147504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MPG1",
+ "6C737664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVSL",
+ "64737664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVSD",
+ "64687664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVHD",
+ "35327664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DV25",
+ "30357664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DV50",
+ "31687664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVH1",
+ "20637664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVC",
+ "34363248-0000-0010-8000-00AA00389B71": "MFVideoFormat_H264",
+ "47504A4D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MJPG",
+ "4F303234-0000-0010-8000-00AA00389B71": "MFVideoFormat_420O",
+ "43564548-0000-0010-8000-00AA00389B71": "MFVideoFormat_HEVC",
+ "53564548-0000-0010-8000-00AA00389B71": "MFVideoFormat_HEVC_ES",
+ "33363248-0000-0010-8000-00AA00389B71": "MFVideoFormat_H263",
+ "3F40F4F0-5622-4FF8-B6D8-A17A584BEE5E": "MFVideoFormat_H264_ES",
+ "E06D8026-DB46-11CF-B4D1-00805F6CBBEA": "MFVideoFormat_MPEG2",
+ "00000001-0000-0010-8000-00AA00389B71": "MFAudioFormat_PCM",
+ "00000003-0000-0010-8000-00AA00389B71": "MFAudioFormat_Float",
+ "00000008-0000-0010-8000-00AA00389B71": "MFAudioFormat_DTS",
+ "00000092-0000-0010-8000-00AA00389B71": "MFAudioFormat_Dolby_AC3_SPDIF",
+ "00000009-0000-0010-8000-00AA00389B71": "MFAudioFormat_DRM",
+ "00000161-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMAudioV8",
+ "00000162-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMAudioV9",
+ "00000163-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMAudio_Lossless",
+ "00000164-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMASPDIF",
+ "0000000A-0000-0010-8000-00AA00389B71": "MFAudioFormat_MSP1",
+ "00000055-0000-0010-8000-00AA00389B71": "MFAudioFormat_MP3",
+ "0000f1ac-0000-0010-8000-00aa00389b71": "MFAudioFormat_FLAC",
+ "00000050-0000-0010-8000-00AA00389B71": "MFAudioFormat_MPEG",
+ "00001610-0000-0010-8000-00AA00389B71": "MFAudioFormat_AAC",
+ "00001600-0000-0010-8000-00AA00389B71": "MFAudioFormat_ADTS",
+ "00007361-0000-0010-8000-00AA00389B71": "MFAudioFormat_AMR_NB",
+ "00007362-0000-0010-8000-00AA00389B71": "MFAudioFormat_AMR_WB",
+ "00007363-0000-0010-8000-00AA00389B71": "MFAudioFormat_AMR_WP",
+ "E06D802C-DB46-11CF-B4D1-00805F6CBBEA": "MFAudioFormat_Dolby_AC3",
+ "A7FB87AF-2D02-42FB-A4D4-05CD93843BDD": "MFAudioFormat_Dolby_DDPlus",
+ "00000000-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_WAVEFORMATEX",
+ "6DBA3190-67BD-11CF-A0F7-0020AFD156E4": "KSDATAFORMAT_SUBTYPE_ANALOG",
+ "00000006-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_ALAW",
+ "00000007-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_MULAW",
+ "00000002-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_ADPCM",
+ "36523B21-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO",
+ "36523B22-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO",
+ "36523B23-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO",
+ "36523B24-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO",
+ "36523B25-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO",
+ "A0AF4F81-E163-11D0-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_DSS_VIDEO",
+ "A0AF4F82-E163-11D0-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_DSS_AUDIO",
+ "E436EB80-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_MPEG1Packet",
+ "E436EB81-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_MPEG1Payload",
+ "E436EB86-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_MPEG1Video",
+ "E06D802B-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO",
+ "E06D8032-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_LPCM_AUDIO",
+ "00000003-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_MPEG1",
+ "00000004-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_MPEG2",
+ "00000005-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_MPEG3",
+ "00000006-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_AAC",
+ "00000008-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_ATRAC",
+ "00000009-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_ONE_BIT_AUDIO",
+ "0000000A-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL_PLUS",
+ "0000000B-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DTS_HD",
+ "0000000C-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_MLP",
+ "0000000D-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DST",
+ "E06D8033-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_DTS_AUDIO",
+ "E06D8034-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_SDDS_AUDIO",
+ "E06D802D-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_SUBPICTURE",
+ "5A9B6A40-1A22-11D1-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_VPVideo",
+ "5A9B6A41-1A22-11D1-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_VPVBI",
+ "19E4A5AA-5662-4FC5-A0C0-1758028E1057": "KSDATAFORMAT_SUBTYPE_JPEG",
+ "CA20D9A0-3E3E-11D1-9BF9-00C04FBBDEBF": "KSDATAFORMAT_SUBTYPE_RAW8",
+ "33214CC1-011F-11D2-B4B1-00A0D102CFBE": "KSDATAFORMAT_SUBTYPE_CC",
+ "F72A76E2-EB0A-11D0-ACE4-0000C0CC16BA": "KSDATAFORMAT_SUBTYPE_NABTS",
+ "F72A76E3-EB0A-11D0-ACE4-0000C0CC16BA": "KSDATAFORMAT_SUBTYPE_TELETEXT",
+ "E757BCA1-39AC-11D1-A9F5-00C04FBBDE8F": "KSDATAFORMAT_SUBTYPE_NABTS_FEC",
+ "E436EB7F-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_OVERLAY",
+ "6E8D4A22-310C-11D0-B79A-00AA003767A7": "KSDATAFORMAT_SUBTYPE_Line21_BytePair",
+ "6E8D4A23-310C-11D0-B79A-00AA003767A7": "KSDATAFORMAT_SUBTYPE_Line21_GOPPacket"
+ }
+ }), getMediaSubtypeNameFromGuid: function getMediaSubtypeNameFromGuid(guid) {
+ var subtypeName = String.empty;
+ if (guid) {
+ var trimmedGuid = MS.Entertainment.Utilities.trimGuid(guid).toUpperCase();
+ subtypeName = MS.Entertainment.Utilities.MediaSubtypeIds[trimmedGuid] || trimmedGuid || String.empty
+ }
+ return subtypeName
+ }
+ })
+ })()
+})();
+/* >>>>>>/framework/servicelocator.js:13584 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Services");
+ var ServiceEntry = WinJS.Class.define(function (factory, isCritical) {
+ this._factory = factory;
+ this.isCritical = isCritical
+ }, {
+ isCritical: false, _factory: null, _cache: null, service: function service() {
+ if (!this._cache)
+ this._cache = this._factory();
+ return this._cache
+ }, reset: function reset() {
+ if (this._cache && this._cache.dispose)
+ this._cache.dispose();
+ this._cache = null
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment", {
+ ServiceLocator: MS.Entertainment.UI.Framework.define(function () {
+ throw "ServiceLocator contains only static methods.";
+ }, {}, {
+ _serviceTable: {}, _validateIdentifierOrThrow: function _validateIdentifierOrThrow(candidateIdentifier) {
+ if (!MS.Entertainment.Services.hasOwnProperty(candidateIdentifier))
+ throw "Unknown service identifier passed into Service Locator: " + candidateIdentifier;
+ }, getService: function getService(identifier) {
+ var serviceTable = this._serviceTable;
+ var serviceEntry = null;
+ this._validateIdentifierOrThrow(identifier);
+ if (!serviceTable.hasOwnProperty(identifier)) {
+ MS.Entertainment.Services.fail("Attempt to retrieve a service that has not been registered: " + identifier);
+ return null
+ }
+ serviceEntry = serviceTable[identifier];
+ return serviceEntry.service()
+ }, isServiceRegistered: function isServiceRegistered(identifier) {
+ return !!this._serviceTable.hasOwnProperty(identifier)
+ }, register: function register(identifier, factory, isCritical) {
+ var serviceTable = this._serviceTable;
+ this._validateIdentifierOrThrow(identifier);
+ if (serviceTable.hasOwnProperty(identifier))
+ throw "Attempt to register a second service for an already registered service identifier: " + identifier;
+ if (typeof factory !== "function")
+ throw "Attempt to register something besides a function as a service factory: " + identifier;
+ serviceTable[identifier] = new ServiceEntry(factory, isCritical)
+ }, unregister: function unregister(identifier) {
+ var serviceEntry;
+ var serviceTable = this._serviceTable;
+ this._validateIdentifierOrThrow(identifier);
+ serviceEntry = serviceTable[identifier];
+ if (serviceEntry)
+ serviceEntry.reset();
+ delete serviceTable[identifier]
+ }, cleanupNonCriticalServices: function cleanupNonCriticalServices() {
+ var serviceTable = this._serviceTable;
+ for (var id in serviceTable) {
+ if (serviceTable[id].isCritical)
+ continue;
+ serviceTable[id].reset()
+ }
+ }, getTestHooks: function getTestHooks() {
+ var that = this;
+ var testHooks = null;
+ testHooks = {
+ getServiceTable: function getServiceTable() {
+ return that._serviceTable
+ }
+ };
+ return testHooks
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Services", {
+ actions: "actions", adService: "adService", anonymousFreePlay: "anonymousFreePlay", appNotification: "appNotification", appToolbar: "appToolbar", applicationStateManager: "applicationStateManager", assetDetails: "assetDetails", backButton: "backButton", bookmarkOperationsWatcher: "bookmarkOperationsWatcher", contentRestrictionService: "contentRestrictionService", contentRestrictionStateHandler: "contentRestrictionStateHandler", cloudCollection: "cloudCollection", cloudRestrictionCollection: "cloudRestrictionCollection", collectionChangeNotifier: "collectionChangeNotifier", contextualCommandService: "contextualCommandService", dashboardRefresher: "dashboardRefresher", dateTimeFormatters: "dateTimeFormatters", dragData: "dragData", featureEnablement: "featureEnablement", findFriends: "findFriends", fileTransfer: "fileTransfer", fileTransferNotifications: "fileTransferNotifications", freePlayLimits: "freePlayLimits", gamesPurchaseHistory: "gamesPurchaseHistory", graceNoteService: "graceNoteService", idleApplicationService: "idleApplicationService", informationArchitecture: "informationArchitecture", interactionNotifier: "interactionNotifier", knownFolders: "knownFolders", listNotification: "listNotification", marketplace: "marketplace", mediaStore: "mediaStore", musicStateHandler: "musicStateHandler", navigation: "navigation", networkStatus: "networkStatus", nowPlayingControlManager: "nowPlayingControlManager", nowPlayingViewModel: "nowPlayingViewModel", mediaDeleted: "mediaDeleted", pinnedList: "pinnedList", pinToStartScreen: "pinToStartScreen", pinToStartScreenInterop: "pinToStartScreenInterop", playbackErrorDisplayService: "playbackErrorDisplayService", playbackEventNotifications: "playbackEventNotifications", playlists: "playlists", playToReceiverNativeService: "playToReceiverNativeService", progressNotification: "progressNotification", purchaseFlowProvider: "purchaseFlowProvider", purchaseHistory: "purchaseHistory", richPresence: "richPresence", readingCloudCollection: "readingCloudCollection", sessionManager: "sessionManager", searchResultCounts: "searchResultCounts", shareDecoder: "shareDecoder", shareEncoder: "shareEncoder", shareHost: "shareHost", shareSender: "shareSender", shareTarget: "shareTarget", shortcutManager: "shortcutManager", signedInUser: "signedInUser", signIn: "signIn", smartDJList: "smartDJList", syncManager: "syncManager", systemMTCMetadataUpdater: "systemMTCMetadataUpdater", tileManager: "tileManager", trackRestrictionCollection: "trackRestrictionCollection", typeToSearch: "typeToSearch", uiState: "uiState", upgradeReminderDisplayer: "upgradeReminderDisplayer", userEngagementService: "userEngagementService", userLibraryManager: "userLibraryManager", userTimeTelemetryManager: "userTimeTelemetryManager", userUsageData: "userUsageData", videoCloudCollection: "videoCloudCollection", videoDetailsUiState: "videoDetailsUiState", volumeService: "volumeService", watchlistService: "watchlistService", watchlistProviderService: "watchlistProviderService", welcomeDialogService: "welcomeDialogService", winJSNavigation: "winJSNavigation", xboxLive: "xboxLive", xhr: "xhr"
+ })
+ })()
+})();
+/* >>>>>>/framework/musicserviceidentifiers.js:13660 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var Services;
+ (function (Services) {
+ Services.playbackPrivilegesNotifier = "playbackPrivilegesNotifier"
+ })(Services = Entertainment.Services || (Entertainment.Services = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/telemetryutilities.js:13675 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Utilities");
+ WinJS.Namespace.define("MS.Entertainment.Utilities.Telemetry", {
+ _adsClicked: [], _previewsPlayed: [], _enableLogging: false, _totalTimeCounterStart: 0, _somethingPlaying: false, _lastBufferedEvent: {}, openDataPoint: function openDataPoint() {
+ var platLog = Microsoft.Entertainment.Platform.Logging;
+ var dataPoint = new platLog.DataPoint(platLog.LoggingLevel.telemetry);
+ if (MS.Entertainment.Utilities.Telemetry._enableLogging && WebUnitExtensions.TelemetryDataPointWrapper)
+ dataPoint = new WebUnitExtensions.TelemetryDataPointWrapper(dataPoint);
+ return dataPoint
+ }, openKeystoneDataPoint: function openKeystoneDataPoint() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.keystone);
+ dataPoint.appendParameter(this.KeystoneParameterNames.Mode, this._getScreenMode());
+ return dataPoint
+ }, closeDataPoint: function closeDataPoint(dataPoint) {
+ if (MS.Entertainment.UI.Application && MS.Entertainment.UI.Application.Helpers && MS.Entertainment.UI.Application.Helpers.activationTelemetryData)
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData.push(dataPoint);
+ else
+ dataPoint.write()
+ }, appendUIPath: function appendUIPath(dataPoint) {
+ var currentLocation = MS.Entertainment.Utilities.getCurrentUserLocation();
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPath, currentLocation)
+ }, appendLastUIPath: function appendLastUIPath(dataPoint) {
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (service.canNavigateBack) {
+ var backStack = service._backStack;
+ var lastPage = backStack._stack[backStack._stack.length - 1];
+ var lastLocation = "None";
+ if (lastPage)
+ lastLocation = lastPage.page.iaNode.moniker;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.LastUIPath, lastLocation)
+ }
+ }, isCurrentPageSearchPage: function isCurrentPageSearchPage() {
+ var currentPage;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ if (currentPage && currentPage.overrideFragmentUrl)
+ if (MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp)
+ return currentPage.iaNode && currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.searchPage;
+ else
+ return currentPage.overrideFragmentUrl.match(/SearchNavStub.html$/i);
+ return false
+ }, _getScreenMode: function _getScreenMode() {
+ var currentMode = "Unknown";
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService)
+ if (uiStateService.isSnapped)
+ currentMode = "ViewSnapped";
+ else if (uiStateService.isFilled)
+ currentMode = "ViewFilled";
+ else
+ currentMode = "ViewFullscreen";
+ return currentMode
+ }, _anonymousUserId: null, _getUserIdValue: function _getUserIdValue() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).xuid;
+ else {
+ if (!this._anonymousUserId)
+ this._anonymousUserId = Microsoft.Entertainment.Marketplace.Marketplace.generateGuid();
+ return this._anonymousUserId
+ }
+ }, _getUsersValue: function _getUsersValue() {
+ var userId;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ userId = "x:" + MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).xuid;
+ else {
+ if (!this._anonymousUserId)
+ this._anonymousUserId = Microsoft.Entertainment.Marketplace.Marketplace.generateGuid();
+ userId = "a:" + this._anonymousUserId
+ }
+ return userId
+ }, _keystoneStarted: false, ensureKeystoneStarted: function ensureKeystoneStarted() {
+ if (!MS.Entertainment.Utilities.isVideoApp2 || this._keystoneStarted)
+ return;
+ this._keystoneStarted = true;
+ this.startKeystoneHeartbeat()
+ }, _keystoneHeartbeatTimerId: undefined, startKeystoneHeartbeat: function startKeystoneHeartbeat() {
+ if (MS.Entertainment.Utilities.isVideoApp2 && !this._keystoneHeartbeatTimerId) {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var heartbeatInterval = isNaN(config.telemetry.keystoneHeartbeatInterval) ? 30 * 1000 : config.telemetry.keystoneHeartbeatInterval;
+ this._keystoneHeartbeatTimerId = setInterval(function () {
+ MS.Entertainment.Utilities.Telemetry.logKeystoneEvent(MS.Entertainment.Utilities.Telemetry.KeystoneEvents.AppHeartbeat)
+ }, heartbeatInterval)
+ }
+ }, priceFromOffer: function priceFromOffer(media, offer) {
+ var price = String.empty;
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.album || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ if (offer && offer.price)
+ price = offer.price + " " + offer.priceCurrencyCode;
+ return price
+ }, mediaTypeNameForTelemetry: function mediaTypeNameForTelemetry(media) {
+ var name;
+ var mediaType = media && media.mediaType;
+ var defaultPlatformType = (media && media.defaultPlatformType) || String.empty;
+ var downloadType = media && media.downloadType;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (media.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo)
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicVideo;
+ else if (media.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.TVEpisode;
+ else
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Movie;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.TVSeries;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.TVSeason;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Artist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Album;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Song;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Playlist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ if (defaultPlatformType)
+ name = defaultPlatformType + " " + MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Game;
+ else
+ name = downloadType || MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Game;
+ break;
+ default:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ break
+ }
+ return name
+ }, internalLogTelemetryEvent: function internalLogTelemetryEvent(dataPoint, event) {
+ dataPoint.appendEventName(event);
+ for (var i = 2; i < arguments.length - 1; i += 2) {
+ var key = arguments[i];
+ var value = arguments[i + 1];
+ if (key && value !== undefined)
+ dataPoint.appendParameter(key, value)
+ }
+ this.closeDataPoint(dataPoint)
+ }, logTelemetryEvent: function logTelemetryEvent(event) {
+ var dataPoint = this.openDataPoint();
+ var args = Array.prototype.slice.call(arguments);
+ args.unshift(dataPoint);
+ this.internalLogTelemetryEvent.apply(this, args)
+ }, logKeystoneEvent: function (event) {
+ if (!MS.Entertainment.Utilities.isVideoApp2)
+ return;
+ var dataPoint = this.openKeystoneDataPoint();
+ var args = Array.prototype.slice.call(arguments);
+ args.unshift(dataPoint);
+ this.internalLogTelemetryEvent.apply(this, args)
+ }, logTelemetryEventWithParameterArray: function logTelemetryEventWithParameterArray(event, parameterArray) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(event);
+ for (var i = 0; i < parameterArray.length; i++)
+ if (parameterArray[i].parameterName && parameterArray[i].parameterValue !== undefined && parameterArray[i].parameterValue !== null)
+ dataPoint.appendParameter(parameterArray[i].parameterName, parameterArray[i].parameterValue);
+ else
+ MS.Entertainment.Utilities.fail("logTelemetryEventWithParameterArray called with invalid parameterArray element. Event: " + event);
+ this.closeDataPoint(dataPoint)
+ }, logTelemetryEventWithUIPath: function logTelemetryEventWithUIPath(event, parameterArray) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(event);
+ this.appendUIPath(dataPoint);
+ if (parameterArray)
+ for (var i = 0; i < parameterArray.length; i++)
+ if (parameterArray[i].parameterName && parameterArray[i].parameterValue !== undefined && parameterArray[i].parameterValue !== null)
+ dataPoint.appendParameter(parameterArray[i].parameterName, parameterArray[i].parameterValue);
+ else
+ MS.Entertainment.Utilities.fail("logTelemetryEventWithUIPath called with invalid parameterArray element. Event: " + event);
+ this.closeDataPoint(dataPoint)
+ }, logSearchEnter: function logSearchEnter(media) {
+ var Queries = Microsoft.Entertainment.Queries;
+ if (!media || (media.videoType !== Queries.VideoType.movie && media.mediaType !== Queries.ObjectType.tvSeries && media.mediaType !== Queries.ObjectType.person && media.mediaType !== Queries.ObjectType.album && media.mediaType !== Queries.ObjectType.track))
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchEnter);
+ this.appendUIPath(dataPoint);
+ this.appendLastUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EDSSearch, true);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ var mediaName = media.name || String.empty;
+ var bingId = media.canonicalId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var zuneId = media.zuneId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var impressionGuid = media.impressionGuid || MS.Entertainment.Utilities.EMPTY_GUID;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SearchImpressionGuid, impressionGuid);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, mediaName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, bingId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, zuneId);
+ this.closeDataPoint(dataPoint)
+ }, logSearchExit: function logSearchExit(media) {
+ var Queries = Microsoft.Entertainment.Queries;
+ if (!media || (media.videoType !== Queries.VideoType.movie && media.mediaType !== Queries.ObjectType.tvSeries && media.mediaType !== Queries.ObjectType.person && media.mediaType !== Queries.ObjectType.album && media.mediaType !== Queries.ObjectType.track))
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchExit);
+ this.appendUIPath(dataPoint);
+ this.appendLastUIPath(dataPoint);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ var mediaName = media.name || String.empty;
+ var bingId = media.canonicalId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var zuneId = media.zuneId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var inCollection = media.inCollection || false;
+ var impressionGuid = media.impressionGuid || MS.Entertainment.Utilities.EMPTY_GUID;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SearchImpressionGuid, impressionGuid);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, mediaName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, bingId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, zuneId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.InCollection, inCollection);
+ this.closeDataPoint(dataPoint)
+ }, logSearchWordWheelEnter: function logSearchWordWheel(title, mediaType, videoType) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchWordWheelEnter);
+ this.appendUIPath(dataPoint);
+ this.appendLastUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SelectedItemTitle, title);
+ var typeName = MS.Entertainment.Utilities.getMediaTypeName(mediaType, videoType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SelectedItemMediaType, typeName);
+ this.closeDataPoint(dataPoint)
+ }, logPlayPreview: function logPlayPreview(media, fromAd) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PreviewPlayed);
+ this.appendUIPath(dataPoint);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.FromAd, fromAd);
+ if (fromAd)
+ this._adsClicked.push(media.serviceId);
+ this._previewsPlayed.push(media.serviceId);
+ this.closeDataPoint(dataPoint)
+ }, logSubscriptionSignupPrePurchase: function logSubscriptionSignupPrePurchase(subscription) {
+ if (!subscription)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SubscriptionSignupPrePurchase);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OfferId, subscription.offerId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Title, subscription.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Price, subscription.price);
+ this.closeDataPoint(dataPoint)
+ }, logSubscriptionSignupPurchaseMade: function logSubscriptionSignupPurchaseMade(subscription) {
+ if (!subscription)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SubscriptionSignupPurchaseMade);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OfferId, subscription.offerId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Title, subscription.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Price, subscription.price);
+ this.closeDataPoint(dataPoint)
+ }, logPurchaseMade: function logPurchaseMade(media, offer) {
+ this.logPurchaseHappened(media, offer);
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PurchaseMade);
+ this.appendUIPath(dataPoint);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.seriesTitle + " " + media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProductGuid, media.seasonServiceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.seasonServiceId))
+ }
+ else {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProductGuid, media.serviceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.serviceId))
+ }
+ var price = this.priceFromOffer(media, offer);
+ if (price)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Price, price);
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ var licenseRight = offer.licenseRight;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.licenseRight, licenseRight)
+ }
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ var videoPostRollABTestName = MS.Entertainment.ViewModels.VideoPostRollHelpers.abTestName;
+ var videoPostRollABGroupName = MS.Entertainment.ViewModels.VideoPostRollHelpers.abGroupName;
+ if (videoPostRollABTestName && videoPostRollABGroupName) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABTestName, videoPostRollABTestName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABGroupName, videoPostRollABGroupName)
+ }
+ }
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.deepLinkSource) {
+ dataPoint.appendParameter("DeepLinkSource", uiStateService.deepLinkSource);
+ dataPoint.appendParameter("DeepLinkSourceID", uiStateService.deepLinkSourceID);
+ var secondsSinceLaunch = (Date.now() - uiStateService.deepLinkLaunchTime) / 1000;
+ dataPoint.appendParameter("DeepLinkSecondsSinceLaunch", secondsSinceLaunch)
+ }
+ var fromAd = false;
+ var fromPreview = false;
+ var i;
+ for (i = 0; i < this._adsClicked.length; i++)
+ if (this._adsClicked[i] === media.serviceId) {
+ fromAd = true;
+ break
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.FromAd, fromAd);
+ for (i = 0; i < this._previewsPlayed.length; i++)
+ if (this._previewsPlayed[i] === media.serviceId) {
+ fromPreview = true;
+ break
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.FromPreview, fromPreview);
+ this.closeDataPoint(dataPoint)
+ }, logVideoPurchaseAttempt: function logVideoPurchaseAttempt(media, offer, purchaseState) {
+ if (!media || !offer)
+ return;
+ this.logKeystoneVideoPurchase(media, offer, purchaseState);
+ if (!purchaseState || purchaseState === this.PurchaseStates.Succeeded)
+ this.logPurchaseMade(media, offer)
+ }, logKeystoneVideoPurchase: function logKeystoneVideoPurchase(media, offer, purchaseState) {
+ if (!media || !offer)
+ return;
+ var ObjectType = Microsoft.Entertainment.Queries.ObjectType;
+ var ServiceLocator = MS.Entertainment.ServiceLocator;
+ var Services = MS.Entertainment.Services;
+ var telemetryParams = [this.KeystoneEvents.Purchase];
+ var offerId = offer.offerId;
+ if (offerId)
+ telemetryParams.push(this.KeystoneParameterNames.OfferId, offerId);
+ var mediaType = media.mediaType;
+ var mediaTypeName = this.mediaTypeNameForTelemetry(media);
+ telemetryParams.push(this.KeystoneParameterNames.MediaType, mediaTypeName);
+ var mediaName,
+ mediaId;
+ if (mediaType === ObjectType.tvSeason) {
+ mediaName = media.seriesTitle + " " + media.name;
+ mediaId = media.seasonServiceId
+ }
+ else {
+ mediaName = media.name;
+ mediaId = media.serviceId
+ }
+ telemetryParams.push(this.KeystoneParameterNames.MediaName, mediaName);
+ var correlationId = MS.Entertainment.Utilities.Telemetry.getCorrelationId(mediaId);
+ if (correlationId)
+ telemetryParams.push(this.KeystoneParameterNames.CorrelationId, correlationId);
+ var price = this.priceFromOffer(media, offer);
+ if (price)
+ telemetryParams.push(this.KeystoneParameterNames.Price, price);
+ if (mediaType === ObjectType.video || mediaType === ObjectType.tvSeason) {
+ var rightsTelemetryParams = this._getKeystoneVideoRightsTelemetry(media, mediaType, offer);
+ if (rightsTelemetryParams && Array.isArray(rightsTelemetryParams))
+ telemetryParams = telemetryParams.concat(rightsTelemetryParams)
+ }
+ var bingId = media.canonicalId;
+ if (bingId && !MS.Entertainment.Utilities.isEmptyGuid(bingId))
+ telemetryParams.push(this.KeystoneParameterNames.BingId, bingId);
+ var zuneId = media.zuneId;
+ if (zuneId && !MS.Entertainment.Utilities.isEmptyGuid(zuneId))
+ telemetryParams.push(this.KeystoneParameterNames.ZuneId, zuneId);
+ if (ServiceLocator.isServiceRegistered(Services.signedInUser)) {
+ var signedInUserService = ServiceLocator.getService(Services.signedInUser);
+ var locale = signedInUserService.locale;
+ if (locale)
+ telemetryParams.push(this.KeystoneParameterNames.Locale, locale)
+ }
+ if (ServiceLocator.isServiceRegistered(Services.navigation)) {
+ var navigationService = ServiceLocator.getService(Services.navigation);
+ var pageMonikers = navigationService.getBackStackPageMonikers();
+ var currentPageMoniker = WinJS.Utilities.getMember("currentPage.iaNode.moniker", navigationService);
+ if (currentPageMoniker)
+ pageMonikers.push(currentPageMoniker);
+ var uiPath;
+ if (pageMonikers && Array.isArray(pageMonikers))
+ uiPath = pageMonikers.reduce(function (prev, curr) {
+ return prev + " / " + curr
+ });
+ if (uiPath)
+ telemetryParams.push(this.KeystoneParameterNames.UiPath, uiPath)
+ }
+ telemetryParams.push(this.KeystoneParameterNames.State, purchaseState);
+ this.logKeystoneEvent.apply(this, telemetryParams)
+ }, _getKeystoneVideoRightsTelemetry: function _getKeystoneVideoRightsTelemetry(media, mediaType, offer) {
+ var ObjectType = Microsoft.Entertainment.Queries.ObjectType;
+ var MarketplaceRight = MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight;
+ var telemetryParams = [];
+ if (mediaType === ObjectType.video) {
+ var mediaInstanceId = offer.mediaInstanceId;
+ if (mediaInstanceId)
+ telemetryParams.push(this.KeystoneParameterNames.MediaInstanceId, mediaInstanceId);
+ var videoDefinition = offer.videoDefinition;
+ if (videoDefinition)
+ telemetryParams.push(this.KeystoneParameterNames.VideoDefinition, videoDefinition);
+ var videoCodec = offer.videoEncoding;
+ if (videoCodec)
+ telemetryParams.push(this.KeystoneParameterNames.VideoCodec, videoCodec);
+ var audioLanguage = offer.primaryAudioLanguage;
+ if (audioLanguage)
+ telemetryParams.push(this.KeystoneParameterNames.AudioLanguage, audioLanguage);
+ var audioEncoding = offer.encoding;
+ if (audioEncoding)
+ telemetryParams.push(this.KeystoneParameterNames.AudioEncoding, audioEncoding);
+ var videoFileUrl = offer.videoFileUrl;
+ if (videoFileUrl)
+ telemetryParams.push(this.KeystoneParameterNames.VideoFileUrl, videoFileUrl);
+ var hasCaptions = media.hasCaptions;
+ telemetryParams.push(this.KeystoneParameterNames.HasCaptions, hasCaptions)
+ }
+ var deliveryFormat = offer.deliveryFormat;
+ if (deliveryFormat)
+ telemetryParams.push(this.KeystoneParameterNames.DeliveryFormat, deliveryFormat);
+ var paymentInstruments = offer.paymentInstruments;
+ var paymentInstrumentsString;
+ if (Array.isArray(paymentInstruments))
+ paymentInstrumentsString = paymentInstruments.join(", ");
+ else if (String.isString(paymentInstruments))
+ paymentInstrumentsString = paymentInstruments;
+ if (paymentInstrumentsString)
+ telemetryParams.push(this.KeystoneParameterNames.PaymentInstruments, paymentInstrumentsString);
+ var licenseRight = offer.licenseRight;
+ if (licenseRight) {
+ var acquisitionType;
+ if (licenseRight === MarketplaceRight.Rent || licenseRight === MarketplaceRight.RentStream)
+ acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Rental;
+ else
+ acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Purchase;
+ telemetryParams.push(this.KeystoneParameterNames.AcquisitionType, acquisitionType)
+ }
+ return telemetryParams
+ }, logShare: function logShare(sharePackage) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ShareCharm);
+ if (sharePackage && sharePackage.package) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ShareTitle, sharePackage.package.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ShareUri, sharePackage.package.uri);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaId, sharePackage.package.mediaId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, this.mediaTypeNameForTelemetry(sharePackage.package));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, sharePackage.package.mediaTitle)
+ }
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logAdClicked: function logAdClicked(adInfo) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.X8AdClicked);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AdInfo, adInfo);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, _logPlaybackControl: function _logPlaybackControl(controlUsed, whereUsed) {
+ var dataPoint = this.openDataPoint();
+ this.appendUIPath(dataPoint);
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackControl);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ControlUsed, controlUsed);
+ var whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown;
+ if (whereUsed.indexOf("nowPlayingTransportControls") !== -1 || whereUsed.indexOf("fullScreenNowPlaying-transportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.NowPlaying;
+ else if (whereUsed.indexOf("globalTransportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.GlobalAppbar;
+ else if (whereUsed.indexOf("appBarTransportControls") !== -1 || whereUsed.indexOf("appMenuHeader") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.AppBar;
+ else if (whereUsed.indexOf("homeHubNowPlayingTile") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.HomeNPTile;
+ else if (whereUsed.indexOf("snappedTransportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.SnappedAppBar;
+ else if (whereUsed.indexOf("mediaKey") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MediaKey;
+ else if (whereUsed.indexOf("voiceCommand") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.VoiceCommand;
+ else if (whereUsed.indexOf("controls-") !== -1 || whereUsed.indexOf("adControls-") !== -1 || whereUsed.indexOf("currentItem-") !== -1 || whereUsed.indexOf("commonOverlays-transportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicTransportControls;
+ else
+ MS.Entertainment.Utilities.assert(false, "unrecognised location for playback control telemetry");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.WhereUsed, whereUsedMapped);
+ this.closeDataPoint(dataPoint)
+ }, logPlayClicked: function logPlayClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Play, whereUsed)
+ }, logPauseClicked: function logPauseClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Pause, whereUsed)
+ }, logStopClicked: function logStopClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Stop, whereUsed)
+ }, logPreviousClicked: function logPreviousClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Previous, whereUsed)
+ }, logNextClicked: function logNextClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Next, whereUsed)
+ }, logPlaybackAttempted: function logPlaybackAttempted(mediaInstance) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackAttempted);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, this._getNetworkStatus());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OSVersion, this._getOSVersion());
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logGetPreferredStreamSucceeded: function logGetPreferredStreamSucceeded(retries) {
+ this.logGetPreferredStreamResult(true, null, retries)
+ }, logGetPreferredStreamFailed: function logGetPreferredStreamFailed(reason, retries) {
+ this.logGetPreferredStreamResult(false, reason, retries)
+ }, logGetPreferredStreamResult: function logGetPreferredStreamResult(success, reason, retries) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.GetPreferredStreamResult);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Success, success);
+ if (reason)
+ if (reason.number)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Reason, reason.number);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Reason, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Reason, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Retries, retries ? retries : 0);
+ this.closeDataPoint(dataPoint)
+ }, logSemanticZoom: function logSemanticZoom(initMethod) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SemanticZoom);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MethodInitiated, initMethod);
+ this.closeDataPoint(dataPoint)
+ }, logVolumeSelected: function logVolumeSelected(value) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.VolumeSelected);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VolumeValue, value);
+ this.closeDataPoint(dataPoint)
+ }, logMuteStateSelected: function logMuteStateSelected(state) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MuteStateSelected);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MuteState, state);
+ this.closeDataPoint(dataPoint)
+ }, _correlationIds: {}, getCorrelationId: function getCorrelationId(serviceId) {
+ var correlationId = String.empty;
+ if (!MS.Entertainment.Utilities.isEmptyGuid(serviceId))
+ correlationId = MS.Entertainment.Utilities.Telemetry._correlationIds[serviceId] || String.empty;
+ return correlationId
+ }, setCorrelationId: function setCorrelationId(serviceId) {
+ if (!MS.Entertainment.Utilities.isEmptyGuid(serviceId))
+ MS.Entertainment.Utilities.Telemetry._correlationIds[serviceId] = Microsoft.Entertainment.Marketplace.Marketplace.generateGuid()
+ }, findCorrelationIdForMediaItem: function findCorrelationIdForMediaItem(mediaItem) {
+ var correlationId;
+ if (mediaItem) {
+ var possibleServiceIds = [mediaItem.serviceId, mediaItem.zuneId, mediaItem.canonicalId];
+ var mediaIsTVContent = MS.Entertainment.Utilities.isAnyTV(mediaItem);
+ if (mediaIsTVContent) {
+ possibleServiceIds.push(mediaItem.seriesId);
+ possibleServiceIds.push(mediaItem.seriesZuneId);
+ possibleServiceIds.push(mediaItem.seriesServiceId);
+ possibleServiceIds.push(mediaItem.canonicalSeriesId);
+ possibleServiceIds.push(mediaItem.seasonServiceId);
+ possibleServiceIds.push(mediaItem.canonicalSeasonId);
+ possibleServiceIds.push(mediaItem.seasonZuneId)
+ }
+ for (var i = 0; i < possibleServiceIds.length; i++) {
+ correlationId = MS.Entertainment.Utilities.Telemetry.getCorrelationId(possibleServiceIds[i]);
+ if (correlationId && MS.Entertainment.Utilities.isValidServiceId(correlationId))
+ break
+ }
+ }
+ return correlationId
+ }, getParentProductGuid: function getParentProductGuid(mediaItem) {
+ var parentProductId = String.empty;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(mediaItem))
+ parentProductId = mediaItem.seriesId;
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(mediaItem))
+ parentProductId = mediaItem.seasonServiceId || mediaItem.canonicalSeasonId || String.empty;
+ return parentProductId
+ }, _getNetworkStatus: function _getNetworkStatus() {
+ var isOnline = MS.Entertainment.UI.NetworkStatusService.isOnline() ? "online" : "offline";
+ var networkStatusStringArray = ["unknown", "unrestricted", "throttled", "onDemand", "localOnly", "none"];
+ return isOnline + ":" + networkStatusStringArray[MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).networkStatus]
+ }, _getOSVersion: function _getOSVersion() {
+ var osVersion = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (MS.Entertainment.Utilities.isApp1) {
+ var versionRegex = /NT\s[\d.]+/;
+ var version = versionRegex.exec(window.navigator.appVersion);
+ if (version.length > 0)
+ osVersion = version[0]
+ }
+ else {
+ var developmentKitProperties = WinJS.Utilities.getMember("Windows.Xbox.System.Internal.DevelopmentKit.DevelopmentKitProperties");
+ if (developmentKitProperties)
+ osVersion = developmentKitProperties["shellVersion"]
+ }
+ return osVersion
+ }, _getFileExtensionFromMediaInstance: function getFileExtensionFromMediaInstance(mediaInstance) {
+ var extension = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ MS.Entertainment.Platform.Playback.assert(mediaInstance, "tried to determine path for undefined mediaInstance");
+ try {
+ if (mediaInstance) {
+ var path = String.empty;
+ if (!mediaInstance.isLocal && mediaInstance.source && !MS.Entertainment.Utilities.isBlobUrl(mediaInstance.source))
+ path = mediaInstance.source;
+ else if (mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ if (mediaInstance._mediaItem.data.filePath)
+ path = mediaInstance._mediaItem.data.filePath;
+ else if (mediaInstance._mediaItem.data.fileItem) {
+ if (mediaInstance._mediaItem.data.fileItem.fileType)
+ extension = mediaInstance._mediaItem.data.fileItem.fileType.toLowerCase();
+ else if (mediaInstance._mediaItem.data.fileItem.path)
+ path = mediaInstance._mediaItem.data.fileItem.path
+ }
+ else if (mediaInstance._mediaItem.data.fileType)
+ extension = mediaInstance._mediaItem.data.fileType.toLowerCase();
+ else if (mediaInstance._mediaItem.data.path)
+ path = mediaInstance._mediaItem.data.path;
+ if (path.length > 0)
+ extension = Windows.Foundation.Uri(path).extension.toLowerCase()
+ }
+ }
+ catch (e) {
+ MS.Entertainment.Platform.Playback.assert(false, "failed to determine extension for path")
+ }
+ if (!extension)
+ extension = "no extension";
+ return extension
+ }, _getUrlFromMediaInstance: function _getUrlFromMediaInstance(mediaInstance) {
+ var url = "undetermined";
+ MS.Entertainment.Platform.Playback.assert(mediaInstance, "tried to determine url for undefined mediaInstance");
+ if (mediaInstance)
+ if ((mediaInstance.isLocal && Microsoft.Entertainment.Configuration.ConfigurationManager().telemetry.flightId) || (!mediaInstance.isLocal && !MS.Entertainment.Utilities.isAmsterdamApp) || (!mediaInstance.isLocal && MS.Entertainment.Utilities.isAmsterdamApp && Microsoft.Entertainment.Configuration.ConfigurationManager().telemetry.flightId))
+ if (!mediaInstance.isLocal && mediaInstance.source && !MS.Entertainment.Utilities.isBlobUrl(mediaInstance.source))
+ url = mediaInstance.source;
+ else if (mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ if (mediaInstance._mediaItem.data.path)
+ url = mediaInstance._mediaItem.data.path;
+ else if (mediaInstance._mediaItem.data.fileItem && mediaInstance._mediaItem.data.fileItem.path)
+ url = mediaInstance._mediaItem.data.fileItem.path;
+ else if (mediaInstance._mediaItem.data.filePath)
+ url = mediaInstance._mediaItem.data.filePath;
+ return url
+ }, _getIsDrmFromMediaInstance: function _getDrmStateFromMediaInstance(mediaInstance) {
+ var isDRM = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (mediaInstance)
+ switch (mediaInstance.protectionState) {
+ case MS.Entertainment.Platform.Playback.ProtectionState.drmProtected:
+ isDRM = "true";
+ break;
+ case MS.Entertainment.Platform.Playback.ProtectionState.unprotected:
+ isDRM = "false";
+ break;
+ case MS.Entertainment.Platform.Playback.ProtectionState.unknown:
+ isDRM = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ break;
+ default:
+ MS.Entertainment.Platform.Playback.assert(false, "unknown protection state in logging");
+ break
+ }
+ return isDRM
+ }, _getIdFromMediaInstance: function _getIdFromMediaInstance(mediaInstance) {
+ var id = 0;
+ if (mediaInstance)
+ id = (mediaInstance.mediaInstanceId ? mediaInstance.mediaInstanceId : mediaInstance.libraryId);
+ return id
+ }, _getSmidFromMediaInstance: function _getSmidFromMediaInstance(mediaInstance) {
+ var id = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data && mediaInstance._mediaItem.data.zuneId)
+ id = mediaInstance._mediaItem.data.zuneId;
+ return id
+ }, _getParentSmidFromMediaInstance: function _getParentSmidFromMediaInstance(mediaInstance) {
+ return WinJS.Utilities.getMember("_mediaItem.data.seasonServiceId", mediaInstance) || WinJS.Utilities.getMember("_mediaItem.data.canonicalSeasonId", mediaInstance) || MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown
+ }, _getPlaybackSource: function _getPlaybackSource(mediaInstance) {
+ var playbackSource = MS.Entertainment.Platform.PlaybackHelpers.lastPlaybackSource;
+ var acquisitionData = WinJS.Utilities.getMember("_mediaItem.data.acquisitionData", mediaInstance);
+ if (acquisitionData) {
+ if (!playbackSource && acquisitionData.acquisitionContext)
+ playbackSource = MS.Entertainment.Utilities.getAcquisitionContextFromEnum(acquisitionData.acquisitionContext);
+ if (acquisitionData.acquisitionContextType)
+ playbackSource = (playbackSource ? playbackSource + ": " : String.empty) + MS.Entertainment.Utilities.getAcquisitionContextTypeFromEnum(acquisitionData.acquisitionContextType)
+ }
+ return playbackSource
+ }, _appendPlaybackCommonDataToDataPoint: function _appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint) {
+ try {
+ if (mediaInstance) {
+ var media = mediaInstance;
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ media = mediaInstance._mediaItem.data;
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ var isSubscription = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).isSubscription : "false";
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsSubscription, isSubscription);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsDrm, this._getIsDrmFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsStream, mediaInstance.isLocal ? "false" : "true");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Id, this._getIdFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Smid, this._getSmidFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ParentSmid, this._getParentSmidFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Extension, this._getFileExtensionFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Url, this._getUrlFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlaybackSource, this._getPlaybackSource(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsPreview, mediaInstance.isPreview ? "true" : "false");
+ var correlationId = MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.serviceId) || MS.Entertainment.Utilities.Telemetry.getCorrelationId(this._getParentSmidFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, correlationId)
+ }
+ else
+ MS.Entertainment.Utilities.assert(mediaInstance, "MediaInstance is null")
+ }
+ catch (ex) {
+ MS.Entertainment.Utilities.fail("Unable to append parameter to data point")
+ }
+ }, logPlaybackHappened: function logPlaybackHappened(mediaInstance) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackHappened);
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (uiStateService.isAppVisible) {
+ if (uiStateService.isSnapped)
+ playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.snapped;
+ else if (uiStateService.nowPlayingVisible || uiStateService.nowPlayingInset)
+ playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.nowplaying
+ }
+ else
+ playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.background;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlayLocation, playLocation);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, this._getNetworkStatus());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OSVersion, this._getOSVersion());
+ this.closeDataPoint(dataPoint)
+ }, shouldSkipLoggingPlaybackError: function shouldSkipLoggingPlaybackError(error, context) {
+ var shouldSkip = false;
+ if (error) {
+ if (context.search("forceError") >= 0)
+ return true;
+ var errorCode = (error.msExtendedCode) ? error.msExtendedCode : error.code;
+ switch (errorCode) {
+ case MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_HDMI_OUTPUT_LOST.code:
+ shouldSkip = true;
+ break
+ }
+ }
+ return shouldSkip
+ }, logMediaPlayerPlayback: function logMediaPlayerPlayback(item) {
+ var ItemType = MS.Entertainment.Data.MediaBrowser.ItemType;
+ if (!item || !item.hydrate || (item.itemType !== ItemType.video && item.itemType !== ItemType.music))
+ return;
+ item.hydrate().done(function () {
+ var telemetryParameterArray = [];
+ this._packBaseItemTelemetry(item, telemetryParameterArray);
+ var telemetryEventName;
+ if (item.itemType === ItemType.video) {
+ telemetryEventName = this.TelemetryEvents.MediaPlayerVideoPlayback;
+ this._packVideoItemTelemetry(item, telemetryParameterArray)
+ }
+ else if (item.itemType === ItemType.music) {
+ telemetryEventName = this.TelemetryEvents.MediaPlayerMusicPlayback;
+ this._packMusicItemTelemetry(item, telemetryParameterArray)
+ }
+ this.logTelemetryEventWithParameterArray(telemetryEventName, telemetryParameterArray)
+ }.bind(this))
+ }, _packBaseItemTelemetry: function _packBaseItemTelemetry(item, telemetryParameterArray) {
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.DriveType, parameterValue: item.driveType || MS.Entertainment.Data.MediaBrowser.DriveType.unknown
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.FileType, parameterValue: item.fileType || String.empty
+ })
+ }, _packVideoItemTelemetry: function _packVideoItemTelemetry(item, telemetryParameterArray) {
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.AudioCodec, parameterValue: item.audioCodec || MS.Entertainment.Utilities.EMPTY_GUID
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.VideoCodec, parameterValue: item.videoCodec || MS.Entertainment.Utilities.EMPTY_GUID
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.ResolutionHeight, parameterValue: item.height || -1
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.ResolutionWidth, parameterValue: item.width || -1
+ });
+ var orientation = item.orientation;
+ if (!isFinite(orientation) || orientation < 0 || orientation > 270 || orientation % 90 !== 0)
+ orientation = -1;
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Orientation, parameterValue: orientation
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Bitrate, parameterValue: item.bitrate || -1
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Duration, parameterValue: item.duration || -1
+ })
+ }, _packMusicItemTelemetry: function _packMusicItemTelemetry(item, telemetryParameterArray) {
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.AudioCodec, parameterValue: item.audioCodec || MS.Entertainment.Utilities.EMPTY_GUID
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Bitrate, parameterValue: item.bitrate || -1
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Duration, parameterValue: item.duration || -1
+ })
+ }, logPlaybackError: function logPlaybackError(mediaInstance, error, context) {
+ if (!mediaInstance)
+ return;
+ MS.Entertainment.UI.Controls.assert(error || mediaInstance._errorDescriptor, "null error passed to logPlaybackError");
+ if (!error && mediaInstance._errorDescriptor)
+ error = mediaInstance._errorDescriptor;
+ var errorContext = context || String.empty;
+ if (mediaInstance._errorDescriptor && mediaInstance._errorDescriptor.context && mediaInstance._errorDescriptor.context !== errorContext)
+ errorContext += (errorContext ? "; " : String.empty) + mediaInstance._errorDescriptor.context;
+ if (error && error.context && (errorContext !== error.context))
+ errorContext += (errorContext ? "; " : String.empty) + error.context;
+ if (this.shouldSkipLoggingPlaybackError(error, errorContext))
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackError);
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ var isSubscription = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).isSubscription : "false";
+ var mediaType = this.mediaTypeNameForTelemetry(mediaInstance._mediaItem.data);
+ var errorCode = error && error.code ? error.code : 0;
+ var msExtendedCode = error && error.msExtendedCode ? error.msExtendedCode : errorCode;
+ var networkStatus = this._getNetworkStatus();
+ var stackTraceLimitDefault = Error.stackTraceLimit;
+ Error.stackTraceLimit = Infinity;
+ var stackTrace = MS.Entertainment.UI.Debug.getStackTrace();
+ Error.stackTraceLimit = stackTraceLimitDefault;
+ stackTrace = stackTrace.replace(/.*at.*(winjs|Function\scode|CoreFX).*\)\n/g, String.empty).replace(/\(.+?.*\//g, "(").replace(/.*at\s/g, String.empty);
+ var stackTraceArray = stackTrace.split("\n");
+ stackTraceArray.reverse();
+ stackTrace = stackTraceArray.join("\n").substring(0, 2048);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, errorCode);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ExtendedCode, msExtendedCode);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorContext, errorContext);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, networkStatus);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OSVersion, this._getOSVersion());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.StackTrace, stackTrace);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError:" + " ErrorCode=" + MS.Entertainment.Platform.Playback.errorToString(errorCode) + "| msExtendedCode=" + MS.Entertainment.Platform.Playback.errorToString(msExtendedCode) + "| ErrorContext=" + errorContext + "| MediaType=" + mediaType + "| isSubscription=" + isSubscription + "| NetworkStatus=" + networkStatus + "| StackTrace=" + stackTrace);
+ this._getMediaInfo(mediaInstance).then(function onSuccess(mediaDetail) {
+ var audioSubtype = String.empty;
+ var videoSubtype = String.empty;
+ var mimeType = String.empty;
+ var sourceCharacter = String.empty;
+ if (mediaDetail) {
+ audioSubtype = mediaDetail.audioSubtype;
+ videoSubtype = mediaDetail.videoSubtype;
+ mimeType = mediaDetail.mimeType;
+ sourceCharacter = mediaDetail.sourceCharacter
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRAudioSubtype, audioSubtype);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRVideoSubtype, videoSubtype);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRMimeType, mimeType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRSourceCharacter, sourceCharacter);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRIsDRM, "false");
+ this.closeDataPoint(dataPoint);
+ if (mediaInstance.source && mediaInstance.source.match && mediaInstance.source.match(/^blob*:/i))
+ URL.revokeObjectURL(mediaInstance.source);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError: data from MF Source Reader" + " audioSubtype=" + audioSubtype + "| videoSubtype=" + videoSubtype + "| mimeType=" + mimeType + "| sourceCharacter=" + sourceCharacter + "| isDRM=false")
+ }.bind(this), function onError(error) {
+ if (error && error.number === MS.Entertainment.Platform.Playback.Error.MF_E_DRM_UNSUPPORTED.code) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRIsDRM, "true");
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError: data from MF Source Reader isDRM=true")
+ }
+ else {
+ var mfSRError = String.empty;
+ if (error)
+ mfSRError = MS.Entertainment.Platform.Playback.errorToString(error.number);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRError, mfSRError);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError: error from MF Source Reader" + " error=" + mfSRError)
+ }
+ this.closeDataPoint(dataPoint);
+ if (mediaInstance.source && mediaInstance.source.match && mediaInstance.source.match(/^blob*:/i))
+ URL.revokeObjectURL(mediaInstance.source)
+ }.bind(this))
+ }, _getMediaInfo: function _getMediaInfo(mediaInstance) {
+ var completion = null;
+ var error = null;
+ var promise = new WinJS.Promise(function (c, e, p) {
+ completion = c;
+ error = e
+ });
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (mediaInstance && mediaInstance.isLocal && mediaInstance.source && (MS.Entertainment.Utilities.isWindowsBlue || (MS.Entertainment.Utilities.isAmsterdamApp && configurationManager.amsterdam.onUsbErrorCodecRetrievalEnabled))) {
+ var getFileItemPromise = null;
+ var checkSizePromise = null;
+ var fileItem = null;
+ var retrieveCodecInfo = false;
+ if (mediaInstance._mediaItem.data.mediaType === "music")
+ fileItem = MS.Entertainment.Data.deflate(mediaInstance._mediaItem.data);
+ else if (mediaInstance._mediaItem.data.fileItem && (mediaInstance._mediaItem.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || mediaInstance._mediaItem.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.track))
+ fileItem = mediaInstance._mediaItem.data.fileItem;
+ if (fileItem)
+ getFileItemPromise = WinJS.Promise.as();
+ else {
+ var filePath = MS.Entertainment.Data.deflate(mediaInstance._mediaItem.data).FilePath;
+ if (filePath)
+ getFileItemPromise = Windows.Storage.StorageFile.getFileFromPathAsync(filePath).then(function onGetFileSuceeded(loadedFile) {
+ fileItem = loadedFile
+ }, function onGetFileFailed(error) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get a file item with error " + MS.Entertainment.Utilities.stringify(error));
+ completion(null);
+ return promise
+ });
+ else {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get a file item because the file path was invalid.");
+ completion(null);
+ return promise
+ }
+ }
+ return getFileItemPromise.then(function getFileSize() {
+ if (fileItem && WinJS.Utilities.getMember("properties.retrievePropertiesAsync", fileItem)) {
+ var requestedCodecProperties = ["System.Video.Compression", "System.Audio.Format", "System.MIMEType"];
+ return fileItem.properties.retrievePropertiesAsync(requestedCodecProperties).then(function onPropertiesRetrieved(codecProperties) {
+ var mediaDetail = {};
+ mediaDetail.videoSubtype = MS.Entertainment.Utilities.getMediaSubtypeNameFromGuid(codecProperties["System.Video.Compression"]);
+ mediaDetail.audioSubtype = MS.Entertainment.Utilities.getMediaSubtypeNameFromGuid(codecProperties["System.Audio.Format"]);
+ mediaDetail.mimeType = codecProperties["System.MIMEType"] ? codecProperties["System.MIMEType"] : "";
+ mediaDetail.sourceCharacter = String.empty;
+ completion(mediaDetail);
+ return promise
+ }, function onPropertiesFailed(error) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get file properties with error " + MS.Entertainment.Utilities.stringify(error));
+ completion(null)
+ })
+ }
+ else {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get file properties because we don't have a valid fileItem.");
+ completion(null);
+ return promise
+ }
+ })
+ }
+ else {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo(): Codec retrieval was prohibited by policy.");
+ completion(null);
+ return promise
+ }
+ }, logPlayerBufferState: function logPlayerBufferState(buffered, currentPosition, duration, playerType) {
+ var bufferingLevel = 1.0;
+ var minBufferedEventsIntervalMs = 15000;
+ var maxBufferingLevel = 0.8;
+ if (!this._lastBufferedEvent[playerType])
+ this._lastBufferedEvent[playerType] = {};
+ var lastBufferedEvent = this._lastBufferedEvent[playerType];
+ var startPositions = String.empty,
+ endPositions = String.empty;
+ for (var i = 0; i < buffered.length; i++) {
+ startPositions += (buffered.start(i) + ";");
+ endPositions += (buffered.end(i) + ";");
+ bufferingLevel = Math.min(bufferingLevel, currentPosition / buffered.end(i));
+ if (Math.abs(duration - buffered.end(i)) <= 1.0) {
+ this._lastBufferedEvent[playerType] = null;
+ return
+ }
+ }
+ if (bufferingLevel < maxBufferingLevel && (lastBufferedEvent.timeStamp && Math.abs(Date.now() - lastBufferedEvent.timeStamp) < minBufferedEventsIntervalMs))
+ return;
+ if (startPositions !== String.empty || endPositions !== String.empty) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlayerBufferState);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventTime, Date.now());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlayerType, playerType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BufferStart, startPositions);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BufferEnd, endPositions);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CurrentPosition, currentPosition);
+ this.closeDataPoint(dataPoint);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlayerBufferState: PlayerType=" + playerType + " BufferStart=" + startPositions + " BufferEnd=" + endPositions + " CurrentPosition=" + currentPosition);
+ if (playerType === "currentPlayer")
+ if (lastBufferedEvent.currentPosition === currentPosition && !lastBufferedEvent.hasStopped) {
+ lastBufferedEvent.hasStopped = true;
+ lastBufferedEvent.lastStoppedTimeStamp = Date.now()
+ }
+ else {
+ if (lastBufferedEvent.hasStopped && lastBufferedEvent.lastStoppedTimeStamp) {
+ var stoppedTimeInterval = Date.now() - lastBufferedEvent.lastStoppedTimeStamp;
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlayerBufferState: Playback has stopped for " + stoppedTimeInterval + "ms due to buffering.")
+ }
+ lastBufferedEvent.hasStopped = false;
+ lastBufferedEvent.lastStoppedTimeStamp = null
+ }
+ lastBufferedEvent.timeStamp = Date.now();
+ lastBufferedEvent.currentPosition = currentPosition
+ }
+ }, logPlayToReceiverError: function logPlayToReceiverError(exception, message) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlayToReceiverError);
+ var errorCode = "0x" + (0xFFFFFFFF + exception.number + 1).toString(16);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, errorCode);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Message, message);
+ this.closeDataPoint(dataPoint)
+ }, logCommandClicked: function logCommandClicked(commandAction) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.CommandUsage);
+ this.appendUIPath(dataPoint);
+ MS.Entertainment.Utilities.assert(!!commandAction.automationId, "commandAction.automationId is null or undefined, commandAction.id = " + commandAction.id);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandId, commandAction.automationId);
+ if (commandAction.title)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandLabel, commandAction.title);
+ if (commandAction.parameter) {
+ if (commandAction.parameter.abTests)
+ commandAction.parameter.abTests.forEach(function (abTest) {
+ if (abTest.abTestName)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABTestName, abTest.abTestName);
+ if (abTest.abGroupName)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABTestName, abTest.abGroupName)
+ });
+ if (commandAction.parameter.mediaItem) {
+ if (commandAction.parameter.mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.game) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.mediaType, commandAction.parameter.mediaItem.mediaType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.serviceId, commandAction.parameter.mediaItem.serviceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.titleType, commandAction.parameter.mediaItem.titleType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.titleId, commandAction.parameter.mediaItem.titleId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.defaultPlatformType, commandAction.parameter.mediaItem.defaultPlatformType)
+ }
+ if (commandAction.parameter.mediaItem.name)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.mediaName, commandAction.parameter.mediaItem.name);
+ if (commandAction.parameter.mediaItem.queryId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.queryId, commandAction.parameter.mediaItem.queryId);
+ if (commandAction.parameter.mediaItem.acquisitionData) {
+ if (commandAction.parameter.mediaItem.acquisitionData.acquisitionContext)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContext, MS.Entertainment.Utilities.getAcquisitionContextFromEnum(commandAction.parameter.mediaItem.acquisitionData.acquisitionContext));
+ if (commandAction.parameter.mediaItem.acquisitionData.acquisitionContextType)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextType, MS.Entertainment.Utilities.getAcquisitionContextTypeFromEnum(commandAction.parameter.mediaItem.acquisitionData.acquisitionContextType));
+ if (commandAction.parameter.mediaItem.acquisitionData.acquisitionContextID)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, commandAction.parameter.mediaItem.acquisitionData.acquisitionContextID)
+ }
+ }
+ else if (commandAction.parameter.hub || commandAction.parameter.page) {
+ if (commandAction.parameter.hub)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.hub, commandAction.parameter.hub);
+ if (commandAction.parameter.page)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.page, commandAction.parameter.page);
+ if (commandAction.parameter.queryId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.queryId, commandAction.parameter.queryId)
+ }
+ if (commandAction.parameter.actionType)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.actionType, commandAction.parameter.actionType);
+ if (commandAction.parameter.executeLocation)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.executeLocation, commandAction.parameter.executeLocation)
+ }
+ else if (commandAction.userModel)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.secondaryGamerTag, commandAction.userModel.gamerTag);
+ this.closeDataPoint(dataPoint)
+ }, logTransportControlsCommand: function logTransportControlsCommand(automationId, title) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.CommandUsage);
+ this.appendUIPath(dataPoint);
+ MS.Entertainment.Utilities.assert(!!automationId, "automationId is null or undefined, title = " + title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandId, automationId);
+ if (title)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandLabel, title);
+ this.closeDataPoint(dataPoint)
+ }, logPopoverShown: function logPopoverShown(commandId, mediaItem) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PopoverDisplay);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPart, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Popover);
+ this.appendUIPath(dataPoint);
+ if (commandId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandId, commandId);
+ if (mediaItem) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.mediaType, mediaItem.mediaType);
+ if (mediaItem.serviceId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.serviceId, mediaItem.serviceId);
+ if (mediaItem.seriesId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.seriesId, mediaItem.seriesId);
+ if (mediaItem.titleId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.titleId, mediaItem.titleId);
+ if (mediaItem.queryId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.queryId, mediaItem.queryId);
+ if (mediaItem.name)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.name, mediaItem.name);
+ if (mediaItem.itemTypeQueryString)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.itemTypeQueryString, mediaItem.itemTypeQueryString)
+ }
+ this.closeDataPoint(dataPoint)
+ }, logModifierClicked: function logModifierClicked(id, label) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ModifierUsage);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Label, label);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Id, id);
+ this.closeDataPoint(dataPoint)
+ }, logNotification: function logNotification(notification, isNewNotification) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.NotificationUsage);
+ this.appendUIPath(dataPoint);
+ MS.Entertainment.Utilities.assert(notification, "notification is null or undefined");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NotificationTitle, notification.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NotificationCategory, notification.category.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsNewNotification, isNewNotification ? "Yes" : "No");
+ this.closeDataPoint(dataPoint)
+ }, logPageAction: function logPageAction(pageContentDataObject, currentLocation, destination, parameterArray) {
+ var telemetryParameterNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames;
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ if (!currentLocation) {
+ MS.Entertainment.Utilities.fail("Page Action call missing currentLocation");
+ return
+ }
+ if (!pageContentDataObject) {
+ MS.Entertainment.Utilities.fail("Page Action call missing pageContentDataObject");
+ return
+ }
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PageAction);
+ dataPoint.appendParameter(telemetryParameterNames.UserId, this._getUserIdValue());
+ dataPoint.appendParameter(telemetryParameterNames.Users, this._getUsersValue());
+ dataPoint.appendParameter(telemetryParameterNames.ActionTypeId, MS.Entertainment.Utilities.Telemetry.InputActionTypes.Click);
+ dataPoint.appendParameter(telemetryParameterNames.ActionInputMethodId, MS.Entertainment.Utilities.Telemetry.InputMethodTypes.Click);
+ if (currentLocation.uri) {
+ dataPoint.appendParameter(telemetryParameterNames.PageURI, currentLocation.uri);
+ var splitUri = currentLocation.uri.split("/");
+ if (splitUri)
+ dataPoint.appendParameter(telemetryParameterNames.PageName, splitUri[splitUri.length - 1]);
+ else
+ dataPoint.appendParameter(telemetryParameterNames.PageName, currentLocation.uri)
+ }
+ else {
+ dataPoint.appendParameter(telemetryParameterNames.PageURI, telemetryValueNames.Unknown);
+ dataPoint.appendParameter(telemetryParameterNames.PageName, telemetryValueNames.Unknown)
+ }
+ dataPoint.appendParameter(telemetryParameterNames.PageTypeId, currentLocation.pageTypeId);
+ dataPoint.appendParameter(telemetryParameterNames.TemplateId, String.empty);
+ if (destination) {
+ dataPoint.appendParameter(telemetryParameterNames.DestPageURI, destination.uri);
+ dataPoint.appendParameter(telemetryParameterNames.DestPageTypeId, destination.pageTypeId)
+ }
+ else {
+ dataPoint.appendParameter(telemetryParameterNames.DestPageURI, telemetryValueNames.None);
+ dataPoint.appendParameter(telemetryParameterNames.DestPageTypeId, telemetryValueNames.None)
+ }
+ dataPoint.appendParameter(telemetryParameterNames.CampaignId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.GroupId, String.empty);
+ var jsonString = null;
+ try {
+ jsonString = JSON.stringify(this._buildPageContentSlotForElement(pageContentDataObject))
+ }
+ catch (e) {
+ MS.Entertainment.Utilities.fail("failed to stringify page content: " + e);
+ jsonString = String.empty
+ }
+ dataPoint.appendParameter(telemetryParameterNames.ContentJsonVersion, 1.1);
+ dataPoint.appendParameter(telemetryParameterNames.Content, jsonString);
+ if (parameterArray && parameterArray.length)
+ for (var i = 0; i < parameterArray.length; i++)
+ if (parameterArray[i].parameterName && parameterArray[i].parameterValue !== undefined && parameterArray[i].parameterValue !== null)
+ dataPoint.appendParameter(parameterArray[i].parameterName, parameterArray[i].parameterValue);
+ else
+ MS.Entertainment.Utilities.fail("logPageAction called with invalid parameterArray element. parameterName: " + parameterArray[i].parameterName);
+ this.closeDataPoint(dataPoint)
+ }, logPageView: function logPageView(rootElement, newPageInformation, refererPageInformation) {
+ var telemetryParameterNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames;
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PageView);
+ dataPoint.appendParameter(telemetryParameterNames.UserId, this._getUserIdValue());
+ dataPoint.appendParameter(telemetryParameterNames.Users, this._getUsersValue());
+ var refererUri = telemetryValueNames.Unknown;
+ var refererTypeId = telemetryValueNames.Unknown;
+ if (refererPageInformation) {
+ if (refererPageInformation.uri)
+ refererUri = refererPageInformation.uri;
+ if (refererPageInformation.pageTypeId)
+ refererTypeId = refererPageInformation.pageTypeId
+ }
+ var newPageUri = telemetryValueNames.Unknown;
+ var newPageName = telemetryValueNames.Unknown;
+ var newPageType = telemetryValueNames.Unknown;
+ if (newPageInformation) {
+ if (newPageInformation.uri) {
+ newPageUri = newPageInformation.uri;
+ var splitUri = newPageInformation.uri.split("/");
+ if (splitUri)
+ newPageName = splitUri[splitUri.length - 1];
+ else
+ newPageName = newPageInformation.uri
+ }
+ if (newPageInformation.pageTypeId)
+ newPageType = newPageInformation.pageTypeId
+ }
+ dataPoint.appendParameter(telemetryParameterNames.PageURI, newPageUri);
+ dataPoint.appendParameter(telemetryParameterNames.PageName, newPageName);
+ dataPoint.appendParameter(telemetryParameterNames.RefererPageURI, refererUri);
+ dataPoint.appendParameter(telemetryParameterNames.PageTypeId, newPageType);
+ dataPoint.appendParameter(telemetryParameterNames.RefererPageTypeId, refererTypeId);
+ dataPoint.appendParameter(telemetryParameterNames.PageTags, this._buildPageTagInformation(rootElement));
+ dataPoint.appendParameter(telemetryParameterNames.PageParameters, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ProductCatalogId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ProductId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.TemplateId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ResolutionWidth, MS.Entertainment.Utilities.getWindowWidth());
+ dataPoint.appendParameter(telemetryParameterNames.ResolutionHeight, MS.Entertainment.Utilities.getWindowHeight());
+ var screenState = MS.Entertainment.Utilities.Telemetry.ScreenState.FullScreen;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped)
+ screenState = MS.Entertainment.Utilities.Telemetry.ScreenState.Snapped;
+ dataPoint.appendParameter(telemetryParameterNames.ScreenState, screenState);
+ dataPoint.appendParameter(telemetryParameterNames.ColorDepth, 24000);
+ dataPoint.appendParameter(telemetryParameterNames.SkinId, String.empty);
+ var authedParameter = MS.Entertainment.Utilities.Telemetry.SignInState.Anonymous;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ authedParameter = MS.Entertainment.Utilities.Telemetry.SignInState.Authenticated;
+ dataPoint.appendParameter(telemetryParameterNames.AuthState, authedParameter);
+ dataPoint.appendParameter(telemetryParameterNames.CampaignId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.GroupId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ContentJsonVersion, 1.1);
+ dataPoint.appendParameter(telemetryParameterNames.Content, this._buildPageContentInformation(rootElement));
+ if (MS.Entertainment.Utilities.isVideoApp2 && (newPageInformation.uri === MS.Entertainment.UI.Monikers.movieDetailsPage || newPageInformation.uri === MS.Entertainment.UI.Monikers.tvDetailsPage)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var media = WinJS.Utilities.getMember("currentPage.options.mediaItem", navigationService);
+ if (media && media.hasServiceId) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProductGuid, media.serviceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.serviceId))
+ }
+ }
+ this.closeDataPoint(dataPoint)
+ }, _buildPageTagInformation: function _buildPageTagInformation(rootElement) {
+ var rootToUse = rootElement ? rootElement : document.querySelector(".pageContainer.currentPage");
+ var attributeElements = null;
+ var resultString = String.empty;
+ var result = null;
+ if (rootToUse)
+ attributeElements = rootToUse.querySelectorAll("[data-ent-pagetag-name]");
+ if (attributeElements && attributeElements.length)
+ for (var i = 0; i < attributeElements.length; i++) {
+ var pageTagName = null;
+ var pageTagValuePath = null;
+ var pageTagValue = null;
+ var pageTagItem = null;
+ var currentElement = attributeElements[i];
+ if (currentElement.hasAttribute("data-ent-pagetag-name"))
+ pageTagName = currentElement.getAttribute("data-ent-pagetag-name");
+ if (currentElement.hasAttribute("data-ent-pagetag-value"))
+ pageTagValuePath = currentElement.getAttribute("data-ent-pagetag-value");
+ MS.Entertainment.Utilities.assert(pageTagName, "element has data-ent-pagetag-name, but was empty");
+ MS.Entertainment.Utilities.assert(pageTagValuePath, "element has data-ent-pagetag-name, but has no or empty value");
+ if (pageTagValuePath)
+ pageTagValue = WinJS.Utilities.getMember(pageTagValuePath, currentElement.winControl || currentElement);
+ if (pageTagName && pageTagValue) {
+ result = result || {};
+ result[pageTagName] = pageTagValue
+ }
+ }
+ if (result)
+ try {
+ resultString = JSON.stringify(result)
+ }
+ catch (e) {
+ MS.Entertainment.Utilities.fail("failed to stringify page tag: " + e)
+ }
+ return resultString
+ }, _buildPageContentInformation: function _buildPageContentInformation(rootElement) {
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ var rootToUse = rootElement ? rootElement : document.querySelector(".pageContainer.currentPage");
+ if (!rootToUse)
+ return String.empty;
+ var attributedElements = rootToUse.querySelectorAll("[data-ent-pagecontent]");
+ var pageContentDataArray = this._buildPageContentArrayForList(attributedElements);
+ var jsonString = String.empty;
+ var pageContentObject = { SVer: "1.00" };
+ pageContentObject.Slots = pageContentDataArray;
+ try {
+ jsonString = JSON.stringify(pageContentObject)
+ }
+ catch (e) {
+ MS.Entertainment.Utilities.fail("failed to stringify page content: " + e)
+ }
+ return jsonString
+ }, _buildPageContentArrayForList: function _buildPageContentObjectForElement(list) {
+ var currentElement = null;
+ var attributeValue = null;
+ var pageContentTelemetryObject = null;
+ var pageContentObjectProperty = null;
+ var contentArray = [];
+ for (var i = 0; i < list.length; i++) {
+ if (!list[i].hasAttribute("data-ent-pagecontent")) {
+ MS.Entertainment.Utilities.fail("element has invalid data-ent-pagecontent value");
+ continue
+ }
+ var attributeValue = list[i].getAttribute("data-ent-pagecontent");
+ if (!attributeValue) {
+ MS.Entertainment.Utilities.fail("element has data-ent-pagecontent, with no value");
+ continue
+ }
+ if (list[i].winControl)
+ pageContentObjectProperty = list[i].winControl[attributeValue];
+ else if (list[i][attributeValue])
+ pageContentObjectProperty = list[i][attributeValue];
+ else
+ pageContentObjectProperty = null;
+ if (pageContentObjectProperty && pageContentObjectProperty.mediaItem)
+ pageContentObjectProperty = pageContentObjectProperty.mediaItem;
+ pageContentTelemetryObject = this._buildPageContentSlotForElement({
+ slot: i, domElement: list[i], itemPropertyBag: pageContentObjectProperty
+ });
+ if (pageContentTelemetryObject)
+ contentArray.push(pageContentTelemetryObject)
+ }
+ return contentArray
+ }, _buildPageContentSlotForElement: function _buildPageContentSlotForElement(pageContentObject) {
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ var contentCatalogIds = MS.Entertainment.Utilities.Telemetry.ContentCatalogId;
+ var contentSourceIds = MS.Entertainment.Utilities.Telemetry.ContentSourceId;
+ var contentTypeIds = MS.Entertainment.Utilities.Telemetry.ContentTypeId;
+ var pageContentTelemetryObject = {};
+ if (!pageContentObject)
+ return pageContentTelemetryObject;
+ if (pageContentObject.slot >= 0)
+ pageContentTelemetryObject.SlotId = pageContentObject.slot.toString();
+ else
+ pageContentTelemetryObject.SlotId = "-1";
+ if (pageContentObject.itemPropertyBag) {
+ pageContentTelemetryObject.ContentId = pageContentObject.itemPropertyBag.serviceId;
+ pageContentTelemetryObject.ContentCatalogId = pageContentObject.itemPropertyBag.catalogId;
+ pageContentTelemetryObject.ContentSourceId = pageContentObject.itemPropertyBag.sourceId;
+ pageContentTelemetryObject.ContentTypeId = pageContentObject.itemPropertyBag.typeId || contentTypeIds.Editorial;
+ pageContentTelemetryObject.ContentName = pageContentObject.itemPropertyBag.name
+ }
+ else if (pageContentObject.domElement && pageContentObject.domElement.hasAttribute("data-win-automationid")) {
+ pageContentTelemetryObject.ContentId = pageContentObject.domElement.getAttribute("data-win-automationid");
+ pageContentTelemetryObject.ContentCatalogId = contentCatalogIds.App;
+ pageContentTelemetryObject.ContentSourceId = contentSourceIds.App;
+ pageContentTelemetryObject.ContentTypeId = contentTypeIds.App;
+ pageContentTelemetryObject.ContentName = pageContentTelemetryObject.ContentId
+ }
+ else {
+ pageContentTelemetryObject.ContentId = pageContentObject.contentId;
+ pageContentTelemetryObject.ContentCatalogId = pageContentObject.contentCatalogId;
+ pageContentTelemetryObject.ContentSourceId = pageContentObject.contentSourceId;
+ pageContentTelemetryObject.ContentTypeId = pageContentObject.contentTypeId;
+ pageContentTelemetryObject.ContentName = pageContentObject.contentName
+ }
+ var contentTagsValue = String.empty;
+ if (pageContentObject.contentTags)
+ try {
+ contentTagsValue = JSON.stringify(pageContentObject.contentTags)
+ }
+ catch (e) {
+ MS.Entertainment.Utilities.fail("failed to stringify content tag: " + e)
+ }
+ pageContentTelemetryObject.ContentTags = contentTagsValue;
+ pageContentTelemetryObject.ProductCatalogId = String.empty;
+ pageContentTelemetryObject.ProductId = String.empty;
+ if (pageContentObject.areaName)
+ pageContentTelemetryObject.AreaId = pageContentObject.areaName;
+ else if (pageContentObject.domElement)
+ pageContentTelemetryObject.AreaId = this._findAreaFromContentItem(pageContentObject.domElement);
+ else
+ pageContentTelemetryObject.AreaId = telemetryValueNames.Unknown;
+ pageContentTelemetryObject.CampaignId = String.empty;
+ pageContentTelemetryObject.GroupId = String.empty;
+ return pageContentTelemetryObject
+ }, _findAreaFromContentItem: function _findAreaFromContentItem(element) {
+ var currentElement = element;
+ var areaName = String.empty;
+ while (currentElement && !areaName) {
+ areaName = currentElement.getAttribute("data-ent-areaname") || String.empty;
+ currentElement = currentElement.parentElement
+ }
+ return areaName
+ }, mediaUsageContentTypeName: function mediaUsageContentTypeName(media) {
+ var name;
+ name = media.edsMediaItemTypeString;
+ if (!name) {
+ var mediaType = media.mediaType;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (media.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ name = MS.Entertainment.Data.Query.edsMediaType.tvEpisode;
+ else if (media.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo)
+ name = MS.Entertainment.Data.Query.edsMediaType.musicVideo;
+ else if (media.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ name = MS.Entertainment.Data.Query.edsMediaType.movie;
+ else
+ name = String.empty;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ name = MS.Entertainment.Data.Query.edsMediaType.tvSeries;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ name = MS.Entertainment.Data.Query.edsMediaType.tvSeason;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ name = MS.Entertainment.Data.Query.edsMediaType.musicArtist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ name = MS.Entertainment.Data.Query.edsMediaType.album;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ name = MS.Entertainment.Data.Query.edsMediaType.track;
+ break;
+ default:
+ name = String.empty;
+ break
+ }
+ }
+ return name
+ }, logMediaUsageHappened: function logMediaUsageHappened(playbackControl, position, eventType, isStartEvent) {
+ if (!playbackControl)
+ return;
+ var mediaInstance = playbackControl.currentMedia;
+ if (playbackControl._player && playbackControl._player._currentMedia)
+ mediaInstance = playbackControl._player._currentMedia;
+ var media = null;
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ media = mediaInstance._mediaItem.data;
+ if (!media)
+ return;
+ var contentType = this.mediaUsageContentTypeName(media);
+ if (contentType === MS.Entertainment.Data.Query.edsMediaType.track && mediaInstance) {
+ if (mediaInstance.isAudioAd)
+ contentType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicAd;
+ else if (mediaInstance.isPreview)
+ contentType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicPreview
+ }
+ else if (contentType === MS.Entertainment.Data.Query.edsMediaType.movie && mediaInstance && mediaInstance.isPreview)
+ contentType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.VideoPreview;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MediaUsageEvent);
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.mediaUsage);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventType, eventType);
+ if (position)
+ position = (position | 0);
+ if (position !== this.badPositionMs)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, position);
+ else {
+ MS.Entertainment.Utilities.assert(false, "playback position is 604800000(7days), duration is " + playbackControl.duration);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, String.empty)
+ }
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, media.canonicalId);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.zuneId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, media.zuneId);
+ if (MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId) && MS.Entertainment.Utilities.isEmptyGuid(media.zuneId)) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, String.empty);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, String.empty)
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, contentType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsStream, mediaInstance && mediaInstance.isLocal ? "false" : "true");
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible)
+ if (uiStateService.isSnapped)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Docked);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Full);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Minimized);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsDrm, this._getIsDrmFromMediaInstance(mediaInstance));
+ var playbackDuration = 0;
+ if (isStartEvent) {
+ var now = Date.now();
+ this._totalTimeCounterStart = now
+ }
+ else if (this._totalTimeCounterStart !== 0) {
+ playbackDuration = Date.now() - this._totalTimeCounterStart;
+ this._totalTimeCounterStart = 0
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlaybackDurationMs, playbackDuration);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaInstanceId, mediaInstance && mediaInstance.mediaInstanceId ? mediaInstance.mediaInstanceId : String.empty);
+ if (playbackControl.duration && playbackControl.duration > 0)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaLengthMs, playbackControl.duration);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaLengthMs, mediaInstance && mediaInstance.duration ? mediaInstance.duration : String.empty);
+ var acquisitionData = media.acquisitionData ? media.acquisitionData : (mediaInstance && mediaInstance.acquisitionData);
+ if (acquisitionData) {
+ if (acquisitionData.acquisitionContext)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContext, MS.Entertainment.Utilities.getAcquisitionContextFromEnum(acquisitionData.acquisitionContext));
+ if (acquisitionData.acquisitionContextType)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextType, MS.Entertainment.Utilities.getAcquisitionContextTypeFromEnum(acquisitionData.acquisitionContextType));
+ if (!MS.Entertainment.Utilities.isEmptyGuid(acquisitionData.acquisitionContextID)) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, acquisitionData.acquisitionContextID);
+ if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.playlist)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AdditionalContext, acquisitionData.acquisitionAdditionalContext || media.playlistName)
+ }
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.track && !MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, (media.track && media.track.canonicalId) || media.canonicalId);
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.album && media.album && !MS.Entertainment.Utilities.isEmptyGuid(media.album.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, media.album.canonicalId);
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.artist && media.artist && !MS.Entertainment.Utilities.isEmptyGuid(media.artist.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, media.artist.canonicalId);
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.playlist && MS.Entertainment.Utilities.isValidServiceId(media.playlistCloudSyncId)) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, media.playlistCloudSyncId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AdditionalContext, media.playlistName)
+ }
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.musicVideo && !MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, (media.musicVideo && media.musicVideo.canonicalId) || media.canonicalId)
+ }
+ else if (mediaInstance && mediaInstance.isAudioAd) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContext, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicAd);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextType, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicAd)
+ }
+ this.closeDataPoint(dataPoint)
+ }, logPlayHappened: function logPlayHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Resume, true);
+ else
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Play, true);
+ this._somethingPlaying = true
+ }, logPauseHappened: function logPauseHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Pause, false)
+ }, logEndHappened: function logEndHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.End, false);
+ this._somethingPlaying = false
+ }, logSkipHappened: function logSkipHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Skip, false);
+ this._somethingPlaying = false
+ }, logPurchaseHappened: function logPurchaseHappened(media, offer) {
+ if (!media || !offer)
+ return;
+ var serviceIdToUse = null;
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ serviceIdToUse = media.seasonServiceId;
+ else
+ serviceIdToUse = media.canonicalId;
+ if (MS.Entertainment.Utilities.isEmptyGuid(media.zuneId) && MS.Entertainment.Utilities.isEmptyGuid(serviceIdToUse))
+ return;
+ var contentType = this.mediaUsageContentTypeName(media);
+ if (!contentType)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MediaUsageEvent);
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.mediaUsage);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventType, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Purchase);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, 0);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, contentType);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(serviceIdToUse))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, serviceIdToUse);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.zuneId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, media.zuneId);
+ var acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Purchase;
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video) {
+ var licenseRight = offer.licenseRight;
+ if (licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent || licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream)
+ acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Rental
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionType, acquisitionType);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible)
+ if (uiStateService.isSnapped)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Docked);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Full);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Minimized);
+ this.closeDataPoint(dataPoint)
+ }, logDownloadHappened: function logDownloadHappened(media) {
+ if (!media)
+ return;
+ if (MS.Entertainment.Utilities.isEmptyGuid(media.zuneId) && MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ return;
+ var contentType = this.mediaUsageContentTypeName(media);
+ if (!contentType)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MediaUsageEvent);
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.mediaUsage);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventType, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Download);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, 0);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, contentType);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, media.canonicalId);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.zuneId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, media.zuneId);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible)
+ if (uiStateService.isSnapped)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Docked);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Full);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Minimized);
+ this.closeDataPoint(dataPoint)
+ }, logPlaybackErrorConvertedToGeneric: function logPlaybackErrorConvertedToGeneric(originalCode, originalExtendedCode, context) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackErrorConvertedToGeneric);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, (originalCode ? originalCode : 0));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ExtendedCode, (originalExtendedCode ? originalExtendedCode : 0));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Context, (context ? context : ""));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlaybackSource, MS.Entertainment.Platform.PlaybackHelpers.lastPlaybackSource);
+ this.closeDataPoint(dataPoint)
+ }, logRootLicenseAcquisition: function logRootLicenseAcquisition(status, errorCode) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.RootLicenseAcquisition);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Status, status);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, (errorCode ? errorCode : 0));
+ this.closeDataPoint(dataPoint)
+ }, logReactiveLicenseAcquisitionProgress: function logReactiveLicenseAcquisitionProgress(mediaInstance, kid, state) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ReactiveLicenseAcquisition);
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.State, state);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Kid, kid ? kid : MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Miid, mediaInstance && mediaInstance.mediaInstanceId ? mediaInstance.mediaInstanceId : MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ this.closeDataPoint(dataPoint)
+ }, logDRMIndividualization: function logDRMIndividualization(status) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.DRMIndividualization);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Status, status);
+ this.closeDataPoint(dataPoint)
+ }, logWelcomePanelDismissed: function logWelcomePanelDismissed() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.WelcomePanelDismissed);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logWelcomePanelStartButton: function logWelcomePanelStartButton() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.WelcomePanelStartButtonClicked);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logSignInWelcomePanel: function logSignInWelcomePanel() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignInWelcomePanel);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logErrorInMediaTagRemoval: function logErrorInMediaTagRemoval(error) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ErrorInMediaTagRemoval);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Error, error);
+ this.closeDataPoint(dataPoint)
+ }, logAudioAdServiceEvent: function logAudioAdServiceEvent(event, mediaInstance, isNextMediaInstance) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(event);
+ this.appendUIPath(dataPoint);
+ MS.Entertainment.UI.Music.assert(!!mediaInstance, "mediaInstance not defined, cannot log audio ad service telemetry");
+ if (!mediaInstance)
+ return;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsStream, mediaInstance.isLocal ? "false" : "true");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.InCollection, mediaInstance.inCollection ? "true" : "false");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.FromCollection, mediaInstance.fromCollection ? "true" : "false");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsPreview, mediaInstance.isPreview ? "true" : "false");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProtectionState, mediaInstance.protectionState);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Extension, this._getFileExtensionFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, this.mediaUsageContentTypeName(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.LicenseRight, mediaInstance.nativeLicenseRight);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ServiceId, mediaInstance.serviceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Duration, mediaInstance.duration);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TotalAudioAdImpressions, configurationManager.music.totalAudioAdImpressions);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TotalVideoAdImpressions, configurationManager.music.totalVideoAdImpressions);
+ if (isNextMediaInstance)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsNextMediaInstance, isNextMediaInstance);
+ this.closeDataPoint(dataPoint)
+ }, logVideoAdServiceEvent: function logVideoAdServiceEvent(event, mediaProperties) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(event);
+ MS.Entertainment.UI.Music.assert(!!mediaProperties, "mediaItem not defined, cannot log video ad service telemetry");
+ if (!mediaProperties)
+ return;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, this.mediaUsageContentTypeName(mediaProperties));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.InCollection, mediaProperties.inCollection ? "true" : "false");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.HasLocalContent, mediaProperties.hasLocalContent ? "true" : "false");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsLibraryQuery, mediaProperties.isLibraryQuery);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlayabilityLocalCounts, mediaProperties.localOnly);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlayabilityCloudCounts, mediaProperties.cloudOnly);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.HasPurchasedCount, mediaProperties.hasPurchasedCount);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TrackCount, mediaProperties.trackCount);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TotalAudioAdImpressions, configurationManager.music.totalAudioAdImpressions);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TotalVideoAdImpressions, configurationManager.music.totalVideoAdImpressions);
+ this.closeDataPoint(dataPoint)
+ }, badPositionMs: 604800000, Events: { CloudMatchStateChangeMethod: "CloudMatchEnabledStateChangeMethod" }, StateChangeMethodValues: {
+ dialog: "dialog", toggle: "toggle", notification: "notification"
+ }, InputActionTypes: { Click: "1" }, InputMethodTypes: { Click: "8" }, ContentCatalogId: {
+ App: "1", Compass: "2", XboxCatalog: "3", EDS: "4"
+ }, ContentSourceId: {
+ UAD: "1", Compass: "2", App: "3", Recommendation: "4", SDS: "5"
+ }, ContentTypeId: {
+ Advertisement: "1", Editorial: "2", App: "3", Webpage: "4", Weblink: "5", TextEntry: "6"
+ }, PageTypeId: {
+ Dash: "1", Webblend: "2", WebPage: "3", Popup: "4", Charm: "5", Menu: "6", AppBar: "7", SmartDJ: "8", Featured: "9", TopMusic: "10", Details: "11", VideoPostRoll: "12", Store: "13"
+ }, ScreenState: {
+ FullScreen: "FullScreen", Snapped: "Snapped"
+ }, SignInState: {
+ Authenticated: "Authenticated", Anonymous: "Anonymous"
+ }, TelemetryEvents: {
+ AccountCreation: "AccountCreation", AuthHeaderResult: "AuthHeaderResult", BlockPurchaseAllItemsFoundOnce: "BlockPurchaseAllItemsFoundOnce", BlockPurchaseAllowed: "BlockPurchaseAllowed", BlockPurchaseFullyOwnedInDb: "BlockPurchaseFullyOwnedInDb", BlockPurchaseFullyOwnedInCloud: "BlockPurchaseFullyOwnedInCloud", BlockPurchaseInventoryCheck: "BlockPurchaseInventoryCheck", BlockPurchaseNavigatedAway: "BlockPurchaseNavigatedAway", BlockPurchaseNoSL2K: "BlockPurchaseNoSL2K", BlockPurchaseErrorGeneric: "BlockPurchaseErrorGeneric", BlockPurchaseErrorPurchase: "BlockPurchaseErrorPurchase", BlockPurchaseErrorRental: "BlockPurchaseErrorRental", BlockPurchaseRegionBlocked: "BlockPurchaseRegionBlocked", CommandUsage: "CommandUsage", DlnaDriveBrowse: "DlnaDriveBrowse", DRMIndividualization: "DRMIndividualization", ErrorInMediaTagRemoval: "ErrorInMediaTagRemoval", GetPreferredStreamResult: "GetPreferredStreamResult", HydratorWrongMediaType: "HydratorWrongMediaType", ImmersiveDetailsMetaDataUpdated: "ImmersiveDetailsMetaDataUpdated", MediaPlayerMusicPlayback: "MediaPlayerMusicPlayback", MediaPlayerVideoPlayback: "MediaPlayerVideoPlayback", MediaUsageEvent: "MediaUsageEvent", MuteStateSelected: "MuteStateSelected", ModifierUsage: "ModifierUsage", NetworkService: "NetworkService", NotificationUsage: "NotificationUsage", PageAction: "PageAction", PageView: "PageView", PaymentInstrumentationResponse: "PaymentInstrumentationResponse", PlayAllMusic: "PlayAllMusic", PlaybackAttempted: "PlaybackAttempted", PlaybackControl: "PlaybackControl", PlaybackError: "PlaybackError", PlaybackErrorConvertedToGeneric: "PlaybackErrorConvertedToGeneric", PlaybackHappened: "PlaybackHappened", PlayerBufferState: "PlayerBufferState", PlayToReceiverError: "PlayToReceiverError", PlayToReceiverPlaybackError: "PlayToReceiverPlaybackError", PlayToReceiverSessionCompleted: "PlayToReceiverSessionCompleted", PlayToReceiverSessionRequested: "PlayToReceiverSessionRequested", PlayToSenderAttempted: "PlayToSenderAttempted", PlayToSenderError: "PlayToSenderError", PlayToSenderPlaybackHappened: "PlayToSenderPlaybackHappened", PopoverDisplay: "PopoverDisplay", PreviewPlayed: "PreviewPlayed", PurchaseEntitlementsNotFound: "PurchaseEntitlementsNotFound", PurchaseMade: "PurchaseMade", PurchaseResponse: "PurchaseResponse", PurchaseReviewStart: "PurchaseReviewStart", RecentUpsellPanelShown: "RecentUpsellPanelShown", ReactiveLicenseAcquisition: "ReactiveLicenseAcquisition", RootLicenseAcquisition: "RootLicenseAcquisition", SearchEnter: "SearchEnter", SearchExit: "SearchExit", SearchGlyphClick: "SearchGlyphClick", SearchPanelLaunch: "SearchPanelLaunch", SearchPanelLaunchFailure: "SearchPanelLaunchFailure", SearchQuerySubmitted: "SearchQuerySubmitted", SearchWordWheelEnter: "SearchWordWheelEnter", SemanticZoom: "SemanticZoom", SendASmile: "Send A Smile", Settings: "Settings", ShareCharm: "ShareCharm", ShareEDSWebQueryComplete: "ShareEDSWebQueryInitiated", ShareEDSWebQueryInitiated: "ShareEDSWebQueryInitiated", SignIn: "SignIn", SignInWelcomePanel: "SignInWelcomePanel", SignOut: "SignOut", SubscriptionDetail: "SubscriptionDetail", SubscriptionSignupPrePurchase: "SubscriptionSignupPrePurchase", SubscriptionSignupPurchaseMade: "SubscriptionSignupPurchaseMade", UIFailure: "UIFailure", UnknownDriveBrowse: "UnknownDriveBrowse", UpsellDialogDisplayed: "UpsellDialogDisplayed", UsbDriveBrowse: "UsbDriveBrowse", UserEngagementCollectionMessageClicked: "UserEngagementCollectionMessageClicked", UserEngagementExternalLinkClicked: "UserEngagementExternalLinkClicked", UserEngagementMessageClick: "UserEngagementMessageClick", UserEngagementMessageDisplayed: "UserEngagementMessageDisplayed", VideoPostRollAction: "VideoPostRollAction", VideoPrePurchaseBlocked: "VideoPrePurchaseBlocked", VolumeSelected: "VolumeSelected", WebBlendError: "WebBlendError", WebBlendLaunch: "WebBlendLaunch", WelcomePageEntered: "WelcomePageEntered", WelcomePanelDismissed: "WelcomePanelDismissed", WelcomePanelStartButtonClicked: "WelcomePanelStartButtonClicked", WhatsNewDismissed: "WhatsNewDismissed", X8AdClicked: "X8AdClicked", X8NewPage: "X8NewPage", X8UsageTime: "X8UsageTime"
+ }, TelemetryParameterNames: {
+ ABGroupName: "ABGroupName", ABTestName: "ABTestName", AcceptTermsOfService: "AcceptTermsOfService", AcquisitionContext: "AcquisitionContext", AcquisitionContextId: "AcquisitionContextId", AcquisitionContextType: "AcquisitionContextType", AcquisitionType: "AcquisitionType", ActionInputMethodId: "ActionInputMethodId", actionType: "actionType", ActionTypeId: "ActionTypeId", AdInfo: "AdInfo", AdditionalContext: "AdditionalContext", AppMode: "AppMode", ArtistServiceId: "ArtistServiceId", AudioCodec: "AudioCodec", AuthHeaderResultText: "AuthHeaderResultText", AuthState: "AuthState", AutomationId: "AutomationId", BingMediaId: "BingMediaId", Bitrate: "Bitrate", BlockPurchaseAllItemFoundOnce: "BlockPurchaseAllItemFoundOnce", BlockPurchaseDatabaseRights: "BlockPurchaseDatabaseRights", BlockPurchaseServiceFailure: "BlockPurchaseServiceFailure", BlockPurchaseServicePurchaseRights: "BlockPurchaseServicePurchaseRights", BlockPurchaseServiceRentalRights: "BlockPurchaseServiceRentalRights", BlockPurchaseRentalConfigSetting: "BlockPurchaseRentalConfigSetting", BlockPurchaseTotalItems: "BlockPurchaseTotalItems", BufferEnd: "BufferEnd", BufferStart: "BufferStart", CampaignId: "CampaignId", CanonicalId: "CanonicalId", CanSignOut: "CanSignOut", ColorDepth: "ColorDepth", commandId: "commandId", commandLabel: "commandLabel", CommentText: "CommentText", Content: "Content", ContentID: "ContentID", ContentIssueType: "ContentIssueType", ContentJsonVersion: "ContentJsonVersion", ContentType: "ContentType", Context: "Context", ControlUsed: "ControlUsed", CorrelationID: "CorrelationID", CreateAccount: "CreateAccount", CurrentPage: "currentPage", CurrentPosition: "CurrentPosition", defaultPlatformType: "defaultPlatformType", DeliveryFormat: "DeliveryFormat", DestPageTypeId: "DestPageTypeId", DestPageURI: "DestPageURI", DialogType: "DialogType", DisplayPrice: "DisplayPrice", DistributionRight: "DistributionRight", DMRFriendlyName: "DMRFriendlyName", DriveSize: "DriveSize", DriveType: "DriveType", DlnaManufacturer: "DlnaManufacturer", DlnaModelName: "DlnaModelName", DlnaModelNumber: "DlnaModelNumber", Duration: "Duration", EdsMediaType: "EdsMediaType", EDSSearch: "EDSSearch", Error: "Error", ErrorCode: "ErrorCode", ErrorContext: "ErrorContext", ErrorId: "ErrorId", ErrorTimestamp: "ErrorTimestamp", EventTime: "EventTime", EventType: "EventType", ExpectedMediaType: "ExpectedEdsMediaType", executeLocation: "executeLocation", ExtendedCode: "ExtendedCode", Extension: "Extension", ExternalLink: "ExternalLink", FeedbackType: "FeedbackType", FileType: "FileType", ForceSignOut: "ForceSignOut", FreePlaysLeft: "FreePlaysLeft", FromAd: "FromAd", FromCollection: "FromCollection", FromPreview: "FromPreview", GroupId: "GroupId", HasLocalContent: "HasLocalContent", HasPurchasedCount: "HasPurchasedCount", HCR: "HCR", hub: "hub", Id: "Id", InCollection: "InCollection", InteractiveUri: "InteractiveUri", IsDrm: "IsDrm", IsLibraryQuery: "IsLibraryQuery", IsNewNotification: "IsNewNotification", IsNextMediaInstance: "IsNextMediaInstance", IsPreview: "IsPreview", IsStream: "IsStream", IsSubscription: "IsSubscription", IssueType: "IssueType", ItemCount: "ItemCount", ItemType: "ItemType", itemTypeQueryString: "itemTypeQueryString", Kid: "Kid", Label: "Label", LastUIPath: "LastUIPath", LiveMembershipLevel: "LiveMembershipLevel", licenseRight: "licenseRight", LicenseRight: "LicenseRight", Location: "Location", MediaId: "MediaId", MediaItem: "MediaItem", MediaItemInstanceId: "MediaItemInstanceId", MediaLengthMs: "MediaLengthMs", MediaName: "MediaName", mediaName: "mediaName", MediaType: "MediaType", mediaType: "mediaType", Message: "Message", MessageText: "MessageText", MethodInitiated: "MethodInitiated", Miid: "Miid", MusicPlaybackBackground: "MusicPlaybackBackground", MusicPlaybackSnapped: "MusicPlaybackSnapped", MusicPlaybackUnsnapped: "MusicPlaybackUnsnapped", MuteState: "MuteState", name: "name", NetworkStatus: "NetworkStatus", NoConnectedAccount: "NoConnectedAccount", NotificationCategory: "NotificationCategory", NotificationTitle: "NotificationTitle", NotSnapped: "NotSnapped", OfferId: "OfferId", Orientation: "Orientation", OSVersion: "OSVersion", page: "page", PageName: "PageName", PageParameters: "PageParameters", PageTags: "PageTags", PageTypeId: "PageTypeId", PageURI: "PageURI", ParentProductGuid: "ParentProductGuid", ParentSmid: "ParentSmid", PivotSelected: "PivotSelected", PlayabilityCloudCounts: "PlayabilityCloudCounts", PlayabilityLocalCounts: "PlayabilityLocalCounts", PlaybackDurationMs: "PlaybackDurationMs", PlaybackSource: "PlaybackSource", PlayerType: "PlayerType", PlayLocation: "PlayLocation", PlayToType: "PlayToType", PurchaseEntitlementsFailureHasFailures: "PurchaseEntitlementsFailureHasFailures", PurchaseEntitlementsFailureAddedEntitlements: "PurchaseEntitlementsFailureAddedEntitlements", MFSRAudioSubtype: "MFSRAudioSubtype", MFSRVideoSubtype: "MFSRVideoSubtype", MFSRMimeType: "MFSRMimeType", MFSRSourceCharacter: "MFSRSourceCharacter", MFSRError: "MFSRError", MFSRIsDRM: "MFSRIsDRM", Position: "Position", Price: "Price", ProductCatalogId: "ProductCatalogId", ProductGuid: "ProductGuid", ProductId: "ProductId", ProtectionState: "ProtectionState", ProviderMediaId: "ProviderMediaId", ProviderMediaInstanceId: "ProviderMediaInstanceId", PurchaseHistoryServiceIsGroveling: "PurchaseHistoryServiceIsGroveling", PurchaseFlowId: "PurchaseFlowId", queryId: "queryId", Reason: "Reason", RefererPageTypeId: "RefererPageTypeId", RefererPageURI: "RefererPageURI", RefreshSignInResult: "RefreshSignInResult", ResolutionHeight: "ResolutionHeight", ResolutionWidth: "ResolutionWidth", Result: "Result", Retries: "Retries", ScreenSize: "ScreenSize", ScreenState: "ScreenState", SearchDestination: "SearchDestination", SearchHCRMediaName: "SearchHCRMediaName", SearchHCRMediaType: "SearchHCRMediaType", SearchImpressionGuid: "SearchImpressionGuid", secondaryGamerTag: "secondaryGamerTag", SelectedItemMediaType: "SelectedItemMediaType", SelectedItemTitle: "SelectedItemTitle", seriesId: "seriesId", ServiceId: "ServiceId", serviceId: "serviceId", SettingsAccountUsage: "SettingsAccountUsage", SettingsHelpUsage: "SettingsHelpUsage", ShareTitle: "ShareTitle", ShareUri: "ShareUri", ShareUrl: "ShareUrl", SignedOfferGuid: "SignedOfferGuid", SignInDuration: "SignInDuration", SignInResult: "SignInResult", SignOutResult: "SignOutResult", SkinId: "SkinId", SMID: "SMID", Smid: "Smid", SnappedMode: "SnappedMode", StackTrace: "StackTrace", State: "State", Status: "Status", Success: "Success", SystemErrorCode: "SystemErrorCode", TaskId: "taskId", TemplateId: "TemplateId", TimeSpent: "TimeSpent", Title: "Title", titleId: "titleId", titleType: "titleType", TotalAudioAdImpressions: "TotalAudioAdImpressions", TotalVideoAdImpressions: "TotalVideoAdImpressions", TrackCount: "TrackCount", TracksLeft: "TracksLeft", UIPart: "UIPart", UIPath: "UIPath", UnsupportedRegion: "UnsupportedRegion", Url: "Url", UserId: "UserId", Users: "Users", VideoCodec: "VideoCodec", VideoPlaybackBackground: "VideoPlaybackBackground", VideoPlaybackSnapped: "VideoPlaybackSnapped", VideoPlaybackUnsnapped: "VideoPlaybackUnsnapped", VideoPostRollAction: "VideoPostRollAction", VolumeValue: "VolumeValue", WhatsNewShownDuration: "WhatsNewOpenedDuration", WhereUsed: "WhereUsed", XCorrelationId: "XCorrelationId", ZuneId: "ZuneId", ZunePass: "ZunePass"
+ }, TelemetryParameterValues: {
+ Album: "Album", AppBar: "AppBar", Artist: "Artist", background: "background", BillingContactInfoClick: "BillingContactInfoClick", BillingHistoryClick: "BillingHistoryClick", Cancel: "Cancel", CancelSubscriptionSuccess: "CancelSubscriptionSuccess", CancelSubscriptionError: "CancelSubscriptionError", ContactPreferencesClick: "ContactPreferencesClick", Docked: "Docked", Download: "Download", End: "End", Error: "Error", Full: "Full", Game: "Game", GlobalAppbar: "GlobalAppbar", HomeNPTile: "HomeNPTile", Immersive: "Immersive", LoadXboxAccountSummaryPage: "LoadXboxAccountSummaryPage", ManageMusicDevices: "ManageMusicDevices", ManagePaymentOptionsClick: "ManagePaymentOptionsClick", MediaKey: "MediaKey", Minimized: "Minimized", Movie: "Movie", MusicAd: "MusicAd", MusicHelpClicked: "MusicHelpClicked", MusicPassSubscribeClick: "MusicPassSubscribeClick", MusicPreview: "MusicPreview", MusicTransportControls: "MusicTransportControls", MusicVideo: "MusicVideo", Next: "Next", None: "None", nowplaying: "nowplaying", NowPlaying: "NowPlaying", Overlay: "Overlay", Pause: "Pause", Play: "Play", Playlist: "Playlist", PlayToByRef: "PlayToByRef", PlayToUGC: "PlayToUGC", Popover: "Popover", Previous: "Previous", Purchase: "Purchase", PrivacyClick: "PrivacyClick", RedeemCodeClick: "RedeemCodeClick", Rental: "Rental", Resume: "Resume", Skip: "Skip", Song: "Song", snapped: "snapped", SnappedAppBar: "SnappedAppBar", Stop: "Stop", Success: "Success", TVEpisode: "TV Episode", TVSeason: "TV Season", TVSeries: "TV Series", unknown: "unknown", Unknown: "Unknown", UnknownHelpClicked: "UnknownHelpClicked", UserAccountLinkClicked: "UserAccountLinkClicked", VideoHelpClicked: "VideoHelpClicked", VideoPreview: "VideoPreview", VoiceCommand: "VoiceCommand"
+ }, KeystoneEvents: {
+ AppHeartbeat: "app_heartbeat", Purchase: "kpi_purchase"
+ }, KeystoneParameterNames: {
+ Mode: "mode", PreviousSessionId: "previous_session_id", OfferId: "offer_id", MediaType: "media_type", MediaName: "media_name", MediaId: "media_id", CorrelationId: "correlation_id", Price: "price", MediaInstanceId: "media_instance_id", VideoDefinition: "video_definition", VideoCodec: "video_codec", AudioLanguage: "audio_language", AudioEncoding: "audio_encoding", VideoFileUrl: "video_file_url", HasCaptions: "has_captions", DeliveryFormat: "delivery_format", PaymentInstruments: "payment_instruments", AcquisitionType: "acquisition_type", BingId: "bing_id", ZuneId: "zune_id", Locale: "locale", UiPath: "ui_path", State: "state"
+ }, PurchaseStates: {
+ Succeeded: "succeeded", Canceled: "canceled", Failed: "failed"
+ }
+ })
+ })()
+})();
+/* >>>>>>/framework/usertimetelemetrymanager.js:15352 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ UserTimeTelemetryManager: MS.Entertainment.UI.Framework.define(function UserTimeTelemetryManager() {
+ this._musicPlaybackTimeTracker = new MS.Entertainment.Framework.PlaybackTimeTracker("Music");
+ this._videoPlaybackTimeTracker = new MS.Entertainment.Framework.PlaybackTimeTracker("Video");
+ var now = Date.now();
+ this._totalTimeCounterStart = now;
+ this._snappedModeTimeCounterStart = now;
+ this._unsnappedModeTimeCounterStart = now;
+ try {
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._userUsageTimeout = this._configuration.telemetry.userTimeEventTimeout
+ }
+ catch (e) {
+ MS.Entertainment.Framework.fail("Failed to access config to get the user time event timeout " + e.toString());
+ this._userUsageTimeout = 900000
+ }
+ if (!MS.Entertainment.Utilities.isTestApp && this._userUsageTimeout && this._userUsageTimeout > 0)
+ this._eventFireTimerPromise = WinJS.Promise.timeout(this._userUsageTimeout).then(this._fireTimerTelemetry.bind(this))
+ }, {
+ _totalTimeCounterStart: 0, _accumulatedTotalTime: 0, _snappedModeTimeCounterStart: 0, _accumulatedSnappedTime: 0, _unsnappedModeTimeCounterStart: 0, _accumulatedUnsnappedTime: 0, _musicPlaybackTimeTracker: null, _videoPlaybackTimeTracker: null, _configuration: null, _startedSnapped: false, _viewModeSwitched: false, _userUsageTimeout: 0, _eventFireTimerPromise: null, _sendDataPoint: function _sendDataPoint() {
+ var totalTime = 0;
+ var snappedTime = 0;
+ var notSnappedTime = 0;
+ var invalidNumbers = false;
+ if (!this._configuration)
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this._configuration.telemetry.timeSpent) {
+ totalTime = this._configuration.telemetry.timeSpent;
+ snappedTime = this._configuration.telemetry.snappedMode;
+ notSnappedTime = this._configuration.telemetry.notSnapped;
+ if ((totalTime < 0) || (snappedTime < 0) || (notSnappedTime < 0))
+ invalidNumbers = true;
+ if (!invalidNumbers) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TimeSpent, parameterValue: totalTime
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SnappedMode, parameterValue: snappedTime
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NotSnapped, parameterValue: notSnappedTime
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MusicPlaybackBackground, parameterValue: this._configuration.telemetry.musicPlaybackBackground
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MusicPlaybackSnapped, parameterValue: this._configuration.telemetry.musicPlaybackSnapped
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MusicPlaybackUnsnapped, parameterValue: this._configuration.telemetry.musicPlaybackUnsnapped
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VideoPlaybackBackground, parameterValue: this._configuration.telemetry.videoPlaybackBackground
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VideoPlaybackSnapped, parameterValue: this._configuration.telemetry.videoPlaybackSnapped
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VideoPlaybackUnsnapped, parameterValue: this._configuration.telemetry.videoPlaybackUnsnapped
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.X8UsageTime, telemetryParameterArray)
+ }
+ this._configuration.telemetry.timeSpent = 0;
+ this._configuration.telemetry.snappedMode = 0;
+ this._configuration.telemetry.notSnapped = 0;
+ this._configuration.telemetry.musicPlaybackBackground = 0;
+ this._configuration.telemetry.musicPlaybackSnapped = 0;
+ this._configuration.telemetry.musicPlaybackUnsnapped = 0;
+ this._configuration.telemetry.videoPlaybackBackground = 0;
+ this._configuration.telemetry.videoPlaybackSnapped = 0;
+ this._configuration.telemetry.videoPlaybackUnsnapped = 0
+ }
+ if (!this._eventFireTimerPromise)
+ if (this._userUsageTimeout && this._userUsageTimeout > 0)
+ this._eventFireTimerPromise = WinJS.Promise.timeout(this._userUsageTimeout).then(this._fireTimerTelemetry.bind(this))
+ }, appActivated: function appActivated() {
+ this._sendDataPoint();
+ this._startedSnapped = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped
+ }, appResumed: function appResumed() {
+ var now = Date.now();
+ this._sendDataPoint();
+ this._totalTimeCounterStart = now;
+ this._accumulatedTotalTime = 0;
+ this._snappedModeTimeCounterStart = now;
+ this._accumulatedSnappedTime = 0;
+ this._unsnappedModeTimeCounterStart = now;
+ this._accumulatedUnsnappedTime = 0;
+ this._viewModeSwitched = false;
+ this._startedSnapped = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped;
+ var sessionManager = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager);
+ if (sessionManager) {
+ var currentSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ if (currentSession && currentSession.currentMedia && currentSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ if (MS.Entertainment.Platform.PlaybackHelpers.isVideo(currentSession.currentMedia))
+ this._videoPlaybackTimeTracker.playbackStart();
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicOrMusicVideo(currentSession.currentMedia))
+ this._musicPlaybackTimeTracker.playbackStart()
+ }
+ }, _fireTimerTelemetry: function _fireTimerTelemetry() {
+ this.appSuspended();
+ this.appResumed()
+ }, appSuspended: function appSuspended() {
+ if (!this._configuration)
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var backgroundTime = 0;
+ this._musicPlaybackTimeTracker.playbackStop();
+ this._videoPlaybackTimeTracker.playbackStop();
+ if (this._eventFireTimerPromise) {
+ this._eventFireTimerPromise.cancel();
+ this._eventFireTimerPromise = null
+ }
+ if (MS.Entertainment.Utilities.isMusicApp)
+ backgroundTime = this._musicPlaybackTimeTracker.accumulatedBackgroundPlaybackTime;
+ this._musicPlaybackTimeTracker.dumpDataPoints();
+ this._videoPlaybackTimeTracker.dumpDataPoints();
+ var accumulatedTotalTimeChange = Date.now() - this._totalTimeCounterStart;
+ this._accumulatedTotalTime += accumulatedTotalTimeChange;
+ this._accumulatedUnsnappedTime += backgroundTime;
+ try {
+ if (this._viewModeSwitched) {
+ this._fixCurrentAccumulatedTime();
+ this._configuration.telemetry.snappedMode = this._accumulatedSnappedTime;
+ this._configuration.telemetry.notSnapped = this._accumulatedUnsnappedTime
+ }
+ else if (this._startedSnapped) {
+ this._configuration.telemetry.snappedMode = this._accumulatedTotalTime / 1000;
+ this._configuration.telemetry.notSnapped = "0"
+ }
+ else {
+ this._configuration.telemetry.snappedMode = "0";
+ this._configuration.telemetry.notSnapped = this._accumulatedTotalTime / 1000
+ }
+ this._configuration.telemetry.timeSpent = this._accumulatedTotalTime / 1000
+ }
+ catch (exception) {
+ MS.Entertainment.Framework.fail("exception in suspend " + exception.toString())
+ }
+ }, _fixCurrentAccumulatedTime: function _fixCurrentAccumulatedTime() {
+ var now = Date.now();
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ var accumulatedSnappedChange = now - this._snappedModeTimeCounterStart;
+ this._accumulatedSnappedTime += (accumulatedSnappedChange / 1000)
+ }
+ else {
+ var accumulatedUnsnappedChange = now - this._unsnappedModeTimeCounterStart;
+ this._accumulatedUnsnappedTime += (accumulatedUnsnappedChange / 1000)
+ }
+ }, switchedToSnappedMode: function switchedToSnappedMode() {
+ var now = Date.now();
+ var accumulatedUnsnappedChange = now - this._unsnappedModeTimeCounterStart;
+ this._accumulatedUnsnappedTime += (accumulatedUnsnappedChange / 1000);
+ this._unsnappedModeTimeCounterStart = now;
+ this._snappedModeTimeCounterStart = now;
+ this._musicPlaybackTimeTracker.snappedModeChanged();
+ this._videoPlaybackTimeTracker.snappedModeChanged();
+ this._viewModeSwitched = true
+ }, switchedToUnsnappedMode: function switchedToUnsnappedMode() {
+ var now = Date.now();
+ var accumulatedSnappedChange = now - this._snappedModeTimeCounterStart;
+ this._accumulatedSnappedTime += (accumulatedSnappedChange / 1000);
+ this._snappedModeTimeCounterStart = now;
+ this._unsnappedModeTimeCounterStart = now;
+ this._musicPlaybackTimeTracker.snappedModeChanged();
+ this._videoPlaybackTimeTracker.snappedModeChanged();
+ this._viewModeSwitched = true
+ }, appVisibilityChanged: function appVisibilityChanged() {
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible) {
+ var accumulatedTotalTimeChange = Date.now() - this._totalTimeCounterStart;
+ this._accumulatedTotalTime += accumulatedTotalTimeChange;
+ if (this._viewModeSwitched)
+ this._fixCurrentAccumulatedTime()
+ }
+ else {
+ var now = Date.now();
+ this._snappedModeTimeCounterStart = now;
+ this._unsnappedModeTimeCounterStart = now;
+ this._totalTimeCounterStart = now
+ }
+ this._musicPlaybackTimeTracker.appVisibilityChanged();
+ this._videoPlaybackTimeTracker.appVisibilityChanged()
+ }, musicPlaybackStart: function musicPlaybackStart() {
+ this._musicPlaybackTimeTracker.playbackStart()
+ }, videoPlaybackStart: function videoPlaybackStart() {
+ this._videoPlaybackTimeTracker.playbackStart()
+ }, musicPlaybackStop: function musicPlaybackStop() {
+ this._musicPlaybackTimeTracker.playbackStop()
+ }, videoPlaybackStop: function videoPlaybackStop() {
+ this._videoPlaybackTimeTracker.playbackStop()
+ }
+ }, null), PlaybackTimeTracker: MS.Entertainment.UI.Framework.define(function PlaybackTimeTracker(name) {
+ this._name = name
+ }, {
+ accumulatedUnsnappedPlaybackTime: 0, accumulatedSnappedPlaybackTime: 0, accumulatedBackgroundPlaybackTime: 0, _playbackTimeCounterStart: 0, _isSnapped: false, _isVisible: false, _name: "", _configuration: null, _accumulatedBackgroundConfig: null, _accumulatedSnappedConfig: null, _accumulatedUnsnappedConfig: null, lastStateChange: 0, currentlyPlaying: false, _sleepTimeFudgeFactor: 1500000, snappedModeChanged: function switchedSnappedMode() {
+ if (this._playbackTimeCounterStart !== 0)
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped !== this._isSnapped) {
+ this.playbackStop();
+ this.playbackStart()
+ }
+ }, appVisibilityChanged: function appVisibilityChanged() {
+ if (this._playbackTimeCounterStart !== 0)
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible !== this._isVisible) {
+ this.playbackStop();
+ this.playbackStart()
+ }
+ }, playbackStart: function playbackStart() {
+ this.playbackStop();
+ this._playbackTimeCounterStart = Date.now();
+ this._isSnapped = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped;
+ this._isVisible = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible
+ }, playbackStop: function playbackStop() {
+ var now = Date.now();
+ if (this._playbackTimeCounterStart !== 0) {
+ if (this._isVisible)
+ if (this._isSnapped)
+ this.accumulatedSnappedPlaybackTime += (now - this._playbackTimeCounterStart) / 1000;
+ else
+ this.accumulatedUnsnappedPlaybackTime += (now - this._playbackTimeCounterStart) / 1000;
+ else if (this._name === "Music") {
+ if (now - this.lastStateChange <= this._sleepTimeFudgeFactor)
+ this.accumulatedBackgroundPlaybackTime += (now - this._playbackTimeCounterStart) / 1000
+ }
+ else
+ this.accumulatedBackgroundPlaybackTime += (now - this._playbackTimeCounterStart) / 1000;
+ this._playbackTimeCounterStart = 0;
+ this.lastStateChange = now
+ }
+ }, dumpDataPoints: function dumpDataPoints(dataPoint) {
+ try {
+ if (!this._configuration)
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this._name === "Music") {
+ this._configuration.telemetry.musicPlaybackBackground = this.accumulatedBackgroundPlaybackTime;
+ this._configuration.telemetry.musicPlaybackSnapped = this.accumulatedSnappedPlaybackTime;
+ this._configuration.telemetry.musicPlaybackUnsnapped = this.accumulatedUnsnappedPlaybackTime
+ }
+ else if (this._name === "Video") {
+ this._configuration.telemetry.videoPlaybackBackground = this.accumulatedBackgroundPlaybackTime;
+ this._configuration.telemetry.videoPlaybackSnapped = this.accumulatedSnappedPlaybackTime;
+ this._configuration.telemetry.videoPlaybackUnsnapped = this.accumulatedUnsnappedPlaybackTime
+ }
+ this.accumulatedBackgroundPlaybackTime = 0;
+ this.accumulatedSnappedPlaybackTime = 0;
+ this.accumulatedUnsnappedPlaybackTime = 0
+ }
+ catch (error) { }
+ }
+ }, null)
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.userTimeTelemetryManager, function getUserTimeTelemetryManager() {
+ return new MS.Entertainment.Framework.UserTimeTelemetryManager
+ }, true);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager)
+ })()
+})();
+/* >>>>>>/framework/uistateservice.js:15605 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ var observableProperty = MS.Entertainment.UI.Framework.observableProperty;
+ var UiStateService = WinJS.Class.derive(MS.Entertainment.UI.Framework.ObservableBase, function uiStateService() {
+ var currentView = Windows.UI.ViewManagement.InputPane.getForCurrentView();
+ currentView.addEventListener("showing", function uiStateService_SoftKeyboardShown() {
+ if (this._hidingPromise)
+ this._hidingPromise.cancel();
+ this.softKeyboardOpen = true
+ }.bind(this));
+ currentView.addEventListener("hiding", function uiStateService_SoftKeyboardHiding(e) {
+ this._hidingPromise = WinJS.Promise.timeout(250).then(function uiStateService_SoftKeyboardHidden() {
+ this._hidingPromise = null;
+ this.softKeyboardOpen = false
+ }.bind(this), function () { })
+ }.bind(this));
+ window.addEventListener("resize", function uiStateService_WindowResizing() {
+ if (!this.softKeyboardOpen)
+ this.dispatchEvent("windowresize")
+ }.bind(this))
+ }, {
+ animationsEnabled: {
+ get: function () {
+ return MS.Entertainment.UI.Framework.animationsEnabled
+ }
+ }, activationKind: observableProperty("activationKind", null), activeListening: observableProperty("activeListening", false), activityOverlayVisible: observableProperty("activityOverlayVisible", false), appBarVisible: observableProperty("appBarVisible", false), applicationTitle: observableProperty("applicationTitle", String.empty), deepLinkSource: observableProperty("deepLinkSource", String.empty), deepLinkSourceID: observableProperty("deepLinkSourceID", String.empty), deepLinkLaunchTime: observableProperty("deepLinkLaunchTime", String.empty), engageVisible: observableProperty("engageVisible", false), gestureEngaged: observableProperty("gestureEngaged", false), isAppVisible: observableProperty("isAppVisible", true, true), isInRestrictedBackground: observableProperty("isInRestrictedBackground", false), isFilled: observableProperty("isFilled", false, true), isFirstLaunch: observableProperty("isFirstLaunch", true), isFullScreenVideo: observableProperty("isFullScreenVideo", false), isFullScreenMusic: observableProperty("isFullScreenMusic", false), isHubStripVisible: observableProperty("isHubStripVisible", false), isScrolling: observableProperty("isScrolling", false), isSearchPaneVisible: observableProperty("isSearchPaneVisible", false), isSettingsCharmVisible: observableProperty("isSettingsCharmVisible", false), isSnapped: observableProperty("isSnapped", false, true), networkStatus: observableProperty("networkStatus", null), nowPlayingConstrainedMode: observableProperty("nowPlayingConstrainedMode", false), nowPlayingVisible: observableProperty("nowPlayingVisible", false), nowPlayingInset: observableProperty("nowPlayingInset", false), nowPlayingTileVisible: observableProperty("nowPlayingTileVisible", false), nuiEngaged: observableProperty("nuiEngaged", false), overlayVisible: observableProperty("overlayVisible", false), postRollAnimationState: observableProperty("postRollAnimationState", null), servicesEnabled: observableProperty("servicesEnabled", true), shouldShowAdsForFreePlay: observableProperty("shouldShowAdsForFreePlay", false), showingPostRoll: observableProperty("showingPostRoll", false), showingTransportControls: observableProperty("showingTransportControls", false), softKeyboardOpen: observableProperty("softKeyboardOpen", false), stageThreeActivated: observableProperty("stageThreeActivated", false), visibleButNotFocused: observableProperty("visibleButNotFocused", false), xboxControllerVisible: observableProperty("xboxControllerVisible", false), primarySessionId: observableProperty("primarySessionId", String.empty)
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.uiState, function getUiStateService() {
+ return new UiStateService
+ }, true)
+ })()
+})();
+/* >>>>>>/framework/observablearray.js:15639 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment");
+ WinJS.Namespace.define("MS.Entertainment", {
+ ObservableArray: MS.Entertainment.UI.Framework.define(function observableArrayConstructor(data) {
+ this._listeners = [];
+ this._indexableItems = WinJS.Binding.as({ length: 0 });
+ if (!data)
+ this._data = [];
+ else
+ this._data = data.slice();
+ this._updateBindableItems()
+ }, {
+ _getObservable: function () {
+ return this
+ }, _data: null, _listeners: null, _indexableItems: null, _validateIndex: function validateIndex(index) {
+ if ((index < 0) || (index > this.length - 1))
+ throw new Error("Index out of bounds");
+ }, _raiseChangeEvent: function raiseChangeEvent(operation, index, item) {
+ var changeObject = {
+ type: operation, index: index, item: item
+ };
+ for (var i = 0; i < this._listeners.length; i++) {
+ var listener = this._listeners[i];
+ if (listener)
+ listener(changeObject)
+ }
+ }, _updateBindableItems: function _updateBindableItems() {
+ if (this._data.length === this._indexableItems.length)
+ return;
+ var that = this;
+ var difference = this._data.length - this._indexableItems;
+ for (var i = 0; i < this._data.length; i++) {
+ if (this._indexableItems.hasOwnProperty("item" + i))
+ continue;
+ (function (index) {
+ Object.defineProperty(that._indexableItems, "item" + index, {
+ get: function () {
+ return that._data[index]
+ }
+ })
+ })(i)
+ }
+ if (difference > 0)
+ for (var j = this._data.length; j < this._indexableItems.length; j++)
+ delete this._indexableItems["item" + j];
+ this._indexableItems.length = this._data.length
+ }, addChangeListener: function addChangeListener(handler) {
+ if (!handler)
+ throw new Error("Argument was invalid: undefined/null");
+ this._listeners.push(handler)
+ }, removeChangeListener: function removeChangeListener(handler) {
+ var handlerIndex = this._listeners.indexOf(handler);
+ if (handlerIndex === -1)
+ return;
+ this._listeners.splice(handlerIndex, 1)
+ }, length: {
+ get: function () {
+ return this._data.length
+ }
+ }, getArray: function getArray() {
+ return [].concat(this._data)
+ }, indexOf: function indexOf(item) {
+ return this._data.indexOf(item)
+ }, lastIndexOf: function lastIndexOf(item, startFrom) {
+ return this._data.lastIndexOf(item, startFrom)
+ }, contains: function contains(item) {
+ return (this.indexOf(item) !== -1)
+ }, item: function item(index) {
+ this._validateIndex(index);
+ return this._data[index]
+ }, clear: function clear() {
+ this._data.length = 0;
+ this._indexableItems = WinJS.Binding.as({ length: 0 });
+ this._raiseChangeEvent(MS.Entertainment.ObservableArray.OperationTypes.reset, -1, null)
+ }, add: function add(item) {
+ this.insert(this.length, item)
+ }, remove: function remove(item) {
+ var index = this.indexOf(item);
+ if (index < 0)
+ return;
+ return this.removeAt(index)
+ }, removeAt: function removeAt(index) {
+ var removedItems = null;
+ this._validateIndex(index);
+ var item = this.item(index);
+ removedItems = this._data.splice(index, 1);
+ MS.Entertainment.assert(removedItems.length === 1, "expecting to remove more than one item. Removed: " + removedItems.length);
+ this._updateBindableItems();
+ this._raiseChangeEvent(MS.Entertainment.ObservableArray.OperationTypes.remove, index, item);
+ return removedItems.length > 0 ? removedItems[0] : null
+ }, insert: function insert(index, item) {
+ if ((index < 0) || (index > this.length))
+ throw new Error("Index out of bounds");
+ this._data.splice(index, 0, item);
+ this._updateBindableItems();
+ this._raiseChangeEvent(MS.Entertainment.ObservableArray.OperationTypes.add, index, item)
+ }, slice: function slice(start, end) {
+ return this._data.slice(start, end)
+ }, some: function some(callback) {
+ return this._data.some(callback)
+ }, spliceArray: function spliceArray(index, count, array) {
+ this.splice.bind(this, index, count).apply(this, array)
+ }, unique: function unique() {
+ var uniqueValues = this._data ? this._data.unique() : [];
+ return uniqueValues
+ }, clone: function clone() {
+ var clonedValues = this._data ? this._data.clone() : [];
+ return clonedValues
+ }, push: function push(item) {
+ this.add(item);
+ return this.length
+ }, pop: function pop() {
+ if (this.length < 1)
+ return;
+ var index = this.length - 1;
+ return this.removeAt(index)
+ }, filter: function filter(callback, that) {
+ if (!this._data)
+ return null;
+ return this._data.filter(callback, that)
+ }, shift: function shift() {
+ if (this.length < 1)
+ return;
+ return this.removeAt(0)
+ }, splice: function splice(index, count) {
+ var removedItems = [];
+ if (count !== 0)
+ this._validateIndex(index + count - 1);
+ for (var i = index; i < index + count; i++)
+ removedItems.push(this.removeAt(index));
+ if (arguments.length > 2)
+ for (var j = 2; j < arguments.length; j++)
+ this.insert(index + j - 2, arguments[j]);
+ return removedItems
+ }, unshift: function unshift(item) {
+ this.insert(0, item);
+ return this.length
+ }, bindableItems: {
+ get: function () {
+ return this._indexableItems
+ }
+ }, forEach: function (callback, that) {
+ if (this._data)
+ this._data.forEach(callback, that)
+ }
+ }, {
+ OperationTypes: MS.Entertainment.UI.Framework.define(null, null, {
+ add: "add", remove: "remove", reset: "reset"
+ })
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/data/factory.js:15787 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (undefined) {
+ "use strict";
+ var MSE = WinJS.Namespace.define("MS.Entertainment", null);
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+ var blockAssertValueNotHydrated = function blockAssertValueNotHydrated() { };
+ var unblockAssertValueNotHydrated = function unblockAssertValueNotHydrated() { };
+ var assertValueNotHydrated = function assertValueNotHydrated(property, propertyPath) { };
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ stringParser: {
+ dateFromUTC: function (string, delimiter) {
+ var date = null;
+ if (string && string.constructor === String) {
+ if (delimiter === undefined)
+ delimiter = "-";
+ var pattern = new RegExp("(\\d{4})" + delimiter + "(\\d{2})" + delimiter + "(\\d{2})(.(\\d{2}):(\\d{2}):(\\d{2})){0,1}");
+ var parts = string.match(pattern);
+ MS.Entertainment.Data.assert(parts, "Parsing string dateFromUTC did not match RegExp pattern");
+ if (parts)
+ date = new Date(Date.UTC(parseInt(parts[1]), parseInt(parts[2], 10) - 1, parseInt(parts[3], 10), parseInt(parts[5] || "0", 10), parseInt(parts[6] || "0", 10), parseInt(parts[7] || "0", 10), 0))
+ }
+ return date
+ }, timeSpanFromXmlDuration: function timeSpanFromXmlDuration(data) {
+ var years = 0;
+ var months = 0;
+ var days = 0;
+ var hours = 0;
+ var minutes = 0;
+ var seconds = 0;
+ var regexp,
+ parts;
+ if (data) {
+ regexp = /(-?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?/i;
+ parts = data.match(regexp);
+ if (parts) {
+ years = parseInt(parts[2] || 0);
+ months = parseInt(parts[3] || 0);
+ days = parseInt(parts[4] || 0);
+ hours = parseInt(parts[5] || 0);
+ minutes = parseInt(parts[6] || 0);
+ seconds = parseInt(parts[7] || 0);
+ parts = null
+ }
+ else {
+ regexp = /^(-?)(\d+)\:(\d+)\:(\d+)$/i;
+ parts = data.match(regexp)
+ }
+ if (parts) {
+ hours = parseInt(parts[2] || 0);
+ minutes = parseInt(parts[3] || 0);
+ seconds = parseInt(parts[4] || 0)
+ }
+ }
+ var timeSpan = new Date(years, months, days, hours, minutes, seconds, 0);
+ return timeSpan
+ }
+ }, Augmentation: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function augmentation(augmentBackingData) {
+ this._cache = {};
+ this._backingAugmentation = {};
+ this._setAugmentBackingData(augmentBackingData || {})
+ }, {
+ _hydratePromise: null, _backingAugmentation: null, _preventObservableInheritance: true, _hydrated: false, hydrating: MS.Entertainment.UI.Framework.observableProperty("hydrating", false), isFailed: MS.Entertainment.UI.Framework.observableProperty("isFailed", false), hydrated: {
+ get: function get_hydrated() {
+ return this._hydrated
+ }, set: function set_hydrated(value) {
+ if (value !== this._hydrated) {
+ var oldValue = this._hydrated;
+ this._hydrated = value;
+ if (!value)
+ this._hydratePromise = null;
+ this.dispatchChangeAndNotify("hydrated", value, oldValue)
+ }
+ }
+ }, instance: {
+ get: function get_instance() {
+ return this._updatedInstance || this
+ }, set: function set_instance(value) {
+ this._updatedInstance = value
+ }, enumerable: true, configurable: false
+ }, _augmentBackingData: {
+ value: null, writable: true, enumerable: true, configurable: false
+ }, _backingData: {
+ get: function get_backingData() {
+ return this._cache
+ }, enumerable: true, configurable: false
+ }, _cache: {
+ value: null, writable: true, enumerable: true, configurable: false
+ }, _updatedInstance: {
+ value: null, writable: true, enumerable: true, configurable: false
+ }, _setCacheValue: {
+ value: function _setCacheValue(key, value) {
+ if (this._cache)
+ this._cache[key] = value
+ }, enumerable: true
+ }, _getAugmentBackingValue: {
+ value: function _getAugmentBackingValue(key, defaultValue) {
+ return (this._augmentBackingData && key in this._augmentBackingData) ? this._augmentBackingData[key] : defaultValue
+ }, enumerable: true, configurable: false
+ }, _setAugmentBackingValue: {
+ value: function _setAugmentBackingValue(key, newValue) {
+ if (this._augmentBackingData) {
+ var oldValue = this._getAugmentBackingValue(key);
+ this._augmentBackingData[key] = newValue;
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue)
+ }
+ }, enumerable: true, configurable: false
+ }, _getCacheValue: {
+ value: function _getCacheValue(key, defaultValue) {
+ return (this._cache && key in this._cache) ? this._cache[key] : defaultValue
+ }, enumerable: true
+ }, _getPropertyValueFromInner: function _getPropertyValueFromInner(key, innerProperty, source) {
+ var cache;
+ var cacheable = innerProperty ? innerProperty.cacheable : false;
+ source = source || this;
+ if (cacheable)
+ cache = this._getCacheValue(key);
+ if (cache === undefined) {
+ if (innerProperty && innerProperty.get)
+ cache = innerProperty.get.call(source, !source._augmentBackingData);
+ else
+ cache = innerProperty;
+ if (cacheable)
+ this._setCacheValue(key, cache)
+ }
+ return cache
+ }, _setPropertyValueFromInner: function _setPropertyValueFromInner(key, innerProperty, newValue, source) {
+ blockAssertValueNotHydrated();
+ source = source || this;
+ var cacheable = innerProperty ? innerProperty.cacheable : false;
+ var oldValue = this._getPropertyValueFromInner(key, innerProperty);
+ if (cacheable)
+ this._setCacheValue(key, newValue);
+ if (innerProperty && innerProperty.set)
+ innerProperty.set.call(source, newValue);
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue);
+ unblockAssertValueNotHydrated()
+ }, _getInitializablePropertyValueFromInner: function _getInitializablePropertyValueFromInner(key, innerProperty) {
+ var initialized = this._getCacheValue(key);
+ if (!initialized && innerProperty && innerProperty.initializer) {
+ innerProperty.initializer.call(this);
+ this._setCacheValue(key, true)
+ }
+ if (innerProperty && innerProperty.get)
+ return innerProperty.get.call(this)
+ }, _setInitializablePropertyValueFromInner: function _setInitializablePropertyValueFromInner(key, innerProperty, newValue) {
+ blockAssertValueNotHydrated();
+ var oldValue = this._getInitializablePropertyValueFromInner(key, innerProperty);
+ if (innerProperty && innerProperty.set)
+ innerProperty.set.call(this, newValue);
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue);
+ unblockAssertValueNotHydrated()
+ }, clone: function clone() {
+ var clone = MS.Entertainment.Data.augment(MS.Entertainment.Data.deflate(this), WinJS.Binding.unwrap(this).constructor);
+ return clone
+ }, cloneWithHydration: function cloneWithHydration() {
+ var clone = this.clone();
+ if (this.hydrated && clone)
+ clone._setHydratedValues(this);
+ return clone
+ }, hydrate: function hydrate(options) {
+ if (!this._hydratePromise && this.onHydrated) {
+ this.hydrated = false;
+ this.hydrating = true;
+ this.isFailed = false;
+ var hydratePromise = this._hydratePromise = WinJS.Promise.as(this.onHydrated.call(this, this, options));
+ hydratePromise = hydratePromise.then(function hydratedCompleted(values) {
+ if (hydratePromise === this._hydratePromise) {
+ this.hydrating = false;
+ if (values) {
+ this._setHydratedValues(values);
+ this.hydrated = true
+ }
+ else
+ this._hydratePromise = null
+ }
+ }.bind(this), function hydratedFailed(error) {
+ if (hydratePromise === this._hydratePromise) {
+ this.hydrating = false;
+ if (!error || error.message !== "Canceled")
+ this.isFailed = true;
+ this._hydratePromise = null
+ }
+ }.bind(this)).then(function hydratedFinally() {
+ return this
+ }.bind(this));
+ if (this._hydratePromise)
+ this._hydratePromise = hydratePromise
+ }
+ return WinJS.Promise.as(this._hydratePromise || this)
+ }, refresh: function refresh(options) {
+ if (!this.hydrating) {
+ this._hydratePromise = null;
+ this.hydrated = false;
+ return this.hydrate(options)
+ }
+ else
+ return WinJS.Promise.as(this._hydratePromise)
+ }, onHydrated: null, _setAugmentBackingData: function _setAugmentBackingData(data) {
+ var key;
+ if (!this._augmentBackingData && data)
+ this._augmentBackingData = data
+ }, _setHydratedValues: function _setHydratedValues(values) {
+ blockAssertValueNotHydrated();
+ var key,
+ property,
+ propertyValue,
+ override;
+ var augmentationShape = MSE.Data.augmentationShape(this);
+ values = values || {};
+ for (key in augmentationShape) {
+ property = augmentationShape[key];
+ if (property && property.hydrated)
+ if (key in values) {
+ propertyValue = values[key];
+ if (property.hydratedComparer)
+ override = property.hydratedComparer(this[key], values[key]) > 0;
+ else
+ override = MS.Entertainment.Data.Comparer.notFalsy(null, values[key]) > 0;
+ if (override)
+ this[key] = values[key]
+ }
+ else if (!property.hydratedIfAvailable)
+ MSE.Data.fail("Expected key missing from hydrated values. Key = " + key)
+ }
+ unblockAssertValueNotHydrated()
+ }, _assertValueNotHydrated: function _assertValueNotHydrated(property, propertyPath) {
+ if (!this.hydrated)
+ assertValueNotHydrated(property, propertyPath)
+ }
+ }, {
+ isAugmentation: function isAugmentation(object) {
+ return MS.Entertainment.Data.Augmentation.prototype.isPrototypeOf(object)
+ }, addProperties: function addProperties(object, innerPropertiesOrValues) {
+ if (object && innerPropertiesOrValues)
+ for (var key in innerPropertiesOrValues)
+ MS.Entertainment.Data.Augmentation.addProperty(object, key, innerPropertiesOrValues[key]);
+ return object
+ }, addProperty: function addProperty(object, key, innerPropertyOrValue) {
+ if (!object)
+ return object;
+ var override = (innerPropertyOrValue && innerPropertyOrValue.override);
+ if (!(key in object) || override) {
+ innerPropertyOrValue = MS.Entertainment.Data.Augmentation.defineProperty(key, innerPropertyOrValue);
+ if (innerPropertyOrValue.get || innerPropertyOrValue.set)
+ Object.defineProperty(object, key, innerPropertyOrValue)
+ }
+ else if (!innerPropertyOrValue)
+ object[key] = innerPropertyOrValue;
+ else if (!innerPropertyOrValue.get && !innerPropertyOrValue.set && innerPropertyOrValue !== "function")
+ object[key] = innerPropertyOrValue;
+ return object
+ }, defineProperty: function defineProperty(key, innerProperty) {
+ var result = innerProperty;
+ var type = typeof innerProperty;
+ var validObject = innerProperty && type === "object";
+ if (validObject && innerProperty.initializer)
+ result = MSE.Data.Augmentation.defineInitializerProperty(key, innerProperty);
+ else if (validObject && (innerProperty.get || innerProperty.set))
+ result = MSE.Data.Augmentation.defineCacheableProperty(key, innerProperty);
+ else if (innerProperty !== "function")
+ result = MSE.Data.Augmentation.defineNotifyProperty(key, innerProperty);
+ return result
+ }, defineAugmentProperty: function defineAugmentProperty(key) {
+ return {
+ get: function () {
+ return this._getAugmentBackingValue(key)
+ }, set: function (newValue) {
+ this._setAugmentBackingValue(key, newValue)
+ }, enumerable: true, configurable: true
+ }
+ }, defineNotifyProperty: function defineNotifyProperty(key, innerValue) {
+ return {
+ get: function () {
+ return this._getCacheValue(key, innerValue)
+ }, set: function (newValue) {
+ var oldValue = this._getCacheValue(key, innerValue);
+ this._setCacheValue(key, newValue);
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue)
+ }, enumerable: true, configurable: true
+ }
+ }, defineCacheableProperty: function defineCacheableProperty(key, innerProperty) {
+ return {
+ get: function () {
+ return this._getPropertyValueFromInner(key, innerProperty)
+ }, set: function (value) {
+ return this._setPropertyValueFromInner(key, innerProperty, value)
+ }, enumerable: (!innerProperty || innerProperty.enumerable === undefined) ? true : innerProperty.enumerable, configurable: (!innerProperty || innerProperty.configurable === undefined) ? true : innerProperty.configurable
+ }
+ }, defineInitializerProperty: function defineInitializer(key, innerProperty) {
+ return {
+ get: function () {
+ return this._getInitializablePropertyValueFromInner(key, innerProperty)
+ }, set: function (value) {
+ return this._setInitializablePropertyValueFromInner(key, innerProperty, value)
+ }, enumerable: (!innerProperty || innerProperty.enumerable === undefined) ? true : innerProperty.enumerable, configurable: (!innerProperty || innerProperty.configurable === undefined) ? true : innerProperty.configurable
+ }
+ }
+ }), _mix: (function () {
+ function defineMixedProperty(deflate, propertyPath, key, innerProperty) {
+ var hasGetter;
+ var hasSetter;
+ if (innerProperty && innerProperty.augmented) {
+ hasGetter = !!innerProperty.get;
+ hasSetter = !!innerProperty.set
+ }
+ if (!hasGetter && !hasSetter)
+ return innerProperty;
+ else {
+ var propertyPathFragments = MSE.Data.Property._getPropertyPathFragments(null, propertyPath);
+ return {
+ get: function () {
+ var result;
+ var that;
+ var source;
+ if (deflate)
+ source = MSE.Data.deflate(this);
+ else
+ source = this;
+ if (hasGetter && MSE.Data.Property._hasPropertyPathFragments(source, propertyPathFragments))
+ that = MSE.Data.Property._valueFromPropertyPathFragments(source, propertyPathFragments);
+ if (that && this._getPropertyValueFromInner)
+ result = this._getPropertyValueFromInner(key, innerProperty, that);
+ return result
+ }, set: function (value) {
+ var that;
+ var source;
+ if (deflate)
+ source = MSE.Data.deflate(this);
+ else
+ source = this;
+ if (hasSetter && MSE.Data.Property._hasPropertyPathFragments(source, propertyPathFragments))
+ that = MSE.Data.Property._valueFromPropertyPathFragments(source, propertyPathFragments);
+ if (that && this._setPropertyValueFromInner)
+ this._setPropertyValueFromInner(key, innerProperty, value, that)
+ }, augmented: true, cacheable: innerProperty.cacheable, enumerable: innerProperty.enumerable, configurable: innerProperty.configurable, hydrated: innerProperty.hydrated, hydratedRequired: innerProperty.hydratedRequired, hydratedComparer: innerProperty.hydratedComparer
+ }
+ }
+ }
+ { };
+ return function _mix(deflate, augmentations) {
+ var instanceMembers = {};
+ var shape;
+ var property;
+ var key;
+ var shapeKey;
+ var constructors = [];
+ for (key in augmentations) {
+ constructors.push(augmentations[key].prototype.constructor);
+ shape = MSE.Data.augmentationShape(augmentations[key].prototype);
+ for (shapeKey in shape) {
+ property = shape[shapeKey];
+ instanceMembers[shapeKey] = defineMixedProperty(deflate, key, shapeKey, shape[shapeKey])
+ }
+ }
+ var mixConstructor = function mixConstructor() {
+ var args = arguments;
+ constructors.forEach(function (constructor) {
+ constructor.apply(this, args)
+ }, this)
+ };
+ return MSE.Data.define(mixConstructor, instanceMembers)
+ }
+ })(), mix: function mix(augmentations) {
+ return this._mix(true, augmentations)
+ }, mixNoDeflate: function mixNoDeflate(augmentations) {
+ return this._mix(false, augmentations)
+ }, define: function define(constructor, instanceMembers, staticMembers) {
+ return MSE.Data.derive(null, constructor, instanceMembers, staticMembers)
+ }, derive: (function () {
+ return function derive(base, constructor, instanceMembers, staticMembers) {
+ base = base || MSE.Data.Augmentation;
+ if (!constructor)
+ constructor = function defaultConstructor() {
+ this.base.apply(this, arguments)
+ };
+ var adjustedInstanceMembers = { _augmentationShape: instanceMembers };
+ for (var key in instanceMembers)
+ adjustedInstanceMembers[key] = MSE.Data.Augmentation.defineProperty(key, instanceMembers[key]);
+ if (adjustedInstanceMembers._augmentationShape && base && base.prototype)
+ adjustedInstanceMembers._augmentationShape._baseAugmentationShape = base.prototype._augmentationShape;
+ return MS.Entertainment.derive(base, constructor, adjustedInstanceMembers, staticMembers)
+ }
+ })(), augment: function augment(data, Augmentation) {
+ var result;
+ if (data === null)
+ return null;
+ if (typeof data !== "object")
+ throw new Error("Can't augment a non-object types. " + (typeof data));
+ if (Augmentation) {
+ result = new Augmentation(data);
+ MSE.Data.assert(result._augmentBackingData === data, "During augmentation the the backing data didn't equal the expected value. Are you sure your Augmentation definition is calling the base constructor?")
+ }
+ else
+ result = data;
+ return result
+ }, augmentArrayItems: function (data, augmentationOrFactory) {
+ if (!Array.isArray(data))
+ throw new Error("Can't call augmentArrayItems a non-array types. " + (typeof data));
+ var itemFactory;
+ if (!augmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(augmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(augmentationOrFactory);
+ else
+ itemFactory = augmentationOrFactory;
+ var result = data;
+ if (itemFactory) {
+ result = [];
+ for (var i = 0; i < data.length; i++)
+ result[i] = itemFactory(data[i])
+ }
+ return result
+ }, augmentationShape: function augmentationShape(data) {
+ var key;
+ var result = {};
+ var shape = (data && data._augmentationShape) ? data._augmentationShape : (data && data.prototype) ? data.prototype._augmentationShape : null;
+ while (shape) {
+ for (key in shape)
+ if (!(key in result))
+ result[key] = shape[key];
+ shape = shape._baseAugmentationShape
+ }
+ return result
+ }, hydratedProperties: function hydratedProperties(data) {
+ var key;
+ var result = [];
+ var augmentationShape = MSE.Data.augmentationShape(data);
+ for (key in augmentationShape)
+ if (augmentationShape[key].hydrated)
+ result.push(key);
+ return result
+ }, deflate: function (data) {
+ return data ? WinJS.Binding.unwrap(data)._augmentBackingData || data : data
+ }, deflateOrFail: function (data) {
+ return WinJS.Binding.unwrap(data)._augmentBackingData
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Merger", {
+ defaultMerger: function defaultMerger(item1, item2) {
+ return new MSE.Data.Property.MergedItem(item1, item2)
+ }, self: function self(item1, item2) {
+ return item1 || item2
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Comparer", {
+ defaultComparer: function defaultComparer(item1, item2) {
+ if (item1 === item2)
+ return 0;
+ else if (item1 < item2 || item2 === null || item2 === undefined)
+ return -1;
+ else if (item1 > item2 || item1 === null || item1 === undefined)
+ return 1;
+ else
+ return 0
+ }, inverseDefaultComparer: function inverseDefaultComparer(item1, item2) {
+ if (item1 === item2)
+ return 0;
+ else if (item1 > item2 || item2 === null || item2 === undefined)
+ return -1;
+ else if (item1 < item2 || item1 === null || item1 === undefined)
+ return 1;
+ else
+ return 0
+ }, dateComparer: function dateComparer(date1, date2) {
+ var isDate1 = date1 && date1.getTime;
+ var isDate2 = date2 && date2.getTime;
+ if (isDate1 && isDate2)
+ return MS.Entertainment.Data.Comparer.defaultComparer(date1.getTime(), date2.getTime());
+ else if (isDate1 && !isDate2)
+ return -1;
+ else if (isDate2 && !isDate1)
+ return 1;
+ else
+ return 0
+ }, inverseDateComparer: function dateComparer(date1, date2) {
+ var isDate1 = date1 && date1.getTime;
+ var isDate2 = date2 && date2.getTime;
+ if (isDate1 && isDate2)
+ return MS.Entertainment.Data.Comparer.inverseDefaultComparer(date1.getTime(), date2.getTime());
+ else if (isDate1 && !isDate2)
+ return -1;
+ else if (isDate2 && !isDate1)
+ return 1;
+ else
+ return 0
+ }, notFalsy: function notFalsy(item1, item2) {
+ var emptyOrNull1 = item1 === null || item1 === undefined || item1 === String.empty;
+ var emptyOrNull2 = item2 === null || item2 === undefined || item2 === String.empty;
+ if (emptyOrNull1 && emptyOrNull2)
+ return NaN;
+ else if (emptyOrNull2)
+ return -1;
+ else if (emptyOrNull1)
+ return 1;
+ else
+ return 0
+ }, preferSecond: function preferSecond(item1, item2) {
+ return 1
+ }, createPropertyComparer: function (propertyPath, innerComparer, secondPropertyPath) {
+ innerComparer = innerComparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ return function propertyComparer(item1, item2) {
+ var propertyFragments = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ var secondPropertyFragments = (secondPropertyFragments === undefined) ? propertyFragments : MSE.Utilities.getPropertyPathFragments(secondPropertyPath);
+ item1 = MSE.Data.Property._valueFromPropertyPathFragments(item1, propertyFragments);
+ item2 = MSE.Data.Property._valueFromPropertyPathFragments(item2, secondPropertyFragments);
+ return innerComparer(item1, item2)
+ }
+ }, createFilterComparer: function (filter) {
+ filter = filter || MS.Entertainment.Data.Filter.defaultFilter;
+ return function filterComparer(item1, item2) {
+ var item = item1;
+ var result = -1;
+ if ((item1 === null || item1 === undefined) && (item2 !== null && item2 !== undefined)) {
+ item = item2;
+ result = 1
+ }
+ if (filter(item))
+ result = NaN;
+ return result
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Filter", {
+ defaultFilter: function defaultFilter(item) {
+ return false
+ }, createPropertyFilter: function createPropertyFilter(propertyPath, filterOrValue) {
+ if (typeof filterOrValue === "function")
+ return function filter(item) {
+ var propertyFragments = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ item = MSE.Data.Property._valueFromPropertyPathFragments(item, propertyFragments);
+ return filterOrValue(item)
+ };
+ else
+ return function filter(item) {
+ var propertyFragments = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ item = MSE.Data.Property._valueFromPropertyPathFragments(item, propertyFragments);
+ return item !== filterOrValue
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Property", {
+ _getArray: function _getArray(original, propertyPathFragments) {
+ var data;
+ var returnResult = {
+ length: 0, data: []
+ };
+ if (MSE.Data.Property._hasPropertyPathFragments(original, propertyPathFragments)) {
+ data = MSE.Data.Property._valueFromPropertyPathFragments(original, propertyPathFragments);
+ if (MSE.Data.VectorViewWrapper.isVectorView(data)) {
+ returnResult.length = MSE.Data.VectorViewWrapper.getLength(data);
+ returnResult.data = data
+ }
+ else if (Array.isArray(data)) {
+ returnResult.length = data.length;
+ returnResult.data = data
+ }
+ else {
+ returnResult.length = 1;
+ returnResult.data = [data]
+ }
+ }
+ return returnResult
+ }, MergedItem: MS.Entertainment.UI.Framework.define(function _mergedItem(source1, source2) {
+ this.source = [];
+ if (source1 !== undefined)
+ this.source[0] = source1;
+ if (source2 !== undefined)
+ this.source[1] = source2
+ }, {
+ source: null, primary: {
+ get: function () {
+ return this.source[0] !== undefined ? this.source[0] : this.source[1]
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Property", {
+ _getPropertyPathFragments: function _getPropertyPathFragments(source, propertyPath) {
+ if (Array.isArray(propertyPath) && source) {
+ var propertyPathArray = propertyPath;
+ propertyPath = null;
+ for (var i = 0; i < propertyPathArray.length; i++) {
+ propertyPath = propertyPathArray[i];
+ if (MSE.Data.Property._hasPropertyPath(source, propertyPath))
+ break
+ }
+ }
+ var result;
+ if (Array.isArray(propertyPath)) {
+ result = [];
+ for (var j = 0; j < propertyPath.length; j++)
+ result.push(MSE.Utilities.getPropertyPathFragments(propertyPath[j]))
+ }
+ else
+ result = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ return result
+ }, _valueFromPropertyPathFragments: function _valueFromPropertyPathFragments(original, fragments) {
+ var result;
+ if (Array.isArray(fragments) && Array.isArray(fragments[0])) {
+ result = [];
+ for (var i = 0; i < fragments.length; i++)
+ result.push(MSE.Utilities.valueFromPropertyPathFragments(original, fragments[i]))
+ }
+ else
+ result = MSE.Utilities.valueFromPropertyPathFragments(original, fragments);
+ return result
+ }, _setFromPropertyPathFragments: function _setFromPropertyPathFragments(original, fragments, value) {
+ if (Array.isArray(fragments) && Array.isArray(fragments[0]))
+ MSE.Utilities.setFromPropertyPathFragments(original, fragments[0], value);
+ else
+ MSE.Utilities.setFromPropertyPathFragments(original, fragments, value)
+ }, _hasPropertyPath: function _hasPropertyPath(source, propertyPath) {
+ var hasPath = false;
+ if (Array.isArray(propertyPath)) {
+ for (var i = 0; i < propertyPath.length; i++)
+ if (MSE.Utilities.hasPropertyPath(source, propertyPath[i])) {
+ hasPath = true;
+ break
+ }
+ }
+ else
+ hasPath = MSE.Utilities.hasPropertyPath(source, propertyPath);
+ return hasPath
+ }, _hasPropertyPathFragments: function _hasPropertyPathFragments(source, propertyPathFragments) {
+ var hasPath = false;
+ if (Array.isArray(propertyPathFragments) && Array.isArray(propertyPathFragments[0])) {
+ for (var i = 0; i < propertyPathFragments.length; i++)
+ if (MSE.Utilities.hasPropertyPathFragments(source, propertyPathFragments[i])) {
+ hasPath = true;
+ break
+ }
+ }
+ else
+ hasPath = MSE.Utilities.hasPropertyPathFragments(source, propertyPathFragments);
+ return hasPath
+ }, _getDefaultValue: function _getDefaultValue(defaultValue, source) {
+ if (defaultValue && typeof defaultValue === "function")
+ defaultValue = defaultValue.call(source);
+ return defaultValue
+ }, _getFeatureEnabled: function _getFeatureEnabled(options) {
+ var featureEnabled = true;
+ if (options && options.feature !== undefined) {
+ var feature = options.feature;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (Array.isArray(feature))
+ for (var i = 0; i < feature.length; i++) {
+ featureEnabled = featureEnablement.isEnabled(feature[i]);
+ if (featureEnabled)
+ break
+ }
+ else
+ featureEnabled = featureEnablement.isEnabled(feature)
+ }
+ return featureEnabled
+ }, hydrated: function hydrated(property, overrideComparer) {
+ if (!property)
+ throw new Error("Invalid parameter. Property was not defined");
+ property.hydrated = true;
+ if (overrideComparer)
+ property.hydratedComparer = overrideComparer;
+ return property
+ }, hydratedRequired: function hydratedRequired(property, overrideComparer) {
+ property = MSE.Data.Property.hydrated(property, overrideComparer);
+ property.hydratedRequired = true;
+ return property
+ }, hydratedIfAvailable: function hydratedIfAvailable(property, overrideComparer) {
+ property = MSE.Data.Property.hydrated(property, overrideComparer);
+ property.hydratedIfAvailable = true;
+ return property
+ }, uncachable: function uncachable(property) {
+ property.cacheable = false;
+ return property
+ }, copyHydrated: function copyHydrated(destination, source) {
+ if (source && destination) {
+ destination.hydrated = source.hydrated;
+ destination.hydratedRequired = source.hydratedRequired;
+ destination.hydratedComparer = source.hydratedComparer
+ }
+ return destination
+ }, value: function value(defaultValue) {
+ var property = {
+ get: function () {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, _alias: function _alias(deflate, source, defaultValue) {
+ var property = {
+ get: function () {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ return MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ }, set: function (value) {
+ if (this._cache) {
+ var original = (deflate) ? MSE.Data.deflate(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ MSE.Data.Property._setFromPropertyPathFragments(original, fragments, value)
+ }
+ }, augmented: true, enumerable: true, configurable: true
+ };
+ return property
+ }, alias: function (source, defaultValue) {
+ return MSE.Data.Property._alias(true, source, defaultValue)
+ }, _convertOriginal: function _convertOriginal(deflate, source, initializerCallback, defaultValue) {
+ if (!initializerCallback)
+ throw new Error("Invalid augument to convertOriginal. The given callback was null or undefined. Source = " + source);
+ var property = MSE.Data.Property._alias(deflate, source, defaultValue);
+ property.initializer = function initializer() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ initializerCallback(original, fragments, original, fragments);
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property)
+ };
+ return property
+ }, convertOriginal: function convertOriginal(source, callback, defaultValue) {
+ return MSE.Data.Property._convertOriginal(true, source, callback, defaultValue)
+ }, convertOriginalNoDeflate: function convertOriginalNoDeflate(source, callback, defaultValue) {
+ return MSE.Data.Property._convertOriginal(false, source, callback, defaultValue)
+ }, _convert: function _convert(deflate, source, parser, defaultValue, options) {
+ if (!parser)
+ throw new Error("Invalid augument. The given parser was null or undefined. Source = " + source);
+ var property = {
+ get: function () {
+ var result;
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ var featureEnabled = MSE.Data.Property._getFeatureEnabled(options);
+ if (!featureEnabled)
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this);
+ else if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ result = parser(MSE.Data.Property._valueFromPropertyPathFragments(original, fragments));
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, convert: function convert(source, parser, defaultValue, options) {
+ return MSE.Data.Property._convert(true, source, parser, defaultValue, options)
+ }, convertNoDeflate: function (source, parser, defaultValue, options) {
+ return MSE.Data.Property._convert(false, source, parser, defaultValue, options)
+ }, _augment: function (deflate, source, augmentationOrFactory, defaultValue) {
+ if (!augmentationOrFactory)
+ throw new Error("Invalid augument. The given augmentationOrFactory definition was null or undefined. Source = " + source);
+ var itemFactory;
+ if (!augmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(augmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(augmentationOrFactory);
+ else
+ itemFactory = augmentationOrFactory;
+ var property = {
+ get: function () {
+ var result;
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ original = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ if (Array.isArray(original))
+ result = MSE.Data.augmentArrayItems(original, itemFactory);
+ else
+ result = itemFactory(original)
+ }
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, augmentation: MSE.Data.Property._augment, augmentationOptions: {
+ deflate: deflate, source: source, augmentation: augmentationOrFactory, defaultValue: defaultValue
+ }
+ };
+ return property
+ }, augment: function (source, augmentation, defaultValue) {
+ return MSE.Data.Property._augment(true, source, augmentation, defaultValue)
+ }, augmentNoDeflate: function (source, augmentation, defaultValue) {
+ return MSE.Data.Property._augment(false, source, augmentation, defaultValue)
+ }, sortArray: function sortArray(source, comparer, augmentation, defaultValue) {
+ var result = MSE.Data.Property.augment(source, augmentation, defaultValue);
+ var oldGetter = result.get;
+ if (!comparer)
+ throw new Error("Invalid augument. The given comparer was null or undefined. Comparer = " + comparer);
+ return {
+ get: function () {
+ var result = oldGetter.apply(this);
+ if (Array.isArray(result))
+ result = result.sort(comparer);
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, augmentation: MSE.Data.Property.sortArray, augmentationOptions: {
+ source: source, comparer: comparer, augmentation: augmentation, defaultValue: defaultValue
+ }
+ }
+ }, format: function (source, stringId, defaultValue) {
+ if (!stringId) {
+ MSE.Data.fail("Invalid augument. The given stringId was null or undefined. Source = " + source);
+ return String.empty
+ }
+ var property = {
+ get: function () {
+ var result = defaultValue;
+ var byPassDeflate = arguments[0];
+ var original = !byPassDeflate ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (source === null)
+ result = String.load(stringId);
+ else if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ result = String.load(stringId).format(MSE.Data.Property._valueFromPropertyPathFragments(original, fragments));
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, _collect: function _collect(deflate, sources, parser, defaultValue) {
+ var property = {
+ get: function () {
+ var i,
+ currentParser,
+ fragments;
+ var result = [];
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ if (sources)
+ for (i = 0; i < sources.length; i += 1) {
+ currentParser = (Array.isArray(parser)) ? parser[i] : parser;
+ fragments = MSE.Data.Property._getPropertyPathFragments(original, sources[i]);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ var item = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ if (currentParser)
+ item = currentParser(item);
+ result.push(item)
+ }
+ else if (defaultValue !== undefined) {
+ var item = defaultValue;
+ if (currentParser)
+ item = currentParser(item);
+ result.push(item)
+ }
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, collect: function collect(sources, parser, defaultValue) {
+ return MS.Entertainment.Data.Property._collect(true, sources, parser, defaultValue)
+ }, collectNoDeflate: function collectNoDeflate(sources, parser, defaultValue) {
+ return MS.Entertainment.Data.Property._collect(false, sources, parser, defaultValue)
+ }, _filterArray: function _filterArray(deflate, source, filter, augmentation) {
+ var property = MSE.Data.Property._filter(deflate, source, filter, augmentation);
+ property.resultConstructor = Array.prototype.constructor;
+ var originalGet = property.get;
+ property.get = function get() {
+ MS.Entertainment.Data.Property.copyHydrated(originalGet, property);
+ var list = originalGet.call(this);
+ var array = (list && list.source) ? list.source : [];
+ return MS.Entertainment.Data.augmentArrayItems(array, augmentation)
+ };
+ property.augmentation = MSE.Data.Property._filterArray;
+ property.augmentationOptions = {
+ deflate: deflate, source: source, filter: filter, augmentation: augmentation
+ };
+ return property
+ }, filterArray: function filterArray(source, filter, augmentation) {
+ return MS.Entertainment.Data.Property._filterArray(true, source, filter, augmentation)
+ }, filterArrayNoDeflate: function filterArrayNoDeflate(source, filter, augmentation) {
+ return MS.Entertainment.Data.Property._filterArray(false, source, filter, augmentation)
+ }, _search: function _search(deflate, source, filter, defaultValue) {
+ if (!source)
+ throw new Error("Invalid augument. The given source was null or undefined. Source = " + source);
+ if (!filter)
+ throw new Error("Invalid augument. The given filter function was null or undefined. Filter = " + filter);
+ var property = {
+ get: function () {
+ var i;
+ var result = null;
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ var sourceValue = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ if (Array.isArray(sourceValue)) {
+ for (i = 0; i < sourceValue.length; i++)
+ if (!filter(sourceValue[i])) {
+ result = sourceValue[i];
+ break
+ }
+ }
+ else if (!filter(sourceValue))
+ result = sourceValue
+ }
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, search: function search(source, filter, defaultValue) {
+ return MS.Entertainment.Data.Property._search(true, source, filter, defaultValue)
+ }, searchNoDeflate: function search(source, filter, defaultValue) {
+ return MS.Entertainment.Data.Property._search(false, source, filter, defaultValue)
+ }, isList: function isList(augmentation) {
+ return augmentation && augmentation.resultConstructor === MSE.Data.VirtualList.prototype.constructor
+ }, createAugmentation: function createAugmentation(original, optionOverrides) {
+ var result = null;
+ var key;
+ var augmentationOptions;
+ if (original && original.augmentation && original.augmentationOptions) {
+ optionOverrides = optionOverrides || {};
+ augmentationOptions = [];
+ for (key in original.augmentationOptions)
+ if (key in optionOverrides)
+ augmentationOptions.push(optionOverrides[key]);
+ else
+ augmentationOptions.push(original.augmentationOptions[key]);
+ result = original.augmentation.apply(this, augmentationOptions)
+ }
+ return result
+ }, list: function (source, itemAugmentationOrFactory, defaultValue) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ var property = {
+ get: function () {
+ var result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this);
+ var byPassDeflate = arguments[0];
+ var original = !byPassDeflate ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ result = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ result = new MSE.Data.VirtualList(itemFactory, result)
+ }
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor, augmentation: MSE.Data.Property.list, augmentationOptions: {
+ source: source, itemAugmentationOrFactory: itemAugmentationOrFactory, defaultValue: defaultValue
+ }
+ };
+ return property
+ }, listWithContext: function listWithContext(source, context, itemAugmentationOrFactory, defaultValue) {
+ var innerItemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ innerItemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ innerItemFactory = itemAugmentationOrFactory;
+ var property = MSE.Data.Property.list(source, itemAugmentationOrFactory, defaultValue);
+ var oldGetter = property.get;
+ property.get = function () {
+ var result = oldGetter.apply(this, arguments);
+ var byPassDeflate = arguments[0];
+ var original = !byPassDeflate ? MSE.Data.deflateOrFail(this) : this;
+ var contextFragments = MSE.Data.Property._getPropertyPathFragments(original, context);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, contextFragments)) {
+ var contextValue = MSE.Data.Property._valueFromPropertyPathFragments(original, contextFragments);
+ var itemFactoryWithContext = function itemFactoryWithContext(sourceItem) {
+ return innerItemFactory(sourceItem, contextValue)
+ };
+ itemFactoryWithContext.listItemFactory = innerItemFactory.listItemFactory;
+ result.setItemFactory(itemFactoryWithContext)
+ }
+ return result
+ };
+ property.augmentation = MSE.Data.Property.listWithContext,
+ property.augmentationOptions = {
+ source: source, context: context, itemAugmentationOrFactory: itemAugmentationOrFactory, defaultValue: defaultValue
+ };
+ return property
+ }, _sort: function _sort(deflate, source, comparer, filter, itemAugmentationOrFactory) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ comparer = comparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ var property = {
+ get: function union() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ var array = source !== undefined ? MSE.Data.Property._getArray(original, fragments).data : [];
+ var arrayLength = array.length;
+ var sortedArray = [];
+ if (filter)
+ array = array.filter(filter);
+ sortedArray = array.sort(comparer);
+ return new MSE.Data.VirtualList(itemFactory, sortedArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor
+ };
+ return property
+ }, sort: function sort(source, comparer, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._sort(true, source, comparer, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.sort;
+ result.augmentationOptions = {
+ source: source, comparer: comparer, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, sortNoDeflate: function sortNoDeflate(source, comparer, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._sort(false, source, comparer, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.sortNoDeflate;
+ result.augmentationOptions = {
+ source: source, comparer: comparer, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, _union: function (deflate, source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ comparer = comparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ merger = merger || MS.Entertainment.Data.Merger.defaultMerger;
+ var property = {
+ get: function union() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments1 = MSE.Data.Property._getPropertyPathFragments(original, source1);
+ var fragments2 = MSE.Data.Property._getPropertyPathFragments(original, source2);
+ var array1 = source1 !== undefined ? MSE.Data.Property._getArray(original, fragments1) : [];
+ var array2 = source2 !== undefined ? MSE.Data.Property._getArray(original, fragments2) : [];
+ var array1Length = array1.length;
+ var array2Length = array2.length;
+ var empty,
+ item1,
+ item2;
+ var combinedArray = [];
+ var i = 0,
+ j = 0;
+ array1 = array1.data;
+ array2 = array2.data;
+ while ((i < array1Length || j < array2Length) && (i <= array1Length && j <= array2Length)) {
+ item1 = (i < array1Length) ? array1[i] : empty;
+ item2 = (j < array2Length) ? array2[j] : empty;
+ var compareResult = comparer(item1, item2);
+ var mergedResult = null;
+ if (compareResult === 0) {
+ mergedResult = merger(item1, item2);
+ i++;
+ j++
+ }
+ else if (compareResult < 0) {
+ mergedResult = merger(item1);
+ i++
+ }
+ else if (!isNaN(compareResult)) {
+ mergedResult = merger(empty, item2);
+ j++
+ }
+ else {
+ if (i < array1Length)
+ i++;
+ { };
+ if (j < array2Length)
+ j++;
+ { }
+ }
+ if (mergedResult !== null && mergedResult !== undefined)
+ combinedArray.push(mergedResult)
+ }
+ return new MSE.Data.VirtualList(itemFactory, combinedArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor
+ };
+ return property
+ }, union: function (source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._union(true, source1, source2, comparer, merger, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.union;
+ result.augmentationOptions = {
+ source1: source1, source2: source2, comparer: comparer, merger: merger, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, unionNoDeflate: function (source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._union(false, source1, source2, comparer, merger, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.unionNoDeflate;
+ result.augmentationOptions = {
+ source1: source1, source2: source2, comparer: comparer, merger: merger, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, _reorder: function (deflate, orderSource, parentSource, itemAugmentationOrFactory, returnArray) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ var property = {
+ get: function reorder() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var orderSourceFragments = MSE.Data.Property._getPropertyPathFragments(original, orderSource);
+ var orderArray = (orderSource !== undefined) ? MSE.Data.Property._getArray(original, orderSourceFragments) : [];
+ var newArray = [];
+ if (orderArray.data)
+ newArray = orderArray.data.map(function (key) {
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, parentSource + "." + key);
+ return MSE.Data.Property._valueFromPropertyPathFragments(original, fragments)
+ }.bind(this));
+ if (returnArray)
+ return MS.Entertainment.Data.augmentArrayItems(newArray, itemFactory);
+ else
+ return new MSE.Data.VirtualList(itemFactory, newArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: (returnArray) ? Array.prototype.constructor : MSE.Data.VirtualList.prototype.constructor
+ };
+ return property
+ }, reorder: function (orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(true, orderSource, parentSource, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, reorderNoDeflate: function (orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(false, orderSource, parentSource, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, reorderArray: function (orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(true, orderSource, parentSource, itemAugmentationOrFactory, true);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, reorderArrayNoDeflate: function (orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(false, orderSource, parentSource, itemAugmentationOrFactory, true);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, intersection: function (source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ comparer = comparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ merger = merger || MS.Entertainment.Data.Merger.defaultMerger;
+ var property = {
+ get: function intersection() {
+ var original = MSE.Data.deflate(this);
+ var fragments1 = MSE.Data.Property._getPropertyPathFragments(original, source1);
+ var fragments2 = MSE.Data.Property._getPropertyPathFragments(original, source2);
+ var array1 = MSE.Data.Property._getArray(original, fragments1);
+ var array2 = MSE.Data.Property._getArray(original, fragments2);
+ var array1Length = array1.length;
+ var array2Length = array2.length;
+ var combinedArray = [];
+ var i = 0,
+ j = 0;
+ var empty,
+ item1,
+ item2;
+ array1 = array1.data;
+ array2 = array2.data;
+ while ((i < array1Length || j < array2Length) && (i <= array1Length && j <= array2Length)) {
+ item1 = (i < array1Length) ? array1[i] : empty;
+ item2 = (j < array2Length) ? array2[j] : empty;
+ var compareResult = comparer(item1, item2);
+ var mergedResult = null;
+ if (compareResult === 0) {
+ mergedResult = merger(item1, item2);
+ i++;
+ j++
+ }
+ else if (compareResult < 0)
+ i++;
+ else
+ j++;
+ if (mergedResult !== null && mergedResult !== undefined)
+ combinedArray.push(mergedResult)
+ }
+ return new MSE.Data.VirtualList(itemFactory, combinedArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor, augmentation: MSE.Data.Property.list, augmentationOptions: {
+ source1: source1, source2: source2, comparer: comparer, merger: merger, itemAugmentationOrFactory: itemAugmentationOrFactory
+ }
+ };
+ return property
+ }, _filter: function _filter(deflate, source, filter, itemAugmentationOrFactory) {
+ var merger = MS.Entertainment.Data.Merger.self;
+ var comparer = MS.Entertainment.Data.Comparer.createFilterComparer(filter);
+ var undefinedVariable;
+ return MSE.Data.Property._union(deflate, source, undefinedVariable, comparer, merger, itemAugmentationOrFactory)
+ }, filter: function filter(source, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._filter(true, source, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.filter;
+ result.augmentationOptions = {
+ source: source, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, filterNoDeflate: function filterNoDeflate(source, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._filter(false, source, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.filterNoDeflate;
+ result.augmentationOptions = {
+ source: source, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, containsRight: function containsRight(right) {
+ var property = {
+ get: function () {
+ if (this.rights)
+ for (var i = 0; i < this.rights.length; i++)
+ if (this.rights[i].licenseRight === right)
+ return true;
+ return false
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Factory", {
+ array: function (data) {
+ if (data !== undefined)
+ return [data];
+ else
+ return []
+ }, joinStrings: function joinStrings() {
+ var strings = [];
+ if (arguments)
+ for (var i = 0; i < arguments.length; i++)
+ strings.push(arguments[i]);
+ return strings.join()
+ }, arrayJoin: function arrayJoin(data, seperator) {
+ seperator = seperator || "/";
+ var result = String.empty;
+ if (Array.isArray(data)) {
+ data = data.filter(function removeNullsAndNonStrings(element) {
+ return element !== null && element !== undefined && typeof element === "string"
+ });
+ result = data.join(seperator)
+ }
+ return result
+ }, arrayJoinWithNewLines: function arrayJoinWithNewLines(data) {
+ return MSE.Data.Factory.arrayJoin(data, "\n\n")
+ }, bool: function bool(data) {
+ return (data) ? true : false
+ }, not: function not(data) {
+ return (!data) ? true : false
+ }, boolFromString: function boolFromString(data) {
+ var re = /^((t)|(true)|(1)|(y)|(yes))$/i;
+ var type = typeof (data);
+ if (type === "boolean")
+ return data;
+ else
+ return (data && typeof (data) === "string" && data.match(re)) ? true : false
+ }, string: function string(data) {
+ return (data) ? "" + data : null
+ }, stringNoNewLines: function stringNoNewLines(data) {
+ if (data) {
+ data = "" + data;
+ data = data.replace(/(\r\n)|(\r)|(\n)|(\u2028)|(\u2029)/g, " ")
+ }
+ { };
+ return data
+ }, stringOrEmpty: function stringOrEmpty(data) {
+ if (typeof data === "string")
+ return data;
+ else
+ return ""
+ }, stringOrUnknown: function stringOrUnknown(data) {
+ var result = MS.Entertainment.Data.Factory.string(data);
+ return result || String.load(String.id.IDS_UNKNOWN_VALUE)
+ }, intNumber: function intNumber(data) {
+ return parseInt(data)
+ }, formattedIntNumber: function formattedIntNumber(data) {
+ var intValue = parseInt(data);
+ var formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(intValue);
+ return formattedNum
+ }, floatNumber: function floatNumber(data) {
+ return parseFloat(data)
+ }, date: function date(data) {
+ var returnValue;
+ if (!data)
+ returnValue = null;
+ else if (data.constructor === Date)
+ returnValue = new Date(data);
+ else if (data.constructor === String) {
+ var matches = data.match(/^\/Date\((-{0,1}[0-9]*)(\+|-){0,1}([0-9]{4}){0,1}\)\/$/);
+ if (matches && matches[1]) {
+ returnValue = new Date(parseInt(matches[1]));
+ if (matches[2] && matches[3])
+ if (matches[2] === "+")
+ returnValue.setUTCHours(returnValue.getUTCHours() - parseInt(matches[3]));
+ else
+ returnValue.setUTCHours(returnValue.getUTCHours() + parseInt(matches[3]))
+ }
+ else
+ returnValue = MSE.Data.stringParser.dateFromUTC(data)
+ }
+ else if (data.universalTime !== undefined)
+ returnValue = new Date(data.universalTime);
+ else
+ returnValue = null;
+ return returnValue
+ }, databaseDateFromYear: function databaseDateFromYear(year) {
+ var date = null;
+ var databaseDate = null;
+ var parsedYear = parseInt(year);
+ if (parsedYear >= 0) {
+ date = new Date(year, 1, 2, 0, 0, 0, 0);
+ databaseDate = MS.Entertainment.Formatters.formatDatabaseDataFromReleaseDate(date)
+ }
+ else
+ MS.Entertainment.Data.fail("Factory::databaseDateFromYear. Invalid year: " + year);
+ return databaseDate
+ }, dateNow: function dateNow() {
+ return new Date
+ }, databaseDate: function databaseDate(data) {
+ var returnValue;
+ if (!data || (data.constructor === String && (data === "0001-01-01T00:00:00.000Z" || data === "1601-01-01T00:00:00Z")))
+ returnValue = null;
+ else
+ returnValue = MSE.Data.Factory.date(data);
+ return returnValue
+ }, secondsToMilliseconds: function secondsToMilliseconds(data) {
+ return parseInt(data) * 1000
+ }, year: function year(data) {
+ var resultValue = null;
+ if (!data)
+ resultValue = null;
+ else if (data.constructor === Date)
+ resultValue = data.getFullYear();
+ else
+ resultValue = data;
+ return resultValue
+ }, localizedYear: function localizedYear(date) {
+ var year = String.empty;
+ var yearNumber = NaN;
+ if (date && date.constructor !== Date) {
+ if (String.isString(date))
+ yearNumber = parseInt(date);
+ if (isNaN(yearNumber))
+ date = new Date(date);
+ else {
+ date = new Date;
+ date.setFullYear(yearNumber)
+ }
+ }
+ if (date && !isNaN(date.getTime())) {
+ var formattedYear = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ year = formattedYear.format(date)
+ }
+ return year
+ }, randomDate: function randomDate(data) {
+ var daysBefore = Math.floor(Math.random() * 9 + 1);
+ var daysBeforeMS = daysBefore * 24 * 60 * 60 * 1000;
+ var returnValue = new Date((new Date).getTime() - daysBeforeMS);
+ returnValue.setMilliseconds(0);
+ returnValue.setSeconds(0);
+ returnValue.setMinutes(0);
+ returnValue.setHours(0);
+ return returnValue
+ }, timeSpan: function timeSpan(data) {
+ var returnValue;
+ if (typeof data === "string")
+ returnValue = MSE.Data.stringParser.timeSpanFromXmlDuration(data);
+ return returnValue
+ }, guid: function guid(data) {
+ if (data && data.replace && data.toLowerCase) {
+ data = data.toLowerCase();
+ data = data.replace(/(^http.*%2f)|(^urn:uuid:)|(^\s)|(\s$)/ig, String.empty)
+ }
+ return data
+ }, normalizeSpacing: function normalizeSpacing(source) {
+ if (source)
+ source = (source + "").trim().replace(/(\s+)/g, " ");
+ return source
+ }, appendCharacterDirection: function appendCharacterDirection(value) {
+ var result = value;
+ if (value && String.isString(value)) {
+ var appTextDirection = MSE.Utilities.getTextDirection();
+ var dataTextDirection = MSE.Utilities.detectStringDirection(value);
+ if (appTextDirection !== dataTextDirection) {
+ var directionMarkerCharacter = (dataTextDirection === MSE.Utilities.TextDirections.RightToLeft) ? String.rtlm : String.ltrm;
+ var firstCharacterDirection = MSE.Utilities.detectCharacterDirection(value.charCodeAt(0));
+ if (!firstCharacterDirection)
+ result = [directionMarkerCharacter, value, directionMarkerCharacter].join(String.empty);
+ else
+ result = value + directionMarkerCharacter
+ }
+ }
+ return result
+ }, normalizeTextDirection: function normalizeTextDirection(source, sourcePropertyPath, destination, destinationPropertyPath) {
+ var newString;
+ var oldString = MSE.Data.Property._valueFromPropertyPathFragments(source, sourcePropertyPath);
+ if (oldString === null || oldString === undefined || typeof oldString === "object")
+ newString = String.empty;
+ else if (oldString)
+ newString = MSE.Data.Factory.appendCharacterDirection(oldString);
+ if (newString || newString === String.empty)
+ MSE.Data.Property._setFromPropertyPathFragments(destination, destinationPropertyPath, newString)
+ }, normalizeStringForVoice: function normalizeStringForVoice(stringToScrub) {
+ return MSE.Data.Factory.stringOrEmpty(stringToScrub)
+ }, normalizeStringForVoiceShort: function normalizeStringForVoiceShort(stringToScrub) {
+ return MSE.Data.Factory.stringOrEmpty(stringToScrub)
+ }, normalizeStringForVoiceLong: function normalizeStringForVoiceLong(stringToScrub) {
+ return MSE.Data.Factory.stringOrEmpty(stringToScrub)
+ }, oneTimeUseBlob: function oneTimeUseBlob(data) {
+ var resultValue = null;
+ if (data)
+ resultValue = URL.createObjectURL(data, { oneTimeOnly: true });
+ return resultValue
+ }, parseJSON: function parseJSON(data) {
+ var result = null;
+ if (data)
+ try {
+ result = JSON.parse(data)
+ }
+ catch (error) {
+ MS.Entertainment.Data.fail("Failed to parse JSON. Error: " + (error && error.message))
+ }
+ return result
+ }, self: function self(data) {
+ return data
+ }, ListItemWrapper: MS.Entertainment.UI.Framework.define(function listItemWrapper(source, factory, initializer) {
+ Object.defineProperty(this, "_privateDataCache", {
+ value: {
+ source: source, factory: factory, initializer: initializer, group: null, isNonSourceData: false, isHeader: false, itemIndex: -1, groupIndexHint: null, groupKey: null, groupData: null, firstItemDescription: null, firstItemIndexHint: -1, firstItemKey: null
+ }, enumerable: false
+ })
+ }, {
+ key: null, data: {
+ get: function () {
+ if (this._privateDataCache.factory) {
+ this._privateDataCache.data = this._privateDataCache.factory(this._privateDataCache.source);
+ if (this._privateDataCache.initializer)
+ this._privateDataCache.initializer(this._source, this._privateData);
+ this._privateDataCache.initializer = null;
+ this._privateDataCache.source = null;
+ this._privateDataCache.factory = null
+ }
+ return this._privateDataCache.data
+ }
+ }, itemIndex: {
+ get: function () {
+ return this._privateDataCache.itemIndex
+ }, set: function (value) {
+ this._privateDataCache.itemIndex = value
+ }, enumerable: false
+ }, firstItemDescription: {
+ get: function () {
+ return this._privateDataCache.firstItemDescription || { sourceIndexHint: this.data && typeof this.data.firstItemIndexSourceHint === "number" ? this.data.firstItemIndexSourceHint : -1 }
+ }, set: function (value) {
+ this._privateDataCache.firstItemDescription = value
+ }, enumerable: false
+ }, firstItemIndexHint: {
+ get: function () {
+ return this._privateDataCache.firstItemIndexHint
+ }, set: function (value) {
+ this._privateDataCache.firstItemIndexHint = value
+ }, enumerable: false
+ }, firstItemKey: {
+ get: function () {
+ return this._privateDataCache.firstItemKey
+ }, set: function (value) {
+ this._privateDataCache.firstItemKey = value
+ }, enumerable: false
+ }, groupIndexHint: {
+ get: function () {
+ return this._privateDataCache.groupIndexHint
+ }, set: function (value) {
+ this._privateDataCache.groupIndexHint = value
+ }, enumerable: false
+ }, groupKey: {
+ get: function () {
+ return this._privateDataCache.groupKey || (this.group && this.group.parentKey)
+ }, set: function (value) {
+ this._privateDataCache.groupKey = value
+ }, enumerable: false
+ }, groupData: {
+ get: function () {
+ return this._privateDataCache.groupData || this.data
+ }, set: function (value) {
+ this._privateDataCache.groupData = value
+ }, enumerable: false
+ }, isNonSourceData: {
+ get: function () {
+ return this._privateDataCache.isNonSourceData
+ }, set: function (value) {
+ this._privateDataCache.isNonSourceData = value
+ }, enumerable: false
+ }, isHeader: {
+ get: function () {
+ return this._privateDataCache.isHeader
+ }, set: function (value) {
+ this._privateDataCache.isHeader = value
+ }, enumerable: false
+ }, group: {
+ get: function () {
+ return this._privateDataCache.group
+ }, set: function (value) {
+ this._privateDataCache.group = value
+ }, enumerable: false
+ }, cached: {
+ get: function () {
+ return (!!this._privateDataCache.factory) || (this._privateDataCache.data !== undefined && this._privateDataCache !== null)
+ }, enumerable: false
+ }, clearCache: function clearCache() {
+ this._privateDataCache.data = null;
+ this._privateDataCache.initializer = null;
+ this._privateDataCache.source = null;
+ this._privateDataCache.factory = null
+ }
+ }, {
+ copyData: function copyData(destination, source, factory, initializer) {
+ destination._privateDataCache.data = null;
+ destination._privateDataCache.source = source;
+ destination._privateDataCache.factory = factory;
+ destination._privateDataCache.initializer = initializer;
+ return destination
+ }, addFirstItemKey: function firstItemKey(item, callback) {
+ this._addProperty("firstItemKey", item, callback)
+ }, addFirstItemIndexHint: function addFirstItemIndexHint(item, callback) {
+ this._addProperty("firstItemIndexHint", item, callback)
+ }, _addProperty: function _addProperty(property, item, callback) {
+ if (callback)
+ Object.defineProperty(item, property, {
+ get: function () {
+ if (callback)
+ return callback();
+ else
+ return this._privateDataCache && this._privateDataCache["firstItemIndexHint"]
+ }, set: function (value) {
+ callback = null;
+ this._privateDataCache["firstItemIndexHint"] = value
+ }, enumerable: false
+ })
+ }
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Factory", {
+ GroupHintWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function groupHintWrapper(source, factory, initializer) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.apply(this, arguments)
+ }, {
+ getHashCode: function getHashCode() {
+ return this.data && this.data.groupKey
+ }
+ }), ListHeaderWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function listHeaderWrapper(group, firstItemIndexHint) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.call(this);
+ this._privateDataCache.data = group.data;
+ this.group = group;
+ this.isNonSourceData = true;
+ this.isHeader = true;
+ this.firstItemIndexHint = firstItemIndexHint
+ }, { preventAugmentation: true }), ListActionItemWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function listHeaderWrapper(data) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.call(this);
+ this._privateDataCache.data = data;
+ this.isNonSourceData = true;
+ this.groupKey = MS.Entertainment.Data.emptyGroupKey;
+ this.groupIndexHint = 0
+ }, {
+ isAction: true, preventAugmentation: true
+ }), ListNoHeaderItemWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function listNoHeaderItemWrapper(data) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.call(this);
+ this._privateDataCache.data = data;
+ this.isNonSourceData = true;
+ this.groupKey = MS.Entertainment.Data.emptyGroupKey;
+ this.groupIndexHint = 0
+ }, {
+ noHeader: true, preventAugmentation: true
+ }), createAugmentationFactory: function createAugmentationFactory(augmentation) {
+ return function augmentationFactory(sourceItem) {
+ return MSE.Data.augment(sourceItem, augmentation)
+ }
+ }, createDerivedAugmentationOrFactory: function createDerivedAugmentationOrFactory(augmentationOrFactory, definition) {
+ var result;
+ if (!augmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(augmentationOrFactory.prototype))
+ result = MS.Entertainment.Data.derive(augmentationOrFactory || null, null, definition);
+ else
+ result = function augmentationFactory(sourceItem) {
+ var value = augmentationOrFactory(sourceItem);
+ return MS.Entertainment.Data.Augmentation.addProperties(value, definition)
+ };
+ return result
+ }, createListItemAugmentationFactory: function createListItemAugmentationFactory(augmentation, initializer, ListItemWrapperConstructor) {
+ return MSE.Data.Factory.createListItemFactory(MSE.Data.Factory.createAugmentationFactory(augmentation), initializer, ListItemWrapperConstructor)
+ }, createListItemFactory: function createListItemFactory(innerFactory, initializer, ListItemWrapperConstructor) {
+ if (!innerFactory)
+ throw "must provide an inner factory if creating a lazy factory method";
+ var factory = function factoryMethod(source, destination) {
+ if (source && source.preventAugmentation)
+ return source;
+ else if (destination)
+ return MS.Entertainment.Data.Factory.ListItemWrapper.copyData(destination, source, innerFactory, initializer);
+ else if (ListItemWrapperConstructor)
+ return new ListItemWrapperConstructor(source, innerFactory, initializer);
+ else
+ return new MS.Entertainment.Data.Factory.ListItemWrapper(source, innerFactory, initializer)
+ };
+ factory.listItemFactory = true;
+ return factory
+ }
+ })
+ })()
+})();
+/* >>>>>>/framework/data/ranges.js:17403 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+ (function (MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ Ranges: MS.Entertainment.UI.Framework.define(function ranges(initialRanges) {
+ this._ranges = [];
+ if (Array.isArray(initialRanges))
+ initialRanges.forEach(function addRange(range) {
+ this._ranges.push(this._createRange(range.start, range.end))
+ }, this);
+ else if (initialRanges)
+ this._ranges.push(this._createRange(initialRanges.start, initialRanges.end))
+ }, {
+ singleItems: false, _ranges: null, _cachedTotal: -1, _createRange: function _createRange(index, endIndex) {
+ return {
+ start: index, end: isNaN(endIndex) ? index : endIndex
+ }
+ }, total: {
+ get: function get_total() {
+ this._initializeTotal();
+ return this._cachedTotal
+ }
+ }, ranges: {
+ get: function () {
+ return this._ranges.map(function (item) {
+ return this._createRange(item.start, item.end)
+ }, this)
+ }
+ }, printRanges: function printRanges() {
+ Debug.console.log(0, "[START PRINT RANGES]");
+ this._ranges.forEach(function (item) {
+ Debug.console.log(0, "[RANGE] [start = " + item.start + "] [end = " + item.end + "]")
+ }, this);
+ Debug.console.log(0, "[END PRINT RANGES]")
+ }, shift: function shift(startIndex, forward) {
+ var i;
+ var increase = (forward) ? 1 : -1;
+ var foundRangeIndex = -1;
+ var foundRange;
+ for (i = 0; i < this._ranges.length; i++)
+ if ((this._ranges[i].start > startIndex) || (this._ranges[i].end >= startIndex)) {
+ foundRangeIndex = i;
+ break
+ }
+ if (foundRangeIndex >= 0) {
+ foundRange = this._ranges[foundRangeIndex];
+ if (foundRange.start < startIndex && foundRange.end >= startIndex) {
+ if (increase > 0) {
+ this._ranges.splice(foundRangeIndex, 0, this._createRange(foundRange.start, startIndex - 1));
+ foundRange.start = startIndex
+ }
+ else
+ foundRange.end += increase;
+ if (foundRange.end < foundRange.start)
+ this._ranges.splice(foundRangeIndex, 1);
+ else
+ foundRangeIndex++
+ }
+ for (i = foundRangeIndex; i < this._ranges.length; i++) {
+ this._ranges[i].start += increase;
+ this._ranges[i].end += increase
+ }
+ if (!this.singleItems) {
+ var right = this._ranges[foundRangeIndex + 1];
+ if (right && right.start <= foundRange.end + 1) {
+ foundRange.end = right.end;
+ this._ranges.splice(foundRangeIndex + 1, 1)
+ }
+ var left = this._ranges[foundRangeIndex - 1];
+ if (left && left.end >= foundRange.start - 1) {
+ foundRange.start = left.start;
+ this._ranges.splice(foundRangeIndex - 1, 1)
+ }
+ }
+ }
+ }, get: function get(index) {
+ return this._ranges ? this._ranges[index] : null
+ }, forEach: function forEach(callback, that) {
+ if (this._ranges)
+ for (var i = 0; i < this._ranges.length; i++)
+ if (callback.call(that || window, this._ranges[i]))
+ break
+ }, findLessThanOrEqual: function findLessThanOrEqual(index) {
+ var i;
+ var foundRangeIndex = -1;
+ for (i = 0; i < this._ranges.length; i++) {
+ if (this._ranges[i].end > index)
+ break;
+ foundRangeIndex = i
+ }
+ return foundRangeIndex
+ }, findIndex: function findIndex(index) {
+ var i;
+ var foundRangeIndex = -1;
+ for (i = 0; i < this._ranges.length; i++)
+ if (this._ranges[i].start <= index && this._ranges[i].end >= index) {
+ foundRangeIndex = i;
+ break
+ }
+ return foundRangeIndex
+ }, find: function find(index) {
+ var foundRange = null;
+ var foundRangeIndex = this.findIndex(index);
+ if (foundRangeIndex >= 0)
+ foundRange = this._ranges[foundRangeIndex];
+ return foundRange
+ }, insert: function insert(index) {
+ var i;
+ var foundRangeIndex = -1;
+ var foundRange;
+ var inserted = true;
+ for (i = 0; i < this._ranges.length; i++)
+ if (this._ranges[i].end + 1 >= index && this._ranges[i].start - 1 <= index && !this.singleItems) {
+ foundRangeIndex = i;
+ foundRange = this._ranges[foundRangeIndex];
+ break
+ }
+ else if (this._ranges[i].start > index) {
+ foundRangeIndex = i;
+ break
+ }
+ if (foundRangeIndex < 0)
+ foundRangeIndex = this._ranges.length;
+ if (!foundRange) {
+ foundRange = this._createRange(index);
+ this._ranges.splice(foundRangeIndex, 0, foundRange)
+ }
+ else if (foundRange.end + 1 === index)
+ foundRange.end = index;
+ else if (foundRange.start - 1 === index)
+ foundRange.start = index;
+ else
+ inserted = false;
+ if (!this.singleItems) {
+ var right = this._ranges[foundRangeIndex + 1];
+ if (right && right.start - 1 <= foundRange.end) {
+ foundRange.end = right.end;
+ this._ranges.splice(foundRangeIndex + 1, 1)
+ }
+ var left = this._ranges[foundRangeIndex - 1];
+ if (left && left.end + 1 >= foundRange.start) {
+ foundRange.start = left.start;
+ this._ranges.splice(foundRangeIndex - 1, 1)
+ }
+ }
+ if (inserted)
+ this._updateCachedTotal(1);
+ return foundRange
+ }, remove: function remove(index) {
+ var i;
+ var foundRangeIndex = -1;
+ var foundRange;
+ var rangeRemovedFrom;
+ var split = false;
+ var removed = false;
+ for (i = 0; i < this._ranges.length; i++)
+ if (this._ranges[i].end >= index && this._ranges[i].start <= index) {
+ foundRangeIndex = i;
+ break
+ }
+ rangeRemovedFrom = foundRange = this._ranges[foundRangeIndex];
+ if (foundRange && foundRange.start <= index) {
+ split = true;
+ removed = true;
+ if (foundRange.start === index) {
+ split = false;
+ foundRange.start = index + 1
+ }
+ if (foundRange.end === index) {
+ split = false;
+ foundRange.end = index - 1
+ }
+ if (foundRange.start > foundRange.end) {
+ split = false;
+ foundRange = null;
+ this._ranges.splice(foundRangeIndex, 1)
+ }
+ }
+ if (split) {
+ this._ranges.splice(foundRangeIndex + 1, 0, this._createRange(index + 1, foundRange.end));
+ foundRange.end = Math.max(0, index - 1)
+ }
+ if (foundRange && !this.singleItems) {
+ var right = this._ranges[foundRangeIndex + 1];
+ if (right && right.start - 1 <= foundRange.end) {
+ foundRange.end = right.end;
+ this._ranges.splice(foundRangeIndex + 1, 1)
+ }
+ var left = this._ranges[foundRangeIndex - 1];
+ if (left && left.end + 1 >= foundRange.start) {
+ foundRange.start = left.start;
+ this._ranges.splice(foundRangeIndex - 1, 1)
+ }
+ }
+ if (removed)
+ this._updateCachedTotal(-1);
+ return rangeRemovedFrom
+ }, exclusionCount: function exclusionCount(startIndex, endIndex, consecutive) {
+ return this._count(startIndex, endIndex, consecutive, true)
+ }, count: function count(startIndex, endIndex, consecutive) {
+ return this._count(startIndex, endIndex, consecutive, false)
+ }, _count: function _count(startIndex, endIndex, consecutive, exclusion) {
+ var i,
+ range,
+ start,
+ end,
+ delta;
+ var count = 0;
+ if (startIndex > endIndex && !isNaN(endIndex))
+ return count;
+ for (i = 0; i < this._ranges.length; i++) {
+ range = this._ranges[i];
+ start = range.start;
+ end = range.end;
+ if (exclusion && start === startIndex) {
+ delta = end - start + 1;
+ startIndex += delta;
+ endIndex += delta;
+ count += delta
+ }
+ if (end < startIndex)
+ continue;
+ else if (start > endIndex)
+ break;
+ if (start < startIndex)
+ start = startIndex;
+ if (end > endIndex)
+ end = endIndex;
+ delta = end - start + 1;
+ if (exclusion && startIndex !== endIndex)
+ endIndex += delta;
+ count += delta;
+ if (consecutive) {
+ if (start > startIndex)
+ count = 0;
+ break
+ }
+ }
+ return count
+ }, countFromEnd: function countFromEnd(startIndex, endIndex, inclusive) {
+ var i,
+ range,
+ start,
+ end;
+ var count = 0;
+ if (startIndex > endIndex)
+ return count;
+ for (i = this._ranges.length - 1; i >= 0; i--) {
+ range = this._ranges[i];
+ start = range.start;
+ end = range.end;
+ if (end < startIndex || start > endIndex)
+ continue;
+ if (start < startIndex)
+ start = startIndex;
+ if (end > endIndex)
+ end = endIndex;
+ count += end - start + 1;
+ if (inclusive) {
+ if (end < endIndex)
+ count = 0;
+ break
+ }
+ }
+ return count
+ }, _initializeTotal: function _initializeTotal() {
+ if (this._cachedTotal < 0)
+ this._cachedTotal = this.count(0);
+ return this._cachedTotal
+ }, _updateCachedTotal: function _updateCachedTotal(change) {
+ if (this._cachedTotal >= 0) {
+ this._cachedTotal += change;
+ MS.Entertainment.Data.assert(this._cachedTotal >= 0, "Cache total has gotten out of wack. cached total = " + this._cachedTotal)
+ }
+ return this._cachedTotal
+ }
+ })
+ })
+ })(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/grouper.js:17681 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+ (function (MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ listGrouperEvents: { batchChange: "batchChange" }, emptyGrouper: {
+ isEmpty: true, noHeaderGroups: true, execute: function execute() {
+ return null
+ }
+ }, emptyGroupKey: "noGroupHeader", ListGrouperBase: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Utilities.EventInvoker", function listGrouper(grouper, dataSource) {
+ if (grouper && !grouper.execute)
+ throw new Error("Invalid galleryGrouper passed to ListGrouper");
+ if (dataSource && dataSource.setGrouper)
+ this._dataSource = dataSource;
+ this._grouper = grouper;
+ this._reset()
+ }, {
+ _dataSourceReadySignal: null, _dataSource: null, _grouper: null, _groups: null, _groupHints: null, _headerRanges: null, _pendingChanges: null, _stopInsertingGroupHintHeaders: false, _groupHintsDispatchCount: 100, _pendingInserts: 0, _tracingId: 0, dispose: function dispose() {
+ if (this._dataSourceReadySignal) {
+ this._dataSourceReadySignal.error(new Error("Grouper has been disposed"));
+ this._dataSourceReadySignal = null
+ }
+ if (this._dataSource) {
+ this._dataSource.setGrouper(null);
+ this._dataSource = null
+ }
+ }, dataSource: {
+ get: function get_dataSource() {
+ return this._dataSource
+ }
+ }, dataSourceReady: {
+ get: function get_dataSourceReady() {
+ return WinJS.Promise.as(this._dataSourceReadySignal && this._dataSourceReadySignal.promise)
+ }
+ }, groupHints: {
+ get: function () {
+ return this._groupHints
+ }, set: function (value) {
+ this.setGroupHints(value)
+ }
+ }, grouper: {
+ get: function () {
+ return this._grouper
+ }
+ }, isGrouperEmpty: {
+ get: function () {
+ return !this._grouper || !!this._grouper.isEmpty
+ }
+ }, isInlineGrouper: {
+ get: function get_isInlineGrouper() {
+ MS.Entertainment.Data.fail("Derived classes must define isInlineGrouper.")
+ }
+ }, headerRanges: {
+ get: function () {
+ if (this._headerRanges)
+ return this._headerRanges.ranges;
+ else
+ return []
+ }
+ }, headerIndices: {
+ get: function () {
+ var result = [];
+ if (this._headerRanges)
+ this._headerRanges.ranges.forEach(function (item) {
+ result.push(item.start)
+ });
+ return result
+ }
+ }, headerCount: {
+ get: function get_headerCount() {
+ var result = 0;
+ if (this._headerRanges)
+ result = this._headerRanges.total;
+ return result
+ }
+ }, reset: function reset() {
+ this._reset();
+ this._onReset()
+ }, _getTracingId: function _getTracingId() {
+ this._tracingId++;
+ return this._tracingId
+ }, _reset: function _reset() {
+ this._headerRanges = new MS.Entertainment.Data.Ranges;
+ this._headerRanges.singleItems = true;
+ this._groups = {};
+ this._groupHints = null;
+ this._pendingChanges = null;
+ this._stopInsertingGroupHintHeaders = false;
+ if (this._dataSourceReadySignal) {
+ this._dataSourceReadySignal.error(new Error("ListGrouper has been reset"));
+ this._dataSourceReadySignal = null
+ }
+ if (this.dataSource) {
+ this._dataSourceReadySignal = new MS.Entertainment.UI.Framework.Signal;
+ this.dataSource.setGrouper(this).done(function setGrouperSucceeded() {
+ if (this._dataSourceReadySignal)
+ this._dataSourceReadySignal.complete()
+ }.bind(this), function setGrouperFailed(error) {
+ if (this._dataSourceReadySignal)
+ this._dataSourceReadySignal.error(error)
+ }.bind(this))
+ }
+ }, _onReset: function _onReset() { }, clear: function clear() {
+ var ranges;
+ if (this._headerRanges && this.isInlineGrouper)
+ ranges = this._headerRanges.ranges;
+ else {
+ this._headerRanges = new MS.Entertainment.Data.Ranges;
+ this._headerRanges.singleItems = true
+ }
+ if (ranges)
+ for (var i = ranges.length - 1; i >= 0; i--)
+ this._removeHeader(ranges[i].start);
+ this._dispatchChanges();
+ this._groups = {}
+ }, setGroupHints: function setGroupHints(value) {
+ var result;
+ var tracingId = this._getTracingId();
+ if (this._groupHints !== value) {
+ msWriteProfilerMark("ent:ListGrouperBase:setGroupHints: " + tracingId + ",StartTM");
+ var oldValue = this._groupHints;
+ this._groupHints = value;
+ result = this._onGroupHintsChanged(value, oldValue).then(function setGroupHints(promiseResult) {
+ this._groupHints = value;
+ msWriteProfilerMark("ent:ListGrouperBase:setGroupHints: " + tracingId + ",StopTM");
+ return promiseResult
+ }.bind(this))
+ }
+ return WinJS.Promise.as(result)
+ }, groupHintIndexFromIndex: function groupHintIndexFromIndex(index) {
+ var result = -1;
+ if (this._groupHints && this._groupHints.forEach) {
+ var async = true;
+ this._groupHints.forEach(function (args) {
+ if (args.item.firstItemIndexHint <= index && args.item.firstItemIndexHint + args.item.data.totalCount - 1 >= index) {
+ result = args.item.itemIndex;
+ args.stop = true
+ }
+ }).done(function () {
+ async = false
+ }, function ignoreErrors(error) {
+ MS.Entertainment.Data.fail("Unexcepted error searching for source index. error: " + (error && error.message))
+ });
+ MS.Entertainment.Data.assert(!async, "The groupHints data source should not be an async data source.")
+ }
+ return result
+ }, groupHintIndexFromGroupHintKey: function groupHintIndexFromGroupHintKey(key) {
+ var result = -1;
+ if (key && this._groupHints && this._groupHints.indexFromKey)
+ result = this._groupHints.indexFromKey(key);
+ return result
+ }, firstItemIndexFromGroupHintKey: function firstItemIndexFromGroupHintKey(groupHintKey) {
+ var index = -1;
+ var groupHintIndex = -1;
+ var groupHint;
+ if (this._groupHints && this._groupHints.indexFromKey)
+ groupHintIndex = this._groupHints.indexFromKey(groupHintKey);
+ if (groupHintIndex >= 0 && groupHintIndex < this._groupHints.count)
+ groupHint = this._groupHints.getItem(groupHintIndex);
+ if (groupHint)
+ index = groupHint.firstItemIndexHint;
+ return index
+ }, groupIndexFromSourceIndex: function groupIndexFromSourceIndex(sourceIndex) {
+ var result = -1;
+ if (this._headerRanges)
+ result = this._headerRanges.findLessThanOrEqual(sourceIndex);
+ return result
+ }, groupSizeFromGroupIndex: function groupSizeFromGroupIndex(groupIndex) {
+ var groupSize = 0;
+ var groupCache = null;
+ var groupCacheAfter = null;
+ var listSize = 0;
+ if (this.dataSource)
+ listSize = this.dataSource.count;
+ if (this._headerRanges) {
+ groupCache = this._headerRanges.get(groupIndex);
+ groupCacheAfter = this._headerRanges.get(groupIndex + 1)
+ }
+ if (groupCache)
+ if (groupCacheAfter)
+ groupSize = groupCacheAfter.start - groupCache.start;
+ else if (listSize > 0)
+ groupSize = listSize - groupCache.start;
+ if (groupSize > 0 && this.isInlineGrouper)
+ groupSize--;
+ return groupSize
+ }, _leftGroupFromSourceIndex: function _leftGroupFromSourceIndex(sourceIndex) {
+ var group = null;
+ var index = -1;
+ var range = null;
+ if (this._headerRanges)
+ index = this._headerRanges.findLessThanOrEqual(sourceIndex);
+ if (index >= 0)
+ range = this._headerRanges.get(index);
+ if (range && range.data)
+ group = range.data;
+ return group
+ }, _leftGroupHintFromSourceIndex: function _leftGroupHintFromSourceIndex(sourceIndex) {
+ return this.groupHintIndexFromGroup(this._leftGroupFromSourceIndex(sourceIndex))
+ }, groupIndexFromKey: function groupIndexFromKey(groupKey) {
+ var result = -1;
+ var currentIndex = -1;
+ if (this._headerRanges)
+ this._headerRanges.forEach(function (range) {
+ var exit = false;
+ currentIndex++;
+ if (range.data && range.data.key === key) {
+ result = currentIndex;
+ exit = true
+ }
+ return exit
+ });
+ return result
+ }, firstGroupItemIndexFromKey: function firstGroupItemIndexFromKey(groupKey) {
+ var result = -1;
+ if (this._groups && this._groups[groupKey])
+ result = this._groups[groupKey].start;
+ return result
+ }, groupHintIndexFromGroup: function groupHintIndexFromGroup(group) {
+ var groupHintIndex = -1;
+ if (group && group.parentKey && this.groupHints && this.groupHints.indexFromKey) {
+ groupHintIndex = this.groupHints.indexFromKey(group.parentKey);
+ if (typeof groupHintIndex !== "number")
+ groupHintIndex = -1
+ }
+ return groupHintIndex
+ }, countHeaders: function countHeaders(startIndex, endIndex) {
+ return 0
+ }, exclusionCountHeaders: function exclusionCountHeaders(startIndex, endIndex) {
+ return 0
+ }, calculate: function calculate(item) {
+ return (item && item.group) || (this._grouper ? this._grouper.execute(item) : null)
+ }, copy: function copy(item, oldItem) {
+ if (item && oldItem) {
+ item.group = oldItem.group;
+ item.isHeader = oldItem.isHeader
+ }
+ return item
+ }, isValidGroupOrParentGroup: function isValidGroupOrParentGroup(group) {
+ return !!(group && group.key) || !!(group && group.parentKey)
+ }, isValidGroup: function isValidGroup(group) {
+ return !!(group && group.key)
+ }, update: function update(index, item, existingItems) {
+ return this._insert(index, item, existingItems, true)
+ }, insert: function insert(index, item, existingItems) {
+ return this._insert(index, item, existingItems, false)
+ }, remove: function remove(index, item, existingItems) {
+ return this._remove(index, item, existingItems)
+ }, _sourceIndexFromIndex: function _sourceIndexFromIndex(index) {
+ var sourceIndex = index;
+ if (this._dataSource && this._dataSource.indexToSourceIndex)
+ sourceIndex = this._dataSource.indexToSourceIndex(index);
+ return sourceIndex
+ }, _sourceIndexToIndex: function _sourceIndexToIndex(sourceIndex) {
+ var index = sourceIndex;
+ if (this._dataSource && this._dataSource.indexFromSourceIndex)
+ index = this._dataSource.indexFromSourceIndex(index);
+ return index
+ }, _addGetHashCode: function _addGetHashCode(listItem, group) {
+ if (listItem && !listItem.getHashCode && group && group.parentKey) {
+ var parentKey = group.parentKey;
+ listItem.getHashCode = function getHashCode() {
+ return parentKey
+ }
+ }
+ listItem = null;
+ group = null
+ }, _createGroupHintListItem: function _createGroupHintListItem(firstItemIndex, group) {
+ var groupHint = {
+ Name: group.parentData && group.parentData.title, GroupId: group.parentKey
+ };
+ if (this._groupHints && this._groupHints.createItem) {
+ groupHint = this._groupHints.createItem(groupHint);
+ groupHint.preventAugmentation = true;
+ this._addGetHashCode(groupHint, group)
+ }
+ return groupHint
+ }, _insertGroupHintFromGroupIfNeeded: function _insertGroupHintFromGroupIfNeeded(firstItemIndex, group, itemBefore, itemAfter) {
+ if (!this._groupHints || !group)
+ return false;
+ var inserted = false;
+ var groupHintIndex = this.groupHintIndexFromGroup(group);
+ if (this._groupHints && groupHintIndex >= 0 && groupHintIndex < this._groupHints.count)
+ this._updateGroupHintSize(this._groupHints.getItem(groupHintIndex), 1);
+ else {
+ var itemBeforeGroupHintIndex = this.groupHintIndexFromGroup(itemBefore && itemBefore.group);
+ var itemAfterGroupHintIndex = this.groupHintIndexFromGroup(itemAfter && itemAfter.group);
+ var groupHint = this._createGroupHintListItem(firstItemIndex, group);
+ if (itemBeforeGroupHintIndex >= 0)
+ groupHintIndex = itemBeforeGroupHintIndex + 1;
+ else if (itemAfterGroupHintIndex >= 0)
+ groupHintIndex = itemAfterGroupHintIndex;
+ else if (this._groupHints.count === 0 || this._isStartOrEnd(itemBefore))
+ groupHintIndex = 0;
+ else if (this._isStartOrEnd(itemAfter))
+ groupHintIndex = this._groupHints.count;
+ else
+ groupHintIndex = this._leftGroupHintFromSourceIndex(firstItemIndex);
+ MS.Entertainment.Data.assert(groupHintIndex >= 0 || (this._isUnknown(itemBefore) && this._isUnknown(itemAfter)), "Couldn't find a spot for the missing group hint.");
+ if (groupHintIndex >= 0) {
+ var async = true;
+ inserted = true;
+ this._groupHints.insertAt(groupHintIndex, groupHint).done(function () {
+ async = false
+ }, function ignoreError(error) {
+ MS.Entertainment.Data.assert(WinJS.Promise.isCanceledError(error), "An unknown error occurred while adding a new group hint. error: " + (error && error.message))
+ });
+ MS.Entertainment.Data.assert(!async, "The groupHints data source should not be an async data source.");
+ this._initializeGroupHintAndSizes(this._groupHints.getItem(groupHintIndex), this._sourceIndexFromIndex(firstItemIndex))
+ }
+ }
+ return inserted
+ }, _insertHeaderIfNeeded: function _insertHeaderIfNeeded(index, group, itemBefore, itemAfter) {
+ var inserted = false;
+ if (group && this.isValidGroup(group)) {
+ var lastKnownIndex = -1;
+ if (this._groups[group.key])
+ lastKnownIndex = this._groups[group.key].start;
+ if (lastKnownIndex < 0) {
+ this._insertHeader(index, group, itemBefore, itemAfter);
+ lastKnownIndex = index;
+ inserted = true
+ }
+ }
+ return inserted
+ }, _updateHeaderIfNeeded: function _updateHeaderIfNeeded(newGroup) {
+ if (newGroup && !newGroup.fromGroupHint) {
+ var groupRange = this._groups[newGroup.key];
+ var firstItemIndex = -1;
+ var groupListItem = null;
+ if (groupRange && groupRange.data && groupRange.data.fromGroupHint) {
+ firstItemIndex = groupRange.start;
+ groupRange.data = null
+ }
+ if (firstItemIndex >= 0) {
+ groupListItem = new MS.Entertainment.Data.Factory.ListHeaderWrapper(newGroup, firstItemIndex);
+ this._pushPendingChange({
+ change: "Update", absoluteIndex: firstItemIndex, value: groupListItem, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ });
+ this._onHeaderUpdated(firstItemIndex, groupListItem)
+ }
+ }
+ }, _onHeaderUpdated: function _onHeaderUpdated(firstItemIndex, groupListItem) { }, _createHeaderItem: function _createHeaderItem(firstItemIndex, group) {
+ return new MS.Entertainment.Data.Factory.ListHeaderWrapper(group, firstItemIndex)
+ }, _insertItem: function _insertItem(index, item, itemBefore, itemAfter) {
+ this._insertGroupHintFromGroupIfNeeded(index, item && item.group, itemBefore, itemAfter)
+ }, _updateItem: function _updateItem(index, item, itemBefore, itemAfter, oldGroup) {
+ var groupHintIndex = -1;
+ var newGroup = item && item.group;
+ if (oldGroup && newGroup && !this._areGroupsEqual(oldGroup, newGroup))
+ groupHintIndex = this.groupHintIndexFromGroupHintKey(oldGroup.parentKey);
+ if (groupHintIndex >= 0) {
+ this._removeItemFromGroupHint(groupHintIndex);
+ this._insertGroupHintFromGroupIfNeeded(index, item && item.group, itemBefore, itemAfter)
+ }
+ }, _updateHeader: function _updateHeader(firstItemIndex, group) {
+ var groupListItem = this._createHeaderItem(firstItemIndex, group);
+ MS.Entertainment.Data.assert(group, "The group header being inserted is null");
+ MS.Entertainment.Data.assert(this._groups[group.key], "Updating a header that doesn't exist, this should not happen");
+ var groupCache = this._groups[group.key];
+ if (groupCache)
+ groupCache.data = group;
+ this._pushPendingChange({
+ change: "Update", absoluteIndex: firstItemIndex, value: groupListItem, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ })
+ }, _insertHeader: function _insertHeader(firstItemIndex, group, itemBefore, itemAfter) {
+ var groupListItem = this._createHeaderItem(firstItemIndex, group);
+ MS.Entertainment.Data.assert(group, "The group header being inserted is null");
+ MS.Entertainment.Data.assert(!group || group.key, "The group header key being inserted is null");
+ MS.Entertainment.Data.assert(!this._groups[group.key], "Inserting a header that already exists, this should not happen");
+ if (this.isInlineGrouper) {
+ this._insertItem(firstItemIndex, groupListItem, itemBefore, itemAfter);
+ this._headerRanges.shift(firstItemIndex, true)
+ }
+ this._groups[group.key] = this._headerRanges.insert(firstItemIndex);
+ this._groups[group.key].data = group;
+ this._pendingInserts++;
+ this._pushPendingChange({
+ change: "Add", absoluteIndex: firstItemIndex, value: groupListItem, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ });
+ this._onHeaderInserted(firstItemIndex, groupListItem)
+ }, _onHeaderInserted: function _onHeaderInserted(firstItemIndex, groupListItem) { }, _removeItem: function _removeItem(index) {
+ var groupHintIndex = this.groupHintIndexFromIndex(index);
+ this._removeItemFromGroupHint(groupHintIndex)
+ }, _removeItemFromGroupHint: function _removeItemFromGroupHint(groupHintIndex) {
+ var groupHint;
+ if (this._groupHints && groupHintIndex >= 0 && groupHintIndex < this._groupHints.count)
+ groupHint = this._groupHints.getItem(groupHintIndex);
+ if (groupHint) {
+ this._updateGroupHintSize(groupHint, -1);
+ if (groupHint.data && groupHint.data.totalCount <= 0)
+ this._groupHints.removeAt(groupHintIndex)
+ }
+ }, _removeHeader: function _removeHeader(firstItemIndex, group) {
+ MS.Entertainment.Data.assert(firstItemIndex >= 0, "Item index should be negative");
+ this._pushPendingChange({
+ change: "Remove", absoluteIndex: firstItemIndex, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ });
+ this._onHeaderRemoved(firstItemIndex);
+ var removedRange = !!this._headerRanges.remove(firstItemIndex);
+ MS.Entertainment.Data.assert(removedRange, "No range was removed");
+ if (!group && removedRange)
+ group = removedRange.data;
+ MS.Entertainment.Data.assert(!removedRange || !removedRange.data || !group || group.key === removedRange.data.key, "We removed the wrong range from the header ranges.");
+ if (group && group.key && group.key in this._groups)
+ delete this._groups[group.key];
+ if (this.isInlineGrouper) {
+ this._removeItem(firstItemIndex);
+ this._headerRanges.shift(firstItemIndex + 1, false)
+ }
+ }, _onHeaderRemoved: function _onHeaderRemoved(firstItemIndex) { }, _onDispatchingChanges: function _onDispatchingChanges(changes) { }, _pushPendingChange: function _pushPendingChange(change) {
+ this._pendingChanges = this._pendingChanges || [];
+ this._pendingChanges.push(change)
+ }, _dispatchChanges: function _dispatchChanges() {
+ var tracingId = this._getTracingId();
+ var pendingChanges = this._pendingChanges;
+ this._pendingChanges = null;
+ this._pendingInserts = 0;
+ if (pendingChanges && pendingChanges.length) {
+ msWriteProfilerMark("ent:ListGrouperBase:_dispatchChanges: " + tracingId + ",StartTM");
+ this._onDispatchingChanges(pendingChanges);
+ this.dispatchEvent(MS.Entertainment.Data.listGrouperEvents.batchChange, {
+ sender: this, changes: pendingChanges
+ });
+ msWriteProfilerMark("ent:ListGrouperBase:_dispatchChanges: " + tracingId + ",StopTM")
+ }
+ }, _onGroupHintsChanged: function _onGroupHintsChanged(newValue, oldValue) {
+ var firstGroupHints = !!newValue && !oldValue;
+ var ranges = [];
+ var headersInserted = 0;
+ var tracingId = this._getTracingId();
+ if (!firstGroupHints)
+ this._stopInsertingGroupHintHeaders = true;
+ if (!newValue)
+ return WinJS.Promise.wrap();
+ var returnPromise = newValue.forEachAll(function addItem(args) {
+ var item = args.item;
+ this._initializeGroupHint(item)
+ }.bind(this)).then(null, function handleError(error) {
+ MS.Entertainment.Data.fail("forEachAll failed when expanding group hints. error: " + (error && error.message))
+ });
+ if (!this._stopInsertingGroupHintHeaders) {
+ msWriteProfilerMark("ent:ListGrouperBase:instertGroupHintAsHeader: " + tracingId + ",StartTM");
+ newValue.forEachAll(function addItem(args) {
+ if (this._stopInsertingGroupHintHeaders) {
+ args.stop = true;
+ return
+ }
+ var item = args.item;
+ this._insertGroupFromGroupHint(item);
+ if (this._groupHintsDispatchCount > 0 && this.headerCount % this._groupHintsDispatchCount === 0) {
+ this._dispatchChanges();
+ return WinJS.Promise.timeout()
+ }
+ }.bind(this)).then(null, function ingoreError() { }).done(function dispatchChanges() {
+ this._dispatchChanges();
+ msWriteProfilerMark("ent:ListGrouperBase:instertGroupHintAsHeader: " + tracingId + ",StopTM")
+ }.bind(this))
+ }
+ return returnPromise
+ }, _insertGroupFromGroupHint: function _insertGroupFromGroupHint(groupHint) {
+ var group;
+ if (!groupHint || !groupHint.data)
+ return;
+ var subGroupHint;
+ var subGroupHintsLength = groupHint.data.subGroupHints ? groupHint.data.subGroupHints.length : 0;
+ if (subGroupHintsLength && groupHint.data.firstItemIndexSourceHint >= 0)
+ for (var i = 0; i < subGroupHintsLength; i++) {
+ subGroupHint = groupHint.data.subGroupHints[i];
+ this._insertGroupFromGroupHint({ data: subGroupHint })
+ }
+ else if (!subGroupHintsLength && groupHint.data.firstItemIndexSourceHint >= 0)
+ group = this.calculate(groupHint);
+ if (group) {
+ group.fromGroupHint = true;
+ this._insertGroupHeaderFromGroupHint(groupHint, group)
+ }
+ }, _groupFromKey: function _groupFromKey(key) {
+ return (this._groups && this._groups[key] && this._groups[key].data) || null
+ }, _groupFromGroupIndex: function _groupFromGroupIndex(index) {
+ var groupCache = null;
+ var group = null;
+ if (this._groups)
+ groupCache = this._headerRanges.get(index);
+ if (groupCache)
+ group = groupCache.data;
+ return group
+ }, _isKnownGroup: function _isKnownGroup(group) {
+ return !!(group && this._groupFromKey(group.key))
+ }, _isStartOrEnd: function _isStartOrEnd(item) {
+ return item === undefined
+ }, _isHeader: function _isHeader(item) {
+ return !!(item && item.isHeader)
+ }, _isUnknown: function _isUnknown(item) {
+ return item === null
+ }, _areGroupsEqual: function _areGroupsEqual(group1, group2) {
+ var equal = false;
+ if (!group1 && !group2)
+ equal = true;
+ else
+ equal = !!(group1 && group2 && group1.key === group2.key);
+ return equal
+ }, _isMatch: function _isMatch(item, group) {
+ return !!(item && this._areGroupsEqual(group, item.group))
+ }, _isNotMatch: function _isNotMatch(item, group) {
+ return !!((this._isStartOrEnd(item)) || (item && group && item.group && item.group.key !== group.key))
+ }, _calculateAndApplyGroup: function _calculateAndApplyGroup(item) {
+ var group = this.calculate(item);
+ if (this.isValidGroupOrParentGroup(group)) {
+ if (this._isKnownGroup(group) && this.isValidGroup(group)) {
+ group = this._groups[group.key].data;
+ MS.Entertainment.Data.assert(!!group, "A known group shouldn't have null data")
+ }
+ this._setGroup(item, group)
+ }
+ return group
+ }, _setGroup: function _setGroup(listItem, group) {
+ if (listItem)
+ listItem.group = group;
+ return listItem
+ }, _shiftHeaderRanges: function _shiftHeaderRanges(startIndex, increase) {
+ this._headerRanges.shift(startIndex, increase)
+ }, _insert: function _insert(index, item, existingItems, updating) {
+ MS.Entertainment.Data.fail("Derived classes must define _insert")
+ }, _insertGroupHeaderFromGroupHint: function _insertGroupHeaderFromGroupHint(groupHint, group) {
+ MS.Entertainment.Data.fail("Derived classes must define _insertGroupHeaderFromGroupHint")
+ }, _remove: function _remove(index, item, existingItems) {
+ MS.Entertainment.Data.fail("Derived classes must define _remove")
+ }, _initializeGroupHintAndSizes: function _initializeGroupHintAndSizes(groupHint, firstItemIndexSourceHint) {
+ if (groupHint && this._groupHints) {
+ groupHint.data.firstItemIndexSourceHint = firstItemIndexSourceHint;
+ groupHint.data.totalCount = 0;
+ this._updateGroupHintSize(groupHint, 1);
+ this._initializeGroupHint(groupHint)
+ }
+ }, _initializeGroupHint: function _initializeGroupHint(groupHint) {
+ if (groupHint && groupHint.data) {
+ var dataSource = this._dataSource;
+ if (dataSource)
+ MS.Entertainment.Data.Factory.ListItemWrapper.addFirstItemIndexHint(groupHint, function () {
+ var index = groupHint.data.firstItemIndexSourceHint;
+ if (dataSource.indexFromSourceIndex)
+ index = dataSource.indexFromSourceIndex(index);
+ return index
+ })
+ }
+ }, _updateGroupHintSize: function _updateGroupHintSize(groupHint, increase) {
+ if (groupHint && this._groupHints) {
+ var groupHintIndex = groupHint.itemIndex;
+ var currentItem = groupHint;
+ if (increase >= 0 || currentItem.data.totalCount >= 0) {
+ currentItem.data.totalCount += increase;
+ for (var i = groupHintIndex + 1; i < this._groupHints.count; i++) {
+ currentItem = this._groupHints.getItem(i);
+ currentItem.data.firstItemIndexSourceHint += increase
+ }
+ }
+ }
+ }
+ }, {
+ clearGroup: function clearGroup(item) {
+ if (item) {
+ item.group = null;
+ item.isHeader = false
+ }
+ }
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ ListGrouper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ListGrouperBase", function listGrouper(grouper, dataSource) {
+ MS.Entertainment.Data.ListGrouperBase.prototype.constructor.call(this, grouper, dataSource)
+ }, {
+ isInlineGrouper: {
+ get: function get_isInlineGrouper() {
+ return true
+ }
+ }, countHeaders: function countHeaders(startIndex, endIndex) {
+ return this._headerRanges.count(startIndex, endIndex)
+ }, exclusionCountHeaders: function exclusionCountHeaders(startIndex, endIndex) {
+ return this._headerRanges.exclusionCount(startIndex, endIndex)
+ }, _insert: function _insert(index, item, existingItems, updating) {
+ if (!item || item.isHeader || (updating && item.group) || this.isGrouperEmpty)
+ return index;
+ var itemBefore = existingItems(index - 1);
+ var itemAfter = existingItems(updating ? index + 1 : index);
+ var group = this.calculate(item);
+ if (!this.isValidGroup(group)) {
+ if (!updating)
+ this._insertItem(index, item, itemBefore, itemAfter);
+ return index
+ }
+ var groupHeaderIndex = -1;
+ if (this._isNotMatchingHeader(itemBefore, group)) {
+ if (updating)
+ this._removeHeader(index - 1, itemBefore.group);
+ else
+ itemAfter = itemBefore;
+ index--;
+ itemBefore = existingItems(index - 1)
+ }
+ if (this._canInsertHeaderUsingGroup(item, group))
+ index = this._moveOrInsertHeaderIfNeeded(index, group, itemBefore, itemAfter).index;
+ this._updateHeaderIfNeeded(group);
+ item.group = group;
+ if (!updating) {
+ this._shiftHeaderRanges(index, true);
+ this._insertItem(index, item, itemBefore, itemAfter)
+ }
+ if (itemAfter) {
+ if (this._canInsertHeaderUsingGroup(itemAfter, itemAfter.group)) {
+ var moveResult = this._moveOrInsertHeaderIfNeeded(index + 1, itemAfter.group, item, null);
+ if (moveResult.oldHeaderIndex >= 0 && moveResult.oldHeaderIndex < index && moveResult.oldHeaderIndex !== moveResult.newHeaderIndex)
+ index--
+ }
+ this._updateHeaderIfNeeded(itemAfter.group)
+ }
+ this._dispatchChanges();
+ return index
+ }, _isNotMatchingHeader: function isNotMatchingHeader(item, group) {
+ return !!(item && item.isHeader && this._isNotMatch(item, group))
+ }, _canInsertHeaderUsingGroup: function _canInsertHeaderUsingGroup(item, group) {
+ return !!(item && group && !item.isAction && !item.isHeader && !item.noHeader)
+ }, _canInsertHeader: function _canInsertHeader(item) {
+ return !!(item && this._canInsertHeaderUsingGroup(item, item.group))
+ }, _remove: function _remove(index, item, existingItems) {
+ item = item || {};
+ if (!item.isHeader && !this.isGrouperEmpty) {
+ var itemBefore = existingItems(index - 1);
+ var itemAfter = existingItems(index + 1);
+ this._removeItem(index, item);
+ if (this.isValidGroup(item && item.group)) {
+ if ((this._isStartOrEnd(itemBefore) || this._isHeader(itemBefore)) && (this._isStartOrEnd(itemAfter) || this._isHeader(itemAfter))) {
+ index--;
+ this._removeHeader(index, itemBefore && itemBefore.group)
+ }
+ this._shiftHeaderRanges(index + 1, false)
+ }
+ item.group = null;
+ this._dispatchChanges()
+ }
+ return index
+ }, _moveOrInsertHeaderIfNeeded: function _moveOrInsertHeaderIfNeeded(index, group, itemBefore, itemAfter) {
+ var result = {
+ index: index, oldHeaderIndex: -1, newHeaderIndex: -1
+ };
+ var atBoundary = this._isNotMatch(itemBefore, group);
+ if (this._groups[group.key])
+ result.oldHeaderIndex = result.newHeaderIndex = this._groups[group.key].start;
+ if (atBoundary)
+ if (result.oldHeaderIndex === index)
+ index++;
+ else if (result.oldHeaderIndex >= 0 && result.oldHeaderIndex !== index - 1) {
+ this._removeHeader(result.oldHeaderIndex, group);
+ if (result.oldHeaderIndex < index)
+ index--;
+ result.newHeaderIndex = index;
+ this._insertHeader(index, group, itemBefore, itemAfter);
+ index++
+ }
+ else if (this._insertHeaderIfNeeded(index, group, itemBefore, itemAfter)) {
+ result.newHeaderIndex = index;
+ index++
+ }
+ result.index = index;
+ return result
+ }, _insertGroupHeaderFromGroupHint: function _insertGroupHeaderFromGroupHint(groupHint, group) {
+ var firstItemIndexHint = this._sourceIndexToIndex(groupHint.data.firstItemIndexSourceHint);
+ this._insertHeaderIfNeeded(firstItemIndexHint + this._pendingInserts, group, null, null)
+ }
+ })
+ })
+ })(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/list.js:18335 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+ (function (MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ chunkerEvents: {
+ batchChange: "batchChange", reset: "reset"
+ }, listEvents: {
+ itemChanged: "itemChanged", countChanged: "countChanged", itemInserted: "itemInserted", itemMoved: "itemMoved", itemRemoved: "itemRemoved", beginNotifications: "beginNotifications", endNotifications: "endNotifications"
+ }, observableListMixin: {
+ count: 0, itemFactory: null, instance: null
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ ObservableList: WinJS.Class.mix(function observableList() {
+ this._initObservable(Object.create(MS.Entertainment.Data.observableListMixin));
+ this.status = MSE.Data.queryStatus.idle
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin, MS.Entertainment.UI.Framework.UpdatePropertyMixin, WinJS.Binding.expandProperties(MS.Entertainment.Data.observableListMixin))
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ List: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ObservableList", function listConstructor(itemFactory) {
+ MS.Entertainment.Data.ObservableList.prototype.constructor.call(this);
+ this._data = [];
+ this._keyMap = {};
+ this.instance = this;
+ this.setItemFactory(itemFactory)
+ }, {
+ _data: null, _keyMap: null, _nextDefaultKey: 0, _disposed: false, dispose: function dispose() {
+ this._data = [];
+ this._keyMap = {};
+ this._disposed = true
+ }, _maxCount: -1, isDisposed: {
+ get: function get_isDisposed() {
+ return this._disposed
+ }
+ }, maxCount: {
+ get: function () {
+ return this._maxCount
+ }, set: function (value) {
+ if (this._maxCount !== value) {
+ this._maxCount = value;
+ if (this._maxCount >= 0)
+ this._setCount(Math.min(this._maxCount, this.count))
+ }
+ }
+ }, hasMaxCount: {
+ get: function () {
+ return this.maxCount >= 0
+ }
+ }, count: {
+ get: function () {
+ var count = this.getProperty("count");
+ return (count < 0) ? 0 : count
+ }, set: function (value) {
+ if (this.hasMaxCount)
+ value = Math.min(this._maxCount, value);
+ this.setProperty("count", value)
+ }
+ }, hasCount: {
+ get: function () {
+ return this.getProperty("count") >= 0
+ }
+ }, setItemFactory: function setItemFactory(itemFactory) {
+ this.itemFactory = itemFactory || MSE.Data.Factory.self;
+ if (!this.itemFactory.listItemFactory)
+ this.itemFactory = MSE.Data.Factory.createListItemFactory(this.itemFactory)
+ }, createItem: function createItem(source) {
+ return this.itemFactory(source === undefined ? null : source)
+ }, copyItem: function copyItem(source, destination) {
+ return this.itemFactory(source === undefined ? null : source, destination)
+ }, insert: function insert() {
+ return this._insertAt(this.count, null)
+ }, insertAt: function insertAt(index, data) {
+ this._insertAt(index, data);
+ return WinJS.Promise.wrap(this._item(index))
+ }, forEach: function forEach(callback, index, countAfter) {
+ return this._forEach(callback, index, countAfter)
+ }, forEachAll: function forEachAll(callback, index, countAfter) {
+ return this.forEach(callback, index, countAfter)
+ }, toArray: function (startIndex, maxCount) {
+ return this._toArray(false, startIndex, maxCount)
+ }, toArrayAll: function (startIndex, maxCount) {
+ return this._toArray(true, startIndex, maxCount)
+ }, _toArray: function _toArray(all, startIndex, maxCount) {
+ startIndex = startIndex || 0;
+ var result = [];
+ var countAfter;
+ var forFunction = all ? this.forEachAll : this.forEach;
+ if (!isNaN(maxCount))
+ countAfter = maxCount - 1;
+ return forFunction.call(this, function addItem(args) {
+ if (args.item && args.item.data)
+ result.push(args.item.data)
+ }, 0, countAfter).then(null, function ignoreError() { }).then(function returnItems() {
+ return result
+ })
+ }, _indexFromItemDescription: function _indexFromItemDescription(itemDescription) {
+ var result = -1;
+ if (itemDescription && !isNaN(itemDescription.sourceIndexHint) && itemDescription.sourceIndexHint >= 0)
+ result = itemDescription.sourceIndexHint;
+ else
+ MSE.Data.fail("Invalid item description was given to _indexFromItemDescription(). Descriptions must have a valid sourceIndexHint");
+ return result
+ }, itemsFromDescription: function itemsFromDescription(itemDescription, countBefore, countAfter) {
+ var result;
+ var index = this._indexFromItemDescription(itemDescription);
+ if (index >= 0)
+ result = this.itemsFromIndex(index, 0, 0).then(function examineResult(result) {
+ return result
+ });
+ else
+ result = WinJS.Promise.wrapError(new Error("Unable to locate item from the given description"));
+ return result
+ }, itemsFromIndex: function itemsFromIndex(index, countBefore, countAfter) {
+ var result = this._onItemsFromIndex(index, countBefore, countAfter).then(function _itemsFromIndex() {
+ return _items(index, countBefore, countAfter)
+ }.bind(this));
+ return result
+ }, _onItemsFromIndex: function _onItemsFromIndex(index, countBefore, countAfter) {
+ return WinJS.Promise.wrap()
+ }, createListAdaptor: function createListAdaptor() {
+ return {
+ compareByIdentity: true, getCount: this.getCount.bind(this), itemsFromIndex: this.itemsFromIndex.bind(this), itemsFromDescription: this.itemsFromDescription.bind(this), insertAtStart: function insertAtStart(key, data) {
+ return WinJS.Promise.wrap(this._insertAt(0, data))
+ }, insertBefore: function insertBefore(key, data, nextKey, nextIndexHint) {
+ return WinJS.Promise.wrap(this._insertAt(this._indexFromKey(nextKey), data))
+ }, insertAfter: function insertAfter(key, data, previousKey, previousIndexHint) {
+ return WinJS.Promise.wrap(this._insertAt(this._indexFromKey(previousKey) + 1, data))
+ }, insertAtEnd: function insertAtEnd(key, data) {
+ return WinJS.Promise.wrap(this._insertAt(this.count, data))
+ }, change: function change(key, newData, indexHint) {
+ return WinJS.Promise.wrap(this._changeByKey(key, newData))
+ }, moveToStart: function moveToStart(key, indexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, 0))
+ }, moveBefore: function moveBefore(key, nextKey, indexHint, nextIndexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, this._indexFromKey(nextKey)))
+ }, moveAfter: function moveAfter(key, previousKey, indexHint, previousIndexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, this._indexFromKey(previousKey) + 1))
+ }, moveToEnd: function moveToEnd(key, indexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, this.count))
+ }, remove: function remove(key, indexHint) {
+ return WinJS.Promise(this._removeAtKey(key))
+ }
+ }
+ }, getCount: function getCount() {
+ return this._onGetCount().then(function _getCount() {
+ if (this.count < 0)
+ return WinJS.Promise.wrapError(MSE.Data.List.CountResult.unknown);
+ else
+ return WinJS.Promise.wrap(this.count)
+ }.bind(this))
+ }, _onGetCount: function _onGetCount() {
+ return WinJS.Promise.wrap()
+ }, getItem: function getItem(destinationIndex) {
+ this._validateIndex(destinationIndex);
+ return this._item(destinationIndex)
+ }, keyFromIndex: function keyFromIndex(key) {
+ return this._keyFromIndex(key)
+ }, indexFromKey: function indexFromKey(key) {
+ return this._indexFromKey(key)
+ }, _insertAt: function _insertAt(index, data, noTranslation, isSourceData) {
+ this._validateInsertIndex(index);
+ var dataToCache = (noTranslation) ? data : this.createItem(data, !isSourceData);
+ dataToCache = this._cacheData(index, dataToCache);
+ this._addCount(1);
+ this._updateItemKeyMap(dataToCache.itemIndex);
+ return dataToCache
+ }, _insertRangeAt: function _insertRangeAt(startIndex, sourceData, noTranslation, isSourceData) {
+ var dataToCache;
+ var index = startIndex;
+ this._validateInsertIndex(index);
+ if (Array.isArray(sourceData))
+ sourceData.forEach(function _insertRangeAtLoop(item) {
+ dataToCache = (noTranslation) ? item : this.createItem(item, !isSourceData);
+ dataToCache = this._cacheData(index, dataToCache);
+ this._addCount(1);
+ index = dataToCache.itemIndex + 1
+ }, this);
+ this._updateItemKeyMap(startIndex);
+ return index - startIndex
+ }, _updateRangeAt: function _updateRangeAt(sourceStartIndex, sourceData, noTranslation) {
+ var dataToCache;
+ var sourceIndex = sourceStartIndex;
+ var startIndex = this.indexFromSourceIndex(sourceStartIndex);
+ var isSourceData = true;
+ this._validateInsertIndex(startIndex);
+ if (Array.isArray(sourceData))
+ sourceData.forEach(function _insertRangeAtLoop(item) {
+ dataToCache = (noTranslation) ? item : this.createItem(item, !isSourceData);
+ dataToCache = this._updateCacheData(this.indexFromSourceIndex(sourceIndex), dataToCache);
+ sourceIndex++
+ }, this);
+ this._updateItemKeyMap(startIndex);
+ return sourceIndex - sourceStartIndex
+ }, _removeAt: function _removeAt(index) {
+ this._validateIndex(index);
+ var data = this._uncacheData(index, 1)[0];
+ MSE.Data.assert(!data || data.itemIndex === index, "The index of the stored data didn't match the removed index.");
+ this._removeDataKey(data);
+ this._addCount(-1);
+ this._updateItemKeyMap(index);
+ return data
+ }, _removeDataKey: function _removeDataKey(data) {
+ var key;
+ if (data && data.key) {
+ key = data.key;
+ delete this._keyMap[data.key]
+ }
+ return key
+ }, _removeRangeAt: function _removeRangeAt(index, count) {
+ this._validateIndex(index);
+ this._validateIndex(index + count - 1);
+ var removed = this._uncacheData(index, count);
+ if (removed) {
+ this._addCount(-removed.length);
+ removed.forEach(function _removeRangeAtLoop(removedItem) {
+ delete this._keyMap[removedItem.key]
+ }, this);
+ this._updateItemKeyMap(removed.length ? removed[removed.length - 1].itemIndex : index)
+ }
+ return removed
+ }, _removeAtKey: function _removeAtKey(key) {
+ return this._removeAt(this._indexFromKey(key))
+ }, _validateInsertIndex: function _validateInsertIndex(index) {
+ if (index < 0 || (index > this.count && this.hasCount))
+ throw new Error("index out of range. index: " + index);
+ }, _validateIndex: function _validateIndex(index) {
+ if ((index < 0) || (index >= this.count && this.hasCount))
+ throw new Error("index out of range in List. index: " + index);
+ }, _validateIndexNoThrow: function _validateIndexNoThrow(index) {
+ return (index >= 0) && (index < this.count && this.hasCount)
+ }, _setCount: function _setCount(value) {
+ if (value < 0)
+ throw "new count is out of range";
+ if (value !== undefined && value !== null) {
+ var oldValue = this.count;
+ this.count = value;
+ if (oldValue !== value)
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.countChanged, {
+ newValue: value, oldValue: oldValue
+ })
+ }
+ }, _addCount: function _addCount(addition) {
+ this._setCount(this.count + addition)
+ }, _trimData: function _trimData(newLength) {
+ if (this._data.length > newLength)
+ this._uncacheData(newLength, this._data.length - newLength)
+ }, _forEach: function _forEach(callback, index, countAfter) {
+ index = index || 0;
+ countAfter = countAfter === undefined ? this.count : countAfter;
+ var totalCount = Math.min(this.count, this._data.length);
+ var first = Math.max(index, 0);
+ var last = Math.min(index + countAfter, totalCount - 1);
+ if (first >= this.count && !(first === 0 && this.count === 0))
+ throw "index is out of range";
+ return new WinJS.Promise(function promiseInitialization(completed, error) {
+ this._forEachIteration({
+ callback: callback, index: first, last: last, completed: completed, error: error, getCount: function getCount() {
+ return this.count
+ }.bind(this), getItem: function getItem(index) {
+ return this._item(index)
+ }.bind(this)
+ })
+ }.bind(this))
+ }, _forEachIteration: function _forEachIteration(iterationArgs) {
+ var promise,
+ args;
+ var promiseCompleted = true;
+ MSE.Data.assert(iterationArgs, "invalid argument. iterationArgs was null or undefined.");
+ while (iterationArgs.index <= iterationArgs.last && iterationArgs.index < iterationArgs.getCount()) {
+ args = {
+ item: iterationArgs.getItem(iterationArgs.index), stop: false
+ };
+ try {
+ promise = WinJS.Promise.as(iterationArgs.callback(args))
+ }
+ catch (exception) {
+ MS.Entertainment.Data.assert(false, "ForEach callback throw an exception. " + exception);
+ promise = WinJS.Promise.wrapError(exception)
+ }
+ promiseCompleted = false;
+ promise.done(function () {
+ if (args.stop) {
+ if (iterationArgs.cancel)
+ iterationArgs.cancel();
+ iterationArgs.index = iterationArgs.last + 1
+ }
+ else
+ iterationArgs.index = iterationArgs.index + 1;
+ promiseCompleted = true
+ }, function ignoreError() { });
+ if (!promiseCompleted) {
+ promise.done(function () {
+ this._forEachIteration(iterationArgs)
+ }.bind(this), function (error) {
+ iterationArgs.error(error)
+ });
+ break
+ }
+ }
+ if (promiseCompleted)
+ iterationArgs.completed()
+ }, _items: function _items(index, countBefore, countAfter) {
+ var safeCount = this._data.length;
+ var first = (countBefore !== undefined && !isNaN(countBefore)) ? Math.max(index - countBefore, 0) : 0;
+ var last = (countAfter !== undefined && !isNaN(countAfter)) ? Math.min(index + countAfter, safeCount - 1) : safeCount - 1;
+ var data = [];
+ var offset = Math.max(index - first, 0);
+ if (first < this.count && first <= last)
+ data = this._data.slice(first, last + 1);
+ return {
+ items: data, offset: offset, totalCount: this.count, absoluteIndex: first + offset
+ }
+ }, _emptyItems: function _emptyItems(index) {
+ return {
+ items: [], offset: 0, totalCount: this.count, absoluteIndex: index
+ }
+ }, _item: function _item(index) {
+ this._validateIndex(index);
+ return this._itemNoValidate(index)
+ }, _itemNoValidate: function (index) {
+ var data = this._data[index];
+ if (data) {
+ this._keyMap[this._itemKey(data)] = index;
+ data.itemIndex = index
+ }
+ else if ((index >= 0) && (index < this.count))
+ data = null;
+ return data
+ }, _itemFromKey: function _itemFromKey(key) {
+ return this._item(this._indexFromKey(key))
+ }, _updateCacheData: function _updateCacheData(index, data) {
+ this._validateIndex(index);
+ if (this._data.length <= index)
+ this._data.length = index + 1;
+ this._data[index] = data;
+ return data
+ }, _cacheData: function _cacheData(index, data) {
+ if (index < this._data.length)
+ this._data.splice(index, 0, data);
+ else if (index >= 0) {
+ if (this._data.length <= index)
+ this._data.length = index + 1;
+ this._data[index] = data
+ }
+ return data
+ }, _uncacheData: function _uncacheData(startIndex, count) {
+ return this._data.splice(startIndex, count)
+ }, _createEmptyItem: function _createEmptyItem() {
+ var emptyItem = new MS.Entertainment.Data.Factory.ListItemWrapper;
+ emptyItem.key = this._createItemKey(item);
+ return emptyItem
+ }, _createPlaceholderItem: function _createPlaceholderItem(index) {
+ var item = this._item(index);
+ if (!item)
+ item = this._cacheData(index, this._createEmptyItem());
+ return item
+ }, _createItemKey: function _createItemKey(data) {
+ var key;
+ if (data && data.getHashCode) {
+ key = data.getHashCode();
+ if (key !== null && key !== undefined)
+ key += String.empty;
+ if (!key || key in this._keyMap) {
+ MS.Entertainment.Data.fail("Key is null or undefined or already exists in list. Key = " + key);
+ key = null
+ }
+ }
+ while (!key || key in this._keyMap)
+ key = (this._nextDefaultKey++) + String.empty;
+ return key
+ }, _itemKey: function _itemKey(data) {
+ if (!data.key)
+ data.key = this._createItemKey(data);
+ return data.key
+ }, _updateItemKeyMap: function _updateItemKeyMap(startIndex, endIndex) {
+ endIndex = endIndex || this._data.length;
+ for (var i = startIndex; i < this._data.length && i <= endIndex; i++)
+ this._itemNoValidate(i)
+ }, _keyFromIndex: function _keyFromIndex(index) {
+ var data;
+ if (index >= 0 && index < this.count)
+ data = this._item(index);
+ if (data)
+ return data.key
+ }, _indexFromKey: function _indexFromKey(key) {
+ return this._keyMap[key]
+ }, indexFromSourceIndex: function indexFromSourceIndex(index) {
+ return index
+ }, indexToSourceIndex: function indexToSourceIndex(index) {
+ return index
+ }, _setAt: function _setAt(index, newData) {
+ this._validateIndex(index);
+ var oldItem = this._item(index);
+ var newItem = this.createItem(newData, oldItem.isNonSourceData);
+ this._updateCacheData(index, newItem);
+ newItem.key = oldItem.key;
+ return newItem
+ }, _changeByKey: function _changeByKey(key, newData) {
+ var index = this._indexFromKey(key);
+ return this._setAt(index, newData)
+ }, _moveByKey: function _moveByKey(fromKey, toIndex) {
+ var fromIndex = this._indexFromKey(fromKey);
+ return this._moveByIndex(fromIndex, toIndex)
+ }, _moveByIndex: function _moveByIndex(fromIndex, toIndex) {
+ this._validateIndex(fromIndex);
+ this._validateInsertIndex(toIndex);
+ if (fromIndex < toIndex)
+ toIndex--;
+ var data = this._uncacheData(fromIndex, 1)[0];
+ fromIndex = data.itemIndex;
+ data = this._cacheData(toIndex, data);
+ this._updateItemKeyMap(Math.min(fromIndex, toIndex));
+ return data
+ }
+ }, {
+ isList: function isList(list) {
+ return MS.Entertainment.Data.List.prototype.isPrototypeOf(list)
+ }, isListOrArray: function isListOrArray(listOrArray) {
+ return Array.isArray(listOrArray) || MS.Entertainment.Data.List.prototype.isPrototypeOf(listOrArray)
+ }, getData: function getData(list, index) {
+ var result;
+ if (Array.isArray(list))
+ result = list[index];
+ else if (MS.Entertainment.Data.List.isList(list))
+ result = list.itemsFromIndex(index, 0, 0).then(function (result) {
+ return result.items[result.offset].data
+ });
+ else
+ result = list;
+ return WinJS.Promise.as(result)
+ }, dataFromIndex: function dataFromIndex(list, index) {
+ var returnValue = list;
+ if (MS.Entertainment.Data.List.isList(list))
+ returnValue = list.itemsFromIndex(index, 0, 0).then(function gotItems(args) {
+ var item = args.items[args.offset];
+ return item ? item.data : null
+ });
+ return WinJS.Promise.as(returnValue)
+ }, listToArray: function listToArray(list, startIndex, maxCount) {
+ var result;
+ if (isNaN(startIndex))
+ startIndex = 0;
+ if (Array.isArray(list)) {
+ var endIndex = (!isNaN(maxCount)) ? startIndex + maxCount + 1 : undefined;
+ result = WinJS.Promise.wrap(list.slice(startIndex, endIndex))
+ }
+ else if (MS.Entertainment.Data.List.isList(list))
+ result = list.toArrayAll(startIndex, maxCount);
+ else if (list)
+ result = WinJS.Promise.wrap([list]);
+ else
+ result = WinJS.Promise.wrap([]);
+ return result
+ }, CountResult: { unknown: "unknown" }, FetchError: {
+ noResponse: "noResponse", doesNotExist: "doesNotExist"
+ }, ErrorMessage: {
+ ListChanged: "List has changed", isListChangedError: function isListChangedError(error) {
+ return error && error.message === MS.Entertainment.Data.List.ErrorMessage.ListChanged
+ }
+ }
+ })
+ })
+ })(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/virtuallist.js:18793 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+ (function (MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ chunkingType: {
+ nothing: 0, next: 1, previous: 2
+ }, VirtualListBase: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.List", function virtualListBaseConstructor(itemFactory, chunker) {
+ MS.Entertainment.Data.List.prototype.constructor.call(this, itemFactory);
+ this._chunker = chunker;
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._cacheLifespanMS = configurationManager.shell.randomAccessCacheLifespanMS
+ }, {
+ _uncacheTimer: null, _cacheLifespanMS: 0, _chunkingDirection: 0, _chunkingPreviousIndex: 0, _chunkingWorkerPromise: null, _chunkerEvents: null, _notificationHandler: null, _groupHinter: null, _pendingGroupHinter: null, _groupHinterExecuted: false, _currentGroupHinterPromise: null, _delayGroupHinterPromise: null, _chunker: null, _chunkerCount: -1, _loadedRanges: null, _loadedNonSourceRanges: null, _editCount: 0, _maxRandomAccessIndexSeen: -1, _allowValidateRanges: 0, _grouper: null, _grouperEvents: null, _groupHinterRefreshDelayMS: 1000, dispose: function dispose() {
+ MS.Entertainment.Data.List.prototype.dispose.call(this);
+ this._stopLazyValidation();
+ this._notificationHandler = null;
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ if (this._grouper)
+ this._grouper.dispose();
+ this.chunker = null;
+ if (this._grouperEvents) {
+ this._grouperEvents.cancel();
+ this._grouperEvents = null
+ }
+ if (this._currentGroupHinterPromise) {
+ this._currentGroupHinterPromise.cancel();
+ this._currentGroupHinterPromise = null
+ }
+ if (this._delayGroupHinterPromise) {
+ this._delayGroupHinterPromise.cancel();
+ this._delayGroupHinterPromise = null
+ }
+ this._grouper = null;
+ this._stopUncacheTimer()
+ }, chunkingEnabled: {
+ get: function () {
+ return (!!this._chunker)
+ }
+ }, chunker: {
+ get: function () {
+ return this._chunker
+ }, set: function (value) {
+ if (value !== this._chunker) {
+ var wasCacheClearingEnabled = this._randomAccessCachingEnabled;
+ var chunkerCount = (value) ? typeof value.totalCount === "number" ? value.totalCount : -1 : -1;
+ var count = chunkerCount;
+ this._chunker = value;
+ if (this._chunker && !this.randomAccessChunking && this.sequentialChunking)
+ this._chunker.chunkDestination = this.createSequentialChunkDestination();
+ if (this._chunker)
+ count = chunkerCount;
+ else if (wasCacheClearingEnabled)
+ this.clear();
+ else
+ count = this.sourceCount;
+ if (count >= 0)
+ this.count = count + this._loadedNonSourceRanges.count(0);
+ this._chunkerCount = chunkerCount;
+ this._updateChunkerEventHandlers();
+ this._notifyInvalidateList();
+ MS.Entertainment.Data.assert(!this._chunker || this.randomAccessChunking || this.sequentialChunking, "The chunker doesn't support sequential or random access chunking. The chunker can't be meaningfully used.")
+ }
+ }
+ }, handleChunkerChanges: {
+ get: function () {
+ return !!this._chunkerEvents
+ }
+ }, chunkerCount: {
+ get: function () {
+ return this._chunkerCount
+ }
+ }, loadedCount: {
+ get: function get_loadedCount() {
+ var loadedCount;
+ if (this.randomAccessChunking)
+ loadedCount = this.count;
+ else
+ loadedCount = this._loadedRanges.count(0, this.count);
+ MS.Entertainment.Data.assert(loadedCount <= this._data.length, "The loaded count shouldn't be larger than the cached data length");
+ return loadedCount
+ }
+ }, sourceCount: {
+ get: function get_sourceCount() {
+ var count = this.loadedSourceCount;
+ if (!this.randomAccessChunking && count < this._sourceCount)
+ count = this._sourceCount;
+ return count
+ }
+ }, loadedSourceCount: {
+ get: function get_loadedSourceCount() {
+ var loadedCount = this.loadedCount;
+ var nonSourceCount = this.nonSourceCount;
+ MS.Entertainment.Data.assert(this.randomAccessChunking || nonSourceCount > 0 || loadedCount === this._data.length, "When sequential chunking and there is no non-source, the loaded count should equal the cached data length");
+ return loadedCount - nonSourceCount
+ }
+ }, hasChunkerCount: {
+ get: function () {
+ return this.chunkerCount >= 0
+ }
+ }, sequentialChunking: {
+ get: function () {
+ return (!!this._chunker && !!this._chunker.loadPreviousChunk && !!this._chunker.loadNextChunk)
+ }
+ }, randomAccessChunking: {
+ get: function () {
+ return (!!this._chunker && this.hasChunkerCount && !!this._chunker.loadChunk && !this._chunker.isDisposed)
+ }
+ }, hasNextChunk: {
+ get: function get_hasNextChunk() {
+ return (this._chunker) ? this._chunker.hasNextChunk && (!this.hasMaxCount || this.loadedCount < this.maxCount) : false
+ }
+ }, hasPreviousChunk: {
+ get: function () {
+ return (this._chunker) ? this._chunker.hasPreviousChunk : false
+ }
+ }, chunkSize: {
+ get: function () {
+ return (this._chunker) ? this._chunker.chunkSize : 0
+ }
+ }, groupHinter: {
+ get: function () {
+ return this._pendingGroupHinter || this._groupHinter
+ }, set: function (value) {
+ if (this._groupHinter !== value && this._pendingGroupHinter !== value)
+ this._pendingGroupHinter = value
+ }
+ }, groups: {
+ get: function get_groups() {
+ var groups = null;
+ if (this._grouper && this._grouper.groups)
+ groups = this._grouper.groups;
+ return groups
+ }
+ }, groupHints: {
+ get: function () {
+ return (this._grouper && this._grouper.groupHints)
+ }
+ }, hasGroupHints: {
+ get: function () {
+ var hasGroupHintsOrListIstEmpty = !!this.groupHints && (this.groupHints.count > 0 || this.count === 0);
+ return (!!this._groupHinter || !!this._pendingGroupHinter) && (!this._groupHinterExecuted || hasGroupHintsOrListIstEmpty)
+ }
+ }, isGroupHintsReady: {
+ get: function () {
+ return this.hasGroupHints && !!this.groupHints && this.groupHints.count > 0
+ }
+ }, source: {
+ get: function () {
+ return this._source
+ }
+ }, grouper: {
+ get: function () {
+ return (this._grouper) ? this._grouper.grouper : null
+ }
+ }, headerIndices: {
+ get: function () {
+ if (this._grouper)
+ return this._grouper.headerIndices;
+ else
+ return []
+ }
+ }, nonSourceIndices: {
+ get: function () {
+ var result = [];
+ if (this._loadedNonSourceRanges)
+ this._loadedNonSourceRanges.ranges.forEach(function (item) {
+ for (var i = item.start; i <= item.end; i++)
+ result.push(i)
+ });
+ return result
+ }
+ }, nonSourceCount: {
+ get: function () {
+ var result = 0;
+ if (this._loadedNonSourceRanges)
+ result = this._loadedNonSourceRanges.count(0, this.count);
+ return result
+ }
+ }, _randomAccessCachingEnabled: {
+ get: function () {
+ return (this._cacheLifespanMS > 0) && (this.randomAccessChunking)
+ }
+ }, createItem: function createItem(source, isNonSourceData) {
+ var item = MS.Entertainment.Data.List.prototype.createItem.apply(this, arguments);
+ item.isNonSourceData = (isNonSourceData === undefined) ? true : isNonSourceData;
+ return item
+ }, setGrouper: function setGrouper(value) {
+ if ((this._disposed && value) || (this._grouper && this._grouper === value) || (!this._grouper && !value))
+ return WinJS.Promise.wrap();
+ return this._setGrouper(value)
+ }, _ensureGrouper: function _ensureGrouper() {
+ if (!this._grouper)
+ this._setGrouper(new MS.Entertainment.Data.ListGrouper(MS.Entertainment.Data.emptyGrouper, this))
+ }, _setGrouper: function _setGrouper(value) {
+ if (this._disposed && value)
+ return WinJS.Promise.wrap();
+ var oldGrouper = this._grouper;
+ this._grouper = null;
+ if (this._grouperEvents) {
+ this._grouperEvents.cancel();
+ this._grouperEvents = null
+ }
+ if (oldGrouper && !this._disposed)
+ oldGrouper.clear();
+ if (value) {
+ MS.Entertainment.Data.assert(value instanceof MS.Entertainment.Data.ListGrouperBase, "Invalid grouper passed to the virtual list");
+ this._grouper = value;
+ if (this._grouper.isInlineGrouper)
+ this._grouperEvents = MS.Entertainment.Utilities.addEventHandlers(this._grouper, { batchChange: this._onBatchChange.bind(this) })
+ }
+ if ((oldGrouper && oldGrouper.grouper && oldGrouper.isInlineGrouper) || (this._grouper && this._grouper.grouper && this._grouper.isInlineGrouper))
+ return this._updateGroups();
+ else
+ return WinJS.Promise.wrap()
+ }, getGroupHints: function getGroupHints() {
+ return this._loadPendingGroupHints(true).then(null, function ignoreError() { }).then(function returnGroupHints() {
+ return this.groupHints
+ }.bind(this))
+ }, _forceRefreshGroupHints: function forceRefreshGroupHints() {
+ return this._loadPendingGroupHints(true)
+ }, _loadPendingGroupHints: function _loadPendingGroupHints(refreshAlways, useTimeout) {
+ if (this._pendingGroupHinter) {
+ this._groupHinter = this._pendingGroupHinter;
+ this._pendingGroupHinter = null;
+ return this._refreshGroupHints(useTimeout)
+ }
+ else if (refreshAlways)
+ return this._refreshGroupHints(useTimeout)
+ }, _refreshGroupHints: function _refreshGroupHints(useTimeout) {
+ this._groupHinterExecuted = false;
+ if (useTimeout)
+ return this._delayRefreshGroupHints();
+ else
+ return this._noDelayRefreshGroupHints()
+ }, _delayRefreshGroupHints: function _delayRefreshGroupHints() {
+ if (this._delayGroupHinterPromise)
+ this._delayGroupHinterPromise.cancel();
+ this._delayGroupHinterPromise = WinJS.Promise.timeout(this._groupHinterRefreshDelayMS).then(this._noDelayRefreshGroupHints.bind(this), function ignoreError() { });
+ return this._delayGroupHinterPromise
+ }, _noDelayRefreshGroupHints: function _noDelayRefreshGroupHints() {
+ var groupHintsPromise = null;
+ var pauseOperation;
+ if (this._delayGroupHinterPromise) {
+ this._delayGroupHinterPromise.cancel();
+ this._delayGroupHinterPromise = null
+ }
+ if ((this._disposed) || (this._currentGroupHinterPromise) || (!this._groupHinter && !this.groupHints))
+ return WinJS.Promise.as(this._currentGroupHinterPromise);
+ this._currentGroupHinterPromise = groupHintsPromise = this._pauseChunkerEvents();
+ this._currentGroupHinterPromise = groupHintsPromise = groupHintsPromise.then(function pausedChunkerEvents(pauseResult) {
+ var result;
+ pauseOperation = pauseResult;
+ if (!this._groupHinter)
+ result = null;
+ else if (!this._groupHinter.getItems) {
+ MS.Entertainment.Data.fail("A groupHinter must implement a getItems() function");
+ result = null
+ }
+ else
+ result = this._groupHinter.getItems();
+ return result
+ }.bind(this)).then(function gotGroupHints(groupHints) {
+ return groupHints
+ }.bind(this), function handleGetGroupHintsError(error) {
+ MS.Entertainment.Data.assert(WinJS.Promise.isCanceledError(error), "For some reason getting the group hints failed. Error: " + (error && error.message));
+ return null
+ }.bind(this)).then(function setGroupHints(groupHints) {
+ if (this._currentGroupHinterPromise === groupHintsPromise) {
+ this._groupHinterExecuted = true;
+ return this._setGroupHints(groupHints)
+ }
+ }.bind(this)).then(function setGroupHintsCompleted() {
+ if (this._currentGroupHinterPromise === groupHintsPromise)
+ this._currentGroupHinterPromise = null;
+ if (pauseOperation)
+ pauseOperation.cancel();
+ return this.groupHints
+ }.bind(this));
+ return WinJS.Promise.as(groupHintsPromise)
+ }, _setGroupHints: function _setGroupHints(groupHints) {
+ if (groupHints)
+ this._ensureGrouper();
+ if (this._grouper && groupHints !== this._grouper.groupHints) {
+ var oldValue = this._grouper.groupHints;
+ return this._grouper.setGroupHints(groupHints).then(function notifyChanges() {
+ if (groupHints)
+ this._forceListenToAllRandomAccessChanges();
+ this.dispatchChangeAndNotify("groupHints", groupHints, oldValue)
+ }.bind(this), function handleSetGroupHintsError(error) {
+ MS.Entertainment.Data.fail("Failed to set group hints. Error message = " + (error && error.message))
+ })
+ }
+ }, _pauseChunkerEvents: function _pauseChunkerEvents() {
+ var promise;
+ var cancelOperation;
+ if (this.chunker && this.chunker.pause) {
+ promise = this.chunker.pause();
+ cancelOperation = {
+ cancel: function cancel() {
+ if (cancelOperation) {
+ this._unpauseChunkerEvents();
+ cancelOperation = null
+ }
+ }.bind(this)
+ }
+ }
+ return WinJS.Promise.as(promise).then(null, function ignoreError() { }).then(function pauseCompleted() {
+ return cancelOperation || { cancel: function () { } }
+ })
+ }, _unpauseChunkerEvents: function _unpauseChunkerEvents() {
+ var promise;
+ if (this.chunker && this.chunker.unpause)
+ promise = this.chunker.unpause();
+ return WinJS.Promise.as(promise)
+ }, _delayCancelOperation: function _delayCancelOperation(operation) {
+ if (operation && operation.cancel)
+ MS.Entertainment.Utilities.schedulePromiseBelowNormal(null, "VirtualList::_delayCancelOperation").done(function _delayCancelOperationWork() {
+ operation.cancel()
+ })
+ }, _needToUpdateRandomAccessChangesRange: {
+ get: function () {
+ return this.chunker && this.randomAccessChunking && this.count && this.hasCount && this.groupHints && this._maxRandomAccessIndexSeen < this.count - 1
+ }
+ }, _randomAccessIndexSeen: function _randomAccessIndexSeen(index) {
+ if (index > this._maxRandomAccessIndexSeen)
+ this._maxRandomAccessIndexSeen = index
+ }, _forceListenToAllRandomAccessChanges: function _forceListenToAllRandomAccessChanges() {
+ if (this._needToUpdateRandomAccessChangesRange) {
+ var pauseOperation;
+ this._pendingRandomAccessChangesRange = this._pendingRandomAccessChangesRange || this._pauseChunkerEvents().then(function chunkerPaused(result) {
+ pauseOperation = result;
+ return this._safeChunkWork(function loadLastChunk() {
+ if (this._needToUpdateRandomAccessChangesRange) {
+ this._pendingRandomAccessChangesRange = null;
+ this._randomAccessIndexSeen(this.count - 1);
+ return this.chunker.loadChunk(this.indexToSourceIndex(this.count - 1), 0, 0)
+ }
+ }.bind(this))
+ }.bind(this)).then(null, function ignoreError() { }).then(function unpauseChunker() {
+ if (pauseOperation)
+ pauseOperation.cancel()
+ })
+ }
+ }, setNotificationHandler: function setNotificationHandler(notificationHandler) {
+ if (this._disposed)
+ return;
+ this._notificationHandler = notificationHandler
+ }, preventNotifications: false, _clearChunkerEventHandlers: function _clearChunkerEventHandlers() {
+ if (this._chunkerEvents) {
+ this._chunkerEvents.cancel();
+ this._chunkerEvents = null
+ }
+ }, _updateChunkerEventHandlers: function _updateChunkerEventHandler() {
+ this._clearChunkerEventHandlers();
+ if (this.chunker)
+ this._chunkerEvents = MS.Entertainment.Utilities.addEvents(this.chunker, {
+ batchChange: this._onBatchChange.bind(this), reset: this._handleChunkerReset.bind(this)
+ })
+ }, _onBatchChange: function _onBatchChange(args) {
+ var nonSourceData = args.detail.sender === this._grouper;
+ var changes = args.detail.changes;
+ return this._handleBatchChanges(changes, nonSourceData)
+ }, applyBatchChanges: function applyBatchChanges(changes) {
+ return this._handleBatchChanges(changes, false)
+ }, _handleBatchChanges: function _handleBatchChanges(changes, nonSourceData) {
+ return this._copyFromSourceIfNeededAndEdit().then(function readyForEdit() {
+ var data,
+ oldData,
+ key,
+ index,
+ lastChange;
+ var lastChangeIndex = -1;
+ var startIndex = this.count;
+ var failure = false;
+ var reload = false;
+ var batch = this._startNotificationBatch(MSE.Data.VirtualListBase.changeType.source);
+ try {
+ changes.forEach(function applyChange(change) {
+ data = null;
+ lastChange = change;
+ lastChangeIndex++;
+ if (change.absoluteIndex >= 0)
+ index = change.absoluteIndex;
+ else
+ index = this._indexFromSourceIndex(change.index, change.change === "Add");
+ switch (change.change) {
+ case "Add":
+ this._validateInsertIndex(index);
+ data = this.createItem(change.value, nonSourceData);
+ this._ensureGroupLink(data);
+ this._addCount(1);
+ data = this._cacheData(index, data);
+ startIndex = Math.min(startIndex, data.itemIndex);
+ batch.inserted(data, this._keyFromIndex(data.itemIndex - 1), this._keyFromIndex(data.itemIndex + 1), data.itemIndex);
+ break;
+ case "Remove":
+ this._validateIndex(index);
+ startIndex = Math.min(startIndex, index);
+ data = this._uncacheData(index, 1)[0];
+ key = this._removeDataKey(data);
+ this._addCount(-1);
+ if (data)
+ batch.removed(key, data.itemIndex);
+ break;
+ case "Update":
+ oldData = this._itemNoValidate(index);
+ if (change.value) {
+ data = this.createItem(change.value, nonSourceData);
+ this._ensureGroupLink(data)
+ }
+ if (oldData && data) {
+ data = this._updateCacheData(index, data);
+ data.key = oldData.key;
+ batch.changed(data, oldData)
+ }
+ break;
+ case "Reload":
+ reload = true;
+ break
+ }
+ { }
+ }.bind(this))
+ }
+ catch (error) {
+ MS.Entertainment.Data.fail("Exception occured while handling change event. Error message: " + (error && error.message), null, MS.Entertainment.UI.Debug.errorLevel.low);
+ failure = true;
+ reload = false
+ }
+ if (failure && this._canResetCaches)
+ this._resetCaches();
+ else {
+ if (this._validateIndexNoThrow(startIndex))
+ this._updateItemKeyMap(startIndex);
+ if (reload) {
+ this._cancelNotificationBatch();
+ this._notifyReload()
+ }
+ else
+ this._endNotificationBatch();
+ this._safeStartUncacheTimer();
+ this._startLazyValidation()
+ }
+ }.bind(this))
+ }, forEach: function forEach(callback, index, countAfter) {
+ var that = this;
+ index = index || 0;
+ var sourceCount = countAfter !== undefined && countAfter !== null ? index + countAfter : undefined;
+ return this._copyFromSourceAsync(sourceCount).then(function copiedSourceItems() {
+ return that._forEach(callback, index, countAfter)
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, forEachAll: function forEachAll(callback, index, countAfter) {
+ index = index || 0;
+ var callbacks = {
+ iteration: callback, completed: null, error: null, cancel: function () {
+ callbacks.cancelled = true
+ }, cancelled: false
+ };
+ var promise = new WinJS.Promise(function startForEachAll(completed, error) {
+ callbacks.completed = completed;
+ callbacks.error = error;
+ this._forEachAll(callbacks, index, countAfter)
+ }.bind(this), function cancelForEachAll() {
+ callbacks.cancel()
+ });
+ promise.done(function forEachAllCompleted() {
+ callbacks = null
+ }, function forEachAllError() {
+ callbacks = null
+ });
+ return promise
+ }, _forEachAll: function _forEachAll(callbacks, index, countAfter) {
+ index = index || 0;
+ var itemsFromIndexCountAfter = countAfter;
+ var itemsFromIndexPromise;
+ if (isNaN(itemsFromIndexCountAfter))
+ itemsFromIndexCountAfter = this.chunkSize > 0 ? this.chunkSize : 100;
+ if (this._disposed)
+ itemsFromIndexPromise = WinJS.Promise.wrapError(new Error("forEachAll stopped because the list has been disposed."));
+ else
+ itemsFromIndexPromise = this.itemsFromIndex(index, 0, itemsFromIndexCountAfter);
+ itemsFromIndexPromise.then(function gotItems(result) {
+ if (callbacks.cancelled)
+ return;
+ var oldIndex = index;
+ var adjustedCountAfter = isNaN(countAfter) ? result.totalCount - index - 1 : Math.min(countAfter, result.totalCount - index - 1);
+ var lastNeededIndex = index + adjustedCountAfter;
+ var lastLoadedAfter = result.items.length - result.offset;
+ var lastLoadedIndex = index + lastLoadedAfter - 1;
+ var maxItemsIndex;
+ if (lastNeededIndex <= lastLoadedIndex) {
+ index = -1;
+ maxItemsIndex = result.items.length - (lastLoadedIndex - lastNeededIndex) - 1
+ }
+ else if (lastLoadedAfter >= 0) {
+ countAfter = countAfter - lastLoadedAfter;
+ index = lastLoadedIndex + 1;
+ maxItemsIndex = result.items.length - 1
+ }
+ else if (!this.randomAccessChunking)
+ index = -1;
+ return new WinJS.Promise(function promiseInitialization(completed, error) {
+ this._forEachIteration({
+ callback: callbacks.iteration, cancel: callbacks.cancel, index: result.offset, last: maxItemsIndex, completed: completed, error: error, stopped: false, getCount: function getCount() {
+ return !result.items ? 0 : result.items.length
+ }, getItem: function getItem(index) {
+ return !result.items ? null : result.items[index]
+ }
+ })
+ }.bind(this))
+ }.bind(this)).done(function checkIfMoreDataNeeded() {
+ if (callbacks.cancelled || index < 0)
+ callbacks.completed();
+ else
+ this._forEachAll(callbacks, index, countAfter)
+ }.bind(this), function forEachAllFailed(error) {
+ if (error && error.shouldRetry)
+ this._forEachAll(callbacks, index, countAfter);
+ else {
+ MS.Entertainment.Data.fail("forEachAll interation has failed. error: " + (error && error.message));
+ callbacks.error(error)
+ }
+ }.bind(this))
+ }, isHeader: function isHeader(index) {
+ return this._grouper ? this._grouper.countHeaders(index, index) === 1 : 0
+ }, headerCount: {
+ get: function getHeaderCount() {
+ return this._grouper ? this._grouper.countHeaders(0, this.count) : 0
+ }
+ }, _items: function _items(index, countBefore, countAfter) {
+ var result = MS.Entertainment.Data.List.prototype._items.apply(this, arguments);
+ if (this._shouldCalculateGroupIndexHint() && result && result.items)
+ result.items.forEach(this._ensureGroupLink.bind(this));
+ this._loadPendingGroupHints();
+ return result
+ }, _shouldCalculateGroupIndexHint: function _shouldCalculateGroupIndexHint() {
+ return this.groupHinter && (!this._grouper || (this._grouper.grouper && this._grouper.grouper.noHeaderGroups))
+ }, _ensureGroupLink: function _ensureGroupLink(item) {
+ if (this._shouldCalculateGroupIndexHint() && item) {
+ if (this._grouper)
+ item.groupIndexHint = this._grouper.groupHintIndexFromIndex(item.itemIndex);
+ if (item.groupIndexHint < 0 || !item.groupIndexHint)
+ item.groupIndexHint = 0
+ }
+ }, itemsFromKey: function itemsFromKey(key, countBefore, countAfter) {
+ var result;
+ var index = this._indexFromKey(key);
+ var validIndex = typeof index === "number" && index >= 0;
+ if (!validIndex) {
+ result = new Error("Invalid index supplied, likely the item has since been removed");
+ result.name = WinJS.UI.FetchError.doesNotExist;
+ result = WinJS.Promise.wrapError(result)
+ }
+ else
+ result = this._itemsFromIndex(index, countBefore, countAfter, key);
+ return result
+ }, itemsFromDescription: function itemsFromDescription(itemDescription, countBefore, countAfter) {
+ var result;
+ var index = this._indexFromItemDescription(itemDescription);
+ index = this._indexFromSourceIndex(index) - this._loadedNonSourceRanges.exclusionCount(index, index);
+ if (index >= 0)
+ result = this._itemsFromIndex(index, countBefore, countAfter, null).then(function examineResult(result) {
+ result.totalCount = null;
+ return result
+ }.bind(this));
+ else
+ result = WinJS.Promise.wrapError(new Error("Unable to locate item from the given description"));
+ return result
+ }, itemsFromIndex: function itemsFromIndex(index, countBefore, countAfter) {
+ return this._itemsFromIndex(index, countBefore, countAfter)
+ }, _itemsFromIndex: function _itemsFromIndex(index, countBefore, countAfter, keyHint) {
+ if (!this._indexFromKey(keyHint))
+ keyHint = null;
+ return this._onItemsFromIndex(index, countBefore, countAfter).then(function _itemsFromIndex() {
+ if (this.randomAccessChunking)
+ return this._itemsFromIndexRandomChunking(index, countBefore, countAfter, keyHint);
+ else
+ return this._itemsFromIndexSequentialChunking(index, countBefore, countAfter)
+ }.bind(this))
+ }, _itemsFromIndexRandomChunking: function _itemsFromIndexRandomChunking(index, countBefore, countAfter, keyHint) {
+ var cacheStartCount = 0;
+ var cacheEndCount = 0;
+ var cacheMiddleCount = 0;
+ var chunkingWorkerPromise = this._chunkingWorkerPromise || WinJS.Promise.wrap();
+ var editCount = this._editCount;
+ var originalBefore = countBefore;
+ var originalAfter = countAfter;
+ var clampRange = false;
+ if (isNaN(countBefore)) {
+ countBefore = 0;
+ clampRange = true
+ }
+ if (isNaN(countAfter)) {
+ countAfter = Math.max(0, this.chunkSize - 1);
+ clampRange = true
+ }
+ if (this.chunkSize) {
+ if (clampRange && countBefore + 1 + countAfter > this.chunkSize)
+ if (countBefore > countAfter) {
+ countAfter = Math.max(0, this.chunkSize - (countBefore + 1));
+ countBefore = Math.max(0, this.chunkSize - (countAfter + 1))
+ }
+ else {
+ countBefore = Math.max(0, this.chunkSize - (countAfter + 1));
+ countAfter = Math.max(0, this.chunkSize - (countBefore + 1))
+ }
+ countBefore = index - (Math.floor((index - countBefore) / this.chunkSize) * this.chunkSize);
+ countAfter = ((Math.floor((index + countAfter) / this.chunkSize) + 1) * this.chunkSize) - 1 - index
+ }
+ if (index - countBefore < 0 || countBefore < 0)
+ countBefore = index;
+ if (this.count >= 0 && index + countAfter >= this.count)
+ countAfter = this.count - index - 1;
+ var pauseChunkerEventsPromise = this._pauseChunkerEvents();
+ var pauseOperation = null;
+ var lastRandomChunkFinished = function lastRandomChunkFinished() {
+ return pauseChunkerEventsPromise.then(function chunkerPaused(operation) {
+ pauseOperation = operation;
+ if (editCount !== this._editCount)
+ return this._createRetryError(MS.Entertainment.Data.List.ErrorMessage.ListChanged);
+ this._stopUncacheTimer();
+ this._startNotificationBatch(MSE.Data.VirtualListBase.changeType.source);
+ return this._copyFromSourceIfNeeded()
+ }.bind(this))
+ }.bind(this);
+ return this._chunkingWorkerPromise = chunkingWorkerPromise.then(lastRandomChunkFinished, lastRandomChunkFinished).then(function copiedFromSource() {
+ if (!this.randomAccessChunking)
+ return WinJS.Promise.wrapError(new Error("Item request has failed because the list has likely been disposed"));
+ editCount = this._editCount;
+ var rangeCount0,
+ rangeCount1,
+ rangeCount2,
+ rangeCount3,
+ rangeCount4;
+ var cacheSourceOrigin,
+ cacheSourceStartToEnd,
+ cacheSourceStartToOrigin,
+ cacheSourceEndToOrigin;
+ var adjustedIndex,
+ adjustedBefore,
+ adjustedAfter,
+ firstIndex,
+ lastIndex,
+ requestLength;
+ var keyIndex;
+ if (keyHint) {
+ keyIndex = this._indexFromKey(keyHint);
+ index = (keyIndex !== undefined) ? keyIndex : index
+ }
+ firstIndex = index - countBefore;
+ lastIndex = index + countAfter;
+ requestLength = countBefore + 1 + countAfter;
+ cacheStartCount = this._loadedRanges.count(firstIndex, lastIndex, true);
+ cacheEndCount = this._loadedRanges.countFromEnd(index, lastIndex, true);
+ cacheMiddleCount = Math.max(0, this._loadedRanges.count(firstIndex, lastIndex) - cacheStartCount - cacheEndCount);
+ if (editCount !== this._editCount)
+ adjustedBefore = -1;
+ else if (cacheStartCount <= 0 && cacheEndCount <= 0 && cacheMiddleCount <= 0) {
+ adjustedIndex = index - this._loadedNonSourceRanges.count(0, index - countBefore - 1);
+ adjustedBefore = countBefore;
+ adjustedAfter = countAfter
+ }
+ else if (cacheStartCount === requestLength)
+ adjustedBefore = -1;
+ else {
+ rangeCount0 = this._loadedNonSourceRanges.count(index, index);
+ rangeCount1 = this._loadedNonSourceRanges.count(0, index - 1);
+ rangeCount2 = this._loadedNonSourceRanges.count(firstIndex, index - 1);
+ rangeCount3 = this._loadedNonSourceRanges.count(index + 1, lastIndex);
+ rangeCount4 = this._loadedNonSourceRanges.count(firstIndex, lastIndex);
+ cacheSourceOrigin = this._loadedRanges.count(index, index, true);
+ cacheSourceOrigin -= this._loadedNonSourceRanges.count(index, index + cacheSourceOrigin);
+ cacheSourceStartToEnd = cacheStartCount - this._loadedNonSourceRanges.count(firstIndex, firstIndex + cacheStartCount - 1);
+ cacheSourceStartToOrigin = this._loadedRanges.count(firstIndex, index - 1, true);
+ cacheSourceStartToOrigin -= this._loadedNonSourceRanges.count(firstIndex, firstIndex + cacheSourceStartToOrigin - 1);
+ cacheSourceEndToOrigin = this._loadedRanges.countFromEnd(index, lastIndex, true);
+ cacheSourceEndToOrigin -= this._loadedNonSourceRanges.count(lastIndex - cacheSourceEndToOrigin + 1, lastIndex);
+ adjustedIndex = index - rangeCount1 + (cacheSourceStartToEnd - cacheSourceStartToOrigin);
+ adjustedBefore = countBefore - rangeCount2 - cacheSourceStartToOrigin;
+ adjustedAfter = countAfter - rangeCount3 - (cacheSourceEndToOrigin) - (rangeCount0 + cacheSourceStartToEnd - cacheSourceStartToOrigin);
+ if (adjustedAfter < 0) {
+ adjustedIndex = adjustedIndex + adjustedAfter;
+ adjustedBefore = adjustedBefore + adjustedAfter;
+ adjustedAfter = 0
+ }
+ }
+ if (adjustedBefore >= 0 && adjustedAfter >= 0)
+ return this.chunker.loadChunk(adjustedIndex, adjustedBefore, adjustedAfter)
+ }.bind(this)).then(function loadedChunk(chunkResult) {
+ var j = 0;
+ var currentItem;
+ var lastCount = 0;
+ var chunkResultLength = (chunkResult) ? chunkResult.items.length : 0;
+ var chunkFailed = (chunkResult) ? chunkResult.error : false;
+ var absoluteIndex = index - countBefore;
+ var maxAbsoluteIndex = -1;
+ var result;
+ if (editCount === this._editCount) {
+ if (chunkResult)
+ this._setCountFromChunker(chunkResult.totalCount);
+ maxAbsoluteIndex = Math.min(this.count - 1, index + countAfter)
+ }
+ if (cacheStartCount > 0 && absoluteIndex <= maxAbsoluteIndex)
+ absoluteIndex += cacheStartCount;
+ while (absoluteIndex <= maxAbsoluteIndex && j < chunkResultLength) {
+ currentItem = this._item(absoluteIndex);
+ if (!currentItem || !currentItem.isNonSourceData) {
+ lastCount = this.count;
+ currentItem = this._cacheSourceItemData(absoluteIndex, chunkResult.items[j]);
+ maxAbsoluteIndex += (this.count - lastCount);
+ absoluteIndex += (currentItem.itemIndex - absoluteIndex);
+ j++
+ }
+ else if (currentItem && !currentItem.cached) {
+ result = new Error("Data is not up to data. Please try again.");
+ maxAbsoluteIndex = -1;
+ break
+ }
+ absoluteIndex += 1
+ }
+ if (chunkFailed)
+ result = this._emptyItems(index);
+ else if (maxAbsoluteIndex >= 0 || this.count === 0) {
+ var keyIndex;
+ if (keyHint)
+ keyIndex = this._indexFromKey(keyHint);
+ countAfter = Math.max(0, Math.min(maxAbsoluteIndex - index, countAfter));
+ if (keyIndex !== index && keyIndex !== undefined && keyIndex >= index - originalBefore && keyIndex <= index + originalAfter) {
+ var keyIndexDelta = keyIndex - index;
+ result = this._items(keyIndex, Math.max(originalBefore - keyIndexDelta, keyIndex - (index - originalBefore)), Math.min(Math.max(0, originalAfter + keyIndexDelta), (index + originalAfter) - keyIndex))
+ }
+ else
+ result = this._items(index, originalBefore, originalAfter)
+ }
+ if (!result)
+ result = this._createRetryError(MS.Entertainment.Data.List.ErrorMessage.ListChanged);
+ this._endNotificationBatch();
+ if (result.items)
+ this._startUncacheTimer();
+ else
+ result = WinJS.Promise.wrapError(result);
+ this._startLazyValidation();
+ return result
+ }.bind(this)).then(function handleSuccess(result) {
+ this._delayCancelOperation(pauseOperation);
+ return result
+ }.bind(this), function handleLoadChunkError(error) {
+ MS.Entertainment.Data.assert(this.isDisposed || WinJS.Promise.isCanceledError(error) || MS.Entertainment.Data.List.ErrorMessage.isListChangedError(error), "Couldn't load the chunk of data. error: " + (error && error.message));
+ this._delayCancelOperation(pauseOperation);
+ this._startLazyValidation();
+ return WinJS.Promise.wrapError(error)
+ }.bind(this))
+ }, _createRetryError: function _createRetryError(message) {
+ var error = new Error(message);
+ error.shouldRetry = true;
+ return error
+ }, _itemsFromIndexSequentialChunking: function _itemsFromIndexSequentialChunking(index, countBefore, countAfter) {
+ countBefore = isNaN(countBefore) ? 0 : countBefore;
+ countAfter = isNaN(countAfter) ? this.chunkSize - 1 : countAfter;
+ if (countBefore < 0)
+ countBefore = 0;
+ var maxEndIndex;
+ var maxStartIndex;
+ var minStartIndex;
+ var minEndIndex;
+ var startedAtEnd = countAfter + index + 1 >= this.count;
+ minStartIndex = Math.max(index - countBefore, 0);
+ minEndIndex = Math.min(index + countAfter, this.count - 1);
+ if (this.chunkSize > 0) {
+ maxEndIndex = Math.max(0, (minEndIndex + this.chunkSize - 1) - (minEndIndex % this.chunkSize));
+ maxStartIndex = Math.max(0, minStartIndex - (minStartIndex % this.chunkSize))
+ }
+ else {
+ maxEndIndex = this.count > 0 ? this.count - 1 : 0;
+ maxStartIndex = 0
+ }
+ return this._prefetchData(minStartIndex, minEndIndex, maxStartIndex, maxEndIndex).then(function prefetchCompleted() {
+ return this._copyFromSourceAsync(maxEndIndex)
+ }.bind(this)).then(function copiedFromSource() {
+ if (isNaN(countAfter) || countAfter < 0 || countAfter + index >= this.count)
+ countAfter = Math.max(0, this.count - index - 1);
+ if (this.hasNextChunk && startedAtEnd)
+ countAfter = countAfter - 1;
+ if (!this.hasNextChunk && !this.hasPreviousChunk)
+ this._setSequentialCount(this.loadedCount);
+ var itemsResult = this._items(index, countBefore, countAfter);
+ this._startLazyValidation();
+ return itemsResult
+ }.bind(this))
+ }, createSequentialChunkDestination: function createSequentialChunkDestination() {
+ var result = null;
+ if (this.sequentialChunking)
+ result = {
+ insertRangeAtEnd: this._insertSequentialChunkedSourceAtEnd.bind(this), insertRangeAtStart: this._insertSequentialChunkedSourceAtStart.bind(this), setItemFactory: this.setItemFactory.bind(this)
+ };
+ else
+ MS.Entertainment.Data.fail("Shouldn't be creating a 'sequential' chunk destination on something that doesn't support sequential loading of data.");
+ return result
+ }, createListAdaptor: function createListAdaptor() {
+ return {
+ compareByIdentity: !this.randomAccessChunking, getCount: this.getCount.bind(this), itemsFromKey: this.itemsFromKey.bind(this), itemsFromIndex: this.itemsFromIndex.bind(this), itemsFromDescription: this.itemsFromDescription.bind(this), setNotificationHandler: this.setNotificationHandler.bind(this), itemSignature: function (data) {
+ var result;
+ if (!data)
+ result = data;
+ else if (data.itemSignature !== undefined)
+ result = data.itemSignature;
+ else {
+ result = JSON.stringify(MS.Entertainment.Data.deflate(data));
+ if (!result === undefined)
+ throw new Error("item signature could not be created");
+ data.itemSignature = result
+ }
+ return result
+ }.bind(this), insertAtStart: function insertAtStart(key, data) {
+ return this._insertAtAsync(0, data)
+ }.bind(this), insertBefore: function insertBefore(key, data, nextKey, nextIndexHint) {
+ return this._insertAtAsync(this._indexFromKey(nextKey), data, nextKey)
+ }.bind(this), insertAfter: function insertAfter(key, data, previousKey, previousIndexHint) {
+ return this._insertAtAsync(this._indexFromKey(previousKey), data, previousKey, 1)
+ }.bind(this), insertAtEnd: function insertAtEnd(key, data) {
+ return this._insertAtAsync(this.count, data)
+ }.bind(this), change: function change(key, newData, indexHint) {
+ var that = this;
+ var index = this._indexFromKey(key);
+ return this._editingListPrivate(index).then(function copiedFromSource() {
+ var oldItem = that._item(index);
+ var newItem = that._changeByKey(key, newData);
+ this._dispatchItemChanged(newItem, oldItem, index);
+ return newItem
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }.bind(this), moveToStart: function moveToStart(key, indexHint) {
+ return this._moveByKeyAsync(key, 0)
+ }.bind(this), moveBefore: function moveBefore(key, nextKey, indexHint, nextIndexHint) {
+ return this._moveByKeyAsync(key, this._indexFromKey(nextKey), nextKey)
+ }.bind(this), moveAfter: function moveAfter(key, previousKey, indexHint, previousIndexHint) {
+ return this._moveByKeyAsync(key, this._indexFromKey(previousKey), previousKey, 1)
+ }.bind(this), moveToEnd: function moveToEnd(key, indexHint) {
+ return this._moveByKeyAsync(key, this.count)
+ }.bind(this), remove: function remove(key, indexHint) {
+ var that = this;
+ return this._editingListPrivate(this._indexFromKey(key), 0, this.count).then(function copiedFromSource() {
+ var index = that._indexFromKey(key);
+ var removedItem = that._removeAt(index);
+ this._dispatchRemoved(key, index);
+ return removedItem
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }.bind(this)
+ }
+ }, insertAt: function insertAt(index, data, options) {
+ var that = this;
+ var insertedData;
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function copiedFromSource() {
+ index = that._indexFromNoHeaderIndex(index, true);
+ insertedData = that._insertAt(index, data, false, options.isSourceData);
+ if (!options.suppressEvents)
+ that._notifyInsertedItem(insertedData, insertedData.itemIndex);
+ { };
+ return insertedData
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, removeAt: function removeAt(index, options) {
+ options = options || {};
+ var that = this;
+ return this._editingListPrivate(index, 0, this.count).then(function copiedFromSource() {
+ index = that._indexFromNoHeaderIndex(index);
+ var removedItem = that._removeAt(index);
+ if (removedItem && !options.suppressEvents)
+ that._notifyRemoved(removedItem.key, removedItem.itemIndex);
+ return removedItem
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, moveAt: function moveAt(fromIndex, toIndex, options) {
+ options = options || {};
+ var that = this;
+ return this._editingListPrivate(0, 0, Math.max(fromIndex, toIndex)).then(function copiedFromSource() {
+ fromIndex = that._indexFromNoHeaderIndex(fromIndex);
+ toIndex = that._indexFromNoHeaderIndex(toIndex, true);
+ var item = null;
+ if (fromIndex !== toIndex)
+ item = that._moveByIndex(fromIndex, toIndex);
+ if (item && !options.suppressEvents)
+ that._notifyMoved(item, fromIndex);
+ return item
+ }, function moveFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, moveIndices: function moveIndices(indices, toIndex, options) {
+ indices = indices || [];
+ var ranges = indices.map(function mapIndex(index) {
+ return {
+ firstIndex: index, lastIndex: index
+ }
+ });
+ return this.moveRanges(ranges, toIndex, options)
+ }, moveRanges: function moveRanges(ranges, toIndex, options) {
+ options = options || {};
+ if (!ranges)
+ throw new Error("Parameter 'ranges' was null or empty");
+ var minIndex = NaN;
+ ranges.forEach(function (range) {
+ minIndex = isNaN(minIndex) || minIndex > range.firstIndex ? range.firstIndex : minIndex
+ });
+ var that = this;
+ return this._editingListPrivate(minIndex, 0, this.count).then(function copiedFromSource() {
+ toIndex = that._indexFromNoHeaderIndex(toIndex, true);
+ var fromIndex = 0;
+ var adjustments = 0;
+ var item = null;
+ var movedItems = [];
+ if (!options.suppressEvents)
+ that._notifyBeginNotifications();
+ for (var i = ranges.length - 1; i >= 0; i--)
+ for (var j = ranges[i].lastIndex; j >= ranges[i].firstIndex; j--) {
+ fromIndex = that._indexFromNoHeaderIndex(j);
+ if (fromIndex >= toIndex) {
+ fromIndex += adjustments;
+ adjustments++
+ }
+ var item = that._moveByIndex(fromIndex, toIndex);
+ toIndex = item.itemIndex;
+ if (!options.suppressEvents)
+ that._notifyMoved(item, fromIndex);
+ movedItems.splice(0, 0, item)
+ }
+ if (!options.suppressEvents)
+ that._notifyEndNotifications();
+ return movedItems
+ })
+ }, changeAt: function changeAt(index, data, options) {
+ options = options || {};
+ return this._editingListPrivate(index, 0, 0).then(function copiedFromSource() {
+ var oldItem = this._item(index);
+ var newItem = this._setAt(index, data);
+ if (item && !options.suppressEvents)
+ this._notifyChanged(newItem, oldItem);
+ return newItem
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, insertRangeAtEnd: function insertRangeAtEnd(range, options) {
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function () {
+ var startIndex = this.count;
+ var count = this._insertRangeAt(startIndex, range, false, options.isSourceData);
+ if (!options.suppressEvents)
+ this._notifyRangeInserted(startIndex, count)
+ }.bind(this), function (error) {
+ throw error;
+ })
+ }, _insertSequentialChunkedSourceAtEnd: function _insertSequentialChunkedSourceAtEnd(range) {
+ if (!this.sequentialChunking)
+ return;
+ return this._copyFromSourceIfNeededAndEdit().then(function _insertSequentialChunkedSourceAtEndWork() {
+ if (!this.sequentialChunking)
+ return;
+ var insertOrUpdateAt = this.hasChunkerCount ? this._updateRangeAt : this._insertRangeAt;
+ var startIndex = this.loadedSourceCount;
+ insertOrUpdateAt.call(this, startIndex, range, false, true)
+ }.bind(this))
+ }, insertRangeAtStart: function insertRangeAtStart(range, options) {
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function () {
+ var count = this._insertRangeAt(0, range, false, options.isSourceData);
+ if (!options.suppressEvents)
+ this._notifyRangeInserted(0, count)
+ }.bind(this), function (error) {
+ throw error;
+ })
+ }, _insertSequentialChunkedSourceAtStart: function _insertSequentialChunkedSourceAtStart(range) {
+ if (!this.sequentialChunking)
+ return;
+ return this._copyFromSourceIfNeededAndEdit().then(function _insertSequentialChunkedSourceAtStartWork() {
+ if (!this.sequentialChunking)
+ return;
+ var insertOrUpdateAt = this.hasChunkerCount ? this._updateRangeAt : this._insertRangeAt;
+ insertOrUpdateAt.call(this, 0, range, false, true)
+ }.bind(this))
+ }, insertRangeAt: function insertRangeAt(index, range, options) {
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function () {
+ index = this._indexFromNoHeaderIndex(index, true);
+ var count = this._insertRangeAt(index, range, false, options.isSourceData);
+ if (!options.suppressEvents)
+ this._notifyRangeInserted(index, count)
+ }.bind(this), function (error) {
+ throw error;
+ })
+ }, removeIndices: function removeIndices(indices, options) {
+ indices = indices || [];
+ var ranges = indices.map(function mapIndex(index) {
+ return {
+ firstIndex: index, lastIndex: index
+ }
+ });
+ return this.removeRanges(ranges, options)
+ }, removeRangeAt: function removeRangeAt(index, count, options) {
+ options = options || {};
+ return this._editingListPrivate(index, 0, this.count).then(function () {
+ index = this._indexFromNoHeaderIndex(index);
+ var removed = this._removeRangeAt(index, count);
+ if (!options.suppressEvents)
+ this._notifyRangeRemoved(removed)
+ }.bind(this), function (error) {
+ throw error;
+ })
+ }, removeRanges: function removeRanges(ranges, options) {
+ options = options || {};
+ if (!ranges)
+ throw new Error("Parameter 'ranges' was null or empty");
+ var minIndex = NaN;
+ ranges.forEach(function (range) {
+ minIndex = isNaN(minIndex) || minIndex > range.firstIndex ? range.firstIndex : minIndex
+ });
+ return this._editingListPrivate(minIndex, 0, this.count).then(function () {
+ var removed = [];
+ for (var i = ranges.length - 1; i >= 0; i--)
+ removed = removed.concat(this._removeRangeAt(ranges[i].firstIndex, ranges[i].lastIndex - ranges[i].firstIndex + 1));
+ if (!options.suppressEvents)
+ this._notifyRangeRemoved(removed);
+ return removed
+ }.bind(this), function (error) {
+ throw error;
+ })
+ }, _setCountFromChunker: function _setCountFromChunker(count) {
+ if (count >= 0) {
+ this.count = count + this._loadedNonSourceRanges.count(0);
+ this._chunkerCount = count;
+ this._forceListenToAllRandomAccessChanges()
+ }
+ }, _setSequentialCount: function _setSequentialCount(count) {
+ if (!this.randomAccessChunking)
+ this.count = count
+ }, _setEmptyCount: function _setEmptyCount(count) {
+ if (this.count < 0)
+ this.count = count
+ }, _insertAtAsync: function _insertAtAsync(index, data, key, offset, isSourceData) {
+ var that = this;
+ offset = offset || 0;
+ return this._testEditingSource({ isSourceData: isSourceData }).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function copiedFromSource() {
+ index = (isNaN(index)) ? that._indexFromKey(key) : index;
+ var item = that._insertAt(index + offset, data, false, isSourceData);
+ if (item)
+ this._dispatchInsertedItem(item, item.itemIndex);
+ return item
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, _moveByKeyAsync: function _moveByKeyAsync(fromKey, toIndex, toKey, toOffset) {
+ var that = this;
+ toOffset = toOffset || 0;
+ toIndex = (isNaN(toIndex)) ? that._indexFromKey(toKey) : toIndex;
+ return this._editingListPrivate(0, 0, Math.max(this._indexFromKey(fromKey), toIndex)).then(function copiedFromSource() {
+ var oldIndex = that._indexFromKey(fromKey);
+ var item = that._moveByKey(fromKey, toIndex + toOffset);
+ that._dispatchMoved(item, oldIndex);
+ return item
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, indexFromSourceIndex: function indexFromSourceIndex(index) {
+ return this._indexFromSourceIndex(index, false)
+ }, indexToSourceIndex: function indexToSourceIndex(index) {
+ return index - this._loadedNonSourceRanges.count(0, index)
+ }, noHeaderIndexFromSourceIndex: function noHeaderIndexFromSourceIndex(index) {
+ return this._indexToNoHeaderIndex(this._indexFromSourceIndex(index, false))
+ }, _indexFromSourceIndex: function _indexFromSourceIndex(index, insert) {
+ return index + this._loadedNonSourceRanges.exclusionCount(0, insert && index ? index - 1 : index)
+ }, _indexToNoHeaderIndex: function _indexToNoHeaderIndex(index) {
+ if (this._grouper)
+ index -= this._grouper.countHeaders(0, index);
+ return index
+ }, _indexFromNoHeaderIndex: function _indexFromNoHeaderIndex(index, insert) {
+ if (this._grouper)
+ index += this._grouper.exclusionCountHeaders(0, insert && index ? index - 1 : index);
+ return index
+ }, _copyItemTo: function _copyItemTo(item, oldItem) {
+ if (oldItem) {
+ item.key = oldItem.key;
+ item.itemIndex = oldItem.itemIndex;
+ if (this._grouper)
+ this._grouper.copy(item, oldItem)
+ }
+ }, _updateCacheData: function _updateCacheData(index, data) {
+ if (data && data.cached) {
+ if (this._grouper)
+ index = this._grouper.update(index, data, this._itemNoValidate.bind(this));
+ data.itemIndex = index
+ }
+ data = MSE.Data.List.prototype._updateCacheData.call(this, index, data);
+ this._updateCacheDataRanges(index, data);
+ this._randomAccessIndexSeen(index);
+ return data
+ }, _updateCacheDataRanges: function _updateCacheDataRanges(index, data) {
+ if (data) {
+ if (data.cached) {
+ this._loadedRanges.insert(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.insert(index)
+ }
+ else {
+ this._loadedRanges.remove(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.remove(index)
+ }
+ this._validateCacheAt(index - 1);
+ this._validateCacheAt(index);
+ this._validateCacheAt(index + 1);
+ this._validateRanges(data.isHeader)
+ }
+ }, _cacheData: function _cacheData(index, data) {
+ if (data && data.cached) {
+ if (this._grouper)
+ index = this._grouper.insert(index, data, this._itemNoValidate.bind(this));
+ data.itemIndex = index
+ }
+ data = MSE.Data.List.prototype._cacheData.call(this, index, data);
+ if (data) {
+ this._loadedRanges.shift(index, true);
+ this._loadedNonSourceRanges.shift(index, true);
+ if (data.cached) {
+ this._loadedRanges.insert(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.insert(index)
+ }
+ this._validateCacheAt(index);
+ this._validateRanges(data.isHeader);
+ this._randomAccessIndexSeen(index)
+ }
+ return data
+ }, _uncacheData: function _uncacheData(startIndex, count) {
+ var result = [];
+ var data;
+ for (var index = startIndex + count - 1, j = 0; j < count; index--, j++) {
+ if (this._grouper)
+ index = this._grouper.remove(index, this._itemNoValidate(index), this._itemNoValidate.bind(this));
+ data = MSE.Data.List.prototype._uncacheData.call(this, index, 1)[0];
+ if (data) {
+ if (data.cached) {
+ this._loadedRanges.remove(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.remove(index)
+ }
+ data.itemIndex = index
+ }
+ this._loadedRanges.shift(index + 1, false);
+ this._loadedNonSourceRanges.shift(index + 1, false);
+ result.push(data);
+ this._validateCacheAt(index);
+ this._validateRanges(data && data.isHeader)
+ }
+ return result
+ }, _validateCacheAt: function _validateCacheAt(index) { }, _startLazyValidation: function _startLazyValidation(startIndex) { }, _stopLazyValidation: function _stopLazyValidation() { }, _validateRangesFromData: function _validtaeRangesFromData(startIndex, count) {
+ var item;
+ var cached;
+ var nonSourceCached;
+ var isHeader;
+ var i = typeof startIndex === "number" ? startIndex : 0;
+ var length = Math.min(this._data.length, typeof count === "number" ? count : this._data.length);
+ for (; i < this._data.length; i++) {
+ item = this._data[i];
+ cached = this._loadedRanges.count(i, i) === 1;
+ nonSourceCached = this._loadedNonSourceRanges.count(i, i) === 1;
+ isHeader = !!this._grouper && this._grouper.countHeaders(i, i) === 1;
+ MS.Entertainment.Data.assert(!item || (item.cached && cached) || (!item.cached && !cached), "Item's cached flag and cache range do not match. index: " + i);
+ MS.Entertainment.Data.assert(!item || (item.isNonSourceData === nonSourceCached), "Item's isNonSourceData and the range indices do not match. index: " + i);
+ MS.Entertainment.Data.assert(!this._grouper || !item || (item.isHeader === isHeader), "Item's isHeader and the range indices do not match. index: " + i)
+ }
+ }, _validateRanges: function _validateRanges(disallowGroupValidates) {
+ if (this._allowValidateRanges <= 0)
+ return;
+ var ranges;
+ var item;
+ this._validateRangesFromData();
+ if (this._allowValidateRanges <= 1)
+ return;
+ ranges = this._loadedRanges.ranges;
+ ranges.forEach(function (item) {
+ MS.Entertainment.Data.assert(item && item.start <= item.end, "A loaded data range is not correct")
+ });
+ ranges = this._loadedNonSourceRanges.ranges;
+ ranges.forEach(function (item) {
+ MS.Entertainment.Data.assert(item && item.start <= item.end, "A loaded non-source data range is not correct")
+ });
+ if (this._allowValidateRanges <= 2)
+ return;
+ if (this._grouper && this._grouper.isInlineGrouper && !disallowGroupValidates) {
+ ranges = this._grouper.headerRanges;
+ ranges.forEach(function (item) {
+ if (!item)
+ return;
+ var listStartItem = this._itemNoValidate(item.start);
+ var listEndItem = this._itemNoValidate(item.end);
+ MS.Entertainment.Data.assert(listStartItem && listStartItem.isHeader, "A header range is invalid, was expecting a header item");
+ MS.Entertainment.Data.assert(listEndItem && listEndItem.isHeader, "A header range is invalid, was expecting a header item");
+ MS.Entertainment.Data.assert((item.start === item.end) || (item.start === item.end - 1 && listStartItem.isHeader && listEndItem.isHeader && listStartItem.group.key !== listEndItem.group.key), "A header range is larger than expected.")
+ }, this)
+ }
+ }, _cacheSourceItemData: function _cacheSourceItemData(index, sourceItem) {
+ var data;
+ if (!(index in this._data)) {
+ data = this.createItem(sourceItem, false);
+ data = this._updateCacheData(index, data);
+ this._updateItemKeyMap(data.itemIndex, data.itemIndex)
+ }
+ else {
+ data = this._item(index);
+ if (!data.cached) {
+ this.copyItem(sourceItem, data);
+ this._updateCacheDataRanges(index, data)
+ }
+ }
+ return data
+ }, _uncacheSourceItemData: function _uncacheSourceItemData(index) {
+ var uncachedItem;
+ var item = this._itemNoValidate(index);
+ if (item && !item.isNonSourceData) {
+ uncachedItem = new MS.Entertainment.Data.Factory.ListItemWrapper;
+ this._copyItemTo(uncachedItem, item);
+ this._updateCacheData(index, uncachedItem)
+ }
+ }, _safeChunkWork: function _safeChunkWork(worker) {
+ var chunkingWorkerPromise = this._chunkingWorkerPromise || WinJS.Promise.wrap();
+ var newChunkingWorkerPromise = this._chunkingWorkerPromise = new WinJS.Promise(function initializePromise(complete) {
+ chunkingWorkerPromise.then(function safeToWork() {
+ var promise;
+ if (worker)
+ promise = worker();
+ return WinJS.Promise.as(promise)
+ }, function ignoreChunkingWorkerPromiseError() { }).then(null, function handleSafeChunkWorkerError(error) {
+ MS.Entertainment.Data.fail("Failed to execute work inside _safeChunkWork. Error message = " + error && error.message)
+ }).done(function finallyCompleteWork() {
+ complete()
+ }.bind(this))
+ }.bind(this));
+ return this._chunkingWorkerPromise
+ }, _safeStartUncacheTimer: function _safeStartUncacheTimer() {
+ var noChunking = false;
+ if (this._randomAccessCachingEnabled)
+ WinJS.Promise.as(this._chunkingWorkerPromise).done(function testChunking() {
+ noChunking = true
+ }, function testChunkingHandleError() {
+ noChunking = true
+ });
+ if (noChunking)
+ this._startUncacheTimer()
+ }, _startUncacheTimer: function _startUncacheTimer() {
+ if (this._disposed)
+ return;
+ this._stopUncacheTimer();
+ if (this._randomAccessCachingEnabled)
+ this._uncacheTimer = WinJS.Promise.timeout(this._cacheLifespanMS).then(function _uncacheDataTimer() {
+ if (!this._uncacheTimer)
+ return;
+ var end,
+ i,
+ range;
+ this._loadedRanges.ranges.forEach(function (range) {
+ end = range.end;
+ for (i = range.start; i <= end; i++)
+ this._uncacheSourceItemData(i)
+ }, this);
+ this._uncacheTimer = null
+ }.bind(this), function _uncacheDataTimerFailed(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ MS.Entertainment.Data.fail("Uncache timer failed to fire. Error message = " + (error && error.message))
+ })
+ }, _stopUncacheTimer: function _stopUncacheTimer() {
+ if (this._uncacheTimer) {
+ this._uncacheTimer.cancel();
+ this._uncacheTimer = null
+ }
+ }, _handleChunkerReset: function _handleChunkerReset(args) {
+ this._resetCaches(args && args.detail && args.detail.totalCount)
+ }, _canResetCaches: {
+ get: function get_canResetCaches() {
+ return this.randomAccessChunking
+ }
+ }, clear: function clear() {
+ this._setSource([]).done(null, function ignoreError() { });
+ if (this._grouper)
+ this._grouper.reset();
+ this._notifyReload()
+ }, _resetCaches: function _resetCaches(totalCountHint) {
+ var pauseOperation;
+ if (this._canResetCaches) {
+ window.msWriteProfilerMark("ent:virtualList_resetCaches:" + this._debugId + ",StartTM");
+ this._pauseChunkerEvents().then(function resetCachesWork(operation) {
+ pauseOperation = operation;
+ var i;
+ var item;
+ var nonSourceData = [];
+ var nonSourceIndices = this.nonSourceIndices;
+ var headerCount = this.headerCount;
+ var totalCount = typeof totalCountHint === "number" && totalCountHint >= 0 ? totalCountHint : this.hasChunkerCount ? this.chunkerCount : 0;
+ this._clearChunkerEventHandlers();
+ this.preventNotifications = true;
+ this._clearChunkerEventHandlers();
+ for (i = 0; i < nonSourceIndices.length; i++) {
+ item = nonSourceIndices[i];
+ if (headerCount >= nonSourceIndices.length - i)
+ break;
+ if (!this.isHeader(item)) {
+ nonSourceData.length = item + 1;
+ nonSourceData[item] = this._data[item]
+ }
+ }
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ this._maxRandomAccessIndexSeen = -1;
+ this._setSource([]).done(null, function ignoreError() { });
+ this._setCount(totalCount);
+ this._forceListenToAllRandomAccessChanges();
+ this.preventNotifications = false;
+ this._notifyReload();
+ if (this._grouper)
+ this._grouper.reset();
+ for (i = 0; i < nonSourceData.length; i++) {
+ item = nonSourceData[i];
+ if (item)
+ this.insertAt(i, item, { suppressEvents: true })
+ }
+ this._updateChunkerEventHandlers();
+ return this._forceRefreshGroupHints()
+ }.bind(this)).then(null, function ignoreError() { }).done(function resetWorkComplete() {
+ if (pauseOperation)
+ pauseOperation.cancel();
+ window.msWriteProfilerMark("ent:virtualList_resetCaches:" + this._debugId + ",StopTM")
+ }.bind(this))
+ }
+ else
+ MS.Entertainment.Data.fail("This list's caches can't be cleared and restored. _resetCaches shouldn't be invoked")
+ }, _copyFromSourceAsync: function _copyFromSourceAsync(endIndex) {
+ if (this._copyingFromSource || this.isEmptySource())
+ return WinJS.Promise.wrap();
+ var startIndex = this._data.length;
+ this._copyingFromSource = true;
+ var allSourceLoaded = false;
+ var promise = this._getSourceCountAsync().then(function gotCount(count) {
+ if (!isNaN(count)) {
+ this._setEmptyCount(count);
+ endIndex = isNaN(endIndex) ? count - 1 : Math.min(count - 1, endIndex)
+ }
+ else
+ endIndex = isNaN(endIndex) ? startIndex : endIndex;
+ allSourceLoaded = endIndex + 1 >= count;
+ if (startIndex <= endIndex)
+ return this._getSourceItemsAsync(startIndex, endIndex)
+ }.bind(this), function getFailed(error) {
+ if (error !== MSE.Data.List.CountResult.unknown)
+ return new WinJS.Promise.wrapError(error)
+ }.bind(this)).then(function gotSourceItems(result) {
+ var absoluteIndex = startIndex;
+ var insertedItem;
+ if (result && result.items) {
+ if (!isNaN(result.totalCount))
+ this._setSequentialCount(result.totalCount);
+ for (var i = 0; i < result.items.length; i++) {
+ insertedItem = this._cacheSourceItemData(absoluteIndex, result.items[i]);
+ absoluteIndex = insertedItem.itemIndex + 1
+ }
+ if (allSourceLoaded)
+ this._clearSourceItems()
+ }
+ }.bind(this));
+ this._copyingFromSource = false;
+ return promise
+ }, _copyFromSourceIfNeeded: function _copyFromSourceIfNeeded() {
+ var result;
+ if (!this.isEmptySource || !this.isEmptySource())
+ result = this._copyFromSourceAsync();
+ return WinJS.Promise.as(result)
+ }, _copyFromSourceIfNeededAndEdit: function _copyFromSourceIfNeededAndEdit() {
+ return this._copyFromSourceIfNeeded().then(function copiedFromSource() {
+ return this._editingListPrivate()
+ }.bind(this))
+ }, _testEditingSource: function _testEditingSource(editOptions) {
+ var promise;
+ if (editOptions && editOptions.isSourceData)
+ promise = this._editingSource();
+ return WinJS.Promise.as(promise)
+ }, _editingSource: function _editingSource() {
+ this._clearChunkerEventHandlers();
+ this._preventCacheClearing();
+ return this._pauseChunkerEvents()
+ }, _preventCacheClearing: function _preventCacheClearing() {
+ this._stopUncacheTimer();
+ this._cacheLifespanMS = -1
+ }, _editingListPrivate: function _editingListPrivate(index, countBefore, countAfter) {
+ var loadingPromise;
+ this._editCount++;
+ if (index >= 0) {
+ countBefore = isNaN(countBefore) ? 0 : countBefore;
+ countAfter = isNaN(countAfter) ? 0 : countAfter;
+ loadingPromise = this.itemsFromIndex(index, countBefore, countAfter)
+ }
+ return WinJS.Promise.as(loadingPromise).then(function loadedData(result) {
+ var changingSourceItem = false;
+ var items = result && result.items;
+ if (items) {
+ var startIndex = Math.max(0, result.offset - countBefore);
+ var endIndex = Math.min(items.length - 1, result.offset + countAfter);
+ for (var i = startIndex; i <= endIndex && !changingSourceItem; i++)
+ changingSourceItem = !items[i].isNonSourceData
+ }
+ if (changingSourceItem)
+ return this._editingSource()
+ }.bind(this)).then(null, function ignoreError(error) {
+ MS.Entertainment.Data.assert(WinJS.Promise.isCanceledError(error) || MS.Entertainment.Data.List.ErrorMessage.isListChangedError(error), "Getting the list ready for editting has failed. error: " + (error && error.message))
+ }).then(function doneEditing() {
+ this._editCount++
+ }.bind(this))
+ }, isEmptySource: function isEmptySource() {
+ return false
+ }, _clearSourceItems: function _clearSourceItems() {
+ throw new Error("_clearSourceItems hasn't been defined");
+ }, _getSourceItemsAsync: function _getSourceItemsAsync(startIndex, endIndex) {
+ throw new Error("_getSourceItemsAync hasn't been defined");
+ }, _getSourceCountAsync: function _getSourceCountAsync() {
+ throw new Error("_getSourceCountAsync hasn't been defined");
+ }, _updateGroups: function _updateGroups() {
+ return this._copyFromSourceIfNeededAndEdit().then(function updateGroups() {
+ var item;
+ var absoluteIndex = 0;
+ this._startNotificationBatch(MSE.Data.VirtualListBase.changeType.source);
+ while (absoluteIndex < this._data.length) {
+ item = this._item(absoluteIndex);
+ if (item && !item.isHeader) {
+ MS.Entertainment.Data.ListGrouperBase.clearGroup(item);
+ item = this._updateCacheData(absoluteIndex, item);
+ absoluteIndex = item.itemIndex
+ }
+ absoluteIndex++
+ }
+ this._endNotificationBatch()
+ }.bind(this))
+ }, _prefetchWorker: function _prefetchWorker(chunkDirections, result) {
+ var returnPromise;
+ var countCurrent = this.count;
+ var loadFunction = this._preChunkStep(chunkDirections.pop());
+ if (loadFunction)
+ returnPromise = loadFunction().then(function handleLoadSuccess() {
+ if (this._isChunkingNext())
+ result.chunkedAfter = this.count - countCurrent;
+ else
+ result.chunkedBefore = this.count - countCurrent;
+ this._postChunkStep();
+ return this._prefetchWorker(chunkDirections, result)
+ }.bind(this), function handleLoadFailures() {
+ this._postChunkStep();
+ return result
+ }.bind(this));
+ else {
+ this._postChunkStep();
+ returnPromise = WinJS.Promise.wrap(result)
+ }
+ return returnPromise
+ }, _prefetchData: function _prefetchData(minStartIndex, minEndIndex, maxStartIndex, maxEndIndex) {
+ var chunkDirections;
+ var returnPromise;
+ var block = false;
+ var result = {
+ chunkedAfter: 0, chunkedBefore: 0
+ };
+ if (this.chunkingEnabled) {
+ if (this.hasNextChunk) {
+ var count = Math.max(this.sourceCount, this.loadedCount);
+ if (minEndIndex + 1 >= count) {
+ block = true;
+ chunkDirections = [MSE.Data.chunkingType.next]
+ }
+ else if (maxEndIndex + 1 >= count)
+ chunkDirections = [MSE.Data.chunkingType.next]
+ }
+ if (this.hasPreviousChunk)
+ if (minStartIndex < 0) {
+ block = true;
+ chunkDirections = chunkDirections || [];
+ chunkDirections.push(MSE.Data.chunkingType.previous)
+ }
+ else if (maxStartIndex <= 0) {
+ chunkDirections = chunkDirections || [];
+ chunkDirections.push(MSE.Data.chunkingType.previous)
+ }
+ }
+ if (!chunkDirections)
+ returnPromise = WinJS.Promise.wrap(result);
+ else {
+ if (!this._chunkingWorkerPromise) {
+ this._chunkingWorkerPromise = this._prefetchWorker(chunkDirections, result);
+ this._chunkingWorkerPromise.done(function () {
+ this._chunkingWorkerPromise = null;
+ block = false
+ }.bind(this))
+ }
+ if (block)
+ returnPromise = this._chunkingWorkerPromise.then(function () {
+ return this._prefetchData(minStartIndex, minEndIndex, maxStartIndex, maxEndIndex)
+ }.bind(this));
+ else
+ returnPromise = WinJS.Promise.wrap(result)
+ }
+ return WinJS.Promise.as(returnPromise)
+ }, _isChunking: function _isChunking() {
+ return this._chunkingDirection === MSE.Data.chunkingType.next || this._chunkingDirection === MSE.Data.chunkingType.previous
+ }, _isChunkingNext: function _isChunkingNext() {
+ return this._chunkingDirection === MSE.Data.chunkingType.next
+ }, _isChunkingPrevious: function _isChunkingPrevious() {
+ return this._chunkingDirection === MSE.Data.chunkingType.previous
+ }, _isChunkingNothing: function _isChunkingNothing() {
+ return this._chunkingDirection === MSE.Data.chunkingType.nothing
+ }, _preChunkStep: function _preChunkStep(newChunkingDirection) {
+ var that = this;
+ this._chunkingDirection = newChunkingDirection || MSE.Data.chunkingType.nothing;
+ return (this._isChunkingNext()) ? function () {
+ return that._chunker.loadNextChunk()
+ } : (this._isChunkingPrevious()) ? function () {
+ return that._chunker.loadPreviousChunk()
+ } : (null)
+ }, _postChunkStep: function _postChunkStep() {
+ this._chunkingDirection = MSE.Data.chunkingType.nothing;
+ this._chunkingPreviousIndex = 0
+ }, _startNotificationBatch: function _startNotificationBatch(changeType) {
+ if (!this._notificationBatch)
+ this._notificationBatch = new MS.Entertainment.Data.UpdateBatch(this._createNotificationHandler());
+ this._notificationBatch.changeType = changeType;
+ this._notificationBatch.start();
+ return this._notificationBatch
+ }, _endNotificationBatch: function _endNotificationBatch() {
+ if (this._notificationBatch)
+ if (this._notificationBatch.end())
+ this._notificationBatch = null
+ }, _cancelNotificationBatch: function _cancelNotificationBatch() {
+ this._notificationBatch = null
+ }, _notifyBeginNotifications: function _notifyBeginNotifications() {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.beginNotifications)
+ this._notificationHandler.beginNotifications();
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.beginNotifications, { sender: this })
+ }, _notifyEndNotifications: function _notifyEndNotifications() {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.endNotifications)
+ this._notificationHandler.endNotifications();
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.endNotifications, { sender: this })
+ }, _notifyInvalidateList: function _notifyInvalidateList() {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.invalidateAll)
+ this._notificationHandler.invalidateAll()
+ }, _notifyReload: function _notifyReload() {
+ if (!this.preventNotifications && this._notificationHandler)
+ if (this._notificationHandler.reload)
+ this._notificationHandler.reload();
+ else if (this._notificationHandler.invalidateAll)
+ this._notificationHandler.invalidateAll()
+ }, _notifyInsertedItem: function _notifyInsertedItem(item, index, changeType) {
+ this._notifyInsertedItemWithKeys(item, this._keyFromIndex(index - 1), this._keyFromIndex(index + 1), index, changeType)
+ }, _notifyInsertedItemWithKeys: function _notifyInsertedItem(item, keyBefore, keyAfter, index, changeType) {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.inserted)
+ this._notificationHandler.inserted(item, keyBefore, keyAfter, index);
+ this._dispatchInsertedItem(item, index, changeType)
+ }, _dispatchInsertedItem: function _dispatchInsertedItem(item, index, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemInserted, {
+ sender: this, newValue: item, index: index, changeType: changeType
+ })
+ }, _notifyRangeInserted: function _notifyRangeInserted(startIndex, count, changeType) {
+ if (count > 0 && count + startIndex <= this.count && startIndex >= 0 && startIndex < this.count && !this.preventNotifications) {
+ var batch = this._startNotificationBatch(changeType);
+ var previousKey = this._keyFromIndex(startIndex - 1);
+ var nextKey = this._keyFromIndex(startIndex + count);
+ var i;
+ if (!nextKey && !previousKey) {
+ batch.inserted(this._item(startIndex), null, null, startIndex);
+ previousKey = this._keyFromIndex(startIndex);
+ startIndex + 1
+ }
+ if (nextKey)
+ for (i = 0; i < count; i++)
+ batch.inserted(this._item(i + startIndex), null, nextKey, startIndex);
+ else
+ for (i = count - 1; i >= 0; i--)
+ batch.inserted(this._item(i + startIndex), previousKey, null, startIndex);
+ this._endNotificationBatch()
+ }
+ }, _notifyRangeRemoved: function _notifyRangeRemoved(itemsRemoved, changeType) {
+ var removedItem;
+ var i;
+ if (itemsRemoved && itemsRemoved.length > 0) {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.beginNotifications && this._notificationHandler.removed && this._notificationHandler.endNotifications) {
+ this._notificationHandler.beginNotifications();
+ itemsRemoved.forEach(function notifyHandler(removedItem) {
+ this._notificationHandler.removed(removedItem.key, removedItem.itemIndex)
+ }, this);
+ this._notificationHandler.endNotifications()
+ }
+ itemsRemoved.forEach(function notifyListeners(removedItem) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemRemoved, {
+ sender: this, key: removedItem.key, index: removedItem.itemIndex, changeType: changeType
+ })
+ }, this)
+ }
+ }, _notifyChanged: function _notifyChanged(newValue, oldValue, changeType) {
+ if (newValue) {
+ var index = this._indexFromKey(newValue.key);
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.changed)
+ this._notificationHandler.changed(newValue, oldValue);
+ this._dispatchItemChanged(newValue, oldValue, index, changeType)
+ }
+ }, _dispatchItemChanged: function _dispatchItemChanged(newValue, oldValue, index, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemChanged, {
+ sender: this, newValue: newValue, oldValue: oldValue, index: index, changeType: changeType
+ })
+ }, _notifyMoved: function _notifyMoved(item, oldIndex, changeType) {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.moved) {
+ var newIndex = this._indexFromKey(item.key);
+ this._notificationHandler.moved(item, this._keyFromIndex(newIndex - 1), this._keyFromIndex(newIndex + 1), oldIndex, newIndex)
+ }
+ this._dispatchMoved(item, oldIndex, changeType)
+ }, _dispatchMoved: function _dispatchMoved(item, oldIndex, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemMoved, {
+ sender: this, value: item, oldIndex: oldIndex, newIndex: item.itemIndex, changeType: changeType
+ })
+ }, _notifyRemoved: function _notifyRemoved(key, index, changeType) {
+ if (key && !this.preventNotifications && this._notificationHandler && this._notificationHandler.removed)
+ this._notificationHandler.removed(key, index);
+ this._dispatchRemoved(key, index, changeType)
+ }, _dispatchRemoved: function _dispatchRemoved(key, index, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemRemoved, {
+ sender: this, key: key, index: index, changeType: changeType
+ })
+ }, _createNotificationHandler: function _createNotificationHandler() {
+ return {
+ changed: this._notifyChanged.bind(this), removed: this._notifyRemoved.bind(this), moved: this._notifyMoved.bind(this), inserted: this._notifyInsertedItemWithKeys.bind(this), beginNotifications: this._notifyBeginNotifications.bind(this), endNotifications: this._notifyEndNotifications.bind(this)
+ }
+ }, _nextInsertIndex: function _nextInsertIndex() {
+ return this._isChunkingPrevious() ? this._chunkingPreviousIndex++ : this._data.length
+ }, _undoInsertIndex: function _undoInsertIndex() {
+ if (this._isChunkingPrevious())
+ this._chunkingPreviousIndex--
+ }
+ }, {
+ changeType: {
+ source: "source", user: "user"
+ }
+ }), UpdateBatch: MS.Entertainment.UI.Framework.define(function updateBatch(notificationHandler) {
+ if (!notificationHandler || !notificationHandler.changed || !notificationHandler.moved || !notificationHandler.removed || !notificationHandler.inserted || !notificationHandler.endNotifications || !notificationHandler.beginNotifications)
+ throw new Error("Invalid notification handler given to the update batch class");
+ this._notificationHandler = notificationHandler;
+ this._batch = []
+ }, {
+ _changeType: null, _notificationHandler: null, _batch: null, _startCount: 0, _createBatchItem: function _createBatchItem(callback, args) {
+ this._batch.push({
+ callback: callback, arguments: args
+ })
+ }, changeType: {
+ get: function get_changeType() {
+ return this._changeType || MSE.Data.VirtualListBase.changeType.user
+ }, set: function set_changeType(value) {
+ this._changeType = value
+ }
+ }, _appendChangeType: function _appendChangeType(args) {
+ var newArgs = [];
+ if (args)
+ for (var i = 0; i < args.length; i++)
+ newArgs.push(args[i]);
+ newArgs.push(this.changeType);
+ return newArgs
+ }, changed: function changed(newItem, oldItem) {
+ this._createBatchItem(this._notificationHandler.changed, this._appendChangeType(arguments))
+ }, moved: function moved(item, oldIndex) {
+ this._createBatchItem(this._notificationHandler.moved, this._appendChangeType(arguments))
+ }, removed: function removed(key, index) {
+ this._createBatchItem(this._notificationHandler.removed, this._appendChangeType(arguments))
+ }, inserted: function inserted(item, keyBefore, keyAfter, index) {
+ this._createBatchItem(this._notificationHandler.inserted, this._appendChangeType(arguments))
+ }, start: function start() {
+ this._startCount++
+ }, end: function end() {
+ var executed = false;
+ this._startCount--;
+ MS.Entertainment.Data.assert(this._startCount >= 0, "UpdateBatch::end called too many times");
+ if (this._startCount === 0) {
+ this.execute();
+ executed = true
+ }
+ else if (this._startCount < 0)
+ this._startCount = 0;
+ return executed
+ }, execute: function execute() {
+ this._notificationHandler.beginNotifications();
+ this._batch.forEach(function (event) {
+ if (event && event.callback)
+ event.callback.apply(null, event.arguments)
+ });
+ this._notificationHandler.endNotifications();
+ this._batch = []
+ }
+ }), DatabaseListWrapper: MS.Entertainment.UI.Framework.define(function databaseListWrapper(list) {
+ this._source = list
+ }, {
+ _source: null, length: {
+ get: function () {
+ return this._source.dataItemsCount || 0
+ }
+ }, getItem: function (index) {
+ return this._source.getItem(index)
+ }
+ }), VectorViewWrapper: MS.Entertainment.UI.Framework.define(function vectorViewWrapper(list) {
+ this._source = list
+ }, {
+ _source: null, length: {
+ get: function () {
+ return this._source.length || this._source.size || 0
+ }
+ }, getItem: function (index) {
+ return this._source[index]
+ }
+ }, {
+ isVectorView: function isVectorView(object) {
+ return object && !MS.Entertainment.Data.VectorViewWrapper.isVectorViewWrapper(object) && !Array.isArray(object) && (typeof object === "object") && (typeof object.size === "number" || typeof object.length === "number")
+ }, isVectorViewWrapper: function isVectorViewWrapper(object) {
+ return MS.Entertainment.Data.VectorViewWrapper.prototype.isPrototypeOf(object)
+ }, getLength: function getLength(object) {
+ return object.size
+ }
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ VirtualList: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.VirtualListBase", function virtualListConstructor(itemFactory, source, chunker) {
+ MS.Entertainment.Data.VirtualListBase.prototype.constructor.call(this, itemFactory, chunker);
+ this.setSource(source).done(null, function () { })
+ }, {
+ _source: null, _sourceCount: 0, dispose: function dispose() {
+ MS.Entertainment.Data.VirtualListBase.prototype.dispose.call(this);
+ this._source = null
+ }, isEmptySource: function isEmptySource() {
+ return this._source === MSE.Data.VirtualList.emptySource
+ }, isSourceArray: function isSourceArray() {
+ return this._source ? Array.isArray(this._source) : false
+ }, isSourceVector: function isSourceVector() {
+ return this._source ? typeof this._source.getItem === "function" : false
+ }, isSourceList: function isSourceList() {
+ return this._source ? typeof this._source.itemsFromIndex === "function" : false
+ }, setSource: function setSource(source) {
+ if (MSE.Data.VectorViewWrapper.isVectorView(source))
+ source = new MSE.Data.VectorViewWrapper(source);
+ else if (source && !Array.isArray(source) && !MSE.Data.VirtualList.is(source) && !MSE.Data.VectorViewWrapper.isVectorViewWrapper(source))
+ throw new Error("Invalid operation. Attempting to convert an unsupported source type to a virtual list");
+ source = source || MSE.Data.VirtualList.emptySource;
+ if (this._source !== source)
+ return this._setSource(source);
+ else
+ return WinJS.Promise.wrap()
+ }, _clearOldSource: function _clearOldSource() {
+ this._keyMap = {};
+ this._data = [];
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ this._source = MSE.Data.VirtualList.emptySource;
+ this._sourceCount = 0;
+ this._selectionCountLocked = 0;
+ if (this._selectedItemsPromise) {
+ this._selectedItemsPromise.cancel();
+ this._selectedItemsPromise = null
+ }
+ }, _setSource: function _setSource(source) {
+ var returnPromise;
+ source = source || MSE.Data.VirtualList.emptySource;
+ this._clearOldSource();
+ this._source = source;
+ this._sourceCount = -1;
+ this.count = -1;
+ returnPromise = this._getSourceCountAsync().then(function gotCount(value) {
+ this._sourceCount = value;
+ if (this.randomAccessChunking)
+ this.count = this.chunkerCount;
+ else
+ this.count = value || 0;
+ if (!value)
+ this._source = MSE.Data.VirtualList.emptySource;
+ this._notifyInvalidateList()
+ }.bind(this));
+ return returnPromise
+ }, _clearSourceItems: function _clearSourceItems() {
+ this._source = MSE.Data.VirtualList.emptySource
+ }, _getSourceItemsAsync: function _getSourceItemsAsync(startIndex, lastIndex) {
+ var promise;
+ if (startIndex > lastIndex || startIndex < 0 || this.isEmptySource())
+ promise = this._getEmptySourceItems();
+ else if (this.isSourceArray())
+ promise = this._getArraySourceItems(this.source, startIndex, lastIndex);
+ else if (this.isSourceList())
+ promise = this._getVirtualListSourceItems(this.source, startIndex, lastIndex);
+ else if (this.isSourceVector())
+ promise = this._getVectorSourceItems(this.source, startIndex, lastIndex);
+ else
+ promise = WinJS.Promise.wrapError(new Error("Unknown source item type"));
+ return promise
+ }, _getSourceCountAsync: function _getSourceCountAsync() {
+ var promise;
+ if (this.isEmptySource())
+ promise = WinJS.Promise.wrapError(MSE.Data.List.CountResult.unknown);
+ else if (!this._source)
+ promise = WinJS.Promise.wrap(0);
+ else if (typeof this._source.length === "number")
+ promise = WinJS.Promise.wrap(this._source.length);
+ else if (typeof this._source.getCount === "function")
+ promise = this._source.getCount();
+ else
+ promise = WinJS.Promise.wrap(0);
+ return promise
+ }, _createSourceItemsResult: function _createSourceItemsResult(items, totalCount) {
+ if (isNaN(totalCount))
+ return { items: items };
+ else
+ return {
+ items: items, totalCount: totalCount
+ }
+ }, _getEmptySourceItems: function _getEmptySourceItems() {
+ return this._createSourceItemsResult([])
+ }, _getArraySourceItems: function _getArraySourceItems(source, startIndex, lastIndex) {
+ return WinJS.Promise.wrap(this._createSourceItemsResult(source.slice(startIndex, lastIndex + 1)))
+ }, _getVectorSourceItems: function _getVectorSourceItems(source, startIndex, lastIndex) {
+ var result = [];
+ for (var i = startIndex; i <= lastIndex; i++)
+ result.push(source.getItem(i));
+ return WinJS.Promise.wrap(this._createSourceItemsResult(result))
+ }, _getVirtualListSourceItems: function _getVirtualListSourceItems(source, startIndex, lastIndex) {
+ var count = Math.max(0, lastIndex - startIndex);
+ return source.itemsFromIndex(startIndex, 0, count).then(function handleResult(args) {
+ var result = [];
+ for (var i = args.offset; i < args.items.length; i++)
+ result.push(args.items[i].data);
+ return this._createSourceItemsResult(result)
+ }.bind(this))
+ }
+ }, {
+ emptySource: [], is: function isVirtualList(object) {
+ return MSE.Data.VirtualList.prototype.isPrototypeOf(object)
+ }, wrapArray: function wrapArray(array) {
+ var virtualList = new MS.Entertainment.Data.VirtualList;
+ return virtualList.setSource(array).then(function returnVirtualList() {
+ return virtualList
+ })
+ }, copy: function copy(list) {
+ var result = null;
+ if (MS.Entertainment.Data.List.isList(list))
+ result = list.toArrayAll().then(function gotArray(array) {
+ return new MS.Entertainment.Data.VirtualList(null, array)
+ });
+ else if (Array.isArray(list))
+ result = new MS.Entertainment.Data.VirtualList(null, list);
+ else if (list !== null && list !== undefined)
+ result = new MS.Entertainment.Data.VirtualList(null, [list]);
+ return WinJS.Promise.as(result)
+ }
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ SelectionList: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.VirtualList", function selectionListConstructor() {
+ MSE.Data.VirtualList.prototype.constructor.call(this);
+ this._preventCacheClearing()
+ }, {
+ _chunkerSource: null, _selection: null, _selectedItemsPromise: null, _selectedEverything: false, _selectionCountLocked: 0, _selectionLocked: false, copy: function copy() {
+ var list = new MS.Entertainment.Data.SelectionList;
+ list.setSource(this._chunkerSource, this._selection, this._selectedEverything);
+ list._lockSelection();
+ return list
+ }, isLocked: {
+ get: function get_isLocked() {
+ return !!this._selectedItemsPromise
+ }
+ }, chunkSize: {
+ get: function () {
+ return 100
+ }
+ }, originalSelectionIndices: {
+ get: function get_originalSelectionIndices() {
+ var result;
+ if (this._selection && this._selection.getIndices)
+ result = this._selection.getIndices();
+ return result || []
+ }
+ }, originalSelectionSourceIndices: {
+ get: function get_originalSelectionSourceIndices() {
+ var result = this.originalSelectionIndices;
+ if (this._chunkerSource && this._chunkerSource.indexToSourceIndex)
+ result = result.map(function (index) {
+ return this._chunkerSource.indexToSourceIndex(index)
+ }, this);
+ return result
+ }
+ }, _selectionCount: {
+ get: function () {
+ if (this._selectedEverything)
+ return this._chunkerSource ? this._chunkerSource.count - this._chunkerSource.nonSourceCount : 0;
+ else
+ return this._selection ? this._selection.count() : this._selectionCountLocked
+ }
+ }, _createChunker: function () {
+ return {
+ totalCount: this._selectionCount, loadChunk: this._loadChunkFromSource.bind(this)
+ }
+ }, setSource: function setSource(source, selection, selectedEverything) {
+ if (selection && !selection.count && !selection.getItems && !selection.getIndices)
+ throw new Error("Invalid selection type was passed to SelectionList");
+ var initialCount = selection ? selection.count() : 0;
+ if (initialCount > 1 && source && !source.forEachAll)
+ throw new Error("Invalid source type was passed to SelectionList. At the moment multi-selection only supports a VirtualList source");
+ this._clearOldSource();
+ this._selection = selection;
+ this._selectedEverything = selectedEverything;
+ this._chunkerSource = source;
+ this.chunker = this._createChunker();
+ return MSE.Data.VirtualList.prototype.setSource.call(this, null)
+ }, _lockSelection: function _lockSelection() {
+ if (!this._selectedEverything && !this._selectedItemsPromise) {
+ this._selectionCountLocked = this._selection ? this._selection.count() : 0;
+ this._selectedItemsPromise = (this._selection ? this._selection.getItems() : WinJS.Promise.wrap([])).then(null, function ignoreCancels(error) {
+ var result = [];
+ if (!WinJS.Promise.isCanceledError(error))
+ result = WinJS.Promise.wrapError(error);
+ return result
+ });
+ this._selection = null
+ }
+ }, _getSelectedItems: function _getSelectedItems() {
+ if (this._selection)
+ return this._selection.getItems();
+ else if (this._selectedItemsPromise)
+ return this._selectedItemsPromise;
+ else
+ return WinJS.Promise.wrap([])
+ }, _getEmptyChunk: function _getEmptyChunk() {
+ return this._createChunkResult(null, null, null, true)
+ }, _createChunkResult: function _createChunkResult(items, offset, count, error) {
+ return WinJS.Promise.wrap({
+ items: items || [], offset: offset || 0, error: !!error, totalCount: count || this._selectionCount
+ })
+ }, _loadChunkFromSource: function _loadChunkFromSource(index, countBefore, countAfter) {
+ countAfter = countAfter || 0;
+ countBefore = countBefore || 0;
+ var selectionCount = this._selectionCount;
+ if (index - countBefore < 0 || countBefore < 0 || countAfter < 0 || selectionCount === 0)
+ return this._getEmptyChunk();
+ else if (this._selectedEverything && selectionCount > 1)
+ return this._getChunkAllSelected(index, countBefore, countAfter);
+ else
+ return this._getChunkSomeSelected(index, countBefore, countAfter)
+ }, _getChunkAllSelected: function _getChunkAllSelected(index, countBefore, countAfter) {
+ var items = [];
+ var offset = countBefore;
+ var startIndex = this._chunkerSource.indexFromSourceIndex(index - countBefore);
+ var totalNeeded = countBefore + 1 + countAfter;
+ return this._chunkerSource.forEachAll(function iteration(args) {
+ if (!args.item.isNonSourceData)
+ items.push(args.item.data);
+ if (items.length >= totalNeeded)
+ args.stop = true
+ }.bind(this), startIndex).then(function gotItems() {
+ return this._createChunkResult(items, offset)
+ }.bind(this))
+ }, _getChunkSomeSelected: function _getChunkSomeSelected(index, countBefore, countAfter) {
+ var selectionCount = this._selectionCount;
+ var startIndex = index - countBefore;
+ var endIndex = index + countAfter;
+ return this._getSelectedItems().then(function (selectionItems) {
+ var items = [];
+ selectionItems = selectionItems || [];
+ for (var i = startIndex; i <= endIndex && i < selectionItems.length; i++)
+ items.push(selectionItems[i] ? selectionItems[i].data : null);
+ return this._createChunkResult(items, countBefore, selectionCount)
+ }.bind(this))
+ }
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ TrimmedList: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.VirtualList", function virtualListConstructor(itemFactory, source, chunker) {
+ MSE.Data.VirtualList.prototype.constructor.call(this, itemFactory, source, chunker)
+ }, {
+ _maxCount: -1, maxCount: {
+ get: function () {
+ return this._maxCount
+ }, set: function (value) {
+ if (this._maxCount !== value)
+ this._maxCount = value;
+ if (this._maxCount >= 0)
+ this.count = Math.min(this._maxCount, this.count)
+ }
+ }, count: {
+ get: function () {
+ return this.getProperty("count")
+ }, set: function (value) {
+ if (this.maxCount >= 0)
+ value = Math.min(this._maxCount, value);
+ this.setProperty("count", value)
+ }
+ }
+ })
+ })
+ })(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/query.js:20741 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+ (function (undefined) {
+ "use strict";
+ var MSE = WinJS.Namespace.define("MS.Entertainment", null);
+ var logJsonFailure = function logJsonFailure(message, error, json) {
+ MSE.Data.fail(["JSON parse failed. \n\t[message: ", (message), "] \n\t[error message: ", (error && error.message), "] \n\t[json string length: ", (json ? json.length : "
"), "] \n\t[json string: \'", (json), "\']"].join(String.empty))
+ };
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ queryStatus: {
+ idle: 0, requestingData: 1, processingData: 2, augmentingData: 3, completed: 4, failed: 5, max: 5, isWorking: function isWorking(status) {
+ return status === MSE.Data.queryStatus.requestingData || status === MSE.Data.queryStatus.processingData || status === MSE.Data.queryStatus.augmentingData
+ }, hasCompleted: function isWorking(status) {
+ return status === MSE.Data.queryStatus.completed
+ }, hasFailed: function isWorking(status) {
+ return status === MSE.Data.queryStatus.failed
+ }, hasCompletedOrFailed: function isWorking(status) {
+ return status === MSE.Data.queryStatus.completed || status === MSE.Data.queryStatus.failed
+ }
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Query.edsMediaType", {
+ album: "Album", musicArtist: "MusicArtist", musicVideo: "MusicVideo", musicPlaylist: "MusicPlaylist", track: "Track"
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Query.edsIdType", {
+ amg: "AMG", canonical: "Canonical", mediaNet: "MediaNet", offer: "Offer", providerContentId: "ProviderContentId", xboxHexTitle: "XboxHexTitle", zuneCatalog: "ZuneCatalog", zuneMediaInstance: "ZuneMediaInstance"
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ observableQueryMixin: {
+ enabled: false, status: MSE.Data.queryStatus.idle, cookie: null, errorCode: 0, errorObject: null, result: null, totalCount: -1
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ ObservableQuery: WinJS.Class.mix(function observableQuery() {
+ this._initObservable(Object.create(MS.Entertainment.Data.observableQueryMixin))
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin, WinJS.Binding.expandProperties(MS.Entertainment.Data.observableQueryMixin))
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ Disposer: MS.Entertainment.UI.Framework.define(null, {
+ dispose: function dispose() {
+ var keys = Object.getOwnPropertyNames(this);
+ for (var key in keys)
+ this.disposeOnly(key)
+ }, disposeOnly: function disposeOnly(key) {
+ var object = this[key];
+ if (object && object.dispose)
+ object.dispose();
+ if (key !== "dispose" && key !== "disposeOnly")
+ delete this[key]
+ }
+ }), MainQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ObservableQuery", function mainQueryConstructor() {
+ MSE.Data.ObservableQuery.prototype.constructor.call(this);
+ this.status = MSE.Data.queryStatus.idle;
+ this.autoUpdateProperties = this.autoUpdateProperties || {};
+ this.autoUpdateProperties.enabled = true
+ }, {
+ _generation: 0, _referenceCount: 0, resultFactory: null, provider: null, autoUpdateProperties: null, debugInstanceId: null, listDestinationHint: null, generation: {
+ get: function () {
+ return this._generation
+ }
+ }, addReference: function addReference() {
+ this._logQueryActions("AddRef");
+ this._referenceCount++
+ }, release: function release() {
+ this._logQueryActions("Release");
+ if (this._referenceCount > 0)
+ this._referenceCount--;
+ else
+ MS.Entertainment.Platform.Playback.Etw.traceString("MainQuery::release() Reference count is already at zero.")
+ }, dispose: function dispose() {
+ this._logQueryActions("Dispose");
+ if (this._referenceCount > 0)
+ MS.Entertainment.Platform.Playback.Etw.traceString("MainQuery::dispose() Reference count is not zero. Could be disposing a query that is still being consumed by another component. Or query may not have been correctly released.")
+ }, createResultObject: function createResultObject() {
+ return this.resultFactory(null, this)
+ }, createPendingResultObject: function createPendingResultObject(resultOverride) {
+ this._generation++;
+ var result = {
+ generation: this._generation, result: ((resultOverride) || this.createResultObject())
+ };
+ return result
+ }, execute: function execute(cookie) {
+ return WinJS.Promise.wrapError(this)
+ }, refresh: function refresh() {
+ var promise;
+ if (this.enabled)
+ promise = this.execute();
+ else
+ promise = WinJS.Promise.wrap(this);
+ return promise
+ }, getItems: function getItems() {
+ return this.execute().then(function executeCompleted() {
+ return this._getList()
+ }.bind(this))
+ }, getItemsAndIgnoreErrors: function getItemsAndIgnoreErrors() {
+ return this.getItems().then(function handleResult(result) {
+ return result
+ }, function handleError(error) {
+ MS.Entertainment.Data.fail("getItems failed. error.message = " + error && error.message);
+ return null
+ })
+ }, getItemsArrayAndIgnoreErrors: function getItemsArrayAndIgnoreErrors() {
+ return this.getItemsAndIgnoreErrors().then(function handleResult(result) {
+ return result ? result.toArrayAll() : []
+ }, function handleError(error) {
+ MS.Entertainment.Data.fail("getItemsAndIgnoreErrors failed. error.message = " + error && error.message);
+ return []
+ }).then(function handleResult(result) {
+ return result
+ }, function handleError(error) {
+ MS.Entertainment.Data.fail("toArrayAll failed. error.message = " + error && error.message);
+ return []
+ })
+ }, createGroupsQuery: function createGroupsQuery() {
+ return null
+ }, restore: function restore(cookie) {
+ return this.execute(cookie)
+ }, loadPreviousChunk: function loadPreviousChunk() {
+ return WinJS.Promise.wrap(this)
+ }, loadNextChunk: function loadNextChunk() {
+ return WinJS.Promise.wrap(this)
+ }, notify: function notify(propertyName, newValue, oldValue) {
+ if (!this.isDisposed && this.autoUpdateProperties && newValue !== oldValue && this.autoUpdateProperties[propertyName])
+ this.refresh().done(null, function error() { });
+ MSE.Data.ObservableQuery.prototype.notify.apply(this, arguments)
+ }, clone: function clone() {
+ var prototype = Object.getPrototypeOf(this);
+ var QueryConstructor = (prototype.constructor);
+ var newQuery = new QueryConstructor;
+ var addToPropertyValues = function addToPropertyValues(key) {
+ if (key !== "isLive")
+ newQuery[key] = this[key]
+ }.bind(this);
+ while (prototype && prototype.constructor !== MS.Entertainment.Data.observableQueryMixin) {
+ Object.keys(prototype).forEach(addToPropertyValues);
+ prototype = Object.getPrototypeOf(prototype)
+ }
+ return newQuery
+ }, _getList: function _getList(resultOverride) {
+ var result = resultOverride || this.result;
+ var list = null;
+ if (this.listDestinationHint)
+ list = this._getListWorker(MS.Entertainment.Utilities.valueFromPropertyPath(result, this.listDestinationHint), 0, this.listDestinationHint);
+ if (!list)
+ list = this._getListWorker(result);
+ return list
+ }, _getListWorker: function _getListWorker(currentValue, depth, currentPath) {
+ var updatedPath,
+ key,
+ updatedValue;
+ var list = null;
+ depth = depth || 0;
+ currentPath = currentPath || String.empty;
+ currentValue = WinJS.Binding.unwrap(currentValue);
+ if (this._isListType(currentValue)) {
+ this.listDestinationHint = currentPath;
+ list = currentValue
+ }
+ else if (currentValue && typeof currentValue === "object" && !Array.isArray(currentValue) && depth < MSE.Data.MainQuery.maxListDepth)
+ for (key in currentValue)
+ if (key && key[0] !== "_")
+ try {
+ updatedValue = currentValue[key];
+ updatedPath = currentPath ? currentPath + "." + key : key;
+ list = this._getListWorker(updatedValue, depth + 1, updatedPath);
+ if (list)
+ break
+ }
+ catch (exception) { }
+ return list
+ }, _isListType: function _isListType(value) {
+ return MSE.Data.List.is(value)
+ }, _setResult: function _setResult(result, totalCount, error) {
+ this.result = result;
+ this.totalCount = totalCount;
+ this.dispatchEvent(MS.Entertainment.Data.MainQuery.events.resultChanged, {
+ sender: this, result: result, totalCount: totalCount, error: error
+ })
+ }, _handleEnabled: function _handleEnabled() {
+ this.refresh()
+ }, _logQueryActions: function _logActions(action) {
+ if (this.debugInstanceId && action && MSE.Platform && MSE.Platform.Playback && MSE.Platform.Playback.Etw) {
+ var queryType = "isLive" in this ? " LibraryWrapperQuery" : " PlaybackQuery";
+ var traceString = "MainQuery:: " + action.toUpperCase() + queryType + " id=" + this.debugInstanceId;
+ MSE.Platform.Playback.Etw.traceString(traceString)
+ }
+ }
+ }, {
+ maxListDepth: 3, events: { resultChanged: "resultChanged" }, isQuery: function MainQuery_isQuery(object) {
+ return MS.Entertainment.Data.MainQuery.prototype.isPrototypeOf(object)
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ RandomAccessChunk: MS.Entertainment.UI.Framework.define(function randomAccessChunk(startIndex, count) {
+ this.startIndex = startIndex;
+ this.count = count
+ }, {
+ startIndex: 0, count: 0
+ }, {
+ is: function randomAccessChunk_is(object) {
+ return MS.Entertainment.Data.RandomAccessChunk.prototype.isPrototypeOf(object)
+ }
+ }), AugmentQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.MainQuery", function () {
+ MSE.Data.MainQuery.prototype.constructor.call(this)
+ }, {
+ _originalChunkDestination: null, _chunkDestination: null, _nextChunk: null, _previousChunk: null, _resultShape: null, _disposed: false, lastChunkedResult: null, resultFactory: MSE.Data.Factory.self, resultAugmentation: null, allowGroupHints: false, hasTotalCount: false, aggregateChunks: false, chunked: true, chunkSize: 100, currentChunk: null, clearResultOnFailure: false, dispose: function dispose() {
+ MSE.Data.MainQuery.prototype.dispose.call(this);
+ this.createPendingResultObject();
+ if (this._originalChunkDestination && this._originalChunkDestination.dispose)
+ this._originalChunkDestination.dispose();
+ this._clearChunkDestination();
+ this._clearListQueryHinter();
+ this._disposed = true
+ }, isDisposed: {
+ get: function () {
+ return this._disposed
+ }
+ }, nextChunk: {
+ get: function () {
+ return this._nextChunk
+ }, set: function (value) {
+ this._nextChunk = value
+ }
+ }, previousChunk: {
+ get: function () {
+ return this._previousChunk
+ }, set: function (value) {
+ this._previousChunk = value
+ }
+ }, hasNextChunk: {
+ get: function () {
+ return (this.nextChunk !== null && this.nextChunk !== undefined && this.nextChunk !== MSE.Data.AugmentQuery.invalidNextChunk)
+ }
+ }, hasPreviousChunk: {
+ get: function () {
+ return (this.previousChunk !== null && this.previousChunk !== undefined && this.previousChunk !== MSE.Data.AugmentQuery.invalidPreviousChunk)
+ }
+ }, isLoadingFromStart: {
+ get: function () {
+ return this.currentChunk === null || this.currentChunk === undefined
+ }
+ }, chunkDestinationHint: {
+ get: function () {
+ return this.listDestinationHint
+ }, set: function (value) {
+ this.listDestinationHint = value
+ }
+ }, chunkDestination: {
+ get: function get_chunkDesination() {
+ return this._chunkDestination
+ }, set: function set_chunkDesination(value) {
+ if (this._disposed)
+ return;
+ this._chunkDestination = value
+ }
+ }, execute: function execute(cookie) {
+ this.currentChunk = (cookie === null || cookie === undefined) ? null : cookie;
+ return this._execute()
+ }, loadPreviousChunk: function loadPreviousChunk() {
+ if (this.previousChunk !== null && this.previousChunk !== undefined && this.previousChunk !== MSE.Data.AugmentQuery.invalidPreviousChunk) {
+ this.currentChunk = this.previousChunk;
+ return this._execute()
+ }
+ else
+ return WinJS.Promise.wrap(this)
+ }, loadNextChunk: function loadNextChunk() {
+ if (this.nextChunk !== null && this.nextChunk !== undefined && this.nextChunk !== MSE.Data.AugmentQuery.invalidNextChunk) {
+ this.currentChunk = this.nextChunk;
+ return this._execute()
+ }
+ else
+ return WinJS.Promise.wrap(this)
+ }, isValidChunk: function isValidChunk(chunk) {
+ return chunk !== null && chunk !== undefined && chunk !== MSE.Data.AugmentQuery.invalidNextChunk && chunk !== MSE.Data.AugmentQuery.invalidPreviousChunk
+ }, _isListType: function _isListType(value) {
+ return MSE.Data.VirtualList.is(value)
+ }, _getChunkDestination: function _getChunkDestination(resultOverride) {
+ return this._getList(resultOverride)
+ }, _setChunkDestination: function _setChunkDestination() {
+ if (this.aggregateChunks) {
+ this._chunkDestination = this._originalChunkDestination = this._getChunkDestination();
+ if (this._originalChunkDestination)
+ this._originalChunkDestination.chunker = this
+ }
+ else
+ this._clearChunkDestination()
+ }, _clearChunkDestination: function _clearChunkDestination() {
+ if (this._originalChunkDestination) {
+ if (WinJS.Binding.unwrap(this._originalChunkDestination.chunker) === this)
+ this._originalChunkDestination.chunker = null;
+ this._originalChunkDestination = null;
+ this._chunkDestination = null
+ }
+ }, _setListQueryHinter: function _setListQueryHinter() {
+ var groupHintsQuery;
+ this._clearListQueryHinter();
+ if (this.allowGroupHints) {
+ groupHintsQuery = this.createGroupsQuery();
+ this._queryHinterDestination = this._getList()
+ }
+ if (this._queryHinterDestination && groupHintsQuery)
+ this._queryHinterDestination.groupHinter = groupHintsQuery
+ }, _clearListQueryHinter: function _clearListQueryHints() {
+ if (this._queryHinterDestination) {
+ if (WinJS.Binding.unwrap(this._queryHinterDestination.groupHinter) === this)
+ this._queryHinterDestination.groupHinter = null;
+ this._queryHinterDestination = null
+ }
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ return result
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ return result
+ }, _parseTotalCount: function _parseTotalCount(result) {
+ return (!this.hasTotalCount || !result || isNaN(result.totalCount)) ? -1 : result.totalCount
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ return this.resultAugmentation
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ return MSE.Data.AugmentQuery.invalidNextChunk
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ return MSE.Data.AugmentQuery.invalidPreviousChunk
+ }, _startExecute: function _startExecute() { }, _preInnerExecute: function _preInnerExecute() {
+ return WinJS.Promise.wrap()
+ }, _startInnerExecute: function _startInnerExecute() {
+ return WinJS.Promise.wrapError()
+ }, _retryInnerExecute: function _retryInnerExecute(result, error) {
+ return false
+ }, _endInnerExecute: function _endInnerExecute(result) { }, _preInsertChunk: function _preInsertChunk(destination, chunk) { }, _execute: function _execute(chunkDestinationOverride) {
+ var innerPromise;
+ var that = this;
+ var pendingResult = this.createPendingResultObject();
+ var loadingFromStart = this.isLoadingFromStart;
+ var chunkingNext = this.nextChunk !== null && this.nextChunk !== undefined && this.currentChunk === this.nextChunk;
+ var chunkingPrevious = this.previousChunk !== null && this.previousChunk !== undefined && this.currentChunk === this.previousChunk;
+ var chunkingRandom = !loadingFromStart && MS.Entertainment.Data.RandomAccessChunk.is(this.currentChunk);
+ var aggregateChunking = this.aggregateChunks && (chunkingNext || chunkingPrevious || chunkingRandom);
+ var progressCallback;
+ function cleanUp() {
+ innerPromise = null;
+ pendingResult = null
+ }
+ { };
+ function cancelInnerPromiseNoError() {
+ if (innerPromise) {
+ if (pendingResult)
+ pendingResult.generation = -1;
+ try {
+ innerPromise.cancel()
+ }
+ catch (exception) { }
+ }
+ cleanUp()
+ }
+ { };
+ function cancelInnerPromise(cancelReason) {
+ cancelInnerPromiseNoError();
+ cancelReason = cancelReason || "unknown";
+ cancelReason = "Query was canceled. Cancel reason: " + cancelReason + ".";
+ return WinJS.Promise.wrapError(that._createError({
+ name: "Canceled", description: cancelReason, message: cancelReason
+ }))
+ }
+ { };
+ function updateStatus(status) {
+ that.status = status;
+ progressCallback(that)
+ }
+ { };
+ function updateError(error) {
+ that.errorObject = that._createError(error);
+ that.errorCode = that.errorObject.number
+ }
+ { };
+ function clearErrorCode() {
+ that.errorCode = 0;
+ that.errorObject = null
+ }
+ { };
+ function handleInnerPromiseEvent(result, callback, preventFailure) {
+ if (pendingResult && pendingResult.generation === that.generation)
+ return callback(result);
+ else if (!preventFailure && !pendingResult)
+ return cancelInnerPromise("the cancel was invoked on the execute promise");
+ else if (!preventFailure && pendingResult.generation >= 0)
+ return cancelInnerPromise("the query.execute was invoked after this execution, " + (that.generation - pendingResult.generation) + " time(s)")
+ }
+ { };
+ function parseInnerResult(result) {
+ updateStatus(MSE.Data.queryStatus.augmentingData);
+ result = that._parseInnerResult(result);
+ return MSE.Data.augment(result, that._getResultAugmentation())
+ }
+ { };
+ function handleInnerCompleted(result) {
+ pendingResult.result = result;
+ that._setResult(pendingResult.result, that._parseTotalCount(pendingResult.result));
+ that._setChunkDestination();
+ that._setListQueryHinter();
+ return WinJS.Promise.wrap()
+ }
+ { };
+ function handleInnerCompletedChunked(result) {
+ pendingResult.result = result;
+ that.totalCount = that._parseTotalCount(pendingResult.result);
+ if (chunkingRandom)
+ return that._insertChunkAt(that.currentChunk.startIndex, that._getChunkDestination(result), chunkDestinationOverride);
+ else
+ return that._insertChunk(chunkingNext, that._getChunkDestination(result), chunkDestinationOverride)
+ }
+ { };
+ function handleInnerFailure(result) {
+ updateStatus(MSE.Data.queryStatus.failed);
+ updateError(result);
+ var newResult = that.clearResultOnFailure ? null : that.result;
+ that._setResult(newResult, that._parseTotalCount(newResult), result);
+ return WinJS.Promise.wrapError(result)
+ }
+ { };
+ function handleInnerProgress(result) {
+ updateStatus(that._parseInnerProgress(result))
+ }
+ { };
+ function executeCompleted() {
+ if (!that.chunked || !that.chunkSize)
+ that._nextChunk = null;
+ else if (chunkingNext || loadingFromStart || chunkingRandom || that._nextChunk === null || that._nextChunk === undefined)
+ that._nextChunk = that._calculateNextChunkKey(pendingResult.result);
+ if (that._nextChunk === null || that._nextChunk === undefined)
+ that._nextChunk = MSE.Data.AugmentQuery.invalidNextChunk;
+ if (!that.chunked || !that.chunkSize)
+ that._previousChunk = null;
+ else if (chunkingPrevious || loadingFromStart || chunkingRandom || that._previousChunk === null || that._previousChunk === undefined)
+ that._previousChunk = that._calculatePreviousChunkKey(pendingResult.result);
+ if (that._previousChunk === null || that._previousChunk === undefined)
+ that._previousChunk = MSE.Data.AugmentQuery.invalidPreviousChunk;
+ if (chunkingPrevious || chunkingNext || chunkingRandom)
+ that.lastChunkedResult = pendingResult.result;
+ that._endInnerExecute(pendingResult.result);
+ updateStatus(MSE.Data.queryStatus.completed)
+ }
+ { };
+ function wrapPromiseHandler(callback, preventFailure) {
+ return function (result) {
+ return handleInnerPromiseEvent(result, callback, preventFailure)
+ }
+ }
+ { };
+ function handlePromiseFailure(error) {
+ return WinJS.Promise.wrapError(error)
+ }
+ { };
+ function testRetry(result, error) {
+ var promise;
+ if (result)
+ result = parseInnerResult(result);
+ if (that._retryInnerExecute(result, error))
+ promise = startInnerExecute();
+ else {
+ var promise = !!error ? wrapPromiseHandler(handleInnerFailure)(error) : wrapPromiseHandler(aggregateChunking ? handleInnerCompletedChunked : handleInnerCompleted)(result);
+ promise = WinJS.Promise.as(promise).then(wrapPromiseHandler(executeCompleted), handlePromiseFailure)
+ }
+ return promise
+ }
+ { };
+ function testRetryOnSuccess(result) {
+ return testRetry(result)
+ }
+ { };
+ function testRetryOnError(error) {
+ return testRetry(null, error)
+ }
+ { };
+ function createInnerPromise(completed, failed, progress) {
+ progressCallback = progressCallback || progress;
+ clearErrorCode();
+ updateStatus(MSE.Data.queryStatus.requestingData);
+ innerPromise = that._startInnerExecute().then(wrapPromiseHandler(testRetryOnSuccess), wrapPromiseHandler(testRetryOnError), wrapPromiseHandler(handleInnerProgress, true)).then(function innerPromiseCompleted() {
+ completed(that);
+ cleanUp()
+ }, function innerPromiseFailed(error) {
+ failed(that._createError(error));
+ cleanUp()
+ })
+ }
+ this._startExecute();
+ function startInnerExecute() {
+ if (!aggregateChunking)
+ that._clearChunkDestination();
+ return WinJS.Promise.as(that._preInnerExecute()).then(function () {
+ return new WinJS.Promise(createInnerPromise, cancelInnerPromiseNoError)
+ })
+ }
+ return startInnerExecute()
+ }, _createError: function _createError(error, description) {
+ var newError = new Error(description);
+ if (error)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperties(newError, error);
+ newError.errorCode = newError.number;
+ newError.originalError = error;
+ newError.details = { query: this };
+ return newError
+ }, _insertChunkAt: function (startIndex, list, chunkDestinationOverride) {
+ var promise;
+ var destination = chunkDestinationOverride || this.chunkDestination;
+ if (!destination)
+ promise = WinJS.Promise.wrapError(new Error("no destination was found when inserting chunk at index"));
+ else if (list && destination.insertRangeAt) {
+ this._preInsertChunk(destination, list);
+ promise = destination.insertRangeAt(startIndex, list.source, {
+ suppressEvents: true, isSourceData: true
+ })
+ }
+ else
+ promise = WinJS.Promise.wrap()
+ }, _insertChunk: function (nextChunk, list, chunkDestinationOverride) {
+ var promise;
+ var destination = chunkDestinationOverride || this.chunkDestination;
+ if (!destination)
+ promise = WinJS.Promise.wrapError(new Error("no destination was found when inserting chunk"));
+ else if (list && destination.insertRangeAtEnd && destination.insertRangeAtStart) {
+ this._preInsertChunk(destination, list);
+ if (nextChunk)
+ promise = destination.insertRangeAtEnd(list.source, {
+ suppressEvents: true, isSourceData: true
+ });
+ else
+ promise = destination.insertRangeAtStart(list.source, {
+ suppressEvents: true, isSourceData: true
+ })
+ }
+ else
+ promise = WinJS.Promise.wrap();
+ return promise
+ }, _getChunkResultSize: function _getChunkResultSize(result) {
+ var resultSize = 0;
+ var listResult;
+ if (result && !isNaN(result.count))
+ resultSize = result.count;
+ else
+ listResult = this._getChunkDestination(result);
+ if (listResult)
+ if (listResult.hasCount)
+ resultSize = listResult.count;
+ else if (listResult.source)
+ resultSize - listResult.source.length;
+ return resultSize || 0
+ }
+ }, {
+ invalidNextChunk: {}, invalidPreviousChunk: {}, _findAugmentation: function _findAugmentation(augmentation, testCallback) {
+ var propertyName;
+ var propertyAugmentation;
+ var itemAugmentationOrFactory;
+ var key;
+ var augmentationShape = MS.Entertainment.Data.augmentationShape(augmentation);
+ if (augmentationShape)
+ for (key in augmentationShape) {
+ propertyAugmentation = augmentationShape[key];
+ if (testCallback(key, propertyAugmentation)) {
+ propertyName = key;
+ break
+ }
+ propertyAugmentation = null
+ }
+ if (propertyAugmentation && propertyAugmentation.augmentationOptions && propertyAugmentation.augmentationOptions.itemAugmentationOrFactory)
+ itemAugmentationOrFactory = propertyAugmentation.augmentationOptions.itemAugmentationOrFactory;
+ return {
+ key: propertyName, augmentation: propertyAugmentation, itemAugmentationOrFactory: itemAugmentationOrFactory
+ }
+ }, findAugmentation: function findAugmentation(augmentation, key) {
+ return MS.Entertainment.Data.AugmentQuery._findAugmentation(augmentation, function isList(testKey, testAugmentation) {
+ return testKey === key
+ })
+ }, findListAugmentation: function findListAugmentation(augmentation) {
+ return MS.Entertainment.Data.AugmentQuery._findAugmentation(augmentation, function isList(testKey, testAugmentation) {
+ return MS.Entertainment.Data.Property.isList(testAugmentation)
+ })
+ }, modifyResultAugmentation: function modifyResultAugmentation(augmentation, key, definition) {
+ var result = augmentation;
+ var itemAugmentation;
+ var rootDefinition;
+ var property = MS.Entertainment.Data.AugmentQuery.findAugmentation(augmentation, key);
+ if (property.key && property.augmentation) {
+ rootDefinition = {};
+ itemAugmentation = property.augmentation.augmentationOptions ? property.augmentation.augmentationOptions.augmentation : null;
+ itemAugmentation = MS.Entertainment.Data.Factory.createDerivedAugmentationOrFactory(itemAugmentation, definition);
+ rootDefinition[property.key] = MS.Entertainment.Data.Property.createAugmentation(property.augmentation, { augmentation: itemAugmentation })
+ }
+ if (augmentation && rootDefinition)
+ result = MS.Entertainment.Data.derive(augmentation, null, rootDefinition);
+ return result
+ }, modifyListResultAugmentation: function modifyListResultAugmentation(augmentation, definition) {
+ var result = augmentation;
+ var listPropertyAugmentation;
+ var listItemAugmentation;
+ var rootDefinition;
+ var listProperty = MS.Entertainment.Data.AugmentQuery.findListAugmentation(augmentation);
+ if (listProperty.key && listProperty.augmentation) {
+ rootDefinition = {};
+ listItemAugmentation = MS.Entertainment.Data.Factory.createDerivedAugmentationOrFactory(listProperty.itemAugmentationOrFactory, definition);
+ rootDefinition[listProperty.key] = MS.Entertainment.Data.Property.createAugmentation(listProperty.augmentation, { itemAugmentationOrFactory: listItemAugmentation })
+ }
+ if (augmentation && rootDefinition)
+ result = MS.Entertainment.Data.derive(augmentation, null, rootDefinition);
+ return result
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ AggregateQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function aggregateQuery() {
+ MSE.Data.AugmentQuery.prototype.constructor.call(this);
+ this.queries = []
+ }, {
+ queries: null, executeSequentially: false, resultAugmentationFactory: null, _handleIntermediateResult: function _handleIntermediateResult(sourceIndex, sourceResult) { }, _startNonSequentialExecution: function _startSequentialExecution() {
+ var executePromises = [];
+ var index = 0;
+ var queryChunk = null;
+ this.queries.forEach(function executeQuery(query) {
+ queryChunk = this._getQueryChunk(index);
+ if (query && queryChunk !== undefined) {
+ query.aggregateChunks = this.chunked ? false : query.aggregateChunks;
+ executePromises.push(query.execute(queryChunk))
+ }
+ else
+ executePromises.push(WinJS.Promise.as({}));
+ index++
+ }, this);
+ return WinJS.Promise.join(executePromises)
+ }, _startSequentialExecution: function _startSequentialExecution() {
+ var results = [];
+ return new WinJS.Promise(function initializePromise(completeCallback, errorCallback) {
+ this._continueSequentialExecution(0, results, completeCallback, errorCallback)
+ }.bind(this))
+ }, _continueSequentialExecution: function _continueSequentialExecution(index, results, completeCallback, errorCallback) {
+ if (index >= this.queries.length) {
+ completeCallback(results);
+ return
+ }
+ var query = this.queries[index];
+ var queryChunk = this._getQueryChunk(index);
+ var queryExecutePromise;
+ if (query && queryChunk !== undefined) {
+ query.aggregateChunks = this.chunked ? false : query.aggregateChunks;
+ queryExecutePromise = query.execute(queryChunk)
+ }
+ else
+ queryExecutePromise = WinJS.Promise.as({});
+ queryExecutePromise.then(function queryFinished(result) {
+ results[index] = result;
+ this._handleIntermediateResult(index, result.result);
+ this._continueSequentialExecution(index + 1, results, completeCallback, errorCallback)
+ }.bind(this), function queryFailed(error) {
+ errorCallback(error)
+ }.bind(this))
+ }, _getQueryChunk: function _getQueryChunk(index) {
+ var executeChunk;
+ if (this.isLoadingFromStart || !this.chunked)
+ executeChunk = null;
+ else if (this.isValidChunk(this.currentChunk[index]))
+ executeChunk = this.currentChunk[index];
+ return executeChunk
+ }, _startInnerExecute: function _startInnerExecute() {
+ var innerPromise;
+ var lowestProgressValue = MSE.Data.queryStatus.max;
+ var loadingFromStart = this.isLoadingFromStart;
+ if (!this.resultAugmentation && this.resultAugmentationFactory && this.resultAugmentationFactory.create)
+ this.resultAugmentation = this.resultAugmentationFactory.create();
+ var returnedProgress;
+ function handleCompleted(result) {
+ returnedProgress(MSE.Data.queryStatus.processingData);
+ var wrapped = new MS.Entertainment.Data.Property.MergedItem;
+ result.forEach(function appendItem(item) {
+ wrapped.source.push(WinJS.Binding.unwrap(item ? item.result : {}))
+ }, this);
+ return wrapped
+ }
+ { };
+ function handleError(error) {
+ var result = error;
+ if (Array.isArray(error))
+ for (var i = 0; i < error.length; i++)
+ if (error[i] && error[i].errorObject) {
+ error = error[i].errorObject;
+ break
+ }
+ return WinJS.Promise.wrapError(error || {})
+ }
+ { };
+ function initializePromise(completed, failed, progress) {
+ returnedProgress = progress;
+ if (this.executeSequentially)
+ innerPromise = this._startSequentialExecution();
+ else
+ innerPromise = this._startNonSequentialExecution();
+ innerPromise.then(handleCompleted.bind(this), handleError.bind(this)).then(function innerCompleted(wrapped) {
+ completed(wrapped)
+ }.bind(this), function innerFailed(error) {
+ failed(error)
+ }.bind(this))
+ }
+ { };
+ function cancelPromise() {
+ if (innerPromise) {
+ innerPromise.cancel();
+ innerPromise = null
+ }
+ }
+ { };
+ return new WinJS.Promise(initializePromise.bind(this), cancelPromise.bind(this))
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ var nextChunk = null;
+ var index = 0;
+ if (this.queries && this.queries.length && (!this.aggregateChunks || this._getChunkResultSize(result)))
+ this.queries.forEach(function (query) {
+ if (query && query.nextChunk) {
+ nextChunk = nextChunk || [];
+ nextChunk.length = index + 1;
+ nextChunk[index] = query.nextChunk
+ }
+ index++
+ }, this);
+ return nextChunk
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ InnerGroupsQuery: MS.Entertainment.UI.Framework.define(function InnerGroupsQuery(innerQuery) {
+ if (!innerQuery || !innerQuery.getGroupsAsync)
+ throw new Error("Invalid argument passed to InnerGroupsQuery");
+ this._innerQuery = innerQuery
+ }, {
+ _innerQuery: null, currentPage: null, previousPage: null, nextPage: null, dispose: function dispose() {
+ this._innerQuery = null
+ }, setCursorPosition: function setCursorPosition() { }, execute: function execute() {
+ return this.executeAsync()
+ }, executeAsync: function executeAsync() {
+ var result;
+ if (this._innerQuery)
+ result = this._innerQuery.getGroupsAsync().then(function extractJson(result) {
+ if (result && "json" in result)
+ result = result.json;
+ return result
+ });
+ else
+ result = WinJS.Promise.wrapError("InnerGroupsQuery has been disposed of");
+ return result
+ }
+ }), WrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function () {
+ MSE.Data.AugmentQuery.prototype.constructor.call(this)
+ }, {
+ _innerQuery: null, _innerGroupsQuery: null, _innerQueryChunked: true, queryId: null, acquisitionData: null, groupsAugmentation: null, dispose: function dispose() {
+ MSE.Data.AugmentQuery.prototype.dispose.call(this);
+ this.releaseInnerQuery()
+ }, createInnerQuery: function createInnerQuery() {
+ return null
+ }, createGroupsQuery: function createGroupsQuery() {
+ var result = this._innerGroupsQuery;
+ var innerQuery;
+ if (!result) {
+ if (this.allowGroupHints)
+ innerQuery = this._getInnerQuery();
+ if (innerQuery && innerQuery.getGroupsAsync) {
+ result = new MSE.Data.WrapperQuery;
+ result.resultAugmentation = WinJS.Binding.unwrap(this.groupsAugmentation);
+ result.chunked = false;
+ result._innerQuery = new MSE.Data.InnerGroupsQuery(innerQuery)
+ }
+ this._innerGroupsQuery = result
+ }
+ return result
+ }, releaseInnerQuery: function releaseInnerQuery() {
+ if (this._innerQuery && this._innerQuery.dispose) {
+ this._innerQuery.dispose();
+ this._innerQuery = null
+ }
+ if (this._innerQuery && this._innerQuery.close) {
+ this._innerQuery.close();
+ this._innerQuery = null
+ }
+ if (this._innerGroupsQuery && this._innerGroupsQuery.dispose) {
+ this._innerGroupsQuery.dispose();
+ this._innerGroupsQuery = null
+ }
+ if (this._innerGroupsQuery && this._innerGroupsQuery.close) {
+ this._innerGroupsQuery.close();
+ this._innerGroupsQuery = null
+ }
+ this._onReleaseInnerQuery()
+ }, _onReleaseInnerQuery: function _onReleaseInnerQuery() { }, _parseInnerResult: function _parseInnerResult(result) {
+ if (result)
+ try {
+ return JSON.parse(result)
+ }
+ catch (error) {
+ logJsonFailure("WrapperQuery::_parseInnerResult has failed because JSON.parse failed.", error, result);
+ throw error;
+ }
+ else
+ throw new Error("WrapperQuery._parseInnerResult failed. Result was null or empty");
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryReturn(this._innerQuery ? this._innerQuery.uri : String.empty);
+ return MSE.Data.queryStatus.processingData
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(query) { }, _startInnerExecute: function _startInnerExecute() {
+ if (this.isDisposed) {
+ MSE.Data.assert(false, "Attempting to execute a disposed wrapper query.");
+ return WinJS.Promise.wrapError(new Error("Attempting to execute a disposed wrapper query."))
+ }
+ var returnPromise;
+ var innerQuery = this._getInnerQuery();
+ return this._startInnerExecuteWork(innerQuery)
+ }, _startInnerExecuteWork: function _startInnerExecuteWork(innerQuery) {
+ if (!MS.Entertainment.Data.RandomAccessChunk.is(this.currentChunk) && this._innerQueryChunked)
+ innerQuery.currentPage = this.currentChunk;
+ else
+ innerQuery.currentPage = null;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryStart(innerQuery.uri);
+ return (innerQuery.executeAsync) ? innerQuery.executeAsync() : innerQuery.execute()
+ }, _getInnerQuery: function _getInnerQuery() {
+ this._innerQuery = this._innerQuery || this.createInnerQuery();
+ this._prepareQueryForInnerExecute(this._innerQuery);
+ return this._innerQuery
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ if (this._innerQuery && this._getChunkResultSize(result))
+ return this._innerQuery.nextPage;
+ else
+ return null
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ if (this._innerQuery && this._getChunkResultSize(result))
+ return this._innerQuery.previousPage;
+ else
+ return null
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ if (this._innerQuery) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_ParseComplete(this._innerQuery.uri);
+ if (this._innerQueryChunked)
+ this.currentChunk = this._innerQuery.currentPage
+ }
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ var resultAugmentation = MSE.Data.AugmentQuery.prototype._getResultAugmentation.call(this);
+ var expandedAugmentation = null;
+ if (this.queryId) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.queryId = this.queryId
+ }
+ if (this.acquisitionData) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.acquisitionData = this.acquisitionData
+ }
+ if (resultAugmentation && expandedAugmentation) {
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyListResultAugmentation(resultAugmentation, expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "item", expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "itemsArray", expandedAugmentation)
+ }
+ return resultAugmentation
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ ServiceWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.WrapperQuery", function () {
+ MSE.Data.WrapperQuery.prototype.constructor.call(this)
+ }, {
+ _shouldAuthenticate: false, _signInHandler: null, autoEncodeUri: true, useCache: null, useIfMatchCache: null, serviceType: 0, expirationTimeSeconds: 0, resourceURI: null, parameters: null, pluralizers: null, headers: null, postData: null, requestType: null, requireResponseData: true, _authenticationHeader: null, forceLowercaseJsonProperties: false, stampChunkInformation: false, dispose: function dispose() {
+ MSE.Data.WrapperQuery.prototype.dispose.call(this);
+ this._unregisterForSignInEvents()
+ }, shouldAuthenticate: {
+ get: function () {
+ return this._shouldAuthenticate
+ }, set: function (value) {
+ if (this._shouldAuthenticate !== value) {
+ var oldValue = value;
+ this._shouldAuthenticate = value;
+ this.notify("shouldAuthenticate", value, oldValue);
+ this._unregisterForSignInEvents();
+ this._registerForSignInEvents()
+ }
+ }
+ }, endpointSupportsAuthentication: {
+ get: function get_endpointSupportsAuthentication() {
+ return true
+ }
+ }, addAuthenticationHeader: {
+ get: function get_authenticate() {
+ var signedIn = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signedIn = signInService.isSignedIn || (this.useApp2UserIfAvailable && signInService.isApp2UserAvailable)
+ }
+ return (this.shouldAuthenticate && this.endpointSupportsAuthentication && signedIn)
+ }
+ }, autoUpdateItemFactory: {
+ get: function get_autoUpdateItemFactory() {
+ return this.stampChunkInformation
+ }
+ }, getResourceEndpointID: function getResourceEndpointID() {
+ MSE.Data.fail("Derived classes must define this function in order for authentication to work.");
+ return null
+ }, getResourceEndpoint: function getResourceEndpoint() {
+ var endpoint = String.empty;
+ var endpointID = this.getResourceEndpointID();
+ if (endpointID)
+ endpoint = MS.Entertainment.Endpoint.load(endpointID);
+ return endpoint
+ }, createResourceURI: function createResourceURI() {
+ return this.resourceURI
+ }, createPostData: function createPostData() {
+ return WinJS.Binding.unwrap(this.postData)
+ }, createParameters: function createParameters() {
+ return WinJS.Binding.unwrap(this.parameters)
+ }, createHeaders: function createHeaders() {
+ return WinJS.Binding.unwrap(this.headers)
+ }, _createAuthenticationHeader: function _createAuthenticationHeader() {
+ return WinJS.Binding.unwrap(this._authenticationHeader)
+ }, hasAuthenticationHeader: function hasAuthenticationHeader() {
+ var header = this._createAuthenticationHeader();
+ return !!header && !!header.value
+ }, createPluralizers: function createPluralizers() {
+ return this.pluralizers
+ }, addHeader: function addHeader(key, value) {
+ if (!this.headers)
+ this.headers = {};
+ this.headers[key] = value
+ }, createInnerQuery: function createInnerQuery() {
+ return new Microsoft.Entertainment.Queries.ServiceXMLQuery
+ }, getResponseVersion: function getResponseVersion(result) { }, _registerForSignInEvents: function _registerForSignInEvents() {
+ this._unregisterForSignInEvents();
+ if (this.shouldAuthenticate && this.endpointSupportsAuthentication && this.autoUpdateProperties && this.autoUpdateProperties.isSignedIn) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signInHandler = WinJS.Binding.bind(signInService, {
+ isSignedIn: function (value, oldValue) {
+ if (oldValue !== undefined)
+ this.notify("isSignedIn", value, oldValue)
+ }.bind(this)
+ })
+ }
+ }, _unregisterForSignInEvents: function _unregisterForSignInEvents() {
+ if (this._signInHandler) {
+ this._signInHandler.cancel();
+ this._signInHandler = null
+ }
+ }, _addParameters: function _addParameters(query, parameters) {
+ var key;
+ var value;
+ if (parameters && query)
+ for (key in parameters)
+ if (parameters.hasOwnProperty(key)) {
+ value = parameters[key];
+ if (value || value === 0)
+ query.addParameter(window.encodeURIComponent(key), window.encodeURIComponent(value).replace(/%2B/gi, "+"))
+ }
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(query) {
+ var pluralizers;
+ var parameters;
+ var key;
+ var value;
+ var uri;
+ uri = this.createResourceURI();
+ query.uri = this.autoEncodeUri ? window.encodeURI(uri) : uri;
+ query.serviceType = this.serviceType;
+ pluralizers = this.createPluralizers();
+ if (pluralizers)
+ query.pluralizationRules = pluralizers;
+ this._addParameters(query, this.createParameters());
+ var headers = this.createHeaders();
+ if (headers)
+ for (key in headers)
+ if (headers.hasOwnProperty(key)) {
+ value = headers[key];
+ if (value || value === 0)
+ query.addHeader(key, value.toString())
+ }
+ var authenticationHeader = this._createAuthenticationHeader();
+ if (authenticationHeader)
+ query.addHeader(authenticationHeader.key, authenticationHeader.value.toString());
+ var postData = this.createPostData();
+ if (postData && postData.contentType && postData.data)
+ query.setPostData(postData.contentType, postData.data);
+ if (this.requestType)
+ query.requestType = this.requestType;
+ if (this.useCache !== null)
+ query.useCache = this.useCache;
+ if (this.expirationTimeSeconds !== 0)
+ query.expirationDate = new Date(Date.now() + (this.expirationTimeSeconds * 1000));
+ if (this.useIfMatchCache !== null)
+ query.useIfMatchCache = this.useIfMatchCache;
+ query.forceLowercaseJsonProperties = this.forceLowercaseJsonProperties;
+ this._registerForSignInEvents()
+ }, _getAuthHeader: function _getAuthHeader() {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var promise = signInService.getXToken(this.getResourceEndpointID());
+ return promise
+ }, _preInnerExecute: function _preInnerExecute() {
+ var promise;
+ var signInService = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn))
+ signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (this.addAuthenticationHeader)
+ promise = this._getAuthHeader().then(function setAuthHeader(header) {
+ this._authenticationHeader = header
+ }.bind(this), function getAuthHeaderFailed(error) {
+ this._clearAuthentication();
+ return WinJS.Promise.wrapError(this._createError(error, "Invalid header for authenticated ServiceWrapperQuery"))
+ }.bind(this));
+ else
+ this._clearAuthentication();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.service.enableTimeTravel && !promise && signInService)
+ if (this.serviceType === MS.Entertainment.Data.ServiceWrapperQuery.ServiceTypes.json)
+ promise = signInService.signIn().then(function success() {
+ return this._getAuthHeader().then(function setAuthHeader(header) {
+ this._authenticationHeader = header
+ }.bind(this), function getAuthHeaderFailed(error) {
+ this._clearAuthentication();
+ return WinJS.Promise.wrapError(this._createError(error, "Invalid header for authenticated ServiceWrapperQuery"))
+ }.bind(this))
+ }.bind(this));
+ else
+ promise = signInService.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport), true, Microsoft.Entertainment.Util.SignInPromptType.doNotPrompt).then(function setHeader(ticket) {
+ this._authenticationHeader = {
+ key: "Authorization", value: "WLID1.0 " + ticket
+ }
+ }.bind(this), function getHeaderFailed(error) {
+ return WinJS.Promise.wrapError(this._createError(error, "Invalid header for authenticated ServiceWrapperQuery"))
+ }.bind(this));
+ return WinJS.Promise.as(promise)
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ MS.Entertainment.Data.WrapperQuery.prototype._endInnerExecute.apply(this, arguments);
+ var version = this.getResponseVersion(result);
+ if (version && this.useIfMatchCache) {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ mediaStore.offlineDetailProvider.setIfMatchValueWithKeyAsync(this._innerQuery.uri, version).done(function setIfMatchValueWithKeyAsync_completed() { }, function setIfMatchValueWithKeyAsync_error() {
+ MSE.Data.assert(false, "Failed to write cache version for if-match query")
+ })
+ }
+ }, _clearAuthentication: function _clearAuthentication() {
+ if (this._authenticationHeader)
+ this._authenticationHeader = {
+ key: this._authenticationHeader.key, value: String.empty
+ }
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ if (result && result.json)
+ try {
+ return JSON.parse(result.json)
+ }
+ catch (error) {
+ var uri = this._innerQuery && this._innerQuery.uri;
+ logJsonFailure("ServiceWrapperQuery::_parseInnerResult has failed because JSON.parse failed. Resource uri was \'" + uri + "\'", error, result && result.json);
+ throw error;
+ }
+ else if (this.requireResponseData)
+ throw new Error("ServiceWrapperQuery._parseInnerResult failed. Result was null or empty");
+ else
+ return WinJS.Promise.wrap({})
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ return MSE.Data.AugmentQuery.invalidPreviousChunk
+ }, _preInsertChunk: function _preInsertChunk(destination, chunk) {
+ MS.Entertainment.Data.WrapperQuery.prototype._preInsertChunk.apply(this, arguments);
+ if (this.autoUpdateItemFactory && destination && destination.setItemFactory && chunk && chunk.itemFactory)
+ destination.setItemFactory(chunk.itemFactory)
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ var resultAugmentation = MSE.Data.WrapperQuery.prototype._getResultAugmentation.call(this);
+ var expandedAugmentation = null;
+ if (this.stampChunkInformation) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.chunkInformation = this._createChunkInformation()
+ }
+ if (resultAugmentation && expandedAugmentation) {
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyListResultAugmentation(resultAugmentation, expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "item", expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "itemsArray", expandedAugmentation)
+ }
+ return resultAugmentation
+ }, _createChunkInformation: function _createChunkInformation() {
+ return this.currentChunk
+ }
+ }, {
+ ServiceTypes: { json: 1 }, RequestTypes: {
+ head: 1, get: 2, post: 3, put: 4, deleteRequest: 5
+ }, isServiceWrapperQuery: function isServiceWrapperQuery(object) {
+ return MS.Entertainment.Data.ServiceWrapperQuery.prototype.isPrototypeOf(object)
+ }
+ }), LibraryWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.WrapperQuery", function () {
+ this.debugInstanceId = ++MSE.Data.DebugInstanceId;
+ this._logQueryActions("Creation");
+ MSE.Data.WrapperQuery.prototype.constructor.call(this);
+ this._currentStateChangePromise = WinJS.Promise.wrap()
+ }, {
+ hasTotalCount: true, allowReset: false, _isLive: false, _isAttached: false, _queryEventHandlers: null, _pauseCount: 0, _pausedQuery: null, _currentStateChangePromise: null, isLive: {
+ get: function get_isLive() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return this._isLive && configurationManager.shell.uiRefresh
+ }, set: function set_isLive(value) {
+ if (value !== this._isLive) {
+ if (this._isAttached) {
+ MSE.Data.assert(!value, "Cannot set a query back to live after it has been run.");
+ if (!value)
+ this.releaseInnerQuery()
+ }
+ this._isLive = value
+ }
+ }
+ }, isPaused: {
+ get: function get_isPaused() {
+ return this._pauseCount > 0
+ }
+ }, pause: function pause(innerQuery) {
+ if (this.isDisposed)
+ return WinJS.Promise.wrap();
+ this._pauseCount++;
+ return this._commitPause(this._innerQuery)
+ }, _commitPause: function _commitPause(innerQuery) {
+ if (this.isDisposed)
+ return WinJS.Promise.wrap();
+ var promise;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.shell.uiRefresh && innerQuery && this.isLive && this._pauseCount > 0) {
+ var queryPause = function queryPause() {
+ var paused = false;
+ if (innerQuery && innerQuery.pauseAsync && this.isLive)
+ paused = innerQuery.pauseAsync();
+ innerQuery = null;
+ return paused
+ }.bind(this);
+ if (this._pausedQuery !== innerQuery) {
+ this._pausedQuery = innerQuery;
+ promise = this._currentStateChangePromise = this._currentStateChangePromise.then(queryPause, queryPause)
+ }
+ else
+ promise = this._currentStateChangePromise
+ }
+ return WinJS.Promise.as(promise)
+ }, unpause: function unpause() {
+ if (this.isDisposed)
+ return WinJS.Promise.wrap();
+ var promise;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._pauseCount--;
+ if (configurationManager.shell.uiRefresh && this._pausedQuery && this._pauseCount === 0 && this.isLive) {
+ var pausedQuery = this._pausedQuery;
+ this._pausedQuery = null;
+ var queryResume = function queryResume() {
+ var unpaused = false;
+ if (pausedQuery && pausedQuery.resumeAsync && this.isLive)
+ unpaused = pausedQuery.resumeAsync();
+ pausedQuery = null;
+ return unpaused
+ }.bind(this);
+ promise = this._currentStateChangePromise = this._currentStateChangePromise.then(queryResume, queryResume)
+ }
+ if (this._pauseCount < 0)
+ this._pauseCount = 0;
+ return WinJS.Promise.as(promise)
+ }, forceLiveRefresh: function forceLiveRefresh() {
+ var refreshPromise;
+ if (this.isLive && this._innerQuery && this._innerQuery.refreshAsync)
+ refreshPromise = this._innerQuery.refreshAsync();
+ return WinJS.Promise.as(refreshPromise)
+ }, loadChunk: function loadChunk(startIndex, countBefore, countAfter, destinationList) {
+ var endIndex = startIndex;
+ var originalStartIndex = startIndex;
+ destinationList = destinationList || true;
+ if (isNaN(startIndex))
+ throw new Error("loadChunk failed. startIndex is not a number: " + startIndex);
+ else if (startIndex < 0)
+ throw new Error("loadChunk failed. startIndex is out of range: " + startIndex);
+ else if (this.totalCount < 0)
+ throw new Error("loadChunk failed. totalCount is unknown, thus random access is not possible");
+ countBefore = (isNaN(countBefore) || countBefore < 0) ? 0 : countBefore;
+ countAfter = (isNaN(countAfter) || countAfter < 0) ? 0 : countAfter;
+ endIndex = startIndex + countAfter;
+ startIndex = Math.max(0, startIndex - countBefore);
+ this.currentChunk = new MS.Entertainment.Data.RandomAccessChunk(startIndex, endIndex - startIndex + 1);
+ this.nextChunk = MS.Entertainment.Data.AugmentQuery.invalidNextChunk;
+ this.previousChunk = MS.Entertainment.Data.AugmentQuery.invalidPreviousChunk;
+ return this._execute(destinationList).then(function (result) {
+ var list = this._getChunkDestination(this.lastChunkedResult);
+ list = (list) ? list.source : [];
+ return {
+ items: list, offset: originalStartIndex - startIndex, totalCount: this.totalCount
+ }
+ }.bind(this), function error() {
+ return {
+ items: [], offset: 0, error: true, totalCount: this.totalCount
+ }
+ }.bind(this))
+ }, execute: function execute(cookie) {
+ this.releaseInnerQuery();
+ return MSE.Data.WrapperQuery.prototype.execute.apply(this, arguments)
+ }, _onReleaseInnerQuery: function _onReleaseInnerQuery() {
+ if (this._pausedQuery) {
+ this._pauseCount = 0;
+ this._pausedQuery = null
+ }
+ this._isAttached = false;
+ this._cancelQueryEventHandlers()
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ if (result) {
+ var jsonString;
+ if (typeof result === "string")
+ jsonString = result;
+ else if (typeof result === "object" && result.json)
+ jsonString = result.json;
+ try {
+ return JSON.parse(jsonString)
+ }
+ catch (error) {
+ logJsonFailure("LibraryWrapperQuery::_parseInnerResult has failed because JSON.parse failed.", error, jsonString);
+ throw error;
+ }
+ }
+ throw new Error("LibraryWrapperQuery._parseInnerResult failed.");
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(innerQuery) {
+ if (MS.Entertainment.Data.RandomAccessChunk.is(this.currentChunk)) {
+ innerQuery.pageSize = this.currentChunk.count;
+ innerQuery.setCursorPosition(this.currentChunk.startIndex)
+ }
+ else {
+ innerQuery.pageSize = this.chunkSize;
+ innerQuery.setCursorPosition(0)
+ }
+ innerQuery.groupsEnabled = this.allowGroupHints;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.shell.uiRefresh && !this._isAttached) {
+ this._cancelQueryEventHandlers();
+ if (this.isLive)
+ this._queryEventHandlers = MS.Entertainment.Utilities.addEvents(innerQuery, { querychanged: this._resultChanged.bind(this) });
+ else if (innerQuery.dispose)
+ innerQuery.dispose();
+ else if (innerQuery.close)
+ innerQuery.close();
+ this._isAttached = true
+ }
+ }, _startInnerExecuteWork: function _startInnerExecuteWork(innerQuery) {
+ var promise = MSE.Data.WrapperQuery.prototype._startInnerExecuteWork.call(this, innerQuery);
+ if (this.isPaused)
+ this._commitPause(innerQuery);
+ return promise
+ }, _cancelQueryEventHandlers: function _cancelQueryEventHandlers() {
+ if (this._queryEventHandlers) {
+ this._queryEventHandlers.cancel();
+ this._queryEventHandlers = null
+ }
+ }, _resultChanged: function _resultChanged(args) {
+ if (args && args.target !== this._innerQuery)
+ return;
+ MSE.Data.assert(args && args.json, "Invalid args given to _resultsChanged");
+ var result;
+ var changes;
+ var maxChanges = 300;
+ var totalCount = NaN;
+ if (this.chunkDestination) {
+ try {
+ if (args)
+ result = JSON.parse(args.json);
+ else
+ result = {}
+ }
+ catch (error) {
+ logJsonFailure("LibraryWrapperQuery::_resultsChanged has failed because JSON.parse failed.", error, args && args.json);
+ result = {}
+ }
+ if (result.TotalCount !== null && !isNaN(result.TotalCount))
+ totalCount = this.totalCount = result.TotalCount;
+ changes = result.changes || [];
+ if (changes.length > maxChanges && this.allowReset)
+ this.dispatchEvent(MS.Entertainment.Data.chunkerEvents.reset, {
+ sender: this, totalCount: totalCount
+ });
+ else
+ this.dispatchEvent(MS.Entertainment.Data.chunkerEvents.batchChange, {
+ sender: this, changes: changes, totalCount: totalCount
+ })
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ JSonWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function () {
+ MSE.Data.AugmentQuery.prototype.constructor.call(this)
+ }, {
+ _innerQuery: null, headers: {}, createResourceUri: function createResourceUri() {
+ throw new Error("createResourceUri is not defined");
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ if (result && result.response)
+ try {
+ return JSON.parse(result.response)
+ }
+ catch (error) {
+ logJsonFailure("JSonWrapperQuery::_parseInnerResult has failed because JSON.parse failed.", error, result && result.response);
+ throw error;
+ }
+ else
+ throw new Error("response was null or empty. status code: " + (result ? result.status : "null"));
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryReturn(this.currentChunk);
+ return MSE.Data.queryStatus.processingData
+ }, _startInnerExecute: function _startInnerExecute() {
+ var that = this;
+ var returnPromise;
+ if (!this.currentChunk)
+ this.currentChunk = this.createResourceUri();
+ if (this.currentChunk)
+ returnPromise = that._xmlHttpRequest({
+ url: this.currentChunk, async: true, headers: WinJS.Binding.unwrap(this.headers)
+ });
+ else
+ returnPromise = WinJS.Promise.WrapError(this);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryStart(this.currentChunk);
+ return returnPromise
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ if (result)
+ return this._createUriFromChunkKey(result.nextPage);
+ else
+ return null
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ if (result)
+ return this._createUriFromChunkKey(result.previousPage);
+ else
+ return null
+ }, _createUriFromChunkKey: function _createUriFromChunkKey(chunkKey) {
+ var uri = null;
+ var baseUrl = this.createResourceUri();
+ var expression = /\?/;
+ if (expression.test(baseUrl))
+ baseUrl = baseUrl + "&";
+ else
+ baseUrl = baseUrl + "?";
+ if (chunkKey)
+ uri = baseUrl + chunkKey;
+ return uri
+ }, _xmlHttpRequest: function _xmlHttpRequest(values) {
+ return MSE.ServiceLocator.getService(MSE.Services.xhr).execute(values)
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_ParseComplete(this.currentChunk)
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ EDSWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ServiceWrapperQuery", function edsServiceWrapperQuery() {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype.constructor.call(this);
+ this.shouldAuthenticate = true
+ }, {
+ serviceType: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.ServiceWrapperQuery.ServiceTypes.json
+ }), requestFields: null, targetDeviceType: null, forceSecureEndpoint: false, useApp2UserIfAvailable: false, enabledImpressionGuid: false, impressionGuid: null, relevancyTrackingContent: null, includeContentRestrictionHeader: false, _requestFieldsToken: null, _anonymousClientIdHeader: null, _impressionGuids: null, _retryCount: 0, dispose: function dispose() {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype.dispose.call(this);
+ if (this._impressionGuids)
+ this._impressionGuids.splice(0)
+ }, autoUpdateOnSignIn: {
+ get: function () {
+ return this.autoUpdateProperties ? !!this.autoUpdateProperties.isSignedIn : false
+ }, set: function (value) {
+ this.autoUpdateProperties = this.autoUpdateProperties || {};
+ this.autoUpdateProperties.isSignedIn = value
+ }
+ }, autoUpdateItemFactory: {
+ get: function get_autoUpdateItemFactory() {
+ return this.stampChunkInformation || this.enabledImpressionGuid
+ }
+ }, endpointSupportsAuthentication: {
+ get: function get_endpointSupportsAuthentication() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var secureEDSEndpointsEnabled = this.forceSecureEndpoint || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.secureEDSEndpointsEnabled);
+ if (!MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps)
+ MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps = {};
+ var authenticatedEndpointID = this.getAuthenticatedResourceEndpointID();
+ if (!MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps[authenticatedEndpointID])
+ MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps[authenticatedEndpointID] = /^https:\/\//i.test(MS.Entertainment.Endpoint.load(authenticatedEndpointID));
+ return secureEDSEndpointsEnabled && MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps[authenticatedEndpointID]
+ }
+ }, useAuthenticatedEndpoint: {
+ get: function get_useAuthenticatedEndpoint() {
+ var useAuthenticatedEndpoint = false;
+ var signedInOrOffline = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signedInOrOffline = signInService.isSignedIn || (this.useApp2UserIfAvailable && signInService.isApp2UserAvailable)
+ }
+ if (!signedInOrOffline && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.networkStatus)) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var networkStatus = uiStateService.networkStatus;
+ signedInOrOffline = networkStatus !== MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown && networkStatus !== MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted && networkStatus !== MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled
+ }
+ return signedInOrOffline && this.endpointSupportsAuthentication && this.shouldAuthenticate
+ }
+ }, addAuthenticationHeader: {
+ get: function get_authenticate() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var signedIn = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signedIn = signInService.isSignedIn || (this.useApp2UserIfAvailable && signInService.isApp2UserAvailable)
+ }
+ return configurationManager.service.enableTimeTravel || (this.useAuthenticatedEndpoint && signedIn)
+ }
+ }, edsHeaders: null, edsParameters: null, createRequestFields: function createRequestFields() {
+ return WinJS.Binding.unwrap(this.requestFields)
+ }, createTargetDeviceType: function createTargetDeviceType() {
+ return this.targetDeviceType
+ }, createEDSHeaders: function createEDSHeaders() {
+ var edsHeaders = WinJS.Binding.unwrap(this.edsHeaders);
+ if (!edsHeaders)
+ edsHeaders = {
+ Accept: "application/json", "x-xbl-contract-version": "3.2", "x-xbl-client-type": MS.Entertainment.Data.EDSWrapperQuery.clientType, "x-xbl-device-type": this.getHeaderDeviceType(), "x-xbl-client-version": MS.Entertainment.Data.EDSWrapperQuery.currentVersion, "x-xbl-build-version": "current"
+ };
+ if (this.includeContentRestrictionHeader && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionHeaderName = "x-xbl-contentRestrictions";
+ var contentRestrictionHeaderValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService).getContentRestrictionHeader();
+ if (edsHeaders[contentRestrictionHeaderName] && !contentRestrictionHeaderValue)
+ delete edsHeaders[contentRestrictionHeaderName];
+ else if (contentRestrictionHeaderValue)
+ edsHeaders[contentRestrictionHeaderName] = contentRestrictionHeaderValue
+ }
+ return edsHeaders
+ }, createEDSParameters: function createEDSParameters() {
+ var edsParameters = WinJS.Binding.unwrap(this.edsParameters);
+ if (this.includeContentRestrictionHeader && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionParameterName = "contentRestrictions";
+ var contentRestrictionParameterValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService).getContentRestrictionUrlParameter();
+ edsParameters = edsParameters || {};
+ if (edsParameters[contentRestrictionParameterName] && !contentRestrictionParameterValue)
+ delete edsParameters[contentRestrictionParameterName];
+ else if (contentRestrictionParameterValue)
+ edsParameters[contentRestrictionParameterName] = contentRestrictionParameterValue
+ }
+ return edsParameters
+ }, getHeaderDeviceType: function getHeaderDeviceType() {
+ return MS.Entertainment.Utilities.defaultEdsHeaderDeviceTypeFromApp
+ }, getAuthenticatedResourceEndpointID: function getAuthenticatedResourceEndpointID() {
+ return MS.Entertainment.Endpoint.id.seid_EDSServiceAuth
+ }, getResourceEndpointID: function getResourceEndpointID() {
+ var endpointID = null;
+ if (this.useAuthenticatedEndpoint)
+ endpointID = MS.Entertainment.Endpoint.id.seid_EDSServiceAuth;
+ else
+ endpointID = MS.Entertainment.Endpoint.id.seid_EDSServiceAnon;
+ return endpointID
+ }, getResourceEndpoint: function getResourceEndpoint(edsEndpointType) {
+ var endpoint = MS.Entertainment.Data.ServiceWrapperQuery.prototype.getResourceEndpoint.call(this);
+ if (endpoint && edsEndpointType)
+ endpoint = endpoint + "/" + edsEndpointType;
+ return endpoint
+ }, _clearAnonymousClientIdHeader: function _clearAnonymousClientIdHeader() {
+ if (this._anonymousClientIdHeader)
+ this._anonymousClientIdHeader = {
+ key: MS.Entertainment.Data.EDSWrapperQuery.clientIdHeader, value: String.empty
+ }
+ }, _createAnonymousClientIdHeader: function _createAnonymousClientIdHeader() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var visitorId = configurationManager.telemetry.visitorId;
+ if (visitorId)
+ this._anonymousClientIdHeader = {
+ key: MS.Entertainment.Data.EDSWrapperQuery.clientIdHeader, value: visitorId
+ };
+ else
+ this._clearAnonymousClientIdHeader()
+ }, _startExecute: function _startExecute() {
+ this._retryCount = 0
+ }, _preInnerExecute: function _preInnerExecute() {
+ var basePromise = MS.Entertainment.Data.ServiceWrapperQuery.prototype._preInnerExecute.apply(this, arguments);
+ var returnPromise = basePromise;
+ if (this.includeContentRestrictionHeader && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ returnPromise = returnPromise.then(function basePromiseCompleted() {
+ return contentRestrictionService.getBrowsePolicyUpdatePromise()
+ })
+ }
+ this._requestFieldsToken = null;
+ var fieldString;
+ var requestFields = this.createRequestFields();
+ MS.Entertainment.Data.assert(Array.isArray(requestFields), "createRequestFields() did not return a valid set of request fields. We must have a valid set of request fields before executing an EDS query. If it is known that the query doesn't except a fieldsToken, createRequestFields() should return an empty array.");
+ if (Array.isArray(requestFields) && requestFields.length) {
+ fieldString = requestFields.join(".");
+ returnPromise = returnPromise.then(function fetchFields() {
+ return MS.Entertainment.Data.EDSWrapperQuery.fetchRequestFields(fieldString).then(function setRequestFields(requestFieldsToken) {
+ this._requestFieldsToken = requestFieldsToken
+ }.bind(this))
+ }.bind(this))
+ }
+ return returnPromise
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(query) {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype._prepareQueryForInnerExecute.apply(this, arguments);
+ var value;
+ if (!isNaN(this.chunkSize) && this.chunkSize > 0)
+ query.addParameter(window.encodeURIComponent(MS.Entertainment.Data.EDSWrapperQuery.maxItemsParameter), window.encodeURIComponent(this.chunkSize));
+ if (this._requestFieldsToken)
+ query.addParameter(window.encodeURIComponent(MS.Entertainment.Data.EDSWrapperQuery.fieldsParameter), window.encodeURIComponent(this._requestFieldsToken));
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.service.enableTimeTravel)
+ query.addParameter(window.encodeURIComponent(MS.Entertainment.Data.EDSWrapperQuery.timeTravelInstantParameter), window.encodeURIComponent(configurationManager.service.timeTravelStartDate));
+ var targetDeviceType = this.createTargetDeviceType();
+ if (targetDeviceType)
+ query.addParameter(MS.Entertainment.Data.EDSWrapperQuery.targetDevicesParameter, targetDeviceType);
+ var headers = this.createEDSHeaders();
+ if (headers)
+ for (var key in headers)
+ if (headers.hasOwnProperty(key)) {
+ value = headers[key];
+ if (value || value === 0)
+ query.addHeader(key, value.toString())
+ }
+ this._addParameters(query, this.createEDSParameters());
+ if (this.hasAuthenticationHeader())
+ this._clearAnonymousClientIdHeader();
+ else
+ this._createAnonymousClientIdHeader();
+ if (this._anonymousClientIdHeader)
+ query.addHeader(this._anonymousClientIdHeader.key, this._anonymousClientIdHeader.value.toString());
+ if (this.impressionGuid) {
+ query.addHeader(MS.Entertainment.Data.EDSWrapperQuery.impressionGuidHeader, this.impressionGuid);
+ if (this.relevancyTrackingContent && this.relevancyTrackingContent.kValue && this.relevancyTrackingContent.kValueNamespace) {
+ query.addHeader(MS.Entertainment.Data.EDSWrapperQuery.kValueHeader, this.relevancyTrackingContent.kValue);
+ query.addHeader(MS.Entertainment.Data.EDSWrapperQuery.kValueNamespaceHeader, this.relevancyTrackingContent.kValueNamespace)
+ }
+ }
+ else
+ query.removeHeader(MS.Entertainment.Data.EDSWrapperQuery.impressionGuidHeader)
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ var resultAugmentation = MSE.Data.ServiceWrapperQuery.prototype._getResultAugmentation.call(this);
+ var expandedAugmentation = null;
+ if (this.enabledImpressionGuid)
+ expandedAugmentation = { impressionGuid: this._createNextImpressionGuidCallback() };
+ if (this.acquisitionData) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.acquisitionData = this.acquisitionData
+ }
+ if (resultAugmentation && expandedAugmentation) {
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyListResultAugmentation(resultAugmentation, expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "item", expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "itemsArray", expandedAugmentation)
+ }
+ return resultAugmentation
+ }, _initializeImpressionGuids: function _initializeImpressionGuids() {
+ if (!this._disposed && !this._impressionGuids && this.enabledImpressionGuid)
+ this._impressionGuids = []
+ }, _createNextImpressionGuidCallback: function _createNextImpressionGuidCallback() {
+ this._initializeImpressionGuids();
+ var impressionGuids = this._impressionGuids;
+ var index = impressionGuids.length;
+ var propertyValue = MS.Entertainment.Data.Property.convert(String.empty, function getImpressionGuid() {
+ return impressionGuids ? impressionGuids[index] : null
+ });
+ propertyValue.override = true;
+ return propertyValue
+ }, _retryInnerExecute: function _retryInnerExecute(result, error) {
+ var retry = false;
+ if (result && result.responseInfo === MS.Entertainment.Data.EDSWrapperQuery.responseInfo.tryAgain && this._retryCount < MS.Entertainment.Data.EDSWrapperQuery._maxRetries) {
+ this._retryCount++;
+ retry = true
+ }
+ return retry
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype._endInnerExecute.apply(this, arguments);
+ this._initializeImpressionGuids();
+ if (this._impressionGuids)
+ this._impressionGuids.push(result ? result.impressionGuid : null)
+ }
+ }, {
+ requestFieldsNotNeeded: [], _cachedIsHttps: null, _cachedFieldTokens: {}, _maxRetries: 3, _currentVersion: null, clientType: {
+ get: function get_clientType() {
+ return "X13"
+ }
+ }, currentVersion: {
+ get: function get_currentVersion() {
+ if (!MS.Entertainment.Data.EDSWrapperQuery._currentVersion) {
+ var currentPackage = Windows.ApplicationModel.Package.current;
+ var currentVersion = currentPackage && currentPackage.id && currentPackage.id.version;
+ if (currentVersion)
+ MS.Entertainment.Data.EDSWrapperQuery._currentVersion = currentVersion.major + "." + currentVersion.minor + "." + currentVersion.build + "." + currentVersion.revision
+ }
+ return MS.Entertainment.Data.EDSWrapperQuery._currentVersion
+ }
+ }, fetchRequestFields: function fetchRequestFields(fieldString) {
+ var returnPromise = null;
+ if (MS.Entertainment.Data.EDSWrapperQuery._cachedFieldTokens[fieldString])
+ returnPromise = WinJS.Promise.as(MS.Entertainment.Data.EDSWrapperQuery._cachedFieldTokens[fieldString]);
+ else {
+ var query = new MS.Entertainment.Data.EDSFieldQuery;
+ query.fields = fieldString;
+ returnPromise = query.execute().then(function cacheQueryResult(completedQuery) {
+ MS.Entertainment.Data.EDSWrapperQuery._cachedFieldTokens[fieldString] = completedQuery.result.fields;
+ return completedQuery.result.fields
+ })
+ }
+ return returnPromise
+ }, maxItemsParameter: "maxItems", fieldsParameter: "fields", targetDevicesParameter: "targetDevices", timeTravelInstantParameter: "currentTime", clientIdHeader: "x-fd-client", impressionGuidHeader: "x-xbl-ig", kValueHeader: "x-xbl-kvalue", kValueNamespaceHeader: "x-xbl-kvalue-namespace", responseInfo: { tryAgain: "TryAgain" }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ EDSFieldQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.EDSWrapperQuery", function edsFieldQuery() {
+ MS.Entertainment.Data.EDSWrapperQuery.prototype.constructor.call(this)
+ }, {
+ fields: null, requestFields: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.EDSWrapperQuery.requestFieldsNotNeeded
+ }), chunkSize: 0, createResourceURI: function () {
+ return this.getResourceEndpoint(MS.Entertainment.Data.Query.edsEndpointType.fields)
+ }, createParameters: function createParameters() {
+ return { desired: this.fields }
+ }, resultAugmentation: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.define(null, { fields: MS.Entertainment.Data.Property.alias("Fields", null) })
+ })
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ BrowseDetailQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AggregateQuery", function browseDetailQuery() {
+ MS.Entertainment.Data.AggregateQuery.prototype.constructor.apply(this, arguments);
+ this.queries.length = 2
+ }, {
+ browseConstructor: null, detailConstructor: null, executeSequentially: {
+ get: function () {
+ var sequentially = true;
+ if (this.detail && MS.Entertainment.Data.Query && MS.Entertainment.Data.Query.edsIdType && (!this.detail.idType || this.detail.idType === MS.Entertainment.Data.Query.edsIdType.canonical))
+ sequentially = false;
+ return sequentially
+ }, set: function (value) {
+ MSE.Data.fail("Shouldn't set executeSequentially on a BrowseDetailQuery.")
+ }
+ }, chunked: {
+ get: function () {
+ return false
+ }, set: function (value) {
+ MSE.Data.fail("Shouldn't set chunked on a BrowseDetailQuery.")
+ }
+ }, browse: {
+ get: function () {
+ if (!this.browseConstructor)
+ return null;
+ if (!this.queries[1])
+ this.queries[1] = new this.browseConstructor;
+ return this.queries[1]
+ }
+ }, detail: {
+ get: function () {
+ if (!this.detailConstructor)
+ return null;
+ if (!this.queries[0])
+ this.queries[0] = new this.detailConstructor;
+ return this.queries[0]
+ }
+ }, impressionGuid: {
+ get: function getImpressionGuid() {
+ return this.browse ? this.browse.impressionGuid : null
+ }, set: function setImpressionGuid(value) {
+ if (this.browse && "impressionGuid" in this.browse)
+ this.browse.impressionGuid = value;
+ if (this.detail && "impressionGuid" in this.detail)
+ this.detail.impressionGuid = value
+ }
+ }, relevancyTrackingContent: {
+ get: function getRelevancyTrackingContent() {
+ return this.detail ? this.detail.relevancyTrackingContent : null
+ }, set: function setRelevancyTrackingContent(value) {
+ if (this.detail && "relevancyTrackingContent" in this.detail)
+ this.detail.relevancyTrackingContent = value
+ }
+ }, _preInnerExecute: function _preInnerExecute() {
+ var browseQuery = this.browse;
+ var detailsQuery = this.detail;
+ return WinJS.Promise.as()
+ }, _handleIntermediateResult: function _handleIntermediateResult(sourceIndex, sourceResult) {
+ if (sourceIndex === 0 && sourceResult.item && (sourceResult.item.canonicalId || sourceResult.item.serviceId) && this.browse) {
+ this.browse.impressionGuid = sourceResult.item.impressionGuid;
+ this.browse.id = sourceResult.item.canonicalId || sourceResult.item.serviceId;
+ this.browse.idType = sourceResult.item.canonicalId ? MS.Entertainment.Data.Query.edsIdType.canonical : MS.Entertainment.Data.Query.edsIdType.zuneCatalog
+ }
+ }
+ }, {
+ mixAugmentation: function mixAugmentation(browseAugmentation, detailAugmentation) {
+ var augmentations = {};
+ augmentations["source[0]"] = detailAugmentation;
+ augmentations["source[1]"] = browseAugmentation;
+ return MS.Entertainment.Data.mix(augmentations)
+ }
+ }), AugmentationWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.MainQuery", function AugmentationWrapperQuery(query) {
+ MSE.Data.MainQuery.prototype.constructor.apply(this, arguments);
+ this.query = query
+ }, {
+ _query: null, _queryNotify: null, _queryEvents: null, autoDisposeQuery: true, query: {
+ get: function () {
+ return this._query
+ }, set: function (value) {
+ if (this.value !== this._query) {
+ if (this._query) {
+ this._query.notify = this._queryNotify;
+ this._queryNotify = null
+ }
+ if (this._queryEvents) {
+ this._queryEvents.cancel();
+ this._queryEvents = null
+ }
+ this._query = value;
+ if (this._query) {
+ this._queryNotify = this._query.notify;
+ this._query.notify = this._notifyProxy.bind(this);
+ this._queryEvents = MS.Entertainment.Utilities.addEvents(this._query, { resultChanged: this._queryResultChanged.bind(this) })
+ }
+ }
+ }
+ }, clearResultOnFailure: {
+ get: function () {
+ return this.query ? this.query.clearResultOnFailure : false
+ }, set: function (value) {
+ if (this.query)
+ this.query.clearResultOnFailure = value
+ }
+ }, chunkDestination: {
+ get: function get_chunkDesination() {
+ return this.query ? this.query.chunkDestination : null
+ }, set: function set_chunkDesination(value) {
+ if (this.query)
+ this.query.chunkDestination = value
+ }
+ }, enabled: {
+ get: function () {
+ return this.query ? this.query.enabled : false
+ }, set: function (value) {
+ if (this.query)
+ this.query.enabled = value
+ }
+ }, status: {
+ get: function () {
+ return this.query ? this.query.status : MSE.Data.queryStatus.idle
+ }, set: function (value) {
+ if (this.query)
+ this.query.status = value
+ }
+ }, cookie: {
+ get: function () {
+ return this.query ? this.query.cookie : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.cookie = value
+ }
+ }, errorCode: {
+ get: function () {
+ return this.query ? this.query.errorCode : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.errorCode = value
+ }
+ }, errorObject: {
+ get: function () {
+ return this.query ? this.query.errorObject : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.errorObject = value
+ }
+ }, result: {
+ get: function () {
+ return this.query ? this.query.result : null
+ }, set: function (value) {
+ if (this.query && this.query.result)
+ this.query.result = value
+ }
+ }, totalCount: {
+ get: function () {
+ return this.query ? this.query.totalCount : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.totalCount = value
+ }
+ }, impressionGuid: {
+ get: function getImpressionGuid() {
+ return this.query ? this.query.impressionGuid : null
+ }, set: function setImpressionGuid(value) {
+ if (this.query && "impressionGuid" in this.query)
+ this.query.impressionGuid = value
+ }
+ }, acquisitionData: {
+ get: function () {
+ return this.query ? this.query.acquisitionData : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.acquisitionData = value
+ }
+ }, lastChunkedResult: {
+ get: function () {
+ return this.query ? this.query.lastChunkedResult : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.lastChunkedResult = value
+ }
+ }, resultFactory: {
+ get: function () {
+ return this.query ? this.query.resultFactory : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.resultFactory = value
+ }
+ }, resultAugmentation: {
+ get: function () {
+ return this.query ? this.query.resultAugmentation : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.resultAugmentation = value
+ }
+ }, aggregateChunks: {
+ get: function () {
+ return this.query ? this.query.aggregateChunks : false
+ }, set: function (value) {
+ if (this.query)
+ this.query.aggregateChunks = value
+ }
+ }, chunked: {
+ get: function () {
+ return this.query ? this.query.chunked : false
+ }, set: function (value) {
+ if (this.query)
+ this.query.chunked = value
+ }
+ }, chunkSize: {
+ get: function () {
+ return this.query ? this.query.chunkSize : 0
+ }, set: function (value) {
+ if (this.query)
+ this.query.chunkSize = value
+ }
+ }, currentChunk: {
+ get: function () {
+ return this.query ? this.query.currentChunk : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.currentChunk = value
+ }
+ }, nextChunk: {
+ get: function () {
+ return this.query ? this.query.nextChunk : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.nextChunk = value
+ }
+ }, previousChunk: {
+ get: function () {
+ return this.query ? this.query.previousChunk : null
+ }, set: function (value) {
+ if (this.query)
+ this.query.previousChunk = value
+ }
+ }, hasNextChunk: {
+ get: function () {
+ return this.query ? this.query.hasNextChunk : null
+ }
+ }, hasPreviousChunk: {
+ get: function () {
+ return this.query ? this.query.hasPreviousChunk : null
+ }
+ }, isLoadingFromStart: {
+ get: function () {
+ return this.query ? this.query.isLoadingFromStart : null
+ }
+ }, isDisposed: {
+ get: function () {
+ return this.query ? this.query.isDisposed : false
+ }
+ }, dispose: function dispose() {
+ if (this.query && this.autoDisposeQuery) {
+ this.query.dispose();
+ this.query = null
+ }
+ if (this._queryEvents) {
+ this._queryEvents.cancel();
+ this._queryEvents = null
+ }
+ }, execute: function execute(cookie) {
+ var result;
+ if (this.query)
+ result = this.query.execute(cookie);
+ else
+ result = WinJS.Promise.wrapError(new Error("Invalid state for executing. The query property was not set to a valid value."));
+ return result
+ }, loadPreviousChunk: function loadPreviousChunk() {
+ var result;
+ if (this.query)
+ result = this.query.loadPreviousChunk();
+ else
+ result = WinJS.Promise.wrapError(new Error("Invalid state for loading previous chunk. The query property was not set to a valid value."));
+ return result
+ }, loadNextChunk: function loadNextChunk() {
+ var result;
+ if (this.query)
+ result = this.query.loadNextChunk();
+ else
+ result = WinJS.Promise.wrapError(new Error("Invalid state for loading next chunk. The query property was not set to a valid value."));
+ return result
+ }, isValidChunk: function isValidChunk(chunk) {
+ var result;
+ if (this.query)
+ result = this.query.isValidChunk(chunk);
+ else
+ result = false;
+ return result
+ }, _notifyProxy: function _notifyProxy(name, value, oldValue) {
+ if (this._queryNotify && this.query)
+ this._queryNotify.apply(this.query, arguments);
+ this.notify(name, value, oldValue)
+ }, _queryResultChanged: function _queryResultChanged(args) {
+ if (args && args.detail)
+ this.dispatchEvent(MS.Entertainment.Data.MainQuery.events.resultChanged, {
+ sender: this, result: args.detail.result, totalCount: args.detail.totalCount, error: args.detail.error
+ })
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ DebugInstanceId: 0, PlaybackQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentationWrapperQuery", function PlaybackQuery(query) {
+ MSE.Data.AugmentationWrapperQuery.prototype.constructor.call(this, query);
+ this.debugInstanceId = ++MS.Entertainment.Data.DebugInstanceId;
+ this._logQueryActions("Creation");
+ query.debugInstanceId = this.debugInstanceId
+ }, {
+ _playbackSessionBindings: null, _hasStarted: false, _playbackOptions: null, _onLastTrackPromise: null, aggregateChunks: {
+ get: function () {
+ return false
+ }, set: function (value) { }
+ }, chunked: {
+ get: function () {
+ return false
+ }, set: function (value) { }
+ }, dispose: function dispose() {
+ if (this._onLastTrackPromise) {
+ this._onLastTrackPromise.cancel();
+ this._onLastTrackPromise = null
+ }
+ MS.Entertainment.Platform.Playback.Etw.traceString("Disposing PlaybackQuery id=" + this.debugInstanceId + ":" + (this.query ? this.query.id : "null"));
+ MSE.Data.AugmentationWrapperQuery.prototype.dispose.apply(this);
+ this._unbindPrimaryPlaybackSession();
+ this._playbackOptions = null
+ }, execute: function execute(cookie) {
+ if (this.isDisposed)
+ return;
+ this._hasStarted = false;
+ this._playbackOptions = this._getPlaybackOptions();
+ this._prepareInnerQuery();
+ var result = MSE.Data.AugmentationWrapperQuery.prototype.execute.call(this, cookie);
+ return result.then(function executeCompleted(promiseResult) {
+ this._bindPrimaryPlaybackSession();
+ return promiseResult
+ }.bind(this))
+ }, _loadNextChunk: function _loadNextChunk() {
+ if (this.isDisposed)
+ return WinJS.Promise.as();
+ this._prepareInnerQuery();
+ var result = MSE.Data.AugmentationWrapperQuery.prototype.loadNextChunk.call(this);
+ return result.then(function (promiseResult) {
+ var list = this._getChunkDestination();
+ var options = this._getPlaybackOptions();
+ if (list && !this.isDisposed && this._playbackOptions.smartDJSeed === options.smartDJSeed)
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(list, this._playbackOptions);
+ else if (!this.isDisposed)
+ this.dispose();
+ return promiseResult
+ }.bind(this))
+ }, _bindPrimaryPlaybackSession: function _bindPrimaryPlaybackSession() {
+ if (this._playbackSessionBindings || this.isDisposed)
+ return;
+ var sessionId = MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionManager && sessionManager.primarySession && sessionManager.primarySession.sessionId === sessionId) {
+ this._playbackSessionBindings = WinJS.Binding.bind(sessionManager.primarySession, {
+ currentTransportState: this._onCurrentTransportStateChanged.bind(this), mediaCollection: this._onMediaCollectionChanged.bind(this)
+ });
+ this._sessionEventHandlers = MS.Entertainment.Utilities.addEvents(sessionManager.primarySession, {
+ sessionStateChanged: this._onCurrentSessionStateChanged.bind(this), lastTrackPlayingChanged: this._onLastTrackPlayingChanged.bind(this)
+ })
+ }
+ }, _unbindPrimaryPlaybackSession: function _unbindPrimaryPlaybackSession() {
+ if (this._playbackSessionBindings) {
+ this._playbackSessionBindings.cancel();
+ this._playbackSessionBindings = null
+ }
+ if (this._sessionEventHandlers) {
+ this._sessionEventHandlers.cancel();
+ this._sessionEventHandlers = null
+ }
+ }, _onMediaCollectionChanged: function _onMediaCollectionChanged(newValue) {
+ if (this._playbackSessionBindings && this._hasStarted && newValue)
+ this.dispose()
+ }, _onCurrentTransportStateChanged: function _onCurrentTransportStateChanged(newValue) {
+ if (this._playbackSessionBindings && !this._hasStarted && newValue !== MS.Entertainment.Platform.Playback.TransportState.starting) {
+ this._hasStarted = newValue !== MS.Entertainment.Platform.Playback.TransportState.stopped;
+ if (this._hasStarted)
+ this._logQueryActions("Started")
+ }
+ }, _onLastTrack: function onLastTrack() {
+ var pagedPromise = WinJS.Promise.as();
+ if (this.isDisposed || !this._playbackSessionBindings)
+ return pagedPromise;
+ var sessionManager = this._getValidSessionManager();
+ if (sessionManager) {
+ var networkReleaseHandle = null;
+ pagedPromise = sessionManager.requestNetworkAndDelay("PlaybackQuery").then(function onNetworkAcquired(result) {
+ if (result) {
+ networkReleaseHandle = result;
+ return this._loadNextChunk()
+ }
+ }.bind(this)).then(null, function ignoreError() { }).then(function onLoadComplete() {
+ if (networkReleaseHandle)
+ networkReleaseHandle.release();
+ this._onLastTrackPromise = null
+ }.bind(this))
+ }
+ return pagedPromise
+ }, _pageMoreData: function _pageMoreData() {
+ if (this._onLastTrackPromise)
+ this._onLastTrackPromise.cancel();
+ this._onLastTrackPromise = MS.Entertainment.Utilities.schedulePromiseNormal().then(this._onLastTrack.bind(this), function (err) { })
+ }, _onCurrentSessionStateChanged: function _onCurrentPlayerSSessionChanged(event) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("Query.js: session state: " + event.detail.newValue);
+ if (this.isDisposed || !this._sessionEventHandlers)
+ return;
+ var sessionManager = this._getValidSessionManager();
+ var state = event.detail.newValue;
+ if (state === MS.Entertainment.Platform.Playback.SessionState.endedWithError || state === MS.Entertainment.Platform.Playback.SessionState.ended)
+ this._pageMoreData()
+ }, _onLastTrackPlayingChanged: function _onLastTrackPlayingChangedChanged(event) {
+ if (this.isDisposed || !this._sessionEventHandlers)
+ return;
+ var lastTrackPlaying = event.detail.newValue;
+ if (lastTrackPlaying)
+ this._pageMoreData()
+ }, _getValidSessionManager: function _getValidSessionManager() {
+ var sessionId = MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (!sessionManager || !sessionManager.primarySession || sessionManager.primarySession.sessionId !== sessionId || !sessionManager.primarySession.mediaCollection)
+ sessionManager = null;
+ return sessionManager
+ }, _prepareInnerQuery: function _prepareInnerQuery() {
+ if (this.query)
+ this.query.aggregateChunks = false
+ }, _getPlaybackOptions: function _getPlaybackOptions() {
+ var sessionId = MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.primarySession || {};
+ return {
+ autoPlay: true, preservePlayContext: true, queueMedia: true, smartDJSeed: playbackSession.smartDJSeed, sessionId: sessionId
+ }
+ }, _getChunkDestination: function _getChunkDestination() {
+ var result = null;
+ if (this.query)
+ result = this.query._getChunkDestination();
+ return result
+ }
+ }), ModelQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function () {
+ MSE.Data.AugmentQuery.prototype.constructor.apply(this, arguments)
+ }, {
+ _innerQuery: null, chunkSize: 0, currentIndex: {
+ get: function () {
+ return ((this.currentChunk && typeof this.currentChunk.startIndex === "number") ? this.currentChunk.startIndex : 0)
+ }
+ }, createModel: function createModel(startIndex, count) {
+ return null
+ }, createAsyncModel: function createAsyncModel(startIndex, count) {
+ return null
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ return MSE.Data.queryStatus.processingData
+ }, _startInnerExecute: function _startInnerExecute() {
+ var that = this;
+ var requestPromise,
+ model;
+ var asyncModel = this.createAsyncModel(this.currentIndex, this.chunkSize);
+ if (asyncModel)
+ requestPromise = asyncModel;
+ else {
+ model = this.createModel(this.currentIndex, this.chunkSize);
+ if (model)
+ requestPromise = WinJS.Promise.wrap(model)
+ }
+ if (!requestPromise)
+ requestPromise = WinJS.Promise.wrapError(this);
+ return requestPromise
+ }, _getChunkResultSize: function _getChunkResultSize(result) {
+ return (result && result.items && result.items.source) ? result.items.source.length : 0
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ var resultSize = this._getChunkResultSize(result);
+ var chunk = null;
+ if (resultSize && this.chunkSize && resultSize >= this.chunkSize)
+ chunk = { startIndex: this.currentIndex + resultSize };
+ return chunk
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ var resultSize = this._getChunkResultSize(result);
+ var chunk = null;
+ if (resultSize && this.currentIndex > this.chunkSize && this.chunkSize)
+ chunk = { startIndex: this.currentIndex + resultSize };
+ return chunk
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ QueryDebugger: MS.Entertainment.UI.Framework.define(null, {}, {
+ queryType: {
+ image: "image", service: "service", database: "database"
+ }, logQuery: (function () {
+ return function logQuery() { }
+ })()
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/keyboardnavigationmanager.js:22781 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ KeyboardNavigationManager: MS.Entertainment.UI.Framework.define(function KeyboardNavigationManager(element, scroller, setTabIndex) {
+ this._element = element;
+ this._scroller = scroller || element;
+ this._setTabIndex = setTabIndex;
+ if (!MS.Entertainment.Utilities.isApp2)
+ this._element.addEventListener("keydown", this._handleKeyInput.bind(this));
+ this._element.addEventListener("focusout", this._handleBlur.bind(this));
+ this._element.addEventListener("focusin", this._handleFocus.bind(this))
+ }, {
+ _element: null, _scroller: null, _focusStyleClass: "acc-keyboardFocusTarget", _setTabIndex: null, _itemWithTabIndex: null, _currentlyFocusedItem: null, _handleKeyInput: function _handleKeyInput(e) {
+ if (MS.Entertainment.Framework.KeyboardNavigationManager._validKeys.indexOf(e.keyCode) === -1 || this.doesElementSupportKeyboardInput(document.activeElement, e.keyCode))
+ return;
+ if (e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space) {
+ this._handleClick(e);
+ return
+ }
+ var initialResults = this._element.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ var initialItemAvailable = true;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTarget(currentInitialItem))
+ results.push(currentInitialItem)
+ }
+ if (results.length < 1)
+ return;
+ if (!this._currentlyFocusedItem) {
+ initialItemAvailable = false;
+ for (var i = 0; i < results.length; i++)
+ if (MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ this._currentlyFocusedItem = results[i];
+ break
+ }
+ }
+ var currentItemOffset = {
+ left: 0, top: 0
+ };
+ if (!this._currentlyFocusedItem && (e.keyCode !== WinJS.Utilities.Key.home && e.keyCode !== WinJS.Utilities.Key.end))
+ return;
+ else
+ currentItemOffset = MS.Entertainment.Utilities.getRelativeOffset(this._currentlyFocusedItem, this._element);
+ var checkElementOffset;
+ var checkElementRight;
+ var checkElementBottom;
+ var currentClosest = null;
+ var currentEdge;
+ var currentItemCheck = null;
+ var currentBestItemCheck = null;
+ if ((initialItemAvailable && currentItemOffset) || (e.keyCode === WinJS.Utilities.Key.home) || (e.keyCode === WinJS.Utilities.Key.end))
+ if (results.length === 1 && !e.ctrlKey)
+ currentClosest = { element: results[0] };
+ else if (e.keyCode === WinJS.Utilities.Key.leftArrow && !e.ctrlKey) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left > checkElementOffset.left)
+ if (currentClosest) {
+ if (currentItemOffset.left - checkElementOffset.left > currentItemOffset.left - currentClosest.left)
+ continue;
+ currentItemCheck = Math.abs(checkElementRight - currentItemOffset.left);
+ currentBestItemCheck = Math.abs(currentClosest.right - currentItemOffset.left);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow && !e.ctrlKey) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (checkElementOffset.left >= currentEdge)
+ if (currentClosest) {
+ if (checkElementOffset.left - currentEdge > currentClosest.left - currentEdge)
+ continue;
+ currentItemCheck = Math.abs(checkElementOffset.left - currentEdge);
+ currentBestItemCheck = Math.abs(currentClosest.left - currentEdge);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.downArrow) {
+ currentEdge = this._currentlyFocusedItem.clientHeight + currentItemOffset.top;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementBottom = checkElementOffset.top + results[i].clientHeight;
+ if (checkElementBottom > currentEdge)
+ if (currentClosest) {
+ if (checkElementBottom - currentEdge > currentClosest.bottom - currentEdge)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left < currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.upArrow) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && currentItemOffset.top > checkElementOffset.top)
+ if (currentClosest) {
+ if (currentItemOffset.top - checkElementOffset.top > currentItemOffset.top - currentClosest.top)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left <= currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.home) {
+ currentClosest = { element: results[0] };
+ if (this._scroller)
+ this._scroller.scrollLeft = 0
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.end) {
+ currentClosest = { element: results[results.length - 1] };
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollWidth
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageDown) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && checkElementOffset.left - currentEdge >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = { element: results[i] };
+ break
+ }
+ }
+ if (!currentClosest)
+ currentClosest = { element: results[results.length - 1] }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageUp) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left - checkElementRight >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = { element: results[i] };
+ break
+ }
+ }
+ }
+ if (!currentClosest)
+ currentClosest = { element: results[0] }
+ }
+ if (currentClosest && currentClosest.element)
+ this.setFocusedItem(currentClosest.element, true);
+ else if (this._currentlyFocusedItem)
+ this.setFocusedItem(this._currentlyFocusedItem, true);
+ e.preventDefault()
+ }, doesElementSupportKeyboardInput: function doesElementSupportKeyboardInput(element, keyCode) {
+ return MS.Entertainment.Utilities.doesElementSupportKeyboardInput(element)
+ }, getFocusedItem: function getFocusedItem() {
+ if (!this._currentlyFocusedItem)
+ this.focusFirstItemInContainer(this._element);
+ return this._currentlyFocusedItem
+ }, getTabIndexedItem: function getTabIndexedItem() {
+ return this._itemWithTabIndex
+ }, setFocusedItem: function setFocusedItem(item, setStyle, skipSettingFocus, skipScroll) {
+ if (item) {
+ this._setInternalFocusState(item, setStyle);
+ if (!skipSettingFocus && this._currentlyFocusedItem)
+ MS.Entertainment.UI.Framework.focusElement(this._currentlyFocusedItem, skipScroll)
+ }
+ }, _setInternalFocusState: function _setInternalFocusState(item, setStyle) {
+ if (item) {
+ if (this._currentlyFocusedItem)
+ WinJS.Utilities.removeClass(this._currentlyFocusedItem, this._focusStyleClass);
+ this._currentlyFocusedItem = item;
+ if (this._currentlyFocusedItem && setStyle)
+ WinJS.Utilities.addClass(this._currentlyFocusedItem, this._focusStyleClass);
+ if (this._setTabIndex)
+ this.setTabIndexedItem(this._currentlyFocusedItem)
+ }
+ }, setTabIndexedItem: function setTabIndexedItem(element) {
+ if (this._itemWithTabIndex)
+ this._itemWithTabIndex.setAttribute("tabindex", -1);
+ if (element) {
+ element.setAttribute("tabindex", "0");
+ this._itemWithTabIndex = element
+ }
+ }, getFocusableChildren: function getFocusableChildren() {
+ return WinJS.Utilities.query(".win-focusable", this._element) || []
+ }, focusFirstItemInContainer: function focusFirstItemInContainer(container, setStyle, skipSettingFocus, skipScroll) {
+ if (container && MS.Entertainment.UI.Framework.canMoveFocus(container)) {
+ var initialResults = container.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTarget(currentInitialItem)) {
+ this.setFocusedItem(currentInitialItem, setStyle, skipSettingFocus, skipScroll);
+ break
+ }
+ }
+ }
+ }, _checkItemValidTarget: function _checkItemValidTarget(item) {
+ if (item) {
+ var disabledAttribute = item.getAttribute("disabled");
+ return item.currentStyle && item.currentStyle.visibility !== "hidden" && item.currentStyle.display !== "none" && disabledAttribute !== "disabled" && disabledAttribute !== "" && item.clientHeight !== 0 && item.clientWidth !== 0
+ }
+ else
+ return false
+ }, _handleClick: function _handleClick(e) {
+ if (this._currentlyFocusedItem && this._currentlyFocusedItem.click && this._checkItemValidTarget(this._currentlyFocusedItem) && e.target && e.target.tagName && e.target.tagName.toLowerCase() !== "button") {
+ this._currentlyFocusedItem.click();
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }, _handleBlur: function _handleBlur(e) {
+ if (this._currentlyFocusedItem && document.activeElement !== this._currentlyFocusedItem) {
+ WinJS.Utilities.removeClass(this._currentlyFocusedItem, this._focusStyleClass);
+ this._currentlyFocusedItem = null
+ }
+ }, _handleFocus: function _handleFocus(e) {
+ var tryFocus = this._currentlyFocusedItem !== document.activeElement;
+ if (tryFocus) {
+ var listViews = this._element.querySelectorAll(".win-listview");
+ for (var i = 0; i < listViews.length; i++)
+ if (listViews[i].contains(document.activeElement)) {
+ tryFocus = false;
+ break
+ }
+ }
+ if (tryFocus)
+ this._setInternalFocusStateFromActiveElement()
+ }, _setInternalFocusStateFromActiveElement: function _setInternalFocusStateFromActiveElement() {
+ if (document.activeElement && WinJS.Utilities.hasClass(document.activeElement, "win-focusable"))
+ this._setInternalFocusState(document.activeElement, true)
+ }
+ }, { _validKeys: [WinJS.Utilities.Key.leftArrow, WinJS.Utilities.Key.rightArrow, WinJS.Utilities.Key.upArrow, WinJS.Utilities.Key.downArrow, WinJS.Utilities.Key.home, WinJS.Utilities.Key.end, WinJS.Utilities.Key.pageDown, WinJS.Utilities.Key.pageUp, WinJS.Utilities.Key.enter, WinJS.Utilities.Key.space, WinJS.Utilities.Key.g] })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ OnScreenKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function OnScreenKeyboardNavigationManager(element, scroller, setTabIndex) {
+ this.base(element, scroller, setTabIndex)
+ }, {
+ setFocusedItem: function setFocusedItem(item, setStyle, skipSettingFocus) {
+ if (!item || !(MS.Entertainment.Utilities.isElementInViewportOfParent(item, this._scroller)))
+ return;
+ this._setInternalFocusState(item, setStyle);
+ if (!skipSettingFocus && this._currentlyFocusedItem)
+ MS.Entertainment.UI.Framework.focusElement(this._currentlyFocusedItem)
+ }
+ }, null)
+ });
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ VerticalKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function VerticalKeyboardNavigationManager(element, scroller, setTabIndex) {
+ this._element = element;
+ this._scroller = scroller || element;
+ this._setTabIndex = setTabIndex;
+ if (!MS.Entertainment.Utilities.isApp2)
+ this._element.addEventListener("keydown", this._handleKeyInput.bind(this));
+ this._element.addEventListener("focusout", this._handleBlur.bind(this));
+ this._element.addEventListener("focusin", this._handleFocus.bind(this))
+ }, {
+ _handleKeyInput: function _handleKeyInput(e) {
+ if (MS.Entertainment.Framework.KeyboardNavigationManager._validKeys.indexOf(e.keyCode) === -1 || MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement))
+ return;
+ if (e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space) {
+ this._handleClick(e);
+ return
+ }
+ var initialResults = this._element.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ var initialItemAvailable = true;
+ var currentIndex = 0;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTarget(currentInitialItem))
+ results.push(currentInitialItem)
+ }
+ if (results.length < 1)
+ return;
+ if (!this._currentlyFocusedItem) {
+ initialItemAvailable = false;
+ for (var i = 0; i < results.length; i++)
+ if (MS.Entertainment.Utilities.isElementInVerticalViewportOfParent(results[i], this._scroller)) {
+ this._currentlyFocusedItem = results[i];
+ break
+ }
+ }
+ currentIndex = results.indexOf(this._currentlyFocusedItem);
+ if (!this._currentlyFocusedItem && (e.keyCode !== WinJS.Utilities.Key.home && e.keyCode !== WinJS.Utilities.Key.end) || currentIndex < 0)
+ return;
+ var currentClosest = null;
+ if (initialItemAvailable || (e.keyCode === WinJS.Utilities.Key.home) || (e.keyCode === WinJS.Utilities.Key.end))
+ if (results.length === 1 && !e.ctrlKey)
+ currentClosest = { element: results[0] };
+ else if (e.keyCode === WinJS.Utilities.Key.downArrow) {
+ if (currentIndex < results.length - 1)
+ currentClosest = { element: results[currentIndex + 1] }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.upArrow) {
+ if (currentIndex > 0)
+ currentClosest = { element: results[currentIndex - 1] }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.home) {
+ currentClosest = { element: results[0] };
+ if (this._scroller)
+ this._scroller.scrollLeft = 0
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.end) {
+ currentClosest = { element: results[results.length - 1] };
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollWidth
+ }
+ if (currentClosest && currentClosest.element)
+ this.setFocusedItem(currentClosest.element, true);
+ else if (this._currentlyFocusedItem)
+ this.setFocusedItem(this._currentlyFocusedItem, true);
+ e.preventDefault()
+ }
+ }, null), FormKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function FormKeyboardNavigationManager(element, scroller) {
+ this.base(element, scroller, true);
+ var focusableChildern = this.getFocusableChildren();
+ if (focusableChildern.length)
+ this._setInternalFocusState(focusableChildern[0], true)
+ }, {
+ doesElementSupportKeyboardInput: function doesElementSupportKeyboardInput(element, keyCode) {
+ var supportsInput = false;
+ var tagName = element && element.tagName;
+ var isMultiLine = element && element.isMultiLine;
+ if ((tagName !== "INPUT") || (isMultiLine) || (keyCode !== WinJS.Utilities.Key.downArrow && keyCode !== WinJS.Utilities.Key.upArrow))
+ supportsInput = MS.Entertainment.Utilities.doesElementSupportKeyboardInput(element);
+ return supportsInput
+ }, setFocusedItem: function setFocusedItem(item, setStyle, skipSettingFocus, skipScroll) {
+ MS.Entertainment.Framework.KeyboardNavigationManager.prototype.setFocusedItem.call(this, item, setStyle, true, skipScroll);
+ if (item && !skipSettingFocus && this._currentlyFocusedItem)
+ MS.Entertainment.UI.Framework.focusElement(this._currentlyFocusedItem, skipScroll, true)
+ }, setTabIndexedItem: function setTabIndexedItem(element) {
+ if (this._itemWithTabIndex) {
+ var inputs = WinJS.Utilities.query("input,select", this._itemWithTabIndex) || [];
+ inputs.forEach(function (child) {
+ child.setAttribute("tabindex", "-1")
+ })
+ }
+ MS.Entertainment.Framework.KeyboardNavigationManager.prototype.setTabIndexedItem.call(this, element);
+ if (this._itemWithTabIndex) {
+ this._itemWithTabIndex.setAttribute("tabindex", "-1");
+ var inputs = WinJS.Utilities.query("input,select", this._itemWithTabIndex) || [];
+ inputs.forEach(function (child) {
+ child.setAttribute("tabindex", "0")
+ })
+ }
+ }, _setInternalFocusStateFromActiveElement: function _setInternalFocusStateFromActiveElement() {
+ if (document.activeElement)
+ if (WinJS.Utilities.hasClass(document.activeElement, "win-focusable"))
+ this._setInternalFocusState(document.activeElement, true);
+ else if (this._element.contains(document.activeElement)) {
+ var focusableChildern = this.getFocusableChildren();
+ var focusableChild;
+ for (var j = 0; j < focusableChildern.length; j++) {
+ focusableChild = focusableChildern[j];
+ if (focusableChild.contains(document.activeElement)) {
+ this._setInternalFocusState(focusableChild, true);
+ break
+ }
+ }
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ DashboardKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function DashboardKeyboardNavigationManager(element, scroller, setTabIndex) {
+ this._element = element;
+ this._scroller = scroller || element;
+ this._setTabIndex = setTabIndex;
+ if (!MS.Entertainment.Utilities.isApp2)
+ this._element.addEventListener("keydown", this._handleKeyInput.bind(this));
+ this._element.addEventListener("focusout", this._handleBlur.bind(this));
+ this._element.addEventListener("focusin", this._handleFocus.bind(this))
+ }, {
+ _pivotsFocused: false, _handleKeyInput: function _handleKeyInput(e) {
+ if (MS.Entertainment.Framework.KeyboardNavigationManager._validKeys.indexOf(e.keyCode) === -1 || MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement))
+ return;
+ if (e.ctrlKey && e.altKey && e.keyCode === WinJS.Utilities.Key.g)
+ if (this._currentlyFocusedItem)
+ if (this._currentlyFocusedItem.getAttribute("data-ent-panelHeader") === "true" && this._currentlyFocusedItem.click)
+ this._currentlyFocusedItem.click();
+ else {
+ this._focusNearestPanelHeader(this._currentlyFocusedItem, true);
+ if (this._currentlyFocusedItem.getAttribute("data-ent-panelHeader") === "true")
+ this._handleClick(e)
+ }
+ if (e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space) {
+ this._handleClick(e);
+ return
+ }
+ if ((e.keyCode !== WinJS.Utilities.Key.home) && (e.keyCode !== WinJS.Utilities.Key.end) && this._currentlyFocusedItem && this._currentlyFocusedItem.getAttribute("data-ent-panelHeader") === "true")
+ if (e.keyCode === WinJS.Utilities.Key.downArrow)
+ this._focusFirstItemInPanelBody(this._currentlyFocusedItem, true);
+ else {
+ var initialPivotsResults = this._element.querySelectorAll("[data-ent-panelheader='true']");
+ var pivotsResults = [];
+ var initialItemIndex;
+ for (var j = 0; j < initialPivotsResults.length; j++) {
+ currentInitialItem = initialPivotsResults[j];
+ if (this._checkItemValidTarget(currentInitialItem))
+ pivotsResults.push(currentInitialItem)
+ }
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ pivotsResults.reverse();
+ initialItemIndex = pivotsResults.indexOf(this._currentlyFocusedItem);
+ if (pivotsResults.length > 0 && initialItemIndex >= 0)
+ if (e.keyCode === WinJS.Utilities.Key.leftArrow && !e.ctrlKey) {
+ if (initialItemIndex > 0)
+ this.setFocusedItem(pivotsResults[initialItemIndex - 1], true)
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow && !e.ctrlKey)
+ if (initialItemIndex < pivotsResults.length - 1)
+ this.setFocusedItem(pivotsResults[initialItemIndex + 1], true)
+ }
+ else {
+ var initialResults = this._element.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ var initialItemAvailable = true;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTargetNoPivot(currentInitialItem))
+ results.push(currentInitialItem)
+ }
+ if (results.length < 1)
+ return;
+ if (!this._currentlyFocusedItem) {
+ initialItemAvailable = false;
+ for (var i = 0; i < results.length; i++)
+ if (MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ this._currentlyFocusedItem = results[i];
+ break
+ }
+ }
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ results.reverse();
+ var currentItemOffset = {
+ left: 0, top: 0
+ };
+ if (!this._currentlyFocusedItem && (e.keyCode !== WinJS.Utilities.Key.home && e.keyCode !== WinJS.Utilities.Key.end))
+ return;
+ else
+ currentItemOffset = MS.Entertainment.Utilities.getRelativeOffset(this._currentlyFocusedItem, this._element);
+ var checkElementOffset;
+ var checkElementRight;
+ var checkElementBottom;
+ var currentClosest = null;
+ var currentEdge;
+ var currentItemCheck = null;
+ var currentBestItemCheck = null;
+ var goingUp = false;
+ if ((initialItemAvailable && currentItemOffset) || (e.keyCode === WinJS.Utilities.Key.home) || (e.keyCode === WinJS.Utilities.Key.end))
+ if (results.length === 1 && !e.ctrlKey)
+ currentClosest = { element: results[0] };
+ else if (e.keyCode === WinJS.Utilities.Key.leftArrow && !e.ctrlKey) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left > checkElementOffset.left)
+ if (currentClosest) {
+ if (currentItemOffset.left - checkElementOffset.left > currentItemOffset.left - currentClosest.left)
+ continue;
+ currentItemCheck = Math.abs(checkElementRight - currentItemOffset.left);
+ currentBestItemCheck = Math.abs(currentClosest.right - currentItemOffset.left);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow && !e.ctrlKey) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (checkElementOffset.left > currentEdge)
+ if (currentClosest) {
+ if (checkElementOffset.left - currentEdge > currentClosest.left - currentEdge)
+ continue;
+ currentItemCheck = Math.abs(checkElementOffset.left - currentEdge);
+ currentBestItemCheck = Math.abs(currentClosest.left - currentEdge);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.downArrow) {
+ currentEdge = this._currentlyFocusedItem.clientHeight + currentItemOffset.top;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementBottom = checkElementOffset.top + results[i].clientHeight;
+ if (checkElementBottom > currentEdge)
+ if (currentClosest) {
+ if (checkElementBottom - currentEdge > currentClosest.bottom - currentEdge)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left <= currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.upArrow) {
+ goingUp = true;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && currentItemOffset.top > checkElementOffset.top)
+ if (currentClosest) {
+ if (currentItemOffset.top - checkElementOffset.top > currentItemOffset.top - currentClosest.top)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left <= currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.home) {
+ currentClosest = { element: results[0] };
+ if (this._scroller)
+ this._scroller.scrollLeft = 0
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.end) {
+ currentClosest = { element: results[results.length - 1] };
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollWidth
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageDown) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && checkElementOffset.left - currentEdge >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = { element: results[i] };
+ break
+ }
+ }
+ if (!currentClosest)
+ currentClosest = { element: results[results.length - 1] }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageUp) {
+ for (var i = results.length - 1; i >= 0; i--)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left - checkElementRight >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = { element: results[i] };
+ break
+ }
+ }
+ }
+ if (!currentClosest)
+ currentClosest = { element: results[0] }
+ }
+ }
+ if (currentClosest && currentClosest.element)
+ this.setFocusedItem(currentClosest.element, true);
+ else if (goingUp)
+ this._focusNearestPanelHeader(this._currentlyFocusedItem, true);
+ else if (this._currentlyFocusedItem)
+ this.setFocusedItem(this._currentlyFocusedItem, true);
+ e.preventDefault()
+ }, _findParentContainer: function _findParentContainer(item) {
+ var ancestor = item;
+ var container = null;
+ do {
+ if (ancestor.domElement)
+ ancestor = ancestor.domElement;
+ if (ancestor.getAttribute("data-ent-dashboardpanel") === "true") {
+ container = ancestor;
+ break
+ }
+ ancestor = ancestor.parentNode
+ } while (ancestor);
+ return container
+ }, _focusNearestPanelHeader: function _focusNearestPanelHeader(item, setStyle) {
+ var container = this._findParentContainer(item);
+ var panelHeader;
+ if (container)
+ this.focusFirstItemInContainer(container.querySelector(".panelTitle"), setStyle)
+ }, _focusFirstItemInPanelBody: function _focusFirstItemInPanelBody(item, setStyle) {
+ var container = this._findParentContainer(item);
+ var panelHeader;
+ if (container)
+ this.focusFirstItemInContainer(container.querySelector(".panelContainer"), setStyle)
+ }, _checkItemValidTargetNoPivot: function _checkItemValidTargetNoPivot(item) {
+ if (item) {
+ var disabledAttribute = item.getAttribute("disabled");
+ var pivotAttribute = item.getAttribute("data-ent-panelheader");
+ return item.currentStyle && pivotAttribute !== "true" && item.currentStyle.visibility !== "hidden" && item.currentStyle.display !== "none" && disabledAttribute !== "disabled" && disabledAttribute !== "" && item.clientHeight !== 0 && item.clientWidth !== 0
+ }
+ else
+ return false
+ }
+ }, null)
+ })
+ })()
+})();
+/* >>>>>>/framework/querywatcher.js:23464 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ QueryWatcher: MS.Entertainment.defineObservable(function QueryWatcher(moniker) {
+ this._moniker = moniker;
+ this._queries = []
+ }, {
+ _firstQueryLogged: false, _moniker: null, _queries: null, autoClear: true, lowestStatus: MS.Entertainment.Data.queryStatus.idle, registerQuery: function registerQuery(query) {
+ if (query !== null) {
+ this._checkAndFireInitialEvent();
+ var that = this;
+ var callback = function statusChangeCallback(status) {
+ var i;
+ var currentStatus;
+ var newLowestStatus = MS.Entertainment.Data.queryStatus.max;
+ var fireCompletedEvent = true;
+ for (i = 0; i < that._queries.length; i++) {
+ currentStatus = that._queries[i].savedQuery.status;
+ if (currentStatus < newLowestStatus)
+ newLowestStatus = currentStatus;
+ if (currentStatus < MS.Entertainment.Data.queryStatus.completed)
+ fireCompletedEvent = false
+ }
+ that.lowestStatus = newLowestStatus;
+ if (fireCompletedEvent) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceQueries_Complete(that._moniker);
+ if (that.autoClear)
+ that.clearQueries()
+ }
+ };
+ this._queries.push({
+ savedQuery: query, savedCallback: callback
+ });
+ query.bind("status", callback)
+ }
+ }, _checkAndFireInitialEvent: function _checkAndFireInitialEvent() {
+ if (!this._firstQueryLogged) {
+ this._firstQueryLogged = true;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceQueries_Begin(this._moniker)
+ }
+ }, clearQueries: function clearQueries() {
+ var i = this._queries.length;
+ for (i = 0; i < this._queries.length; i++)
+ this._queries[i].savedQuery.unbind("status", this._queries[i].savedCallback);
+ this._queries.length = 0;
+ this._firstQueryLogged = false
+ }
+ }, null)
+ })
+ })()
+})();
+/* >>>>>>/framework/actionidentifiers.js:23519 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions.ActionIdentifiers", {
+ actionPassThrough: "actionPassThrough", addArtistToNowPlaying: "addArtistToNowPlaying", addTo: "addTo", addToNowPlaying: "addToNowPlaying", addToPlaylist: "addToPlaylist", addRemoveItemWatchlist: "addRemoveItemWatchlist", albumDetailsNavigate: "albumDetailsNavigate", albumDeviceDetailsNavigate: "albumDeviceDetailsNavigate", albumPurchase: "albumPurchase", artistMediaNavigate: "artistMediaNavigate", artistDetailsNavigate: "artistDetailsNavigate", collectionNavigate: "collectionNavigate", copy: "copy", createPlaylist: "createPlaylist", deepLinkConfigureMemoryLeakTracking: "deepLinkConfigureMemoryLeakTracking", deepLinkLocation: "deepLinkLocation", deepLinkSearch: "deepLinkSearch", deepLinkDetails: "deepLinkDetails", deepLinkPlay: "deepLinkPlay", deepLinkPlayPin: "deepLinkPlayPin", deepLinkPlayTo: "deepLinkPlayTo", deepLinkLaunchTitle: "deepLinkLaunchTitle", deepLinkLaunchFeedbackFlyout: "deepLinkLaunchFeedbackFlyout", deepLinkShowPerfTrackLog: "deepLinkShowPerfTrackLog", deeplinkSetDlna: "deeplinkSetDlna", deeplinkTunerConfig: "deeplinkTunerConfig", deepLinkVideoProtocolConverter: "deepLinkVideoProtocolConverter", deepLinkXBLDefault: "deepLinkXBLDefault", deepLinkXBLDetails: "deepLinkXBLDetails", deepLinkXBLPlayback: "deepLinkXBLPlayback", deleteMedia: "deleteMedia", deleteSmartDJ: "deleteSmartDJ", depthGalleryNavigate: "depthGalleryNavigate", disabled: "disabled", download: "download", downloadAgain: "downloadAgain", downloadCancel: "downloadCancel", downloadPause: "downloadPause", downloadResume: "downloadResume", downloadRemove: "downloadRemove", downloadSeason: "downloadSeason", downloadDemo: "downloadDemo", editMetadata: "editMetadata", editMetadataImage: "editMetadataImage", editMetadataMatchAlbumInfo: "editMetadataMatchAlbumInfo", exploreHubNavigate: "exploreHubNavigate", externalNavigate: "externalNavigate", externalAdNavigate: "externalAdNavigate", featuredSetsNavigate: "featuredSetsNavigate", findAlbumInfo: "findAlbumInfo", flexHubNavigate: "flexHubNavigate", genericPlay: "genericPlay", importPlaylists: "importPlaylists", invoke: "invoke", invokeGlobalCommand: "invokeGlobalCommand", launchApp: "launchApp", launchHelpApp: "launchHelpApp", launchInteractiveApp: "launchInteractiveApp", manageFolders: "manageFolders", mediaItemDetailsNavigate: "mediaItemDetailsNavigate", mediaStatusSubscriptionSignupAction: "mediaStatusSubscriptionSignupAction", more: "more", moveListItemDown: "moveListItemDown", moveListItemToBottom: "moveListItemToBottom", moveListItemToTop: "moveListItemToTop", moveListItemUp: "moveListItemUp", musicCollectionNavigate: "musicCollectionNavigate", musicDeepLinkDetails: "musicDeepLinkDetails", musicDeepLinkLocation: "musicDeepLinkLocation", musicPinToStartPlayAndNavigate: "musicPinToStartPlayAndNavigate", navigate: "navigate", navigateToDefault: "navigateToDefault", navigateToVideoDetails: "navigateToVideoDetails", newMusicMarketplaceNavigate: "newMusicMarketplaceNavigate", notificationClear: "notificationClear", nowPlayingNavigate: "nowPlayingNavigate", openAbout: "openAbout", openFeedbackDialog: "openFeedbackDialog", openFile: "openFile", pickPlaylist: "pickPlaylist", pinMediaItem: "pinMediaItem", pinToStartScreen: "pinToStartScreen", playAll: "playAll", playArtist: "playArtist", playFreeOffer: "playFreeOffer", playMedia: "playMedia", playPlaylist: "playPlaylist", playQuery: "playQuery", playSmartDJ: "playSmartDJ", playOnXbox: "playOnXbox", playlistDetailsNavigate: "playlistDetailsNavigate", purchase: "purchase", purchaseSubscriptionOffer: "purchaseSubscriptionOffer", radioNavigate: "radioNavigate", readerAction: "readerAction", refreshCollection: "refreshCollection", renamePlaylist: "renamePlaylist", removeFromPlaybackSession: "removeFromPlaybackSession", removeFromList: "removeFromList", removeFromPlaylist: "removeFromPlaylist", repeatNowPlaying: "repeatNowPlaying", resetSearchFilter: "resetSearchFilter", resetSearchHub: "resetSearchHub", restorePurchases: "restorePurchases", saveNowPlayingPlaylist: "saveNowPlayingPlaylist", search: "search", searchByContext: "searchByContext", searchArtist: "searchArtist", searchResultsNavigate: "searchResultsNavigate", selectArtist: "selectArtist", selectPlaylist: "selectPlaylist", setBackgroundImage: "setBackgroundImage", share: "share", shiftDashboard: "shiftDashboard", shuffleNowPlaying: "shuffleNowPlaying", showAccountPicker: "showAccountPicker", showFindFriendsFlyout: "showFindFriendsFlyout", showItemDetails: "showItemDetails", showImmersiveDetails: "showImmersiveDetails", showActivityOverlay: "showActivityOverlay", showLocalGrovelInfoDialog: "showLocalGrovelInfoDialog", showMusicVideoContextualAppbar: "showMusicVideoContextualAppbar", showPlaylistItemInformation: "showPlaylistItemInformation", showTrackContextualAppbar: "showTrackContextualAppbar", showSwitcherOverlay: "showSwitcherOverlay", showVideoDownloadManager: "showVideoDownloadManager", showWebHostDialog: "showWebHostDialog", showPopOver: "showPopOver", shuffleAllMusic: "shuffleAllMusic", signIn: "signIn", signInRequiredNavigate: "signInRequiredNavigate", signInAndOnlineRequiredNavigate: "signInAndOnlineRequiredNavigate", signOut: "signOut", skipBackward: "skipBackward", skipForward: "skipForward", studiosAndNetworksGalleryNavigate: "studiosAndNetworksGalleryNavigate", subscriptionAddToMyMusic: "subscriptionAddToMyMusic", subscriptionDownload: "subscriptionDownload", subscriptionSignup: "subscriptionSignup", subscriptionWithSignIn: "subscriptionWithSignIn", switchVideoDefinition: "switchVideoDefinition", toggleMusicVideoPlayback: "toggleMusicVideoPlayback", topMusicMarketplaceNavigate: "topMusicMarketplaceNavigate", trackPurchase: "trackPurchase", switchLanguage: "switchLanguage", unpinFromStartScreen: "unpinFromStartScreen", userEngagementCollectionMessage: "userEngagementCollectionMessage", videoCollectionMovieNavigate: "videoCollectionMovieNavigate", videoCollectionNavigate: "videoCollectionNavigate", videoCollectionOtherNavigate: "videoCollectionOtherNavigate", videoCollectionTvNavigate: "videoCollectionTvNavigate", videoDetailsNavigate: "videoDetailsNavigate", videoDeepLinkLocation: "videoDeepLinkLocation", videoMarketplaceNavigate: "videoMarketplaceNavigate", videoPostRollNavigate: "videoPostRollNavigate", videoRecommendationsNavigate: "videoRecommendationsNavigate", videoWatchlistNavigate: "videoWatchlistNavigate", watchOnXbox: "watchOnXbox", testAction: "testAction", testAction2: "testAction2", testPanelAction: "testPanelAction", testPanelAction2: "testPanelAction2", testPanelAction3: "testPanelAction3", testPanelAction4: "testPanelAction4", notificationCloudContent: "notificationCloudContent", notificationCloudContentV2: "notificationCloudContentV2", notificationDetailsNetworkStatus: "notificationDetailsNetworkStatus", notificationLocalContent: "notificationLocalContent", notificationNetworkStatus: "notificationNetworkStatus", notificationPartialContent: "notificationPartialContent"
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI", {
+ AppBarActions: {
+ addTo: "addTo", addToNowPlaying: "addToNowPlaying", addLocalArtistToNowPlaying: "addLocalArtistToNowPlaying", addMarketplaceArtistToNowPlaying: "addMarketplaceArtistToNowPlaying", addToMyMusic: "addToMyMusic", addToPlaylist: "addToPlaylist", addToOtherPlaylist: "addToOtherPlaylist", addTrackToPlaylist: "addTrackToPlaylist", artistDetails: "artistDetails", buyCurrentSeason: "buyCurrentSeason", buyEpisode: "buyEpisode", buySeason: "buySeason", buyVideo: "buyVideo", clearSelection: "clearSelection", closeSmartGlassActivity: "closeSmartglassActivity", closeSmartGlassController: "closeSmartGlassController", createNewPlaylist: "createNewPlaylist", deleteMedia: "deleteMedia", deleteSeries: "deleteSeries", deletePlaylist: "deletePlaylist", deleteSmartDJ: "deleteSmartDJ", downloadFromMarketplace: "downloadFromMarketplace", downloadSeason: "downloadSeason", editMetadata: "editMetadata", editMetadataImage: "editMetadataImage", editMetadataMatchAlbumInfo: "editMetadataMatchAlbumInfo", exploreAlbum: "exploreAlbum", findAlbumInfo: "findAlbumInfo", getOnXbox360: "getOnXbox360", globalCommandHelpApp: "globalCommandHelpApp", pinToStartScreen: "pinToStartScreen", unpinFromStartScreen: "unpinFromStartScreen", importPlaylists: "importPlaylists", mediaProperties: "mediaProperties", moveListItemDown: "moveListItemDown", moveListItemToBottom: "moveListItemToBottom", moveListItemToTop: "moveListItemToTop", moveListItemUp: "moveListItemUp", movieDetails: "movieDetails", navigateBack: "navigateBack", navigateToDefault: "navigateToDefault", navigateToHome: "navigateToHome", navigateToNowPlaying: "navigateToNowPlaying", navigateToWatchlist: "navigateToWatchlist", openAbout: "openAbout", openFeedbackDialog: "openFeedbackDialog", openFile: "openFile", playContinuous: "playContinuous", playFreeOffer: "playFreeOffer", playMusicVideo: "playMusicVideo", playMusicVideoFromTrack: "playMusicVideoFromTrack", playNow: "playNow", playDisabled: "playDisabled", playOnXbox360: "playOnXbox360", playTrackOnXbox360: "playTrackOnXbox360", playSelection: "playSelection", playSelectionContinuous: "playSelectionContinuous", playSmartDJ: "playSmartDJ", playTopSongs: "playTopSongs", playTrailer: "playTrailer", playVideo: "playVideo", previewSelection: "previewSelection", previewTrack: "previewTrack", purchaseTrackFromMarketplace: "purchaseTrackFromMarketplace", purchaseAlbumFromMarketplace: "purchaseAlbumFromMarketplace", removeFailedVideo: "removeFailedVideo", removeFromList: "removeFromList", removeFromPlaylist: "removeFromPlaylist", removeFromNowPlaying: "removeFromNowPlaying", removeFailedDownload: "removeFailedDownload", renamePlaylist: "renamePlaylist", rentVideo: "rentVideo", restorePurchases: "restorePurchases", restartVideo: "restartVideo", resumeVideo: "resumeVideo", saveNowPlayingPlaylist: "saveNowPlayingPlaylist", search: "search", seasonDetails: "seasonDetails", seriesDetails: "seriesDetails", setBackgroundImage: "setBackgroundImage", showDownloadManager: "showDownloadManager", showPlaylistItemInformation: "showPlaylistItemInformation", signIn: "signIn", subscriptionDownload: "subscriptionDownload", tryDownloadAgain: "tryDownloadAgain", toggleSwitcher: "toggleSwitcher", toggleMusicVideoPlayback: "toggleMusicVideoPlayback", subscriptionSignup: "subscriptionSignup"
+ }
+ })
+})();
+/* >>>>>>/framework/musicactionidentifiers.js:23530 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ var ActionIdentifiers;
+ (function (ActionIdentifiers) {
+ ActionIdentifiers.deviceHubNavigate = "deviceHubNavigate";
+ ActionIdentifiers.mediaStatusSubscriptionSignupAction = "mediaStatusSubscriptionSignupAction";
+ ActionIdentifiers.musicDeepLinkPlayAndNavigate = "musicDeepLinkPlayAndNavigate";
+ ActionIdentifiers.showEducationFlyout = "showEducationFlyout";
+ ActionIdentifiers.showPurchaseConfirmationFlyout = "showPurchaseConfirmationFlyout";
+ ActionIdentifiers.resetCloudCollection = "resetCloudCollection";
+ ActionIdentifiers.showResetCloudCollectionFlyout = "showResetCloudCollectionFlyout"
+ })(ActionIdentifiers = Actions.ActionIdentifiers || (Actions.ActionIdentifiers = {}))
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/automationidentifiers.js:23557 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.UI.AutomationIds", {
+ accountProvisioningChildWebLink: "accountProvisioningChildWebLink", accountProvisioningTOS: "accountProvisioningTOS", accountProvisioningPrivacy: "accountProvionsingPrivacy", addToPlaylistAction: "addToPlaylistAction", addToNowPlaying: "addToNowPlaying", albumDetailsNavigate: "albumDetailsNavigate", albumDeviceDetailsNavigate: "albumDeviceDetailsNavigate", albumPurchase: "albumPurchase", artistMediaNavigate: "artistMediaNavigate", artistDetailsNavigate: "artistDetailsNavigate", appBarAddLocalArtistToNowPlaying: "appBarAddLocalArtistToNowPlaying", appBarAddMarketplaceArtistToNowPlaying: "appBarAddMarketplaceArtistToNowPlaying", appBarAddTo: "appBarAddTo", appBarAddToMyMusic: "appBarAddToMyMusic", appBarSubscriptionAddToMyMusic: "appBarSubscriptionAddToMyMusic", appBarAddToCloud: "appBarAddToCloud", appBarAddToNowPlaying: "appBarAddToNowPlaying", appBarArtistDetails: "appBarArtistDetails", appBarBuyCurrentSeason: "appBarBuyCurrentSeason", appBarBuyEpisode: "appBarBuyEpisode", appBarBuySeason: "appBarBuySeason", appBarBuyVideo: "appBarBuyVideo", appBarCloseCommandingPopover: "appBarCloseCommandingPopover", appBarClearSelection: "appBarClearSelection", appBarCloseSmartGlassActivity: "appBarCloseSmartGlassActivity", appBarCloseSmartGlassController: "appBarCloseSmartGlassController", appBarDeleteSmartDJ: "appBarDeleteSmartDJ", appBarDownloadAgain: "appBarDownloadAgain", appBarDownloadFromMarketplace: "appBarDownloadFromMarketplace", appBarDownloadSeason: "appBarDownloadSeason", appBarExploreAlbum: "appBarExploreAlbum", appBarFindAlbumInfo: "appBarFindAlbumInfo", appBarGetOnXbox360: "appBarGetOnXbox360", appBarPinToStartScreen: "appBarPinToStartScreen", appBarMediaProperties: "appBarMediaProperties", appBarMovieDetails: "appBarMovieDetails", appBarNavigateBack: "appBarNavigateBack", appBarNavigateToDefault: "appBarNavigateToDefault", appBarNavigateToHome: "appBarNavigateToHome", appBarNavigateToNowPlaying: "appBarNavigateToNowPlaying", appBarNavigateToWatchlist: "appBarNavigateToWatchlist", appBarOpenAbout: "appBarOpenAbout", appBarOpenFile: "appBarOpenFile", appBarPlayFreeVideoOffer: "appBarPlayFreeVideoOffer", appBarPlayDisabled: "appBarPlayDisabled", appBarPlayNow: "appBarPlayNow", appBarPlayOnXbox360: "appBarPlayOnXbox360", appBarPlaySelection: "appBarPlaySelection", appBarPlaySmartDJ: "appBarPlaySmartDJ", appBarPlayTopSongs: "appBarPlayTopSongs", appBarPlayTrackOnXbox360: "appBarPlayTrackOnXbox360", appBarPlayTrailer: "appBarPlayTrailer", appBarPreviewTrack: "appBarPreviewTrack", appBarPurchaseAlbumFromMarketplace: "appBarPurchaseAlbumFromMarketplace", appBarPurchaseTrackFromMarketplace: "appBarPurchaseTrackFromMarketplace", appBarRemoveDownload: "appBarRemoveDownload", appBarRentVideo: "appBarRentVideo", appBarRestartVideo: "appBarRestartVideo", appBarResumeVideo: "appBarResumeVideo", appBarRestorePurchases: "appBarRestorePurchases", appBarSaveNowPlaying: "appBarSaveNowPlaying", appBarSeasonDetails: "appBarSeasonDetails", appBarSearch: "appBarSearch", appBarSeriesDetail: "appBarSeriesDetail", appBarShowDownloadManager: "appBarShowDownloadManager", appBarSignIn: "appBarSignIn", appBarSubscriptionDownload: "appBarSubscriptionDownload", appBarSubscriptionSignup: "appBarSubscriptionSignup", appBarToggleSwitcher: "appBarToggleSwitcher", appBarUnpinFromStartScreen: "appBarUnpinFromStartScreen", appBarUpsellPlayPause: "appBarUpsellPlayPause", criticReviewSelect: "criticReviewSelect", collectionCreatePlaylist: "collectionCreatePlaylist", collectionCreateSmartDJ: "collectionCreateSmartDJ", collectionEmptyShowAllMusicLink: "collectionEmptyShowAllMusicLink", collectionFilterLink: "collectionFilterLink", collectionNavigate: "collectionNavigate", collectionImportPlaylist: "collectionImportPlaylist", copy: "copy", createPlaylist: "createPlaylist", dashboardNewReleasesMoreButton: "dashboardNewReleasesMoreButton", dashboardNewMusicVideosButton: "dashboardNewMusicVideosButton", dashboardHomePlaylistsButton: "dashboardHomePlaylistsButton", dashboardHomeCollectionButton: "dashboardHomeCollectionButton", dashboardHomeSearch: "dashboardHomeSearch", dashboardFeaturedSearch: "dashboardFeaturedSearch", dashboardSmartDJCollection: "dashboardSmartDJCollection", dashboardSmartDJSearch: "dashboardSmartDJSearch", dashboardSmartDJSearchArtist: "dashboardSmartDJSearchArtist", dashboardTopMusicSearch: "dashboardTopMusicSearch", dashboardHomeUpsellPanelStartTrial: "dashboardHomeUpsellPanelStartTrial", dashboardHomeUpsellPanelLearnMore: "dashboardHomeUpsellPanelLearnMore", dashboardFeaturedMoreButton: "dashboardFeaturedMoreButton", dashboardTopMusicFirstColumnMoreButton: "dashboardTopMusicFirstColumnMoreButton", dashboardTopMusicSecondColumnMoreButton: "dashboardTopMusicSecondColumnMoreButton", dashboardVideoBrowseMovieMarketplace: "dashboardVideoBrowseMovieMarketplace", dashboardVideoBrowseTvMarketplace: "dashboardVideoBrowseTvMarketplace", dashboardVideoFeaturedSets: "dashboardVideoFeaturedSets", dashboardVideoRecommendations: "dashboardVideoRecommendations", deepLink: "deepLink", deepLinkFeatureEnablementAction: "deepLinkFeatureEnablementAction", deepLinkLaunchFeedbackFlyout: "deepLinkLaunchFeedbackFlyout", deepLinkShowPerfTrackLog: "deepLinkShowPerfTrackLog", deepLinkPlay: "deepLinkPlay", deepLinkPlayArtist: "deepLinkPlayArtist", deepLinkPlayPin: "deepLinkPlayPin", deepLinkPlaySmartDJ: "deepLinkPlaySmartDJ", doubleClickPlay: "doubleClickPlay", editMetadata: "editMetadata", editMetadataImage: "editMetadataImage", editMetadataMatchAlbumInfo: "editMetadataMatchAlbumInfo", explicitAlbumNotification: "explicitAlbumNotification", explicitAlbumMixedNotification: "explicitAlbumMixedNotification", exploreHubNavigate: "exploreHubNavigate", exploreUpsellLearnMore: "exploreUpsellLearnMore", exploreUpsellMusicPassSignIn: "exploreUpsellMusicPassSignIn", exploreUpsellMusicPassSignUp: "exploreUpsellMusicPassSignUp", failedPanelNavigateToMarketplace: "failedPanelNavigateToMarketplace", flexHubNavigate: "flexHubNavigate", flexHubSelected: "flexHubSelected", flyoutAddToPlaylist: "flyoutAddToPlaylist", flyoutAddTrackToPlaylist: "flyoutAddTrackToPlaylist", flyoutCreatePlaylist: "flyoutCreatePlaylist", flyoutPlayArtist: "flyoutPlayArtist", flyoutPlaySmartDJ: "flyoutPlaySmartDJ", flyoutOtherPlaylist: "flyoutOtherPlaylist", freeTrialButton: "freeTrialButton", freeLimitsSubscriptionSignup: "freeLimitsSubscriptionSignup", galleryPlaySmartDJ: "galleryPlaySmartDJ", genericPlay: "genericPlay", genrePivot: "genre", globalCommandHelpApp: "globalCommandHelpApp", invokeGlobalCommand: "invokeGlobalCommand", launchAppDeepLinkPurchasePDLC: "launchAppDeepLinkPurchasePDLC", launchAppMoreAboutLibraries: "launchAppMoreAboutLibraries", launchAppMusicApp: "launchAppMusicApp", launchAppPlayToXbox: "launchAppPlayToXbox", launchAppPurchaseGame: "launchAppPurchaseGame", launchAppStoreUpgrade: "launchAppStoreUpgrade", launchAppVideoApp: "launchAppVideoApp", libraryPlaySmartDJ: "libraryPlaySmartDJ", mediaItemDetailsNavigate: "mediaItemDetailsNavigate", miniProfileHubPanelSignIn: "miniProfileHubPanelSignIn", mouseNavigateBack: "mouseNavigateBack", moveListItemDown: "moveListItemDown", moveListItemToBottom: "moveListItemToBottom", moveListItemToTop: "moveListItemToTop", moveListItemUp: "moveListItemUp", musicDeepLinkLocation: "musicDeepLinkLocation", musicDeepLinkDetails: "musicDeepLinkDetails", musicPinToStartPlayAndNavigate: "musicPinToStartPlayAndNavigate", muteVolume: "muteVolume", navigate: "navigate", navigateToDefault: "navigateToDefault", navigateToVideoDetails: "navigateToVideoDetails", navPaneCreatePlaylist: "navPaneCreatePlaylist", navPaneImportPlaylists: "navPaneImportPlaylists", newMusicMarketplaceNavigate: "newMusicMarketplaceNavigate", nowPlayingNavigate: "nowPlayingNavigate", nowPlayingTransportPause: "nowPlayingTransportPause", nowPlayingTransportPlay: "nowPlayingTransportPlay", nowPlayingTransportPlayPause: "nowPlayingTransportPlayPause", nowPlayingTransportSkipBack: "nowPlayingTransportSkipBack", nowPlayingTransportSkipBackHold: "nowPlayingTransportSkipBackHold", nowPlayingTransportSkipForward: "nowPlayingTransportSkipForward", nowPlayingTransportSkipForwardHold: "nowPlayingTransportSkipForwardHold", nowPlayingTransportVolume: "nowPlayingTransportVolume", nowPlayingTransportVolumeHold: "nowPlayingTransportVolumeHold", offlineFullyStreamingAlbumNotification: "offlineFullyStreamingAlbumNotification", offlineFullyStreamingPlaylistNotification: "offlineFullyStreamingPlaylistNotification", offlinePartiallyStreamingAlbumNotification: "offlinePartiallyStreamingAlbumNotification", offlinePartiallyStreamingPlaylistNotification: "offlinePartiallyStreamingPlaylistNotification", openFeedbackDialog: "openFeedbackDialog", playbackSkipBackward: "playbackSkipBackward", playbackSkipForward: "playbackSkipForward", playMedia: "playMedia", playMusicVideo: "playMusicVideo", playMusicVideoFromTrack: "playMusicVideoFromTrack", playQueryAction: "playQueryAction", playlistAddToActivePlaylistAction: "playlistAddToActivePlaylistAction", playlistAddToPlaylistAction: "playlistAddToPlaylistAction", playlistAddTrackToActivePlaylistAction: "playlistAddTrackToActivePlaylistAction", playlistAddTrackToPlaylistAction: "playlistAddTrackToPlaylistAction", playlistCreatePlaylistAction: "playlistCreatePlaylistAction", playlistCreatePlaylistFromNowPlayingAction: "playlistCreatePlaylistFromNowPlayingAction", playlistDeletePlaylist: "playlistDeletePlaylist", playlistDetailsNavigate: "playlistDetailsNavigate", playlistFlyoutAddToPlaylist: "playlistFlyoutAddToPlaylist", playlistFlyoutAddTrackToPlaylist: "playlistFlyoutAddTrackToPlaylist", playlistFlyoutCreatePlaylist: "playlistFlyoutCreatePlaylist", playlistMoveTrackDown: "playlistMoveTrackDown", playlistMoveTrackUp: "playlistMoveTrackUp", playlistNewPlaylistNameEntry: "playlistNewPlaylistNameEntry", playlistRemoveFromPlaylist: "playlistRemoveFromPlaylist", playlistRemoveFromNowPlaying: "playlistRemoveFromNowPlaying", playlistRenamePlaylistAction: "playlistRenamePlaylistAction", playlistRenamePlaylistNameEntry: "playlistRenamePlaylistNameEntry", playlistSaveNowPlayingPlaylistNameEntry: "playlistSaveNowPlayingPlaylistNameEntry", playlistShowPlaylistInformation: "playlistShowPlaylistInformation", playlistSubscriptionAddToMyMusic: "playlistSubscriptionAddToMyMusic", playlistWebCreatePlaylistAction: "playlistWebCreatePlaylistAction", pinToStartPlay: "pinToStartPlay", radioNavigate: "radioNavigate", readerAction: "readerAction", removeFromList: "removeFromList", refreshPanel: "refreshPanel", runTestDeepLinkAction: "runTestDeepLinkAction", searchResultsNavigate: "searchResultsNavigate", setBackgroundImageAction: "setBackgroundImageAction", settingsAccountBillingContact: "settingsAccountBillingContact", settingsAccountBillingHistory: "settingsAccountBillingHistory", settingsAccountContactPreferences: "settingsAccountContactPreferences", settingsAccountManageDevices: "settingsAccountManageDevices", settingsAccountManagePayment: "settingsAccountManagePayment", settingsAccountPrivacy: "settingsAccountPrivacy", settingsSubscriptionSignup: "settingsSubscriptionSignup", settingsHelp: "settingsHelp", showAccountPicker: "showAccountPicker", showDownloadManager: "showDownloadManager", showImmersiveDetails: "showImmersiveDetails", showItemDetails: "showItemDetails", showLocalGrovelInfoDialog: "showLocalGrovelInfoDialog", showMusicVideoContextualAppbar: "showMusicVideoContextualAppbar", showNowPlayingMoreActions: "showNowPlayingMoreActions", showTrackContextualAppbar: "showTrackContextualAppbar", showPlaylist: "showPlaylist", showPopover: "showPopover", shuffleAllMusic: "shuffleAllMusic", signIn: "signIn", smartButtonAddToDisabled: "smartButtonAddToDisabled", smartButtonAddToFromPopover: "smartButtonAddToFromPopover", smartButtonAddToFromTrackInline: "smartButtonAddToFromTrackInline", smartButtonAddToFromArtistImmersive: "smartButtonAddToFromArtistImmersive", smartButtonAddToFromAlbumDetails: "smartButtonAddToFromAlbumDetails", smartButtonLaunchInteractiveApp: "smartButtonLaunchInteractiveApp", smartButtonWatch: "smartButtonWatch", smartButtonBuyVideo: "smartButtonBuyVideo", smartButtonBuyEpisode: "smartButtonBuyEpisode", smartButtonRentVideo: "smartButtonRentVideo", smartBuyPlayFreeVideoOffer: "smartBuyPlayFreeVideoOffer", smartButtonPlay: "smartButtonPlay", smartButtonPlayTrack: "smartButtonPlayTrack", smartButtonPlayNowPlayingTrack: "smartButtonPlayNowPlayingTrack", smartButtonRestart: "smartButtonRestart", smartButtonResume: "smartButtonResume", smartButtonPlayDisabled: "smartButtonPlayDisabled", smartButtonSwitchVideoDefinition: "smartButtonSwitchVideoDefinition", smartButtonSwitchLanguage: "smartButtonSwitchLanguage", smartButtonFindAlbumInfo: "smartButtonFindAlbumInfo", smartButtonAddToNowPlaying: "smartButtonAddToNowPlaying", smartButtonAddAlbumToNowPlaying: "smartButtonAddAlbumToNowPlaying", smartButtonAddPlaylistToNowPlaying: "smartButtonAddPlaylistToNowPlaying", smartButtonAddTrackToNowPlaying: "smartButtonAddTrackToNowPlaying", smartButtonContentNotAvailable: "smartButtonContentNotAvailable", smartButtonAddMarketplaceArtistToNowPlaying: "smartButtonAddMarketplaceArtistToNowPlaying", smartButtonAddLocalArtistToNowPlaying: "smartButtonAddLocalArtistToNowPlaying", smartButtonAddRemoveItemWatchlist: "smartButtonAddRemoveItemWatchlist", smartButtonMoveListItemDown: "smartButtonMoveListItemDown", smartButtonMoveListItemToBottom: "smartButtonMoveListItemToBottom", smartButtonMoveListItemToTop: "smartButtonMoveListItemToTop", smartButtonMoveListItemUp: "smartButtonMoveListItemUp", smartButtonOverflowAction: "smartButtonOverflowAction", smartButtonPinToDashboard: "smartButtonPinToDashboard", smartButtonPlaySeason: "smartButtonPlaySeason", smartButtonPlayAnyArtist: "smartButtonPlayAnyArtist", smartButtonPlayPlaylist: "smartButtonPlayPlaylist", smartButtonNewSmartDj: "smartButtonNewSmartDj", smartButtonPinToStartScreen: "smartButtonPinToStartScreen", smartButtonUnpinFromStartScreen: "smartButtonUnpinFromStartScreen", smartButtonPlayArtist: "smartButtonPlayArtist", smartButtonPlayArtistSmartDj: "smartButtonPlayArtistSmartDj", smartButtonDelete: "smartButtonDelete", smartButtonDeleteSmartDj: "smartButtonDeleteSmartDj", smartButtonAddToMyMusic: "smartButtonAddToMyMusic", smartButtonAddToMyMusicAlbum: "smartButtonAddToMyMusicAlbum", smartButtonAddToMyMusicAlbumOp: "smartButtonAddToMyMusicAlbumOp", smartButtonAddToMyMusicTrack: "smartButtonAddToMyMusicTrack", smartButtonAddToMyMusicTrackOp: "smartButtonAddToMyMusicTrackOp", smartButtonDownload: "smartButtonDownload", smartButtonDownloadCancel: "smartButtonDownloadCancel", smartButtonDownloadFreeExtra: "smartButtonDownloadFreeExtra", smartButtonDownloadPause: "smartButtonDownloadPause", smartButtonDownloadResume: "smartButtonDownloadResume", smartButtonDownloadRetry: "smartButtonDownloadRetry", smartButtonDownloadSeason: "smartButtonDownloadSeason", smartButtonTryAgain: "smartButtonTryAgain", smartButtonRemove: "smartButtonRemove", smartButtonRenamePlaylist: "smartButtonRenamePlaylist", smartButtonMusicPassSignup: "smartButtonMusicPassSignup", smartButtonPlayTrailer: "smartButtonPlayTrailer", smartButtonPlayGameTrailer: "smartButtonPlayGameTrailer", smartButtonPlayOnXbox: "smartButtonPlayOnXbox", smartButtonWatchTrailer: "smartButtonWatchTrailer", smartButtonWatchOnXbox: "smartButtonWatchOnXbox", smartButtonMovieDetails: "smartButtonMovieDetails", smartButtonArtistDetails: "smartButtonArtistDetails", smartButtonSeriesDetails: "smartButtonSeriesDetails", smartButtonSeasonDetails: "smartButtonSeasonDetails", smartButtonGameDetails: "smartButtonGameDetails", smartButtonCompareGameActivities: "smartButtonCompareGameActivities", smartButtonGameExtras: "smartButtonGameExtras", smartButtonBuyModernGame: "smartButtonBuyModernGame", smartButtonPlayOnPc: "smartButtonPlayOnPc", smartButtonPlayAlbum: "smartButtonPlayAlbum", smartButtonPlayAlbumPreview: "smartButtonPlayAlbumPreview", smartButtonPlayTrackPreview: "smartButtonPlayTrackPreview", smartButtonPlayArtistPreview: "smartButtonPlayArtistPreview", smartButtonArtistLocalPlayAll: "smartButtonArtistLocalPlayAll", smartButtonArtistMarketplacePlayAll: "smartButtonArtistMarketplacePlayAll", smartButtonArtistPlayVideos: "smartButtonArtistPlayVideos", smartButtonBuyAlbum: "smartButtonBuyAlbum", smartButtonBuyTrack: "smartButtonBuyTrack", smartButtonDisabledBuyTrack: "smartButtonDisabledBuyTrack", smartButtonBuyExtra: "smartButtonBuyExtra", smartButtonBuyGame: "smartButtonBuyGame", smartButtonBuySeason: "smartButtonBuySeason", smartButtonBuyCurrentSeason: "smartButtonBuyCurrentSeason", smartButtonBuyCurrentSeasonPass: "smartButtonBuyCurrentSeasonPass", smartButtonBuyNextSeason: "smartButtonBuyNextSeason", smartButtonBuyNextSeasonPass: "smartButtonBuyNextSeasonPass", smartButtonExtraPurchasedDisabled: "smartButtonExtraPurchasedDisabled", smartButtonGamePurchasedDisabled: "smartButtonGamePurchasedDisabled", smartButtonDemoPurchasedDisabled: "smartButtonDemoPurchasedDisabled", smartButtonTryGameDemo: "smartButtonTryGameDemo", smartButtonShowDownloadManager: "smartButtonShowDownloadManager", smartButtonShowPlaylist: "smartButtonShowPlaylist", smartButtonRemoveFromList: "smartButtonRemoveFromList", smartButtonRemoveFromPlaylist: "smartButtonRemoveFromPlaylist", smartButtonRemoveFromNowPlaying: "smartButtonRemoveFromNowPlaying", smartButtonDeleteMedia: "smartButtonDeleteMedia", smartButtonDeleteSeries: "smartButtonDeleteSeries", smartButtonDeletePlaylist: "smartButtonDeletePlaylist", smartButtonMediaProperties: "smartButtonMediaProperties", smartButtonShuffleAll: "smartButtonShuffleAll", smartButtonBrowseAllMusic: "smartButtonBrowseAllMusic", smartButtonGetFreeMusicPassTrial: "smartButtonGetFreeMusicPassTrial", smartButtonBuyActivity: "smartButtonBuyActivity", smartButtonPlayActivity: "smartButtonPlayActivity", smartButtonGetGold: "smartButtonGetGold", smartButtonPlaylistItemInformation: "smartButtonPlaylistItemInformation", smartButtonSaveNowPlayingPlaylist: "smartButtonSaveNowPlayingPlaylist", smartButtonPlayRelatedArtist: "smartButtonPlayRelatedArtist", smartButtonRatingPicker: "smartButtonRatingPicker", smartButtonChangeSeason: "smartButtonChangeSeason", smartButtonInCollection: "smartButtonInCollection", smartButtonViewInCollection: "smartButtonViewInCollection", startRadioStation: "startRadioStation", subscriptionDownload: "subscriptionDownload", subscriptionSignup: "subscriptionSignup", subscriptionSignupWithSignIn: "subscriptionSignupWithSignIn", subscriptionSignupPurchaseOffer: "subscriptionSignupPurchaseOffer", subscriptionSignupRedeemCode: "subscriptionSignupRedeemCode", socialBuzzNavigateToProfile: "socialBuzzNavigateToProfile", subgenrePivot: "subgenre", textMessageDeleteButton: "textMessageDeleteButton", textMessageReplyButton: "textMessageReplyButton", toggleMusicVideoPlayback: "toggleMusicVideoPlayback", topMusicMarketplaceButton: "topMusicMarketplaceButton", topMusicMarketplaceNavigate: "topMusicMarketplaceNavigate", trackPurchase: "trackPurchase", transportClosedCaption: "transportClosedCaption", transportNextTrack: "transportNextTrack", transportPause: "transportPause", transportPlay: "transportPlay", transportPlayPause: "transportPlayPause", transportPreviousTrack: "transportPreviousTrack", transportRepeat: "transportRepeat", transportPlaybackOptions: "transportPlaybackOptions", transportShuffle: "transportShuffle", transportSkipBack: "transportSkipBack", transportSkipBackHold: "transportSkipBackHold", transportSkipForward: "transportSkipForward", transportSkipForwardHold: "transportSkipForwardHold", transportSmartGlass: "transportSmartGlass", transportXbox: "transportXbox", transportVolume: "transportVolume", transportVolumeHold: "transportVolumeHold", unsnapButtonAction: "unsnapButtonAction", userFeedbackDialogPrivacyLink: "userFeedbackDialogPrivacyLink", verticalPivotSelected: "verticalPivotSelected", videoAdSubscriptionSignup: "videoAdSubscriptionSignup", videoDeepLinkLocation: "videoDeepLinkLocation", videoNavigateToPreviewBrowse: "videoNavigateToPreviewBrowse", videoPostRollPlayTimer: "videoPostRollPlayTimer", viewMoreImmersive: "viewMoreImmersive", voiceNavigateBack: "voiceNavigateBack", whatsNewLink: "whatsNewLink"
+ })
+ })()
+})();
+/* >>>>>>/framework/musicautomationidentifiers.js:23568 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var AutomationIds;
+ (function (AutomationIds) {
+ AutomationIds.deviceHubNavigate = "deviceHubNavigate";
+ AutomationIds.mediaStatusSubscriptionSignUp = "mediaStatusSubscriptionSignUp";
+ AutomationIds.musicDeepLinkPlayAndNavigate = "musicDeepLinkPlayAndNavigate";
+ AutomationIds.showEducationFlyout = "showEducationFlyout";
+ AutomationIds.showPurchaseConfirmationFlyout = "showPurchaseConfirmationFlyout";
+ AutomationIds.showSubscriptionSignUpFromFreeStreamingIsGoneDialog = "showSubscriptionSignUpFromFreeStreamingIsGoneDialog";
+ AutomationIds.playlistUpsellNotification = "playlistUpsellNotification";
+ AutomationIds.playlistUpsellNotificationSubscriptionSignUp = "playlistUpsellNotificationSubscriptionSignUp";
+ AutomationIds.showSettingsPane = "showSettingsPane";
+ AutomationIds.showSubscriptionSignUpFromRadioPage = "showSubscriptionSignUpFromRadioPage";
+ AutomationIds.cloudDedupeNotification = "cloudDedupeNotification";
+ AutomationIds.resetCloudCollection = "resetCloudCollection";
+ AutomationIds.showResetCloudCollectionFlyout = "showResetCloudCollectionFlyout"
+ })(AutomationIds = UI.AutomationIds || (UI.AutomationIds = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/action.js:23598 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ ActionArray: MS.Entertainment.UI.Framework.derive("Array", null, {
+ subActions: null, actionsWithSubActions: null, pushSubAction: function addSubAction(actionId, subActionId) {
+ MS.Entertainment.UI.Actions.assert(actionId, "actionId must be defined");
+ MS.Entertainment.UI.Actions.assert(subActionId, "subActionId must be defined");
+ this.actionsWithSubActions = this.actionsWithSubActions || [];
+ this.subActions = this.subActions || {};
+ if (!this.subActions[actionId])
+ this.actionsWithSubActions.push(actionId);
+ this.subActions[actionId] = this.subActions[actionId] || [];
+ this.subActions[actionId].push(subActionId)
+ }, hasSubActions: function hasSubActions(actionId) {
+ MS.Entertainment.UI.Actions.assert(actionId, "actionId must be defined");
+ return this.subActions && this.subActions[actionId] && this.subActions[actionId].length > 0
+ }
+ }, {
+ areSubActionsEqual: function areSubActionsEqual(actionArray1, actionArray2) {
+ var arraysAreEqual = true;
+ var subActions1 = (actionArray1 && actionArray1.subActions) || {};
+ var subActions2 = (actionArray2 && actionArray2.subActions) || {};
+ var actionsWithSubActions1 = (actionArray1 && actionArray1.actionsWithSubActions) || [];
+ var actionsWithSubActions2 = (actionArray2 && actionArray2.actionsWithSubActions) || [];
+ var subActionValues1;
+ var subActionValues2;
+ if (actionsWithSubActions1.length !== actionsWithSubActions2.length)
+ arraysAreEqual = false;
+ else
+ for (var i = 0; arraysAreEqual && i < actionsWithSubActions1.length; i++) {
+ subActionValues1 = subActions1[actionsWithSubActions1[i]];
+ subActionValues2 = subActions1[actionsWithSubActions2[i]];
+ for (var j = 0; j < subActionValues1.length; j++)
+ if (subActionValues1[j] !== subActionValues2[j]) {
+ arraysAreEqual = false;
+ break
+ }
+ }
+ return arraysAreEqual
+ }
+ }), ExecutionLocation: {
+ activity: "activity", canvas: "canvas", engage: "engage", gallery: "gallery", invokeInline: "invokeInline", opportunity: "opportunity", popover: "popover", selection: "selection", nowPlaying: "nowPlaying"
+ }, ActionWrapperType: {
+ appbarAction: "appbarAction", button: "button"
+ }, ActionService: MS.Entertainment.UI.Framework.define(function actionServiceConstructor() {
+ this._actionFactories = {}
+ }, {
+ _actionFactories: null, register: function register(id, factory) {
+ MS.Entertainment.UI.Actions.assert(MS.Entertainment.UI.Actions.ActionIdentifiers.hasOwnProperty(id), "Identifier wasn't found in action list: " + id);
+ MS.Entertainment.UI.Actions.assert(!this._actionFactories.hasOwnProperty(id), "This action identifier has already been registered: " + id);
+ MS.Entertainment.UI.Actions.assert(typeof factory === "function", "Factory method was not a function");
+ this._actionFactories[id] = factory
+ }, isRegistered: function isRegistered(id) {
+ return this._actionFactories.hasOwnProperty(id)
+ }, getAction: function getAction(id) {
+ if (!this._actionFactories.hasOwnProperty(id))
+ throw "Supplied Action Identifier was not registered: " + id;
+ var newAction = this._actionFactories[id]();
+ newAction.id = id;
+ return newAction
+ }, _unregister: function _unregister(id) {
+ delete this._actionFactories[id]
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.actions, function actionServiceFactory() {
+ return new MS.Entertainment.UI.Actions.ActionService
+ }, true);
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ Action: MS.Entertainment.defineObservable(function actionConstructor() {
+ var that = this;
+ var firstCall = true;
+ this.bind("parameter", function parameterChanged() {
+ if (firstCall) {
+ firstCall = false;
+ return
+ }
+ that.requeryCanExecute();
+ that.requeryCanShow()
+ })
+ }, {
+ parameter: null, shouldShow: false, isEnabled: true, title: null, voiceDisableOverride: false, subActions: null, hasSubActions: false, onComplete: null, onExecuting: null, useRelativePositioning: false, id: null, automationId: null, shouldAutomaticallySendTelemetry: true, isDragAndDropResponse: false, type: null, label: null, section: null, tooltip: null, _getTranslatedDragAndDropParameters: function _getTranslatedDragAndDropParameters() {
+ if (!this.translateDragAndDropParams)
+ return this.parameter;
+ var source = this.parameter && this.parameter.source;
+ var target = this.parameter && this.parameter.target;
+ MS.Entertainment.UI.Actions.assert(source, "Drag-and-drop action parameters do not contain a source parameter, so we don't know what is being dragged.");
+ return this.translateDragAndDropParams(source, target)
+ }, execute: function execute(referenceDomElement) {
+ var result;
+ var onExecuting;
+ this.requeryCanExecute();
+ if (this.isEnabled && this.executed) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceAction_Invoked(this.id);
+ onExecuting = this.onExecuting && this.onExecuting();
+ onExecuting = WinJS.Promise.as(onExecuting);
+ var parameter = this.parameter;
+ if (this.isDragAndDropResponse)
+ parameter = this._getTranslatedDragAndDropParameters();
+ if (this.shouldAutomaticallySendTelemetry)
+ MS.Entertainment.Utilities.Telemetry.logCommandClicked(this);
+ result = onExecuting.then(function onExecutingComplete() {
+ return this.executed(parameter, referenceDomElement)
+ }.bind(this))
+ }
+ return WinJS.Promise.as(result).then(function onComplete() {
+ if (this.onComplete)
+ return this.onComplete();
+ else
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }, requeryCanShow: function requeryCanShow() {
+ var parameter = this.parameter;
+ if (this.isDragAndDropResponse)
+ parameter = this._getTranslatedDragAndDropParameters();
+ if (this.canShow)
+ this.shouldShow = !!this.canShow(parameter)
+ }, requeryCanExecute: function requeryCanExecute() {
+ if (!this.executed) {
+ this.isEnabled = false;
+ return
+ }
+ var parameter = this.parameter;
+ if (this.isDragAndDropResponse)
+ parameter = this._getTranslatedDragAndDropParameters();
+ if (this.canExecute)
+ this.isEnabled = !!this.canExecute(parameter)
+ }, setSubActions: function setSubActions(newSubActions) {
+ this.subActions = newSubActions
+ }, useOverrideTitleIfExists: function useOverrideTitleIfExists() {
+ if ("overrideTitle" in this)
+ this.title = this["overrideTitle"]
+ }
+ }), extractMediaItemFromParam: function extractMediaItemFromParam(param) {
+ var mediaItem;
+ if (param && param.mediaItem)
+ mediaItem = param.mediaItem;
+ else
+ mediaItem = param;
+ return mediaItem
+ }, extractButtonFromParam: function extractButtonFromParam(param) {
+ var button;
+ if (param && param.button)
+ button = param.button;
+ else
+ button = param;
+ return button
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ InvokeAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function invokeAction() {
+ this.base();
+ this.invoker = new MS.Entertainment.Utilities.EventInvoker
+ }, {
+ invoker: null, invokeEvent: "invoked", executed: function executed(param) {
+ return this.invoker.dispatchEvent(this.invokeEvent, param)
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.invoke, function () {
+ return new MS.Entertainment.UI.Actions.InvokeAction
+ })
+ })();
+ (function runVoiceMixins() {
+ MS.Entertainment.Utilities.runVoicePropertyMixins(MS.Entertainment.UI.Actions.Action)
+ })()
+})();
+/* >>>>>>/controls/listcontrols.js:23769 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ItemsControl: MS.Entertainment.UI.Framework.defineUserControl(null, function itemsControlConstructor(element, options) {
+ this.repeaterContainer = element;
+ this._handleChangesInDataSource = this._handleChangesInDataSource.bind(this);
+ if (!this.keyboardNavigationManagerClass)
+ this.keyboardNavigationManagerClass = MS.Entertainment.Framework.KeyboardNavigationManager;
+ if (MS.Entertainment.UI.Framework.getTextDirection() === MS.Entertainment.UI.Framework.TextDirections.RightToLeft) {
+ var left = this.bringIntoViewLeftMargin;
+ var right = this.bringIntoViewRightMargin;
+ this.bringIntoViewLeftMargin = right;
+ this.bringIntoViewRightMargin = left
+ }
+ if (this.virtualize) {
+ if (!this.itemSize && !this.getItemSize)
+ throw new Error("itemSize required when using virtualization");
+ if (!this.virtualizationAxis)
+ throw new Error("virtualizationOrientation required when using virtualization");
+ if (!this.singleAxis && (!this.itemSize.width || !this.itemSize.height))
+ throw new Error("When using multiaxis, you need to supply an itemSize that has a width and height");
+ if (this._scroller.attachEvent)
+ this._scrollerAttachEvent = (function (handler, element) {
+ element.attachEvent("onresize", handler);
+ return {
+ cancel: function () {
+ element.detachEvent("onresize", handler)
+ }
+ }
+ })(this._handleElementResizing.bind(this), this._scroller);
+ this._scrollerEvents = MS.Entertainment.UI.Framework.addEventHandlers(this._scroller, {
+ mselementresize: this._handleElementResizing.bind(this), scroll: this._handleScrollingForVirtualization.bind(this)
+ })
+ }
+ this._constructed = true
+ }, {
+ delayInitializeChildren: false, _constructed: false, keyboardNavigable: false, keyboardNavigationManagerClass: null, keyboardNavigationSetTabIndex: false, _keyboardNavigationManager: null, raisePanelReady: false, ignoreChildrenInitialization: true, _restoreFocusAfterRender: false, deferForLongLists: false, longListDeferralItemLimit: 10, firstItemTabIndex: -1, itemSize: null, getItemSize: null, fireFirstTimeRenderedEventOnEmptyObservableArray: false, _firstTimeRenderCompleted: false, _internalDeclarativeRenderHelper: null, _declarativeRenderHelper: {
+ get: function () {
+ if (!this._internalDeclarativeRenderHelper)
+ this._internalDeclarativeRenderHelper = new MS.Entertainment.UI.Controls.DeclarativeItemsControlRenderHelper;
+ return this._internalDeclarativeRenderHelper
+ }
+ }, _scroller: {
+ get: function () {
+ if (this.useParentAsScrollContainer)
+ if (this.parentScroller)
+ return this.parentScroller;
+ else
+ return this.repeaterContainer.parentElement;
+ return this.repeaterContainer
+ }
+ }, _itemTemplate: null, _itemTemplateSet: null, itemTemplate: {
+ get: function () {
+ return this._itemTemplate
+ }, set: function (value) {
+ this._itemTemplate = value;
+ this._itemTemplateProvider = null;
+ if (this._itemTemplate && this._itemTemplateSet) {
+ this._itemTemplateSet(value);
+ this._itemTemplateSet = null
+ }
+ }
+ }, _virtualize: false, virtualize: {
+ get: function itemsControl_virtualize_get() {
+ return this._virtualize
+ }, set: function itemsControl_virtualize_set(value) {
+ if (this._constructed)
+ throw new Error("Can't set the virtualization setting after construction");
+ this._virtualize = value
+ }
+ }, singleAxis: true, containerStyle: null, animateIn: true, bringIntoViewRightMargin: 0, bringIntoViewLeftMargin: 0, _highestIndexItemToRender: -1, _scrollTopPosition: -1, _scrollLeftPosition: -1, _scrollerHeight: -1, _scrollerWidth: -1, _firstVerticalItemScrollOffset: -1, _firstHorizontalItemScrollOffset: -1, _itemTemplateProvider: null, _workingDataSource: null, _pendedBringItemIntoViewItem: null, controlName: "ItemsControl", _dataSource: undefined, _firstTimeRenderedCount: -1, _isRTL: null, _frozen: false, repeaterContainer: null, isFirstTimeRendered: false, dataSource: {
+ get: function () {
+ return this._dataSource
+ }, set: function (value) {
+ if (value === this._dataSource)
+ return;
+ var oldValue = this._dataSource;
+ this._dataSource = value;
+ if (this._dataBindingHandler)
+ this._dataBindingHandler(value, oldValue);
+ else
+ this._listChangedHandler(value, oldValue);
+ if (!oldValue && value)
+ this._initializeWithData();
+ this.notify("dataSource", value, oldValue)
+ }
+ }, initialize: function initialize() {
+ if (this.dataSource)
+ this._initializeWithData()
+ }, unload: function unload() {
+ if (this._workingDataSource) {
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = null
+ }
+ if (this._scrollerEvents) {
+ this._scrollerEvents.cancel();
+ this._scrollerEvents = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._frozen = true;
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._frozen = false
+ }, _initializeWithData: function _initializeWithData() {
+ this._loadItemTemplateIgnoreErrors();
+ if (this.keyboardNavigable)
+ this._keyboardNavigationManager = new this.keyboardNavigationManagerClass(this.repeaterContainer, null, this.keyboardNavigationSetTabIndex)
+ }, loadItemTemplate: function loadItemTemplate() {
+ var completePromise;
+ if (!this._itemTemplateProvider)
+ completePromise = this._loadTemplate(this.itemTemplate, null, true);
+ else
+ completePromise = WinJS.Promise.wrap(this._itemTemplateProvider);
+ completePromise = completePromise || WinJS.Promise.wrapError(new Error("No item template provided"));
+ return completePromise.then(function (template) {
+ this._itemTemplateProvider = template;
+ return template
+ }.bind(this))
+ }, _loadItemTemplateIgnoreErrors: function _loadItemTemplateIgnoreErrors() {
+ this.loadItemTemplate().done(null, function () { })
+ }, selectTemplate: function (item) {
+ return this.loadItemTemplate().then(function () {
+ return this._itemTemplateProvider
+ }.bind(this))
+ }, render: function (sourceChanged) {
+ if (this.virtualize)
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length === 0, "List should not have items");
+ this._setSizeForScrolling();
+ if (this._workingDataSource && this._workingDataSource.length) {
+ if (this.applyPanelTemplate)
+ this.applyPanelTemplate();
+ var loadTemplatePromise = null;
+ if ((!this._firstTimeRenderCompleted && this.repeaterContainer.children.length) || !this.itemTemplate)
+ loadTemplatePromise = WinJS.Promise.as();
+ else
+ loadTemplatePromise = this.loadItemTemplate();
+ loadTemplatePromise.then(function renderOnceTemplateProviderLoaded() {
+ var workingLength = this._workingDataSource ? this._workingDataSource.length : 0;
+ if (this.virtualize && this.highestIndexItemToRender !== 0)
+ workingLength = Math.min(this.highestIndexItemToRender, workingLength);
+ if (this._firstTimeRenderCompleted)
+ MS.Entertainment.UI.Framework.empty(this.repeaterContainer);
+ if (this._firstTimeRenderedCount === -1) {
+ this._firstTimeRenderedCount = this.deferForLongLists ? Math.min(workingLength, this.longListDeferalItemLimit) : workingLength;
+ for (var i = this.repeaterContainer.children.length - 1; i >= this._firstTimeRenderedCount; i--)
+ this.repeaterContainer.removeChild(this.repeaterContainer.children[i])
+ }
+ for (var i = 0; i < workingLength; i++) {
+ if (this.deferForLongLists && (i === this.longListDeferalItemLimit))
+ break;
+ this._renderItem(this._workingDataSource.item(i), i)
+ }
+ if (this.deferForLongLists && i < workingLength)
+ window.requestAnimationFrame(function () {
+ for (; i < workingLength; i++) {
+ if ((i % (this.longListDeferalItemLimit * 2)) === 0)
+ MS.Entertainment.UI.Framework.forceFullLayout();
+ this._renderItem(this._workingDataSource.item(i))
+ }
+ }.bind(this));
+ if (this.itemsRendered)
+ this.itemsRendered();
+ if (this.restoreFocus)
+ this.restoreFocus()
+ }.bind(this))
+ }
+ else {
+ if (sourceChanged)
+ MS.Entertainment.UI.Framework.empty(this.repeaterContainer);
+ var isEmptyArray = (this.dataSource && Array.isArray(this.dataSource) && this.dataSource.length === 0);
+ var isEmptyObservableArray = (this.dataSource && this.dataSource instanceof MS.Entertainment.ObservableArray && this.dataSource.length === 0);
+ if (isEmptyArray || (isEmptyObservableArray && this.fireFirstTimeRenderedEventOnEmptyObservableArray))
+ if (this._firstTimeRenderedCount === -1) {
+ this._firstTimeRenderedCount = 0;
+ this._sendFirstTimeRenderedEvent()
+ }
+ }
+ this._firstTimeRenderCompleted = true
+ }, highestIndexItemToRender: {
+ get: function highestIndexItemToRender_get() {
+ if (this._highestIndexItemToRender === -1)
+ if (!this.virtualize)
+ this._highestIndexItemToRender = this._workingDataSource.length;
+ else {
+ var minTargetPositionWidth = WinJS.Utilities.getMember("domElement.currentStyle.maxWidth", this);
+ var minTargetPositionHeight = WinJS.Utilities.getMember("domElement.currentStyle.maxHeight", this);
+ minTargetPositionWidth = parseInt(minTargetPositionWidth) || 0;
+ minTargetPositionHeight = parseInt(minTargetPositionHeight) || 0;
+ var targetPosition = {
+ horizontal: this.scrollLeftPosition + Math.max(this.scrollerWidth, minTargetPositionWidth), vertical: this.scrollTopPosition + Math.max(this.scrollerHeight, minTargetPositionHeight)
+ };
+ this._highestIndexItemToRender = this.getHighestItemToRenderForScrollPosition(targetPosition)
+ }
+ return this._highestIndexItemToRender
+ }
+ }, getHighestItemToRenderForScrollPosition: function getHighestItemToRenderForScrollPosition(targetPosition) {
+ var itemCount;
+ if (this.singleAxis) {
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "horizontal";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "vertical";
+ itemCount = (targetPosition[axis] - this.firstItemScrollOffset) / this.itemSize
+ }
+ else
+ itemCount = this._multipleAxisItemCount(targetPosition);
+ return Math.ceil(Math.abs(itemCount))
+ }, _getVerticalAxisItemCount: function _getVerticalAxisItemCount(targetVerticalPosition) {
+ var viewportHeight = targetVerticalPosition - this.firstVerticalItemScrollOffset;
+ var verticalItems = viewportHeight / this.itemSize.height;
+ return verticalItems
+ }, _getHorizontalAxisItemCount: function _getHorizontalAxisItemCount(targetHorizontalPosition) {
+ var viewportWidth = targetHorizontalPosition - this.firstHorizontalItemScrollOffset;
+ var horizontalItems = viewportWidth / this.itemSize.width;
+ return horizontalItems
+ }, _multipleAxisItemCount: function _multipleAxisItemCount(targetPosition) {
+ var verticalItems;
+ var horizontalItems;
+ switch (this.virtualizationAxis) {
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal:
+ verticalItems = Math.floor(this._getVerticalAxisItemCount(targetPosition.vertical));
+ horizontalItems = Math.ceil(this._getHorizontalAxisItemCount(targetPosition.horizontal));
+ break;
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical:
+ verticalItems = Math.ceil(this._getVerticalAxisItemCount(targetPosition.vertical));
+ horizontalItems = Math.floor(this._getHorizontalAxisItemCount(targetPosition.horizontal));
+ break;
+ default:
+ MS.Entertainment.UI.Controls.fail("Unexpected Axis: " + this.virtualizationAxis);
+ verticalItems = 0;
+ horizontalItems = 0;
+ break
+ }
+ return horizontalItems * verticalItems
+ }, firstItemScrollOffset: {
+ get: function itemsControl_firstItemScrollOffset() {
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ return this.firstHorizontalItemScrollOffset;
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ return this.firstVerticalItemScrollOffset
+ }
+ }, firstVerticalItemScrollOffset: {
+ get: function itemsControl_firstVerticalItemScrollOffset() {
+ if (!this.useParentAsScrollContainer)
+ return 0;
+ if (this._firstVerticalItemScrollOffset === -1) {
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(this.repeaterContainer, this._scroller).top;
+ this._firstVerticalItemScrollOffset = relativePosition
+ }
+ return this._firstVerticalItemScrollOffset
+ }
+ }, firstHorizontalItemScrollOffset: {
+ get: function itemsControl_firstHorizonalItemScrollOffset() {
+ if (!this.useParentAsScrollContainer)
+ return 0;
+ if (this._firstHorizontalItemScrollOffset === -1) {
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(this.repeaterContainer, this._scroller).left;
+ if (this.isRTL)
+ relativePosition += ((this.repeaterContainer.calculatedSize || this.repeaterContainer.clientWidth) - this.scrollerWidth);
+ this._firstHorizontalItemScrollOffset = Math.abs(relativePosition)
+ }
+ return this._firstHorizontalItemScrollOffset
+ }
+ }, getItemSizeForIndex: function getItemSizeForIndex(index) {
+ return this.itemSize
+ }, scrollLeftPosition: {
+ get: function itemsControl_scrollLeftPosition() {
+ if (this._scrollLeftPosition === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollLeftPosition = this._scroller.scrollLeft;
+ this._skipResize = false
+ }
+ return this._scrollLeftPosition
+ }
+ }, scrollTopPosition: {
+ get: function itemsControl_scrollTopPosition() {
+ if (this._scrollTopPosition === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollTopPosition = this._scroller.scrollTop;
+ this._skipResize = false
+ }
+ return this._scrollTopPosition
+ }
+ }, scrollerHeight: {
+ get: function itemsControl_scrollerHeight() {
+ if (this._scrollerHeight === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollerHeight = this._scroller.clientHeight;
+ this._skipResize = false
+ }
+ return this._scrollerHeight
+ }
+ }, scrollerWidth: {
+ get: function itemsControl_scrollerWidth() {
+ if (this._scrollerWidth === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollerWidth = this._scroller.clientWidth;
+ this._skipResize = false
+ }
+ return this._scrollerWidth
+ }
+ }, viewportWidth: {
+ get: function viewportWidth_get() {
+ return this.scrollLeftPosition + this.scrollerWidth - this.firstHorizontalItemScrollOffset
+ }
+ }, viewportHeight: {
+ get: function viewportHeight_get() {
+ return this.scrollTopPosition + this.scrollerHeight - this.firstVerticalItemScrollOffset
+ }
+ }, itemsPerColumn: {
+ get: function itemsPerColumn_get() {
+ return Math.floor(this.viewportHeight / this.itemSize.height)
+ }
+ }, isRTL: {
+ get: function isRTL_get() {
+ if (this._isRTL === null)
+ this._isRTL = (MS.Entertainment.UI.Framework.getTextDirectionForElement(this.domElement) === MS.Entertainment.UI.Framework.TextDirections.RightToLeft);
+ return this._isRTL
+ }
+ }, _isIndexInRealizedArea: function _isIndexInRealizedArea(index) {
+ if (!this.virtualize)
+ return true;
+ if (index < this.highestIndexItemToRender)
+ return true;
+ return false
+ }, _ensureRealizedToRealizedItemLimit: function _ensureRealizedToRealizedItemLimit() {
+ if (!this._workingDataSource || !this._workingDataSource.length)
+ return;
+ if (this.repeaterContainer.children.length > this.highestIndexItemToRender)
+ return;
+ if ((this._workingDataSource.length < this.highestIndexItemToRender) && (this.repeaterContainer.children.length === this._workingDataSource.length))
+ return;
+ if (this.virtualize)
+ this._firstTimeRenderedCount = Math.min(this._firstTimeRenderedCount, this.highestIndexItemToRender);
+ if (!this._firstTimeRenderCompleted)
+ return;
+ for (var i = this.repeaterContainer.children.length; i < this._workingDataSource.length; i++)
+ this._renderItem(this._workingDataSource.item(i), i)
+ }, _handleElementResizing: function _handleElementResizing() {
+ if (this._skipResize)
+ return;
+ this._resetVirtualizationCaches();
+ this._ensureRealizedToRealizedItemLimit()
+ }, _resetVirtualizationCaches: function _resetVirtualizatonCaches() {
+ this._scrollerHeight = -1;
+ this._scrollerWidth = -1;
+ this._scrollLeftPosition = -1;
+ this._scrollTopPosition = -1;
+ this._firstHorizontalItemScrollOffset = -1;
+ this._firstVerticalItemScrollOffset = -1;
+ this._highestIndexItemToRender = -1;
+ if (this.repeaterContainer)
+ this.repeaterContainer.calculatedSize = undefined
+ }, _handleScrollingForVirtualization: function _handleScrollingForVirtualization() {
+ this._scrollLeftPosition = -1;
+ this._scrollTopPosition = -1;
+ this._highestIndexItemToRender = -1;
+ this._ensureRealizedToRealizedItemLimit();
+ this.dispatchEvent("itemsControlScrolled")
+ }, _setSizeForScrolling: function _setSizeForScrolling() {
+ if (!(this.useParentAsScrollContainer && this.virtualize))
+ return;
+ var size = 0;
+ if (this._workingDataSource && this._workingDataSource.length)
+ if (this.singleAxis)
+ size = (this.itemSize * this._workingDataSource.length);
+ else
+ size = this._getMultipleAxisScrollingSize();
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "width";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "height";
+ this.repeaterContainer.style[axis] = (size ? size + "px" : String.empty);
+ this.repeaterContainer.calculatedSize = size;
+ this.dispatchEvent("scrollSizeChanged")
+ }, _getMultipleAxisScrollingSize: function _getMultipleAxisScrollingSize() {
+ var itemCount;
+ var itemSize;
+ switch (this.virtualizationAxis) {
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal:
+ itemCount = this._workingDataSource.length / Math.floor(this._getVerticalAxisItemCount(this.viewportHeight));
+ itemSize = this.itemSize.width;
+ break;
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical:
+ itemCount = this._workingDataSource.length / Math.floor(this._getHorizontalAxisItemCount(this.viewportWidth));
+ itemSize = this.itemSize.height;
+ break;
+ default:
+ MS.Entertainment.UI.Controls.fail("Unexpected Axis: " + this.virtualizationAxis);
+ itemCount = 0;
+ itemSize = 0;
+ break
+ }
+ itemCount = Math.ceil(itemCount);
+ return itemSize * itemCount
+ }, processItemData: function processItemData(data, index) {
+ return data
+ }, bringItemIntoView: function bringItemIntoView(item, options) {
+ options = options || {};
+ MS.Entertainment.UI.Controls.assert(item, "You need an item to bring into view");
+ var itemBroughtIntoView = WinJS.Promise.as();
+ if (!item)
+ return itemBroughtIntoView;
+ if (!this._workingDataSource) {
+ var pendeditem = {
+ item: item, completePromise: null
+ };
+ this._pendedBringItemIntoViewItem = pendeditem;
+ return new WinJS.Promise(function (c) {
+ pendeditem.completePromise = c
+ })
+ }
+ var index = this._workingDataSource ? this._workingDataSource.indexOf(item) : -1;
+ MS.Entertainment.assert(index > -1, "item not found in data source");
+ var element = this.repeaterContainer.children[index];
+ if (!element) {
+ var pendeditem = {
+ item: item, completePromise: null
+ };
+ this._pendedBringItemIntoViewItem = pendeditem;
+ return new WinJS.Promise(function (c) {
+ pendeditem.completePromise = c
+ })
+ }
+ if (!options.bringOnMinimally && !options.animated)
+ element.scrollIntoView();
+ else {
+ var targetPosition = this.getScrollPositionToShowItem(item, {
+ bringOnMinimally: options.bringOnMinimally, alwaysAlignLeftEdge: options.alwaysAlignLeftEdge
+ });
+ if (targetPosition != -1)
+ itemBroughtIntoView = this._performScroll(targetPosition, options.animated, options.ignoreMissingStarts)
+ }
+ return itemBroughtIntoView
+ }, scrollToPosition: function scrollToPosition(scrollPosition, options) {
+ this._performScroll(scrollPosition, options.animated, options.ignoreMissingStarts, options.useZoomTo)
+ }, getScrollPositionToShowItemFromIndex: function getScrollPositionToShowItemFromIndex(index) {
+ if (this.singleAxis) {
+ if (index === 0)
+ return 0;
+ return Math.min(this.firstItemScrollOffset + ((index - 1) * this.itemSize), (this._scroller.scrollWidth - this.scrollerWidth))
+ }
+ else {
+ var verticalAxisItemCount = this.itemsPerColumn;
+ if (!verticalAxisItemCount)
+ return 0;
+ var column = Math.floor(index / verticalAxisItemCount);
+ return Math.min(this.firstItemScrollOffset + ((column - 1) * this.itemSize.width), (this._scroller.scrollWidth - this.scrollerWidth))
+ }
+ }, getScrollPositionToShowItem: function (item, options) {
+ options = options || {};
+ var result = -1;
+ MS.Entertainment.UI.Controls.assert(item, "Required an item");
+ if (!item)
+ return result;
+ var index = this._workingDataSource ? this._workingDataSource.indexOf(item) : -1;
+ MS.Entertainment.assert(index > -1, "item not found in data source");
+ var element = this.repeaterContainer.children[index];
+ if (!element)
+ return result;
+ var rightMargin = this.bringIntoViewRightMargin;
+ var leftMargin = this.bringIntoViewLeftMargin;
+ if (!options.bringOnMinimally) {
+ rightMargin = 0;
+ leftMargin = 0
+ }
+ var minRightEdgeOnScreen = (element.offsetLeft + element.clientWidth + rightMargin) - this._scroller.clientWidth;
+ var minLeftEdgeOnScreen = Math.max(0, element.offsetLeft - leftMargin);
+ if (MS.Entertainment.UI.Framework.getTextDirection() === MS.Entertainment.UI.Framework.TextDirections.RightToLeft) {
+ minLeftEdgeOnScreen = (this._scroller.clientWidth - element.offsetLeft - element.clientWidth - rightMargin);
+ minRightEdgeOnScreen = leftMargin - element.offsetLeft
+ }
+ var isRightEdgeOnScreen = this._scroller.scrollLeft >= minRightEdgeOnScreen;
+ var isLeftEdgeOnScreen = this._scroller.scrollLeft <= minLeftEdgeOnScreen;
+ var targetScrollPosition = -1;
+ if (options.alwaysAlignLeftEdge) {
+ minLeftEdgeOnScreen = Math.min(minLeftEdgeOnScreen, Math.max(0, (this._scroller.scrollWidth - this._scroller.clientWidth)));
+ targetScrollPosition = minLeftEdgeOnScreen
+ }
+ else if (!(isRightEdgeOnScreen && isLeftEdgeOnScreen))
+ if (!isRightEdgeOnScreen)
+ targetScrollPosition = minRightEdgeOnScreen;
+ else if (!isLeftEdgeOnScreen)
+ targetScrollPosition = minLeftEdgeOnScreen;
+ return targetScrollPosition
+ }, getElementForItem: function getElementForItem(item) {
+ var index = this._workingDataSource ? this._workingDataSource.indexOf(item) : -1;
+ return this.repeaterContainer.children[index]
+ }, getElementForIndex: function getElementForIndex(index) {
+ if (!(this.repeaterContainer && this.repeaterContainer.children)) {
+ MS.Entertainment.UI.Controls.fail("getElementForIndex called on items control with no repeater");
+ return null
+ }
+ return this.repeaterContainer.children[index]
+ }, getIndexForElement: function getElementForIndex(element) {
+ var currentItem = 0;
+ var returnIndex = -1;
+ if (this.repeaterContainer && this.repeaterContainer.children)
+ for (var i = 0; i < this.repeaterContainer.children.length; i++) {
+ currentItem = this.repeaterContainer.children[i];
+ if (currentItem === element || currentItem.contains(element)) {
+ returnIndex = i;
+ break
+ }
+ }
+ return returnIndex
+ }, _performScroll: function _performScroll(scrollLeft, animated, ignoreMissingStarts, useZoomTo) {
+ if (useZoomTo) {
+ this._scroller.msZoomTo({ contentX: scrollLeft });
+ return WinJS.Promise.as()
+ }
+ if (!animated) {
+ this._scroller.scrollLeft = scrollLeft;
+ return WinJS.Promise.as()
+ }
+ return MS.Entertainment.UI.Framework.scrollIntoViewWithAnimation(this._scroller, scrollLeft, ignoreMissingStarts)
+ }, _loadTemplate: function _loadTemplate(template) {
+ var completePromise = WinJS.Promise.as(template);
+ if (!template)
+ completePromise = new WinJS.Promise(function (c, e, p) {
+ this._itemTemplateSet = c
+ }.bind(this));
+ completePromise = completePromise.then(function (validTemplate) {
+ if (typeof validTemplate === "string")
+ return MS.Entertainment.UI.Framework.loadTemplate(validTemplate, null, true);
+ else if (validTemplate)
+ return WinJS.Promise.wrap(validTemplate.winControl)
+ });
+ return completePromise
+ }, _listChangedHandler: function _listChangedHandler(newValue, oldValue) {
+ if (this._unloaded)
+ return;
+ if (!newValue) {
+ if (this._workingDataSource) {
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = null;
+ this._resetDomState()
+ }
+ if (newValue === null && this.itemsRendered)
+ this.itemsRendered();
+ return
+ }
+ if (this._workingDataSource)
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ var tempWorkingData = WinJS.Binding.unwrap(newValue);
+ if (!(newValue instanceof MS.Entertainment.ObservableArray))
+ tempWorkingData = new MS.Entertainment.ObservableArray(newValue);
+ if (tempWorkingData)
+ tempWorkingData.addChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = tempWorkingData;
+ if (this.itemsChanged)
+ this.itemsChanged();
+ if (newValue || oldValue) {
+ if (this._firstTimeRenderCompleted)
+ this._resetDomState();
+ this.render(newValue && oldValue)
+ }
+ }, _renderItem: function _renderItemToIndex(item, index) {
+ if (this.virtualize) {
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this._workingDataSource.length, "Found more children that we should have had");
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this.dataSource.length, "Found more children that we should have had")
+ }
+ if (!this._isIndexInRealizedArea(index))
+ return;
+ item = this.processItemData(item, index);
+ var container = null;
+ var selectionPromise = null;
+ if (!this._firstTimeRenderCompleted && index < this.repeaterContainer.children.length) {
+ container = this.repeaterContainer.children[index];
+ selectionPromise = WinJS.Promise.as(this._declarativeRenderHelper)
+ }
+ else
+ selectionPromise = this.selectTemplate(item);
+ selectionPromise.then(function withSelectedTemplate(itemTemplateProvider) {
+ var element;
+ if (!container)
+ container = document.createElement(itemTemplateProvider.element.tagName);
+ var that = this;
+ var upperBound = (this._workingDataSource && this._workingDataSource.length - 1) || 0;
+ var end;
+ var start;
+ if (upperBound < 0)
+ upperBound = 0;
+ end = (index >= upperBound) || (index === undefined);
+ start = (index < 1);
+ if (!end || !(end && start) && index)
+ element = this.repeaterContainer.children[index];
+ if (end || (end && start) || !element)
+ that.repeaterContainer.appendChild(container);
+ else
+ that.repeaterContainer.insertBefore(container, element);
+ if (that.containerStyle)
+ WinJS.Utilities.addClass(container, that.containerStyle);
+ if (this.virtualize) {
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this._workingDataSource.length, "Found more children that we should have had");
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this.dataSource.length, "Found more children that we should have had")
+ }
+ itemTemplateProvider.render(item, container).then(function (child) {
+ var animationPromise;
+ if (that.applyItemTemplate)
+ container = that.applyItemTemplate(container, item, index);
+ if (that._pendedBringItemIntoViewItem && that._pendedBringItemIntoViewItem.item === item) {
+ var complete = that._pendedBringItemIntoViewItem.completePromise;
+ that._pendedBringItemIntoViewItem = null;
+ that.bringItemIntoView(item, { bringOnMinimally: true }).then(complete)
+ }
+ if (container && that.animateIn && MS.Entertainment.UI.Framework.beginShowAnimations) {
+ var elementToAnimate = container;
+ if (that.useFirstChildForAnimations && container.children.length)
+ elementToAnimate = container.children[0];
+ animationPromise = MS.Entertainment.UI.Framework.beginShowAnimations(elementToAnimate)
+ }
+ if (that._firstTimeRenderedCount > 0) {
+ that._firstTimeRenderedCount--;
+ if (that._firstTimeRenderedCount === 0)
+ that._sendFirstTimeRenderedEvent()
+ }
+ if (index === 0 && that.firstItemTabIndex !== -1) {
+ var firstFocusElement = container.querySelector(".win-focusable");
+ if (firstFocusElement)
+ firstFocusElement.tabIndex = that.firstItemTabIndex
+ }
+ if (index === 0 && that.focusFirstItemOnRender)
+ WinJS.Promise.as(animationPromise).done(function setFocusOnAnimationComplete() {
+ var firstFocusElement = container.querySelector(".win-focusable");
+ if (firstFocusElement)
+ MS.Entertainment.UI.Framework.focusElement(firstFocusElement)
+ });
+ if (that.delayInitializeChildren)
+ that._delayInitializeContainer(container);
+ that.dispatchEvent("itemRendered", {
+ element: container, item: item, index: index
+ })
+ })
+ }.bind(this))
+ }, itemsRendered: function itemsRendered() {
+ if (this.raisePanelReady)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.repeaterContainer);
+ if (MS.Entertainment.UI.Controls.Panel)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReadyTest(this.repeaterContainer);
+ if (this.itemsRenderedCallback)
+ this.itemsRenderedCallback()
+ }, _delayInitializeContainer: function _delayInitializeContainer(container) {
+ if (!this.isDelayInitialized || !container || this._unloaded)
+ return;
+ MS.Entertainment.UI.Framework.delayInitializeChildren(container)
+ }, _sendFirstTimeRenderedEvent: function _sendFirstTimeRenderedEvent() {
+ WinJS.Promise.timeout(1).then(function sendFirstTimeRenderedEvent() {
+ this.isFirstTimeRendered = true;
+ if (this.repeaterContainer) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("firstTimeRendered", true, true);
+ this.repeaterContainer.dispatchEvent(domEvent)
+ }
+ }.bind(this))
+ }, _removeChildrenFromIndex: function _removeChildrenFromIndex(index) {
+ for (var i = this.repeaterContainer.children.length - 1; i >= index; i--)
+ this.repeaterContainer.removeChild(this.repeaterContainer.children[i])
+ }, _resetDomState: function _resetDomState() {
+ MS.Entertainment.UI.Framework.empty(this.repeaterContainer);
+ this._resetVirtualizationCaches()
+ }, _handleChangesInDataSource: function _handleChangesInDataSource(notification) {
+ if (this.itemsChanged)
+ this.itemsChanged(notification);
+ this._highestIndexItemToRender = -1;
+ switch (notification.type) {
+ case MS.Entertainment.ObservableArray.OperationTypes.add:
+ if (this.virtualize && !this._isIndexInRealizedArea(notification.index))
+ this._removeChildrenFromIndex(notification.index);
+ else
+ this._renderItem(notification.item, notification.index);
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.remove:
+ var child = this.repeaterContainer.children[notification.index];
+ if (child) {
+ this.repeaterContainer.removeChild(child);
+ if (this._handleItemRemoved)
+ this._handleItemRemoved(child);
+ if (this.virtualize && !this._isIndexInRealizedArea(notification.index))
+ this._removeChildrenFromIndex(notification.index);
+ this._scrollLeftPosition = -1
+ }
+ if (this.virtualize)
+ this._ensureRealizedToRealizedItemLimit();
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.reset:
+ this._resetDomState();
+ break;
+ default:
+ MS.Entertainment.assert(false, "unsupported notification type: " + notification.type);
+ break
+ }
+ this._setSizeForScrolling()
+ }
+ }, null, {
+ waitForItemsControlRenderEvents: function waitForItemsControlRenderEvents(domElement, numEvents) {
+ return MS.Entertainment.Utilities.waitForDomEventMultipleTimes("firstTimeRendered", domElement, numEvents)
+ }, loadAllItemTemplates: function loadAllItemTemplates() {
+ MS.Entertainment.UI.Controls.assert(Array.isArray(this.itemTemplate), "expected an array");
+ var templateLoadPromises = this.itemTemplate.map(function (templatePath) {
+ return MS.Entertainment.UI.Framework.loadTemplate(templatePath, null, true)
+ });
+ return WinJS.Promise.join(templateLoadPromises)
+ }, handleItemsChanged: function handleItemsChanged(domElement, numEvents) {
+ if (this.repeaterContainer.contains(document.activeElement))
+ this._restoreFocusAfterRender = true;
+ WinJS.Promise.timeout(700).done(function restoreFocus() {
+ if (!document.activeElement && this._restoreFocusAfterRender && MS.Entertainment.UI.Framework.canMoveFocus(this.repeaterContainer))
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.repeaterContainer);
+ this._restoreFocusAfterRender = false
+ }.bind(this))
+ }, ContainerStyles: {
+ none: "", horizontalFlow: "horizontalFlow", verticalFlow: "verticalFlow", listFlowLeft: "listFlowLeft"
+ }, VirtualizationAxis: {
+ horizontal: "horizontal", vertical: "vertical"
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ FlexibleItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function (element, options) {
+ WinJS.Utilities.addClass(element, "flexibleItemsControlContainer");
+ this.applyPanelTemplate = this.applyPanelTemplate.bind(this);
+ this.onItemClicked = this._onItemClicked.bind(this)
+ }, {
+ dataContext: null, itemTemplates: null, itemSize: null, rowLayout: false, fixedRowCount: null, fixedColumnCount: null, skipSettingWidth: false, skipSettingHeight: false, reflowOnWindowSizeChanged: false, restoreFocusOnUpdate: false, restoreFocusAfterBackNavigate: false, enableClickEvents: false, _loadTemplatePromise: null, _restoreFocusAfterRender: false, _restoreFocusAfterBackNavigate: false, applyPanelTemplate: function applyPanelTemplate() {
+ var dataLength = this._workingDataSource ? this._workingDataSource.length : 1;
+ var rowCount;
+ var columnCount;
+ var hasFixedRowCount = typeof this.fixedRowCount === "number";
+ var hasFixedColumnCount = typeof this.fixedColumnCount === "number";
+ if (hasFixedRowCount && !hasFixedColumnCount) {
+ rowCount = this.fixedRowCount;
+ columnCount = Math.max(Math.ceil(dataLength / rowCount), 1)
+ }
+ else if (!hasFixedRowCount && hasFixedColumnCount) {
+ columnCount = this.fixedColumnCount;
+ rowCount = Math.max(Math.ceil(dataLength / columnCount), 1)
+ }
+ else if (hasFixedRowCount && hasFixedColumnCount) {
+ rowCount = this.fixedRowCount;
+ columnCount = this.fixedColumnCount
+ }
+ else {
+ rowCount = MS.Entertainment.Utilities.getRowCountForResolution();
+ columnCount = Math.max(Math.ceil(dataLength / rowCount), 1)
+ }
+ MS.Entertainment.UI.Controls.assert(dataLength <= (rowCount * columnCount), "FlexibleItemsControl_applyPanelTemplate: Items don't fit in the container.");
+ var explicitWidth = (columnCount * this.itemSize.width) + "px";
+ var explicitHeight = (rowCount * this.itemSize.height) + "px";
+ if (!this.skipSettingWidth && this.repeaterContainer.style.width !== explicitWidth)
+ this.repeaterContainer.style.width = explicitWidth;
+ if (!this.skipSettingHeight && this.repeaterContainer.style.height !== explicitHeight)
+ this.repeaterContainer.style.height = explicitHeight;
+ if (this.rowLayout)
+ WinJS.Utilities.addClass(this.repeaterContainer, "flexRowLayout");
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("SizeAdjusted", true, true);
+ this.repeaterContainer.dispatchEvent(domEvent)
+ }, itemsChanged: function itemsChanged() {
+ if (this.restoreFocusOnUpdate && this.repeaterContainer.contains(document.activeElement))
+ this._restoreFocusAfterRender = true;
+ this.applyPanelTemplate();
+ WinJS.Promise.timeout(1).done(function restoreFocus() {
+ if (!document.activeElement)
+ this.restoreFocus()
+ }.bind(this))
+ }, restoreFocus: function restoreFocus() {
+ if ((this._restoreFocusAfterRender || this._restoreFocusAfterBackNavigate) && MS.Entertainment.UI.Framework.canMoveFocus(this.repeaterContainer)) {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.repeaterContainer);
+ this._restoreFocusAfterBackNavigate = false
+ }
+ this._restoreFocusAfterRender = false
+ }, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.apply(this, arguments);
+ if (this.reflowOnWindowSizeChanged && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).addEventListener("windowresize", this.applyPanelTemplate);
+ if (this.enableClickEvents)
+ this.repeaterContainer.addEventListener("click", this.onItemClicked)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.thaw.call(this);
+ if (this.dataContext && this.dataContext.thaw)
+ this.dataContext.thaw();
+ if (!document.activeElement && this.restoreFocusAfterBackNavigate)
+ this.restoreFocus()
+ }, unload: function unload() {
+ if (this.reflowOnWindowSizeChanged && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).removeEventListener("windowresize", this.applyPanelTemplate);
+ if (this.enableClickEvents)
+ this.repeaterContainer.removeEventListener("click", this.onItemClicked);
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, applyItemTemplate: function applyItemTemplate(container, item, index) {
+ WinJS.Utilities.addClass(container, "flexibleItemsControlItemContainer");
+ if (index !== null && index !== undefined) {
+ WinJS.Utilities.addClass(container, "item" + index);
+ if (item && item.automaticFocusOverride) {
+ var focusItem = container.querySelector(".win-focusable");
+ if (focusItem)
+ focusItem.setAttribute("data-win-focus", item.automaticFocusOverride)
+ }
+ }
+ return container
+ }, resetItemTemplate: function resetItemTemplate() {
+ if (this._loadTemplatePromise) {
+ this._loadTemplatePromise.cancel();
+ this._loadTemplatePromise = null
+ }
+ this.loadItemTemplate()
+ }, loadItemTemplate: function () {
+ MS.Entertainment.UI.Controls.assert(!this.itemTemplate, "Do not support non-array template");
+ MS.Entertainment.UI.Controls.assert(Array.isArray(this.itemTemplates), "expected an array");
+ if (this._loadTemplatePromise)
+ return this._loadTemplatePromise;
+ var templateLoadPromises = [];
+ var loadedTemplates = {};
+ this.itemTemplates.forEach(function (item) {
+ var promise = MS.Entertainment.UI.Framework.loadTemplate(item.template, null, true).then(function (template) {
+ loadedTemplates[item.value] = template
+ });
+ templateLoadPromises.push(promise)
+ });
+ this._loadTemplatePromise = WinJS.Promise.join(templateLoadPromises).then(function () {
+ this._itemTemplateProviders = loadedTemplates
+ }.bind(this));
+ return this._loadTemplatePromise
+ }, selectTemplate: function selectTemplate(item) {
+ return this.loadItemTemplate().then(function () {
+ var propertyValue = WinJS.Utilities.getMember(this._getPropertyToCheck(item), item);
+ MS.Entertainment.UI.Controls.assert(propertyValue, "Couldn't find that property on the data, it was falsey.");
+ var template = this._itemTemplateProviders[propertyValue];
+ MS.Entertainment.UI.Controls.assert(template, "Couldn't find a template for property: " + this.propertyName + " with value: " + propertyValue);
+ return template
+ }.bind(this))
+ }, _getPropertyToCheck: function _getPropertyToCheck(item) {
+ if (!Array.isArray(this.propertyName))
+ return this.propertyName;
+ var propertyName;
+ for (var i = 0; i < this.propertyName.length; i++)
+ if (item[this.propertyName[i]]) {
+ propertyName = this.propertyName[i];
+ break
+ }
+ return propertyName
+ }, _onItemClicked: function _onItemClicked(e) {
+ var element = e.srcElement;
+ while (element && element !== this.repeaterContainer) {
+ if (element.clickDataContext && element.clickDataContext.doclick) {
+ element.clickDataContext.doclick({
+ target: element.clickDataContext, domElement: element
+ });
+ e.stopPropagation();
+ if (this.restoreFocusAfterBackNavigate)
+ this._restoreFocusAfterBackNavigate = true;
+ return
+ }
+ element = element.parentElement
+ }
+ }
+ }, {})
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ DeclarativeItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, null, null, { isDeclarativeControlContainer: true }), DeclarativeItemsControlRenderHelper: MS.Entertainment.UI.Framework.define(function DeclarativeItemsControlRenderHelper() { }, {
+ render: function render(dataContext, container) {
+ return WinJS.UI.processAll(container).then(function bindingProcessAllAfterControlProcessAll() {
+ return WinJS.Binding.processAll(container, dataContext)
+ }).then(function returnContainer() {
+ return container
+ })
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ItemsControlWithViewModel: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function itemsControlWithViewModel(element, options) { }, {
+ listViewModel: null, controlName: "ItemsControlWithViewModel", processItemData: function processItemData(itemData, index) {
+ return new MS.Entertainment.UI.Controls.ItemsControlViewModel(itemData, this.listViewModel, index)
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ItemsControlWithVariableSizeItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function ItemsControlWithVariableSizeItems(element, options) {
+ if (!this.getItemSize)
+ throw new Error("getItemSize function is required when using variable sized items");
+ }, {
+ virtualize: true, additionalScrollContainerPadding: 0, additionalItemsToRealize: 0, _restoreFocusPromise: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.call(this);
+ this._restoreFocus = this._restoreFocus.bind(this);
+ WinJS.Utilities.addClass(this.domElement, "listContainer")
+ }, unload: function unload() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.freeze.call(this)
+ }, getHighestItemToRenderForScrollPosition: function getHighestItemToRenderForScrollPosition(targetPosition) {
+ var itemCount = 0;
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "horizontal";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "vertical";
+ var currentHighestViewportPosition = targetPosition[axis] - this.firstItemScrollOffset;
+ var summedSize = 0;
+ var workingLength = this._workingDataSource.length;
+ while (summedSize < currentHighestViewportPosition && itemCount < workingLength) {
+ summedSize += this.getItemSize(this._workingDataSource.item(itemCount), itemCount);
+ itemCount++
+ }
+ if (this.additionalItemsToRealize) {
+ var adjustedItemIndex = Math.min(itemCount + this.additionalItemsToRealize, workingLength);
+ itemCount = adjustedItemIndex
+ }
+ return itemCount
+ }, getScrollPositionToShowItemFromIndex: function getScrollPositionToShowItemFromIndex(index) {
+ var summedSize = 0;
+ for (var i = 0; i < index - 1; i++)
+ summedSize += this.getItemSize(this._workingDataSource.item(i), i);
+ return summedSize
+ }, _setSizeForScrolling: function _setSizeForScrolling() {
+ if (!(this.useParentAsScrollContainer && this.virtualize))
+ return;
+ var size = String.empty;
+ if (this._workingDataSource && this._workingDataSource.length) {
+ var summedSize = 0;
+ this._workingDataSource.forEach(function sumItemSize(item, index) {
+ summedSize += this.getItemSize(item, index)
+ }.bind(this));
+ summedSize += this.additionalScrollContainerPadding;
+ size = summedSize + "px"
+ }
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "width";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "height";
+ this.repeaterContainer.style[axis] = size;
+ this.repeaterContainer.calculatedSize = size;
+ this.dispatchEvent("scrollSizeChanged")
+ }, getItemSizeForIndex: function getItemSizeForIndex(index) {
+ if (index < this._workingDataSource.length)
+ return this.getItemSize(this._workingDataSource.item(index))
+ }, itemsRendered: function itemsRendered() {
+ if (this.focusFirstItemOnRender)
+ this._restoreFocus();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.itemsRendered.call(this)
+ }, _restoreFocus: function _restoreFocus() {
+ this._clearFocusPromise();
+ var firstItemFocused = false;
+ if (this._unloaded)
+ return;
+ if (!MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer)) {
+ var firstItemFromSelector = this.repeaterContainer.querySelector(".listContainer > :first-child .win-focusable");
+ if (firstItemFromSelector)
+ MS.Entertainment.UI.Framework.focusElement(firstItemFromSelector)
+ }
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer))
+ firstItemFocused = true;
+ if (!firstItemFocused)
+ this._createFocusPromise()
+ }, _createFocusPromise: function _createFocusPromise(timeout) {
+ timeout = isNaN(timeout) ? 100 : timeout;
+ this._clearFocusPromise();
+ this._restoreFocusPromise = WinJS.Promise.timeout(timeout).then(this._restoreFocus)
+ }, _clearFocusPromise: function _clearFocusPromise() {
+ if (this._restoreFocusPromise) {
+ this._restoreFocusPromise.cancel();
+ this._restoreFocusPromise = null
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ItemsControlViewModel: MS.Entertainment.UI.Framework.define(function itemsControlViewModel(data, listViewModel, index) {
+ this.data = data;
+ this.listViewModel = listViewModel;
+ this.index = index
+ }, {
+ listViewModel: null, data: null, index: -1, instance: {
+ get: function () {
+ return this
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ CarouselItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function carouselItemsControl(element, options) {
+ this.delayInitializeChildren = true;
+ if (!this.itemSize)
+ throw new Error("itemSize required when using a carousel");
+ if (!this.virtualizationAxis)
+ throw new Error("virtualizationOrientation required when using virtualization");
+ }, {
+ controlName: "CarouselItemsControl", leftOffset: 0, maxLeftOffset: 0, marginLeftOffset: 0, transitionDuration: 0, _defaultTimeoutMS: 500, _defaultTransitionDuration: 100, applyPanelTemplate: function applyPanelTemplate() {
+ if (this._workingDataSource) {
+ this.repeaterContainer.style.marginLeft = (this.marginLeftOffset - ((this.maxLeftOffset - this.leftOffset) * this.itemSize)) + "px";
+ var marginLeft = WinJS.Utilities.convertToPixels(this.repeaterContainer, window.getComputedStyle(this.repeaterContainer, null)["margin-Left"]);
+ var marginRight = WinJS.Utilities.convertToPixels(this.repeaterContainer, window.getComputedStyle(this.repeaterContainer, null)["margin-Right"]);
+ var buffer = marginLeft + marginRight;
+ this.repeaterContainer.style.width = (this._workingDataSource.length * this.itemSize + buffer) + "px"
+ }
+ }, applyItemTemplate: function applyItemTemplate(container, item, index) {
+ return container
+ }, scrollAnimated: function scrollAnimated(count, removeIndex, timeout) {
+ if (count === 0)
+ return WinJS.Promise.as();
+ if (!MS.Entertainment.UI.Framework.animationsEnabled)
+ return WinJS.Promise.as();
+ var translateDelta = -count * this.itemSize;
+ if (this.repeaterContainer.isAnimatingScroll)
+ return WinJS.Promise.as();
+ var updateItemPosition = function updateItemPosition() {
+ var marginLeft;
+ var actualOffsetLeft = (this.maxLeftOffset - this.leftOffset);
+ var actualOffset = actualOffsetLeft * this.itemSize;
+ marginLeft = (this.marginLeftOffset - actualOffset) + "px";
+ if (removeIndex >= 0) {
+ if (this.repeaterContainer.children.length > removeIndex) {
+ var child = this.repeaterContainer.children[removeIndex];
+ WinJS.Utilities.addClass(child, "removeFromDisplay")
+ }
+ this.dataSource.removeAt(removeIndex)
+ }
+ this.repeaterContainer.style.marginLeft = marginLeft;
+ WinJS.Utilities.removeClass(this.repeaterContainer, "scrollAnimation");
+ this.repeaterContainer.style.msTransform = "";
+ this.repeaterContainer.isAnimatingScroll = null
+ }.bind(this);
+ timeout = timeout || this._defaultTimeoutMS;
+ var timeoutPromise = WinJS.Promise.timeout(timeout).then(function resetAnimatingFlag() {
+ scrollComplete.cancel();
+ timeoutPromise = null
+ }.bind(this));
+ var scrollComplete = this.repeaterContainer.isAnimatingScroll;
+ if (!scrollComplete)
+ scrollComplete = MS.Entertainment.UI.Framework.waitForStartedTransitionsToComplete(this.repeaterContainer.parentElement, true, "scrollAnimation").then(function () {
+ if (timeoutPromise) {
+ timeoutPromise.cancel();
+ timeoutPromise = null
+ }
+ updateItemPosition()
+ }.bind(this), function animationFailed() {
+ updateItemPosition()
+ }.bind(this));
+ else
+ MS.Entertainment.UI.Framework.resetStartedTransitionCount(this.repeaterContainer);
+ WinJS.Utilities.addClass(this.repeaterContainer, "scrollAnimation");
+ var transformStyle = "translateX(" + translateDelta + "px)";
+ var duration = this._defaultTransitionDuration;
+ this.repeaterContainer.transitionDuration = duration;
+ this.repeaterContainer.style.msTransform = transformStyle;
+ this.repeaterContainer.isAnimatingScroll = scrollComplete;
+ return scrollComplete
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ FocusHandlingItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, null, {
+ _restoreFocusPromise: null, _actionsHadFocusOnButtonChange: false, ignoreNextRestoreFocus: false, useSetActive: false, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.call(this);
+ this._restoreFocus = this._restoreFocus.bind(this);
+ WinJS.Utilities.addClass(this.domElement, "listContainer")
+ }, unload: function unload() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.thaw.call(this);
+ this.restoreFocus()
+ }, itemsRendered: function itemsRendered() {
+ WinJS.Promise.timeout(1).done(function raiseReadyEvent() {
+ if (this.repeaterContainer) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("itemsReady", true, true);
+ this.repeaterContainer.dispatchEvent(domEvent)
+ }
+ }.bind(this))
+ }, restoreFocus: function restoreFocus(forceSetFocus) {
+ if (this._frozen || this._unloaded)
+ return;
+ if (this.ignoreNextRestoreFocus) {
+ this.ignoreNextRestoreFocus = false;
+ return
+ }
+ this._clearFocusPromise();
+ if (forceSetFocus)
+ this._actionsHadFocusOnButtonChange = forceSetFocus;
+ if (!this._actionsHadFocusOnButtonChange)
+ return;
+ this._createFocusPromise()
+ }, _restoreFocus: function _restoreFocus() {
+ this._clearFocusPromise();
+ if (this._frozen || this._unloaded)
+ return;
+ if (MS.Entertainment.UI.Framework.isFlyoutVisible())
+ return;
+ if (MS.Entertainment.UI.Framework.isFlyoutVisible())
+ return;
+ if (this._actionsHadFocusOnButtonChange && !MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer)) {
+ var firstItemFromSelector = this.repeaterContainer.querySelector(".listContainer > :first-child .win-focusable");
+ if (firstItemFromSelector)
+ MS.Entertainment.UI.Framework.focusElement(firstItemFromSelector, this.useSetActive)
+ }
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer))
+ this._actionsHadFocusOnButtonChange = false;
+ if (this._actionsHadFocusOnButtonChange)
+ this._createFocusPromise()
+ }, _listChangedHandler: function _listChangedHandler(newValue, oldValue) {
+ if (this._unloaded)
+ return;
+ this._actionsHadFocusOnButtonChange = this._actionsHadFocusOnButtonChange || !document.activeElement || MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer);
+ MS.Entertainment.UI.Controls.ItemsControl.prototype._listChangedHandler.apply(this, arguments)
+ }, _createFocusPromise: function _createFocusPromise(timeout) {
+ timeout = isNaN(timeout) ? 100 : timeout;
+ this._clearFocusPromise();
+ this._restoreFocusPromise = WinJS.Promise.timeout(timeout).then(this._restoreFocus)
+ }, _clearFocusPromise: function _clearFocusPromise() {
+ if (this._restoreFocusPromise) {
+ this._restoreFocusPromise.cancel();
+ this._restoreFocusPromise = null
+ }
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/controls/droptargetcontainer.js:24855 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Controls;
+ (function (Controls) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ var DropTargetContainer = (function (_super) {
+ __extends(DropTargetContainer, _super);
+ function DropTargetContainer() {
+ _super.apply(this, arguments)
+ }
+ Object.defineProperty(DropTargetContainer.prototype, "actionId", {
+ get: function () {
+ return this._actionId
+ }, set: function (value) {
+ Controls.assert(!this.action, "Action has already been set. Cannot set both an action and an action id.");
+ this._actionId = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DropTargetContainer.prototype, "action", {
+ get: function () {
+ if (!this._action && this._actionId) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ this._updateAction(actionService.getAction(this._actionId))
+ }
+ return this._action
+ }, set: function (value) {
+ Controls.assert(!this.actionId, "Action id has already been set. Cannot set both an action and an action id.");
+ this._updateAction(value)
+ }, enumerable: true, configurable: true
+ });
+ DropTargetContainer.prototype._updateAction = function (action) {
+ if (action) {
+ Controls.assert(!this._action, "Action has already been defined. Cannot re-initialize");
+ this._action = action
+ }
+ };
+ Object.defineProperty(DropTargetContainer.prototype, "_currentActiveDropTarget", {
+ get: function () {
+ return this.__currentActiveDropTarget
+ }, set: function (newActiveDropTarget) {
+ if (this.__currentActiveDropTarget === newActiveDropTarget)
+ return;
+ if (this.__currentActiveDropTarget)
+ WinJS.Utilities.removeClass(this.__currentActiveDropTarget, DropTargetContainer.dragEnteredCSSClass);
+ if (newActiveDropTarget && this._canDrop(newActiveDropTarget.dataContext))
+ WinJS.Utilities.addClass(newActiveDropTarget, DropTargetContainer.dragEnteredCSSClass);
+ this.__currentActiveDropTarget = newActiveDropTarget;
+ this._updateDragCompleteHandler()
+ }, enumerable: true, configurable: true
+ });
+ DropTargetContainer._getDropHandlerElement = function (dropEventElement) {
+ while (dropEventElement && dropEventElement.getAttribute("data-ent-droptarget") !== "true")
+ dropEventElement = dropEventElement.parentElement;
+ return dropEventElement
+ };
+ DropTargetContainer.prototype._getDropHandlerElementAtEventPoint = function (event) {
+ var eventElement = document.elementFromPoint(event.clientX, event.clientY);
+ var dropTargetElement = null;
+ if (this.domElement && this.domElement.contains(eventElement))
+ dropTargetElement = DropTargetContainer._getDropHandlerElement(eventElement);
+ return dropTargetElement
+ };
+ DropTargetContainer.prototype._updateDragCompleteHandler = function () {
+ var _this = this;
+ if (!this.__currentActiveDropTarget && this._dragCompleteHandler) {
+ this._dragCompleteHandler.cancel();
+ this._dragCompleteHandler = null
+ }
+ else if (this._currentActiveDropTarget && !this._dragCompleteHandler) {
+ var listenerEvents = {};
+ listenerEvents[UI.Components.Shell.DragDataService.dragCompleteEvent] = function (event) {
+ if (_this._dragCompleteHandler) {
+ _this._dragCompleteHandler.cancel();
+ _this._dragCompleteHandler = null
+ }
+ _this._currentActiveDropTarget = null
+ };
+ this._dragCompleteHandler = MS.Entertainment.Utilities.addEventHandlers(document.body, listenerEvents)
+ }
+ };
+ DropTargetContainer.prototype._canDrop = function (dataContext) {
+ if (!this.action)
+ return false;
+ var dragDataService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dragData);
+ if (!dragDataService.draggedItem)
+ return !!dragDataService.draggedItemPromise;
+ var dragAndDropParams = {
+ target: dataContext, source: dragDataService.draggedItem
+ };
+ this.action.parameter = dragAndDropParams;
+ this.action.isDragAndDropResponse = true;
+ this.action.requeryCanExecute();
+ return this.action.isEnabled
+ };
+ DropTargetContainer.prototype._onDragEnter = function (event) {
+ var dropHandlerElement = DropTargetContainer._getDropHandlerElement(event.srcElement);
+ if (dropHandlerElement)
+ this._currentActiveDropTarget = dropHandlerElement
+ };
+ DropTargetContainer.prototype._onDragLeave = function (event) {
+ var exitedDropHandlerElement = DropTargetContainer._getDropHandlerElement(event.srcElement);
+ var dropHandlerElementAtEventPoint = this._getDropHandlerElementAtEventPoint(event);
+ if (exitedDropHandlerElement && !dropHandlerElementAtEventPoint)
+ this._currentActiveDropTarget = null
+ };
+ DropTargetContainer.prototype._onDragOver = function (event) {
+ var dropHandlerElement = DropTargetContainer._getDropHandlerElement(event.srcElement);
+ if (dropHandlerElement && this._canDrop(dropHandlerElement.dataContext))
+ event.preventDefault()
+ };
+ DropTargetContainer.prototype._onDrop = function (event) {
+ var _this = this;
+ if (!this.action)
+ return;
+ var dropHandlerElement = DropTargetContainer._getDropHandlerElement(event.srcElement);
+ if (dropHandlerElement) {
+ var dragDataService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dragData);
+ var draggedItem = null;
+ dragDataService.draggedItemPromise.then(function (draggedItemResult) {
+ draggedItem = draggedItemResult;
+ var dragAndDropParams = {
+ target: dropHandlerElement.dataContext, source: draggedItem
+ };
+ var referenceContainerDomElement = dropHandlerElement.querySelector(DropTargetContainer.referenceContainerSelector) || dropHandlerElement;
+ _this.action.parameter = dragAndDropParams;
+ _this.action.isDragAndDropResponse = true;
+ return _this.action.execute(referenceContainerDomElement)
+ }).done(function () {
+ if (draggedItem && draggedItem.onDragDataHandled)
+ draggedItem.onDragDataHandled()
+ }, function (error) {
+ Controls.assert(WinJS.Promise.isCanceledError(error), "DropTargetContainer::_onDrop: Unexpected error while retrieving dragged item: " + error && error.message)
+ })
+ }
+ };
+ DropTargetContainer.prototype.initialize = function () {
+ _super.prototype.initialize.call(this);
+ this._dropHandlerBinding = UI.Framework.addEventHandlers(this.domElement, {
+ dragenter: this._onDragEnter.bind(this), dragleave: this._onDragLeave.bind(this), dragover: this._onDragOver.bind(this), drop: this._onDrop.bind(this)
+ })
+ };
+ DropTargetContainer.prototype.unload = function () {
+ _super.prototype.unload.call(this);
+ if (this._dropHandlerBinding) {
+ this._dropHandlerBinding.cancel();
+ this._dropHandlerBinding = null
+ }
+ };
+ DropTargetContainer.dragEnteredCSSClass = "state-dragEntered";
+ DropTargetContainer.referenceContainerSelector = "[data-ent-usage='referenceContainer']";
+ return DropTargetContainer
+ })(UI.Framework.UserControl);
+ Controls.DropTargetContainer = DropTargetContainer;
+ WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.DropTargetContainer)
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/selectionmanager.js:25031 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Framework");
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ SelectionManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function selectionManager(dataSource, defaultSelectionIndex, settingsKey, overrideUserSettingOnce) {
+ MS.Entertainment.UI.Framework.ObservableBase.prototype.constructor.call(this);
+ this._handleChangesInDataSource = this._handleChangesInDataSource.bind(this);
+ this._dataSource = dataSource;
+ this._settingsKey = settingsKey;
+ this._defaultSelectionIndex = defaultSelectionIndex;
+ this._overrideUserSettingOnce = !!overrideUserSettingOnce;
+ this._updateWorkingDataSource();
+ this._updateDefaultSelection();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.enableSaving = !configurationManager.shell.preventSelectionManagerSettingSaves
+ }, {
+ _dataSource: null, _workingDataSource: null, _bindings: null, _settingsKey: null, _overrideUserSettingOnce: false, _isRoamingSetting: true, _defaultSelectionIndex: -1, _selectedItem: null, _selectedIndex: -1, _disposed: false, enableSaving: true, compareById: false, dispose: function dispose() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ this._setSelected(this._selectedItem, false);
+ this._dataSource = null;
+ this._selectedItem = null;
+ this._disposed = true
+ }, dataSource: {
+ get: function () {
+ return this._dataSource
+ }, set: function (value) {
+ value = WinJS.Binding.unwrap(value);
+ var oldValue = this._dataSource;
+ var nullOrArray = !value || Array.isArray(value) || value instanceof MS.Entertainment.ObservableArray;
+ MS.Entertainment.UI.Framework.assert(nullOrArray, "Source was not an array. Only array's are supported");
+ if (value !== this._dataSource && nullOrArray && !this._disposed) {
+ this.updateAndNotify("dataSource", value);
+ this._updateWorkingDataSource();
+ this._updateDefaultSelection()
+ }
+ }
+ }, defaultSelectionIndex: {
+ get: function () {
+ return this._defaultSelectionIndex
+ }, set: function (value) {
+ this.updateAndNotify("defaultSelectionIndex", value)
+ }
+ }, isRoamingSetting: {
+ get: function () {
+ return this._isRoamingSetting
+ }, set: function (value) {
+ var oldValue = this._isRoamingSetting;
+ if (value !== this._isRoamingSetting) {
+ this._isRoamingSetting = value;
+ this.saveSelection();
+ this.dispatchChangeAndNotify("isRoamingSetting", value, oldValue)
+ }
+ }
+ }, settingsKey: {
+ get: function () {
+ return this._settingsKey
+ }, set: function (value) {
+ this.updateAndNotify("settingsKey", value)
+ }
+ }, selectedIndex: {
+ get: function () {
+ return this._selectedIndex
+ }, set: function (value) {
+ if (value !== this._selectedIndex) {
+ var oldValue = this._selectedIndex;
+ this._selectedIndex = value;
+ this._onSelectedIndexChanged(value, oldValue)
+ }
+ }
+ }, selectedItem: {
+ get: function () {
+ return this._item(this.selectedIndex)
+ }, set: function (value) {
+ var oldValue = WinJS.Binding.unwrap(this.selectedItem);
+ value = WinJS.Binding.unwrap(value);
+ if (value !== oldValue) {
+ var index = -1;
+ if (this._workingDataSource)
+ for (var i = 0; i < this._workingDataSource.length; i++)
+ if (WinJS.Binding.unwrap(this._workingDataSource.item(i)) === value) {
+ index = i;
+ break
+ }
+ this.selectedIndex = index
+ }
+ }
+ }, clear: function clear() {
+ if (this._selectedIndex !== -1) {
+ var oldValue = this._selectedIndex;
+ this._selectedIndex = -1;
+ this._onSelectedIndexChanged(this._selectedIndex, oldValue)
+ }
+ }, reselect: function reselect() {
+ this.dispatchEvent(MS.Entertainment.UI.Framework.SelectionManager.events.reselected, {
+ sender: this, selection: {
+ item: this.selectedItem, index: this.selectedIndex
+ }
+ })
+ }, _setSelected: function _setSelected(item, value) {
+ if (item && item instanceof Object && "selected" in item)
+ item.selected = value
+ }, _item: function _item(index) {
+ return (this._workingDataSource && index >= 0 && index < this._workingDataSource.length) ? this._workingDataSource.item(index) : null
+ }, _indexFromId: function _indexFromId(id) {
+ var index = -1;
+ if (this._workingDataSource)
+ this._workingDataSource.some(function (item, itemIndex) {
+ if (item && item.id === id) {
+ index = itemIndex;
+ return true
+ }
+ });
+ return index
+ }, _indexFromSettingsValue: function _indexFromSettingsValue(settingsValue) {
+ var index = settingsValue;
+ if (this.compareById)
+ index = this._indexFromId(settingsValue);
+ return index
+ }, _settingsValueFromIndex: function _settinsValueFromIndex(index) {
+ var settingsValue = index;
+ if (this.compareById) {
+ var item = this._item(index);
+ settingsValue = item && item.id;
+ settingsValue = settingsValue || String.empty
+ }
+ return settingsValue
+ }, _updateWorkingDataSource: function _updateWorkingDataSource() {
+ if (this._workingDataSource)
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ if (!this._dataSource) {
+ this._workingDataSource = null;
+ return
+ }
+ var tempWorkingData = WinJS.Binding.unwrap(this._dataSource);
+ if (!(this._dataSource instanceof MS.Entertainment.ObservableArray))
+ tempWorkingData = new MS.Entertainment.ObservableArray(this._dataSource);
+ if (tempWorkingData)
+ tempWorkingData.addChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = tempWorkingData
+ }, _updateDefaultSelection: function _updateDefaultSelection() {
+ var newIndex = -1;
+ if (this.settingsKey && this.enableSaving)
+ if (this.isRoamingSetting && !MS.Entertainment.Utilities.isVideoApp2)
+ newIndex = this._indexFromSettingsValue(MS.Entertainment.Utilities.getUserRoamingSetting(this.settingsKey));
+ else
+ newIndex = this._indexFromSettingsValue(Windows.Storage.ApplicationData.current.localSettings.values[this.settingsKey]);
+ if (this._overrideUserSettingOnce || newIndex < 0 || isNaN(newIndex) || (this._workingDataSource && newIndex >= this._workingDataSource.length))
+ newIndex = (isNaN(this._defaultSelectionIndex)) ? 0 : this._defaultSelectionIndex;
+ if (!this._workingDataSource || newIndex >= this._workingDataSource.length)
+ newIndex = -1;
+ if (newIndex !== this.selectedIndex)
+ this.selectedIndex = newIndex;
+ else if (newIndex >= 0)
+ this._onSelectedIndexChanged(newIndex, newIndex)
+ }, _onSelectedIndexChanged: function _onSelectedIndexChanged(newValue, oldValue) {
+ if (!this._disposed) {
+ var oldSelectedItem = this._selectedItem;
+ var newSelectedItem = this._item(newValue);
+ var selectedIndexChanged = newValue !== oldValue;
+ var selectedItemChanged = newSelectedItem !== oldSelectedItem;
+ this._setSelected(oldSelectedItem, false);
+ if (selectedIndexChanged)
+ this.dispatchChangeAndNotify("selectedIndex", newValue, oldValue);
+ if (selectedItemChanged)
+ this.notify("selectedItem", newSelectedItem, oldSelectedItem);
+ this._selectedItem = newSelectedItem;
+ this._setSelected(newSelectedItem, true);
+ if (!this._overrideUserSettingOnce)
+ this._saveSelection(newValue);
+ else
+ this._overrideUserSettingOnce = false;
+ if (selectedItemChanged)
+ this.dispatchEvent(MS.Entertainment.UI.Framework.SelectionManager.events.selectedItemChanged, {
+ sender: this, newSelection: {
+ item: newSelectedItem, index: newValue
+ }, oldSelection: {
+ item: oldSelectedItem, index: oldValue
+ }
+ })
+ }
+ }, saveSelection: function saveSelection() {
+ if (this.dataSource && this.dataSource.length)
+ this._saveSelection(this.selectedIndex)
+ }, _saveSelection: function _saveSelection(value) {
+ if (this.settingsKey && this.enableSaving && value >= 0)
+ if (this.isRoamingSetting && !MS.Entertainment.Utilities.isVideoApp2)
+ MS.Entertainment.Utilities.setUserRoamingSetting(this.settingsKey, this._settingsValueFromIndex(value));
+ else
+ Windows.Storage.ApplicationData.current.localSettings.values[this.settingsKey] = this._settingsValueFromIndex(value)
+ }, _handleChangesInDataSource: function _handleChangesInDataSource(notification) {
+ var newIndex = this.selectedIndex;
+ switch (notification.type) {
+ case MS.Entertainment.ObservableArray.OperationTypes.add:
+ if (notification.index <= this.selectedIndex)
+ this.selectedIndex = this.selectedIndex + 1;
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.remove:
+ if (notification.index <= this.selectedIndex && this.selectedIndex > 0)
+ this.selectedIndex = this.selectedIndex - 1;
+ else if (notification.index === this.selectedIndex)
+ this._onSelectedIndexChanged(notification.index, this.selectedIndex);
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.reset:
+ this.selectedIndex = this._defaultSelectionIndex;
+ break;
+ default:
+ MS.Entertainment.UI.Controls.assert(false, "unsupported notification type: " + notification.type);
+ break
+ }
+ if (this.selectedIndex < 0 && this._workingDataSource.length > this._defaultSelectionIndex)
+ this.selectedIndex = this._defaultSelectionIndex
+ }
+ }, {
+ events: {
+ selectedItemChanged: "selectedItemChanged", reselected: "reselected"
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/data/augmenters/commonaugmenters.js:25254 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MSE, undefined) {
+ "use strict";
+ var alias = MSE.Data.Property.alias;
+ var augment = MSE.Data.Property.augment;
+ var convert = MSE.Data.Property.convert;
+ var convertNoDeflate = MSE.Data.Property.convertNoDeflate;
+ var convertOriginal = MSE.Data.Property.convertOriginal;
+ var convertOriginalNoDeflate = MSE.Data.Property.convertOriginalNoDeflate;
+ var list = MSE.Data.Property.list;
+ var listWithContext = MSE.Data.Property.listWithContext;
+ var format = MSE.Data.Property.format;
+ var collect = MSE.Data.Property.collect;
+ var filter = MSE.Data.Property.filter;
+ var filterArray = MSE.Data.Property.filterArray;
+ var value = MSE.Data.Property.value;
+ var uncachable = MSE.Data.Property.uncachable;
+ var hydrated = MSE.Data.Property.hydrated;
+ var hydratedRequired = MSE.Data.Property.hydratedRequired;
+ var convertFeatureOptionsMusic = { feature: Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace };
+ var defaultVoiceConfidence = MSE.Data.Factory.defaultVoiceConfidence;
+ var convertFeatureOptionsMusicOrVideo = { feature: [Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace] };
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ ImageIdType: {
+ undefinedImageIdType: Microsoft.Entertainment.ImageIdType.undefinedImageIdType, application: Microsoft.Entertainment.ImageIdType.application, editorialAlbum: Microsoft.Entertainment.ImageIdType.album, editorialArtist: Microsoft.Entertainment.ImageIdType.artist, editorialMovie: Microsoft.Entertainment.ImageIdType.movie, editorialSeason: Microsoft.Entertainment.ImageIdType.season, editorialSeries: Microsoft.Entertainment.ImageIdType.series, editorialTrack: Microsoft.Entertainment.ImageIdType.track, parentalRating: Microsoft.Entertainment.ImageIdType.parentalRating, image: Microsoft.Entertainment.ImageIdType.image, movie: Microsoft.Entertainment.ImageIdType.movie, episode: Microsoft.Entertainment.ImageIdType.episode, series: Microsoft.Entertainment.ImageIdType.series
+ }, ItemLocation: {
+ unknown: "unknown", collection: "collection", marketplace: "marketplace"
+ }, ItemIdType: {
+ unknown: "unknown", library: "library", service: "service"
+ }, convertFeatureOptionsMusicOrVideo: convertFeatureOptionsMusicOrVideo
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Filter.Marketplace", {
+ filterUnsupportedFlexItems: function filterUnsupportedFlexItems(item) {
+ return item && !(item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Movie || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Series || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Album || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Artist || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.MovieTrailer || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Season || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Episode || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Hub)
+ }
+ });
+ var xboxCatalogIdPrefix = "66acd000-77fe-1000-9115-d802";
+ var classicWindowsCatalogIdPrefix = "66acd000-77fe-1000-9115-d804";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data.Factory.Common");
+ WinJS.Namespace.defineWithParent(MSE, "Data.Factory.Common", {
+ createMediaItemFromEditorialItem: function createMediaItemFromEditorialItem(editorialItem) {
+ var augmentation = MS.Entertainment.Utilities.getEditorialItemAugmentation(editorialItem && editorialItem.link && editorialItem.link.type);
+ return MSE.Data.augment(editorialItem, augmentation)
+ }, createMediaItemFromPinnedItem: function createMediaItemFromEditorialItem(pinnedItem) {
+ var augmentation = MS.Entertainment.Utilities.getPinnedItemAugmentation(pinnedItem && pinnedItem.Item && pinnedItem.Item.ContentType);
+ return MSE.Data.augment(pinnedItem.Item, augmentation)
+ }, createMediaItemFromRecentItem: function createMediaItemFromEditorialItem(recentItem) {
+ var augmentation = MS.Entertainment.Utilities.getRecentItemAugmentation(recentItem && recentItem.Item && recentItem.Item.ContentType, recentItem && recentItem.Item && recentItem.Item.AcquisitionContext);
+ return MSE.Data.augment(recentItem.Item, augmentation)
+ }, combineTitleAndSubTitle: function combineTitleAndSubTitle(mediaItem) {
+ var result = String.empty;
+ if (mediaItem)
+ if (!mediaItem.mainTitle)
+ result = mediaItem.subTitle;
+ else if (!mediaItem.subTitle)
+ result = mediaItem.mainTitle;
+ else
+ result = String.load(String.id.IDS_TITLE_SUBTITLE).format(mediaItem.mainTitle, mediaItem.subTitle);
+ return result
+ }, hasSmartGlassActivities: function hasSmartGlassActivities(hasActivities) {
+ return false
+ }, zuneDeviceTypesValidate: function zuneDeviceTypesValidate(deviceTypes) {
+ var newDeviceTypes = [];
+ if (Array.isArray(deviceTypes))
+ deviceTypes.forEach(function validate(deviceType) {
+ if (deviceType === MS.Entertainment.Data.Augmenter.Marketplace.zuneDeviceType._pc)
+ newDeviceTypes.push(MS.Entertainment.Data.Augmenter.Marketplace.zuneDeviceType.pc);
+ else
+ newDeviceTypes.push(deviceType)
+ });
+ return newDeviceTypes
+ }, musicArtistWebDetailsUri: function musicArtistWebDetailsUri(id) {
+ if (id)
+ return MS.Entertainment.Utilities.UriFactory.create(MS.Entertainment.Endpoint.id.seid_PCMarketplace, ["redirect"], {
+ type: "artist", id: id
+ });
+ else
+ return null
+ }, musicAlbumWebDetailsUri: function musicAlbumWebDetailsUri(id) {
+ if (id)
+ return MS.Entertainment.Utilities.UriFactory.create(MS.Entertainment.Endpoint.id.seid_PCMarketplace, ["redirect"], {
+ type: "album", id: id
+ });
+ else
+ return null
+ }, musicTrackWebDetailsUri: function musicTrackWebDetailsUri(id) {
+ if (id)
+ return MS.Entertainment.Utilities.UriFactory.create(MS.Entertainment.Endpoint.id.seid_PCMarketplace, ["redirect"], {
+ type: "track", id: id
+ });
+ else
+ return null
+ }, personWebDetailsUri: function personWebDetailsUri(data) {
+ var result = null;
+ if (!data)
+ return result;
+ switch (data.personType) {
+ case Microsoft.Entertainment.Queries.PersonType.artist:
+ case Microsoft.Entertainment.Queries.PersonType.primaryArtist:
+ result = MSE.Data.Factory.Common.musicArtistWebDetailsUri(data.serviceId);
+ break;
+ case Microsoft.Entertainment.Queries.PersonType.actor:
+ case Microsoft.Entertainment.Queries.PersonType.creator:
+ case Microsoft.Entertainment.Queries.PersonType.director:
+ case Microsoft.Entertainment.Queries.PersonType.influencer:
+ case Microsoft.Entertainment.Queries.PersonType.producer:
+ case Microsoft.Entertainment.Queries.PersonType.writer:
+ break;
+ default:
+ MS.Entertainment.Data.Factory.Common.assert(false, "Unknown personType in personWebDetailsUri");
+ break
+ }
+ return result
+ }, webDetailsUri: function webDetailsUri(data) {
+ var result = null;
+ if (!data)
+ return result;
+ try {
+ switch (data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ result = MSE.Data.Factory.Common.videoWebDetailsUri(data);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ result = MSE.Data.Factory.Common.personWebDetailsUri(data);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ result = MSE.Data.Factory.Common.tvSeriesWebDetailsUri(data.hasZuneId ? data.zuneId : data.serviceId);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ var seriesId;
+ if (data.seriesIdType === MS.Entertainment.Data.Query.edsIdType.zuneCatalog)
+ seriesId = data.seriesId;
+ else
+ seriesId = data.seriesServiceId;
+ result = MSE.Data.Factory.Common.tvSeasonWebDetailsUri(seriesId + "_s" + data.seasonNumber);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ result = MSE.Data.Factory.Common.musicAlbumWebDetailsUri(data.hasZuneId ? data.zuneId : data.serviceId);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ result = MSE.Data.Factory.Common.musicTrackWebDetailsUri(data.hasZuneId ? data.zuneId : data.serviceId);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.bio:
+ case Microsoft.Entertainment.Queries.ObjectType.editorial:
+ case Microsoft.Entertainment.Queries.ObjectType.genre:
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ case Microsoft.Entertainment.Queries.ObjectType.review:
+ break;
+ default:
+ MS.Entertainment.Data.Factory.Common.assert(false, "Unknown mediaType in webDetailsUri");
+ break
+ }
+ }
+ catch (error) {
+ result = null
+ }
+ return result
+ }, imageUri: function imageUri(data) {
+ var result;
+ var imageType = MS.Entertainment.Data.ImageIdType.undefinedImageIdType;
+ var imageId;
+ var imageChildId;
+ if (!data || data.mediaType === null || data.mediaType === undefined)
+ return result;
+ switch (data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ imageType = MS.Entertainment.Data.ImageIdType.xboxGame;
+ imageId = data.titleId;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ imageId = data.serviceId;
+ switch (data.videoType) {
+ case Microsoft.Entertainment.Queries.VideoType.movie:
+ imageType = MS.Entertainment.Data.ImageIdType.movie;
+ break;
+ case Microsoft.Entertainment.Queries.VideoType.tvEpisode:
+ imageType = MS.Entertainment.Data.ImageIdType.series;
+ break
+ }
+ { };
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ imageType = MS.Entertainment.Data.ImageIdType.series;
+ imageId = data.serviceId;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ imageType = MS.Entertainment.Data.ImageIdType.season;
+ imageId = data.seriesId;
+ imageChildId = data.seasonNumber;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ imageType = MS.Entertainment.Data.ImageIdType.album;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ imageType = MS.Entertainment.Data.ImageIdType.track;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ switch (data.personType) {
+ case Microsoft.Entertainment.Queries.PersonType.artist:
+ case Microsoft.Entertainment.Queries.PersonType.primaryArtist:
+ imageType = MS.Entertainment.Data.ImageIdType.artist;
+ break
+ }
+ break
+ }
+ if (imageType !== MS.Entertainment.Data.ImageIdType.undefinedImageIdType)
+ if (imageType === MS.Entertainment.Data.ImageIdType.track || imageType === MS.Entertainment.Data.ImageIdType.album || imageType === MS.Entertainment.Data.ImageIdType.artist)
+ result = MS.Entertainment.UI.Shell.ImageLoader.getNewImageServiceUri(data, 100, 100);
+ else if (imageId)
+ result = MS.Entertainment.UI.Shell.ImageLoader.makeCatalogImageUri(imageId, imageType, null, true, null, null, imageChildId);
+ return result
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter", {
+ GamePlatform: {
+ PC: "PC", Xbox: "Xbox", Phone: "Phone", Modern: "Modern", Web: "Web", Unknown: "Unknown"
+ }, GameTitleType: {
+ game: "Game", application: "App"
+ }, GameSupportedPlatform: {
+ Xbox360: "Xbox360", WebGames: "WebGames"
+ }, ServiceTypes: {
+ editorialItem: 1, wmis: 2, audioAd: 3
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ zuneDeviceType: {
+ all: "All", pc: "WindowsPC", xblWinClient: "XblWinClient", xbox360: "Xbox360", zuneDevice: "Zune3.0", zuneMobile: "ZuneMobile", _pc: "PC/Windows"
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Factory.Library", {
+ scaleGroupHintNumber: function scaleGroupHintNumber(number) {
+ var result = 0;
+ if (!isNaN(number))
+ result = Math.log(number + 1);
+ return result
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Factory.Library", {
+ mediaTypeToSubTypeMappings: (function () {
+ var mapping;
+ return {
+ get: function mediaTypeToSubTypeMappings_get() {
+ if (mapping)
+ return mapping;
+ mapping = {};
+ mapping[Microsoft.Entertainment.Queries.ObjectType.album] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.game] = [Microsoft.Entertainment.Queries.GameType, Microsoft.Entertainment.Queries.GameTitleType];
+ mapping[Microsoft.Entertainment.Queries.ObjectType.person] = Microsoft.Entertainment.Queries.PersonType;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.playlist] = Microsoft.Entertainment.Platform.PlaylistType;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.smartDJ] = Microsoft.Entertainment.Queries.SmartDJObjectTypes;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.track] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.tvSeason] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.tvSeries] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.video] = Microsoft.Entertainment.Queries.VideoType;
+ return mapping
+ }
+ }
+ })(), mediaTypeToSubTypeNameMappings: (function () {
+ var mapping;
+ return {
+ get: function mediaTypeToSubTypeNameMappings_get() {
+ if (mapping)
+ return mapping;
+ mapping = {};
+ mapping[Microsoft.Entertainment.Queries.ObjectType.album] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.game] = ["gameType", "gameTitleType"];
+ mapping[Microsoft.Entertainment.Queries.ObjectType.person] = "personType";
+ mapping[Microsoft.Entertainment.Queries.ObjectType.playlist] = "playlistType";
+ mapping[Microsoft.Entertainment.Queries.ObjectType.smartDJ] = "smartDJType";
+ mapping[Microsoft.Entertainment.Queries.ObjectType.track] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.tvSeason] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.tvSeries] = null;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.video] = "videoType";
+ return mapping
+ }
+ }
+ })(), mediaTypeToRatingTypeMappings: (function () {
+ var mapping;
+ return {
+ get: function mediaTypeToRatingTypeMappings() {
+ if (mapping)
+ return mapping;
+ mapping = {};
+ if (Microsoft.Entertainment.Platform.RatingType) {
+ mapping[Microsoft.Entertainment.Queries.ObjectType.tvSeries] = Microsoft.Entertainment.Platform.RatingType.tvSeries;
+ mapping[Microsoft.Entertainment.Queries.ObjectType.video] = Microsoft.Entertainment.Platform.RatingType.movie
+ }
+ return mapping
+ }
+ }
+ })(), createGroupHintsListItemFactory: function createGroupHintsListItemFactory(augmentation) {
+ var innerFactory = MSE.Data.Factory.createListItemAugmentationFactory(augmentation, null, MSE.Data.Factory.GroupHintWrapper);
+ var groupHintsListItem = function groupHintsListItem(sourceItem, context) {
+ var result = innerFactory(sourceItem);
+ if (result && result.data && !isNaN(context))
+ result.data.largestTotalCount = context;
+ return result
+ };
+ groupHintsListItem.listItemFactory = innerFactory.listItemFactory;
+ return groupHintsListItem
+ }, localizedYearOrMonthFromDate: function localizedYearOrMonthFromDate(source) {
+ var result = String.empty;
+ var formatter;
+ if (source && source.getFullYear)
+ result = source.getFullYear();
+ if ((new Date).getFullYear() === result)
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).monthYear;
+ if (formatter)
+ result = formatter.format(source);
+ return MS.Entertainment.Data.Factory.Library.localizedYearOrMonth(result + String.empty)
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Factory.Marketplace.Rights", {
+ hasRight: function hasRight(rights, rightTypes) {
+ var rightTypeIndex,
+ rightIndex;
+ var foundRight = false;
+ if (rights && rightTypes)
+ for (rightIndex in rights) {
+ for (rightTypeIndex in rightTypes)
+ if (rights[rightIndex] && rights[rightIndex].licenseRight === rightTypes[rightTypeIndex]) {
+ foundRight = true;
+ break
+ }
+ if (foundRight)
+ break
+ }
+ return foundRight
+ }, hasPreviewRight: function hasPreviewRight(rights) {
+ return MSE.Data.Factory.Marketplace.Rights.hasRight(rights, [MSE.Data.Augmenter.Marketplace.RightType.preview])
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter", {
+ MediaItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(function MediaItem() {
+ this.base.apply(this, arguments);
+ MS.Entertainment.Utilities.addEventHandlers(this, {
+ libraryIdChanged: function libraryIdChanged() {
+ this.dispatchChangeAndNotify("inCollection", this.inCollection, !this.inCollection)
+ }.bind(this)
+ })
+ }, {
+ serviceId: String.empty, serviceIdType: String.empty, zuneId: String.empty, canonicalId: String.empty, libraryId: hydrated(value(-1)), impressionGuid: hydrated(value(null)), localTracksCount: alias("LocalTracksCount", 0), offlineFilesCount: alias("OfflineFilesCount", 0), remoteTracksCount: alias("RemoteTracksCount", 0), remoteFilesCount: alias("RemoteFilesCount", 0), totalTracksCount: alias("TotalTracksCount"), mediaType: -1, name: hydratedRequired(value(String.empty)), title: hydratedRequired(convertNoDeflate("name", MSE.Data.Factory.self)), isPinnedToStartScreen: null, location: null, canPurchaseDownload: alias("CanPurchaseDownload", false), canPurchaseStream: alias("CanPurchaseStream", false), canRentStream: alias("CanRentStream", false), canRentDownload: alias("CanRentDownload", false), canSubscriptionDownload: alias("CanSubscriptionDownload", false), canPlayLocally: alias("CanPlayLocally", false), canPlayStream: alias("CanStream", false), canFreeStream: alias("CanFreeStream", false), canSubscriptionStream: alias("CanSubscriptionStream", false), primaryImageUri: hydrated(convertNoDeflate(String.empty, MSE.Data.Factory.Common.imageUri, String.empty)), webUri: convertNoDeflate(String.empty, MSE.Data.Factory.Common.webDetailsUri, String.empty), parent: null, acquisitionData: null, mediaTypeString: {
+ get: function () {
+ return String.empty
+ }
+ }, expectedMediaTypeString: {
+ get: function () {
+ return String.empty
+ }
+ }, isValid: {
+ get: function () {
+ return this.hasServiceId || this.inCollection || this.hasCanonicalId || this.hasZuneId
+ }
+ }, isValidType: {
+ get: function () {
+ return true
+ }
+ }, inCollection: uncachable(value(function get_inCollection() {
+ return MS.Entertainment.Utilities.isValidLibraryId(this.libraryId)
+ })), hasServiceId: {
+ get: function () {
+ return !MS.Entertainment.Utilities.isEmptyGuid(this.serviceId)
+ }
+ }, hasCanonicalId: {
+ get: function () {
+ return !MS.Entertainment.Utilities.isEmptyGuid(this.canonicalId)
+ }
+ }, hasZuneId: {
+ get: function () {
+ return !MS.Entertainment.Utilities.isEmptyGuid(this.zuneId)
+ }
+ }, isRemovable: {
+ get: function () {
+ return (this.inCollection && (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.album || this.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || this.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || this.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist || (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && !(this.playlistId >= 0))))
+ }
+ }, canTransfer: {
+ get: function get_canTransfer() {
+ switch (this.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ return this.remoteTracksCount < this.totalTracksCount;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ return this.remoteFilesCount === 0 && this.localFilesCount > 0;
+ default:
+ return false
+ }
+ }
+ }, hasRemoteContent: {
+ get: function get_hasRemoteContent() {
+ switch (this.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ return this.remoteTracksCount > 0;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ return this.remoteFilesCount > 0;
+ default:
+ return false
+ }
+ }
+ }, hasLocalContent: {
+ get: function get_hasLocalContent() {
+ switch (this.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ return this.localTracksCount > 0;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ return (this.localTracksCount + this.offlineFilesCount) > 0;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ return this.localTracksCount > 0;
+ default:
+ return true
+ }
+ }
+ }, isEqual: function MediaItem_GenericComparer(mediaItem2) {
+ var isSame = false;
+ if (mediaItem2 && ((!MS.Entertainment.Utilities.isEmptyGuid(this.serviceId) && mediaItem2.serviceId === this.serviceId) || (!MS.Entertainment.Utilities.isEmptyGuid(this.canonicalId) && mediaItem2.canonicalId === this.canonicalId) || (!MS.Entertainment.Utilities.isEmptyGuid(this.zuneId) && mediaItem2.zuneId === this.zuneId) || (MS.Entertainment.Utilities.isValidLibraryId(this.libraryId) && mediaItem2.libraryId === this.libraryId) || (this.titleId && mediaItem2.titleId === this.titleId) || (this.filePath && mediaItem2.filePath === this.filePath) || (this.activationFilePath && mediaItem2.activationFilePath === this.activationFilePath) || (this.cloudSyncItemId && mediaItem2.cloudSyncItemId === this.cloudSyncItemId)))
+ isSame = true;
+ return isSame
+ }, isChildOf: function isChildOf(mediaItem2) {
+ var isChild = false;
+ if (mediaItem2 && this.parent)
+ if ((!MS.Entertainment.Utilities.isEmptyGuid(mediaItem2.zuneId) && mediaItem2.zuneId === this.parent.zuneId) || (!MS.Entertainment.Utilities.isEmptyGuid(mediaItem2.canonicalId) && mediaItem2.canonicalId === this.parent.canonicalId))
+ isChild = true;
+ else
+ isChild = this.parent.isChildOf(mediaItem2);
+ return isChild
+ }, sharesParentWith: function sharesParentWith(mediaItem2) {
+ var sharesParent = false;
+ if (mediaItem2 && mediaItem2.parent && this.parent) {
+ if ((!MS.Entertainment.Utilities.isEmptyGuid(mediaItem2.parent.zuneId) && mediaItem2.parent.zuneId === this.parent.zuneId) || (!MS.Entertainment.Utilities.isEmptyGuid(mediaItem2.parent.canonicalId) && mediaItem2.parent.canonicalId === this.parent.canonicalId))
+ sharesParent = true;
+ else
+ sharesParent = this.sharesParentWith(mediaItem2.parent);
+ if (!sharesParent)
+ sharesParent = this.parent.sharesParentWith(mediaItem2)
+ }
+ return sharesParent
+ }, sharesDirectParentWith: function sharesDirectParentWith(mediaItem2) {
+ var sharesParent = false;
+ if (mediaItem2 && mediaItem2.parent && this.parent && this.parent.isEqual)
+ sharesParent = this.parent.isEqual(mediaItem2.parent);
+ return sharesParent
+ }, canDownload: {
+ get: function get_canDownload() {
+ return this.canPurchaseDownload || this.canRentDownload || this.canSubscriptionDownload
+ }
+ }, canPlay: {
+ get: function get_canPlay() {
+ return this.canPlayLocally || this.canPlayStream
+ }
+ }, canStream: {
+ get: function get_canStream() {
+ return this.canPurchaseStream || this.canRentStream || this.canFreeStream || this.canSubscriptionStream
+ }
+ }
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Common", {
+ ErrorCode: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ exactMatches: convert("Envelope.Body.LookupFullParamResponse.LookupFullParamResult.ExactResultsCount", MSE.Data.Factory.intNumber, 0), errorCodeUrl: alias("Envelope.Body.LookupFullParamResponse.LookupFullParamResult.ExactMatch.ErrorArticleUrl", "http://go.microsoft.com/fwlink/?LinkId=246305")
+ })
+ }), IntroPanelContent: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ title: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), details: convert("BodyText.p", MSE.Data.Factory.arrayJoinWithNewLines, String.empty), subtitle: convertOriginal("Subtitle", MSE.Data.Factory.normalizeTextDirection, String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ MediaItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.MediaItem, null, {
+ libraryId: convert("ObjectId", MSE.Data.Factory.intNumber, -1), serviceId: convert("ServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusicOrVideo), serviceIdType: "ZuneCatalog", zuneId: convert("ServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusicOrVideo), imageUri: hydratedRequired(alias("ImageUrl", null)), imageResizeUri: hydratedRequired(alias("ImageUrl", null)), fromCollection: true, canonicalId: hydrated(convert("BingId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusicOrVideo)), collectionState: alias("CollectionState", null), canSubscriptionDownload: alias("CanSubscriptionDownload", false), inCollection: uncachable(value(function get_inCollection() {
+ return MS.Entertainment.Utilities.isValidLibraryId(this.libraryId) && this.collectionState !== Microsoft.Entertainment.Queries.ItemCollectionState.notInCollection && this.collectionState !== Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionValidRights && this.collectionState !== Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionTakenDown && this.collectionState !== Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionValidRights
+ })), inCloudCollectionV2: uncachable(value(function get_inCloudCollectionV2() {
+ return this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveOnly || this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveAndLocal
+ }))
+ })
+ }), Genre: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.MediaItem, null, {
+ libraryId: convert("ObjectId", MSE.Data.Factory.intNumber, -1), value: convert("ObjectId", MSE.Data.Factory.intNumber, -1), name: alias("Name", String.empty), label: alias("Name", String.empty), mediaType: Microsoft.Entertainment.Queries.ObjectType.genre, type: "genre"
+ })
+ }), LibraryResultSet: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { totalCount: alias("TotalCount", -1) })
+ }), GroupItemHintBase: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ _title: convert("Name", MSE.Data.Factory.stringOrUnknown), title: convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty), groupKey: convert([["GroupId", "SortName"]], MSE.Data.Factory.joinStrings, null), firstItemIndexSourceHint: alias("DBOffsetIndex", 0)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ GroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHintBase, null, {
+ _title: convert("Name", MSE.Data.Factory.stringOrUnknown), title: convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty), groupKey: convert("GroupId", MSE.Data.Factory.string, null), description: convert("ItemsCount", MSE.Data.Factory.string, String.empty), totalCount: alias("ItemsCount", 0), largestTotalCount: 0, totalCountScaled: uncachable(convertNoDeflate("totalCount", MSE.Data.Factory.Library.scaleGroupHintNumber, 0)), largestTotalCountScaled: uncachable(convertNoDeflate("largestTotalCount", MSE.Data.Factory.Library.scaleGroupHintNumber, 0)), firstItemIndexSourceHint: alias("DBOffsetIndex", 0), subGroupHints: augment("SubGroups", MSE.Data.Augmenter.Library.GroupItemHintBase, null)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ Playlist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.MediaItem, null, {
+ count: convert("PlaylistItemsCount", MSE.Data.Factory.intNumber, -1), duration: convert("Duration", MSE.Data.Factory.secondsToMilliseconds, -1), libraryId: convert("ObjectId", MSE.Data.Factory.intNumber, -1), name: convertOriginal("Name", MSE.Data.Factory.normalizeTextDirection, String.empty), type: convert("Type", MSE.Data.Factory.intNumber, -1), dateAdded: convert("DateAdded", MSE.Data.Factory.databaseDate, null), yearOrMonthAdded: convertNoDeflate("dateAdded", MSE.Data.Factory.Library.localizedYearOrMonthFromDate, null), dateEdited: convert("DateEdited", MSE.Data.Factory.databaseDate, null), yearOrMonthEdited: convertNoDeflate("dateEdited", MSE.Data.Factory.Library.localizedYearOrMonthFromDate, null), isExplicit: false, explicitAriaString: String.empty, authorName: String.empty, shortText: String.empty, mediaType: Microsoft.Entertainment.Queries.ObjectType.playlist, tracks: hydratedRequired(value(null)), recentlyPlayedDate: convert("RecentlyPlayedDate", MSE.Data.Factory.databaseDate, null), cloudSyncItemId: convert("CloudSyncItemId", MSE.Data.Factory.guid, String.empty), voicePhrase: convert("Name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), smartDjSeed: convert("SmartDjSeed", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), currentItemIndex: convert("CurrentItemIndex", MSE.Data.Factory.intNumber, -1), localTracksCount: convert("LocalItemsCount", MSE.Data.Factory.intNumber, -1), remoteTracksCount: convert("RemoteItemsCount", MSE.Data.Factory.intNumber, -1), totalTracksCount: convert("PlaylistItemsCount", MSE.Data.Factory.intNumber, -1), allTracksLocal: {
+ get: function get_allTracksLocal() {
+ return this.localTracksCount >= 0 && this.totalTracksCount >= 0 && this.localTracksCount >= this.totalTracksCount
+ }
+ }, allTracksRemote: {
+ get: function get_allTracksRemote() {
+ return this.remoteTracksCount >= 0 && this.totalTracksCount >= 0 && this.remoteTracksCount >= this.totalTracksCount
+ }
+ }, onHydrated: MS.Entertainment.Hydrator.playlistCollection
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ MediaItemContainer: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.MediaItem, null, { knownChildServiceIdsPromise: null })
+ }), GenresResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, {
+ items: list("ResultSet", MSE.Data.Augmenter.Library.Genre, null), itemsArray: augment("ResultSet", MSE.Data.Augmenter.Library.Genre, null)
+ })
+ }), GroupsAugmentation: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.GroupItemHint)), totalCount: alias("TotalCount")
+ })
+ }), PlaylistsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, { items: list("ResultSet", MSE.Data.Augmenter.Library.Playlist, null) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EditorialType: {
+ Movie: "Movie", Series: "Series", Album: "Album", Artist: "Artist", MusicVideo: "MusicVideo", Track: "Track", Playlist: "Playlist", Game: "Game", MovieTrailer: "MovieTrailer", Hub: "Hub", FlexHub: "FlexHub", Season: "Season", Episode: "Episode"
+ }, RightType: {
+ albumPurchase: "AlbumPurchase", preview: "Preview", purchase: "Purchase", purchaseStream: "PurchaseStream", rent: "Rent", rentStream: "RentStream", stream: "Stream", freeStream: "FreeStream", subscription: "Subscription", subscriptionFree: "SubscriptionFree", seasonPurchase: "SeasonPurchase", seasonPurchaseStream: "SeasonPurchaseStream"
+ }, IntroPanelResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("ContentManifest.Content", MSE.Data.Augmenter.Common.IntroPanelContent) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ MediaItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.MediaItem, null, {
+ mediaType: null, serviceIdType: "ZuneCatalog", serviceId: convert("id", MSE.Data.Factory.guid, String.empty), zuneId: convert("id", MSE.Data.Factory.guid, String.empty), canonicalId: convert("id", MSE.Data.Factory.guid, String.empty), contentType: alias("type", String.empty), hasActivities: convert("HasActivities", MSE.Data.Factory.Common.hasSmartGlassActivities, false), collectionState: alias("CollectionState", null)
+ })
+ }), Right: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mediaInstanceId: convert("mediaInstanceId", MSE.Data.Factory.guid, String.empty), offerId: convert("offerId", MSE.Data.Factory.guid, String.empty), licenseRight: alias("licenseRight", String.empty), videoDefinition: alias("videoDefinition", String.empty), videoEncoding: alias("videoEncoding", String.empty), videoFileUrl: alias("videoFileUrl", String.empty), clientTypes: convert("clientTypes.clientType", MSE.Data.Factory.Common.zuneDeviceTypesValidate, MSE.Data.Factory.array), paymentInstruments: alias("paymentTypes.paymentType", MSE.Data.Factory.array)
+ })
+ }), EditorialImage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { id: alias("id", null) })
+ }), EditorialItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ id: alias("id", String.empty), libraryId: hydrated(value(-1)), serviceIdType: "ZuneCatalog", serviceId: convert("link.target", MSE.Data.Factory.guid, String.empty), zuneId: convert("link.target", MSE.Data.Factory.guid, String.empty), canonicalId: MS.Entertainment.Utilities.EMPTY_GUID, type: alias("link.type", String.empty), target: alias("link.target", String.empty), editorialTitle: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryText: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), title: String.empty, text: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), backgroundImageId: alias("backgroundImage.id", String.empty), serviceType: MSE.Data.Augmenter.ServiceTypes.editorialItem, image: augment("image", MSE.Data.Augmenter.Marketplace.EditorialImage, null)
+ })
+ }), EditorialHub: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mediaType: Microsoft.Entertainment.Queries.ObjectType.editorial, id: alias("id", String.empty), libraryId: hydrated(value(-1)), serviceIdType: "ZuneCatalog", serviceId: convert("link.target", MSE.Data.Factory.guid, String.empty), zuneId: convert("link.target", MSE.Data.Factory.guid, String.empty), canonicalId: MS.Entertainment.Utilities.EMPTY_GUID, type: alias("link.type", String.empty), target: alias("link.target", String.empty), editorialTitle: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryText: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), title: String.empty, text: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), backgroundImageId: alias("backgroundImage.id", String.empty), serviceType: MSE.Data.Augmenter.ServiceTypes.editorialItem, isNotMedia: true
+ })
+ }), GenreQueryOptions: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ genreId: convert("id", MSE.Data.Factory.guid, String.empty), parentGenreId: convert("parentId", MSE.Data.Factory.guid, String.empty)
+ })
+ }), ClosedCaption: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mediaInstanceId: convert("mediaInstanceId", MSE.Data.Factory.guid, String.empty), fileUri: alias("fileUri", String.empty), lcid: alias("lcid", String.empty), name: alias("name", String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ MediaItemContainer: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.MediaItem, null, { knownChildServiceIdsPromise: null })
+ }), PrefixData: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: convert("id", MSE.Data.Factory.guid, String.empty), zuneId: alias("id", String.empty), name: convertOriginal("title.$value", MSE.Data.Factory.normalizeTextDirection, String.empty), type: alias("type", String.empty), score: convert("score", MSE.Data.Factory.intNumber, 0)
+ })
+ }), Genre: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: convert("id", MSE.Data.Factory.guid, String.empty), name: alias("title", String.empty), mediaType: Microsoft.Entertainment.Queries.ObjectType.genre
+ })
+ }), EditorialItemsEntry: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ id: alias("id", String.empty), editorialItems: augment("editorialItems.editorialItem", MS.Entertainment.Data.Factory.Common.createMediaItemFromEditorialItem, null), catalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.EDS, sourceId: MS.Entertainment.Utilities.Telemetry.ContentSourceId.Compass
+ })
+ }), GenrePivotValue: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ queryOptions: augment(String.empty, MSE.Data.Augmenter.Marketplace.GenreQueryOptions, null), itemQueryOptions: augment(String.empty, MSE.Data.Augmenter.Marketplace.GenreQueryOptions, null), itemQuery: {
+ get: function () {
+ return MS.Entertainment.Data.Query.musicSubGenre
+ }
+ }
+ })
+ }), EditorialResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ items: filter("feed.entry[0].editorialItems.editorialItem", MS.Entertainment.Data.Filter.Marketplace.filterUnsupportedFlexItems, MS.Entertainment.Data.Factory.Common.createMediaItemFromEditorialItem, null), itemsArray: filterArray("feed.entry[0].editorialItems.editorialItem", MS.Entertainment.Data.Filter.Marketplace.filterUnsupportedFlexItems, MS.Entertainment.Data.Factory.Common.createMediaItemFromEditorialItem), name: alias("feed.title.$value", MSE.Data.Factory.normalizeTextDirection, String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ RichGenre: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Genre, null, {
+ name: alias(["title.$value", "title"], String.empty), serviceId: alias("id", String.empty), parentServiceId: alias("parentId", String.empty), isRoot: convert("isRoot", MSE.Data.Factory.boolFromString, true), label: alias(["title.$value", "title"], String.empty), value: augment(String.empty, MSE.Data.Augmenter.Marketplace.GenrePivotValue), items: null, selected: false, expanded: false, tabPanelId: null, childIds: null, ariaLevel: 1
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ SubRichGenre: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.RichGenre, null, {
+ items: undefined, expanded: undefined, ariaLevel: 2
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ GenericMediaResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("entry", MSE.Data.Augmenter.Marketplace.MediaItem, null) })
+ }), PrefixResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("feed.entry", MSE.Data.Augmenter.Marketplace.PrefixData, null) })
+ }), GenresResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("feed.entry", MSE.Data.Augmenter.Marketplace.RichGenre, null) })
+ }), SubGenresResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("entry.subGenres.genre", MSE.Data.Augmenter.Marketplace.SubRichGenre, null) })
+ }), EntriesResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ entries: list("feed.entry", MSE.Data.Augmenter.Marketplace.EditorialItemsEntry, null), entriesArray: augment("feed.entry", MSE.Data.Augmenter.Marketplace.EditorialItemsEntry, null), itemsArray: convertNoDeflate("entriesArray", MSE.Data.Factory.self, null)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ MediaSharePackage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mediaId: alias("serviceId", String.empty), mediaType: alias("mediaType", 0), mediaTitle: alias("name", String.empty), title: alias("name", String.empty), description: alias("description", String.empty), text: alias("name", String.empty), uri: alias("webUri", String.empty), htmlUri: alias("webUri", String.empty), htmlImages: collect(["imageUri", "primaryImageUri"], null, String.empty), htmlLines: collect(["name", "description"], null, String.empty)
+ })
+ })
+ })
+ })(MS.Entertainment)
+})();
+/* >>>>>>/controls/pivotcontrols.js:25830 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ PivotsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function pivotsControlConstructor() {
+ this._keyDown = this._keyDown.bind(this);
+ this._onGlobalKeyDown = this._onGlobalKeyDown.bind(this);
+ this.domElement.addEventListener("keydown", this._keyDown);
+ if (MS.Entertainment.Utilities.isApp2)
+ this.selectedIndex = 0
+ }, {
+ _applyItemTemplateCounter: 0, focusItemOnSelectedIndexChanged: true, manageDownNavigation: false, delayListeningForGlobalNavigation: false, _globalHandlerEvents: null, focusOverrideData: { down: '.currentPage .modifierControl:not([tabIndex=\'-1\'])' }, controlName: "PivotsControl", initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.call(this, arguments);
+ this.bind("selectedIndex", this._selectedIndexChanged.bind(this));
+ if (!this.delayListeningForGlobalNavigation)
+ this._listenForGlobalNavigation()
+ }, applyItemTemplate: function applyItemTemplate(container, dataContext, index) {
+ var child = container.children[0];
+ child.setAttribute("data-win-automationId", "pivot{0}".format(index));
+ child.pivotPropertyChangeHandler = this._onPropertyChange.bind(this);
+ MS.Entertainment.Utilities.attachPropertyChangeEvent(child, child.pivotPropertyChangeHandler);
+ if (MS.Entertainment.Utilities.isApp2 && this.manageDownNavigation && this.focusOverrideData)
+ child.setAttribute("data-win-focus", JSON.stringify(this.focusOverrideData));
+ if (this.isVoiceEnabled) {
+ this.addVoiceAttribute(child, true, false);
+ WinJS.Utilities.addClass(child, this.voiceTextStyle);
+ if (child.winControl && dataContext && dataContext.options && dataContext.options.voice)
+ this.updateVoiceProperties(child.winControl, dataContext.options.voice)
+ }
+ if (this.selectedIndex === this._applyItemTemplateCounter) {
+ child.setAttribute("tabindex", "0");
+ WinJS.Utilities.addClass(child, "selected");
+ child.setAttribute("aria-selected", true);
+ if (this.focusItemOnSelectedIndexChanged)
+ MS.Entertainment.UI.Framework.focusElement(child)
+ }
+ this._applyItemTemplateCounter++;
+ return container
+ }, setTabPanel: function setTabPanel(tabPanel) {
+ for (var i = 0; i < this.domElement.children.length; i++)
+ MS.Entertainment.Framework.AccUtils.createAndAddAriaLink(this._getChildDomElement(i), tabPanel, "aria-controls")
+ }, enableGlobalNavigation: function enableGlobalNavigation() {
+ this._listenForGlobalNavigation()
+ }, _onPropertyChange: function _onPropertyChange(evt) {
+ if (evt && evt.propertyName === "aria-selected")
+ if (evt.srcElement.getAttribute("aria-selected") === "true")
+ if (this.focusItemOnSelectedIndexChanged) {
+ MS.Entertainment.UI.Framework.focusElement(evt.srcElement);
+ evt.srcElement.click()
+ }
+ }, unload: function unload() {
+ for (var i = 0; i < this.domElement.children.length; i++) {
+ var childElement = this._getChildDomElement(i);
+ MS.Entertainment.Utilities.detachPropertyChangeEvent(childElement, childElement.pivotPropertyChangeHandler);
+ childElement.pivotPropertyChangeHandler = null
+ }
+ this._stopListeningForGlobalNavigation();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.freeze.call(this);
+ this._stopListeningForGlobalNavigation()
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.thaw.call(this);
+ this._listenForGlobalNavigation()
+ }, _listenForGlobalNavigation: function _listenForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ var currentPage = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "currentPage");
+ if (!currentPage)
+ return;
+ this._globalHandlerEvents = MS.Entertainment.Utilities.addEventHandlers(currentPage, { keydown: this._onGlobalKeyDown })
+ }, _stopListeningForGlobalNavigation: function _stopListeningForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (!this._globalHandlerEvents)
+ return;
+ this._globalHandlerEvents.cancel()
+ }, focusLogicalRight: function focusLogicalRight() {
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ return this._focusLogicalLeftImpl();
+ return this._focusLogicalRightImpl()
+ }, _focusLogicalRightImpl: function _focusLogicalRightImpl() {
+ if (this.selectedIndex < this.domElement.children.length - 1) {
+ var childElement = this._getChildDomElement(this.selectedIndex + 1);
+ if (MS.Entertainment.Utilities.isApp2)
+ childElement.setAttribute("tabindex", 0);
+ if (!MS.Entertainment.Utilities.isApp2 || this.domElement.contains(document.activeElement))
+ MS.Entertainment.UI.Framework.focusElement(childElement);
+ childElement.click()
+ }
+ return true
+ }, focusLogicalLeft: function focusLogicalLeft() {
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ return this._focusLogicalRightImpl();
+ return this._focusLogicalLeftImpl()
+ }, _focusLogicalLeftImpl: function _focusLogicalLeftImpl() {
+ if (this.selectedIndex > 0) {
+ var childElement = this._getChildDomElement(this.selectedIndex - 1);
+ if (MS.Entertainment.Utilities.isApp2)
+ childElement.setAttribute("tabindex", 0);
+ if (!MS.Entertainment.Utilities.isApp2 || this.domElement.contains(document.activeElement))
+ MS.Entertainment.UI.Framework.focusElement(childElement);
+ childElement.click();
+ return true
+ }
+ else
+ return false
+ }, _onGlobalKeyDown: function _onGlobalKeyDown(e) {
+ if (MS.Entertainment.Utilities.getDirectionFromGlobalKeyInput(e))
+ this._keyDown(e);
+ return
+ }, _keyDown: function _keyDown(e) {
+ if (MS.Entertainment.Utilities.isApp1 && e.altKey)
+ return;
+ var handled = false;
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rightArrow:
+ case WinJS.Utilities.Key.rArrow:
+ case WinJS.Utilities.Key.rOtherArrow:
+ case WinJS.Utilities.Key.rGlobal:
+ case WinJS.Utilities.Key.pageDown:
+ handled = this.focusLogicalRight();
+ break;
+ case WinJS.Utilities.Key.leftArrow:
+ case WinJS.Utilities.Key.lArrow:
+ case WinJS.Utilities.Key.lOtherArrow:
+ case WinJS.Utilities.Key.lGlobal:
+ case WinJS.Utilities.Key.pageUp:
+ handled = this.focusLogicalLeft();
+ break;
+ default:
+ return
+ }
+ if (handled) {
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }, _selectedIndexChanged: function _selectedIndexChanged(newIndex, oldIndex) {
+ for (var i = 0; i < this.domElement.children.length; i++) {
+ var childElement = this._getChildDomElement(i);
+ WinJS.Utilities.removeClass(childElement, "selected");
+ childElement.setAttribute("tabindex", -1);
+ childElement.setAttribute("aria-selected", false)
+ }
+ var newSelectedChildElement = this._getChildDomElement(newIndex);
+ if (newSelectedChildElement) {
+ WinJS.Utilities.addClass(newSelectedChildElement, "selected");
+ newSelectedChildElement.setAttribute("tabindex", "0");
+ newSelectedChildElement.setAttribute("aria-selected", true);
+ if (this.focusItemOnSelectedIndexChanged || (this.domElement && this.domElement.contains(document.activeElement)))
+ MS.Entertainment.UI.Framework.focusElement(newSelectedChildElement);
+ this.selectedIndex = newIndex
+ }
+ }, _getChildDomElement: function _getChildDomElement(index) {
+ if (index >= 0 && index < this.domElement.children.length)
+ return this.domElement.children[index].children[0];
+ return null
+ }, _selectedIndex: -1, selectedIndex: {
+ get: function () {
+ return this._selectedIndex
+ }, set: function (val) {
+ if (val === this._selectedIndex)
+ return;
+ var old = this._selectedIndex;
+ this._selectedIndex = val;
+ this.notify("selectedIndex", val, old)
+ }
+ }
+ }, {}), VerticalPivotControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControlWithViewModel", null, null, {
+ _expandedItems: null, _expandBindings: null, _navigationControlEvents: null, _navigationControlBindings: null, _dividerTemplateProvider: null, _selectionManagerHandlers: null, _selectionManager: null, _tabPanelId: null, keyboardNavigable: true, keyboardNavigationManagerClass: MS.Entertainment.Framework.VerticalKeyboardNavigationManager, keyboardNavigationSetTabIndex: true, focusItemOnSelectedIndexChanged: true, dividers: true, reselectWhenAlreadySelected: false, containerStyle: MS.Entertainment.UI.Controls.ItemsControl.ContainerStyles.verticalFlow, itemTemplate: "/Controls/PivotControls.html#verticalPivotButtonTemplate", dividerTemplate: "/Controls/PivotControls.html#verticalDividerTemplate", initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.initialize.call(this);
+ this._navigationControlEvents = MS.Entertainment.Utilities.addEvents(this, {
+ click: this._onClick.bind(this), keydown: this._onKeyDown.bind(this)
+ })
+ }, unload: function unload() {
+ if (this._navigationControlBindings) {
+ this._navigationControlBindings.cancel();
+ this._navigationControlBindings = null
+ }
+ if (this._expandBindings) {
+ this._expandBindings.cancel();
+ this._expandBindings = null
+ }
+ if (this._navigationControlEvents) {
+ this._navigationControlEvents.cancel();
+ this._navigationControlEvents = null
+ }
+ for (var i = 0; i < this.domElement.children.length; i++)
+ this._detachItemListeners(this.domElement.children[i]);
+ MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.unload.call(this)
+ }, selectionManager: {
+ get: function () {
+ return this._selectionManager
+ }, set: function (value) {
+ if (this._selectionManager !== value) {
+ var oldValue = this._selectionManager;
+ this._selectionManager = value;
+ if (this._navigationControlBindings) {
+ this._navigationControlBindings.cancel();
+ this._navigationControlBindings = null
+ }
+ if (this._selectionManagerEvents) {
+ this._selectionManagerEvents.cancel();
+ this._selectionManagerEvents = null
+ }
+ this._navigationControlBindings = WinJS.Binding.bind(this._selectionManager, {
+ dataSource: this._selectionManagerDataSourceChangeHandler.bind(this), selectedIndex: this._expand.bind(this)
+ });
+ this._selectionManagerEvents = MS.Entertainment.UI.Framework.addEventHandlers(this._selectionManager, { selectedItemChanged: this._selectedItemChanged.bind(this) });
+ this.notify("selectionManager", value, oldValue)
+ }
+ }
+ }, loadItemTemplate: function loadItemTemplate() {
+ if (!this.dividers)
+ return MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.loadItemTemplate.apply(this, arguments);
+ var completePromise;
+ if (!this._dividerTemplateProvider)
+ completePromise = this._loadTemplate(this.dividerTemplate);
+ else
+ completePromise = WinJS.Promise.wrap(this._dividerTemplateProvider);
+ return completePromise.then(function baseLoadTemplate(template) {
+ this._dividerTemplateProvider = template;
+ return MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.loadItemTemplate.apply(this)
+ }.bind(this))
+ }, selectTemplate: function (item) {
+ if (!this.dividers)
+ return MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.selectTemplate.apply(this, arguments);
+ return this.loadItemTemplate().then(function () {
+ if (item && WinJS.Binding.unwrap(item.data) === MS.Entertainment.UI.Controls.VerticalPivotControl.divider)
+ return this._dividerTemplateProvider;
+ else
+ return this._itemTemplateProvider
+ }.bind(this))
+ }, applyItemTemplate: function applyItemTemplate(container, dataContext) {
+ var item = this._item(dataContext.index);
+ if (item) {
+ item.tabPanelId = this._tabPanelId;
+ if (container) {
+ var buttonElement = this._getButtonElementFromItem(container);
+ if (buttonElement) {
+ var automationId = this._getAutomationId(item);
+ if (automationId)
+ buttonElement.setAttribute("data-win-automationId", automationId + "_view");
+ buttonElement.pivotPropertyChangeHandler = this._onPropertyChange.bind(this);
+ MS.Entertainment.Utilities.attachPropertyChangeEvent(buttonElement, buttonElement.pivotPropertyChangeHandler);
+ if (item.selected) {
+ WinJS.Utilities.query(".win-focusable.selected", this.domElement).forEach(function (element) {
+ WinJS.Utilities.removeClass(element, "selected")
+ });
+ WinJS.Utilities.addClass(buttonElement, "selected")
+ }
+ if (item.selected || (dataContext.index === 0 && this.selectionManager && !this.selectionManager.selectedItem))
+ if (this.keyboardNavigable)
+ WinJS.Promise.timeout().done(function _setTabIndexOnSelectedItem() {
+ if (this._keyboardNavigationManager)
+ this._keyboardNavigationManager.setTabIndexedItem(buttonElement)
+ }.bind(this))
+ }
+ }
+ }
+ return container
+ }, _getButtonElementFromItem: function _getButtonElementFromItem(element) {
+ var foundButtonElement;
+ if (element) {
+ if (element.tagName === "BUTTON")
+ foundButtonElement = element;
+ else
+ foundButtonElement = element.querySelector("BUTTON");
+ if (!foundButtonElement && element.firstElementChild)
+ foundButtonElement = element.firstElementChild.firstElementChild
+ }
+ return foundButtonElement
+ }, _onPropertyChange: function _onPropertyChange(evt) {
+ if (evt && evt.propertyName === "aria-selected" && evt.srcElement.getAttribute("aria-selected") === "true") {
+ if (this.focusItemOnSelectedIndexChanged)
+ MS.Entertainment.UI.Framework.focusElement(evt.srcElement);
+ var index = -1;
+ if (evt.srcElement.winControl && !MS.Entertainment.UI.Framework.checkIsElementOnly(evt.srcElement))
+ index = this._findIndexFromControl(evt.srcElement.winControl);
+ else
+ index = this._findIndexFromElement(evt.srcElement);
+ if (index >= 0 && index !== this.selectionManager.selectedIndex)
+ this._selectItemAt(index)
+ }
+ }, _selectItemAt: function _selectItemAt(index) {
+ if (this.selectionManager && this._isValidIndex(index))
+ if (index !== this.selectionManager.selectedIndex) {
+ var item = this._item(index) || {};
+ if (!item.isDisabled)
+ this.selectionManager.selectedIndex = index
+ }
+ else if (this.reselectWhenAlreadySelected)
+ this.selectionManager.reselect();
+ else if (this._expandedItems && this._expandedItems.indexOf(this._item(index)) < 0)
+ this._unexpand();
+ else
+ this._expand(index)
+ }, _nextValidIndex: function _nextValidIndex(direction) {
+ var newIndex = 0;
+ if (this.selectionManager && this.selectionManager.dataSource) {
+ var newItem = null;
+ var firstIndex = this.selectionManager.selectedIndex;
+ newIndex = firstIndex;
+ do {
+ newIndex += direction;
+ if (this._isValidIndex(newIndex))
+ newItem = this._item(newIndex);
+ else {
+ newIndex = firstIndex;
+ break
+ }
+ } while (!newItem || newItem.isDisabled)
+ }
+ return newIndex
+ }, setTabPanelId: function setTabPanelId(tabPanelId) {
+ this._tabPanelId = tabPanelId
+ }, _onClick: function _onClick(args) {
+ var target = args && args.target;
+ var winControl = target && target.winControl;
+ if (winControl && !MS.Entertainment.UI.Framework.checkIsElementOnly(target)) {
+ var index = this._findIndexFromControl(winControl);
+ this._selectItemAt(index)
+ }
+ else if (target) {
+ var index = this._findIndexFromElement(target);
+ this._selectItemAt(index)
+ }
+ }, _onKeyDown: function _onKeyDown(e) {
+ if (!this._keyboardNavigationManager)
+ return;
+ if (e.keyCode === WinJS.Utilities.Key.rightArrow) {
+ var focusedItem = this._keyboardNavigationManager.getFocusedItem();
+ var index = focusedItem ? this._findIndexFromControl(focusedItem.winControl) : -1;
+ if (this._isValidIndex(index) && !this._isSubItem(index)) {
+ var item = this._item(index);
+ if (item && "items" in item)
+ if (!item.expanded) {
+ if (this.selectionManager.selectedIndex !== index)
+ this.selectionManager.selectedIndex = index;
+ this._expand(index)
+ }
+ else if (this._expandedItems && this._expandedItems.length) {
+ var firstChildIndex = index + 2;
+ this._keyboardNavigationManager.setFocusedItem(this.domElement.children[firstChildIndex], true)
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.leftArrow) {
+ var focusedItem = this._keyboardNavigationManager.getFocusedItem();
+ var index = focusedItem ? this._findIndexFromControl(focusedItem.winControl) : -1;
+ if (this._isValidIndex(index))
+ if (this._isSubItem(index)) {
+ var parentIndex = this._indexOf(this._expandedItems[0]) - 1;
+ this._keyboardNavigationManager.setFocusedItem(this.domElement.children[parentIndex], true)
+ }
+ else {
+ var item = this._item(index);
+ if (item && item.expanded) {
+ if (this.selectionManager.selectedIndex !== index)
+ this.selectionManager.selectedIndex = index;
+ this._unexpand()
+ }
+ }
+ }
+ return true
+ }, _findIndexFromElement: function _findIndexFromElement(element) {
+ var index = -1;
+ var children = this.domElement && this.domElement.children;
+ if (children)
+ for (var i = 0; i < children.length; i++)
+ if (children[i] === element || children[i].contains(element)) {
+ index = i;
+ break
+ }
+ return index
+ }, _findIndexFromControl: function _findIndexFromControl(winControl) {
+ var result;
+ if (!winControl)
+ return -1;
+ if (winControl.data)
+ result = this._indexOf(winControl.data);
+ if (!result && !isNaN(winControl.index))
+ result = winControl.index;
+ return result
+ }, _selectionManagerDataSourceChangeHandler: function _selectionManagerDataSourceChangeHandler(newValue, oldValue) {
+ if (newValue)
+ this.dataSource = newValue;
+ else if (this.dataSource === oldValue)
+ this.dataSource = null
+ }, _listChangedHandler: function _listChangedHandler(newValue, oldValue) {
+ if (this.selectionManager && newValue)
+ this.selectionManager.dataSource = newValue;
+ MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype._listChangedHandler.apply(this, arguments)
+ }, _detachItemListeners: function _detachItemListeners(element) {
+ var buttonElement = this._getButtonElementFromItem(element);
+ if (buttonElement) {
+ MS.Entertainment.Utilities.detachPropertyChangeEvent(buttonElement, buttonElement.pivotPropertyChangeHandler);
+ buttonElement.pivotPropertyChangeHandler = null
+ }
+ }, _handleItemRemoved: function _handleItemRemoved(element) {
+ if (!element)
+ return;
+ this._detachItemListeners(element);
+ if (this.keyboardNavigable && this._keyboardNavigationManager) {
+ var currentItemWithTabIndex = this._keyboardNavigationManager.getTabIndexedItem();
+ if (currentItemWithTabIndex && (currentItemWithTabIndex === element || element.contains(currentItemWithTabIndex)))
+ this._keyboardNavigationManager.focusFirstItemInContainer(this.domElement, false, false, true)
+ }
+ }, _item: function _item(index) {
+ return this._isValidIndex(index) ? (Array.isArray(this.selectionManager.dataSource) ? this.selectionManager.dataSource[index] : this.selectionManager.dataSource.item(index)) : null
+ }, _isSubItem: function _isChildItem(index) {
+ return this._expandedItems && this._expandedItems.indexOf(this._item(index)) >= 0
+ }, _indexOf: function _indexOf(item) {
+ var result = -1;
+ if (this.selectionManager && this.selectionManager.dataSource) {
+ result = this.selectionManager.dataSource.indexOf(item);
+ if (result < 0)
+ result = this.selectionManager.dataSource.indexOf(WinJS.Binding.as(item))
+ }
+ return result
+ }, _lastIndexOf: function _indexOf(item, fromIndex) {
+ var result = -1;
+ if (this.selectionManager && this.selectionManager.dataSource) {
+ result = this.selectionManager.dataSource.lastIndexOf(item, fromIndex);
+ if (result < 0)
+ result = this.selectionManager.dataSource.lastIndexOf(WinJS.Binding.as(item))
+ }
+ return result
+ }, _selectedItemChanged: function _selectedItemChanged(args) {
+ var detail = args.detail;
+ WinJS.Utilities.query(".win-focusable.selected", this.domElement).forEach(function (element) {
+ WinJS.Utilities.removeClass(element, "selected")
+ });
+ if (!detail.newSelection)
+ return;
+ var newSelectedElement = this.domElement.children[detail.newSelection.index];
+ if (!newSelectedElement)
+ return;
+ if (newSelectedElement && !WinJS.Utilities.hasClass(newSelectedElement, "win-focusable"))
+ newSelectedElement = newSelectedElement.querySelector(".win-focusable");
+ if (!newSelectedElement)
+ return;
+ WinJS.Utilities.addClass(newSelectedElement, "selected")
+ }, _expand: function _expand(index, oldIndex, preventBinding) {
+ WinJS.Promise.timeout().done(function _updateTabIndexedItem() {
+ if (this._unloaded)
+ return;
+ if (!(this._keyboardNavigationManager && this.keyboardNavigable))
+ return;
+ if (index >= 0 && index < this.domElement.children.length) {
+ var child = this.domElement.children[index];
+ if (child && this._keyboardNavigationManager) {
+ var focusableElement = WinJS.Utilities.hasClass(child, "win-focusable") ? child : child.querySelector(".win-focusable");
+ this._keyboardNavigationManager.setTabIndexedItem(focusableElement)
+ }
+ }
+ }.bind(this));
+ var item = this._item(index);
+ if (item && oldIndex !== undefined && !preventBinding) {
+ var telemetryParameters = {
+ title: this._getAutomationId(item), automationId: MS.Entertainment.UI.AutomationIds.verticalPivotSelected
+ };
+ MS.Entertainment.Utilities.Telemetry.logCommandClicked(telemetryParameters)
+ }
+ if (this._expandedItems && (this._expandedItems.indexOf(this._item(index + 1)) >= 0 || this._expandedItems.indexOf(item) >= 0))
+ return;
+ this._unexpand();
+ if (this._expandBindings) {
+ this._expandBindings.cancel();
+ this._expandBindings = null
+ }
+ if (item && item.items && item.items.length !== 0 && this.selectionManager.selectedIndex === index) {
+ this._expandedItems = this._addExpandedItems(index + 1, item.items);
+ if ("expanded" in item)
+ item.expanded = true
+ }
+ else if (!preventBinding && item && this.selectionManager.selectedIndex === index)
+ this._expandBindings = WinJS.Binding.bind(item, {
+ items: function (newValue, oldValue) {
+ if (oldValue !== undefined)
+ this._expand(index, oldIndex, true)
+ }.bind(this)
+ })
+ }, _unexpand: function _unexpand() {
+ var items = this._expandedItems;
+ this._expandedItems = null;
+ if (!items || !items.length || !this.selectionManager || !this.selectionManager.dataSource)
+ return;
+ var startIndex = this._indexOf(items[0]);
+ var endIndex = this._lastIndexOf(items[items.length - 1], startIndex + items.length - 1);
+ var expandedItem = this._item(startIndex - 1);
+ if (startIndex >= 0 && endIndex >= 0 && endIndex >= startIndex)
+ this.selectionManager.dataSource.splice(startIndex, endIndex - startIndex + 1);
+ if (expandedItem) {
+ if ("childIds" in expandedItem)
+ expandedItem.childIds = null;
+ if ("expanded" in expandedItem)
+ expandedItem.expanded = false
+ }
+ }, _addExpandedItems: function _addExpandedItems(index, items) {
+ if (!items || !items.length || !this.selectionManager || !this.selectionManager.dataSource)
+ return null;
+ var parentItem = this._item(index - 1);
+ var divider = MS.Entertainment.UI.Controls.VerticalPivotControl.divider;
+ var result = [divider].concat(items, [divider]);
+ var args = [index, 0].concat(result);
+ this.selectionManager.dataSource.splice.apply(this.selectionManager.dataSource, args);
+ if (parentItem && "childIds" in parentItem) {
+ parentItem.childIds = [];
+ for (var i = index + 1; i < index + items.length + 1; i++) {
+ var childElement = this.domElement.children[i];
+ MS.Entertainment.Framework.AccUtils.createAriaLinkId(childElement);
+ parentItem.childIds.push(childElement.id)
+ }
+ }
+ return result
+ }, _isValidIndex: function _isValidIndex(index) {
+ return this.selectionManager && this.selectionManager.dataSource && this.selectionManager.dataSource.length > index && index >= 0
+ }, _getAutomationId: function _getAutomationId(item) {
+ return item.id || (item.isRoot ? MS.Entertainment.UI.AutomationIds.genrePivot : MS.Entertainment.UI.AutomationIds.subgenrePivot)
+ }
+ }, {}, { divider: { divider: true } })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", { DeclarativeVerticalPivotControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalPivotControl", null, null, null, null, { isDeclarativeControlContainer: true }) });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ HorizontalPivotControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalPivotControl", null, function () {
+ this._onGlobalKeyDown = this._onGlobalKeyDown.bind(this)
+ }, {
+ _globalHandlerEvents: null, focusOverrideData: { down: '.currentPage .modifierControl:not([tabIndex=\'-1\'])' }, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.initialize.apply(this, arguments);
+ this._listenForGlobalNavigation()
+ }, unload: function unload() {
+ this._stopListeningForGlobalNavigation();
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.freeze.call(this);
+ this._stopListeningForGlobalNavigation()
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.thaw.call(this);
+ this._listenForGlobalNavigation()
+ }, applyItemTemplate: function applyItemTemplate(container, dataContext) {
+ var result = MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.applyItemTemplate.apply(this, arguments);
+ var child = result.querySelector("button");
+ if (child && MS.Entertainment.Utilities.isApp2 && this.focusOverrideData)
+ child.setAttribute("data-win-focus", JSON.stringify(this.focusOverrideData));
+ return result
+ }, _listenForGlobalNavigation: function _listenForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ var currentPage = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "currentPage");
+ if (!currentPage)
+ return;
+ this._globalHandlerEvents = MS.Entertainment.Utilities.addEventHandlers(currentPage, { keydown: this._onGlobalKeyDown })
+ }, _stopListeningForGlobalNavigation: function _stopListeningForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (!this._globalHandlerEvents)
+ return;
+ this._globalHandlerEvents.cancel()
+ }, _expand: function _expand(index, oldIndex, preventBinding) {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype._expand.apply(this, arguments);
+ var unselectedItems = WinJS.Utilities.query("button:not(.selected)", this.domElement);
+ unselectedItems.forEach(function (item) {
+ item.tabIndex = -1
+ })
+ }, _onGlobalKeyDown: function _onGlobalKeyDown(e) {
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rGlobal:
+ case WinJS.Utilities.Key.lGlobal:
+ this._onKeyDown(e);
+ break;
+ case WinJS.Utilities.Key.pageUp:
+ case WinJS.Utilities.Key.pageDown:
+ if (e.altKey)
+ this._onKeyDown(e);
+ break
+ }
+ return
+ }, _onKeyDown: function _onKeyDown(e) {
+ if (!this._keyboardNavigationManager)
+ return;
+ if (MS.Entertainment.Utilities.isApp1 && e.altKey)
+ return;
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rightArrow:
+ case WinJS.Utilities.Key.rArrow:
+ case WinJS.Utilities.Key.rOtherArrow:
+ case WinJS.Utilities.Key.rGlobal:
+ case WinJS.Utilities.Key.pageDown:
+ this._selectItemAt(this._nextValidIndex(1));
+ break;
+ case WinJS.Utilities.Key.leftArrow:
+ case WinJS.Utilities.Key.lArrow:
+ case WinJS.Utilities.Key.lOtherArrow:
+ case WinJS.Utilities.Key.lGlobal:
+ case WinJS.Utilities.Key.pageUp:
+ this._selectItemAt(this._nextValidIndex(-1));
+ break;
+ default:
+ return
+ }
+ e.stopPropagation()
+ }, containerStyle: MS.Entertainment.UI.Controls.ItemsControl.ContainerStyles.horizontalFlow, itemTemplate: "/Controls/PivotControls.html#horizontalPivotButtonTemplate", dividerTemplate: "/Controls/PivotControls.html#horizontalDividerTemplate"
+ })
+ })
+ })();
+ (function runVoiceMixins() {
+ MS.Entertainment.Utilities.runVoiceControlMixins(MS.Entertainment.UI.Controls.PivotsControl)
+ })()
+})();
+/* >>>>>>/components/music/playplaylist.js:26439 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Music");
+ WinJS.Namespace.define("MS.Entertainment.Music", {
+ PlayPlaylistOverlay: MS.Entertainment.UI.Framework.defineUserControl("Components/Music/PlayPlaylist.html#playPlaylistOverlayTemplate", function playPlaylistOverlayConstructor(element, options) {
+ this._queryPlaylists();
+ this.dialogTitle = options.dialogTitle || String.id.IDS_PLAY_PLAYLIST_OVERLAY_TITLE;
+ this.showManageLink = options.hideManageLink ? !options.hideManageLink : this.showManageLink;
+ MS.Entertainment.Music.assert(options.invokeTelemetryMoniker, "invokeTelemetryMoniker parameter missing from options bucket");
+ this.invokeTelemetryMoniker = options.invokeTelemetryMoniker
+ }, {
+ invokeTelemetryMoniker: String.empty, _container: null, _showPlaylist: false, _showNoPlaylists: false, _eventHandlers: null, initialize: function initialize() {
+ this._playlistList.selectionHelperFactory = function selectionHelperFactory() {
+ return new MS.Entertainment.UI.Controls.DoNothingSelectionHelper
+ };
+ this.importPlaylistsAction = this._getImportPlaylistsAction();
+ WinJS.Utilities.addClass(this.domElement, "playPlaylistOverlayContainer");
+ this._updateState();
+ this._eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {
+ keypress: function onKeyPress(event) {
+ if (event.keyCode === WinJS.Utilities.Key.escape)
+ this._container.hide()
+ }.bind(this), keyup: function onKeyUp(event) {
+ if (event.keyCode === WinJS.Utilities.Key.dismissButton) {
+ event.stopPropagation();
+ this._container.hide()
+ }
+ }.bind(this)
+ })
+ }, setOverlay: function setOverlay(container) {
+ this._container = container
+ }, unload: function unload() {
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, onManagePlaylists: function onManagePlaylists(event) {
+ this._sendTelemetryEvent("PlayPlaylistOverlay_ManagePlaylists");
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ this._navigateAndClose(MS.Entertainment.UI.Monikers.musicCollection, MS.Entertainment.UI.Monikers.musicCollectionPlaylists, { selectHub: true });
+ else
+ this._navigateAndClose(MS.Entertainment.UI.Monikers.musicPlaylistCollection, null)
+ }, onBrowseAlbums: function onBrowseAlbums(event) {
+ this._sendTelemetryEvent("PlayPlaylistOverlay_BrowseAlbums");
+ this._navigateAndClose(MS.Entertainment.UI.Monikers.musicCollection, MS.Entertainment.UI.Monikers.musicCollectionByAlbum, { selectHub: true })
+ }, onBrowseAllMusic: function onBrowseAllMusic(event) {
+ this._sendTelemetryEvent("PlayPlaylistOverlay_BrowseAllMusic");
+ this._navigateAndClose(MS.Entertainment.UI.Monikers.musicMarketplace, MS.Entertainment.UI.Monikers.musicMarketplaceAlbums)
+ }, _navigateAndClose: function _navigateAndClose(page, hub, navigationArguments) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateTo(page, hub, null, navigationArguments);
+ this._container.hide()
+ }, onPlaylistInvoked: function onPlaylistInvoked(event) {
+ if (event.detail.itemPromise)
+ event.detail.itemPromise.done(function (mediaItem) {
+ this._container.result = mediaItem && mediaItem.data;
+ this._sendTelemetryEvent("PlayPlaylistOverlay_" + this.invokeTelemetryMoniker);
+ this._container.hide()
+ }.bind(this))
+ }, _queryPlaylists: function _queryPlaylists() {
+ var query = new MS.Entertainment.Data.Query.libraryPlaylists;
+ query.sort = Microsoft.Entertainment.Queries.PlaylistsSortBy.dateEditedDescending;
+ query.isLive = false;
+ query.execute().done(function querySuccess(q) {
+ if (q.result && q.result.items && q.result.items.count) {
+ this.playlists = q.result.items;
+ this._showPlaylists = true
+ }
+ else
+ this._showNoPlaylists = true;
+ this._updateState()
+ }.bind(this))
+ }, _updateState: function _updateState() {
+ if (this._showPlaylists && this._playlists) {
+ this._sendTelemetryEvent("PlayPlaylistOverlay_DisplayedWithPlaylists");
+ WinJS.Utilities.removeClass(this._playlists, "hideFromDisplay");
+ this._showPlaylists = false
+ }
+ if (this._showNoPlaylists && this._noPlaylists) {
+ this._sendTelemetryEvent("PlayPlaylistOverlay_DisplayedWithoutPlaylists");
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (signedInUser.isSubscription || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay))
+ WinJS.Utilities.removeClass(this._allMusicLink, "hideFromDisplay");
+ WinJS.Utilities.removeClass(this._noPlaylists, "hideFromDisplay");
+ this._showNoPlaylists = false
+ }
+ }, _sendTelemetryEvent: function _sendTelemetryEvent(event) {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(event)
+ }, _getImportPlaylistsAction: function _getImportPlaylistsAction() {
+ var importPlaylistsAction = MS.Entertainment.UI.Actions.ImportPlaylists.getDoImportPlaylistsAction();
+ var executed = importPlaylistsAction.executed;
+ importPlaylistsAction.executed = function executedOverride() {
+ return executed().then(function executedCompleted() {
+ this._container.hide()
+ }.bind(this))
+ }.bind(this);
+ return importPlaylistsAction
+ }
+ }, {
+ showManageLink: true, dialogTitle: String.empty, playlists: null, importPlaylistsAction: null
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Music", {
+ PlayPlaylistAction: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Actions.Action", function playPlaylistActionConstructor() {
+ MS.Entertainment.UI.Actions.Action.prototype.constructor.apply(this)
+ }, {
+ canExecute: function canExecute() {
+ return true
+ }, executed: function (parameter) {
+ var options = this._getOverlayOptions();
+ var overlay = new MS.Entertainment.UI.Controls.Overlay(document.createElement("div"), options);
+ return overlay.show().then(function onOverlayClosed() {
+ var mediaItem = overlay.result;
+ if (!mediaItem)
+ return;
+ var query = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ query.playlistId = mediaItem.libraryId;
+ query.isLive = false;
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(query, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, saveNowPlaying: false, showImmersive: false, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.playlist, showAppBar: true, shuffle: false, playContext: { playlist: mediaItem }
+ })
+ })
+ }, _getOverlayOptions: function () {
+ var halfPopoverWidth = 335;
+ var halfPopoverHeight = 325;
+ var centeredStyle = "calc(50% - {0}px)";
+ var horizontalMargin = centeredStyle.format(halfPopoverWidth);
+ var verticalMargin = centeredStyle.format(halfPopoverHeight);
+ var options = {
+ userControl: "MS.Entertainment.Music.PlayPlaylistOverlay", userControlOptions: { invokeTelemetryMoniker: "PlaylistPlayed" }, top: verticalMargin, left: horizontalMargin, bottom: verticalMargin, right: horizontalMargin, persistOnNavigate: false, dontWaitForContent: true, enableKeyboardLightDismiss: true, showAnimation: function showAnimation() {
+ return WinJS.Promise.as()
+ }
+ };
+ return options
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Music", {
+ PickPlaylistAction: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Music.PlayPlaylistAction", function pickPlaylistActionConstructor() {
+ MS.Entertainment.Music.PlayPlaylistAction.prototype.constructor.apply(this)
+ }, {
+ executed: function (parameter) {
+ var options = this._getOverlayOptions();
+ var mediaItem = this.parameter.mediaItem;
+ var automationId = this.automationId;
+ options.userControlOptions.dialogTitle = String.id.IDS_PICK_PLAYLIST_OVERLAY_TITLE;
+ options.userControlOptions.hideManageLink = true;
+ options.userControlOptions.invokeTelemetryMoniker = "PlaylistChosen";
+ return MS.Entertainment.Data.List.listToArray(mediaItem).then(function gotItems(mediaItemArray) {
+ var appView = Windows.UI.ViewManagement.ApplicationView;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!uiStateService.isSnapped || appView.tryUnsnap()) {
+ var appBarControl = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBarControl)
+ appBarControl.hide();
+ var overlay = new MS.Entertainment.UI.Controls.Overlay(document.createElement("div"), options);
+ return overlay.show().then(function onOverlayDismissed() {
+ var playlistItem = overlay.result;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.addToPlaylist);
+ action.automationId = automationId;
+ action.parameter = {
+ mediaItem: playlistItem, itemToAdd: mediaItemArray, shouldUseTopSongsForArtistAddTo: parameter.shouldUseTopSongsForArtistAddTo
+ };
+ action.execute()
+ })
+ }
+ }, function onListToArrayError(error) {
+ MS.Entertainment.Music.fail("listToArray failed with error: " + (error && error.message))
+ })
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Music", {
+ AddToPlaylistAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function AddToPlaylistActionConstructor() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.addToPlaylistAction, _marketplaceEnabled: false, _isDTOMarket: false, _refreshAppState: function _refreshAppState() {
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var featureEnablement = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.featureEnablement);
+ var freeStreamEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay);
+ this._marketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var userCanSubscriptionStream = this._marketplaceEnabled && signedInUserService && signedInUserService.isSubscription;
+ this._isDTOMarket = this._marketplaceEnabled && !freeStreamEnabled && !userCanSubscriptionStream
+ }, translateDragAndDropParams: function translateDragAndDropParams(source, target) {
+ MS.Entertainment.UI.Actions.assert(target, "A target playlist is required when adding to a playlist.");
+ return {
+ itemToAdd: source && source.data, mediaItem: target
+ }
+ }, executed: function (parameter) {
+ var playlistItem = parameter.mediaItem;
+ var itemToAdd = parameter.itemToAdd || this.itemToAdd;
+ var mediaContext;
+ var collectionFilter;
+ if (!playlistItem)
+ return;
+ mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ collectionFilter = mediaContext && mediaContext.collectionFilter;
+ return MS.Entertainment.Data.List.listToArray(itemToAdd).then(function gotArray(mediaItemsArray) {
+ if (mediaItemsArray.length)
+ MS.Entertainment.UI.Actions.Playlists._appendToPlaylist(playlistItem.libraryId, playlistItem.name, mediaItemsArray, collectionFilter, parameter)
+ }.bind(this)).then(null, function ignoreFailures(error) {
+ MS.Entertainment.Music.assert(WinJS.Promise.isCanceledError(error), "Failed to append items to a playlist. Error: " + (error && error.message))
+ }).then(function finishAction() {
+ if (this.callback)
+ this.callback()
+ }.bind(this))
+ }, canExecute: function canExecute(parameter) {
+ var itemToAdd = parameter.itemToAdd || parameter.mediaItems || this.itemToAdd;
+ this._refreshAppState();
+ return ((!this._isDTOMarket || !this.isDragAndDropResponse) && this._mediaItemNotEmpty(itemToAdd)) || this._mediaItemsFromCollection(itemToAdd)
+ }, _mediaItemNotEmpty: function _mediaItemNotEmpty(mediaItem) {
+ var mediaItemNotEmpty = false;
+ if (Array.isArray(mediaItem))
+ mediaItemNotEmpty = mediaItem.length > 0;
+ else if (MS.Entertainment.Data.List.isList(mediaItem))
+ mediaItemNotEmpty = mediaItem.count > 0;
+ else
+ mediaItemNotEmpty = !!mediaItem;
+ return mediaItemNotEmpty
+ }, _mediaItemsFromCollection: function _mediaItemsFromCollection(mediaItems) {
+ var mediaItem;
+ if (Array.isArray(mediaItems))
+ mediaItem = mediaItems[0];
+ else if (MS.Entertainment.Data.List.isList(mediaItems)) {
+ MS.Entertainment.Data.List.dataFromIndex(mediaItems, 0).done(function gotMediaItem(data) {
+ mediaItem = data
+ }, function getMediaItemFailed(error) {
+ MS.Entertainment.Music.fail("Failed to get media item from virtual list.")
+ });
+ MS.Entertainment.Music.assert(mediaItem || mediaItems.count === 0, "Failed to get media item synchronously.")
+ }
+ else if (mediaItems)
+ mediaItem = mediaItems;
+ else
+ MS.Entertainment.Music.fail("Expected a valid item or list of items to add to playlist.");
+ return !!mediaItem && mediaItem.fromCollection
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.pickPlaylist, function () {
+ return new MS.Entertainment.Music.PickPlaylistAction
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.playPlaylist, function () {
+ return new MS.Entertainment.Music.PlayPlaylistAction
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.addToPlaylist, function () {
+ return new MS.Entertainment.Music.AddToPlaylistAction
+ });
+ WinJS.Namespace.define("MS.Entertainment.Music", {
+ SelectPlaylistAction: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Actions.Action", function selectPlaylistConstructor() {
+ MS.Entertainment.Music.PlayPlaylistAction.prototype.constructor.apply(this)
+ }, {
+ executed: function executed(param) {
+ param = param || {};
+ var galleryClass = param.galleryClass || this.galleryClass;
+ var action;
+ if (param.action)
+ action = param.action;
+ else if (param.actionId) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ action = actionService.getAction(param.actionId)
+ }
+ else
+ action = this.action;
+ MS.Entertainment.Framework.assert(action, "No valid action given to selectPlaylist");
+ if (action) {
+ action.itemToAdd = param.mediaItem;
+ action.automationId = this.automationId
+ }
+ var options = {
+ galleryClass: galleryClass, action: action, media: param.mediaItem
+ };
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.selectPlaylist, null, null, options)
+ }, canExecute: function canExecute() {
+ return true
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.selectPlaylist, function () {
+ return new MS.Entertainment.Music.SelectPlaylistAction
+ })
+ })()
+})();
+/* >>>>>>/viewmodels/music/playlistsviewmodel.js:26718 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var ViewModels;
+ (function (ViewModels) {
+ var PlaylistsItemData = (function (_super) {
+ __extends(PlaylistsItemData, _super);
+ function PlaylistsItemData(data) {
+ _super.call(this);
+ this._selected = false;
+ this._data = null;
+ this._data = data
+ }
+ Object.defineProperty(PlaylistsItemData.prototype, "data", {
+ get: function () {
+ return this._data
+ }, set: function (value) {
+ this.updateAndNotify("data", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PlaylistsItemData.prototype, "selected", {
+ get: function () {
+ return this._selected
+ }, set: function (value) {
+ this.updateAndNotify("selected", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PlaylistsItemData.prototype, "id", {
+ get: function () {
+ return "playlist"
+ }, enumerable: true, configurable: true
+ });
+ return PlaylistsItemData
+ })(Entertainment.UI.Framework.ObservableBase);
+ ViewModels.PlaylistsItemData = PlaylistsItemData;
+ var PlaylistsViewModel = (function (_super) {
+ __extends(PlaylistsViewModel, _super);
+ function PlaylistsViewModel() {
+ var _this = this;
+ _super.call(this);
+ this._disposed = false;
+ this._query = null;
+ this._playlists = null;
+ this._selectionManager = null;
+ this._showImportPlaylists = false;
+ this._playlistsChangeListener = null;
+ this._selectionBindings = null;
+ this._preventNavigationLibraryId = -1;
+ this._playlists = new Entertainment.Data.ObservableArrayVirtualListAdapter;
+ this._selectionManager = new Entertainment.UI.Framework.SelectionManager(this._playlists);
+ this._query = new Entertainment.Data.Query.libraryPlaylists;
+ this._query.sort = Microsoft.Entertainment.Queries.PlaylistsSortBy.dateEditedDescending;
+ this._query.isLive = true;
+ this._query.chunkSize = ViewModels.PlaylistsViewModel._fixedQueryPageSize;
+ this._query.getItems().done(function (virtualList) {
+ if (virtualList) {
+ _this._playlists.initialize(virtualList, function (data) {
+ return new PlaylistsItemData(data)
+ });
+ _this.showImportPlaylists = true
+ }
+ }, function (error) {
+ MS.Entertainment.fail("Library playlists query failed!" + (error && error.message))
+ });
+ this._playlistsChangeListener = function (notification) {
+ if (notification.type === Entertainment.ObservableArray.OperationTypes.add) {
+ var selectedItem = _this._selectionManager.selectedItem;
+ if (selectedItem && selectedItem.selected && selectedItem.data.libraryId === notification.item.data.libraryId)
+ _this._selectionManager.selectedIndex = notification.index
+ }
+ };
+ this._playlists.addChangeListener(this._playlistsChangeListener);
+ this._selectionBindings = Entertainment.UI.Framework.addEventHandlers(this._selectionManager, {
+ selectedItemChanged: function (args) {
+ var newSelectedItem = WinJS.Utilities.getMember("detail.newSelection.item", args);
+ var oldSelectedItem = WinJS.Utilities.getMember("detail.oldSelection.item", args);
+ if (newSelectedItem && (!oldSelectedItem || oldSelectedItem.data.libraryId !== newSelectedItem.data.libraryId) && (_this._preventNavigationLibraryId < 0 || _this._preventNavigationLibraryId !== newSelectedItem.data.libraryId)) {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var navigateToPlaylistDetailsAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.playlistDetailsNavigate);
+ navigateToPlaylistDetailsAction.parameter = newSelectedItem.data;
+ navigateToPlaylistDetailsAction.execute()
+ }
+ _this._preventNavigationLibraryId = -1
+ }, reselected: function (args) {
+ var navigationJournal = Entertainment.UI.Framework.Navigation.getJournal();
+ if (!navigationJournal.canGoBack)
+ return;
+ var reselectedItem = WinJS.Utilities.getMember("detail.selection.item", args);
+ if (reselectedItem) {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var navigateToPlaylistDetailsAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.playlistDetailsNavigate);
+ navigateToPlaylistDetailsAction.parameter = reselectedItem.data;
+ navigateToPlaylistDetailsAction.execute()
+ }
+ }
+ })
+ }
+ PlaylistsViewModel.prototype.dispose = function () {
+ if (this._disposed)
+ return;
+ if (this._playlists && this._playlistsChangeListener)
+ this._playlists.removeChangeListener(this._playlistsChangeListener);
+ if (this._selectionBindings) {
+ this._selectionBindings.cancel();
+ this._selectionBindings = null
+ }
+ if (this._playlists) {
+ this._playlists.dispose();
+ this._playlists = null
+ }
+ if (this._selectionManager) {
+ this._selectionManager.dispose();
+ this._selectionManager = null
+ }
+ if (this._query) {
+ this._query.dispose();
+ this._query = null
+ }
+ this._disposed = true
+ };
+ PlaylistsViewModel.prototype.refresh = function () {
+ if (!this._disposed && this._query && this._query.forceLiveRefresh)
+ this._query.forceLiveRefresh()
+ };
+ Object.defineProperty(PlaylistsViewModel.prototype, "playlists", {
+ get: function () {
+ return this._playlists
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PlaylistsViewModel.prototype, "selectionManager", {
+ get: function () {
+ return this._selectionManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PlaylistsViewModel.prototype, "showImportPlaylists", {
+ get: function () {
+ return this._showImportPlaylists
+ }, set: function (value) {
+ this._showImportPlaylists = value;
+ this.dispatchChangeAndNotify("showImportPlaylists", value, !value)
+ }, enumerable: true, configurable: true
+ });
+ PlaylistsViewModel.prototype.getCreatePlaylistAction = function () {
+ var _this = this;
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var createPlaylistAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.createPlaylist);
+ createPlaylistAction.automationId = Entertainment.UI.AutomationIds.navPaneCreatePlaylist;
+ createPlaylistAction.parameter = {
+ showPlaylistPopover: false, completeAction: function () {
+ _this.refresh()
+ }
+ };
+ return createPlaylistAction
+ };
+ PlaylistsViewModel.prototype.getImportPlaylistsAction = function () {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var importPlaylistsAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.importPlaylists);
+ importPlaylistsAction.automationId = Entertainment.UI.AutomationIds.navPaneImportPlaylists;
+ return importPlaylistsAction
+ };
+ PlaylistsViewModel.prototype.navigateToPlaylist = function (libraryId, preventAsserts) {
+ var index = -1;
+ for (var i = 0; i < this._playlists.length; i++)
+ if (this._playlists.item(i).data.libraryId === libraryId) {
+ index = i;
+ break
+ }
+ MS.Entertainment.ViewModels.assert(preventAsserts || index !== -1, "Library id not found in playlists. Cannot navigate to provided library id: " + libraryId);
+ if (index !== -1)
+ this._selectionManager.selectedIndex = index;
+ return index >= 0
+ };
+ PlaylistsViewModel.prototype.navigateToPlaylistAsync = function (libraryId, timeoutMS) {
+ var _this = this;
+ var result = null;
+ if (this.navigateToPlaylist(libraryId, true))
+ result = WinJS.Promise.as(true);
+ else if (this._playlists) {
+ var playlists = this._playlists;
+ var foundSignal = new Entertainment.UI.Framework.Signal;
+ var temporaryListener = function (notification) {
+ if (notification.type === Entertainment.ObservableArray.OperationTypes.add && _this.navigateToPlaylist(libraryId, true))
+ foundSignal.complete(true)
+ };
+ playlists.addChangeListener(temporaryListener);
+ result = foundSignal.promise.then(null, function () {
+ return false
+ }).then(function (found) {
+ playlists.removeChangeListener(temporaryListener);
+ return found
+ });
+ if (timeoutMS > 0)
+ WinJS.Promise.timeout(timeoutMS, foundSignal.promise)
+ }
+ return result
+ };
+ PlaylistsViewModel.prototype.selectPlaylistAsync = function (libraryId, timeout) {
+ this._preventNavigationLibraryId = libraryId;
+ return this.navigateToPlaylistAsync(libraryId, timeout)
+ };
+ PlaylistsViewModel._fixedQueryPageSize = 100;
+ return PlaylistsViewModel
+ })(Entertainment.UI.Framework.ObservableBase);
+ ViewModels.PlaylistsViewModel = PlaylistsViewModel;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.playlists, function () {
+ return new PlaylistsViewModel
+ })
+ })(ViewModels = Entertainment.ViewModels || (Entertainment.ViewModels = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/winjsnavigation.js:26944 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Framework;
+ (function (Framework) {
+ var fx = MS.Entertainment.UI.Framework;
+ var PivotData = (function (_super) {
+ __extends(PivotData, _super);
+ function PivotData(dataContext, template, title, icon, moniker, onNavigateStart, onNavigateComplete, dropActionId, supportsSnapped) {
+ if (supportsSnapped === void 0)
+ supportsSnapped = false;
+ _super.call(this);
+ this.dataContext = dataContext;
+ this.template = template;
+ this.title = title;
+ this.icon = icon;
+ this.moniker = moniker;
+ this.onNavigateStart = onNavigateStart;
+ this.onNavigateComplete = onNavigateComplete;
+ this.dropActionId = dropActionId;
+ this.supportsSnapped = supportsSnapped;
+ this._selected = false
+ }
+ Object.defineProperty(PivotData.prototype, "selected", {
+ get: function () {
+ return this._selected
+ }, set: function (value) {
+ this.updateAndNotify("selected", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PivotData.prototype, "id", {
+ get: function () {
+ return this.moniker
+ }, enumerable: true, configurable: true
+ });
+ return PivotData
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Framework.PivotData = PivotData;
+ var NavigationOperation = (function () {
+ function NavigationOperation(dataContext, template, contentComplete, skipUI, animatePageTransition, dataContextParameter, monikerData, supportsSnapped) {
+ if (supportsSnapped === void 0)
+ supportsSnapped = false;
+ this.dataContext = null;
+ this.template = null;
+ this.contentComplete = null;
+ this.skipUI = false;
+ this.animatePageTransition = false;
+ this.supportsSnapped = false;
+ this.dataContext = dataContext;
+ this.template = template;
+ this.contentComplete = contentComplete;
+ if (skipUI === null || skipUI === undefined)
+ this.skipUI = false;
+ else
+ this.skipUI = skipUI;
+ if (animatePageTransition === null || animatePageTransition === undefined)
+ this.animatePageTransition = true;
+ else
+ this.animatePageTransition = animatePageTransition;
+ this.dataContextParameter = dataContextParameter;
+ this.monikerData = monikerData;
+ this.supportsSnapped = supportsSnapped
+ }
+ return NavigationOperation
+ })();
+ Framework.NavigationOperation = NavigationOperation;
+ var Navigation = (function (_super) {
+ __extends(Navigation, _super);
+ function Navigation(_contentContainer, pivots) {
+ _super.call(this);
+ this._contentContainer = _contentContainer;
+ this._suppressNavigationOnNextSelectionChange = false;
+ this._skipUICreationOnNextPivotChange = false;
+ this._firstNavigate = true;
+ this.animatePageTransitions = false;
+ this.focusImmediatelyOnBackNavigation = false;
+ this.forceFUENavigation = false;
+ this.playBackNavigationSound = false;
+ this.clearCachesOnNavigation = false;
+ this.setFocusContainerOnNavigation = false;
+ this.blockInputOnHiddenPages = false;
+ this._onFUEPage = false;
+ this._isFirstLocationLoaded = false;
+ this._isNavigationInProgress = false;
+ this._deferTemplateLoads = false;
+ this._defaultPivotIndex = 0;
+ this.focusTimeout = Navigation.DEFAULT_FOCUS_TIMEOUT;
+ this._journal = Navigation.getJournal();
+ this._journalEvents = fx.addEventHandlers(this._journal, {
+ beforenavigate: this._handleBeforeNavigate.bind(this), navigating: this._handleNavigating.bind(this), navigated: this._handleNavigated.bind(this)
+ });
+ fx.currentContentContainer = document.querySelector(".control-app")
+ }
+ Object.defineProperty(Navigation.prototype, "primaryPivots", {
+ get: function () {
+ return this._primaryPivots
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "currentSupportsSnapped", {
+ get: function () {
+ var currentSupportsSnapped = false;
+ if (this._journal && this._journal.state)
+ currentSupportsSnapped = !!this._journal.state.supportsSnapped;
+ return currentSupportsSnapped
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "realizedDataContext", {
+ get: function () {
+ return this._journal && this._journal.state && this._journal.state.realizedDataContext
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "currentMonikerData", {
+ get: function () {
+ return WinJS.Utilities.getMember("_journal.state.monikerData", this)
+ }, enumerable: true, configurable: true
+ });
+ Navigation.prototype.initialize = function (pivots, defaultPivot, fueNavigationOperation) {
+ var _this = this;
+ if (fueNavigationOperation) {
+ this._fueNavigationOperation = fueNavigationOperation;
+ fueNavigationOperation.animatePageTransition = false;
+ var originalContentComplete = fueNavigationOperation.contentComplete;
+ fueNavigationOperation.contentComplete = function () {
+ _this._onFUEPage = true;
+ if (originalContentComplete)
+ originalContentComplete()
+ }
+ }
+ this._defaultPivotIndex = (typeof defaultPivot === "undefined") ? 0 : defaultPivot;
+ this._primaryPivots = pivots;
+ MS.Entertainment.UI.Framework.addEventHandlers(this._primaryPivots, {
+ selectedItemChanged: function (args) {
+ var selectedPivot = (args && args.detail && args.detail.newSelection && args.detail.newSelection.item);
+ if (selectedPivot)
+ _this._handlePivotChange(selectedPivot, args.detail.newSelection.index)
+ }, reselected: function (args) {
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ if (!navigationJournal.canGoBack) {
+ if (WinJS.Utilities.getMember("_journal.state.realizedDataContext.dataContextParameterChanged", _this)) {
+ _this._journal.state.realizedDataContext.dataContextParameterChanged(_this._dataContextParameterForNextPivotChange);
+ _this._dataContextParameterForNextPivotChange = null
+ }
+ return
+ }
+ var reselectedPivot = (WinJS.Utilities.getMember("detail.selection.item", args));
+ if (reselectedPivot)
+ _this._handlePivotChange(reselectedPivot, WinJS.Utilities.getMember("detail.selection.index", args))
+ }
+ })
+ };
+ Navigation.prototype._getCurrentPivotChangePromise = function () {
+ return this._inProgressNavigation
+ };
+ Navigation.prototype.cancelInProgressNavigation = function () {
+ if (this._inProgressNavigation) {
+ this._inProgressNavigation.cancel();
+ this._resetInProgressNavigation()
+ }
+ };
+ Navigation.prototype._handlePivotChange = function (selectedPivot, index) {
+ this.cancelInProgressNavigation();
+ if (this._suppressNavigationOnNextSelectionChange) {
+ this._suppressNavigationOnNextSelectionChange = false;
+ return WinJS.Promise.as()
+ }
+ if (selectedPivot.onNavigateStart)
+ selectedPivot.onNavigateStart();
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ var navigationPreviousLocation = navigationJournal ? navigationJournal.location : String.empty;
+ this.clearHistory();
+ var navigationPromise = this.navigateTo(new NavigationOperation(selectedPivot.dataContext, selectedPivot.template, selectedPivot.onNavigateComplete, this._skipUICreationOnNextPivotChange, undefined, this._dataContextParameterForNextPivotChange, selectedPivot.moniker, selectedPivot.supportsSnapped));
+ this._dataContextParameterForNextPivotChange = null;
+ var contentCatalogIds = MS.Entertainment.Utilities.Telemetry.ContentCatalogId;
+ var contentSourceIds = MS.Entertainment.Utilities.Telemetry.ContentSourceId;
+ var contentTypeIds = MS.Entertainment.Utilities.Telemetry.ContentTypeId;
+ var navigationLocation = navigationJournal ? navigationJournal.location : String.empty;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ slot: index, areaName: "NavBarArea1", contentId: selectedPivot.moniker, contentCatalogId: contentCatalogIds.App, contentSourceId: contentSourceIds.App, contentTypeId: contentTypeIds.App, contentName: selectedPivot.moniker
+ }, {
+ uri: navigationPreviousLocation, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: navigationLocation, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ return navigationPromise
+ };
+ Navigation.prototype._adjustScroller = function () {
+ if (this._contentContainer.children.length > 1) {
+ if (!this._contentContainerHeight)
+ this._contentContainerHeight = this.contentContainer.getBoundingClientRect().height;
+ var scrollLimit = ((this._contentContainer.children.length - 1) * this._contentContainerHeight);
+ this._contentContainer.style.msScrollLimitYMin = scrollLimit + "px"
+ }
+ else {
+ this._contentContainer.style.msScrollLimitYMin = "";
+ this._contentContainer.scrollTop = 0
+ }
+ };
+ Navigation.prototype._handleElementSizeChanged = function () {
+ var newWindowHeight = MS.Entertainment.Utilities.getWindowHeight();
+ if (this._previousWindowHeight && (this._previousWindowHeight === newWindowHeight))
+ return;
+ this._previousWindowHeight = newWindowHeight;
+ this._contentContainerHeight = 0;
+ this._adjustScroller()
+ };
+ Navigation.prototype._getPreviousStackLocation = function () {
+ var previousLocation = String.empty;
+ var oldState;
+ var backStack = this._journal.history.backStack;
+ if (backStack.length > 1) {
+ oldState = backStack[backStack.length - 1].state;
+ if (oldState && oldState.location)
+ previousLocation = oldState.location
+ }
+ return previousLocation
+ };
+ Navigation.prototype._dropInput = function (e) {
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.invokeGlobalCommand:
+ case WinJS.Utilities.Key.searchButton:
+ case WinJS.Utilities.Key.dismissButton:
+ return
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ e.stopImmediatePropagation()
+ };
+ Navigation.prototype._loadPage = function (state, template, removeOldContent, skipEnterPage) {
+ var _this = this;
+ var dataContext = state.initialDataContext;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.LoadTemplate:" + template + ",StartTM");
+ return fx.loadTemplate(template, null, !this._deferTemplateLoads).then(function (control) {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.LoadTemplate:" + template + ",StopTM");
+ var container = document.createElement("div");
+ WinJS.Utilities.addClass(container, "nav-currentPage");
+ WinJS.Utilities.addClass(container, "hideFromDisplay");
+ _this._waitOnContentComplete(container).done(function () {
+ MS.Entertainment.Utilities.Telemetry.logPageView(container, { uri: template }, { uri: _this._getPreviousStackLocation() })
+ });
+ _this.contentContainer.appendChild(container);
+ _this._adjustScroller();
+ state.domElement = container;
+ var realizedDataContext = null;
+ if (dataContext) {
+ if (!(dataContext instanceof Function))
+ throw new Error("You must supply a function as a data context");
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ":CreateDataContext,StartTM");
+ realizedDataContext = dataContext(state.dataContextCreationParameter);
+ state.dataContextCreationParameter = null;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ":CreateDataContext,StopTM")
+ }
+ container.__navigationState = state;
+ state.realizedDataContext = realizedDataContext;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.EnterPage:" + template + ",StartTM");
+ return WinJS.Promise.join({
+ element: control.render(realizedDataContext, container), exitPage: removeOldContent
+ })
+ }).then(function (result) {
+ var element = result.element;
+ var animateTransition = true;
+ if (!skipEnterPage) {
+ animateTransition = state.animatePageTransition;
+ WinJS.Utilities.removeClass(element, "hideFromDisplay")
+ }
+ else
+ animateTransition = false;
+ var enterPageResult = WinJS.Promise.join({
+ enterpage: _this._enterPage(element, animateTransition).then(function () {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.EnterPage:" + template + ",StopTM")
+ }), element: element
+ });
+ _this._resetInProgressNavigation();
+ return enterPageResult
+ })
+ };
+ Navigation.prototype._handleForwardNavigation = function (state, template) {
+ var _this = this;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ",StartTM");
+ if (state.skipUI) {
+ this._resetInProgressNavigation();
+ return WinJS.Promise.as()
+ }
+ if (this.clearCachesOnNavigation && Entertainment.Utilities.isAboveMemoryCleanupThreshold())
+ Framework.clearCaches(true);
+ var oldState;
+ var backStack = this._journal.history.backStack;
+ var removeOldContent;
+ if (this._firstNavigate) {
+ this.removeContent(this.contentContainer.firstElementChild);
+ removeOldContent = WinJS.Promise.as();
+ this._firstNavigate = false;
+ this._waitOnContentComplete(this.contentContainer).done(function () {
+ _this._isFirstLocationLoaded = true
+ })
+ }
+ else {
+ this._isFirstLocationLoaded = true;
+ if (this._journal.canGoBack && backStack[backStack.length - 1]) {
+ oldState = backStack[backStack.length - 1].state;
+ if (oldState.domElement) {
+ if (this.blockInputOnHiddenPages) {
+ var dropInput = this._dropInput.bind(this);
+ oldState.inputBlockEventHandlers = Framework.addEventHandlers(oldState.domElement, {
+ keydown: dropInput, keyup: dropInput, keypress: dropInput
+ }, true)
+ }
+ if (oldState.domElement.contains(document.activeElement))
+ oldState.previouslyFocusedItem = this._extractFocusElementInformation(oldState.domElement);
+ MS.Entertainment.assert(oldState, "Given we can go back, expected to be able to get information from the backstack");
+ removeOldContent = this._exitPage().then(function () {
+ WinJS.Utilities.removeClass(oldState.domElement, "nav-currentPage");
+ MS.Entertainment.UI.Framework.freezeControlsInSubtree(oldState.domElement)
+ })
+ }
+ else
+ removeOldContent = WinJS.Promise.as()
+ }
+ }
+ if (!template) {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:NoTemplate,StopTM");
+ return removeOldContent
+ }
+ var pageLoadedSignal = new fx.Signal;
+ this._wasInteractedBeforeTimeout(this.contentContainer, pageLoadedSignal.promise).then(function (wasInteracted) {
+ if (wasInteracted)
+ return;
+ if (state === _this._journal.state) {
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(state.domElement))
+ return;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(state.domElement)
+ }
+ }).done(null, function (error) {
+ MS.Entertainment.fail("Failure setting focus: " + (error && error.message))
+ });
+ return this._loadPage(state, template, removeOldContent).then(function (result) {
+ if (oldState && oldState.domElement && (oldState != _this._journal.state))
+ WinJS.Utilities.addClass(oldState.domElement, "hideFromDisplay");
+ if (!oldState || oldState !== _this._journal.state) {
+ if (_this.setFocusContainerOnNavigation)
+ fx.currentContentContainer = state.domElement;
+ MS.Entertainment.UI.Framework.setFocusRoot(state.domElement)
+ }
+ pageLoadedSignal.complete();
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ",StopTM")
+ })
+ };
+ Navigation.prototype._handleBackNavigation = function (newState) {
+ var _this = this;
+ var oldContentRemovedPromise;
+ var createdPage = false;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigatingBack:" + newState.location + ",StartTM");
+ if (this.playBackNavigationSound)
+ Entertainment.Utilities.playBackButtonClick();
+ var historyItem = this._journal.history.forwardStack.shift();
+ MS.Entertainment.assert(historyItem, "Expected to find some history state");
+ if (historyItem && historyItem.state) {
+ var oldState = historyItem.state;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ slot: 0, areaName: "BackButtonArea", contentId: "BackButton", contentCatalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.App, contentSourceId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.App, contentTypeId: MS.Entertainment.Utilities.Telemetry.ContentTypeId.App, contentName: "BackButton"
+ }, {
+ uri: oldState.location, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: newState.location, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ oldContentRemovedPromise = this._exitPage().then(function () {
+ _this.removeContent(oldState.domElement)
+ })
+ }
+ else
+ oldContentRemovedPromise = WinJS.Promise.as();
+ return oldContentRemovedPromise.then(function () {
+ if (newState.domElement)
+ return;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigatingBack.CreatingPage:" + newState.location);
+ createdPage = true;
+ return _this._loadPage(newState, newState.location, oldContentRemovedPromise, true)
+ }).then(function () {
+ WinJS.Utilities.addClass(newState.domElement, "nav-currentPage");
+ WinJS.Utilities.removeClass(newState.domElement, "hideFromDisplay");
+ MS.Entertainment.UI.Framework.thawControlsInSubtree(newState.domElement);
+ if (_this.setFocusContainerOnNavigation)
+ fx.currentContentContainer = newState.domElement;
+ MS.Entertainment.UI.Framework.setFocusRoot(newState.domElement);
+ if (newState.inputBlockEventHandlers) {
+ newState.inputBlockEventHandlers.cancel();
+ newState.inputBlockEventHandlers = null
+ }
+ _this._journal.history.forwardStack = [];
+ var enterPagePromise = _this._enterPage(newState.domElement, newState.animatePageTransition);
+ if (createdPage)
+ return;
+ if (WinJS.Utilities.getMember("realizedDataContext.navigatedBackTo", newState))
+ newState.realizedDataContext.navigatedBackTo();
+ { };
+ _this._resetInProgressNavigation();
+ var checkForInteractionPromise;
+ if (_this.focusImmediatelyOnBackNavigation)
+ checkForInteractionPromise = WinJS.Promise.wrap(false);
+ else
+ checkForInteractionPromise = _this._wasInteractedBeforeTimeout(newState.domElement, enterPagePromise);
+ checkForInteractionPromise.then(function (wasInteraction) {
+ if (wasInteraction)
+ return;
+ if (!document.body.contains(newState.domElement))
+ return;
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(newState.domElement) || MS.Entertainment.UI.Framework.focusedItemInContainer(newState.domElement))
+ return;
+ var focusState = newState.previouslyFocusedItem;
+ newState.previouslyFocusedItem = null;
+ if (focusState)
+ if (focusState.listView && focusState.currentItem) {
+ focusState.currentItem.showFocus = MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus;
+ focusState.listView.currentItem = focusState.currentItem
+ }
+ else
+ MS.Entertainment.UI.Framework.focusFirstFocusableAncestor(focusState.focusedElement);
+ else if (newState === _this._journal.state) {
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(newState.domElement))
+ return;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(newState.domElement)
+ }
+ }).done(null, function (error) {
+ MS.Entertainment.fail("Failure setting focus: " + (error && error.message))
+ });
+ return enterPagePromise
+ }).then(function () {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigatingBack:" + newState.location + ",StopTM");
+ MS.Entertainment.Utilities.Telemetry.logPageView(newState.domElement, { uri: newState.location }, { uri: oldState && oldState.location });
+ if (_this.clearCachesOnNavigation && Entertainment.Utilities.isAboveMemoryCleanupThreshold())
+ Framework.clearCaches(true).then(function () {
+ return WinJS.Promise.timeout(1000)
+ }).then(function () {
+ Framework.clearCaches(true)
+ })
+ })
+ };
+ Navigation.prototype._handleBeforeNavigate = function (args) {
+ var proposed = args.detail.state;
+ var current = this._journal.state;
+ var backstack = this._journal.history.backStack;
+ if (!current)
+ return;
+ if (window.onNewVideoPage && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var isCurrentLocationOldPage = MS.Entertainment.UI.Monikers && navigationService && navigationService.currentPage && navigationService.currentPage.iaNode.moniker !== MS.Entertainment.UI.Monikers.homeHub;
+ if (isCurrentLocationOldPage) {
+ var navigateBackAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateBackAction.automationId = "newBackNavigate";
+ navigateBackAction.parameter = MS.Entertainment.UI.Actions.navigate.NavigateLocation.back;
+ navigateBackAction.execute();
+ args.preventDefault()
+ }
+ }
+ var backStack = this._journal.history.backStack;
+ if (WinJS.Utilities.getMember("length", backStack) && backStack[backStack.length - 1].state === proposed && WinJS.Utilities.getMember("realizedDataContext.goBack", current) && current.realizedDataContext.goBack())
+ args.preventDefault();
+ if (proposed && (current.location === proposed.location) && WinJS.Utilities.getMember("realizedDataContext.dataContextParameterChanged", current)) {
+ current.realizedDataContext.dataContextParameterChanged(proposed.dataContextCreationParameter);
+ args.preventDefault()
+ }
+ };
+ Navigation.prototype._handleNavigating = function (args) {
+ args.detail.setPromise(WinJS.Promise.as(args.detail.delta < 0))
+ };
+ Navigation.prototype._handleNavigated = function (args) {
+ var _this = this;
+ var isBackNavigation = args.detail.value;
+ var navigationDetail = args.detail;
+ var navigationPromise;
+ this._updatePivotSelection(navigationDetail.state.monikerData);
+ if (!isBackNavigation)
+ navigationPromise = this._handleForwardNavigation(navigationDetail.state, navigationDetail.location);
+ else
+ navigationPromise = this._handleBackNavigation(navigationDetail.state);
+ navigationDetail.setPromise(navigationPromise.then(null, function (error) {
+ var message = (error && error.toString()) || String.empty;
+ if (!WinJS.Promise.isCanceledError(error))
+ MS.Entertainment.fail("Navigation failed with: " + message);
+ _this._resetInProgressNavigation();
+ return WinJS.Promise.wrapError(error)
+ }))
+ };
+ Navigation.prototype._updatePivotSelection = function (monikerData) {
+ if (!monikerData)
+ return;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.UpdatePivotSelection:" + monikerData + ",StartTM");
+ var dataSource = WinJS.Utilities.getMember("_primaryPivots.dataSource", this) || [];
+ var itemToSelect = -1;
+ dataSource.forEach(function (item, index) {
+ if (item.moniker !== monikerData)
+ return;
+ itemToSelect = index
+ });
+ if (itemToSelect > -1) {
+ if (this.primaryPivots.selectedIndex !== itemToSelect) {
+ this._suppressNavigationOnNextSelectionChange = true;
+ this.primaryPivots.selectedIndex = itemToSelect
+ }
+ }
+ else
+ this.dispatchEvent("unknownMonikerEncountered", { monikerData: monikerData });
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.UpdatePivotSelection:" + monikerData + ",StopTM")
+ };
+ Navigation.prototype.navigateTo = function (operation) {
+ var _this = this;
+ if (this._isNavigationInProgress)
+ return WinJS.Promise.cancel;
+ operation = operation || new NavigationOperation(null);
+ if (this._onFUEPage) {
+ this._onFUEPage = false;
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ config.fue.showLXFUE = false;
+ this.forceFUENavigation = false
+ }
+ if (!operation.monikerData)
+ if (this._suppressedMoniker)
+ operation.monikerData = this._suppressedMoniker;
+ else if (this._journal.state)
+ operation.monikerData = this._journal.state.monikerData;
+ this._suppressedMoniker = null;
+ this._isNavigationInProgress = true;
+ this._inProgressNavigation = this._journal.navigate(operation.template, {
+ initialDataContext: operation.dataContext, location: operation.template, contentComplete: operation.contentComplete, skipUI: operation.skipUI, animatePageTransition: operation.animatePageTransition, supportsSnapped: operation.supportsSnapped, dataContextCreationParameter: operation.dataContextParameter, monikerData: operation.monikerData
+ }).then(null, function (error) {
+ _this._resetInProgressNavigation();
+ return WinJS.Promise.wrapError(error)
+ });
+ return this._inProgressNavigation
+ };
+ Navigation.prototype.navigateToDefault = function () {
+ if (!this.primaryPivots.dataSource || (this.primaryPivots.dataSource.length < 1))
+ return WinJS.Promise.wrapError(new Error("Nothing to navigate to"));
+ var showFUEPromise = this._showFUEIfNeeded();
+ if (showFUEPromise)
+ return showFUEPromise;
+ var defaultPivotIndex = this._defaultPivotIndex;
+ if (defaultPivotIndex < 0 || defaultPivotIndex > this.primaryPivots.dataSource.length - 1)
+ defaultPivotIndex = 0;
+ if (this.primaryPivots.selectedIndex !== defaultPivotIndex) {
+ this._suppressNavigationOnNextSelectionChange = true;
+ this.primaryPivots.selectedIndex = defaultPivotIndex
+ }
+ var selectedPivot = this.primaryPivots.selectedItem;
+ return this._handlePivotChange(this.primaryPivots.selectedItem, this.primaryPivots.selectedIndex)
+ };
+ Navigation.prototype._showFUEIfNeeded = function () {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (this._fueNavigationOperation && (config.fue.showLXFUE || this.forceFUENavigation)) {
+ this.primaryPivots.clear();
+ return this.navigateTo(this._fueNavigationOperation)
+ }
+ return null
+ };
+ Navigation.prototype.navigateToMoniker = function (moniker, skipUI, skipBackStack, dataContextParameter) {
+ var dataSource = this._primaryPivots.dataSource;
+ if (!dataSource || !dataSource.length)
+ throw new Error("Nothing to navigate to");
+ var itemToSelect = -1;
+ dataSource.forEach(function (item, index) {
+ if (item.moniker != moniker)
+ return;
+ itemToSelect = index
+ });
+ if (itemToSelect === -1)
+ throw new Error("Moniker wasn't found in the list of pivots");
+ this._skipUICreationOnNextPivotChange = !!skipUI;
+ this._suppressNavigationOnNextSelectionChange = !!skipBackStack;
+ if (this._suppressNavigationOnNextSelectionChange)
+ this._suppressedMoniker = moniker;
+ this._dataContextParameterForNextPivotChange = dataContextParameter;
+ if (this._primaryPivots.selectedIndex === itemToSelect)
+ this._primaryPivots.reselect();
+ else
+ this._primaryPivots.selectedIndex = itemToSelect;
+ this._skipUICreationOnNextPivotChange = false;
+ this._dataContextParameterForNextPivotChange = null
+ };
+ Navigation.prototype.navigateBack = function () {
+ var result;
+ if (WinJS.Navigation.canGoBack)
+ result = WinJS.Navigation.back();
+ else
+ result = this.navigateToDefault();
+ return WinJS.Promise.as(result)
+ };
+ Object.defineProperty(Navigation.prototype, "contentContainer", {
+ get: function () {
+ if (!this._contentContainer) {
+ this._contentContainer = document.querySelector(".control-app .app-body");
+ this._containerEvents = fx.addEventHandlers(this._contentContainer, { mselementresize: this._handleElementSizeChanged.bind(this) })
+ }
+ return this._contentContainer
+ }, enumerable: true, configurable: true
+ });
+ Navigation.prototype.removeContent = function (container) {
+ if (!container)
+ return;
+ var context = container.__navigationState;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ContentRemoved,StartTM");
+ if (container.parentElement)
+ container.parentElement.removeChild(container);
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ContentRemoved,StopTM");
+ this._adjustScroller();
+ if (context) {
+ if (context.inputBlockEventHandlers) {
+ context.inputBlockEventHandlers.cancel();
+ context.inputBlockEventHandlers = null
+ }
+ if (context.realizedDataContext && context.realizedDataContext.dispose) {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.DataContextDisposed,StartTM");
+ context.realizedDataContext.dispose();
+ context.realizedDataContext = null;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.DataContextDisposed,StopTM")
+ }
+ }
+ };
+ Navigation.prototype._extractFocusElementInformation = function (pageContainer) {
+ var listViews = WinJS.Utilities.query(".win-listview", pageContainer);
+ var result = {
+ listView: null, currentItem: null, focusedElement: document.activeElement
+ };
+ if (listViews.length < 1)
+ return result;
+ var containingListView = listViews.filter(function (item) {
+ return item.contains(document.activeElement)
+ });
+ if (containingListView.length < 1)
+ return result;
+ var listView = containingListView[0].winControl;
+ if (listView) {
+ result.listView = listView;
+ result.currentItem = listView.currentItem
+ }
+ return result
+ };
+ Navigation.prototype._waitOnContentComplete = function (el) {
+ var signal = new fx.Signal;
+ var _listeners = fx.addEventHandlers(el, {
+ ContentComplete: function () {
+ if (_listeners) {
+ _listeners.cancel();
+ _listeners = null;
+ signal.complete()
+ }
+ }
+ });
+ return signal.promise
+ };
+ Navigation.prototype._wasInteractedBeforeTimeout = function (element, waitPromise) {
+ var _this = this;
+ var signal = new fx.Signal;
+ var timeout;
+ waitPromise = waitPromise || WinJS.Promise.as();
+ var interactionHandler = function () {
+ if (bindings) {
+ bindings.cancel();
+ bindings = null
+ }
+ if (signal) {
+ signal.complete(true);
+ signal = null
+ }
+ if (timeout)
+ timeout.cancel()
+ };
+ var bindings = MS.Entertainment.UI.Framework.addEventHandlers(element, {
+ MSManipulationStateChanged: interactionHandler, mousewheel: interactionHandler
+ });
+ waitPromise.then(function () {
+ if (!signal)
+ return;
+ timeout = WinJS.Promise.timeout(_this.focusTimeout);
+ return timeout
+ }).done(function () {
+ if (bindings) {
+ bindings.cancel();
+ bindings = null
+ }
+ if (signal) {
+ signal.complete(false);
+ signal = null
+ }
+ }, function () { });
+ return signal.promise
+ };
+ Navigation.prototype._enterPage = function (el, animatePageTransition) {
+ var result;
+ if (this.animatePageTransitions && animatePageTransition) {
+ el.style.overflow = "hidden";
+ el.style.opacity = "0.0";
+ result = WinJS.UI.Animation.enterPage(el).then(function () {
+ el.style.overflow = String.empty;
+ el.style.opacity = String.empty
+ })
+ }
+ else
+ result = WinJS.Promise.as();
+ return WinJS.Promise.timeout().then(function () {
+ return result
+ })
+ };
+ Navigation.prototype._exitPage = function () {
+ return WinJS.Promise.timeout()
+ };
+ Navigation.prototype._resetInProgressNavigation = function () {
+ if (this._inProgressNavigation)
+ this._inProgressNavigation = null;
+ this._isNavigationInProgress = false
+ };
+ Navigation.prototype.clearHistory = function () {
+ var _this = this;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ClearHistory,StartTM");
+ var children = WinJS.Utilities.children(this.contentContainer);
+ children.forEach(function (element) {
+ _this.removeContent(element)
+ });
+ this._journal.history = {};
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ClearHistory,StopTM")
+ };
+ Navigation.prototype.trimBackStack = function () {
+ var _this = this;
+ var backstackToTrim = this._journal.history.backStack;
+ backstackToTrim.forEach(function (historyItem) {
+ var state = historyItem.state;
+ _this.removeContent(state.domElement);
+ state.domElement = null;
+ state.previouslyFocusedItem = null
+ })
+ };
+ Navigation.prototype.freezeCurrentPage = function () {
+ var currentPageElement = WinJS.Utilities.getMember("_journal.state.domElement", this);
+ if (!currentPageElement)
+ return;
+ Framework.freezeControlsInSubtree(currentPageElement)
+ };
+ Navigation.prototype.thawCurrentPage = function () {
+ var currentPageElement = WinJS.Utilities.getMember("_journal.state.domElement", this);
+ if (!currentPageElement)
+ return;
+ Framework.thawControlsInSubtree(currentPageElement)
+ };
+ Object.defineProperty(Navigation.prototype, "location", {
+ get: function () {
+ var journal = Navigation.getJournal();
+ return journal && journal.location || String.empty
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "isFirstLocationLoaded", {
+ get: function () {
+ return this._isFirstLocationLoaded
+ }, enumerable: true, configurable: true
+ });
+ Navigation.prototype.setPreviouslyFocusedItem = function (focusedElement, listView, currentItem) {
+ var journal = Navigation.getJournal();
+ var state = journal && journal.state;
+ if (state)
+ state.previouslyFocusedItem = {
+ listView: listView, currentItem: currentItem, focusedElement: focusedElement
+ }
+ };
+ Navigation.prototype.clearPreviouslyFocusedItem = function () {
+ var journal = Navigation.getJournal();
+ var state = journal && journal.state;
+ if (state)
+ state.previouslyFocusedItem = null
+ };
+ Object.defineProperty(Navigation.prototype, "currentlySelectedPivotMoniker", {
+ get: function () {
+ if (!WinJS.Utilities.getMember("_primaryPivots.selectedItem", this))
+ return null;
+ return this._primaryPivots.selectedItem.moniker
+ }, enumerable: true, configurable: true
+ });
+ Navigation.raiseContentComplete = function (element) {
+ var domEvent = document.createEvent("event");
+ domEvent.initEvent("ContentComplete", true, true);
+ element.dispatchEvent(domEvent);
+ var journal = WinJS.Navigation;
+ if (journal && journal.state && journal.state.contentComplete) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceWinJSNavigation_ContentComplete(journal.state.location);
+ journal.state.contentComplete();
+ journal.state.contentComplete = null
+ }
+ };
+ Navigation.getJournal = function () {
+ return Navigation.testJournalInstance || WinJS.Navigation
+ };
+ Navigation.DEFAULT_FOCUS_TIMEOUT = 1000;
+ return Navigation
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Framework.Navigation = Navigation;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.winJSNavigation, function () {
+ return new Navigation
+ })
+ })(Framework = UI.Framework || (UI.Framework = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ var NavigationActions;
+ (function (NavigationActions) {
+ var NavigateToDefaultAction = (function (_super) {
+ __extends(NavigateToDefaultAction, _super);
+ function NavigateToDefaultAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.navigateToDefault
+ }
+ NavigateToDefaultAction.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateToDefaultAction.prototype.executed = function (param) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigation.navigateToDefault()
+ };
+ return NavigateToDefaultAction
+ })(Actions.Action);
+ NavigationActions.NavigateToDefaultAction = NavigateToDefaultAction
+ })(NavigationActions = Actions.NavigationActions || (Actions.NavigationActions = {}));
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.navigateToDefault, function () {
+ return new MS.Entertainment.UI.Actions.NavigationActions.NavigateToDefaultAction
+ })
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/components/shell/appnotification.js:27793 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI");
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {
+ Notification: WinJS.Class.define(function notificationConstructor(options) {
+ var property;
+ for (property in options)
+ this[property] = options[property]
+ }, {
+ notificationType: null, title: "", subTitle: "", subTitleCaret: false, moreDetails: "", icon: null, dismissIcon: MS.Entertainment.UI.Icon.close, category: null, isPersistent: false, iconClassName: "", acknowledged: false, visible: true, attachedNotification: null, dismissOnSignOut: false, hideDefaultRing: false, automationId: null, _action: null, _actionParams: null, _actions: null, _actionParamsArray: null, _actionArray: null, _dismissAction: null, _dismissActionObject: null, _dismissActionParams: null, action: {
+ get: function get_action() {
+ return this._action
+ }, set: function set_action(value) {
+ if (this._action !== value) {
+ this._action = value;
+ this._actionArray = null
+ }
+ }
+ }, actions: {
+ get: function get_actions() {
+ return this._actions
+ }, set: function set_actions(value) {
+ if (this._actions !== value) {
+ this._actions = value;
+ this._actionArray = null
+ }
+ }
+ }, actionParams: {
+ get: function get_actionParams() {
+ return this._actionParams
+ }, set: function set_actionParams(value) {
+ this._actionParams = value;
+ if (this._actionArray && this._actionArray.item(0))
+ this._actionArray.item(0) = value
+ }
+ }, actionParamsArray: {
+ get: function get_actionParamsArray() {
+ return this._actionParamsArray
+ }, set: function set_actionParamsArray(value) {
+ this._actionParamsArray = value;
+ if (this._actionArray && this._actionParamsArray)
+ for (var i = 0; i < this._actionParamsArray.length; i++)
+ if (this._actionParamsArray[i])
+ WinJS.UI.setOptions(this._actionArray.item(i), this._actionParamsArray[i])
+ }
+ }, bindableActionArray: {
+ get: function get_bindableActionArray() {
+ return this.actionArray && this.actionArray.bindableItems
+ }
+ }, actionArray: {
+ get: function get_actionArray() {
+ if (this._actionArray)
+ return this._actionArray;
+ var actions = null;
+ if (this._actions)
+ actions = this._actions;
+ else
+ actions = this._convertToArray(this._action);
+ this._actionArray = new MS.Entertainment.ObservableArray;
+ for (var i = 0; i < actions.length; i++)
+ if (actions[i] && typeof actions[i] === "string") {
+ this._actionArray.push(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(actions[i]));
+ if (this._actionArray.item(i))
+ if (this._actionParamsArray && this._actionParamsArray[i])
+ WinJS.UI.setOptions(this._actionArray.item(i), this._actionParamsArray[i]);
+ else if (this._actionParams)
+ WinJS.UI.setOptions(this._actionArray.item(i), this._actionParams)
+ }
+ return this._actionArray
+ }, set: function set_actionArray(value) {
+ this._actionArray = value
+ }
+ }, dismissAction: {
+ get: function get_action() {
+ return this._dismissAction
+ }, set: function set_action(value) {
+ if (this._dismissAction !== value) {
+ this._dismissAction = value;
+ this._dismissActionObject = null
+ }
+ }
+ }, dismissActionParams: {
+ get: function get_dismissActionParamss() {
+ return this._dismissActionParams
+ }, set: function set_dismissActionParams(value) {
+ this._dismissActionParams = value;
+ if (this._dismissActionObject)
+ this._dismissActionObject.parameter = value
+ }
+ }, dismissActionObject: {
+ get: function get_dismissActionObject() {
+ if (!this._dismissActionObject && this.dismissAction)
+ this._dismissActionObject = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(this.dismissAction);
+ if (this._dismissActionObject)
+ this._dismissActionObject.parameter = this.dismissActionParams;
+ return this._dismissActionObject
+ }
+ }, toJSON: function toJSON() {
+ var resultObject = {};
+ for (var key in this)
+ if (key && key[0] !== "_" && key !== "toJSON" && key !== "actionArray" && key !== "bindableActionArray" && key !== "dismissActionObject")
+ resultObject[key] = this[key];
+ return resultObject
+ }, _convertToArray: function _convertToArray(item) {
+ var array = [];
+ if (!Array.isArray(item) && item)
+ array = [item];
+ return array
+ }
+ }, {
+ Type: {
+ Informational: "Informational", Critical: "Critical"
+ }
+ }), AppNotificationService: MS.Entertainment.defineObservable(function AppNotificationServiceConstructor() {
+ MS.Entertainment.UI.AppNotificationService._instanceCount++;
+ MS.Entertainment.Utilities.assert(MS.Entertainment.UI.AppNotificationService._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification)");
+ this.infoNotifications = new MS.Entertainment.ObservableArray;
+ this.criticalNotifications = new MS.Entertainment.ObservableArray;
+ this._dismissOnSignOutCategories = [];
+ var waitPromise = WinJS.Promise.as();
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn))
+ waitPromise = WinJS.Promise.timeout(4000);
+ waitPromise.then(function () {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).bind("isSignedIn", this._onSignInChange.bind(this))
+ }.bind(this))
+ }, {
+ _dismissOnSignOutCategories: null, infoNotifications: null, _infoNotificationContainer: null, criticalNotifications: null, _criticalNotificationContainer: null, _filterNotification: function _filterNotification(notification) {
+ return MS.Entertainment.Utilities.isApp2 && (notification.notificationType === MS.Entertainment.UI.Notification.Type.Informational)
+ }, send: function send(notification) {
+ if (!notification || this._filterNotification(notification))
+ return;
+ if (!notification.isPersistent)
+ MS.Entertainment.UI.assert(notification.notificationType === MS.Entertainment.UI.Notification.Type.Informational, "Non-persistent notifications must be informational only");
+ if (!notification.category) {
+ MS.Entertainment.UI.assert(!notification.isPersistent, "Expected a category on persistent notifications.");
+ MS.Entertainment.UI.assert(!notification.dismissOnSignOut, "Expected a category on dismiss-on-signout notifications.")
+ }
+ else if (notification.dismissOnSignOut && this._dismissOnSignOutCategories.indexOf(notification.category) < 0)
+ this._dismissOnSignOutCategories.push(notification.category);
+ notification = WinJS.Binding.as(notification);
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceNotification_NotificationArrived(notification.title);
+ switch (notification.notificationType) {
+ case MS.Entertainment.UI.Notification.Type.Informational:
+ var existingIndex = this._indexOfNotification(this.infoNotifications, notification.category);
+ if (existingIndex >= 0)
+ if (!notification.isPersistent) {
+ this.infoNotifications.splice(existingIndex, 1);
+ this.infoNotifications.push(notification)
+ }
+ else {
+ this.infoNotifications.item(existingIndex).title = notification.title;
+ this.infoNotifications.item(existingIndex).subTitle = notification.subTitle
+ }
+ else
+ this.infoNotifications.push(notification);
+ break;
+ case MS.Entertainment.UI.Notification.Type.Critical:
+ var existingIndex = this._indexOfNotification(this.criticalNotifications, notification.category);
+ if (existingIndex < 0)
+ this.criticalNotifications.push(notification);
+ break
+ }
+ }, removeNotificationByCategory: function removeNotificationByCategory(category) {
+ var index = this._indexOfNotification(this.criticalNotifications, category);
+ if (index >= 0)
+ this.criticalNotifications.splice(index, 1);
+ index = this._indexOfNotification(this.infoNotifications, category);
+ if (index >= 0)
+ this.infoNotifications.splice(index, 1)
+ }, _indexOfNotification: function _indexOfNotification(queue, category) {
+ if (category)
+ for (var index = 0; index < queue.length; index++) {
+ var notification = queue.item(index);
+ if (notification.category === category)
+ return index
+ }
+ return -1
+ }, _onSignInChange: function _onSignInChange(isSignedIn) {
+ if (!isSignedIn) {
+ for (var i = 0; i < this._dismissOnSignOutCategories.length; i++)
+ this.removeNotificationByCategory(this._dismissOnSignOutCategories[i]);
+ this._dismissOnSignOutCategories = []
+ }
+ }
+ }, {
+ factory: function factory() {
+ var appNotificationService = new MS.Entertainment.UI.AppNotificationService;
+ Object.defineProperty(appNotificationService, "infoNotificationContainer", {
+ get: function () {
+ if (!this._infoNotificationContainer)
+ this._infoNotificationContainer = document.querySelector(".infoNotificationContainer");
+ return this._infoNotificationContainer
+ }
+ });
+ Object.defineProperty(appNotificationService, "criticalNotificationContainer", {
+ get: function () {
+ if (!this._criticalNotificationContainer)
+ this._criticalNotificationContainer = document.querySelector(".criticalNotificationContainer");
+ return this._criticalNotificationContainer
+ }
+ });
+ return appNotificationService
+ }, _instanceCount: 0
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.appNotification, MS.Entertainment.UI.AppNotificationService.factory);
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ InfoNotification: MS.Entertainment.UI.Framework.defineUserControl("/Components/Shell/appNotification.html#infoNotificationTemplate", function infoNotification(element, options) { }, {
+ _appNotificationService: null, _navigation: null, _timer: null, _notificationItemTemplate: null, _uiSettings: new Windows.UI.ViewManagement.UISettings, _initialized: false, _selfEventHandlers: null, _webUIApplicationEventHandlers: null, _navigationBindings: null, itemTemplate: "/Components/Shell/appNotification.html#infoNotificationItemTemplate", notificationDataSourcePropertyName: "infoNotifications", initialize: function initialize() { }, delayedInitialize: function delayedInitialize() {
+ return MS.Entertainment.UI.Framework.loadTemplate(this.itemTemplate).then(function (templateProvider) {
+ this._notificationItemTemplate = templateProvider.element;
+ this._appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ this._onPropertyChange = this._onPropertyChange.bind(this);
+ this._onDataSourceChanged = this._onDataSourceChanged.bind(this);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ this._navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._navigationBindings = WinJS.Binding.bind(this._navigation, { currentPage: this._onPropertyChange })
+ }
+ this._selfEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this.domElement, { keydown: this.onKeyDown.bind(this) });
+ this.notificationContainer.itemTemplate = this._notificationItemTemplate;
+ this._appNotificationService[this.notificationDataSourcePropertyName].addChangeListener(this._onDataSourceChanged);
+ this._initialized = true;
+ this.notificationContainer.dataSource = this._appNotificationService[this.notificationDataSourcePropertyName]
+ }.bind(this))
+ }, onKeyDown: function onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onItemClick(event)
+ }, _playTransitionAnimation: function _playTransitionAnimation(element) {
+ var incomingPageMove = {
+ left: "60px", top: "0px"
+ };
+ element.style.left = "0px";
+ element.style.top = "0px";
+ element.style.opacity = 0.0;
+ return WinJS.UI.Animation.enterContent(element, [incomingPageMove], { mechanism: "transition" })
+ }, _onTimerHandler: function _onTimerHandler() {
+ if (this._appNotificationService[this.notificationDataSourcePropertyName].length === 1) {
+ var item = this._appNotificationService.infoNotifications.item(0);
+ if (item.isPersistent) {
+ this._resetTimer();
+ return
+ }
+ }
+ var elements = this.notificationContainer.domElement.querySelectorAll(".win-template");
+ var currentElement = elements[0];
+ var nextElement = elements[1];
+ if (currentElement)
+ WinJS.UI.Animation.fadeOut(currentElement).done(function () {
+ var item = this._appNotificationService.infoNotifications.shift();
+ if (item && item.isPersistent)
+ this._appNotificationService[this.notificationDataSourcePropertyName].push(item);
+ if (nextElement)
+ this._playTransitionAnimation(nextElement)
+ }.bind(this));
+ if (this._appNotificationService.infoNotifications.length > 0)
+ this._resetTimer();
+ else {
+ window.clearTimeout(this._timer);
+ this._timer = null
+ }
+ }, _resetTimer: function _restartTimer() {
+ window.clearTimeout(this._timer);
+ var notificationTimeoutMs = this._uiSettings.messageDuration * 1000;
+ this._timer = window.setTimeout(function () {
+ this._onTimerHandler()
+ }.bind(this), notificationTimeoutMs)
+ }, _shouldHideNotifications: function _shouldHideNotifications() {
+ var notificationVisibility = ((this._appNotificationService[this.notificationDataSourcePropertyName].length > 0) && this._initialized);
+ if (this._navigation && this._navigation.currentPage)
+ notificationVisibility = notificationVisibility && this._navigation.currentPage.showNotifications;
+ return !notificationVisibility
+ }, _onDataSourceChanged: function _onDataSourceChanged() {
+ this.hideNotifications = this._shouldHideNotifications();
+ if (!this.hideNotifications)
+ if (this.notificationDataSourcePropertyName === "infoNotifications")
+ if (!this._timer)
+ this._resetTimer();
+ this._updateLiveRegionContainer()
+ }, _updateLiveRegionContainer: function _updateLiveRegionContainer() {
+ WinJS.Promise.timeout(300).then(function () {
+ var items = this.notificationContainer.domElement.querySelectorAll(".notificationContent");
+ if (items && items[0] && this._liveRegionContainer && this._buttonContainer) {
+ this._buttonContainer.removeChild(this._liveRegionContainer);
+ this._liveRegionContainer = document.createElement("div");
+ WinJS.Utilities.addClass(this._liveRegionContainer, "removeFromDisplay");
+ this._liveRegionContainer.setAttribute("role", "tooltip");
+ this._liveRegionContainer.setAttribute("aria-live", "polite");
+ this._buttonContainer.appendChild(this._liveRegionContainer);
+ this._liveRegionContainer.setAttribute("aria-label", items[0].textContent)
+ }
+ }.bind(this))
+ }, unload: function unload() {
+ if (this._selfEventHandlers) {
+ this._selfEventHandlers.cancel();
+ this._selfEventHandlers = null
+ }
+ if (this._appNotificationService && this._appNotificationService.infoNotifications)
+ this._appNotificationService.infoNotifications.removeChangeListener(this._onDataSourceChanged);
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, onItemClick: function onItemClick(event) {
+ if (this._appNotificationService.infoNotifications.length <= 0)
+ return;
+ var currentItem = this._appNotificationService.infoNotifications.item(0);
+ if (currentItem && currentItem.action) {
+ if (currentItem.action.execute)
+ currentItem.action.execute();
+ else if (typeof currentItem.action === "function")
+ currentItem.action();
+ return
+ }
+ }, _onPropertyChange: function _onPropertyChange() {
+ if (this._appNotificationService[this.notificationDataSourcePropertyName]) {
+ var dataSource = this._appNotificationService[this.notificationDataSourcePropertyName];
+ if (dataSource !== this.notificationContainer.dataSource)
+ this.notificationContainer.dataSource = this._appNotificationService[this.notificationDataSourcePropertyName]
+ }
+ this.hideNotifications = this._shouldHideNotifications();
+ if (!this.hideNotifications)
+ if (this.notificationDataSourcePropertyName === "infoNotifications")
+ if (!this._timer)
+ this._resetTimer()
+ }
+ }, { hideNotifications: true })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ CriticalNotification: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.InfoNotification", "/Components/Shell/appNotification.html#criticalNotificationTemplate", function criticalNotification(element, options) { }, {
+ itemTemplate: "/Components/Shell/appNotification.html#criticalNotificationItemTemplate", notificationDataSourcePropertyName: "criticalNotifications", _criticalSelfEventHandlers: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.InfoNotification.prototype.initialize.call(this)
+ }, unload: function unload() {
+ MS.Entertainment.UI.Controls.InfoNotification.prototype.unload.call(this);
+ if (this._criticalSelfEventHandlers) {
+ this.this._criticalSelfEventHandlers.cancel();
+ this.this._criticalSelfEventHandlers = null
+ }
+ }, onItemClick: function onItemClick(event) {
+ var currentItem = this._appNotificationService.criticalNotifications.item(0);
+ var item = this._appNotificationService.criticalNotifications.shift();
+ if (item && item.action) {
+ item.action();
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceNotification_NotificationClicked(item.title)
+ }
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/components/shell/listnotification.js:28130 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var ListNotification = (function () {
+ function ListNotification() { }
+ ListNotification.createNotification = function (category, messageText, detailsText, actionIds, actionOptionsArray, hidden, automationId, isDissmissable) {
+ var notification = new UI.Notification;
+ notification.category = category;
+ notification.icon = category.icon;
+ notification.title = messageText;
+ notification.subTitle = detailsText;
+ notification.actions = actionIds;
+ notification.actionParamsArray = actionOptionsArray;
+ notification.visible = !hidden;
+ notification.automationId = automationId;
+ if (isDissmissable) {
+ notification.dismissAction = UI.Actions.ActionIdentifiers.notificationClear;
+ notification.dismissActionParams = { category: category }
+ }
+ else
+ notification.dismissAction = null;
+ return notification
+ };
+ return ListNotification
+ })();
+ UI.ListNotification = ListNotification;
+ var NotificationCategory = (function () {
+ function NotificationCategory(priority, name, icon, firstTimeOnly, completed, visible) {
+ this.priority = priority;
+ this.name = name;
+ this.icon = icon;
+ this.firstTimeOnly = firstTimeOnly;
+ this.completed = completed;
+ this.visible = visible
+ }
+ return NotificationCategory
+ })();
+ UI.NotificationCategory = NotificationCategory;
+ (function (NotificationCategoryNames) {
+ NotificationCategoryNames[NotificationCategoryNames["userEngagementContent"] = 0] = "userEngagementContent";
+ NotificationCategoryNames[NotificationCategoryNames["networkStatus"] = 1] = "networkStatus";
+ NotificationCategoryNames[NotificationCategoryNames["localContent"] = 2] = "localContent";
+ NotificationCategoryNames[NotificationCategoryNames["partialContent"] = 3] = "partialContent";
+ NotificationCategoryNames[NotificationCategoryNames["cloudContent"] = 4] = "cloudContent";
+ NotificationCategoryNames[NotificationCategoryNames["cloudContentV2"] = 5] = "cloudContentV2";
+ NotificationCategoryNames[NotificationCategoryNames["explicitPrivileges"] = 6] = "explicitPrivileges";
+ NotificationCategoryNames[NotificationCategoryNames["playbackPrivileges"] = 7] = "playbackPrivileges";
+ NotificationCategoryNames[NotificationCategoryNames["playlistUpsell"] = 8] = "playlistUpsell"
+ })(UI.NotificationCategoryNames || (UI.NotificationCategoryNames = {}));
+ var NotificationCategoryNames = UI.NotificationCategoryNames;
+ var NotificationCategoryEnum = (function () {
+ function NotificationCategoryEnum() { }
+ NotificationCategoryEnum.isCollectionCategory = function (category) {
+ return category && (category.name === UI.NotificationCategoryNames[4] || category.name === UI.NotificationCategoryNames[5] || category.name === UI.NotificationCategoryNames[2] || category.name === UI.NotificationCategoryNames[1] || category.name === UI.NotificationCategoryNames[3] || category.name === UI.NotificationCategoryNames[0])
+ };
+ NotificationCategoryEnum.isCloudStorageCategory = function (category) {
+ return false
+ };
+ NotificationCategoryEnum.userEngagementContent = new NotificationCategory(0, NotificationCategoryNames[0], UI.Icon.notification, false);
+ NotificationCategoryEnum.networkStatus = new NotificationCategory(1, NotificationCategoryNames[1], UI.Icon.inlineStreaming, true);
+ NotificationCategoryEnum.localContent = new NotificationCategory(2, NotificationCategoryNames[2], UI.Icon.inlineNotification, true);
+ NotificationCategoryEnum.partialContent = new NotificationCategory(3, NotificationCategoryNames[3], UI.Icon.notification, false);
+ NotificationCategoryEnum.cloudContent = new NotificationCategory(4, NotificationCategoryNames[4], UI.Icon.devices, true);
+ NotificationCategoryEnum.explicitPrivileges = new NotificationCategory(6, NotificationCategoryNames[6], UI.Icon.notification, true);
+ NotificationCategoryEnum.playbackPrivileges = new NotificationCategory(6, NotificationCategoryNames[7], UI.Icon.notification, false);
+ NotificationCategoryEnum.cloudContentV2 = new NotificationCategory(5, NotificationCategoryNames[5], UI.Icon.oneDrive, true);
+ NotificationCategoryEnum.playlistUpsell = new NotificationCategory(8, NotificationCategoryNames[8], UI.Icon.notification, false);
+ return NotificationCategoryEnum
+ })();
+ UI.NotificationCategoryEnum = NotificationCategoryEnum;
+ var ListNotificationService = (function (_super) {
+ __extends(ListNotificationService, _super);
+ function ListNotificationService() {
+ _super.call(this);
+ this._notificationVersionExpected = 2;
+ ListNotificationService._instanceCount++;
+ MS.Entertainment.UI.assert(ListNotificationService._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.listNotification);");
+ this._loadStoredNotifications()
+ }
+ Object.defineProperty(ListNotificationService.prototype, "notifications", {
+ get: function () {
+ var availableNotifications = this._notifications.filter(function (item) {
+ return !item.acknowledged && item.visible
+ });
+ if (ListNotificationService._notificationFilter)
+ availableNotifications = availableNotifications.filter(ListNotificationService._notificationFilter);
+ return availableNotifications
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ListNotificationService.prototype, "localAppSettings", {
+ get: function () {
+ var storedData = null;
+ if (Entertainment.Utilities.isApp1)
+ try {
+ storedData = Windows.Storage.ApplicationData.current.localSettings.values[ListNotificationService._localStorageKey]
+ }
+ catch (e) {
+ MS.Entertainment.fail("Failed to read from local app settings for the list notification service with the following error: " + e.toString())
+ }
+ return storedData
+ }, set: function (value) {
+ if (Entertainment.Utilities.isApp1)
+ try {
+ Windows.Storage.ApplicationData.current.localSettings.values[ListNotificationService._localStorageKey] = value
+ }
+ catch (e) {
+ MS.Entertainment.fail("Failed to write to local app settings for the list notification service with the following error: " + e.toString())
+ }
+ }, enumerable: true, configurable: true
+ });
+ ListNotificationService.applyCustonNotificationFilter = function (value) {
+ ListNotificationService._notificationFilter = value;
+ return {
+ cancel: function () {
+ ListNotificationService._notificationFilter = null
+ }
+ }
+ };
+ ListNotificationService.prototype.createAndSend = function (category, messageText, detailsText, actionIds, actionParamsArray, completeCategory, hidden, automationId, dismissable) {
+ var notification = ListNotification.createNotification(category, messageText, detailsText, actionIds, actionParamsArray, hidden, automationId, dismissable !== false);
+ this.send(notification);
+ if (completeCategory)
+ notification.category.completed = true;
+ return notification
+ };
+ ListNotificationService.prototype.send = function (notification) {
+ MS.Entertainment.UI.assert(notification, "Null notification sent to the list notification service.");
+ var index = this.indexOfNotificationByCategory(notification.category);
+ if (index >= 0) {
+ if (this._notifications[index].category.completed)
+ return;
+ if (notification.category.firstTimeOnly && this._notifications[index].acknowledged)
+ return;
+ Entertainment.Utilities.Telemetry.logNotification(notification);
+ this._notifications[index] = notification;
+ this._notifications[index].acknowledged = false;
+ this.storeNotifications();
+ this.dispatchEvent(ListNotificationService.sendNotificationReceived, notification)
+ }
+ else {
+ Entertainment.Utilities.Telemetry.logNotification(notification, true);
+ this._notifications.push(notification);
+ this.storeNotifications();
+ this.dispatchEvent(ListNotificationService.sendNotificationReceived, notification)
+ }
+ };
+ ListNotificationService.prototype.clear = function (category, removeFromList) {
+ MS.Entertainment.UI.assert(category, "Cannot clear list notifications without category.");
+ var index = this.indexOfNotificationByCategory(category);
+ if (index >= 0) {
+ if (removeFromList)
+ this._notifications.splice(index, 1);
+ else
+ this._notifications[index].acknowledged = true;
+ this.storeNotifications();
+ this.dispatchEvent(ListNotificationService.clearNotificationReceived, category)
+ }
+ };
+ ListNotificationService.prototype.reset = function () {
+ this._notifications = [];
+ this.localAppSettings = []
+ };
+ ListNotificationService.prototype.getNotificationByCategory = function (category) {
+ var matches = this._notifications.filter(function (item) {
+ return item.category.name === category.name
+ });
+ return matches && matches.length > 0 ? matches[0] : null
+ };
+ ListNotificationService.prototype.indexOfNotificationByCategory = function (category) {
+ var notification = this.getNotificationByCategory(category);
+ return notification ? this._notifications.indexOf(notification) : -1
+ };
+ ListNotificationService.prototype.storeNotifications = function () {
+ this._notifications.sort(function (notification1, notification2) {
+ var notification1Pri = notification1 && notification1.category && notification1.category.priority ? notification1.category.priority : -1;
+ var notification2Pri = notification2 && notification2.category && notification2.category.priority ? notification2.category.priority : -1;
+ if (notification1Pri === notification2Pri)
+ return 0;
+ else if (notification1Pri > notification2Pri)
+ return 1;
+ else
+ return -1
+ });
+ var notificationsToSave = this._notifications.filter(function (item) {
+ return item.category.firstTimeOnly === true
+ });
+ try {
+ this.localAppSettings = JSON.stringify(notificationsToSave)
+ }
+ catch (error) {
+ MS.Entertainment.fail("Failed to stringify notifications to local storage with the following error: " + (error && error.message))
+ }
+ };
+ ListNotificationService.prototype._upgrade = function () {
+ var _this = this;
+ if (this._notifications) {
+ var notificationstoClear = this._notifications.filter(function (notification) {
+ return (!(notification.category.firstTimeOnly && notification.acknowledged) || !notification.category.completed)
+ });
+ notificationstoClear.forEach(function (notification) {
+ _this.clear(notification.category, true)
+ })
+ }
+ };
+ ListNotificationService.prototype._loadStoredNotifications = function () {
+ var _this = this;
+ var storedNotifications = this.localAppSettings;
+ if (storedNotifications)
+ try {
+ this._notifications = JSON.parse(storedNotifications)
+ }
+ catch (e) {
+ MS.Entertainment.fail("Failed to load notifications from local storage with the following error: " + e.toString())
+ }
+ if (!this._notifications || !Array.isArray(this._notifications))
+ this._notifications = [];
+ this._notifications = this._notifications.map(function (notification) {
+ return new UI.Notification(notification)
+ });
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var currentNotificationVersion = configurationManager.shell.notificationVersion || 0;
+ if (currentNotificationVersion < this._notificationVersionExpected) {
+ this._upgrade();
+ WinJS.Promise.timeout(30000).done(function () {
+ try {
+ configurationManager.shell.notificationVersion = _this._notificationVersionExpected
+ }
+ catch (error) {
+ UI.fail("ListNotification::_loadStoredNotifications. A failure occurred when trying to write the upgraded notification version back to the config store. Error message: " + (error && error.message), String.empty, UI.Debug.errorLevel.low)
+ }
+ }, function (timeOutFailure) {
+ UI.fail("ListNotification::_loadStoredNotifications. A failure occurred in the wait timeout for setting the notification version. Error message: " + (timeOutFailure && timeOutFailure.message), String.empty, UI.Debug.errorLevel.low)
+ })
+ }
+ };
+ ListNotificationService.factory = function () {
+ return new ListNotificationService
+ };
+ ListNotificationService._instanceCount = 0;
+ ListNotificationService._localStorageKey = "MusicNotifications";
+ ListNotificationService._notificationFilter = null;
+ ListNotificationService.sendNotificationReceived = "sendNotificationReceived";
+ ListNotificationService.clearNotificationReceived = "clearNotificationReceived";
+ return ListNotificationService
+ })(UI.Framework.ObservableBase);
+ UI.ListNotificationService = ListNotificationService;
+ var ObservableListNotificationAdapter = (function (_super) {
+ __extends(ObservableListNotificationAdapter, _super);
+ function ObservableListNotificationAdapter(filterAllGlobalNotifications, filterCallback) {
+ _super.call(this);
+ this._applyGlobalNotifications = !filterAllGlobalNotifications;
+ this._filterCallback = filterCallback;
+ this._initializeNotificationList()
+ }
+ ObservableListNotificationAdapter.prototype.dispose = function () {
+ this._isDisposed = true;
+ this._releaseGlobalNotifications();
+ this._filterCallback = null
+ };
+ Object.defineProperty(ObservableListNotificationAdapter.prototype, "dataSource", {
+ get: function () {
+ return this._dataSource
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ObservableListNotificationAdapter.prototype, "filterCallback", {
+ get: function () {
+ return this._filterCallback
+ }, set: function (value) {
+ if (!this._isDisposed)
+ this._filterCallback = value
+ }, enumerable: true, configurable: true
+ });
+ ObservableListNotificationAdapter.prototype.isEqual = function (adapter) {
+ var isEqual = this === adapter;
+ if (!isEqual && adapter)
+ isEqual = (!this.dataSource || this.dataSource.length === 0) && (!adapter.dataSource || adapter.dataSource.length === 0);
+ if (!isEqual && adapter && adapter.dataSource && this.dataSource && adapter.dataSource.length === this.dataSource.length) {
+ var thisItems = {};
+ var itemKey = null;
+ var item = null;
+ for (var i = 0; i < this.dataSource.length; i++) {
+ item = this.dataSource.item(i);
+ try {
+ itemKey = JSON.stringify(item, this._stringifyReplacer.bind(this))
+ }
+ catch (error) {
+ UI.fail("Failed to stringify this data. error: " + (error && error.message));
+ thisItems = null;
+ break
+ }
+ thisItems[itemKey] = thisItems[itemKey] ? thisItems[itemKey] + 1 : 1
+ }
+ if (thisItems) {
+ isEqual = true;
+ for (var j = 0; j < adapter.dataSource.length; j++) {
+ item = adapter.dataSource.item(j);
+ try {
+ itemKey = JSON.stringify(item, this._stringifyReplacer.bind(this))
+ }
+ catch (error) {
+ UI.fail("Failed to stringify adapter data. error: " + (error && error.message));
+ isEqual = false;
+ break
+ }
+ if (thisItems[itemKey] > 0)
+ thisItems[itemKey] = thisItems[itemKey] - 1;
+ else
+ isEqual = false
+ }
+ }
+ }
+ return isEqual
+ };
+ ObservableListNotificationAdapter.prototype.append = function (items) {
+ if (this.dataSource)
+ this.dataSource.spliceArray(this.dataSource.length, 0, items)
+ };
+ ObservableListNotificationAdapter.prototype._filterNotifications = function (notification) {
+ var result = false;
+ if (this.filterCallback)
+ result = this.filterCallback(notification);
+ return result
+ };
+ ObservableListNotificationAdapter.prototype._stringifyReplacer = function (key, value) {
+ if (key === "actionParams")
+ return String.empty;
+ else
+ return value
+ };
+ ObservableListNotificationAdapter.prototype._releaseGlobalNotifications = function () {
+ if (this._notificationServiceHandlers) {
+ this._notificationServiceHandlers.cancel();
+ this._notificationServiceHandlers = null
+ }
+ };
+ ObservableListNotificationAdapter.prototype._initializeNotificationList = function () {
+ var globalNotifications = null;
+ var result = null;
+ var listNotificationService;
+ this._releaseGlobalNotifications();
+ if (this._applyGlobalNotifications && Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.listNotification))
+ listNotificationService = Entertainment.ServiceLocator.getService(Entertainment.Services.listNotification);
+ if (listNotificationService) {
+ globalNotifications = new Entertainment.ObservableArray(listNotificationService.notifications.filter(this._filterNotifications.bind(this)));
+ this._notificationServiceHandlers = Entertainment.Utilities.addEventHandlers(listNotificationService, {
+ clearNotificationReceived: this._onClearNotification.bind(this), sendNotificationReceived: this._onSendNotification.bind(this)
+ })
+ }
+ this._setDataSource(globalNotifications)
+ };
+ ObservableListNotificationAdapter.prototype._setDataSource = function (value) {
+ this.updateAndNotify("dataSource", value || new Entertainment.ObservableArray)
+ };
+ ObservableListNotificationAdapter.prototype._onSendNotification = function (args) {
+ if (args && args.detail && this.dataSource && this._filterNotifications(args.detail))
+ this.dataSource.push(args.detail)
+ };
+ ObservableListNotificationAdapter.prototype._onClearNotification = function (args) {
+ var removeIndex = -1;
+ if (args && args.detail && this.dataSource)
+ this.dataSource.some(function (notification, index, items) {
+ if (notification && notification.category && args.detail && notification.category.name === args.detail.name) {
+ removeIndex = index;
+ return true
+ }
+ else
+ return false
+ });
+ if (removeIndex >= 0)
+ this.dataSource.splice(removeIndex, 1)
+ };
+ return ObservableListNotificationAdapter
+ })(UI.Framework.ObservableBase);
+ UI.ObservableListNotificationAdapter = ObservableListNotificationAdapter
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.listNotification, MS.Entertainment.UI.ListNotificationService.factory)
+})();
+/* >>>>>>/components/shell/dragdataservice.js:28523 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Components;
+ (function (Components) {
+ var Shell;
+ (function (Shell) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Components.Shell");
+ var DragDataService = (function () {
+ function DragDataService() {
+ var _this = this;
+ this._draggedItem = null;
+ this._draggedItemPromise = null;
+ this._documentDragEndHandler = null;
+ this._documentDragEndHandler = MS.Entertainment.Utilities.addEventHandlers(document.body, {
+ dragend: function () {
+ if (_this._hasDragData) {
+ Shell.fail("DragDataService::onDragEndEvent: Drag data needs to be cleaned up by the component that called DragDataService::startDrag.");
+ _this.finishDrag()
+ }
+ }
+ })
+ }
+ Object.defineProperty(DragDataService.prototype, "_hasDragData", {
+ get: function () {
+ return !!(this.draggedItem || this.draggedItemPromise)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DragDataService.prototype, "draggedItem", {
+ get: function () {
+ return this._draggedItem
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DragDataService.prototype, "draggedItemPromise", {
+ get: function () {
+ return this._draggedItemPromise
+ }, enumerable: true, configurable: true
+ });
+ DragDataService.prototype.startDrag = function (draggedItemPromise) {
+ var _this = this;
+ Shell.assert(!this._hasDragData, "DragDataService::draggedItemPromise: Attempted to set a new drag context without clearing existing context.");
+ Shell.assert(draggedItemPromise, "DragDataService::draggedItemPromise: Attempted to start a drag operation without valid drag data.");
+ this._draggedItemPromise = draggedItemPromise && draggedItemPromise.then(function (item) {
+ Shell.assert(item && item.data, "DragDataService::draggedItemPromise: Expected to get item from dragged item promise.");
+ _this._draggedItem = item;
+ return _this._draggedItem
+ }, function (error) {
+ Shell.fail("DragDataService::draggedItemPromise: Failed to get item from promise: " + (error && error.message));
+ _this._draggedItem = null;
+ return WinJS.Promise.wrapError(error)
+ })
+ };
+ DragDataService.prototype.finishDrag = function () {
+ if (this._draggedItemPromise) {
+ this._draggedItemPromise.cancel();
+ this._draggedItemPromise = null
+ }
+ this._draggedItem = null;
+ var dragCompleteEvent = document.createEvent("Event");
+ dragCompleteEvent.initEvent(DragDataService.dragCompleteEvent, true, false);
+ document.body.dispatchEvent(dragCompleteEvent)
+ };
+ DragDataService.dragCompleteEvent = "dragComplete";
+ return DragDataService
+ })();
+ Shell.DragDataService = DragDataService;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.dragData, function () {
+ return new DragDataService
+ })
+ })(Shell = Components.Shell || (Components.Shell = {}))
+ })(Components = UI.Components || (UI.Components = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/components/signin/signinerrors.js:28602 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ WinJS.Namespace.define("MS.Entertainment.Utilities.SignInErrors", {
+ NS_E_WMPIM_USEROFFLINE: 0xC00D1126 - 0xFFFFFFFF - 1, NS_E_SIGNIN_TAG_CHANGE_REQUIRED: 0xC00D1375 - 0xFFFFFFFF - 1, ZEST_E_TOS_NOT_ACCEPTED: 0xC101A21B - 0xFFFFFFFF - 1, ZUNE_E_SIGNIN_TERMS_OF_SERVICE_CHILD: 0xC1010017 - 0xFFFFFFFF - 1, NS_E_SIGNIN_TERMS_OF_SERVICE: 0xC00D1376 - 0xFFFFFFFF - 1, NS_E_SIGNIN_ACCOUNT_SUSPENDED: 0xC00D1377 - 0xFFFFFFFF - 1, NS_E_SIGNIN_SUBSCRIPTION_SUSPENDED: 0xC00D1378 - 0xFFFFFFFF - 1, NS_E_SIGNIN_BILLING_UNAVAILABLE: 0xC00D1379 - 0xFFFFFFFF - 1, NS_E_SIGNIN_PASSPORT_UNKNOWN_ERROR: 0xC00D1389 - 0xFFFFFFFF - 1, NS_E_SIGNIN_NOT_SUPPORTED_REGION: 0xC00D1388 - 0xFFFFFFFF - 1, NS_E_SIGNIN_INVALID_REGION: 0xC00D1353 - 0xFFFFFFFF - 1, NS_E_SIGNIN_VERSION_NOT_SUPPORTED: 0xC00D1390 - 0xFFFFFFFF - 1, NS_E_SIGNIN_CHILD_ACCOUNT_CREATION_BLOCKED: 0xC00D1394 - 0xFFFFFFFF - 1, NS_E_SIGNIN_REGION_MISMATCH_ERROR: 0xC00D1398 - 0xFFFFFFFF - 1, XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED: 0x80172008 - 0xFFFFFFFF - 1, NO_CONNECTED_ACCOUNT: 0x80070525 - 0xFFFFFFFF - 1, NS_E_INVALID_USERNAME_AND_PASSWORD: 0x8007052e - 0xFFFFFFFF - 1, ZUNE_E_SIGNIN_ERROR_CANCELLED: 0x800704C7 - 0xFFFFFFFF - 1, ERROR_NETWORK_UNREACHABLE: 0x800704CF - 0xFFFFFFFF - 1, NS_E_NO_ACCOUNT_PROOF: 0x800434ed - 0xFFFFFFFF - 1, NS_E_ACCOUNT_PROOF_NOT_VERIFIED: 0x800434ef - 0xFFFFFFFF - 1, INET_E_RESOURCE_NOT_FOUND: 0x800C0005 - 0xFFFFFFFF - 1, INET_E_DOWNLOAD_FAILURE: 0x800c0008 - 0xFFFFFFFF - 1, INET_E_CONNECTION_TIMEOUT: 0x800c000b - 0xFFFFFFFF - 1, HTTP_E_STATUS_DENIED: 0x80190191 - 0xFFFFFFFF - 1, ONL_E_ACCESS_DENIED_BY_TOU: 0x80860002 - 0xFFFFFFFF - 1, ONL_E_PASSWORD_UPDATE_REQUIRED: 0x80860004 - 0xFFFFFFFF - 1, ONL_E_ACCOUNT_UPDATE_REQUIRED: 0x80860005 - 0xFFFFFFFF - 1, ONL_E_FORCESIGNIN: 0x80860006 - 0xFFFFFFFF - 1, ONL_E_PARENTAL_CONSENT_REQUIRED: 0x80860008 - 0xFFFFFFFF - 1, ONL_E_EMAIL_VERIFICATION_REQUIRED: 0x80860009 - 0xFFFFFFFF - 1, ONL_E_ACTION_REQUIRED: 0x8086000C - 0xFFFFFFFF - 1, XBL_SERVER_CONNECTION_FAILURE: 0x82bc0008 - 0xFFFFFFFF - 1, XO_E_ACCOUNT_CREATION_REQUIRED: 0x8015DC09 - 0xFFFFFFFF - 1, XO_E_ACCOUNT_TERMS_OF_USE_NOT_ACCEPTED: 0x8015DC0A - 0xFFFFFFFF - 1, ZEST_E_SIGNIN_REQUIRED: 0xC101A24B - 0xFFFFFFFF - 1, X8_E_SIGNIN_MISMATCH: 0xC101010E - 0xFFFFFFFF - 1
+ })
+})();
+/* >>>>>>/components/signin/signin.js:28610 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Utilities");
+ (function () {
+ "use strict";
+ var observableProperty = MS.Entertainment.UI.Framework.observableProperty;
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ SignedInUser: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Utilities.User", function signedInUser() {
+ MS.Entertainment.Utilities.SignedInUser._instanceCount++;
+ MS.Entertainment.Utilities.assert(MS.Entertainment.Utilities.SignedInUser._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser)");
+ this.refresh(null, true)
+ }, {
+ gamerTag: MS.Entertainment.UI.Framework.observableProperty("gamerTag", String.empty), xuid: MS.Entertainment.UI.Framework.observableProperty("xuid", String.empty), locale: MS.Entertainment.UI.Framework.observableProperty("locale", String.empty), isParentallyControlled: MS.Entertainment.UI.Framework.observableProperty("isParentallyControlled", false), hasExplicitPrivilege: MS.Entertainment.UI.Framework.observableProperty("hasExplicitPrivilege", false), isSubscription: MS.Entertainment.UI.Framework.observableProperty("isSubscription", false), membershipLevel: MS.Entertainment.UI.Framework.observableProperty("membershipLevel", String.empty), meteringCertificate: MS.Entertainment.UI.Framework.observableProperty("meteringCertificate", String.empty), signInName: MS.Entertainment.UI.Framework.observableProperty("signInName", String.empty), firstName: MS.Entertainment.UI.Framework.observableProperty("firstName", String.empty), lastName: MS.Entertainment.UI.Framework.observableProperty("lastName", String.empty), _userPuid: MS.Entertainment.UI.Framework.observableProperty("_userPuid", String.empty), _userCid: MS.Entertainment.UI.Framework.observableProperty("_userCid", String.empty), _userAnid: MS.Entertainment.UI.Framework.observableProperty("_userAnid", String.empty), canSignOut: MS.Entertainment.UI.Framework.observableProperty("canSignOut", false), isTunerActivated: MS.Entertainment.UI.Framework.observableProperty("isTunerActivated", false), isTunerActivatable: MS.Entertainment.UI.Framework.observableProperty("isTunerActivatable", false), isGamerTag: function isGamerTag(gamerTag) {
+ return gamerTag && this.gamerTag && this.gamerTag.match(new RegExp("^" + gamerTag + "$", "i")) !== null
+ }, isGold: function isGold() {
+ return this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Gold || this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.FamilyGold || this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Family
+ }, isSilver: function isSilver() {
+ return this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Silver
+ }, getUserAnid: function getUserAnid() {
+ if (this._userAnid)
+ return this.userAnid;
+ if (!this._userPuid)
+ return String.empty;
+ var padding = [];
+ for (var w = 0; w < (MS.Entertainment.Utilities.SignedInUser._initialPuidLength - this._userPuid.length); w++)
+ padding[w] = "0";
+ var puidToUse = padding.join(String.empty).concat(this._userPuid);
+ try {
+ var macAlgorithmProvider = Windows.Security.Cryptography.Core.MacAlgorithmProvider.openAlgorithm("HMAC_MD5");
+ var keyMaterial = Windows.Security.Cryptography.CryptographicBuffer.createFromByteArray([99, 202, 90, 90, 191, 64, 70, 72, 58, 206, 107, 87, 165, 187, 152, 8]);
+ var key = macAlgorithmProvider.createKey(keyMaterial);
+ var encodedPuid = Windows.Security.Cryptography.CryptographicBuffer.convertStringToBinary(puidToUse, Windows.Security.Cryptography.BinaryStringEncoding.utf16LE);
+ var bytes = null;
+ bytes = Windows.Security.Cryptography.CryptographicBuffer.copyToByteArray(encodedPuid);
+ var bytes2 = [];
+ for (var i = 0; i < bytes.length; i++)
+ bytes2[i] = bytes[i];
+ for (var k = bytes.length - 1; k < MS.Entertainment.Utilities.SignedInUser._encodedMaterialLength; k++)
+ bytes2[k] = 0;
+ var finalEncodedPuid = Windows.Security.Cryptography.CryptographicBuffer.createFromByteArray(bytes2);
+ var signatureBuffer = Windows.Security.Cryptography.Core.CryptographicEngine.sign(key, finalEncodedPuid);
+ var signature = Windows.Security.Cryptography.CryptographicBuffer.encodeToHexString(signatureBuffer);
+ var finalString = signature.slice(0, MS.Entertainment.Utilities.SignedInUser._anidSliceLength).concat(MS.Entertainment.Utilities.SignedInUser._paddingForPuidHash);
+ this._userAnid = finalString
+ }
+ catch (e) {
+ MS.Entertainment.Utilities.fail("Failed to hash anid " + e);
+ return null
+ }
+ return finalString
+ }, refresh: function refresh(signInProvider, doNotUpdatePropertyCache) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.nativeUserModel = [null];
+ this._userAnid = null;
+ if (signInProvider) {
+ this.gamerTag = signInProvider.gamerTag;
+ this.xuid = signInProvider.xuid;
+ this.locale = signInProvider.locale;
+ this.isParentallyControlled = signInProvider.parentallyControlled;
+ this.hasExplicitPrivilege = signInProvider.explicitPrivilege;
+ this.isSubscription = signInProvider.isSubscription;
+ this.membershipLevel = signInProvider.membershipLevel;
+ this.subscriptionOfferID = signInProvider.subscriptionOfferID;
+ this.meteringCertificate = signInProvider.meteringCertificate;
+ this.signInName = signInProvider.signInName;
+ this.firstName = signInProvider.firstName;
+ this.lastName = signInProvider.lastName;
+ this._userPuid = signInProvider.id;
+ this._userCid = signInProvider.cid;
+ this.canSignOut = signInProvider.canSignOut;
+ this.isTunerActivated = signInProvider.isTunerActivated;
+ this.isTunerActivatable = signInProvider.isTunerActivatable
+ }
+ else {
+ this.gamerTag = String.empty;
+ this.xuid = String.empty;
+ this.locale = String.empty;
+ this.isParentallyControlled = false;
+ this.hasExplicitPrivilege = false;
+ this.isSubscription = false;
+ this.membershipLevel = String.empty;
+ this.subscriptionOfferID = String.empty;
+ this.meteringCertificate = String.empty;
+ this.signInName = String.empty;
+ this.firstName = String.empty;
+ this.lastName = String.empty;
+ this._userPuid = null;
+ this._userCid = null;
+ this.canSignOut = false;
+ this.isTunerActivated = false;
+ this.isTunerActivatable = false
+ }
+ if (!doNotUpdatePropertyCache)
+ this.updateLastSignedInUserPropertyCache()
+ }, updateLastSignedInUserPropertyCache: function updateLastSignedInUserPropertyCache() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!configurationManager.service.enableTimeTravel) {
+ configurationManager.service.lastSignedInUserParentControl = this.isParentallyControlled;
+ configurationManager.service.lastSignedInUserExplicitPrivilege = this.hasExplicitPrivilege;
+ configurationManager.service.lastSignedInUserSubscription = this.isSubscription;
+ configurationManager.service.lastSignedInUserMembership = this.membershipLevel ? MS.Entertainment.Utilities.SignedInUser.membershipStringMap[this.membershipLevel] : MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Silver;
+ configurationManager.service.lastSignedInUserGamerTag = this.gamerTag;
+ configurationManager.service.lastSignedInUserXuid = this.xuid;
+ configurationManager.service.lastSignedInUserCid = this._userCid;
+ configurationManager.service.lastSignedInUserSignInName = this.signInName;
+ configurationManager.service.lastSignedInUserAccountLocale = this.locale
+ }
+ }
+ }, {
+ factory: function factory() {
+ return new MS.Entertainment.Utilities.SignedInUser
+ }, _instanceCount: 0, _initialPuidLength: 16, _anidSliceLength: 24, _paddingForPuidHash: "FFFFFFFF", _encodedMaterialLength: 66, membershipStringMap: {
+ None: "None", Silver: "Free", Gold: "Gold", Family: "Family", FamilyGold: "FamilyGold"
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.signedInUser, MS.Entertainment.Utilities.SignedInUser.factory, true);
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ SignIn: MS.Entertainment.UI.Framework.derive(MS.Entertainment.UI.Framework.ObservableBase, function SignIn_constructor() {
+ MS.Entertainment.Utilities.SignIn._instanceCount++;
+ MS.Entertainment.Utilities.assert(MS.Entertainment.Utilities.SignIn._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn)");
+ this._signInProvider = new Microsoft.Entertainment.Util.SignIn;
+ this._liveIdChangeCompleteHandler = this._liveIdChangeCompleteHandler.bind(this);
+ Object.defineProperty(this, "appNotificationService", {
+ get: function _getAppNotificationService() {
+ if (!this._appNotificationService && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appNotification))
+ this._appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ return this._appNotificationService
+ }.bind(this)
+ });
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).service.enableNativeSignIn) {
+ var serviceEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProvider;
+ this._signInEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._signInProvider, {
+ signinstarted: function handleSignInStartedEvent() {
+ serviceEventProvider.traceServiceSignInStarted()
+ }, signoutstarted: function handleSignOutStartedEvent() {
+ serviceEventProvider.traceServiceSignOutStarted()
+ }, signincompleted: function handleSignInCompletedEvent() {
+ serviceEventProvider.traceServiceSignInCompleted()
+ }, signoutcompleted: function handleSignOutCompletedEvent() {
+ serviceEventProvider.traceServiceSignOutCompleted()
+ }
+ })
+ }
+ if (WinJS.Utilities.getMember("Social.UI")) {
+ Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", this._handleApp2AppResume.bind(this));
+ var profilePickerContainer = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePickerContainer);
+ if (profilePickerContainer && profilePickerContainer.firstElementChild) {
+ var pickerControlElement = profilePickerContainer.firstElementChild;
+ this.handleApp2CurrentUserChanged = this.handleApp2CurrentUserChanged.bind(this);
+ pickerControlElement.addEventListener("currentuserchanged", this.handleApp2CurrentUserChanged);
+ pickerControlElement.suppressUnload = true;
+ if (pickerControlElement.winControl)
+ pickerControlElement.winControl.domElement = profilePickerContainer.firstElementChild
+ }
+ }
+ }, {
+ isSignedIn: observableProperty("isSignedIn", false), isApp2UserAvailable: observableProperty("isApp2UserAvailable", false), isSigningIn: observableProperty("isSigningIn", false), signInError: observableProperty("signInError", 0), isSigningOut: observableProperty("isSigningOut", false), isSignInEnabled: observableProperty("isSignInEnabled", true), _partnerToken: null, _appNotificationService: null, _liveIdChangeTaskName: "LiveIdChange", _networkStatusBinding: null, _lastSignedInUserRegion: null, _signInStartTime: null, _offlineErrorRetryCount: 0, _lastRefreshSignInFailed: false, signIn: function signIn(dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowCredUI, dontShowTOS) {
+ var that = this;
+ if (this.isSignedIn)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.success);
+ else if (this.isSigningIn)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.signingIn);
+ else if (this.isSigningOut)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.signingOut);
+ else {
+ this.signInError = 0;
+ this.isSigningIn = true;
+ return this._doSignIn(dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowCredUI, dontShowTOS)
+ }
+ }, signInApp2User: function signInApp2User() {
+ if (!MS.Entertainment.Utilities.isApp2 || MS.Entertainment.isAppModeOverride)
+ return;
+ var currentUser = this.getAppCurrentUser();
+ if (!currentUser && !WinJS.Utilities.getMember("App2.ApplicationModel.Core.CoreApplicationContext.currentUser")) {
+ this.isApp2UserAvailable = false;
+ return
+ }
+ currentUser = App2.ApplicationModel.Core.CoreApplicationContext.currentUser;
+ if (!currentUser.isGuest && currentUser.isSignedIn) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configurationManager.service.lastSignedInUserXuid = currentUser.xboxUserId;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.xuid = currentUser.xboxUserId;
+ signedInUser.gamerTag = currentUser.displayInfo.gamertag;
+ this._updateCurrentUser(currentUser);
+ this.isApp2UserAvailable = true
+ }
+ else
+ this.isApp2UserAvailable = false
+ }, _authenticateUserHelper: function _authenticateUserHelper(dontShowNotifications) {
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ this._lastSignedInUserRegion = globalizationManager.getRegion();
+ return this.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport), true, Microsoft.Entertainment.Util.SignInPromptType.promptIfNeeded).then(function (passportTicket) {
+ return this._signInProvider.authenticateUser(passportTicket)
+ }.bind(this)).then(function authenticateUserSuccess() {
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignIn.SignInResult.success, false, false, false, false)
+ }.bind(this), function intialPassportTicketError(err) {
+ return this._onSignInComplete(err.number, false, true, true, true)
+ }.bind(this))
+ }, _doSignIn: function _doSignIn(dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowCredUI, dontShowTOS) {
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience)
+ return WinJS.Promise.as();
+ this._signInStartTime = this._signInProvider.startTime = new Date;
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).service.enableNativeSignIn)
+ return this._authenticateUserHelper(dontShowNotifications);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isSignInAvailable = false;
+ var isSupported = true;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ isSignInAvailable = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSignInAvailable);
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ isSignInAvailable = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoSignInAvailable);
+ else
+ isSignInAvailable = true;
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ isSupported = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer).checkAndRunUpgradeReminder(!dontShowErrors);
+ if (!isSupported || !stateService.servicesEnabled) {
+ this.isSignInEnabled = false;
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_VERSION_NOT_SUPPORTED, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }
+ if (!isSignInAvailable) {
+ this.isSignInEnabled = false;
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION, (dontShowErrors || MS.Entertainment.Utilities.isVideoApp2), dontShowAccountCreation, true, dontShowTOS)
+ }
+ var promptType = Microsoft.Entertainment.Util.SignInPromptType.promptIfNeeded;
+ if (dontShowCredUI)
+ promptType = Microsoft.Entertainment.Util.SignInPromptType.doNotPrompt;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.networkStatus && (uiStateService.networkStatus === MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none || uiStateService.networkStatus === MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly))
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS);
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ this._lastSignedInUserRegion = globalizationManager.getRegion();
+ var accountPickerPromise = WinJS.Promise.as();
+ if (MS.Entertainment.Utilities.isApp2) {
+ var currentUser = this.getAppCurrentUser();
+ if (!currentUser && App2 && App2.ApplicationModel && App2.ApplicationModel.Core && App2.ApplicationModel.Core.CoreApplicationContext)
+ currentUser = App2.ApplicationModel.Core.CoreApplicationContext.currentUser;
+ var useAccountPicker = !dontShowCredUI;
+ if ((!currentUser || currentUser.isGuest || !currentUser.isSignedIn) && useAccountPicker)
+ accountPickerPromise = MS.Entertainment.UI.Shell.AccountPicker.showAccountPickerAsync().then(function showAccountPickerAsyncComplete(result) {
+ if (!result || !result.user)
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NO_CONNECTED_ACCOUNT, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS);
+ this._updateCurrentUser(result.user);
+ if (WinJS.Utilities.getMember("Social.UI")) {
+ var profilePicker = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePicker);
+ if (profilePicker)
+ profilePicker.currentUser = result.user
+ }
+ }.bind(this), function showAccountPickerAsyncError(error) {
+ var dontShowErrorMessage = dontShowErrors;
+ if (WinJS.Promise.isCanceledError(error))
+ dontShowErrorMessage = true;
+ return this._onSignInComplete(error, dontShowErrorMessage, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this));
+ else if (currentUser && currentUser.isSignedIn && !currentUser.isGuest)
+ this._updateCurrentUser(currentUser)
+ }
+ return accountPickerPromise.then(function accountPickerComplete() {
+ var intialPassportTicketRequest = WinJS.Promise.as(String.empty);
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ intialPassportTicketRequest = this.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport), true, promptType);
+ return intialPassportTicketRequest.then(function getPassportTicketSuccess(passportTicket) {
+ if (!(Windows.ApplicationModel.Search && MS.Entertainment.Utilities.isApp2))
+ MS.Entertainment.Utilities.assert(passportTicket, "No passport ticket");
+ if (this.appNotificationService) {
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError);
+ if (!dontShowNotifications)
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_SIGNIN_PROGRESS), subTitle: String.empty, moreDetails: String.empty, icon: WinJS.UI.AppBarIcon.sync, action: null, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo, isPersistent: true, iconClassName: MS.Entertainment.Utilities.SignIn.NotificationIconClass
+ }))
+ }
+ return this._signInInternal(passportTicket).then(function signInInternalSuccess() {
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignIn.SignInResult.success, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this), function signInInternalError(err) {
+ return this._onSignInComplete(err.number, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this))
+ }.bind(this), function getPassportTicketError(errTicket) {
+ return this._onSignInComplete(errTicket.number, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this))
+ }.bind(this))
+ }, _registerUserChangedEvents: function _registerUserChangedEvents() {
+ if (!MS.Entertainment.Utilities.isApp2) {
+ this._unregisterLiveIdChangeEvent();
+ this._registerLiveIdChangeEvent()
+ }
+ }, _handleApp2AppResume: function _handleApp2AppResume(eventArgs) {
+ var profilePicker = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePicker);
+ if (profilePicker && profilePicker._currentUserChanged)
+ profilePicker._currentUserChanged()
+ }, handleApp2CurrentUserChanged: function handleApp2CurrentUserChanged(eventArgs) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProvider;
+ eventProvider.traceServiceUserChanged("handleApp2CurrentUserChanged invoked");
+ var newUser = null;
+ if (eventArgs && eventArgs.detail)
+ newUser = eventArgs.detail.newCurrentUser;
+ if (!newUser || (newUser.isGuest || !newUser.isSignedIn)) {
+ this.signOut();
+ return
+ }
+ eventProvider.traceServiceUserChanged("New User:" + newUser.xboxUserId);
+ var previousUser = null;
+ try {
+ previousUser = this._signInProvider.currentUser
+ }
+ catch (ex) { }
+ if (!this.isSignedIn || !previousUser || (previousUser.xboxUserId !== newUser.xboxUserId)) {
+ if (previousUser && newUser && (previousUser.xboxUserId !== newUser.xboxUserId))
+ this._showLoadingCursorOnUserSwitch();
+ this.signOut().then(function signOutComplete() {
+ this._updateCurrentUser(newUser);
+ this.signIn()
+ }.bind(this))
+ }
+ else if (previousUser && previousUser.xboxUserId === newUser.xboxUserId)
+ this._updateCurrentUser(newUser)
+ }, _showLoadingCursorOnUserSwitch: function _showLoadingCursorOnUserSwitch() {
+ MS.Entertainment.UI.Controls.Overlay.showLoadingOverlay({
+ userControl: "MS.Entertainment.UI.Controls.LoadingControl", hideOnNowPlaying: true, enableKeyboardLightDismiss: false, onInitialize: function setModel(overlayContent) {
+ var progressControl = document.createElement("progress");
+ WinJS.Utilities.addClass(progressControl, "loadingRing win-ring win-large");
+ overlayContent.appendChild(progressControl);
+ return WinJS.Promise.wrap()
+ }, userControlOptions: {
+ isBusy: true, height: null, displayDelay: 0
+ }, overlayCustomStyle: "loadingControlOverlayBackground", showAnimation: function showAnimation(element) {
+ WinJS.Utilities.addClass(element, "fadeIn");
+ return WinJS.Promise.as()
+ }, hideAnimation: function hideAnimation(element) {
+ WinJS.Utilities.removeClass(element, "fadeIn");
+ WinJS.Utilities.addClass(element, "fadeOut");
+ return WinJS.Promise.as()
+ }, closeTimeoutMS: MS.Entertainment.Utilities.SignIn.SIGNIN_SWITCH_USER_LOAD_TIMEOUT
+ })
+ }, _updateCurrentUser: function _updateCurrentUser(newUser) {
+ if (newUser === undefined)
+ MS.Entertainment.Utilities.fail("signIn.js _updateCurrentUser: newUser is undefined");
+ var oldUser = null;
+ try {
+ oldUser = this._signInProvider.currentUser
+ }
+ catch (ex) { }
+ this._signInProvider.currentUser = newUser
+ }, _registerLiveIdChangeEvent: function _registerLiveIdChangeEvent() {
+ try {
+ var trigger = new Windows.ApplicationModel.Background.SystemTrigger(Windows.ApplicationModel.Background.SystemTriggerType.onlineIdConnectedStateChange, false);
+ var taskBuilder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder;
+ taskBuilder.name = this._liveIdChangeTaskName;
+ taskBuilder.taskEntryPoint = "LiveIdChange.js";
+ taskBuilder.setTrigger(trigger);
+ var task = taskBuilder.register();
+ task.addEventListener("completed", this._liveIdChangeCompleteHandler)
+ }
+ catch (ex) { }
+ }, _unregisterLiveIdChangeEvent: function _unregisterLiveIdChangeEvent() {
+ var iterator = Windows.ApplicationModel.Background.BackgroundTaskRegistration.allTasks.first();
+ var hasCurrentTask = iterator.hasCurrent;
+ while (hasCurrentTask) {
+ var currentTask = iterator.current.value;
+ if (currentTask.name === this._liveIdChangeTaskName)
+ currentTask.unregister(true);
+ hasCurrentTask = iterator.moveNext()
+ }
+ }, _liveIdChangeCompleteHandler: function _liveIdChangeCompleteHandler() {
+ this.signOut().then(function signOutComplete() {
+ this.signInOnStart()
+ }.bind(this))
+ }, getAppCurrentUser: function getAppCurrentUser() {
+ var user;
+ try {
+ user = this._signInProvider.currentUser;
+ if (!(user && user.isSignedIn))
+ user = null
+ }
+ catch (ex) { }
+ return user
+ }, getToBeProvisionedUserName: function getToBeProvisionedUserName() {
+ var user;
+ try {
+ user = this._signInProvider.signInName
+ }
+ catch (ex) { }
+ return user
+ }, switchCurrentUser: function switchCurrentUser() {
+ MS.Entertainment.UI.Shell.AccountPicker.showAccountPickerAsync().done(function showAccountPickerAsyncComplete(result) {
+ if (!result || !result.user)
+ return;
+ var previousUser = this.getAppCurrentUser();
+ if (previousUser && previousUser.xboxUserId !== result.user.xboxUserId)
+ this.signOut().done(function signOutComplete() {
+ this._updateCurrentUser(result.user);
+ this.signIn()
+ }.bind(this))
+ }.bind(this), null)
+ }, signInOnStart: function signInOnStart() {
+ return this.signIn(true, true, false, true, false).then(null, function signInError() { })
+ }, getSignInPromise: function getSignInPromise() {
+ var signedInSignal = new MS.Entertainment.UI.Framework.Signal;
+ var signInBindings;
+ var signInPromise = WinJS.Promise.wrap();
+ var cleanupSignInBindings = function () {
+ if (!signInBindings)
+ return;
+ signInBindings.cancel();
+ signInBindings = null;
+ signedInSignal.complete()
+ };
+ if (this.isSigningIn) {
+ signInBindings = WinJS.Binding.bind(this, { isSigningIn: cleanupSignInBindings });
+ signInPromise = signedInSignal.promise
+ }
+ return signInPromise
+ }, signOut: function signOut(forceSignOut, persistUserDB, dontShowNotifications) {
+ if (this.isSigningOut)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.signingOut);
+ this.isSigningOut = true;
+ var signOutComplete = function signOutComplete(signOutResult, dontShowNotifications) {
+ if (this.isSignedIn) {
+ this.isSignedIn = this.isApp2UserAvailable = false;
+ if (MS.Entertainment.Utilities.isApp2)
+ this._updateCurrentUser(null);
+ this.signInError = MS.Entertainment.Utilities.SignInErrors.ZEST_E_SIGNIN_REQUIRED;
+ this.isSigningIn = false;
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.alwaysPromptOnPurchase = true;
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.promptOnPurchaseFirstRun = true;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.refresh(null, forceSignOut);
+ MS.Entertainment.Utilities.SignIn.dispatchEvent("signOutComplete", true);
+ if (!forceSignOut)
+ this._resetNavigationState()
+ }
+ this.isSigningOut = false;
+ if (this._refreshSignInPromise) {
+ this._refreshSignInPromise.cancel();
+ this._refreshSignInPromise = null
+ }
+ if (!dontShowNotifications)
+ this._showSignInNotification();
+ if (!forceSignOut) {
+ this._lastSignedInUserRegion = null;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configurationManager.service.lastSignInAccountRegion = ""
+ }
+ var signOutResultText = signOutResult;
+ if (typeof signOutResult === "number")
+ signOutResultText = MS.Entertainment.Utilities.convertToHexString(signOutResult);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SignOutResult, parameterValue: signOutResultText
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ForceSignOut, parameterValue: !!forceSignOut
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignOut, telemetryParameterArray);
+ return signOutResult
+ }.bind(this);
+ if (this.isSignedIn || forceSignOut)
+ return this._signOutInternal(persistUserDB).then(function (signIn) {
+ return signOutComplete(MS.Entertainment.Utilities.SignIn.SignInResult.success, dontShowNotifications)
+ }, function (err) {
+ return signOutComplete(err.number, dontShowNotifications)
+ });
+ else {
+ this.isSigningOut = false;
+ return WinJS.Promise.wrap()
+ }
+ }, forgetUserInformation: function forgetUserInformation() {
+ return Microsoft.Entertainment.Fulfillment.Reading.Entitlements.clearUserHashAsync().then(function () {
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn)._forgetUserInformationInternal()
+ })
+ }, _resetNavigationState: function resetNavigationState() {
+ var navigationService = null;
+ var winJSNavigationService = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoQueryCacheService)) {
+ var videoQueryCacheService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoQueryCacheService);
+ videoQueryCacheService.reloadQueries()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateToDefaultPage()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)) {
+ winJSNavigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ winJSNavigationService.navigateToDefault()
+ }
+ }, getPassportTicket: function getPassportTicket(policy, service, ignoreSignInState, promptType) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if ((this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired)) || ignoreSignInState)
+ return this._getPassportTicketInternal(policy, service, ignoreSignInState, promptType).then(function (passport) {
+ if (passport)
+ return passport.passportTicket
+ });
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getWebAuthToken: function getWebAuthToken(startUri, endUri, ignoreSignInState, webAuthOptions) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ var WebAuthOptions = Windows.Security.Authentication.Web.WebAuthenticationOptions;
+ if ((this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired)) || ignoreSignInState)
+ return Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAsync(webAuthOptions || WebAuthOptions.none, startUri, endUri).then(function (result) {
+ var WebAuthStatus = Windows.Security.Authentication.Web.WebAuthenticationStatus;
+ switch (result.responseStatus) {
+ case WebAuthStatus.errorHttp:
+ return WinJS.Promise.wrapError(result.responseData);
+ break;
+ case WebAuthStatus.userCancel:
+ return WinJS.Promise.cancel;
+ break;
+ case WebAuthStatus.success:
+ return result.responseData;
+ break
+ }
+ });
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getAuthHeaderForEndpoint: function getAuthHeaderForEndpoint(endpointId, ignoreSignInState) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if (this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired))
+ return this._getAuthHeaderForEndpointInternal(endpointId, ignoreSignInState).then(function complete(result) {
+ this._triggerRefreshIfNeeded();
+ return result
+ }.bind(this), function error(err) {
+ if (err.number)
+ this._sendXSTSTelemetry(err.number);
+ return WinJS.Promise.wrapError(err)
+ }.bind(this));
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getAuthHeader: function getAuthHeader() {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if (this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired))
+ return this._getAuthHeaderInternal().then(function complete(result) {
+ this._triggerRefreshIfNeeded();
+ return result
+ }.bind(this), function error(err) {
+ if (err.number)
+ this._sendXSTSTelemetry(err.number);
+ return WinJS.Promise.wrapError(err)
+ }.bind(this));
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getXToken: function getXToken(endpointId, ignoreSignInState) {
+ return this._getXToken(function () {
+ return this._getXTokenInternal(endpointId)
+ }.bind(this), ignoreSignInState)
+ }, getXTokenByRelyingParty: function getXTokenByRelyingParty(relyingParty, ignoreSignInState) {
+ return this._getXToken(function () {
+ return this._getXTokenByRelyingPartyInternal(relyingParty)
+ }.bind(this), ignoreSignInState)
+ }, _getXToken: function _getXToken(nativeOperation, ignoreSignInState) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if ((this.isSignedIn || this.isApp2UserAvailable) && (!upgradeService || !upgradeService.upgradeRequired) || ignoreSignInState)
+ return nativeOperation().then(function complete(result) {
+ if (result) {
+ this._triggerRefreshIfNeeded();
+ return {
+ key: "Authorization", value: result.token
+ }
+ }
+ }.bind(this), function error(err) {
+ return WinJS.Promise.wrapError(err)
+ });
+ else
+ return WinJS.Promise.wrapError(null)
+ }, _triggerRefreshIfNeeded: function _triggerRefreshIfNeeded() {
+ if (this._lastRefreshSignInFailed) {
+ this._refreshSignIn(MS.Entertainment.Utilities.SignIn.SIGNIN_REFRESH_INTERVAL_OVERRIDE);
+ this._lastRefreshSignInFailed = false
+ }
+ }, setIsSignInSupported: function setIsSignInSupported(isSupported) {
+ this._signInProvider.isSignInSupported = isSupported
+ }, _sendXSTSTelemetry: function _sendXSTSTelemetry(result) {
+ var authHeaderResultText = result;
+ if (typeof result === "number")
+ authHeaderResultText = "0x" + (result + 0xFFFFFFFF + 1).toString(16);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AuthHeaderResultText, parameterValue: authHeaderResultText
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.AuthHeaderResult, telemetryParameterArray)
+ }, refreshSignInState: function refreshSignInState() {
+ this._signInProvider.clearTokenMap();
+ return this._doSignIn(true, true, true, true, true)
+ }, provisionUserAccount: function provisionUserAccount() {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.provisionUserAccount()
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _onSignInComplete: function _onSignInComplete(signInResult, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS) {
+ this.isSigningIn = false;
+ this.isSignedIn = this.isApp2UserAvailable = this._signInProvider.isSignedIn();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this.isSignedIn) {
+ this.signInError = 0;
+ if (this.appNotificationService) {
+ if (!dontShowNotifications)
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_SIGNIN_COMPLETE), subTitle: String.empty, moreDetails: null, icon: MS.Entertainment.UI.Icon.player, action: null, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo, isPersistent: false
+ }));
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError)
+ }
+ }
+ else {
+ if (this.appNotificationService)
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo);
+ this.signInError = signInResult
+ }
+ if (this.isSignedIn) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.refresh(this._signInProvider);
+ MS.Entertainment.Utilities.SignIn.dispatchEvent("signInComplete", true);
+ if (this._partnerToken)
+ this._sendPartnerTokenToMDS(this._partnerToken);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.richPresence)) {
+ var richPresenceService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.richPresence);
+ richPresenceService.setRichPresence(MS.Entertainment.Services.RichPresenceActionType.browsingApp)
+ }
+ }
+ this._sendTelemetry(signInResult);
+ this._registerUserChangedEvents();
+ var that = this;
+ switch (signInResult) {
+ case MS.Entertainment.Utilities.SignIn.SignInResult.success:
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ var userXboxRegion = globalizationManager.getRegion();
+ var userAccountRegion = this._lastSignedInUserRegion;
+ if (userAccountRegion !== userXboxRegion) {
+ var userRegionSupported = this._checkUserRegionIsSupported(userXboxRegion);
+ if (userRegionSupported)
+ if (MS.Entertainment.Utilities.isApp1)
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_SIGNIN_MIXED_REGION_ERROR_TITLE), String.load(String.id.IDS_SIGNIN_MIXED_REGION_ERROR_DESC)).done(function () {
+ MSApp.terminateApp(new Error("Region Changed because signed in user has different xbox live region"))
+ });
+ else
+ this._resetNavigationState();
+ else {
+ if (this.appNotificationService)
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo);
+ if (!userRegionSupported) {
+ this.signInError = MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION;
+ this._sendTelemetry(this.signInError)
+ }
+ this._lastSignedInUserRegion = null;
+ configurationManager.service.lastSignInAccountRegion = String.empty;
+ if (!dontShowErrors) {
+ var msgPromise = MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION);
+ return msgPromise.then(function showSignInErrorComplete() {
+ that.signOut(true, false, dontShowNotifications);
+ return MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION
+ })
+ }
+ else {
+ this.signOut(true, false, dontShowNotifications);
+ return WinJS.Promise.wrapError(MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION)
+ }
+ }
+ }
+ this._offlineErrorRetryCount = 0;
+ that._refreshSignIn();
+ return WinJS.Promise.wrap(signInResult);
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED:
+ case MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_CREATION_REQUIRED:
+ if (!dontShowAccountCreation && !MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.Accounts.AccountProvisioningDialog.showAccountProvisioningDialog().then(function createAccountComplete() {
+ return this.signIn(true, true, false, true, true)
+ }.bind(this), function createAccountError(error) {
+ if (error.number === MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_CHILD_ACCOUNT_CREATION_BLOCKED || error.number === MS.Entertainment.Utilities.SignInErrors.ONL_E_PARENTAL_CONSENT_REQUIRED)
+ return MS.Entertainment.Accounts.ChildAccountProvisioningDialog.showChildAccountProvisioningDialog().then(function childAccountProvisioningComplete() {
+ return this.signIn(true, true, false, true, true)
+ }.bind(this));
+ else
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), error.number).then(function callSignIn() {
+ return this.signIn(true, true, false, true, true)
+ }.bind(this))
+ }.bind(this));
+ else {
+ this.signOut(true, false, dontShowNotifications);
+ return WinJS.Promise.wrapError(signInResult)
+ }
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_TERMS_OF_SERVICE:
+ case MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_TERMS_OF_USE_NOT_ACCEPTED:
+ if (!dontShowTOS && !MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.Accounts.AcceptTermsOfService.doAcceptTermsOfService().then(function acceptTermsOfServiceComplete() {
+ return that.signIn(true, true, false, true, true)
+ });
+ else {
+ this.signOut(true, true);
+ return WinJS.Promise.wrapError(signInResult)
+ }
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_VERSION_NOT_SUPPORTED:
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NO_CONNECTED_ACCOUNT:
+ this._showSignInNotification();
+ var persistUserDB = true;
+ if (configurationManager.service.lastSignedInUserGamerTag && configurationManager.service.lastSignedInUserGamerTag !== String.empty)
+ persistUserDB = false;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.refresh(null);
+ this.signOut(true, persistUserDB, true);
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.ERROR_NETWORK_UNREACHABLE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_RESOURCE_NOT_FOUND:
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_DOWNLOAD_FAILURE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_CONNECTION_TIMEOUT:
+ case MS.Entertainment.Utilities.SignInErrors.XBL_SERVER_CONNECTION_FAILURE:
+ this._resetNetworkStatusBinding();
+ this._offlineErrorRetryCount++;
+ if (this._offlineErrorRetryCount < configurationManager.service.signInNetworkErrorRetryCount)
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), { networkStatus: this._onNetworkStatusChanged.bind(this) });
+ else
+ this._showSignInNotification();
+ if (!dontShowErrors)
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE).then(function showSignInErrorComplete() {
+ return signInResult
+ });
+ else
+ return WinJS.Promise.wrapError(signInResult);
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION:
+ if (!dontShowErrors)
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), signInResult).then(function showSignInErrorComplete() {
+ that.signOut(true, false, dontShowNotifications);
+ return signInResult
+ });
+ else {
+ this.signOut(true, false, dontShowNotifications);
+ return WinJS.Promise.wrapError(signInResult)
+ }
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_INVALID_USERNAME_AND_PASSWORD:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_FORCESIGNIN:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_ACCESS_DENIED_BY_TOU:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_PASSWORD_UPDATE_REQUIRED:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_ACCOUNT_UPDATE_REQUIRED:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_ACTION_REQUIRED:
+ return this.signIn();
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_NO_ACCOUNT_PROOF:
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_ACCOUNT_PROOF_NOT_VERIFIED:
+ return this.signIn();
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.ZUNE_E_SIGNIN_ERROR_CANCELLED:
+ this._showSignInNotification();
+ return WinJS.Promise.wrapError(signInResult);
+ default:
+ var that = this;
+ var signInAction = WinJS.Utilities.markSupportedForProcessing(function () {
+ that.signIn()
+ });
+ if (this.appNotificationService)
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Critical, title: String.load(String.id.IDS_SIGNIN_ERROR), subTitle: String.load(String.id.IDS_SIGNIN_RETRY), moreDetails: null, icon: WinJS.UI.AppBarIcon.sync, action: signInAction, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError, isPersistent: true
+ }));
+ this.signOut(true, true);
+ if (!dontShowErrors)
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), signInResult).then(function showSignInErrorComplete() {
+ return signInResult
+ });
+ else
+ return WinJS.Promise.wrapError(signInResult);
+ break
+ }
+ return WinJS.Promise.wrapError(signInResult)
+ }, _checkUserRegionIsSupported: function _checkUserRegionIsSupported(userRegion) {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var supportedRegions;
+ var isSignInSupported = true;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ supportedRegions = config.features.musicSignInAvailable;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ supportedRegions = config.features.videoSignInAvailable;
+ else
+ isSignInSupported = true;
+ if (supportedRegions !== "ALL" && supportedRegions.toLowerCase().indexOf(userRegion.toLowerCase()) < 0)
+ isSignInSupported = false;
+ return isSignInSupported
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newValue) {
+ switch (newValue) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ if (!this.isSignedIn)
+ WinJS.Promise.timeout(1000).then(function _delay() {
+ this.signIn(true, true, false, true, true).done(function success() {
+ this._resetNetworkStatusBinding()
+ }.bind(this), function error() {
+ this._resetNetworkStatusBinding()
+ }.bind(this))
+ }.bind(this));
+ break
+ }
+ }, _resetNetworkStatusBinding: function _resetNetworkStatusBinding() {
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ }, _launchStore: function _launchStore() {
+ var launchInfo = "ms-windows-store:Updates";
+ var appAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ appAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppStoreUpgrade;
+ appAction.parameter = {
+ uri: launchInfo, appendSource: true, appendGamerTag: false
+ };
+ appAction.execute()
+ }, _isNetworkError: function _isNetworkError(error) {
+ switch (error) {
+ case MS.Entertainment.Utilities.SignInErrors.ERROR_NETWORK_UNREACHABLE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_RESOURCE_NOT_FOUND:
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_DOWNLOAD_FAILURE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_CONNECTION_TIMEOUT:
+ case MS.Entertainment.Utilities.SignInErrors.XBL_SERVER_CONNECTION_FAILURE:
+ return true;
+ default:
+ return false
+ }
+ return false
+ }, _refreshSignIn: function _refreshSignIn(signInInterval) {
+ var refreshInterval = signInInterval ? signInInterval : MS.Entertainment.Utilities.SignIn.SIGNIN_REFRESH_INTERVAL;
+ if (this._refreshSignInPromise) {
+ this._refreshSignInPromise.cancel();
+ this._refreshSignInPromise = null
+ }
+ this._refreshSignInPromise = WinJS.Promise.timeout(refreshInterval).then(function _silentSignIn() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProvider;
+ eventProvider.traceServiceRefreshSignInStarted();
+ var requestNetwork = function requestNetwork() {
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ return sessionManager.requestNetworkAndDelay("SignIn")
+ }
+ else
+ return WinJS.Promise.as()
+ };
+ requestNetwork().then(function onNetworkRequested(networkReleaseHandle) {
+ this._doSignIn(true, true, true, true, true).then(function success() {
+ eventProvider.traceServiceRefreshSignInCompleted();
+ MS.Entertainment.Utilities.SignIn.dispatchEvent("signInRefreshed", true);
+ this._signInProvider.clearTokenMap();
+ MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount = 3;
+ this._lastRefreshSignInFailed = false;
+ if (networkReleaseHandle)
+ networkReleaseHandle.release()
+ }.bind(this), function error(signInResult) {
+ var signInResultText = signInResult;
+ if (typeof signInResult === "number")
+ signInResultText = MS.Entertainment.Utilities.convertToHexString(signInResult);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.RefreshSignInResult, parameterValue: signInResultText
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignIn, telemetryParameterArray);
+ this._signInProvider.clearTokenMap();
+ if (this._isNetworkError(signInResult))
+ if (MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount > 0) {
+ MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount--;
+ this._refreshSignIn(MS.Entertainment.Utilities.SignIn.SIGNIN_REFRESH_INTERVAL_OVERRIDE)
+ }
+ else {
+ MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount = 3;
+ this._lastRefreshSignInFailed = true
+ }
+ else
+ this._lastRefreshSignInFailed = true;
+ if (networkReleaseHandle)
+ networkReleaseHandle.release()
+ }.bind(this))
+ }.bind(this))
+ }.bind(this))
+ }, _signInInternal: function _signInInternal(passportTicket) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.signInUser(passportTicket)
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _signOutInternal: function _signOutInternal(persistUserDB) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.signOut(persistUserDB || false)
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _forgetUserInformationInternal: function _forgetUserInformationInternal() {
+ var asyncForgetUserInformationOp = null;
+ try {
+ asyncForgetUserInformationOp = this._signInProvider.forgetUserInformation()
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncForgetUserInformationOp
+ }, _getPassportTicketInternal: function _getPassportTicketInternal(policy, service, ignoreSignInState, promptType) {
+ var asyncSignInOp = null;
+ if (!promptType)
+ promptType = Microsoft.Entertainment.Util.SignInPromptType.promptIfNeeded;
+ try {
+ asyncSignInOp = this._signInProvider.getTicket(policy, service, ignoreSignInState, promptType)
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _getAuthHeaderForEndpointInternal: function _getAuthHeaderForEndpointInternal(endpointId, ignoreSignInState) {
+ var asyncAuthHeaderOp = null;
+ try {
+ asyncAuthHeaderOp = this._signInProvider.getAuthHeaderForEndpoint(endpointId, ignoreSignInState)
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncAuthHeaderOp
+ }, _getAuthHeaderInternal: function _getAuthHeaderInternal() {
+ var asyncAuthHeaderOp = null;
+ try {
+ asyncAuthHeaderOp = this._signInProvider.getAuthHeader()
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncAuthHeaderOp
+ }, _getXTokenInternal: function _getXTokenInternal(endpointId) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.getXTokenAsyncOp(endpointId)
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _getXTokenByRelyingPartyInternal: function _getXTokenByRelyingPartyInternal(endpointId) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.getXTokenByRelyingPartyAsyncOp(endpointId)
+ }
+ catch (err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _sendTelemetry: function _sendTelemetry(signInResult) {
+ var signInResultText = signInResult;
+ if (typeof signInResult === "number")
+ signInResultText = MS.Entertainment.Utilities.convertToHexString(signInResult);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceSignInResult(signInResultText);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SignInResult, parameterValue: signInResultText
+ }];
+ switch (signInResult) {
+ case MS.Entertainment.Utilities.SignIn.SignInResult.success:
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZunePass, parameterValue: signedInUser.isSubscription
+ });
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanSignOut, parameterValue: signedInUser.canSignOut
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NO_CONNECTED_ACCOUNT:
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NoConnectedAccount, parameterValue: true
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED:
+ case MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_CREATION_REQUIRED:
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CreateAccount, parameterValue: true
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_TERMS_OF_SERVICE:
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcceptTermsOfService, parameterValue: true
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION:
+ var region = (new Microsoft.Entertainment.Configuration.ConfigurationManager).service.lastSignInAccountRegion;
+ if (!region) {
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ region = globalizationManager.getRegion()
+ }
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UnsupportedRegion, parameterValue: region
+ });
+ break;
+ default:
+ break
+ }
+ var stopTime = new Date;
+ var durationMsec;
+ if (this._signInStartTime) {
+ durationMsec = stopTime.valueOf() - this._signInStartTime.valueOf();
+ this._signInStartTime = null
+ }
+ if (durationMsec) {
+ if (durationMsec < 0)
+ durationMsec = -10 * 60 * 1000;
+ else if (durationMsec > 5 * 60 * 1000)
+ durationMsec = 10 * 60 * 1000;
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SignInDuration, parameterValue: durationMsec.toString()
+ })
+ }
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignIn, telemetryParameterArray)
+ }, _showSignInNotification: function _showSignInNotification() {
+ if (!this.appNotificationService)
+ return;
+ var signInAction = WinJS.Utilities.markSupportedForProcessing(function () {
+ this.signIn().done(null, function () { })
+ }.bind(this));
+ var notificationTitle;
+ var notificationSubtitle;
+ var notificationIcon;
+ if (this.signInError === MS.Entertainment.Utilities.SignInErrors.XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED || this.signInError === MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_CREATION_REQUIRED) {
+ notificationTitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE);
+ notificationSubtitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT);
+ notificationIcon = WinJS.UI.AppBarIcon.sync
+ }
+ else {
+ notificationTitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE);
+ notificationSubtitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT);
+ notificationIcon = WinJS.UI.AppBarIcon.sync
+ }
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo);
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Critical, title: notificationTitle, subTitle: notificationSubtitle, moreDetails: null, icon: notificationIcon, action: signInAction, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError, isPersistent: true
+ }))
+ }, _sendPartnerTokenToMDS: function _sendPartnerTokenToMDS(partnerToken) {
+ var mdsCall = this._signInProvider.updatePartnerToken(partnerToken);
+ mdsCall.then(null, function (e) {
+ MS.Entertainment.Utilities.fail("Error trying to send partnerToken to MDS: " + (e & e.message))
+ }).done(function () {
+ this._partnerToken = null
+ }.bind(this))
+ }, updatePartnerToken: function updatePartnerToken(partnerToken) {
+ MS.Entertainment.Utilities.assert(partnerToken, "No partner token provided to sign in");
+ if (!partnerToken)
+ return;
+ if (this.isSignedIn)
+ this._sendPartnerTokenToMDS(partnerToken);
+ else
+ this._partnerToken = partnerToken
+ }
+ }, {
+ factory: function factory() {
+ return new MS.Entertainment.Utilities.SignIn
+ }, TicketType: {
+ MBI: "MBI", MBI_SSL: "MBI_SSL", HBI: "HBI", SA_20MIN: "SA_20MIN", JWT: "JWT"
+ }, SignInResult: {
+ success: "success", cancel: "cancel", signingIn: "signingIn", signingOut: "signingOut"
+ }, NotificationCategory: {
+ signInError: "signInError", signInInfo: "signInInfo"
+ }, NotificationIconClass: "rotate360Animation", _instanceCount: 0, listeners: null, SIGNIN_REFRESH_INTERVAL: 3 * 3600 * 1000, SIGNIN_REFRESH_INTERVAL_OVERRIDE: 900 * 1000, SIGNIN_SWITCH_USER_LOAD_TIMEOUT: 30 * 1000, _signInRefreshRetryCount: 3, addEventListener: function (eventType, listener, capture) {
+ if (MS.Entertainment.Utilities.SignIn.listeners === null) {
+ var ListenerType = WinJS.Class.mix(WinJS.Class.define(null), WinJS.Utilities.eventMixin);
+ MS.Entertainment.Utilities.SignIn.listeners = new ListenerType
+ }
+ MS.Entertainment.Utilities.SignIn.listeners.addEventListener(eventType, listener, capture)
+ }, dispatchEvent: function (eventType, details) {
+ if (MS.Entertainment.Utilities.SignIn.listeners !== null)
+ return MS.Entertainment.Utilities.SignIn.listeners.dispatchEvent(eventType, details)
+ }, removeEventListener: function (eventType, listener, capture) {
+ MS.Entertainment.Utilities.SignIn.listeners.removeEventListener(eventType, listener, capture)
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.signIn, MS.Entertainment.Utilities.SignIn.factory, true);
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ signIn: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function signInAction() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.signIn, executed: function executed() {
+ var commandingPopOver = MS.Entertainment.UI.Controls.CommandingPopOver;
+ if (commandingPopOver)
+ commandingPopOver.hideCurrentCommandingPopover();
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signIn().done(null, function () { })
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })
+ }), signInRequiredNavigate: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.navigate, function signInRequiredNavigate_constructor() {
+ this.base();
+ MS.Entertainment.Utilities.SignIn.addEventListener("signInComplete", this.requeryCanExecute.bind(this), false);
+ MS.Entertainment.Utilities.SignIn.addEventListener("signOutComplete", this.requeryCanExecute.bind(this), false)
+ }, {
+ canExecute: function signInRequiredNavigate_canExecute(param) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return signIn.isSignedIn
+ }
+ })
+ }), signInAndOnlineRequiredNavigate: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.signInRequiredNavigate, function signInAndOnlineRequiredNavigate_constructor() {
+ this.base();
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), { networkStatus: this.onNetworkStatusChanged.bind(this) })
+ }, {
+ _networkStatusBinding: null, _isOnline: null, canExecute: function signInAndOnlineRequiredNavigate_canExecute(param) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return (signIn.isSignedIn && this._isOnline)
+ }, onNetworkStatusChanged: function onNetworkStatusChanged(newValue) {
+ var isOnline = this.isNetworkStatusCodeOnline(newValue);
+ if (isOnline !== this._isOnline)
+ this._isOnline = isOnline
+ }, isNetworkStatusCodeOnline: function isNetworkStatusCodeOnline(status) {
+ var isOnline = false;
+ switch (status) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ isOnline = true;
+ break;
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ isOnline = false;
+ break
+ }
+ return isOnline
+ }
+ })
+ }), showAccountPicker: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function showAccountPickerAction() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.showAccountPicker, executed: function executed() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.switchCurrentUser().done(null, function error() { })
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })
+ })
+ });
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.signIn, function () {
+ return new MS.Entertainment.UI.Actions.signIn
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.signInRequiredNavigate, function () {
+ return new MS.Entertainment.UI.Actions.signInRequiredNavigate
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.signInAndOnlineRequiredNavigate, function () {
+ return new MS.Entertainment.UI.Actions.signInAndOnlineRequiredNavigate
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.showAccountPicker, function () {
+ return new MS.Entertainment.UI.Actions.showAccountPicker
+ })
+ })()
+})();
+/* >>>>>>/components/playback/playbackhelpers.js:29772 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.PlaybackHelpers");
+ WinJS.Namespace.define("MS.Entertainment.Platform", {
+ PlayAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function playAction() {
+ this.base()
+ }, {
+ _executing: false, executed: function executed(param) {
+ if (MS.Entertainment.Utilities.isApp2 && this._executing)
+ return;
+ this._executing = true;
+ this.requeryCanExecute();
+ var mediaQueued = WinJS.Promise.as(this.executedPlay(param));
+ mediaQueued.done(function waitForPlayback(wasMediaQueued) {
+ if (wasMediaQueued)
+ MS.Entertainment.Platform.PlaybackHelpers.waitForTransportState(MS.Entertainment.Platform.Playback.TransportState.playing).then(null, function ignoreError() { }).done(function enableAction() {
+ this._executing = false;
+ this.requeryCanExecute()
+ }.bind(this));
+ else {
+ this._executing = false;
+ this.requeryCanExecute()
+ }
+ }.bind(this), function ignoreError() { });
+ return mediaQueued
+ }, executedPlay: function executedPlay(param) {
+ return false
+ }, canExecute: function canExecute(param) {
+ return this.canExecutePlay(param) && (MS.Entertainment.Utilities.isApp2 || !this._executing)
+ }, canExecutePlay: function canExecutePlay(param) {
+ return false
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Platform.PlaybackHelpers", {
+ _getFeatureEnablement: (function _getFeatureEnablement_closure() {
+ var featureEnablement = null;
+ return function _getFeatureEnablement_getter() {
+ if (!featureEnablement)
+ featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return featureEnablement
+ }
+ })(), waitForTransportState: function waitForTransportState(transportStates) {
+ var bindings;
+ var completed;
+ var failed;
+ var promise;
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ if (transportStates && !Array.isArray(transportStates))
+ transportStates = [transportStates];
+ function onPlaybackChanged() {
+ if (!bindings)
+ return;
+ if (playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.error)
+ failed();
+ else if (transportStates.indexOf(playbackSession.currentTransportState) >= 0)
+ completed()
+ }
+ if (transportStates)
+ promise = new WinJS.Promise(function initializePromise(c, f) {
+ completed = c;
+ failed = f;
+ bindings = WinJS.Binding.bind(playbackSession, {
+ currentTransportState: onPlaybackChanged, playerState: onPlaybackChanged
+ })
+ }, function canceled() { });
+ else
+ promise = WinJS.Promise.wrap();
+ promise.then(null, function ignoreError() { }).done(function clearBindings() {
+ if (bindings) {
+ bindings.cancel();
+ bindings = null
+ }
+ });
+ return promise
+ }, getMediaByServiceId: function getMediaByServiceId(serviceId, idType) {
+ return MS.Entertainment.Utilities.getMediaByServiceId(serviceId, idType)
+ }, getGameMediaByTitleId: function getGameMediaByTitleId(titleId) {
+ titleId = parseInt(titleId);
+ if (!titleId)
+ return WinJS.Promise.wrapError(null);
+ var edsMediaItem = MS.Entertainment.Data.augment({ TitleId: titleId }, MS.Entertainment.Data.Augmenter.Marketplace.XboxGame);
+ MS.Entertainment.ViewModels.MediaItemModel.augment(edsMediaItem);
+ if (edsMediaItem.hydrate)
+ return edsMediaItem.hydrate().then(function hydrateSuccess() {
+ return edsMediaItem
+ }, function hydrateFailed() {
+ return edsMediaItem
+ });
+ else
+ return WinJS.Promise.wrap(edsMediaItem)
+ }, getMusicMediaByServiceId: function _getArtistMediaByServiceId(serviceId, serviceIdType, mediaType) {
+ var featureEnablement = this._getFeatureEnablement();
+ return new WinJS.Promise(function (c, e, p) {
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace)) {
+ var useCanonicalId = true;
+ if (serviceIdType) {
+ var idType = serviceIdType.toLocaleLowerCase();
+ if (idType === MS.Entertainment.Data.Query.edsIdType.canonical.toLocaleLowerCase())
+ useCanonicalId = true;
+ else if (idType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsIdType.zuneCatalog.toLocaleLowerCase())
+ useCanonicalId = false;
+ else
+ MS.Entertainment.UI.Components.Shell.fail("Unknown media ID type.")
+ }
+ var item = useCanonicalId ? { ID: serviceId } : { ZuneId: serviceId };
+ item.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ switch (mediaType.toLocaleLowerCase()) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicArtist.toLocaleLowerCase():
+ var artist = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSArtist);
+ if (artist) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(artist);
+ artist.hydrate().done(function completeHydrate(media) {
+ c(media)
+ }, function hydrateError(error) {
+ e(error)
+ })
+ }
+ else {
+ error = new Error("Failed to augment artist");
+ e(error)
+ }
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.album.toLocaleLowerCase():
+ var album = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSAlbum);
+ if (album) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(album);
+ album.hydrate().done(function completeHydrate(media) {
+ c(media)
+ }, function hydrateError(error) {
+ e(error)
+ })
+ }
+ else {
+ error = new Error("Failed to augment album");
+ e(error)
+ }
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.track.toLocaleLowerCase():
+ var track = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSTrack);
+ if (track) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(track);
+ track.hydrate({ forceUpdate: true }).done(function completeHydrate(media) {
+ c(media)
+ }, function hydrateError(error) {
+ e(error)
+ })
+ }
+ else {
+ error = new Error("Failed to augment track");
+ e(error)
+ }
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.musicPlaylist.toLocaleLowerCase():
+ var error;
+ if (serviceId) {
+ error = new Error("Marketplace playlists not implemented");
+ e(error)
+ }
+ else {
+ error = new Error("No service id given");
+ e(error)
+ }
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.musicVideo.toLocaleLowerCase():
+ var musicVideo = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSMusicVideo);
+ if (musicVideo) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(musicVideo);
+ musicVideo.hydrate({ forceUpdate: true }).done(function completeHydrate(media) {
+ c(media)
+ }, function hydrateError(error) {
+ e(error)
+ })
+ }
+ else {
+ error = new Error("Failed to augment musicVideo");
+ e(error)
+ }
+ break;
+ default:
+ MS.Entertainment.UI.Components.Shell.fail("Unknown desired media type.");
+ break
+ }
+ }
+ else
+ e(MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code)
+ })
+ }, isXboxConsoleAvailableInRegion: function _isXboxConsoleAvailableInRegion() {
+ var result = true;
+ result = this._getFeatureEnablement().isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.xbox360ConsoleRegions);
+ return result
+ }, isPlayToXboxFeatureEnabled: function _isPlayToXboxFeatureEnabled(mediaItem) {
+ var result = this.isXboxConsoleAvailableInRegion();
+ if (result)
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var featureEnablement = this._getFeatureEnablement();
+ if (mediaItem)
+ if (this.isTVEpisode(mediaItem))
+ result = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ else if (this.isMusicVideo(mediaItem))
+ result = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicVideosMarketplace);
+ else
+ result = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ else
+ result = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicVideosMarketplace))
+ }
+ return result
+ }, isClosedCaptionFeatureEnabled: function _isClosedCaptionFeatureEnabled() {
+ return this._getFeatureEnablement().isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.closedCaptionsEnabled) && MS.Entertainment.Utilities.isVideoApp
+ }, playMedia: function playMedia(mediaItem, showDetails, startPositionMsec) {
+ this.playMedia2(mediaItem, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, startPositionMsec: startPositionMsec, showImmersive: true, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: !showDetails
+ }
+ })
+ }, playMediaOnXbox: function playMediaOnXbox(mediaItem, titleId, deepLinkInfo, startPositionMsec) {
+ this.playMedia2(mediaItem, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.remoteLRC, titleId: titleId, autoPlay: true, deepLinkInfo: deepLinkInfo, startPositionMsec: startPositionMsec, showImmersive: true, showSmartGlassActivity: true, showAppBar: false, appBarHideTimeoutMS: MS.Entertainment.UI.Controls.BottomAppBar.defaultCompanionHideTimeoutMS, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.remoteLRC, startFullScreen: false
+ }
+ })
+ }, showImmersiveDetails: function showImmersiveDetails(mediaItem, showDetails, autoPlay, hub, options, sessionId, completeCallBack, titleId, deepLink, startPositionMsec) {
+ var immersiveOptions = {
+ startFullScreen: !showDetails, hub: hub, panelOptions: options, sessionId: sessionId
+ };
+ var playPreviewOnly = (mediaItem && mediaItem.playPreviewOnly) ? mediaItem.playPreviewOnly : false;
+ var playOptions = {
+ autoPlay: autoPlay, showImmersive: true, immersiveOptions: immersiveOptions, sessionId: sessionId, titleId: titleId, deepLink: deepLink, playPreviewOnly: playPreviewOnly, startPositionMsec: startPositionMsec, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.details
+ };
+ if (autoPlay)
+ this.playMedia2(mediaItem, playOptions);
+ else
+ this.showImmersive(mediaItem, immersiveOptions)
+ }, addToNowPlaying: function addToNowPlaying(mediaItem, collectionFilter, preventPlay) {
+ this.playMedia2(mediaItem, {
+ autoPlay: true, showAppBar: true, queueMedia: true, showImmersive: false, preservePlayContext: true, collectionFilter: collectionFilter, preventPlay: preventPlay
+ })
+ }, waitForTransportStateOrTimeout: function waitForTransportStateOrTimeout(tsToWaitFor, tmoMsec) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("+PlaybackHelpers::waitForTransportStateOrTimeout(" + tsToWaitFor + ", " + tmoMsec + ")");
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ var uberPromise = new WinJS.Promise(function _uberPromise(c, e, p) {
+ var tmoPromise = null;
+ var tsChanged = function _tsChanged(transportState) {
+ if (transportState === tsToWaitFor) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PlaybackHelpers::waitForTransportStateOrTimeout, tsChanged : " + transportState);
+ playbackSession.unbind("currentTransportState", tsChanged);
+ if (tmoPromise)
+ tmoPromise.cancel();
+ c()
+ }
+ else if (playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.error && playbackSession.errorDescriptor) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PlaybackHelpers::waitForTransportStateOrTimeout, playerState error");
+ playbackSession.unbind("currentTransportState", tsChanged);
+ if (tmoPromise)
+ tmoPromise.cancel();
+ c()
+ }
+ };
+ var tmoExpired = function _tmoExpired() {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PlaybackHelpers::waitForTransportStateOrTimeout, timed out");
+ playbackSession.unbind("currentTransportState", tsChanged);
+ c()
+ };
+ tmoPromise = WinJS.Promise.timeout(tmoMsec).then(tmoExpired);
+ playbackSession.bind("currentTransportState", tsChanged)
+ });
+ MS.Entertainment.Platform.Playback.Etw.traceString("-PlaybackHelpers::waitForTransportStateOrTimeout");
+ return uberPromise
+ }, playMedia2: function playMedia2(mediaItem, options) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ sessionMgr.nowPlayingSession.isPlayToReceiverSessionRunning = !!options.isPlayToReceiverSessionRunning;
+ var playOptions = options || {};
+ if (!mediaItem.activationFilePath) {
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayProtectedInApp();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayNonProtectedInApp()
+ }
+ if (playOptions.playContext) {
+ MS.Entertainment.Platform.PlaybackHelpers.assert(!playOptions.preservePlayContext, "preservePlayContext and playContext both supplied; the session playContext will not be changed.");
+ MS.Entertainment.Platform.PlaybackHelpers.assert(!playOptions.playContext.isSmartDJ || playOptions.playContext.artistSeed, "isSmartDJ parameter is set in the playback context, but no SmartDJ seed was specified.")
+ }
+ playOptions.autoPlay = (playOptions.autoPlay !== undefined) ? playOptions.autoPlay : true;
+ playOptions.showImmersive = (playOptions.showImmersive !== undefined) ? playOptions.showImmersive : false;
+ MS.Entertainment.Platform.PlaybackHelpers.playActionInitiated = true;
+ MS.Entertainment.Platform.PlaybackHelpers.lastPlaybackSource = playOptions.playbackSource || String.empty;
+ MS.Entertainment.Platform.Playback.Etw.traceString("+PlaybackHelpers::playMedia2" + ", autoPlay=" + playOptions.autoPlay + ", showImmersive=" + playOptions.showImmersive + ", showAppbar=" + playOptions.showAppBar + ", preventNavigateToDefault=" + playOptions.preventNavigateToDefault + ", callback=" + (playOptions.completeCallBack ? true : false));
+ var immersiveOptions = playOptions.immersiveOptions ? playOptions.immersiveOptions : {};
+ if (!playOptions.sessionId)
+ playOptions.sessionId = sessionMgr.primarySession.sessionId;
+ if (!playOptions.setOnly && !options.queueMedia && !playOptions.doNotNavigate && this.forceFullScreenNowPlaying) {
+ playOptions.showImmersive = true;
+ playOptions.showAppBar = false
+ }
+ if (mediaItem && mediaItem.playPreviewOnly)
+ playOptions.sessionId = MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ immersiveOptions.sessionId = playOptions.sessionId;
+ var validateExplicitPrivilege = true;
+ var doPlay = function doPlay(userCancelled) {
+ if (userCancelled)
+ return;
+ var navigationService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ MS.Entertainment.Platform.Playback.Etw.traceString("+PlaybackHelpers::doPlay");
+ this._validateMediaItem(mediaItem, validateExplicitPrivilege).then(function validateMediaItem_completed() {
+ MS.Entertainment.Platform.PlaybackHelpers._play(mediaItem, playOptions);
+ if (playOptions.navigateToDetailsPage)
+ MS.Entertainment.Platform.PlaybackHelpers.navigateToDetailsPage(playOptions.album ? playOptions.album : mediaItem);
+ if (playOptions.showImmersive)
+ MS.Entertainment.Platform.PlaybackHelpers.waitForTransportStateOrTimeout(MS.Entertainment.Platform.Playback.TransportState.starting, 2500).then(function _delayedShowImmersive() {
+ var playbackSession = sessionMgr.nowPlayingSession;
+ if (playbackSession.playerState !== MS.Entertainment.Platform.Playback.PlayerState.error)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(mediaItem, immersiveOptions);
+ else if (navigationService && !navigationService.currentPage)
+ navigationService.navigateToDefaultPage()
+ });
+ else if (!playOptions.preventNavigateToDefault)
+ if (navigationService && !navigationService.currentPage)
+ navigationService.navigateToDefaultPage();
+ if (!MS.Entertainment.Utilities.isApp2 && playOptions.showAppBar && !window.onNewMusicPage) {
+ var playbackSession = sessionMgr.nowPlayingSession;
+ var showPromise = null;
+ var appBarShown = false;
+ var showPromiseTimeoutMS = 1200;
+ var onPlaybackStarted = function showAppBarOnPlaybackStart(currentPlaybackState) {
+ if (currentPlaybackState === MS.Entertainment.Platform.Playback.TransportState.starting || currentPlaybackState === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ if (showPromise)
+ showPromise.cancel();
+ showAppBar()
+ }
+ else if (playbackSession.errorDescriptor)
+ playbackSession.unbind("currentTransportState", onPlaybackStarted)
+ };
+ var showAppBar = function showAppBar() {
+ if (appBarShown)
+ return;
+ appBarShown = true;
+ playbackSession.unbind("currentTransportState", onPlaybackStarted);
+ showPromise = null;
+ var appBarControl = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBarControl)
+ appBarControl.show((isNaN(playOptions.appBarHideTimeoutMS) ? MS.Entertainment.UI.Controls.BottomAppBar.defaultHideTimeoutMS : playOptions.appBarHideTimeoutMS))
+ };
+ showPromise = WinJS.Promise.timeout(showPromiseTimeoutMS).done(showAppBar);
+ playbackSession.bind("currentTransportState", onPlaybackStarted)
+ }
+ if (playOptions.completeCallBack)
+ playOptions.completeCallBack();
+ { }
+ }.bind(this));
+ MS.Entertainment.Platform.Playback.Etw.traceString("-PlaybackHelpers::doPlay")
+ }.bind(this);
+ doPlay();
+ MS.Entertainment.Platform.Playback.Etw.traceString("-PlaybackHelpers::playMedia2")
+ }, navigateToDetailsPage: function navigateToDetailsPage(mediaItem) {
+ if (MS.Entertainment.Utilities.isApp1 && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)) {
+ var actionId;
+ var actionParameter = {
+ data: mediaItem, isTrack: false
+ };
+ switch (mediaItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.artistDetailsNavigate;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate;
+ actionParameter.isTrack = true;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.playlistDetailsNavigate;
+ break;
+ default:
+ MS.Entertainment.UI.fail("Not a supported media type. Type: " + mediaItem.mediaType)
+ }
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var actionToExecute = actionService.getAction(actionId);
+ if (actionToExecute) {
+ actionToExecute.parameter = actionParameter;
+ actionToExecute.execute()
+ }
+ }
+ }, showImmersive: function showImmersive(mediaItem, immersiveOptions) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ immersiveOptions = immersiveOptions ? immersiveOptions : {};
+ immersiveOptions.startFullScreen = (immersiveOptions.startFullScreen !== undefined) ? immersiveOptions.startFullScreen : false;
+ if (!immersiveOptions.startFullScreen)
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMovie(mediaItem)) {
+ mediaItem.hydrate();
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.MovieDetailsRequest)
+ }
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(mediaItem) || MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(mediaItem) || MS.Entertainment.Platform.PlaybackHelpers.isTVSeries(mediaItem)) {
+ mediaItem.hydrate();
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.TVDetailsRequest)
+ }
+ if (!MS.Entertainment.Data.List.isListOrArray(mediaItem) && !MS.Entertainment.Data.MainQuery.isQuery(mediaItem))
+ immersiveOptions.mediaItem = mediaItem;
+ if (immersiveOptions.sessionId) {
+ if (!immersiveOptions.mediaItem) {
+ var playbackSession = sessionMgr.getSession(immersiveOptions.sessionId);
+ immersiveOptions.mediaItem = playbackSession.currentMedia
+ }
+ if (this.useFullScreenNowPlaying || this.forceFullScreenNowPlaying) {
+ var fullScreenNowPlayingOptions = null;
+ if (MS.Entertainment.Utilities.isVideoApp)
+ fullScreenNowPlayingOptions = {
+ mediaItem: immersiveOptions.mediaItem, showNotifications: false
+ };
+ immersiveOptions.startFullScreen = true;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.fullScreenNowPlaying, null, null, fullScreenNowPlayingOptions);
+ if (immersiveOptions.completeCallback)
+ immersiveOptions.completeCallback(true);
+ { };
+ return
+ }
+ }
+ if (immersiveOptions.mediaItem) {
+ var forcePageChange = true;
+ var currentPageIsSameImmersive = false;
+ if (immersiveOptions.overridePageChange !== undefined)
+ forcePageChange = immersiveOptions.overridePageChange;
+ else {
+ var currentLocation = MS.Entertainment.Utilities.getCurrentUserLocation();
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.Monikers") && currentLocation === MS.Entertainment.UI.Monikers.immersiveDetails) {
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ if (currentPage.options.mediaItem.isEqual && immersiveOptions.mediaItem.isChildOf && immersiveOptions.mediaItem.sharesParentWith) {
+ currentPageIsSameImmersive = currentPage.options.mediaItem.isEqual(immersiveOptions.mediaItem) || immersiveOptions.mediaItem.isChildOf(currentPage.options.mediaItem) || immersiveOptions.mediaItem.sharesParentWith(currentPage.options.mediaItem);
+ forcePageChange = !currentPageIsSameImmersive
+ }
+ }
+ }
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isMusicApp && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace) && immersiveOptions.sessionId)
+ immersiveOptions.hideBackButtonOnNavigate = true;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.immersiveDetails, null, null, immersiveOptions, forcePageChange);
+ if (currentPageIsSameImmersive && immersiveOptions.completeCallback)
+ immersiveOptions.completeCallback(false)
+ }
+ else if (immersiveOptions.forceNavigate)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.immersiveDetails, null, null, immersiveOptions, false);
+ else {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!navigationService.currentPage)
+ navigationService.navigateToDefaultPage();
+ if (immersiveOptions.completeCallback)
+ immersiveOptions.completeCallback(false);
+ { }
+ }
+ }, playToXbox: function playToXbox(mediaItem, provider, startPositionMsec) {
+ if (!mediaItem)
+ return;
+ var mediaItemModel = mediaItem;
+ var _getInfoAndLaunchCompanion = function _getInfoAndLaunchCompanion() {
+ var titleId = provider ? provider.partnerApplicationLaunchInfoList[0].TitleId : MS.Entertainment.Platform.LivingRoomCompanion.WellKnownTitleId.ze;
+ var deepLinkInfo = provider ? provider.partnerApplicationLaunchInfoList[0].deepLinkInfo : null;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var session = sessionMgr.primarySession;
+ if (mediaItemModel.mediaType === Microsoft.Entertainment.Queries.ObjectType.game)
+ titleId = mediaItemModel.titleId;
+ var launchInfo = "xboxsmartglass://launchTitle/?";
+ launchInfo += "titleId=" + titleId + "&mediaType=" + mediaItemModel.mediaType;
+ if (mediaItemModel.hasZuneId)
+ launchInfo += "&serviceId=" + mediaItemModel.zuneId;
+ else if (mediaItemModel.hasServiceId)
+ launchInfo += "&serviceId=" + mediaItemModel.serviceId;
+ if (deepLinkInfo)
+ launchInfo += "&deepLinkInfo=" + encodeURIComponent(deepLinkInfo);
+ if (startPositionMsec)
+ launchInfo += "&startPositionMsec=" + startPositionMsec;
+ launchInfo += "&firstAction=playnow";
+ var appAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ appAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppPlayToXbox;
+ appAction.parameter = {
+ uri: launchInfo, appendSource: true, appendGamerTag: true
+ };
+ appAction.execute()
+ }.bind(this);
+ if (!mediaItem.hydrated) {
+ var mediaItemModel = MS.Entertainment.ViewModels.MediaItemModel.augment(mediaItem);
+ if (mediaItemModel.hydrate)
+ mediaItemModel.hydrate().then(function _hydrated() {
+ _getInfoAndLaunchCompanion()
+ })
+ }
+ else
+ _getInfoAndLaunchCompanion()
+ }, playToXboxPauseLocalPlayback: function _playToXboxPauseLocalPlayback(mediaItem, provider, startPositionMsec) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionManager && sessionManager.primarySession.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying)
+ switch (sessionManager.primarySession.targetTransportState) {
+ case MS.Entertainment.Platform.Playback.TransportState.playing:
+ case MS.Entertainment.Platform.Playback.TransportState.starting:
+ case MS.Entertainment.Platform.Playback.TransportState.buffering:
+ sessionManager.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ break
+ }
+ this.playToXbox(mediaItem, provider, startPositionMsec)
+ }, playFromXbox: function playFromXbox(mediaItem, startPositionMsec) {
+ if (!mediaItem)
+ return;
+ MS.Entertainment.Platform.PlaybackHelpers.assert(mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video, "playFromXbox: only video can be transfered to X8");
+ var mediaItemModel = mediaItem;
+ function _getInfoAndLaunchX8() {
+ var launchInfo = "microsoftvideo://play/?id=" + mediaItemModel.serviceId;
+ if (startPositionMsec)
+ launchInfo += "&startPositionMsec=" + startPositionMsec;
+ var appAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ appAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppVideoApp;
+ appAction.parameter = {
+ uri: launchInfo, appendSource: true, appendGamerTag: true
+ };
+ appAction.execute()
+ }
+ if (!mediaItem.hydrated && !mediaItem.hasServiceId) {
+ var mediaItemModel = MS.Entertainment.ViewModels.MediaItemModel.augment(mediaItem);
+ if (mediaItemModel.hydrate)
+ mediaItemModel.hydrate().then(function _hydrated() {
+ _getInfoAndLaunchX8()
+ })
+ }
+ else
+ _getInfoAndLaunchX8()
+ }, showPlaybackError: function showPlaybackError(error) {
+ var title = String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE);
+ return MS.Entertainment.UI.Shell.showError(title, error.code)
+ }, showItemDetails: function showItemDetails(popOverOptions, immersiveOptions) {
+ var checkOffline = false;
+ var mediaItem = null;
+ var location = null;
+ var initialPreferences = null;
+ immersiveOptions = immersiveOptions || {};
+ var forceDetails = immersiveOptions.forceDetails || false;
+ var completeCallback = immersiveOptions.completeCallback || null;
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (popOverOptions && popOverOptions.dataContext) {
+ mediaItem = popOverOptions.dataContext.data;
+ location = popOverOptions.dataContext.location;
+ initialPreferences = popOverOptions.dataContext.preferences
+ }
+ MS.Entertainment.Platform.PlaybackHelpers.assert(mediaItem, "popOverOptions.dataContext.data required to show item details");
+ if (mediaItem) {
+ if (mediaItem.hasServiceId)
+ MS.Entertainment.Utilities.Telemetry.setCorrelationId(mediaItem.serviceId);
+ if (MS.Entertainment.Utilities.Telemetry.isCurrentPageSearchPage())
+ MS.Entertainment.Utilities.Telemetry.logSearchExit(mediaItem);
+ var showImmersive = false;
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ showImmersive = this.isMovie(mediaItem) || this.isTVSeries(mediaItem) || this.isTVSeason(mediaItem) || (this.isTVEpisode(mediaItem) && forceDetails);
+ checkOffline = true
+ }
+ else if (MS.Entertainment.Utilities.isMusicApp2)
+ if (this.isMusicArtist(mediaItem)) {
+ showImmersive = true;
+ mediaItem.fromCollection = popOverOptions.dataContext.location === MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection
+ }
+ if (checkOffline && !MS.Entertainment.UI.NetworkStatusService.isOnline() && showImmersive && location === MS.Entertainment.Data.ItemLocation.marketplace) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ else if (this.isMovie(mediaItem) && MS.Entertainment.Utilities.isVideoApp2)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.movieDetailsPage, null, null, {
+ mediaItem: mediaItem, completeCallback: completeCallback || null, initialPreferences: initialPreferences
+ }, true);
+ else if ((this.isTVSeries(mediaItem) || this.isTVSeason(mediaItem) || (this.isTVEpisode(mediaItem) && forceDetails)) && MS.Entertainment.Utilities.isVideoApp2) {
+ var model = new MS.Entertainment.Components.Video.TvDetailsModel;
+ model.start(mediaItem);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.tvDetailsPage, null, null, {
+ mediaItem: mediaItem, model: model, completeCallback: completeCallback || null
+ }, true)
+ }
+ else if (showImmersive)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(mediaItem, immersiveOptions);
+ else
+ MS.Entertainment.UI.Controls.PopOver.showPopOver(popOverOptions)
+ }
+ }, shouldDisplayRatingImage: function shouldDisplayRatingImage() {
+ var playbackSession = null;
+ var displayRatingImage = false;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionMgr && sessionMgr.nowPlayingSession && sessionMgr.primarySession)
+ playbackSession = sessionMgr.nowPlayingSession;
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ var currentRegion = globalizationManager.getRegion().toLowerCase();
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var supportedRegions = config.playback.videoRatingAvailable;
+ if ((supportedRegions.toLowerCase().indexOf(currentRegion.toLowerCase()) >= 0) && playbackSession && playbackSession.getProtectionState() !== MS.Entertainment.Platform.Playback.ProtectionState.unprotected)
+ displayRatingImage = true;
+ return displayRatingImage
+ }, getVideoRatingImageAsync: function getVideoRatingImageAsync() {
+ var playbackSession = null;
+ var ratingImage = String.empty;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ if (playbackSession && playbackSession.currentMedia && playbackSession.currentMedia.hasServiceId && playbackSession.currentMedia.ratingImage) {
+ ratingImage = playbackSession.currentMedia.ratingImage;
+ return WinJS.Promise.wrap(ratingImage)
+ }
+ else if (playbackSession.currentMedia.activationFilePath && playbackSession.getProtectionState() !== MS.Entertainment.Platform.Playback.ProtectionState.unprotected) {
+ var query = new MS.Entertainment.Data.Query.libraryVideos;
+ query.videoUrl = playbackSession.currentMedia.activationFilePath;
+ return query.execute().then(function getVideoComplete(q) {
+ return WinJS.Utilities.getMember("result.firstItem", q)
+ }, function getVideoError() {
+ return WinJS.Promise.as(ratingImage)
+ })
+ }
+ else
+ return WinJS.Promise.wrap(ratingImage)
+ }, _validateMediaItem: function _validateMediaItem(mediaItem, validateExplicitPrivilege) {
+ var validateAccountHasExplicitPrivilege = function validateAccountHasExplicitPrivilege() {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!validateExplicitPrivilege || signedInUser.hasExplicitPrivilege)
+ return WinJS.Promise.wrap();
+ else
+ return this.showPlaybackError(MS.Entertainment.Platform.Playback.makeParentallyBlockedError()).then(function () {
+ return WinJS.Promise.wrapError(error)
+ })
+ }.bind(this);
+ var validateGameMediaItem = function validateGameMediaItem() {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (signInService.isSignedIn)
+ return validateAccountHasExplicitPrivilege();
+ else
+ return signInService.signIn().then(function signin_completed() {
+ if (signInService.isSignedIn)
+ return validateAccountHasExplicitPrivilege();
+ else
+ return this.showPlaybackError(MS.Entertainment.Platform.Playback.Error.NS_E_EXPLICIT_CONTENT_SIGNIN_REQUIRED).then(function () {
+ return WinJS.Promise.wrapError(error)
+ })
+ }.bind(this))
+ }.bind(this);
+ if (mediaItem && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.game)
+ return validateGameMediaItem();
+ else
+ return WinJS.Promise.wrap()
+ }, _setProperty: function _setProperty(item, propertyName, propertyValue) {
+ if (propertyName in item)
+ item[propertyName] = propertyValue;
+ else
+ item.addProperty(propertyName, propertyValue)
+ }, _setMediaAvailability: function _setMediaAvailability(mediaItem, mediaAvailabilty) {
+ var mediaItems = Array.isArray(mediaItem) ? mediaItem : [mediaItem];
+ mediaItems.forEach(function setMediaAvailability(mediaItem) {
+ if (mediaItem.inCollection && mediaItem.fromCollection && (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.person || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist))
+ if (mediaAvailabilty || mediaItem._mediaAvailability)
+ this._setProperty(mediaItem, "_mediaAvailability", mediaAvailabilty)
+ }, this)
+ }, _play: function _play(mediaItem, options) {
+ MS.Entertainment.UI.Controls.assert(mediaItem, "PlayAction::_play. mediaItem argument is invalid");
+ MS.Entertainment.UI.Controls.assert(options, "PlayAction::_play. options argument is invalid");
+ if (mediaItem && options) {
+ var trackToSearchFor = options.track;
+ if (trackToSearchFor)
+ trackToSearchFor.playPreviewOnly = options.playPreviewOnly ? options.playPreviewOnly : false;
+ var compareTrackItem = function compareTrackItem() {
+ return this.data.isEqual(trackToSearchFor)
+ };
+ compareTrackItem.track = trackToSearchFor;
+ mediaItem.playPreviewOnly = !!options.playPreviewOnly;
+ mediaItem.enableFallbackToPreview = !!options.enableFallbackToPreview;
+ MS.Entertainment.Platform.Playback.Etw.traceString("+PlaybackHelpers::_play");
+ var ensurePreownedMediaAddedAsyncPromise = WinJS.Promise.wrap();
+ if (MS.Entertainment.Utilities.isVideoApp && mediaItem && !mediaItem.playPreviewOnly)
+ ensurePreownedMediaAddedAsyncPromise = MS.Entertainment.Platform.PurchaseHelpers.ensurePreownedMediaAddedAsync(mediaItem);
+ MS.Entertainment.Platform.Playback.Etw.traceString("+PlaybackHelpers::ensurePreownedMediaAddedAsyncPromise");
+ return ensurePreownedMediaAddedAsyncPromise.then(function ensurePreownedMediaAddedAsync_complete(dbResult) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("-PlaybackHelpers::ensurePreownedMediaAddedAsyncPromise");
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.setPrimarySession(options.sessionId);
+ playbackSession._ensureSession().done(function verifiedSessionIsInitialized() {
+ playbackSession.shuffle = options.shuffle !== undefined ? options.shuffle : playbackSession.shuffle;
+ playbackSession.smartDJSeed = options.smartDJSeed !== undefined ? options.smartDJSeed : null;
+ var startPositionMsec = 0 | options.startPositionMsec;
+ var autoPlay = (typeof options.autoPlay) === "boolean" ? options.autoPlay : playbackSession.autoPlay;
+ playbackSession.autoPlay = autoPlay;
+ if (options.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying) {
+ this._setMediaAvailability(mediaItem, options.collectionFilter);
+ if (options.queueMedia && !options.setOnly) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PlaybackHelpers queueItem: appending");
+ var getCountPromise = playbackSession.mediaCollection ? playbackSession.mediaCollection.getCount() : WinJS.Promise.wrap(0);
+ getCountPromise.done(function insertNewMedia(currentCount) {
+ playbackSession.insertAtEnd(null, mediaItem).done(function playIfPaused() {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PlaybackHelpers queueItem: append complete");
+ if (options.autoPlay && !options.preventPlay && (playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.paused || playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped || playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.unInitialize))
+ playbackSession.playAt(currentCount)
+ }, function errorWhileAppending(error) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PlaybackHelpers queueItem: error while appending " + JSON.stringify(error))
+ })
+ })
+ }
+ else {
+ playbackSession.setDataSource(mediaItem).done(function dataSourceSet(mediaCollection) {
+ if (!!options.setOnly) {
+ if (mediaCollection) {
+ var list = mediaCollection.createListBinding();
+ var index = options.offset || 0;
+ list.fromIndex(index).then(function first_in_collection(item) {
+ if (item) {
+ if (!item.data.hydrate) {
+ item.data.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ MS.Entertainment.ViewModels.MediaItemModel.augment(item.data)
+ }
+ var setCurrentMedia = function setCurrentMedia() {
+ playbackSession.autoPlay = false;
+ playbackSession.playAt(index)
+ };
+ if (!item.data.hydrated)
+ item.data.hydrate({ forceUpdate: true }).done(setCurrentMedia, setCurrentMedia);
+ else
+ setCurrentMedia()
+ }
+ list.release()
+ })
+ }
+ return
+ }
+ if (typeof (options.offset) !== "number" && options.offset < 0)
+ options.offset = null;
+ if (startPositionMsec > 0)
+ playbackSession.playAt(options.offset || 0, startPositionMsec);
+ else {
+ playbackSession.autoPlay = autoPlay;
+ if (options.offset === null)
+ playbackSession.activate(document.createElement("div"));
+ else if (!trackToSearchFor)
+ playbackSession.playAt(options.offset);
+ else
+ playbackSession.playAt(options.offset, 0, compareTrackItem)
+ }
+ }.bind(this), function dataSourceSetFailed(error) { });
+ if (!options.preservePlayContext && !options.queueMedia)
+ sessionMgr.playContext = options.playContext || {}
+ }
+ var isPlaylist = mediaItem.execute !== undefined || this.isMusicTrack(mediaItem) || this.isMusicAlbum(mediaItem) || this.isPerson(mediaItem) || this.isMusicPlaylist(mediaItem) || this.isMusicVideo(mediaItem) || (Array.isArray(mediaItem) && mediaItem.length > 0) || (MS.Entertainment.Data.List.isList(mediaItem) && mediaItem.count > 0) || (mediaItem.source && mediaItem.source.length > 1);
+ if ((options.saveNowPlaying === undefined || options.saveNowPlaying) && isPlaylist && !options.playPreviewOnly) {
+ if (MS.Entertainment.Platform.PlaybackHelpers._saveNowPlayingPromise) {
+ MS.Entertainment.Platform.PlaybackHelpers._saveNowPlayingPromise.cancel();
+ MS.Entertainment.Platform.PlaybackHelpers._saveNowPlayingPromise = null
+ }
+ MS.Entertainment.Platform.PlaybackHelpers._saveNowPlayingPromise = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers._saveNowPlayingTimeout).then(function saveNowPlaying() {
+ playbackSession.savePlaylist(null, true);
+ MS.Entertainment.Platform.PlaybackHelpers._saveNowPlayingPromise = null
+ })
+ }
+ }
+ else if (options.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.remoteLRC) {
+ if (!options.titleId)
+ options.titleId = MS.Entertainment.Platform.LivingRoomCompanion.WellKnownTitleId.ze;
+ sessionMgr.nowPlayingSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ MS.Entertainment.UI.Controls.ActivityOverlay.lastAutoLaunchId = null;
+ if (options.queueMedia)
+ playbackSession.insertAtEnd(null, mediaItem);
+ else
+ playbackSession.setDataSource(mediaItem, options.deepLinkInfo).then(function dataSourceSet() {
+ playbackSession.playAt(options.titleId, startPositionMsec, MS.Entertainment.Platform.LivingRoomCompanion.LaunchFirstAction.playNow)
+ }.bind(this))
+ }
+ MS.Entertainment.Platform.Playback.Etw.traceString("-PlaybackHelpers::_play")
+ }.bind(this), function sessionCannotBeInitialized(errorObj) {
+ MS.Entertainment.UI.Controls.assert(false, "Session initialization failure: " + JSON.stringify(errorObj))
+ })
+ }.bind(this), function ensurePreownedMediaAddedAsync_error(e) {
+ MS.Entertainment.UI.Controls.assert(false, "ensurePreownedMediaAddedAsync invoked the error handler.")
+ })
+ }
+ }, reloadNowPlaying: function reloadNowPlaying(startOnLoad) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var isSubscription = configurationManager.service.lastSignedInUserSubscription;
+ var firstFreeStringsLaunch = configurationManager.music.firstFreeStringsLaunch && !isSubscription;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (startOnLoad || (!firstFreeStringsLaunch && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind === Windows.ApplicationModel.Activation.ActivationKind.launch && !MS.Entertainment.Platform.PlaybackHelpers.playActionInitiated) && (!sessionMgr.nowPlayingSession || sessionMgr.nowPlayingSession.currentMedia === null)) {
+ var query = new MS.Entertainment.Data.Query.libraryPlaylists;
+ query.playlistType = Microsoft.Entertainment.Platform.PlaylistType.nowPlaying;
+ query.chunkSize = 1;
+ query.execute().then(function loadPlaylist(query) {
+ if (query.result.totalCount > 0)
+ query.result.items.toArray(0, 1).then(function playPlaylist(playlist) {
+ if (playlist.length >= 1 && (startOnLoad || !MS.Entertainment.Platform.PlaybackHelpers.playActionInitiated) && (!sessionMgr.nowPlayingSession || sessionMgr.nowPlayingSession.currentMedia === null)) {
+ var queryPromise = WinJS.Promise.as();
+ var mediaItemsQuery = null;
+ var playOptions = null;
+ if (playlist[0].count > 0) {
+ mediaItemsQuery = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ mediaItemsQuery.playlistId = playlist[0].libraryId;
+ playOptions = {
+ autoPlay: true, setOnly: !startOnLoad, saveNowPlaying: false, showAppBar: false, queueMedia: !startOnLoad, showImmersive: false, doNotNavigate: true, offset: Math.max((playlist[0].currentItemIndex || 0), 0)
+ };
+ sessionMgr.nowPlayingSession.pendingOrdinal = playOptions.offset
+ }
+ else if (playlist[0].smartDjSeed && MS.Entertainment.Utilities.isValidGuid(playlist[0].smartDjSeed))
+ queryPromise = MS.Entertainment.Platform.PlaybackHelpers.getMusicMediaByServiceId(playlist[0].smartDjSeed, MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsMediaType.musicArtist).then(function loadMedia(media) {
+ if (media) {
+ mediaItemsQuery = new MS.Entertainment.Data.Query.Music.SmartDJ;
+ mediaItemsQuery.id = media.canonicalId;
+ mediaItemsQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.smartDJ, Microsoft.Entertainment.Platform.AcquisitionContextType.artist, media.canonicalId);
+ playOptions = {
+ autoPlay: true, setOnly: !startOnLoad, saveNowPlaying: false, showAppBar: false, queueMedia: !startOnLoad, showImmersive: false, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.radio, smartDJSeed: media, doNotNavigate: true, playContext: {
+ artistSeed: media, isSmartDJ: true
+ }
+ }
+ }
+ });
+ var onPlayerStateChanged = function onPlayerStateChanged(currentPlayerState) {
+ if (!currentPlayerState)
+ return;
+ if (currentPlayerState === MS.Entertainment.Platform.Playback.PlayerState.notReady) {
+ if (!MS.Entertainment.Platform.PlaybackHelpers.playActionInitiated) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.adService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService).skipAudioAdForNextTrack = true;
+ if (mediaItemsQuery && playOptions)
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(mediaItemsQuery, playOptions);
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).engageVisible = true
+ }
+ }
+ else if (currentPlayerState === MS.Entertainment.Platform.Playback.PlayerState.error)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService).suppressNextPlaybackErrorDialog = true;
+ sessionMgr.primarySession.unbind("playerState", onPlayerStateChanged)
+ };
+ var primarySessionIdChanged = function primarySessionIdChanged() {
+ if (sessionMgr.primarySession) {
+ sessionMgr.primarySession.bind("playerState", onPlayerStateChanged);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).unbind("primarySessionId", primarySessionIdChanged)
+ }
+ };
+ queryPromise.done(function initializeBinding() {
+ if (mediaItemsQuery && playOptions)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).bind("primarySessionId", primarySessionIdChanged);
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).engageVisible = true
+ }, function onError(e) {
+ MS.Entertainment.fail("Error loading smartDj playlist: " + e.toString())
+ })
+ }
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).engageVisible = true
+ });
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).engageVisible = true
+ })
+ }
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).engageVisible = true;
+ if (firstFreeStringsLaunch)
+ configurationManager.music.firstFreeStringsLaunch = false
+ }, isMovie: function MediaInstance_isMovie(mediaItem) {
+ return MS.Entertainment.Utilities.isMovie(mediaItem)
+ }, isTVEpisode: function MediaInstance_isTVEpisode(mediaItem) {
+ return MS.Entertainment.Utilities.isTVEpisode(mediaItem)
+ }, isTVSeason: function MediaInstance_isTVSeason(mediaItem) {
+ return MS.Entertainment.Utilities.isTVSeason(mediaItem)
+ }, isTVSeries: function MediaInstance_isTVSeries(mediaItem) {
+ return MS.Entertainment.Utilities.isTVSeries(mediaItem)
+ }, isAnyTV: function MediaInstance_isTV(mediaItem) {
+ return MS.Entertainment.Utilities.isAnyTV(mediaItem)
+ }, isVideo: function MediaInstance_isVideo(mediaItem) {
+ return MS.Entertainment.Utilities.isVideo(mediaItem)
+ }, isMusicArtist: function MediaInstance_isMusicArtist(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.person);
+ return isType
+ }, isMusicVideo: function MediaInstance_isMusicVideo(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo);
+ return isType
+ }, isMusicTrack: function MediaInstance_isMusicTrack(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track) || (MS.Entertainment.Data.MediaBrowser && (mediaItem.mediaType === MS.Entertainment.Data.MediaBrowser.ItemType.music));
+ return isType
+ }, isMusicTrackOrMusicVideo: function MediaInstance_isMusicTrackOrMusicVideo(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(mediaItem) || MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(mediaItem));
+ return isType
+ }, isMusicAlbum: function MediaInstance_isMusicAlbum(mediaItem) {
+ if (mediaItem)
+ return (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ }, isMusicPlaylist: function MediaInstance_isMusicPlaylist(mediaItem) {
+ if (mediaItem)
+ return (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist)
+ }, isMusicOrMusicVideo: function MediaInstance_isMusicOrMusicVideo(mediaItem) {
+ if (mediaItem)
+ return this.isMusicTrack(mediaItem) || this.isMusicAlbum(mediaItem) || this.isMusicVideo(mediaItem) || this.isMusicPlaylist(mediaItem)
+ }, isAnyMusic: function MediaInstance_isAnyMusic(mediaItem) {
+ if (mediaItem)
+ return this.isMusicTrack(mediaItem) || this.isMusicAlbum(mediaItem) || this.isMusicVideo(mediaItem) || this.isMusicArtist(mediaItem) || this.isMusicPlaylist(mediaItem)
+ }, isGame: function MediaInstance_isGame(mediaItem) {
+ if (mediaItem)
+ return (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.game)
+ }, isPerson: function MediaInstance_isPerson(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.person);
+ return isType
+ }, forceFullScreenNowPlaying: {
+ get: function () {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ return (!uiState.isSnapped && MS.Entertainment.Utilities.isMusicApp2) || MS.Entertainment.Utilities.isVideoApp
+ }
+ }, useFullScreenNowPlaying: {
+ get: function () {
+ return MS.Entertainment.Utilities.isMusicApp2 || MS.Entertainment.Utilities.isVideoApp
+ }
+ }, PlaybackSource: {
+ fileActivation: "fileActivation", details: "details", radio: "radio", playlist: "playlist", playTo: "playTo", deeplink: "deeplink", postRoll: "postRoll", resumeApp: "resumeApp"
+ }, _saveNowPlayingTimeout: 10000, _saveNowPlayingPromise: null, deferredUpdateTimeout: 100, playActionInitiated: false, lastPlaybackSource: ""
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ RemoveFromPlaybackSession: MS.Entertainment.deferredDerive("MS.Entertainment.UI.ToolbarAction", function RemoveFromPlaybackSession() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.playlistRemoveFromNowPlaying, executed: function executed(param) {
+ param = this.transformParameter(param);
+ var keyPromise;
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ if (param && param.mediaItem && param.mediaItem.mediaCollection)
+ if (param.key)
+ keyPromise = WinJS.Promise.wrap(param.key);
+ else if (param.mediaItem.mediaCollection.itemFromIndex)
+ keyPromise = param.mediaItem.mediaCollection.itemFromIndex(param.offset).then(function gotItem(item) {
+ return item.key
+ });
+ if (keyPromise)
+ keyPromise.then(function gotKey(key) {
+ if (mediaContext)
+ mediaContext.dispatchEvent(MS.Entertainment.UI.AppBarActions.removeFromNowPlaying, param);
+ param.mediaItem.mediaCollection.remove(key)
+ }, function failedToGetKey(error) {
+ if (mediaContext)
+ mediaContext.dispatchEvent(MS.Entertainment.UI.AppBarActions.removeFromNowPlaying, param);
+ MS.Entertainment.Platform.PlaybackHelpers.fail("Failed to remove item from now playing. Error message " + error && error.message)
+ })
+ }, transformParameter: function transformParameter(parameter) {
+ return parameter
+ }, canExecute: function canExecute(param) {
+ param = this.transformParameter(param);
+ var canExecute = !!param && MS.Entertainment.Platform.Playback.PlaybackSession.isPlaybackSession(param.mediaItem) && !!param.mediaItem.mediaCollection && (!!param.key || (typeof param.offset === "number" & param.offset >= 0));
+ return canExecute
+ }
+ }), PlayMedia: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function PlayMedia() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.playMedia, executed: function executed(param) {
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.PlayCommand);
+ var isImmersive = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ isImmersive = navigationService.checkUserLocation(MS.Entertainment.UI.Monikers.immersiveDetails)
+ }
+ var playContext = {};
+ if (param.artistSeed) {
+ playContext.artistSeed = param.artistSeed;
+ playContext.isSmartDJ = param.isSmartDJ
+ }
+ else if (param.playlist)
+ playContext.playlist = param.playlist;
+ else if (param.mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist)
+ playContext.playlist = param.mediaItem;
+ var playbackSource = String.empty;
+ if (playContext.isSmartDJ)
+ playbackSource = MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.radio;
+ else if (playContext.playlist)
+ playbackSource = MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.playlist;
+ if (MS.Entertainment.Platform.Playback.PlaybackSession.isPlaybackSession(param.mediaItem)) {
+ var playbackEventNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackEventNotifications);
+ playbackEventNotifications.clearErrors();
+ var playbackSession = param.mediaItem;
+ playbackSession.autoPlay = true;
+ playbackSession.playAt(param.offset || 0)
+ }
+ else {
+ if (param.playPreviewOnly)
+ param.mediaItem.playPreviewOnly = param.playPreviewOnly;
+ else
+ param.mediaItem.playPreviewOnly = false;
+ var mediaItem;
+ if (param.playMusicVideo)
+ mediaItem = param.mediaItem.musicVideo;
+ else {
+ mediaItem = param.mediaItem;
+ mediaItem.mediaAvailability = param.collectionFilter
+ }
+ var isFilteredCollection = !!param.collectionFilter && param.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available && param.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.undefined;
+ MS.Entertainment.UI.Actions.assert(!(mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album && isFilteredCollection && param.playPreviewOnly), "Applying a filter and requesting preview only on an album hasn't been validated to work. You are attempting to do this. Please verify this works");
+ var album;
+ if (!isFilteredCollection && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album && !param.dontUseTrackListForPlayback && mediaItem.tracks) {
+ album = mediaItem;
+ mediaItem = mediaItem.tracks
+ }
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayProtectedInApp();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayNonProtectedInApp();
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(mediaItem, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, saveNowPlaying: true, startPositionMsec: param.startPositionMS, showImmersive: !!param.showImmersive, showAppBar: (!!param.showAppBar && !isImmersive), shuffle: param.shuffle, queueMedia: !!param.queueMedia, playbackSource: playbackSource, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: !param.showDetails, overridePageChange: param.overridePageChange
+ }, offset: param.offset, track: param.track, playContext: playContext, playPreviewOnly: param.playPreviewOnly, preservePlayContext: param.preservePlayContext, collectionFilter: param.collectionFilter, album: album, navigateToDetailsPage: param.navigateToDetailsPage, enableFallbackToPreview: !!param.enableFallbackToPreview
+ })
+ }
+ }.bind(this), canExecute: function canExecute(param) {
+ return param && param.mediaItem && (!param.playMusicVideo || param.mediaItem.hasMusicVideoId)
+ }
+ }), ShuffleNowPlaying: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function ShuffleNowPlaying() {
+ this.base()
+ }, {
+ forceTitleChange: true, automationId: MS.Entertainment.UI.AutomationIds.transportShuffle, executed: function executed(param) {
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ playbackSession.shuffle = !playbackSession.shuffle;
+ if (!param || !param.ignoreLabel)
+ this.title = playbackSession.shuffle ? String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON)
+ }, canExecute: function canExecute(param) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ return !!(sessionMgr && sessionMgr.nowPlayingSession && sessionMgr.nowPlayingSession.canShuffle)
+ }
+ }), RepeatNowPlaying: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function RepeatNowPlaying() {
+ this.base()
+ }, {
+ forceTitleChange: true, automationId: MS.Entertainment.UI.AutomationIds.transportRepeat, executed: function executed(param) {
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ playbackSession.repeat = !playbackSession.repeat;
+ this.title = playbackSession.repeat ? String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON)
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ }), ShowItemDetails: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function showItemDetails() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.showItemDetails, executed: function executed(popOverParameters) {
+ if (popOverParameters && popOverParameters.clearBackStack && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.clearBackStackOnNextNavigate(true)
+ }
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ }), SkipBackward: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function skipBackward() {
+ this.base();
+ this.executed = this.executed.bind(this);
+ this.canExecute = this.canExecute.bind(this)
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.playbackSkipBackward, executed: function executed() {
+ var session = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ if (session)
+ session.skipBack()
+ }, canExecute: function canExecute() {
+ var session = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ return !!(session && session.canSkipBackward)
+ }
+ }), SkipForward: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function skipForward() {
+ this.base();
+ this.executed = this.executed.bind(this);
+ this.canExecute = this.canExecute.bind(this)
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.playbackSkipForward, executed: function executed() {
+ var session = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ if (session)
+ session.skipFwd()
+ }, canExecute: function canExecute() {
+ var session = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ return !!(session && session.canSkipForward)
+ }
+ }), ToggleMusicVideoPlayback: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function toggleMusicVideoPlayback() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.toggleMusicVideoPlayback, executed: function executed() {
+ var session = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ if (session)
+ session.musicVideosEnabled = !session.musicVideosEnabled
+ }, canExecute: function canExecute() {
+ var session = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ return !!(session)
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.playMedia, function () {
+ return new MS.Entertainment.UI.Actions.PlayMedia
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.removeFromPlaybackSession, function () {
+ return new MS.Entertainment.UI.Actions.RemoveFromPlaybackSession
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.shuffleNowPlaying, function () {
+ return new MS.Entertainment.UI.Actions.ShuffleNowPlaying
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.repeatNowPlaying, function () {
+ return new MS.Entertainment.UI.Actions.RepeatNowPlaying
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.showItemDetails, function () {
+ return new MS.Entertainment.UI.Actions.ShowItemDetails
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.skipBackward, function () {
+ return new MS.Entertainment.UI.Actions.SkipBackward
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.skipForward, function () {
+ return new MS.Entertainment.UI.Actions.SkipForward
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.toggleMusicVideoPlayback, function () {
+ return new MS.Entertainment.UI.Actions.ToggleMusicVideoPlayback
+ })
+ })()
+})();
+/* >>>>>>/framework/endpoints.js:30876 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment", {
+ Endpoint: {
+ id: Microsoft.Entertainment.Util.Endpoints.EndpointId, load: function load(endpointId) {
+ var endpointManager = new Microsoft.Entertainment.Util.EndpointManager;
+ return endpointManager.getEndpointUri(endpointId)
+ }, getCulture: function getCulture() {
+ var endpointManager = new Microsoft.Entertainment.Util.EndpointManager;
+ return endpointManager.getEndpointCulture()
+ }
+ }
+ })
+ })()
+})();
+/* >>>>>>/components/music/cloudcollectionservice.js:30893 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment", {
+ CloudCollectionService: MS.Entertainment.UI.Framework.define(function CloudCollectionServiceConstructor() {
+ this._configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this._isSyncFeatureEnabled) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var onSignInStateChange = this._onSignInStateChange.bind(this);
+ WinJS.Binding.bind(signInService, { isSignedIn: onSignInStateChange });
+ WinJS.Binding.bind(signedInUserService, { isSubscription: onSignInStateChange })
+ }
+ }, {
+ _isAvailable: false, _isEnabled: false, _isFeatureEnabled: false, _autoDownloadEnabled: false, _cloudMatchStatus: false, _shouldDownloadOnAdd: true, _syncManagerStorage: null, _syncManager: {
+ get: function cloudCollectionService_getSyncManager() {
+ if (!this._syncManagerStorage)
+ this._syncManagerStorage = new Microsoft.Entertainment.Sync.SyncManager;
+ return this._syncManagerStorage
+ }
+ }, _configurationManager: null, _listeningToSyncManagerEvents: false, _displayedAnyErrors: false, startListening: function startListening() {
+ if (this._isSyncFeatureEnabled && !this._listeningToSyncManagerEvents && this._syncManager) {
+ this._syncManager.addEventListener("collectionsyncend", this._onCollectionSyncEnd.bind(this), false);
+ this._listeningToSyncManagerEvents = true
+ }
+ }, isAvailable: {
+ get: function getIsAvailable() {
+ return this._isAvailable
+ }
+ }, isFeatureEnabled: {
+ get: function getIsFeatureEnabled() {
+ return this._isFeatureEnabled
+ }
+ }, isV2Enabled: {
+ get: function getIsV2Enabled() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled)
+ }
+ }, isEnabled: {
+ get: function getIsEnabled() {
+ return this._isEnabled
+ }, set: function setIsEnabled(newValue) {
+ if (this._isEnabled !== newValue) {
+ this._configurationManager.sync.cloudCollectionEnabled = newValue;
+ this._isEnabled = newValue;
+ this._updateIsEnabledState();
+ this._updateAutoDownloadEnabledState()
+ }
+ }
+ }, isDeduplicationUIEnabled: {
+ get: function getIsDeduplicationUIEnabled() {
+ return this._configurationManager.sync.cloudCollectionV2DeduplicationStrategyUI
+ }
+ }, isCloudMatchOptedIn: {
+ get: function getCloudMatchOptedIn() {
+ return this._cloudMatchStatus === MS.Entertainment.CloudCollectionService.CloudMatchStatus.OptedIn
+ }
+ }, isCloudMatchOptedOut: {
+ get: function getCloudMatchOptedOut() {
+ return this._cloudMatchStatus === MS.Entertainment.CloudCollectionService.CloudMatchStatus.OptedOut
+ }
+ }, isCloudMatchNotApplicable: {
+ get: function getCloudMatchNotApplicable() {
+ return this._cloudMatchStatus === MS.Entertainment.CloudCollectionService.CloudMatchStatus.NotApplicable
+ }
+ }, isDeduplicationStrategyActive: {
+ get: function getDeduplicationStrategyActivate() {
+ return this._configurationManager.sync.cloudCollectionV2DeduplicationStrategy === MS.Entertainment.CloudCollectionService.DeduplicationStrategy.activated
+ }
+ }, autoDownloadEnabled: {
+ get: function getAutoDownloadEnabled() {
+ return this._autoDownloadEnabled
+ }, set: function setAutoDownloadEnabled(newValue) {
+ if (this._autoDownloadEnabled !== newValue) {
+ this._configurationManager.sync.keepCloudCollectionOffline = newValue;
+ this._autoDownloadEnabled = newValue;
+ this._updateAutoDownloadEnabledState();
+ this.requestSync()
+ }
+ }
+ }, shouldDownloadOnAdd: {
+ get: function getShouldDownloadOnAdd() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signIn.isSignedIn && signedInUser.isSubscription) {
+ this._shouldDownloadOnAdd = this._configurationManager.music.musicPassDownloadEnabled;
+ if (this.isEnabled)
+ this._shouldDownloadOnAdd |= this.autoDownloadEnabled
+ }
+ else
+ this._shouldDownloadOnAdd = false;
+ return this._shouldDownloadOnAdd
+ }
+ }, _updateIsAvailableState: function _updateIsAvailableState() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.storeSync))
+ this._isAvailable = true
+ }, _updateIsEnabledState: function _updateIsEnabledState(skipSync) {
+ this._isEnabled = this.isAvailable && this._isEnabled;
+ if (this._isEnabled && !skipSync) {
+ var syncDelay = MS.Entertainment.Utilities.isMusicApp2 ? 5000 : 0;
+ WinJS.Promise.timeout(syncDelay).done(this.requestSync.bind(this))
+ }
+ }, _updateIsFeatureEnabledState: function _updateIsFeatureEnabledState() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.storeSync))
+ this._isFeatureEnabled = true;
+ else
+ this._isFeatureEnabled = false
+ }, _updateAutoDownloadEnabledState: function _updateAutoDownloadEnabledState() {
+ this._autoDownloadEnabled = this.isEnabled && this._autoDownloadEnabled
+ }, _isSyncFeatureEnabled: {
+ get: function get_isSyncFeatureEnabled() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return (featureEnablement && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.storeSync))
+ }
+ }, requestSync: function requestSync() {
+ if (!this._syncManager) {
+ var syncManager = new Microsoft.Entertainment.Sync.SyncManager;
+ this._syncManager = syncManager
+ }
+ this._syncManager.requestSync(Microsoft.Entertainment.Sync.RequestSyncOption.checkIfDirty)
+ }, _onSignInStateChange: function _signInStateChanged(newSignInValue, oldSignInValue) {
+ var shouldSkipSync = oldSignInValue === undefined;
+ if (oldSignInValue !== newSignInValue) {
+ this._isAvailable = false;
+ this._isEnabled = this._configurationManager.sync.cloudCollectionEnabled;
+ this._cloudMatchStatus = this._configurationManager.shell.cloudMatching;
+ this._autoDownloadEnabled = this._configurationManager.sync.keepCloudCollectionOffline;
+ this._updateIsAvailableState();
+ this._updateIsEnabledState(shouldSkipSync);
+ this._updateAutoDownloadEnabledState();
+ this._updateIsFeatureEnabledState()
+ }
+ }, setCloudMatchOptIn: function setCloudMatchOptIn(matchStatus) {
+ if (this._cloudMatchStatus !== matchStatus) {
+ this._configurationManager.shell.cloudMatching = matchStatus;
+ this._configurationManager.sync.syncBlockedItems = (matchStatus === MS.Entertainment.CloudCollectionService.CloudMatchStatus.OptedIn);
+ if (this.isAvailable && this.isEnabled && matchStatus === MS.Entertainment.CloudCollectionService.CloudMatchStatus.OptedIn)
+ this.requestSync();
+ this._cloudMatchStatus = matchStatus
+ }
+ }, clearCloudMatchOptIn: function clearCloudMatchOptIn() {
+ this._configurationManager.shell.cloudMatching = MS.Entertainment.CloudCollectionService.CloudMatchStatus.Unknown;
+ this._cloudMatchStatus = MS.Entertainment.CloudCollectionService.CloudMatchStatus.Unknown
+ }, activateDeduplicationStrategy: function activateDeduplicationStrategy() {
+ this._setDeduplicationStrategy(MS.Entertainment.CloudCollectionService.DeduplicationStrategy.activated)
+ }, deactivateDeduplicationStrategy: function deactivateDeduplicationStrategy() {
+ this._setDeduplicationStrategy(MS.Entertainment.CloudCollectionService.DeduplicationStrategy.deactivated)
+ }, _setDeduplicationStrategy: function setDeduplicationStrategy(deduplicationStrategy) {
+ if (this._configurationManager.sync.cloudCollectionV2DeduplicationStrategy !== deduplicationStrategy) {
+ this._configurationManager.sync.cloudCollectionV2DeduplicationStrategy = deduplicationStrategy;
+ this.requestSync()
+ }
+ }, _onCollectionSyncEnd: function _onCollectionSyncEnd(errors) {
+ if (errors) {
+ if (!this._displayedAnyErrors)
+ errors.forEach(this._sendSyncErrorNotification.bind(this));
+ if (errors.size === 0 && this._displayedAnyErrors)
+ this._getAppNotificationService().removeNotificationByCategory(this._syncErrorNotificationCategory)
+ }
+ else if (this._displayedAnyErrors)
+ this._getAppNotificationService().removeNotificationByCategory(this._syncErrorNotificationCategory)
+ }, _sendSyncErrorNotification: function _sendSyncErrorNotification(error) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appNotification)) {
+ var notificationTitle;
+ var notificationSubTitle = String.load(String.id.IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT);
+ switch (error) {
+ case Microsoft.Entertainment.Sync.CollectionSyncError.collectionFull:
+ notificationTitle = String.load(String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER);
+ break;
+ case Microsoft.Entertainment.Sync.CollectionSyncError.maxPlaylistsReached:
+ notificationTitle = String.load(String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER);
+ break;
+ default:
+ return
+ }
+ this._displayedAnyErrors = true;
+ var notification = new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Critical, title: notificationTitle, subTitle: notificationSubTitle, icon: MS.Entertainment.UI.Icon.inlineError, action: this._showSyncError.bind(this, error), category: this._syncErrorNotificationCategory, isPersistent: true, dismissOnSignOut: true
+ });
+ this._getAppNotificationService().send(notification)
+ }
+ }, _showSyncError: function _showSyncError(error) {
+ var dialogTitle;
+ var dialogMessage;
+ switch (error) {
+ case Microsoft.Entertainment.Sync.CollectionSyncError.collectionFull:
+ dialogTitle = String.load(String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE);
+ var maxTracksInCollection = this._configurationManager.sync.maxTracksInCollection;
+ dialogMessage = String.load(String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE).format(maxTracksInCollection);
+ MS.Entertainment.UI.Shell.showMessageBox(dialogTitle, dialogMessage);
+ break;
+ case Microsoft.Entertainment.Sync.CollectionSyncError.maxPlaylistsReached:
+ dialogTitle = String.load(String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE);
+ var maxPlayListsInCollection = this._configurationManager.groveler.maxPlaylistsInCollection;
+ dialogMessage = String.load(String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE).format(maxPlayListsInCollection);
+ MS.Entertainment.UI.Shell.showMessageBox(dialogTitle, dialogMessage);
+ break;
+ default:
+ return
+ }
+ this.requestSync()
+ }, _getAppNotificationService: function _getAppNotificationService() {
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification)
+ }, _syncErrorNotificationCategory: "SyncErrorNotification"
+ }, {
+ factory: function factory() {
+ return new MS.Entertainment.CloudCollectionService
+ }, CloudMatchStatus: {
+ Unknown: 0, OptedIn: 1, OptedOut: 2, NotApplicable: 3
+ }, DeduplicationStrategy: {
+ notSpecified: 0, choiceRequired: 1, activated: 2, deactivated: 3
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.cloudCollection, MS.Entertainment.CloudCollectionService.factory)
+ })()
+})();
+/* >>>>>>/framework/accutils.js:31090 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ KeyboardInteractionListener: MS.Entertainment.UI.Framework.define(function KeyboardInteractionListener() {
+ var keyboardHandler = this._onKeyDown.bind(this);
+ var mouseHandler = this._onMouseDown.bind(this);
+ var focusInHandler = this._handleFocusIn.bind(this);
+ var focusOutHandler = this._handleFocusOut.bind(this);
+ var keyDownHandler = this.handleKeyDown.bind(this);
+ var keyUpHandler = this._handleKeyUp.bind(this);
+ var pointerDownHandler = this._handlePointerDown.bind(this);
+ var pointerUpHandler = this._handlePointerUp.bind(this);
+ var pointOutHandler = this._handlePointerOut.bind(this);
+ var gestureEngagedHandler = this._gestureEngagedHandler.bind(this);
+ var gestureDisengagedHandler = this._gestureDisengagedHandler.bind(this);
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = MS.Entertainment.Utilities.isApp2;
+ document.addEventListener("keydown", keyboardHandler, true);
+ document.addEventListener("MSPointerDown", mouseHandler, false);
+ document.addEventListener("pointerdown", mouseHandler, false);
+ if (MS.Entertainment.Utilities.isApp2) {
+ document.addEventListener("MSPointerMove", mouseHandler, false);
+ document.addEventListener("MSPointerHover", mouseHandler, false);
+ document.addEventListener("pointermove", mouseHandler, false);
+ document.addEventListener("pointerhover", mouseHandler, false);
+ document.addEventListener("keydown", keyDownHandler, true);
+ document.addEventListener("keyup", keyUpHandler, true);
+ document.addEventListener("MSPointerDown", pointerDownHandler, false);
+ document.addEventListener("MSPointerUp", pointerUpHandler, false);
+ document.addEventListener("MSPointerOut", pointOutHandler, false);
+ window.addEventListener("focusin", focusInHandler, false);
+ window.addEventListener("focusout", focusOutHandler, false);
+ window.addEventListener("gestureengaged", gestureEngagedHandler, false);
+ window.addEventListener("gesturedisengaged", gestureDisengagedHandler, false);
+ this._documentLastHadFocus = document.hasFocus()
+ }
+ if (WinJS.Utilities.hasWinRT) {
+ var commandUI = Windows.UI.Input.EdgeGesture.getForCurrentView();
+ commandUI.addEventListener("completed", this._onAppBarGesture.bind(this))
+ }
+ }, {
+ _keyboardStyleSet: false, _mouseStyleSet: false, _mouseHoverTimeout: null, _mouseHoverResetTime: 10000, _documentLastHadFocus: false, _onKeyDown: function KeyboardInteractionListener_onKeyDown(evt) {
+ this.lastInputType = MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.keyboard;
+ if (!this._keyboardStyleSet && MS.Entertainment.Framework.KeyboardInteractionListener._isKeyboardNavigationEvent(evt))
+ this._setKeyboardMode(evt)
+ }, _setKeyboardMode: function _setKeyboardMode(evt) {
+ this._keyboardStyleSet = true;
+ this._mouseStyleSet = false;
+ WinJS.Utilities.addClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = true;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nuiEngaged = false
+ }, _onAppBarGesture: function _onAppBarGesture(evt) {
+ if (evt && evt.kind === Windows.UI.Input.EdgeGestureKind.keyboard) {
+ this._keyboardStyleSet = true;
+ WinJS.Utilities.addClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = true
+ }
+ }, _onMouseDown: function KeyboardInteractionListener_onMouseDown(evt) {
+ this.lastInputType = MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.mouse;
+ if (!this._mouseStyleSet) {
+ this._keyboardStyleSet = false;
+ this._mouseStyleSet = true;
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.addClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ if (MS.Entertainment.Utilities.isApp2) {
+ if (this._mouseHoverTimeout)
+ this._mouseHoverTimeout.cancel();
+ this._mouseHoverTimeout = WinJS.Promise.timeout(this._mouseHoverResetTime).then(this._setKeyboardMode.bind(this))
+ }
+ }
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nuiEngaged = true
+ }, _handleFocusIn: function _handleFocusIn(evt) {
+ var documentHasFocus = document.hasFocus();
+ if (documentHasFocus && !this._documentLastHadFocus) {
+ this._setKeyboardMode();
+ WinJS.Utilities.removeClass(document.body, "win-visiblebutnotfocused");
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).visibleButNotFocused = false
+ }
+ this._documentLastHadFocus = documentHasFocus
+ }, _handleFocusOut: function _handleFocusOut(evt) {
+ var documentHasFocus = document.hasFocus();
+ if (!documentHasFocus) {
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ this._keyboardStyleSet = false;
+ this._mouseStyleSet = false;
+ WinJS.Utilities.addClass(document.body, "win-visiblebutnotfocused");
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).visibleButNotFocused = true
+ }
+ this._documentLastHadFocus = documentHasFocus
+ }, handleKeyDown: function handleKeyDown(evt) {
+ if (document.activeElement && (evt.key === "Spacebar" || evt.key === "Enter" || evt.keyCode === WinJS.Utilities.Key.invokeButton) && !evt.repeat)
+ WinJS.Utilities.addClass(document.activeElement, "win-itemcontainer-active")
+ }, _handleKeyUp: function _handleKeyUp(evt) {
+ if ((evt.key === "Spacebar" || evt.key === "Enter" || evt.keyCode === WinJS.Utilities.Key.invokeButton) && !evt.repeat)
+ MS.Entertainment.Framework.KeyboardInteractionListener._cleanUpActiveItemContainers()
+ }, _handlePointerDown: function _handlePointerDown() {
+ this.lastInputType = MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.touch;
+ if (document.activeElement)
+ WinJS.Utilities.addClass(document.activeElement, "win-itemcontainer-active")
+ }, _handlePointerUp: function _handlePointerUp() {
+ MS.Entertainment.Framework.KeyboardInteractionListener._cleanUpActiveItemContainers()
+ }, _handlePointerOut: function _handlePointerOut() {
+ MS.Entertainment.Framework.KeyboardInteractionListener._cleanUpActiveItemContainers()
+ }, _gestureEngagedHandler: function _gestureEngagedHandler() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).gestureEngaged = true
+ }, _gestureDisengagedHandler: function _gestureDisengagedHandler() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).gestureEngaged = false
+ }, lastInputType: -1
+ }, {
+ LastInputType: {
+ unknown: -1, mouse: 1, keyboard: 2, touch: 3
+ }, keyboardFocusClassName: "showKeyboardFocus", mouseHoverClassName: "showPointerHover", showKeyboardFocus: false, instance: null, _cleanUpActiveItemContainers: function _cleanUpActiveItemContainers() {
+ WinJS.Utilities.query(".win-itemcontainer-active").forEach(function (item) {
+ WinJS.Utilities.removeClass(item, "win-itemcontainer-active")
+ })
+ }, _isKeyboardNavigationEvent: function _isKeyboardNavigationEvent(evt) {
+ if (evt.keyCode === WinJS.Utilities.Key.tab)
+ return true;
+ else if (evt.keyCode === WinJS.Utilities.Key.leftArrow || evt.keyCode === WinJS.Utilities.Key.rightArrow || evt.keyCode === WinJS.Utilities.Key.downArrow || evt.keyCode === WinJS.Utilities.Key.upArrow || evt.keyCode === WinJS.Utilities.Key.home || evt.keyCode === WinJS.Utilities.Key.end || evt.keyCode === WinJS.Utilities.Key.pageUp || evt.keyCode === WinJS.Utilities.Key.pageDown || evt.keyCode === WinJS.Utilities.Key.escape || evt.keyCode === WinJS.Utilities.Key.backspace || evt.keyCode === WinJS.Utilities.Key.leftArrow || evt.keyCode === WinJS.Utilities.Key.lArrow || evt.keyCode === WinJS.Utilities.Key.lOtherArrow || evt.keyCode === WinJS.Utilities.Key.rightArrow || evt.keyCode === WinJS.Utilities.Key.rArrow || evt.keyCode === WinJS.Utilities.Key.rOtherArrow || evt.keyCode === WinJS.Utilities.Key.upArrow || evt.keyCode === WinJS.Utilities.Key.uArrow || evt.keyCode === WinJS.Utilities.Key.uOtherArrow || evt.keyCode === WinJS.Utilities.Key.downArrow || evt.keyCode === WinJS.Utilities.Key.dArrow || evt.keyCode === WinJS.Utilities.Key.dOtherArrow)
+ return !MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement);
+ return false
+ }, init: function KeyboardInteractionListener_init() {
+ if (!MS.Entertainment.Framework.KeyboardInteractionListener.instance)
+ MS.Entertainment.Framework.KeyboardInteractionListener.instance = new MS.Entertainment.Framework.KeyboardInteractionListener
+ }, wasLastInputMouse: {
+ get: function KeyboardInteractionListener_get_wasLastInputMouse() {
+ var instance = MS.Entertainment.Framework.KeyboardInteractionListener.instance;
+ if (!instance)
+ return false;
+ return instance.lastInputType === MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.mouse
+ }
+ }, wasLastInputTouch: {
+ get: function KeyboardInteractionListener_get_wasLastInputTouch() {
+ var instance = MS.Entertainment.Framework.KeyboardInteractionListener.instance;
+ if (!instance)
+ return false;
+ return instance.lastInputType === MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.touch
+ }
+ }
+ }), AccUtils: MS.Entertainment.UI.Framework.define(null, null, {
+ idCounter: 0, createAriaLinkId: function createAriaLinkId(linkedElement) {
+ if (!linkedElement.id) {
+ linkedElement.id = "accid" + MS.Entertainment.Framework.AccUtils.idCounter;
+ MS.Entertainment.Framework.AccUtils.idCounter++
+ }
+ }, addAriaLink: function addAriaAttribute(element, linkedElementId, attribute) {
+ element.setAttribute(attribute, linkedElementId)
+ }, createAndAddAriaLink: function createAndAddAriaLink(element, linkedElement, attribute) {
+ MS.Entertainment.Framework.AccUtils.createAriaLinkId(linkedElement);
+ MS.Entertainment.Framework.AccUtils.addAriaLink(element, linkedElement.id, attribute)
+ }, checkAndSetAriaAttribute: WinJS.Utilities.markSupportedForProcessing(function checkAndSetAriaAttribute(value, targetElement, targetProperty) {
+ targetProperty = "" + targetProperty;
+ switch (targetProperty) {
+ case "label":
+ MS.Entertainment.Utilities.setAccessibilityText(targetElement, value);
+ break;
+ case "role":
+ value ? targetElement.setAttribute("role", value) : targetElement.removeAttribute("role");
+ break;
+ case "level":
+ value ? targetElement.setAttribute("aria-level", value) : targetElement.removeAttribute("aria-level");
+ break;
+ case "setsize":
+ value || value === 0 ? targetElement.setAttribute("aria-setsize", value) : targetElement.removeAttribute("aria-setsize");
+ break;
+ case "posinset":
+ value || value === 0 ? targetElement.setAttribute("aria-posinset", value) : targetElement.removeAttribute("aria-posinset");
+ break;
+ case "expanded":
+ typeof value === "boolean" ? targetElement.setAttribute("aria-expanded", value) : targetElement.removeAttribute("aria-expanded");
+ break;
+ case "selected":
+ typeof value === "boolean" ? targetElement.setAttribute("aria-selected", value) : targetElement.removeAttribute("aria-selected");
+ break;
+ case "controls":
+ value ? targetElement.setAttribute("aria-controls", value) : targetElement.removeAttribute("aria-controls");
+ break;
+ case "owns":
+ Array.isArray(value) && value.length ? targetElement.setAttribute("aria-owns", value.join(" ")) : targetElement.removeAttribute("aria-owns");
+ break;
+ default:
+ MS.Entertainment.Utilities.assert(false, "Attempted to bind to invalid ARIA attribute: " + targetProperty);
+ break
+ }
+ }), setAriaAttribute: MS.Entertainment.Utilities.weakElementBindingInitializer(function setAriaAttribute(text, targetElement, targetProperty) {
+ if (Array.isArray(targetProperty))
+ targetProperty = targetProperty[0];
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(text, targetElement, targetProperty)
+ }), setAriaAttributeFromStringId: MS.Entertainment.Utilities.weakElementBindingInitializer(function setAriaAttributeFromStringId(stringId, targetElement, targetProperty) {
+ if (Array.isArray(targetProperty))
+ targetProperty = targetProperty[0];
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(stringId && String.load(stringId), targetElement, targetProperty)
+ }), setAriaAttributeFromStaticStringId: WinJS.Utilities.markSupportedForProcessing(function setAriaAttributeFromStaticStringId(sourceObject, staticStringId, targetElement, targetProperty) {
+ var data = String.id[staticStringId[0]];
+ MS.Entertainment.Formatters.assert(String.id[data], "Formatters_formatStringId must be passed a valid string id, received: " + data);
+ if (String.id[data])
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(String.load(data), targetElement, targetProperty)
+ }), setAriaSliderBounds: function setAriaSliderPosition(element, min, max) {
+ if (!element)
+ return;
+ element = element.domElement ? element.domElement : element;
+ if (element) {
+ MS.Entertainment.Utilities.assert(typeof min === "number", "Expected parameter min to be numeric in setAriaSliderBounds.");
+ MS.Entertainment.Utilities.assert(typeof max === "number", "Expected parameter max to be numeric in setAriaSliderBounds.");
+ element.setAttribute("aria-valuemin", min);
+ element.setAttribute("aria-valuemax", max)
+ }
+ }, setAriaSliderPosition: function setAriaSliderPosition(element, value, valueText) {
+ if (!element)
+ return;
+ element = element.domElement ? element.domElement : element;
+ if (element) {
+ MS.Entertainment.Utilities.assert(typeof value === "number", "Expected parameter value to be numeric in setAriaSliderPosition.");
+ element.setAttribute("aria-valuenow", value);
+ if (valueText)
+ element.setAttribute("aria-valuetext", valueText)
+ }
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/pluralizationutilities.js:31315 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var Utilities;
+ (function (Utilities) {
+ var PluralizationRule = (function () {
+ function PluralizationRule(captureExpression, resultString) {
+ this._matches = PluralizationRule._createMatchFunction(captureExpression);
+ this._resultString = resultString
+ }
+ PluralizationRule._stringStartsWith = function (str, expression) {
+ return str.length !== expression.length && str.lastIndexOf(expression, 0) === 0
+ };
+ PluralizationRule._countEndsWith = function (count, expression, expressionModuloFactor) {
+ return count !== expression && (count % expressionModuloFactor) === expression
+ };
+ PluralizationRule._createRangeRuleFunction = function (captureExpression, indexOfRange) {
+ var firstNumber = Number(captureExpression.substr(0, indexOfRange));
+ var lastNumber = Number(captureExpression.substr(indexOfRange + 1));
+ MS.Entertainment.Utilities.assert(firstNumber < lastNumber, "Malformed rule detected. First number in a range must be less than the last number.");
+ if (!isNaN(firstNumber) && !isNaN(lastNumber))
+ return function (count) {
+ return count >= firstNumber && count <= lastNumber
+ };
+ MS.Entertainment.Utilities.fail("Malformed rule detected. One or both ends of a range rule were not valid numbers.", captureExpression);
+ return function (count) {
+ return false
+ }
+ };
+ PluralizationRule._createWildcardRuleFunction = function (captureExpression, indexOfWildcard) {
+ if (captureExpression === "*")
+ return function (count) {
+ return true
+ };
+ else if (indexOfWildcard === 0) {
+ var captureExpressionEnding = Number(captureExpression.substr(1));
+ if (!isNaN(captureExpressionEnding)) {
+ var expressionModuloFactor = Math.pow(10, captureExpression.length - 1);
+ return function (count) {
+ return PluralizationRule._countEndsWith(count, captureExpressionEnding, expressionModuloFactor)
+ }
+ }
+ else
+ MS.Entertainment.Utilities.fail("Malformed rule detected. Wildcard rule must end with a number.")
+ }
+ else if (indexOfWildcard === captureExpression.length - 1) {
+ var captureExpressionBeginning = captureExpression.substr(0, captureExpression.length - 1);
+ return function (count) {
+ var countText = String.empty + count;
+ return PluralizationRule._stringStartsWith(countText, captureExpressionBeginning)
+ }
+ }
+ MS.Entertainment.Utilities.fail("Malformed rule detected. Wildcard was found in the middle of the expression.", captureExpression);
+ return function (count) {
+ return false
+ }
+ };
+ PluralizationRule._createMatchFunction = function (captureExpression) {
+ var indexOfRange = captureExpression.indexOf("-");
+ if (indexOfRange >= 0)
+ return PluralizationRule._createRangeRuleFunction(captureExpression, indexOfRange);
+ else {
+ var indexOfWildcard = captureExpression.indexOf("*");
+ if (indexOfWildcard >= 0)
+ return PluralizationRule._createWildcardRuleFunction(captureExpression, indexOfWildcard);
+ else {
+ var numericForm = Number(captureExpression);
+ if (!isNaN(numericForm))
+ if (numericForm >= 0)
+ return function (count) {
+ return count === numericForm
+ };
+ else
+ MS.Entertainment.Utilities.fail("Malformed rule detected. Negative numbers are not supported for pluralization.", captureExpression);
+ else
+ MS.Entertainment.Utilities.fail("Malformed rule detected.", captureExpression)
+ }
+ }
+ return function (count) {
+ return false
+ }
+ };
+ Object.defineProperty(PluralizationRule.prototype, "matches", {
+ get: function () {
+ return this._matches
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PluralizationRule.prototype, "resultString", {
+ get: function () {
+ return this._resultString
+ }, enumerable: true, configurable: true
+ });
+ return PluralizationRule
+ })();
+ Utilities.PluralizationRule = PluralizationRule;
+ var Pluralization = (function () {
+ function Pluralization() { }
+ Pluralization._resetState = function () {
+ this._initializedIdVisionCheck = false;
+ this._initializedPseudoLocCheck = false;
+ MS.Entertainment.Utilities.Pluralization._pluralizationRulesets = {}
+ };
+ Pluralization.getPluralizedString = function (stringId, count) {
+ MS.Entertainment.Utilities.Pluralization._pluralizationRulesets = MS.Entertainment.Utilities.Pluralization._pluralizationRulesets || {};
+ if (!MS.Entertainment.Utilities.Pluralization._pluralizationRulesets[stringId]) {
+ var newRuleset = MS.Entertainment.Utilities.Pluralization._createRuleset(stringId);
+ if (!newRuleset || !Array.isArray(newRuleset)) {
+ MS.Entertainment.Utilities.fail("Expected ruleset for this string ID to be a defined array.", stringId);
+ newRuleset = []
+ }
+ MS.Entertainment.Utilities.Pluralization._pluralizationRulesets[stringId] = newRuleset
+ }
+ var resultString = String.empty;
+ var ruleset = MS.Entertainment.Utilities.Pluralization._pluralizationRulesets[stringId];
+ var matchFound = ruleset.some(function (rule) {
+ if (rule.matches(count)) {
+ resultString = rule.resultString;
+ return true
+ }
+ return false
+ });
+ if (!matchFound)
+ MS.Entertainment.Utilities.fail("Failed to find a pluralization rule that matches {0} in ruleset {1}.".format(count, stringId));
+ return resultString
+ };
+ Object.defineProperty(Pluralization, "_useIdVision", {
+ get: function () {
+ if (!Pluralization._initializedIdVisionCheck) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ Pluralization.__useIdVision = configurationManager.shell.idVision;
+ Pluralization._initializedIdVisionCheck = true
+ }
+ return Pluralization.__useIdVision
+ }, enumerable: true, configurable: true
+ });
+ Pluralization._createRuleset = function (stringId) {
+ var ruleset = [];
+ var rulesString = String.load(stringId, true);
+ if (rulesString) {
+ var firstPseudoLocSectionLength = 0;
+ var lastPseudoLocSectionLength = 0;
+ var hasPseudoLocSections = false;
+ if (!Pluralization._initializedPseudoLocCheck || Pluralization._isPseudoLoc) {
+ var firstPseudoLocSectionLength = rulesString.indexOf("[[");
+ var lastPseudoLocSectionLength = rulesString.length - rulesString.lastIndexOf("]") - 1;
+ hasPseudoLocSections = (firstPseudoLocSectionLength > 0 || lastPseudoLocSectionLength > 0);
+ if (!Pluralization._initializedPseudoLocCheck)
+ Pluralization._isPseudoLoc = hasPseudoLocSections;
+ Pluralization._initializedPseudoLocCheck = true
+ }
+ var actualRulesLength = rulesString.length - (firstPseudoLocSectionLength + lastPseudoLocSectionLength);
+ var idVisionId = null;
+ if (Pluralization._useIdVision)
+ idVisionId = "[" + String.idVisionIds[stringId] + "] ";
+ var regexp = /(?:\[\[([0-9\-\*]+)\]([^\]]*?)\])+?/g;
+ var numGroups = 3;
+ var parts;
+ while (parts = regexp.exec(rulesString)) {
+ MS.Entertainment.Utilities.assert(parts.length === numGroups, "Expected one result string for each capture expression.");
+ var captureExpression = parts[1];
+ var resultString = parts[2];
+ if (hasPseudoLocSections) {
+ var resultPseudoLocRatio = actualRulesLength > 0 ? resultString.length / actualRulesLength : 0;
+ var beginningPseudoLoc = firstPseudoLocSectionLength > 0 ? rulesString.substr(0, Math.ceil(firstPseudoLocSectionLength * resultPseudoLocRatio)) : String.empty;
+ var endingPseudoLoc = lastPseudoLocSectionLength > 0 ? rulesString.substr(rulesString.length - Math.ceil(lastPseudoLocSectionLength * resultPseudoLocRatio)) : String.empty;
+ resultString = beginningPseudoLoc + resultString + endingPseudoLoc
+ }
+ if (idVisionId)
+ resultString = idVisionId + resultString;
+ ruleset.push(new PluralizationRule(captureExpression, resultString))
+ }
+ MS.Entertainment.Utilities.assert(ruleset.length > 0, "Parsing failure for string " + stringId)
+ }
+ return ruleset
+ };
+ Pluralization._pluralizationRulesets = {};
+ return Pluralization
+ })();
+ Utilities.Pluralization = Pluralization
+ })(Utilities = Entertainment.Utilities || (Entertainment.Utilities = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/formatters.js:31502 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Formatters");
+ WinJS.Namespace.define("MS.Entertainment.Formatters", {
+ DateTimeFormatters: MS.Entertainment.UI.Framework.define(function dateTimeFormatters() { }, {
+ _year: null, _monthYear: null, _abbreviatedMonthYear: null, _abbreviatedMonth: null, _dayMonthYear: null, _shortDate: null, _decimalNumber: null, _groupedDecimalNumber: null, _percentNumber: null, year: {
+ get: function () {
+ if (!this._year)
+ try {
+ this._year = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("year")
+ }
+ catch (e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"year\") object. Error: " + error);
+ this._year = this._defaultFormatter
+ }
+ return this._year
+ }
+ }, abbreviatedMonthYear: {
+ get: function () {
+ if (!this._abbreviatedMonthYear)
+ try {
+ this._abbreviatedMonthYear = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("month.abbreviated year")
+ }
+ catch (e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"month.abbreviated year\") object. Error: " + error);
+ this._abbreviatedMonthYear = this._defaultFormatter
+ }
+ return this._abbreviatedMonthYear
+ }
+ }, abbreviatedMonth: {
+ get: function () {
+ if (!this._abbreviatedMonth)
+ try {
+ this._abbreviatedMonth = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("month.abbreviated")
+ }
+ catch (e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"month.abbreviated\") object. Error: " + error);
+ this._abbreviatedMonth = this._defaultFormatter
+ }
+ return this._abbreviatedMonth
+ }
+ }, monthYear: {
+ get: function () {
+ if (!this._monthYear)
+ try {
+ this._monthYear = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("month year")
+ }
+ catch (e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"month year\") object. Error: " + error);
+ this._abbreviatedMonth = this._defaultFormatter
+ }
+ return this._monthYear
+ }
+ }, shortDate: {
+ get: function () {
+ if (!this._shortDate)
+ try {
+ this._shortDate = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("shortdate")
+ }
+ catch (e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"shortdate\") object. Error: " + error);
+ this._shortDate = this._defaultFormatter
+ }
+ return this._shortDate
+ }
+ }, dayMonthYear: {
+ get: function () {
+ if (!this._dayMonthYear)
+ try {
+ this._dayMonthYear = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("day month year")
+ }
+ catch (e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"day month year\") object. Error: " + error);
+ this._dayMonthYear = this._defaultFormatter
+ }
+ return this._dayMonthYear
+ }
+ }, decimalNumber: {
+ get: function () {
+ if (!this._decimalNumber) {
+ this._decimalNumber = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ this._decimalNumber.fractionDigits = 0;
+ this._decimalNumber.isGrouped = false;
+ this._decimalNumber.integerDigits = MS.Entertainment.Formatters.DateTimeFormatters.defaultDecimalDigits
+ }
+ return this._decimalNumber
+ }
+ }, groupedDecimalNumber: {
+ get: function () {
+ if (!this._groupedDecimalNumber) {
+ this._groupedDecimalNumber = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ this._groupedDecimalNumber.fractionDigits = 0;
+ this._groupedDecimalNumber.isGrouped = true;
+ this._groupedDecimalNumber.integerDigits = MS.Entertainment.Formatters.DateTimeFormatters.defaultDecimalDigits
+ }
+ return this._groupedDecimalNumber
+ }
+ }, percentNumber: {
+ get: function () {
+ if (!this._percentNumber) {
+ this._percentNumber = new Windows.Globalization.NumberFormatting.PercentFormatter;
+ this._percentNumber.fractionDigits = 0;
+ this._percentNumber.integerDigits = 0;
+ this._percentNumber.isDecimalPointAlwaysDisplayed = false;
+ this._percentNumber.isGrouped = true
+ }
+ return this._percentNumber
+ }
+ }, _defaultFormatter: {
+ get: function () {
+ return {
+ format: function format() {
+ return String.empty
+ }
+ }
+ }
+ }
+ }, {
+ create: function create() {
+ return new MS.Entertainment.Formatters.DateTimeFormatters
+ }, defaultDecimalDigits: 1
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.dateTimeFormatters, MS.Entertainment.Formatters.DateTimeFormatters.create);
+ WinJS.Namespace.define("MS.Entertainment.Formatters", {
+ MediaSortFormatter: MS.Entertainment.defineOptionalObservable(function mediaSortFormatter() {
+ this.bind("totalCount", this._updateResult.bind(this))
+ }, {
+ _countStringId: null, _unknownStringId: null, _countOnly: null, _filter: null, initialize: function initialize(countStringId, unknownStringId, countOnly, filter) {
+ this._countStringId = countStringId;
+ this._unknownStringId = unknownStringId;
+ this._countOnly = countOnly;
+ this._filter = filter;
+ this._updateResult()
+ }, _updateResult: function _updateResult() {
+ var countFormatter;
+ if (this.count >= 0) {
+ var mediaStringWithCount = MS.Entertainment.Utilities.Pluralization.getPluralizedString(this._countStringId, this.totalCount);
+ countFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ countFormatter.isGrouped = true;
+ this.result = String.load(this._filter ? String.id.IDS_N_FILTER_IN : String.id.IDS_N_SORTED_BY).format(countFormatter.format(this.totalCount), String.load(mediaStringWithCount));
+ countFormatter.isGrouped = false
+ }
+ else if (this._unknownStringId)
+ this.result = String.load(this._filter ? String.id.IDS_FILTER_IN : String.id.IDS_SORTED_BY).format(String.load(this._unknownStringId));
+ else if (this._countOnly) {
+ countFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ this.result = countFormatter.format(this.totalCount)
+ }
+ else
+ this.result = null
+ }
+ }, {
+ totalCount: 0, result: null
+ }), formatDestinationHelper: WinJS.Utilities.markSupportedForProcessing(function formatHelper(destination, destinationProperty, value) {
+ if (destinationProperty.length > 1) {
+ var prop = destination[destinationProperty[0]];
+ for (var x = 1; x < destinationProperty.length - 1; x++)
+ prop = prop[destinationProperty[x]];
+ prop[destinationProperty[x]] = value
+ }
+ else
+ destination[destinationProperty] = value
+ }), formatSourceHelper: WinJS.Utilities.markSupportedForProcessing(function formatSourceHelper(source, sourceProperty) {
+ var sourceData;
+ if (Array.isArray(sourceProperty)) {
+ sourceData = source[sourceProperty[0]];
+ for (var i = 1; i < sourceProperty.length; i++)
+ sourceData = sourceData[sourceProperty[i]]
+ }
+ else
+ sourceData = source[sourceProperty];
+ return sourceData
+ }), formatStringOrStringId: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function (value) {
+ var sourceDataType = typeof value;
+ var result = String.empty;
+ if (sourceDataType === "string")
+ result = (String.id[value]) ? String.load(value) : value;
+ else if (value)
+ MS.Entertainment.Formatters.fail("Unrecognized string type in formatter: " + sourceDataType);
+ return result
+ })), _formatStringStripHTML: function _formatStringStripHTML(value) {
+ var sourceDataType = typeof value;
+ var result = String.empty;
+ if (sourceDataType === "string") {
+ if (value)
+ result = toStaticHTML(value.replace(/<(?:.|\n)*?>/gm, ""))
+ }
+ else if (value)
+ MS.Entertainment.Formatters.fail("Unrecognized string type in formatter: " + sourceDataType);
+ return result
+ }, _formatStringStripHTMLAndDecode: function _formatStringStripHTMLAndDecode(value) {
+ var sourceDataType = typeof value;
+ var result = String.empty;
+ if (sourceDataType === "string") {
+ if (value)
+ result = MS.Entertainment.Utilities.unEscapeHTML(value)
+ }
+ else if (value)
+ MS.Entertainment.Formatters.fail("Unrecognized string type in formatter: " + sourceDataType);
+ return result
+ }, formatStringStripHTML: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function (value) {
+ return MS.Entertainment.Formatters._formatStringStripHTML(value)
+ })), formatStringStripHTMLAndDecode: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function (value) {
+ return MS.Entertainment.Formatters._formatStringStripHTMLAndDecode(value)
+ })), formatStringId: WinJS.Utilities.markSupportedForProcessing(function formatStringOrStringId(source, sourceProperty, destination, destinationProperty) {
+ MS.Entertainment.Formatters.assert(sourceProperty[0] === "String", "Formatters_formatStringId must be passed a valid string id");
+ var len = sourceProperty.length;
+ var data = String;
+ for (var i = 1; i < len && data; i++)
+ data = data[sourceProperty[i]];
+ MS.Entertainment.Formatters.assert(String.id[data], "Formatters_formatStringId must be passed a valid string id");
+ var result = (String.id[data] && String.load(data)) || String.empty;
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, result)
+ }), formatStringIdNoAssert: WinJS.Utilities.markSupportedForProcessing(function formatStringIdNoAssert(source, sourceProperty, destination, destinationProperty) {
+ MS.Entertainment.Formatters.assert(sourceProperty[0] === "String", "Formatters_formatStringId must be passed a valid string id");
+ var len = sourceProperty.length;
+ var data = String;
+ for (var i = 1; i < len && data; i++)
+ data = data[sourceProperty[i]];
+ var result = (String.id[data] && String.load(data)) || String.empty;
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, result)
+ }), formatYearFromDateNonConverter: function formatYearFromDateNonConverter(sourceData) {
+ var date = null;
+ var year = null;
+ if (sourceData) {
+ date = new Date(sourceData);
+ if (date) {
+ var formattedYear = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ year = formattedYear.format(date)
+ }
+ }
+ return year || String.empty
+ }, formatYearFromDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatReleaseYear(sourceData) {
+ return MS.Entertainment.Formatters.formatYearFromDateNonConverter(sourceData)
+ })), formatDatabaseDataFromReleaseDate: function formatDatabaseDataFromReleaseDate(sourceData) {
+ var date = null;
+ if (sourceData && sourceData.toISOString)
+ date = sourceData.toISOString().replace("T", " ").substring(0, 19);
+ else
+ MS.Entertainment.Formatters.fail("Expected date to be provided as source data. Cannot format releaseDate");
+ return date || String.empty
+ }, formatShortDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatYearMonthDate(sourceValue) {
+ return MS.Entertainment.Formatters.formatShortDateNonConverter(sourceValue)
+ })), formatShortDateNonConverter: function formatShortDateNonConverter(sourceValue) {
+ if (sourceValue) {
+ var dateFormat = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).shortDate;
+ sourceValue = dateFormat.format(sourceValue)
+ }
+ return sourceValue || String.empty
+ }, formatLongDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatYearMonthDate(sourceValue) {
+ if (sourceValue) {
+ var dateFormat = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).dayMonthYear;
+ sourceValue = dateFormat.format(sourceValue)
+ }
+ return sourceValue || String.empty
+ })), formatDurationFromDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDurationFromDate(sourceData) {
+ return MS.Entertainment.Formatters.formatDurationFromDateNonConverter(sourceData)
+ })), formatDurationFromDateNonConverter: function formatDurationFromDateNonConverter(sourceData) {
+ var date = sourceData;
+ if (typeof sourceData !== "number")
+ date = new Date(sourceData);
+ var duration = MS.Entertainment.Utilities.formatTimeString(date);
+ return duration
+ }, formatDurationFromDateNoSeconds: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDurationFromDateNoSeconds(sourceData) {
+ return MS.Entertainment.Formatters.formatDurationFromDateNoSecondsNonConverter(sourceData)
+ })), formatDurationFromDateNoSecondsNonConverter: function formatDurationFromDateNoSecondsNonConverter(sourceData) {
+ var duration = MS.Entertainment.Utilities.formatTimeString(sourceData, { excludeSeconds: true });
+ return duration
+ }, formatDurationGreaterThanZeroFromDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDurationGreaterThanZeroFromDate(sourceData) {
+ return MS.Entertainment.Formatters.formatDurationGreaterThanZeroFromDateNonConverter(sourceData)
+ })), formatDurationGreaterThanZeroFromDateNonConverter: function formatDurationGreaterThanZeroFromDateNonConverter(sourceData) {
+ var date = null;
+ var forceEmptyString = false;
+ if (typeof sourceData === "number")
+ if (sourceData > 0)
+ date = MS.Entertainment.Utilities._millisecondsToDate(sourceData);
+ else
+ forceEmptyString = true;
+ else
+ date = new Date(sourceData);
+ var duration = sourceData && !forceEmptyString ? MS.Entertainment.Utilities.formatTimeString(date) : String.empty;
+ return duration
+ }, milliSecondsFromTimeSpan: function milliSecondsFromTimeSpan(days, hours, minutes, seconds, milliseconds) {
+ return ((((days ? days : 0) * 24 + (hours ? hours : 0)) * 60 + (minutes ? minutes : 0)) * 60 + (seconds ? seconds : 0)) * 1000 + (milliseconds ? milliseconds : 0)
+ }, formatCount: function formatCount(count, countTextFunction) {
+ if (count === undefined || count === -1)
+ return String.empty;
+ return countTextFunction(count)
+ }, countText: function countText(count, countFormatStringId) {
+ var numberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ return MS.Entertainment.Formatters.countTextWithCustomFormatter(numberFormatter, count, countFormatStringId)
+ }, countTextWithoutOrderFormat: function countTextWithoutOrderFormat(count, countFormatStringId) {
+ var formatString = String.load(String.id.IDS_MUSIC_RELATED_PANEL_FORMAT);
+ var formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(count);
+ var countLabel = MS.Entertainment.Utilities.Pluralization.getPluralizedString(countFormatStringId, count);
+ return formatString.format(formattedCount, countLabel)
+ }, countTextWithCustomFormatter: function countTextWithCustomFormatter(numberFormatter, count, countFormatStringId) {
+ var formattedCount = numberFormatter.format(count);
+ return MS.Entertainment.Utilities.Pluralization.getPluralizedString(countFormatStringId, count).format(formattedCount)
+ }, formatGenresList: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatGenresList(genres) {
+ return MS.Entertainment.Formatters.formatGenresListNonConverter(genres)
+ })), formatGenresListNonConverter: function formatGenresListNonConverter(genres) {
+ if (!genres)
+ return String.empty;
+ var genreNames = [];
+ if (Array.isArray(genres)) {
+ genres.forEach(function forEachGenresList(genre) {
+ if (genre)
+ genreNames.push(genre.name)
+ });
+ return genreNames.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else if (typeof genres !== "string" && genres.forEach) {
+ MS.Entertainment.Formatters.fail("Supplied with virtual list. Don't know how to handle this. Don't think it's used any more");
+ return String.empty
+ }
+ else if (typeof genres === "string")
+ return genres
+ }, formatStringOrUnknown: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatStringOrUnknown(result) {
+ if (!result || result === "null")
+ result = String.load(String.id.IDS_UNKNOWN_VALUE);
+ return result
+ })), formatStringOrEmpty: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatStringOrEmpty(result) {
+ if (!result || result === "null")
+ result = String.empty;
+ return result
+ })), formatStringOrEmptyOneTime: WinJS.Utilities.markSupportedForProcessing(function formatStringOrEmptyOneTime(source, sourceProperties, dest, destProperties) {
+ var result = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperties);
+ if (!result || result === "null")
+ result = String.empty;
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, result)
+ }), formatDecimalNumber: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDecimalNumber(num) {
+ if (num === undefined || num === null || typeof (num) !== "number")
+ return String.empty;
+ var formattedNum;
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(num);
+ return formattedNum
+ })), formatDecimalNumberIncrement: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDecimalNumberIncrement(num) {
+ if (num === undefined || num === null || typeof (num) !== "number")
+ return String.empty;
+ var formattedNum;
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(num + 1);
+ return formattedNum
+ })), formatDecimalNumberIncrementOneTime: WinJS.Utilities.markSupportedForProcessing(function formatDecimalNumberIncrementOneTime(source, sourceProperties, dest, destProperties) {
+ var formattedNum = String.empty;
+ var number = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperties);
+ if (typeof number === "number" && !isNaN(number))
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(number + 1);
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, formattedNum)
+ }), formatIcon: WinJS.Utilities.markSupportedForProcessing(function formatIcon(source, sourceProperty, destination, destinationProperty) {
+ var icon = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, icon)
+ }), setPropertyFromStatic: WinJS.Utilities.markSupportedForProcessing(function setPropertyFromStatic(source, sourceProperty, destination, destinationProperty) {
+ var valueFromProperty = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, valueFromProperty)
+ }), formatGenre: function formatGenre(sourceValue) {
+ var result = String.empty;
+ if (sourceValue.genre)
+ if (Array.isArray(sourceValue.genre)) {
+ var genreNames = [];
+ sourceValue.genre.forEach(function (genre) {
+ if (genre)
+ genreNames.push(genre.name)
+ });
+ result = genreNames.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else if (sourceValue.genre.name)
+ result = sourceValue.genre.name;
+ else
+ result = sourceValue.genre;
+ else if (sourceValue.genreName)
+ result = sourceValue.genreName;
+ return result
+ }, formatAlbumAndArtist: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function (sourceValue) {
+ return MS.Entertainment.Formatters.formatAlbumAndArtistHelper(sourceValue)
+ })), formatAlbumAndArtistHelper: function formatAlbumAndArtistHelper(sourceValue, showArtistIfDifferent) {
+ var value = String.empty;
+ if (sourceValue) {
+ var artistName = (!showArtistIfDifferent || sourceValue.hasNonAlbumArtistName) ? sourceValue.artistName : String.empty;
+ if (artistName && sourceValue.albumName)
+ value = String.load(String.id.IDS_MUSIC_ALBUM_BY_ARTIST).format(sourceValue.albumName, artistName);
+ else if (artistName)
+ value = String.load(String.id.IDS_MUSIC_BY_ARTIST).format(artistName);
+ else if (sourceValue.albumName)
+ value = sourceValue.albumName
+ }
+ return value
+ }, formatArtist: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatArtist(count) {
+ return MS.Entertainment.Formatters.formatCount(count, MS.Entertainment.Formatters.artistCountText)
+ })), formatTracks: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatTracks(count) {
+ return MS.Entertainment.Formatters.formatCount(count, MS.Entertainment.Formatters.trackCountText)
+ })), formatTracksOneTime: WinJS.Utilities.markSupportedForProcessing(function formatTracksOneTime(source, sourceProperties, dest, destProperties) {
+ var count = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperties);
+ count = MS.Entertainment.Formatters.formatCount(count, MS.Entertainment.Formatters.trackCountText);
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, count)
+ }), formatAlbumCount: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatAlbumCount(count) {
+ return MS.Entertainment.Formatters.formatCount(count, MS.Entertainment.Formatters.albumCountText)
+ })), formatAlbumCountOneTime: WinJS.Utilities.markSupportedForProcessing(function formatAlbumCountOneTime(source, sourceProperties, dest, destProperties) {
+ var count = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperties);
+ count = MS.Entertainment.Formatters.formatCount(count, MS.Entertainment.Formatters.albumCountText);
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, count)
+ }), formatTrackAndAlbumCount: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatTrackAndAlbumCount(artist) {
+ if (artist) {
+ var details = [];
+ var formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var albumCountFormatted;
+ var tracksCountFormatted;
+ if (artist.totalAlbumsCount === 1)
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_ALBUM_COUNT));
+ else if (artist.totalAlbumsCount > 1) {
+ albumCountFormatted = formatter.format(artist.totalAlbumsCount);
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_ALBUMS_COUNT).format(albumCountFormatted))
+ }
+ if (artist.totalTracksCount === 1)
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_SONG_COUNT));
+ else if (artist.totalTracksCount > 1) {
+ tracksCountFormatted = formatter.format(artist.totalTracksCount);
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_SONGS_COUNT).format(tracksCountFormatted))
+ }
+ return details.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else
+ return String.empty
+ })), formatPlaylistDetailsTrackCount: function formatPlaylistDetailsTrackCount(playlist) {
+ var playlistDetailsTrackCount = String.empty;
+ if (playlist)
+ if (playlist.count === 1)
+ playlistDetailsTrackCount = String.load(String.id.IDS_DETAILS_PLAYLIST_SONG_COUNT);
+ else if (playlist.count > 1) {
+ var formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(playlist.count);
+ playlistDetailsTrackCount = String.load(String.id.IDS_DETAILS_PLAYLIST_SONGS_COUNT).format(formattedCount)
+ }
+ else
+ playlistDetailsTrackCount = String.load(String.id.IDS_PLAYLIST_PAGE_EMPTY_TEXT);
+ return playlistDetailsTrackCount
+ }, trackCountText: function trackCountText(count) {
+ return MS.Entertainment.Formatters.countText(count, String.id.IDS_MUSIC_TRACKS_LABEL_PLURAL)
+ }, artistCountText: function artistCountText(count) {
+ return MS.Entertainment.Formatters.countTextWithoutOrderFormat(count, String.id.IDS_MUSIC_TYPE_ARTIST_PLURAL)
+ }, albumCountText: function albumCountText(count) {
+ return MS.Entertainment.Formatters.countTextWithoutOrderFormat(count, String.id.IDS_MUSIC_TYPE_ALBUM_PLURAL)
+ }, playlistCountText: function playlistCountText(count) {
+ return MS.Entertainment.Formatters.countTextWithoutOrderFormat(count, String.id.IDS_MUSIC_TYPE_PLAYLIST_PLURAL)
+ }, playlistsAddedCountText: function playlistsAddedCountText(count) {
+ return MS.Entertainment.Formatters.countText(count, String.id.IDS_PLAYLIST_PLAYLISTS_ADDED_PLURAL)
+ }, formatTrackNumber: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatTrackNumber(num) {
+ var formattedNum = String.empty;
+ if (num)
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(num);
+ return formattedNum
+ })), formatTrackNumberOneTime: WinJS.Utilities.markSupportedForProcessing(function formatTrackNumberOneTime(source, sourceProperties, dest, destProperties) {
+ var formattedNum = String.empty;
+ var trackNumber = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperties);
+ if (trackNumber)
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(trackNumber);
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, formattedNum)
+ }), formatTrackDuration: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatTrackDuration(duration) {
+ if (duration)
+ duration = MS.Entertainment.Utilities.millisecondsToTimeCode(duration);
+ else
+ duration = String.empty;
+ return duration
+ })), formatTrackMediaTypeBadgeString: WinJS.Utilities.markSupportedForProcessing(function formatTrackMediaTypeBadge(source, sourceProperty, destination, destinationProperty) {
+ var hasMusicVideoId = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperty);
+ var trackMediaTypeString = String.empty;
+ trackMediaTypeString = hasMusicVideoId ? String.load(String.id.IDS_MUSIC2_SEARCH_SONG_VIDEO_CARD) : String.load(String.id.IDS_MUSIC2_SEARCH_SONG_CARD);
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, trackMediaTypeString)
+ }), formatMusicVideoMediaTypeBadgeString: WinJS.Utilities.markSupportedForProcessing(function formatTrackMediaTypeBadge(source, sourceProperty, destination, destinationProperty) {
+ var hasTrackId = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperty);
+ var trackMediaTypeString = String.empty;
+ trackMediaTypeString = hasTrackId ? String.load(String.id.IDS_MUSIC2_SEARCH_SONG_VIDEO_CARD) : String.load(String.id.IDS_MUSIC2_SEARCH_VIDEO_CARD);
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, trackMediaTypeString)
+ }), getUsbDeviceNameForDashboard: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function getUsbDeviceNameForDashboard(sourceData) {
+ var text = String.load(String.id.IDS_MEDIABROWSER_LANDING_PAGE_USB_TITLE).format(sourceData);
+ return text
+ })), formatIsDownloaded: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatCanPlayLocally(source) {
+ var result = String.empty;
+ if (!source && MS.Entertainment.Utilities.isApp1)
+ result = MS.Entertainment.UI.Icon.inlineStreaming;
+ return result
+ })), issueCountText: function issueCountText(count) {
+ return MS.Entertainment.Formatters.countText(count, String.id.IDS_READ_ISSUE_COUNT_PLURAL)
+ }, formatIssueCount: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatIssueCount(count) {
+ return MS.Entertainment.Formatters.formatCount(count, MS.Entertainment.Formatters.issueCountText)
+ })), formatIsSample: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatIsSample(source) {
+ if (source && source === true)
+ return String.load(String.id.IDS_READ_SAMPLE_TEXT);
+ return String.empty
+ })), formatStringForVoice: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatStringForVoice(source) {
+ return MS.Entertainment.UI.App2.VoiceStatics.normalizeStringForVoice(source)
+ }))
+ })
+ })()
+})();
+/* >>>>>>/framework/music1/collectionchangenotifier.js:31983 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var CollectionChangeNotifierService = (function () {
+ function CollectionChangeNotifierService() {
+ this._signInService = null;
+ this._signInServiceBinding = null;
+ this._networkStatusBinding = null;
+ this._blockGlobalCollectionChangeEvents = false;
+ this._blockGlobalCollectionUpSyncEvents = false;
+ this._blockedUpSyncItemData = null;
+ this._navigationService = null;
+ CollectionChangeNotifierService._instanceCount++;
+ UI.assert(CollectionChangeNotifierService._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.collectionChangeNotifier);");
+ this._appNotificationService = Entertainment.ServiceLocator.getService(Entertainment.Services.appNotification);
+ this._listNotificationService = Entertainment.ServiceLocator.getService(Entertainment.Services.listNotification);
+ this._cloudCollectionService = Entertainment.ServiceLocator.getService(Entertainment.Services.cloudCollection);
+ this._signInService = Entertainment.ServiceLocator.getService(Entertainment.Services.signIn);
+ this._uiStateService = Entertainment.ServiceLocator.getService(Entertainment.Services.uiState);
+ this._startListening();
+ if (this.isCloudCollectionV2Enabled)
+ this._sendListNotification(UI.NotificationCategoryEnum.cloudContent, String.empty, String.empty, null, null, true, true)
+ }
+ Object.defineProperty(CollectionChangeNotifierService, "collectionChangeNotifierService", {
+ get: function () {
+ return Entertainment.ServiceLocator.getService(Entertainment.Services.collectionChangeNotifier)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService, "blockGlobalCollectionChangeEvents", {
+ get: function () {
+ return CollectionChangeNotifierService.collectionChangeNotifierService._blockGlobalCollectionChangeEvents
+ }, set: function (value) {
+ CollectionChangeNotifierService.collectionChangeNotifierService._blockGlobalCollectionChangeEvents = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService, "blockGlobalCollectionUpSyncEvents", {
+ get: function () {
+ return CollectionChangeNotifierService.collectionChangeNotifierService._blockGlobalCollectionUpSyncEvents
+ }, set: function (value) {
+ var ccnService = CollectionChangeNotifierService.collectionChangeNotifierService;
+ ccnService._blockGlobalCollectionUpSyncEvents = value;
+ if (!value) {
+ var eventData = {
+ itemsCompleted: 0, isCompleted: ccnService._blockedUpSyncItemData ? ccnService._blockedUpSyncItemData.isCompleted : 0
+ };
+ ccnService._onCollectionUpSyncProgress(eventData)
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService, "navigationService", {
+ get: function () {
+ return CollectionChangeNotifierService.collectionChangeNotifierService._navigationService
+ }, set: function (value) {
+ CollectionChangeNotifierService.collectionChangeNotifierService._navigationService = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "configManager", {
+ get: function () {
+ if (!this._configManager)
+ this._configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return this._configManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isCloudCollectionEnabled", {
+ get: function () {
+ return this._cloudCollectionService.isEnabled
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isCloudCollectionV2Enabled", {
+ get: function () {
+ return this._cloudCollectionService.isV2Enabled
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isCloudMatchOptedIn", {
+ get: function () {
+ return this._cloudCollectionService.isCloudMatchOptedIn
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isCloudMatchOptedOut", {
+ get: function () {
+ return this._cloudCollectionService.isCloudMatchOptedOut
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isCloudMatchOptedUnknown", {
+ get: function () {
+ return !this.isCloudMatchOptedIn && !this.isCloudMatchOptedOut
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isCloudMatchNotApplicable", {
+ get: function () {
+ return this._cloudCollectionService.isCloudMatchNotApplicable
+ }, set: function (value) {
+ if (value)
+ this._cloudCollectionService.setCloudMatchOptIn(Entertainment.CloudCollectionService.CloudMatchStatus.NotApplicable);
+ else
+ this.resetCloudListNotification(true)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isCloudDownloadOnAddEnabled", {
+ get: function () {
+ return this._cloudCollectionService.shouldDownloadOnAdd
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isMDLCStarted", {
+ get: function () {
+ return this.configManager.mdlc.firstMDLCDidWork
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "isMDLCFinished", {
+ get: function () {
+ return this.configManager.mdlc.firstMDLCFinished
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CollectionChangeNotifierService.prototype, "mdlcPercentageComplete", {
+ get: function () {
+ return this.configManager.mdlc.firstMDLCPercentageComplete
+ }, enumerable: true, configurable: true
+ });
+ CollectionChangeNotifierService.prototype.dispose = function () {
+ if (this._signInServiceBinding) {
+ this._signInServiceBinding.cancel();
+ this._signInServiceBinding = null
+ }
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ };
+ CollectionChangeNotifierService.prototype.resetCloudListNotification = function (showOptInNotification) {
+ this._cloudCollectionService.clearCloudMatchOptIn();
+ var cloudNotification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.cloudContent);
+ if (cloudNotification) {
+ cloudNotification.attachedNotification = null;
+ this._listNotificationService.clear(UI.NotificationCategoryEnum.cloudContent, true)
+ }
+ if (showOptInNotification)
+ this._sendCloudMatchingOptInDialogListNotification(false)
+ };
+ CollectionChangeNotifierService.prototype._buildMDLCProgressNotification = function (detailsMessage) {
+ var mdlcNotification = new UI.Notification;
+ mdlcNotification.category = UI.NotificationCategoryEnum.cloudContent;
+ mdlcNotification.icon = UI.NotificationCategoryEnum.cloudContent.icon;
+ mdlcNotification.title = String.load(String.id.IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_1);
+ mdlcNotification.subTitle = detailsMessage;
+ mdlcNotification.action = UI.Actions.ActionIdentifiers.notificationCloudContent;
+ mdlcNotification.actionParams = { matchingDialog: true };
+ mdlcNotification.dismissAction = UI.Actions.ActionIdentifiers.notificationClear;
+ return mdlcNotification
+ };
+ CollectionChangeNotifierService.prototype._clearListNotification = function (category, removeFromList) {
+ this._listNotificationService.clear(category, removeFromList)
+ };
+ CollectionChangeNotifierService.prototype._sendGlobalNotification = function (category, titleText, subTitleText, isPersistent) {
+ var notification = new UI.Notification;
+ notification.title = titleText;
+ notification.subTitle = subTitleText;
+ notification.category = category.name;
+ notification.notificationType = "Informational";
+ notification.isPersistent = isPersistent;
+ if (isPersistent) {
+ notification.icon = WinJS.UI.AppBarIcon.sync;
+ notification.iconClassName = "rotate360Animation"
+ }
+ else {
+ notification.icon = UI.Icon.musicInCollection;
+ notification.iconClassName = String.empty
+ }
+ notification.action = WinJS.Utilities.markSupportedForProcessing(function () {
+ if (Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.winJSNavigation)) {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var collectionNavigateAction = actionService.getAction(UI.Actions.ActionIdentifiers.collectionNavigate);
+ collectionNavigateAction.execute()
+ }
+ else {
+ var navigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.navigation);
+ if (navigationService.currentPage.iaNode.moniker !== UI.Monikers.musicCollection)
+ navigationService.navigateTo(UI.Monikers.musicCollection)
+ }
+ });
+ this._appNotificationService.send(notification);
+ return notification
+ };
+ CollectionChangeNotifierService.prototype._sendListNotification = function (category, messageText, detailsText, actionIds, actionParamsArray, completeCategory, hidden, automationId, dismissable) {
+ var listNotificationService = Entertainment.ServiceLocator.getService(Entertainment.Services.listNotification);
+ return listNotificationService.createAndSend(category, messageText, detailsText, actionIds, actionParamsArray, completeCategory, hidden, automationId, dismissable)
+ };
+ CollectionChangeNotifierService.prototype._sendCloudMatchingOptInDialogListNotification = function (isHiddenNotification) {
+ var signedInUser = Entertainment.ServiceLocator.getService(Entertainment.Services.signedInUser);
+ if (this.isCloudCollectionV2Enabled || (signedInUser && !signedInUser.isSubscription))
+ return null;
+ var optInCloudNotification = null;
+ if (isHiddenNotification)
+ optInCloudNotification = this._sendListNotification(UI.NotificationCategoryEnum.cloudContent, String.load(String.id.IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_1), String.empty, [UI.Actions.ActionIdentifiers.notificationCloudContent], [{
+ consentDialog: true, title: String.load(String.id.IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_2)
+ }], null, true);
+ else if (this.isCloudMatchOptedUnknown && this.isCloudCollectionEnabled) {
+ var grovelNotification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.localContent);
+ if (grovelNotification && grovelNotification.category && grovelNotification.category.completed) {
+ optInCloudNotification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.cloudContent);
+ if (optInCloudNotification) {
+ if (!optInCloudNotification.attachedNotification) {
+ var detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_0_SONGS_SCANNED_NOTIFICATION_LINE_2).format(0);
+ var mdlcNotification = this._buildMDLCProgressNotification(detailsMessage);
+ optInCloudNotification.attachedNotification = mdlcNotification
+ }
+ optInCloudNotification.visible = true;
+ this._listNotificationService.send(optInCloudNotification)
+ }
+ else {
+ optInCloudNotification = this._sendListNotification(UI.NotificationCategoryEnum.cloudContent, String.load(String.id.IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_1), String.empty, [UI.Actions.ActionIdentifiers.notificationCloudContent], [{
+ consentDialog: true, title: String.load(String.id.IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_2)
+ }]);
+ var detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_0_SONGS_SCANNED_NOTIFICATION_LINE_2).format(0);
+ var mdlcNotification = this._buildMDLCProgressNotification(detailsMessage);
+ optInCloudNotification.attachedNotification = mdlcNotification
+ }
+ }
+ }
+ return optInCloudNotification
+ };
+ CollectionChangeNotifierService.prototype._createAndSendCloudContentV2Notification = function (firstTrackAdded) {
+ var cloudContentV2Notification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.cloudContentV2);
+ var showContentFoundBanner = firstTrackAdded || this.configManager.generalSettings.cloudCollectionV2FirstTrackAdded;
+ if (showContentFoundBanner && (!cloudContentV2Notification || (cloudContentV2Notification && !cloudContentV2Notification.category.completed)))
+ cloudContentV2Notification = this._sendListNotification(UI.NotificationCategoryEnum.cloudContentV2, String.load(String.id.IDS_COLLECTION_CLOUDV2_BANNER2_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationCloudContentV2], [{
+ contentFoundDialog: true, getMoreInfoDialog: false, title: String.load(String.id.IDS_COLLECTION_CLOUDV2_BANNER2_ACTION)
+ }], true);
+ else if (!cloudContentV2Notification)
+ cloudContentV2Notification = this._sendListNotification(UI.NotificationCategoryEnum.cloudContentV2, String.load(String.id.IDS_COLLECTION_CLOUDV2_BANNER1_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationCloudContentV2], [{
+ contentFoundDialog: false, getMoreInfoDialog: true, title: String.load(String.id.IDS_COLLECTION_CLOUDV2_BANNER1_ACTION)
+ }]);
+ return cloudContentV2Notification
+ };
+ CollectionChangeNotifierService.prototype._startListening = function () {
+ var _this = this;
+ this._signInServiceBinding = WinJS.Binding.bind(this._signInService, { isSignedIn: this._onSignInChanged.bind(this) });
+ this._networkStatusBinding = UI.Framework.addEventHandlers(this._uiStateService, {
+ networkStatusChanged: function () {
+ return _this._onNetworkStatusChanged()
+ }
+ });
+ this._collectionBuildingManager = new Microsoft.Entertainment.Platform.CollectionBuildingManager;
+ if (this.isCloudCollectionV2Enabled) {
+ if (this._cloudCollectionService.isDeduplicationUIEnabled)
+ this._collectionBuildingEvents = Entertainment.Utilities.addEventHandlers(this._collectionBuildingManager, {
+ collectionbuildbeginevent: this._onCollectionBegin.bind(this), collectionbuildprogressevent: this._onCollectionProgress.bind(this), collectionbuildupsyncprogressevent: this._onCollectionUpSyncProgress.bind(this), collectionbuildendevent: this._onCollectionEnd.bind(this), collectionbuildcloudcollectionv2firsttrackaddedevent: this._onCollectionBuildingCloudCollectionV2FirstTrackAddedEvent.bind(this), collectionbuilddeduplicationstrategyrequiredevent: this._onCollectionBuildingDeduplicationStrategyRequiredEvent.bind(this)
+ });
+ else
+ this._collectionBuildingEvents = Entertainment.Utilities.addEventHandlers(this._collectionBuildingManager, {
+ collectionbuildbeginevent: this._onCollectionBegin.bind(this), collectionbuildprogressevent: this._onCollectionProgress.bind(this), collectionbuildupsyncprogressevent: this._onCollectionUpSyncProgress.bind(this), collectionbuildendevent: this._onCollectionEnd.bind(this), collectionbuildcloudcollectionv2firsttrackaddedevent: this._onCollectionBuildingCloudCollectionV2FirstTrackAddedEvent.bind(this)
+ });
+ this._createAndSendCloudContentV2Notification(false)
+ }
+ else
+ this._collectionBuildingEvents = Entertainment.Utilities.addEventHandlers(this._collectionBuildingManager, {
+ collectionbuildbeginevent: this._onCollectionBegin.bind(this), collectionbuildprogressevent: this._onCollectionProgress.bind(this), collectionbuildmdlcprogressevent: this._onCollectionMDLCProgress.bind(this), collectionbuildupsyncprogressevent: this._onCollectionUpSyncProgress.bind(this), collectionbuildendevent: this._onCollectionEnd.bind(this), collectionbuildmediasyncedevent: this._onMediaSync.bind(this)
+ })
+ };
+ CollectionChangeNotifierService.prototype._onSignInChanged = function (newValue, oldValue) {
+ if (oldValue === undefined)
+ return;
+ if (newValue)
+ if (this.configManager.service.cleanedUpDatabase) {
+ this.resetCloudListNotification(true);
+ this.configManager.service.cleanedUpDatabase = false
+ }
+ else
+ this._sendCloudMatchingOptInDialogListNotification(false);
+ else
+ this.resetCloudListNotification(false)
+ };
+ CollectionChangeNotifierService.prototype._onNetworkStatusChanged = function () {
+ var _this = this;
+ var isOnline = UI.NetworkStatusService.isOnline();
+ var existingNotification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.networkStatus);
+ var shouldClearNotification = isOnline && !!existingNotification;
+ var shouldSendNotification = !isOnline && !existingNotification && !this._isFilteredToAvailableOffline();
+ if (shouldClearNotification)
+ this._clearListNotification(UI.NotificationCategoryEnum.networkStatus, true);
+ else if (shouldSendNotification) {
+ var allTracksQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ allTracksQuery.mediaAvailability = Microsoft.Entertainment.Platform.MediaAvailability.available;
+ var localTracksQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ localTracksQuery.mediaAvailability = Microsoft.Entertainment.Platform.MediaAvailability.availableOffline;
+ WinJS.Promise.join({
+ totalTrackCount: allTracksQuery.executeCount(), localTrackCount: localTracksQuery.executeCount()
+ }).done(function (result) {
+ if (result.totalTrackCount > result.localTrackCount)
+ _this._sendListNotification(UI.NotificationCategoryEnum.networkStatus, String.load(String.id.IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationNetworkStatus], [{ title: String.load(String.id.IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_BODY) }]);
+ allTracksQuery.dispose();
+ localTracksQuery.dispose()
+ }, function (error) {
+ UI.fail("CollectionChangeNotifier::_onNetworkStatusChanged: Failed to execute library tracks query with the following error: " + error && error.message);
+ allTracksQuery.dispose();
+ localTracksQuery.dispose()
+ })
+ }
+ };
+ CollectionChangeNotifierService.prototype._isFilteredToAvailableOffline = function () {
+ var navigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ var availableOffline = Microsoft.Entertainment.Platform.MediaAvailability.availableOffline;
+ return navigationService && navigationService.realizedDataContext && (navigationService.realizedDataContext.collectionFilter === availableOffline || navigationService.realizedDataContext.filterValue === availableOffline)
+ };
+ CollectionChangeNotifierService.prototype._onCollectionBegin = function (eventData) {
+ MS.Entertainment.UI.assert(eventData, "Missing event data on collection begin event.");
+ MS.Entertainment.UI.assert(eventData.detail, "Missing source data on collection begin event.");
+ MS.Entertainment.UI.assert(eventData.detail.length > 0, "Missing source data on collection begin event.");
+ if (eventData.detail[0] === Microsoft.Entertainment.Platform.CollectionBuildingSource.cloud)
+ return;
+ if (WinJS.Utilities.getMember("Windows.Storage.StorageLibrary"))
+ this._sendListNotification(UI.NotificationCategoryEnum.localContent, String.load(String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.manageFolders], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY) }]);
+ else
+ this._sendListNotification(UI.NotificationCategoryEnum.localContent, String.load(String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationLocalContent], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY) }])
+ };
+ CollectionChangeNotifierService.prototype._onCollectionProgress = function (eventData) {
+ if (this._blockGlobalCollectionChangeEvents) {
+ this._appNotificationService.removeNotificationByCategory(UI.NotificationCategoryEnum.localContent.name);
+ return
+ }
+ MS.Entertainment.UI.assert(eventData, "Missing event data on collection progress event.");
+ MS.Entertainment.UI.assert(eventData.itemsCompleted >= 0, "Missing total count data on collection progress event.");
+ if (eventData.itemsCompleted === 0)
+ return;
+ var isCompleted = !!eventData.isCompleted;
+ var headerMessage = String.empty;
+ var detailsMessage = String.empty;
+ if (isCompleted)
+ headerMessage = String.load(String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1);
+ else
+ headerMessage = String.load(String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1);
+ if (eventData.itemsCompleted > 1)
+ detailsMessage = String.load(String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS).format(eventData.itemsCompleted);
+ else
+ detailsMessage = String.load(String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG).format(eventData.itemsCompleted);
+ this._sendGlobalNotification(UI.NotificationCategoryEnum.localContent, headerMessage, detailsMessage, !isCompleted)
+ };
+ CollectionChangeNotifierService.prototype._onCollectionMDLCProgress = function (eventData) {
+ MS.Entertainment.UI.assert(eventData, "Missing event data on MLDC progress event.");
+ MS.Entertainment.UI.assert(eventData.itemsProcessed >= 0, "Missing item process count data on MLDC progress event.");
+ var isCompleted = !!eventData.isCompleted;
+ var detailsMessage = String.empty;
+ var numberMatched = eventData.itemsProcessed;
+ if (isCompleted) {
+ MS.Entertainment.UI.assert(this.isMDLCFinished, "Received a MDLC is complete event when mdlc.HasMDLCFinished flag has not been set.");
+ MS.Entertainment.UI.assert(this.mdlcPercentageComplete === 100, "Received a MDLC is complete event when mdlc.MdlcPercentageComplete is not 100%.");
+ detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_2)
+ }
+ else {
+ MS.Entertainment.UI.assert(this.mdlcPercentageComplete >= 0, "Received a MDLC in progress event when mdlc.MdlcPercentageComplete is not greater than 0%.");
+ if (numberMatched === 0)
+ detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_0_SONGS_SCANNED_NOTIFICATION_LINE_2).format(numberMatched);
+ else if (numberMatched === 1)
+ detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_1_SONG_SCANNED_NOTIFICATION_LINE_2).format(numberMatched);
+ else
+ detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_N_SONGS_SCANNED_NOTIFICATION_LINE_2).format(numberMatched)
+ }
+ if (!this.isCloudMatchOptedIn) {
+ var mdlcNotification = this._buildMDLCProgressNotification(detailsMessage);
+ var optInCloudNotification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.cloudContent);
+ if (!optInCloudNotification)
+ optInCloudNotification = this._sendCloudMatchingOptInDialogListNotification(true);
+ if (optInCloudNotification) {
+ optInCloudNotification.attachedNotification = mdlcNotification;
+ this._listNotificationService.storeNotifications()
+ }
+ }
+ else {
+ this._sendListNotification(UI.NotificationCategoryEnum.cloudContent, String.load(String.id.IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_1), detailsMessage, [UI.Actions.ActionIdentifiers.notificationCloudContent], [{ matchingDialog: true }]);
+ this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.cloudContent).attachedNotification = null;
+ if (isCompleted)
+ this._cloudCollectionService.requestSync()
+ }
+ };
+ CollectionChangeNotifierService.prototype._onCollectionUpSyncProgress = function (eventData) {
+ MS.Entertainment.UI.assert(eventData, "Missing event data on collection upsync progress event.");
+ MS.Entertainment.UI.assert(eventData.itemsCompleted >= 0, "Missing total count data on collection upsync progress event.");
+ var isCompleted = !!eventData.isCompleted;
+ var headerMessage = String.empty;
+ var detailsMessage = String.empty;
+ var itemsUploaded = eventData.itemsCompleted;
+ if (this._blockGlobalCollectionUpSyncEvents) {
+ if (!this.isCloudDownloadOnAddEnabled) {
+ if (isCompleted)
+ this._blockGlobalCollectionUpSyncEvents = false;
+ return
+ }
+ if (!this._blockedUpSyncItemData)
+ this._blockedUpSyncItemData = {
+ itemsCompleted: itemsUploaded, isCompleted: isCompleted
+ };
+ else {
+ this._blockedUpSyncItemData.itemsCompleted += !isCompleted ? itemsUploaded : 0;
+ this._blockedUpSyncItemData.isCompleted = isCompleted
+ }
+ }
+ else {
+ if (this._blockedUpSyncItemData) {
+ if (!this._blockedUpSyncItemData.isCompleted && !isCompleted)
+ return;
+ itemsUploaded = this._blockedUpSyncItemData.itemsCompleted;
+ this._blockedUpSyncItemData = null
+ }
+ else if (itemsUploaded === 0)
+ return;
+ if (isCompleted)
+ headerMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_MATCHED_NOTIFICATION);
+ else
+ headerMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_SCANNING_NOTIFICATION);
+ if (itemsUploaded > 1)
+ detailsMessage = String.load(String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS).format(itemsUploaded);
+ else
+ detailsMessage = String.load(String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG).format(itemsUploaded);
+ this._sendGlobalNotification(UI.NotificationCategoryEnum.localContent, headerMessage, detailsMessage, !isCompleted)
+ }
+ };
+ CollectionChangeNotifierService.prototype._onCollectionEnd = function (eventData) {
+ var _this = this;
+ MS.Entertainment.UI.assert(eventData, "Missing event data on collection end event.");
+ MS.Entertainment.UI.assert(eventData.error >= 0, "Missing error code data on collection end event.");
+ MS.Entertainment.UI.assert(eventData.itemsCollected >= 0, "Missing count data on collection end event.");
+ MS.Entertainment.UI.assert(eventData.source >= 0, "Missing source data on collection end event.");
+ if (eventData.source === Microsoft.Entertainment.Platform.CollectionBuildingSource.cloud && !this.isCloudCollectionV2Enabled) {
+ var mdlcNotification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.cloudContent);
+ if (mdlcNotification && this.isCloudMatchOptedIn && this.isMDLCFinished) {
+ var trackProvider = (new Microsoft.Entertainment.Platform.MediaStore).trackProvider;
+ trackProvider.getMatchedCountsAsync().done(function (eventData) {
+ MS.Entertainment.UI.assert(eventData, "Missing event data on get matched counts event.");
+ var matchedTrackCount = eventData.localAndCloudValidRightsTrackCount;
+ var totalTrackCount = eventData.localTrackCount;
+ MS.Entertainment.UI.assert(matchedTrackCount >= 0, "Missing total match count data on get matched counts event.");
+ MS.Entertainment.UI.assert(totalTrackCount >= 0, "Missing local track count data on get matched counts event.");
+ var headerMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_1);
+ var detailsMessage = String.empty;
+ if (matchedTrackCount === 0)
+ detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_NO_SONGS_MATCHED_NOTIFICATION_LINE_2);
+ else if (matchedTrackCount === 1)
+ detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2).format(matchedTrackCount);
+ else
+ detailsMessage = String.load(String.id.IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2).format(matchedTrackCount, totalTrackCount);
+ mdlcNotification.attachedNotification = null;
+ _this._sendListNotification(UI.NotificationCategoryEnum.cloudContent, headerMessage, String.empty, [UI.Actions.ActionIdentifiers.notificationCloudContent], [{
+ matchingDialog: true, title: detailsMessage
+ }])
+ }, function (eventData) {
+ MS.Entertainment.fail("CollectionChangeNotifier::_onCollectionEnd: Failed to get matched count for final MDLC notification with the following error: " + eventData && eventData.message)
+ })
+ }
+ }
+ else {
+ if (eventData.error === Microsoft.Entertainment.Platform.CollectionBuildingError.errorMissingMetadata)
+ this._sendListNotification(UI.NotificationCategoryEnum.partialContent, String.load(String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationPartialContent], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY) }]);
+ if (eventData.itemsCollected > 0 || eventData.itemsTotal > 0) {
+ if (WinJS.Utilities.getMember("Windows.Storage.StorageLibrary"))
+ this._sendListNotification(UI.NotificationCategoryEnum.localContent, String.load(String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.manageFolders], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY) }], true);
+ else
+ this._sendListNotification(UI.NotificationCategoryEnum.localContent, String.load(String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationLocalContent], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY) }], true);
+ if (this.isCloudMatchNotApplicable)
+ this.isCloudMatchNotApplicable = false;
+ this._sendCloudMatchingOptInDialogListNotification(false)
+ }
+ else {
+ if (WinJS.Utilities.getMember("Windows.Storage.StorageLibrary"))
+ this._sendListNotification(UI.NotificationCategoryEnum.localContent, String.load(String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.manageFolders], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY) }]);
+ else
+ this._sendListNotification(UI.NotificationCategoryEnum.localContent, String.load(String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationLocalContent], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY) }]);
+ this.isCloudMatchNotApplicable = true
+ }
+ }
+ };
+ CollectionChangeNotifierService.prototype._onMediaSync = function (eventData) {
+ var signedInUser = Entertainment.ServiceLocator.getService(Entertainment.Services.signedInUser);
+ if (signedInUser && signedInUser.isSubscription && (this.isCloudMatchOptedOut || this.isCloudMatchNotApplicable))
+ this._sendListNotification(UI.NotificationCategoryEnum.cloudContent, String.load(String.id.IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE), String.empty, [UI.Actions.ActionIdentifiers.notificationCloudContent], [{ title: String.load(String.id.IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY) }])
+ };
+ CollectionChangeNotifierService.prototype._onCollectionBuildingCloudCollectionV2FirstTrackAddedEvent = function (eventData) {
+ this._createAndSendCloudContentV2Notification(true)
+ };
+ CollectionChangeNotifierService.prototype._onCollectionBuildingDeduplicationStrategyRequiredEvent = function (eventData) {
+ var existingOneDriveNotification = this._listNotificationService.getNotificationByCategory(UI.NotificationCategoryEnum.cloudContentV2);
+ if (!existingOneDriveNotification || (existingOneDriveNotification.actionParamsArray && existingOneDriveNotification.actionParamsArray.length > 0 && existingOneDriveNotification.actionParamsArray[0] && !existingOneDriveNotification.actionParamsArray[0].dedupeDialog)) {
+ var isCompleted = existingOneDriveNotification && existingOneDriveNotification.category.completed;
+ var dedupeOneDriveNotification = UI.ListNotification.createNotification(UI.NotificationCategoryEnum.cloudContentV2, String.load(String.id.IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_BODY), String.empty, [UI.Actions.ActionIdentifiers.notificationCloudContentV2], [{
+ dedupeDialog: true, contentFoundDialog: false, getMoreInfoDialog: false, title: String.load(String.id.IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_ACTION)
+ }], false, UI.AutomationIds.cloudDedupeNotification, false);
+ dedupeOneDriveNotification.attachedNotification = existingOneDriveNotification;
+ dedupeOneDriveNotification.category.completed = true;
+ this._clearListNotification(UI.NotificationCategoryEnum.cloudContentV2, true);
+ this._listNotificationService.send(dedupeOneDriveNotification)
+ }
+ };
+ CollectionChangeNotifierService.prototype.testCollectionBeginNotifications = function () {
+ var eventData = { detail: [0] };
+ this._onCollectionBegin(eventData)
+ };
+ CollectionChangeNotifierService.prototype.testCollectionProgressNotifications = function (itemAddCount, isFinalProgress) {
+ var eventData = {
+ itemsCompleted: itemAddCount, isCompleted: isFinalProgress ? 1 : 0
+ };
+ this._onCollectionProgress(eventData)
+ };
+ CollectionChangeNotifierService.prototype.testCollectionEndNotifications = function (finalItemCount, errorCode) {
+ var eventData = {
+ itemsCollected: finalItemCount, error: errorCode ? errorCode : Microsoft.Entertainment.Platform.CollectionBuildingError.errorNone, source: 0
+ };
+ this._onCollectionEnd(eventData)
+ };
+ CollectionChangeNotifierService.prototype.testCollectionMDLCProgressNotifications = function (itemProcessedCount, isComplete) {
+ var eventData = {
+ itemsProcessed: itemProcessedCount, itemsTotal: 200, isCompleted: isComplete ? 1 : 0
+ };
+ this._onCollectionMDLCProgress(eventData)
+ };
+ CollectionChangeNotifierService.prototype.testCollectionUpSyncProgressNotifications = function (itemUploadCount) {
+ var eventData = {
+ itemsCompleted: itemUploadCount, isCompleted: 1
+ };
+ this._onCollectionUpSyncProgress(eventData)
+ };
+ CollectionChangeNotifierService.prototype.testMediaSyncNotifications = function () {
+ this._onMediaSync(null)
+ };
+ CollectionChangeNotifierService.prototype.testCloudContentV2Notifications = function () {
+ this._onCollectionBuildingCloudCollectionV2FirstTrackAddedEvent(null)
+ };
+ CollectionChangeNotifierService.prototype.testClearListNotifications = function (categoryName) {
+ var category;
+ if (categoryName === UI.NotificationCategoryEnum.localContent.name)
+ category = UI.NotificationCategoryEnum.localContent;
+ else if (categoryName === UI.NotificationCategoryEnum.partialContent.name)
+ category = UI.NotificationCategoryEnum.partialContent;
+ else if (categoryName === UI.NotificationCategoryEnum.cloudContent.name)
+ category = UI.NotificationCategoryEnum.cloudContent;
+ else
+ category = UI.NotificationCategoryEnum.cloudContentV2;
+ this._clearListNotification(category)
+ };
+ CollectionChangeNotifierService.prototype.testClearAllListNotifications = function () {
+ this._clearListNotification(UI.NotificationCategoryEnum.localContent);
+ this._clearListNotification(UI.NotificationCategoryEnum.partialContent);
+ this._clearListNotification(UI.NotificationCategoryEnum.cloudContent);
+ this._clearListNotification(UI.NotificationCategoryEnum.cloudContentV2)
+ };
+ CollectionChangeNotifierService.prototype.testResetListNotifications = function () {
+ this._listNotificationService.reset()
+ };
+ CollectionChangeNotifierService.factory = function () {
+ return new CollectionChangeNotifierService
+ };
+ CollectionChangeNotifierService._instanceCount = 0;
+ return CollectionChangeNotifierService
+ })();
+ UI.CollectionChangeNotifierService = CollectionChangeNotifierService
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.collectionChangeNotifier, MS.Entertainment.UI.CollectionChangeNotifierService.factory)
+})();
+/* >>>>>>/framework/navigatetopageaction.js:32544 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ var NavigateToPageAction = (function (_super) {
+ __extends(NavigateToPageAction, _super);
+ function NavigateToPageAction() {
+ _super.apply(this, arguments);
+ this.animatePageTransition = true
+ }
+ Object.defineProperty(NavigateToPageAction.prototype, "pivotMoniker", {
+ get: function () {
+ return this._pivotMoniker
+ }, set: function (value) {
+ this._pivotMoniker = value
+ }, enumerable: true, configurable: true
+ });
+ NavigateToPageAction.prototype.getPivotMoniker = function (key) {
+ Trace.fail("NavigateToPageAction::getPivotMoniker is abstract and must be subclassed.");
+ return null
+ };
+ NavigateToPageAction.prototype.canExecute = function (param) {
+ return Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.winJSNavigation)
+ };
+ NavigateToPageAction.prototype._navigateTo = function (dataContext, template, referenceElement, contentCompleteCallback, perfStartTime, itemPropertyBag, supportsSnapped) {
+ if (supportsSnapped === void 0)
+ supportsSnapped = false;
+ if (referenceElement)
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ domElement: referenceElement, itemPropertyBag: itemPropertyBag
+ }, {
+ uri: MS.Entertainment.Utilities.getCurrentUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: template, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ if (perfStartTime)
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(perfStartTime);
+ var pivotMoniker = null;
+ if (this.parameter && this.parameter.pivotMoniker)
+ pivotMoniker = this.getPivotMoniker(this.parameter.pivotMoniker);
+ else if (this.pivotMoniker)
+ pivotMoniker = this.getPivotMoniker(this.pivotMoniker);
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateTo(new MS.Entertainment.UI.Framework.NavigationOperation(dataContext, template, contentCompleteCallback, null, this.animatePageTransition, null, pivotMoniker, supportsSnapped))
+ };
+ return NavigateToPageAction
+ })(Actions.Action);
+ Actions.NavigateToPageAction = NavigateToPageAction
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/music1/navigateactions.js:32614 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ var MusicNavigation;
+ (function (MusicNavigation) {
+ (function (Monikers) {
+ Monikers[Monikers["devices"] = 1] = "devices";
+ Monikers[Monikers["explore"] = 2] = "explore";
+ Monikers[Monikers["mymusic"] = 3] = "mymusic";
+ Monikers[Monikers["nowPlaying"] = 4] = "nowPlaying";
+ Monikers[Monikers["radio"] = 5] = "radio"
+ })(MusicNavigation.Monikers || (MusicNavigation.Monikers = {}));
+ var Monikers = MusicNavigation.Monikers
+ })(MusicNavigation = Actions.MusicNavigation || (Actions.MusicNavigation = {}));
+ var MusicNavigateToPageAction = (function (_super) {
+ __extends(MusicNavigateToPageAction, _super);
+ function MusicNavigateToPageAction() {
+ _super.apply(this, arguments)
+ }
+ MusicNavigateToPageAction.prototype.getPivotMoniker = function (key) {
+ return MusicNavigation.Monikers[key]
+ };
+ return MusicNavigateToPageAction
+ })(Actions.NavigateToPageAction);
+ Actions.MusicNavigateToPageAction = MusicNavigateToPageAction;
+ var DeviceHubActions;
+ (function (DeviceHubActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.deviceHubNavigate;
+ this.deviceHubPageUri = "/Components/Music1/DevicesPage.html#devicesBody"
+ }
+ Object.defineProperty(NavigateAction.prototype, "_isCurrentLocationDevicesHub", {
+ get: function () {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ return navigationService.location === this.deviceHubPageUri
+ }, enumerable: true, configurable: true
+ });
+ NavigateAction.prototype.canExecute = function (param) {
+ var featureEnablement = Entertainment.ServiceLocator.getService(Entertainment.Services.featureEnablement);
+ var devicesEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.devicesEnabled);
+ return devicesEnabled && !this._isCurrentLocationDevicesHub
+ };
+ NavigateAction.prototype.executed = function (param) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ navigationService.navigateToMoniker("devices")
+ };
+ return NavigateAction
+ })(Actions.Action);
+ DeviceHubActions.NavigateAction = NavigateAction
+ })(DeviceHubActions = Actions.DeviceHubActions || (Actions.DeviceHubActions = {}));
+ var PlaylistDetailsActions;
+ (function (PlaylistDetailsActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.call(this);
+ this.automationId = MS.Entertainment.UI.AutomationIds.playlistDetailsNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return param != null && param != undefined
+ };
+ NavigateAction.prototype.executed = function (param) {
+ if (!this.canExecute(param))
+ return;
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.PlaylistDetailsRequest);
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ var playlistId = (param.data || param);
+ var playlist = param.data || param;
+ if (typeof playlist !== "object")
+ playlist = null;
+ if (playlist && MS.Entertainment.Utilities.isValidLibraryId(playlist.libraryId))
+ playlistId = playlist.libraryId;
+ if (typeof playlistId !== "number" || isNaN(playlistId))
+ playlistId = -1;
+ navigationService.cancelInProgressNavigation();
+ navigationService.clearHistory();
+ navigationService.navigateTo(new MS.Entertainment.UI.Framework.NavigationOperation(function () {
+ var viewModel = new MS.Entertainment.ViewModels.PlaylistDetailsViewModel(param.data || param);
+ viewModel.loadModules();
+ return viewModel
+ }, "/Components/Music1/PlaylistDetailsPage.html#playlistDetails", MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPlaylistDetailsRequest));
+ if (MS.Entertainment.Utilities.isValidLibraryId(playlistId) && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playlists)) {
+ var playlists = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playlists);
+ playlists.selectPlaylistAsync(playlistId, 1000).done(null, function (error) {
+ MS.Entertainment.UI.Actions.fail("PlaylistDetailsActions::executed() Failed to select playlist pivot. error: " + (error && error.message))
+ })
+ }
+ };
+ return NavigateAction
+ })(Actions.Action);
+ PlaylistDetailsActions.NavigateAction = NavigateAction
+ })(PlaylistDetailsActions = Actions.PlaylistDetailsActions || (Actions.PlaylistDetailsActions = {}));
+ var ArtistDetailsActions;
+ (function (ArtistDetailsActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.artistDetailsNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return !!param
+ };
+ NavigateAction.prototype.executed = function (param, referenceElement) {
+ var artist = param.data ? param.data : param;
+ this._navigateTo(function () {
+ var viewModel = new MS.Entertainment.ViewModels.ArtistDetailsViewModelBase(artist, param.filter || param.collectionFilter);
+ viewModel.loadModules();
+ return viewModel
+ }, "/Components/Music1/ArtistDetailsPage.html#artistDetails", referenceElement, MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioArtistDetailsRequest, MS.Entertainment.Instrumentation.PerfTrack.StartPoints.ArtistDetailsRequest, artist)
+ };
+ return NavigateAction
+ })(MusicNavigateToPageAction);
+ ArtistDetailsActions.NavigateAction = NavigateAction
+ })(ArtistDetailsActions = Actions.ArtistDetailsActions || (Actions.ArtistDetailsActions = {}));
+ var AlbumDetailsActions;
+ (function (AlbumDetailsActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.albumDetailsNavigate;
+ this.pageUri = "/Components/Music1/AlbumDetailsPage.html#albumDetails"
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ if (param !== null && param !== undefined) {
+ var mediaItem = param && "data" in param ? param.data : param;
+ var forceNavigation = param && "forceNavigation" in param ? param.forceNavigation : false;
+ var navigation = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation))
+ navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ var currentDataContext = null;
+ if (navigation)
+ currentDataContext = navigation.realizedDataContext;
+ var canExecute = true;
+ if (currentDataContext && currentDataContext.isShowing) {
+ var libraryId = mediaItem.libraryId || mediaItem;
+ var serviceId = mediaItem.serviceId || mediaItem;
+ var idToCheckfor = MS.Entertainment.Utilities.isValidLibraryId(libraryId) ? libraryId : serviceId;
+ canExecute = forceNavigation || !currentDataContext.isShowing(idToCheckfor)
+ }
+ return canExecute && mediaItem
+ }
+ else
+ return false
+ };
+ NavigateAction.prototype.executed = function (param, referenceElement) {
+ var _this = this;
+ var mediaItem = param.data ? param.data : param;
+ var queryAlbumId;
+ var queryTrack;
+ if (param.isTrack)
+ queryTrack = mediaItem;
+ else if (MS.Entertainment.Utilities.isValidGuid(mediaItem) || MS.Entertainment.Utilities.isValidLibraryId(mediaItem))
+ queryAlbumId = mediaItem;
+ else if (param.isFromSpotlight) {
+ mediaItem.imageUri = String.empty;
+ mediaItem.imageResizeUri = String.empty;
+ mediaItem.imagePrimaryUrl = String.empty
+ }
+ this._navigateTo(function () {
+ var viewModel = _this._createViewModel(mediaItem, param.filter, queryAlbumId, queryTrack);
+ viewModel.mediaItemPromise.done(function () {
+ viewModel.loadModules()
+ });
+ return viewModel
+ }, this.pageUri, referenceElement, MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAlbumDetailsRequest, MS.Entertainment.Instrumentation.PerfTrack.StartPoints.AlbumDetailsRequest, mediaItem)
+ };
+ NavigateAction.prototype._createViewModel = function (mediaItem, filter, queryAlbumId, queryTrack) {
+ return new MS.Entertainment.ViewModels.AlbumDetailsViewModel(mediaItem, filter, queryAlbumId, queryTrack)
+ };
+ return NavigateAction
+ })(MusicNavigateToPageAction);
+ AlbumDetailsActions.NavigateAction = NavigateAction;
+ var DeviceNavigateAction = (function (_super) {
+ __extends(DeviceNavigateAction, _super);
+ function DeviceNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.albumDeviceDetailsNavigate;
+ this.pageUri = "/Components/Music1/DevicesPage.html#devicesBody"
+ }
+ DeviceNavigateAction.prototype._createViewModel = function (mediaItem, filter, queryAlbumId, queryTrack) {
+ return new MS.Entertainment.ViewModels.DevicesAlbumDetailsViewModel(mediaItem)
+ };
+ return DeviceNavigateAction
+ })(NavigateAction);
+ AlbumDetailsActions.DeviceNavigateAction = DeviceNavigateAction
+ })(AlbumDetailsActions = Actions.AlbumDetailsActions || (Actions.AlbumDetailsActions = {}));
+ var CollectionActions;
+ (function (CollectionActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.collectionNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateAction.prototype.executed = function (param) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateToMoniker("mymusic")
+ };
+ return NavigateAction
+ })(Actions.Action);
+ CollectionActions.NavigateAction = NavigateAction
+ })(CollectionActions = Actions.CollectionActions || (Actions.CollectionActions = {}));
+ var ExploreHubActions;
+ (function (ExploreHubActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.exploreHubNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateAction.prototype.executed = function (param) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateToMoniker("explore")
+ };
+ return NavigateAction
+ })(Actions.Action);
+ ExploreHubActions.NavigateAction = NavigateAction
+ })(ExploreHubActions = Actions.ExploreHubActions || (Actions.ExploreHubActions = {}));
+ var RadioActions;
+ (function (RadioActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.radioNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateAction.prototype.executed = function (param) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateToMoniker("radio")
+ };
+ return NavigateAction
+ })(Actions.Action);
+ RadioActions.NavigateAction = NavigateAction
+ })(RadioActions = Actions.RadioActions || (Actions.RadioActions = {}));
+ var SearchActions;
+ (function (SearchActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.searchResultsNavigate;
+ this._searchHubPageUri = "/Components/Music1/SearchResultsHubPage.html#searchResults";
+ this._searchFullResultsPageUri = "/Components/Music1/SearchResultsPage.html#searchResults"
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return !!param
+ };
+ NavigateAction.prototype.executed = function (param, referenceElement) {
+ var _this = this;
+ var searchText = param.searchText;
+ var searchPageUri = this._buildSearchPageUriString(param, false);
+ var navigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ var sourcePage = navigationService.location;
+ var existingSearchText = navigationService.realizedDataContext && navigationService.realizedDataContext.searchText;
+ var existingSearchScope = navigationService.realizedDataContext && navigationService.realizedDataContext.searchScope;
+ if (searchText === existingSearchText && searchPageUri === sourcePage)
+ return;
+ this._navigateTo(function () {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var searchScope;
+ if (!isMusicMarketplaceEnabled || !UI.NetworkStatusService.isOnline())
+ searchScope = 0;
+ else if (sourcePage === _this._searchFullResultsPageUri || sourcePage === _this._searchHubPageUri)
+ searchScope = existingSearchScope;
+ else
+ searchScope = 1;
+ var viewModel;
+ if (param.isAlbumSearch)
+ viewModel = new Entertainment.ViewModels.AlbumSearchGalleryViewModelBase(searchText, searchScope);
+ else if (param.isArtistSearch)
+ viewModel = new Entertainment.ViewModels.ArtistSearchGalleryViewModelBase(searchText, searchScope);
+ else if (param.isSongSearch)
+ viewModel = new Entertainment.ViewModels.SongSearchGalleryViewModelBase(searchText, searchScope);
+ else
+ viewModel = new Entertainment.ViewModels.MusicSearchHubViewModelBase(searchText, searchScope);
+ viewModel.loadModules();
+ return viewModel
+ }, searchPageUri, referenceElement, Entertainment.Instrumentation.PerfTrack.triggerScenarioSearchGalleryRequestToLoad, Entertainment.Instrumentation.PerfTrack.StartPoints.SearchGalleryRequest)
+ };
+ NavigateAction.prototype._buildSearchPageUriString = function (param, includeQueryParam) {
+ var uriString = String.empty;
+ if (param.isAlbumSearch)
+ uriString = includeQueryParam ? this._searchFullResultsPageUri + "?isAlbumSearch=true" : this._searchFullResultsPageUri;
+ else if (param.isArtistSearch)
+ uriString = includeQueryParam ? this._searchFullResultsPageUri + "?isArtistSearch=true" : this._searchFullResultsPageUri;
+ else if (param.isSongSearch)
+ uriString = includeQueryParam ? this._searchFullResultsPageUri + "?isSongSearch=true" : this._searchFullResultsPageUri;
+ else
+ uriString = this._searchHubPageUri;
+ return uriString
+ };
+ return NavigateAction
+ })(MusicNavigateToPageAction);
+ SearchActions.NavigateAction = NavigateAction
+ })(SearchActions = Actions.SearchActions || (Actions.SearchActions = {}));
+ var NewMusicMarketplaceActions;
+ (function (NewMusicMarketplaceActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.newMusicMarketplaceNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateAction.prototype.executed = function (param, referenceElement) {
+ this._navigateTo(function () {
+ return new MS.Entertainment.ViewModels.NewMusicMarketplaceViewModel(MS.Entertainment.ViewModels.NewMusicMarketplaceViewModel.ViewTypes.newAlbums)
+ }, "/Components/Music1/MusicMarketplacePageTemplate.html#marketplacePageBody", referenceElement)
+ };
+ return NavigateAction
+ })(MusicNavigateToPageAction);
+ NewMusicMarketplaceActions.NavigateAction = NavigateAction
+ })(NewMusicMarketplaceActions = Actions.NewMusicMarketplaceActions || (Actions.NewMusicMarketplaceActions = {}));
+ var TopMusicMarketplaceActions;
+ (function (TopMusicMarketplaceActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.topMusicMarketplaceNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateAction.prototype.executed = function (param, referenceElement) {
+ this._navigateTo(function () {
+ return new MS.Entertainment.ViewModels.TopMusicMarketplaceViewModel(MS.Entertainment.ViewModels.TopMusicMarketplaceViewModel.ViewTypes.topMusic, param.pivotType)
+ }, "/Components/Music1/MusicMarketplacePageTemplate.html#marketplacePageBody", referenceElement)
+ };
+ return NavigateAction
+ })(MusicNavigateToPageAction);
+ TopMusicMarketplaceActions.NavigateAction = NavigateAction
+ })(TopMusicMarketplaceActions = Actions.TopMusicMarketplaceActions || (Actions.TopMusicMarketplaceActions = {}));
+ var ArtistMediaActions;
+ (function (ArtistMediaActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.artistMediaNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateAction.prototype.executed = function (param, referenceElement) {
+ MS.Entertainment.UI.Actions.assert(param, "Cannot navigate to artist music page without defining artist parameter");
+ var artist = param.data ? param.data : param;
+ this._navigateTo(function () {
+ return new MS.Entertainment.ViewModels.ArtistMediaViewModel(MS.Entertainment.ViewModels.ArtistMediaViewModel.ViewTypes.artistMusic, artist, param.pivotType, param.modifierSelection)
+ }, "/Components/Music1/MusicMarketplacePageTemplate.html#marketplacePageBody", referenceElement)
+ };
+ return NavigateAction
+ })(MusicNavigateToPageAction);
+ ArtistMediaActions.NavigateAction = NavigateAction
+ })(ArtistMediaActions = Actions.ArtistMediaActions || (Actions.ArtistMediaActions = {}));
+ var NowPlayingActions;
+ (function (NowPlayingActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingNavigate
+ }
+ NavigateAction.prototype.canExecute = function (param) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ var currentDataContext = navigation && navigation.realizedDataContext;
+ return !currentDataContext || (currentDataContext && currentDataContext.view !== "nowPlaying")
+ };
+ NavigateAction.prototype.executed = function (param) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ if (param && param.clearHistory)
+ navigationService.navigateToMoniker(MusicNavigation.Monikers[4]);
+ else {
+ var navigationOperation = new MS.Entertainment.UI.Framework.NavigationOperation(function () {
+ return new MS.Entertainment.ViewModels.NowPlayingViewModel(MS.Entertainment.ViewModels.NowPlayingViewModel.ViewTypes.nowPlaying)
+ }, "/Components/Music1/NowPlayingPage.html#nowPlayingPage");
+ navigationOperation.supportsSnapped = true;
+ navigationService.navigateTo(navigationOperation)
+ }
+ };
+ return NavigateAction
+ })(Actions.Action);
+ NowPlayingActions.NavigateAction = NavigateAction
+ })(NowPlayingActions = Actions.NowPlayingActions || (Actions.NowPlayingActions = {}))
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.playlistDetailsNavigate, function () {
+ return new MS.Entertainment.UI.Actions.PlaylistDetailsActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate, function () {
+ return new MS.Entertainment.UI.Actions.AlbumDetailsActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.albumDeviceDetailsNavigate, function () {
+ return new MS.Entertainment.UI.Actions.AlbumDetailsActions.DeviceNavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.artistDetailsNavigate, function () {
+ return new MS.Entertainment.UI.Actions.ArtistDetailsActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.exploreHubNavigate, function () {
+ return new MS.Entertainment.UI.Actions.ExploreHubActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deviceHubNavigate, function () {
+ return new MS.Entertainment.UI.Actions.DeviceHubActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.newMusicMarketplaceNavigate, function () {
+ return new MS.Entertainment.UI.Actions.NewMusicMarketplaceActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.topMusicMarketplaceNavigate, function () {
+ return new MS.Entertainment.UI.Actions.TopMusicMarketplaceActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.artistMediaNavigate, function () {
+ return new MS.Entertainment.UI.Actions.ArtistMediaActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.collectionNavigate, function () {
+ return new MS.Entertainment.UI.Actions.CollectionActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.searchResultsNavigate, function () {
+ return new MS.Entertainment.UI.Actions.SearchActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.radioNavigate, function () {
+ return new MS.Entertainment.UI.Actions.RadioActions.NavigateAction
+ })
+ })();
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.nowPlayingNavigate, function () {
+ return new MS.Entertainment.UI.Actions.NowPlayingActions.NavigateAction
+ })
+ })()
+})();
+/* >>>>>>/framework/deeplink.js:33117 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.DeepLink");
+ WinJS.Namespace.define("MS.Entertainment.UI.DeepLink", {
+ _hideDeepLinkLoadingOverlayTimeoutMS: 10000, _deepLinksFactories: {}, isRegistered: function isRegistered(appMode) {
+ return !!MS.Entertainment.UI.DeepLink._deepLinksFactories[appMode]
+ }, registerDeepLinksFactory: function registerDeepLinksFactory(appMode, factory) {
+ MS.Entertainment.UI.DeepLink._deepLinksFactories[appMode] = factory
+ }, getTestHooks: function getTestHooks() {
+ return {
+ getRegisteredDeepLinksFactory: function getRegisteredDeepLinksFactory() {
+ return MS.Entertainment.UI.DeepLink._deepLinksFactories
+ }
+ }
+ }, ParamType: {
+ identifier: /^[_a-zA-Z][_a-zA-Z0-9]*$/g, guid: /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/g, mediaId: /^((\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})|[0-9]+)$/g, boolean: /^true|false$/gi, integer: /^[-+]?[0-9]+$/g, unsigned_integer: /^[0-9]+$/g, stringFormat: /.+/g, test: function test(type, value) {
+ type.lastIndex = 0;
+ return type.test(value)
+ }
+ }, PlayStateType: {
+ play: "play", pause: "pause"
+ }, processDeepLink: (function processDeepLink(command, params) {
+ var _deepLinks = null;
+ function convertToActionableParam(paramInput, paramType) {
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ switch (paramType) {
+ case type.identifier:
+ case type.stringFormat:
+ case type.guid:
+ return paramInput;
+ case type.boolean:
+ return (paramInput.toLowerCase() === "true");
+ case type.integer:
+ case type.unsigned_integer:
+ return parseInt(paramInput);
+ case type.mediaId:
+ if (type.test(type.guid, paramInput))
+ return paramInput;
+ else if (type.test(type.unsigned_integer, paramInput))
+ return parseInt(paramInput);
+ else {
+ MS.Entertainment.UI.DeepLink.fail("The parameter input of type mediaId was invalid. ParamInput=" + paramInput);
+ return null
+ }
+ default:
+ MS.Entertainment.UI.DeepLink.fail("The parameter type is not known. ParamType=" + paramType);
+ return null
+ }
+ }
+ return function processDeepLink(command, params) {
+ if (!command)
+ throw "processDeepLink: command parameter is mandatory";
+ if (!params)
+ throw "processDeepLink: params parameter is mandatory";
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ if (!_deepLinks) {
+ var factory = MS.Entertainment.UI.DeepLink._deepLinksFactories[MS.Entertainment.appMode];
+ if (factory)
+ _deepLinks = factory();
+ if (!_deepLinks)
+ return false;
+ for (var name in _deepLinks) {
+ var deepLink = _deepLinks[name];
+ MS.Entertainment.UI.DeepLink.assert(deepLink.actionId, "DeepLink definition: 'actionId' field not specified");
+ MS.Entertainment.UI.DeepLink.assert(deepLink.params, "DeepLink definition: 'params' field not specified");
+ for (var paramName in deepLink.params) {
+ var param = deepLink.params[paramName];
+ MS.Entertainment.UI.DeepLink.assert(typeof param.required === "boolean", "DeepLink definition: 'required' field not specified");
+ MS.Entertainment.UI.DeepLink.assert(param.type, "DeepLink definition: 'type' field not specified")
+ }
+ }
+ }
+ deepLink = _deepLinks[command];
+ if (!deepLink)
+ return false;
+ if (MS.Entertainment.Utilities.isApp2)
+ params = this._normalizeObjectProperties(params, deepLink.params);
+ for (name in deepLink.params)
+ if (deepLink.params[name].required && !params[name])
+ return false;
+ for (name in params) {
+ var parameterInfo = deepLink.params[name];
+ if (!parameterInfo)
+ return false;
+ parameterInfo.type.lastIndex = 0;
+ if (!type.test(parameterInfo.type, params[name]))
+ return false;
+ if (parameterInfo.values)
+ if (parameterInfo.caseInsensitive) {
+ var parameterValue = params[name].toLocaleLowerCase();
+ var validValue = false;
+ for (var i = 0; i < parameterInfo.values.length; i++) {
+ var itemValue = parameterInfo.values[i];
+ if (itemValue && (itemValue.toLocaleLowerCase() === parameterValue)) {
+ validValue = true;
+ break
+ }
+ }
+ if (!validValue)
+ return false
+ }
+ else {
+ var actionParam = convertToActionableParam(params[name], deepLink.params[name].type);
+ if (actionParam === undefined || actionParam === null || deepLink.params[name].values.indexOf(actionParam) === -1)
+ return false
+ }
+ }
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ if (!actionService.isRegistered(deepLink.actionId))
+ return false;
+ var action = actionService.getAction(deepLink.actionId);
+ if (!action.automationId)
+ action.automationId = MS.Entertainment.UI.AutomationIds.deepLink;
+ var actionParams = {};
+ for (name in params) {
+ actionParams[name] = convertToActionableParam(params[name], deepLink.params[name].type);
+ if (actionParams[name] === undefined || actionParams[name] === null)
+ return false
+ }
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ actionParams["navigationDelay"] = 2000;
+ action.parameter = actionParams;
+ action.command = command;
+ action.execute();
+ if (MS.Entertainment.Utilities.isMusicApp2 && !deepLink.hideOverlay)
+ MS.Entertainment.UI.DeepLink._showDeepLinkLoadingOverlay();
+ return true
+ }
+ })(), processProtocol: function processProtocol(url, dataPoint, parameters) {
+ var decodedUrl;
+ try {
+ decodedUrl = decodeURI(url)
+ }
+ catch (e) {
+ MS.Entertainment.UI.DeepLink.fail("processProtocol: decodeURI failed for " + url);
+ return false
+ }
+ var match = /^[a-zA-Z0-9-]+:\/\/([a-zA-Z-]+)\/?\?(.*)$/g.exec(decodedUrl);
+ if (!match && parameters)
+ match = /^([a-zA-Z-]+)\/?\?(.*)$/g.exec(parameters);
+ if (!match || !match[1])
+ return false;
+ var command = match[1];
+ var isValid = true;
+ var deepLinkSource = String.empty;
+ var params = {};
+ if (match[2]) {
+ var nameValuePairs = match[2].split("&");
+ for (var i = 0; i < nameValuePairs.length; i++) {
+ var nameValuePair = nameValuePairs[i];
+ match = /([_a-zA-Z][_a-zA-Z0-9-]*)=(.*)$/g.exec(nameValuePair);
+ if (match && match[1] && match[2] && !params[match[1]])
+ switch (match[1].toLowerCase()) {
+ case "source":
+ if (dataPoint)
+ dataPoint.appendParameter("DeeplinkSource", match[2]);
+ deepLinkSource = match[2];
+ break;
+ case "partnertoken":
+ MS.Entertainment.UI.DeepLink.assert(match[2], "No partner token received when processing deep link: " + url);
+ if (dataPoint)
+ dataPoint.appendParameter("DeepLinkPartnerToken", match[2]);
+ this._updateSignInWithPartnerToken(match[2]);
+ break;
+ case "eventtype":
+ break;
+ default:
+ params[match[1]] = match[2];
+ break
+ }
+ else {
+ isValid = false;
+ break
+ }
+ }
+ }
+ if (deepLinkSource) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.deepLinkSource = deepLinkSource;
+ if (params["ContentID"])
+ uiStateService.deepLinkSourceID = params["ContentID"];
+ uiStateService.deepLinkLaunchTime = Date.now();
+ if (dataPoint) {
+ dataPoint.appendParameter("DeepLinkSourceID", uiStateService.deepLinkSourceID);
+ dataPoint.appendParameter("DeepLinkLaunchTime", uiStateService.deepLinkLaunchTime)
+ }
+ }
+ if (isValid)
+ isValid = this.processDeepLink(command, params);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (isValid)
+ eventProvider.traceDeepLink_Protocol_Invoked(url);
+ else
+ eventProvider.traceDeepLink_Protocol_Failed(url);
+ return isValid
+ }, _updateSignInWithPartnerToken: function _updateSignInWithPartnerToken(partnerToken) {
+ MS.Entertainment.UI.DeepLink.assert(partnerToken, "No partner token received when processing deep link");
+ if (!partnerToken || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ MS.Entertainment.UI.DeepLink.fail("Unable to get sign in service for registering partner token");
+ return
+ }
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signInService.updatePartnerToken(partnerToken)
+ }, processTile: function processTile(tileArgs) {
+ if (typeof tileArgs.command !== "string")
+ return false;
+ var command = tileArgs.command;
+ var params = {};
+ for (var name in tileArgs)
+ if (name !== "command" && typeof tileArgs[name] === "string")
+ params[name] = tileArgs[name];
+ var isValid = this.processDeepLink(command, params);
+ var argumentsAsText = "command=" + command;
+ for (name in params)
+ argumentsAsText = argumentsAsText + ", " + name + "=" + params[name];
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (isValid)
+ eventProvider.traceDeepLink_Tile_Invoked(argumentsAsText);
+ else
+ eventProvider.traceDeepLink_Tile_Failed(argumentsAsText);
+ return isValid
+ }, _showDeepLinkLoadingOverlay: function _showDeepLinkLoadingOverlay() {
+ MS.Entertainment.UI.Controls.Overlay.showLoadingOverlay({
+ userControl: "MS.Entertainment.UI.Controls.LoadingControl", hideOnNowPlaying: true, enableKeyboardLightDismiss: false, onInitialize: function setModel(overlayContent) {
+ var progressControl = document.createElement("progress");
+ WinJS.Utilities.addClass(progressControl, "loadingRing win-ring win-large");
+ overlayContent.appendChild(progressControl);
+ return WinJS.Promise.wrap()
+ }, userControlOptions: {
+ isBusy: true, height: null
+ }, closeTimeoutMS: MS.Entertainment.UI.DeepLink._hideDeepLinkLoadingOverlayTimeoutMS, focusFirstElementOnNavigate: false
+ })
+ }, _normalizeObjectProperties: function _normalizeObjectProperties(unNormalizedObject, templateObject) {
+ var normalizedObject = {};
+ for (var unNormalizedPropertyName in unNormalizedObject)
+ for (var templatePropertyName in templateObject)
+ if (templatePropertyName.toLocaleLowerCase() === unNormalizedPropertyName.toLocaleLowerCase()) {
+ normalizedObject[templatePropertyName] = unNormalizedObject[unNormalizedPropertyName];
+ break
+ }
+ return normalizedObject
+ }
+ });
+ MS.Entertainment.UI.DeepLink.registerDeepLinksFactory(Microsoft.Entertainment.Application.AppMode.music2, function () {
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ return {
+ location: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLocation, params: {
+ id: {
+ type: type.identifier, required: true, values: [MS.Entertainment.UI.Monikers.homeHub, MS.Entertainment.UI.Monikers.musicMarketplaceFeatured, MS.Entertainment.UI.Monikers.flexHub]
+ }, targetId: {
+ type: type.stringFormat, required: false
+ }, gamerTag: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, details: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkDetails, params: {
+ id: {
+ type: type.guid, required: true
+ }, desiredMediaItemType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.album, MS.Entertainment.Data.Query.edsMediaType.musicArtist, MS.Entertainment.Data.Query.edsMediaType.track], caseInsensitive: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog,], caseInsensitive: true
+ }
+ }
+ }, play: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlay, params: {
+ id: {
+ type: type.guid, required: true
+ }, startIndex: {
+ type: type.unsigned_integer, required: false
+ }, desiredMediaItemType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.album, MS.Entertainment.Data.Query.edsMediaType.musicArtist, MS.Entertainment.Data.Query.edsMediaType.track], caseInsensitive: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog,], caseInsensitive: true
+ }, gamerTag: {
+ type: type.stringFormat, required: false
+ }, playSmartDJ: {
+ type: type.boolean, required: false
+ }
+ }
+ }, playto: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlayTo, params: {}
+ }, "default": {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkXBLDefault, params: {
+ PlayState: {
+ type: type.identifier, required: false, values: [MS.Entertainment.UI.DeepLink.PlayStateType.play, MS.Entertainment.UI.DeepLink.PlayStateType.pause], caseInsensitive: true
+ }, DeepLinkInfo: {
+ type: type.stringFormat, required: false
+ }
+ }, hideOverlay: true
+ }, "media-details": {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkXBLDetails, params: {
+ ContentID: {
+ type: type.guid, required: true
+ }, ContentType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.album, MS.Entertainment.Data.Query.edsMediaType.musicArtist, MS.Entertainment.Data.Query.edsMediaType.track, MS.Entertainment.Data.Query.edsMediaType.musicPlaylist], caseInsensitive: true
+ }, DeepLinkInfo: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, "media-playback": {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkXBLPlayback, params: {
+ ContentID: {
+ type: type.guid, required: true
+ }, ContentType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.album, MS.Entertainment.Data.Query.edsMediaType.musicArtist, MS.Entertainment.Data.Query.edsMediaType.track, MS.Entertainment.Data.Query.edsMediaType.musicPlaylist, MS.Entertainment.Data.Query.edsMediaType.musicVideo], caseInsensitive: true
+ }, PlaySmartDJ: {
+ type: type.boolean, required: false
+ }, DeepLinkInfo: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, tunerConfig: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deeplinkTunerConfig, params: {
+ namespace: {
+ type: type.stringFormat, required: true, values: ["features", "music"]
+ }, key: {
+ type: type.stringFormat, required: true, values: ["cloudCollectionV2Enabled", "backgroundAudioEnabled"]
+ }, value: {
+ type: type.stringFormat, required: true
+ }
+ }
+ }
+ }
+ })
+ })()
+})();
+/* >>>>>>/framework/music1/musicdeeplinks.js:33448 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ MS.Entertainment.UI.DeepLink.registerDeepLinksFactory(Microsoft.Entertainment.Application.AppMode.music, function () {
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ return {
+ location: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.musicDeepLinkLocation, params: {
+ id: {
+ type: type.identifier, required: true, values: [MS.Entertainment.UI.Actions.MusicDeepLinksActions.NavigateAction.ids.homeHub, MS.Entertainment.UI.Actions.MusicDeepLinksActions.NavigateAction.ids.musicMarketplaceFeatured,]
+ }, gamerTag: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, details: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.musicDeepLinkDetails, params: {
+ id: {
+ type: type.mediaId, required: true
+ }, dialogOnly: {
+ type: type.boolean, required: false
+ }, origin: {
+ type: type.identifier, required: false, values: ["music"], caseInsensitive: true
+ }, location: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.ItemLocation.marketplace, MS.Entertainment.Data.ItemLocation.collection], caseInsensitive: true
+ }, desiredMediaItemType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.album, MS.Entertainment.Data.Query.edsMediaType.musicArtist, MS.Entertainment.Data.Query.edsMediaType.track, MS.Entertainment.Data.Query.edsMediaType.musicPlaylist], caseInsensitive: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog, MS.Entertainment.Data.ItemIdType.library], caseInsensitive: true
+ }
+ }
+ }, play: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.musicDeepLinkPlayAndNavigate, params: {
+ id: {
+ type: type.guid, required: true
+ }, startIndex: {
+ type: type.unsigned_integer, required: false
+ }, desiredMediaItemType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.album, MS.Entertainment.Data.Query.edsMediaType.musicArtist, MS.Entertainment.Data.Query.edsMediaType.track], caseInsensitive: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog,], caseInsensitive: true
+ }, gamerTag: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, playPin: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.musicPinToStartPlayAndNavigate, params: {
+ id: {
+ type: type.stringFormat, required: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog,], caseInsensitive: true
+ }, mediaType: {
+ type: type.integer, required: true, values: [Microsoft.Entertainment.Queries.ObjectType.track, Microsoft.Entertainment.Queries.ObjectType.album, Microsoft.Entertainment.Queries.ObjectType.person, Microsoft.Entertainment.Queries.ObjectType.playlist, Microsoft.Entertainment.Queries.ObjectType.smartDJ,]
+ }, tileId: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, feedback: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLaunchFeedbackFlyout, params: {
+ url: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, showPerfTrackLog: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkShowPerfTrackLog, params: {
+ enable: {
+ type: type.boolean, required: true
+ }
+ }
+ }, configureMemoryLeakTracking: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkConfigureMemoryLeakTracking, params: {
+ enable: {
+ type: type.boolean, required: true
+ }
+ }
+ }
+ }
+ })
+})();
+/* >>>>>>/framework/music1/musicdeeplinksactions.js:33520 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ var DeepLinkActionBase = (function (_super) {
+ __extends(DeepLinkActionBase, _super);
+ function DeepLinkActionBase() {
+ _super.apply(this, arguments)
+ }
+ DeepLinkActionBase.prototype.executed = function (params) {
+ Actions.fail("executed should be overridden by its subclass");
+ return null
+ };
+ DeepLinkActionBase.prototype.canExecute = function (param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ DeepLinkActionBase.prototype._loadScriptsForMusicDeepLinkActions = function () {
+ return MS.Entertainment.UI.Framework.loadScripts("/ViewModels/MediaItemModel.js", "/ViewModels/PurchaseFlow/SmartBuyStateEngine.js", "/framework/data/augmenters/edsAugmenters.js", "/framework/data/augmenters/musicAugmenters.js", "/framework/data/queries/marketplaceQueries.js", "/framework/data/queries/edsqueries.js", "/Framework/data/queries/musicqueries.js", "/Framework/endpoints.js", "/Framework/ScriptUtilities.js", "/Framework/disabled.js")
+ };
+ DeepLinkActionBase.prototype._loadAndShowNonMarketplaceErrorDialog = function () {
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/MessageBox.html", "messageBoxTemplate", true).then(function () {
+ return WinJS.Promise.timeout()
+ }).done(function () {
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_TITLE), String.load(String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_DESC))
+ }, function (error) {
+ Actions.fail("Failed to load MessageBox loadTemplate for deeplink action: " + error && error.message)
+ })
+ };
+ DeepLinkActionBase.prototype._playMedia = function (mediaItem, automationId) {
+ Actions.assert(mediaItem, "MediaItem is needed for playback.");
+ Actions.assert(mediaItem.mediaType, "MediaItem mediaType is needed for playback.");
+ var actionId;
+ var actionParameter = {
+ mediaItem: mediaItem, enableFallbackToPreview: false, dontUseTrackListForPlayback: true
+ };
+ switch (mediaItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.playArtist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.playMedia;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.playMedia;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.smartDJ:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.playSmartDJ;
+ break;
+ default:
+ Actions.fail(mediaItem.mediaType + " is not a supported media type to play");
+ return
+ }
+ this._updatePlayOptionsForMarketplaceRegion(actionParameter);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var actionToExecute = actionService.getAction(actionId);
+ actionToExecute.automationId = automationId;
+ if (actionToExecute) {
+ actionToExecute.parameter = actionParameter;
+ actionToExecute.execute()
+ }
+ };
+ DeepLinkActionBase.prototype._navigateToMediaDetailsPage = function (mediaItem, origin) {
+ Actions.assert(mediaItem, "MediaItem is needed to navigate.");
+ Actions.assert(mediaItem.mediaType, "MediaItem mediaType is needed to navigate.");
+ var actionId;
+ var actionParameter = {
+ data: mediaItem, isTrack: false, location: MS.Entertainment.Data.ItemLocation.collection, clearHistory: false
+ };
+ switch (mediaItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.artistDetailsNavigate;
+ if (!MS.Entertainment.Utilities.isValidLibraryId(mediaItem.libraryId))
+ actionParameter.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate;
+ if (!MS.Entertainment.Utilities.isValidLibraryId(mediaItem.libraryId))
+ actionParameter.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate;
+ actionParameter.isTrack = true;
+ if (!MS.Entertainment.Utilities.isValidLibraryId(mediaItem.libraryId))
+ actionParameter.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.playlistDetailsNavigate;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.smartDJ:
+ actionId = MS.Entertainment.UI.Actions.ActionIdentifiers.nowPlayingNavigate;
+ actionParameter.clearHistory = true;
+ break;
+ default:
+ Actions.fail(mediaItem.mediaType + " is not a supported media type.");
+ return
+ }
+ MS.Entertainment.Framework.ScriptUtilities.waitForSnappedIfNeeded().done(function () {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ var moniker = "";
+ if (actionParameter.location === MS.Entertainment.Data.ItemLocation.marketplace && origin !== "music")
+ moniker = "explore";
+ else if (actionParameter.location === MS.Entertainment.Data.ItemLocation.collection && actionId !== MS.Entertainment.UI.Actions.ActionIdentifiers.nowPlayingNavigate)
+ moniker = "mymusic";
+ if (moniker.length > 0)
+ navigation.navigateToMoniker(moniker, true);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var actionToExecute = actionService.getAction(actionId);
+ if (actionToExecute) {
+ actionToExecute.parameter = actionParameter;
+ actionToExecute.execute()
+ }
+ }, function (error) {
+ MS.Entertainment.UI.Controls.assert(WinJS.Promise.isCanceledError(error), "musicDeeplinksActions::_navigateToMediaDetailsPage: Failed to wait to snapped. Error:" + error + ": " + error.message)
+ })
+ };
+ DeepLinkActionBase.prototype._updatePlayOptionsForMarketplaceRegion = function (playbackParameters) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay))
+ return;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace))
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSubscription)) {
+ if (!MS.Entertainment.Utilities.currentOrLastUserSubscriptionEnabled())
+ playbackParameters.enableFallbackToPreview = true
+ }
+ else
+ playbackParameters.enableFallbackToPreview = true
+ };
+ return DeepLinkActionBase
+ })(Actions.Action);
+ Actions.DeepLinkActionBase = DeepLinkActionBase;
+ var MusicDeepLinksActions;
+ (function (MusicDeepLinksActions) {
+ var NavigateAction = (function (_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.musicDeepLinkLocation
+ }
+ NavigateAction.prototype.executed = function (param) {
+ this._loadScriptsForMusicDeepLinkActions().done(function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = null;
+ if (param.id === NavigateAction.ids.musicMarketplaceFeatured)
+ action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.exploreHubNavigate);
+ else if (param.id === NavigateAction.ids.homeHub)
+ action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigateToDefault);
+ else {
+ Actions.fail("Unexpected marketplace location: " + param.id);
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ if (navigation.location)
+ return;
+ else
+ action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigateToDefault)
+ }
+ action.parameter = param;
+ if (!action.automationId)
+ action.automationId = MS.Entertainment.UI.AutomationIds.deepLink;
+ MS.Entertainment.Framework.ScriptUtilities.waitForSnappedIfNeeded().done(function () {
+ action.execute()
+ }, function (error) {
+ MS.Entertainment.UI.Controls.assert(WinJS.Promise.isCanceledError(error), "musicDeeplinksActions::NavigationAction::executed: Failed to wait to snapped. Error:" + error + ": " + error.message)
+ })
+ }, function (error) {
+ Actions.fail("NavigateAction::executed failed because _loadScriptsForMusicDeepLinkActions() failed. Message: " + error && error.message)
+ })
+ };
+ NavigateAction.ids = {
+ homeHub: "homeHub", musicMarketplaceFeatured: "musicMarketplaceFeatured"
+ };
+ return NavigateAction
+ })(DeepLinkActionBase);
+ MusicDeepLinksActions.NavigateAction = NavigateAction;
+ var NavigateToDetailsAction = (function (_super) {
+ __extends(NavigateToDetailsAction, _super);
+ function NavigateToDetailsAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.musicDeepLinkDetails
+ }
+ NavigateToDetailsAction.prototype.canExecute = function (params) {
+ return MS.Entertainment.UI.NetworkStatusService.isOnline() || (params && params.origin !== "music")
+ };
+ NavigateToDetailsAction.prototype.executed = function (params) {
+ var _this = this;
+ Actions.assert(params, "params is expected.");
+ Actions.assert(params.id, "params.id is expected.");
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigation.navigateToDefault();
+ this._loadAndShowNonMarketplaceErrorDialog();
+ return
+ }
+ var navigationPromise;
+ var networkStatus = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus);
+ if (!networkStatus.isEnabled(0))
+ navigationPromise = WinJS.Promise.wrapError(new Error("Music marketplace network is not enabled. Cannot execute to music details deeplink."));
+ WinJS.Promise.as(navigationPromise).then(function () {
+ return _this._loadScriptsForMusicDeepLinkActions()
+ }).then(function () {
+ if (!params.desiredMediaItemType)
+ return MS.Entertainment.Platform.PlaybackHelpers.getMediaByServiceId(params.id);
+ var location = MS.Entertainment.Data.ItemLocation.marketplace;
+ if (params.location)
+ location = params.location.toLowerCase();
+ var item;
+ if (params.idType)
+ switch (params.idType.toLocaleLowerCase()) {
+ case MS.Entertainment.Data.Query.edsIdType.canonical.toLocaleLowerCase():
+ item = { ID: params.id };
+ break;
+ case MS.Entertainment.Data.Query.edsIdType.zuneCatalog.toLocaleLowerCase():
+ item = { ZuneId: params.id };
+ break;
+ case MS.Entertainment.Data.ItemIdType.library.toLocaleLowerCase():
+ item = { ObjectId: params.id };
+ break;
+ default:
+ return WinJS.Promise.wrapError(new Error("Unknown media ID type."));
+ break
+ }
+ else
+ item = { ID: params.id };
+ var media = null;
+ if (location === MS.Entertainment.Data.ItemLocation.marketplace) {
+ item.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ switch (params.desiredMediaItemType.toLocaleLowerCase()) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicArtist.toLocaleLowerCase():
+ media = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSArtist);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.album.toLocaleLowerCase():
+ media = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSAlbum);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.track.toLocaleLowerCase():
+ media = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSTrack);
+ break;
+ default:
+ media = WinJS.Promise.wrapError(new Error("Unknown marketplace media type passed to details deeplink. Media Type: " + params.desiredMediaItemType));
+ break
+ }
+ }
+ else if (location === MS.Entertainment.Data.ItemLocation.collection) {
+ item.location = MS.Entertainment.Data.ItemLocation.collection;
+ switch (params.desiredMediaItemType.toLocaleLowerCase()) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicPlaylist.toLocaleLowerCase():
+ media = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Library.Playlist);
+ break;
+ default:
+ media = WinJS.Promise.wrapError(new Error("Unknown collection media type passed to details deeplink. Media Type: " + params.desiredMediaItemType));
+ break
+ }
+ }
+ else
+ media = WinJS.Promise.wrapError(new Error("Unknown location type passed to details deeplink. Location: " + location));
+ return media
+ }).done(function (media) {
+ _this._navigateToMediaDetailsPage(media, params.origin)
+ }, function (error) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigation.navigateToDefault();
+ Actions.fail("Failed to navigate to the deeplink. Error: " + (error && error.message))
+ })
+ };
+ return NavigateToDetailsAction
+ })(DeepLinkActionBase);
+ MusicDeepLinksActions.NavigateToDetailsAction = NavigateToDetailsAction;
+ var DeepLinkLaunchFeedbackFlyout = (function (_super) {
+ __extends(DeepLinkLaunchFeedbackFlyout, _super);
+ function DeepLinkLaunchFeedbackFlyout() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.deepLinkLaunchFeedbackFlyout
+ }
+ DeepLinkLaunchFeedbackFlyout.prototype.executed = function (params) {
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/UserFeedbackDialog.html#userFeedbackDialogTemplate", null, true).done(function () {
+ if (params.url)
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.shareUrl = params.url;
+ MS.Entertainment.UI.Shell.showFeedbackDialog()
+ })
+ };
+ return DeepLinkLaunchFeedbackFlyout
+ })(Actions.Action);
+ MusicDeepLinksActions.DeepLinkLaunchFeedbackFlyout = DeepLinkLaunchFeedbackFlyout;
+ var DeeplinkPlayAndNavigateAction = (function (_super) {
+ __extends(DeeplinkPlayAndNavigateAction, _super);
+ function DeeplinkPlayAndNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.musicDeepLinkPlayAndNavigate
+ }
+ DeeplinkPlayAndNavigateAction.prototype.executed = function (params) {
+ var _this = this;
+ Actions.assert(params, "Music deeplink activation params is expected.");
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigation.navigateToDefault();
+ this._loadAndShowNonMarketplaceErrorDialog();
+ return
+ }
+ var mediaToPlay = null;
+ WinJS.Promise.join({
+ mediaItem: this._getMediaItem(params), scripts: this._loadScriptsForMusicDeepLinkActions()
+ }).then(function (result) {
+ if (result.mediaItem) {
+ mediaToPlay = result.mediaItem;
+ _this._navigateToMediaDetailsPage(mediaToPlay);
+ var validation = new MS.Entertainment.Framework.PlayValidation.MediaPlayValidation;
+ return validation.validatePlayMedia(mediaToPlay)
+ }
+ else
+ return WinJS.Promise.wrapError(new Error("No mediaItem found."))
+ }).done(function () {
+ _this._playMedia(mediaToPlay, MS.Entertainment.UI.AutomationIds.deepLinkPlay)
+ }, function (error) {
+ if (!WinJS.Promise.isCanceledError(error)) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigation.navigateToDefault()
+ }
+ })
+ };
+ DeeplinkPlayAndNavigateAction.prototype._getMediaItem = function (deeplinkParams) {
+ Actions.assert(deeplinkParams, "Deeplink activation parameters are needed to get the media item.");
+ Actions.assert(deeplinkParams.id, "Deeplink media id is needed to get the media item.");
+ var id = deeplinkParams.id;
+ var idType = deeplinkParams.idType;
+ var mediaItemPromise = MS.Entertainment.Platform.PlaybackHelpers.getMediaByServiceId(id, idType);
+ return mediaItemPromise.then(function (media) {
+ if (media)
+ return media.hydrate()
+ }, function (error) {
+ return WinJS.Promise.wrapError(new Error("Failed to get media item for deeplink. Error: " + error && error.message))
+ })
+ };
+ return DeeplinkPlayAndNavigateAction
+ })(DeepLinkActionBase);
+ MusicDeepLinksActions.DeeplinkPlayAndNavigateAction = DeeplinkPlayAndNavigateAction
+ })(MusicDeepLinksActions = Actions.MusicDeepLinksActions || (Actions.MusicDeepLinksActions = {}));
+ var MusicPinToStartActions;
+ (function (MusicPinToStartActions) {
+ var PlayAndNavigateAction = (function (_super) {
+ __extends(PlayAndNavigateAction, _super);
+ function PlayAndNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.musicPinToStartPlayAndNavigate
+ }
+ PlayAndNavigateAction.prototype.executed = function (params) {
+ var _this = this;
+ Actions.assert(params, "Music pin activation params is expected.");
+ var mediaToPlay = null;
+ WinJS.Promise.join({
+ mediaItem: this._getMediaItem(params), scripts: this._loadScriptsForMusicDeepLinkActions()
+ }).then(function (result) {
+ var mediaPlaySignal = new UI.Framework.Signal;
+ if (result.mediaItem) {
+ mediaToPlay = result.mediaItem;
+ _this._navigateToMediaDetailsPage(mediaToPlay);
+ if (_this._shouldPlayMedia(mediaToPlay, params)) {
+ var validation = new MS.Entertainment.Framework.PlayValidation.MediaPlayValidation;
+ return validation.validatePlayMedia(mediaToPlay)
+ }
+ else
+ mediaPlaySignal.promise.cancel()
+ }
+ else
+ mediaPlaySignal.error(new Error("No mediaItem found."));
+ return mediaPlaySignal.promise
+ }).done(function () {
+ _this._playMedia(mediaToPlay, MS.Entertainment.UI.AutomationIds.deepLinkPlay)
+ }, function (error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ _this._showErrorDialog(params)
+ })
+ };
+ PlayAndNavigateAction.prototype._getMediaItem = function (pinParams) {
+ Actions.assert(pinParams, "Pin activation parameters are needed to get the media item.");
+ Actions.assert(pinParams.id, "Pin media id is needed to get the media item.");
+ Actions.assert(pinParams.mediaType, "Pin media type is needed to get the media item.");
+ var id = pinParams.id;
+ var idType = pinParams.idType;
+ var mediaType = pinParams.mediaType;
+ var mediaItemPromise;
+ var isSmartDj = mediaType === Microsoft.Entertainment.Queries.ObjectType.smartDJ;
+ if (MS.Entertainment.Utilities.isValidLibraryId(id))
+ mediaItemPromise = MS.Entertainment.Utilities.createMediaItemByLibraryInfo(id, mediaType);
+ else {
+ Actions.assert(pinParams.idType, "Pin media id type is needed to get the media item.");
+ if (isSmartDj)
+ idType = MS.Entertainment.Data.Query.edsIdType.canonical;
+ mediaItemPromise = MS.Entertainment.Platform.PlaybackHelpers.getMediaByServiceId(id, idType)
+ }
+ return mediaItemPromise.then(function (media) {
+ if (media) {
+ if (isSmartDj)
+ media.mediaType = Microsoft.Entertainment.Queries.ObjectType.smartDJ;
+ return media.hydrate()
+ }
+ else
+ return WinJS.Promise.wrapError(new Error("Failed to get media item for pin. Id: " + id))
+ }, function (error) {
+ return WinJS.Promise.wrapError(new Error("Failed to get media item for pin. Error: " + error && error.message))
+ })
+ };
+ PlayAndNavigateAction.prototype._shouldPlayMedia = function (pinnedMedia, pinParams) {
+ Actions.assert(pinParams, "Pin activation parameters are needed to play the media item.");
+ Actions.assert(pinnedMedia, "Pinned media is needed for playback.");
+ return !(pinParams.tileId && pinnedMedia.mediaType === Microsoft.Entertainment.Queries.ObjectType.person)
+ };
+ PlayAndNavigateAction.prototype._showErrorDialog = function (pinParams) {
+ var _this = this;
+ this._loadScriptsForMusicDeepLinkActions().then(function () {
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/MessageBox.html", "messageBoxTemplate", true).done(function () {
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_MEDIA_ERROR_CAPTION), String.load(String.id.IDS_PIN_TO_START_LINK_ERROR_TEXT), {
+ width: "100%", height: "410px", defaultButtonIndex: 0, buttons: [_this._createUnpinFromStartButton(pinParams), _this._createCancelButton()]
+ }).then(null, function (error) {
+ Actions.fail("PlayAndNavigateAction::_showErrorDialog. Failed to unpin from start. Error: " + (error && error.message))
+ })
+ });
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigation.navigateToDefault()
+ })
+ };
+ PlayAndNavigateAction.prototype._createCancelButton = function () {
+ return {
+ title: String.load(String.id.IDS_CANCEL_BUTTON), execute: this._onCancel.bind(this)
+ }
+ };
+ PlayAndNavigateAction.prototype._createUnpinFromStartButton = function (pinParams) {
+ return {
+ title: String.load(String.id.IDS_UNPIN_FROM_START_SCREEN_BUTTON), execute: function (dialog) {
+ Actions.assert(pinParams.tileId, "Pinned tile id is needed for unpin action");
+ var tileIDs = [pinParams.tileId];
+ var pinToStartScreenService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.pinToStartScreen);
+ pinToStartScreenService.unpinAsync(tileIDs).done(function () {
+ dialog.hide()
+ })
+ }
+ }
+ };
+ PlayAndNavigateAction.prototype._onCancel = function (dialog) {
+ dialog.hide()
+ };
+ return PlayAndNavigateAction
+ })(DeepLinkActionBase);
+ MusicPinToStartActions.PlayAndNavigateAction = PlayAndNavigateAction
+ })(MusicPinToStartActions = Actions.MusicPinToStartActions || (Actions.MusicPinToStartActions = {}))
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.musicDeepLinkLocation, function () {
+ return new MS.Entertainment.UI.Actions.MusicDeepLinksActions.NavigateAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.musicDeepLinkDetails, function () {
+ return new MS.Entertainment.UI.Actions.MusicDeepLinksActions.NavigateToDetailsAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLaunchFeedbackFlyout, function () {
+ return new MS.Entertainment.UI.Actions.MusicDeepLinksActions.DeepLinkLaunchFeedbackFlyout
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.musicDeepLinkPlayAndNavigate, function () {
+ return new MS.Entertainment.UI.Actions.MusicDeepLinksActions.DeeplinkPlayAndNavigateAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.musicPinToStartPlayAndNavigate, function () {
+ return new MS.Entertainment.UI.Actions.MusicPinToStartActions.PlayAndNavigateAction
+ })
+ })()
+})();
+/* >>>>>>/framework/music1/musicflyoutactions.js:34005 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ var ShowPurchaseConfirmationFlyoutAction = (function (_super) {
+ __extends(ShowPurchaseConfirmationFlyoutAction, _super);
+ function ShowPurchaseConfirmationFlyoutAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.showPurchaseConfirmationFlyout
+ }
+ ShowPurchaseConfirmationFlyoutAction.prototype.canExecute = function (param) {
+ return true
+ };
+ ShowPurchaseConfirmationFlyoutAction.prototype.executed = function (param) {
+ var purchaseFlyout = new UI.Controls.PurchaseConfirmationFlyout;
+ purchaseFlyout.text = String.load(String.id.IDS_MUSIC_DTO_CONFIRM_FLYOUT_TITLE);
+ purchaseFlyout.description = String.load(String.id.IDS_MUSIC_DTO_CONFIRM_FLYOUT_BODY);
+ purchaseFlyout.referenceDomElement = document.querySelector(".verticalPivotItem_collection");
+ purchaseFlyout.referenceDomElementContainer = document.querySelector(".navpane-content");
+ Actions.assert(purchaseFlyout.referenceDomElement, "Flyout anchor point element was not found");
+ purchaseFlyout.flyoutAlignment = 2;
+ purchaseFlyout.showFlyout()
+ };
+ return ShowPurchaseConfirmationFlyoutAction
+ })(Actions.Action);
+ Actions.ShowPurchaseConfirmationFlyoutAction = ShowPurchaseConfirmationFlyoutAction;
+ var ShowResetCloudCollectionFlyoutAction = (function (_super) {
+ __extends(ShowResetCloudCollectionFlyoutAction, _super);
+ function ShowResetCloudCollectionFlyoutAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.showResetCloudCollectionFlyout
+ }
+ ShowResetCloudCollectionFlyoutAction.prototype.canExecute = function (param) {
+ return true
+ };
+ ShowResetCloudCollectionFlyoutAction.prototype.executed = function (param) {
+ var resetCloudFlyout = new UI.Controls.PurchaseConfirmationFlyout;
+ resetCloudFlyout.text = String.load(String.id.IDS_MUSIC_RESET_COLLECTION_FLYOUT_TITLE);
+ resetCloudFlyout.description = String.load(String.id.IDS_MUSIC_RESET_COLLECTION_FLYOUT_BODY);
+ resetCloudFlyout.referenceDomElement = document.querySelector(".verticalPivotItem_collection");
+ resetCloudFlyout.referenceDomElementContainer = document.querySelector(".navpane-content");
+ Actions.assert(resetCloudFlyout.referenceDomElement, "ShowResetCloudCollectionFlyoutAction::executed() Flyout anchor point element was not found");
+ resetCloudFlyout.flyoutAlignment = 2;
+ resetCloudFlyout.showFlyout()
+ };
+ return ShowResetCloudCollectionFlyoutAction
+ })(Actions.Action);
+ Actions.ShowResetCloudCollectionFlyoutAction = ShowResetCloudCollectionFlyoutAction;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.showPurchaseConfirmationFlyout, function () {
+ return new MS.Entertainment.UI.Actions.ShowPurchaseConfirmationFlyoutAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.showResetCloudCollectionFlyout, function () {
+ return new MS.Entertainment.UI.Actions.ShowResetCloudCollectionFlyoutAction
+ })
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/shortcutmanager.js:34082 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ ShortcutCategory: { keyboardShortcut: "keyboardShortcut" }, ShortcutManager: MS.Entertainment.UI.Framework.define(null, {
+ _registeredHandlers: [], _registeredShortcuts: [], blockKeyboardShortcuts: false, registerShortcutCategoryHandler: function registerShortcutCategoryHandler(shortcutCategory, handler) {
+ if (MS.Entertainment.Framework.ShortcutCategory.hasOwnProperty(shortcutCategory)) {
+ var registered = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (registered === -1)
+ if (handler && handler.registerShortcut && handler.unregisterShortcut)
+ this._registeredHandlers.push({
+ shortcutCategory: shortcutCategory, handler: handler
+ });
+ else
+ MS.Entertainment.Framework.assert(false, "Shortcut Handler does not meet contract");
+ else
+ MS.Entertainment.Framework.assert(false, "Already registered Handler for " + shortcutCategory)
+ }
+ else
+ MS.Entertainment.Framework.assert(false, "Unrecognized shortcut category " + shortcutCategory)
+ }, unregisterShortcutCategoryHandler: function unregisterShortcutCategoryHandler(shortcutCategory) {
+ var removed;
+ var index = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (index > -1)
+ removed = this._registeredHandlers.splice(index, 1);
+ if (removed && removed[0] && removed[0].handler && removed[0].handler.dispose)
+ removed[0].handler.dispose()
+ }, registerShortcut: function registerShortcut(shortcutCategory, shortcut, action) {
+ if (MS.Entertainment.Framework.ShortcutCategory.hasOwnProperty(shortcutCategory)) {
+ var index = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (index > -1)
+ this._registeredHandlers[index].handler.registerShortcut(shortcut, action);
+ else
+ MS.Entertainment.Framework.assert(false, "No registered Handler for " + shortcutCategory)
+ }
+ else
+ MS.Entertainment.Framework.assert(false, "Unrecognized shortcut category " + shortcutCategory)
+ }, unregisterShortcut: function unregisterShortcut(shortcutCategory, shortcut) {
+ var handlerIndex = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (index > -1)
+ var success = this._registeredHandlers[index].handler.unregisterShortcut(shortcut)
+ }, _getCategoryRegistrationIndex: function _getCategoryRegistrationIndex(shortcutCategory) {
+ var index = -1;
+ for (var i = 0; i < this._registeredHandlers.length; i++)
+ if (this._registeredHandlers[i].shortcutCategory === shortcutCategory) {
+ index = i;
+ break
+ }
+ return index
+ }
+ }, null)
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.shortcutManager, function ShortcutManagerFactory() {
+ return new MS.Entertainment.Framework.ShortcutManager
+ })
+ })()
+})();
+/* >>>>>>/framework/keyboardshortcuthandler.js:34143 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ KeyboardShortcutModifiers: {
+ ctrl: "ctrl", alt: "alt", shift: "shift"
+ }, KeyboardShortcutHandler: MS.Entertainment.UI.Framework.define(function KeyboardShortcutHandler() {
+ this._keyModifiers = MS.Entertainment.Framework.KeyboardShortcutModifiers
+ }, {
+ initialize: function initialize() {
+ if (this._documentEvents) {
+ this._documentEvents.cancel();
+ this._documentEvents = null
+ }
+ var documentEvents;
+ if (MS.Entertainment.Utilities.isApp2)
+ documentEvents = { keyup: this._handleKey.bind(this) };
+ else
+ documentEvents = { keydown: this._handleKey.bind(this) };
+ this._documentEvents = MS.Entertainment.Utilities.addEventHandlers(document, documentEvents, false)
+ }, _handleKey: function _handleKey(event) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var shortcutManagerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shortcutManager);
+ var flyoutFocused = WinJS.UI.AutomaticFocus && WinJS.UI.AutomaticFocus.focusRoot && WinJS.Utilities.hasClass(WinJS.UI.AutomaticFocus.focusRoot, "win-flyout");
+ var overlayVisible = flyoutFocused || uiStateService.overlayVisible;
+ var globalButtonPressed = MS.Entertainment.Utilities.isApp2 && (event.keyCode === WinJS.Utilities.Key.invokeGlobalCommand || event.keyCode === WinJS.Utilities.Key.ltButton || event.keyCode === WinJS.Utilities.Key.rtButton || (event.altKey && event.keyCode === WinJS.Utilities.Key.enter));
+ var allowDismissButton = !overlayVisible || WinJS.Utilities.getMember("MS.Entertainment.UI.Framework.currentOverlayContainer.winControl.allowBackNavigate");
+ var dismissButtonPressed = event.keyCode === WinJS.Utilities.Key.dismissButton && allowDismissButton;
+ if (!dismissButtonPressed && shortcutManagerService.blockKeyboardShortcuts)
+ return;
+ if (overlayVisible && !globalButtonPressed && !dismissButtonPressed)
+ return;
+ var keys = {};
+ if (event.shiftKey)
+ keys.shift = true;
+ if (event.ctrlKey)
+ keys.ctrl = true;
+ if (event.altKey)
+ keys.alt = true;
+ if (event.keyCode)
+ keys.key = event.keyCode;
+ var index = this._checkShortcutRegistration(keys);
+ if (index > -1) {
+ var shortcut = this._registeredShortcuts[index];
+ if (!((MS.Entertainment.Utilities.doesElementSupportKeyboardInput(event.target) || event.target.isContentEditable) && !shortcut.shortcut.allowInEditControls))
+ shortcut.action.execute()
+ }
+ }, _registeredShortcuts: [], _keyModifiers: null, _windowEvents: null, _documentEvents: null, dispose: function dispose() {
+ if (this._windowEvents) {
+ this._windowEvents.cancel();
+ this._windowEvents = null
+ }
+ if (this._documentEvents) {
+ this._documentEvents.cancel();
+ this._documentEvents = null
+ }
+ }, registerShortcut: function registerShortcut(shortcut, action) {
+ if (shortcut && shortcut.key && action) {
+ var registered = this._checkShortcutRegistration(shortcut);
+ if (registered === -1)
+ this._registeredShortcuts.push({
+ shortcut: shortcut, action: action
+ });
+ else
+ Trace.fail("Shortcut already registered " + shortcut.key)
+ }
+ else {
+ Trace.assert(shortcut, "Invalid shortcut, shortcut variable is falsy");
+ Trace.assert(action, "Invalid shortcut, action variable is falsy")
+ }
+ }, unregisterShortcut: function unregisterShortcut(shortcut) {
+ var index = this._checkShortcutRegistration(shortcut);
+ if (index > -1)
+ this._registeredShortcuts.splice(index, 1)
+ }, _checkShortcutRegistration: function _checkShortcutRegistration(shortcut) {
+ var index = -1;
+ var registeredShortcut = null;
+ for (var i = 0; i < this._registeredShortcuts.length; i++) {
+ registeredShortcut = this._registeredShortcuts[i].shortcut;
+ if ((registeredShortcut.alt === shortcut.alt) && (registeredShortcut.ctrl === shortcut.ctrl) && (registeredShortcut.shift === shortcut.shift) && (registeredShortcut.key === shortcut.key)) {
+ index = i;
+ break
+ }
+ }
+ return index
+ }
+ }, {
+ _instance: null, instance: {
+ get: function () {
+ if (!MS.Entertainment.Framework.KeyboardShortcutHandler._instance)
+ MS.Entertainment.Framework.KeyboardShortcutHandler._instance = new MS.Entertainment.Framework.KeyboardShortcutHandler;
+ return MS.Entertainment.Framework.KeyboardShortcutHandler._instance
+ }
+ }
+ })
+ });
+ var shortcutManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shortcutManager);
+ shortcutManager.registerShortcutCategoryHandler(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, MS.Entertainment.Framework.KeyboardShortcutHandler.instance)
+ })()
+})();
+/* >>>>>>/framework/data/augmenters/commonhydrators.js:34245 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Media");
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Hydrator");
+ WinJS.Namespace.define("MS.Entertainment.Hydrator", {
+ prepareDetailsQuery: function prepareDetailsQuery(query, queryWatcher, hydrating) {
+ if (query) {
+ if (hydrating.hasCanonicalId) {
+ query.id = hydrating.canonicalId;
+ query.idType = MS.Entertainment.Data.Query.edsIdType.canonical
+ }
+ else {
+ query.id = hydrating.serviceId;
+ query.idType = hydrating.serviceIdType
+ }
+ query.impressionGuid = hydrating.impressionGuid;
+ query.acquisitionData = hydrating.acquisitionData;
+ query.relevancyTrackingContent = hydrating.relevancyTrackingContent;
+ if (queryWatcher)
+ queryWatcher.registerQuery(query)
+ }
+ return query
+ }, sanitizeLibraryIds: function sanitizeLibraryIds(data, hydrating) {
+ if (hydrating && MS.Entertainment.Utilities.isValidLibraryId(hydrating.libraryId))
+ data.libraryId = hydrating.libraryId
+ }, sanitizeIds: function sanitizeIds(data, hydrating) {
+ var result = data;
+ hydrating = hydrating || {};
+ if (data) {
+ this.sanitizeLibraryIds(data, hydrating);
+ result = MS.Entertainment.ViewModels.MediaItemModel.getLibraryIdAsync(data).then(function gotLibraryId(libraryId) {
+ data.libraryId = libraryId;
+ if (!MS.Entertainment.Utilities.isEmptyGuid(hydrating.zuneId) || MS.Entertainment.Utilities.isEmptyGuid(data.zuneId))
+ data.zuneId = null;
+ if (MS.Entertainment.Utilities.isEmptyGuid(data.canonicalId))
+ data.canonicalId = null;
+ if (MS.Entertainment.Utilities.isEmptyGuid(data.serviceId)) {
+ data.serviceId = null;
+ data.serviceIdType = null
+ }
+ }, function ignoreError() { }).then(function finallyBlock() {
+ return data
+ })
+ }
+ return WinJS.Promise.as(result)
+ }, playlistCollection: function playlistCollection(hydrating, options) {
+ options = options || {};
+ var result;
+ var queryWatcher = new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.playlistCollection");
+ var item = new MS.Entertainment.Data.Augmenter.Library.Playlist;
+ var query = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ query.playlistId = hydrating.libraryId;
+ queryWatcher.registerQuery(query);
+ result = query.execute().then(function querySuccess(q) {
+ item.tracks = q.result.items;
+ return item
+ });
+ return WinJS.Promise.as(result)
+ }, playlist: function playlist(hydrating, options) {
+ options = options || {};
+ var result;
+ var queryWatcher = new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.playlistCollection");
+ var item = new MS.Entertainment.Data.Augmenter.Library.Playlist;
+ var query = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ query.cloudSyncItemId = hydrating.cloudSyncItemId;
+ var playlistQuery = MS.Entertainment.UI.Actions.Playlists.queryPlaylistById(hydrating.cloudSyncItemId, true);
+ result = playlistQuery.then(function querySuccess(playlist) {
+ return playlist
+ }, function error() {
+ return null
+ });
+ return WinJS.Promise.as(result)
+ }
+ })
+ })()
+})();
+/* >>>>>>/framework/data/augmenters/musichydrators.js:34324 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Hydrator");
+
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Hydrator");
+ WinJS.Namespace.define("MS.Entertainment.Hydrator", {
+ artist: function artist(hydrating, options) {
+ options = options || {};
+ var result;
+ var queryWatcher;
+ var loadedLibraryId;
+ var skipHydrate = hydrating.fromCollection && !options.forceUpdate;
+ if (skipHydrate || !hydrating.hasServiceId)
+ result = null;
+ else {
+ var artistQuery = MS.Entertainment.Hydrator.prepareDetailsQuery(new MS.Entertainment.Data.Query.Music.ArtistDetails, new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.artist"), hydrating);
+ result = artistQuery.execute().then(function querySuccess(q) {
+ var item = q.result.item;
+ if (!item || !item.isValid) {
+ if (item && !item.isValidType) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EdsMediaType, parameterValue: item.mediaTypeString
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ExpectedMediaType, parameterValue: item.expectedMediaTypeString
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.HydratorWrongMediaType, telemetryParameterArray)
+ }
+ return WinJS.Promise.wrapError(new Error("Failed to retrieve an artist media item from the query."))
+ }
+ return MS.Entertainment.Hydrator.sanitizeIds(item, hydrating)
+ }.bind(this))
+ }
+ return WinJS.Promise.as(result)
+ }, album: function album(hydrating, options) {
+ if ((hydrating.location === MS.Entertainment.Data.ItemLocation.marketplace) || (!hydrating.fromCollection && !hydrating.location) || (!hydrating.inCollection && !hydrating.location))
+ return MS.Entertainment.Hydrator.albumMarketplace(hydrating, options);
+ else
+ return MS.Entertainment.Hydrator.albumCollection(hydrating, options)
+ }, albumMarketplace: function albumMarketplace(hydrating, options) {
+ options = options || {};
+ var result;
+ var skipHydrate = hydrating.fromCollection && !options.forceUpdate;
+ if (skipHydrate || !hydrating.hasServiceId)
+ result = null;
+ else {
+ var albumQuery;
+ if (options.skipTracks)
+ albumQuery = MS.Entertainment.Hydrator.prepareDetailsQuery(new MS.Entertainment.Data.Query.Music.AlbumDetails, new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.albumMarketplace"), hydrating);
+ else
+ albumQuery = MS.Entertainment.Hydrator.prepareDetailsQuery(new MS.Entertainment.Data.Query.Music.AlbumWithTracks, new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.albumMarketplace"), hydrating);
+ if (albumQuery.setTrackAlbum)
+ albumQuery.setTrackAlbum(hydrating);
+ result = albumQuery.execute().then(function querySuccess(q) {
+ var item = q.result ? q.result.item : null;
+ if (!item || !item.isValid)
+ return WinJS.Promise.wrapError(new Error("Failed to retrieve an album media item from the query."));
+ var promises = [MS.Entertainment.Hydrator.sanitizeIds(item, hydrating)];
+ if (item.artist && hydrating.artist) {
+ MS.Entertainment.Hydrator.sanitizeLibraryIds(item.artist, hydrating.artist);
+ promises.push(MS.Entertainment.Hydrator.sanitizeIds(item.artist, null))
+ }
+ return WinJS.Promise.join(promises)
+ }).then(function (promiseResults) {
+ return promiseResults && promiseResults[0]
+ })
+ }
+ return WinJS.Promise.as(result)
+ }, topSongsAlbum: function topSongsAlbum(hydrating, options) {
+ options = options || {};
+ var result;
+ var skipHydrate = hydrating.fromCollection && !options.forceUpdate;
+ if (skipHydrate || !hydrating.hasServiceId)
+ result = null;
+ else {
+ var albumQuery = MS.Entertainment.Hydrator.prepareDetailsQuery(new MS.Entertainment.Data.Query.Music.TopSongsAlbumWithTracks, new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.topSongsAlbum"), hydrating);
+ result = albumQuery.execute().then(function querySuccess(q) {
+ var item = q.result.item;
+ return MS.Entertainment.Hydrator.sanitizeIds(item, hydrating)
+ })
+ }
+ return WinJS.Promise.as(result)
+ }, albumCollection: function albumCollection(hydrating, options) {
+ options = options || {};
+ var result;
+ var item = new MS.Entertainment.Data.Augmenter.Library.Album;
+ var queryWatcher = new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.albumCollection");
+ item.zuneId = hydrating.zuneId;
+ result = MS.Entertainment.Hydrator.sanitizeIds(item, hydrating);
+ if (!options.skipTracks)
+ result = result.then(function goLibraryId() {
+ var query = new MS.Entertainment.Data.Query.libraryTracks;
+ query.albumId = item.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.TracksSortBy.numberAscending;
+ query.mediaAvailability = options.collectionFilter;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.album, MS.Entertainment.Utilities.isValidServiceId(hydrating.canonicalId) ? hydrating.canonicalId : String.empty);
+ queryWatcher.registerQuery(query);
+ return query.execute()
+ }.bind(this)).then(function querySuccess(q) {
+ item.tracks = q.result && q.result.items;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (isMusicMarketplaceEnabled && item.tracks) {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ var provider = mediaStore.trackProvider;
+ return item.tracks.forEachAll(function getPurchasedInfo(args) {
+ var track = args.item.data || {};
+ if (!track.hasServiceId)
+ return;
+ if (track.inCollection && track.localFilesCount > 0)
+ return provider.getPreferredFileUrlAsync(track.libraryId).then(function getPreferredFileUrlAsync_complete(preferredFile) {
+ if (!preferredFile || preferredFile.type !== Microsoft.Entertainment.Platform.FileUrlType.localFileUrl || preferredFile.protection !== Microsoft.Entertainment.Platform.ProtectionState.unprotected) {
+ args.stop = true;
+ item.hasPurchasableTracks = true
+ }
+ }, function ignoreError() { });
+ else {
+ args.stop = true;
+ item.hasPurchasableTracks = true
+ }
+ })
+ }
+ }).then(function returnItem() {
+ return item
+ });
+ return WinJS.Promise.as(result)
+ }, musicVideo: function musicVideo(hydrating, options) {
+ options = options || {};
+ var result;
+ var skipHydrate = hydrating.inCollection && hydrating.fromCollection && !options.forceUpdate;
+ if (skipHydrate || (!this.hasCanonicalId && !this.hasServiceId))
+ result = null;
+ else {
+ var musicVideoQuery = MS.Entertainment.Hydrator.prepareDetailsQuery(new MS.Entertainment.Data.Query.Music.MusicVideoDetails, new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.musicVideo"), hydrating);
+ result = musicVideoQuery.execute().then(function querySuccess(q) {
+ var item = q.result.item;
+ if (!item || !item.isValid)
+ return WinJS.Promise.wrapError(new Error("Failed to retrieve a music video media item from the query."));
+ var promises = [MS.Entertainment.Hydrator.sanitizeIds(item, hydrating)];
+ if (item.artist && hydrating.artist) {
+ MS.Entertainment.Hydrator.sanitizeLibraryIds(item.artist, hydrating.artist);
+ promises.push(MS.Entertainment.Hydrator.sanitizeIds(item.artist, null))
+ }
+ return WinJS.Promise.join(promises)
+ }.bind(this)).then(function (promiseResults) {
+ return promiseResults && promiseResults[0]
+ })
+ }
+ return WinJS.Promise.as(result)
+ }, track: function track(hydrating, options) {
+ options = options || {};
+ var result;
+ var skipHydrate = hydrating.inCollection && hydrating.fromCollection && !options.forceUpdate;
+ if (skipHydrate || !this.hasServiceId)
+ result = null;
+ else {
+ var trackQuery = MS.Entertainment.Hydrator.prepareDetailsQuery(new MS.Entertainment.Data.Query.Music.SongDetails, new MS.Entertainment.Framework.QueryWatcher("MS.Entertainment.Hydrator.track"), hydrating);
+ result = trackQuery.execute().then(function querySuccess(q) {
+ var item = q.result.item;
+ if (!item || !item.isValid)
+ return WinJS.Promise.wrapError(new Error("Failed to retrieve a track media item from the query."));
+ var promises = [MS.Entertainment.Hydrator.sanitizeIds(item, hydrating)];
+ if (item.album && hydrating.album) {
+ MS.Entertainment.Hydrator.sanitizeLibraryIds(item.album, hydrating.album);
+ promises.push(MS.Entertainment.Hydrator.sanitizeIds(item.album, null))
+ }
+ if (item.artist && hydrating.artist) {
+ MS.Entertainment.Hydrator.sanitizeLibraryIds(item.artist, hydrating.artist);
+ promises.push(MS.Entertainment.Hydrator.sanitizeIds(item.artist, null))
+ }
+ return WinJS.Promise.join(promises)
+ }.bind(this)).then(function (promiseResults) {
+ return promiseResults && promiseResults[0]
+ })
+ }
+ return WinJS.Promise.as(result)
+ }, cloudPlaylist: function cloudPlaylist(hydrating, options) {
+ options = options || {};
+ var result;
+ var skipHydrate = hydrating.inCollection && hydrating.fromCollection && !options.forceUpdate;
+ if (skipHydrate || !this.hasServiceId)
+ result = null;
+ else {
+ var getPlaylistQuery = new MS.Entertainment.Data.Query.Music.CloudPlaylist;
+ getPlaylistQuery.id = hydrating.zuneId;
+ getPlaylistQuery.idType = MS.Entertainment.Data.Query.edsIdType.zuneCatalog;
+ getPlaylistQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.playlist);
+ result = getPlaylistQuery.execute().then(function returnPlaylist(queryResult) {
+ return queryResult.result || WinJS.Promise.wrapError("Playlist query failed.")
+ })
+ }
+ return WinJS.Promise.as(result)
+ }
+ })
+ })()
+})();
+/* >>>>>>/framework/data/augmenters/musicaugmenters.js:34522 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MSE, undefined) {
+ "use strict";
+ var alias = MSE.Data.Property.alias;
+ var augment = MSE.Data.Property.augment;
+ var augmentNoDeflate = MSE.Data.Property.augmentNoDeflate;
+ var convert = MSE.Data.Property.convert;
+ var convertNoDeflate = MSE.Data.Property.convertNoDeflate;
+ var convertOriginal = MSE.Data.Property.convertOriginal;
+ var convertOriginalNoDeflate = MSE.Data.Property.convertOriginalNoDeflate;
+ var containsRight = MSE.Data.Property.containsRight;
+ var searchNoDeflate = MSE.Data.Property.searchNoDeflate;
+ var list = MSE.Data.Property.list;
+ var listWithContext = MSE.Data.Property.listWithContext;
+ var format = MSE.Data.Property.format;
+ var collect = MSE.Data.Property.collect;
+ var filter = MSE.Data.Property.filter;
+ var filterNoDeflate = MSE.Data.Property.filterNoDeflate;
+ var filterArray = MSE.Data.Property.filterArray;
+ var filterArrayNoDeflate = MSE.Data.Property.filterArrayNoDeflate;
+ var sortArray = MSE.Data.Property.sortArray;
+ var value = MSE.Data.Property.value;
+ var hydrated = MSE.Data.Property.hydrated;
+ var hydratedRequired = MSE.Data.Property.hydratedRequired;
+ var convertFeatureOptionsMusic = { feature: Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace };
+ var convertFeatureOptionsClosedCaptions = { feature: Microsoft.Entertainment.FeatureEnablement.FeatureItem.closedCaptionsEnabled };
+ var defaultVoiceConfidence = MSE.Data.Factory.defaultVoiceConfidence;
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ AssetLocationIdType: {
+ unknown: "unknown", zune: "zune", cloudStorage: "cloudStorage"
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Filter.Marketplace", {
+ filterUnsupportedAlbums: function filterUnsupportedAlbums(item) {
+ return item && (MSE.Data.Factory.boolFromString(item.isPremium) || !MSE.Data.Factory.boolFromString(item.isActionable))
+ }, filterTracksWithoutMusicVideos: function filterTracksWithoutMusicVideos(item) {
+ return !item || !item.hasMusicVideoId
+ }, filterSmartDJTracks: function filterSmartDJTracks(item) {
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var userHasSubscription = signedInUserService.isSubscription;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isFreePlay = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay);
+ var hasFreeStreams = MS.Entertainment.Utilities.isMusicApp2;
+ if (item && item.Providers)
+ for (var i = 0; i < item.Providers.length; i++) {
+ var provider = item.Providers[i];
+ for (var j = 0; j < provider.ProviderContents.length; j++) {
+ var providerContents = provider.ProviderContents[j];
+ for (var k = 0; k < providerContents.OfferInstances.length; k++) {
+ var offerInstance = providerContents.OfferInstances[k];
+ if (((userHasSubscription || hasFreeStreams) && offerInstance.DistributionRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Stream) || (isFreePlay && !userHasSubscription && offerInstance.DistributionRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.FreeStream))
+ return false
+ }
+ }
+ }
+ return true
+ }, filterUnsupportedMusicHubItems: function filterUnsupportedMusicHubItems(item) {
+ return !item || !item.link || !(item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Album || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Artist || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Hub || item.link.type === MSE.Data.Augmenter.Marketplace.EditorialType.Track)
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Comparer.Marketplace", {
+ edsCompareImageRankOnly: function edsCompareImageRankOnly(image1, image2) {
+ var result;
+ image1 = MS.Entertainment.Data.deflate(image1);
+ image2 = MS.Entertainment.Data.deflate(image2);
+ if (image1 === image2)
+ result = 0;
+ else if (!image2)
+ result = -1;
+ else if (!image1)
+ result = 1;
+ else if (image1.Order < image2.Order)
+ result = -1;
+ else if (image1.Order > image2.Order)
+ result = 1;
+ else
+ result = 0;
+ return result
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Filter.Library", {
+ filterBackingFiles: function filterBackingFiles(item) {
+ if (item && item.Url)
+ if (MS.Entertainment.Utilities.isStreamingUrl(item.Url))
+ return true;
+ else
+ return false
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment", {
+ cloudIcons: {
+ InCloudLocal: MS.Entertainment.UI.Icon.cloud, InCloudNotLocal: MS.Entertainment.UI.Icon.inlineStreaming, NotInCloudLocal: String.empty, NotInCloudNotLocal: String.empty, MarketplaceInCollection: MS.Entertainment.UI.Icon.musicInCollection, Downloading: MS.Entertainment.UI.Icon.downloading, PendingDownload: MS.Entertainment.UI.Icon.downloading, PendingSync: MS.Entertainment.UI.Icon.cloudSyncing
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Factory", {
+ isMediaParentallyBlocked: function isMediaParentallyBlocked(media) {
+ var isParentallyBlocked = false;
+ if (media && media.isExplicit && !media.inCollection) {
+ var signedIn = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signedIn = signInService.isSignedIn
+ }
+ if (!signedIn || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser)) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ isParentallyBlocked = !configurationManager.service.lastSignedInUserExplicitPrivilege
+ }
+ else {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ isParentallyBlocked = !signedInUser.xuid || !signedInUser.hasExplicitPrivilege
+ }
+ }
+ return isParentallyBlocked
+ }, createEventProxy: function createEventProxy() {
+ return new MSE.Utilities.EventInvoker
+ }, albumAndArtist: function albumAndArtist(sourceValue) {
+ var value = String.empty;
+ if (sourceValue)
+ if (sourceValue.artistName && sourceValue.albumName)
+ value = String.load(String.id.IDS_MUSIC_ALBUM_BY_ARTIST).format(sourceValue.albumName, sourceValue.artistName);
+ else if (sourceValue.artistName)
+ value = String.load(String.id.IDS_MUSIC_BY_ARTIST).format(sourceValue.artistName);
+ else if (sourceValue.albumName)
+ value = sourceValue.albumName;
+ return value
+ }, createArtistRemoveString: function createArtistRemoveString(sourceValue) {
+ var value = String.empty;
+ if (sourceValue && sourceValue.name && String.id.IDS_MUSIC_SHARE_REMOVE_ARTIST_LABEL)
+ value = String.load(String.id.IDS_MUSIC_SHARE_REMOVE_ARTIST_LABEL).format(sourceValue.name);
+ return value
+ }, createTrackAndArtistRemoveString: function createTrackAndArtistRemoveString(sourceValue) {
+ var value = String.empty;
+ if (sourceValue)
+ if (sourceValue.name && sourceValue.artistName && String.id.IDS_MUSIC_SHARE_REMOVE_TRACK_BY_ARTIST_LABEL)
+ value = String.load(String.id.IDS_MUSIC_SHARE_REMOVE_TRACK_BY_ARTIST_LABEL).format(sourceValue.name, sourceValue.artistName);
+ else if (sourceValue.artistName && Sting.id.IDS_MUSIC_BY_ARTIST)
+ value = String.load(String.id.IDS_MUSIC_BY_ARTIST).format(sourceValue.artistName);
+ else if (sourceValue.name)
+ value = sourceValue.name;
+ return value
+ }, createArtistFromMediaDiscoveryAlbum: function createArtistFromMediaDiscoveryAlbum(sourceValue) {
+ var artist = null;
+ if (sourceValue)
+ artist = MS.Entertainment.Data.augment({
+ Name: sourceValue.artistName, ZuneId: sourceValue.primaryArtistId
+ }, MSE.Data.Augmenter.Marketplace.EDSArtist);
+ return artist
+ }, convertTrackToMusicVideo: function convertTrackToMusicVideo(sourceTrack) {
+ var musicVideo = null;
+ if (sourceTrack && sourceTrack.hasMusicVideoId) {
+ musicVideo = new MSE.Data.Augmenter.Marketplace.EDSMusicVideoBase;
+ musicVideo.canonicalId = sourceTrack.musicVideoId;
+ musicVideo.track = sourceTrack;
+ musicVideo.edsMediaItemType = MS.Entertainment.Data.Query.edsMediaType.musicVideo;
+ musicVideo.playlistName = sourceTrack.playlistName;
+ musicVideo.playlistCloudSyncId = sourceTrack.playlistCloudSyncId;
+ if (sourceTrack.acquisitionData)
+ musicVideo.acquisitionData = sourceTrack.acquisitionData
+ }
+ return musicVideo
+ }, convertMusicVideoToTrack: function convertMusicVideoToTrack(sourceVideo) {
+ var track = null;
+ if (sourceVideo && sourceVideo.hasTrackId) {
+ track = new MSE.Data.Augmenter.Marketplace.EDSTrack;
+ track.libraryId = sourceVideo.trackLibraryId || -1;
+ track.serviceId = sourceVideo.trackId;
+ track.serviceIdType = MS.Entertainment.Data.Query.edsIdType.canonical;
+ track.musicVideo = sourceVideo;
+ if (sourceVideo.acquisitionData)
+ track.acquisitionData = sourceVideo.acquisitionData
+ }
+ return track
+ }, toCloudIcon: function toCloudIcon(sourceValue) {
+ var icon = null;
+ var cloudCollectionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection);
+ var cloudCollectionV2Enabled = cloudCollectionService.isV2Enabled;
+ var cloudCollectionEnabled = !cloudCollectionV2Enabled && cloudCollectionService.isEnabled;
+ switch (sourceValue) {
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyPendingSync:
+ return (cloudCollectionEnabled ? MS.Entertainment.cloudIcons.PendingSync : MS.Entertainment.cloudIcons.InCloudNotLocal);
+ case Microsoft.Entertainment.Queries.ItemCollectionState.localOnlyPendingSync:
+ return (cloudCollectionEnabled ? MS.Entertainment.cloudIcons.PendingSync : String.empty);
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveOnly:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyTakenDown:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionTakenDown:
+ return MS.Entertainment.cloudIcons.InCloudNotLocal;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.localOnly:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.localOnlyNoCatalogId:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalNoRights:
+ return (cloudCollectionEnabled ? MS.Entertainment.cloudIcons.NotInCloudLocal : String.empty);
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveAndLocal:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalTakenDown:
+ return (cloudCollectionEnabled ? MS.Entertainment.cloudIcons.InCloudLocal : String.empty);
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollection:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionNoRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyNoRights:
+ default:
+ return String.empty;
+ break
+ }
+ return icon
+ }, toCloudIconOpacity: function toCloudIconOpacity(sourceValue) {
+ var opacity = "1.0";
+ return opacity
+ }, toCloudIconTooltip: function toCloudIconTooltip(sourceValue) {
+ var toolTip = String.empty;
+ var cloudCollectionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection);
+ var cloudCollectionEnabled = cloudCollectionService.isEnabled;
+ var cloudCollectionV2Enabled = cloudCollectionService.isV2Enabled;
+ switch (sourceValue) {
+ case Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveOnly:
+ toolTip = String.load(String.id.IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_ONEDRIVE);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyPendingSync:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyTakenDown:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionTakenDown:
+ toolTip = String.load(String.id.IDS_COLLECTION_TOOLTIP_STREAMING);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.localOnly:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.localOnlyNoCatalogId:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalNoRights:
+ if (cloudCollectionEnabled)
+ toolTip = cloudCollectionV2Enabled ? String.load(String.id.IDS_MUSIC_PROPERTIES_AVAILABLE_ON_THIS_PC) : String.load(String.id.IDS_COLLECTION_TOOLTIP_UNMATCHED);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.localOnlyPendingSync:
+ toolTip = (cloudCollectionEnabled ? String.load(String.id.IDS_COLLECTION_CLOUD_SYNC_PENDING) : String.empty);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveAndLocal:
+ toolTip = String.load(String.id.IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_MULTIPLE_LOCATIONS);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalTakenDown:
+ toolTip = (cloudCollectionEnabled ? String.load(String.id.IDS_COLLECTION_TOOLTIP_MATCHED) : String.empty);
+ break;
+ default:
+ toolTip = String.empty;
+ break
+ }
+ return toolTip
+ }, toCloudStreamingSource: function toCloudStreamingSource(sourceValue) {
+ var streamingSource = String.empty;
+ switch (sourceValue) {
+ case Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveOnly:
+ streamingSource = String.load(String.id.IDS_MUSIC_PROPERTIES_FOLDER_PATH_ONEDRIVE);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyPendingSync:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyTakenDown:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollection:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionTakenDown:
+ streamingSource = String.load(String.id.IDS_MUSIC_PROPERTIES_FOLDER_PATH_STREAMING);
+ break;
+ default:
+ streamingSource = String.empty;
+ break
+ }
+ return streamingSource
+ }, toCloudIconAriaString: function toCloudIconAriaString(sourceValue) {
+ var ariaString = String.empty;
+ var cloudCollectionEnabled = (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection)).isEnabled;
+ switch (sourceValue) {
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyPendingSync:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveOnly:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyTakenDown:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionTakenDown:
+ ariaString = String.load(String.id.IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.localOnlyPendingSync:
+ if (cloudCollectionEnabled)
+ ariaString = String.load(String.id.IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA);
+ break;
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalValidRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.oneDriveAndLocal:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalTakenDown:
+ if (cloudCollectionEnabled)
+ ariaString = String.load(String.id.IDS_COLLECTION_CLOUD_MATCHED_ARIA);
+ break;
+ default:
+ break
+ }
+ return ariaString
+ }, toExplicitAriaString: function toExplicitAriaString(sourceValue) {
+ return sourceValue ? String.load(String.id.IDS_DETAILS_EXPLICIT_LABEL_UC) : String.empty
+ }, inCollectionToCloudIcon: function inCollectionToCloudIcon(inCollection) {
+ if (inCollection)
+ return MS.Entertainment.cloudIcons.MarketplaceInCollection;
+ else
+ return MS.Entertainment.cloudIcons.NotInCloudNotLocal
+ }, toPlaylistItemOpacity: function toPlaylistItemOpacity(itemCollectionState) {
+ var opacity = "1.0";
+ switch (itemCollectionState) {
+ case Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionNoRights:
+ case Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyNoRights:
+ return "0.25"
+ }
+ return opacity
+ }, createAlbumDetailString: function createAlbumDetailString(album, options) {
+ if (!album)
+ return String.empty;
+ var values = [];
+ if (album.artistName)
+ values.push(album.artistName);
+ if (album.releaseDate) {
+ var formattedYear = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ values.push(formattedYear.format(album.releaseDate))
+ }
+ var genre;
+ if (album.primaryGenre)
+ genre = album.primaryGenre.name || album.primaryGenre;
+ else if (album.genreName)
+ genre = album.genreName;
+ if (genre)
+ values.push(genre);
+ if ((!options || options.includeLabel) && album.label)
+ values.push(album.label);
+ if (options && options.includeExplicit && album.isExplicit)
+ values.push(String.load(String.id.IDS_DETAILS_EXPLICIT_LABEL));
+ return values.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }, createArtistDetailString: function createArtistDetailString(artist, isCollection) {
+ if (!artist)
+ return String.empty;
+ var details = [];
+ if (isCollection) {
+ MS.Entertainment.UI.assert(artist.inCollection, "media item in collection view is not in collection");
+ var formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var albumCountFormatted;
+ var tracksCountFormatted;
+ if (artist.totalAlbumsCount === 1)
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_ALBUM_COUNT));
+ else if (artist.totalAlbumsCount > 1) {
+ albumCountFormatted = formatter.format(artist.totalAlbumsCount);
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_ALBUMS_COUNT).format(albumCountFormatted))
+ }
+ if (artist.totalTracksCount === 1)
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_SONG_COUNT));
+ else if (artist.totalTracksCount > 1) {
+ tracksCountFormatted = formatter.format(artist.totalTracksCount);
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_SONGS_COUNT).format(tracksCountFormatted))
+ }
+ else
+ details.push(String.load(String.id.IDS_DETAILS_COLLECTION_NO_SONGS))
+ }
+ else {
+ var genre;
+ if (artist.primaryGenre)
+ genre = artist.primaryGenre.title || artist.primaryGenre;
+ if (genre)
+ details.push(genre)
+ }
+ return details.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }, createAlbumSummaryString: function createAlbumSummaryString(album) {
+ var summary = String.empty;
+ if (album)
+ if (album.trackCount !== undefined && album.trackCount !== null)
+ if (album.releaseYear)
+ summary = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_FAI_ALBUM_SUMMARY_4_PLURAL, album.trackCount).format(album.artistName, album.trackCount, album.releaseYear, album.primaryGenreName);
+ else
+ summary = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_FAI_ALBUM_SUMMARY_3_PLURAL, album.trackCount).format(album.artistName, album.trackCount, album.primaryGenreName);
+ else if (album.releaseYear)
+ summary = String.load(String.id.IDS_FAI_ALBUM_SUMMARY_3).format(album.artistName, album.releaseYear, album.primaryGenreName);
+ else
+ summary = String.load(String.id.IDS_FAI_ALBUM_SUMMARY_2).format(album.artistName, album.primaryGenreName);
+ return summary
+ }, createRightsFromString: function createRightsFromString(rightsString) {
+ var newRights = [];
+ if (rightsString && rightsString.split) {
+ var rightsArray = rightsString.split(",");
+ for (var i = 0; i < rightsArray.length; i++) {
+ if (rightsArray[i] === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.SubscriptionFree)
+ rightsArray[i] = MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Stream;
+ if (rightsArray[i] !== MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Download)
+ newRights.push({
+ licenseRight: MS.Entertainment.Data.Factory.Marketplace.edsConvertToRightType(rightsArray[i]), clientTypes: [MS.Entertainment.Utilities.defaultClientTypeFromApp]
+ })
+ }
+ }
+ return newRights
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Factory.Library", {
+ localizedYearOrMonthKey: function localizedYearOrMonthKey(source) {
+ return MS.Entertainment.Utilities.trimCharacterDirection(MS.Entertainment.Data.Factory.Library.localizedYearOrMonth(source))
+ }, localizedYearOrMonth: function localizedYearOrMonth(source) {
+ source = MS.Entertainment.Utilities.trimCharacterDirection(source);
+ var result = String.empty;
+ if (String.isString(source) && !isNaN(parseInt(source)))
+ result = MSE.Data.Factory.localizedYear(source) || source;
+ else
+ result = source;
+ return result || String.load(String.id.IDS_UNKNOWN_VALUE)
+ }, convertToAssetLocationIdType: function convertToAssetLocationIdType(ids) {
+ var type = MS.Entertainment.Data.AssetLocationIdType.unknown;
+ var catalogId = null;
+ var serviceId = null;
+ if (ids && Array.isArray(ids)) {
+ catalogId = ids[0];
+ serviceId = ids[1]
+ }
+ if (MS.Entertainment.Utilities.isValidGuid(catalogId) && !MS.Entertainment.Utilities.isEmptyGuid(catalogId))
+ type = MS.Entertainment.Data.AssetLocationIdType.zune;
+ else if (MS.Entertainment.Utilities.isValidGuid(serviceId) && !MS.Entertainment.Utilities.isEmptyGuid(serviceId))
+ type = MS.Entertainment.Data.AssetLocationIdType.cloudStorage;
+ return type
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Factory.Marketplace", {
+ inMyMusicText: function inMyMusicText(inCollection) {
+ return inCollection ? String.load(String.id.IDS_MUSIC_IN_MY_MUSIC_LABEL) : String.empty
+ }, processTextWithLinks: function processTextWithLinks(text) {
+ return MS.Entertainment.Utilities.processServiceLinks(text, {
+ $close: "", Contributor: ""
+ })
+ }, edsAlbumRightsIEBProviders: function edsAlbumRightsIEBProviders(providers, provideType, deviceType) {
+ return MS.Entertainment.Data.Factory.Marketplace.edsRights(providers, null, null, MSE.Data.Augmenter.Marketplace.EDSModernAlbumOfferRight)
+ }, edsConvertToAlbumRightType: function edsConvertToAlbumRightType(distributionRight) {
+ return MS.Entertainment.Data.Factory.Marketplace.edsConvertToRightType(distributionRight, MS.Entertainment.Data.Augmenter.Marketplace.edsDistributionRightToAlbumRightTypeMappings)
+ }, edsCreateGenreQueryOptions: function edsCreateGenreQueryOptions(genre) {
+ var rootGenre;
+ var childGenre;
+ if (genre)
+ if (genre.isRoot)
+ rootGenre = genre;
+ else {
+ childGenre = genre;
+ rootGenre = genre.parent
+ }
+ var result = { subGenreId: (childGenre) ? childGenre.serviceId : null };
+ if (rootGenre && rootGenre.serviceId)
+ result.genreId = rootGenre.serviceId;
+ return result
+ }, edsCreateGenreTrackQueryOptions: function edsCreateGenreTrackQueryOptions(genre) {
+ var options = MSE.Data.Factory.Marketplace.edsCreateGenreQueryOptions(genre);
+ if (options)
+ options.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.genre, genre && genre.serviceId);
+ return options
+ }, edsCrossMediaToMusicFactory: function edsCrossMediaToMusicFactory(item) {
+ var mediaType = item.type || item.MediaItemType;
+ if (mediaType in MS.Entertainment.Data.Query.edsMediaTypeIntegerToStringMappings)
+ mediaType = MS.Entertainment.Data.Query.edsMediaTypeIntegerToStringMappings[mediaType];
+ var augmenter;
+ if (mediaType === MS.Entertainment.Data.Query.edsMediaType.album)
+ augmenter = MS.Entertainment.Data.Augmenter.Marketplace.Music.SearchAlbum;
+ else if (mediaType === MS.Entertainment.Data.Query.edsMediaType.musicArtist)
+ augmenter = MS.Entertainment.Data.Augmenter.Marketplace.Music.SearchArtist;
+ else if (mediaType === MS.Entertainment.Data.Query.edsMediaType.track)
+ augmenter = MS.Entertainment.Data.Augmenter.Marketplace.Music.SearchTrack;
+ else
+ MS.Entertainment.UI.Actions.fail("Unknown media type returned from crossMedia search: " + mediaType);
+ if (augmenter)
+ item = MS.Entertainment.Data.augment(WinJS.Binding.unwrap(item), augmenter);
+ return item
+ }, edsClosedCaptionFiles: function edsClosedCaptions(providers) {
+ var result = [];
+ if (Array.isArray(providers))
+ providers.forEach(function providerItem(provider) {
+ if (provider && Array.isArray(provider.ProviderContents))
+ provider.ProviderContents.forEach(function augmentItem(content) {
+ if (content && content.VideoAttributes && Array.isArray(content.VideoAttributes.ClosedCaptionFiles))
+ content.VideoAttributes.ClosedCaptionFiles.forEach(function augmentClosedCaptions(closedCaptions) {
+ result.push(MSE.Data.augment({
+ MediaInstanceID: content.MediaInstanceID, Lcid: closedCaptions.Lcid, Name: closedCaptions.Name, FileUri: closedCaptions.Url
+ }, MSE.Data.Augmenter.Marketplace.EdsMusicVideoClosedCaption))
+ })
+ })
+ });
+ return result
+ }, setListMaxCount: function setListMaxCount(list) {
+ if (list)
+ list.maxCount = 100;
+ return list
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ Artist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.MediaItem, null, {
+ libraryId: hydratedRequired(convert("ObjectId", MSE.Data.Factory.intNumber, -1)), localAlbumsCount: convert("LocalAlbumsCount", MSE.Data.Factory.intNumber, -1), localTracksCount: convert("LocalTracksCount", MSE.Data.Factory.intNumber, -1), name: hydratedRequired(convertOriginal("Name", MSE.Data.Factory.normalizeTextDirection, String.empty)), sortName: convertOriginal("SortName", MSE.Data.Factory.normalizeTextDirection, String.empty), title: hydratedRequired(convertOriginal("Name", MSE.Data.Factory.normalizeTextDirection, String.empty)), remoteAlbumsCount: convert("RemoteAlbumsCount", MSE.Data.Factory.intNumber, -1), remoteTracksCount: convert("RemoteTracksCount", MSE.Data.Factory.intNumber, -1), serviceId: hydratedRequired(convert("ServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), totalAlbumsCount: convert("TotalAlbumsCount", MSE.Data.Factory.intNumber, -1), totalTracksCount: convert("TotalTracksCount", MSE.Data.Factory.intNumber, -1), hasSmartDJ: hydratedRequired(alias("CanSmartDJ", false)), primaryGenre: hydrated(convertNoDeflate("genre.name", MSE.Data.Factory.self, String.empty)), genre: hydrated(value(String.empty)), description: hydratedRequired(value(String.empty)), descriptionNoTags: hydratedRequired(value(String.empty)), backgroundImageUri: hydratedRequired(value(null)), backgroundImageResizeUri: hydratedRequired(value(null)), mediaType: Microsoft.Entertainment.Queries.ObjectType.person, personType: Microsoft.Entertainment.Queries.PersonType.artist, cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, voicePhrase: convert("Name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), allTracksLocal: {
+ get: function get_allTracksLocal() {
+ return this.localTracksCount >= 0 && this.totalTracksCount >= 0 && this.localTracksCount >= this.totalTracksCount
+ }
+ }, onHydrated: MS.Entertainment.Hydrator.artist
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ AlbumArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Artist, null, {
+ name: hydratedRequired(convertOriginal("ArtistName", MSE.Data.Factory.normalizeTextDirection, null)), sortName: convertOriginal("ArtistSortName", MSE.Data.Factory.normalizeTextDirection, null), title: hydratedRequired(convertOriginal("ArtistName", MSE.Data.Factory.normalizeTextDirection, null)), libraryId: hydratedRequired(convert("ArtistId", MSE.Data.Factory.intNumber, -1)), serviceId: convert("ArtistServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), zuneId: hydratedRequired(convert("ArtistServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), mediaType: Microsoft.Entertainment.Queries.ObjectType.person, personType: Microsoft.Entertainment.Queries.PersonType.artist, imageUri: hydratedRequired(convert("ArtistImageUrl", MSE.Data.Factory.self, null)), imageResizeUri: hydratedRequired(convert("ArtistImageUrl", MSE.Data.Factory.self, null)), canonicalId: hydratedRequired(convert("ArtistBingId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), voicePhrase: convert("ArtistName", MSE.Data.Factory.normalizeStringForVoice, String.empty), hasSmartDJ: hydratedRequired(convert("ArtistCanSmartDJ", MSE.Data.Factory.self, false)), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ Album: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.MediaItemContainer, null, {
+ artist: augment(String.empty, MSE.Data.Augmenter.Library.AlbumArtist), parent: convertNoDeflate("artist", MSE.Data.Factory.self, null), artistId: convert("ArtistId", MSE.Data.Factory.intNumber, -1), artistGroupId: convert([["ArtistId", "ArtistSortName"]], MSE.Data.Factory.joinStrings, null), artistName: convertOriginal("ArtistName", MSE.Data.Factory.normalizeTextDirection, null), artistSortName: convertOriginal("ArtistSortName", MSE.Data.Factory.normalizeTextDirection, null), artistServiceId: convert("ArtistServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), _criticReview: hydrated(convertOriginal("ReviewSources[0].CriticReviews[0].CriticText", MSE.Data.Factory.normalizeTextDirection, String.empty)), criticReviewNoTags: hydratedRequired(convertNoDeflate("_criticReview", MS.Entertainment.Utilities.processServiceTextBlob, String.empty)), criticReview: hydratedRequired(convertNoDeflate("_criticReview", MS.Entertainment.Data.Factory.Marketplace.processTextWithLinks, String.empty)), dateAdded: convert("DateAdded", MSE.Data.Factory.databaseDate, null), yearOrMonthAdded: convertNoDeflate("dateAdded", MSE.Data.Factory.Library.localizedYearOrMonthFromDate, null), description: convertOriginal("Description", MSE.Data.Factory.normalizeTextDirection, String.empty), filePath: convertOriginal("AlbumArtFileName", MSE.Data.Factory.string, String.empty), genreId: convert("GenreId", MSE.Data.Factory.intNumber, -1), genreGroupId: convert("GenreId", MSE.Data.Factory.string, null), genreName: convertOriginal("GenreName", MSE.Data.Factory.normalizeTextDirection, String.empty), libraryId: convert("ObjectId", MSE.Data.Factory.intNumber, -1), localTracksCount: convert("LocalTracksCount", MSE.Data.Factory.intNumber, -1), name: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), sortName: convertOriginal("SortTitle", MSE.Data.Factory.normalizeTextDirection, String.empty), releaseDate: convert("ReleaseDate", MSE.Data.Factory.databaseDate, null), remoteTracksCount: convert("RemoteTracksCount", MSE.Data.Factory.intNumber, -1), serviceId: convert("ServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), totalTracksCount: convert("TotalTracksCount", MSE.Data.Factory.intNumber, -1), trackCount: convert("TotalTracksCount", MSE.Data.Factory.intNumber, -1), userStarRating: convert("StarRating", MSE.Data.Factory.intNumber, -1), releaseYear: convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null), label: hydrated(value(String.empty)), isExplicit: hydrated(value(false)), isAlbum: hydrated(value(true)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), rights: hydrated(value(null)), tracks: hydrated(value(null)), primaryGenre: hydrated(value(null)), hasPurchasableTracks: hydrated(value(false)), mediaType: Microsoft.Entertainment.Queries.ObjectType.album, canPurchase: alias("CanPurchase", false), canPurchaseStream: alias("CanPurchaseStream", false), canPurchaseDownload: alias("CanPurchaseDownload", false), canFreeStream: alias("CanFreeStream", false), canSubscriptionStream: alias("CanSubscriptionStream", false), canSubscriptionDownload: alias("CanSubscriptionDownload", false), canPlayLocally: alias("CanPlayLocally", false), canPreview: alias("CanPreview", false), hasPurchased: alias("HasPurchased", false), collectionState: alias("CollectionState", -1), recentlyPlayedDate: convert("RecentlyPlayedDate", MSE.Data.Factory.databaseDate, null), roamingViaOneDriveTrackCount: alias("RoamingViaOneDriveTrackCount", -1), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), hasTakenedDown: {
+ get: function () {
+ return this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalTakenDown || this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyTakenDown || this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionTakenDown
+ }
+ }, hasSubscriptionTracks: {
+ get: function () {
+ return this.canSubscriptionStream || this.canSubscriptionDownload
+ }
+ }, hasLocalTracks: {
+ get: function () {
+ return this.localTracksCount > 0
+ }
+ }, hasRemoteOnlyTracks: {
+ get: function () {
+ return this.remoteTracksCount - this.localTracksCount > 0
+ }
+ }, hasAllRemoteOnlyTracks: {
+ get: function () {
+ return this.localTracksCount <= 0 && this.remoteTracksCount > 0
+ }
+ }, hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && this.artistServiceId !== MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ }, isCloudMatched: {
+ get: function () {
+ return this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyValidRights || this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalValidRights
+ }
+ }, allTracksLocal: {
+ get: function get_allTracksLocal() {
+ return this.localTracksCount >= 0 && this.totalTracksCount >= 0 && this.localTracksCount >= this.totalTracksCount
+ }
+ }, cloudIcon: convert("CollectionState", MSE.Data.Factory.toCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: convert("CollectionState", MSE.Data.Factory.toCloudIconOpacity, "1.0"), cloudIconTooltip: convert("CollectionState", MSE.Data.Factory.toCloudIconTooltip, String.empty), cloudIconAriaString: convert("CollectionState", MSE.Data.Factory.toCloudIconAriaString, String.empty), onHydrated: MS.Entertainment.Hydrator.album
+ })
+ }), AlbumWithTracks: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.BrowseDetailQuery.mixAugmentation(MSE.Data.Augmenter.Library.AlbumTracksOnAlbumResult, MSE.Data.Augmenter.Library.AlbumDetailsResult)
+ }), AlbumDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.mixNoDeflate({ item: MSE.Data.Augmenter.Library.Album })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ TrackArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Artist, null, {
+ name: hydratedRequired(convertOriginal("ArtistName", MSE.Data.Factory.normalizeTextDirection, null)), sortName: convertOriginal("ArtistSortName", MSE.Data.Factory.normalizeTextDirection, null), title: hydratedRequired(convertOriginal("ArtistName", MSE.Data.Factory.normalizeTextDirection, null)), libraryId: hydratedRequired(convert("ArtistId", MSE.Data.Factory.intNumber, -1)), serviceId: convert("ArtistServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), zuneId: hydratedRequired(convert("ArtistServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), mediaType: Microsoft.Entertainment.Queries.ObjectType.person, personType: Microsoft.Entertainment.Queries.PersonType.artist, imageUri: hydratedRequired(convert("ArtistImageUrl", MSE.Data.Factory.self, null)), imageResizeUri: hydratedRequired(convert("ArtistImageUrl", MSE.Data.Factory.self, null)), canonicalId: hydratedRequired(convert("ArtistBingId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), voicePhrase: convert("ArtistName", MSE.Data.Factory.normalizeStringForVoice, String.empty), hasSmartDJ: hydratedRequired(convert("ArtistCanSmartDJ", MSE.Data.Factory.self, false)), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ TrackAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Album, null, {
+ name: convertOriginal("AlbumName", MSE.Data.Factory.normalizeTextDirection, null), sortName: convertOriginal("AlbumSortName", MSE.Data.Factory.normalizeTextDirection, null), artist: augment(String.empty, MSE.Data.Augmenter.Library.TrackArtist), libraryId: convert("AlbumId", MSE.Data.Factory.intNumber, -1), serviceId: convert("AlbumServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), zuneId: convert("AlbumServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), mediaType: Microsoft.Entertainment.Queries.ObjectType.album, imageUri: convert("AlbumImageUrl", MSE.Data.Factory.self, null), imageResizeUri: convert("AlbumImageUrl", MSE.Data.Factory.self, null), canonicalId: convert("AlbumBingId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), voicePhrase: convert("AlbumName", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ TrackPlaylist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Playlist, null, {
+ libraryId: convert("PlaylistId", MSE.Data.Factory.intNumber, -1), cloudSyncItemId: convert("PlaylistCloudId", MSE.Data.Factory.guid, String.empty), name: convertOriginal("PlaylistName", MSE.Data.Factory.normalizeTextDirection, String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ AcquisitionData: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ acquisitionContext: alias("AcquisitionContext", null), acquisitionContextType: alias("AcquisitionContextType", null), acquisitionContextID: convert("AcquisitionContextId", MSE.Data.Factory.guid, String.empty), acquisitionAdditionalContext: alias("AcquisitionAdditionalContext", String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ Track: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.MediaItem, null, {
+ acquisitionData: augment(String.empty, MSE.Data.Augmenter.Library.AcquisitionData), artist: hydrated(augment(String.empty, MSE.Data.Augmenter.Library.TrackArtist)), artistId: convert("ArtistId", MSE.Data.Factory.intNumber, -1), artistGroupId: convert([["ArtistId", "ArtistSortName"]], MSE.Data.Factory.joinStrings, null), artistName: hydrated(convertOriginal("ArtistName", MSE.Data.Factory.normalizeTextDirection, null), MSE.Data.Comparer.notFalsy), artistSortName: convertOriginal("ArtistSortName", MSE.Data.Factory.normalizeTextDirection, null), artistServiceId: hydrated(convert("ArtistServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), album: hydrated(augment(String.empty, MSE.Data.Augmenter.Library.TrackAlbum)), parent: convertNoDeflate("album", MSE.Data.Factory.self, null), albumId: convert("AlbumId", MSE.Data.Factory.intNumber, -1), albumGroupId: convert([["AlbumId", "AlbumSortName"]], MSE.Data.Factory.joinStrings, null), albumServiceId: hydrated(convert("AlbumServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), albumName: hydrated(convertOriginal("AlbumName", MSE.Data.Factory.normalizeTextDirection, null)), albumSortName: convertOriginal("AlbumSortName", MSE.Data.Factory.normalizeTextDirection, null), _albumAndArtistName: convertNoDeflate(String.empty, MSE.Data.Factory.albumAndArtist, String.empty), albumAndArtistName: convertOriginalNoDeflate("_albumAndArtistName", MSE.Data.Factory.normalizeTextDirection, String.empty), copyright: convertOriginal("Copyright", MSE.Data.Factory.normalizeTextDirection, null), dateAdded: convert("DateAdded", MSE.Data.Factory.databaseDate, null), yearOrMonthAdded: convertNoDeflate("dateAdded", MSE.Data.Factory.Library.localizedYearOrMonthFromDate, null), filePath: convert("FilePath", MSE.Data.Factory.string, null), genreId: convert("GenreId", MSE.Data.Factory.intNumber, -1), genreGroupId: convert("GenreId", MSE.Data.Factory.string, null), genreName: hydrated(convert("GenreName", MSE.Data.Factory.string, null)), primaryGenre: hydrated(convert("GenreName", MSE.Data.Factory.string, null)), label: hydratedRequired(value(null)), libraryId: convert("ObjectId", MSE.Data.Factory.intNumber, -1), localFilesCount: convert("LocalFilesCount", MSE.Data.Factory.intNumber, -1), name: hydrated(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), mainTitle: hydrated(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), musicVideoId: hydrated(convertOriginal("MusicVideoId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), musicVideo: convertNoDeflate(String.empty, MSE.Data.Factory.convertTrackToMusicVideo, null), sortName: convertOriginal("SortTitle", MSE.Data.Factory.normalizeTextDirection, String.empty), offlineFilesCount: convert("OfflineFilesCount", MSE.Data.Factory.intNumber, -1), playlist: augment(String.empty, MSE.Data.Augmenter.Library.TrackPlaylist), playlistCloudSyncId: convert("PlaylistCloudId", MSE.Data.Factory.guid, String.empty), playlistId: convert("PlaylistId", MSE.Data.Factory.intNumber, -1), playlistName: convertOriginal("PlaylistName", MSE.Data.Factory.normalizeTextDirection, String.empty), playlistItemId: convert("PlaylistItemId", MSE.Data.Factory.intNumber, -1), releaseDate: hydrated(convert("ReleaseDate", MSE.Data.Factory.databaseDate, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, String.empty)), remoteFilesCount: convert("RemoteFilesCount", MSE.Data.Factory.intNumber, -1), roamingViaOneDrive: alias("RoamingViaOneDrive", false), serviceId: convert("CatalogId", MSE.Data.Factory.guid, String.empty, MS.Entertainment.Data.convertFeatureOptionsMusicOrVideo), serviceIdType: "ZuneCatalog", assetLocationId: convert("ServiceMediaId", MSE.Data.Factory.guid, String.empty), assetLocationIdType: convert([["CatalogId", "ServiceMediaId"]], MSE.Data.Factory.Library.convertToAssetLocationIdType, String.empty), trackNumber: convert("TrackNumber", MSE.Data.Factory.intNumber, -1), discNumber: convert("DiscNumber", MSE.Data.Factory.intNumber, -1), userStarRating: convert("StarRating", MSE.Data.Factory.intNumber, -1), duration: hydrated(convert("Duration", MSE.Data.Factory.intNumber, -1), MSE.Data.Comparer.inverseDefaultComparer), durationMilliseconds: hydrated(convert("Duration", MSE.Data.Factory.intNumber, -1), MSE.Data.Comparer.inverseDefaultComparer), durationString: convert("Duration", MSE.Utilities.millisecondsToTimeCode, String.empty), mediaType: Microsoft.Entertainment.Queries.ObjectType.track, eventProxy: convert(String.empty, MSE.Data.Factory.createEventProxy), images: hydratedRequired(value(null)), imageUri: hydrated(alias("AlbumImageUrl", null)), imageResizeUri: hydrated(alias("AlbumImageUrl", null)), rights: hydrated(value(null)), hasSmartDJ: hydrated(alias("ArtistCanSmartDJ", false)), canPurchase: alias("CanPurchase", false), canPurchaseStream: alias("CanPurchaseStream", false), canPurchaseDownload: alias("CanPurchaseDownload", false), canFreeStream: alias("CanFreeStream", false), canSubscriptionStream: alias("CanSubscriptionStream", false), canSubscriptionDownload: alias("CanSubscriptionDownload", false), canPlayLocally: alias("CanPlayLocally", false), canPreview: alias("CanPreview", false), hasPurchased: alias("HasPurchased", false), isFreeStreamRestrictedByIndividualLimit: alias("IsFreeStreamRestrictedByIndividualLimit", false), isFreeStreamRestrictedByMonthlyLimit: alias("IsFreeStreamRestrictedByMonthlyLimit", false), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), isExplicit: false, isTrack: true, explicitAriaString: String.empty, canPurchaseAlbum: {
+ get: function () {
+ return !!(this.album && this.album.canPurchaseAlbum && this.album.canPurchaseAlbum())
+ }
+ }, hasAssetLocationId: {
+ get: function () {
+ return !!this.assetLocationId && !MS.Entertainment.Utilities.isEmptyGuid(this.assetLocationId)
+ }
+ }, hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.artistServiceId)
+ }
+ }, hasAlbumServiceId: {
+ get: function () {
+ return this.albumServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.albumServiceId)
+ }
+ }, hasMusicVideoId: {
+ get: function () {
+ return this.musicVideoId && !MS.Entertainment.Utilities.isEmptyGuid(this.musicVideoId)
+ }
+ }, hasNonMarketplaceImage: {
+ get: function () {
+ return !(this.hasServiceId || this.imageUri)
+ }
+ }, hasNonAlbumArtistName: {
+ get: function () {
+ return (!this.album || this.artistName !== this.album.artistName)
+ }
+ }, isFromPlaylist: {
+ get: function () {
+ return (this.fromCollection && MS.Entertainment.Utilities.isValidLibraryId(this.playlistId))
+ }
+ }, hasTakenDown: {
+ get: function () {
+ return this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalTakenDown || this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyTakenDown || this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.notInCollectionTakenDown
+ }
+ }, canStreamFromCloudStorage: {
+ get: function () {
+ return this.assetLocationId === MS.Entertainment.Data.AssetLocationIdType.cloudStorage
+ }
+ }, isCloudMatched: {
+ get: function () {
+ return this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudOnlyValidRights || this.collectionState === Microsoft.Entertainment.Queries.ItemCollectionState.cloudAndLocalValidRights
+ }
+ }, playlistItemOpacity: convert("CollectionState", MSE.Data.Factory.toPlaylistItemOpacity, "1.0"), cloudIcon: convert("CollectionState", MSE.Data.Factory.toCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: convert("CollectionState", MSE.Data.Factory.toCloudIconOpacity, "1.0"), cloudIconTooltip: convert("CollectionState", MSE.Data.Factory.toCloudIconTooltip, String.empty), cloudIconAriaString: convert("CollectionState", MSE.Data.Factory.toCloudIconAriaString, String.empty), onHydrated: MS.Entertainment.Hydrator.track
+ })
+ }), AlbumTracksOnAlbumResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { tracks: hydrated(convertOriginalNoDeflate("items", MSE.Data.Factory.self, null)) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ File: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { url: alias("Url", String.empty) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ MusicVideo: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.MediaItem, null, {
+ artist: hydrated(augment(String.empty, MSE.Data.Augmenter.Library.TrackArtist)), artistId: convert("ArtistId", MSE.Data.Factory.intNumber, -1), artistGroupId: convert([["ArtistId", "ArtistSortName"]], MSE.Data.Factory.joinStrings, null), artistName: hydrated(convertOriginal("ArtistName", MSE.Data.Factory.normalizeTextDirection, null), MSE.Data.Comparer.notFalsy), artistServiceId: hydrated(convert("ArtistBingId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), canonicalId: convert("BingId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), closedCaptionFiles: hydrated(convert("Providers", MSE.Data.Factory.Marketplace.edsClosedCaptionFiles, null)), duration: hydrated(convert("Duration", MSE.Data.Factory.timeSpan, -1), MSE.Data.Comparer.inverseDateComparer), durationMilliseconds: convertNoDeflate("duration", MSE.Utilities.millisecondsFromTimeSpan, null), durationSeconds: convertNoDeflate("duration", MSE.Utilities.secondsFromTimeSpan, null), durationString: convertNoDeflate("duration", MSE.Utilities.millisecondsToTimeCode, String.empty), hasCaptions: hydrated(convertNoDeflate("closedCaptionFiles.length", MSE.Data.Factory.bool, false, convertFeatureOptionsClosedCaptions)), dateAdded: convert("DateAdded", MSE.Data.Factory.databaseDate, null), yearOrMonthAdded: convertNoDeflate("dateAdded", MSE.Data.Factory.Library.localizedYearOrMonthFromDate, null), genreId: convert("GenreId", MSE.Data.Factory.intNumber, -1), genreGroupId: convert("GenreId", MSE.Data.Factory.string, null), genreName: hydrated(convert("GenreName", MSE.Data.Factory.string, null)), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), imageUri: hydrated(alias("ImageUrl", null)), isExplicit: hydrated(convert("IsExplicit", MSE.Data.Factory.boolFromString, false)), primaryGenre: hydrated(convert("GenreName", MSE.Data.Factory.string, null)), libraryId: convert("ObjectId", MSE.Data.Factory.intNumber, -1), name: hydrated(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), sortName: convertOriginal("SortTitle", MSE.Data.Factory.normalizeTextDirection, String.empty), releaseDate: hydrated(convert("ReleaseDate", MSE.Data.Factory.databaseDate, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, String.empty)), trackId: hydrated(convert("TrackBingId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), trackLibraryId: convert("TrackId", MSE.Data.Factory.intNumber, -1), serviceId: hydrated(convert("ServiceMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic)), mediaType: Microsoft.Entertainment.Queries.ObjectType.video, videoType: Microsoft.Entertainment.Queries.VideoType.musicVideo, rights: hydrated(value(null)), hasSmartDJ: hydrated(alias("ArtistCanSmartDJ", false)), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), explicitAriaString: String.empty, track: convertNoDeflate(String.empty, MSE.Data.Factory.convertMusicVideoToTrack, null), hasTrackId: {
+ get: function () {
+ return this.trackId && !MS.Entertainment.Utilities.isEmptyGuid(this.trackId)
+ }
+ }, hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.artistServiceId)
+ }
+ }, onHydrated: MS.Entertainment.Hydrator.musicVideo
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ AlbumGroupData: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Album, null, {
+ name: convertOriginal("Name", MSE.Data.Factory.normalizeTextDirection, String.empty), libraryId: convert("GroupId", MSE.Data.Factory.intNumber, -1)
+ })
+ }), AlbumGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHint, null, { description: convert("ItemsCount", MS.Entertainment.Formatters.albumCountText, String.empty) })
+ }), ArtistGroupData: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Artist, null, {
+ name: convertOriginal("Name", MSE.Data.Factory.normalizeTextDirection, String.empty), libraryId: convert("GroupId", MSE.Data.Factory.intNumber, -1)
+ })
+ }), ArtistGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHint, null, { description: convert("ItemsCount", MS.Entertainment.Formatters.artistCountText, String.empty) })
+ }), TrackGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHint, null, { description: convert("ItemsCount", MS.Entertainment.Formatters.trackCountText, String.empty) })
+ }), PlaylistGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHint, null, { description: convert("ItemsCount", MS.Entertainment.Formatters.playlistCountText, String.empty) })
+ }), AlbumByArtistSubGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHintBase, null, { artist: augment(String.empty, MSE.Data.Augmenter.Library.ArtistGroupData, null) })
+ }), TrackByArtistSubGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHintBase, null, { artist: augment(String.empty, MSE.Data.Augmenter.Library.ArtistGroupData, null) })
+ }), TrackByAlbumSubGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupItemHintBase, null, { album: augment(String.empty, MSE.Data.Augmenter.Library.AlbumGroupData, null) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ AlbumByYearOrMonthGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.AlbumGroupItemHint, null, {
+ groupKey: convert("Name", MSE.Data.Factory.Library.localizedYearOrMonthKey), yearOrMonthAdded: convert("Name", MSE.Data.Factory.Library.localizedYearOrMonth)
+ })
+ }), AlbumByArtistGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.AlbumGroupItemHint, null, { subGroupHints: augment("SubGroups", MSE.Data.Augmenter.Library.AlbumByArtistSubGroupItemHint, null) })
+ }), AlbumByGenreGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.AlbumGroupItemHint, null, {
+ _genreName: convert("Name", MSE.Data.Factory.stringOrUnknown), genreName: convertOriginalNoDeflate("_genreName", MSE.Data.Factory.normalizeTextDirection, String.empty)
+ })
+ }), TrackByYearOrMonthGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.TrackGroupItemHint, null, {
+ groupKey: convert("Name", MSE.Data.Factory.Library.localizedYearOrMonthKey), yearOrMonthAdded: convert("Name", MSE.Data.Factory.Library.localizedYearOrMonth)
+ })
+ }), TrackByArtistGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.TrackGroupItemHint, null, { subGroupHints: augment("SubGroups", MSE.Data.Augmenter.Library.TrackByArtistSubGroupItemHint, null) })
+ }), TrackByAlbumGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.TrackGroupItemHint, null, { subGroupHints: augment("SubGroups", MSE.Data.Augmenter.Library.TrackByAlbumSubGroupItemHint, null) })
+ }), TrackByGenreGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.TrackGroupItemHint, null, {
+ _genreName: convert("Name", MSE.Data.Factory.stringOrUnknown), genreName: convertOriginalNoDeflate("_genreName", MSE.Data.Factory.normalizeTextDirection, String.empty)
+ })
+ }), PlaylistByYearOrMonthGroupItemHint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.PlaylistGroupItemHint, null, {
+ groupKey: convert("Name", MSE.Data.Factory.Library.localizedYearOrMonthKey), yearOrMonthAdded: convert("Name", MSE.Data.Factory.Library.localizedYearOrMonth), yearOrMonthEdited: convert("Name", MSE.Data.Factory.Library.localizedYearOrMonth)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Library", {
+ TracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, { items: list("ResultSet", MSE.Data.Augmenter.Library.Track, null) })
+ }), MusicVideosResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, {
+ items: list("ResultSet", MSE.Data.Augmenter.Library.MusicVideo, null), itemsArray: augment("ResultSet", MSE.Data.Augmenter.Library.MusicVideo, null)
+ })
+ }), TrackMusicVideoResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, {
+ _tracks: augment("ResultSet", MSE.Data.Augmenter.Library.Track), itemsArray: filterArrayNoDeflate("_tracks", MSE.Data.Filter.Marketplace.filterTracksWithoutMusicVideos, MSE.Data.Factory.convertTrackToMusicVideo, null), items: filterNoDeflate("_tracks", MSE.Data.Filter.Marketplace.filterTracksWithoutMusicVideos, MSE.Data.Factory.convertTrackToMusicVideo, null)
+ })
+ }), TrackResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, { item: augment("ResultSet[0]", MSE.Data.Augmenter.Library.Track) })
+ }), ArtistsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, {
+ items: list("ResultSet", MSE.Data.Augmenter.Library.Artist, null), itemsArray: augment("ResultSet", MSE.Data.Augmenter.Library.Artist, null), totalTracksCount: alias("ResultSet[0].TotalTracksCount", 0), totalAlbumsCount: alias("ResultSet[0].TotalAlbumsCount", 0)
+ })
+ }), AlbumResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, { item: augment("ResultSet[0]", MSE.Data.Augmenter.Library.Album) })
+ }), AlbumWithTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment(String.empty, MSE.Data.Augmenter.Library.AlbumWithTracks, null) })
+ }), AlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, {
+ items: list("ResultSet", MSE.Data.Augmenter.Library.Album, null), itemsArray: augment("ResultSet", MSE.Data.Augmenter.Library.Album, null), primaryAlbum: augment("ResultSet[0]", MSE.Data.Augmenter.Library.Album)
+ })
+ }), AlbumsLimitedResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, {
+ _items: list("ResultSet", MSE.Data.Augmenter.Library.Album, null), items: convertNoDeflate("_items", MSE.Data.Factory.Marketplace.setListMaxCount, null), primaryAlbum: augment("ResultSet[0]", MSE.Data.Augmenter.Library.Album)
+ })
+ }), AlbumsGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.AlbumGroupItemHint)) })
+ }), AlbumsByYearOrMonthGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.AlbumByYearOrMonthGroupItemHint)) })
+ }), AlbumsByArtistGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.AlbumByArtistGroupItemHint)) })
+ }), AlbumsByGenreGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.AlbumByGenreGroupItemHint)) })
+ }), ArtistsGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.ArtistGroupItemHint)) })
+ }), TracksGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.TrackGroupItemHint)) })
+ }), TracksByArtistGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.TrackByArtistGroupItemHint)) })
+ }), TracksByAlbumGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.TrackByAlbumGroupItemHint)) })
+ }), TracksByGenreGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.TrackByGenreGroupItemHint)) })
+ }), TracksByYearOrMonthGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.TrackByYearOrMonthGroupItemHint)) })
+ }), PlaylistsGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.PlaylistGroupItemHint)) })
+ }), PlaylistsByYearOrMonthGroupHintsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.GroupsAugmentation, null, { items: listWithContext("Groups", "LargestGroupItemsCount", MSE.Data.Factory.Library.createGroupHintsListItemFactory(MSE.Data.Augmenter.Library.PlaylistByYearOrMonthGroupItemHint)) })
+ }), FilesResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.LibraryResultSet, null, { itemsArray: filterArray("ResultSet", MSE.Data.Filter.Library.filterBackingFiles, MSE.Data.Augmenter.Library.File) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ AlbumReview: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: convert("id", MSE.Data.Factory.guid, String.empty), name: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), content: convertOriginal("content", MSE.Data.Factory.normalizeTextDirection, String.empty)
+ })
+ }), ArtistBio: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: convert("id", MSE.Data.Factory.guid, String.empty), name: convertOriginal("title.$value", MSE.Data.Factory.normalizeTextDirection, String.empty), _content: convertOriginal("content.$value", MSE.Data.Factory.normalizeTextDirection, String.empty), contentNoTags: hydratedRequired(convertNoDeflate("_content", MS.Entertainment.Utilities.processServiceTextBlob, String.empty)), content: hydratedRequired(convertNoDeflate("_content", MS.Entertainment.Data.Factory.Marketplace.processTextWithLinks, String.empty)), mediaType: Microsoft.Entertainment.Queries.ObjectType.bio
+ })
+ }), ArtistImage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: convert("id", MSE.Data.Factory.guid, String.empty), url: alias("instances.imageInstance[0].url", String.empty)
+ })
+ }), Playlist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: hydrated(convert("id", MSE.Data.Factory.guid, String.empty)), name: hydrated(convertOriginal("sortTitle", MSE.Data.Factory.normalizeTextDirection, String.empty)), isExplicit: hydrated(convert("isExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), authorName: hydrated(convertOriginal("authorName", MSE.Data.Factory.normalizeTextDirection, String.empty)), shortText: hydrated(convertOriginal("shortText", MSE.Data.Factory.normalizeTextDirection, String.empty)), count: hydrated(value(0)), duration: hydrated(value(0)), mediaType: Microsoft.Entertainment.Queries.ObjectType.playlist, type: -1, voicePhrase: hydrated(convert("sortTitle", MSE.Data.Factory.normalizeStringForVoice, String.empty)), voiceConfidence: value(defaultVoiceConfidence), onHydrated: MS.Entertainment.Hydrator.playlist
+ })
+ }), Artist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: convert("id", MSE.Data.Factory.guid, String.empty), libraryId: hydratedRequired(alias("libraryId", -1)), name: hydratedRequired(convertOriginal(["title.$value", "name"], MSE.Data.Factory.normalizeTextDirection, String.empty)), title: hydratedRequired(convertOriginal(["title.$value", "name"], MSE.Data.Factory.normalizeTextDirection, String.empty)), genre: hydrated(augment("primaryGenre", MSE.Data.Augmenter.Marketplace.Genre, null)), primaryGenre: hydrated(convertNoDeflate("genre.name", MSE.Data.Factory.self, String.empty)), imageId: convert("image.id", MSE.Data.Factory.guid, null), latestAlbumImageId: convert("latestAlbumImage.id", MSE.Data.Factory.guid, null), hasSmartDJ: hydratedRequired(convert("hasRadioChannel", MSE.Data.Factory.boolFromString, false)), description: hydratedRequired(value(String.empty)), mediaType: Microsoft.Entertainment.Queries.ObjectType.person, personType: Microsoft.Entertainment.Queries.PersonType.artist, cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, voicePhrase: convert("name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), onHydrated: MS.Entertainment.Hydrator.artist
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ Album: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItemContainer, null, {
+ serviceId: hydrated(convert("id", MSE.Data.Factory.guid, String.empty)), name: hydrated(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty)), artistName: hydrated(convertOriginal("primaryArtist.name", MSE.Data.Factory.normalizeTextDirection, String.empty)), label: hydrated(convertOriginal("label", MSE.Data.Factory.normalizeTextDirection, String.empty)), artist: hydrated(augment("primaryArtist", MS.Entertainment.Data.Augmenter.Marketplace.Artist, null)), parent: convertNoDeflate("artist", MSE.Data.Factory.self, null), artistServiceId: hydrated(convert("primaryArtist.id", MSE.Data.Factory.guid, String.empty)), primaryGenre: hydrated(augment("primaryGenre", MSE.Data.Augmenter.Marketplace.Genre, null)), primaryGenreName: hydrated(alias("primaryGenre.title", String.empty)), playCount: convert("playCount", MSE.Data.Factory.intNumber, -1), playRank: convert("playRank", MSE.Data.Factory.intNumber, -1), isExplicit: convert("isExplicit", MSE.Data.Factory.boolFromString, false), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), isPremium: convert("isPremium", MSE.Data.Factory.boolFromString, false), rights: hydrated(augment("rights.right", MSE.Data.Augmenter.Marketplace.Right, [])), releaseDate: hydrated(convert("releaseDate", MSE.Data.Factory.date, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null)), tracks: hydratedRequired(value(null)), mediaType: Microsoft.Entertainment.Queries.ObjectType.album, dateAdded: null, description: null, voicePhrase: convert("title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && this.artistServiceId !== MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ }, hasLibraryId: {
+ get: function () {
+ return this.libraryId > 0
+ }
+ }, cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, summary: convertNoDeflate(String.empty, MSE.Data.Factory.createAlbumSummaryString), onHydrated: MS.Entertainment.Hydrator.album
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EditorialMusicHub: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EditorialHub, null, {
+ voicePhrase: convert("title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), EditorialArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Artist, null, {
+ serviceType: null, serviceId: convert("link.target", MSE.Data.Factory.guid, String.empty), name: hydratedRequired(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: hydratedRequired(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty)), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), zuneId: hydratedRequired(convert("link.target", MSE.Data.Factory.guid, String.empty)), canonicalId: hydratedRequired(value(MSE.Data.Factory.guid)), type: alias("link.type", String.empty), target: alias("link.target", String.empty), voicePhrase: convert("title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), SearchArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Artist, null, {
+ serviceId: alias("serviceId", String.empty), name: hydratedRequired(convertOriginal("name", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: hydratedRequired(convertOriginal("name", MSE.Data.Factory.normalizeTextDirection, String.empty)), hcrSecondaryText: String.empty, hcrInCollectionText: convertNoDeflate("inCollection", MSE.Data.Factory.Marketplace.inMyMusicText, 0), voicePhrase: convert("name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), EditorialAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Album, null, {
+ serviceType: null, serviceId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), name: hydrated(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty)), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), zuneId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), canonicalId: hydratedRequired(value(MSE.Data.Factory.guid)), type: alias("link.type", String.empty), target: alias("link.target", String.empty), voicePhrase: convert("title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), SearchAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Album, null, {
+ serviceId: hydrated(alias("serviceId", String.empty)), name: hydrated(convertOriginal("name", MSE.Data.Factory.normalizeTextDirection, String.empty)), hcrSecondaryText: convertOriginalNoDeflate("artistName", MSE.Data.Factory.normalizeTextDirection, 0), hcrInCollectionText: convertNoDeflate("inCollection", MSE.Data.Factory.Marketplace.inMyMusicText, 0), voicePhrase: convert("name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), MergedAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Album, null, {
+ serviceId: hydrated(convert("primary.id", MSE.Data.Factory.guid, String.empty)), libraryId: convert("source[1].ObjectId", MSE.Data.Factory.self, -1), name: hydrated(convertOriginal("primary.title.$value", MSE.Data.Factory.normalizeTextDirection, String.empty)), artistName: hydrated(convertOriginal("primary.primaryArtist.name", MSE.Data.Factory.normalizeTextDirection, String.empty)), label: hydrated(convertOriginal("primary.label", MSE.Data.Factory.normalizeTextDirection, String.empty)), artist: hydrated(augment("primary.primaryArtist", MS.Entertainment.Data.Augmenter.Marketplace.Artist, null)), artistServiceId: hydrated(convert("primary.primaryArtist.id", MSE.Data.Factory.guid, String.empty)), primaryGenre: hydrated(augment("primary.primaryGenre", MSE.Data.Augmenter.Marketplace.Genre, null)), playCount: convert("primary.playCount", MSE.Data.Factory.intNumber, -1), playRank: convert("primary.playRank", MSE.Data.Factory.intNumber, -1), isExplicit: convert("primary.isExplicit", MSE.Data.Factory.boolFromString, false), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), isPremium: convert("primary.isPremium", MSE.Data.Factory.boolFromString, false), rights: hydrated(augment("primary.rights.right", MSE.Data.Augmenter.Marketplace.Right, [])), releaseDate: hydrated(convert("primary.releaseDate", MSE.Data.Factory.date, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null)), voicePhrase: convert("primary.title.$value", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), Track: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ serviceId: hydrated(convert("id", MSE.Data.Factory.guid, String.empty)), name: hydrated(convertOriginal("title.$value", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), duration: hydrated(convert("length", MSE.Data.Factory.timeSpan, -1), MSE.Data.Comparer.inverseDateComparer), durationString: convertNoDeflate("duration", MSE.Utilities.millisecondsToTimeCode, String.empty), trackNumber: convert("trackNumber", MSE.Data.Factory.intNumber, -1), date: convert("updated", MSE.Data.Factory.date), artist: hydrated(augment("primaryArtist", MSE.Data.Augmenter.Marketplace.Artist, null)), artistServiceId: hydrated(convert("primaryArtist.id", MSE.Data.Factory.guid, String.empty)), artistName: hydrated(convertOriginal("primaryArtist.name", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), album: hydrated(augment("album", MSE.Data.Augmenter.Marketplace.Album, null)), parent: convertNoDeflate("album", MSE.Data.Factory.self, null), albumName: hydrated(convertOriginal("album.title", MSE.Data.Factory.normalizeTextDirection, String.empty)), _albumAndArtistName: convertNoDeflate(String.empty, MSE.Data.Factory.albumAndArtist, String.empty), albumAndArtistName: convertOriginalNoDeflate("_albumAndArtistName", MSE.Data.Factory.normalizeTextDirection, String.empty), albumServiceId: hydrated(convert("album.id", MSE.Data.Factory.guid, String.empty)), rights: hydrated(augment("rights.right", MSE.Data.Augmenter.Marketplace.Right, [])), hasPreview: convertNoDeflate("rights", MSE.Data.Factory.Marketplace.Rights.hasPreviewRight, false), genreName: hydrated(alias("primaryGenre.title", String.empty)), primaryGenre: hydrated(alias("primaryGenre.title", String.empty)), mediaType: Microsoft.Entertainment.Queries.ObjectType.track, isExplicit: convert("isExplicit", MSE.Data.Factory.boolFromString, false), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, String.empty)), label: hydrated(convertOriginal("label", MSE.Data.Factory.normalizeTextDirection, String.empty)), eventProxy: convert(String.empty, MSE.Data.Factory.createEventProxy), dateAdded: null, filePath: null, releaseDate: hydrated(value(null)), hasRights: true, images: hydratedRequired(value(null)), imageUri: hydratedRequired(value(null)), imageResizeUri: hydratedRequired(value(null)), voicePhrase: convert("title.$value", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), isAudioAd: alias("isAudioAd", false), source: alias("source", null), hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.artistServiceId)
+ }
+ }, hasAlbumServiceId: {
+ get: function () {
+ return this.albumServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.albumServiceId)
+ }
+ }, isParentallyBlocked: {
+ get: function () {
+ return MS.Entertainment.Data.Factory.isMediaParentallyBlocked(this)
+ }
+ }, cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, onHydrated: MS.Entertainment.Hydrator.track
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ PinnedArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EditorialArtist, null, {
+ provider: alias("Provider", null), canonicalId: hydrated(convert("ProviderId", MSE.Data.Factory.guid, String.empty))
+ })
+ }), PinnedAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EditorialAlbum, null, {
+ provider: alias("Provider", null), canonicalId: hydrated(convert("ProviderId", MSE.Data.Factory.guid, String.empty))
+ })
+ }), PinnedPlaylist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Playlist, null, {
+ provider: alias("Provider", null), cloudSyncItemId: hydrated(convert("ProviderId", MSE.Data.Factory.guid, String.empty)), title: alias("Title", null)
+ })
+ })
+ }),
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ RecentArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSArtist, null, {
+ acquisitionContext: alias("AcquisitionContext"), serviceId: alias("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), serviceIdType: MS.Entertainment.Data.Query.edsIdType.canonical, canonicalId: hydratedRequired(alias("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), childType: alias("ChildItemMediaType", null), name: hydrated(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), imageResizeUri: hydrated(alias("ImageUrl")), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), RecentSmartDJ: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSArtist, null, {
+ acquisitionContext: alias("AcquisitionContext"), smartDJ: true, serviceId: alias("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), serviceIdType: MS.Entertainment.Data.Query.edsIdType.canonical, canonicalId: hydratedRequired(alias("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), mediaType: Microsoft.Entertainment.Queries.ObjectType.smartDJ, artist: augment(["Item", String.empty], MSE.Data.Augmenter.Marketplace.EDSSmartDJArtist, null), artistServiceId: alias(["ItemId"], MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), name: hydrated(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), imageResizeUri: hydrated(alias("ImageUrl")), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), RecentAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSAlbum, null, {
+ acquisitionContext: alias("AcquisitionContext"), canonicalId: hydrated(convert("ItemId", MSE.Data.Factory.guid, String.empty)), serviceIdType: MS.Entertainment.Data.Query.edsIdType.canonical, name: hydrated(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), imageResizeUri: hydrated(alias("ImageUrl")), serviceId: hydrated(convert("ItemId", MSE.Data.Factory.guid, String.empty)), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), RecentPlaylist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.CloudPlaylist, null, {
+ acquisitionContext: alias("AcquisitionContext"), albumImages: hydrated(sortArray("AlbumImages", MSE.Data.Comparer.Marketplace.edsCompareImageRankOnly, MSE.Data.Augmenter.Marketplace.CloudImage, MSE.Data.Factory.array)), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), onHydrated: MS.Entertainment.Hydrator.cloudPlaylist
+ })
+ }), RecentMusicVideo: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null, {
+ acquisitionContext: alias("AcquisitionContext"), canonicalId: hydrated(convert("ItemId", MSE.Data.Factory.guid, String.empty)), serviceIdType: MS.Entertainment.Data.Query.edsIdType.canonical, name: hydrated(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), imageResizeUri: hydrated(alias("ImageUrl")), serviceId: hydrated(convert("ItemId", MSE.Data.Factory.guid, String.empty)), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ })
+ }),
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EditorialTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Track, null, {
+ serviceType: null, serviceId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), name: hydrated(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), imageId: hydrated(convert("image.id", MSE.Data.Factory.guid, String.empty)), zuneId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), canonicalId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), type: alias("link.type", String.empty), target: alias("link.target", String.empty), voicePhrase: convert("title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ SearchTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Track, null, {
+ serviceId: hydrated(alias("serviceId", String.empty)), name: hydrated(convertOriginal("name", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), hcrSecondaryText: convertOriginalNoDeflate("album.title", MSE.Data.Factory.normalizeTextDirection, 0), hcrInCollectionText: convertNoDeflate("inCollection", MSE.Data.Factory.Marketplace.inMyMusicText, 0), voicePhrase: convert("name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), RichAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Album, null, {
+ _name: alias(["title.$value", "title"], String.empty), name: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), tracks: hydrated(augment("entry", MSE.Data.Augmenter.Marketplace.Track, null)), voicePhrase: convertNoDeflate("_name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), MusicVideo: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.Track, null, {})
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.WMIS", {
+ Track: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ name: hydrated(alias("Title", String.empty), MSE.Data.Comparer.notFalsy), trackNumber: convert("TrackNum", MSE.Data.Factory.intNumber, 0), uniqueFileId: alias("UniqueFileId"), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), onHydrated: MS.Entertainment.Hydrator.track
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.WMIS", {
+ Album: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ name: hydrated(alias("albumFullTitle", String.empty)), id: alias("id_album"), serviceType: MSE.Data.Augmenter.ServiceTypes.wmis, artistName: alias("albumPerformer", String.empty), primaryGenreName: alias("albumGenre", String.empty), releaseDate: convert("albumReleaseDate", MSE.Data.Factory.date, null), releaseYear: convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null), trackCount: convert("numberOfTracks", MSE.Data.Factory.intNumber, 0), tracks: hydratedRequired(value(null)), artist: hydratedRequired(value(null)), voicePhrase: convert("albumFullTitle", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), albumCover: alias("albumCover", null), imageUri: {
+ get: (function () {
+ var imageEndpoint;
+ return function getImageUri() {
+ if (this._imageUrl === null) {
+ if (!imageEndpoint)
+ imageEndpoint = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_WMISImage) + "/";
+ if (this.albumCover)
+ this._imageUrl = imageEndpoint + this.albumCover;
+ else
+ this._imageUrl = String.Empty
+ }
+ return this._imageUrl
+ }
+ })(), set: function (value) {
+ this._imageUrl = value
+ }
+ }, summary: convertNoDeflate(String.empty, MSE.Data.Factory.createAlbumSummaryString), _imageUrl: null, onHydrated: MS.Entertainment.Hydrator.album
+ })
+ }), AlbumWithTracks: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ name: alias("Title", String.empty), artistName: alias("PerformerName", String.empty), primaryGenreName: alias("Genre", String.empty), releaseDate: convert("ReleaseDate", MSE.Data.Factory.date, null), releaseYear: convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null), tracks: augment("track", MSE.Data.Augmenter.WMIS.Track, null), uniqueFileId: alias("UniqueFileId"), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), largeCoverArtURL: alias("LargeCoverArtURL", null), imageUri: {
+ get: (function () {
+ var imageEndpoint;
+ return function getImageUri() {
+ if (!imageEndpoint)
+ imageEndpoint = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_WMISImage) + "/";
+ if (this.largeCoverArtURL)
+ return imageEndpoint + this.largeCoverArtURL;
+ else
+ return String.Empty
+ }
+ })()
+ }
+ })
+ }), Endpoint: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ name: alias("Name", String.empty), uri: alias("URI", String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.WMIS", {
+ AlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ count: alias("METADATA.MDSR-CD.SearchResultCount", 0), items: list("METADATA.MDSR-CD.SearchResult.Result", MSE.Data.Augmenter.WMIS.Album, null)
+ })
+ }), AlbumWithTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("METADATA.MDAR-CD", MSE.Data.Augmenter.WMIS.AlbumWithTracks, null) })
+ }), EndpointsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ getAlbumDetailsEndpoint: {
+ get: function () {
+ return this._findEndpointUrl("GetAlbumDetailsFromAlbumId")
+ }
+ }, queryEndpoint: {
+ get: function () {
+ return this._findEndpointUrl("Search")
+ }
+ }, _features: augment("METADATA.ENDPOINTS.ENDPOINT", MSE.Data.Augmenter.WMIS.Endpoint, null), _findEndpointUrl: function _findEndpointUrl(name) {
+ for (var i = 0; i < this._features.length; i++)
+ if (this._features[i].name === name)
+ return this._features[i].uri;
+ return String.empty
+ }
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.MusicMatch", {
+ ArtistRole: {
+ main: "Main", secondary: "Secondary"
+ }, MatchType: {
+ fullMatch: "FullMatch", metadataMatch: "MetadataMatch", noMatch: "NoMatch", notInRequest: "NotInRequest"
+ }, extractPrimaryArtist: function extractPrimaryArtist(contributions) {
+ if (contributions)
+ for (var key in contributions) {
+ var artist = contributions[key];
+ if (artist && artist.Role === MS.Entertainment.Data.Augmenter.MusicMatch.ArtistRole.main)
+ return MSE.Data.augment(artist, MSE.Data.Augmenter.MusicMatch.Artist)
+ }
+ return null
+ }, Artist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ name: convert("ArtistName", MSE.Data.Factory.normalizeTextDirection, String.empty), zuneId: convert("ArtistId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), role: alias("Role", String.empty), mediaType: Microsoft.Entertainment.Queries.ObjectType.person, voicePhrase: convert("ArtistName", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), onHydrated: MS.Entertainment.Hydrator.artist
+ })
+ }), Track: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mainTitle: hydrated(alias("Title", String.empty), MSE.Data.Comparer.notFalsy), subTitle: alias("SubTitle", String.empty), zuneId: convert("MetadataMediaId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), _name: convertNoDeflate(String.empty, MSE.Data.Factory.Common.combineTitleAndSubTitle, String.empty), name: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), trackNumber: convert("TrackNumber", MSE.Data.Factory.intNumber, 0), requestId: alias("TrackRequestId", String.empty), matchType: alias("MatchType", String.empty), artists: augment("Contributions", MSE.Data.Augmenter.MusicMatch.Artist), artist: convert("Contributions", MSE.Data.Augmenter.MusicMatch.extractPrimaryArtist, null), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), mediaType: Microsoft.Entertainment.Queries.ObjectType.track, actionableMediaId: alias("ActionableMediaId", String.empty), isInMusicCatalog: alias("IsInXboxMusicCatalog", false), isExplicit: hydrated(convert("IsExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), onHydrated: MS.Entertainment.Hydrator.track
+ })
+ }), AlbumWithTracks: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ zuneId: convert("AlbumId", MSE.Data.Factory.guid, String.empty, convertFeatureOptionsMusic), mainTitle: alias("Title", String.empty), subTitle: alias("SubTitle", String.empty), _name: convertNoDeflate(String.empty, MSE.Data.Factory.Common.combineTitleAndSubTitle, String.empty), name: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty), artistName: alias("ArtistDisplayName", String.empty), artists: augment("Contributions", MSE.Data.Augmenter.MusicMatch.Artist), artist: convert("Contributions", MSE.Data.Augmenter.MusicMatch.extractPrimaryArtist, null), primaryGenreName: alias("Genre", String.empty), releaseDate: convert("ReleaseDate", MSE.Data.Factory.date, null), releaseYear: convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null), tracks: augment("Tracks", MSE.Data.Augmenter.MusicMatch.Track), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), imageUri: alias("Url"), mediaType: Microsoft.Entertainment.Queries.ObjectType.album, trackCount: hydrated(convert("Tracks.length", MSE.Data.Factory.intNumber, 0)), isInMusicCatalog: alias("IsInXboxMusicCatalog"), summary: convertNoDeflate(String.empty, MSE.Data.Factory.createAlbumSummaryString), isExplicit: hydrated(convert("IsExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), onHydrated: MS.Entertainment.Hydrator.album, hasZuneId: {
+ get: function () {
+ return !MS.Entertainment.Utilities.isEmptyGuid(this.zuneId)
+ }
+ }
+ })
+ }), AlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ xCorrelationId: alias("XCorrelationId", String.empty), items: list("Albums", MSE.Data.Augmenter.MusicMatch.AlbumWithTracks, null)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ MergedCollectionMarketplaceResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ marketplaceItems: filterArray("source[0].feed.entry", MSE.Data.Filter.Marketplace.filterUnsupportedAlbums, MSE.Data.Augmenter.Marketplace.MediaItem), collectionItems: augment("source[1].ResultSet", MSE.Data.Augmenter.Library.MediaItem, null)
+ })
+ }), TracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ items: list("feed.entry", MSE.Data.Augmenter.Marketplace.Track, null), itemsArray: augment("feed.entry", MSE.Data.Augmenter.Marketplace.Track, null)
+ })
+ }), TrackDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("entry", MSE.Data.Augmenter.Marketplace.Track, null) })
+ }), MusicVideoDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("entry", MSE.Data.Augmenter.Marketplace.MusicVideo, null) })
+ }), AlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ count: alias("feed.entry.length"), items: filter("feed.entry", MSE.Data.Filter.Marketplace.filterUnsupportedAlbums, MSE.Data.Augmenter.Marketplace.RichAlbum)
+ })
+ }), FeaturedGenreAlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ count: alias(["feed.entry[1].albums.album.length", "feed.entry.length"]), items: filter(["feed.entry[1].albums.album", "feed.entry"], MSE.Data.Filter.Marketplace.filterUnsupportedAlbums, MSE.Data.Augmenter.Marketplace.RichAlbum)
+ })
+ }), AlbumDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("feed", MSE.Data.Augmenter.Marketplace.RichAlbum, null) })
+ }), AlbumReviewResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("entry", MSE.Data.Augmenter.Marketplace.AlbumReview, null) })
+ }), ArtistsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("feed.entry", MSE.Data.Augmenter.Marketplace.Artist, null) })
+ }), ArtistDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("entry", MSE.Data.Augmenter.Marketplace.Artist, null) })
+ }), ArtistBioResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { item: augment("entry", MSE.Data.Augmenter.Marketplace.ArtistBio, null) })
+ }), ArtistImagesResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: augment("feed.entry", MSE.Data.Augmenter.Marketplace.ArtistImage, null) })
+ }), PlaylistsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("feed.entry", MSE.Data.Augmenter.Marketplace.Playlist, null) })
+ }), TopAlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ count: alias("feed.entry.length"), entries: filter("feed.entry", MSE.Data.Filter.Marketplace.filterUnsupportedAlbums, MSE.Data.Augmenter.Marketplace.RichAlbum)
+ })
+ }), TopAlbumsResultWithItems: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ count: alias("feed.entry.length"), items: filter("feed.entry", MSE.Data.Filter.Marketplace.filterUnsupportedAlbums, MSE.Data.Augmenter.Marketplace.RichAlbum)
+ })
+ }), TopArtistsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("feed.entry", MSE.Data.Augmenter.Marketplace.Artist, null) })
+ }), TopTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("feed.entry", MSE.Data.Augmenter.Marketplace.Track, null) })
+ }), CloudPlaylists: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("PlaylistMetadata.PlaylistMetadata", MSE.Data.Augmenter.Marketplace.CloudPlaylist, null) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Spotlight", {
+ SpotlightItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ actionTarget: alias("ActionTarget", null), id: convert("ItemId", MSE.Data.Factory.guid, String.empty), imagePrimaryUrl: alias("ImageUrl", null), imageResizeUri: alias("ImageUrl", null), isExplicit: convert("IsExplicit", MSE.Data.Factory.boolFromString, false), mediaType: Microsoft.Entertainment.Queries.ObjectType.editorial, name: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryArtistId: convert("PrimaryArtistId", MSE.Data.Factory.guid, String.empty), primaryText: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), serviceId: convert("ItemId", MSE.Data.Factory.guid, String.empty), serviceIdType: MS.Entertainment.Data.Query.edsIdType.zuneCatalog, serviceType: value(MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem), type: alias("ItemType", null), voiceConfidence: value(defaultVoiceConfidence), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), zuneId: convert("ItemId", MSE.Data.Factory.guid, String.empty)
+ })
+ }), SpotlightArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSArtist, null, {
+ canonicalId: hydratedRequired(convert("ID", MSE.Data.Factory.guid, String.empty)), editorialTitle: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), id: convert("ItemId", MSE.Data.Factory.guid, String.empty), imagePrimaryUrl: alias("ImageUrl", null), itemType: alias("ItemType", null), name: hydratedRequired(convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty)), primaryText: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), serviceId: convert("ItemId", MSE.Data.Factory.guid, String.empty), serviceIdType: convert(String.empty, MSE.Data.Factory.Marketplace.edsServiceIdTypeLegacy, null), text: convertOriginal("LongDescription", MSE.Data.Factory.normalizeTextDirection, String.empty), type: alias("ItemType", null), voiceConfidence: value(defaultVoiceConfidence), voicePhrase: convertNoDeflate("primaryText", MSE.Data.Factory.normalizeStringForVoice, String.empty), zuneId: convert("ItemId", MSE.Data.Factory.guid, String.empty)
+ })
+ }), SpotlightAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSAlbum, null, {
+ editorialTitle: convertOriginal("LongDescription", MSE.Data.Factory.normalizeTextDirection, String.empty), id: convert("ItemId", MSE.Data.Factory.guid, String.empty), imagePrimaryUrl: alias("ImageUrl", null), imageResizeUri: hydrated(alias("ImageUrl", null)), itemType: alias("ItemType", null), primaryText: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), serviceId: convert("ItemId", MSE.Data.Factory.guid, String.empty), serviceIdType: convert(String.empty, MSE.Data.Factory.Marketplace.edsServiceIdTypeLegacy, null), text: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), title: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), type: alias("ItemType", null), voiceConfidence: value(defaultVoiceConfidence), voicePhrase: convertNoDeflate("primaryText", MSE.Data.Factory.normalizeStringForVoice, String.empty)
+ })
+ }), SpotlightPlaylist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.CloudPlaylist, null, {
+ editorialTitle: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), id: convert("ItemId", MSE.Data.Factory.guid, String.empty), imageId: alias("ImageId", null), name: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), itemType: alias("ItemType", null), primaryText: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), serviceId: convert("ItemId", MSE.Data.Factory.guid, String.empty), serviceIdType: convert(String.empty, MSE.Data.Factory.Marketplace.edsServiceIdTypeLegacy, null), text: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), type: alias("ItemType", null), voiceConfidence: value(defaultVoiceConfidence), voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EditorialEntriesResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ entries: list("feed.entry", MSE.Data.Augmenter.Marketplace.EditorialItemsEntry, null), itemsArray: augment("feed.entry", MSE.Data.Augmenter.Marketplace.EditorialItemsEntry, null), editorialItems: filterArray("feed.entry[0].editorialItems.editorialItem", MSE.Data.Filter.Marketplace.filterUnsupportedMusicHubItems, MS.Entertainment.Data.Factory.Common.createMediaItemFromEditorialItem, MS.Entertainment.Data.Factory.array)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ AlbumSharePackage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mediaId: alias("serviceId", String.empty), mediaType: alias("mediaType", Microsoft.Entertainment.Queries.ObjectType.album), mediaTitle: alias("name", String.empty), title: alias("name", String.empty), description: alias("artistName", String.empty), text: alias("name", String.empty), uri: alias("webUri", String.empty), htmlUri: alias("webUri", String.empty), htmlImages: collect(["imageUri", "primaryImageUri"], null, String.empty), htmlLines: collect(["name", "artistName", "releaseYear"], null, String.empty), emptyMessage: String.id.IDS_SHARE_EMPTY_MESSAGE_ALBUM
+ })
+ }), TrackSharePackage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mediaId: alias("serviceId", String.empty), mediaType: alias("mediaType", Microsoft.Entertainment.Queries.ObjectType.track), mediaTitle: alias("name", String.empty), title: alias("name", String.empty), description: alias("artistName", String.empty), text: alias("name", String.empty), uri: alias("webUri", String.empty), htmlUri: alias("webUri", String.empty), htmlImages: collect(["imageUri", "primaryImageUri"], null, String.empty), htmlLines: collect(["name", "artistName"], null, String.empty), emptyMessage: String.id.IDS_SHARE_EMPTY_MESSAGE_TRACK
+ })
+ }), ArtistSharePackage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MS.Entertainment.Data.Augmenter.Marketplace.MediaSharePackage, null, {
+ emptyMessage: String.id.IDS_SHARE_EMPTY_MESSAGE_ARTIST, description: alias("descriptionNoTags", String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMediaItem, null, {
+ genre: hydrated(augment("Genres[0]", MSE.Data.Augmenter.Marketplace.EDSGenre, null)), genreName: hydrated(convertNoDeflate("genre.name", MSE.Data.Factory.self, String.empty)), primaryGenre: hydrated(convertNoDeflate("genre.name", MSE.Data.Factory.self, String.empty)), _description: convertOriginal("Description", MSE.Data.Factory.normalizeTextDirection, String.empty), descriptionNoTags: hydratedRequired(convertNoDeflate("_description", MS.Entertainment.Utilities.processServiceTextBlob, String.empty)), description: hydratedRequired(convertNoDeflate("_description", MS.Entertainment.Data.Factory.Marketplace.processTextWithLinks, String.empty)), content: hydratedRequired(convertNoDeflate("_description", MS.Entertainment.Data.Factory.Marketplace.processTextWithLinks, String.empty)), images: sortArray("Images", MSE.Data.Comparer.Marketplace.edsCompareImageRankOnly, MSE.Data.Augmenter.Marketplace.EDSImage, MSE.Data.Factory.array), primaryImage: searchNoDeflate("images", MSE.Data.Filter.Marketplace.edsFilterNonCoversNonThumbnailsWideOrTall, null), largeImages: filterArray("Images", MSE.Data.Filter.Marketplace.edsFilterNonNowPlayingBackgrounds, MSE.Data.Augmenter.Marketplace.EDSImage, MSE.Data.Factory.array), primaryLargeImage: convertNoDeflate("largeImages[0]", MSE.Data.Factory.self, null), mediaType: Microsoft.Entertainment.Queries.ObjectType.person, personType: Microsoft.Entertainment.Queries.PersonType.artist, hasSmartDJ: hydrated(alias("HasTrackMediaGuide", false)), hasDescription: true, cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, sortName: alias("SortName", String.empty), voicePhrase: convert("Name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), onHydrated: MS.Entertainment.Hydrator.artist, catalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.EDS, sourceId: MS.Entertainment.Utilities.Telemetry.ContentSourceId.App, webPlaylistRemoveLabel: convertNoDeflate(String.empty, MSE.Data.Factory.createArtistRemoveString, String.empty)
+ })
+ }), EDSAlbumOfferRight: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSOfferRight, null, { licenseRight: convert("offer.DistributionRight", MSE.Data.Factory.Marketplace.edsConvertToAlbumRightType, String.empty) })
+ }), EdsMusicVideoClosedCaption: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ mediaInstanceId: convert("MediaInstanceID", MSE.Data.Factory.guid, String.empty), lcid: convert("Lcid", MSE.Data.Factory.string, String.empty), name: alias("Name", String.empty), fileUri: alias("FileUri", String.empty)
+ })
+ }), EDSModernAlbumOfferRight: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSModernOfferRight, null, {
+ licenseRight: convert("offer.DistributionRight", MSE.Data.Factory.Marketplace.edsConvertToAlbumRightType, String.empty), displayPrice: convertOriginalNoDeflate("_displayData.displayPrice", MSE.Data.Factory.normalizeTextDirection, String.empty), _displayData: convert("offer.OfferDisplay", MSE.Data.Factory.parseJSON, String.empty)
+ })
+ }), EDSSubscription: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.MediaItem, null, {
+ title: convertOriginalNoDeflate("_displayData.availabilityTitle", MSE.Data.Factory.normalizeTextDirection, String.empty), price: convertOriginalNoDeflate("_displayData.displayPrice", MSE.Data.Factory.normalizeTextDirection, String.empty), offerId: convertNoDeflate("_displayData.offerId", MSE.Data.Factory.self, String.empty), signedOffer: alias("SignedOffer", String.empty), mediaType: MS.Entertainment.Data.Query.edsMediaType.subscription, _displayData: convert("OfferDisplayData", MSE.Data.Factory.parseJSON, String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSSmartDJArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSArtist, null, {
+ name: convertOriginal(["Item.Title", "Title"], MSE.Data.Factory.normalizeTextDirection, String.empty), hasSmartDJ: hydratedRequired(alias("HasTrackMediaGuide", false)), imageResizeUri: alias("ImageUrl", String.empty), serviceId: alias("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), canonicalId: hydratedRequired(alias("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), voicePhrase: convert("Item.Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSSmartDJResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ name: convertOriginal(["Item.Title", "Title"], MSE.Data.Factory.normalizeTextDirection, String.empty), subtitle: convertOriginal(["Item.SubTitle", "SubTitle"], MSE.Data.Factory.normalizeTextDirection, String.empty), serviceId: alias(["Item.ItemId", "ItemId"], MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), artist: augment(["Item", String.empty], MSE.Data.Augmenter.Marketplace.EDSSmartDJArtist, null), artistServiceId: alias(["Item.ItemId", "ItemId"], MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), imageResizeUri: alias(["Item.ImageUrl", "ImageUrl"], String.empty), index: alias("Index", -1), recentlyPlayedDate: convert(["Item.EventDateTimeUtc", "EventDateTimeUtc"], MSE.Data.Factory.databaseDate, null), smartDJ: true, mediaType: Microsoft.Entertainment.Queries.ObjectType.smartDJ, voicePhrase: convert("Item.Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), listVersion: -1, catalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.EDS, sourceId: MS.Entertainment.Utilities.Telemetry.ContentSourceId.App
+ })
+ }), EDSAlbumReview: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ _criticReview: convertOriginal("ReviewSources[0].CriticReviews[0].CriticText", MSE.Data.Factory.normalizeTextDirection, String.empty), criticReviewNoTags: hydratedRequired(convertNoDeflate("_criticReview", MS.Entertainment.Utilities.processServiceTextBlob, String.empty)), criticReview: hydratedRequired(convertNoDeflate("_criticReview", MS.Entertainment.Data.Factory.Marketplace.processTextWithLinks, String.empty))
+ })
+ }), EDSAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMediaItem, null, {
+ mainTitle: alias(["Name", "name"], String.empty), subTitle: alias("SubTitle", String.empty), _name: convertNoDeflate(String.empty, MSE.Data.Factory.Common.combineTitleAndSubTitle, String.empty), name: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty), artistName: hydrated(convertOriginal("PrimaryArtist.Name", MSE.Data.Factory.normalizeTextDirection, String.empty)), label: hydrated(convertOriginal("Label", MSE.Data.Factory.normalizeTextDirection, String.empty)), _artist: augment("PrimaryArtist", MSE.Data.Augmenter.Marketplace.EDSArtist, null), artist: hydrated(convertNoDeflate([["impressionGuid", "_artist"]], MSE.Data.Factory.Marketplace.edsSetImpressionGuid)), parent: convertNoDeflate("artist", MSE.Data.Factory.self, null), artistServiceId: hydrated(convert("PrimaryArtist.ID", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), _criticReview: convertOriginal("ReviewSources[0].CriticReviews[0].CriticText", MSE.Data.Factory.normalizeTextDirection, String.empty), criticReviewNoTags: hydratedRequired(convertNoDeflate("_criticReview", MS.Entertainment.Utilities.processServiceTextBlob, String.empty)), criticReview: hydratedRequired(convertNoDeflate("_criticReview", MS.Entertainment.Data.Factory.Marketplace.processTextWithLinks, String.empty)), hasSmartDJ: hydrated(alias("PrimaryArtist.HasTrackMediaGuide", false)), primaryGenre: hydrated(augment("Genres[0]", MSE.Data.Augmenter.Marketplace.EDSGenre, null)), primaryGenreName: hydrated(alias("Genres[0].Name", String.empty)), trackCount: hydrated(convert("TrackCount", MSE.Data.Factory.intNumber, 0)), totalTracksCount: hydrated(convert("TrackCount", MSE.Data.Factory.intNumber, -1)), isExplicit: hydrated(convert("IsExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), releaseDate: hydrated(convert("ReleaseDate", MSE.Data.Factory.date, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null)), duration: hydrated(convert("Duration", MSE.Data.Factory.timeSpan, -1), MSE.Data.Comparer.inverseDateComparer), durationSeconds: convertNoDeflate("duration", MSE.Utilities.secondsFromTimeSpan, null), genre: hydrated(augment("Genres[0]", MSE.Data.Augmenter.Marketplace.EDSGenre, null)), genreName: hydrated(convertNoDeflate("genre.name", MSE.Data.Factory.self, String.empty)), mediaType: Microsoft.Entertainment.Queries.ObjectType.album, dateAdded: null, rights: hydrated(convert("Providers", MSE.Data.Factory.Marketplace.edsAlbumRightsIEBProviders, null)), tracks: hydrated(value(null)), hasPurchasableTracks: hydrated(value(false)), cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, cloudIconAriaString: String.empty, isPremium: false, voicePhrase: convert("Name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && this.artistServiceId !== MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ }, hasLibraryId: {
+ get: function () {
+ return this.libraryId > 0
+ }
+ }, summary: convertNoDeflate(String.empty, MSE.Data.Factory.createAlbumSummaryString), isParentallyBlocked: {
+ get: function () {
+ return MS.Entertainment.Data.Factory.isMediaParentallyBlocked(this)
+ }
+ }, onHydrated: MS.Entertainment.Hydrator.album, catalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.EDS, sourceId: MS.Entertainment.Utilities.Telemetry.ContentSourceId.App
+ })
+ }), EDSGenreBrowseQueryOptions: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { genreId: alias("Name", String.empty) })
+ }), EDSSubGenreQueryOptions: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { genreId: alias("Name", String.empty) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSTrackAlbumBase: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.mix({ ParentAlbum: MSE.Data.Augmenter.Marketplace.EDSAlbum })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSTrackAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSTrackAlbumBase, null, {
+ name: hydrated(convertOriginal("ParentAlbum.Name", MSE.Data.Factory.normalizeTextDirection, String.empty)), artistName: hydrated(convertOriginal("PrimaryArtist.Name", MSE.Data.Factory.normalizeTextDirection, String.empty)), artist: hydrated(augment("PrimaryArtist", MSE.Data.Augmenter.Marketplace.EDSArtist, null)), artistServiceId: hydrated(convert("PrimaryArtist.ID", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), hasSmartDJ: hydrated(alias("PrimaryArtist.HasTrackMediaGuide", false)), parent: convertNoDeflate("artist", MSE.Data.Factory.self, null), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null)), cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, webUri: convertNoDeflate(String.empty, MSE.Data.Factory.Common.webDetailsUri, String.empty), voicePhrase: convert("ParentAlbum.Name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSMergedAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSAlbum, null, {
+ serviceId: hydrated(convert(["primary.ZuneId", "primary.ID"], MSE.Data.Factory.guid, String.empty)), libraryId: convert("source[1].ObjectId", MSE.Data.Factory.self, -1), serviceIdType: hydrated(convert("primary", MSE.Data.Factory.Marketplace.edsServiceIdType, null)), zuneId: hydrated(alias(["primary.ZuneId", "primary.ID"], MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), canonicalId: hydrated(alias("primary.ID", MS.Entertainment.Utilities.EMPTY_GUID)), mainTitle: alias("primary.Name", String.empty), subTitle: alias("primary.SubTitle", String.empty), impressionGuid: alias("primary.impressionGuid", String.empty), _name: convertNoDeflate(String.empty, MSE.Data.Factory.Common.combineTitleAndSubTitle, String.empty), name: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), _artist: augment("primary.PrimaryArtist", MSE.Data.Augmenter.Marketplace.EDSArtist, null), artist: hydrated(convertNoDeflate([["impressionGuid", "_artist"]], MSE.Data.Factory.Marketplace.edsSetImpressionGuid)), artistName: hydrated(convertOriginal("primary.PrimaryArtist.Name", MSE.Data.Factory.normalizeTextDirection, String.empty)), label: hydrated(convertOriginal("primary.Label", MSE.Data.Factory.normalizeTextDirection, String.empty)), artistServiceId: hydrated(convert(["primary.PrimaryArtist.ZuneID", "primary.PrimaryArtist.ID"], MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), primaryGenre: hydrated(augment("primary.Genres[0]", MSE.Data.Augmenter.Marketplace.EDSGenre, null)), trackCount: hydrated(convert("primary.TrackCount", MSE.Data.Factory.intNumber, 0)), isExplicit: hydrated(convert("primary.IsExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), releaseDate: hydrated(convert("primary.ReleaseDate", MSE.Data.Factory.date, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null)), duration: hydrated(convert("primary.Duration", MSE.Data.Factory.timeSpan, -1), MSE.Data.Comparer.inverseDateComparer), durationSeconds: convertNoDeflate("duration", MSE.Utilities.secondsFromTimeSpan, null), edsMediaGroup: alias("primary.MediaGroup", null), edsMediaItemType: alias("primary.MediaItemType", null), mediaType: Microsoft.Entertainment.Queries.ObjectType.album, images: hydrated(sortArray("primary.Images", MSE.Data.Comparer.Marketplace.edsCompareImage, MSE.Data.Augmenter.Marketplace.EDSImage, MSE.Data.Factory.array)), rights: hydrated(convert("primary.Providers", MSE.Data.Factory.Marketplace.edsAlbumRightsIEBProviders, null)), cloudIcon: convert("primary.CollectionState", MSE.Data.Factory.toCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: convert("primary.CollectionState", MSE.Data.Factory.toCloudIconOpacity, "1.0"), cloudIconTooltip: convert("primary.CollectionState", MSE.Data.Factory.toCloudIconTooltip, String.empty), cloudIconAriaString: convert("CollectionState", MSE.Data.Factory.toCloudIconAriaString, String.empty), voicePhrase: convert("primary.Name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), EDSTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMediaItem, null, {
+ assetLocationId: convertNoDeflate("zuneId", MSE.Data.Factory.guid, String.empty), assetLocationIdType: MS.Entertainment.Data.AssetLocationIdType.zune, mainTitle: alias(["Name", "name"], String.empty), subTitle: alias("SubTitle", String.empty), _name: convertNoDeflate(String.empty, MSE.Data.Factory.Common.combineTitleAndSubTitle, String.empty), name: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), title: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), duration: hydrated(convert("Duration", MSE.Data.Factory.timeSpan, -1), MSE.Data.Comparer.inverseDateComparer), durationSeconds: convertNoDeflate("duration", MSE.Utilities.secondsFromTimeSpan, null), durationMilliseconds: convertNoDeflate("duration", MSE.Utilities.millisecondsFromTimeSpan, null), durationString: convertNoDeflate("duration", MSE.Utilities.millisecondsToTimeCode, String.empty), trackNumber: hydrated(convert("TrackNumber", MSE.Data.Factory.intNumber, -1)), _artist: augment("PrimaryArtist", MSE.Data.Augmenter.Marketplace.EDSArtist, null), artist: hydrated(convertNoDeflate([["impressionGuid", "_artist"]], MSE.Data.Factory.Marketplace.edsSetImpressionGuid)), artistServiceId: hydrated(convert("PrimaryArtist.ID", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), artistName: hydrated(convertOriginal("PrimaryArtist.Name", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), hasSmartDJ: hydrated(alias("PrimaryArtist.HasTrackMediaGuide", false)), hasMusicVideoMediaGuide: hydrated(convert("HasMusicVideoMediaGuide", MSE.Data.Factory.boolFromString, false)), musicVideoId: hydrated(convert("MusicVideoId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), _musicVideo: hydratedRequired(convertNoDeflate(String.empty, MSE.Data.Factory.convertTrackToMusicVideo, null)), musicVideo: hydratedRequired(convertNoDeflate([["_musicVideo", "impressionGuid", "acquisitionData"]], MSE.Data.Factory.Marketplace.edsSetImpressionGuidAndAcquisition)), _album: augment(String.empty, MSE.Data.Augmenter.Marketplace.EDSTrackAlbum, null), album: hydrated(convertNoDeflate([["impressionGuid", "_album"]], MSE.Data.Factory.Marketplace.edsSetImpressionGuid)), parent: convertNoDeflate("album", MSE.Data.Factory.self, null), albumName: hydrated(convertOriginal("ParentAlbum.Name", MSE.Data.Factory.normalizeTextDirection, String.empty)), _albumAndArtistName: convertNoDeflate(String.empty, MSE.Data.Factory.albumAndArtist, String.empty), albumAndArtistName: convertOriginalNoDeflate("_albumAndArtistName", MSE.Data.Factory.normalizeTextDirection, String.empty), albumServiceId: hydrated(convert("ParentAlbum.ID", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), genreName: hydrated(alias("Genres[0].Name", String.empty)), primaryGenre: hydrated(alias("Genres[0].Name", String.empty)), mediaType: Microsoft.Entertainment.Queries.ObjectType.track, isExplicit: hydrated(convert("IsExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), releaseDate: hydrated(convert("ReleaseDate", MSE.Data.Factory.date, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, String.empty)), eventProxy: convert(String.empty, MSE.Data.Factory.createEventProxy), label: hydrated(convertOriginal("Label", MSE.Data.Factory.normalizeTextDirection, String.empty)), hasPurchased: alias("HasPurchased", false), canPurchaseDownload: alias("CanPurchaseDownload", false), isFreeStreamRestrictedByIndividualLimit: alias("IsFreeStreamRestrictedByIndividualLimit", false), isFreeStreamRestrictedByMonthlyLimit: alias("IsFreeStreamRestrictedByMonthlyLimit", false), canPlayLocally: alias("CanPlayLocally", false), canFreeStream: containsRight(MSE.Data.Augmenter.Marketplace.RightType.stream), canSubscriptionStream: containsRight(MSE.Data.Augmenter.Marketplace.RightType.stream), canSubscriptionDownload: containsRight(MSE.Data.Augmenter.Marketplace.RightType.subscription), canPreview: containsRight(MSE.Data.Augmenter.Marketplace.RightType.preview), canPurchase: containsRight(MSE.Data.Augmenter.Marketplace.RightType.purchase), canPurchaseAlbum: containsRight(MSE.Data.Augmenter.Marketplace.RightType.albumPurchase), canDelete: {
+ get: function () {
+ return (this.libraryId >= 0)
+ }
+ }, voicePhrase: convert("Name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), isPremium: false, dateAdded: null, filePath: null, genreId: -1, userStarRating: -1, cloudIcon: convertNoDeflate("inCollection", MSE.Data.Factory.inCollectionToCloudIcon, MS.Entertainment.cloudIcons.NotInCloudNotLocal), cloudIconOpacity: "1.0", cloudIconTooltip: String.empty, hasAssetLocationId: {
+ get: function () {
+ return !!this.assetLocationId && !MS.Entertainment.Utilities.isEmptyGuid(this.assetLocationId)
+ }
+ }, hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.artistServiceId)
+ }
+ }, hasAlbumServiceId: {
+ get: function () {
+ return this.albumServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.albumServiceId)
+ }
+ }, hasMusicVideoId: {
+ get: function () {
+ return this.musicVideoId && !MS.Entertainment.Utilities.isEmptyGuid(this.musicVideoId)
+ }
+ }, hasNonMarketplaceImage: {
+ get: function () {
+ return !(this.hasServiceId || this.imageUri)
+ }
+ }, hasNonAlbumArtistName: {
+ get: function () {
+ return (!this.album || this.artistName !== this.album.artistName)
+ }
+ }, isParentallyBlocked: {
+ get: function () {
+ return MS.Entertainment.Data.Factory.isMediaParentallyBlocked(this)
+ }
+ }, onHydrated: MS.Entertainment.Hydrator.track, webPlaylistRemoveLabel: convertNoDeflate(String.empty, MSE.Data.Factory.createTrackAndArtistRemoveString, String.empty)
+ })
+ }), EDSGenrePivotValue: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ queryOptions: convertNoDeflate(String.empty, MSE.Data.Factory.Marketplace.edsCreateGenreQueryOptions, null), itemQueryOptions: convertNoDeflate(String.empty, MSE.Data.Factory.Marketplace.edsCreateGenreQueryOptions, null), itemQuery: {
+ get: function () {
+ return MS.Entertainment.Data.Query.Music.SubGenres
+ }
+ }, minItems: 2, trackQueryOptions: convertNoDeflate(String.empty, MSE.Data.Factory.Marketplace.edsCreateGenreTrackQueryOptions, null), isRoot: alias("isRoot", false), serviceId: alias("serviceId", null)
+ })
+ }), EDSSubGenrePivotValue: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ queryOptions: convertNoDeflate(String.empty, MSE.Data.Factory.Marketplace.edsCreateGenreQueryOptions, null), trackQueryOptions: convertNoDeflate(String.empty, MSE.Data.Factory.Marketplace.edsCreateGenreTrackQueryOptions, null), isRoot: alias("isRoot", false), serviceId: alias("serviceId", null), parent: alias("parent", null)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ CloudPlaylistTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSTrack, null, {
+ serviceId: convert("ContentId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), zuneId: convert("ContentId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), serviceIdType: MS.Entertainment.Data.Query.edsIdType.zuneCatalog, _name: alias("Metadata.Title", String.empty), duration: convert("Metadata.Length", MSE.Data.Factory.timeSpan, -1), artistName: alias("Metadata.Artists[0].Name", String.empty), rights: convert("LicenseRights", MSE.Data.Factory.createRightsFromString, [])
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ CloudPlaylist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.MediaItem, null, {
+ name: alias("Title", String.empty), tracks: list("PlaylistMedia", MSE.Data.Augmenter.Marketplace.CloudPlaylistTrack, null), items: convertNoDeflate("tracks", MSE.Data.Factory.self, null), serviceId: convert("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), zuneId: convert("ItemId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), serviceIdType: "ZuneCatalog", count: alias("NumberOfMedia"), albumImages: sortArray("AlbumImages", MSE.Data.Comparer.Marketplace.edsCompareImageRankOnly, MSE.Data.Augmenter.Marketplace.CloudImage, MSE.Data.Factory.array), mediaType: Microsoft.Entertainment.Queries.ObjectType.playlist
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ CloudImage: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSImage, null, { imageResizeUri: alias(["ResizeUrl", "Url"], null) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSRichTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSTrack, null, {
+ hasRights: {
+ get: function get_hasRights() {
+ var hasRights = false;
+ if (this.rights && this.rights.length)
+ for (var i = 0; i < this.rights.length; i++) {
+ hasRights = this.rights[i].isFullRight;
+ if (hasRights)
+ break
+ }
+ return hasRights
+ }
+ }
+ })
+ }), EDSRichGenre: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSGenre, null, {
+ isRoot: true, label: alias("Name", String.empty), id: alias("Name", String.empty), value: augmentNoDeflate(String.empty, MSE.Data.Augmenter.Marketplace.EDSGenrePivotValue), items: null, selected: false, expanded: false, tabPanelId: null, childIds: null, ariaLevel: 1
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSTopSongsAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSAlbum, null, {
+ serviceId: convertNoDeflate("artist.serviceId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID), serviceIdType: convertNoDeflate("artist.serviceIdType", MSE.Data.Factory.Marketplace.edsServiceIdType, null), zuneId: hydrated(convertNoDeflate("artist.zuneId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), canonicalId: hydrated(convertNoDeflate("artist.canonicalId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), name: format(null, String.id.IDS_DETAILS_TOP_SONGS, String.empty), secondaryText: hydrated(convertNoDeflate("artist.name", MSE.Data.Factory.self, String.empty)), _tracks: list("Items", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null), tracks: hydrated(convertNoDeflate("_tracks", MSE.Data.Factory.Marketplace.setListMaxCount, null)), groupKey: "topSongs", trackCount: 100, isTopSongs: true, releaseYear: String.empty, onHydrated: MS.Entertainment.Hydrator.topSongsAlbum
+ })
+ }), EDSMusicVideoBase: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMediaItem, null, {
+ albumAndArtistName: convertOriginalNoDeflate("artistName", MSE.Data.Factory.normalizeTextDirection, String.empty), _artist: augment("PrimaryArtist", MSE.Data.Augmenter.Marketplace.EDSArtist, null), artist: hydrated(convertNoDeflate([["impressionGuid", "_artist"]], MSE.Data.Factory.Marketplace.edsSetImpressionGuid)), artistServiceId: hydrated(convert("PrimaryArtist.ID", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), artistName: hydrated(convertOriginal("PrimaryArtist.Name", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), canonicalId: hydrated(convert(["ID", "id"], MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), closedCaptionFiles: hydrated(convert("Providers", MSE.Data.Factory.Marketplace.edsClosedCaptionFiles, null)), duration: hydrated(convert("Duration", MSE.Data.Factory.timeSpan, -1), MSE.Data.Comparer.inverseDateComparer), durationMilliseconds: convertNoDeflate("duration", MSE.Utilities.millisecondsFromTimeSpan, null), durationSeconds: convertNoDeflate("duration", MSE.Utilities.secondsFromTimeSpan, null), durationString: convertNoDeflate("duration", MSE.Utilities.millisecondsToTimeCode, String.empty), genreName: hydrated(alias("Genres[0].Name", String.empty)), hasCaptions: hydrated(convertNoDeflate("closedCaptionFiles.length", MSE.Data.Factory.bool, false, convertFeatureOptionsClosedCaptions)), hasSmartDJ: hydrated(alias("PrimaryArtist.HasTrackMediaGuide", false)), images: sortArray("Images", MSE.Data.Comparer.Marketplace.edsCompareImageRankOnly, MSE.Data.Augmenter.Marketplace.EDSImage, MSE.Data.Factory.array), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), isExplicit: hydrated(convert("IsExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), label: hydrated(convertOriginal("Label", MSE.Data.Factory.normalizeTextDirection, String.empty)), mediaType: Microsoft.Entertainment.Queries.ObjectType.video, primaryGenre: hydrated(alias("Genres[0].Name", String.empty)), primaryImage: searchNoDeflate("images", MSE.Data.Filter.Marketplace.edsFilterNonCoversNonThumbnailsWideOrTall, null), releaseDate: hydrated(convert("ReleaseDate", MSE.Data.Factory.date, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, String.empty)), trackId: hydrated(convert("TrackId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), videoType: Microsoft.Entertainment.Queries.VideoType.musicVideo, voiceConfidence: value(defaultVoiceConfidence), voicePhrase: hydrated(convert("Name", MSE.Data.Factory.normalizeStringForVoice, String.empty)), hasTrackId: {
+ get: function () {
+ return this.trackId && !MS.Entertainment.Utilities.isEmptyGuid(this.trackId)
+ }
+ }, hasArtistServiceId: {
+ get: function () {
+ return this.artistServiceId && !MS.Entertainment.Utilities.isEmptyGuid(this.artistServiceId)
+ }
+ }, onHydrated: MS.Entertainment.Hydrator.musicVideo
+ })
+ }), EDSMusicVideo: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMusicVideoBase, null, {
+ _track: convertNoDeflate(String.empty, MSE.Data.Factory.convertMusicVideoToTrack, null), track: hydrated(convertNoDeflate([["impressionGuid", "_track"]], MSE.Data.Factory.Marketplace.edsSetImpressionGuid))
+ })
+ }), EDSSubRichGenre: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSRichGenre, null, {
+ isRoot: false, value: augmentNoDeflate(String.empty, MSE.Data.Augmenter.Marketplace.EDSSubGenrePivotValue), items: undefined, expanded: undefined, ariaLevel: 2
+ })
+ }), EDSEditorialTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSTrack, null, {
+ serviceType: null, serviceId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), serviceIdType: hydrated(convert(String.empty, MSE.Data.Factory.Marketplace.edsServiceIdTypeLegacy, null)), serviceImageType: MS.Entertainment.Data.ImageIdType.editorialTrack, canonicalId: hydrated(convert("canonicalId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), name: hydrated(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), MSE.Data.Comparer.notFalsy), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), artist: hydrated(augment("primaryArtist", MS.Entertainment.Data.Augmenter.Marketplace.Artist, null)), zuneId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), type: alias("link.type", String.empty), target: alias("link.target", String.empty), id: alias("id", String.empty), editorialTitle: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryText: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), text: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), backgroundImageId: alias("backgroundImage.id", String.empty), voicePhrase: convert("title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), EDSEditorialArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSArtist, null, {
+ serviceType: null, serviceId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), serviceIdType: hydrated(convert(String.empty, MSE.Data.Factory.Marketplace.edsServiceIdTypeLegacy, null)), canonicalId: hydrated(convert("canonicalId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), serviceImageType: MS.Entertainment.Data.ImageIdType.editorialArtist, name: hydrated(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: hydrated(convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty)), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), zuneId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), type: alias("link.type", String.empty), target: alias("link.target", String.empty), id: alias("id", String.empty), editorialTitle: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryText: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), text: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), backgroundImageId: alias("backgroundImage.id", String.empty), voicePhrase: convert("title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence)
+ })
+ }), EDSEditorialAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSAlbum, null, {
+ serviceType: null, serviceId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), serviceIdType: hydrated(convert(String.empty, MSE.Data.Factory.Marketplace.edsServiceIdTypeLegacy, null)), serviceImageType: MS.Entertainment.Data.ImageIdType.editorialAlbum, canonicalId: hydrated(convert("canonicalId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), imageId: convert("image.id", MSE.Data.Factory.guid, String.empty), artist: hydrated(augment("primaryArtist", MS.Entertainment.Data.Augmenter.Marketplace.Artist, null)), zuneId: hydrated(convert("link.target", MSE.Data.Factory.guid, String.empty)), type: alias("link.type", String.empty), target: alias("link.target", String.empty), id: alias("id", String.empty), editorialTitle: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryText: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), secondaryText: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), text: convertOriginal("text", MSE.Data.Factory.normalizeTextDirection, String.empty), backgroundImageId: alias("backgroundImage.id", String.empty), voicePhrase: convert("text", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), name: hydrated(value(String.empty))
+ })
+ }), EDSEditorialAlbumEntry: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSAlbum, null, {
+ _name: alias(["title.$value", "title"], String.empty), name: hydrated(convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty)), serviceId: hydrated(convert("id", MSE.Data.Factory.guid, String.empty)), serviceIdType: hydrated(convert(String.empty, MSE.Data.Factory.Marketplace.edsServiceIdTypeLegacy, null)), serviceImageType: MS.Entertainment.Data.ImageIdType.editorialAlbum, artistName: hydrated(convertOriginal("primaryArtist.name", MSE.Data.Factory.normalizeTextDirection, String.empty)), label: hydrated(convertOriginal("label", MSE.Data.Factory.normalizeTextDirection, String.empty)), artist: hydrated(augment("primaryArtist", MS.Entertainment.Data.Augmenter.Marketplace.Artist, null)), artistServiceId: hydrated(convert("primaryArtist.id", MSE.Data.Factory.guid, String.empty)), primaryGenre: hydrated(augment("primaryGenre", MSE.Data.Augmenter.Marketplace.Genre, null)), primaryGenreName: hydrated(alias("primaryGenre.title", String.empty)), playCount: convert("playCount", MSE.Data.Factory.intNumber, -1), playRank: convert("playRank", MSE.Data.Factory.intNumber, -1), isExplicit: hydrated(convert("isExplicit", MSE.Data.Factory.boolFromString, false)), explicitAriaString: convertNoDeflate("isExplicit", MSE.Data.Factory.toExplicitAriaString, String.empty), rights: hydrated(augment("rights.right", MSE.Data.Augmenter.Marketplace.Right, MSE.Data.Factory.array)), releaseDate: hydrated(convert("releaseDate", MSE.Data.Factory.date, null)), releaseYear: hydrated(convertNoDeflate("releaseDate", MSE.Data.Factory.localizedYear, null)), voicePhrase: convertNoDeflate("_name", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), canonicalId: hydrated(convert("canonicalId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), zuneId: hydrated(convert("id", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), catalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.EDS, sourceId: MS.Entertainment.Utilities.Telemetry.ContentSourceId.Compass
+ })
+ }), MediaDiscoveryAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSAlbum, null, {
+ artist: convertNoDeflate(String.empty, MSE.Data.Factory.createArtistFromMediaDiscoveryAlbum, null), artistName: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), canonicalId: hydrated(convert("BingId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), editorialTitle: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), id: alias("BingId", String.empty), imageUri: alias("ImageUrl", String.empty), imagePrimaryUrl: alias("ImageUrl", String.empty), imageResizeUri: alias("ImageUrl", String.empty), name: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryArtistId: convert("PrimaryArtistId", MSE.Data.Factory.guid, String.empty), primaryText: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), serviceId: convert("BingId", MSE.Data.Factory.guid, String.empty), serviceIdType: MS.Entertainment.Data.Query.edsIdType.canonical, serviceType: null, type: MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Album, voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), zuneId: convert("ItemId", MSE.Data.Factory.guid, String.empty)
+ })
+ }), MediaDiscoveryMusicVideo: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null, {
+ artist: convertNoDeflate(String.empty, MSE.Data.Factory.createArtistFromMediaDiscoveryAlbum, null), artistName: convertOriginal("Text", MSE.Data.Factory.normalizeTextDirection, String.empty), canonicalId: hydrated(convert("BingId", MSE.Data.Factory.guid, MS.Entertainment.Utilities.EMPTY_GUID)), editorialTitle: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), id: alias("BingId", String.empty), imageUri: alias("ImageUrl", String.empty), imagePrimaryUrl: alias("ImageUrl", String.empty), name: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), primaryArtistId: convert("PrimaryArtistId", MSE.Data.Factory.guid, String.empty), primaryText: convertOriginal("Title", MSE.Data.Factory.normalizeTextDirection, String.empty), serviceId: convert("BingId", MSE.Data.Factory.guid, String.empty), serviceIdType: MS.Entertainment.Data.Query.edsIdType.canonical, serviceType: null, type: MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Album, voicePhrase: convert("Title", MSE.Data.Factory.normalizeStringForVoice, String.empty), voiceConfidence: value(defaultVoiceConfidence), zuneId: convert("ItemId", MSE.Data.Factory.guid, String.empty)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSArtistDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.mixNoDeflate({ item: MSE.Data.Augmenter.Marketplace.EDSArtist })
+ }), EDSAlbumDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.mixNoDeflate({ item: MSE.Data.Augmenter.Marketplace.EDSAlbum })
+ }), EDSTrackDetailsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.mixNoDeflate({ item: MSE.Data.Augmenter.Marketplace.EDSRichTrack })
+ }), EDSArtistDetailResultItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, { item: augment("Items[0]", MSE.Data.Augmenter.Marketplace.EDSArtist, null) })
+ }), EDSArtistImagesResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: filterArray("Items[0].Images", MSE.Data.Filter.Marketplace.edsFilterNonNowPlayingBackgrounds, MSE.Data.Augmenter.Marketplace.EDSImage, null), itemsArray: filterArray("Items[0].Images", MSE.Data.Filter.Marketplace.edsFilterNonNowPlayingBackgrounds, MSE.Data.Augmenter.Marketplace.EDSImage, null)
+ })
+ }), EDSAlbumDetailsResultItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, { item: augment("Items[0]", MSE.Data.Augmenter.Marketplace.EDSAlbum, null) })
+ }), EDSAlbumReviewResultItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, { item: augment("Items[0]", MSE.Data.Augmenter.Marketplace.EDSAlbumReview, null) })
+ }), EDSTopSongsAlbumDetailsResultItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, { item: augment(String.empty, MSE.Data.Augmenter.Marketplace.EDSTopSongsAlbum, null) })
+ }), EDSTrackDetailsResultItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, {
+ item: augment("Items[0]", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null), data: convertNoDeflate("item", MSE.Data.Factory.self, null)
+ })
+ }), EDSMusicVideoDetailsResultItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, { item: augment("Items[0]", MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null) })
+ }), EDSArtistsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: list("Items", MSE.Data.Augmenter.Marketplace.EDSArtist, null), itemsArray: augment("Items", MSE.Data.Augmenter.Marketplace.EDSArtist, null), total: alias(["Totals[0].Count", "Items.length"], -1), totalCount: alias(["Totals[0].Count", "Items.length"], -1)
+ })
+ }), EDSAlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: list("Items", MSE.Data.Augmenter.Marketplace.EDSAlbum, null), itemsArray: augment("Items", MSE.Data.Augmenter.Marketplace.EDSAlbum, null)
+ })
+ }), EDSTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: list("Items", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null), itemsArray: augment("Items", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null)
+ })
+ }), LimitedEDSTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSTracksResult, null, {
+ _items: list("Items", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null), items: convertNoDeflate("_items", MSE.Data.Factory.Marketplace.setListMaxCount, null)
+ })
+ }), EDSMusicVideosResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: list("Items", MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null), itemsArray: augment("Items", MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null)
+ })
+ }), LimitedEDSMusicVideosResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSMusicVideosResult, null, {
+ _items: list("Items", MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null), items: convertNoDeflate("_items", MSE.Data.Factory.Marketplace.setListMaxCount, null)
+ })
+ }), EDSArtistTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ _items: list("Items", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null), items: convertNoDeflate("_items", MSE.Data.Factory.Marketplace.setListMaxCount, null)
+ })
+ }), EDSArtistMusicVideosResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: list("Items", MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null), itemsArray: augment("Items", MSE.Data.Augmenter.Marketplace.EDSMusicVideo, null)
+ })
+ }), EDSGenresResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: list("MediaQueryRefiners[0].Refiners", MSE.Data.Augmenter.Marketplace.EDSRichGenre, null), total: alias("MediaQueryRefiners[0].Refiners.length", 0)
+ })
+ }), EDSAlbumTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ tracks: list("Items", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null), items: convertNoDeflate("tracks", MSE.Data.Factory.self, null)
+ })
+ }), EDSAlbumMusicVideosResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ _tracks: augment("Items", MSE.Data.Augmenter.Marketplace.EDSRichTrack, null), itemsArray: filterArrayNoDeflate("_tracks", MSE.Data.Filter.Marketplace.filterTracksWithoutMusicVideos, MSE.Data.Factory.convertTrackToMusicVideo, null), items: filterNoDeflate("_tracks", MSE.Data.Filter.Marketplace.filterTracksWithoutMusicVideos, MSE.Data.Factory.convertTrackToMusicVideo, null)
+ })
+ }), EDSAlbumTracksOnAlbumResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { tracks: hydrated(convertOriginalNoDeflate("tracks", MSE.Data.Factory.self, null)) })
+ }), EDSSmartDJTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, { items: filter("Items", MSE.Data.Filter.Marketplace.filterSmartDJTracks, MSE.Data.Augmenter.Marketplace.EDSRichTrack, null) })
+ }), EDSSmartDJResults: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ items: list("ListItems", MSE.Data.Augmenter.Marketplace.EDSSmartDJResult, null), itemsArray: augment("ListItems", MSE.Data.Augmenter.Marketplace.EDSSmartDJResult, null), responseInfo: alias("ResponseInfo", null), responseStatus: alias("ResponseStatus", null), listVersion: alias("ListMetadata.ListVersion", 0), totalCount: alias("ListMetadata.ListCount", -1)
+ })
+ }), EDSRecentListResults: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ itemsArray: augment("ListItems", MS.Entertainment.Data.Factory.Common.createMediaItemFromRecentItem), responseInfo: alias("ResponseInfo", null), responseStatus: alias("ResponseStatus", null), listVersion: alias("ListMetadata.ListVersion", 0), totalCount: alias("ListMetadata.ListCount", -1)
+ })
+ }), EDSFeaturedGenreAlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ count: alias(["feed.entry[1].albums.album.length", "feed.entry.length"]), items: filter(["feed.entry[1].albums.album", "feed.entry"], MSE.Data.Filter.Marketplace.filterUnsupportedAlbums, MSE.Data.Augmenter.Marketplace.EDSEditorialAlbumEntry), itemsArray: filterArray(["feed.entry[1].albums.album", "feed.entry"], MSE.Data.Filter.Marketplace.filterUnsupportedAlbums, MSE.Data.Augmenter.Marketplace.EDSEditorialAlbumEntry)
+ })
+ }), EDSRelatedResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, {
+ items: list("Items[0].RelatedMedia", MSE.Data.Augmenter.Marketplace.EDSArtist, null), itemsArray: augment("Items[0].RelatedMedia", MSE.Data.Augmenter.Marketplace.EDSArtist, null), totalCount: alias("Items[0].RelatedMedia.length", -1), total: alias("Items[0].RelatedMedia.length", -1)
+ })
+ }), EDSMusicSearchResult: MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, {
+ items: list("Items", MS.Entertainment.Data.Factory.Marketplace.edsCrossMediaToMusicFactory, null), total: alias("Totals[0].Count", 0)
+ }), EDSSubscriptionDetailResultItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSDetailsResult, null, { itemsArray: augment("Items[0].Availabilities", MSE.Data.Augmenter.Marketplace.EDSSubscription, null) })
+ }), MediaDiscoveryAlbumsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ items: list("Items", MSE.Data.Augmenter.Marketplace.MediaDiscoveryAlbum, null), itemsArray: augment("Items", MSE.Data.Augmenter.Marketplace.MediaDiscoveryAlbum, null)
+ })
+ }), MediaDiscoveryMusicVideosResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ items: list("Items", MSE.Data.Augmenter.Marketplace.MediaDiscoveryMusicVideo, null), itemsArray: augment("Items", MSE.Data.Augmenter.Marketplace.MediaDiscoveryMusicVideo, null)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSSubGenresResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSGenresResult, null, { items: list("MediaQueryRefiners[0].Refiners", MSE.Data.Augmenter.Marketplace.EDSSubRichGenre, null) })
+ }), EDSAlbumWithTracks: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.BrowseDetailQuery.mixAugmentation(MSE.Data.Augmenter.Marketplace.EDSAlbumTracksOnAlbumResult, MSE.Data.Augmenter.Marketplace.EDSAlbumDetailsResult)
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace", {
+ EDSAlbumWithTracksResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Marketplace.EDSBrowseResult, null, { item: augment(String.empty, MSE.Data.Augmenter.Marketplace.EDSAlbumWithTracks, null) })
+ }), EDSMergedCollectionMarketplaceResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ marketplaceItems: augment("source[0].Items", MSE.Data.Augmenter.Marketplace.EDSMediaItem, null), collectionItems: augment("source[1].ResultSet", MSE.Data.Augmenter.Library.MediaItem, null), total: alias("source[0].Totals[0].Count", 0)
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.Marketplace.Music", {
+ Artist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSArtist
+ }), EditorialAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSEditorialAlbum
+ }), EditorialArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSEditorialArtist
+ }), EditorialMusicVideo: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.MediaDiscoveryMusicVideo
+ }), EditorialTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSEditorialTrack
+ }), MergedCollectionMarketplaceResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSMergedCollectionMarketplaceResult
+ }), MergedAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSMergedAlbum
+ }), SearchAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSAlbum
+ }), SearchArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSArtist
+ }), SearchTrack: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Marketplace.EDSTrack
+ }), SpotlightArtist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Spotlight.SpotlightArtist
+ }), SpotlightAlbum: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Spotlight.SpotlightAlbum
+ }), SpotlightPlaylist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MS.Entertainment.Data.Augmenter.Spotlight.SpotlightPlaylist
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.FileActivation", {
+ Track: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Track, null, {
+ _albumName: convert("musicProps.album", MSE.Data.Factory.stringOrEmpty, String.empty), albumName: hydrated(convertOriginalNoDeflate("_albumName", MSE.Data.Factory.normalizeTextDirection, String.empty)), _artistName: convert("musicProps.artist", MSE.Data.Factory.stringOrEmpty, String.empty), artistName: hydrated(convertOriginalNoDeflate("_artistName", MSE.Data.Factory.normalizeTextDirection, String.empty)), duration: hydrated(convert("musicProps.duration", MSE.Data.Factory.intNumber, -1), MSE.Data.Comparer.inverseDefaultComparer), imageUri: hydrated(convert("thumbnail", MSE.Data.Factory.oneTimeUseBlob, null)), mediaType: Microsoft.Entertainment.Queries.ObjectType.track, _title: convert("musicProps.title", MSE.Data.Factory.stringOrEmpty, String.empty), name: hydrated(convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty), mainTitle: convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty), trackNumber: convert("musicProps.trackNumber", MSE.Data.Factory.intNumber, -1), activationFilePath: convert("fileItem.path", MSE.Data.Factory.string, String.empty), folderRelativeId: convert("fileItem.folderRelativeId", MSE.Data.Factory.string, String.empty), genreName: hydrated(value(String.empty)), fileItem: alias("fileItem", null), filePath: alias("FilePath", null), musicProps: alias("musicProps", null), onHydrated: MS.Entertainment.Hydrator.track
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.PlayTo", {
+ Track: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.Library.Track, null, {
+ _albumName: convert("musicProps.album", MSE.Data.Factory.stringOrEmpty, String.empty), albumName: hydrated(convertOriginalNoDeflate("_albumName", MSE.Data.Factory.normalizeTextDirection, String.empty)), _artistName: convert("musicProps.artist", MSE.Data.Factory.stringOrEmpty, String.empty), artistName: hydrated(convertOriginalNoDeflate("_artistName", MSE.Data.Factory.normalizeTextDirection, String.empty)), duration: hydrated(convert("musicProps.duration", MSE.Data.Factory.intNumber, -1), MSE.Data.Comparer.inverseDefaultComparer), mediaType: Microsoft.Entertainment.Queries.ObjectType.track, _title: convert("musicProps.title", MSE.Data.Factory.stringOrEmpty, String.empty), name: hydrated(convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty)), title: convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty), mainTitle: convertOriginalNoDeflate("_title", MSE.Data.Factory.normalizeTextDirection, String.empty), trackNumber: convert("musicProps.trackNumber", MSE.Data.Factory.intNumber, -1), activationFilePath: alias("FilePath", null), genreName: hydrated(value(String.empty)), onHydrated: MS.Entertainment.Hydrator.track
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.EchoNest", {
+ MediaItem: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.MediaItem, null, {
+ echoNestId: convert("id", MSE.Data.Factory.self, String.empty), _name: convert("name", MSE.Data.Factory.self, String.empty), name: convertOriginalNoDeflate("_name", MSE.Data.Factory.normalizeTextDirection, String.empty), familiarity: convert("familiarity", MSE.Data.Factory.floatNumber, 0.0), sortName: alias("name", String.empty)
+ })
+ }), Artist: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.EchoNest.MediaItem, null, {
+ mediaType: Microsoft.Entertainment.Queries.ObjectType.person, personType: Microsoft.Entertainment.Queries.PersonType.artist
+ })
+ }), ArtistsResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, { items: list("response.artists", MSE.Data.Augmenter.EchoNest.Artist, null) })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data.Augmenter.WebPlaylist", {
+ WebSite: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.derive(MSE.Data.Augmenter.MediaItem, null, {
+ name: convertOriginal("title", MSE.Data.Factory.normalizeTextDirection, String.empty), description: convertOriginal("description", MSE.Data.Factory.normalizeTextDirection, String.empty), url: alias("url", String.empty)
+ })
+ }), WebSitesResult: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.Data.define(null, {
+ items: list("sites", MSE.Data.Augmenter.WebPlaylist.WebSite, null), itemsArray: augment("sites", MSE.Data.Augmenter.WebPlaylist.WebSite, null)
+ })
+ })
+ })
+ })(MS.Entertainment)
+})();
+/* >>>>>>/framework/data/queries/libraryqueries.js:35885 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ var MSE = WinJS.Namespace.define("MS.Entertainment", null);
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ LibraryQueryBase: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.LibraryWrapperQuery, null, {
+ groupsAugmentation: MSE.Data.Augmenter.Library.GroupsAugmentation, getItemIndexAsync: function getItemIndexAsync(libraryId) {
+ var getItemIndexPromise;
+ if (this._innerQuery && this._innerQuery.getItemIndexAsync)
+ getItemIndexPromise = this._innerQuery.getItemIndexAsync(libraryId);
+ return WinJS.Promise.as(getItemIndexPromise)
+ }, executeCount: function executeCount() {
+ var innerQuery = this.createInnerQuery();
+ return innerQuery.getCountAsync()
+ }
+ }, {
+ isLibraryQuery: function LibraryQuery_isLibraryQuery(object) {
+ return MS.Entertainment.Data.Query.LibraryQueryBase.prototype.isPrototypeOf(object)
+ }
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryGenres: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ mediaType: Microsoft.Entertainment.Queries.GenresQueryMediaType.undefined, videoType: -1, sort: Microsoft.Entertainment.Queries.GenresSortBy.none, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.GenresQuery;
+ query.mediaType = this.mediaType;
+ if (this.videoType !== -1)
+ query.videoType = this.videoType;
+ query.primarySortBy = this.sort;
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.GenresResult, aggregateChunks: true
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryVideoMusic: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ category: Microsoft.Entertainment.Queries.VideoType.musicVideo, sort: Microsoft.Entertainment.Queries.VideosSortBy.none, playlistId: -1, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.VideosQuery;
+ if (this.playlistId !== -1)
+ query.playlistId = this.playlistId;
+ else {
+ if (this.category !== -1)
+ query.category = this.category;
+ query.primarySortBy = this.sort
+ }
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.MusicVideosResult, aggregateChunks: true
+ })
+ }), libraryAlbumGenres: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.libraryGenres, null, { mediaType: Microsoft.Entertainment.Queries.GenresQueryMediaType.album })
+ }), libraryTrackGenres: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.libraryGenres, null, { mediaType: Microsoft.Entertainment.Queries.GenresQueryMediaType.track })
+ }), libraryMusicVideoGenres: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.libraryGenres, null, {
+ mediaType: Microsoft.Entertainment.Queries.GenresQueryMediaType.video, videoType: Microsoft.Entertainment.Queries.VideoType.musicVideo
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryTracks: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ albumId: -1, artistId: -1, trackId: -1, maxAlbumsCount: -1, sort: Microsoft.Entertainment.Queries.TracksSortBy.none, keyword: null, autoUpdateProperties: null, mediaAvailability: null, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.TracksQuery;
+ var id = parseInt(this.albumId);
+ if (id !== -1)
+ query.albumId = id;
+ id = parseInt(this.artistId);
+ if (id !== -1)
+ query.artistId = id;
+ id = parseInt(this.trackId);
+ if (id !== -1)
+ query.trackId = id;
+ var maxAlbumsCount = parseInt(this.maxAlbumsCount);
+ if (maxAlbumsCount !== -1)
+ query.maxAlbumsCount = maxAlbumsCount;
+ query.primarySortBy = this.sort;
+ if (this.mediaAvailability && this.mediaAvailability !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ query.mediaAvailability = this.mediaAvailability;
+ if (this.keyword)
+ if (!Array.isArray(this.keyword))
+ query.keyword = [this.keyword];
+ else
+ query.keyword = this.keyword;
+ if (this.trackUrl)
+ query.trackUrl = this.trackUrl;
+ switch (this.sort) {
+ case Microsoft.Entertainment.Queries.TracksSortBy.dateAddedAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.dateAddedDescending:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.TracksByYearOrMonthGroupHintsResult;
+ break;
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumArtistAscendingAlbumReleaseYearAscendingNumberAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumArtistAscendingAlbumReleaseYearDescendingNumberAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumArtistAscendingReleaseYearDescending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumArtistDescendingReleaseYearDescending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumDateAddedAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumDateAddedDescending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumGenreNameTitleAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumGenreNameTitleDescending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumReleaseYearAscendingNumberAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumReleaseYearAscendingTitleAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumReleaseYearDescendingNumberAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumReleaseYearDescendingTitleAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumTitleAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumTitleDescending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumTitleDiscNumberNumberAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.albumTitleDiscNumberNumberDescending:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.TracksByAlbumGroupHintsResult;
+ break;
+ case Microsoft.Entertainment.Queries.TracksSortBy.artistAscendingAlbumReleaseYearAscendingNumberAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.artistAscendingAlbumReleaseYearDescendingNumberAscending:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.TracksByArtistGroupHintsResult;
+ break;
+ case Microsoft.Entertainment.Queries.TracksSortBy.genreAscendingTitleAscending:
+ case Microsoft.Entertainment.Queries.TracksSortBy.genreDescendingTitleDescending:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.TracksByGenreGroupHintsResult;
+ break;
+ default:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.TracksGroupHintsResult;
+ break
+ }
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.TracksResult, groupsAugmentation: MSE.Data.Augmenter.Library.TracksGroupHintsResult, aggregateChunks: true
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryArtists: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ artistOf: Microsoft.Entertainment.Queries.ArtistOf.undefined, keyword: null, sort: Microsoft.Entertainment.Queries.PeopleSortBy.none, personId: -1, playlistId: -1, autoUpdateProperties: null, mediaAvailability: null, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.PeopleQuery;
+ query.artistOf = this.artistOf;
+ query.primarySortBy = this.sort;
+ if (this.mediaAvailability && this.mediaAvailability !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ query.mediaAvailability = this.mediaAvailability;
+ if (this.keyword)
+ if (!Array.isArray(this.keyword))
+ query.keyword = [this.keyword];
+ else
+ query.keyword = this.keyword;
+ if (this.personId !== -1)
+ query.personId = this.personId;
+ else if (this.playlistId !== -1)
+ query.playlistId = this.playlistId;
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.ArtistsResult, groupsAugmentation: MSE.Data.Augmenter.Library.ArtistsGroupHintsResult, aggregateChunks: true
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryAlbumArtists: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.libraryArtists, null, { artistOf: Microsoft.Entertainment.Queries.ArtistOf.album })
+ }), libraryAlbums: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ genreId: -1, albumId: -1, artistId: -1, playlistId: -1, sort: Microsoft.Entertainment.Queries.AlbumsSortBy.none, keyword: null, autoUpdateProperties: null, mediaAvailability: null, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.AlbumsQuery;
+ var id = parseInt(this.genreId);
+ if (id !== -1)
+ query.genreId = this.genreId;
+ id = parseInt(this.albumId);
+ if (id !== -1)
+ query.albumId = this.albumId;
+ id = parseInt(this.artistId);
+ if (id !== -1)
+ query.artistId = this.artistId;
+ id = parseInt(this.playlistId);
+ if (id !== -1)
+ query.playlistId = this.playlistId;
+ query.primarySortBy = this.sort;
+ if (this.mediaAvailability && this.mediaAvailability !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ query.mediaAvailability = this.mediaAvailability;
+ if (this.keyword)
+ if (!Array.isArray(this.keyword))
+ query.keyword = [this.keyword];
+ else
+ query.keyword = this.keyword;
+ switch (this.sort) {
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.releaseYearAscendingTitleAscending:
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.releaseYearDescendingTitleAscending:
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.dateAddedAscending:
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.dateAddedDescending:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.AlbumsByYearOrMonthGroupHintsResult;
+ break;
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.artistAscending:
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.artistDescending:
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.artistAscendingReleaseYearDescending:
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.artistDescendingReleaseYearDescending:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.AlbumsByArtistGroupHintsResult;
+ break;
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.genreNameTitleAscending:
+ case Microsoft.Entertainment.Queries.AlbumsSortBy.genreNameTitleDescending:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.AlbumsByGenreGroupHintsResult;
+ break;
+ default:
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.AlbumsGroupHintsResult;
+ break
+ }
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.AlbumsResult, groupsAugmentation: MSE.Data.Augmenter.Library.AlbumsGroupHintsResult, aggregateChunks: true
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryAlbumsLimited: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.libraryAlbums, null, { resultAugmentation: MSE.Data.Augmenter.Library.AlbumsLimitedResult })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryPlaylists: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ playlistType: Microsoft.Entertainment.Platform.PlaylistType.static, sort: Microsoft.Entertainment.Queries.PlaylistsSortBy.none, keyword: null, playlistId: -1, autoUpdateProperties: null, mediaAvailability: null, title: null, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.PlaylistsQuery;
+ if (this.playlistType)
+ query.playlistType = this.playlistType;
+ var id = parseInt(this.playlistId);
+ if (id !== -1)
+ query.playlistId = this.playlistId;
+ var cloudSyncItemId = this.cloudSyncItemId;
+ if (MS.Entertainment.Utilities.isValidServiceId(cloudSyncItemId))
+ query.cloudSyncItemId = this.cloudSyncItemId;
+ if (this.sort && this.sort !== Microsoft.Entertainment.Queries.PlaylistsSortBy.none)
+ query.primarySortBy = this.sort;
+ if (this.mediaAvailability && this.mediaAvailability !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ query.mediaAvailability = this.mediaAvailability;
+ if (this.keyword)
+ query.keyword = this.keyword;
+ if (this.title)
+ query.title = this.title;
+ if (this.sort === Microsoft.Entertainment.Queries.PlaylistsSortBy.dateEditedAscending || this.sort === Microsoft.Entertainment.Queries.PlaylistsSortBy.dateEditedDescending || this.sort === Microsoft.Entertainment.Queries.PlaylistsSortBy.dateAddedAscending || this.sort === Microsoft.Entertainment.Queries.PlaylistsSortBy.dateAddedDescending)
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.PlaylistsByYearOrMonthGroupHintsResult;
+ else
+ this.groupsAugmentation = MSE.Data.Augmenter.Library.PlaylistsGroupHintsResult;
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.PlaylistsResult, groupsAugmentation: MSE.Data.Augmenter.Library.PlaylistsGroupHintsResult, aggregateChunks: true
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ libraryPlaylistMediaItems: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ playlistId: -1, sort: Microsoft.Entertainment.Queries.PlaylistItemsSortBy.ordinalAscending, mediaAvailability: null, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.PlaylistMediaItemsQuery;
+ var id = parseInt(this.playlistId);
+ if (id !== -1)
+ query.playlistId = id;
+ if (this.mediaAvailability && this.mediaAvailability !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ query.mediaAvailability = this.mediaAvailability;
+ if (this.sort)
+ query.primarySortBy = this.sort;
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.TracksResult, aggregateChunks: true
+ })
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Query", {
+ LibraryTrackFiles: MS.Entertainment.UI.Framework.lazyDefine(function () {
+ return MSE.derive(MSE.Data.Query.LibraryQueryBase, null, {
+ trackId: -1, createInnerQuery: function createInnerQuery() {
+ var query = new Microsoft.Entertainment.Queries.FilesQuery;
+ var id = parseInt(this.trackId);
+ if (id !== -1)
+ query.trackId = id;
+ return query
+ }, resultAugmentation: MSE.Data.Augmenter.Library.FilesResult, aggregateChunks: true
+ })
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/data/observablearrayvirtuallistadapter.js:36142 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var Data;
+ (function (Data) {
+ var ObservableArrayVirtualListAdapter = (function (_super) {
+ __extends(ObservableArrayVirtualListAdapter, _super);
+ function ObservableArrayVirtualListAdapter() {
+ _super.call(this);
+ this._virtualList = null;
+ this._disposed = false;
+ this._initialized = false;
+ this._itemFactory = null;
+ this._inNotificationBatch = false;
+ this.maxItems = Number.MAX_VALUE;
+ this.pagingDelayMS = 250;
+ this.pageInDataOnItemRemoved = false
+ }
+ ObservableArrayVirtualListAdapter.prototype.dispose = function () {
+ if (!this._disposed) {
+ this._clear();
+ this._disposed = true
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype.initialize = function (virtualList, itemFactory) {
+ MS.Entertainment.assert(virtualList, "virtualList argument expected");
+ MS.Entertainment.assert(itemFactory, "itemFactory argument expected");
+ MS.Entertainment.assert(!this._initialized, "initialize should only be called once!");
+ this._initialized = true;
+ this._itemFactory = itemFactory;
+ this._clear();
+ this._virtualList = virtualList;
+ return this._pageInVirtualListData()
+ };
+ ObservableArrayVirtualListAdapter.prototype._pageInVirtualListData = function () {
+ var _this = this;
+ var itemsPromise = WinJS.Promise.as();
+ if (this._virtualList && !this._disposed)
+ itemsPromise = this._virtualList.itemsFromIndex(this.length).then(function (result) {
+ if (_this._disposed)
+ return;
+ if (result && result.items && _this._virtualList && !_this._disposed) {
+ if (!_this.length)
+ _this._virtualList.setNotificationHandler({
+ beginNotifications: _this._beginNotifications.bind(_this), endNotifications: _this._endNotifications.bind(_this), invalidateAll: _this._invalidateAll.bind(_this), inserted: _this._inserted.bind(_this), removed: _this._removed.bind(_this), changed: _this._changed.bind(_this), moved: _this._moved.bind(_this)
+ });
+ var maxLength = Math.min(result.items.length, _this.maxItems);
+ for (var i = result.offset; (i < maxLength) && (_this.length < _this.maxItems); i++)
+ _this.push(_this._itemFactory(result.items[i].data));
+ if (result.totalCount > _this.length && _this.length < _this.maxItems)
+ WinJS.Promise.timeout(_this.pagingDelayMS).done(function () {
+ if (_this._disposed)
+ return;
+ _this._pageInVirtualListData()
+ })
+ }
+ }, function (error) {
+ MS.Entertainment.fail("itemsFromIndex failed!" + (error && error.message))
+ });
+ return itemsPromise
+ };
+ ObservableArrayVirtualListAdapter.prototype._clear = function () {
+ if (this._virtualList) {
+ this._virtualList.setNotificationHandler(null);
+ this._virtualList = null
+ }
+ if (this.length)
+ this.splice(0, this.length)
+ };
+ ObservableArrayVirtualListAdapter.prototype._beginNotifications = function () {
+ this._inNotificationBatch = true
+ };
+ ObservableArrayVirtualListAdapter.prototype._endNotifications = function () {
+ this._inNotificationBatch = false;
+ this._pageInDataForRemovedItems()
+ };
+ ObservableArrayVirtualListAdapter.prototype._pageInDataForRemovedItems = function () {
+ if (this._shouldPageInDataForRemovedItems())
+ this._invalidateAll()
+ };
+ ObservableArrayVirtualListAdapter.prototype._shouldPageInDataForRemovedItems = function () {
+ return this.pageInDataOnItemRemoved && !this._inNotificationBatch && (this.length < this.maxItems) && (this.length < this._virtualList.count)
+ };
+ ObservableArrayVirtualListAdapter.prototype._invalidateAll = function () {
+ if (!this._disposed) {
+ this.splice(0, this.length);
+ this._pageInVirtualListData()
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._inserted = function (item, keyBefore, keyAfter, index) {
+ if (!this._disposed) {
+ MS.Entertainment.assert(index >= 0 && (index <= this.length || index > this.maxItems), "index out of bounds");
+ if (index >= 0 && index <= this.length && index < this.maxItems) {
+ if (this.length === this.maxItems)
+ this.pop();
+ if (index >= this.length)
+ this.push(this._itemFactory(item.data));
+ else
+ this.splice(index, 0, this._itemFactory(item.data))
+ }
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._removed = function (key, index) {
+ if (!this._disposed) {
+ MS.Entertainment.assert(index >= 0 && (index < this.length || index >= this.maxItems), "index out of bounds");
+ if (index >= 0 && index < this.length) {
+ this.splice(index, 1);
+ this._pageInDataForRemovedItems()
+ }
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._changed = function (newValue, oldValue) {
+ if (!this._disposed) {
+ var index = this._virtualList.indexFromKey(oldValue.key);
+ MS.Entertainment.assert(index >= 0 && (index < this.length || index >= this.maxItems), "index out of bounds");
+ if (index >= 0 && index < this.length) {
+ var item = this.item(index);
+ item.data = newValue.data
+ }
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._moved = function (item, keyBefore, keyAfter, oldIndex, newIndex) {
+ if (!this._disposed) {
+ MS.Entertainment.assert(this.maxItems === Number.MAX_VALUE, "move action is not currently supported when maxItems is set");
+ MS.Entertainment.assert(oldIndex >= 0 && (oldIndex < this.length || oldIndex >= this.maxItems), "oldIndex out of bounds");
+ MS.Entertainment.assert(newIndex >= 0 && (newIndex < this.length || newIndex >= this.maxItems), "newIndex out of bounds");
+ if (oldIndex >= 0 && oldIndex < this.length && newIndex >= 0 && newIndex < this.length) {
+ this.splice(oldIndex, 1);
+ this.splice(newIndex, 0, item)
+ }
+ }
+ };
+ return ObservableArrayVirtualListAdapter
+ })(Entertainment.ObservableArray);
+ Data.ObservableArrayVirtualListAdapter = ObservableArrayVirtualListAdapter
+ })(Data = Entertainment.Data || (Entertainment.Data = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/framework/fileactivationhandler.js:36295 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Activation", {
+ showNowDefaultDelayMS: 10000, localImageFileNameforMTC: "localImageFileForMTC.png", fileActivationHandler: function fileActivationHandler(e, isAppRunning, suppressNavigateToImmersive) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: start");
+ try {
+ if (MS.Entertainment.Utilities.isMusicApp && MS.Entertainment.Activation.isSingleSong(e)) {
+ var fileItem = e.files[0];
+ return MS.Entertainment.Activation.startTagPlaybackForSong(fileItem, isAppRunning).then(function onStartTagPlaybackForSong() {
+ return MS.Entertainment.Activation.handoffSongToPlaybackPlatform.bind(this, fileItem, suppressNavigateToImmersive, false)
+ }, function onStartTagPlaybackForSongError() {
+ return MS.Entertainment.Activation.handoffSongToPlaybackPlatform.bind(this, fileItem, suppressNavigateToImmersive, true)
+ }).done(null, function ignoreError() { })
+ }
+ else {
+ var fileItems = e.files;
+ if (fileItems.size === 1) {
+ var fileItem = fileItems[0];
+ var fileType = String.empty;
+ if (fileItem.fileType)
+ fileType = fileItem.fileType.toLowerCase();
+ if (MS.Entertainment.Utilities.isMusicApp && MS.Entertainment.Activation._isPlaylist(fileType))
+ return MS.Entertainment.Activation._processPlaylist(fileItem, suppressNavigateToImmersive);
+ else
+ return MS.Entertainment.Activation.retrievePropertiesAndPlay(fileItems, null, suppressNavigateToImmersive)
+ }
+ else if (fileItems.size > 1)
+ return MS.Entertainment.Activation.retrievePropertiesAndPlay(fileItems, e.acquisition, suppressNavigateToImmersive);
+ else
+ return WinJS.Promise.wrap()
+ }
+ }
+ catch (ex) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("fileActivationHandler() exception thrown: " + ex.message);
+ var title = String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE);
+ return MS.Entertainment.UI.Shell.showError(title, MS.Entertainment.Platform.Playback.Error.NS_E_WMP_ACCESS_DENIED)
+ }
+ }, startTagPlaybackForSong: function startTagPlaybackForSong(fileItem, isAppRunning) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: playLocalSong, name=" + fileItem.name);
+ if (isAppRunning) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ if (playbackSession && playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ sessionMgr.clearCachedPBMState()
+ }
+ else if (Windows && Windows.Media && Windows.Media.MediaControl) {
+ var mediaControls = Windows.Media.MediaControl;
+ try {
+ mediaControls.addEventListener("playpausetogglepressed", function audioControlPlayPause() { }, false);
+ mediaControls.addEventListener("playpressed", function audioControlPlay() { }, false);
+ mediaControls.addEventListener("stoppressed", function audioControlStop() { }, false);
+ mediaControls.addEventListener("pausepressed", function audioControlPause() { }, false);
+ mediaControls.addEventListener("soundlevelchanged", function audioSoundlevelchanged() { }, false)
+ }
+ catch (ex) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("Non-fatal exception caught in mediaControls.addEventListener: " + JSON.stringify(ex))
+ }
+ }
+ var beforeReady = new Date;
+ return WinJS.Utilities.ready().then(function doPlayLocalSong() {
+ var delayedBy = (new Date - beforeReady);
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: waiting for document ready for " + delayedBy + "ms");
+ var audioTag;
+ try {
+ audioTag = document.createElement("audio");
+ audioTag.setAttribute("msAudioCategory", "backgroundCapableMedia");
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var hasSubscription = configurationManager.service.lastSignedInUserSubscription;
+ if (hasSubscription) {
+ var mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager;
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
+ var copyProtectionSystems = new Windows.Foundation.Collections.PropertySet;
+ copyProtectionSystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput";
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = copyProtectionSystems;
+ audioTag.msSetMediaProtectionManager(mediaProtectionManager)
+ }
+ }
+ catch (exception) {
+ var description = "playLocalSong: audioTag creation failure: " + exception.description;
+ MS.Entertainment.UI.Controls.fail(description);
+ return WinJS.Promise.wrapError(description)
+ }
+ if (MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation) {
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation.pause();
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation.removeAttribute("src");
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation = null
+ }
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation = audioTag;
+ var onPlaying = function onPlaying() {
+ if (MS.Entertainment.Activation.navigateToDefaultPromise)
+ MS.Entertainment.Activation.navigateToDefaultPromise.cancel();
+ MS.Entertainment.Activation.navigateToDefaultPromise = null;
+ if (fileItem.fileType && fileItem.fileType.toLowerCase() === ".wma")
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayProtectedContent();
+ else
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayNonProtectedContent();
+ audioTag.removeEventListener("playing", onPlaying)
+ };
+ audioTag.addEventListener("playing", onPlaying);
+ audioTag.autoplay = true;
+ audioTag.src = URL.createObjectURL(fileItem, { oneTimeOnly: false });
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ audioTag.volume = volumeControllerService.volume;
+ audioTag.muted = volumeControllerService.mute;
+ return WinJS.Promise.wrap(audioTag)
+ })
+ }, startTagPlaybackForVideo: function startTagPlaybackForVideo(fileItem) {
+ return WinJS.Utilities.ready().then(function doPlayLocalSong() {
+ var videoTag;
+ try {
+ videoTag = document.createElement("video");
+ videoTag.setAttribute("msAudioCategory", "foregroundCapableMedia")
+ }
+ catch (exception) {
+ var description = "startTagPlaybackForVideo: videoTag creation failure: " + exception.description;
+ MS.Entertainment.UI.Controls.fail(description);
+ return WinJS.Promise.wrapError(description)
+ }
+ if (fileItem.fileType.toLowerCase() === ".wmv") {
+ var mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager;
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
+ var copyProtectionSystems = new Windows.Foundation.Collections.PropertySet;
+ copyProtectionSystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput";
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = copyProtectionSystems;
+ videoTag.msSetMediaProtectionManager(mediaProtectionManager)
+ }
+ if (fileItem.fileType.toLowerCase() === ".mkv");
+ videoTag.autoplay = true;
+ videoTag.style.width = "100%";
+ videoTag.style.height = "100%";
+ videoTag.src = URL.createObjectURL(fileItem, { oneTimeOnly: false });
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ videoTag.volume = volumeControllerService.volume;
+ videoTag.muted = volumeControllerService.mute;
+ document.body.appendChild(videoTag);
+ var appContainer = document.querySelector(".control-app");
+ MS.Entertainment.Utilities.collapseElement(appContainer);
+ return WinJS.Promise.wrap(videoTag)
+ })
+ }, handoffSongToPlaybackPlatform: function handoffSongToPlaybackPlatform(fileItem, suppressNavigateToImmersive, autoPlay) {
+ var completion = null;
+ var error = null;
+ var promise = new WinJS.Promise(function (c, e, p) {
+ completion = c;
+ error = e
+ });
+ var mediaItem;
+ var queryPromise;
+ if (fileItem.path)
+ queryPromise = WinJS.Promise.timeout(400).then(function queryForTrack() {
+ var trackQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ trackQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ trackQuery.chunkSize = 1;
+ trackQuery.aggregateChunks = false;
+ trackQuery.trackUrl = fileItem.path;
+ return trackQuery.getItemsArrayAndIgnoreErrors()
+ });
+ else
+ queryPromise = WinJS.Promise.wrap();
+ queryPromise = queryPromise.then(function getMediaItem(trackArray) {
+ if (trackArray && trackArray.length === 1)
+ mediaItem = trackArray[0];
+ else {
+ var dataToAugment = {
+ fileItem: fileItem, musicProps: { title: fileItem.displayName }
+ };
+ mediaItem = MS.Entertainment.Data.augment(dataToAugment, MS.Entertainment.Data.Augmenter.FileActivation.Track);
+ if (mediaItem)
+ mediaItem.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, Microsoft.Entertainment.Platform.AcquisitionContextType.track)
+ }
+ var retrievePropertiesPromise;
+ if (mediaItem && mediaItem.fileItem)
+ retrievePropertiesPromise = MS.Entertainment.Activation.retrieveProperties(mediaItem.fileItem, Microsoft.Entertainment.Platform.AcquisitionContextType.track).then(function onGetProperties(result) {
+ if (result && result.mediaItem && mediaItem.inCollection)
+ mediaItem.imageUri = result.mediaItem.imageUri;
+ else
+ mediaItem = result.mediaItem
+ });
+ return WinJS.Promise.as(retrievePropertiesPromise)
+ });
+ var waitPromise = WinJS.Promise.timeout(1200);
+ WinJS.Promise.join([waitPromise, queryPromise]).done(function playTrack() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService)) {
+ var displayService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService);
+ if (displayService)
+ displayService.showDialogForNonCriticalErrors = true
+ }
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(mediaItem, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: autoPlay, showImmersive: false, preventNavigateToDefault: true, showAppBar: false, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true
+ }, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, saveNowPlaying: false, playContext: { activationFilePath: mediaItem && mediaItem.activationFilePath }
+ })
+ }, function playTrack_error(e) {
+ MS.Entertainment.UI.Controls.fail("fileActivationHandler: Error in playTrack" + e)
+ });
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ MS.Entertainment.Activation.navigateToDefaultPromise = WinJS.Promise.timeout(MS.Entertainment.Activation.showNowDefaultDelayMS).then(function () {
+ if (sessionMgr.primarySession.errorDescriptor) {
+ var traceMsg = "File Activation Handler: playback failed ";
+ traceMsg += "- Player State :" + sessionMgr.primarySession.playerState;
+ traceMsg += " : Current transport State :" + sessionMgr.primarySession.currentTransportState;
+ traceMsg += " : Error Code :" + MS.Entertainment.Platform.Playback.errorToString(sessionMgr.primarySession.errorDescriptor.msExtendedCode);
+ MS.Entertainment.Platform.Playback.Etw.traceString(traceMsg)
+ }
+ error("fileActivationHandler::navigateToDefaultPromise");
+ sessionMgr.primarySession.unbind("currentTransportState", onCurrentTransportStateChanged)
+ }, function onError() { });
+ var onCurrentTransportStateChanged = function onCurrentTransportStateChanged(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: playback playing");
+ sessionMgr.primarySession.unbind("currentTransportState", onCurrentTransportStateChanged);
+ if (MS.Entertainment.Activation.navigateToDefaultPromise)
+ MS.Entertainment.Activation.navigateToDefaultPromise.cancel();
+ MS.Entertainment.Activation.navigateToDefaultPromise = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.clearBackStackOnNextNavigate(true)
+ }
+ if (suppressNavigateToImmersive)
+ completion();
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true, completeCallback: function completeLoad() {
+ WinJS.Promise.timeout(100).then(function complete() {
+ completion()
+ })
+ }
+ })
+ }
+ };
+ sessionMgr.primarySession.bind("currentTransportState", onCurrentTransportStateChanged)
+ }
+ else
+ completion();
+ return promise
+ }, retrieveProperties: function retrieveProperties(fileItem, acquisitionContextType, fileOptions) {
+ var promise;
+ var result = {
+ unsupportedType: true, mediaItem: null, error: null
+ };
+ var fileIsAudio = false;
+ var fileIsVideo = false;
+ var contentType = String.empty;
+ var fileType = String.empty;
+ var fileOptions = fileOptions || {};
+ contentType = MS.Entertainment.Utilities.getMediaFileContentType(fileItem);
+ fileType = MS.Entertainment.Utilities.getMediaFileFileType(fileItem);
+ if (MS.Entertainment.Activation._isPlaylist(fileType))
+ return MS.Entertainment.Activation._processPlaylist(fileItem);
+ else if (contentType.indexOf("audio", 0) === 0)
+ fileIsAudio = true;
+ else if (contentType.indexOf("video", 0) === 0 || fileType === ".ts" || fileType === ".divx" || fileType === ".xvid" || fileType === ".mkv")
+ fileIsVideo = true;
+ result.unsupportedType = !(fileIsAudio || fileIsVideo);
+ if (result.unsupportedType) {
+ MS.Entertainment.UI.Actions.assert(MS.Entertainment.Utilities.isAmsterdamApp, "We managed to open a file that is neither audio nor video, this should not happen");
+ fileIsVideo = MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isAmsterdamApp;
+ fileIsAudio = MS.Entertainment.Utilities.isMusicApp
+ }
+ try {
+ if ((MS.Entertainment.Utilities.isMusicApp && (fileIsAudio || (fileType === ".mp4"))) || (MS.Entertainment.Utilities.isAmsterdamApp && fileIsAudio)) {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp && fileItem.path)
+ promise = WinJS.Promise.timeout().then(function queryForTrack() {
+ var trackQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ trackQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, acquisitionContextType);
+ trackQuery.trackUrl = fileItem.path;
+ trackQuery.chunkSize = 1;
+ trackQuery.aggregateChunks = false;
+ return trackQuery.getItemsArrayAndIgnoreErrors()
+ });
+ else
+ promise = WinJS.Promise.wrap();
+ promise = promise.then(function getMediaItem(trackArray) {
+ if (trackArray && trackArray.length === 1) {
+ result.mediaItem = trackArray[0];
+ return result
+ }
+ var musicPropertiesRetrievalPromise;
+ try {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ musicPropertiesRetrievalPromise = fileItem.properties.getMusicPropertiesAsync();
+ else
+ musicPropertiesRetrievalPromise = MS.Entertainment.Data.Factory.MediaBrowser.storageItemToAugmentedItem(fileItem).hydrate()
+ }
+ catch (ex) {
+ MS.Entertainment.UI.Controls.fail("fileActivationHandler: Error in getMusicPropertiesAsync: ", ex.message);
+ MS.Entertainment.Platform.Playback.Etw.traceString("fileActivationHandler: Error in getMusicPropertiesAsync: " + ex.message);
+ result.error = ex;
+ return WinJS.Promise.wrapError(result)
+ }
+ return musicPropertiesRetrievalPromise.then(function onRetrievedMusicProps(musicProps) {
+ var dataToAugment = {};
+ dataToAugment.fileItem = fileItem;
+ dataToAugment.musicProps = musicProps;
+ var mediaItem = MS.Entertainment.Data.augment(dataToAugment, MS.Entertainment.Data.Augmenter.FileActivation.Track);
+ if (!mediaItem.name)
+ mediaItem.name = fileItem.name;
+ if (fileOptions.trackIndex >= 0)
+ musicProps.playlistIndex = fileOptions.trackIndex;
+ mediaItem.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ result.mediaItem = mediaItem;
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ return WinJS.Promise.timeout(2000)
+ }, function onRetrievedMusicPropsError(error) {
+ result.error = error;
+ return WinJS.Promise.wrapError(result)
+ }).then(function onPreGetThumbnailAsync() {
+ if (MS.Entertainment.Utilities.isAmsterdamApp)
+ return WinJS.Promise.as(null);
+ else
+ fileItem.getThumbnailAsync.bind(fileItem, Windows.Storage.FileProperties.ThumbnailMode.musicView, 100)
+ }).then(function onThumbnailRetrieved(thumbnail) {
+ if (thumbnail && result.mediaItem) {
+ result.mediaItem.imageUri = MS.Entertainment.Data.Factory.oneTimeUseBlob(thumbnail);
+ //if (thumbnail.type !== Windows.Storage.FileProperties.ThumbnailType.icon)
+ MS.Entertainment.Platform.Playback.makeLocalImagePromise = MS.Entertainment.Platform.Playback.makeLocalImageFileFromThumbnailPromise(thumbnail);
+ //else
+ // result.mediaItem.imageUri = null;
+ return WinJS.Promise.as(result)
+ }
+ else if (result.mediaItem)
+ return WinJS.Promise.as(result)
+ }, function onThumbnailRetrieved_Error(error) {
+ result.error = error;
+ return WinJS.Promise.wrapError(result)
+ })
+ })
+ }
+ else if (fileIsVideo && (MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isAmsterdamApp)) {
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ var appView = Windows.UI.ViewManagement.ApplicationView;
+ if (appView)
+ appView.tryUnsnap()
+ }
+ var dataToAugment = {};
+ dataToAugment.fileItem = fileItem;
+ var mediaItem = MS.Entertainment.Data.augment(dataToAugment, MS.Entertainment.Data.Augmenter.FileActivation.Video);
+ if (!mediaItem.name)
+ mediaItem.name = fileItem.name;
+ result.mediaItem = mediaItem;
+ WinJS.Promise.timeout(2000).then(function getThumbnail() {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ fileItem.getThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.videosView, MS.Entertainment.UI.Shell.ImageLoader.DefaultThumbnailSizes.video).then(function onThumbnailRetrieved(thumbnail) {
+ if (thumbnail && mediaItem)
+ mediaItem.imageUri = MS.Entertainment.Data.Factory.oneTimeUseBlob(thumbnail);
+ { }
+ }, function onThumbnailRetrievedError(error) {
+ var description = "failed to retrieve thumbnail. error: " + error.message;
+ MS.Entertainment.UI.Controls.fail(description)
+ })
+ });
+ promise = WinJS.Promise.as(result)
+ }
+ else {
+ result.error = new Error("Invalid type");
+ promise = WinJS.Promise.as(result)
+ }
+ }
+ catch (exception) {
+ MS.Entertainment.UI.Controls.assert(false, exception.description);
+ promise = WinJS.Promise.wrapError(exception.description)
+ }
+ return promise
+ }, retrievePropertiesAndPlay: function retrievePropertiesAndPlay(fileItems, playlistAcquisition, suppressNavigateToImmersive, fileOptions, overloadNavigateBack) {
+ var firstItem = null;
+ var currentPromise;
+ var promises = [];
+ var i;
+ var fileOptions = fileOptions || {};
+ if (overloadNavigateBack) {
+ MS.Entertainment.Navigation.assert(MS.Entertainment.Utilities.isVideoApp1, "navigateBack function is overloaded in the wrong context");
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigation) {
+ var navigateBackOriginalCopy = navigation.navigateBack;
+ navigation.navigateBack = function overloadedNavigateBack() {
+ var oldPage = WinJS.Binding.unwrap(this.currentPage);
+ if (oldPage.iaNode.moniker === "fullScreenNowPlaying") {
+ var appContainer = document.querySelector(".control-app");
+ MS.Entertainment.Utilities.displayElement(appContainer);
+ var videoPage = document.querySelector(".app-classicContainer .control-videoFullScreenNowPlaying");
+ if (videoPage && videoPage.style)
+ videoPage.style.backgroundColor = "rgb(0, 0, 0)"
+ }
+ navigation.navigateBack = navigateBackOriginalCopy;
+ navigation.navigateBack()
+ }
+ }
+ }
+ var videoPlayback = MS.Entertainment.Utilities.isVideoApp;
+ function _onFirstResolvedProperties(result) {
+ var completion = null;
+ var error = null;
+ var promise = new WinJS.Promise(function (c, e, p) {
+ completion = c;
+ error = e
+ });
+ if (firstItem) {
+ completion();
+ return promise
+ }
+ else if (!result || !result.mediaItem || result.error) {
+ error(result);
+ return promise
+ }
+ var hasCurrentPage = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (videoPlayback)
+ navigationService.clearBackStackOnNextNavigate(true);
+ hasCurrentPage = !!navigationService.currentPage
+ }
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (videoPlayback || hasCurrentPage) {
+ var completePromise = function completePromise(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing || newValue === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ completion();
+ sessionMgr.primarySession.unbind("currentTransportState", completePromise);
+ sessionMgr.primarySession.unbind("playerState", completePromise)
+ }
+ };
+ sessionMgr.primarySession.bind("currentTransportState", completePromise);
+ sessionMgr.primarySession.bind("playerState", completePromise)
+ }
+ firstItem = result.mediaItem;
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(firstItem, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, showImmersive: videoPlayback, preventNavigateToDefault: !videoPlayback || suppressNavigateToImmersive, showAppBar: hasCurrentPage && !videoPlayback, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true
+ }, playContext: { activationFilePath: firstItem.activationFilePath }, saveNowPlaying: false
+ });
+ if (!videoPlayback && !hasCurrentPage) {
+ var navigateToDefaultPromise = WinJS.Promise.timeout(MS.Entertainment.Activation.showNowDefaultDelayMS).then(function () {
+ error("fileActivationHandler::navigateToDefaultPromise");
+ sessionMgr.primarySession.unbind("currentTransportState", navigateToImmersive)
+ }, function onError() { });
+ var navigateToImmersive = function navigateToImmersive(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ navigateToDefaultPromise.cancel();
+ navigateToDefaultPromise = null;
+ if (navigationService)
+ navigationService.clearBackStackOnNextNavigate(true);
+ if (!suppressNavigateToImmersive && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true, completeCallback: function completeLoad() {
+ WinJS.Promise.timeout(100).then(function complete() {
+ completion()
+ })
+ }
+ });
+ else
+ completion();
+ sessionMgr.primarySession.unbind("currentTransportState", navigateToImmersive)
+ }
+ };
+ sessionMgr.primarySession.bind("currentTransportState", navigateToImmersive)
+ }
+ return promise
+ }
+ { };
+ function _onAllResolvedProperties(results) {
+ var j;
+ var unsupportedType;
+ var playingItems = !!firstItem;
+ if (!videoPlayback)
+ if (fileOptions.queueItems) {
+ var mediaItems = results.map(function extractMediaItems(result) {
+ if (result && result.mediaItem)
+ return result.mediaItem
+ });
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(mediaItems, {
+ queueMedia: true, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, preventNavigateToDefault: suppressNavigateToImmersive
+ })
+ }
+ else
+ for (var i = 0; i < results.length; i++) {
+ var result = results[i];
+ if (result && result.mediaItem && firstItem !== result.mediaItem)
+ if (!firstItem && !fileOptions.queueItems)
+ return _onFirstResolvedProperties(result).then(function processRemainingResults() {
+ return _onAllResolvedProperties(results)
+ });
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(result.mediaItem, {
+ queueMedia: true, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, preventNavigateToDefault: suppressNavigateToImmersive
+ });
+ else if (result && result.unsupportedType)
+ unsupportedType = true
+ }
+ if (!playingItems && unsupportedType)
+ this._showError(String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE), MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED.code)
+ }
+ { };
+ var firstPromise = null;
+ for (i = 0; i < fileItems.length; i++) {
+ currentPromise = MS.Entertainment.Activation.retrieveProperties(fileItems[i], playlistAcquisition || Microsoft.Entertainment.Platform.AcquisitionContextType.track, { trackIndex: fileOptions.firstTrackIndex >= 0 ? fileOptions.firstTrackIndex + i : null });
+ if (i === 0 && !fileOptions.queueItems) {
+ firstPromise = currentPromise;
+ firstPromise.then(function onRetrieveProperties(result) {
+ return _onFirstResolvedProperties(result)
+ }).then(null, function onRetrievePropertiesError(result) {
+ if (videoPlayback && fileItems.length === 1) {
+ var title = String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE);
+ if (result && result.unsupportedType)
+ this._showError(title, MS.Entertainment.Platform.Playback.Error.MF_E_UNSUPPORTED_BYTESTREAM.code);
+ else
+ this._showError(title, MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC.code)
+ }
+ }.bind(this))
+ }
+ else
+ promises.push(currentPromise)
+ }
+ var processRest = function processRest() {
+ return WinJS.Promise.join(promises).then(_onAllResolvedProperties.bind(this), function onJoinError() { })
+ };
+ if (!fileOptions.queueItems) {
+ firstPromise.then(processRest, processRest);
+ return firstPromise
+ }
+ else
+ return processRest()
+ }, isSingleSong: function isSingleSong(e) {
+ var fileItems = e.files;
+ var single = false;
+ try {
+ if (fileItems.size === 1) {
+ var fileItem = fileItems[0];
+ var contentType = String.empty;
+ var fileIsAudio = false;
+ if (fileItem.contentType)
+ contentType = fileItem.contentType.toLowerCase();
+ if (contentType)
+ fileIsAudio = (contentType.indexOf("audio", 0) === 0);
+ if (fileItem.fileType)
+ fileIsAudio = fileIsAudio && !MS.Entertainment.Activation._isPlaylist(fileItem.fileType.toLowerCase());
+ if (fileIsAudio)
+ single = true
+ }
+ }
+ catch (ex) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("isSingleSong() exception thrown: " + ex.message)
+ }
+ return single
+ }, _isPlaylist: function _isPlaylist(fileType) {
+ return (fileType === ".wpl" || fileType === ".zpl" || fileType === ".m3u")
+ }, _processPlaylist: function _processPlaylist(fileItem, suppressNavigateToImmersive) {
+ try {
+ return Windows.Media.Playlists.Playlist.loadAsync(fileItem).then(function processPlaylist(playlist) {
+ return MS.Entertainment.Activation.fileActivationHandler({
+ files: playlist.files, acquisition: Microsoft.Entertainment.Platform.AcquisitionContextType.playlist
+ }, null, suppressNavigateToImmersive)
+ }, function onError(error) {
+ if (error.number)
+ if (error.number === -2147024809)
+ this._showError(String.load(String.id.IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE), MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_PLAYLIST_PATH_NOT_SUPPORTED.code);
+ else
+ this._showError(String.load(String.id.IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE), error.number);
+ return WinJS.Promise.wrapError()
+ }.bind(this))
+ }
+ catch (e) {
+ return WinJS.Promise.wrapError()
+ }
+ }, _showError: function _showError(title, errorCode) {
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/MessageBox.html", "messageBoxTemplate", true).done(function onLoadCompleted() {
+ MS.Entertainment.UI.Shell.showError(title, errorCode)
+ }, function onLoadError(error) {
+ MS.Entertainment.UI.Components.Shell.fail("failed to load MessageBox loadTemplate for file activation: " + error && error.message)
+ })
+ }
+ })
+ })()
+})();
+/* >>>>>>/components/search/typetosearchservice.js:36872 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {
+ TypeToSearchService: MS.Entertainment.UI.Framework.define(function () {
+ this._handleFocusIn = this._handleFocusIn.bind(this)
+ }, {
+ _isEnabledForApp: {
+ get: function () {
+ var result = false;
+ if (MS.Entertainment.Utilities.isVideoApp1 || (MS.Entertainment.Utilities.isMusicApp1))
+ result = true;
+ return result
+ }
+ }, typeToSearchPropertyName: "showOnKeyboardInput", getTypeToSearchHost: function getTypeToSearchHost() {
+ var host = MS.Entertainment.ViewModels.SearchContractViewModel.getForCurrentView();
+ if (!host)
+ host = {};
+ return host
+ }, shouldEnableTypeToSearchForElement: function shouldEnableTypeToSearchForElement(element) {
+ return MS.Entertainment.Utilities.doesElementSupportKeyboardInput(element)
+ }, _isListeningForFocus: false, _disabledCount: 0, _listenForFocus: function _listenForFocus() {
+ if (this._isListeningForFocus)
+ return;
+ this._isListeningForFocus = true;
+ document.body.addEventListener("focusin", this._handleFocusIn)
+ }, _stopListeningForFocus: function _stopListeningForFocus() {
+ if (!this._isListeningForFocus)
+ return;
+ document.body.removeEventListener("focusin", this._handleFocusIn);
+ this._isListeningForFocus = false
+ }, _handleFocusIn: function _handleFocusIn() {
+ if (this.shouldEnableTypeToSearchForElement(document.activeElement))
+ this._suspendTypeToSearch();
+ else
+ this._resumeTypeToSearch()
+ }, _suspendTypeToSearch: function _suspendTypeToSearch() {
+ this.getTypeToSearchHost()[this.typeToSearchPropertyName] = false;
+ window.msWriteProfilerMark("ent:TypeToSearch:Suspended")
+ }, _resumeTypeToSearch: function _resumeTypeToSearch() {
+ this.getTypeToSearchHost()[this.typeToSearchPropertyName] = true;
+ window.msWriteProfilerMark("ent:TypeToSearch:Resume")
+ }, disableTypeToSearch: function disableTypeToSearch() {
+ if (!this._isEnabledForApp)
+ return;
+ this._stopListeningForFocus();
+ this._suspendTypeToSearch();
+ this._disabledCount++;
+ window.msWriteProfilerMark("ent:TypeToSearch:Disabled")
+ }, enableTypeToSearch: function enableTypeToSearch() {
+ if (!this._isEnabledForApp)
+ return;
+ if (this._disabledCount > 0) {
+ this._disabledCount--;
+ if (this._disabledCount > 0)
+ return
+ }
+ this._resumeTypeToSearch();
+ window.msWriteProfilerMark("ent:TypeToSearch:Enabled");
+ this._listenForFocus()
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.typeToSearch, function createTypeToSearchService() {
+ return new MS.Entertainment.UI.TypeToSearchService
+ })
+ })()
+})();
+/* >>>>>>/components/music1/anonymousfreeplay.js:36938 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var Music;
+ (function (Music) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Music");
+ var AnonymousFreePlay = (function () {
+ function AnonymousFreePlay() { }
+ Object.defineProperty(AnonymousFreePlay.prototype, "anonymousLimitReached", {
+ get: function () {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlayAnonymous) && (new Microsoft.Entertainment.Configuration.ConfigurationManager).music.anonymousLimitReached)
+ return true;
+ return false
+ }, enumerable: true, configurable: true
+ });
+ AnonymousFreePlay.factory = function () {
+ return new MS.Entertainment.Music.AnonymousFreePlay
+ };
+ return AnonymousFreePlay
+ })();
+ Music.AnonymousFreePlay = AnonymousFreePlay
+ })(Music = Entertainment.Music || (Entertainment.Music = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.anonymousFreePlay, MS.Entertainment.Music.AnonymousFreePlay.factory)
+})();
+/* >>>>>>/components/playback/playbackstates.js:36969 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ TransportState: {
+ unInitialize: "unInitialize", playing: "playing", paused: "paused", stopped: "stopped", starting: "starting", buffering: "buffering"
+ }, SessionState: {
+ notActivated: "notActivated", activated: "activated", ended: "ended", endedWithError: "endedWithError"
+ }, ProtectionState: {
+ unknown: "unknown", drmProtected: "drmProtected", unprotected: "unprotected"
+ }, PlayerState: {
+ ready: "ready", notReady: "notReady", error: "error"
+ }, PlayerMode: {
+ local: "local", remote: "remote"
+ }, UsageContext: {
+ user: "User", automatic: "Automatic"
+ }
+ })
+ })()
+})();
+/* >>>>>>/components/playback/playbackeventnotifications.js:36994 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ WinJS.Namespace.define("MS.Entertainment.Platform.Playback", {
+ PlaybackEventNotifications: MS.Entertainment.UI.Framework.define(function playbackEventNotifierConstructor() { }, {
+ _listeners: {}, _listenerCount: 0, _errors: {}, _nowPlayingId: 0, _bindings: null, _oldMedia: null, setError: function setError(mediaId, errorCode) {
+ MS.Entertainment.Platform.Playback.assert(this._isValidMediaId(mediaId), "invalid mediaId param");
+ MS.Entertainment.Platform.Playback.assert(errorCode <= 0, "invalid errorCode param");
+ if (errorCode === 0)
+ delete this._errors[mediaId];
+ else
+ this._errors[mediaId] = errorCode;
+ this._sendEvent(mediaId, MS.Entertainment.Platform.Playback.PlaybackEventNotifications.Event.error, errorCode)
+ }, clearErrors: function clearErrors() {
+ for (var mediaId in this._errors)
+ this._sendEvent(mediaId, MS.Entertainment.Platform.Playback.PlaybackEventNotifications.Event.error, 0);
+ this._errors = {}
+ }, getError: function getError(mediaId) {
+ var errorCode = this._errors[mediaId];
+ return errorCode
+ }, attachListener: function attachListener(mediaId, listener) {
+ MS.Entertainment.Platform.Playback.assert(this._isValidMediaId(mediaId), "invalid mediaId param");
+ MS.Entertainment.Platform.Playback.assert(listener instanceof Function, "listener param is not a function");
+ var listeners = this._listeners[mediaId];
+ if (!listeners)
+ this._listeners[mediaId] = [listener];
+ else
+ listeners.push(listener);
+ if (this._listenerCount === 0) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._bindings = WinJS.Binding.bind(sessionManager, {
+ nowPlayingSession: {
+ currentOrdinal: this._handleCurrentOrdinalChange.bind(this), currentMedia: this._handleCurrentMediaChange.bind(this)
+ }
+ })
+ }
+ this._listenerCount++;
+ var errorCode = this._errors[mediaId];
+ if (errorCode && !this._shouldIgnoreError(errorCode))
+ listener(mediaId, MS.Entertainment.Platform.Playback.PlaybackEventNotifications.Event.error, errorCode);
+ if (this._isValidMediaId(mediaId) && (mediaId === this._nowPlayingId))
+ listener(mediaId, MS.Entertainment.Platform.Playback.PlaybackEventNotifications.Event.nowPlaying, true)
+ }, detachListener: function detachListener(mediaId, listener) {
+ MS.Entertainment.Platform.Playback.assert(this._isValidMediaId(mediaId), "invalid mediaId param");
+ MS.Entertainment.Platform.Playback.assert(listener instanceof Function, "listener param is not a function");
+ var listeners = this._listeners[mediaId];
+ if (listeners)
+ if (listeners.length === 1) {
+ MS.Entertainment.Platform.Playback.assert(listeners[0] === listener, "listener not attached");
+ if (listeners[0] === listener)
+ delete this._listeners[mediaId]
+ }
+ else {
+ var index = listeners.indexOf(listener);
+ MS.Entertainment.Platform.Playback.assert(index >= 0, "listener not attached");
+ if (index >= 0)
+ listeners.splice(index, 1)
+ }
+ this._listenerCount--;
+ this._listenerCount = Math.max(0, this._listenerCount);
+ if (this._listenerCount === 0 && this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null;
+ this._oldMedia = null;
+ this._nowPlayingId = 0
+ }
+ }, _handleCurrentMediaChange: function _handleCurrentMediaChange(newMedia) {
+ if (this._oldMedia)
+ this._setNowPlaying(this._oldMedia, false);
+ if (newMedia)
+ this._setNowPlaying(newMedia, true);
+ this._oldMedia = newMedia
+ }, _handleCurrentOrdinalChange: function _handleCurrentOrdinalChange(newOrdinal) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var session = sessionManager.nowPlayingSession;
+ var collection = session ? session.mediaCollection : null;
+ if (collection && newOrdinal === +newOrdinal)
+ collection.itemFromIndex(newOrdinal).done(function _handleCurrentOrdinalChange_gotItem(item) {
+ if (item && item.data)
+ this._handleCurrentMediaChange(item.data)
+ }.bind(this), function _handleCurrentOrdinalChange_errorOnItemGet(error) {
+ MS.Entertainment.Platform.Playback.fail("unexpected: _handleCurrentOrdinalChange_errorOnItemGet " + newOrdinal)
+ });
+ else
+ this._handleCurrentMediaChange(null)
+ }, _setNowPlaying: function _setNowPlaying(media, isNowPlaying, isSecondaryMedia) {
+ this._setNowPlayingInternal(media, isNowPlaying, isSecondaryMedia);
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && media.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo && media.hasTrackId)
+ this._setNowPlayingInternal(media.track, isNowPlaying, isSecondaryMedia)
+ }, _setNowPlayingInternal: function _sendNowPlayingEvent(media, isNowPlaying, isSecondaryMedia) {
+ var mediaId = MS.Entertainment.Platform.Playback.PlaybackEventNotifications.getEventingMediaId(media);
+ this._sendEvent(mediaId, MS.Entertainment.Platform.Playback.PlaybackEventNotifications.Event.nowPlaying, isNowPlaying);
+ this._nowPlayingId = (isNowPlaying && !isSecondaryMedia) ? mediaId : 0
+ }, _sendEvent: function _sendEvent(mediaId, event, value) {
+ var listeners = this._listeners[mediaId];
+ if (listeners && !this._shouldIgnoreError(value))
+ listeners.forEach(function (listener) {
+ listener(mediaId, event, value)
+ })
+ }, _isValidMediaId: function _isValidMediaId(mediaId) {
+ return ((typeof mediaId === "number" && mediaId >= 0) || (typeof mediaId === "string" && !MS.Entertainment.Utilities.isEmptyGuid(mediaId)))
+ }, _shouldIgnoreError: function _shouldIgnoreError(errorCode) {
+ return (errorCode === MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_NOT_LOCAL.code)
+ }
+ }, {
+ Event: {
+ error: "error", nowPlaying: "nowPlaying"
+ }, getEventingMediaId: function getEventingMediaId(mediaItem) {
+ var mediaId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (mediaItem)
+ if (MS.Entertainment.Utilities.isValidServiceId(mediaItem.assetLocationId))
+ mediaId = mediaItem.assetLocationId;
+ else if (MS.Entertainment.Utilities.isValidServiceId(mediaItem.serviceId))
+ mediaId = mediaItem.serviceId;
+ else if (mediaItem.libraryId && (typeof mediaItem.libraryId === "number") && mediaItem.libraryId >= 0)
+ mediaId = mediaItem.libraryId;
+ else if (mediaItem.activationFilePath)
+ mediaId = mediaItem.activationFilePath;
+ else if (mediaItem.folderRelativeId)
+ mediaId = mediaItem.folderRelativeId;
+ else if (mediaItem.track)
+ mediaId = mediaItem.track.serviceId;
+ else
+ MS.Entertainment.Utilities.fail("mediaItem did not contain a serviceId, libraryId or activation path. Eventing will fail. " + MS.Entertainment.Utilities.stringify(mediaItem));
+ return mediaId
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.playbackEventNotifications, function playbackEventNotifierFactory() {
+ return new MS.Entertainment.Platform.Playback.PlaybackEventNotifications
+ }, true)
+ })()
+})();
+/* >>>>>>/components/playback/playbackerrors.js:37127 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ initPlaybackError: function PlaybackError(message, context) {
+ this.message = message;
+ if (context)
+ this.context = context;
+ var d = this.name + (message ? ": " + message : String.empty);
+ if (context)
+ d += " (" + context + ")";
+ this.description = d;
+ if (arguments.length > 0)
+ this.trace();
+ return []
+ }, initUnplayableItemError: function initUnplayableItemError(mediaItem, ordinal) {
+ return [(mediaItem && mediaItem.data && mediaItem.data.title) ? " Title@" + ordinal + ": " + mediaItem.data.title + " ID = " + mediaItem.data.assetLocationId : undefined, (ordinal === +ordinal) ? ordinal.toString() : ((typeof ordinal == "string") ? ordinal : undefined)]
+ }
+ });
+ var Playback = MSEPlatform.Playback;
+ function deriveError(definitionNamespace, name, baseError) {
+ var proto = Object.getPrototypeOf(new baseError);
+ var fullName = name;
+ if ("name" in proto)
+ fullName += "." + proto.name;
+ var shortName = name + "Error";
+ var predicateName = "is" + shortName;
+ var initFunctionName = "init" + shortName;
+ var initFunction = definitionNamespace[initFunctionName];
+ definitionNamespace[shortName] = function () {
+ var baseArgs = initFunction ? initFunction.apply(this, arguments) : arguments;
+ proto.constructor.apply(this, baseArgs)
+ };
+ var errorConstructor = definitionNamespace[shortName];
+ var baseProto = new baseError;
+ errorConstructor.prototype = baseProto;
+ errorConstructor.prototype.constructor = errorConstructor;
+ baseProto[predicateName] = true;
+ baseProto.name = fullName;
+ baseProto.shortName = shortName;
+ baseProto.namespace = definitionNamespace;
+ return baseProto
+ }
+ var playbackErrorTrace = function playbackErrorTrace() {
+ if (MSEPlatform.Playback.Etw && "traceString" in MSEPlatform.Playback.Etw)
+ MSEPlatform.Playback.Etw.traceString(this.toString())
+ };
+ deriveError(Playback, "Playback", Error);
+ Playback.PlaybackError.prototype.trace = playbackErrorTrace;
+ deriveError(Playback, "UnplayableItem", Playback.PlaybackError);
+ deriveError(Playback, "SkipFwdOutOfRange", Playback.PlaybackError);
+ deriveError(Playback, "SkipBkwdOutOfRange", Playback.PlaybackError);
+ (function () {
+ function _hresult(hex) {
+ return hex >= 0x80000000 ? hex - 0x100000000 : hex
+ }
+ var errorGroups = {
+ Error: {
+ NS_E_EXPLICIT_CONTENT_SIGNIN_REQUIRED: 0xC00D1354, NS_E_EXPLICIT_CONTENT_PLAY_BLOCKED: 0xC00D1355, NS_E_EXPLICIT_CONTENT_DOWNLOAD_BLOCKED: 0xC00D1393, NS_E_NO_PLAYABLE_MEDIA: 0xC00D10DE, NS_E_WMP_ACCESS_DENIED: 0xC00D11D2, NS_E_WMP_NETWORK_ERROR: 0xC00D11C0, NS_E_SIGNIN_NOT_SUPPORTED_REGION: 0xC00D1388, NS_E_DRM_NEEDS_INDIVIDUALIZATION: 0xC00D2728, NS_E_WMPIM_USEROFFLINE: 0xC00D1126, NS_E_WMP_DRM_LICENSE_NOTACQUIRED: 0xc00d1204, NS_E_COMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED: 0xC00D2098, NS_E_UNCOMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED: 0xC00D2099, NS_E_DRM_DRIVER_AUTH_FAILURE: 0xC00D274D, NS_E_DRM_UNABLE_TO_INITIALIZE: 0xC00D271D, NS_E_WMP_AUDIO_HW_PROBLEM: 0xC00D11BA, NS_E_WMP_OUTOFMEMORY: 0xC00D11C6, NS_E_WMP_BAD_DRIVER: 0xC00D11D1, NS_E_WMP_MULTIPLE_ERROR_IN_PLAYLIST: 0xC00D11DF, NS_E_WMPCORE_BUSY: 0xC00D10B7, NS_E_WMP_DRM_GENERIC_LICENSE_FAILURE: 0xC00D11DA, NS_E_DRM_INVALID_LICENSE: 0xC00D2718, ZEST_E_UNAUTHENTICATED: 0xC101A004, ZEST_E_SIGNIN_REQUIRED: 0xC101A24B, ZEST_E_DEVICE_ACTIVATION_LIMIT_EXCEEDED: 0xC101A411, ZEST_E_ASSET_ITEM_NOT_PURCHASED: 0xC101A7D1, ZEST_E_ASSET_LICENSE_RIGHT_NOT_OWNED: 0xC101A7D4, ZEST_E_ASSET_LICENSE_SUBSCRIPTION_DOWNLOAD_ONLY: 0xC101A7DC, ZEST_E_MULTITUNER_CONCURRENTSTREAMING_DETECTED: 0xC101A7D8, ZEST_E_MEDIAINSTANCE_STREAMING_OCCUPIED: 0xC101A7E1, ZEST_E_MW_CONCURRENT_STREAM: 0xC101A9CA, ZEST_E_MW_CONTENT_REVOKED_ON_LABEL_TAKEDOWN: 0xC101A9D6, ZEST_E_UNSUPPORTED_DRM_COMPONENT: 0xC101A3F5, ZEST_E_UNSUPPORTED_DRM_COMPONENT_STREAM: 0xC101A419, ZUNE_E_PASSPORT_TICKET_SIGNIN_REQUIRED: 0xC1010036, ZUNE_E_NO_SUBSCRIPTION_DOWNLOAD_RIGHTS: 0xC1010029, ZUNE_E_DOWNLOAD_LIBRARY_DISK_FULL: 0xC1010039, ZUNE_E_DOWNLOAD_SYSTEM_DISK_FULL: 0xC1010038, ZUNE_E_MAXIMUM_PLAYLIST_LENGTH_EXCEEDED: 0xc10100c9, E_MDS_UNAUTHENTICATED_TRACK_LIMIT: 0xC101AB55, E_MDS_AUTHENTICATED_TRACK_LIMIT: 0xC101AB56, E_MDS_INDIVIDUAL_TRACK_LIMIT: 0xC101AB59, E_MDS_CANNOT_PLAY: 0xC101AB57, E_MDS_ROAMING_LIMIT: 0xC101AB58, E_ENHANCED_STORAGE: 0x8004b896, E_ABORT: 0x80004004, E_NOTIMPL: 0x80004001, E_FILE_NOT_FOUND: 0x80070002, E_FAIL: 0x80004005, ERROR_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED: 0xC0262500, X8_E_PLAYBACK_MEDIA_ERR_ABORTED: 0xC101008D, X8_E_PLAYBACK_MEDIA_ERR_NETWORK: 0xC101008E, X8_E_PLAYBACK_MEDIA_ERR_DECODE: 0xC101008F, X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED: 0xC1010090, X8_E_PLAYBACK_MEDIA_GENERIC: 0xC1010091, X8_E_PLAYBACK_MEDIA_CANT_PLAYTO: 0xC1010092, X8_E_PLAYBACK_MEDIA_CANT_PLAYTO_PREMIUM: 0xC1010093, X8_E_PLAYBACK_FREESTREAMING_NO_RIGHTS: 0xC1010094, X8_E_PLAYBACK_PLAYTO_ERR_DECODE: 0xC1010095, X8_E_PLAYBACK_LOGON_TO_PLAY_EXPLICIT_CONTENT: 0xC1010096, X8_E_PLAYBACK_LOGON_TO_PLAY_EXPLICIT_CONTENT_PRE_ASSET_LOCATION: 0xC1010097, X8_E_PLAYBACK_EXPLICIT_CONTENT_PLAY_BLOCKED_PRE_ASSET_LOCATION: 0xC1010098, X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED: 0xC1010099, X8_E_PLAYBACK_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED: 0xC101009A, X8_E_PLAYBACK_PLAYLIST_FILE_CORRUPT: 0xC101009C, X8_E_PLAYBACK_REMOTE_DESKTOP_NOT_SUPPORTED: 0xC101009D, X8_E_PLAYBACK_MEDIA_ERR_NOT_LOCAL: 0xC101009E, X8_E_PLAYBACK_HDMI_OUTPUT_LOST: 0xC101009F, X8_E_PLAYBACK_PLAYLIST_PATH_NOT_SUPPORTED: 0xC10100A0, X8_E_PLAYBACK_PLAYTO_UNEXPECTED_ERR: 0xC10100A1, X8_E_PLAYBACK_COMPONENT_LOAD_FAILURE: 0xC10100A2, X8_E_PLAYBACK_NO_ASSET_LOCATION: 0xC101010A, X8_E_PREVIEW_ONLY_DONOT_PLAY_IN_PLAYLIST: 0xC101010D, X8_E_OPLOCK_HANDLE_CLOSED: 0xC101010F, X8_E_PLAYBACK_STOPPED_DATA_LIMIT_EXCEEDED: 0xC10101C2, X8_E_PLAYBACK_STOPPED_DATA_LIMIT_APPROACHING: 0xC10101C3, X8_E_PLAYBACK_STOPPED_SWITCHED_TO_METERED_NETWORK: 0xC10101C4, X8_E_UNSUPPORTED_FORMAT: 0xC1010103, MF_E_DRM_UNSUPPORTED: 0xC00D3700, MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED: 0XC00D4E86, MF_E_UNSUPPORTED_CONTENT_PROTECTION_SYSTEM: 0xC00D7186, MF_E_INVALIDMEDIATYPE: 0xC00D36B4, MF_E_CANNOT_CREATE_SINK: 0xC00D36FA, MF_E_DEBUGGING_NOT_ALLOWED: 0xC00D715D, MF_E_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED: 0xC00D7178, MF_E_INVALIDREQUEST: 0xC00D36B2, MF_E_UNSUPPORTED_SCHEME: 0xC00D36C3, MF_E_UNSUPPORTED_BYTESTREAM: 0xC00D36C4, MF_E_UNSUPPORTED_RATE: 0xC00D36D0, MF_E_TOPO_CODEC_NOT_FOUND: 0xC00D5212, MF_E_NO_PMP_HOST: 0xC00D717F, MF_E_UNAUTHORIZED: 0xC00D3701, INET_E_CONNECTION_TIMEOUT: 0x800C000b, INET_E_DOWNLOAD_FAILURE: 0x800C0008, INET_E_RESOURCE_NOT_FOUND: 0x800C0005, SL_E_LICENSE_FILE_NOT_INSTALLED: 0xC004F011
+ }, MediaTagError: {
+ MEDIA_ENGINE_ERR_NOERROR: 0, MEDIA_ERR_ABORTED: 1, MEDIA_ERR_NETWORK: 2, MEDIA_ERR_DECODE: 3, MEDIA_ERR_SRC_NOT_SUPPORTED: 4
+ }
+ };
+ var errorCodeNameLookupTable = {};
+ function _adjustCodeUINT32(code) {
+ return code < 0 ? (code += 0x100000000) : (code & 0xFFFFFFFF)
+ }
+ var codeToString = {
+ Error: function (code, codeName) {
+ return (codeName + "(0x" + _adjustCodeUINT32(code).toString(16) + ")")
+ }, MediaTagError: function (code, codeName) {
+ return (codeName + "(" + code + ")")
+ }, unknownError: function (code) {
+ return "(0x" + _adjustCodeUINT32(code).toString(16) + ")".toString()
+ }
+ };
+ for (var groupName in errorGroups) {
+ var errorGroup = errorGroups[groupName];
+ for (var codeName in errorGroup) {
+ var code = _hresult(errorGroup[codeName]);
+ if (codeToString[groupName])
+ errorCodeNameLookupTable[code] = codeToString[groupName](_hresult(code), codeName)
+ }
+ }
+ { };
+ function _hydrateErrorTable(errorGroups) {
+ var _hydratedTable = {};
+ for (var groupName in errorGroups) {
+ var errorGroup = errorGroups[groupName];
+ Object.defineProperty(_hydratedTable, groupName, {
+ value: {}, writable: false, enumerable: true, configurable: false
+ });
+ for (var codeName in errorGroup) {
+ var code = _hresult(errorGroup[codeName]);
+ Object.defineProperty(_hydratedTable[groupName], codeName, {
+ value: {
+ code: _hresult(errorGroup[codeName]), name: codeName
+ }, writable: false, enumerable: true, configurable: false
+ })
+ }
+ }
+ { };
+ return _hydratedTable
+ }
+ function _errorToString(code) {
+ var codeName = errorCodeNameLookupTable[code];
+ return codeName || codeToString.unknownError(code)
+ }
+ function _mediaErrorToString(error) {
+ return ("error.code = " + _errorToString(error.code) + ", error.msExtendedCode = " + _errorToString(error.msExtendedCode))
+ }
+ function _codeOf(errorName) {
+ for (var groupName in errorGroups) {
+ var errorGroup = errorGroups[groupName];
+ var code = errorGroup[errorName];
+ if (code === +code)
+ return _hresult(code)
+ }
+ { };
+ throw new Error("Invalid Error name: " + errorName);
+ }
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", _hydrateErrorTable(errorGroups));
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ errorToString: _errorToString, mediaErrorToString: _mediaErrorToString, codeOfError: _codeOf
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment.Platform.Playback", {
+ makePlaybackError: function makePlaybackError(error, context, postPendedText) {
+ if (error instanceof Error)
+ MSEPlatform.Playback.Etw.traceString("+PlaybackError::makePlaybackError InnerError: " + MSEPlatform.Playback.errorToString(error.code));
+ else
+ MSEPlatform.Playback.Etw.traceString("+PlaybackError::makePlaybackError InnerError" + ", " + MSEPlatform.Playback.mediaErrorToString(error) + ", context = " + context);
+ var playbackError = {};
+ var errorCode = 0;
+ if (!error) {
+ errorCode = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC.code;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackErrorConvertedToGeneric(0, 0, "makePlaybackError, error is NULL - " + context)
+ }
+ else if (typeof (error) === "object") {
+ postPendedText = postPendedText || error.postPendedText;
+ if (error.code)
+ errorCode = MS.Entertainment.Platform.Playback._mapMediaElementErrorCodes(error.code, error.msExtendedCode);
+ else if (error.number)
+ errorCode = MS.Entertainment.Platform.Playback._mapMediaElementErrorCodes(error.number);
+ else if (error.msExtendedCode)
+ errorCode = error.msExtendedCode;
+ else
+ try {
+ var s = error.toString();
+ if (s && s !== String.empty) {
+ errorCode = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC.code;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackErrorConvertedToGeneric(0, 0, "makePlaybackError, string object = " + s + " - " + context)
+ }
+ }
+ catch (ex) { }
+ }
+ else if (typeof (error) === "string") {
+ errorCode = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC.code;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackErrorConvertedToGeneric(0, 0, "makePlaybackError, string literal = " + error + " - " + context)
+ }
+ else if (isNaN(error)) {
+ errorCode = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC.code;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackErrorConvertedToGeneric(0, 0, "makePlaybackError, error isNaN - " + context)
+ }
+ else
+ errorCode = error;
+ playbackError.innerError = error;
+ playbackError.isCritical = (error && error.isCritical);
+ playbackError.code = errorCode;
+ playbackError.msExtendedCode = errorCode;
+ playbackError.context = context;
+ playbackError.postPendedText = postPendedText;
+ if (error && error.name)
+ playbackError[error.name] = errorCode;
+ MSEPlatform.Playback.Etw.traceString("-PlaybackError::makePlaybackError OuterError" + ", code = " + MSEPlatform.Playback.errorToString(errorCode));
+ return playbackError
+ }, firePlaybackError: function firePlaybackError(callback, error, context, mediaItem, postPendedText) {
+ if (callback) {
+ var eventObject = {
+ type: "error", target: {
+ error: {
+ code: 0, innerError: null, isCritical: false, msExtendedCode: 0, mediaItem: null, context: context, postPendedText: null
+ }
+ }
+ };
+ eventObject.target.error = MS.Entertainment.Platform.Playback.makePlaybackError(error, context, postPendedText);
+ if (mediaItem !== undefined)
+ eventObject.target.error.mediaItem = mediaItem;
+ MSEPlatform.Playback.Etw.traceString("PlaybackErrors::firePlaybackError" + ", code = " + MSEPlatform.Playback.errorToString(eventObject.target.error.code) + ", msExtendedCode = " + MSEPlatform.Playback.errorToString(eventObject.target.error.msExtendedCode) + ", context = " + context);
+ callback(eventObject)
+ }
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayProtectedInApp();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayNonProtectedInApp()
+ }, makeParentallyBlockedError: function makeParentallyBlockedError() {
+ return MS.Entertainment.Utilities.isVideoApp ? MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_EXPLICIT_CONTENT_PLAY_BLOCKED_PRE_ASSET_LOCATION : MS.Entertainment.Platform.Playback.Error.NS_E_EXPLICIT_CONTENT_PLAY_BLOCKED
+ }, _mapMediaElementErrorCodes: function _mapMediaElementErrorCodes(code, msExtendedCode) {
+ if (code < MSEPlatform.Playback.MediaTagError.MEDIA_ERR_ABORTED.code || code > MSEPlatform.Playback.MediaTagError.MEDIA_ERR_SRC_NOT_SUPPORTED.code)
+ return code;
+ var errorCode;
+ switch (code) {
+ case MSEPlatform.Playback.MediaTagError.MEDIA_ERR_ABORTED.code:
+ if (msExtendedCode)
+ errorCode = msExtendedCode;
+ else
+ errorCode = MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_ABORTED.code;
+ break;
+ case MSEPlatform.Playback.MediaTagError.MEDIA_ERR_NETWORK.code:
+ if (msExtendedCode)
+ errorCode = msExtendedCode;
+ else
+ errorCode = MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_NETWORK.code;
+ break;
+ case MSEPlatform.Playback.MediaTagError.MEDIA_ERR_DECODE.code:
+ if (msExtendedCode)
+ errorCode = msExtendedCode;
+ else
+ errorCode = MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_DECODE.code;
+ break;
+ case MSEPlatform.Playback.MediaTagError.MEDIA_ERR_SRC_NOT_SUPPORTED.code:
+ if (msExtendedCode)
+ if (msExtendedCode === MSEPlatform.Playback.Error.MF_E_UNSUPPORTED_CONTENT_PROTECTION_SYSTEM.code)
+ errorCode = MSEPlatform.Playback.Error.NS_E_WMP_DRM_LICENSE_NOTACQUIRED.code;
+ else
+ errorCode = msExtendedCode;
+ else
+ errorCode = MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED.code;
+ break;
+ default:
+ errorCode = MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC.code;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackErrorConvertedToGeneric(code, msExtendedCode, "_mapMediaElementErrorCodes");
+ break
+ }
+ return errorCode
+ }
+ })
+ })()
+})();
+/* >>>>>>/components/playback/playlist/playlist.js:37368 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function (playlistNamespace) {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ var Playback = WinJS.Namespace.define("MS.Entertainment.Platform.Playback", null);
+ var ArrayDataAdapter = WinJS.Class.define(function (array, options) {
+ if (typeof array === "string")
+ array = JSON.parse(array);
+ if (!Array.isArray(array) && !array.getAt)
+ array = [array];
+ this._array = array;
+ if (options) {
+ if (options.keyOf)
+ this._keyOf = options.keyOf;
+ if (options.compareByIdentity)
+ this.compareByIdentity = true
+ }
+ if (this._keyOf)
+ this._keyMap = {};
+ else
+ this._items = new Array(array.length)
+ }, {
+ setNotificationHandler: function (notificationHandler) {
+ if (this._array.onvectorchanged !== undefined) {
+ var CollectionChange = Windows.Foundation.Collections.CollectionChange;
+ var that = this;
+ this._array.addEventListener("vectorchanged", function (ev) {
+ var index = ev.index;
+ switch (ev.collectionChange) {
+ case CollectionChange.reset:
+ notificationHandler.invalidateAll();
+ break;
+ case CollectionChange.itemInserted:
+ notificationHandler.inserted(that._item(index), that._itemKey(index - 1), that._itemKey(index + 1), index);
+ break;
+ case CollectionChange.itemChanged:
+ notificationHandler.changed(that._item(index));
+ break;
+ case CollectionChange.itemRemoved:
+ notificationHandler.removed(null, index);
+ break
+ }
+ })
+ }
+ }, itemsFromEnd: function (count) {
+ var len = this._array.length;
+ return (len === 0 ? errorDoesNotExist() : this.itemsFromIndex(len - 1, Math.min(count - 1, len - 1), 0))
+ }, itemsFromKey: function (key, countBefore, countAfter) {
+ this._ensureItems();
+ if (!this._keyToIndexMap) {
+ this._keyToIndexMap = {};
+ var len = this._array.length;
+ for (var i = 0; i < len; i++)
+ this._keyToIndexMap[this._itemKey(i)] = i
+ }
+ var index = this._keyToIndexMap[key];
+ return (typeof index === "number" ? this.itemsFromIndex(index, Math.min(countBefore, index), countAfter) : errorDoesNotExist())
+ }, itemsFromIndex: function (index, countBefore, countAfter) {
+ var len = this._array.length;
+ if (index >= len)
+ return errorDoesNotExist();
+ else {
+ var first = index - countBefore;
+ var last = Math.min(index + countAfter, len - 1);
+ var items = new Array(last - first + 1);
+ for (var i = first; i <= last; i++)
+ items[i - first] = this._item(i);
+ return WinJS.Promise.wrap({
+ items: items, offset: countBefore, totalCount: len, absoluteIndex: index
+ })
+ }
+ }, getCount: function () {
+ return WinJS.Promise.wrap(this._array.length)
+ }, insertAtStart: function (key, data) {
+ return this._insert(0, data)
+ }, insertBefore: function (key, data, nextKey, nextIndexHint) {
+ return this._insert(this._indexFromKeyAndHint(nextKey, nextIndexHint), data)
+ }, insertAfter: function (key, data, previousKey, previousIndexHint) {
+ return this._insert(this._indexFromKeyAndHint(previousKey, previousIndexHint) + 1, data)
+ }, insertAtEnd: function (key, data) {
+ return this._insert(this._array.length, data)
+ }, change: function (key, newData, indexHint) {
+ var index = this._indexFromKeyAndHint(key, indexHint);
+ if (isNaN(index))
+ return errorNoLongerMeaningful();
+ this._setAt(index, newData);
+ return WinJS.Promise.wrap()
+ }, moveToStart: function (key, indexHint) {
+ return this._move(this._indexFromKeyAndHint(key, indexHint), 0)
+ }, moveBefore: function (key, nextKey, indexHint, nextIndexHint) {
+ return this._move(this._indexFromKeyAndHint(key, indexHint), this._indexFromKeyAndHint(nextKey, nextIndexHint))
+ }, moveAfter: function (key, previousKey, indexHint, previousIndexHint) {
+ return this._move(this._indexFromKeyAndHint(key, indexHint), this._indexFromKeyAndHint(previousKey, previousIndexHint) + 1)
+ }, moveToEnd: function (key, indexHint) {
+ return this._move(this._indexFromKeyAndHint(key, indexHint), this._array.length)
+ }, remove: function (key, indexHint) {
+ var index = this._indexFromKeyAndHint(key, indexHint);
+ if (isNaN(index))
+ return errorNoLongerMeaningful();
+ if (!this._keyOf) {
+ this._ensureItems();
+ this._items.splice(index, 1)
+ }
+ this._removeAt(index);
+ if (this._keyOf)
+ delete this._keyMap[key];
+ return WinJS.Promise.wrap()
+ }, keyFromIndex: function keyFromIndex(index) {
+ return this._itemKey(index)
+ }, _itemKey: function (index) {
+ if (index < 0 || index >= this._array.length)
+ return null;
+ else if (this._keyOf)
+ return this._keyOf(this._array[index]);
+ else {
+ var item = this._items[index];
+ if (item)
+ return item.key;
+ else
+ return index.toString()
+ }
+ }, _newItem: function (index) {
+ return {
+ key: this._itemKey(index), data: this._array[index]
+ }
+ }, _ensureItems: function () {
+ if (typeof this._nextAvailableKey !== "number") {
+ var len = this._array.length;
+ for (var i = 0; i < len; i++)
+ if (!this._items[i])
+ this._items[i] = this._newItem(i);
+ this._nextAvailableKey = len
+ }
+ }, _item: function (index) {
+ var item;
+ if (this._keyOf) {
+ var data = this._array[index],
+ key = this._keyOf(data);
+ item = this._keyMap[key];
+ if (!item)
+ item = this._keyMap[key] = {
+ key: key, data: data
+ }
+ }
+ else {
+ item = this._items[index];
+ if (!item)
+ item = this._items[index] = this._newItem(index)
+ }
+ return item
+ }, _indexFromKeyAndHint: function (key, indexHint) {
+ var i,
+ min,
+ max;
+ for (i = indexHint, max = Math.min(i + keySearchRange, this._array.length - 1); i <= max; i++)
+ if (this._itemKey(i) === key)
+ return i;
+ for (i = indexHint - 1, min = Math.max(indexHint - keySearchRange, 0); i >= min; i--)
+ if (this._itemKey(i) === key)
+ return i;
+ return NaN
+ }, _insert: function (index, data) {
+ if (isNaN(index))
+ return errorNoLongerMeaningful();
+ if (!this._keyOf)
+ this._ensureItems();
+ this._insertAt(index, data);
+ var item;
+ if (this._keyOf) {
+ var key = this._keyOf(data);
+ item = {
+ key: key, data: data
+ };
+ this._keyMap[key] = item
+ }
+ else {
+ item = {
+ key: (this._nextAvailableKey++).toString(), data: data
+ };
+ this._items.splice(index, 0, item)
+ }
+ return WinJS.Promise.wrap(item)
+ }, _move: function (indexFrom, indexTo) {
+ if (isNaN(indexFrom) || isNaN(indexTo))
+ return errorNoLongerMeaningful();
+ var item,
+ data;
+ if (this._keyOf)
+ data = this._array[indexFrom];
+ else {
+ this._ensureItems();
+ item = this._items.splice(indexFrom, 1)[0];
+ data = item.data
+ }
+ this._removeAt(indexFrom);
+ if (indexFrom < indexTo)
+ indexTo--;
+ this._insertAt(indexTo, data);
+ if (!this._keyOf)
+ this._items.splice(indexTo, 0, item);
+ return WinJS.Promise.wrap()
+ }, _insertAt: function (index, data) {
+ if (this._array.insertAt)
+ this._array.insertAt(index, data);
+ else
+ this._array.splice(index, 0, data)
+ }, _setAt: function (index, data) {
+ if (this._array.setAt)
+ this._array.setAt(index, data);
+ else
+ this._array[index] = data
+ }, _removeAt: function (index) {
+ if (this._array.removeAt)
+ this._array.removeAt(index);
+ else
+ this._array.splice(index, 1)
+ }
+ });
+ var ArrayDataSource = WinJS.Class.derive(WinJS.UI.VirtualizedDataSource, function (array, options) {
+ this._baseDataSourceConstructor(new ArrayDataAdapter(array, options))
+ });
+ var playlistProvider;
+ var mySpace = WinJS.Namespace.define(playlistNamespace, null);
+ var Playback = WinJS.Namespace.define("MS.Entertainment.Platform.Playback");
+ var Factory = WinJS.Namespace.define("MS.Entertainment.Data.Factory");
+ var Query = WinJS.Namespace.define("MS.Entertainment.Data.Query");
+ var Shell = WinJS.Namespace.define("MS.Entertainment.UI.Shell");
+ var converterByMediaType;
+ function initializeConverterByMediaType() {
+ if (converterByMediaType)
+ return;
+ converterByMediaType = {};
+ converterByMediaType[Microsoft.Entertainment.Queries.ObjectType.track] = "track";
+ converterByMediaType[Microsoft.Entertainment.Queries.ObjectType.video] = "video";
+ converterByMediaType[Microsoft.Entertainment.Queries.ObjectType.game] = "gameTrailer";
+ if (MS.Entertainment.Data.MediaBrowser)
+ converterByMediaType[MS.Entertainment.Data.MediaBrowser.ItemType.music] = "musicFile"
+ }
+ var expanderByMediaType;
+ function initializeExpanderByMediaType() {
+ if (expanderByMediaType)
+ return;
+ expanderByMediaType = {};
+ expanderByMediaType[Microsoft.Entertainment.Queries.ObjectType.album] = "album";
+ expanderByMediaType[Microsoft.Entertainment.Queries.ObjectType.person] = "artist";
+ expanderByMediaType[Microsoft.Entertainment.Queries.ObjectType.genre] = "genre";
+ expanderByMediaType[Microsoft.Entertainment.Queries.ObjectType.playlist] = "playlist";
+ if (MS.Entertainment.Data.MediaBrowser)
+ expanderByMediaType[MS.Entertainment.Data.MediaBrowser.ItemType.folder] = "folder"
+ }
+ function localPathToUrl(path, mediaInstanceId) {
+ if (!path)
+ return WinJS.Promise.wrap(null);
+ if (!mediaInstanceId || mediaInstanceId === MS.Entertainment.Utilities.EMPTY_GUID)
+ mediaInstanceId = null;
+ else
+ mediaInstanceId = ("{" + mediaInstanceId + "}").toUpperCase();
+ return Windows.Storage.StorageFile.getFileFromPathAsync(path).then(function (loadedFile) {
+ var url = URL.createObjectURL(loadedFile, { oneTimeOnly: false });
+ return {
+ url: url, mediaInstanceId: mediaInstanceId
+ }
+ })
+ }
+ function servicePathToUrl(path) {
+ if (!path)
+ return WinJS.Promise.wrapError("servicePathToUrl is called with null url");
+ var request = null;
+ var url = path;
+ return new WinJS.Promise(function (c, e, p) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var hostName = (new Windows.Foundation.Uri(url)).host;
+ signIn.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, hostName, false).then(function getTicketCompleted(passportTicket) {
+ request = new XMLHttpRequest;
+ request.onreadystatechange = function () {
+ if (request.readyState === 4) {
+ if (request.status >= 200 && request.status < 300) {
+ var responseHeader = request.getAllResponseHeaders();
+ var response = request.response;
+ var stream = response.msRandomAccessStream;
+ var blob = msWWA.createBlobFromRandomAccessStream(response.type, stream);
+ var url = URL.createObjectURL(blob, { oneTimeOnly: false });
+ if (c)
+ c({
+ url: url, mediaInstanceId: null
+ })
+ }
+ else if (e)
+ e(request);
+ request.onreadystatechange = function () { }
+ }
+ else if (p)
+ p(request)
+ };
+ request.open("GET", url, false);
+ request.responseType = "blob";
+ request.setRequestHeader("Authorization", "WLID1.1 " + passportTicket);
+ request.send(null)
+ })
+ }, function () {
+ if (request)
+ request.abort()
+ })
+ }
+ function waitForSignIn() {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (signInService.isSignedIn)
+ return WinJS.Promise.wrap();
+ else if (signInService.isSigningIn)
+ return new WinJS.Promise(function (c, e, p) {
+ function onIsSigningInChanged(newValue, oldValue) {
+ if (!newValue) {
+ signInService.unbind("isSigningIn", onIsSigningInChanged);
+ if (signInService.isSignedIn)
+ c();
+ else
+ e("sign in failed or canceled")
+ }
+ }
+ signInService.bind("isSigningIn", onIsSigningInChanged)
+ });
+ else
+ return WinJS.Promise.wrapError(Playback.Error.ZEST_E_SIGNIN_REQUIRED)
+ }
+ function getPassportTicket() {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return waitForSignIn().then(function signedIn() {
+ return signInService.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport))
+ })
+ }
+ function shouldRetryForFailure(failure) {
+ var retry = false;
+ var Error = MS.Entertainment.Platform.Playback.Error;
+ if (failure && (failure.number == Error.INET_E_CONNECTION_TIMEOUT.code || failure.number == Error.INET_E_DOWNLOAD_FAILURE.code || failure.number == Error.INET_E_RESOURCE_NOT_FOUND.code))
+ retry = true;
+ return retry
+ }
+ function getValidServiceMediaId(item) {
+ if (!item) {
+ MS.Entertainment.Platform.Playback.fail("Attempted to acquire SMID from null item.");
+ return MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ var serviceMediaId;
+ if (MS.Entertainment.Utilities.isValidServiceId(item.zuneId))
+ serviceMediaId = item.zuneId;
+ else if (MS.Entertainment.Utilities.isValidServiceId(item.serviceId) && item.serviceIdType === MS.Entertainment.Data.Query.edsIdType.zuneCatalog)
+ serviceMediaId = item.serviceId;
+ else
+ MS.Entertainment.Platform.Playback.fail("Failed to acquire a valid SMID from this item: " + "item.zuneId = " + item.zuneId + "item.serviceId = " + item.serviceId + "item.serviceIdType = " + item.serviceIdType);
+ return serviceMediaId || MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ function getPreferredStream(item, context, mediaEntitlements, retriesAttempted) {
+ if (!retriesAttempted)
+ retriesAttempted = 0;
+ return getPreferredStreamInternal(item, context, mediaEntitlements).then(function success(result) {
+ Playback.Etw.traceString("PLST->getPreferredStream: success ");
+ MS.Entertainment.Utilities.Telemetry.logGetPreferredStreamSucceeded(retriesAttempted);
+ return result
+ }, function fail(result) {
+ if (WinJS.Promise.isCanceledError(result)) {
+ Playback.Etw.traceString("PLST->getPreferredStream: canceled");
+ return WinJS.Promise.wrapError(result)
+ }
+ Playback.Etw.traceString("PLST->getPreferredStream: failed with error : " + result);
+ MS.Entertainment.Utilities.Telemetry.logGetPreferredStreamFailed(result, retriesAttempted);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (retriesAttempted < configurationManager.playback.getPreferredStreamRetries && shouldRetryForFailure(result)) {
+ Playback.Etw.traceString("PLST->getPreferredStream: waiting and trying again");
+ return WinJS.Promise.timeout(configurationManager.playback.getPreferredStreamRetryDelayMS).then(function delayedRetry() {
+ return getPreferredStream(item, context, mediaEntitlements, retriesAttempted + 1)
+ })
+ }
+ else {
+ Playback.Etw.traceString("PLST->getPreferredStream: attempt failed but not retrying");
+ return WinJS.Promise.wrapError(result)
+ }
+ })
+ }
+ function getPreferredStreamInternal(item, context, mediaEntitlements, retryCount) {
+ function doGetAssetLocationsAsync() {
+ var skipSubscriptionFiltering = MS.Entertainment.Utilities.isMusicApp2;
+ return MS.Entertainment.Platform.PurchaseHelpers.getAssetLocationsAsync(getValidServiceMediaId(item), item.rights, rightsFilter, false, context, "USE HEADER AUTH NOT PASSPORT TICKET", skipSubscriptionFiltering)
+ }
+ function onTrackingIdObtained(id, obtained) {
+ if (id) {
+ var trackingIdState = MS.Entertainment.Platform.SessionManager.trackingIdState;
+ trackingIdState[id] = "obtained";
+ Playback.Etw.traceString("OBTAINED tracking id: " + id)
+ }
+ }
+ Playback.Etw.traceString("PLST->getPreferredStreamInternal, context: " + context);
+ if (Debug.testHookSimulateGetPreferredStreamFailure) {
+ Playback.Etw.traceString("PLST->getPreferredStreamInternal, simulating failure: " + Debug.testHookSimulateGetPreferredStreamFailure);
+ return WinJS.Promise.wrapError(Debug.testHookSimulateGetPreferredStreamFailure)
+ }
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionMgr._primarySession.isRemoteSessionRunning)
+ context = "User";
+ if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.track) {
+ var assetLocationRequestPromise = null;
+ if (mediaEntitlements && mediaEntitlements.canFullyStream && mediaEntitlements.best.stream.isAvailable) {
+ var requestInfo = {
+ serviceMediaIds: [mediaEntitlements.serviceMediaId], mediaInstanceIds: [mediaEntitlements.best.stream.serviceMediaInstanceId], nativeLicenseRights: [MS.Entertainment.Platform.PurchaseHelpers.LicenseRightMap.fromModernToNative(mediaEntitlements.best.stream.licenseRight)], offerIds: [null]
+ };
+ assetLocationRequestPromise = MS.Entertainment.Platform.PurchaseHelpers.getAssetLocationsUsingRequestInfoAsync(requestInfo, false, context, "USE HEADER AUTH NOT PASSPORT TICKET", true)
+ }
+ else {
+ var rightsFilter = [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Stream];
+ assetLocationRequestPromise = waitForSignIn().then(doGetAssetLocationsAsync, doGetAssetLocationsAsync)
+ }
+ return assetLocationRequestPromise.then(function getAssetLocationsAsync_complete(assetLocations) {
+ if (assetLocations.length === 0) {
+ var error = Playback.Error.X8_E_PLAYBACK_NO_ASSET_LOCATION;
+ if (error === Playback.Error.X8_E_PLAYBACK_NO_ASSET_LOCATION && mediaEntitlements && mediaEntitlements.hasTakeDown)
+ error = Playback.Error.ZEST_E_MW_CONTENT_REVOKED_ON_LABEL_TAKEDOWN;
+ if (error === Playback.Error.X8_E_PLAYBACK_NO_ASSET_LOCATION && mediaEntitlements && mediaEntitlements.subscription && (mediaEntitlements.subscription.isAvailable && !mediaEntitlements.subscription.stream.isAvailable))
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ error = Playback.Error.ZEST_E_ASSET_LICENSE_SUBSCRIPTION_DOWNLOAD_ONLY;
+ else
+ error = Playback.Error.ZEST_E_ASSET_LICENSE_SUBSCRIPTION_NO_STREAM;
+ if (error === Playback.Error.X8_E_PLAYBACK_NO_ASSET_LOCATION && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits) && MS.Entertainment.Music.FreePlayLimits.isFreeStreamingTrack(item)) {
+ var freePlayLimits = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits);
+ if (item.isFreeStreamRestrictedByIndividualLimit)
+ error = Playback.Error.E_MDS_INDIVIDUAL_TRACK_LIMIT;
+ else if (freePlayLimits.isMonthlyFreeLimitExceeded || item.isFreeStreamRestrictedByMonthlyLimit)
+ error = Playback.Error.E_MDS_AUTHENTICATED_TRACK_LIMIT
+ }
+ if (error === Playback.Error.X8_E_PLAYBACK_NO_ASSET_LOCATION) {
+ MS.Entertainment.Platform.Playback.assert(item && item.mediaType && item.mediaType === Microsoft.Entertainment.Queries.ObjectType.track, "expected a track media type");
+ var canBuy = false;
+ var canPreview = false;
+ if (item && item.rights)
+ for (var i = 0; i < item.rights.length; i++) {
+ var right = item.rights[i];
+ if (right.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Purchase || right.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.AlbumPurchase)
+ canBuy = true;
+ if (right.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Preview)
+ canPreview = true;
+ if (canBuy && canPreview)
+ break
+ }
+ if (canBuy)
+ error = Playback.Error.ZEST_E_ASSET_LICENSE_RIGHT_NOT_OWNED;
+ else if (canPreview)
+ error = Playback.Error.X8_E_PREVIEW_ONLY_DONOT_PLAY_IN_PLAYLIST
+ }
+ Playback.Etw.traceString("PLST->getAssetLocationsAsync_complete with error: " + error.name);
+ return WinJS.Promise.wrapError(error)
+ }
+ Playback.Etw.traceString("PLST<-getPreferredStreamInternal");
+ onTrackingIdObtained(assetLocations[0].trackingId);
+ return WinJS.Promise.wrap({
+ url: assetLocations[0].assetUrl, mediaInstanceId: assetLocations[0].mediaInstanceId, nativeLicenseRight: assetLocations[0].nativeLicenseRight, offerId: assetLocations[0].offerId, trackingId: assetLocations[0].trackingId
+ })
+ }, function getAssetLocationsAsync_error(error) {
+ Playback.Etw.traceString("PLST->getAssetLocationsAsync_error: " + error);
+ if (!isNetworkAvailable() && !WinJS.Promise.isCanceledError(error))
+ error = Playback.Error.NS_E_WMPIM_USEROFFLINE;
+ else if (error && error.number && error.number === MS.Entertainment.Platform.Playback.Error.ZUNE_E_PASSPORT_TICKET_SIGNIN_REQUIRED.code)
+ if (!retryCount) {
+ Playback.Etw.traceString("PLST->getAssetLocationsAsync sign-in error - wait for sign-in and retry");
+ return waitForSignIn().then(function retry() {
+ return getPreferredStreamInternal(item, context, mediaEntitlements, 1)
+ })
+ }
+ return WinJS.Promise.wrapError(error)
+ })
+ }
+ else
+ return getPassportTicket().then(function got_ticket(ticket) {
+ function getPreferredStreamInfoAsync(ticket, serviceId) {
+ var assetLocationRequest = new Microsoft.Entertainment.Common.Service.Requests.Mds.Video.AssetLocationRequest;
+ assetLocationRequest.serviceMediaId = serviceId;
+ assetLocationRequest.intendedUse = Microsoft.Entertainment.Common.Service.Requests.Mds.Video.IntendedUse.stream;
+ return assetLocationRequest.sendAsync().then(function getAssetLocationAsync_complete(assetLocationResponse) {
+ var videoEncoding = Microsoft.Entertainment.Marketplace.VideoEncoding.unknown;
+ if (assetLocationResponse.body.encoding === Microsoft.Entertainment.Common.Service.Requests.Mds.Video.Encoding.h264)
+ videoEncoding = Microsoft.Entertainment.Marketplace.VideoEncoding.h264;
+ else if (assetLocationResponse.body.encoding === Microsoft.Entertainment.Common.Service.Requests.Mds.Video.Encoding.vc1)
+ videoEncoding = Microsoft.Entertainment.Marketplace.VideoEncoding.vc1;
+ return WinJS.Promise.wrap({
+ url: assetLocationResponse.body.url, licenseKeyId: assetLocationResponse.body.licenseKeyId, signedLicensePolicyTicket: assetLocationResponse.body.signedLicensePolicyTicket, mediaInstanceId: assetLocationResponse.body.serviceMediaInstanceId, offerId: assetLocationResponse.body.offerId, videoEncoding: videoEncoding
+ })
+ })
+ }
+ var serviceId = getValidServiceMediaId(item);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return Microsoft.Entertainment.Marketplace.Marketplace.getMediaEntitlementsAsync([serviceId]).then(function onComplete(mediaEntitlementResult) {
+ try {
+ mediaEntitlements = JSON.parse(mediaEntitlementResult).result.entitlements[0]
+ }
+ catch (e) {
+ mediaEntitlements = null
+ }
+ if (mediaEntitlements && mediaEntitlements.canFullyStream)
+ return getPreferredStreamInfoAsync(ticket, serviceId);
+ else if (item.rights) {
+ var offerIds = [];
+ for (var i = 0; i < item.rights.length; i++)
+ if (item.rights[i].offerId)
+ offerIds.push(item.rights[i].offerId);
+ return MS.Entertainment.UI.PurchaseHistoryService.refreshVideoOffersAsync(offerIds).then(function onComplete(result) {
+ return getPreferredStreamInfoAsync(ticket, serviceId)
+ }, function onError(error) {
+ Playback.Etw.traceString("PLST->refreshAsync() error = " + MS.Entertainment.Utilities.stringify(error));
+ return getPreferredStreamInfoAsync(ticket, serviceId)
+ })
+ }
+ else
+ return WinJS.Promise.wrapError(Playback.Error.ZEST_E_ASSET_ITEM_NOT_PURCHASED)
+ }, function onError(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ })
+ }
+ function isNetworkAvailable() {
+ try {
+ return MS.Entertainment.UI.NetworkStatusService.isOnline()
+ }
+ catch (ex) {
+ MS.Entertainment.Platform.Playback.fail("Exception in isNetworkAvailable, make sure uiState service has been registered prior playback attempt: " + MS.Entertainment.Utilities.stringify(ex));
+ return true
+ }
+ }
+ function itemToUrl(item, context) {
+ Playback.Etw.traceString("PLST->itemToUrl");
+ if (!item)
+ return WinJS.Promise.wrap(null);
+ var mediaStore = null;
+ var provider = null;
+ var preferredFile;
+ switch (item.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ provider = mediaStore.videoProvider;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ provider = mediaStore.trackProvider;
+ break;
+ default:
+ return WinJS.Promise.wrapError("Unexpected media type")
+ }
+ var mediaEntitlements = null;
+ function internalItemToUrl() {
+ var urlPromise;
+ var localPath = null;
+ var protectionState = Playback.ProtectionState.unknown;
+ if (preferredFile)
+ switch (preferredFile.type) {
+ case Microsoft.Entertainment.Platform.FileUrlType.localFileUrl:
+ urlPromise = localPathToUrl(preferredFile.url, preferredFile.mediaInstanceId);
+ localPath = preferredFile.url;
+ if (preferredFile.protection) {
+ switch (preferredFile.protection) {
+ case Microsoft.Entertainment.Platform.ProtectionState.protected:
+ protectionState = Playback.ProtectionState.drmProtected;
+ break;
+ case Microsoft.Entertainment.Platform.ProtectionState.unprotected:
+ protectionState = Playback.ProtectionState.unprotected;
+ break;
+ case Microsoft.Entertainment.Platform.ProtectionState.unknown:
+ protectionState = Playback.ProtectionState.unknown;
+ break;
+ default:
+ MS.Entertainment.Platform.Playback.assert(false, "getPreferredFileUrlAsync returned invalid protectionState");
+ break
+ }
+ if (MS.Entertainment.Utilities.isVideoApp1 && !MS.Entertainment.Utilities.isWindowsBlue)
+ protectionState = Playback.ProtectionState.drmProtected
+ }
+ break;
+ case Microsoft.Entertainment.Platform.FileUrlType.serviceFileUrl:
+ MS.Entertainment.Platform.Playback.assert(!!preferredFile.url, "Fix it: provider.getPreferredFileUrlAsync returned null serviceFileUrl in success completion");
+ urlPromise = servicePathToUrl(preferredFile.url);
+ protectionState = Playback.ProtectionState.unprotected;
+ break;
+ case Microsoft.Entertainment.Platform.FileUrlType.marketPlaceFileUrl:
+ urlPromise = getPreferredStream(item, context, mediaEntitlements);
+ protectionState = Playback.ProtectionState.unknown;
+ break;
+ case Microsoft.Entertainment.Platform.FileUrlType.remoteMachineFileUrl:
+ urlPromise = WinJS.Promise.wrapError(Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_NOT_LOCAL);
+ protectionState = Playback.ProtectionState.unknown;
+ break;
+ default:
+ urlPromise = getPreferredStream(item, context, mediaEntitlements);
+ protectionState = Playback.ProtectionState.drmProtected;
+ item.filePath = null;
+ break
+ }
+ else if (item.filePath && item.filePath.substr(0, 5) === "zest:") {
+ urlPromise = getPreferredStream(item, context, mediaEntitlements);
+ protectionState = Playback.ProtectionState.drmProtected
+ }
+ else if (item.filePath) {
+ urlPromise = localPathToUrl(item.filePath);
+ localPath = item.filePath;
+ protectionState = Playback.ProtectionState.unknown
+ }
+ else {
+ urlPromise = getPreferredStream(item, context, mediaEntitlements);
+ protectionState = Playback.ProtectionState.drmProtected
+ }
+ Playback.Etw.traceString("PLST->computeURL");
+ return urlPromise.then(function urlPromiseComplete(result) {
+ Playback.Etw.traceString("PLST<-computeURL");
+ if (localPath) {
+ if (!(item.filePath && item.filePath === localPath))
+ item.filePath = localPath;
+ if (protectionState !== Playback.ProtectionState.unknown) {
+ Playback.Etw.traceString("PLST-localPath protection state returned from DB: " + protectionState);
+ return WinJS.Promise.wrap({
+ url: result.url, mediaInstanceId: result.mediaInstanceId, nativeLicenseRight: null, offerId: null, isLocal: true, trackingId: result.trackingId, protectionState: protectionState
+ })
+ }
+ else {
+ Playback.Etw.traceString("PLST->localPath protection state");
+ return Windows.Storage.StorageFile.getFileFromPathAsync(localPath).then(function getFileFromPathAsync(storageFile) {
+ var extraProps = [];
+ extraProps.push("System.DRM.IsProtected");
+ return storageFile.properties.retrievePropertiesAsync(extraProps).then(function retrievePropertiesAsync(extraPropsResult) {
+ var isProtected = extraPropsResult.lookup("System.DRM.IsProtected");
+ if (isProtected)
+ protectionState = Playback.ProtectionState.drmProtected;
+ else
+ protectionState = Playback.ProtectionState.unprotected;
+ Playback.Etw.traceString("PLST<-localPath protection state");
+ return WinJS.Promise.wrap({
+ url: result.url, mediaInstanceId: result.mediaInstanceId, nativeLicenseRight: null, offerId: null, isLocal: true, trackingId: result.trackingId, protectionState: protectionState
+ })
+ })
+ })
+ }
+ }
+ else {
+ MS.Entertainment.Platform.Playback.assert(!!result, "Fix it: urlPromise in itemToUrl should not call into success handler with null or undefined result! Check corresponding urlPromise returning function behavior");
+ if (!result)
+ return WinJS.Promise.wrapError("itemToUrl: unexpected failure in urlPromise sucessful completion");
+ if (protectionState === Playback.ProtectionState.unknown)
+ if (result.url && result.url.toLowerCase().indexOf(".mp3") !== -1)
+ protectionState = Playback.ProtectionState.unprotected;
+ else
+ protectionState = Playback.ProtectionState.drmProtected;
+ return WinJS.Promise.wrap({
+ url: result.url, mediaInstanceId: result.mediaInstanceId, nativeLicenseRight: result.nativeLicenseRight, licenseKeyId: result.licenseKeyId, signedLicensePolicyTicket: result.signedLicensePolicyTicket, offerId: result.offerId, isLocal: false, trackingId: result.trackingId, protectionState: protectionState, videoEncoding: result.videoEncoding
+ })
+ }
+ }, function urlPromiseError(error) {
+ Playback.Etw.traceString("PLST<-computeURLError");
+ return WinJS.Promise.wrapError(error)
+ })
+ }
+ var getMediaEntitlementsPromise = function itemToUrl_getMediaEntitlements() {
+ if (!item.canPlayLocally && (item.hasZuneId && item.mediaType === Microsoft.Entertainment.Queries.ObjectType.track))
+ return Microsoft.Entertainment.Marketplace.Marketplace.getMediaEntitlementsAsync([item.zuneId]).then(function itemToUrl_getMediaEntitlementsAsync_complete(result) {
+ mediaEntitlements = JSON.parse(result).result.entitlements[0];
+ return internalItemToUrl()
+ }, function itemToUrl_getMediaEntitlementsAsync_error() {
+ return internalItemToUrl()
+ });
+ else
+ return internalItemToUrl()
+ };
+ var hydrationPromise = function itemToUrl_hydrate() {
+ var shouldHydrate = (!item.hydrated || item.isFailed) && isNetworkAvailable();
+ if (shouldHydrate && item.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ if (preferredFile.type === Microsoft.Entertainment.Platform.FileUrlType.localFileUrl) {
+ Playback.Etw.traceString("PLST::itemToUrl_hydrate skipping hydrate for local track");
+ shouldHydrate = false
+ }
+ else if (preferredFile.type === Microsoft.Entertainment.Platform.FileUrlType.marketPlaceFileUrl && item.inCollection && item.hasZuneId) {
+ Playback.Etw.traceString("PLST::itemToUrl_hydrate skipping hydrate for in collection marketplace track");
+ shouldHydrate = false
+ }
+ if (shouldHydrate) {
+ item = MS.Entertainment.ViewModels.MediaItemModel.augment(item);
+ return item.hydrate({ forceUpdate: true }).then(getMediaEntitlementsPromise, getMediaEntitlementsPromise)
+ }
+ else
+ return getMediaEntitlementsPromise()
+ };
+ Playback.Etw.traceString("PLST->getPreferredFileUrlAsync. item.libraryId = " + item.libraryId);
+ return provider.getPreferredFileUrlAsync(item.libraryId).then(function (result) {
+ Playback.Etw.traceString("PLST<-getPreferredFileUrlAsync");
+ preferredFile = result;
+ return hydrationPromise()
+ }, function handleError(e) {
+ var s = "PLST<-getPreferredFileUrlAsync Error : " + e + " hr = " + Playback.errorToString(e.number);
+ Playback.Etw.traceString(s);
+ return WinJS.Promise.wrapError(e)
+ })
+ }
+ function createMediaInstance(itemData) {
+ return Playback.MediaInstance.createInstanceAsync(itemData)
+ }
+ function queryPreviewRights(item, mediaType) {
+ var queryDetailPromise = WinJS.Promise.wrap(null);
+ if (!item.data.rights)
+ queryDetailPromise = MS.Entertainment.Platform.PurchaseHelpers.queryMediaDetailForCacheItemAsync(item, mediaType);
+ return queryDetailPromise.then(function queryMediaDetailForCacheItemAsync_complete(detail) {
+ var rights = (detail && detail.result && detail.result.item) ? detail.result.item.rights : item.data.rights;
+ var zuneId = (detail && detail.result && detail.result.zuneId) ? detail.result.item.zuneId : item.data.zuneId;
+ if (!zuneId)
+ zuneId = (detail && detail.result && detail.result.serviceId) ? detail.result.item.serviceId : item.data.serviceId;
+ var right;
+ if (rights)
+ right = MS.Entertainment.Platform.PurchaseHelpers.getPreferredRight(rights, [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.PreviewStream, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Preview]);
+ if (right)
+ if (mediaType === Microsoft.Entertainment.Queries.ObjectType.video) {
+ right.previewUrl = right.videoFileUrl;
+ return WinJS.Promise.wrap(right)
+ }
+ else
+ return MS.Entertainment.Platform.PurchaseHelpers.getAssetLocationsAsync(zuneId, [right]).then(function getAssetLocationsAsync_complete(assetLocations) {
+ if (assetLocations.length === 0)
+ return WinJS.Promise.wrapError("No PreviewStream or Preview license right found for " + ((item.data) ? item.data.name : item.name));
+ right.previewUrl = assetLocations[0].assetUrl;
+ return WinJS.Promise.wrap(right)
+ }, function getAssetLocations_error(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ if (!isNetworkAvailable())
+ error = MS.Entertainment.Platform.Playback.makePlaybackError(Playback.Error.NS_E_WMPIM_USEROFFLINE, "getAssetLocations_error");
+ return WinJS.Promise.wrapError(error)
+ });
+ else
+ return WinJS.Promise.wrapError("No PreviewStream or Preview license right found for this item")
+ })
+ }
+ function createMusicVideoInstanceAsync(item, ordinal, startPosition, context, playPreviewOnly) {
+ if (!item.data.musicVideo)
+ return WinJS.Promise.wrapError("No music video available to hydrate");
+ return waitForSignIn().then(function signed_in() {
+ return item.data.musicVideo.hydrate().then(function gotMusicVideo(musicVideo) {
+ var dynamicItem = {
+ key: item.key, data: musicVideo, trackItem: item
+ };
+ return mediaInstanceFactory.musicVideo(dynamicItem, ordinal, startPosition, context, playPreviewOnly)
+ }, function got_MusicVideoDetailsError(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ return WinJS.Promise.wrapError(new Error("MusicVideo hydration failure " + MS.Entertainment.Utilities.stringify(error)));
+ else
+ return WinJS.Promise.wrapError(error)
+ })
+ })
+ }
+ var audioVideoInstanceFactory = function audioVideoInstanceFactory(item, ordinal, startPosition, mediaType, context, playPreviewOnly, ignoreMusicVideos) {
+ if (MS.Entertainment.Utilities.isMusicApp2 && MS.Entertainment.Platform.Playback._isMusicVideoModeInEffect && !ignoreMusicVideos && mediaType === Microsoft.Entertainment.Queries.ObjectType.track && item.data.hasMusicVideoId)
+ return createMusicVideoInstanceAsync(item, ordinal, startPosition, context, playPreviewOnly).then(function createMusicVideoInstanceAsync_success(instance) {
+ return instance
+ }, function createMusicVideoInstanceAsync_error(error) {
+ Playback.Etw.traceString("audioVideoInstanceFactory::createMusicVideoInstanceAsync failed: " + MS.Entertainment.Utilities.stringify(error));
+ if (!WinJS.Promise.isCanceledError(error))
+ return audioVideoInstanceFactory(item, ordinal, startPosition, mediaType, context, playPreviewOnly, true);
+ else
+ return WinJS.Promise.wrapError(error)
+ });
+ function createPreviewMediaInstance() {
+ Playback.Etw.traceString("+PLST::audioVideoInstanceFactory():createPreviewMediaInstance");
+ function GetPreviewMediaInstanceUrl() {
+ return item.data.videoPreviewUrl;
+ Playback.Etw.traceString("-PLST::audioVideoInstanceFactory():createPreviewMediaInstance")
+ }
+ if (item.data.hasCanonicalId && item.data.videoPreviewUrl) {
+ Playback.Etw.traceString("-PLST::audioVideoInstanceFactory():createPreviewMediaInstance for video preview");
+ return createMediaInstance({
+ source: GetPreviewMediaInstanceUrl(), isLocal: false, mediaInstanceId: null, nativeLicenseRight: null, offerId: null, cookie: ordinal, mediaItem: item, mediaType: mediaType, protectionState: Playback.ProtectionState.unprotected, startPosition: startPosition
+ })
+ }
+ else
+ return queryPreviewRights(item, mediaType).then(function gotPreview(right) {
+ if (!right) {
+ Playback.Etw.traceString("-PLST::audioVideoInstanceFactory():createPreviewMediaInstance::gotPreview returning null");
+ return null
+ }
+ Playback.Etw.traceString("-PLST::audioVideoInstanceFactory():createPreviewMediaInstance::gotPreview");
+ return createMediaInstance({
+ source: right.previewUrl, isLocal: false, mediaInstanceId: right.mediaInstanceId, nativeLicenseRight: MS.Entertainment.Platform.PurchaseHelpers.LicenseRightMap.toNative(right.licenseRight), offerId: null, cookie: ordinal, mediaItem: item, mediaType: mediaType, protectionState: Playback.ProtectionState.unprotected, startPosition: startPosition
+ })
+ }, function gotNoPreview(error) {
+ Playback.Etw.traceString("-PLST::audioVideoInstanceFactory():createPreviewMediaInstance. gotNoPreview");
+ return WinJS.Promise.wrapError(error)
+ })
+ }
+ function handleErrorMediaInstance(error, context) {
+ if (WinJS.Promise.isCanceledError(error)) {
+ Playback.Etw.traceString("Playlist::handleErrorMediaInstance: mediaInstance conversion canceled");
+ return WinJS.Promise.wrapError(error)
+ }
+ var playbackError = Playback.makePlaybackError(error, context);
+ return createMediaInstance({
+ cookie: ordinal, error: playbackError, mediaItem: item, mediaType: mediaType
+ })
+ }
+ if (playPreviewOnly)
+ return createPreviewMediaInstance();
+ else if (item.data.inCollection) {
+ Playback.Etw.traceString("PLST->audioVideoInstanceFactory(): Item is in user's collection. Following collection resolution path (itemToUrl)");
+ return itemToUrl(item.data, context).then(function foundInYourCollection(result) {
+ Playback.Etw.traceString("PLST<-itemToUrl");
+ return createMediaInstance({
+ source: result.url, mediaInstanceId: result.mediaInstanceId, nativeLicenseRight: result.nativeLicenseRight, licenseKeyId: result.licenseKeyId, signedLicensePolicyTicket: result.signedLicensePolicyTicket, offerId: result.offerId, isLocal: result.isLocal, cookie: ordinal, mediaItem: item, mediaType: mediaType, protectionState: result.protectionState, trackingId: result.trackingId, startPosition: startPosition, videoEncoding: result.videoEncoding
+ })
+ }, function notFoundInYourCollection(error) {
+ Playback.Etw.traceString("PLST<-itemToUrl error: " + error);
+ return handleErrorMediaInstance(error, "itemToUrl")
+ })
+ }
+ else if (item.data.filePath && item.data.filePath !== String.empty) {
+ Playback.Etw.traceString("PLST->audioVideoInstanceFactory(): item.data.filePath is non-null");
+ return createMediaInstance({
+ source: item.data.filePath, mediaInstanceId: null, nativeLicenseRight: null, offerId: null, isLocal: true, cookie: ordinal, mediaItem: item, mediaType: mediaType, protectionState: Playback.ProtectionState.unknown, startPosition: startPosition
+ })
+ }
+ else if (MS.Entertainment.Utilities.isAmsterdamApp) {
+ var isMediaLocal = function isMediaLocal(fileItem) {
+ var result = true;
+ if (fileItem.path && fileItem.path.toUpperCase().indexOf("\\\\?\\STORAGE") !== 0)
+ result = false;
+ return result
+ };
+ var isLocal = true;
+ var mediaSource = null;
+ if (item.data.mediaType === MS.Entertainment.Data.MediaBrowser.ItemType.music) {
+ isLocal = isMediaLocal(item.data);
+ mediaSource = URL.createObjectURL(MS.Entertainment.Data.deflate(item.data), { oneTimeOnly: false })
+ }
+ else {
+ isLocal = isMediaLocal(item.data.fileItem);
+ mediaSource = URL.createObjectURL(item.data.fileItem, { oneTimeOnly: false })
+ }
+ return createMediaInstance({
+ source: mediaSource, mediaInstanceId: null, nativeLicenseRight: null, offerId: null, isLocal: isLocal, cookie: ordinal, mediaItem: item, mediaType: mediaType, protectionState: Playback.ProtectionState.unprotected, startPosition: startPosition
+ })
+ }
+ else if (item.data.fileItem) {
+ Playback.Etw.traceString("PLST->audioVideoInstanceFactory(): item.data.fileItem is non-null");
+ return createMediaInstance({
+ source: URL.createObjectURL(item.data.fileItem, { oneTimeOnly: false }), mediaInstanceId: null, nativeLicenseRight: null, offerId: null, isLocal: true, cookie: ordinal, mediaItem: item, mediaType: mediaType, protectionState: Playback.ProtectionState.unknown, startPosition: startPosition
+ })
+ }
+ else {
+ Playback.Etw.traceString("PLST->audioVideoInstanceFactory(): Item is not in the user's collection. Following non-collection resolution path.");
+ var getMediaEntitlementsPromise = (!item.data.hasZuneId || item.data.mediaType !== Microsoft.Entertainment.Queries.ObjectType.track) ? WinJS.Promise.wrap(null) : Microsoft.Entertainment.Marketplace.Marketplace.getMediaEntitlementsAsync([item.data.zuneId]).then(function audioVideoInstanceFactory_getMediaEntitlementsAsync_complete(result) {
+ return JSON.parse(result).result.entitlements[0]
+ }, function audioVideoInstanceFactory_getMediaEntitlementsAsync_error() {
+ return null
+ });
+ return getMediaEntitlementsPromise.then(function audioVideoInstanceFactory_getMediaEntitlementsPromise_complete(mediaEntitlements) {
+ if (item.data.isExplicit && !item.data.inCollection) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!signedInUser.xuid) {
+ var error = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_LOGON_TO_PLAY_EXPLICIT_CONTENT_PRE_ASSET_LOCATION;
+ Playback.Etw.traceString("PLST<-getPreferredStream error: " + error);
+ return handleErrorMediaInstance(error, "audioVideoInstanceFactory_getMediaEntitlementsPromise_complete_notSignedInExplicit")
+ }
+ else if (!signedInUser.hasExplicitPrivilege) {
+ var error = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_EXPLICIT_CONTENT_PLAY_BLOCKED_PRE_ASSET_LOCATION;
+ Playback.Etw.traceString("PLST<-getPreferredStream error: " + error);
+ return handleErrorMediaInstance(error, "audioVideoInstanceFactory_getMediaEntitlementsPromise_complete_noExplicitPrivilege")
+ }
+ }
+ return getPreferredStream(item.data, context, mediaEntitlements).then(function gotStream(result) {
+ var streamProtection = Playback.ProtectionState.drmProtected;
+ var uri = new Windows.Foundation.Uri(result.url);
+ if (uri.extension === ".mp3")
+ streamProtection = Playback.ProtectionState.unprotected;
+ return createMediaInstance({
+ source: result.url, mediaInstanceId: result.mediaInstanceId, nativeLicenseRight: result.nativeLicenseRight, licenseKeyId: result.licenseKeyId, signedLicensePolicyTicket: result.signedLicensePolicyTicket, offerId: result.offerId, trackingId: result.trackingId, isLocal: false, cookie: ordinal, mediaItem: item, mediaType: mediaType, protectionState: streamProtection, startPosition: startPosition
+ })
+ }, function noStreamForYou(error) {
+ if (item.data.enableFallbackToPreview) {
+ Playback.Etw.traceString("PLST<-getPreferredStream falls back to preview: " + error);
+ return createPreviewMediaInstance()
+ }
+ else {
+ Playback.Etw.traceString("PLST<-getPreferredStream error: " + error);
+ return handleErrorMediaInstance(error, "getPreferredStream")
+ }
+ })
+ }, function noStreamForYou(error) {
+ Playback.Etw.traceString("PLST<-getPreferredStream error: " + error);
+ return handleErrorMediaInstance(error, "getMediaEntitlementsPromise")
+ })
+ }
+ };
+ function isPreviewOnly(item) {
+ var playPreviewOnly = false;
+ if (item && item.data)
+ playPreviewOnly = item.data.playPreviewOnly;
+ if (item && MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(item.data) && MS.Entertainment.Utilities.isMusicApp2 && !MS.Entertainment.isAppModeOverride) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.playback.previewOnly) {
+ playPreviewOnly = playPreviewOnly || (Microsoft.Media.PlayReadyClient.PlayReadyStatics.playReadyCertificateSecurityLevel !== 2000);
+ if (playPreviewOnly && item && item.data && ((item.data.fromCollection && item.data.canPurchaseStream) || item.data.hasPurchased || (item.data.filePath && (item.data.filePath.indexOf("blob:") === 0))))
+ playPreviewOnly = false
+ }
+ }
+ return playPreviewOnly
+ }
+ { };
+ var mediaInstanceFactory = {
+ track: function mediaInstanceFactory_track(item, ordinal, startPosition, context) {
+ var hydrateCompleted = function hydrateCompleted(error) {
+ if (WinJS.Promise.isCanceledError(error)) {
+ Playback.Etw.traceString("mediaInstanceFactory::Track: hydration canceled");
+ return WinJS.Promise.wrapError(error)
+ }
+ Playback.Etw.traceString("PLST::mediaInstanceFactory::Track: <-MediaItemModel.hydrateLibraryInfoAsync()");
+ var playPreviewOnly = isPreviewOnly(item);
+ if ((!item.data.hasRights && item.data.hasAssetLocationId && (!item.data.inCollection || playPreviewOnly)) || (item.data.hasAssetLocationId && MS.Entertainment.Utilities.isMusicApp2 && !item.data.hasMusicVideoId)) {
+ if (!isNetworkAvailable())
+ return WinJS.Promise.wrapError(Playback.Error.NS_E_WMPIM_USEROFFLINE);
+ var q = new Query.Music.SongDetails;
+ q.id = item.data.assetLocationId;
+ q.idType = item.data.serviceIdType;
+ q.impressionGuid = item.data.impressionGuid;
+ if (item.data.acquisitionData && item.data.acquisitionData.acquisitionContext && item.data.acquisitionData.acquisitionContextType) {
+ var acquisitionAdditionalContext = item.data.acquisitionData.acquisitionAdditionalContext || item.data.playlistName || String.empty;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(item.data.acquisitionData.acquisitionContext, item.data.acquisitionData.acquisitionContextType, item.data.acquisitionData.acquisitionContextID, acquisitionAdditionalContext)
+ }
+ Playback.Etw.traceString("PLST::mediaInstanceFactory::track: ->q.execute()");
+ return q.execute().then(function trackQueryCompleted(completedQuery) {
+ Playback.Etw.traceString("PLST::mediaInstanceFactory::track: <-q.execute()");
+ var marketplaceItem = null;
+ if (completedQuery && completedQuery.result) {
+ marketplaceItem = completedQuery.result;
+ if (marketplaceItem.data && item && item.data) {
+ marketplaceItem.data.enableFallbackToPreview = item.data.enableFallbackToPreview;
+ marketplaceItem.data.playPreviewOnly = item.data.playPreviewOnly;
+ if (item.data.playlistId >= 0) {
+ marketplaceItem.data.playlistId = item.data.playlistId;
+ marketplaceItem.data.playlistName = item.data.playlistName;
+ marketplaceItem.data.playlistCloudSyncId = item.data.playlistCloudSyncId
+ }
+ else if (item.data.acquisitionData && item.data.acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.playlist) {
+ marketplaceItem.data.playlistName = item.data.acquisitionData.acquisitionAdditionalContext;
+ marketplaceItem.data.playlistCloudSyncId = item.data.acquisitionData.acquisitionContextID
+ }
+ }
+ else {
+ Playback.Etw.traceString("PLST:mediaInstanceFactory_track details call failed for " + (item && item.data ? item.data.assetLocationId : "undefined"));
+ marketplaceItem = item
+ }
+ }
+ return audioVideoInstanceFactory(marketplaceItem, ordinal, startPosition, Microsoft.Entertainment.Queries.ObjectType.track, context, playPreviewOnly)
+ })
+ }
+ else
+ return audioVideoInstanceFactory(item, ordinal, startPosition, Microsoft.Entertainment.Queries.ObjectType.track, context, playPreviewOnly)
+ };
+ Playback.Etw.traceString("PLST::mediaInstanceFactory::Track: ->MediaItemModel.hydrateLibraryInfoAsync()");
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(item.data).then(hydrateCompleted, hydrateCompleted)
+ }, video: function mediaInstanceFactory_video(item, ordinal, startPosition, context) {
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(item.data || item))
+ return mediaInstanceFactory.musicVideo(item, ordinal, startPosition, context);
+ var playPreviewOnly = false;
+ if (item && item.data)
+ playPreviewOnly = item.data.playPreviewOnly;
+ Playback.Etw.traceString("PLST::mediaInstanceFactory::Video: playPreviewOnly = [" + playPreviewOnly + "]");
+ return audioVideoInstanceFactory(item, ordinal, startPosition, Microsoft.Entertainment.Queries.ObjectType.video, context, playPreviewOnly)
+ }, musicVideo: function mediaInstanceFactory_musicVideo(item, ordinal, startPosition, context, playPreviewOnlySet) {
+ Playback.Etw.traceString("PLST::mediaInstanceFactory::MusicVideo: playPreviewOnlySet = [" + playPreviewOnlySet || false + "]");
+ return waitForSignIn().then(function musicVideo_goodToGo() {
+ var playPreviewOnly = !!playPreviewOnlySet;
+ var rightsFilter;
+ if (item && item.data && !playPreviewOnly)
+ playPreviewOnly = isPreviewOnly(item);
+ rightsFilter = playPreviewOnly ? [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Preview] : [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Stream, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Preview];
+ return item.data.hydrate({ forceUpdate: item.data.fromCollection }).then(function musicVideoHydrationCompleted(musicVideo) {
+ var rights = musicVideo.rights;
+ return MS.Entertainment.Platform.PurchaseHelpers.getAssetLocationsAsync(musicVideo.canonicalId, rights, rightsFilter, false, context, "USE HEADER AUTH NOT PASSPORT TICKET")
+ }).then(function createMusicVideoMediaInstance(result) {
+ if (!result || (Array.isArray(result) && (result.length === 0 || !result[0].assetUrl)))
+ return WinJS.Promise.wrapError(new Error("Music Video getAssetLocationsAsync failure"));
+ return createMediaInstance({
+ source: result[0].assetUrl, isLocal: false, mediaInstanceId: result[0].mediaInstanceId, nativeLicenseRight: result[0].nativeLicenseRight, offerId: null, cookie: ordinal, mediaItem: item, mediaType: Microsoft.Entertainment.Queries.ObjectType.video, protectionState: !result[0].nativeLicenseRight ? Playback.ProtectionState.unprotected : Playback.ProtectionState.unknown, startPosition: !startPosition ? 0 : startPosition
+ })
+ })
+ })
+ }, playlistMediaItem: function mediaInstanceFactory_playlistMediaItem(item, ordinal, startPosition, context) {
+ var converterFn = null;
+ switch (item.data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ converterFn = this.track;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ converterFn = this.video;
+ break
+ }
+ if (converterFn)
+ return converterFn(item, ordinal, startPosition);
+ else
+ return WinJS.Promise.wrapError("No support for this mediaType yet - " + item.data.mediaType)
+ }, musicFile: function mediaInstanceFactory_file(item, ordinal, startPosition, context) {
+ return audioVideoInstanceFactory(item, ordinal, startPosition, Microsoft.Entertainment.Queries.ObjectType.track, context, false)
+ }
+ };
+ var mediaItemExpansion = {
+ album: function (data) {
+ var q;
+ if (data.inCollection && data.fromCollection) {
+ q = new Query.libraryTracks;
+ q.albumId = data.libraryId;
+ q.mediaAvailability = data._mediaAvailability;
+ q.sort = Microsoft.Entertainment.Queries.TracksSortBy.numberAscending;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.album, MS.Entertainment.Utilities.isValidServiceId(data.canonicalId) ? data.canonicalId : String.empty);
+ return WinJS.Promise.wrap(q)
+ }
+ else {
+ q = new Query.Music.AlbumWithTracks;
+ if (data.hasCanonicalId) {
+ q.id = data.canonicalId;
+ q.idType = MS.Entertainment.Data.Query.edsIdType.canonical
+ }
+ else {
+ q.id = data.serviceId;
+ q.idType = data.serviceIdType
+ }
+ q.impressionGuid = data.impressionGuid;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.album, MS.Entertainment.Utilities.isValidServiceId(data.canonicalId) ? data.canonicalId : String.empty);
+ return q.execute().then(function albumQueryCompleted(queryResult) {
+ if (!queryResult.result)
+ return WinJS.Promise.wrapError("query null results");
+ var tracks = queryResult.result.item.tracks;
+ if (tracks) {
+ tracks.playPreviewOnly = !!data.playPreviewOnly;
+ tracks.enableFallbackToPreview = !!data.enableFallbackToPreview;
+ return tracks.forEachAll(function () { }).then(function () {
+ return tracks
+ }, function handlerError(error) {
+ MS.Entertainment.Platform.Playback.fail("track.forEachAll has failed during album expansion. error " + (error && error.message));
+ return []
+ })
+ }
+ else
+ return tracks
+ })
+ }
+ }, artist: function (data) {
+ var q;
+ if (data.inCollection && data.fromCollection) {
+ q = new Query.libraryTracks;
+ q.artistId = data.libraryId;
+ q.mediaAvailability = data._mediaAvailability;
+ q.sort = Microsoft.Entertainment.Queries.TracksSortBy.artistAscendingAlbumReleaseYearDescendingNumberAscending;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist, MS.Entertainment.Utilities.isValidServiceId(data.canonicalId) ? data.canonicalId : String.empty);
+ return WinJS.Promise.wrap(q)
+ }
+ else {
+ q = new Query.Music.ArtistTopSongs;
+ q.hasTotalCount = true;
+ if (data.hasCanonicalId) {
+ q.id = data.canonicalId;
+ q.idType = MS.Entertainment.Data.Query.edsIdType.canonical
+ }
+ else {
+ q.id = data.serviceId;
+ q.idType = data.serviceIdType
+ }
+ q.impressionGuid = data.impressionGuid;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.artist, MS.Entertainment.Utilities.isValidServiceId(data.canonicalId) ? data.canonicalId : String.empty);
+ return q.execute().then(function artistQueryCompleted(queryResult) {
+ var tracks = queryResult.result.items;
+ if (tracks) {
+ tracks.playPreviewOnly = !!data.playPreviewOnly;
+ tracks.enableFallbackToPreview = !!data.enableFallbackToPreview;
+ return tracks.forEachAll(function () { }, 0, 99).then(function () {
+ return tracks
+ }, function handlerError(error) {
+ MS.Entertainment.Platform.Playback.fail("track.forEachAll has failed during artist expansion. error " + (error && error.message));
+ return []
+ })
+ }
+ else
+ return tracks
+ })
+ }
+ }, genre: function (data) {
+ if (data.inCollection) {
+ var q = new Query.libraryVideos;
+ q.genreId = data.libraryId;
+ return WinJS.Promise.wrap(q)
+ }
+ return null
+ }, playlist: function (data) {
+ if (data.fromCollection) {
+ var q = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ q.playlistId = data.libraryId;
+ q.mediaAvailability = data._mediaAvailability;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.playlist, MS.Entertainment.Utilities.isValidServiceId(data.cloudSyncItemId) ? data.cloudSyncItemId : String.empty);
+ return WinJS.Promise.wrap(q)
+ }
+ else {
+ var q = new MS.Entertainment.Data.Query.Music.CloudPlaylist;
+ q.id = data.serviceId;
+ q.idType = data.serviceIdType;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.playlist, data.serviceId, data.name);
+ return WinJS.Promise.wrap(q)
+ }
+ }, folder: function (data) {
+ var q = new MS.Entertainment.Data.Query.MediaBrowserFileQuery(MS.Entertainment.Data.deflate(data), [MS.Entertainment.Data.MediaBrowser.ItemType.music]);
+ return q.execute().then(function folderQueryCompleted(queryResult) {
+ var files = WinJS.Utilities.getMember("result.items", queryResult);
+ if (files)
+ return files.toArrayAll();
+ else
+ return []
+ })
+ }
+ };
+ function expandMediaItem(mediaItem) {
+ var converter;
+ initializeExpanderByMediaType();
+ if ("mediaType" in mediaItem)
+ converter = expanderByMediaType[mediaItem.mediaType];
+ if (converter && converter in mediaItemExpansion) {
+ Playback.Etw.traceString("PLST:mediaItemExpansion for " + converter + ": start");
+ return mediaItemExpansion[converter](mediaItem)
+ }
+ else
+ return null
+ }
+ function _mediaItemToMediaInstance(item, ordinal, startPosition, context) {
+ var converter;
+ Playback.Etw.traceString("PLST::mediaItemToMediaInstance: item.data.mediaType = " + item.data.mediaType);
+ initializeConverterByMediaType();
+ if ("mediaType" in item.data)
+ converter = converterByMediaType[item.data.mediaType];
+ if (converter && converter in mediaInstanceFactory)
+ return WinJS.Promise.as(mediaInstanceFactory[converter](item, ordinal, startPosition, context));
+ else {
+ Playback.Etw.traceString("PLST::mediaItemToMediaInstance: returning null");
+ return WinJS.Promise.as(null)
+ }
+ }
+ { };
+ function mediaItemToMediaInstance(item, ordinal, startPosition, context) {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ return MS.Entertainment.Utilities.playabilityTestAsync(item.data, {
+ mediaRights: MS.Entertainment.Utilities.isApp1, checkExplicit: MS.Entertainment.Utilities.isApp1
+ }).then(function onPlayabilityTest(playability) {
+ if (!playability.isPlayable) {
+ Playback.Etw.traceString("-PLST::convertToMediaInstance: unavailable : " + item.data.title);
+ return WinJS.Promise.wrapError(new Playback.UnplayableItemError(item, ordinal))
+ }
+ else
+ return _mediaItemToMediaInstance(item, ordinal, startPosition, context)
+ });
+ return _mediaItemToMediaInstance(item, ordinal, startPosition, context)
+ }
+ { };
+ function convertToMediaInstance(item, ordinal, startPosition, context) {
+ var Playback = MS.Entertainment.Platform.Playback;
+ var Err = MS.Entertainment.Utilities.Error;
+ Playback.Etw.traceString("+PLST::convertToMediaInstance");
+ if (item === null || item === undefined) {
+ Playback.Etw.traceString("PLST::convertToMediaInstance: invalid item accessed from collection - out of range access?");
+ return WinJS.Promise.wrapError("null item accessed from collection - out of range access?")
+ }
+ if (item.data && "source" in item.data) {
+ var itemData = {};
+ Object.keys(WinJS.Binding.expandProperties(item.data)).forEach(function (k) {
+ itemData[k] = item.data[k]
+ });
+ itemData.startPosition = startPosition;
+ itemData.cookie = ordinal;
+ itemData.mediaItem = item;
+ Playback.Etw.traceString("-PLST::convertToMediaInstance: source: " + itemData.source);
+ return createMediaInstance(itemData)
+ }
+ if (item.data && ("mediaType" in item.data)) {
+ var promise = mediaItemToMediaInstance(item, ordinal, startPosition, context);
+ if (promise !== null) {
+ Playback.Etw.traceString("-PLST::convertToMediaInstance");
+ return promise
+ }
+ Playback.Etw.traceString("-PLST::convertToMediaInstance: unknown factory for mediaInstance conversion");
+ return WinJS.Promise.wrapError("unknown factory for mediaInstance conversion")
+ }
+ Playback.Etw.traceString("-PLST::convertToMediaInstance: unknown media type");
+ return WinJS.Promise.wrapError("unknown media type")
+ }
+ { };
+ var ObservableDataSourceBase = WinJS.Binding.define({
+ size: 0, orderVersion: 0, mediaCollection: null
+ });
+ var PlaylistSourceNotificationHandler = WinJS.Class.define(function (onSizeChanged, onOrderChanged) {
+ this._onSizeChanged = onSizeChanged;
+ this._onOrderChanged = onOrderChanged
+ }, {
+ _orderChangeCount: 0, _orderVersion: 0, _removeCount: 0, _sizeCount: 0, _newSize: 0, beginNotifications: function () {
+ this._orderChangeCount = 0;
+ this._removeCount = 0;
+ this._sizeCount = 0
+ }, inserted: function (item, previousRequestID, nextRequestID) { }, changed: function (newItem, oldItem) { }, moved: function (requestID, previousRequestID, nextRequestID) {
+ this._orderChangeCount++
+ }, removed: function (requestID, mirage) {
+ this._removeCount++
+ }, countChanged: function (newCount, oldCount) {
+ if (newCount < oldCount)
+ this._removeCount++;
+ this._newSize = newCount;
+ this._sizeCount++
+ }, indexChanged: function (requestID, newIndex, oldIndex) {
+ this._orderChangeCount++
+ }, endNotifications: function () {
+ if (this._sizeCount || this._removeCount)
+ this._onSizeChanged(this._newSize);
+ if (this._orderChangeCount || this._removeCount) {
+ this._orderVersion++;
+ this._onOrderChanged(this._orderVersion)
+ }
+ }, reload: function () {
+ return
+ }
+ });
+ function FlatListAdaptor(adaptorOptions) {
+ var options = adaptorOptions || {};
+ var sources = [];
+ var countPromise = new WinJS.Promise.wrap(0);
+ var uniqueKey = 0;
+ var notificationHandler = null;
+ this.compareByIdentity = true;
+ function errorNoLongerMeaningful() {
+ var error = new WinJS.ErrorFromName(WinJS.UI.EditError.noLongerMeaningful);
+ error.Name = error.name;
+ return WinJS.Promise.wrapError(error)
+ }
+ function mapFlatIndex(i) {
+ var x = 0;
+ var source = null;
+ if (sources)
+ for (var j = 0; j < sources.length; j++) {
+ var entry = sources[j];
+ if (i >= x && i < x + entry.size)
+ return {
+ source: entry, index: entry.start + i - x
+ };
+ else
+ x += entry.size
+ }
+ return null
+ }
+ function dispose() {
+ for (var i = 0; i < sources.length; i++) {
+ var entrySource = sources[i].source;
+ if (entrySource && "release" in entrySource)
+ entrySource.release();
+ sources[i].source = null;
+ var entryOrigin = sources[i].origin;
+ if (entryOrigin && "addReference" in entryOrigin && "release" in entryOrigin)
+ entryOrigin.release();
+ sources[i].origin = null
+ }
+ sources = null
+ }
+ function currentSize() {
+ var size = 0;
+ for (var i = 0; i < sources.length; i++)
+ size += sources[i].size;
+ return size
+ }
+ function insertAtEnd(key, dataBlock) {
+ if (key === null)
+ key = (uniqueKey++).toString();
+ var origin = null;
+ var data = dataBlock;
+ if (dataBlock && "sourceOrigin" in dataBlock) {
+ origin = dataBlock.sourceOrigin;
+ data = dataBlock.data
+ }
+ origin = origin || {
+ playPreviewOnly: data && !!data.playPreviewOnly, enableFallbackToPreview: data && !!data.enableFallbackToPreview, adapter: data
+ };
+ if (data && data.playPreviewOnly)
+ data.playPreviewOnly = false;
+ if (Array.isArray(data))
+ return insertSourceAtEnd(key, new ArrayDataSource(data, {
+ compareByIdentity: true, keyOf: options.keyOf
+ }), origin, data.length);
+ else if (isNaN(data) && "itemsFromIndex" in data && "getCount" in data) {
+ if (origin && "addReference" in origin && "release" in origin)
+ origin.addReference();
+ return insertSourceAtEnd(key, new MS.Entertainment.Utilities.VirtualizedDataSource(data), origin)
+ }
+ else if (isNaN(data) && "createListBinding" in data)
+ return insertSourceAtEnd(key, data, origin);
+ else {
+ if (data) {
+ data.playPreviewOnly = !!origin.playPreviewOnly;
+ data.enableFallbackToPreview = !!origin.enableFallbackToPreview
+ }
+ return insertItemAtEnd(key, data)
+ }
+ }
+ function remove(key) {
+ try {
+ var keyObject = JSON.parse(key)
+ }
+ catch (ex) {
+ return errorNoLongerMeaningful()
+ }
+ var itemKey = (typeof keyObject === "object") ? keyObject.itemKey : key;
+ var removePromise;
+ if (typeof keyObject === "object" && "listKey" in keyObject) {
+ if (typeof itemKey == "string")
+ itemKey = parseInt(keyObject.itemKey);
+ removePromise = removeListItem(keyObject.listKey, itemKey)
+ }
+ else
+ removePromise = removeTopItem(itemKey);
+ return removePromise.then(function successful_removal() {
+ countPromise = countPromise.then(function (count) {
+ return WinJS.Promise.wrap(count - 1)
+ });
+ return removePromise
+ })
+ }
+ function findTopEntryByItsKey(key) {
+ for (var j = 0; j < sources.length; j++)
+ if (sources[j].key === key)
+ return {
+ index: j, entry: sources[j]
+ };
+ return null
+ }
+ function findEntryByListItemKey(listKey, itemKey) {
+ for (var j = 0; j < sources.length; j++)
+ if (sources[j].key === listKey && sources[j].start <= itemKey && (sources[j].start + sources[j].size > itemKey))
+ return {
+ index: j, entry: sources[j]
+ };
+ return null
+ }
+ function findEntryByKey(key) {
+ var keyObject = JSON.parse(key);
+ var itemKey = keyObject.itemKey;
+ if ("listKey" in keyObject) {
+ if (typeof itemKey == "string")
+ itemKey = parseInt(keyObject.itemKey);
+ return findEntryByListItemKey(keyObject.listKey, itemKey)
+ }
+ else
+ return findTopEntryByItsKey(itemKey)
+ }
+ function pullOutItem(key) {
+ var keyObject = JSON.parse(key);
+ var itemKey = keyObject.itemKey;
+ if ("listKey" in keyObject) {
+ if (typeof itemKey == "string")
+ itemKey = parseInt(keyObject.itemKey);
+ return pullOutListElement(findEntryByListItemKey(keyObject.listKey, itemKey), itemKey)
+ }
+ else
+ return pullOutTopElement(findTopEntryByItsKey(itemKey))
+ }
+ function pullOutTopElement(itemSource) {
+ if (itemSource === null)
+ return null;
+ var entry = itemSource.entry;
+ sources.splice(itemSource.index, 1);
+ return entry
+ }
+ function pullOutListElement(itemSource, itemKey) {
+ if (itemSource === null)
+ return null;
+ var entry = itemSource.entry;
+ var extracted = {
+ origin: entry.origin, source: entry.source, key: entry.key, start: itemKey, size: 1, isItem: false
+ };
+ var x = itemSource.index;
+ if (itemKey === entry.start) {
+ sources[x].start++;
+ sources[x].size--;
+ if (sources[x].size === 0)
+ sources.splice(x, 1)
+ }
+ else {
+ var size = entry.size;
+ var start = entry.start;
+ sources[x].size = itemKey - start;
+ if (itemKey - start < size - 1)
+ sources.splice(x + 1, 0, {
+ origin: entry.origin, source: entry.source, key: entry.key, start: itemKey + 1, size: size - (itemKey - start + 1), isItem: false
+ })
+ }
+ return extracted
+ }
+ function removeTopItem(key) {
+ var itemSource = findTopEntryByItsKey(key);
+ if (itemSource === null || !itemSource.entry.isItem || itemSource.entry.size !== 1)
+ return WinJS.Promise.wrapError("remove error: invalid key");
+ pullOutTopElement(itemSource);
+ return WinJS.Promise.as()
+ }
+ function removeListItem(listKey, itemKey) {
+ var itemSource = findEntryByListItemKey(listKey, itemKey);
+ if (itemSource === null)
+ return WinJS.Promise.wrapError("remove error: invalid key");
+ pullOutListElement(itemSource, itemKey);
+ return WinJS.Promise.as()
+ }
+ function lastKeyInEntry(entry) {
+ if (entry.isItem)
+ return entry.key;
+ return subItemKey(entry.key, entry.start + entry.size - 1)
+ }
+ function firstKeyInEntry(entry) {
+ if (entry.isItem)
+ return entry.key;
+ return subItemKey(entry.key, entry.start)
+ }
+ function promiseForFirstItemInEntry(entry) {
+ if (entry.isItem)
+ return WinJS.Promise.wrap({
+ key: JSON.stringify({ itemKey: entry.key }), data: entry.source
+ });
+ else {
+ var item = { key: subItemKey(entry.key, entry.start) };
+ return entry.source.fromIndex(entry.start).then(function (value) {
+ item.data = value.data;
+ return item
+ })
+ }
+ }
+ function insertEntryAtKey(entry, before, targetKey) {
+ var targetSource = findEntryByKey(targetKey);
+ var x = targetSource && targetSource.index;
+ var previousKey = null;
+ var nextKey = null;
+ if (targetSource == null)
+ throw "Datasource move error: target key is not is not in collection";
+ if (targetSource.entry.size === 1) {
+ if (x > 0)
+ previousKey = lastKeyInEntry(before ? sources[x - 1] : entry);
+ if (x < entry.start + entry.size - 1)
+ nextKey = firstKeyInEntry(before ? entry : sources[x + 1]);
+ sources.splice(before ? targetSource.index : targetSource.index + 1, 0, entry);
+ return promiseForFirstItemInEntry(entry).then(function (value) {
+ return {
+ item: value, previousKey: previousKey, nextKey: nextKey
+ }
+ })
+ }
+ else
+ return splitInsertAtTarget(entry, before, targetKey, targetSource)
+ }
+ function insertEntryAtEnd(entry, atStart) {
+ var previousKey = null;
+ var nextKey = null;
+ if (atStart)
+ nextKey = firstKeyInEntry(sources[0]);
+ else
+ previousKey = lastKeyInEntry(sources[sources.length - 1]);
+ sources.splice(atStart ? 0 : sources.length, 0, entry);
+ return promiseForFirstItemInEntry(entry).then(function (value) {
+ return {
+ item: value, previousKey: previousKey, nextKey: nextKey
+ }
+ })
+ }
+ function splitInsertAtTarget(sourceEntry, before, targetKey, targetSource) {
+ var itemKey = parseInt(JSON.parse(targetKey).itemKey);
+ var entry = targetSource.entry;
+ var x = targetSource.index;
+ var previousKey = null;
+ var nextKey = null;
+ if (before && itemKey === entry.start) {
+ nextKey = firstKeyInEntry(targetSource.entry);
+ if (x > 0)
+ previousKey = lastKeyInEntry(sources[x - 1]);
+ sources.splice(x, 0, entry);
+ return promiseForFirstItemInEntry(sourceEntry).then(function (value) {
+ return {
+ item: value, previousKey: previousKey, nextKey: nextKey
+ }
+ })
+ }
+ if (!before && itemKey === entry.start + entry.size - 1) {
+ previousKey = lastKeyInEntry(entry);
+ if (x < sources.length - 1)
+ nextKey = fistKeyInEntry(sources[x + 1]);
+ sources.splice(x + 1, 0, entry);
+ return promiseForFirstItemInEntry(sourceEntry).then(function (value) {
+ return {
+ item: value, previousKey: previousKey, nextKey: nextKey
+ }
+ })
+ }
+ var leftSplit = {
+ origin: entry.origin, source: entry.source, key: entry.key, start: entry.start, size: before ? itemKey - entry.start : itemKey - entry.start + 1, isItem: false
+ };
+ var rightSplit = {
+ origin: entry.origin, source: entry.source, key: entry.key, start: leftSplit.start + leftSplit.size, size: entry.size - leftSplit.size, isItem: false
+ };
+ previousKey = lastKeyInEntry(leftSplit);
+ nextKey = firstKeyInEntry(rightSplit);
+ sources.splice(x, 1, leftSplit, sourceEntry, rightSplit);
+ return promiseForFirstItemInEntry(sourceEntry).then(function (value) {
+ return {
+ item: value, previousKey: previousKey, nextKey: nextKey
+ }
+ })
+ }
+ function moveToPosition(key, before, targetKey) {
+ try {
+ var itemSource = pullOutItem(key);
+ if (itemSource === null)
+ return WinJS.Promise.wrapError("Datasource move error: source key is not in collection");
+ return insertEntryAtKey(itemSource, before, targetKey).then(function moveDone(moveResult) {
+ return moveResult.item
+ })
+ }
+ catch (e) {
+ return errorNoLongerMeaningful()
+ }
+ }
+ function moveToEnd(key, atStart) {
+ try {
+ var itemSource = pullOutItem(key);
+ if (itemSource === null)
+ return WinJS.Promise.wrapError("Datasource move error: source key is not in collection");
+ return insertEntryAtEnd(itemSource, atStart).then(function (moveResult) {
+ return moveResult.item
+ })
+ }
+ catch (e) {
+ return errorNoLongerMeaningful()
+ }
+ }
+ function insertItemAtEnd(key, data) {
+ if (data === null || data === undefined)
+ return WinJS.Promise.wrapError("Attempt to append null or undefined item rejected");
+ var newIndex = currentSize();
+ var lastEntry = sources.length > 0 ? sources[sources.length - 1] : null;
+ var entry = {
+ source: data, key: key, start: 0, size: 1, isItem: true, origin: null
+ };
+ sources.push(entry);
+ countPromise = countPromise.then(function (c) {
+ return WinJS.Promise.wrap(c + 1)
+ });
+ if (notificationHandler)
+ if (lastEntry === null || lastEntry.size <= 0)
+ notificationHandler.inserted({
+ key: key, data: data
+ }, null, null, 0);
+ else if (lastEntry.isItem)
+ notificationHandler.inserted({
+ key: key, data: data
+ }, lastEntry.key, null, newIndex);
+ else
+ lastEntry.source.fromIndex(lastEntry.size - 1).then(function (e) {
+ notificationHandler.inserted({
+ key: key, data: data
+ }, subItemKey(lastEntry.key, e.key), null, newIndex)
+ });
+ return WinJS.Promise.wrap({
+ key: key, data: data, insertCount: newIndex + 1
+ })
+ }
+ function insertSourceAtEnd(key, data, origin, knownCount) {
+ var getCount = isNaN(knownCount) ? data.getCount() : WinJS.Promise.as(knownCount);
+ return getCount.then(function (c) {
+ if (c === 0)
+ return WinJS.Promise.as();
+ var list = data.createListBinding();
+ var entry = {
+ origin: origin, source: list, key: key, start: 0, size: c, isItem: false
+ };
+ sources.push(entry);
+ countPromise = countPromise.then(function (count) {
+ return WinJS.Promise.wrap(count + c)
+ });
+ if (notificationHandler)
+ notificationHandler.invalidateAll();
+ return {
+ key: key, data: data, insertCount: c
+ }
+ })
+ }
+ function subItemKey(listKey, elementKey) {
+ elementKey = elementKey.toString();
+ return JSON.stringify({
+ listKey: listKey, itemKey: elementKey
+ })
+ }
+ function itemsFromIndex(index, countBefore, countAfter) {
+ if (index === undefined) {
+ index = 0;
+ countBefore = 0
+ }
+ var items = [],
+ first = index - countBefore,
+ last = index + countAfter,
+ offset = countBefore;
+ for (var i = first; i <= last; i++) {
+ var indexMap = mapFlatIndex(i);
+ if (indexMap === null)
+ if (items.length === 0 && first < last) {
+ offset--;
+ continue
+ }
+ else
+ break;
+ if (indexMap.source.isItem)
+ items.push(WinJS.Promise.wrap({
+ key: indexMap.source.key, data: indexMap.source.source
+ }));
+ else
+ items.push(indexMap.source.source.fromIndex(indexMap.index).then(function listItemRetrieved(item) {
+ if (this.origin && item && item.data) {
+ item.data.playPreviewOnly = this.origin.playPreviewOnly;
+ item.data.enableFallbackToPreview = this.origin.enableFallbackToPreview
+ }
+ return WinJS.Promise.wrap({
+ key: subItemKey(this.key, item ? item.key : ("nullSubSourceItem" + indexMap.index)), data: item ? item.data : {
+ adaptorError: "nullSubSourceItem@" + indexMap.index, errorOriginQuery: !this.origin ? "Nullified Query " : {
+ debugId: this.origin.debugInstanceId, refCount: this.origin._referenceCount, isDisposed: this.origin.isDisposed, size: this.origin.totalCount
+ }
+ }
+ })
+ }.bind(indexMap.source)))
+ }
+ if (items.length === 0)
+ return countPromise.then(function (c) {
+ return WinJS.Promise.wrap({
+ items: [], offset: offset, totalCount: c, absoluteIndex: index
+ })
+ });
+ else
+ return WinJS.Promise.join(items).then(function (i) {
+ return countPromise.then(function (c) {
+ return WinJS.Promise.wrap({
+ items: i, offset: offset, totalCount: c, absoluteIndex: index
+ })
+ })
+ })
+ }
+ this.dispose = dispose;
+ this.remove = remove;
+ this.moveToStart = function (key) {
+ return moveToEnd(key, true)
+ };
+ this.moveToEnd = function (key) {
+ return moveToEnd(key, false)
+ };
+ this.moveBefore = function (key, nextKey) {
+ return moveToPosition(key, true, nextKey)
+ };
+ this.moveAfter = function (key, previousKey) {
+ return moveToPosition(key, false, previousKey)
+ };
+ this.itemsFromIndex = itemsFromIndex;
+ this.insertAtEnd = function FlatListAdaptor_insertAtEnd(key, data) {
+ return insertAtEnd(key, data)
+ };
+ this.getCount = function FlatListAdaptor_getCount() {
+ return countPromise
+ };
+ this.setNotificationHandler = function FlatListAdaptor_setNotificationHandler(handler) {
+ notificationHandler = handler
+ }
+ }
+ WinJS.Namespace.define(playlistNamespace, {
+ AccessSerializer: function AccessSerializer() {
+ var waitingList = [];
+ this.enter = function AccessSerializer_enter(serializedPromise) {
+ var synchronouslyExecuted = false;
+ var pushedPromise = false;
+ var promise = WinJS.Promise.join(waitingList).then(function processNext() {
+ return serializedPromise().then(function synchronous(arg) {
+ synchronouslyExecuted = !pushedPromise;
+ return arg
+ })
+ }).then(function cleanupQueue(arg) {
+ if (!synchronouslyExecuted)
+ waitingList.shift();
+ return arg
+ });
+ if (!synchronouslyExecuted) {
+ pushedPromise = true;
+ waitingList.push(promise)
+ }
+ return promise
+ };
+ this.reset = function AccessSerializer_reset() {
+ for (var i = 0; i < waitingList.length; i++)
+ waitingList[i].cancel();
+ waitingList = []
+ }
+ }
+ });
+ function CompoundDataSource() {
+ var adaptor = new FlatListAdaptor;
+ CompoundDataSource.prototype.constructor = CompoundDataSource;
+ Object.getPrototypeOf(new MS.Entertainment.Utilities.VirtualizedDataSource(new FlatListAdaptor))._baseDataSourceConstructor.call(this, adaptor);
+ var that = this;
+ this._lock = new MS.Entertainment.Platform.Playback.Playlist.AccessSerializer;
+ this.dispose = function CompoundDataSource_dispose() {
+ adaptor.dispose();
+ if (this._lock) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST: PlaylistCore::Dispose - Calling reset() on the _lock");
+ this._lock.reset();
+ this._lock = null
+ }
+ adaptor = null
+ };
+ this.insertAtEnd = function CompoundDataSource_insertAtEnd(key, data) {
+ this.beginEdits();
+ var promise = adaptor.insertAtEnd(key, data);
+ this.endEdits();
+ this.invalidateAll();
+ return promise
+ };
+ function implemented() {
+ var listOfMethods = arguments;
+ for (var i = 0; i < arguments.length; i++)
+ (function define_implemented_method() {
+ var method = listOfMethods[i];
+ var _super = that[method];
+ that[method] = function () {
+ var opArguments = arguments;
+ return this._lock.enter(function doEdit() {
+ try {
+ return _super.apply(that, opArguments)
+ }
+ catch (e) {
+ var args = "(" + arguments[0];
+ for (var j = 1; j < arguments.length; j++)
+ args += ", " + arguments[j];
+ args += ")";
+ return WinJS.Promise.wrapError(new Error(e + " in " + method + args + ". Invalid key in arguments"))
+ }
+ })
+ }
+ })();
+ { }
+ }
+ implemented("remove", "moveToStart", "moveToEnd", "moveBefore", "moveAfter")
+ }
+ CompoundDataSource.prototype = Object.create(WinJS.Utilities.eventMixin);
+ function clearCachedPermissions() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService).clearPermissionCache();
+ var playbackEventNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackEventNotifications);
+ playbackEventNotifications.clearErrors()
+ }
+ }
+ function PlaylistMediaCollection() {
+ CompoundDataSource.call(this);
+ PlaylistMediaCollection.prototype.constructor = PlaylistMediaCollection;
+ var _insertAtEnd = this.insertAtEnd;
+ this.insertAtEnd = function PlaylistMediaCollection_insertAtEnd(key, data) {
+ var that = this;
+ clearCachedPermissions();
+ function isListAdapter(data) {
+ return isNaN(data) && "itemsFromIndex" in data && "getCount" in data
+ }
+ function interpretData(data) {
+ var item = WinJS.Promise.wrap(data);
+ var expandedItem = null;
+ MS.Entertainment.Platform.Playback.Etw.tracePlaylistInterpretingData();
+ if ((data && "mediaType" in data) || isListAdapter(data)) {
+ expandedItem = expandMediaItem(data);
+ if (expandedItem !== null)
+ item = expandedItem
+ }
+ return item.then(function (data) {
+ if (expandedItem)
+ Playback.Etw.traceString("item expanded");
+ if (MS.Entertainment.Data.MainQuery.isQuery(data)) {
+ var traceHeader = "interpretData: queryExecute ";
+ Playback.Etw.traceString(traceHeader + "start");
+ return data.execute().then(function querySuccess(q) {
+ Playback.Etw.traceString(traceHeader + "done");
+ Playback.Etw.traceString(traceHeader + "itemCount: " + q.result.items.count);
+ return WinJS.Promise.wrap({
+ sourceOrigin: q, data: q.result.items
+ })
+ })
+ }
+ else
+ return WinJS.Promise.wrap(data)
+ })
+ }
+ return this._lock.enter(function expandAndAppend() {
+ return interpretData(data).then(function interpretDataCompleted(interpretedData) {
+ Playback.Etw.traceString("playlist item interpreted");
+ return _insertAtEnd.call(that, key, interpretedData)
+ }, function interpretedDataFailed(error) {
+ Playback.Etw.traceString("playlist item interpret failed. error: " + error);
+ if (data && data.debugInstanceId && "dispose" in data)
+ data.dispose();
+ return WinJS.Promise.wrapError(error)
+ })
+ })
+ }
+ }
+ PlaylistMediaCollection.prototype = Object.create(WinJS.UI.VirtualizedDataSource.prototype);
+ var PlaylistDataSource = WinJS.Class.derive(ObservableDataSourceBase, function (datasource, completePromise, knownCount) {
+ ObservableDataSourceBase.prototype.constructor.call(this, {
+ size: 0, orderVersion: 0, mediaCollection: datasource
+ });
+ var that = this;
+ this._activationPromise = null;
+ this._activationOrdinal = null;
+ var getCount = isNaN(knownCount) ? this.mediaCollection.getCount() : WinJS.Promise.as(knownCount);
+ getCount.then(function (sz) {
+ that.updateProperty("size", sz).then(function (v) {
+ completePromise(sz)
+ })
+ });
+ this._listBinding = this.mediaCollection.createListBinding(new PlaylistSourceNotificationHandler(function onSizeChanged(sz) {
+ if (sz > that.size)
+ clearCachedPermissions();
+ that.size = sz
+ }, function onOrderChanged(v) {
+ that.orderVersion = v
+ }))
+ }, {
+ isDisposed: false, dispose: function dispose() {
+ if (!this.isDisposed) {
+ if (this._activationPromise)
+ this._activationPromise.cancel();
+ if (this._nextActivationPromise)
+ this._nextActivationPromise.cancel();
+ if (this._listBinding) {
+ this._listBinding.release();
+ this._listBinding = null
+ }
+ if (this.mediaCollection) {
+ this.mediaCollection.dispose();
+ this.mediaCollection = null
+ }
+ this.isDisposed = true
+ }
+ }, itemAt: function itemAt(ordinal) {
+ if (ordinal === null || this.isDisposed || !this._listBinding)
+ return WinJS.Promise.as();
+ var itemPromise = this._listBinding.fromIndex(ordinal);
+ itemPromise.retain();
+ return itemPromise
+ }, getPlaybackMedia: function getPlaybackMedia(ordinal, startPosition, context, resetPreviewFlag) {
+ if (ordinal === undefined || ordinal === null || isNaN(ordinal))
+ return WinJS.Promise.as();
+ return this.itemAt(ordinal).then(function (v) {
+ if (resetPreviewFlag)
+ v.data.playPreviewOnly = false;
+ return convertToMediaInstance(v, ordinal, startPosition, context)
+ })
+ }, ordinalOf: function ordinalOf(media) {
+ return media != null ? media.cookie : null
+ }
+ });
+ WinJS.Namespace.define(playlistNamespace, {
+ ListSequencer: WinJS.Class.define(function () { }, {
+ _size: null, setSize: function setSize(s) {
+ this._size = s
+ }, repeat: false, initialize: function initialize(ds) {
+ this.setSize(ds ? ds.size : null)
+ }, position: function ListSequencer_position(ordinal) {
+ if (!this._size || ordinal < 0 || ordinal >= this._size)
+ return NaN;
+ return ordinal
+ }, first: 0, before: function before(ordinal) {
+ if (ordinal === null || ordinal === undefined)
+ return null;
+ return (ordinal === this.first) ? (this.repeat ? this._size - 1 : null) : --ordinal
+ }, after: function after(ordinal) {
+ if (ordinal === null || ordinal === undefined)
+ return null;
+ return (ordinal < this._size - 1) ? ++ordinal : (this.repeat ? this.first : null)
+ }
+ })
+ });
+ WinJS.Namespace.define(playlistNamespace, {
+ IncrementalShuffleGenerator: WinJS.Class.define(function (n) {
+ this._size = n;
+ this._spanStart = [0];
+ this._spanLength = [n];
+ if (arguments.length === 2 && arguments[1] !== null)
+ this.remove(arguments[1])
+ }, {
+ _size: 0, _rand: function IncrementalShuffleGenerator__rand() {
+ return Math.floor(Math.random() * this._size)
+ }, _spanStart: [], _spanLength: [], generate: function IncrementalShuffleGenerator_generate() {
+ var k = this._rand();
+ for (var i = 0; i < this._spanStart.length; i++) {
+ var start = this._spanStart[i];
+ var length = this._spanLength[i];
+ if (k < length) {
+ var g = start + k;
+ this._markSpan(i, g, start, length);
+ return g
+ }
+ k -= length
+ }
+ return null
+ }, remove: function IncrementalShuffleGenerator_remove(ordinal) {
+ for (var i = 0; i < this._spanStart.length; i++) {
+ var start = this._spanStart[i];
+ var length = this._spanLength[i];
+ if (ordinal >= start && ordinal < start + length) {
+ this._markSpan(i, ordinal, start, length);
+ return
+ }
+ }
+ }, _markSpan: function IncrementalShuffleGenerator__markSpan(i, g, start, length) {
+ if (g === start)
+ if (--length === 0) {
+ this._spanStart.splice(i, 1);
+ this._spanLength.splice(i, 1)
+ }
+ else {
+ this._spanStart[i] = start + 1;
+ this._spanLength[i] = length
+ }
+ else if (g === (start + length - 1))
+ this._spanLength[i] = length - 1;
+ else {
+ this._spanStart.splice(i, 1, start, g + 1);
+ this._spanLength.splice(i, 1, g - start, length - (g - start) - 1)
+ }
+ this._size--;
+ return
+ }
+ })
+ });
+ function QuantumShuffleSequencer() {
+ var shuffler;
+ var shuffleFwd;
+ var shuffleBkwd;
+ var positions;
+ var _first;
+ var size;
+ var initialized = false;
+ var that = this;
+ function using(namespace, functionName) {
+ return namespace[functionName].bind(namespace)
+ }
+ var assert = function QuantumShuffleSequencer_assert(condition, text) {
+ if (!condition)
+ throw (new Error("QuantumShuffleSequencer: " + text));
+ };
+ var fail = using(MS.Entertainment.Platform.Playback, "fail");
+ var trace = using(MS.Entertainment.Platform.Playback.Etw, "traceString");
+ function extendFwd(ordinal) {
+ positions[ordinal] = shuffleFwd.length;
+ shuffleFwd.push(ordinal);
+ shuffler.remove(ordinal)
+ }
+ function extendBkwd(ordinal) {
+ shuffleBkwd.push(ordinal);
+ positions[ordinal] = -shuffleBkwd.length;
+ shuffler.remove(ordinal)
+ }
+ function extendAt(position, ordinal) {
+ if (position < 0)
+ extendBkwd(ordinal);
+ else
+ extendFwd(ordinal)
+ }
+ function getShuffle(position) {
+ if (position >= 0)
+ return shuffleFwd[position];
+ else
+ return shuffleBkwd[-(1 + position)]
+ }
+ function initialize(sz, first) {
+ assert(sz > 0, "Initialize shuffle with positive sizes only");
+ if (initialized)
+ trace("Warning: re-initializing initialized shuffler");
+ shuffler = new mySpace.IncrementalShuffleGenerator(sz || 0, first);
+ shuffleFwd = [];
+ shuffleBkwd = [];
+ positions = {};
+ if (first === +first)
+ that.first = first;
+ that.size = sz;
+ initialized = true
+ }
+ function rollOverCut(step) {
+ var fName = step > 0 ? "After" : "Before";
+ assert(shuffleFwd.length + shuffleBkwd.length === that.size, fName + " Rollover initiated on partial sequence");
+ trace(fName + "Rollover");
+ var toArray = step > 0 ? shuffleBkwd : shuffleFwd;
+ var thisArray = step > 0 ? shuffleFwd : shuffleBkwd;
+ return toArray.length ? toArray[toArray.length - 1] : thisArray[0]
+ }
+ function position(ordinal) {
+ var p = positions[ordinal];
+ if (p !== +p)
+ return NaN;
+ return p
+ }
+ function shuffleIterator(step, ordinal) {
+ var name = step > 0 ? "after" : "before";
+ var fName = "ShuffleSequencer_" + name + "(" + ordinal + "): ";
+ trace(fName + "repeat = " + that.repeat);
+ if (ordinal !== +ordinal) {
+ trace(fName + " argument is not a number: return null");
+ return null
+ }
+ if (step < 0 && ordinal === that.first)
+ if (!that.repeat) {
+ trace(fName + "Reached end of shuffle in before(first) : return null");
+ return null
+ }
+ var position = positions[ordinal];
+ if (position === undefined) {
+ assert(ordinal >= 0 && ordinal < that.size, "Invalid jump in ordinal value");
+ if (that._isFirstSet())
+ extendAt(step, ordinal);
+ else
+ that.first = ordinal;
+ return shuffleIterator(step, ordinal)
+ }
+ else {
+ var nextOrdinal = getShuffle(position + step);
+ if (nextOrdinal === undefined) {
+ assert(step > 0 ? (position + step >= 0) : (position + step < 0), fName + "encountered undefined value in directional part of shuffle");
+ trace(fName + "Extending");
+ var newOrdinal = shuffler.generate();
+ if (newOrdinal !== null) {
+ trace(fName + "generated " + newOrdinal);
+ extendAt(position + step, newOrdinal);
+ return newOrdinal
+ }
+ else
+ nextOrdinal = rollOverCut(step)
+ }
+ if (step > 0)
+ if (nextOrdinal === that.first)
+ if (!that.repeat) {
+ trace(fName + "Reached end of shuffle");
+ nextOrdinal = null
+ }
+ trace(fName + "returns " + nextOrdinal);
+ return nextOrdinal
+ }
+ }
+ this.repeat = false;
+ Object.defineProperty(this, "first", {
+ set: function QuantumShuffleSequencer_set_first(value) {
+ if (!that._isFirstSet() && (value === +value)) {
+ extendAt(0, value);
+ _first = value;
+ assert(shuffler, "QuantumShuffleSequencer_set_first : shuffler has not been initialized")
+ }
+ else {
+ assert(that._isFirstSet(), "QuantumShuffleSequencer_set_first : \"first\" is already set");
+ assert(value !== +value, "QuantumShuffleSequencer_set_first : Invalid value for \"first\"")
+ }
+ }, get: function QuantumShuffleSequencer_get_first() {
+ if (!that._isFirstSet()) {
+ assert(shuffler, "QuantumShuffleSequencer_get_first : shufler has not been initialized");
+ _first = shuffler.generate();
+ trace("Setting shuffle first to " + _first);
+ assert(that._isFirstSet, "QuantumShuffleSequencer_get_first : shuffler is empty");
+ extendFwd(_first)
+ }
+ return _first
+ }, enumerable: true, configurable: false
+ });
+ this._isFirstSet = function QuantumShuffleSequencer__isFirstSet() {
+ return _first === +_first
+ };
+ this.initialize = function QuantumShuffleSequencer_initialize(datasource, first) {
+ initialize((datasource && datasource.size) || 0, first)
+ };
+ this.initializeSize = function QuantumShuffleSequencer_initializeSize(size, first) {
+ initialize(size || 0, first)
+ };
+ this.before = shuffleIterator.bind(this, -1);
+ this.after = shuffleIterator.bind(this, 1);
+ this.position = position
+ }
+ { };
+ WinJS.Namespace.define(playlistNamespace, { QuantumShuffleSequencer: QuantumShuffleSequencer });
+ function createPlaylistDataSource(arg, promise) {
+ var playlistDataSource = new PlaylistMediaCollection;
+ return playlistDataSource.insertAtEnd(null, arg).then(function (insertResult) {
+ return WinJS.Promise.wrap(new PlaylistDataSource(playlistDataSource, promise, !insertResult ? insertResult : insertResult.insertCount))
+ })
+ }
+ function makeEmptyPromise() {
+ var completePromise;
+ var newPromise = new WinJS.Promise(function (c, e, p) {
+ completePromise = c
+ });
+ return {
+ completePromise: completePromise, promise: newPromise
+ }
+ }
+ function findOrdinal(core, startingOrdinal, nowPlayingKey) {
+ var datasource = core._dataSource;
+ var list;
+ var size = datasource.size;
+ if (size === 0)
+ return -1;
+ list = datasource.mediaCollection.createListBinding();
+ return list.fromIndex(startingOrdinal).then(function findOrdinal_current(mediaItem) {
+ if (!nowPlayingKey || (mediaItem && mediaItem.key === nowPlayingKey)) {
+ list.release();
+ return null
+ }
+ var neighborPromises = [];
+ var candidateIndices = [startingOrdinal - 1, startingOrdinal + 1, 0, size - 1];
+ neighborPromises.push(startingOrdinal > 0 ? list.fromIndex(startingOrdinal - 1) : WinJS.Promise.wrap(null));
+ neighborPromises.push(startingOrdinal < size - 1 ? list.fromIndex(startingOrdinal + 1) : WinJS.Promise.wrap(null));
+ neighborPromises.push(list.fromIndex(0));
+ neighborPromises.push(list.fromIndex(size - 1));
+ return WinJS.Promise.join(neighborPromises).then(function findOrdinal_heuristic1(neighbor) {
+ for (var i = 0; i < neighbor.length; i++)
+ if (neighbor[i] !== null && neighbor[i].key === nowPlayingKey) {
+ list.release();
+ return candidateIndices[i]
+ }
+ list.release();
+ return -1
+ })
+ })
+ }
+ function expandingSearch(core, startingOrdinal, fCompare, maxDistance) {
+ var datasource = core._dataSource;
+ var list = datasource.mediaCollection.createListBinding();
+ var size = datasource.size;
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST:expandingSearch start@" + startingOrdinal);
+ function internalExpandingSearch(distance) {
+ function pairSearch() {
+ function found(i) {
+ return list.fromIndex(i).then(function got_list_element(mediaItemEntry) {
+ return fCompare.call(mediaItemEntry) ? i : null
+ })
+ }
+ var search = [];
+ var forwardIndex = startingOrdinal + distance;
+ if (forwardIndex < size)
+ search.push(found(forwardIndex));
+ if (distance !== 0) {
+ var backwardIndex = startingOrdinal - distance;
+ if (backwardIndex >= 0)
+ search.push(found(backwardIndex))
+ }
+ return WinJS.Promise.join(search).then(function pair_evaluated(searchResult) {
+ switch (searchResult.length) {
+ case 0:
+ return undefined;
+ case 1:
+ return searchResult[0];
+ case 2:
+ return (searchResult[0] !== null) ? searchResult[0] : searchResult[1];
+ default:
+ return null
+ }
+ })
+ }
+ return pairSearch().then(function next_pair(foundOrdinal) {
+ if (foundOrdinal === undefined) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST:expandingSearch: No match in a whole list (" + distance + ")");
+ return null
+ }
+ if (foundOrdinal !== null) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST:expandingSearch: match found at distance = " + distance);
+ return foundOrdinal
+ }
+ if (maxDistance === undefined || distance < maxDistance)
+ return WinJS.Promise.timeout().then(internalExpandingSearch.bind(this, distance + 1));
+ else {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST:expandingSearch: no match at max distance " + distance);
+ return null
+ }
+ })
+ }
+ function cleanup(arg) {
+ list.release();
+ return arg
+ }
+ return internalExpandingSearch(0).then(cleanup, cleanup)
+ }
+ WinJS.Namespace.define(playlistNamespace, {
+ PlaylistCore: WinJS.Class.derive(MS.Entertainment.UI.Framework.ObservableBase, function (element, options) {
+ this._listSequencer = new mySpace.ListSequencer;
+ this._sequenceGenerator = this._listSequencer;
+ this.setOptions(options);
+ var that = this;
+ this.bind("shuffle", function (v) {
+ that.onSetShuffleMode(v)
+ });
+ this.bind("repeat", function (v) {
+ that.onSetRepeatMode(v)
+ })
+ }, {
+ _dataSource: null, _playbackControlEventHandlers: null, _currentMediaKey: null, settingDataSource: false, currentOrdinal: MS.Entertainment.UI.Framework.observableProperty("currentOrdinal", null), currentNowPlayingPlaylistLibraryId: MS.Entertainment.UI.Framework.observableProperty("currentNowPlayingPlaylistLibraryId", null), pendingOrdinal: MS.Entertainment.UI.Framework.observableProperty("pendingOrdinal", null), currentMedia: MS.Entertainment.UI.Framework.observableProperty("currentMedia", null), canSkipBackward: MS.Entertainment.UI.Framework.observableProperty("canSkipBackward", false), canSkipForward: MS.Entertainment.UI.Framework.observableProperty("canSkipForward", false), shuffle: MS.Entertainment.UI.Framework.observableProperty("shuffle", false), repeat: MS.Entertainment.UI.Framework.observableProperty("repeat", false), canShuffle: MS.Entertainment.UI.Framework.observableProperty("canShuffle", true), canRepeat: MS.Entertainment.UI.Framework.observableProperty("canRepeat", true), smartDJSeed: MS.Entertainment.UI.Framework.observableProperty("smartDJSeed", null), mediaCollection: MS.Entertainment.UI.Framework.observableProperty("mediaCollection", null), lastTrackPlaying: MS.Entertainment.UI.Framework.observableProperty("lastTrackPlaying", false), setDataSource: function PlaylistCore_setDataSource(value) {
+ this.settingDataSource = true;
+ MS.Entertainment.Platform.Playback.Etw.tracePlaylistSetDataSourceBegin();
+ var that = this;
+ var datasource = this._dataSource;
+ if (this._readyToSetDataSource)
+ this._readyToSetDataSource.cancel();
+ if (this.smartDJSeed) {
+ this.canShuffle = false;
+ this.canRepeat = false
+ }
+ else {
+ this.canShuffle = true;
+ this.canRepeat = true
+ }
+ var createPromise = makeEmptyPromise();
+ that._dataSourceSetPromise = makeEmptyPromise();
+ var readyToSetDataSource = createPlaylistDataSource(value, createPromise.completePromise).then(function (newDataSource) {
+ if (datasource) {
+ for (var promiseTitle in that._savePlaylistInProgressPromise)
+ if (that._savePlaylistInProgressPromise[promiseTitle]) {
+ that._savePlaylistInProgressPromise[promiseTitle].cancel();
+ Playback.Etw.traceString("PLST::setDataSource_onCreatePlaylistDataSourceComplete: pending savePlaylist promises cancelled.")
+ }
+ if (that._dataSourceBindings)
+ that._dataSourceBindings.cancel();
+ datasource.dispose()
+ }
+ that._setMedia(null, null);
+ that._dataSource = newDataSource;
+ that._dataSourceBindings = WinJS.Binding.bind(that._dataSource, {
+ size: function (v) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST::binding: new size: " + v);
+ that._onSizeChanged(v);
+ that._dataSourceSetPromise.completePromise(v)
+ }, orderVersion: function (v) {
+ that._onOrderChanged()
+ }, mediaCollection: function (v) {
+ that.updateAndNotify("currentOrdinal", null).then(function () {
+ that.updateAndNotify("mediaCollection", v)
+ })
+ }
+ });
+ return WinJS.Promise.join([that._dataSourceSetPromise.promise, createPromise.promise]).then(function () {
+ that.settingDataSource = false;
+ MS.Entertainment.Platform.Playback.Etw.tracePlaylistSetDataSourceEnd();
+ that.onSetShuffleMode(that.shuffle);
+ return newDataSource ? WinJS.Promise.wrap(WinJS.Binding.unwrap(newDataSource.mediaCollection)) : WinJS.Promise.as()
+ })
+ }, function handleError(error) {
+ that.settingDataSource = false;
+ Playback.Etw.traceString("PLST::setDataSource_onCreatePlaylistDataSourceError: " + MS.Entertainment.Utilities.stringify(error));
+ if (datasource) {
+ for (var promiseTitle in that._savePlaylistInProgressPromise)
+ if (that._savePlaylistInProgressPromise[promiseTitle]) {
+ that._savePlaylistInProgressPromise[promiseTitle].cancel();
+ Playback.Etw.traceString("PLST::setDataSource_onCreatePlaylistDataSourceError: pending savePlaylist promises cancelled.")
+ }
+ datasource.dispose();
+ if (that._dataSourceBindings)
+ that._dataSourceBindings.cancel()
+ }
+ that._setMedia(null, null);
+ that._dataSource = null
+ });
+ function markDataSourcePromiseCompleted() {
+ that._readyToSetDataSource = null;
+ return readyToSetDataSource
+ }
+ { };
+ this._readyToSetDataSource = readyToSetDataSource;
+ return readyToSetDataSource.then(markDataSourcePromiseCompleted, markDataSourcePromiseCompleted)
+ }, _dispose: function PlayListCore_dispose() {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST: PlaylistCore::Dispose");
+ if (this._lock) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST: PlaylistCore::Dispose - Calling reset() on the _lock");
+ this._lock.reset()
+ }
+ if (this._dataSource) {
+ this._dataSource.dispose();
+ this._dataSource = null
+ }
+ if (this._dataSourceBindings) {
+ this._dataSourceBindings.cancel();
+ this._dataSourceBindings = null
+ }
+ if (this._dataSourceSetPromise) {
+ if (this._dataSourceSetPromise.promise)
+ this._dataSourceSetPromise.promise.cancel();
+ this._dataSourceSetPromise = null
+ }
+ this.currentMedia = null;
+ this._currentMediaKey = null;
+ this._currentMediaInstance = null
+ }, _dataSourceSetPromise: makeEmptyPromise(), _playbackControlReadyPromise: null, _readyToSetDataSource: null, _lock: new MS.Entertainment.Platform.Playback.Playlist.AccessSerializer, insertAtEnd: function PlayListCore_insertAt(key, data) {
+ var that = this;
+ this.lastTrackPlaying = false;
+ function insertAtEndInternal() {
+ return that._lock.enter(function serializedInsert() {
+ that.flushPreroll(true);
+ if (!that._dataSource)
+ return that.setDataSource(data);
+ var insert = that._dataSource.mediaCollection.insertAtEnd(key, data).then(function verifyCount(count) {
+ if (!count)
+ that._dataSourceSetPromise.completePromise();
+ return count
+ });
+ that._dataSourceSetPromise = makeEmptyPromise();
+ return WinJS.Promise.join([insert, that._dataSourceSetPromise.promise]).then(function (joinArray) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("Playlist top level insertAtEnd: completed");
+ return WinJS.Promise.wrap(joinArray[0])
+ })
+ })
+ }
+ if (that._playbackControlReadyPromise)
+ return that._playbackControlReadyPromise.promise.then(function onPlaybackControlReady() {
+ return insertAtEndInternal()
+ });
+ else
+ return insertAtEndInternal()
+ }, _options: null, setOptions: function PlaylistCore_setOptions(options) {
+ if (!options)
+ return;
+ this._options = options;
+ if (this._options.hasOwnProperty("src"))
+ if (this._options.src.hasOwnProperty("winControl"))
+ this.setDataSource(this._options.src.winControl);
+ else
+ this.setDataSource(this._options.src);
+ if (this._options.hasOwnProperty("player"))
+ if (this._options.player.hasOwnProperty("winControl"))
+ this.setPlaybackControl(this._options.player.winControl);
+ else
+ this.setPlaybackControl(this._options.player)
+ }, _playbackControl: null, _currentMediaInstance: null, _prerollOrdinal: null, _userActionOrdinal: null, _activationPromise: null, _savePlaylistInProgressPromise: {}, _onPrerollCallback: function PlaylistCore_onPrerollCallback(newValue, oldValue) {
+ if (this._playbackControlReadyPromise)
+ this._playbackControlReadyPromise.completePromise();
+ if (!oldValue && newValue && this._dataSource)
+ this._setNext(this._dataSource)
+ }, _setCurrentOrdinal: function PlaylistCore_setCurrentOrdinal(ordinal) {
+ this.currentOrdinal = ordinal;
+ this._prerollOrdinal = ordinal
+ }, _computeNextToPreroll: function PlaylistCore_computeNextToPreroll() {
+ if (this._prerollOrdinal === null && this.currentOrdinal != null)
+ this._prerollOrdinal = this.currentOrdinal;
+ if (this._prerollOrdinal !== null)
+ this._prerollOrdinal = this.after(this._prerollOrdinal);
+ this._updateCommandStatus();
+ return this._prerollOrdinal
+ }, _onCurrentItemCallback: function PlaylistCore_onCurrentItemCallback(v) {
+ this._currentMediaInstance = v;
+ if (v && this._dataSource) {
+ var i = this._dataSource.ordinalOf(v);
+ var originalMediaItem = v._mediaItem.data;
+ this._setCurrentOrdinal(i);
+ if (originalMediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && originalMediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo && v._mediaItem.trackItem) {
+ this.currentMedia = originalMediaItem;
+ this._currentMediaKey = v._mediaItem.trackItem.key
+ }
+ else {
+ var list = this._dataSource.mediaCollection.createListBinding();
+ list.fromIndex(i).then(function got_media_item(item) {
+ if (!item) {
+ this._setMedia(null, null);
+ this._currentMediaKey = null
+ }
+ else {
+ this.currentMedia = item.data;
+ this._currentMediaKey = item.key
+ }
+ list.release()
+ }.bind(this), function fromIndexError() {
+ list.release();
+ Playback.Etw.traceString("PLST->_onCurrentItemCallback->fromIndex")
+ })
+ }
+ }
+ else {
+ this._setCurrentOrdinal(null);
+ if (!v) {
+ this.currentMedia = null;
+ this._currentMediaKey = null
+ }
+ }
+ this._updateCommandStatus()
+ }, itemAt: function PlaylistCore_itemAt(datasource, ordinal) {
+ return datasource ? datasource.itemAt(ordinal) : WinJS.Promise.as()
+ }, setPlaybackControl: function PlaylistCore_setPlaybackControl(value) {
+ if (this._playbackControlEventHandlers != null) {
+ this._playbackControlEventHandlers.cancel();
+ this._playbackControlEventHandlers = null
+ }
+ this._playbackControl = value;
+ this._playbackControlEventHandlers = MS.Entertainment.Utilities.addEvents(this._playbackControl, {
+ currentMediaChanged: function (v) {
+ this._onCurrentItemCallback(v.detail.newValue)
+ }.bind(this), readyForNextMediaChanged: function (e) {
+ this._onPrerollCallback(e.detail.newValue, e.detail.oldValue)
+ }.bind(this)
+ })
+ }, _setMediaByIndex: function PlaylistCore__setMediaByIndex(ordinal, startPosition, resetPreviewFlag) {
+ var datasource = this._dataSource;
+ this._userActionOrdinal = ordinal;
+ this._prerollOrdinal = ordinal;
+ Playback.Etw.traceString("PLST->getPlaybackMedia");
+ if (datasource._activationPromise)
+ if (datasource._activationOrdinal == ordinal)
+ return;
+ else
+ datasource._activationPromise.cancel();
+ datasource._activationOrdinal = ordinal;
+ var activationPromise = datasource.getPlaybackMedia(ordinal, startPosition, Playback.UsageContext.user, resetPreviewFlag).then(function getPlaybackMedia_success(mediaInstance) {
+ Playback.Etw.traceString("PLST<-getPlaybackMedia");
+ this._setMedia(datasource, mediaInstance)
+ }.bind(this), function getPlaybackMedia_error(error) {
+ if (!WinJS.Promise.isCanceledError(error)) {
+ Playback.Etw.traceString("PLST:getPlaybackMediaError " + error);
+ if (error && error.isUnplayableItemError)
+ return WinJS.Promise.wrapError(error);
+ return this.itemAt(datasource, ordinal).then(function getPlaybackMedia_error_itemAt(mediaItem) {
+ return createMediaInstance({
+ cookie: ordinal, error: Playback.makePlaybackError(error, "PLST->getPlaybackMedia_error"), mediaItem: mediaItem
+ }).then(function (errorMediaInstance) {
+ this._setMedia(datasource, errorMediaInstance)
+ }.bind(this))
+ }.bind(this))
+ }
+ else
+ Playback.Etw.traceString("Playlist::_setMediaByIndex::getPlaybackMedia: activation canceled")
+ }.bind(this));
+ function markActivationCompleted(error) {
+ datasource._activationPromise = null;
+ if (error && error.isUnplayableItemError)
+ return WinJS.Promise.wrapError(error)
+ }
+ datasource._activationPromise = activationPromise;
+ return activationPromise.then(markActivationCompleted, markActivationCompleted)
+ }, _findPlayable: function (advanceOrdinalFun, ordinal, originalOrdinal, complete) {
+ var seqNext = advanceOrdinalFun(ordinal);
+ if (seqNext === null || !this.mediaCollection)
+ return WinJS.Promise.as(null);
+ var startOrdinal = originalOrdinal === undefined ? ordinal : originalOrdinal;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ return new WinJS.Promise(function (c, e, p) {
+ var topComplete = complete === undefined ? c : complete;
+ this.mediaCollection.itemFromIndex(seqNext).done(function checkPlayability(mediaItem) {
+ if (!mediaItem) {
+ topComplete(null);
+ return
+ }
+ MS.Entertainment.Utilities.playabilityTestAsync(mediaItem.data, {
+ mediaRights: MS.Entertainment.Utilities.isApp1, checkExplicit: MS.Entertainment.Utilities.isApp1
+ }).done(function onPlayability(playability) {
+ if (playability.isPlayable)
+ topComplete(seqNext);
+ else {
+ if (seqNext === startOrdinal) {
+ topComplete(null);
+ return
+ }
+ MS.Entertainment.Utilities.schedulePromiseNormal().done(function () {
+ this._findPlayable(advanceOrdinalFun, seqNext, startOrdinal, topComplete).done(function _findPlayable_complete(seqNext) {
+ topComplete(seqNext)
+ }, function _findPlayable_error(error) {
+ topComplete(null)
+ })
+ }.bind(this))
+ }
+ }.bind(this))
+ }.bind(this), function error() {
+ topComplete(null)
+ })
+ }.bind(this));
+ else
+ return WinJS.Promise.wrap(seqNext)
+ }, nextPlayable: function PlaylistCore_nextPlayable(ordinal) {
+ if (this._nextPlayablePromise)
+ this._nextPlayablePromise.cancel();
+ this._nextPlayablePromise = this._findPlayable(this.after.bind(this), ordinal);
+ return this._nextPlayablePromise
+ }, previousPlayable: function PlaylistCore_previousPlayable(ordinal) {
+ if (this._previousPlayablePromise)
+ this._previousPlayablePromise.cancel();
+ this._previousPlayablePromise = this._findPlayable(this.before.bind(this), ordinal);
+ return this._previousPlayablePromise
+ }, activate: function PlaylistCore_activate(index, startPosition, searchFor, maxSearchDistance) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PLST::activate at " + index);
+ if (this._nextPlayablePromise) {
+ this._nextPlayablePromise.cancel();
+ this._nextPlayablePromise = null
+ }
+ if (this._previousPlayablePromise) {
+ this._previousPlayablePromise.cancel();
+ this._previousPlayablePromise = null
+ }
+ return this._dataSourceSetPromise.promise.then(function synchronized_activate() {
+ return this._activate(index, startPosition, searchFor, maxSearchDistance)
+ }.bind(this))
+ }, _activate: function PlaylistCore__activate(index, startPosition, searchFor, maxSearchDistance) {
+ if (!this._playbackControl) {
+ var err = "Cannot activate playlist : playbackControl is not set";
+ Playback.Etw.traceString("PLST:" + err);
+ throw err;
+ }
+ if (!this._dataSource) {
+ var err = "Cannot activate playlist : datasource is not set";
+ Playback.Etw.traceString("PLST:" + err);
+ throw err;
+ }
+ MS.Entertainment.Platform.Playback.Etw.tracePlaylistActivate(index, startPosition, this.shuffle, this.repeat);
+ this._playbackControl.activating = true;
+ if (this._dataSource.size === 0) {
+ this._setMedia(null);
+ return
+ }
+ if (this._playbackControlReadyPromise && this._playbackControlReadyPromise.promise)
+ this._playbackControlReadyPromise.promise.cancel();
+ this._playbackControlReadyPromise = makeEmptyPromise();
+ var ordinal = index;
+ if (ordinal === undefined)
+ ordinal = this.first;
+ else if (index === +index && this.shuffle && !this._sequenceGenerator._isFirstSet())
+ this._sequenceGenerator.first = index;
+ function isValidNumber(n) {
+ return +n === n
+ }
+ if (!isNaN(ordinal) && ordinal >= 0 && ordinal < this._dataSource.size)
+ if (!!searchFor)
+ return expandingSearch(this, ordinal, searchFor, maxSearchDistance || 0).then(function found(foundIndex) {
+ if (isValidNumber(foundIndex))
+ return this._setMediaByIndex(foundIndex, startPosition);
+ else if (searchFor.track)
+ return this.setDataSource(searchFor.track).then(function playSingleTrack() {
+ this.activate()
+ }.bind(this));
+ else {
+ MS.Entertainment.Platform.Playback.assert(false, "Search functionality requested in activation w/o specifying backup track to play");
+ Playback.Etw.traceString("Playlist::activate aborted. Track not found and no alternate track specified");
+ return WinJS.Promise.as()
+ }
+ }.bind(this));
+ else
+ return this._setMediaByIndex(ordinal, startPosition)
+ }, skipFwd: function PlaylistCore_skipFwd() {
+ if (this._playbackControl.hasPrerolledMedia()) {
+ this._userActionOrdinal = this._prerollOrdinal;
+ this._playbackControl.skipToNextPrerolled(true);
+ return WinJS.Promise.as()
+ }
+ else
+ return this.nextPlayable(this.currentOrdinal).then(function (atOrdinal) {
+ if (atOrdinal != null)
+ return this.activate(atOrdinal).then(null, function failedToActivate(error) {
+ if (error && error.isUnplayableItemError)
+ return WinJS.Promise.wrapError(new Playback.SkipFwdOutOfRangeError)
+ }.bind(this));
+ else {
+ if (this._playbackControlReadyPromise && this._playbackControlReadyPromise.promise) {
+ this._playbackControlReadyPromise.promise.cancel();
+ this._playbackControlReadyPromise = null
+ }
+ return WinJS.Promise.wrapError(new Playback.SkipFwdOutOfRangeError)
+ }
+ }.bind(this))
+ }, skipBack: function PlaylistCore_skipBack() {
+ return this.previousPlayable(this.currentOrdinal).then(function (atOrdinal) {
+ if (atOrdinal != null)
+ return this.activate(atOrdinal).then(null, function failedToActivate(error) {
+ if (error && error.isUnplayableItemError)
+ if (error && error.isUnplayableItemError)
+ return WinJS.Promise.wrapError(new Playback.SkipBkwdOutOfRangeError)
+ }.bind(this));
+ else {
+ this._updateCommandStatus();
+ return WinJS.Promise.wrapError(new Playback.SkipBkwdOutOfRangeError)
+ }
+ }.bind(this))
+ }, flushPreroll: function PlaylistCore_flushPreroll(doNotResetFirst) {
+ if (this._dataSource) {
+ if (this._playbackControl && this._playbackControl._player)
+ this._playbackControl._player.reset(true);
+ this._prerollOrdinal = null;
+ this._setNext(this._dataSource);
+ if (this.firstTrackPlaying && !doNotResetFirst)
+ delete this.firstTrackPlaying;
+ this.lastTrackPlaying = false;
+ this._updateCommandStatus()
+ }
+ }, _updateCommandStatus: function PlaylistCore__updateCommandStatus() {
+ this.canSkipForward = (this._prerollOrdinal != null) && !this.lastTrackPlaying;
+ this.canSkipBackward = this.repeat || (this.currentOrdinal != null && this.firstTrackPlaying !== this.currentOrdinal && this.before(this.currentOrdinal) != null)
+ }, onSetShuffleMode: function PlaylistCore_onSetShuffleMode(v) {
+ this._sequenceGenerator = v ? new mySpace.QuantumShuffleSequencer : this._listSequencer;
+ this._initializeFromSource();
+ this.flushPreroll(true)
+ }, onSetRepeatMode: function PlaylistCore_onSetRepeatMode(v) {
+ this._sequenceGenerator.repeat = v;
+ if (this.currentOrdinal != null) {
+ this._userActionOrdinal = this.currentOrdinal;
+ this._prerollOrdinal = this.currentOrdinal;
+ this._setNext(this._dataSource)
+ }
+ this._updateCommandStatus()
+ }, _onSizeChanged: function PlaylistCore__onSizeChanged(sz) {
+ if (sz > this._dataSource ? this._dataSource.size : 0)
+ clearCachedPermissions();
+ if (sz)
+ this.onSetShuffleMode(this.shuffle)
+ }, _reactivateAt: function _reactivateAt(newOrdinal) {
+ if (newOrdinal === null)
+ return;
+ this.activate(newOrdinal).done(function activated() {
+ this._setCurrentOrdinal(newOrdinal)
+ }.bind(this), function errorToActivate(error) {
+ if (error && error.isUnplayableItemError)
+ return this.nextPlayable(+error.context).done(function gotNextPlayable(atOrdinal) {
+ if (atOrdinal !== null) {
+ this.activate(atOrdinal).done(null, function errorOnFound() {
+ if (error && error.isUnplayableItemError) {
+ this._reactivateAt(atOrdinal);
+ return
+ }
+ this._setMedia(null, null);
+ this._setCurrentOrdinal(null)
+ });
+ this._setCurrentOrdinal(atOrdinal)
+ }
+ else {
+ this._playbackControl.errorDescriptor = MSEPlatform.Playback.makePlaybackError(MSEPlatform.Playback.Error.NS_E_WMP_MULTIPLE_ERROR_IN_PLAYLIST, "No playable media in the playlist");
+ this._playbackControl.errorDescriptor.isCritical = true;
+ this._playbackControl._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.error);
+ this._setMedia(null, null);
+ this._setCurrentOrdinal(null)
+ }
+ }.bind(this), function notExpectedToErrorOut() { })
+ }.bind(this))
+ }, _onOrderChanged: function PlaylistCore__onOrderChanged() {
+ if (this.currentOrdinal !== undefined && this.currentOrdinal !== null && this._currentMediaInstance !== null) {
+ var datasource = this._dataSource;
+ findOrdinal(this, this.currentOrdinal, this._currentMediaKey).then(function adjust_playback(newOrdinal) {
+ if (newOrdinal !== null) {
+ var reactivate = false;
+ if (newOrdinal === -1) {
+ reactivate = true;
+ if (this.currentOrdinal >= this._dataSource.size) {
+ newOrdinal = this.after(this.currentOrdinal);
+ if (newOrdinal === this.currentOrdinal)
+ newOrdinal = null
+ }
+ else
+ newOrdinal = this.currentOrdinal
+ }
+ if (newOrdinal !== null) {
+ if (reactivate)
+ this._reactivateAt(newOrdinal)
+ }
+ else {
+ this._setMedia(null, null);
+ this._setCurrentOrdinal(null)
+ }
+ }
+ this.flushPreroll(true)
+ }.bind(this))
+ }
+ }, first: {
+ get: function PlaylistCore_getFirst() {
+ try {
+ return this._sequenceGenerator.first
+ }
+ catch (ex) {
+ Playback.Etw.traceString("PlaylistCore: Exception " + MS.Entertainment.Utilities.stringify(ex) + " in .first");
+ return 0
+ }
+ }
+ }, after: function PlaylistCore_after(ordinal) {
+ if (ordinal !== +ordinal)
+ return null;
+ try {
+ return this._sequenceGenerator.after(ordinal)
+ }
+ catch (ex) {
+ Playback.Etw.traceString("PlaylistCore: Exception " + MS.Entertainment.Utilities.stringify(ex) + " in after: " + ordinal);
+ return null
+ }
+ }, before: function PlaylistCore_before(ordinal) {
+ if (ordinal !== +ordinal)
+ return null;
+ try {
+ return this._sequenceGenerator.before(ordinal)
+ }
+ catch (ex) {
+ Playback.Etw.traceString("PlaylistCore: Exception " + MS.Entertainment.Utilities.stringify(ex) + " in before: " + ordinal);
+ return null
+ }
+ }, position: function PlaylistCore_position(ordinal) {
+ if (ordinal !== +ordinal)
+ return NaN;
+ return this._sequenceGenerator.position(ordinal)
+ }, _initializeFromSource: function PlaylistCore__initializeFromSource() {
+ if (this._dataSource) {
+ var c = this.currentOrdinal;
+ this._sequenceGenerator.initialize(this._dataSource, c)
+ }
+ this._sequenceGenerator.repeat = this.repeat
+ }, _setNext: function PlaylistCore__setNext(datasource) {
+ if (this.isDisposed)
+ return WinJS.Promise.as();
+ if (datasource._nextActivationPromise) {
+ datasource._nextActivationPromise.cancel();
+ this._prerollOrdinal = null
+ }
+ var next = this._computeNextToPreroll();
+ return this._setNextInternal(datasource, next).then(null, function errorInSetNext(error) {
+ if (error && error.isUnplayableItemError)
+ this.nextPlayable(next).done(function foundPlayable(foundOrdinal) {
+ this._setNextInternal(datasource, foundOrdinal)
+ }.bind(this))
+ }.bind(this))
+ }, _setNextInternal: function PlaylistCore__setNextInternal(datasource, next) {
+ if (next === null)
+ return WinJS.Promise.as(this._setNextMedia(null));
+ return this.itemAt(datasource, next).then(this._setNextMedia.bind(this))
+ }, _setMedia: function PlaylistCore__setMedia(datasource, item) {
+ var currentOrdinal = null;
+ if (datasource && item && !this.isDisposed) {
+ currentOrdinal = datasource.ordinalOf(item);
+ MS.Entertainment.Platform.Playback.Etw.tracePlaylistSetMedia(item)
+ }
+ else
+ this.currentMedia = null;
+ this._setCurrentOrdinal(currentOrdinal);
+ if (this._playbackControl)
+ this._playbackControl.currentMedia = item
+ }, _setNextMedia: function PlaylistCore__setNextMedia(item) {
+ if (this._playbackControl) {
+ var nextMedia;
+ if (item) {
+ this.lastTrackPlaying = false;
+ nextMedia = item
+ }
+ else {
+ if (this._playbackControl.nextMedia === undefined)
+ nextMedia = null;
+ else
+ nextMedia = undefined;
+ if (this.currentOrdinal !== null)
+ this.lastTrackPlaying = true
+ }
+ this._updateCommandStatus();
+ return this._playbackControl.prerollMediaItem(nextMedia)
+ }
+ }, savePlaylist: function savePlaylist(title, overwrite, waitForCreationOnly) {
+ Playback.Etw.traceString("PLST::savePlaylist started " + (new Date).toTimeString());
+ var that = this;
+ var playlistId = -1;
+ var overwriteNamed = !!overwrite;
+ var datasource = this._dataSource;
+ var promiseTitle = title || "NowPlaying";
+ var acquisitionContextType = -1;
+ var acquisitionContext = -1;
+ var acquisitionContextId = MS.Entertainment.Utilities.EMPTY_GUID;
+ var acquisitionAdditionalContext = String.empty;
+ var signInService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn) : null;
+ var signedInUserService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser) : null;
+ var hasExplicitPrivilege = signInService && signInService.isSignedIn && signedInUserService && signedInUserService.hasExplicitPrivilege;
+ if (this._savePlaylistInProgressPromise[promiseTitle]) {
+ this._savePlaylistInProgressPromise[promiseTitle].cancel();
+ Playback.Etw.traceString("PLST::savePlaylist previous cancelled")
+ }
+ if (!playlistProvider) {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ playlistProvider = mediaStore.playlistProvider
+ }
+ function appendItem(item) {
+ if (!item || !item.data)
+ return WinJS.Promise.wrapError("Cannot save the undefined or null playlist item");
+ var mediaItem = item.data;
+ var hydrateMediaItemIfRequired = WinJS.Promise.as(mediaItem);
+ if (item.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ if (item.data.hasTrackId && title) {
+ hydrateMediaItemIfRequired = item.data.track.hydrate();
+ mediaItem = item.data.track
+ }
+ else
+ return WinJS.Promise.as();
+ return hydrateMediaItemIfRequired.then(function mediaItemHydrated(mediaItem) {
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(mediaItem)
+ }).then(function gotLibraryInfo() {
+ if (MS.Entertainment.Utilities.isAmsterdamApp)
+ return WinJS.Promise.as(null);
+ var libraryMediaPromise;
+ if (mediaItem && mediaItem.acquisitionData) {
+ acquisitionContextType = mediaItem.acquisitionData.acquisitionContextType || -1;
+ acquisitionContext = mediaItem.acquisitionData.acquisitionContext || -1;
+ acquisitionContextId = MS.Entertainment.Utilities.isValidGuid(mediaItem.acquisitionData.acquisitionContextID) ? mediaItem.acquisitionData.acquisitionContextID : MS.Entertainment.Utilities.EMPTY_GUID;
+ if (!mediaItem.acquisitionData.acquisitionAdditionalContext)
+ mediaItem.acquisitionData.acquisitionAdditionalContext = mediaItem.playlistName || title;
+ acquisitionAdditionalContext = mediaItem.acquisitionData.acquisitionAdditionalContext
+ }
+ if (mediaItem.mediaType && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && mediaItem.libraryId === -1)
+ if (hasExplicitPrivilege || !mediaItem.isExplicit)
+ libraryMediaPromise = MS.Entertainment.Platform.PurchaseHelpers.addNonCollectionMediaToLibrary([mediaItem]);
+ else
+ libraryMediaPromise = WinJS.Promise.wrapError(MS.Entertainment.Platform.Playback.makeParentallyBlockedError());
+ else
+ libraryMediaPromise = WinJS.Promise.wrap({
+ mediaIdentifiers: [{
+ libraryId: mediaItem.libraryId, libraryType: mediaItem.mediaType, mediaId: mediaItem.serviceId || MS.Entertainment.Utilities.EMPTY_GUID
+ }]
+ });
+ return libraryMediaPromise
+ }).then(function mediaAddedToLibrary(result) {
+ if (!result || !result.mediaIdentifiers || !result.mediaIdentifiers.length)
+ return WinJS.Promise.as();
+ var libraryIds = result.mediaIdentifiers.map(function mapLibraryId(item) {
+ return item.libraryId
+ });
+ var mediaTypes = result.mediaIdentifiers.map(function mapLibraryType(item) {
+ return item.libraryType
+ });
+ var serviceMediaIds = result.mediaIdentifiers.map(function mapServiceId(item) {
+ return item.mediaId || MS.Entertainment.Utilities.EMPTY_GUID
+ });
+ if (acquisitionContextType && acquisitionContext && acquisitionContextId && !MS.Entertainment.Utilities.isEmptyGuid(acquisitionContextId))
+ return playlistProvider.appendPlaylistItemsAsync(playlistId, libraryIds, serviceMediaIds, mediaTypes, Microsoft.Entertainment.Platform.MediaAvailability.undefined, [acquisitionContextType], [acquisitionContext], [acquisitionContextId], [acquisitionAdditionalContext]);
+ else
+ return playlistProvider.appendPlaylistItemsAsync(playlistId, libraryIds, serviceMediaIds, mediaTypes, Microsoft.Entertainment.Platform.MediaAvailability.undefined)
+ }, function mediaNotAddedToLibrary(error) {
+ if (mediaItem.fileItem || error === Playback.Error.NS_E_EXPLICIT_CONTENT_PLAY_BLOCKED)
+ return WinJS.Promise.wrap();
+ var trackArtistName = String.empty;
+ var trackArtistServiceId = MS.Entertainment.Utilities.EMPTY_GUID;
+ if (mediaItem.artist) {
+ trackArtistName = mediaItem.artist.name;
+ trackArtistServiceId = mediaItem.artist.serviceId || MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ var albumName = String.empty;
+ var albumArtistName = trackArtistName;
+ var albumArtistServiceId = trackArtistServiceId;
+ if (mediaItem.album) {
+ albumName = mediaItem.album.name;
+ if (mediaItem.album.artist) {
+ albumArtistName = mediaItem.album.artist.name;
+ albumArtistServiceId = mediaItem.album.artist.serviceId || MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ }
+ var duration = !mediaItem.duration ? 0 : mediaItem.duration.getMinutes ? (((mediaItem.duration.getMinutes() * 60) + mediaItem.duration.getSeconds()) * 1000) : mediaItem.duration;
+ return playlistProvider.appendMarketplaceTrackPlaylistItemAsync(playlistId, [mediaItem.libraryId], [albumName], [albumArtistName], [mediaItem.name], [trackArtistName], [item.data.genreName], [duration], [albumArtistServiceId], [trackArtistServiceId], [item.data.serviceId ? item.data.serviceId : MS.Entertainment.Utilities.EMPTY_GUID], item.data.mediaType, [acquisitionContextType], [acquisitionContext], [acquisitionContextId], [acquisitionAdditionalContext])
+ })
+ }
+ function cleanup(arg) {
+ that._savePlaylistInProgressPromise[promiseTitle] = null;
+ var cancel = String.empty;
+ if (WinJS.Promise.isCanceledError(arg))
+ cancel = " (canceled) ";
+ Playback.Etw.traceString("PLST::savePlaylist cleanup: " + cancel + (new Date).toTimeString());
+ return arg
+ }
+ function progressReport(index) {
+ if (index % 100 === 0)
+ Playback.Etw.traceString("PLST::savePlaylist @" + index)
+ }
+ try {
+ if (datasource) {
+ var listCreationPromise = null;
+ if (!title) {
+ Playback.Etw.traceString("PLST::savePlaylist create nowplaying playlist");
+ listCreationPromise = playlistProvider.createPlaylistAsync(Microsoft.Entertainment.Platform.PlaylistType.nowPlaying, "NowPlaying", true)
+ }
+ else {
+ Playback.Etw.traceString("PLST::savePlaylist create named playlist, title= " + title + ", overwriteNamed=" + overwriteNamed);
+ listCreationPromise = playlistProvider.createPlaylistAsync(Microsoft.Entertainment.Platform.PlaylistType.static, title, overwriteNamed)
+ }
+ that._savePlaylistInProgressPromise[promiseTitle] = listCreationPromise;
+ return listCreationPromise.then(function createPlaylist_complete(createPlaylistReturnValue) {
+ Playback.Etw.traceString("PLST::savePlaylist createPlaylist_complete");
+ this.currentNowPlayingPlaylistLibraryId = createPlaylistReturnValue.playlistId;
+ playlistId = createPlaylistReturnValue.playlistId;
+ if (this.smartDJSeed && MS.Entertainment.Utilities.isValidGuid(this.smartDJSeed.canonicalId) && !title)
+ return playlistProvider.savePlaylistRadioSeedAsync(playlistId, this.smartDJSeed.canonicalId).then(function returnPlaylist() {
+ return playlistId
+ });
+ else {
+ playlistProvider.savePlaylistCurrentItemIndexAsync(playlistId, this.currentOrdinal);
+ var listWritePromise = MS.Entertainment.Platform.Playback.Playlist.PlaylistCore.forEachItemSequentially(datasource.mediaCollection, appendItem, null, progressReport).then(function savingTracks(count) {
+ return count
+ }, function savingTracksError(error) {
+ if (WinJS.Promise.isCanceledError(error))
+ Playback.Etw.traceString("PLST::savePlaylist cancelled");
+ else
+ Playback.Etw.traceString("PLST::savePlaylist terminated with error " + Playback.errorToString(error.number))
+ });
+ that._savePlaylistInProgressPromise[promiseTitle] = listWritePromise;
+ if (!waitForCreationOnly)
+ return listWritePromise.then(function saved_all(count) {
+ return WinJS.Promise.wrap(playlistId)
+ });
+ else
+ return playlistId
+ }
+ }.bind(this), function onError(e) {
+ Playback.Etw.traceString("PLST::savePlaylist creation error: " + MS.Entertainment.Utilities.stringify(e));
+ cleanup(e);
+ return WinJS.Promise.wrapError(e)
+ }).then(cleanup)
+ }
+ }
+ catch (e) {
+ return WinJS.Promise.wrapError(e)
+ }
+ }
+ }, {
+ forEachItemSequentially: function forEachItemSequentially(collection, asyncOp, maxItems, progress) {
+ return collection.getCount().then(function forEachItemSequentially_listCounted(count) {
+ var list = collection.createListBinding();
+ var completed,
+ error;
+ function _iterationError(err) {
+ Playback.Etw.traceString("PLST::forEachItemSequentially iteration error: " + MS.Entertainment.Utilities.stringify(err));
+ list.release();
+ error(err)
+ }
+ { };
+ function _forEachItemSequentially(startingWith) {
+ if (progress)
+ progress(startingWith);
+ if (startingWith === count || (maxItems && maxItems === startingWith)) {
+ list.release();
+ completed(startingWith);
+ return
+ }
+ list.fromIndex(startingWith).done(function forEachItemSequentially_gotItem(item) {
+ WinJS.Promise.timeout().done(function forEachItemSequentially_processItem() {
+ asyncOp(item).done(_forEachItemSequentially.bind(this, startingWith + 1), _iterationError)
+ })
+ })
+ }
+ return new WinJS.Promise(function (c, e) {
+ completed = c;
+ error = e;
+ _forEachItemSequentially(0)
+ })
+ })
+ }, convertMediaItemToMediaInstance: function convertMediaItemToMediaInstance(mediaItem, startPosition, context) {
+ return convertToMediaInstance(mediaItem, mediaItem.index, startPosition, context)
+ }
+ })
+ })
+ })("MS.Entertainment.Platform.Playback.Playlist")
+})();
+/* >>>>>>/components/playback/controls/mediaplayer.js:40305 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ var HNS_PER_MILLISECOND = 10000;
+ var FourCCMap = {
+ Unknown: "Unknown", "858604357": "EC-3", "1279476033": "AACL", "1212367169": "AACH", "875967048": "H.264"
+ };
+ function getPassportTicketAsync(returnEmptyOnFailure) {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ return WinJS.Promise.wrapError("No SessionMgr is registered");
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ return sessionMgr.getPassportTicketAsync(returnEmptyOnFailure)
+ }
+ function isBlobUrl(url) {
+ var blobUrlRegex = /^blob:/i;
+ return blobUrlRegex.test(url)
+ }
+ function enumToString(enumValue, enumeration) {
+ for (var name in enumeration)
+ if (enumValue === enumeration[name])
+ return name;
+ return "unknown"
+ }
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ MediaPlayer: MS.Entertainment.UI.Framework.define(function MediaPlayer_constructor(playerType, mediaInstance, autoPlay) {
+ if (!this._tagPlayer)
+ this._tagPlayer = this._createHtmlTag(playerType, mediaInstance, autoPlay);
+ this._autoPlay = autoPlay;
+ this._media = mediaInstance
+ }, {
+ autoplay: {
+ get: function autoplay_get() {
+ return this._autoPlay
+ }, set: function autoplay_set(value) {
+ this._autoPlay = value
+ }
+ }, muted: {
+ get: function muted_get() {
+ return this._tagPlayer.muted
+ }, set: function muted_set(value) {
+ this._tagPlayer.muted = value
+ }
+ }, volume: {
+ get: function volume_get() {
+ return this._tagPlayer.volume
+ }, set: function volume_set(value) {
+ this._tagPlayer.volume = value
+ }
+ }, currentTime: {
+ get: function currentTime_get() {
+ return this._tagPlayer.currentTime
+ }, set: function currentTime_set(value) {
+ this._tagPlayer.currentTime = value
+ }
+ }, duration: {
+ get: function duration_get() {
+ if (this._tagPlayer.durationOverrideMS)
+ return this._tagPlayer.durationOverrideMS / 1000;
+ return this._tagPlayer.duration
+ }
+ }, error: {
+ get: function error_get() {
+ return this._tagPlayer.error
+ }
+ }, media: {
+ get: function media_get() {
+ return this._media
+ }
+ }, playerType: {
+ get: function playerType_get() {
+ return this._tagPlayer.tagName
+ }
+ }, playbackRate: {
+ get: function playbackRate_get() {
+ return this._tagPlayer.playbackRate
+ }, set: function playbackRate_set(value) {
+ this._tagPlayer.playbackRate = value
+ }
+ }, buffered: {
+ get: function buffered_get() {
+ return this._tagPlayer.buffered
+ }
+ }, ended: {
+ get: function ended_get() {
+ return this._tagPlayer.ended
+ }
+ }, isDisposed: {
+ get: function isDisposed_get() {
+ return this._disposed
+ }
+ }, skipThisError: {
+ get: function skipThisError_get() {
+ return this._skipThisError
+ }, set: function skipThisError_set(value) {
+ this._skipThisError = value
+ }
+ }, isPreActivatedSource: {
+ get: function isPreActivatedSource_get() {
+ return this._usingPreActivatedTag
+ }
+ }, msPlayToDisabled: {
+ get: function msPlayToDisabled_get() {
+ return this._tagPlayer.msPlayToDisabled
+ }
+ }, msPlayToSource: {
+ get: function msPlayToSource_get() {
+ return this._tagPlayer.msPlayToSource
+ }
+ }, play: function MediaPlayer_play() {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::Play()");
+ this._tagPlayer.play()
+ }, pause: function MediaPlayer_pause() {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::Pause()");
+ this._tagPlayer.pause()
+ }, stop: function MediaPlayer_stop() {
+ this.pause()
+ }, seekToPosition: function MediaPlayer_seekToPosition(positionMsec) {
+ try {
+ var positionSec = positionMsec / 1000;
+ this._tagPlayer.currentTime = positionSec
+ }
+ catch (e) {
+ MSEPlatform.Playback.Etw.tracePlaybackError(e.code, e.msExtendedCode, "MediaPlayer::seekToPosition")
+ }
+ }, forceTimeUpdate: function MediaPlayer_forceTimeUpdate() {
+ return this._tagPlayer.currentTime * 1000
+ }, addEventListener: function MediaPlayer_addEventListener(type, listener, useCapture) {
+ this._tagPlayer.addEventListener(type, listener, useCapture)
+ }, removeEventListener: function MediaPlayer_removeEventListener(type, listener, useCapture) {
+ this._tagPlayer.removeEventListener(type, listener, useCapture)
+ }, getElement: function MediaPlayer_getElement() {
+ return this._tagPlayer
+ }, getMediaDurationMS: function MediaPlayer_getMediaDurationMS() {
+ function getDurationMS(duration) {
+ if (duration) {
+ if (duration.getMinutes)
+ duration = ((duration.getHours() * 60 * 60) + (duration.getMinutes() * 60) + duration.getSeconds()) * 1000
+ }
+ else
+ duration = 0;
+ return duration
+ }
+ var duration = null;
+ if (this._media && this._media._mediaItem && this._media._mediaItem.data)
+ duration = this._media._mediaItem.data.duration;
+ return getDurationMS(duration)
+ }, dispose: function MediaPlayer_dispose() {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::dispose: Disposing tag");
+ if (this._tagPlayer._mediaProtectionManagerBindings) {
+ this._tagPlayer._mediaProtectionManagerBindings.cancel();
+ this._tagPlayer._mediaProtectionManagerBindings = null
+ }
+ this._tagPlayer.removeAttribute("src");
+ this._tagPlayer.load();
+ this._media = null;
+ this._disposed = true
+ }, configureDRM: function MediaPlayer_configureDRM() {
+ var that = this;
+ var htmlTag = this._tagPlayer;
+ var mediaInstance = this._media;
+ var Playback = MSEPlatform.Playback;
+ var licenseLog = "";
+ var startLicenseAcquisitionTime = new Date;
+ MSEPlatform.Playback.assert(mediaInstance, "mediaInstance should not be null");
+ function getKidFromServiceRequest(e) {
+ return e && e.request && e.request.contentHeader ? e.request.contentHeader.keyIdString : String.empty
+ }
+ function serviceRequested(e) {
+ function onPlaySRCompleted(asyncOp) {
+ if (e && e.completion && e.completion.complete)
+ e.completion.complete(true);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "License acquisition succeeded");
+ var elapsedTime = new Date - startLicenseAcquisitionTime;
+ Playback.Etw.traceString("DRM:LA Time Elapsed (ms) : " + elapsedTime);
+ licenseLog = "";
+ if (Playback.AudioPlayer.fastStartBlockedOnLA)
+ Playback.AudioPlayer.fastStartBlockedOnLA = false;
+ if (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && !mediaInstance.trackLeafLicenseAcquired && mediaInstance.isLocal)
+ mediaInstance.trackLeafLicenseAcquired = true
+ }
+ function onPlaySRError(error) {
+ var errorCode = (error && error.number) ? error.number : "unknown";
+ Playback.Etw.traceString("DRM:onPlaySRError: " + errorCode);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "License acquisition failed with error " + errorCode);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (error && error.number === MSEPlatform.Playback.Error.NS_E_DRM_INVALID_LICENSE.code && (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track) && signedInUser && signedInUser.isSubscription && mediaInstance.isLocal) {
+ Playback.Etw.traceString("DRM:onPlaySRError: retry root LA for subscription downloaded content");
+ getPassportTicketAsync().then(function _gotTicket(ticket) {
+ MSEPlatform.Playback.drmIndividualizationPromise.then(function _doAcquireRootLicense() {
+ Microsoft.Entertainment.Util.PlayReadyHandler.acquireRootLicense(ticket)
+ })
+ }).then(function _rootSucceeded() {
+ Playback.Etw.traceString("DRM:onPlaySRError: root LA retry SUCCEEDED");
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("succeeded");
+ if (e && e.completion && e.completion.complete)
+ e.completion.complete(true)
+ }, function _rootFailed(error) {
+ Playback.Etw.traceString("DRM:onPlaySRError: root LA retry FAILED: " + errorCode);
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("failed", errorCode);
+ that._drmNotifyError(error, "DRM ServiceRequest Error (Root LA Retry): " + licenseLog, e)
+ })
+ }
+ else if (error && error.number === MSEPlatform.Playback.Error.MF_E_UNSUPPORTED_RATE.code && mediaInstance.mediaType !== Microsoft.Entertainment.Queries.ObjectType.track && mediaInstance.smidEnablerInEffect && mediaInstance.isLocal)
+ that._drmNotifyError(MSEPlatform.Playback.Error.ZEST_E_ASSET_LICENSE_RIGHT_NOT_OWNED, "Protected Video Content SMID is not owned. " + licenseLog, e);
+ else
+ that._drmNotifyError(error, "DRM ServiceRequest Error: " + licenseLog, e)
+ }
+ function onPlaySRProgress(report) {
+ if (report.indexOf("lease") === -1) {
+ var elapsedTime = new Date - startLicenseAcquisitionTime;
+ Playback.Etw.traceString("DRM:" + elapsedTime + ":" + report);
+ licenseLog += elapsedTime + " : " + report + "\n"
+ }
+ else
+ try {
+ var leaseObject = JSON.parse(report);
+ mediaInstance.initialLease = leaseObject.lease
+ }
+ catch (e) {
+ Playback.Etw.traceString("Exception thrown when parsing the lease: " + report)
+ }
+ }
+ try {
+ if (!mediaInstance)
+ return;
+ if (e.request.type === Microsoft.Media.PlayReadyClient.PlayReadyStatics.individualizationServiceRequestType) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, String.empty, "Individualization Requested");
+ e.request.beginServiceRequest().then(function indiv_complete() {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, String.empty, "Individualization Successful");
+ try {
+ var next = e.request.nextServiceRequest();
+ if (next) {
+ e.request = next;
+ serviceRequested(e)
+ }
+ else
+ onPlaySRCompleted()
+ }
+ catch (ex) {
+ MSEPlatform.Playback.MediaPlayer.drmNotifyException(htmlTag, ex, "DRM Individualization Service Request")
+ }
+ }, function indiv_error() {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, String.empty, "Individualization Failed");
+ that._drmNotifyError(MSEPlatform.Playback.Error.NS_E_DRM_NEEDS_INDIVIDUALIZATION, null, e)
+ });
+ return
+ }
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "License Needed");
+ mediaInstance.fillDownloadSubscriptionInfoAsync().then(function fillDownloadSubscriptionInfoAsync_complete() {
+ if (!mediaInstance.nativeLicenseRight && mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && mediaInstance.isLocal)
+ mediaInstance.nativeLicenseRight = Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload;
+ var right = MSEPlatform.PurchaseHelpers.LicenseRightMap.toScript(mediaInstance.nativeLicenseRight);
+ return getPassportTicketAsync(right === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.FreeStream).then(function execute_drm_serviceRequest(ticket) {
+ var handler;
+ try {
+ if (MS.Entertainment.Utilities.isEmptyGuid(mediaInstance.mediaInstanceId) || !right) {
+ if (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Track has no MIID or no rights");
+ that._drmNotifyError(MSEPlatform.Playback.Error.ZUNE_E_NO_SUBSCRIPTION_DOWNLOAD_RIGHTS, "No rights to this content", e);
+ return
+ }
+ else if (mediaInstance.signedLicensePolicyTicket) {
+ handler = Microsoft.Entertainment.Util.PlayReadyHandler.createForVideoLicensePolicyTicket(mediaInstance.signedLicensePolicyTicket, !mediaInstance.isLocal);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting LPT enabler")
+ }
+ else if (!MS.Entertainment.Utilities.isEmptyGuid(mediaInstance.serviceIdSafe)) {
+ mediaInstance.smidEnablerInEffect = true;
+ handler = Microsoft.Entertainment.Util.PlayReadyHandler.createForVideoServiceMediaId(mediaInstance.serviceIdSafe, !mediaInstance.isLocal);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting SMID enabler")
+ }
+ else if (mediaInstance._mediaItem && mediaInstance._mediaItem.data && mediaInstance._mediaItem.data.fileItem) {
+ MSEPlatform.PurchaseHelpers.getServiceIdAsync(mediaInstance._mediaItem.data.fileItem).done(function crackedSmid(smid) {
+ if (smid) {
+ mediaInstance.smidEnablerInEffect = true;
+ mediaInstance._mediaItem.data.zuneId = smid;
+ handler = Microsoft.Entertainment.Util.PlayReadyHandler.createForVideoServiceMediaId(smid, !mediaInstance.isLocal);
+ handler.beginServiceRequest(e.request).then(onPlaySRCompleted, onPlaySRError, onPlaySRProgress)
+ }
+ else {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Media has no SMID assigned");
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED, "Media has no SMID assigned", e)
+ }
+ }, function cannotCrackSmid(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Cannot crack SMID" + error);
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED, "Cannot crack SMID " + error, e)
+ });
+ return
+ }
+ }
+ else if (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && mediaInstance.trackLeafLicenseAcquired) {
+ Playback.Etw.traceString("DRM:onPlaySRError: retry root LA for subscription downloaded content");
+ handler = new Microsoft.Entertainment.Util.PlayReadyHandler(ticket);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting root subscription enabler")
+ }
+ else {
+ handler = new Microsoft.Entertainment.Util.PlayReadyHandler(ticket, right, mediaInstance.shouldLogToDrmDownloadHistory, mediaInstance.offerId ? mediaInstance.offerId : MS.Entertainment.Utilities.EMPTY_GUID, mediaInstance.mediaInstanceId);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting MIID+Offer enabler")
+ }
+ handler.beginServiceRequest(e.request).then(onPlaySRCompleted, onPlaySRError, onPlaySRProgress)
+ }
+ catch (ex) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Unexpected exception thrown");
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, ex, "License Acquisition Service Request")
+ }
+ }, function sign_in_failure(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Sign in Failed");
+ that._drmNotifyError(MSEPlatform.Playback.Error.ZEST_E_SIGNIN_REQUIRED, null, e)
+ })
+ }, function fillDownloadSubscriptionInfoAsync_error(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Media Detail Query failed");
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED, "Media has no SMID assigned", e)
+ }).done(null, function reactiveLicenseAcquisitionFailed(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Unexpected outer exception thrown");
+ that._drmNotifyError(error, "serviceRequested", e)
+ })
+ }
+ catch (ex) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Unexpected outer exception thrown");
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, ex, "serviceRequested")
+ }
+ }
+ function componentLoadFailed(e) {
+ var traceMsg = "";
+ var postPendedText = "";
+ try {
+ traceMsg += e.information.items.size + " failed components!\n";
+ traceMsg += "Components:\n";
+ var size = e.information.items.size;
+ for (var i = 0; i < size; i++) {
+ traceMsg += e.information.items[i].name + "\nReasons=" + e.information.items[i].reasons + "\n" + "Renewal Id=" + e.information.items[i].renewalId + "\n";
+ postPendedText += (" - " + e.information.items[i].name + "\n")
+ }
+ e.completion.complete(true);
+ traceMsg += "Resumed source (false)\n";
+ MSEPlatform.Playback.Etw.traceString(traceMsg);
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_COMPONENT_LOAD_FAILURE, null, null, postPendedText)
+ }
+ catch (e) {
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, e, "componentLoadFailed")
+ }
+ }
+ var mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager;
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
+ var copyProtectionSystems = new Windows.Foundation.Collections.PropertySet;
+ copyProtectionSystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput";
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = copyProtectionSystems;
+ if (MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isMusicApp2)
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionContainerGuid"] = "{9A04F079-9840-4286-AB92-E65BE0885F95}";
+ htmlTag._mediaProtectionManagerBindings = MS.Entertainment.Utilities.addEventHandlers(mediaProtectionManager, {
+ componentloadfailed: componentLoadFailed, servicerequested: serviceRequested
+ });
+ try {
+ htmlTag.msSetMediaProtectionManager(mediaProtectionManager)
+ }
+ catch (e) {
+ MS.Entertainment.Platform.Playback.fail("_configureTagForDRM: Unexpected exception on msSetMediaProtectionManager: " + e.message);
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, e, "configureTagForDRM_msSetMediaProtectionManager")
+ }
+ }, _createHtmlTag: function MediaPlayer_createHtmlTag(playerType, mediaInstance, autoPlay) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::createHtmlTag: creating audio/video tag. mediaInstance.source = " + mediaInstance.source);
+ var Playback = MSEPlatform.Playback;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var htmlTag = Playback.MediaPlayer.createMediaTag(playerType);
+ if (!htmlTag)
+ throw "MediaPlayer::createHtmlTag(): Error! cannot create " + playerType + " tag. Out of memory?";
+ if (playerType === "audio" && (MS.Entertainment.Utilities.isApp1 || configurationManager.music.backgroundAudioEnabled))
+ try {
+ htmlTag.setAttribute("msAudioCategory", "backgroundCapableMedia")
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::constructor: failed to set backgroundCapableMedia. exception: " + ex)
+ }
+ else
+ htmlTag.setAttribute("msAudioCategory", "foregroundOnlyMedia");
+ htmlTag.msPlayToDisabled = Playback.shouldDisableDlnaPlayTo(mediaInstance);
+ Playback.Etw.traceString("MediaPlayer::createHtmlTag(), autoplay= " + autoPlay);
+ htmlTag.autoplay = autoPlay;
+ htmlTag.style.width = "100%";
+ htmlTag.style.height = "100%";
+ return htmlTag
+ }, _drmNotifyError: function MediaPlayer_drmNotifyError(error, source, serviceRequest, postPendedText) {
+ var that = this;
+ var bubbleError = true;
+ var code = error.number ? error.number : error.code;
+ if (code === MSEPlatform.Playback.Error.ZEST_E_ASSET_LICENSE_RIGHT_NOT_OWNED.code)
+ if (this._media)
+ if (this._media._mediaItem && this._media._mediaItem.data && this._media._mediaItem.data["playFromXbox"]) {
+ bubbleError = false;
+ this._media._mediaItem.data["playPreviewOnly"] = true;
+ WinJS.Promise.timeout().then(function tryPreview() {
+ MSEPlatform.PlaybackHelpers.playMedia(that._media._mediaItem.data, true)
+ })
+ }
+ else if (this._media.smidEnablerInEffect) {
+ code = MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED.code;
+ error.code = code
+ }
+ if (bubbleError) {
+ MSEPlatform.Playback.MediaPlayer._fireTagPlaybackError(this, code, source, postPendedText);
+ if (serviceRequest && serviceRequest.completion && serviceRequest.completion.complete) {
+ this._skipThisError = true;
+ serviceRequest.completion.complete(false)
+ }
+ }
+ }, _setSourceFromMediaInstance: function MediaPlayer_setSourceFromMediaInstance() {
+ this._tagPlayer.src = this._media.source
+ }, _replaceSourceOnMediaInstance: function MediaPlayer_replaceSourceOnMediaInstance() {
+ URL.revokeObjectURL(this._media.source);
+ this._media.source = this._tagPlayer.src
+ }, _autoplay: false, _tagPlayer: null, _media: null, _disposed: false, _skipThisError: false
+ }, {
+ createMediaTag: function MediaPlayer_createMediaTag(type) {
+ return document.createElement(type)
+ }, _fireTagPlaybackError: function MediaPlayer_fireTagPlaybackError(player, error, context, postPendedText) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::_fireTagPlaybackError: error = " + MSEPlatform.Playback.mediaErrorToString(error));
+ MSEPlatform.Playback.assert(player && player.firePlaybackError, "Fix misconfigured media tag error handler");
+ if (player && player.firePlaybackError)
+ player.firePlaybackError(error, context, postPendedText)
+ }, _drmNotifyException: function MediaPlayer_drmNotifyException(player, ex, source) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::_drmNotifyException: " + JSON.stringify(ex) + " source: " + source);
+ WinJS.Promise.timeout().then(function notifyDrmException() {
+ MSEPlatform.Playback.MediaPlayer._fireTagPlaybackError(player, MSEPlatform.Playback.Error.NS_E_WMP_DRM_GENERIC_LICENSE_FAILURE.code, source)
+ })
+ }
+ }), AudioPlayer: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.MediaPlayer", function AudioPlayer_constructor(mediaInstance, autoPlay) {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::constructor: Creating audio player");
+ this.base("audio", mediaInstance, autoPlay);
+ if (!this._usingPreActivatedTag && mediaInstance.protectionState !== MSEPlatform.Playback.ProtectionState.unprotected)
+ this.configureDRM();
+ if (this._usingFastStartTag) {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::constructor: usingFastStart ");
+ MSEPlatform.Playback.assert(!mediaInstance.isLocal, "fast start tag should only be used with streaming content");
+ MSEPlatform.Playback.assert(mediaInstance.protectionState === MSEPlatform.Playback.ProtectionState.drmProtected, "fast start tag should only be used with protected content");
+ this._tagPlayer.fastStartProperties["Url"] = mediaInstance.source
+ }
+ else if (this._usingPreActivatedTag)
+ this._replaceSourceOnMediaInstance();
+ else
+ this._setSourceFromMediaInstance()
+ }, {
+ isFastStartSource: {
+ get: function isFastStartSource_get() {
+ return this._usingFastStartTag
+ }
+ }, _createHtmlTag: function AudioPlayer_createHtmlTag(playerType, mediaInstance, autoPlay) {
+ var htmlTag;
+ this._usingFastStartTag = false;
+ this._usingPreActivatedTag = false;
+ var audioTagForFileActivation = MSEPlatform.Playback.AudioPlayer.audioTagForFileActivation;
+ if (audioTagForFileActivation) {
+ if (!audioTagForFileActivation.error) {
+ htmlTag = audioTagForFileActivation;
+ this._usingPreActivatedTag = true
+ }
+ else {
+ mediaInstance.mediaInstanceId = null;
+ autoPlay = true
+ }
+ MSEPlatform.Playback.AudioPlayer.audioTagForFileActivation = null
+ }
+ if (!this._usingPreActivatedTag)
+ if (!MS.Entertainment.Utilities.isMusicApp2 && autoPlay && MSEPlatform.Playback.AudioPlayer.fastStartTag && !mediaInstance.isLocal && !mediaInstance.disableFastStart && mediaInstance.protectionState === MSEPlatform.Playback.ProtectionState.drmProtected) {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::_createHtmlTag(): Using FastStart");
+ htmlTag = MSEPlatform.Playback.AudioPlayer.fastStartTag;
+ htmlTag.autoplay = autoPlay;
+ MSEPlatform.Playback.AudioPlayer.fastStartTag = null;
+ this._usingFastStartTag = true
+ }
+ else
+ htmlTag = MSEPlatform.Playback.MediaPlayer.prototype._createHtmlTag.call(this, playerType, mediaInstance, autoPlay);
+ return htmlTag
+ }, _usingFastStartTag: false, _usingPreActivatedTag: false
+ }, {
+ createFastStartTag: function AudioPlayer_createFastStartTag() {
+ function configureFastStartTagForDRM(htmlTag) {
+ var disableFastStart = function disableFastStart(e) {
+ if (this.fastStartTag)
+ this.disposeFastStartTag();
+ this.fastStartBlockedOnLA = true
+ }.bind(this);
+ var mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager;
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
+ var copyProtectionSystems = new Windows.Foundation.Collections.PropertySet;
+ copyProtectionSystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput";
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = copyProtectionSystems;
+ htmlTag._mediaProtectionManagerBindings = MS.Entertainment.Utilities.addEventHandlers(mediaProtectionManager, {
+ componentloadfailed: disableFastStart, servicerequested: disableFastStart
+ });
+ try {
+ htmlTag.msSetMediaProtectionManager(mediaProtectionManager)
+ }
+ catch (e) {
+ MS.Entertainment.Platform.Playback.fail("_configureFastStartTagForDRM: Unexpected exception on msSetMediaProtectionManager: " + e.message);
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(htmlTag, e, "configureFastStartTagForDRM_msSetMediaProtectionManager")
+ }
+ }
+ if (this.fastStartTag) {
+ MSEPlatform.Playback.Etw.traceString("-AudioPlayer:_createFastStartTag exists already");
+ return
+ }
+ var extensionManager = new Windows.Media.MediaExtensionManager;
+ this.fastStartTag = MSEPlatform.Playback.MediaPlayer.createMediaTag("audio");
+ this.fastStartTag.fastStartProperties = new Windows.Foundation.Collections.PropertySet;
+ this.fastStartTag.fastStartProperties["Url"] = "";
+ extensionManager.registerSchemeHandler("Microsoft.Entertainment.Platform.Playback.FastStartSchemeHandler", "fsms:", this.fastStartTag.fastStartProperties);
+ this.fastStartTag.setAttribute("msAudioCategory", "backgroundCapableMedia");
+ this.fastStartTag.width = 0;
+ this.fastStartTag.height = 0;
+ this.fastStartTag.autoplay = false;
+ configureFastStartTagForDRM.call(this, this.fastStartTag);
+ this.fastStartTag.src = "fsms://#";
+ MSEPlatform.Playback.Etw.traceString("-AudioPlayer:createFastStartTag: created")
+ }, disposeFastStartTag: function AudioPlayer_disposeFastStartTag() {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::disposeFastStartTag: Disposing tag");
+ if (this.fastStartTag) {
+ if (this.fastStartTag._mediaProtectionManagerBindings) {
+ this.fastStartTag._mediaProtectionManagerBindings.cancel();
+ this.fastStartTag._mediaProtectionManagerBindings = null
+ }
+ this.fastStartTag.removeAttribute("src");
+ this.fastStartTag.load();
+ this.fastStartTag = null;
+ this.fastStartBlockedOnLA = false
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::disposeFastStartTag: Nothing to dispose")
+ }, hasValidFastStartTag: function AudioPlayer_hasValidFastStartTag() {
+ return !!this.fastStartTag
+ }, audioTagForFileActivation: null, fastStartBlockedOnLA: false, fastStartTag: null
+ }), VideoPlayer: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.MediaPlayer", function VideoPlayer_constructor(mediaInstance, autoPlay) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::constructor: Creating video player");
+ this.base("video", mediaInstance, autoPlay);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.playback.switchToXboxMBRSourceForH264StreamingPercent)
+ if ((Math.random() * 100) < configurationManager.playback.switchToXboxMBRSourceForH264StreamingPercent)
+ MSEPlatform.Playback.VideoPlayer._useXboxMBRSourceForH264Streaming = true;
+ else
+ MSEPlatform.Playback.VideoPlayer._useXboxMBRSourceForH264Streaming = false;
+ if (!isBlobUrl(mediaInstance.source)) {
+ if (mediaInstance.videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264 && !MSEPlatform.Playback.VideoPlayer._useXboxMBRSourceForH264Streaming) {
+ var adaptiveSourceOpenedEventHandler = this._adaptiveSourceOpened.bind(this);
+ MSEPlatform.Playback.VideoPlayer._adaptiveSourceManager.addEventListener("adaptivesourceopenedevent", adaptiveSourceOpenedEventHandler);
+ this._unhookEventHandlers = function _unhookEventHandlers() {
+ MSEPlatform.Playback.VideoPlayer._adaptiveSourceManager.removeEventListener("adaptivesourceopenedevent", adaptiveSourceOpenedEventHandler);
+ if (this._adaptiveStreamingEvents) {
+ this._adaptiveStreamingEvents.cancel();
+ this._adaptiveStreamingEvents = null
+ }
+ };
+ this._reporter = new Microsoft.Entertainment.Platform.Playback.SmoothStreamingPlaybackReporter;
+ this._reporter.setMainAttribute("URL", mediaInstance.source);
+ if (this._urlRetryMap)
+ this._urlRetryMap = {}
+ }
+ else if ((MS.Entertainment.Utilities.isVideoApp2 || MS.Entertainment.Utilities.isMusicApp2) && !MS.Entertainment.isAppModeOverride) {
+ var smoothStreamingSessionCreatedEventHandler = this._smoothStreamingSessionCreated.bind(this);
+ var resourceAvailabilityChanged = this._resourceAvailabilityChanged.bind(this);
+ MSEPlatform.Playback.VideoPlayer._smoothStreamingSessionManager.addEventListener("sessioncreated", smoothStreamingSessionCreatedEventHandler);
+ Windows.Xbox.ApplicationModel.ApplicationResourceLimits.addEventListener("resourceavailabilitychanged", resourceAvailabilityChanged);
+ this._unhookEventHandlers = function _unhookEventHandlers() {
+ MSEPlatform.Playback.VideoPlayer._smoothStreamingSessionManager.removeEventListener("sessioncreated", smoothStreamingSessionCreatedEventHandler);
+ Windows.Xbox.ApplicationModel.ApplicationResourceLimits.removeEventListener("resourceavailabilitychanged", resourceAvailabilityChanged)
+ }
+ }
+ if (configurationManager)
+ this._startBitrate = configurationManager.playback.defaultStartBitrate
+ }
+ MSEPlatform.Playback.VideoPlayer.registerByteStreamHandlerForURL(mediaInstance.source, mediaInstance.videoEncoding);
+ this._tagPlayer.videoEncoding = mediaInstance.videoEncoding;
+ if (mediaInstance.protectionState !== MSEPlatform.Playback.ProtectionState.unprotected)
+ this.configureDRM();
+ if (this._usingPreActivatedTag)
+ this._replaceSourceOnMediaInstance();
+ else
+ this._setSourceFromMediaInstance()
+ }, {
+ _createHtmlTag: function VideoPlayer_createHtmlTag(playerType, mediaInstance, autoPlay) {
+ var htmlTag;
+ this._usingPreActivatedTag = false;
+ var videoTagForFileActivation = MSEPlatform.Playback.VideoPlayer.videoTagForFileActivation;
+ if (videoTagForFileActivation) {
+ htmlTag = videoTagForFileActivation;
+ this._usingPreActivatedTag = true;
+ MSEPlatform.Playback.VideoPlayer.videoTagForFileActivation = null
+ }
+ if (!this._usingPreActivatedTag)
+ htmlTag = MSEPlatform.Playback.MediaPlayer.prototype._createHtmlTag.call(this, playerType, mediaInstance, autoPlay);
+ return htmlTag
+ }, dispose: function VideoPlayer_dispose() {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::dispose: Disposing video player");
+ this._unhookEventHandlers();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this._tagPlayer.videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264 && !MSEPlatform.Playback.VideoPlayer._useXboxMBRSourceForH264Streaming) {
+ var that = this;
+ this._flushTelemetryBuffer();
+ this._reporter = null;
+ this._urlRetryMap = {};
+ this.videoStreamStatistics = null;
+ WinJS.Promise.timeout(1000).then(function () {
+ MSEPlatform.Playback.MediaPlayer.prototype.dispose.call(that)
+ })
+ }
+ else {
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride && this._smoothStreamingSession)
+ if (!this._isConstrained)
+ try {
+ var lastBitrate = this._smoothStreamingSession.currentBitrate;
+ if (lastBitrate > 0) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::dispose: Updating recorded last bitrate seen = " + lastBitrate);
+ MSEPlatform.Playback.VideoPlayer.lastBitrateUnconstrained = lastBitrate;
+ Windows.Storage.ApplicationData.current.localSettings.values[MSEPlatform.Playback.VideoPlayer.lastBitrateUnconstrainedKey] = lastBitrate
+ }
+ }
+ catch (e) { }
+ MSEPlatform.Playback.MediaPlayer.prototype.dispose.call(this)
+ }
+ }, _unhookEventHandlers: function VideoPlayer_unhookEventHandlers() {
+ return
+ }, _isConstrained: {
+ get: function VideoPlayer_isConstrained() {
+ return (Windows.Xbox.ApplicationModel.ApplicationResourceLimits.resourceAvailability === Windows.Xbox.ApplicationModel.ResourceAvailability.constrained)
+ }
+ }, _smoothStreamingSessionCreated: function VideoPlayer_smoothStreamingSessionCreated(session) {
+ if (session.uri !== this._media.source)
+ return;
+ var Playback = MSEPlatform.Playback;
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_smoothStreamingSessionCreated: Event: smoothstreamingsessioncreated");
+ MS.Entertainment.Platform.assert(this._smoothStreamingSession === null, "_smoothStreamingSessionCreated called while this._smoothStreamingSession was non-null");
+ this._smoothStreamingSession = session;
+ if (Microsoft.Entertainment.Configuration.ConfigurationManager().playback.enableVideo2SmoothStreamingTelemetry && !isBlobUrl(session.uri))
+ try {
+ var reporter = new Microsoft.Entertainment.Platform.Playback.SmoothStreamingPlaybackReporter;
+ session.setReporter(reporter)
+ }
+ catch (e) {
+ MS.Entertainment.Platform.fail("Failed to set session reporter: " + (e && e.message) ? e.message : String.empty, e ? e.number : 0)
+ }
+ try {
+ Playback.VideoPlayer.lastBitrateUnconstrained = Windows.Storage.ApplicationData.current.localSettings.values[Playback.VideoPlayer.lastBitrateUnconstrainedKey]
+ }
+ catch (e) {
+ MS.Entertainment.Platform.fail("Failure to read " + Playback.VideoPlayer.lastBitrateUnconstrainedKey + " from localSettings: " + (e && e.message) ? e.message : "", e ? e.number : 0)
+ }
+ try {
+ if (this._isConstrained)
+ this._smoothStreamingSession.startBitrate = Math.min(this._startBitrate, Playback.VideoPlayer.maxBitrateConstrained);
+ else
+ this._smoothStreamingSession.startBitrate = Playback.VideoPlayer.lastBitrateUnconstrained ? Playback.VideoPlayer.lastBitrateUnconstrained : this._startBitrate
+ }
+ catch (e) {
+ MS.Entertainment.Platform.fail("Exception in _smoothStreamingSessionCreated: " + (e && e.message) ? e.message : 0, e ? e.number : 0)
+ }
+ if (this._smoothStreamingEvents) {
+ this._smoothStreamingEvents.cancel();
+ this._smoothStreamingEvents = null
+ }
+ this._smoothStreamingEvents = MS.Entertainment.Utilities.addEventHandlers(session, { closed: this._smoothStreamingSessionClosed.bind(this) });
+ this._updateSmoothStreamingSessionRates()
+ }, _smoothStreamingSessionClosed: function VideoPlayer_smoothStreamingSessionClosed(evt) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_smoothStreamingSessionClosed: Event: smoothstreamingsessionclosed(" + evt.errorCode + ")");
+ if (this._smoothStreamingEvents) {
+ this._smoothStreamingEvents.cancel();
+ this._smoothStreamingEvents = null
+ }
+ this._smoothStreamingSession = null
+ }, _resourceAvailabilityChanged: function _resourceAvailabilityChanged(evt) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_resourceAvailabilityChanged: Event: resourceavailabilitychanged");
+ var Playback = MSEPlatform.Playback;
+ if (this._smoothStreamingSession && Playback.VideoPlayer.respectConstrainedMode) {
+ this._updateSmoothStreamingSessionRates();
+ try {
+ if (this._isConstrained) {
+ var currentBitrate = this._smoothStreamingSession.currentBitrate;
+ if (currentBitrate > 0) {
+ Playback.VideoPlayer.lastBitrateUnconstrained = currentBitrate;
+ Windows.Storage.ApplicationData.current.localSettings.values[Playback.VideoPlayer.lastBitrateUnconstrainedKey] = currentBitrate
+ }
+ if (currentBitrate > Playback.VideoPlayer.maxBitrateConstrained) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_resourceAvailabilityChanged: Calling RequestBitrateChange(" + Playback.VideoPlayer.maxBitrateConstrained + ", false)");
+ this._smoothStreamingSession.requestBitrateChange(Playback.VideoPlayer.maxBitrateConstrained, true)
+ }
+ }
+ else {
+ var newBitrate = Playback.VideoPlayer.lastBitrateUnconstrained && Playback.VideoPlayer.lastBitrateUnconstrained > 0 ? Playback.VideoPlayer.lastBitrateUnconstrained : this._startBitrate;
+ if (newBitrate > this._smoothStreamingSession.currentBitrate) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_resourceAvailabilityChanged: Calling RequestBitrateChange(" + newBitrate + ", true)");
+ this._smoothStreamingSession.requestBitrateChange(newBitrate, true)
+ }
+ }
+ }
+ catch (e) {
+ MS.Entertainment.Platform.fail("Exception calling requestBitrateChange: " + (e && e.message) ? e.message : 0, e ? e.number : 0)
+ }
+ var positionMs = this.forceTimeUpdate();
+ this.seekToPosition(Math.max(positionMs - 100, 0))
+ }
+ }, _updateSmoothStreamingSessionRates: function VideoPlayer_updateSmoothStreamingSessionRates() {
+ try {
+ var Playback = MSEPlatform.Playback;
+ MS.Entertainment.Platform.assert(this._smoothStreamingSession, "_updateSmoothStreamingSessionRates called while this._smoothStreamingSession was null");
+ if (this._isConstrained) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_updateSmoothStreamingSessionRates: mode values being applied to this._smoothStreamingSession");
+ this._smoothStreamingSession.maximumBitrate = Playback.VideoPlayer.maxBitrateConstrained;
+ this._smoothStreamingSession.maximumWidth = Playback.VideoPlayer.maxWidthConstrained;
+ this._smoothStreamingSession.maximumHeight = Playback.VideoPlayer.maxHeightConstrained
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_updateSmoothStreamingSessionRates: 'Full' (unconstrained) mode values being applied to this._smoothStreamingSession");
+ this._smoothStreamingSession.maximumBitrate = Playback.VideoPlayer.maxBitrateUnconstrained;
+ this._smoothStreamingSession.maximumWidth = Playback.VideoPlayer.maxWidthUnconstrained;
+ this._smoothStreamingSession.maximumHeight = Playback.VideoPlayer.maxHeightUnconstrained
+ }
+ }
+ catch (e) {
+ MS.Entertainment.Platform.fail("_updateSmoothStreamingSessionRates exception: " + (e && e.message) ? e.message : 0, e ? e.number : 0)
+ }
+ }, _adaptiveSourceOpened: function VideoPlayer_adaptiveSourceOpened(args) {
+ var adaptiveSource = args.adaptiveSource;
+ if (adaptiveSource.uri.absoluteUri !== this._media.source)
+ return;
+ this._adaptiveStreamingEvents = MS.Entertainment.Utilities.addEventHandlers(adaptiveSource, {
+ manifestreadyevent: this._onH264PiffManifestReady.bind(this), adaptivesourcestatusupdatedevent: this._onAdaptiveSourceStatusUpdated.bind(this), adaptivesourcefailedevent: this._onAdaptiveSourceFailed.bind(this)
+ })
+ }, _onH264PiffManifestReady: function VideoPlayer_onH264PiffManifestReady(args) {
+ this._currentH264VideoStream = null;
+ this._h264ChunksDownloaded = 0;
+ function getPreferredAudioStream(availableStreams) {
+ function AudioStreamDescriptor(fourCC, bitrate, index) {
+ this._fourCC = fourCC;
+ this._bitrate = bitrate;
+ this._index = index
+ }
+ function compareAudioStreamDescriptors(descriptorOne, descriptorTwo) {
+ var FourCCCodes = new Array(858604357, 1279476033, 1212367169);
+ if (descriptorOne._fourCC === descriptorTwo._fourCC)
+ return (descriptorTwo._bitrate - descriptorOne._bitrate);
+ else {
+ var fourCCAIndex = FourCCCodes.indexOf(descriptorOne._fourCC);
+ var fourCCBIndex = FourCCCodes.indexOf(descriptorTwo._fourCC);
+ return fourCCAIndex - fourCCBIndex
+ }
+ }
+ var audioStreamDescriptors = new Array;
+ for (var i = 0; i < availableStreams.size; i++)
+ if (availableStreams[i].type === Microsoft.Media.AdaptiveStreaming.MediaStreamType.audio) {
+ var firstTrack = availableStreams[i].availableTracks[0];
+ var fourCC = firstTrack.fourCC;
+ var bitrate = firstTrack.bitrate;
+ audioStreamDescriptors.push(new AudioStreamDescriptor(fourCC, bitrate, i))
+ }
+ var preferredAudioStream = null;
+ if (audioStreamDescriptors.length !== 0) {
+ audioStreamDescriptors.sort(compareAudioStreamDescriptors);
+ preferredAudioStream = availableStreams[audioStreamDescriptors[0]._index]
+ }
+ return preferredAudioStream
+ }
+ function selectVideoTracks(videoStream) {
+ var availableTracks = videoStream.availableTracks;
+ var availableBitrates = availableTracks.map(function getBitrate(track) {
+ if (track.bitrate)
+ return track.bitrate
+ });
+ this._media._mediaItem.data.availableVideoBitrates = availableBitrates;
+ var selectedVideoTracks = [];
+ for (var i = 0; i < availableTracks.size; i++)
+ if (availableTracks[i].maxWidth <= MSEPlatform.Playback.VideoPlayer.maxWidthUnconstrained && availableTracks[i].maxHeight <= MSEPlatform.Playback.VideoPlayer.maxHeightUnconstrained)
+ selectedVideoTracks.push(availableTracks[i]);
+ MS.Entertainment.Platform.Playback.assert(selectedVideoTracks.length > 0, "Video stream has no tracks available!");
+ videoStream.restrictTracks(selectedVideoTracks);
+ var topBitrate = 0;
+ for (var i = 0; i < selectedVideoTracks.length; i++)
+ if (selectedVideoTracks[i].bitrate >= topBitrate)
+ topBitrate = selectedVideoTracks[i].bitrate;
+ var startingVideoTracks = [];
+ var startingBitrate = Math.min(topBitrate, this._startBitrate);
+ for (var i = 0; i < selectedVideoTracks.length; i++)
+ if (selectedVideoTracks[i].bitrate >= startingBitrate)
+ startingVideoTracks.push(selectedVideoTracks[i]);
+ MS.Entertainment.Platform.Playback.assert(startingVideoTracks.length > 0, "Video stream has no tracks which can be selected!");
+ videoStream.selectTracks(startingVideoTracks)
+ }
+ function getPreferredVideoStream(availableStreams) {
+ var firstVideoStream = null;
+ for (var i = 0; i < availableStreams.size; i++)
+ if (availableStreams[i].type === Microsoft.Media.AdaptiveStreaming.MediaStreamType.video) {
+ firstVideoStream = availableStreams[i];
+ break
+ }
+ if (firstVideoStream)
+ selectVideoTracks.call(this, firstVideoStream);
+ return firstVideoStream
+ }
+ var manifest = args.adaptiveSource.manifest;
+ var availableStreams = manifest.availableStreams;
+ var selectedStreams = new Array;
+ var preferredAudioStream = getPreferredAudioStream(availableStreams);
+ if (preferredAudioStream) {
+ selectedStreams.push(preferredAudioStream);
+ var preferredVideoStream = getPreferredVideoStream.call(this, availableStreams);
+ if (preferredVideoStream) {
+ selectedStreams.push(preferredVideoStream);
+ manifest.selectStreamsAsync(selectedStreams);
+ this._currentH264VideoStream = preferredVideoStream
+ }
+ }
+ this._initializeVideoStreamStats(preferredVideoStream, preferredAudioStream)
+ }, _initializeVideoStreamStats: function VideoPlayer_initializeVideoStreamStats(preferredVideoStream, preferredAudioStream) {
+ this.videoStreamStatistics = {
+ history: [], failureEvents: [], maxVideoBitrate: 0, maxWidth: 0, maxHeight: 0, videoCodec: FourCCMap.Unknown, audioCodec: FourCCMap.Unknown
+ };
+ for (var i = 0; i < preferredVideoStream.availableTracks.length; i++) {
+ this.videoStreamStatistics.maxVideoBitrate = Math.max(preferredVideoStream.availableTracks[i].bitrate, this.videoStreamStatistics.maxVideoBitrate);
+ this.videoStreamStatistics.maxWidth = Math.max(preferredVideoStream.availableTracks[i].maxWidth, this.videoStreamStatistics.maxWidth);
+ this.videoStreamStatistics.maxHeight = Math.max(preferredVideoStream.availableTracks[i].maxHeight, this.videoStreamStatistics.maxHeight)
+ }
+ this.videoStreamStatistics.videoCodec = FourCCMap[preferredVideoStream.availableTracks[0].fourCC] || FourCCMap.Unknown;
+ this.videoStreamStatistics.audioCodec = FourCCMap[preferredAudioStream.availableTracks[0].fourCC] || FourCCMap.Unknown
+ }, _addVideoStreamFailureStats: function VideoPlayer_addVideoStreamFailureStats(stat) {
+ if (this.videoStreamStatistics) {
+ var MAX_STREAM_FAILURE_ENTRIES = 30;
+ this.videoStreamStatistics.failureEvents.unshift(stat);
+ this.videoStreamStatistics.failureEvents.splice(MAX_STREAM_FAILURE_ENTRIES)
+ }
+ }, _addVideoStreamHistoryStats: function VideoPlayer_addVideoStreamHistoryStats(stat) {
+ function ageOutHistoryBuffers(buffers, positionHNS, maxAgeHNS) {
+ if (!buffers)
+ return;
+ var prevHist = null;
+ for (var i = 0; i < buffers.length; i++) {
+ var hist = buffers[i];
+ if (hist.hnsStartTime < (positionHNS - maxAgeHNS))
+ buffers.splice(i);
+ if (prevHist)
+ if ((prevHist.hnsStartTime - hist.hnsStartTime) <= 0)
+ buffers.splice(i);
+ prevHist = hist
+ }
+ }
+ if (this.videoStreamStatistics) {
+ var MAX_STREAM_HISTORY_HNS = 600000000;
+ this.videoStreamStatistics.history.unshift(stat);
+ ageOutHistoryBuffers(this.videoStreamStatistics.history, this.forceTimeUpdate() * 10000, MAX_STREAM_HISTORY_HNS)
+ }
+ }, _onAdaptiveSourceStatusUpdated: function VideoPlayer_onAdaptiveSourceStatusUpdated(args) {
+ function populateUrlRetryMap(urlInfo) {
+ if (urlInfo)
+ if (this._urlRetryMap[urlInfo])
+ this._urlRetryMap[urlInfo]++;
+ else
+ this._urlRetryMap[urlInfo] = 1
+ }
+ if (args)
+ switch (args.updateType) {
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkDownloaded:
+ this._h264ChunksDownloaded++;
+ if (this._h264ChunksDownloaded === this._h264ChunksDownloadedThreshold && this._currentH264VideoStream)
+ this._currentH264VideoStream.selectTracks(this._currentH264VideoStream.availableTracks);
+ this._reportChunkDownloaded(args);
+ if ((this._h264ChunksDownloaded % 20) === 0 && this._reporter)
+ this._reporter.sendLogAsync("Report", false);
+ break;
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.rebuffer:
+ if (this._reporter) {
+ this._reporter.reportBuffering();
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceStatusUpdated: Rebuffering")
+ }
+ this._addVideoStreamFailureStats({
+ hnsTime: this.forceTimeUpdate() * HNS_PER_MILLISECOND, info: "Rebuffering due to poor network conditions"
+ });
+ break;
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkConnectHttpInvalid:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.nextChunkHttpInvalid:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkHdrHttpInvalid:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkHdrError:
+ populateUrlRetryMap.call(this, args.additionalInfo);
+ var responseValue = args.httpResponse ? args.httpResponse.toString() : "None";
+ var hresult = args.result ? args.result.toString() : "None";
+ var chunkUrl = args.additionalInfo || string.empty;
+ var errorString = enumToString(args.updateType, Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType) + "_" + responseValue + "_" + hresult;
+ if (this._reporter) {
+ this._reporter.setSubAttribute("hr", errorString);
+ this._reporter.setSubAttribute("ChunkUrl", chunkUrl);
+ this._reporter.sendLogAsync("MissingChunk", false);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceStatusUpdated: Missing chunk. Url:" + chunkUrl + " hr:" + errorString)
+ }
+ this._addVideoStreamFailureStats({
+ hnsTime: this.forceTimeUpdate() * HNS_PER_MILLISECOND, info: "Missing chunk: hr=" + errorString
+ });
+ break;
+ default:
+ break
+ }
+ }, _flushTelemetryBuffer: function VideoPlayer_flushTelemetryBuffer() {
+ if (this._reporter) {
+ this._reporter.sendLogAsync("Report", false);
+ this._reporter.sendLogAsync("Close", false)
+ }
+ }, _getTelemetryInfoFromChunkDownloadedArgs: function _getTelemetryInfoFromChunkDownloadedArgs(args) {
+ var TelemetryFields = {
+ chunkIndex: 0, url: 1, mediaStreamType: 2, chunkStartTimeHns: 3, chunkDurationns: 4, chunkBitrate: 5, chunkByteCount: 6, downloadRequestedTimeMs: 7, downloadCompletedTimeMs: 8, chunkPerceivedBandwidth: 9, avgPerceivedBandwidth: 10, bufferLevelAtRequested90kHz: 11, bufferLevelAtCompleted90kHz: 12, responseHeaders: 13
+ };
+ function uint32(val) {
+ var value = +val;
+ return isNaN(value) ? 0 : value
+ }
+ function getChunkIP(responseHeaders) {
+ function convertIPToDecimal(dottedIP) {
+ var decimalIP = 0;
+ var currentMultiplier = 1;
+ var splitIP = dottedIP.split(".");
+ for (var i = 0; i < splitIP.length; i++) {
+ decimalIP += (currentMultiplier * (+splitIP[i]));
+ currentMultiplier *= 256
+ }
+ return decimalIP
+ }
+ var cdnIPPatterns = [/x-cdn-info: \w+_([\d.]+)/, /X-CDN-Info: ([\d.]+)-\w+/,];
+ for (var i = 0; i < cdnIPPatterns.length; i++) {
+ var matches = cdnIPPatterns[i].exec(responseHeaders);
+ if (matches && matches.length > 1)
+ return convertIPToDecimal(matches[1])
+ }
+ return 0
+ }
+ var BUFFER_UNITS_90KHZ_TO_HNS = (1 / 90) * HNS_PER_MILLISECOND;
+ var additionalInfo = args.additionalInfo.split(";");
+ var info = {};
+ info.chunkId = uint32(additionalInfo[TelemetryFields.chunkIndex]);
+ info.url = additionalInfo[TelemetryFields.url];
+ info.bitrate = uint32(additionalInfo[TelemetryFields.chunkBitrate]);
+ info.startTickMs = uint32(additionalInfo[TelemetryFields.downloadRequestedTimeMs]);
+ info.openedTickMs = uint32(additionalInfo[TelemetryFields.downloadRequestedTimeMs]);
+ info.completedTicksMs = uint32(additionalInfo[TelemetryFields.downloadCompletedTimeMs]);
+ info.sizeInBytes = uint32(additionalInfo[TelemetryFields.chunkByteCount]);
+ info.hnsStartTime = uint32(additionalInfo[TelemetryFields.chunkStartTimeHns]);
+ info.avgBandwidth = uint32(additionalInfo[TelemetryFields.avgPerceivedBandwidth]);
+ info.lastBandwidth = uint32(additionalInfo[TelemetryFields.chunkPerceivedBandwidth]);
+ info.hnsBuffer = uint32(additionalInfo[TelemetryFields.bufferLevelAtCompleted90kHz]) * BUFFER_UNITS_90KHZ_TO_HNS;
+ info.isVideo = uint32(additionalInfo[TelemetryFields.mediaStreamType]) === 1;
+ info.chunkIP = getChunkIP(additionalInfo[TelemetryFields.responseHeaders]);
+ info.chunkStartTimeHns = uint32(additionalInfo[TelemetryFields.chunkStartTimeHns]);
+ return info
+ }, _reportChunkDownloaded: function VideoPlayer_reportChunkDownloaded(args) {
+ var info = this._getTelemetryInfoFromChunkDownloadedArgs(args);
+ var bitrateIndex = 0;
+ var width = 0;
+ var height = 0;
+ if (info.isVideo) {
+ this._addVideoStreamHistoryStats(info);
+ if (this._reporter) {
+ if (!this._urlRetryMap[info.url])
+ this._reporter.setMainAttribute("DownloadRetries", "0");
+ else
+ this._reporter.setMainAttribute("DownloadRetries", this._urlRetryMap[info.url].toString());
+ for (var i = 0; i < this._currentH264VideoStream.availableTracks.length; i++)
+ if (this._currentH264VideoStream.availableTracks[i].bitrate === info.bitrate) {
+ bitrateIndex = this._currentH264VideoStream.availableTracks[i].trackIndex;
+ width = this._currentH264VideoStream.availableTracks[i].maxWidth;
+ height = this._currentH264VideoStream.availableTracks[i].maxHeight
+ }
+ this._reporter.addChunkInfo(bitrateIndex, info.bitrate, width, height);
+ this._reporter.addChunkHistory(info.chunkId, info.bitrate, info.bitrateIndex, info.hnsBuffer, info.avgBandwidth, info.lastBandwidth);
+ this._reporter.addDownloadData(info.startTickMs, info.openedTickMs, info.completedTicksMs, info.sizeInBytes, info.hnsStartTime, info.bitrate);
+ this._reporter.addChunkIP(info.chunkStartTimeHns, info.chunkIP)
+ }
+ }
+ }, selectVideoBitrate: function selectVideoBitrate(requestedBitrate) {
+ if (this._currentH264VideoStream) {
+ if (requestedBitrate) {
+ var requestedVideoTrack = [];
+ for (var i = 0; i < this._currentH264VideoStream.availableTracks.length; i++)
+ if (this._currentH264VideoStream.availableTracks[i].bitrate === +requestedBitrate) {
+ requestedVideoTrack.push(this._currentH264VideoStream.availableTracks[i]);
+ break
+ }
+ MS.Entertainment.Platform.Playback.assert(requestedVideoTrack.length > 0, "Video stream has no tracks with matching bitrate!");
+ if (requestedVideoTrack.length > 0)
+ this._currentH264VideoStream.selectTracks(requestedVideoTrack)
+ }
+ else
+ this._currentH264VideoStream.selectTracks(this._currentH264VideoStream.availableTracks);
+ var positionMs = this.forceTimeUpdate();
+ this.seekToPosition(Math.max(positionMs - 100, 0));
+ if (this.videoStreamStatistics && this.videoStreamStatistics.history)
+ this.videoStreamStatistics.history.length = 0
+ }
+ }, _onAdaptiveSourceFailed: function _onAdaptiveSourceFailed(args) {
+ if (this._reporter && args) {
+ var httpResponse = args.httpResponse ? args.httpResponse.toString() : "None";
+ var hresult = args.result ? args.result.toString() : "None";
+ var errorState = enumToString(args.failType, Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType) + "_" + httpResponse + "_" + hresult;
+ switch (args.failType) {
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestParseFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestVersionUnsupported:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestHttpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestInvalid:
+ this._reporter.setSubAttribute("hr", errorState);
+ this._reporter.sendLogAsync("CorruptedManifest", true);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceFailed: Corrupted Manifest. hr:" + errorState);
+ break;
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpRecvFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpParseResponseFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpTooManyRedirect:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpRedirectFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpRedirectNotAllowed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpCreateFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpOpenFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpSendFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkConnectHttpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkNextHttpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkHdrParseFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkInvalidData:
+ this.retryableError = true;
+ default:
+ this._reporter.setSubAttribute("hr", errorState);
+ this._reporter.sendLogAsync("Error", true);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceFailed: Error. hr:" + errorState)
+ }
+ }
+ }, getAudioTracks: function VideoPlayer_getAudioTracks() {
+ MSEPlatform.Playback.assert(this._tagPlayer);
+ return this._tagPlayer.audioTracks
+ }, getSelectedAudioTrack: function VideoPlayer_getSelectedAudioTrack() {
+ var selectedAudioTrack = -1;
+ for (var i = 0; i < this._tagPlayer.audioTracks.length; i++)
+ if (this._tagPlayer.audioTracks[i].enabled) {
+ selectedAudioTrack = i;
+ break
+ }
+ return selectedAudioTrack
+ }, selectAudioTrack: function VideoPlayer_selectAudioTrack(trackIndex) {
+ if (trackIndex === +trackIndex && trackIndex >= 0 && trackIndex < this._tagPlayer.audioTracks.length) {
+ this._tagPlayer.audioTracks[trackIndex].enabled = true;
+ for (var i = 0; i < this._tagPlayer.audioTracks.length; i++)
+ if (i !== trackIndex && this._tagPlayer.audioTracks[i].enabled)
+ this._tagPlayer.audioTracks[i].enabled = false
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::selectAudioTrack failed. Must provide a valid track index. Track index: " + trackIndex)
+ }, _smoothStreamingSession: null, _smoothStreamingEvents: null, _startBitrate: 2 * 1024 * 1024, _reporter: null, _adaptiveStreamingEvents: null, _currentH264VideoStream: null, _currentlyRegisteredByteStreamHandler: null, _h264ChunksDownloaded: 0, _h264ChunksDownloadedThreshold: 5, _urlRetryMap: {}, videoStreamStatistics: null, retryableError: false
+ }, {
+ initializeVideoExtensions: function VideoPlayer_initializeVideoExtensions() {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp && (MS.Entertainment.Utilities.isVideoApp1 || MS.Entertainment.Utilities.isApp2 || MS.Entertainment.Utilities.isTestApp)) {
+ this._extensionManager = new Windows.Media.MediaExtensionManager;
+ this._adaptiveSourceManager = Microsoft.Media.AdaptiveStreaming.AdaptiveSourceManager.getDefault();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager && this._adaptiveSourceManager) {
+ this._adaptiveSourceManager.sendExtendedCommand("heuristichealthybufferpercent", String(configurationManager.playback.h264StreamingHealthyBufferPercentage));
+ this._adaptiveSourceManager.sendExtendedCommand("httpwaitentireresponse", String(configurationManager.playback.h264StreamingSendSamplesAfterDownloadCompletes));
+ this._adaptiveSourceManager.setDownloadBufferSec(configurationManager.playback.h264StreamingDownloadBufferSizeSecs)
+ }
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride) {
+ this._smoothStreamingSessionManager = new Windows.Xbox.Media.SmoothStreamingSessionManager;
+ if (configurationManager) {
+ this.maxBitrateConstrained = configurationManager.playback.maxBitrateConstrained;
+ this.maxWidthConstrained = configurationManager.playback.maxWidthConstrained;
+ this.maxHeightConstrained = configurationManager.playback.maxHeightConstrained;
+ this.respectConstrainedMode = configurationManager.playback.respectConstrainedMode
+ }
+ }
+ }
+ if (MS.Entertainment.Utilities.isVideoApp1 && !MS.Entertainment.Utilities.isWindowsBlue)
+ this._extensionManager.registerByteStreamHandler("Microsoft.Entertainment.Platform.Playback.CFFByteStreamHandler", ".mp4", String.empty)
+ }, registerByteStreamHandlerForURL: function VideoPlayer_registerByteStreamHandlerForURL(url, videoEncoding) {
+ if (!isBlobUrl(url) && (MS.Entertainment.Utilities.isVideoApp1 || MS.Entertainment.Utilities.isApp2 || MS.Entertainment.Utilities.isTestApp) && !MS.Entertainment.Utilities.isAmsterdamApp) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var isH264 = (videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264);
+ if (isH264 && !this._useXboxMBRSourceForH264Streaming) {
+ if (this._currentlyRegisteredByteStreamHandler !== this.VideoStreamFormat.H264) {
+ this._currentlyRegisteredByteStreamHandler = this.VideoStreamFormat.H264;
+ var ps = new Windows.Foundation.Collections.PropertySet;
+ ps.insert("{A5CE1DE8-1D00-427B-ACEF-FB9A3C93DE2D}", this._adaptiveSourceManager);
+ this._extensionManager.registerByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", "", "text/xml", ps);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_registerByteStreamHandlerForURL: Registered H.264 bytestream handler. Url:" + url)
+ }
+ }
+ else if (this._currentlyRegisteredByteStreamHandler !== this.VideoStreamFormat.VC1) {
+ this._currentlyRegisteredByteStreamHandler = this.VideoStreamFormat.VC1;
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride) {
+ var ps = new Windows.Foundation.Collections.PropertySet;
+ ps.insert("SmoothStreamingSessionManager", this._smoothStreamingSessionManager);
+ this._extensionManager.registerByteStreamHandler("Windows.Xbox.Media.SmoothStreamingByteStreamHandler", "", "text/xml", ps);
+ if (isH264)
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_registerByteStreamHandlerForURL: Using Xbox MBR source for H.264 content!")
+ }
+ else
+ this._extensionManager.registerByteStreamHandler("Microsoft.Entertainment.Platform.Playback.MBRByteStreamHandler", "", "text/xml");
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_registerByteStreamHandlerForURL: Registered VC-1 bytestream handler. Url:" + url)
+ }
+ }
+ }, maxWidthUnconstrained: {
+ get: function maxWidthUnconstrained_get() {
+ return (MS.Entertainment.Utilities.isApp1 && !MS.Entertainment.Utilities.isWindowsBlue) ? 1366 : 1920
+ }
+ }, maxHeightUnconstrained: {
+ get: function maxHeightUnconstrained_get() {
+ return (MS.Entertainment.Utilities.isApp1 && !MS.Entertainment.Utilities.isWindowsBlue) ? 768 : 1080
+ }
+ }, maxWidthConstrained: 1920, maxHeightConstrained: 720, maxBitrateConstrained: 850000, maxBitrateUnconstrained: 4294967295, respectConstrainedMode: true, lastBitrateUnconstrained: 0, lastBitrateUnconstrainedKey: "VideoPlayer._lastBitrateUnconstrained", VideoStreamFormat: {
+ H264: "H264", VC1: "VC1"
+ }, _useXboxMBRSourceForH264Streaming: false, _smoothStreamingSessionManager: null, _adaptiveSourceManager: null, _extensionManager: null, _currentlyRegisteredByteStreamHandler: null
+ })
+ })
+ })()
+})();
+/* >>>>>>/components/playback/controls/xplayer.js:41389 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ shouldDisableDlnaPlayTo: function shouldDisableDlnaPlayTo(mediaInstance) {
+ var mediaType = mediaInstance.mediaType;
+ var disable = false;
+ if (mediaType === Microsoft.Entertainment.Queries.ObjectType.video) {
+ if (!MS.Entertainment.Utilities.isWindowsBlue && mediaInstance.protectionState === MSEPlatform.Playback.ProtectionState.drmProtected && MS.Entertainment.Utilities.isValidServiceId(mediaInstance.serviceIdSafe))
+ disable = true
+ }
+ else if (!MS.Entertainment.Utilities.isWindowsBlue && !mediaInstance.isLocal && mediaInstance.protectionState === MSEPlatform.Playback.ProtectionState.drmProtected)
+ disable = true;
+ return disable
+ }, XPlayer: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function XPlayer_constructor(playerContainer) {
+ this._playerContainer = playerContainer;
+ this._setupDlnaPlayToMgr();
+ if (MS.Entertainment.Utilities.SignIn)
+ MS.Entertainment.Utilities.SignIn.addEventListener("signInComplete", function () {
+ this._createFastStartAudioTag()
+ }.bind(this));
+ this._onAppResume = this._onAppResume.bind(this);
+ this._onAppSuspending = this._onAppSuspending.bind(this);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", this._onAppResume);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", this._onAppSuspending);
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ this._volumeController = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this._volumeControllerBindings = WinJS.Binding.bind(this._volumeController, {
+ volume: this._onVolumeValueStateChange.bind(this), mute: this._onVolumeValueStateChange.bind(this)
+ });
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState)) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ MS.Entertainment.UI.Framework.addEventHandlers(uiStateService, { isAppVisibleChanged: this._onAppVisibleChanged.bind(this) })
+ }
+ }
+ }, {
+ _contentRestrictionService: {
+ get: (function () {
+ var contentRestrictionServiceHolder = null;
+ return function _contentRestrictionServiceGetter() {
+ if (contentRestrictionServiceHolder === null && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService))
+ contentRestrictionServiceHolder = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ return contentRestrictionServiceHolder
+ }
+ })()
+ }, dispose: function dispose() {
+ this._cleanupDlnaPlayToMgr();
+ if (MS.Entertainment.Utilities.SignIn)
+ MS.Entertainment.Utilities.SignIn.removeEventListener("signInComplete");
+ Windows.UI.WebUI.WebUIApplication.removeEventListener("resuming", this._onAppResume);
+ Windows.UI.WebUI.WebUIApplication.removeEventListener("suspending", this._onAppSuspending);
+ if (this._volumeControllerBindings) {
+ this._volumeControllerBindings.cancel();
+ this._volumeControllerBindings = null
+ }
+ this._playerContainer = null
+ }, autoPlay: {
+ get: function autoPlay_get() {
+ return this._autoPlay
+ }, set: function autoPlay_set(value) {
+ this._autoPlay = value
+ }
+ }, currentMedia: {
+ get: function currentMedia_get() {
+ return this._currentMedia
+ }, set: function currentMedia_set(value) {
+ this._setMedia(value)
+ }
+ }, nextMedia: {
+ get: function nextMedia_get() {
+ return this._nextMedia
+ }, set: function nextMedia_set(value) {
+ this._setNextMedia(value)
+ }
+ }, _volume: {
+ get: function volume_get() {
+ this._ensurePipeline();
+ return this._currentPlayer.volume
+ }, set: function volume_set(value) {
+ this._ensurePipeline();
+ this._currentPlayer.volume = value
+ }
+ }, muted: {
+ get: function muted_get() {
+ this._ensurePipeline();
+ return this._currentPlayer.muted
+ }, set: function muted_set(value) {
+ this._ensurePipeline();
+ this._currentPlayer.muted = value
+ }
+ }, playbackRate: {
+ get: function playbackRate_get() {
+ this._ensurePipeline();
+ return this._currentPlayer.playbackRate
+ }, set: function playbackRate_set(value) {
+ this._ensurePipeline();
+ this._currentPlayer.playbackRate = value
+ }
+ }, videoStreamStatistics: {
+ get: function videoStreamStatistics_get() {
+ if (this._currentPlayer && this._currentPlayer.videoStreamStatistics)
+ return this._currentPlayer.videoStreamStatistics;
+ return null
+ }
+ }, retryableError: {
+ get: function retryableError_get() {
+ if (this._currentPlayer && this._currentPlayer.retryableError)
+ return this._currentPlayer.retryableError;
+ return false
+ }
+ }, play: function play() {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::Play()");
+ this._ensurePipeline();
+ this._currentPlayer.play()
+ }, pause: function pause() {
+ this._ensurePipeline();
+ this._currentPlayer.pause()
+ }, stop: function stop() {
+ this._ensurePipeline();
+ this._currentPlayer.stop();
+ if (this.currentMedia)
+ this.currentMedia.stopPosition = this.forceTimeUpdate()
+ }, seekToPosition: function seekToPosition(positionMsec) {
+ this._ensurePipeline();
+ try {
+ this._currentMedia.maxPosition = this._currentPlayer.currentTime;
+ this._currentPlayer.seekToPosition(positionMsec);
+ this._currentMedia.maxPosition = positionMsec / 1000
+ }
+ catch (e) {
+ MSEPlatform.Playback.Etw.tracePlaybackError(e.code, e.msExtendedCode, "XPlayer::seekToPosition")
+ }
+ }, fastFwd: function fastFwd() { }, rewind: function rewind() { }, slowFwd: function slowFwd() { }, slowRewind: function slowRewind() { }, selectVideoBitrate: function selectVideoBitrate(requestedBitrate) {
+ this._ensurePipeline();
+ this._currentPlayer.selectVideoBitrate(requestedBitrate)
+ }, getAudioTracks: function getAudioTracks() {
+ this._ensurePipeline();
+ return this._currentPlayer.getAudioTracks()
+ }, getSelectedAudioTrack: function getSelectedAudioTrack() {
+ this._ensurePipeline();
+ return this._currentPlayer.getSelectedAudioTrack()
+ }, selectAudioTrack: function selectAudioTrack(trackIndex) {
+ this._ensurePipeline();
+ this._currentPlayer.selectAudioTrack(trackIndex)
+ }, _removePlayerFromDOM: function _removePlayerFromDOM(player) {
+ var playerElement = player.getElement();
+ if (this._playerContainer && this._playerContainer.contains(playerElement))
+ this._playerContainer.removeChild(playerElement);
+ if (playerElement.parentNode && playerElement.parentNode.contains(playerElement))
+ playerElement.parentNode.removeChild(playerElement)
+ }, _removePlayerSrc: function _removePlayerSrc(player, removeFromDOM) {
+ if (player) {
+ if (removeFromDOM)
+ this._removePlayerFromDOM(player);
+ if (player.media && !player.media._errorDescriptor)
+ if (player.media.source && player.media.source.match && player.media.source.match(/^blob*:/i))
+ URL.revokeObjectURL(player.media.source);
+ player.dispose()
+ }
+ }, reset: function reset(resetNext) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_reset: resetNext = " + resetNext);
+ if (resetNext) {
+ if (this._nextPlayer) {
+ this._unhookNextMediaEvents();
+ this._nextMedia = null;
+ this._removePlayerSrc(this._nextPlayer, false);
+ this._nextPlayer = null
+ }
+ }
+ else if (this._currentPlayer && !this._isDlnaConnectionPresent()) {
+ this._unhookCurrentMediaEvents();
+ this._currentMedia = null;
+ this._removePlayerSrc(this._currentPlayer, true);
+ this._currentPlayer = null
+ }
+ }, enableTimeUpdate: function enableTimeUpdate() {
+ if (this._currentMediaEventsCallback && this._currentPlayer) {
+ this._currentPlayer.removeEventListener("timeupdate", this._currentMediaEventsCallback);
+ this._currentPlayer.addEventListener("timeupdate", this._currentMediaEventsCallback, false)
+ }
+ }, disableTimeUpdate: function disableTimeUpdate() {
+ if (this._currentMediaEventsCallback && this._currentPlayer)
+ this._currentPlayer.removeEventListener("timeupdate", this._currentMediaEventsCallback)
+ }, forceTimeUpdate: function forceTimeUpdate() {
+ if (this._currentPlayer)
+ return this._currentPlayer.currentTime * 1000
+ }, isRemoteSession: function isRemoteSession() {
+ return this._isDlnaConnectionPresent()
+ }, _prePlayAsync: function _prePlay_Async(mediaInstance) {
+ function fireExplicitContentBlockedErrorAndFail(error, context, message) {
+ if (error) {
+ message += " Details: ";
+ try {
+ message += JSON.stringify(error)
+ }
+ catch (ex) {
+ message += error.toString()
+ }
+ }
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_fireExplicitContentBlockedErrorAndFail: explicit content blocked. context: " + context + ", message: " + message);
+ MSEPlatform.Playback.fail(message);
+ var playbackError = MS.Entertainment.Platform.Playback.makePlaybackError(MSEPlatform.Playback.makeParentallyBlockedError(), context);
+ playbackError.innerError = error;
+ return WinJS.Promise.wrapError(playbackError)
+ }
+ if (!mediaInstance || !mediaInstance._ratedContentDescriptionPromise)
+ return WinJS.Promise.as();
+ return mediaInstance._ratedContentDescriptionPromise.then(function gotRatedContentDescription(ratedContentDescription) {
+ return this._contentRestrictionService.requestContentAccessAsync(ratedContentDescription)
+ }.bind(this), function gotRatedContentDescription_failed(error) {
+ var msg = "_ratedContentDescriptionPromise retuned an unexpected async error.";
+ return fireExplicitContentBlockedErrorAndFail(error, "gotRatedContentDescription_failed", msg)
+ }).then(function requestContentAccessAsync_complete(canPlay) {
+ if (canPlay)
+ return;
+ var itemName = "No title";
+ try {
+ itemName = mediaInstance._mediaItem.data.name
+ }
+ catch (ex) {
+ { }
+ }
+ MS.Entertainment.Platform.Playback.Etw.traceString("RESTRICTED ITEM: " + itemName);
+ var errorCode = MSEPlatform.Playback.makeParentallyBlockedError();
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!signedInUser.xuid)
+ errorCode = MSEPlatform.Playback.Error.X8_E_PLAYBACK_LOGON_TO_PLAY_EXPLICIT_CONTENT;
+ return WinJS.Promise.wrapError(MSEPlatform.Playback.makePlaybackError(errorCode, "ParentalControl"))
+ }, function requestContentAccessAsync_failed(error) {
+ var msg = "requestContentAccessAsync retuned an unexpected async error.";
+ return fireExplicitContentBlockedErrorAndFail(error, "requestContentAccessAsync_failed", msg)
+ })
+ }, _setMedia: function _setMedia(mediaInstance) {
+ if (!mediaInstance) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::setMedia(): null mediaInstance!");
+ throw "XPlayer::setMedia(): null mediaInstance!";
+ }
+ this._nextMediaStarted = false;
+ this._prePlayAsync(mediaInstance).done(function _prePlayAsync_set_media_completed() {
+ var name = (mediaInstance._mediaItem && mediaInstance._mediaItem.data) ? mediaInstance._mediaItem.data.name : String.empty;
+ MSEPlatform.Playback.Etw.traceString("+XPlayer::_setMedia: name=[" + name + "], source=[" + mediaInstance.source + "]");
+ if (this._isDlnaConnectionPresent()) {
+ var dlnaNextPlayer;
+ if (!MSEPlatform.Playback.shouldDisableDlnaPlayTo(mediaInstance)) {
+ this._unhookCurrentMediaEvents();
+ try {
+ dlnaNextPlayer = this._createMediaPlayer(mediaInstance, false);
+ if (!dlnaNextPlayer.msPlayToDisabled) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_setMedia, set PlayToSource.next on current player and start playto");
+ this._configurePlayToByRefMediaPlayer(dlnaNextPlayer, mediaInstance);
+ this._setVolumeValueAndStateOnTag(dlnaNextPlayer);
+ this._currentPlayer.msPlayToSource.next = dlnaNextPlayer.msPlayToSource;
+ if (MS.Entertainment.Utilities.isVideoApp1 && mediaInstance.startPosition) {
+ var startTime = Math.floor((+mediaInstance.startPosition) / 1000) + 1;
+ dlnaNextPlayer.currentTime = startTime
+ }
+ this._currentPlayer.msPlayToSource.playNext()
+ }
+ this._currentMedia = null;
+ this._removePlayerSrc(this._currentPlayer, true);
+ this._currentPlayer = dlnaNextPlayer;
+ this._currentMedia = mediaInstance;
+ this._hookupCurrentMediaEvents();
+ this._playerContainer.appendChild(this._currentPlayer.getElement())
+ }
+ catch (ex) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("XPlayer::_setMedia: Exception thrown when configuring dlnaNextPlayer: " + ex);
+ var playbackError = MS.Entertainment.Platform.Playback.makePlaybackError(MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_PLAYTO_UNEXPECTED_ERR, "XPlayer::_setMedia() threw exception when configuring dlnaNextPlayer");
+ this._firePlaybackError(playbackError, playbackError.context);
+ this._currentMedia = null;
+ this._removePlayerSrc(this._currentPlayer, true)
+ }
+ }
+ if (!dlnaNextPlayer || dlnaNextPlayer.msPlayToDisabled)
+ if (this._currentPlayer && this._currentMedia) {
+ this._nextMedia = mediaInstance;
+ this._nextMediaLoaded = false;
+ this._nextMediaStarted = false;
+ this._nextMediaError = false;
+ this._fireNextMediaError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED, "XPlayer::_setMedia, playTo is disabled for media. Current media playing, treat this as next media")
+ }
+ else
+ this._firePlaybackError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED, "XPlayer::_setMedia, playTo is disabled for media");
+ dlnaNextPlayer = null
+ }
+ else {
+ if (this._currentPlayer)
+ this.reset(false);
+ this._currentMedia = mediaInstance;
+ this._currentPlayer = this._createMediaPlayer(mediaInstance, this._autoPlay);
+ this._configurePlayToByRefMediaPlayer(this._currentPlayer, this._currentMedia);
+ this._hookupCurrentMediaEvents();
+ this._setVolumeValueAndStateOnTag(this._currentPlayer);
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_setMedia: audio/video tag appending");
+ if (this._currentPlayer.playerType === "VIDEO" && this._currentPlayer.isPreActivatedSource);
+ else
+ this._playerContainer.appendChild(this._currentPlayer.getElement())
+ }
+ MSEPlatform.Playback.Etw.traceString("-XPlayer::_setMedia:")
+ }.bind(this), function _prePlayAsync_set_media_failed(error) {
+ MSEPlatform.Playback.Etw.traceString("-XPlayer::_setMedia: _prePlayAsync_set_media_failed");
+ this._currentMedia = mediaInstance;
+ var playbackError = error;
+ if (!error || !error.code || !error.context)
+ playbackError = MSEPlatform.Playback.makePlaybackError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC, "XPlayer::_setMedia() failed");
+ return this._firePlaybackError(playbackError, playbackError.context)
+ }.bind(this))
+ }, _setNextMedia: function _setNextMedia(mediaInstance) {
+ if (mediaInstance) {
+ var name = WinJS.Utilities.getMember("_mediaItem.data.name", mediaInstance) || String.empty;
+ MSEPlatform.Playback.Etw.traceString("+XPlayer::_setNextMedia: name=[" + name + "], source=[" + mediaInstance.source + "]")
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("+XPlayer::_setNextMedia: null, prerolled media is disposed");
+ if (this._nextPlayer)
+ this.reset(true);
+ if (!mediaInstance)
+ return;
+ else if (!this._isDlnaConnectionPresent() || !MSEPlatform.Playback.shouldDisableDlnaPlayTo(mediaInstance))
+ this._nextPlayer = this._createMediaPlayer(mediaInstance, false);
+ this._nextMedia = mediaInstance;
+ this._nextMediaLoaded = false;
+ this._nextMediaStarted = false;
+ this._nextMediaError = false;
+ var succeeded = true;
+ if (this._isDlnaConnectionPresent())
+ if (!this._nextPlayer || this._nextPlayer.msPlayToDisabled) {
+ this._fireNextMediaError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED, "XPlayer::_setNextMedia, playTo is disabled for media");
+ succeeded = false
+ }
+ if (succeeded)
+ this._hookupNextMediaEvents();
+ MSEPlatform.Playback.Etw.traceString("-XPlayer::_setNextMedia")
+ }, _fireNextMediaError: function _fireNextMediaError(error, context) {
+ MSEPlatform.Playback.firePlaybackError(this._handleNextMediaEvents.bind(this), this._remapErrorForPlayTo(error), context)
+ }, _firePlaybackError: function _firePlaybackError(error, context, postPendedText) {
+ MSEPlatform.Playback.firePlaybackError(this._currentMediaEventsCallback, this._remapErrorForPlayTo(error), context, null, postPendedText)
+ }, _remapErrorForPlayTo: function _remapErrorForPlayTo(error) {
+ var mappedError = error;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var isSubscription = signedInUser && signedInUser.isSubscription;
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_remapErrorForPlayTo: user is " + isSubscription ? "MUSIC PASS user" : "NON-MusicPass user");
+ if (this._isDlnaConnectionPresent() && error && (typeof (error) === "object") && (error.code === MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED.code))
+ if (isSubscription)
+ mappedError = MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_CANT_PLAYTO_PREMIUM;
+ else
+ mappedError = MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_CANT_PLAYTO;
+ return mappedError
+ }, _createMediaPlayer: function _createMediaPlayer(mediaInstance, autoPlay) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_createMediaPlayer: creating audio/video player. mediaInstance.source = " + mediaInstance.source);
+ var Playback = MSEPlatform.Playback;
+ var mediaPlayer;
+ if (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ mediaPlayer = new Playback.VideoPlayer(mediaInstance, autoPlay);
+ else {
+ mediaPlayer = new Playback.AudioPlayer(mediaInstance, autoPlay);
+ var mediaElement = mediaPlayer.getElement();
+ if (mediaPlayer.isFastStartSource) {
+ WinJS.Promise.timeout().then(function fastStartSimulateMediaLoaded() {
+ if (!mediaPlayer.error) {
+ mediaElement.durationOverrideMS = mediaPlayer.getMediaDurationMS();
+ this._currentMediaEventsCallback({
+ srcElement: mediaElement, type: "loadedmetadata"
+ })
+ }
+ else {
+ var target = { error: mediaPlayer.error };
+ this._currentMediaEventsCallback({
+ srcElement: mediaElement, type: "error", target: target
+ })
+ }
+ }.bind(this));
+ MSEPlatform.Playback.assert(autoPlay, "fast start tag should only be used with autoplay");
+ mediaPlayer.play()
+ }
+ }
+ if (mediaPlayer.isPreActivatedSource) {
+ var mediaElement = mediaPlayer.getElement();
+ Playback.Etw.traceString("XPlayer::_CreateMediaPlayer() pre created audioTag or videoTag");
+ WinJS.Promise.timeout().then(function preCreatedHtmlTagSimulateEvents() {
+ if (!mediaPlayer.error) {
+ if (this._currentMedia && this._currentMedia._mediaItem && this._currentMedia._mediaItem.data)
+ if (!this._currentMedia._mediaItem.data.duration || this._currentMedia._mediaItem.data.duration <= 0)
+ this._currentMedia._mediaItem.data.duration = Math.round(this._currentPlayer.duration * 1000);
+ this._currentMediaEventsCallback({
+ srcElement: mediaElement, type: "loadedmetadata"
+ });
+ this._currentMediaEventsCallback({
+ srcElement: mediaElement, type: "playing"
+ });
+ if (mediaPlayer.ended)
+ this._currentMediaEventsCallback({
+ srcElement: mediaElement, type: "ended"
+ })
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp1)
+ this._currentMediaEventsCallback({
+ srcElement: mediaElement, target: mediaElement, type: "error"
+ })
+ }.bind(this))
+ }
+ return mediaPlayer
+ }, _errorFilterHandler: null, _hookupCurrentMediaEvents: function _hookupCurrentMediaEvents() {
+ var currentPlayer = this._currentPlayer;
+ if (!this._errorFilterHandler)
+ this._errorFilterHandler = function errorFilter(e) {
+ var primarySession;
+ var shouldSkipForApp2 = false;
+ var shouldSimulateEnded = false;
+ var shouldRetryPlayback = false;
+ var isPlayToReceiverSessionRunning = false;
+ if (MS.Entertainment.Utilities.isApp2) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ primarySession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ isPlayToReceiverSessionRunning = primarySession && primarySession.isPlayToReceiverSessionRunning
+ }
+ shouldSkipForApp2 = e.target.endOfStream || isPlayToReceiverSessionRunning || (e.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_ENHANCED_STORAGE.code) || (e.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_ABORT.code) || (e.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_FILE_NOT_FOUND.code) || (e.target.error.msExtendedCode === MSEPlatform.Playback.Error.MF_E_UNSUPPORTED_RATE.code) || (e.target.error.msExtendedCode === MSEPlatform.Playback.MediaTagError.MEDIA_ENGINE_ERR_NOERROR.code);
+ if (shouldSkipForApp2)
+ if (e.target.endOfStream)
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_errorFilter() Error after EOS, msExtendedCode = " + e.target.error.msExtendedCode);
+ else {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_errorFilter() Errors on Video2 ignored, msExtendedCode = " + e.target.error.msExtendedCode);
+ if (e.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_ENHANCED_STORAGE.code) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_errorFilter() Received PlayReady decryptor error. Set retry flag.");
+ shouldRetryPlayback = true
+ }
+ else if (primarySession) {
+ var currentPosition = primarySession.currentPosition;
+ var duration = +(primarySession.duration);
+ if (!isPlayToReceiverSessionRunning && (duration !== 0) && ((currentPosition / duration) >= 0.95))
+ shouldSimulateEnded = true
+ }
+ }
+ }
+ var shouldSkipThisError = ((currentPlayer && currentPlayer.skipThisError) || shouldSkipForApp2) && !shouldRetryPlayback;
+ if (currentPlayer)
+ currentPlayer.skipThisError = false;
+ if (!shouldSkipThisError) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_errorFilter() Forwarding error to other subscribers.");
+ this._currentMediaEventsCallback(e)
+ }
+ else if (shouldSimulateEnded) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_errorFilter() Simulating ended event.");
+ this._currentMediaEventsCallback({
+ srcElement: e.target, type: "ended", target: e.target
+ })
+ }
+ }.bind(this);
+ if (this._currentMediaEventsCallback) {
+ currentPlayer.addEventListener("loadedmetadata", this._currentMediaEventsCallback, false);
+ currentPlayer.addEventListener("playing", this._currentMediaEventsCallback, false);
+ currentPlayer.addEventListener("ended", this._currentMediaEventsCallback, false);
+ currentPlayer.addEventListener("pause", this._currentMediaEventsCallback, false);
+ currentPlayer.addEventListener("error", this._errorFilterHandler, false);
+ currentPlayer.addEventListener("seeked", this._currentMediaEventsCallback, false);
+ currentPlayer.addEventListener("durationchange", this._currentMediaEventsCallback, false);
+ currentPlayer.addEventListener("ratechange", this._currentMediaEventsCallback, false)
+ }
+ this.enableTimeUpdate();
+ var currentMediahandler = this._handleCurrentMediaEvents.bind(this);
+ currentPlayer.addEventListener("ended", currentMediahandler, false);
+ currentPlayer.addEventListener("playing", currentMediahandler, false);
+ currentPlayer.addEventListener("pause", currentMediahandler, false);
+ currentPlayer.addEventListener("error", currentMediahandler, false);
+ currentPlayer.addEventListener("progress", currentMediahandler, false);
+ if (currentPlayer && !currentPlayer.msPlayToDisabled)
+ try {
+ if (currentPlayer.msPlayToSource && currentPlayer.msPlayToSource.connection) {
+ var dlnaHandler = this._handleDlnaConnectionEvents.bind(this);
+ currentPlayer.msPlayToSource.connection.addEventListener("error", dlnaHandler, false);
+ currentPlayer.msPlayToSource.connection.addEventListener("statechanged", dlnaHandler, false);
+ currentPlayer.msPlayToSource.connection.addEventListener("transferred", dlnaHandler, false)
+ }
+ }
+ catch (ex) {
+ MS.Entertainment.UI.Debug.writeLine("Failed to hook up DLNA Connection events: " + ex)
+ }
+ this._unhookCurrentMediaEvents = function () {
+ if (currentPlayer) {
+ currentPlayer.removeEventListener("ended", currentMediahandler, false);
+ currentPlayer.removeEventListener("playing", currentMediahandler, false);
+ currentPlayer.removeEventListener("pause", currentMediahandler, false);
+ currentPlayer.removeEventListener("error", currentMediahandler, false);
+ currentPlayer.removeEventListener("progress", currentMediahandler, false);
+ if (this._currentMediaEventsCallback) {
+ currentPlayer.removeEventListener("loadedmetadata", this._currentMediaEventsCallback);
+ currentPlayer.removeEventListener("playing", this._currentMediaEventsCallback);
+ currentPlayer.removeEventListener("ended", this._currentMediaEventsCallback);
+ currentPlayer.removeEventListener("pause", this._currentMediaEventsCallback);
+ currentPlayer.removeEventListener("error", this._errorFilterHandler);
+ currentPlayer.removeEventListener("seeked", this._currentMediaEventsCallback);
+ currentPlayer.removeEventListener("durationchange", this._currentMediaEventsCallback);
+ currentPlayer.removeEventListener("ratechange", this._currentMediaEventsCallback)
+ }
+ this.disableTimeUpdate();
+ if (currentPlayer && !currentPlayer.msPlayToDisabled)
+ try {
+ if (currentPlayer.msPlayToSource && currentPlayer.msPlayToSource.connection) {
+ currentPlayer.msPlayToSource.connection.removeEventListener("error", dlnaHandler);
+ currentPlayer.msPlayToSource.connection.removeEventListener("statechanged", dlnaHandler);
+ currentPlayer.msPlayToSource.connection.removeEventListener("transferred", dlnaHandler)
+ }
+ }
+ catch (ex) {
+ MS.Entertainment.UI.Debug.writeLine("Failed to unhook DLNA Connection events: " + ex)
+ }
+ }
+ }
+ }, _configurePlayToByRefMediaPlayer: function _configurePlayToByRefMediaPlayer(player, media) {
+ if (MS.Entertainment.Utilities.isWindowsBlue)
+ if (player && !player.msPlayToDisabled)
+ try {
+ if (player.msPlayToSource) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_configurePlayToByRefMediaPlayer - Hooking up DLNA PlayToByRef");
+ var mediaIsProtected = false;
+ var mediaIdExists = false;
+ var playToUrl = MS.Entertainment.Utilities.isMusicApp ? "ms-playtoapp-xboxmusic://media?" : "ms-playtoapp-xboxvideo://media?";
+ if (media) {
+ mediaIsProtected = (media.protectionState !== MSEPlatform.Playback.ProtectionState.unprotected);
+ if (media._mediaItem && media._mediaItem.data) {
+ if (MS.Entertainment.Utilities.isValidServiceId(media._mediaItem.data.zuneId)) {
+ mediaIdExists = true;
+ playToUrl = this._appendParamToUrl(playToUrl, "X_id={" + MS.Entertainment.Utilities.trimGuid(media._mediaItem.data.zuneId) + "}")
+ }
+ else if (MS.Entertainment.Utilities.isValidServiceId(media.serviceId)) {
+ mediaIdExists = true;
+ playToUrl = this._appendParamToUrl(playToUrl, "X_id={" + MS.Entertainment.Utilities.trimGuid(media.serviceId) + "}")
+ }
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser && signedInUser.xuid)
+ playToUrl = this._appendParamToUrl(playToUrl, "XUID=" + signedInUser.xuid)
+ }
+ }
+ if (mediaIdExists && mediaIsProtected) {
+ var playToUri = new Windows.Foundation.Uri(playToUrl);
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_configurePlayToByRefMediaPlayer - setting this._currentPlayer.msPlayToSource.preferredSourceUri");
+ player.msPlayToSource.preferredSourceUri = playToUri
+ }
+ }
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_configurePlayToByRefMediaPlayer - this._currentPlayer.msPlayToSource.preferredSourceUri exception", ex.toString())
+ }
+ }, _appendParamToUrl: function _appendParamToUrl(url, param) {
+ var newUrl = url;
+ if (newUrl[newUrl.length - 1] !== '?')
+ newUrl += '&';
+ newUrl += param;
+ return newUrl
+ }, _unhookCurrentMediaEvents: function _unhookCurrentMediaEvents() { }, _hookupNextMediaEvents: function _hookupNextMediaEvents() {
+ var handler = this._handleNextMediaEvents.bind(this);
+ var nextPlayer = this._nextPlayer;
+ this._unhookNextMediaEvents();
+ nextPlayer.addEventListener("loadedmetadata", handler, false);
+ nextPlayer.addEventListener("error", handler, false);
+ nextPlayer.addEventListener("progress", handler, false);
+ this._unhookNextMediaEvents = function () {
+ nextPlayer.removeEventListener("loadedmetadata", handler);
+ nextPlayer.removeEventListener("error", handler);
+ nextPlayer.removeEventListener("progress", handler)
+ }
+ }, _unhookNextMediaEvents: function _unhookNextMediaEvents() { }, _onSwitchPlayerError: function _onSwitchPlayerError(error) {
+ var msg = "Async errors should have been handled by _switchPlayerAsync: ";
+ try {
+ msg += JSON.stringify(error)
+ }
+ catch (ex) {
+ { }
+ }
+ MSEPlatform.Playback.fail(msg);
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_onSwitchPlayerError. " + MSEPlatform.Playback.mediaErrorToString(error))
+ }, _handleCurrentMediaEvents: function _handleCurrentMediaEvents(event) {
+ var traceInfo = String.empty;
+ if (event.type === "error" && event.target && event.target.error)
+ traceInfo = MSEPlatform.Playback.mediaErrorToString(event.target.error);
+ if (event.type !== "progress")
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleCurrentMediaEvents event from audio/video tag: " + event.type + " " + traceInfo);
+ if (this._currentMedia) {
+ if (event.type != "ended")
+ this._currentMedia.maxPosition = this._currentPlayer ? this._currentPlayer.currentTime : 0;
+ else
+ this._currentMedia.maxPosition = this._currentPlayer.duration;
+ this._currentMedia._lastStateChangeEvent = event
+ }
+ switch (event.type) {
+ case "ended":
+ if (event.target.tagName === "VIDEO" && this._currentPlayer && (this._currentPlayer.currentTime / this._currentPlayer.duration) <= 0.25)
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleCurrentMediaEvents : playback ended at the start of the media. Ignoring ended event");
+ else {
+ event.target.endOfStream = true;
+ if (this.controlIsProcessingNextMedia)
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleCurrentMediaEvents : playback ended before preroll completed");
+ else
+ this._switchPlayerAsync().done(function _switchPlayerAsync_completed(succeeded) {
+ this._nextMediaStarted = false;
+ if (succeeded)
+ this._currentPlayer.play()
+ }.bind(this), this._onSwitchPlayerError.bind(this))
+ }
+ break;
+ case "playing":
+ if (!MSEPlatform.Playback.AudioPlayer.hasValidFastStartTag() && MS.Entertainment.Utilities.isMusicApp1)
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState)) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleCurrentMediaEvents : _createFastStartAudioTag on playing event and app is visible");
+ this._createFastStartAudioTag()
+ }
+ }
+ break;
+ case "progress":
+ MS.Entertainment.Utilities.Telemetry.logPlayerBufferState(this._currentPlayer.buffered, this._currentPlayer.currentTime, this._currentPlayer.duration, "currentPlayer");
+ break;
+ default:
+ break
+ }
+ }, _handleNextMediaEvents: function _handleNextMediaEvents(event) {
+ if (this._nextMedia)
+ this._nextMedia._lastStateChangeEvent = event;
+ switch (event.type) {
+ case "loadedmetadata":
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleNextMediaEvents - loadedmetadata");
+ if (this._nextMedia) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleNextMediaEvents - loadedmetadata, resetting errorDescriptor");
+ this._nextMedia._errorDescriptor = null;
+ this._nextMediaError = false;
+ this._nextMediaLoaded = true;
+ if (this._currentPlayer && (this._currentPlayer.ended || this._currentMedia._errorDescriptor)) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleNextMediaEvents - preroll completed after previous track ended. Calling switchPlayer.");
+ this._switchPlayerAsync().done(function _switchPlayerAsync_completed(succeeded) {
+ if (succeeded)
+ this._currentPlayer.play()
+ }.bind(this), this._onSwitchPlayerError.bind(this))
+ }
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleNextMediaEvents - loadedmetadata, nextMedia null?");
+ break;
+ case "error":
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleNextMediaEvents - error");
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleNextMediaEvents - error," + " src = " + (event.target.src ? event.target.src : "null") + ", currentsrc = " + (event.target.currentSrc ? event.target.currentSrc : "null") + ", " + MSEPlatform.Playback.mediaErrorToString(event.target.error));
+ if (event.target.error.msExtendedCode === MSEPlatform.Playback.Error.MF_E_UNSUPPORTED_RATE.code) {
+ MSEPlatform.Playback.Etw.traceString("MF_E_UNSUPPORTED_RATE ignored in a prerolled item");
+ break
+ }
+ if (this._nextMedia) {
+ this._nextMedia._errorDescriptor = event.target.error;
+ this._nextMediaError = true
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleNextMediaEvents - error, nextMedia null?");
+ break;
+ case "progress":
+ MS.Entertainment.Utilities.Telemetry.logPlayerBufferState(this._nextPlayer.buffered, this._nextPlayer.currentTime, this._nextPlayer.duration, "nextPlayer");
+ break;
+ default:
+ break
+ }
+ }, _handleDlnaConnectionEvents: function _handleDlnaConnectionEvents(event) {
+ switch (event.type) {
+ case "error":
+ if (this._currentMedia && this._currentMedia.alternateVideoEncoding !== null) {
+ this._firePlaybackError(MSEPlatform.Playback.Error.MF_E_UNSUPPORTED_BYTESTREAM, "Dlna translated error. Not subject to DLNA telemetry.");
+ break
+ }
+ var telemetryParameter = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, parameterValue: event.code ? event.code : 0
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlayToSenderError, telemetryParameter);
+ var errorString = MSEPlatform.Playback.errorToString(event.code);
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleDlnaConnectionEvents - Error = " + errorString);
+ MS.Entertainment.UI.Debug.writeLine("DLNA ConnectionError: " + errorString);
+ break;
+ case "statechanged":
+ if (this._currentPlayer && !this._currentPlayer.msPlayToDisabled && this._currentPlayer.msPlayToSource && this._currentPlayer.msPlayToSource.connection) {
+ MS.Entertainment.UI.Debug.writeLine("_currentPlayer connection state: " + this._currentPlayer.msPlayToSource.connection.state);
+ this.playToSenderConnectionState = this._currentPlayer.msPlayToSource.connection.state;
+ if (MS.Entertainment.Utilities.isWindowsBlue && this._currentMedia)
+ this._currentMedia._remoteTrackingMode = true;
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleDlnaConnectionEvents - _currentPlayer Connection StateChanged = " + this.playToSenderConnectionState)
+ }
+ else {
+ MS.Entertainment.UI.Debug.writeLine("DLNA Connection StateChanged: " + event.currentState);
+ this.playToSenderConnectionState = event.currentState;
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleDlnaConnectionEvents - DLNA Connection StateChanged = " + this.playToSenderConnectionState)
+ }
+ if (this._currentMedia && !this._currentMedia._telemetryDataSent && this.playToSenderConnectionState === Windows.Media.PlayTo.PlayToConnectionState.rendering) {
+ var currentMediaIsProtected = (this._currentMedia.protectionState !== MS.Entertainment.Platform.Playback.ProtectionState.unprotected);
+ var currentMediaHasSmid = MS.Entertainment.Utilities.isValidServiceId(this._currentMedia.serviceIdSafe);
+ var playToType = (currentMediaHasSmid && currentMediaIsProtected) ? MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.PlayToByRef : MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.PlayToUGC;
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlayToSenderPlaybackHappened, [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlayToType, parameterValue: playToType
+ }]);
+ this._currentMedia._telemetryDataSent = true
+ }
+ if (this.playToSenderConnectionState === Windows.Media.PlayTo.PlayToConnectionState.disconnected) {
+ this.dmrName = "";
+ this.isRemoteSessionRunning = false;
+ if (MS.Entertainment.Utilities.isWindowsBlue && this._currentMedia)
+ this._currentMedia._remoteTrackingMode = false;
+ if (this._currentPlayer)
+ this._setVolumeValueAndStateOnTag(this._currentPlayer);
+ if (this._currentMedia)
+ this._currentMedia.startPosition = 0;
+ if (this._currentPlayer && this._currentPlayer.msPlayToDisabled)
+ this._firePlaybackError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED, "DLNA actual device error");
+ if (MS.Entertainment.Utilities.isVideoApp1 && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible)
+ this.reset(false);
+ if (this._currentPlayer && this._currentPlayer.isFastStartSource && MSEPlatform.Playback.AudioPlayer.hasValidFastStartTag) {
+ this._nextPlayer = this._createMediaPlayer(this._currentMedia, false);
+ this._nextMedia = this._currentMedia;
+ this._configurePlayToByRefMediaPlayer(this._nextPlayer, this._nextMedia);
+ this._destroyCurrentAndPromoteNextPlayer()
+ }
+ }
+ break;
+ case "transferred":
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_handleDlnaConnectionEvents - DLNA Connection Transferred");
+ MS.Entertainment.UI.Debug.writeLine("DLNA Connection Transferred");
+ break
+ }
+ }, _isDlnaConnectionPresent: function _isDlnaConnectionPresent() {
+ return (this._dlnaPlayToMgr && this.playToSenderConnectionState !== Windows.Media.PlayTo.PlayToConnectionState.disconnected)
+ }, _switchPlayerAsync: function _switchPlayerAsync() {
+ return this._prePlayAsync(this._nextMedia).then(function _prePlayAsync_succeeded() {
+ MSEPlatform.Playback.Etw.traceString("+XPlayer:_switchPlayer. this._nextPlayer = " + this._nextPlayer);
+ if (this._nextPlayer) {
+ MSEPlatform.Playback.Etw.traceSwitchingToNextMedia(this._nextMedia.source);
+ this._unhookCurrentMediaEvents();
+ if (this._isDlnaConnectionPresent()) {
+ if (this._currentPlayer && this._currentPlayer.msPlayToSource)
+ if (this._currentPlayer.msPlayToSource.next) {
+ MSEPlatform.Playback.Etw.traceString("Xplayer::_switchPlayer, PlayToSource.next already exists, start playto");
+ this._setVolumeValueAndStateOnTag(this._nextPlayer);
+ this._currentPlayer.msPlayToSource.playNext()
+ }
+ else if (this._nextPlayer.msPlayToDisabled)
+ this._fireNextMediaError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED, "XPlayer::_switchPlayer, playTo is disabled for media");
+ else
+ try {
+ MSEPlatform.Playback.Etw.traceString("Xplayer::_switchPlayer, PlayToSource.next does not exist, set PlayToSource.next on current player and start playto");
+ this._configurePlayToByRefMediaPlayer(this._nextPlayer, this._nextMedia);
+ this._setVolumeValueAndStateOnTag(this._nextPlayer);
+ this._currentPlayer.msPlayToSource.next = this._nextPlayer.msPlayToSource;
+ this._currentPlayer.msPlayToSource.playNext()
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_switchPlayer. Caught exception in _configurePlayToByRefMediaPlayer");
+ this._currentPlayer.msPlayToSource = null
+ }
+ }
+ else
+ this._configurePlayToByRefMediaPlayer(this._nextPlayer, this._nextMedia)
+ }
+ if (this._nextPlayer === null)
+ if (this.controlIsProcessingNextMedia || (this.controlIsProcessingNextMedia === undefined && MS.Entertainment.Utilities.isMusicApp)) {
+ MSEPlatform.Playback.Etw.traceString("-XPlayer::_switchPlayer. returning false");
+ return false
+ }
+ else if (!(this.isRemoteSessionRunning || MS.Entertainment.Utilities.isVideoApp1)) {
+ this._destroyCurrentAndPromoteNextPlayer();
+ MSEPlatform.Playback.Etw.traceString("-XPlayer:_switchPlayer, setting _nextMediaStarted with currentPlayer " + !!this._currentPlayer);
+ this._nextMediaStarted = true
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("-XPlayer:_switchPlayer. returning false");
+ return false
+ }
+ else {
+ this._destroyCurrentAndPromoteNextPlayer();
+ this._nextMediaStarted = true
+ }
+ var success = !!this._currentPlayer;
+ MSEPlatform.Playback.Etw.traceString("-XPlayer::_switchPlayer, switchSucceeded: returning " + success);
+ return success
+ }.bind(this), function _prePlayAsync_switch_player_failed(error) {
+ MSEPlatform.Playback.Etw.traceString("-XPlayer::_prePlayAsync_switch_player_failed");
+ if (error && error.code && error.context)
+ this._fireNextMediaError(error.code, error.context);
+ else {
+ var playbackError = MSEPlatform.Playback.makePlaybackError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC, "_prePlayAsync failed without an error code");
+ this._fireNextMediaError(playbackError.error, playbackError.context)
+ }
+ return false
+ }.bind(this))
+ }, _destroyCurrentAndPromoteNextPlayer: function _destroyCurrentAndPromoteNextPlayer() {
+ MSEPlatform.Playback.Etw.traceString("+XPlayer::_destroyCurrentAndPromoteNextPlayer");
+ try {
+ if (this._currentPlayer)
+ this._removePlayerSrc(this._currentPlayer, true)
+ }
+ catch (ex) {
+ MSEPlatform.Playback.assert(ex, "Error in media tag removal");
+ MS.Entertainment.Utilities.Telemetry.logErrorInMediaTagRemoval(ex)
+ }
+ this._currentPlayer = this._nextPlayer;
+ this._currentMedia = this._nextMedia;
+ if (this._currentPlayer) {
+ this._setVolumeValueAndStateOnTag(this._currentPlayer);
+ this._playerContainer.appendChild(this._currentPlayer.getElement());
+ this._hookupCurrentMediaEvents()
+ }
+ this._unhookNextMediaEvents();
+ this._nextPlayer = null;
+ this._nextMedia = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService)) {
+ var displayService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService);
+ if (displayService)
+ displayService.showDialogForNonCriticalErrors = false
+ }
+ MSEPlatform.Playback.Etw.traceString("-XPlayer::_destroyCurrentAndPromoteNextPlayer")
+ }, _onSourceRequested: function _onSourceRequested(event) {
+ if (this._currentPlayer && this._currentPlayer.msPlayToDisabled)
+ return;
+ try {
+ var sourceRequest = event.sourceRequest;
+ var deferral = sourceRequest.getDeferral();
+ if (this._currentPlayer) {
+ sourceRequest.setSource(this._currentPlayer.msPlayToSource);
+ if (this._nextMedia && MSEPlatform.Playback.shouldDisableDlnaPlayTo(this._nextMedia))
+ this._fireNextMediaError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED, "XPlayer::_onSourceRequested, playTo is disabled for next media")
+ }
+ else
+ sourceRequest.setSource(null);
+ deferral.complete()
+ }
+ catch (ex) {
+ this._firePlaybackError(ex.number, "DLNA SourceRequested")
+ }
+ }, _onSourceSelected: function _onSourceSelected(event) {
+ if (event && event.friendlyName) {
+ var telemetryParameter = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.DMRFriendlyName, parameterValue: event.friendlyName
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlayToSenderAttempted, telemetryParameter);
+ MSEPlatform.Playback.Etw.traceString("Xplayer::_onSourceSelected, PlayTo DMR Selected: " + event.friendlyName);
+ MS.Entertainment.UI.Debug.writeLine("DLNA SourceSelected: DMR = " + event.friendlyName);
+ this.isRemoteSessionRunning = true;
+ this.dmrName = event.friendlyName
+ }
+ }, _setupDlnaPlayToMgr: function _setupDlnaPlayToMgr() {
+ this.playToSenderConnectionState = Windows.Media.PlayTo.PlayToConnectionState.disconnected;
+ try {
+ this._dlnaPlayToMgr = Windows.Media.PlayTo.PlayToManager.getForCurrentView();
+ if (this._dlnaPlayToMgr) {
+ this._dlnaPlayToMgr.defaultSourceSelection = false;
+ this._dlnaPlayToMgr.addEventListener("sourcerequested", this._onSourceRequested.bind(this), false);
+ this._dlnaPlayToMgr.addEventListener("sourceselected", this._onSourceSelected.bind(this), false)
+ }
+ }
+ catch (ex) {
+ this._dlnaPlayToMgr = null
+ }
+ }, _cleanupDlnaPlayToMgr: function _cleanupDlnaPlayToMgr() {
+ if (this._dlnaPlayToMgr) {
+ this._dlnaPlayToMgr.removeEventListener("sourcerequested", this._onSourceRequested);
+ this._dlnaPlayToMgr.removeEventListener("sourceselected", this._onSourceSelected);
+ this._dlnaPlayToMgr = null
+ }
+ }, _createFastStartAudioTag: function _createFastStartAudioTag() {
+ MSEPlatform.Playback.Etw.traceString("+XPlayer:_createFastStartAudioTag");
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!signIn.isSignedIn) {
+ MSEPlatform.Playback.Etw.traceString("-XPlayer:_createFastStartAudioTag. signIn.isSignedIn = false");
+ return
+ }
+ MSEPlatform.Playback.AudioPlayer.createFastStartTag()
+ }
+ }, _ensurePipeline: function _ensurePipeline() {
+ if (this._currentPlayer === undefined || this._currentPlayer === null || this._currentPlayer.isDisposed) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_ensurePipeline() error! AV pipeline not set yet.");
+ throw "XPlayer::_ensurePipeline() error! AV pipeline not set yet.";
+ }
+ }, _onAppResume: function _onAppResume() {
+ if (MSEPlatform.Playback.AudioPlayer.hasValidFastStartTag)
+ try {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_onAppResume: Destroying FastStart tag on resume. Windows invalidates inactive DRM pipelines on suspend");
+ MSEPlatform.Playback.AudioPlayer.disposeFastStartTag()
+ }
+ catch (e) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_onAppResume: error! AV pipeline not set yet.");
+ MSEPlatform.Playback.assert(false, "failed to destroy fast start tag on resume. exception:" + e)
+ }
+ }, _onAppSuspending: function _onAppSuspending() {
+ try {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_onAppSuspending: close out tracking items");
+ for (var trackingId in this._trackingIdUsage) {
+ var media = this._mediaByTrackingId(trackingId);
+ this._closeTrackingTransaction(media);
+ delete this._trackingIdUsage[trackingId];
+ this._globalDeleteTrackingIdState[trackingId]
+ }
+ }
+ catch (e) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_onAppSuspending: failed to close out tracking items on suspend. exception: " + e);
+ MSEPlatform.Playback.assert(false, "XPlayer::_onAppSuspending: failed to close out tracking items on suspend. exception: " + e)
+ }
+ }, _onAppVisibleChanged: function _onAppVisibleChanged() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState)) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible)
+ this._createFastStartAudioTag();
+ else if (MSEPlatform.Playback.AudioPlayer.hasValidFastStartTag)
+ MSEPlatform.Playback.AudioPlayer.disposeFastStartTag()
+ }
+ }, _onGlobalTrackingIdState: function _onGlobalTrackingIdState(id, state) {
+ if (id) {
+ var trackingIdState = MSEPlatform.SessionManager.trackingIdState;
+ MSEPlatform.Playback.Etw.traceString("Was: " + trackingIdState[id] + " tracking id: " + id);
+ trackingIdState[id] = state;
+ MSEPlatform.Playback.Etw.traceString("Now:" + state + ": " + id)
+ }
+ }, _globalDeleteTrackingIdState: function _globalDeleteTrackingIdState(id) {
+ if (id) {
+ var trackingIdState = MSEPlatform.SessionManager.trackingIdState;
+ MSEPlatform.Playback.Etw.traceString("Deleted " + trackingIdState[id] + " tracking id: " + id);
+ delete trackingIdState[id]
+ }
+ }, _mediaByTrackingId: function _mediaByTrackingId(trackingId) {
+ if (this._trackingIdUsage[trackingId] & MSEPlatform.Playback.XPlayer._mediaBitmask.current)
+ return this._currentMedia;
+ if (this._trackingIdUsage[trackingId] & MSEPlatform.Playback.XPlayer._mediaBitmask.next)
+ return this._nextMedia;
+ return null
+ }, _releaseTrackingRef: function _releaseTrackingRef(media, mediaBitmask) {
+ if (media && media.hasOwnProperty("trackingId") && !!media.trackingId) {
+ if (!this._trackingIdUsage[media.trackingId])
+ this._trackingIdUsage[media.trackingId] = 0;
+ this._trackingIdUsage[media.trackingId] &= ~mediaBitmask
+ }
+ }, _addTrackingRef: function _addTrackingRef(media, mediaBitmask) {
+ if (media && media.hasOwnProperty("trackingId") && !!media.trackingId) {
+ if (!this._trackingIdUsage[media.trackingId])
+ this._trackingIdUsage[media.trackingId] = 0;
+ this._trackingIdUsage[media.trackingId] |= mediaBitmask
+ }
+ }, _checkTracking: function _checkTracking(media, mediaBitmask) {
+ if (media && media.hasOwnProperty("trackingId") && !!media.trackingId && this._trackingIdUsage[media.trackingId] === 0) {
+ if (mediaBitmask === MSEPlatform.Playback.XPlayer._mediaBitmask.current && media._lastStateChangeEvent && media._lastStateChangeEvent.type != "ended")
+ media.maxPosition = this._currentPlayer ? this._currentPlayer.currentTime : 0;
+ this._onTrackedMediaOutOfScope(media);
+ delete this._trackingIdUsage[media.trackingId];
+ this._globalDeleteTrackingIdState(media.trackingId)
+ }
+ }, _onTrackedMediaOutOfScope: function _onTrackedMediaOutOfScope(media) {
+ this._closeTrackingTransaction(media)
+ }, _closeTrackingTransaction: function _closeTrackingTransaction(media) {
+ if (!media)
+ return;
+ Microsoft.Entertainment.Marketplace.Marketplace.sendPlaybackDurationAsync(media.trackingId, media.maxPosition);
+ this._onGlobalTrackingIdState(media.trackingId, "Reported");
+ MSEPlatform.Playback.Etw.traceString("XPlayer::_closeTrackingTransaction(" + media.trackingId + ", " + media.maxPosition + ")")
+ }, _overwriteMediaRefCount: function _overwriteMediaRefCount(destinationMedia, sourceMedia, mediaBitmask) {
+ this._releaseTrackingRef(destinationMedia, mediaBitmask);
+ this._addTrackingRef(sourceMedia, mediaBitmask);
+ this._checkTracking(destinationMedia, mediaBitmask)
+ }, _overwriteCurrentMedia: function _overwriteCurrentMedia(value) {
+ if (value)
+ this._onGlobalTrackingIdState(value.trackingId, "Current");
+ this._overwriteMediaRefCount(this._currentMediaValueHolder, value, MSEPlatform.Playback.XPlayer._mediaBitmask.current);
+ this._currentMediaValueHolder = value
+ }, _overwriteNextMedia: function _overwriteNextMedia(value) {
+ if (value)
+ this._onGlobalTrackingIdState(value.trackingId, "Next");
+ this._overwriteMediaRefCount(this._nextMediaValueHolder, value, MSEPlatform.Playback.XPlayer._mediaBitmask.next);
+ this._nextMediaValueHolder = value
+ }, _currentMedia: {
+ get: function internal_currentMedia_get() {
+ return this._currentMediaValueHolder
+ }, set: function internal_currentMedia_set(value) {
+ this._overwriteCurrentMedia(value)
+ }
+ }, _nextMedia: {
+ get: function internal_nextMedia_get() {
+ return this._nextMediaValueHolder
+ }, set: function internal_nextMedia_set(value) {
+ this._overwriteNextMedia(value)
+ }
+ }, _onVolumeValueStateChange: function VolumeValueStateChange(arg) {
+ if (this._currentPlayer)
+ this._setVolumeValueAndStateOnTag(this._currentPlayer)
+ }, _setVolumeValueAndStateOnTag: function setVolumeValueAndStateOnTag(tag) {
+ try {
+ if (tag && MS.Entertainment.Utilities.isMusicApp1 && this._volumeController) {
+ tag.volume = applyVolumeCurve(this._volumeController.volume);
+ tag.muted = this._volumeController.mute
+ }
+ else if (tag && MS.Entertainment.Utilities.isMusicApp2)
+ tag.volume = (tag.playerType === "AUDIO") ? (Microsoft.Entertainment.Configuration.ConfigurationManager().playback.music2VolumeValue) / 100 : 1.0
+ }
+ catch (e) {
+ MSEPlatform.Playback.Etw.traceString("XPlayer::SetVolumeValueAndStateOnTag threw an error" + e.toString())
+ }
+ function applyVolumeCurve(value) {
+ var curvedVolume = 0;
+ if (value)
+ curvedVolume = Math.pow(value, 7.0 / 4.0);
+ return curvedVolume
+ }
+ }, _currentPlayer: {
+ get: function _currentPlayer_get() {
+ return this._currentMediaPlayer
+ }, set: function _currentPlayer_set(mediaPlayer) {
+ if (this._currentMediaPlayer !== mediaPlayer) {
+ this._currentMediaPlayer = mediaPlayer;
+ if (this._currentMediaPlayer)
+ this.mediaElement = this._currentMediaPlayer.getElement();
+ else
+ this.mediaElement = null;
+ if (!!mediaPlayer)
+ this._currentMediaPlayer.firePlaybackError = this._firePlaybackError.bind(this)
+ }
+ }
+ }, _nextPlayer: {
+ get: function _nextPlayer_get() {
+ return this._nextMediaPlayer
+ }, set: function _nextPlayer_set(mediaPlayer) {
+ if (this._nextMediaPlayer !== mediaPlayer) {
+ this._nextMediaPlayer = mediaPlayer;
+ if (!!mediaPlayer)
+ this._nextMediaPlayer.firePlaybackError = this._fireNextMediaError.bind(this)
+ }
+ }
+ }, _playerContainer: null, _currentMediaPlayer: null, _nextMediaPlayer: null, _currentMediaValueHolder: null, _currentMediaEventsCallback: null, _nextMediaValueHolder: null, _dlnaPlayToMgr: null, _trackingIdUsage: {}, _volumeController: null, _volumeControllerBindings: null, _lastTimeSeparationId: null, _usingFastStartTag: false, _nextMediaLoaded: MS.Entertainment.UI.Framework.observableProperty("_nextMediaLoaded", false), _nextMediaStarted: MS.Entertainment.UI.Framework.observableProperty("_nextMediaStarted", false), _nextMediaError: MS.Entertainment.UI.Framework.observableProperty("_nextMediaError", false), dmrName: MS.Entertainment.UI.Framework.observableProperty("dmrName", String.empty), isRemoteSessionRunning: MS.Entertainment.UI.Framework.observableProperty("isRemoteSessionRunning", false), playToSenderConnectionState: MS.Entertainment.UI.Framework.observableProperty("playToSenderConnectionState", Windows.Media.PlayTo.PlayToConnectionState.disconnected), mediaElement: MS.Entertainment.UI.Framework.observableProperty("mediaElement", null)
+ }, {
+ createInstance: function XPlayer_createInstance(playerContainer) {
+ var isWWA = true;
+ var player = null;
+ if (isWWA)
+ player = new MSEPlatform.Playback.XPlayer(playerContainer);
+ return player
+ }, createMediaTag: function createMediaTag(type) {
+ return MSEPlatform.Playback.MediaPlayer.createMediaTag(type)
+ }, audioTagForFileActivation: {
+ get: function audioTagForFileActivation_get() {
+ return MSEPlatform.Playback.AudioPlayer.audioTagForFileActivation
+ }, set: function audioTagForFileActivation_set(tag) {
+ MSEPlatform.Playback.AudioPlayer.audioTagForFileActivation = tag
+ }
+ }, videoTagForFileActivation: {
+ get: function videoTagForFileActivation_get() {
+ return MSEPlatform.Playback.VideoPlayer.videoTagForFileActivation
+ }, set: function videoTagForFileActivation_set(tag) {
+ MSEPlatform.Playback.VideoPlayer.videoTagForFileActivation = tag
+ }
+ }, _mediaBitmask: {
+ current: 1, next: 2
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/components/playback/playbacktrace.js:42443 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Platform.Playback", {
+ Etw: MS.Entertainment.UI.Framework.define(null, {}, {
+ _getEtwProvider: (function PlaybackEtw_getEtwProvider() {
+ var playbackEtwProvider;
+ return function _getEtwProvider() {
+ if (!playbackEtwProvider)
+ playbackEtwProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Pipeline;
+ return playbackEtwProvider
+ }
+ })(), traceString: function PlaybackEtw_traceString(s) {
+ if (this._getEtwProvider)
+ this._getEtwProvider().tracePlayback_WPP(s)
+ }, tracePlayerStateChanged: function PlaybackEtw_tracePlayerStateChanged(newState, oldState) {
+ this._getEtwProvider().tracePlayback_PlayerStateChanged(newState, oldState)
+ }, traceTargetTransportStateSet: function PlaybackEtw_traceTargetTransportStateSet(wannaBeState, currentState) {
+ this._getEtwProvider().tracePlayback_TargetTransportStateSet(wannaBeState, currentState)
+ }, traceTransportStateChanged: function PlaybackEtw_traceTransportStateChanged(newState, oldState, isVideo) {
+ this._getEtwProvider().tracePlayback_TransportStateChanged(newState, oldState);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var shouldDisableTelemetry = !configurationManager.telemetry.enabled || MS.Entertainment.Utilities.isTestApp;
+ if (!shouldDisableTelemetry)
+ if (newState !== oldState)
+ if (newState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ if (isVideo)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).videoPlaybackStart();
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).musicPlaybackStart();
+ else if (newState === MS.Entertainment.Platform.Playback.TransportState.paused || newState === MS.Entertainment.Platform.Playback.TransportState.stopped)
+ if (isVideo)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).videoPlaybackStop();
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).musicPlaybackStop()
+ }, traceMediaLoaded: function PlaybackEtw_traceMediaLoaded(isNext, mediaInstance, durationMsec) {
+ if (mediaInstance)
+ if (isNext)
+ this._getEtwProvider().tracePlayback_NextMediaLoaded(mediaInstance.source, mediaInstance.mediaType, mediaInstance.protectionState, mediaInstance.startPosition, mediaInstance.cookie, durationMsec);
+ else {
+ this._getEtwProvider().tracePlayback_CurrentMediaLoaded(mediaInstance.source, mediaInstance.mediaType, mediaInstance.protectionState, mediaInstance.startPosition, mediaInstance.cookie, durationMsec);
+ MS.Entertainment.Utilities.Telemetry.logPlaybackHappened(mediaInstance)
+ }
+ }, traceControlInitialized: function PlaybackEtw_traceControlInitialized() {
+ this._getEtwProvider().tracePlayback_ControlInitialized()
+ }, traceSessionInitialized: function PlaybackEtw_traceSessionInitialized() {
+ this._getEtwProvider().tracePlayback_SessionInitialized()
+ }, traceSetMedia: function PlaybackEtw_traceSetMedia(mediaInstance) {
+ this._getEtwProvider().tracePlayback_SetMedia(mediaInstance.source, mediaInstance.mediaType, mediaInstance.protectionState, mediaInstance.startPosition, mediaInstance.cookie, 0)
+ }, traceSetNextMedia: function PlaybackEtw_traceSetNextMedia(readyForNext, mediaInstance) {
+ this._getEtwProvider().tracePlayback_SetNextMedia(readyForNext, mediaInstance.source, mediaInstance.mediaType, mediaInstance.protectionState, mediaInstance.startPosition, mediaInstance.cookie)
+ }, traceSwitchingToNextMedia: function PlaybackEtw_traceSwitchingToNextMedia(mediaSource) {
+ this._getEtwProvider().tracePlayback_SwitchingToNextMedia(mediaSource)
+ }, traceNextMediaStarted: function PlaybackEtw_traceNextMediaStarted(mediaSource) {
+ this._getEtwProvider().tracePlayback_NextMediaStarted(mediaSource)
+ }, tracePlaybackEnableTimeUpdate: function PlaybackEtw_tracePlaybackEnableTimeUpdate(currentPosition) {
+ this._getEtwProvider().tracePlayback_EnableTimeUpdate(currentPosition)
+ }, tracePlaybackDisableTimeUpdate: function PlaybackEtw_tracePlaybackDisableTimeUpdate(currentPosition) {
+ this._getEtwProvider().tracePlayback_DisableTimeUpdate(currentPosition)
+ }, tracePlaybackForceTimeUpdate: function PlaybackEtw_tracePlaybackForceTimeUpdate(currentPosition) {
+ this._getEtwProvider().tracePlayback_ForceTimeUpdate(currentPosition)
+ }, tracePlaybackPBMSoundLevelChanged: function PlaybackEtw_tracePlaybackPBMSoundLevelChanged(soundLevel, currentTransportState) {
+ this._getEtwProvider().tracePlayback_PBMSoundLevelChanged(soundLevel, currentTransportState)
+ }, tracePlaylistSetDataSourceBegin: function PlaybackEtw_tracePlaylistSetDataSourceBegin() {
+ this._getEtwProvider().tracePlaylist_SetDataSourceBegin()
+ }, tracePlaylistSetDataSourceEnd: function PlaybackEtw_tracePlaylistSetDataSourceEnd() {
+ this._getEtwProvider().tracePlaylist_SetDataSourceEnd()
+ }, tracePlaylistInterpretingData: function PlaybackEtw_tracePlaylistInterpretingData() {
+ this._getEtwProvider().tracePlaylist_InterpretingData()
+ }, tracePlaylistActivate: function PlaybackEtw_tracePlaylistActivate(index, startPosition, isShuffle, isRepeat) {
+ this._getEtwProvider().tracePlaylist_Activate(index, startPosition, isShuffle, isRepeat)
+ }, tracePlaylistSetMedia: function PlaybackEtw_tracePlaylistSetMedia(mediaInstance) {
+ this._getEtwProvider().tracePlaylist_SetMedia(mediaInstance.source, mediaInstance.mediaType, mediaInstance.protectionState, mediaInstance.startPosition, mediaInstance.cookie)
+ }, tracePlaylistSetNextMedia: function PlaybackEtw_tracePlaylistSetNextMedia(mediaInstance) {
+ this._getEtwProvider().tracePlaylist_SetNextMedia(mediaInstance.source, mediaInstance.mediaType, mediaInstance.protectionState, mediaInstance.startPosition, mediaInstance.cookie)
+ }, tracePlaybackError: function PlaybackEtw_tracePlaybackError(errorCode, extendedCode, context) {
+ this._getEtwProvider().tracePlayback_ErrorOccurred(errorCode, extendedCode || 0, context || "")
+ }, tracePlaylogBookmarkLoad: function PlaybackEtw_tracePlaylogBookmarkLoad(bookmark, playFromBookmark) {
+ this._getEtwProvider().tracePlaylog_BookmarkLoad(bookmark, playFromBookmark)
+ }, tracePlaylogBookmarkSave: function PlaybackEtw_tracePlaylogBookmarkSave(bookmark) {
+ this._getEtwProvider().tracePlaylog_BookmarkSave(bookmark)
+ }, tracePlaylogPlayCountLoad: function PlaybackEtw_tracePlaylogPlayCountLoad(count) {
+ this._getEtwProvider().tracePlaylog_PlayCountLoad(count)
+ }, tracePlaylogPlayCountSave: function PlaybackEtw_tracePlaylogPlayCountSave(count) {
+ this._getEtwProvider().tracePlaylog_PlayCountSave(count)
+ }, tracePlaylogPlayedLoad: function PlaybackEtw_tracePlaylogPlayedLoad(played) {
+ this._getEtwProvider().tracePlaylog_PlayedLoad(played)
+ }, tracePlaylogPlayedSave: function PlaybackEtw_tracePlaylogPlayedSave(played) {
+ this._getEtwProvider().tracePlaylog_PlayedSave(played)
+ }, traceDRMRootLicenseRefreshAccount: function PlaybackEtw_traceDRMRootLicenseRefreshAccount(subscription, tunerActivated) {
+ this._getEtwProvider().traceDRM_RootLicenseRefresh_Account(subscription, tunerActivated)
+ }, traceDRMRootLicenseRefreshDetails: function PlaybackEtw_traceDRMRootLicenseRefreshDetails(now, lastRefresh, spanMs) {
+ this._getEtwProvider().traceDRM_RootLicenseRefresh_Details(now, lastRefresh, spanMs)
+ }, traceDRMRootLicenseRefreshInvoked: function PlaybackEtw_traceDRMRootLicenseRefreshInvoked() {
+ this._getEtwProvider().traceDRM_RootLicenseRefresh_Invoked()
+ }, traceDRMRootLicenseRefreshCompleted: function PlaybackEtw_traceDRMRootLicenseRefreshCompleted(status) {
+ this._getEtwProvider().traceDRM_RootLicenseRefresh_Completed(status)
+ }, traceDRMReportMeteringAccount: function PlaybackEtw_traceDRMReportMeteringAccount(subscription, tunerActivated, meteringCertificate) {
+ this._getEtwProvider().traceDRM_ReportMetering_Account(subscription, tunerActivated, meteringCertificate)
+ }, traceDRMReportMeteringInvoked: function PlaybackEtw_traceDRMReportMeteringInvoked() {
+ this._getEtwProvider().traceDRM_ReportMetering_Invoked()
+ }, traceDRMReportMeteringCompleted: function PlaybackEtw_traceDRMReportMeteringCompleted(status) {
+ this._getEtwProvider().traceDRM_ReportMetering_Completed(status)
+ }, traceCCRendererGetTTMLFilepath: function PlaybackEtw_traceCCRendererGetTTMLFilepath(state, smid, miid, lcid, filePath) {
+ this._getEtwProvider().traceClosedCaptions_RendererGetTTMLFilepath(state, smid ? smid : String.empty, miid ? miid : String.empty, lcid, filePath ? filePath : String.empty)
+ }, traceCCRendererLoadTTMLFile: function PlaybackEtw_traceCCRendererLoadTTMLFile(state, filePath) {
+ this._getEtwProvider().traceClosedCaptions_RendererLoadTTMLFile(state, filePath ? filePath : String.empty)
+ }, traceCCEnterRenderingLoop: function PlaybackEtw_traceCCEnterRenderingLoop(currentPosition, transportState) {
+ this._getEtwProvider().traceClosedCaptions_EnterRenderingLoop(currentPosition ? currentPosition : 0, transportState ? transportState : String.empty)
+ }, traceCCExitRenderingLoop: function PlaybackEtw_traceCCExitRenderingLoop(currentPosition, transportState, ccOn) {
+ this._getEtwProvider().traceClosedCaptions_ExitRenderingLoop(currentPosition ? currentPosition : 0, transportState ? transportState : String.empty, ccOn)
+ }, traceClosedCaptionsOn: function PlaybackEtw_traceClosedCaptionsOn(enable) {
+ this._getEtwProvider().traceClosedCaptions_On(enable)
+ }, traceCCDroppedFrame: function PlaybackEtw_traceCCDroppedFrame(generatedAt, validUntil, currentPosition) {
+ this._getEtwProvider().traceClosedCaptions_DroppedFrame(generatedAt ? generatedAt : 0, validUntil ? validUntil : 0, currentPosition ? currentPosition : 0)
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/components/playback/volumecontroller.js:42564 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ VolumeService: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function VolumeServiceConstructor() {
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ this._configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.updateAndNotify("volume", (this._configurationManager.playback.musicVolumeValue) / 100);
+ this.updateAndNotify("mute", this._configurationManager.playback.musicMuteState)
+ }
+ else
+ try {
+ this._volumeManager = new Microsoft.Entertainment.AppVolumeManager.AppVolume;
+ this._volumeManager.addEventListener("systemvolumestatechanged", this._systemVolumeStateChanged.bind(this));
+ this._volumeManager.addEventListener("audioendpointchanged", this._audioEndpointChanged.bind(this));
+ this._initializeStates()
+ }
+ catch (e) {
+ this.updateAndNotify("isAudioEndpointAvailable", false)
+ }
+ }, {
+ _systemVolumeStateChangedBindingMethod: null, _volumeManager: null, _volume: 0.80, _mute: false, _isAudioEndpointAvailable: true, _configurationManager: null, volume: {
+ get: function getVolume() {
+ return this._volume
+ }, set: function setVolume(newValue) {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this._configurationManager.playback.musicVolumeValue = newValue * 100;
+ else
+ try {
+ if (this._volumeManager)
+ this._volumeManager.setVolumeLevelAsync(newValue)
+ }
+ catch (e) {
+ MS.Entertainment.UI.Controls.fail(e && e.toString())
+ }
+ if (this._volume !== newValue)
+ this.updateAndNotify("volume", newValue)
+ }
+ }, mute: {
+ get: function getMute() {
+ return this._mute
+ }, set: function setMute(newValue) {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this._configurationManager.playback.musicMuteState = newValue;
+ else
+ try {
+ if (this._volumeManager)
+ this._volumeManager.setMutedAsync(newValue)
+ }
+ catch (e) {
+ MS.Entertainment.UI.Controls.fail(e && e.toString())
+ }
+ if (this._mute !== newValue)
+ this.updateAndNotify("mute", newValue)
+ }
+ }, isAudioEndpointAvailable: {
+ get: function getIsAudioEndpointAvailable() {
+ return this._isAudioEndpointAvailable
+ }, set: function setIsAudioEndpointAvailable(newState) {
+ this.updateAndNotify("isAudioEndpointAvailable", newValue)
+ }
+ }, _systemVolumeStateChanged: function systemVolumeStateChanged() {
+ this._updateSystemVolumeStates()
+ }, _initializeStates: function initializeStates() {
+ this._updateSystemVolumeStates()
+ }, _updateSystemVolumeStates: function updateSystemVolumeStates() {
+ try {
+ if (this._volumeManager) {
+ this._volumeManager.getVolumeLevelAsync().done(function getVolumeLevelAsync_complete(volume) {
+ if (this._volume !== volume.value)
+ this.updateAndNotify("volume", volume.value)
+ }.bind(this), function getVolumeLevelAsync_error(error) {
+ MS.Entertainment.UI.Controls.fail("Failed to get system volume level with error:" + (error && error.toString()))
+ });
+ this._volumeManager.getMutedAsync().done(function getMutedAsync_complete(muteState) {
+ if (this._mute !== muteState.value)
+ this.updateAndNotify("mute", muteState.value)
+ }.bind(this), function getMutedAsync_error(error) {
+ MS.Entertainment.UI.Controls.fail("Failed to get system mute level with error:" + (error && error.toString()))
+ })
+ }
+ }
+ catch (e) {
+ MS.Entertainment.UI.Controls.fail(e && e.toString())
+ }
+ }, _audioEndpointChanged: function _audioEndpointChanged(newState) {
+ if (newState.detail.length > 0)
+ if (newState.detail[0] === 1) {
+ this.updateAndNotify("isAudioEndpointAvailable", true);
+ this._updateSystemVolumeStates()
+ }
+ else
+ this.updateAndNotify("isAudioEndpointAvailable", false)
+ }
+ }, {
+ factory: function factory() {
+ return new MS.Entertainment.UI.Controls.VolumeService
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.volumeService, MS.Entertainment.UI.Controls.VolumeService.factory)
+ })()
+})();
+/* >>>>>>/components/playback/playlog.js:42666 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ WinJS.Namespace.define("MS.Entertainment.Platform.Playback", {
+ _getPlayLogTickInterval: (function _getPlayLogTickInterval_Closure() {
+ var _playLogTickInterval = {};
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.music] = 15000;
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.music2] = 15000;
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.video] = 120000;
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.video2] = 30000;
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.amsterdam] = 15000;
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.games] = -1;
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.companion] = -1;
+ _playLogTickInterval[Microsoft.Entertainment.Application.AppMode.test] = -1;
+ _playLogTickInterval["X8_Test_PlayLog"] = 500;
+ return function _getPlayLogTickInterval(appMode) {
+ return _playLogTickInterval[appMode]
+ }
+ })()
+ });
+ WinJS.Namespace.define("MS.Entertainment.Platform.Playback", {
+ _Bookmark: MS.Entertainment.UI.Framework.define(function _bookmark_constructor() { }, {
+ _lastSavePosition: 0, _shouldSaveOnMediaInstance: function _shouldSaveOnMediaInstance(mediaInstance) {
+ var save = false;
+ if (mediaInstance)
+ save = (!mediaInstance.isMusicVideo() && (mediaInstance.isTVEpisode() || mediaInstance.isMovie() || mediaInstance.isVideo()));
+ return save
+ }, shouldSaveOnPosition: function shouldSaveOnPosition(mediaInstance, position) {
+ var save = false;
+ var saveThreshold = MS.Entertainment.Platform.Playback._getPlayLogTickInterval(MS.Entertainment.appMode);
+ if (this._shouldSaveOnMediaInstance(mediaInstance))
+ save = (this._lastSavePosition + saveThreshold <= position);
+ return save
+ }, shouldSaveOnTransportState: function shouldSaveOnTransportState(mediaInstance, transportState) {
+ var save = false;
+ if (this._shouldSaveOnMediaInstance(mediaInstance))
+ save = (transportState === MS.Entertainment.Platform.Playback.TransportState.paused || transportState === MS.Entertainment.Platform.Playback.TransportState.stopped);
+ return save
+ }, save: function save(mediaInstance, position) {
+ if (mediaInstance) {
+ mediaInstance.bookmark = position;
+ this._lastSavePosition = position
+ }
+ }, clear: function clear(mediaInstance) {
+ this.save(mediaInstance, 0)
+ }
+ }), _PlayedState: MS.Entertainment.UI.Framework.define(function _PlayedState_constructor() { }, {
+ saved: false, _videoThreshold: 95, _otherMediaThreshold: MS.Entertainment.Utilities.isMusicApp2 ? 0 : 90, shouldSaveOnProgress: function shouldSaveOnProgress(mediaInstance, percentage) {
+ var threshold = 101;
+ if (mediaInstance)
+ if (mediaInstance.isTVEpisode() || mediaInstance.isMovie() || mediaInstance.isVideo())
+ threshold = this._videoThreshold;
+ else
+ threshold = this._otherMediaThreshold;
+ return (percentage > threshold)
+ }, save: function save(mediaInstance) {
+ if (mediaInstance) {
+ mediaInstance.played = true;
+ this.saved = true
+ }
+ }, clear: function clear(mediaInstance) {
+ if (mediaInstance)
+ mediaInstance.played = false
+ }
+ }), _Playcount: MS.Entertainment.UI.Framework.define(function _Playcount_constructor() { }, {
+ saved: false, _trackThreshold: 20, _otherMediaThreshold: 95, shouldSaveOnProgress: function shouldSaveOnProgress(mediaInstance, percentage) {
+ var threshold = 101;
+ if (mediaInstance)
+ if (mediaInstance.isMusicTrack())
+ threshold = this._trackThreshold;
+ else
+ threshold = this._otherMediaThreshold;
+ return (percentage > threshold)
+ }, save: function save(mediaInstance) {
+ if (mediaInstance) {
+ mediaInstance.playcount++;
+ this.saved = true
+ }
+ }
+ }), _PlayLogTimer: MS.Entertainment.UI.Framework.define(function _PlayLogTimer_constructor(callback) {
+ this._timerCallback = callback
+ }, {
+ _timerId: null, _timerCallback: null, _timerIntervalMsec: null, start: function _PlayLogTimer_start() {
+ if (this._timerId) {
+ this._timerId.cancel();
+ this._timerId = null
+ }
+ this._tick()
+ }, stop: function _PlayLogTimer_stop() {
+ if (this._timerId) {
+ this._timerId.cancel();
+ this._timerId = null
+ }
+ }, _tick: function _PlayLogTimer_tick() {
+ var tickInterval = MS.Entertainment.Platform.Playback._getPlayLogTickInterval(MS.Entertainment.appMode);
+ if (tickInterval === -1)
+ return;
+ MS.Entertainment.Platform.Playback.assert(!isNaN(tickInterval), "Invalid tickInterval of: " + tickInterval);
+ this._timerId = WinJS.Promise.timeout(tickInterval).then(function _PlayLogTimer_ring_ring() {
+ if (this._timerCallback)
+ this._timerCallback();
+ WinJS.Promise.timeout().then(function _tick_tock() {
+ this._tick()
+ }.bind(this))
+ }.bind(this))
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Platform.Playback", {
+ PlayLog: MS.Entertainment.UI.Framework.define(function PlayLog_constructor(playbackControl) {
+ this._observe(playbackControl)
+ }, {
+ _currentMediaInstance: null, _currentPosition: 0, _currentDuration: 0, _bookmark: null, _playedState: null, _playcount: null, _playLogTimer: null, _playbackControl: null, _observe: function PlayLog_observe(playbackControl) {
+ this._playbackControl = playbackControl;
+ playbackControl.bind("currentMedia", this._onCurrentMediaChanged.bind(this));
+ playbackControl.bind("currentTransportState", this._onCurrentTransportStateChanged.bind(this));
+ playbackControl.bind("duration", this._onDurationChanged.bind(this));
+ playbackControl.bind("seekedPosition", this._onSeekedPositionChanged.bind(this))
+ }, _onCurrentMediaChanged: function PlayLog_onCurrentMediaChanged(newMediaInstance) {
+ if (newMediaInstance) {
+ this._currentMediaInstance = newMediaInstance;
+ this._currentDuration = this._playbackControl.duration;
+ this._currentPosition = 0;
+ this._bookmark = new MS.Entertainment.Platform.Playback._Bookmark;
+ this._playedState = new MS.Entertainment.Platform.Playback._PlayedState;
+ this._playcount = new MS.Entertainment.Platform.Playback._Playcount;
+ this._playedState.clear(this._currentMediaInstance);
+ if (!this._playLogTimer)
+ this._playLogTimer = new MS.Entertainment.Platform.Playback._PlayLogTimer(this._onCurrentPositionChanged.bind(this));
+ if (this._playLogTimer)
+ this._playLogTimer.start()
+ }
+ else
+ this._currentMediaInstance = null
+ }, _onDurationChanged: function PlayLog_onDurationChanged(newDuration) {
+ this._currentDuration = newDuration
+ }, _onCurrentPositionChanged: function PlayLog_onCurrentPositionChanged() {
+ var progress = 0;
+ var newPosition = this._playbackControl.forceTimeUpdate();
+ this._currentPosition = newPosition;
+ if (this._currentMediaInstance && this._currentMediaInstance.playlogEnabled) {
+ if (this._currentDuration !== 0)
+ progress = this._currentPosition * 100 / this._currentDuration;
+ if (!this._playedState.saved && this._bookmark.shouldSaveOnPosition(this._currentMediaInstance, newPosition))
+ this._bookmark.save(this._currentMediaInstance, newPosition);
+ if (!this._playedState.saved && this._playedState.shouldSaveOnProgress(this._currentMediaInstance, progress)) {
+ this._playedState.save(this._currentMediaInstance);
+ this._bookmark.clear(this._currentMediaInstance)
+ }
+ if (this._currentDuration - (this._currentMediaInstance.maxPosition * 1000) < 1000)
+ this._bookmark.clear(this._currentMediaInstance);
+ if (!this._playcount.saved && this._playcount.shouldSaveOnProgress(this._currentMediaInstance, progress))
+ this._playcount.save(this._currentMediaInstance)
+ }
+ }, _onCurrentTransportStateChanged: function PlayLog_onCurrentTransportStateChanged(newTransportState) {
+ if (this._currentMediaInstance && this._currentMediaInstance.playlogEnabled && newTransportState !== MS.Entertainment.Platform.Playback.TransportState.starting) {
+ this._onCurrentPositionChanged();
+ if (!this._playedState.saved && this._bookmark.shouldSaveOnTransportState(this._currentMediaInstance, newTransportState)) {
+ if (newTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped && this._currentMediaInstance && this._currentMediaInstance.stopPosition)
+ this._currentPosition = this._currentMediaInstance.stopPosition;
+ else
+ this._currentPosition = this._playbackControl.forceTimeUpdate();
+ if (this._currentPosition > 0)
+ this._bookmark.save(this._currentMediaInstance, this._currentPosition)
+ }
+ if (newTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ this._playLogTimer.start();
+ else
+ this._playLogTimer.stop()
+ }
+ }, _onSeekedPositionChanged: function PlayLog_onSeekedPositionChanged() {
+ if (this._currentMediaInstance && this._currentMediaInstance.playlogEnabled) {
+ this._onCurrentPositionChanged();
+ if (this._bookmark._shouldSaveOnMediaInstance(this._currentMediaInstance) && this._currentPosition >= 0) {
+ this._bookmark.save(this._currentMediaInstance, this._currentPosition);
+ this._playLogTimer.start()
+ }
+ }
+ }
+ }, {})
+ })
+ })()
+})();
+/* >>>>>>/components/playback/session/playbacksession.js:42849 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ var playbackControlMixin = {
+ _playbackControlCreateInstance: function _playbackControlCreateInstance() {
+ if (!this._playbackControl) {
+ var parkedPlaybackHost = document.createElement("div");
+ WinJS.Utilities.addClass(parkedPlaybackHost, "removeFromDisplay");
+ document.body.appendChild(parkedPlaybackHost);
+ this._parkedPlaybackHost = parkedPlaybackHost;
+ this._playbackControlContainer = document.createElement("div");
+ this._playbackControlContainer.setAttribute("data-win-control", "MS.Entertainment.Platform.Playback.PlaybackControl");
+ this._parkedPlaybackHost.appendChild(this._playbackControlContainer);
+ if (!this._playbackControlContainer)
+ throw "_playbackControlCreateInstance: Error! Cannot create playbackControlContainer. Out of memory?";
+ this._playbackControl = new MSEPlatform.Playback.PlaybackControl(this._playbackControlContainer, {});
+ if (!this._playbackControl)
+ throw "_playbackControlCreateInstance: Error! Cannot create playbackControl. Out of memory?";
+ }
+ }, _parkedPlaybackHost: null, _playbackControlHost: null, _playbackControlContainer: null, _playbackControl: null, _playbackControlEvents: null, _iPlayback: null
+ };
+ var playlistMixin = {
+ _playlistCreateInstance: function _playlistCreateInstance() {
+ if (!this._playlist)
+ this._playlist = new MSEPlatform.Playback.Playlist.PlaylistCore(null, {});
+ if (!this._playlist)
+ throw "_playlistCreateInstance: Error! Cannot create playlist. Out of memory?";
+ this._playlist.addEventListener("shuffleChanged", function _shuffleChanged(e) {
+ if (e.detail && e.detail.oldValue !== undefined)
+ try {
+ if (this.smartDJSeed) {
+ if (e.detail.newValue)
+ MS.Entertainment.Platform.Playback.assert(!e.detail.newValue, "Shuffle should not be set to on while playing Radio")
+ }
+ else {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ this._saveSessionStateValue("shuffle", e.detail.newValue);
+ this._playlist.shuffle = e.detail.newValue
+ }
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession_shuffleChanged: ignored non-fatal exception: " + e)
+ }
+ }.bind(this));
+ this._playlist.addEventListener("repeatChanged", function _repeatChanged(e) {
+ if (e.detail && e.detail.oldValue !== undefined)
+ try {
+ if (this.smartDJSeed) {
+ if (e.detail.newValue)
+ MS.Entertainment.Platform.Playback.assert(!e.detail.newValue, "Repeat should not be set to on while playing Radio")
+ }
+ else {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ this._saveSessionStateValue("repeat", e.detail.newValue);
+ this._playlist.repeat = e.detail.newValue
+ }
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession_repeatChanged: ignored non-fatal exception: " + ex)
+ }
+ }.bind(this));
+ this._playlist.addEventListener("lastTrackPlayingChanged", function _lastTrackPlayingChanged(e) {
+ if (e.detail)
+ this.lastTrackPlaying = e.detail.newValue
+ }.bind(this))
+ }, _playlist: null
+ };
+ var ccRendererMixin = {
+ _ccRendererCreateInstance: function _ccRendererCreateInstance(playbackControl, rendererContainer) {
+ if (!this._ccRenderer)
+ this._ccRenderer = new MSEPlatform.Playback.ClosedCaptions.Renderer(playbackControl, rendererContainer)
+ }, _ccRenderer: null
+ };
+ var videoNetstatsMixin = {
+ enableVideoNetstats: {
+ get: function enableVideoNetstats_get() {
+ return this._enableVideoNetstats
+ }, set: function enableVideoNetstats_set(value) {
+ this._enableVideoNetstats = value;
+ if (this._videoNetstats && this._videoNetstats.domElement) {
+ if (this._enableVideoNetstats)
+ WinJS.Utilities.removeClass(this._videoNetstats.domElement, "hideFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._videoNetstats.domElement, "hideFromDisplay");
+ this._videoNetstats.drawOverlay = this._enableVideoNetstats
+ }
+ }
+ }, _videoNetstats: null, _enableVideoNetstats: false
+ };
+ WinJS.Namespace.define("MS.Entertainment.Platform.Playback", {
+ _musicVideosEnabled: false, _musicVideosParentalBlockSet: false, _isMusicVideoModeInEffect: {
+ get: function Playback_isMusicVideoModeInEffect() {
+ return MS.Entertainment.Platform.Playback._musicVideosEnabled && !MS.Entertainment.Platform.Playback._musicVideosParentalBlockSet
+ }
+ }
+ });
+ var playbackSessionMixin = {
+ sessionId: {
+ get: function PlaybackSession_sessionId_get() {
+ return this._sessionId
+ }
+ }, isPlayingVideo: {
+ get: function PlaybackSession_isPlayingVideo_get() {
+ return this.mediaElement && this.mediaElement.tagName === "VIDEO"
+ }
+ }, _setMusicVideosEnabled: function _playbackSessionMixin_setMusicVideoEnabled(value, isPersistedValue) {
+ function hasMusicVideoIdAsync(item) {
+ var q = new MS.Entertainment.Data.Query.Music.SongDetails;
+ q.id = item.serviceId;
+ q.idType = item.serviceIdType;
+ q.impressionGuid = item.impressionGuid;
+ if (item.acquisitionData && item.acquisitionData.acquisitionContext && item.acquisitionData.acquisitionContextType) {
+ var acquisitionAdditionalContext = item.acquisitionData.acquisitionAdditionalContext || item.playlistName || String.empty;
+ q.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(item.acquisitionData.acquisitionContext, item.acquisitionData.acquisitionContextType, item.acquisitionData.acquisitionContextID, acquisitionAdditionalContext)
+ }
+ return q.execute().then(function trackQueryCompleted(completedQuery) {
+ var marketplaceItem = null;
+ if (completedQuery && completedQuery.result) {
+ marketplaceItem = completedQuery.result;
+ if (marketplaceItem && marketplaceItem.data)
+ return marketplaceItem.data.hasMusicVideoId
+ }
+ return false
+ }, function trackQueryError() {
+ return false
+ })
+ }
+ MS.Entertainment.Platform.Playback.assert(MS.Entertainment.Utilities.isMusicApp2, "At this time this property is expected to be manipulated by Music2App only. Remove the assert if this is no longer true " + "or check if unintended call happened and remove it");
+ var oldValue = MS.Entertainment.Platform.Playback._isMusicVideoModeInEffect;
+ if (isPersistedValue) {
+ MS.Entertainment.Platform.Playback._musicVideosEnabled = value;
+ this._saveSessionStateValue("musicVideosEnabled", value)
+ }
+ else
+ MS.Entertainment.Platform.Playback._musicVideosParentalBlockSet = value;
+ if (!this.currentMedia)
+ return;
+ value = MS.Entertainment.Platform.Playback._isMusicVideoModeInEffect;
+ if (oldValue === !value)
+ if ((value && this.currentMedia.hasMusicVideoId) || (!value && !this.currentMedia.hasMusicVideoId && !this.currentMedia.hasServiceId))
+ this._playlist.activate(this.currentOrdinal);
+ else if (value && !this.currentMedia.hasMusicVideoId && this.currentMedia.hasServiceId && !MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(this.currentMedia))
+ hasMusicVideoIdAsync(this.currentMedia).done(function hasMusicVideoIdAsync_completes(hasMusicVideoId) {
+ if (hasMusicVideoId)
+ this._playlist.activate(this.currentOrdinal)
+ }.bind(this), function ignoreError() {
+ MS.Entertainment.Platform.Playback.fail("hasMusicVideoIdAsync should not return on async error path. True or False only. Ignored.")
+ })
+ }, musicVideosEnabled: {
+ get: function PlaybackSession_musicVideosEnabled_get() {
+ return MS.Entertainment.Platform.Playback._musicVideosEnabled
+ }, set: function PlaybackSession_musicVideosEnabled_set(value) {
+ this._setMusicVideosEnabled(value, true)
+ }
+ }, musicVideosParentalBlockSet: {
+ get: function PlaybackSession_musicVideosParentalBlockSet() {
+ return MS.Entertainment.Platform.Playback._musicVideosParentalBlockSet
+ }, set: function PlaybackSession_musicVideosParentalBlockSet(value) {
+ if (value !== MS.Entertainment.Platform.Playback._musicVideosParentalBlockSet)
+ this._setMusicVideosEnabled(value, false)
+ }
+ }, isMusicVideoModeInEffect: {
+ get: function PlaybackSession_isMusicVideoModeInEffect() {
+ return MS.Entertainment.Platform.Playback._isMusicVideoModeInEffect
+ }
+ }, playbackControlDom: {
+ get: function PlaybackSession_playbackControlDom_get() {
+ return this._playbackControlContainer
+ }, set: function PlaybackSession_playbackControlDom_set() {
+ throw "Error! playbackControlDom property is not settable";
+ }
+ }, setDataSource: function PlaybackSession_setDataSource(dataSource) {
+ var that = this;
+ this._setDataSourcePromise = this._ensureSession().then(function _setDataSource2() {
+ that._iPlayback.reset(true);
+ return that._playlist.setDataSource(dataSource).then(function (mediaCollection) {
+ return mediaCollection
+ })
+ });
+ return this._setDataSourcePromise
+ }, activate: function PlaybackSession_activate(playbackControlHost, index) {
+ if (!playbackControlHost)
+ return;
+ var that = this;
+ this._ensureSession().then(function _activate2() {
+ that.sessionState = MS.Entertainment.Platform.Playback.SessionState.activated;
+ playbackControlHost.appendChild(that._playbackControlContainer);
+ that._playbackControlHost = playbackControlHost;
+ that.pendingOrdinal = -1;
+ switch (that._iPlayback.currentTransportState) {
+ case MSEPlatform.Playback.TransportState.paused:
+ that._iPlayback.targetTransportState = MSEPlatform.Playback.TransportState.playing;
+ break;
+ case MSEPlatform.Playback.TransportState.stopped:
+ that.playAt(index);
+ break;
+ case MSEPlatform.Playback.TransportState.playing:
+ break;
+ default:
+ break
+ }
+ })
+ }, deactivate: function PlaybackSession_deactivate(pausePlayback) {
+ if (!this._playbackControlHost)
+ return;
+ var pause = pausePlayback || false;
+ var that = this;
+ this._ensureSession().then(function _deactivate2() {
+ that.sessionState = MS.Entertainment.Platform.Playback.SessionState.notActivated;
+ if (pause)
+ that._iPlayback.targetTransportState = MSEPlatform.Playback.TransportState.paused;
+ var control = that._playbackControlHost.children[0];
+ that._playbackControlHost = null;
+ that._parkedPlaybackHost.appendChild(control)
+ })
+ }, clear: function PlaybackSession_clear() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession:: Clear");
+ if (this._iPlayback) {
+ this._iPlayback.targetTransportState = MSEPlatform.Playback.TransportState.stopped;
+ this._iPlayback.reset(true)
+ }
+ if (this._playlist)
+ this._playlist._dispose();
+ this.currentMedia = null;
+ this.pendingOrdinal = null;
+ if (this._setDataSourcePromise) {
+ this._setDataSourcePromise.cancel();
+ this._setDataSourcePromise = null
+ }
+ this.sessionState = MS.Entertainment.Platform.Playback.SessionState.notActivated;
+ MS.Entertainment.Platform.PlaybackHelpers.playActionInitiated = false
+ }, relocate: function PlaybackSession_relocate(newHost) {
+ if (!newHost)
+ return;
+ if (typeof (newHost) === "object")
+ this._relocateLocal(newHost)
+ }, playAt: function PlaybackSession_playAt(index, startTimeMsec, searchFor, maxSearchDistance) {
+ if (index < 0)
+ return;
+ if (this._playAtStartsWithFirst === undefined)
+ this._playAtStartsWithFirst = (index === undefined || index === this._playlist.first);
+ var that = this;
+ return this._ensureSession().then(function _playAt2() {
+ that._playlist.activate(index, startTimeMsec, searchFor, maxSearchDistance).then(function activated() {
+ if (that._playAtStartsWithFirst) {
+ that._playlist.firstTrackPlaying = index;
+ delete that._playAtStartsWithFirst
+ }
+ }, function errorToActivate(error) {
+ if (error && error.isUnplayableItemError)
+ return that.nextPlayable(+error.context).then(function (atOrdinal) {
+ if (atOrdinal !== null)
+ that._playlist.activate(atOrdinal, startTimeMsec, searchFor, maxSearchDistance);
+ else {
+ that._playlist._playbackControl.errorDescriptor = MSEPlatform.Playback.makePlaybackError(MSEPlatform.Playback.Error.NS_E_WMP_MULTIPLE_ERROR_IN_PLAYLIST, "No playable media in the playlist");
+ that._playlist._playbackControl.errorDescriptor.isCritical = true;
+ that._playlist._playbackControl._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.error);
+ that._playlist._setMedia(null, null);
+ that._playlist._setCurrentOrdinal(null)
+ }
+ })
+ })
+ })
+ }, playAtOrdinal: function PlaybackSession_playAtOrdinal(ordinal, forcePlayback) {
+ var _onPlaylistMediaChangeComplete = function _onPlaylistMediaChangeComplete() {
+ if (this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.paused || this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped)
+ this.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ this._playlist.removeEventListener("currentMediaChanged", _onPlaylistMediaChangeComplete)
+ }.bind(this);
+ if (forcePlayback)
+ this._playlist.addEventListener("currentMediaChanged", _onPlaylistMediaChangeComplete);
+ return this.playAt(ordinal)
+ }, isMediaCurrentlyLoaded: function PlaybackSession_isMediaCurrentlyLoaded(media) {
+ var type = typeof media;
+ var match = false;
+ if (this.currentMedia)
+ switch (type) {
+ case "number":
+ match = MS.Entertainment.Utilities.isValidLibraryId(media) && this.currentMedia.libraryId === media;
+ break;
+ case "string":
+ match = !MS.Entertainment.Utilities.isEmptyGuid(media) && (this.currentMedia.zuneId === media || this.currentMedia.canonicalId === media || this.currentMedia.serviceId === media);
+ break;
+ case "object":
+ match = media && this.currentMedia.isEqual(media);
+ break
+ }
+ return match
+ }, getProtectionState: function getProtectionState() {
+ if (this._iPlayback && this._iPlayback._player && this._iPlayback._player._currentMedia)
+ return this._iPlayback._player._currentMedia.protectionState;
+ else
+ return null
+ }, filterClosedCaptions: function PlaybackSession_filterClosedCaptions(media) {
+ var closedCaptions = [];
+ var mediaInstanceId = String.empty;
+ if (this.currentMedia && this._iPlayback && this._iPlayback._player && this._iPlayback._player._currentMedia && this._iPlayback._player._currentMedia.mediaInstanceId && !this.currentMedia.mediaInstanceId)
+ mediaInstanceId = this._iPlayback._player._currentMedia.mediaInstanceId;
+ var filterToRelevantClosedCaptionFiles = function filterToRelevantClosedCaptionFiles(closedCaptionFile) {
+ var ccFileMediaInstanceID = closedCaptionFile.mediaInstanceId.toUpperCase();
+ if (!MS.Entertainment.Utilities.isSameGuid(ccFileMediaInstanceID, mediaInstanceId))
+ return false;
+ return true
+ };
+ if (media && media.closedCaptionFiles && media.closedCaptionFiles.length)
+ closedCaptions = media.closedCaptionFiles.filter(filterToRelevantClosedCaptionFiles);
+ return closedCaptions
+ }, _relocateLocal: function PlaybackSession_relocateLocal(newHost) {
+ var that = this;
+ this._ensureSession().then(function _relocate2() {
+ newHost.appendChild(that._playbackControlContainer);
+ that._playbackControlHost = newHost
+ })
+ }, _restoreSessionState: function PlaybackSession_restoreSessionState() {
+ var shuffle = false;
+ var repeat = false;
+ try {
+ shuffle = MS.Entertainment.Utilities.getUserRoamingSetting("shuffle") || false;
+ repeat = MS.Entertainment.Utilities.getUserRoamingSetting("repeat") || false;
+ MS.Entertainment.Platform.Playback._musicVideosEnabled = MS.Entertainment.Utilities.getUserRoamingSetting("musicVideosEnabled") || false
+ }
+ catch (e) { }
+ if (this.canShuffle)
+ this._playlist.shuffle = shuffle;
+ if (this.canRepeat)
+ this._playlist.repeat = repeat
+ }, _saveSessionStateValue: function PlaybackSession_saveSessionStateValue(key, value) {
+ MS.Entertainment.Utilities.setUserRoamingSetting(key, value)
+ }, _ensureSession: function PlaybackSession_ensureSession() {
+ if (!this._playbackControl)
+ return WinJS.Promise.wrapError("PlaybackSession_ensureSession: Error! PlaybackControl not created.");
+ return this._sessionInitializedPromise
+ }, _repositionOnError: function PlaybackSession__repositionOnError() {
+ if (this._playlist && this._playlist._dataSource && this._playlist._dataSource.size === 1)
+ return null;
+ if (this.error.isCritical)
+ return null;
+ else
+ return this.first;
+ return null
+ }, _onPlaylistEnded: function PlaybackSession_onPlaylistEnded() {
+ this._iPlayback.waitForNoLossAssignmentsComplete().then(function assignsComplete() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession:: _onPlaylistEnded");
+ if (MS.Entertainment.Utilities.isMusicApp && !this.isPlayToReceiverSessionRunning && !this.smartDJSeed) {
+ var repositionOrdinal = this.first;
+ this.pendingOrdinal = repositionOrdinal;
+ if (this.error) {
+ this.sessionState = MS.Entertainment.Platform.Playback.SessionState.endedWithError;
+ var repositionOnErrorOrdinal = this._repositionOnError();
+ if (repositionOnErrorOrdinal === null)
+ return;
+ else
+ repositionOrdinal = repositionOnErrorOrdinal
+ }
+ else
+ this.sessionState = MS.Entertainment.Platform.Playback.SessionState.ended;
+ WinJS.Promise.timeout(100).done(function repositionPlayback() {
+ this.autoPlay = false;
+ this.playAt(repositionOrdinal);
+ this.pendingOrdinal = repositionOrdinal
+ }.bind(this))
+ }
+ else
+ this.sessionState = MS.Entertainment.Platform.Playback.SessionState.ended
+ }.bind(this))
+ }, _onPlaylistMediaChanged: function PlaybackSession_onPlaylistMediaChanged(e) {
+ var newMediaItem = (e && e.detail) ? e.detail.newValue : null;
+ if (!newMediaItem && !this._playlist.settingDataSource) {
+ this.currentMedia = null;
+ this._onPlaylistEnded();
+ return
+ }
+ this._updateCurrentMedia(newMediaItem);
+ if (!newMediaItem)
+ return;
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ if (!MS.Entertainment.UI.Shell.ImageLoader.isBlobUrl(newMediaItem.imageUri))
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(newMediaItem, 100, 100).then(function gotAlbumArt(uri) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession_onPlaylistMediaChanged: albumArtUri = " + uri);
+ var artUri = new Windows.Foundation.Uri(uri);
+ this.assignTrackNameAndAlbumArt(artUri)
+ }.bind(this), function noAlbumArt(error) {
+ this.assignTrackNameAndAlbumArt(null)
+ }.bind(this));
+ else if (MS.Entertainment.Utilities.isMusicApp1)
+ MSEPlatform.Playback.makeLocalImagePromise.done(function assignImageToMTC() {
+ var imagePath = "ms-appdata:///local/" + MS.Entertainment.Activation.localImageFileNameforMTC;
+ var artUri = new Windows.Foundation.Uri(imagePath);
+ this.assignTrackNameAndAlbumArt(artUri)
+ }.bind(this), function assignImageToMTC_error() {
+ this.assignTrackNameAndAlbumArt(null)
+ }.bind(this))
+ }, assignTrackNameAndAlbumArt: (function PlaybackSession_assignTrackNameAndAlbumArt_closure() {
+ var mediaControlsAvailable = true;
+ return function assignTrackNameAndAlbumArt(uri) {
+ try {
+ if (mediaControlsAvailable && Windows.Media.MediaControl) {
+ Windows.Media.MediaControl.albumArt = uri;
+ if (this.currentMedia) {
+ Windows.Media.MediaControl.trackName = this.currentMedia.name;
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession_assignTrackNameAndAlbumArt::Assigned trackname to MTC:" + this.currentMedia.name);
+ if (this.currentMedia.artistName) {
+ Windows.Media.MediaControl.artistName = this.currentMedia.artistName;
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession_assignTrackNameAndAlbumArt::Assigned artistname to MTC:" + this.currentMedia.artistName)
+ }
+ else
+ Windows.Media.MediaControl.artistName = ""
+ }
+ else
+ Windows.Media.MediaControl.trackName = "";
+ MSEPlatform.Playback.Etw.traceString("PlaybackSession_assignTrackNameAndAlbumArt::Assigned album art uri to MTC")
+ }
+ }
+ catch (ex) {
+ mediaControlsAvailable = false
+ }
+ }
+ })(), _onAudioAdChanged: function _onAudioAdChanged() {
+ this.canSeek = !this.isAudioAd;
+ this._updateCanSkipBackward();
+ this._updateCanSkipForward();
+ this._updateCurrentMediaForAudioAdChange()
+ }, _onSignedInUserChanged: function _onSignedInUserChanged(newXuid) {
+ if (this._signedInUserXuid !== newXuid) {
+ this._signedInUserXuid = newXuid;
+ this._restoreSessionState()
+ }
+ }, _onCurrentPositionChanged: function _onCurrentPositionChanged(value) {
+ if (!this._playlist.canSkipBackward)
+ this._updateCanSkipBackward()
+ }, _updateCanSkipBackward: function _updateCanSkipBackward() {
+ var canSkip = !this._iPlayback.isAudioAd && (this._playlist.canSkipBackward || this._iPlayback.currentPosition > this._skipBackThreshold);
+ if (canSkip !== this.canSkipBackward)
+ this.canSkipBackward = canSkip
+ }, _updateCanSkipForward: function _updateCanSkipForward() {
+ var canSkip = true;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ canSkip = !this._iPlayback.isAudioAd && this._playlist.canSkipForward;
+ if (canSkip !== this.canSkipForward)
+ this.canSkipForward = canSkip
+ }, _updateCanShuffle: function _updateCanShuffle() {
+ this.canShuffle = this._playlist.canShuffle;
+ if (this.canShuffle)
+ this.shuffle = MS.Entertainment.Utilities.getUserRoamingSetting("shuffle") || false;
+ else
+ this.shuffle = false
+ }, _updateCanRepeat: function _updateCanRepeat() {
+ this.canRepeat = this._playlist.canRepeat;
+ if (this.canRepeat)
+ this.repeat = MS.Entertainment.Utilities.getUserRoamingSetting("repeat") || false;
+ else
+ this.repeat = false
+ }, _onVisibilityChanged: function _onVisibilityChanged() {
+ if (document.hidden)
+ this.disableTimeUpdate();
+ else {
+ this.enableTimeUpdate();
+ this.forceTimeUpdate()
+ }
+ }, _updateCurrentMediaForAudioAdChange: function _updateCurrentMediaForAudioAdChange(newMediaItem) {
+ if (MS.Entertainment.Utilities.isApp2)
+ return;
+ if (this._iPlayback._player && this._iPlayback._player._currentMedia && this._iPlayback._player._currentMedia._mediaItem)
+ this.currentMedia = this._iPlayback._player._currentMedia._mediaItem.data;
+ else if (!this._iPlayback._player || !this._iPlayback._player._currentMedia)
+ this.currentMedia = null
+ }, _updateCurrentMedia: function _updateCurrentMedia(newMediaItem) {
+ if (MS.Entertainment.Utilities.isApp2 || newMediaItem === null)
+ this.currentMedia = newMediaItem;
+ else
+ this._updateCurrentMediaForAudioAdChange()
+ }, _onPlayerStateChanged: function _onPlayerStateChanged() { }, _onRemoteSessionRunningChanged: function _onRemoteSessionRunningChanged(e) {
+ if (e) {
+ this._closedCaptionSavedState = this.closedCaptionsOn;
+ this.closedCaptionsOn = false
+ }
+ else if (this._closedCaptionSavedState !== null)
+ this.closedCaptionsOn = this._closedCaptionSavedState
+ }, companionExperience: {
+ get: function PlaybackSession_companionExperience_get() {
+ return this._companionExperience
+ }
+ }, flushPreroll: function PlaybackSession_flushPreroll(networkStatus) {
+ var currentPlayabilityVersion = this.itemsPlayability;
+ this.updateAndNotify("itemsPlayability", currentPlayabilityVersion + 1);
+ if (this._playlist)
+ this._playlist.flushPreroll()
+ }, skipFwd: function PlaybackSession_skipFwd() {
+ MS.Entertainment.Platform.Playback.assert(this.canSkipForward, "skipFwd() should not be called if canSkipForward is false");
+ return this._playlist.skipFwd().then(null, function failedToSkip(err) {
+ if (err && err.isSkipFwdOutOfRangeError)
+ if (this.smartDJSeed) {
+ this._iPlayback.targetTransportState = MSEPlatform.Playback.TransportState.paused;
+ WinJS.Promise.timeout().then(this._onPlaylistEnded.bind(this))
+ }
+ }.bind(this))
+ }, skipBack: function PlaybackSession_skipBack(forcePreviousTrack) {
+ MS.Entertainment.Platform.Playback.assert(this.canSkipBackward, "skipBack() should not be called if canSkipBackward is false");
+ if ((forcePreviousTrack || this.currentPosition <= this._skipBackThreshold) && this._playlist.canSkipBackward)
+ return this._playlist.skipBack().then(null, function failedToSkip(err) {
+ if (err && err.isSkipBkwdOutOfRangeError) { }
+ }.bind(this));
+ else
+ return WinJS.Promise.as(this._iPlayback.seekToPosition(0))
+ }, _sessionId: null, _sessionInitializedPromise: null, _setDataSourcePromise: WinJS.Promise.as(), _companionExperience: null
+ };
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", { PlaybackSessionBase: WinJS.Class.mix(function mixConstructor() { }, MS.Entertainment.UI.Framework.EventMixin, MS.Entertainment.UI.Framework.UpdatePropertyMixin, playbackSessionMixin, playbackControlMixin, playlistMixin, ccRendererMixin, videoNetstatsMixin, WinJS.Binding.mixin) });
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ PlaybackSession: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.PlaybackSessionBase", function playbackSession_constructor(id) {
+ var completePromise;
+ this._initObservable({});
+ this._sessionInitializedPromise = new WinJS.Promise(function (c, e, p) {
+ completePromise = c
+ });
+ this._sessionId = (!id ? MSEPlatform.SessionManager._createSessionId() : id);
+ this._playbackControlCreateInstance();
+ this._signOutHandlerBound = this._signOutHandler.bind(this);
+ var onPlaybackSessionInitialized = function () {
+ var isInitialized;
+ if (this._playbackControlEvents) {
+ this._playbackControlEvents.cancel();
+ this._playbackControlEvents = null;
+ isInitialized = true
+ }
+ if (isInitialized) {
+ this._playlistCreateInstance();
+ this._iPlayback = this._playbackControl.getPlaybackInterface();
+ this._playlist.setPlaybackControl(this._iPlayback);
+ if (MS.Entertainment.Utilities.isVideoApp)
+ this._ccRendererCreateInstance(this._iPlayback, this._playbackControl.getClosedCaptionsContainer());
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ this._videoNetstats = this._playbackControl.getVideoNetstatsContainer();
+ if (!MS.Entertainment.Utilities.isApp2 && (new Microsoft.Entertainment.Configuration.ConfigurationManager).playback.enableVideoQualitySelector)
+ this.enableVideoNetstats = !!(Windows.Storage.ApplicationData.current.roamingSettings.values["enableVideoNetstats"])
+ }
+ MS.Entertainment.ProxyHelpers.proxyProperties(this, this._iPlayback, ["targetTransportState", "autoPlay", "_volume", "muted", "videoEncoding", "videoStreamStatistics"]);
+ MS.Entertainment.ProxyHelpers.proxyObservables(this, this._iPlayback, ["playerState", "error", "currentTransportState", "isAudioAd", "isPreview", "duration", "currentPosition", "videoWidth", "videoHeight", "seekedPosition", "errorDescriptor", "playbackRate", "minPlaybackRate", "maxPlaybackRate", "isRemoteSessionRunning", "mediaElement", "currentRequestedBitrate"]);
+ MS.Entertainment.ProxyHelpers.delegateFunctions(this, this._iPlayback, ["seekToPosition", "fastFwd", "fastReverse", "slowFwd", "slowReverse", "enableTimeUpdate", "disableTimeUpdate", "forceTimeUpdate", "isRemoteSession", "notifyNetworkConnectionChanged", "selectVideoBitrate", "getAudioTracks", "getSelectedAudioTrack", "selectAudioTrack", "setPlaybackRate"]);
+ MS.Entertainment.ProxyHelpers.proxyProperties(this, this._playlist, ["first"]);
+ MS.Entertainment.ProxyHelpers.proxyObservables(this, this._playlist, ["shuffle", "repeat", "canShuffle", "canRepeat", "canSkipBackward", "canSkipForward", "mediaCollection", "currentOrdinal", "currentNowPlayingPlaylistLibraryId", "smartDJSeed"]);
+ MS.Entertainment.ProxyHelpers.delegateFunctions(this, this._playlist, ["before", "after", "savePlaylist", "insertAtEnd", "position", "nextPlayable", "previousPlayable"]);
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ MS.Entertainment.ProxyHelpers.proxyProperties(this, this._ccRenderer, ["closedCaptionsOn"]);
+ MS.Entertainment.ProxyHelpers.proxyObservables(this, this._ccRenderer, ["ccLcid"])
+ }
+ try {
+ this._playLog = new MS.Entertainment.Platform.Playback.PlayLog(this._iPlayback)
+ }
+ catch (e) {
+ MS.Entertainment.Platform.Playback.fail("PlayLog should always be loaded before PlaybackSession. " + (e && e.toString()))
+ }
+ if (MS.Entertainment.Utilities.isVideoApp)
+ this._concurrentStreamingRestriction = new MS.Entertainment.Platform.Playback.ConcurrentStreamingRestriction(this._iPlayback);
+ this._playlist.addEventListener("currentMediaChanged", this._onPlaylistMediaChanged.bind(this));
+ this._iPlayback.addEventListener("currentPositionChanged", this._onCurrentPositionChanged.bind(this));
+ this._restoreSessionState();
+ MS.Entertainment.Platform.Playback.Etw.traceSessionInitialized();
+ completePromise();
+ this._iPlayback.bind("isAudioAd", this._onAudioAdChanged.bind(this));
+ this._iPlayback.bind("playerState", this._onPlayerStateChanged.bind(this));
+ this._iPlayback.bind("isRemoteSessionRunning", this._onRemoteSessionRunningChanged.bind(this));
+ this._playlist.bind("canSkipBackward", this._updateCanSkipBackward.bind(this));
+ this._playlist.bind("canSkipForward", this._updateCanSkipForward.bind(this));
+ this._playlist.bind("canShuffle", this._updateCanShuffle.bind(this));
+ this._playlist.bind("canRepeat", this._updateCanRepeat.bind(this));
+ this._visibilityChanged = this._onVisibilityChanged.bind(this);
+ document.addEventListener("visibilitychange", this._visibilityChanged, false);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser))
+ this._signedInUserBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser), { xuid: this._onSignedInUserChanged.bind(this) });
+ if (this._constructionTime)
+ MSEPlatform.Playback.Etw.traceString("session is initialized " + (new Date - this._constructionTime) + "ms after construction");
+ else
+ MSEPlatform.Playback.Etw.traceString("session is initialized during construction")
+ }
+ }.bind(this);
+ if (this._playbackControl.controlInitialized)
+ onPlaybackSessionInitialized();
+ else
+ this._playbackControlEvents = MS.Entertainment.Utilities.addEventHandlers(this._playbackControl, { onControlInitialized: onPlaybackSessionInitialized });
+ this._constructionTime = new Date;
+ MSEPlatform.Playback.Etw.traceString("session constructed")
+ }, {
+ canShuffle: MS.Entertainment.UI.Framework.observableProperty("canShuffle", true), canRepeat: MS.Entertainment.UI.Framework.observableProperty("canRepeat", true), canControlMedia: MS.Entertainment.UI.Framework.observableProperty("canControlMedia", true), canFastForward: MS.Entertainment.UI.Framework.observableProperty("canFastForward", false), canSlowForward: MS.Entertainment.UI.Framework.observableProperty("canSlowForward", false), canFastReverse: MS.Entertainment.UI.Framework.observableProperty("canFastReverse", false), canSlowReverse: MS.Entertainment.UI.Framework.observableProperty("canSlowReverse", false), canSeek: MS.Entertainment.UI.Framework.observableProperty("canSeek", true), currentMedia: MS.Entertainment.UI.Framework.observableProperty("currentMedia", null), sessionState: MS.Entertainment.UI.Framework.observableProperty("sessionState", MS.Entertainment.Platform.Playback.SessionState.notActivated), canSkipBackward: MS.Entertainment.UI.Framework.observableProperty("canSkipBackward", true), canSkipForward: MS.Entertainment.UI.Framework.observableProperty("canSkipForward", true), lastPlayedMedia: MS.Entertainment.UI.Framework.observableProperty("lastPlayedMedia", null), lastPlayedDuration: MS.Entertainment.UI.Framework.observableProperty("lastPlayedDuration", 0), lastPlayedPosition: MS.Entertainment.UI.Framework.observableProperty("lastPlayedPosition", 0), isPlayToReceiverSessionRunning: MS.Entertainment.UI.Framework.observableProperty("isPlayToReceiverSessionRunning", false), lastTrackPlaying: MS.Entertainment.UI.Framework.observableProperty("lastTrackPlaying", false), itemsPlayability: MS.Entertainment.UI.Framework.observableProperty("itemsPlayability", 0), _skipBackThreshold: 5000, _visibilityChanged: null, _closedCaptionSavedState: null, _signedInUserXuid: null, _signedInUserBinding: null, _signOutHandlerBound: null, _signInBound: false, _signOutHandler: function _signOutHandler() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (!signIn.isSignedIn)
+ this.setLastPlayedMedia(null)
+ }, currentMediaKey: {
+ get: function get_CurrentMediaKey() {
+ return this._playlist ? this._playlist._currentMediaKey : null
+ }
+ }, setLastPlayedMedia: function setLastPlayedMedia(media) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (media && signIn.isSignedIn) {
+ if (!this._signInBound) {
+ signIn.bind("isSignedIn", this._signOutHandlerBound);
+ this._signInBound = true
+ }
+ }
+ else if (this._signInBound) {
+ signIn.unbind("isSignedIn", this._signOutHandlerBound);
+ this._signInBound = false
+ }
+ MS.Entertainment.Platform.Playback.assert(media === null || media === this.currentMedia, "setLastPlayedMedia called with something other than currentMedia");
+ this.lastPlayedMedia = media;
+ this.lastPlayedDuration = (media === null) ? 0 : this.duration;
+ this.lastPlayedPosition = (media === null) ? 0 : this.currentPosition
+ }, isVideoAdSupported: {
+ get: function () {
+ return this._playbackControl.isVideoAdSupported
+ }
+ }
+ }, {
+ isPlaybackSession: function isPlaybackSession(object) {
+ return MS.Entertainment.Platform.Playback.PlaybackSession.prototype.isPrototypeOf(object)
+ }
+ }), makeLocalImageFileFromThumbnailPromise: (function PlaybackSession_makeLocalImageFileFromThumbnailPromise_closure() {
+ var makeLocalImageFilePromise;
+ return function makeLocalImageFileFromThumbnailPromise(thumbnail) {
+ if (makeLocalImageFilePromise) {
+ makeLocalImageFilePromise.cancel();
+ makeLocalImageFilePromise = null
+ }
+ makeLocalImageFilePromise = new WinJS.Promise(function makeLocalImageFile(completed, error) {
+ var timer = function attemptFileCreation(count) {
+ Windows.Storage.ApplicationData.current.localFolder.createFileAsync(MS.Entertainment.Activation.localImageFileNameforMTC, Windows.Storage.CreationCollisionOption.replaceExisting).done(completed, function createFileAsync_Error(createFileError) {
+ if (count <= 6)
+ WinJS.Promise.timeout(500).then(function retryOnError() {
+ timer(count + 1)
+ });
+ else
+ error(createFileError)
+ })
+ };
+ timer(0)
+ });
+ var size;
+ var reader;
+ var localFile;
+ var inputStream;
+ makeLocalImageFilePromise = makeLocalImageFilePromise.then(function (file) {
+ inputStream = thumbnail.getInputStreamAt(0);
+ reader = new Windows.Storage.Streams.DataReader(inputStream);
+ size = thumbnail.size;
+ localFile = file;
+ return reader.loadAsync(size)
+ }).then(function loadAsync_success() {
+ var buffer = new Array(size);
+ reader.readBytes(buffer);
+ return Windows.Storage.FileIO.writeBytesAsync(localFile, buffer)
+ }, function loadAsync_error(error) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("imageLoader::_loadBytesAsync_Error")
+ }).then(function () {
+ if (reader)
+ reader.close();
+ if (inputStream)
+ inputStream.close()
+ }).then(function () {
+ makeLocalImageFilePromise = null
+ });
+ return makeLocalImageFilePromise
+ }
+ })(), makeLocalImagePromise: null
+ })
+ })()
+})();
+/* >>>>>>/framework/networkstatusservice.js:43507 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var NetworkStatusService = (function (_super) {
+ __extends(NetworkStatusService, _super);
+ function NetworkStatusService() {
+ _super.call(this);
+ this._approachingDataLimit = false;
+ this._networkStatusChangedBinding = null;
+ this._overLimit = false;
+ this._uiStateService = null;
+ this._offlineDelayPromise = null;
+ this._offlineDelayTimerInMS = 5000;
+ this._networkedFeatureStatusTable = null;
+ this._lastNotificationId = "-1";
+ this._uiStateService = Entertainment.ServiceLocator.getService(Entertainment.Services.uiState);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.shell.retailExperience || configurationManager.shell.mockNetworkStatusOffline)
+ this._uiStateService.networkStatus = 5;
+ else
+ this._startListening();
+ this._initializeNetworkedFeaturesTable()
+ }
+ Object.defineProperty(NetworkStatusService.prototype, "approachingDataLimit", {
+ get: function () {
+ return this._approachingDataLimit
+ }, set: function (value) {
+ this.updateAndNotify("approachingDataLimit", value)
+ }, enumerable: true, configurable: true
+ });
+ NetworkStatusService.isOnline = function () {
+ var isOnline = true;
+ switch (Entertainment.ServiceLocator.getService(Entertainment.Services.uiState).networkStatus) {
+ case null:
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ isOnline = true;
+ break;
+ case 4:
+ case 5:
+ isOnline = false;
+ break;
+ default:
+ UI.fail("Current network state is not a valid MS.Entertainment.UI.NetworkStatusService.NetworkStatus value.")
+ }
+ return isOnline
+ };
+ NetworkStatusService.prototype.isEnabled = function (feature) {
+ Entertainment.Utilities.validateIsMemberOrThrow(feature, NetworkStatusService.NetworkedFeature);
+ var networkStatus = !this._uiStateService.networkStatus ? 5 : this._uiStateService.networkStatus;
+ var featureStatusArray = this._networkedFeatureStatusTable[feature];
+ UI.assert(featureStatusArray, "Unknown feature");
+ UI.assert(featureStatusArray[networkStatus] !== undefined, "Unknown network status for this feature");
+ return featureStatusArray ? featureStatusArray[networkStatus] : false
+ };
+ NetworkStatusService.prototype.dispose = function () {
+ if (this._networkStatusChangedBinding) {
+ this._networkStatusChangedBinding.cancel();
+ this._networkStatusChangedBinding = null
+ }
+ };
+ NetworkStatusService.prototype._initializeNetworkedFeaturesTable = function () {
+ this._networkedFeatureStatusTable = {};
+ var musicMarketplace = {};
+ musicMarketplace[0] = true;
+ musicMarketplace[1] = true;
+ musicMarketplace[2] = true;
+ musicMarketplace[3] = false;
+ musicMarketplace[4] = false;
+ musicMarketplace[5] = false;
+ this._networkedFeatureStatusTable[0] = musicMarketplace;
+ var videoMarketplace = {};
+ videoMarketplace[0] = true;
+ videoMarketplace[1] = true;
+ videoMarketplace[2] = true;
+ videoMarketplace[3] = false;
+ videoMarketplace[4] = false;
+ videoMarketplace[5] = false;
+ this._networkedFeatureStatusTable[1] = videoMarketplace
+ };
+ NetworkStatusService.prototype._startListening = function () {
+ var _this = this;
+ this._networkStatusChangedBinding = Entertainment.Utilities.addEventHandlers(Windows.Networking.Connectivity.NetworkInformation, {
+ networkstatuschanged: function () {
+ return _this._onNetworkStatusChanged()
+ }
+ });
+ this._updateNetworkStatus(true)
+ };
+ NetworkStatusService.prototype._onNetworkStatusChanged = function () {
+ this._updateNetworkStatus(false)
+ };
+ NetworkStatusService.prototype._updateNetworkStatus = function (immediateStatusUpdate) {
+ var _this = this;
+ if (Entertainment.Utilities.isApp2) {
+ this._uiStateService.networkStatus = 1;
+ return
+ }
+ if (this._offlineDelayPromise) {
+ this._offlineDelayPromise.cancel();
+ this._offlineDelayPromise = null
+ }
+ var internetProfile = null;
+ try {
+ internetProfile = Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile()
+ }
+ catch (e) {
+ UI.fail("Exception accessing: NetworkInformation.getInternetConnectionProfile: " + e.toString())
+ }
+ if (!internetProfile) {
+ if (immediateStatusUpdate)
+ this._uiStateService.networkStatus = 5;
+ else
+ this._offlineDelayPromise = WinJS.Promise.timeout(this._offlineDelayTimerInMS).then(function () {
+ return _this._uiStateService.networkStatus = 5
+ });
+ return
+ }
+ var stringId = String.empty;
+ var raiseNotification = false;
+ var isCritical = false;
+ try {
+ switch (internetProfile.getNetworkConnectivityLevel()) {
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.none:
+ this._uiStateService.networkStatus = 5;
+ break;
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.localAccess:
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.constrainedInternetAccess:
+ this._uiStateService.networkStatus = 4;
+ stringId = String.id.IDS_NETWORK_STATUS_LOCAL_ONLY;
+ raiseNotification = false;
+ break;
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess:
+ var connectionCost = internetProfile.getConnectionCost();
+ try {
+ this.approachingDataLimit = connectionCost.approachingDataLimit;
+ switch (connectionCost.networkCostType) {
+ case Windows.Networking.Connectivity.NetworkCostType.unknown:
+ case Windows.Networking.Connectivity.NetworkCostType.unrestricted:
+ this._uiStateService.networkStatus = 1;
+ break;
+ case Windows.Networking.Connectivity.NetworkCostType.fixed:
+ case Windows.Networking.Connectivity.NetworkCostType.variable:
+ if (connectionCost.overDataLimit) {
+ this._uiStateService.networkStatus = 3;
+ stringId = String.id.IDS_NETWORK_STATUS_OVER_THE_LIMIT;
+ raiseNotification = true;
+ isCritical = true
+ }
+ else if (connectionCost.roaming) {
+ this._uiStateService.networkStatus = 3;
+ stringId = String.id.IDS_NETWORK_STATUS_ROAMING;
+ raiseNotification = true;
+ isCritical = true
+ }
+ else {
+ this._uiStateService.networkStatus = 2;
+ stringId = String.id.IDS_NETWORK_STATUS_THROTTLED;
+ raiseNotification = true
+ }
+ break;
+ default:
+ UI.assert(false, "Unknown ConnectivityLevel");
+ this._uiStateService.networkStatus = 0;
+ stringId = String.empty;
+ break
+ }
+ }
+ catch (e) {
+ UI.fail("Exception accessing: networkCostType: " + e.toString());
+ this._uiStateService.networkStatus = 0;
+ stringId = String.empty
+ }
+ break;
+ default:
+ this._uiStateService.networkStatus = 0;
+ stringId = String.empty;
+ break
+ }
+ }
+ catch (e) {
+ UI.fail("Exception accessing: Windows.Networking.Connectivity.NetworkConnectivityLevel: " + e.toString());
+ this._uiStateService.networkStatus = 5
+ }
+ if (this._uiStateService.networkStatus)
+ this._sendTelemetry(this._uiStateService.networkStatus);
+ if (raiseNotification)
+ this._sendNotification(stringId, isCritical);
+ else
+ this._lastNotificationId = stringId
+ };
+ NetworkStatusService.prototype._sendTelemetry = function (status) {
+ var telemetryParameterArray = [{
+ parameterName: Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, parameterValue: NetworkStatusService.NetworkStatus[status]
+ }];
+ Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(Entertainment.Utilities.Telemetry.TelemetryEvents.NetworkService, telemetryParameterArray)
+ };
+ NetworkStatusService.prototype._sendNotification = function (stringId, isCritical) {
+ if (stringId === this._lastNotificationId)
+ return;
+ var appNotificationService = Entertainment.ServiceLocator.getService(Entertainment.Services.appNotification);
+ appNotificationService.removeNotificationByCategory(NetworkStatusService._notificationCategory);
+ this._lastNotificationId = stringId;
+ appNotificationService.send(new UI.Notification({
+ notificationType: isCritical ? UI.Notification.Type.Critical : UI.Notification.Type.Informational, title: String.load(String.id.IDS_NETWORK_STATUS_HEADER), subTitle: String.load(stringId), moreDetails: null, icon: UI.Icon.inlineStreaming, action: null, category: NetworkStatusService._notificationCategory, isPersistent: !!isCritical
+ }))
+ };
+ NetworkStatusService._notificationCategory = "networkStatus";
+ return NetworkStatusService
+ })(UI.Framework.ObservableBase);
+ UI.NetworkStatusService = NetworkStatusService;
+ var NetworkStatusService;
+ (function (NetworkStatusService) {
+ (function (NetworkStatus) {
+ NetworkStatus[NetworkStatus["unknown"] = 0] = "unknown";
+ NetworkStatus[NetworkStatus["unrestricted"] = 1] = "unrestricted";
+ NetworkStatus[NetworkStatus["throttled"] = 2] = "throttled";
+ NetworkStatus[NetworkStatus["onDemand"] = 3] = "onDemand";
+ NetworkStatus[NetworkStatus["localOnly"] = 4] = "localOnly";
+ NetworkStatus[NetworkStatus["none"] = 5] = "none"
+ })(NetworkStatusService.NetworkStatus || (NetworkStatusService.NetworkStatus = {}));
+ var NetworkStatus = NetworkStatusService.NetworkStatus;
+ (function (NetworkedFeature) {
+ NetworkedFeature[NetworkedFeature["musicMarketplace"] = 0] = "musicMarketplace";
+ NetworkedFeature[NetworkedFeature["videoMarketplace"] = 1] = "videoMarketplace"
+ })(NetworkStatusService.NetworkedFeature || (NetworkStatusService.NetworkedFeature = {}));
+ var NetworkedFeature = NetworkStatusService.NetworkedFeature
+ })(NetworkStatusService = UI.NetworkStatusService || (UI.NetworkStatusService = {}));
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.networkStatus, function () {
+ return new NetworkStatusService
+ })
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/components/playback/mediainstance.js:43758 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ MediaInstance: MS.Entertainment.UI.Framework.define(function MediaInstance_constructor(mediaObject) {
+ this._initialize(mediaObject)
+ }, {
+ source: String.empty, acquisitionData: null, alternateSource: null, mediaType: -1, protectionState: MS.Entertainment.Platform.Playback.ProtectionState.unknown, startPosition: 0, cookie: 1, isLocal: false, playlogEnabled: true, trackingId: String.empty, isAudioAd: false, isPreview: false, inCollection: false, inCloudCollectionV2: false, fromCollection: false, licenseKeyId: null, signedLicensePolicyTicket: null, serviceId: null, duration: null, videoAdSupported: false, videoEncoding: Microsoft.Entertainment.Marketplace.VideoEncoding.unknown, alternateVideoEncoding: null, _bookmark: 0, _played: false, _playcount: 0, _mediaItem: null, _provider: null, _errorDescriptor: null, _initializedPromise: null, _mediaStore: null, _bookmarkWatcher: null, _initialize: function MediaInstance_initialize(mediaObject) {
+ var that = this;
+ var playFromBookmark = true;
+ if (mediaObject) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (mediaObject.hasOwnProperty("source")) {
+ var source = mediaObject["source"];
+ var manifestHint = /_51.ism\/manifest/i;
+ if (source && source.toString().match(manifestHint) && !MS.Entertainment.Utilities.isVideoApp2) {
+ this["alternateSource"] = source;
+ this["source"] = source.toString().replace(manifestHint, "_ST.ism/manifest")
+ }
+ else
+ this["source"] = source
+ }
+ if (mediaObject.hasOwnProperty("mediaType"))
+ this["mediaType"] = mediaObject["mediaType"];
+ if (mediaObject.hasOwnProperty("startPosition") && mediaObject["startPosition"]) {
+ this["startPosition"] = mediaObject["startPosition"];
+ playFromBookmark = false
+ }
+ if (mediaObject.hasOwnProperty("cookie"))
+ this["cookie"] = mediaObject["cookie"];
+ this["isPreview"] = false;
+ if (mediaObject.hasOwnProperty("mediaItem")) {
+ this["_mediaItem"] = mediaObject["mediaItem"];
+ if (this._mediaItem && this._mediaItem.acquisitionData)
+ this["acquisitionData"] = this._mediaItem.acquisitionData;
+ if (this._mediaItem && this._mediaItem.data) {
+ if (this._mediaItem.data.libraryId)
+ this["libraryId"] = this._mediaItem.data.libraryId;
+ if (this._mediaItem.data.playPreviewOnly) {
+ this["playlogEnabled"] = false;
+ this["isPreview"] = true
+ }
+ if (this._mediaItem.data.playlistId && this._mediaItem.data.playlistId >= 0) {
+ this["containerLibraryId"] = this._mediaItem.data.playlistId;
+ this["containerMediaType"] = Microsoft.Entertainment.Queries.ObjectType.playlist
+ }
+ else if (this._mediaItem.data.albumId) {
+ this["containerLibraryId"] = this._mediaItem.data.albumId;
+ this["containerMediaType"] = Microsoft.Entertainment.Queries.ObjectType.album
+ }
+ if (this._mediaItem.data.inCollection)
+ this["inCollection"] = this._mediaItem.data.inCollection;
+ if (this._mediaItem.data.inCloudCollectionV2)
+ this["inCloudCollectionV2"] = this._mediaItem.data.inCloudCollectionV2;
+ if (this._mediaItem.data.duration)
+ this["duration"] = this._mediaItem.data.duration;
+ if (this._mediaItem.data.serviceId)
+ this["serviceId"] = this._mediaItem.data.serviceId;
+ if (this._mediaItem.data.fromCollection)
+ this["fromCollection"] = this._mediaItem.data.fromCollection
+ }
+ }
+ if (mediaObject.hasOwnProperty("mediaInstanceId"))
+ this["mediaInstanceId"] = mediaObject["mediaInstanceId"];
+ if (mediaObject.hasOwnProperty("licenseKeyId"))
+ this["licenseKeyId"] = mediaObject["licenseKeyId"];
+ if (mediaObject.hasOwnProperty("signedLicensePolicyTicket"))
+ this["signedLicensePolicyTicket"] = mediaObject["signedLicensePolicyTicket"];
+ if (mediaObject.hasOwnProperty("nativeLicenseRight"))
+ this["nativeLicenseRight"] = mediaObject["nativeLicenseRight"];
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var freeVideoWithAds = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoFreeWithAds);
+ if (mediaObject.hasOwnProperty("offerId")) {
+ this["offerId"] = mediaObject["offerId"];
+ var offerId = mediaObject["offerId"];
+ if (freeVideoWithAds && offerId && configurationManager.video.offerIdsVideoFreeWithAds) {
+ MS.Entertainment.Platform.Playback.assert(offerId.length > 3, "OfferId is invalid.");
+ offerId = offerId.substr(1, offerId.length - 2).toLowerCase();
+ var freeOfferWithAds = configurationManager.video.offerIdsVideoFreeWithAds.split(',');
+ for (var count = 0; count < freeOfferWithAds.length; count++)
+ if (offerId === freeOfferWithAds[count].toLowerCase()) {
+ this.videoAdSupported = true;
+ break
+ }
+ }
+ }
+ if (freeVideoWithAds && configurationManager.video.playVideoFreeWithAds)
+ this.videoAdSupported = true;
+ if (mediaObject.hasOwnProperty("libraryId"))
+ this["libraryId"] = mediaObject["libraryId"];
+ if (mediaObject.hasOwnProperty("isLocal"))
+ this["isLocal"] = mediaObject["isLocal"];
+ if (mediaObject.hasOwnProperty("error"))
+ this["_errorDescriptor"] = mediaObject["error"];
+ if (mediaObject.hasOwnProperty("trackingId") && !!mediaObject.trackingId)
+ this["trackingId"] = mediaObject["trackingId"];
+ if (mediaObject.hasOwnProperty("isAudioAd"))
+ this["isAudioAd"] = mediaObject["isAudioAd"];
+ if (mediaObject.hasOwnProperty("protectionState"))
+ this["protectionState"] = mediaObject["protectionState"];
+ if (mediaObject.hasOwnProperty("videoEncoding")) {
+ this["videoEncoding"] = mediaObject["videoEncoding"];
+ this["alternateVideoEncoding"] = null
+ }
+ else if (this.isVideo() && this.isPreview) {
+ this["videoEncoding"] = Microsoft.Entertainment.Marketplace.VideoEncoding.h264;
+ this["alternateVideoEncoding"] = Microsoft.Entertainment.Marketplace.VideoEncoding.vc1
+ }
+ var protectionState = this["protectionState"];
+ if (this.isLocal && this.isMusicTrack() && (protectionState === MS.Entertainment.Platform.Playback.ProtectionState.drmProtected || protectionState === MS.Entertainment.Platform.Playback.ProtectionState.unknown)) {
+ var isSubscription = configurationManager.service.lastSignedInUserSubscription;
+ if (!isSubscription)
+ if (protectionState === MS.Entertainment.Platform.Playback.ProtectionState.drmProtected) {
+ this["_errorDescriptor"] = { msExtendedCode: MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_FREESTREAMING_NO_RIGHTS.code };
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_constructor : Free-streaming user trying to play protected content, setting error to 0xC1010094")
+ }
+ else if (protectionState === MS.Entertainment.Platform.Playback.ProtectionState.unknown) {
+ this["protectionState"] = MS.Entertainment.Platform.Playback.ProtectionState.unprotected;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_constructor : unknown protection state. We set to unprotected state")
+ }
+ }
+ }
+ this._initializedPromise = this._loadBookmarkAndPlayDataAsync(playFromBookmark);
+ this._maxPositionValueHolder = 0;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ this._ratedContentDescriptionPromise = contentRestrictionService.createRatedContentDescriptionFromMediaItemAsync(this._mediaItem && this._mediaItem.data, MS.Entertainment.Utilities.isMusicApp2)
+ }
+ }, maxPosition: {
+ get: function MediaInstance__position_get() {
+ return this._maxPositionValueHolder
+ }, set: function MediaInstance__position_set(value) {
+ if (value > this._maxPositionValueHolder && !this._remoteTrackingMode)
+ this._maxPositionValueHolder = value
+ }
+ }, _loadBookmarkAndPlayDataAsync: function MediaInstance_loadBookmarkAndPlayDataAsync(playFromBookmark) {
+ var provider = this._getProvider();
+ if (this.playlogEnabled && provider && this.libraryId && this.libraryId > 0) {
+ var getBookmarkAsync = provider.getBookmarkAsync(this.libraryId).then(function success(result) {
+ this._bookmark = result.value;
+ if (playFromBookmark)
+ this.startPosition = this._bookmark;
+ return WinJS.Promise.wrap()
+ }.bind(this), function error() {
+ this._bookmark = 0;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_loadBookmarkAndPlayDataAsync : Failed to load bookmark");
+ return WinJS.Promise.wrap()
+ }.bind(this));
+ var getPlaycountAsync = provider.getPlaycountAsync(this.libraryId).then(function success(result) {
+ this._playcount = result.value;
+ return WinJS.Promise.wrap()
+ }.bind(this), function error() {
+ this._playcount = 0;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_loadBookmarkAndPlayDataAsync : Failed to load play count");
+ return WinJS.Promise.wrap()
+ }.bind(this));
+ var getPlayedStatusAsync = provider.getPlayedStatusAsync(this.libraryId).then(function success(result) {
+ this._played = result.value;
+ return WinJS.Promise.wrap()
+ }.bind(this), function error() {
+ this._played = 0;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_loadBookmarkAndPlayDataAsync : Failed to load played status");
+ return WinJS.Promise.wrap()
+ }.bind(this));
+ return WinJS.Promise.join([getBookmarkAsync, getPlaycountAsync, getPlayedStatusAsync]).then(function () {
+ return WinJS.Promise.wrap(this)
+ }.bind(this))
+ }
+ else
+ return WinJS.Promise.wrap(this)
+ }, isEqual: function MediaInstance_isEqual(mediaInstance) {
+ var isSame = false;
+ if (mediaInstance && this.source === mediaInstance.source && this.mediaType === mediaInstance.mediaType && this.protectionState === mediaInstance.protectionState && this.startPosition === mediaInstance.startPosition && this.cookie === mediaInstance.cookie)
+ isSame = true;
+ return isSame
+ }, toString: function MediaInstance_toString() {
+ var mediaString = this.source + " : " + this.mediaType + " : " + this.protectionState + " : " + this.startPosition + " : " + this.cookie;
+ return mediaString
+ }, _getProvider: function _getProvider() {
+ if (!this._mediaStore)
+ this._mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ if (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ return this._mediaStore.videoProvider;
+ else if (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ return this._mediaStore.trackProvider;
+ else
+ return null
+ }, _getContainerProvider: function _getContainerProvider() {
+ if (!this._mediaStore)
+ this._mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ switch (this.containerMediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ return this._mediaStore.albumProvider;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ return this._mediaStore.playlistProvider;
+ default:
+ return null
+ }
+ }, _getBookmarkWatcher: function _getBookmarkWatcher() {
+ if (!this._bookmarkWatcher)
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.bookmarkOperationsWatcher))
+ this._bookmarkWatcher = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.bookmarkOperationsWatcher);
+ return this._bookmarkWatcher
+ }, _getMediaItemProp: function MediaInstance_getMediaItemProp(name, defaultValue, validityCheckFunction) {
+ if (!name || typeof (name) !== "string" || name === String.empty)
+ throw new Error("Invalid property name.");
+ if (!validityCheckFunction || typeof (validityCheckFunction) !== "function")
+ throw new Error("Invalid validity check function.");
+ var result = this[name];
+ if (validityCheckFunction(result))
+ return result;
+ if (this._mediaItem) {
+ var result = this._mediaItem[name];
+ if (validityCheckFunction(result))
+ return result;
+ if (this._mediaItem.data) {
+ var result = this._mediaItem.data[name];
+ if (validityCheckFunction(result))
+ return result
+ }
+ }
+ return defaultValue
+ }, isMovie: function MediaInstance_isMovie() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && this._mediaItem.data.videoType === Microsoft.Entertainment.Queries.VideoType.movie);
+ return isType
+ }, isTVEpisode: function MediaInstance_isTVEpisode() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && this._mediaItem.data.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode);
+ return isType
+ }, isVideo: function MediaInstance_isVideo() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ }, isMusicVideo: function MediaInstance_isMusicVideo() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && this._mediaItem.data.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo);
+ return isType
+ }, isMusicTrack: function MediaInstance_isMusicTrack() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ }, isMusicAlbum: function MediaInstance_isMusicAlbum() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ }, isGame: function MediaInstance_isGame() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.game)
+ }, isArtist: function MediaInstance_isArtist() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.person && this._mediaItem.personType === Microsoft.Entertainment.Queries.PersonType.artist);
+ return isType
+ }, isGenre: function MediaInstance_isGenre() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.genre)
+ }, isPlaylist: function MediaInstance_isPlaylist() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist)
+ }, bookmark: {
+ set: function MediaInstance_setBookmark(newValue) {
+ this._bookmark = newValue;
+ if (this.libraryId && this.libraryId > 0) {
+ var provider = this._getProvider();
+ if (provider) {
+ var setBookmarkAsync = provider.setBookmarkAsync(this.libraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogBookmarkSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setBookmarkAsync : Failed to save bookmark")
+ });
+ var bookmarkWatcher = this._getBookmarkWatcher();
+ if (bookmarkWatcher)
+ bookmarkWatcher.registerOperation(setBookmarkAsync)
+ }
+ }
+ }, get: function MediaInstance_getBookmark() {
+ return this._bookmark
+ }
+ }, played: {
+ set: function MediaInstance_setPlayed(newValue) {
+ this._played = newValue;
+ if (this.libraryId && this.libraryId > 0) {
+ var provider = this._getProvider();
+ var containerProvider = this._getContainerProvider();
+ var bookmarkWatcher = this._getBookmarkWatcher();
+ if (provider) {
+ var setPlayedStatusAsync = provider.setPlayedStatusAsync(this.libraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogPlayedSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setPlayedStatusAsync : Failed to save played status")
+ });
+ if (bookmarkWatcher)
+ bookmarkWatcher.registerOperation(setPlayedStatusAsync)
+ }
+ if (containerProvider) {
+ var setPlayedStatusAsync = containerProvider.setPlayedStatusAsync(this.containerLibraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogPlayedSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setPlayedStatusAsync : Failed to save played status on container")
+ });
+ if (bookmarkWatcher)
+ bookmarkWatcher.registerOperation(setPlayedStatusAsync)
+ }
+ }
+ }, get: function MediaInstance_getPlayed() {
+ return this._played
+ }
+ }, playcount: {
+ set: function MediaInstance_setPlaycount(newValue) {
+ this._playcount = newValue;
+ if (this.libraryId && this.libraryId > 0) {
+ var provider = this._getProvider();
+ if (provider)
+ provider.setPlaycountAsync(this.libraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogPlayCountSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setPlaycountAsync : Failed to save play count")
+ })
+ }
+ }, get: function MediaInstance_getPlaycount() {
+ return this._playcount
+ }
+ }, serviceIdSafe: {
+ get: function MediaInstance_getServiceId() {
+ var serviceMediaIdSafe = this._getMediaItemProp("zuneId", MS.Entertainment.Utilities.EMPTY_GUID, function (value) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(value)
+ });
+ if (MS.Entertainment.Utilities.isValidServiceId(serviceMediaIdSafe))
+ return serviceMediaIdSafe;
+ else {
+ serviceMediaIdSafe = this._getMediaItemProp("serviceId", MS.Entertainment.Utilities.EMPTY_GUID, function (value) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(value)
+ });
+ var serviceIdType = this._getMediaItemProp("serviceIdType", "unknown", function (value) {
+ return value === MS.Entertainment.Data.Query.edsIdType.zuneCatalog || value === MS.Entertainment.Data.Query.edsIdType.canonical
+ });
+ if (serviceIdType === MS.Entertainment.Data.Query.edsIdType.zuneCatalog)
+ return serviceMediaIdSafe;
+ else
+ return MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ }
+ }, mediaTypeSafe: {
+ get: function MediaInstance_getMediaTypeSafe() {
+ return this._getMediaItemProp("mediaType", -1, function (value) {
+ return value !== -1
+ })
+ }
+ }, shouldLogToDrmDownloadHistory: {
+ get: function MediaInstance_shouldLogToDownloadHistory() {
+ if (this.nativeLicenseRight !== undefined && this.nativeLicenseRight !== null && this.nativeLicenseRight !== Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.unknownMediaRight)
+ return this.nativeLicenseRight !== Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload;
+ return this.mediaTypeSafe !== Microsoft.Entertainment.Queries.ObjectType.track
+ }
+ }, fillDownloadSubscriptionInfoAsync: function fillDownloadSubscriptionInfoAsync() {
+ if ((!this.mediaInstanceId || MS.Entertainment.Utilities.isEmptyGuid(this.mediaInstanceId)) && this._mediaItem && this.mediaTypeSafe === Microsoft.Entertainment.Queries.ObjectType.track)
+ return MS.Entertainment.Platform.PurchaseHelpers.queryMediaDetailForCacheItemAsync(this._mediaItem, this.mediaTypeSafe).then(function queryMediaDetailForCacheItemAsync_complete(detail) {
+ if (detail.result && detail.result.item && detail.result.item.rights) {
+ var right = MS.Entertainment.Platform.PurchaseHelpers.getPreferredRight(detail.result.item.rights, [Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload]);
+ if (right) {
+ this.mediaInstanceId = right.mediaInstanceId;
+ this.offerId = right.offerId;
+ this.nativeLicenseRight = Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload
+ }
+ }
+ }.bind(this));
+ return WinJS.Promise.wrap()
+ }
+ }, {
+ createInstanceAsync: function MediaInstance_CreateInstanceAsync(itemData) {
+ var mediaInstance = new MSEPlatform.Playback.MediaInstance(itemData);
+ return mediaInstance._initializedPromise
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/components/playback/controls/playbackcontroller.js:44125 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ var Playback = WinJS.Namespace.define("MS.Entertainment.Platform.Playback", null);
+ var VideoRetrySkipTimeMs = 2000;
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ PlaybackController: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function PlaybackController_constructor() {
+ var sessionMgr = null;
+ var eventHandlers = MS.Entertainment.Utilities.addEvents(this, {
+ currentMediaChanged: function currentMediaChanged(e) {
+ var newMedia = e.detail.newValue;
+ var oldMedia = e.detail.oldValue;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::currentMediaChanged: ");
+ this._setMedia(newMedia);
+ if (!sessionMgr && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (newMedia && sessionMgr)
+ sessionMgr._notifyUpcomingStreaming(!newMedia.isLocal);
+ if (newMedia)
+ this._isVideo = newMedia.isVideo ? newMedia.isVideo() : false
+ }.bind(this), nextMediaChanged: function nextMediaChanged(e) {
+ var newMedia = e.detail.newValue;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::nextMediaChanged: " + (newMedia ? newMedia.source : "null"));
+ if (!!newMedia)
+ MS.Entertainment.Platform.Playback.Etw.tracePlaylistSetNextMedia(newMedia);
+ this._setNextMedia(newMedia)
+ }.bind(this), playerStateChanged: function playerStateChanged(e) {
+ var newState = e.detail.newValue;
+ var oldState = e.detail.oldValue;
+ if (!oldState)
+ oldState = "undefined";
+ MSEPlatform.Playback.Etw.tracePlayerStateChanged(newState, oldState)
+ }, currentTransportStateChanged: function currentTransportStateChanged(e) {
+ var newState = e.detail.newValue;
+ var oldState = e.detail.oldValue;
+ if (!oldState)
+ oldState = "undefined";
+ MSEPlatform.Playback.Etw.traceTransportStateChanged(newState, oldState, this._isVideo)
+ }.bind(this)
+ });
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.bind("currentTransportState", function onCurrentTransportStateChanged() {
+ this._reschedulePrerollCallback()
+ }.bind(this));
+ this._configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._offlineNetworkRequestDelay = this._configManager.playback.offlineNetworkRequestDelay;
+ var observablePromises = {};
+ var lastPlayerStateError = null;
+ this._observableNoLossAssign = function _observableNoLossAssign(name, value) {
+ if (name === "playerState")
+ if (value === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ if (!this._errorDescriptor.isCritical)
+ this._errorDescriptor.isCritical = this._isCriticalError(this._errorDescriptor);
+ if (this._currentMedia)
+ this._errorDescriptor.errorOrdinal = this._currentMedia.cookie;
+ this._observableNoLossAssign("error", this._errorDescriptor);
+ lastPlayerStateError = this._errorDescriptor
+ }
+ else if (lastPlayerStateError) {
+ this._observableNoLossAssign("error", null);
+ lastPlayerStateError = null
+ }
+ if (!observablePromises[name])
+ observablePromises[name] = this.updateAndNotify(name, value);
+ else
+ observablePromises[name] = observablePromises[name].then(function assign() {
+ return this.updateAndNotify(name, value)
+ }.bind(this))
+ };
+ this._observableNoLossAssignAsyncBegin = function _observableNoLossAssignAsyncBegin(name) {
+ var completion;
+ if (observablePromises[name]) {
+ observablePromises[name].cancel();
+ observablePromises[name] = null
+ }
+ observablePromises[name] = new WinJS.Promise(function (c, e, p) {
+ completion = c
+ });
+ return {
+ complete: function (value) {
+ if (value)
+ this._observableNoLossAssign(name, value);
+ completion()
+ }.bind(this), cancel: function () {
+ if (observablePromises[name]) {
+ observablePromises[name].cancel();
+ observablePromises[name] = null
+ }
+ }.bind(this)
+ }
+ },
+ this.waitForNoLossAssignmentsComplete = function waitForNoLossAssignmentsComplete() {
+ return WinJS.Promise.join(observablePromises)
+ }
+ }, {
+ dispose: function dispose() {
+ this.reset();
+ this.unbind("currentTransportState");
+ if (this._playerEventHandlers) {
+ this._playerEventHandlers.cancel();
+ this._playerEventHandlers = null
+ }
+ this._player._currentMediaEventsCallback = null
+ }, targetTransportState: {
+ get: function targetTransportState_get() {
+ return this._targetTransportState
+ }, set: function targetTransportState_set(value) {
+ if (!this._isPlayerSet())
+ return;
+ MSEPlatform.Playback.Etw.traceTargetTransportStateSet(value, this.currentTransportState);
+ if (this._isPlayerState(MSEPlatform.Playback.PlayerState.ready)) {
+ if ((this._targetTransportState !== value) || (MS.Entertainment.Platform.Playback.TransportState.playing === value && (this.playbackRate > 1 || this.playbackRate < -1)))
+ this._applyTargetTransportState(value)
+ }
+ else if (this._isPlayerState(MSEPlatform.Playback.PlayerState.error))
+ try {
+ this._applyTargetTransportState(value)
+ }
+ catch (e) { }
+ else
+ this._targetTransportState = value
+ }
+ }, autoPlay: {
+ get: function autoPlay_get() {
+ if (!this._isPlayerSet())
+ return false;
+ return this._player.autoPlay
+ }, set: function autoPlay_set(value) {
+ if (!this._isPlayerSet())
+ return;
+ this._player.autoPlay = value
+ }
+ }, muted: {
+ get: function muted_get() {
+ if (!this._isPlayerSet())
+ return false;
+ return this._player.muted
+ }, set: function muted_set(value) {
+ if (!this._isPlayerSet())
+ return;
+ this._player.muted = value
+ }
+ }, videoEncoding: {
+ get: function videoEncoding_get() {
+ return this.currentMedia ? this.currentMedia.videoEncoding : null
+ }
+ }, videoStreamStatistics: {
+ get: function videoStreamStatistics_get() {
+ if (!this._isPlayerSet())
+ return null;
+ return this._player.videoStreamStatistics
+ }
+ }, _volume: {
+ get: function volume_get() {
+ if (!this._isPlayerSet())
+ return null;
+ return this._player._volume
+ }, set: function volume_set(value) {
+ MS.Entertainment.UI.assert(MS.Entertainment.Utilities.isApp2, "Apply volume directly on the tag should be limited to App2 only");
+ if (!this._isPlayerSet())
+ return;
+ this._player._volume = value
+ }
+ }, seekToPosition: function seekToPosition(positionMsec) {
+ if (!this._isPlayerSet())
+ return;
+ if (positionMsec < 0)
+ positionMsec = 0;
+ if (positionMsec > this.duration)
+ positionMsec = this.duration;
+ if (!this._isPlayerState(MSEPlatform.Playback.PlayerState.ready))
+ this._targetPosition = positionMsec;
+ else {
+ if (this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ MS.Entertainment.Utilities.Telemetry.logPauseHappened(this, this.forceTimeUpdate());
+ MS.Entertainment.Utilities.Telemetry.logPlayHappened(this, positionMsec)
+ }
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var isPlayToReceiverSessionRunning = sessionMgr && sessionMgr.primarySession && sessionMgr.primarySession.isPlayToReceiverSessionRunning;
+ if (!isPlayToReceiverSessionRunning)
+ if ((this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped) && (this._currentMedia && !this._currentMedia.videoAdSupported))
+ this._applyTargetTransportState(MS.Entertainment.Platform.Playback.TransportState.playing);
+ this._player.seekToPosition(positionMsec);
+ if (this.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.playing)
+ this._targetPosition = positionMsec
+ }
+ }, fastFwd: function fastFwd() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.fastFwd()
+ }, fastReverse: function fastReverse() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.rewind()
+ }, slowFwd: function slowFwd() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.slowFwd()
+ }, slowReverse: function slowReverse() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.slowRewind()
+ }, selectVideoBitrate: function selectVideoBitrate(requestedBitrate) {
+ if (!this._isPlayerSet())
+ return;
+ this.currentRequestedBitrate = +requestedBitrate;
+ this._player.selectVideoBitrate(requestedBitrate)
+ }, getAudioTracks: function getAudioTracks() {
+ if (!this._isPlayerSet())
+ return;
+ return this._player.getAudioTracks()
+ }, getSelectedAudioTrack: function getSelectedAudioTrack() {
+ if (!this._isPlayerSet())
+ return;
+ return this._player.getSelectedAudioTrack()
+ }, selectAudioTrack: function selectAudioTrack(trackIndex) {
+ if (!this._isPlayerSet())
+ return;
+ this._player.selectAudioTrack(trackIndex)
+ }, setPlaybackRate: function setPlaybackRate(playbackRate) {
+ if (!this._isPlayerSet())
+ return;
+ if (playbackRate === +playbackRate && playbackRate >= this.minPlaybackRate && playbackRate <= this.maxPlaybackRate)
+ this._player.playbackRate = playbackRate
+ }, reset: function reset(sendStop) {
+ this._internalCurrentMedia = null;
+ if (!this._isPlayerSet())
+ return;
+ if (sendStop && this._player && this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ this._player.reset(false);
+ this._player.reset(true);
+ if (this._prerollMediaItem) {
+ this._prerollMediaItem = null;
+ this._cancelPrerollCallback()
+ }
+ this.currentPosition = 0;
+ this._targetPosition = 0;
+ if (sendStop)
+ this.currentTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ this._targetTransportState = MS.Entertainment.Platform.Playback.TransportState.unInitialize;
+ this.duration = 0;
+ this.errorDescriptor = null;
+ this._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.notReady);
+ this.readyForNextMedia = false;
+ this.videoWidth = 0;
+ this.videoHeight = 0;
+ this.playbackRate = 1;
+ this.minPlaybackRate = -128;
+ this.maxPlaybackRate = 128;
+ this.currentRequestedBitrate = null
+ }, forceError: function forceError(errorCode) {
+ if (!this._isPlayerSet())
+ return;
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), errorCode, "forceError");
+ this.reset(true)
+ }, setPlayer: function setPlayer(player) {
+ if (player) {
+ this._player = player;
+ if (this._playerEventHandlers) {
+ this._playerEventHandlers.cancel();
+ this._playerEventHandlers = null
+ }
+ this._playerEventHandlers = MS.Entertainment.Utilities.addEvents(this._player, {
+ _nextMediaLoadedChanged: function _onNextMediaLoaded(e) {
+ var isLoaded = e.detail.newValue;
+ this._handleNextMediaLoaded(isLoaded, this)
+ }.bind(this), _nextMediaStartedChanged: function _onNextMediaStarted(e) {
+ var isStarted = e.detail.newValue;
+ this._handleNextMediaStarted(isStarted, this)
+ }.bind(this), _nextMediaErrorChanged: function _onNextMediaError(e) {
+ var isError = e.detail.newValue;
+ this._handleNextMediaError(isError)
+ }.bind(this), isRemoteSessionRunningChanged: function _onRemoteSessionChanged(e) {
+ var isRemoteSessionRunningValue = e.detail.newValue;
+ this.isRemoteSessionRunning = isRemoteSessionRunningValue
+ }.bind(this), playToSenderConnectionStateChanged: function _onPlayToSenderConnectionStateChanged(e) {
+ var playToSenderConnectionStateValue = e.detail.newValue;
+ this.playToSenderConnectionState = playToSenderConnectionStateValue
+ }.bind(this), mediaElementChanged: function _onMediaElementChanged(e) {
+ var mediaElementValue = e.detail.newValue;
+ this.mediaElement = mediaElementValue
+ }.bind(this)
+ });
+ this._player._currentMediaEventsCallback = this._onPlayerEvent.bind(this)
+ }
+ }, enableTimeUpdate: function enableTimeUpdate() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.enableTimeUpdate();
+ MSEPlatform.Playback.Etw.tracePlaybackEnableTimeUpdate(this.currentPosition)
+ }, disableTimeUpdate: function disableTimeUpdate() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.disableTimeUpdate();
+ MSEPlatform.Playback.Etw.tracePlaybackDisableTimeUpdate(this.currentPosition)
+ }, forceTimeUpdate: function forceTimeUpdate() {
+ if (this._isPlayerSet() && this._player._currentPlayer) {
+ this.currentPosition = this._player.forceTimeUpdate();
+ MSEPlatform.Playback.Etw.tracePlaybackForceTimeUpdate(this.currentPosition)
+ }
+ return this.currentPosition
+ }, isRemoteSession: function isRemoteSession() {
+ if (this._isPlayerSet())
+ return this._player.isRemoteSession();
+ return false
+ }, notifyNetworkConnectionChanged: function notifyNetworkConnectionChanged(networkConnection) {
+ WinJS.Promise.timeout().then(this._handleNetworkConnectionChanged(networkConnection))
+ }, skipToNextPrerolled: function skipToNextPrerolled(fromSkipButton) {
+ this._reportPrerollErrors();
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ this._player._switchPlayerAsync().done(function switch_completed(succeeded) {
+ if (succeeded) {
+ if (this.targetTransportState === MSEPlatform.Playback.TransportState.playing || this.currentTransportState === MSEPlatform.Playback.TransportState.playing || (this.autoPlay && !fromSkipButton))
+ this._applyTargetTransportState(MSEPlatform.Playback.TransportState.playing)
+ }
+ else
+ this._skipButtonPressed = fromSkipButton
+ }.bind(this), null)
+ }, hasPrerolledMedia: function hasPrerolledMedia() {
+ return (this._player && this._player._nextPlayer)
+ }, _internalPrerollMediaItem: function _internalPrerollMediaItem(mediaItem) {
+ this._prerollMediaItem = mediaItem;
+ if (this._prerollMediaItem)
+ return WinJS.Promise.as(this._reschedulePrerollCallback());
+ else
+ return WinJS.Promise.as(this._setNextMedia(null))
+ }, prerollMediaItem: function PrerollMediaItem(mediaItem) {
+ var Playback = MS.Entertainment.Platform.Playback;
+ var name = (mediaItem && mediaItem.data) ? mediaItem.data.name : String.empty;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::prerollMediaItem: Control has been asked to preroll \"" + name + "\"");
+ this._cancelPrerollCallback();
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = true;
+ if (MS.Entertainment.Utilities.isMusicApp && mediaItem && mediaItem.data)
+ return MS.Entertainment.Utilities.playabilityTestAsync(mediaItem.data, {
+ mediaRights: MS.Entertainment.Utilities.isApp1, checkExplicit: MS.Entertainment.Utilities.isApp1
+ }).then(function onPlayabilityTest(playability) {
+ if (!playability.isPlayable)
+ return WinJS.Promise.wrapError(new Playback.UnplayableItemError(mediaItem, mediaItem.index));
+ else
+ return this._internalPrerollMediaItem(mediaItem)
+ }.bind(this));
+ return this._internalPrerollMediaItem(mediaItem)
+ }, _reschedulePrerollCallback: function _reschedulePrerollCallback() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback");
+ this._cancelPrerollCallback();
+ if (!this._prerollMediaItem) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Control has nothing to preroll. Dropping reschedule request.");
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = false;
+ return
+ }
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Control is scheduling next media.");
+ var myPrerollPromiseOrdinal = this._prerollPromiseOrdinal;
+ this._prerollPromise = this._collectPrerollInformation().then(function onCollectPrerollInformation(prerollInformation) {
+ if (myPrerollPromiseOrdinal !== this._prerollPromiseOrdinal) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Promise was canceled but completed anyway. Dropping.");
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = false;
+ return
+ }
+ if (this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Control was stopped, prerolling immediately.");
+ prerollInformation.delayTime = 0
+ }
+ if (prerollInformation.delayTime > 0 && this.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.playing)
+ if (this.currentMedia && this.currentMedia._errorDescriptor)
+ if (this._errorCount < this._maxSequentialErrors) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Not playing and in error, prerolling immediately.");
+ prerollInformation.delayTime = 0
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Not scheduling preroll. Too many errors. Report and deactivate playlist");
+ this._setNextMedia(null);
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Not scheduling preroll. Determined we should delay but pipeline is not playing");
+ return
+ }
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Scheduling preroll for " + (prerollInformation.delayTime / 1000) + " seconds from now");
+ return WinJS.Promise.timeout(prerollInformation.delayTime).then(function onPrerollTimeout() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Preroll timeout fired at " + (this.currentPosition / 1000) + " seconds into the file. ");
+ return this._requestNetwork().then(function () {
+ return this._setPrerollItemAsNextInstance()
+ }.bind(this))
+ }.bind(this), function onPrerollTimeoutError(error) {
+ if (WinJS.Promise.isCanceledError(error))
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: _prerollPromise canceled.")
+ })
+ }.bind(this), function onCollectPrerollInformationError(error) {
+ if (WinJS.Promise.isCanceledError(error))
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback::onCollectPrerollInformationError: _prerollPromise canceled.")
+ })
+ }, _cancelPrerollCallback: function PlaylistCore_cancelPrerollCallback() {
+ if (this._prerollPromise) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::cancelPrerollCallback: Canceling scheduled preroll.");
+ this._prerollPromise.cancel();
+ this._prerollPromise = null;
+ this._prerollPromiseOrdinal++
+ }
+ }, _collectPrerollInformation: function PlaylistCore_collectPrerollInformation() {
+ return this._hydrateItemForPreroll(this._prerollMediaItem).then(function onHydrateItemForPreroll(result) {
+ var prerollInformation = {
+ isLocal: null, delayTime: 0
+ };
+ if (result && result.data) {
+ prerollInformation.isLocal = result.data.canPlayLocally;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::collectPrerollInformation: Preroll item can play locally: " + result.data.canPlayLocally + ".");
+ if (prerollInformation.isLocal === false)
+ prerollInformation.delayTime = this._calculatePrerollTimeout()
+ }
+ return prerollInformation
+ }.bind(this))
+ }, _hydrateItemForPreroll: function _hydrateItemForPreroll(mediaItem) {
+ if (mediaItem && !mediaItem.hydratedForPreroll && mediaItem.data && mediaItem.data.mediaType) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: >> hydrateLibraryInfoAsync");
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(mediaItem.data).then(function onHydrateLibraryInfoAsync() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: << hydrateLibraryInfoAsync");
+ mediaItem.hydratedForPreroll = true;
+ return WinJS.Promise.wrap(mediaItem)
+ }, function onHydrateLibraryInfoAsyncError(e) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: << hydrateLibraryInfoAsync Error");
+ return WinJS.Promise.wrapError(e)
+ })
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: mediaItem hydrated for preroll");
+ if (mediaItem)
+ mediaItem.hydratedForPreroll = true;
+ return WinJS.Promise.wrap(mediaItem)
+ }
+ }, _calculatePrerollTimeout: function PlaylistCore_calculatePrerollTimeout() {
+ var currentPosition = this.forceTimeUpdate();
+ var currentDuration = this.duration ? this.duration : 0;
+ var timeout = currentDuration - currentPosition;
+ timeout = timeout - this._configManager.playback.streamingPrerollMS;
+ if (timeout < 0)
+ timeout = 0;
+ MSEPlatform.Playback.Etw.traceString("calculatePrerollTimeout: Determining a preroll timeout position: " + currentPosition + " duration: " + currentDuration + " timeout: " + timeout);
+ return timeout
+ }, _setPrerollItemAsNextInstance: function _setPrerollItemAsNextInstance() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setPrerollItemAsNextInstance: Prerolling at " + (this.currentPosition / 1000) + " seconds into the file.");
+ var onSetComplete = function onSetComplete() {
+ this._prerollMediaItem = null
+ }.bind(this);
+ MS.Entertainment.Platform.Playback.assert(this._prerollMediaItem, "Tried to convert a null preroll item. Dropping.");
+ if (!this._prerollMediaItem) {
+ MSEPlatform.Playback.Etw.traceString("Tried to convert a null preroll item. Dropping.");
+ return
+ }
+ return MS.Entertainment.Platform.Playback.Playlist.PlaylistCore.convertMediaItemToMediaInstance(this._prerollMediaItem, null, MS.Entertainment.Platform.Playback.UsageContext.automatic).then(function onConvertMediaItemToMediaInstance(mediaInstance) {
+ MSEPlatform.Playback.Etw.traceString("onConvertMediaItemToMediaInstance: mediaInstance.source = " + mediaInstance.source);
+ this.nextMedia = mediaInstance;
+ onSetComplete()
+ }.bind(this), function onConvertMediaItemToMediaInstanceError(error) {
+ MSEPlatform.Playback.Etw.traceString("onConvertMediaItemToMediaInstanceError");
+ if (error && error.isUnplayableItemError) {
+ onSetComplete();
+ this._signalForNextMedia()
+ }
+ else if (!(WinJS.Promise.isCanceledError(error)))
+ return MSEPlatform.Playback.MediaInstance.createInstanceAsync({
+ cookie: this._prerollMediaItem.index, error: MSEPlatform.Playback.makePlaybackError(error, "prerollMediaItem_convertMediaItemToMediaInstance error"), mediaItem: this._prerollMediaItem
+ }).then(function (errorMediaInstance) {
+ this.nextMedia = errorMediaInstance;
+ onSetComplete()
+ }.bind(this));
+ else
+ MSEPlatform.Playback.Etw.traceString("onConvertMediaItemToMediaInstanceError: prerollMediaItem canceled")
+ }.bind(this))
+ }, _isPlayerSet: function _isPlayerSet() {
+ if (!this._player)
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::isPlayerSet: No, player is not set yet!");
+ return (this._player ? true : false)
+ }, _isPlayerState: function _isPlayerState(state) {
+ return (this.playerState === state)
+ }, _requestNetwork: function _requestNetwork() {
+ return WinJS.Promise.timeout(0)
+ }, _releaseNetwork: function _releaseNetwork() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::releaseNetwork");
+ if (this._networkUpRequest) {
+ var releaseMeLater = this._networkUpRequest;
+ this._networkUpRequest = null;
+ WinJS.Promise.timeout(5000).then(function () {
+ releaseMeLater.release()
+ })
+ }
+ }, _setMedia: function _setMedia(mediaInstance) {
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data) {
+ var itemData = mediaInstance._mediaItem.data;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setMedia: mediaInstance = { name: " + itemData.name + ", libraryId: " + itemData.libraryId + ", serviceId: " + itemData.serviceId + " }")
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setMedia: mediaInstance._mediaItem.data= undefined");
+ this._clearReportedErrors();
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = false;
+ if (!mediaInstance) {
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ if (this._canResetOnNullMediaInstance)
+ this.reset(true);
+ else
+ this._canResetOnNullMediaInstance = true;
+ return
+ }
+ if (!this._isPlayerSet())
+ return;
+ if (mediaInstance.isEqual(this._internalCurrentMedia))
+ return;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackAttempted(mediaInstance);
+ this.endOfPlaylist = false;
+ if (this._player && ((this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing) || (this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.paused)))
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ this.isPreview = mediaInstance.isPreview;
+ if (mediaInstance.videoAdSupported)
+ this.autoPlay = false;
+ this._handleMediaInstance(mediaInstance)
+ }, _handleMediaInstance: function _handleMediaInstance(mediaInstance) {
+ this._nextMediaInstanceAfterAd = null;
+ this.isAudioAd = false;
+ this._setPlayerMedia(mediaInstance)
+ }, _clearReportedErrors: function _clearReportedErrors() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setPlayerMedia: clear all reported errors");
+ var playbackEventNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackEventNotifications);
+ playbackEventNotifications.clearErrors();
+ this._erroredMediaInstances = [];
+ this._lastErrorEncountered = null;
+ this._hasSameErrors = true;
+ this._hasPlayedSong = false;
+ this._errorCount = 0
+ }, _setPlayerMedia: function _setPlayerMedia(mediaInstance) {
+ MSEPlatform.Playback.Etw.traceSetMedia(mediaInstance);
+ this.reset(true);
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var errorCode = this._isParentallyBlocked(mediaInstance);
+ if (errorCode) {
+ var mediaItem = (mediaInstance._mediaItem ? mediaInstance._mediaItem.data : null);
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), errorCode, "_setMedia_isParentallyBlocked", mediaItem);
+ return
+ }
+ }
+ if (mediaInstance && mediaInstance._errorDescriptor) {
+ var mediaItem = (mediaInstance._mediaItem ? mediaInstance._mediaItem.data : null);
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), mediaInstance._errorDescriptor, "_setMedia_preexistingCondition", mediaItem);
+ return
+ }
+ if (this.autoPlay)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.starting;
+ this._canResetOnNullMediaInstance = !MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation && !MS.Entertainment.Platform.Playback.XPlayer.videoTagForFileActivation;
+ this._player.currentMedia = mediaInstance
+ }, _setNextMedia: function _setNextMedia(mediaInstance) {
+ if (!this._isPlayerSet())
+ return;
+ var name = (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data) ? mediaInstance._mediaItem.data.name : String.empty;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setNextMedia: name= " + name);
+ if (!mediaInstance) {
+ this._player.nextMedia = null;
+ this._player.controlIsProcessingNextMedia = false;
+ this.endOfPlaylist = true;
+ if ((this.autoPlay && !this.activating && (this.currentTransportState !== MSEPlatform.Playback.TransportState.playing && this.currentTransportState !== MSEPlatform.Playback.TransportState.starting)) || (this.currentTransportState === MSEPlatform.Playback.TransportState.starting && this.error))
+ this._handleErrorsOnEndOfPlaylist();
+ return
+ }
+ MS.Entertainment.Utilities.Telemetry.logPlaybackAttempted(mediaInstance);
+ MSEPlatform.Playback.Etw.traceSetNextMedia(this.readyForNextMedia, mediaInstance);
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var errorCode = this._isParentallyBlocked(mediaInstance);
+ if (errorCode) {
+ mediaInstance._errorDescriptor = { msExtendedCode: errorCode.code };
+ this._player.controlIsProcessingNextMedia = false;
+ this._handleNextMediaError(true, null, mediaInstance);
+ return
+ }
+ }
+ if (mediaInstance && mediaInstance._errorDescriptor) {
+ this._player.controlIsProcessingNextMedia = false;
+ this._handleNextMediaError(true, null, mediaInstance);
+ return
+ }
+ this._player.nextMedia = mediaInstance;
+ this._player.controlIsProcessingNextMedia = false
+ }, _isParentallyBlocked: function _isParentallyBlocked(mediaInstance) {
+ var errorCode = null;
+ if (mediaInstance._mediaItem) {
+ var mediaItem = mediaInstance._mediaItem.data;
+ if (mediaItem)
+ if (mediaItem.isExplicit && !mediaItem.inCollection) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!signedInUser.xuid)
+ errorCode = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_LOGON_TO_PLAY_EXPLICIT_CONTENT;
+ else if (!signedInUser.hasExplicitPrivilege)
+ errorCode = MS.Entertainment.Platform.Playback.makeParentallyBlockedError()
+ }
+ }
+ return errorCode
+ }, _onPlayerEvent: function _onPlayerEvent(event) {
+ switch (event.type) {
+ case "loadedmetadata":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata");
+ this.errorDescriptor = null;
+ if (event.srcElement.durationOverrideMS)
+ this.duration = event.srcElement.durationOverrideMS;
+ else if (isFinite(event.srcElement.duration))
+ this.duration = Math.round(event.srcElement.duration * 1000);
+ if (!this._player) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata - player is null");
+ MS.Entertainment.Utilities.fail("loadedmetadata - player is null")
+ }
+ if (!this._player._currentMedia) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata - currentMedia is null");
+ MS.Entertainment.Utilities.fail("loadedmetadata - currentMedia is null")
+ }
+ MSEPlatform.Playback.Etw.traceMediaLoaded(false, this._player._currentMedia, this.duration);
+ if (this._player._currentMedia)
+ this._player._currentMedia.alternateSource = null;
+ this._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.ready);
+ if (this._player && this._player._currentMedia && !this._player._currentMedia.isAudioAd) {
+ if (!this.hasPrerolledMedia()) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata - raising readyForNextMedia");
+ this.readyForNextMedia = true
+ }
+ }
+ else if (this._nextMediaInstanceAfterAd)
+ this._setNextMedia(this._nextMediaInstanceAfterAd);
+ this.videoWidth = event.srcElement.videoWidth;
+ this.videoHeight = event.srcElement.videoHeight;
+ if (this._targetPosition === 0 && this._player && this._player._currentMedia && this._player._currentMedia.startPosition > 0 && !this.isRemoteSession())
+ this._targetPosition = this._player._currentMedia.startPosition;
+ if (this._targetTransportState !== MSEPlatform.Playback.TransportState.unInitialize && this._targetTransportState !== this.currentTransportState)
+ this._applyTargetTransportState(this._targetTransportState);
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata, autoplay=" + this.autoPlay);
+ if (this.autoPlay && this._player) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata: calling xplayer.play(), autoplay=true");
+ this._player.play()
+ }
+ break;
+ case "timeupdate":
+ if (event.srcElement && event.srcElement.currentTime)
+ this.currentPosition = Math.round(event.srcElement.currentTime * 1000);
+ break;
+ case "durationchange":
+ if (event.srcElement.durationOverrideMS)
+ this.duration = event.srcElement.durationOverrideMS;
+ else if (event.srcElement && event.srcElement.duration && isFinite(event.srcElement.duration))
+ this.duration = Math.round(event.srcElement.duration * 1000);
+ break;
+ case "ratechange":
+ this.playbackRate = event.srcElement.playbackRate;
+ break;
+ case "playing":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: Playing");
+ if (MS.Entertainment.Utilities.isVideoApp && this.currentPosition < 1000 && this._targetPosition < 1000) {
+ this.seekToPosition((this._targetPosition > this.currentPosition) ? this._targetPosition : (this.currentPosition + 50));
+ this._targetPosition = 0
+ }
+ else if (this._targetPosition > 0) {
+ this.seekToPosition(this._targetPosition);
+ this._targetPosition = 0
+ }
+ this._targetTransportState = MSEPlatform.Playback.TransportState.playing;
+ this.currentTransportState = MSEPlatform.Playback.TransportState.playing;
+ if (this._player && this._player.currentMedia && this._player.currentMedia.protectionState && (this._player.currentMedia.protectionState === MS.Entertainment.Platform.Playback.ProtectionState.drmProtected)) {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPlayProtectedInApp()
+ }
+ else {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayNonProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPlayNonProtectedInApp()
+ }
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioAppLaunchPlayProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayProtectedInApp();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioAppLaunchPlayNonProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayNonProtectedInApp();
+ this._hasPlayedSong = true;
+ this._errorCount = 0;
+ MS.Entertainment.Utilities.Telemetry.logPlayHappened(this, this.forceTimeUpdate());
+ break;
+ case "pause":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: pause");
+ if (this._targetTransportState === MSEPlatform.Playback.TransportState.stopped)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ else if (this.currentTransportState === MSEPlatform.Playback.TransportState.stopped) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: pause - Current transport state is stopped. Ignoring paused request.");
+ return
+ }
+ else {
+ this._targetTransportState = MSEPlatform.Playback.TransportState.paused;
+ this.currentTransportState = MSEPlatform.Playback.TransportState.paused;
+ MS.Entertainment.Utilities.Telemetry.logPauseHappened(this, this.forceTimeUpdate())
+ }
+ break;
+ case "ended":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: ended");
+ if (event.target.tagName === "VIDEO" && ((this.currentPosition / this.duration) <= 0.25))
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: playback ended at the start of the media. Ignoring ended event");
+ else {
+ if (!this.hasPrerolledMedia() && !this._player.controlIsProcessingNextMedia) {
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ this._targetTransportState = MSEPlatform.Playback.TransportState.stopped;
+ if (this.endOfPlaylist || (this._lastErrorEncountered && this._lastErrorEncountered.isCritical))
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ MS.Entertainment.Utilities.Telemetry.logEndHappened(this, this.duration);
+ this.currentPosition = 0;
+ this._reportPrerollErrors();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService)) {
+ var displayService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService);
+ if (displayService)
+ displayService.showDialogForNonCriticalErrors = false
+ }
+ }
+ break;
+ case "seeked":
+ this._fireSeekedPositionChanged(this.currentPosition);
+ break;
+ case "error":
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayProtectedInApp();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayNonProtectedInApp();
+ this.activating = false;
+ var currentMediaInstance = this._player ? this._player.currentMedia || this._currentMedia : null;
+ if (currentMediaInstance === null || (this.isRemoteSessionRunning && event.target.error.code === MSEPlatform.Playback.MediaTagError.MEDIA_ERR_SRC_NOT_SUPPORTED.code && event.target.error.msExtendedCode !== MSEPlatform.Playback.Error.E_ENHANCED_STORAGE.code)) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: Error to ignore: error: code=" + MSEPlatform.Playback.errorToString(event.target.error.code));
+ break
+ }
+ if (event.target.error.msExtendedCode === MSEPlatform.Playback.Error.MF_E_NO_PMP_HOST.code)
+ break;
+ var name = (currentMediaInstance && currentMediaInstance._mediaItem && currentMediaInstance._mediaItem.data) ? currentMediaInstance._mediaItem.data.name : String.empty;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: error: " + MSEPlatform.Playback.mediaErrorToString(event.target.error) + ", itemName=" + name);
+ if (event.srcElement)
+ event.srcElement.errorCode = event.target.error.code;
+ if (currentMediaInstance && currentMediaInstance.videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264 && event.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_FAIL.code && this._player.retryableError && MS.Entertainment.UI.NetworkStatusService.isOnline()) {
+ currentMediaInstance.startPosition = this.currentPosition + VideoRetrySkipTimeMs;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (currentMediaInstance && MS.Entertainment.UI.NetworkStatusService.isOnline() && event.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_ENHANCED_STORAGE.code) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent error: Received PlayReady decryptor error. Restarting playback from last known position.");
+ currentMediaInstance.startPosition = this.currentPosition;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (currentMediaInstance && currentMediaInstance.alternateVideoEncoding !== null) {
+ currentMediaInstance.videoEncoding = currentMediaInstance.alternateVideoEncoding;
+ currentMediaInstance.alternateVideoEncoding = null;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (currentMediaInstance && currentMediaInstance.alternateSource) {
+ currentMediaInstance.source = currentMediaInstance.alternateSource;
+ currentMediaInstance.alternateSource = null;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (event.srcElement && event.srcElement.fastStartProperties && event.srcElement.error && event.srcElement.error.msExtendedCode === MSEPlatform.Playback.Error.MF_E_DRM_UNSUPPORTED.code) {
+ currentMediaInstance.disableFastStart = true;
+ this._setMedia(currentMediaInstance)
+ }
+ else {
+ var err = event.target.error;
+ err.context = (err.context ? err.context + "; " : String.empty) + "onPlayerEvent: Error from tag";
+ this._handleCurrentMediaError(err)
+ }
+ break
+ }
+ }, _fireSeekedPositionChanged: function _fireSeekedPositionChanged(currentPosition) {
+ this.seekedPosition = currentPosition;
+ this._reschedulePrerollCallback()
+ }, _handleErrorsOnEndOfPlaylist: function _handleErrorsOnEndOfPlaylist() {
+ var displayError = null;
+ if (this._lastErrorEncountered) {
+ var displayError = MS.Entertainment.Platform.Playback.Error.NS_E_WMP_MULTIPLE_ERROR_IN_PLAYLIST;
+ if (this._hasSameErrors)
+ displayError = this._lastErrorEncountered;
+ if (!this._hasPlayedSong)
+ displayError.isCritical = true
+ }
+ var playerStateAsyncAssignment = this._observableNoLossAssignAsyncBegin("playerState");
+ this._player._nextMediaStarted = false;
+ this._player._switchPlayerAsync().done(function setErrorStateOnEnd() {
+ if (displayError) {
+ this.errorDescriptor = displayError;
+ playerStateAsyncAssignment.complete(MS.Entertainment.Platform.Playback.PlayerState.error);
+ this._lastErrorEncountered = null
+ }
+ else
+ playerStateAsyncAssignment.cancel()
+ }.bind(this), function dontcare() { })
+ }, _handleNextMediaLoaded: function _handleNextMediaLoaded(isLoaded, iPlayback) {
+ if (isLoaded) {
+ iPlayback.readyForNextMedia = false;
+ this._releaseNetwork();
+ MSEPlatform.Playback.Etw.traceMediaLoaded(true, iPlayback._player._nextMedia, iPlayback._player._nextPlayer ? iPlayback._player._nextPlayer.duration * 1000 : 0);
+ if (this._skipButtonPressed || (iPlayback.currentMedia && iPlayback.currentMedia._errorDescriptor)) {
+ this._skipButtonPressed = false;
+ iPlayback.skipToNextPrerolled()
+ }
+ }
+ }, _handleNextMediaStarted: function _handleNextMediaStarted(isStarted, iPlayback) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNextMediaStarted: " + isStarted);
+ if (isStarted) {
+ iPlayback._internalCurrentMedia = iPlayback._player._currentMedia;
+ if (!iPlayback._internalCurrentMedia) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNextMediaStarted: currentMedia null");
+ iPlayback.currentMedia = null
+ }
+ if (iPlayback._player._currentMedia && !iPlayback._player._currentMedia.isAudioAd) {
+ iPlayback.currentMedia = iPlayback._player._currentMedia;
+ iPlayback.errorDescriptor = iPlayback._player._currentMedia._errorDescriptor
+ }
+ iPlayback.isAudioAd = iPlayback._player._currentMedia && iPlayback._player._currentMedia.isAudioAd;
+ iPlayback._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.ready);
+ if (iPlayback._player._currentPlayer)
+ iPlayback.duration = Math.round(iPlayback._player._currentPlayer.duration * 1000);
+ if (iPlayback.currentTransportState !== MSEPlatform.Playback.TransportState.playing)
+ iPlayback.currentPosition = 0;
+ if (iPlayback.currentMedia) {
+ MSEPlatform.Playback.Etw.traceNextMediaStarted(iPlayback.currentMedia.source);
+ MS.Entertainment.Utilities.Telemetry.logPlaybackHappened(iPlayback.currentMedia)
+ }
+ this._startProcessingNextMedia()
+ }
+ }, _startProcessingNextMedia: function _startProcessingNextMedia() {
+ if (this._internalCurrentMedia) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNextMediaStarted - raising readyForNextMedia");
+ this._signalForNextMedia()
+ }
+ }, _handleNextMediaError: function _handleNextMediaError(isError, unReferrencedParam, mediaInstance) {
+ if (isError) {
+ var error;
+ if (!mediaInstance)
+ mediaInstance = this._player._nextMedia;
+ if (mediaInstance && mediaInstance.alternateVideoEncoding !== null) {
+ mediaInstance.videoEncoding = mediaInstance.alternateVideoEncoding;
+ mediaInstance.alternateVideoEncoding = null;
+ this._player._setNextMedia(mediaInstance);
+ return
+ }
+ if (mediaInstance) {
+ if (!this._shouldIgnoreThisErrorForBlocking(mediaInstance._errorDescriptor.code))
+ this._addErroredMediaInstance(mediaInstance);
+ error = this.errorDescriptor;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackError(mediaInstance, error, "PlaybackController_handleNextMediaError")
+ }
+ this._player.reset(true);
+ this._reportPrerollErrors();
+ if (!this._isCriticalError(error)) {
+ var that = this;
+ var nowplayingSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ if (nowplayingSession.repeat && this._errorCount > 1)
+ nowplayingSession.mediaCollection.getCount().done(function onGetCount(playlistCount) {
+ if (that._errorCount >= playlistCount) {
+ that.endOfPlaylist = true;
+ that._handleErrorsOnEndOfPlaylist()
+ }
+ else
+ that._signalForNextMedia()
+ }, function onGetCountError(error) {
+ that._signalForNextMedia()
+ });
+ else
+ this._signalForNextMedia()
+ }
+ else if (!this._hasPlayedSong) {
+ this.endOfPlaylist = true;
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ }
+ }, _remapPlaybackError: function _remapPlaybackError(error) {
+ return error
+ }, _handleCurrentMediaError: function _handleCurrentMediaError(error) {
+ error = this._remapPlaybackError(error);
+ if (this.isRemoteSession() && error && error.code === 3)
+ this.errorDescriptor = { msExtendedCode: MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_PLAYTO_ERR_DECODE.code };
+ else {
+ this.errorDescriptor = error;
+ this.errorDescriptor.mediaItem = (this.currentMedia && this.currentMedia._mediaItem) ? this.currentMedia._mediaItem.data : null
+ }
+ if (this._player && this._player.currentMedia) {
+ error.errorOrdinal = this._player.currentMedia.cookie;
+ this._player.currentMedia._errorDescriptor = error
+ }
+ var errorContext = error.context || "PlaybackController_handleCurrentMediaError";
+ MSEPlatform.Playback.Etw.tracePlaybackError(error.code, error.msExtendedCode, errorContext);
+ this._lastErrorEncountered = error;
+ this._addErroredMediaInstance(this._player && this._player.currentMedia);
+ MS.Entertainment.Utilities.Telemetry.logPlaybackError(this.currentMedia, error, errorContext);
+ if (this._isCriticalError(error))
+ this.errorDescriptor.isCritical = true;
+ else
+ this._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.error);
+ if (this.errorDescriptor.isCritical) {
+ MSEPlatform.Playback.AudioPlayer.disposeFastStartTag();
+ this._setNextMedia(null);
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ this._processPlaybackErrorPostMapping(error)
+ }, _processPlaybackErrorPostMapping: function _processPlaybackErrorPostMapping(error) { }, _signalForNextMedia: function _signalForNextMedia() {
+ this._player.controlIsProcessingNextMedia = true;
+ this.readyForNextMedia = false;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::signalForNextMedia requested");
+ if (this._signalForNextMediaPromise) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::signalForNextMedia: cancel previous");
+ this._signalForNextMediaPromise.cancel()
+ }
+ this._signalForNextMediaPromise = WinJS.Promise.timeout(10);
+ this._signalForNextMediaPromise.then(function () {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::signalForNextMedia: raising readyForNextMedia");
+ this.readyForNextMedia = true;
+ this._signalForNextMediaPromise = null
+ }.bind(this))
+ }, _isCriticalError: function _isCriticalError(error) {
+ if (!error)
+ return false;
+ else if (this._errorCount >= this._maxSequentialErrors)
+ return true;
+ switch (error.msExtendedCode) {
+ case MSEPlatform.Playback.Error.X8_E_PLAYBACK_STOPPED_DATA_LIMIT_APPROACHING.code:
+ case MSEPlatform.Playback.Error.E_MDS_ROAMING_LIMIT.code:
+ case MSEPlatform.Playback.Error.ERROR_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED.code:
+ case MSEPlatform.Playback.Error.MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED.code:
+ case MSEPlatform.Playback.Error.MF_E_CANNOT_CREATE_SINK.code:
+ case MSEPlatform.Playback.Error.MF_E_DEBUGGING_NOT_ALLOWED.code:
+ case MSEPlatform.Playback.Error.MF_E_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED.code:
+ case MSEPlatform.Playback.Error.ZEST_E_MW_CONCURRENT_STREAM.code:
+ case MSEPlatform.Playback.Error.ZEST_E_MEDIAINSTANCE_STREAMING_OCCUPIED.code:
+ case MSEPlatform.Playback.Error.ZEST_E_MULTITUNER_CONCURRENTSTREAMING_DETECTED.code:
+ case MSEPlatform.Playback.Error.NS_E_COMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED.code:
+ case MSEPlatform.Playback.Error.NS_E_UNCOMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED.code:
+ case MSEPlatform.Playback.Error.NS_E_DRM_DRIVER_AUTH_FAILURE.code:
+ case MSEPlatform.Playback.Error.NS_E_DRM_NEEDS_INDIVIDUALIZATION.code:
+ case MSEPlatform.Playback.Error.NS_E_DRM_UNABLE_TO_INITIALIZE.code:
+ case MSEPlatform.Playback.Error.NS_E_WMP_AUDIO_HW_PROBLEM.code:
+ case MSEPlatform.Playback.Error.NS_E_WMP_BAD_DRIVER.code:
+ case MSEPlatform.Playback.Error.E_MDS_UNAUTHENTICATED_TRACK_LIMIT.code:
+ return true;
+ default:
+ return false
+ }
+ }, _fireCriticalPlaybackError: function _fireCriticalPlaybackError(error) {
+ var mediaItem = (this.currentMedia && this.currentMedia._mediaItem ? this.currentMedia._mediaItem.data : null);
+ error.isCritical = true;
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), error, "PlaybackController_fireCriticalError", mediaItem);
+ this._errorCount = 0
+ }, _shouldIgnoreThisErrorForBlocking: function _shouldIgnoreThisErrorForBlocking(error) {
+ return ((error === MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_NOT_LOCAL.code) || (error === MS.Entertainment.Platform.Playback.Error.MF_E_NO_PMP_HOST))
+ }, _addErroredMediaInstance: function _addErroredMediaInstance(mediaInstance) {
+ if (!mediaInstance)
+ return;
+ var error = null;
+ var errorCode = null;
+ if (mediaInstance._errorDescriptor) {
+ error = MS.Entertainment.Platform.Playback.makePlaybackError(mediaInstance._errorDescriptor);
+ errorCode = error.msExtendedCode;
+ error.errorOrdinal = mediaInstance.cookie
+ }
+ if (this._hasSameErrors && errorCode && this._lastErrorEncountered && this._lastErrorEncountered.msExtendedCode !== errorCode)
+ this._hasSameErrors = false;
+ this._lastErrorEncountered = error;
+ this._erroredMediaInstances.push(mediaInstance);
+ this._errorCount++;
+ if (this._isCriticalError(error)) {
+ error.isCritical = true;
+ this.errorDescriptor = error
+ }
+ }, _reportPrerollErrors: function _reportPrerollErrors() {
+ var playbackEventNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackEventNotifications);
+ while (this._erroredMediaInstances.length > 0) {
+ var mediaInstance = this._erroredMediaInstances.pop();
+ var mediaItem = null;
+ var errorCode = null;
+ if (mediaInstance) {
+ if (mediaInstance._mediaItem) {
+ mediaItem = mediaInstance._mediaItem.data;
+ if (mediaItem && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaInstance._mediaItem.trackItem)
+ mediaItem = mediaInstance._mediaItem.trackItem.data
+ }
+ if (mediaInstance._errorDescriptor) {
+ var error = MS.Entertainment.Platform.Playback.makePlaybackError(mediaInstance._errorDescriptor);
+ errorCode = error.msExtendedCode
+ }
+ }
+ playbackEventNotifications.setError(MS.Entertainment.Platform.Playback.PlaybackEventNotifications.getEventingMediaId(mediaItem), errorCode)
+ }
+ }, _handleNetworkConnectionChanged: function _handleNetworkConnectionChanged(networkConnection) {
+ switch (networkConnection) {
+ case MS.Entertainment.Platform.NetworkConnection.approachingDataLimit:
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNetworkConnectionChanged: approachingDataLimit");
+ this._pauseStreamingAndFireError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_STOPPED_DATA_LIMIT_APPROACHING);
+ break;
+ case MS.Entertainment.Platform.NetworkConnection.overDataLimit:
+ case MS.Entertainment.Platform.NetworkConnection.switchedToMetered:
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNetworkConnectionChanged: overDataLimit");
+ break
+ }
+ }, _pauseStreamingAndFireError: function _pauseStreamingAndFireError(error) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_pauseStreamingAndFireError");
+ if (!this._isPlayerSet() || this.currentTransportState === MSEPlatform.Playback.TransportState.unInitialize || this.currentTransportState === MSEPlatform.Playback.TransportState.stopped || this.currentTransportState === MSEPlatform.Playback.TransportState.paused)
+ return;
+ if (!this.currentMedia || this.currentMedia.isLocal)
+ return;
+ this._player.pause();
+ this._targetTransportState = MSEPlatform.Playback.TransportState.paused;
+ this._fireCriticalPlaybackError(error)
+ }, _applyTargetTransportState: function _applyTargetTransportState(value) {
+ this._targetTransportState = value;
+ try {
+ switch (value) {
+ case MSEPlatform.Playback.TransportState.stopped:
+ if (this.currentTransportState === MSEPlatform.Playback.TransportState.paused)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ else if (this.currentTransportState !== MSEPlatform.Playback.TransportState.stopped)
+ this._player.stop();
+ break;
+ case MSEPlatform.Playback.TransportState.paused:
+ this._player.pause();
+ if (!this._currentMedia || !this._currentMedia.videoAdSupported)
+ this.autoPlay = false;
+ break;
+ case MSEPlatform.Playback.TransportState.playing:
+ if (this.currentTransportState !== MSEPlatform.Playback.TransportState.paused)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.starting;
+ this._player.play();
+ this.activating = false;
+ if (!this._currentMedia || !this._currentMedia.videoAdSupported)
+ this.autoPlay = true;
+ break;
+ default:
+ throw "PlaybackController_applyTargetTransportState: Error! Unsupported state - " + value;
+ }
+ }
+ catch (exception) {
+ if (this._player._currentPlayer === null)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ else
+ throw exception;
+ }
+ }, currentMedia: MS.Entertainment.UI.Framework.observableProperty("currentMedia", null), currentPosition: MS.Entertainment.UI.Framework.observableProperty("currentPosition", 0), currentTransportState: MS.Entertainment.UI.Framework.observableProperty("currentTransportState", MS.Entertainment.Platform.Playback.TransportState.stopped), isAudioAd: MS.Entertainment.UI.Framework.observableProperty("isAudioAd", false), isPreview: MS.Entertainment.UI.Framework.observableProperty("isPreview", false), duration: MS.Entertainment.UI.Framework.observableProperty("duration", 0), errorDescriptor: MS.Entertainment.UI.Framework.observableProperty("errorDescriptor", null), nextMedia: MS.Entertainment.UI.Framework.observableProperty("nextMedia", null), playerState: MS.Entertainment.UI.Framework.observableProperty("playerState", MS.Entertainment.Platform.Playback.PlayerState.notReady), readyForNextMedia: MS.Entertainment.UI.Framework.observableProperty("readyForNextMedia", false), videoWidth: MS.Entertainment.UI.Framework.observableProperty("videoWidth", 0), videoHeight: MS.Entertainment.UI.Framework.observableProperty("videoHeight", 0), playbackRate: MS.Entertainment.UI.Framework.observableProperty("playbackRate", 1), minPlaybackRate: MS.Entertainment.UI.Framework.observableProperty("minPlaybackRate", -128), maxPlaybackRate: MS.Entertainment.UI.Framework.observableProperty("maxPlaybackRate", 128), _isVideo: MS.Entertainment.UI.Framework.observableProperty("_isVideo", false), seekedPosition: MS.Entertainment.UI.Framework.observableProperty("seekedPosition", 0), isRemoteSessionRunning: MS.Entertainment.UI.Framework.observableProperty("isRemoteSessionRunning", false), playToSenderConnectionState: MS.Entertainment.UI.Framework.observableProperty("playToSenderConnectionState", Windows.Media.PlayTo.PlayToConnectionState.disconnected), mediaElement: MS.Entertainment.UI.Framework.observableProperty("mediaElement", false), error: MS.Entertainment.UI.Framework.observableProperty("error", null), currentRequestedBitrate: MS.Entertainment.UI.Framework.observableProperty("currentRequestedBitrate", null), _configManager: null, _offlineNetworkRequestDelay: 100, _internalCurrentMedia: null, _player: null, _targetTransportState: MSEPlatform.Playback.TransportState.unInitialize, _targetPosition: 0, _sessionMgr: null, _erroredMediaInstances: [], _signalForNextMediaPromise: null, _nextMediaInstanceAfterAd: null, _skipButtonPressed: false, _prerollPromise: null, _prerollPromiseOrdinal: 0, _lastErrorEncountered: null, _hasSameErrors: true, _hasPlayedSong: false, _errorCount: 0, _maxSequentialErrors: 25, _canResetOnNullMediaInstance: true
+ }, {
+ createInstance: function createInstance() {
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ return new MS.Entertainment.Platform.Playback.PlaybackControllerMusic1;
+ else if (MS.Entertainment.Utilities.isMusicApp2)
+ return new MS.Entertainment.Platform.Playback.PlaybackControllerMusic;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ return new MS.Entertainment.Platform.Playback.PlaybackControllerVideo;
+ else if (MS.Entertainment.Utilities.isTestApp || MS.Entertainment.Utilities.isAmsterdamApp)
+ return new MS.Entertainment.Platform.Playback.PlaybackController;
+ else
+ MS.Entertainment.Utilities.fail("PlaybackController.createInstance() Wrong app mode")
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/components/playback/controls/playbackcontrollermusic.js:45177 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ PlaybackControllerMusic: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.PlaybackController", function PlaybackControllerMusic_constructor() {
+ MSEPlatform.Playback.PlaybackController.prototype.constructor.call(this)
+ }, {
+ _remapPlaybackError: function _remapPlaybackError(error) {
+ var remappedError = error;
+ if (MS.Entertainment.Utilities.isApp2 && error && error.msExtendedCode === -2147024891) {
+ remappedError = MS.Entertainment.Platform.Playback.makePlaybackError(MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_HDMI_OUTPUT_LOST.code, "PlaybackController_handleCurrentMediaError");
+ remappedError.isCritical = true
+ }
+ if (error && error.msExtendedCode === MS.Entertainment.Platform.Playback.Error.MF_E_UNAUTHORIZED.code)
+ if (this._currentMedia.isLocal)
+ remappedError = MS.Entertainment.Platform.Playback.makePlaybackError(MS.Entertainment.Platform.Playback.Error.ZEST_E_UNSUPPORTED_DRM_COMPONENT.code, "PlaybackController_handleCurrentMediaError");
+ else
+ remappedError = MS.Entertainment.Platform.Playback.makePlaybackError(MS.Entertainment.Platform.Playback.Error.ZEST_E_UNSUPPORTED_DRM_COMPONENT_STREAM.code, "PlaybackController_handleCurrentMediaError");
+ return remappedError
+ }, _requestNetwork: function _requestNetwork() {
+ var wakeTimeoutMs = 0;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::requestNetwork");
+ if (!this._networkUpRequest) {
+ this._networkUpRequest = this._sessionMgr.requestNetwork("PlaybackControl");
+ wakeTimeoutMs = MS.Entertainment.UI.NetworkStatusService.isOnline() ? 2000 : this._offlineNetworkRequestDelay
+ }
+ return WinJS.Promise.timeout(wakeTimeoutMs)
+ }, _processPlaybackErrorPostMapping: function _processPlaybackErrorPostMapping(error) {
+ if (error.context !== "PlaybackController_fireCriticalError") {
+ if (this.currentMedia) {
+ this.currentMedia._errorDescriptor = this.errorDescriptor;
+ if (!this._shouldIgnoreThisErrorForBlocking(this.currentMedia._errorDescriptor.code))
+ this._addErroredMediaInstance(this.currentMedia)
+ }
+ this._reportPrerollErrors();
+ if (!this._isCriticalError(error))
+ if (this.hasPrerolledMedia())
+ this.skipToNextPrerolled();
+ else if (this._player && !this._player.controlIsProcessingNextMedia)
+ this._signalForNextMedia()
+ }
+ }
+ }, {})
+ })
+ })()
+})();
+/* >>>>>>/components/playback/controls/playbackcontrollermusic1.js:45227 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ PlaybackControllerMusic1: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.PlaybackControllerMusic", function PlaybackControllerMusic1_constructor() {
+ MSEPlatform.Playback.PlaybackControllerMusic.prototype.constructor.call(this)
+ }, {
+ _handleMediaInstance: function _handleMediaInstance(mediaInstance) {
+ this._getAudioAd(mediaInstance, false).then(function onGotAd(mediaInstanceAd) {
+ if (mediaInstanceAd) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleMediaInstance - play audio ad");
+ this._nextMediaInstanceAfterAd = mediaInstance;
+ mediaInstance = mediaInstanceAd;
+ this.isAudioAd = true
+ }
+ else {
+ this._nextMediaInstanceAfterAd = null;
+ this.isAudioAd = false
+ }
+ this._setPlayerMedia(mediaInstance)
+ }.bind(this))
+ }, _getAudioAd: function _getAudioAd(mediaInstance, isNextMediaInstance) {
+ if (!mediaInstance || mediaInstance.isLocal)
+ return WinJS.Promise.wrap(null);
+ if (this.isRemoteSession())
+ return WinJS.Promise.wrap(null);
+ var adService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ return adService.isAudioAdRequired(mediaInstance, isNextMediaInstance).then(function onGotAd(item) {
+ if (item) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_getAudioAd: audio ad required");
+ var mediaItem = { data: item };
+ var itemData = {
+ source: mediaItem.data.source, isLocal: false, mediaInstanceId: null, nativeLicenseRight: null, offerId: null, cookie: 0, mediaItem: mediaItem, mediaType: Microsoft.Entertainment.Queries.ObjectType.track, protectionState: MS.Entertainment.Platform.Playback.ProtectionState.unprotected, startPosition: 0, isAudioAd: true, inCollection: mediaItem.data.inCollection, fromCollection: mediaItem.data.fromCollection, duration: mediaItem.data.duration, serviceId: mediaItem.data.serviceId
+ };
+ return MSEPlatform.Playback.MediaInstance.createInstanceAsync(itemData)
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_getAudioAd: no audio ad required");
+ return WinJS.Promise.wrap(null)
+ }
+ }.bind(this), function onFail(error) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_getAudioAd: isAudioAdRequired failed with error: " + error);
+ return WinJS.Promise.wrap(null)
+ })
+ }, _startProcessingNextMedia: function _startProcessingNextMedia() {
+ if (this._internalCurrentMedia)
+ this._getAudioAd(this._player._currentMedia, true).then(function onGotAd(mediaInstanceAd) {
+ if (!mediaInstanceAd) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_startProcessingNextMedia - raising readyForNextMedia");
+ this._signalForNextMedia()
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_startProcessingNextMedia - play audio ad as a next media");
+ this._setNextMedia(mediaInstanceAd)
+ }
+ }.bind(this))
+ }
+ }, {})
+ })
+ })()
+})();
+/* >>>>>>/components/playback/controls/playbackcontrol.js:45292 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+ (function () {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ PlaybackControl: MS.Entertainment.UI.Framework.defineUserControl("/Components/Playback/Controls/PlaybackControl.html#playbackControlTemplate", function PlaybackControl_constructor(element, options) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackControl::Constructor: ")
+ }, {
+ initialize: function PlaybackControl_initialize() {
+ MS.Entertainment.Platform.Playback.Etw.traceString("PlaybackControl::initialize");
+ this._iPlayback = new MS.Entertainment.Platform.Playback.PlaybackController.createInstance;
+ this._player = MS.Entertainment.Platform.Playback.XPlayer.createInstance(this._playerContainer);
+ if (this._iPlayback === null || this._player === null)
+ throw "PlaybackControl_initialize: Error! failed to create XPlayer";
+ this._iPlayback.setPlayer(this._player);
+ this.controlInitialized = true;
+ MSEPlatform.Playback.Etw.traceControlInitialized();
+ this.dispatchEvent("onControlInitialized", { sender: this })
+ }, dispose: function PlaybackControl_dispose() {
+ this.release()
+ }, release: function release() {
+ if (this._iPlayback) {
+ this._iPlayback.dispose();
+ this._iPlayback = null;
+ this._player.dispose();
+ this._player = null
+ }
+ }, getPlaybackInterface: function PlaybackControl_getPlaybackInterface() {
+ if (this._iPlayback === null)
+ throw "PlaybackControl_getPlaybackInterface: Error! iPlayback is null";
+ return this._iPlayback
+ }, getClosedCaptionsContainer: function PlaybackControl_getClosedCaptionsContainer() {
+ return this._closedCaptionsContainer
+ }, getVideoNetstatsContainer: function PlaybackControl_getVideoNetstatsContainer() {
+ return this._videoNetstatsContainer
+ }, isVideoAdSupported: {
+ get: function () {
+ var iPlayback;
+ try {
+ iPlayback = this.getPlaybackInterface()
+ }
+ catch (e) {
+ return false
+ }
+ if (iPlayback._currentMedia)
+ return iPlayback._currentMedia.videoAdSupported;
+ else
+ return false
+ }
+ }, _iPlayback: null, _player: null, _playerContainer: null, _closedCaptionsContainer: null, _videoNetstatsContainer: null
+ }, { controlInitialized: false })
+ })
+ })()
+})();
+/* >>>>>>/controls/transportcontrols/transportcontrols.js:45346 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ TransportControls: MS.Entertainment.UI.Framework.defineUserControl("/Controls/TransportControls/TransportControls.html#transportControlsTemplate", function (element, options) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService)) {
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this._volumeControllerService = volumeControllerService;
+ this._volumeStateBinds = WinJS.Binding.bind(volumeControllerService, {
+ volume: this._onVolumeValueChange.bind(this), mute: this._onMuteStateChange.bind(this), isAudioEndpointAvailable: this._onAudioEndpointChange.bind(this)
+ })
+ }
+ }, {
+ _initialized: false, _messageTimeout: null, _sessionMgr: null, _uiStateService: null, _bindings: null, _eventHandlers: null, _deferredUpdateTimer: null, _isNowPlayingControls: false, _appBarPlaybackOptionsMenu: null, playbackOptionsActions: null, _volumeStateBinds: null, focusPlayOnInitialize: false, _playToStateBinds: null, _volumeControllerService: null, initialize: function initialize() {
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var localShuffleAction = new MS.Entertainment.UI.ToolbarAction;
+ localShuffleAction.id = "appBarTransportControlsShuffle";
+ localShuffleAction.automationId = MS.Entertainment.UI.AutomationIds.transportShuffle;
+ localShuffleAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON);
+ localShuffleAction.icon = MS.Entertainment.UI.Icon.shuffleOn;
+ localShuffleAction.executed = function shuffleExecuted() {
+ this.shuffleButtonClick()
+ }.bind(this);
+ localShuffleAction.isPlaybackOption = true;
+ localShuffleAction.forceTitleChange = true;
+ localShuffleAction.addProperty("isVisible", false);
+ localShuffleAction.ariaLabelOverride = String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON);
+ localShuffleAction.enableAriaPressedOverride = true;
+ localShuffleAction.addProperty("ariaPressed", false);
+ localShuffleAction.isToggleAction = true;
+ this._shuffleAction = localShuffleAction;
+ var localRepeatAction = new MS.Entertainment.UI.ToolbarAction;
+ localRepeatAction.id = "appBarTransportControlsRepeat";
+ localRepeatAction.automationId = MS.Entertainment.UI.AutomationIds.transportRepeat;
+ localRepeatAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON);
+ localRepeatAction.icon = WinJS.UI.AppBarIcon.refresh;
+ localRepeatAction.executed = function repeatExecuted() {
+ this.repeatButtonClick()
+ }.bind(this);
+ localRepeatAction.isPlaybackOption = true;
+ localRepeatAction.forceTitleChange = true;
+ localRepeatAction.addProperty("isVisible", true);
+ localRepeatAction.ariaLabelOverride = String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON);
+ localRepeatAction.enableAriaPressedOverride = true;
+ localRepeatAction.addProperty("ariaPressed", false);
+ localRepeatAction.isToggleAction = true;
+ this._repeatAction = localRepeatAction;
+ var localSkipBackAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipBackAction.id = "appBarTransportControlsPrevious";
+ localSkipBackAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipBack;
+ localSkipBackAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON);
+ localSkipBackAction.icon = MS.Entertainment.UI.Icon.previous;
+ localSkipBackAction.executed = function skipBackExecuted() {
+ this.skipBackButtonClick()
+ }.bind(this);
+ localSkipBackAction.canExecute = function skipBackCanExecute(parameter) {
+ return !this.isDisabled && !this.skipBackDisabled
+ }.bind(this);
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ localSkipBackAction.voicePhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_PREVIOUS_SONG_VUI_ALM);
+ localSkipBackAction.voicePhoneticPhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_PREVIOUS_SONG_VUI_PRON);
+ localSkipBackAction.voiceConfidence = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_PREVIOUS_SONG_VUI_CONF)
+ }
+ this._skipBackAction = localSkipBackAction;
+ var localSkipBackHoldAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipBackHoldAction.id = "appBarTransportControlsPreviousHold";
+ localSkipBackHoldAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipBackHold;
+ localSkipBackHoldAction.canExecute = function skipBackHoldCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ localSkipBackHoldAction.executed = this.skipBackButtonHold.bind(this);
+ this._skipBackHoldAction = localSkipBackHoldAction;
+ var localPlayAction = new MS.Entertainment.UI.ToolbarAction;
+ localPlayAction.id = "appBarTransportControlsPlay";
+ localPlayAction.automationId = MS.Entertainment.UI.AutomationIds.transportPlay;
+ localPlayAction.title = String.load(MS.Entertainment.UI.Controls.TransportControls.playButtonStringId);
+ localPlayAction.icon = MS.Entertainment.UI.Icon.play;
+ localPlayAction.executed = function playExecuted() {
+ this.playPauseButtonClick()
+ }.bind(this);
+ localPlayAction.canExecute = function playCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ this._playAction = localPlayAction;
+ var localPauseAction = new MS.Entertainment.UI.ToolbarAction;
+ localPauseAction.id = "appBarTransportControlsPause";
+ localPauseAction.automationId = MS.Entertainment.UI.AutomationIds.transportPause;
+ localPauseAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON);
+ localPauseAction.icon = WinJS.UI.AppBarIcon.pause;
+ localPauseAction.executed = function pauseExecuted() {
+ this.pauseButtonClick()
+ }.bind(this);
+ localPauseAction.canExecute = function pauseCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ this._pauseAction = localPauseAction;
+ this._playPauseAction = this._playAction;
+ if (this._playPauseButton)
+ this.bind("playVisible", function _updatePlayPause() {
+ var voicePhraseStringId;
+ var voicePhoneticPhraseStringId;
+ var voiceConfidenceStringId;
+ if (this.playVisible) {
+ this._playPauseAction = this._playAction;
+ this._playPauseButton.text = this._playAction.title;
+ voicePhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PLAY_VUI_ALM;
+ voicePhoneticPhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PLAY_VUI_PRON;
+ voiceConfidenceStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PLAY_VUI_CONF
+ }
+ else {
+ this._playPauseAction = this._pauseAction;
+ this._playPauseButton.text = this._pauseAction.title;
+ voicePhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PAUSE_VUI_ALM;
+ voicePhoneticPhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PAUSE_VUI_PRON;
+ voiceConfidenceStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PAUSE_VUI_CONF
+ }
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this._playPauseAction.voicePhrase = String.load(voicePhraseStringId);
+ this._playPauseAction.voicePhoneticPhrase = String.load(voicePhoneticPhraseStringId);
+ this._playPauseAction.voiceConfidence = String.load(voiceConfidenceStringId);
+ XboxJS.UI.Voice.refreshVoiceElements()
+ }
+ }.bind(this));
+ var localSkipForwardAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipForwardAction.id = "appBarTransportControlsForward";
+ localSkipForwardAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipForward;
+ localSkipForwardAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_NEXT_BUTTON);
+ localSkipForwardAction.icon = MS.Entertainment.UI.Icon.next;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ localSkipForwardAction.voicePhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_NEXT_SONG_VUI_ALM);
+ localSkipForwardAction.voicePhoneticPhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_NEXT_SONG_VUI_PRON);
+ localSkipForwardAction.voiceConfidence = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_NEXT_SONG_VUI_CONF);
+ WinJS.Promise.timeout().then(function () {
+ XboxJS.UI.Voice.refreshVoiceElements()
+ })
+ }
+ localSkipForwardAction.executed = function skipForwardExecuted() {
+ this.skipForwardButtonClick()
+ }.bind(this);
+ localSkipForwardAction.canExecute = function skipForwardCanExecute(parameter) {
+ return !this.isDisabled && !this.skipForwardDisabled
+ }.bind(this);
+ this._skipForwardAction = localSkipForwardAction;
+ var localSkipForwardHoldAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipForwardHoldAction.id = "appBarTransportControlsForwardHold";
+ localSkipForwardHoldAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipForwardHold;
+ localSkipForwardHoldAction.canExecute = function skipForwardHoldCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ localSkipForwardHoldAction.executed = this.skipForwardButtonHold.bind(this);
+ this._skipForwardHoldAction = localSkipForwardHoldAction;
+ this._initializeVolumeAction();
+ var localSmartGlassAction = new MS.Entertainment.UI.ToolbarAction;
+ localSmartGlassAction.id = "appBarTransportControlsSmartGlass";
+ localSmartGlassAction.automationId = MS.Entertainment.UI.AutomationIds.transportSmartGlass;
+ localSmartGlassAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON);
+ localSmartGlassAction.icon = MS.Entertainment.UI.Icon.game;
+ localSmartGlassAction.executed = function SmartGlassExecuted() {
+ this.smartGlassButtonClick()
+ }.bind(this);
+ localSmartGlassAction.canExecute = function SmartGlassCanExecute(parameter) {
+ return !this.smartGlassDisabled
+ }.bind(this);
+ this._smartGlassAction = localSmartGlassAction;
+ var localXboxAction = new MS.Entertainment.UI.ToolbarAction;
+ localXboxAction.id = "appBarTransportControlsXbox";
+ localXboxAction.automationId = MS.Entertainment.UI.AutomationIds.transportXbox;
+ localXboxAction.icon = MS.Entertainment.UI.Icon.takeFromXbox;
+ localXboxAction.adornerRing = MS.Entertainment.UI.Icon.takeFromXboxAdornerAppbar;
+ localXboxAction.adornerMode = MS.Entertainment.UI.Controls.IconButtonMode.Custom;
+ localXboxAction.hideDefaultRing = true;
+ localXboxAction.executed = function XboxExecuted() {
+ this.xboxButtonClick()
+ }.bind(this);
+ localXboxAction.canExecute = function XboxCanExecute(parameter) {
+ return !this.xboxDisabled
+ }.bind(this);
+ this._xboxAction = localXboxAction;
+ var localClosedCaptionAction = new MS.Entertainment.UI.ToolbarAction;
+ localClosedCaptionAction.id = "playbackOptionsClosedCaption";
+ localClosedCaptionAction.automationId = MS.Entertainment.UI.AutomationIds.transportClosedCaption;
+ localClosedCaptionAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL);
+ localClosedCaptionAction.icon = MS.Entertainment.UI.Icon.closedCaption;
+ localClosedCaptionAction.isComboPlaybackOption = true;
+ localClosedCaptionAction.addProperty("isComboBoxEnabled", false);
+ localClosedCaptionAction.addProperty("availableLanguages", []);
+ localClosedCaptionAction.addProperty("selectedIndex", 0);
+ localClosedCaptionAction.addProperty("isVisible", false);
+ localClosedCaptionAction.currentPlayingMediaInstance = 0;
+ this._closedCaptionAction = localClosedCaptionAction;
+ if (!this._isNowPlayingControls) {
+ this.playbackOptionsActions = [];
+ this.playbackOptionsActions.unshift({ action: this._closedCaptionAction });
+ this.playbackOptionsActions.unshift({ action: this._repeatAction });
+ this.playbackOptionsActions.unshift({ action: this._shuffleAction });
+ this._createPlaybackOptionsMenu()
+ }
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this._initialized = true;
+ this._updateStates();
+ if (this.focusPlayOnInitialize && this._playPauseButton) {
+ var playPauseIconButton = this._playPauseButton.domElement.querySelector(".iconButton");
+ if (playPauseIconButton)
+ MS.Entertainment.UI.Framework.focusElement(playPauseIconButton);
+ else
+ MS.Entertainment.UI.Controls.fail("Expected an iconButton child beneath playPause control")
+ }
+ }, _initializeVolumeAction: function _initializeVolumeAction() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService))
+ return;
+ var localVolumeAction = new MS.Entertainment.UI.ToolbarAction;
+ localVolumeAction.id = "appBarTransportControlsVolume";
+ localVolumeAction.automationId = MS.Entertainment.UI.AutomationIds.transportVolume;
+ if (this._volumeControllerService.isAudioEndpointAvailable) {
+ if (this._volumeControllerService.mute) {
+ localVolumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON);
+ localVolumeAction.icon = WinJS.UI.AppBarIcon.mute
+ }
+ else {
+ var formattedValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(Math.round(this._volumeControllerService.volume * 100));
+ localVolumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON).format(formattedValue);
+ localVolumeAction.icon = WinJS.UI.AppBarIcon.volume
+ }
+ localVolumeAction.canExecute = function volumeActionCanExecute(parameter) {
+ if (this.playbackSession && this.playbackSession.isRemoteSessionRunning) {
+ this.volumeDisabled = true;
+ return false
+ }
+ else {
+ this.volumeDisabled = false;
+ return true
+ }
+ }.bind(this);
+ localVolumeAction.executed = function volumeButtonExecuted() {
+ this.volumeButtonClick()
+ }.bind(this)
+ }
+ else {
+ localVolumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON);
+ localVolumeAction.icon = MS.Entertainment.UI.Icon.volumeDisabled;
+ localVolumeAction.canExecute = function volumeActionCanExecute(parameter) {
+ return false
+ }
+ }
+ this._volumeAction = localVolumeAction;
+ var localVolumeHoldAction = new MS.Entertainment.UI.ToolbarAction;
+ localVolumeHoldAction.id = "appBarTransportControlsVolumeHold";
+ localVolumeHoldAction.automationId = MS.Entertainment.UI.AutomationIds.transportVolumeHold;
+ localVolumeHoldAction.canExecute = function volumeHoldCanExecute(parameter) {
+ return true
+ };
+ localVolumeHoldAction.executed = this.volumeButtonHold.bind(this);
+ this._volumeHoldAction = localVolumeHoldAction
+ }, _onVolumeValueChange: function volumeValueChange(newValue) {
+ var volumeValue = Math.round(newValue * 100);
+ if (this._volumeAction && this._volumeControllerService.isAudioEndpointAvailable)
+ this._updateTitleOnVolumeButton(volumeValue)
+ }, _onMuteStateChange: function muteStateChange(newState) {
+ var muteState = newState;
+ if (this._volumeAction && this._volumeButton && this._volumeControllerService.isAudioEndpointAvailable)
+ if (muteState) {
+ this._volumeButton.icon = WinJS.UI.AppBarIcon.mute;
+ this._volumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON)
+ }
+ else {
+ this._volumeButton.icon = WinJS.UI.AppBarIcon.volume;
+ var volumeValue = Math.round(this._volumeControllerService.volume * 100);
+ this._updateTitleOnVolumeButton(volumeValue)
+ }
+ }, _playToStateChanged: function _playToStateChanged() {
+ if (this._volumeAction)
+ this._volumeAction.requeryCanExecute();
+ if (this._closedCaptionAction)
+ this._handleCCVisibility()
+ }, _handleCCVisibility: function _handleCCVisibility() {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.nowPlayingSession;
+ var isPlayToSessionRunning = playbackSession.isRemoteSessionRunning;
+ if (isPlayToSessionRunning) {
+ this._ccSavedState = this._closedCaptionAction.isComboBoxEnabled;
+ this._closedCaptionAction.isComboBoxEnabled = false
+ }
+ else
+ this._closedCaptionAction.isComboBoxEnabled = this._ccSavedState
+ }, _onAudioEndpointChange: function audioEndpointChange(newState) {
+ this._initializeVolumeAction()
+ }, _updateTitleOnVolumeButton: function updateTitleOnVolumeButton(volumeValue) {
+ var formattedValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(volumeValue);
+ this._volumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON).format(formattedValue)
+ }, isVolumeServiceRequired: {
+ get: function () {
+ return (MS.Entertainment.Utilities.isApp1)
+ }
+ }, showMessage: function showMessage(messageTitle, messageText, showDuration, showAppBar) {
+ this.messageVisible = true;
+ this.messageTitle = messageTitle;
+ this.messageSubTitle = messageText;
+ if (this._messageTimeout) {
+ this._messageTimeout.cancel();
+ this._messageTimeout = null
+ }
+ if (showAppBar) {
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.show)
+ appBar.show()
+ }
+ if (showDuration)
+ this._messageTimeout = WinJS.Promise.timeout(showDuration).then(function _delay() {
+ this.clearMessage()
+ }.bind(this))
+ }, clearMessage: function clearMessage() {
+ this.messageVisible = false;
+ this.messageTitle = "";
+ this.messageSubTitle = ""
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ }, unload: function unload() {
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ if (this._volumeStateBinds) {
+ this._volumeStateBinds.cancel();
+ this._volumeStateBinds = null
+ }
+ this._detachBindings();
+ this.unbind("playbackSession");
+ this.unbind("volumeAction");
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _createPlaybackOptionsMenu: function _createPlaybackOptionsMenu() {
+ var container = document.createElement("div");
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.PlaybackOptionsList");
+ this._appBarPlaybackOptionsMenu = new MS.Entertainment.UI.Controls.PlaybackOptionsList(this._playbackOptionsContainer.appendChild(container), { _overflowTitleOverride: String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON) });
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.ActionList");
+ this.bind("playbackOptionsActions", function _updateActions() {
+ this._appBarPlaybackOptionsMenu.items = this.playbackOptionsActions
+ }.bind(this));
+ this._appBarPlaybackOptionsMenu.containerWidth = 100;
+ this._appBarPlaybackOptionsMenu._maxItems = 1;
+ if (this._appBarPlaybackOptionsMenu._getOverflowAction().action)
+ this._appBarPlaybackOptionsMenu._getOverflowAction().action.executed = this._appBarPlaybackOptionsMenu.executeActionUpdateCombo
+ }, updatePlaybackOptionsActionSet: function updatePlaybackOptionsActionSet() {
+ if (this._appBarPlaybackOptionsMenu)
+ this._appBarPlaybackOptionsMenu.updateActionSets()
+ }, _applyBindings: function _applyBindings() {
+ if (this._unloaded)
+ return;
+ this._detachBindings();
+ var mediaStateChanged = this._mediaStateChanged.bind(this);
+ var updateStates = this._updateStates.bind(this);
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.playbackSession, {
+ currentTitleIdChanged: mediaStateChanged, playerStateChanged: this._playerStateChanged.bind(this), currentMediaChanged: mediaStateChanged, currentTransportStateChanged: mediaStateChanged, shuffleChanged: mediaStateChanged, repeatChanged: mediaStateChanged, canSkipBackwardChanged: mediaStateChanged, canSkipForwardChanged: mediaStateChanged, playbackRateChanged: mediaStateChanged, canControlMediaChanged: mediaStateChanged
+ });
+ this._playerStateChanged();
+ this._bindings = WinJS.Binding.bind(this, {
+ _uiStateService: {
+ primarySessionId: mediaStateChanged, isSnapped: updateStates, nowPlayingTileVisible: updateStates
+ }, playbackSession: { isRemoteSessionRunning: this._playToStateChanged.bind(this) }
+ })
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ if (this._unloaded)
+ return;
+ if (this.playbackSession)
+ this._applyBindings();
+ this._mediaStateChanged()
+ }, _playerStateChanged: function _playerStateChanged(e) {
+ this._updateStates()
+ }, _mediaStateChanged: function _mediaStateChanged(e) {
+ this._updateStates()
+ }, _updateStates: function _updateStates() {
+ if (this._deferredUpdateTimer)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ }, _updateStatesDeferred: function _updateStatesDeferred() {
+ this._deferredUpdateTimer = null;
+ if (this._unloaded)
+ return;
+ if (this._initialized && this.playbackSession) {
+ var isPlaylist = MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia);
+ var showNowPlayingSkipAndVolumeButtons = this.playbackSession.currentMedia && (this.playbackSession === this._sessionMgr.nowPlayingSession && !MS.Entertainment.Platform.PlaybackHelpers.isVideo(this.playbackSession.currentMedia));
+ this.nowPlayingSkipBackVisible = showNowPlayingSkipAndVolumeButtons;
+ this.nowPlayingSkipForwardVisible = showNowPlayingSkipAndVolumeButtons;
+ this.nowPlayingVolumeVisible = (this.isVolumeServiceRequired && showNowPlayingSkipAndVolumeButtons);
+ var localPlayToXboxFeatureEnabled = MS.Entertainment.Platform.PlaybackHelpers.isPlayToXboxFeatureEnabled(this.playbackSession.currentMedia);
+ if (!this.playbackSession.currentMedia) {
+ this.isDisabled = true;
+ this.playVisible = true;
+ this.skipBackDisabled = true;
+ this.skipForwardDisabled = true;
+ this.playbackLabelId = MS.Entertainment.UI.Controls.TransportControls.playButtonStringId
+ }
+ else {
+ if (this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.unInitialize || this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.paused || this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped || this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.buffering || (this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.playing && this.playbackSession.playbackRate !== 1) || this.playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ this.playVisible = true;
+ this.playbackLabelId = MS.Entertainment.UI.Controls.TransportControls.playButtonStringId
+ }
+ else {
+ this.playVisible = false;
+ this.playbackLabelId = String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON
+ }
+ if (this.playbackSession.targetTransportState !== MS.Entertainment.Platform.Playback.TransportState.unInitialize && this.playbackSession.targetTransportState !== this.playbackSession.currentTransportState && this.playbackSession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.starting && this.playbackSession.playerState !== MS.Entertainment.Platform.Playback.PlayerState.error)
+ this.isDisabled = true;
+ else
+ this.isDisabled = !this.playbackSession.canControlMedia;
+ this.skipBackDisabled = this.isDisabled || (!this.playbackSession.canSkipBackward && isPlaylist);
+ this.skipForwardDisabled = this.isDisabled || (!this.playbackSession.canSkipForward && isPlaylist);
+ var skipNextIconButton = this._skipNextButton.domElement.querySelector(".iconButton");
+ if (this.skipForwardDisabled && this._playPauseButton && this._playPauseButton.domElement && skipNextIconButton === document.activeElement) {
+ var playPauseIconButton = this._playPauseButton.domElement.querySelector(".iconButton");
+ if (playPauseIconButton)
+ MS.Entertainment.UI.Framework.focusElement(playPauseIconButton);
+ else
+ MS.Entertainment.UI.Controls.fail("Expected an iconButton child beneath playPause control")
+ }
+ var currentPlayingMediaInstance = -1;
+ if (this.playbackSession._iPlayback && this.playbackSession._iPlayback.currentMedia && this.playbackSession._iPlayback.currentMedia.mediaInstanceId)
+ currentPlayingMediaInstance = this.playbackSession._iPlayback.currentMedia.mediaInstanceId;
+ if (!this._isNowPlayingControls && this._closedCaptionAction && this._closedCaptionAction.currentPlayingMediaInstance !== currentPlayingMediaInstance) {
+ this._closedCaptionAction.currentPlayingMediaInstance = currentPlayingMediaInstance;
+ this._closedCaptionAction.availableLanguages = [];
+ this._closedCaptionAction.isComboBoxEnabled = false;
+ if (this.playbackSession.currentMedia.closedCaptionFiles) {
+ var numTotalCaptionFiles = this.playbackSession.currentMedia.closedCaptionFiles.length;
+ var addOffLanguageOption = true;
+ var that = this;
+ this.playbackSession.currentMedia.closedCaptionFiles.forEach(function extractCaptionFiles(file) {
+ var ccFileMediaInstanceID = ("{" + file.mediaInstanceId + "}").toUpperCase();
+ if (ccFileMediaInstanceID === currentPlayingMediaInstance) {
+ if (addOffLanguageOption) {
+ that._closedCaptionAction.availableLanguages.push({
+ name: "Off", lcid: 0
+ });
+ addOffLanguageOption = false
+ }
+ var foundLcid = false;
+ for (var i = 0; i < that._closedCaptionAction.availableLanguages.length; i++)
+ if (that._closedCaptionAction.availableLanguages[i].lcid === file.lcid) {
+ foundLcid = true;
+ break
+ }
+ if (!foundLcid)
+ that._closedCaptionAction.availableLanguages.push(file)
+ }
+ });
+ this._closedCaptionAction.isComboBoxEnabled = this._closedCaptionAction.availableLanguages.length > 0 ? true : false;
+ var turnCaptionsOff = true;
+ if (this._closedCaptionAction.isComboBoxEnabled) {
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ var foundPreferredLanguage = false;
+ var englishLcidIndex = 0;
+ var ENGLISH_LCID = "1033";
+ if (settingsStorage.values["preferredCaptionLanguage"]) {
+ for (var i = 0; i < this._closedCaptionAction.availableLanguages.length; i++) {
+ if (!foundPreferredLanguage && this._closedCaptionAction.availableLanguages[i].lcid === settingsStorage.values["preferredCaptionLanguage"]) {
+ this.playbackSession.ccLcid = settingsStorage.values["preferredCaptionLanguage"];
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(true);
+ foundPreferredLanguage = true;
+ turnCaptionsOff = false
+ }
+ if (!englishLcidIndex && this._closedCaptionAction.availableLanguages[i].lcid === ENGLISH_LCID)
+ englishLcidIndex = i
+ }
+ if (!foundPreferredLanguage && englishLcidIndex) {
+ this.playbackSession.ccLcid = ENGLISH_LCID;
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(true);
+ turnCaptionsOff = false
+ }
+ }
+ }
+ if (turnCaptionsOff)
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(false)
+ }
+ }
+ }
+ this.dlnaTransferAvailable = ((this.playbackSession.currentMedia && !this.playbackSession.currentMedia.hasServiceId) || (this.playbackSession.currentMedia && MS.Entertainment.Utilities.isMusicApp));
+ if (this._sessionMgr.primarySession.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.remoteLRC)
+ this._xboxAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON);
+ else if (this.dlnaTransferAvailable || MS.Entertainment.Utilities.isMusicApp)
+ this._xboxAction.title = String.load(String.id.IDS_XBOX_PLAY_TO_DEVICE);
+ else
+ this._xboxAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON)
+ }
+ this.anyTransferAvailable = this.dlnaTransferAvailable;
+ this.xboxDisabled = (!this.anyTransferAvailable || this.isDisabled);
+ this.xboxVisible = MS.Entertainment.Platform.PlaybackHelpers.isXboxConsoleAvailableInRegion() && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped && !MS.Entertainment.Utilities.isMusicApp && !Windows.UI.ViewManagement.ViewSizePreference;
+ this.smartGlassDisabled = true;
+ this.smartGlassVisible = false;
+ this.volumeVisible = (this.isVolumeServiceRequired && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped);
+ this._updateIcons();
+ if (this._appBarPlaybackOptionsMenu && this._appBarPlaybackOptionsMenu._getOverflowAction().action) {
+ this._appBarPlaybackOptionsMenu._getOverflowAction().action.isEnabled = !this.isDisabled;
+ WinJS.Utilities.removeClass(this._playbackOptionsContainer, "removeFromDisplay")
+ }
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ if (this._appBarPlaybackOptionsMenu && this._appBarPlaybackOptionsMenu._getOverflowAction().action)
+ WinJS.Utilities.addClass(this._playbackOptionsContainer, "removeFromDisplay");
+ this._closedCaptionAction.isVisible = false;
+ this._shuffleAction.isVisible = false;
+ this._repeatAction.isVisible = false
+ }
+ else {
+ this._repeatAction.isVisible = true;
+ this._shuffleAction.isVisible = MS.Entertainment.Utilities.isMusicApp;
+ if (this._shuffleAction.isVisible)
+ this._updateShuffleButton();
+ if (this._repeatAction.isVisible)
+ this._updateRepeatButton();
+ this._closedCaptionAction.isVisible = MS.Entertainment.Platform.PlaybackHelpers.isClosedCaptionFeatureEnabled()
+ }
+ if (this._initialized) {
+ this._playAction.requeryCanExecute();
+ this._pauseAction.requeryCanExecute();
+ this._skipBackAction.requeryCanExecute();
+ this._skipForwardAction.requeryCanExecute();
+ this._xboxAction.requeryCanExecute();
+ this._smartGlassAction.requeryCanExecute();
+ if (this._volumeAction)
+ this._volumeAction.requeryCanExecute()
+ }
+ }, _updateIcons: function _updateIcons() {
+ if (this._xboxAction) {
+ if (this.dlnaTransferAvailable) {
+ this._xboxAction.icon = MS.Entertainment.UI.Icon.sendToXbox;
+ this._xboxAction.adornerRing = MS.Entertainment.UI.Icon.sendToXboxAdornerAppbar;
+ this._xboxAction.title = String.load(String.id.IDS_XBOX_PLAY_TO_DEVICE)
+ }
+ else {
+ this._xboxAction.icon = MS.Entertainment.UI.Icon.sendToXbox;
+ this._xboxAction.adornerRing = MS.Entertainment.UI.Icon.sendToXboxAdornerAppbar;
+ this._xboxAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON)
+ }
+ if (this._xboxButton)
+ this._xboxButton._updateAction()
+ }
+ }, xboxButtonClick: function xboxButtonClick() {
+ if (!this.visibility || !this.playbackSession)
+ return;
+ if (this.xboxTransferAvailable) {
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ MS.Entertainment.Platform.PlaybackHelpers.playToXbox(this.playbackSession.currentMedia, null, Math.round(this.playbackSession.currentPosition))
+ }
+ else
+ try {
+ Windows.Media.PlayTo.PlayToManager.showPlayToUI()
+ }
+ catch (ex) {
+ MS.Entertainment.UI.Debug.writeLine("Failed to show devices charm (may be disabled?): " + ex)
+ }
+ }, smartGlassButtonClick: function smartGlassButtonClick() {
+ if (!this.visibility || !this.playbackSession)
+ return;
+ this.smartGlassActive = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.xboxControls).visibility;
+ if (this.smartGlassActive)
+ MS.Entertainment.UI.Controls.XBoxControls.hide();
+ else
+ MS.Entertainment.UI.Controls.XBoxControls.show()
+ }, moreButtonClick: function moreButtonClick() {
+ this._updateStates()
+ }, playButtonClick: function playButtonClick() {
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked(this.domElement.className);
+ if (this._playPauseButton) {
+ this._playPauseAction = this._pauseAction;
+ this._playPauseButton.text = this._pauseAction.text;
+ this.playVisible = false
+ }
+ var isCurrentStateStoppedByError = (this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped) && !!this.playbackSession.errorDescriptor;
+ if (this.playbackSession.currentMedia !== null && (this.playbackSession.currentOrdinal === null || isCurrentStateStoppedByError))
+ this.playbackSession.activate(document.createElement("div"), this.playbackSession.pendingOrdinal);
+ else
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ if (this.playbackSession.targetTransportState !== MS.Entertainment.Platform.Playback.TransportState.unInitialize)
+ this._updateStates()
+ }, pauseButtonClick: function pauseButtonClick() {
+ MS.Entertainment.Utilities.Telemetry.logPauseClicked(this.domElement.className);
+ if (this._playPauseButton) {
+ this._playPauseAction = this._playAction;
+ this._playPauseButton.text = this._playAction.text;
+ this.playVisible = true
+ }
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ this._updateStates()
+ }, playPauseButtonClick: function playPauseButtonClick(e) {
+ if (!this.visibility || !this.playbackSession)
+ return;
+ if (this.playVisible)
+ this.playButtonClick();
+ else
+ this.pauseButtonClick()
+ }, skipForwardButtonClick: function skipForwardButtonClick(e) {
+ if (!this.visibility || this.skipForwardDisabled || !this.playbackSession)
+ return;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia))
+ this.playbackSession.skipFwd();
+ else {
+ var positionMs = this.playbackSession.getProperty("currentPosition");
+ this.playbackSession.seekToPosition(positionMs + 29000)
+ }
+ this._updateStates();
+ MS.Entertainment.Utilities.Telemetry.logNextClicked(this.domElement.className)
+ }, skipForwardButtonHold: function skipForwardButtonHold() {
+ if (this.playbackSession)
+ this.playbackSession.fastFwd()
+ }, volumeButtonClick: function volumeButtonClick(e) {
+ if (!this._volumeAction.isEnabled)
+ return;
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ appBar.sticky = true;
+ var position = WinJS.Utilities.getPosition(this._volumeButton.domElement);
+ var distanceFromBottom = (MS.Entertainment.Utilities.getWindowHeight() - position.top);
+ var left = (position.left >= 0 && position.width >= 0) ? (position.left + Math.round((0.5 * position.width) - 33)) + "px" : "auto";
+ var top = "auto";
+ var right = "auto";
+ var bottom = distanceFromBottom >= 0 ? distanceFromBottom + "px" : "auto";
+ var customStyle = "volumeContainer";
+ if (!this._volumeOverlay) {
+ this._volumeClickActionAvailable = false;
+ this._volumeOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.VolumeBar", {}, {
+ right: right, top: top, left: left, bottom: bottom
+ });
+ this._volumeOverlay.customStyle = customStyle;
+ this._volumeOverlay.enableKeyboardLightDismiss = true;
+ this._volumeOverlay.show().done(function overlayClosed() {
+ this._volumeOverlay = null
+ }.bind(this))
+ }
+ }, volumeButtonHold: function volumeButtonHold() {
+ return
+ }, skipBackButtonClick: function skipBackButtonClick(e) {
+ if (!this.visibility || this.skipBackDisabled || !this.playbackSession)
+ return;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia))
+ this.playbackSession.skipBack();
+ else {
+ var positionMs = this.playbackSession.getProperty("currentPosition");
+ this.playbackSession.seekToPosition(positionMs - 15000)
+ }
+ this._updateStates();
+ MS.Entertainment.Utilities.Telemetry.logPreviousClicked(this.domElement.className)
+ }, skipBackButtonHold: function skipBackButtonHold() {
+ if (this.playbackSession)
+ this.playbackSession.fastReverse()
+ }, repeatButtonClick: function repeatButtonClick() {
+ if (this.visibility && this.playbackSession) {
+ this.playbackSession.repeat = !this.playbackSession.repeat;
+ this._updateRepeatButton();
+ this._updateStates()
+ }
+ }, _updateRepeatButton: function _updateRepeatButton() {
+ var sessionRepeat = this.playbackSession && this.playbackSession.repeat;
+ this._repeatAction.title = sessionRepeat ? String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON);
+ this._repeatAction.ariaPressed = sessionRepeat
+ }, shuffleButtonClick: function shuffleButtonClick() {
+ if (this.visibility && this.playbackSession) {
+ this.playbackSession.shuffle = !this.playbackSession.shuffle;
+ this._updateShuffleButton();
+ this._updateStates()
+ }
+ }, _updateShuffleButton: function _updateShuffleButton() {
+ var sessionShuffle = this.playbackSession && this.playbackSession.shuffle;
+ this._shuffleAction.title = sessionShuffle ? String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON);
+ this._shuffleAction.ariaPressed = sessionShuffle
+ }
+ }, {
+ playbackLabelId: null, playbackSession: null, isDisabled: true, playVisible: false, nowPlayingSkipBackVisible: false, nowPlayingSkipForwardVisible: false, nowPlayingVolumeVisible: false, skipBackDisabled: true, skipForwardDisabled: true, messageTitle: "", messageSubTitle: "", messageVisible: false, shuffleEnabled: false, repeatEnabled: false, moreVisible: false, smartGlassVisible: false, smartGlassDisabled: true, smartGlassActive: false, volumeVisible: true, volumeDisabled: false, xboxJoined: false, xboxVisible: false, xboxDisabled: true, xboxTransferAvailable: false, dlnaTransferAvailable: false, anyTransferAvailable: false, _playAction: null, _pauseAction: null, _playPauseAction: null, _skipForwardAction: null, _skipForwardHoldAction: null, _smartGlassAction: null, _skipBackAction: null, _skipBackHoldAction: null, _repeatAction: null, _shuffleAction: null, _xboxAction: null, _volumeAction: null, _volumeHoldAction: null, _volumeOverlay: null, _decimalFormatter: null, _ccSavedState: null
+ }, {
+ _closedCaptionsInitialized: false, applySelectBoxOptionTemplate: function optionTemplate(container, item) {
+ container.textContent = item.name;
+ container.value = item.lcid
+ }, applySelectBoxChanged: function selectThingy() {
+ this.domElement.addEventListener("change", function selectionChanged(e) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.nowPlayingSession;
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ if (playbackSession)
+ if (e.target.selectedIndex) {
+ playbackSession.ccLcid = e.target.options[e.target.selectedIndex].value;
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(true);
+ settingsStorage.values["preferredCaptionLanguage"] = e.target.options[e.target.selectedIndex].value
+ }
+ else {
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(false);
+ settingsStorage.values.remove("preferredCaptionLanguage")
+ }
+ })
+ }, playButtonStringId: {
+ get: function getPlayButtonStringId() {
+ return MS.Entertainment.Utilities.isMusicApp ? String.id.IDS_PLAY_BUTTON : String.id.IDS_PLAY_BUTTON_VIDEO
+ }
+ }, setClosedCaptions: function setClosedCaptions(value) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.nowPlayingSession;
+ if (playbackSession) {
+ if (!this._closedCaptionsInitialized && value) {
+ this._closedCaptionsInitialized = true;
+ MS.Entertainment.Platform.Playback.ClosedCaptions.Renderer.loadAndUpdateClosedCaptionStyleSettings()
+ }
+ playbackSession.closedCaptionsOn = !!value
+ }
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/components/session/sessionmgr.js:46056 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform");
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "LivingRoomCompanion", {
+ BrowserUrlState: {
+ updated: "updated", updating: "updating"
+ }, BrowserInputMode: {
+ browser: "browser", dpad: "dpad"
+ }, SessionState: {
+ unInitialize: "unInitialize", disconnecting: "disconnecting", disconnected: "disconnected", connecting: "connecting", connected: "connected", transferringToRemote: "transferringToRemote", transferringToLocal: "transferringToLocal", error: "error", connectedTemporaryError: "connectedTemporaryError"
+ }, AppLifetime: {
+ none: "none", suspending: "suspending", resuming: "resuming", running: "running", shutdown: "shutdown"
+ }, WellKnownTitleId: {
+ ze: 1481115739, hu: 810026961, nx: 960956369, dd: 4294838225, mc: 1480918995, bb: 1481115776
+ }, isWellKnownTitle: function isWellKnownTitle(titleId, wellKnownTitleId) {
+ if (!titleId || isNaN(titleId))
+ return false;
+ return (parseInt(titleId) === wellKnownTitleId)
+ }, LaunchFirstAction: {
+ playNow: "PlayNow", addNow: "AddNow"
+ }
+ });
+ WinJS.Namespace.defineWithParent(MS.Entertainment, "Platform", {
+ SessionManager: MS.Entertainment.UI.Framework.define(function SessionManager_constructor() {
+ this._createMediaControlMethods();
+ this._bindMediaControls();
+ this._bindSystemMediaTransportControls();
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), { networkStatus: this._onNetworkStatusChanged.bind(this) })
+ }, {
+ nowPlayingSession: {
+ get: function SessionManager_nowPlayingSession_get() {
+ return this._nowPlayingSession
+ }
+ }, primarySession: {
+ get: function SessionManager_primarySession_get() {
+ return this._primarySession
+ }
+ }, setPrimarySession: function SessionManager_setPrimarySession(sessionId) {
+ if (!this.sessions || !sessionId)
+ return null;
+ if (this._stopPromise && sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying) {
+ this._stopPromise.cancel();
+ this._stopPromise = null
+ }
+ if (this._primarySession && this._primarySession.sessionId === sessionId)
+ return this._primarySession;
+ if (this._primarySession)
+ if (Windows && Windows.Media && Windows.Media.MediaControl) {
+ this._primarySession.unbind("canSkipForward", this._bindMediaControlsNext);
+ this._primarySession.unbind("canSkipBackward", this._bindMediaControlsPrevious)
+ }
+ var activeSession = this.getSession(sessionId);
+ if (activeSession) {
+ this._primarySession = activeSession;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).primarySessionId = this._primarySession.sessionId;
+ if (Windows && Windows.Media && Windows.Media.MediaControl) {
+ activeSession.bind("canSkipForward", this._bindMediaControlsNext);
+ activeSession.bind("canSkipBackward", this._bindMediaControlsPrevious)
+ }
+ }
+ return activeSession
+ }, _stopPromise: null, createSession: function SessionManager_createSession() {
+ this.sessions = this.sessions || {};
+ var session = new MSEPlatform.Playback.PlaybackSession;
+ this.sessions[session.sessionId] = session;
+ return session
+ }, getSession: function SessionManager_getSession(sessionId) {
+ var session = null;
+ if (sessionId in this.sessions)
+ session = this.sessions[sessionId];
+ return session
+ }, activateSession: function SessionManager_activateSession(controlHost, sessionId) {
+ var session = (!sessionId ? this._nowPlayingSession : this.sessions[sessionId]);
+ if (session)
+ WinJS.Promise.join([session._setDataSourcePromise]).then(function () {
+ session.activate(controlHost)
+ })
+ }, deactivateSession: function SessionManager_deactivateSession(pausePlayback, sessionId) {
+ var session = (!sessionId ? this._nowPlayingSession : this.sessions[sessionId]);
+ if (session)
+ session.deactivate(pausePlayback)
+ }, relocateSession: function SessionManager_relocateSession(newHost, sessionId) {
+ var session = (!sessionId ? this._nowPlayingSession : this.sessions[sessionId]);
+ if (session)
+ session.relocate(newHost)
+ }, displayRequestActive: function SessionManager_displayRequestActive() {
+ if (this._displayRequest) {
+ if (this._isDisplayRequestActive)
+ return;
+ try {
+ this._displayRequest.requestActive();
+ this._isDisplayRequestActive = true
+ }
+ catch (e) { }
+ }
+ }, displayRequestRelease: function SessionManager_displayRequestRelease() {
+ if (this._displayRequest) {
+ if (!this._isDisplayRequestActive)
+ return;
+ try {
+ this._displayRequest.requestRelease();
+ this._isDisplayRequestActive = false
+ }
+ catch (e) { }
+ }
+ }, clearCachedPBMState: function SessionManager_clearCachedPBMState() {
+ if (this._transportStateBeforePaused !== MS.Entertainment.Platform.Playback.TransportState.unInitialize) {
+ MSEPlatform.Playback.Etw.traceString("Clearing cached state '" + this._transportStateBeforePaused + "' from when we paused due to PBM event");
+ this._transportStateBeforePaused = MS.Entertainment.Platform.Playback.TransportState.unInitialize
+ }
+ }, _createMediaControlMethods: function _createMediaControlMethods() {
+ var mediaControls = null;
+ var systemMediaTransportControls = null;
+ if (!MS.Entertainment.Utilities.isApp2)
+ mediaControls = WinJS.Utilities.getMember("Media.MediaControl", Windows);
+ if (WinJS.Utilities.getMember("Media.SystemMediaTransportControls", Windows) && (MS.Entertainment.Utilities.isMusicApp2 || MS.Entertainment.Utilities.isAmsterdamApp))
+ systemMediaTransportControls = Windows.Media.SystemMediaTransportControls.getForCurrentView();
+ this._bindMediaControlsNext = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function SessionManager_bindMediaControlsNext(canSkipForward) {
+ if (mediaControls)
+ if (canSkipForward && !this._nextTrackPressedListener)
+ try {
+ this._nextTrackPressedListener = MS.Entertainment.UI.Framework.addEventHandlers(mediaControls, {
+ nexttrackpressed: function nextTrackPressed() {
+ this._mediaControlNext()
+ }.bind(this)
+ }, false)
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("sessionManager::_createMediaControlMethods(): Non-fatal exception caught in addEventListener(nexttrackpressed): " + ex)
+ }
+ else if (!canSkipForward && this._nextTrackPressedListener) {
+ this._nextTrackPressedListener.cancel();
+ this._nextTrackPressedListener = null
+ }
+ if (systemMediaTransportControls) {
+ systemMediaTransportControls.isNextEnabled = canSkipForward;
+ systemMediaTransportControls.displayUpdater.update()
+ }
+ }, this);
+ this._bindMediaControlsPrevious = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function SessionManager_bindMediaControlsPrevious(canSkipBack) {
+ if (mediaControls)
+ if (canSkipBack && !this._previousTrackPressedListener)
+ try {
+ this._previousTrackPressedListener = MS.Entertainment.UI.Framework.addEventHandlers(mediaControls, {
+ previoustrackpressed: function previousTrackPressed() {
+ this._mediaControlPrevious()
+ }.bind(this)
+ }, false)
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("sessionManager::_createMediaControlMethods(): Non-fatal exception caught in addEventListener(previoustrackpressed): " + ex)
+ }
+ else if (!canSkipBack && this._previousTrackPressedListener) {
+ this._previousTrackPressedListener.cancel();
+ this._previousTrackPressedListener = null
+ }
+ if (systemMediaTransportControls) {
+ systemMediaTransportControls.isPreviousEnabled = canSkipBack;
+ systemMediaTransportControls.displayUpdater.update()
+ }
+ }, this);
+ this._mediaControlNext = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function SessionManager_mediaControlNext(source) {
+ source = source ? source : "mediaKey";
+ if (this.primarySession)
+ this.primarySession._ensureSession().then(function sessionMgr_doMediaControlNext() {
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.primarySession.currentMedia))
+ this.primarySession.skipFwd();
+ else {
+ var positionMs = this.primarySession.forceTimeUpdate();
+ this.primarySession.seekToPosition(positionMs + 29000)
+ }
+ }.bind(this));
+ MS.Entertainment.Utilities.Telemetry.logNextClicked(source)
+ }, this);
+ this._mediaControlPrevious = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function SessionManager_mediaControlPrevious(source, forcePreviousTrack) {
+ source = source ? source : "mediaKey";
+ if (this.primarySession)
+ this.primarySession._ensureSession().then(function sessionMgr_doMediaControlPrevious() {
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.primarySession.currentMedia))
+ this.primarySession.skipBack(forcePreviousTrack);
+ else {
+ var positionMs = this.primarySession.forceTimeUpdate();
+ this.primarySession.seekToPosition(positionMs - 15000)
+ }
+ }.bind(this));
+ MS.Entertainment.Utilities.Telemetry.logPreviousClicked(source)
+ }, this);
+ this._mediaControlPlayPauseToggle = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function SessionManager_mediaControlPlayPauseToggle(source) {
+ source = source ? source : "mediaKey";
+ if (this.primarySession) {
+ this.primarySession._ensureSession().then(function sessionMgr_doMediaControlPlayPauseToggle() {
+ if (this.primarySession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ MS.Entertainment.Utilities.Telemetry.logPauseClicked(source)
+ }
+ else if (this.primarySession.playerState === MS.Entertainment.Platform.Playback.PlayerState.ready)
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ else
+ this.primarySession.playAt(0)
+ }.bind(this));
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked(source)
+ }
+ }, this)
+ }, _bindMediaControls: function _bindMediaControls() {
+ if (!Windows || !Windows.Media || !Windows.Media.MediaControl || MS.Entertainment.Utilities.isApp2)
+ return;
+ var mediaControls = Windows.Media.MediaControl;
+ try {
+ mediaControls.addEventListener("playpausetogglepressed", function mediaControlPlayPause() {
+ this._mediaControlPlayPauseToggle()
+ }.bind(this), false);
+ mediaControls.addEventListener("playpressed", function mediaControlPlay() {
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked("mediaKey")
+ }.bind(this), false);
+ mediaControls.addEventListener("stoppressed", function mediaControlStop() {
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ MS.Entertainment.Utilities.Telemetry.logStopClicked("mediaKey")
+ }.bind(this), false);
+ mediaControls.addEventListener("pausepressed", function mediaControlPause() {
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ MS.Entertainment.Utilities.Telemetry.logPauseClicked("mediaKey")
+ }.bind(this), false);
+ mediaControls.addEventListener("soundlevelchanged", this._onSoundLevelChanged.bind(this), false)
+ }
+ catch (ex) {
+ MSEPlatform.Playback.Etw.traceString("Non-fatal exception caught in mediaControls.addEventListener: " + ex)
+ }
+ }, _bindSystemMediaTransportControls: function _bindSystemMediaTransportControls() {
+ if (!WinJS.Utilities.getMember("Media.SystemMediaTransportControls", Windows) || (!MS.Entertainment.Utilities.isMusicApp2 && !MS.Entertainment.Utilities.isAmsterdamApp))
+ return;
+ var systemMediaTransportControls = Windows.Media.SystemMediaTransportControls.getForCurrentView();
+ var systemMediaButtons = Windows.Media.SystemMediaTransportControlsButton;
+ systemMediaTransportControls.addEventListener("buttonpressed", function buttonPressed(evt) {
+ evt.detail.forEach(function eventIterator(event) {
+ switch (event.button) {
+ case systemMediaButtons.stop:
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ MS.Entertainment.Utilities.Telemetry.logStopClicked("voiceCommand");
+ break;
+ case systemMediaButtons.play:
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked("voiceCommand");
+ break;
+ case systemMediaButtons.pause:
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ MS.Entertainment.Utilities.Telemetry.logPauseClicked("voiceCommand");
+ break;
+ case systemMediaButtons.next:
+ this._mediaControlNext("voiceCommand");
+ break;
+ case systemMediaButtons.previous:
+ this._mediaControlPrevious("voiceCommand", true);
+ break
+ }
+ }.bind(this))
+ }.bind(this));
+ systemMediaTransportControls.addEventListener("propertychanged", function propertyChanged(event) {
+ var updater = systemMediaTransportControls.displayUpdater;
+ switch (event.property) {
+ case Windows.Media.SystemMediaTransportControlsProperty.playbackPosition:
+ if (updater.type === Windows.Media.MediaPlaybackType.music)
+ if (isFinite(updater.musicProperties.playbackPosition) && updater.musicProperties.playbackPosition >= 0)
+ this.primarySession.seekToPosition(updater.musicProperties.playbackPosition);
+ break;
+ default:
+ break
+ }
+ }.bind(this))
+ }, _onSoundLevelChanged: function SessionManager_onSoundLevelChanged() {
+ try {
+ if (this.primarySession && this.primarySession.isRemoteSession && this.primarySession.isRemoteSession())
+ return;
+ var soundLevel = Windows.Media.MediaControl.soundLevel;
+ switch (soundLevel) {
+ case Windows.Media.SoundLevel.full:
+ this._onSoundLevelFull();
+ break;
+ case Windows.Media.SoundLevel.low:
+ this._onSoundLevelLow();
+ break;
+ case Windows.Media.SoundLevel.muted:
+ this._onSoundLevelMuted();
+ break;
+ default:
+ MS.Entertainment.Platform.assert(false, "Unexpected value for soundLevel: " + soundLevel);
+ break
+ }
+ }
+ catch (ex) { }
+ }, _onSoundLevelFull: function SessionManager_onSoundLevelFull() {
+ var currentTransportState = MS.Entertainment.Platform.Playback.TransportState.unInitialize;
+ MSEPlatform.Playback.Etw.traceString("+PBM Sound Full");
+ if (this.primarySession) {
+ currentTransportState = this.primarySession.currentTransportState;
+ if (this._transportStateBeforePaused && this._transportStateBeforePaused !== MS.Entertainment.Platform.Playback.TransportState.unInitialize) {
+ if (this._transportStateBeforePaused !== MS.Entertainment.Platform.Playback.TransportState.starting) {
+ MSEPlatform.Playback.Etw.traceString("PBM Sound full. Target TransportState to stored value:", this._transportStateBeforePaused);
+ this.primarySession.targetTransportState = this._transportStateBeforePaused
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PBM Sound full. Target TransportState to playing");
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing
+ }
+ this._transportStateBeforePaused = MS.Entertainment.Platform.Playback.TransportState.unInitialize
+ }
+ }
+ MSEPlatform.Playback.Etw.tracePlaybackPBMSoundLevelChanged("full", currentTransportState)
+ }, _onSoundLevelLow: function SessionManager_onSoundLevelLow() {
+ var currentTransportState = MS.Entertainment.Platform.Playback.TransportState.unInitialize;
+ MSEPlatform.Playback.Etw.traceString("+PBM Sound Low");
+ if (this.primarySession) {
+ currentTransportState = this.primarySession.currentTransportState;
+ if (!MS.Entertainment.Utilities.isMusicApp && currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.stopped) {
+ MSEPlatform.Playback.Etw.traceString("PBM Sound Low pausing from " + this.primarySession.currentTransportState);
+ this._transportStateBeforePaused = this.primarySession.currentTransportState;
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused
+ }
+ }
+ MSEPlatform.Playback.Etw.tracePlaybackPBMSoundLevelChanged("low", currentTransportState)
+ }, _onSoundLevelMuted: function SessionManager_onSoundLevelMuted() {
+ MSEPlatform.Playback.Etw.traceString("+PBM Sound Muted");
+ if (this.primarySession && this.primarySession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.stopped) {
+ this._transportStateBeforePaused = this.primarySession.currentTransportState;
+ this.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused
+ }
+ MSEPlatform.Playback.Etw.tracePlaybackPBMSoundLevelChanged("muted", this._transportStateBeforePaused)
+ }, _flushPreroll: function SessionManager_flushPreroll(status) {
+ for (var id in this.sessions)
+ if ("flushPreroll" in this.sessions[id])
+ this.sessions[id].flushPreroll(status)
+ }, _onNetworkStatusChanged: function SessionManager_onNetworkStatusChanged(newValue) {
+ this._flushPreroll(newValue)
+ }, _rootLicenseRefresh: (function SessionManager_rootLicenseRefresh_closure() {
+ var configurationManager;
+ return function SessionManager_rootLicenseRefresh(signIn) {
+ if (!configurationManager)
+ configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var tunerActivated = (signedInUser && signedInUser.isTunerActivated) ? true : false;
+ var subscription = (signedInUser && signedInUser.isSubscription) ? true : false;
+ MSEPlatform.Playback.Etw.traceDRMRootLicenseRefreshAccount(subscription);
+ if (!(subscription && tunerActivated))
+ return WinJS.Promise.wrap();
+ var now = new Date;
+ var spanMs = configurationManager.drm.timeBetweenRefreshSessionsMins * 60 * 1000;
+ var lastRefresh = configurationManager.drm.lastFullRefresh;
+ MSEPlatform.Playback.Etw.traceDRMRootLicenseRefreshDetails(now, lastRefresh, spanMs);
+ if (now - lastRefresh < spanMs) {
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("skipped");
+ return WinJS.Promise.wrap()
+ }
+ MSEPlatform.Playback.Etw.traceDRMRootLicenseRefreshInvoked();
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("attempted");
+ return signIn.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport)).then(function gotTicket(ticket) {
+ var drmIndividualizationPromise = WinJS.Promise.as(MS.Entertainment.Platform.Playback.drmIndividualizationPromise);
+ return drmIndividualizationPromise.then(function _doAcquireRootLicense() {
+ return Microsoft.Entertainment.Util.PlayReadyHandler.acquireRootLicense(ticket)
+ })
+ }).then(function succeeded() {
+ configurationManager.drm.lastFullRefresh = now;
+ MSEPlatform.Playback.Etw.traceDRMRootLicenseRefreshCompleted("succeeded");
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("succeeded");
+ return WinJS.Promise.wrap()
+ }, function failed(error) {
+ var errorCode = (error && error.number) ? error.number : "unknown";
+ MSEPlatform.Playback.Etw.traceDRMRootLicenseRefreshCompleted(error + " (error code: " + errorCode + ")");
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("failed", errorCode);
+ return WinJS.Promise.wrapError(error)
+ })
+ }
+ })(), _reportMetering: function SessionManager_reportMetering(signIn) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var subscription = (signedInUser && signedInUser.isSubscription) ? true : false;
+ var tunerActivated = (signedInUser && signedInUser.isTunerActivated) ? true : false;
+ var meteringCertificate = (signedInUser) ? signedInUser.meteringCertificate : null;
+ MSEPlatform.Playback.Etw.traceDRMReportMeteringAccount(subscription, tunerActivated, meteringCertificate ? "set" : "not set");
+ if (subscription && tunerActivated) {
+ MSEPlatform.Playback.Etw.traceDRMReportMeteringInvoked();
+ signIn.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport)).then(function gotTicket(ticket) {
+ return Microsoft.Entertainment.Util.PlayReadyHandler.reportMetering(ticket, meteringCertificate)
+ }).then(function succeeded() {
+ MSEPlatform.Playback.Etw.traceDRMReportMeteringCompleted("succeeded")
+ }, function failed(error) {
+ var errorCode = (error && error.number) ? error.number : "unknown";
+ MSEPlatform.Playback.Etw.traceDRMReportMeteringCompleted(error + "(error code: " + errorCode + ")")
+ })
+ }
+ }, getPassportTicketAsync: function SessionManager_getPassportTicketAsync(returnEmptyOnFailure) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (!signIn)
+ return WinJS.Promise.wrapError("No SignIn service registered");
+ function getPassportTicketAsync_signedIn(returnEmptyOnFailure) {
+ return signIn.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport)).then(function getPassportTicketAsync_success(ticket) {
+ if (!ticket) {
+ if (returnEmptyOnFailure)
+ return String.empty;
+ return WinJS.Promise.wrapError(new Error("Unable to get a valid passport ticket."))
+ }
+ return ticket
+ }, function getPassportTicketAsync_error(e) {
+ if (returnEmptyOnFailure)
+ return String.empty;
+ return WinJS.Promise.wrapError(e)
+ })
+ }
+ if (signIn.isSignedIn || returnEmptyOnFailure)
+ return getPassportTicketAsync_signedIn(returnEmptyOnFailure);
+ else {
+ var waitForSignIn = new WinJS.Promise(function SessionManager_initWaitForSignIn(c, e, p) {
+ function _waitForSignInAsync_signInComplete() {
+ MS.Entertainment.Utilities.SignIn.removeEventListener("signInComplete", _waitForSignInAsync_signInComplete, false);
+ c()
+ }
+ MS.Entertainment.Utilities.SignIn.addEventListener("signInComplete", _waitForSignInAsync_signInComplete, false);
+ if (!signIn.isSigningIn)
+ signIn.signIn(false, true, true).then(null, function signInError(value) {
+ this.primarySession.currentTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped
+ }.bind(this))
+ }.bind(this));
+ return waitForSignIn.then(getPassportTicketAsync_signedIn.bind(this, returnEmptyOnFailure))
+ }
+ }, _onSignInCompleted: function SessionManager_onSignInCompleted() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (signIn && signIn.isSignedIn) {
+ var retries = 0;
+ var DRMOnSignInActivities = function DRMOnSignIn() {
+ if (MS.Entertainment.Platform.Playback.drmIndividualizationPromise)
+ MS.Entertainment.Platform.Playback.drmIndividualizationPromise.done(function indivDone(individualized) {
+ if (individualized) {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this._rootLicenseRefresh(signIn).then(function SessionManager_rootLicenseRefresh_Completed() {
+ this._reportMetering(signIn)
+ }.bind(this))
+ }
+ else {
+ MS.Entertainment.Utilities.DRM.individualizationAsync();
+ if (retries < 5) {
+ retries++;
+ MSEPlatform.Playback.Etw.traceString("Re-indiv on sign-in. Retry#" + retries);
+ DRMOnSignInActivities()
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("Re-indiv on sign-in. Does not work - giving up after " + retries + " retries.")
+ }
+ }.bind(this), function uhOh(error) {
+ MS.Entertainment.Platform.fail("DRM indiv promise should not ever fail: only false/true success is expected")
+ })
+ }.bind(this);
+ this._flushPreroll();
+ DRMOnSignInActivities()
+ }
+ }, _onSignOutCompleted: function SessionManager_onSignOutCompleted() {
+ this._flushPreroll()
+ }, _onApproachingDataLimitChanged: function SessionManager_onApproachingDataLimitChanged(approachingDataLimit) {
+ if (approachingDataLimit)
+ if (this._nowPlayingSession)
+ this._nowPlayingSession.notifyNetworkConnectionChanged(MS.Entertainment.Platform.NetworkConnection.approachingDataLimit)
+ }, _initialize: function SessionManager_initialize() {
+ MSEPlatform.Playback.VideoPlayer.initializeVideoExtensions();
+ if (MS.Entertainment.Utilities.SignIn) {
+ MS.Entertainment.Utilities.SignIn.addEventListener("signInComplete", this._onSignInCompleted.bind(this), false);
+ MS.Entertainment.Utilities.SignIn.addEventListener("signOutComplete", this._onSignOutCompleted.bind(this), false)
+ }
+ this.sessions = this.sessions || {};
+ var sessionId = MSEPlatform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ this.sessions[sessionId] = new MSEPlatform.Playback.PlaybackSession(sessionId);
+ this._nowPlayingSession = this.sessions[sessionId];
+ this._nowPlayingSession.addEventListener("currentOrdinalChanged", this._onPlaylistOrdinalChanged.bind(this));
+ this._nowPlayingSession.addEventListener("currentNowPlayingPlaylistLibraryIdChanged", this._currentNowPlayingPlaylistLibraryIdChanged.bind(this));
+ this._nowPlayingSession.addEventListener("currentTransportStateChanged", this._currentTransportStateChanged.bind(this));
+ this.setPrimarySession(sessionId)
+ }, _displayRequest: {
+ get: function get_displayRequest() {
+ if (!this.__displayRequest && Windows && Windows.System && Windows.System.Display)
+ if (Windows && Windows.System && Windows.System.Display)
+ this.__displayRequest = new Windows.System.Display.DisplayRequest;
+ return this.__displayRequest
+ }
+ }, _currentTransportStateChanged: function _currentTransportStateChanged(e) {
+ if (this._mediaStore && this.primarySession && this.primarySession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped && this.primarySession.currentNowPlayingPlaylistLibraryId && !this.primarySession.canSkipForward)
+ this._onPlaylistOrdinalChanged(this.primarySession.first)
+ }, _dataLimitHandler: null, _notifyUpcomingStreaming: function _sessionMgr_notifyUpcomingStreaming(isStream) {
+ if (isStream)
+ if (!this._dataLimitHandler) {
+ this._dataLimitHandler = this._onApproachingDataLimitChanged.bind(this);
+ WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus), { approachingDataLimit: this._dataLimitHandler })
+ }
+ }, _currentNowPlayingPlaylistLibraryIdChanged: function _currentNowPlayingPlaylistLibraryIdChanged(e) {
+ var newId = (e && e.detail) ? e.detail.newValue : null;
+ this._currentNowPlayingPlaylistLibraryId = newId
+ }, _onPlaylistOrdinalChanged: function _onPlaylistOrdinalChanged(e) {
+ var newOrdinal = typeof e === "number" ? e : (e && e.detail) ? e.detail.newValue : null;
+ if (newOrdinal === null)
+ return;
+ if (!this._mediaStore)
+ this._mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ var provider = this._mediaStore.playlistProvider;
+ if (this._currentNowPlayingPlaylistLibraryId >= 0)
+ provider.savePlaylistCurrentItemIndexAsync(this._currentNowPlayingPlaylistLibraryId, newOrdinal);
+ else {
+ this._updatePendingOrdinal = newOrdinal;
+ if (this._playlistIdLookupPromise)
+ return;
+ var query = new MS.Entertainment.Data.Query.libraryPlaylists;
+ query.playlistType = Microsoft.Entertainment.Platform.PlaylistType.nowPlaying;
+ query.chunkSize = 1;
+ this._playlistIdLookupPromise = query.execute().then(function loadPlaylist(query) {
+ if (query.result.totalCount > 0)
+ query.result.items.toArray(0, 1).then(function updatePlaylist(playlist) {
+ if (playlist && playlist.length > 0) {
+ this._currentNowPlayingPlaylistLibraryId = playlist[0].libraryId;
+ provider.savePlaylistCurrentItemIndexAsync(playlist[0].libraryId, this._updatePendingOrdinal)
+ }
+ this._playlistIdLookupPromise = null
+ }.bind(this))
+ }.bind(this))
+ }
+ }, requestNetwork: function SessionManager_requestNetwork(requestOwner) {
+ var releaseCount = 0;
+ MS.Entertainment.Platform.assert(MS.Entertainment.Utilities.isMusicApp, "requestNetwork should not be needed outside of the music app");
+ if (!this._networkKeepAliveTag)
+ try {
+ if (!this._extensionManager)
+ this._extensionManager = new Windows.Media.MediaExtensionManager;
+ this._networkKeepAliveSettings = new Windows.Foundation.Collections.PropertySet;
+ this._networkKeepAliveSettings["DoesNotUseNetwork"] = false;
+ this._extensionManager.registerSchemeHandler("Microsoft.Entertainment.Platform.Playback.ConnectedStandbySchemeHandler", "shape:", this._networkKeepAliveSettings);
+ this._networkKeepAliveTag = document.createElement("video");
+ this._networkKeepAliveTag.width = 0;
+ this._networkKeepAliveTag.height = 0;
+ this._networkKeepAliveTag.src = "shape://circle";
+ this._networkKeepAliveTag.autoplay = false
+ }
+ catch (exception) {
+ MSEPlatform.Playback.Etw.traceString("Non-fatal exception caught in requestNetwork: " + exception)
+ }
+ if (this._networkKeepAliveSettings && this._networkKeepAliveRefCount++ === 0)
+ this._networkKeepAliveSettings["DoesNotUseNetwork"] = false;
+ MSEPlatform.Playback.Etw.traceString("requestNetwork from " + requestOwner + ", " + "refCount: " + this._networkKeepAliveRefCount);
+ return {
+ release: function releaseNetwork() {
+ MS.Entertainment.Platform.assert(releaseCount++ === 0, "double release from " + requestOwner);
+ if (this._networkKeepAliveSettings && --this._networkKeepAliveRefCount === 0) {
+ this._networkKeepAliveSettings["DoesNotUseNetwork"] = true;
+ this._networkKeepAliveTag.removeAttribute("src");
+ this._networkKeepAliveTag = null
+ }
+ MSEPlatform.Playback.Etw.traceString("releaseNetwork from " + requestOwner + ", " + "refCount: " + this._networkKeepAliveRefCount)
+ }.bind(this)
+ }
+ }, requestNetworkAndDelay: function sessionManager_requestNetworkAndDelay(requestOwner) {
+ var networkReleaseHandle = this.requestNetwork(requestOwner);
+ return WinJS.Promise.timeout(this._networkRequestDelay).then(function onNetworkRequestDelayed() {
+ return networkReleaseHandle
+ })
+ }, sessions: null, tmfAuthToken: null, __displayRequest: null, _isDisplayRequestActive: false, _nowPlayingSession: null, _primarySession: null, _transportStateBeforePaused: MS.Entertainment.Platform.Playback.TransportState.unInitialize, _networkKeepAliveTag: null, _networkKeepAliveSettings: null, _networkKeepAliveRefCount: 0, _currentNowPlayingPlaylistLibraryId: -1, _updatePendingOrdinal: -1, _playlistIdLookupPromise: null, _mediaStore: null, _networkRequestDelay: 2000
+ }, {
+ trackingIdState: {}, _createSessionId: (function createSessionId_closure() {
+ var sessionCounter = 0;
+ return function _createSessionId() {
+ sessionCounter++;
+ return ("sessionId_" + sessionCounter)
+ }
+ })()
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ WellKnownPlaybackSessionId: {
+ nowPlaying: "nowPlaying", remoteLRC: "remoteLRC"
+ }
+ });
+ WinJS.Namespace.defineWithParent(MS.Entertainment, "Platform", {
+ NetworkConnection: {
+ approachingDataLimit: "approachingDataLimit", overDataLimit: "overDataLimit", switchedToMetered: "switchedToMetered"
+ }
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.sessionManager, function sessionManagerFactory() {
+ var sessionMgr = new MSEPlatform.SessionManager;
+ sessionMgr._initialize();
+ return sessionMgr
+ }, true)
+ })()
+})();
+/* >>>>>>/controls/transportcontrols/seekbar.js:46627 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+ (function () {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ SeekBar: MS.Entertainment.UI.Framework.defineUserControl("/Controls/TransportControls/SeekBar.html#seekBarTemplate", function (element, options) {
+ this._renderLoop = this._renderLoop.bind(this);
+ this._updateSize = this._updateSize.bind(this)
+ }, {
+ _initialized: false, _uiStateService: MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), _bindings: null, _cachedValues: {
+ _trackWidth: 0, _seekbarPosition: 0, _thumbWidth: 0, msScrollLimitXMax: 0
+ }, _scrubValue: 0, _lastAriaSliderUpdate: 0, _musicThumbOffset: 30, _isKeyDownOnThumb: false, initialize: function initialize() {
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this.bind("metadataVisible", this._updateValues.bind(this));
+ this.bind("visibility", this._visibilityChanged.bind(this));
+ var handlePointerEvent = this._onPointerEvent.bind(this);
+ this._track.addEventListener("keydown", this._onKeyDownEvent.bind(this), true);
+ this._thumb.addEventListener("keyup", this._onKeyUpEvent.bind(this), true);
+ this._scroller.addEventListener("keydown", this._onKeyDownEvent.bind(this), true);
+ this._scroller.addEventListener("MSPointerDown", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerUp", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerMove", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerdown", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerup", handlePointerEvent, true);
+ this._scroller.addEventListener("pointermove", handlePointerEvent, true);
+ this._scroller.addEventListener("MSManipulationStateChanged", handlePointerEvent, true);
+ this._scroller.addEventListener("scroll", this._scrollPositionChanged.bind(this), true);
+ this._scroller.addEventListener("MSHoldVisual", function (e) {
+ e.preventDefault()
+ });
+ MS.Entertainment.Utilities.attachResizeEvent(this.domElement, this._updateSize);
+ this._initialized = true
+ }, _visibilityChanged: function _visibilityChanged(newVal) {
+ if (newVal)
+ this._updateSize()
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }, freeze: function seekBar_freeze() {
+ if (this.frozen) {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ return
+ }
+ this._detachBindings();
+ this.frozen = true;
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function seekBar_thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this.frozen = false;
+ if (this._initialized)
+ this._playbackSessionChanged();
+ this._updateSize()
+ }, unload: function unload() {
+ this._detachBindings();
+ MS.Entertainment.Utilities.detachResizeEvent(this.domElement, this._updateSize);
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _updateSize: function _updateSize() {
+ if (this._track) {
+ this._cachedValues._seekbarPosition = WinJS.Utilities.getPosition(this._track);
+ this._cachedValues._trackWidth = this._track.clientWidth
+ }
+ if (this._thumb)
+ this._cachedValues._thumbWidth = this._thumb.clientWidth;
+ if (this._scroller) {
+ this._scroller.style.msScrollLimitXMin = "0px";
+ if (this.playbackSession && MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ this._scroller.style.msScrollLimitXMax = this._scroller.clientWidth - (this._cachedValues._thumbWidth * 6) + "px";
+ else
+ this._scroller.style.msScrollLimitXMax = this._scroller.clientWidth - (this._cachedValues._thumbWidth * 2) + "px";
+ this._cachedValues.msScrollLimitXMax = this._scroller.style.msScrollLimitXMax;
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth))
+ }
+ this._mediaPositionChanged()
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ if (this.playbackSession)
+ this._bindings = WinJS.Binding.bind(this, {
+ playbackSession: {
+ currentMedia: this._mediaChanged.bind(this), currentPosition: this._mediaPositionChanged.bind(this), currentTransportState: this._playbackStateChanged.bind(this)
+ }, _uiStateService: {
+ isSnapped: this._snappedStateChanged.bind(this), isFullScreenVideo: this._fullScreenVideoChanged.bind(this)
+ }
+ });
+ this._updateValues();
+ this._updateAriaSliderValues(true)
+ }, _playbackStateChanged: function _playbackStateChanged() {
+ this._updateAriaSliderValues(true)
+ }, _snappedStateChanged: function _snappedStateChanged(newVal) {
+ if (!newVal) {
+ this._updatePosition();
+ this._updateAriaSliderValues(true)
+ }
+ }, _fullScreenVideoChanged: function _fullScreenVideoChanged(isFullScreenVideo) {
+ if (!isFullScreenVideo) {
+ this._updatePosition();
+ this._updateAriaSliderValues(true)
+ }
+ }, _mediaChanged: function _mediaChanged() {
+ this._updatePosition();
+ this._updateAriaSliderValues();
+ this._updateNowPlayingText()
+ }, _mediaPositionChanged: function _mediaPositionChanged() {
+ if (document.hidden)
+ return;
+ this._updatePosition();
+ this._updateAriaSliderValues()
+ }, _updateNowPlayingText: function _updateNowPlayingText() {
+ this.nowPlayingText = String.load(String.id.IDS_HOME_NOW_PLAYING)
+ }, _updatePosition: function _updatePosition() {
+ if (this.frozen || !this.playbackSession)
+ return;
+ var durationMs = this.playbackSession.duration;
+ var positionMs = this.playbackSession.currentPosition;
+ positionMs = Math.min(durationMs, positionMs);
+ this.max = durationMs;
+ this.min = 0;
+ if (!this.isManipulating) {
+ MS.Entertainment.Framework.AccUtils.setAriaSliderBounds(this._track, this.min, this.max);
+ this.value = positionMs;
+ this._updateValues()
+ }
+ }, _scrollPositionChanged: function _scrollPositionChanged() {
+ if (this.disabled)
+ return;
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ var percentage = (scrollableWidth - this._scroller.scrollLeft) / scrollableWidth;
+ var newPosition = (this.max - this.min) * percentage + this.min;
+ this._scrubValue = newPosition;
+ this._scrubValue = this._scrubValue < 0 ? 0 : this._scrubValue;
+ this._scrubValue = this._scrubValue > this.max ? this.max : this._scrubValue
+ }, _captureSeekBarInput: function _captureSeekBarInput(e) {
+ if (e.pointerId && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType)) && this._scroller)
+ this._scroller.msSetPointerCapture(e.pointerId);
+ if (!this.isManipulating) {
+ this.metadataVisible = false;
+ this.isManipulating = true;
+ this._engage()
+ }
+ this._seekBarMove(e)
+ }, _releaseSeekBarInput: function _releaseSeekBarInput(e) {
+ if (this.isManipulating) {
+ this.isManipulating = false;
+ this.metadataVisible = true;
+ if (e.pointerId && this._isTouchPointerType(e.pointerType))
+ this._scrollPositionChanged();
+ else if (e.pointerId && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType)))
+ this._scroller.msReleasePointerCapture(e.pointerId);
+ this._disengage();
+ this._updatePlaybackSession();
+ this._updateValues();
+ this._updateAriaSliderValues(true)
+ }
+ }, _seekBarMove: function _seekBarMove(e, forceUpdate) {
+ if (!this._scroller)
+ return;
+ if (forceUpdate || (this.isManipulating && e.eventPhase === e.AT_TARGET && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType))))
+ if (this.playbackSession && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + 40;
+ else
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + this._musicThumbOffset
+ }, _onPointerEvent: function _onPointerEvent(e) {
+ if (this.disabled)
+ return;
+ switch (e.type) {
+ case "MSManipulationStateChanged":
+ if (e.currentState === e.MS_MANIPULATION_STATE_STOPPED || e.currentState === e.MS_MANIPULATION_STATE_INERTIA) {
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollLeft;
+ this._releaseSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case "MSPointerDown":
+ case "pointerdown":
+ if (!this.playbackSession || !this.playbackSession.canSeek)
+ return;
+ if (e.eventPhase === e.AT_TARGET) {
+ if (this._scroller) {
+ var offset = 0;
+ if (!MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ offset = this._cachedValues._thumbWidth;
+ else
+ offset = this._musicThumbOffset;
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + offset
+ }
+ this._scrollPositionChanged();
+ this.value = this._scrubValue;
+ this._updateValues();
+ this._updateAriaSliderValues(true);
+ this._updatePlaybackSession();
+ this._releaseSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case "MSPointerUp":
+ case "pointerup":
+ case "MSPointerCancel":
+ case "pointercancel":
+ this._releaseSeekBarInput(e);
+ e.cancelBubble = true;
+ break;
+ case "MSPointerMove":
+ case "pointermove":
+ this._seekBarMove(e);
+ e.cancelBubble = true;
+ e.stopImmediatePropagation();
+ break
+ }
+ }, _onKeyDownEvent: function _onKeyDownEvent(e) {
+ if (this.disabled)
+ return;
+ if (e && this.playbackSession && this.playbackSession.canSeek) {
+ var newPositionMs = this.value;
+ if (e.keyCode === WinJS.Utilities.Key.leftArrow) {
+ this._isKeyDownOnThumb = true;
+ if (e.ctrlKey)
+ newPositionMs -= this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.ctrlSkipPercentage);
+ else if (e.shiftKey)
+ newPositionMs -= MS.Entertainment.UI.Controls.SeekBar.shiftSkipMs;
+ else
+ newPositionMs -= this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.defaultSkipPercentage)
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow) {
+ this._isKeyDownOnThumb = true;
+ if (e.ctrlKey)
+ newPositionMs += this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.ctrlSkipPercentage);
+ else if (e.shiftKey)
+ newPositionMs += MS.Entertainment.UI.Controls.SeekBar.shiftSkipMs;
+ else
+ newPositionMs += this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.defaultSkipPercentage)
+ }
+ if (newPositionMs !== this.value) {
+ this.value = newPositionMs;
+ this._updateValues();
+ this._updateAriaSliderValues(true);
+ this._updatePlaybackSession();
+ e.preventDefault()
+ }
+ }
+ }, _onKeyUpEvent: function _onKeyUpEvent(e) {
+ if (this.disabled)
+ return;
+ this._isKeyDownOnThumb = false
+ }, _engage: function _engage() {
+ WinJS.Utilities.addClass(this._thumb, "seekBarThumbEngaged");
+ WinJS.Utilities.addClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (this.playbackSession && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ WinJS.Utilities.addClass(this._track, "seekBarTrackEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = false;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = false
+ }
+ window.requestAnimationFrame(this._renderLoop)
+ }, _disengage: function _disengage() {
+ WinJS.Utilities.removeClass(this._thumb, "seekBarThumbEngaged");
+ WinJS.Utilities.removeClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (this.playbackSession && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ WinJS.Utilities.removeClass(this._track, "seekBarTrackEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = true;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = true
+ }
+ this.value = this._scrubValue
+ }, _percentageToMilliseconds: function _percentageToMilliseconds(percentage) {
+ percentage = percentage < 0 ? 0 : percentage;
+ percentage = percentage > 100 ? 100 : percentage;
+ return this.min + ((percentage * (this.max - this.min)) / 100)
+ }, _millisecondsToDecimal: function _millisecondsToDecimal(milliseconds) {
+ milliseconds = milliseconds < 0 ? 0 : milliseconds;
+ milliseconds = milliseconds > this.max ? this.max : milliseconds;
+ var newPosition = (milliseconds - this.min) / (this.max - this.min);
+ newPosition = isNaN(newPosition) ? 0 : newPosition;
+ return newPosition
+ }, _millisecondsToPercentage: function _millisecondsToPercentage(milliseconds) {
+ return (this._millisecondsToDecimal(milliseconds) * 100) + "%"
+ }, _updatePlaybackSession: function _updatePlaybackSession() {
+ if (this.playbackSession !== null)
+ try {
+ this.playbackSession.seekToPosition(this.value)
+ }
+ catch (err) { }
+ }, _lastUpdate: 0, _renderLoop: function _renderLoop() {
+ if ((new Date) - this._lastUpdate > 20) {
+ this._lastUpdate = new Date;
+ this._updateValues();
+ this._updateAriaSliderValues(true)
+ }
+ if (this.isManipulating)
+ window.requestAnimationFrame(this._renderLoop)
+ }, _updateValues: function _updateValues() {
+ if (!this._initialized || this.frozen || !this.playbackSession || !this.playbackSession.currentMedia)
+ return;
+ var durationText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.max);
+ this.seekBarDurationText = durationText ? "/" + durationText : String.empty;
+ if (this.isManipulating) {
+ var scrubValueText = MS.Entertainment.Utilities.millisecondsToTimeCode(this._scrubValue);
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ this._thumbText.textContent = scrubValueText + this.seekBarDurationText;
+ else
+ this._thumbText.textContent = scrubValueText
+ }
+ else {
+ this.value = this.value < 0 ? 0 : this.value;
+ this.value = this.value > this.max ? this.max : this.value;
+ if (this._cachedValues._trackWidth > 0 && this.seekBarFill)
+ this.seekBarFill.style.msTransform = "scaleX(" + this._millisecondsToDecimal(this.value) + ")";
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth));
+ this.seekBarPositionText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.value);
+ this.thumbVisible = (this.metadataVisible || this.isManipulating || this._uiStateService.isSnapped) && this.playbackSession && this.playbackSession.canSeek
+ }
+ if (this.metadataVisible !== this.isManipulating ? false : this.metadataVisible)
+ this.metadataVisible = this.isManipulating ? false : this.metadataVisible
+ }, _updateAriaSliderValues: function _updateAriaSliderValues(alwaysUpdate) {
+ if (alwaysUpdate || (new Date) - this._lastAriaSliderUpdate > MS.Entertainment.UI.Controls.SeekBar.ariaUpdateDelayMs) {
+ MS.Entertainment.Framework.AccUtils.setAriaSliderPosition(this._track, this.value, this.seekBarPositionText);
+ this._lastAriaSliderUpdate = new Date
+ }
+ }, _isTouchPointerType: function _isTouchPointerType(pointerType) {
+ return pointerType === 2 || pointerType === "touch"
+ }, _isPenPointerType: function _isPenPointerType(pointerType) {
+ return pointerType === 3 || pointerType === "pen"
+ }, _isMousePointerType: function _isMousePointerType(pointerType) {
+ return pointerType === 4 || pointerType === "mouse"
+ }
+ }, {
+ disabled: false, min: 0, max: 100, value: 0, seekBarDurationText: "", seekBarPositionText: "", nowPlayingText: "", isManipulating: false, metadataVisible: true, thumbVisible: true, playbackSession: null, frozen: false
+ }, {
+ ariaUpdateDelayMs: 5000, shiftSkipMs: 1000, ctrlSkipPercentage: 20, defaultSkipPercentage: 5
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ PlaybackSeekBar: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.SeekBar", "/Controls/TransportControls/SeekBar.html#playbackSeekBarTemplate", function (element, options) {
+ this._renderLoop = this._renderLoop.bind(this);
+ this._updateSize = this._updateSize.bind(this);
+ this._cachedValues = {
+ _trackWidth: 0, _seekbarPosition: 0, _thumbWidth: 0, msScrollLimitXMax: 0
+ }
+ }, {
+ _seekbarThumbOffset: 30, initialize: function initialize() {
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this.bind("metadataVisible", this._updateValues.bind(this));
+ this.bind("visibility", this._visibilityChanged.bind(this));
+ var handlePointerEvent = this._onPointerEvent.bind(this);
+ this._thumb.addEventListener("keydown", this._onKeyDownEvent.bind(this), true);
+ this._thumb.addEventListener("keyup", this._onKeyUpEvent.bind(this), true);
+ this._scroller.addEventListener("MSPointerDown", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerUp", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerMove", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerdown", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerup", handlePointerEvent, true);
+ this._scroller.addEventListener("pointermove", handlePointerEvent, true);
+ this._scroller.addEventListener("MSManipulationStateChanged", handlePointerEvent, true);
+ this._scroller.addEventListener("scroll", this._scrollPositionChanged.bind(this), true);
+ this._scroller.addEventListener("MSHoldVisual", function (e) {
+ e.preventDefault()
+ });
+ MS.Entertainment.Utilities.attachResizeEvent(this.domElement, this._updateSize);
+ this.updateScrollerState();
+ this._initialized = true
+ }, _updateSize: function _updateSize() {
+ if (this._track) {
+ this._cachedValues._seekbarPosition = WinJS.Utilities.getPosition(this._track);
+ this._cachedValues._trackWidth = this._track.clientWidth
+ }
+ if (this._thumb)
+ this._cachedValues._thumbWidth = this._thumb.clientWidth;
+ if (this._scroller) {
+ this._scroller.style.msScrollLimitXMin = "0px";
+ var msScrollLimitXMax = this._scroller.clientWidth - 2 * this._seekbarThumbOffset;
+ msScrollLimitXMax = (msScrollLimitXMax > 0) ? msScrollLimitXMax : 0;
+ this._scroller.style.msScrollLimitXMax = msScrollLimitXMax + "px";
+ this._cachedValues.msScrollLimitXMax = this._scroller.style.msScrollLimitXMax;
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth))
+ }
+ this._mediaPositionChanged()
+ }, _updateValues: function _updateValues() {
+ if (!this._initialized || this.frozen || !this.playbackSession || !this.playbackSession.currentMedia)
+ return;
+ this.metadataVisible = true;
+ var durationText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.max);
+ this.seekBarDurationText = durationText ? durationText : String.empty;
+ if (this.isManipulating) {
+ var scrubValueText = MS.Entertainment.Utilities.millisecondsToTimeCode(this._scrubValue);
+ this._thumbText.textContent = scrubValueText
+ }
+ else {
+ this.value = this.value < 0 ? 0 : this.value;
+ this.value = this.value > this.max ? this.max : this.value;
+ if (this._cachedValues._trackWidth > 0 && this.seekBarFill)
+ this.seekBarFill.style.msTransform = "scaleX(" + this._millisecondsToDecimal(this.value) + ")";
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth));
+ this.seekBarPositionText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.value);
+ this.thumbVisible = this.playbackSession && this.playbackSession.canSeek
+ }
+ }, _engage: function _engage() {
+ WinJS.Utilities.addClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = false;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = false
+ }
+ window.requestAnimationFrame(this._renderLoop)
+ }, _disengage: function _disengage() {
+ WinJS.Utilities.removeClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = true;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = true
+ }
+ this.value = this._scrubValue
+ }, _updatePosition: function _updatePosition() {
+ if (this.frozen || !this.playbackSession)
+ return;
+ var durationMs = this.playbackSession.duration;
+ if (!durationMs || typeof durationMs !== "number" || isNaN(durationMs))
+ if (this.playbackSession.currentMedia && typeof this.playbackSession.currentMedia.duration === "number" && !isNaN(this.playbackSession.currentMedia.duration))
+ durationMs = this.playbackSession.currentMedia.duration;
+ else if (this.playbackSession.currentMedia && this.playbackSession.currentMedia.duration.getSeconds && this.playbackSession.currentMedia.duration.getMinutes)
+ durationMs = 1000 * (this.playbackSession.currentMedia.duration.getSeconds() + 60 * this.playbackSession.currentMedia.duration.getMinutes());
+ else
+ durationMs = 0;
+ durationMs = (durationMs > 0) ? durationMs : 0;
+ var positionMs = this.playbackSession.currentPosition;
+ if (!positionMs || typeof positionMs !== "number" || isNaN(positionMs))
+ positionMs = 0;
+ positionMs = Math.min(durationMs, positionMs);
+ this.max = durationMs;
+ this.min = 0;
+ if (!this.isManipulating && !this._isKeyDownOnThumb) {
+ MS.Entertainment.Framework.AccUtils.setAriaSliderBounds(this._track, this.min, this.max);
+ this.value = positionMs;
+ this._updateValues()
+ }
+ }, initializeDuration: function initializeDuration() {
+ if (this.max === 0)
+ this._updatePosition()
+ }, _seekBarMove: function _seekBarMove(e, forceUpdate) {
+ if (!this._scroller)
+ return;
+ if (forceUpdate || (this.isManipulating && e.eventPhase === e.AT_TARGET && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType))))
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + this._seekbarThumbOffset
+ }, _onPointerEvent: function _onPointerEvent(e) {
+ if (this.disabled)
+ return;
+ switch (e.type) {
+ case "MSManipulationStateChanged":
+ if (e.currentState === e.MS_MANIPULATION_STATE_STOPPED || e.currentState === e.MS_MANIPULATION_STATE_INERTIA) {
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollLeft;
+ this._releaseSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case "MSPointerDown":
+ case "pointerdown":
+ if (!this.playbackSession || !this.playbackSession.canSeek)
+ return;
+ if (event.button === 2)
+ return;
+ if (e.eventPhase === e.AT_TARGET) {
+ if (this._scroller) {
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + this._seekbarThumbOffset;
+ { }
+ }
+ this._scrollPositionChanged();
+ this.value = this._scrubValue;
+ this._updateValues();
+ this._updateAriaSliderValues(true);
+ this._updatePlaybackSession();
+ this._captureSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case "MSPointerUp":
+ case "pointerup":
+ case "MSPointerCancel":
+ case "pointercancel":
+ this._releaseSeekBarInput(e);
+ e.cancelBubble = true;
+ break;
+ case "MSPointerMove":
+ case "pointermove":
+ this._seekBarMove(e);
+ break
+ }
+ }, updateScrollerState: function updateScrollerState() {
+ if (!this._scroller)
+ return;
+ if (this.disabled)
+ WinJS.Utilities.addClass(this._scroller, "seekBar-scrollerDisabled");
+ else
+ WinJS.Utilities.removeClass(this._scroller, "seekBar-scrollerDisabled")
+ }, _updateAriaSliderValues: function _updateAriaSliderValues(alwaysUpdate) {
+ if (alwaysUpdate || (new Date) - this._lastAriaSliderUpdate > MS.Entertainment.UI.Controls.SeekBar.ariaUpdateDelayMs) {
+ var ariaPositionText = this.seekBarPositionText;
+ if (ariaPositionText === String.load(String.id.IDS_TIME_DISPLAY_ZERO))
+ ariaPositionText = String.load(String.id.IDS_TIME_ARIA_ZERO);
+ MS.Entertainment.Framework.AccUtils.setAriaSliderPosition(this._thumb, this.value, ariaPositionText);
+ this._lastAriaSliderUpdate = new Date
+ }
+ }
+ })
+ })
+ })()
+})();
+/* >>>>>>/controls/transportcontrols/musictransportcontrols.js:47146 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Controls;
+ (function (Controls) {
+ var TransportStates = MS.Entertainment.Platform.Playback.TransportState;
+ var MusicTransportControls = (function (_super) {
+ __extends(MusicTransportControls, _super);
+ function MusicTransportControls(element, options) {
+ _super.call(this, element, options);
+ this._seekBar = null;
+ this._optionsFlyout = null;
+ this.skipNextEnabled = false;
+ this.skipBackEnabled = false;
+ this.playPauseEnabled = false;
+ this.volumeEnabled = false;
+ this.optionsEnabled = false;
+ this.shuffleEnabled = true;
+ this.repeatEnabled = true;
+ this._isPlaying = false;
+ this._isInitialized = false;
+ this._pageContainerLoaded = false;
+ this._optionsInitialized = false;
+ this._isAudioAd = false;
+ this._volumeOverlay = null;
+ this._dateTimeFormatters = null;
+ this._sessionMgr = null;
+ this._volumeControllerService = null;
+ this._eventHandlers = null;
+ this._volumeStateBinds = null;
+ this._playToStateBinds = null;
+ this._appBarEvents = null;
+ this.deferredUpdateTimeout = 100;
+ this._albumArtSize = 70;
+ this._defaultAlbumArtUri = MS.Entertainment.UI.ImagePaths.genericMusicSmall
+ }
+ MusicTransportControls.prototype.initialize = function () { };
+ MusicTransportControls.prototype.deferredInitialize = function () {
+ var _this = this;
+ MS.Entertainment.UI.Framework.processDeclarativeControlContainer(this);
+ this._delayInitializeScripts = WinJS.UI.Fragments.renderCopy("/Controls/TransportControls/MusicTransportControlDependencies.html").then(null, function (error) {
+ MS.Entertainment.UI.Controls.assert(WinJS.Promise.isCanceledError(error), "Failed to load delayed scripts. error: " + (error && error.message))
+ }).then(function () {
+ if (_this._unloaded)
+ return;
+ _this._delayInitializeScripts = null;
+ _this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ _this._skipBackButton.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON));
+ _this._skipNextButton.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_NEXT_BUTTON));
+ _this._optionsButton.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON));
+ _this._playbackSession = _this._sessionMgr.primarySession;
+ _this._playbackSessionChanged();
+ MS.Entertainment.Utilities.attachResizeEvent(_this.domElement, _this._onResize.bind(_this));
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService)) {
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ _this._volumeControllerService = volumeControllerService;
+ _this._volumeStateBinds = WinJS.Binding.bind(volumeControllerService, {
+ volume: _this._onVolumeValueChange.bind(_this), mute: _this._onMuteStateChange.bind(_this), isAudioEndpointAvailable: _this._onAudioEndpointChange.bind(_this)
+ })
+ }
+ _this._playToStateBinds = WinJS.Binding.bind(_this._playbackSession, { isRemoteSessionRunning: _this._playToStateChanged.bind(_this) });
+ _this._updateVolume();
+ _this._isInitialized = true
+ })
+ };
+ MusicTransportControls.prototype.attachToAppBar = function () {
+ var _this = this;
+ var appBarElement = document.querySelector("[data-win-control='WinJS.UI.AppBar']");
+ if (appBarElement && appBarElement.winControl)
+ this._appBarEvents = UI.Framework.addEventHandlers(appBarElement.winControl, {
+ beforeshow: function () {
+ _this.suppressTabbing()
+ }, afterhide: function () {
+ _this.restoreTabbing()
+ }
+ })
+ };
+ MusicTransportControls.prototype.suppressTabbing = function () {
+ if (!this._isInitialized)
+ return;
+ MS.Entertainment.Framework.ScriptUtilities.suppressTabbing(this.domElement)
+ };
+ MusicTransportControls.prototype.restoreTabbing = function () {
+ if (!this._isInitialized)
+ return;
+ MS.Entertainment.Framework.ScriptUtilities.restoreTabbing(this.domElement)
+ };
+ MusicTransportControls.prototype._updateOptions = function () {
+ this._updateShuffleButton();
+ this._updateRepeatButton()
+ };
+ MusicTransportControls.prototype._initializeOptions = function () {
+ if (!this._optionsFlyout) {
+ this._optionsFlyout = document.querySelector(".controls-optionsFlyout").winControl;
+ if (!this._optionsFlyout) {
+ MS.Entertainment.UI.Controls.fail("Failed to initialize options menu.");
+ return false
+ }
+ }
+ this._optionsInitialized = true;
+ var flyout = this._optionsFlyout.element;
+ document.body.appendChild(flyout);
+ this._updateOptions();
+ return true
+ };
+ MusicTransportControls.prototype._onResize = function () {
+ if (!this._unloaded && this._volumeOverlay) {
+ this._volumeOverlay.hide();
+ this._volumeOverlay = null
+ }
+ };
+ MusicTransportControls.prototype._updateVolume = function () {
+ if (!this._volumeControllerService || !this._volumeButton || !this._volumeText)
+ return;
+ this.volumeEnabled = false;
+ if (this._volumeControllerService.isAudioEndpointAvailable) {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-xbox-volumeDisabled");
+ if (this._volumeControllerService.mute) {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-win-volume");
+ WinJS.Utilities.addClass(this._volumeButton, "icon-win-mute");
+ this._volumeContainer.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON))
+ }
+ else {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-win-mute");
+ WinJS.Utilities.addClass(this._volumeButton, "icon-win-volume");
+ var formattedValue = this._formatNumber(Math.round(this._volumeControllerService.volume * 100));
+ this._volumeContainer.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON).format(formattedValue))
+ }
+ this.volumeEnabled = true;
+ this._updateVolumeText(this._volumeControllerService.volume)
+ }
+ else {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-win-volume icon-win-mute");
+ WinJS.Utilities.addClass(this._volumeButton, "icon-xbox-volumeDisabled");
+ this._volumeText.textContent = String.empty
+ }
+ };
+ MusicTransportControls.prototype._onVolumeValueChange = function (newValue) {
+ if (this._unloaded)
+ return;
+ if (this._volumeText && this._volumeControllerService.isAudioEndpointAvailable)
+ this._updateVolumeText(newValue)
+ };
+ MusicTransportControls.prototype._updateVolumeText = function (volumeLevel) {
+ if (this._unloaded)
+ return;
+ if (this._volumeText) {
+ var roundedLevel = (this._volumeControllerService.mute) ? 0 : Math.round(volumeLevel * 100);
+ this._volumeText.textContent = this._formatNumber(roundedLevel)
+ }
+ };
+ MusicTransportControls.prototype._onMuteStateChange = function (newState) {
+ if (this._unloaded)
+ return;
+ this._updateVolume()
+ };
+ MusicTransportControls.prototype._onAudioEndpointChange = function (newValue) {
+ if (this._unloaded)
+ return;
+ this._updateVolume()
+ };
+ MusicTransportControls.prototype._playToStateChanged = function (newState) {
+ if (this._unloaded)
+ return;
+ this._updateVolume();
+ this._updateButton(this._volumeButton, this.volumeEnabled)
+ };
+ MusicTransportControls.prototype._updateStates = function () {
+ if (this._deferredUpdateTimer || this._unloaded)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(this.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ };
+ MusicTransportControls.prototype._updateStatesDeferred = function () {
+ this._deferredUpdateTimer = null;
+ if (!this._unloaded) {
+ this._updateIcons();
+ this._updateMetadata()
+ }
+ };
+ MusicTransportControls.prototype._updateIcons = function () {
+ var _this = this;
+ if (this._unloaded)
+ return;
+ if (!this._playbackSession || !this._playbackSession.currentMedia) {
+ this.skipBackEnabled = false;
+ this.skipNextEnabled = false;
+ this.playPauseEnabled = false;
+ this._isPlaying = false;
+ this.optionsEnabled = false;
+ this.shuffleEnabled = false;
+ this.repeatEnabled = false;
+ this._isAudioAd = false
+ }
+ else {
+ this.skipBackEnabled = this._playbackSession.canSkipBackward;
+ this.skipNextEnabled = this._playbackSession.canSkipForward;
+ this.playPauseEnabled = true;
+ this._isPlaying = !(this._playbackSession.targetTransportState === TransportStates.unInitialize || this._playbackSession.targetTransportState === TransportStates.paused || this._playbackSession.targetTransportState === TransportStates.stopped);
+ this.optionsEnabled = true;
+ this.shuffleEnabled = this._playbackSession.canShuffle;
+ this.repeatEnabled = this._playbackSession.canRepeat;
+ this._isAudioAd = this._playbackSession.isAudioAd
+ }
+ if (this._isAudioAd) {
+ WinJS.Utilities.addClass(this._playbackControls, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._playbackAdControls, "removeFromDisplay")
+ }
+ else {
+ WinJS.Utilities.addClass(this._playbackAdControls, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._playbackControls, "removeFromDisplay")
+ }
+ this._updateVolume();
+ this._updateButton(this._skipBackButton, this.skipBackEnabled && !this._isAudioAd);
+ this._updateButton(this._playPauseButton, this.playPauseEnabled && !this._isAudioAd);
+ this._updateButton(this._skipNextButton, this.skipNextEnabled && !this._isAudioAd);
+ this._updateButton(this._volumeButton, this.volumeEnabled && !this._isAudioAd);
+ this._updateButton(this._volumeContainer, this.volumeEnabled && !this._isAudioAd);
+ this._updateButton(this._optionsButton, this.optionsEnabled && !this._isAudioAd);
+ this._updateButton(this._shuffleButton, this.shuffleEnabled && !this._isAudioAd);
+ this._updateButton(this._repeatButton, this.repeatEnabled && !this._isAudioAd);
+ this._updateButton(this._flyoutShuffleButton, this.shuffleEnabled && !this._isAudioAd);
+ this._updateButton(this._flyoutRepeatButton, this.repeatEnabled && !this._isAudioAd);
+ this._updateButton(this._playPauseAdButton, this.playPauseEnabled && this._isAudioAd);
+ this._updateButton(this._upsellButton, this._isAudioAd);
+ this._updateShuffleButton();
+ this._updateRepeatButton();
+ if (this._playbackSession && this._playbackSession.currentMedia) {
+ if (!this._seekBar) {
+ this._seekBarContainer.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.PlaybackSeekBar");
+ this._seekBar = new MS.Entertainment.UI.Controls.PlaybackSeekBar(this._seekBarContainer, {});
+ this._seekBar.playbackSession = this._playbackSession;
+ this._seekBar.disabled = true;
+ this._seekBar.initializeDuration()
+ }
+ WinJS.Utilities.removeClass(this._seekBar.domElement, "hideFromDisplay")
+ }
+ else if (this._seekBar)
+ WinJS.Utilities.addClass(this._seekBar.domElement, "hideFromDisplay");
+ if (this._playbackSession.targetTransportState && this._playbackSession.targetTransportState !== TransportStates.unInitialize && this._seekBar && !this._isAudioAd)
+ this._seekBar.disabled = false;
+ if (this._seekBar)
+ this._seekBar.updateScrollerState();
+ var playPauseButtons = [this._playPauseButton, this._playPauseAdButton];
+ playPauseButtons.forEach(function (playPauseButton) {
+ if (_this._isPlaying) {
+ WinJS.Utilities.removeClass(playPauseButton, "icon-win-play");
+ WinJS.Utilities.addClass(playPauseButton, "icon-win-pause");
+ playPauseButton.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON))
+ }
+ else {
+ WinJS.Utilities.removeClass(playPauseButton, "icon-win-pause");
+ WinJS.Utilities.addClass(playPauseButton, "icon-win-play");
+ playPauseButton.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_BUTTON))
+ }
+ })
+ };
+ MusicTransportControls.prototype._updateMetadata = function () {
+ if (this._unloaded)
+ return;
+ if (this._playbackSession.currentMedia) {
+ this._metadataTitle.textContent = this._playbackSession.currentMedia.title;
+ this._metadataSubtitle.textContent = this._playbackSession.currentMedia.artistName;
+ if (!MS.Entertainment.UI.Shell.ImageLoader.isBlobUrl(this._playbackSession.currentMedia.imageUri))
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(this._playbackSession.currentMedia, this._albumArtSize, this._albumArtSize).done(this._updateAlbumArt.bind(this), this._errorAlbumArt.bind(this));
+ else
+ this._fetchAlbumArtFromFile();
+ this._show(this._metadataTitle);
+ if (this._isAudioAd) {
+ this._metadataAudioAdReason.href = MS.Entertainment.UI.FWLink.advertisementReason;
+ this._metadataAudioAdReason.textContent = String.load(String.id.IDS_MUSIC_STREAMING_AD_DESC_LINK);
+ if (this._metadataContainer.element)
+ this._metadataContainer.element.tabIndex = -1;
+ this._metadataContainer.draggable = false;
+ this._show(this._metadataAudioAdReason);
+ this._hide(this._metadataSubtitle)
+ }
+ else {
+ this._metadataAudioAdReason.href = String.empty;
+ this._metadataAudioAdReason.textContent = String.empty;
+ if (this._metadataContainer.element)
+ this._metadataContainer.element.tabIndex = 0;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._metadataContainer.draggable = configurationManager.shell.dragAndDropEnabled;
+ this._show(this._metadataSubtitle);
+ this._hide(this._metadataAudioAdReason)
+ }
+ this._show(this._metadataContainer && this._metadataContainer.element)
+ }
+ else {
+ this._hide(this._metadataContainer && this._metadataContainer.element);
+ this._hide(this._metadataTitle);
+ this._hide(this._metadataSubtitle);
+ this._hide(this._metadataAlbumArt);
+ this._hide(this._metadataAudioAdReason)
+ }
+ };
+ MusicTransportControls.prototype._fetchAlbumArtFromFile = function () {
+ var _this = this;
+ if (!this._playbackSession || !this._playbackSession.currentMedia || !this._playbackSession.currentMedia.fileItem) {
+ this._errorAlbumArt();
+ return
+ }
+ var fileItem = this._playbackSession.currentMedia.fileItem;
+ fileItem.getThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.musicView, this._albumArtSize).then(function (thumbnail) {
+ //if (thumbnail && thumbnail.type !== Windows.Storage.FileProperties.ThumbnailType.icon) {
+ var uri = MS.Entertainment.Data.Factory.oneTimeUseBlob(thumbnail);
+ _this._updateAlbumArt(uri)
+ //}
+ //else
+ // _this._errorAlbumArt()
+ }, function (error) {
+ _this._errorAlbumArt()
+ })
+ };
+ MusicTransportControls.prototype._updateAlbumArt = function (uri) {
+ if (this._unloaded)
+ return;
+ this._metadataAlbumArt.src = uri;
+ this._show(this._metadataAlbumArt)
+ };
+ MusicTransportControls.prototype._errorAlbumArt = function (err) {
+ if (this._unloaded)
+ return;
+ if (this._playbackSession && this._playbackSession.currentMedia) {
+ this._metadataAlbumArt.src = this._defaultAlbumArtUri;
+ this._show(this._metadataAlbumArt)
+ }
+ else
+ this._hide(this._metadataAlbumArt)
+ };
+ MusicTransportControls.prototype._applyBindings = function () {
+ this._detachBindings();
+ var updateStatesFunction = this._updateStates.bind(this);
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this._playbackSession, {
+ currentTitleIdChanged: updateStatesFunction, playerStateChanged: updateStatesFunction, currentMediaChanged: updateStatesFunction, currentTransportStateChanged: updateStatesFunction, shuffleChanged: updateStatesFunction, repeatChanged: updateStatesFunction, canSkipBackwardChanged: updateStatesFunction, canSkipForwardChanged: updateStatesFunction, playbackRateChanged: updateStatesFunction, canControlMediaChanged: updateStatesFunction, canTransferChanged: updateStatesFunction, isAudioAdChanged: updateStatesFunction
+ })
+ };
+ MusicTransportControls.prototype._detachBindings = function () {
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ };
+ MusicTransportControls.prototype.unload = function () {
+ this._unloaded = true;
+ this._detachBindings();
+ if (this._volumeStateBinds) {
+ this._volumeStateBinds.cancel();
+ this._volumeStateBinds = null
+ }
+ if (this._playToStateBinds) {
+ this._playToStateBinds.cancel();
+ this._playToStateBinds = null
+ }
+ if (this._appBarEvents) {
+ this._appBarEvents.cancel();
+ this._appBarEvents = null
+ }
+ if (this._delayInitializeScripts) {
+ this._delayInitializeScripts.cancel();
+ this._delayInitializeScripts = null
+ }
+ };
+ MusicTransportControls.prototype._playbackSessionChanged = function () {
+ if (this._playbackSession)
+ this._applyBindings();
+ this._updateStates()
+ };
+ MusicTransportControls.prototype._metadataAdReasonClick = function (event) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.adService)) {
+ var adService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ adService.sendAudioAdReasonClickTelemetryInfo()
+ }
+ event.stopPropagation()
+ };
+ MusicTransportControls.prototype._metadataAdReasonKeyDown = function (event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter)
+ this._metadataAdReasonClick(event)
+ };
+ MusicTransportControls.prototype._upsellClick = function () {
+ if (!this._playbackSession)
+ return;
+ MS.Entertainment.Framework.ScriptUtilities.waitForSnappedIfNeeded().done(function () {
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.appBarSubscriptionSignup, String.load(String.id.IDS_MUSIC_STREAMING_UPSELL_LABEL));
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var signupAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionSignup);
+ signupAction.automationId = String.id.IDS_MUSIC_GET_A_SUBSCRIPTION_TEXT;
+ signupAction.execute()
+ }, function (error) {
+ MS.Entertainment.UI.Controls.assert(WinJS.Promise.isCanceledError(error), "MusicTransportControls::_upsellClick: Failed to wait to snapped. Error:" + error + ": " + error.message)
+ })
+ };
+ MusicTransportControls.prototype._metadataKeyDown = function (event) {
+ switch (event.keyCode) {
+ case WinJS.Utilities.Key.enter:
+ case WinJS.Utilities.Key.space:
+ this._metadataClick();
+ break
+ }
+ };
+ MusicTransportControls.prototype._volumeKeyDown = function (event) {
+ switch (event.keyCode) {
+ case WinJS.Utilities.Key.enter:
+ case WinJS.Utilities.Key.space:
+ this._volumeClick();
+ break
+ }
+ };
+ MusicTransportControls.prototype._metadataDragStart = function (eventInfo) {
+ var dragDataPromise;
+ if (this._playbackSession && this._playbackSession.currentMedia)
+ dragDataPromise = WinJS.Promise.as({ data: this._playbackSession.currentMedia });
+ if (dragDataPromise && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.dragData)) {
+ var dragDataService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dragData);
+ dragDataService.startDrag(dragDataPromise)
+ }
+ };
+ MusicTransportControls.prototype._metadataDragEnd = function (eventInfo) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.dragData)) {
+ var dragDataService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dragData);
+ dragDataService.finishDrag()
+ }
+ };
+ MusicTransportControls.prototype._metadataClick = function () {
+ if (!this._playbackSession)
+ return;
+ if (this._playbackSession.currentMedia !== null && this._playbackSession.currentOrdinal === null)
+ this._playbackSession.activate(document.createElement("div"));
+ if (this._playbackSession.currentMedia && this._playbackSession.currentMedia.album) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var albumDetailsNavigateAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate);
+ var hasLibraryId = MS.Entertainment.Utilities.isValidLibraryId(this._playbackSession.currentMedia.album.libraryId);
+ albumDetailsNavigateAction.parameter = {
+ data: hasLibraryId ? this._playbackSession.currentMedia.album.libraryId : this._playbackSession.currentMedia.album.serviceId, location: hasLibraryId ? MS.Entertainment.Data.ItemLocation.collection : MS.Entertainment.Data.ItemLocation.marketplace
+ };
+ albumDetailsNavigateAction.execute()
+ }
+ this._updateStates()
+ };
+ MusicTransportControls.prototype._skipBackClick = function () {
+ if (!this._playbackSession || !this.skipBackEnabled || !this._playbackSession.canSkipBackward)
+ return;
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportSkipBack, String.load(String.id.IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON));
+ MS.Entertainment.Utilities.Telemetry.logPreviousClicked(this._skipBackButton.className);
+ this._playbackSession.skipBack()
+ };
+ MusicTransportControls.prototype._skipNextClick = function () {
+ if (!this._playbackSession || !this.skipNextEnabled || !this._playbackSession.canSkipForward)
+ return;
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportSkipForward, String.load(String.id.IDS_TRANSPORT_CONTROLS_NEXT_BUTTON));
+ MS.Entertainment.Utilities.Telemetry.logNextClicked(this._skipNextButton.className);
+ this._playbackSession.skipFwd()
+ };
+ MusicTransportControls.prototype._playPauseClick = function (e) {
+ if (!this._playbackSession || !this.playPauseEnabled)
+ return;
+ if (this._playbackSession.targetTransportState !== TransportStates.playing) {
+ var isCurrentStateStoppedByError = (this._playbackSession.currentTransportState === TransportStates.stopped) && !!this._playbackSession.errorDescriptor;
+ if (this._playbackSession.currentMedia && (this._playbackSession.currentOrdinal === null || isCurrentStateStoppedByError))
+ this._playbackSession.activate(document.createElement("div"), this._playbackSession.pendingOrdinal);
+ else
+ this._playbackSession.targetTransportState = TransportStates.playing;
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportPlay, String.load(MS.Entertainment.UI.Controls.TransportControls.playButtonStringId));
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked(this._playPauseButton.className)
+ }
+ else {
+ this._playbackSession.targetTransportState = TransportStates.paused;
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportPause, String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON));
+ MS.Entertainment.Utilities.Telemetry.logPauseClicked(this._playPauseButton.className)
+ }
+ };
+ MusicTransportControls.prototype._volumeClick = function () {
+ var _this = this;
+ if (!this.volumeEnabled)
+ return;
+ var position = WinJS.Utilities.getPosition(this._volumeContainer);
+ var distanceFromBottom = (MS.Entertainment.Utilities.getWindowHeight() - position.top);
+ var left = (position.left >= 0 && position.width >= 0) ? (position.left + Math.round((0.5 * position.width) - 33)) + "px" : "auto";
+ var top = "auto";
+ var right = "auto";
+ var bottom = "77px";
+ var customStyle = "volumeContainer";
+ if (!this._volumeOverlay) {
+ this._volumeOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.VolumeBar", {}, {
+ right: right, top: top, left: left, bottom: bottom
+ });
+ this._volumeOverlay.customStyle = customStyle;
+ this._volumeOverlay.enableKeyboardLightDismiss = true;
+ this._volumeOverlay.show().done(function () {
+ _this._volumeOverlay = null
+ }, function () {
+ _this._volumeOverlay = null
+ })
+ }
+ };
+ MusicTransportControls.prototype._optionsClick = function () {
+ if ((!this._optionsInitialized && !this._initializeOptions()) || !this._optionsFlyout)
+ return;
+ this._updateOptions();
+ this._optionsFlyout.show(this._optionsButton);
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportPlaybackOptions, String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON))
+ };
+ MusicTransportControls.prototype._repeatClick = function () {
+ if (this.repeatEnabled && this._playbackSession) {
+ this._playbackSession.repeat = !this._playbackSession.repeat;
+ this._updateRepeatButton();
+ this._updateStates();
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportRepeat, String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON))
+ }
+ };
+ MusicTransportControls.prototype._updateRepeatButton = function () {
+ var sessionRepeat = this._playbackSession && this._playbackSession.canRepeat && this._playbackSession.repeat;
+ var repeatText = sessionRepeat ? String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON);
+ var repeatTooltipText = sessionRepeat ? String.load(String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON);
+ this._flyoutRepeatButton.textContent = repeatText;
+ this._flyoutRepeatButton.setAttribute("aria-label", repeatTooltipText);
+ this._repeatButton.setAttribute("aria-label", repeatTooltipText);
+ this._repeatButton.title = repeatTooltipText;
+ sessionRepeat ? WinJS.Utilities.addClass(this._repeatButton, "repeatButtonOn") : WinJS.Utilities.removeClass(this._repeatButton, "repeatButtonOn")
+ };
+ MusicTransportControls.prototype._shuffleClick = function () {
+ if (this.shuffleEnabled && this._playbackSession) {
+ this._playbackSession.shuffle = !this._playbackSession.shuffle;
+ this._updateShuffleButton();
+ this._updateStates();
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportShuffle, String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON))
+ }
+ };
+ MusicTransportControls.prototype._updateShuffleButton = function () {
+ var sessionShuffle = this._playbackSession && this._playbackSession.canShuffle && this._playbackSession.shuffle;
+ var shuffleText = sessionShuffle ? String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON);
+ var shuffleTooltipText = sessionShuffle ? String.load(String.id.IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON);
+ this._flyoutShuffleButton.textContent = shuffleText;
+ this._flyoutShuffleButton.setAttribute("aria-label", shuffleTooltipText);
+ this._shuffleButton.setAttribute("aria-label", shuffleTooltipText);
+ this._shuffleButton.title = shuffleTooltipText;
+ sessionShuffle ? WinJS.Utilities.addClass(this._shuffleButton, "shuffleButtonOn") : WinJS.Utilities.removeClass(this._shuffleButton, "shuffleButtonOn")
+ };
+ MusicTransportControls.prototype._updateButton = function (button, enable) {
+ if (!button)
+ return;
+ if (enable !== true)
+ button.setAttribute("disabled", "disabled");
+ else
+ button.removeAttribute("disabled")
+ };
+ MusicTransportControls.prototype._hide = function (element) {
+ if (!element)
+ return;
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ };
+ MusicTransportControls.prototype._show = function (element) {
+ if (!element)
+ return;
+ WinJS.Utilities.removeClass(element, "hideFromDisplay")
+ };
+ MusicTransportControls.prototype._formatNumber = function (num) {
+ if (!this._dateTimeFormatters) {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.dateTimeFormatters))
+ return String.empty;
+ this._dateTimeFormatters = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters)
+ }
+ return this._dateTimeFormatters.decimalNumber.format(num)
+ };
+ MusicTransportControls.isDeclarativeControlContainer = true;
+ return MusicTransportControls
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.MusicTransportControls = MusicTransportControls
+ })(Controls = UI.Controls || (UI.Controls = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MusicTransportControls)
+})();
+/* >>>>>>/components/music/playlistflyoutactions.js:47737 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ var CreateFlyoutAction = (function (_super) {
+ __extends(CreateFlyoutAction, _super);
+ function CreateFlyoutAction() {
+ _super.apply(this, arguments);
+ this.action = null;
+ this.referenceContainer = null;
+ this.left = "auto";
+ this.top = "auto";
+ this.right = "auto";
+ this.bottom = "auto";
+ this.flyoutWidth = 0;
+ this.flyoutHeight = 0;
+ this.template = String.empty
+ }
+ CreateFlyoutAction.prototype._clampEdgeInScreen = function (edgeName, flyoutSize, screenSize) {
+ var referenceContainerEdge = this.referenceContainer[edgeName];
+ if (typeof (referenceContainerEdge) === "number" && referenceContainerEdge >= 0) {
+ var edge = referenceContainerEdge;
+ if (flyoutSize)
+ edge = MS.Entertainment.Utilities.getEdgeWithinViewport(edge, flyoutSize, screenSize);
+ this[edgeName] = edge + "px"
+ }
+ else
+ this[edgeName] = "auto"
+ };
+ CreateFlyoutAction.prototype._createUserControlOptions = function (parameter) {
+ return {}
+ };
+ CreateFlyoutAction.prototype.canExecute = function () {
+ return true
+ };
+ CreateFlyoutAction.prototype.executed = function (parameter, referenceDomElement) {
+ var _this = this;
+ var screenWidth = MS.Entertainment.Utilities.getWindowWidth();
+ var screenHeight = MS.Entertainment.Utilities.getWindowHeight();
+ if (!this.referenceContainer && referenceDomElement)
+ this.referenceContainer = { domElement: referenceDomElement };
+ if (this.referenceContainer && this.referenceContainer.domElement) {
+ var paddingFromElement = 10;
+ var boundingRectangle = WinJS.Binding.unwrap(this.referenceContainer).domElement.getBoundingClientRect();
+ var boundingTop = boundingRectangle.top;
+ var anchorPoint = "top";
+ var anchorPosition = Math.round(boundingRectangle.top) + "px";
+ if (this.flyoutHeight && ((boundingTop + this.flyoutHeight) > MS.Entertainment.Utilities.getWindowHeight())) {
+ anchorPoint = "bottom";
+ anchorPosition = "20px"
+ }
+ this[anchorPoint] = anchorPosition;
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft) {
+ var rightEdge = screenWidth - Math.round(boundingRectangle.left) + paddingFromElement;
+ if (this.flyoutWidth)
+ rightEdge = MS.Entertainment.Utilities.getEdgeWithinViewport(rightEdge, this.flyoutWidth, screenWidth);
+ this.right = rightEdge + "px"
+ }
+ else {
+ var leftEdge = Math.round(boundingRectangle.right) + paddingFromElement;
+ if (this.flyoutWidth)
+ leftEdge = MS.Entertainment.Utilities.getEdgeWithinViewport(leftEdge, this.flyoutWidth, screenWidth);
+ this.left = leftEdge + "px"
+ }
+ }
+ else if (this.referenceContainer) {
+ var leftDefined = this.referenceContainer.left >= 0;
+ var rightDefined = this.referenceContainer.right >= 0;
+ MS.Entertainment.UI.Actions.assert(!leftDefined || !rightDefined || !this.flyoutWidth, "Width cannot be used when the left and right edges of the flyout are already defined.");
+ var topDefined = this.referenceContainer.top >= 0;
+ var bottomDefined = this.referenceContainer.bottom >= 0;
+ MS.Entertainment.UI.Actions.assert(!topDefined || !bottomDefined || !this.flyoutHeight, "Height cannot be used when the top and bottom edges of the flyout are already defined.");
+ this._clampEdgeInScreen("left", this.flyoutWidth, screenWidth);
+ this._clampEdgeInScreen("right", this.flyoutWidth, screenWidth);
+ this._clampEdgeInScreen("top", this.flyoutHeight, screenHeight);
+ this._clampEdgeInScreen("bottom", this.flyoutHeight, screenHeight)
+ }
+ var userControlOptions = this._createUserControlOptions ? this._createUserControlOptions(parameter) : {};
+ var overlayOptions = {
+ left: this.left, bottom: this.bottom, right: this.right, top: this.top, dontWaitForContent: true, showAnimation: function () {
+ return WinJS.Promise.as()
+ }
+ };
+ this._openPopup = MS.Entertainment.UI.Shell.createOverlay(this.template, userControlOptions, overlayOptions);
+ return this._openPopup.show().then(function () {
+ _this._openPopup = null
+ })
+ };
+ return CreateFlyoutAction
+ })(Actions.Action);
+ Actions.CreateFlyoutAction = CreateFlyoutAction;
+ var CreatePlaylistAction = (function (_super) {
+ __extends(CreatePlaylistAction, _super);
+ function CreatePlaylistAction() {
+ _super.call(this);
+ this.flyoutWidth = 300;
+ this.flyoutHeight = 175;
+ this.template = "MS.Entertainment.UI.Controls.CreatePlaylistFlyout";
+ this.automationId = MS.Entertainment.UI.AutomationIds.createPlaylist
+ }
+ CreatePlaylistAction.prototype.translateDragAndDropParams = function (source) {
+ return { mediaItems: source && source.data }
+ };
+ CreatePlaylistAction.prototype._createUserControlOptions = function (parameter) {
+ return {
+ actionParameters: parameter, action: this.action || new MS.Entertainment.UI.Actions.Playlists.CreatePlaylistAction
+ }
+ };
+ CreatePlaylistAction.prototype.canExecute = function (param) {
+ var isDTOMarket = false;
+ var mediaItems = param && param.mediaItems;
+ var mediaFromCollection = this._areMediaItemsFromCollection(mediaItems);
+ if (this.isDragAndDropResponse) {
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var featureEnablement = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.featureEnablement);
+ var freeStreamEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay);
+ var marketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var userCanSubscriptionStream = marketplaceEnabled && signedInUserService && signedInUserService.isSubscription;
+ isDTOMarket = marketplaceEnabled && !freeStreamEnabled && !userCanSubscriptionStream
+ }
+ return !MS.Entertainment.UI.Controls.CreatePlaylistFlyout.flyoutOpened && (!isDTOMarket || mediaFromCollection)
+ };
+ CreatePlaylistAction.prototype._areMediaItemsFromCollection = function (mediaItems) {
+ var mediaItem;
+ if (Array.isArray(mediaItems))
+ mediaItem = mediaItems[0];
+ else if (MS.Entertainment.Data.List.isList(mediaItems)) {
+ MS.Entertainment.Data.List.dataFromIndex(mediaItems, 0).done(function (data) {
+ mediaItem = data
+ }, function () {
+ Actions.fail("Failed to get media item from virtual list.")
+ });
+ Actions.assert(mediaItem || mediaItems.count === 0, "Failed to get media item synchronously.")
+ }
+ else if (mediaItems)
+ mediaItem = mediaItems;
+ return !!(mediaItem && mediaItem.fromCollection)
+ };
+ return CreatePlaylistAction
+ })(CreateFlyoutAction);
+ Actions.CreatePlaylistAction = CreatePlaylistAction;
+ var CreatePlaylistActionTextInput = (function (_super) {
+ __extends(CreatePlaylistActionTextInput, _super);
+ function CreatePlaylistActionTextInput() {
+ _super.call(this);
+ this.param = null;
+ this._isExecuting = false;
+ this.automationId = MS.Entertainment.UI.AutomationIds.createPlaylist
+ }
+ CreatePlaylistActionTextInput.prototype.executed = function (param) {
+ var _this = this;
+ param = param || {};
+ this.param = param;
+ var inputPaneInternal = WinJS.Utilities.getMember("UI.ViewManagement.InputPaneInternal", Windows);
+ if (inputPaneInternal) {
+ var inputPaneInternal = inputPaneInternal.getForCurrentView();
+ inputPaneInternal.suggestions.clear()
+ }
+ return MS.Entertainment.UI.Controls.TextInputOverlay.getTextInput({
+ submitText: String.load(String.id.IDS_SAVE_BUTTON), errorSubmitText: String.load(String.id.IDS_PLAYLIST_CREATE_REPLACE), watermark: String.load(String.id.IDS_PLAYLIST_NAME_TITLE), initialText: param.defaultPlaylistName, validateInput: function (playlistName) {
+ return _this._attemptCreatePlaylist(playlistName, false)
+ }, validateError: function (playlistName) {
+ return _this._attemptCreatePlaylist(playlistName, true)
+ }
+ }).then(function (textInput) {
+ if (param.completeAction && textInput)
+ param.completeAction()
+ }, function () { })
+ };
+ CreatePlaylistActionTextInput.prototype._attemptCreatePlaylist = function (playlistName, hadError) {
+ var _this = this;
+ if (this._isExecuting)
+ return WinJS.Promise.as();
+ this._isExecuting = true;
+ var parameters = this.param || {};
+ this.action = this.action || new MS.Entertainment.UI.Actions.Playlists.CreatePlaylistAction;
+ this.action.parameter = this.action.parameter || {};
+ this.action.parameter.name = playlistName;
+ this.action.parameter.playlist = parameters.playlist;
+ this.action.parameter.mediaItems = parameters.mediaItems;
+ this.action.parameter.overwrite = hadError && this.action.supportsOverwrite;
+ this.action.automationId = MS.Entertainment.UI.AutomationIds.playlistNewPlaylistNameEntry;
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ this.action.parameter.completeCallback = function () {
+ signal.complete();
+ _this._isExecuting = false
+ };
+ this.action.parameter.failedCallback = function () {
+ var errorStringId = _this.action.supportsOverwrite ? String.id.IDS_PLAYLIST_CREATE_DUPLICATE_MESSAGE : String.id.IDS_PLAYLIST_EXISTING_NAME;
+ signal.error(new Error(String.load(errorStringId)));
+ _this._isExecuting = false
+ };
+ if (this.action.parameter.overwrite && MS.Entertainment.Utilities.isMusicApp2) {
+ var pinnedList = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.pinnedList);
+ var playlistID = pinnedList.getPlaylistByName(playlistName);
+ if (playlistID) {
+ var mediaItem = {
+ mediaType: Microsoft.Entertainment.Queries.ObjectType.playlist, cloudSyncItemId: playlistID
+ };
+ pinnedList.deletePin(mediaItem)
+ }
+ }
+ this.action.execute();
+ return signal.promise
+ };
+ CreatePlaylistActionTextInput.prototype.canExecute = function () {
+ return !this._isExecuting
+ };
+ return CreatePlaylistActionTextInput
+ })(CreateFlyoutAction);
+ Actions.CreatePlaylistActionTextInput = CreatePlaylistActionTextInput
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ (function () {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.createPlaylist, function () {
+ return MS.Entertainment.Utilities.isMusicApp1 ? new MS.Entertainment.UI.Actions.CreatePlaylistAction : new MS.Entertainment.UI.Actions.CreatePlaylistActionTextInput
+ })
+ })()
+})();
+/* >>>>>>/controls/messagebox.js:47976 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", { MessageBox: MS.Entertainment.UI.Framework.defineUserControl("/Controls/MessageBox.html#messageBoxTemplate", function messageBoxConstructor(element, options) { }, {}, { description: null }) })
+ })()
+})();
+/* >>>>>>/controls/errordialog.js:47985 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ (function () {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ErrorDialog: MS.Entertainment.UI.Framework.defineUserControl("/Controls/ErrorDialog.html#errorDialogTemplate", function messageBoxConstructor(element, options) {
+ this.webLinkText = String.load(String.id.IDS_DIALOG_ERROR_MORE_INFO);
+ this.feedbackLinkText = String.load(String.id.IDS_DIALOG_ERROR_FEEDBACKLINK);
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.App2.VoiceStatics"))
+ this.webLinkVoiceConfidence = MS.Entertainment.UI.App2.VoiceStatics.defaultConfidence
+ }, {
+ webLinkPromise: null, _parentOverlay: null, additionalButton: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.assert(this.errorDialogErrorCode, "Overlay: Element with data-ent-member='errorDialogErrorCode' not found");
+ if (!this.errorCode)
+ this.errorDialogErrorCode.style.visibility = "hidden";
+ if (!this.subTitle)
+ WinJS.Utilities.addClass(this.errorDialogDescription, "text-small")
+ }, onFeedbackLinkClick: function onFeedbackLinkClick() {
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.errorId = this.errorCode;
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.timestamp = (new Date).toUTCString();
+ this._parentOverlay.hide();
+ MS.Entertainment.UI.Shell.showFeedbackDialog();
+ MS.Entertainment.Utilities.Telemetry.logPageAction({ domElement: this.errorDialogFeedbackLink }, {
+ uri: "errorDialogTemplate", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ }, {
+ uri: "userFeedbackDialogTemplate", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ })
+ }, onWebLinkClick: function onWebLinkClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var webUrlPromise;
+ var onWeblinkPromiseClicked = function onWeblinkPromiseClicked(url) {
+ this._parentOverlay.hide();
+ window.open(url, "_blank");
+ MS.Entertainment.Utilities.Telemetry.logPageAction({ domElement: this.errorDialogWebLink }, {
+ uri: "errorDialogTemplate", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ }, {
+ uri: url, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.WebPage
+ })
+ }.bind(this);
+ MS.Entertainment.UI.Controls.assert(this.webLinkPromise, "webLinkPromise was null");
+ webUrlPromise = WinJS.Promise.as(this.webLinkPromise);
+ WinJS.Promise.timeout(500, webUrlPromise).done(onWeblinkPromiseClicked, onWeblinkPromiseClicked);
+ if (e.stopPropagation && e.preventDefault) {
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }, setOverlay: function setOverlay(instance) {
+ this._parentOverlay = instance;
+ if (MS.Entertainment.Utilities.isApp2 && instance && instance.buttons) {
+ instance.cancelButtonIndex = 0;
+ var newButtons = [];
+ if (this.additionalButton) {
+ var cancelButton = instance.buttons[instance.cancelButtonIndex];
+ instance.buttons = [];
+ var dismissBeforeExecute = function () {
+ this._parentOverlay.hide();
+ this.additionalButton.execute()
+ }.bind(this);
+ newButtons.push({
+ title: this.additionalButton.title, execute: dismissBeforeExecute
+ }, cancelButton);
+ instance.cancelButtonIndex = 1
+ }
+ newButtons.push({
+ title: String.load(String.id.IDS_DIALOG_ERROR_MORE_INFO_BUTTON_VUI_GUI), execute: this.onWebLinkClick.bind(this)
+ }, {
+ title: String.load(String.id.IDS_DIALOG_ERROR_FEEDBACKBUTTON_VUI_GUI), execute: this.onFeedbackLinkClick.bind(this)
+ });
+ instance.buttons = instance.buttons.concat(newButtons)
+ }
+ }
+ }, {
+ subTitle: null, description: null, errorCode: null, webLinkText: null, feedbackLinkText: null, webLinkVoiceConfidence: 0.2, showLinks: true, showErrorCodeInContent: true
+ })
+ })
+ })()
+})();
+/* >>>>>>/framework/managefoldersaction.js:48064 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Actions;
+ (function (Actions) {
+ var ManageFoldersAutomationIds = (function () {
+ function ManageFoldersAutomationIds() { }
+ ManageFoldersAutomationIds.manageFolders = "manageFolders";
+ return ManageFoldersAutomationIds
+ })();
+ Actions.ManageFoldersAutomationIds = ManageFoldersAutomationIds;
+ var ManageFoldersActions;
+ (function (ManageFoldersActions) {
+ var ManageFolders = (function (_super) {
+ __extends(ManageFolders, _super);
+ function ManageFolders() {
+ _super.apply(this, arguments);
+ this.automationId = ManageFoldersAutomationIds.manageFolders
+ }
+ ManageFolders.prototype.canExecute = function (param) {
+ this.useOverrideTitleIfExists();
+ return true
+ };
+ ManageFolders.prototype.executed = function (param) {
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/ManageFoldersPage.html#manageFoldersTemplate", null, true).done(function () {
+ MS.Entertainment.UI.Controls.ManageFoldersDialog.show()
+ })
+ };
+ return ManageFolders
+ })(Actions.Action);
+ ManageFoldersActions.ManageFolders = ManageFolders
+ })(ManageFoldersActions = Actions.ManageFoldersActions || (Actions.ManageFoldersActions = {}))
+ })(Actions = UI.Actions || (UI.Actions = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}));
+ (function () {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.manageFolders, function () {
+ return new MS.Entertainment.UI.Actions.ManageFoldersActions.ManageFolders
+ })
+ })()
+})();
+/* >>>>>>/coreapplication.js:48123 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Shell;
+ (function (Shell) {
+ var fx = MS.Entertainment.UI.Framework;
+ var utils = MS.Entertainment.Utilities;
+ var lightDismissLimit = 1024;
+ var stateCollapsedClass = "state-collapsed";
+ var stateExpandedClass = "state-expanded";
+ var collapsedNavBarWidth = 90;
+ var CoreApplication = (function (_super) {
+ __extends(CoreApplication, _super);
+ function CoreApplication() {
+ _super.apply(this, arguments);
+ this.clearLastActivatedEventArgsAfterHandling = true;
+ this._activated = false;
+ this._isPrelaunched = false;
+ this._navPaneToggleState = false;
+ this._wasRecentlyResumed = false;
+ this._snappedWatcher = null;
+ this._windowShrinksMediaMatch = null;
+ this.delayInitializationComplete = false;
+ this.setStageThreeCompletedOnFirstPage = true;
+ this.skipNotificationInitialization = false;
+ this._clearQueryAfterSearch = true;
+ this.hideMenuAriaLabelStringId = String.id.IDS_NAV_PANE_HIDE_MENU;
+ this.showMenuAriaLabelStringId = String.id.IDS_NAV_PANE_SHOW_MENU;
+ this.loadAppBar = true;
+ this.updateBranding = true;
+ this.snappedModeMaxWidthPx = 479
+ }
+ Object.defineProperty(CoreApplication.prototype, "marketPlaceEnabled", {
+ get: function () {
+ return false
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "defaultPivotIndex", {
+ get: function () {
+ return 0
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "minAppSupportedVersion", {
+ get: function () {
+ MS.Entertainment.UI.Actions.fail("minAppSupportedVersion() should be overrided by subclass");
+ return "1.0.0.0"
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "minServiceSupportedVersion", {
+ get: function () {
+ MS.Entertainment.UI.Actions.fail("minServiceSupportedVersion() should be overrided by subclass");
+ return "1.0.0.0"
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.afterAppReady = function () { };
+ CoreApplication.prototype.afterProcessAllCompleted = function () { };
+ CoreApplication.prototype.afterAppBarReady = function () { };
+ CoreApplication.prototype.beforeUICreation = function () { };
+ CoreApplication.prototype.getAppTitle = function () {
+ MS.Entertainment.UI.Actions.fail("getAppTitle() should be overrided by subclass");
+ return String.empty
+ };
+ CoreApplication.prototype.getAppSubTitle = function () {
+ return String.empty
+ };
+ CoreApplication.prototype.getAppPivots = function () {
+ MS.Entertainment.UI.Actions.fail("getAppPivots() should be overrided by subclass");
+ return []
+ };
+ CoreApplication.prototype.onNavPaneFirstTimeRender = function () { };
+ CoreApplication.prototype.onPrimaryPivotsSelectionChange = function (newPivot) { };
+ CoreApplication.prototype.beforeProtocolProcessPromise = function (deepLink) {
+ return null
+ };
+ CoreApplication.prototype.afterProtocolProcessed = function (deepLink, requiredDependencies) { };
+ CoreApplication.prototype.beforeAppActivation = function () { };
+ CoreApplication.prototype.beforeAppActivationHandling = function () { };
+ CoreApplication.prototype.beforeSearchActivation = function () { };
+ CoreApplication.prototype.handleFileActivation = function (isFirstRun, args) {
+ return false
+ };
+ Object.defineProperty(CoreApplication.prototype, "isNavPaneAnimating", {
+ get: function () {
+ return !!this._animatingNavBarPromise
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.afterSnappedSet = function (isSnapped) { };
+ CoreApplication.prototype.beforeDelayInitializeCompletes = function () { };
+ CoreApplication.prototype.afterAppResume = function () { };
+ CoreApplication.prototype.afterAppSuspends = function (e) { };
+ CoreApplication.prototype.getDeeplinkUri = function (args) {
+ var deeplinkUri = args.uri;
+ if (!deeplinkUri && args.arguments)
+ try {
+ deeplinkUri = new Windows.Foundation.Uri(this.appProtocolName + "://" + args.arguments)
+ }
+ catch (e) {
+ MS.Entertainment.fail("Failed to create a URI from an argument: " + (e && e.message));
+ return null
+ }
+ return deeplinkUri
+ };
+ CoreApplication.prototype.getStartedFromParamForProtocolActivation = function (args) {
+ var deeplinkUri = args.uri;
+ var startedFrom;
+ if (!deeplinkUri && args.arguments) {
+ var tile = args.tileId;
+ if (tile)
+ startedFrom = "Pin";
+ else
+ startedFrom = "Tile"
+ }
+ else
+ startedFrom = "Deeplink";
+ return startedFrom
+ };
+ Object.defineProperty(CoreApplication.prototype, "configurationManager", {
+ get: function () {
+ if (!this._configurationManager)
+ this._configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return this._configurationManager
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.getSavedNavigationMonikerData = function () {
+ return this.configurationManager.shell.lastUsedAppNavigationMonikerData
+ };
+ CoreApplication.prototype.setSavedNavigationMonikerData = function (value) {
+ this.configurationManager.shell.lastUsedAppNavigationMonikerData = value
+ };
+ CoreApplication.prototype.saveCurrentNavigationMonikerData = function () {
+ var monikerData = this.navigation.currentMonikerData;
+ if (monikerData)
+ this.setSavedNavigationMonikerData(monikerData.toString())
+ };
+ CoreApplication.prototype.clearNavigationMonikerData = function () {
+ this.setSavedNavigationMonikerData(String.empty)
+ };
+ CoreApplication.prototype.navigateToInitialPage = function () {
+ var savedMonikerData = this.getSavedNavigationMonikerData();
+ var validMonikerData = false;
+ if (savedMonikerData)
+ this.getAppPivots().forEach(function (item, index) {
+ if (item.moniker === savedMonikerData)
+ validMonikerData = true
+ });
+ if (validMonikerData) {
+ this.navigation.navigateToMoniker(savedMonikerData);
+ this.clearNavigationMonikerData()
+ }
+ else
+ this._navigateToDefault()
+ };
+ Object.defineProperty(CoreApplication.prototype, "applicationLifetimeManager", {
+ get: function () {
+ if (!this._applicationLifetimeManager)
+ this._applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ return this._applicationLifetimeManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "commonTraceProvider", {
+ get: function () {
+ if (!this._commonTraceProvider)
+ this._commonTraceProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ return this._commonTraceProvider
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "telemetryManager", {
+ get: function () {
+ if (!this._telemetryManager)
+ this._telemetryManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager);
+ return this._telemetryManager
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.initialize = function () {
+ var _this = this;
+ WinJS.strictProcessing();
+ WinJS.Binding.optimizeBindingReferences = true;
+ MS.Entertainment.Utilities.updateHtmlDirectionAttribute();
+ fx.enableAutoControlCleanup();
+ WinJS.Application.onerror = MS.Entertainment.UI.Debug.unhandledPromiseErrorHandler;
+ var webUI = Windows.UI.WebUI.WebUIApplication;
+ this._webUIEvents,
+ fx.addEventHandlers(webUI, {
+ activated: this.activated.bind(this), suspending: this.suspending.bind(this), resuming: this.resuming.bind(this)
+ });
+ this._windowEvents = fx.addEventHandlers(window, { unload: this.unload.bind(this) });
+ this._documentEvents = fx.addEventHandlers(document, {
+ visibilitychange: this.visibilityChanged.bind(this), dragstart: function (e) {
+ if (e.target.tagName === "IMG")
+ e.preventDefault()
+ }
+ });
+ MS.Entertainment.Utilities.systemAppListenersAttached = true;
+ this.beforeUICreation();
+ this.startupBindingProcessed = new MS.Entertainment.UI.Framework.Signal;
+ window.msWriteProfilerMark("ent:Startup.ControlsProcessedAndDataBound,StartTM");
+ MS.Entertainment.Utilities.processAllOnDocumentLoaded(document.body, this).done(function () {
+ window.msWriteProfilerMark("ent:Startup.ControlsProcessedAndDataBound,StopTM");
+ _this.afterProcessAllCompleted();
+ if (_this.updateBranding)
+ _this._updateBranding();
+ _this.initializeControlEventHandlers();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.UI.Framework.flags.attachCookieToRemovedDomElements = configurationManager.shell.attachCookieToRemovedDomElements;
+ MS.Entertainment.UI.Framework.flags.attachLargeObjectToUnloadedControl = configurationManager.shell.attachLargeObjectToUnloadedControl;
+ _this.startupBindingProcessed.complete()
+ })
+ };
+ CoreApplication.prototype._updateBranding = function () {
+ var titleElement = document.querySelector("[data-ent-member=_appTitleLabel]");
+ var navPaneHeader = document.querySelector("[data-ent-member=_navPaneHeader]");
+ if (!(titleElement && navPaneHeader)) {
+ MS.Entertainment.fail("Unable to get branding elements. Something very bad is happening");
+ return
+ }
+ if (!this.marketPlaceEnabled)
+ WinJS.Utilities.addClass(navPaneHeader, "navpane-noMarketplace");
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (MS.Entertainment.Utilities.isMusicApp1 && configurationManager.shell.showPreviewBranding) {
+ var subTitleElement = document.querySelector("[data-ent-member=_appSubTitleLabel]");
+ WinJS.Utilities.addClass(navPaneHeader, "header-previewLabel");
+ subTitleElement.textContent = this.getAppSubTitle()
+ }
+ titleElement.textContent = this.getAppTitle()
+ };
+ CoreApplication.prototype._loadDelayedInitFragment = function (critical) {
+ var delayedStartupContainer = document.getElementById("delayedStartupContainer");
+ if (!this._delayedInitFragmentPromise) {
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ this._delayedInitFragmentPromise = signal.promise;
+ msWriteProfilerMark("ent:loadDelayedInitFragment,StartTM");
+ var loadDelayedInitFragment = function () {
+ msWriteProfilerMark("ent:loadDelayedInitFragment,StopTM");
+ MS.Entertainment.Utilities.loadHtmlPage("/delayedStageThreeStartup.html", delayedStartupContainer).then(function () {
+ signal.complete()
+ })
+ };
+ if (!critical)
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function () {
+ loadDelayedInitFragment()
+ });
+ else
+ loadDelayedInitFragment()
+ }
+ return this._delayedInitFragmentPromise
+ };
+ CoreApplication.prototype.delayInitializeApplication = function () {
+ var _this = this;
+ if (!this._delayedInitPromise)
+ this._delayedInitPromise = this._loadDelayedInitFragment().then(function () {
+ _this._delayInitializeWork()
+ });
+ return this._delayedInitPromise
+ };
+ CoreApplication.prototype.activated = function (args, wasPreviouslyPrelaunched) {
+ var _this = this;
+ this.lastActivatedEventArgs = utils.cloneActivationArguments(args);
+ var kind;
+ var isFirstRun = !this._activated;
+ try {
+ kind = args.kind
+ }
+ catch (e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception.toString();
+ MS.Entertainment.fail("Exception while trying to determine the activation kind. Error exception was:" + description + "." + "\n Error was:" + error);
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ var startTime;
+ if (!wasPreviouslyPrelaunched && args.prelaunchActivated) {
+ this._handlePrelaunch();
+ return
+ }
+ if (args.arguments === MS.Entertainment.Utilities.retailExperienceArgument)
+ MS.Entertainment.Utilities.setRetailExperienceState(true);
+ if (window.sessionStorage["NewAppNavigated"] !== "true" && !wasPreviouslyPrelaunched)
+ this.applicationLifetimeManager.raiseActivated(args);
+ if (this._activated)
+ this.telemetryManager.appActivated();
+ if (!this._activated) {
+ MS.Entertainment.Framework.KeyboardInteractionListener.init();
+ WinJS.Application.start();
+ this.commonTraceProvider.traceProcessInitializeEventStart();
+ startTime = new Date;
+ this._app = new Microsoft.Entertainment.Application.Application;
+ this._app.init(Microsoft.Entertainment.Application.ExecMode.foreground);
+ this.beforeAppActivation();
+ this._appInitDuration = (new Date).valueOf() - startTime.valueOf();
+ this._activated = true;
+ var deferSplashScreen;
+ if (args.activatedOperation)
+ deferSplashScreen = args.activatedOperation.getDeferral();
+ this._contentContainerEvents = MS.Entertainment.UI.Framework.addEventHandlers(this.navigation.contentContainer, { ContentComplete: this._waitForFirstPageCompleted.bind(this) });
+ this.startupBindingProcessed.promise.done(function () {
+ if (deferSplashScreen)
+ deferSplashScreen.complete()
+ })
+ }
+ this.beforeAppActivationHandling();
+ var dataPoint = new Microsoft.Entertainment.Platform.Logging.DataPoint(Microsoft.Entertainment.Platform.Logging.LoggingLevel.telemetry, Microsoft.Entertainment.Platform.Logging.TelemetryAuthMethod.unauthenticated);
+ dataPoint.appendEventName("X8Run");
+ dataPoint.appendParameter("ClientResolution", window.screen.width + "x" + window.screen.height);
+ if (kind === Windows.ApplicationModel.Activation.ActivationKind.launch && !args.url && args.arguments)
+ kind = Windows.ApplicationModel.Activation.ActivationKind.protocol;
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function () {
+ _this._handleVersionChecks()
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind = kind;
+ switch (kind) {
+ case Windows.ApplicationModel.Activation.ActivationKind.launch:
+ dataPoint.appendParameter("StartedFrom", "launch");
+ this.navigateToInitialPage();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunch();
+ var navPane = document.getElementById("navPane");
+ MS.Entertainment.assert(navPane, "Nav-pane div does not exist!");
+ var navPaneRendered = MS.Entertainment.UI.Framework.addEventHandlers(navPane, {
+ firstTimeRendered: function () {
+ _this.onNavPaneFirstTimeRender();
+ navPaneRendered.cancel();
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function () {
+ _this._focusPivots()
+ })
+ }
+ });
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.file:
+ dataPoint.appendParameter("StartedFrom", "File");
+ this._navigateToDefault();
+ if (!this.handleFileActivation(isFirstRun, args))
+ this._loadDelayedInitFragment(true).done(function () {
+ MS.Entertainment.Activation.fileActivationHandler(args, !isFirstRun, true)
+ });
+ if (this.clearLastActivatedEventArgsAfterHandling)
+ this.lastActivatedEventArgs = null;
+ else {
+ this.lastActivatedEventArgs.files = null;
+ this.lastActivatedEventArgs.kind = Windows.ApplicationModel.Activation.ActivationKind.launch
+ }
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.protocol:
+ var deepLink = this.getDeeplinkUri(args);
+ if (!deepLink)
+ return this._navigateToDefault();
+ var startedFrom = this.getStartedFromParamForProtocolActivation(args);
+ dataPoint.appendParameter("StartedFrom", startedFrom);
+ var dependenciesPromise = this.beforeProtocolProcessPromise(deepLink);
+ WinJS.Promise.as(dependenciesPromise).done(function () {
+ if (!MS.Entertainment.UI.DeepLink.processProtocol(deepLink.rawUri, dataPoint, args.arguments)) {
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ _this._navigateToDefault()
+ }
+ else {
+ _this.afterProtocolProcessed(deepLink, !!dependenciesPromise);
+ if (_this.lastActivatedEventArgs) {
+ _this.lastActivatedEventArgs.uri = null;
+ _this.lastActivatedEventArgs.kind = Windows.ApplicationModel.Activation.ActivationKind.launch
+ }
+ }
+ });
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.search:
+ this.beforeSearchActivation();
+ this._navigateToSearch(args.queryText, true);
+ if (this._clearQueryAfterSearch) {
+ this.lastActivatedEventArgs.kind = Windows.ApplicationModel.Activation.ActivationKind.launch;
+ this.lastActivatedEventArgs.queryText = null
+ }
+ break;
+ default:
+ this._navigateToDefault();
+ MS.Entertainment.fail("Unexpected Activation kind: " + kind);
+ break
+ }
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function () {
+ dataPoint.write()
+ })
+ };
+ CoreApplication.prototype.isCurrentVersionSupported = function () {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var currentPackage = Windows.ApplicationModel.Package.current;
+ var currentVersion = currentPackage.id.version;
+ var minVersionSupported = MS.Entertainment.Utilities.parseVersionString(this.minAppSupportedVersion);
+ var minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString(this.minServiceSupportedVersion);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var versionSupported = (MS.Entertainment.Utilities.compareVersions(currentVersion, minVersionSupported) >= 0);
+ uiStateService.servicesEnabled = (MS.Entertainment.Utilities.compareVersions(currentVersion, minServiceVersionSupported) >= 0);
+ return versionSupported
+ };
+ CoreApplication.prototype._handleVersionChecks = function () {
+ var versionSupported = this.isCurrentVersionSupported();
+ if (!versionSupported) {
+ WinJS.Promise.timeout().done(function () {
+ window.location.href = "UpdateApp.html"
+ });
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ };
+ CoreApplication.prototype._waitForFirstPageCompleted = function () {
+ var _this = this;
+ this._cleanupContentContainerEvents();
+ this.telemetryManager.appActivated();
+ this.commonTraceProvider.traceProcessInitializeEventStop(this._appInitDuration);
+ this.delayInitializeApplication();
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceHubStrip_Ready("dashboard");
+ this._windowShrinksMediaMatch = matchMedia("all and (max-width: 1023px)");
+ var windowShrinksHandlerFunction = this._windowMadeSmaller.bind(this);
+ this._windowShrinksMediaMatch.addListener(windowShrinksHandlerFunction);
+ this._windowShrinksHandler = {
+ cancel: function () {
+ return _this._windowShrinksMediaMatch.removeListener(windowShrinksHandlerFunction)
+ }
+ };
+ this._updateNavPaneToggleAriaLabel();
+ this._initializeSnappedWatcher();
+ var searchBoxElement = document.querySelector(".control-app .searchInputBox");
+ if (searchBoxElement) {
+ var searchBoxControl = searchBoxElement.winControl;
+ if (searchBoxControl)
+ searchBoxControl.searchHistoryDisabled = false
+ }
+ if (this.setStageThreeCompletedOnFirstPage) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.stageThreeActivated = true
+ }
+ this.afterAppReady()
+ };
+ CoreApplication.prototype._getFileTransferNotificationHandler = function () {
+ MS.Entertainment.UI.Actions.fail("_getFileTransfeNotificationHandler() should be overrided by subclass");
+ return null
+ };
+ CoreApplication.prototype._delayInitializeWork = function () {
+ var _this = this;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus);
+ if (MS.Entertainment.FeatureEnablement)
+ MS.Entertainment.FeatureEnablement.initialize();
+ this._initializeAppNotifications().then(function () {
+ return WinJS.Promise.timeout(1000)
+ }).done(function () {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signInOnStart()
+ });
+ var appFileTransferNotificationHandler = this._getFileTransferNotificationHandler();
+ if (appFileTransferNotificationHandler)
+ appFileTransferNotificationHandler.startTransferListener();
+ this.beforeDelayInitializeCompletes();
+ MS.Entertainment.Framework.KeyboardInteractionListener.init();
+ MS.Entertainment.Framework.KeyboardShortcutHandler.instance.initialize();
+ MS.Entertainment.UI.Shell.createShellKeyboardShortcuts();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender)) {
+ var sender = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ sender.setDefaultEmptyMessage()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.tileManager))
+ this._tileManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.tileManager);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.typeToSearch))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).enableTypeToSearch();
+ var delayedStartupContainer = document.getElementById("delayedStartupContainer");
+ var appBarPromise = WinJS.Promise.as();
+ if (this.loadAppBar)
+ appBarPromise = MS.Entertainment.UI.Framework.loadTemplate("/Controls/AppBar/BottomAppBar.html#bottomAppBarTemplate").then(function () {
+ var appBarDiv = document.createElement("div");
+ appBarDiv.setAttribute("data-win-control", "WinJS.UI.AppBar");
+ appBarDiv.setAttribute("data-win-options", JSON.stringify({
+ placement: "bottom", layout: "custom"
+ }));
+ appBarDiv.setAttribute("data-win-automationid", "bottomAppBar");
+ WinJS.Utilities.addClass(appBarDiv, "bottomAppBar");
+ var appBarContent = document.createElement("div");
+ appBarContent.setAttribute("data-ent-id", "BottomAppBar");
+ appBarContent.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.BottomAppBar");
+ appBarDiv.appendChild(appBarContent);
+ document.body.appendChild(appBarDiv);
+ return WinJS.UI.processAll(appBarDiv).then(function () {
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (bottomAppBar)
+ bottomAppBar.deferredInit()
+ })
+ });
+ appBarPromise.done(function () {
+ _this.afterAppBarReady()
+ });
+ if (WinJS.Utilities.getMember("MS.Entertainment.ViewModels.SearchContractViewModel"))
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ this.delayInitializationComplete = true
+ };
+ CoreApplication.prototype._initializeAppNotifications = function () {
+ var infoNotification = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appInfoNotification);
+ var criticalNotification = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appCriticalNotification);
+ if (this.skipNotificationInitialization || !(infoNotification && criticalNotification))
+ return WinJS.Promise.as();
+ return WinJS.Promise.join({
+ info: WinJS.UI.process(infoNotification), critical: WinJS.UI.process(criticalNotification)
+ }).then(function (result) {
+ return WinJS.Promise.join([result.info.delayedInitialize(), result.critical.delayedInitialize()])
+ }).then(function () {
+ if (MS.Entertainment.Utilities.getRetailExperienceState())
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification).send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_DEMO_IN_DEMO_MODE), subTitle: "", moreDetails: "", action: null, category: "demo", isPersistent: true
+ }))
+ })
+ };
+ CoreApplication.prototype._cleanupContentContainerEvents = function () {
+ if (!this._contentContainerEvents)
+ return;
+ this._contentContainerEvents.cancel();
+ this._contentContainerEvents = null
+ };
+ CoreApplication.prototype._focusPivots = function () {
+ var navContent = document.querySelector(".app-navpane .navpane-content");
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(navContent)
+ };
+ CoreApplication.prototype._handlePrelaunch = function () {
+ var _this = this;
+ this._isPrelaunched = true;
+ var visibility = fx.addEventHandlers(document, {
+ visibilitychange: function () {
+ if (document.hidden)
+ return;
+ visibility.cancel();
+ MS.Entertainment.Utilities.resetPerfTrackStartTime();
+ _this._isPrelaunched = false;
+ _this.activated(_this.lastActivatedEventArgs, true)
+ }
+ })
+ };
+ CoreApplication.prototype.suspending = function (e) {
+ if (this._isPrelaunched)
+ return;
+ this._cancelPendingBackStackTrim();
+ var startTime = new Date;
+ this.commonTraceProvider.traceProcessSuspendEventStart();
+ this.applicationLifetimeManager.raiseSuspending();
+ this.saveCurrentNavigationMonikerData();
+ this.commonTraceProvider.traceProcessSuspendTelemetryStart();
+ this.telemetryManager.appSuspended();
+ this.commonTraceProvider.traceProcessSuspendTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onSuspending();
+ var duration = (new Date).valueOf() - startTime.valueOf();
+ this.commonTraceProvider.traceProcessSuspendEventStop(duration);
+ this.afterAppSuspends(e)
+ };
+ CoreApplication.prototype.resuming = function () {
+ if (this._isPrelaunched)
+ return;
+ this._cancelPendingBackStackTrim();
+ var startTime = new Date;
+ this.commonTraceProvider.traceProcessResumeEventStart();
+ this.applicationLifetimeManager.raiseResuming();
+ if (this._tileManager)
+ this._tileManager.updateTile();
+ this.commonTraceProvider.traceProcessResumeTelemetryStart();
+ this.telemetryManager.appResumed();
+ this.commonTraceProvider.traceProcessResumeTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onResuming();
+ this._wasRecentlyResumed = true;
+ var duration = (new Date).valueOf() - startTime.valueOf();
+ this.commonTraceProvider.traceProcessResumeEventStop(duration);
+ this.afterAppResume()
+ };
+ CoreApplication.prototype.visibilityChanged = function () {
+ if (this._isPrelaunched)
+ return;
+ var isVisible = !document.hidden;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.isAppVisible = isVisible;
+ this.commonTraceProvider.traceAppVisibilityChanged(isVisible);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appVisibilityChanged();
+ if (isVisible) {
+ this._cancelPendingBackStackTrim();
+ this.navigation.thawCurrentPage();
+ WinJS.Utilities.query(".overlayAnchor", document.body).forEach(function (overlay) {
+ fx.thawControlsInSubtree(overlay)
+ });
+ if (this._wasRecentlyResumed) {
+ this._wasRecentlyResumed = false;
+ if (WinJS.Utilities.getMember("Microsoft.PerfTrack.PerfTrackTimePoint.responsive"))
+ MS.Entertainment.Instrumentation.PerfTrack.getLogger().writeResumeStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive)
+ }
+ }
+ else {
+ this.navigation.freezeCurrentPage();
+ WinJS.Utilities.query(".overlayAnchor", document.body).forEach(function (overlay) {
+ fx.freezeControlsInSubtree(overlay)
+ });
+ this._trimBackStackAfterIdlePeriod()
+ }
+ };
+ CoreApplication.prototype._trimBackStackAfterIdlePeriod = function () {
+ var _this = this;
+ this._cancelPendingBackStackTrim();
+ if (!this.configurationManager.shell.backgroundBackStackTrimmingDelay)
+ return;
+ this._pendingBackStackTrim = WinJS.Promise.timeout(this.configurationManager.shell.backgroundBackStackTrimmingDelay).then(function () {
+ _this.navigation.trimBackStack();
+ _this._pendingBackStackTrim = null
+ }, function () { })
+ };
+ CoreApplication.prototype._cancelPendingBackStackTrim = function () {
+ if (!this._pendingBackStackTrim)
+ return;
+ this._pendingBackStackTrim.cancel();
+ this._pendingBackStackTrim = null
+ };
+ CoreApplication.prototype.unload = function () {
+ if (this._app)
+ this._app.shutdownAsync();
+ if (this._documentEvents) {
+ this._documentEvents.cancel();
+ this._documentEvents = null
+ }
+ if (this._windowEvents) {
+ this._windowEvents.cancel();
+ this._windowEvents = null
+ }
+ if (this._webUIEvents) {
+ this._webUIEvents.cancel();
+ this._webUIEvents = null
+ }
+ if (this._searchBoxEvents) {
+ this._searchBoxEvents.cancel();
+ this._searchBoxEvents = null
+ }
+ if (this._windowShrinksHandler) {
+ this._windowShrinksHandler.cancel();
+ this._windowShrinksHandler = null
+ }
+ if (this._toggleNavMenuEventHandlers) {
+ this._toggleNavMenuEventHandlers.cancel();
+ this._toggleNavMenuEventHandlers = null
+ }
+ if (this._dragEnterEventHandlers) {
+ this._dragEnterEventHandlers.cancel();
+ this._dragEnterEventHandlers = null
+ }
+ this._cleanupLightDismissNavPaneHandlers();
+ this._cleanupContentContainerEvents()
+ };
+ CoreApplication.prototype._handleNavMenuClicked = function () {
+ this._handleNavMenuClickedImpl()
+ };
+ CoreApplication.prototype._handleNavMenuClickedImpl = function (dontAnimate) {
+ var navPane = document.getElementById("navPane");
+ var contentPane = document.getElementById("contentHost");
+ if (!navPane)
+ return;
+ var navPaneExpanding = WinJS.Utilities.hasClass(navPane, stateCollapsedClass);
+ if (MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit)
+ this._toggleLightDismissNavPane(navPane, dontAnimate);
+ else {
+ if (this.isNavPaneAnimating)
+ return;
+ if (navPaneExpanding)
+ window.msWriteProfilerMark("ent:X13App.NavPane.Expanding");
+ else
+ window.msWriteProfilerMark("ent:X13App.NavPane.Collapsing");
+ this._toggleNavPane(navPaneExpanding, navPane, contentPane, dontAnimate)
+ }
+ var contentCatalogIds = MS.Entertainment.Utilities.Telemetry.ContentCatalogId;
+ var contentSourceIds = MS.Entertainment.Utilities.Telemetry.ContentSourceId;
+ var contentTypeIds = MS.Entertainment.Utilities.Telemetry.ContentTypeId;
+ if (this._navPaneToggleButton) {
+ var navButtonId = this._navPaneToggleButton.getAttribute("data-win-automationid");
+ if (navPaneExpanding)
+ navButtonId += ":Expanding";
+ else
+ navButtonId += ":Collapsing";
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ var navigationLocation = navigationJournal ? navigationJournal.location : String.empty;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ slot: 0, areaName: "NavBarArea1", contentId: navButtonId, contentCatalogId: contentCatalogIds.App, contentSourceId: contentSourceIds.App, contentTypeId: contentTypeIds.App, contentName: navButtonId
+ }, {
+ uri: navigationLocation, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ })
+ }
+ };
+ CoreApplication.prototype._toggleNavPane = function (expanding, navPane, contentPane, dontAnimate) {
+ var _this = this;
+ if (contentPane || dontAnimate) {
+ if (contentPane) {
+ WinJS.Utilities.toggleClass(contentPane, stateExpandedClass);
+ WinJS.Utilities.toggleClass(navPane, stateCollapsedClass)
+ }
+ else
+ WinJS.Utilities.toggleClass(navPane, stateExpandedClass);
+ this.navPaneToggleState = !expanding;
+ return
+ }
+ var navPaneClientWidth = navPane.clientWidth;
+ if (expanding) {
+ this._animatingNavBarPromise = MS.Entertainment.Utilities.schedulePromiseNormal().then(function () {
+ WinJS.Utilities.toggleClass(navPane, stateExpandedClass);
+ return WinJS.UI.Animation.showPanel(navPane, {
+ top: "0px", left: "-" + navPaneClientWidth + "px", rtlflip: true
+ })
+ });
+ this._animatingNavBarPromise.done(function () {
+ _this.navPaneToggleState = false;
+ _this._animatingNavBarPromise = null
+ })
+ }
+ else {
+ var targetLeft = navPaneClientWidth - collapsedNavBarWidth;
+ this._animatingNavBarPromise = WinJS.Utilities.Scheduler.schedulePromiseNormal().then(function () {
+ var transformStyle = "translateX(-" + targetLeft + "px)";
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ transformStyle = "translateX(" + targetLeft + "px)";
+ navPane.style.msTransform = transformStyle;
+ WinJS.Utilities.addClass(navPane, "state-collapsing");
+ return WinJS.UI.Animation.hidePanel(navPane, {
+ top: "0px", left: "-" + targetLeft + "px", rtlflip: true
+ })
+ });
+ this._animatingNavBarPromise.done(function () {
+ WinJS.Utilities.toggleClass(navPane, stateExpandedClass);
+ _this._animatingNavBarPromise = null;
+ _this.navPaneToggleState = true;
+ navPane.style.msTransform = "";
+ WinJS.Utilities.removeClass(navPane, "state-collapsing")
+ })
+ }
+ };
+ CoreApplication.prototype._isNavMenuExpanded = function () {
+ var navPane = document.getElementById("navPane");
+ if (MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit)
+ return WinJS.Utilities.hasClass(navPane, stateExpandedClass);
+ else
+ return !WinJS.Utilities.hasClass(navPane, stateCollapsedClass)
+ };
+ CoreApplication.prototype._handleInvokeSearchClicked = function () {
+ var searchInputBox = document.querySelector("[data-ent-member=searchInputBox] .win-searchbox-input");
+ this._handleNavMenuClicked();
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function () {
+ var searchBoxControl = searchInputBox;
+ if (searchBoxControl)
+ MS.Entertainment.UI.Framework.focusElement(searchBoxControl, true, true)
+ })
+ };
+ CoreApplication.prototype._toggleLightDismissNavPane = function (navPane, dontAnimate) {
+ var _this = this;
+ if (!navPane)
+ return;
+ var expanding = !WinJS.Utilities.hasClass(navPane, stateExpandedClass);
+ if (expanding) {
+ window.msWriteProfilerMark("ent:X13App.NavPane.Expanding");
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (bottomAppBar && bottomAppBar.hide)
+ bottomAppBar.hide();
+ navPane.winControl.enabled = true;
+ this._cleanupLightDismissNavPaneHandlers();
+ this._navPaneLightDismissHandlers = MS.Entertainment.UI.Framework.addEventHandlers(navPane, {
+ keydown: function (evt) {
+ if (evt.keyCode !== WinJS.Utilities.Key.escape)
+ return;
+ _this._toggleLightDismissNavPane(navPane)
+ }, focusout: function () {
+ if (navPane.contains(document.activeElement) || _this._focusIsInOverlayFromNavPane(document.activeElement))
+ return;
+ _this._toggleLightDismissNavPane(navPane)
+ }
+ });
+ var mediaWatcher = window.matchMedia("all and (min-width: 1024px)");
+ var mediaMatchedHandler = function () {
+ if (!mediaWatcher.matches)
+ return;
+ _this._toggleLightDismissNavPane(navPane, true)
+ };
+ mediaWatcher.addListener(mediaMatchedHandler);
+ this._navPaneWindowChangedHandlers = {
+ cancel: function () {
+ mediaWatcher.removeListener(mediaMatchedHandler)
+ }
+ }
+ }
+ else {
+ window.msWriteProfilerMark("ent:X13App.NavPane.Collapsing");
+ navPane.winControl.enabled = false;
+ this._cleanupLightDismissNavPaneHandlers()
+ }
+ this._toggleNavPane(expanding, navPane, null, dontAnimate)
+ };
+ CoreApplication.prototype._focusIsInOverlayFromNavPane = function (element) {
+ var navPane = document.getElementById("navPane");
+ var candidates = WinJS.Utilities.query(".overlayAnchor", document.body).filter(function (overlayElement) {
+ var containerElement = overlayElement.winControl && overlayElement.winControl.referenceContainer && overlayElement.winControl.referenceContainer.domElement;
+ return containerElement && navPane.contains(containerElement) && overlayElement.contains(element)
+ });
+ return candidates.length > 0
+ };
+ CoreApplication.prototype._cleanupLightDismissNavPaneHandlers = function () {
+ if (this._navPaneLightDismissHandlers) {
+ this._navPaneLightDismissHandlers.cancel();
+ this._navPaneLightDismissHandlers = null
+ }
+ if (this._navPaneWindowChangedHandlers) {
+ this._navPaneWindowChangedHandlers.cancel();
+ this._navPaneWindowChangedHandlers = null
+ }
+ };
+ Object.defineProperty(CoreApplication.prototype, "navPaneToggleState", {
+ get: function () {
+ return this._navPaneToggleState
+ }, set: function (value) {
+ this.updateAndNotify("navPaneToggleState", value);
+ this._updateNavPaneToggleAriaLabel()
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype._updateNavPaneToggleAriaLabel = function () {
+ if (!this._navPaneToggleButton)
+ return;
+ var navPane = document.getElementById("navPane");
+ var ariaLabelStringId = this.hideMenuAriaLabelStringId;
+ if (MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit)
+ if (WinJS.Utilities.hasClass(navPane, stateExpandedClass))
+ ariaLabelStringId = this.hideMenuAriaLabelStringId;
+ else
+ ariaLabelStringId = this.showMenuAriaLabelStringId;
+ else if (WinJS.Utilities.hasClass(navPane, stateCollapsedClass))
+ ariaLabelStringId = this.showMenuAriaLabelStringId;
+ else
+ ariaLabelStringId = this.hideMenuAriaLabelStringId;
+ if (ariaLabelStringId) {
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(String.load(ariaLabelStringId), this._navPaneToggleButton, "label");
+ if (this._navPaneToggleButton.winControl)
+ this._navPaneToggleButton.winControl.innerHTML = String.load(ariaLabelStringId)
+ }
+ };
+ CoreApplication.prototype.initializeControlEventHandlers = function () {
+ var _this = this;
+ var searchBoxElement = document.querySelector(".control-app .searchInputBox");
+ var searchBoxControl;
+ if (searchBoxElement)
+ searchBoxControl = (searchBoxElement).winControl;
+ if (searchBoxControl) {
+ this._searchBoxElement = searchBoxElement;
+ searchBoxControl.placeholderText = String.load(String.id.IDS_SEARCH_BUTTON);
+ var typeToSearchService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch);
+ typeToSearchService.typeToSearchPropertyName = "focusOnKeyboardInput";
+ typeToSearchService.getTypeToSearchHost = function () {
+ return searchBoxControl
+ };
+ typeToSearchService.shouldEnableTypeToSearchForElement = function (element) {
+ if (searchBoxControl.element.contains(element))
+ return false;
+ return MS.Entertainment.UI.TypeToSearchService.prototype.shouldEnableTypeToSearchForElement.apply(_this, arguments)
+ };
+ this._searchBoxEvents = MS.Entertainment.UI.Framework.addEventHandlers(searchBoxControl, {
+ querysubmitted: function (e) {
+ if (_this._searchBoxElement) {
+ var submitButton = _this._searchBoxElement.querySelector(".win-searchbox-button");
+ if (submitButton)
+ submitButton.focus()
+ }
+ if (e.detail.queryText && e.detail.queryText.match(/\S/)) {
+ _this._navigateToSearch(e.detail.queryText, false, e.detail.language);
+ if ((MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit) && _this._isNavMenuExpanded())
+ _this._handleNavMenuClicked()
+ }
+ }, suggestionsrequested: function (e) {
+ var currentSearchContract = WinJS.Utilities.getMember("MS.Entertainment.ViewModels.SearchContractViewModel.current");
+ if (!currentSearchContract)
+ return null;
+ return currentSearchContract.searchKeywordSuggestionRequested({
+ language: e.detail.language, linguisticDetails: e.detail.linguisticDetails, queryText: e.detail.queryText, request: e.detail
+ })
+ }, receivingfocusonkeyboardinput: function () {
+ if (!searchBoxElement.contains(document.activeElement))
+ searchBoxControl.queryText = String.empty;
+ if (!_this._isNavMenuExpanded())
+ _this._handleNavMenuClickedImpl(true)
+ }
+ })
+ }
+ var toggleNavButton = document.querySelector("[data-ent-member=toggleNavMenu]");
+ if (toggleNavButton) {
+ this._navPaneToggleButton = toggleNavButton;
+ this._toggleNavMenuEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(toggleNavButton, { click: this._handleNavMenuClicked.bind(this) })
+ }
+ var invokeSearchButton = document.querySelector("[data-ent-member=invokeSearchButton]");
+ if (invokeSearchButton)
+ this._invokeSearchEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(invokeSearchButton, { click: this._handleInvokeSearchClicked.bind(this) });
+ var navPane = document.getElementById("navPane");
+ if (navPane)
+ this._dragEnterEventHandlers = UI.Framework.addEventHandlers(navPane, {
+ dragenter: function () {
+ if (!_this._isNavMenuExpanded())
+ _this._handleNavMenuClicked()
+ }
+ })
+ };
+ CoreApplication.prototype._navigateToDefault = function () {
+ var windowWidth = MS.Entertainment.Utilities.getWindowWidth();
+ if (windowWidth <= this.snappedModeMaxWidthPx)
+ this._setSnapped(true);
+ else
+ this.navigation.navigateToDefault()
+ };
+ CoreApplication.prototype._navigateToSearch = function (searchText, isCatalogSearch, searchLanguage) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var navigateToSearchPage = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.searchResultsNavigate);
+ navigateToSearchPage.parameter = {
+ searchText: searchText, isCatalogSearch: isCatalogSearch
+ };
+ navigateToSearchPage.execute(document.querySelector(".control-app .searchInputBox"))
+ };
+ CoreApplication.prototype._initializeSnappedWatcher = function () {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!this._snappedWatcher) {
+ this._snappedWatcher = window.matchMedia("all and (min-width: 320px) and (max-width: " + this.snappedModeMaxWidthPx + "px)");
+ this._snappedWatcher.addListener(this._onSnappedModeChanged.bind(this));
+ if (this._snappedWatcher.matches)
+ this._onSnappedModeChanged()
+ }
+ };
+ CoreApplication.prototype._onSnappedModeChanged = function () {
+ this._setSnapped(!!(this._snappedWatcher && this._snappedWatcher.matches))
+ };
+ CoreApplication.prototype._setSnapped = function (snapped) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isSnapped !== snapped) {
+ uiStateService.isSnapped = snapped;
+ this.afterSnappedSet(snapped)
+ }
+ };
+ CoreApplication.prototype._windowMadeSmaller = function () {
+ var navPane = document.getElementById("navPane");
+ if (!navPane || !this._navPaneToggleButton)
+ return;
+ if (this._isNavMenuExpanded() && this._windowShrinksMediaMatch.matches)
+ this._toggleLightDismissNavPane(navPane);
+ if (!navPane.contains(document.activeElement) && !this._searchBoxElement.contains(document.activeElement))
+ return;
+ MS.Entertainment.UI.Framework.focusElement(this._navPaneToggleButton, false, true)
+ };
+ Object.defineProperty(CoreApplication.prototype, "navigation", {
+ get: function () {
+ var _this = this;
+ if (!this._navigation) {
+ var fueNavigationOperation = this._getFUENavigationOperation();
+ this._navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ this._navigation.initialize(this._getPrimaryPivots(), this.defaultPivotIndex, fueNavigationOperation);
+ this._initializeNavigation();
+ MS.Entertainment.UI.Framework.addEventHandlers(this._navigation.primaryPivots, {
+ selectedItemChanged: function (args) {
+ var selectedPivot = (args && args.detail && args.detail.newSelection && args.detail.newSelection.item);
+ _this.onPrimaryPivotsSelectionChange(selectedPivot)
+ }
+ })
+ }
+ return this._navigation
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype._initializeNavigation = function () {
+ this._navigation.animatePageTransitions = true
+ };
+ CoreApplication.prototype._getFUENavigationOperation = function () {
+ MS.Entertainment.UI.Actions.fail("_getFUENavigationOperation() should be overrided by subclass");
+ return null
+ };
+ CoreApplication.prototype._getPrimaryPivots = function () {
+ var appPivots = this.getAppPivots();
+ return new fx.SelectionManager(appPivots, -1)
+ };
+ Object.defineProperty(CoreApplication.prototype, "pivots", {
+ get: function () {
+ return this.navigation.primaryPivots
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype._traceTimeFromStart = function (message) {
+ message = message + ": " + (Date.now() - window.PerfTrack.LaunchInformation.getStartTime());
+ WinJS.Promise.timeout(2000).done(function () {
+ return alert(message)
+ })
+ };
+ return CoreApplication
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Shell.CoreApplication = CoreApplication
+ })(Shell = UI.Shell || (UI.Shell = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+/* >>>>>>/musicwinmain.js:49110 */
+(function () {
+ /* Copyright (C) Microsoft Corporation. All rights reserved. */
+ var __extends = this.__extends || function (d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+ (function (MS) {
+ var Entertainment;
+ (function (Entertainment) {
+ var UI;
+ (function (UI) {
+ var Shell;
+ (function (Shell) {
+ var MusicNavigation = MS.Entertainment.UI.Actions.MusicNavigation;
+ var perfTrack = MS.Entertainment.Instrumentation.PerfTrack;
+ window.onNewMusicPage = true;
+ var MusicApplication = (function (_super) {
+ __extends(MusicApplication, _super);
+ function MusicApplication() {
+ _super.call(this);
+ this._snappedNavigated = false;
+ this.appProtocolName = "microsoftmusic"
+ }
+ Object.defineProperty(MusicApplication.prototype, "marketPlaceEnabled", {
+ get: function () {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MusicApplication.prototype, "defaultPivotIndex", {
+ get: function () {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return config.music.defaultPivotIndex
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MusicApplication.prototype, "minAppSupportedVersion", {
+ get: function () {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return config.fue.minMusicAppSupportedVersion
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MusicApplication.prototype, "minServiceSupportedVersion", {
+ get: function () {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return config.service.minMusicServiceSupportedVersion
+ }, enumerable: true, configurable: true
+ });
+ MusicApplication.prototype.getSavedNavigationMonikerData = function () {
+ if (this.configurationManager.music.useStickyPivots)
+ return this.configurationManager.shell.lastUsedAppNavigationMonikerData;
+ else
+ return String.empty
+ };
+ MusicApplication.prototype.beforeProtocolProcessPromise = function (deepLink) {
+ var dependenciesPromise = null;
+ if (deepLink.host === "play" || deepLink.host === "playPin") {
+ dependenciesPromise = this._loadDelayedInitFragment(true);
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signInOnStart();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayProtectedContent()
+ }
+ return dependenciesPromise
+ };
+ MusicApplication.prototype.afterProtocolProcessed = function (deepLink, requiredDependencies) {
+ if (deepLink.host !== "playPin" && (requiredDependencies || deepLink.host === "feedback") && !this.navigation.location)
+ this._navigateToDefault()
+ };
+ MusicApplication.prototype.beforeSearchActivation = function () {
+ this.navigation.navigateToMoniker("explore", true)
+ };
+ MusicApplication.prototype.beforeAppActivation = function () {
+ var demoModeAppStateReset = MS.Entertainment.Utilities.resetAppStateForRetailExperienceIfNeeded();
+ if (demoModeAppStateReset)
+ MS.Entertainment.Utilities.removeAllPlaylistsIfDemoMode();
+ Entertainment.ServiceLocator.getService(Entertainment.Services.collectionChangeNotifier)
+ };
+ MusicApplication.prototype.handleFileActivation = function (isFirstRun, args) {
+ var _this = this;
+ var handled = false;
+ if (isFirstRun) {
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayNonProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayProtectedContent()
+ }
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.none;
+ if (MS.Entertainment.Activation.isSingleSong(args)) {
+ MS.Entertainment.Activation.startTagPlaybackForSong(args.files[0], this.delayInitializationComplete).then(function () {
+ return _this._loadDelayedInitFragment(true)
+ }).then(function () {
+ return MS.Entertainment.Activation.handoffSongToPlaybackPlatform(args.files[0], true, false)
+ }).done(null, function (error) { });
+ handled = true
+ }
+ return handled
+ };
+ MusicApplication.prototype.afterSnappedSet = function (isSnapped) {
+ if (isSnapped)
+ if (!this.navigation.currentSupportsSnapped) {
+ this._snappedNavigated = true;
+ var navigationParameter = { clearHistory: false };
+ this._navigateToNowPlaying(navigationParameter)
+ }
+ else
+ this._snappedNavigated = false;
+ else if (this._snappedNavigated) {
+ this._snappedNavigated = false;
+ this.navigation.navigateBack()
+ }
+ };
+ MusicApplication.prototype.beforeDelayInitializeCompletes = function () {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits).initialize();
+ MS.Entertainment.Utilities.DRM.individualizationAsync();
+ MS.Entertainment.UI.PurchaseHistoryService.initialize();
+ var cloudCollectionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection);
+ cloudCollectionService.startListening();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).bind("isSignedIn", function (isSignedIn) {
+ if (isSignedIn) {
+ cloudCollectionService.requestSync();
+ if (Microsoft.Entertainment.FileTransferManager)
+ Microsoft.Entertainment.FileTransferManager.scheduleProgressCheck();
+ MS.Entertainment.Music.FreeStreamingIsGoneAnnouncementDialog.showDialogIfNecessary()
+ }
+ });
+ if (MS.Entertainment.UI.Actions.ImportPlaylists)
+ MS.Entertainment.UI.Actions.ImportPlaylists.resumeLastPlaylistImport();
+ MS.Entertainment.Platform.PlaybackHelpers.reloadNowPlaying();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService).initialize();
+ MS.Entertainment.UI.Shell.WhatsNew.WhatsNewExperience.showWhatsNewIfNeeded()
+ };
+ MusicApplication.prototype._getFileTransferNotificationHandler = function () {
+ if (MS.Entertainment.UI.FileTransferNotificationHandlers)
+ return new MS.Entertainment.UI.FileTransferNotificationHandlers;
+ return null
+ };
+ MusicApplication.prototype.afterAppReady = function () {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ UI.CollectionChangeNotifierService.navigationService = actionService.getAction(UI.Actions.ActionIdentifiers.deviceHubNavigate);
+ var musicTransportControls = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.musicTransportControls);
+ if (musicTransportControls)
+ musicTransportControls.deferredInitialize()
+ };
+ MusicApplication.prototype.afterAppBarReady = function () {
+ var musicTransportControls = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.musicTransportControls);
+ if (musicTransportControls)
+ musicTransportControls.attachToAppBar()
+ };
+ MusicApplication.prototype.initialize = function () {
+ _super.prototype.initialize.call(this)
+ };
+ MusicApplication.prototype.beforeUICreation = function () {
+ MS.Entertainment.Utilities.useRadioStrings();
+ MS.Entertainment.Utilities.useCollectionStrings();
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ var currentRegion = globalizationManager.getRegion().toLowerCase();
+ if (currentRegion == "jp")
+ MS.Entertainment.Utilities.useDTOOnlyStrings()
+ };
+ MusicApplication.prototype.getAppTitle = function () {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.shell.showPreviewBranding)
+ return String.load(String.id.IDS_MUSIC_APP_TITLE);
+ else
+ return this.marketPlaceEnabled ? String.empty : String.load(String.id.IDS_MUSIC_APP_TITLE)
+ };
+ MusicApplication.prototype.getAppSubTitle = function () {
+ return String.load(String.id.IDS_PREVIEW_APP_SUBTITLE)
+ };
+ MusicApplication.prototype.onNavPaneFirstTimeRender = function () {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunch();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchToCollection();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchToRadio();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchToExplore()
+ };
+ MusicApplication.prototype.onPrimaryPivotsSelectionChange = function (newPivot) {
+ if (newPivot)
+ this.playlists.selectionManager.clear()
+ };
+ MusicApplication.prototype.getAppPivots = function () {
+ var musicPivots = new MS.Entertainment.ObservableArray;
+ musicPivots.push(new MS.Entertainment.UI.Framework.PivotData(function () {
+ return MS.Entertainment.ViewModels.MusicCollectionLX.createMusicCollectionLX()
+ }, "/Components/Music1/CollectionPageTemplate.html#collectionBody", String.load(String.id.IDS_COLLECTION_PIVOT_TC), MS.Entertainment.UI.Icon.mediaMusic, MusicNavigation.Monikers[3], function () {
+ perfTrack.setStartTime(perfTrack.StartPoints.CollectionGalleryRequest)
+ }, function () {
+ perfTrack.triggerScenarioCollectionGalleryRequestToLoad();
+ perfTrack.triggerScenarioAppLaunchToCollection()
+ }, MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionAddToMyMusic));
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.smartDJMarketplace))
+ musicPivots.push(this._createRadioPivot());
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace))
+ musicPivots.push(this._createExplorePivot());
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.devicesEnabled) && !config.shell.retailExperience)
+ musicPivots.push(this._createDevicesPivot());
+ musicPivots.push(this._createNowPlayingPivot());
+ return musicPivots
+ };
+ MusicApplication.prototype.initializeControlEventHandlers = function () {
+ _super.prototype.initializeControlEventHandlers.call(this);
+ var showPlaylistsButton = document.querySelector("[data-ent-member=showPlaylistsButton]");
+ if (showPlaylistsButton)
+ this._showPlaylistEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(showPlaylistsButton, { click: this._handleNavMenuClicked.bind(this) })
+ };
+ MusicApplication.prototype._createExplorePivot = function () {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var result;
+ if (!config.shell.retailExperience)
+ result = new MS.Entertainment.UI.Framework.PivotData(function () {
+ return new MS.Entertainment.ViewModels.ExploreHubViewModelBase
+ }, "/Components/Music1/ExplorePage.html#exploreBody", String.load(String.id.IDS_MUSIC_EXPLORE_PIVOT_TC), MS.Entertainment.UI.Icon.explore, MusicNavigation.Monikers[2], function () {
+ perfTrack.setStartTime(perfTrack.StartPoints.ExplorePageRequest)
+ }, function () {
+ perfTrack.triggerScenarioExplorePageRequestToLoad();
+ perfTrack.triggerScenarioAppLaunchToExplore()
+ });
+ else
+ result = new MS.Entertainment.UI.Framework.PivotData(function () {
+ return MS.Entertainment.ViewModels.DemoExplorePage.createDemoExplorePage()
+ }, "/Components/Music1/DemoExplorePageTemplate.html#collectionBody", String.load(String.id.IDS_MUSIC_EXPLORE_PIVOT_TC), MS.Entertainment.UI.Icon.explore, MusicNavigation.Monikers[2]);
+ return result
+ };
+ MusicApplication.prototype._createRadioPivot = function () {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var result;
+ if (!config.shell.retailExperience)
+ result = new MS.Entertainment.UI.Framework.PivotData(function () {
+ return MS.Entertainment.ViewModels.RadioCollectionViewModelBase.createRadioCollectionViewModel()
+ }, "/Components/Music1/RadioPageTemplate.html#collectionBody", String.load(String.id.IDS_MUSIC_SMARTDJ_PIVOT_TC), MS.Entertainment.UI.Icon.radio, MusicNavigation.Monikers[5], function () {
+ perfTrack.setStartTime(perfTrack.StartPoints.RadioPageRequest)
+ }, function () {
+ perfTrack.triggerScenarioRadioPageRequestToLoad();
+ perfTrack.triggerScenarioAppLaunchToRadio()
+ });
+ else
+ result = new MS.Entertainment.UI.Framework.PivotData(function () {
+ return MS.Entertainment.ViewModels.DemoRadioCollection.createDemoRadioCollection()
+ }, "/Components/Music1/DemoRadioPageTemplate.html#collectionBody", String.load(String.id.IDS_MUSIC_SMARTDJ_PIVOT_TC), MS.Entertainment.UI.Icon.radio, MusicNavigation.Monikers[5]);
+ return result
+ };
+ MusicApplication.prototype._createDevicesPivot = function () {
+ return new MS.Entertainment.UI.Framework.PivotData(function () {
+ return new MS.Entertainment.ViewModels.DevicesHubViewModel
+ }, "/Components/Music1/DevicesPage.html#devicesBody", String.load(String.id.IDS_MUSIC_DEVICES_PIVOT_TC), MS.Entertainment.UI.Icon.devices, MusicNavigation.Monikers[1], function () {
+ perfTrack.setStartTime(perfTrack.StartPoints.DevicesPageRequest)
+ }, function () {
+ perfTrack.triggerScenarioDevicesPageRequestToLoad()
+ })
+ };
+ MusicApplication.prototype._createNowPlayingPivot = function () {
+ return new MS.Entertainment.UI.Framework.PivotData(function () {
+ return new MS.Entertainment.ViewModels.NowPlayingViewModel(MS.Entertainment.ViewModels.NowPlayingViewModel.ViewTypes.nowPlaying)
+ }, "/Components/Music1/NowPlayingPage.html#nowPlayingPage", String.load(String.id.IDS_MUSIC_NOW_PLAYING_SC), MS.Entertainment.UI.Icon.nowPlaying, MusicNavigation.Monikers[4], function () {
+ perfTrack.setStartTime(perfTrack.StartPoints.NowPlayingPageRequest)
+ }, function () {
+ perfTrack.triggerScenarioNowPlayingPageRequestToLoad()
+ }, MS.Entertainment.UI.Actions.ActionIdentifiers.addToNowPlaying, true)
+ };
+ MusicApplication.prototype._navigateToNowPlaying = function (param) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var nowPlayingNavigateAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.nowPlayingNavigate);
+ MS.Entertainment.assert(nowPlayingNavigateAction, "Now Playing navigate action is undefined.");
+ if (nowPlayingNavigateAction) {
+ this.navigation.cancelInProgressNavigation();
+ nowPlayingNavigateAction.parameter = param;
+ nowPlayingNavigateAction.execute()
+ }
+ };
+ MusicApplication.prototype._getFUENavigationOperation = function () {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSubscription))
+ return null;
+ return new MS.Entertainment.UI.Framework.NavigationOperation(function () {
+ return new MS.Entertainment.ViewModels.FUEPageViewModel
+ }, "/Components/Music1/FUEPageTemplate.html#body", function () {
+ perfTrack.disableAllStartupScenarios()
+ })
+ };
+ Object.defineProperty(MusicApplication.prototype, "playlists", {
+ get: function () {
+ var _this = this;
+ if (!this._playlists) {
+ this._playlists = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playlists);
+ MS.Entertainment.UI.Framework.addEventHandlers(this._playlists.selectionManager, {
+ selectedItemChanged: function (args) {
+ var selectedPlaylist = (args && args.detail && args.detail.newSelection && args.detail.newSelection.item);
+ if (selectedPlaylist)
+ _this.navigation.primaryPivots.clear()
+ }
+ });
+ var createPlaylistButton = document.querySelector("[data-ent-member=createPlaylistButton]");
+ createPlaylistButton.addEventListener("click", this._createPlaylist.bind(this));
+ var importPlaylistButton = document.querySelector("[data-ent-member=importPlaylistsButton]");
+ importPlaylistButton.addEventListener("click", this._importPlaylists.bind(this))
+ }
+ return this._playlists
+ }, enumerable: true, configurable: true
+ });
+ MusicApplication.prototype._createPlaylist = function (event) {
+ var _this = this;
+ this.delayInitializeApplication().done(function () {
+ if (!_this._isNavMenuExpanded())
+ _this._handleNavMenuClicked();
+ var createPlaylistAction = _this.playlists.getCreatePlaylistAction();
+ createPlaylistAction.referenceContainer = { domElement: event.srcElement.querySelector(".verticalPlaylistItem-icon") };
+ createPlaylistAction.execute()
+ }, function (error) {
+ MS.Entertainment.fail("Failed to create playlist because delayed app init app failed: " + (error && error.message))
+ })
+ };
+ MusicApplication.prototype._importPlaylists = function (event) {
+ var _this = this;
+ this.delayInitializeApplication().done(function () {
+ var importPlaylistsAction = _this.playlists.getImportPlaylistsAction();
+ importPlaylistsAction.execute()
+ }, function (error) {
+ MS.Entertainment.fail("Failed to import playlists because delayed app init app failed: " + (error && error.message))
+ })
+ };
+ MusicApplication.prototype.unload = function () {
+ _super.prototype.unload.call(this);
+ if (this._showPlaylistEventHandlers) {
+ this._showPlaylistEventHandlers.cancel();
+ this._showPlaylistEventHandlers = null
+ }
+ };
+ return MusicApplication
+ })(MS.Entertainment.UI.Shell.CoreApplication);
+ Shell.MusicApplication = MusicApplication;
+ if (MS.Entertainment.Utilities.isMain) {
+ var musicApp = new MusicApplication;
+ musicApp.initialize()
+ }
+ })(Shell = UI.Shell || (UI.Shell = {}))
+ })(UI = Entertainment.UI || (Entertainment.UI = {}))
+ })(Entertainment = MS.Entertainment || (MS.Entertainment = {}))
+ })(MS || (MS = {}))
+})();
+
+
+WinJS.Namespace.define("MS.Entertainment.UI.App2", {
+ VoiceStatics: WinJS.Class.define(function () { }, { normalizeStringForVoice: function (s) { return s; } })
+})
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/microsoft.system.package.metadata/Autogen/JSByteCodeCache_32 b/packages/microsoft.zunemusic/microsoft.system.package.metadata/Autogen/JSByteCodeCache_32
new file mode 100644
index 00000000..16f2e46d
Binary files /dev/null and b/packages/microsoft.zunemusic/microsoft.system.package.metadata/Autogen/JSByteCodeCache_32 differ
diff --git a/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.pckgdep b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.pckgdep
new file mode 100644
index 00000000..e917dbbe
Binary files /dev/null and b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.pckgdep differ
diff --git a/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.recovery b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.recovery
new file mode 100644
index 00000000..abf400aa
Binary files /dev/null and b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.recovery differ
diff --git a/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.pckgdep b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.pckgdep
new file mode 100644
index 00000000..e917dbbe
Binary files /dev/null and b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.pckgdep differ
diff --git a/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.recovery b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.recovery
new file mode 100644
index 00000000..7448d710
Binary files /dev/null and b/packages/microsoft.zunemusic/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.recovery differ
diff --git a/packages/microsoft.zunemusic/msapp-error.html b/packages/microsoft.zunemusic/msapp-error.html
new file mode 100644
index 00000000..4822693d
--- /dev/null
+++ b/packages/microsoft.zunemusic/msapp-error.html
@@ -0,0 +1,15 @@
+
+
+
+
+ IWX Entertainment Client
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunemusic/msapp-error.js b/packages/microsoft.zunemusic/msapp-error.js
new file mode 100644
index 00000000..ac0515c8
--- /dev/null
+++ b/packages/microsoft.zunemusic/msapp-error.js
@@ -0,0 +1,36 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ function initialize() {
+ var json = {
+ httpStatus: "", failureName: "", failureUrl: ""
+ };
+ for (var property in json) {
+ var parameterValue = getQueryParameter(property);
+ if (parameterValue)
+ json[property] = unescape(parameterValue);
+ else
+ json[property] = "Unknown"
+ }
+ json["verb"] = json["message"] = "NAVIGATION_ERROR";
+ json["header"] = {
+ version: {
+ major: "1", minor: "0"
+ }, taskId: "OTHER"
+ };
+ var jsonString = JSON.stringify(json);
+ var origin = "ms-appx://" + document.location.host;
+ window.parent.postMessage(jsonString, origin)
+ }
+ function getQueryParameter(variable) {
+ var query = window.location.search.substring(1);
+ var vars = query.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] === variable)
+ return pair[1]
+ }
+ return ""
+ }
+ document.addEventListener("DOMContentLoaded", initialize, false)
+})()
diff --git a/packages/microsoft.zunemusic/raw/EntCommon.dll b/packages/microsoft.zunemusic/raw/EntCommon.dll
new file mode 100644
index 00000000..6d423b47
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/EntCommon.dll differ
diff --git a/packages/microsoft.zunemusic/raw/EntPlat.dll b/packages/microsoft.zunemusic/raw/EntPlat.dll
new file mode 100644
index 00000000..f7cefce8
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/EntPlat.dll differ
diff --git a/packages/microsoft.zunemusic/raw/EntSyncFx.dll b/packages/microsoft.zunemusic/raw/EntSyncFx.dll
new file mode 100644
index 00000000..c79ecc92
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/EntSyncFx.dll differ
diff --git a/packages/microsoft.zunemusic/raw/Microsoft.Entertainment.Instrumentation.Providers.dll b/packages/microsoft.zunemusic/raw/Microsoft.Entertainment.Instrumentation.Providers.dll
new file mode 100644
index 00000000..33bafd8c
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/Microsoft.Entertainment.Instrumentation.Providers.dll differ
diff --git a/packages/microsoft.zunemusic/raw/Microsoft.Entertainment.winmd b/packages/microsoft.zunemusic/raw/Microsoft.Entertainment.winmd
new file mode 100644
index 00000000..30001daa
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/Microsoft.Entertainment.winmd differ
diff --git a/packages/microsoft.zunemusic/raw/Microsoft.Media.AdaptiveStreaming.dll b/packages/microsoft.zunemusic/raw/Microsoft.Media.AdaptiveStreaming.dll
new file mode 100644
index 00000000..72064737
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/Microsoft.Media.AdaptiveStreaming.dll differ
diff --git a/packages/microsoft.zunemusic/raw/Microsoft.Media.AdaptiveStreaming.winmd b/packages/microsoft.zunemusic/raw/Microsoft.Media.AdaptiveStreaming.winmd
new file mode 100644
index 00000000..1a160de9
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/Microsoft.Media.AdaptiveStreaming.winmd differ
diff --git a/packages/microsoft.zunemusic/raw/Microsoft.PerfTrack.dll b/packages/microsoft.zunemusic/raw/Microsoft.PerfTrack.dll
new file mode 100644
index 00000000..a7bab463
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/Microsoft.PerfTrack.dll differ
diff --git a/packages/microsoft.zunemusic/raw/Microsoft.PerfTrack.winmd b/packages/microsoft.zunemusic/raw/Microsoft.PerfTrack.winmd
new file mode 100644
index 00000000..46467cec
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/Microsoft.PerfTrack.winmd differ
diff --git a/packages/microsoft.zunemusic/raw/MicrosoftAdvertising.dll b/packages/microsoft.zunemusic/raw/MicrosoftAdvertising.dll
new file mode 100644
index 00000000..0f1ba091
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/MicrosoftAdvertising.dll differ
diff --git a/packages/microsoft.zunemusic/raw/MicrosoftAdvertising.winmd b/packages/microsoft.zunemusic/raw/MicrosoftAdvertising.winmd
new file mode 100644
index 00000000..3a675bcb
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/MicrosoftAdvertising.winmd differ
diff --git a/packages/microsoft.zunemusic/raw/gnsdk_fp.dll b/packages/microsoft.zunemusic/raw/gnsdk_fp.dll
new file mode 100644
index 00000000..830eddae
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/gnsdk_fp.dll differ
diff --git a/packages/microsoft.zunemusic/raw/resources.pri b/packages/microsoft.zunemusic/raw/resources.pri
new file mode 100644
index 00000000..e1d7e215
Binary files /dev/null and b/packages/microsoft.zunemusic/raw/resources.pri differ
diff --git a/packages/microsoft.zunemusic/resources/en-gb.json b/packages/microsoft.zunemusic/resources/en-gb.json
new file mode 100644
index 00000000..8ac40110
--- /dev/null
+++ b/packages/microsoft.zunemusic/resources/en-gb.json
@@ -0,0 +1,2284 @@
+{
+ "resources": {
+ "IDS_ACC_BACK_BUTTON": "Back",
+ "IDS_ACC_HOME_BUTTON": "Home",
+ "IDS_ACC_REFRESH_BUTTON": "Refresh",
+ "IDS_ACTIVATION_LIMIT_EXCEEDED_DTO": "You're already downloading on the maximum number of devices.",
+ "IDS_ADVERTISEMENT": "Advertisement",
+ "IDS_APP1_MODULE_VIEW_ALL": "View all",
+ "IDS_APP1_MODULE_VIEW_ALL_LABEL": "View all {0}",
+ "IDS_APP2_FILTER_SORTED_BY": "Sort by",
+ "IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT": "Content filtered. Appropriate up to age {0}.",
+ "IDS_APP2_PARENTAL_NO_CONTENT_TITLE": "Parental controls are enabled",
+ "IDS_BETA_TOS_ACCEPT_MESSAGE": "By clicking I Accept, you agree to the license terms required to use this app.",
+ "IDS_BETA_TOS_BUTTON_ACCEPT": "I accept",
+ "IDS_BETA_TOS_BUTTON_DECLINE": "Cancel",
+ "IDS_BETA_TOS_TITLE": "First things first.",
+ "IDS_BROWSE_ACTION_TITLE": "Show More",
+ "IDS_BUY_BUTTON": "Buy",
+ "IDS_BUY_BUTTON_VIDEO": "Buy",
+ "IDS_CANCEL_BUTTON": "Cancel",
+ "IDS_CANCEL_BUTTON_TC": "Cancel",
+ "IDS_CHILD_AGE_GATING_MESSAGE": "Purchase of this content is currently not allowed for child and teen accounts.",
+ "IDS_CHILD_AGE_GATING_TITLE": "Sorry",
+ "IDS_CLEAR_DOWNLOAD_ERROR_BUTTON": "Clear error",
+ "IDS_CLEAR_SELECTION": "Clear selection",
+ "IDS_CLOSE_BUTTON": "Close",
+ "IDS_CLOSE_BUTTON_LC": "close",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE": "You have more music than we can sync with the cloud. To keep your music in sync, limit your number of songs to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE": "Can't sync your music.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER": "Can't sync your music",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE": "We can't sync with the cloud right now. Until we do, changes you make here won't show up on other devices and changes on those devices won't show up here. We'll keep trying. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE": "Can't sync right now.",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER": "Can't sync",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT": "More info",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE": "Playlists can have only {0} songs. Choose fewer songs or remove some first.",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL": "[[1]Playlists can have only {0} song. Choose fewer songs or remove some first.][[*]Playlists can have only {0} songs. Choose fewer songs or remove some first.]",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE": "Can't add to {0}",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE": "You have more playlists than we can sync with the cloud. To keep your playlists in sync, limit their number to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE": "Can't sync playlists.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER": "Can't sync playlists",
+ "IDS_COLLECTION_ALL_VIDEO_EMPTY": "When you add videos to your Windows library, they'll appear here, too.",
+ "IDS_COLLECTION_CLOUD_MATCHED_ARIA": "Cloud matched",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING": "Checking Xbox Music availability",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA": "Cloud sync pending",
+ "IDS_COLLECTION_HEADER_ZOOM_IN": "Activate to zoom in",
+ "IDS_COLLECTION_HEADER_ZOOM_OUT": "Activate to zoom out",
+ "IDS_COLLECTION_IN_CLOUD": "In cloud",
+ "IDS_COLLECTION_IN_CLOUD_FREE": "Matched (available here and for streaming on other Windows 8/Windows RT devices)",
+ "IDS_COLLECTION_IN_CLOUD_MATCHED": "Matched (available here and for streaming on other Xbox Music devices)",
+ "IDS_COLLECTION_MOVIE_EMPTY": "It's lonely here. Find hit films at the Xbox Video Store.",
+ "IDS_COLLECTION_MOVIE_EMPTY_LINK": "Show me hit films at the Xbox Video Store",
+ "IDS_COLLECTION_MUSIC_EMPTY": "It’s lonely here. Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_2": "Go to the Windows desktop. Select Windows Explorer, then Music Library. Put your MP3s in this folder.",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK": "Browse millions of songs in Xbox Music",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM": "Find music to stream for free or buy and add to your collection",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM": "Browse all music",
+ "IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE": "Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_TITLE": "It's lonely here.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT": "This app plays music from your Windows library. To add music, go to the Windows desktop, select Windows Explorer and then Music Library.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE": "Collection",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE": "We'll add songs from any files you have on this PC.",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE": "Choose where we look",
+ "IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK": "Choose where we look for music on this PC",
+ "IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK": "Add music to your Windows music library",
+ "IDS_COLLECTION_MUSIC_SETTINGS_TITLE": "Settings",
+ "IDS_COLLECTION_NOT_IN_CLOUD": "Not in cloud",
+ "IDS_COLLECTION_OPEN_FILES_LINK": "Open or play something",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE": "Browse new, featured, and top music.",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE": "Explore music",
+ "IDS_COLLECTION_PIVOT": "collection",
+ "IDS_COLLECTION_PIVOT_TC": "Collection",
+ "IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD": "Add to cloud",
+ "IDS_COLLECTION_PURCHASES_RESTORE": "Restore",
+ "IDS_COLLECTION_PURCHASES_RESTORE_TEXT": "Where possible, restore all purchased music to my collection. Some purchases may no longer be available.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE": "This song is no longer available for streaming or download from Xbox Music. It might be available for purchase.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE": "Song not available.",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD": "Streaming",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE": "Streaming only",
+ "IDS_COLLECTION_THIS_DEVICE_ONLY": "This device only",
+ "IDS_COLLECTION_TOOLTIP_CANT_PLAY_ONEDRIVE_TRACK": "This music file cannot be played here.",
+ "IDS_COLLECTION_TOOLTIP_CLOUD_STATUS": "Streaming status",
+ "IDS_COLLECTION_TOOLTIP_LEARN_MORE": "Learn more",
+ "IDS_COLLECTION_TOOLTIP_MATCHED": "Listen offline here, also in Xbox Music catalogue",
+ "IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD": "Not in cloud (available only here)",
+ "IDS_COLLECTION_TOOLTIP_STREAMING": "Stream from Xbox Music catalogue (download to listen offline)",
+ "IDS_COLLECTION_TOOLTIP_UNMATCHED": "Unmatched (available only here)",
+ "IDS_COLLECTION_TV_EMPTY": "Show me TV programmes at the Xbox Video Store",
+ "IDS_COLLECTION_VIDEO_EMPTY": "When you have videos that aren't films or TV programmes, they'll appear here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY": "It's lonely here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2": "Make sure your videos are part of your Windows library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE": "You can also open files directly, but playing them this way won't add them to your Video library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT": "This app plays videos from your Windows library. To add videos, go to the Windows desktop, select Windows Explorer, and then Videos Library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE": "My Videos",
+ "IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK": "Choose where we look for videos on this PC",
+ "IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK": "Add videos to your Windows video library",
+ "IDS_COLLECTION_VIDEO_SETTINGS_TITLE": "Settings",
+ "IDS_COMMA_SEPARATOR": "{0}, {1}",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY": "When you connect to your Xbox 360 with Xbox SmartGlass, what you play there will appear here.",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE": "Welcome!",
+ "IDS_COMPOSE_MESSAGE_SEND": "Send",
+ "IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL": "Move and tap with one finger.",
+ "IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL": "Zoom with two.",
+ "IDS_CONTROLLER_DISMISS_KEYBOARD": "Tap here when you're done typing.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING": "Someone else is using their Xbox SmartGlass remote.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON": "OK",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE": "Sorry, you can’t use the remote right now.",
+ "IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL": "Enter your Family Settings pass code to continue.",
+ "IDS_CONTROLLER_INVOKE_KEYBOARD": "Tap here to start typing.",
+ "IDS_CONTROLLER_SAME_WIRELESS_NETWORK": "For the best experience, your Xbox console and this device should be on the same wireless network.",
+ "IDS_CONTROLLER_SEPARATE_NETWORKS": "Xbox SmartGlass will work across separate networks, but you can't use the keyboard or browser control.",
+ "IDS_CONTROLLER_SLOW_CONNECTION": "Slow connection",
+ "IDS_CONTROLLER_SLOW_CONNECTION_BUTTON": "OK",
+ "IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO": "More info",
+ "IDS_CONTROLLER_SWITCHER_BROWSER": "Browser",
+ "IDS_CONTROLLER_SWITCHER_BUTTON": "Switch",
+ "IDS_CONTROLLER_SWITCHER_CONTROLLER": "Controller",
+ "IDS_CONTROLLER_SWITCHER_GUIDE": "Guide",
+ "IDS_CONTROLLER_SWITCHER_KEYBOARD": "Keyboard",
+ "IDS_CONTROLLER_TUTORIAL_SWIPE": "Swipe to move and hold to move faster",
+ "IDS_CONTROLLER_TUTORIAL_TAP": "Tap to select",
+ "IDS_CONTROLLER_WEB_HUB_BUTTON": "Web Hub",
+ "IDS_CREATEACCOUNT_TITLE": "Create Account",
+ "IDS_DELETE_BUTTON": "Delete",
+ "IDS_DELETE_DESCRIPTION_LOCAL_PLURAL": "[[1]Are you sure you want to delete this {0} item?][[*]Are you sure you want to delete these {0} items?]",
+ "IDS_DELETE_DESCRIPTION_LOCAL_SINGLE": "Are you sure you want to delete \"{0}\"?",
+ "IDS_DELETE_LABEL": "Delete",
+ "IDS_DEMO_CONFIGURATION_COMPLETE": "The application has been configured for the retail experience. It will now close.",
+ "IDS_DEMO_IN_DEMO_MODE": "Retail demo",
+ "IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER": "Featured Albums",
+ "IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER": "Featured Artists",
+ "IDS_DEMO_MUSIC_EXPLORE_HEADER": "Discover new music",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1": "Listen to millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE": "Browse and buy from a catalogue of millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2": "Find, play, and collect your favourites",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3": "Save them as playlists and see them on other devices",
+ "IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER": "Explore Xbox Music",
+ "IDS_DEMO_MUSIC_EXPLORE_SUBTITLE": "Xbox Music lets you listen to your favourite artists, and helps you to discover new ones.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE": "xbox music store",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE": "* Internet required. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE": "Buy individual songs or get unlimited access to millions of songs with Xbox Music Pass.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE": "Purchase songs and albums from the Xbox Music store to build your personal music collection.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE": "From the latest new releases to classic favourites.",
+ "IDS_DEMO_MUSIC_RADIO_HEADER": "Personalised radio",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_1": "Pick an artist and we will pick the tunes",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_2": "Save your favourite stations as playlists for easy listening",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_3": "Skip as many songs as you like — you are in complete control",
+ "IDS_DEMO_MUSIC_RADIO_SUBTITLE": "Xbox Music lets you listen to customised stations of music you will love.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE": "* Internet required. Limits on free streaming apply. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE": "Enjoy 6 months free unlimited music streaming on every Windows PC and tablet.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE": "Get Xbox Music Pass for unlimited access to millions of songs on all your devices.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE": "Xbox Music brings you all the music you love. Any way you want it.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE": "* Broadband internet and compatible devices required. See xbox.com/live.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE": "Play your purchased videos anywhere you go. Start on your tablet and pick up where you left off on your Xbox 360.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF": "Rent or buy the latest HD films.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON": "Rent or buy the latest HD films and buy TV programmes.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE": "* Content from Xbox Video Store. Internet required; carrier fees apply. HD capable display required.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE": "Watch what you love wherever you are, get instant-on HD to start watching right away.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON": "Get the latest TV programmes the day after they air.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE": "Xbox Video brings you the latest films and TV programmes you love, anywhere you are.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV": "Xbox Video brings you the latest films you love, anywhere you are.",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING": "Add to now playing",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION": "add to now playing",
+ "IDS_DETAILS_ALL_EPISODES_LABEL": "All episodes",
+ "IDS_DETAILS_ARTIST_ALBUMS": "albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL_LC": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL": "Show all albums",
+ "IDS_DETAILS_AUDIO_LANGUAGE": "{0} audio",
+ "IDS_DETAILS_BUY_ALBUM_LABEL": "Buy album",
+ "IDS_DETAILS_BUY_BUNDLE": "Buy bundle",
+ "IDS_DETAILS_BUY_EPISODE_LABEL": "Buy/rent",
+ "IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL": "Buy episode",
+ "IDS_DETAILS_BUY_EXTRA": "Buy extra",
+ "IDS_DETAILS_BUY_SEASON_CURRENT_LABEL": "Buy series pass",
+ "IDS_DETAILS_BUY_SEASON_LABEL": "Buy series",
+ "IDS_DETAILS_BUY_SONG_LABEL": "Buy song",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT": "1 album",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_DETAILS_COLLECTION_ALBUMS_COUNT": "{0} albums",
+ "IDS_DETAILS_COLLECTION_NO_SONGS": "no songs in collection",
+ "IDS_DETAILS_COLLECTION_SONG_COUNT": "1 song in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_COUNT": "{0} songs in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_PLURAL": "[[1]{0} song in collection][[*]{0} songs in collection]",
+ "IDS_DETAILS_CURRENT_MEDIA_LABEL": "Now playing",
+ "IDS_DETAILS_DEMO_PURCHASED_LABEL": "Demo purchased",
+ "IDS_DETAILS_DESCRIPTION_LABEL": "Description",
+ "IDS_DETAILS_DEVELOPER_LABEL": "Developer",
+ "IDS_DETAILS_DOWNLOAD_FREE_EXTRA": "Get for Xbox 360",
+ "IDS_DETAILS_DOWNLOAD_LABEL": "Download",
+ "IDS_DETAILS_DOWNLOAD_LABEL_HD": "Download (HD)",
+ "IDS_DETAILS_DOWNLOAD_LABEL_SD": "Download (SD)",
+ "IDS_DETAILS_DURATION_HOURS_FORMAT": "{0} hr {1} min",
+ "IDS_DETAILS_DURATION_LABEL": "Duration",
+ "IDS_DETAILS_DURATION_MINS_FORMAT": "{0} min",
+ "IDS_DETAILS_DURATION_MINSEC_FORMAT": "{0} min {1} sec",
+ "IDS_DETAILS_EPISODES_LABEL": "Episodes",
+ "IDS_DETAILS_EPISODES_LABEL_LC": "episodes",
+ "IDS_DETAILS_EPISODES_LABEL_UC": "EPISODES",
+ "IDS_DETAILS_EXPLICIT_LABEL": "Explicit",
+ "IDS_DETAILS_EXPLICIT_LABEL_UC": "EXPLICIT",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL": "Extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_LC": "extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_UC": "EXTRAS",
+ "IDS_DETAILS_EXTRA_FOR_GAME": "{0} for {1}",
+ "IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL": "{0}, last purchased on {1}",
+ "IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON": "{0}, purchased on {1}",
+ "IDS_DETAILS_EXTRA_PURCHASED_LABEL": "Extra purchased",
+ "IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL": "Purchased on {0}",
+ "IDS_DETAILS_FEATURED_TRAILER_TITLE": "Official trailer",
+ "IDS_DETAILS_FEATURED_WATCH_TRAILER": "Play trailer",
+ "IDS_DETAILS_FILE_OPEN_LABEL": "Open file",
+ "IDS_DETAILS_GAME_PURCHASED_LABEL": "Game purchased",
+ "IDS_DETAILS_GENRE_LABEL": "Genres",
+ "IDS_DETAILS_HUB_MUSIC_ALBUMS": "Show all available albums from this artist.",
+ "IDS_DETAILS_HUB_TV_SEASONS": "Show all available seasons from this series.",
+ "IDS_DETAILS_LATEST_EPISODE_LABEL": "New episode available",
+ "IDS_DETAILS_METADATA_SEPERATOR": " • ",
+ "IDS_DETAILS_MORE_ACTION": "More",
+ "IDS_DETAILS_MY_ALBUMS": "In Collection",
+ "IDS_DETAILS_NETWORK_LABEL": "Network",
+ "IDS_DETAILS_NEW_EPISODE_LABEL": "New episode",
+ "IDS_DETAILS_NOT_RATED_LABEL": "NR",
+ "IDS_DETAILS_NOT_RATED_LONG_LABEL": "Not rated",
+ "IDS_DETAILS_OVERVIEW": "overview",
+ "IDS_DETAILS_PERC_WATCHED_LABEL": "{0}% watched",
+ "IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE": "Choose an app",
+ "IDS_DETAILS_PLATFORM_LABEL": "Platform",
+ "IDS_DETAILS_PLAY_ALBUM_BUTTON": "Play album",
+ "IDS_DETAILS_PLAY_NOW_LABEL": "Play",
+ "IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_ON_XBOX_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL": "Start radio",
+ "IDS_DETAILS_PLAY_SEASON_BUTTON": "Play series",
+ "IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL": "Play Smart DJ",
+ "IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL": "Play song on Xbox",
+ "IDS_DETAILS_PLAY_TRAILER_LABEL": "Play trailer",
+ "IDS_DETAILS_PLAYLIST_NO_SONGS": "no songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONG_COUNT": "1 song in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_COUNT": "{0} songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_PLURAL": "[[1]{0} song in playlist][[*]{0} songs in playlist]",
+ "IDS_DETAILS_PREVIEW_ALBUM_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_ARTIST_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_EPISODE_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_SONG_LABEL": "Preview",
+ "IDS_DETAILS_PUBLISHER_LABEL": "Publisher",
+ "IDS_DETAILS_QUALITY_LABEL": "Quality",
+ "IDS_DETAILS_RATING_LABEL": "Rating",
+ "IDS_DETAILS_RATING_USERRATED": "Your rating",
+ "IDS_DETAILS_RATINGS_PLURAL": "[[1]{0} rating][[*]{0} ratings]",
+ "IDS_DETAILS_RECENT_ALBUMS": "Latest Albums",
+ "IDS_DETAILS_RELATED_ARTISTS": "Related Artists",
+ "IDS_DETAILS_RELEASE_DATE_LABEL": "Release date",
+ "IDS_DETAILS_REVIEW_LABEL": "Review",
+ "IDS_DETAILS_SEASONS_LABEL": "Series",
+ "IDS_DETAILS_SHUFFLE_ALL": "Shuffle all",
+ "IDS_DETAILS_SIMILAR_MOVIES": "Similar Films",
+ "IDS_DETAILS_START_DOWNLOAD_LABEL": "Start download",
+ "IDS_DETAILS_STUDIO_LABEL": "Studio",
+ "IDS_DETAILS_TITLE_NAR": "Details for {0}",
+ "IDS_DETAILS_TOP_SONGS": "Top Songs",
+ "IDS_DETAILS_TRACK_NUM_FORMAT": "{0}.",
+ "IDS_DETAILS_TRACKS_LABEL": "Songs",
+ "IDS_DETAILS_TRY_AGAIN_LABEL": "Try again",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_HD": "Try again (HD)",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_SD": "Try again (SD)",
+ "IDS_DETAILS_TVSERIES_SEASONS": "seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_ALL": "all seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_LOCAL": "my seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL": "Show all seasons",
+ "IDS_DETAILS_UNRATED_LABEL": "UR",
+ "IDS_DETAILS_UNRATED_LONG_LABEL": "Unrated",
+ "IDS_DETAILS_VIDEO_HUB_RELATED": "you may also like",
+ "IDS_DETAILS_VIDEO_HUB_RELATED_UC": "YOU MAY ALSO LIKE",
+ "IDS_DETAILS_VIEW_FULL_APP": "Explore app",
+ "IDS_DETAILS_VIEW_FULL_ARTIST": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_GAME": "Explore game",
+ "IDS_DETAILS_VIEW_FULL_MOVIE": "Explore film",
+ "IDS_DETAILS_VIEW_FULL_SEASON": "Show seasons",
+ "IDS_DETAILS_VIEW_FULL_SERIES": "Explore series",
+ "IDS_DETAILS_VIEW_MORE": "Show more",
+ "IDS_DETAILS_WATCH_NOW_LABEL": "Watch",
+ "IDS_DETAILS_WATCH_ON_XBOX_LABEL": "Buy/rent",
+ "IDS_DETAILS_WATCH_TRAILER_LABEL": "Watch trailer",
+ "IDS_DIALOG_ERROR_CODE": "STATUS CODE",
+ "IDS_DIALOG_ERROR_FEEDBACKLINK": "Give Microsoft feedback about this problem",
+ "IDS_DIALOG_ERROR_MORE_INFO": "Find help for this",
+ "IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE": "Your session has timed out. Try again?",
+ "IDS_DIALOG_SESSION_TIMED_OUT_TITLE": "Lost connection.",
+ "IDS_DIALOG_UNEXPECTED_ERROR_CAPTION": "There's a problem.",
+ "IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD": "Can't download",
+ "IDS_DOWNLOAD_ERROR_CAPTION": "Can't download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL": "Cancel all",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD": "Cancel Download",
+ "IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS": "There were problems with your download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS": "Tap a song to retry, or cancel a download to see detailed info on a problem.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS": "Retry all downloads",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD": "Retry download",
+ "IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER": "Try again later",
+ "IDS_DOWNLOAD_LABEL": "Keep Offline",
+ "IDS_EDIT_BUTTON": "Edit",
+ "IDS_EDITBOX_ERROR_NUMBER": "Use numbers in this field.",
+ "IDS_EDITBOX_REMAINING_PLURAL": "[[1]{0} character remaining][[*]{0} characters remaining]",
+ "IDS_EMPTY_VIEW": "There's nothing to show here right now. Please check back later.",
+ "IDS_FAILED_PANEL_HEADER": "We can't connect to Xbox services right now.",
+ "IDS_FAILED_PANEL_LABEL": "Make sure you have internet access, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_DESC": "To use Xbox services, connect to the internet, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_HEADER": "Your PC is offline.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE": "We've enabled new features! To see them, please restart this app.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE": "New features available",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER": "App update",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED": "Please restart the app.",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED": "Restart for new features.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY": "Could not download to your library. That path is no longer available. If you are using external storage, make sure it's available and connected.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG": "Download cancelled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT": "Download cancelled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOADED": "Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG": "Some things didn't download ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT": "Problem downloading ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG": "You're low on storage space",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT": "You're low on storage space",
+ "IDS_FILTER_ALL": "all",
+ "IDS_FILTER_ALL_GENRES": "all genres",
+ "IDS_FILTER_ALL_GENRES_SC": "All genres",
+ "IDS_FILTER_ALL_SUBGENRES_SC": "All subgenres",
+ "IDS_FILTER_BY": "By",
+ "IDS_FILTER_SORTED_BY": "arranged by",
+ "IDS_GLOBAL_COMMAND_HELP": "Help",
+ "IDS_GLOBAL_COMMAND_HOME": "Home",
+ "IDS_GLOBAL_COMMAND_NOW_PLAYING": "Now Playing",
+ "IDS_GLOBAL_COMMAND_RESTORE_PURCHASES": "Restore purchases",
+ "IDS_GLOBAL_COMMAND_SEARCH": "Search",
+ "IDS_HHMMSS_DURATION": "{0}:{1}:{2}",
+ "IDS_HOME_NOW_PLAYING": "Now Playing",
+ "IDS_HOME_NOW_PLAYING_EPISODE": "Now Playing - {0}",
+ "IDS_HOME_NOW_PLAYING_JUMP_IN": "Jump in",
+ "IDS_HOME_NOW_PLAYING_LC": "now playing",
+ "IDS_HOME_NOW_PLAYING_RESUME": "Resume",
+ "IDS_HOME_NOW_PLAYING_RESUME_ARIA": "Resume - {0}",
+ "IDS_HOME_NOW_PLAYING_XBOX": "On your Xbox",
+ "IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED": "Last played on your Xbox",
+ "IDS_HOME_PIVOT": "home",
+ "IDS_HOME_TILE_PAUSED_LABEL": "paused",
+ "IDS_LOADING_STATUS_LABEL": "Loading",
+ "IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR": "Add folder",
+ "IDS_MANAGE_FOLDERS_DESCRIPTION": "Right now, we're watching these folders:",
+ "IDS_MANAGE_FOLDERS_DONE_BUTTON": "Done",
+ "IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR": "Exclude folder",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT": "To remove this folder, add another one first.",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE": "Your collection needs at least one folder to work.",
+ "IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION": "Media Browser",
+ "IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION": "Media Player",
+ "IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION": "Media Player Preview",
+ "IDS_MANIFEST_MUSIC_APP_DESCRIPTION": "Music",
+ "IDS_MANIFEST_MUSIC_APP_NAME": "Music",
+ "IDS_MANIFEST_TEST_APP_DESCRIPTION": "Xbox on Windows",
+ "IDS_MANIFEST_VIDEO_APP_DESCRIPTION": "Video",
+ "IDS_MANIFEST_VIDEO_APP_NAME": "Video",
+ "IDS_MARKETPLACE_BY_PLAYRANK": "by most played",
+ "IDS_MARKETPLACE_PIVOT": "all music",
+ "IDS_MARKETPLACE_REGION_EMPTY": "There is nothing available in your region just yet. Please check back soon!",
+ "IDS_MARKETPLACE_SORT_BEST_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_CRITIC_RATING": "critic rating",
+ "IDS_MARKETPLACE_SORT_PLAY_RANK": "most played",
+ "IDS_MARKETPLACE_SORT_POPULARITY": "most played",
+ "IDS_MARKETPLACE_SORT_RELEASE_DATE": "release date",
+ "IDS_MARKETPLACE_SORT_SALES_RANK": "top selling",
+ "IDS_MARKETPLACE_SORT_TITLE": "title",
+ "IDS_MARKETPLACE_SORT_TOP_RENTED": "top rented",
+ "IDS_MARKETPLACE_SORT_TOP_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_USER_RATING": "customer rating",
+ "IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION": "In collection",
+ "IDS_MEDIA_ERROR_CAPTION": "Media problem.",
+ "IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON": "Song Download Error",
+ "IDS_MEDIA_STATUS_DOWNLOADING_ICON": "Song is Downloading",
+ "IDS_MEDIA_STATUS_INLINE_STREAMING_ICON": "Media is available for streaming",
+ "IDS_MEDIA_STATUS_NOW_PLAYING_ICON": "Song is playing",
+ "IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON": "Sorry, can't play. Please try again.",
+ "IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your monthly streaming limit.",
+ "IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your play limit for this song.",
+ "IDS_MEDIATYPE_ALBUM": "Album",
+ "IDS_MEDIATYPE_ARTIST": "Artist",
+ "IDS_MEDIATYPE_GAME": "Xbox 360 game",
+ "IDS_MEDIATYPE_GAME_WINDOWS": "Windows game",
+ "IDS_MEDIATYPE_MOVIE": "Film",
+ "IDS_MEDIATYPE_PLAYLIST": "Playlist",
+ "IDS_MEDIATYPE_SONG": "Song",
+ "IDS_MEDIATYPE_TVEPISODE": "TV Episode",
+ "IDS_MEDIATYPE_TVSEASON": "TV Season",
+ "IDS_MEDIATYPE_TVSERIES": "TV Series",
+ "IDS_MMSS_DURATION": "{0}:{1}",
+ "IDS_MODIFIER_PREFIX_SORTBY": "arrange by:",
+ "IDS_MODIFIER_PREFIX_VIEW": "show:",
+ "IDS_MODIFIER_PREFIX_VIEWBY": "arrange by",
+ "IDS_MOGO_NOW_PLAYING": "Now playing",
+ "IDS_MOGO_NOW_PLAYING_XBOXMUSIC": "Now playing on Xbox Music",
+ "IDS_MOGO_NOW_PLAYING_XBOXVIDEO": "Now playing on Xbox Video",
+ "IDS_MOGO_RESUME": "Resume",
+ "IDS_MOGO_XBOX_MUSIC_XENON": "{0} Xbox Music",
+ "IDS_MOGO_XBOX_VIDEO_XENON": "{0} Xbox Video",
+ "IDS_MUSIC_ALBUMS_PIVOT": "albums",
+ "IDS_MUSIC_ALBUMS_PIVOT_TC": "Albums",
+ "IDS_MUSIC_APP_TITLE": "music",
+ "IDS_MUSIC_APP_TITLE_TC": "Music",
+ "IDS_MUSIC_ARTISTS_PIVOT": "artists",
+ "IDS_MUSIC_ARTISTS_PIVOT_TC": "Artists",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY": "Music automatically finds songs in your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library at your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX": "Xbox Music automatically finds songs in your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library at your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK": "Tap for more info.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE": "Add music to your Windows music library.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY": "Learn how to fix it",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY": "We think we can help. Tap to learn more.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE": "It looks like a lot of your music isn't showing up right.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY": "Choose where we look",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE": "We're adding music from this PC.",
+ "IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} album added to your music][[*]{0} albums added to your music]",
+ "IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} artist added to your music][[*]{0} artists added to your music]",
+ "IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE": "You have nothing in the cloud just yet.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1": "Listen to millions of songs for free.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2": "Enjoy your music on all your PCs.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE": "Free",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC": "These are songs you own that aren't available in the cloud. To make them available, tap Add To and choose Cloud Collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE": "No icon",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC": "You can play these songs whether you're online or offline. This icon appears beside anything that's available in the cloud and anything you've downloaded using Xbox Music Pass.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE": "Available here and in the cloud",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC": "You can play these songs whenever you're online and signed in. While playing songs from Xbox Music, you'll see or hear occasional ads. To avoid interruptions, sign up for Xbox Music Pass and enjoy unlimited listening to millions of songs.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE": "Streaming only",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT": "You'll see the following icons on songs and albums in your music collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE": "Icons in your music collection",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_DESC": "Tap to learn about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_TITLE": "Tell me about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_BODY": "Your music in the cloud will automatically appear on your other Windows 8/Windows RT devices.\n\nWith Xbox Music Pass, you'll also see your cloud music on your phone and Xbox 360.",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK": "Learn more about Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE": "Music in the cloud",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY": "If you're not seeing all your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE": "All done! We've added the music from this PC.",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1": "Added your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1": "Adding your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG": "{0} song",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS": "{0} songs",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing your PC's Music library.",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE": "We didn't find any music on this PC.",
+ "IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY": "Learn more about how it works",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY": "Tap to learn more.",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE": "Your collection now includes music you've added from Xbox Music.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1": "Enjoy your pass on your mobile devices.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2": "Enjoy ad-free listening.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3": "Download songs to listen to later",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE": "Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} song added to your music][[*]{0} songs added to your music]",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2": "Also available on other devices",
+ "IDS_MUSIC_COLLECTION_EMPTY_DESC": "Find new tunes and old favourites.",
+ "IDS_MUSIC_COLLECTION_EMPTY_TITLE": "No music in your collection",
+ "IDS_MUSIC_COLLECTION_PIVOT": "my music",
+ "IDS_MUSIC_COLLECTION_PIVOT_TC": "My Music",
+ "IDS_MUSIC_DEVICES_PIVOT": "devices",
+ "IDS_MUSIC_DEVICES_PIVOT_TC": "Devices",
+ "IDS_MUSIC_EXPLORE_PIVOT": "explore",
+ "IDS_MUSIC_EXPLORE_PIVOT_TC": "Explore",
+ "IDS_MUSIC_FEATURED_PIVOT": "featured",
+ "IDS_MUSIC_GENRES_PIVOT": "genres",
+ "IDS_MUSIC_LOCATION_DMZ": "Temporary Cache",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_DESC": "Try a different genre or filter.",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_TITLE": "There's nothing to show here",
+ "IDS_MUSIC_MARKETPLACE_PIVOT": "all music",
+ "IDS_MUSIC_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_MUSIC_PIVOT": "music",
+ "IDS_MUSIC_RADIO_PIVOT": "radio",
+ "IDS_MUSIC_RADIO_PIVOT_TC": "Radio",
+ "IDS_MUSIC_SONGS_PIVOT_TC": "Songs",
+ "IDS_MUSIC_STORE_PIVOT": "store",
+ "IDS_MUSIC_STORE_PIVOT_TC": "Store",
+ "IDS_MUSIC_TOP_ALBUMS_PIVOT": "top",
+ "IDS_MUSIC_VIEW_PLAYLIST": "Show song list",
+ "IDS_MY_MUSIC_BUTTON_DESC": "My music",
+ "IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE": "My Music",
+ "IDS_N_FILTER_IN": "{0} {1}",
+ "IDS_N_SORTED_BY": "{0} {1} arranged by",
+ "IDS_NAV_PANE_HIDE_MENU": "Hide menu",
+ "IDS_NAV_PANE_SHOW_MENU": "Show menu",
+ "IDS_NETWORK_STATUS_HEADER": "Network status",
+ "IDS_NETWORK_STATUS_LOCAL_ONLY": "Now local only",
+ "IDS_NETWORK_STATUS_NONE": "Offline",
+ "IDS_NETWORK_STATUS_OVER_THE_LIMIT": "Over data limit",
+ "IDS_NETWORK_STATUS_ROAMING": "Roaming",
+ "IDS_NETWORK_STATUS_THROTTLED": "Limited network",
+ "IDS_NETWORK_STATUS_UNRESTRICTED": "Now unrestricted",
+ "IDS_NEXT_BUTTON": "Next",
+ "IDS_NO_BUTTON": "No",
+ "IDS_NOT_AVAILABLE_OFFLINE": "Not available offline",
+ "IDS_NOW_PLAYING_DETAILS_BUTTON": "Details",
+ "IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION": "Add this album to my music",
+ "IDS_NOW_PLAYING_OP_ADD_SONG_ACTION": "Add this song to my music",
+ "IDS_NOW_PLAYING_OP_BIO_ACTION": "Check out the bio",
+ "IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION": "See other albums from this artist",
+ "IDS_NOW_PLAYING_OP_RADIO_ACTION": "Start radio",
+ "IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION": "Save this as a playlist",
+ "IDS_NOW_PLAYING_OP_SHARE_ACTION": "Share with a friend",
+ "IDS_NOW_PLAYING_OP_SMARTDJ_ACTION": "Play Smart DJ",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION": "Play top songs",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION": "Play top songs for this related artist",
+ "IDS_NOW_PLAYING_PANEL_TITLE_LC": "now playing",
+ "IDS_NOW_PLAYING_PLAYLIST_BUTTON": "Now playing",
+ "IDS_NOW_PLAYING_REMOVE_TRACK_ACTION": "Remove from list",
+ "IDS_NUMBER_SYMBOL": "#",
+ "IDS_OK_BUTTON": "OK",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE": "Next Page",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE": "Previous Page",
+ "IDS_PIN_TO_START_LINK_ERROR_TEXT": "Sorry, we can't find that. It might have been moved or deleted.",
+ "IDS_PIN_TO_START_SCREEN_BUTTON": "Pin to start",
+ "IDS_PLAY_ALL": "Play all",
+ "IDS_PLAY_ALL_DESC": "Shuffle all music",
+ "IDS_PLAY_ALL_LABEL": "Play all music",
+ "IDS_PLAY_ALL_SHUFFLED": "Play all shuffled",
+ "IDS_PLAY_BUTTON": "Play",
+ "IDS_PLAY_BUTTON_VIDEO": "Play",
+ "IDS_PLAYBACK_DURATION_PROGRESS": "{0}/{1}",
+ "IDS_PLAYBACK_ERROR_MESSAGE_TITLE": "Can't play.",
+ "IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE": "This song isn't available when you're offline. To play it, connect to the internet.",
+ "IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE": "Try a different playlist.",
+ "IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED": "To play this song, you need to sign in.",
+ "IDS_PLAYLIST_BUTTON_DESC": "Playlists",
+ "IDS_PREVIEW_APP_SUBTITLE": "preview",
+ "IDS_PROGRESS_NAR": "{0} of {1}",
+ "IDS_PROVISIONING_ACCEPT_BUTTON": "I Accept",
+ "IDS_PROVISIONING_ACCEPTANCE_DESC": "Clicking \"I Accept\" means you have read and agree to the following:",
+ "IDS_PROVISIONING_ALREADY_HAVE_BUTTON": "Already have an Xbox profile?",
+ "IDS_PROVISIONING_ALREADY_HAVE_DESC": "Choose Cancel and sign in with your other Microsoft account.",
+ "IDS_PROVISIONING_CANCEL_BUTTON": "Cancel",
+ "IDS_PROVISIONING_CHILD_LIST_COMEBACK": "{0}. Come back here",
+ "IDS_PROVISIONING_CHILD_LIST_SIGNIN": "{0}. Click here to sign in",
+ "IDS_PROVISIONING_CHILD_LIST_TITLE": "Do the following:",
+ "IDS_PROVISIONING_CHILD_LIST_XBOX_LINK": "{0}. Create your profile at Xbox.com",
+ "IDS_PROVISIONING_CHILD_SUBTITLE": "To create your profile, please go to Xbox.com. You'll need a parent to approve it.",
+ "IDS_PROVISIONING_CHILD_TITLE": "Parent Needed",
+ "IDS_PROVISIONING_EXPLANATION": "Adding an online Xbox membership to your Microsoft account lets you participate in great Xbox gaming and entertainment.",
+ "IDS_PROVISIONING_PRIVACY_LINK": "Privacy Statement",
+ "IDS_PROVISIONING_TITLE": "To continue, create an Xbox profile",
+ "IDS_PROVISIONING_TOS_LINK": "Xbox Terms of Use",
+ "IDS_PROVISIONING_USER_EMAIL": "Your login: {0}",
+ "IDS_PURCHASE_ERROR_CAPTION": "There's a problem.",
+ "IDS_PURCHASE_ERROR_MESSAGE": "Sorry, we can't complete your purchase right now.",
+ "IDS_PURCHASE_ERROR_MESSAGE_TITLE": "Try again later",
+ "IDS_RADIO_ERROR_CAPTION": "Radio",
+ "IDS_READ_LESS": "Read less",
+ "IDS_READ_MORE": "Read more",
+ "IDS_RECENT_LAST_WEEK": "last week",
+ "IDS_RECENT_THIS_MONTH": "this month",
+ "IDS_RECENT_THIS_WEEK": "this week",
+ "IDS_REMOVE_BUTTON": "Remove",
+ "IDS_RENT_BUTTON": "Rent",
+ "IDS_RESTART_BUTTON": "Restart",
+ "IDS_RESUME_BUTTON": "Resume",
+ "IDS_SAVE_BUTTON": "Save",
+ "IDS_SEARCH_ALBUMLOCAL_LABEL": "Album \nCollection \n({0})",
+ "IDS_SEARCH_ALBUMMARKETPLACE_LABEL": "Music Store: \nAlbums \n({0})",
+ "IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL": "Albums ({0})",
+ "IDS_SEARCH_ALBUMS_PIVOT_LABEL": "albums ({0})",
+ "IDS_SEARCH_ALBUMS_RESULT_TITLE": "Album results for \"{0}\"",
+ "IDS_SEARCH_ALL_PIVOT_LABEL": "all results ({0})",
+ "IDS_SEARCH_ARTISTLOCAL_LABEL": "Artist \nCollection \n({0})",
+ "IDS_SEARCH_ARTISTMARKETPLACE_LABEL": "Music Store: \nArtists \n({0})",
+ "IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL": "Artists ({0})",
+ "IDS_SEARCH_ARTISTS_PIVOT_LABEL": "artists ({0})",
+ "IDS_SEARCH_ARTISTS_RESULT_TITLE": "Artist results for \"{0}\"",
+ "IDS_SEARCH_BUTTON": "Search",
+ "IDS_SEARCH_FILTER_ALL": "all results",
+ "IDS_SEARCH_FILTER_COLLECTION": "My videos",
+ "IDS_SEARCH_FILTER_MARKETPLACE": "all music",
+ "IDS_SEARCH_FILTER_MARKETPLACE_VIDEO": "Xbox Video Store",
+ "IDS_SEARCH_HCR_WITH_KEYWORD_NAR": "Best match for {0}",
+ "IDS_SEARCH_INMYVIDEOS_LABEL": "in my videos",
+ "IDS_SEARCH_MODIFIER_PIVOT_LABEL": "All",
+ "IDS_SEARCH_MOVIELOCAL_LABEL": "My \nFilms \n({0})",
+ "IDS_SEARCH_MOVIEMARKETPLACE_LABEL": "Video Store: \nFilms \n({0})",
+ "IDS_SEARCH_MUSICHUB_TITLE": "music ({0})",
+ "IDS_SEARCH_NORESULT_TITLE": "no results for \"{0}\"",
+ "IDS_SEARCH_NORESULT_TITLE_TC": "No Results for \"{0}\"",
+ "IDS_SEARCH_NOTSIGNEDIN": "Sign in to see full results.",
+ "IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL": "My \nvideos \n({0})",
+ "IDS_SEARCH_PIVOT": "search",
+ "IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL": "Playlists ({0})",
+ "IDS_SEARCH_PLAYLISTS_PIVOT_LABEL": "playlists ({0})",
+ "IDS_SEARCH_RESULT_TITLE": "results for \"{0}\"",
+ "IDS_SEARCH_RESULT_TITLE_TC": "Results for \"{0}\"",
+ "IDS_SEARCH_SEARCHSTARTED": "searching...",
+ "IDS_SEARCH_SONGLOCAL_LABEL": "My \nSongs \n({0})",
+ "IDS_SEARCH_SONGMARKETPLACE_LABEL": "Music Store: \nSongs \n({0})",
+ "IDS_SEARCH_SONGS_GROUP_HEADER_LABEL": "Songs ({0})",
+ "IDS_SEARCH_SONGS_PIVOT_LABEL": "songs ({0})",
+ "IDS_SEARCH_TRACKS_RESULT_TITLE": "Song results for \"{0}\"",
+ "IDS_SEARCH_TVSERIESLOCAL_LABEL": "My \nTV Programmes \n({0})",
+ "IDS_SEARCH_TVSERIESMARKETPLACE_LABEL": "Video Store: \nTV Programmes \n({0})",
+ "IDS_SEARCH_VIDEOHUB_TITLE": "videos ({0})",
+ "IDS_SEE_ALL_BUTTON": "Show all",
+ "IDS_SEE_LESS_BUTTON": "Show less",
+ "IDS_SEE_MORE_BUTTON": "Show more",
+ "IDS_SERVICE_UNAVAILABLE_CAPTION": "Sorry, the Xbox service isn't available right now.",
+ "IDS_SET_BUTTON": "Set",
+ "IDS_SETTINGS_ABOUT_ABOUT_ADS": "About our ads",
+ "IDS_SETTINGS_ABOUT_CODE_CONDUCT": "Code of Conduct",
+ "IDS_SETTINGS_ABOUT_DESCRIPTION": "This computer program is protected by copyright law and international treaties. Unauthorised reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.",
+ "IDS_SETTINGS_ABOUT_LEARN_MORE": "Learn more at Xbox.com",
+ "IDS_SETTINGS_ABOUT_ONLINE_CONTENT": "Online content",
+ "IDS_SETTINGS_ABOUT_PRERELEASE_VERSION": "Version: {0} ({1}, {2}{3})",
+ "IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT": "Privacy statement",
+ "IDS_SETTINGS_ABOUT_SUPPORT": "Support",
+ "IDS_SETTINGS_ABOUT_TITLE": "About",
+ "IDS_SETTINGS_ABOUT_TOS": "Terms of Service",
+ "IDS_SETTINGS_ABOUT_VERSION_FORMAT": "{0}.{1}.{2}.{3}",
+ "IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC": "Billing History",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC": "Billing Contact Information",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC": "Contact Preferences",
+ "IDS_SETTINGS_ACCOUNT_CURRENT_USER": "You're signed in as {0}",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC": "Manage Xbox Music Devices",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC": "Manage Payment Options",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC": "Get Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL": "Trial 14 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH": "Free 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH": "Free 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH": "Free 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC": "Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH": "1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH": "Prepaid 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH": "Prepaid 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH": "Prepaid 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL": "Trial 30 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH": "12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC": "Privacy and Online Settings",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC": "Enter a code to get a Gold Membership, Xbox Music Pass, or other stuff (where available).",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC": "Redeem Code",
+ "IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC": "Sign Out",
+ "IDS_SETTINGS_ACCOUNT_TITLE": "Account",
+ "IDS_SETTINGS_ACCOUNT_TITLE_TC": "My Account",
+ "IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC": "Your Account",
+ "IDS_SETTINGS_CAPTIONS_AUTO_MUTED": "Show captions when sound is muted",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR": "Caption background colour",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY": "Background transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR": "Character colour",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY": "Character transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE": "Character size",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLACK": "black",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLUE": "blue",
+ "IDS_SETTINGS_CAPTIONS_COLOR_CYAN": "cyan",
+ "IDS_SETTINGS_CAPTIONS_COLOR_GREEN": "green",
+ "IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA": "magenta",
+ "IDS_SETTINGS_CAPTIONS_COLOR_RED": "red",
+ "IDS_SETTINGS_CAPTIONS_COLOR_WHITE": "white",
+ "IDS_SETTINGS_CAPTIONS_COLOR_YELLOW": "yellow",
+ "IDS_SETTINGS_CAPTIONS_DEFAULT": "default",
+ "IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE": "Character edge style",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED": "depressed",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DROP": "dropshadow",
+ "IDS_SETTINGS_CAPTIONS_EDGE_NONE": "none",
+ "IDS_SETTINGS_CAPTIONS_EDGE_RAISED": "raised",
+ "IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED": "uniform",
+ "IDS_SETTINGS_CAPTIONS_FONT_CASUAL": "casual",
+ "IDS_SETTINGS_CAPTIONS_FONT_CURSIVE": "cursive",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS": "monospaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF": "monospaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS": "proportionally spaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF": "proportionally spaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS": "small capitals",
+ "IDS_SETTINGS_CAPTIONS_FONT_STYLE": "Font style",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE": "solid",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT": "semi-transparent",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT": "transparent",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW": "Preview",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE": "Caption preview",
+ "IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT": "Reset to default",
+ "IDS_SETTINGS_CAPTIONS_SIZE_100": "100% (default)",
+ "IDS_SETTINGS_CAPTIONS_SIZE_150": "150%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_200": "200%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_50": "50%",
+ "IDS_SETTINGS_CAPTIONS_TITLE": "Captions",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_COLOR": "Window colour",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY": "Window transparency",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE": "Automatically download songs here after you add or buy them on other devices",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE": "Automatically download songs here after you buy them on other devices",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC": "Buying music",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS": "Please tell us about your experience, including relevant album, song, and artist names. The more details, the better!",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO": "Buying or renting a video",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS": "Tell us about your experience, including relevant series name, season number, episode name and film title. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_CANCEL": "Cancel",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN": "Cannot sign in",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS": "Please tell us about your experience. The more details, the better!",
+ "IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW": "Viewing my collection",
+ "IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION": "Comments",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED": "Connected device",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS": "Please tell us about your experience, including the type of device you are using.",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT": "Problem with store info (wrong art, wrong name, etc.)",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK": "Media playback",
+ "IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY": "Discovering content",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION": "Thanks for your feedback! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG": "Thanks for your feedback, {0}! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC": "Downloading music",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO": "Downloading a video",
+ "IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY": "Auto-playing next episode",
+ "IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS": "Please tell us about what you were doing when you had the error occur.",
+ "IDS_SETTINGS_FEEDBACK_GENERALERRORS": "General error",
+ "IDS_SETTINGS_FEEDBACK_GHOSTTEXT": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_GREATAPP": "Great app",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT": "Music format",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS": "Please tell us about your experience, including the formats or file types you are needing to use.",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA": "Music metadata",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS": "Please give us your feedback, including relevant album and artist names and a description of the problem encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_NOCONNECTION": "Connect to the internet to submit your feedback.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE": "Problem in the app (error, confusing behaviour, etc.)",
+ "IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE": "Problem with the way something plays or appears in the app",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION": "Choose a category for your feedback and enter your comments below.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE": "Dislike",
+ "IDS_SETTINGS_FEEDBACK_OPTION_LIKE": "Like",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC": "Playing music",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS": "Please tell us about your experience, including whether you were playing your own music or songs from Xbox.",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO": "Playing a video",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS": "Please tell us about your experience, including whether you were playing your own video or something from Xbox Video.",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS": "Please provide artist, album and/or track name and describe the issue encountered.",
+ "IDS_SETTINGS_FEEDBACK_REQUESTCONTENT": "Request content",
+ "IDS_SETTINGS_FEEDBACK_SAS_TEXT": "Want to report an issue?",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC": "Music streaming",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS": "Please tell us about your experience, including relevant album, song, artist names, and if you're using a subscription. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO": "Streaming a video",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS": "Please tell us about your experience, including relevant series name, season number, episode name, film title, and if you were attempting to download or stream the video. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUBMIT": "Submit",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION": "Suggestion",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS": "Please tell us about changes you would like to see. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS": "Got Ideas?",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC": "Go to the Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO": "Go to the Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC": "Go to the Xbox Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO": "Go to the Xbox Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SYNC": "Sync/cloud",
+ "IDS_SETTINGS_FEEDBACK_TITLE": "Feedback",
+ "IDS_SETTINGS_FEEDBACK_TRAILER": "Watching a trailer",
+ "IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS": "Please tell us about your experience, including any relevant titles. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO": "Go to XboxVideoUserVoice.com and tell us what we should add.",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT": "Video format",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS": "Please tell us about your experience, including the formats or file types you want to use.",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC": "Wrong music info",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS": "Please give us your feedback including relevant album, song, artist names and a description of the problem you encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_WRONGVIDEO": "Wrong video info",
+ "IDS_SETTINGS_FORGET_ME": "Remove",
+ "IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE": "{0}%",
+ "IDS_SETTINGS_HELP_TITLE": "Help",
+ "IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_SUBTITLE": "The songs you've put on OneDrive will become the master version. This won't affect songs that aren't duplicates.",
+ "IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_TITLE": "Automatically clean up duplicate tracks",
+ "IDS_SETTINGS_ONEDRIVE_TITLE": "OneDrive",
+ "IDS_SETTINGS_PREFERENCE_ACCOUNT": "Switch users",
+ "IDS_SETTINGS_PREFERENCE_TITLE": "Preferences",
+ "IDS_SETTINGS_PROMPT_TOGGLE_TITLE": "Ask me to sign in before completing purchases or managing my account",
+ "IDS_SETTINGS_RESET_CLOUD_SUBTITLE": "Delete your playlists, and any music you've added or downloaded from the Music catalogue",
+ "IDS_SETTINGS_RESET_CLOUD_TITLE": "Reset",
+ "IDS_SETTINGS_SWITCH_USER": "Switch users",
+ "IDS_SETTINGS_SWITCH_USER_DESCRIPTION": "This app is designed for use by one person at a time. To switch users, select Remove. This will sign you out of the app and reset all app settings. Signing out will not delete any music or videos.",
+ "IDS_SETTINGS_TITLE": "Settings",
+ "IDS_SHARE_EMPTY_MESSAGE_ALBUM": "Sorry, that album can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_ARTIST": "Sorry, that artist can't be shared because they're not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MOVIE": "Sorry, that film can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MUSIC": "To share something, select an artist, album, or song.",
+ "IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO": "Sorry, that video can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TRACK": "Sorry, that song can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE": "Sorry, that episode can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SEASON": "Sorry, that season can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SERIES": "Sorry, that series can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_VIDEO": "First, choose a film or TV programme to share.",
+ "IDS_SHARE_FILES_MUSIC_DESCRIPTION": "Files from the Music app",
+ "IDS_SHARE_FRIEND_REQUEST": "{0} wants to be friends!",
+ "IDS_SHARE_FRIEND_REQUEST_LINK": "Add them on {0}Xbox.com{1}",
+ "IDS_SHARE_GAME_TEXT": "Check out {0}",
+ "IDS_SHARE_LEADER_BOARD_TEXT": "In {0}, {1} ranks {2} among their friends",
+ "IDS_SHARE_MORE_MICROSOFT_DOT_COM": "See more at {0}Microsoft.com{1}",
+ "IDS_SHARE_MORE_XBOX_DOT_COM": "See more at {0}Xbox.com{1}",
+ "IDS_SHARE_MORE_XBOXVIDEO_DOT_COM": "See more at {0}XboxVideo.com{1}",
+ "IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_SHARE_MUSIC_CONCATENATION": "{0} {1}",
+ "IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL": "[[1]{0} playlist][[*]{0} playlists]",
+ "IDS_SHARE_MUSIC_SONG_COUNT_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_SHARE_PROFILE": "Share profile",
+ "IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT": "{0} unlocked the {1} achievement in {2}",
+ "IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT": "{0} hasn't unlocked the {1} achievement in {2}",
+ "IDS_SHARE_TELL_FRIEND_ADD": "Tell your friends to add you",
+ "IDS_SHOW_ALL_MODIFIER": "show all",
+ "IDS_SHOW_FEATURED_MODIFIER": "show featured",
+ "IDS_SIGNIN_COMPLETE": "Signed in",
+ "IDS_SIGNIN_ERROR": "Can't sign in",
+ "IDS_SIGNIN_ERROR_CAPTION": "Sign in",
+ "IDS_SIGNIN_ERROR_MORE_INFO": "More info",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_DESC": "You can still use this app, but the app needs to restart. Click close to restart the app.",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_TITLE": "The region for your Xbox profile is different from your Windows region.",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT": "Click here to sign in",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE": "Sign In",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT": "Get the most from your apps",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE": "Sign up with Xbox",
+ "IDS_SIGNIN_PROGRESS": "Signing in",
+ "IDS_SIGNIN_RETRY": "Try again",
+ "IDS_SMARTDJ_ERROR_CAPTION": "Smart DJ",
+ "IDS_SNAPPED_DETAILS_OVERVIEW_TITLE": "overview",
+ "IDS_SNAPPED_DETAILS_PLAYLIST_TITLE": "playlist",
+ "IDS_SNAPPED_DETAILS_POSTROLL_TITLE": "what's next",
+ "IDS_SNAPPED_DETAILS_RECOMMEND_LABEL": "recommended",
+ "IDS_SNAPPED_DETAILS_REPLAY_LABEL": "Play Again",
+ "IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL": "Shuffle",
+ "IDS_SNAPPED_GO_FULLSCREEN_MESSAGE": "To start something, go to full screen.",
+ "IDS_SNAPPED_MUSIC_HEADER": "Start listening",
+ "IDS_SNAPPED_MUSIC_UNSNAP_TEXT": "Find something to play",
+ "IDS_SNAPPED_VIDEO_UNSNAP_TEXT": "Find something to watch",
+ "IDS_SOCIAL_PIVOT": "social",
+ "IDS_SORT_FILTER_CONTROL_ACC_FILTER": "Filter",
+ "IDS_SORT_FILTER_CONTROL_ACC_SORT": "Sort",
+ "IDS_SORTED_BY": "{0} by",
+ "IDS_SWIPE_HORIZONTALLY_TO_SELECT": "Swipe left to select",
+ "IDS_SWIPE_VERTICALLY_TO_SELECT": "Swipe down to select",
+ "IDS_TIME_ARIA_ZERO": "0:0",
+ "IDS_TIME_DISPLAY_ZERO": "0:00",
+ "IDS_TOS_ACCEPT_BUTTON": "I Accept",
+ "IDS_TOS_ACCEPT_CHECKBOX": "I accept the Xbox Live Terms of Use agreement",
+ "IDS_TOS_ACCEPT_ERROR": "You must accept the Terms of Use to proceed.",
+ "IDS_TOS_CANCEL": "Cancel",
+ "IDS_TOS_TEXT_HEADER": "Please review and accept",
+ "IDS_TOS_TITLE": "Attention",
+ "IDS_TOS_UPDATE_DESC": "The Xbox Terms of Use have recently been updated. Please review and accept the new Terms of Use agreement before you sign in.",
+ "IDS_TOS_UPDATE_HEADER": "Updated Terms of Use",
+ "IDS_TOUCHPAD_SUBTITLE1": "press and slide",
+ "IDS_TOUCHPAD_SUBTITLE2": "tap to select",
+ "IDS_TOUCHPAD_TITLE": "select",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL": "Closed captioning",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE": "Not available",
+ "IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON": "No speakers or headphones.",
+ "IDS_TRANSPORT_CONTROLS_MUTE_LABEL": "Mute",
+ "IDS_TRANSPORT_CONTROLS_NEXT_BUTTON": "Next",
+ "IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON": "Pause",
+ "IDS_TRANSPORT_CONTROLS_PLAY_BUTTON": "Play",
+ "IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON": "Play here",
+ "IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON": "Play on Xbox",
+ "IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON": "Playback options",
+ "IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON": "Previous",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON": "Repeat",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON": "Repeat: off",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON": "Repeat: on",
+ "IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON": "Resume on Xbox",
+ "IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL": "Progress bar",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON": "Shuffle",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON": "Shuffle: off",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON": "Shuffle: on",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON": "Turn repeat off",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON": "Turn repeat on",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON": "Turn shuffle off",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON": "Turn shuffle on",
+ "IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL": "Unmute",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON": "Volume \n{0}",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON": "Muted",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL": "Volume",
+ "IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON": "Remote",
+ "IDS_TV_SEASON_NAME": "Season {0}",
+ "IDS_TV_SEASON_NAME_LC": "season {0}",
+ "IDS_UNKNOWN_VALUE": "unknown",
+ "IDS_UNPIN_FROM_START_SCREEN_BUTTON": "Unpin from start",
+ "IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION": "Click to get Windows 8.1",
+ "IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT": "To use Xbox services, get the latest version of the app.",
+ "IDS_VERSION_CHECK_SERVICE_TITLE": "Update available",
+ "IDS_VERSION_CHECK_SIGNIN_TEXT": "Get the latest version of the app.",
+ "IDS_VERSION_CHECK_UPGRADE_CAPTION": "Your app needs an update.",
+ "IDS_VERSION_CHECK_UPGRADE_LINK": "Get the update",
+ "IDS_VERSION_CHECK_UPGRADE_TEXT": "To keep using this app, get the latest version at the Windows Store.",
+ "IDS_VIDEO_APP_TITLE": "video",
+ "IDS_VIDEO_COLLECTION_EMPTY": "Videos you purchase from Xbox Video will appear here.",
+ "IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK": "Xbox Video home",
+ "IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK": "Search",
+ "IDS_VIDEO_FEATURED_PIVOT": "featured",
+ "IDS_VIDEO_GENRES_PIVOT": "genres",
+ "IDS_VIDEO_NETWORKS_PIVOT": "networks",
+ "IDS_VIDEO_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_VIDEO_PIVOT": "videos",
+ "IDS_VIDEO_STUDIOS_PIVOT": "studios",
+ "IDS_VIDEO_TOP_SELLING_PIVOT": "top selling",
+ "IDS_VIDEO_TV_FREE_EPISODES_PIVOT": "free tv",
+ "IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT": "last night's programmes",
+ "IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK": "Film store",
+ "IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK": "My videos",
+ "IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK": "TV store",
+ "IDS_VIEW_ALL": "Show all",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT": "Next",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION": "Do you want us to ask for your password every time you make a purchase? You can change this preference later in Settings, Preferences.",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE": "Password prompt for purchase?",
+ "IDS_WEBHOST_RESIZE_WINDOW_BODY": "Make your window larger or rotate your device.",
+ "IDS_WEBHOST_RESIZE_WINDOW_TITLE": "Your screen needs to be wider",
+ "IDS_WEBHOST_ROTATE_BODY": "To use this feature, change your screen orientation by turning your device.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_BODY": "To work correctly, this feature needs more of your screen. Increase the size of the app window or rotate your device to continue.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY": "Increase the size of the app window (turning your device if needed).",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE": "The app needs more width on your screen to continue",
+ "IDS_WEBHOST_ROTATE_TITLE": "Please rotate your device",
+ "IDS_WHATSNEW_NOTIFICATION_SUBTITLE": "Click to see what's better",
+ "IDS_WHATSNEW_POPUP_LINK": "Read the full release notes",
+ "IDS_XBOX_GET_FOR_XBOX": "Get for Xbox 360",
+ "IDS_XBOX_MUSIC_APP_TITLE": "xbox music",
+ "IDS_XBOX_PLAY_TO_DEVICE": "Play To",
+ "IDS_XBOX_VIDEO_APP_TITLE": "xbox video",
+ "IDS_YES_BUTTON": "Yes",
+ "IDS_COLLECTION_CLOUDV2_BANNER1_ACTION": "Get started",
+ "IDS_COLLECTION_CLOUDV2_BANNER1_ACTION2": "Enrol now",
+ "IDS_COLLECTION_CLOUDV2_BANNER1_TITLE": "Play your music wherever you go. Just add songs to your Music folder on OneDrive.",
+ "IDS_COLLECTION_CLOUDV2_BANNER2_ACTION": "Filter to show only my music on OneDrive",
+ "IDS_COLLECTION_CLOUDV2_BANNER2_TITLE": "Did you know... Songs you've put in your OneDrive Music folder show up here.",
+ "IDS_MUSIC_ACTION_TRY_FOR_FREE": "Try for free",
+ "IDS_MUSIC_ACTION_VIEW_UNPLAYABLE": "How to view unplayable content",
+ "IDS_MUSIC_ALBUM_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE": "Some songs in this album can't be played.",
+ "IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE": "This album is explicit and your Xbox Live account settings prevent you from playing it.",
+ "IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are explicit and your Xbox Live account settings prevent you from playing them.",
+ "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY": "Download the album now",
+ "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_TITLE": "This album can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album can't be streamed at the request of the copyright holder, but you can still download them to listen.",
+ "IDS_MUSIC_ALBUM_DETAILS_ITEM_EXPLICIT_BANNER_NOTIFICATION_TITLE": "This song contains explicit lyrics and is blocked by your Xbox Live account settings.",
+ "IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY": "Tap the icons beside the songs to learn more.",
+ "IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE": "Some songs in this album have play or purchase restrictions required by the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so this album can't be streamed.",
+ "IDS_MUSIC_ALBUM_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so some songs in this album can't be streamed.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY": "Start your free trial",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_TITLE": "This album is available only with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are available only with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_BANNER_NOTIFICATION_TITLE": "This album is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_BANNER_NOTIFICATION_TITLE": "This album hasn't been released yet. Check back soon!",
+ "IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album haven't been released yet. Check back soon!",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_BANNER_NOTIFICATION_TITLE": "This album is only available for purchase at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are only available for purchase at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY": "Buy the album now",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE": "The songs in this album can only be purchased as part of the full album.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_BANNER_NOTIFICATION_TITLE": "This album can't be purchased at the request of the copyright holder, but you can still buy the songs individually.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "This album can't be purchased at the request of the copyright holder, but you can still buy some of the songs individually.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are only available when purchasing the full album.",
+ "IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_BANNER_NOTIFICATION_TITLE": "The songs in this album can't be downloaded for offline listening at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album can't be downloaded for offline listening at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_BANNER_NOTIFICATION_TITLE": "This album isn't available through Xbox Music.",
+ "IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album aren't available through Xbox Music.",
+ "IDS_MUSIC_ALBUM_NOT_AVAILABLE_BANNER_FREE_USER": "To restore hidden albums to your collection, you'll need an Xbox Music Pass.",
+ "IDS_MUSIC_ARTIST_ALL_ALBUMS_TITLE": "{0} : Albums",
+ "IDS_MUSIC_ARTIST_DETAILS_COLLECTION_ALBUMS_TITLE": "In Collection",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_BODY": "It's easy to listen to your music everywhere. Tap here to get started.",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_TITLE": "Want your music on all your devices?",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_OFF_TOOLTIP": "Add music to Cloud",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_ON_TOOLTIP": "Return to Collection",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_FREE_FLYOUT_BODY": "This album contains free streaming music from Xbox Music.\n \nYou can stream this for free on any Windows 8 PC and on the web. An Xbox Music Pass is required to play this on your phone or on your Xbox console.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_PASS_FLYOUT_BODY": "This album contains music you got with your Xbox Music Pass.\n \nIt already roams to all your devices, without you having to do anything.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_ACTION": "Try an Xbox Music Pass free for 30 days",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_BODY": "This is free streaming music from Xbox Music.\n \nYou can stream this for free on any Windows 8 PC and on the web. An Xbox Music Pass is required to play this on your phone or on your Xbox console.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PASS_FLYOUT_BODY": "This is music you got with your Xbox Music Pass.\n \nIt already roams to all your devices, without you having to do anything.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PURCHASED_FLYOUT_BODY": "This song was purchased from Xbox Music.\n \nIt already roams to all your devices, without you having to do anything.",
+ "IDS_MUSIC_COLLECTION_BY_ALBUM_SORT": "By album",
+ "IDS_MUSIC_COLLECTION_BY_ALPHA_SORT": "By a to z",
+ "IDS_MUSIC_COLLECTION_BY_ALPHA_SORT_LC": "by a to z",
+ "IDS_MUSIC_COLLECTION_BY_ARTIST_SORT": "By artist",
+ "IDS_MUSIC_COLLECTION_BY_DATEADDED_SORT": "By date added",
+ "IDS_MUSIC_COLLECTION_BY_GENRE_SORT": "By genre",
+ "IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT": "By popularity",
+ "IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT_LC": "by popularity",
+ "IDS_MUSIC_COLLECTION_BY_RELEASEYEAR_SORT": "By release year",
+ "IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_BODY": "Show just your offline music",
+ "IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so some of your collection can't be streamed.",
+ "IDS_MUSIC_DETAILS_CLEAR_DOWNLOAD_ERROR_ACTION": "Clear download error",
+ "IDS_MUSIC_DETAILS_OFFLINE_BANNER_NOTIFICATION_BODY": "Connect to the Internet to listen.",
+ "IDS_MUSIC_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_BODY": "Show just the offline songs",
+ "IDS_MUSIC_DETAILS_RETRY_DOWNLOAD_ACTION": "Retry download",
+ "IDS_MUSIC_DEVICES_CATEGORY1_FREE": "Windows 8.1, music.xbox.com",
+ "IDS_MUSIC_DEVICES_CATEGORY2_FREE": "Xbox One, Xbox 360, Windows Phone, iOS®, Android™",
+ "IDS_MUSIC_DEVICES_EMPTY_ERROR_BODY": "Please try again later.",
+ "IDS_MUSIC_DEVICES_EMPTY_ERROR_HEADER": "Sorry, we're having trouble showing what's available on your devices.",
+ "IDS_MUSIC_DEVICES_EMPTY_MATCHING_BODY": "Music matching lets you listen to the music from this PC on other devices. Just match your music to what we have at Xbox Music. (If a song isn't found at Xbox Music, it's not matched.)",
+ "IDS_MUSIC_DEVICES_EMPTY_MATCHING_HEADER": "It looks like you haven't enabled music matching.",
+ "IDS_MUSIC_DEVICES_EMPTY_MATCHING_LINK": "Match my music",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_FREE": "Music shown here will appear when you sign in to Xbox Music on a device.",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_PASS": "Music shown here will appear when you sign in to Xbox Music on Windows 8.1, Xbox One, Xbox 360, music.xbox.com, Windows Phone, iOS® and Android™.",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_UNAUTH": "Sign in to Xbox Music to see what's available on all your devices.",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE2_FREE": "Tap on a device category to see what music will be available there.",
+ "IDS_MUSIC_DEVICES_TITLE": "Music On Your Devices",
+ "IDS_MUSIC_DEVICES_UPSELL_HEADER": "Using Xbox Music on these devices requires an Xbox Music Pass.",
+ "IDS_MUSIC_DEVICES_UPSELL_LINK": "Try Xbox Music Pass free for 30 days",
+ "IDS_MUSIC_DEVICES_UPSELL_LINK_GENERIC": "Get an Xbox Music Pass",
+ "IDS_MUSIC_DEVICES_VIEW_ALBUM_LINK": "View album in collection",
+ "IDS_MUSIC_DEVICES_VIEW_ARTIST_LINK": "View artist in collection",
+ "IDS_MUSIC_DTO_BUY_ALBUM_TEXT": "Buy album for {0}",
+ "IDS_MUSIC_DTO_BUY_FREE_TEXT": "Get it free",
+ "IDS_MUSIC_DTO_BUY_TRACK_TEXT": "Buy song for {0}",
+ "IDS_MUSIC_DTO_CANT_BUY_TEXT": "Sorry, that isn't available for purchase from Xbox Music.",
+ "IDS_MUSIC_DTO_CONFIRM_FLYOUT_BODY": "We'll download it here in just a second. With your purchase you can also download on other devices.",
+ "IDS_MUSIC_DTO_CONFIRM_FLYOUT_TITLE": "Thanks for your purchase!",
+ "IDS_MUSIC_DTO_VIEW_ALBUM_TEXT": "View album in catalogue",
+ "IDS_MUSIC_EDIT_METADATA_ALBUM_ACTION": "Edit info",
+ "IDS_MUSIC_EDIT_METADATA_ALBUM_DIALOG_TITLE": "Edit Album Info",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_CANCEL": "Cancel",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_SAVE": "Save",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_BUTTON": "Change art",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LABEL": "Album art",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LOAD_ERROR": "That image didn't work. Try another one.",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_ARTIST": "Album artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE": "Album genre",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE_CUSTOM": "Custom genre",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_ARTIST": "Album sort artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_TITLE": "Album sort title",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_TITLE": "Album title",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_DISC_NUMBER": "Disc",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_RELEASE_YEAR": "Year",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_ARTIST": "Song artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_GENRE": "Song genre",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_ARTIST": "Song sort artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_TITLE": "Song sort title",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_NUMBER": "Song",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_TITLE": "Song title",
+ "IDS_MUSIC_EDIT_METADATA_ERROR_DESCRIPTION": "Try something else. That text won't work.",
+ "IDS_MUSIC_EDIT_METADATA_ERROR_TITLE": "Can't Edit",
+ "IDS_MUSIC_EDIT_METADATA_MULTI_ERROR_MESSAGE": "Some entries won't work. See the highlighted boxes.",
+ "IDS_MUSIC_EDIT_METADATA_SINGLE_ERROR_MESSAGE": "Some entries won't work. See the highlighted box.",
+ "IDS_MUSIC_EDIT_METADATA_SONG_ACTION": "Edit info",
+ "IDS_MUSIC_EDIT_METADATA_SONG_DIALOG_TITLE": "Edit Song Info",
+ "IDS_MUSIC_EDIT_METADATA_TOGGLE_SORT_FIELDS": "Show sorts",
+ "IDS_MUSIC_ERROR_DETAILS": "Sorry, Xbox Music isn't available right now. Try it again soon.",
+ "IDS_MUSIC_ERROR_HEADER": "Sorry!",
+ "IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_BODY": "Edit your account settings",
+ "IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE": "Your Xbox Live account doesn't allow you to play explicit content.",
+ "IDS_MUSIC_FEATURED_TITLE": "Featured Music",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_ACTION": "Got it",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_BODY": "Streaming and radio are now only available with an Xbox Music Pass. Music you own still works the same.",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_ACTION": "Check out what's free",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_BODY": "Choose your own holiday gifts from a choice set of albums. Keep them forever.",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_TITLE": "Holiday Freebies",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_ACTION": "Try for free",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_BODY": "Unlimited streaming anywhere you take Xbox Music. Download songs to play offline. Try it free for 30 days*.",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_TITLE": "Try Xbox Music Pass for free",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_TITLE": "Things have changed around here",
+ "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_ACTION": "Got it",
+ "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_BODY": "With free streaming gone from Xbox Music, to play some songs in your collection you need an Xbox Music Pass. We've hidden those songs for now, so you won't keep trying to play the unplayable.",
+ "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_TITLE": "We're cleaning up your collection",
+ "IDS_MUSIC_FREEBIES_TITLE": "Holiday Freebies",
+ "IDS_MUSIC_HIDE_MENU": "Hide menu",
+ "IDS_MUSIC_MANAGE_FOLDERS_TITLE": "Build your collection from your local music files",
+ "IDS_MUSIC_MODULE_SHOW_ALL_GENRES": "View genres",
+ "IDS_MUSIC_MODULE_SHOW_ALL_LABEL": "View all {0}",
+ "IDS_MUSIC_MODULE_VIEW_ALL_ALBUMS": "View all albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_ARTISTS": "View all artists",
+ "IDS_MUSIC_MODULE_VIEW_ALL_LATEST_ALBUMS": "View all latest albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_NEW_ALBUMS": "View all new albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_SONGS": "View all songs",
+ "IDS_MUSIC_MODULE_VIEW_ALL_TOP_ALBUMS": "View all top albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_TOP_ARTISTS": "View all top artists",
+ "IDS_MUSIC_MODULE_VIEW_ALL_TOP_SONGS": "View all top songs",
+ "IDS_MUSIC_MODULE_VIEWALL": "View all",
+ "IDS_MUSIC_NEW_ALBUMS_TITLE": "New Albums",
+ "IDS_MUSIC_NOW_PLAYING_ARTIST_RADIO": "{0} Radio",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION": "Play from collection",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION_DESC": "Choose tunes from your existing stash.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE": "Explore the Xbox Music catalogue",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE_DESC": "Check out new artists and popular tracks.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO": "Start a radio station",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO_DESC": "Instantly make custom stations for your favourite performers.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_SUBTITLE": "Songs you play will show up here.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_TITLE": "Nothing's on right now",
+ "IDS_MUSIC_NOW_PLAYING_ENTER_FULLSCREEN_ACTION": "Switch to full screen",
+ "IDS_MUSIC_NOW_PLAYING_EXIT_FULLSCREEN_ACTION": "Leave full screen",
+ "IDS_MUSIC_NOW_PLAYING_SC": "Now playing",
+ "IDS_MUSIC_NOW_PLAYING_UNHIDE_BUTTONS_NARRATOR": "Show hidden now playing buttons",
+ "IDS_MUSIC_OFFLINE_DETAILS": "Connect to the internet, then we'll be able to show you more.",
+ "IDS_MUSIC_OFFLINE_HEADER": "Looks like you're offline",
+ "IDS_MUSIC_PIN_RADIO_TILE_NAME": "{0} radio",
+ "IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_BODY": "Tap the icons beside the songs to learn more.",
+ "IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE": "Some songs in this playlist can't be played on this device.",
+ "IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so this playlist can't be streamed.",
+ "IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so some songs in this playlist can't be streamed.",
+ "IDS_MUSIC_RELEASE_NOTE_BUGS": "Minor fixes and improvements",
+ "IDS_MUSIC_SAVE_NOW_PLAYING_PLAYLIST": "Save as a playlist",
+ "IDS_MUSIC_SEARCH_ALBUM_RESULTS": "Albums",
+ "IDS_MUSIC_SEARCH_ARTIST_RESULTS": "Artists",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER": "Full catalogue ({0})",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER_ACTION_PLURAL": "[[1]Tap to see {0} catalogue result.][[*]Tap to see {0} catalogue results.]",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER_MAX_RESULTS": "Full catalogue ({0}+)",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER_NO_COUNT": "Full catalogue",
+ "IDS_MUSIC_SEARCH_CATALOG_PLACEHOLDER": "Search catalogue",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER": "In collection ({0})",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER_ACTION_PLURAL": "[[1]Tap to see {0} collection result.][[*]Tap to see {0} collection results.]",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER_MAX_RESULTS": "In collection ({0}+)",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER_NO_COUNT": "In collection",
+ "IDS_MUSIC_SEARCH_COLLECTION_PLACEHOLDER": "Search collection",
+ "IDS_MUSIC_SEARCH_SONG_RESULTS": "Songs",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_HOURS_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1} at {2}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.][[*]You'll get {0} more hours of free music streaming on {1} at {2}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.]",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_NO_DATE": "Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.][[*]You'll get {0} more hours of free music streaming on {1}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.]",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_REACHED": "You've reached your monthly streaming limit.",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_TITLE": "Monthly streaming limit",
+ "IDS_MUSIC_SHARE_ALTERNATIVES_TEXT": "Some websites work better than others. Try one of these.",
+ "IDS_MUSIC_SHARE_CHARM_TEXT": "Create a playlist",
+ "IDS_MUSIC_SHARE_CREATE_PLAYLIST_LABEL": "Create playlist",
+ "IDS_MUSIC_SHARE_FEATURE_COMING_SOON": "This feature is coming soon!",
+ "IDS_MUSIC_SHARE_FEEDBACK": "Feedback",
+ "IDS_MUSIC_SHARE_FREE_USER_TITLE": "To create playlists from websites, get an Xbox Music Pass",
+ "IDS_MUSIC_SHARE_LOADING_CREATING_PLAYLIST": "Making a playlist.",
+ "IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC": "Looking for music.",
+ "IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC_SUB": "This may take a little while...",
+ "IDS_MUSIC_SHARE_NO_ARTIST_FOUND": "Sorry, we didn't find anything.",
+ "IDS_MUSIC_SHARE_NO_ARTIST_FOUND_SUB": "We didn't find music on this page.",
+ "IDS_MUSIC_SHARE_PARTNERS_LABEL": "Powered by Echonest",
+ "IDS_MUSIC_SHARE_PREVIEW": "Preview",
+ "IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED": "Sorry, we can't create a playlist.",
+ "IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED_SUB": "Sharing with Xbox Music isn’t supported in your region yet.",
+ "IDS_MUSIC_SHARE_REMOVE_ARTIST_LABEL": "Remove {0}",
+ "IDS_MUSIC_SHARE_REMOVE_TRACK_BY_ARTIST_LABEL": "Remove {0} by {1}",
+ "IDS_MUSIC_SHARE_SAS_FEEDBACK_COMMENTS": "Tell us about your experience.",
+ "IDS_MUSIC_SHARE_SAS_FEEDBACK_TYPE": "Creating a web playlist",
+ "IDS_MUSIC_SHARE_SAS_FEEDBACK_URL_NOTE": "We’ll send the website you’re using to create the web playlist with your feedback.",
+ "IDS_MUSIC_SHARE_SERVICE_DOWN": "Try again in a few minutes.",
+ "IDS_MUSIC_SHARE_SERVICE_DOWN_SUB": "We can’t look for music just now.",
+ "IDS_MUSIC_SHOW_MENU": "Show menu",
+ "IDS_MUSIC_SONG_CANT_PLAY_FLYOUT_BODY": "This song can't be played.",
+ "IDS_MUSIC_SONG_DOWNLOAD_ONLY_FLYOUT_BODY": "This song can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "IDS_MUSIC_SONG_NOT_AVAILABLE_BANNER_FREE_USER": "To restore hidden songs to your collection, you'll need an Xbox Music Pass.",
+ "IDS_MUSIC_SONG_PASS_ONLY_FLYOUT_BODY": "This song is available only with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_PASS_PURCHASE_FLYOUT_BODY": "This song is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_FLYOUT_BODY": "This song can't be played on this device.",
+ "IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_UNROAMED_FLYOUT_BODY": "This is a local song added from another device. It can't be played here.",
+ "IDS_MUSIC_SONG_PRE_RELEASE_FLYOUT_BODY": "This song hasn't been released yet. Check back soon!",
+ "IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY": "This song can only be purchased as part of the full album.",
+ "IDS_MUSIC_SONG_PURCHASE_ONLY_FLYOUT_BODY": "This song is only available for purchase at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_STREAMING_ONLY_FLYOUT_BODY": "This song can't be downloaded for offline listening at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_TAKEDOWN_FLYOUT_BODY": "This song has been removed from Xbox Music at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_UNAVAILABLE_FLYOUT_BODY": "This song isn't available through Xbox Music.",
+ "IDS_MUSIC_STREAMING_AD_DESC_LINK": "Why am I getting this ad?",
+ "IDS_MUSIC_STREAMING_AD_LABEL": "Advertisement",
+ "IDS_MUSIC_STREAMING_ADD_TO_MY_MUSIC_TITLE": "Want to make this part of your collection?",
+ "IDS_MUSIC_STREAMING_CANT_PLAY_DESC": "Sorry, we can't play right now. Please try again soon.",
+ "IDS_MUSIC_STREAMING_CANT_PLAY_TITLE": "Can't Play",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_DESC": "We want to be sure you're still listening.\n \nWith an Xbox Music Pass, you'll avoid interruptions like this one. You'll also get unlimited access to the music you love.",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE1": "Are you still there?",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE2": "We haven't seen you in a while. Tap here to keep playing music.",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_PLAY_ACTION": "Keep playing",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_PREMIUM_ACITON": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_TITLE": "Are you still there?",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_ACTION": "Sign in now",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_DESC": "To keep streaming music for free, sign in with your Xbox profile.",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_TITLE": "Sign in",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_ACTION": "Sign in now",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_DESC": "Xbox Music lets you stream some songs for free without signing in. You've hit your limit. But don't worry, it's easy to keep the good times rolling. Just sign in with your Microsoft Account and you'll continue to have access to stream millions of songs for free. Don't have an account? It's easy and free to sign up.",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_TITLE": "Don't let the good times end",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE1": "Keep playing for free!",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE2": "Sign in",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_HOURS_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1} at {2}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.][[*]You'll get {0} more hours of free music streaming on {1} at {2}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.]",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_NO_DATE": "Keep streaming! Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.][[*]You'll get {0} more hours of free music streaming on {1}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.]",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE1": "Free music limit reached",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE2": "Learn more",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_PC_FILTER_LINK": "Filter to just the music on this PC.",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_TITLE": "You've hit your monthly limit.",
+ "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE1": "Play for free",
+ "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2": "You have {0} more hours of free music streaming for this month.",
+ "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2_PLURAL": "[[1]You have {0} more hour of free music streaming for this month.][[*]You have {0} more hours of free music streaming for this month.]",
+ "IDS_MUSIC_STREAMING_NEXT_SONG_LABEL": "Up next",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_DESC": "Get unlimited access to the music you love with Xbox Music Pass.\nOr \nBuy the song or album from Xbox Music.",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_PREMIUM_ACTION": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_PURCHASE_ACTION": "Buy",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_TITLE": "To download, do one of the following.",
+ "IDS_MUSIC_STREAMING_PLAY_LIMIT_DESC": "This is a great time to upgrade! Xbox Music Pass gives you unlimited access to the music you love, with no interruptions. For a low monthly fee, you can use your music pass on your PC, Windows Phone, and Xbox 360.",
+ "IDS_MUSIC_STREAMING_PLAY_LIMIT_PREMIUM_ACTION": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_PLAY_LIMIT_TITLE": "Sorry, but you've maxed out your free plays for the month.",
+ "IDS_MUSIC_STREAMING_SIGN_IN_ACTION": "Sign in now",
+ "IDS_MUSIC_STREAMING_SIGN_IN_DESC": "All you need to do is sign up with Xbox or sign in with an existing Xbox profile. Don't worry, you don't need a credit card for signup.",
+ "IDS_MUSIC_STREAMING_SIGN_IN_TITLE": "Want to listen for free?",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY": "You can play any song {0} times for free.\n \nWant to play that song again? Buy the MP3 or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY_NO_COUNT": "Want to play that song again? Buy the MP3 or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_BUY_ACTION": "Buy song",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY": "You can play any song {0} times for free.\n \nWant to play these songs again? Buy the MP3s or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY_NO_COUNT": "Want to play these songs again? Buy the MP3s or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_TITLE": "You've hit your play limit.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_TITLE": "You've hit your play limit for {0} by {1}.",
+ "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_DESC": "You can use Xbox Music away from home for up to 2 weeks.\n \nTo keep playing, make sure you're using an account that matches your region.\n \nDid you know? With Xbox Music Pass you can download your music for unlimited access anywhere, anytime. Perfect for travelling.",
+ "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_PREMIUM_ACTION": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_TITLE": "Have you been travelling?",
+ "IDS_MUSIC_STREAMING_TRIAL_END_BODY": "From now on, you can stream {0} hours of music for free each month. You can always listen to music you own.\n \nCheck your remaining time in Settings, Preferences.\n \nUpgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE1": "Keep listening for free",
+ "IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE2": "Learn more",
+ "IDS_MUSIC_STREAMING_TRIAL_END_PREMIUM_LINK": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_TRIAL_END_TITLE": "Keep listening for free.",
+ "IDS_MUSIC_STREAMING_UPSELL_LABEL": "Upgrade to skip ads",
+ "IDS_MUSIC_TOP_ARTISTS_TITLE": "Top Artists",
+ "IDS_MUSIC_TOP_MUSIC_TITLE": "Top Music",
+ "IDS_MUSIC_TOP_SONGS_TITLE": "Top Songs",
+ "IDS_MUSIC_TOPALBUMS_TITLE": "Top Albums",
+ "IDS_MUSIC_TRANSFER_CANCEL_TOOLTIP": "Cancel",
+ "IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_LABEL": "Making songs available offline",
+ "IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_PROGRESS": "[[1]{0} of {1} download][[*]{0} of {1} downloads]",
+ "IDS_MUSIC_TRANSFER_UPLOAD_GROUP_LABEL": "Making songs available online",
+ "IDS_MUSIC_TRANSFER_UPLOAD_GROUP_PROGRESS": "[[1]{0} of {1} upload][[*]{0} of {1} uploads]",
+ "IDS_MUSIC_UPSELL_BANNER_LEARN_MORE": "Learn more",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION": "Sign in or sign up, and try us for free",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION2": "Try for free",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION": "Get an Xbox Music Pass",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION_ASTERISK": "Get an Xbox Music Pass*",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2": "Start your free trial",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2_ASTERISK": "Start your free trial*",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT": "Enjoy ad-free music on your phone, Xbox, PC and the web.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT2": "Take Xbox Music offline with unlimited downloads.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT3": "All music. No ads. Listen on all your devices.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT4": "Go premium for ad-free listening on all your devices.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT5": "Free streaming and free radio will end on 1 December 2014. Sign up for the Xbox Music Pass and keep the music streaming on your PC, tablet, Xbox and the web.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT": "Start your personal music collection, listen to artist radio and create playlists.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_NO_TRENDING": "Expand your musical horizons with related artists.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_TRENDING": "Expand your musical horizons with related artists and trending playlists.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT2": "Create your own library of the latest releases and favourite classics.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT3": "Create radio stations based on favourite artists and songs.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT4": "Discover new music from one of the largest digital music catalogues on the planet.",
+ "IDS_MUSIC_UPSELL_DIALOG_ACTION": "Or redeem a code",
+ "IDS_MUSIC_UPSELL_DIALOG_DISCLAIMER": "*Xbox Music Pass is streaming only on Xbox consoles and on the web. See xbox.com/music for system requirements and terms of use.",
+ "IDS_MUSIC_UPSELL_DIALOG_LINE1": "All music, no ads. Listen to millions of songs ad-free.",
+ "IDS_MUSIC_UPSELL_DIALOG_LINE2": "Stream music on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_UPSELL_DIALOG_LINE3": "Take your music offline and listen even when you're not connected.*",
+ "IDS_MUSIC_UPSELL_DIALOG_MUSIC_PASS_DISCLAIMER": "*Internet required; ISP fees apply. Xbox Music Pass 30 day trial continues to a paid monthly subscription unless cancelled. Credit card required. Limit 1 per person; prior Zune Pass trial users not eligible. On Xbox consoles and the Web, Xbox Music Pass is streaming only. Download music on up to 4 devices. Some Xbox Music content may not be available via Xbox Music Pass, and may vary over time and by region. See xbox.com/music.",
+ "IDS_MUSIC_UPSELL_DIALOG_REDEEM_BUTTON": "{0} {1}",
+ "IDS_MUSIC_UPSELL_DIALOG_TITLE": "Go premium with an Xbox Music Pass.",
+ "IDS_MUSIC_UPSELL_DIALOG_TITLE_ALT": "Thanks for being an Xbox Music Pass subscriber! Extend your subscription to stay premium.",
+ "IDS_MUSIC_WELCOME_CLOUDV2_BUTTON": "Get started",
+ "IDS_MUSIC_WELCOME_CLOUDV2_SUBTITLE": "Add your music to OneDrive so you can play it anywhere.",
+ "IDS_MUSIC_WELCOME_CLOUDV2_TITLE": "OneDrive",
+ "IDS_MUSIC_WELCOME_COLLECTION_BUTTON": "Go to collection",
+ "IDS_MUSIC_WELCOME_COLLECTION_SUBTITLE": "All your music, organised just the way you like it.",
+ "IDS_MUSIC_WELCOME_COLLECTION_TITLE": "Collection",
+ "IDS_MUSIC_WELCOME_EXPLORE_BUTTON": "Browse millions of songs",
+ "IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE": "Browse and buy from a catalogue of millions of songs.",
+ "IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE_2": "Browse and buy from a catalog of 40,000,000 songs.",
+ "IDS_MUSIC_WELCOME_EXPLORE_TITLE": "Explore Catalogue",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_BUTTON": "Get a music pass",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE": "Millions of songs to collect and play.",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE2": "Over 30 million songs to collect and play.",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_TITLE": "Go Premium",
+ "IDS_MUSIC_WELCOME_PAGE_SUBTITLE": "Your music, plus access to millions of other songs.",
+ "IDS_MUSIC_WELCOME_PAGE_TITLE": "Welcome to Xbox Music",
+ "IDS_MUSIC_WELCOME_RADIO_BUTTON": "Listen to artist radio",
+ "IDS_MUSIC_WELCOME_RADIO_SUBTITLE": "Discover new musical horizons, rediscover your favourite artists.",
+ "IDS_MUSIC_WELCOME_RADIO_TITLE": "Radio",
+ "IDS_VIDEO_AD_LEARN_MORE": "Learn more",
+ "IDS_VIDEO_AD_PROGRESS": "Music will start in {0}",
+ "IDS_VIDEO_AD_UPSELL_LINE_1": "Tired of interruptions?",
+ "IDS_VIDEO_AD_UPSELL_LINE_2": "Go premium!",
+ "IDS_APP_UPDATE_SPLASH_SUBTITLE": "This may take a few minutes, especially if you have a lot of music.",
+ "IDS_APP_UPDATE_SPLASH_TITLE": "Completing the update",
+ "IDS_COLLECTION_BY_ALBUM_TITLE": "albums",
+ "IDS_COLLECTION_BY_ARTIST_TITLE": "artists",
+ "IDS_COLLECTION_BY_SONG_TITLE": "songs",
+ "IDS_COLLECTION_FILTER_ALL": "all my music",
+ "IDS_COLLECTION_FILTER_ALL_MUSIC": "all music",
+ "IDS_COLLECTION_FILTER_ALL_SC": "All my music",
+ "IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE": "available offline",
+ "IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE_SC": "Available offline",
+ "IDS_COLLECTION_FILTER_FLYOUT_CLOUDV2": "Filter all your music to see what's on your OneDrive, streaming, or just on this device",
+ "IDS_COLLECTION_FILTER_FLYOUT_OFFLINE": "Filter all your music to see what you can stream and what's available offline",
+ "IDS_COLLECTION_FILTER_FROM_XBOX_MUSIC": "Xbox Music Pass",
+ "IDS_COLLECTION_FILTER_IN_CLOUD": "in the cloud",
+ "IDS_COLLECTION_FILTER_IN_CLOUD_SC": "In the cloud",
+ "IDS_COLLECTION_FILTER_MUSIC_EMPTY_LINK": "Show all my music",
+ "IDS_COLLECTION_FILTER_MUSIC_EMPTY_TEXT": "Your music is hidden by the filter.",
+ "IDS_COLLECTION_FILTER_ON_ONEDRIVE": "on OneDrive",
+ "IDS_COLLECTION_FILTER_ON_ONEDRIVE_SC": "On OneDrive",
+ "IDS_COLLECTION_FILTER_ONLY_ON_PC": "only on this PC",
+ "IDS_COLLECTION_FILTER_ONLY_ON_PC_SC": "Only on this PC",
+ "IDS_COLLECTION_FILTER_OWNED_MUSIC": "music I own",
+ "IDS_COLLECTION_FILTER_PURCHASED": "purchased",
+ "IDS_COLLECTION_FILTER_PURCHASED_SC": "Purchased",
+ "IDS_COLLECTION_FILTER_STREAMING": "streaming",
+ "IDS_COLLECTION_FILTER_STREAMING_SC": "Streaming",
+ "IDS_DETAILS_FILTER_AVAILABLE_OFFLINE": "Showing offline music",
+ "IDS_DETAILS_FILTER_FROM_XBOX_MUSIC": "Showing music from Xbox Music Pass",
+ "IDS_DETAILS_FILTER_IN_CLOUD": "Showing music in cloud",
+ "IDS_DETAILS_FILTER_ON_ONEDRIVE": "Showing music on OneDrive",
+ "IDS_DETAILS_FILTER_ON_PC": "Showing music on this PC",
+ "IDS_DETAILS_FILTER_PURCHASED": "Showing purchased music",
+ "IDS_DETAILS_FILTER_STREAMING": "Showing streaming music",
+ "IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE": "To make your music available in the cloud, match it with something from Xbox Music.",
+ "IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE_FREE": "By matching your music with songs from Xbox Music, you'll see it on any Windows 8/Windows RT device you sign into.",
+ "IDS_FAI_ADD_ALBUM_CLOUD_TITLE": "What's a good match for this?",
+ "IDS_FAI_ADD_ALBUM_LEARN_MORE": "Learn more",
+ "IDS_FAI_ALBUM_COLUMN_TITLE": "Albums from Xbox Music",
+ "IDS_FAI_ALBUM_SUMMARY_2": "{0}, {1}",
+ "IDS_FAI_ALBUM_SUMMARY_3": "{0}, {1}, {2}",
+ "IDS_FAI_ALBUM_SUMMARY_3_PLURAL": "[[1]{0}, {1} song, {2}][[*]{0}, {1} songs, {2}]",
+ "IDS_FAI_ALBUM_SUMMARY_4_PLURAL": "[[1]{0}, {1} song, {2}, {3}][[*]{0}, {1} songs, {2}, {3}]",
+ "IDS_FAI_AVAILABLE_TRACKS": "Available song titles",
+ "IDS_FAI_CANCEL_BUTTON": "Cancel",
+ "IDS_FAI_CHOOSE_ALBUM_CLOUD_TITLE": "Update your metadata from the Xbox Music catalogue. What’s a good match?",
+ "IDS_FAI_CHOOSE_ALBUM_TITLE": "Choose the right album",
+ "IDS_FAI_CLOUD_MATCH_BULK_LINK": "Here's how to add a bunch of albums at once >",
+ "IDS_FAI_CLOUD_MATCH_SUBTEXT": "For unmatched songs, tap to choose an available song title.",
+ "IDS_FAI_FINISH_BUTTON": "Finish",
+ "IDS_FAI_MATCH": "match",
+ "IDS_FAI_MATCH_ALBUM_COMMAND": "Music in the cloud",
+ "IDS_FAI_MATCH_COLUMN_TITLE": "We'll update metadata for marked tracks",
+ "IDS_FAI_MATCH_SONGS_SUBTITLE": "We couldn't automatically match every song from your PC to this album. You can fix the remaining tracks here. Note that not all tracks are available in Xbox Music.",
+ "IDS_FAI_MATCH_SONGS_TITLE": "Almost done.",
+ "IDS_FAI_MATCHED_SONGS": "Here's what we matched.",
+ "IDS_FAI_NEXT_BUTTON": "Next",
+ "IDS_FAI_NO_ALBUM_FOUND_ERROR": "Sorry, we can't find a match for that album. Please try another.",
+ "IDS_FAI_NO_SONGS_MATCHED_ERROR": "We didn't find any song matches.",
+ "IDS_FAI_NO_STREAMS_MATCHED_ERROR": "Sorry, that's not available from Xbox Music.",
+ "IDS_FAI_ORIGINAL_TRACK": "Original song title",
+ "IDS_FAI_SEARCH_ALBUM_HINT": "Don't see the right album?",
+ "IDS_FAI_SEARCH_ALBUM_TITLE": "Search for the right album",
+ "IDS_FAI_SONG_COLUMN_TITLE": "Songs from your album",
+ "IDS_FAI_UNMATCHED_SONGS": "We're not quite sure about these.",
+ "IDS_FIND_ALBUM_INFO_COMMAND": "Find album info",
+ "IDS_MARKETPLACE_BY_ALBUM": "by album",
+ "IDS_MARKETPLACE_BY_ARTIST": "by artist",
+ "IDS_MARKETPLACE_BY_RELEASE_DATE": "by release date",
+ "IDS_MARKETPLACE_SORT_PREFIX": "arranged by {0}",
+ "IDS_MATCH_ALBUM_INFO_COMMAND": "Match album info",
+ "IDS_MUSIC_ABOUT_PANEL_TEXT": "about",
+ "IDS_MUSIC_ABOUT_PANEL_TEXT_LC": "about",
+ "IDS_MUSIC_ADD_ALBUM_TO_LIST_TITLE_PLURAL": "[[1]Add album to:][[*]Add albums to:]",
+ "IDS_MUSIC_ADD_MUSIC_VIDEO_TO_LIST_TITLE_PLURAL": "[[1]Add music video to:][[*]Add music videos to:]",
+ "IDS_MUSIC_ADD_PLAYLIST_TO_LIST_TITLE": "Add playlist to:",
+ "IDS_MUSIC_ADD_SONG_TO_LIST_TITLE_PLURAL": "[[1]Add song to:][[*]Add songs to:]",
+ "IDS_MUSIC_ADD_TO_COLLECTION_BUTTON": "Collection",
+ "IDS_MUSIC_ADD_TO_LIST_BUTTON": "Add to",
+ "IDS_MUSIC_ADD_TO_LIST_CLOUD_ACTION": "Music in the cloud",
+ "IDS_MUSIC_ADD_TO_LIST_CLOUD_COLLECTION_ACTION": "Cloud collection",
+ "IDS_MUSIC_ADD_TO_LIST_COLLECTION_ACTION": "My music",
+ "IDS_MUSIC_ADD_TO_LIST_DEVICES_ACTION": "Devices",
+ "IDS_MUSIC_ADD_TO_LIST_NEW_PLAYLIST_ACTION": "New playlist",
+ "IDS_MUSIC_ADD_TO_LIST_NOW_PLAYING_ACTION": "Now playing",
+ "IDS_MUSIC_ADD_TO_LIST_PLAYLIST_ACTION": "Other playlist",
+ "IDS_MUSIC_ADD_TO_LIST_TITLE": "Add {0} to:",
+ "IDS_MUSIC_ADD_TO_MY_MUSIC_BUTTON": "My music",
+ "IDS_MUSIC_ADD_TO_PLAYLIST_TITLE": "Select a playlist",
+ "IDS_MUSIC_ALBUM_BY_ARTIST": "{0} by {1}",
+ "IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_BODY": "Delete them from your collection",
+ "IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_TITLE": "Songs in this album have been removed from Xbox Music at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_ONLY_PURCHASE_TEXT": "Album only",
+ "IDS_MUSIC_ALBUM_SORT": "album",
+ "IDS_MUSIC_ALBUMS_IN_COLLECTION": "Albums in My Music",
+ "IDS_MUSIC_ARTIST_BIO_TITLE": "bio",
+ "IDS_MUSIC_ARTIST_BIO_TITLE_TC": "Bio",
+ "IDS_MUSIC_BUY_TEXT": "Buy Music",
+ "IDS_MUSIC_BY_ARTIST": "by {0}",
+ "IDS_MUSIC_CLOUD_COLLECTION_ICON_HEADER": "Collection icons",
+ "IDS_MUSIC_CLOUD_ICON_CLOSE_BUTTON": "Close",
+ "IDS_MUSIC_CLOUD_ICON_CLOUD_HEADER": "On this device and in the cloud",
+ "IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_FREE": "These are songs you can play when this device is offline. These are also available on any Windows 8/Windows RT device you sign into.",
+ "IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_XMP": "These are songs you can play when this device is offline. These are also available on any Windows Phone 8, Xbox 360, and Windows 8/Windows RT device you sign into.",
+ "IDS_MUSIC_CLOUD_ICON_HEADER": "My music icons",
+ "IDS_MUSIC_CLOUD_ICON_LEARN_MORE_TEXT": "Learn more about music in the cloud >",
+ "IDS_MUSIC_CLOUD_ICON_NONE_HEADER": "No icon?",
+ "IDS_MUSIC_CLOUD_ICON_NONE_PARA_1": "These are songs you own, available only on this device. To make them available on other devices, tap Add To and choose Cloud Collection.",
+ "IDS_MUSIC_CLOUD_ICON_NONE_PARA_1_ALT": "These are songs you own, available only on this device. To make them available on other devices, tap Add To and choose Devices.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_HEADER": "Streaming only",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_LINK": "Learn more.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_FREE": "These are songs you've added from Xbox Music. You'll see these on any Windows 8/Windows RT device you sign into. However, they can't be played offline on this device.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_XMP": "These are songs you've added from Xbox Music. You'll see these on any Windows Phone 8, Xbox 360, and Windows 8/Windows RT device you sign into. However, they can't be played offline on this device.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_FREE": "To play them offline, download them by buying them or by signing up for Xbox Music Pass.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_XMP": "To play them offline, download them.",
+ "IDS_MUSIC_CLOUD_ICON_SUB_HEADER": "You'll see the following icons on songs and albums in your music collection.",
+ "IDS_MUSIC_CLOUD_MATCH_ACCEPT_BUTTON": "Match my music",
+ "IDS_MUSIC_CLOUD_MATCH_CANCEL_BUTTON": "Maybe later",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_ALT_FREE": "When you subscribe to Xbox Music Pass, you'll also get your music on Xbox 360 and Windows Phone.",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_FREE": "Extend your music to Xbox 360 and Windows Phone 8",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_ALT_FREE": "Learn more about Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_FREE": "with Xbox Music Pass >",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_XMP": "with Xbox Music Pass >",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_XMP": "Extend your music to Xbox 360 and Windows Phone 8",
+ "IDS_MUSIC_CLOUD_MATCH_HEADER": "Music in the cloud",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_1_FREE": "Music matching lets you listen to the music from this PC on other Windows 8/Windows RT tablets and PCs. Just match your music to what we have at Xbox Music. (If a song isn't found at Xbox Music, it's not matched.)",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_1_XMP": "Music matching lets you listen to the music from this PC on several devices, like Windows Phone 8, Xbox 360, and Windows 8/Windows RT tablets and PCs. Just match your music to what we have at Xbox Music. (If a song isn't found at Xbox Music, it's not matched.)",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_2_FREE": "To match music later, see Music in the Cloud in Settings.",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_2_XMP": "To match music later, see Music in the Cloud in Settings.",
+ "IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_FREE": "Listen for free on multiple PCs",
+ "IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_XMP": "Your music, wherever you want it",
+ "IDS_MUSIC_CLOUD_SETTINGS_ICON_INFO_LINK_TEXT": "Learn about those icons in your collection",
+ "IDS_MUSIC_CLOUD_SETTINGS_MATCH_INFO_LINK_TEXT": "Find out how this works",
+ "IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC": "Automatically add matched songs on this PC to your cloud collection",
+ "IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC_ALT": "Automatically add matched songs on this PC to Devices",
+ "IDS_MUSIC_COLLECTION_ALPHA_SORT": "a to z",
+ "IDS_MUSIC_COLLECTION_ARTIST_SORT": "artist",
+ "IDS_MUSIC_COLLECTION_DATEADDED_SORT": "date added",
+ "IDS_MUSIC_COLLECTION_DATEEDITED_SORT": "date changed",
+ "IDS_MUSIC_COLLECTION_DATEPLAYED_SORT": "date played",
+ "IDS_MUSIC_COLLECTION_EMPTY_HEADING": "Get some music",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING1": "Visit the Music store",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING2": "Add your music to OneDrive",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING3": "Get a Music Pass",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT1": "There are tons of tracks to pick from.",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT2": "Then you can play your songs from any device.",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT3": "Unlimited streaming – start your free trial.",
+ "IDS_MUSIC_COLLECTION_EMPTY_TEXT": "There are a few ways you can add songs:",
+ "IDS_MUSIC_COLLECTION_EXPLORE_ALBUM": "Explore album",
+ "IDS_MUSIC_COLLECTION_GROVEL_HEADING": "We’re looking for your music",
+ "IDS_MUSIC_COLLECTION_GROVEL_TEXT": "This may take a while if you have a lot of songs.",
+ "IDS_MUSIC_COLLECTION_RATING_SORT": "rating",
+ "IDS_MUSIC_COLLECTION_RELEASEYEAR_SORT": "release year",
+ "IDS_MUSIC_COLLECTION_SONGS_PANEL_TEXT_LC": "my songs",
+ "IDS_MUSIC_COLLECTION_TITLE": "Music collection",
+ "IDS_MUSIC_COLLECTION_TITLE_LC": "music collection",
+ "IDS_MUSIC_CONTENT_NOT_AVAILABLE_BUTTON": "Not available",
+ "IDS_MUSIC_CREATE_PLAYLIST": "New playlist",
+ "IDS_MUSIC_DATA_PROVIDER_BANDPAGE": "Portions of the artist content is provided by BandPage®",
+ "IDS_MUSIC_DATA_PROVIDER_ECHONEST": "Radio powered by",
+ "IDS_MUSIC_DATA_PROVIDER_GRACENOTE": "Portions of the content is copyright © of Gracenote or its providers.",
+ "IDS_MUSIC_DATA_PROVIDER_ROVI": "Portions of content provided by Rovi Corporation. © 2014 Rovi Corporation.",
+ "IDS_MUSIC_DATE_CHANGED_TEXT": "date changed",
+ "IDS_MUSIC_DEEPLINK_ERROR_GENERIC_DESC": "Choose something else to listen to or try again later.",
+ "IDS_MUSIC_DEEPLINK_ERROR_GENERIC_TITLE": "Sorry, we can't take you there",
+ "IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_DESC": "The Xbox Music service isn't available in your region quite yet.",
+ "IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_TITLE": "Sorry, we can't take you there",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL": "[[1]This will permanently delete this {0} album from your library.][[*]This will permanently delete these {0} albums from your library.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_MIXED_PLURAL": "[[1]This will permanently delete this {0} album from your library and from OneDrive, if they're on there, too.][[*]This will permanently delete these {0} albums from your library and from OneDrive, if they're on there, too.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_ONEDRIVE_PLURAL": "[[1]This will permanently delete this {0} album from your library and from OneDrive.][[*]This will permanently delete these {0} albums from your library and from OneDrive.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL": "[[1]This will permanently delete this {0} track from your library.][[*]This will permanently delete these {0} tracks from your library.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_MIXED_PLURAL": "[[1]This will permanently delete this {0} track from your library and from OneDrive, if they're on there, too.][[*]This will permanently delete these {0} tracks from your library and from OneDrive, if they're on there, too.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_ONEDRIVE_PLURAL": "[[1]This will permanently delete this {0} track from your library and from OneDrive.][[*]This will permanently delete these {0} tracks from your library and from OneDrive.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_ALBUMS_PLURAL": "[[1]We'll delete this {0} album from your cloud library, but if you own any of the song files we won't delete them from your PC. ][[*]We'll delete these {0} albums from your cloud library, but if you own any of the song files we won't delete them from your PC.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM": "We'll delete this album from your cloud library.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM_WITH_LOCAL": "We'll delete this album from your cloud library, but if you own any of the song files we won't delete them from your PC.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK": "We'll delete this song from your library.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK_WITH_LOCAL": "We'll delete this song from your cloud library, but if you own the song file we won’t delete it from your PC.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_TRACKS_PLURAL": "[[1]We'll delete this {0} song from your cloud library, but if you own the song file we won't delete it from your PC.][[*]We'll delete these {0} songs from your cloud library, but if you own the song files we won't delete them from your PC.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_LIBRARY": "This will permanently delete \"{0}\" from your library.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_ONEDRIVE": "This will permanently delete \"{0}\" from your library and from OneDrive.",
+ "IDS_MUSIC_DELETE_DIALOG_HEADING_MULTIPLE": "Are you sure you want to delete these?",
+ "IDS_MUSIC_DELETE_DIALOG_HEADING_SINGLE": "Are you sure you want to delete this?",
+ "IDS_MUSIC_DISCOGRAPHY_TITLE": "albums",
+ "IDS_MUSIC_DONT_SHOW_AGAIN_MESSAGE": "Don't show this message again",
+ "IDS_MUSIC_DOWNLOAD_COMPLETE": "Download Complete",
+ "IDS_MUSIC_DOWNLOAD_ERROR": "Download Error",
+ "IDS_MUSIC_DOWNLOAD_ERROR_NOTIFICATION": "Can't download to this computer",
+ "IDS_MUSIC_DOWNLOAD_NOTIFICATION": "Downloading...",
+ "IDS_MUSIC_DOWNLOAD_PROGRESS_SONGS_PLURAL": "[[1]{0} song remaining][[*]{0} songs remaining]",
+ "IDS_MUSIC_DOWNLOAD_VIEW_ALBUM": "show album",
+ "IDS_MUSIC_ECHONEST_ALT_TEXT": "EchoNest",
+ "IDS_MUSIC_EMPTY_PLAYLIST": "Give your playlist some music: select a song or an album in your collection, then select Add to Playlist. Your songs will appear here.",
+ "IDS_MUSIC_ENGAGE_ARTIST_ENTER": "Enter an artist.",
+ "IDS_MUSIC_ENGAGE_ARTIST_ENTER_BUTTON_UC": "FIND",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_PLAY": "Sorry, we could not find that artist in the Xbox Music catalogue.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_RADIO": "Sorry, we cannot start radio for {0}.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_SMARTDJ": "Sorry, we cannot start Smart DJ for {0}.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_TEXT": "Try searching for another artist.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_NONE_UC": "NO RESULTS FOR \"{0}\"",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_UC": "RESULTS FOR \"{0}\"",
+ "IDS_MUSIC_ENGAGE_FREE_STREAM_DESC": "Search for any artist, song, or album and instantly play whatever you want.",
+ "IDS_MUSIC_ENGAGE_FREE_STREAM_TITLE": "Stream millions of songs for free.",
+ "IDS_MUSIC_ENGAGE_NEW_RADIO_ACTION": "Start radio",
+ "IDS_MUSIC_ENGAGE_NEW_RADIO_FREE_DESC": "Just choose an artist to create a station.",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_ACTION": "New Smart DJ",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_DESC": "Enter an artist and we'll create a playlist of related music",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_DESC": "Just pick an artist — Smart DJ builds the perfect mix.",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_TITLE": "Free streaming radio.",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION": "Play any artist",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION_FREE": "Play any artist — free!",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_DESC": "Enter an artist and we'll kick off a mix of their most popular songs",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_DESC": "Stream your favourite songs by your favourite artists.",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_TITLE": "Listen for free!",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_ACTION": "Play a playlist",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_DESC": "Relax, set a mood, or dive deep with favourite songs and artists",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_DESC": "Add your favourites and the latest songs from Xbox Music — free!",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_TITLE": "Make a playlist.",
+ "IDS_MUSIC_ENGAGE_PLAYLIST_ADD_TITLE_UC": "ADD \"{0}\" TO",
+ "IDS_MUSIC_ENGAGE_PLAYLIST_MANAGE": "Manage playlists",
+ "IDS_MUSIC_ENGAGE_PLAYLIST_PLAY_TITLE_UC": "MY PLAYLISTS",
+ "IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_ACTION": "Try Xbox Music Pass",
+ "IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_DESC": "Enjoy all the music you love — free — for a limited time.",
+ "IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_ACTION": "Shuffle my music",
+ "IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_DESC": "Once you've added music, shuffle it for a fresh and friendly mix",
+ "IDS_MUSIC_GENRE_SORT": "genre",
+ "IDS_MUSIC_GET_A_SUBSCRIPTION_TEXT": "Get unlimited music with Xbox Music Pass!",
+ "IDS_MUSIC_IN_COLLECTION_LABEL": "in collection",
+ "IDS_MUSIC_IN_LIBRARY_LABEL": "In library",
+ "IDS_MUSIC_IN_MY_MUSIC_LABEL": "in my music",
+ "IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_PLURAL": "[[1]influencing artist][[*]influencing artists]",
+ "IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_TEXT": "influencing artists",
+ "IDS_MUSIC_INFLUENCING_ARTISTS_TEXT": "influencing artists",
+ "IDS_MUSIC_INTRO_BROWSE_BUTTON_AUTHED": "Start",
+ "IDS_MUSIC_INTRO_BROWSE_BUTTON_NONAUTHED": "Sign in",
+ "IDS_MUSIC_INTRO_DETAILS": "See it? Play it.\n\nStream millions of songs for free.\n\nAdd the songs you love to your music collection.\n\nMake playlists of your favourite songs and mix in the latest from Xbox Music.\n\nJust pick an artist — Smart DJ builds the perfect mix.",
+ "IDS_MUSIC_INTRO_DETAILS_RADIO": "See it? Play it.\n\nStream millions of songs for free.\n\nAdd the songs you love to your music collection.\n\nCreate playlists of your favourite songs and mix in the latest from Xbox Music.\n\nJust pick an artist — Radio builds the perfect mix.",
+ "IDS_MUSIC_INTRO_HEADER": "Welcome to Xbox Music",
+ "IDS_MUSIC_INTRO_PLAY_BUTTON_AUTHED": "Start playing",
+ "IDS_MUSIC_INTRO_PLAY_BUTTON_NONAUTHED": "Sign in to start playing",
+ "IDS_MUSIC_LATEST_ALBUM": "Latest album",
+ "IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE": "all music",
+ "IDS_MUSIC_MARKETPLACE_GALLERY_TITLE": "all music",
+ "IDS_MUSIC_MARKETPLACE_MOST_PLAYTED_SORT": "most played",
+ "IDS_MUSIC_MARKETPLACE_POPULARITY_SORT": "popularity",
+ "IDS_MUSIC_MARKETPLACE_RELEASEDATE_SORT": "date",
+ "IDS_MUSIC_MARKETPLACE_TITLE_LC": "xbox music store",
+ "IDS_MUSIC_MARKETPLACE_TITLE_SORT": "title",
+ "IDS_MUSIC_MATCH_GRACENOTE_SERVICE": "Music matching service powered by Gracenote",
+ "IDS_MUSIC_MAX_DEVICES_NOTIFICATION": "Device limit reached",
+ "IDS_MUSIC_MODIFIER_GENRE": "Genre",
+ "IDS_MUSIC_MODIFIER_GENRE_ALL": "All music",
+ "IDS_MUSIC_MODIFIER_SUBGENRE": "Subgenre",
+ "IDS_MUSIC_MODIFIER_SUBGENRE_NONE": "None",
+ "IDS_MUSIC_MOST_POPULAR_PANEL_HEADER": "top music",
+ "IDS_MUSIC_MY_PLAYLISTS_HEADER": "my playlists",
+ "IDS_MUSIC_NEW_RELEASES_TITLE_LC": "new releases",
+ "IDS_MUSIC_NOTIFICATION_1_ALBUM_ADDED": "1 album",
+ "IDS_MUSIC_NOTIFICATION_1_ARTIST_ADDED": "1 artist",
+ "IDS_MUSIC_NOTIFICATION_1_TRACK_ADDED": "1 song",
+ "IDS_MUSIC_NOTIFICATION_ADD_ERROR": "Can't add",
+ "IDS_MUSIC_NOTIFICATION_ADD_SONGS_ERROR": "Can't add songs",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_COLLECTION": "Added to collection",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_MY_MUSIC": "Added to your music",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_NOW_PLAYING": "Added to now playing",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_PLAYLIST": "Added to playlist",
+ "IDS_MUSIC_NOTIFICATION_ADDING_TO_COLLECTION": "Adding to collection",
+ "IDS_MUSIC_NOTIFICATION_ADDING_TO_NOW_PLAYING": "Adding to now playing",
+ "IDS_MUSIC_NOTIFICATION_ADDING_TO_PLAYLIST": "Adding to playlist",
+ "IDS_MUSIC_NOTIFICATION_ALBUMS_ADDED_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_MUSIC_NOTIFICATION_ARTISTS_ADDED_PLURAL": "[[1]{0} artist][[*]{0} artists]",
+ "IDS_MUSIC_NOTIFICATION_MUSIC_PASS_ONLY": "Xbox Music Pass only",
+ "IDS_MUSIC_NOTIFICATION_N_ALBUMS_ADDED": "{0} albums",
+ "IDS_MUSIC_NOTIFICATION_N_ARTISTS_ADDED": "{0} artists",
+ "IDS_MUSIC_NOTIFICATION_N_TRACKS_ADDED": "{0} songs",
+ "IDS_MUSIC_NOTIFICATION_PURCHASE_ONLY": "Available for purchase only",
+ "IDS_MUSIC_NOTIFICATION_RADIO_LOCKED": "You're listening to radio",
+ "IDS_MUSIC_NOTIFICATION_TRACKS_ADDED_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_NOW_PLAYING_DEFAULT_LIST_NAME": "Now Playing ({0})",
+ "IDS_MUSIC_NOW_PLAYING_NEXT_SONG_DESC": "Up next",
+ "IDS_MUSIC_NOW_PLAYING_PANEL_HEADER_UC": "NOW PLAYING",
+ "IDS_MUSIC_NOW_PLAYING_PREVIOUS_SONG_DESC": "You've just heard",
+ "IDS_MUSIC_NOW_PLAYING_SMART_DJ_LIST_NAME": "{0} mix ({1})",
+ "IDS_MUSIC_NOW_PLAYING_TOP_SONGS_LIST_NAME": "{0} top songs ({1})",
+ "IDS_MUSIC_OFFLINE_DRM_DESC": "We need to check usage rights for that song. Please try again when you're online.",
+ "IDS_MUSIC_OFFLINE_DRM_TITLE": "Can't play",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_ACTION": "Get started",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_BODY": "Some of the songs you put on OneDrive resulted in duplicates. Let's clean things up.",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_NO": "Keep duplicates",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_YES": "Remove duplicates",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_BODY": "There are some songs on your OneDrive that are the same as songs you've added from the Music catalogue. We can clean things up for you so the same song won't be listed twice.\n\nHere's what will happen:\n• The songs you've put on OneDrive will become the master version. We'll remove songs that you've added from the Music catalogue if—and only if—they're a perfect match to the ones on OneDrive.\n• You can stream or download those songs from OneDrive.* (If you want to listen when you're offline, make sure you've downloaded those songs). \n• This won't affect songs that aren't duplicates, and you can turn this off at any time in Settings.\n\n*Important: Choose Keep duplicates if you use the Music app on Android, iOS, or a version of Windows or Windows Phone earlier than 8.1. The Music app on these operating systems doesn't work with OneDrive yet, so you won't be able to stream your music.",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_TITLE": "Let's clean up your duplicate songs",
+ "IDS_MUSIC_PLAY_ALBUM_LABEL": "Play album",
+ "IDS_MUSIC_PLAY_ALL_BUTTON": "Play all",
+ "IDS_MUSIC_PLAY_SELECTION_ACTION": "Play selected",
+ "IDS_MUSIC_PLAY_TO_DISABLED_TEXT": "Can't play to device",
+ "IDS_MUSIC_PLAY_TO_LABEL": "Play To",
+ "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR_TEXT": "Sorry, we can't stream music to that device. Download the music here, then try again.",
+ "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR2_TEXT": "To play rights-managed music to your Xbox, sign up for Xbox Music Pass or sign in with a profile that has a pass already.",
+ "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR3_TEXT": "Rights-managed music from the Xbox service can be streamed only to an Xbox 360 console.",
+ "IDS_MUSIC_PLAY_TO_STREAMING_ERROR_TEXT": "Sorry, we can't stream this song.",
+ "IDS_MUSIC_PLAY_TOP_SONGS_BUTTON": "Play top songs",
+ "IDS_MUSIC_PLAYLIST_LABEL": "Playlist",
+ "IDS_MUSIC_PLAYLIST_SEARCH_NAME_DESC": "Enter an artist, album, or song from your playlists",
+ "IDS_MUSIC_PLAYLIST_SEARCH_NAME_LABEL": "Enter playlist name",
+ "IDS_MUSIC_PLAYLISTS_BROWSE_COLLECTION": "Browse your albums to find music to add",
+ "IDS_MUSIC_PLAYLISTS_BROWSE_MARKETPLACE": "Browse all music to find music to add",
+ "IDS_MUSIC_PREVIEW_SELECTION_ACTION": "Preview selection",
+ "IDS_MUSIC_PREVIEW_TOP_SONGS_BUTTON": "Preview top songs",
+ "IDS_MUSIC_PROPERTIES_ALBUM_ARTIST_LABEL": "Album artist",
+ "IDS_MUSIC_PROPERTIES_ALBUM_TITLE_LABEL": "Album title",
+ "IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_MULTIPLE_LOCATIONS": "Listen on this device or stream from OneDrive from any device",
+ "IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_ONEDRIVE": "Stream from OneDrive (download to listen offline)",
+ "IDS_MUSIC_PROPERTIES_AVAILABLE_ON_THIS_PC": "Listen on this device (to listen on other devices, add to OneDrive)",
+ "IDS_MUSIC_PROPERTIES_BIT_RATE_LABEL": "Bit rate",
+ "IDS_MUSIC_PROPERTIES_COPYRIGHT_LABEL": "Copyright",
+ "IDS_MUSIC_PROPERTIES_DIALOG_TEXT": "Properties",
+ "IDS_MUSIC_PROPERTIES_DISC_LABEL": "Disc",
+ "IDS_MUSIC_PROPERTIES_DRM_LABEL": "DRM",
+ "IDS_MUSIC_PROPERTIES_FILE_SIZE_LABEL": "File size",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_COPY_LINK": "Copy path",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_LABEL": "File location",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_ONEDRIVE": "On OneDrive",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_STREAMING": "Xbox Music catalogue",
+ "IDS_MUSIC_PROPERTIES_GENRE_LABEL": "Genre",
+ "IDS_MUSIC_PROPERTIES_LENGTH_LABEL": "Length",
+ "IDS_MUSIC_PROPERTIES_MEDIA_TYPE_LABEL": "Media type",
+ "IDS_MUSIC_PROPERTIES_RELEASE_YEAR_LABEL": "Release year",
+ "IDS_MUSIC_PROPERTIES_SONG_ARTIST_LABEL": "Song artist",
+ "IDS_MUSIC_PROPERTIES_SONG_TITLE_LABEL": "Song title",
+ "IDS_MUSIC_PROPERTIES_TRACK_LABEL": "Track",
+ "IDS_MUSIC_RECENT_PANEL_HEADER_UC": "RECENTLY PLAYED",
+ "IDS_MUSIC_RECENT_PLAYLIST_DIALOG_TEXT": "Recent playlists",
+ "IDS_MUSIC_RELATED_ARTISTS_COUNT_PLURAL": "[[1]related artist][[*]related artists]",
+ "IDS_MUSIC_RELATED_ARTISTS_COUNT_TEXT": "related artists",
+ "IDS_MUSIC_RELATED_ARTISTS_LINK": "Show all related",
+ "IDS_MUSIC_RELATED_ARTISTS_TEXT": "related artists",
+ "IDS_MUSIC_RELATED_GENRES_PLURAL": "[[1]related genre][[*]related genres]",
+ "IDS_MUSIC_RELATED_PANEL_FORMAT": "{0} {1}",
+ "IDS_MUSIC_RELATED_PANEL_TEXT": "related",
+ "IDS_MUSIC_RENAME_PLAYLIST": "Rename",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_CANCEL": "Cancel",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_DELETE": "Reset now",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_DESCRIPTION": "If your collection is a mess, you can reset it. If you have a Music Pass and you miss a song or album you've removed, just add it back from Explore.",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_NOTE": "Important: If you reset, you can't go back. Depending on what you've selected above, you will have to add songs again and/or recreate your playlists.",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_PLURAL": "[[1]Remove all of the music I added from the Music catalogue ({0} song)][[*]Remove all of the music I added from the Music catalogue ({0} songs)]",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_SINGLE": "Remove all of the songs I added from the Music catalogue ({0} song)",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_PLURAL": "[[1]Remove all of my playlists (This won't delete songs you've added to your collection.) ({0} playlist)][[*]Remove all of my playlists (This won't delete songs you've added to your collection.) ({0} playlists)]",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_SINGLE": "Remove all of my playlists (This won't delete songs you've added to your collection.) ({0} playlist)",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_PLURAL": "[[1]Remove all of the songs I bought (You can download any of these songs from Explore later.) ({0} purchase)][[*]Remove all of the songs I bought (You can download any of these songs from Explore later.) ({0} purchases)]",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_SINGLE": "Remove all of the songs I bought (You can download any of these songs from Explore later.) ({0} purchase)",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_TITLE": "Reset your cloud collection",
+ "IDS_MUSIC_RESET_COLLECTION_FLYOUT_BODY": "This might take a while. You can keep listening to your music while we're working on it.",
+ "IDS_MUSIC_RESET_COLLECTION_FLYOUT_TITLE": "Resetting your cloud collection",
+ "IDS_MUSIC_SAVE_AS_PLAYLIST": "Save as playlist",
+ "IDS_MUSIC_SAVE_NAME_PLAYLIST": "Save changes",
+ "IDS_MUSIC_SAVE_NOW_PLAYING_ACTION": "Save now playing",
+ "IDS_MUSIC_SAVE_THIS_AS_PLAYLIST": "Save this as a playlist",
+ "IDS_MUSIC_SCAN_MATCH_0_SONGS_SCANNED_NOTIFICATION_LINE_2": "We have checked {0} songs so far. This will go faster if you stay plugged in.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2": "{0} song is now available on other devices when you sign in. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_FREE": "{0} song is now available to you when you sign in on other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_PREMIUM": "{0} song is now available to you when you sign in on Windows Phone 8, Xbox 360, and other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_SCANNED_NOTIFICATION_LINE_2": "We have checked {0} song so far. This will go faster if you stay plugged in.",
+ "IDS_MUSIC_SCAN_MATCH_MATCHED_NOTIFICATION": "Added to your music in the cloud",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2": "{0} of your {1} songs are now available on other devices when you sign in. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_FREE": "{0} of your {1} songs are now available to you when you sign in on other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_PREMIUM": "{0} of your {1} songs are now available to you when you sign in on Windows Phone 8, Xbox 360, and other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_SCANNED_NOTIFICATION_LINE_2": "We've checked {0} songs so far. This will go faster if you stay plugged in.",
+ "IDS_MUSIC_SCAN_MATCH_NO_SONGS_MATCHED_NOTIFICATION_LINE_2": "We didn't find anything that matched songs from Xbox Music. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_1": "Want to hear this PC's music on other devices?",
+ "IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_2": "Learn more about music in the cloud",
+ "IDS_MUSIC_SCAN_MATCH_SCANNING_NOTIFICATION": "Adding to your music in the cloud",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_1": "We finished matching your music.",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_2": "Almost done. Just a moment while we finish up.",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_1": "We're matching your music with songs from Xbox Music.",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_2_PLURAL": "[[1]We have checked {0} song so far. This will go the fastest if you stay plugged in.][[*]We have checked {0} songs so far. This will go the fastest if you stay plugged in.]",
+ "IDS_MUSIC_SEARCH_ALL_EMPTY_DESC": "Try searching for something else.",
+ "IDS_MUSIC_SEARCH_ALL_EMPTY_LINK": "Show all results",
+ "IDS_MUSIC_SEARCH_ALL_EMPTY_TITLE": "Sorry, we couldn't find that in your music or the Xbox Music catalogue.",
+ "IDS_MUSIC_SEARCH_BEST_MATCH": "Best match",
+ "IDS_MUSIC_SEARCH_CATALOG_EMPTY_DESC": "Tap \"In collection\" to see results from your collection.",
+ "IDS_MUSIC_SEARCH_CATALOG_EMPTY_TITLE": "Sorry, we didn't find that in the Xbox Music catalogue.",
+ "IDS_MUSIC_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE": "We don't see that in your collection or the Xbox Music catalogue.",
+ "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_DESC": "Tap \"Full catalogue\" to see results from Xbox Music.",
+ "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE": "Sorry, we didn't find that in your collection.",
+ "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG": "Sorry, we didn't find that in your collection.",
+ "IDS_MUSIC_SEARCH_LOCATION_COLLECTION_STORE": "from all sources",
+ "IDS_MUSIC_SEARCH_LOCATION_NOT_AVAILABLE": "Not available",
+ "IDS_MUSIC_SEARCH_LOCATION_STORE": "Xbox Music Store",
+ "IDS_MUSIC_SEARCH_MY_EMPTY_DESC": "Try searching the full catalogue of Xbox Music.",
+ "IDS_MUSIC_SEARCH_MY_EMPTY_LINK": "Show results from all music",
+ "IDS_MUSIC_SEARCH_MY_EMPTY_TITLE": "Sorry, we didn't find that in your music.",
+ "IDS_MUSIC_SEARCH_TOP_RESULT": "Top result",
+ "IDS_MUSIC_SEE_MORE_BUTTON": "See more",
+ "IDS_MUSIC_SETTINGS_AUTOMATIC_DOWNLOAD": "Automatic downloads",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ALT_DESCRIPTION": "When you add songs from Xbox Music to Collection, also add them to Devices",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_OFF_DESCRIPTION": "Your music stays on this PC, and songs played or added on other Xbox Music devices aren't shown here.",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ON_DESCRIPTION": "When you add songs from Xbox Music to your collection, you'll see them on each Xbox Music device you sign into.",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_TITLE": "Cloud collection",
+ "IDS_MUSIC_SETTINGS_CLOUD_DEVICES_TITLE": "Music on devices",
+ "IDS_MUSIC_SETTINGS_CLOUD_MUSIC_TITLE": "Music in the cloud",
+ "IDS_MUSIC_SETTINGS_MEDIA_INFO_DESC": "Automatically retrieve and update album art and metadata",
+ "IDS_MUSIC_SETTINGS_MEDIA_INFO_LABEL": "Media Info",
+ "IDS_MUSIC_SETTINGS_METADATA_SAVE_DESC": "When you edit song info in Xbox Music, we’ll update your song files with those changes.",
+ "IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_DESCRIPTION": "Automatically download songs you add from the Music catalogue",
+ "IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_TITLE": "Downloads",
+ "IDS_MUSIC_SETTINGS_SHOW_CLOUD_GROVEL_INFO_DESC": "Normally, when you add songs and albums from Xbox Music to your collection, those items are kept in sync so they're available to you on any PC you sign in to.",
+ "IDS_MUSIC_SETTINGS_STARTUP_VIEW_DESC": "When the app opens, show my music",
+ "IDS_MUSIC_SETTINGS_STARTUP_VIEW_LABEL": "Startup view",
+ "IDS_MUSIC_SHOW_ALBUMS": "albums",
+ "IDS_MUSIC_SHOW_ARTISTS": "artists",
+ "IDS_MUSIC_SHOW_PLAYLISTS": "playlists",
+ "IDS_MUSIC_SHOW_SONGS": "songs",
+ "IDS_MUSIC_SIMILAR_ALBUMS_PLURAL": "[[1]similar album][[*]similar albums]",
+ "IDS_MUSIC_SIMILAR_ARTISTS_TEXT": "similar artists",
+ "IDS_MUSIC_SONGS_IN_COLLECTION": "Songs in My Music",
+ "IDS_MUSIC_SPOTLIGHT_ITEM_NAR": "spotlight item",
+ "IDS_MUSIC_SPOTLIGHT_PANEL_HEADER": "spotlight",
+ "IDS_MUSIC_STREAMING_NOTIFICATION": "Streaming only",
+ "IDS_MUSIC_SUBSCRIPTION_SIGN_IN_DESC": "Use an existing Xbox profile or make a new one.",
+ "IDS_MUSIC_SUBSCRIPTION_SIGN_IN_TITLE": "To start your free trial, first sign in.",
+ "IDS_MUSIC_SUBSCRIPTION_UPSELL_TEXT": "Get an Xbox Music Pass",
+ "IDS_MUSIC_TOP_ALBUM_TITLE_LC": "top music",
+ "IDS_MUSIC_TOP_SONGS_PANEL_TEXT": "songs",
+ "IDS_MUSIC_TOP_SONGS_PANEL_TEXT_LC": "songs",
+ "IDS_MUSIC_TRACKS_LABEL_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_TYPE_ALBUM_PLURAL": "[[1]album][[*]albums]",
+ "IDS_MUSIC_TYPE_ALBUM_TITLE_TC": "Albums",
+ "IDS_MUSIC_TYPE_ARTIST_PLURAL": "[[1]artist][[*]artists]",
+ "IDS_MUSIC_TYPE_ARTIST_TITLE_TC": "Artists",
+ "IDS_MUSIC_TYPE_PLAYLIST_PLURAL": "[[1]playlist][[*]playlists]",
+ "IDS_MUSIC_TYPE_PLAYLIST_TITLE_TC": "Playlists",
+ "IDS_MUSIC_TYPE_RADIO_PLURAL": "[[1]radio station][[*]radio stations]",
+ "IDS_MUSIC_TYPE_TRACK_PLURAL": "[[1]song][[*]songs]",
+ "IDS_MUSIC_TYPE_TRACK_TITLE_TC": "Songs",
+ "IDS_MUSIC_VIDEO_MARKETPLACE_TITLE": "Music videos",
+ "IDS_MUSIC_VIDEO_MARKETPLACE_TITLE_LC": "music videos",
+ "IDS_MUSIC2_ARTIST_DETAILS_HERO_PANEL_TITLE_UC": "ARTIST DETAILS",
+ "IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_EMPTY": "There's nothing by {0} in your collection. Switch back to all music and add the albums or songs you want.",
+ "IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_TITLE": "Albums by {0}",
+ "IDS_MUSIC2_GALLERY_JUMP_TO_DATE": "Jump to date",
+ "IDS_MUSIC2_GALLERY_JUMP_TO_LETTER": "Jump to letter",
+ "IDS_MUSIC2_TOP_ALBUMS_HEADER_NO_GENRE_UC": "TOP ALBUMS",
+ "IDS_MUSIC2_TOP_SONGS_PANEL_TEXT": "top songs",
+ "IDS_PICK_PLAYLIST_OVERLAY_TITLE": "Pick a playlist",
+ "IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALBUMS": "Browse my albums",
+ "IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALL_MUSIC": "Browse all music",
+ "IDS_PLAY_PLAYLIST_OVERLAY_EMPTY_DESC": "Make your own mixes with just the songs you want. To start a playlist, select any song or album, then tap \"Add to Playlist\".",
+ "IDS_PLAY_PLAYLIST_OVERLAY_IMPORT_DESC": "Already have playlists in your Music library? Add them now.",
+ "IDS_PLAY_PLAYLIST_OVERLAY_MANAGE_PLAYLIST": "Manage my playlists",
+ "IDS_PLAY_PLAYLIST_OVERLAY_TITLE": "My playlists",
+ "IDS_PLAYLIST_ADD": "Add to playlist",
+ "IDS_PLAYLIST_ADD_ACTIVE": "Add to {0}",
+ "IDS_PLAYLIST_ADD_SONG": "Add song to playlist",
+ "IDS_PLAYLIST_ADD_SONG_ACTIVE": "Add song to {0}",
+ "IDS_PLAYLIST_ADDED_TO_PLAYLIST": "Added to Playlist",
+ "IDS_PLAYLIST_ADDED_TO_PLAYLIST_ITEMS_PLURAL": "[[1]{0} item][[*]{0} items]",
+ "IDS_PLAYLIST_BAD_CHARACTERS_ERROR": "The name you entered has unusable characters. Please try another name.",
+ "IDS_PLAYLIST_CHANGED_ON": "Last changed on {0}",
+ "IDS_PLAYLIST_COLLECTION_TITLE": "playlists",
+ "IDS_PLAYLIST_CREATE_DUPLICATE_MESSAGE": "That one's there already. Replace it, or try a different name.",
+ "IDS_PLAYLIST_CREATE_LABEL": "Create new playlist",
+ "IDS_PLAYLIST_CREATE_PLAYLIST_ACTION_TEXT": "Create a playlist",
+ "IDS_PLAYLIST_CREATE_PLAYLIST_DESC_TEXT": "To add tunes, find songs in your music and select Add to Playlist.",
+ "IDS_PLAYLIST_CREATE_PLAYLIST_LINK": "Start a new playlist",
+ "IDS_PLAYLIST_CREATE_REPLACE": "Replace",
+ "IDS_PLAYLIST_DEFAULT_NAME": "New Playlist",
+ "IDS_PLAYLIST_EXISTING_NAME": "That one's there already. Try a different name.",
+ "IDS_PLAYLIST_IMPORT_COMPLETED": "Playlists added",
+ "IDS_PLAYLIST_IMPORT_COMPLETED_NONE_FOUND": "No playlists found",
+ "IDS_PLAYLIST_IMPORT_DIALOG_DESC_TEXT": "We'll look for playlists in your Music library and playlists created in iTunes.",
+ "IDS_PLAYLIST_IMPORT_DIALOG_TITLE": "Xbox Music will add playlists to your collection.",
+ "IDS_PLAYLIST_IMPORT_DIALOG_TITLE_NO_MARKETPLACE": "Music will add playlists to your collection.",
+ "IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_DESC_TEXT": "Select here to import existing playlists from your Music library. You can always import playlists later.",
+ "IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_LINK": "Import your existing playlists",
+ "IDS_PLAYLIST_IMPORT_FAILURE_DETAIL": "To make sure you're seeing all of them, restart the app and add them again.",
+ "IDS_PLAYLIST_IMPORT_FAILURE_OCCURRED": "Some playlists weren't added.",
+ "IDS_PLAYLIST_IMPORT_FAILURE_SUBTITLE": "Learn more",
+ "IDS_PLAYLIST_IMPORT_IN_PROGRESS": "Searching for playlists",
+ "IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_DESC_TEXT": "This shouldn't take too much longer.",
+ "IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_TITLE": "We're already adding your playlists.",
+ "IDS_PLAYLIST_IMPORT_PLAYLIST_BUTTON": "Import playlists",
+ "IDS_PLAYLIST_ITEM_BUTTON_NOT_AVAILABLE": "Not available",
+ "IDS_PLAYLIST_ITEM_DIALOG_NO_MATCH_XBOX_MUSIC_CLOUD": "This song from your other device isn't available here. To play it, copy it to this device.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE": "Not available on this device.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_DTO_ONLY_MARKETPLACE_ENABLED": "We can't play this song. To hear it on this device, restore the song file to your music collection.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER": "To play, get an Xbox Music Pass.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_ACTION": "Try for free",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_TITLE": "To play some of the songs in this playlist, you'll need an Xbox Music Pass.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_ENABLED": "Not available here.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_NOT_ENABLED": "This song has been removed.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_FOUND_MARKETPLACE_NOT_ENABLED": "We can't find this song on your device any longer.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_MATCHED_MARKETPLACE_ENABLED": "This song isn't on this device, and it doesn't match anything in the cloud, so we can't stream it for you here.",
+ "IDS_PLAYLIST_MORE": "More playlists",
+ "IDS_PLAYLIST_MOVE_DOWN": "move down",
+ "IDS_PLAYLIST_MOVE_DOWN_SC": "Move down",
+ "IDS_PLAYLIST_MOVE_TO_BOTTOM": "move to bottom",
+ "IDS_PLAYLIST_MOVE_TO_BOTTOM_SC": "Move to bottom",
+ "IDS_PLAYLIST_MOVE_TO_TOP": "move to top",
+ "IDS_PLAYLIST_MOVE_TO_TOP_SC": "Move to top",
+ "IDS_PLAYLIST_MOVE_UP": "move up",
+ "IDS_PLAYLIST_MOVE_UP_SC": "Move up",
+ "IDS_PLAYLIST_NAME": "Name",
+ "IDS_PLAYLIST_NAME_TITLE": "Name this playlist",
+ "IDS_PLAYLIST_NO_CONTENT_TITLE": "It's lonely in here.",
+ "IDS_PLAYLIST_PAGE_EMPTY_BROWSE_TITLE": "Browse for something new",
+ "IDS_PLAYLIST_PAGE_EMPTY_TEXT": "No songs yet",
+ "IDS_PLAYLIST_PAGE_EMPTY_TITLE": "Add songs!",
+ "IDS_PLAYLIST_PLAYLISTS_ADDED_PLURAL": "[[1]{0} playlist added][[*]{0} playlists added]",
+ "IDS_PLAYLIST_REMOVE": "Remove from playlist",
+ "IDS_POPUP_FILTER_CLOUD_ZERO_SONGS": "No songs in this playlist are in the cloud. Select the link above to show all tracks.",
+ "IDS_POPUP_FILTER_SHOW_ALL_LINK": "Show all music",
+ "IDS_RADIO_ARTIST_NOT_FOUND": "Sorry, we cannot start the radio for {0}. Please try another artist.",
+ "IDS_RADIO_ARTIST_RESULTS": "Radio",
+ "IDS_RADIO_CARD_LABEL": "Radio",
+ "IDS_RADIO_CARD_LABEL_LC": "radio",
+ "IDS_RADIO_COLLECTION_TITLE": "radio",
+ "IDS_RADIO_CREATE_ACTION": "Start radio",
+ "IDS_RADIO_CREATE_ACTION_LC": "start radio",
+ "IDS_RADIO_EMPTY_GALLERY_ACTION": "Start radio",
+ "IDS_RADIO_EMPTY_GALLERY_TITLE": "It's lonely in here.",
+ "IDS_RADIO_FREE_USER_ACTION": "Try for free",
+ "IDS_RADIO_FREE_USER_SUBTITLE": "Create radio stations based on your favourite artists with an Xbox Music Pass",
+ "IDS_RADIO_FREE_USER_TITLE": "Expand your musical horizons",
+ "IDS_RADIO_LOADING_TEXT": "We're choosing music related to {0}",
+ "IDS_RADIO_NONSMARTDJ_ARTIST": "Sorry, we can't start the radio for {0}. Please try another artist, or press Play to stream the top songs from {0} instead.",
+ "IDS_RADIO_OFFINE_ERROR_TITLE": "We can't start the radio right now.",
+ "IDS_RADIO_PAGE_CREATE_RADIO_ACTION": "Start a station",
+ "IDS_RADIO_PAGE_EMPTY_SUBTITLE": "We will automatically collect any stations you create and keep them here for you.",
+ "IDS_RADIO_PAGE_EMPTY_TITLE": "You'll see your stations here.",
+ "IDS_RADIO_PAGE_ERROR_GALLERY_TITLE": "We cannot retrieve your stations right now.",
+ "IDS_RADIO_PAGE_SIGN_IN_SUBTITLE": "Sign in to see a list of your stations.",
+ "IDS_RADIO_PAGE_SUBTITLE_LINE1": "Enter any artist you like, and we will pick similar music for you.",
+ "IDS_RADIO_PAGE_SUBTITLE_LINE2": "Start with any artist, and we'll pick similar music for you.",
+ "IDS_RADIO_PLAY_FROM_MEDIA_ACTION": "Start radio",
+ "IDS_RADIO_PLAY_FROM_MEDIA_ACTION_LC": "start radio",
+ "IDS_RADIO_PLAYING_TEXT": "Playing radio",
+ "IDS_RADIO_PLAYING_TEXT_LC": "playing radio",
+ "IDS_SMARTDJ_1_FEATURED_ARTIST": "Includes artists like {0}",
+ "IDS_SMARTDJ_2_FEATURED_ARTISTS": "Includes artists like {0}, {1}",
+ "IDS_SMARTDJ_ARTIST_NOT_FOUND": "Sorry, we can't start Smart DJ for {0}. Please try another artist.",
+ "IDS_SMARTDJ_ARTIST_RESULTS": "Smart DJ artists",
+ "IDS_SMARTDJ_CARD_LABEL": "Smart DJ",
+ "IDS_SMARTDJ_CARD_LABEL_LC": "smart dj",
+ "IDS_SMARTDJ_COLLECTION_TITLE": "smart djs",
+ "IDS_SMARTDJ_CREATE_ACTION": "New Smart DJ",
+ "IDS_SMARTDJ_CREATE_ACTION_LC": "new smart dj",
+ "IDS_SMARTDJ_EMPTY_GALLERY_ACTION": "New Smart DJ",
+ "IDS_SMARTDJ_LOADING_TEXT": "Smart DJ is picking music related to {0}",
+ "IDS_SMARTDJ_NONSMARTDJ_ARTIST": "Sorry, we can't start a Smart DJ for {0}. Please try another artist, or press Play to stream the top songs from {0} instead.",
+ "IDS_SMARTDJ_NONSMARTDJ_ARTIST_RESULTS": "Other artists",
+ "IDS_SMARTDJ_OFFINE_ERROR_DESC": "Make sure you have internet access, then try again.",
+ "IDS_SMARTDJ_OFFINE_ERROR_TITLE": "We can't start Smart DJ right now.",
+ "IDS_SMARTDJ_PAGE_CREATE_SMARTDJ_ACTION": "New Smart DJ",
+ "IDS_SMARTDJ_PAGE_ERROR_GALLERY_TITLE": "It's lonely in here.",
+ "IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION": "Play Smart DJ",
+ "IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION_LC": "play smart dj",
+ "IDS_SMARTDJ_PLAYING_TEXT": "Playing Smart DJ",
+ "IDS_SMARTDJ_PLAYING_TEXT_LC": "playing smart dj",
+ "IDS_SMARTDJ_POPULAR_ARTISTS_DIALOG_TITLE": "Popular artists",
+ "IDS_SMARTDJ_POPULAR_ARTISTS_ENTRY_TEXT": "Enter artist",
+ "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_ACTION": "Get Xbox Music Pass",
+ "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_DESC": "This is a great time to upgrade! Xbox Music Pass gives you unlimited plays of premium content, with no interruptions. For a low monthly fee, you can use your music pass on your PC, Windows Phone, and Xbox 360.",
+ "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_TITLE": "Sorry, but this song is available only with Xbox Music Pass.",
+ "IDS_WHATSNEW_ABOUT_MUSIC_POPUP_TITLE": "What's new in Music version {0}.{1}.{2}",
+ "IDS_WHATSNEW_ABOUT_XBOX_MUSIC_POPUP_TITLE": "What's new in Xbox Music version {0}.{1}.{2}",
+ "IDS_WHATSNEW_MUSIC_NOTIFICATION_TITLE": "We've updated Music!",
+ "IDS_WHATSNEW_MUSIC_POPUP_TITLE": "What's new in Music version {0}.{1}.{2}",
+ "IDS_WHATSNEW_XBOX_MUSIC_NOTIFICATION_TITLE": "We have updated Xbox Music!",
+ "IDS_WHATSNEW_XBOX_MUSIC_POPUP_TITLE": "What's new in Xbox Music version {0}.{1}.{2}",
+ "101": "Unknown Song %d",
+ "102": "Unknown Album (%s %s)",
+ "103": "Unknown Album (",
+ "104": "Unknown Artist",
+ "105": "Unknown Song",
+ "106": "the ;",
+ "108": "Various Artists",
+ "109": "Unknown Album",
+ "110": "Unknown Genre",
+ "250": "Unknown Song",
+ "251": "Unknown Artist",
+ "252": "Unknown Album",
+ "258": "Unknown Series",
+ "259": "Unknown Video",
+ "260": "Unknown Series",
+ "261": "We couldn't determine the original series for these podcast episodes. To subscribe, select one or more episodes and enter a URL.",
+ "262": "Couldn't determine the URL for this podcast series. To subscribe to it, select one or more episodes and enter a URL.",
+ "320": "Music",
+ "321": "TV",
+ "322": "Shorts",
+ "323": "Series %1!02d!",
+ "324": "Films",
+ "325": "Xbox Music Pass",
+ "326": "Purchases",
+ "328": "Subscription Cache",
+ "329": "Downloading",
+ "360": "%1: %2",
+ "361": "audiobook",
+ "362": "audiobook",
+ "363": "comedy / spoken word",
+ "364": "podcast",
+ "365": "karaoke",
+ "5000": "Xbox Event Log",
+ "607": "Smart DJ",
+ "609": "Resume playing",
+ "610": "Shuffle all music",
+ "611": "Podcasts",
+ "612": "Podcast Folder",
+ "613": "Podcast Folder",
+ "618": "Xbox temporary converted files",
+ "619": "OneDrive Cache",
+ "000D1359": "This song is available only when you buy the whole album.",
+ "000D135E": "Sorry, can't go there. Please try again.",
+ "C00D001A": "The item is missing or we can't get to it.",
+ "C00D0029": "If the item is on an external hard drive or network location, make sure you have access to that device or location.",
+ "C00D0BBE": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D0BC0": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D0BCD": "The given property isn't supported.",
+ "C00D0FF5": "To preview or play explicit content, sign in.",
+ "C00D0FF6": "Your privacy & online settings don't allow you to buy explicit content.",
+ "C00D0FF7": "Your privacy & online settings don't allow you to buy things.",
+ "C00D0FF8": "Access to this content is blocked based on the online safety settings for this account. Please sign in to play this content.",
+ "C00D0FF9": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D0FFC": "Can't play the disc because the drive is in use.",
+ "C00D0FFD": "To download explicit content, sign in.",
+ "C00D1051": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1053": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1057": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D1077": "Sorry, this item is unavailable.",
+ "C00D10B7": "Sorry, we can't play this item right now. Please try again later.",
+ "C00D10BD": "Can't play videos because there's a problem with your video card. For troubleshooting help, contact the maker of your computer's video card.",
+ "C00D10D1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D10DE": "Can't play the video because there's a problem with the file. Try renting or buying the video at the Xbox Video Store.",
+ "C00D10DF": "Can't play because the item's file format isn't supported. Make sure your video doesn't have multiple soundtracks.",
+ "C00D10E0": "Can't play this item because the file is too big.",
+ "C00D10E1": "Can't play files that are incompletely downloaded or are corrupted.",
+ "C00D1117": "Sorry, this item is currently unavailable.",
+ "C00D1126": "Make sure you're connected to the internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1198": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1199": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11A1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11B5": "Sorry, we can't download because we can't check usage rights at the moment. Please try again soon!",
+ "C00D11BA": "Can't play. Make sure your computer has a working sound card, then try again.",
+ "C00D11C0": "Sorry, we can't play just now. You might be offline or our service could be down. Make sure you're connected to the Internet, and try again in a while.",
+ "C00D11C3": "Can't play. Make sure you have internet access, then try again.",
+ "C00D11C6": "Sorry, this app needs a restart. Go to Home, press the menu button on your controller, and choose Quit. Then start the app again.",
+ "C00D11CD": "Please try again. If the problem continues, visit www.xbox.com/support to check for guidance.",
+ "C00D11D1": "Can't play. Make sure your computer's sound and video cards are working and have the latest drivers, then try again.",
+ "C00D11D2": "Can't access the file. Make sure that the file isn't in use, that you can access the place the file is stored, and that your network's proxy settings are correct, then try again.",
+ "C00D11D3": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11D6": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D11DA": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11DF": "Can't play one or more songs. For more information, select an information icon in the now playing list.",
+ "C00D11E7": "Can't play or sync this protected file.",
+ "C00D1204": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D12A2": "Can't sign in. Please try again later.",
+ "C00D12A3": "Can't sign in because access requires a user name and password.",
+ "C00D12A4": "Can't sign in because the server has denied access. Please try again later.",
+ "C00D12A5": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A6": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A7": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A8": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A9": "Can't sign in due to a network error. Make sure you have network access and try again.",
+ "C00D12AA": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12D7": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C00D12DD": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D12E6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12E7": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12F7": "Can't check usage rights. Make sure you have internet access, then restart the app.",
+ "C00D12F8": "Sorry, can't check usage rights. Please try again in a few minutes.",
+ "C00D1313": "The app closed while trying to update this subscription. Further updates for this subscription will no longer download automatically. Try subscribing to it again or deleting it.",
+ "C00D1333": "Can't find a secure channel. The server certificate isn't valid.",
+ "C00D1334": "Can't find a secure channel. The server certificate is revoked or the revocation list can't be retrieved.",
+ "C00D1335": "Can't find a secure channel. The server certificate was issued by an untrusted certification authority.",
+ "C00D1336": "Can't find a secure channel. The server certificate name doesn't match the server address.",
+ "C00D1337": "Can't find a secure channel. The server certificate is expired.",
+ "C00D1338": "Can't perform this operation. Please try again later.",
+ "C00D1339": "Can't perform the requested action because access requires a user name and password.",
+ "C00D133B": "Can't perform the requested action because the website has denied access. Please try again later.",
+ "C00D133C": "Sorry, this item is no longer available from Xbox. Try searching for it - a newer version might be available.",
+ "C00D1342": "Can't perform the requested action because it's no longer on the website.",
+ "C00D134C": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134D": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134E": "Can't perform the requested action due to a network error. Make sure you have network access and try again.",
+ "C00D134F": "Can't do that because of a temporary server condition. Please try again later.",
+ "C00D1350": "Microsoft Update has encountered an unexpected error. Please try again later.",
+ "C00D1351": "Sorry, we can't connect to Xbox services. Please try again later.",
+ "C00D1352": "Wrong username and password combination.",
+ "C00D1354": "Please sign in to preview or play this item.",
+ "C00D1355": "You're not old enough to play explicit content.",
+ "C00D1356": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D1357": "Can't purchase or download media from multiple online stores.",
+ "C00D1358": "Can't purchase or download the item. It might not be available.",
+ "C00D135A": "Can't identify the provider of this item.",
+ "C00D135B": "This song can be downloaded only when you buy the whole album.",
+ "C00D135C": "You've used up all of your downloads for this item.",
+ "C00D135D": "You've reached the maximum number of things you can buy at one time.",
+ "C00D135F": "Can't sign in. Make sure you're using the right email address and password. The Xbox service might be temporarily unavailable.",
+ "C00D1360": "Can't download this item because the server isn't responding. The server might be temporarily unavailable or you may have lost your internet connection.",
+ "C00D1363": "The folder couldn't be opened. It might have been moved or deleted.",
+ "C00D1365": "To play this, we need to confirm usage rights. Please sign in with the Microsoft account you were using when you bought it.",
+ "C00D1366": "Can't download because there's not enough storage space for this item.",
+ "C00D1367": "Can't sign in. Please try again later.",
+ "C00D136C": "The email address and password that you entered are not linked to an Xbox profile. Enter a different Microsoft account (email address and password), or use these to create a new Microsoft account.",
+ "C00D136D": "Can't sign in because the Xbox service isn't yet available in your region.",
+ "C00D136E": "The email address and password that you entered are not linked to an Xbox profile. To use these credentials, first sign in at Xbox.com, then sign in to this app again.",
+ "C00D136F": "There's a serious error with your Xbox account.",
+ "C00D1371": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D1372": "Can't download. Make sure the media folder specified in software settings is accessible and that there's enough space on your hard disk.",
+ "C00D1374": "Sorry, can't sign in right now.",
+ "C00D1375": "You need to change your gamertag.",
+ "C00D1376": "Our terms of service have been updated. Select Terms of Service to read and accept the terms in a web browser, then return to this screen to sign in.",
+ "C00D1377": "Your Xbox account has been suspended.",
+ "C00D1378": "Your Xbox account has been suspended.",
+ "C00D1379": "Sorry, can't access your account right now. Please try again later.",
+ "C00D137B": "The item wasn't found. Please try again later.",
+ "C00D137C": "This item can't be previewed, purchased, or downloaded.",
+ "C00D137D": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C00D137E": "Sorry, we can't connect to Xbox services right now. Please try again later.",
+ "C00D137F": "Sorry, Xbox stores aren't yet available in your location. Please check back!",
+ "C00D1380": "That didn't work the way it was supposed to. Please try again.",
+ "C00D1381": "Sorry, we don't have the right album info for this.",
+ "C00D1382": "The Xbox service didn't return valid purchase information.",
+ "C00D1383": "The Xbox service didn't return valid sign in information.",
+ "C00D1384": "Can't provide your Microsoft Points balance right now.",
+ "C00D1385": "Need to check usage rights. Please sign in.",
+ "C00D1387": "The destination download folder doesn't exist. Check that the media folder in the software general settings is set correctly.",
+ "C00D1388": "Sorry, sign-in isn't supported in your region at this time.",
+ "C00D1391": "Before we can sign you in, we need you to verify your age. To continue, go to www.xbox.com/verifyage.",
+ "C00D1392": "Sorry, we can't sign you in due to age requirements for your region. For more information, go to www.xbox.com/verifyage.",
+ "C00D1393": "You are not old enough to download explicit content.",
+ "C00D1395": "Please sign in at Xbox.com and make sure your payment info is up to date.",
+ "C00D1396": "The app update is pending and this app needs a restart. Go to Home, press the menu button on your controller and choose Quit. Then start the app again.",
+ "C00D1397": "Before we can sign you in, we need you to verify your email account. To continue, go to https://account.live.com and sign in.",
+ "C00D2718": "Can't play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C00D2719": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one. If you have just renewed your Xbox Music Pass, please sign out and sign in again.",
+ "C00D271A": "To play this item, we need to check the usage rights for it. Please sign in with the profile you were using when you bought it.",
+ "C00D271D": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D271E": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2721": "Sorry, we can't do what you wanted because there's a problem with your computer's usage rights.%0.",
+ "C00D272B": "Sorry, can't play or download. Please try again in a few minutes.",
+ "C00D274D": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D2759": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2781": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D27D8": "Usage rights for this item have expired. To play it, sign in.",
+ "C00D27D9": "The usage rights for this item aren't active yet. Try again at a later date.",
+ "C00D27DB": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D280A": "Sorry, you need a newer computer to play or download this item.",
+ "C00D2841": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D284F": "Your rental has expired. To play this video, rent it again or buy it.",
+ "C00D2850": "You've already rented this video for this device. To get ready to watch it, select Download.",
+ "C00D2904": "To play this content, your computer's video card, video driver, analogue video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2905": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's video card doesn't work with it. Update your video card, then try again.",
+ "C00D2906": "To play this item, your video card, video driver, and screen must each be compliant with HDCP copy protection. One or more of them is not. To check HDCP compliance, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2907": "To play this content, your computer's video card, video driver, analogue video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2908": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D2909": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D290B": "Your current display setting is in clone (duplicate) mode. The current content cannot be viewed in this mode. Try changing the display settings to extended mode.",
+ "C00D2EED": "The proxy server couldn't be located. Please check your proxy server configuration.",
+ "C00D32E0": "To listen, connect speakers or headphones to your computer.",
+ "C00D36B2": "Choose a shorter path or file name. Current path or file name is too long. The file path and name can be up to 200 characters.",
+ "C00D36B4": "This item is in a format we don't support. Please choose something else.",
+ "C00D36C4": "This item's file format may be unsupported, the file extension may be incorrect, or the file may be corrupted.",
+ "C00D36E6": "Sorry, we're not sure what happened. Please try again later.",
+ "C00D36FA": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D36FF": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D4E86": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D5212": "This item was encoded in a format that's not supported.",
+ "C00D715D": "Sorry, you can't play rights-managed content while you're debugging. Finish your analysis, then try again.",
+ "C1010003": "To continue using this app, install the latest version.",
+ "C1010005": "Can't access the server. Make sure that there are no firewalls or proxy servers blocking access to the Xbox service, then try again.",
+ "C1010008": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C1010017": "The Xbox Live Terms of Service have been updated. The parent associated with this account must read and accept the new terms before you can sign in.",
+ "C101001C": "Can't retrieve the computer name.",
+ "C101001D": "Can't retrieve the computer name.",
+ "C101001F": "There might be a problem with your network connection or an error in the web address you entered. Check your network connection and, if applicable, the URL. Then try again.",
+ "C1010023": "Sign-in isn't available in your region.",
+ "C1010026": "This item can't be purchased on your computer. To download or watch it, use your Xbox 360 console.",
+ "C1010027": "Your network is too slow for instant playback, so your video will be downloaded to ensure optimal viewing. You'll find this item in your video collection once the download is complete.",
+ "C1010028": "Your network is too slow for instant playback. To ensure optimal viewing, download this video instead of trying to stream it.",
+ "C1010029": "This item is no longer available, or is available only for purchase and can't be downloaded using an Xbox Music Pass.",
+ "C101002A": "Can't complete the download. Please try again later.",
+ "C1010030": "You can leave feedback only on things you've bought. If you own this item, go to the Users page in PC settings and sign in to Windows with the Microsoft account you were using when you bought it, then try posting feedback again.",
+ "C1010036": "To continue, sign in.",
+ "C1010064": "Smart DJ is currently unavailable. Please try again later.",
+ "C1010065": "Songs from Xbox Music weren't added to this playlist because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010066": "This playlist wasn't refreshed because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010067": "This playlist couldn't be refreshed because similar songs couldn't be found.",
+ "C1010070": "Sorry, we can't post your review, due to either a network error or the contents of your review. Please check your internet connection. Also, make sure none of the language in your review is offensive. If the problem continues, wait a while and then try again.",
+ "C101008D": "Sorry, can't play. Please try again.",
+ "C101008E": "Couldn't play because of a network problem. Please try again.",
+ "C101008F": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010090": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010091": "Sorry, we're not sure what happened there. Please try again.",
+ "C1010094": "This song requires an Xbox Music Pass. To play the song, sign up for an Xbox Music Pass or sign in with an account that has one.",
+ "C1010095": "To stream rights-managed music or video to another device, that device needs to support the media rights management (DRM) for that content. Make sure you are signed in with the same account on both devices, or play content that's not rights-managed.",
+ "C1010098": "Access to this content is blocked based on the online safety settings for this account.",
+ "C1010099": "Make sure that this media file has been added to your media library and try to play it from the media library gallery of the application.",
+ "C101009A": "To play premium content, please ensure your build of Windows is signed with the official Microsoft Windows Production certificate.",
+ "C101009B": "Another app is controlling your sound at the moment. To listen here, close that app and try again.",
+ "C101009C": "That one is either corrupted or in a format we can't play.",
+ "C101009D": "If you are using remote desktop, try streaming or downloading on your local PC instead.",
+ "C101009E": "This song is not available on this device. The item doesn't match anything in the cloud, so we can't stream it for you here.",
+ "C101009F": "The connection to your TV was lost.",
+ "C10100A0": "We can't play from the file locations for those songs in that playlist.",
+ "C10100A1": "We cannot play on your receiver at this moment. Please disconnect your receiver and try again.",
+ "C10100A2": "Sorry, we couldn't play that. It looks like your audio or video device isn't using Windows certified drivers. Try again after installing the latest official drivers. The following files are not certified:",
+ "C10100C8": "Automatic refreshing has been disabled for this playlist due to poor performance. Editing the playlist rules to reduce list size might improve performance.",
+ "C10100C9": " ZUNE_E_MAXIMUM_PLAYLIST_LENGTH_EXCEEDED",
+ "C10100DD": "Could not download to your library. That path is no longer available. If you are using external storage, make sure it is available and connected.",
+ "C10100DE": "Your media library is currently write protected and preventing us from downloading. Please remove the write protection and try again.",
+ "C10100DF": "Couldn't download to your library. Your library doesn't contain any folders that are not associated with a cloud storage service.",
+ "C1010100": "Sorry, not sure what happened there. Close and reopen the app, then try again.",
+ "C1010101": "If the item is on an external hard drive, make sure the drive is connected and turned on.",
+ "C1010102": "Make sure you're connected to the internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C1010103": "This item is in a format we don't support. Please choose something else.",
+ "C1010104": "Make sure your video cable and TV both support HDCP copy protection. Also, check with the maker of your computer's video card to see if there's an HDCP-compliant driver for it.",
+ "C1010105": "Make sure the item you're trying to play is available locally. This app doesn't support playing over remote desktop.",
+ "C1010106": "Your version of Windows doesn't support playing music or video.",
+ "C1010107": "Wait a few moments, then try again.",
+ "C1010108": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one.",
+ "C1010109": "Can't Play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C101010B": "Can't play because we can't check usage rights. Make sure your PC's clock and time zone are set correctly, then try again.",
+ "C101010C": "Your TV or monitor does not support the copy protection technology required to play this content.",
+ "C101010D": "This song is not available through Xbox Music.",
+ "C101010F": "Can't play the item because it is being used by another application.",
+ "C1010140": "The item contains a sync ID reference to another item that does not exist in the local replica.",
+ "C1010141": "The item exists in the database but has not yet been assigned a sync ID.",
+ "C1010142": "The item contains a variable type sync ID reference but does not contain the sync type.",
+ "C1010143": "The item is missing a property that is required by the schema.",
+ "C1010144": "The message did not contain an item of the expected type.",
+ "C101014B": "Sorry, we can't download this right now. Wait a while, then try again.",
+ "C10101C2": "We've stopped playing because you've reached your data limit and we thought you should know. To resume, select Play.",
+ "C10101C3": "We've stopped playing because you're nearing your data limit and we don't want you to unknowingly exceed it. To resume, select Play.",
+ "C10101C4": "We've stopped playing because you're now connected to a metered network where you could quickly exceed your data limit. To resume, select Play.",
+ "C101A000": "Request completed successfully.",
+ "C101A001": "There was a problem. Please try again later.",
+ "C101A002": "There was a problem. Please try again later.",
+ "C101A003": "Can't complete your request. Make sure you've entered the right info, then try again.",
+ "C101A004": "To use this app, make sure you are signed in to your Xbox account.",
+ "C101A005": "Can't complete your request. Please try again later.",
+ "C101A006": "There was a problem. Please try again later.",
+ "C101A007": "There was a problem. Please try again later.",
+ "C101A008": "Can't complete your request because you have one or more duplicate entries. Check that you've entered valid information, then try again.",
+ "C101A009": "Can't complete your request. You've made too many service requests in a short time. Please try again later.",
+ "C101A010": "Can't complete your request. Check that you've entered valid information, then try again.",
+ "C101A053": "We can't check the playback rights for this item at the moment. Please try again later. Make sure you sign in with an account that matches the region setting of your device.",
+ "C101A054": "There was a problem. Please try again later. ",
+ "C101A055": "Sorry, this item is no longer available.",
+ "C101A1F8": "There was a problem. Please try again later.",
+ "C101A1F9": "To complete your request, a parent needs to sign in.",
+ "C101A1FA": "That isn't the right parent account. Please try again.",
+ "C101A1FB": "Sorry, we couldn't get the info we needed. Please try again later.",
+ "C101A1FC": "There was a problem. Please try again later.",
+ "C101A20D": "There was a problem. Please try again later.",
+ "C101A20E": "There was a problem. Please try again later.",
+ "C101A20F": "There was a problem. Please try again later.",
+ "C101A211": "There was a problem. Please try again later.",
+ "C101A212": "There was a problem. Please try again later.",
+ "C101A213": "There was a problem. Please try again later.",
+ "C101A214": "There was a problem. Please try again later.",
+ "C101A215": "There was a problem. Please try again later.",
+ "C101A216": "There was a problem. Please try again later.",
+ "C101A217": "There was a problem. Please try again later.",
+ "C101A218": "There was a problem. Please try again later.",
+ "C101A219": "There was a problem. Please try again later.",
+ "C101A21A": "There was a problem. Please try again later.",
+ "C101A21B": "You haven't accepted the Xbox Live Terms of Service. To continue, please review and accept the terms.",
+ "C101A21C": "There was a problem. Please try again later.",
+ "C101A230": "Please enter a gamertag and try again.",
+ "C101A231": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A232": "There was a problem. Please try again later.",
+ "C101A233": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A234": "There was a problem. Please try again later.",
+ "C101A235": "There was a problem. Please try again later.",
+ "C101A236": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A237": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A238": "Can't complete your request due to age restrictions. Your parent would need to change your account permissions in Account Settings, Privacy, Family Settings.",
+ "C101A239": "Can't sign in. Please check and correct your account details, then try again.",
+ "C101A23A": "There was a problem. Please try again later.",
+ "C101A23B": "There was a problem. Please try again later.",
+ "C101A23D": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A23E": "There was a problem. Please try again later.",
+ "C101A241": "Sorry, the item you're trying to buy is no longer available.",
+ "C101A242": "There was a problem. Please try again later.",
+ "C101A243": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A244": "Sorry, that subscription isn't available anymore.",
+ "C101A245": "There was a problem. Please try again later.",
+ "C101A246": "There's no Xbox profile associated with your current Microsoft account. To get the most from this app, create an Xbox profile using this email and password combination.",
+ "C101A247": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A248": "There was a problem. Please try again later.",
+ "C101A249": "There was a problem. Please try again later.",
+ "C101A24A": "There was a problem. Please try again later.",
+ "C101A24B": "You need to be signed in to play this. Sign in, then try again.",
+ "C101A24D": "Can't sign in right now. Please try again later.",
+ "C101A24E": "The Xbox Live Code of Conduct doesn't permit your gamertag. You must change it before you can use the Xbox service.",
+ "C101A3E9": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3EA": "This item's price has changed.",
+ "C101A3EB": "The item wasn't found. Please try again later.",
+ "C101A3EC": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3ED": "You've exhausted the number of times you can restore this item.",
+ "C101A3EE": "Sorry, you can't stream music or video when you're outside of the region for your profile.",
+ "C101A3EF": "You don't have enough Microsoft Points to complete the purchase.",
+ "C101A3F0": "You've used or purchased the maximum number of Microsoft Points for today. Please try again tomorrow.",
+ "C101A3F1": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A3F2": "To protect your account, Xbox limits the number of purchases in a 24-hour period. Please try again later.",
+ "C101A3F3": "Your Xbox Music Pass has expired. To play this music, sign up for a new pass in Settings, Account, Xbox Music Pass.",
+ "C101A3F4": "You're using an unsupported version of this Xbox app.",
+ "C101A3F5": "Can't play because the item's usage rights are no longer valid. Try deleting this item and downloading it again.",
+ "C101A3F6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C101A3F7": "Sorry, we're not sure what happened there. Please try again.",
+ "C101A3F8": "Xbox can't issue the requested rights.",
+ "C101A3F9": "You're using an unsupported version of this Xbox app.",
+ "C101A3FA": "Please use an SSL connection to sign in.",
+ "C101A3FB": "Can't sign in.",
+ "C101A3FC": "The license is corrupt or not valid.",
+ "C101A3FD": "The content owner for the license you just acquired requires that your device be linked to this computer.",
+ "C101A3FF": "Sorry, this item is unavailable.",
+ "C101A400": "To protect your account, the number of purchases you can make in a 24-hour period is limited. Please try again later.",
+ "C101A410": "Can't remove this computer or device. You've already removed one from this Xbox Music Pass in the last 30 days.",
+ "C101A411": "You're downloading songs from Xbox Music on the maximum allowed devices. You might still be able to stream music here, you just can't download it.",
+ "C101A412": "Sorry, you don't have enough song credits for this purchase. To complete your purchase, buy Microsoft Points in Account Settings.",
+ "C101A413": "Sorry, this code has already been redeemed. Enter a new code or use Microsoft Points for your purchase.",
+ "C101A414": "The offer you're trying to use isn't valid.",
+ "C101A415": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A416": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A417": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A418": "Can't purchase because the Xbox service isn't yet available in your region.",
+ "C101A419": "This song has been removed from Xbox Music at the request of the copyright holder.",
+ "C101A7D1": "Need to check usage rights. Please sign in to the account you used to purchase the item.",
+ "C101A7D2": "The item wasn't found. Please try again later.",
+ "C101A7D3": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A7D4": "This song is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "C101A7D5": "Sorry, we can't play or download because we can't check usage rights at the moment. Please try again soon!",
+ "C101A7D8": "You've exceeded the number of videos you can stream at the same time. To watch the current video, stop one of your other streams and then start this one again.",
+ "C101A7DA": "You've exceeded the number of videos you're allowed to stream at the same time. To watch the current video, stop one of your other streams, and then start this one again.",
+ "C101A7DB": "You've exceeded the number of songs you're allowed to stream at the same time. To listen to the current song, stop one of your other streams, and then start this one again.",
+ "C101A7DC": "This song can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "C101A7DD": "Sorry, this song isn't available here. Try a different one.",
+ "C101A7E1": "Sorry, you've used up the number of simultaneous streams for this video. Your video will stop.",
+ "C101A7E2": "Sorry, you've used up the number of simultaneous streams for this song. Your song will stop.",
+ "C101A9C5": "Can't sign in. Please try again later.",
+ "C101A9C6": "Can't sign in. Please try again later.",
+ "C101A9C7": "Can't sign in. Please try again later.",
+ "C101A9C8": "Can't sign in. Please try again later.",
+ "C101A9C9": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Devices.",
+ "C101A9CA": "Can't stream this song, possibly because you're already streaming from another location. Try again later.",
+ "C101A9CB": "Sorry, can't connect to Xbox services. Please try again later.",
+ "C101A9CC": "Can't complete your transaction. Please try again later.",
+ "C101A9CD": "Can't complete your transaction. Please try again later.",
+ "C101A9CE": "Can't connect to Xbox. Your account is in use somewhere else.",
+ "C101A9CF": "Can't complete your transaction. Please try again later.",
+ "C101A9D4": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D5": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D6": "This song is no longer available using Xbox Music Pass.",
+ "C101AB55": "You have reached the limit for the number of tracks you may play before logging in.",
+ "C101AB6A": "The licence for this content has expired. Please delete the file and download it again from your collection.",
+ "C101ABB9": "Can't complete your transaction. Please try again later.",
+ "C101ABBA": "Can't download media usage rights. Please try again later.",
+ "C333000B": "Failed to acquire a licence for the content. Make sure your device has all of the necessary certificates.",
+ "C33305DD": "Your parent has restricted your account.",
+ "C33307D2": "The content cannot be licensed in this country/region.",
+ "C33307D3": "To view this content you need to be in the region for your Xbox profile. If you've moved permanently, change your region at account.xbox.com.",
+ "C33307D5": "This rental has expired.",
+ "C33307D8": "The maximum download count has been reached.",
+ "C33307D9": "Please sign in.",
+ "C33307DA": "Unable to acquire usage rights for the content.",
+ "C3330835": "The maximum number of concurrent streams for this content has been reached.",
+ "C3330837": "Your account has reached the maximum number of simultaneous streams.",
+ "C3330838": "The maximum number of concurrent streams for this content has been reached."
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/resources/en-us.json b/packages/microsoft.zunemusic/resources/en-us.json
new file mode 100644
index 00000000..9b2d4edd
--- /dev/null
+++ b/packages/microsoft.zunemusic/resources/en-us.json
@@ -0,0 +1,2369 @@
+{
+ "resources": {
+ "IDS_ACC_BACK_BUTTON": "Back",
+ "IDS_ACC_HOME_BUTTON": "Home",
+ "IDS_ACC_REFRESH_BUTTON": "Refresh",
+ "IDS_ACTIVATION_LIMIT_EXCEEDED_DTO": "You're already downloading on the maximum number of devices.",
+ "IDS_ADVERTISEMENT": "Advertisement",
+ "IDS_APP1_MODULE_VIEW_ALL": "View all",
+ "IDS_APP1_MODULE_VIEW_ALL_LABEL": "View all {0}",
+ "IDS_APP2_FILTER_SORTED_BY": "Sort by",
+ "IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT": "Content filtered. Appropriate up to age {0}.",
+ "IDS_APP2_PARENTAL_NO_CONTENT_TITLE": "Parental controls are enabled",
+ "IDS_BETA_TOS_ACCEPT_MESSAGE": "By clicking I Accept, you agree to the license terms required to use this app.",
+ "IDS_BETA_TOS_BUTTON_ACCEPT": "I accept",
+ "IDS_BETA_TOS_BUTTON_DECLINE": "Cancel",
+ "IDS_BETA_TOS_TITLE": "First things first.",
+ "IDS_BROWSE_ACTION_TITLE": "Show More",
+ "IDS_BUY_BUTTON": "Buy",
+ "IDS_BUY_BUTTON_VIDEO": "Buy",
+ "IDS_CANCEL_BUTTON": "Cancel",
+ "IDS_CANCEL_BUTTON_TC": "Cancel",
+ "IDS_CHILD_AGE_GATING_MESSAGE": "Purchase of this content is currently not allowed for child and teen accounts.",
+ "IDS_CHILD_AGE_GATING_TITLE": "Sorry",
+ "IDS_CLEAR_DOWNLOAD_ERROR_BUTTON": "Clear error",
+ "IDS_CLEAR_SELECTION": "Clear selection",
+ "IDS_CLOSE_BUTTON": "Close",
+ "IDS_CLOSE_BUTTON_LC": "close",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE": "You have more music than we can sync with the cloud. To keep your music in sync, limit your number of songs to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE": "Can't sync your music.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER": "Can't sync your music",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE": "We can't sync with the cloud right now. Until we do, changes you make here won't show up on other devices and changes on those devices won't show up here. We'll keep trying. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE": "Can't sync right now.",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER": "Can't sync",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT": "More info",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE": "Playlists can have only {0} songs. Choose fewer songs or remove some first.",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL": "[[1]Playlists can have only {0} song. Choose fewer songs or remove some first.][[*]Playlists can have only {0} songs. Choose fewer songs or remove some first.]",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE": "Can't add to {0}",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE": "You have more playlists than we can sync with the cloud. To keep your playlists in sync, limit their number to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE": "Can't sync playlists.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER": "Can't sync playlists",
+ "IDS_COLLECTION_ALL_VIDEO_EMPTY": "When you add videos to your Windows library, they'll appear here, too.",
+ "IDS_COLLECTION_CLOUD_MATCHED_ARIA": "Cloud matched",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING": "Checking Xbox Music availability",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA": "Cloud sync pending",
+ "IDS_COLLECTION_HEADER_ZOOM_IN": "Activate to zoom in",
+ "IDS_COLLECTION_HEADER_ZOOM_OUT": "Activate to zoom out",
+ "IDS_COLLECTION_IN_CLOUD": "In cloud",
+ "IDS_COLLECTION_IN_CLOUD_FREE": "Matched (available here and for streaming on other Windows 8/Windows RT devices)",
+ "IDS_COLLECTION_IN_CLOUD_MATCHED": "Matched (available here and for streaming on other Xbox Music devices)",
+ "IDS_COLLECTION_MOVIE_EMPTY": "It's lonely here. Find hit movies at the Xbox Video Store.",
+ "IDS_COLLECTION_MOVIE_EMPTY_LINK": "Show me hit movies at the Xbox Video Store",
+ "IDS_COLLECTION_MUSIC_EMPTY": "It’s lonely here. Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_2": "Go to the Windows desktop. Select Windows Explorer, then Music Library. Put your MP3s in this folder.",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK": "Browse millions of songs in Xbox Music",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM": "Find music to stream for free or buy and add to your collection",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM": "Browse all music",
+ "IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE": "Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_TITLE": "It’s lonely here.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT": "This app plays music from your Windows library. To add music, go to the Windows desktop, select Windows Explorer and then Music Library.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE": "Collection",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE": "We’ll add songs from any files you have on this PC.",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE": "Choose where we look",
+ "IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK": "Choose where we look for music on this PC",
+ "IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK": "Add music to your Windows music library",
+ "IDS_COLLECTION_MUSIC_SETTINGS_TITLE": "Settings",
+ "IDS_COLLECTION_NOT_IN_CLOUD": "Not in cloud",
+ "IDS_COLLECTION_OPEN_FILES_LINK": "Open or play something",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE": "Browse new, featured, and top music.",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE": "Explore music",
+ "IDS_COLLECTION_PIVOT": "collection",
+ "IDS_COLLECTION_PIVOT_TC": "Collection",
+ "IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD": "Add to cloud",
+ "IDS_COLLECTION_PURCHASES_RESTORE": "Restore",
+ "IDS_COLLECTION_PURCHASES_RESTORE_TEXT": "Where possible, restore all purchased music to my collection. Some purchases may no longer be available.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE": "This song is no longer available for streaming or download from Xbox Music. It might be available for purchase.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE": "Song not available.",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD": "Streaming",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE": "Streaming only",
+ "IDS_COLLECTION_THIS_DEVICE_ONLY": "This device only",
+ "IDS_COLLECTION_TOOLTIP_CANT_PLAY_ONEDRIVE_TRACK": "This music file cannot be played here.",
+ "IDS_COLLECTION_TOOLTIP_CLOUD_STATUS": "Streaming status",
+ "IDS_COLLECTION_TOOLTIP_LEARN_MORE": "Learn more",
+ "IDS_COLLECTION_TOOLTIP_MATCHED": "Listen offline here, also in Xbox Music catalog",
+ "IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD": "Not in cloud (available only here)",
+ "IDS_COLLECTION_TOOLTIP_STREAMING": "Stream from Xbox Music catalog (download to listen offline)",
+ "IDS_COLLECTION_TOOLTIP_UNMATCHED": "Unmatched (available only here)",
+ "IDS_COLLECTION_TV_EMPTY": "Show me TV shows at the Xbox Video Store",
+ "IDS_COLLECTION_VIDEO_EMPTY": "When you have videos that aren't movies or TV shows, they'll appear here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY": "It's lonely here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2": "Make sure your videos are part of your Windows library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE": "You can also open files directly, but playing them this way won't add them to your Video library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT": "This app plays videos from your Windows library. To add videos, go to the Windows desktop, select Windows Explorer, and then Videos Library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE": "My Videos",
+ "IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK": "Choose where we look for videos on this PC",
+ "IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK": "Add videos to your Windows video library",
+ "IDS_COLLECTION_VIDEO_SETTINGS_TITLE": "Settings",
+ "IDS_COMMA_SEPARATOR": "{0}, {1}",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY": "When you connect to your Xbox 360 with Xbox SmartGlass, what you play there will appear here.",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE": "Welcome!",
+ "IDS_COMPOSE_MESSAGE_SEND": "Send",
+ "IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL": "Move and tap with one finger.",
+ "IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL": "Zoom with two.",
+ "IDS_CONTROLLER_DISMISS_KEYBOARD": "Tap here when you're done typing.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING": "Someone else is using their Xbox SmartGlass remote.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON": "OK",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE": "Sorry, you can’t use the remote right now.",
+ "IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL": "Enter your Family Settings pass code to continue.",
+ "IDS_CONTROLLER_INVOKE_KEYBOARD": "Tap here to start typing.",
+ "IDS_CONTROLLER_SAME_WIRELESS_NETWORK": "For the best experience, your Xbox console and this device should be on the same wireless network.",
+ "IDS_CONTROLLER_SEPARATE_NETWORKS": "Xbox SmartGlass will work across separate networks, but you can't use the keyboard or browser control.",
+ "IDS_CONTROLLER_SLOW_CONNECTION": "Slow connection",
+ "IDS_CONTROLLER_SLOW_CONNECTION_BUTTON": "OK",
+ "IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO": "More info",
+ "IDS_CONTROLLER_SWITCHER_BROWSER": "Browser",
+ "IDS_CONTROLLER_SWITCHER_BUTTON": "Switch",
+ "IDS_CONTROLLER_SWITCHER_CONTROLLER": "Controller",
+ "IDS_CONTROLLER_SWITCHER_GUIDE": "Guide",
+ "IDS_CONTROLLER_SWITCHER_KEYBOARD": "Keyboard",
+ "IDS_CONTROLLER_TUTORIAL_SWIPE": "Swipe to move and hold to move faster",
+ "IDS_CONTROLLER_TUTORIAL_TAP": "Tap to select",
+ "IDS_CONTROLLER_WEB_HUB_BUTTON": "Web Hub",
+ "IDS_CREATEACCOUNT_TITLE": "Create Account",
+ "IDS_DELETE_BUTTON": "Delete",
+ "IDS_DELETE_DESCRIPTION_LOCAL_PLURAL": "[[1]Are you sure you want to delete this {0} item?][[*]Are you sure you want to delete these {0} items?]",
+ "IDS_DELETE_DESCRIPTION_LOCAL_SINGLE": "Are you sure you want to delete \"{0}\"?",
+ "IDS_DELETE_LABEL": "Delete",
+ "IDS_DEMO_CONFIGURATION_COMPLETE": "The application has been configured for the retail experience. It will now close.",
+ "IDS_DEMO_IN_DEMO_MODE": "Retail demo",
+ "IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER": "Featured Albums",
+ "IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER": "Featured Artists",
+ "IDS_DEMO_MUSIC_EXPLORE_HEADER": "Discover new music",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1": "Listen to millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE": "Browse and buy from a catalog of millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2": "Find, play, and collect your favorites",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3": "Save them as playlists and see them on other devices",
+ "IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER": "Explore Xbox Music",
+ "IDS_DEMO_MUSIC_EXPLORE_SUBTITLE": "Xbox Music lets you listen to your favorite artists, and helps you discover new ones.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE": "xbox music store",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE": "* Internet required. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE": "Buy individual songs or get unlimited access to millions of songs with Xbox Music Pass.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE": "Purchase songs and albums from the Xbox Music store to build your personal music collection.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE": "From the latest new releases to classic favorites.",
+ "IDS_DEMO_MUSIC_RADIO_HEADER": "Personalized radio",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_1": "Pick an artist and we'll pick the tunes",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_2": "Save your favorite stations as playlists for easy listening",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_3": "Skip as many songs as you like — you're in complete control",
+ "IDS_DEMO_MUSIC_RADIO_SUBTITLE": "Xbox Music lets you listen to customized stations of music you'll love.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE": "* Internet required. Limits on free streaming apply. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE": "Enjoy 6 months free unlimited music streaming on every Windows PC and tablet.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE": "Get Xbox Music Pass for unlimited access to millions of songs on all your devices.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE": "Xbox Music brings you all the music you love. Any way you want it.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE": "* Broadband Internet and compatible devices required. See xbox.com/live.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE": "Play your purchased videos anywhere you go. Start on your tablet and pick up where you left off on your Xbox 360.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF": "Rent or buy the latest HD movies.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON": "Rent or buy the latest HD movies and buy TV shows.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE": "* Content from Xbox Video Store. Internet required; carrier fees apply. HD capable display required.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE": "Watch what you love wherever you are, get instant-on HD to start watching right away.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON": "Get the latest TV shows the day after they air.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE": "Xbox Video brings you the latest movies and TV shows you love, anywhere you are.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV": "Xbox Video brings you the latest movies you love, anywhere you are.",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING": "Add to now playing",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION": "add to now playing",
+ "IDS_DETAILS_ALL_EPISODES_LABEL": "All episodes",
+ "IDS_DETAILS_ARTIST_ALBUMS": "albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL_LC": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL": "Show all albums",
+ "IDS_DETAILS_AUDIO_LANGUAGE": "{0} audio",
+ "IDS_DETAILS_BUY_ALBUM_LABEL": "Buy album",
+ "IDS_DETAILS_BUY_BUNDLE": "Buy bundle",
+ "IDS_DETAILS_BUY_EPISODE_LABEL": "Buy/rent",
+ "IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL": "Buy episode",
+ "IDS_DETAILS_BUY_EXTRA": "Buy extra",
+ "IDS_DETAILS_BUY_SEASON_CURRENT_LABEL": "Buy season pass",
+ "IDS_DETAILS_BUY_SEASON_LABEL": "Buy season",
+ "IDS_DETAILS_BUY_SONG_LABEL": "Buy song",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT": "1 album",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_DETAILS_COLLECTION_ALBUMS_COUNT": "{0} albums",
+ "IDS_DETAILS_COLLECTION_NO_SONGS": "no songs in collection",
+ "IDS_DETAILS_COLLECTION_SONG_COUNT": "1 song in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_COUNT": "{0} songs in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_PLURAL": "[[1]{0} song in collection][[*]{0} songs in collection]",
+ "IDS_DETAILS_CURRENT_MEDIA_LABEL": "Now playing",
+ "IDS_DETAILS_DEMO_PURCHASED_LABEL": "Demo purchased",
+ "IDS_DETAILS_DESCRIPTION_LABEL": "Description",
+ "IDS_DETAILS_DEVELOPER_LABEL": "Developer",
+ "IDS_DETAILS_DOWNLOAD_FREE_EXTRA": "Get for Xbox 360",
+ "IDS_DETAILS_DOWNLOAD_LABEL": "Download",
+ "IDS_DETAILS_DOWNLOAD_LABEL_HD": "Download (HD)",
+ "IDS_DETAILS_DOWNLOAD_LABEL_SD": "Download (SD)",
+ "IDS_DETAILS_DURATION_HOURS_FORMAT": "{0} hr {1} min",
+ "IDS_DETAILS_DURATION_LABEL": "Duration",
+ "IDS_DETAILS_DURATION_MINS_FORMAT": "{0} min",
+ "IDS_DETAILS_DURATION_MINSEC_FORMAT": "{0} min {1} sec",
+ "IDS_DETAILS_EPISODES_LABEL": "Episodes",
+ "IDS_DETAILS_EPISODES_LABEL_LC": "episodes",
+ "IDS_DETAILS_EPISODES_LABEL_UC": "EPISODES",
+ "IDS_DETAILS_EXPLICIT_LABEL": "Explicit",
+ "IDS_DETAILS_EXPLICIT_LABEL_UC": "EXPLICIT",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL": "Extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_LC": "extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_UC": "EXTRAS",
+ "IDS_DETAILS_EXTRA_FOR_GAME": "{0} for {1}",
+ "IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL": "{0}, last purchased on {1}",
+ "IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON": "{0}, purchased on {1}",
+ "IDS_DETAILS_EXTRA_PURCHASED_LABEL": "Extra purchased",
+ "IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL": "Purchased on {0}",
+ "IDS_DETAILS_FEATURED_TRAILER_TITLE": "Official trailer",
+ "IDS_DETAILS_FEATURED_WATCH_TRAILER": "Play trailer",
+ "IDS_DETAILS_FILE_OPEN_LABEL": "Open file",
+ "IDS_DETAILS_GAME_PURCHASED_LABEL": "Game purchased",
+ "IDS_DETAILS_GENRE_LABEL": "Genres",
+ "IDS_DETAILS_HUB_MUSIC_ALBUMS": "Show all available albums from this artist.",
+ "IDS_DETAILS_HUB_TV_SEASONS": "Show all available seasons from this series.",
+ "IDS_DETAILS_LATEST_EPISODE_LABEL": "New episode available",
+ "IDS_DETAILS_METADATA_SEPERATOR": " • ",
+ "IDS_DETAILS_MORE_ACTION": "More",
+ "IDS_DETAILS_MY_ALBUMS": "In Collection",
+ "IDS_DETAILS_NETWORK_LABEL": "Network",
+ "IDS_DETAILS_NEW_EPISODE_LABEL": "New episode",
+ "IDS_DETAILS_NOT_RATED_LABEL": "NR",
+ "IDS_DETAILS_NOT_RATED_LONG_LABEL": "Not rated",
+ "IDS_DETAILS_OVERVIEW": "overview",
+ "IDS_DETAILS_PERC_WATCHED_LABEL": "{0}% watched",
+ "IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE": "Choose an app",
+ "IDS_DETAILS_PLATFORM_LABEL": "Platform",
+ "IDS_DETAILS_PLAY_ALBUM_BUTTON": "Play album",
+ "IDS_DETAILS_PLAY_NOW_LABEL": "Play",
+ "IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_ON_XBOX_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL": "Start radio",
+ "IDS_DETAILS_PLAY_SEASON_BUTTON": "Play season",
+ "IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL": "Play Smart DJ",
+ "IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL": "Play song on Xbox",
+ "IDS_DETAILS_PLAY_TRAILER_LABEL": "Play trailer",
+ "IDS_DETAILS_PLAYLIST_NO_SONGS": "no songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONG_COUNT": "1 song in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_COUNT": "{0} songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_PLURAL": "[[1]{0} song in playlist][[*]{0} songs in playlist]",
+ "IDS_DETAILS_PREVIEW_ALBUM_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_ARTIST_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_EPISODE_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_SONG_LABEL": "Preview",
+ "IDS_DETAILS_PUBLISHER_LABEL": "Publisher",
+ "IDS_DETAILS_QUALITY_LABEL": "Quality",
+ "IDS_DETAILS_RATING_LABEL": "Rating",
+ "IDS_DETAILS_RATING_USERRATED": "Your rating",
+ "IDS_DETAILS_RATINGS_PLURAL": "[[1]{0} rating][[*]{0} ratings]",
+ "IDS_DETAILS_RECENT_ALBUMS": "Latest Albums",
+ "IDS_DETAILS_RELATED_ARTISTS": "Related Artists",
+ "IDS_DETAILS_RELEASE_DATE_LABEL": "Release date",
+ "IDS_DETAILS_REVIEW_LABEL": "Review",
+ "IDS_DETAILS_SEASONS_LABEL": "Seasons",
+ "IDS_DETAILS_SHUFFLE_ALL": "Shuffle all",
+ "IDS_DETAILS_SIMILAR_MOVIES": "Similar Movies",
+ "IDS_DETAILS_START_DOWNLOAD_LABEL": "Start download",
+ "IDS_DETAILS_STUDIO_LABEL": "Studio",
+ "IDS_DETAILS_TITLE_NAR": "Details for {0}",
+ "IDS_DETAILS_TOP_SONGS": "Top Songs",
+ "IDS_DETAILS_TRACK_NUM_FORMAT": "{0}.",
+ "IDS_DETAILS_TRACKS_LABEL": "Songs",
+ "IDS_DETAILS_TRY_AGAIN_LABEL": "Try again",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_HD": "Try again (HD)",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_SD": "Try again (SD)",
+ "IDS_DETAILS_TVSERIES_SEASONS": "seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_ALL": "all seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_LOCAL": "my seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL": "Show all seasons",
+ "IDS_DETAILS_UNRATED_LABEL": "UR",
+ "IDS_DETAILS_UNRATED_LONG_LABEL": "Unrated",
+ "IDS_DETAILS_VIDEO_HUB_RELATED": "you may also like",
+ "IDS_DETAILS_VIDEO_HUB_RELATED_UC": "YOU MAY ALSO LIKE",
+ "IDS_DETAILS_VIEW_FULL_APP": "Explore app",
+ "IDS_DETAILS_VIEW_FULL_ARTIST": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_GAME": "Explore game",
+ "IDS_DETAILS_VIEW_FULL_MOVIE": "Explore movie",
+ "IDS_DETAILS_VIEW_FULL_SEASON": "Show seasons",
+ "IDS_DETAILS_VIEW_FULL_SERIES": "Explore series",
+ "IDS_DETAILS_VIEW_MORE": "Show more",
+ "IDS_DETAILS_WATCH_NOW_LABEL": "Watch",
+ "IDS_DETAILS_WATCH_ON_XBOX_LABEL": "Buy/rent",
+ "IDS_DETAILS_WATCH_TRAILER_LABEL": "Watch trailer",
+ "IDS_DIALOG_ERROR_CODE": "STATUS CODE",
+ "IDS_DIALOG_ERROR_FEEDBACKLINK": "Give Microsoft feedback about this problem",
+ "IDS_DIALOG_ERROR_MORE_INFO": "Find help for this",
+ "IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE": "Your session has timed out. Try again?",
+ "IDS_DIALOG_SESSION_TIMED_OUT_TITLE": "Lost connection.",
+ "IDS_DIALOG_UNEXPECTED_ERROR_CAPTION": "There's a problem.",
+ "IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD": "Can't download",
+ "IDS_DOWNLOAD_ERROR_CAPTION": "Can't download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL": "Cancel all",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD": "Cancel Download",
+ "IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS": "There were problems with your download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS": "Tap a song to retry, or cancel a download to see detailed info on a problem.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS": "Retry all downloads",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD": "Retry download",
+ "IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER": "Try again later",
+ "IDS_DOWNLOAD_LABEL": "Keep Offline",
+ "IDS_EDIT_BUTTON": "Edit",
+ "IDS_EDITBOX_ERROR_NUMBER": "Use numbers in this field.",
+ "IDS_EDITBOX_REMAINING_PLURAL": "[[1]{0} character remaining][[*]{0} characters remaining]",
+ "IDS_EMPTY_VIEW": "There's nothing to show here right now. Please check back later.",
+ "IDS_FAILED_PANEL_HEADER": "We can't connect to Xbox services right now.",
+ "IDS_FAILED_PANEL_LABEL": "Make sure you have Internet access, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_DESC": "To use Xbox services, connect to the Internet, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_HEADER": "Your PC is offline.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE": "We've enabled new features! To see them, please restart this app.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE": "New features available",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER": "App update",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED": "Please restart the app.",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED": "Restart for new features.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY": "Couldn't download to your library. That path is no longer available. If you're using external storage, make sure it's available and connected.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG": "Download canceled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT": "Download canceled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOADED": "Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG": "Some things didn't download ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT": "Problem downloading ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG": "You're low on storage space",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT": "You're low on storage space",
+ "IDS_FILTER_ALL": "all",
+ "IDS_FILTER_ALL_GENRES": "all genres",
+ "IDS_FILTER_ALL_GENRES_SC": "All genres",
+ "IDS_FILTER_ALL_SUBGENRES_SC": "All subgenres",
+ "IDS_FILTER_BY": "By",
+ "IDS_FILTER_SORTED_BY": "arranged by",
+ "IDS_GLOBAL_COMMAND_HELP": "Help",
+ "IDS_GLOBAL_COMMAND_HOME": "Home",
+ "IDS_GLOBAL_COMMAND_NOW_PLAYING": "Now Playing",
+ "IDS_GLOBAL_COMMAND_RESTORE_PURCHASES": "Restore purchases",
+ "IDS_GLOBAL_COMMAND_SEARCH": "Search",
+ "IDS_HHMMSS_DURATION": "{0}:{1}:{2}",
+ "IDS_HOME_NOW_PLAYING": "Now Playing",
+ "IDS_HOME_NOW_PLAYING_EPISODE": "Now Playing - {0}",
+ "IDS_HOME_NOW_PLAYING_JUMP_IN": "Jump in",
+ "IDS_HOME_NOW_PLAYING_LC": "now playing",
+ "IDS_HOME_NOW_PLAYING_RESUME": "Resume",
+ "IDS_HOME_NOW_PLAYING_RESUME_ARIA": "Resume - {0}",
+ "IDS_HOME_NOW_PLAYING_XBOX": "On your Xbox",
+ "IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED": "Last played on your Xbox",
+ "IDS_HOME_PIVOT": "home",
+ "IDS_HOME_TILE_PAUSED_LABEL": "paused",
+ "IDS_LOADING_STATUS_LABEL": "Loading",
+ "IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR": "Add folder",
+ "IDS_MANAGE_FOLDERS_DESCRIPTION": "Right now, we're watching these folders:",
+ "IDS_MANAGE_FOLDERS_DONE_BUTTON": "Done",
+ "IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR": "Exclude folder",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT": "To remove this folder, add another one first.",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE": "Your collection needs at least one folder to work.",
+ "IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION": "Media Browser",
+ "IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION": "Media Player",
+ "IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION": "Media Player Preview",
+ "IDS_MANIFEST_MUSIC_APP_DESCRIPTION": "Music",
+ "IDS_MANIFEST_MUSIC_APP_NAME": "Music",
+ "IDS_MANIFEST_TEST_APP_DESCRIPTION": "Xbox on Windows",
+ "IDS_MANIFEST_VIDEO_APP_DESCRIPTION": "Video",
+ "IDS_MANIFEST_VIDEO_APP_NAME": "Video",
+ "IDS_MARKETPLACE_BY_PLAYRANK": "by most played",
+ "IDS_MARKETPLACE_PIVOT": "all music",
+ "IDS_MARKETPLACE_REGION_EMPTY": "There's nothing available in your region just yet. Please check back soon!",
+ "IDS_MARKETPLACE_SORT_BEST_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_CRITIC_RATING": "critic rating",
+ "IDS_MARKETPLACE_SORT_PLAY_RANK": "most played",
+ "IDS_MARKETPLACE_SORT_POPULARITY": "most played",
+ "IDS_MARKETPLACE_SORT_RELEASE_DATE": "release date",
+ "IDS_MARKETPLACE_SORT_SALES_RANK": "top selling",
+ "IDS_MARKETPLACE_SORT_TITLE": "title",
+ "IDS_MARKETPLACE_SORT_TOP_RENTED": "top rented",
+ "IDS_MARKETPLACE_SORT_TOP_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_USER_RATING": "customer rating",
+ "IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION": "In collection",
+ "IDS_MEDIA_ERROR_CAPTION": "Media problem.",
+ "IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON": "Song Download Error",
+ "IDS_MEDIA_STATUS_DOWNLOADING_ICON": "Song is Downloading",
+ "IDS_MEDIA_STATUS_INLINE_STREAMING_ICON": "Media is available for streaming",
+ "IDS_MEDIA_STATUS_NOW_PLAYING_ICON": "Song is playing",
+ "IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON": "Sorry, can't play. Please try again.",
+ "IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your monthly streaming limit.",
+ "IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your play limit for this song.",
+ "IDS_MEDIATYPE_ALBUM": "Album",
+ "IDS_MEDIATYPE_ARTIST": "Artist",
+ "IDS_MEDIATYPE_GAME": "Xbox 360 game",
+ "IDS_MEDIATYPE_GAME_WINDOWS": "Windows game",
+ "IDS_MEDIATYPE_MOVIE": "Movie",
+ "IDS_MEDIATYPE_PLAYLIST": "Playlist",
+ "IDS_MEDIATYPE_SONG": "Song",
+ "IDS_MEDIATYPE_TVEPISODE": "TV Episode",
+ "IDS_MEDIATYPE_TVSEASON": "TV Season",
+ "IDS_MEDIATYPE_TVSERIES": "TV Series",
+ "IDS_MMSS_DURATION": "{0}:{1}",
+ "IDS_MODIFIER_PREFIX_SORTBY": "arrange by:",
+ "IDS_MODIFIER_PREFIX_VIEW": "show:",
+ "IDS_MODIFIER_PREFIX_VIEWBY": "arrange by",
+ "IDS_MOGO_NOW_PLAYING": "Now playing",
+ "IDS_MOGO_NOW_PLAYING_XBOXMUSIC": "Now playing on Xbox Music",
+ "IDS_MOGO_NOW_PLAYING_XBOXVIDEO": "Now playing on Xbox Video",
+ "IDS_MOGO_RESUME": "Resume",
+ "IDS_MOGO_XBOX_MUSIC_XENON": "{0} Xbox Music",
+ "IDS_MOGO_XBOX_VIDEO_XENON": "{0} Xbox Video",
+ "IDS_MUSIC_ALBUMS_PIVOT": "albums",
+ "IDS_MUSIC_ALBUMS_PIVOT_TC": "Albums",
+ "IDS_MUSIC_APP_TITLE": "music",
+ "IDS_MUSIC_APP_TITLE_TC": "Music",
+ "IDS_MUSIC_ARTISTS_PIVOT": "artists",
+ "IDS_MUSIC_ARTISTS_PIVOT_TC": "Artists",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY": "Music automatically pulls in songs from your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library to your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX": "Xbox Music automatically pulls in music from your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library to your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK": "Tap for more info.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE": "Add music to your Windows music library.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY": "Learn how to fix it",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY": "We think we can help. Tap to learn more.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE": "It looks like a lot of your music isn't showing up right.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY": "Choose where we look",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE": "We're adding music from this PC.",
+ "IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} album added to your music][[*]{0} albums added to your music]",
+ "IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} artist added to your music][[*]{0} artists added to your music]",
+ "IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE": "You have nothing in the cloud just yet.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1": "Listen to millions of songs for free.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2": "Enjoy your music on all your PCs.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE": "Free",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC": "These are songs you own that aren't available in the cloud. To make them available, tap Add To and choose Cloud Collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE": "No icon",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC": "You can play these songs whether you're online or offline. This icon appears beside anything that's available in the cloud and anything you've downloaded using Xbox Music Pass.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE": "Available here and in the cloud",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC": "You can play these songs whenever you're online and signed in. While playing songs from Xbox Music, you'll see or hear occasional ads. To avoid interruptions, sign up for Xbox Music Pass and enjoy unlimited listening to millions of songs.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE": "Streaming only",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT": "You'll see the following icons on songs and albums in your music collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE": "Icons in your music collection",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_DESC": "Tap to learn about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_TITLE": "Tell me about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_BODY": "Your music in the cloud will automatically appear on your other Windows 8/Windows RT devices.\n\nWith Xbox Music Pass, you'll also see your cloud music on your phone and Xbox 360.",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK": "Learn more about Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE": "Music in the cloud",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY": "If you're not seeing all your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE": "All done! We've added the music from this PC.",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1": "Added your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1": "Adding your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG": "{0} song",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS": "{0} songs",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing your PC's Music library.",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE": "We didn't find any music on this PC.",
+ "IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY": "Learn more about how it works",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY": "Tap to learn more.",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE": "Your collection now includes music you've added from Xbox Music.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1": "Enjoy your pass on your mobile devices.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2": "Enjoy ad-free listening.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3": "Download songs to listen to later",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE": "Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} song added to your music][[*]{0} songs added to your music]",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2": "Also available on other devices",
+ "IDS_MUSIC_COLLECTION_EMPTY_DESC": "Find new tunes and old favorites.",
+ "IDS_MUSIC_COLLECTION_EMPTY_TITLE": "No music in your collection",
+ "IDS_MUSIC_COLLECTION_PIVOT": "my music",
+ "IDS_MUSIC_COLLECTION_PIVOT_TC": "My Music",
+ "IDS_MUSIC_DEVICES_PIVOT": "devices",
+ "IDS_MUSIC_DEVICES_PIVOT_TC": "Devices",
+ "IDS_MUSIC_EXPLORE_PIVOT": "explore",
+ "IDS_MUSIC_EXPLORE_PIVOT_TC": "Explore",
+ "IDS_MUSIC_FEATURED_PIVOT": "featured",
+ "IDS_MUSIC_GENRES_PIVOT": "genres",
+ "IDS_MUSIC_LOCATION_DMZ": "Temporary Cache",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_DESC": "Try a different genre or filter.",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_TITLE": "There's nothing to show here",
+ "IDS_MUSIC_MARKETPLACE_PIVOT": "all music",
+ "IDS_MUSIC_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_MUSIC_PIVOT": "music",
+ "IDS_MUSIC_RADIO_PIVOT": "radio",
+ "IDS_MUSIC_RADIO_PIVOT_TC": "Radio",
+ "IDS_MUSIC_SONGS_PIVOT_TC": "Songs",
+ "IDS_MUSIC_STORE_PIVOT": "store",
+ "IDS_MUSIC_STORE_PIVOT_TC": "Store",
+ "IDS_MUSIC_TOP_ALBUMS_PIVOT": "top",
+ "IDS_MUSIC_VIEW_PLAYLIST": "Show song list",
+ "IDS_MY_MUSIC_BUTTON_DESC": "My music",
+ "IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE": "My Music",
+ "IDS_N_FILTER_IN": "{0} {1}",
+ "IDS_N_SORTED_BY": "{0} {1} arranged by",
+ "IDS_NAV_PANE_HIDE_MENU": "Hide menu",
+ "IDS_NAV_PANE_SHOW_MENU": "Show menu",
+ "IDS_NETWORK_STATUS_HEADER": "Network status",
+ "IDS_NETWORK_STATUS_LOCAL_ONLY": "Now local only",
+ "IDS_NETWORK_STATUS_NONE": "Offline",
+ "IDS_NETWORK_STATUS_OVER_THE_LIMIT": "Over data limit",
+ "IDS_NETWORK_STATUS_ROAMING": "Roaming",
+ "IDS_NETWORK_STATUS_THROTTLED": "Limited network",
+ "IDS_NETWORK_STATUS_UNRESTRICTED": "Now unrestricted",
+ "IDS_NEXT_BUTTON": "Next",
+ "IDS_NO_BUTTON": "No",
+ "IDS_NOT_AVAILABLE_OFFLINE": "Not available offline",
+ "IDS_NOW_PLAYING_DETAILS_BUTTON": "Details",
+ "IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION": "Add this album to my music",
+ "IDS_NOW_PLAYING_OP_ADD_SONG_ACTION": "Add this song to my music",
+ "IDS_NOW_PLAYING_OP_BIO_ACTION": "Check out the bio",
+ "IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION": "See other albums from this artist",
+ "IDS_NOW_PLAYING_OP_RADIO_ACTION": "Start radio",
+ "IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION": "Save this as a playlist",
+ "IDS_NOW_PLAYING_OP_SHARE_ACTION": "Share with a friend",
+ "IDS_NOW_PLAYING_OP_SMARTDJ_ACTION": "Play Smart DJ",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION": "Play top songs",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION": "Play top songs for this related artist",
+ "IDS_NOW_PLAYING_PANEL_TITLE_LC": "now playing",
+ "IDS_NOW_PLAYING_PLAYLIST_BUTTON": "Now playing",
+ "IDS_NOW_PLAYING_REMOVE_TRACK_ACTION": "Remove from list",
+ "IDS_NUMBER_SYMBOL": "#",
+ "IDS_OK_BUTTON": "OK",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE": "Next Page",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE": "Previous Page",
+ "IDS_PIN_TO_START_LINK_ERROR_TEXT": "Sorry, we can't find that. It might have been moved or deleted.",
+ "IDS_PIN_TO_START_SCREEN_BUTTON": "Pin to start",
+ "IDS_PLAY_ALL": "Play all",
+ "IDS_PLAY_ALL_DESC": "Shuffle all music",
+ "IDS_PLAY_ALL_LABEL": "Play all music",
+ "IDS_PLAY_ALL_SHUFFLED": "Play all shuffled",
+ "IDS_PLAY_BUTTON": "Play",
+ "IDS_PLAY_BUTTON_VIDEO": "Play",
+ "IDS_PLAYBACK_DURATION_PROGRESS": "{0}/{1}",
+ "IDS_PLAYBACK_ERROR_MESSAGE_TITLE": "Can't play.",
+ "IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE": "This song isn't available when you're offline. To play it, connect to the Internet.",
+ "IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE": "Try a different playlist.",
+ "IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED": "To play this song, you need to sign in.",
+ "IDS_PLAYLIST_BUTTON_DESC": "Playlists",
+ "IDS_PREVIEW_APP_SUBTITLE": "preview",
+ "IDS_PROGRESS_NAR": "{0} of {1}",
+ "IDS_PROVISIONING_ACCEPT_BUTTON": "I Accept",
+ "IDS_PROVISIONING_ACCEPTANCE_DESC": "Clicking \"I Accept\" means you have read and agree to the following:",
+ "IDS_PROVISIONING_ALREADY_HAVE_BUTTON": "Already have an Xbox profile?",
+ "IDS_PROVISIONING_ALREADY_HAVE_DESC": "Choose Cancel and sign in with your other Microsoft account.",
+ "IDS_PROVISIONING_CANCEL_BUTTON": "Cancel",
+ "IDS_PROVISIONING_CHILD_LIST_COMEBACK": "{0}. Come back here",
+ "IDS_PROVISIONING_CHILD_LIST_SIGNIN": "{0}. Click here to sign in",
+ "IDS_PROVISIONING_CHILD_LIST_TITLE": "Do the following:",
+ "IDS_PROVISIONING_CHILD_LIST_XBOX_LINK": "{0}. Make your profile at Xbox.com",
+ "IDS_PROVISIONING_CHILD_SUBTITLE": "To make your profile, please go to Xbox.com. You'll need a parent to approve it.",
+ "IDS_PROVISIONING_CHILD_TITLE": "Parent Needed",
+ "IDS_PROVISIONING_EXPLANATION": "Adding an online Xbox membership to your Microsoft account lets you participate in great Xbox gaming and entertainment.",
+ "IDS_PROVISIONING_PRIVACY_LINK": "Privacy Statement",
+ "IDS_PROVISIONING_TITLE": "To continue, create an Xbox profile",
+ "IDS_PROVISIONING_TOS_LINK": "Xbox Terms of Use",
+ "IDS_PROVISIONING_USER_EMAIL": "Your login: {0}",
+ "IDS_PURCHASE_ERROR_CAPTION": "There's a problem.",
+ "IDS_PURCHASE_ERROR_MESSAGE": "Sorry, we can't complete your purchase right now.",
+ "IDS_PURCHASE_ERROR_MESSAGE_TITLE": "Try again later",
+ "IDS_RADIO_ERROR_CAPTION": "Radio",
+ "IDS_READ_LESS": "Read less",
+ "IDS_READ_MORE": "Read more",
+ "IDS_RECENT_LAST_WEEK": "last week",
+ "IDS_RECENT_THIS_MONTH": "this month",
+ "IDS_RECENT_THIS_WEEK": "this week",
+ "IDS_REMOVE_BUTTON": "Remove",
+ "IDS_RENT_BUTTON": "Rent",
+ "IDS_RESTART_BUTTON": "Restart",
+ "IDS_RESUME_BUTTON": "Resume",
+ "IDS_SAVE_BUTTON": "Save",
+ "IDS_SEARCH_ALBUMLOCAL_LABEL": "Album \nCollection \n({0})",
+ "IDS_SEARCH_ALBUMMARKETPLACE_LABEL": "Music Store: \nAlbums \n({0})",
+ "IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL": "Albums ({0})",
+ "IDS_SEARCH_ALBUMS_PIVOT_LABEL": "albums ({0})",
+ "IDS_SEARCH_ALBUMS_RESULT_TITLE": "Album results for \"{0}\"",
+ "IDS_SEARCH_ALL_PIVOT_LABEL": "all results ({0})",
+ "IDS_SEARCH_ARTISTLOCAL_LABEL": "Artist \nCollection \n({0})",
+ "IDS_SEARCH_ARTISTMARKETPLACE_LABEL": "Music Store: \nArtists \n({0})",
+ "IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL": "Artists ({0})",
+ "IDS_SEARCH_ARTISTS_PIVOT_LABEL": "artists ({0})",
+ "IDS_SEARCH_ARTISTS_RESULT_TITLE": "Artist results for \"{0}\"",
+ "IDS_SEARCH_BUTTON": "Search",
+ "IDS_SEARCH_FILTER_ALL": "all results",
+ "IDS_SEARCH_FILTER_COLLECTION": "My videos",
+ "IDS_SEARCH_FILTER_MARKETPLACE": "all music",
+ "IDS_SEARCH_FILTER_MARKETPLACE_VIDEO": "Xbox Video Store",
+ "IDS_SEARCH_HCR_WITH_KEYWORD_NAR": "Best match for {0}",
+ "IDS_SEARCH_INMYVIDEOS_LABEL": "in my videos",
+ "IDS_SEARCH_MODIFIER_PIVOT_LABEL": "All",
+ "IDS_SEARCH_MOVIELOCAL_LABEL": "My \nMovies \n({0})",
+ "IDS_SEARCH_MOVIEMARKETPLACE_LABEL": "Video Store: \nMovies \n({0})",
+ "IDS_SEARCH_MUSICHUB_TITLE": "music ({0})",
+ "IDS_SEARCH_NORESULT_TITLE": "no results for \"{0}\"",
+ "IDS_SEARCH_NORESULT_TITLE_TC": "No Results for \"{0}\"",
+ "IDS_SEARCH_NOTSIGNEDIN": "Sign in to see full results.",
+ "IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL": "My \nvideos \n({0})",
+ "IDS_SEARCH_PIVOT": "search",
+ "IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL": "Playlists ({0})",
+ "IDS_SEARCH_PLAYLISTS_PIVOT_LABEL": "playlists ({0})",
+ "IDS_SEARCH_RESULT_TITLE": "results for \"{0}\"",
+ "IDS_SEARCH_RESULT_TITLE_TC": "Results for \"{0}\"",
+ "IDS_SEARCH_SEARCHSTARTED": "searching...",
+ "IDS_SEARCH_SONGLOCAL_LABEL": "My \nSongs \n({0})",
+ "IDS_SEARCH_SONGMARKETPLACE_LABEL": "Music Store: \nSongs \n({0})",
+ "IDS_SEARCH_SONGS_GROUP_HEADER_LABEL": "Songs ({0})",
+ "IDS_SEARCH_SONGS_PIVOT_LABEL": "songs ({0})",
+ "IDS_SEARCH_TRACKS_RESULT_TITLE": "Song results for \"{0}\"",
+ "IDS_SEARCH_TVSERIESLOCAL_LABEL": "My \nTV Shows \n({0})",
+ "IDS_SEARCH_TVSERIESMARKETPLACE_LABEL": "Video Store: \nTV Shows \n({0})",
+ "IDS_SEARCH_VIDEOHUB_TITLE": "videos ({0})",
+ "IDS_SEE_ALL_BUTTON": "Show all",
+ "IDS_SEE_LESS_BUTTON": "Show less",
+ "IDS_SEE_MORE_BUTTON": "Show more",
+ "IDS_SERVICE_UNAVAILABLE_CAPTION": "Sorry, the Xbox service isn't available right now.",
+ "IDS_SET_BUTTON": "Set",
+ "IDS_SETTINGS_ABOUT_ABOUT_ADS": "About our ads",
+ "IDS_SETTINGS_ABOUT_CODE_CONDUCT": "Code of Conduct",
+ "IDS_SETTINGS_ABOUT_DESCRIPTION": "This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.",
+ "IDS_SETTINGS_ABOUT_LEARN_MORE": "Learn more at Xbox.com",
+ "IDS_SETTINGS_ABOUT_ONLINE_CONTENT": "Online content",
+ "IDS_SETTINGS_ABOUT_PRERELEASE_VERSION": "Version: {0} ({1}, {2}{3})",
+ "IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT": "Privacy statement",
+ "IDS_SETTINGS_ABOUT_SUPPORT": "Support",
+ "IDS_SETTINGS_ABOUT_TITLE": "About",
+ "IDS_SETTINGS_ABOUT_TOS": "Terms of Service",
+ "IDS_SETTINGS_ABOUT_VERSION_FORMAT": "{0}.{1}.{2}.{3}",
+ "IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC": "Billing History",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC": "Billing Contact Information",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC": "Contact Preferences",
+ "IDS_SETTINGS_ACCOUNT_CURRENT_USER": "You're signed in as {0}",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC": "Manage Xbox Music Devices",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC": "Manage Payment Options",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC": "Get Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL": "Trial 14 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH": "Free 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH": "Free 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH": "Free 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC": "Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH": "1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH": "Prepaid 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH": "Prepaid 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH": "Prepaid 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL": "Trial 30 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH": "12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC": "Privacy and Online Settings",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC": "Enter a code to get a Gold Membership, Xbox Music Pass, or other stuff (where available).",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC": "Redeem Code",
+ "IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC": "Sign Out",
+ "IDS_SETTINGS_ACCOUNT_TITLE": "Account",
+ "IDS_SETTINGS_ACCOUNT_TITLE_TC": "My Account",
+ "IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC": "Your Account",
+ "IDS_SETTINGS_CAPTIONS_AUTO_MUTED": "Show captions when sound is muted",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR": "Caption background color",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY": "Background transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR": "Character color",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY": "Character transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE": "Character size",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLACK": "black",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLUE": "blue",
+ "IDS_SETTINGS_CAPTIONS_COLOR_CYAN": "cyan",
+ "IDS_SETTINGS_CAPTIONS_COLOR_GREEN": "green",
+ "IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA": "magenta",
+ "IDS_SETTINGS_CAPTIONS_COLOR_RED": "red",
+ "IDS_SETTINGS_CAPTIONS_COLOR_WHITE": "white",
+ "IDS_SETTINGS_CAPTIONS_COLOR_YELLOW": "yellow",
+ "IDS_SETTINGS_CAPTIONS_DEFAULT": "default",
+ "IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE": "Character edge style",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED": "depressed",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DROP": "dropshadow",
+ "IDS_SETTINGS_CAPTIONS_EDGE_NONE": "none",
+ "IDS_SETTINGS_CAPTIONS_EDGE_RAISED": "raised",
+ "IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED": "uniform",
+ "IDS_SETTINGS_CAPTIONS_FONT_CASUAL": "casual",
+ "IDS_SETTINGS_CAPTIONS_FONT_CURSIVE": "cursive",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS": "monospaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF": "monospaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS": "proportionally spaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF": "proportionally spaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS": "small capitals",
+ "IDS_SETTINGS_CAPTIONS_FONT_STYLE": "Font style",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE": "solid",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT": "semitransparent",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT": "transparent",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW": "Preview",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE": "Caption preview",
+ "IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT": "Reset to default",
+ "IDS_SETTINGS_CAPTIONS_SIZE_100": "100% (default)",
+ "IDS_SETTINGS_CAPTIONS_SIZE_150": "150%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_200": "200%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_50": "50%",
+ "IDS_SETTINGS_CAPTIONS_TITLE": "Captions",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_COLOR": "Window color",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY": "Window transparency",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE": "Automatically download songs here after you add or buy them on other devices",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE": "Automatically download songs here after you buy them on other devices",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC": "Buying music",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS": "Tell us about your experience including relevant album, song, and artist names. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO": "Buying or renting a video",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS": "Tell us about your experience, including relevant series name, season number, episode name, and movie title. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_CANCEL": "Cancel",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN": "Can't sign in",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS": "Tell us about your experience. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW": "Viewing my collection",
+ "IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION": "Comments",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED": "Connected device",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS": "Tell us about your experience, including the type of device you're using.",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT": "Problem with store info (wrong art, wrong name, etc.)",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK": "Media playback",
+ "IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY": "Discovering content",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION": "Thanks for your feedback! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG": "Thanks for your feedback, {0}! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC": "Downloading music",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO": "Downloading a video",
+ "IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY": "Auto-playing next episode",
+ "IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS": "Tell us about what you were doing when you noticed the error.",
+ "IDS_SETTINGS_FEEDBACK_GENERALERRORS": "General error",
+ "IDS_SETTINGS_FEEDBACK_GHOSTTEXT": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_GREATAPP": "Great app",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT": "Music format",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS": "Tell us about your experience, including the formats or file types you're wanting to use.",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA": "Music metadata",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS": "Give us your feedback, including relevant album, artist names and a description of the problem encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_NOCONNECTION": "Connect to the Internet to submit your feedback.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE": "Problem in the app (error, confusing behavior, etc.)",
+ "IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE": "Problem with the way something plays or appears in the app",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION": "Choose a category for your feedback and enter your comments below.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE": "Dislike",
+ "IDS_SETTINGS_FEEDBACK_OPTION_LIKE": "Like",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC": "Playing music",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS": "Tell us about your experience, including whether you were playing your own music or songs from Xbox.",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO": "Playing a video",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS": "Tell us about your experience, including whether you were playing your own video or something from Xbox Video.",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS": "Please provide artist, album and/or track name and describe the issue encountered.",
+ "IDS_SETTINGS_FEEDBACK_REQUESTCONTENT": "Request content",
+ "IDS_SETTINGS_FEEDBACK_SAS_TEXT": "Want to report an issue?",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC": "Music streaming",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS": "Tell us about your experience including relevant album, song, artist names, and if you're using a subscription. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO": "Streaming a video",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS": "Tell us about your experience. Please include relevant series name, season number, episode name, movie title, and if you were attempting to download or stream the video. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUBMIT": "Submit",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION": "Suggestion",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS": "Tell us about changes you'd like to see. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS": "Got Ideas?",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC": "Go to the Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO": "Go to the Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC": "Go to the Xbox Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO": "Go to the Xbox Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SYNC": "Sync/cloud",
+ "IDS_SETTINGS_FEEDBACK_TITLE": "Feedback",
+ "IDS_SETTINGS_FEEDBACK_TRAILER": "Watching a trailer",
+ "IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS": "Tell us about your experience, including any relevant titles. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO": "Go to XboxVideoUserVoice.com and tell us what we should add.",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT": "Video format",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS": "Tell us about your experience, including the formats or file types you're wanting to use.",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC": "Wrong music info",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS": "Give us your feedback including relevant album, song, artist names and a description of the problem encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_WRONGVIDEO": "Wrong video info",
+ "IDS_SETTINGS_FORGET_ME": "Remove",
+ "IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE": "{0}%",
+ "IDS_SETTINGS_HELP_TITLE": "Help",
+ "IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_SUBTITLE": "The songs you've put on OneDrive will become the master version. This won't affect songs that aren't duplicates.",
+ "IDS_SETTINGS_ONEDRIVE_DEDUP_SETTING_TITLE": "Automatically clean up duplicate tracks",
+ "IDS_SETTINGS_ONEDRIVE_TITLE": "OneDrive",
+ "IDS_SETTINGS_PREFERENCE_ACCOUNT": "Switch users",
+ "IDS_SETTINGS_PREFERENCE_TITLE": "Preferences",
+ "IDS_SETTINGS_PROMPT_TOGGLE_TITLE": "Ask me to sign in before completing purchases or managing my account",
+ "IDS_SETTINGS_RESET_CLOUD_SUBTITLE": "Delete your playlists, and any music you've added or downloaded from the Music catalog",
+ "IDS_SETTINGS_RESET_CLOUD_TITLE": "Reset",
+ "IDS_SETTINGS_SWITCH_USER": "Switch users",
+ "IDS_SETTINGS_SWITCH_USER_DESCRIPTION": "This app is designed for use by one person at a time. To switch users, select Remove. This will sign you out of the app and reset all app settings. Signing out will not delete any music or videos.",
+ "IDS_SETTINGS_TITLE": "Settings",
+ "IDS_SHARE_EMPTY_MESSAGE_ALBUM": "Sorry, that album can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_ARTIST": "Sorry, that artist can't be shared because they're not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MOVIE": "Sorry, that movie can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MUSIC": "To share something, select an artist, album, or song.",
+ "IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO": "Sorry, that video can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TRACK": "Sorry, that song can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE": "Sorry, that episode can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SEASON": "Sorry, that season can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SERIES": "Sorry, that series can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_VIDEO": "First, choose a movie or TV show to share.",
+ "IDS_SHARE_FILES_MUSIC_DESCRIPTION": "Files from the Music app",
+ "IDS_SHARE_FRIEND_REQUEST": "{0} wants to be friends!",
+ "IDS_SHARE_FRIEND_REQUEST_LINK": "Add them on {0}Xbox.com{1}",
+ "IDS_SHARE_GAME_TEXT": "Check out {0}",
+ "IDS_SHARE_LEADER_BOARD_TEXT": "In {0}, {1} ranks {2} among their friends",
+ "IDS_SHARE_MORE_MICROSOFT_DOT_COM": "See more at {0}Microsoft.com{1}",
+ "IDS_SHARE_MORE_XBOX_DOT_COM": "See more at {0}Xbox.com{1}",
+ "IDS_SHARE_MORE_XBOXVIDEO_DOT_COM": "See more at {0}XboxVideo.com{1}",
+ "IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_SHARE_MUSIC_CONCATENATION": "{0} {1}",
+ "IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL": "[[1]{0} playlist][[*]{0} playlists]",
+ "IDS_SHARE_MUSIC_SONG_COUNT_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_SHARE_PROFILE": "Share profile",
+ "IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT": "{0} unlocked the {1} achievement in {2}",
+ "IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT": "{0} hasn't unlocked the {1} achievement in {2}",
+ "IDS_SHARE_TELL_FRIEND_ADD": "Tell your friends to add you",
+ "IDS_SHOW_ALL_MODIFIER": "show all",
+ "IDS_SHOW_FEATURED_MODIFIER": "show featured",
+ "IDS_SIGNIN_COMPLETE": "Signed in",
+ "IDS_SIGNIN_ERROR": "Can't sign in",
+ "IDS_SIGNIN_ERROR_CAPTION": "Sign in",
+ "IDS_SIGNIN_ERROR_MORE_INFO": "More info",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_DESC": "You can still use this app, but the app needs to restart. Click close to restart the app.",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_TITLE": "The region for your Xbox profile is different from your Windows region.",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT": "Click here to sign in",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE": "Sign In",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT": "Get the most from your apps",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE": "Sign up with Xbox",
+ "IDS_SIGNIN_PROGRESS": "Signing in",
+ "IDS_SIGNIN_RETRY": "Try again",
+ "IDS_SMARTDJ_ERROR_CAPTION": "Smart DJ",
+ "IDS_SNAPPED_DETAILS_OVERVIEW_TITLE": "overview",
+ "IDS_SNAPPED_DETAILS_PLAYLIST_TITLE": "playlist",
+ "IDS_SNAPPED_DETAILS_POSTROLL_TITLE": "what's next",
+ "IDS_SNAPPED_DETAILS_RECOMMEND_LABEL": "recommended",
+ "IDS_SNAPPED_DETAILS_REPLAY_LABEL": "Play Again",
+ "IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL": "Shuffle",
+ "IDS_SNAPPED_GO_FULLSCREEN_MESSAGE": "To start something, go full screen.",
+ "IDS_SNAPPED_MUSIC_HEADER": "Start listening",
+ "IDS_SNAPPED_MUSIC_UNSNAP_TEXT": "Find something to play",
+ "IDS_SNAPPED_VIDEO_UNSNAP_TEXT": "Find something to watch",
+ "IDS_SOCIAL_PIVOT": "social",
+ "IDS_SORT_FILTER_CONTROL_ACC_FILTER": "Filter",
+ "IDS_SORT_FILTER_CONTROL_ACC_SORT": "Sort",
+ "IDS_SORTED_BY": "{0} by",
+ "IDS_SWIPE_HORIZONTALLY_TO_SELECT": "Swipe left to select",
+ "IDS_SWIPE_VERTICALLY_TO_SELECT": "Swipe down to select",
+ "IDS_TIME_ARIA_ZERO": "0:0",
+ "IDS_TIME_DISPLAY_ZERO": "0:00",
+ "IDS_TOS_ACCEPT_BUTTON": "I Accept",
+ "IDS_TOS_ACCEPT_CHECKBOX": "I accept the Xbox Live Terms of Use agreement",
+ "IDS_TOS_ACCEPT_ERROR": "You must accept the Terms of Use to proceed.",
+ "IDS_TOS_CANCEL": "Cancel",
+ "IDS_TOS_TEXT_HEADER": "Please review and accept",
+ "IDS_TOS_TITLE": "Attention",
+ "IDS_TOS_UPDATE_DESC": "The Xbox Terms of Use have recently been updated. Please review and accept the new Terms of User agreement before you sign in.",
+ "IDS_TOS_UPDATE_HEADER": "Updated Terms of Use",
+ "IDS_TOUCHPAD_SUBTITLE1": "press and slide",
+ "IDS_TOUCHPAD_SUBTITLE2": "tap to select",
+ "IDS_TOUCHPAD_TITLE": "select",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL": "Closed captioning",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE": "Not available",
+ "IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON": "No speakers or headphones.",
+ "IDS_TRANSPORT_CONTROLS_MUTE_LABEL": "Mute",
+ "IDS_TRANSPORT_CONTROLS_NEXT_BUTTON": "Next",
+ "IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON": "Pause",
+ "IDS_TRANSPORT_CONTROLS_PLAY_BUTTON": "Play",
+ "IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON": "Play here",
+ "IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON": "Play on Xbox",
+ "IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON": "Playback options",
+ "IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON": "Previous",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON": "Repeat",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON": "Repeat: off",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON": "Repeat: on",
+ "IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON": "Resume on Xbox",
+ "IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL": "Progress bar",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON": "Shuffle",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON": "Shuffle: off",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON": "Shuffle: on",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON": "Turn repeat off",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON": "Turn repeat on",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON": "Turn shuffle off",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON": "Turn shuffle on",
+ "IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL": "Unmute",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON": "Volume \n{0}",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON": "Muted",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL": "Volume",
+ "IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON": "Remote",
+ "IDS_TV_SEASON_NAME": "Season {0}",
+ "IDS_TV_SEASON_NAME_LC": "season {0}",
+ "IDS_UNKNOWN_VALUE": "unknown",
+ "IDS_UNPIN_FROM_START_SCREEN_BUTTON": "Unpin from start",
+ "IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION": "Click to get Windows 8.1",
+ "IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT": "To use Xbox services, get the latest version of the app.",
+ "IDS_VERSION_CHECK_SERVICE_TITLE": "Update available",
+ "IDS_VERSION_CHECK_SIGNIN_TEXT": "Get the latest version of the app.",
+ "IDS_VERSION_CHECK_UPGRADE_CAPTION": "Your app needs an update.",
+ "IDS_VERSION_CHECK_UPGRADE_LINK": "Get the update",
+ "IDS_VERSION_CHECK_UPGRADE_TEXT": "To keep using this app, get the latest version at the Windows Store.",
+ "IDS_VIDEO_APP_TITLE": "video",
+ "IDS_VIDEO_COLLECTION_EMPTY": "Videos you purchase from Xbox Video will appear here.",
+ "IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK": "Xbox Video home",
+ "IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK": "Search",
+ "IDS_VIDEO_FEATURED_PIVOT": "featured",
+ "IDS_VIDEO_GENRES_PIVOT": "genres",
+ "IDS_VIDEO_NETWORKS_PIVOT": "networks",
+ "IDS_VIDEO_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_VIDEO_PIVOT": "videos",
+ "IDS_VIDEO_STUDIOS_PIVOT": "studios",
+ "IDS_VIDEO_TOP_SELLING_PIVOT": "top selling",
+ "IDS_VIDEO_TV_FREE_EPISODES_PIVOT": "free tv",
+ "IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT": "last night's shows",
+ "IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK": "Movies store",
+ "IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK": "My videos",
+ "IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK": "TV store",
+ "IDS_VIEW_ALL": "Show all",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT": "Next",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION": "Do you want us to ask for your password every time you make a purchase? You can change this preference later in Settings, Preferences.",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE": "Password prompt for purchase?",
+ "IDS_WEBHOST_RESIZE_WINDOW_BODY": "Make your window larger or rotate your device.",
+ "IDS_WEBHOST_RESIZE_WINDOW_TITLE": "Your screen needs to be wider",
+ "IDS_WEBHOST_ROTATE_BODY": "To use this feature, change your screen orientation by turning your device.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_BODY": "To work right, this feature needs more of your screen. Increase the size of the app window or rotate your device to continue.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY": "Increase the size of the app window (turning your device if needed).",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE": "The app needs more width on your screen to continue",
+ "IDS_WEBHOST_ROTATE_TITLE": "Please rotate your device",
+ "IDS_WHATSNEW_NOTIFICATION_SUBTITLE": "Click to see what's better",
+ "IDS_WHATSNEW_POPUP_LINK": "Read the full release notes",
+ "IDS_XBOX_GET_FOR_XBOX": "Get for Xbox 360",
+ "IDS_XBOX_MUSIC_APP_TITLE": "xbox music",
+ "IDS_XBOX_PLAY_TO_DEVICE": "Play To",
+ "IDS_XBOX_VIDEO_APP_TITLE": "xbox video",
+ "IDS_YES_BUTTON": "Yes",
+ "IDS_COLLECTION_CLOUDV2_BANNER1_ACTION": "Get started",
+ "IDS_COLLECTION_CLOUDV2_BANNER1_ACTION2": "Enroll now",
+ "IDS_COLLECTION_CLOUDV2_BANNER1_TITLE": "Play your music wherever you go. Just add songs to your Music folder on OneDrive.",
+ "IDS_COLLECTION_CLOUDV2_BANNER2_ACTION": "Filter to show only my music on OneDrive",
+ "IDS_COLLECTION_CLOUDV2_BANNER2_TITLE": "Did you know... Songs you've put in your OneDrive Music folder show up here.",
+ "IDS_MUSIC_ACTION_TRY_FOR_FREE": "Try for free",
+ "IDS_MUSIC_ACTION_VIEW_UNPLAYABLE": "How to view unplayable content",
+ "IDS_MUSIC_ALBUM_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE": "Some songs in this album can't be played.",
+ "IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE": "This album is explicit and your Xbox Live account settings prevent you from playing it.",
+ "IDS_MUSIC_ALBUM_DETAILS_CHILD_EXPLICIT_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are explicit and your Xbox Live account settings prevent you from playing them.",
+ "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_BODY": "Download the album now",
+ "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_BANNER_NOTIFICATION_TITLE": "This album can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "IDS_MUSIC_ALBUM_DETAILS_DOWNLOAD_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album can't be streamed at the request of the copyright holder, but you can still download them to listen.",
+ "IDS_MUSIC_ALBUM_DETAILS_ITEM_EXPLICIT_BANNER_NOTIFICATION_TITLE": "This song contains explicit lyrics and is blocked by your Xbox Live account settings.",
+ "IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_BODY": "Tap the icons beside the songs to learn more.",
+ "IDS_MUSIC_ALBUM_DETAILS_MIXED_RIGHTS_BANNER_NOTIFICATION_TITLE": "Some songs in this album have play or purchase restrictions required by the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so this album can't be streamed.",
+ "IDS_MUSIC_ALBUM_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so some songs in this album can't be streamed.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_BODY": "Start your free trial",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_BANNER_NOTIFICATION_TITLE": "This album is available only with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are available only with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_BANNER_NOTIFICATION_TITLE": "This album is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PASS_PURCHASE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_BANNER_NOTIFICATION_TITLE": "This album hasn't been released yet. Check back soon!",
+ "IDS_MUSIC_ALBUM_DETAILS_PRE_RELEASE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album haven't been released yet. Check back soon!",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_BANNER_NOTIFICATION_TITLE": "This album is only available for purchase at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are only available for purchase at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_BODY": "Buy the album now",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_BANNER_NOTIFICATION_TITLE": "The songs in this album can only be purchased as part of the full album.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_BANNER_NOTIFICATION_TITLE": "This album can't be purchased at the request of the copyright holder, but you can still buy the songs individually.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "This album can't be purchased at the request of the copyright holder, but you can still buy some of the songs individually.",
+ "IDS_MUSIC_ALBUM_DETAILS_PURCHASE_SONGS_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album are only available when purchasing the full album.",
+ "IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_BANNER_NOTIFICATION_TITLE": "The songs in this album can't be downloaded for offline listening at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_STREAMING_ONLY_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album can't be downloaded for offline listening at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_BANNER_NOTIFICATION_TITLE": "This album isn't available through Xbox Music.",
+ "IDS_MUSIC_ALBUM_DETAILS_UNAVAILABLE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Some songs in this album aren't available through Xbox Music.",
+ "IDS_MUSIC_ALBUM_NOT_AVAILABLE_BANNER_FREE_USER": "To restore hidden albums to your collection, you'll need an Xbox Music Pass.",
+ "IDS_MUSIC_ARTIST_ALL_ALBUMS_TITLE": "{0} : Albums",
+ "IDS_MUSIC_ARTIST_DETAILS_COLLECTION_ALBUMS_TITLE": "In Collection",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_BODY": "It's easy to listen to your music everywhere. Tap here to get started.",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_OOBE_FLYOUT_TITLE": "Want your music on all your devices?",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_OFF_TOOLTIP": "Add music to Cloud",
+ "IDS_MUSIC_CLOUDMODE_BUTTON_TOGGLE_ON_TOOLTIP": "Return to Collection",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_FREE_FLYOUT_BODY": "This album contains free streaming music from Xbox Music.\n \nYou can stream this for free on any Windows 8 PC and on the web. An Xbox Music Pass is required to play this on your phone or on your Xbox console.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_ALBUM_PASS_FLYOUT_BODY": "This album contains music you've gotten with your Xbox Music Pass.\n \nIt already roams to all your devices, without you having to do anything.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_ACTION": "Try an Xbox Music Pass free for 30 days",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_FREE_FLYOUT_BODY": "This is free streaming music from Xbox Music.\n \nYou can stream this for free on any Windows 8 PC and on the web. An Xbox Music Pass is required to play this on your phone or on your Xbox console.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PASS_FLYOUT_BODY": "This is music you've gotten with your Xbox Music Pass.\n \nIt already roams to all your devices, without you having to do anything.",
+ "IDS_MUSIC_CLOUDMODE_CATALOG_MUSIC_PURCHASED_FLYOUT_BODY": "This song was purchased from Xbox Music.\n \nIt already roams to all your devices, without you having to do anything.",
+ "IDS_MUSIC_COLLECTION_BY_ALBUM_SORT": "By album",
+ "IDS_MUSIC_COLLECTION_BY_ALPHA_SORT": "By a to z",
+ "IDS_MUSIC_COLLECTION_BY_ALPHA_SORT_LC": "by a to z",
+ "IDS_MUSIC_COLLECTION_BY_ARTIST_SORT": "By artist",
+ "IDS_MUSIC_COLLECTION_BY_DATEADDED_SORT": "By date added",
+ "IDS_MUSIC_COLLECTION_BY_GENRE_SORT": "By genre",
+ "IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT": "By popularity",
+ "IDS_MUSIC_COLLECTION_BY_POPULARITY_SORT_LC": "by popularity",
+ "IDS_MUSIC_COLLECTION_BY_RELEASEYEAR_SORT": "By release year",
+ "IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_BODY": "Show just your offline music",
+ "IDS_MUSIC_COLLECTION_OFFLINE_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so some of your collection can't be streamed.",
+ "IDS_MUSIC_DETAILS_CLEAR_DOWNLOAD_ERROR_ACTION": "Clear download error",
+ "IDS_MUSIC_DETAILS_OFFLINE_BANNER_NOTIFICATION_BODY": "Connect to the Internet to listen.",
+ "IDS_MUSIC_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_BODY": "Show just the offline songs",
+ "IDS_MUSIC_DETAILS_RETRY_DOWNLOAD_ACTION": "Retry download",
+ "IDS_MUSIC_DEVICES_CATEGORY1_FREE": "Windows 8.1, music.xbox.com",
+ "IDS_MUSIC_DEVICES_CATEGORY2_FREE": "Xbox One, Xbox 360, Windows Phone, iOS®, Android™",
+ "IDS_MUSIC_DEVICES_EMPTY_ERROR_BODY": "Please try again later.",
+ "IDS_MUSIC_DEVICES_EMPTY_ERROR_HEADER": "Sorry, we're having trouble showing what's available on your devices.",
+ "IDS_MUSIC_DEVICES_EMPTY_MATCHING_BODY": "Music matching lets you listen to the music from this PC on other devices. Just match your music to what we have at Xbox Music. (If a song isn't found at Xbox Music, it's not matched.)",
+ "IDS_MUSIC_DEVICES_EMPTY_MATCHING_HEADER": "It looks like you haven't enabled music matching.",
+ "IDS_MUSIC_DEVICES_EMPTY_MATCHING_LINK": "Match my music",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_FREE": "Music shown here will appear when you sign in to Xbox Music on a device.",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_PASS": "Music shown here will appear when you sign in to Xbox Music on Windows 8.1, Xbox One, Xbox 360, music.xbox.com, Windows Phone, iOS® and Android™.",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE1_UNAUTH": "Sign in to Xbox Music to see what's available on all your devices.",
+ "IDS_MUSIC_DEVICES_SUBTITLE_LINE2_FREE": "Tap on a device category to see what music will be available there.",
+ "IDS_MUSIC_DEVICES_TITLE": "Music On Your Devices",
+ "IDS_MUSIC_DEVICES_UPSELL_HEADER": "Using Xbox Music on these devices requires an Xbox Music Pass.",
+ "IDS_MUSIC_DEVICES_UPSELL_LINK": "Try Xbox Music Pass free for 30 days",
+ "IDS_MUSIC_DEVICES_UPSELL_LINK_GENERIC": "Get an Xbox Music Pass",
+ "IDS_MUSIC_DEVICES_VIEW_ALBUM_LINK": "View album in collection",
+ "IDS_MUSIC_DEVICES_VIEW_ARTIST_LINK": "View artist in collection",
+ "IDS_MUSIC_DTO_BUY_ALBUM_TEXT": "Buy album for {0}",
+ "IDS_MUSIC_DTO_BUY_FREE_TEXT": "Get it free",
+ "IDS_MUSIC_DTO_BUY_TRACK_TEXT": "Buy song for {0}",
+ "IDS_MUSIC_DTO_CANT_BUY_TEXT": "Sorry, that isn't available for purchase from Xbox Music.",
+ "IDS_MUSIC_DTO_CONFIRM_FLYOUT_BODY": "We'll download it here in just a second. With your purchase you can also download on other devices.",
+ "IDS_MUSIC_DTO_CONFIRM_FLYOUT_TITLE": "Thanks for your purchase!",
+ "IDS_MUSIC_DTO_VIEW_ALBUM_TEXT": "View album in catalog",
+ "IDS_MUSIC_EDIT_METADATA_ALBUM_ACTION": "Edit info",
+ "IDS_MUSIC_EDIT_METADATA_ALBUM_DIALOG_TITLE": "Edit Album Info",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_CANCEL": "Cancel",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ACTION_SAVE": "Save",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_BUTTON": "Change art",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LABEL": "Album art",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_ALBUM_ART_LOAD_ERROR": "That image didn't work. Try another one.",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_ARTIST": "Album artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE": "Album genre",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_GENRE_CUSTOM": "Custom genre",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_ARTIST": "Album sort artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_SORT_TITLE": "Album sort title",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_ALBUM_TITLE": "Album title",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_DISC_NUMBER": "Disc",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_RELEASE_YEAR": "Year",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_ARTIST": "Song artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_GENRE": "Song genre",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_ARTIST": "Song sort artist",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_SONG_SORT_TITLE": "Song sort title",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_NUMBER": "Song",
+ "IDS_MUSIC_EDIT_METADATA_DIALOG_FIELD_TRACK_TITLE": "Song title",
+ "IDS_MUSIC_EDIT_METADATA_ERROR_DESCRIPTION": "Try something else. That text won't work.",
+ "IDS_MUSIC_EDIT_METADATA_ERROR_TITLE": "Can't Edit",
+ "IDS_MUSIC_EDIT_METADATA_MULTI_ERROR_MESSAGE": "Some entries won't work. See the highlighted boxes.",
+ "IDS_MUSIC_EDIT_METADATA_SINGLE_ERROR_MESSAGE": "Some entries won't work. See the highlighted box.",
+ "IDS_MUSIC_EDIT_METADATA_SONG_ACTION": "Edit info",
+ "IDS_MUSIC_EDIT_METADATA_SONG_DIALOG_TITLE": "Edit Song Info",
+ "IDS_MUSIC_EDIT_METADATA_TOGGLE_SORT_FIELDS": "Show sorts",
+ "IDS_MUSIC_ERROR_DETAILS": "Sorry, Xbox Music isn't available right now. Try it again soon.",
+ "IDS_MUSIC_ERROR_HEADER": "Sorry!",
+ "IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_BODY": "Edit your account settings",
+ "IDS_MUSIC_EXPLORE_CHILD_EXPLICIT_BANNER_NOTIFICATION_TITLE": "Your Xbox Live account doesn't allow you to play explicit content.",
+ "IDS_MUSIC_FEATURED_TITLE": "Featured Music",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_ACTION": "Got it",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_BODY": "Streaming and radio are now only available with an Xbox Music Pass. Music you own still works the same.",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_ACTION": "Check out what's free",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_BODY": "Choose your own holiday gifts from a choice set of albums. Keep them forever.",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_FREEBIES_TITLE": "Holiday Freebies",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_ACTION": "Try for free",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_BODY": "Unlimited streaming anywhere you take Xbox Music. Download songs to play offline. Try it free for 30 days*.",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_MUSIC_PASS_TITLE": "Try Xbox Music Pass for free",
+ "IDS_MUSIC_FREE_STREAM_CHANGED_TITLE": "Things have changed around here",
+ "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_ACTION": "Got it",
+ "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_BODY": "With free streaming gone from Xbox Music, to play some songs in your collection you need an Xbox Music Pass. We've hidden those songs for now, so you won't keep trying to play the unplayable.",
+ "IDS_MUSIC_FREE_STREAM_CLEAN_UP_COLLECTION_TITLE": "We're cleaning up your collection",
+ "IDS_MUSIC_FREEBIES_TITLE": "Holiday Freebies",
+ "IDS_MUSIC_HIDE_MENU": "Hide menu",
+ "IDS_MUSIC_MANAGE_FOLDERS_TITLE": "Build your collection from your local music files",
+ "IDS_MUSIC_MODULE_SHOW_ALL_GENRES": "View genres",
+ "IDS_MUSIC_MODULE_SHOW_ALL_LABEL": "View all {0}",
+ "IDS_MUSIC_MODULE_VIEW_ALL_ALBUMS": "View all albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_ARTISTS": "View all artists",
+ "IDS_MUSIC_MODULE_VIEW_ALL_LATEST_ALBUMS": "View all latest albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_NEW_ALBUMS": "View all new albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_SONGS": "View all songs",
+ "IDS_MUSIC_MODULE_VIEW_ALL_TOP_ALBUMS": "View all top albums",
+ "IDS_MUSIC_MODULE_VIEW_ALL_TOP_ARTISTS": "View all top artists",
+ "IDS_MUSIC_MODULE_VIEW_ALL_TOP_SONGS": "View all top songs",
+ "IDS_MUSIC_MODULE_VIEWALL": "View all",
+ "IDS_MUSIC_NEW_ALBUMS_TITLE": "New Albums",
+ "IDS_MUSIC_NOW_PLAYING_ARTIST_RADIO": "{0} Radio",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION": "Play from collection",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_COLLECTION_DESC": "Choose tunes from your existing stash.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE": "Explore the Xbox Music catalog",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_EXPLORE_DESC": "Check out new artists and popular tracks.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO": "Start a radio station",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_ACTION_RADIO_DESC": "Instantly make custom stations for your favorite performers.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_SUBTITLE": "Songs you play will show up here.",
+ "IDS_MUSIC_NOW_PLAYING_EMPTY_TITLE": "Nothing's on right now",
+ "IDS_MUSIC_NOW_PLAYING_ENTER_FULLSCREEN_ACTION": "Go full screen",
+ "IDS_MUSIC_NOW_PLAYING_EXIT_FULLSCREEN_ACTION": "Leave full screen",
+ "IDS_MUSIC_NOW_PLAYING_SC": "Now playing",
+ "IDS_MUSIC_NOW_PLAYING_UNHIDE_BUTTONS_NARRATOR": "Show hidden now playing buttons",
+ "IDS_MUSIC_OFFLINE_DETAILS": "Connect to the Internet, then we'll be able to show you more.",
+ "IDS_MUSIC_OFFLINE_HEADER": "Looks like you're offline",
+ "IDS_MUSIC_PIN_RADIO_TILE_NAME": "{0} radio",
+ "IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_BODY": "Tap the icons beside the songs to learn more.",
+ "IDS_MUSIC_PLAYLIST_DETAILS_CANT_PLAY_BANNER_NOTIFICATION_TITLE": "Some songs in this playlist can't be played on this device.",
+ "IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so this playlist can't be streamed.",
+ "IDS_MUSIC_PLAYLIST_DETAILS_OFFLINE_PARTIAL_BANNER_NOTIFICATION_TITLE": "Looks like you're offline, so some songs in this playlist can't be streamed.",
+ "IDS_MUSIC_RELEASE_NOTE_BUGS": "Minor fixes and improvements",
+ "IDS_MUSIC_SAVE_NOW_PLAYING_PLAYLIST": "Save as a playlist",
+ "IDS_MUSIC_SEARCH_ALBUM_RESULTS": "Albums",
+ "IDS_MUSIC_SEARCH_ARTIST_RESULTS": "Artists",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER": "Full catalog ({0})",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER_ACTION_PLURAL": "[[1]Tap to see {0} catalog result.][[*]Tap to see {0} catalog results.]",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER_MAX_RESULTS": "Full catalog ({0}+)",
+ "IDS_MUSIC_SEARCH_CATALOG_FILTER_NO_COUNT": "Full catalog",
+ "IDS_MUSIC_SEARCH_CATALOG_PLACEHOLDER": "Search catalog",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER": "In collection ({0})",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER_ACTION_PLURAL": "[[1]Tap to see {0} collection result.][[*]Tap to see {0} collection results.]",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER_MAX_RESULTS": "In collection ({0}+)",
+ "IDS_MUSIC_SEARCH_COLLECTION_FILTER_NO_COUNT": "In collection",
+ "IDS_MUSIC_SEARCH_COLLECTION_PLACEHOLDER": "Search collection",
+ "IDS_MUSIC_SEARCH_SONG_RESULTS": "Songs",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_HOURS_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1} at {2}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.][[*]You'll get {0} more hours of free music streaming on {1} at {2}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.]",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_NO_DATE": "Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.][[*]You'll get {0} more hours of free music streaming on {1}. Upgrade to Xbox Music Pass and listen as much as you want on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.]",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_REACHED": "You've reached your monthly streaming limit.",
+ "IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_TITLE": "Monthly streaming limit",
+ "IDS_MUSIC_SHARE_ALTERNATIVES_TEXT": "Some websites work better than others. Try one of these.",
+ "IDS_MUSIC_SHARE_CHARM_TEXT": "Create a playlist",
+ "IDS_MUSIC_SHARE_CREATE_PLAYLIST_LABEL": "Create playlist",
+ "IDS_MUSIC_SHARE_FEATURE_COMING_SOON": "This feature is coming soon!",
+ "IDS_MUSIC_SHARE_FEEDBACK": "Feedback",
+ "IDS_MUSIC_SHARE_FREE_USER_TITLE": "To create playlists from websites, get an Xbox Music Pass",
+ "IDS_MUSIC_SHARE_LOADING_CREATING_PLAYLIST": "Making a playlist.",
+ "IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC": "Looking for music.",
+ "IDS_MUSIC_SHARE_LOADING_FINDING_MUSIC_SUB": "This may take a little while...",
+ "IDS_MUSIC_SHARE_NO_ARTIST_FOUND": "Sorry, we didn't find anything.",
+ "IDS_MUSIC_SHARE_NO_ARTIST_FOUND_SUB": "We didn't find music on this page.",
+ "IDS_MUSIC_SHARE_PARTNERS_LABEL": "Powered by Echonest",
+ "IDS_MUSIC_SHARE_PREVIEW": "Preview",
+ "IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED": "Sorry, we can't create a playlist.",
+ "IDS_MUSIC_SHARE_REGION_NOT_SUPPORTED_SUB": "Sharing with Xbox Music isn’t supported in your region yet.",
+ "IDS_MUSIC_SHARE_REMOVE_ARTIST_LABEL": "Remove {0}",
+ "IDS_MUSIC_SHARE_REMOVE_TRACK_BY_ARTIST_LABEL": "Remove {0} by {1}",
+ "IDS_MUSIC_SHARE_SAS_FEEDBACK_COMMENTS": "Tell us about your experience.",
+ "IDS_MUSIC_SHARE_SAS_FEEDBACK_TYPE": "Creating a web playlist",
+ "IDS_MUSIC_SHARE_SAS_FEEDBACK_URL_NOTE": "We’ll send the website you’re using to create the web playlist with your feedback.",
+ "IDS_MUSIC_SHARE_SERVICE_DOWN": "Try again in a few minutes.",
+ "IDS_MUSIC_SHARE_SERVICE_DOWN_SUB": "We can’t look for music just now.",
+ "IDS_MUSIC_SHOW_MENU": "Show menu",
+ "IDS_MUSIC_SONG_CANT_PLAY_FLYOUT_BODY": "This song can't be played.",
+ "IDS_MUSIC_SONG_DOWNLOAD_ONLY_FLYOUT_BODY": "This song can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "IDS_MUSIC_SONG_NOT_AVAILABLE_BANNER_FREE_USER": "To restore hidden songs to your collection, you'll need an Xbox Music Pass.",
+ "IDS_MUSIC_SONG_PASS_ONLY_FLYOUT_BODY": "This song is available only with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_PASS_PURCHASE_FLYOUT_BODY": "This song is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_FLYOUT_BODY": "This song can't be played on this device.",
+ "IDS_MUSIC_SONG_PLAYLIST_CANT_PLAY_UNROAMED_FLYOUT_BODY": "This is a local song added from another device. It can't be played here.",
+ "IDS_MUSIC_SONG_PRE_RELEASE_FLYOUT_BODY": "This song hasn't been released yet. Check back soon!",
+ "IDS_MUSIC_SONG_PURCHASE_ALBUM_FLYOUT_BODY": "This song can only be purchased as part of the full album.",
+ "IDS_MUSIC_SONG_PURCHASE_ONLY_FLYOUT_BODY": "This song is only available for purchase at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_STREAMING_ONLY_FLYOUT_BODY": "This song can't be downloaded for offline listening at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_TAKEDOWN_FLYOUT_BODY": "This song has been removed from Xbox Music at the request of the copyright holder.",
+ "IDS_MUSIC_SONG_UNAVAILABLE_FLYOUT_BODY": "This song isn't available through Xbox Music.",
+ "IDS_MUSIC_STREAMING_AD_DESC_LINK": "Why am I getting this ad?",
+ "IDS_MUSIC_STREAMING_AD_LABEL": "Advertisement",
+ "IDS_MUSIC_STREAMING_ADD_TO_MY_MUSIC_TITLE": "Want to make this part of your collection?",
+ "IDS_MUSIC_STREAMING_CANT_PLAY_DESC": "Sorry, we can't play right now. Please try again soon.",
+ "IDS_MUSIC_STREAMING_CANT_PLAY_TITLE": "Can't Play",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_DESC": "We want to be sure you're still listening.\n \nWith an Xbox Music Pass, you'll avoid interruptions like this one. You'll also get unlimited access to the music you love.",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE1": "Are you still there?",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_NOTIFICATION_LINE2": "We haven't seen you in a while. Tap here to keep playing music.",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_PLAY_ACTION": "Keep playing",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_PREMIUM_ACITON": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_EMPTY_ROOM_TITLE": "Are you still there?",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_ACTION": "Sign in now",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_DESC": "To keep streaming music for free, sign in with your Xbox profile.",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_TITLE": "Sign in",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_ACTION": "Sign in now",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_DESC": "Xbox Music lets you stream some songs for free without signing in. You hit your limit. But don't worry, it's easy to keep the good times rolling. Just sign in with your Microsoft Account and you'll continue to have access to stream millions of songs for free. Don't have an account? It's easy and free to sign up.",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_TITLE": "Don't let the good times end",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE1": "Keep playing for free!",
+ "IDS_MUSIC_STREAMING_KEEP_PLAYING_NOTIFICATION_LINE2": "Sign in",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_HOURS_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1} at {2}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.][[*]You'll get {0} more hours of free music streaming on {1} at {2}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.]",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_NO_DATE": "Keep streaming! Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_DESC_PLURAL": "[[1]You'll get {0} more hour of free music streaming on {1}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.][[*]You'll get {0} more hours of free music streaming on {1}.\n \nWant to keep streaming? Upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.\n \nYou can still listen to music you already own.]",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE1": "Free music limit reached",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_NOTIFICATION_LINE2": "Learn more",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_PC_FILTER_LINK": "Filter to just the music on this PC.",
+ "IDS_MUSIC_STREAMING_MONTHLY_LIMIT_TITLE": "You've hit your monthly limit.",
+ "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE1": "Play for free",
+ "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2": "You have {0} more hours of free music streaming for this month.",
+ "IDS_MUSIC_STREAMING_MONTHLY_RESET_NOTIFICATION_LINE2_PLURAL": "[[1]You have {0} more hour of free music streaming for this month.][[*]You have {0} more hours of free music streaming for this month.]",
+ "IDS_MUSIC_STREAMING_NEXT_SONG_LABEL": "Up next",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_DESC": "Get unlimited access to the music you love with Xbox Music Pass.\nOr \nBuy the song or album from Xbox Music.",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_PREMIUM_ACTION": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_PURCHASE_ACTION": "Buy",
+ "IDS_MUSIC_STREAMING_NO_DOWNLOAD_TITLE": "To download, do one of the following.",
+ "IDS_MUSIC_STREAMING_PLAY_LIMIT_DESC": "This is a great time to upgrade! Xbox Music Pass gives you unlimited access to the music you love, with no interruptions. For a low monthly fee, you can use your music pass on your PC, Windows Phone, and Xbox 360.",
+ "IDS_MUSIC_STREAMING_PLAY_LIMIT_PREMIUM_ACTION": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_PLAY_LIMIT_TITLE": "Sorry, but you've maxed out your free plays for the month.",
+ "IDS_MUSIC_STREAMING_SIGN_IN_ACTION": "Sign in now",
+ "IDS_MUSIC_STREAMING_SIGN_IN_DESC": "All you need to do is sign up with Xbox or sign in with an existing Xbox profile. Don't worry, you don't need a credit card for signup.",
+ "IDS_MUSIC_STREAMING_SIGN_IN_TITLE": "Want to listen for free?",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY": "You can play any song {0} times for free.\n \nWant to play that song again? Buy the MP3 or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_BODY_NO_COUNT": "Want to play that song again? Buy the MP3 or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_BUY_ACTION": "Buy song",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY": "You can play any song {0} times for free.\n \nWant to play these songs again? Buy the MP3s or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_BODY_NO_COUNT": "Want to play these songs again? Buy the MP3s or upgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_MULTI_TITLE": "You've hit your play limit.",
+ "IDS_MUSIC_STREAMING_TRACK_LIMIT_TITLE": "You've hit your play limit for {0} by {1}.",
+ "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_DESC": "You can use Xbox Music away from home for up to 2 weeks.\n \nTo keep playing, make sure you're using an account that matches your region.\n \nDid you know? With Xbox Music Pass you can download your music for unlimited access anywhere, anytime. Perfect for traveling.",
+ "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_PREMIUM_ACTION": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_TRAVEL_LIMIT_TITLE": "Have you been traveling?",
+ "IDS_MUSIC_STREAMING_TRIAL_END_BODY": "From now on, you can stream {0} hours of music for free each month. You can always listen to music you own.\n \nCheck your remaining time in Settings, Preferences.\n \nUpgrade to Xbox Music Pass and listen on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE1": "Keep listening for free",
+ "IDS_MUSIC_STREAMING_TRIAL_END_NOTIFICATION_LINE2": "Learn more",
+ "IDS_MUSIC_STREAMING_TRIAL_END_PREMIUM_LINK": "Get Xbox Music Pass",
+ "IDS_MUSIC_STREAMING_TRIAL_END_TITLE": "Keep listening for free.",
+ "IDS_MUSIC_STREAMING_UPSELL_LABEL": "Upgrade to skip ads",
+ "IDS_MUSIC_TOP_ARTISTS_TITLE": "Top Artists",
+ "IDS_MUSIC_TOP_MUSIC_TITLE": "Top Music",
+ "IDS_MUSIC_TOP_SONGS_TITLE": "Top Songs",
+ "IDS_MUSIC_TOPALBUMS_TITLE": "Top Albums",
+ "IDS_MUSIC_TRANSFER_CANCEL_TOOLTIP": "Cancel",
+ "IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_LABEL": "Making songs available offline",
+ "IDS_MUSIC_TRANSFER_DOWNLOAD_GROUP_PROGRESS": "[[1]{0} of {1} download][[*]{0} of {1} downloads]",
+ "IDS_MUSIC_TRANSFER_UPLOAD_GROUP_LABEL": "Making songs available online",
+ "IDS_MUSIC_TRANSFER_UPLOAD_GROUP_PROGRESS": "[[1]{0} of {1} upload][[*]{0} of {1} uploads]",
+ "IDS_MUSIC_UPSELL_BANNER_LEARN_MORE": "Learn more",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION": "Sign in or sign up, and try us for free",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_IN_ACTION2": "Try for free",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION": "Get an Xbox Music Pass",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION_ASTERISK": "Get an Xbox Music Pass*",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2": "Start your free trial",
+ "IDS_MUSIC_UPSELL_BANNER_SIGN_UP_ACTION2_ASTERISK": "Start your free trial*",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT": "Enjoy ad-free music on your phone, Xbox, PC, and the web.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT2": "Take Xbox Music offline with unlimited downloads.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT3": "All music. No ads. Listen on all your devices.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT4": "Go premium for ad-free listening on all your devices.",
+ "IDS_MUSIC_UPSELL_BANNER_TEXT5": "Free streaming and free radio will end on Dec. 1, 2014. Sign up for the Xbox Music Pass and keep the music streaming on your PC, tablet, Xbox and the web.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT": "Start your personal music collection, listen to artist radio, and create playlists.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_NO_TRENDING": "Expand your musical horizons with related artists.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT_TRENDING": "Expand your musical horizons with related artists and trending playlists.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT2": "Create your own library of the latest releases and favorite classics.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT3": "Create radio stations based on favorite artists and songs.",
+ "IDS_MUSIC_UPSELL_BANNER_UNAUTH_TEXT4": "Discover new music from one of the largest digital music catalogs on the planet.",
+ "IDS_MUSIC_UPSELL_DIALOG_ACTION": "Or redeem a code",
+ "IDS_MUSIC_UPSELL_DIALOG_DISCLAIMER": "*Xbox Music Pass is streaming only on Xbox consoles and on the web. See xbox.com/music for system requirements and terms of use.",
+ "IDS_MUSIC_UPSELL_DIALOG_LINE1": "All music, no ads. Listen to millions of songs ad-free.",
+ "IDS_MUSIC_UPSELL_DIALOG_LINE2": "Stream music on your PC, tablet, Xbox, phone — including iOS® and Android™ — and the web.",
+ "IDS_MUSIC_UPSELL_DIALOG_LINE3": "Take your music offline and listen even when you're not connected.*",
+ "IDS_MUSIC_UPSELL_DIALOG_MUSIC_PASS_DISCLAIMER": "*Internet required; ISP fees apply. Xbox Music Pass 30 day trial continues to a paid monthly subscription unless cancelled. Credit card required. Limit 1 per person; prior Zune Pass trial users not eligible. On Xbox consoles and the Web, Xbox Music Pass is streaming only. Download music on up to 4 devices. Some Xbox Music content may not be available via Xbox Music Pass, and may vary over time and by region. See xbox.com/music.",
+ "IDS_MUSIC_UPSELL_DIALOG_REDEEM_BUTTON": "{0} {1}",
+ "IDS_MUSIC_UPSELL_DIALOG_TITLE": "Go premium with an Xbox Music Pass.",
+ "IDS_MUSIC_UPSELL_DIALOG_TITLE_ALT": "Thanks for being an Xbox Music Pass subscriber! Extend your subscription to stay premium.",
+ "IDS_MUSIC_WELCOME_CLOUDV2_BUTTON": "Get started",
+ "IDS_MUSIC_WELCOME_CLOUDV2_SUBTITLE": "Add your music to OneDrive so you can play it anywhere.",
+ "IDS_MUSIC_WELCOME_CLOUDV2_TITLE": "OneDrive",
+ "IDS_MUSIC_WELCOME_COLLECTION_BUTTON": "Go to collection",
+ "IDS_MUSIC_WELCOME_COLLECTION_SUBTITLE": "All your music, organized just the way you like it.",
+ "IDS_MUSIC_WELCOME_COLLECTION_TITLE": "Collection",
+ "IDS_MUSIC_WELCOME_EXPLORE_BUTTON": "Browse millions of songs",
+ "IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE": "Browse and buy from a catalog of millions of songs.",
+ "IDS_MUSIC_WELCOME_EXPLORE_SUBTITLE_2": "Browse and buy from a catalog of 40,000,000 songs.",
+ "IDS_MUSIC_WELCOME_EXPLORE_TITLE": "Explore Catalog",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_BUTTON": "Get a music pass",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE": "Millions of songs to collect and play.",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_SUBTITLE2": "Over 30 million songs to collect and play.",
+ "IDS_MUSIC_WELCOME_GO_PREMIUM_TITLE": "Go Premium",
+ "IDS_MUSIC_WELCOME_PAGE_SUBTITLE": "Your music, plus access to millions of other songs.",
+ "IDS_MUSIC_WELCOME_PAGE_TITLE": "Welcome to Xbox Music",
+ "IDS_MUSIC_WELCOME_RADIO_BUTTON": "Listen to artist radio",
+ "IDS_MUSIC_WELCOME_RADIO_SUBTITLE": "Discover new musical horizons, rediscover your favorite artists.",
+ "IDS_MUSIC_WELCOME_RADIO_TITLE": "Radio",
+ "IDS_VIDEO_AD_LEARN_MORE": "Learn more",
+ "IDS_VIDEO_AD_PROGRESS": "Music will start in {0}",
+ "IDS_VIDEO_AD_UPSELL_LINE_1": "Tired of interruptions?",
+ "IDS_VIDEO_AD_UPSELL_LINE_2": "Go premium!",
+ "IDS_APP_UPDATE_SPLASH_SUBTITLE": "This could take a few minutes, especially if you have a lot of music.",
+ "IDS_APP_UPDATE_SPLASH_TITLE": "Completing the update",
+ "IDS_COLLECTION_BY_ALBUM_TITLE": "albums",
+ "IDS_COLLECTION_BY_ARTIST_TITLE": "artists",
+ "IDS_COLLECTION_BY_SONG_TITLE": "songs",
+ "IDS_COLLECTION_FILTER_ALL": "all my music",
+ "IDS_COLLECTION_FILTER_ALL_MUSIC": "all music",
+ "IDS_COLLECTION_FILTER_ALL_SC": "All my music",
+ "IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE": "available offline",
+ "IDS_COLLECTION_FILTER_AVAILABLE_OFFLINE_SC": "Available offline",
+ "IDS_COLLECTION_FILTER_FLYOUT_CLOUDV2": "Filter all your music to see what's on your OneDrive, streaming, or just on this device",
+ "IDS_COLLECTION_FILTER_FLYOUT_OFFLINE": "Filter all your music to see what you can stream and what's available offline",
+ "IDS_COLLECTION_FILTER_FROM_XBOX_MUSIC": "Xbox Music Pass",
+ "IDS_COLLECTION_FILTER_IN_CLOUD": "in the cloud",
+ "IDS_COLLECTION_FILTER_IN_CLOUD_SC": "In the cloud",
+ "IDS_COLLECTION_FILTER_MUSIC_EMPTY_LINK": "Show all my music",
+ "IDS_COLLECTION_FILTER_MUSIC_EMPTY_TEXT": "Your music is hidden by the filter.",
+ "IDS_COLLECTION_FILTER_ON_ONEDRIVE": "on OneDrive",
+ "IDS_COLLECTION_FILTER_ON_ONEDRIVE_SC": "On OneDrive",
+ "IDS_COLLECTION_FILTER_ONLY_ON_PC": "only on this PC",
+ "IDS_COLLECTION_FILTER_ONLY_ON_PC_SC": "Only on this PC",
+ "IDS_COLLECTION_FILTER_OWNED_MUSIC": "music I own",
+ "IDS_COLLECTION_FILTER_PURCHASED": "purchased",
+ "IDS_COLLECTION_FILTER_PURCHASED_SC": "Purchased",
+ "IDS_COLLECTION_FILTER_STREAMING": "streaming",
+ "IDS_COLLECTION_FILTER_STREAMING_SC": "Streaming",
+ "IDS_DETAILS_FILTER_AVAILABLE_OFFLINE": "Showing offline music",
+ "IDS_DETAILS_FILTER_FROM_XBOX_MUSIC": "Showing music from Xbox Music Pass",
+ "IDS_DETAILS_FILTER_IN_CLOUD": "Showing music in cloud",
+ "IDS_DETAILS_FILTER_ON_ONEDRIVE": "Showing music on OneDrive",
+ "IDS_DETAILS_FILTER_ON_PC": "Showing music on this PC",
+ "IDS_DETAILS_FILTER_PURCHASED": "Showing purchased music",
+ "IDS_DETAILS_FILTER_STREAMING": "Showing streaming music",
+ "IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE": "To make your music available in the cloud, match it with something from Xbox Music.",
+ "IDS_FAI_ADD_ALBUM_CLOUD_SUBTITLE_FREE": "By matching your music with songs from Xbox Music, you'll see it on any Windows 8/Windows RT device you sign into.",
+ "IDS_FAI_ADD_ALBUM_CLOUD_TITLE": "What's a good match for this?",
+ "IDS_FAI_ADD_ALBUM_LEARN_MORE": "Learn more",
+ "IDS_FAI_ALBUM_COLUMN_TITLE": "Albums from Xbox Music",
+ "IDS_FAI_ALBUM_SUMMARY_2": "{0}, {1}",
+ "IDS_FAI_ALBUM_SUMMARY_3": "{0}, {1}, {2}",
+ "IDS_FAI_ALBUM_SUMMARY_3_PLURAL": "[[1]{0}, {1} song, {2}][[*]{0}, {1} songs, {2}]",
+ "IDS_FAI_ALBUM_SUMMARY_4_PLURAL": "[[1]{0}, {1} song, {2}, {3}][[*]{0}, {1} songs, {2}, {3}]",
+ "IDS_FAI_AVAILABLE_TRACKS": "Available song titles",
+ "IDS_FAI_CANCEL_BUTTON": "Cancel",
+ "IDS_FAI_CHOOSE_ALBUM_CLOUD_TITLE": "Update your metadata from the Xbox Music catalog. What’s a good match?",
+ "IDS_FAI_CHOOSE_ALBUM_TITLE": "Choose the right album",
+ "IDS_FAI_CLOUD_MATCH_BULK_LINK": "Here's how to add a bunch of albums at once >",
+ "IDS_FAI_CLOUD_MATCH_SUBTEXT": "For unmatched songs, tap to choose an available song title.",
+ "IDS_FAI_FINISH_BUTTON": "Finish",
+ "IDS_FAI_MATCH": "match",
+ "IDS_FAI_MATCH_ALBUM_COMMAND": "Music in the cloud",
+ "IDS_FAI_MATCH_COLUMN_TITLE": "We'll update metadata for marked tracks",
+ "IDS_FAI_MATCH_SONGS_SUBTITLE": "We couldn't automatically match every song from your PC to this album. You can fix the remaining tracks here. Note that not all tracks are available in Xbox Music.",
+ "IDS_FAI_MATCH_SONGS_TITLE": "Almost done.",
+ "IDS_FAI_MATCHED_SONGS": "Here's what we matched.",
+ "IDS_FAI_NEXT_BUTTON": "Next",
+ "IDS_FAI_NO_ALBUM_FOUND_ERROR": "Sorry, we can't find a match for that album. Please try another.",
+ "IDS_FAI_NO_SONGS_MATCHED_ERROR": "We didn't find any song matches.",
+ "IDS_FAI_NO_STREAMS_MATCHED_ERROR": "Sorry, that's not available from Xbox Music.",
+ "IDS_FAI_ORIGINAL_TRACK": "Original song title",
+ "IDS_FAI_SEARCH_ALBUM_HINT": "Don't see the right album?",
+ "IDS_FAI_SEARCH_ALBUM_TITLE": "Search for the right album",
+ "IDS_FAI_SONG_COLUMN_TITLE": "Songs from your album",
+ "IDS_FAI_UNMATCHED_SONGS": "We're not quite sure about these.",
+ "IDS_FIND_ALBUM_INFO_COMMAND": "Find album info",
+ "IDS_MARKETPLACE_BY_ALBUM": "by album",
+ "IDS_MARKETPLACE_BY_ARTIST": "by artist",
+ "IDS_MARKETPLACE_BY_RELEASE_DATE": "by release date",
+ "IDS_MARKETPLACE_SORT_PREFIX": "arranged by {0}",
+ "IDS_MATCH_ALBUM_INFO_COMMAND": "Match album info",
+ "IDS_MUSIC_ABOUT_PANEL_TEXT": "about",
+ "IDS_MUSIC_ABOUT_PANEL_TEXT_LC": "about",
+ "IDS_MUSIC_ADD_ALBUM_TO_LIST_TITLE_PLURAL": "[[1]Add album to:][[*]Add albums to:]",
+ "IDS_MUSIC_ADD_MUSIC_VIDEO_TO_LIST_TITLE_PLURAL": "[[1]Add music video to:][[*]Add music videos to:]",
+ "IDS_MUSIC_ADD_PLAYLIST_TO_LIST_TITLE": "Add playlist to:",
+ "IDS_MUSIC_ADD_SONG_TO_LIST_TITLE_PLURAL": "[[1]Add song to:][[*]Add songs to:]",
+ "IDS_MUSIC_ADD_TO_COLLECTION_BUTTON": "Collection",
+ "IDS_MUSIC_ADD_TO_LIST_BUTTON": "Add to",
+ "IDS_MUSIC_ADD_TO_LIST_CLOUD_ACTION": "Music in the cloud",
+ "IDS_MUSIC_ADD_TO_LIST_CLOUD_COLLECTION_ACTION": "Cloud collection",
+ "IDS_MUSIC_ADD_TO_LIST_COLLECTION_ACTION": "My music",
+ "IDS_MUSIC_ADD_TO_LIST_DEVICES_ACTION": "Devices",
+ "IDS_MUSIC_ADD_TO_LIST_NEW_PLAYLIST_ACTION": "New playlist",
+ "IDS_MUSIC_ADD_TO_LIST_NOW_PLAYING_ACTION": "Now playing",
+ "IDS_MUSIC_ADD_TO_LIST_PLAYLIST_ACTION": "Other playlist",
+ "IDS_MUSIC_ADD_TO_LIST_TITLE": "Add {0} to:",
+ "IDS_MUSIC_ADD_TO_MY_MUSIC_BUTTON": "My music",
+ "IDS_MUSIC_ADD_TO_PLAYLIST_TITLE": "Select a playlist",
+ "IDS_MUSIC_ALBUM_BY_ARTIST": "{0} by {1}",
+ "IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_BODY": "Delete them from your collection",
+ "IDS_MUSIC_ALBUM_DETAILS_TAKEDOWN_BANNER_NOTIFICATION_TITLE": "Songs in this album have been removed from Xbox Music at the request of the copyright holder.",
+ "IDS_MUSIC_ALBUM_ONLY_PURCHASE_TEXT": "Album only",
+ "IDS_MUSIC_ALBUM_SORT": "album",
+ "IDS_MUSIC_ALBUMS_IN_COLLECTION": "Albums in My Music",
+ "IDS_MUSIC_ARTIST_BIO_TITLE": "bio",
+ "IDS_MUSIC_ARTIST_BIO_TITLE_TC": "Bio",
+ "IDS_MUSIC_BUY_TEXT": "Buy Music",
+ "IDS_MUSIC_BY_ARTIST": "by {0}",
+ "IDS_MUSIC_CLOUD_COLLECTION_ICON_HEADER": "Collection icons",
+ "IDS_MUSIC_CLOUD_ICON_CLOSE_BUTTON": "Close",
+ "IDS_MUSIC_CLOUD_ICON_CLOUD_HEADER": "On this device and in the cloud",
+ "IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_FREE": "These are songs you can play when this device is offline. These are also available on any Windows 8/Windows RT device you sign into.",
+ "IDS_MUSIC_CLOUD_ICON_CLOUD_PARA_1_XMP": "These are songs you can play when this device is offline. These are also available on any Windows Phone 8, Xbox 360, and Windows 8/Windows RT device you sign into.",
+ "IDS_MUSIC_CLOUD_ICON_HEADER": "My music icons",
+ "IDS_MUSIC_CLOUD_ICON_LEARN_MORE_TEXT": "Learn more about music in the cloud >",
+ "IDS_MUSIC_CLOUD_ICON_NONE_HEADER": "No icon?",
+ "IDS_MUSIC_CLOUD_ICON_NONE_PARA_1": "These are songs you own, available only on this device. To make them available on other devices, tap Add To and choose Cloud Collection.",
+ "IDS_MUSIC_CLOUD_ICON_NONE_PARA_1_ALT": "These are songs you own, available only on this device. To make them available on other devices, tap Add To and choose Devices.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_HEADER": "Streaming only",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_LINK": "Learn more.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_FREE": "These are songs you've added from Xbox Music. You'll see these on any Windows 8/Windows RT device you sign into. However, they can't be played offline on this device.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_1_XMP": "These are songs you've added from Xbox Music. You'll see these on any Windows Phone 8, Xbox 360, and Windows 8/Windows RT device you sign into. However, they can't be played offline on this device.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_FREE": "To play them offline, download them by buying them or by signing up for Xbox Music Pass.",
+ "IDS_MUSIC_CLOUD_ICON_STREAM_PARA_2_XMP": "To play them offline, download them.",
+ "IDS_MUSIC_CLOUD_ICON_SUB_HEADER": "You'll see the following icons on songs and albums in your music collection.",
+ "IDS_MUSIC_CLOUD_MATCH_ACCEPT_BUTTON": "Match my music",
+ "IDS_MUSIC_CLOUD_MATCH_CANCEL_BUTTON": "Maybe later",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_ALT_FREE": "When you subscribe to Xbox Music Pass, you'll also get your music on Xbox 360 and Windows Phone.",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_FREE": "Extend your music to Xbox 360 and Windows Phone 8",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_ALT_FREE": "Learn more about Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_FREE": "with Xbox Music Pass >",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_LINK_XMP": "with Xbox Music Pass >",
+ "IDS_MUSIC_CLOUD_MATCH_FOOTER_XMP": "Extend your music to Xbox 360 and Windows Phone 8",
+ "IDS_MUSIC_CLOUD_MATCH_HEADER": "Music in the cloud",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_1_FREE": "Music matching lets you listen to the music from this PC on other Windows 8/Windows RT tablets and PCs. Just match your music to what we have at Xbox Music. (If a song isn't found at Xbox Music, it's not matched.)",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_1_XMP": "Music matching lets you listen to the music from this PC on several devices, like Windows Phone 8, Xbox 360, and Windows 8/Windows RT tablets and PCs. Just match your music to what we have at Xbox Music. (If a song isn't found at Xbox Music, it's not matched.)",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_2_FREE": "To match music later, see Music in the Cloud in Settings.",
+ "IDS_MUSIC_CLOUD_MATCH_PARA_2_XMP": "To match music later, see Music in the Cloud in Settings.",
+ "IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_FREE": "Listen for free on multiple PCs",
+ "IDS_MUSIC_CLOUD_MATCH_SUB_HEADER_XMP": "Your music, wherever you want it",
+ "IDS_MUSIC_CLOUD_SETTINGS_ICON_INFO_LINK_TEXT": "Learn about those icons in your collection",
+ "IDS_MUSIC_CLOUD_SETTINGS_MATCH_INFO_LINK_TEXT": "Find out how this works",
+ "IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC": "Automatically add matched songs on this PC to your cloud collection",
+ "IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC_ALT": "Automatically add matched songs on this PC to Devices",
+ "IDS_MUSIC_COLLECTION_ALPHA_SORT": "a to z",
+ "IDS_MUSIC_COLLECTION_ARTIST_SORT": "artist",
+ "IDS_MUSIC_COLLECTION_DATEADDED_SORT": "date added",
+ "IDS_MUSIC_COLLECTION_DATEEDITED_SORT": "date changed",
+ "IDS_MUSIC_COLLECTION_DATEPLAYED_SORT": "date played",
+ "IDS_MUSIC_COLLECTION_EMPTY_HEADING": "Get some music",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING1": "Visit the Music store",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING2": "Add your music to OneDrive",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBHEADING3": "Get a Music Pass",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT1": "There are tons of tracks to pick from.",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT2": "Then you can play your songs from any device.",
+ "IDS_MUSIC_COLLECTION_EMPTY_SUBTEXT3": "Unlimited streaming – start your free trial.",
+ "IDS_MUSIC_COLLECTION_EMPTY_TEXT": "There’s a few ways you can add songs:",
+ "IDS_MUSIC_COLLECTION_EXPLORE_ALBUM": "Explore album",
+ "IDS_MUSIC_COLLECTION_GROVEL_HEADING": "We’re looking for your music",
+ "IDS_MUSIC_COLLECTION_GROVEL_TEXT": "This may take a while if you have a lot of songs.",
+ "IDS_MUSIC_COLLECTION_RATING_SORT": "rating",
+ "IDS_MUSIC_COLLECTION_RELEASEYEAR_SORT": "release year",
+ "IDS_MUSIC_COLLECTION_SONGS_PANEL_TEXT_LC": "my songs",
+ "IDS_MUSIC_COLLECTION_TITLE": "Music collection",
+ "IDS_MUSIC_COLLECTION_TITLE_LC": "music collection",
+ "IDS_MUSIC_CONTENT_NOT_AVAILABLE_BUTTON": "Not available",
+ "IDS_MUSIC_CREATE_PLAYLIST": "New playlist",
+ "IDS_MUSIC_DATA_PROVIDER_BANDPAGE": "Portions of the artist content is provided by BandPage®",
+ "IDS_MUSIC_DATA_PROVIDER_ECHONEST": "Radio powered by",
+ "IDS_MUSIC_DATA_PROVIDER_GRACENOTE": "Portions of the content is copyright © of Gracenote or its providers.",
+ "IDS_MUSIC_DATA_PROVIDER_ROVI": "Portions of content provided by Rovi Corporation. © 2014 Rovi Corporation.",
+ "IDS_MUSIC_DATE_CHANGED_TEXT": "date changed",
+ "IDS_MUSIC_DEEPLINK_ERROR_GENERIC_DESC": "Choose something else to listen to or try again later.",
+ "IDS_MUSIC_DEEPLINK_ERROR_GENERIC_TITLE": "Sorry, we can't take you there",
+ "IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_DESC": "The Xbox Music service isn't available in your region just yet.",
+ "IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_TITLE": "Sorry, we can't take you there",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL": "[[1]This will permanently delete this {0} album from your library.][[*]This will permanently delete these {0} albums from your library.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_MIXED_PLURAL": "[[1]This will permanently delete this {0} album from your library and from OneDrive, if they're on there, too.][[*]This will permanently delete these {0} albums from your library and from OneDrive, if they're on there, too.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_ONEDRIVE_PLURAL": "[[1]This will permanently delete this {0} album from your library and from OneDrive.][[*]This will permanently delete these {0} albums from your library and from OneDrive.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL": "[[1]This will permanently delete this {0} track from your library.][[*]This will permanently delete these {0} tracks from your library.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_MIXED_PLURAL": "[[1]This will permanently delete this {0} track from your library and from OneDrive, if they're on there, too.][[*]This will permanently delete these {0} tracks from your library and from OneDrive, if they're on there, too.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_ONEDRIVE_PLURAL": "[[1]This will permanently delete this {0} track from your library and from OneDrive.][[*]This will permanently delete these {0} tracks from your library and from OneDrive.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_ALBUMS_PLURAL": "[[1]We'll delete this {0} album from your cloud library, but if you own any of the song files we won't delete them from your PC. ][[*]We'll delete these {0} albums from your cloud library, but if you own any of the song files we won't delete them from your PC.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM": "We'll delete this album from your cloud library.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_ALBUM_WITH_LOCAL": "We'll delete this album from your cloud library, but if you own any of the song files we won't delete them from your PC.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK": "We'll delete this song from your library.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_SINGLE_TRACK_WITH_LOCAL": "We'll delete this song from your cloud library, but if you own the song file we won’t delete it from your PC.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_ONLY_CLOUD_TRACKS_PLURAL": "[[1]We'll delete this {0} song from your cloud library, but if you own the song file we won't delete it from your PC.][[*]We'll delete these {0} songs from your cloud library, but if you own the song files we won't delete them from your PC.]",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_LIBRARY": "This will permanently delete \"{0}\" from your library.",
+ "IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_ONEDRIVE": "This will permanently delete \"{0}\" from your library and from OneDrive.",
+ "IDS_MUSIC_DELETE_DIALOG_HEADING_MULTIPLE": "Are you sure you want to delete these?",
+ "IDS_MUSIC_DELETE_DIALOG_HEADING_SINGLE": "Are you sure you want to delete this?",
+ "IDS_MUSIC_DISCOGRAPHY_TITLE": "albums",
+ "IDS_MUSIC_DONT_SHOW_AGAIN_MESSAGE": "Don't show this message again",
+ "IDS_MUSIC_DOWNLOAD_COMPLETE": "Download Complete",
+ "IDS_MUSIC_DOWNLOAD_ERROR": "Download Error",
+ "IDS_MUSIC_DOWNLOAD_ERROR_NOTIFICATION": "Can't download to this computer",
+ "IDS_MUSIC_DOWNLOAD_NOTIFICATION": "Downloading...",
+ "IDS_MUSIC_DOWNLOAD_PROGRESS_SONGS_PLURAL": "[[1]{0} song remaining][[*]{0} songs remaining]",
+ "IDS_MUSIC_DOWNLOAD_VIEW_ALBUM": "show album",
+ "IDS_MUSIC_ECHONEST_ALT_TEXT": "EchoNest",
+ "IDS_MUSIC_EMPTY_PLAYLIST": "Give your playlist some music: select a song or an album in your collection, then select Add to Playlist. Your songs will appear here.",
+ "IDS_MUSIC_ENGAGE_ARTIST_ENTER": "Enter an artist.",
+ "IDS_MUSIC_ENGAGE_ARTIST_ENTER_BUTTON_UC": "FIND",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_PLAY": "Sorry, we couldn't find that artist in the Xbox Music catalog.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_RADIO": "Sorry, we can't start radio for {0}.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_SMARTDJ": "Sorry, we can't start Smart DJ for {0}.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_NONE_TEXT": "Try searching for another artist.",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_NONE_UC": "NO RESULTS FOR \"{0}\"",
+ "IDS_MUSIC_ENGAGE_ARTIST_SEARCH_TITLE_UC": "RESULTS FOR \"{0}\"",
+ "IDS_MUSIC_ENGAGE_FREE_STREAM_DESC": "Search for any artist, song, or album and instantly play whatever you want.",
+ "IDS_MUSIC_ENGAGE_FREE_STREAM_TITLE": "Stream millions of songs for free.",
+ "IDS_MUSIC_ENGAGE_NEW_RADIO_ACTION": "Start radio",
+ "IDS_MUSIC_ENGAGE_NEW_RADIO_FREE_DESC": "Just pick an artist to create a station.",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_ACTION": "New Smart DJ",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_DESC": "Enter an artist and we'll create a playlist of related music",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_DESC": "Just pick an artist — Smart DJ builds the perfect mix.",
+ "IDS_MUSIC_ENGAGE_NEW_SMARTDJ_FREE_TITLE": "Free streaming radio.",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION": "Play any artist",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_ACTION_FREE": "Play any artist — free!",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_DESC": "Enter an artist and we'll kick off a mix of their most popular songs",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_DESC": "Stream your favorite songs by your favorite artists.",
+ "IDS_MUSIC_ENGAGE_PLAY_ARTIST_FREE_TITLE": "Listen for free!",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_ACTION": "Play a playlist",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_DESC": "Kick back, set a mood, or dive deep with favorite songs and artists",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_DESC": "Add your favorites and the latest songs from Xbox Music — free!",
+ "IDS_MUSIC_ENGAGE_PLAY_PLAYLIST_FREE_TITLE": "Make a playlist.",
+ "IDS_MUSIC_ENGAGE_PLAYLIST_ADD_TITLE_UC": "ADD \"{0}\" TO",
+ "IDS_MUSIC_ENGAGE_PLAYLIST_MANAGE": "Manage playlists",
+ "IDS_MUSIC_ENGAGE_PLAYLIST_PLAY_TITLE_UC": "MY PLAYLISTS",
+ "IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_ACTION": "Try Xbox Music Pass",
+ "IDS_MUSIC_ENGAGE_PREMIUM_TRIAL_DESC": "Enjoy all the music you love — free — for a limited time.",
+ "IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_ACTION": "Shuffle my music",
+ "IDS_MUSIC_ENGAGE_SHUFFLE_MUSIC_DESC": "Once you've added music, shuffle it for a fresh and friendly mix",
+ "IDS_MUSIC_GENRE_SORT": "genre",
+ "IDS_MUSIC_GET_A_SUBSCRIPTION_TEXT": "Get unlimited music with Xbox Music Pass!",
+ "IDS_MUSIC_IN_COLLECTION_LABEL": "in collection",
+ "IDS_MUSIC_IN_LIBRARY_LABEL": "In library",
+ "IDS_MUSIC_IN_MY_MUSIC_LABEL": "in my music",
+ "IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_PLURAL": "[[1]influencing artist][[*]influencing artists]",
+ "IDS_MUSIC_INFLUENCING_ARTISTS_COUNT_TEXT": "influencing artists",
+ "IDS_MUSIC_INFLUENCING_ARTISTS_TEXT": "influencing artists",
+ "IDS_MUSIC_INTRO_BROWSE_BUTTON_AUTHED": "Start",
+ "IDS_MUSIC_INTRO_BROWSE_BUTTON_NONAUTHED": "Sign in",
+ "IDS_MUSIC_INTRO_DETAILS": "See it? Play it.\n\nStream millions of songs for free.\n\nAdd the songs you love to your music collection.\n\nMake playlists of your favorite songs and mix in the latest from Xbox Music.\n\nJust pick an artist — Smart DJ builds the perfect mix.",
+ "IDS_MUSIC_INTRO_DETAILS_RADIO": "See it? Play it.\n\nStream millions of songs for free.\n\nAdd the songs you love to your music collection.\n\nMake playlists of your favorite songs and mix in the latest from Xbox Music.\n\nJust pick an artist — Radio builds the perfect mix.",
+ "IDS_MUSIC_INTRO_HEADER": "Welcome to Xbox Music",
+ "IDS_MUSIC_INTRO_PLAY_BUTTON_AUTHED": "Start playing",
+ "IDS_MUSIC_INTRO_PLAY_BUTTON_NONAUTHED": "Sign in to start playing",
+ "IDS_MUSIC_LATEST_ALBUM": "Latest album",
+ "IDS_MUSIC_MARKETPLACE_DASHBOARD_TITLE": "all music",
+ "IDS_MUSIC_MARKETPLACE_GALLERY_TITLE": "all music",
+ "IDS_MUSIC_MARKETPLACE_MOST_PLAYTED_SORT": "most played",
+ "IDS_MUSIC_MARKETPLACE_POPULARITY_SORT": "popularity",
+ "IDS_MUSIC_MARKETPLACE_RELEASEDATE_SORT": "date",
+ "IDS_MUSIC_MARKETPLACE_TITLE_LC": "xbox music store",
+ "IDS_MUSIC_MARKETPLACE_TITLE_SORT": "title",
+ "IDS_MUSIC_MATCH_GRACENOTE_SERVICE": "Music matching service powered by Gracenote",
+ "IDS_MUSIC_MAX_DEVICES_NOTIFICATION": "Device limit reached",
+ "IDS_MUSIC_MODIFIER_GENRE": "Genre",
+ "IDS_MUSIC_MODIFIER_GENRE_ALL": "All music",
+ "IDS_MUSIC_MODIFIER_SUBGENRE": "Subgenre",
+ "IDS_MUSIC_MODIFIER_SUBGENRE_NONE": "None",
+ "IDS_MUSIC_MOST_POPULAR_PANEL_HEADER": "top music",
+ "IDS_MUSIC_MY_PLAYLISTS_HEADER": "my playlists",
+ "IDS_MUSIC_NEW_RELEASES_TITLE_LC": "new releases",
+ "IDS_MUSIC_NOTIFICATION_1_ALBUM_ADDED": "1 album",
+ "IDS_MUSIC_NOTIFICATION_1_ARTIST_ADDED": "1 artist",
+ "IDS_MUSIC_NOTIFICATION_1_TRACK_ADDED": "1 song",
+ "IDS_MUSIC_NOTIFICATION_ADD_ERROR": "Can't add",
+ "IDS_MUSIC_NOTIFICATION_ADD_SONGS_ERROR": "Can't add songs",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_COLLECTION": "Added to collection",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_MY_MUSIC": "Added to your music",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_NOW_PLAYING": "Added to now playing",
+ "IDS_MUSIC_NOTIFICATION_ADDED_TO_PLAYLIST": "Added to playlist",
+ "IDS_MUSIC_NOTIFICATION_ADDING_TO_COLLECTION": "Adding to collection",
+ "IDS_MUSIC_NOTIFICATION_ADDING_TO_NOW_PLAYING": "Adding to now playing",
+ "IDS_MUSIC_NOTIFICATION_ADDING_TO_PLAYLIST": "Adding to playlist",
+ "IDS_MUSIC_NOTIFICATION_ALBUMS_ADDED_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_MUSIC_NOTIFICATION_ARTISTS_ADDED_PLURAL": "[[1]{0} artist][[*]{0} artists]",
+ "IDS_MUSIC_NOTIFICATION_MUSIC_PASS_ONLY": "Xbox Music Pass only",
+ "IDS_MUSIC_NOTIFICATION_N_ALBUMS_ADDED": "{0} albums",
+ "IDS_MUSIC_NOTIFICATION_N_ARTISTS_ADDED": "{0} artists",
+ "IDS_MUSIC_NOTIFICATION_N_TRACKS_ADDED": "{0} songs",
+ "IDS_MUSIC_NOTIFICATION_PURCHASE_ONLY": "Available for purchase only",
+ "IDS_MUSIC_NOTIFICATION_RADIO_LOCKED": "You're listening to radio",
+ "IDS_MUSIC_NOTIFICATION_TRACKS_ADDED_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_NOW_PLAYING_DEFAULT_LIST_NAME": "Now Playing ({0})",
+ "IDS_MUSIC_NOW_PLAYING_NEXT_SONG_DESC": "Up next",
+ "IDS_MUSIC_NOW_PLAYING_PANEL_HEADER_UC": "NOW PLAYING",
+ "IDS_MUSIC_NOW_PLAYING_PREVIOUS_SONG_DESC": "You just heard",
+ "IDS_MUSIC_NOW_PLAYING_SMART_DJ_LIST_NAME": "{0} mix ({1})",
+ "IDS_MUSIC_NOW_PLAYING_TOP_SONGS_LIST_NAME": "{0} top songs ({1})",
+ "IDS_MUSIC_OFFLINE_DRM_DESC": "We need to check usage rights for that song. Please try again when you're online.",
+ "IDS_MUSIC_OFFLINE_DRM_TITLE": "Can't play",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_ACTION": "Get started",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_BANNER_BODY": "Some of the songs you put on OneDrive resulted in duplicates. Let's clean things up.",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_NO": "Keep duplicates",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_ACTION_YES": "Remove duplicates",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_BODY": "There are some songs on your OneDrive that are the same as songs you've added from the Music catalog. We can clean things up for you so the same song won't be listed twice.\n\nHere's what will happen:\n• The songs you've put on OneDrive will become the master version. We'll remove songs that you've added from the Music catalog if—and only if—they're a perfect match to the ones on OneDrive.\n• You can stream or download those songs from OneDrive.* (If you want to listen when you're offline, make sure you've downloaded those songs). \n• This won't affect songs that aren't duplicates, and you can turn this off at any time in Settings.\n\n*Important: Choose Keep duplicates if you use the Music app on Android, iOS, or a version of Windows or Windows Phone earlier than 8.1. The Music app on these operating systems doesn't work with OneDrive yet, so you won't be able to stream your music.",
+ "IDS_MUSIC_ONEDRIVE_DEDUP_DIALOG_TITLE": "Let's clean up your duplicate songs",
+ "IDS_MUSIC_PLAY_ALBUM_LABEL": "Play album",
+ "IDS_MUSIC_PLAY_ALL_BUTTON": "Play all",
+ "IDS_MUSIC_PLAY_SELECTION_ACTION": "Play selected",
+ "IDS_MUSIC_PLAY_TO_DISABLED_TEXT": "Can't play to device",
+ "IDS_MUSIC_PLAY_TO_LABEL": "Play To",
+ "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR_TEXT": "Sorry, we can't stream music to that device. Download the music here, then try again.",
+ "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR2_TEXT": "To play rights-managed music to your Xbox, sign up for Xbox Music Pass or sign in with a profile that has a pass already.",
+ "IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR3_TEXT": "Rights-managed music from the Xbox service can be streamed only to an Xbox 360 console.",
+ "IDS_MUSIC_PLAY_TO_STREAMING_ERROR_TEXT": "Sorry, we can't stream this song.",
+ "IDS_MUSIC_PLAY_TOP_SONGS_BUTTON": "Play top songs",
+ "IDS_MUSIC_PLAYLIST_LABEL": "Playlist",
+ "IDS_MUSIC_PLAYLIST_SEARCH_NAME_DESC": "Enter an artist, album, or song from your playlists",
+ "IDS_MUSIC_PLAYLIST_SEARCH_NAME_LABEL": "Enter playlist name",
+ "IDS_MUSIC_PLAYLISTS_BROWSE_COLLECTION": "Browse your albums to find music to add",
+ "IDS_MUSIC_PLAYLISTS_BROWSE_MARKETPLACE": "Browse all music to find music to add",
+ "IDS_MUSIC_PREVIEW_SELECTION_ACTION": "Preview selection",
+ "IDS_MUSIC_PREVIEW_TOP_SONGS_BUTTON": "Preview top songs",
+ "IDS_MUSIC_PROPERTIES_ALBUM_ARTIST_LABEL": "Album artist",
+ "IDS_MUSIC_PROPERTIES_ALBUM_TITLE_LABEL": "Album title",
+ "IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_MULTIPLE_LOCATIONS": "Listen on this device or stream from OneDrive from any device",
+ "IDS_MUSIC_PROPERTIES_AVAILABLE_FROM_ONEDRIVE": "Stream from OneDrive (download to listen offline)",
+ "IDS_MUSIC_PROPERTIES_AVAILABLE_ON_THIS_PC": "Listen on this device (to listen on other devices, add to OneDrive)",
+ "IDS_MUSIC_PROPERTIES_BIT_RATE_LABEL": "Bit rate",
+ "IDS_MUSIC_PROPERTIES_COPYRIGHT_LABEL": "Copyright",
+ "IDS_MUSIC_PROPERTIES_DIALOG_TEXT": "Properties",
+ "IDS_MUSIC_PROPERTIES_DISC_LABEL": "Disc",
+ "IDS_MUSIC_PROPERTIES_DRM_LABEL": "DRM",
+ "IDS_MUSIC_PROPERTIES_FILE_SIZE_LABEL": "File size",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_COPY_LINK": "Copy path",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_LABEL": "File location",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_ONEDRIVE": "On OneDrive",
+ "IDS_MUSIC_PROPERTIES_FOLDER_PATH_STREAMING": "Xbox Music catalog",
+ "IDS_MUSIC_PROPERTIES_GENRE_LABEL": "Genre",
+ "IDS_MUSIC_PROPERTIES_LENGTH_LABEL": "Length",
+ "IDS_MUSIC_PROPERTIES_MEDIA_TYPE_LABEL": "Media type",
+ "IDS_MUSIC_PROPERTIES_RELEASE_YEAR_LABEL": "Release year",
+ "IDS_MUSIC_PROPERTIES_SONG_ARTIST_LABEL": "Song artist",
+ "IDS_MUSIC_PROPERTIES_SONG_TITLE_LABEL": "Song title",
+ "IDS_MUSIC_PROPERTIES_TRACK_LABEL": "Track",
+ "IDS_MUSIC_RECENT_PANEL_HEADER_UC": "RECENT PLAYS",
+ "IDS_MUSIC_RECENT_PLAYLIST_DIALOG_TEXT": "Recent playlists",
+ "IDS_MUSIC_RELATED_ARTISTS_COUNT_PLURAL": "[[1]related artist][[*]related artists]",
+ "IDS_MUSIC_RELATED_ARTISTS_COUNT_TEXT": "related artists",
+ "IDS_MUSIC_RELATED_ARTISTS_LINK": "Show all related",
+ "IDS_MUSIC_RELATED_ARTISTS_TEXT": "related artists",
+ "IDS_MUSIC_RELATED_GENRES_PLURAL": "[[1]related genre][[*]related genres]",
+ "IDS_MUSIC_RELATED_PANEL_FORMAT": "{0} {1}",
+ "IDS_MUSIC_RELATED_PANEL_TEXT": "related",
+ "IDS_MUSIC_RENAME_PLAYLIST": "Rename",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_CANCEL": "Cancel",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_ACTION_DELETE": "Reset now",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_DESCRIPTION": "If your collection is a mess, you can reset it. If you have a Music Pass and you miss a song or album you've removed, just add it back from Explore.",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_NOTE": "Important: If you reset, you can't go back. Depending on what you've selected above, you will have to add songs again and/or recreate your playlists.",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_PLURAL": "[[1]Remove all of the music I added from the Music catalog ({0} song)][[*]Remove all of the music I added from the Music catalog ({0} songs)]",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PASS_SINGLE": "Remove all of the songs I added from the Music catalog ({0} song)",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_PLURAL": "[[1]Remove all of my playlists (This won't delete songs you've added to your collection.) ({0} playlist)][[*]Remove all of my playlists (This won't delete songs you've added to your collection.) ({0} playlists)]",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PLAYLIST_SINGLE": "Remove all of my playlists (This won't delete songs you've added to your collection.) ({0} playlist)",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_PLURAL": "[[1]Remove all of the songs I bought (You can download any of these songs from Explore later.) ({0} purchase)][[*]Remove all of the songs I bought (You can download any of these songs from Explore later.) ({0} purchases)]",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_OPTION_PURCHASE_SINGLE": "Remove all of the songs I bought (You can download any of these songs from Explore later.) ({0} purchase)",
+ "IDS_MUSIC_RESET_COLLECTION_DIALOG_TITLE": "Reset your cloud collection",
+ "IDS_MUSIC_RESET_COLLECTION_FLYOUT_BODY": "This might take a while. You can keep listening to your music while we're working on it.",
+ "IDS_MUSIC_RESET_COLLECTION_FLYOUT_TITLE": "Resetting your cloud collection",
+ "IDS_MUSIC_SAVE_AS_PLAYLIST": "Save as playlist",
+ "IDS_MUSIC_SAVE_NAME_PLAYLIST": "Save changes",
+ "IDS_MUSIC_SAVE_NOW_PLAYING_ACTION": "Save now playing",
+ "IDS_MUSIC_SAVE_THIS_AS_PLAYLIST": "Save this as a playlist",
+ "IDS_MUSIC_SCAN_MATCH_0_SONGS_SCANNED_NOTIFICATION_LINE_2": "We've checked {0} songs so far. This will go fastest if you stay plugged in.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2": "{0} song is now available on other devices when you sign in. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_FREE": "{0} song is now available to you when you sign in on other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_MATCHED_NOTIFICATION_LINE_2_PREMIUM": "{0} song is now available to you when you sign in on Windows Phone 8, Xbox 360, and other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_1_SONG_SCANNED_NOTIFICATION_LINE_2": "We've checked {0} song so far. This will go fastest if you stay plugged in.",
+ "IDS_MUSIC_SCAN_MATCH_MATCHED_NOTIFICATION": "Added to your music in the cloud",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2": "{0} of your {1} songs are now available on other devices when you sign in. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_FREE": "{0} of your {1} songs are now available to you when you sign in on other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_MATCHED_NOTIFICATION_LINE_2_PREMIUM": "{0} of your {1} songs are now available to you when you sign in on Windows Phone 8, Xbox 360, and other Windows 8/Windows RT devices. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_N_SONGS_SCANNED_NOTIFICATION_LINE_2": "We've checked {0} songs so far. This will go fastest if you stay plugged in.",
+ "IDS_MUSIC_SCAN_MATCH_NO_SONGS_MATCHED_NOTIFICATION_LINE_2": "We didn't find anything that matched songs from Xbox Music. Tap to learn more.",
+ "IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_1": "Want to hear this PC's music on other devices?",
+ "IDS_MUSIC_SCAN_MATCH_OPT_IN_NOTIFICATION_LINE_2": "Learn more about music in the cloud",
+ "IDS_MUSIC_SCAN_MATCH_SCANNING_NOTIFICATION": "Adding to your music in the cloud",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_1": "We finished matching your music.",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_MATCHED_NOTIFICATION_LINE_2": "Almost done. Just a moment while we finish up.",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_1": "We're matching your music with songs from Xbox Music.",
+ "IDS_MUSIC_SCAN_MATCH_SONGS_SCANNED_NOTIFICATION_LINE_2_PLURAL": "[[1]We've checked {0} song so far. This will go fastest if you stay plugged in.][[*]We've checked {0} songs so far. This will go fastest if you stay plugged in.]",
+ "IDS_MUSIC_SEARCH_ALL_EMPTY_DESC": "Try searching for something else.",
+ "IDS_MUSIC_SEARCH_ALL_EMPTY_LINK": "Show all results",
+ "IDS_MUSIC_SEARCH_ALL_EMPTY_TITLE": "Sorry, we couldn't find that in your music or the Xbox Music catalog.",
+ "IDS_MUSIC_SEARCH_BEST_MATCH": "Best match",
+ "IDS_MUSIC_SEARCH_CATALOG_EMPTY_DESC": "Tap \"In collection\" to see results from your collection.",
+ "IDS_MUSIC_SEARCH_CATALOG_EMPTY_TITLE": "Sorry, we didn't find that in the Xbox Music catalog.",
+ "IDS_MUSIC_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE": "We don't see that in your collection or the Xbox Music catalog.",
+ "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_DESC": "Tap \"Full catalog\" to see results from Xbox Music.",
+ "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE": "Sorry, we didn't find that in your collection.",
+ "IDS_MUSIC_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG": "Sorry, we didn't find that in your collection.",
+ "IDS_MUSIC_SEARCH_LOCATION_COLLECTION_STORE": "from all sources",
+ "IDS_MUSIC_SEARCH_LOCATION_NOT_AVAILABLE": "Not available",
+ "IDS_MUSIC_SEARCH_LOCATION_STORE": "Xbox Music Store",
+ "IDS_MUSIC_SEARCH_MY_EMPTY_DESC": "Try searching the full catalog of Xbox Music.",
+ "IDS_MUSIC_SEARCH_MY_EMPTY_LINK": "Show results from all music",
+ "IDS_MUSIC_SEARCH_MY_EMPTY_TITLE": "Sorry, we didn't find that in your music.",
+ "IDS_MUSIC_SEARCH_TOP_RESULT": "Top result",
+ "IDS_MUSIC_SEE_MORE_BUTTON": "See more",
+ "IDS_MUSIC_SETTINGS_AUTOMATIC_DOWNLOAD": "Automatic downloads",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ALT_DESCRIPTION": "When you add songs from Xbox Music to Collection, also add them to Devices",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_OFF_DESCRIPTION": "Your music stays on this PC, and songs played or added on other Xbox Music devices aren't shown here.",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ON_DESCRIPTION": "When you add songs from Xbox Music to your collection, you'll see them on each Xbox Music device you sign into.",
+ "IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_TITLE": "Cloud collection",
+ "IDS_MUSIC_SETTINGS_CLOUD_DEVICES_TITLE": "Music on devices",
+ "IDS_MUSIC_SETTINGS_CLOUD_MUSIC_TITLE": "Music in the cloud",
+ "IDS_MUSIC_SETTINGS_MEDIA_INFO_DESC": "Automatically retrieve and update album art and metadata",
+ "IDS_MUSIC_SETTINGS_MEDIA_INFO_LABEL": "Media Info",
+ "IDS_MUSIC_SETTINGS_METADATA_SAVE_DESC": "When you edit song info in Xbox Music, we’ll update your song files with those changes.",
+ "IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_DESCRIPTION": "Automatically download songs you add from the Music catalog",
+ "IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_TITLE": "Downloads",
+ "IDS_MUSIC_SETTINGS_SHOW_CLOUD_GROVEL_INFO_DESC": "Normally, when you add songs and albums from Xbox Music to your collection, those items are kept in sync so they're available to you on any PC you sign in to.",
+ "IDS_MUSIC_SETTINGS_STARTUP_VIEW_DESC": "When the app opens, show my music",
+ "IDS_MUSIC_SETTINGS_STARTUP_VIEW_LABEL": "Startup view",
+ "IDS_MUSIC_SHOW_ALBUMS": "albums",
+ "IDS_MUSIC_SHOW_ARTISTS": "artists",
+ "IDS_MUSIC_SHOW_PLAYLISTS": "playlists",
+ "IDS_MUSIC_SHOW_SONGS": "songs",
+ "IDS_MUSIC_SIMILAR_ALBUMS_PLURAL": "[[1]similar album][[*]similar albums]",
+ "IDS_MUSIC_SIMILAR_ARTISTS_TEXT": "similar artists",
+ "IDS_MUSIC_SONGS_IN_COLLECTION": "Songs in My Music",
+ "IDS_MUSIC_SPOTLIGHT_ITEM_NAR": "spotlight item",
+ "IDS_MUSIC_SPOTLIGHT_PANEL_HEADER": "spotlight",
+ "IDS_MUSIC_STREAMING_NOTIFICATION": "Streaming only",
+ "IDS_MUSIC_SUBSCRIPTION_SIGN_IN_DESC": "Use an existing Xbox profile or make a new one.",
+ "IDS_MUSIC_SUBSCRIPTION_SIGN_IN_TITLE": "To start your free trial, first sign in.",
+ "IDS_MUSIC_SUBSCRIPTION_UPSELL_TEXT": "Get an Xbox Music Pass",
+ "IDS_MUSIC_TOP_ALBUM_TITLE_LC": "top music",
+ "IDS_MUSIC_TOP_SONGS_PANEL_TEXT": "songs",
+ "IDS_MUSIC_TOP_SONGS_PANEL_TEXT_LC": "songs",
+ "IDS_MUSIC_TRACKS_LABEL_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_TYPE_ALBUM_PLURAL": "[[1]album][[*]albums]",
+ "IDS_MUSIC_TYPE_ALBUM_TITLE_TC": "Albums",
+ "IDS_MUSIC_TYPE_ARTIST_PLURAL": "[[1]artist][[*]artists]",
+ "IDS_MUSIC_TYPE_ARTIST_TITLE_TC": "Artists",
+ "IDS_MUSIC_TYPE_PLAYLIST_PLURAL": "[[1]playlist][[*]playlists]",
+ "IDS_MUSIC_TYPE_PLAYLIST_TITLE_TC": "Playlists",
+ "IDS_MUSIC_TYPE_RADIO_PLURAL": "[[1]radio station][[*]radio stations]",
+ "IDS_MUSIC_TYPE_TRACK_PLURAL": "[[1]song][[*]songs]",
+ "IDS_MUSIC_TYPE_TRACK_TITLE_TC": "Songs",
+ "IDS_MUSIC_VIDEO_MARKETPLACE_TITLE": "Music videos",
+ "IDS_MUSIC_VIDEO_MARKETPLACE_TITLE_LC": "music videos",
+ "IDS_MUSIC2_ARTIST_DETAILS_HERO_PANEL_TITLE_UC": "ARTIST DETAILS",
+ "IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_EMPTY": "There's nothing by {0} in your collection. Switch back to all music and add the albums or songs you want.",
+ "IDS_MUSIC2_ARTIST_DISCOGRAPHY_GALLERY_TITLE": "Albums by {0}",
+ "IDS_MUSIC2_GALLERY_JUMP_TO_DATE": "Jump to date",
+ "IDS_MUSIC2_GALLERY_JUMP_TO_LETTER": "Jump to letter",
+ "IDS_MUSIC2_TOP_ALBUMS_HEADER_NO_GENRE_UC": "TOP ALBUMS",
+ "IDS_MUSIC2_TOP_SONGS_PANEL_TEXT": "top songs",
+ "IDS_PICK_PLAYLIST_OVERLAY_TITLE": "Pick a playlist",
+ "IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALBUMS": "Browse my albums",
+ "IDS_PLAY_PLAYLIST_OVERLAY_BROWSE_ALL_MUSIC": "Browse all music",
+ "IDS_PLAY_PLAYLIST_OVERLAY_EMPTY_DESC": "Make your own mixes with just the songs you want. To start a playlist, select any song or album, then tap Add to Playlist.",
+ "IDS_PLAY_PLAYLIST_OVERLAY_IMPORT_DESC": "Already have playlists in your Music library? Add them now.",
+ "IDS_PLAY_PLAYLIST_OVERLAY_MANAGE_PLAYLIST": "Manage my playlists",
+ "IDS_PLAY_PLAYLIST_OVERLAY_TITLE": "My playlists",
+ "IDS_PLAYLIST_ADD": "Add to playlist",
+ "IDS_PLAYLIST_ADD_ACTIVE": "Add to {0}",
+ "IDS_PLAYLIST_ADD_SONG": "Add song to playlist",
+ "IDS_PLAYLIST_ADD_SONG_ACTIVE": "Add song to {0}",
+ "IDS_PLAYLIST_ADDED_TO_PLAYLIST": "Added to Playlist",
+ "IDS_PLAYLIST_ADDED_TO_PLAYLIST_ITEMS_PLURAL": "[[1]{0} item][[*]{0} items]",
+ "IDS_PLAYLIST_BAD_CHARACTERS_ERROR": "The name you entered has unusable characters. Please try another name.",
+ "IDS_PLAYLIST_CHANGED_ON": "Last changed on {0}",
+ "IDS_PLAYLIST_COLLECTION_TITLE": "playlists",
+ "IDS_PLAYLIST_CREATE_DUPLICATE_MESSAGE": "That one's there already. Replace it, or try a different name.",
+ "IDS_PLAYLIST_CREATE_LABEL": "Create new playlist",
+ "IDS_PLAYLIST_CREATE_PLAYLIST_ACTION_TEXT": "Create a playlist",
+ "IDS_PLAYLIST_CREATE_PLAYLIST_DESC_TEXT": "To add tunes, find songs in your music and select Add to Playlist.",
+ "IDS_PLAYLIST_CREATE_PLAYLIST_LINK": "Start a new playlist",
+ "IDS_PLAYLIST_CREATE_REPLACE": "Replace",
+ "IDS_PLAYLIST_DEFAULT_NAME": "New Playlist",
+ "IDS_PLAYLIST_EXISTING_NAME": "That one's there already. Try a different name.",
+ "IDS_PLAYLIST_IMPORT_COMPLETED": "Playlists added",
+ "IDS_PLAYLIST_IMPORT_COMPLETED_NONE_FOUND": "No playlists found",
+ "IDS_PLAYLIST_IMPORT_DIALOG_DESC_TEXT": "We'll look for playlists in your Music library and playlists created in iTunes.",
+ "IDS_PLAYLIST_IMPORT_DIALOG_TITLE": "Xbox Music will add playlists to your collection.",
+ "IDS_PLAYLIST_IMPORT_DIALOG_TITLE_NO_MARKETPLACE": "Music will add playlists to your collection.",
+ "IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_DESC_TEXT": "Select here to import existing playlists from your Music library. You can always import playlists later.",
+ "IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_LINK": "Import your existing playlists",
+ "IDS_PLAYLIST_IMPORT_FAILURE_DETAIL": "To make sure you're seeing all of them, restart the app and add them again.",
+ "IDS_PLAYLIST_IMPORT_FAILURE_OCCURRED": "Some playlists weren't added.",
+ "IDS_PLAYLIST_IMPORT_FAILURE_SUBTITLE": "Learn more",
+ "IDS_PLAYLIST_IMPORT_IN_PROGRESS": "Searching for playlists",
+ "IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_DESC_TEXT": "This shouldn't take too much longer.",
+ "IDS_PLAYLIST_IMPORT_IN_PROGRESS_DIALOG_TITLE": "We're already adding your playlists.",
+ "IDS_PLAYLIST_IMPORT_PLAYLIST_BUTTON": "Import playlists",
+ "IDS_PLAYLIST_ITEM_BUTTON_NOT_AVAILABLE": "Not available",
+ "IDS_PLAYLIST_ITEM_DIALOG_NO_MATCH_XBOX_MUSIC_CLOUD": "This song from your other device isn't available here. To play it, copy it to this device.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE": "Not available on this device.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_DTO_ONLY_MARKETPLACE_ENABLED": "We can't play this song. To hear it on this device, restore the song file to your music collection.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER": "To play, get an Xbox Music Pass.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_ACTION": "Try for free",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_FREE_USER_TITLE": "To play some of the songs in this playlist, you'll need an Xbox Music Pass.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_ENABLED": "Not available here.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_AVAILABLE_MARKETPLACE_NOT_ENABLED": "This song has been removed.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_FOUND_MARKETPLACE_NOT_ENABLED": "We can't find this song on your device any longer.",
+ "IDS_PLAYLIST_ITEM_DIALOG_NOT_MATCHED_MARKETPLACE_ENABLED": "This song isn't on this device, and it doesn't match to anything in the cloud, so we can't stream it for you here.",
+ "IDS_PLAYLIST_MORE": "More playlists",
+ "IDS_PLAYLIST_MOVE_DOWN": "move down",
+ "IDS_PLAYLIST_MOVE_DOWN_SC": "Move down",
+ "IDS_PLAYLIST_MOVE_TO_BOTTOM": "move to bottom",
+ "IDS_PLAYLIST_MOVE_TO_BOTTOM_SC": "Move to bottom",
+ "IDS_PLAYLIST_MOVE_TO_TOP": "move to top",
+ "IDS_PLAYLIST_MOVE_TO_TOP_SC": "Move to top",
+ "IDS_PLAYLIST_MOVE_UP": "move up",
+ "IDS_PLAYLIST_MOVE_UP_SC": "Move up",
+ "IDS_PLAYLIST_NAME": "Name",
+ "IDS_PLAYLIST_NAME_TITLE": "Name this playlist",
+ "IDS_PLAYLIST_NO_CONTENT_TITLE": "It's lonely in here.",
+ "IDS_PLAYLIST_PAGE_EMPTY_BROWSE_TITLE": "Browse for something new",
+ "IDS_PLAYLIST_PAGE_EMPTY_TEXT": "No songs yet",
+ "IDS_PLAYLIST_PAGE_EMPTY_TITLE": "Add songs!",
+ "IDS_PLAYLIST_PLAYLISTS_ADDED_PLURAL": "[[1]{0} playlist added][[*]{0} playlists added]",
+ "IDS_PLAYLIST_REMOVE": "Remove from playlist",
+ "IDS_POPUP_FILTER_CLOUD_ZERO_SONGS": "No songs in this playlist are in the cloud. Select the link above to show all tracks.",
+ "IDS_POPUP_FILTER_SHOW_ALL_LINK": "Show all music",
+ "IDS_RADIO_ARTIST_NOT_FOUND": "Sorry, we can't start radio for {0}. Please try another artist.",
+ "IDS_RADIO_ARTIST_RESULTS": "Radio",
+ "IDS_RADIO_CARD_LABEL": "Radio",
+ "IDS_RADIO_CARD_LABEL_LC": "radio",
+ "IDS_RADIO_COLLECTION_TITLE": "radio",
+ "IDS_RADIO_CREATE_ACTION": "Start radio",
+ "IDS_RADIO_CREATE_ACTION_LC": "start radio",
+ "IDS_RADIO_EMPTY_GALLERY_ACTION": "Start radio",
+ "IDS_RADIO_EMPTY_GALLERY_TITLE": "It's lonely in here.",
+ "IDS_RADIO_FREE_USER_ACTION": "Try for free",
+ "IDS_RADIO_FREE_USER_SUBTITLE": "Create radio stations based on your favorite artists with an Xbox Music Pass",
+ "IDS_RADIO_FREE_USER_TITLE": "Expand your musical horizons",
+ "IDS_RADIO_LOADING_TEXT": "We are picking music related to {0}",
+ "IDS_RADIO_NONSMARTDJ_ARTIST": "Sorry, we can't start radio for {0}. Please try another artist, or press Play to stream the top songs from {0} instead.",
+ "IDS_RADIO_OFFINE_ERROR_TITLE": "We can't start radio right now.",
+ "IDS_RADIO_PAGE_CREATE_RADIO_ACTION": "Start a station",
+ "IDS_RADIO_PAGE_EMPTY_SUBTITLE": "We will automatically collect any stations you create and keep them here for you.",
+ "IDS_RADIO_PAGE_EMPTY_TITLE": "You’ll see your stations here.",
+ "IDS_RADIO_PAGE_ERROR_GALLERY_TITLE": "We can't retrieve your stations right now.",
+ "IDS_RADIO_PAGE_SIGN_IN_SUBTITLE": "Sign in to see a list of your stations.",
+ "IDS_RADIO_PAGE_SUBTITLE_LINE1": "Enter any artist you like, and we’ll pick similar music for you.",
+ "IDS_RADIO_PAGE_SUBTITLE_LINE2": "Start with any artist, and we’ll pick similar music for you.",
+ "IDS_RADIO_PLAY_FROM_MEDIA_ACTION": "Start radio",
+ "IDS_RADIO_PLAY_FROM_MEDIA_ACTION_LC": "start radio",
+ "IDS_RADIO_PLAYING_TEXT": "Playing radio",
+ "IDS_RADIO_PLAYING_TEXT_LC": "playing radio",
+ "IDS_SMARTDJ_1_FEATURED_ARTIST": "Includes artists like {0}",
+ "IDS_SMARTDJ_2_FEATURED_ARTISTS": "Includes artists like {0}, {1}",
+ "IDS_SMARTDJ_ARTIST_NOT_FOUND": "Sorry, we can't start Smart DJ for {0}. Please try another artist.",
+ "IDS_SMARTDJ_ARTIST_RESULTS": "Smart DJ artists",
+ "IDS_SMARTDJ_CARD_LABEL": "Smart DJ",
+ "IDS_SMARTDJ_CARD_LABEL_LC": "smart dj",
+ "IDS_SMARTDJ_COLLECTION_TITLE": "smart djs",
+ "IDS_SMARTDJ_CREATE_ACTION": "New Smart DJ",
+ "IDS_SMARTDJ_CREATE_ACTION_LC": "new smart dj",
+ "IDS_SMARTDJ_EMPTY_GALLERY_ACTION": "New Smart DJ",
+ "IDS_SMARTDJ_LOADING_TEXT": "Smart DJ is picking music related to {0}",
+ "IDS_SMARTDJ_NONSMARTDJ_ARTIST": "Sorry, we can't start a Smart DJ for {0}. Please try another artist, or press Play to stream the top songs from {0} instead.",
+ "IDS_SMARTDJ_NONSMARTDJ_ARTIST_RESULTS": "Other artists",
+ "IDS_SMARTDJ_OFFINE_ERROR_DESC": "Make sure you have Internet access, then try again.",
+ "IDS_SMARTDJ_OFFINE_ERROR_TITLE": "We can't start Smart DJ right now.",
+ "IDS_SMARTDJ_PAGE_CREATE_SMARTDJ_ACTION": "New Smart DJ",
+ "IDS_SMARTDJ_PAGE_ERROR_GALLERY_TITLE": "It's lonely in here.",
+ "IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION": "Play Smart DJ",
+ "IDS_SMARTDJ_PLAY_FROM_MEDIA_ACTION_LC": "play smart dj",
+ "IDS_SMARTDJ_PLAYING_TEXT": "Playing Smart DJ",
+ "IDS_SMARTDJ_PLAYING_TEXT_LC": "playing smart dj",
+ "IDS_SMARTDJ_POPULAR_ARTISTS_DIALOG_TITLE": "Popular artists",
+ "IDS_SMARTDJ_POPULAR_ARTISTS_ENTRY_TEXT": "Enter artist",
+ "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_ACTION": "Get Xbox Music Pass",
+ "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_DESC": "This is a great time to upgrade! Xbox Music Pass gives you unlimited plays of premium content, with no interruptions. For a low monthly fee, you can use your music pass on your PC, Windows Phone, and Xbox 360.",
+ "IDS_SMARTDJ_PREMIUM_TRACK_ERROR_TITLE": "Sorry, but this song is available only with Xbox Music Pass.",
+ "IDS_WHATSNEW_ABOUT_MUSIC_POPUP_TITLE": "What's new in Music version {0}.{1}.{2}",
+ "IDS_WHATSNEW_ABOUT_XBOX_MUSIC_POPUP_TITLE": "What's new in Xbox Music version {0}.{1}.{2}",
+ "IDS_WHATSNEW_MUSIC_NOTIFICATION_TITLE": "We updated Music!",
+ "IDS_WHATSNEW_MUSIC_POPUP_TITLE": "What's new in Music version {0}.{1}.{2}",
+ "IDS_WHATSNEW_XBOX_MUSIC_NOTIFICATION_TITLE": "We updated Xbox Music!",
+ "IDS_WHATSNEW_XBOX_MUSIC_POPUP_TITLE": "What's new in Xbox Music version {0}.{1}.{2}",
+ "101": "Unknown Song %d",
+ "102": "Unknown Album (%s %s)",
+ "103": "Unknown Album (",
+ "104": "Unknown Artist",
+ "105": "Unknown Song",
+ "106": "the ;",
+ "108": "Various Artists",
+ "109": "Unknown Album",
+ "110": "Unknown Genre",
+ "250": "Unknown Song",
+ "251": "Unknown Artist",
+ "252": "Unknown Album",
+ "258": "Unknown Series",
+ "259": "Unknown Video",
+ "260": "Unknown Series",
+ "261": "We couldn't determine the original series for these podcast episodes. To subscribe, select one or more episodes and enter a URL.",
+ "262": "Couldn't determine the URL for this podcast series. To subscribe to it, select one or more episodes and enter a URL.",
+ "320": "Music",
+ "321": "TV",
+ "322": "Shorts",
+ "323": "Season %1!02d!",
+ "324": "Movies",
+ "325": "Xbox Music Pass",
+ "326": "Purchases",
+ "328": "Subscription Cache",
+ "329": "Downloading",
+ "360": "%1: %2",
+ "361": "audiobook",
+ "362": "audiobook",
+ "363": "comedy / spoken word",
+ "364": "podcast",
+ "365": "karaoke",
+ "5000": "Xbox Event Log",
+ "607": "Smart DJ",
+ "609": "Resume playing",
+ "610": "Shuffle all music",
+ "611": "Podcasts",
+ "612": "Podcast Folder",
+ "613": "Podcast Folder",
+ "618": "Xbox temporary converted files",
+ "619": "OneDrive Cache",
+ "000D1359": "This song is available only when you buy the whole album.",
+ "000D135E": "Sorry, can't go there. Please try again.",
+ "C00D001A": "The item is missing or we can't get to it.",
+ "C00D0029": "If the item is on an external hard drive or network location, make sure you have access to that device or location.",
+ "C00D0BBE": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D0BC0": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D0BCD": "The given property isn't supported.",
+ "C00D0FF5": "To preview or play explicit content, sign in.",
+ "C00D0FF6": "Your privacy & online settings don't allow you to buy explicit content.",
+ "C00D0FF7": "Your privacy & online settings don't allow you to buy things.",
+ "C00D0FF8": "Access to this content is blocked based on the online safety settings for this account. Please sign in to play this content.",
+ "C00D0FF9": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D0FFC": "Can't play the disc because the drive is in use.",
+ "C00D0FFD": "To download explicit content, sign in.",
+ "C00D1051": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1053": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1057": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D1077": "Sorry, this item is unavailable.",
+ "C00D10B7": "Sorry, we can't play this item right now. Please try again later.",
+ "C00D10BD": "Can't play videos because there's a problem with your video card. For troubleshooting help, contact the maker of your computer's video card.",
+ "C00D10D1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D10DE": "Can't play the video because there's a problem with the file. Try renting or buying the video at the Xbox Video Store.",
+ "C00D10DF": "Can't play because the item's file format isn't supported. Make sure your video doesn't have multiple soundtracks.",
+ "C00D10E0": "Can't play this item because the file is too big.",
+ "C00D10E1": "Can't play files that are incompletely downloaded or are corrupted.",
+ "C00D1117": "Sorry, this item is currently unavailable.",
+ "C00D1126": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1198": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1199": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11A1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11B5": "Sorry, we can't download because we can't check usage rights at the moment. Please try again soon!",
+ "C00D11BA": "Can't play. Make sure your computer has a working sound card, then try again.",
+ "C00D11C0": "Sorry, we can't play just now. You might be offline or our service could be down. Make sure you're connected to the Internet, and try again in a while.",
+ "C00D11C3": "Can't play. Make sure you have Internet access, then try again.",
+ "C00D11C6": "Sorry, this app needs a restart. Go to Home, press the menu button on your controller, and choose Quit. Then start the app again.",
+ "C00D11CD": "Please try again. If the problem continues, visit www.xbox.com/support to check for guidance.",
+ "C00D11D1": "Can't play. Make sure your computer's sound and video cards are working and have the latest drivers, then try again.",
+ "C00D11D2": "Can't access the file. Make sure that the file isn't in use, that you can access the place the file is stored, and that your network's proxy settings are correct, then try again.",
+ "C00D11D3": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11D6": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D11DA": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11DF": "Can't play one or more songs. For more information, select an information icon in the now playing list.",
+ "C00D11E7": "Can't play or sync this protected file.",
+ "C00D1204": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D12A2": "Can't sign in. Please try again later.",
+ "C00D12A3": "Can't sign in because access requires a user name and password.",
+ "C00D12A4": "Can't sign in because the server has denied access. Please try again later.",
+ "C00D12A5": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A6": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A7": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A8": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A9": "Can't sign in due to a network error. Make sure you have network access and try again.",
+ "C00D12AA": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12D7": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C00D12DD": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D12E6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12E7": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12F7": "Can't check usage rights. Make sure you have Internet access, then restart the app.",
+ "C00D12F8": "Sorry, can't check usage rights. Please try again in a few minutes.",
+ "C00D1313": "The app closed while trying to update this subscription. Further updates for this subscription will no longer download automatically. Try subscribing to it again or deleting it.",
+ "C00D1333": "Can't find a secure channel. The server certificate isn't valid.",
+ "C00D1334": "Can't find a secure channel. The server certificate is revoked or the revocation list can't be retrieved.",
+ "C00D1335": "Can't find a secure channel. The server certificate was issued by an untrusted certification authority.",
+ "C00D1336": "Can't find a secure channel. The server certificate name doesn't match the server address.",
+ "C00D1337": "Can't find a secure channel. The server certificate is expired.",
+ "C00D1338": "Can't perform this operation. Please try again later.",
+ "C00D1339": "Can't perform the requested action because access requires a user name and password.",
+ "C00D133B": "Can't perform the requested action because the website has denied access. Please try again later.",
+ "C00D133C": "Sorry, this item is no longer available from Xbox. Try searching for it - a newer version might be available.",
+ "C00D1342": "Can't perform the requested action because it's no longer on the website.",
+ "C00D134C": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134D": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134E": "Can't perform the requested action due to a network error. Make sure you have network access and try again.",
+ "C00D134F": "Can't do that because of a temporary server condition. Please try again later.",
+ "C00D1350": "Microsoft Update has encountered an unexpected error. Please try again later.",
+ "C00D1351": "Sorry, we can't connect to Xbox services. Please try again later.",
+ "C00D1352": "Wrong username and password combination.",
+ "C00D1354": "Please sign in to preview or play this item.",
+ "C00D1355": "You're not old enough to play explicit content.",
+ "C00D1356": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D1357": "Can't purchase or download media from multiple online stores.",
+ "C00D1358": "Can't purchase or download the item. It might not be available.",
+ "C00D135A": "Can't identify the provider of this item.",
+ "C00D135B": "This song can be downloaded only when you buy the whole album.",
+ "C00D135C": "You've used up all of your downloads for this item.",
+ "C00D135D": "You've reached the maximum number of things you can buy at one time.",
+ "C00D135F": "Can't sign in. Make sure you're using the right email address and password. The Xbox service might be temporarily unavailable.",
+ "C00D1360": "Can't download this item because the server isn't responding. The server might be temporarily unavailable or you may have lost your Internet connection.",
+ "C00D1363": "The folder couldn't be opened. It might have been moved or deleted.",
+ "C00D1365": "To play this, we need to confirm usage rights. Please sign in with the Microsoft account you were using when you bought it.",
+ "C00D1366": "Can't download because there's not enough storage space for this item.",
+ "C00D1367": "Can't sign in. Please try again later.",
+ "C00D136C": "The email address and password that you entered are not linked to an Xbox profile. Enter a different Microsoft account (email address and password), or use these to create a new Microsoft account.",
+ "C00D136D": "Can't sign in because the Xbox service isn't yet available in your region.",
+ "C00D136E": "The email address and password that you entered are not linked to an Xbox profile. To use these credentials, first sign in at Xbox.com, then sign in to this app again.",
+ "C00D136F": "There's a serious error with your Xbox account.",
+ "C00D1371": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D1372": "Can't download. Make sure the media folder specified in software settings is accessible and that there's enough space on your hard disk.",
+ "C00D1374": "Sorry, can't sign in right now.",
+ "C00D1375": "You need to change your gamertag.",
+ "C00D1376": "Our terms of service have been updated. Select Terms of Service to read and accept the terms in a web browser, then return to this screen to sign in.",
+ "C00D1377": "Your Xbox account has been suspended.",
+ "C00D1378": "Your Xbox account has been suspended.",
+ "C00D1379": "Sorry, can't access your account right now. Please try again later.",
+ "C00D137B": "The item wasn't found. Please try again later.",
+ "C00D137C": "This item can't be previewed, purchased, or downloaded.",
+ "C00D137D": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C00D137E": "Sorry, we can't connect to Xbox services right now. Please try again later.",
+ "C00D137F": "Sorry, Xbox stores aren't yet available in your location. Please check back!",
+ "C00D1380": "That didn't work the way it was supposed to. Please try again.",
+ "C00D1381": "Sorry, we don't have the right album info for this.",
+ "C00D1382": "The Xbox service didn't return valid purchase information.",
+ "C00D1383": "The Xbox service didn't return valid sign in information.",
+ "C00D1384": "Can't provide your Microsoft Points balance right now.",
+ "C00D1385": "Need to check usage rights. Please sign in.",
+ "C00D1387": "The destination download folder doesn't exist. Check that the media folder in the software general settings is set correctly.",
+ "C00D1388": "Sorry, sign-in isn't supported in your region at this time.",
+ "C00D1391": "Before we can sign you in, we need you to verify your age. To continue, go to www.xbox.com/verifyage.",
+ "C00D1392": "Sorry, we can't sign you in due to age requirements for your region. For more information, go to www.xbox.com/verifyage.",
+ "C00D1393": "You're not old enough to download explicit content.",
+ "C00D1395": "Please sign in at Xbox.com and make sure your payment info is up to date.",
+ "C00D1396": "The app update is pending and this app needs a restart. Go to Home, press the menu button on your controller, and choose Quit. Then start the app again.",
+ "C00D1397": "Before we can sign you in, we need you to verify your email account. To continue, go to https://account.live.com and sign in.",
+ "C00D2718": "Can't play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C00D2719": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one. If you just renewed your Xbox Music Pass, please sign out and sign in again.",
+ "C00D271A": "To play this item, we need to check the usage rights for it. Please sign in with the profile you were using when you bought it.",
+ "C00D271D": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D271E": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2721": "Sorry, we can't do what you wanted because there's a problem with your computer's usage rights.%0.",
+ "C00D272B": "Sorry, can't play or download. Please try again in a few minutes.",
+ "C00D274D": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D2759": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2781": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D27D8": "Usage rights for this item have expired. To play it, sign in.",
+ "C00D27D9": "The usage rights for this item aren't active yet. Try again at a later date.",
+ "C00D27DB": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D280A": "Sorry, you need a newer computer to play or download this item.",
+ "C00D2841": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D284F": "Your rental has expired. To play this video, rent it again or buy it.",
+ "C00D2850": "You've already rented this video for this device. To get ready to watch it, select Download.",
+ "C00D2904": "To play this content, your computer's video card, video driver, analog video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2905": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's video card doesn't work with it. Update your video card, then try again.",
+ "C00D2906": "To play this item, your video card, video driver, and screen must each be compliant with HDCP copy protection. One or more of them is not. To check HDCP compliance, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2907": "To play this content, your computer's video card, video driver, analog video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2908": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D2909": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D290B": "Your current display setting is in clone (duplicate) mode. The current content cannot be viewed in this mode. Try changing the display settings to extended mode.",
+ "C00D2EED": "The proxy server couldn't be located. Please check your proxy server configuration.",
+ "C00D32E0": "To listen, connect speakers or headphones to your computer.",
+ "C00D36B2": "Choose a shorter path or file name. Current path or file name is too long. The file path and name can be up to 200 characters.",
+ "C00D36B4": "This item is in a format we don't support. Please choose something else.",
+ "C00D36C4": "This item's file format may be unsupported, the file extension may be incorrect, or the file may be corrupted.",
+ "C00D36E6": "Sorry, we're not sure what happened. Please try again later.",
+ "C00D36FA": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D36FF": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D4E86": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D5212": "This item was encoded in a format that's not supported.",
+ "C00D715D": "Sorry, you can't play rights-managed content while you're debugging. Finish your analysis, then try again.",
+ "C1010003": "To continue using this app, install the latest version.",
+ "C1010005": "Can't access the server. Make sure that there are no firewalls or proxy servers blocking access to the Xbox service, then try again.",
+ "C1010008": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C1010017": "The Xbox LIVE Terms of Service have been updated. The parent associated with this account must read and accept the new terms before you can sign in.",
+ "C101001C": "Can't retrieve the computer name.",
+ "C101001D": "Can't retrieve the computer name.",
+ "C101001F": "There might be a problem with your network connection or an error in the web address you entered. Check your network connection and, if applicable, the URL. Then try again.",
+ "C1010023": "Sign-in isn't available in your region.",
+ "C1010026": "This item can't be purchased on your computer. To download or watch it, use your Xbox 360 console.",
+ "C1010027": "Your network is too slow for instant playback, so your video will be downloaded to ensure optimal viewing. You'll find this item in your video collection once the download is complete.",
+ "C1010028": "Your network is too slow for instant playback. To ensure optimal viewing, download this video instead of trying to stream it.",
+ "C1010029": "This item is no longer available, or is available only for purchase and can't be downloaded using an Xbox Music Pass.",
+ "C101002A": "Can't complete the download. Please try again later.",
+ "C1010030": "You can leave feedback only on things you've bought. If you own this item, go to the Users page in PC settings and sign in to Windows with the Microsoft account you were using when you bought it, then try posting feedback again.",
+ "C1010036": "To continue, sign in.",
+ "C1010064": "Smart DJ is currently unavailable. Please try again later.",
+ "C1010065": "Songs from Xbox Music weren't added to this playlist because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010066": "This playlist wasn't refreshed because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010067": "This playlist couldn't be refreshed because similar songs couldn't be found.",
+ "C1010070": "Sorry, we can't post your review, due to either a network error or the contents of your review. Please check your Internet connection. Also, make sure none of the language in your review is offensive. If the problem continues, wait a while and then try again.",
+ "C101008D": "Sorry, can't play. Please try again.",
+ "C101008E": "Couldn't play because of a network problem. Please try again.",
+ "C101008F": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010090": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010091": "Sorry, we're not sure what happened there. Please try again.",
+ "C1010094": "This song requires an Xbox Music Pass. To play the song, sign up for an Xbox Music Pass or sign in with an account that has one.",
+ "C1010095": "To stream rights-managed music or video to another device, that device needs to support the media rights management (DRM) for that content. Make sure you are signed in with the same account on both devices, or play content that's not rights-managed.",
+ "C1010098": "Access to this content is blocked based on the online safety settings for this account.",
+ "C1010099": "Make sure this media file has been added to your media library and try to play it from media library gallery of the application.",
+ "C101009A": "To play premium content, please ensure your build of Windows is signed with the official Microsoft Windows Production certificate.",
+ "C101009B": "Another app is controlling your sound right now. To listen here, close that app and try again.",
+ "C101009C": "That one is either corrupted or in a format we can't play.",
+ "C101009D": "If you are using remote desktop, try streaming or downloading on your local PC instead.",
+ "C101009E": "This song is not available on this device. The item doesn't match to anything in the cloud, so we can't stream it for you here.",
+ "C101009F": "The connection to your TV was lost.",
+ "C10100A0": "We cannot play from the file locations for those songs in that playlist.",
+ "C10100A1": "We cannot play on your receiver at this moment. Please disconnect your receiver and try again.",
+ "C10100A2": "Sorry, we couldn't play that. It looks like your audio or video device isn't using Windows certified drivers. Try again after installing the latest official drivers. The following files are not certified:",
+ "C10100C8": "Automatic refreshing has been disabled for this playlist due to poor performance. Editing the playlist rules to reduce list size might improve performance.",
+ "C10100C9": " ZUNE_E_MAXIMUM_PLAYLIST_LENGTH_EXCEEDED",
+ "C10100DD": "Couldn't download to your library. That path is no longer available. If you're using external storage, make sure it's available and connected.",
+ "C10100DE": "Your media library is currently write protected and preventing us from downloading. Please remove the write protection and try again.",
+ "C10100DF": "Couldn't download to your library. Your library doesn't contain any folders that are not associated with a cloud storage service.",
+ "C1010100": "Sorry, not sure what happened there. Close and reopen the app, then try again.",
+ "C1010101": "If the item is on an external hard drive, make sure the drive is connected and turned on.",
+ "C1010102": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C1010103": "This item is in a format we don't support. Please choose something else.",
+ "C1010104": "Make sure your video cable and TV both support HDCP copy protection. Also, check with the maker of your computer's video card to see if there's an HDCP-compliant driver for it.",
+ "C1010105": "Make sure the item you're trying to play is available locally. This app doesn't support playing over remote desktop.",
+ "C1010106": "Your version of Windows doesn't support playing music or video.",
+ "C1010107": "Wait a few moments, then try again.",
+ "C1010108": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one.",
+ "C1010109": "Can't Play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C101010B": "Can't play because we can't check usage rights. Make sure your PC's clock and time zone are set correctly, then try again.",
+ "C101010C": "Your TV or monitor does not support the copy protection technology required to play this content.",
+ "C101010D": "This song is not available through Xbox Music.",
+ "C101010F": "Can't play the item because it is being used by another application.",
+ "C1010140": "The item contains a sync ID reference to another item that does not exist in the local replica.",
+ "C1010141": "The item exists in the database but has not yet been assigned a sync ID.",
+ "C1010142": "The item contains a variable type sync ID reference but does not contain the sync type.",
+ "C1010143": "The item is missing a property that is required by the schema.",
+ "C1010144": "The message did not contain an item of the expected type.",
+ "C101014B": "Sorry, we can't download this right now. Wait a while, then try again.",
+ "C10101C2": "We've stopped playing because you've reached your data limit and we thought you should know. To resume, select Play.",
+ "C10101C3": "We've stopped playing because you're nearing your data limit and we don't want you to unknowingly exceed it. To resume, select Play.",
+ "C10101C4": "We've stopped playing because you're now connected to a metered network where you could quickly exceed your data limit. To resume, select Play.",
+ "C101A000": "Request completed successfully.",
+ "C101A001": "There was a problem. Please try again later.",
+ "C101A002": "There was a problem. Please try again later.",
+ "C101A003": "Can't complete your request. Make sure you've entered the right info, then try again.",
+ "C101A004": "To use this app, make sure you are signed in to your Xbox account.",
+ "C101A005": "Can't complete your request. Please try again later.",
+ "C101A006": "There was a problem. Please try again later.",
+ "C101A007": "There was a problem. Please try again later.",
+ "C101A008": "Can't complete your request because you have one or more duplicate entries. Check that you've entered valid information, then try again.",
+ "C101A009": "Can't complete your request. You've made too many service requests in a short time. Please try again later.",
+ "C101A010": "Can't complete your request. Check that you've entered valid information, then try again.",
+ "C101A053": "We can't check the playback rights for this item right now. Please try again later. Make sure to sign in with an account that matches the region setting of your device.",
+ "C101A054": "There was a problem. Please try again later. ",
+ "C101A055": "Sorry, this item is no longer available.",
+ "C101A1F8": "There was a problem. Please try again later.",
+ "C101A1F9": "To complete your request, a parent needs to sign in.",
+ "C101A1FA": "That isn't the right parent account. Please try again.",
+ "C101A1FB": "Sorry, we couldn't get the info we needed. Please try again later.",
+ "C101A1FC": "There was a problem. Please try again later.",
+ "C101A20D": "There was a problem. Please try again later.",
+ "C101A20E": "There was a problem. Please try again later.",
+ "C101A20F": "There was a problem. Please try again later.",
+ "C101A211": "There was a problem. Please try again later.",
+ "C101A212": "There was a problem. Please try again later.",
+ "C101A213": "There was a problem. Please try again later.",
+ "C101A214": "There was a problem. Please try again later.",
+ "C101A215": "There was a problem. Please try again later.",
+ "C101A216": "There was a problem. Please try again later.",
+ "C101A217": "There was a problem. Please try again later.",
+ "C101A218": "There was a problem. Please try again later.",
+ "C101A219": "There was a problem. Please try again later.",
+ "C101A21A": "There was a problem. Please try again later.",
+ "C101A21B": "You haven't accepted the Xbox LIVE Terms of Service. To continue, please review and accept the terms.",
+ "C101A21C": "There was a problem. Please try again later.",
+ "C101A230": "Please enter a gamertag and try again.",
+ "C101A231": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A232": "There was a problem. Please try again later.",
+ "C101A233": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A234": "There was a problem. Please try again later.",
+ "C101A235": "There was a problem. Please try again later.",
+ "C101A236": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A237": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A238": "Can't complete your request due to age restrictions. Your parent would need to change your account permissions in Account Settings, Privacy, Family Settings.",
+ "C101A239": "Can't sign in. Please check and correct your account details, then try again.",
+ "C101A23A": "There was a problem. Please try again later.",
+ "C101A23B": "There was a problem. Please try again later.",
+ "C101A23D": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A23E": "There was a problem. Please try again later.",
+ "C101A241": "Sorry, the item you're trying to buy is no longer available.",
+ "C101A242": "There was a problem. Please try again later.",
+ "C101A243": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A244": "Sorry, that subscription isn't available anymore.",
+ "C101A245": "There was a problem. Please try again later.",
+ "C101A246": "There's no Xbox profile associated with your current Microsoft account. To get the most from this app, create an Xbox profile using this email and password combination.",
+ "C101A247": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A248": "There was a problem. Please try again later.",
+ "C101A249": "There was a problem. Please try again later.",
+ "C101A24A": "There was a problem. Please try again later.",
+ "C101A24B": "You need to be signed in to play this. Sign in, then try again.",
+ "C101A24D": "Can't sign in right now. Please try again later.",
+ "C101A24E": "The Xbox LIVE Code of Conduct doesn't permit your gamertag. You must change it before you can use the Xbox service.",
+ "C101A3E9": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3EA": "This item's price has changed.",
+ "C101A3EB": "The item wasn't found. Please try again later.",
+ "C101A3EC": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3ED": "You've exhausted the number of times you can restore this item.",
+ "C101A3EE": "Sorry, you can't stream music or video when you're outside of the region for your profile.",
+ "C101A3EF": "You don't have enough Microsoft Points to complete the purchase.",
+ "C101A3F0": "You've used or purchased the maximum number of Microsoft Points for today. Please try again tomorrow.",
+ "C101A3F1": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A3F2": "To protect your account, Xbox limits the number of purchases in a 24-hour period. Please try again later.",
+ "C101A3F3": "Your Xbox Music Pass has expired. To play this music, sign up for a new pass in Settings, Account, Xbox Music Pass.",
+ "C101A3F4": "You're using an unsupported version of this Xbox app.",
+ "C101A3F5": "Can't play because the item's usage rights are no longer valid. Try deleting this item and downloading it again.",
+ "C101A3F6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C101A3F7": "Sorry, we're not sure what happened there. Please try again.",
+ "C101A3F8": "Xbox can't issue the requested rights.",
+ "C101A3F9": "You're using an unsupported version of this Xbox app.",
+ "C101A3FA": "Please use an SSL connection to sign in.",
+ "C101A3FB": "Can't sign in.",
+ "C101A3FC": "The license is corrupt or not valid.",
+ "C101A3FD": "The content owner for the license you just acquired requires that your device be linked to this computer.",
+ "C101A3FF": "Sorry, this item is unavailable.",
+ "C101A400": "To protect your account, the number of purchases you can make in a 24-hour period is limited. Please try again later.",
+ "C101A410": "Can't remove this computer or device. You've already removed one from this Xbox Music Pass in the last 30 days.",
+ "C101A411": "You're downloading songs from Xbox Music on the maximum allowed devices. You might still be able to stream music here, you just can't download it.",
+ "C101A412": "Sorry, you don't have enough song credits for this purchase. To complete your purchase, buy Microsoft Points in Account Settings.",
+ "C101A413": "Sorry, this code has already been redeemed. Enter a new code or use Microsoft Points for your purchase.",
+ "C101A414": "The offer you're trying to use isn't valid.",
+ "C101A415": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A416": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A417": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A418": "Can't purchase because the Xbox service isn't yet available in your region.",
+ "C101A419": "This song has been removed from Xbox Music at the request of the copyright holder.",
+ "C101A7D1": "Need to check usage rights. Please sign in to the account you used to purchase the item.",
+ "C101A7D2": "The item wasn't found. Please try again later.",
+ "C101A7D3": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A7D4": "This song is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "C101A7D5": "Sorry, we can't play or download because we can't check usage rights at the moment. Please try again soon!",
+ "C101A7D8": "You've exceeded the number of videos you can stream at the same time. To watch the current video, stop one of your other streams and then start this one again.",
+ "C101A7DA": "You've exceeded the number of videos you're allowed to stream at the same time. To watch the current video, stop one of your other streams, and then start this one again.",
+ "C101A7DB": "You've exceeded the number of songs you're allowed to stream at the same time. To listen to the current song, stop one of your other streams, and then start this one again.",
+ "C101A7DC": "This song can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "C101A7DD": "Sorry, this song isn't available here. Try a different one.",
+ "C101A7E1": "Sorry, you've used up the number of simultaneous streams for this video. Your video will stop.",
+ "C101A7E2": "Sorry, you've used up the number of simultaneous streams for this song. Your song will stop.",
+ "C101A9C5": "Can't sign in. Please try again later.",
+ "C101A9C6": "Can't sign in. Please try again later.",
+ "C101A9C7": "Can't sign in. Please try again later.",
+ "C101A9C8": "Can't sign in. Please try again later.",
+ "C101A9C9": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Devices.",
+ "C101A9CA": "Can't stream this song, possibly because you're already streaming from another location. Try again later.",
+ "C101A9CB": "Sorry, can't connect to Xbox services. Please try again later.",
+ "C101A9CC": "Can't complete your transaction. Please try again later.",
+ "C101A9CD": "Can't complete your transaction. Please try again later.",
+ "C101A9CE": "Can't connect to Xbox. Your account is in use somewhere else.",
+ "C101A9CF": "Can't complete your transaction. Please try again later.",
+ "C101A9D4": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D5": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D6": "This song is no longer available using Xbox Music Pass.",
+ "C101AB55": "You have reached the limit for the number of tracks you may play before logging in.",
+ "C101AB6A": "The license for this content has expired. Please delete the file and download it again from your collection.",
+ "C101ABB9": "Can't complete your transaction. Please try again later.",
+ "C101ABBA": "Can't download media usage rights. Please try again later.",
+ "C333000B": "Failed to acquire a license for the content. Make sure your device has all of the necessary certificates.",
+ "C33305DD": "Your parent has restricted your account.",
+ "C33307D2": "The content cannot be licensed in this country/region.",
+ "C33307D3": "To view this content you need to be in the region for your Xbox profile. If you've moved permanently, change your region at account.xbox.com.",
+ "C33307D5": "This rental has expired.",
+ "C33307D8": "The maximum download count has been reached.",
+ "C33307D9": "Please sign in.",
+ "C33307DA": "Unable to acquire usage rights for the content.",
+ "C3330835": "The maximum number of concurrent streams for this content has been reached.",
+ "C3330837": "Your account has reached the maximum number of simultaneous streams.",
+ "C3330838": "The maximum number of concurrent streams for this content has been reached.",
+ "IDS_APP2_PAGE_TITLE_PRIMARY": "{0} - {1}",
+ "IDS_APP2_PAGE_TITLE_PRIMARY_SECONDARY": "{0} - {1} - {2}",
+ "IDS_DETAILS_INFO_SEPERATOR": ", ",
+ "IDS_DETAILS_SLASH_SEPERATOR": " / ",
+ "IDS_EMPTY_SYMBOL": "--",
+ "IDS_FILTER_IN": "{0}",
+ "IDS_MANIFEST_TEST_APP_NAME": "Xbox",
+ "IDS_MANIFEST_TEST_APP_SHORT_NAME": "Xbox",
+ "IDS_MUSIC_SMARTDJ_PIVOT": "smart dj",
+ "IDS_MUSIC_SMARTDJ_PIVOT_TC": "Smart DJ",
+ "IDS_SETTINGS_ABOUT_SUPPORT_WEB_LINK": "http://support.xbox.com",
+ "IDS_SETTINGS_IMPRINT_LEGAL_LINK_TITLE": "Impressum",
+ "IDS_SNAPPED_MUSIC_GO_FULLSCREEN_TITLE": "Xbox Music",
+ "IDS_SNAPPED_VIDEO_GO_FULLSCREEN_TITLE": "Xbox Video",
+ "IDS_TITLE_SUBTITLE": "{0} ({1})",
+ "IDS_WILD_CARD_SYMBOL": "*",
+ "IDS_XBOX_MUSIC2_APP_TITLE": "Xbox Music",
+ "IDS_XBOX_VIDEO2_APP_TITLE": "Xbox Video",
+ "IDS_MUSIC_ONEDRIVE_ANNOUNCEMENT": "Xbox Music and OneDrive integration is part of an experimental project, for internal testing only.",
+ "213": "MDRCD_%s.xml",
+ "256": "%1!02d! %2",
+ "257": "%1!02d! %2 (disc %3!d!)",
+ "27": "Playlists",
+ "30": "Xbox Temporary Music",
+ "327": "Xbox Music",
+ "33": "%1 (%2)"
+ },
+ "MicrosoftAdvertising": {
+ "ExceptionMessages": {
+ "AdGameComponentAlreadyInitialized": "AdGameComponent has already been initialized.",
+ "AdGameComponentHasNotBeenInitialized": "AdGameComponent has not been initialized.",
+ "AdManagerNotInitialized": "AdManager has not been initialized.",
+ "AdMangerAlreadyInitialized": "AdManager has already been initialized with a different ApplicationId.",
+ "AdUnitIdAlreadySet": "AdUnitId has already been set.",
+ "AllActionsMalformed": "All found actions were malformed.",
+ "ApplicationIdIsRequired": "applicationId is required.",
+ "AssetNodeIsSingleEntry": "Asset node is a single entry.",
+ "AutoRefreshStateAlreadySet": "Refresh state has already been set.",
+ "BannerInformationNotFound": "Banner information is not found.",
+ "CapabilitiesMissing": "Required capabilities are missing from manifest (%s): %s.",
+ "ClickToRichUrlWithoutReferralNotWellFormed": "Click to rich media url without referral is not well formed: {0}.",
+ "ClickToRichUrlWithReferralNotWellFormed": "Click to rich media url with referral is not well formed: {0}.",
+ "CouldNotFindProperty": "Could not find property: %s.",
+ "DecodingEscapedCharactersFailed": "Decoding escaped characters failed, more output characters than expected.",
+ "DidNotParseToEnd": "Did not parse until the end.",
+ "ExtractedPropertyNotAString": "Extracted property not of string type: {0}.",
+ "FontDoesNotSupportCharacter": "Font does not support character: {0}.",
+ "GeoDataNotAvailable": "No latitude and longitude data available.",
+ "HttpRequestFailedWithStatusCode": "HTTP request failed with status code: %d.",
+ "HttpResponseContainedNoContent": "Server response contained no content.",
+ "IncompleteInit": "ApplicationId and AdUnitId need to be set before using this control.",
+ "InternalError": "Internal error encountered.",
+ "InvalidAction": "Invalid action param: {0}.",
+ "InvalidDataFormat": "Invalid data format: %s.",
+ "InvalidJsonResponse": "Invalid JSON response: %s.",
+ "InvalidLocation": "The Location value is out of range.",
+ "InvalidParameterMissingItemSeparator": "Invalid Parameter, missing item separator.",
+ "InvalidRefresh": "Refresh cannot be used when auto refresh is enabled.",
+ "InvalidSize": "The rectangle dimensions do not meet the minimum size requirements ({0}x{1}).",
+ "JsonDoesntStartWithObjectOrArray": "Server JSON response does not start with object/array.",
+ "JsonIntegerParseOverflow": "Number being parsed is too big: {0}.",
+ "JsonNodeIsNotADictionary": "Json node is not a dictionary.",
+ "JsonResponseTypeInvalid": "Invalid JSON response type.",
+ "JsonStringValueNotWellFormed": "Json string value not well formed.",
+ "LoadContentNotCalled": "LoadContent has not been called before Update/Draw.",
+ "NonPremiumWithNoApplicationId": "Non-premium ads require the manager to be created with a non-null, non-empty applicationID.",
+ "ObjectShouldHaveNoElements": "Object should have no elements yet, but it does.",
+ "ParameterIsLessThanPermittedLength": "Parameter is less than permitted length: {0} < {1}.",
+ "ParameterNullOrEmpty": "Parameter is null or empty.",
+ "ParseStackNotEmpty": "Parsing stack not empty, some nodes not parsed completely.",
+ "ParseStringNotANumber": "Not a valid number to be parsed.",
+ "RectangleHeightNotSufficient": "Rectangle height not sufficient for a single line of text. Height should be at least: {0}.",
+ "RefreshWhileEngaged": "Manual refresh not permitted while ad is engaged.",
+ "RefreshWhileRequestInProgress": "Refresh was triggered but another request is already in progress.",
+ "RequestDataHasNullDataItem": "httpRequestData or its URL is null.",
+ "RichMediaInfoNotFound": "Rich media information not found.",
+ "StringContainsInvalidEscapeSequence": "String contains invalid escape sequences.",
+ "TextAdTitleNotFound": "Mandatory title for text ad not found.",
+ "TooManyImpressionUrls": "Number of impression entries exceeds the limit: {0}.",
+ "UnableToFitText": "Unable to fit text in the given space.",
+ "UnicodeCharacterTruncated": "Unicode character is truncated.",
+ "UnknownAdType": "Unknown ad type: {0}.",
+ "UnknownJsonToken": "Unknown token encountered: {0}.",
+ "UnknownRichMediaMimeType": "Unknown rich media mime type recieved: {0}."
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/resources/generic.json b/packages/microsoft.zunemusic/resources/generic.json
new file mode 100644
index 00000000..d865b30a
--- /dev/null
+++ b/packages/microsoft.zunemusic/resources/generic.json
@@ -0,0 +1,624 @@
+{
+ "Files": {
+ "animations": {
+ "animations.css": "animations\\animations.css",
+ "controlsAnimations.css": "animations\\controlsAnimations.css",
+ "GalleryAnimations.css": "animations\\GalleryAnimations.css",
+ "HubStripAnimations.css": "animations\\HubStripAnimations.css",
+ "HubStripAnimations.js": "animations\\HubStripAnimations.js",
+ "ImmersiveDetailsAnimations.css": "animations\\ImmersiveDetailsAnimations.css",
+ "ShellAnimations.css": "animations\\ShellAnimations.css",
+ "SocialAnimations.css": "animations\\SocialAnimations.css",
+ "SocialAnimations.js": "animations\\SocialAnimations.js"
+ },
+ "Components": {
+ "Accounts": {
+ "AcceptTermsOfService.js": "Components\\Accounts\\AcceptTermsOfService.js",
+ "AccountProvisioningDialog.html": "Components\\Accounts\\AccountProvisioningDialog.html",
+ "AccountProvisioningDialog.js": "Components\\Accounts\\AccountProvisioningDialog.js"
+ },
+ "Immersive": {
+ "Music": {
+ "ArtistOverview.html": "Components\\Immersive\\Music\\ArtistOverview.html",
+ "ArtistOverview.js": "Components\\Immersive\\Music\\ArtistOverview.js",
+ "MoreArtistAlbums.html": "Components\\Immersive\\Music\\MoreArtistAlbums.html",
+ "MoreArtistOverview.html": "Components\\Immersive\\Music\\MoreArtistOverview.html",
+ "MoreArtistOverviewGeneric.html": "Components\\Immersive\\Music\\MoreArtistOverviewGeneric.html"
+ },
+ "Shared": {
+ "BaseImmersiveOverviewSummary.js": "Components\\Immersive\\Shared\\BaseImmersiveOverviewSummary.js",
+ "BaseImmersiveSummary.js": "Components\\Immersive\\Shared\\BaseImmersiveSummary.js",
+ "Hero.html": "Components\\Immersive\\Shared\\Hero.html",
+ "Hero.js": "Components\\Immersive\\Shared\\Hero.js",
+ "MoreGalleryControl.html": "Components\\Immersive\\Shared\\MoreGalleryControl.html",
+ "MoreGalleryControl.js": "Components\\Immersive\\Shared\\MoreGalleryControl.js",
+ "RelatedGridItems.html": "Components\\Immersive\\Shared\\RelatedGridItems.html",
+ "RelatedGridItems.js": "Components\\Immersive\\Shared\\RelatedGridItems.js",
+ "RelatedItems.html": "Components\\Immersive\\Shared\\RelatedItems.html",
+ "RelatedItems.js": "Components\\Immersive\\Shared\\RelatedItems.js"
+ },
+ "Immersive.html": "Components\\Immersive\\Immersive.html",
+ "Immersive.js": "Components\\Immersive\\Immersive.js",
+ "ImmersiveNavStub.html": "Components\\Immersive\\ImmersiveNavStub.html"
+ },
+ "ImmersiveDetails": {
+ "InformationArchitecture.js": "Components\\ImmersiveDetails\\InformationArchitecture.js",
+ "SnappedDetails.html": "Components\\ImmersiveDetails\\SnappedDetails.html",
+ "SnappedDetails.js": "Components\\ImmersiveDetails\\SnappedDetails.js",
+ "SnappedMovieDetails.html": "Components\\ImmersiveDetails\\SnappedMovieDetails.html",
+ "SnappedMovieDetails.js": "Components\\ImmersiveDetails\\SnappedMovieDetails.js"
+ },
+ "InlineDetails": {
+ "ActionButtonsControl.html": "Components\\InlineDetails\\ActionButtonsControl.html",
+ "MusicAlbumInlineDetails.html": "Components\\InlineDetails\\MusicAlbumInlineDetails.html",
+ "MusicArtistInlineDetails.html": "Components\\InlineDetails\\MusicArtistInlineDetails.html",
+ "MusicInlineDetailsDemo.html": "Components\\InlineDetails\\MusicInlineDetailsDemo.html",
+ "MusicInlineDetailsDemo.js": "Components\\InlineDetails\\MusicInlineDetailsDemo.js",
+ "MusicPlaylistInlineDetails.html": "Components\\InlineDetails\\MusicPlaylistInlineDetails.html",
+ "MusicPlaylistInlineDetails.js": "Components\\InlineDetails\\MusicPlaylistInlineDetails.js",
+ "TvEpisodeInlineDetails.html": "Components\\InlineDetails\\TvEpisodeInlineDetails.html",
+ "TvEpisodeInlineDetails.js": "Components\\InlineDetails\\TvEpisodeInlineDetails.js",
+ "TvSeriesInlineDetails.html": "Components\\InlineDetails\\TvSeriesInlineDetails.html",
+ "TvSeriesInlineDetails.js": "Components\\InlineDetails\\TvSeriesInlineDetails.js"
+ },
+ "Music": {
+ "AppServices.js": "Components\\Music\\AppServices.js",
+ "CloudGrovelInfo.html": "Components\\Music\\CloudGrovelInfo.html",
+ "CloudMatchIconDialog.html": "Components\\Music\\CloudMatchIconDialog.html",
+ "CloudMatchOptInDialog.html": "Components\\Music\\CloudMatchOptInDialog.html",
+ "FeaturedMusicAdFreeView1.html": "Components\\Music\\FeaturedMusicAdFreeView1.html",
+ "FeaturedMusicAdFreeView2.html": "Components\\Music\\FeaturedMusicAdFreeView2.html",
+ "FeaturedMusicView1.html": "Components\\Music\\FeaturedMusicView1.html",
+ "FeaturedMusicView2.html": "Components\\Music\\FeaturedMusicView2.html",
+ "FeaturedMusicViewDemo.html": "Components\\Music\\FeaturedMusicViewDemo.html",
+ "FindAlbumInfo.html": "Components\\Music\\FindAlbumInfo.html",
+ "IMusicStateHandlers.js": "Components\\Music\\IMusicStateHandlers.js",
+ "LocalGrovelInfo.html": "Components\\Music\\LocalGrovelInfo.html",
+ "Music.html": "Components\\Music\\Music.html",
+ "MusicBrandDialog.html": "Components\\Music\\MusicBrandDialog.html",
+ "MusicCollection.js": "Components\\Music\\MusicCollection.js",
+ "MusicCollectionTemplates.html": "Components\\Music\\MusicCollectionTemplates.html",
+ "MusicDashboardTemplates.html": "Components\\Music\\MusicDashboardTemplates.html",
+ "MusicDemoModel.js": "Components\\Music\\MusicDemoModel.js",
+ "MusicFeatures.js": "Components\\Music\\MusicFeatures.js",
+ "MusicFullScreenNowPlaying.html": "Components\\Music\\MusicFullScreenNowPlaying.html",
+ "musicia.js": "Components\\Music\\musicia.js",
+ "MusicPageHost.html": "Components\\Music\\MusicPageHost.html",
+ "MusicPages.js": "Components\\Music\\MusicPages.js",
+ "MusicPagesVertical.html": "Components\\Music\\MusicPagesVertical.html",
+ "MusicPanels.html": "Components\\Music\\MusicPanels.html",
+ "MusicSharedTemplates.html": "Components\\Music\\MusicSharedTemplates.html",
+ "MusicSharedTemplatesControls.js": "Components\\Music\\MusicSharedTemplatesControls.js",
+ "MusicSpotlightView1.html": "Components\\Music\\MusicSpotlightView1.html",
+ "MusicSpotlightView2.html": "Components\\Music\\MusicSpotlightView2.html",
+ "MusicSpotlightViewDemo.html": "Components\\Music\\MusicSpotlightViewDemo.html",
+ "MusicUtilities.js": "Components\\Music\\MusicUtilities.js",
+ "MusicWelcomeView.html": "Components\\Music\\MusicWelcomeView.html",
+ "MusicWelcomeView.js": "Components\\Music\\MusicWelcomeView.js",
+ "PlayPlaylist.html": "Components\\Music\\PlayPlaylist.html",
+ "PurchaseMusic.js": "Components\\Music\\PurchaseMusic.js",
+ "ResetCloudCollection.html": "Components\\Music\\ResetCloudCollection.html",
+ "ResetCloudCollection.js": "Components\\Music\\ResetCloudCollection.js",
+ "TransferNotificationHandler.js": "Components\\Music\\TransferNotificationHandler.js"
+ },
+ "Music1": {
+ "AlbumDetailsPage.html": "Components\\Music1\\AlbumDetailsPage.html",
+ "AlbumMetadataEditDialog.html": "Components\\Music1\\AlbumMetadataEditDialog.html",
+ "apphelper.js": "Components\\Music1\\apphelper.js",
+ "ArtistDetailsPage.html": "Components\\Music1\\ArtistDetailsPage.html",
+ "CollectionPageDelayedScripts.html": "Components\\Music1\\CollectionPageDelayedScripts.html",
+ "CollectionPageTemplate.html": "Components\\Music1\\CollectionPageTemplate.html",
+ "CreateWebPlaylistAction.js": "Components\\Music1\\CreateWebPlaylistAction.js",
+ "DemoExplorePageTemplate.html": "Components\\Music1\\DemoExplorePageTemplate.html",
+ "DemoRadioPageTemplate.html": "Components\\Music1\\DemoRadioPageTemplate.html",
+ "DevicesPage.html": "Components\\Music1\\DevicesPage.html",
+ "ExplorePage.html": "Components\\Music1\\ExplorePage.html",
+ "FreeStreamingIsGoneAnnouncementDialog.html": "Components\\Music1\\FreeStreamingIsGoneAnnouncementDialog.html",
+ "FreeStreamingIsGoneAnnouncementDialog.js": "Components\\Music1\\FreeStreamingIsGoneAnnouncementDialog.js",
+ "FUEPageTemplate.html": "Components\\Music1\\FUEPageTemplate.html",
+ "lxSnappedMode.html": "Components\\Music1\\lxSnappedMode.html",
+ "MultiArtistTopSongsQuery.js": "Components\\Music1\\MultiArtistTopSongsQuery.js",
+ "music1templatescontrols.js": "Components\\Music1\\music1templatescontrols.js",
+ "MusicMarketplacePageTemplate.html": "Components\\Music1\\MusicMarketplacePageTemplate.html",
+ "NavigationTemplates.html": "Components\\Music1\\NavigationTemplates.html",
+ "NowPlayingFullScreen.js": "Components\\Music1\\NowPlayingFullScreen.js",
+ "NowPlayingFullScreenPage.html": "Components\\Music1\\NowPlayingFullScreenPage.html",
+ "NowPlayingPage.html": "Components\\Music1\\NowPlayingPage.html",
+ "NowPlayingPageDelayedScripts.html": "Components\\Music1\\NowPlayingPageDelayedScripts.html",
+ "PlaylistDetailsPage.html": "Components\\Music1\\PlaylistDetailsPage.html",
+ "RadioPageTemplate.html": "Components\\Music1\\RadioPageTemplate.html",
+ "SearchResultsHubPage.html": "Components\\Music1\\SearchResultsHubPage.html",
+ "SearchResultsPage.html": "Components\\Music1\\SearchResultsPage.html",
+ "ShareFlyout.html": "Components\\Music1\\ShareFlyout.html",
+ "SubscriptionSignup.html": "Components\\Music1\\SubscriptionSignup.html",
+ "TrackMetadataEditDialog.html": "Components\\Music1\\TrackMetadataEditDialog.html"
+ },
+ "Playback": {
+ "Controls": {
+ "PlaybackControl.css": "Components\\Playback\\Controls\\PlaybackControl.css",
+ "PlaybackControl.html": "Components\\Playback\\Controls\\PlaybackControl.html"
+ },
+ "Playlist": {
+ "NewPlaylistOverlay.html": "Components\\Playback\\Playlist\\NewPlaylistOverlay.html",
+ "NewPlaylistOverlay.js": "Components\\Playback\\Playlist\\NewPlaylistOverlay.js"
+ },
+ "IndivWorker.js": "Components\\Playback\\IndivWorker.js"
+ },
+ "Search": {
+ "MusicSearchView.js": "Components\\Search\\MusicSearchView.js",
+ "SearchSharedTemplates.html": "Components\\Search\\SearchSharedTemplates.html",
+ "SearchView.js": "Components\\Search\\SearchView.js"
+ },
+ "Settings": {
+ "Settings.js": "Components\\Settings\\Settings.js",
+ "SettingsAbout.html": "Components\\Settings\\SettingsAbout.html",
+ "SettingsAccount.html": "Components\\Settings\\SettingsAccount.html",
+ "SettingsFeedback.html": "Components\\Settings\\SettingsFeedback.html",
+ "SettingsPreferences.html": "Components\\Settings\\SettingsPreferences.html"
+ },
+ "shell": {
+ "AdControl.html": "Components\\shell\\AdControl.html",
+ "appNotification.html": "Components\\shell\\appNotification.html",
+ "BackButtonService.js": "Components\\shell\\BackButtonService.js",
+ "ContentNotificationList.html": "Components\\shell\\ContentNotificationList.html",
+ "DeepLinkActions.js": "Components\\shell\\DeepLinkActions.js",
+ "FrontHubStrip.html": "Components\\shell\\FrontHubStrip.html",
+ "FrontHubStrip.js": "Components\\shell\\FrontHubStrip.js",
+ "GalleryHubStrip.html": "Components\\shell\\GalleryHubStrip.html",
+ "GalleryHubStrip.js": "Components\\shell\\GalleryHubStrip.js",
+ "PrimaryNavigationButton.js": "Components\\shell\\PrimaryNavigationButton.js",
+ "ShellKeyboardShortcuts.js": "Components\\shell\\ShellKeyboardShortcuts.js",
+ "SnappedMode.html": "Components\\shell\\SnappedMode.html",
+ "SnappedMode.js": "Components\\shell\\SnappedMode.js",
+ "UserEngagementServiceMessage.html": "Components\\shell\\UserEngagementServiceMessage.html",
+ "UserEngagementServiceMessage.js": "Components\\shell\\UserEngagementServiceMessage.js",
+ "WhatsNewDisplay.html": "Components\\shell\\WhatsNewDisplay.html",
+ "WhatsNewDisplay.js": "Components\\shell\\WhatsNewDisplay.js",
+ "WhatsNewExperience.js": "Components\\shell\\WhatsNewExperience.js"
+ },
+ "Video": {
+ "TvSeriesHeaderControl.html": "Components\\Video\\TvSeriesHeaderControl.html",
+ "TvSeriesHeaderControl.js": "Components\\Video\\TvSeriesHeaderControl.js",
+ "VideoCollection.html": "Components\\Video\\VideoCollection.html",
+ "VideoCollectionPanels.html": "Components\\Video\\VideoCollectionPanels.html",
+ "VideoPanels.html": "Components\\Video\\VideoPanels.html",
+ "VideoSharedTemplatesControls.js": "Components\\Video\\VideoSharedTemplatesControls.js"
+ },
+ "BaseTransferNotificationHandler.js": "Components\\BaseTransferNotificationHandler.js",
+ "Marketplace.html": "Components\\Marketplace.html",
+ "Marketplace.js": "Components\\Marketplace.js"
+ },
+ "controls": {
+ "AppBar": {
+ "BottomAppBar.html": "controls\\AppBar\\BottomAppBar.html",
+ "BottomAppBar.js": "controls\\AppBar\\BottomAppBar.js",
+ "BottomProgressBar.html": "controls\\AppBar\\BottomProgressBar.html",
+ "BottomProgressBar.js": "controls\\AppBar\\BottomProgressBar.js",
+ "RemoveOverlay.html": "controls\\AppBar\\RemoveOverlay.html"
+ },
+ "Music": {
+ "ArtistImageCollage.js": "controls\\Music\\ArtistImageCollage.js",
+ "BaseNowPlayingVisualization.js": "controls\\Music\\BaseNowPlayingVisualization.js",
+ "CreatePlaylistFlyout.html": "controls\\Music\\CreatePlaylistFlyout.html",
+ "MediaPropertiesFlyout.html": "controls\\Music\\MediaPropertiesFlyout.html",
+ "MusicFeaturedContent.js": "controls\\Music\\MusicFeaturedContent.js",
+ "SelectArtistFlyout.html": "controls\\Music\\SelectArtistFlyout.html"
+ },
+ "Music1": {
+ "EducationFlyout.js": "controls\\Music1\\EducationFlyout.js",
+ "EducationFlyoutTemplates.html": "controls\\Music1\\EducationFlyoutTemplates.html",
+ "MediaStatusFlyout.html": "controls\\Music1\\MediaStatusFlyout.html",
+ "NowPlayingControl.js": "controls\\Music1\\NowPlayingControl.js",
+ "PurchaseConfirmationFlyout.html": "controls\\Music1\\PurchaseConfirmationFlyout.html",
+ "PurchaseConfirmationFlyout.js": "controls\\Music1\\PurchaseConfirmationFlyout.js"
+ },
+ "Music2": {
+ "NowPlayingVisualization.html": "controls\\Music2\\NowPlayingVisualization.html",
+ "NowPlayingVisualization.js": "controls\\Music2\\NowPlayingVisualization.js"
+ },
+ "NowPlaying": {
+ "MusicVisualization.html": "controls\\NowPlaying\\MusicVisualization.html",
+ "MusicVisualization.js": "controls\\NowPlaying\\MusicVisualization.js",
+ "NowPlaying.html": "controls\\NowPlaying\\NowPlaying.html",
+ "NowPlaying.js": "controls\\NowPlaying\\NowPlaying.js",
+ "NowPlayingMetadata.html": "controls\\NowPlaying\\NowPlayingMetadata.html",
+ "NowPlayingMetadata.js": "controls\\NowPlaying\\NowPlayingMetadata.js",
+ "NowPlayingOverlays.html": "controls\\NowPlaying\\NowPlayingOverlays.html",
+ "NowPlayingPlaylist.html": "controls\\NowPlaying\\NowPlayingPlaylist.html",
+ "NowPlayingPlaylist.js": "controls\\NowPlaying\\NowPlayingPlaylist.js",
+ "NowPlayingTransportControls.html": "controls\\NowPlaying\\NowPlayingTransportControls.html",
+ "NowPlayingTransportControls.js": "controls\\NowPlaying\\NowPlayingTransportControls.js",
+ "SnappedNowPlaying.html": "controls\\NowPlaying\\SnappedNowPlaying.html",
+ "SnappedNowPlaying.js": "controls\\NowPlaying\\SnappedNowPlaying.js",
+ "SnappedNowPlayingMetadata.html": "controls\\NowPlaying\\SnappedNowPlayingMetadata.html",
+ "SnappedNowPlayingMetadata.js": "controls\\NowPlaying\\SnappedNowPlayingMetadata.js",
+ "SnappedNowPlayingPlaylist.js": "controls\\NowPlaying\\SnappedNowPlayingPlaylist.js",
+ "SnappedNowPlayingPlaylistFlipView.js": "controls\\NowPlaying\\SnappedNowPlayingPlaylistFlipView.js"
+ },
+ "TransportControls": {
+ "MusicTransportControlDependencies.html": "controls\\TransportControls\\MusicTransportControlDependencies.html",
+ "SeekBar.html": "controls\\TransportControls\\SeekBar.html",
+ "TimelineEvent.html": "controls\\TransportControls\\TimelineEvent.html",
+ "TimelineEvent.js": "controls\\TransportControls\\TimelineEvent.js",
+ "TransportControls.html": "controls\\TransportControls\\TransportControls.html",
+ "VideoScrub.html": "controls\\TransportControls\\VideoScrub.html",
+ "VideoScrub.js": "controls\\TransportControls\\VideoScrub.js",
+ "VolumeBar.html": "controls\\TransportControls\\VolumeBar.html",
+ "VolumeBar.js": "controls\\TransportControls\\VolumeBar.js"
+ },
+ "actionList.html": "controls\\actionList.html",
+ "AdCompanion.html": "controls\\AdCompanion.html",
+ "AdCompanion.js": "controls\\AdCompanion.js",
+ "ArcProgress.html": "controls\\ArcProgress.html",
+ "ArcProgress.js": "controls\\ArcProgress.js",
+ "ContentItemNotifier.js": "controls\\ContentItemNotifier.js",
+ "Dashboard.html": "controls\\Dashboard.html",
+ "Dashboard.js": "controls\\Dashboard.js",
+ "DashboardPanel.html": "controls\\DashboardPanel.html",
+ "Dialog.html": "controls\\Dialog.html",
+ "EditBox.html": "controls\\EditBox.html",
+ "EditBox.js": "controls\\EditBox.js",
+ "ErrorDialog.html": "controls\\ErrorDialog.html",
+ "FailedPanel.html": "controls\\FailedPanel.html",
+ "FailedPanel.js": "controls\\FailedPanel.js",
+ "FeaturedContent.js": "controls\\FeaturedContent.js",
+ "FlipView.html": "controls\\FlipView.html",
+ "FlipView.js": "controls\\FlipView.js",
+ "Flyout.html": "controls\\Flyout.html",
+ "GalleryControl.html": "controls\\GalleryControl.html",
+ "GalleryThumbnail.js": "controls\\GalleryThumbnail.js",
+ "Hub.html": "controls\\Hub.html",
+ "Hub.js": "controls\\Hub.js",
+ "HubStrip.html": "controls\\HubStrip.html",
+ "HubStrip.js": "controls\\HubStrip.js",
+ "iconbutton.html": "controls\\iconbutton.html",
+ "ImageCollage.html": "controls\\ImageCollage.html",
+ "ImmersiveLayout.html": "controls\\ImmersiveLayout.html",
+ "ImmersiveLayout.js": "controls\\ImmersiveLayout.js",
+ "ItemControl.js": "controls\\ItemControl.js",
+ "ItemControlSelection.html": "controls\\ItemControlSelection.html",
+ "LibraryFeaturedContent.html": "controls\\LibraryFeaturedContent.html",
+ "LibraryFeaturedContent.js": "controls\\LibraryFeaturedContent.js",
+ "Link.html": "controls\\Link.html",
+ "LoadingControl.js": "controls\\LoadingControl.js",
+ "ManageFoldersPage.html": "controls\\ManageFoldersPage.html",
+ "MediaItemThumbnail.js": "controls\\MediaItemThumbnail.js",
+ "MessageBox.html": "controls\\MessageBox.html",
+ "MessageLinkBox.html": "controls\\MessageLinkBox.html",
+ "MessageLinkBox.js": "controls\\MessageLinkBox.js",
+ "Modifier.html": "controls\\Modifier.html",
+ "Music8Dashboard.html": "controls\\Music8Dashboard.html",
+ "Overlay.html": "controls\\Overlay.html",
+ "PivotControls.html": "controls\\PivotControls.html",
+ "PleaseResizeDialog.html": "controls\\PleaseResizeDialog.html",
+ "PleaseResizeDialog.js": "controls\\PleaseResizeDialog.js",
+ "PopOver.html": "controls\\PopOver.html",
+ "ProgressStackPanelControl.html": "controls\\ProgressStackPanelControl.html",
+ "ProgressStackPanelView.js": "controls\\ProgressStackPanelView.js",
+ "ShowMore.html": "controls\\ShowMore.html",
+ "ShowMore.js": "controls\\ShowMore.js",
+ "SignInControl.html": "controls\\SignInControl.html",
+ "templateSelector.js": "controls\\templateSelector.js",
+ "TextInputOverlay.js": "controls\\TextInputOverlay.js",
+ "thumbnailButton.html": "controls\\thumbnailButton.html",
+ "thumbnailButton.js": "controls\\thumbnailButton.js",
+ "ToggleModifier.html": "controls\\ToggleModifier.html",
+ "ToggleModifier.js": "controls\\ToggleModifier.js",
+ "UpgradeTile.html": "controls\\UpgradeTile.html",
+ "UpgradeTile.js": "controls\\UpgradeTile.js",
+ "UserFeedbackDialog.html": "controls\\UserFeedbackDialog.html",
+ "VideoAd.html": "controls\\VideoAd.html",
+ "WebHost.html": "controls\\WebHost.html",
+ "WebHost.js": "controls\\WebHost.js",
+ "WebHostDialog.html": "controls\\WebHostDialog.html",
+ "WebHostDialog.js": "controls\\WebHostDialog.js",
+ "WebHostMessage.js": "controls\\WebHostMessage.js"
+ },
+ "Fonts": {
+ "segxmvr.woff": "Fonts\\segxmvr.woff",
+ "segxsym.woff": "Fonts\\segxsym.woff"
+ },
+ "Framework": {
+ "data": {
+ "xboxLive.js": "Framework\\data\\xboxLive.js",
+ "xhr.js": "Framework\\data\\xhr.js"
+ },
+ "CoreFX_TSHelpers.js": "Framework\\CoreFX_TSHelpers.js",
+ "DashboardRefresherService.js": "Framework\\DashboardRefresherService.js",
+ "featureEnablement.js": "Framework\\featureEnablement.js",
+ "IAService.js": "Framework\\IAService.js",
+ "IdVision.js": "Framework\\IdVision.js",
+ "launchAppAction.js": "Framework\\launchAppAction.js",
+ "musicDeeplinks.js": "Framework\\musicDeeplinks.js",
+ "navigation.js": "Framework\\navigation.js",
+ "PlaybackErrorDisplayService.js": "Framework\\PlaybackErrorDisplayService.js",
+ "ProgressNotificationService.js": "Framework\\ProgressNotificationService.js",
+ "purchasehistoryservice.js": "Framework\\purchasehistoryservice.js",
+ "shiftDashboardAction.js": "Framework\\shiftDashboardAction.js",
+ "tileManager.js": "Framework\\tileManager.js",
+ "UpgradeToBlueNotification.js": "Framework\\UpgradeToBlueNotification.js",
+ "UserEngagementService.js": "Framework\\UserEngagementService.js"
+ },
+ "Images": {
+ "CloudDialog": {
+ "bg-gradient-cloud-dialog.png": "Images\\CloudDialog\\bg-gradient-cloud-dialog.png",
+ "cloud.png": "Images\\CloudDialog\\cloud.scale-100.png",
+ "Cloud_3Screen_Dialog.png": "Images\\CloudDialog\\Cloud_3Screen_Dialog.scale-100.png",
+ "streaming.png": "Images\\CloudDialog\\streaming.scale-100.png"
+ },
+ "Demo": {
+ "music_featuredHero.png": "Images\\Demo\\music_featuredHero.png",
+ "music_featuredSmall1.png": "Images\\Demo\\music_featuredSmall1.png",
+ "music_featuredSmall2.png": "Images\\Demo\\music_featuredSmall2.png",
+ "music_featuredSmall3.png": "Images\\Demo\\music_featuredSmall3.png",
+ "music_spotlightHero.png": "Images\\Demo\\music_spotlightHero.png",
+ "music_spotlightSmall1.png": "Images\\Demo\\music_spotlightSmall1.png",
+ "music_spotlightSmall2.png": "Images\\Demo\\music_spotlightSmall2.png",
+ "music_spotlightSmall3.png": "Images\\Demo\\music_spotlightSmall3.png"
+ },
+ "Devices": {
+ "Devices_PCWeb_Active.png": "Images\\Devices\\Devices_PCWeb_Active.scale-100.png",
+ "Devices_PCWeb_Hover.png": "Images\\Devices\\Devices_PCWeb_Hover.scale-100.png",
+ "Devices_PCWeb_Rest.png": "Images\\Devices\\Devices_PCWeb_Rest.scale-100.png",
+ "Devices_PhonesXbox_Active.png": "Images\\Devices\\Devices_PhonesXbox_Active.scale-100.png",
+ "Devices_PhonesXbox_Hover.png": "Images\\Devices\\Devices_PhonesXbox_Hover.scale-100.png",
+ "Devices_PhonesXbox_Rest.png": "Images\\Devices\\Devices_PhonesXbox_Rest.scale-100.png"
+ },
+ "ExploreUpsell": {
+ "devices.png": "Images\\ExploreUpsell\\devices.scale-100.png",
+ "offline.png": "Images\\ExploreUpsell\\offline.scale-100.png",
+ "sign-in.png": "Images\\ExploreUpsell\\sign-in.scale-100.png"
+ },
+ "FUE": {
+ "fue_background1.jpg": "Images\\FUE\\fue_background1.jpg",
+ "fue_background2.jpg": "Images\\FUE\\fue_background2.jpg",
+ "fue_background3.jpg": "Images\\FUE\\fue_background3.jpg",
+ "fue_background4.jpg": "Images\\FUE\\fue_background4.jpg",
+ "fue_background5.jpg": "Images\\FUE\\fue_background5.jpg"
+ },
+ "GenericIcons": {
+ "Music8_1": {
+ "Missing_Album_130.png": "Images\\GenericIcons\\Music8_1\\Missing_Album_130.scale-100.png",
+ "Missing_Album_150.png": "Images\\GenericIcons\\Music8_1\\Missing_Album_150.scale-100.png",
+ "Missing_Album_210.png": "Images\\GenericIcons\\Music8_1\\Missing_Album_210.scale-100.png",
+ "Missing_Album_75.png": "Images\\GenericIcons\\Music8_1\\Missing_Album_75.scale-100.png",
+ "Missing_Artist_130.png": "Images\\GenericIcons\\Music8_1\\Missing_Artist_130.scale-100.png",
+ "Missing_Artist_150.png": "Images\\GenericIcons\\Music8_1\\Missing_Artist_150.scale-100.png",
+ "Missing_Artist_75.png": "Images\\GenericIcons\\Music8_1\\Missing_Artist_75.scale-100.png",
+ "Missing_Art_Now_Playing.png": "Images\\GenericIcons\\Music8_1\\Missing_Art_Now_Playing.scale-100.png"
+ },
+ "ico_74x_GenericMusic_L2.png": "Images\\GenericIcons\\ico_74x_GenericMusic_L2.scale-100.png",
+ "ico_74x_GenericMusic_Large.png": "Images\\GenericIcons\\ico_74x_GenericMusic_Large.scale-100.png",
+ "ico_74x_GenericMusic_Medium.png": "Images\\GenericIcons\\ico_74x_GenericMusic_Medium.scale-100.png",
+ "ico_74x_GenericMusic_Small.png": "Images\\GenericIcons\\ico_74x_GenericMusic_Small.scale-100.png",
+ "ico_GenericMusic_L3_Hero.png": "Images\\GenericIcons\\ico_GenericMusic_L3_Hero.scale-100.png"
+ },
+ "ListStripes": {
+ "ListStripes.png": "Images\\ListStripes\\ListStripes.scale-100.png",
+ "ListStripesTall.png": "Images\\ListStripes\\ListStripesTall.scale-100.png",
+ "ListStripesTall_WhiteBackground.png": "Images\\ListStripes\\ListStripesTall_WhiteBackground.scale-100.png"
+ },
+ "LoadingCardTemplateBg": {
+ "LoadingCardTemplateBg_Empty.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_Empty.scale-100.png",
+ "LoadingCardTemplateBg_EmptyRTL.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_EmptyRTL.scale-100.png",
+ "LoadingCardTemplateBg_Music.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_Music.scale-100.png",
+ "LoadingCardTemplateBg_MusicRTL.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_MusicRTL.scale-100.png"
+ },
+ "NowPlaying": {
+ "now_playing_mask.png": "Images\\NowPlaying\\now_playing_mask.png",
+ "XenonMaskAntialiasing.png": "Images\\NowPlaying\\XenonMaskAntialiasing.png",
+ "XenonSquare.png": "Images\\NowPlaying\\XenonSquare.png"
+ },
+ "SubscriptionSignup": {
+ "Subscription_Devices.png": "Images\\SubscriptionSignup\\Subscription_Devices.scale-100.png"
+ },
+ "ThirdParty": {
+ "Echonest_Attribution_Assets_1.png": "Images\\ThirdParty\\Echonest_Attribution_Assets_1.scale-100.png",
+ "Webmix_Co-Attribution.png": "Images\\ThirdParty\\Webmix_Co-Attribution.scale-100.png",
+ "echonest.png": "Images\\ThirdParty\\echonest.scale-100.png"
+ },
+ "Tiles": {
+ "MusicNowPlaying": {
+ "Music_np_app_tile_02_circlepiece01.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_circlepiece01.png",
+ "Music_np_app_tile_02_circlepiece02.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_circlepiece02.png",
+ "Music_np_app_tile_02_circlepiece03.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_circlepiece03.png",
+ "Music_np_app_tile_02_diamond01.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_diamond01.png",
+ "Music_np_app_tile_02_halfcirclerot01.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_halfcirclerot01.png",
+ "Music_np_app_tile_02_parallelogram01.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_parallelogram01.png",
+ "Music_np_app_tile_02_parallelogram02.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_parallelogram02.png",
+ "Music_np_app_tile_02_parallelogram03rot.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_parallelogram03rot.png",
+ "Music_np_app_tile_02_square01rot.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_square01rot.png",
+ "Music_np_app_tile_02_square02rot.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_square02rot.png",
+ "Music_np_app_tile_02_trapezoid01.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_trapezoid01.png",
+ "Music_np_app_tile_02_trapezoid02.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_trapezoid02.png",
+ "Music_np_app_tile_02_triangle01.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_triangle01.png",
+ "Music_np_app_tile_02_triangle02.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_triangle02.png",
+ "Music_np_app_tile_02_triangle03.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_triangle03.png",
+ "Music_np_app_tile_02_triangle04.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_triangle04.png",
+ "Music_np_app_tile_02_triangle05.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_triangle05.png",
+ "Music_np_app_tile_02_triangle6rot.png": "Images\\Tiles\\MusicNowPlaying\\Music_np_app_tile_02_triangle6rot.png"
+ },
+ "MusicIcon.png": "Images\\Tiles\\MusicIcon.png",
+ "NP_tile_gradient.png": "Images\\Tiles\\NP_tile_gradient.png",
+ "NP_tile_gradient_1x1.png": "Images\\Tiles\\NP_tile_gradient_1x1.png",
+ "XBL_MUSIC_150x150_A.png": "Images\\Tiles\\XBL_MUSIC_150x150_A.scale-100.png",
+ "XBL_MUSIC_30x30_A.png": "Images\\Tiles\\XBL_MUSIC_30x30_A.scale-100.png",
+ "XBL_MUSIC_310x150_C.png": "Images\\Tiles\\XBL_MUSIC_310x150_C.scale-100.png",
+ "XBL_MUSIC_310x310_A.png": "Images\\Tiles\\XBL_MUSIC_310x310_A.scale-100.png",
+ "XBL_MUSIC_50x50_A.png": "Images\\Tiles\\XBL_MUSIC_50x50_A.png",
+ "XBL_MUSIC_620x300_A.png": "Images\\Tiles\\XBL_MUSIC_620x300_A.scale-100.png",
+ "XBL_MUSIC_70x70_A.png": "Images\\Tiles\\XBL_MUSIC_70x70_A.scale-100.png"
+ },
+ "TransportControls": {
+ "leaf_default.png": "Images\\TransportControls\\leaf_default.png",
+ "leaf_touch.png": "Images\\TransportControls\\leaf_touch.png"
+ },
+ "WebDialogResize": {
+ "Expand_Screen_Icon.png": "Images\\WebDialogResize\\Expand_Screen_Icon.scale-100.png",
+ "RotateResizeIcon.png": "Images\\WebDialogResize\\RotateResizeIcon.scale-100.png"
+ },
+ "AppBar_gradient.png": "Images\\AppBar_gradient.png",
+ "cloudNotificationHeaderBlue1.png": "Images\\cloudNotificationHeaderBlue1.png",
+ "cloudNotificationHeaderBlue2.png": "Images\\cloudNotificationHeaderBlue2.png",
+ "cloudNotificationHeaderBlue3.png": "Images\\cloudNotificationHeaderBlue3.png",
+ "cloudNotificationHeaderBlue4.png": "Images\\cloudNotificationHeaderBlue4.png",
+ "cloudNotificationHeaderBlue5.png": "Images\\cloudNotificationHeaderBlue5.png",
+ "ico_252x265_GenericMusic.png": "Images\\ico_252x265_GenericMusic.scale-100.png",
+ "ico_74x_GenericMusic.png": "Images\\ico_74x_GenericMusic.scale-100_contrast-black.png",
+ "ico_74x_GenericMusic_L2.png": "Images\\ico_74x_GenericMusic_L2.scale-100_contrast-black.png",
+ "img_not_found.png": "Images\\img_not_found.png",
+ "immersive_details_background_gradient.png": "Images\\immersive_details_background_gradient.png",
+ "immersive_details_viewMore_background_gradient.png": "Images\\immersive_details_viewMore_background_gradient.png",
+ "link_asset.png": "Images\\link_asset.png",
+ "loading_image.png": "Images\\loading_image.png",
+ "MusicDialogBluePattern.png": "Images\\MusicDialogBluePattern.png",
+ "MusicDialogGreenPattern.png": "Images\\MusicDialogGreenPattern.png",
+ "MusicDialogOrangePattern.png": "Images\\MusicDialogOrangePattern.png",
+ "MusicDialogPinkPattern.png": "Images\\MusicDialogPinkPattern.png",
+ "notification_retry_ring_dark.png": "Images\\notification_retry_ring_dark.png",
+ "notification_retry_ring_light.png": "Images\\notification_retry_ring_light.png",
+ "notification_retry_spinner_dark.png": "Images\\notification_retry_spinner_dark.png",
+ "notification_retry_spinner_light.png": "Images\\notification_retry_spinner_light.png",
+ "squareLoading.png": "Images\\squareLoading.png",
+ "standard_card_square_art_overlay.png": "Images\\standard_card_square_art_overlay.png",
+ "streaming_dark.png": "Images\\streaming_dark.png",
+ "streaming_light.png": "Images\\streaming_light.png",
+ "surface_education_panel.png": "Images\\surface_education_panel.png",
+ "transparent.png": "Images\\transparent.png",
+ "x8_300x250_ad_error.png": "Images\\x8_300x250_ad_error.png",
+ "x8_300x600_ad_error.png": "Images\\x8_300x600_ad_error.png",
+ "XBM_Branded_Title.png": "Images\\XBM_Branded_Title.scale-100.png"
+ },
+ "Models": {
+ "ProgressModel.js": "Models\\ProgressModel.js"
+ },
+ "MSAdvertisingJS": {
+ "ads": {
+ "ad.js": "MSAdvertisingJS\\ads\\ad.js",
+ "bootstrap.html": "MSAdvertisingJS\\ads\\bootstrap.html",
+ "bootstrap.js": "MSAdvertisingJS\\ads\\bootstrap.js",
+ "ormma.js": "MSAdvertisingJS\\ads\\ormma.js",
+ "VASTAd.js": "MSAdvertisingJS\\ads\\VASTAd.js"
+ }
+ },
+ "Styles": {
+ "Animations.css": "Styles\\Animations.css",
+ "App.css": "Styles\\App.css",
+ "BottomAppBar.css": "Styles\\BottomAppBar.css",
+ "ClosedCaption.css": "Styles\\ClosedCaption.css",
+ "DefaultStyles.css": "Styles\\DefaultStyles.css",
+ "HubLayouts.css": "Styles\\HubLayouts.css",
+ "Images.css": "Styles\\Images.css",
+ "Immersive.css": "Styles\\Immersive.css",
+ "ImmersiveDetails.css": "Styles\\ImmersiveDetails.css",
+ "InlineDetails.css": "Styles\\InlineDetails.css",
+ "Marketplace.css": "Styles\\Marketplace.css",
+ "NowPlaying.css": "Styles\\NowPlaying.css",
+ "Search.css": "Styles\\Search.css",
+ "SeekBar.css": "Styles\\SeekBar.css",
+ "Settings.css": "Styles\\Settings.css",
+ "share.css": "Styles\\share.css",
+ "Shell.css": "Styles\\Shell.css",
+ "Snapped.css": "Styles\\Snapped.css",
+ "TransportControls.css": "Styles\\TransportControls.css",
+ "ui-overrides.css": "Styles\\ui-overrides.css"
+ },
+ "ViewModels": {
+ "Home": {
+ "dashboardContentViewModel.js": "ViewModels\\Home\\dashboardContentViewModel.js",
+ "FeaturedViewModel.js": "ViewModels\\Home\\FeaturedViewModel.js",
+ "SpotlightViewModel.js": "ViewModels\\Home\\SpotlightViewModel.js"
+ },
+ "Immersive": {
+ "ImmersiveViewModels.js": "ViewModels\\Immersive\\ImmersiveViewModels.js"
+ },
+ "Music": {
+ "ArtistImmersiveViewModel.js": "ViewModels\\Music\\ArtistImmersiveViewModel.js",
+ "BaseNowPlayingViewModel.js": "ViewModels\\Music\\BaseNowPlayingViewModel.js",
+ "LegacyMusicMarketplaceViewModel.js": "ViewModels\\Music\\LegacyMusicMarketplaceViewModel.js",
+ "MusicEngageViewModel.js": "ViewModels\\Music\\MusicEngageViewModel.js",
+ "MusicHubCollectionPanel.js": "ViewModels\\Music\\MusicHubCollectionPanel.js",
+ "musichubmusicpanel.js": "ViewModels\\Music\\musichubmusicpanel.js",
+ "MusicMarketplaceVerticalTemplates.js": "ViewModels\\Music\\MusicMarketplaceVerticalTemplates.js",
+ "musicspotlight.js": "ViewModels\\Music\\musicspotlight.js",
+ "MusicVideosModule.js": "ViewModels\\Music\\MusicVideosModule.js",
+ "MusicWelcomeViewModel.js": "ViewModels\\Music\\MusicWelcomeViewModel.js"
+ },
+ "Music1": {
+ "DemoPageViewModels.js": "ViewModels\\Music1\\DemoPageViewModels.js",
+ "MetadataEditInterfaces.js": "ViewModels\\Music1\\MetadataEditInterfaces.js",
+ "NowPlayingViewModel.js": "ViewModels\\Music1\\NowPlayingViewModel.js",
+ "ShareTargetFocusWorker.js": "ViewModels\\Music1\\ShareTargetFocusWorker.js",
+ "ShareTargetHtmlParserWorker.js": "ViewModels\\Music1\\ShareTargetHtmlParserWorker.js",
+ "ShareTargetMain.js": "ViewModels\\Music1\\ShareTargetMain.js",
+ "ShareTargetViewModel.js": "ViewModels\\Music1\\ShareTargetViewModel.js",
+ "TextContentActions.js": "ViewModels\\Music1\\TextContentActions.js"
+ },
+ "Music2": {
+ "NowPlayingViewModel.js": "ViewModels\\Music2\\NowPlayingViewModel.js"
+ },
+ "Search": {
+ "MusicHCRResultViewModel.js": "ViewModels\\Search\\MusicHCRResultViewModel.js",
+ "MusicSearchVerticalTemplates.js": "ViewModels\\Search\\MusicSearchVerticalTemplates.js",
+ "MusicSearchViewModel.js": "ViewModels\\Search\\MusicSearchViewModel.js",
+ "NewSearchViewModel.js": "ViewModels\\Search\\NewSearchViewModel.js",
+ "SearchContractViewModel.js": "ViewModels\\Search\\SearchContractViewModel.js",
+ "SearchViewModel.js": "ViewModels\\Search\\SearchViewModel.js"
+ },
+ "CollectionMarketplaceQuery.js": "ViewModels\\CollectionMarketplaceQuery.js",
+ "Command.js": "ViewModels\\Command.js",
+ "ProgressStackPanelViewModel.js": "ViewModels\\ProgressStackPanelViewModel.js"
+ },
+ "WinJS": {
+ "win": {
+ "uicollections.css": "WinJS\\win\\uicollections.css"
+ }
+ },
+ "AlbumDetailsPage_merged.js": "AlbumDetailsPage_merged.js",
+ "AppxManifest.xml": "AppxManifest.xml",
+ "ArtistDetailsPage_merged.js": "ArtistDetailsPage_merged.js",
+ "CollectionPageDelayedScripts_merged.js": "CollectionPageDelayedScripts_merged.js",
+ "CollectionPageTemplate_merged.js": "CollectionPageTemplate_merged.js",
+ "config.json": "config.json",
+ "delayedStageFourStartup.html": "delayedStageFourStartup.html",
+ "delayedStageThreeStartup.html": "delayedStageThreeStartup.html",
+ "DevicesPage_merged.js": "DevicesPage_merged.js",
+ "EntCommon.dll": "EntCommon.dll",
+ "EntPlat.dll": "EntPlat.dll",
+ "EntSyncFx.dll": "EntSyncFx.dll",
+ "ExplorePage_merged.js": "ExplorePage_merged.js",
+ "fileActivationStartup.html": "fileActivationStartup.html",
+ "FUEPageTemplate_merged.js": "FUEPageTemplate_merged.js",
+ "gnsdk_fp.dll": "gnsdk_fp.dll",
+ "group_1_merged.js": "group_1_merged.js",
+ "group_2_merged.js": "group_2_merged.js",
+ "group_3_merged.js": "group_3_merged.js",
+ "group_4_merged.js": "group_4_merged.js",
+ "group_unique_merged.js": "group_unique_merged.js",
+ "launchToCollectionStartup.html": "launchToCollectionStartup.html",
+ "LiveIdChange.js": "LiveIdChange.js",
+ "main.html": "main.html",
+ "main.js": "main.js",
+ "main_merged.js": "main_merged.js",
+ "Microsoft.Entertainment.Instrumentation.Providers.dll": "Microsoft.Entertainment.Instrumentation.Providers.dll",
+ "Microsoft.Entertainment.winmd": "Microsoft.Entertainment.winmd",
+ "Microsoft.Media.AdaptiveStreaming.dll": "Microsoft.Media.AdaptiveStreaming.dll",
+ "Microsoft.Media.AdaptiveStreaming.winmd": "Microsoft.Media.AdaptiveStreaming.winmd",
+ "Microsoft.PerfTrack.dll": "Microsoft.PerfTrack.dll",
+ "Microsoft.PerfTrack.winmd": "Microsoft.PerfTrack.winmd",
+ "MicrosoftAdvertising.dll": "MicrosoftAdvertising.dll",
+ "MicrosoftAdvertising.winmd": "MicrosoftAdvertising.winmd",
+ "msapp-error.html": "msapp-error.html",
+ "msapp-error.js": "msapp-error.js",
+ "MusicMarketplacePageTemplate_merged.js": "MusicMarketplacePageTemplate_merged.js",
+ "NowPlaying_merged.js": "NowPlaying_merged.js",
+ "PlaylistDetailsPage_merged.js": "PlaylistDetailsPage_merged.js",
+ "RadioPageTemplate_merged.js": "RadioPageTemplate_merged.js",
+ "SearchResultsHubPage_merged.js": "SearchResultsHubPage_merged.js",
+ "SearchResultsPage_merged.js": "SearchResultsPage_merged.js",
+ "updateapp.html": "updateapp.html",
+ "UpdateApp.js": "UpdateApp.js",
+ "Version.json": "Version.json",
+ "WarmupCode.js": "WarmupCode.js"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.zunemusic/updateapp.html b/packages/microsoft.zunemusic/updateapp.html
new file mode 100644
index 00000000..ae2dc074
--- /dev/null
+++ b/packages/microsoft.zunemusic/updateapp.html
@@ -0,0 +1,25 @@
+
+
+
+
+ IWX Entertainment Client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/AppxBlockMap.xml b/packages/microsoft.zunevideo/AppxBlockMap.xml
new file mode 100644
index 00000000..68b65eb8
--- /dev/null
+++ b/packages/microsoft.zunevideo/AppxBlockMap.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/AppxManifest.xml b/packages/microsoft.zunevideo/AppxManifest.xml
new file mode 100644
index 00000000..3494f773
--- /dev/null
+++ b/packages/microsoft.zunevideo/AppxManifest.xml
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+ false
+ ms-resource:IDS_MANIFEST_VIDEO_APP_NAME
+ Microsoft Corporation
+ ms-resource:IDS_MANIFEST_VIDEO_APP_DESCRIPTION
+ images\Tiles\XBL_VIDEO_50x50_A.png
+
+
+
+
+ 6.3.0
+ 6.3.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Images\Tiles\VideoIcon.png .3g2 .3gp .3gpp .avi .divx .m2ts .m2t .m4v .mod .mov .mp4 .mp4v .mpe .mpeg .mpg .mpv2 .mts .tod .ts .tts .wm .wmv .xvid .mkv
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EntPlat.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EntCommon.dll
+
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft.Entertainment.Instrumentation.Providers.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft.PerfTrack.dll
+
+
+
+
+
+
+ entplat.dll
+
+
+
+
+ Microsoft.Media.AdaptiveStreaming.dll Microsoft.Media.AdaptiveStreaming.dll MicrosoftAdvertising.dll
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/AppxMetadata/CodeIntegrity.cat b/packages/microsoft.zunevideo/AppxMetadata/CodeIntegrity.cat
new file mode 100644
index 00000000..96da90fd
Binary files /dev/null and b/packages/microsoft.zunevideo/AppxMetadata/CodeIntegrity.cat differ
diff --git a/packages/microsoft.zunevideo/Classic/DelayedStageThreeStartup.html b/packages/microsoft.zunevideo/Classic/DelayedStageThreeStartup.html
new file mode 100644
index 00000000..8899935e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Classic/DelayedStageThreeStartup.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Classic/Main.html b/packages/microsoft.zunevideo/Classic/Main.html
new file mode 100644
index 00000000..5c6397d7
--- /dev/null
+++ b/packages/microsoft.zunevideo/Classic/Main.html
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Accounts/AcceptTermsOfService.js b/packages/microsoft.zunevideo/Components/Accounts/AcceptTermsOfService.js
new file mode 100644
index 00000000..c04402e1
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Accounts/AcceptTermsOfService.js
@@ -0,0 +1,33 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.Accounts", {AcceptTermsOfService: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.WebHostExperience", function AcceptTermsOfService_constructor() {
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.constructor.call(this)
+ }, {
+ startListener: function startListener() {
+ if (!this.disposed)
+ this.eventProvider.traceAcceptTermsOfService_Start("");
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.startListener.apply(this, arguments)
+ }, messageReceived: function messageReceived(messageStruct, webHost, sendMessageFunc) {
+ if (!this.disposed)
+ switch (messageStruct.verb) {
+ case"CLOSE_DIALOG":
+ if (messageStruct.reason === "SUCCESS")
+ this.eventProvider.traceAcceptTermsOfService_Finish("");
+ else if (messageStruct.reason === "CANCEL")
+ this.eventProvider.traceAcceptTermsOfService_Cancel("");
+ break
+ }
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.messageReceived.apply(this, arguments)
+ }
+ }, {doAcceptTermsOfService: function doAcceptTermsOfService() {
+ var url = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_ModernPurchase) + "/acceptTou?client=x13";
+ var experience = new MS.Entertainment.Accounts.AcceptTermsOfService;
+ return MS.Entertainment.UI.Shell.showWebHostDialog("TOS", {
+ desiredLeft: "0%", desiredTop: null, desiredHeight: (new Microsoft.Entertainment.Configuration.ConfigurationManager).service.modernWebBlendHeight, showBackButton: false, showCancelButton: false, desiredZIndex: 1002
+ }, {
+ sourceUrl: "", signInOverride: true, authenticatedSourceUrl: url, webHostExperience: experience, taskId: MS.Entertainment.UI.Controls.WebHost.TaskId.TOU, isDialog: true
+ })
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Accounts/AccountProvisioningDialog.html b/packages/microsoft.zunevideo/Components/Accounts/AccountProvisioningDialog.html
new file mode 100644
index 00000000..29b8b5f9
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Accounts/AccountProvisioningDialog.html
@@ -0,0 +1,48 @@
+
+
+
+
+ Account Provisioning Dialog Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Accounts/AccountProvisioningDialog.js b/packages/microsoft.zunevideo/Components/Accounts/AccountProvisioningDialog.js
new file mode 100644
index 00000000..e3d4b4fe
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Accounts/AccountProvisioningDialog.js
@@ -0,0 +1,192 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Accounts) {
+ var AccountProvisioningDialog = (function(_super) {
+ __extends(AccountProvisioningDialog, _super);
+ function AccountProvisioningDialog(element, options) {
+ this.templateStorage = "/Components/Accounts/AccountProvisioningDialog.html";
+ this.templateName = "accountProvisioningDialog";
+ this._actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ _super.call(this, element, options)
+ }
+ AccountProvisioningDialog.prototype.initialize = function() {
+ var _this = this;
+ this._emailAccountContainer.textContent = String.load(String.id.IDS_PROVISIONING_USER_EMAIL).format(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).getToBeProvisionedUserName());
+ WinJS.Promise.timeout(100).done(function() {
+ MS.Entertainment.UI.Framework.focusElement(_this._alreadyHaveAccountButton)
+ })
+ };
+ AccountProvisioningDialog.prototype.setOverlay = function(dialog) {
+ this._hostDialog = dialog
+ };
+ AccountProvisioningDialog.prototype.alreadyHaveAccountClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ this._xboxAccountExplanation.textContent = String.load(String.id.IDS_PROVISIONING_ALREADY_HAVE_DESC);
+ WinJS.Utilities.removeClass(this._xboxAccountExplanation, "removeFromDisplay")
+ };
+ AccountProvisioningDialog.prototype.termsOfServiceLinkClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var externalNavigationAction = this._actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBox) + "/legal/LiveTOU";
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.accountProvisioningTOS;
+ externalNavigationAction.execute()
+ };
+ AccountProvisioningDialog.prototype.privacyStatementClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var externalNavigationAction = this._actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = "http://go.microsoft.com/fwlink/?LinkID=259655";
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.accountProvisioningPrivacy;
+ externalNavigationAction.execute()
+ };
+ AccountProvisioningDialog.prototype.acceptClicked = function() {
+ if (this._hostDialog && this._hostDialog.buttons && this._hostDialog.buttons.length === 2) {
+ this._hostDialog.buttons[0].isEnabled = false;
+ this._hostDialog.buttons[1].isEnabled = false;
+ this._hostDialog.buttons[0].isDisabled = true;
+ this._hostDialog.buttons[1].isDisabled = true
+ }
+ if (this.progressSpinner)
+ WinJS.Utilities.removeClass(this.progressSpinner, "removeFromDisplay")
+ };
+ AccountProvisioningDialog.showAccountProvisioningDialog = function() {
+ var completionSignal = new MS.Entertainment.UI.Framework.Signal;
+ var controlOptions = {
+ defaultButtonIndex: -1, cancelButtonIndex: 1, persistOnNavigate: true, buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_PROVISIONING_ACCEPT_BUTTON), execute: function(d) {
+ if (d && d.overlayContent && d.overlayContent.winControl) {
+ if (d.overlayContent.winControl._dismissPromiseCompleting)
+ return;
+ d.overlayContent.winControl.acceptClicked();
+ d.overlayContent.winControl._dismissPromiseCompleting = true
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).provisionUserAccount().done(function() {
+ AccountProvisioningDialog.sendTelemetry("SUCCESS");
+ d.hide();
+ completionSignal.complete()
+ }, function(error) {
+ AccountProvisioningDialog.sendTelemetry("ERROR", error);
+ d.hide();
+ completionSignal.error(error)
+ })
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_PROVISIONING_CANCEL_BUTTON), execute: function(d) {
+ AccountProvisioningDialog.sendTelemetry("CANCEL");
+ if (d && d.overlayContent && d.overlayContent.winControl) {
+ if (d.overlayContent.winControl._dismissPromiseCompleting)
+ return;
+ d.overlayContent.winControl._dismissPromiseCompleting = true
+ }
+ d.hide();
+ completionSignal.complete()
+ }
+ })]
+ };
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_PROVISIONING_TITLE), "MS.Entertainment.Accounts.AccountProvisioningDialog", controlOptions).done(null, function(error) {
+ MS.Entertainment.fail("Error showing Account Provisioning Dialog: " + (error && error.message));
+ completionSignal.complete()
+ });
+ return completionSignal.promise
+ };
+ AccountProvisioningDialog.sendTelemetry = function(result, error) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Result, parameterValue: result
+ }];
+ if (error && error.number)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, parameterValue: error.number
+ });
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.AccountCreation, telemetryParameterArray)
+ };
+ return AccountProvisioningDialog
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Accounts.AccountProvisioningDialog = AccountProvisioningDialog;
+ var ChildAccountProvisioningDialog = (function(_super) {
+ __extends(ChildAccountProvisioningDialog, _super);
+ function ChildAccountProvisioningDialog(element, options) {
+ this.templateStorage = "/Components/Accounts/AccountProvisioningDialog.html";
+ this.templateName = "childAccountProvisioningDialog";
+ this._actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ _super.call(this, element, options)
+ }
+ ChildAccountProvisioningDialog.prototype.initialize = function() {
+ var _this = this;
+ var decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ decimalFormatter.fractionDigits = 0;
+ var numberOne = decimalFormatter.format(1);
+ var numberTwo = decimalFormatter.format(2);
+ var numberThree = decimalFormatter.format(3);
+ this._xboxSiteLink.textContent = String.load(String.id.IDS_PROVISIONING_CHILD_LIST_XBOX_LINK).format(numberOne);
+ this._comeBackText.textContent = String.load(String.id.IDS_PROVISIONING_CHILD_LIST_COMEBACK).format(numberTwo);
+ this._signInLink.textContent = String.load(String.id.IDS_PROVISIONING_CHILD_LIST_SIGNIN).format(numberThree);
+ WinJS.Promise.timeout(100).done(function() {
+ MS.Entertainment.UI.Framework.focusElement(_this._xboxSiteLink)
+ })
+ };
+ ChildAccountProvisioningDialog.prototype.setOverlay = function(dialog) {
+ this._hostDialog = dialog
+ };
+ ChildAccountProvisioningDialog.prototype.xboxSiteLinkClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var webLink = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/Flows/BeginFlow.ashx?workflow=AccountCreation";
+ var externalNavigationAction = this._actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = webLink;
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.accountProvisioningChildWebLink;
+ externalNavigationAction.execute();
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: this._xboxSiteLink}, {
+ uri: "childAccountProvisioningInfoDialog", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ }, {
+ uri: webLink, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.WebPage
+ })
+ };
+ ChildAccountProvisioningDialog.prototype.signInClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: this._signInLink}, {
+ uri: "childAccountProvisioningInfoDialog", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ });
+ this._hostDialog.hide()
+ };
+ ChildAccountProvisioningDialog.showChildAccountProvisioningDialog = function() {
+ var completionSignal = new MS.Entertainment.UI.Framework.Signal;
+ var controlOptions = {
+ defaultButtonIndex: -1, cancelButtonIndex: 0, persistOnNavigate: true, buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_PROVISIONING_CANCEL_BUTTON), execute: function(d) {
+ d.hide()
+ }
+ })]
+ };
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_PROVISIONING_CHILD_TITLE), "MS.Entertainment.Accounts.ChildAccountProvisioningDialog", controlOptions).done(function() {
+ completionSignal.complete()
+ }, function(error) {
+ MS.Entertainment.fail("Error showing Account Provisioning Dialog: " + (error && error.message));
+ completionSignal.complete()
+ });
+ return completionSignal.promise
+ };
+ return ChildAccountProvisioningDialog
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Accounts.ChildAccountProvisioningDialog = ChildAccountProvisioningDialog;
+ WinJS.Utilities.markSupportedForProcessing(ChildAccountProvisioningDialog);
+ WinJS.Utilities.markSupportedForProcessing(AccountProvisioningDialog)
+ })(Entertainment.Accounts || (Entertainment.Accounts = {}));
+ var Accounts = Entertainment.Accounts
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/BaseTransferNotificationHandler.js b/packages/microsoft.zunevideo/Components/BaseTransferNotificationHandler.js
new file mode 100644
index 00000000..8d3db62a
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/BaseTransferNotificationHandler.js
@@ -0,0 +1,165 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/FileTransferNotificationService.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {BaseFileTransferNotificationHandlers: MS.Entertainment.UI.Framework.define(function BaseFileTransferNotificationHandlersConstructor() {
+ this.errorPopoverMediaId = null;
+ this.currentDownloads = {};
+ this.trackDownloads = 0;
+ this.currentPaused = {};
+ this.trackPaused = 0;
+ this.downloadErrorsEncountered = false;
+ this.updateTimer = null;
+ this.preventMoreDownloadPausedNotification = false
+ }, {
+ trackDownloadUpdate: function trackDownloadUpdate(eventInfo) {
+ MS.Entertainment.UI.assert(!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.mediaId) || eventInfo.task.libraryId > 0, "task object had an invalid identifiers: mediaId: {0}, libraryId {1}".format(eventInfo.task.mediaId, eventInfo.task.libraryId));
+ var mediaIdentifier = this._getMediaIdentifierFromTask(eventInfo.task);
+ var itemIsDownloading = false;
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ switch (eventInfo.task.taskStatus) {
+ case Microsoft.Entertainment.FileTransferStatus.error:
+ case Microsoft.Entertainment.FileTransferStatus.canceled:
+ case Microsoft.Entertainment.FileTransferStatus.completed:
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--
+ }
+ if (this.currentPaused[mediaIdentifier]) {
+ delete this.currentPaused[mediaIdentifier];
+ this.trackPaused--
+ }
+ itemIsDownloading = false;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.paused:
+ case Microsoft.Entertainment.FileTransferStatus.pausedCostedNetwork:
+ case Microsoft.Entertainment.FileTransferStatus.pausedNoNetwork:
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--
+ }
+ if (!this.currentPaused[mediaIdentifier]) {
+ this.currentPaused[mediaIdentifier] = true;
+ this.trackPaused++
+ }
+ itemIsDownloading = true;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.running:
+ if (this.trackDownloads === 0)
+ this.downloadErrorsEncountered = false;
+ if (!this.currentDownloads[mediaIdentifier]) {
+ this.currentDownloads[mediaIdentifier] = true;
+ this.trackDownloads++
+ }
+ itemIsDownloading = true;
+ break
+ }
+ fileTransferNotifications.setItemError(mediaIdentifier, 0);
+ fileTransferNotifications.setItemTransferState(mediaIdentifier, MS.Entertainment.UI.FileTransferNotificationService.Event.download, itemIsDownloading);
+ this._startNotificationTimer()
+ }, trackDownloadError: function trackDownloadError(eventInfo) {
+ MS.Entertainment.UI.assert(!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.mediaId) || eventInfo.task.libraryId > 0, "task object had an invalid identifiers: mediaId: {0}, libraryId {1}".format(eventInfo.task.mediaId, eventInfo.task.libraryId));
+ this.downloadErrorsEncountered = true;
+ this._setDownloadErrorEventInfo(eventInfo);
+ if (eventInfo.task.isClosed)
+ this._clearDownloadEventInfo(eventInfo)
+ }, startTransferListener: function startTransferListener() {
+ var trackDownloadNotifiers = {
+ add: this.trackDownloadUpdate.bind(this), cancel: this.trackDownloadUpdate.bind(this), complete: this.trackDownloadUpdate.bind(this), update: this.trackDownloadUpdate.bind(this), error: this.trackDownloadError.bind(this)
+ };
+ var trackTaskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true);
+ var handler = {
+ notifier: trackDownloadNotifiers, taskKeyGetter: trackTaskKeyGetter
+ };
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ fileTransferNotifications.startListening(handler)
+ }, _clearDownloadEventInfo: function _clearDownloadEventInfo(eventInfo) {
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ var appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.mediaId)) {
+ fileTransferNotifications.setItemTransferState(eventInfo.task.mediaId, MS.Entertainment.UI.FileTransferNotificationService.Event.download, false);
+ fileTransferNotifications.setItemError(eventInfo.task.mediaId, 0)
+ }
+ if (eventInfo.task.libraryId >= 0) {
+ fileTransferNotifications.setItemTransferState(eventInfo.task.libraryId, MS.Entertainment.UI.FileTransferNotificationService.Event.download, false);
+ fileTransferNotifications.setItemError(eventInfo.task.libraryId, 0)
+ }
+ }, _setDownloadErrorEventInfo: function _setDownloadErrorEventInfo(eventInfo) {
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ var mediaIdentifier = this._getMediaIdentifierFromTask(eventInfo.task);
+ fileTransferNotifications.setItemTransferState(mediaIdentifier, MS.Entertainment.UI.FileTransferNotificationService.Event.download, false);
+ fileTransferNotifications.setItemError(mediaIdentifier, eventInfo.task.responseCode);
+ var startNotificationTimer = false;
+ if (this.currentPaused[mediaIdentifier]) {
+ delete this.currentPaused[mediaIdentifier];
+ this.trackPaused--;
+ startNotificationTimer = true
+ }
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--;
+ startNotificationTimer = true
+ }
+ if (startNotificationTimer)
+ this._startNotificationTimer()
+ }, _getMediaIdentifierFromTask: function _getMediaIdentifierFromTask(transferTask) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(transferTask.mediaId) ? transferTask.mediaId : transferTask.libraryId
+ }, _startNotificationTimer: function _startNotificationTimer() {
+ if (!this.updateTimer)
+ this.updateTimer = WinJS.Promise.timeout(1000).then(function updateTrackNotifications() {
+ this._updateTrackDownloadNotification();
+ this.updateTimer = null
+ }.bind(this))
+ }, _updateTrackDownloadNotification: function _updateTrackDownloadNotification() {
+ var appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ var removeNotification = false;
+ var notification;
+ var notificationType = MS.Entertainment.UI.Notification.Type.Informational;
+ var title = String.empty;
+ var subTitle = String.empty;
+ var icon = WinJS.UI.AppBarIcon.download;
+ var category = this.Type.TrackDownloadInformational;
+ var isPersistent = false;
+ var skipNotification = false;
+ var clickAction = (MS.Entertainment.Utilities.isVideoApp1 ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showVideoDownloadManager) : null);
+ var currentDownloads = this.trackDownloads;
+ var currentPaused = this.trackPaused;
+ if (currentDownloads > 0) {
+ var numberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var formattedCount = numberFormatter.format(currentDownloads);
+ title = this._downloadNotification;
+ subTitle = MS.Entertainment.Utilities.Pluralization.getPluralizedString(this._downloadInProgressString, currentDownloads).format(formattedCount);
+ isPersistent = true;
+ this.preventMoreDownloadPausedNotification = false
+ }
+ else if (currentPaused > 0)
+ if (this.preventMoreDownloadPausedNotification)
+ skipNotification = true;
+ else {
+ title = String.load(String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT);
+ this.preventMoreDownloadPausedNotification = true
+ }
+ else {
+ title = this._downloadComplete;
+ removeNotification = this.downloadErrorsEncountered;
+ this.downloadErrorsEncountered = false;
+ this.preventMoreDownloadPausedNotification = false;
+ if (MS.Entertainment.UI.CollectionChangeNotifierService) {
+ MS.Entertainment.UI.CollectionChangeNotifierService.blockGlobalCollectionChangeEvents = false;
+ MS.Entertainment.UI.CollectionChangeNotifierService.blockGlobalCollectionUpSyncEvents = false
+ }
+ }
+ if (!skipNotification) {
+ notification = new MS.Entertainment.UI.Notification({
+ notificationType: notificationType, title: title, subTitle: subTitle, icon: icon, category: category, isPersistent: isPersistent, action: clickAction, dismissOnSignOut: true
+ });
+ if (!removeNotification)
+ appNotificationService.send(notification);
+ else
+ appNotificationService.removeNotificationByCategory(notification.category)
+ }
+ }, Type: {
+ TrackDownloadInformational: "TrackDownloadInformational", AlbumDownloadError: "AlbumDownloadError"
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Dashboard/DashboardViewModel.js b/packages/microsoft.zunevideo/Components/Dashboard/DashboardViewModel.js
new file mode 100644
index 00000000..8080d4be
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Dashboard/DashboardViewModel.js
@@ -0,0 +1,150 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Dashboard) {
+ var DashboardViewModel = (function(_super) {
+ __extends(DashboardViewModel, _super);
+ function DashboardViewModel(disableRefresh) {
+ _super.call(this);
+ this._isInitialized = false;
+ this._isOnline = false;
+ this._networkStatusBinding = null;
+ this._dashboardRefreshEvents = null;
+ this._refreshOnDashboardThaw = false;
+ this._dashboardFrozen = false;
+ this._pageTypeId = MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash;
+ var servicelocator = MS.Entertainment.ServiceLocator;
+ this._networkStatusBinding = WinJS.Binding.bind(servicelocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ if (!disableRefresh)
+ this._dashboardRefreshEvents = MS.Entertainment.UI.Framework.addEventHandlers(servicelocator.getService(MS.Entertainment.Services.dashboardRefresher), {refreshDashboard: this._dashboardRefreshChanged.bind(this)});
+ this._isInitialized = true
+ }
+ DashboardViewModel.prototype.dispose = function() {
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ if (this._dashboardRefreshEvents) {
+ this._dashboardRefreshEvents.cancel();
+ this._dashboardRefreshEvents = null
+ }
+ };
+ DashboardViewModel.prototype.dashboardFreezeHandler = function() {
+ this._dashboardFrozen = true
+ };
+ DashboardViewModel.prototype.dashboardThawHandler = function() {
+ if (this._refreshOnDashboardThaw && this._isInitialized) {
+ this._refreshOnDashboardThaw = false;
+ WinJS.Promise.timeout(MS.Entertainment.UI.DashboardRefresherService.refreshDelayTime).done(function timeoutFunction() {
+ this.getItems(true)
+ }.bind(this))
+ }
+ this._dashboardFrozen = false
+ };
+ DashboardViewModel.prototype.getItems = function(refreshing) {
+ return WinJS.Promise.wrapError("getItems must be implemented by derived classes")
+ };
+ DashboardViewModel.prototype.onOnScreen = function() {
+ this.dashboardThawHandler()
+ };
+ DashboardViewModel.prototype.onOffScreen = function() {
+ this._dashboardFrozen = true
+ };
+ DashboardViewModel.prototype._dashboardRefreshChanged = function() {
+ if (!this._isInitialized)
+ return;
+ if (!this._dashboardFrozen)
+ this._refreshData();
+ else
+ this._refreshOnDashboardThaw = true
+ };
+ DashboardViewModel.prototype._refreshData = function(){};
+ DashboardViewModel.prototype._onNetworkStatusChanged = function(newValue) {
+ var isOnline = false;
+ switch (newValue) {
+ case 0:
+ case 1:
+ case 2:
+ isOnline = true;
+ break;
+ case 3:
+ case 4:
+ case 5:
+ isOnline = false;
+ break
+ }
+ if (isOnline !== this._isOnline) {
+ this._isOnline = isOnline;
+ if (this._isOnline && this._isInitialized)
+ this.getItems()
+ }
+ };
+ DashboardViewModel.areArraysEqual = function(first, second, comparer) {
+ if (!first || !second || first.length != second.length)
+ return false;
+ for (var i = 0; i < first.length; i++)
+ if (!comparer(first[i], second[i]))
+ return false;
+ return true
+ };
+ DashboardViewModel._getPivotName = function(domElement) {
+ var currentElement = domElement;
+ var pivotName = String.empty;
+ while (currentElement && !pivotName) {
+ pivotName = currentElement.getAttribute("data-ent-pivotname") || String.empty;
+ currentElement = currentElement.parentElement
+ }
+ return pivotName
+ };
+ DashboardViewModel._getLocation = function(domElement) {
+ var pivotName = DashboardViewModel._getPivotName(domElement);
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).getUserLocation() + (pivotName ? "/" + pivotName : String.empty)
+ };
+ DashboardViewModel.prototype._wrapAction = function(action) {
+ var wrappedAction = new MS.Entertainment.UI.Actions.Action;
+ var getLocation = DashboardViewModel._getLocation;
+ var pageTypeId = this._pageTypeId;
+ wrappedAction.automationId = action.automationId;
+ wrappedAction.canExecute = function canExecute(params) {
+ return action.canExecute(params)
+ };
+ wrappedAction.executed = function executed(params) {
+ var domElement = this.referenceContainer && this.referenceContainer.domElement;
+ var pivotName = null;
+ if (domElement)
+ var location = getLocation(domElement);
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ itemPropertyBag: {
+ serviceId: action.automationId, catalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.App, sourceId: MS.Entertainment.Utilities.Telemetry.ContentSourceId.App, typeId: MS.Entertainment.Utilities.Telemetry.ContentTypeId.App
+ }, domElement: domElement
+ }, {
+ uri: getLocation(domElement), pageTypeId: pageTypeId
+ }, {
+ uri: (action.parameter && action.parameter.page) || MS.Entertainment.UI.Monikers.fullScreenNowPlaying, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ action.execute()
+ };
+ return wrappedAction
+ };
+ return DashboardViewModel
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Dashboard.DashboardViewModel = DashboardViewModel
+ })(UI.Dashboard || (UI.Dashboard = {}));
+ var Dashboard = UI.Dashboard
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Immersive.html b/packages/microsoft.zunevideo/Components/Immersive/Immersive.html
new file mode 100644
index 00000000..9aaf093e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Immersive.html
@@ -0,0 +1,110 @@
+
+
+
+
+ Immersive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Immersive.js b/packages/microsoft.zunevideo/Components/Immersive/Immersive.js
new file mode 100644
index 00000000..e2ab0145
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Immersive.js
@@ -0,0 +1,385 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/corefx.js", "/Framework/serviceLocator.js", "/Framework/utilities.js", "/ViewModels/MediaItemModel.js");
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {Immersive: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Immersive.html#immersiveTemplate", function immersiveConstructor(element, options) {
+ this._navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._page = this._navigationService.currentPage;
+ this.options = this._page.options || {};
+ this.options.panelOptions = this.options.panelOptions || {};
+ this.options.initialFrame = -1;
+ this.options.completeCallback = this.options.completeCallback || null;
+ var mediaItem = this.options.mediaItem;
+ if (mediaItem) {
+ if (mediaItem.serviceType === MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem)
+ mediaItem = MS.Entertainment.Utilities.convertEditorialItem(mediaItem);
+ this.mediaItem = Array.isArray(mediaItem) ? mediaItem : MS.Entertainment.ViewModels.MediaItemModel.augment(mediaItem)
+ }
+ this._uiStateService.nowPlayingInset = !this.options.startFullScreen;
+ this._uiStateService.nowPlayingVisible = this.options.startFullScreen || !!this.options.sessionId;
+ if (MS.Entertainment.Utilities.isApp2) {
+ this._previousVoicePhrase = String.load(String.id.IDS_PREVIOUS_PAGE_VUI_ALM);
+ this._previousVoicePhoneticPhrase = String.load(String.id.IDS_PREVIOUS_PAGE_VUI_PRON);
+ this._previousVoiceConfidence = String.load(String.id.IDS_PREVIOUS_PAGE_VUI_CONF);
+ this._nextVoicePhrase = String.load(String.id.IDS_NEXT_PAGE_VUI_ALM);
+ this._nextVoicePhoneticPhrase = String.load(String.id.IDS_NEXT_PAGE_VUI_PRON);
+ this._nextVoiceConfidence = String.load(String.id.IDS_NEXT_PAGE_VUI_CONF)
+ }
+ }, {
+ _initialized: false, _playbackSessionBindings: null, _bindings: null, _page: null, _playbackSession: null, _initialFocusSet: false, _navigationBindings: null, _selectionEventBindings: null, _galleryEventBindings: null, _selectionManager: null, _hideFirstPivot: false, _navigationService: null, _uiStateService: null, _restorePlaybackState: null, _previousVoiceConfidence: null, _previousVoicePhrase: null, _previousVoicePhoneticPhrase: null, _nextVoiceConfidence: null, _nextVoicePhrase: null, _nextVoicePhoneticPhrase: null, _maxVoiceScrollStyle: "maxScrolled", _scrollEventHandler: null, initialize: function initialize() {
+ var createPageTitle = this.mediaItem && (MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isMusicApp2);
+ var createSecondaryTitle = this.mediaItem && MS.Entertainment.Utilities.isVideoApp;
+ if (createPageTitle)
+ this._createPageTitle();
+ if (createSecondaryTitle)
+ this._createSecondaryTitle();
+ if (MS.Entertainment.Utilities.isMusicApp1 && !this._selectionManager)
+ this._selectionManager = new MS.Entertainment.UI.Controls.AppBarSelectionManager(this.domElement);
+ var hubStripVisibleEvent = document.createEvent("Event");
+ hubStripVisibleEvent.initEvent("HubStripVisible", true, true);
+ if (this.domElement)
+ this.domElement.dispatchEvent(hubStripVisibleEvent);
+ if (this.mediaItem)
+ this._updateMetaData(this.mediaItem);
+ else if (!this._uiStateService.isSnapped)
+ MS.Entertainment.UI.Controls.assert(false, "Immersive details not supplied with a mediaItem.");
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ this._scrollEventHandler = MS.Entertainment.UI.Framework.addEventHandlers(this._scroller, {scroll: function immersive_scroll() {
+ if (this._uiStateService.isSnapped)
+ this._scroller.scrollLeft = 0
+ }.bind(this)});
+ this._bindings = WinJS.Binding.bind(this, {
+ _uiStateService: {
+ nowPlayingInset: function nowPlayingInsetChanged(newVal, oldVal) {
+ if (!this.frozen) {
+ if (!newVal && oldVal !== undefined)
+ this._bringFrameIntoView(0, true);
+ else if (newVal && !oldVal && oldVal !== undefined && !this._uiStateService.nowPlayingVisible) {
+ var frame = this.frameViewModel.frames.item(1);
+ if (frame)
+ this._focusFrame(frame)
+ }
+ if (newVal) {
+ WinJS.Utilities.removeClass(this.immersiveControl.domElement, "immersiveDetailsHubStripNoScroll");
+ WinJS.Utilities.removeClass(this.immersiveControl.domElement, "hideBackground")
+ }
+ else {
+ WinJS.Utilities.addClass(this.immersiveControl.domElement, "immersiveDetailsHubStripNoScroll");
+ WinJS.Utilities.addClass(this.immersiveControl.domElement, "hideBackground")
+ }
+ }
+ }.bind(this), isSnapped: function isSnappedChanged(newVal, oldVal) {
+ if (newVal) {
+ this.immersiveControl.domElement.style.overflow = "hidden";
+ this._scroller.style.overflow = "hidden";
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this._bringFrameIntoView(0, true);
+ this._clearItemControlSelection()
+ }
+ else if (oldVal !== undefined) {
+ this.immersiveControl.domElement.style.overflow = String.empty;
+ this._scroller.style.overflow = String.empty
+ }
+ }.bind(this)
+ }, _page: {options: this._pageOptionsChanged.bind(this)}
+ });
+ if (MS.Entertainment.Utilities.isApp2)
+ this._attachApp2Handlers();
+ if (this.options.sessionId) {
+ this._playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).getSession(this.options.sessionId);
+ this._playbackSessionBindings = WinJS.Binding.bind(this, {_playbackSession: {currentMedia: function onCurrentMediaChanged(currentMedia, oldMedia) {
+ if (currentMedia && oldMedia && !currentMedia.isEqual(oldMedia) && MS.Entertainment.Platform.PlaybackHelpers.isAnyMusic(currentMedia))
+ this._updateMetaData(currentMedia)
+ }.bind(this)}})
+ }
+ this._initialized = true
+ }, _clearItemControlSelection: function _clearItemControlSelection() {
+ if (this._selectionManager)
+ this._selectionManager.clearSelection()
+ }, _detachBindings: function _detachBindings() {
+ this._detachPlaybackSessionBindings();
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }, _detachPlaybackSessionBindings: function _detachPlaybackSessionBindings() {
+ if (this._playbackSessionBindings) {
+ this._playbackSessionBindings.cancel();
+ this._playbackSessionBindings = null
+ }
+ }, unload: function unload() {
+ this._detachBindings();
+ if (this._scrollEventHandler) {
+ this._scrollEventHandler.cancel();
+ this._scrollEventHandler = null
+ }
+ if (this._pageScroller) {
+ this._pageScroller.dispose();
+ this._pageScroller = null
+ }
+ this._unshareMediaItem();
+ if (this.mediaItem) {
+ if (this.mediaItem.liveQuery && this.mediaItem.liveQuery.dispose)
+ this.mediaItem.liveQuery.dispose();
+ this.mediaItem.liveQuery = null
+ }
+ if (this.frameViewModel && this.frameViewModel.dispose)
+ this.frameViewModel.dispose();
+ if (this._selectionManager) {
+ this._selectionManager.dispose();
+ this._selectionManager = null
+ }
+ if (this._galleryEventBindings) {
+ this._galleryEventBindings.cancel();
+ this._galleryEventBindings = null
+ }
+ if (this._navigationBindings) {
+ this._navigationBindings.cancel();
+ this._navigationBindings = null
+ }
+ this._clearItemControlSelection();
+ if (this._restorePlaybackState)
+ this._restorePlaybackState.cancel();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function immersive_freeze() {
+ var appBar;
+ this.frozen = true;
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible)
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible = false;
+ appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.repossessNowPlaying)
+ appBar.repossessNowPlaying()
+ }
+ if (this.frameViewModel && this.frameViewModel.freeze)
+ this.frameViewModel.freeze();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function immersive_thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this.frozen = false;
+ if (this.frameViewModel && this.frameViewModel.thaw)
+ this.frameViewModel.thaw()
+ }, _createPageTitle: function _createPageTitle() {
+ var pageTitleContainer = document.createElement("div");
+ WinJS.Utilities.addClass(pageTitleContainer, "immersivePageTitle");
+ this._titleContainer.appendChild(pageTitleContainer);
+ var templateName = MS.Entertainment.Utilities.isVideoApp ? "/Components/Immersive/Immersive.html#immersivePageTitle" : "/Components/Immersive/Immersive.html#immersiveMediaPageTitle";
+ MS.Entertainment.UI.Framework.loadTemplate(templateName).then(function(template) {
+ return template.render(this, pageTitleContainer)
+ }.bind(this))
+ }, _createSecondaryTitle: function _createSecondaryTitle() {
+ var secondaryTitleContainer = document.createElement("div");
+ WinJS.Utilities.addClass(secondaryTitleContainer, "immersivePageTitle");
+ this._scroller.appendChild(secondaryTitleContainer);
+ var templateName = "/Components/Immersive/Immersive.html#immersiveSecondaryPageTitle";
+ MS.Entertainment.UI.Framework.loadTemplate(templateName).then(function(template) {
+ return template.render(this, secondaryTitleContainer)
+ }.bind(this))
+ }, _heroScreenRatio: 0.66, _backButtonSize: 60, _pivotOffset: 40, _attachApp2Handlers: function _attachApp2Handlers() {
+ WinJS.Utilities.removeClass(this.nextPageScroller, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.previousPageScroller, "removeFromDisplay");
+ if (this._scroller && this.immersiveControl && this.immersiveControl.domElement) {
+ this._pageScroller = new MS.Entertainment.UI.Controls.PageScroller(this._scroller, this.nextPageScroller, this.previousPageScroller, this.immersiveControl.domElement);
+ this._pageScroller.logicalContainerSelector = "[data-ent-type~='pageScrollerFrame']"
+ }
+ }, _pageOptionsChanged: function _pageOptionsChanged(newVal, oldVal) {
+ if (oldVal && ((oldVal.mediaItem.isEqual && oldVal.mediaItem.isEqual(newVal.mediaItem)) || (newVal.mediaItem.isChildOf && newVal.mediaItem.isChildOf(oldVal.mediaItem)) || (Array.isArray(newVal.mediaItem) || newVal.mediaItem.execute)))
+ if (this.frameViewModel) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset = !newVal.startFullScreen;
+ this.frameViewModel.sessionId = newVal.sessionId;
+ WinJS.Promise.timeout(250).then(function _delayLoad() {
+ this._bringFrameIntoView(0, true)
+ }.bind(this))
+ }
+ }, _updateMetaData: function _updateMetaData(mediaItem) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPart, parameterValue: MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Immersive
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPath, parameterValue: this._navigationService.getUserLocation()
+ }];
+ this.metadataMediaItem = mediaItem;
+ if (Array.isArray(mediaItem) || mediaItem.execute) {
+ if (Array.isArray(mediaItem) && mediaItem.length > 0)
+ this._updateMetaData(mediaItem[0]);
+ else if (mediaItem.execute) {
+ var queryComplete = function executeSuccess(q) {
+ if (q.result.items)
+ q.result.items.toArray().then(function(items) {
+ this._updateMetaData(items)
+ }.bind(this))
+ }.bind(this);
+ mediaItem.execute().then(queryComplete.bind(this), function queryFailed(error){})
+ }
+ return
+ }
+ var isNewViewModel = true;
+ switch (mediaItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ MS.Entertainment.UI.Controls.assert(false, "We don't support games anymore");
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(mediaItem))
+ this.frameViewModel = new MS.Entertainment.ViewModels.TvImmersiveViewModel;
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(mediaItem) && mediaItem.artist) {
+ this._convertToArtist(mediaItem);
+ return
+ }
+ else {
+ this.frameViewModel = new MS.Entertainment.ViewModels.MovieImmersiveViewModel;
+ this._hideFirstPivot = true;
+ if (mediaItem.hasZuneId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZuneId, parameterValue: mediaItem.zuneId
+ });
+ else if (mediaItem.hasCanonicalId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanonicalId, parameterValue: mediaItem.canonicalId
+ })
+ }
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ this.frameViewModel = new MS.Entertainment.ViewModels.TvImmersiveViewModel;
+ if (mediaItem.seriesId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SeriesId, parameterValue: mediaItem.seriesId
+ });
+ else if (mediaItem.hasZuneId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZuneId, parameterValue: mediaItem.zuneId
+ });
+ else if (mediaItem.hasCanonicalId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanonicalId, parameterValue: mediaItem.canonicalId
+ });
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ if (mediaItem.artistServiceId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ArtistServiceId, parameterValue: mediaItem.artistServiceId
+ });
+ else if (mediaItem.hasZuneId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZuneId, parameterValue: mediaItem.zuneId
+ });
+ else if (mediaItem.hasCanonicalId)
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanonicalId, parameterValue: mediaItem.canonicalId
+ });
+ if (!this.frameViewModel)
+ this.frameViewModel = new MS.Entertainment.ViewModels.ArtistImmersiveViewModel;
+ else
+ isNewViewModel = false;
+ break
+ }
+ MS.Entertainment.UI.Controls.assert(this.frameViewModel, "Immersive details didn't get a valid viewmodel.");
+ if (!this.frameViewModel || !this.frameViewModel.updateMetaData) {
+ this._navigationService.navigateToDefaultPage();
+ return
+ }
+ var hydratePromise = this.frameViewModel.updateMetaData(mediaItem, this.options.startFullScreen);
+ MS.Entertainment.UI.Controls.assert(this.frameViewModel.frames.length > 0, "Immersive details viewmodel didn't create any frames.");
+ if (!this.frameViewModel.frames.length) {
+ this._navigationService.navigateToDefaultPage();
+ return
+ }
+ if (this.frameViewModel.frames.item(0).isFullScreen === undefined)
+ this.frameViewModel.frames.item(0).addProperty("isFullScreen", this.options.startFullScreen);
+ hydratePromise.then(function mediaHydrated(mediaItem) {
+ if (mediaItem && !mediaItem.isFailed) {
+ if (this.frameViewModel.backgroundImageUri)
+ this._loadBackgroundImage(this.frameViewModel.backgroundImageUri);
+ WinJS.Promise.timeout().done(function shareMediaAfterTimeout() {
+ this._shareMediaItem(mediaItem)
+ }.bind(this));
+ this.mediaName = mediaItem.name;
+ if (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ var nameOverride = mediaItem.seriesTitle || mediaItem.primaryText || mediaItem.name;
+ if (nameOverride)
+ this.mediaName = nameOverride
+ }
+ }
+ if (this.options)
+ this.options.mediaItem = mediaItem
+ }.bind(this));
+ this.frameViewModel.sessionId = this.options.sessionId;
+ if (isNewViewModel)
+ this.frameViewModel.frames.addChangeListener(this._handleFramesChanged.bind(this));
+ this._handleFramesChanged();
+ if (this.options.completeCallback)
+ if (this.frameViewModel.handleNavigationCompleteCallback)
+ this.frameViewModel.navigationCompleteCallback = this.options.completeCallback;
+ else
+ this.options.completeCallback(true);
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ImmersiveDetailsMetaDataUpdated, telemetryParameterArray)
+ }, _handleFramesChanged: function _handleFramesChanged() {
+ WinJS.Promise.timeout().then(function() {
+ if (this.options.hub || this.options.initialFrame > 0) {
+ for (var i = 0; i < this.frameViewModel.frames.length; i++)
+ if (this.frameViewModel.frames.item(i).moniker === this.options.hub)
+ this.options.initialFrame = i;
+ if (this.options.initialFrame > -1 && this.options.initialFrame < this.frameViewModel.frames.length)
+ this._bringFrameIntoView(this.options.initialFrame, true)
+ }
+ else if (!this._initialFocusSet && this.immersiveControl && this.immersiveControl.dataSource && this.frameViewModel.frames.length > 1 && this.frameViewModel.skipInitialFocus !== true)
+ if (this._focusFrame(this.frameViewModel.frames.item(0)))
+ this._initialFocusSet = true
+ }.bind(this))
+ }, _focusFrame: function _focusFrame(frame, frameIndex) {
+ var element = this.immersiveControl.getElementForItem(frame);
+ if (element)
+ MS.Entertainment.UI.Framework.waitForControlToInitialize(element).then(function() {
+ return WinJS.Promise.timeout(700)
+ }).then(function() {
+ if (!this._scroller.isAnimatingScroll)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(element);
+ if (frameIndex !== undefined && frameIndex === this.options.initialFrame && this.options.showInitialFrameViewMore && frame.showViewMore)
+ frame.showViewMore()
+ }.bind(this));
+ return element
+ }, _bringFrameIntoView: function _bringFrameIntoView(frameIndex, focusAfterScrolling) {
+ if (this.immersiveControl && this.frameViewModel && this.frameViewModel.frames.length > 0)
+ this.immersiveControl.bringItemIntoView(this.frameViewModel.frames.item(frameIndex), {bringOnMinimally: true}).then(function() {
+ if (focusAfterScrolling)
+ this._focusFrame(this.frameViewModel.frames.item(frameIndex), frameIndex)
+ }.bind(this))
+ }, _convertToArtist: function _convertToArtist(mediaItem) {
+ mediaItem = mediaItem.artist || {};
+ mediaItem = MS.Entertainment.ViewModels.MediaItemModel.augment(mediaItem);
+ this._updateMetaData(mediaItem)
+ }, _shareMediaItem: function _shareMediaItem(overrideMediaItem) {
+ var sender = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ if (sender) {
+ overrideMediaItem = overrideMediaItem || this.mediaItem;
+ if (!this.nowPlayingVisible && overrideMediaItem) {
+ this._unshareMediaItem();
+ this._shareOperation = sender.pendingShare(overrideMediaItem)
+ }
+ }
+ }, _unshareMediaItem: function _unshareMediaItem() {
+ if (this._shareOperation) {
+ this._shareOperation.cancel();
+ this._shareOperation = null
+ }
+ }, _loadBackgroundImage: function _loadBackgroundImage(backgroundImageUri) {
+ if (backgroundImageUri)
+ MS.Entertainment.UI.Shell.ImageLoader.cacheImage(backgroundImageUri, String.empty).done(function cacheImage(url) {
+ this.backgroundImageUri = url
+ }.bind(this))
+ }
+ }, {
+ backgroundImageUri: String.empty, frameViewModel: null, options: null, mediaItem: null, metadataMediaItem: null, mediaName: String.empty, frozen: false
+ }, {makeFrame: function makeFrame(heading, columnSpan, control, viewMoreContentUrl, moniker, disableHeaderButton) {
+ if (!heading && MS.Entertainment.Utilities.isVideoApp2)
+ heading = String.load(String.id.IDS_HOME_PIVOT);
+ return WinJS.Binding.as({
+ heading: heading, visible: false, viewMoreHeading: heading, disableHeaderButton: disableHeaderButton, viewMoreSubHeading: null, title: heading, columnSpan: columnSpan, getData: null, viewMoreInfo: {
+ icon: MS.Entertainment.UI.Icon.nowPlayingNext, title: String.load(String.id.IDS_DETAILS_VIEW_MORE)
+ }, hideViewMoreIfEnoughSpace: false, overviewConstructor: control, viewMoreTemplate: viewMoreContentUrl, moniker: moniker
+ })
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/ImmersiveNavStub.html b/packages/microsoft.zunevideo/Components/Immersive/ImmersiveNavStub.html
new file mode 100644
index 00000000..0b254344
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/ImmersiveNavStub.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Immersive Details Page
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/BaseImmersiveOverviewSummary.js b/packages/microsoft.zunevideo/Components/Immersive/Shared/BaseImmersiveOverviewSummary.js
new file mode 100644
index 00000000..15147fe4
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/BaseImmersiveOverviewSummary.js
@@ -0,0 +1,25 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js", "/Components/Immersive/Shared/BaseImmersiveSummary.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BaseImmersiveOverviewSummary: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", null, function baseImmersiveOverviewSummary() {
+ if (this.usesSmartBuyStateEngine)
+ this.smartBuyStateEngine = this._createSmartBuyStateEngine()
+ }, {
+ controlName: "ImmersiveOverviewSummary", usesSmartBuyStateEngine: true, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.initialize.apply(this, arguments);
+ if (MS.Entertainment.UI.Controls.UserFeedbackDialog)
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.inlineDetailsItem = this.dataContext
+ }, unload: function unload() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.unload();
+ this.smartBuyStateEngine = null
+ }
+ if (MS.Entertainment.UI.Controls.UserFeedbackDialog)
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.inlineDetailsItem = null;
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.unload.call(this)
+ }, _createSmartBuyStateEngine: function _createSmartBuyStateEngine() {
+ return new MS.Entertainment.ViewModels.SmartBuyStateEngine
+ }
+ }, {smartBuyStateEngine: null})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/BaseImmersiveSummary.js b/packages/microsoft.zunevideo/Components/Immersive/Shared/BaseImmersiveSummary.js
new file mode 100644
index 00000000..d815a0af
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/BaseImmersiveSummary.js
@@ -0,0 +1,8 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/ViewModels/MediaItemModel.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BaseImmersiveSummary: MS.Entertainment.UI.Framework.defineUserControl(null, function baseImmersiveSummary(){}, {
+ controlName: "BaseImmersiveSummary", initialize: function initialize(){}
+ }, {dataContext: null})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/MoreGalleryControl.html b/packages/microsoft.zunevideo/Components/Immersive/Shared/MoreGalleryControl.html
new file mode 100644
index 00000000..0a46e8b2
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/MoreGalleryControl.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/MoreGalleryControl.js b/packages/microsoft.zunevideo/Components/Immersive/Shared/MoreGalleryControl.js
new file mode 100644
index 00000000..3d96de77
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/MoreGalleryControl.js
@@ -0,0 +1,62 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {DynamicMoreGalleryControl: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Shared/MoreGalleryControl.html#dynamicMoreGalleryControlTemplate", function moreGalleryControlBase(element, options) {
+ this.dataContext = MS.Entertainment.UI.Controls.DynamicMoreGalleryControl.emptyDataContext
+ }, {
+ initialize: function initialize() {
+ if (this.dataContext && this.dataContext.begin)
+ this.dataContext.begin();
+ this._initializeSelectionHandlers()
+ }, _initializeSelectionHandlers: function _initializeSelectionHandlers() {
+ if (this._gallery.selectionMode !== MS.Entertainment.UI.Controls.GalleryControl.SelectionMode.none) {
+ var defaultSelectionHandlers = MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers(this._clearSelection.bind(this));
+ this._gallery.addSelectionHandlers(defaultSelectionHandlers);
+ this._gallery.addSelectionHandlers({deleteMedia: this._handleItemDeleted.bind(this)})
+ }
+ }, _handleItemDeleted: function _handleItemDeleted(deleted) {
+ if (deleted)
+ this._clearSelection()
+ }, _clearSelection: function _clearSelection() {
+ this._gallery.clearSelection()
+ }
+ }, {dataContext: null}, {emptyDataContext: {
+ view: null, items: null, selectedTemplate: null, modifierSelectionManager: null
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MoreGalleryControl: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Shared/MoreGalleryControl.html#MoreGalleryControl", function moreGalleryControlConstructor(element, options)
+ {
+ this.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(null, 0)
+ }, {
+ _bindings: null, _skipReloadOnBind: false, initialize: function initialize() {
+ if (this.dataContext.getModifierDataSource)
+ this.dataContext.getModifierDataSource().then(function getModifierFromDataContext(modifierItems) {
+ this.modifierSelectionManager.dataSource = new MS.Entertainment.ObservableArray(modifierItems)
+ }.bind(this));
+ else
+ this.reload();
+ if (this.dataContext.defaultSelectionIndex)
+ this.modifierSelectionManager.selectedIndex = this.dataContext.defaultSelectionIndex;
+ this._skipReloadOnBind = true;
+ this._bindings = WinJS.Binding.bind(this, {modifierSelectionManager: {selectedIndex: this.reload.bind(this)}});
+ this._skipReloadOnBind = false
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this.dataContext && this.dataContext.defaultSelectionIndex)
+ this.dataContext.defaultSelectionIndex = 0;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, reload: function reload(newIndex, oldIndex) {
+ if (!this._skipReloadOnBind)
+ this.dataContext.getItems(this.modifierSelectionManager.selectedItem).then(function getItemsFromDataContext(items) {
+ this.galleryItems = items
+ }.bind(this)).then(function _setFocus() {
+ this._gallery.focusFirstItemOnPageLoad = true
+ }.bind(this))
+ }
+ }, {
+ dataContext: null, galleryItems: null, modifierSelectionManager: null, itemTemplate: String.empty, panelTemplate: String.empty, inlineExtraData: null
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedGridItems.html b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedGridItems.html
new file mode 100644
index 00000000..13a9c6c2
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedGridItems.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedGridItems.js b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedGridItems.js
new file mode 100644
index 00000000..7788e002
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedGridItems.js
@@ -0,0 +1,41 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImmersiveRelatedGridItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Shared/RelatedGridItems.html#ImmersiveRelatedGridItems", function immersiveRelatedGridItems(element, options) {
+ this.dataContext = options.dataContext || MS.Entertainment.UI.Controls.ImmersiveRelatedGridItems.emptyDataContext
+ }, {
+ className: null, fixedColumnCount: null, fixedRowCount: null, rowLayout: false, itemSize: null, itemTemplates: [], propertyName: null, initialize: function initialize() {
+ if (this.dataContext.selectedTemplate) {
+ this.className = this.dataContext.selectedTemplate.className || this.className;
+ this._grid.fixedColumnCount = this.dataContext.selectedTemplate.fixedColumnCount || this.fixedColumnCount;
+ this._grid.fixedRowCount = this.dataContext.selectedTemplate.fixedRowCount || this.fixedRowCount;
+ this._grid.rowLayout = this.dataContext.selectedTemplate.rowLayout || this.rowLayout;
+ this._grid.itemSize = this.dataContext.selectedTemplate.itemSize || this.itemSize;
+ this._grid.itemTemplates = this.dataContext.selectedTemplate.itemTemplates || this.itemTemplates;
+ this._grid.propertyName = this.dataContext.selectedTemplate.propertyName || this.propertyName
+ }
+ this._grid.dataSource = this.dataContext.items;
+ var promise = this.dataContext.previousSignal ? WinJS.Binding.unwrap(this.dataContext.previousSignal).promise : WinJS.Promise.wrap();
+ promise.done(function showFrame() {
+ this.visible = true;
+ if (this.dataContext.visibleSignal)
+ WinJS.Binding.unwrap(this.dataContext.visibleSignal).complete();
+ WinJS.Promise.timeout(1000).done(function() {
+ this.setInitialTabIndex()
+ }.bind(this))
+ }.bind(this))
+ }, setInitialTabIndex: function setInitialTabIndex() {
+ var querySelectorString = ".win-focusable";
+ var firstListItem = this.domElement && this.domElement.querySelector(querySelectorString);
+ if (firstListItem)
+ firstListItem.tabIndex = 0;
+ else
+ WinJS.Promise.timeout(1000).then(function() {
+ this.setInitialTabIndex()
+ }.bind(this))
+ }
+ }, {items: null}, {emptyDataContext: {
+ selectedTemplate: {}, items: null
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedItems.html b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedItems.html
new file mode 100644
index 00000000..52dbb3af
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedItems.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedItems.js b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedItems.js
new file mode 100644
index 00000000..8646e754
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Shared/RelatedItems.js
@@ -0,0 +1,122 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ImmersiveRelatedItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Shared/RelatedItems.html#ImmersiveRelatedItemsTemplate", function moreGalleryControlBase(element, options) {
+ this.dataContext = options.dataContext || MS.Entertainment.UI.Controls.ImmersiveRelatedItems.emptyDataContext;
+ if (this.dataContext.selectedTemplate) {
+ this.panelTemplate = this.dataContext.selectedTemplate.panelTemplateUrl || this.panelTemplate;
+ this.panelOptions = this.dataContext.selectedTemplate.panelOptions || this.panelOptions;
+ this.itemTemplate = this.dataContext.selectedTemplate.templateUrl || this.itemTemplate;
+ this.className = this.dataContext.selectedTemplate.className || this.className
+ }
+ }, {
+ className: null, initialize: function initialize() {
+ var thumbnailButton = this.domElement.querySelector(".relatedHeroItem");
+ if (thumbnailButton) {
+ thumbnailButton.tabIndex = 0;
+ WinJS.Utilities.addClass(thumbnailButton, "acc-keyboardFocusTarget");
+ WinJS.Utilities.addClass(thumbnailButton, "win-focusable");
+ thumbnailButton.addEventListener("click", this.onItemClick.bind(this));
+ thumbnailButton.addEventListener("keydown", this.onKeyDown.bind(this))
+ }
+ var querySelectorString = ".control-immersiveListViewItem";
+ var firstListItem = this.domElement.querySelector(querySelectorString);
+ if (firstListItem)
+ firstListItem.tabIndex = 0
+ }, onKeyDown: function onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onItemClick(event)
+ }, onItemClick: function onItemClick(event) {
+ var popOverParameters = {itemConstructor: this.panelTemplate};
+ popOverParameters.dataContext = {
+ data: this.dataContext.heroActionItem, location: MS.Entertainment.Data.ItemLocation.marketplace
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ }, {
+ itemTemplate: null, panelTemplate: null
+ }, {emptyDataContext: {
+ selectedTemplate: {templateUrl: null}, heroItem: {
+ name: null, description: null
+ }, items: null
+ }}), ImmersiveRelatedTileItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Shared/RelatedItems.html#ImmersiveRelatedTilesTemplate", function moreGalleryControlBase(element, options) {
+ this.dataContext = options.dataContext || MS.Entertainment.UI.Controls.ImmersiveRelatedItems.emptyDataContext;
+ if (this.dataContext.selectedTemplate) {
+ this.invokeBehavior = this.dataContext.selectedTemplate.invokeBehavior || this.invokeBehavior;
+ this.actionOptions = this.dataContext.selectedTemplate.actionOptions || this.actionOptions;
+ this.itemTemplate = this.dataContext.selectedTemplate.templateUrl || this.itemTemplate;
+ this.className = this.dataContext.selectedTemplate.className || this.className;
+ this.panelTemplate = this.dataContext.selectedTemplate.panelTemplateUrl || this.panelTemplate;
+ this.panelOptions = this.dataContext.selectedTemplate.panelOptions || this.panelOptions
+ }
+ }, {
+ initialize: function initialize() {
+ if (this.domElement) {
+ this.domElement.addEventListener("click", this.onItemClick.bind(this));
+ this.domElement.addEventListener("keypress", this.onKeyPress.bind(this))
+ }
+ }, onKeyPress: function onKeyPress(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onItemClick(event)
+ }, onItemClick: function onItemClick(event) {
+ var listItem = event.target;
+ if (!WinJS.Utilities.hasClass(listItem, "horizontalListItem"))
+ listItem = MS.Entertainment.Utilities.findParentElementByClassName(listItem, "horizontalListItem");
+ if (!listItem) {
+ listItem = event.target;
+ while (listItem && listItem !== this.domElement) {
+ if (listItem.dataContext)
+ break;
+ listItem = listItem.parentElement
+ }
+ {}
+ }
+ if (listItem && listItem.dataContext)
+ if (listItem.dataContext.action)
+ listItem.dataContext.action.execute();
+ else if (this.invokeBehavior === MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.action) {
+ Trace.assert(this.actionOptions, "RelatedItems: invokeBehavior is set as action, but there are no actionOptions");
+ Trace.assert(this.actionOptions.id, "RelatedItems: invokeBehavior is set as action, but there is no action id defined");
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var itemAction = actionService.getAction(this.actionOptions.id);
+ itemAction.parameter = this.actionOptions.parameter || {};
+ itemAction.parameter.data = listItem.dataContext;
+ itemAction.execute()
+ }
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(listItem.dataContext)) {
+ var smartBuyStateEngine;
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ var mediaContext = appBarService.pushMediaContext(listItem.dataContext, null, [], {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.invokeInline});
+ smartBuyStateEngine = new MS.Entertainment.ViewModels.SmartBuyStateEngine;
+ smartBuyStateEngine.initialize(listItem.dataContext, MS.Entertainment.ViewModels.SmartBuyButtons.getMusicVideoInlineDetailsButtons(mediaContext), MS.Entertainment.ViewModels.MusicStateHandlers.onMusicVideoInlineDetailsStateChanged);
+ var setAppbarActions = function setAppBarActions() {
+ mediaContext.setToolbarActions(smartBuyStateEngine.currentAppbarActions)
+ };
+ var smartStateEngineBindings = WinJS.Binding.bind(smartBuyStateEngine, {currentAppbarActions: setAppbarActions.bind(this)});
+ var contextualData = {
+ title: listItem.dataContext.title, subTitle: listItem.dataContext.artistName
+ };
+ listItem.dataContext.hydrate();
+ MS.Entertainment.UI.Controls.CommandingPopOver.showContextualCommands(contextualData).then(function hideComplete() {
+ smartStateEngineBindings.cancel();
+ smartStateEngineBindings = null
+ })
+ }
+ else {
+ var popOverParameters = {itemConstructor: this.panelTemplate};
+ var location = listItem.dataContext.fromCollection ? MS.Entertainment.Data.ItemLocation.collection : MS.Entertainment.Data.ItemLocation.marketplace;
+ popOverParameters.dataContext = {
+ data: listItem.dataContext, location: location
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ }
+ }, {
+ className: null, itemTemplate: null, panelTemplate: null, actionOptions: null, invokeBehavior: null
+ }, {emptyDataContext: {
+ selectedTemplate: {templateUrl: null}, items: null
+ }})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/CastAndCrew.js b/packages/microsoft.zunevideo/Components/Immersive/Video/CastAndCrew.js
new file mode 100644
index 00000000..f3719eed
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/CastAndCrew.js
@@ -0,0 +1,204 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ContributorList: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Video/MovieImmersiveTemplates.html#ContributorList", function contributorListConstructor(){}, {
+ singularTitle: null, pluralTitle: null, zeroTitle: null, _bindings: null, initialize: function initialize() {
+ this._bindings = WinJS.Binding.bind(this, {dataSource: this.dataSourceChanged.bind(this)})
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, dataSourceChanged: function listItemsChanged() {
+ if (!this.dataSource || this.dataSource.length === 0)
+ this.contributorTitle = this.zeroTitle;
+ else if (this.dataSource.length === 1)
+ this.contributorTitle = this.singularTitle;
+ else
+ this.contributorTitle = this.pluralTitle;
+ this.boundDataSource = this.dataSource
+ }
+ }, {
+ contributorTitle: null, boundDataSource: null, dataSource: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {CastAndCrewList: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Video/MovieImmersiveTemplates.html#CastAndCrew", function castAndCrewListContstructor(element, options) {
+ this.dataContext = options.dataContext || MS.Entertainment.UI.Controls.CastAndCrewList.emptyDataContext;
+ if (this.dataContext.selectedTemplate) {
+ this.panelTemplate = this.dataContext.selectedTemplate.panelTemplateUrl || this.panelTemplate;
+ this.panelOptions = this.dataContext.selectedTemplate.panelOptions || this.panelOptions;
+ this.itemTemplate = this.dataContext.selectedTemplate.templateUrl || this.itemTemplate;
+ this.className = this.dataContext.selectedTemplate.className || this.className
+ }
+ this._contributingRoleControls = {}
+ }, {
+ className: null, isViewMore: false, _bindings: null, keyboardNavigationManager: null, _focusInitialized: false, _focusEventHandlers: null, _controlListKeys: null, _contributingRoleControls: null, initialize: function initialize() {
+ this.itemsChanged = this.itemsChanged.bind(this);
+ var edsContributorRole = MS.Entertainment.Data.Augmenter.Marketplace.edsContributorRole;
+ this._controlListKeys = [edsContributorRole.creator, edsContributorRole.director, edsContributorRole.actor, edsContributorRole.writer];
+ this.loadContributingRoleControlMap();
+ this._focusEventHandlers = [MS.Entertainment.Utilities.addEvents(this, {focusin: this._focusHandler.bind(this)})];
+ if (MS.Entertainment.Utilities.isApp1)
+ this.keyboardNavigationManager = new MS.Entertainment.Framework.VerticalKeyboardNavigationManager(this.domElement, null, true);
+ else
+ for (var control in this._contributingRoleControls) {
+ this._contributingRoleControls[control].listControl.keyboardNavigable = true;
+ if (this.isViewMore)
+ this._focusEventHandlers.push(MS.Entertainment.UI.Framework.addEventHandlers(this._contributingRoleControls[control].listControl.domElement, {firstTimeRendered: this._forceFocusHandler.bind(this)}))
+ }
+ this._bindings = WinJS.Binding.bind(this, {dataContext: {items: this.itemsChanged}});
+ var promise = this.dataContext.previousSignal ? WinJS.Binding.unwrap(this.dataContext.previousSignal).promise : WinJS.Promise.wrap();
+ promise.done(function showFrame() {
+ this.visible = true;
+ if (this.dataContext.visibleSignal)
+ WinJS.Binding.unwrap(this.dataContext.visibleSignal).complete()
+ }.bind(this))
+ }, loadContributingRoleControlMap: function loadTemplates() {
+ var edsContributorRole = MS.Entertainment.Data.Augmenter.Marketplace.edsContributorRole;
+ this._contributingRoleControls[edsContributorRole.creator] = this.creatorControl;
+ this._contributingRoleControls[edsContributorRole.actor] = this.actorControl;
+ this._contributingRoleControls[edsContributorRole.director] = this.directorControl;
+ this._contributingRoleControls[edsContributorRole.writer] = this.writerControl
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._focusEventHandlers) {
+ for (var focusEventHandler in this._focusEventHandlers)
+ this._focusEventHandlers[focusEventHandler].cancel();
+ this._focusEventHandlers = null
+ }
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.unload.call(this)
+ }, _forceFocusHandler: function _forceFocusHandler() {
+ this._focusHandler(true)
+ }, _focusHandler: function _focusHandler(event) {
+ var force = event === true;
+ WinJS.Promise.timeout(1).done(function delayFocusItem() {
+ if (!this._focusInitialized || force) {
+ var querySelectorString = ".control-immersiveListViewItem";
+ var firstListItem = this.domElement.querySelector(querySelectorString);
+ if (firstListItem) {
+ if (MS.Entertainment.Utilities.isApp1 && !this.isViewMore)
+ this.keyboardNavigationManager.setFocusedItem(firstListItem, true);
+ else if (this.isViewMore)
+ MS.Entertainment.UI.Framework.focusElement(firstListItem);
+ if (this._focusInitialized)
+ return;
+ this._focusEventHandlers.push(MS.Entertainment.Utilities.addEvents(firstListItem, {focusin: this._scrollToTop.bind(this)}));
+ for (var contributingRole in this._contributingRoleControls)
+ if (this._contributingRoleControls[contributingRole] && this._contributingRoleControls[contributingRole].listControl && this._contributingRoleControls[contributingRole].listControl.domElement)
+ this._contributingRoleControls[contributingRole].listControl.domElement.tabIndex = -1;
+ this._setControlFocusDirectionOverrides();
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(this.domElement))
+ this._focusInitialized = true
+ }
+ }
+ }.bind(this))
+ }, _setControlFocusDirectionOverrides: function _setControlFocusDirectionOverrides() {
+ if (this.isViewMore)
+ return;
+ var leftOfCastAndCrew = null;
+ var leftOfCastAndCrewViewMore = null;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var criticReviewsVisible = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.rottenTomatoes) && this.dataContext && this.dataContext._mediaItem && this.dataContext._mediaItem.criticReview && this.dataContext._mediaItem.criticReview.reviewScore > 0);
+ if (criticReviewsVisible) {
+ leftOfCastAndCrew = MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel.cssSelectors.rottenTomatoesOverview;
+ leftOfCastAndCrewViewMore = MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel.cssSelectors.rottenTomatoesViewMore
+ }
+ else {
+ leftOfCastAndCrew = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.smartBuyButton;
+ leftOfCastAndCrewViewMore = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.movieHeroViewMore
+ }
+ var belowCastAndCrew = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp;
+ if (this.dataContext && this.dataContext.frame && !this.dataContext.frame.hideViewMoreIfEnoughSpace)
+ belowCastAndCrew = MS.Entertainment.UI.Controls.CastAndCrewList.cssSelectors.castAndCrewViewMore;
+ var middleCastAndCrewItemFocusDirectionMap = JSON.stringify({
+ left: leftOfCastAndCrew, right: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related
+ });
+ var topCastAndCrewItemFocusDirectionMap = JSON.stringify({
+ left: leftOfCastAndCrew, right: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related, up: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp
+ });
+ var bottomCastAndCrewItemFocusDirectionMap = JSON.stringify({
+ left: leftOfCastAndCrew, right: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related, down: belowCastAndCrew
+ });
+ var bottomCastAndCrewItemClass = "bottomCastAndCrewItem";
+ var castAndCrewItems = this.domElement.querySelectorAll(MS.Entertainment.UI.Controls.CastAndCrewList.cssSelectors.castAndCrewMember);
+ if (castAndCrewItems && castAndCrewItems.length > 0) {
+ if (castAndCrewItems.length === 1) {
+ var onlyCastAndCrewItemFocusDirectionMap = JSON.stringify({
+ left: leftOfCastAndCrew, right: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related, down: belowCastAndCrew, up: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp
+ });
+ castAndCrewItems[0].setAttribute("data-win-focus", onlyCastAndCrewItemFocusDirectionMap);
+ WinJS.Utilities.addClass(castAndCrewItems[0], bottomCastAndCrewItemClass)
+ }
+ else {
+ castAndCrewItems[0].setAttribute("data-win-focus", topCastAndCrewItemFocusDirectionMap);
+ WinJS.Utilities.removeClass(castAndCrewItems[0], bottomCastAndCrewItemClass);
+ castAndCrewItems[castAndCrewItems.length - 1].setAttribute("data-win-focus", bottomCastAndCrewItemFocusDirectionMap);
+ WinJS.Utilities.addClass(castAndCrewItems[castAndCrewItems.length - 1], bottomCastAndCrewItemClass)
+ }
+ for (var i = 1; i < castAndCrewItems.length - 1; i++) {
+ castAndCrewItems[i].setAttribute("data-win-focus", middleCastAndCrewItemFocusDirectionMap);
+ WinJS.Utilities.removeClass(castAndCrewItems[i], bottomCastAndCrewItemClass)
+ }
+ }
+ var bottomCastAndCrewItemSelector = ".currentPage ." + bottomCastAndCrewItemClass;
+ var castAndCrewViewMoreItemFocusDirectionMap = JSON.stringify({
+ left: leftOfCastAndCrewViewMore, right: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related, down: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp, up: bottomCastAndCrewItemSelector
+ });
+ var castAndCrewViewMore = document.querySelector(MS.Entertainment.UI.Controls.CastAndCrewList.cssSelectors.castAndCrewViewMore);
+ if (castAndCrewViewMore)
+ castAndCrewViewMore.setAttribute("data-win-focus", castAndCrewViewMoreItemFocusDirectionMap)
+ }, _scrollToTop: function _scrollToTop() {
+ if (this.domElement)
+ this.domElement.scrollTop = 0;
+ if (this.isViewMore && this._criticReviewList && this._criticReviewList.children && this._criticReviewList.children.length > 0)
+ this._criticReviewList.children[0].scrollIntoView()
+ }, itemsChanged: function itemsChanged() {
+ if (this.dataContext && this.dataContext.items) {
+ this.dataContext.items.forEach(function itemIterator(currentItem) {
+ if (currentItem.role)
+ if (this._contributingRoleControls[currentItem.role]) {
+ var currentRoleControl = this._contributingRoleControls[currentItem.role];
+ if (!currentRoleControl.itemList)
+ currentRoleControl.itemList = new MS.Entertainment.ObservableArray;
+ currentRoleControl.itemList.push(currentItem)
+ }
+ else
+ MS.Entertainment.Framework.fail("Unknown contributing roletype: " + currentItem.role)
+ }.bind(this));
+ for (var index = 0; index < this._controlListKeys.length; index++) {
+ var currentRoleControl = this._contributingRoleControls[this._controlListKeys[index]];
+ if (currentRoleControl.itemList) {
+ currentRoleControl.dataSource = currentRoleControl.itemList;
+ currentRoleControl.itemList = null
+ }
+ }
+ }
+ }
+ }, {visible: false}, {
+ cssSelectors: {
+ castAndCrewViewMore: ".currentPage .viewMoreRow.cast .template-moreButton .win-focusable", castAndCrewMember: ".currentPage .control-contributorList .control-immersiveListViewItemContainer .control-immersiveListViewItem"
+ }, emptyDataContext: {
+ selectedTemplate: {templateUrl: null}, items: null
+ }, makeCastAndCrewFrame: function loadCastAndCrewFrame(mediaItem, previousSignal, visibleSignal) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var castAndCrewEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.castAndCrew);
+ if (!MS.Entertainment.UI.NetworkStatusService.isOnline() || !castAndCrewEnabled || !mediaItem || !mediaItem.contributors || !mediaItem.contributors.length > 0)
+ return WinJS.Promise.wrap();
+ var castAndCrewViewModel = new MS.Entertainment.ViewModels.CastAndCrewViewModel(mediaItem);
+ castAndCrewViewModel.visibleSignal = visibleSignal;
+ castAndCrewViewModel.previousSignal = previousSignal;
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(String.load(String.id.IDS_VIDEO_CAST_HEADING), 1, MS.Entertainment.UI.Controls.CastAndCrewList, "/Components/Immersive/Video/CastAndCrewMore.html", MS.Entertainment.ViewModels.MovieImmersiveViewModel.Monikers.cast, MS.Entertainment.Utilities.isVideoApp2);
+ frame.hideViewMoreIfEnoughSpace = castAndCrewViewModel.maxItems === 0 || mediaItem.contributors.length <= castAndCrewViewModel.maxItems;
+ frame.visibleSignal = visibleSignal;
+ frame.getData = function relatedGetData() {
+ castAndCrewViewModel.frame = frame;
+ return WinJS.Promise.wrap(castAndCrewViewModel)
+ };
+ return WinJS.Promise.wrap(frame)
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/CastAndCrewMore.html b/packages/microsoft.zunevideo/Components/Immersive/Video/CastAndCrewMore.html
new file mode 100644
index 00000000..6a5c8e50
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/CastAndCrewMore.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/CriticReviewMore.html b/packages/microsoft.zunevideo/Components/Immersive/Video/CriticReviewMore.html
new file mode 100644
index 00000000..69e41da3
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/CriticReviewMore.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+ Immersive Related
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/Episodes.js b/packages/microsoft.zunevideo/Components/Immersive/Video/Episodes.js
new file mode 100644
index 00000000..ce109c6e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/Episodes.js
@@ -0,0 +1,346 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ EpisodeItem: MS.Entertainment.UI.Framework.defineUserControl("/Components/Immersive/Video/TVImmersiveTemplates.html#tvEpisodeTemplate", function episodeItemConstructor(){}, {
+ _bindings: null, initialize: function initialize() {
+ if (this.tvEpisodeDownloadStatusIcon.supportsDelayInitialization)
+ MS.Entertainment.Utilities.schedulePromiseNormal().done(function _delay() {
+ this.tvEpisodeDownloadStatusIcon.delayInitialize()
+ }.bind(this));
+ this._bindings = WinJS.Binding.bind(this, {mediaItem: this._mediaItemChanged.bind(this)});
+ this.showMediaStatusIcon = MS.Entertainment.Utilities.isApp1
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _mediaItemChanged: function _mediaItemChanged() {
+ this.showDuration = MS.Entertainment.Utilities.isApp1 && this.mediaItem && this.mediaItem.duration
+ }, _onClick: function onClick() {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.UI.Controls.ImmersiveViewMore.dismissCurrentPopOver();
+ var popOverParameters = {itemConstructor: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()};
+ popOverParameters.dataContext = {data: this.mediaItem};
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }, _onKeyDown: function _onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this._onClick()
+ }
+ }, {
+ showDuration: false, showMediaStatusIcon: false
+ }), EpisodeList: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", "/Components/Immersive/Video/TVImmersiveTemplates.html#tvEpisodeListTemplate", function episodeListConstructor(){}, {
+ _keyboardNavigationManager: null, _focusEventHandlers: null, _focusInitialized: false, _episodeListControls: null, _navigationEventHandlers: null, isViewMore: false, initializeEpisodeListControls: function initializeEpisodeListControls() {
+ this._episodeListControls = [this._episodeList, this._latestEpisodeList]
+ }, initialize: function initialize() {
+ this.latestEpisodes = new MS.Entertainment.ObservableArray;
+ this.episodes = new MS.Entertainment.ObservableArray;
+ this.initializeEpisodeListControls();
+ this._bindings = WinJS.Binding.bind(this.dataContext.tvImmersiveViewModel, {season: this.seasonChanged.bind(this)});
+ this._focusEventHandlers = [MS.Entertainment.Utilities.addEvents(this, {focusin: this._focusHandler.bind(this)})];
+ if (MS.Entertainment.Utilities.isApp1)
+ this.keyboardNavigationManager = new MS.Entertainment.Framework.VerticalKeyboardNavigationManager(this.domElement, null, true);
+ else
+ for (var control in this._episodeListControls) {
+ this._episodeListControls[control].keyboardNavigable = true;
+ if (this.isViewMore)
+ this._focusEventHandlers.push(MS.Entertainment.UI.Framework.addEventHandlers(this._episodeListControls[control].domElement, {firstTimeRendered: this._forceFocusHandler.bind(this)}))
+ }
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ if (this._navigationEventHandlers) {
+ this._navigationEventHandlers.cancel();
+ this._navigationEventHandlers = null
+ }
+ this._navigationEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(page, {onNavigateTo: function onNavigateTo() {
+ for (var control in this._episodeListControls) {
+ var listElement = this._episodeListControls[control] && this._episodeListControls[control].domElement;
+ if (listElement)
+ listElement.tabIndex = 0
+ }
+ this._focusInitialized = false
+ }.bind(this)})
+ }, showFrameWhenReady: function showFrameWhenReady() {
+ var promise = this.dataContext.previousSignal ? WinJS.Binding.unwrap(this.dataContext.previousSignal).promise : WinJS.Promise.wrap();
+ promise.done(function showFrame() {
+ this.visible = this.frameVisible();
+ if (this.dataContext.frame)
+ this.dataContext.frame.hideFrame(this.visible);
+ if (this.dataContext.visibleSignal) {
+ WinJS.Binding.unwrap(this.dataContext.visibleSignal).complete();
+ this.dataContext.visibleSignal = null
+ }
+ }.bind(this))
+ }, frameVisible: function frameVisible() {
+ return this.episodes && this.episodes.length > 0
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._episodeBindings) {
+ this._episodeBindings.cancel();
+ this._episodeBindings = null
+ }
+ if (this._seasonChangePromise) {
+ this._seasonChangePromise.cancel();
+ this._seasonChangePromise = null
+ }
+ if (this._focusEventHandlers) {
+ for (var focusEventHandler in this._focusEventHandlers)
+ this._focusEventHandlers[focusEventHandler].cancel();
+ this._focusEventHandlers = null
+ }
+ if (this._navigationEventHandlers) {
+ this._navigationEventHandlers.cancel();
+ this._navigationEventHandlers = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _forceFocusHandler: function _forceFocusHandler() {
+ WinJS.Promise.timeout(1).done(function delayFocusFirstEpisode() {
+ this._focusHandler(true)
+ }.bind(this))
+ }, _focusHandler: function _focusHandler(event) {
+ var force = event === true;
+ var clickTarget = null;
+ if (event && event.target)
+ if (event.target.classList.contains("template-episodeListItem"))
+ clickTarget = event.target;
+ else if (event.target.parentElement && event.target.parentElement.classList.contains("template-episodeListItem"))
+ clickTarget = event.target.parentElement;
+ if (!this._focusInitialized || force) {
+ var querySelectorString = ".win-focusable";
+ var firstListItem = this.domElement.querySelector(querySelectorString);
+ var itemToFocus = firstListItem;
+ if (MS.Entertainment.Utilities.isApp1) {
+ var itemListElement = this._episodeList ? this._episodeList.domElement : null;
+ if (!this.isViewMore && MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll >= 0 && itemToFocus && itemListElement && itemListElement.children && itemListElement.children[MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll]) {
+ var itemToScroll = itemListElement.children[MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll];
+ if (!clickTarget && itemToScroll)
+ itemToScroll.scrollIntoView();
+ itemToFocus = itemListElement.children[MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll + 1].querySelector(querySelectorString) || itemToFocus
+ }
+ itemToFocus = clickTarget || itemToFocus;
+ if (itemToFocus)
+ this.keyboardNavigationManager.setFocusedItem(itemToFocus, true)
+ }
+ else if (this.isViewMore && firstListItem)
+ MS.Entertainment.UI.Framework.focusElement(firstListItem);
+ if (!this._focusInitialized && firstListItem) {
+ this._focusEventHandlers.push(MS.Entertainment.Utilities.addEvents(firstListItem, {focusin: this._scrollToTop.bind(this)}));
+ for (var control in this._episodeListControls)
+ this._episodeListControls[control].domElement.tabIndex = -1;
+ this._setControlFocusDirectionOverrides();
+ this._focusInitialized = true
+ }
+ }
+ }, _scrollToTop: function _scrollToTop() {
+ if (this.domElement)
+ this.domElement.scrollTop = 0;
+ if (this.isViewMore && this._episodeListPanel && this._episodeListPanel.children && this._episodeListPanel.children.length > 0)
+ this._episodeListPanel.children[0].scrollIntoView()
+ }, _setControlFocusDirectionOverrides: function _setControlFocusDirectionOverrides() {
+ if (this.isViewMore)
+ return;
+ var belowEpisodes = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp;
+ if (this.dataContext && this.dataContext.frame && !this.dataContext.frame.hideViewMoreIfEnoughSpace)
+ belowEpisodes = MS.Entertainment.UI.Controls.EpisodeList.cssSelectors.episodeViewMore;
+ var middleEpisodeFocusDirectionMap = JSON.stringify({});
+ var topEpisodeFocusDirectionMap = JSON.stringify({up: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp});
+ var bottomEpisodeFocusDirectionMap = JSON.stringify({down: belowEpisodes});
+ var bottomEpisodeItemClass = "bottomEpisodeItem";
+ var episodeItems = this.domElement.querySelectorAll(MS.Entertainment.UI.Controls.EpisodeList.cssSelectors.episodeItem);
+ if (episodeItems && episodeItems.length > 0) {
+ if (episodeItems.length === 1) {
+ var onlyEpisodeFocusDirectionMap = JSON.stringify({
+ down: belowEpisodes, up: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp
+ });
+ episodeItems[0].setAttribute("data-win-focus", onlyEpisodeFocusDirectionMap);
+ WinJS.Utilities.addClass(episodeItems[0], bottomEpisodeItemClass)
+ }
+ else {
+ episodeItems[0].setAttribute("data-win-focus", topEpisodeFocusDirectionMap);
+ WinJS.Utilities.removeClass(episodeItems[0], bottomEpisodeItemClass);
+ episodeItems[episodeItems.length - 1].setAttribute("data-win-focus", bottomEpisodeFocusDirectionMap);
+ WinJS.Utilities.addClass(episodeItems[episodeItems.length - 1], bottomEpisodeItemClass)
+ }
+ for (var i = 1; i < episodeItems.length - 1; i++) {
+ episodeItems[i].setAttribute("data-win-focus", middleEpisodeFocusDirectionMap);
+ WinJS.Utilities.removeClass(episodeItems[i], bottomEpisodeItemClass)
+ }
+ }
+ var bottomEpisodeItemSelector = ".currentPage ." + bottomEpisodeItemClass;
+ var episodeViewMoreItemFocusDirectionMap = JSON.stringify({
+ left: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.tvHeroViewMore, down: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp, up: bottomEpisodeItemSelector
+ });
+ var episodeViewMore = document.querySelector(MS.Entertainment.UI.Controls.EpisodeList.cssSelectors.episodeViewMore);
+ if (episodeViewMore)
+ episodeViewMore.setAttribute("data-win-focus", episodeViewMoreItemFocusDirectionMap)
+ }, seasonChanged: function seasonChanged(season, oldSeason) {
+ if ((season && season !== oldSeason) && (!oldSeason || (season.serviceId !== oldSeason.serviceId))) {
+ if (this._episodeBindings) {
+ this._episodeBindings.cancel();
+ this._episodeBindings = null
+ }
+ if (this._seasonChangePromise) {
+ this._seasonChangePromise.cancel();
+ this._seasonChangePromise = null
+ }
+ this._focusInitialized = false;
+ for (var control in this._episodeListControls)
+ this._episodeListControls[control].domElement.tabIndex = 0;
+ this._seasonChangePromise = season.hydrate().then(function hydrated(mediaItem) {
+ var promise;
+ if (MS.Entertainment.UI.NetworkStatusService.isOnline() && mediaItem.episodes && mediaItem.episodes.count > 0)
+ this._episodeBindings = WinJS.Binding.bind(this.dataContext.tvImmersiveViewModel, {episode: this._parseEpisodesFromSeason.bind(this)});
+ else
+ promise = this._loadLocalEpisodes(season);
+ return promise
+ }.bind(this)).then(function additonalEpisodeParsing() {
+ this._additonalEpisodeParsing()
+ }.bind(this)).done(function allDone() {
+ this._checkToShowViewMore();
+ this.showFrameWhenReady();
+ return
+ }.bind(this));
+ {}
+ }
+ }, _additonalEpisodeParsing: function _additonalEpisodeParsing() {
+ return WinJS.Promise.wrap()
+ }, _parseEpisodesFromSeason: function _parseEpisodesFromSeason() {
+ this._parseEpisodes(this.dataContext.tvImmersiveViewModel.season.episodes, this.dataContext.tvImmersiveViewModel.season.episode)
+ }, _parseEpisodes: function _parseEpisodes(episodes, featuredEpisode) {
+ var promise = WinJS.Promise.wrap();
+ var featuredEpisodeIndex = 0;
+ this.latestEpisodes.clear();
+ this.episodes.clear();
+ this.showLatestEpisodes = false;
+ this.showEpisodes = false;
+ this.showEpisodesHeading = this.showLatestEpisodes && this.showEpisodes;
+ this._showViewMore(false);
+ this.visible = false;
+ MS.Entertainment.UI.Controls.EpisodeList.episodeRenderIndex = 0;
+ MS.Entertainment.UI.Controls.EpisodeList.totalEpisodesToRender = episodes ? episodes.count : 0;
+ if (episodes && episodes.count > 0) {
+ var sevenDaysInMilliseconds = MS.Entertainment.Formatters.milliSecondsFromTimeSpan(7);
+ promise = episodes.itemsFromIndex(0).then(function gotEpisodes(episodeList) {
+ if (episodeList && episodeList.items && episodeList.items.length > 0) {
+ var todayDateOnly = new Date;
+ todayDateOnly.setHours(0, 0, 0, 0);
+ var latestEpisode = null;
+ var latestEpisodeDateOnly = null;
+ for (var i = 0; i < episodeList.items.length; i++) {
+ var currentEpisode = episodeList.items[i].data;
+ if (!currentEpisode)
+ continue;
+ if (currentEpisode.episodeNumber > 0) {
+ if (featuredEpisode && featuredEpisode.isEqual && featuredEpisode.isEqual(currentEpisode))
+ featuredEpisodeIndex = this.episodes.length;
+ this.episodes.push(currentEpisode);
+ var currentEpisodeDateOnly = new Date;
+ currentEpisodeDateOnly.setTime(currentEpisode.releaseDate);
+ currentEpisodeDateOnly.setHours(0, 0, 0, 0);
+ var deltaDates = todayDateOnly - currentEpisodeDateOnly;
+ if (deltaDates >= 0 && deltaDates <= sevenDaysInMilliseconds)
+ if (!latestEpisodeDateOnly || currentEpisodeDateOnly >= latestEpisodeDateOnly) {
+ latestEpisode = currentEpisode;
+ latestEpisodeDateOnly = currentEpisodeDateOnly
+ }
+ }
+ else {
+ MS.Entertainment.UI.Controls.EpisodeList.totalEpisodesToRender--;
+ this._processExtraEpisode(currentEpisode)
+ }
+ }
+ if (latestEpisode) {
+ if (latestEpisodeDateOnly <= todayDateOnly)
+ this.latestEpisodes.push(latestEpisode);
+ MS.Entertainment.UI.Controls.EpisodeList.totalEpisodesToRender++
+ }
+ }
+ if (this.dataContext.maxItems) {
+ var numberOfEpisodesToDisplay = this.dataContext.maxItems - this.latestEpisodes.length;
+ var showViewMore = false;
+ if (this.episodes && this.episodes.length > numberOfEpisodesToDisplay) {
+ var firstShown = 0;
+ if (featuredEpisodeIndex)
+ firstShown = Math.min(this.episodes.length - numberOfEpisodesToDisplay, Math.max(0, featuredEpisodeIndex - 1));
+ this.episodes.splice(0, firstShown);
+ this.episodes.splice(numberOfEpisodesToDisplay, this.episodes.length - numberOfEpisodesToDisplay);
+ showViewMore = true
+ }
+ this._showViewMore(showViewMore)
+ }
+ else {
+ var indexOfItemForScroll = Math.max(featuredEpisodeIndex - 1, 0);
+ if (indexOfItemForScroll)
+ MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll = indexOfItemForScroll;
+ else {
+ this._scrollToTop();
+ MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll = -1
+ }
+ }
+ this.showLatestEpisodes = this.latestEpisodes.length > 0;
+ this.showEpisodes = this.episodes.length > 0;
+ this.showEpisodesHeading = this.showLatestEpisodes || this.showEpisodes;
+ this.showFrameWhenReady()
+ }.bind(this))
+ }
+ else {
+ this.showLatestEpisodes = false;
+ this.showEpisodes = false;
+ this.showEpisodesHeading = false;
+ this.visible = false
+ }
+ return promise
+ }, _processExtraEpisode: function _processExtraEpisode(extrasEpisode){}, _showViewMore: function _showViewMore(show) {
+ if (!this.isViewMore && this.dataContext && this.dataContext.frame)
+ this.dataContext.frame.hideViewMoreIfEnoughSpace = MS.Entertainment.Utilities.isApp1 || !show
+ }, _checkToShowViewMore: function _checkToShowViewMore(){}, _loadLocalEpisodes: function loadLocalEpisodes(mediaItem) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ if (!mediaItem.inCollection) {
+ this._parseEpisodes([]);
+ completion();
+ return promise
+ }
+ var query = new MS.Entertainment.Data.Query.libraryVideoTV;
+ query.seasonId = mediaItem.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.VideosSortBy.seriesTitleSeasonNumberEpisodeNumber;
+ query.isLive = true;
+ this.episodesQuery = query;
+ query.execute().then(function queryComplete(q) {
+ return this._parseEpisodes(q.result.items, this.dataContext.tvImmersiveViewModel.season.episode).then(function parseEpisodesComplete(parseComplete) {
+ completion()
+ }.bind(this))
+ }.bind(this));
+ return promise
+ }
+ }, {
+ episodes: null, latestEpisodes: null, showEpisodes: false, showEpisodesHeading: false, showLatestEpisodes: false, visible: false
+ }, {
+ cssSelectors: {
+ episodeViewMore: ".currentPage .tvEpisodesFrame .viewMoreRow .template-moreButton .win-focusable", episodeItem: ".currentPage .tvEpisodeListPanel .episodeContainer .template-episodeListItem"
+ }, episodeRenderIndex: 0, totalEpisodesToRender: 0, storedIndexOfItemForScroll: 0, countRenderedItemsForScrollIntoView: MS.Entertainment.Utilities.weakElementBindingInitializer(function countRenderedItemsForScrollIntoView(sourceValue, targetElement, elementProperty) {
+ targetElement[elementProperty] = sourceValue;
+ MS.Entertainment.UI.Controls.EpisodeList.episodeRenderIndex++;
+ if (MS.Entertainment.UI.Controls.EpisodeList.episodeRenderIndex === MS.Entertainment.UI.Controls.EpisodeList.totalEpisodesToRender) {
+ var itemListElement = document.querySelector(".tvEpisodeListPanel .inlineDetailsEpisodeList.standardEpisodes");
+ if (MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll >= 0 && itemListElement && itemListElement.children && itemListElement.children[MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll])
+ WinJS.Promise.timeout(1).done(function delayScrollEpisode() {
+ itemListElement.children[MS.Entertainment.UI.Controls.EpisodeList.storedIndexOfItemForScroll].scrollIntoView()
+ });
+ if (MS.Entertainment.Utilities.isApp2)
+ if (itemListElement && itemListElement.children)
+ WinJS.Promise.timeout(1).done(function delayFocusFirstEpisode() {
+ MS.Entertainment.UI.Framework.focusElement(itemListElement.children[0])
+ })
+ }
+ })
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/EpisodesMore.html b/packages/microsoft.zunevideo/Components/Immersive/Video/EpisodesMore.html
new file mode 100644
index 00000000..da794d9c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/EpisodesMore.html
@@ -0,0 +1,18 @@
+
+
+
+
+ More Video Overview
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/Extras.js b/packages/microsoft.zunevideo/Components/Immersive/Video/Extras.js
new file mode 100644
index 00000000..c4450aa5
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/Extras.js
@@ -0,0 +1,81 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Controls/listControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ExtrasList: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.EpisodeList", "/Components/Immersive/Video/TVImmersiveTemplates.html#tvExtrasListTemplate", function episodeListConstructor(){}, {
+ showExtrasViewMore: false, initializeEpisodeListControls: function initializeEpisodeListControls() {
+ this._episodeListControls = [this._extraEpisodeList, this._seriesExtrasList]
+ }, initialize: function initialize() {
+ this.extraEpisodes = new MS.Entertainment.ObservableArray;
+ this.seriesExtras = new MS.Entertainment.ObservableArray;
+ MS.Entertainment.UI.Controls.EpisodeList.prototype.initialize.call(this)
+ }, frameVisible: function frameVisible() {
+ return (this.extraEpisodes && this.extraEpisodes.length > 0) || (this.seriesExtras && this.seriesExtras.length > 0)
+ }, _checkToShowViewMore: function _checkToShowViewMore() {
+ this.showExtraEpisodes = this.extraEpisodes && this.extraEpisodes.length > 0;
+ this.showSeriesExtras = this.seriesExtras && this.seriesExtras.length > 0;
+ this.showExtrasHeading = this.showExtraEpisodes || this.showSeriesExtras;
+ if (this.dataContext.maxItems) {
+ var numberOfEpisodesToDisplay = Math.max(this.dataContext.maxItems, this.dataContext.maxItems - this.extraEpisodes.length);
+ if (this.extraEpisodes && this.extraEpisodes.length > numberOfEpisodesToDisplay) {
+ this.extraEpisodes.splice(numberOfEpisodesToDisplay, this.extraEpisodes.length - numberOfEpisodesToDisplay);
+ this.showExtrasViewMore = true
+ }
+ numberOfEpisodesToDisplay -= this.extraEpisodes.length;
+ if (this.seriesExtras && this.seriesExtras.length > numberOfEpisodesToDisplay) {
+ this.seriesExtras.splice(numberOfEpisodesToDisplay > 0 ? numberOfEpisodesToDisplay : 0, this.seriesExtras.length - numberOfEpisodesToDisplay);
+ this.showExtrasViewMore = true
+ }
+ }
+ this._showViewMore(this.showExtrasViewMore);
+ this._scrollToTop()
+ }, seasonChanged: function seasonChanged(season, oldSeason) {
+ if ((season && season !== oldSeason) && (!oldSeason || (season.serviceId !== oldSeason.serviceId)))
+ this.showExtrasViewMore = false;
+ MS.Entertainment.UI.Controls.EpisodeList.prototype.seasonChanged.apply(this, arguments)
+ }, _additonalEpisodeParsing: function _additonalEpisodeParsing() {
+ var series = MS.Entertainment.ViewModels.MediaItemModel.augment(this.dataContext.tvImmersiveViewModel.series);
+ MS.Entertainment.Framework.assert(series, "The TV Series object cannot be undefined.");
+ var seasons = MS.Entertainment.UI.NetworkStatusService.isOnline() ? series.seasons : series.librarySeasons;
+ MS.Entertainment.Framework.assert(!seasons || seasons.toArrayAll, "For some reason the seasons list does not support toArrayAll");
+ if (seasons && seasons.toArrayAll)
+ seasons.toArrayAll().then(function(items) {
+ this._parseSeasons(items)
+ }.bind(this))
+ }, _parseSeasons: function _parseSeasons(seasons) {
+ var seasonHydrationPromise = WinJS.Promise.wrap();
+ this.seriesExtras.clear();
+ this.showSeriesExtras = false;
+ for (var i = 0; seasons && i < seasons.length; i++) {
+ var currentSeason = seasons[i];
+ if (currentSeason.seasonNumber == 0) {
+ seasonHydrationPromise = currentSeason.hydrate();
+ break
+ }
+ }
+ return seasonHydrationPromise.then(function seasonHydrated(season) {
+ if (season && season.episodes) {
+ season.episodes.itemsFromIndex(0).then(function scanEpisodes(episodes) {
+ for (var i = 0; i < episodes.items.length; i++)
+ this.seriesExtras.push(episodes.items[i].data)
+ }.bind(this));
+ this.showSeriesExtras = this.seriesExtras.length > 0;
+ this.showExtrasHeading = this.showExtraEpisodes || this.showSeriesExtras;
+ this._checkToShowViewMore();
+ this.showFrameWhenReady()
+ }
+ }.bind(this))
+ }, _parseEpisodes: function _parseEpisodes(episodes, featuredEpisode) {
+ this.extraEpisodes.clear();
+ this.showExtraEpisodes = false;
+ return MS.Entertainment.UI.Controls.EpisodeList.prototype._parseEpisodes.apply(this, arguments)
+ }, _processExtraEpisode: function _processExtraEpisode(extrasEpisode) {
+ this.extraEpisodes.push(extrasEpisode);
+ return MS.Entertainment.UI.Controls.EpisodeList.prototype._processExtraEpisode.call(this)
+ }
+ }, {
+ extraEpisodes: null, seriesExtras: null, showExtrasHeading: false, showSeriesExtras: false, showExtraEpisodes: false, showExtrasViewMore: false
+ }, {cssSelectors: {
+ episodeViewMore: ".currentPage .tvExtrasFrame .viewMoreRow .template-moreButton .win-focusable", episodeItem: ".currentPage .tvEpisodeListPanel .tvEpisodeExtraContainer .template-episodeListExtraItem"
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/ExtrasMore.html b/packages/microsoft.zunevideo/Components/Immersive/Video/ExtrasMore.html
new file mode 100644
index 00000000..9fb90873
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/ExtrasMore.html
@@ -0,0 +1,18 @@
+
+
+
+
+ More Video Overview
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/MoreVideoOverview.html b/packages/microsoft.zunevideo/Components/Immersive/Video/MoreVideoOverview.html
new file mode 100644
index 00000000..842a29b2
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/MoreVideoOverview.html
@@ -0,0 +1,32 @@
+
+
+
+
+ More Video Overview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/MovieHero.html b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieHero.html
new file mode 100644
index 00000000..e6b45e3b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieHero.html
@@ -0,0 +1,64 @@
+
+
+
+
+ Immersive Video Hero
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/MovieHero.js b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieHero.js
new file mode 100644
index 00000000..c60c6c74
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieHero.js
@@ -0,0 +1,70 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Components/Immersive/Video/VideoHero.js");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImmersiveMovieHero: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ImmersiveVideoHero", "/Components/Immersive/Video/MovieHero.html#ImmersiveMovieHero", function immersiveMovieHero() {
+ this._setControlVisibilityOverrides()
+ }, {
+ controlName: "ImmersiveMovieHero", _signedInBinding: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ImmersiveVideoHero.prototype.initialize.call(this);
+ this._bindings = WinJS.Binding.bind(this, {dataContext: {
+ heroImageMediaItem: this._heroImageMediaItemChanged.bind(this), mediaItem: this._heroImageMediaItemChanged.bind(this)
+ }});
+ this._initializeSmartBuyStateEngine();
+ if (MS.Entertainment.UI.Framework.animationsEnabled) {
+ var logPerfTrace = function logPerfTrace() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioMovieDetailsRequest();
+ this.domElement.removeEventListener("animationstart", logPerfTrace)
+ }.bind(this);
+ this.domElement.addEventListener("animationstart", logPerfTrace)
+ }
+ else
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioMovieDetailsRequest()
+ }, _initializeSmartBuyStateEngine: function _initializeSmartBuyStateEngine() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.unload();
+ this.smartBuyStateEngine = null
+ }
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ this.smartBuyStateEngine = new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine;
+ this.smartBuyStateEngine.initialize(this.dataContext.mediaItem, MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.dataContext.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.canvas), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoDetailsTwoButtonStateChanged)
+ }
+ }, unload: function unload() {
+ if (this._signedInBinding) {
+ this._signedInBinding.cancel();
+ this._signedInBinding = null
+ }
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.unload();
+ this.smartBuyStateEngine = null
+ }
+ MS.Entertainment.UI.Controls.ImmersiveVideoHero.prototype.unload.call(this)
+ }, _setControlVisibilityOverrides: function _setControlVisibilityOverrides() {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ this.displayActionButtons = true;
+ else
+ this.displayRating = true
+ }, _setControlFocusDirectionOverrides: function _setControlFocusDirectionOverrides() {
+ this._heroViewMoreSelector = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.movieHeroViewMore;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var criticReviewsVisible = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.rottenTomatoes) && this.heroMediaItem && this.heroMediaItem.criticReview && this.heroMediaItem.criticReview.reviewScore > 0);
+ var castAndCrewVisible = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.castAndCrew) && this.heroMediaItem && this.heroMediaItem.contributors && this.heroMediaItem.contributors.length > 0);
+ if (criticReviewsVisible) {
+ this._rightOfSmartBuyButtons = MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel.cssSelectors.rottenTomatoesOverview;
+ this._rightOfOverviewViewMore = MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel.cssSelectors.rottenTomatoesViewMore
+ }
+ else if (castAndCrewVisible) {
+ this._rightOfSmartBuyButtons = MS.Entertainment.UI.Controls.CastAndCrewList.cssSelectors.castAndCrewMember;
+ this._rightOfOverviewViewMore = MS.Entertainment.UI.Controls.CastAndCrewList.cssSelectors.castAndCrewViewMore
+ }
+ else {
+ this._rightOfSmartBuyButtons = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related;
+ this._rightOfOverviewViewMore = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related
+ }
+ MS.Entertainment.UI.Controls.ImmersiveVideoHero.prototype._setControlFocusDirectionOverrides.call(this)
+ }
+ }, {
+ displayRatingsButton: false, mediaTypeClassName: MS.Entertainment.UI.Controls.VideoHeroMediaTypes.movie, smartBuyStateEngine: null
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/MovieImmersiveTemplates.html b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieImmersiveTemplates.html
new file mode 100644
index 00000000..7429a309
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieImmersiveTemplates.html
@@ -0,0 +1,174 @@
+
+
+
+
+
+ Games Immersive Overview
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
TOMATOMETER®
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/MovieOverview.js b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieOverview.js
new file mode 100644
index 00000000..91000f6c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/MovieOverview.js
@@ -0,0 +1,134 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/ViewModels/MediaItemModel.js", "/Components/Immersive/Shared/BaseImmersiveSummary.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MovieImmersiveOverviewSummary: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary", "/Components/Immersive/Video/MovieImmersiveTemplates.html#ImmersiveOverview", function immersiveOverview() {
+ this._appbarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar)
+ }, {
+ _buttons: null, _mediaContext: null, _appbarService: null, _bindings: null, expirationTickTimer: null, usesSmartBuyStateEngine: true, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary.prototype.initialize.apply(this, arguments);
+ if (this.dataContext.showButtons)
+ if (this.dataContext.mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie) {
+ var onRentalStateRetrieved = function onRentalStateRetrieved(stateInfo) {
+ if (MS.Entertainment.Utilities.isVideoApp)
+ if (stateInfo && stateInfo.marketplace && stateInfo.marketplace.rentalExpirations && stateInfo.marketplace.rentalExpirations.length > 0 && (stateInfo.marketplace.rentalExpirations.overall.latestDate || stateInfo.marketplace.rentalExpirations.overall.isExpired)) {
+ if (this.expirationTickTimer) {
+ window.clearTimeout(this.expirationTickTimer);
+ this.expirationTickTimer = null
+ }
+ MS.Entertainment.UI.RentalExpirationService.getExpirationString(this.dataContext.mediaItem, stateInfo.marketplace.rentalExpirations.overall.latestDate, this.getExpirationStringCallback.bind(this))
+ }
+ else
+ this.dataContext.expirationString = String.empty
+ }.bind(this);
+ if (this.smartBuyStateEngine) {
+ var onSmartBuyStateChanged = function onSmartBuyStateChanged(stateInfo) {
+ onRentalStateRetrieved(stateInfo);
+ return MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoDetailsTwoButtonStateChanged.apply(this, arguments)
+ };
+ this.smartBuyStateEngine.initialize(this.dataContext.mediaItem, MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.dataContext.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.canvas), onSmartBuyStateChanged)
+ }
+ else
+ MS.Entertainment.ViewModels.SmartBuyStateEngine.queryMediaStateAsync(this.dataContext.mediaItem).then(function queryMediaStateAsync_complete(stateInfo) {
+ onRentalStateRetrieved(stateInfo)
+ }.bind(this))
+ }
+ if (this.dataContext.mediaItem && this.dataContext.mediaItem.hasServiceId && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer)) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener(MS.Entertainment.UI.Controls.MovieImmersiveOverviewSummary._downloadMovieNotificationListenerId, function getTaskKey(task) {
+ return (this.dataContext && this.dataContext.mediaItem && task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && task.libraryId === this.dataContext.mediaItem.libraryId) ? task.libraryId : null
+ }.bind(this), this.dataContext.mediaItem, MS.Entertainment.UI.FileTransferNotifiers.genericFile);
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.dataContext.mediaItem)
+ }
+ this._mediaContext = this._appbarService.pushMediaContext(this.dataContext.mediaItem, null, null, {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.canvas});
+ if (this.smartBuyStateEngine)
+ this._bindings = WinJS.Binding.bind(this.smartBuyStateEngine, {currentAppbarActions: this._updateAppBar.bind(this)});
+ this.movieOverviewMetadata = this.formatMovieOverviewMetadata(this.dataContext.mediaItem);
+ this.ratingControlDisabled = MS.Entertainment.Utilities.isApp2;
+ this.displayStarRatingControl = MS.Entertainment.Utilities.isApp2;
+ this.displayActionButtons = !MS.Entertainment.Utilities.isVideoApp2;
+ this._waitForActionsReadyOrTimeout().done(function actionsReady() {
+ this.visible = true;
+ if (this.dataContext.visibleSignal)
+ WinJS.Binding.unwrap(this.dataContext.visibleSignal).complete();
+ WinJS.Promise.timeout(1000).done(function() {
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ var event = document.createEvent("Event");
+ event.initEvent("contentready", true, false);
+ this.domElement.dispatchEvent(event)
+ }
+ }.bind(this))
+ }.bind(this))
+ }, _waitForActionsReadyOrTimeout: function _waitForActionsReadyOrTimeout() {
+ var previousFramePromise = this.dataContext.previousSignal ? WinJS.Binding.unwrap(this.dataContext.previousSignal).promise : WinJS.Promise.wrap();
+ var promises = [previousFramePromise];
+ var movieButtons = WinJS.Utilities.getMember("_buttons.domElement", this);
+ if (movieButtons && this.smartBuyStateEngine)
+ promises.push(MS.Entertainment.Utilities.waitForDomEvent("ActionsReady", movieButtons));
+ return WinJS.Promise.any([WinJS.Promise.join(promises), WinJS.Promise.timeout(2000)])
+ }, unload: function unload() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.unload();
+ this.smartBuyStateEngine = null
+ }
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this.expirationTickTimer) {
+ window.clearTimeout(this.expirationTickTimer);
+ this.expirationTickTimer = null
+ }
+ MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary.prototype.unload.call(this)
+ }, freeze: function overview_freeze() {
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary.prototype.freeze.call(this)
+ }, thaw: function overview_thaw() {
+ MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary.prototype.thaw.call(this);
+ this._mediaContext = this._appbarService.pushMediaContext(this.dataContext.mediaItem, null, null, {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.canvas});
+ if (this.smartBuyStateEngine)
+ this._mediaContext.setToolbarActions(this.smartBuyStateEngine.currentAppbarActions)
+ }, getExpirationStringCallback: function getExpirationStringCallback(spanInMilliseconds, expirationTickTimer) {
+ this.expirationTickTimer = expirationTickTimer;
+ this.dataContext.expirationString = MS.Entertainment.Formatters.formatRentalExpirationFromSpanInt(spanInMilliseconds, true)
+ }, _createSmartBuyStateEngine: function _createSmartBuyStateEngine() {
+ return new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine
+ }, _updateAppBar: function _updateAppBar(newValue, oldValue) {
+ if ((oldValue === undefined || this.smartBuyStateEngine) && this._mediaContext)
+ this._mediaContext.setToolbarActions(newValue)
+ }, formatMovieOverviewMetadata: function formatMovieOverviewMetadata(sourceValue) {
+ var result = String.empty;
+ if (sourceValue) {
+ var parts = [];
+ if (sourceValue.releaseDate)
+ parts.push(MS.Entertainment.Formatters.formatYearFromDateNonConverter(sourceValue.releaseDate));
+ if (sourceValue.genre)
+ parts.push(MS.Entertainment.Formatters.formatGenresListNonConverter(sourceValue.genre));
+ if (sourceValue.studioName)
+ parts.push(sourceValue.studioName);
+ else if (sourceValue.studios && sourceValue.studios.length > 0 && sourceValue.studios[0].name)
+ parts.push(sourceValue.studios[0].name);
+ var languages = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getLanguagesForRights(sourceValue, MS.Entertainment.Utilities.defaultClientTypeFromApp);
+ if (languages && languages.length === 1)
+ parts.push(String.load(String.id.IDS_DETAILS_AUDIO_LANGUAGE).format(MS.Entertainment.Utilities.getDisplayLanguageFromLanguageCode(languages[0])));
+ if (sourceValue.rating)
+ parts.push(sourceValue.rating);
+ if (sourceValue.duration)
+ parts.push(MS.Entertainment.Formatters.formatDurationFromDateNonConverter(sourceValue.duration));
+ result = parts.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ return result
+ }
+ }, {
+ movieOverviewMetadata: String.empty, visible: false, displayStarRatingControl: false, displayActionButtons: false, ratingControlDisabled: false
+ }, {
+ _downloadMovieNotificationListenerId: "MovieImmersiveOverviewSummary", cssSelectors: {starRatingControl: '.movie .overview .ratingContainer .control-starRating:not(.disabled) .mediaRatingControl'}
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/TVHero.html b/packages/microsoft.zunevideo/Components/Immersive/Video/TVHero.html
new file mode 100644
index 00000000..50a765cc
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/TVHero.html
@@ -0,0 +1,72 @@
+
+
+
+
+ Immersive Video Hero
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/TVHero.js b/packages/microsoft.zunevideo/Components/Immersive/Video/TVHero.js
new file mode 100644
index 00000000..9236ffce
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/TVHero.js
@@ -0,0 +1,178 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Components/Immersive/Video/VideoHero.js");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ TvHeroImageControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Shell.ImageControl", null, function(element, options){}, {hide: function hide(element) {
+ try {
+ if (this.domElement && this.domElement.src && this.domElement.src !== this.defaultImagePath)
+ this._setImgSrc(this.defaultImagePath)
+ }
+ catch(e) {
+ fxassert(false, "Error setting image URL: " + result);
+ this._handleError()
+ }
+ }}), ImmersiveTvHero: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ImmersiveVideoHero", "/Components/Immersive/Video/TVHero.html#ImmersiveTvHero", function immersiveTvHero(){}, {
+ _bindings: null, _selectedSeasonBinds: null, _networkStatusBinds: null, _signedInBinding: null, controlName: "ImmersiveTvHero", ownedEpisodeCount: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ImmersiveVideoHero.prototype.initialize.call(this);
+ this.viewModel = this.dataContext.tvImmersiveViewModel;
+ this._bindings = WinJS.Binding.bind(this, {
+ dataContext: {
+ heroImageMediaItem: this._heroImageMediaItemChanged.bind(this), season: this._heroImageMediaItemChanged.bind(this)
+ }, viewModel: {
+ season: this.onChangeSeason.bind(this), libraryEpisodes: {count: this.onLibraryEpisodesChange.bind(this)}
+ }
+ });
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState)) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._networkStatusBinds = WinJS.Binding.bind(uiStateService, {networkStatus: this._onNetworkStatusChanged.bind(this)})
+ }
+ this._setSeasonFromSeries(this.dataContext.series, this.dataContext.season);
+ if (MS.Entertainment.UI.Framework.animationsEnabled) {
+ var logPerfTrace = function logPerfTrace() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioTVDetailsRequest();
+ this.domElement.removeEventListener("animationstart", logPerfTrace)
+ }.bind(this);
+ this.domElement.addEventListener("animationstart", logPerfTrace)
+ }
+ else
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioTVDetailsRequest()
+ }, unload: function unload() {
+ if (this._signedInBinding) {
+ this._signedInBinding.cancel();
+ this._signedInBinding = null
+ }
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._selectedSeasonBinds) {
+ this._selectedSeasonBinds.cancel();
+ this._selectedSeasonBinds = null
+ }
+ if (this._networkStatusBinds) {
+ this._networkStatusBinds.cancel();
+ this._networkStatusBinds = null
+ }
+ MS.Entertainment.UI.Controls.ImmersiveVideoHero.prototype.unload.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.ImmersiveVideoHero.prototype.thaw.call(this)
+ }, onChangeSeason: function onChangeSeason() {
+ if (this.viewModel && this.viewModel.season && this.viewModel.season.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ this._setSeasonFromSeries(this.viewModel.series, this.viewModel.season);
+ this.dataContext.heroImageMediaItem = this.viewModel.season
+ }
+ }, onLibraryEpisodesChange: function onLibraryEpisodesChange() {
+ if (this.viewModel.libraryEpisodes && this.viewModel.libraryEpisodes.count) {
+ var countLibraryEpisodes = {};
+ var fromSource = false;
+ var listProperty = "_data";
+ if (!this.viewModel.libraryEpisodes._data.length) {
+ listProperty = "_source";
+ fromSource = true
+ }
+ this.viewModel.libraryEpisodes[listProperty].forEach(function countEpisodes(episode) {
+ var seasonNumber = fromSource ? episode.seasonNumber : (episode.data && episode.data.seasonNumber);
+ if (countLibraryEpisodes[seasonNumber])
+ countLibraryEpisodes[seasonNumber]++;
+ else
+ countLibraryEpisodes[seasonNumber] = 1
+ });
+ this.ownedEpisodeCount = countLibraryEpisodes;
+ if (this.seasonSelections)
+ this.seasonSelections.forEach(function walkSeasonModifierList(item) {
+ if (this.ownedEpisodeCount && typeof(item.season.seasonNumber) === "number")
+ item.ownedEpisodes = this.ownedEpisodeCount[item.season.seasonNumber] || 0
+ }.bind(this))
+ }
+ }, _modifierSelectedItemChangedCallback: function _modifierSelectedItemChangedCallback() {
+ if (this.viewModel.series && (this.viewModel.series.seasons || this.viewModel.series.librarySeasons) && this.modifierSelectionManager.selectedItem && this.modifierSelectionManager.selectedItem.season) {
+ MS.Entertainment.Framework.assert(this.modifierSelectionManager.selectedItem.season.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason, "Non-season used in the season drop down in tv series inline details");
+ if (this.modifierSelectionManager.selectedItem.season.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this.viewModel.setSeason(this.modifierSelectionManager.selectedItem.season)
+ }
+ }, _setSeasonFromSeries: function _setSeasonFromSeries(series, selectedSeason) {
+ series = MS.Entertainment.ViewModels.MediaItemModel.augment(series);
+ this.series = series;
+ var isOnline = MS.Entertainment.UI.NetworkStatusService.isOnline();
+ var seasons = (isOnline && series.seasons) ? series.seasons : series.librarySeasons;
+ MS.Entertainment.Framework.assert(!seasons || seasons.toArrayAll, "For some reason the seasons list does not support toArrayAll");
+ if (seasons && seasons.toArrayAll)
+ seasons.toArrayAll().then(function(seasonItems) {
+ var nonExtraSeasons = [];
+ for (var i = 0; i < seasonItems.length; i++) {
+ var seasonNumber = seasonItems[i].seasonNumber;
+ if (seasonNumber !== 0)
+ nonExtraSeasons.push(seasonItems[i])
+ }
+ return WinJS.Promise.wrap(nonExtraSeasons)
+ }.bind(this)).then(function(items) {
+ this._updateFromSeasonsArray(items, selectedSeason)
+ }.bind(this))
+ }, _updateFromSeasonsArray: function _updateFromSeasonsArray(seasons, selectedSeason) {
+ this.seasonSelections = [];
+ var selectedIndex = seasons.length - 1;
+ for (var i = 0; i < seasons.length; i++) {
+ var item = null;
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ item = {
+ season: seasons[i], label: MS.Entertainment.Formatters.formatTVSeasonNumberInt(seasons[i].seasonNumber, true), templateOverride: "/Controls/Video/SeasonModifier.html#seasonModifierPopupEntry", ownedEpisodes: this.ownedEpisodeCount && typeof(seasons[i].seasonNumber) === "number" && this.ownedEpisodeCount[seasons[i].seasonNumber] ? this.ownedEpisodeCount[seasons[i].seasonNumber] : 0
+ };
+ else
+ item = {
+ season: seasons[i], label: MS.Entertainment.Formatters.formatTVSeasonNumberInt(seasons[i].seasonNumber, true)
+ };
+ this.seasonSelections.push(item);
+ if (selectedSeason && this._isPartOfSeason(seasons[i], selectedSeason))
+ selectedIndex = i
+ }
+ if (this._selectedSeasonBinds) {
+ this._selectedSeasonBinds.cancel();
+ this._selectedSeasonBinds = null
+ }
+ this.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(this.seasonSelections, selectedIndex);
+ if (this.dataContext.tvImmersiveViewModel.setSeason)
+ this._selectedSeasonBinds = WinJS.Binding.bind(this.modifierSelectionManager, {selectedItem: this._modifierSelectedItemChangedCallback.bind(this)})
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(status, oldStatus) {
+ var selectedSeason = null;
+ if (this.modifierSelectionManager && this.modifierSelectionManager.selectedItem)
+ selectedSeason = this.modifierSelectionManager.selectedItem.season;
+ if (oldStatus && selectedSeason)
+ if (MS.Entertainment.UI.NetworkStatusService.isOnline())
+ this._setSeasonFromSeries(this.series, selectedSeason);
+ else if (this.seasonSelections && this.seasonSelections.length > 0) {
+ var offlineSeasons = [];
+ var hydrationPromises = [];
+ for (var i = 0; i < this.seasonSelections.length; i++)
+ if (this.seasonSelections[i] && this.seasonSelections[i].season) {
+ MS.Entertainment.Framework.assert(this.seasonSelections[i].season, "Modifier season not found");
+ hydrationPromises.push(MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this.seasonSelections[i].season))
+ }
+ WinJS.Promise.join(hydrationPromises).done(function hydratedLibraryInfo() {
+ for (var i = 0; i < this.seasonSelections.length; i++)
+ if (this.seasonSelections[i] && this.seasonSelections[i].season) {
+ var season = this.seasonSelections[i].season;
+ MS.Entertainment.Framework.assert(season, "Modifier season not found");
+ if (season && (season.inCollection || season.isEqual(selectedSeason)))
+ offlineSeasons.push(season)
+ }
+ this._updateFromSeasonsArray(offlineSeasons, selectedSeason)
+ }.bind(this))
+ }
+ }, _isPartOfSeason: function _isPartOfSeason(seasonItem, selectedSeason) {
+ MS.Entertainment.Framework.assert(seasonItem, "seasonItem is not defined");
+ MS.Entertainment.Framework.assert(selectedSeason, "selectedSeason is not defined");
+ if (!MS.Entertainment.Utilities.isEmptyGuid(seasonItem.edsId) && (seasonItem.edsId === selectedSeason.canonicalSeasonId || seasonItem.edsId === selectedSeason.serviceId))
+ return true;
+ if (!MS.Entertainment.Utilities.isEmptyGuid(seasonItem.serviceId) && seasonItem.serviceId === selectedSeason.serviceId)
+ return true;
+ if (!MS.Entertainment.Utilities.isEmptyGuid(seasonItem.zuneId) && seasonItem.zuneId === selectedSeason.serviceId)
+ return true;
+ return false
+ }
+ }, {
+ mediaTypeClassName: MS.Entertainment.UI.Controls.VideoHeroMediaTypes.tv, modifierSelectionManager: null, seasonSelections: null, viewModel: null
+ }, {cssSelectors: {immersiveSecondaryText: '.immersiveDetails .currentPage .immersivePageTitle .immersiveSecondaryText'}})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/TVImmersiveTemplates.html b/packages/microsoft.zunevideo/Components/Immersive/Video/TVImmersiveTemplates.html
new file mode 100644
index 00000000..210a8345
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/TVImmersiveTemplates.html
@@ -0,0 +1,208 @@
+
+
+
+
+
+ TV Immersive Overview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/TVOverview.js b/packages/microsoft.zunevideo/Components/Immersive/Video/TVOverview.js
new file mode 100644
index 00000000..c1aac2c5
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/TVOverview.js
@@ -0,0 +1,194 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/ViewModels/MediaItemModel.js", "/Components/Immersive/Shared/BaseImmersiveSummary.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TvImmersiveOverviewSummary: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary", "/Components/Immersive/Video/TVImmersiveTemplates.html#ImmersiveOverview", function immersiveOverview() {
+ this.displayActionButtons = MS.Entertainment.Utilities.isApp1
+ }, {
+ _buttonsEpisode: null, _buttonsSeason: null, usesSmartBuyStateEngine: false, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary.prototype.initialize.apply(this, arguments);
+ MS.Entertainment.UI.Controls.assert((this.dataContext && this.dataContext.tvImmersiveViewModel && this.dataContext.tvImmersiveViewModel.season && this.dataContext.tvImmersiveViewModel.season.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason), "Must pass in a TV Season to the TV Season Overview panel.");
+ this.viewModel = this.dataContext.tvImmersiveViewModel;
+ if (this.viewModel) {
+ this.viewModel.seasonStateInfoCallback = this._setDisclaimerVisibility.bind(this);
+ if (this.viewModel.seasonStateInfo)
+ this._setDisclaimerVisibility(this.viewModel.seasonStateInfo)
+ }
+ if (MS.Entertainment.Utilities.isApp2 && this._episodeButton)
+ this._episodeButton.tabIndex = -1;
+ this._seasonBinds = WinJS.Binding.bind(this.viewModel, {
+ season: this.onMediaChange.bind(this), episode: this.onMediaChange.bind(this)
+ });
+ this._waitForActionsReadyOrTimeout().done(function actionsReady() {
+ if (!this.displayActionButtons)
+ this._updateDescriptionViewMore();
+ this.visible = true;
+ if (this.dataContext.visibleSignal)
+ WinJS.Binding.unwrap(this.dataContext.visibleSignal).complete()
+ }.bind(this));
+ this._setControlFocusability()
+ }, _createSmartBuyStateEngine: function _createSmartBuyStateEngine() {
+ return new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine
+ }, _setControlFocusability: function _setControlFocusability() {
+ if (MS.Entertainment.Utilities.isApp1 && this._watchNextEpisode) {
+ WinJS.Utilities.addClass(this._watchNextEpisode, "acc-keyboardFocusTarget");
+ WinJS.Utilities.addClass(this._watchNextEpisode, "win-focusable")
+ }
+ }, _setDisclaimerVisibility: function _setDisclaimerVisibility(stateInfo) {
+ if (!this.viewModel.season || this.viewModel.season.isComplete)
+ this.showSeasonPassDisclaimer = false;
+ else {
+ var entireSeasonIsOwned = WinJS.Utilities.getMember("marketplace.hasPurchasedSeason", stateInfo);
+ if (entireSeasonIsOwned !== undefined)
+ if (entireSeasonIsOwned)
+ this.showSeasonPassDisclaimer = false;
+ else {
+ var bestFreeRight = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getBestFreeSeasonRight(this.viewModel.season);
+ var seasonPassOffer = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultSeasonBuyOffer(this.viewModel.season, MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd, String.empty);
+ this.showSeasonPassDisclaimer = !!seasonPassOffer && !bestFreeRight
+ }
+ }
+ }, _waitForActionsReadyOrTimeout: function _waitForActionsReadyOrTimeout() {
+ var previousFramePromise = this.dataContext.previousSignal ? WinJS.Binding.unwrap(this.dataContext.previousSignal).promise : WinJS.Promise.wrap();
+ var promises = [previousFramePromise];
+ var seasonButtons = WinJS.Utilities.getMember("_buttonsSeason.domElement", this);
+ if (seasonButtons && WinJS.Utilities.getMember("dataContext.tvImmersiveViewModel.seasonSmartBuyStateEngine", this))
+ promises.push(MS.Entertainment.Utilities.waitForDomEvent("ActionsReady", seasonButtons));
+ var episodeButtons = WinJS.Utilities.getMember("_buttonsEpisode.domElement", this);
+ if (episodeButtons && WinJS.Utilities.getMember("dataContext.tvImmersiveViewModel.episodeSmartBuyStateEngine", this))
+ promises.push(MS.Entertainment.Utilities.waitForDomEvent("ActionsReady", episodeButtons));
+ return WinJS.Promise.any([WinJS.Promise.join(promises), WinJS.Promise.timeout(2000)])
+ }, onMediaChange: function onMediaChange() {
+ if (this.dataContext && this.dataContext.tvImmersiveViewModel && this.dataContext.tvImmersiveViewModel.season) {
+ this.season = this.dataContext.tvImmersiveViewModel.season;
+ this.episode = this.dataContext.tvImmersiveViewModel.season.episode;
+ if (!this.season.hydrated)
+ this.showSeasonPassDisclaimer = false;
+ this.season.hydrate().then(function onHydratedSeason() {
+ var fileTransferService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ if (this.season.hasServiceId && fileTransferService) {
+ var mediaKey = this.season.seriesId.toLowerCase();
+ var seasonNumber = this.season.seasonNumber;
+ fileTransferService.registerListener(MS.Entertainment.UI.Controls.TvImmersiveOverviewSummary._downloadNotificationListenerId, function getTaskKey(task) {
+ return (task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && task.seriesMediaId.toLowerCase() === mediaKey && task.seasonNumber === seasonNumber) ? mediaKey : null
+ }.bind(this), this.season, MS.Entertainment.UI.FileTransferNotifiers.episodeCollection);
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.season)
+ }
+ if (fileTransferService && this.season.episode && this.season.episode.hasServiceId) {
+ var currentEpisode = this.season.episode;
+ fileTransferService.registerListener(MS.Entertainment.UI.Controls.TvImmersiveOverviewSummary._downloadEpisodeNotificationListenerId, function getTaskKey(task) {
+ return (task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && task.libraryId === currentEpisode.libraryId) ? task.libraryId : null
+ }.bind(this), this.season.episode, MS.Entertainment.UI.FileTransferNotifiers.genericFile);
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.season.episode)
+ }
+ this.tvOverviewMetadata = this.formatTvOverviewMetadata(this.season);
+ this.episodeDetails = this.formatTvEpisodeMetadata();
+ if (!this.displayActionButtons) {
+ var event = document.createEvent("Event");
+ event.initEvent("contentready", true, false);
+ this.domElement.dispatchEvent(event)
+ }
+ }.bind(this))
+ }
+ }, unload: function unload() {
+ var fileTransferService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ if (fileTransferService) {
+ fileTransferService.unregisterListener(MS.Entertainment.UI.Controls.TvImmersiveOverviewSummary._downloadNotificationListenerId);
+ fileTransferService.unregisterListener(MS.Entertainment.UI.Controls.TvImmersiveOverviewSummary._downloadEpisodeNotificationListenerId)
+ }
+ if (this._buttonsSeason && this._buttonsSeason.domElement)
+ this._buttonsSeason.domElement.removeEventListener("ActionsReady", this._updateDescriptionViewMore);
+ if (this._buttonsEpisode && this._buttonsEpisode.domElement)
+ this._buttonsEpisode.domElement.removeEventListener("ActionsReady", this._updateDescriptionViewMore);
+ if (this._seasonBinds) {
+ this._seasonBinds.cancel();
+ this._seasonBinds = null
+ }
+ if (this.viewModel) {
+ this.viewModel.seasonStateInfoCallback = null;
+ this.viewModel = null
+ }
+ MS.Entertainment.UI.Controls.BaseImmersiveOverviewSummary.prototype.unload.call(this)
+ }, _updateDescriptionViewMore: function _updateDescriptionViewMore(newValue, oldValue) {
+ WinJS.Promise.timeout(500).then(function updateVM() {
+ var event = document.createEvent("Event");
+ event.initEvent("contentready", true, false);
+ this.domElement.dispatchEvent(event)
+ }.bind(this))
+ }, formatTvOverviewMetadata: function formatTvOverviewMetadata(sourceValue) {
+ var result = String.empty;
+ if (sourceValue) {
+ var parts = [];
+ if (sourceValue.genre)
+ parts.push(MS.Entertainment.Formatters.formatGenresListNonConverter(sourceValue.genre));
+ if (sourceValue.studioName)
+ parts.push(sourceValue.studioName);
+ else if (sourceValue.network)
+ parts.push(sourceValue.network);
+ else if (sourceValue.studios && sourceValue.studios.length > 0 && sourceValue.studios[0].name)
+ parts.push(sourceValue.studios[0].name);
+ else if (sourceValue.networks && sourceValue.networks.length > 0 && sourceValue.networks[0].name)
+ parts.push(sourceValue.networks[0].name);
+ var languages = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getLanguagesForRights(this.media, MS.Entertainment.Utilities.defaultClientTypeFromApp);
+ if (languages && languages.length === 1)
+ parts.push(String.load(String.id.IDS_DETAILS_AUDIO_LANGUAGE).format(MS.Entertainment.Utilities.getDisplayLanguageFromLanguageCode(languages[0])));
+ if (sourceValue.rating)
+ parts.push(sourceValue.rating);
+ var episodesLabel = this.getEpisodeCountLabel(sourceValue);
+ if (episodesLabel)
+ parts.push(episodesLabel);
+ result = parts.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ return result
+ }, formatTvEpisodeMetadata: function formatTvEpisodeMetadata() {
+ var result = String.empty;
+ if (this.season && this.season.episode) {
+ var parts = [];
+ if (this.season.episode.genre)
+ parts.push(MS.Entertainment.Formatters.formatGenresListNonConverter(this.season.episode.genre));
+ else if (this.season.episode.genreName)
+ parts.push(this.season.episode.genreName);
+ if (this.season.episode.studioName)
+ parts.push(this.season.episode.studioName);
+ else if (this.season.episode.network)
+ parts.push(this.season.episode.network);
+ var languages = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getLanguagesForRights(this.media, MS.Entertainment.Utilities.defaultClientTypeFromApp);
+ if (languages && languages.length === 1)
+ parts.push(String.load(String.id.IDS_DETAILS_AUDIO_LANGUAGE).format(MS.Entertainment.Utilities.getDisplayLanguageFromLanguageCode(languages[0])));
+ if (this.season.episode.rating)
+ parts.push(this.season.episode.rating);
+ result = parts.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ return result
+ }, getEpisodeCountLabel: function getEpisodeCountLabel(seasonItem) {
+ var label = null;
+ if (seasonItem.episodes && seasonItem.episodes.count) {
+ var episodeCount = seasonItem.episodes.count;
+ if (episodeCount > 0) {
+ var stringId = String.id.IDS_TV_EPISODES_LABEL;
+ if (episodeCount === 1)
+ stringId = String.id.IDS_TV_EPISODE_LABEL;
+ var formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(episodeCount);
+ label = String.load(stringId).format(formattedNum)
+ }
+ }
+ return label
+ }, _onClickEpisode: function _onClickEpisode() {
+ if (this.viewModel && this.viewModel.season && this.viewModel.season.episode) {
+ var popOverParameters = {itemConstructor: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()};
+ popOverParameters.dataContext = {
+ data: this.viewModel.season.episode, location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace
+ };
+ MS.Entertainment.UI.Controls.PopOver.showPopOver(popOverParameters)
+ }
+ }, _onKeyDown: function _onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space || event.keyCode === WinJS.Utilities.Key.invokeButton)
+ this._onClickEpisode()
+ }
+ }, {
+ viewModel: null, tvOverviewMetadata: String.empty, episodeDetails: String.empty, season: null, episode: null, showSeasonPassDisclaimer: false, displayActionButtons: false, visible: false
+ }, {
+ _downloadNotificationListenerId: "TvImmersiveOverviewSummary", _downloadEpisodeNotificationListenerId: "TvImmersiveOverviewSummaryEpisode"
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Immersive/Video/VideoHero.js b/packages/microsoft.zunevideo/Components/Immersive/Video/VideoHero.js
new file mode 100644
index 00000000..ac21bffc
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Immersive/Video/VideoHero.js
@@ -0,0 +1,68 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js", "/Components/Immersive/Shared/BaseImmersiveSummary.js");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ VideoHeroMediaTypes: {
+ tv: "mediatype-tvSeries", movie: "mediatype-movie"
+ }, ImmersiveVideoHero: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", null, function immersiveVideoHero() {
+ this.uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)
+ }, {
+ _eventHandler: null, uiStateService: null, _navigationEventHandlers: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.initialize.call(this);
+ this.displayHeroContent = MS.Entertainment.UI.NetworkStatusService.isOnline()
+ }, freeze: function immersiveVideoHero_freeze() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.freeze.call(this)
+ }, thaw: function immersiveVideoHero_thaw() {
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.thaw.call(this)
+ }, unload: function unload() {
+ if (this._navigationEventHandlers) {
+ this._navigationEventHandlers.cancel();
+ this._navigationEventHandlers = null
+ }
+ if (this.dataContext.dispose)
+ this.dataContext.dispose();
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.unload.call(this)
+ }, _heroImageMediaItemChanged: function _heroImageMediaItemChanged() {
+ if (this.heroImageMediaItem && this.heroImageMediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries)
+ return;
+ this.heroMediaItem = this.heroImageMediaItem;
+ var promise;
+ if (this.heroImageMediaItem.hydrate)
+ promise = this.heroImageMediaItem.hydrate();
+ else
+ promise = WinJS.Promise.as();
+ promise.done(function onMediaItemHydrate() {
+ if (this.domElement)
+ WinJS.Utilities.addClass(this.domElement, this.mediaTypeClassName)
+ }.bind(this))
+ }, heroImageMediaItem: {get: function get() {
+ var heroMediaItem = null;
+ if (this.dataContext)
+ heroMediaItem = this.dataContext.heroImageMediaItem ? this.dataContext.heroImageMediaItem : this.dataContext.mediaItem;
+ return heroMediaItem
+ }}
+ }, {
+ heroMediaItem: null, mediaTypeClassName: String.empty, displayHeroContent: true, displayRating: false, displayReview: false, displayActionButtons: false
+ }, {
+ cssSelectors: {
+ noOp: ".currentPage :focus", related: ".currentPage .related .template-fullBleedThumbnail", movieHeroViewMore: ".currentPage .movieOverviewFrame .viewMoreRow .template-moreButton .win-focusable", tvHeroViewMore: ".currentPage .viewMoreRow.overview .template-moreButton .win-focusable", smartBuyButton: ".currentPage .contextButtonGroup > .contextButtonContainer:not(.removeFromDisplay) .iconButton,.currentPage .contextButtonGroup > .contextButtonContainer:not(.removeFromDisplay) .control-modifierActionButton,.currentPage .contextButtonGroup .contextButtonContainer .win-ratingpicker-ratebutton"
+ }, forceShowAnimationOnLoadOrTimeout: MS.Entertainment.Utilities.weakElementBindingInitializer(function forceShowAnimationOnLoadOrTimeout(sourceValue, targetElement, elementProperty) {
+ if (sourceValue && !(Array.isArray(sourceValue) && sourceValue.length === 0)) {
+ MS.Entertainment.Utilities.showElement(targetElement);
+ if (targetElement.showTimeout) {
+ targetElement.showTimeout.cancel();
+ targetElement.showTimeout = null
+ }
+ }
+ else if (!targetElement.showTimeout)
+ targetElement.showTimeout = WinJS.Promise.timeout(1000).then(function showElementTimeout() {
+ MS.Entertainment.Utilities.showElement(this);
+ this.showTimeout.cancel();
+ this.showTimeout = null
+ }.bind(targetElement))
+ })
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/ImmersiveDetails/InformationArchitecture.js b/packages/microsoft.zunevideo/Components/ImmersiveDetails/InformationArchitecture.js
new file mode 100644
index 00000000..553f53d8
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/ImmersiveDetails/InformationArchitecture.js
@@ -0,0 +1,28 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/iaservice.js", "/Framework/serviceLocator.js", "/Monikers.js");
+(function() {
+ "use strict";
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.informationArchitecture)) {
+ Trace.fail("InformationArchitecture - Information Architecture not registered. This should be impossible, but is always fatal");
+ throw new Error("Information Architecture - Information Architecture not registered");
+ }
+ var ia = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ var createImmersiveDetailsIA = function createImmersiveDetailsIA() {
+ var Viewability = MS.Entertainment.InformationArchitecture.Viewability;
+ var immersiveDetails = ia.createNode("", MS.Entertainment.UI.Monikers.immersiveDetails, null, {hub: Viewability.hidden}, false);
+ immersiveDetails.getPage = (function() {
+ var oldGetPage = immersiveDetails.getPage;
+ return function customImmersiveDetailsGetPage() {
+ var page = oldGetPage.call(this);
+ page.overrideFragmentUrl = "/Components/Immersive/ImmersiveNavStub.html";
+ return page
+ }
+ })();
+ Object.defineProperty(immersiveDetails, "showNotifications", {get: function() {
+ return true
+ }});
+ ia.rootNode.addChild(immersiveDetails)
+ };
+ createImmersiveDetailsIA();
+ ia.addIAHandler(createImmersiveDetailsIA, true)
+})()
diff --git a/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedDetails.html b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedDetails.html
new file mode 100644
index 00000000..b8c75c99
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedDetails.html
@@ -0,0 +1,33 @@
+
+
+
+
+ Snapped Details Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedDetails.js b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedDetails.js
new file mode 100644
index 00000000..64859468
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedDetails.js
@@ -0,0 +1,84 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/corefx.js", "/Framework/serviceLocator.js", "/Framework/utilities.js", "/ViewModels/MediaItemModel.js");
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SnappedDetails: MS.Entertainment.UI.Framework.defineUserControl("/Components/ImmersiveDetails/SnappedDetails.html#snappedDetailsTemplate", function immersiveDetailsConstructor(element, options) {
+ this.modelItem = {}
+ }, {
+ _initialized: false, _sessionMgr: null, _currentDetailsTemplatePath: null, _detailsDataContext: null, _uiStateEventHandler: null, initialize: function initialize() {
+ this.delayInitialize()
+ }, _delayInitialized: function delayInitialized() {
+ if (this._uiStateEventHandler) {
+ this._uiStateEventHandler.cancel();
+ this._uiStateEventHandler = null
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.detailsReady = true;
+ this._initialized = true
+ }
+ else
+ this._uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {stageThreeActivatedChanged: function stageThreeActivatedChanged(e) {
+ if (e.detail.newValue)
+ this._delayInitialized()
+ }.bind(this)})
+ }, updateModelItem: function updateModelItem(newModel) {
+ if (newModel && newModel !== this.modelItem && (!this.modelItem || !this.modelItem.isEqual || !this.modelItem.isEqual(newModel)))
+ this._updateMetaData(MS.Entertainment.ViewModels.MediaItemModel.augment(newModel))
+ }, _convertToTvSeries: function _convertToTvSeries(modelItem) {
+ var seriesMediaItem = MS.Entertainment.Data.augment({
+ id: modelItem.seriesId, libraryId: modelItem.seriesLibraryId, title: {$value: modelItem.seriesTitle}
+ }, MS.Entertainment.Data.Augmenter.Marketplace.TVSeries);
+ if (!this.modelItem || modelItem.seriesId !== this.modelItem.serviceId)
+ this._updateMetaData(MS.Entertainment.ViewModels.MediaItemModel.augment(seriesMediaItem))
+ }, _convertToArtist: function _convertToArtist(modelItem) {
+ var artistMediaItem = MS.Entertainment.Data.augment({
+ id: modelItem.artistServiceId, libraryId: modelItem.artistId, name: modelItem.artistName
+ }, MS.Entertainment.Data.Augmenter.Marketplace.Music.Artist);
+ this._updateMetaData(MS.Entertainment.ViewModels.MediaItemModel.augment(artistMediaItem))
+ }, _updateMetaData: function _updateMetaData(modelItem) {
+ var defaultIndex = 0;
+ if (!modelItem || !modelItem.mediaType)
+ return;
+ if (!this.modelItem)
+ MS.Entertainment.Utilities.empty(this.detailsContentContainer);
+ switch (modelItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ return;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(modelItem) && modelItem.hasServiceId) {
+ this._convertToArtist(modelItem);
+ return
+ }
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(modelItem))
+ this.setDetailsTemplate("/Components/ImmersiveDetails/SnappedTvEpisodeDetails.html#tvEpisodeOverviewTemplate", {modelItem: modelItem});
+ else
+ this.setDetailsTemplate("/Components/ImmersiveDetails/SnappedMovieDetails.html#movieOverviewTemplate", {modelItem: modelItem});
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ return;
+ default:
+ this.setDetailsTemplate("/Components/ImmersiveDetails/SnappedMovieDetails.html#movieOverviewTemplate", {modelItem: modelItem});
+ break
+ }
+ if (modelItem.hydrate)
+ modelItem.hydrate();
+ this.modelItem = modelItem
+ }, setDetailsTemplate: function setDetailsTemplate(templatePath, modelItem) {
+ if (this._currentDetailsTemplatePath !== templatePath) {
+ this._currentDetailsTemplatePath = templatePath;
+ MS.Entertainment.Utilities.empty(this.detailsContentContainer);
+ MS.Entertainment.UI.Framework.loadTemplate(templatePath).then(function renderControl(controlInstance) {
+ this._detailsDataContext = WinJS.Binding.as({dataContext: modelItem});
+ return controlInstance.render(this._detailsDataContext, this.detailsContentContainer)
+ }.bind(this))
+ }
+ else
+ this._detailsDataContext.dataContext.modelItem = modelItem.modelItem
+ }
+ }, {
+ modelItem: null, playbackSession: null, detailsReady: false
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedMovieDetails.html b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedMovieDetails.html
new file mode 100644
index 00000000..0bcc4fe4
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedMovieDetails.html
@@ -0,0 +1,53 @@
+
+
+
+
+ Snapped Movie Details Template
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedMovieDetails.js b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedMovieDetails.js
new file mode 100644
index 00000000..7aa0661c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedMovieDetails.js
@@ -0,0 +1,71 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {SnappedMovieDetailsOverview: MS.Entertainment.UI.Framework.defineUserControl("Components/ImmersiveDetails/SnappedMovieDetails.html#movieDetailsOverviewTemplate", function movieDetailsOverviewConstructor() {
+ this._bindingsToDetach = [];
+ this.smartBuyStateEngine = new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine
+ }, {
+ _bindingsToDetach: null, initialize: function initialize() {
+ this.bind("mediaItem", this._modelChanged.bind(this));
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._initializeBinding(uiStateService, "nowPlayingVisible", function nowPlayingVisibleChanged() {
+ this.nowPlayingVisible = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible
+ }.bind(this));
+ this._initializeBinding(uiStateService, "nowPlayingInset", function nowPlayingInsetChanged() {
+ this.nowPlayingInset = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset
+ }.bind(this));
+ this.bind("showPlayFeatured", this._updatePlayTrailerVisible.bind(this));
+ this.bind("featuredInfoVisible", this._updatePlayTrailerVisible.bind(this));
+ if (this.mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie || this.mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ this.smartBuyStateEngine.initialize(this.mediaItem, MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.canvas), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoDetailsTwoButtonStateChanged);
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement)
+ }, _updatePlayTrailerVisible: function _updatePlayTrailerVisible() {
+ this.playTrailerVisible = this.showPlayFeatured && this.featuredInfoVisible
+ }, _detachBindings: function _detachBindings() {
+ this._bindingsToDetach.forEach(function(e) {
+ e.source.unbind(e.name, e.action)
+ });
+ this._bindingsToDetach = []
+ }, _initializeBinding: function _initializeBinding(source, name, action) {
+ source.bind(name, action);
+ this._bindingsToDetach.push({
+ source: source, name: name, action: action
+ })
+ }, unload: function unload() {
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.unload();
+ this._detachBindings();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _modelChanged: function _modelChanged() {
+ if (this.mediaItem) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this.showPlayFeatured = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace) && this.mediaItem.hasZuneId && MS.Entertainment.ViewModels.SmartBuyStateHandlers._mediaHasAnyRight(this.mediaItem, MS.Entertainment.Utilities.defaultClientTypeFromApp, [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Preview, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.PreviewStream]);
+ if (this.mediaItem.serviceId && !MS.Entertainment.Utilities.isEmptyGuid(this.mediaItem.serviceId))
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(this.mediaItem).done(function imageUrl(url) {
+ this.boxArtImageUri = url
+ }.bind(this));
+ else if (this.mediaItem.imageUri) {
+ this.backgroundImageUri = this.mediaItem.imageUri;
+ this.boxArtImageUri = this.mediaItem.imageUri
+ }
+ }
+ else {
+ this.showPlayFeatured = false;
+ this.backgroundImageUri = null;
+ this.boxArtImageUri = null
+ }
+ }
+ }, {
+ mediaItem: null, smartBuyStateEngine: null, backgroundImageUri: null, boxArtImageUri: null, onPlayClicked: null, playTrailerVisible: false, featuredInfoVisible: true, nowPlayingVisible: false, nowPlayingInset: false, overviewVisible: false, showPlayFeatured: true, sessionId: null, hidePlayTrailer: false, playTrailerClick: function playTrailerClick() {
+ MS.Entertainment.Utilities.Telemetry.logPlayPreview(this.mediaItem, false);
+ if (this.onPlayClicked) {
+ MS.Entertainment.UI.Controls.assert(this.mediaItem, "playTrailerClick. this.mediaItem is not valid");
+ if (this.mediaItem) {
+ this.mediaItem.playPreviewOnly = true;
+ this.onPlayClicked()
+ }
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedTvEpisodeDetails.html b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedTvEpisodeDetails.html
new file mode 100644
index 00000000..5cf7df4b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedTvEpisodeDetails.html
@@ -0,0 +1,51 @@
+
+
+
+
+ Snapped TV Episode Details Template
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedTvEpisodeDetails.js b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedTvEpisodeDetails.js
new file mode 100644
index 00000000..4b7d8604
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/ImmersiveDetails/SnappedTvEpisodeDetails.js
@@ -0,0 +1,45 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {SnappedTvEpisodeDetailsOverview: MS.Entertainment.UI.Framework.defineUserControl("/Components/ImmersiveDetails/SnappedTvEpisodeDetails.html#tvEpisodeDetailsOverviewTemplate", function tvSeriesDetailsOverviewConstructor() {
+ this._bindingsToDetach = []
+ }, {
+ _bindingsToDetach: null, initialize: function initialize() {
+ this.bind("mediaItem", this._modelChanged.bind(this));
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._initializeBinding(uiStateService, "nowPlayingVisible", function nowPlayingVisibleChanged() {
+ this.nowPlayingVisible = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible
+ }.bind(this));
+ this._initializeBinding(uiStateService, "nowPlayingInset", function nowPlayingInsetChanged() {
+ this.nowPlayingInset = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset
+ }.bind(this));
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement)
+ }, _detachBindings: function _detachBindings() {
+ this._bindingsToDetach.forEach(function(e) {
+ e.source.unbind(e.name, e.action)
+ });
+ this._bindingsToDetach = []
+ }, _initializeBinding: function _initializeBinding(source, name, action) {
+ source.bind(name, action);
+ this._bindingsToDetach.push({
+ source: source, name: name, action: action
+ })
+ }, unload: function unload() {
+ this._detachBindings();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _modelChanged: function _modelChanged(newModel) {
+ if (newModel)
+ if (newModel.serviceId && !MS.Entertainment.Utilities.isEmptyGuid(newModel.serviceId))
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(newModel).done(function imageUrl(url) {
+ this.boxArtImageUri = url
+ }.bind(this));
+ else if (newModel.imageUri) {
+ this.backgroundImageUri = newModel.imageUri;
+ this.boxArtImageUri = newModel.imageUri
+ }
+ }
+ }, {
+ mediaItem: null, backgroundImageUri: null, boxArtImageUri: null, featuredInfoVisible: true, nowPlayingVisible: false, nowPlayingInset: false, overviewVisible: false, sessionId: null, playFeaturedClick: function playFeaturedClick(){}
+ }, {})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/ActionButtonsControl.html b/packages/microsoft.zunevideo/Components/InlineDetails/ActionButtonsControl.html
new file mode 100644
index 00000000..dffc82eb
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/ActionButtonsControl.html
@@ -0,0 +1,122 @@
+
+
+
+
+ Action Buttons Control
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/BaseInlineDetails.js b/packages/microsoft.zunevideo/Components/InlineDetails/BaseInlineDetails.js
new file mode 100644
index 00000000..d9cee764
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/BaseInlineDetails.js
@@ -0,0 +1,420 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {BaseInlineDetails: MS.Entertainment.UI.Framework.defineUserControl(null, function baseInlineDetails(element, options) {
+ this.media = this.media || {};
+ this.mediaBindings = [];
+ this._listBindings = []
+ }, {
+ inlineExtraData: null, allowShare: true, _loadedButtons: false, _shareOperation: null, _overlay: null, _listLoadingControlPromise: null, _listBindings: null, _disableActionsOnListSelection: false, _errorPanelShown: false, _focusOverriden: false, controlName: "BaseInlineDetails", LOADING_PANEL_SHOW_DELAY: 500, LIST_LOADING_SHOW_DELAY: 1500, initialize: function initialize() {
+ this.bind("isLoading", function() {
+ if (!this.fragmentContainer)
+ return;
+ if (!this.isLoading) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (!this.isFailed) {
+ eventProvider.traceGalleryControl_InLine_Open_End();
+ if (this.failedControl)
+ MS.Entertainment.Utilities.hideElement(this.failedControl);
+ if (this.loadingContainer)
+ MS.Entertainment.Utilities.hideElement(this.loadingContainer).then(function showContent() {
+ var showPromise = MS.Entertainment.Utilities.showElement(this.fragmentContainer);
+ this._fragmentContainerShown();
+ return showPromise
+ }.bind(this)).then(this._raiseContentReady.bind(this));
+ else {
+ var showPromise = MS.Entertainment.Utilities.showElement(this.fragmentContainer);
+ this._fragmentContainerShown();
+ showPromise.then(this._raiseContentReady.bind(this)).done(function() {
+ if (!this._focusOverriden)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.domElement)
+ }.bind(this))
+ }
+ }
+ else
+ eventProvider.traceGalleryControl_InLine_Open_Error()
+ }
+ else if (this.loadingContainer) {
+ WinJS.Promise.timeout(this.LOADING_PANEL_SHOW_DELAY).then(function _delay() {
+ if (this.isLoading)
+ MS.Entertainment.Utilities.showElement(this.loadingContainer)
+ }.bind(this));
+ MS.Entertainment.Utilities.hideElement(this.fragmentContainer)
+ }
+ }.bind(this));
+ this.isLoading = true
+ }, unload: function unload() {
+ this._releaseMedia();
+ this.hideListLoadingControl();
+ this._clearListBindings();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, setOverlay: function setOverlay(overlay) {
+ this._overlay = overlay
+ }, showListLoadingControl: function showLoadingControl(delay) {
+ if (this._listLoadingControlPromise) {
+ this._listLoadingControlPromise.cancel();
+ this._listLoadingControlPromise = null
+ }
+ if (this.listLoadingContainer)
+ this._listLoadingControlPromise = WinJS.Promise.timeout(delay ? delay : this.LIST_LOADING_SHOW_DELAY).then(function showProgressRing() {
+ var ring = document.createElement("progress");
+ var ringSize = MS.Entertainment.Utilities.isApp2 ? "win-large" : "win-medium";
+ ring.className = ringSize + " win-ring";
+ this.listLoadingContainer.appendChild(ring);
+ WinJS.Utilities.removeClass(this.listLoadingContainer, "removeFromDisplay");
+ this._listLoadingControlPromise = null
+ }.bind(this), function onError(){})
+ }, hideListLoadingControl: function hideLoadingControl() {
+ if (this._listLoadingControlPromise) {
+ this._listLoadingControlPromise.cancel();
+ this._listLoadingControlPromise = null
+ }
+ if (this.listLoadingContainer) {
+ MS.Entertainment.Utilities.empty(this.listLoadingContainer);
+ WinJS.Utilities.addClass(this.listLoadingContainer, "removeFromDisplay")
+ }
+ }, _releaseMedia: function _releaseMedia() {
+ this._unshareModel();
+ this._clearMediaBindings()
+ }, _clearListBindings: function _clearListBindings() {
+ for (var i = 0; i < this._listBindings.length; i++)
+ if (this._listBindings[i])
+ this._listBindings[i].cancel();
+ this._listBindings = []
+ }, _clearMediaBindings: function _clearMediaBindings() {
+ for (var i = 0; i < this.mediaBindings.length; i++)
+ if (this.mediaBindings[i])
+ this.mediaBindings[i].cancel();
+ this.mediaBindings = []
+ }, _getLists: function _getLists() {
+ if (!this.domElement)
+ return [];
+ var lists = WinJS.Utilities.query("[data-win-control='MS.Entertainment.UI.Controls.GalleryControl']", this.domElement) || [];
+ lists = lists.map(function mapListItem(item) {
+ return item.winControl ? item.winControl : item
+ });
+ if (lists.length <= 0 && this._list)
+ lists = [this._list];
+ return lists
+ }, _removeComplete: function removeComplete(eventArgs) {
+ var removed = eventArgs.detail && eventArgs.detail.deleted;
+ var removedMedia = eventArgs.detail && eventArgs.detail.removedItem;
+ if (removed && this.media && this.media.isEqual && this.media.isEqual(removedMedia))
+ if (this._overlay)
+ this._overlay.hide()
+ }, _clearSelection: function _clearSelection() {
+ var lists = this._getLists();
+ lists.forEach(function(list) {
+ list.clearSelection()
+ })
+ }, _clearInvocation: function _clearInvocation() {
+ var lists = this._getLists();
+ lists.forEach(function(list) {
+ if (list && list.invocationHelper)
+ list.invocationHelper.clearInvocation()
+ })
+ }, _shareModel: function _shareModel() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender))
+ return;
+ var sender = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ if (this.media && this.allowShare) {
+ this._unshareModel();
+ try {
+ this._shareOperation = sender.pendingShare(this.media)
+ }
+ catch(e) {
+ this._shareOperation = null
+ }
+ }
+ }, _unshareModel: function _unshareModel() {
+ if (this._shareOperation) {
+ this._shareOperation.cancel();
+ this._shareOperation = null
+ }
+ }, _setMedia: function _setMedia(media) {
+ var platLog;
+ var dataPoint;
+ if (media) {
+ if (media.serviceType === MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem)
+ media = MS.Entertainment.Utilities.convertEditorialItem(media);
+ MS.Entertainment.Utilities.Telemetry.logPopoverShown(MS.Entertainment.UI.AutomationIds.showPopover, media)
+ }
+ this._releaseMedia();
+ this.media = media;
+ if (!this.isLoading)
+ this._shareModel()
+ }, _showPanel: function showPanel(noDelay) {
+ if (noDelay)
+ this.isLoading = false;
+ else
+ WinJS.Promise.timeout().then(function updateStatus() {
+ this.isLoading = false
+ }.bind(this))
+ }, _hidePanel: function showPanel(noDelay) {
+ if (noDelay)
+ this.isLoading = true;
+ else
+ WinJS.Promise.timeout().then(function updateStatus() {
+ this.isLoading = true
+ }.bind(this))
+ }, _showElement: function showElement(element, visibility) {
+ if (element)
+ if (visibility)
+ WinJS.Utilities.removeClass(element, "inlineDetailsHidden");
+ else
+ WinJS.Utilities.addClass(element, "inlineDetailsHidden")
+ }, _fragmentContainerShown: function _fragmentContainerShown(){}, _raiseContentReady: function _raiseContentReady() {
+ var readyEvent = document.createEvent("Event");
+ readyEvent.initEvent("DetailsReady", true, true);
+ this.domElement.dispatchEvent(readyEvent)
+ }
+ }, {
+ isLoading: true, isFailed: false, media: null, mediaBindings: null
+ })});
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Pages");
+ WinJS.Namespace.define("MS.Entertainment.Pages", {BaseMediaInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", null, function baseInlineDetails(element, options) {
+ this.smartBuyStateEngine = null;
+ this._appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._appbarEventHandlers = {deleteMedia: this._removeComplete.bind(this)}
+ }, {
+ controlName: "BaseMediaInlineDetails", blockErrorPanel: false, _mediaContext: null, _appBarService: null, _appbarEventHandlers: null, _isOnline: false, _currentButtonsBinding: null, _enableCurrentButtonsBinding: false, initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.call(this);
+ switch (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).networkStatus) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ this._isOnline = true;
+ break;
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ this._isOnline = false;
+ if (this._showErrorPanel)
+ this._handleError();
+ break
+ }
+ this._setMedia(this.media);
+ if (this._disableActionsOnListSelection)
+ this._createListSelectionBindings()
+ }, _createListSelectionBindings: function _createListSelectionBindings() {
+ var lists = this._getLists();
+ var selectedIndicesChangedCallback = this._selectedIndicesChanged.bind(this);
+ this._clearListBindings();
+ lists.forEach(function(list) {
+ var binding = WinJS.Binding.bind(list, {selectedIndices: selectedIndicesChangedCallback});
+ this._listBindings.push(binding)
+ }.bind(this))
+ }, _selectedIndicesChanged: function _selectedIndicesChanged(newValue, oldValue) {
+ this._updateButtonStates(newValue, oldValue)
+ }, _updateButtonStates: function _updateButtonStates(newValue, oldValue) {
+ if (oldValue === undefined)
+ return;
+ var enableActions = !Array.isArray(newValue) || newValue.length === 0;
+ var popoverButtons = (this._actionsPanel.currentButtons && this._actionsPanel.currentButtons.getArray()) || [];
+ for (var i = 0; i < popoverButtons.length; i++)
+ popoverButtons[i].isEnabled = enableActions
+ }, _releaseSmartButtons: function _releaseSmartButtons() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.unload();
+ this.smartBuyStateEngine = null
+ }
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ }, _releaseMedia: function _releaseMedia() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype._releaseMedia.apply(this, arguments);
+ if (MS.Entertainment.UI.Controls.UserFeedbackDialog)
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.inlineDetailsItem = null;
+ if (this._enableCurrentButtonsBinding)
+ this._clearCurrentButtonsBinding();
+ this._releaseSmartButtons()
+ }, _setMedia: function _setMedia(media) {
+ if (this._unloaded)
+ return;
+ MS.Entertainment.Pages.BaseInlineDetails.prototype._setMedia.apply(this, arguments);
+ media = this.media;
+ MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this.media);
+ if (MS.Entertainment.UI.Controls.UserFeedbackDialog)
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.inlineDetailsItem = this;
+ var lists = this._getLists();
+ var mediaContext;
+ if (lists.length || !this.smartBuyStateEngine) {
+ mediaContext = this._appBarService.pushMediaContext(media, this._appbarEventHandlers, null, {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.popover});
+ mediaContext.collectionFilter = this.collectionFilter || Microsoft.Entertainment.Platform.MediaAvailability.available
+ }
+ this._initializeLists(lists, mediaContext);
+ if (!this.smartBuyStateEngine) {
+ this._mediaContext = mediaContext;
+ this.smartBuyStateEngine = this._createSmartBuyStateEngine();
+ this.mediaBindings.push(WinJS.Binding.bind(this.smartBuyStateEngine, {currentAppbarActions: this._setAppbarActions.bind(this)}))
+ }
+ if (this._enableCurrentButtonsBinding)
+ this._setCurrentButtonsBinding()
+ }, _createSmartBuyStateEngine: function _createSmartBuyStateEngine() {
+ return new MS.Entertainment.ViewModels.SmartBuyStateEngine
+ }, _setCurrentButtonsBinding: function _setCurrentButtonsBinding() {
+ this._loadedButtons = false;
+ this._clearCurrentButtonsBinding();
+ if (this.smartBuyStateEngine)
+ this._currentButtonsBinding = WinJS.Binding.bind(this.smartBuyStateEngine, {currentButtons: this._onButtonsChanged.bind(this)})
+ }, _clearCurrentButtonsBinding: function _clearCurrentButtonsBinding() {
+ if (this._currentButtonsBinding) {
+ this._currentButtonsBinding.cancel();
+ this._currentButtonsBinding = null
+ }
+ }, _onButtonsChanged: function _onButtonsChanged(newButtons, oldButtons) {
+ if (this._unloaded || !newButtons || newButtons.length === 0 || !this._currentButtonsBinding)
+ return;
+ if (!this._loadedButtons) {
+ this._buttonChangedHandler();
+ this._loadedButtons = true
+ }
+ this._setActionButtonFocusOverrides(newButtons.length)
+ }, _setActionButtonFocusOverrides: function _setActionButtonFocusOverrides(actionButtonsLength) {
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ var noOp = ".currentPage :focus";
+ var actionButtons = document.querySelectorAll(".actions .win-focusable");
+ for (var i = 0; i < actionButtons.length; i++)
+ actionButtons[i].removeAttribute("data-win-focus");
+ if (actionButtonsLength === 1)
+ actionButtons[0].setAttribute("data-win-focus", JSON.stringify({
+ up: noOp, down: noOp
+ }));
+ else if (actionButtonsLength > 1) {
+ actionButtons[0].setAttribute("data-win-focus", JSON.stringify({up: noOp}));
+ actionButtons[actionButtonsLength - 1].setAttribute("data-win-focus", JSON.stringify({down: noOp}))
+ }
+ }
+ }, _initializeLists: function _initializeLists(lists, mediaContext) {
+ if (lists)
+ lists.forEach(function initializeList(list) {
+ if (list) {
+ if (MS.Entertainment.ViewModels.SmartAppbarActions && MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers)
+ list.addSelectionHandlers(MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers(this._clearSelection.bind(this), this._removeComplete.bind(this)));
+ if (list.invocationHelper) {
+ var clearInvocation = this._clearInvocation.bind(this);
+ list.invocationHelper.addInvocationHandlers({deleteMedia: clearInvocation})
+ }
+ list.mediaContext = mediaContext
+ }
+ }, this)
+ }, _showCollectionFilter: function _showCollectionFilter() {
+ var stringId;
+ if (this._unloaded)
+ return;
+ switch (this.collectionFilter) {
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableOffline:
+ stringId = String.id.IDS_DETAILS_FILTER_AVAILABLE_OFFLINE;
+ break;
+ case Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloud:
+ stringId = String.id.IDS_DETAILS_FILTER_IN_CLOUD;
+ break;
+ default:
+ break
+ }
+ if (stringId) {
+ var action = new MS.Entertainment.UI.Actions.Action;
+ action.automationId = MS.Entertainment.UI.AutomationIds.collectionFilterLink;
+ action.canExecute = function canExecute() {
+ return true
+ };
+ action.executed = function executed() {
+ if (this._unloaded)
+ return;
+ this.collectionFilter = null;
+ if (this._mediaContext)
+ this._mediaContext.collectionFilter = null;
+ var lists = this._getLists();
+ lists.forEach(function clearLists(list) {
+ if (list.mediaContext && list.mediaContext.collectionFilter)
+ list.mediaContext.collectionFilter = null;
+ list.dataSource = null
+ });
+ this.showListLoadingControl();
+ this._onClearedFilters();
+ if (this._collectionFilterText)
+ WinJS.Utilities.addClass(this._collectionFilterText, "removeFromDisplay");
+ if (this._collectionFilterLink)
+ WinJS.Utilities.addClass(this._collectionFilterLink.domElement, "removeFromDisplay")
+ }.bind(this);
+ if (this._collectionFilterText) {
+ this._collectionFilterText.textContent = String.load(stringId);
+ WinJS.Utilities.removeClass(this._collectionFilterText, "removeFromDisplay")
+ }
+ if (this._collectionFilterLink) {
+ this._collectionFilterLink.action = action;
+ WinJS.Utilities.removeClass(this._collectionFilterLink.domElement, "removeFromDisplay")
+ }
+ }
+ }, _onClearedFilters: function _onClearedFilters() {
+ MS.Entertainment.Pages.fail("called by _showCollectionFilter. Should be overridden")
+ }, _setAppbarActions: function _setAppbarActions(newValue, oldValue) {
+ if (!this._unloaded && this._mediaContext)
+ this._mediaContext.setToolbarActions(this.smartBuyStateEngine ? this.smartBuyStateEngine.currentAppbarActions : null)
+ }, _formatDurationString: function formatDetailString(value) {
+ var duration = String.empty;
+ if (value && value !== -1)
+ duration = MS.Entertainment.Utilities.formatTimeString(value);
+ return duration
+ }, _hydrateMediaIfPossible: function _hydrateMediaIfPossible() {
+ if (this.media.hasServiceId)
+ return this._hydrateMedia();
+ else {
+ this._handleHydrateCompleted();
+ return WinJS.Promise.wrap()
+ }
+ }, _hydrateMedia: function _hydrateMedia() {
+ var hydratePromise;
+ if (this.media.hydrate && !this._errorPanelShown) {
+ var hydrateOptions = {
+ forceUpdate: this.media.isFailed, listenForDBUpdates: true
+ };
+ hydratePromise = this.media.hydrate(hydrateOptions).then(this._handleHydrateCompleted.bind(this), this._handleError.bind(this));
+ var binding = WinJS.Binding.bind(this.media, {isFailed: this._handleIsFailedChanged.bind(this)});
+ this.mediaBindings.push(binding)
+ }
+ else {
+ this._handleHydrateCompleted();
+ hydratePromise = WinJS.Promise.wrap()
+ }
+ return hydratePromise
+ }, _handleIsFailedChanged: function _handleIsFailedChanged() {
+ if (this._unloaded || !this.media)
+ return;
+ if (this.media.isFailed && !this.media.hydrated)
+ this._handleError()
+ }, _handleHydrateCompleted: function _handleHydrateCompleted() {
+ this._shareModel();
+ this._showPanel();
+ this._onHydrateCompleted()
+ }, _onHydrateCompleted: function _onHydrateCompleted(){}, _showErrorPanel: {get: function _showErrorPanel() {
+ return this._shouldShowErrorPanel()
+ }}, _shouldShowErrorPanel: function _shouldShowErrorPanel() {
+ return (!this.media.inCollection && !this.blockErrorPanel && !this.isFailed)
+ }, _handleError: function _handleError() {
+ if (this._showErrorPanel) {
+ this.isFailed = true;
+ this.isLoading = false;
+ this._errorPanelShown = true;
+ if (this.loadingContainer)
+ MS.Entertainment.Utilities.hideElement(this.loadingContainer);
+ if (this.fragmentContainer)
+ MS.Entertainment.Utilities.hideElement(this.fragmentContainer);
+ if (this.failedControl)
+ MS.Entertainment.Utilities.showElement(this.failedControl);
+ var newControl = document.createElement("div");
+ newControl.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.FailedPanel");
+ this.failedControl.appendChild(newControl);
+ WinJS.UI.process(newControl)
+ }
+ else
+ this._showPanel()
+ }
+ }, {
+ originalLocation: null, detailString: null, smartBuyStateEngine: null, showStreamingStatus: false, streamingStatusText: null, collectionFilter: null, collectionFilterText: String.empty
+ }, {Location: {
+ collection: MS.Entertainment.Data.ItemLocation.collection, marketplace: MS.Entertainment.Data.ItemLocation.marketplace
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/MusicAlbumInlineDetails.html b/packages/microsoft.zunevideo/Components/InlineDetails/MusicAlbumInlineDetails.html
new file mode 100644
index 00000000..0f6645fe
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/MusicAlbumInlineDetails.html
@@ -0,0 +1,228 @@
+
+
+
+
+ Music Album Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/MusicAlbumInlineDetails.js b/packages/microsoft.zunevideo/Components/InlineDetails/MusicAlbumInlineDetails.js
new file mode 100644
index 00000000..0ea9a62c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/MusicAlbumInlineDetails.js
@@ -0,0 +1,347 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Components.InlineDetails");
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MusicAlbumInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", null, function musicAlbumInlineDetails(element, options) {
+ this.templateStorage = "/Components/InlineDetails/MusicAlbumInlineDetails.html";
+ this.templateName = "music2AlbumInlineDetailsTemplate"
+ }, {
+ tracks: null, _songCount: 0, _signedInUser: null, _signInBindings: null, _listenerId: null, _invokedTrack: null, _eventHandlers: null, _buttonEventHandlers: null, _disableActionsOnListSelection: true, _enableCurrentButtonsBinding: true, initialize: function initialize() {
+ if (!this.media)
+ return;
+ this._list.ensureNextItemVisibleCount = 2;
+ this.LOADING_PANEL_SHOW_DELAY = 2000,
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this, arguments);
+ this.showListLoadingControl();
+ if (this.media.listenerId) {
+ this._listenerId = this.media.listenerId;
+ this.media.listenerId = null
+ }
+ this.media.location = this.originalLocation;
+ this.media = MS.Entertainment.ViewModels.MediaItemModel.augment(this.media);
+ this._formatDetailString();
+ this._setupSmartBuy();
+ if (this.originalLocation === MS.Entertainment.Data.ItemLocation.collection) {
+ this.media.fromCollection = true;
+ WinJS.Utilities.removeClass(this._list.domElement, "marketplaceTracks");
+ WinJS.Utilities.addClass(this._list.domElement, "collectionTracks");
+ this._loadLocalTracks();
+ if (this.media.hasServiceId && !this.media.hasCanonicalId) {
+ var query = new MS.Entertainment.Data.Query.Music.AlbumDetails;
+ query.id = this.media.serviceId;
+ query.idType = this.media.serviceIdType;
+ query.execute().done(function gotAlbum(albumQuery) {
+ if (WinJS.Utilities.getMember("result.item", albumQuery))
+ this.media.canonicalId = albumQuery.result.item.canonicalId
+ }.bind(this), function albumQueryError(error) {
+ MS.Entertainment.Components.InlineDetails.fail("Album query to get canonical id failed: " + (error && error.message))
+ })
+ }
+ }
+ else {
+ if (this.media.fromCollection)
+ this.media.hydrated = false;
+ this.media.fromCollection = false;
+ WinJS.Utilities.removeClass(this._list.domElement, "collectionTracks");
+ WinJS.Utilities.addClass(this._list.domElement, "marketplaceTracks");
+ var trackBinding = WinJS.Binding.bind(this.media, {
+ tracks: this._loadServiceTracks.bind(this), isFailed: function _hydrateFailed(newValue) {
+ if (!trackBinding || !newValue || this._unloaded)
+ return;
+ if (this._fallbackToCollection()) {
+ trackBinding.cancel();
+ trackBinding = null;
+ this.originalLocation = MS.Entertainment.Data.ItemLocation.collection;
+ this.initialize()
+ }
+ }.bind(this)
+ });
+ this.mediaBindings.push(trackBinding);
+ if (this._list && this._list.mediaContext)
+ this._list.mediaContext.containingMedia = {
+ playbackItemSource: this.media, playbackOffset: 0
+ }
+ }
+ this._hydrateMedia();
+ if (!this._eventHandlers)
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.domElement, {
+ iteminvoked: this._itemInvoked.bind(this), galleryFirstPageRendered: function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("album")
+ }
+ });
+ if (!this._buttonEventHandlers)
+ this._buttonEventHandlers = MS.Entertainment.Utilities.addEvents(this.domElement, {iconButtonClicked: function processIconButtonClicked(event) {
+ var id = event && event.id;
+ if (id === MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToMyMusic || id === MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionAddToMyMusic) {
+ MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this.media);
+ MS.Entertainment.ViewModels.MediaItemModel.hydrateListLibraryInfoAsync(this.tracks)
+ }
+ event.stopPropagation()
+ }.bind(this)});
+ this._showPanel();
+ if (this.smartBuyStateEngine) {
+ var resumeSmartBuyEngineStateChanges = function resumeSmartBuyEngineStateChanges() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.suspendStateChanges = false;
+ this.smartBuyStateEngine.updateState()
+ }
+ }.bind(this);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer)) {
+ this.smartBuyStateEngine.suspendStateChanges = true;
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.media).done(resumeSmartBuyEngineStateChanges, resumeSmartBuyEngineStateChanges)
+ }
+ }
+ }, unload: function unload() {
+ if (this._listenerId) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.unregisterListener(this._listenerId);
+ this._listenerId = null
+ }
+ if (this._signInBindings) {
+ this._signInBindings.cancel();
+ this._signInBindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ if (this._buttonEventHandlers) {
+ this._buttonEventHandlers.cancel();
+ this._buttonEventHandlers = null
+ }
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }, _handleActionsReady: function _handleActionsReady(event) {
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ WinJS.Promise.timeout(100).done(function focusElement() {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(event.srcElement)
+ }.bind(this))
+ }, _itemInvoked: function _itemInvoked(event) {
+ event.detail.itemPromise.then(function getItemData(data) {
+ var matchingTrack = null;
+ var marketplaceTracks = this.media.marketplaceTracks;
+ if (MS.Entertainment.Data.List.isList(marketplaceTracks))
+ MS.Entertainment.Data.List.listToArray(marketplaceTracks).done(function gotItems(trackArray) {
+ marketplaceTracks = trackArray
+ });
+ if (!data.data.rights && marketplaceTracks) {
+ var found = marketplaceTracks.some(function(track) {
+ if (track.serviceId === data.data.serviceId) {
+ matchingTrack = track;
+ return track
+ }
+ });
+ if (matchingTrack)
+ data.data.rights = matchingTrack.rights
+ }
+ }.bind(this));
+ event.stopPropagation()
+ }, _onFocusIn: function _onFocusIn() {
+ WinJS.Utilities.addClass(this._list.domElement, "focused")
+ }, _onFocusOut: function _onFocusOut() {
+ WinJS.Utilities.removeClass(this._list.domElement, "focused")
+ }, _setupSmartBuy: function _setupSmartBuy() {
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getAlbumInlineDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.popover), MS.Entertainment.ViewModels.MusicStateHandlers.onAlbumPopoverStateChanged);
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._smartBuyStateEngineBindings = WinJS.Binding.bind(this.smartBuyStateEngine, {currentButtons: function updateButtons(newValue) {
+ if (newValue && newValue.length) {
+ this.actionButtons = new MS.Entertainment.ObservableArray(newValue).bindableItems;
+ if (!this.domElement.contains(document.activeElement))
+ WinJS.Promise.timeout(50).done(function setFocus() {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._actionColumn)
+ }.bind(this))
+ }
+ }.bind(this)})
+ }, _buttonChangedHandler: function _buttonChangedHandler() {
+ this._setTrackDataSource()
+ }, _onClearedFilters: function _onClearedFilters() {
+ this._loadLocalTracks()
+ }, _fallbackToCollection: function _fallbackToCollection() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ return navigationService.checkUserLocation(MS.Entertainment.UI.Monikers.searchPage) && this.media && this.media.inCollection
+ }, _shouldShowErrorPanel: function _shouldShowErrorPanel() {
+ return this.media && !this.media.fromCollection && !this.blockErrorPanel && !this.isFailed && !this._fallbackToCollection()
+ }, _populateMusicVideoIds: function _populateMusicVideoIds(queryResult) {
+ if (!this.media.hasServiceId)
+ return;
+ var marketplaceAlbum = new MS.Entertainment.Data.Augmenter.Marketplace.EDSAlbum;
+ marketplaceAlbum.serviceId = this.media.serviceId;
+ marketplaceAlbum.serviceIdType = this.media.serviceIdType;
+ return marketplaceAlbum.hydrate({forceUpdate: true}).then(function createArrays() {
+ if (!marketplaceAlbum.tracks)
+ return WinJS.Promise.wrapError("No tracks on specified album");
+ return WinJS.Promise.join({
+ marketplaceTracks: marketplaceAlbum.tracks.toArray(), localQueryTracks: queryResult.toArray()
+ })
+ }, function error(error){}).then(function populateMusicVideoIds(results) {
+ var musicVideoIdMap = {};
+ results.marketplaceTracks.forEach(function marketplaceTrackIterator(marketplaceTrack) {
+ musicVideoIdMap[marketplaceTrack.serviceId] = marketplaceTrack.musicVideoId
+ });
+ results.localQueryTracks.forEach(function localTrackIterator(localTrack) {
+ localTrack.musicVideoId = musicVideoIdMap[localTrack.serviceId]
+ });
+ return results.localQueryTracks
+ }, function error(error){})
+ }, _loadLocalTracks: function _loadLocalTracks() {
+ var query = new MS.Entertainment.Data.Query.libraryTracks;
+ query.albumId = this.media.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.TracksSortBy.numberAscending;
+ query.mediaAvailability = this.collectionFilter;
+ query.isLive = true;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.album, MS.Entertainment.Utilities.isValidServiceId(this.media.canonicalId) ? this.media.canonicalId : String.empty);
+ if (this._list && this._list.mediaContext)
+ this._list.mediaContext.containingMedia = {
+ playbackItemSource: query.clone(), playbackOffset: 0
+ };
+ query.execute().then(function(q) {
+ this.tracks = q.result.items;
+ this._songCount = this.tracks.count;
+ var binding = WinJS.Binding.bind(q.result.items, {count: this._updateHandler.bind(this)});
+ this.mediaBindings.push(binding);
+ if (this._loadedButtons)
+ this._setTrackDataSource();
+ if (this.collectionFilter && this.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available) {
+ var unfilteredQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ unfilteredQuery.albumId = this.media.libraryId;
+ unfilteredQuery.executeCount().done(function unfilteredQueryComplete(unfilteredTrackCount) {
+ if (unfilteredTrackCount > this._songCount)
+ this._showCollectionFilter()
+ }.bind(this), function unfilteredQueryError() {
+ this._showCollectionFilter()
+ }.bind(this))
+ }
+ this._populateMusicVideoIds(q.result.items)
+ }.bind(this))
+ }, _updateHandler: function _updateHandler(newValue, oldValue) {
+ if (oldValue !== undefined)
+ if (newValue === 0 && this._overlay)
+ this._overlay.hide()
+ }, _loadServiceTracks: function loadServiceTracks(newValue, oldValue) {
+ if (oldValue === undefined && !newValue)
+ return;
+ if (this.media.tracks) {
+ this.tracks = this.media.tracks;
+ if (!this._signedInUser) {
+ this._signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!this._signedInUser.isSubscription)
+ this._signInBindings = WinJS.Binding.bind(this._signedInUser, {isSubscription: this._updateSubscriptionLinkVisibility.bind(this)})
+ }
+ }
+ if (this._loadedButtons)
+ this._setTrackDataSource()
+ }, _setTrackDataSource: function _setTrackDataSource() {
+ this.hideListLoadingControl();
+ this._list.dataSource = this.tracks;
+ this._findTrack()
+ }, _findTrack: function findTrack() {
+ if (!this._invokedTrack || !this.tracks || this.tracks.count === 0)
+ return;
+ this.tracks.forEachAll(function findTrack(args) {
+ if ((this._invokedTrack.serviceId && this._invokedTrack.serviceId !== MS.Entertainment.Utilities.EMPTY_GUID && args.item.data.serviceId === this._invokedTrack.serviceId) || (this._invokedTrack.canonicalId && this._invokedTrack.canonicalId !== MS.Entertainment.Utilities.EMPTY_GUID && args.item.data.canonicalId === this._invokedTrack.canonicalId) || (this._invokedTrack.libraryId !== -1 && this._invokedTrack.libraryId === args.item.data.libraryId)) {
+ this._list.initialInvoked = this.tracks.indexFromKey(args.item.key);
+ args.stop = true
+ }
+ }.bind(this)).done(null, function handlerError(error) {
+ MS.Entertainment.Components.InlineDetails.fail("track.forEachAll has failed. error " + (error && error.message))
+ })
+ }, _formatDetailString: function _formatDetailString() {
+ var bindingsComplete = false;
+ var formatAlbumDetailString = function formatAlbumDetailString() {
+ if (bindingsComplete) {
+ this.detailString = MS.Entertainment.Data.Factory.createAlbumDetailString(this.media, MS.Entertainment.Pages.MusicTrackAlbumInlineDetails.detailsOptions);
+ this.showExplicitLabel = this.media.isExplicit && MS.Entertainment.Utilities.isMusicApp1
+ }
+ }.bind(this);
+ this.mediaBindings.push(WinJS.Binding.bind(this.media, {
+ artistName: formatAlbumDetailString, releaseDate: formatAlbumDetailString, primaryGenre: formatAlbumDetailString, genreName: formatAlbumDetailString, label: formatAlbumDetailString
+ }));
+ bindingsComplete = true;
+ formatAlbumDetailString()
+ }, _updateSubscriptionLinkVisibility: function _updateSubscriptionLinkVisibility() {
+ if (this._subscriptionLink && this._subscriptionLink.action && this._subscriptionLink.action.canExecute())
+ MS.Entertainment.ViewModels.MusicSmartBuyStateHandlers.getAlbumRights(this.media).then(function getAlbumRights_complete(rights) {
+ this.showSignupLink = (rights.subscriptionStream || rights.subscriptionDownload);
+ if (this.showSignupLink)
+ this._subscriptionLink.action.parameter = MS.Entertainment.Music.Freeplay.Events.musicPassUpsellAlbumPopoverLinkInvoked
+ }.bind(this));
+ else
+ this.showSignupLink = false
+ }
+ }, {
+ showSignupLink: false, showExplicitLabel: false, actionButtons: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MusicTrackAlbumInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MusicAlbumInlineDetails", "Components/InlineDetails/MusicAlbumInlineDetails.html#musicAlbumInlineDetailsTemplate", function musicAlbumInlineDetails(element, options) {
+ var shouldInvokeTrack = WinJS.Utilities.getMember("dataContext.invokeTrack", options);
+ if (shouldInvokeTrack !== undefined)
+ this._shouldInvokeTrack = shouldInvokeTrack
+ }, {
+ _shouldInvokeTrack: true, initialize: function initialize() {
+ if (this._shouldInvokeTrack)
+ this._invokedTrack = {
+ serviceId: this.media.serviceId, canonicalId: this.media.canonicalId, libraryId: this.media.libraryId
+ };
+ MS.Entertainment.Components.InlineDetails.assert(this.media, "Invalid MediaItem passed into MusicTrackAlbumInlineDetails");
+ this.media = this.media || {};
+ if (this.originalLocation === MS.Entertainment.Data.ItemLocation.collection) {
+ var albumIdPromise;
+ if (this.media.album)
+ albumIdPromise = MS.Entertainment.ViewModels.MediaItemModel.getLibraryIdAsync(this.media.album);
+ else if (MS.Entertainment.Utilities.isValidLibraryId(this.media.albumId))
+ albumIdPromise = WinJS.Promise.as(this.media.albumId);
+ else {
+ MS.Entertainment.Components.InlineDetails.fail("Invalid Media Item passed into MusicTrackAlbumInlineDetails");
+ albumIdPromise = WinJS.Promise.as(-1)
+ }
+ albumIdPromise.then(function gotLibraryId(albumLibraryId) {
+ var query;
+ var queryExecutePromise;
+ if (MS.Entertainment.Utilities.isValidLibraryId(albumLibraryId)) {
+ query = new MS.Entertainment.Data.Query.libraryAlbums;
+ query.albumId = albumLibraryId
+ }
+ else if (this.media.album && this.media.album.hasServiceId) {
+ query = new MS.Entertainment.Data.Query.Music.AlbumDetails;
+ query.id = this.media.album.serviceId;
+ query.idType = this.media.album.serviceIdType;
+ this.originalLocation = MS.Entertainment.Data.ItemLocation.marketplace
+ }
+ queryExecutePromise = query ? query.execute() : WinJS.Promise.wrapError("Not enough info to create a valid query");
+ return queryExecutePromise
+ }.bind(this)).done(function queryCompleted(query) {
+ if (query.result.primaryAlbum)
+ this.media = query.result.primaryAlbum;
+ else if (query.result.item)
+ this.media = query.result.item;
+ MS.Entertainment.Pages.MusicAlbumInlineDetails.prototype.initialize.apply(this)
+ }.bind(this), function queryFailed(error) {
+ MS.Entertainment.Components.InlineDetails.fail("Query failed to get library album details. Error message: " + (error && error.message));
+ MS.Entertainment.Pages.MusicAlbumInlineDetails.prototype.initialize.apply(this)
+ }.bind(this))
+ }
+ else {
+ this.media = this.media.album;
+ MS.Entertainment.Pages.MusicAlbumInlineDetails.prototype.initialize.apply(this)
+ }
+ }
+ }, {}, {
+ artSize: {get: function() {
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ return {
+ width: 215, height: 215
+ };
+ else
+ return {
+ width: 532, height: 532
+ }
+ }}, detailsOptions: {get: function() {
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ return null;
+ else
+ return {
+ includeLabel: false, includeExplicit: true
+ }
+ }}
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/MusicArtistInlineDetails.html b/packages/microsoft.zunevideo/Components/InlineDetails/MusicArtistInlineDetails.html
new file mode 100644
index 00000000..72d1ccee
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/MusicArtistInlineDetails.html
@@ -0,0 +1,212 @@
+
+
+
+
+ Music Artist Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/MusicArtistInlineDetails.js b/packages/microsoft.zunevideo/Components/InlineDetails/MusicArtistInlineDetails.js
new file mode 100644
index 00000000..7fcd5f93
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/MusicArtistInlineDetails.js
@@ -0,0 +1,444 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Pages");
+ WinJS.Namespace.define("MS.Entertainment.Pages", {
+ MusicArtistInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", "Components/InlineDetails/MusicArtistInlineDetails.html#musicArtistInlineDetailsTemplate", function musicArtistInlineDetails(element, options){}, {
+ tracks: null, albums: null, _songCount: -1, _albumIndex: -1, _queryResults: null, _queryDisposer: null, _buttonEventHandlers: null, _initializingLists: false, _initializedLists: false, _notificationsSender: null, _detailBindings: null, _disableActionsOnListSelection: true, _enableCurrentButtonsBinding: true, _signedInUser: null, _signInBindings: null, isCollection: {get: function() {
+ return this.originalLocation === MS.Entertainment.Data.ItemLocation.collection
+ }}, initialize: function initialize() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this, arguments);
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("artist")
+ });
+ this._buttonEventHandlers = MS.Entertainment.Utilities.addEvents(this.domElement, {iconButtonClicked: function processIconButtonClicked(event) {
+ var id = event && event.id;
+ if (id === MS.Entertainment.UI.Actions.AddTo.subMenuIds.addToMyMusic || id === MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionAddToMyMusic) {
+ MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this.media);
+ MS.Entertainment.ViewModels.MediaItemModel.hydrateListLibraryInfoAsync(this.media && this.media.tracks)
+ }
+ event.stopPropagation()
+ }.bind(this)});
+ if (this.media.mediaType !== Microsoft.Entertainment.Queries.ObjectType.person && this.media.artist)
+ this.media = this.media.artist;
+ this.media = MS.Entertainment.ViewModels.MediaItemModel.augment(this.media);
+ this._showPanel(true);
+ this.showListLoadingControl();
+ this._queryDisposer = new MS.Entertainment.Data.Disposer
+ }, _shouldShowErrorPanel: function _shouldShowErrorPanel() {
+ return this.media && !this.media.fromCollection && !this.blockErrorPanel && !this.isFailed
+ }, _onPrimaryItemInvoked: function _onPrimaryItemInvoked(event) {
+ if (!event || !event.detail || !event.detail.itemPromise)
+ return;
+ event.detail.itemPromise.done(function gotItem(item) {
+ if (!item || !item.data) {
+ MS.Entertainment.Pages.fail("In valid arugments. The item or item.data was null");
+ return
+ }
+ if (!item.isHeader) {
+ this._albumIndex = item.index;
+ this._setMedia(item.data)
+ }
+ else
+ this._albumIndex = -1
+ }.bind(this), function handleError(error) {
+ MS.Entertainment.Pages.fail("Failed to get primary item data in artist popover. Error: " + (error && error.message))
+ })
+ }, _onSecondaryItemInvoked: function _onSecondaryItemInvoked(event) {
+ if (!event || !event.detail || !event.detail.itemPromise)
+ return;
+ event.detail.itemPromise.then(function getItemData(data) {
+ if (data.data && data.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && !data.data.rights) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(data.data);
+ data.data.hydrate()
+ }
+ }.bind(this), function handleError(error) {
+ MS.Entertainment.Pages.fail("Failed to get secondary item data in artist popover. Error: " + (error && error.message))
+ });
+ event.stopPropagation()
+ }, _onBackButtonClicked: function _onBackButtonClicked() {
+ this._setMedia(this.artist)
+ }, _onClearedFilters: function _onClearedFilters() {
+ this.albums = null;
+ this._queryDisposer.disposeOnly("albumsQuery");
+ this._queryDisposer.disposeOnly("tracksQuery");
+ this._setMedia(this.media)
+ }, _setupSmartBuy: function _setupSmartBuy(media) {
+ if (this.smartBuyStateEngine) {
+ var buttons;
+ var stateUpdateHandler;
+ var isAlbum = media && media.mediaType === Microsoft.Entertainment.Queries.ObjectType.album;
+ if (isAlbum) {
+ stateUpdateHandler = MS.Entertainment.ViewModels.MusicStateHandlers.onAlbumPopoverStateChanged;
+ buttons = MS.Entertainment.ViewModels.SmartBuyButtons.getAlbumInlineDetailsButtons(media, MS.Entertainment.UI.Actions.ExecutionLocation.popover)
+ }
+ else {
+ buttons = MS.Entertainment.ViewModels.SmartBuyButtons.getArtistInlineDetailsButtons(media, MS.Entertainment.UI.Actions.ExecutionLocation.popover);
+ stateUpdateHandler = !this.isCollection ? function onMarketplaceArtistDetailsChanged(stateInfo) {
+ return MS.Entertainment.ViewModels.MusicStateHandlers.onMarketplaceArtistPopoverStateChanged.apply(this.smartBuyStateEngine, [stateInfo, this.tracks])
+ }.bind(this) : MS.Entertainment.ViewModels.MusicStateHandlers.onLocalArtistPopoverStateChanged
+ }
+ this.smartBuyStateEngine.initialize(media, buttons, stateUpdateHandler)
+ }
+ }, unload: function unload() {
+ if (this._buttonEventHandlers) {
+ this._buttonEventHandlers.cancel();
+ this._buttonEventHandlers = null
+ }
+ if (this._queryDisposer) {
+ this._queryDisposer.dispose();
+ this._queryDisposer = null
+ }
+ if (this._detailBindings) {
+ this._detailBindings.cancel();
+ this._detailBindings = null
+ }
+ if (this._signInBindings) {
+ this._signInBindings.cancel();
+ this._signInBindings = null
+ }
+ this._unregisterFileTransferListener();
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }, _setMedia: function _setMedia(media) {
+ this.activeMedia = media = media || this.artist;
+ var useMedia = this.activeMedia;
+ var loadContentPromise;
+ if (media && media.isTopSongs) {
+ useMedia = this.artist;
+ this._secondaryList.itemTemplate = "Components/InlineDetails/MusicArtistInlineDetails.html#musicInlineDetailsTrack"
+ }
+ else
+ this._secondaryList.itemTemplate = "Components/InlineDetails/MusicAlbumInlineDetails.html#musicInlineDetailsTrack";
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._setMedia.call(this, useMedia);
+ this._beginPageChange();
+ this._secondaryList.dataSource = null;
+ this._actionsPanel.buttons = [];
+ if (media && media.mediaType === Microsoft.Entertainment.Queries.ObjectType.album) {
+ this.album = media;
+ this.album.location = this.originalLocation;
+ this._formatAlbumDetailString();
+ WinJS.Utilities.addClass(this._primaryPanel, "popOverSecondPage");
+ this._showElement(this._containerTitle.domElement, false);
+ this._showElement(this._primaryListPanel, false);
+ this._showElement(this._secondaryListPanel, false);
+ loadContentPromise = this._loadAlbumTracks(media);
+ this._secondaryList.mediaContext.containingMedia = {
+ playbackItemSource: useMedia, playbackOffset: 0
+ }
+ }
+ else {
+ this.artist = media;
+ this._formatArtistDetailString();
+ WinJS.Utilities.removeClass(this._primaryPanel, "popOverSecondPage");
+ this._showElement(this._containerTitle.domElement, this.isCollection);
+ this._showElement(this._primaryListPanel, false);
+ this._showElement(this._secondaryListPanel, false);
+ loadContentPromise = this._loadAlbums(media);
+ if (this._albumIndex >= 0)
+ this._list.ensureVisible(this._albumIndex);
+ this._secondaryList.mediaContext.containingMedia = {
+ playbackItemSource: null, playbackOffset: 0
+ }
+ }
+ loadContentPromise.done(function addSubscriptionUpsell() {
+ if (!this._signedInUser)
+ this._signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (this._signedInUser && !this._signedInUser.isSubscription)
+ this._signInBindings = WinJS.Binding.bind(this._signedInUser, {isSubscription: this._updateSubscriptionLinkVisibility.bind(this)})
+ }.bind(this));
+ MS.Entertainment.UI.FileTransferService.pulseAsync(useMedia);
+ this._initializeListsOnce();
+ this._setupSmartBuy(useMedia);
+ this._endPageChange()
+ }, _initializeListsOnce: function intializeListsOnce() {
+ if (this._initializingLists)
+ return;
+ this._initializingLists = true;
+ WinJS.Promise.timeout().then(function() {
+ if (!this.smartBuyStateEngine || this._unloaded)
+ return;
+ this._initializedLists = true;
+ if (!this.isCollection) {
+ WinJS.Utilities.addClass(this._list.domElement, "marketplaceAlbums");
+ WinJS.Utilities.addClass(this._secondaryList.domElement, "marketplaceTracks");
+ this._list.grouper = new MS.Entertainment.Pages.ArtistPopoverAlbumGrouper(true)
+ }
+ else {
+ WinJS.Utilities.addClass(this._list.domElement, "collectionAlbums");
+ WinJS.Utilities.addClass(this._secondaryList.domElement, "collectionTracks");
+ this._containerTitle.stringId = String.id.IDS_MUSIC_ALBUMS_IN_COLLECTION
+ }
+ var hydrateIfPossible = function hydrateIfPossible(hasServiceId) {
+ this._hydrateMediaIfPossible()
+ }.bind(this);
+ var binding = WinJS.Binding.bind(this.artist, {hasServiceId: hydrateIfPossible});
+ this.mediaBindings.push(binding);
+ this._loadAlbums(this.artist).done()
+ }.bind(this))
+ }, _buttonChangedHandler: function _buttonChangedHandler() {
+ if (this.activeMedia && this.activeMedia.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ this._displayAlbumTracksList(this.tracks);
+ else
+ this._displayArtistAlbumList(this.albums)
+ }, _loadAlbums: function _loadAlbums(artist) {
+ if (!this._initializedLists || !artist || this._unloaded)
+ return WinJS.Promise.as();
+ var query = this._queryDisposer.albumsQuery;
+ var hydratePromise;
+ if (this.albums) {
+ this._displayArtistAlbumList(this.albums);
+ return WinJS.Promise.as()
+ }
+ else {
+ query = query || this.isCollection ? new MS.Entertainment.Data.Query.libraryAlbums : new MS.Entertainment.Data.Query.Music.ArtistAlbums;
+ this._queryDisposer.albumsQuery = query;
+ if (this.isCollection) {
+ query.artistId = artist.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.AlbumsSortBy.titleAscending;
+ query.mediaAvailability = this.collectionFilter;
+ query.isLive = true
+ }
+ else {
+ if (!artist.hasCanonicalId)
+ hydratePromise = artist.hydrate();
+ hydratePromise = WinJS.Promise.as(hydratePromise).then(function setCanonicalId() {
+ if (!artist.hasCanonicalId || artist.isFailed)
+ return WinJS.Promise.wrapError(new Error("Artist doesn't have a canonical id or hydrate failed"));
+ else
+ query.id = artist.canonicalId
+ })
+ }
+ return WinJS.Promise.as(hydratePromise).then(function executeQuery() {
+ if (this._unloaded)
+ return;
+ query = this._addContentNotifications(query, artist);
+ return query.getItemsAndIgnoreErrors()
+ }.bind(this)).then(function insertTopSongsItem(albums) {
+ if (this._unloaded)
+ return;
+ if (!albums)
+ albums = new MS.Entertainment.Data.VirtualList(null, []);
+ return MS.Entertainment.Utilities.redirectPromise(this._insertTopSongsItems(albums), albums)
+ }.bind(this)).then(function setAlbums(albums) {
+ if (this._unloaded)
+ return;
+ this.albums = albums;
+ if (this._loadedButtons)
+ this._displayArtistAlbumList(albums)
+ }.bind(this), function handleError() {
+ if (this._unloaded)
+ return;
+ if (!this._isOnline)
+ this._handleError();
+ else
+ this._showEmptyArtistPanel()
+ }.bind(this))
+ }
+ }, _showEmptyArtistPanel: function _showEmptyArtistPanel() {
+ WinJS.Utilities.removeClass(this.emptyContainer, "removeFromDisplay");
+ this.hideListLoadingControl();
+ this.tracks = [];
+ this.smartBuyStateEngine.updateState()
+ }, _loadAlbumTracks: function _loadAlbumTracks(album) {
+ if (!this._initializedLists || !album)
+ return WinJS.Promise.as();
+ var hydratingPromise;
+ if (this.isCollection)
+ album.tracks = null;
+ else if (album.hydrate)
+ hydratingPromise = album.hydrate();
+ return WinJS.Promise.as(hydratingPromise).then(function hydratingDone() {
+ if (this._unloaded)
+ return;
+ return album.tracks || this._getAlbumTracksQuery(album).getItemsAndIgnoreErrors()
+ }.bind(this)).then(function setAlbumTrack(tracks) {
+ if (this._unloaded)
+ return;
+ album.tracks = tracks || album.tracks;
+ this.tracks = tracks;
+ if (this._loadedButtons)
+ this._displayAlbumTracksList(tracks)
+ }.bind(this))
+ }, _updateSubscriptionLinkVisibility: function _updateSubscriptionLinkVisibility() {
+ if (this._subscriptionLink && this._subscriptionLink.action && this._subscriptionLink.action.canExecute() && this.media && (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.album))
+ MS.Entertainment.ViewModels.MusicSmartBuyStateHandlers.getAlbumRights(this.media).then(function getAlbumRights_complete(rights) {
+ this.showSignupLink = (rights.subscriptionStream || rights.subscriptionDownload);
+ if (this.showSignupLink)
+ this._subscriptionLink.action.parameter = MS.Entertainment.Music.Freeplay.Events.musicPassUpsellAlbumPopoverLinkInvoked
+ }.bind(this));
+ else
+ this.showSignupLink = false
+ }, _insertTopSongsItems: function _insertTopSongsItems(albums) {
+ var insertPromise;
+ if (albums && !this.isCollection) {
+ var topSongsAlbum = new MS.Entertainment.Data.Augmenter.Marketplace.EDSTopSongsAlbum;
+ topSongsAlbum.artist = this.artist;
+ insertPromise = albums.insertAt(0, new MS.Entertainment.Data.Factory.ListNoHeaderItemWrapper(topSongsAlbum))
+ }
+ return WinJS.Promise.as(insertPromise)
+ }, _getAlbumTracksQuery: function _getAlbumTracksQuery(album) {
+ var query = this._queryDisposer.tracksQuery || this.isCollection ? new MS.Entertainment.Data.Query.libraryTracks : new MS.Entertainment.Data.Query.Music.AlbumSongs;
+ this._queryDisposer.tracksQuery = query;
+ if (this.isCollection) {
+ query.albumId = album.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.TracksSortBy.albumReleaseYearDescendingNumberAscending;
+ query.mediaAvailability = this.collectionFilter;
+ query.isLive = true;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.album, MS.Entertainment.Utilities.isValidServiceId(album.canonicalId) ? album.canonicalId : String.empty)
+ }
+ else {
+ query.id = album.canonicalId;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.album, MS.Entertainment.Utilities.isValidServiceId(album.canonicalId) ? album.canonicalId : String.empty)
+ }
+ return this._addContentNotifications(query)
+ }, _beginPageChange: function _beginPageChange() {
+ MS.Entertainment.Utilities.hideElement(this._primaryPanel)
+ }, _displayArtistAlbumList: function _displayArtistAlbumList(items) {
+ if (this._unloaded)
+ return;
+ this.hideListLoadingControl();
+ this._showElement(this._primaryListPanel, items && items.count > 0);
+ this._showElement(this._containerTitle, items && items.count > 0);
+ if (this._list) {
+ if (!this._list.dataSource)
+ this._updateArtistCounts();
+ this._list.dataSource = items
+ }
+ if (items && this.collectionFilter && this.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available) {
+ var unfilteredQuery = new MS.Entertainment.Data.Query.libraryAlbums;
+ unfilteredQuery.artistId = this.media.libraryId;
+ unfilteredQuery.executeCount().done(function unfilteredQueryComplete(unfilteredAlbumCount) {
+ if (unfilteredAlbumCount > items.count)
+ this._showCollectionFilter()
+ }.bind(this), function unfilteredQueryError() {
+ this._showCollectionFilter()
+ }.bind(this))
+ }
+ }, _displayAlbumTracksList: function _displayAlbumTracksList(items) {
+ if (this._unloaded)
+ return;
+ this.hideListLoadingControl();
+ this._showElement(this._secondaryListPanel, items && items.count > 0);
+ this._showElement(this._containerTitle, items && items.count > 0);
+ this._secondaryList.dataSource = items;
+ if (items && this.collectionFilter && this.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available) {
+ var unfilteredQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ unfilteredQuery.albumId = this.media.libraryId;
+ unfilteredQuery.executeCount().done(function unfilteredQueryComplete(unfilteredTrackCount) {
+ if (unfilteredTrackCount > items.count)
+ this._showCollectionFilter()
+ }.bind(this), function unfilteredQueryError() {
+ this._showCollectionFilter()
+ }.bind(this))
+ }
+ }, _endPageChange: function _endPageChange() {
+ MS.Entertainment.Utilities.showElement(this._primaryPanel)
+ }, _updateArtistCounts: function _updateArtistCounts() {
+ if (this.artist && this.artist.inCollection) {
+ var localArtistQuery = new MS.Entertainment.Data.Query.libraryArtists;
+ localArtistQuery.personId = this.artist.libraryId;
+ localArtistQuery.mediaAvailability = this.collectionFilter;
+ localArtistQuery.execute().done(function(query) {
+ this.artist.totalTracksCount = query.result.totalTracksCount;
+ this.artist.totalAlbumsCount = query.result.totalAlbumsCount
+ }.bind(this))
+ }
+ }, _formatAlbumDetailString: function _formatAlbumDetailString() {
+ if (this._detailBindings) {
+ this._detailBindings.cancel();
+ this._detailBindings = null
+ }
+ var bindingsComplete = false;
+ var formatAlbumDetailString = function formatAlbumDetailString() {
+ if (bindingsComplete && this.media === this.album)
+ this.detailString = MS.Entertainment.Data.Factory.createAlbumDetailString(this.album)
+ }.bind(this);
+ this._detailBindings = WinJS.Binding.bind(this.album, {
+ artistName: formatAlbumDetailString, releaseDate: formatAlbumDetailString, primaryGenre: formatAlbumDetailString, genreName: formatAlbumDetailString, label: formatAlbumDetailString
+ });
+ bindingsComplete = true;
+ formatAlbumDetailString()
+ }, _formatArtistDetailString: function _formatArtistDetailString() {
+ if (this._detailBindings) {
+ this._detailBindings.cancel();
+ this._detailBindings = null
+ }
+ var bindingsComplete = false;
+ var formatArtistDetailString = function formatArtistDetailString() {
+ if (bindingsComplete && this.media === this.artist)
+ this.detailString = MS.Entertainment.Data.Factory.createArtistDetailString(this.artist, this.isCollection)
+ }.bind(this);
+ this._detailBindings = WinJS.Binding.bind(this.artist, {
+ inCollection: formatArtistDetailString, detailString: formatArtistDetailString, totalAlbumsCount: formatArtistDetailString, totalTracksCount: formatArtistDetailString, primaryGenre: formatArtistDetailString
+ });
+ bindingsComplete = true;
+ formatArtistDetailString()
+ }, _addContentNotifications: function _addContentNotifications(query, sourceMedia) {
+ if (query) {
+ var propertyKey = this.isCollection ? "libraryId" : "serviceId";
+ var notifications = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.FileTransferService.keyFromProperty(propertyKey, false, true));
+ notifications.modifyQuery(query);
+ if (sourceMedia && sourceMedia.mediaType === Microsoft.Entertainment.Queries.ObjectType.person) {
+ this._notificationsSender = notifications.createSender();
+ this._fileTransferListenerId = "MusicArtistInlineDetails_" + MS.Entertainment.Utilities.getSessionUniqueInteger();
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ var taskKeyGetter;
+ if (this.isCollection)
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("albumLibraryId");
+ else
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("albumMediaId", false, true);
+ fileTransferService.registerListener(this._fileTransferListenerId, taskKeyGetter, this._notificationsSender, MS.Entertainment.UI.FileTransferNotifiers.trackCollection)
+ }
+ }
+ return query
+ }, _unregisterFileTransferListener: function _unregisterFileTransferListener() {
+ if (this._fileTransferListenerId) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.unregisterListener(this._fileTransferListenerId)
+ }
+ this._notificationsSender = null
+ }
+ }, {
+ artist: null, album: null, activeMedia: null, showSignupLink: false
+ }), ArtistPopoverAlbumGrouper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryGrouper", function ArtistPopoverAlbumGrouper(isMarketplace) {
+ this.isMarketplace = isMarketplace || false;
+ this.keyPropertyName = "mediaType"
+ }, {
+ isMarketplace: false, useKeyAsData: false, createData: function createData(item) {
+ var title;
+ if (item && item.data && !item.data.isTopSongs && item.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ title = String.load(this.isMarketplace ? String.id.IDS_DETAILS_RECENT_ALBUMS : String.id.IDS_MUSIC_ALBUMS_IN_COLLECTION);
+ else
+ title = String.load(this.isMarketplace ? String.id.IDS_DETAILS_TOP_SONGS : String.id.IDS_MUSIC_SONGS_IN_COLLECTION);
+ return {title: title}
+ }
+ }), ArtistPopoverTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryTemplateSelector", function galleryTemplateSelector() {
+ MS.Entertainment.UI.Controls.TemplateSelectorBase.prototype.constructor.call(this);
+ this.topSongsAlbumTemplate = "Components/Music/MusicSharedTemplates.html#verticalTopSongsAlbumTemplate"
+ }, {
+ topSongsAlbumTemplate: {
+ get: function() {
+ return this.getTemplate(MS.Entertainment.Pages.ArtistPopoverTemplateSelector.templateType.topSongsAlbum)
+ }, set: function(value) {
+ this.addTemplate(MS.Entertainment.Pages.ArtistPopoverTemplateSelector.templateType.topSongsAlbum, value)
+ }
+ }, onSelectTemplate: function onSelectTemplate(item) {
+ if (item.data && item.data.isTopSongs)
+ return this.getTemplateProvider(MS.Entertainment.Pages.ArtistPopoverTemplateSelector.templateType.topSongsAlbum);
+ else
+ return MS.Entertainment.UI.Controls.GalleryTemplateSelector.prototype.onSelectTemplate.apply(this, arguments)
+ }
+ }, {templateType: {topSongsAlbum: "topSongsAlbum"}}), ArtistTracksDataNotificationHandler: MS.Entertainment.UI.Framework.define(function artistTracksDataNotificationHandler(updateCallback) {
+ this._updateCallback = updateCallback
+ }, {
+ _updateCallback: null, dispose: function dispose() {
+ this._updateCallback = null
+ }, inserted: function inserted(item, previousKey, nextKey, index) {
+ this._updateCallback(index)
+ }, changed: function changed(newItem, oldItem){}, moved: function moved(item, previousKey, nextKey, oldIndex, newIndex){}, removed: function removed(key, index) {
+ this._updateCallback(index, key)
+ }, countChanged: function countChanged(newCount, oldCount){}
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/MusicPlaylistInlineDetails.html b/packages/microsoft.zunevideo/Components/InlineDetails/MusicPlaylistInlineDetails.html
new file mode 100644
index 00000000..be6b36c6
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/MusicPlaylistInlineDetails.html
@@ -0,0 +1,271 @@
+
+
+
+
+ Music Playlist Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/MusicPlaylistInlineDetails.js b/packages/microsoft.zunevideo/Components/InlineDetails/MusicPlaylistInlineDetails.js
new file mode 100644
index 00000000..b3f5f7c6
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/MusicPlaylistInlineDetails.js
@@ -0,0 +1,401 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Pages");
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MusicPlaylistInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", null, function musicPlaylistInlineDetails(element, options) {
+ this.templateStorage = "/Components/InlineDetails/MusicPlaylistInlineDetails.html";
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ this.templateName = "musicPlaylistInlineDetailsTemplate";
+ else
+ this.templateName = "music2PlaylistInlineDetailsTemplate";
+ this.moveUpAction = new MS.Entertainment.UI.Actions.Playlists.MoveTrackUpAction;
+ this.moveDownAction = new MS.Entertainment.UI.Actions.Playlists.MoveTrackDownAction;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this.playlistSize = {
+ width: 532, height: 532
+ };
+ this._supportsReorder = false
+ }
+ }, {
+ playlistSize: {
+ width: 215, height: 215
+ }, tracks: null, _songCount: 0, _queryResults: null, _lastInvokedIndex: -1, _currentMoveUpButton: null, _currentMoveDownButton: null, eventHandlers: null, _playlistQuery: null, _disableActionsOnListSelection: true, _browseAlbumsButtonFocused: false, _enableCurrentButtonsBinding: true, _currentFilterZeroSongs: false, _localTrackQuery: null, _supportsReorder: true, _updateImmediately: false, _smartBuyStateEngineBindings: null, initialize: function initialize() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this, arguments);
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._list.ensureNextItemVisibleCount = 2;
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("playlist")
+ });
+ this.moveUpAction.playlist = this.media;
+ this.moveDownAction.playlist = this.media;
+ this.moveUpAction.bind("isEnabled", this._onMoveUpEnabled.bind(this));
+ this.moveDownAction.bind("isEnabled", this._onMoveDownEnabled.bind(this));
+ MS.Entertainment.UI.assert(this.originalLocation === MS.Entertainment.Data.ItemLocation.collection, "playlists not supported in marketplace view");
+ MS.Entertainment.UI.assert(this.media.inCollection, "media item in collection view is not in collection");
+ this._showPanel(true);
+ this._setupSmartBuy();
+ var removeItemCallback = this._removeItem.bind(this);
+ this._list.invocationHelper.addInvocationHandlers({removeFromPlaylist: removeItemCallback});
+ WinJS.Promise.timeout().then(function() {
+ if (!this.smartBuyStateEngine)
+ return;
+ this._loadLocalTracks()
+ }.bind(this));
+ this._formatDetailString();
+ this._formatPlaylistName();
+ this._formatPlaylistDuration();
+ this._formatPlaylistSubtitle();
+ this._setupPlaylistChangedListener();
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ this._list.addSelectionHandlers({removeFromPlaylist: removeItemCallback});
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.domElement, {iteminvoked: this._itemInvoked.bind(this)});
+ this._shareModel()
+ }
+ else
+ this._updateImmediately = true
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ if (this._playlistQuery && this._playlistQuery.pause)
+ this._playlistQuery.pause()
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._playlistQuery && this._playlistQuery.unpause)
+ this._playlistQuery.unpause();
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this._loadLocalTracks();
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._actionColumn)
+ }
+ }, _setupPlaylistChangedListener: function _setupPlaylistChangedListener() {
+ this._playlistQuery = new MS.Entertainment.Data.Query.libraryPlaylists;
+ this._playlistQuery.isLive = true;
+ this._playlistQuery.playlistId = this.media.libraryId;
+ this._playlistQuery.execute().done(function getResults(results) {
+ var recentResults = results;
+ recentResults.result.items.setNotificationHandler(new MS.Entertainment.UI.Actions.Playlists.playlistDataNotificationHandler(null, this._handleRecentPlaylistDataNotifications.bind(this)))
+ }.bind(this), function onError(){})
+ }, _handleRecentPlaylistDataNotifications: function _handleRecentPlaylistDataNotifications(newItems, oldItems) {
+ var currentIndex = newItems.length ? newItems.length - 1 : -1;
+ var newItem = currentIndex >= 0 ? newItems[currentIndex] : null;
+ while (currentIndex > 0 && newItem && newItem.data.libraryId !== this.media.libraryId) {
+ currentIndex--;
+ newItem = newItems[currentIndex]
+ }
+ {};
+ if (!newItem || newItem.data.libraryId !== this.media.libraryId)
+ return;
+ MS.Entertainment.Utilities.copyAugmentedProperties(newItem.data, this.media);
+ this.media.tracks = this.tracks;
+ var countPromise = WinJS.Promise.wrap(newItem.data.count);
+ if (this._list.dataSource && MS.Entertainment.Utilities.isMusicApp1)
+ countPromise = this._list.dataSource.getCount();
+ countPromise.done(function updateCount(count) {
+ if (count === 0 && this.media.count) {
+ count = this.media.count;
+ this._showTracks(true)
+ }
+ if (this._songCount !== count)
+ this.smartBuyStateEngine.updateState();
+ this._songCount = count;
+ this._formatDetailString(this._songCount);
+ this._formatPlaylistName();
+ this._formatPlaylistDuration();
+ this.playlistDuration = newItem.data.duration ? MS.Entertainment.Utilities.formatTimeString(newItem.data.duration) : String.empty;
+ if (this._songCount === 0)
+ this._showTracks(false)
+ }.bind(this), function handlerError(error) {
+ MS.Entertainment.Pages.fail("Failed to get count. Error message: " + error && error.message)
+ })
+ }, _handleActionsReady: function _handleActionsReady(event) {
+ if (MS.Entertainment.Utilities.isMusicApp2 && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).overlayVisible && MS.Entertainment.UI.Framework.canMoveFocus(event.srcElement) && this._songCount)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(event.srcElement)
+ }, _setupSmartBuy: function _setupSmartBuy() {
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getPlaylistInlineDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.popover), function onPlaylistPopoverStateChanged(stateInfo) {
+ if (stateInfo && this.originalLocation !== MS.Entertainment.Data.ItemLocation.collection || (!this.media.inCollection && !stateInfo.canPlay) || this.media.count <= 0)
+ this._showTracks(false);
+ var buttons;
+ if (this.smartBuyStateEngine)
+ buttons = MS.Entertainment.ViewModels.MusicStateHandlers.onPlaylistPopoverStateChanged.call(this.smartBuyStateEngine, stateInfo);
+ else
+ buttons = WinJS.Promise.wrap([]);
+ return buttons
+ }.bind(this), {updateImmediately: this._updateImmediately});
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._smartBuyStateEngineBindings = WinJS.Binding.bind(this.smartBuyStateEngine, {currentButtons: function updateButtons(newValue) {
+ if (newValue && newValue.length) {
+ this.actionButtons = new MS.Entertainment.ObservableArray(newValue).bindableItems;
+ if (!this.domElement.contains(document.activeElement))
+ WinJS.Promise.timeout(50).done(function setFocus() {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._actionColumn)
+ }.bind(this))
+ }
+ }.bind(this)})
+ }
+ }, unload: function unload() {
+ if (this._eventHandlers)
+ this._eventHandlers.cancel();
+ if (this._playlistQuery) {
+ this._playlistQuery.dispose();
+ this._playlistQuery = null
+ }
+ if (this._localTrackQuery) {
+ this._localTrackQuery.dispose();
+ this._localTrackQuery = null
+ }
+ if (this._smartBuyStateEngineBindings) {
+ this._smartBuyStateEngineBindings.cancel();
+ this._smartBuyStateEngineBindings = null
+ }
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }, _buttonChangedHandler: function _buttonChangedHandler() {
+ this._setTrackDataSource()
+ }, _setTrackDataSource: function _setTrackDataSource() {
+ this._list.dataSource = this.tracks;
+ this._showTracks(this._songCount > 0)
+ }, _itemInvoked: function _itemInvoked(event) {
+ event.detail.itemPromise.then(function getItemData(data) {
+ if (this._lastInvokedIndex !== data.index || event.detail.rerender) {
+ this._updateParameters(data.data.playlistItemId, data.index);
+ var trackDomElement = this._list.getElementAtIndex(data.index);
+ var buttonContainer = trackDomElement.querySelector(".inlineDetailsMoveTrackUpButton");
+ var moveUpControl = buttonContainer ? buttonContainer.winControl : null;
+ MS.Entertainment.UI.assert(moveUpControl, "the move track up button is missing");
+ if (moveUpControl) {
+ this._currentMoveUpButton = moveUpControl;
+ this._setControlOptions(moveUpControl, this.moveUpAction)
+ }
+ buttonContainer = trackDomElement.querySelector(".inlineDetailsMoveTrackDownButton");
+ var moveDownControl = buttonContainer ? buttonContainer.winControl : null;
+ MS.Entertainment.UI.assert(moveDownControl, "the move track down button is missing");
+ if (moveDownControl) {
+ this._currentMoveDownButton = moveDownControl;
+ this._setControlOptions(moveDownControl, this.moveDownAction)
+ }
+ this._lastInvokedIndex = data.index
+ }
+ else {
+ this._currentMoveUpButton = null;
+ this._currentMoveDownButton = null;
+ this._lastInvokedIndex = -1
+ }
+ }.bind(this));
+ event.stopPropagation()
+ }, _updateParameters: function _updateParameters(playlistItemId, index) {
+ var parameter = {
+ playlistContentId: playlistItemId, index: index, postExecute: this._swapItems.bind(this)
+ };
+ this.moveUpAction.parameter = parameter;
+ this.moveDownAction.parameter = parameter
+ }, _onMoveUpEnabled: function _onMoveUpEnabled(enabled) {
+ if (this._currentMoveUpButton)
+ this._currentMoveUpButton.isDisabled = !enabled
+ }, _onMoveDownEnabled: function _onMoveDownEnabled(enabled) {
+ if (this._currentMoveDownButton)
+ this._currentMoveDownButton.isDisabled = !enabled
+ }, _onFocusIn: function _onFocusIn() {
+ WinJS.Utilities.addClass(this._list.domElement, "focused")
+ }, _onFocusOut: function _onFocusOut() {
+ WinJS.Utilities.removeClass(this._list.domElement, "focused")
+ }, _setControlOptions: function _setControlOptions(control, action) {
+ if (control) {
+ control.action = action;
+ control.text = action.title;
+ control.icon = action.iconInfo.icon;
+ control.isDisabled = !action.isEnabled;
+ control.tabIndex = action.tabIndex;
+ control.automationId = action.automationId
+ }
+ }, _swapItems: function _swapItems(index, insertBefore) {
+ var key = null;
+ if (this._list && this._list.dataSource)
+ key = this._list.dataSource.keyFromIndex(index);
+ MS.Entertainment.Pages.assert(!!key, "Key not found for index: " + index);
+ if (key) {
+ var insertIndex = insertBefore < this._songCount ? insertBefore : insertBefore - 1;
+ var nextKey = this._list.dataSource.keyFromIndex(insertIndex);
+ MS.Entertainment.Pages.assert(!!nextKey, "Key not found for index: " + insertIndex);
+ if (nextKey) {
+ if (insertBefore < this._songCount)
+ this._list.internalDataSource.moveBefore(key, nextKey);
+ else
+ this._list.internalDataSource.moveAfter(key, nextKey);
+ this._list.getFirstVisibleIndex().then(function updateIndex(firstIndex) {
+ if (insertBefore <= firstIndex) {
+ if (firstIndex > 0)
+ this._list.setFirstVisibleIndex(firstIndex - 1)
+ }
+ else
+ this._list.getLastVisibleIndex().then(function updateIndex(lastIndex) {
+ if (insertBefore > lastIndex - 1)
+ this._list.ensureVisible(insertBefore);
+ else
+ this._list.setFirstVisibleIndex(firstIndex)
+ }.bind(this))
+ }.bind(this));
+ var newIndex = insertBefore < index ? insertBefore : insertBefore - 1;
+ var oldParameter = this.moveUpAction.parameter;
+ this._updateParameters(oldParameter.playlistitemId, newIndex);
+ this._lastInvokedIndex = newIndex
+ }
+ }
+ }, _removeItem: function _removeItem(eventArgs) {
+ if (!this._supportsReorder) {
+ this._localTrackQuery.forceLiveRefresh();
+ this._playlistQuery.forceLiveRefresh();
+ return
+ }
+ var removedIndices = (eventArgs.detail && eventArgs.detail.removedIndices) || [];
+ var complete = eventArgs.detail && eventArgs.detail.complete;
+ var returnValues = eventArgs.detail && eventArgs.detail.returnValues;
+ if (complete) {
+ var removedItems = 0;
+ removedIndices.forEach(function removeItem(index) {
+ if (index === this._lastInvokedIndex)
+ this._lastInvokedIndex = -1;
+ this._list.dataSource.removeAt(index - removedItems);
+ removedItems++
+ }.bind(this));
+ this._list.clearSelection()
+ }
+ else {
+ if (returnValues)
+ returnValues.updatedIndex = this._lastInvokedIndex;
+ {};
+ return this._lastInvokedIndex
+ }
+ }, _resetReorderControl: function _resetReorderControl() {
+ if (this._lastInvokedIndex === -1)
+ return;
+ var trackDomElement = this._list.getElementAtIndex(this._lastInvokedIndex);
+ var invokedContainer = MS.Entertainment.Utilities.findParentElementByClassName(trackDomElement, "invoked");
+ if (invokedContainer)
+ WinJS.Utilities.removeClass(invokedContainer, "invoked");
+ this._lastInvokedIndex = -1
+ }, _selectedIndicesChanged: function _selectedIndicesChanged(newValue, oldValue) {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._selectedIndicesChanged.call(this, newValue, oldValue);
+ if (newValue.length > 0) {
+ this._resetReorderControl();
+ this._lastInvokedIndex = -1
+ }
+ }, _onClearedFilters: function _onClearedFilters() {
+ this._loadLocalTracks()
+ }, _loadLocalTracks: function loadLocalTracks() {
+ var query = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ query.playlistId = this.media.libraryId;
+ query.mediaAvailability = this.collectionFilter;
+ query.isLive = false;
+ if (!this._supportsReorder) {
+ query.isLive = true;
+ this._localTrackQuery = query
+ }
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.playlist, MS.Entertainment.Utilities.isValidServiceId(this.media.cloudSyncItemId) ? this.media.cloudSyncItemId : String.empty);
+ this._list.mediaContext.containingMedia = {
+ playbackItemSource: query.clone(), playbackOffset: 0
+ };
+ query.execute().then(function queryComplete(q) {
+ this._queryResults = q.result.items;
+ this._songCount = this._queryResults.count;
+ this._formatDetailString(this._songCount);
+ this.tracks = q.result.items;
+ this._currentFilterZeroSongs = false;
+ if (this._loadedButtons)
+ this._setTrackDataSource();
+ if (this._songCount > 0 || MS.Entertainment.Utilities.isMusicApp2)
+ this._subTitleText.removeAttribute("tabindex");
+ else
+ this._subTitleText.setAttribute("tabindex", 0);
+ if (this.collectionFilter && this.collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available) {
+ var unfilteredQuery = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ unfilteredQuery.playlistId = this.media.libraryId;
+ unfilteredQuery.executeCount().done(function unfilteredQueryComplete(unfilteredTrackCount) {
+ if (unfilteredTrackCount > this._songCount) {
+ this._showCollectionFilter();
+ if (this._songCount === 0) {
+ this._subTitleText.removeAttribute("tabindex");
+ this.detailString = String.empty;
+ this._currentFilterZeroSongs = true;
+ this._showTracks(false)
+ }
+ }
+ }.bind(this), function unfilteredQueryError() {
+ this._showCollectionFilter()
+ }.bind(this))
+ }
+ }.bind(this))
+ }, _formatDetailString: function _formatDetailString(count) {
+ if (count === null || count === undefined)
+ count = this.media.count;
+ var details;
+ var formattedCount;
+ if (count === 1)
+ details = String.load(String.id.IDS_DETAILS_PLAYLIST_SONG_COUNT);
+ else if (count > 1) {
+ formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(count);
+ details = String.load(String.id.IDS_DETAILS_PLAYLIST_SONGS_COUNT).format(formattedCount)
+ }
+ else if (MS.Entertainment.Utilities.isMusicApp1)
+ details = String.load(String.id.IDS_MUSIC_EMPTY_PLAYLIST);
+ else
+ details = String.load(String.id.IDS_MUSIC2_EMPTY_PLAYLIST);
+ this.detailString = details;
+ this._formatPlaylistSubtitle()
+ }, _formatPlaylistDuration: function _formatDurationString() {
+ this.playlistDuration = this.media.duration ? MS.Entertainment.Utilities.formatTimeString(this.media.duration) : String.empty
+ }, _formatPlaylistName: function _formatPlaylistName() {
+ this.playlistName = this.media.name || String.load(String.id.IDS_MUSIC_PLAYLIST_LABEL)
+ }, _formatPlaylistSubtitle: function _formatPlaylistSubtitle() {
+ if (this.playlistDuration)
+ this.playlistSubtitle = String.load(String.id.IDS_COMMA_SEPARATOR).format(this.detailString, this.playlistDuration);
+ else
+ this.playlistSubtitle = this.detailString
+ }, _showTracks: function _showTracks(show) {
+ if (show) {
+ this._showElement(this._tracksPanel, true);
+ this._showElement(this._emptyPanel, false)
+ }
+ else {
+ this._showElement(this._tracksPanel, false);
+ if (this._currentFilterZeroSongs) {
+ WinJS.Utilities.removeClass(this._currentFilterZeroSongsText, "removeFromDisplay");
+ WinJS.Utilities.addClass(this._browseLinks, "removeFromDisplay")
+ }
+ else {
+ WinJS.Utilities.addClass(this._currentFilterZeroSongsText, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._browseLinks, "removeFromDisplay");
+ if (!this._browseAlbumsButtonFocused)
+ WinJS.Promise.timeout(250).done(function setFocus() {
+ MS.Entertainment.UI.Framework.focusElement(this._browseAlbumsButton);
+ this._browseAlbumsButtonFocused = true;
+ this._focusOverriden = true
+ }.bind(this))
+ }
+ this._showElement(this._emptyPanel, true);
+ MS.Entertainment.Utilities.showElement(this._emptyPanel)
+ }
+ }, onBrowseAlbums: function onBrowseAlbums(event) {
+ this._sendTelemetryEvent("MusicPlaylistInlineDetails_BrowseAlbums");
+ this._makeActivePlaylist();
+ if (this._overlay && MS.Entertainment.Utilities.isMusicApp1)
+ this._overlay.hide();
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.musicCollection, MS.Entertainment.UI.Monikers.musicCollectionByAlbum, null, {
+ selectHub: true, disableSavingSelectedHub: true
+ })
+ }, onBrowseAllMusic: function onBrowseAllMusic(event) {
+ this._sendTelemetryEvent("MusicPlaylistInlineDetails_BrowseAllMusic");
+ this._makeActivePlaylist();
+ if (this._overlay && MS.Entertainment.Utilities.isMusicApp1)
+ this._overlay.hide();
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.musicMarketplace, MS.Entertainment.UI.Monikers.musicMarketplaceAlbums)
+ }, _sendTelemetryEvent: function _sendTelemetryEvent(event) {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(event)
+ }, _makeActivePlaylist: function _makeActivePlaylist() {
+ var playlistProvider = (new Microsoft.Entertainment.Platform.MediaStore).playlistProvider;
+ playlistProvider.setPlaylistDateEditedToNowAsync(this.media.libraryId)
+ }
+ }, {
+ moveUpAction: null, moveDownAction: null, playlistDuration: null, playlistName: null, playlistSubtitle: null, actionButtons: null
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/TvEpisodeInlineDetails.html b/packages/microsoft.zunevideo/Components/InlineDetails/TvEpisodeInlineDetails.html
new file mode 100644
index 00000000..b2e6f8e9
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/TvEpisodeInlineDetails.html
@@ -0,0 +1,62 @@
+
+
+
+
+ Music Albums Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/TvEpisodeInlineDetails.js b/packages/microsoft.zunevideo/Components/InlineDetails/TvEpisodeInlineDetails.js
new file mode 100644
index 00000000..15b100fd
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/TvEpisodeInlineDetails.js
@@ -0,0 +1,33 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {TvEpisodeInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", "/Components/InlineDetails/TvEpisodeInlineDetails.html#tvEpisodeInlineDetailsTemplate", function tvEpisodeInlineDetails(){}, {
+ initialize: function initialize() {
+ MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this.media).done(function libraryInfoHydrated() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this);
+ this._finalizeInitialize()
+ }.bind(this), function libraryInfoHydrateFailed(error) {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this);
+ this._finalizeInitialize()
+ }.bind(this))
+ }, _finalizeInitialize: function _finalizeInitialize() {
+ this.media = MS.Entertainment.ViewModels.MediaItemModel.augment(this.media);
+ this._showPanel(true);
+ WinJS.Promise.timeout().then(function() {
+ if (!this.smartBuyStateEngine)
+ return;
+ var hydrateIfPossible = function hydrateIfPossible(hasServiceId) {
+ if (hasServiceId)
+ this._hydrateMedia();
+ else
+ this._showPanel()
+ };
+ var binding = WinJS.Binding.bind(this.media, {hasServiceId: hydrateIfPossible.bind(this)});
+ this.mediaBindings.push(binding);
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.invokeInline), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoDetailsTwoButtonStateChanged)
+ }.bind(this))
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/TvSeriesInlineDetails.html b/packages/microsoft.zunevideo/Components/InlineDetails/TvSeriesInlineDetails.html
new file mode 100644
index 00000000..1645e085
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/TvSeriesInlineDetails.html
@@ -0,0 +1,210 @@
+
+
+
+
+ tvSeriess Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/TvSeriesInlineDetails.js b/packages/microsoft.zunevideo/Components/InlineDetails/TvSeriesInlineDetails.js
new file mode 100644
index 00000000..cc8b37c6
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/TvSeriesInlineDetails.js
@@ -0,0 +1,597 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js", "/ViewModels/MediaItemModel.js", "/Components/InlineDetails/ActionButtonsControl.js", "/Components/InlineDetails/BaseInlineDetails.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {TvSeriesInlineDetails: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseMediaInlineDetails", "/Components/InlineDetails/TvSeriesInlineDetails.html#tvSeriesInlineDetailsTemplate", function tvSeriesInlineDetails(element, options) {
+ this._episodeHeight = options.episodeHeight;
+ this._inlineHeight = options.inlineHeight;
+ this._onBackFromEpisodeClickCallback = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._backFromEpisode, this);
+ this._onEpisodeListItemClickCallback = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._onEpisodeListItemClick, this)
+ }, {
+ _episodeHeight: 0, _inlineHeight: 0, _fileTransferListenerId: null, _detailStringBindingComplete: false, _detailEpisodeStringBindingComplete: false, _modifierBinding: null, _selectedEpisodeIndex: 0, _activeEpisodeList: null, _episodesPanel: null, _currentPage: null, initialize: function initialize() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._currentPage = WinJS.Binding.unwrap(navigationService.currentPage);
+ if (this._currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.navigationPopover)
+ this._currentPage.onNavigateTo = function onNavigateTo(fromPage) {
+ if (navigationService.navigationDirection === MS.Entertainment.Navigation.NavigationDirection.backward) {
+ var fromPageMoniker = WinJS.Utilities.getMember("iaNode.moniker", fromPage);
+ if (fromPageMoniker === MS.Entertainment.UI.Monikers.fullScreenNowPlaying) {
+ WinJS.Utilities.addClass(this.domElement, "hideFromDisplay");
+ WinJS.Promise.timeout(1).done(function delayBackNavigate() {
+ navigationService.navigateBack()
+ })
+ }
+ }
+ }.bind(this);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer))
+ this._fileTransferListenerId = "TVSeriesInlineDetails_" + MS.Entertainment.Utilities.getSessionUniqueInteger();
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-season")
+ });
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries)
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-series")
+ });
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media))
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRendered() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-episode")
+ });
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries) {
+ var handleBackPress = function(event) {
+ var goBackToEpisodeList = false;
+ if (this.showEpisode)
+ switch (event.type) {
+ case"MSPointerUp":
+ case"pointerup":
+ goBackToEpisodeList = (event.button === 3);
+ break;
+ case"keydown":
+ goBackToEpisodeList = (event.keyCode === WinJS.Utilities.Key.backspace);
+ break
+ }
+ if (goBackToEpisodeList)
+ this._backFromEpisode()
+ };
+ var handleBackPressFunc = handleBackPress.bind(this);
+ this.domElement.addEventListener("keydown", handleBackPressFunc, true);
+ this.domElement.addEventListener("MSPointerUp", handleBackPressFunc, true);
+ this.domElement.addEventListener("pointerup", handleBackPressFunc, true)
+ }
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media))
+ this.episode = this.media;
+ if (Microsoft.Entertainment.Queries.ObjectType.tvSeries === this.media.mediaType)
+ this.series = this.media;
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.initialize.apply(this, arguments);
+ this._formatDetailString();
+ this._showPanel(true)
+ }, unload: function unload() {
+ if (this._fileTransferListenerId) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ var listenerId = this._fileTransferListenerId;
+ if (!this.showEpisode)
+ listenerId = listenerId + "_season";
+ fileTransferService.unregisterListener(listenerId)
+ }
+ if (this._currentPage && this._currentPage.onNavigateTo)
+ this._currentPage.onNavigateTo = null;
+ this._currentPage = null;
+ if (this._modifierBinding)
+ this._modifierBinding.cancel();
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }, _createSmartBuyStateEngine: function _createSmartBuyStateEngine() {
+ return new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine
+ }, _onHydrateCompleted: function _onHydrateCompleted() {
+ if (this.media.isFailed)
+ this._handleError();
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.applicationStateManager)) {
+ var applicationStateManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.applicationStateManager);
+ applicationStateManager.saveDetailsState(this.media)
+ }
+ }, _fragmentContainerShown: function _fragmentContainerShown() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._fragmentContainerShown.call(this);
+ if (this.series)
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-series");
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-season");
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPopoverRequestToLoad("tv-episode")
+ }, _modifierSelectedItemChangedCallback: function _modifierSelectedItemChangedCallback() {
+ if (this.series && (this.series.seasons || this.series.librarySeasons) && this.modifierSelectionManager.selectedItem && this.modifierSelectionManager.selectedItem.media) {
+ MS.Entertainment.Framework.assert(this.modifierSelectionManager.selectedItem.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason, "Non-season used in the season drop down in tv series inline details");
+ if (this.modifierSelectionManager.selectedItem.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this._setMedia(this.modifierSelectionManager.selectedItem.media)
+ }
+ }, _setSeasonFromSeries: function _setSeasonFromSeries(media) {
+ media = MS.Entertainment.ViewModels.MediaItemModel.augment(media);
+ this.series = media;
+ this._hydrateMedia().then(function seriesHydrated() {
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries) {
+ this._formatDetailString();
+ var seasons = media.seasons ? media.seasons : media.librarySeasons;
+ if (seasons)
+ seasons.toArrayAll().then(function(items) {
+ this.seasonSelections = [];
+ items.forEach(function(season) {
+ var item = {
+ media: season, label: MS.Entertainment.Formatters.formatTVSeasonNumberInt(season.seasonNumber)
+ };
+ this.seasonSelections.push(item)
+ }.bind(this));
+ media = items[items.length - 1];
+ this.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(this.seasonSelections, items.length - 1);
+ var binding = WinJS.Binding.bind(this.modifierSelectionManager, {selectedItem: this._modifierSelectedItemChangedCallback.bind(this)})
+ }.bind(this))
+ }
+ }.bind(this))
+ }, _setMedia: function _setMedia(media) {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._setMedia.apply(this, arguments);
+ if (Microsoft.Entertainment.Queries.ObjectType.tvSeries === this.media.mediaType || (MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem === this.media.serviceType && MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series === this.media.type)) {
+ this._setSeasonFromSeries(this.media);
+ return
+ }
+ if (Microsoft.Entertainment.Queries.ObjectType.tvSeason === this.media.mediaType || (MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem === this.media.serviceType && MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season === this.media.type))
+ this.season = this.media;
+ this.media = MS.Entertainment.ViewModels.MediaItemModel.augment(this.media);
+ this.showEpisode = (this.episode && this.episode === this.media);
+ this._updateShowBackButton();
+ this._hideShowEpisodeList();
+ this._hydrateMedia();
+ if (this._fileTransferListenerId && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer)) {
+ if (!this.media.contentNotifications)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(this.media, "contentNotifications", new MS.Entertainment.UI.ContentNotification.ObservableNotificationArray);
+ else
+ this.media.contentNotifications.clear();
+ var mediaKey = this.showEpisode ? null : this.media.seriesId.toLowerCase() + "_s" + this.media.seasonNumber;
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ var getTaskKey = null;
+ var listenerId = this._fileTransferListenerId;
+ if (this.showEpisode)
+ getTaskKey = function getTaskKey(task) {
+ return (task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && task.libraryId === media.libraryId) ? task.libraryId : null
+ };
+ else {
+ getTaskKey = function getTaskKey(task) {
+ if (task && task.seriesMediaId && !MS.Entertainment.Utilities.isEmptyGuid(task.seriesMediaId)) {
+ var taskKey = task.seriesMediaId.toLowerCase() + "_s" + task.seasonNumber;
+ if (taskKey === mediaKey)
+ return mediaKey
+ }
+ return null
+ };
+ listenerId = listenerId + "_season"
+ }
+ fileTransferService.registerListener(listenerId, getTaskKey, this.media, this.showEpisode ? MS.Entertainment.UI.FileTransferNotifiers.genericFile : MS.Entertainment.UI.FileTransferNotifiers.episodeCollection);
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.media)
+ }
+ var binding;
+ if (!this.series || this.media.mediaType !== Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this.description = String.empty;
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason && this.media.hasSeriesId) {
+ var updateEpisodes = function updateEpisodes() {
+ if (!this.media.episodesQueryFailed)
+ this._parseEpisodes(this.media.episodes);
+ else
+ this._parseEpisodes(null);
+ this._hideShowEpisodeList()
+ };
+ var episodesQueryFailed = function episodesQueryFailed() {
+ if (this.media.episodesQueryFailed)
+ this._loadLocalEpisodes()
+ };
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this._loadSeriesInfo();
+ binding = WinJS.Binding.bind(this.media, {
+ episodeCount: this._formatDetailString.bind(this), genre: this._formatDetailString.bind(this), episodes: updateEpisodes.bind(this), episodesQueryFailed: episodesQueryFailed.bind(this)
+ });
+ if (this.series)
+ this.mediaBindings.push(WinJS.Binding.bind(this.series, {description: this._formatDetailString.bind(this)}));
+ else
+ this.mediaBindings.push(WinJS.Binding.bind(this.media, {description: this._formatDetailString.bind(this)}));
+ this._detailStringBindingComplete = true
+ }
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ this._loadLocalSeriesInfo();
+ binding = WinJS.Binding.bind(this.media, {description: this._formatDetailString.bind(this)});
+ this._detailStringBindingComplete = true
+ }
+ else if (this.media === this.episode || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media)) {
+ binding = WinJS.Binding.bind(this.media, {
+ rightsHydrated: this._formatDetailString.bind(this), description: this._formatDetailString.bind(this), libraryDefinitions: this._formatDetailString.bind(this)
+ });
+ this._detailEpisodeStringBindingComplete = true
+ }
+ if (binding)
+ this.mediaBindings.push(binding);
+ this._formatDetailString();
+ this._setupSmartBuy();
+ var animations = [];
+ var episodeShown = !WinJS.Utilities.hasClass(this._episodeContent, "hideFromDisplay");
+ if (this.showEpisode) {
+ if (!episodeShown)
+ animations.push(MS.Entertainment.Utilities.showElement(this._episodeContent))
+ }
+ else if (episodeShown)
+ animations.push(MS.Entertainment.Utilities.hideElement(this._episodeContent));
+ WinJS.Promise.join(animations).done(function animationsComplete() {
+ if (this.showEpisode) {
+ if (this._actionButtons.restoreFocus)
+ this._actionButtons.restoreFocus(true);
+ else
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._actionButtons.domElement);
+ var lists = [this._latestEpisodeList, this._episodeList, this._extraEpisodeList];
+ lists.forEach(function(list) {
+ if (list) {
+ var item = list.getCurrentItem();
+ if (item && item.hasFocus) {
+ this._activeEpisodeList = list;
+ this._selectedEpisodeIndex = item.index
+ }
+ }
+ }.bind(this))
+ }
+ else {
+ var activeEpisodeList = this._activeEpisodeList;
+ var indexToFocus = this._selectedEpisodeIndex;
+ if (!this._activeEpisodeList) {
+ activeEpisodeList = this.showLatestEpisodes ? this._latestEpisodeList : this._episodeList;
+ indexToFocus = 0
+ }
+ activeEpisodeList.setCurrentItem({
+ index: indexToFocus, hasFocus: true, showFocus: MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus
+ })
+ }
+ }.bind(this))
+ }, _releaseMedia: function _releaseMedia() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._releaseMedia.apply(this, arguments);
+ if (this._episodeListHooked) {
+ this._episodeList.domElement.removeEventListener("iteminvoked", this._onEpisodeListItemClickCallback);
+ this._episodeListHooked = false
+ }
+ if (this._latestEpisodeListHooked) {
+ this._latestEpisodeList.domElement.removeEventListener("iteminvoked", this._onEpisodeListItemClickCallback);
+ this._latestEpisodeListHooked = false
+ }
+ if (this._extraEpisodeListHooked) {
+ this._extraEpisodeList.domElement.removeEventListener("iteminvoked", this._onEpisodeListItemClickCallback);
+ this._extraEpisodeListHooked = false
+ }
+ if (this.episodesQuery) {
+ this.episodesQuery.dispose();
+ this.episodesQuery = null
+ }
+ if (this._fileTransferListenerId) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ var listenerId = this._fileTransferListenerId;
+ if (!this.showEpisode)
+ listenerId = listenerId + "_season";
+ fileTransferService.unregisterListener(listenerId)
+ }
+ }, _setupSmartBuy: function _setupSmartBuy() {
+ if (this.showEpisode) {
+ var that = this;
+ var smartBuyButtonsChanged = function smartButtonsChanged(stateInfo) {
+ return MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoInlineDetailsStateChanged.call(this, stateInfo).then(function refreshedButtons(buttons) {
+ if (that._actionButtons.restoreFocus)
+ that._actionButtons.restoreFocus(true);
+ else
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(that._actionButtons.domElement);
+ return buttons
+ })
+ };
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getEpisodeDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.popover), smartBuyButtonsChanged)
+ }
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ if (this.smartBuyStateEngine)
+ this.smartBuyStateEngine.initialize(this.media, MS.Entertainment.ViewModels.SmartBuyButtons.getTVSeasonInlineDetailsButtons(this.media, MS.Entertainment.UI.Actions.ExecutionLocation.popover), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onTVSeasonInlineDetailsStateChanged)
+ }, _handleError: function _handleError() {
+ if (this.media.inCollection)
+ this._loadLocalSeriesInfo();
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype._handleError.apply(this, arguments)
+ }, _loadLocalSeriesInfo: function _loadLocalSeriesInfo() {
+ var loadEpisodesPromise = this._loadLocalEpisodes();
+ var loadSeriesPromise = this._loadSeriesInfo();
+ WinJS.Promise.join([loadEpisodesPromise, loadSeriesPromise]).then(function() {
+ this._showPanel()
+ }.bind(this))
+ }, _loadLocalEpisodes: function loadLocalEpisodes() {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ if (!this.media.inCollection || this.showEpisode) {
+ completion();
+ return
+ }
+ var query = new MS.Entertainment.Data.Query.libraryVideoTV;
+ query.seasonId = this.media.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.VideosSortBy.seriesTitleSeasonNumberEpisodeNumber;
+ query.isLive = true;
+ query.execute().then(function queryComplete(q) {
+ if (!this.episodes) {
+ this._parseEpisodes(q.result.items);
+ this.episodesQuery = query;
+ this._hideShowEpisodeList()
+ }
+ completion()
+ }.bind(this));
+ return promise
+ }, _hasVideoRating: function hasVideoRating(rating) {
+ var lowerCased = rating && rating.toLowerCase();
+ if (!lowerCased)
+ return false;
+ switch (lowerCased) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.edsVideoRating.nr:
+ case MS.Entertainment.Data.Augmenter.Marketplace.edsVideoRating.notRated:
+ case MS.Entertainment.Data.Augmenter.Marketplace.edsVideoRating.unrated:
+ return false
+ }
+ return true
+ }, _loadSeriesInfo: function _loadSeriesInfo() {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason && !this._isOnline) {
+ this._loadLocalEpisodes();
+ completion()
+ }
+ else if (this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason && this.media.seriesId && this.media.seriesId !== MS.Entertainment.Utilities.EMPTY_GUID) {
+ var series = this.series;
+ if (!series) {
+ series = new MS.Entertainment.Data.Augmenter.Marketplace.Video.EdsTVSeries;
+ series.serviceId = this.media.seriesId;
+ series.serviceIdType = this.media.seriesIdType
+ }
+ series.hydrate().done(function populateSeriesInfo() {
+ this.media.genre = series.genre;
+ if (!this._hasVideoRating(this.media.rating))
+ this.media.rating = series.rating;
+ if (this.media.seasonNumber > 0 && series.seasons)
+ series.seasons.itemsFromIndex(0).done(function processItems(args) {
+ for (var x = 0; x < args.items.length; x++)
+ if (this.media.seasonNumber === args.items[x].data.seasonNumber) {
+ this.media.releaseDate = this.media.releaseDate || args.items[x].data.releaseDate;
+ this.media.episodeCount = this.media.episodeCount || args.items[x].data.episodeCount;
+ this.media.description = this.media.description || args.items[x].data.description;
+ this.media.rights = this.media.rights || args.items[x].data.rights;
+ this.media.isComplete = this.media.isComplete || args.items[x].data.isComplete;
+ break
+ }
+ if (this.showEpisode)
+ this._formatDetailString();
+ completion()
+ }.bind(this));
+ else {
+ this._formatDetailString();
+ completion()
+ }
+ }.bind(this), function seriesInfoError() {
+ this._loadLocalEpisodes();
+ completion()
+ }.bind(this))
+ }
+ return promise
+ }, _onEpisodeListItemClick: function TVSeriesInlineDetails_onEpisodeListItemClick(event) {
+ this.description = String.empty;
+ MS.Entertainment.Utilities.hideElement(this._seasonContent).done(function loadEpisode() {
+ event.detail.itemPromise.then(function getItemData(data) {
+ this.episode = data.data;
+ this._setMedia(this.episode);
+ MS.Entertainment.Utilities.showElement(this._episodeContent)
+ }.bind(this))
+ }.bind(this))
+ }, _backFromEpisode: function _backFromEpisode() {
+ this.episode = null;
+ this._seasonContent.setAttribute("data-ent-showanimation", "enterPage");
+ this.description = String.empty;
+ MS.Entertainment.Utilities.hideElement(this._episodeContent).done(function loadSeason() {
+ this._setMedia(this.season);
+ MS.Entertainment.Utilities.showElement(this._seasonContent)
+ }.bind(this))
+ }, _canNavigateBackfromEpisode: function _canNavigateBackfromEpisode() {
+ return this.showEpisode && (this.season || this.series)
+ }, _updateShowBackButton: function _updateShowBackButton() {
+ var showBackButton = this._canNavigateBackfromEpisode() && MS.Entertainment.Utilities.isApp1;
+ if (showBackButton !== this.showBackButton)
+ this.showBackButton = showBackButton
+ }, _formatDetailString: function formatDetailString() {
+ if (this.showEpisode)
+ return this._formatEpisodeDetailString();
+ if (this.series)
+ return this._formatSeriesDetailString();
+ return this._formatSeasonDetailString()
+ }, _formatSeasonDetailString: function formatDetailString() {
+ if (!this._detailStringBindingComplete)
+ return;
+ if (!this.media.rightsHydrated)
+ return;
+ var values = [];
+ var releaseDate = this._getReleaseDate();
+ if (releaseDate)
+ values.push(releaseDate);
+ if (this.media.rating)
+ values.push(this.media.rating);
+ var genres = this._getGenres();
+ if (genres)
+ values.push(genres);
+ var episodesLabel = this._getEpisodeCountLabel();
+ if (episodesLabel)
+ values.push(episodesLabel);
+ var detailString = values.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR));
+ if (this.detailString !== detailString)
+ this.detailString = detailString;
+ if (!this.detailString)
+ this.detailString = " ";
+ this._updateDescription()
+ }, _formatSeriesDetailString: function _formatSeriesDetailString() {
+ if (!this._detailStringBindingComplete)
+ return;
+ if (!this.series.rightsHydrated && this.series.mediaType !== Microsoft.Entertainment.Queries.ObjectType.tvSeries)
+ return;
+ var values = [];
+ if (this.originalLocation === MS.Entertainment.Data.ItemLocation.collection && this.series.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ if (this.series.seasonNumber <= 0)
+ values.push(String.load(String.id.IDS_TV_SEASON_0_NAME));
+ else
+ values.push(String.load(String.id.IDS_TV_SEASON_NAME).format(this.series.seasonNumber));
+ var genres = this._getGenres();
+ if (genres)
+ values.push(genres);
+ if (this.series.rating)
+ values.push(this.series.rating);
+ var seasonsLabel = this._getSeasonCountLabel();
+ if (seasonsLabel)
+ values.push(seasonsLabel);
+ var seriesDetailString = values.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR));
+ if (this.seriesDetailString !== seriesDetailString)
+ this.seriesDetailString = seriesDetailString;
+ if (!this.seriesDetailString)
+ this.seriesDetailString = " ";
+ this._updateDescription()
+ }, _formatEpisodeDetailString: function formatEpisodeDetailString() {
+ if (!this._detailEpisodeStringBindingComplete)
+ return;
+ if (!this.media.rightsHydrated)
+ return;
+ var episodeDetailString = MS.Entertainment.Formatters.formatEpisodeMetadata(this.media, {
+ releaseDate: true, genres: true, network: true, languages: true, rating: true, videoDefinition: true, duration: true
+ });
+ if (this.episodeDetailString !== episodeDetailString)
+ this.episodeDetailString = episodeDetailString;
+ if (!this.episodeDetailString)
+ this.episodeDetailString = " ";
+ var seasonNumberEpisodeNumberString = MS.Entertainment.Formatters.formatTVSeasonEpisodeNumberInt(this.media);
+ if (this.seasonNumberEpisodeNumberString !== seasonNumberEpisodeNumberString)
+ this.seasonNumberEpisodeNumberString = seasonNumberEpisodeNumberString;
+ if (!this.seasonNumberEpisodeNumberString)
+ this.seasonNumberEpisodeNumberString = " ";
+ this._updateDescription()
+ }, _updateDescription: function _updateDescription() {
+ if (this.showEpisode) {
+ if (this.description !== this.media.description && this.episodeDetailString && this.episodeDetailString !== " ")
+ this.description = this.media.description
+ }
+ else if (this.series) {
+ if (this.description !== this.series.description && this.seriesDetailString && this.seriesDetailString !== " ")
+ this.description = this.series.description
+ }
+ else if (this.description !== this.media.description && this.detailString && this.detailString !== " ")
+ this.description = MS.Entertainment.Utilities.isVideoApp1 ? this.media.description : null
+ }, _hideShowEpisodeList: function _hideShowEpisodeList() {
+ if (!this.showEpisode && this.episodes && this.episodes.length > 0) {
+ this._episodeList.domElement.addEventListener("iteminvoked", this._onEpisodeListItemClickCallback, false);
+ this._episodeListHooked = true;
+ this._showElement(this._episodesPanel, true)
+ }
+ else
+ this._showElement(this._episodesPanel, false);
+ if (!this.showEpisode && this.latestEpisodes && this.latestEpisodes.length > 0) {
+ this._latestEpisodeList.domElement.addEventListener("iteminvoked", this._onEpisodeListItemClickCallback, false);
+ this._latestEpisodeListHooked = true;
+ this._showElement(this._latestEpisodesPanel, true)
+ }
+ else
+ this._showElement(this._latestEpisodesPanel, false);
+ if (!this.showEpisode && this.extraEpisodes && this.extraEpisodes.length > 0) {
+ this._extraEpisodeList.domElement.addEventListener("iteminvoked", this._onEpisodeListItemClickCallback, false);
+ this._extraEpisodeListHooked = true;
+ this._showElement(this._extraEpisodesPanel, true)
+ }
+ else
+ this._showElement(this._extraEpisodesPanel, false)
+ }, _parseEpisodes: function _parseEpisodes(episodes) {
+ this.episodes = episodes === null ? null : [];
+ this.extraEpisodes = episodes === null ? null : [];
+ if (episodes && episodes.count > 0) {
+ var sevenDaysInMilliseconds = MS.Entertainment.Formatters.milliSecondsFromTimeSpan(7);
+ episodes.itemsFromIndex(0, 0, episodes.count).done(function gotLatestEpisode(latestEpisodes) {
+ var latestEpisode = null;
+ if (latestEpisodes && latestEpisodes.items && latestEpisodes.items.length > 0) {
+ var foundLatestAired = false;
+ var index = latestEpisodes.items.length - 1;
+ while (index >= 0) {
+ latestEpisode = latestEpisodes.items[index].data;
+ if (MS.Entertainment.Utilities.isVideoApp2 || latestEpisode.episodeNumber > 0)
+ this.episodes.unshift(latestEpisode);
+ else
+ this.extraEpisodes.unshift(latestEpisode);
+ if (!foundLatestAired) {
+ var todayDateOnly = new Date;
+ todayDateOnly.setTime(Date.now());
+ todayDateOnly.setHours(0, 0, 0, 0);
+ var latestEpisodeDateOnly = new Date;
+ latestEpisodeDateOnly.setTime(latestEpisode.releaseDate);
+ latestEpisodeDateOnly.setHours(0, 0, 0, 0);
+ var deltaDates = todayDateOnly - latestEpisodeDateOnly;
+ if (latestEpisode && (deltaDates >= 0 && deltaDates <= sevenDaysInMilliseconds))
+ this.latestEpisodes = [latestEpisode];
+ else
+ this.latestEpisodes = [];
+ foundLatestAired = deltaDates >= 0
+ }
+ index--
+ }
+ }
+ else
+ this.latestEpisodes = [];
+ this.showLatestEpisodes = MS.Entertainment.Utilities.isVideoApp1 && this.latestEpisodes.length > 0;
+ this.showExtraEpisodes = MS.Entertainment.Utilities.isVideoApp1 && this.extraEpisodes.length > 0;
+ this.showEpisodes = this.episodes.length > 0
+ }.bind(this))
+ }
+ else {
+ this.latestEpisodes = [];
+ this.showEpisodes = false;
+ this.showLatestEpisodes = false;
+ this.showExtraEpisodes = false
+ }
+ }, _getReleaseDate: function getReleaseDate() {
+ var releaseDate = null;
+ if (this.media.releaseDate) {
+ var formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.media))
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).shortDate;
+ var date = new Date(this.media.releaseDate);
+ releaseDate = formatter.format(date)
+ }
+ return releaseDate
+ }, _getGenres: function getGenres() {
+ var genres = null;
+ if (this.media.genre)
+ if (Array.isArray(this.media.genre)) {
+ var genreNames = [];
+ this.media.genre.forEach(function(genre) {
+ if (genre)
+ genreNames.push(genre.name)
+ });
+ genres = genreNames.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else
+ genres = this.media.genre;
+ else if (this.media.genreName)
+ genres = this.media.genreName;
+ return genres
+ }, _getSeasonCountLabel: function getSeasonCountLabel() {
+ var label = null;
+ if (this.series.seasonCount && this.series.seasonCount > 0)
+ label = MS.Entertainment.Formatters.seasonCountText(this.series.seasonCount);
+ return label
+ }, _getEpisodeCountLabel: function getEpisodeCountLabel() {
+ var label = null;
+ var formattedNum;
+ if (this.media.episodeCount && this.media.episodeCount > 0) {
+ var stringId = String.id.IDS_TV_EPISODES_LABEL;
+ if (this.media.episodeCount === 1)
+ stringId = String.id.IDS_TV_EPISODE_LABEL;
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(this.media.episodeCount);
+ label = String.load(stringId).format(formattedNum)
+ }
+ return label
+ }
+ }, {
+ _episodeList: null, _latestEpisodeList: null, _extraEpisodeList: null, _onEpisodeListItemClickCallback: null, _onBackFromEpisodeClickCallback: null, _episodeListHooked: false, _latestEpisodeListHooked: false, _extraEpisodeListHooked: false, episodes: null, showEpisodes: false, latestEpisodes: null, showLatestEpisodes: false, extraEpisodes: null, showExtraEpisodes: false, episodeDetailString: null, seasonNumberEpisodeNumberString: null, seriesDetailString: null, description: null, episodesQuery: null, episode: null, showEpisode: false, showBackButton: false, season: null, series: null, seasonSelections: null, modifierSelectionManager: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {TvSeriesInlineDetailsFullScreen: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.TvSeriesInlineDetails", "/Components/InlineDetails/TvSeriesInlineDetails.html#tvSeriesInlineDetailsFullScreenTemplate", function TvSeriesInlineDetailsFullScreen(){}, {}, {})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/VideoInlineDetailsDemo.html b/packages/microsoft.zunevideo/Components/InlineDetails/VideoInlineDetailsDemo.html
new file mode 100644
index 00000000..5b9b4fd7
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/VideoInlineDetailsDemo.html
@@ -0,0 +1,105 @@
+
+
+
+
+ Video Inline Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/InlineDetails/VideoInlineDetailsDemo.js b/packages/microsoft.zunevideo/Components/InlineDetails/VideoInlineDetailsDemo.js
new file mode 100644
index 00000000..ef57b7d6
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/InlineDetails/VideoInlineDetailsDemo.js
@@ -0,0 +1,25 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {
+ VideoInlineDetailsSpotlightDemo: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", "/Components/InlineDetails/VideoInlineDetailsDemo.html#videoSpotlightInlineDetailsDemoTemplate", function VideoInlineDetailsSpotlightDemo(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.apply(this, arguments)
+ }, unload: function unload() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }
+ }), VideoInlineDetailsMarketplaceDemo: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", "/Components/InlineDetails/VideoInlineDetailsDemo.html#videoMarketplaceInlineDetailsDemoTemplate", function VideoInlineDetailsMarketplaceDemo(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.apply(this, arguments)
+ }, unload: function unload() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }
+ }), VideoInlineDetailsMarketplaceNoTvDemo: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.BaseInlineDetails", "/Components/InlineDetails/VideoInlineDetailsDemo.html#videoMarketplaceInlineDetailsNoTvDemoTemplate", function VideoInlineDetailsNoTvDemo(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Pages.BaseInlineDetails.prototype.initialize.apply(this, arguments)
+ }, unload: function unload() {
+ MS.Entertainment.Pages.BaseMediaInlineDetails.prototype.unload.call(this)
+ }
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Marketplace.html b/packages/microsoft.zunevideo/Components/Marketplace.html
new file mode 100644
index 00000000..7c5f5e98
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Marketplace.html
@@ -0,0 +1,59 @@
+
+
+
+
+ Marketplace Page Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Marketplace.js b/packages/microsoft.zunevideo/Components/Marketplace.js
new file mode 100644
index 00000000..aebcbec0
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Marketplace.js
@@ -0,0 +1,337 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MarketplaceBase: MS.Entertainment.UI.Framework.defineUserControl("/Components/Marketplace.html#marketplaceTemplate", function marketplaceBaseConstructor(element, options){}, {
+ view: null, templateSelectorConstructor: MS.Entertainment.UI.Controls.GalleryTemplateSelector, allowEmpty: false, clearItemsDuringQuery: false, usePageScroller: true, usePageScrollerChildAsAnimationRoot: false, pageScrollerAnimationRootSelectors: null, _pageScroller: null, _bindings: null, _viewModelEventHandlers: null, _currentGalleryClass: String.empty, _scrollerPadding: 175, selectedTemplate: {get: function() {
+ return (this._viewModel) ? this._viewModel.selectedTemplate : null
+ }}, initialize: function initialize() {
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRender() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioMarketplaceGalleryRequestToLoad()
+ });
+ this.bind("_viewModel", this._initializePage.bind(this));
+ this._bindings = WinJS.Binding.bind(this, {dataContext: this._updateViewModel.bind(this)});
+ MS.Entertainment.UI.Framework.UserControl.prototype.initialize.call(this)
+ }, unload: function unload() {
+ if (this._viewModel && this._viewModel.dispose)
+ this._viewModel.dispose();
+ if (this._viewModel && this._viewModel.unregisterServices)
+ this._viewModel.unregisterServices();
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._pageScroller) {
+ this._pageScroller.dispose();
+ this._pageScroller = null
+ }
+ this._uninitializePage();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ if (this._viewModel && this._viewModel.freeze)
+ this._viewModel.freeze();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._viewModel && this._viewModel.thaw)
+ this._viewModel.thaw();
+ if (this._pageScroller)
+ this._pageScroller.refreshScrollPosition()
+ }, _uninitializePage: function _uninitializePage() {
+ if (this._viewModelEventHandlers) {
+ this._viewModelEventHandlers.cancel();
+ this._viewModelEventHandlers = null
+ }
+ }, _updateViewModel: function _updateViewModel(newValue) {
+ if (newValue)
+ this._viewModel = newValue.viewModel
+ }, _initializePage: function initializePage() {
+ this._uninitializePage();
+ this._viewModelEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel, {
+ itemsChanged: this._setGalleryItems.bind(this), isFailedChanged: this._setFailedEvent.bind(this), largeItemIndexChanged: this._updateGalleryLargeItemIndex.bind(this)
+ });
+ this._setGalleryItems();
+ this._setFailedEvent();
+ this._updateGalleryLargeItemIndex()
+ }, _setPageScollerAnimationRoots: function _setPageScollerAnimationRoots() {
+ var rootElements = [];
+ if (!this._pageScroller || !Array.isArray(this.pageScrollerAnimationRootSelectors))
+ return;
+ this.pageScrollerAnimationRootSelectors.reduce(function(data, selector) {
+ var element = this.domElement.querySelector(selector);
+ if (element)
+ data.push(element);
+ return data
+ }.bind(this), rootElements);
+ this._pageScroller.animationRoots = rootElements
+ }, _setGalleryItems: function setGalleryItems() {
+ var node = this.selectedTemplate;
+ if (this._unloaded || !node || !this._viewModel.items || (!this._viewModel.items.count && (!this.allowEmpty && !node.allowEmpty && (this._viewModel.isCurrentQuery() || !this.clearItemsDuringQuery))) || (!this._viewModel.isCurrentQuery() && !this.clearItemsDuringQuery)) {
+ this._galleryView.dataSource = null;
+ return
+ }
+ if (this._galleryView.useItemsControlInGallery) {
+ this._initializeSelectionHandlers();
+ var items = new MS.Entertainment.Data.ObservableArrayVirtualListAdapter;
+ items.initialize(this._viewModel.items, function adapterFactory(item) {
+ return item
+ });
+ this._galleryView.dataSource = items;
+ if (this.usePageScroller) {
+ if (!this._pageScroller) {
+ this._pageScroller = new MS.Entertainment.UI.Controls.PageScroller(this._galleryScrollContainer, this._nextPageScroller, this._previousPageScroller);
+ this._pageScroller.leftScrollPadding = this._scrollerPadding;
+ this._pageScroller.rightScrollPadding = this._scrollerPadding;
+ this._pageScroller.logicalContainerSelector = ".marketplaceGalleryFlex";
+ this._pageScroller.useFirstChildAsAnimationRoot = this.usePageScrollerChildAsAnimationRoot;
+ this._setPageScollerAnimationRoots()
+ }
+ this._pageScroller.resetScrollPosition()
+ }
+ return
+ }
+ this._galleryView.headerType = node.headerType || MS.Entertainment.UI.Controls.GalleryControl.HeaderType.auto;
+ this._galleryView.largeItemSize = node.largeItemSize || this._galleryView.largeItemSize;
+ this._galleryView.multiSize = node.multiSize || false;
+ this._galleryView.maxRows = node.maxRows || -1;
+ this._galleryView.startNewColumnOnHeaders = node.startNewColumnOnHeaders || false;
+ this._galleryView.slotSize = node.slotSize;
+ this._galleryView.itemMargin = node.itemMargin;
+ this._galleryView.itemSize = node.itemSize;
+ this._galleryView.itemTemplate = node.templateUrl;
+ this._galleryView.panelTemplate = node.panelTemplateUrl;
+ this._galleryView.panelOptions = node.panelOptions;
+ this._galleryView.actionTemplate = node.actionTemplateUrl;
+ this._galleryView.mediaType = node.mediaType;
+ this._galleryView.headerClass = node.headerClass || null;
+ this._galleryView.horizontal = node.horizontal || false;
+ this._galleryView.grouped = node.grouped;
+ this._galleryView.layout = node.layout || MS.Entertainment.UI.Controls.GalleryControl.Layout.grid;
+ this._galleryView.invokeBehavior = node.invokeBehavior || MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.popOver;
+ this._galleryView.invokeHelperFactory = node.invokeHelperFactory || null;
+ this._galleryView.headerTemplate = node.groupTemplate || this._galleryView.headerTemplate || null;
+ this._galleryView.forceInteractive = node.forceInteractive || false;
+ this._galleryView.backdropColor = node.backdropColor;
+ this._galleryView.raisePanelResetEvents = node.raisePanelResetEvents || true;
+ this._galleryView.actionOptions = node.actionOptions || null;
+ this._galleryView.emptyGalleryTemplate = (!this._viewModel.isCurrentQuery() && this.clearItemsDuringQuery) ? null : node.emptyGalleryTemplate;
+ this._galleryView.emptyGalleryModel = this._viewModel.emptyGalleryModel || null;
+ this._galleryView.delayHydrateLibraryId = node.delayHydrateLibraryId || false;
+ this._galleryView.minimumListLength = node.minimumListLength;
+ this._galleryView.panelTemplateTypeMappings = node.panelTemplateTypeMappings;
+ this._galleryView.selectionStyleFilled = node.selectionStyleFilled || false;
+ this._galleryView.maxSelectionCount = node.maxSelectionCount;
+ this._galleryView.restoreFocusOnDataChanges = node.restoreFocusOnDataChanges || false;
+ if (node.selectionMode)
+ this._galleryView.selectionMode = node.selectionMode;
+ if (node.swipeBehavior)
+ this._galleryView.swipeBehavior = node.swipeBehavior;
+ this._galleryView.grouperItemThreshold = -1;
+ if (node.groupHeaderPosition)
+ this._galleryView.headerPosition = node.groupHeaderPosition;
+ if (this._galleryView.grouped) {
+ this._galleryView.grouperType = node.grouperType;
+ this._galleryView.grouper.keyPropertyName = node.grouperField;
+ this._galleryView.grouper.useKeyAsData = (node.grouperKeyAsData !== undefined) ? node.grouperKeyAsData : true
+ }
+ else
+ this._galleryView.grouperType = null;
+ if (this._currentGalleryClass)
+ WinJS.Utilities.removeClass(this._galleryView.domElement, this._currentGalleryClass);
+ if (node.galleryClass) {
+ WinJS.Utilities.addClass(this._galleryView.domElement, node.galleryClass);
+ this._currentGalleryClass = node.galleryClass
+ }
+ this._initializeSelectionHandlers();
+ this._galleryView.dataSource = this._viewModel.items
+ }, _initializeSelectionHandlers: function _initializeSelectionHandlers() {
+ if (this._galleryView.selectionMode !== MS.Entertainment.UI.Controls.GalleryControl.SelectionMode.none) {
+ var defaultSelectionHandlers = MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers(this._clearSelection.bind(this));
+ this._galleryView.addSelectionHandlers(defaultSelectionHandlers);
+ this._galleryView.addSelectionHandlers({deleteMedia: this._handleItemDeleted.bind(this)})
+ }
+ }, _handleItemDeleted: function _handleItemDeleted(eventArgs) {
+ var deleted = eventArgs.detail && eventArgs.detail.deleted;
+ if (deleted)
+ this._clearSelection()
+ }, _clearSelection: function _clearSelection() {
+ this._galleryView.clearSelection()
+ }, _setFailedEvent: function updateFailed() {
+ if (this._viewModel.isFailed)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement, true, this._viewModel.failedGalleryModel)
+ }, _updateGalleryLargeItemIndex: function updateGalleryLargeItemIndex() {
+ if (this._unloaded)
+ return;
+ this._galleryView.largeItemIndex = this._viewModel.largeItemIndex
+ }, _mergeGroupItems: function mergeGroupItems(lessSignificantGroupItem, moreSignificantGroupItem) {
+ if (lessSignificantGroupItem && moreSignificantGroupItem) {
+ var combinedItem = {};
+ for (var property in lessSignificantGroupItem)
+ combinedItem[property] = lessSignificantGroupItem[property];
+ for (property in moreSignificantGroupItem)
+ combinedItem[property] = moreSignificantGroupItem[property];
+ return combinedItem
+ }
+ else if (lessSignificantGroupItem)
+ return lessSignificantGroupItem;
+ else if (moreSignificantGroupItem)
+ return moreSignificantGroupItem
+ }
+ }, {
+ _viewModel: null, dataContext: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Marketplace: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MarketplaceBase", "/Components/Marketplace.html#marketplaceTemplate", function marketplaceConstructor(element, options){}, {
+ _galleryImageChangedCallback: null, _heroImageChangedCallback: null, _modifierSelectedItemChangedCallback: null, _marketplaceViewModelEventHandlers: null, _modifierEventHandlers: null, _secondaryModifierEventHandlers: null, _updatingSecondaryFilter: false, selectedTemplate: {get: function() {
+ return (!this.combinedQueryOptions) ? null : this._mergeGroupItems(this._viewModel.Templates[this.combinedQueryOptions.template], this.combinedQueryOptions)
+ }}, primaryFilterSelectedItem: {get: function() {
+ return this._viewModel && this._viewModel.modifierSelectionManager ? this._viewModel.modifierSelectionManager.selectedItem : null
+ }}, secondaryFilterSelectedItem: {get: function() {
+ return this._viewModel && this._viewModel.secondaryModifierSelectionManager ? this._viewModel.secondaryModifierSelectionManager.selectedItem : null
+ }}, primaryFilterDataSource: {
+ get: function() {
+ return this._viewModel && this._viewModel.modifierSelectionManager ? this._viewModel.modifierSelectionManager.dataSource : null
+ }, set: function(value) {
+ if (this._viewModel && this._viewModel.modifierSelectionManager)
+ this._viewModel.modifierSelectionManager.dataSource = value
+ }
+ }, secondaryFilterDataSource: {
+ get: function() {
+ return this._viewModel && this._viewModel.secondaryModifierSelectionManager ? this._viewModel.secondaryModifierSelectionManager.dataSource : null
+ }, set: function(value) {
+ if (this._viewModel && this._viewModel.secondaryModifierSelectionManager)
+ this._viewModel.secondaryModifierSelectionManager.dataSource = value
+ }
+ }, initialize: function initialize() {
+ this._galleryImageChangedCallback = this._setGalleryImage.bind(this);
+ this._heroImageChangedCallback = this._setHeroImage.bind(this);
+ this._modifierSelectedItemChangedCallback = this._modifierSelectionChanged.bind(this);
+ this._modifierChanged = this._modifierChanged.bind(this);
+ this._secondaryModifierChanged = this._secondaryModifierChanged.bind(this);
+ MS.Entertainment.Pages.MarketplaceBase.prototype.initialize.apply(this, arguments)
+ }, addEventHandlers: function addEventHandlers() {
+ this._marketplaceViewModelEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel, {
+ galleryImageUrlChanged: this._galleryImageChangedCallback, heroImageUrlChanged: this._heroImageChangedCallback, modifierChanged: this._modifierChanged, secondaryModifierChanged: this._secondaryModifierChanged
+ })
+ }, cancelEventHandlers: function cancelEventHandlers() {
+ if (this._marketplaceViewModelEventHandlers) {
+ this._marketplaceViewModelEventHandlers.cancel();
+ this._marketplaceViewModelEventHandlers = null
+ }
+ this._cancelModifierEventHandlers();
+ this._cancelSecondaryModifierEventHandlers()
+ }, _cancelModifierEventHandlers: function _cancelModifierEventHandlers() {
+ if (this._modifierEventHandlers) {
+ this._modifierEventHandlers.cancel();
+ this._modifierEventHandlers = null
+ }
+ }, _cancelSecondaryModifierEventHandlers: function _cancelSecondaryModifierEventHandlers() {
+ if (this._secondaryModifierEventHandlers) {
+ this._secondaryModifierEventHandlers.cancel();
+ this._secondaryModifierEventHandlers = null
+ }
+ }, unload: function unload() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype.unload.call(this)
+ }, _uninitializePage: function _uninitializePage() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype._uninitializePage.apply(this, arguments);
+ this.cancelEventHandlers()
+ }, _initializePage: function initializePage() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype._initializePage.apply(this, arguments);
+ this.addEventHandlers();
+ this._galleryImageChangedCallback();
+ if (!this.primaryFilterDataSource || this.primaryFilterDataSource.length === 0 || !this.primaryFilterSelectedItem)
+ this._viewModel.populatePrimaryFilter();
+ else
+ this._modifierSelectedItemChangedCallback()
+ }, _setGalleryImage: function setGalleryImage() {
+ this._hubImage = this._viewModel.galleryImageUrl
+ }, _setHeroImage: function setHeroImage() {
+ if (this._heroImageContainer && this._viewModel && this._viewModel.heroImageUrl) {
+ this._heroImageContainer.target = this._viewModel.heroImageUrl;
+ if (this._heroPrimaryTextContainer && this._viewModel.heroPrimaryText)
+ MS.Entertainment.Utilities.showElement(this._heroPrimaryTextContainer);
+ if (this._heroSecondaryTextContainer && this._viewModel.heroSecondaryText)
+ MS.Entertainment.Utilities.showElement(this._heroSecondaryTextContainer);
+ this.usePageScrollerChildAsAnimationRoot = false;
+ this.pageScrollerAnimationRootSelectors = [".marketplaceGallery-image", ".marketplaceGalleryFlex"];
+ this._setPageScollerAnimationRoots();
+ if (this._pageScroller && this._pageScroller.useFirstChildAsAnimationRoot)
+ this._pageScroller.useFirstChildAsAnimationRoot = this.usePageScrollerChildAsAnimationRoot
+ }
+ }, _updateSecondaryFilter: function updateSecondaryFilter(primaryFilterItem) {
+ if (primaryFilterItem && !this._updatingSecondaryFilter) {
+ var secondaryFilterUpdated = false;
+ this._updatingSecondaryFilter = true;
+ if (!primaryFilterItem.secondaryFilter && this.secondaryFilterDataSource && this.secondaryFilterDataSource.length !== 0) {
+ this.secondaryFilterDataSource = [];
+ secondaryFilterUpdated = true
+ }
+ else if (primaryFilterItem.secondaryFilter !== undefined && (this.combinedQueryOptions === undefined || primaryFilterItem.secondaryFilter !== this.combinedQueryOptions.secondaryFilter)) {
+ this._viewModel.populateSecondaryFilter(this.primaryFilterSelectedItem);
+ secondaryFilterUpdated = true
+ }
+ this._updatingSecondaryFilter = false;
+ this.combinedQueryOptions = primaryFilterItem;
+ return secondaryFilterUpdated
+ }
+ }, _updateGalleryItems: function updateGalleryItems(combinedQueryOptions) {
+ if (combinedQueryOptions && combinedQueryOptions.query) {
+ var imageQuery = null;
+ var galleryImage = null;
+ var contentQuery = new combinedQueryOptions.query;
+ this.combinedQueryOptions = combinedQueryOptions;
+ this._viewModel.combinedQueryOptions = combinedQueryOptions;
+ if (combinedQueryOptions.serviceId !== undefined)
+ contentQuery.serviceId = combinedQueryOptions.serviceId;
+ if (combinedQueryOptions.genre !== undefined)
+ contentQuery.genre = combinedQueryOptions.genre;
+ if (combinedQueryOptions.studio !== undefined)
+ contentQuery.studio = combinedQueryOptions.studio;
+ if (combinedQueryOptions.network !== undefined)
+ contentQuery.network = combinedQueryOptions.network;
+ if (combinedQueryOptions.impressionGuid !== undefined)
+ contentQuery.impressionGuid = combinedQueryOptions.impressionGuid;
+ if (combinedQueryOptions.orderBy !== undefined)
+ contentQuery.orderBy = combinedQueryOptions.orderBy;
+ if (combinedQueryOptions.sort !== undefined)
+ contentQuery.sort = combinedQueryOptions.sort;
+ if (combinedQueryOptions.startsWith !== undefined)
+ contentQuery.startsWith = combinedQueryOptions.startsWith;
+ if (combinedQueryOptions.imageUri !== undefined)
+ galleryImage = combinedQueryOptions.imageUri;
+ if (combinedQueryOptions.galleryImage !== undefined && combinedQueryOptions.serviceId !== undefined) {
+ imageQuery = new combinedQueryOptions.galleryImage;
+ imageQuery.id = combinedQueryOptions.serviceId
+ }
+ if (combinedQueryOptions.desiredMediaItemTypes !== undefined)
+ contentQuery.desiredMediaItemTypes = combinedQueryOptions.desiredMediaItemTypes;
+ if (combinedQueryOptions.playlistId !== undefined)
+ contentQuery.playlistId = combinedQueryOptions.playlistId;
+ if (combinedQueryOptions.mediaItemObjectType !== undefined)
+ contentQuery.mediaItemObjectType = combinedQueryOptions.mediaItemObjectType;
+ this._viewModel.beginQuery(contentQuery, imageQuery, galleryImage)
+ }
+ }, _modifierChanged: function _modifierChanged() {
+ this._cancelModifierEventHandlers();
+ if (this._viewModel.modifierSelectionManager) {
+ this._modifierEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel.modifierSelectionManager, {selectedItemChanged: this._modifierSelectedItemChangedCallback});
+ this._modifierSelectionChanged()
+ }
+ }, _secondaryModifierChanged: function _secondaryModifierChanged() {
+ this._cancelSecondaryModifierEventHandlers();
+ if (this._viewModel.secondaryModifierSelectionManager) {
+ this._secondaryModifierEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._viewModel.secondaryModifierSelectionManager, {selectedItemChanged: this._modifierSelectedItemChangedCallback});
+ this._modifierSelectionChanged()
+ }
+ }, _modifierSelectionChanged: function modifierSelectionChanged() {
+ var primaryFilterSelectedItem = this.primaryFilterSelectedItem;
+ if (primaryFilterSelectedItem !== null)
+ if (!this._updateSecondaryFilter(primaryFilterSelectedItem)) {
+ this._galleryView.emptyGalleryTemplate = null;
+ this._galleryView.dataSource = null;
+ var mergedItem = this._mergeGroupItems(primaryFilterSelectedItem, this.secondaryFilterSelectedItem);
+ this._updateGalleryItems(mergedItem)
+ }
+ }
+ }, {_hubImage: null}, {})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MarketplaceListViewModelGallery: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MarketplaceBase", "/Components/Marketplace.html#marketplaceListViewModelGalleryTemplate", function marketplaceListViewModelGalleryConstructor(element, options){})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Music/Music.html b/packages/microsoft.zunevideo/Components/Music/Music.html
new file mode 100644
index 00000000..7d55089b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Music/Music.html
@@ -0,0 +1,103 @@
+
+
+
+
+ Music Hub Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Music/MusicCollection.js b/packages/microsoft.zunevideo/Components/Music/MusicCollection.js
new file mode 100644
index 00000000..74446370
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Music/MusicCollection.js
@@ -0,0 +1,617 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {
+ MusicCollection: MS.Entertainment.UI.Framework.defineUserControl(null, function musicCollectionConstructor(element, options) {
+ var gallery = document.createElement("div");
+ gallery.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.GalleryControl");
+ gallery.className = "collectionMusicGalleryView collectionMusic collectionGallery";
+ this._galleryView = new MS.Entertainment.UI.Controls.GalleryControl(gallery, {
+ tap: MS.Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly, selectionMode: MS.Entertainment.UI.Controls.GalleryControl.SelectionMode.multi, templateSelectorConstructor: MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector, swipeBehavior: MS.Entertainment.UI.Controls.GalleryControl.swipeBehavior.select, focusFirstItemOnPageLoad: true, selectionStyleFilled: true
+ });
+ element.appendChild(gallery)
+ }, {
+ _viewModel: null, _galleryView: null, _songClickedHandler: null, _artistClickedHandler: null, _currentClickHandler: null, _selectedSong: null, _bindings: null, _uiStateBindings: null, _viewModelEvents: null, _appBarService: null, view: null, canZoom: {get: function() {
+ return this._galleryView && this._galleryView.canZoom
+ }}, isZoomReady: {get: function() {
+ return this._galleryView && this._galleryView.isZoomReady
+ }}, isZoomedOut: {
+ get: function() {
+ return this._galleryView && this._galleryView.isZoomedOut
+ }, set: function(newValue) {
+ if (this._galleryView) {
+ this._galleryView.isZoomedOut = newValue;
+ this.updateAndNotify("isZoomedOut", newValue)
+ }
+ }
+ }, initialize: function initialize() {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRender() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchToCollection();
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioCollectionGalleryRequestToLoad()
+ });
+ this._songClickedHandler = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._songClicked, this);
+ this._bindings = WinJS.Binding.bind(this, {
+ dataContext: this._initializePage.bind(this), _galleryView: {
+ canZoom: function notifyCanZoom(newValue) {
+ this.notify("canZoom", newValue, false)
+ }.bind(this), isZoomedOut: function setIsZoomedOut(newValue) {
+ this.updateAndNotify("isZoomedOut", newValue)
+ }.bind(this)
+ }
+ });
+ this._uiStateBindings = WinJS.Binding.bind(uiState, {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ var updateGallery = this._updateGallery.bind(this);
+ var clearSelection = this._clearSelection.bind(this);
+ var removeItem = this._removeItemCompleted.bind(this);
+ var defaultSelectionHandlers = MS.Entertainment.ViewModels.SmartAppbarActions.setDefaultGalleryEventHandlers(clearSelection, removeItem);
+ this._galleryView.addSelectionHandlers(defaultSelectionHandlers);
+ this._galleryView.addSelectionHandlers({
+ createNewPlaylist: updateGallery, renamePlaylist: updateGallery, deleteMedia: removeItem, findAlbumInfo: clearSelection
+ })
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._binding = null
+ }
+ if (this._uiStateBindings) {
+ this._uiStateBindings.cancel();
+ this._uiStateBindings = null
+ }
+ if (this._galleryView)
+ this._galleryView.clearSelectionHandlers();
+ this._disposeViewModel();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._selectedSong) {
+ var control = this._selectedSong.querySelector("[data-win-control], .ent-control").winControl;
+ control.expand(this._selectedSong);
+ control.panelClickHandler = this._inPlacePanelClick.bind(this);
+ control.domElement.addEventListener("click", control.panelClickHandler, false)
+ }
+ }, _disposeViewModel: function _disposeViewModel() {
+ if (this._viewModel)
+ this._viewModel.dispose();
+ if (this._viewModelEvents) {
+ this._viewModelEvents.cancel();
+ this._viewModelEvents = null
+ }
+ }, _setClickHandler: function setClickHandler(handler) {
+ if (this._currentClickHandler)
+ this._galleryView.domElement.removeEventListener("iteminvoked", this._currentClickHandler);
+ this._currentClickHandler = handler;
+ this._galleryView.domElement.addEventListener("iteminvoked", this._currentClickHandler, false)
+ }, _initializePage: function initializePage() {
+ if (!this.dataContext)
+ return;
+ this._disposeViewModel();
+ this._viewModel = this.dataContext.viewModel;
+ this._viewModel.view = this.view;
+ this._initializeGalleryView();
+ this._viewModelEvents = MS.Entertainment.Utilities.addEventHandlers(this._viewModel, {
+ itemsChanged: this._viewModelDataChanged.bind(this), isFailedChanged: this._viewModelFailedChanged.bind(this), notificationsChanged: this._onNotificationsChanged.bind(this)
+ });
+ this._viewModelDataChanged()
+ }, _initializeGalleryView: function initializeGalleryView() {
+ var node = this._viewModel.selectedTemplate;
+ this._galleryView.queryToPause = null;
+ this._galleryView.mediaType = this.view;
+ this._galleryView.emptyGalleryTemplate = node.emptyGalleryTemplate || "Controls/GalleryControl.html#listViewEmptyGalleryWithNotificationsTemplate";
+ this._galleryView.emptyGalleryModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ this.dataContext.hideShadow = node.hideShadow
+ }, _viewModelFailedChanged: function _viewModelFailedChanged() {
+ if (this._viewModel && this._viewModel.errorModel)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement, true, this._viewModel.errorModel)
+ }, _viewModelDataChanged: function viewModelDataChanged() {
+ if (!this._viewModel.items || !this._viewModel.isCurrentQuery())
+ return;
+ var node = this._viewModel.selectedTemplate;
+ if (node.headerTemplate)
+ this._galleryView.headerTemplate = node.headerTemplate;
+ else
+ this._galleryView.headerTemplate = null;
+ if (node.panelTemplate) {
+ this._galleryView.panelTemplate = node.panelTemplate ? node.panelTemplate : null;
+ this._galleryView.panelOptions = node.panelOptions ? node.panelOptions : null;
+ this._galleryView.itemSize = node.itemSize ? node.itemSize : null;
+ this._galleryView.slotSize = node.slotSize ? node.slotSize : null
+ }
+ else {
+ this._galleryView.panelTemplate = null;
+ this._galleryView.panelOptions = null;
+ this._galleryView.itemSize = null;
+ this._galleryView.slotSize = null
+ }
+ this._galleryView.headerType = node.headerType || MS.Entertainment.UI.Controls.GalleryControl.HeaderType.auto;
+ this._galleryView.invokeBehavior = node.invokeBehavior || MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.popOver;
+ this._galleryView.actionOptions = node.actionOptions || null;
+ this._galleryView.invokeHelperFactory = node.invokeHelperFactory || null;
+ this._updateEmptyModel();
+ this._galleryView.itemTemplate = node.template;
+ this._galleryView.zoomedOutTemplate = node.zoomedOutTemplate;
+ this._galleryView.actionTemplate = node.actionTemplate;
+ this._galleryView.itemClass = node.itemClass || null;
+ this._galleryView.headerClass = node.headerClass || null;
+ this._galleryView.layout = node.layout || MS.Entertainment.UI.Controls.GalleryControl.Layout.grid;
+ this._galleryView.tap = node.tap || MS.Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly;
+ this._galleryView.headerPosition = node.groupHeaderPosition || null;
+ this._galleryView.forceInteractive = node.forceInteractive || false;
+ this._galleryView.grouperItemThreshold = node.grouperItemThreshold;
+ this._updateMinimumListLength();
+ this._galleryView.userGatedGallery = node.userGatedGallery || false;
+ this._galleryView.userGatedGalleryTemplate = node.userGatedGalleryTemplate || "Controls/GalleryControl.html#listViewEmptyGalleryWithNotificationsTemplate";
+ this._updateUserGatedModel();
+ this._galleryView.syncScreen = node.syncScreen || false;
+ this._galleryView.syncScreenTemplate = node.syncScreenTemplate || null;
+ this._updateSyncScreenModel();
+ this._galleryView.restoreFocusOnDataChanges = node.restoreFocusOnDataChanges || false;
+ this._galleryView.backdropColor = node.backdropColor;
+ this._galleryView.selectionHelperOptions = node.selectionHelperOptions || null;
+ this._galleryView.allowSelectAll = node.allowSelectAll || false;
+ this._galleryView.allowHeaders = node.allowHeaders === undefined ? true : node.allowHeaders;
+ this._galleryView.allowZoom = node.allowZoom || false;
+ this._galleryView.maxSelectionCount = node.maxSelectionCount;
+ if (!this._galleryView.mediaContext)
+ this._galleryView.mediaContext = this._appBarService.pushDefaultContext();
+ var clonedQuery = this._viewModel.cloneCurrentQuery();
+ if (clonedQuery)
+ clonedQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.playAll);
+ this._galleryView.mediaContext.containingMedia = {
+ playbackItemSource: clonedQuery, playbackOffset: 0
+ };
+ var collectionFilter = this._getCollectionFilter();
+ this._galleryView.mediaContext.collectionFilter = collectionFilter;
+ this._galleryView.mediaContext.setToolbarActions(node.getAppBarActions ? node.getAppBarActions() : []);
+ if (node.grouped || (node.grouperType && node.allowZoom)) {
+ this._galleryView.grouperType = node.grouperType;
+ this._galleryView.grouper.keyPropertyName = node.grouperField;
+ this._galleryView.grouper.parentKeyPropertyName = node.grouperParentKeyPropertyName;
+ this._galleryView.grouper.titlePropertyName = node.grouperTitlePropertyName;
+ this._galleryView.grouper.useKeyAsData = (node.grouperKeyAsData !== undefined) ? node.grouperKeyAsData : true
+ }
+ else
+ this._galleryView.grouperType = null;
+ if (this._currentGalleryClass) {
+ WinJS.Utilities.removeClass(this._galleryView.domElement, this._currentGalleryClass);
+ this._currentGalleryClass = String.empty
+ }
+ if (node.galleryClass) {
+ WinJS.Utilities.addClass(this._galleryView.domElement, node.galleryClass);
+ this._currentGalleryClass = node.galleryClass
+ }
+ this._galleryView.queryToPause = this._viewModel.pausableQuery;
+ this._galleryView.dataSource = this._viewModel.items;
+ if (collectionFilter && collectionFilter !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ WinJS.Utilities.addClass(this._galleryView.domElement, "collectionFiltered");
+ else
+ WinJS.Utilities.removeClass(this._galleryView.domElement, "collectionFiltered");
+ this._selectedSong = null;
+ this._inPlacePanelAnimating = false
+ }, _getCollectionFilter: function _getCollectionFilter() {
+ var collectionFilter;
+ var selectedFilter;
+ if (this._viewModel && this._viewModel.filterSelectionManager)
+ selectedFilter = WinJS.Binding.unwrap(this._viewModel.filterSelectionManager.selectedItem);
+ if (selectedFilter && selectedFilter.value && selectedFilter.value.queryOptions)
+ collectionFilter = selectedFilter.value.queryOptions.mediaAvailability;
+ return collectionFilter
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged() {
+ if (this._uiStateBindings)
+ this._updateEmptyModel()
+ }, _onNotificationsChanged: function _onNotificationsChanged() {
+ if (this._viewModelEvents) {
+ this._updateMinimumListLength();
+ this._updateEmptyModel()
+ }
+ }, _updateMinimumListLength: function _updateMinimumListLength() {
+ var notifications = this._viewModel.createNotificationActionCells ? this._viewModel.createNotificationActionCells() : null;
+ var numNotifications = (notifications && notifications.length) || 0;
+ this._galleryView.minimumListLength = numNotifications + this._viewModel.selectedTemplate.minimumListLength
+ }, _updateEmptyModel: function _updateEmptyModel() {
+ if (!this._viewModel.items || !this._viewModel.isCurrentQuery())
+ return;
+ var titleId;
+ var descriptionId;
+ var details;
+ switch (this._viewModel._view) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists:
+ titleId = String.id.IDS_PLAYLIST_NO_CONTENT_TITLE;
+ details = this._getEmptyPlaylistCollectionDetails();
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.smartDJs:
+ titleId = String.id.IDS_RADIO_EMPTY_GALLERY_TITLE;
+ details = MS.Entertainment.Pages.MusicCollection.getEmptySmartDJCollectionDetails();
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ titleId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_EMPTY_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_EMPTY_DESC;
+ details = this._getEmptyPlaylistCollectionDetails();
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.musicVideos:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_MUSIC_VIDEOS_EMPTY_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_COLLECTION_MUSIC_VIDEOS_EMPTY_DESC;
+ details = this._getEmptyCollectionDetails();
+ break;
+ default:
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ titleId = String.id.IDS_COLLECTION_MUSIC_EMPTY;
+ else {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled))
+ switch (this._viewModel._lastUsedFilterItem.id) {
+ case MS.Entertainment.ViewModels.MusicCollectionAutomationIds.collectionFilterAll:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_EMPTY_TITLE_CLOUDV2_ALL;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollectionAutomationIds.collectionFilterRoamsViaCloud:
+ titleId = String.id.IDS_COLLECTION_MUSIC_EMPTY;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollectionAutomationIds.collectionFilterRoamsViaCloudDrive:
+ default:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_EMPTY_TITLE_CLOUDV2;
+ break
+ }
+ else
+ titleId = String.id.IDS_MUSIC2_COLLECTION_EMPTY_TITLE
+ }
+ descriptionId = MS.Entertainment.Utilities.isMusicApp1 ? null : String.id.IDS_MUSIC2_COLLECTION_EMPTY_DESC;
+ details = this._getEmptyCollectionDetails();
+ break
+ }
+ var filter = this._getCollectionFilter();
+ if (filter && filter !== Microsoft.Entertainment.Platform.MediaAvailability.available)
+ details = details.concat(this._getEmptyFilteredDetails());
+ var notifications = this._viewModel.createNotificationActionCells ? this._viewModel.createNotificationActionCells() : null;
+ if (this._galleryView && this._galleryView.emptyGalleryModel) {
+ this._galleryView.emptyGalleryModel.primaryStringId = titleId;
+ this._galleryView.emptyGalleryModel.secondaryStringId = descriptionId;
+ this._galleryView.emptyGalleryModel.details = details;
+ this._galleryView.emptyGalleryModel.notifications = notifications
+ }
+ }, _getEmptyCollectionDetails: function _getEmptyCollectionDetails() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var details = [];
+ var filter = this._getCollectionFilter();
+ if (MS.Entertainment.Utilities.isMusicApp1 && filter !== Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloud) {
+ var onMoreAboutLibrariesAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showLocalGrovelInfoDialog);
+ details = [{
+ stringId: String.id.IDS_COLLECTION_MUSIC_EMPTY_2, linkStringId: String.id.IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK, linkAction: onMoreAboutLibrariesAction, linkIcon: MS.Entertainment.UI.Icon.search
+ }]
+ }
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ var navigateToMusicMarketplace = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateToMusicMarketplace.parameter = MS.Entertainment.UI.Monikers.musicMarketplace;
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ details.push({
+ stringId: String.id.IDS_MUSIC_COLLECTION_EMPTY_DESC, linkStringId: String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK, linkAction: navigateToMusicMarketplace, linkIcon: MS.Entertainment.UI.Icon.flexhub
+ });
+ else {
+ details.push({
+ linkStringId: String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_GUI, linkAction: navigateToMusicMarketplace, linkIcon: MS.Entertainment.UI.Icon.flexhub, voicePhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_CONF)
+ });
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled)) {
+ var learnMoreAction = new MS.Entertainment.UI.Actions.Action;
+ learnMoreAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardHomeUpsellPanelLearnMore;
+ learnMoreAction.canExecute = function canExecute(params) {
+ return true
+ };
+ learnMoreAction.executed = function executed() {
+ var cloudCollectionV2Url = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_CloudCollectionV2);
+ Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(cloudCollectionV2Url))
+ };
+ details.push({
+ linkStringId: String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_GUI, linkAction: learnMoreAction, linkIcon: MS.Entertainment.UI.Icon.flexhub, voicePhrase: String.load(String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_CLOUDV2_INFO_BUTTON_VUI_CONF)
+ })
+ }
+ }
+ }
+ return details
+ }, _getEmptyPlaylistCollectionDetails: function _getEmptyPlaylistCollectionDetails() {
+ var details = [];
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var createPlaylistAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.createPlaylist);
+ createPlaylistAction.automationId = MS.Entertainment.UI.AutomationIds.collectionCreatePlaylist;
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ details.push({
+ stringId: String.id.IDS_PLAYLIST_CREATE_PLAYLIST_DESC_TEXT, linkStringId: String.id.IDS_PLAYLIST_CREATE_PLAYLIST_LINK, linkAction: createPlaylistAction, linkIcon: WinJS.UI.AppBarIcon.add
+ });
+ var importPlaylistsAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.importPlaylists);
+ importPlaylistsAction.automationId = MS.Entertainment.UI.AutomationIds.collectionImportPlaylist;
+ details.push({
+ stringId: String.id.IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_DESC_TEXT, linkStringId: String.id.IDS_PLAYLIST_IMPORT_EXISTING_PLAYLIST_LINK, linkAction: importPlaylistsAction, linkIcon: WinJS.UI.AppBarIcon.importall
+ })
+ }
+ else {
+ details.push({
+ linkStringId: String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_GUI, linkAction: createPlaylistAction, linkIcon: WinJS.UI.AppBarIcon.add, voicePhrase: String.load(String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_PLAYLIST_GALLERY_ACTION_BUTTON_VUI_CONF)
+ });
+ var navigateToMusicMarketplace = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateToMusicMarketplace.parameter = MS.Entertainment.UI.Monikers.musicMarketplace;
+ details.push({
+ linkStringId: String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_GUI, linkAction: navigateToMusicMarketplace, linkIcon: MS.Entertainment.UI.Icon.flexhub, voicePhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_BROWSE_CATALOG_BUTTON_VUI_CONF)
+ })
+ }
+ return details
+ }, _getEmptyFilteredDetails: function _getEmptyFilteredDetails() {
+ var clearFilterAction = new MS.Entertainment.UI.Actions.Action;
+ clearFilterAction.automationId = MS.Entertainment.UI.AutomationIds.collectionEmptyShowAllMusicLink;
+ clearFilterAction.canExecute = function canExecute() {
+ return true
+ };
+ clearFilterAction.executed = function executed() {
+ if (this._viewModel && this._viewModel.clearFilter)
+ this._viewModel.clearFilter()
+ }.bind(this);
+ return [{
+ stringId: String.id.IDS_COLLECTION_FILTER_MUSIC_EMPTY_TEXT, linkStringId: String.id.IDS_COLLECTION_FILTER_MUSIC_EMPTY_LINK, linkAction: clearFilterAction, linkIcon: WinJS.UI.AppBarIcon.filter
+ }]
+ }, _updateUserGatedModel: function _updateUserGatedModel() {
+ if (this._galleryView && this._galleryView.userGatedGallery) {
+ var titleId;
+ var descriptionId;
+ var details;
+ switch (this._viewModel._view) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ titleId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_EMPTY_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_PLAYLISTS_GALLERY_GATED_DESC;
+ details = this._getUserGatedMusic2PlaylistCollectionDetails();
+ this._galleryView.userGatedGalleryModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.newlyAdded:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.musicVideos:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_GATED_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_COLLECTION_GATED_DESC;
+ details = this._getUserGatedMusic2CollectionDetails();
+ this._galleryView.userGatedGalleryModel = new MS.Entertainment.UI.Controls.FailedPanelWithQueryModel;
+ this._galleryView.userGatedGalleryModel.query = this._createRecentAlbumsQuery();
+ this._galleryView.userGatedGalleryModel.itemTemplate = "/Components/Shell/Music2WelcomeDialog.html#welcomeDialogAlbumTemplate";
+ break;
+ default:
+ MS.Entertainment.Pages.fail("Unsupported user gated view: " + this._viewModel._view);
+ break
+ }
+ this._galleryView.userGatedGalleryModel.primaryStringId = titleId;
+ this._galleryView.userGatedGalleryModel.secondaryStringId = descriptionId;
+ this._galleryView.userGatedGalleryModel.details = details;
+ this._galleryView.userGatedGalleryModel.className = MS.Entertainment.Pages.MusicCollection.userGatedClass
+ }
+ }, _updateSyncScreenModel: function _updateSyncScreenModel() {
+ if (this._galleryView && this._galleryView.syncScreen) {
+ var titleId;
+ var descriptionId;
+ var action;
+ switch (this._viewModel._view) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ titleId = String.id.IDS_MUSIC2_PLAYLISTS_SYNC_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_PLAYLISTS_SYNC_DESC;
+ action = this._createSyncWaitAction(this._viewModel._view);
+ this._galleryView.syncScreenModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.newlyAdded:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.albums2:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.artists2:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.musicVideos:
+ titleId = String.id.IDS_MUSIC2_COLLECTION_SYNC_TITLE;
+ descriptionId = String.id.IDS_MUSIC2_COLLECTION_SYNC_DESC;
+ action = this._createSyncWaitAction(this._viewModel._view);
+ this._galleryView.syncScreenModel = new MS.Entertainment.UI.Controls.FailedPanelWithQueryModel;
+ this._galleryView.syncScreenModel.query = this._createRecentAlbumsQuery();
+ this._galleryView.syncScreenModel.itemTemplate = "/Components/Shell/Music2WelcomeDialog.html#welcomeDialogAlbumTemplate";
+ break;
+ default:
+ MS.Entertainment.Pages.fail("Unsupported playlist/collection syncing view: " + this._viewModel._view);
+ break
+ }
+ this._galleryView.syncScreenModel.primaryStringId = titleId;
+ this._galleryView.syncScreenModel.secondaryStringId = descriptionId;
+ this._galleryView.syncScreenModel.details = null;
+ this._galleryView.syncScreenModel.action = action;
+ this._galleryView.syncScreenModel.showLoadingRing = true;
+ this._galleryView.syncScreenModel.className = MS.Entertainment.Pages.MusicCollection.syncScreenClass
+ }
+ }, _createRecentAlbumsQuery: function _createRecentAlbumsQuery() {
+ var albumsQuery = new MS.Entertainment.Data.Query.Music.RecentList;
+ return {getItems: function getItems() {
+ return albumsQuery.execute().then(function gotRecentAlbums(q) {
+ var albums = q && q.result && q.result.itemsArray.filter(function imageFilter(item) {
+ return item.mediaType === Microsoft.Entertainment.Queries.ObjectType.album && !!item.imageResizeUri
+ });
+ if (albums.length >= MS.Entertainment.Pages.MusicCollection.recentAlbumsToDisplay)
+ return WinJS.Promise.wrap(albums.slice(0, MS.Entertainment.Pages.MusicCollection.recentAlbumsToDisplay));
+ return WinJS.Promise.wrap()
+ }.bind(this), function onError(error) {
+ MS.Entertainment.Music.fail("Failed to complete albums query: " + error && error.message);
+ return WinJS.Promise.wrapError(error)
+ })
+ }}
+ }, _getUserGatedMusic2CollectionDetails: function _getUserGatedMusic2CollectionDetails() {
+ return [{
+ linkStringId: String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_GUI, linkAction: this._createDismissAction(MS.Entertainment.Utilities.UserConfigurationValues.collectionDialogXuids), linkIcon: WinJS.UI.AppBarIcon.filter, voicePhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_CONF)
+ }]
+ }, _getUserGatedMusic2PlaylistCollectionDetails: function _getUserGatedMusic2PlaylistCollectionDetails() {
+ return [{
+ linkStringId: String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_GUI, linkAction: this._createDismissAction(MS.Entertainment.Utilities.UserConfigurationValues.playlistDialogXuids), linkIcon: WinJS.UI.AppBarIcon.filter, voicePhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_ALM), voicePhoneticPhrase: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_PRON), voiceConfidence: String.load(String.id.IDS_MUSIC2_CONTINUE_BUTTON_DESC_VUI_CONF)
+ }]
+ }, _createDismissAction: function _createDismissAction(configurationValue) {
+ var dismissAction = new MS.Entertainment.UI.Actions.Action;
+ dismissAction.automationId = MS.Entertainment.UI.AutomationIds.collectionEmptyShowAllMusicLink;
+ dismissAction.canExecute = function canExecute() {
+ return true
+ };
+ dismissAction.executed = function executed() {
+ MS.Entertainment.Utilities.setUserConfigurationValue(configurationValue, true);
+ if (this._galleryView.syncScreen && this._viewModel.selectedTemplate.syncScreen) {
+ this._galleryView.userGatedGalleryModel.updateProperty("primaryStringId", this._galleryView.syncScreenModel.primaryStringId);
+ this._galleryView.userGatedGalleryModel.updateProperty("secondaryStringId", this._galleryView.syncScreenModel.secondaryStringId);
+ this._galleryView.userGatedGalleryModel.updateProperty("details", this._galleryView.syncScreenModel.details);
+ this._galleryView.userGatedGalleryModel.updateProperty("showLoadingRing", this._galleryView.syncScreenModel.showLoadingRing);
+ this._galleryView.userGatedGalleryModel.updateProperty("className", this._galleryView.syncScreenModel.className);
+ if (this._galleryView.syncScreenModel)
+ this._galleryView.syncScreenModel.action.execute()
+ }
+ else
+ this._viewModel.refresh()
+ }.bind(this);
+ return dismissAction
+ }, _setSyncScreenDisplayed: function _setSyncScreenDisplayed(viewType) {
+ if (!viewType)
+ MS.Entertainment.fail();
+ var userConfigurationValue = null;
+ switch (viewType) {
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.playlists2:
+ userConfigurationValue = MS.Entertainment.Utilities.UserConfigurationValues.playlistSyncScreenDismissed;
+ break;
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.newlyAdded:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.albums2:
+ case MS.Entertainment.ViewModels.MusicCollection.ViewTypes.artists2:
+ userConfigurationValue = MS.Entertainment.Utilities.UserConfigurationValues.albumArtistSyncScreenDismissed;
+ break;
+ default:
+ MS.Entertainment.Pages.fail("_setSyncScreenDisplayed: Invalid viewType defined " + viewType);
+ return
+ }
+ MS.Entertainment.Utilities.setUserConfigurationValue(userConfigurationValue, true)
+ }, _createSyncWaitAction: function _createSyncWaitAction(viewType) {
+ var syncWaitAction = new MS.Entertainment.UI.Actions.Action;
+ syncWaitAction.automationId = MS.Entertainment.UI.AutomationIds.collectionEmptyShowAllMusicLink;
+ syncWaitAction.canExecute = function canExecute() {
+ return true
+ };
+ syncWaitAction.executed = function executed() {
+ if (this._viewModel.pausableQuery)
+ this._viewModel.pausableQuery.unpause();
+ var canDismissSync = new WinJS.Promise(function waitToDismissSync(complete) {
+ var viewModelBinding;
+ var dismissSyncIfReady = function dismissSyncIfReady() {
+ if (this._viewModel.totalCount >= 1 || !this._viewModel.selectedTemplate.syncScreen) {
+ this._setSyncScreenDisplayed(viewType);
+ complete();
+ if (viewModelBinding) {
+ viewModelBinding.cancel();
+ viewModelBinding = null
+ }
+ }
+ }.bind(this);
+ viewModelBinding = WinJS.Binding.bind(this._viewModel, {
+ totalCountString: dismissSyncIfReady, selectedTemplate: {syncScreen: dismissSyncIfReady}
+ })
+ }.bind(this));
+ var dismissSyncPromise = WinJS.Promise.join([WinJS.Promise.timeout(MS.Entertainment.Pages.MusicCollection.SYNC_SCREEN_WAIT_TIME_MS), canDismissSync]);
+ WinJS.Promise.as(dismissSyncPromise).done(function refreshViewModel() {
+ this._viewModel.refresh()
+ }.bind(this))
+ }.bind(this);
+ return syncWaitAction
+ }, _songClicked: function songClicked(event) {
+ if (!this._inPlacePanelAnimating) {
+ var element = this._galleryView.getElementAtIndex(event.detail.itemIndex, true);
+ var item = element.querySelector("[data-win-control], .ent-control").winControl;
+ this._handlePanelClick(element, item, event.detail.itemIndex)
+ }
+ }, _inPlacePanelClick: function inPlacePanelClick(event) {
+ if (event.srcElement.type !== "button" && !this._inPlacePanelAnimating) {
+ var element = MS.Entertainment.Utilities.findParentElementByClassName(event.srcElement, "win-item");
+ var item = element.querySelector("[data-win-control], .ent-control").winControl;
+ this._handlePanelClick(element, item)
+ }
+ }, _handlePanelClick: function handlePanelClick(element, item, itemIndex) {
+ var promises = [];
+ this._inPlacePanelAnimating = true;
+ if (element === this._selectedSong) {
+ item.domElement.removeEventListener("click", item.panelClickHandler);
+ promises.push(item.collapse(this._selectedSong));
+ this._selectedSong = null
+ }
+ else if (item) {
+ if (this._selectedSong) {
+ var control = this._selectedSong.querySelector("[data-win-control], .ent-control");
+ if (control && control.winControl) {
+ var oldItem = control.winControl;
+ oldItem.domElement.removeEventListener("click", oldItem.panelClickHandler);
+ if (oldItem.isSelected)
+ promises.push(oldItem.collapse(this._selectedSong))
+ }
+ }
+ this._galleryView.ensureVisible(itemIndex);
+ WinJS.Promise.timeout().then(function() {
+ item.panelClickHandler = this._inPlacePanelClick.bind(this);
+ item.domElement.addEventListener("click", item.panelClickHandler, false)
+ }.bind(this));
+ promises.push(item.expand(element));
+ this._selectedSong = element
+ }
+ WinJS.Promise.join(promises).then(function doneAnimating() {
+ this._inPlacePanelAnimating = false
+ }.bind(this))
+ }, _removeItemCompleted: function _removeItemCompleted(eventArgs) {
+ var removed = eventArgs.detail && eventArgs.detail.deleted;
+ var removedItem = eventArgs.detail && eventArgs.detail.removedItem;
+ if (removed) {
+ this._clearSelection();
+ if (this._viewModel) {
+ if (this._viewModel.removeItemCompleted)
+ this._viewModel.removeItemCompleted(removedItem);
+ if (this._viewModel.pausableQuery && this._viewModel.pausableQuery.forceLiveRefresh)
+ this._viewModel.pausableQuery.forceLiveRefresh()
+ }
+ }
+ }, _updateGallery: function _updateGallery() {
+ this._clearSelection();
+ if (this._viewModel && this._viewModel.updateQuery)
+ this._viewModel.updateQuery()
+ }, _clearSelection: function _clearSelection() {
+ this._galleryView.clearSelection()
+ }, showingDialog: false
+ }, {dataContext: null}, {
+ getEmptySmartDJCollectionDetails: function _getEmptySmartDJCollectionDetails(completeAction) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var playSmartDJAction;
+ var details;
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ playSmartDJAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.selectArtist);
+ playSmartDJAction.automationId = MS.Entertainment.UI.AutomationIds.appBarPlaySmartDJ;
+ playSmartDJAction.parameter = {
+ isSmartDJ: true, successCallback: completeAction
+ };
+ details = [{
+ linkStringId: String.id.IDS_SMARTDJ_PAGE_CREATE_SMARTDJ_ACTION, linkAction: playSmartDJAction, linkIcon: MS.Entertainment.UI.Icon.smartDj, linkIconPressed: MS.Entertainment.UI.Icon.smartDjPressed, linkHideDefaultRing: true
+ }]
+ }
+ else {
+ playSmartDJAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.searchArtist);
+ playSmartDJAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardSmartDJSearchArtist;
+ playSmartDJAction.parameter = {
+ hasSmartDJ: true, galleryClass: "smartDjActionGallery"
+ };
+ details = [{
+ linkStringId: String.id.IDS_MUSIC2_RADIO_START_PANEL_VUI_GUI, linkAction: playSmartDJAction, linkIcon: MS.Entertainment.UI.Icon.smartDj, linkIconPressed: MS.Entertainment.UI.Icon.smartDjPressed, linkHideDefaultRing: true
+ }]
+ }
+ return details
+ }, userGatedClass: "userGatedGallery", recentAlbumsToDisplay: 6, SYNC_SCREEN_WAIT_TIME_MS: 6000
+ }), MusicCollectionGalleryItemTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryTemplateSelector", function galleryTemplateSelector() {
+ MS.Entertainment.UI.Controls.TemplateSelectorBase.prototype.constructor.call(this);
+ this.notificationDefaultTemplate = "Components/Music/MusicCollectionTemplates.html#verticalNotificationActionTemplate"
+ }, {
+ notificationDefaultTemplate: {
+ get: function() {
+ return this.getTemplate(MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector.templateType.notificationDefault)
+ }, set: function(value) {
+ this.addTemplate(MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector.templateType.notificationDefault, value)
+ }
+ }, onSelectTemplate: function onSelectTemplate(item) {
+ if (item && item.data && item.data.isNotification)
+ return this.getTemplateProvider(MS.Entertainment.Pages.MusicCollectionGalleryItemTemplateSelector.templateType.notificationDefault);
+ else
+ return MS.Entertainment.UI.Controls.GalleryTemplateSelector.prototype.onSelectTemplate.apply(this, arguments)
+ }
+ }, {templateType: {notificationDefault: "notificationDefault"}})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Music/MusicPageHost.html b/packages/microsoft.zunevideo/Components/Music/MusicPageHost.html
new file mode 100644
index 00000000..48ced80f
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Music/MusicPageHost.html
@@ -0,0 +1,30 @@
+
+
+
+
+ Music Pages Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Music/MusicPages.js b/packages/microsoft.zunevideo/Components/Music/MusicPages.js
new file mode 100644
index 00000000..1509cee9
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Music/MusicPages.js
@@ -0,0 +1,610 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js", "/Framework/selectionManager.js", "/Controls/pivotControls.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Music", {MusicPage: MS.Entertainment.UI.Framework.defineUserControl(null, function MusicPage(element, options) {
+ var appbar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appbar && appbar.suspendActionListChanges)
+ appbar.suspendActionListChanges();
+ this._resetPage();
+ this._hubsSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(null, 0);
+ var container = element.querySelector("[data-ent-member='_container']");
+ WinJS.UI.processAll(container).done(function() {
+ WinJS.Binding.processAll(container, this)
+ }.bind(this))
+ }, {
+ processChildren: true, controlName: "MusicPages", _hubsSelectionManager: null, _pivotsSourcePath: null, _modifierSourcePath: null, _page: null, _complexBindings: null, _eventHandlers: null, _loadedHub: null, _initialized: false, _pageReadyOnce: false, _pageLoadedOnce: false, _title: null, _loadedOnce: false, _isFailed: false, _isLoading: true, _signedInUserBindings: null, _uiStateBindings: null, _uiStateEventHandlers: null, _itemControlAppBarSelection: null, _lastChangeWasNavigate: true, title: {
+ get: function() {
+ return this._title
+ }, set: function(value) {
+ if (value !== this._title) {
+ var oldValue = this._title;
+ this._title = value;
+ this.notify("title", value, oldValue);
+ if (this._initialized && !this._unloaded)
+ this._titleContainer.textContent = value
+ }
+ }
+ }, loadedOnce: {
+ get: function() {
+ return this._loadedOnce
+ }, set: function(value) {
+ if (value !== this._title) {
+ var oldValue = this._loadedOnce;
+ this._loadedOnce = value;
+ this.notify("loadedOnce", value, oldValue);
+ if (this._initialized && !this._unloaded)
+ this._bodyContainer.visibility = value
+ }
+ }
+ }, isFailed: {
+ get: function() {
+ return this._isFailed
+ }, set: function(value) {
+ if (value !== this._isFailed) {
+ var oldValue = this._isFailed;
+ this._isFailed = value;
+ this.notify("isFailed", value, oldValue);
+ this._isFailedChanged(value, oldValue)
+ }
+ }
+ }, isLoading: {
+ get: function() {
+ return this._isLoading
+ }, set: function(value) {
+ if (value !== this._isLoading) {
+ var oldValue = this._isLoading;
+ this._isLoading = value;
+ this.notify("isLoading", value, oldValue);
+ this._isLoadingChanged(value, oldValue)
+ }
+ }
+ }, currentHub: {get: function() {
+ return (this._hubsSelectionManager && this._hubsSelectionManager.selectedItem) ? this._hubsSelectionManager.selectedItem : MS.Entertainment.Music.MusicHub.empty
+ }}, isCurrentHubEmpty: {get: function() {
+ return MS.Entertainment.Music.MusicHub.isEmpty(this.currentHub)
+ }}, currentHubId: {get: function() {
+ return this.currentHub.id
+ }}, pivotsUsePanels: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.pivotsUsePanels : false
+ }}, modifiersUsePanels: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.modifiersUsePanels : false
+ }}, hideLoadingPanel: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.hideLoadingPanel : false
+ }}, hideNavigationContainer: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.hideNavigationContainer : false
+ }}, hideSidebar: {get: function() {
+ return (this.currentHub.dataContext) ? this.currentHub.dataContext.hideSidebar : false
+ }}, hidePivotsOnFailed: {get: function() {
+ return (this.currentHub.dataContext && this.currentHub.dataContext.hidePivotsOnFailed !== undefined) ? this.currentHub.dataContext.hidePivotsOnFailed : true
+ }}, initialize: function initialize() {
+ window.msWriteProfilerMark("ent:MusicPage.Initialized");
+ if (this._unloaded)
+ return;
+ this._eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._hubsSelectionManager, {selectedItemChanged: this._onSelectionChanged.bind(this)});
+ this._onSelectionChanged();
+ MS.Entertainment.Framework.AccUtils.createAriaLinkId(this.hubContainer);
+ if (this._pivotControl)
+ this._pivotControl.setTabPanelId(this.hubContainer.id);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var musicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (!musicMarketplaceEnabled)
+ WinJS.Utilities.addClass(this.domElement, "marketplaceDisabled");
+ this._initialized = true;
+ if (this.dataContext && this.dataContext.pageIsFlexHub)
+ if (this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel)
+ this.currentHub.dataContext.viewModel.queryTitleCallback = this._setPageTitleCallBack.bind(this);
+ if (this._titleContainer)
+ this._titleContainer.textContent = this.title;
+ if (this._bodyContainer)
+ this._bodyContainer.visibility = this.loadedOnce;
+ this._isLoadingChanged(this.isLoading);
+ this._isFailedChanged(this.isFailed)
+ }, _setPageTitleCallBack: function _setPageTitleCallBack(title) {
+ this.title = title
+ }, unload: function unload() {
+ this._resetPage();
+ this._uninitializeSidebar();
+ if (this._signedInUserBindings) {
+ this._signedInUserBindings.cancel();
+ this._signedInUserBindings = null
+ }
+ if (this._hubsSelectionManager && this._hubsSelectionManager.dataSource)
+ this._hubsSelectionManager.dataSource.forEach(function(item) {
+ item.dispose()
+ });
+ if (this._hubsSelectionManager) {
+ this._hubsSelectionManager.dispose();
+ this._hubsSelectionManager = null
+ }
+ if (this._complexBindings) {
+ this._complexBindings.cancel();
+ this._complexBindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ if (this._loadedHub && this._loadedHub.dispose) {
+ this._loadedHub.dispose();
+ this._loadedHub = null
+ }
+ if (this.dataContext) {
+ if (this.dataContext.viewModel && this.dataContext.viewModel.dispose)
+ this.dataContext.viewModel.dispose();
+ this.dataContext = null
+ }
+ if (this._itemControlAppBarSelection) {
+ this._itemControlAppBarSelection.dispose();
+ this._itemControlAppBarSelection = null
+ }
+ this._page = null;
+ this.modifierDescriptionFormatter = null;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, handlePanelReady: function handlePanelReady(event) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (event.failed || (!event.failed && this.isFailed)) {
+ this.failedModel = event.model;
+ this.isFailed = event.failed
+ }
+ event.panelId = this.currentHubId;
+ this.isLoading = false;
+ eventProvider.tracePanel_Ready(this.currentHubId || "");
+ eventProvider.traceHub_Ready(this.currentHubId || "");
+ this._invokePageReadyOnce()
+ }, handlePanelReset: function handlePanelReset() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (!this.isLoading) {
+ this.failedModel = null;
+ this.isFailed = false;
+ this.isLoading = true;
+ eventProvider.tracePanel_Load_Start(this.currentHubId || "");
+ eventProvider.traceHub_Load_Start(this.currentHubId || "")
+ }
+ }, handleGalleryFirstPage: function handleGalleryFirstPage() {
+ WinJS.Promise.timeout().then(function musicPageResumeActionListChanges() {
+ window.msWriteProfilerMark("ent:MusicPages.ResumeActionListChanges");
+ var appbar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appbar && appbar.resumeActionListChanges)
+ appbar.resumeActionListChanges()
+ })
+ }, onNavigateTo: function onNavigateTo(page, hub, panel) {
+ var pageDataContext;
+ var modifierSelectionManager;
+ var pivotSelectionManager;
+ var dataContext;
+ window.msWriteProfilerMark("ent:MusicPage.NavigateTo");
+ this._lastChangeWasNavigate = true;
+ if (this.id !== page.iaNode.moniker) {
+ dataContext = page.getDataContext();
+ this.id = page.iaNode.moniker;
+ this._resetPage();
+ this._page = page;
+ this._changeHubSelection(page, hub, dataContext);
+ this.title = page.title;
+ this.dataContext = dataContext;
+ this._invokePageLoadStart()
+ }
+ else if (this._hubsSelectionManager.selectedItem.id !== hub.iaNode.moniker)
+ this._changeHubSelection(page, hub);
+ if (this.dataContext && this.dataContext.pageIsFlexHub)
+ this.hidePivots = true
+ }, _changeHubSelection: function _changeHubSelection(page, hub, dataContext) {
+ this._hubsSelectionManager.dataSource = null;
+ this._hubsSelectionManager.settingsKey = (dataContext && dataContext.preventHubSelectionSave) ? null : this.id + "_viewSelection";
+ this._hubsSelectionManager.dataSource = this._mapHubs(this._page.hubs);
+ if (hub && this._hubsSelectionManager.dataSource && page.options && page.options.selectHub)
+ for (var hubIndex = 0; hubIndex < this._hubsSelectionManager.dataSource.length; hubIndex++)
+ if (hub.iaNode.moniker === this._hubsSelectionManager.dataSource[hubIndex].id) {
+ this._hubsSelectionManager.selectedIndex = hubIndex;
+ break
+ }
+ this._startViewModelQuery()
+ }, _startViewModelQuery: function _startViewModelQuery() {
+ if (this.currentHub.dataContext.viewModel && this.currentHub.dataContext.viewModel.begin)
+ this.currentHub.dataContext.viewModel.begin()
+ }, _setIsFailed: function _setIsFailed(newValue) {
+ this.isFailed = newValue
+ }, _isFailedChanged: function _isFailedChanged(value, oldValue) {
+ if (this._initialized && !this._unloaded)
+ if (value) {
+ WinJS.Utilities.addClass(this.loadingControl, "removeFromDisplay");
+ MS.Entertainment.Utilities.hideElement(this.hubContainer);
+ MS.Entertainment.Utilities.showElement(this.failedControl);
+ var newControl = document.createElement("div");
+ newControl.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.FailedPanel");
+ this.failedControl.appendChild(newControl);
+ WinJS.UI.process(newControl).then(function setModel() {
+ newControl.winControl.model = this.failedModel
+ }.bind(this));
+ if (this.panelAction) {
+ var panelAction = WinJS.Binding.unwrap(this.panelAction);
+ if (panelAction && panelAction.action)
+ panelAction.action.isEnabled = false
+ }
+ if (this.hidePivotsOnFailed) {
+ WinJS.Utilities.addClass(this._modifierControl.domElement, "removeFromDisplayOnError");
+ if (this._secondaryModifierControl)
+ WinJS.Utilities.addClass(this._secondaryModifierControl.domElement, "removeFromDisplayOnError");
+ if (this._filterControl)
+ WinJS.Utilities.addClass(this._filterControl.domElement, "removeFromDisplayOnError");
+ WinJS.Utilities.addClass(this._pivotControl.domElement, "removeFromDisplayOnError")
+ }
+ }
+ else {
+ MS.Entertainment.Utilities.hideElement(this.failedControl);
+ if (oldValue) {
+ MS.Entertainment.Utilities.showElement(this.hubContainer);
+ WinJS.Utilities.addClass(this.loadingControl, "removeFromDisplay")
+ }
+ WinJS.Utilities.removeClass(this._modifierControl.domElement, "removeFromDisplayOnError");
+ if (this._secondaryModifierControl)
+ WinJS.Utilities.removeClass(this._secondaryModifierControl.domElement, "removeFromDisplayOnError");
+ if (this._filterControl)
+ WinJS.Utilities.removeClass(this._filterControl.domElement, "removeFromDisplayOnError");
+ WinJS.Utilities.removeClass(this._pivotControl.domElement, "removeFromDisplayOnError")
+ }
+ }, _isLoadingChanged: function _isLoadingChanged(value, oldValue) {
+ if (this._initialized && !this._unloaded)
+ if (!value || this.hideLoadingPanel) {
+ WinJS.Utilities.addClass(this.loadingControl, "removeFromDisplay");
+ if (!this.isFailed)
+ MS.Entertainment.Utilities.showElement(this.hubContainer);
+ MS.Entertainment.Utilities.empty(this.loadingControl)
+ }
+ else {
+ MS.Entertainment.Utilities.hideElement(this.hubContainer);
+ WinJS.Utilities.removeClass(this.loadingControl, "removeFromDisplay");
+ var ring = document.createElement("progress");
+ ring.className = "win-medium win-ring galleryProgress";
+ this.loadingControl.appendChild(ring)
+ }
+ }, _minModifierItemsChanged: function _minModifierItemsChanged(newValue, oldValue) {
+ if (this._initialized && !this._unloaded)
+ this._modifierControl.minItems = newValue
+ }, _modifierDescriptionChanged: function _modifierDescriptionChanged(newValue, oldValue) {
+ if (this._initialized && !this._unloaded)
+ if (this._filterControl && this._filterControl.items) {
+ this._filterControl.descriptionLabelText = newValue;
+ this._modifierControl.descriptionLabelText = String.load(String.id.IDS_FILTER_SORTED_BY)
+ }
+ else
+ this._modifierControl.descriptionLabelText = newValue
+ }, _titleOverrideChanged: function _titleOverrideChanged(newValue, oldValue) {
+ if (newValue !== null && newValue !== undefined)
+ this.title = newValue;
+ else if (this._page)
+ this.title = this._page.title;
+ else
+ this.title = String.empty
+ }, _pivotSelectedIndexOverrideChanged: function _pivotSelectedIndexOverrideChanged(newValue, oldValue) {
+ if (this._hubsSelectionManager && newValue !== null && newValue !== undefined)
+ this._hubsSelectionManager.selectedIndex = newValue
+ }, _refreshModifierSelectionManagers: function _refreshModifierSelectionManagers() {
+ if (this._complexBindings) {
+ var modifierSelectionManager;
+ var secondaryModifierSelectionManager;
+ if (this.modifiersUsePanels) {
+ modifierSelectionManager = this._hubsSelectionManager;
+ secondaryModifierSelectionManager = null
+ }
+ else if (this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel) {
+ modifierSelectionManager = this.currentHub.dataContext.viewModel.modifierSelectionManager;
+ secondaryModifierSelectionManager = this.currentHub.dataContext.viewModel.secondaryModifierSelectionManager
+ }
+ modifierSelectionManager = modifierSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ secondaryModifierSelectionManager = secondaryModifierSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ this._modifierControl.selectionManager = this.modifierSelectionManager = modifierSelectionManager;
+ if (this._secondaryModifierControl) {
+ this._secondaryModifierControl.selectionManager = this.secondaryModifierSelectionManager = secondaryModifierSelectionManager;
+ this._secondaryModifierControl.items = secondaryModifierSelectionManager ? secondaryModifierSelectionManager.dataSource : null
+ }
+ }
+ }, _refreshFilterSelectionManagers: function _refreshFilterSelectionManagers() {
+ if (this._complexBindings && this._filterControl) {
+ var filterSelectionManager;
+ if (!this.modifiersUsePanels && this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel)
+ filterSelectionManager = this.currentHub.dataContext.viewModel.filterSelectionManager;
+ filterSelectionManager = filterSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ this._filterControl.selectionManager = this.filterSelectionManager = filterSelectionManager
+ }
+ }, _refreshPivotSelectionManagers: function _refreshPivotSelectionManagers() {
+ if (this._complexBindings) {
+ var pivotsSelectionManager;
+ if (this.pivotsUsePanels)
+ pivotsSelectionManager = this._hubsSelectionManager;
+ else if (this.currentHub && this.currentHub.dataContext && this.currentHub.dataContext.viewModel)
+ pivotsSelectionManager = this.currentHub.dataContext.viewModel.pivotsSelectionManager;
+ pivotsSelectionManager = pivotsSelectionManager || MS.Entertainment.Music.MusicPage.empty;
+ this._pivotControl.selectionManager = this.pivotsSelectionManager = pivotsSelectionManager
+ }
+ }, _mapHubs: function _mapHubs(hubs) {
+ var result;
+ if (hubs)
+ result = hubs.map(function mapHubToHub(hub) {
+ return new MS.Entertainment.Music.MusicHub({
+ page: this._page, hub: hub
+ })
+ }, this);
+ else
+ result = [];
+ return result
+ }, _resetPage: function _resetPage() {
+ this.hubs = [];
+ this.dataContext = {};
+ this.title = null;
+ this._page = {};
+ if (this._loadedHub && this._loadedHub.dispose)
+ this._loadedHub.dispose();
+ this._loadedHub = MS.Entertainment.Music.MusicHub.empty
+ }, _onSelectionChanged: function _onSelectionChanged(args) {
+ if (this._complexBindings) {
+ this._complexBindings.cancel();
+ this._complexBindings = null
+ }
+ if (this._pageReadyOnce && MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).lastNavigationWasPage = false;
+ if (this.currentHub)
+ this._loadHub()
+ }, _loadHub: function _loadHub() {
+ var currentHub = this.currentHub;
+ if (MS.Entertainment.Music.MusicHub.isEmpty(currentHub) || currentHub === this._loadedHub)
+ return;
+ if (this._loadedHub && this._loadedHub.clearDataContext) {
+ this._loadedHub.clearDataContext();
+ this._loadedHub = null
+ }
+ this.handlePanelReset();
+ this._loadedHub = currentHub;
+ if (currentHub.options) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.currentHub = currentHub.options.hub
+ }
+ MS.Entertainment.Utilities.empty(this.hubContainer);
+ window.msWriteProfilerMark("ent:MusicPage.LoadHubTemplate,StartTM");
+ MS.Entertainment.UI.Framework.loadTemplate(currentHub.fragmentUrl, null, true).then(function renderHub(controlInstance) {
+ if (this._loadedHub === currentHub)
+ return this._renderHub(controlInstance, currentHub)
+ }.bind(this)).then(function finalizeHub() {
+ this.loadedOnce = true
+ }.bind(this));
+ MS.Entertainment.UI.Framework.assert(!this._complexBindings, "bindings should have been cleared");
+ if (!this._lastChangeWasNavigate)
+ this._startViewModelQuery();
+ this._lastChangeWasNavigate = false;
+ var viewModelBindings = {
+ modifierDescriptionFormatter: {result: this._modifierDescriptionChanged.bind(this)}, isFailed: this._setIsFailed.bind(this), titleOverride: this._titleOverrideChanged.bind(this), pivotSelectedIndexOverride: this._pivotSelectedIndexOverrideChanged.bind(this)
+ };
+ if (!this.modifiersUsePanels) {
+ viewModelBindings["modifierSelectionManager"] = {dataSource: this._refreshModifierSelectionManagers.bind(this)};
+ viewModelBindings["filterSelectionManager"] = {dataSource: this._refreshFilterSelectionManagers.bind(this)};
+ viewModelBindings["secondaryModifierSelectionManager"] = {dataSource: this._refreshModifierSelectionManagers.bind(this)}
+ }
+ if (!this.pivotsUsePanels)
+ viewModelBindings["pivotsSelectionManager"] = {dataSource: this._refreshPivotSelectionManagers.bind(this)};
+ if (this.hideNavigationContainer)
+ WinJS.Utilities.addClass(this._pivotControl.domElement, "removeFromDisplay");
+ this._complexBindings = WinJS.Binding.bind(currentHub, {dataContext: {
+ viewModel: viewModelBindings, minModifierItems: this._minModifierItemsChanged.bind(this)
+ }});
+ this._refreshModifierSelectionManagers();
+ this._refreshFilterSelectionManagers();
+ this._refreshPivotSelectionManagers()
+ }, _renderHub: function _renderHub(controlInstance, musicHub) {
+ return controlInstance.render(musicHub, this.hubContainer).then(function raiseEvent() {
+ if (this._loadedHub !== musicHub)
+ return;
+ window.msWriteProfilerMark("ent:MusicPage.LoadHubTemplate,StopTM");
+ if (musicHub.id)
+ this.hubContainer.setAttribute("data-win-automationid", musicHub.id);
+ else
+ this.hubContainer.removeAttribute("data-win-automationid");
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelLoadingStarted", true, true);
+ this.hubContainer.dispatchEvent(domEvent);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.tracePanel_Load_End(musicHub.id || "");
+ eventProvider.traceHub_Load_End(musicHub.id || "");
+ this._invokePageLoadedOnce();
+ if (!musicHub || !musicHub.dataContext || !musicHub.dataContext.doNotRaisePanelReady) {
+ window.msWriteProfilerMark("ent:MusicPages.RaisePanelReady");
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.hubContainer)
+ }
+ }.bind(this))
+ }, _uninitializeSidebar: function _uninitializeSidebar() {
+ if (this._uiStateBindings) {
+ this._uiStateBindings.cancel();
+ this._uiStateBindings = null
+ }
+ if (this._uiStateEventHandlers) {
+ this._uiStateEventHandlers.cancel();
+ this._uiStateEventHandlers = null
+ }
+ }, _initializeSidebar: function _initializeSidebar() {
+ this._uninitializeSidebar();
+ if (!this.hideSidebar) {
+ var loadSidebar = this._loadSidebar.bind(this);
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this._uiStateEventHandlers = MS.Entertainment.Utilities.addEventHandlers(uiState, {windowresize: loadSidebar});
+ this._uiStateBindings = WinJS.Binding.bind(uiState, {isSnapped: loadSidebar});
+ this._signedInUserBindings = WinJS.Binding.bind(signedInUser, {isSubscription: loadSidebar});
+ this._loadSidebar()
+ }
+ }, _loadSidebar: function _loadSidebar() {
+ if (this._uiStateEventHandlers && this._uiStateBindings && this._signedInUserBindings && this._sidebarHost) {
+ MS.Entertainment.Utilities.empty(this._sidebarHost);
+ var viewModel = this.currentHub.dataContext.viewModel;
+ if (viewModel.getSidebarItems) {
+ var sidebarItems = viewModel.getSidebarItems(viewModel.view);
+ if (sidebarItems)
+ for (var i = 0; i < sidebarItems.length; i++)
+ this._sidebarHost.appendChild(sidebarItems[i])
+ }
+ if (this._sidebarHost.children.length > 0)
+ WinJS.Utilities.addClass(this.domElement, "sidebarEnabled");
+ else
+ WinJS.Utilities.removeClass(this.domElement, "sidebarEnabled")
+ }
+ }, _invokePageLoadStart: function _invokePageLoadStart() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Load_Start(this.id || "");
+ this._pageLoadedOnce = false;
+ this._pageReadyOnce = false
+ }, _invokePageLoadedOnce: function _invokePageLoadedOnce() {
+ if (!this._pageLoadedOnce) {
+ this._pageLoadedOnce = true;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Load_End(this.id);
+ var visibleEvent = document.createEvent("Event");
+ visibleEvent.initEvent("HubStripVisible", true, false);
+ this.domElement.dispatchEvent(visibleEvent)
+ }
+ }, _invokePageReadyOnce: function _invokePageReadyOnce() {
+ if (!this._pageReadyOnce) {
+ this._pageReadyOnce = true;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Ready(this.id);
+ var readyEvent = document.createEvent("Event");
+ readyEvent.initEvent("HubStripLoaded", true, false);
+ this.domElement.dispatchEvent(readyEvent);
+ var readyEvent = document.createEvent("Event");
+ readyEvent.initEvent("HubStripReady", true, false);
+ this.domElement.dispatchEvent(readyEvent);
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiState.isHubStripVisible = true;
+ this._initializeSidebar()
+ }
+ }
+ }, {
+ modifierSelectionManager: null, filterSelectionManager: null, secondaryModifierSelectionManager: null, pivotsSelectionManager: null, dataContext: null, id: null, hidePivots: false, showSideContentContainer: false
+ }, {
+ empty: {}, applyGetPage: function applyGetPage(iaNode) {
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(iaNode, "Components/Music/MusicPageHost.html")
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Music", {MusicHub: MS.Entertainment.defineOptionalObservable(function MusicHubInstance(options) {
+ this.options = options;
+ if (options && options.hub) {
+ this.id = options.hub.iaNode.moniker;
+ this.fragmentUrl = options.hub.overrideFragmentUrl;
+ if (options.hub.titleProviderFactory) {
+ this._titleProvider = options.hub.titleProviderFactory();
+ this._titleProviderBindings = WinJS.Binding.bind(this._titleProvider, {title: this._titleProviderTitleChanged.bind(this)})
+ }
+ else
+ this.label = options.hub.title
+ }
+ }, {
+ _dataContext: null, _disposed: false, _titleProvider: null, _titleProviderBindings: null, dispose: function dispose() {
+ this._disposed = true;
+ this.clearDataContext();
+ if (this._titleProviderBindings) {
+ this._titleProviderBindings.cancel();
+ this._titleProviderBindings = null
+ }
+ if (this._titleProvider && this._titleProvider.dispose) {
+ this._titleProvider.dispose();
+ this._titleProvider = null
+ }
+ }, _titleProviderTitleChanged: function _titleProviderTitleChanged(title) {
+ if (title) {
+ this.label = title;
+ this.isDisabled = false
+ }
+ else {
+ this.label = String.empty;
+ this.isDisabled = true
+ }
+ }, clearDataContext: function clearDataContext() {
+ if (this._dataContextBinds) {
+ this._dataContextBinds.cancel();
+ this._dataContextBinds = null
+ }
+ if (this._dataContext) {
+ if (this._dataContext.viewModel && this._dataContext.viewModel.dispose)
+ this._dataContext.viewModel.dispose();
+ this._dataContext = null
+ }
+ if (this.options && this.options.hub)
+ this.options.hub.clearDataContext()
+ }, instance: {get: function() {
+ return this
+ }}, dataContext: {get: function() {
+ var original = this._dataContext;
+ if (!this._disposed) {
+ if (!this._dataContext && this.options && this.options.hub)
+ this._dataContext = this.options.hub.getDataContext();
+ if (!this._dataContext && this.options && this.options.page)
+ this._dataContext = this.options.page.getDataContext()
+ }
+ return this._dataContext
+ }}
+ }, {
+ id: null, selected: false, label: null, isDisabled: false, titleOverride: null, pivotSelectedIndexOverride: null, fragmentUrl: null, options: null, isRoot: true
+ }, {
+ empty: {
+ dataContext: null, selected: false, id: null, fragmentUrl: null, options: null
+ }, isEmpty: function isEmpty(value) {
+ return WinJS.Binding.unwrap(value) === MS.Entertainment.Music.MusicHub.empty
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {SearchResultsPivotTitleProvider: MS.Entertainment.defineObservable(function searchResultsPivotTitleProviderConstructor(defaultStringId, formatStringId, countProperty, hideOnZero) {
+ this._defaultString = String.load(defaultStringId);
+ this._formatString = String.load(formatStringId);
+ this._hideOnZero = hideOnZero;
+ var binding = {};
+ binding[countProperty] = this._onCountChange.bind(this);
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ this._bindings = WinJS.Binding.bind(searchResultCounts, binding)
+ }, {
+ title: String.empty, _defaultString: null, _formatString: null, _bindings: null, _hideOnZero: false, _onCountChange: function onCountChange(count) {
+ var formattedCount;
+ if (count === -1)
+ this.title = this._defaultString;
+ else if (this._hideOnZero && count === 0)
+ this.title = null;
+ else {
+ formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(count);
+ this.title = this._formatString.format(formattedCount)
+ }
+ }, dispose: function dispose() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {MusicSearchResultCounts: MS.Entertainment.defineObservable(function searchResultCountsConstructor(){}, {
+ clearOnRestore: false, allCount: -1, artistsCount: 0, albumsCount: 0, songsCount: 0, playlistsCount: 0, musicVideosCount: 0, backup: function backup() {
+ this.clearOnRestore = false;
+ return {
+ allCount: this.allCount, artistsCount: this.artistsCount, albumsCount: this.albumsCount, songsCount: this.songsCount, playlistsCount: this.playlistsCount, musicVideosCount: this.musicVideosCount
+ }
+ }, restore: function restore(savedSearchResultCounts) {
+ if (!this.clearOnRestore) {
+ this.allCount = savedSearchResultCounts.allCount;
+ this.artistsCount = savedSearchResultCounts.artistsCount;
+ this.albumsCount = savedSearchResultCounts.albumsCount;
+ this.songsCount = savedSearchResultCounts.songsCount;
+ this.playlistsCount = savedSearchResultCounts.playlistsCount;
+ this.musicVideosCount = savedSearchResultCounts.musicVideosCount
+ }
+ else {
+ this.clearCounts();
+ this.clearOnRestore = false
+ }
+ }, clearCounts: function clearCounts() {
+ this.allCount = -1;
+ this.artistsCount = 0;
+ this.albumsCount = 0;
+ this.songsCount = 0;
+ this.playlistsCount = 0;
+ this.musicVideosCount = 0
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.searchResultCounts, function getSearchResultCountsService() {
+ return new MS.Entertainment.ViewModels.MusicSearchResultCounts
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Music/MusicPagesVertical.html b/packages/microsoft.zunevideo/Components/Music/MusicPagesVertical.html
new file mode 100644
index 00000000..09e428c7
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Music/MusicPagesVertical.html
@@ -0,0 +1,110 @@
+
+
+
+
+
+ Music Vertical Page Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Music/MusicPanels.html b/packages/microsoft.zunevideo/Components/Music/MusicPanels.html
new file mode 100644
index 00000000..3053457c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Music/MusicPanels.html
@@ -0,0 +1,127 @@
+
+
+
+
+
+ Music Panels
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Music/MusicSharedTemplatesControls.js b/packages/microsoft.zunevideo/Components/Music/MusicSharedTemplatesControls.js
new file mode 100644
index 00000000..fe72d9c5
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Music/MusicSharedTemplatesControls.js
@@ -0,0 +1,6 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {AlbumThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "Components/Music/MusicSharedTemplates.html#albumThumbnailButtonTemplate")});
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ArtistCardlessThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "Components/Music/MusicSharedTemplates.html#artistCardlessThumbnailButtonTemplate")});
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SongThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "Components/Music/MusicSharedTemplates.html#songThumbnailButtonTemplate")});
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VerticalAlbumSummaryThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MediaItemThumbnail", "Components/Music/MusicSharedTemplates.html#verticalAlbumSummaryThumbnailTemplate")})
diff --git a/packages/microsoft.zunevideo/Components/Playback/Controls/PlaybackControl.css b/packages/microsoft.zunevideo/Components/Playback/Controls/PlaybackControl.css
new file mode 100644
index 00000000..2986fff4
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Playback/Controls/PlaybackControl.css
@@ -0,0 +1,30 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.playbackPipeline, .nowPlayingPlaybackControlContainer .win-template
+{
+ width: 100%;
+ height: 100%
+}
+.nowPlayingPlaybackControlContainer
+{
+ width: 100%;
+ height: 100%;
+ position: relative
+}
+.closedCaptionsContainer
+{
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ direction: ltr
+}
+.videoStreamingStatisticsContainer
+{
+ width: 100%;
+ height: 400px;
+ position: absolute;
+ left: 50px;
+ bottom: 100px;
+ direction: ltr
+}
diff --git a/packages/microsoft.zunevideo/Components/Playback/Controls/PlaybackControl.html b/packages/microsoft.zunevideo/Components/Playback/Controls/PlaybackControl.html
new file mode 100644
index 00000000..8f3a8865
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Playback/Controls/PlaybackControl.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+ Playback Control Template
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Playback/IndivWorker.js b/packages/microsoft.zunevideo/Components/Playback/IndivWorker.js
new file mode 100644
index 00000000..da67b3ca
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Playback/IndivWorker.js
@@ -0,0 +1,8 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+try {
+ securityVersion = Microsoft.Media.PlayReadyClient.PlayReadyStatics.playReadySecurityVersion;
+ postMessage(true)
+}
+catch(ex) {
+ postMessage(false)
+}
diff --git a/packages/microsoft.zunevideo/Components/Playback/Netstats/VideoNetstats.js b/packages/microsoft.zunevideo/Components/Playback/Netstats/VideoNetstats.js
new file mode 100644
index 00000000..2dc38fce
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Playback/Netstats/VideoNetstats.js
@@ -0,0 +1,325 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Platform) {
+ (function(Playback) {
+ var MSEPlayback = MS.Entertainment.Platform.Playback;
+ var hnsPerSecond = 10000000;
+ var hnsPerMillisecond = 10000;
+ var defaultStrokestyle = "#FFFFFF";
+ var defaultFillstyle = "#FFFFFF";
+ {};
+ var VideoNetstatsControl = (function(_super) {
+ __extends(VideoNetstatsControl, _super);
+ function VideoNetstatsControl(element, options) {
+ _super.call(this, element, options);
+ this.suppressUnload = true;
+ this.columnWidth = 16;
+ this.columnGutter = 2;
+ this.lineWidth = 3;
+ this.numChartLines = 5;
+ this.chartLabelOffset = 12;
+ this.textDisplayOffset = 10;
+ this.maxbwStrokestyle = "#00FF00";
+ this.bwStrokeStyle = "#FF0000";
+ this.currentPositionFillstyle = "#FFFFFF";
+ this.currentPositionStrokestyle = "#FFFFFF";
+ this.goodChunkFillstyle = "#00FF00";
+ this.badChunkFillstyle = "#FF0000";
+ this.chartLinesStrokestyle = "#FFFFFF";
+ this.canvasRenderWidth = 1920;
+ this.canvasRenderHeight = 400;
+ this._drawOverlay = false;
+ this._sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var platLog = Microsoft.Entertainment.Platform.Logging;
+ this._sessionGuid = platLog.DataPoint.properties.sessionGuid;
+ this._canvas = document.createElement("canvas");
+ this._canvas.style.cssText = "width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; direction: ltr;";
+ this._canvas.width = this.canvasRenderWidth;
+ this._canvas.height = this.canvasRenderHeight;
+ element.appendChild(this._canvas);
+ this._bindings = WinJS.Binding.bind(this, {_sessionManager: {nowPlayingSession: {currentTransportState: this._currentTransportStateChanged.bind(this)}}})
+ }
+ VideoNetstatsControl.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ this._cancelDrawLoop();
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ };
+ Object.defineProperty(VideoNetstatsControl.prototype, "drawOverlay", {
+ get: function() {
+ return this._drawOverlay
+ }, set: function(value) {
+ this._drawOverlay = value;
+ if (this._drawOverlay && this._currentTransportState === Playback.TransportState.playing)
+ this._beginDrawLoop();
+ if (!this._drawOverlay) {
+ this._cancelDrawLoop();
+ this.clearCanvas()
+ }
+ }, enumerable: true, configurable: true
+ });
+ VideoNetstatsControl.prototype._currentTransportStateChanged = function(value, oldValue) {
+ if (!value || this._unloaded)
+ return;
+ this._currentTransportState = value;
+ if (this._currentTransportState === Playback.TransportState.playing && this._drawOverlay)
+ this._beginDrawLoop();
+ else
+ this._cancelDrawLoop()
+ };
+ VideoNetstatsControl.prototype._beginDrawLoop = function() {
+ var _this = this;
+ if (!this._drawLoopTimerToken)
+ this._drawLoopTimerToken = setInterval(function() {
+ return _this._onDrawLoop()
+ }, MS.Entertainment.Platform.Playback.VideoNetstatsControl.drawTimeoutMs)
+ };
+ VideoNetstatsControl.prototype._cancelDrawLoop = function() {
+ if (this._drawLoopTimerToken) {
+ clearInterval(this._drawLoopTimerToken);
+ this._drawLoopTimerToken = null
+ }
+ };
+ VideoNetstatsControl.prototype._onDrawLoop = function() {
+ this._updateDisplay(this._sessionManager.nowPlayingSession.videoStreamStatistics)
+ };
+ VideoNetstatsControl.prototype._updateDisplay = function(stats) {
+ this.clearCanvas();
+ if (!stats || this._uiStateService.isSnapped)
+ return;
+ var ctx = this._canvas.getContext("2d");
+ var positionMs = this._sessionManager.primarySession.forceTimeUpdate();
+ var maxBitrate = (stats.maxVideoBitrate) + 100000;
+ var chartLinesWidth = Math.round(ctx.canvas.width * 0.75);
+ var chartWidth = chartLinesWidth * 0.8;
+ var chartHeight = Math.round(ctx.canvas.height * 0.5);
+ this._drawChartLines(ctx, chartLinesWidth, chartHeight, this.numChartLines, maxBitrate / (this.numChartLines - 1));
+ this._drawChunkHistogram(stats, positionMs, maxBitrate, ctx, chartWidth, chartHeight, this.columnWidth, this.columnGutter);
+ this._drawNetworkBandwidthGraph(stats, maxBitrate, ctx, chartWidth, chartHeight, this.lineWidth, this.columnWidth, this.columnGutter);
+ this._displayStreamInfo(stats, ctx, 0, chartHeight + 50);
+ this._displayFailureEvents(stats, ctx, chartLinesWidth + 10, this.textDisplayOffset)
+ };
+ VideoNetstatsControl.prototype._drawChunkHistogram = function(stats, positionMs, maxBitrate, ctx, width, height, colWidth, colGutter) {
+ var nowLeft = -1;
+ var futureLeft = -1;
+ var positionHNS = positionMs * hnsPerMillisecond;
+ var left = 0;
+ for (var j = stats.history.length; j > 0; j--) {
+ var hist = stats.history[j - 1];
+ var top = hist.bitrate / maxBitrate;
+ top = Math.round(top * height);
+ if (hist.lastBandwidth === 0 && hist.hnsStartTime !== 0)
+ ctx.fillStyle = this.badChunkFillstyle;
+ else
+ ctx.fillStyle = this.goodChunkFillstyle;
+ ctx.fillRect(left, height - top, colWidth, top);
+ var radius = colWidth / 2;
+ if (hist.hnsStartTime <= positionHNS && (hist.hnsStartTime + MSEPlayback.VideoNetstatsControl.getDuration(stats.history, j - 1, MSEPlayback.VideoNetstatsControl.defaultVideoChunkDurationHns) > positionHNS)) {
+ ctx.fillStyle = this.currentPositionFillstyle;
+ ctx.strokeStyle = this.currentPositionStrokestyle;
+ ctx.beginPath();
+ ctx.arc(left + radius, height - radius, radius, 0, 2 * Math.PI);
+ ctx.fill();
+ if (nowLeft === -1)
+ nowLeft = left
+ }
+ futureLeft = left;
+ left = left + colWidth + colGutter;
+ if (left > width)
+ break
+ }
+ ctx.font = "20px Segoe UI";
+ ctx.fillStyle = defaultFillstyle;
+ ctx.textAlign = "center";
+ var currentPositiontext = MSEPlayback.VideoNetstatsControl.secondsToTimeString(positionMs / 1000, false);
+ var currentPositionRenderLength = ctx.measureText(currentPositiontext);
+ if (nowLeft > currentPositionRenderLength.width)
+ ctx.fillText(currentPositiontext, nowLeft, height + 20);
+ ctx.textAlign = "start";
+ if (nowLeft > currentPositionRenderLength.width * 2)
+ if (stats.history.length) {
+ var pastLengthSeconds = (stats.history[stats.history.length - 1].hnsStartTime / (hnsPerSecond)) - (positionMs / 1000);
+ ctx.fillText(MSEPlayback.VideoNetstatsControl.secondsToTimeString(pastLengthSeconds, true), 0, height + 20)
+ }
+ if (futureLeft - nowLeft > currentPositionRenderLength.width)
+ if (stats.history.length) {
+ var futureLengthSeconds = (stats.history[j].hnsStartTime / (hnsPerSecond)) - (positionMs / 1000);
+ ctx.fillText(MSEPlayback.VideoNetstatsControl.secondsToTimeString(futureLengthSeconds, true), futureLeft, height + 20)
+ }
+ };
+ VideoNetstatsControl.prototype._drawNetworkBandwidthGraph = function(stats, maxBandwidth, ctx, width, height, lineWidth, colWidth, colGutter) {
+ var left = colWidth / 2;
+ var previousPositionValid = false;
+ var currentStrokeStyle = this.bwStrokeStyle;
+ var previousPos = [];
+ ctx.beginPath();
+ ctx.lineWidth = lineWidth;
+ ctx.strokeStyle = currentStrokeStyle;
+ for (var j = stats.history.length; j > 0; j--) {
+ var hist = stats.history[j - 1];
+ var top = hist.lastBandwidth / maxBandwidth;
+ top = Math.round(top * height);
+ top = Math.min(height, top);
+ var beginNewPath = false;
+ if (top >= height) {
+ if (currentStrokeStyle !== this.maxbwStrokestyle) {
+ currentStrokeStyle = this.maxbwStrokestyle;
+ beginNewPath = true
+ }
+ }
+ else if (currentStrokeStyle !== this.bwStrokeStyle) {
+ currentStrokeStyle = this.bwStrokeStyle;
+ ctx.beginPath();
+ ctx.strokeStyle = currentStrokeStyle;
+ ctx.moveTo(previousPos[0], height - previousPos[1])
+ }
+ if (!previousPositionValid)
+ ctx.moveTo(left, height - top);
+ else if (top !== 0)
+ ctx.lineTo(left, height - top);
+ if (top === 0)
+ previousPositionValid = false;
+ else
+ previousPositionValid = true;
+ ctx.stroke();
+ if (beginNewPath) {
+ ctx.beginPath();
+ ctx.strokeStyle = currentStrokeStyle;
+ if (top !== 0)
+ ctx.moveTo(left, height - top)
+ }
+ previousPos = [left, top];
+ left = left + colWidth + colGutter;
+ if (left > width)
+ break
+ }
+ ctx.strokeStyle = defaultStrokestyle
+ };
+ VideoNetstatsControl.prototype._drawChartLines = function(ctx, width, height, intervals, step) {
+ ctx.strokeStyle = this.chartLinesStrokestyle;
+ ctx.font = "10px Segoe UI";
+ ctx.lineWidth = 1;
+ for (var i = 0; i < intervals; i++) {
+ var y = height - (i * height / (intervals - 1));
+ ctx.beginPath();
+ ctx.moveTo(0, y);
+ ctx.lineTo(width, y);
+ ctx.stroke();
+ if (i !== 0) {
+ ctx.beginPath();
+ ctx.fillStyle = defaultFillstyle;
+ ctx.textAlign = "start";
+ ctx.fillText(MSEPlayback.VideoNetstatsControl.bitrateToString(i * step), 5, y + this.chartLabelOffset);
+ ctx.textAlign = "right";
+ ctx.fillText(MSEPlayback.VideoNetstatsControl.bitrateToString(i * step), width - 5, y + this.chartLabelOffset);
+ ctx.fill()
+ }
+ }
+ ctx.stroke();
+ ctx.strokeRect(0, 0, width, height)
+ };
+ VideoNetstatsControl.prototype._displayFailureEvents = function(stats, ctx, x, y) {
+ ctx.font = "10px Consolas";
+ ctx.fillStyle = defaultFillstyle;
+ for (var j = 0; j < stats.failureEvents.length; j++) {
+ var stat = stats.failureEvents[j];
+ var failureString = stat.hnsTime.toFixed(0) + ":" + stat.info;
+ var currentY = y + j * 10;
+ ctx.fillText(failureString, x, currentY)
+ }
+ };
+ VideoNetstatsControl.prototype._displayStreamInfo = function(stats, ctx, x, y) {
+ ctx.font = "20px Segoe UI";
+ ctx.fillStyle = defaultFillstyle;
+ ctx.fillText("Selected Video Stream: " + stats.maxWidth + "X" + stats.maxHeight + ", " + stats.videoCodec, x, y);
+ ctx.fillText("Selected Audio Stream: " + stats.audioCodec, x, y + 30);
+ ctx.fillText("Session GUID: " + this._sessionGuid, x, y + 60)
+ };
+ VideoNetstatsControl.getDuration = function(buffers, i, defaultDuration) {
+ var duration = defaultDuration;
+ for (var j = i - 1; j >= 0; j--) {
+ var hist = buffers[i];
+ var histNext = buffers[j];
+ if (hist.hnsStartTime === histNext.hnsStartTime)
+ continue;
+ duration = histNext.hnsStartTime - hist.hnsStartTime;
+ break
+ }
+ return duration
+ };
+ VideoNetstatsControl.secondsToTimeString = function(time, includeSign) {
+ var seconds;
+ var minutes;
+ var hours;
+ var timeString;
+ var signString = String.empty;
+ if (time < 0)
+ signString = "-";
+ else
+ signString = "+";
+ time = Math.abs(time);
+ time = time - time % 1;
+ seconds = time % 60;
+ time = time - seconds;
+ time = time / 60;
+ minutes = time % 60;
+ time = time - minutes;
+ hours = time / 60;
+ timeString = seconds.toString();
+ if (hours || minutes) {
+ if (seconds < 10)
+ timeString = "0" + timeString;
+ timeString = minutes + ":" + timeString
+ }
+ else
+ timeString = timeString + "s";
+ if (hours) {
+ if (minutes < 10)
+ timeString = "0" + timeString;
+ timeString = hours + ":" + timeString
+ }
+ if (includeSign)
+ timeString = signString + timeString;
+ return timeString
+ };
+ VideoNetstatsControl.bitrateToString = function(bitrate) {
+ var kbps = bitrate / 1000;
+ kbps = kbps - kbps % 1;
+ return kbps + " kbps"
+ };
+ VideoNetstatsControl.prototype.clearCanvas = function() {
+ if (this._canvas) {
+ var ctx = this._canvas.getContext("2d");
+ ctx.save();
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ ctx.restore()
+ }
+ };
+ VideoNetstatsControl.drawTimeoutMs = 1000;
+ VideoNetstatsControl.defaultVideoChunkDurationHns = 20000000;
+ return VideoNetstatsControl
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Playback.VideoNetstatsControl = VideoNetstatsControl
+ })(Platform.Playback || (Platform.Playback = {}));
+ var Playback = Platform.Playback
+ })(Entertainment.Platform || (Entertainment.Platform = {}));
+ var Platform = Entertainment.Platform
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Playback/Playlist/NewPlaylistOverlay.html b/packages/microsoft.zunevideo/Components/Playback/Playlist/NewPlaylistOverlay.html
new file mode 100644
index 00000000..8b7e01ee
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Playback/Playlist/NewPlaylistOverlay.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Create Playlist Dialog
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Playback/Playlist/NewPlaylistOverlay.js b/packages/microsoft.zunevideo/Components/Playback/Playlist/NewPlaylistOverlay.js
new file mode 100644
index 00000000..ce4a1e17
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Playback/Playlist/NewPlaylistOverlay.js
@@ -0,0 +1,78 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NewPlaylistOverlay: MS.Entertainment.UI.Framework.defineUserControl("/Components/Playback/Playlist/NewPlaylistOverlay.html#newPlaylistDialogTemplate", null, {
+ _dialog: null, initialize: function initialize() {
+ this._playlistEdit.value = MS.Entertainment.UI.Controls.NewPlaylistOverlay.getNextDefaultPlaylistName();
+ this._playlistEdit.setValue();
+ this._playlistEdit.keyUp = this.onKeyUp.bind(this);
+ WinJS.Promise.timeout(150).then(function() {
+ var inputControl = WinJS.Utilities.getMember("_playlistEdit.inputControl", this);
+ if (inputControl)
+ inputControl.select()
+ }.bind(this))
+ }, setOverlay: function setOverlay(overlay) {
+ this._dialog = overlay
+ }, onKeyUp: function onKeyUp(e) {
+ var inputValue = WinJS.Utilities.getMember("_playlistEdit.inputControl.value", this);
+ this._dialog.buttons[0].isDisabled = !inputValue;
+ if (this.duplicateMessageVisible) {
+ this.duplicateMessageVisible = false;
+ this._dialog.buttons[0].title = String.load(String.id.IDS_OK_BUTTON)
+ }
+ }, submit: function submit(dataSource) {
+ var that = this;
+ var overwrite = this.duplicateMessageVisible;
+ MS.Entertainment.UI.Controls.NewPlaylistOverlay.save(this._playlistEdit.value, dataSource || [], overwrite).then(function save_success() {
+ that._dialog.hide()
+ }, function save_failure(e) {
+ if (e.number === MS.Entertainment.UI.Actions.Playlists.ERROR_PLAYLIST_ALREADY_EXISTS) {
+ that._duplicateMessage.text = String.load(String.id.IDS_PLAYLIST_CREATE_DUPLICATE_MESSAGE).format(that._playlistEdit.value);
+ that.duplicateMessageVisible = true;
+ that._dialog.buttons[0].title = String.load(String.id.IDS_PLAYLIST_CREATE_REPLACE)
+ }
+ })
+ }
+ }, {duplicateMessageVisible: false}, {
+ show: function show(dataSource) {
+ return MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_PLAYLIST_NAME_TITLE), "MS.Entertainment.UI.Controls.NewPlaylistOverlay", {
+ width: "30%", height: "210px", buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_OK_BUTTON), execute: function execute_submit(dialog) {
+ dialog.userControlInstance.submit(dataSource)
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_CANCEL_BUTTON), execute: function execute_cancel(dialog) {
+ dialog.hide()
+ }
+ })], defaultButtonIndex: 0, cancelButtonIndex: 1
+ })
+ }, getNextDefaultPlaylistName: function getNextDefaultPlaylistName() {
+ return String.load(String.id.IDS_PLAYLIST_DEFAULT_NAME)
+ }, save: function save(playlistName, playlistDataSource, overwrite) {
+ var isDuplicate = false;
+ var session = null;
+ var playlist = new MS.Entertainment.Platform.Playback.Playlist.PlaylistCore;
+ return playlist.setDataSource(playlistDataSource).then(function(mediaCollection) {
+ return playlist.savePlaylist(playlistName, overwrite).then(function save_succeeded(playlistId) {
+ return WinJS.Promise.wrap(playlistId)
+ }, function save_failed(e) {
+ return WinJS.Promise.wrapError(e)
+ })
+ })
+ }, addToPlaylist: function addToPlaylist(playlist, album) {
+ if (!playlist || !playlist.name)
+ throw"NewPlaylistOverlay: Cannot add to invalid playlist";
+ if (!album)
+ throw"NewPlaylistOverlay: Album is invalid and cannot be added to a playlist";
+ var playlistQuery = new MS.Entertainment.Data.Query.libraryPlaylistMediaItems;
+ playlistQuery.playlistId = playlist.libraryId;
+ var playlistCore = new MS.Entertainment.Platform.Playback.Playlist.PlaylistCore;
+ return playlistCore.setDataSource(playlistQuery).then(function(mediaCollection) {
+ return playlistCore.insertAtEnd(null, album)
+ }).then(function(value) {
+ return playlistCore.savePlaylist(playlist.name, true)
+ })
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Playback/VideoScrubber.js b/packages/microsoft.zunevideo/Components/Playback/VideoScrubber.js
new file mode 100644
index 00000000..9d894f04
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Playback/VideoScrubber.js
@@ -0,0 +1,137 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {VideoScrubberObservables: MS.Entertainment.defineObservable(function VideoScrubberObservables_constructor() {
+ var _this = this;
+ this.bind("scrubActive", function scrubActiveChanged(activate) {
+ _this._toggleScrub(activate)
+ })
+ }, {
+ canScrub: false, scrubActive: false
+ })});
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {VideoScrubber: MS.Entertainment.UI.Framework.derive("MSEPlatform.Playback.VideoScrubberObservables", function VideoScrubber_constructor(playbackControl) {
+ if (!playbackControl)
+ return;
+ MSEPlatform.Playback.VideoScrubberObservables.prototype.constructor.call(this);
+ this._iPlaybackControl = playbackControl;
+ this._parkedThumbnailDiv = document.createElement("div");
+ WinJS.Utilities.addClass(this._parkedThumbnailDiv, "removeFromDisplay");
+ document.body.appendChild(this._parkedThumbnailDiv);
+ var videoScrubber = this;
+ playbackControl.bind("currentMedia", function(newMedia) {
+ videoScrubber._onMediaChanged(newMedia, videoScrubber)
+ })
+ }, {
+ pausePlaybackWhileScrubbing: true, minScrubStep: 5000, thumbnailDiv: {set: function VideoScrubber_thumbnailDiv_set(value) {
+ this._onThumbnailDivChanged(value)
+ }}, scrubPosition: {
+ get: function VideoScrubber_scrubPosition_get() {
+ return this._scrubPosition
+ }, set: function VideoScrubber_scrubPosition_set(value) {
+ this._onScrubPositionChanged(value)
+ }
+ }, _toggleScrub: function VideoScrubber_toggleScrub(activate) {
+ if (activate) {
+ if (this._iPlaybackControl) {
+ this._transportStateBeforeScrub = this._iPlaybackControl.currentTransportState;
+ if (this.pausePlaybackWhileScrubbing)
+ this._iPlaybackControl.targetTransportState = MSEPlatform.Playback.TransportState.paused
+ }
+ }
+ else if (this._iPlaybackControl && this._thumbnailPlayer) {
+ this._iPlaybackControl.seekToPosition(this._thumbnailPlayer.currentTime * 1000);
+ this._iPlaybackControl.targetTransportState = this._transportStateBeforeScrub
+ }
+ }, _onMediaChanged: function VideoScrubber_onMediaChanged(newMedia, _this) {
+ _this._reset();
+ _this._thumbnailPlayer = _this._thumbnailGenerator.start(newMedia, _this._onThumbnailCacheReady, _this);
+ if (_this._thumbnailPlayer && _this._thumbnailDiv)
+ _this._thumbnailDiv.appendChild(_this._thumbnailPlayer)
+ }, _onThumbnailCacheReady: function VideoScrubber_onThumbnailCacheReady(_this) {
+ try {
+ _this._thumbnailPlayer.currentTime = 1;
+ _this.canScrub = true
+ }
+ catch(e) {
+ if (e.code !== e.INDEX_SIZE_ERR)
+ throw(e);
+ else {
+ _this._initialSeekRetryCount++;
+ if (_this._initialSeekRetryCount > 3)
+ throw(e);
+ else
+ WinJS.Promise.timeout(10).then(function retryInitialSeek() {
+ _this._onThumbnailCacheReady(_this)
+ })
+ }
+ }
+ }, _onThumbnailDivChanged: function VideoScrubber_onThumbnailDivChanged(newDiv) {
+ if (this._thumbnailPlayer && newDiv) {
+ newDiv.appendChild(this._thumbnailPlayer);
+ this._thumbnailPlayer.pause();
+ this._thumbnailDiv = newDiv
+ }
+ }, _onScrubPositionChanged: function VideoScrubber_onScrubPositionChanged(newScrubPos) {
+ if (this._verifyScrubability(newScrubPos))
+ this._presentThumbnail(newScrubPos)
+ }, _verifyScrubability: function VideoScrubber_verifyScrubability(newScrubPos) {
+ return (this.scrubActive && this.canScrub && (Math.abs(newScrubPos - this._scrubPosition) >= this.minScrubStep))
+ }, _presentThumbnail: function VideoScrubber_presentThumbnail(newScrubPos) {
+ if (!this._thumbnailPlayer)
+ return;
+ try {
+ var scrubPos = newScrubPos / 1000;
+ if (scrubPos < 0)
+ scrubPos = 0;
+ if (scrubPos > this._thumbnailPlayer.duration)
+ scrubPos = this._thumbnailPlayer.duration;
+ this._thumbnailPlayer.currentTime = scrubPos;
+ this._scrubPosition = newScrubPos
+ }
+ catch(e) {
+ if (e.code !== e.INDEX_SIZE_ERR)
+ throw(e);
+ }
+ }, _reset: function VideoScrubber_reset() {
+ this.canScrub = false;
+ this.scrubActive = false;
+ this._transportStateBeforeScrub = MSEPlatform.Playback.TransportState.playing;
+ this._scrubPosition = 0;
+ this._initialSeekRetryCount = 0
+ }, _scrubPosition: 0, _iPlaybackControl: null, _thumbnailPlayer: null, _thumbnailDiv: null, _transportStateBeforeScrub: null, _initialSeekRetryCount: 0, _parkedThumbnailDiv: null, _thumbnailGenerator: {
+ _thumbnailCache: null, start: function thumbnailGenerator_start(media, thumbnailReadyCallback, scrubberInstance) {
+ if (!media || !thumbnailReadyCallback)
+ return null;
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ return null;
+ if (!this._isThumbnailEnabled())
+ return null;
+ if (this._thumbnailCache) {
+ this._thumbnailCache.removeEventListener("loadeddata", thumbnailReadyCallback);
+ this._thumbnailCache.removeAttribute("src")
+ }
+ this._thumbnailCache = document.createElement("video");
+ this._thumbnailCache.autobuffer = true;
+ this._thumbnailCache.msRealTime = true;
+ this._thumbnailCache.muted = true;
+ this._thumbnailCache.src = media.source;
+ scrubberInstance._parkedThumbnailDiv.appendChild(this._thumbnailCache);
+ this._thumbnailCache.addEventListener("loadeddata", function() {
+ thumbnailReadyCallback(scrubberInstance)
+ });
+ this._thumbnailCache.style.width = "100%";
+ this._thumbnailCache.style.height = "100%";
+ return this._thumbnailCache
+ }, _isThumbnailEnabled: (function thumbnailGenerator_isEnabled() {
+ var configurationManager;
+ return function _isThumbnailEnabled() {
+ if (!configurationManager)
+ configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.playback.enableVideoScrubbing
+ }
+ })()
+ }
+ }, {})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Search/SearchSharedTemplates.html b/packages/microsoft.zunevideo/Components/Search/SearchSharedTemplates.html
new file mode 100644
index 00000000..a6c8e902
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Search/SearchSharedTemplates.html
@@ -0,0 +1,34 @@
+
+
+
+
+ Search Shared Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Search/SearchView.js b/packages/microsoft.zunevideo/Components/Search/SearchView.js
new file mode 100644
index 00000000..699318ef
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Search/SearchView.js
@@ -0,0 +1,186 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Pages");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {SearchTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryTemplateSelector", function galleryTemplateSelector(galleryView) {
+ MS.Entertainment.UI.Controls.GalleryTemplateSelector.prototype.constructor.call(this);
+ this._galleryView = galleryView
+ }, {
+ _galleryView: null, ensureItemTemplatesLoaded: function ensureItemTemplatesLoaded() {
+ MS.Entertainment.Pages.assert(false, "SearchTemplateSelector.ensureItemTemplatesLoaded is abstract - should never be called")
+ }, onSelectTemplate: function onSelectTemplate(item) {
+ var template = null;
+ if (item.isHeader)
+ template = "header";
+ else if (item.data && item.data.isAction)
+ template = "modifierAction";
+ else {
+ var data = (item && item.data) ? item.data : {};
+ switch (data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ template = data.inCollection ? "collectionArtist" : "marketplaceArtist";
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ template = data.inCollection ? "collectionAlbum" : "marketplaceAlbum";
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ template = data.inCollection ? "collectionSong" : "marketplaceSong";
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ template = "collectionPlaylist";
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ if (data.isHCR)
+ template = "videoHCR";
+ else
+ template = data.inCollection ? "collectionTVSeries" : "marketplaceTVSeries";
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (data.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ if (data.isHCR)
+ template = "videoHCR";
+ else
+ template = data.inCollection ? "collectionMovie" : "marketplaceMovie";
+ else if (data.videoType === Microsoft.Entertainment.Queries.VideoType.other)
+ template = "otherVideo";
+ else if (data.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo)
+ template = "marketplaceMusicVideo";
+ else
+ MS.Entertainment.Pages.assert(false, "Unknown video type in search results");
+ break;
+ default:
+ MS.Entertainment.Pages.assert(false, "no template defined");
+ break
+ }
+ }
+ this.ensureTemplatesLoaded([template]);
+ return this.getTemplateProvider(template)
+ }, getPanelTemplatePath: function getPanelTemplatePath(item) {
+ return this._getPanelTemplatePath(item, false)
+ }, _getPanelTemplatePath: function getPanelTemplatePath(item, forceMarketplace) {
+ var data = (item && item.data) ? item.data : {};
+ this._galleryView.panelOptions = (data && data.inCollection && (!forceMarketplace || !data.hasCanonicalId)) ? {location: MS.Entertainment.Data.ItemLocation.collection} : {location: MS.Entertainment.Data.ItemLocation.marketplace};
+ switch (data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ return MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl();
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (data.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ return "MS.Entertainment.Pages.MovieInlineDetails";
+ MS.Entertainment.Pages.assert(data.videoType === Microsoft.Entertainment.Queries.VideoType.other, "unknown video type");
+ return "";
+ default:
+ MS.Entertainment.Pages.assert(false, "no template defined");
+ return null
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Search: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MarketplaceBase", "/Components/Marketplace.html#marketplaceTemplate", function search(){}, {
+ allowEmpty: true, templateSelectorConstructor: null, _searchResultsCounts: null, _uiStateService: null, initializeWithEmptyItems: false, initialize: function initialize() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype.initialize.call(this);
+ this.domElement.addEventListener("galleryFirstPageRendered", function galleryFirstPageRender() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioSearchGalleryRequestToLoad()
+ })
+ }, unload: function unload() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype.unload.call(this)
+ }, _setGalleryItems: function _setGalleryItems() {
+ if (this._unloaded)
+ return;
+ if (this._galleryView)
+ this._galleryView.templateSelectorConstructor = this.templateSelectorConstructor;
+ if (this.initializeWithEmptyItems) {
+ this._galleryView.dataSource = null;
+ this.initializeWithEmptyItems = false
+ }
+ MS.Entertainment.Pages.MarketplaceBase.prototype._setGalleryItems.call(this)
+ }, freeze: function freeze() {
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ this._searchResultsCounts = searchResultCounts.backup();
+ MS.Entertainment.Pages.MarketplaceBase.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.Pages.MarketplaceBase.prototype.thaw.call(this);
+ if (this._searchResultsCounts) {
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ searchResultCounts.restore(this._searchResultsCounts)
+ }
+ }
+ }, null, {hcrZestTypes: {
+ tvSeries: "Series", movie: "Movie", album: "Album", artist: "Artist", track: "Track"
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {SearchResultsGroupHeader: MS.Entertainment.UI.Framework.defineUserControl(null, function searchResultsGroupHeaderConstructor(element){}, {
+ controlName: "SearchResultsGroupHeader", _groupTypeBinding: null, _resultCountBinding: null, _labelWithCount: null, initialize: function initialize() {
+ this._groupTypeBinding = WinJS.Binding.bind(this, {groupType: this._onGroupTypeChange.bind(this)})
+ }, unload: function unload() {
+ if (this._groupTypeBinding) {
+ this._groupTypeBinding.cancel();
+ this._groupTypeBinding = null
+ }
+ if (this._resultCountBinding) {
+ this._resultCountBinding.cancel();
+ this._resultCountBinding = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _onGroupTypeChange: function _onGroupTypeChange(groupType) {
+ if (!this._unloaded && groupType) {
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ this.domElement.parentElement.setAttribute("data-win-automationid", groupType);
+ MS.Entertainment.Framework.assert(!this._resultCountBinding, "Result count binding already exists");
+ switch (groupType) {
+ case Microsoft.Entertainment.Queries.ObjectType.person + String.empty:
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {artistsCount: this._handleCountChange.bind(this)});
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album + String.empty:
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {albumsCount: this._handleCountChange.bind(this)});
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track + String.empty:
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_SONGS_GROUP_HEADER_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {songsCount: this._handleCountChange.bind(this)});
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist + String.empty:
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {playlistsCount: this._handleCountChange.bind(this)});
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video + String.empty:
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {playlistsCount: this._handleCountChange.bind(this)});
+ break;
+ case"collectionMovie":
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_MOVIELOCAL_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {movieLocalCount: this._handleCountChange.bind(this)});
+ break;
+ case"marketplaceMovie":
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_MOVIEMARKETPLACE_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {movieMPCount: this._handleCountChange.bind(this)});
+ break;
+ case"collectionTVSeries":
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_TVSERIESLOCAL_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {tvSeriesLocalCount: this._handleCountChange.bind(this)});
+ break;
+ case"marketplaceTVSeries":
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_TVSERIESMARKETPLACE_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {tvSeriesMPCount: this._handleCountChange.bind(this)});
+ break;
+ case"otherVideo":
+ this._labelWithCount = String.load(String.id.IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL);
+ this._resultCountBinding = WinJS.Binding.bind(searchResultCounts, {otherVideoLocalResultCount: this._handleCountChange.bind(this)});
+ break;
+ case"-1":
+ this.domElement.textContent = String.load(String.id.IDS_MUSIC_SEARCH_TOP_RESULT);
+ break;
+ case"all":
+ this.domElement.textContent = String.load(String.id.IDS_SEARCH_MODIFIER_PIVOT_LABEL);
+ break;
+ default:
+ MS.Entertainment.Pages.assert(false, "unexpected group type");
+ break
+ }
+ }
+ }, _handleCountChange: function _handleCountChange(count) {
+ if (!this._unloaded && count >= 0) {
+ var formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(count);
+ this.domElement.textContent = this._labelWithCount.format(formattedCount)
+ }
+ }
+ }, {groupType: null})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Search/VideoSearchView.js b/packages/microsoft.zunevideo/Components/Search/VideoSearchView.js
new file mode 100644
index 00000000..ff1519ac
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Search/VideoSearchView.js
@@ -0,0 +1,57 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Pages");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {VideoSearchTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Pages.SearchTemplateSelector", function videoSearchTemplateSelector(galleryView) {
+ MS.Entertainment.Pages.SearchTemplateSelector.prototype.constructor.apply(this, arguments);
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ if (galleryView.headerType === MS.Entertainment.UI.Controls.GalleryControl.HeaderType.inPlace)
+ this.addTemplate("header", "/Components/Video/VideoSearchTemplates.html#searchGroupHeaderInPlace");
+ else
+ this.addTemplate("header", "/Components/Video/VideoSearchTemplates.html#searchGroupHeader");
+ this.addTemplate("marketplaceMovie", "/Components/Video/VideoSearchTemplates.html#movieTitleYearTemplate");
+ this.addTemplate("marketplaceTVSeries", "/Components/Video/VideoSearchTemplates.html#tvSeriesSeasonTemplate");
+ this.addTemplate("collectionMovie", "/Components/Video/VideoSearchTemplates.html#movieTitleYearTemplate");
+ this.addTemplate("collectionTVSeries", "/Components/Video/VideoSearchTemplates.html#tvSeriesSeasonTemplate");
+ this.addTemplate("otherVideo", "/Components/Video/VideoCollectionTemplates.html#videoTitleDurationTemplate");
+ this.addTemplate("videoHCR", "/Components/Video/VideoSearchTemplates.html#videoSearchHCRViewTemplate")
+ }
+ else {
+ if (galleryView.headerType === MS.Entertainment.UI.Controls.GalleryControl.HeaderType.inPlace)
+ this.addTemplate("header", "/Components/Video/VideoSearchTemplates2.html#searchGroupHeaderInPlace");
+ else
+ this.addTemplate("header", "/Components/Video/VideoSearchTemplates2.html#searchGroupHeader");
+ this.addTemplate("marketplaceMovie", "/Components/Video/VideoSearchTemplates2.html#cardMovieTitleYearTemplate");
+ this.addTemplate("marketplaceTVSeries", "/Components/Video/VideoSearchTemplates2.html#cardTvSeriesSeasonTemplate");
+ this.addTemplate("collectionMovie", "/Components/Video/VideoSearchTemplates2.html#cardMovieTitleYearTemplate");
+ this.addTemplate("collectionTVSeries", "/Components/Video/VideoSearchTemplates2.html#cardTvSeriesSeasonTemplate");
+ this.addTemplate("otherVideo", "/Components/Video/VideoSearchTemplates2.html#cardVideoTitleDurationTemplate");
+ this.addTemplate("videoHCR", "/Components/Video/VideoSearchTemplates2.html#videoSearchHCRViewTemplate")
+ }
+ }, {ensureItemTemplatesLoaded: function ensureItemTemplatesLoaded() {
+ return this.ensureTemplatesLoaded(["header", "marketplaceMovie", "marketplaceTVSeries", "collectionMovie", "collectionTVSeries", "otherVideo", "videoHCR"])
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {VideoSearchTemplateSelectorAll: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Pages.VideoSearchTemplateSelector", function videoSearchTemplateSelectorAll() {
+ MS.Entertainment.Pages.VideoSearchTemplateSelector.prototype.constructor.apply(this, arguments)
+ }, {getPanelTemplatePath: function getPanelTemplatePath(item) {
+ return this._getPanelTemplatePath(item, MS.Entertainment.UI.NetworkStatusService.isOnline())
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {NewVideoSearch: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.Search", "/Components/Marketplace.html#marketplaceTemplate", function newVideoSearch() {
+ this.templateSelectorConstructor = MS.Entertainment.Pages.VideoSearchTemplateSelectorAll
+ }, {allowEmpty: false})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Video2Search: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.Search", "/Components/Video/VideoMarketplaceTemplates.html#searchGalleryTemplate", null, {}, {}, {
+ tvSeriesSearchTemplateSize: 440, movieSearchTemplateSize: 324, computeSearchItemSize: function computeSearchItemSize(item) {
+ var itemType = WinJS.Utilities.getMember("actionType.mediaType", item) || item.mediaType;
+ switch (itemType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ return MS.Entertainment.ViewModels.VideoMarketplace.tvSeriesLowDensityCardTemplateSize;
+ default:
+ return MS.Entertainment.ViewModels.VideoMarketplace.movieLowDensityCardTemplateSize
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Settings/Settings.js b/packages/microsoft.zunevideo/Components/Settings/Settings.js
new file mode 100644
index 00000000..035fa1a3
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Settings/Settings.js
@@ -0,0 +1,1043 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Utilities.Settings", {
+ onShow: function onShow(sender, id) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).disableTypeToSearch();
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ switch (id) {
+ case"SettingsAccount":
+ eventProvider.traceSettingsAccount_Launch(id);
+ break;
+ case"SettingsAbout":
+ eventProvider.traceSettingsAbout_Launch(id);
+ break;
+ case"SettingsPreferences":
+ eventProvider.traceSettingsPreferences_Launch(id);
+ break;
+ case"SettingsFeedback":
+ eventProvider.traceSettingsFeedback_Launch(id);
+ break;
+ case"SettingsCaptions":
+ eventProvider.traceSettingsCaptions_Launch(id);
+ break
+ }
+ }, onShowComplete: function onShowComplete(sender, id) {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiState.isSettingsCharmVisible = true;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ switch (sender.currentTarget.id) {
+ case"SettingsAccount":
+ eventProvider.traceSettingsAccount_LaunchComplete(sender.currentTarget.id);
+ break;
+ case"SettingsAbout":
+ eventProvider.traceSettingsAbout_LaunchComplete(sender.currentTarget.id);
+ break;
+ case"SettingsPreferences":
+ eventProvider.traceSettingsPreferences_LaunchComplete(sender.currentTarget.id);
+ break;
+ case"SettingsFeedback":
+ eventProvider.traceSettingsFeedback_LaunchComplete(sender.currentTarget.id);
+ break;
+ case"SettingsCaptions":
+ eventProvider.traceSettingsCaptions_LaunchComplete(sender.currentTarget.id);
+ break
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {SettingsWrapper: MS.Entertainment.UI.Framework.defineUserControl(null, function(element, options) {
+ MS.Entertainment.Utilities.Settings.onShow(null, element.parentElement.id)
+ }, {
+ processChildren: true, deferInitialization: true, ignoreChildrenInitialization: true, controlName: "SettingsWrapper", initialize: function initialize() {
+ this.domElement.parentElement.addEventListener("aftershow", MS.Entertainment.Utilities.Settings.onShowComplete, false);
+ this.domElement.parentElement.addEventListener("afterhide", this.onHideComplete, false);
+ if (this._backButton)
+ this._backButton.setAttribute("aria-label", String.load(String.id.IDS_ACC_BACK_BUTTON))
+ }, backToSettings: function backToSettings() {
+ try {
+ WinJS.UI.SettingsFlyout.show()
+ }
+ catch(ex) {
+ MS.Entertainment.Utilities.fail(false, "WinJS.UI.SettingsFlyout.show() fails: " + ex.toString())
+ }
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceSettings_BackToHome("")
+ }, onHideComplete: function onHideComplete(sender, id) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).enableTypeToSearch();
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiState.isSettingsCharmVisible = false
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {PreferenceSettingsWrapper: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Utilities.SettingsWrapper", null, function(element, options){}, {
+ _onIsGrovelingChangedHandler: null, _displayingCredUI: false, _signIn: null, _sessionMgr: null, _configManager: null, initialize: function initialize() {
+ MS.Entertainment.Utilities.SettingsWrapper.prototype.initialize.call(this);
+ this._signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._initializeSignedInSetting();
+ this._initializeMediaLibrarySetting();
+ this._initializeLaunchToCollectionSetting();
+ this._initializeGoOnlineForMetadataSetting();
+ this._initializeSaveMetadataEditSetting();
+ this._initializePromptOnPurchaseSetting();
+ this._initializeDownloadQualitySetting();
+ this._initializeStreamingQualitySetting();
+ this._initializeMusicPassDownloadEnabledSetting();
+ this._initializeCloudCollectionEnabledSetting();
+ this._initializeCloudMatchEnabledSetting();
+ this._initializeCloudCollectionOfflineSetting();
+ this._initializePurchasesSetting();
+ this._initializeFreePlayLimitsSetting()
+ }, forgetMe: function forgetMe() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signOut();
+ this.backToSettings()
+ }, restorePurchases: function restorePurchases() {
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ service.grovel(true, true)
+ }, showLocalGrovelDialog: function showLocalGrovelDialog() {
+ if (WinJS.Utilities.getMember("Windows.Storage.StorageLibrary"))
+ MS.Entertainment.UI.Controls.ManageFoldersDialog.show();
+ else if (MS.Entertainment.Utilities.isMusicApp)
+ MS.Entertainment.Music.localGrovelInfoDialog.show()
+ }, handleKeyDownForLocalGrovelDialog: function handleKeyDownForLocalGrovelDialog(e) {
+ if (e.keyCode !== WinJS.Utilities.Key.enter)
+ return;
+ this.showLocalGrovelDialog();
+ e.stopPropagation();
+ e.preventDefault()
+ }, showCloudCollectionIconInfoDialog: function showCloudCollectionIconInfoDialog() {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ MS.Entertainment.Music.cloudMatchIconDialog.show()
+ }, handleKeyDownForCloudCollectionIconInfoDialog: function handleKeyDownForCloudCollectionIconInfoDialog(e) {
+ if (e.keyCode !== WinJS.Utilities.Key.enter)
+ return;
+ this.showCloudCollectionIconInfoDialog();
+ e.stopPropagation();
+ e.preventDefault()
+ }, showCloudCollectionOptInDialog: function showCloudCollectionOptInDialog() {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ MS.Entertainment.Music.cloudMatchOptInDialog.show()
+ }, handleKeyDownForCloudCollectionOptInDialog: function handleKeyDownForCloudCollectionOptInDialog(e) {
+ if (e.keyCode !== WinJS.Utilities.Key.enter)
+ return;
+ this.showCloudCollectionOptInDialog();
+ e.stopPropagation();
+ e.preventDefault()
+ }, promptToggleChange: function promptToggleChange(event) {
+ if (this.promptOnPurchase.checked)
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.alwaysPromptOnPurchase = this.promptOnPurchase.checked;
+ else if (this._displayingCredUI)
+ return;
+ else {
+ this._displayingCredUI = true;
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_PassportTicket), false, Microsoft.Entertainment.Util.SignInPromptType.retypeCredentials).then(function success(t) {
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.alwaysPromptOnPurchase = false;
+ WinJS.UI.SettingsFlyout.showSettings("SettingsPreferences", "/Components/Settings/SettingsPreferences.html")
+ }.bind(this), function getPassportTicketError(errTicket) {
+ MS.Entertainment.Utilities.assert(false, "Toggling prompt preferences fails with error code: " + errTicket.number)
+ })
+ }
+ }, downloadQualityClicked: function downloadQualityClicked() {
+ if (this._downloadHD.checked)
+ MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference = MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd;
+ else if (this._downloadSD.checked)
+ MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference = MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd;
+ else
+ MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference = null
+ }, streamingQualityOverlayToggleChange: function streamingQualityOverlayToggleChange(event) {
+ MS.Entertainment.UI.Controls.assert(this._sessionMgr.primarySession, "streamingQualityOverlayToggleChange called at unexpected time with no playbackSession");
+ if (this._sessionMgr.primarySession) {
+ this._sessionMgr.primarySession.enableVideoNetstats = !!this.streamingQualityOverlay.checked;
+ Windows.Storage.ApplicationData.current.roamingSettings.values["enableVideoNetstats"] = !!this.streamingQualityOverlay.checked
+ }
+ }, musicPassDownloadEnabledToggleChange: function musicPassDownloadEnabledToggleChange() {
+ var checkSettingAllowedPromise = WinJS.Promise.wrap();
+ if (this.musicPassDownloadEnabled.checked)
+ checkSettingAllowedPromise = MS.Entertainment.UI.SubscriptionDownload.verifyMachineActivationIsNotAtLimit();
+ checkSettingAllowedPromise.then(function settingIsAllowed() {
+ (Microsoft.Entertainment.Configuration.ConfigurationManager()).music.musicPassDownloadEnabled = this.musicPassDownloadEnabled.checked;
+ this._initializeCloudCollectionOfflineSetting();
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(MS.Entertainment.Utilities.PreferenceSettingsWrapper.TelemetryEvents.MusicPassDownloadEnabledStateChanged, MS.Entertainment.Utilities.PreferenceSettingsWrapper.States.MusicPassDownloadEnabledState, this.musicPassDownloadEnabled.checked)
+ }.bind(this), function settingIsNotAllowed(errorCode) {
+ if (errorCode === MS.Entertainment.UI.SubscriptionDownload.deviceActivationLimitExceededErrorCode) {
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_DOWNLOAD_ERROR_CAPTION), errorCode);
+ this.musicPassDownloadEnabled.checked = false
+ }
+ }.bind(this))
+ }, cloudCollectionEnabledToggleChange: function cloudCollectionEnabledToggleChange(event) {
+ var cloudCollectionService = this._getCloudCollectionService();
+ if (cloudCollectionService) {
+ cloudCollectionService.isEnabled = this.cloudCollectionEnabled.checked;
+ this._updateCloudCollectionDescription(cloudCollectionService.isEnabled);
+ this._initializeCloudCollectionOfflineSetting();
+ this._initializeCloudMatchEnabledSetting();
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(MS.Entertainment.Utilities.PreferenceSettingsWrapper.TelemetryEvents.CloudCollectionEnabledStateChanged, MS.Entertainment.Utilities.PreferenceSettingsWrapper.States.CloudCollectionEnabledState, this.cloudCollectionEnabled.checked)
+ }
+ }, cloudMatchEnabledToggleChange: function cloudMatchEnabledToggleChange(event) {
+ var cloudCollectionService = this._getCloudCollectionService();
+ if (cloudCollectionService) {
+ var optIn = this.cloudMatchEnabled.checked ? MS.Entertainment.CloudCollectionService.CloudMatchStatus.OptedIn : MS.Entertainment.CloudCollectionService.CloudMatchStatus.OptedOut;
+ cloudCollectionService.setCloudMatchOptIn(optIn);
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(MS.Entertainment.Utilities.PreferenceSettingsWrapper.TelemetryEvents.CloudMatchEnabledStateChanged, MS.Entertainment.Utilities.PreferenceSettingsWrapper.States.CloudMatchEnabledState, this.cloudMatchEnabled.checked, MS.Entertainment.Utilities.Telemetry.Events.CloudMatchStateChangeMethod, MS.Entertainment.Utilities.Telemetry.StateChangeMethodValues.toggle)
+ }
+ }, cloudCollectionOfflineToggleChange: function cloudCollectionOfflineToggleChange(event) {
+ var checkSettingAllowedPromise = WinJS.Promise.wrap();
+ if (this.cloudCollectionOffline.checked)
+ checkSettingAllowedPromise = MS.Entertainment.UI.SubscriptionDownload.verifyMachineActivationIsNotAtLimit();
+ checkSettingAllowedPromise.then(function settingIsAllowed() {
+ var cloudCollectionService = this._getCloudCollectionService();
+ if (cloudCollectionService)
+ cloudCollectionService.autoDownloadEnabled = this.cloudCollectionOffline.checked;
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(MS.Entertainment.Utilities.PreferenceSettingsWrapper.TelemetryEvents.CloudCollectionAutoDownloadStateChanged, MS.Entertainment.Utilities.PreferenceSettingsWrapper.States.CloudCollectionAutoDownloadState, this.cloudCollectionOffline.checked)
+ }.bind(this), function settingIsNotAllowed(errorCode) {
+ if (errorCode === MS.Entertainment.UI.SubscriptionDownload.deviceActivationLimitExceededErrorCode) {
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_DOWNLOAD_ERROR_CAPTION), errorCode);
+ this.cloudCollectionOffline.checked = false
+ }
+ }.bind(this))
+ }, goOnlineForMetadataChange: function goOnlineForMetadataChange(event) {
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).mdlc.connectToInternetForAlbumMetadata = this.goOnlineForMetadata.checked
+ }, saveMetadataEditChange: function saveMetadataEditChange(event) {
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).mediaStore.writeOutMetadata = this.saveMetadataEditToggleSwitch.checked
+ }, launchToCollectionChange: function launchToCollectionChange(event) {
+ var launchLocation;
+ if (this.launchToCollection.checked)
+ if (MS.Entertainment.Utilities.isMusicApp)
+ launchLocation = MS.Entertainment.UI.Monikers.musicCollection;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ launchLocation = MS.Entertainment.UI.Monikers.videoCollection;
+ var settingsStorage = null;
+ if (MS.Entertainment.Utilities.isApp1)
+ settingsStorage = Windows.Storage.ApplicationData.current.roamingSettings;
+ else
+ settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ if (launchLocation)
+ settingsStorage.values["launchLocation"] = launchLocation;
+ else
+ settingsStorage.values.remove("launchLocation")
+ }, _getCloudCollectionService: function _getCloudCollectionService() {
+ if (MS.Entertainment.Utilities.isMusicApp && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.cloudCollection))
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection);
+ return null
+ }, _initializeMediaLibrarySetting: function _initializeMediaLibrarySetting() {
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ this.libraryPreferencesTitle.text = String.load(String.id.IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE);
+ if (WinJS.Utilities.getMember("Windows.Storage.StorageLibrary"))
+ this.libraryPreferencesWebLink.stringId = String.id.IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK;
+ else {
+ this.libraryPreferencesText.text = String.load(String.id.IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT);
+ this.libraryPreferencesWebLink.stringId = String.id.IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK
+ }
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp) {
+ this.libraryPreferencesTitle.text = String.load(String.id.IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE);
+ if (WinJS.Utilities.getMember("Windows.Storage.StorageLibrary"))
+ this.libraryPreferencesWebLink.stringId = String.id.IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK;
+ else {
+ this.libraryPreferencesText.text = String.load(String.id.IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT);
+ this.libraryPreferencesWebLink.stringId = String.id.IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK;
+ this.libraryPreferencesWebLink.domElement.href = MS.Entertainment.UI.FWLink.videoLibraries
+ }
+ }
+ else
+ this._hideElement(this.libraryPreferences)
+ }, _initializeSignedInSetting: function _initializeSignedInSetting() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this._signIn.isSignedIn && config.shell.showRemoveInPreferences) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this.currentUserId.text = String.load(String.id.IDS_SETTINGS_ACCOUNT_CURRENT_USER).format(signedInUser.signInName);
+ if (!signedInUser.canSignOut) {
+ this._hideElement(this.forgetMeButton);
+ this._hideElement(this.forgetMeDesc)
+ }
+ }
+ else
+ this._hideElement(this.switchUserContainer)
+ }, _initializePromptOnPurchaseSetting: function _initializePromptOnPurchaseSetting() {
+ if (this._signIn.isSignedIn && (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.showPromptOnPurchaseSetting) {
+ this.promptOnPurchase.title = String.load(String.id.IDS_SETTINGS_PROMPT_TOGGLE_TITLE);
+ this.promptOnPurchase.checked = (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.alwaysPromptOnPurchase
+ }
+ else
+ this._hideElement(this.promptOnPurchaseContainer)
+ }, _initializeDownloadQualitySetting: function _initializeDownloadQualitySetting() {
+ if (!MS.Entertainment.Utilities.isVideoApp)
+ this._hideElement(this.downloadQualityContainer);
+ else {
+ this._downloadHD.checked = MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd;
+ this._downloadSD.checked = MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd;
+ this._downloadPrompt.checked = MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference !== MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd && MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference !== MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd
+ }
+ }, _initializeStreamingQualitySetting: function _initializeStreamingQualitySetting() {
+ if (MS.Entertainment.Utilities.isVideoApp1 && this._configManager.playback.enableVideoQualitySelector) {
+ var playbackSession = this._sessionMgr.primarySession;
+ this._showElement(this.streamingQualityContainer);
+ this.streamingQualityOverlay.checked = !!(Windows.Storage.ApplicationData.current.roamingSettings.values["enableVideoNetstats"]);
+ if (WinJS.Utilities.getMember("currentMedia.availableVideoBitrates", playbackSession)) {
+ this._populateBitrateSelectionList(playbackSession.currentMedia.availableVideoBitrates, playbackSession.currentRequestedBitrate);
+ this._showElement(this.streamingQualityOptionsContainer)
+ }
+ else
+ this._hideElement(this.streamingQualityOptionsContainer)
+ }
+ }, _populateBitrateSelectionList: function _populateBitrateSelectionList(availableVideoBitrates, requestedBitrate) {
+ var item = new MS.Entertainment.UI.Controls.VideoBitrateSelectorItem(document.createElement("div"), {
+ bitrate: null, checked: !requestedBitrate
+ });
+ this.streamingQualityOptionsContainer.appendChild(item.domElement);
+ availableVideoBitrates.map(function generateItem(bitrate) {
+ var item = new MS.Entertainment.UI.Controls.VideoBitrateSelectorItem(document.createElement("div"), {
+ bitrate: bitrate, checked: bitrate === requestedBitrate
+ });
+ this.streamingQualityOptionsContainer.appendChild(item.domElement)
+ }.bind(this))
+ }, _updateMusicDownloadSettingsContainer: function _updateMusicDownloadSettingsContainer() {
+ if (this._isCloudCollectionOfflineAvailable() || this._isMusicPassDownloadAvailable())
+ this._showElement(this.downloadSettingsContainer);
+ else
+ this._hideElement(this.downloadSettingsContainer)
+ }, _isMusicPassDownloadAvailable: function _isMusicPassDownloadAvailable() {
+ return MS.Entertainment.Utilities.isMusicApp && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).isSubscription
+ }, _initializeMusicPassDownloadEnabledSetting: function _initializeMusicPassDownloadEnabledSetting() {
+ if (this._isMusicPassDownloadAvailable()) {
+ this.musicPassDownloadEnabled.title = String.load(String.id.IDS_MUSIC_SETTINGS_MUSIC_PASS_DOWNLOAD_DESCRIPTION);
+ this.musicPassDownloadEnabled.checked = (new Microsoft.Entertainment.Configuration.ConfigurationManager).music.musicPassDownloadEnabled
+ }
+ else
+ this._hideElement(this.musicPassDownloadEnabledSettingsContainer);
+ this._updateMusicDownloadSettingsContainer()
+ }, _initializeCloudCollectionEnabledSetting: function _initializeCloudCollectionEnabledSetting() {
+ var cloudCollectionService = this._getCloudCollectionService();
+ if (MS.Entertainment.Utilities.isMusicApp && cloudCollectionService && cloudCollectionService.isAvailable && !cloudCollectionService.isV2Enabled && this._signIn.isSignedIn) {
+ var isCloudCollectionEnabled = cloudCollectionService.isEnabled;
+ this.cloudCollectionEnabled.checked = isCloudCollectionEnabled;
+ this._updateCloudCollectionDescription(isCloudCollectionEnabled)
+ }
+ else {
+ this._hideElement(this.cloudCollectionEnabledSettingsContainer);
+ this._hideElement(this.cloudCollectionOfflineSettingsContainer);
+ this._hideElement(this.cloudIconInfoWebLink)
+ }
+ this._updateMusicDownloadSettingsContainer()
+ }, _updateCloudCollectionDescription: function _updateCloudCollectionDescription(isCloudCollectionEnabled) {
+ this.cloudCollectionEnabled.title = isCloudCollectionEnabled ? String.load(String.id.IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_ON_DESCRIPTION) : String.load(String.id.IDS_MUSIC_SETTINGS_CLOUD_COLLECTION_OFF_DESCRIPTION)
+ }, _initializeCloudMatchEnabledSetting: function _initializeCloudMatchEnabledSetting() {
+ var cloudCollectionService = this._getCloudCollectionService();
+ if (MS.Entertainment.Utilities.isMusicApp && cloudCollectionService && cloudCollectionService.isEnabled && !cloudCollectionService.isV2Enabled) {
+ this.cloudMatchEnabled.checked = cloudCollectionService.isCloudMatchOptedIn;
+ this.cloudMatchEnabled.title = String.load(String.id.IDS_MUSIC_CLOUD_SETTINGS_MATCH_TOGGLE_DESC);
+ this._showElement(this.cloudMatchSettingContainer)
+ }
+ else
+ this._hideElement(this.cloudMatchSettingContainer)
+ }, _isCloudCollectionOfflineAvailable: function _isCloudCollectionOfflineAvailable() {
+ var cloudCollectionService = this._getCloudCollectionService();
+ return MS.Entertainment.Utilities.isMusicApp && cloudCollectionService && cloudCollectionService.isEnabled && (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn)).isSignedIn && (Microsoft.Entertainment.Configuration.ConfigurationManager()).music.musicPassDownloadEnabled
+ }, _initializeCloudCollectionOfflineSetting: function _initializeCloudCollectionOfflineSetting() {
+ if (this._isCloudCollectionOfflineAvailable()) {
+ var isSubscriptionUser = (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser)).isSubscription;
+ this.cloudCollectionOffline.title = isSubscriptionUser ? String.load(String.id.IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE) : String.load(String.id.IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE);
+ this.cloudCollectionOffline.checked = this._getCloudCollectionService().autoDownloadEnabled;
+ this._showElement(this.cloudCollectionOfflineSettingsContainer)
+ }
+ else {
+ var cloudCollectionService = this._getCloudCollectionService();
+ if (cloudCollectionService)
+ cloudCollectionService.autoDownloadEnabled = false;
+ this._hideElement(this.cloudCollectionOfflineSettingsContainer)
+ }
+ this._updateMusicDownloadSettingsContainer()
+ }, _initializeLaunchToCollectionSetting: function _initializeLaunchToCollectionSetting() {
+ var enableMusicSetting;
+ var enableVideoSetting;
+ var appMode = MS.Entertainment.appMode;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ var musicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ enableMusicSetting = musicMarketplaceEnabled && !window.onNewMusicPage
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp) {
+ var moviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ enableVideoSetting = moviesMarketplaceEnabled || tvMarketplaceEnabled
+ }
+ var settingsStorage = null;
+ if (MS.Entertainment.Utilities.isApp1)
+ settingsStorage = Windows.Storage.ApplicationData.current.roamingSettings;
+ else
+ settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ if (enableMusicSetting) {
+ this.launchToCollection.title = String.load(String.id.IDS_MUSIC_SETTINGS_STARTUP_VIEW_DESC);
+ this.launchToCollection.checked = !!(settingsStorage.values["launchLocation"])
+ }
+ else if (enableVideoSetting) {
+ this.launchToCollection.title = String.load(String.id.IDS_VIDEO_SETTINGS_STARTUP_VIEW_DESC);
+ this.launchToCollection.checked = !!(settingsStorage.values["launchLocation"])
+ }
+ else
+ this._hideElement(this.launchToCollectionContainer)
+ }, _initializeGoOnlineForMetadataSetting: function _initializeGoOnlineForMetadataSetting() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ this.goOnlineForMetadata.title = String.load(String.id.IDS_MUSIC_SETTINGS_MEDIA_INFO_DESC);
+ this.goOnlineForMetadata.checked = (new Microsoft.Entertainment.Configuration.ConfigurationManager).mdlc.connectToInternetForAlbumMetadata
+ }
+ else
+ this._hideElement(this.goOnlineForMetadataContainer)
+ }, _initializeSaveMetadataEditSetting: function _initializeSaveMetadataEditSetting() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isMusicApp && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.metadataEdit)) {
+ this.saveMetadataEditToggleSwitch.title = String.load(String.id.IDS_MUSIC_SETTINGS_METADATA_SAVE_DESC);
+ this.saveMetadataEditToggleSwitch.checked = (new Microsoft.Entertainment.Configuration.ConfigurationManager).mediaStore.writeOutMetadata
+ }
+ else
+ this._hideElement(this.saveMetadataEditContainer)
+ }, _onIsGrovelingChanged: function _onIsGrovelingChanged(isGroveling) {
+ if (isGroveling) {
+ this.restorePurchaseButtonLabel.stringId = String.id.IDS_VIDEO_SETTINGS_PURCHASES_RESTORING_BUTTON;
+ this.restorePurchaseButton.disabled = true
+ }
+ else {
+ this.restorePurchaseButtonLabel.stringId = String.id.IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_BUTTON;
+ this.restorePurchaseButton.disabled = false
+ }
+ }, _initializePurchasesSetting: function _initializePurchasesSetting() {
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ var hideSetting = true;
+ if (service && MS.Entertainment.UI.PurchaseHistoryService.isFeatureEnabled && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn && MS.Entertainment.Utilities.isVideoApp) {
+ var networkStatus = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).networkStatus;
+ switch (networkStatus) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ break;
+ default:
+ hideSetting = false;
+ this._onIsGrovelingChangedHandler = this._onIsGrovelingChanged.bind(this);
+ service.bind("isGroveling", this._onIsGrovelingChangedHandler);
+ break
+ }
+ }
+ if (hideSetting)
+ this._hideElement(this.purchasesContainer)
+ }, _initializeFreePlayLimitsSetting: function _initializeFreePlayLimitsSetting() {
+ this._hideElement(this.freePlayLimitsContainer);
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits))
+ return;
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!signIn.isSignedIn || signedInUser.isSubscription)
+ return;
+ var freePlayLimits = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits);
+ freePlayLimits.getLimits().done(function getLimitsComplete(limits) {
+ if (limits && limits.freeTrialCompleted) {
+ if (!limits.monthlyFreeLimitExceeded)
+ this._hideElement(this.freePlayLimitsMonthlyLimitExceeded);
+ this.preferenceFreePlayLimitMeter.max = limits.monthlyFreeMinutesAllowance;
+ this.preferenceFreePlayLimitMeter.value = limits.monthlyFreeMinutesUsed;
+ var percentageUsed = 0;
+ if (limits.monthlyFreeMinutesUsed >= limits.monthlyFreeMinutesAllowance)
+ percentageUsed = 100;
+ else if (limits.monthlyFreeMinutesAllowance > 0)
+ percentageUsed = (limits.monthlyFreeMinutesUsed / limits.monthlyFreeMinutesAllowance) * 100;
+ percentageUsed = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(Math.round(percentageUsed));
+ this.freePlayLimitsMeterPercentageLabel.textContent = String.load(String.id.IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE).format(percentageUsed);
+ var monthlyFreeHoursAllowance = Math.max(Math.floor(limits.monthlyFreeMinutesAllowance / 60), 0);
+ var dateFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).dayMonthYear;
+ var nextMonthlyFreeLimitResetDate = dateFormatter.format(limits.nextMonthlyFreeLimitResetDate);
+ var monthlyHoursPluralFormatString = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_MUSIC_SETTINGS_MONTHLY_LIMIT_DESC_PLURAL, monthlyFreeHoursAllowance);
+ this.freePlayLimitsMonthlyUsageLabel.text = monthlyHoursPluralFormatString.format(monthlyFreeHoursAllowance, nextMonthlyFreeLimitResetDate);
+ this._showElement(this.freePlayLimitsContainer)
+ }
+ }.bind(this), function getLimitsError(){})
+ }, onSubscribe: function onSubscribe() {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.limitSettingsSubscribe);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionSignup);
+ action.automationId = MS.Entertainment.UI.AutomationIds.settingsSubscriptionSignup;
+ action.execute()
+ }, handleOnSubscribeKeyDown: function handleOnSubscribeKeyDown(e) {
+ if (e.keyCode !== WinJS.Utilities.Key.enter)
+ return;
+ this.onSubscribe()
+ }, unload: function unload() {
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ if (service && this._onIsGrovelingChangedHandler) {
+ service.unbind("isGroveling", this._onIsGrovelingChangedHandler);
+ this._onIsGrovelingChangedHandler = null
+ }
+ MS.Entertainment.Utilities.SettingsWrapper.prototype.unload.call(this)
+ }, _showElement: function _showElement(element) {
+ if (element.domElement)
+ element = element.domElement;
+ WinJS.Utilities.removeClass(element, "removeFromDisplay")
+ }, _hideElement: function _hideElement(element) {
+ if (element.domElement)
+ element = element.domElement;
+ WinJS.Utilities.addClass(element, "removeFromDisplay")
+ }
+ }, null, {
+ TelemetryEvents: {
+ MusicPassDownloadEnabledStateChanged: "MusicPassDownloadEnabledStateChanged", CloudCollectionEnabledStateChanged: "CloudCollectionEnabledStateChanged", CloudCollectionAutoDownloadStateChanged: "CloudCollectionAutoDownloadStateChanged", CloudMatchEnabledStateChanged: "CloudMatchEnabledStateChanged"
+ }, States: {
+ MusicPassDownloadEnabledState: "MusicPassDownloadEnabledState", CloudCollectionEnabledState: "CloudCollectionEnabledState", CloudCollectionAutoDownloadState: "CloudCollectionAutoDownloadState", CloudMatchEnabledState: "CloudMatchEnabledState"
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VideoBitrateSelectorItem: MS.Entertainment.UI.Framework.defineUserControl("/Components/Settings/SettingsPreferences.html#videoBitrateSelectorItemTemplate", function videoBitrateSelectorItemConstructor(element, options){}, {
+ initialize: function initialize() {
+ this._label.displayText = (this.bitrate === null) ? String.load(String.id.IDS_VIDEO_STREAMING_QUALITY_SELECTOR_OPTION_AUTOMATIC) : (this.bitrate / 1000) + "kbps";
+ this._input.checked = !!this.checked
+ }, onBitrateSelectorItemClick: function onBitrateSelectorItemClick(event) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ MS.Entertainment.UI.Controls.assert(playbackSession, "Video bitrate is selected at unexpected time with no playback session");
+ if (playbackSession)
+ playbackSession.selectVideoBitrate(this.bitrate)
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {CaptionSettingsWrapper: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Utilities.SettingsWrapper", null, function(element, options) {
+ var optionElements = ["characterColors", "characterOpacity", "characterSizes", "characterFonts", "backgroundColors", "backgroundOpacity", "windowColors", "windowOpacity", "characterEdges"];
+ var possibleColors = [{
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_DEFAULT), value: ""
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_WHITE), value: "255,255,255"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_BLACK), value: "0,0,0"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_RED), value: "255,0,0"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_GREEN), value: "0,255,0"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_BLUE), value: "0,0,255"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_YELLOW), value: "255,255,0"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA), value: "255,0,255"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_COLOR_CYAN), value: "0,255,255"
+ }];
+ var opacityOptions = [{
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_DEFAULT), value: ""
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE), value: "1.0"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT), value: "0.5"
+ }];
+ var elementToSettingNameMap = {
+ backgroundColors: {textBackgroundColor: 0}, characterColors: {textColor: 0}, characterOpacity: {textOpacity: 0}, backgroundOpacity: {textBackgroundOpacity: 0}, characterFonts: {textFontFamily: 0}, characterSizes: {textFontSize: 1}, windowColors: {regionBackgroundColor: 0}, windowOpacity: {regionOpacity: 0}, characterEdges: {textEdgeAttributeEnum: 0}
+ };
+ var choices = {
+ characterColors: possibleColors, backgroundColors: possibleColors, windowColors: possibleColors, characterOpacity: [{
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_DEFAULT), value: ""
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE), value: "1.0"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT), value: "0.5"
+ }], backgroundOpacity: opacityOptions, windowOpacity: opacityOptions, characterSizes: [{
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_SIZE_50), value: "50%"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_SIZE_100), value: "100%"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_SIZE_150), value: "150%"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_SIZE_200), value: "200%"
+ }], characterFonts: [{
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_DEFAULT), value: ""
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF), value: "courier"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF), value: "times roman"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS), value: "consolas"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS), value: "arial"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_FONT_CASUAL), value: "comic sans ms"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_FONT_CURSIVE), value: "segoe script"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS), value: "trebuchet ms"
+ }], characterEdges: [{
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_DEFAULT), value: "0"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_EDGE_NONE), value: "1"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_EDGE_RAISED), value: "2"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED), value: "3"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED), value: "4"
+ }, {
+ name: String.load(String.id.IDS_SETTINGS_CAPTIONS_EDGE_DROP), value: "5"
+ }]
+ };
+ var ccSettings = MS.Entertainment.Platform.Playback.ClosedCaptions.Renderer.loadClosedCaptionStyleSettings();
+ var wrapper = this;
+ function dumpCurrentSettings() {
+ var settings = {};
+ optionElements.forEach(function storeSelection(name) {
+ var settingEntry = elementToSettingNameMap[name];
+ var settingName = Object.keys(settingEntry)[0];
+ settings[settingName] = wrapper[name].options[wrapper[name].options.selectedIndex].value
+ });
+ return settings
+ }
+ {};
+ function updatePreviewWindow() {
+ var settings = dumpCurrentSettings();
+ updateSelectBox(wrapper.characterOpacity, settings.textColor !== String.empty);
+ updateSelectBox(wrapper.backgroundOpacity, settings.textBackgroundColor !== String.empty);
+ updateSelectBox(wrapper.windowOpacity, settings.regionBackgroundColor !== String.empty);
+ MS.Entertainment.Platform.Playback.ClosedCaptions.Renderer.updateClosedCaptionStyleSettings(settings, true)
+ }
+ {};
+ function initElements(elementNames) {
+ elementNames.forEach(function initElement(name) {
+ initOptions(choices[name], wrapper[name], name)
+ })
+ }
+ {};
+ function initOptions(possibleOptions, element, name) {
+ possibleOptions.forEach(function load(option) {
+ var opt = document.createElement("option");
+ element.options.add(opt);
+ opt.label = option.name;
+ opt.value = option.value
+ });
+ var settingEntry = elementToSettingNameMap[name];
+ var settingName = Object.keys(settingEntry)[0];
+ var settingIndex = settingEntry[settingName];
+ var settingValue = ccSettings[settingName];
+ if (settingValue !== undefined && settingValue !== null)
+ for (var index = 0; index < possibleOptions.length; index++)
+ if (possibleOptions[index].value === settingValue) {
+ settingIndex = index;
+ break
+ }
+ element.options.selectedIndex = settingIndex
+ }
+ function updateSelectBox(selectBox, enable) {
+ if (!selectBox)
+ return;
+ if (!enable) {
+ selectBox.setAttribute("disabled", "disabled");
+ selectBox.selectedIndex = 0
+ }
+ else
+ selectBox.removeAttribute("disabled")
+ }
+ this.initialize = function CaptionSettingsWrapper_initialize() {
+ MS.Entertainment.Utilities.SettingsWrapper.prototype.initialize.call(this);
+ this.domElement.parentElement.addEventListener("beforehide", this.onSettingsDismiss.bind(this), false);
+ this.previewText.innerText = String.load(String.id.IDS_SETTINGS_CAPTIONS_PREVIEW);
+ initElements(optionElements);
+ updatePreviewWindow()
+ };
+ this.onReset = function CaptionSettingsWrapper_onReset() {
+ optionElements.forEach(function resetIndex(name) {
+ var settingEntry = elementToSettingNameMap[name];
+ var settingName = Object.keys(settingEntry)[0];
+ var settingDefaultIndex = settingEntry[settingName];
+ this[name].options.selectedIndex = settingDefaultIndex
+ }, this);
+ updatePreviewWindow()
+ };
+ this.onSettingsDismiss = function CaptionSettingsWrapper_onSettingsDismiss() {
+ var settings = dumpCurrentSettings();
+ MS.Entertainment.Platform.Playback.ClosedCaptions.Renderer.saveClosedCaptionStyleSettings(settings);
+ MS.Entertainment.Platform.Playback.ClosedCaptions.Renderer.updateClosedCaptionStyleSettings(settings)
+ };
+ this.captionSettingsChange = function CaptionSettingsWrapper_captionSettingsChange() {
+ updatePreviewWindow()
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {AboutSettingsWrapper: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Utilities.SettingsWrapper", null, function aboutSettingsWrapperConstructor(element, options){}, {
+ initialize: function initialize() {
+ MS.Entertainment.Utilities.SettingsWrapper.prototype.initialize.call(this);
+ var helpLink;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ helpLink = "http://go.microsoft.com/fwlink/p/?LinkId=255543";
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ helpLink = "http://go.microsoft.com/fwlink/p/?LinkId=255544";
+ if (helpLink)
+ this.helpLink.domElement.setAttribute("href", helpLink);
+ this._showOrHideCopyrights();
+ if (this.settingsAboutEchonestImage && MS.Entertainment.Utilities.isMusicApp)
+ this.settingsAboutEchonestImage.setAttribute("aria-label", String.load(String.id.IDS_MUSIC_ECHONEST_ALT_TEXT));
+ this._showOrHideEchonestRadio();
+ var imprintLinkUrl = this._getImprintLink();
+ if (imprintLinkUrl && WinJS.Utilities.getMember("imprintLink.domElement", this)) {
+ this.imprintLink.stringId = String.id.IDS_SETTINGS_IMPRINT_LEGAL_LINK_TITLE;
+ this.imprintLink.domElement.setAttribute("href", imprintLinkUrl);
+ WinJS.Utilities.removeClass(this.imprintLink.domElement, "removeFromDisplay")
+ }
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (config.generalSettings.showPerfTrackLog) {
+ var perfTrackLog = "";
+ MS.Entertainment.Instrumentation.PerfTrack.triggerLog.forEach(function perfTrackLogEntry(logEntry) {
+ perfTrackLog += logEntry + "\n"
+ });
+ this.perfTrackLog.value = perfTrackLog;
+ WinJS.Utilities.removeClass(this.perfTrackLog, "removeFromDisplay")
+ }
+ else if (WinJS.Utilities.getMember("MS.Entertainment.UI.Application.Helpers.perfMessages.length") > 0) {
+ var perfTrackLog = "";
+ for (var i = -0; i < MS.Entertainment.UI.Application.Helpers.perfMessages.length; i++)
+ perfTrackLog += MS.Entertainment.UI.Application.Helpers.perfMessages[i] + "\n";
+ this.perfTrackLog.value = perfTrackLog;
+ WinJS.Utilities.removeClass(this.perfTrackLog, "removeFromDisplay")
+ }
+ }, _showOrHideCopyrights: function _showOrHideCopyrights() {
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ WinJS.Utilities.removeClass(this.copyrights, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.gracenoteCopyright, "removeFromDisplay")
+ }
+ else
+ WinJS.Utilities.addClass(this.copyrights, "removeFromDisplay")
+ }, _showOrHideEchonestRadio: function _showOrHideEchonestRadio() {
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var showEchonestRadio = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.smartDJMarketplace);
+ if (showEchonestRadio)
+ WinJS.Utilities.removeClass(this.settingsAboutEchonestRadioContainer, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this.settingsAboutEchonestRadioContainer, "removeFromDisplay")
+ }
+ }, _getImprintLink: function _getImprintLink() {
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ var currentRegion = globalizationManager.getRegion().toLowerCase();
+ var link = String.empty;
+ switch (currentRegion) {
+ case"at":
+ link = "http://go.microsoft.com/fwlink/?LinkId=317759&clcid=0xc07";
+ break;
+ case"de":
+ link = "http://go.microsoft.com/fwlink/?LinkId=317760&clcid=0x407";
+ break;
+ case"ch":
+ link = "http://go.microsoft.com/fwlink/?LinkId=317761&clcid=0x807";
+ break
+ }
+ return link
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {SettingsVersion: MS.Entertainment.UI.Framework.defineUserControl(null, function SettingsVersionConstructor(element) {
+ this.versionPromise = MS.Entertainment.Utilities.getVersionString()
+ }, {
+ controlName: "SettingsVersion", versionPromise: null, initialize: function initialize() {
+ MS.Entertainment.Utilities.assert(this.versionPromise, "Promise to load the version string hasn't been set");
+ this.versionPromise.then(function(v) {
+ this.domElement.textContent = v
+ }.bind(this))
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ AccountSettingsWrapper: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Utilities.SettingsWrapper", null, function AccountSettingsWrapper_constructor(){}, {
+ _signInHandler: null, _signIn: null, _signedInUser: null, _actionService: null, initialize: function initialize() {
+ MS.Entertainment.Utilities.SettingsWrapper.prototype.initialize.call(this);
+ this.domElement.parentElement.addEventListener("aftershow", MS.Entertainment.Utilities.Settings.onShowComplete, false);
+ this.domElement.parentElement.addEventListener("beforehide", this.onAccountPanelHide, false);
+ this._signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this._actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ this.onAccountShow();
+ if (this._backButton)
+ this._backButton.setAttribute("aria-label", String.load(String.id.IDS_ACC_BACK_BUTTON))
+ }, unload: function unload() {
+ if (this._signInHandler)
+ this._signIn.unbind("isSignedIn", this._signInHandler);
+ MS.Entertainment.Utilities.SettingsWrapper.prototype.unload.call(this)
+ }, onAccountShow: function onAccountShow() {
+ if (!this._signIn.isSignedIn) {
+ this._onlineAccountPanel.style.visibility = "collapse";
+ this._offlineAccountPanel.style.visibility = "visible";
+ this._signInHandler = this._onSignInChange.bind(this);
+ this._signIn.bind("isSignedIn", this._signInHandler)
+ }
+ else
+ this._loadXboxAccountSummaryPage()
+ }, onAccountPanelHide: function onAccountPanelHide(sender, id) {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiState.isSettingsCharmVisible = false;
+ var accountPanel = sender.currentTarget;
+ if (accountPanel) {
+ MS.Entertainment.UI.assert(accountPanel.winControl._dismiss, "accountPanel.winControl._dismiss missing");
+ accountPanel.winControl._dismiss()
+ }
+ if (MS.Entertainment.Utilities.Settings._signInHandler) {
+ this._signIn.unbind("isSignedIn", this._signInHandler);
+ this._signInHandler = null
+ }
+ }, _loadXboxAccountSummaryPage: function _loadXboxAccountSummaryPage() {
+ if (this._onlineAccountPanel && this._signIn.isSignedIn) {
+ this._offlineAccountPanel.style.visibility = "collapse";
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ if ((new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement).isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSubscription)) {
+ WinJS.Utilities.removeClass(this._musicPassButton, "removeFromDisplay");
+ this._musicPassLevel.stringId = this._getMusicPassInformationStringId()
+ }
+ if (this._signedInUser.isSubscription)
+ WinJS.Utilities.removeClass(this._musicDevicesButton, "removeFromDisplay")
+ }
+ this._accountEmail.text = this._signedInUser.signInName;
+ if (this._signedInUser.canSignOut)
+ this._accountHeader.stringId = String.id.IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC;
+ else
+ this._accountHeader.stringId = String.id.IDS_SETTINGS_ACCOUNT_TITLE;
+ this._onlineAccountPanel.style.visibility = "visible";
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.LoadXboxAccountSummaryPage)
+ }
+ }, _getMusicPassInformationStringId: function _getMusicPassInformationStringId() {
+ if (!this._signedInUser.isSubscription)
+ return String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC;
+ var stringIdToReturn = MS.Entertainment.Utilities.AccountSettingsWrapper._musicPassSubscriptionStringMap[this._signedInUser.subscriptionOfferID];
+ if (!stringIdToReturn)
+ stringIdToReturn = String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC;
+ return stringIdToReturn
+ }, _redeemCodeClick: function _redeemCodeClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var url = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_ModernPurchase) + "/redeem?client=x13";
+ this._openWebblendDialog(url);
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.RedeemCodeClick)
+ }, _musicPassSubscribeClick: function _musicPassSubscribeClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionSignup);
+ action.automationId = MS.Entertainment.UI.AutomationIds.settingsSubscriptionSignup;
+ action.execute();
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicPassSubscribeClick)
+ }, _manageMusicDevices: function _manageMusicDevices(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.navigateToUrl(MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/devices/manage", MS.Entertainment.UI.AutomationIds.settingsAccountManageDevices);
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.ManageMusicDevices)
+ }, _managePaymentOptionsClick: function _managePaymentOptionsClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.navigateToUrl("http://go.microsoft.com/fwlink/?LinkId=506604", MS.Entertainment.UI.AutomationIds.settingsAccountManagePayment);
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.ManagePaymentOptionsClick)
+ }, _billingContactInfoClick: function _billingContactInfoClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.navigateToUrl(MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/Account/BillingAccountInformation", MS.Entertainment.UI.AutomationIds.settingsAccountBillingContact);
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.BillingContactInfoClick)
+ }, _billingHistoryClick: function _billingHistoryClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.navigateToUrl(MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_MicrosoftBilling), MS.Entertainment.UI.AutomationIds.settingsAccountBillingHistory);
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.BillingHistoryClick)
+ }, _privacyClick: function _privacyClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.navigateToUrl(MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/Account/Settings", MS.Entertainment.UI.AutomationIds.settingsAccountPrivacy);
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.PrivacyClick)
+ }, _contactPreferencesClick: function _contactPreferencesClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ MS.Entertainment.Utilities.navigateToUrl(MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/MyXbox/ContactPreferences", MS.Entertainment.UI.AutomationIds.settingsAccountContactPreferences);
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.ContactPreferencesClick)
+ }, _userAccountLinkClicked: function _userAccountLinkClicked(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ if (this._signedInUser.canSignOut) {
+ this._signIn.signOut();
+ try {
+ WinJS.UI.SettingsFlyout.show()
+ }
+ catch(ex) {
+ MS.Entertainment.Utilities.fail(false, "WinJS.UI.SettingsFlyout.show() fails: " + ex.toString())
+ }
+ }
+ else
+ window.open(MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBox) + "/Live/ChangeUser");
+ this._sendTelemetry(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.UserAccountLinkClicked)
+ }, _openWebblendDialog: function _openWebblendDialog(url) {
+ MS.Entertainment.UI.Shell.showWebHostDialog(null, {
+ desiredLeft: "0%", desiredTop: null, desiredHeight: (new Microsoft.Entertainment.Configuration.ConfigurationManager).service.modernWebBlendHeight, showBackButton: false, showCancelButton: false
+ }, {
+ sourceUrl: "", authenticatedSourceUrl: url, webHostExperienceFactory: MS.Entertainment.Utilities.SettingsExperience.factory, taskId: MS.Entertainment.UI.Controls.WebHost.TaskId.ACCOUNT, isDialog: true
+ })
+ }, _onSignInChange: function _onSignInChange(isSignedIn) {
+ if (isSignedIn)
+ this._loadXboxAccountSummaryPage()
+ }, _sendTelemetry: function _sendTelemetry(settingsAccountChoice) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SettingsAccountUsage, parameterValue: settingsAccountChoice
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.Settings, telemetryParameterArray)
+ }, _overlayOnLostFocus: function _overlayOnLostFocus(){}
+ }, null, {_musicPassSubscriptionStringMap: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return {"18446189333720334375": String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH}
+ })}), SettingsExperience: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.WebHostExperience", function SettingsExperience_constructor() {
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.constructor.call(this)
+ }, {
+ _onRedemptionSuccess: function _onRedemptionSuccess() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.refreshSignInState().then(function refreshPurchaseHistory() {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ if (signIn.isSignedIn)
+ purchaseHistoryService.grovel(false, false)
+ })
+ }, messageReceived: function messageReceived(messageStruct, webHost, sendMessageFunc) {
+ var errorCode = String.empty;
+ if (!this.disposed)
+ switch (messageStruct.verb) {
+ case"CLOSE_DIALOG":
+ if (messageStruct.reason === "SUCCESS")
+ this.eventProvider.traceSettingsHome_Finish(messageStruct.taskId);
+ else if (messageStruct.reason === "ERROR")
+ this.eventProvider.traceSettingsAccount_Error(messageStruct.errorCode);
+ else if (messageStruct.reason === "CANCEL") {
+ try {
+ WinJS.UI.SettingsFlyout.show()
+ }
+ catch(ex) {
+ MS.Entertainment.Utilities.fail(false, "WinJS.UI.SettingsFlyout.show() fails: " + ex.toString())
+ }
+ this.eventProvider.traceSettings_BackToHome("")
+ }
+ break;
+ case"OPEN_DIALOG":
+ switch (messageStruct.reason) {
+ case"xblmembership":
+ case"redeemcode":
+ case"zunepass":
+ MS.Entertainment.UI.Shell.showWebHostDialog(null, {
+ desiredLeft: "0%", desiredTop: "10%", showBackButton: false, showCancelButton: false
+ }, {
+ sourceUrl: "", authenticatedSourceUrl: messageStruct.targetUrl, webHostExperienceFactory: MS.Entertainment.Utilities.SettingsExperience.factory, taskId: MS.Entertainment.UI.Controls.WebHost.TaskId.ACCOUNT, isDialog: true
+ });
+ break
+ }
+ break;
+ case"UPGRADE_MEMBERSHIP":
+ case"UPGRADE_MEMBERSHIP ":
+ this.eventProvider.traceSubscriptionSignup_Start(String.empty);
+ break;
+ case"MEMBERSHIP_UPGRADE_SUCESSFUL":
+ case"MEMBERSHIP_UPGRADE_SUCCESSFUL":
+ case"MEMBERSHIP_UPGRADE_SUCESSFUL ":
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.refreshSignInState();
+ this.eventProvider.traceSubscriptionSignup_Finish(String.empty);
+ break;
+ case"TOKEN_REDEMPTION_SUCCESSFUL":
+ this._onRedemptionSuccess();
+ break;
+ case"SIGNOUT_CLICKED":
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signOut();
+ try {
+ WinJS.UI.SettingsFlyout.show()
+ }
+ catch(ex) {
+ MS.Entertainment.Utilities.fail(false, "WinJS.UI.SettingsFlyout.show() fails: " + ex.toString())
+ }
+ break;
+ case"done":
+ switch (messageStruct.status) {
+ case"success":
+ this._onRedemptionSuccess();
+ break
+ }
+ break
+ }
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.messageReceived.apply(this, arguments)
+ }, errorReceived: function errorReceived(errorCode) {
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.errorReceived.apply(this, arguments)
+ }
+ }, {factory: WinJS.Utilities.markSupportedForProcessing(function factory() {
+ return new MS.Entertainment.Utilities.SettingsExperience
+ })})
+ });
+ (function() {
+ WinJS.Application.onsettings = function onSettings(e) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceSettingsPopulate_Start("");
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (!(new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience) {
+ var hasCaptions = MS.Entertainment.Platform.PlaybackHelpers.isClosedCaptionFeatureEnabled();
+ e.detail.applicationcommands = {};
+ var settingsPage = {
+ about: "/Components/Settings/SettingsAbout.html", account: "/Components/Settings/SettingsAccount.html", preferences: "/Components/Settings/SettingsPreferences.html", captions: "/Components/Settings/SettingsCaptions.html", feedback: "/Components/Settings/SettingsFeedback.html"
+ };
+ if (signIn.isSignInEnabled)
+ e.detail.applicationcommands.SettingsAccount = {
+ href: settingsPage.account, title: String.load(String.id.IDS_SETTINGS_ACCOUNT_TITLE_TC)
+ };
+ e.detail.applicationcommands.SettingsPreferences = {
+ href: settingsPage.preferences, title: String.load(String.id.IDS_SETTINGS_PREFERENCE_TITLE)
+ };
+ if (hasCaptions)
+ e.detail.applicationcommands.SettingsCaptions = {
+ href: settingsPage.captions, title: String.load(String.id.IDS_SETTINGS_CAPTIONS_TITLE)
+ };
+ e.detail.applicationcommands.SettingsAbout = {
+ href: settingsPage.about, title: String.load(String.id.IDS_SETTINGS_ABOUT_TITLE)
+ };
+ e.detail.applicationcommands.SettingsFeedback = {
+ href: settingsPage.feedback, title: String.load(String.id.IDS_SETTINGS_FEEDBACK_TITLE)
+ }
+ }
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.hide)
+ appBar.hide();
+ var showDownloadDeviceSettingsCommand = new Windows.UI.ApplicationSettings.SettingsCommand("SettingsShowDownloadDevice", String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_LINK), _seeDevicesSettingsCommandHandler);
+ var removeDownloadDeviceSettingsCommand = new Windows.UI.ApplicationSettings.SettingsCommand("SettingsRemoveDownloadDevice", String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_LINK), _removeDevicesSettingsCommandHandler);
+ var helpSettingsCommand = new Windows.UI.ApplicationSettings.SettingsCommand("SettingsHelp", String.load(String.id.IDS_SETTINGS_HELP_TITLE), _helpSettingsCommandHandler);
+ eventProvider.traceSettingsWinJSPopulate_Start("");
+ WinJS.UI.SettingsFlyout.populateSettings(e);
+ if (MS.Entertainment.Utilities.isVideoApp && signIn.isSignedIn && !(new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience) {
+ e.detail.e.request.applicationCommands.append(showDownloadDeviceSettingsCommand);
+ var deviceGroup = Microsoft.Entertainment.Service.Requests.DeviceGroup;
+ if (deviceGroup.DeviceRegisterationStatus.registered === deviceGroup.DeviceGroupManagement.getDeviceRegisterationStatus())
+ e.detail.e.request.applicationCommands.append(removeDownloadDeviceSettingsCommand)
+ }
+ e.detail.e.request.applicationCommands.append(helpSettingsCommand);
+ function _helpSettingsCommandHandler() {
+ var helpLink;
+ var helpApp = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.UnknownHelpClicked;
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ helpLink = "http://go.microsoft.com/fwlink/?LinkId=299474";
+ helpApp = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicHelpClicked
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp) {
+ helpLink = "http://go.microsoft.com/fwlink/?LinkId=299476";
+ helpApp = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.VideoHelpClicked
+ }
+ MS.Entertainment.Utilities.navigateToUrl(helpLink, MS.Entertainment.UI.AutomationIds.settingsHelp);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SettingsHelpUsage, parameterValue: helpApp
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.Settings, telemetryParameterArray)
+ }
+ {};
+ function _seeDevicesSettingsCommandHandler() {
+ MS.Entertainment.Utilities.navigateToUrl("http://go.microsoft.com/fwlink/?LinkId=614900&ref=videosetting", MS.Entertainment.UI.AutomationIds.settingsShowDevice)
+ }
+ {};
+ function _removeDevicesSettingsCommandHandler() {
+ var removeCancelDialogButtons = [{
+ title: String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_REMOVE), execute: function onRemove(overlay) {
+ Microsoft.Entertainment.Service.Requests.DeviceGroup.DeviceGroupManagement.deregisterDeviceAsync().done(null, function(err){});
+ overlay.hide()
+ }
+ }, {
+ title: String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_CANCEL), execute: function onCancel(overlay) {
+ overlay.hide()
+ }
+ }];
+ return MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_HEADER), String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_MESSAGE), {
+ buttons: removeCancelDialogButtons, defaultButtonIndex: 0, cancelButtonIndex: 1
+ })
+ }
+ {};
+ eventProvider.traceSettingsPopulate_End("")
+ }
+ })()
+})()
diff --git a/packages/microsoft.zunevideo/Components/Settings/SettingsAbout.html b/packages/microsoft.zunevideo/Components/Settings/SettingsAbout.html
new file mode 100644
index 00000000..c66cb515
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Settings/SettingsAbout.html
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ Settings Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Settings/SettingsAccount.html b/packages/microsoft.zunevideo/Components/Settings/SettingsAccount.html
new file mode 100644
index 00000000..f2635500
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Settings/SettingsAccount.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+ Settings Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Settings/SettingsCaptions.html b/packages/microsoft.zunevideo/Components/Settings/SettingsCaptions.html
new file mode 100644
index 00000000..7b4dbe27
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Settings/SettingsCaptions.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+ Settings Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Settings/SettingsFeedback.html b/packages/microsoft.zunevideo/Components/Settings/SettingsFeedback.html
new file mode 100644
index 00000000..f91fe9e3
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Settings/SettingsFeedback.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+ Settings Control Template
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Settings/SettingsPreferences.html b/packages/microsoft.zunevideo/Components/Settings/SettingsPreferences.html
new file mode 100644
index 00000000..bd607667
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Settings/SettingsPreferences.html
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
+
+ Settings Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video/AppServices.js b/packages/microsoft.zunevideo/Components/Video/AppServices.js
new file mode 100644
index 00000000..62d1cd14
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/AppServices.js
@@ -0,0 +1,6 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.purchaseFlowProvider, MS.Entertainment.Purchase.VideoPurchaseFlowProvider.factory)
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/AppbarActions.js b/packages/microsoft.zunevideo/Components/Video/AppbarActions.js
new file mode 100644
index 00000000..40d144b7
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/AppbarActions.js
@@ -0,0 +1,21 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels.SmartAppbarActions", {
+ defaultActions: {
+ _defaultActions: null, get: function() {
+ if (!MS.Entertainment.ViewModels.SmartAppbarActions._defaultActions)
+ MS.Entertainment.ViewModels.SmartAppbarActions._defaultActions = [MS.Entertainment.UI.AppBarActions.openFile];
+ return MS.Entertainment.ViewModels.SmartAppbarActions._defaultActions
+ }
+ }, setDefaultGalleryEventHandlers: function setDefaultGalleryEventHandlers(clearSelectionCallback, removeCompleteCallback) {
+ return {}
+ }, _appBarActions: null, getAppbarActions: function getAppbarActions() {
+ if (MS.Entertainment.ViewModels.SmartAppbarActions._appBarActions)
+ return MS.Entertainment.ViewModels.SmartAppbarActions._appBarActions;
+ MS.Entertainment.ViewModels.SmartAppbarActions._appBarActions = [MS.Entertainment.UI.Components.Shell.OpenFileAction.getOpenFileAction(), ];
+ return MS.Entertainment.ViewModels.SmartAppbarActions._appBarActions
+ }
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/CriticReviewControls.js b/packages/microsoft.zunevideo/Components/Video/CriticReviewControls.js
new file mode 100644
index 00000000..60252e12
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/CriticReviewControls.js
@@ -0,0 +1,241 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/utilities.js");
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels.Video");
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.ViewModels.Video.assert(MS.Entertainment.appMode !== undefined, "File was loaded in startup path, this make slow down perf since we are creating a config object");
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ WinJS.Namespace.define("MS.Entertainment.ViewModels.Video", {ReviewTemplates: {
+ rottenTomatoesOverviewControl: "/Components/Immersive/Video/MovieImmersiveTemplates.html#rottenTomatoesOverviewTemplate", rottenTomatoesReviewControl: "/Components/Immersive/Video/MovieImmersiveTemplates.html#rottenTomatoesReviewTemplate", rottenTomatoesImmersivePanel: "/Components/Immersive/Video/MovieImmersiveTemplates.html#rottenTomatoesImmersivePanelTemplate"
+ }});
+ else
+ WinJS.Namespace.define("MS.Entertainment.ViewModels.Video", {ReviewTemplates: {
+ rottenTomatoesOverviewControl: "/Components/Video2/MovieDetailsPage.html#rottenTomatoesOverviewTemplate", rottenTomatoesReviewControl: "/Components/Video2/MovieDetailsPage.html#rottenTomatoesReviewTemplate", rottenTomatoesImmersivePanel: "/Components/Video2/MovieDetailsPage.html#rottenTomatoesImmersivePanelTemplate"
+ }});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {RottenTomatoesOverviewControl: MS.Entertainment.UI.Framework.defineUserControl(MS.Entertainment.ViewModels.Video.ReviewTemplates.rottenTomatoesOverviewControl, function RottenTomatoesOverviewControl(){}, {
+ controlName: "RottenTomatoesOverviewControl", allowAnimations: false, onClickWithContext: null, initialize: function initalize() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this.visible = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.rottenTomatoes) && this.mediaItem && this.mediaItem.criticReview && this.mediaItem.criticReview.reviewScore > 0);
+ if (!this.visible)
+ return;
+ this._setControlFocusability();
+ this._setStyle();
+ this._setTomatoIcon();
+ this.onClickWithContext = WinJS.Utilities.markSupportedForProcessing(this._onClick.bind(this))
+ }, _makeFocusable: function _makeFocusable(control) {
+ if (control) {
+ WinJS.Utilities.addClass(control, "acc-keyboardFocusTarget");
+ WinJS.Utilities.addClass(control, "win-focusable")
+ }
+ }, _setControlFocusability: function _setControlFocusability() {
+ if (MS.Entertainment.Utilities.isApp2)
+ this._makeFocusable(this._overviewControl);
+ else
+ this._makeFocusable(this._subtitle)
+ }, _setTomatoIcon: function _setTomatoIcon() {
+ if (this.mediaItem && this.mediaItem.criticReview && this.mediaItem.criticReview.reviewScore >= 0)
+ if (this.mediaItem.criticReview.reviewScore >= 75 && this.mediaItem.criticReview.reviewScoreCount >= 40)
+ this.tomatoIcon = MS.Entertainment.UI.Controls.RottenTomatoesOverviewControl.iconCertifiedFresh;
+ else if (this.mediaItem.criticReview.reviewScore >= 60)
+ this.tomatoIcon = MS.Entertainment.UI.Controls.RottenTomatoesOverviewControl.iconFresh;
+ else
+ this.tomatoIcon = MS.Entertainment.UI.Controls.RottenTomatoesOverviewControl.iconRotten;
+ if (this._tomatoImageElement)
+ if (this.tomatoIcon)
+ this._tomatoImageElement.src = "ms-appx://" + this.tomatoIcon;
+ else
+ MS.Entertainment.Utilities.hideElement(this._tomatoImageElement)
+ }, _setStyle: function _setStyle() {
+ if (this.mediaItem && this.mediaItem.criticReview && this.mediaItem.criticReview.reviewScore >= 0 && this._scorePercentageProgressBar)
+ if (this.mediaItem.criticReview.reviewScore >= 60) {
+ WinJS.Utilities.removeClass(this._scorePercentageProgressBar, "state-scoreRotten");
+ WinJS.Utilities.addClass(this._scorePercentageProgressBar, "state-scoreFresh")
+ }
+ else {
+ WinJS.Utilities.removeClass(this._scorePercentageProgressBar, "state-scoreFresh");
+ WinJS.Utilities.addClass(this._scorePercentageProgressBar, "state-scoreRotten")
+ }
+ }, _onKeyDown: function _onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space || event.keyCode === WinJS.Utilities.Key.invokeButton)
+ this._onClick()
+ }, _onClick: function onClick() {
+ var focusableElement = MS.Entertainment.Utilities.isVideoApp2 && this.domElement && this.domElement.querySelector(".win-focusable");
+ if (focusableElement)
+ MS.Entertainment.UI.Framework.focusElement(focusableElement);
+ if (this.mediaItem && this.mediaItem.criticReview && this.mediaItem.criticReview.url && MS.Entertainment.Utilities.verifyUrl(this.mediaItem.criticReview.url))
+ Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(this.mediaItem.criticReview.url))
+ }
+ }, {
+ tomatoIcon: null, visible: false
+ }, {
+ iconFresh: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return "/images/ThirdParty/ico_RottenTomatoes_Fresh." + MS.Entertainment.Utilities.getPackageImageFileExtension()
+ }), iconRotten: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return "/images/ThirdParty/ico_RottenTomatoes_Rotten." + MS.Entertainment.Utilities.getPackageImageFileExtension()
+ }), iconCertifiedFresh: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return "/images/ThirdParty/ico_RottenTomatoes_CertifiedFresh." + MS.Entertainment.Utilities.getPackageImageFileExtension()
+ })
+ })}),
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {RottenTomatoesReviewControl: MS.Entertainment.UI.Framework.defineUserControl(MS.Entertainment.ViewModels.Video.ReviewTemplates.rottenTomatoesReviewControl, function RottenTomatoesReviewControl(){}, {
+ controlName: "RottenTomatoesReviewControl", allowAnimations: false, onClickWithContext: null, initialize: function initalize() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this.visible = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.rottenTomatoes) && this.criticReview && this.criticReview.criticName && this.criticReview.publication && this.criticReview.scoreDescription && this.criticReview.scoreDescription !== "none");
+ if (!this.visible)
+ return;
+ this._setTomatoIcon();
+ this.onClickWithContext = WinJS.Utilities.markSupportedForProcessing(this._onClick.bind(this))
+ }, _setTomatoIcon: function _setTomatoIcon() {
+ switch (this.criticReview.scoreDescription) {
+ case"fresh":
+ this.tomatoIcon = MS.Entertainment.UI.Controls.RottenTomatoesOverviewControl.iconFresh;
+ break;
+ case"rotten":
+ this.tomatoIcon = MS.Entertainment.UI.Controls.RottenTomatoesOverviewControl.iconRotten;
+ break;
+ case"none":
+ this.tomatoIcon = null;
+ break;
+ default:
+ MS.Entertainment.Framework.fail("Unknown RottenTomatos ScoreDescription: " + this.criticReview.scoreDescription)
+ }
+ if (this._tomatoImageElement)
+ if (this.tomatoIcon)
+ this._tomatoImageElement.src = "ms-appx://" + this.tomatoIcon;
+ else
+ MS.Entertainment.Utilities.hideElement(this._tomatoImageElement)
+ }, _onKeyDown: function onKeyDown() {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space || event.keyCode === WinJS.Utilities.Key.invokeButton)
+ this._onClick()
+ }, _onClick: function onClick() {
+ var focusableElement = MS.Entertainment.Utilities.isVideoApp2 && this.domElement && this.domElement.querySelector(".win-focusable");
+ if (focusableElement)
+ MS.Entertainment.UI.Framework.focusElement(focusableElement);
+ if (this.criticReview && this.criticReview.publicationUrl && MS.Entertainment.Utilities.verifyUrl(this.criticReview.publicationUrl))
+ Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(this.criticReview.publicationUrl))
+ }
+ }, {
+ tomatoIcon: null, visible: true
+ })}),
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {RottenTomatoesImmersivePanel: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BaseImmersiveSummary", MS.Entertainment.ViewModels.Video.ReviewTemplates.rottenTomatoesImmersivePanel, function rottenTomatoesImmersivePanelConstructor() {
+ if (this.isViewMore)
+ this._initializeFocusBind = WinJS.Binding.bind(this, {criticListView: function setFirstTimeRenderBind() {
+ if (this.criticListView)
+ this._focusHandler(true)
+ }.bind(this)})
+ }, {
+ keyboardNavigationManager: null, _focusInitialized: false, _focusEventHandlers: null, _initializeFocusBind: null, isViewMore: false, initialize: function initialize() {
+ this._focusEventHandlers = [MS.Entertainment.Utilities.addEvents(this, {focusin: this._focusHandler.bind(this)})];
+ if (MS.Entertainment.Utilities.isApp1)
+ this.keyboardNavigationManager = new MS.Entertainment.Framework.VerticalKeyboardNavigationManager(this.domElement, null, true);
+ else
+ this.criticListView.keyboardNavigable = true;
+ var promise = this.dataContext.previousSignal ? WinJS.Binding.unwrap(this.dataContext.previousSignal).promise : WinJS.Promise.wrap();
+ promise.done(function showFrame() {
+ this.visible = !!this.dataContext.mediaItem.criticReview.reviewScore;
+ if (this.dataContext.visibleSignal)
+ WinJS.Binding.unwrap(this.dataContext.visibleSignal).complete()
+ }.bind(this))
+ }, unload: function unload() {
+ if (this._focusEventHandlers) {
+ for (var focusEventHandler in this._focusEventHandlers)
+ this._focusEventHandlers[focusEventHandler].cancel();
+ this._focusEventHandlers = null
+ }
+ if (this._initializeFocusBind) {
+ this._initializeFocusBind.cancel();
+ this._initializeFocusBind = null
+ }
+ MS.Entertainment.UI.Controls.BaseImmersiveSummary.prototype.unload.call(this)
+ }, _scrollToTop: function _scrollToTop() {
+ if (this.domElement)
+ this.domElement.scrollTop = 0
+ }, _focusHandler: function _focusHandler(event) {
+ var force = event === true;
+ WinJS.Promise.timeout(1).done(function delayFocusItem() {
+ if (!this._focusInitialized || force) {
+ var querySelectorString = ".contentRow .win-focusable";
+ var firstListItem = this.rottenTomatoesOverview.domElement.querySelector(querySelectorString);
+ if (firstListItem)
+ if (MS.Entertainment.Utilities.isApp1 && !this.isViewMore)
+ this.keyboardNavigationManager.setFocusedItem(firstListItem, true);
+ else if (this.isViewMore)
+ MS.Entertainment.UI.Framework.focusElement(firstListItem);
+ if (this._focusInitialized)
+ return;
+ if (this.rottenTomatoesOverview)
+ this._focusEventHandlers.push(MS.Entertainment.Utilities.addEvents(this.rottenTomatoesOverview, {focusin: this._scrollToTop.bind(this)}));
+ this.criticListView.domElement.tabIndex = -1;
+ this._setControlFocusDirectionOverrides();
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(this.domElement))
+ this._focusInitialized = true
+ }
+ }.bind(this))
+ }, _setControlFocusDirectionOverrides: function _setControlFocusDirectionOverrides() {
+ if (this.isViewMore)
+ return;
+ var rightOfCriticReviews = null;
+ var rightOfCriticReviewsViewMore = null;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var castAndCrewVisible = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.castAndCrew) && this.dataContext.mediaItem && this.dataContext.mediaItem.contributors && this.dataContext.mediaItem.contributors.length > 0);
+ if (castAndCrewVisible) {
+ rightOfCriticReviews = MS.Entertainment.UI.Controls.CastAndCrewList.cssSelectors.castAndCrewMember;
+ rightOfCriticReviewsViewMore = MS.Entertainment.UI.Controls.CastAndCrewList.cssSelectors.castAndCrewViewMore
+ }
+ else {
+ rightOfCriticReviews = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related;
+ rightOfCriticReviewsViewMore = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.related
+ }
+ var belowCriticReviews = MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp;
+ if (this.dataContext && this.dataContext.frame && !this.dataContext.frame.hideViewMoreIfEnoughSpace)
+ belowCriticReviews = MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel.cssSelectors.rottenTomatoesViewMore;
+ var middleCriticReviewFocusDirectionMap = JSON.stringify({
+ left: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.smartBuyButton, right: rightOfCriticReviews
+ });
+ var topCriticReviewFocusDirectionMap = JSON.stringify({
+ left: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.smartBuyButton, right: rightOfCriticReviews, up: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp
+ });
+ var bottomCriticReviewFocusDirectionMap = JSON.stringify({
+ left: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.smartBuyButton, right: rightOfCriticReviews, down: belowCriticReviews
+ });
+ var bottomCriticReviewItemClass = "bottomCriticReviewItem";
+ var criticReviewItems = this.domElement.querySelectorAll(MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel.cssSelectors.rottenTomatoesOverview);
+ if (criticReviewItems && criticReviewItems.length > 0) {
+ if (criticReviewItems.length === 1) {
+ var onlyCriticReviewFocusDirectionMap = JSON.stringify({
+ left: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.smartBuyButton, right: rightOfCriticReviews, down: belowCriticReviews, up: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp
+ });
+ criticReviewItems[0].setAttribute("data-win-focus", onlyCriticReviewFocusDirectionMap);
+ WinJS.Utilities.addClass(criticReviewItems[0], bottomCriticReviewItemClass)
+ }
+ else {
+ criticReviewItems[0].setAttribute("data-win-focus", topCriticReviewFocusDirectionMap);
+ WinJS.Utilities.removeClass(criticReviewItems[0], bottomCriticReviewItemClass);
+ criticReviewItems[criticReviewItems.length - 1].setAttribute("data-win-focus", bottomCriticReviewFocusDirectionMap);
+ WinJS.Utilities.addClass(criticReviewItems[criticReviewItems.length - 1], bottomCriticReviewItemClass)
+ }
+ for (var i = 1; i < criticReviewItems.length - 1; i++) {
+ criticReviewItems[i].setAttribute("data-win-focus", middleCriticReviewFocusDirectionMap);
+ WinJS.Utilities.removeClass(criticReviewItems[i], bottomCriticReviewItemClass)
+ }
+ }
+ var bottomCriticReviewItemSelector = ".currentPage ." + bottomCriticReviewItemClass;
+ var criticReviewViewMoreItemFocusDirectionMap = JSON.stringify({
+ left: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.movieHeroViewMore, right: rightOfCriticReviewsViewMore, down: MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.noOp, up: bottomCriticReviewItemSelector
+ });
+ var criticReviewViewMore = document.querySelector(MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel.cssSelectors.rottenTomatoesViewMore);
+ if (criticReviewViewMore)
+ criticReviewViewMore.setAttribute("data-win-focus", criticReviewViewMoreItemFocusDirectionMap)
+ }
+ }, {
+ visible: false, criticListView: null
+ }, {cssSelectors: {
+ rottenTomatoesViewMore: ".currentPage .viewMoreRow.reviews .inlineCaretButton", rottenTomatoesOverview: ".currentPage .rottenTomatoesPanel .win-focusable"
+ }})})
+})();
+(function runCriticReviewVoiceMixins() {
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.App2.VoicePropertyMixin")) {
+ WinJS.Class.mix(MS.Entertainment.UI.Controls.RottenTomatoesOverviewControl, MS.Entertainment.UI.App2.VoicePropertyMixin);
+ WinJS.Class.mix(MS.Entertainment.UI.Controls.RottenTomatoesReviewControl, MS.Entertainment.UI.App2.VoicePropertyMixin)
+ }
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/DemoDashboardViewModel.js b/packages/microsoft.zunevideo/Components/Video/DemoDashboardViewModel.js
new file mode 100644
index 00000000..8d33dba1
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/DemoDashboardViewModel.js
@@ -0,0 +1,76 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Video) {
+ var MovieDemoDashboardDataContext = (function() {
+ function MovieDemoDashboardDataContext() {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.viewModel = new MS.Entertainment.UI.Video.DemoDashboardViewModel([{imageUriOverride: "ms-appdata:///local/Images/movie_01.png"}, {imageUriOverride: "ms-appdata:///local/Images/movie_02.png"}, {imageUriOverride: "ms-appdata:///local/Images/movie_03.png"}, {imageUriOverride: "ms-appdata:///local/Images/movie_04.png"}, {imageUriOverride: "ms-appdata:///local/Images/movie_05.png"}, {imageUriOverride: "ms-appdata:///local/Images/movie_06.png"}], "MS.Entertainment.Pages.VideoInlineDetailsSpotlightDemo");
+ this.viewModel.getItems()
+ }
+ return MovieDemoDashboardDataContext
+ })();
+ Video.MovieDemoDashboardDataContext = MovieDemoDashboardDataContext;
+ var TvDemoDashboardDataContext = (function() {
+ function TvDemoDashboardDataContext() {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.viewModel = new MS.Entertainment.UI.Video.DemoDashboardViewModel([{imageUriOverride: "ms-appdata:///local/Images/tv_01.png"}, {imageUriOverride: "ms-appdata:///local/Images/tv_02.png"}, {imageUriOverride: "ms-appdata:///local/Images/tv_03.png"}, {imageUriOverride: "ms-appdata:///local/Images/tv_04.png"}, {imageUriOverride: "ms-appdata:///local/Images/tv_05.png"}, {imageUriOverride: "ms-appdata:///local/Images/tv_06.png"}], "MS.Entertainment.Pages.VideoInlineDetailsMarketplaceDemo");
+ this.viewModel.getItems()
+ }
+ return TvDemoDashboardDataContext
+ })();
+ Video.TvDemoDashboardDataContext = TvDemoDashboardDataContext;
+ var DemoDashboardViewModel = (function(_super) {
+ __extends(DemoDashboardViewModel, _super);
+ function DemoDashboardViewModel(items, popoverConstructor) {
+ _super.call(this, items.length, 0, false);
+ this._items = items;
+ this._popoverConstructor = popoverConstructor
+ }
+ DemoDashboardViewModel.prototype._getResultsFromQuery = function() {
+ return WinJS.Promise.wrap({primaryPanelItems: this._items})
+ };
+ DemoDashboardViewModel.prototype._wrapEditorialItem = function(item) {
+ item.doclick = function() {
+ var popOverParameters = null;
+ popOverParameters = {itemConstructor: this._popoverConstructor};
+ MS.Entertainment.UI.Controls.PopOver.showNonMediaPopOver(popOverParameters)
+ }.bind(this);
+ return WinJS.Binding.as(item)
+ };
+ DemoDashboardViewModel.prototype.canDisplayMediaType = function(item) {
+ return true
+ };
+ DemoDashboardViewModel.prototype._getPrimaryContentPanel = function() {
+ return new Video.VideoHubDashboardContentPanel
+ };
+ DemoDashboardViewModel.prototype._getSecondaryContentPanel = function() {
+ return null
+ };
+ DemoDashboardViewModel.prototype._getActions = function() {
+ return []
+ };
+ return DemoDashboardViewModel
+ })(Video.VideoHubDashboardViewModel);
+ Video.DemoDashboardViewModel = DemoDashboardViewModel
+ })(UI.Video || (UI.Video = {}));
+ var Video = UI.Video
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Video/EmptyHome.html b/packages/microsoft.zunevideo/Components/Video/EmptyHome.html
new file mode 100644
index 00000000..df52d08c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/EmptyHome.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video/FeaturedMoviesView.html b/packages/microsoft.zunevideo/Components/Video/FeaturedMoviesView.html
new file mode 100644
index 00000000..9effca60
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/FeaturedMoviesView.html
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/FeaturedTvView.html b/packages/microsoft.zunevideo/Components/Video/FeaturedTvView.html
new file mode 100644
index 00000000..d9b205d5
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/FeaturedTvView.html
@@ -0,0 +1,354 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/HubDashboardViewModel.js b/packages/microsoft.zunevideo/Components/Video/HubDashboardViewModel.js
new file mode 100644
index 00000000..d8631048
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/HubDashboardViewModel.js
@@ -0,0 +1,232 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Video) {
+ var VideoHubDashboardContentPanel = (function(_super) {
+ __extends(VideoHubDashboardContentPanel, _super);
+ function VideoHubDashboardContentPanel() {
+ _super.apply(this, arguments)
+ }
+ Object.defineProperty(VideoHubDashboardContentPanel.prototype, "header", {
+ get: function() {
+ return this._header
+ }, set: function(value) {
+ this.updateAndNotify("header", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoHubDashboardContentPanel.prototype, "items", {
+ get: function() {
+ return this._items
+ }, set: function(value) {
+ this.updateAndNotify("items", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoHubDashboardContentPanel.prototype, "moreAction", {
+ get: function() {
+ return this._moreAction
+ }, set: function(value) {
+ this.updateAndNotify("moreAction", value)
+ }, enumerable: true, configurable: true
+ });
+ return VideoHubDashboardContentPanel
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Video.VideoHubDashboardContentPanel = VideoHubDashboardContentPanel;
+ var VideoHubDashboardViewModelData = (function(_super) {
+ __extends(VideoHubDashboardViewModelData, _super);
+ function VideoHubDashboardViewModelData() {
+ _super.apply(this, arguments);
+ this._showNotEnoughKidsContentPanel = false
+ }
+ Object.defineProperty(VideoHubDashboardViewModelData.prototype, "actions", {
+ get: function() {
+ return this._actions
+ }, set: function(value) {
+ this.updateAndNotify("actions", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoHubDashboardViewModelData.prototype, "primaryContentPanel", {
+ get: function() {
+ return this._primaryContentPanel
+ }, set: function(value) {
+ this.updateAndNotify("primaryContentPanel", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoHubDashboardViewModelData.prototype, "secondaryContentPanel", {
+ get: function() {
+ return this._secondaryContentPanel
+ }, set: function(value) {
+ this.updateAndNotify("secondaryContentPanel", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoHubDashboardViewModelData.prototype, "showNotEnoughKidsContentPanel", {
+ get: function() {
+ return this._showNotEnoughKidsContentPanel
+ }, set: function(value) {
+ this.updateAndNotify("showNotEnoughKidsContentPanel", value)
+ }, enumerable: true, configurable: true
+ });
+ return VideoHubDashboardViewModelData
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Video.VideoHubDashboardViewModelData = VideoHubDashboardViewModelData;
+ var VideoHubDashboardViewModel = (function(_super) {
+ __extends(VideoHubDashboardViewModel, _super);
+ function VideoHubDashboardViewModel(maxPrimaryItems, maxSecondaryItems, loadPanelActions) {
+ _super.call(this);
+ this._viewModelData = null;
+ this._mainQueryRetryTimeout = 250;
+ this._mainQueryRetryAttempts = 1;
+ this._maxQueryRetryAttempts = 6;
+ this._mainQueryRefreshPromise = null;
+ this._maxPrimaryItems = maxPrimaryItems;
+ this._maxSecondaryItems = maxSecondaryItems;
+ this._loadPanelActions = loadPanelActions
+ }
+ VideoHubDashboardViewModel.prototype.dispose = function() {
+ _super.prototype.dispose.call(this);
+ if (this._mainQueryRefreshPromise) {
+ this._mainQueryRefreshPromise.cancel();
+ this._mainQueryRefreshPromise = null
+ }
+ };
+ Object.defineProperty(VideoHubDashboardViewModel.prototype, "viewModelData", {
+ get: function() {
+ return this._viewModelData
+ }, set: function(value) {
+ this.updateAndNotify("viewModelData", value)
+ }, enumerable: true, configurable: true
+ });
+ VideoHubDashboardViewModel.prototype.getItems = function(refreshing) {
+ var _this = this;
+ if (!refreshing)
+ this.createEmptyDataSource();
+ if (this._mainQueryRefreshPromise) {
+ this._mainQueryRefreshPromise.cancel();
+ this._mainQueryRefreshPromise = null
+ }
+ return this._getResultsFromQuery().then(function(results) {
+ if (!results)
+ return null;
+ var primaryItems = _this.getItemsToDisplay(results.primaryPanelItems, _this._maxPrimaryItems);
+ var secondaryItems = _this.getItemsToDisplay(results.secondaryPanelItems, _this._maxSecondaryItems);
+ _this.createDataSource(primaryItems, secondaryItems)
+ }, function() {
+ if (!refreshing && _this._mainQueryRetryAttempts < _this._maxQueryRetryAttempts) {
+ _this._mainQueryRetryTimeout *= _this._mainQueryRetryAttempts;
+ _this._mainQueryRefreshPromise = WinJS.Promise.timeout(_this._mainQueryRetryTimeout).then(_this.getItems.bind(_this));
+ _this._mainQueryRetryAttempts++
+ }
+ return null
+ })
+ };
+ VideoHubDashboardViewModel.prototype.getItemsToDisplay = function(items, maxItems) {
+ var itemsToDisplay = [];
+ if (items)
+ for (var i = 0; i < items.length && itemsToDisplay.length < maxItems; i++) {
+ var currentItem = (items[i] && items[i].editorialItem) || items[i];
+ if (this.canDisplayMediaType(currentItem)) {
+ currentItem = this._wrapEditorialItem(currentItem);
+ itemsToDisplay.push(currentItem)
+ }
+ }
+ itemsToDisplay = itemsToDisplay.concat(this._fillEmptyResults(maxItems - itemsToDisplay.length));
+ return itemsToDisplay
+ };
+ VideoHubDashboardViewModel.prototype.createEmptyDataSource = function() {
+ this.createDataSource(this._fillEmptyResults(this._maxPrimaryItems), this._fillEmptyResults(this._maxSecondaryItems))
+ };
+ VideoHubDashboardViewModel.prototype.createDataSource = function(firstPanelItems, secondPanelItems) {
+ if (!this.viewModelData) {
+ var actions = this._getActions();
+ var primaryContentPanel = this._getPrimaryContentPanel();
+ var secondaryContentPanel = this._getSecondaryContentPanel();
+ this.viewModelData = new VideoHubDashboardViewModelData;
+ this.viewModelData.actions = new MS.Entertainment.ObservableArray(actions).bindableItems;
+ this.viewModelData.primaryContentPanel = primaryContentPanel;
+ this.viewModelData.secondaryContentPanel = secondaryContentPanel
+ }
+ if (this.viewModelData.primaryContentPanel)
+ this.viewModelData.primaryContentPanel.items = new MS.Entertainment.ObservableArray(firstPanelItems).bindableItems;
+ if (this.viewModelData.secondaryContentPanel)
+ this.viewModelData.secondaryContentPanel.items = new MS.Entertainment.ObservableArray(secondPanelItems).bindableItems
+ };
+ VideoHubDashboardViewModel.prototype._getQuery = function() {
+ throw new Error("This should be implemented by a subclass.");
+ };
+ VideoHubDashboardViewModel.prototype._getResultsFromQuery = function() {
+ var _this = this;
+ return this._getQuery().execute().then(function(query) {
+ if (!query || !query.result.entriesArray)
+ return null;
+ var items = query.result.entriesArray;
+ var primaryPanelItems = items && items[0] && items[0].editorialItems;
+ var secondaryPanelItems = items && items[1] && items[1].editorialItems;
+ primaryPanelItems = primaryPanelItems.map(function(item) {
+ return item.editorialItem
+ });
+ secondaryPanelItems = secondaryPanelItems.map(function(item) {
+ return item.editorialItem
+ });
+ var contentRestrictionService = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService))
+ contentRestrictionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ var wrapPanelItems = function() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var numberEmptyTiles = (_this._maxPrimaryItems - primaryPanelItems.length) + (_this._maxSecondaryItems - secondaryPanelItems.length);
+ if (contentRestrictionService)
+ contentRestrictionService.getBrowsePolicyUpdatePromise().done(function() {
+ if (contentRestrictionService.hasBrowseFilterRestriction() && numberEmptyTiles > config.video.contentRestrictionMaxEmptyFeaturedItems)
+ _this.viewModelData.showNotEnoughKidsContentPanel = true;
+ else
+ _this.viewModelData.showNotEnoughKidsContentPanel = false
+ });
+ return WinJS.Promise.wrap({
+ primaryPanelItems: primaryPanelItems, secondaryPanelItems: secondaryPanelItems
+ })
+ };
+ if (contentRestrictionService)
+ return contentRestrictionService.getBrowsePolicyUpdatePromise().then(function() {
+ if (contentRestrictionService.hasBrowseFilterRestriction()) {
+ var primaryPromise = contentRestrictionService.filterRestrictedMediaItems(primaryPanelItems).then(function setFilteredPrimaryItems(filteredPrimaryItems) {
+ primaryPanelItems = filteredPrimaryItems
+ });
+ var secondaryPromise = contentRestrictionService.filterRestrictedMediaItems(secondaryPanelItems).then(function setFilteredSecondaryItems(filteredSecondaryItems) {
+ secondaryPanelItems = filteredSecondaryItems
+ });
+ return WinJS.Promise.join([primaryPromise, secondaryPromise]).then(wrapPanelItems)
+ }
+ return wrapPanelItems()
+ });
+ return wrapPanelItems()
+ })
+ };
+ VideoHubDashboardViewModel.prototype._getPrimaryContentPanel = function() {
+ throw new Error("This should be implemented by a subclass.");
+ };
+ VideoHubDashboardViewModel.prototype._getSecondaryContentPanel = function() {
+ throw new Error("This should be implemented by a subclass.");
+ };
+ VideoHubDashboardViewModel.prototype._getActions = function() {
+ throw new Error("This should be implemented by a subclass.");
+ };
+ return VideoHubDashboardViewModel
+ })(MS.Entertainment.UI.Video.EditorialDashboardViewModel);
+ Video.VideoHubDashboardViewModel = VideoHubDashboardViewModel
+ })(UI.Video || (UI.Video = {}));
+ var Video = UI.Video
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Video/InteractiveTVHelper.js b/packages/microsoft.zunevideo/Components/Video/InteractiveTVHelper.js
new file mode 100644
index 00000000..a2b44408
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/InteractiveTVHelper.js
@@ -0,0 +1,133 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Components) {
+ (function(Video) {
+ var UrlLookupItem = (function() {
+ function UrlLookupItem(mediaId, deepLinkUrl) {
+ this.mediaId = mediaId;
+ this.deepLinkUrl = deepLinkUrl
+ }
+ return UrlLookupItem
+ })();
+ Video.UrlLookupItem = UrlLookupItem;
+ var InteractiveAppHelper = (function() {
+ function InteractiveAppHelper(){}
+ InteractiveAppHelper.addConfigValuesToTable = function(mediaIdString, deepLinkUrlString) {
+ var mediaIds = mediaIdString.split(",");
+ var deepLinkUrls = deepLinkUrlString.split(",");
+ if (mediaIds && deepLinkUrls && mediaIds.length > 0 && mediaIds.length === deepLinkUrls.length)
+ for (var i = 0; i < mediaIds.length; i++)
+ MS.Entertainment.Components.Video.InteractiveAppHelper._urlLookupTable.push(new UrlLookupItem(mediaIds[i], deepLinkUrls[i]))
+ };
+ InteractiveAppHelper.loadUrlLookupFromConfig = function() {
+ if (!MS.Entertainment.Components.Video.InteractiveAppHelper._loadedLookupFromConfig) {
+ MS.Entertainment.Components.Video.InteractiveAppHelper._urlLookupTable = [];
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ InteractiveAppHelper.addConfigValuesToTable(configurationManager.video.interactiveTVMediaIDs, configurationManager.video.interactiveTVDeepLinkUrls);
+ InteractiveAppHelper.addConfigValuesToTable(configurationManager.video.interactiveMovieMediaIDs, configurationManager.video.interactiveMovieDeepLinkUrls);
+ MS.Entertainment.Components.Video.InteractiveAppHelper._loadedLookupFromConfig = true
+ }
+ };
+ InteractiveAppHelper.getRootUrlFromMedia = function(media) {
+ var rootUrl = String.empty;
+ MS.Entertainment.Components.Video.InteractiveAppHelper.loadUrlLookupFromConfig();
+ for (var i = 0; i < MS.Entertainment.Components.Video.InteractiveAppHelper._urlLookupTable.length; i++)
+ if ((MS.Entertainment.Components.Video.InteractiveAppHelper._urlLookupTable[i].mediaId === media.canonicalId && media.hasCanonicalId) || (MS.Entertainment.Components.Video.InteractiveAppHelper._urlLookupTable[i].mediaId === media.zuneId && media.hasZuneId) || (MS.Entertainment.Components.Video.InteractiveAppHelper._urlLookupTable[i].mediaId === media.serviceId && media.hasServiceId)) {
+ rootUrl = MS.Entertainment.Components.Video.InteractiveAppHelper._urlLookupTable[i].deepLinkUrl;
+ break
+ }
+ return rootUrl
+ };
+ InteractiveAppHelper.hasInteractiveUrlFromMedia = function(media) {
+ return !!MS.Entertainment.Components.Video.InteractiveAppHelper.getRootUrlFromMedia(media)
+ };
+ InteractiveAppHelper.appendBookmarksForAllEpisodesInSeason = function(media, deepLinkUrl) {
+ var deepLinkPromise = WinJS.Promise.wrap(deepLinkUrl);
+ var season = MS.Entertainment.Utilities.convertMediaItemToTvSeason(media);
+ if (season && season.refresh) {
+ var hydrateSeason = season.refresh();
+ deepLinkPromise = hydrateSeason.then(function(hydratedSeason) {
+ return hydratedSeason.episodes.toArrayAll()
+ }, function(hydratedSeason) {
+ return WinJS.Promise.wrap(null)
+ }).then(function(marketplaceEpisodes) {
+ if (marketplaceEpisodes) {
+ var ms = new Microsoft.Entertainment.Platform.MediaStore;
+ var bookmarkPromises = [];
+ for (var i = 0; i < marketplaceEpisodes.length; i++) {
+ if (marketplaceEpisodes[i].episodeNumber < 1 || marketplaceEpisodes[i].episodeNumber > 99)
+ continue;
+ var promise = WinJS.Promise.wrap({value: 0});
+ if (marketplaceEpisodes[i].libraryId > -1)
+ promise = ms.videoProvider.getBookmarkAsync(marketplaceEpisodes[i].libraryId);
+ bookmarkPromises.push(promise)
+ }
+ return WinJS.Promise.join(bookmarkPromises)
+ }
+ return WinJS.Promise.wrap(null)
+ }, function(episodes) {
+ return WinJS.Promise.wrap(null)
+ }).then(function(bookmarks) {
+ if (bookmarks) {
+ var episodeBookmarkList = String.empty;
+ for (var i = 0; i < bookmarks.length; i++) {
+ episodeBookmarkList = episodeBookmarkList + bookmarks[i].value;
+ if (i !== bookmarks.length - 1)
+ episodeBookmarkList = episodeBookmarkList + ","
+ }
+ deepLinkUrl = MS.Entertainment.Utilities.UriFactory.appendQuery(deepLinkUrl, {bookmarksInMSec: episodeBookmarkList})
+ }
+ return deepLinkUrl
+ }, function(error) {
+ return deepLinkUrl
+ })
+ }
+ return deepLinkPromise
+ };
+ InteractiveAppHelper.getInteractiveUrlFromMedia = function(media) {
+ var deepLinkUrl = MS.Entertainment.Components.Video.InteractiveAppHelper.getRootUrlFromMedia(media);
+ if (deepLinkUrl && MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(media) || MS.Entertainment.Platform.PlaybackHelpers.isMovie(media)) {
+ var ms = new Microsoft.Entertainment.Platform.MediaStore;
+ var isTVEpisode = MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(media);
+ var pendingBookmarkWriteOperations;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.bookmarkOperationsWatcher)) {
+ var bookmarkWatcher = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.bookmarkOperationsWatcher);
+ pendingBookmarkWriteOperations = bookmarkWatcher.waitForPendingOperations()
+ }
+ return WinJS.Promise.as(pendingBookmarkWriteOperations).then(function() {
+ var promise = WinJS.Promise.wrap({value: 0});
+ if (media.libraryId > -1)
+ promise = ms.videoProvider.getBookmarkAsync(media.libraryId);
+ return promise
+ }).then(function(bookmark) {
+ deepLinkUrl = MS.Entertainment.Utilities.UriFactory.appendQuery(deepLinkUrl, {
+ xbvmediaId: media.hasZuneId ? media.zuneId : media.canonicalId, videoStartTimeWithAdsInMSec: bookmark.value
+ });
+ var bookmarksPromise = WinJS.Promise.as(deepLinkUrl);
+ if (isTVEpisode)
+ bookmarksPromise = MS.Entertainment.Components.Video.InteractiveAppHelper.appendBookmarksForAllEpisodesInSeason(media, deepLinkUrl);
+ return bookmarksPromise
+ }, function(error) {
+ return WinJS.Promise.wrap(deepLinkUrl)
+ })
+ }
+ else if (deepLinkUrl) {
+ deepLinkUrl = MS.Entertainment.Utilities.UriFactory.appendQuery(deepLinkUrl, {xbvmediaId: media.hasZuneId ? media.zuneId : media.canonicalId});
+ return MS.Entertainment.Components.Video.InteractiveAppHelper.appendBookmarksForAllEpisodesInSeason(media, deepLinkUrl)
+ }
+ return WinJS.Promise.wrap(deepLinkUrl)
+ };
+ InteractiveAppHelper._urlLookupTable = [];
+ InteractiveAppHelper._loadedLookupFromConfig = false;
+ return InteractiveAppHelper
+ })();
+ Video.InteractiveAppHelper = InteractiveAppHelper
+ })(Components.Video || (Components.Video = {}));
+ var Video = Components.Video
+ })(Entertainment.Components || (Entertainment.Components = {}));
+ var Components = Entertainment.Components
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Video/MovieDashboardViewModel.js b/packages/microsoft.zunevideo/Components/Video/MovieDashboardViewModel.js
new file mode 100644
index 00000000..d920290e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/MovieDashboardViewModel.js
@@ -0,0 +1,162 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Video) {
+ var MovieDashboardDataContext = (function() {
+ function MovieDashboardDataContext() {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.viewModel = MS.Entertainment.UI.Video.MovieDashboardViewModel.sharedInstance
+ }
+ MovieDashboardDataContext.prototype.dispose = function() {
+ if (this.viewModel && this.viewModel.dispose)
+ this.viewModel.dispose()
+ };
+ return MovieDashboardDataContext
+ })();
+ Video.MovieDashboardDataContext = MovieDashboardDataContext;
+ var NewMoviesDashboardDataContext = (function() {
+ function NewMoviesDashboardDataContext() {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.panelAction = null;
+ this.viewModel = MS.Entertainment.UI.Video.MovieDashboardViewModel.sharedInstance;
+ this.panelAction = {action: this.viewModel.viewModelData.primaryContentPanel.moreAction}
+ }
+ NewMoviesDashboardDataContext.prototype.dispose = function() {
+ if (this.viewModel && this.viewModel.dispose)
+ this.viewModel.dispose()
+ };
+ return NewMoviesDashboardDataContext
+ })();
+ Video.NewMoviesDashboardDataContext = NewMoviesDashboardDataContext;
+ var FeaturedMoviesDashboardDataContext = (function() {
+ function FeaturedMoviesDashboardDataContext() {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.panelAction = null;
+ this.viewModel = MS.Entertainment.UI.Video.MovieDashboardViewModel.sharedInstance;
+ this.panelAction = {action: this.viewModel.viewModelData.secondaryContentPanel.moreAction}
+ }
+ FeaturedMoviesDashboardDataContext.prototype.dispose = function() {
+ if (this.viewModel && this.viewModel.dispose)
+ this.viewModel.dispose()
+ };
+ return FeaturedMoviesDashboardDataContext
+ })();
+ Video.FeaturedMoviesDashboardDataContext = FeaturedMoviesDashboardDataContext;
+ var MovieDashboardViewModel = (function(_super) {
+ __extends(MovieDashboardViewModel, _super);
+ function MovieDashboardViewModel(maxNewReleaseItems, maxFeaturedItems, loadPanelActions) {
+ _super.call(this, maxNewReleaseItems, maxFeaturedItems, loadPanelActions)
+ }
+ Object.defineProperty(MovieDashboardViewModel, "sharedInstance", {
+ get: function() {
+ if (!MS.Entertainment.UI.Video.MovieDashboardViewModel._sharedInstance) {
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ MS.Entertainment.UI.Video.MovieDashboardViewModel._sharedInstance = new MS.Entertainment.UI.Video.MovieDashboardViewModel(6, 6, false);
+ else
+ MS.Entertainment.UI.Video.MovieDashboardViewModel._sharedInstance = new MS.Entertainment.UI.Video.MovieDashboardViewModel(4, 4, true);
+ MS.Entertainment.UI.Video.MovieDashboardViewModel._sharedInstance.getItems()
+ }
+ return MS.Entertainment.UI.Video.MovieDashboardViewModel._sharedInstance
+ }, enumerable: true, configurable: true
+ });
+ MovieDashboardViewModel.prototype._getQuery = function() {
+ var query = new MS.Entertainment.Data.Query.MovieHub;
+ query.queryId = MS.Entertainment.UI.Monikers.movieMarketplacePanel;
+ return query
+ };
+ MovieDashboardViewModel.prototype._getPrimaryContentPanel = function() {
+ var primaryContentPanel = new Video.VideoHubDashboardContentPanel;
+ primaryContentPanel.header = String.load(String.id.IDS_VIDEO_DASH_MOVIE_NEW_UC);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var moreAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.videoMarketplaceNavigate);
+ moreAction.moniker = MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases;
+ moreAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.movieMarketplace, hub: MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, args: {selectHub: true}
+ };
+ moreAction.disableWhenOffline = true;
+ moreAction.disableOnServicesDisabled = true;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ moreAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_NEW_MOVIES_BUTTON_VUI_ALM);
+ moreAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_NEW_MOVIES_BUTTON_VUI_PRON);
+ moreAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_NEW_MOVIES_BUTTON_VUI_CONF)
+ }
+ primaryContentPanel.moreAction = moreAction;
+ return primaryContentPanel
+ };
+ MovieDashboardViewModel.prototype._getSecondaryContentPanel = function() {
+ var secondaryContentPanel = new Video.VideoHubDashboardContentPanel;
+ secondaryContentPanel.header = String.load(String.id.IDS_VIDEO_DASH_MOVIE_FEATURED_UC);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var moreAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.videoMarketplaceNavigate);
+ moreAction.moniker = MS.Entertainment.UI.Monikers.movieMarketplaceFeatured;
+ moreAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.movieMarketplace, hub: MS.Entertainment.UI.Monikers.movieMarketplaceFeatured, args: {selectHub: true}
+ };
+ moreAction.disableWhenOffline = true;
+ moreAction.disableOnServicesDisabled = true;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ moreAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_MORE_FEATURED_MOVIES_BUTTON_VUI_ALM);
+ moreAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_MORE_FEATURED_MOVIES_BUTTON_VUI_PRON);
+ moreAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_MORE_FEATURED_MOVIES_BUTTON_VUI_CONF)
+ }
+ secondaryContentPanel.moreAction = moreAction;
+ return secondaryContentPanel
+ };
+ MovieDashboardViewModel.prototype._getActions = function() {
+ if (!this._loadPanelActions)
+ return [];
+ var actionService;
+ var browseAction;
+ var searchAction;
+ actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ browseAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.videoMarketplaceNavigate);
+ browseAction.moniker = MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases;
+ browseAction.icon = MS.Entertainment.UI.Icon.store;
+ browseAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.movieMarketplace, hub: MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, args: {selectHub: true}
+ };
+ browseAction.disableWhenOffline = true;
+ browseAction.disableOnServicesDisabled = true;
+ browseAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardVideoBrowseMovieMarketplace;
+ browseAction.title = String.load(String.id.IDS_VIDEO2_L1_BROWSE_MOVIES_BUTTON_VUI_GUI);
+ browseAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_BROWSE_MOVIES_BUTTON_VUI_ALM);
+ browseAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_BROWSE_MOVIES_BUTTON_VUI_PRON);
+ browseAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_BROWSE_MOVIES_BUTTON_VUI_CONF);
+ searchAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.search);
+ searchAction.icon = WinJS.UI.AppBarIcon.find;
+ searchAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardFeaturedSearch;
+ searchAction.defaultModifierIndex = MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.movies;
+ searchAction.title = String.load(String.id.IDS_VIDEO2_L1_SEARCH_MOVIES_BUTTON_VUI_GUI);
+ searchAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_SEARCH_MOVIES_BUTTON_VUI_ALM);
+ searchAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_SEARCH_MOVIES_BUTTON_VUI_PRON);
+ searchAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_SEARCH_MOVIES_BUTTON_VUI_CONF);
+ return [browseAction, searchAction]
+ };
+ MovieDashboardViewModel.prototype.dispose = function() {
+ MS.Entertainment.UI.Video.MovieDashboardViewModel._sharedInstance = null
+ };
+ return MovieDashboardViewModel
+ })(Video.VideoHubDashboardViewModel);
+ Video.MovieDashboardViewModel = MovieDashboardViewModel
+ })(UI.Video || (UI.Video = {}));
+ var Video = UI.Video
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Video/NewMoviesView.html b/packages/microsoft.zunevideo/Components/Video/NewMoviesView.html
new file mode 100644
index 00000000..dd75d516
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/NewMoviesView.html
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/NewTvView.html b/packages/microsoft.zunevideo/Components/Video/NewTvView.html
new file mode 100644
index 00000000..48628559
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/NewTvView.html
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/PreviewBrowse.html b/packages/microsoft.zunevideo/Components/Video/PreviewBrowse.html
new file mode 100644
index 00000000..dba9e76b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/PreviewBrowse.html
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+ Preview Browse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/PreviewBrowse.js b/packages/microsoft.zunevideo/Components/Video/PreviewBrowse.js
new file mode 100644
index 00000000..35c34bcd
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/PreviewBrowse.js
@@ -0,0 +1,858 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js", "/ViewModels/PurchaseFlow/VideoSmartBuyStateEngine.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Video");
+ WinJS.Namespace.define("MS.Entertainment.Video", {PreviewBrowse: MS.Entertainment.UI.Framework.defineUserControl(null, function PreviewBrowse(element, options) {
+ this.updateNavigationHandler();
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService)) {
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this._volumeStateBinds = WinJS.Binding.bind(volumeControllerService, {
+ volume: this._updateVolumeButtonState.bind(this), mute: this._updateVolumeButtonState.bind(this), isAudioEndpointAvailable: this._clearVolumeOverlayAndUpdateState.bind(this)
+ })
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState))
+ this._networkStatusBinds = WinJS.Binding.bind(uiStateService, {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ this._uiStateHandlers = MS.Entertainment.Utilities.addEventHandlers(uiStateService, {
+ isSnappedChanged: this._clearVolumeOverlayAndUpdateState.bind(this), windowresize: this._clearVolumeOverlayAndUpdateState.bind(this)
+ });
+ this._appResumedBinding = MS.Entertainment.UI.Framework.addEventHandlers(Windows.UI.WebUI.WebUIApplication, {resuming: this._handleAppResume.bind(this)});
+ this._mainHeader = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.mainHeader)
+ }, {
+ processChildren: true, deferInitialization: true, _flipView: null, _virtualizedDataSource: null, _flipViewEventHandlers: null, _lastFlipViewPage: 0, _isFrozen: false, _storedFlipViewCurrentPage: 0, _storedFlipViewPreviousPage: -1, _currentSrcElement: null, _currentMediaItem: null, _currentMediaItemHasTrailer: false, _currentFreeRight: null, _currentBuyOffer: null, _currentRentStreamOffer: null, _currentRentDownloadOffer: null, _dialogToHide: null, _inPurchaseFlow: false, _animateNextHandler: null, _animatePreviousHandler: null, _lastPlaybackContainer: null, _playbackElement: null, _playbackControl: null, _lastPlaybackState: null, _overridePlaybackStateOnThaw: null, _ignoreTransportStateOnFreeze: false, _getDetailsHidePromise: null, _fadeTimer: null, _fadeCenterTextTimer: null, _fadeTimeoutDuration: 3000, _fadeCenterTimeoutDuration: 3000, _autoAdvanceTimer: null, _autoAdvanceTimeoutDuration: 3000, _playPauseButton: null, _volumeStateBinds: null, _networkStatusBinds: null, _volumeOverlayBottomOffset: 17, _volumeOverlayLeftOffset: 33, _appbarService: null, _useAppBar: true, _bottomAppBar: null, _customAppBar: null, _customAppBarElement: null, _spinner: null, _uiStateHandlers: null, _appResumedBinding: null, _mainHeader: null, _voicePrevious: null, _voiceNext: null, _voiceDetails: null, initialize: function initialize() {
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ this._useAppBar = false;
+ var handlePointerMoveApp2 = this._onMouseMoveApp2.bind(this);
+ this._flipViewEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._flipView, {
+ pageselected: this.onChangePage.bind(this), pagecompleted: this.onPageComplete.bind(this), pagevisibilitychanged: this.onPageVisibilityChanged.bind(this), keydown: this._onKeyDownApp2.bind(this), click: this.onDetailsClick.bind(this), MSPointerHover: handlePointerMoveApp2, pointerhover: handlePointerMoveApp2
+ })
+ }
+ else {
+ this._appbarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._appbarService.pushDefaultContext([]);
+ this._bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ this._bottomAppBar.disabled = true;
+ var bottomAppBarElement = document.querySelector(".bottomAppBar");
+ bottomAppBarElement.disabled = true;
+ var barContainer = document.querySelector("[data-win-control='WinJS.UI.AppBar']");
+ this._customAppBar = barContainer.winControl;
+ this._customAppBarElement = barContainer;
+ WinJS.Binding.processAll(barContainer, this);
+ MS.Entertainment.UI.Framework.processDeclMembers(barContainer, this, false);
+ barContainer.parentNode.removeChild(barContainer);
+ bottomAppBarElement.parentNode.appendChild(barContainer);
+ var handlePointerMove = this._onMouseMove.bind(this);
+ this._flipViewEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._flipView, {
+ pageselected: this.onChangePage.bind(this), pagecompleted: this.onPageComplete.bind(this), pagevisibilitychanged: this.onPageVisibilityChanged.bind(this), keydown: this._onKeyDownApp1.bind(this), click: this._onClick.bind(this), MSPointerMove: handlePointerMove, pointermove: handlePointerMove
+ });
+ this._freeButton.onClick = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this.onFree, this);
+ this._buyButton.onClick = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this.onBuy, this);
+ this._rentButton.onClick = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this.onRent, this);
+ this._playPauseButton.onClick = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this.togglePlayPause, this);
+ this._volumeButton.onClick = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this.onVolumeClick, this);
+ this._getDetailsButton.domElement.onclick = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this.onDetailsClick, this)
+ }
+ this._playbackElement = document.createElement("div");
+ this._playbackControl = new MS.Entertainment.Platform.Playback.PlaybackControl(this._playbackElement, {});
+ this._playbackControl.bind("controlInitialized", function playbackControlInitialized(isInitialized) {
+ if (isInitialized) {
+ var iPlayback = this._playbackControl.getPlaybackInterface();
+ iPlayback.bind("currentTransportState", this.handleTransportStateChanges.bind(this))
+ }
+ }.bind(this));
+ var currentLocation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).getUserLocation();
+ if (currentLocation === MS.Entertainment.UI.Monikers.movieTrailerBrowse) {
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ if (currentPage.options && currentPage.options.getItems)
+ currentPage.options.getItems().then(function onGetItems(goodItems) {
+ this._virtualizedDataSource = new MS.Entertainment.Utilities.VirtualizedDataSource(goodItems);
+ this._flipView.itemDataSource = this._virtualizedDataSource;
+ this._virtualizedDataSource.getCount().then(function gotCount(count) {
+ if (count > 0)
+ this._virtualizedDataSource.itemFromIndex(0).then(function gotItem(item) {
+ this.hydrateItem(item.data)
+ }.bind(this))
+ }.bind(this))
+ }.bind(this))
+ }
+ this._animateNextHandler = this.animateNext.bind(this);
+ this._animatePreviousHandler = this.animatePrevious.bind(this);
+ var animations = {
+ next: this._animateNextHandler, previous: this._animatePreviousHandler
+ };
+ this._flipView.setCustomAnimations(animations);
+ this._updateVolumeButtonState()
+ }, unload: function unload() {
+ if (MS.Entertainment.Utilities.isApp1)
+ this._mainHeader.visibility = true;
+ if (MS.Entertainment.Utilities.isApp2 && App2.PlatformLogo)
+ App2.PlatformLogo.visible = true;
+ if (this._customAppBarElement) {
+ this._bottomAppBar.disabled = false;
+ var buttonContainer = this._customAppBarElement.querySelector(".buttonContainer");
+ this._customAppBarElement.removeChild(buttonContainer);
+ this._customAppBarElement.parentNode.removeChild(this._customAppBarElement);
+ this._customAppBarElement = null;
+ this._customAppBar = null
+ }
+ if (this._playbackControl) {
+ var iPlayback = this._playbackControl.getPlaybackInterface();
+ iPlayback.unbind("currentTransportState");
+ iPlayback.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ iPlayback.currentMedia = null;
+ this._playbackControl.unbind("controlInitialized");
+ this._playbackControl.release();
+ this._playbackControl = null
+ }
+ if (this._flipViewEventHandlers) {
+ this._flipViewEventHandlers.cancel();
+ this._flipViewEventHandlers = null
+ }
+ if (this._volumeStateBinds) {
+ this._volumeStateBinds.cancel();
+ this._volumeStateBinds = null
+ }
+ if (this._networkStatusBinds) {
+ this._networkStatusBinds.cancel();
+ this._networkStatusBinds = null
+ }
+ if (this._uiStateHandlers) {
+ this._uiStateHandlers.cancel();
+ this._uiStateHandlers = null
+ }
+ if (this._appResumedBinding) {
+ this._appResumedBinding.cancel();
+ this._appResumedBinding = null
+ }
+ this._virtualizedDataSource = null;
+ if (this._flipView && !this._flipView._unloaded) {
+ this._flipView.dispose();
+ this._flipView = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function previewBrowse_freeze() {
+ this._isFrozen = true;
+ this.clearAutoAdvanceTimer();
+ this.clearFadeTimer();
+ this.clearCenterFadeTimer();
+ if (this._useAppBar) {
+ this._appbarService.pushDefaultContext();
+ this._bottomAppBar.disabled = false;
+ this._customAppBarElement.disabled = true
+ }
+ if (this._playbackControl) {
+ if (!this._ignoreTransportStateOnFreeze)
+ this._lastPlaybackState = this._playbackControl.getPlaybackInterface().currentTransportState;
+ this._playbackControl.getPlaybackInterface().targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused
+ }
+ this._lastFlipViewPage = this._flipView.currentPage;
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function previewBrowse_thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._flipView.currentPage = this._lastFlipViewPage;
+ WinJS.Promise.timeout().then(function deferLastPageRestore() {
+ if (this._flipView.currentPage !== this._lastFlipViewPage)
+ this._flipView.currentPage = this._lastFlipViewPage
+ }.bind(this));
+ if (this._useAppBar) {
+ this._appbarService.pushDefaultContext([]);
+ this._bottomAppBar.disabled = true;
+ this._customAppBarElement.disabled = false
+ }
+ this.startFadeCenterTimer();
+ this.startFadeAllTimer();
+ if (!this._currentMediaItemHasTrailer)
+ this.startAutoAdvanceTimer();
+ this.updateBuyRentButtons();
+ WinJS.Promise.timeout().then(function delaySetPlaybackStateOnThaw() {
+ if (!this._ignoreTransportStateOnFreeze) {
+ if (this._overridePlaybackStateOnThaw) {
+ this._lastPlaybackState = this._overridePlaybackStateOnThaw;
+ this._overridePlaybackStateOnThaw = null
+ }
+ this._restoreLastPlaybackState()
+ }
+ MS.Entertainment.UI.Framework.focusElement(this._flipView.element);
+ this._isFrozen = false
+ }.bind(this))
+ }, _restoreLastPlaybackState: function _restoreLastPlaybackState() {
+ if (this._playbackControl) {
+ var iPlayback = this._playbackControl.getPlaybackInterface();
+ if (iPlayback)
+ if (this._lastPlaybackState === MS.Entertainment.Platform.Playback.TransportState.starting || this._lastPlaybackState === MS.Entertainment.Platform.Playback.TransportState.buffering)
+ iPlayback.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ else
+ iPlayback.targetTransportState = this._lastPlaybackState || MS.Entertainment.Platform.Playback.TransportState.playing
+ }
+ }, slideElement: function slideElement(element, destination) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ function animationEnd(event) {
+ if (event.srcElement === element) {
+ element.removeEventListener("transitionend", animationEnd, false);
+ element.animationEnd = null;
+ WinJS.Utilities.removeClass(element, "flipViewTransitionAnimation");
+ element.style.msTransform = "";
+ element.style.left = destination.left + "px";
+ element.style.top = destination.top + "px";
+ element.animating = false;
+ completion()
+ }
+ }
+ {};
+ if (!MS.Entertainment.ServiceLocator || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled) {
+ if (!element.animating) {
+ element.style.left = destination.oldLeft + "px";
+ element.style.top = destination.oldTop + "px";
+ element.animating = true
+ }
+ else {
+ element.removeEventListener("transitionend", element.animationEnd, false);
+ element.animationEnd = null
+ }
+ element.animationEnd = animationEnd;
+ element.addEventListener("transitionend", animationEnd, false);
+ requestAnimationFrame(function() {
+ WinJS.Utilities.addClass(element, "flipViewTransitionAnimation");
+ var translate = "";
+ if (destination.left !== destination.oldLeft)
+ translate += "translateX(" + (destination.left - destination.oldLeft) + "px) ";
+ if (destination.top !== destination.oldTop)
+ translate += "translateY(" + (destination.top - destination.oldTop) + "px)";
+ element.style.msTransform = translate
+ })
+ }
+ else {
+ element.style.left = destination.left + "px";
+ element.style.top = destination.top + "px";
+ completion()
+ }
+ return promise
+ }, animateNext: function animateNext(outgoingPage, incomingPage) {
+ var outGoingDestination = {
+ left: -outgoingPage.scrollWidth, top: 0, oldLeft: 0, oldTop: 0
+ };
+ var slideOut = this.slideElement(outgoingPage, outGoingDestination);
+ var inComingDestination = {
+ left: 0, top: 0, oldLeft: outgoingPage.scrollWidth, oldTop: 0
+ };
+ var slideIn = this.slideElement(incomingPage, inComingDestination);
+ var promises = [];
+ promises.push(slideOut);
+ promises.push(slideIn);
+ return WinJS.Promise.join(promises)
+ }, animatePrevious: function animatePrevious(outgoingPage, incomingPage) {
+ var outGoingDestination = {
+ left: outgoingPage.scrollWidth, top: 0, oldLeft: 0, oldTop: 0
+ };
+ var slideOut = this.slideElement(outgoingPage, outGoingDestination);
+ var inComingDestination = {
+ left: 0, top: 0, oldLeft: -outgoingPage.scrollWidth, oldTop: 0
+ };
+ var slideIn = this.slideElement(incomingPage, inComingDestination);
+ var promises = [];
+ promises.push(slideOut);
+ promises.push(slideIn);
+ return WinJS.Promise.join(promises)
+ }, updateNavigationHandler: function updateNavigationHandler() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ var oldNavigateTo = page.onNavigateTo || function(){};
+ page.onNavigateTo = function() {
+ if (navigationService.navigationDirection === MS.Entertainment.Navigation.NavigationDirection.backward) {
+ var isNetworkConnected = MS.Entertainment.UI.NetworkStatusService.isOnline();
+ if (!isNetworkConnected)
+ WinJS.Promise.timeout().done(function delayNavigateBack() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack()
+ })
+ }
+ oldNavigateTo();
+ return false
+ }.bind(this)
+ }, hydrateItem: function hydrateItem(item) {
+ if (item.hydrate && !item.hydrated)
+ return item.hydrate().then(function populateSecondaryMetadataText(item) {
+ item.addProperty("previewBrowseSecondaryMetadata", this.formatMovieGenreRatingDuration(item))
+ }.bind(this));
+ return WinJS.Promise.wrap()
+ }, onChangePage: function onChangePage(e) {
+ this._currentSrcElement = e.srcElement;
+ var flipViewCurrentPage = this._flipView.currentPage;
+ if (this._virtualizedDataSource)
+ this._virtualizedDataSource.getCount().then(function gotCount(count) {
+ for (var i = 0; i < 6 && flipViewCurrentPage + i < count; i++)
+ this._virtualizedDataSource.itemFromIndex(flipViewCurrentPage + i).then(function gotItem(item) {
+ this.hydrateItem(item.data)
+ }.bind(this))
+ }.bind(this));
+ this.initializeCenterTextOverlays();
+ if (this._lastPlaybackContainer) {
+ this._lastPlaybackContainer.removeChild(this._playbackElement);
+ if (this._playbackControl) {
+ var iPlayback = this._playbackControl.getPlaybackInterface();
+ iPlayback.currentMedia = null
+ }
+ this._lastPlaybackContainer = null
+ }
+ this.clearAutoAdvanceTimer();
+ this.clearFadeTimer();
+ this.clearCenterFadeTimer()
+ }, onPageComplete: function onPageComplete(e) {
+ this._storedFlipViewCurrentPage = this._flipView.currentPage;
+ this._virtualizedDataSource.itemFromIndex(this._storedFlipViewCurrentPage).then(function gotItem(item) {
+ if (!item || !item.data)
+ return;
+ this._currentMediaItem = item.data;
+ this._currentMediaItemHasTrailer = true;
+ this._currentFreeRight = null;
+ var currentMediaItem = this._currentMediaItem;
+ this.hydrateItem(this._currentMediaItem).done(function success() {
+ if (currentMediaItem !== this._currentMediaItem)
+ return;
+ var playbackContainerElement = this._currentSrcElement.querySelector(".playbackContainer");
+ if (playbackContainerElement && this._playbackControl) {
+ playbackContainerElement.appendChild(this._playbackElement);
+ var iPlayback = this._playbackControl.getPlaybackInterface();
+ this._currentMediaItem.playPreviewOnly = true;
+ var mediaInstance = new MS.Entertainment.Platform.Playback.MediaInstance({
+ source: this._currentMediaItem ? this._currentMediaItem.videoPreviewUrl : null, protectionState: MS.Entertainment.Platform.Playback.ProtectionState.unprotected, mediaType: Microsoft.Entertainment.Queries.ObjectType.video, mediaItem: {data: this._currentMediaItem}
+ });
+ iPlayback.autoPlay = true;
+ iPlayback.currentMedia = mediaInstance;
+ iPlayback.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ this._lastPlaybackState = iPlayback.targetTransportState;
+ var itemHasTrailer = mediaInstance.source || false;
+ if (!itemHasTrailer) {
+ this.startAutoAdvanceTimer();
+ this._currentMediaItemHasTrailer = false
+ }
+ if (!this._getDetailsHidePromise)
+ if (this._useAppBar) {
+ this._getDetailsHidePromise = MS.Entertainment.Utilities.hideElement(this._getDetailsButton.domElement);
+ this.updateBuyRentButtons(true)
+ }
+ else
+ this._getDetailsHidePromise = WinJS.Promise.as();
+ this._getDetailsHidePromise.done(function updateBottomBar() {
+ if (this._currentMediaItem && this._useAppBar) {
+ this._boxArt.target = this._currentMediaItem;
+ this._barTitle.textContent = this._currentMediaItem.name;
+ this._barGenre.textContent = MS.Entertainment.Formatters.formatGenre(this._currentMediaItem);
+ this._barSecondaryMetadata.textContent = this.formatMovieRatingDuration(this._currentMediaItem);
+ this._barStarRatings.averageRating = this._currentMediaItem.averageRating;
+ this._barStarRatings.userRating = this._currentMediaItem.userRating;
+ this.updateBuyRentButtons();
+ MS.Entertainment.Utilities.showElement(this._getDetailsButton.domElement)
+ }
+ this._getDetailsHidePromise = null
+ }.bind(this));
+ this._lastPlaybackContainer = playbackContainerElement
+ }
+ }.bind(this))
+ }.bind(this));
+ this.startFadeAllTimer();
+ this.startFadeCenterTimer();
+ if (!this._useAppBar || this._customAppBar.hidden)
+ MS.Entertainment.UI.Framework.focusElement(this._flipView.element);
+ this._storedFlipViewPreviousPage = this._storedFlipViewCurrentPage
+ }, onPageVisibilityChanged: function onPageVisibilityChanged(e) {
+ this._storedFlipViewCurrentPage = this._flipView.currentPage;
+ if (this._storedFlipViewPreviousPage === this._storedFlipViewCurrentPage) {
+ var iPlayback = this._playbackControl.getPlaybackInterface();
+ WinJS.Promise.timeout(1).done(function delaySetTransportState() {
+ this._restoreLastPlaybackState();
+ this.startFadeAllTimer();
+ this.startFadeCenterTimer()
+ }.bind(this))
+ }
+ if (e.detail.visible && !this._isFrozen) {
+ this._currentMediaItem = null;
+ this._currentFreeRight = null;
+ this.clearAutoAdvanceTimer();
+ this.clearCenterFadeTimer();
+ this.clearFadeTimer();
+ if (!this._getDetailsHidePromise && this._useAppBar) {
+ this._getDetailsHidePromise = MS.Entertainment.Utilities.hideElement(this._getDetailsButton.domElement);
+ this.updateBuyRentButtons(true)
+ }
+ }
+ MS.Entertainment.Utilities.hideElement(this._spinner)
+ }, onDetailsClick: function onDetailsClick() {
+ if (this._currentMediaItem) {
+ this.updateBarVisibility(true);
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({dataContext: {data: this._currentMediaItem}})
+ }
+ }, onLeftArrow: function onLeftArrow() {
+ this._flipView.previous()
+ }, onRightArrow: function onRightArrow() {
+ this._flipView.next()
+ }, onVolumeClick: function onVolumeClick(e) {
+ this._customAppBar.sticky = true;
+ var position = WinJS.Utilities.getPosition(this._volumeButton.domElement);
+ var distanceFromBottom = MS.Entertainment.Utilities.getWindowHeight() - position.top + this._volumeOverlayBottomOffset;
+ var left = (position.left >= 0 && position.width >= 0) ? (position.left + Math.round((0.5 * position.width) - this._volumeOverlayLeftOffset)) + "px" : "auto";
+ var top = "auto";
+ var right = "auto";
+ var bottom = distanceFromBottom >= 0 ? distanceFromBottom + "px" : "auto";
+ var customStyle = "volumeContainer";
+ if (!this._volumeOverlay) {
+ this._volumeOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.VolumeBar", {}, {
+ right: right, top: top, left: left, bottom: bottom
+ });
+ this._volumeOverlay.customStyle = customStyle;
+ this._volumeOverlay.enableKeyboardLightDismiss = true;
+ this._volumeOverlay.show().done(function overlayClosed() {
+ WinJS.Promise.timeout().then(function delaySetAppBarNonSticky() {
+ this._customAppBar.sticky = false
+ }.bind(this));
+ this._volumeOverlay = null
+ }.bind(this))
+ }
+ }, _updateVolumeButtonState: function _updateVolumeButtonState() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService)) {
+ var volumeController = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ if (this._volumeButton && volumeController)
+ if (volumeController.isAudioEndpointAvailable) {
+ var formattedValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(Math.round(volumeController.volume * 100));
+ this._volumeButton.text = volumeController.mute ? String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON).format(formattedValue);
+ this._volumeButton.icon = volumeController.mute ? WinJS.UI.AppBarIcon.mute : WinJS.UI.AppBarIcon.volume;
+ this._volumeButton.isDisabled = false
+ }
+ else {
+ this._volumeButton.text = String.load(String.id.IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON);
+ this._volumeButton.icon = MS.Entertainment.UI.Icon.volumeDisabled;
+ this._volumeButton.isDisabled = true
+ }
+ }
+ }, _clearVolumeOverlayAndUpdateState: function _clearVolumeOverlayAndUpdateState() {
+ if (this._volumeOverlay)
+ this._volumeOverlay.hide();
+ this._updateVolumeButtonState()
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newState) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ if (page.iaNode.moniker === MS.Entertainment.UI.Monikers.movieTrailerBrowse)
+ switch (newState) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack();
+ break
+ }
+ }, _handleAppResume: function _handleAppResume() {
+ var currentPageElement = document.querySelector("#pageContainer .currentPage");
+ WinJS.Utilities.addClass(currentPageElement, "hideFromDisplay");
+ WinJS.Promise.timeout(1).done(function delayShow() {
+ WinJS.Utilities.removeClass(currentPageElement, "hideFromDisplay")
+ })
+ }, togglePlayPause: function togglePlayPause(forcePause) {
+ if (this._playbackControl) {
+ var iPlayback = this._playbackControl.getPlaybackInterface();
+ if (iPlayback.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing || forcePause)
+ iPlayback.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ else
+ iPlayback.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ this._lastPlaybackState = iPlayback.targetTransportState
+ }
+ }, onFree: function onFree() {
+ this.buyRentHelper(MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_BUY)
+ }, onBuy: function onBuy() {
+ this.buyRentHelper(MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_BUY)
+ }, onRent: function onRent() {
+ this.buyRentHelper(MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_RENT)
+ }, buyRentHelper: function buyRentHelper(purchaseType) {
+ this.clearAutoAdvanceTimer();
+ this.clearFadeTimer();
+ this._ignoreTransportStateOnFreeze = true;
+ this._lastPlaybackState = this._playbackControl.getPlaybackInterface().currentTransportState;
+ this.togglePlayPause(true);
+ this._purchaseFlowEventProcessed = false;
+ this._mediaToNavigateTo = null;
+ if (this._currentMediaItem) {
+ var languages = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getLanguagesForRights(this._currentMediaItem, MS.Entertainment.Utilities.defaultClientTypeFromApp);
+ if (languages && languages.length > 1) {
+ this.onDetailsClick();
+ return
+ }
+ if (this._currentFreeRight) {
+ var offerId = this._currentFreeRight.offerId;
+ var currencyCode = this._currentFreeRight.priceCurrencyCode;
+ var purchaseType = MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_BUY;
+ if (this._currentFreeRight.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent || this._currentFreeRight.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream)
+ purchaseType = MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_RENT;
+ if (!this._inPurchaseFlow) {
+ this._inPurchaseFlow = true;
+ MS.Entertainment.Platform.PurchaseHelpers.freePurchaseFlow(this._currentMediaItem, offerId, currencyCode, purchaseType, true, this._currentFreeRight.signedOffer, this._currentFreeRight, MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.details).then(function outOfPurchaseFlow() {
+ this._inPurchaseFlow = false
+ }.bind(this))
+ }
+ }
+ else {
+ var offerId;
+ var returnUri;
+ var gamerTag;
+ var signedOffer;
+ var getRentalOptionPromise = WinJS.Promise.wrap();
+ if (purchaseType === MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_BUY) {
+ offerId = this._currentBuyOffer.offerId;
+ signedOffer = this._currentBuyOffer.signedOffer
+ }
+ else if (this._currentRentStreamOffer && this._currentRentDownloadOffer) {
+ if (!MS.Entertainment.UI.NetworkStatusService.isOnline()) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode);
+ return
+ }
+ getRentalOptionPromise = MS.Entertainment.UI.Controls.RentalOptionsDialog.showRentalOptionsDialog(this._currentMediaItem, this._currentRentStreamOffer, this._currentRentDownloadOffer).then(function(rentalOptionsDialogResult) {
+ signedOffer = rentalOptionsDialogResult.offer.signedOffer;
+ offerId = rentalOptionsDialogResult.offer.offerId;
+ this._dialogToHide = rentalOptionsDialogResult.dialog;
+ if (this._dialogToHide && this._dialogToHide.buttons && this._dialogToHide.buttons[0])
+ this._dialogToHide.buttons[0].isEnabled = false
+ }.bind(this), this.purchaseFlowCancelAndErrorEvent.bind(this))
+ }
+ else if (this._currentRentStreamOffer) {
+ offerId = this._currentRentStreamOffer.offerId;
+ signedOffer = this._currentRentStreamOffer.signedOffer
+ }
+ else if (this._currentRentDownloadOffer) {
+ offerId = this._currentRentDownloadOffer.offerId;
+ signedOffer = this._currentRentDownloadOffer.signedOffer
+ }
+ getRentalOptionPromise.done(function showPurchaseFlowDialog() {
+ if (offerId && signedOffer)
+ MS.Entertainment.Platform.PurchaseHelpers.launchPurchaseFlow(this._currentMediaItem, null, purchaseType, {
+ onFinishedEvent: function purchaseFlowOnFinishedEvent() {
+ this._purchaseFlowEventProcessed = true;
+ this._overridePlaybackStateOnThaw = this._lastPlaybackState;
+ this._mediaToNavigateTo = this._currentMediaItem;
+ this._ignoreTransportStateOnFreeze = false;
+ this.hideDialogIfNeeded()
+ }.bind(this), onMessageEvent: this.hideDialogIfNeeded.bind(this), onCancelEvent: this.purchaseFlowCancelAndErrorEvent.bind(this), onErrorEvent: this.purchaseFlowCancelAndErrorEvent.bind(this), onShowWebHostDialogComplete: this.purchaseFlowCancelAndErrorEvent.bind(this), onShowWebHostDialogError: this.purchaseFlowCancelAndErrorEvent.bind(this)
+ }, offerId, returnUri, gamerTag, signedOffer)
+ }.bind(this))
+ }
+ }
+ }, hideDialogIfNeeded: function hideDialogIfNeeded() {
+ if (this._dialogToHide) {
+ this._dialogToHide.hide();
+ this._dialogToHide = null
+ }
+ }, purchaseFlowCancelAndErrorEvent: function purchaseFlowCancelAndErrorEvent() {
+ this.hideDialogIfNeeded();
+ if (!this._purchaseFlowEventProcessed) {
+ this.startFadeAllTimer();
+ if (!this._currentMediaItemHasTrailer)
+ this.startAutoAdvanceTimer();
+ this._restoreLastPlaybackState();
+ if (this._customAppBar.hidden)
+ MS.Entertainment.UI.Framework.focusElement(this._flipView.element);
+ this._purchaseFlowEventProcessed = true;
+ this._ignoreTransportStateOnFreeze = false
+ }
+ if (this._mediaToNavigateTo) {
+ var mediaToNavigateTo = this._mediaToNavigateTo;
+ WinJS.Promise.timeout().done(function navigateToItemDetails() {
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({dataContext: {data: mediaToNavigateTo}})
+ }.bind(this));
+ this._mediaToNavigateTo = null
+ }
+ }, updateBuyRentButtons: function updateBuyRentButtons(forceHide) {
+ if (!this._useAppBar)
+ return;
+ if (forceHide) {
+ if (this._freeButton)
+ WinJS.Utilities.addClass(this._freeButton.domElement, "removeFromDisplay");
+ this._buySubtitle.textContent = String.empty;
+ if (this._buyButton)
+ WinJS.Utilities.addClass(this._buyButton.domElement, "removeFromDisplay");
+ this._rentSubtitle.textContent = String.empty;
+ if (this._rentButton)
+ WinJS.Utilities.addClass(this._rentButton.domElement, "removeFromDisplay")
+ }
+ else {
+ var bestFreeRight = null;
+ var canBuy = false;
+ var canRent = false;
+ if (this._currentMediaItem) {
+ bestFreeRight = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getBestFreeRight(this._currentMediaItem, MS.Entertainment.Utilities.defaultClientTypeFromApp, [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Purchase, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.PurchaseStream, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream, ]);
+ var buyOffer = bestFreeRight ? null : MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultBuyOffer(this._currentMediaItem, false);
+ var rentStreamOffer = bestFreeRight ? null : MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultRentStreamOffer(this._currentMediaItem);
+ var rentDownloadOffer = (MS.Entertainment.Utilities.isVideoApp2 || bestFreeRight) ? null : MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultRentDownloadOffer(this._currentMediaItem);
+ MS.Entertainment.Platform.PurchaseHelpers.getItemPurchaseAndRentStateAsync(this._currentMediaItem, true).done(function onGetItemPurchaseAndRentState(state) {
+ if (!this._currentMediaItem)
+ return;
+ var hasCurrentRight = (state.canPurchaseDownload || state.canPurchaseStream || state.canRentDownload || state.canRentStream);
+ if (bestFreeRight !== null && !hasCurrentRight) {
+ this._currentFreeRight = bestFreeRight;
+ if (this._freeButton)
+ WinJS.Utilities.removeClass(this._freeButton.domElement, "removeFromDisplay")
+ }
+ else {
+ this._currentFreeRight = null;
+ if (this._freeButton)
+ WinJS.Utilities.addClass(this._freeButton.domElement, "removeFromDisplay")
+ }
+ if (buyOffer && !hasCurrentRight) {
+ this._currentBuyOffer = buyOffer;
+ this._buySubtitle.textContent = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getPriceString(buyOffer);
+ if (this._buyButton)
+ WinJS.Utilities.removeClass(this._buyButton.domElement, "removeFromDisplay")
+ }
+ else {
+ this._currentBuyOffer = null;
+ this._buySubtitle.textContent = String.empty;
+ if (this._buyButton)
+ WinJS.Utilities.addClass(this._buyButton.domElement, "removeFromDisplay")
+ }
+ if ((rentStreamOffer || rentDownloadOffer) && !hasCurrentRight) {
+ this._currentRentStreamOffer = rentStreamOffer;
+ this._currentRentDownloadOffer = rentDownloadOffer;
+ var offer = this._currentRentStreamOffer || this._currentRentDownloadOffer;
+ if (offer) {
+ this._rentSubtitle.textContent = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getPriceString(offer);
+ if (this._rentButton)
+ WinJS.Utilities.removeClass(this._rentButton.domElement, "removeFromDisplay")
+ }
+ }
+ else {
+ this._currentRentStreamOffer = null;
+ this._currentRentDownloadOffer = null;
+ this._rentSubtitle.textContent = String.empty;
+ if (this._rentButton)
+ WinJS.Utilities.addClass(this._rentButton.domElement, "removeFromDisplay")
+ }
+ }.bind(this))
+ }
+ }
+ }, handleTransportStateChanges: function handleTransportStateChanges(newValue, oldValue) {
+ switch (this._playbackControl.getPlaybackInterface().currentTransportState) {
+ case MS.Entertainment.Platform.Playback.TransportState.playing:
+ if (this._useAppBar) {
+ this._playPauseButton.icon = MS.Entertainment.UI.Icon.pause;
+ this._playPauseButton.stringId = String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON
+ }
+ break;
+ case MS.Entertainment.Platform.Playback.TransportState.paused:
+ if (this._useAppBar) {
+ this._playPauseButton.icon = MS.Entertainment.UI.Icon.play;
+ this._playPauseButton.stringId = String.id.IDS_TRANSPORT_CONTROLS_PLAY_BUTTON
+ }
+ break;
+ case MS.Entertainment.Platform.Playback.TransportState.stopped:
+ if (!this._autoAdvanceTimer)
+ if (oldValue === MS.Entertainment.Platform.Playback.TransportState.playing)
+ this.autoAdvance();
+ else if (oldValue === MS.Entertainment.Platform.Playback.TransportState.starting)
+ this.startAutoAdvanceTimer();
+ break;
+ default:
+ break
+ }
+ }, startFadeAllTimer: function startFadeAllTimer() {
+ this.clearFadeTimer();
+ this._fadeTimer = WinJS.Promise.timeout(this._fadeTimeoutDuration).then(function fadeOut() {
+ if (this._autoAdvanceTimer === null)
+ if (MS.Entertainment.Utilities.isApp2 && this._currentSrcElement) {
+ var currentOverlay = this._currentSrcElement.querySelector(".previewBrowseItemDataContainer");
+ this.setOverlayVisibility(currentOverlay, false)
+ }
+ else
+ this.setOverlayVisibility(null, false)
+ }.bind(this))
+ }, clearFadeTimer: function clearFadeTimer() {
+ if (this._fadeTimer) {
+ this._fadeTimer.cancel();
+ this._fadeTimer = null
+ }
+ if (MS.Entertainment.Utilities.isApp2 && this._currentSrcElement) {
+ var currentOverlay = this._currentSrcElement.querySelector(".previewBrowseItemDataContainer");
+ this.setOverlayVisibility(currentOverlay, true)
+ }
+ else
+ this.setOverlayVisibility(null, true)
+ }, startFadeCenterTimer: function startFadeCenterTimer() {
+ this.clearCenterFadeTimer();
+ this._fadeCenterTextTimer = WinJS.Promise.timeout(this._fadeCenterTimeoutDuration).then(function fadeOut() {
+ if (this._autoAdvanceTimer === null)
+ this.fadeCenterTextOverlay()
+ }.bind(this))
+ }, clearCenterFadeTimer: function clearCenterFadeTimer() {
+ if (this._fadeCenterTextTimer) {
+ this._fadeCenterTextTimer.cancel();
+ this._fadeCenterTextTimer = null
+ }
+ }, startAutoAdvanceTimer: function startAutoAdvanceTimer() {
+ this.clearAutoAdvanceTimer();
+ this._autoAdvanceTimer = WinJS.Promise.timeout(this._autoAdvanceTimeoutDuration).then(function autoAdvance() {
+ this.autoAdvance()
+ }.bind(this))
+ }, clearAutoAdvanceTimer: function clearAutoAdvanceTimer() {
+ if (this._autoAdvanceTimer) {
+ this._autoAdvanceTimer.cancel();
+ this._autoAdvanceTimer = null
+ }
+ }, autoAdvance: function autoAdvance() {
+ var flipViewCurrentPage = this._flipView.currentPage;
+ this._flipView.count().done(function gotCount(count) {
+ var lastPage = count - 1;
+ if (flipViewCurrentPage === lastPage)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack();
+ else
+ this._flipView.next()
+ }.bind(this))
+ }, initializeCenterTextOverlays: function initializeCenterTextOverlays() {
+ var allOverlays = document.querySelectorAll(".previewBrowseItemDataContainer");
+ var forEach = Array.prototype.forEach;
+ forEach.call(allOverlays, function ensureVisibleOverlays(overlay) {
+ this.setOverlayVisibility(overlay, true)
+ }.bind(this))
+ }, fadeCenterTextOverlay: function fadeCenterTextOverlay() {
+ if (this._currentSrcElement) {
+ var currentOverlay = this._currentSrcElement.querySelector(".previewBrowseItemDataContainer");
+ MS.Entertainment.Utilities.hideElement(currentOverlay);
+ MS.Entertainment.Utilities.showElement(this._spinner)
+ }
+ }, _setNavigationButtonVisibility: function _setNavigationVisibility(arrowButton, voiceButton, visible) {
+ if (visible) {
+ if (arrowButton)
+ MS.Entertainment.Utilities.showElement(arrowButton);
+ if (voiceButton) {
+ WinJS.Utilities.removeClass(voiceButton, MS.Entertainment.UI.App2.VoiceStatics.voiceDisabledCssStyle);
+ WinJS.Utilities.removeClass(voiceButton, "hideFromDisplay")
+ }
+ }
+ else {
+ if (arrowButton)
+ MS.Entertainment.Utilities.hideElement(arrowButton);
+ if (voiceButton) {
+ WinJS.Utilities.addClass(voiceButton, "hideFromDisplay");
+ WinJS.Utilities.addClass(voiceButton, MS.Entertainment.UI.App2.VoiceStatics.voiceDisabledCssStyle)
+ }
+ }
+ if (voiceButton)
+ App2.UI.Voice.refreshVoiceElements()
+ }, setOverlayVisibility: function setOverlayVisibility(overlay, visible) {
+ if (visible) {
+ var flipViewCurrentPage = this._storedFlipViewCurrentPage;
+ if (overlay)
+ MS.Entertainment.Utilities.showElement(overlay);
+ if (flipViewCurrentPage !== 0)
+ this._setNavigationButtonVisibility(this._arrowLeft, this._previousTrailerVoice, true);
+ else
+ this._setNavigationButtonVisibility(this._arrowLeft, this._previousTrailerVoice, false);
+ this._flipView.count().done(function gotCount(count) {
+ var lastPage = count - 1;
+ if (flipViewCurrentPage === lastPage)
+ this._setNavigationButtonVisibility(this._arrowRight, this._nextTrailerVoice, false);
+ else
+ this._setNavigationButtonVisibility(this._arrowRight, this._nextTrailerVoice, true)
+ }.bind(this));
+ if (MS.Entertainment.Utilities.isApp1)
+ this._mainHeader.visibility = true;
+ if (MS.Entertainment.Utilities.isApp2 && App2.PlatformLogo)
+ App2.PlatformLogo.visible = true
+ }
+ else {
+ if (overlay)
+ MS.Entertainment.Utilities.hideElement(overlay);
+ if (this._arrowLeft)
+ MS.Entertainment.Utilities.hideElement(this._arrowLeft);
+ if (this._arrowRight)
+ MS.Entertainment.Utilities.hideElement(this._arrowRight);
+ if (MS.Entertainment.Utilities.isApp1)
+ this._mainHeader.visibility = false;
+ if (MS.Entertainment.Utilities.isApp2 && App2.PlatformLogo)
+ App2.PlatformLogo.visible = false
+ }
+ this.updateCursorVisibility(visible)
+ }, updateBarVisibility: function updateBarVisibility(forceHide) {
+ if (this._customAppBar && this._useAppBar)
+ if (this._customAppBar.hidden && !forceHide)
+ this._customAppBar.show();
+ else
+ this._customAppBar.hide()
+ }, updateCursorVisibility: function updateCursorVisibility(visibility) {
+ var cursorStyle = visibility ? "default" : "none";
+ if (this._flipView && this._flipView.element && this._flipView.element.style.cursor !== cursorStyle)
+ this._flipView.element.style.cursor = cursorStyle
+ }, _onClick: function _onClick(e) {
+ this.updateBarVisibility();
+ this.startFadeAllTimer();
+ e.stopPropagation()
+ }, _onMouseMove: function _onMouseMove(e) {
+ this.startFadeAllTimer();
+ e.stopPropagation()
+ }, _onMouseMoveApp2: function _onMouseMove(e) {
+ this.startFadeAllTimer()
+ }, _onKeyDownApp2: function _onKeyDownApp2(e) {
+ if (e.altKey)
+ return;
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rightArrow:
+ case WinJS.Utilities.Key.rArrow:
+ case WinJS.Utilities.Key.rOtherArrow:
+ this._flipView.next();
+ break;
+ case WinJS.Utilities.Key.leftArrow:
+ case WinJS.Utilities.Key.lArrow:
+ case WinJS.Utilities.Key.lOtherArrow:
+ this._flipView.previous();
+ break;
+ case WinJS.Utilities.Key.upArrow:
+ case WinJS.Utilities.Key.uArrow:
+ case WinJS.Utilities.Key.uOtherArrow:
+ case WinJS.Utilities.Key.downArrow:
+ case WinJS.Utilities.Key.dArrow:
+ case WinJS.Utilities.Key.dOtherArrow:
+ this.setOverlayVisibility(null, true);
+ this.startFadeAllTimer();
+ break;
+ case WinJS.Utilities.Key.enter:
+ this.onDetailsClick();
+ break;
+ default:
+ return
+ }
+ e.stopPropagation()
+ }, _onKeyDownApp1: function _onKeyDownApp1(e) {
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.upArrow:
+ case WinJS.Utilities.Key.downArrow:
+ case WinJS.Utilities.Key.tab:
+ this.setOverlayVisibility(null, true);
+ this.startFadeAllTimer();
+ break;
+ default:
+ return
+ }
+ e.stopPropagation()
+ }, formatMovieRatingDuration: function formatMovieRatingDuration(sourceValue) {
+ var result = String.empty;
+ if (sourceValue) {
+ var parts = [];
+ if (sourceValue.localizedRatingStringLong)
+ parts.push(sourceValue.localizedRatingStringLong);
+ if (sourceValue.duration)
+ parts.push(MS.Entertainment.Formatters.formatDurationGreaterThanZeroFromDateNonConverter(sourceValue.duration));
+ result = parts.join(String.load(String.id.IDS_DETAILS_METADATA_SEPERATOR))
+ }
+ return result
+ }, formatMovieGenreRatingDuration: function formatMovieGenreRatingDuration(sourceValue) {
+ var result = String.empty;
+ if (sourceValue) {
+ var parts = [];
+ if (sourceValue.genre)
+ parts.push(MS.Entertainment.Formatters.formatGenresListNonConverter(sourceValue.genre));
+ if (sourceValue.localizedRatingStringLong)
+ parts.push(sourceValue.localizedRatingStringLong);
+ if (sourceValue.duration)
+ parts.push(MS.Entertainment.Formatters.formatDurationGreaterThanZeroFromDateNonConverter(sourceValue.duration));
+ result = parts.join(String.load(String.id.IDS_DETAILS_METADATA_SEPERATOR))
+ }
+ return result
+ }
+ }, {showSpinner: true})})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/PurchaseVideo.js b/packages/microsoft.zunevideo/Components/Video/PurchaseVideo.js
new file mode 100644
index 00000000..9d1fc4ba
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/PurchaseVideo.js
@@ -0,0 +1,155 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Purchase");
+ WinJS.Namespace.define("MS.Entertainment.Purchase", {
+ VideoPurchaseFlowProvider: MS.Entertainment.UI.Framework.define(null, {getPurchaseFlow: function getPurchaseFlow(mediaItem, serviceId, target, purchaseType, offerId, returnUri, gamerTag) {
+ if (mediaItem.mediaType !== Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.mediaType !== Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ MS.Entertainment.Purchase.fail("Expected movie, episode or season media for Video purchase flow.");
+ return null
+ }
+ var purchaseExp = null;
+ var purchaseUrl = String.empty;
+ var taskId = String.empty;
+ if (MS.Entertainment.Utilities.isDrmIndividualized) {
+ var type = String.empty;
+ var extraParam = String.empty;
+ if (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ serviceId = (mediaItem.seriesZuneId && mediaItem.seriesZuneId !== MS.Entertainment.Utilities.EMPTY_GUID) ? mediaItem.seriesZuneId : mediaItem.seriesId;
+ extraParam = "&seasonNumber=" + mediaItem.seasonNumber;
+ type = MS.Entertainment.Platform.PurchaseHelpers.TV_SEASON_TYPE
+ }
+ else if (mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ type = MS.Entertainment.Platform.PurchaseHelpers.TV_EPISODE_TYPE;
+ else if (mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ type = MS.Entertainment.Platform.PurchaseHelpers.MOVIE_TYPE;
+ else {
+ MS.Entertainment.Purchase.fail("Unsupported video type.");
+ return null
+ }
+ purchaseUrl = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_ModernPurchase) + "/Purchase?client=x13";
+ if (purchaseType)
+ purchaseUrl = purchaseUrl + "&purchaseAction=" + purchaseType;
+ purchaseExp = new MS.Entertainment.Purchase.PurchaseVideo;
+ taskId = MS.Entertainment.UI.Controls.WebHost.TaskId.VIDEO
+ }
+ else
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_PURCHASE_ERROR_CAPTION), 0x8004b822);
+ return {
+ purchaseExp: purchaseExp, purchaseUrl: purchaseUrl, taskId: taskId
+ }
+ }}, {factory: function factory() {
+ return new MS.Entertainment.Purchase.VideoPurchaseFlowProvider
+ }}), PurchaseVideo: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.WebHostExperience", function PurchaseVideo_constructor() {
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.constructor.call(this);
+ this.addMedia = MS.Entertainment.Platform.PurchaseHelpers.addMedia;
+ this.downloadMedia = MS.Entertainment.Platform.PurchaseHelpers.downloadMedia
+ }, {
+ mediaItem: null, offerIds: null, addMedia: null, downloadMedia: null, dbItems: null, downloadWhenAdded: false, startListener: function startListener() {
+ var trace = String.empty;
+ if (!this.disposed)
+ this.eventProvider.tracePurchaseFlowVideo_Start(trace);
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.startListener.apply(this, arguments)
+ }, _onPurchaseSuccess: function _onPurchaseSuccess(messageStruct) {
+ MS.Entertainment.UI.assert(messageStruct.receipt, "Success message doesn't contain a valid receipt");
+ var offerIds = this.offerIds;
+ var offerId = String.empty;
+ var errorCode = String.empty;
+ if (messageStruct.offerIds)
+ offerIds = messageStruct.offerIds;
+ if (offerIds && offerIds.length > 0)
+ offerId = offerIds[0];
+ this.eventProvider.tracePurchaseFlowVideo_Finish(offerId);
+ var that = this;
+ MS.Entertainment.UI.assert(this.mediaItem, "Purchase Flow got a null mediaItem");
+ if (this.mediaItem) {
+ MS.Entertainment.Platform.PurchaseHelpers.downloadClosedCaptionFiles(this.mediaItem);
+ this.addMedia(this.mediaItem, offerIds, true).then(function addComplete(dbItems) {
+ that.dbItems = dbItems;
+ that.mediaItem.rights.forEach(function(right) {
+ if (right.offerId === offerId)
+ if (right.licenseRight === MS.Entertainment.Data.Augmenter.Marketplace.edsDistributionRight.rent && right.deliveryFormat === MS.Entertainment.Data.Augmenter.Marketplace.edsDeliveryFormat.download)
+ that.downloadWhenAdded = true
+ });
+ if (that.downloadWhenAdded)
+ that.downloadMedia(that.mediaItem, dbItems.dbMediaIds, dbItems.dbMediaTypes, false, true)
+ })
+ }
+ }, _onDialogDone: function _onDialogDone(messageStruct) {
+ var offerIds = this.offerIds;
+ var offerId = null;
+ if (messageStruct.offerIds)
+ offerIds = messageStruct.offerIds;
+ if (offerIds && offerIds.length > 0)
+ offerId = offerIds[0];
+ if (offerId)
+ this.eventProvider.tracePurchaseFlowVideo_Done(String.empty, offerId)
+ }, messageReceived: function messageReceived(messageStruct, webHost, sendMessageFunc) {
+ if (!this.disposed)
+ switch (messageStruct.verb) {
+ case"CLOSE_DIALOG":
+ switch (messageStruct.reason) {
+ case"CANCEL":
+ this.eventProvider.tracePurchaseFlowVideo_Cancel(String.empty);
+ break;
+ case"ERROR":
+ this.eventProvider.tracePurchaseFlowVideo_Error(String.empty, messageStruct.errorCode);
+ break;
+ case"REJECTION":
+ this.eventProvider.tracePurchaseFlowVideo_Rejection(String.empty, messageStruct.errorCode);
+ break;
+ case"SUCCESS":
+ this._onDialogDone(messageStruct);
+ break
+ }
+ break;
+ case"error":
+ this.eventProvider.tracePurchaseFlowVideo_Error(String.empty, messageStruct.description);
+ break;
+ case"done":
+ if (messageStruct.status === "cancel")
+ this.eventProvider.tracePurchaseFlowVideo_Cancel(String.empty);
+ else if (messageStruct.status === "success" && messageStruct.receipt) {
+ this._onPurchaseSuccess(messageStruct);
+ this._onDialogDone(messageStruct)
+ }
+ break;
+ case"CONTENT_ADDED":
+ this._onPurchaseSuccess(messageStruct);
+ break;
+ case"BANDWIDTH_CHECK":
+ this.eventProvider.tracePurchaseFlowVideo_Start_Bandwidth_Test(String.empty);
+ this.startBandwidthTest(this.mediaItem, sendMessageFunc);
+ break
+ }
+ MS.Entertainment.UI.Controls.WebHostExperience.prototype.messageReceived.apply(this, arguments)
+ }, startBandwidthTest: function startBandwidthTest(mediaItem, sendMessageFunc) {
+ var videoFileUrl = String.empty;
+ if (mediaItem.rights)
+ for (var i = 0; i < mediaItem.rights.length; i++) {
+ var licenseRight = mediaItem.rights[i].licenseRight;
+ if (licenseRight === "PurchaseStream" || licenseRight === "RentStream") {
+ videoFileUrl = mediaItem.rights[i].videoFileUrl;
+ if (videoFileUrl && videoFileUrl !== String.empty)
+ break
+ }
+ }
+ if (videoFileUrl && videoFileUrl !== String.empty) {
+ var bandwidthTest = new Microsoft.Entertainment.Platform.Playback.MBRBandwidthTest;
+ bandwidthTest.start(videoFileUrl).then(function testFinished(rate) {
+ sendMessageFunc("BANDWIDTH_TEST_FINISH " + rate)
+ }, function testError(error) {
+ sendMessageFunc("BANDWIDTH_TEST_ERROR " + " 1")
+ }, function testProgress(progress) {
+ sendMessageFunc("BANDWIDTH_TEST_PROGRESS " + (progress * 100))
+ })
+ }
+ else
+ sendMessageFunc("BANDWIDTH_TEST_FINISH 1000")
+ }
+ }, {factory: function factory() {
+ return new MS.Entertainment.Purchase.PurchaseVideo
+ }})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/RentalExpirationService.js b/packages/microsoft.zunevideo/Components/Video/RentalExpirationService.js
new file mode 100644
index 00000000..08c2f62f
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/RentalExpirationService.js
@@ -0,0 +1,75 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/debug.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI");
+ WinJS.Namespace.define("MS.Entertainment.UI", {RentalExpirationService: MS.Entertainment.UI.Framework.define(null, {}, {
+ getExpirationString: function getExpirationString(media, date, callback) {
+ if (date) {
+ var spanInMilliseconds = date - Date.now();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var useTestExpiration = configurationManager.service.useTestExpirationService;
+ if (useTestExpiration) {
+ var testExpirationIndex = MS.Entertainment.UI.RentalExpirationService.testExpirationIndexes[media];
+ if (testExpirationIndex === undefined)
+ testExpirationIndex = MS.Entertainment.UI.RentalExpirationService.testExpirationIndexes[media] = 0;
+ spanInMilliseconds = MS.Entertainment.UI.RentalExpirationService.getTestExpirations()[testExpirationIndex];
+ if (testExpirationIndex < MS.Entertainment.UI.RentalExpirationService.getTestExpirations().length - 1)
+ MS.Entertainment.UI.RentalExpirationService.testExpirationIndexes[media]++
+ }
+ var expirationTickTimer = null;
+ if (spanInMilliseconds > 0) {
+ var milliSecondsToNextUpdate = spanInMilliseconds % (60 * 1000);
+ expirationTickTimer = window.setTimeout(function() {
+ this.getExpirationString(media, date, callback)
+ }.bind(this), milliSecondsToNextUpdate)
+ }
+ callback(spanInMilliseconds, expirationTickTimer)
+ }
+ else
+ callback(-1, null)
+ }, testExpirationIndexes: [], testExpirations: [], generateNearbyExpirations: function generateExpirations(expSpan) {
+ MS.Entertainment.UI.RentalExpirationService.testExpirations.push(expSpan + 3000);
+ MS.Entertainment.UI.RentalExpirationService.testExpirations.push(expSpan);
+ MS.Entertainment.UI.RentalExpirationService.testExpirations.push(expSpan - 58000)
+ }, getTestExpirations: function getTestExpirations() {
+ if (MS.Entertainment.UI.RentalExpirationService.testExpirations.length === 0) {
+ var dateZero = new Date(0, 0, 0);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 12) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 4, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 4) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 3, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 3, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 3) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 2, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 2, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 1, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 1, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 2, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 2, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 1, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 1, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 0, 2) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 0, 1) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(new Date(0, 0, 0, 0, 0, 5) - dateZero);
+ MS.Entertainment.UI.RentalExpirationService.generateNearbyExpirations(-60000)
+ }
+ return MS.Entertainment.UI.RentalExpirationService.testExpirations
+ }, testExpirationSpan: function testSpan(span) {
+ var message;
+ message = MS.Entertainment.Formatters.formatRentalExpirationFromSpanInt(span);
+ Debug.writeln(message)
+ }, testExpirationFormatter: function testExpirationFormatter() {
+ var test = MS.Entertainment.UI.RentalExpirationService.getTestExpirations();
+ test.forEach(function(exp) {
+ if (exp % 60000 === 3000)
+ Debug.writeln("");
+ MS.Entertainment.UI.RentalExpirationService.testExpirationSpan(exp)
+ })
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/TransferNotificationHandler.js b/packages/microsoft.zunevideo/Components/Video/TransferNotificationHandler.js
new file mode 100644
index 00000000..b2057ff0
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/TransferNotificationHandler.js
@@ -0,0 +1,136 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/FileTransferNotificationService.js");
+scriptValidator("/Components/BaseTransferNotificationHandler.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {FileTransferNotificationHandlers: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.BaseFileTransferNotificationHandlers", function FileTransferNotificationHandlersConstructor() {
+ MS.Entertainment.UI.BaseFileTransferNotificationHandlers.prototype.constructor.call(this);
+ this.currentError = {};
+ this.trackErrors = 0
+ }, {
+ _downloadInProgressString: {get: function() {
+ return String.id.IDS_VIDEO_DOWNLOAD_PROGRESS_ITEMS_PLURAL
+ }}, _downloadNotification: {get: function() {
+ return String.load(String.id.IDS_VIDEO_DOWNLOAD_NOTIFICATION)
+ }}, _downloadComplete: {get: function() {
+ return String.load(String.id.IDS_VIDEO_DOWNLOAD_COMPLETE)
+ }}, trackDownloadUpdate: function trackDownloadUpdate(eventInfo) {
+ MS.Entertainment.UI.assert(!MS.Entertainment.Utilities.isEmptyGuid(eventInfo.task.mediaId) || eventInfo.task.libraryId > 0, "task object had an invalid identifiers: mediaId: {0}, libraryId {1}".format(eventInfo.task.mediaId, eventInfo.task.libraryId));
+ var mediaIdentifier = this._getMediaIdentifierFromTask(eventInfo.task);
+ var itemIsDownloading = false;
+ var fileTransferNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransferNotifications);
+ switch (eventInfo.task.taskStatus) {
+ case Microsoft.Entertainment.FileTransferStatus.error:
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--
+ }
+ if (this.currentPaused[mediaIdentifier]) {
+ delete this.currentPaused[mediaIdentifier];
+ this.trackPaused--
+ }
+ if (eventInfo.task.isClosed && this.currentError[mediaIdentifier]) {
+ delete this.currentError[mediaIdentifier];
+ this.trackErrors--
+ }
+ else if (!eventInfo.task.isClosed && !this.currentError[mediaIdentifier]) {
+ this.currentError[mediaIdentifier] = true;
+ this.trackErrors++
+ }
+ itemIsDownloading = false;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.canceled:
+ case Microsoft.Entertainment.FileTransferStatus.completed:
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--
+ }
+ if (this.currentError[mediaIdentifier]) {
+ delete this.currentError[mediaIdentifier];
+ this.trackErrors--
+ }
+ if (this.currentPaused[mediaIdentifier]) {
+ delete this.currentPaused[mediaIdentifier];
+ this.trackPaused--
+ }
+ itemIsDownloading = false;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.paused:
+ case Microsoft.Entertainment.FileTransferStatus.pausedCostedNetwork:
+ case Microsoft.Entertainment.FileTransferStatus.pausedNoNetwork:
+ if (this.currentDownloads[mediaIdentifier]) {
+ delete this.currentDownloads[mediaIdentifier];
+ this.trackDownloads--
+ }
+ if (this.currentError[mediaIdentifier]) {
+ delete this.currentError[mediaIdentifier];
+ this.trackErrors--
+ }
+ if (!this.currentPaused[mediaIdentifier]) {
+ this.currentPaused[mediaIdentifier] = true;
+ this.trackPaused++
+ }
+ itemIsDownloading = true;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.running:
+ if (this.currentError[mediaIdentifier]) {
+ delete this.currentError[mediaIdentifier];
+ this.trackErrors--
+ }
+ if (this.currentPaused[mediaIdentifier]) {
+ delete this.currentPaused[mediaIdentifier];
+ this.trackPaused--
+ }
+ if (!this.currentDownloads[mediaIdentifier]) {
+ this.currentDownloads[mediaIdentifier] = true;
+ this.trackDownloads++
+ }
+ itemIsDownloading = true;
+ break
+ }
+ fileTransferNotifications.setItemError(mediaIdentifier, 0);
+ fileTransferNotifications.setItemTransferState(mediaIdentifier, MS.Entertainment.UI.FileTransferNotificationService.Event.download, itemIsDownloading);
+ this._startNotificationTimer()
+ }, _updateTrackDownloadNotification: function _updateTrackDownloadNotification() {
+ var appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ var notification;
+ var notificationType = MS.Entertainment.UI.Notification.Type.Informational;
+ var title = String.Empty;
+ var subTitle = String.Empty;
+ var subTitleCaret = false;
+ var icon = WinJS.UI.AppBarIcon.download;
+ var category = this.Type.TrackDownloadInformational;
+ var isPersistent = false;
+ var clickAction = (MS.Entertainment.Utilities.isVideoApp1 ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showVideoDownloadManager) : null);
+ var currentDownloads = this.trackDownloads;
+ var currentPaused = this.trackPaused;
+ var currentErrors = this.trackErrors;
+ if (currentDownloads > 0) {
+ var numberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var formattedCount = numberFormatter.format(currentDownloads);
+ title = this._downloadNotification;
+ subTitle = MS.Entertainment.Utilities.Pluralization.getPluralizedString(this._downloadInProgressString, currentDownloads).format(formattedCount);
+ isPersistent = true
+ }
+ else if (currentPaused > 0) {
+ title = String.load(String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT);
+ subTitle = String.load(String.id.IDS_VIDEO_DOWNLOAD_MORE_INFO);
+ isPersistent = true
+ }
+ else if (currentErrors > 0) {
+ title = String.load(String.id.IDS_VIDEO_DOWNLOAD_ERROR);
+ subTitle = String.load(String.id.IDS_VIDEO_DOWNLOAD_MORE_INFO);
+ isPersistent = true
+ }
+ else
+ title = this._downloadComplete;
+ subTitleCaret = (MS.Entertainment.Utilities.isVideoApp1 && subTitle && clickAction);
+ notification = new MS.Entertainment.UI.Notification({
+ notificationType: notificationType, title: title, subTitle: subTitle, subTitleCaret: subTitleCaret, icon: icon, category: category, isPersistent: isPersistent, action: clickAction
+ });
+ appNotificationService.send(notification)
+ }, trackDownloadError: function trackDownloadError(eventInfo) {
+ this.trackDownloadUpdate(eventInfo)
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/TvDashboardViewModel.js b/packages/microsoft.zunevideo/Components/Video/TvDashboardViewModel.js
new file mode 100644
index 00000000..156f024c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/TvDashboardViewModel.js
@@ -0,0 +1,162 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Video) {
+ var TvDashboardDataContext = (function() {
+ function TvDashboardDataContext() {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.viewModel = MS.Entertainment.UI.Video.TvDashboardViewModel.sharedInstance
+ }
+ TvDashboardDataContext.prototype.dispose = function() {
+ if (this.viewModel && this.viewModel.dispose)
+ this.viewModel.dispose()
+ };
+ return TvDashboardDataContext
+ })();
+ Video.TvDashboardDataContext = TvDashboardDataContext;
+ var NewTvDashboardDataContext = (function() {
+ function NewTvDashboardDataContext(maxNewReleases, maxFeatured, loadPanelActions) {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.panelAction = null;
+ this.viewModel = MS.Entertainment.UI.Video.TvDashboardViewModel.sharedInstance;
+ this.panelAction = {action: this.viewModel.viewModelData.primaryContentPanel.moreAction}
+ }
+ NewTvDashboardDataContext.prototype.dispose = function() {
+ if (this.viewModel && this.viewModel.dispose)
+ this.viewModel.dispose()
+ };
+ return NewTvDashboardDataContext
+ })();
+ Video.NewTvDashboardDataContext = NewTvDashboardDataContext;
+ var FeaturedTvDashboardDataContext = (function() {
+ function FeaturedTvDashboardDataContext(maxNewReleases, maxFeatured, loadPanelActions) {
+ this.doNotRaisePanelReady = false;
+ this.hideNavigationContainer = true;
+ this.panelAction = null;
+ this.viewModel = MS.Entertainment.UI.Video.TvDashboardViewModel.sharedInstance;
+ this.panelAction = {action: this.viewModel.viewModelData.secondaryContentPanel.moreAction}
+ }
+ FeaturedTvDashboardDataContext.prototype.dispose = function() {
+ if (this.viewModel && this.viewModel.dispose)
+ this.viewModel.dispose()
+ };
+ return FeaturedTvDashboardDataContext
+ })();
+ Video.FeaturedTvDashboardDataContext = FeaturedTvDashboardDataContext;
+ var TvDashboardViewModel = (function(_super) {
+ __extends(TvDashboardViewModel, _super);
+ function TvDashboardViewModel(maxNewReleaseItems, maxFeaturedItems, loadPanelActions) {
+ _super.call(this, maxNewReleaseItems, maxFeaturedItems, loadPanelActions)
+ }
+ Object.defineProperty(TvDashboardViewModel, "sharedInstance", {
+ get: function() {
+ if (!MS.Entertainment.UI.Video.TvDashboardViewModel._sharedInstance) {
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ MS.Entertainment.UI.Video.TvDashboardViewModel._sharedInstance = new MS.Entertainment.UI.Video.TvDashboardViewModel(6, 7, false);
+ else
+ MS.Entertainment.UI.Video.TvDashboardViewModel._sharedInstance = new MS.Entertainment.UI.Video.TvDashboardViewModel(4, 4, true);
+ MS.Entertainment.UI.Video.TvDashboardViewModel._sharedInstance.getItems()
+ }
+ return MS.Entertainment.UI.Video.TvDashboardViewModel._sharedInstance
+ }, enumerable: true, configurable: true
+ });
+ TvDashboardViewModel.prototype._getQuery = function() {
+ var query = new MS.Entertainment.Data.Query.TvHub;
+ query.queryId = MS.Entertainment.UI.Monikers.tvMarketplacePanel;
+ return query
+ };
+ TvDashboardViewModel.prototype._getPrimaryContentPanel = function() {
+ var primaryContentPanel = new Video.VideoHubDashboardContentPanel;
+ primaryContentPanel.header = String.load(String.id.IDS_VIDEO_DASH_TV_NEW_UC);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var moreAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.videoMarketplaceNavigate);
+ moreAction.moniker = MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases;
+ moreAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.tvMarketplace, hub: MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases, args: {selectHub: true}
+ };
+ moreAction.disableWhenOffline = true;
+ moreAction.disableOnServicesDisabled = true;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ moreAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_MORE_NEW_TV_BUTTON_VUI_ALM);
+ moreAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_MORE_NEW_TV_BUTTON_VUI_PRON);
+ moreAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_MORE_NEW_TV_BUTTON_VUI_CONF)
+ }
+ primaryContentPanel.moreAction = moreAction;
+ return primaryContentPanel
+ };
+ TvDashboardViewModel.prototype._getSecondaryContentPanel = function() {
+ var secondaryContentPanel = new Video.VideoHubDashboardContentPanel;
+ secondaryContentPanel.header = String.load(String.id.IDS_VIDEO_DASH_TV_FEATURED_UC);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var moreAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.videoMarketplaceNavigate);
+ moreAction.moniker = MS.Entertainment.UI.Monikers.tvMarketplaceFeatured;
+ moreAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.tvMarketplace, hub: MS.Entertainment.UI.Monikers.tvMarketplaceFeatured, args: {selectHub: true}
+ };
+ moreAction.disableWhenOffline = true;
+ moreAction.disableOnServicesDisabled = true;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ moreAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_MORE_FEATURED_TV_BUTTON_VUI_ALM);
+ moreAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_MORE_FEATURED_TV_BUTTON_VUI_PRON);
+ moreAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_MORE_FEATURED_TV_BUTTON_VUI_CONF)
+ }
+ secondaryContentPanel.moreAction = moreAction;
+ return secondaryContentPanel
+ };
+ TvDashboardViewModel.prototype._getActions = function() {
+ if (!this._loadPanelActions)
+ return [];
+ var actionService;
+ var browseAction;
+ var searchAction;
+ actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ browseAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.videoMarketplaceNavigate);
+ browseAction.icon = MS.Entertainment.UI.Icon.store;
+ browseAction.moniker = MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases;
+ browseAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.tvMarketplace, hub: MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases, args: {selectHub: true}
+ };
+ browseAction.disableWhenOffline = true;
+ browseAction.disableOnServicesDisabled = true;
+ browseAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardVideoBrowseMovieMarketplace;
+ browseAction.title = String.load(String.id.IDS_VIDEO2_L1_BROWSE_TV_BUTTON_VUI_GUI);
+ browseAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_BROWSE_TV_BUTTON_VUI_ALM);
+ browseAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_BROWSE_TV_BUTTON_VUI_PRON);
+ browseAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_BROWSE_TV_BUTTON_VUI_CONF);
+ searchAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.search);
+ searchAction.icon = WinJS.UI.AppBarIcon.find;
+ searchAction.automationId = MS.Entertainment.UI.AutomationIds.dashboardFeaturedSearch;
+ searchAction.defaultModifierIndex = MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.tvShows;
+ searchAction.title = String.load(String.id.IDS_VIDEO2_L1_SEARCH_TV_BUTTON_VUI_GUI);
+ searchAction.voicePhrase = String.load(String.id.IDS_VIDEO2_L1_SEARCH_TV_BUTTON_VUI_ALM);
+ searchAction.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L1_SEARCH_TV_BUTTON_VUI_PRON);
+ searchAction.voiceConfidence = String.load(String.id.IDS_VIDEO2_L1_SEARCH_TV_BUTTON_VUI_CONF);
+ return [browseAction, searchAction]
+ };
+ TvDashboardViewModel.prototype.dispose = function() {
+ MS.Entertainment.UI.Video.TvDashboardViewModel._sharedInstance = null
+ };
+ return TvDashboardViewModel
+ })(Video.VideoHubDashboardViewModel);
+ Video.TvDashboardViewModel = TvDashboardViewModel
+ })(UI.Video || (UI.Video = {}));
+ var Video = UI.Video
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Video/TvSeriesHeaderControl.html b/packages/microsoft.zunevideo/Components/Video/TvSeriesHeaderControl.html
new file mode 100644
index 00000000..4c5ea3bc
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/TvSeriesHeaderControl.html
@@ -0,0 +1,37 @@
+
+
+
+
+ TV Series Header Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video/TvSeriesHeaderControl.js b/packages/microsoft.zunevideo/Components/Video/TvSeriesHeaderControl.js
new file mode 100644
index 00000000..da0474ba
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/TvSeriesHeaderControl.js
@@ -0,0 +1,37 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {TvSeriesHeaderControl: MS.Entertainment.UI.Framework.defineUserControl("/Components/Video/TvSeriesHeaderControl.html#tvSeriesHeaderControlTemplate", function episodeControlConstructor(element, options) {
+ this.series = {}
+ }, {
+ initialize: function initialize() {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var seriesMediaItem = new MS.Entertainment.Data.Augmenter.Library.TVSeries;
+ setProperty(seriesMediaItem, "id", this.series.seriesId);
+ setProperty(seriesMediaItem, "serviceId", this.series.seriesId);
+ setProperty(seriesMediaItem, "serviceIdType", MS.Entertainment.Data.Query.edsIdType.canonical);
+ setProperty(seriesMediaItem, "libraryId", this.series.seriesLibraryId);
+ setProperty(seriesMediaItem, "imageUri", this.series.seriesImageUri);
+ setProperty(seriesMediaItem, "title", this.series.seriesTitle);
+ setProperty(seriesMediaItem, "name", this.series.seriesTitle);
+ this.seriesMediaItem = MS.Entertainment.ViewModels.MediaItemModel.augment(seriesMediaItem)
+ }, onClick: function onClick() {
+ if (this.seriesMediaItem.hydrate) {
+ var hydrateOptions = {listenForDBUpdates: true};
+ this.seriesMediaItem.hydrate(hydrateOptions).then(function showDetailsSuccess() {
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(this.seriesMediaItem)
+ }.bind(this), function showDetailsError() {
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(this.seriesMediaItem)
+ }.bind(this))
+ }
+ }, onKeyDown: function onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space) {
+ this.onClick();
+ event.stopPropagation()
+ }
+ }
+ }, {
+ seriesMediaItem: null, stringId: String.id.IDS_DETAILS_VIEW_FULL_SERIES, text: null, series: null
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoCloudCollectionService.js b/packages/microsoft.zunevideo/Components/Video/VideoCloudCollectionService.js
new file mode 100644
index 00000000..973e5c3f
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoCloudCollectionService.js
@@ -0,0 +1,40 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Video) {
+ var VideoCloudCollectionService = (function(_super) {
+ __extends(VideoCloudCollectionService, _super);
+ function VideoCloudCollectionService() {
+ _super.call(this)
+ }
+ VideoCloudCollectionService.prototype.startSync = function() {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ var hasGrovelEverCompleted = !!(purchaseHistoryService && purchaseHistoryService.hasGrovelEverCompleted);
+ var syncManager = new Microsoft.Entertainment.Sync.SyncManager;
+ if (syncManager && hasGrovelEverCompleted)
+ syncManager.requestSync(Microsoft.Entertainment.Sync.RequestSyncOption.checkIfDirty)
+ };
+ return VideoCloudCollectionService
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Video.VideoCloudCollectionService = VideoCloudCollectionService
+ })(Entertainment.Video || (Entertainment.Video = {}));
+ var Video = Entertainment.Video
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+(function() {
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.videoCloudCollection, function getService() {
+ return new MS.Entertainment.Video.VideoCloudCollectionService
+ }, true)
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoCollection.html b/packages/microsoft.zunevideo/Components/Video/VideoCollection.html
new file mode 100644
index 00000000..b801e3a8
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoCollection.html
@@ -0,0 +1,34 @@
+
+
+
+
+ Video Collection Page Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoCollection.js b/packages/microsoft.zunevideo/Components/Video/VideoCollection.js
new file mode 100644
index 00000000..b44622c8
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoCollection.js
@@ -0,0 +1,291 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/corefx.js", "/Framework/utilities.js", "/Framework/servicelocator.js", "/Framework/Data/queries/libraryqueries.js", "/ViewModels/Video/VideoCollectionViewModel.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Pages", {
+ VideoCollection: MS.Entertainment.UI.Framework.defineUserControl("/Components/Video/VideoCollection.html#videoCollectionTemplate", function videoCollectionConstructor(element, options) {
+ if (this.view === MS.Entertainment.ViewModels.VideoCollection.ViewTypes.other)
+ this.templateSelectorConstructor = MS.Entertainment.Pages.VideoCollectionTemplateSelector
+ }, {
+ _viewModel: null, _galleryView: null, _initializePageCallback: null, _primaryModifierSelectionChangedCallback: null, _viewModelDataChangedCallback: null, _episodeClickedHandler: null, _folderClickedHandler: null, _currentClickHandler: null, _selectedEpisode: null, view: null, galleryClass: null, templateSelectorConstructor: MS.Entertainment.UI.Controls.GalleryTemplateSelector, _viewModelEvents: null, initialize: function initialize() {
+ var onGalleryFirstRendered = function galleryFirstPageRender() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchToCollection();
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioCollectionGalleryRequestToLoad();
+ if (this.domElement)
+ this.domElement.removeEventListener("galleryFirstPageRendered", onGalleryFirstRendered)
+ }.bind(this);
+ this.domElement.addEventListener("galleryFirstPageRendered", onGalleryFirstRendered);
+ this._initializePageCallback = this._initializePage.bind(this);
+ this._primaryModifierSelectionChangedCallback = this._primaryModifierSelectionChanged.bind(this);
+ this._viewModelDataChangedCallback = this._viewModelDataChanged.bind(this);
+ this._episodeClickedHandler = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._episodeClicked, this);
+ this._folderClickedHandler = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._folderClicked, this);
+ this.bind("dataContext", this._initializePageCallback);
+ var clearSelection = this._clearSelection.bind(this);
+ var removeItem = this._removeItemCompleted.bind(this);
+ var handlers = {
+ deleteMedia: removeItem, deleteSeries: removeItem, play: clearSelection, playFreeOffer: clearSelection, playOnXbox360: clearSelection, tryDownloadAgain: clearSelection, removeFailedVideo: clearSelection, movieDetails: clearSelection, playTrailer: clearSelection, restartVideo: clearSelection, resumeVideo: clearSelection, playDisabled: clearSelection, buyEpisode: clearSelection, buyVideo: clearSelection, rentVideo: clearSelection, seriesDetails: clearSelection, downloadFromMarketplace: clearSelection, downloadSeason: clearSelection, getOnXbox: clearSelection
+ };
+ this._galleryView.addSelectionHandlers(handlers)
+ }, unload: function unload() {
+ this.unbind("dataContext", this._initializePageCallback);
+ if (this._viewModelEvents) {
+ this._viewModelEvents.cancel();
+ this._viewModelEvents = null
+ }
+ if (this._viewModel)
+ this._viewModel.dispose();
+ this._setClickHandler(null);
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ if (this._selectedEpisode) {
+ var control = this._selectedEpisode.querySelector("[data-win-control]").winControl;
+ control.domElement.removeEventListener("click", control.panelClickHandler, false)
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._selectedEpisode) {
+ var control = this._selectedEpisode.querySelector("[data-win-control]").winControl;
+ control.expand(this._selectedEpisode);
+ control.panelClickHandler = this._inPlacePanelClick.bind(this);
+ control.domElement.addEventListener("click", control.panelClickHandler, false)
+ }
+ }, _removeItemCompleted: function _removeItemCompleted(eventArgs) {
+ var removed = eventArgs.detail && eventArgs.detail.deleted;
+ if (removed)
+ this._clearSelection()
+ }, _clearSelection: function _clearSelection() {
+ this._galleryView.clearSelection()
+ }, _initializePage: function initializePage() {
+ if (!this.dataContext || this._unloaded)
+ return;
+ this._viewModel = this.dataContext.viewModel;
+ this.view = this._viewModel.view;
+ this._viewModel.items = null;
+ this._initializeModifiers();
+ this._initializeGalleryView();
+ this._viewModelEvents = MS.Entertainment.Utilities.addEventHandlers(this._viewModel, {itemsChanged: this._viewModelDataChangedCallback});
+ this._viewModel.beginQuery()
+ }, _setClickHandler: function setClickHandler(handler) {
+ if (this._currentClickHandler)
+ this._galleryView.domElement.removeEventListener("iteminvoked", this._currentClickHandler);
+ this._currentClickHandler = handler;
+ if (this._currentClickHandler)
+ this._galleryView.domElement.addEventListener("iteminvoked", this._currentClickHandler, false)
+ }, _initializeGalleryView: function initializeGalleryView() {
+ if (this.galleryClass)
+ WinJS.Utilities.addClass(this._galleryView.domElement, this.galleryClass);
+ this._galleryView.queryToPause = null;
+ this._galleryView.dataSource = null;
+ this._galleryView.mediaType = this.view;
+ this._galleryView.emptyGalleryModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ this._galleryView.emptyGalleryModel.isVisible = false;
+ this._galleryView.emptyGalleryModel.primaryStringId = String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY;
+ if (MS.Entertainment.Utilities.isApp2)
+ this._galleryView.emptyGalleryModel.secondaryStringId = String.id.IDS_VIDEO_COLLECTION_EMPTY
+ }, _initializeModifiers: function initializeModifiers() {
+ var that = this;
+ var sorts = MS.Entertainment.ViewModels.VideoCollection.Sorts[this._viewModel.view]();
+ var values = [];
+ for (var x = 0; x < sorts.values.length; x++) {
+ var node = sorts[sorts.values[x]];
+ var value = {
+ label: node.title, value: node.value, type: "sort"
+ };
+ values.push(value)
+ }
+ this._bindings = WinJS.Binding.bind(this, {_viewModel: {modifierSelectionManager: {selectedItem: this._primaryModifierSelectionChangedCallback.bind(this)}}});
+ this._viewModel.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(values, 0, this._viewModel.settingsKey)
+ }, _primaryModifierSelectionChanged: function primaryModifierSelectionChanged(newValue) {
+ if (newValue)
+ this._updateViewModel(newValue)
+ }, _updateViewModel: function updateViewModel(item) {
+ switch (item.type) {
+ case"sort":
+ if (this._viewModel.sort !== item.value) {
+ this._viewModel.sort = item.value;
+ this._viewModel.beginQuery()
+ }
+ break
+ }
+ }, _viewModelDataChanged: function viewModelDataChanged() {
+ if (!this._viewModel.items || !this._viewModel.isCurrentQuery() || !this._viewModel.view || !this._viewModel.sort)
+ return;
+ var node = MS.Entertainment.ViewModels.VideoCollection.Templates[this._viewModel.view][this._viewModel.sort];
+ this._galleryView.headerTemplate = node.headerTemplate || null;
+ if (node.panelTemplate) {
+ this._galleryView.panelTemplate = node.panelTemplate ? node.panelTemplate : null;
+ this._galleryView.panelOptions = node.panelOptions ? node.panelOptions : null
+ }
+ else {
+ this._galleryView.panelTemplate = null;
+ this._galleryView.panelOptions = null
+ }
+ this._galleryView.emptyGalleryModel.isVisible = this._viewModel.items.count === 0;
+ this._galleryView.itemSize = node.itemSize || null;
+ this._galleryView.slotSize = node.slotSize || null;
+ this._galleryView.maxRows = node.maxRows || -1;
+ this._galleryView.multiSize = node.multiSize || false;
+ this._galleryView.panelTemplateTypeMappings = [{
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.tvEpisode, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }],
+ this._galleryView.itemTemplate = node.template;
+ this._galleryView.itemClass = node.itemClass || null;
+ this._galleryView.headerClass = node.headerClass || null;
+ this._galleryView.tap = node.tap || MS.Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly;
+ this._galleryView.backdropColor = node.backdropColor || MS.Entertainment.ViewModels.VideoGalleryColors.backdropColor;
+ this._galleryView.invokeBehavior = node.invokeBehavior || MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.popOver;
+ this._galleryView.actionTemplate = node.actionTemplateUrl || null;
+ switch (this._viewModel.view) {
+ case MS.Entertainment.ViewModels.VideoCollection.ViewTypes.all:
+ case MS.Entertainment.ViewModels.VideoCollection.ViewTypes.other:
+ this._galleryView.emptyGalleryModel.details = this._getEmptyCollectionDetails();
+ break;
+ case MS.Entertainment.ViewModels.VideoCollection.ViewTypes.movies:
+ this._galleryView.emptyGalleryModel.details = this._getEmptyCollectionMoviesDetails();
+ break;
+ case MS.Entertainment.ViewModels.VideoCollection.ViewTypes.tv:
+ this._galleryView.emptyGalleryModel.details = this._getEmptyCollectionTVDetails();
+ break
+ }
+ if (node.groupHeaderPosition)
+ this._galleryView.headerPosition = node.groupHeaderPosition;
+ if (node.grouped) {
+ this._galleryView.grouperType = node.grouperType;
+ this._galleryView.grouper.keyPropertyName = node.grouperField;
+ if ("grouperKeyAsData" in node)
+ this._galleryView.grouper.useKeyAsData = node.grouperKeyAsData
+ }
+ else
+ this._galleryView.grouperType = null;
+ if (node.galleryClass) {
+ if (this.galleryClass)
+ WinJS.Utilities.removeClass(this._galleryView.domElement, this.galleryClass);
+ WinJS.Utilities.addClass(this._galleryView.domElement, node.galleryClass);
+ this.galleryClass = node.galleryClass
+ }
+ if (this._viewModel.view === MS.Entertainment.ViewModels.VideoCollection.ViewTypes.other)
+ this._setClickHandler(this._folderClickedHandler);
+ else
+ this._setClickHandler(null);
+ this._galleryView.queryToPause = this._viewModel.getQuery();
+ this._galleryView.dataSource = this._viewModel.items;
+ this._selectedEpisode = null;
+ this._inPlacePanelAnimating = false
+ }, _getEmptyCollectionDetails: function _getEmptyCollectionDetails() {
+ var details = null;
+ if (MS.Entertainment.Utilities.isApp1) {
+ var isStorageLibrarySupported = WinJS.Utilities.getMember("Windows.Storage.StorageLibrary") ? true : false;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var openFileAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.openFile);
+ var onManageFoldersAction = isStorageLibrarySupported ? actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.manageFolders) : null;
+ var onMoreAboutLibrariesAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ onMoreAboutLibrariesAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppMoreAboutLibraries;
+ onMoreAboutLibrariesAction.parameter = {
+ uri: MS.Entertainment.UI.FWLink.videoLibraries, appendSource: false
+ };
+ details = [{
+ stringId: String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2, linkStringId: isStorageLibrarySupported ? String.id.IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK : String.id.IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK, linkAction: isStorageLibrarySupported ? onManageFoldersAction : onMoreAboutLibrariesAction, linkIcon: WinJS.UI.AppBarIcon.find
+ }, {
+ stringId: String.id.IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE, linkStringId: String.id.IDS_COLLECTION_OPEN_FILES_LINK, linkAction: openFileAction, linkIcon: WinJS.UI.AppBarIcon.folder
+ }]
+ }
+ return details
+ }, _getEmptyCollectionMoviesDetails: function _getEmptyCollectionMoviesDetails() {
+ var details = null;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isApp1 && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace)) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var navigateToMovieMarketplace = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateToMovieMarketplace.parameter = MS.Entertainment.UI.Monikers.movieMarketplace;
+ details = [{
+ linkStringId: String.id.IDS_COLLECTION_MOVIE_EMPTY_LINK, linkAction: navigateToMovieMarketplace, linkIcon: MS.Entertainment.UI.Icon.store
+ }]
+ }
+ return details
+ }, _getEmptyCollectionTVDetails: function _getEmptyCollectionTVDetails() {
+ var details = null;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isApp1 && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var navigateToTVMarketplace = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateToTVMarketplace.parameter = MS.Entertainment.UI.Monikers.tvMarketplace;
+ details = [{
+ linkStringId: String.id.IDS_COLLECTION_TV_EMPTY, linkAction: navigateToTVMarketplace, linkIcon: MS.Entertainment.UI.Icon.store
+ }]
+ }
+ return details
+ }, _folderClicked: function folderClicked(event) {
+ var item = this._galleryView.getDataObjectAtIndex(event.detail.itemIndex);
+ var folder = (item && item._value && item._value.folderId >= 0) ? item._value : null;
+ if (folder && folder.folderId >= 0 && this._viewModel && this._viewModel.openFolder)
+ this._viewModel.openFolder(folder)
+ }, _episodeClicked: function episodeClicked(event) {
+ if (!this._inPlacePanelAnimating) {
+ var element = this._galleryView.getElementAtIndex(event.detail.itemIndex, true);
+ var item = element.querySelector("[data-win-control]").winControl;
+ this._handlePanelClick(element, item, event.detail.itemIndex)
+ }
+ }, _inPlacePanelClick: function inPlacePanelClick(event) {
+ if (event.srcElement.type !== "button" && !this._inPlacePanelAnimating) {
+ var element = MS.Entertainment.Utilities.findParentElementByClassName(event.srcElement, "win-item");
+ var item = element.querySelector("[data-win-control]").winControl;
+ this._handlePanelClick(element, item)
+ }
+ }, _handlePanelClick: function handlePanelClick(element, item, itemIndex) {
+ var promises = [];
+ this._inPlacePanelAnimating = true;
+ if (element === this._selectedEpisode) {
+ item.domElement.removeEventListener("click", item.panelClickHandler);
+ promises.push(item.collapse(this._selectedEpisode));
+ this._selectedEpisode = null
+ }
+ else {
+ if (this._selectedEpisode) {
+ var control = this._selectedEpisode.querySelector("[data-win-control]");
+ if (control && control.winControl) {
+ var oldItem = control.winControl;
+ oldItem.domElement.removeEventListener("click", oldItem.panelClickHandler);
+ if (oldItem.isSelected)
+ promises.push(oldItem.collapse(this._selectedEpisode))
+ }
+ }
+ this._galleryView.ensureVisible(itemIndex);
+ WinJS.Promise.timeout().then(function() {
+ item.panelClickHandler = this._inPlacePanelClick.bind(this);
+ item.domElement.addEventListener("click", item.panelClickHandler, false)
+ }.bind(this));
+ promises.push(item.expand(element));
+ this._selectedEpisode = element
+ }
+ WinJS.Promise.join(promises).then(function doneAnimating() {
+ this._inPlacePanelAnimating = false
+ }.bind(this))
+ }
+ }, {dataContext: null}, {canInvokeForItemOverride: WinJS.Utilities.markSupportedForProcessing(function canInvokeForItem(item) {
+ return !(item && item.data && item.data.type === Microsoft.Entertainment.Queries.ObjectType.folder)
+ })}), VideoCollectionTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryTemplateSelector", function videoCollectionTemplateSelector(galleryView) {
+ MS.Entertainment.UI.Controls.GalleryTemplateSelector.prototype.constructor.call(this);
+ this._galleryView = galleryView;
+ this.addTemplate(MS.Entertainment.UI.Controls.TemplateSelectorBase.templateType.emptyGallery, "/Controls/GalleryControl.html#listViewEmptyGalleryTemplate");
+ this.addTemplate("folder", "/Components/Video/VideoCollectionTemplates.html#personalFolderTile");
+ this.addTemplate("otherVideo", "/Components/Video/VideoStartupTemplates.html#personalFileTile")
+ }, {onSelectTemplate: function onSelectTemplate(item) {
+ var template = null;
+ if (item && item.data) {
+ var data = item.data || {};
+ if (data.type === Microsoft.Entertainment.Queries.ObjectType.folder)
+ template = "folder";
+ else
+ template = "otherVideo"
+ }
+ this.ensureTemplatesLoaded([template]);
+ return this.getTemplateProvider(template)
+ }})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoCollectionPanels.html b/packages/microsoft.zunevideo/Components/Video/VideoCollectionPanels.html
new file mode 100644
index 00000000..841fd532
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoCollectionPanels.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+ Video Panels
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoCollectionTemplates.html b/packages/microsoft.zunevideo/Components/Video/VideoCollectionTemplates.html
new file mode 100644
index 00000000..b14ad8ec
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoCollectionTemplates.html
@@ -0,0 +1,163 @@
+
+
+
+
+ Video Collection Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoDashboardViewModel.js b/packages/microsoft.zunevideo/Components/Video/VideoDashboardViewModel.js
new file mode 100644
index 00000000..6014e914
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoDashboardViewModel.js
@@ -0,0 +1,188 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Video) {
+ var VideoDashboardViewModel = (function(_super) {
+ __extends(VideoDashboardViewModel, _super);
+ function VideoDashboardViewModel() {
+ _super.apply(this, arguments)
+ }
+ VideoDashboardViewModel.prototype._refreshData = function() {
+ this.getItems(true)
+ };
+ return VideoDashboardViewModel
+ })(MS.Entertainment.UI.Dashboard.DashboardViewModel);
+ Video.VideoDashboardViewModel = VideoDashboardViewModel;
+ var EditorialDashboardViewModel = (function(_super) {
+ __extends(EditorialDashboardViewModel, _super);
+ function EditorialDashboardViewModel() {
+ _super.apply(this, arguments)
+ }
+ EditorialDashboardViewModel.prototype.canDisplayMediaType = function(item) {
+ var canDisplayMediaType = false;
+ var editorialType = item && item.actionType && item.actionType.mediaType;
+ if (item)
+ canDisplayMediaType = (editorialType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode || editorialType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie || editorialType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series || (editorialType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season && MS.Entertainment.Utilities.isValidServiceId(item.seriesId)) || editorialType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub || editorialType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub || item.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries) && editorialType !== MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer;
+ return canDisplayMediaType
+ };
+ EditorialDashboardViewModel.prototype.processMediaItemQuery = function(query, maxItems, raiseError) {
+ var _this = this;
+ return query.getItems().then(function gotItems(items) {
+ return items.toArrayAll()
+ }).then(function(listItems) {
+ return WinJS.Promise.as(_this.wrapMediaItems(listItems, maxItems))
+ }, function(error) {
+ if (raiseError)
+ return WinJS.Promise.wrapError(error);
+ return WinJS.Promise.as(_this._fillEmptyResults(maxItems))
+ })
+ };
+ EditorialDashboardViewModel.prototype.wrapMediaItems = function(listItems, maxItems) {
+ var items = [];
+ for (var i = 0; i < listItems.length && items.length < maxItems; i++) {
+ var currentItem = listItems[i];
+ currentItem.index = i;
+ if (this.canDisplayMediaType(currentItem))
+ items.push(this._wrapMediaItem(currentItem))
+ }
+ if (items.length < maxItems)
+ items = items.concat(this._fillEmptyResults(maxItems - items.length));
+ MS.Entertainment.ViewModels.assert(items.length === maxItems, "itemList has the wrong number of items");
+ return items
+ };
+ EditorialDashboardViewModel.prototype._wrapEditorialItem = function(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var query;
+ var promoClicked;
+ var flexHubClicked;
+ var popOverConstructor;
+ var mediaItem = item;
+ var showItemDetails = true;
+ var editorialType = item && item.actionType && item.actionType.mediaType;
+ switch (editorialType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ popOverConstructor = "MS.Entertainment.Pages.MovieInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ popOverConstructor = "MS.Entertainment.Pages.TvSeriesInlineDetailsFullScreen";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub:
+ setProperty(item, "isFlexHub", true);
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.ItemType.Media:
+ break;
+ default:
+ showItemDetails = false;
+ MS.Entertainment.ViewModels.assert(editorialType === undefined, "Unknown type passed into wrapItem: " + editorialType);
+ break
+ }
+ if (editorialType !== MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub && !item.isFlexHub) {
+ var queriedData = mediaItem;
+ promoClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function(e) {
+ var hydrate = mediaItem && mediaItem.hydrate && mediaItem.hydrate();
+ if (queriedData && showItemDetails) {
+ var popOverParameters = {
+ itemConstructor: popOverConstructor, dataContext: {
+ location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace, data: queriedData
+ }
+ };
+ var hydrate = mediaItem && mediaItem.hydrate && mediaItem.hydrate();
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ else if (!this._isOnline) {
+ var offlinePopOverParameters = null;
+ offlinePopOverParameters = {itemConstructor: "MS.Entertainment.UI.Controls.FailedPanel"};
+ return MS.Entertainment.UI.Controls.PopOver.showNonMediaPopOver(offlinePopOverParameters)
+ }
+ }, this);
+ setProperty(item, "doclick", promoClicked)
+ }
+ else {
+ flexHubClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function(e) {
+ if (!this._isOnline) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.flexHubPage, MS.Entertainment.UI.Monikers.flexHub, null, {
+ query: item.target || item.actionTarget, sourceQueryId: item.queryId
+ })
+ }, this);
+ setProperty(item, "doclick", flexHubClicked)
+ }
+ return item
+ };
+ EditorialDashboardViewModel.prototype._fillEmptyResults = function(maxItems) {
+ var emptyItems = [];
+ for (var i = 0; i < maxItems; i++)
+ emptyItems.push(null);
+ return emptyItems
+ };
+ EditorialDashboardViewModel.prototype._wrapMediaItem = function(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var promoClicked;
+ var popOverConstructor;
+ var mediaItem = item;
+ var showItemDetails = true;
+ setProperty(item, "primaryText", item.name);
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(item).then(function setPrimaryImageUrl(url) {
+ setProperty(item, "imagePrimaryUrl", url)
+ }.bind(this));
+ setProperty(item, "imageFallbackUrl", MS.Entertainment.UI.Shell.ImageLoader.getMediaItemDefaultImageUrl(item));
+ switch (item.type) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ popOverConstructor = "MS.Entertainment.Pages.MovieInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ popOverConstructor = "MS.Entertainment.Pages.TvSeriesInlineDetailsFullScreen";
+ break;
+ default:
+ showItemDetails = false;
+ MS.Entertainment.ViewModels.assert(item.type === undefined, "Unknown type passed into wrapItem: " + item.type);
+ break
+ }
+ promoClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function(e) {
+ if (mediaItem && showItemDetails) {
+ var popOverParameters = {
+ itemConstructor: popOverConstructor, dataContext: {
+ location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace, data: mediaItem
+ }
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ else if (!this._isOnline) {
+ var offlinePopOverParameters = null;
+ offlinePopOverParameters = {itemConstructor: "MS.Entertainment.UI.Controls.FailedPanel"};
+ return MS.Entertainment.UI.Controls.PopOver.showNonMediaPopOver(offlinePopOverParameters)
+ }
+ }, this);
+ setProperty(item, "doclick", promoClicked);
+ return item
+ };
+ return EditorialDashboardViewModel
+ })(MS.Entertainment.UI.Video.VideoDashboardViewModel);
+ Video.EditorialDashboardViewModel = EditorialDashboardViewModel
+ })(UI.Video || (UI.Video = {}));
+ var Video = UI.Video
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoFeatures.js b/packages/microsoft.zunevideo/Components/Video/VideoFeatures.js
new file mode 100644
index 00000000..08fba3d0
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoFeatures.js
@@ -0,0 +1,57 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment", {Features: {
+ appFeatures: [Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoSignInAvailable, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace, Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoAllQuerySupported], refreshApp: function refreshApp() {
+ WinJS.Promise.timeout(500).done(function() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var hasMarketplace = true;
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var moviesEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ hasMarketplace = moviesEnabled || tvEnabled;
+ MS.Entertainment.ViewModels.VideoSpotlight.startupVideoSpotlight = null
+ }
+ if (MS.Entertainment.Utilities.isVideoApp2 && WinJS.Utilities.getMember("Microsoft.Entertainment.BackgroundTasks.EpgChannelUpdateTask")) {
+ var epg = new Microsoft.Entertainment.BackgroundTasks.EpgChannelUpdateTask;
+ epg.updateChannelsNow()
+ }
+ if (hasMarketplace) {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ MS.Entertainment.Video.Video2WelcomeDialog.hide();
+ WinJS.Utilities.removeClass(document.documentElement, MS.Entertainment.Utilities.noMarketplaceRootClassName)
+ }
+ else
+ WinJS.Utilities.addClass(document.documentElement, MS.Entertainment.Utilities.noMarketplaceRootClassName);
+ var iaService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ iaService.reset();
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._handleAppRefreshAfterNavigate();
+ if (navigationService.currentPage && !uiStateService.isFullScreenVideo && !uiStateService.isFullScreenMusic && !uiStateService.isSnapped) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateToDefaultPage()
+ }
+ else
+ navigationService.clearBackStackOnNextNavigate(true)
+ }.bind(this))
+ }, _handleAppRefreshAfterNavigate: function _handleAppRefreshAfterNavigate() {
+ if (!MS.Entertainment.Utilities.isVideoApp2)
+ return;
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var eventHandlers = MS.Entertainment.Utilities.addEvents(navigationService, {currentPageChanged: function onCurrentPageChanged() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var moviesEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var hasMarketplace = moviesEnabled || tvEnabled;
+ if (!hasMarketplace)
+ MS.Entertainment.Video.Video2WelcomeDialog.show().done(null, null);
+ if (eventHandlers) {
+ eventHandlers.cancel();
+ eventHandlers = null
+ }
+ }.bind(this)})
+ }
+ }})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoFullScreenNowPlaying.html b/packages/microsoft.zunevideo/Components/Video/VideoFullScreenNowPlaying.html
new file mode 100644
index 00000000..0bd1b12b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoFullScreenNowPlaying.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+ Full screen Now Playing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoFullScreenNowPlaying.js b/packages/microsoft.zunevideo/Components/Video/VideoFullScreenNowPlaying.js
new file mode 100644
index 00000000..f46b2eef
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoFullScreenNowPlaying.js
@@ -0,0 +1,276 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Video");
+var Playback = MS.Entertainment.Platform.Playback;
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Video) {
+ var VideoFullScreenNowPlaying = (function(_super) {
+ __extends(VideoFullScreenNowPlaying, _super);
+ function VideoFullScreenNowPlaying(element, options) {
+ var _this = this;
+ _super.call(this, element, options);
+ this.controlName = "VideoFullScreenNowPlaying";
+ this.frozen = false;
+ this._delayInitialize = true;
+ this._dontReclaimNowPlaying = false;
+ this._showSpinner = false;
+ var container = element.querySelector("[data-ent-member='_container']");
+ WinJS.UI.processAll(container).done(function() {
+ WinJS.Binding.processAll(container, _this)
+ })
+ }
+ VideoFullScreenNowPlaying.prototype.initialize = function() {
+ this._bindingsNowPlaying = WinJS.Binding.bind(this, {sessionManager: {nowPlayingSession: {currentTransportState: this._currentTransportStateChanged.bind(this)}}});
+ this._uiStateBindings = WinJS.Binding.bind(this.uiStateService, {isSnapped: this._onSnappedChanged.bind(this)});
+ this._onAppSuspending = this._onAppSuspending.bind(this);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", this._onAppSuspending);
+ document.addEventListener("NowPlaying_ShowDetails", this._handleNowPlayingShowDetails.bind(this));
+ this._patchNavigateAway()
+ };
+ VideoFullScreenNowPlaying.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._bindingsNowPlaying) {
+ this._bindingsNowPlaying.cancel();
+ this._bindingsNowPlaying = null
+ }
+ if (this._uiStateBindings) {
+ this._uiStateBindings.cancel();
+ this._uiStateBindings = null
+ }
+ if (this.currentPage) {
+ this.currentPage.onNavigatingAway = null;
+ this.currentPage.onNavigateAway = null
+ }
+ Windows.UI.WebUI.WebUIApplication.removeEventListener("suspending", this._onAppSuspending);
+ var nowPlayingSession = this.sessionManager && this.sessionManager.nowPlayingSession;
+ if (nowPlayingSession)
+ nowPlayingSession.targetTransportState = Playback.TransportState.stopped;
+ this.nowPlayingManager.releaseNowPlayingControl(Playback.WellKnownPlaybackSessionId.nowPlaying);
+ if (this._uiStateService) {
+ this.uiStateService.nowPlayingVisible = false;
+ this.uiStateService.isFullScreenVideo = false
+ }
+ };
+ VideoFullScreenNowPlaying.prototype.freeze = function() {
+ _super.prototype.freeze.call(this);
+ this._delayedInitialization();
+ if (this._nowPlayingManager)
+ this.nowPlayingManager.releaseNowPlayingControl(Playback.WellKnownPlaybackSessionId.nowPlaying);
+ this.uiStateService.nowPlayingVisible = false;
+ this.uiStateService.isFullScreenVideo = false;
+ this.frozen = true
+ };
+ VideoFullScreenNowPlaying.prototype.thaw = function() {
+ _super.prototype.thaw.call(this);
+ if (!this._dontReclaimNowPlaying) {
+ this._delayedInitialization();
+ this._reclaimNowPlayingControl()
+ }
+ this.frozen = false
+ };
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "navigationService", {
+ get: function() {
+ if (!this._navigationService)
+ this._navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ return this._navigationService
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "currentPage", {
+ get: function() {
+ if (!this._currentPage) {
+ var currentPage = WinJS.Binding.unwrap(this.navigationService.currentPage);
+ if (currentPage && currentPage.iaNode && currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.fullScreenNowPlaying)
+ this._currentPage = currentPage
+ }
+ return this._currentPage
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "uiStateService", {
+ get: function() {
+ if (!this._uiStateService)
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ return this._uiStateService
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "sessionManager", {
+ get: function() {
+ if (!this._sessionManager)
+ this._sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ return this._sessionManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "nowPlayingManager", {
+ get: function() {
+ if (!this._nowPlayingManager)
+ this._nowPlayingManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager);
+ return this._nowPlayingManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "applicationStateManager", {
+ get: function() {
+ if (!this._applicationStateManager && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.applicationStateManager))
+ this._applicationStateManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.applicationStateManager);
+ return this._applicationStateManager
+ }, enumerable: true, configurable: true
+ });
+ VideoFullScreenNowPlaying.prototype.onNavigateTo = function(){};
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "showSpinner", {
+ get: function() {
+ return this._showSpinner
+ }, set: function(value) {
+ this.updateAndNotify("showSpinner", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoFullScreenNowPlaying.prototype, "isPreviousPageDetailsPage", {
+ get: function() {
+ var isDetailsPage = false;
+ var previousLocation = this.navigationService.getPreviousLocation();
+ if (previousLocation && previousLocation.page && previousLocation.page.iaNode && previousLocation.page.iaNode.moniker) {
+ var moniker = previousLocation.page.iaNode.moniker;
+ isDetailsPage = (moniker === MS.Entertainment.UI.Monikers.immersiveDetails || moniker === MS.Entertainment.UI.Monikers.navigationPopover || moniker === MS.Entertainment.UI.Monikers.movieDetailsPage || moniker === MS.Entertainment.UI.Monikers.tvDetailsPage)
+ }
+ return isDetailsPage
+ }, enumerable: true, configurable: true
+ });
+ VideoFullScreenNowPlaying.prototype._onAppSuspending = function() {
+ this.sessionManager.clearCachedPBMState();
+ var playbackSession = this.sessionManager.primarySession;
+ if (playbackSession && playbackSession.currentMedia && this.mediaItem && !this.mediaItem.playPreviewOnly) {
+ var currentMediaFilePath = WinJS.Utilities.getMember("currentMedia.fileItem.path", playbackSession) || WinJS.Utilities.getMember("currentMedia.filePath", playbackSession);
+ var currentMediaServiceId = WinJS.Utilities.getMember("currentMedia.serviceId", playbackSession);
+ if (MS.Entertainment.Utilities.isEmptyGuid(currentMediaServiceId))
+ VideoFullScreenNowPlaying.pendingAutoResumeFilePath = currentMediaFilePath || String.empty
+ }
+ this.navigationService.navigateBack();
+ this._dontReclaimNowPlaying = true
+ };
+ VideoFullScreenNowPlaying.prototype._navigateToDetails = function() {
+ this._delayedInitialization();
+ if (!this.mediaItem || !this.mediaItem.hasServiceId)
+ return;
+ if (Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.winJSNavigation) || this.isPreviousPageDetailsPage)
+ this.navigationService.navigateBack();
+ else {
+ this.navigationService.clearBackStackOnNextNavigate(true);
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({dataContext: {data: this.mediaItem}}, {forceDetails: true})
+ }
+ };
+ VideoFullScreenNowPlaying.prototype._delayedInitialization = function() {
+ if (!this._delayInitialize || this._unloaded || !this.currentPage || !this.currentPage.options || !this.currentPage.options.mediaItem)
+ return;
+ this._delayInitialize = false;
+ this.mediaItem = this.currentPage.options.mediaItem;
+ this.uiStateService.nowPlayingInset = false;
+ this.uiStateService.nowPlayingTileVisible = false;
+ if (this.applicationStateManager && this.mediaItem.hasServiceId)
+ this.applicationStateManager.savePlaybackState(this.mediaItem, {hasBackStack: true});
+ WinJS.Promise.timeout().then(this._reclaimNowPlayingControl.bind(this))
+ };
+ VideoFullScreenNowPlaying.prototype._setShowSpinnerState = function(currentTransportState) {
+ this.showSpinner = currentTransportState === Playback.TransportState.starting
+ };
+ VideoFullScreenNowPlaying.prototype._currentTransportStateChanged = function(value, oldValue) {
+ if (!value || this.frozen || this._unloaded)
+ return;
+ if (value !== Playback.TransportState.starting)
+ this._delayedInitialization();
+ this._setShowSpinnerState(value);
+ var isPlayToSessionRunning = (this.sessionManager && this.sessionManager.nowPlayingSession && this.sessionManager.nowPlayingSession.isPlayToReceiverSessionRunning);
+ if (value === Playback.TransportState.stopped && oldValue && !isPlayToSessionRunning && !this.uiStateService.isSnapped)
+ this._navigateToDetails()
+ };
+ VideoFullScreenNowPlaying.prototype._onSnappedChanged = function(val, oldVal) {
+ if (oldVal === undefined)
+ return;
+ if (!val && oldVal && this.sessionManager.nowPlayingSession.currentTransportState === Playback.TransportState.stopped)
+ this._navigateToDetails()
+ };
+ VideoFullScreenNowPlaying.prototype._handleNowPlayingShowDetails = function() {
+ if (this.frozen || this._unloaded)
+ return;
+ this._navigateToDetails()
+ };
+ VideoFullScreenNowPlaying.prototype._reclaimNowPlayingControl = function() {
+ var _this = this;
+ if (this._reclaimPromise)
+ return;
+ this.uiStateService.nowPlayingVisible = true;
+ this.uiStateService.isFullScreenVideo = true;
+ this._nowPlayingControl = this.nowPlayingManager.getNowPlayingControl(Playback.WellKnownPlaybackSessionId.nowPlaying);
+ this._reclaimPromise = MS.Entertainment.UI.Framework.waitForControlToInitialize(this._nowPlayingControl.domElement).then(function() {
+ var playbackSession = _this.sessionManager.nowPlayingSession;
+ _this._nowPlayingControl.playbackSession = playbackSession;
+ _this._nowPlayingControl.repossessNowPlaying();
+ if (_this._nowPlayingHostContainer) {
+ MS.Entertainment.Utilities.empty(_this._nowPlayingHostContainer);
+ _this._nowPlayingHostContainer.appendChild(_this._nowPlayingControl.domElement)
+ }
+ });
+ this._reclaimPromise.done(function() {
+ _this._reclaimPromise = null
+ })
+ };
+ VideoFullScreenNowPlaying.prototype._patchNavigateAway = function() {
+ var currentPage = this.currentPage;
+ currentPage.onNavigatingAway = function onVideoFullScreenNavigatingAway() {
+ var cancelNavigation = this._handleNavigateBack();
+ return cancelNavigation
+ }.bind(this);
+ var oldNavigateAway = currentPage.onNavigateAway || function(){};
+ currentPage.onNavigateAway = function onVideoFullScreenNavigateAway() {
+ this._delayedInitialization();
+ var cancelNavigation = false;
+ var playbackSession = this.sessionManager.getSession(Playback.WellKnownPlaybackSessionId.nowPlaying);
+ if (this.navigationService.navigationDirection === MS.Entertainment.Navigation.NavigationDirection.backward)
+ cancelNavigation = this._handleNavigateBack();
+ if (!cancelNavigation) {
+ if (playbackSession.currentMedia && this.mediaItem && !this.mediaItem.playPreviewOnly)
+ playbackSession.setLastPlayedMedia(playbackSession.currentMedia);
+ this._removeMediaFromPlaybackSession()
+ }
+ oldNavigateAway();
+ return cancelNavigation
+ }.bind(this)
+ };
+ VideoFullScreenNowPlaying.prototype._handleNavigateBack = function() {
+ var _this = this;
+ var cancelNavigation = false;
+ var isPlayToSessionRunning = (this.sessionManager && this.sessionManager.nowPlayingSession && this.sessionManager.nowPlayingSession.isPlayToReceiverSessionRunning);
+ if (MS.Entertainment.Utilities.isVideoApp2 && this.mediaItem && !isPlayToSessionRunning)
+ if (!this.isPreviousPageDetailsPage && this.mediaItem.hasServiceId) {
+ this.navigationService.clearBackStackOnNextNavigate(true);
+ WinJS.Promise.timeout(1).done(function() {
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({dataContext: {data: _this.mediaItem}}, {forceDetails: true})
+ });
+ cancelNavigation = true
+ }
+ return cancelNavigation
+ };
+ VideoFullScreenNowPlaying.prototype._removeMediaFromPlaybackSession = function() {
+ var playbackSession = this.sessionManager.getSession(Playback.WellKnownPlaybackSessionId.nowPlaying);
+ playbackSession.clear()
+ };
+ VideoFullScreenNowPlaying.pendingAutoResumeFilePath = String.empty;
+ return VideoFullScreenNowPlaying
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Video.VideoFullScreenNowPlaying = VideoFullScreenNowPlaying
+ })(Entertainment.Video || (Entertainment.Video = {}));
+ var Video = Entertainment.Video
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoIA.js b/packages/microsoft.zunevideo/Components/Video/VideoIA.js
new file mode 100644
index 00000000..1602edb1
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoIA.js
@@ -0,0 +1,293 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/Data/queries/libraryQueries.js", "/Framework/iaservice.js", "/Framework/serviceLocator.js", "/Framework/utilities.js", "/Monikers.js", "/ViewModels/Video/VideoSpotlight.js");
+ var createVideoIA = function createVideoIA(iaService) {
+ var hiddenPanel = {panel: MS.Entertainment.InformationArchitecture.Viewability.hidden};
+ var hiddenHub = {hub: MS.Entertainment.InformationArchitecture.Viewability.hidden};
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var moviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var marketplaceEnabled = (moviesMarketplaceEnabled || tvMarketplaceEnabled);
+ var lastNightOnTvEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvLastNightQuery);
+ var demoMode = config.shell.retailExperience;
+ var customerRatingSortEnabled = config.video.customerRatingSort;
+ var galleryPageTemplate = "/Controls/ModifierGalleryPage.html";
+ var templateVideoHubSpotlightPanel = "/Components/Video/VideoSpotlightView1.html#videoHubSpotlightPanelTemplate";
+ var templateMovieHubCollectionPanel = "/Components/Video/VideoSpotlightView1.html#movieHubCollectionPanelTemplate";
+ var templateTvHubCollectionPanel = "/Components/Video/VideoSpotlightView1.html#tvHubCollectionPanelTemplate";
+ var templateVideoHubCollectionPanel = "/Components/Video/VideoSpotlightView1.html#videoHubCollectionPanelTemplate";
+ var templateVideoHubNewMoviesPanel = "/Components/Video/VideoSpotlightView1.html#videoHubNewMoviesPanelTemplate";
+ var templateVideoHubFeaturedMoviesPanel = "/Components/Video/VideoSpotlightView1.html#videoHubFeaturedMoviesPanelTemplate";
+ var templateVideoHubNewTvPanel = "/Components/Video/VideoSpotlightView1.html#videoHubNewTvPanelTemplate";
+ var templateVideoHubFeaturedTvPanel = "/Components/Video/VideoSpotlightView1.html#videoHubFeaturedTvPanelTemplate";
+ var movieMarketplaceHubFragmentUrl = "/Components/Video/VideoPanels.html#movieMarketplaceTemplate";
+ var tvMarketplaceHubFragmentUrl = "/Components/Video/VideoPanels.html#tvMarketplaceTemplate";
+ var videoSearchHubFragmentTemplate = "/Components/Video/VideoPanels.html#videoSearchTemplate";
+ var videoMarketplaceFlexHubFragmentUrl = "/Components/Video/VideoPanels.html#flexHubMarketplaceTemplate";
+ var videoMarketplaceFeaturedSetsFragmentUrl = "/Components/Video/VideoPanels.html#featuredSetsMarketplaceTemplate";
+ function createVideoMarketplaceDataContext(view, hub) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.VideoMarketplace(view, hub), doNotRaisePanelReady: false
+ }
+ }
+ {};
+ function createVideoCollectionDataContext(view, hub) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.VideoCollection(view, hub), view: view, doNotRaisePanelReady: false
+ }
+ }
+ {};
+ function createVideoSearchDataContext(viewType) {
+ return {
+ viewModel: new MS.Entertainment.ViewModels.VideoSearchViewModel(viewType, moviesMarketplaceEnabled, tvMarketplaceEnabled), noMarketplace: !marketplaceEnabled, minModifierItems: 0, doNotRaisePanelReady: false, hideLoadingPanel: false, hideShadow: false
+ }
+ }
+ {};
+ var videoSearch = iaService.createNode(String.load(String.id.IDS_SEARCH_SEARCHSTARTED), MS.Entertainment.UI.Monikers.searchPage);
+ videoSearch.useStaticHubStrip = true;
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(videoSearch, galleryPageTemplate);
+ var videoAllSearch = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.allVideoSearch, null, hiddenPanel);
+ videoAllSearch.useStaticHubStrip = true;
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(videoAllSearch, videoSearchHubFragmentTemplate);
+ videoAllSearch.getDataContext = function getVideoAllSearchDataContext() {
+ var viewType = marketplaceEnabled ? MS.Entertainment.ViewModels.VideoSearchViewModel.ViewTypes.allVideo : MS.Entertainment.ViewModels.VideoSearchViewModel.ViewTypes.noMarketplace;
+ var dataContext = createVideoSearchDataContext(viewType);
+ return dataContext
+ };
+ videoAllSearch.addChild(iaService.createNode(String.load(String.id.IDS_SEARCH_SEARCHSTARTED), MS.Entertainment.UI.Monikers.allVideoSearchPanel, "/Components/Video/VideoPanels.html#videoSearchTemplate", hiddenHub, null));
+ videoSearch.addChild(videoAllSearch);
+ var videoCollection = iaService.createNode(String.load(String.id.IDS_VIDEO_COLLECTION_PIVOT), MS.Entertainment.UI.Monikers.videoCollection);
+ videoCollection.perfTrackStartPoint = MS.Entertainment.Instrumentation.PerfTrack.StartPoints.CollectionGalleryRequest;
+ videoCollection.useStaticHubStrip = true;
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(videoCollection, galleryPageTemplate);
+ var addedLxEmptyPage = false;
+ if (window.onNewVideoPage && !config.video.videoLXDefaultToClassic) {
+ var emptyHome = iaService.createNode(String.load(String.id.IDS_HOME_PIVOT), MS.Entertainment.UI.Monikers.homeHub);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(emptyHome, "/Components/Video/EmptyHome.html");
+ iaService.rootNode = emptyHome;
+ addedLxEmptyPage = true
+ }
+ if (marketplaceEnabled || addedLxEmptyPage)
+ iaService.rootNode.addChild(videoCollection);
+ else
+ iaService.rootNode = videoCollection;
+ if (marketplaceEnabled) {
+ if (!demoMode)
+ if (!addedLxEmptyPage) {
+ var home = iaService.createNode(String.load(String.id.IDS_HOME_PIVOT), MS.Entertainment.UI.Monikers.homeHub);
+ home.getDataContext = function homeGetDataContext() {
+ var videoSpotlight = MS.Entertainment.ViewModels.VideoSpotlight.startupVideoSpotlight;
+ MS.Entertainment.ViewModels.VideoSpotlight.startupVideoSpotlight = null;
+ if (!videoSpotlight)
+ videoSpotlight = new MS.Entertainment.ViewModels.VideoSpotlight;
+ return videoSpotlight
+ };
+ var spotlightPanel = iaService.createNode(String.load(String.id.IDS_VIDEO_SPOTLIGHT), MS.Entertainment.UI.Monikers.homeSpotlight, templateVideoHubSpotlightPanel);
+ iaService.rootNode.addChild(home);
+ iaService.rootNode.defaultChild = home;
+ home.addChild(spotlightPanel)
+ }
+ var videoOtherCollectionPanel = iaService.createNode(String.load(String.id.IDS_VIDEO_COLLECTION_PIVOT), MS.Entertainment.UI.Monikers.videoOtherCollectionPanel, templateVideoHubCollectionPanel, hiddenHub);
+ videoOtherCollectionPanel.getDataContext = function videoCollectionPanelGetDataContext() {
+ return new MS.Entertainment.ViewModels.OtherHubCollectionPanel
+ };
+ videoCollection.addChild(videoOtherCollectionPanel);
+ if (moviesMarketplaceEnabled && !demoMode) {
+ var videoMovieCollectionPanel = iaService.createNode(String.load(String.id.IDS_VIDEO_COLLECTION_MOVIES_PIVOT), MS.Entertainment.UI.Monikers.videoMovieCollectionPanel, templateMovieHubCollectionPanel, hiddenHub);
+ videoMovieCollectionPanel.getDataContext = function videoCollectionPanelGetDataContext() {
+ return new MS.Entertainment.ViewModels.MovieHubCollectionPanel
+ };
+ videoCollection.addChild(videoMovieCollectionPanel)
+ }
+ if (tvMarketplaceEnabled && !demoMode) {
+ var videoTvCollectionPanel = iaService.createNode(String.load(String.id.IDS_VIDEO_COLLECTION_TV_PIVOT), MS.Entertainment.UI.Monikers.videoTvCollectionPanel, templateTvHubCollectionPanel, hiddenHub);
+ videoTvCollectionPanel.getDataContext = function videoCollectionPanelGetDataContext() {
+ return new MS.Entertainment.ViewModels.TvHubCollectionPanel
+ };
+ videoCollection.addChild(videoTvCollectionPanel)
+ }
+ }
+ var folderTitle = String.load(String.id.IDS_OTHER_VIDEO_COLLECTION_TITLE);
+ var folderVideoCollection = iaService.createNode(folderTitle, MS.Entertainment.UI.Monikers.otherVideoCollection, null, hiddenPanel);
+ folderVideoCollection.getDataContext = function getDataContext() {
+ return createVideoCollectionDataContext("other")
+ };
+ videoCollection.addChild(folderVideoCollection);
+ folderVideoCollection.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.otherVideoCollectionPanel, "/Components/Video/VideoCollectionPanels.html#videoCollectionFolderTemplate"));
+ if (!demoMode) {
+ var movieCollection = iaService.createNode(String.load(String.id.IDS_MOVIE_COLLECTION_TITLE), MS.Entertainment.UI.Monikers.movieCollection, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(movieCollection, "/Components/Video/VideoCollectionPanels.html#videoCollectionMoviesTemplate");
+ movieCollection.getDataContext = function getDataContext() {
+ return createVideoCollectionDataContext("movies", movieCollection)
+ };
+ movieCollection.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.movieCollectionPanel, "/Components/Video/VideoCollectionPanels.html#videoCollectionMoviesTemplate"), null, null, null);
+ videoCollection.addChild(movieCollection);
+ var tvCollection = iaService.createNode(String.load(String.id.IDS_TV_COLLECTION_TITLE), MS.Entertainment.UI.Monikers.tvCollection, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(tvCollection, "/Components/Video/VideoCollectionPanels.html#videoCollectionTVTemplate");
+ tvCollection.getDataContext = function getDataContext() {
+ return createVideoCollectionDataContext("tv", tvCollection)
+ };
+ tvCollection.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.tvCollectionPanel, "/Components/Video/VideoCollectionPanels.html#videoCollectionTVTemplate"), null, null, null);
+ videoCollection.addChild(tvCollection)
+ }
+ if (marketplaceEnabled)
+ if (!demoMode) {
+ var movieMarketplace = iaService.createNode(String.load(String.id.IDS_MOVIE_MARKETPLACE_TITLE_LC), MS.Entertainment.UI.Monikers.movieMarketplace, null, null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ movieMarketplace.perfTrackStartPoint = MS.Entertainment.Instrumentation.PerfTrack.StartPoints.MarketplaceGalleryRequest;
+ movieMarketplace.useStaticHubStrip = true;
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(movieMarketplace, galleryPageTemplate);
+ iaService.rootNode.addChild(movieMarketplace);
+ var movieMarketplaceNewReleasesPanel = iaService.createNode(String.load(String.id.IDS_VIDEO_DASH_MOVIE_NEW_LC), MS.Entertainment.UI.Monikers.movieMarketplacePanel, templateVideoHubNewMoviesPanel, hiddenHub, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ movieMarketplaceNewReleasesPanel.getDataContext = function movieMarketplaceGetDataContext() {
+ return new MS.Entertainment.UI.Video.NewMoviesDashboardDataContext
+ };
+ movieMarketplace.addChild(movieMarketplaceNewReleasesPanel);
+ var movieMarketplaceFeaturedPanel = iaService.createNode(String.load(String.id.IDS_VIDEO_DASH_MOVIE_FEATURED_LC), MS.Entertainment.UI.Monikers.movieMarketplacePanel2, templateVideoHubFeaturedMoviesPanel, hiddenHub, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ movieMarketplaceFeaturedPanel.getDataContext = function movieMarketplaceGetDataContext() {
+ return new MS.Entertainment.UI.Video.FeaturedMoviesDashboardDataContext
+ };
+ movieMarketplace.addChild(movieMarketplaceFeaturedPanel);
+ var movieMarketplaceNewReleasesHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_MOVIE_NEW_RELEASE_LC), MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(movieMarketplaceNewReleasesHub, movieMarketplaceHubFragmentUrl);
+ movieMarketplaceNewReleasesHub.getDataContext = function getNewReleasesContext() {
+ return createVideoMarketplaceDataContext("movieNewReleases", movieMarketplaceNewReleasesHub)
+ };
+ movieMarketplaceNewReleasesHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.movieMarketplaceNewReleasesPanel, "/Components/Video/VideoPanels.html#movieMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace));
+ movieMarketplace.addChild(movieMarketplaceNewReleasesHub);
+ var movieMarketplaceFeaturedHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_MOVIE_FEATURED_LC), MS.Entertainment.UI.Monikers.movieMarketplaceFeatured, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(movieMarketplaceFeaturedHub, movieMarketplaceHubFragmentUrl);
+ movieMarketplaceFeaturedHub.getDataContext = function getFeaturedContext() {
+ return createVideoMarketplaceDataContext("movieFeatured", movieMarketplaceFeaturedHub)
+ };
+ movieMarketplaceFeaturedHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.movieMarketplaceFeaturedPanel, "/Components/Video/VideoPanels.html#movieMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace));
+ movieMarketplace.addChild(movieMarketplaceFeaturedHub);
+ var movieMarketplaceTopPurchasedHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_MOVIE_TOP_SALES_LC), MS.Entertainment.UI.Monikers.movieMarketplaceTopPurchased, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(movieMarketplaceTopPurchasedHub, movieMarketplaceHubFragmentUrl);
+ movieMarketplaceTopPurchasedHub.getDataContext = function getPopularContext() {
+ return createVideoMarketplaceDataContext("movieTopPurchased", movieMarketplaceTopPurchasedHub)
+ };
+ movieMarketplaceTopPurchasedHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.movieMarketplaceTopPurchasedPanel, "/Components/Video/VideoPanels.html#movieMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace));
+ movieMarketplace.addChild(movieMarketplaceTopPurchasedHub);
+ var movieMarketplaceTopRentedHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_MOVIE_TOP_RENTED_LC), MS.Entertainment.UI.Monikers.movieMarketplaceTopRented, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(movieMarketplaceTopRentedHub, movieMarketplaceHubFragmentUrl);
+ movieMarketplaceTopRentedHub.getDataContext = function getTopRentedContext() {
+ return createVideoMarketplaceDataContext("movieTopRented", movieMarketplaceTopRentedHub)
+ };
+ movieMarketplaceTopRentedHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.movieMarketplaceTopRentedPanel, "/Components/Video/VideoPanels.html#movieMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace));
+ movieMarketplace.addChild(movieMarketplaceTopRentedHub);
+ if (customerRatingSortEnabled) {
+ var movieMarketplaceTopRatedHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_MOVIE_TOP_RATED_LC), MS.Entertainment.UI.Monikers.movieMarketplaceTopRated, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(movieMarketplaceTopRatedHub, movieMarketplaceHubFragmentUrl);
+ movieMarketplaceTopRatedHub.getDataContext = function getTopRatedContext() {
+ return createVideoMarketplaceDataContext("movieTopRated", movieMarketplaceTopRatedHub)
+ };
+ movieMarketplaceTopRatedHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.movieMarketplaceTopRatedPanel, "/Components/Video/VideoPanels.html#movieMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace));
+ movieMarketplace.addChild(movieMarketplaceTopRatedHub)
+ }
+ var tvMarketplace = iaService.createNode(String.load(String.id.IDS_TV_MARKETPLACE_TITLE_LC), MS.Entertainment.UI.Monikers.tvMarketplace, null, null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ tvMarketplace.perfTrackStartPoint = MS.Entertainment.Instrumentation.PerfTrack.StartPoints.MarketplaceGalleryRequest;
+ tvMarketplace.useStaticHubStrip = true;
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(tvMarketplace, galleryPageTemplate);
+ iaService.rootNode.addChild(tvMarketplace);
+ var tvMarketplacePanel = iaService.createNode(String.load(String.id.IDS_VIDEO_DASH_TV_NEW_LC), MS.Entertainment.UI.Monikers.tvMarketplacePanel, templateVideoHubNewTvPanel, hiddenHub, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ tvMarketplacePanel.getDataContext = function tvMarketplaceGetDataContext() {
+ return new MS.Entertainment.UI.Video.NewTvDashboardDataContext
+ };
+ tvMarketplace.addChild(tvMarketplacePanel);
+ var tvMarketplacePanel2 = iaService.createNode(String.load(String.id.IDS_VIDEO_DASH_TV_FEATURED_LC), MS.Entertainment.UI.Monikers.tvMarketplacePanel2, templateVideoHubFeaturedTvPanel, hiddenHub, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ tvMarketplacePanel2.getDataContext = function tvMarketplaceGetDataContext() {
+ return new MS.Entertainment.UI.Video.FeaturedTvDashboardDataContext
+ };
+ tvMarketplace.addChild(tvMarketplacePanel2);
+ var tvMarketplaceNewReleasesHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_TV_NEW_RELEASE_LC), MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(tvMarketplaceNewReleasesHub, tvMarketplaceHubFragmentUrl);
+ tvMarketplaceNewReleasesHub.getDataContext = function getNewReleasesContext() {
+ return createVideoMarketplaceDataContext("tvNewReleases", tvMarketplaceNewReleasesHub)
+ };
+ tvMarketplaceNewReleasesHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.tvMarketplaceNewReleasesPanel, "/Components/Video/VideoPanels.html#tvMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ tvMarketplace.addChild(tvMarketplaceNewReleasesHub);
+ var tvMarketplaceFeaturedHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_TV_FEATURED_LC), MS.Entertainment.UI.Monikers.tvMarketplaceFeatured, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(tvMarketplaceFeaturedHub, tvMarketplaceHubFragmentUrl);
+ tvMarketplaceFeaturedHub.getDataContext = function getTvFeaturedContext() {
+ return createVideoMarketplaceDataContext("tvFeatured", tvMarketplaceFeaturedHub)
+ };
+ tvMarketplaceFeaturedHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.tvMarketplaceFeaturedPanel, "/Components/Video/VideoPanels.html#tvMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ tvMarketplace.addChild(tvMarketplaceFeaturedHub);
+ if (lastNightOnTvEnabled) {
+ var tvMarketplaceLastNightHub = iaService.createNode(String.load(String.id.IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT), MS.Entertainment.UI.Monikers.tvMarketplaceLastNight, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(tvMarketplaceLastNightHub, tvMarketplaceHubFragmentUrl);
+ tvMarketplaceLastNightHub.getDataContext = function getLastNightTvContext() {
+ return createVideoMarketplaceDataContext("tvAiredLastNight", tvMarketplaceLastNightHub)
+ };
+ tvMarketplaceLastNightHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.tvMarketplaceLastNightPanel, "/Components/Video/VideoPanels.html#tvMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ tvMarketplace.addChild(tvMarketplaceLastNightHub)
+ }
+ var tvMarketplaceTopPurchasedHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_TV_TOP_SALES_LC), MS.Entertainment.UI.Monikers.tvMarketplaceTopPurchased, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(tvMarketplaceTopPurchasedHub, tvMarketplaceHubFragmentUrl);
+ tvMarketplaceTopPurchasedHub.getDataContext = function getTopPurchasedContext() {
+ return createVideoMarketplaceDataContext("tvTopPurchased", tvMarketplaceTopPurchasedHub)
+ };
+ tvMarketplaceTopPurchasedHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.tvMarketplaceTopPurchasedPanel, "/Components/Video/VideoPanels.html#tvMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ tvMarketplace.addChild(tvMarketplaceTopPurchasedHub);
+ if (customerRatingSortEnabled) {
+ var tvMarketplaceTopRatedHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_TV_TOP_RATED_LC), MS.Entertainment.UI.Monikers.tvMarketplaceTopRated, null, hiddenPanel, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(tvMarketplaceTopRatedHub, tvMarketplaceHubFragmentUrl);
+ tvMarketplaceTopRatedHub.getDataContext = function getTvTopRatedContext() {
+ return createVideoMarketplaceDataContext("tvTopRated", tvMarketplaceTopRatedHub)
+ };
+ tvMarketplaceTopRatedHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.tvMarketplaceTopRatedPanel, "/Components/Video/VideoPanels.html#tvMarketplaceTemplate", null, null, Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ tvMarketplace.addChild(tvMarketplaceTopRatedHub)
+ }
+ var videoMarketplaceFlexHubPage = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.flexHubPage);
+ videoMarketplaceFlexHubPage.useStaticHubStrip = true;
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(videoMarketplaceFlexHubPage, galleryPageTemplate);
+ var videoMarketplaceFlexHub = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.flexHub, null, hiddenPanel, null);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(videoMarketplaceFlexHub, videoMarketplaceFlexHubFragmentUrl);
+ videoMarketplaceFlexHub.getDataContext = function getFlexHubContext() {
+ return createVideoMarketplaceDataContext("flexHub", videoMarketplaceFlexHub)
+ };
+ videoMarketplaceFlexHub.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.flexHubPanel, "/Components/Video/VideoPanels.html#flexHubMarketplaceTemplate", null, null));
+ videoMarketplaceFlexHubPage.addChild(videoMarketplaceFlexHub);
+ var videoMarketplaceFeaturedSetsPage = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.featuredSetsPage);
+ videoMarketplaceFeaturedSetsPage.useStaticHubStrip = true;
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(videoMarketplaceFeaturedSetsPage, galleryPageTemplate);
+ var videoMarketplaceFeaturedSets = iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.featuredSets, null, hiddenPanel, null);
+ MS.Entertainment.InformationArchitecture.Node.overrideHubFragmentUrl(videoMarketplaceFeaturedSets, videoMarketplaceFeaturedSetsFragmentUrl);
+ videoMarketplaceFeaturedSets.getDataContext = function getFeaturedSetsContext() {
+ return createVideoMarketplaceDataContext("featuredSet", videoMarketplaceFeaturedSets)
+ };
+ videoMarketplaceFeaturedSets.addChild(iaService.createNode(String.empty, MS.Entertainment.UI.Monikers.featuredSetsPanel, "/Components/Video/VideoPanels.html#featuredSetsMarketplaceTemplate", null, null));
+ videoMarketplaceFeaturedSetsPage.addChild(videoMarketplaceFeaturedSets);
+ var previewBrowsePanel = iaService.createNode(String.load(String.id.IDS_VIDEO_PREVIEW_BROWSE_BUTTON), MS.Entertainment.UI.Monikers.movieTrailerBrowse);
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(previewBrowsePanel, "/Components/Video/PreviewBrowse.html");
+ previewBrowsePanel.getDataContext = null
+ }
+ else {
+ var demoMarketplaceHub = iaService.createNode(String.load(String.id.IDS_MARKETPLACE_PIVOT), MS.Entertainment.UI.Monikers.videoMarketplace);
+ iaService.rootNode.addChild(demoMarketplaceHub);
+ iaService.rootNode.defaultChild = demoMarketplaceHub;
+ if (moviesMarketplaceEnabled) {
+ var demoMoviePanel = iaService.createNode(String.load(String.id.IDS_VIDEO_DASH_MOVIE_FEATURED_LC), MS.Entertainment.UI.Monikers.movieMarketplacePanel, templateVideoHubNewMoviesPanel, hiddenHub);
+ demoMoviePanel.getDataContext = function demoMovieMarketplaceGetDataContext() {
+ return new MS.Entertainment.UI.Video.MovieDemoDashboardDataContext
+ };
+ demoMarketplaceHub.addChild(demoMoviePanel)
+ }
+ if (tvMarketplaceEnabled) {
+ var demoTvPanel = iaService.createNode(String.load(String.id.IDS_VIDEO_DASH_TV_FEATURED_LC), MS.Entertainment.UI.Monikers.tvMarketplacePanel, templateVideoHubNewTvPanel, hiddenHub);
+ demoTvPanel.getDataContext = function demoTvMarketplaceGetDataContext() {
+ return new MS.Entertainment.UI.Video.TvDemoDashboardDataContext
+ };
+ demoMarketplaceHub.addChild(demoTvPanel)
+ }
+ }
+ };
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.informationArchitecture)) {
+ Trace.fail("VideoIA - Information Architecture not registered. This should be impossible, but is always fatal");
+ throw new Error("VideoIA - Information Architecture not registered");
+ }
+ var ia = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ ia.addIAHandler(createVideoIA)
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoMarketplaceTemplates.html b/packages/microsoft.zunevideo/Components/Video/VideoMarketplaceTemplates.html
new file mode 100644
index 00000000..b872409c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoMarketplaceTemplates.html
@@ -0,0 +1,1383 @@
+
+
+
+
+ Video Marketplace Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoPanels.html b/packages/microsoft.zunevideo/Components/Video/VideoPanels.html
new file mode 100644
index 00000000..9f46294b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoPanels.html
@@ -0,0 +1,140 @@
+
+
+
+
+
+ Music Panels
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoSearchTemplates.html b/packages/microsoft.zunevideo/Components/Video/VideoSearchTemplates.html
new file mode 100644
index 00000000..395f5853
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoSearchTemplates.html
@@ -0,0 +1,168 @@
+
+
+
+
+ Video Shared Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoSharedTemplatesControls.js b/packages/microsoft.zunevideo/Components/Video/VideoSharedTemplatesControls.js
new file mode 100644
index 00000000..961f3ab2
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoSharedTemplatesControls.js
@@ -0,0 +1,9 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Controls/thumbnailbutton.js", "/Controls/mediaItemThumbnail.js", "/Framework/corefx.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MovieListItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "/Components/Video/VideoMarketplaceTemplates.html#movieListItemButtonTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {CastAndCrewListItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "/Components/Video/VideoMarketplaceTemplates.html#movieListItemButtonTemplate", function castAndCrewListItem(){}, {}, {showAnimation: null})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MovieGridItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "/Components/Video/VideoMarketplaceTemplates.html#movieGridItemButtonTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TvGridItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.GalleryThumbnail", "/Components/Video/VideoMarketplaceTemplates.html#tvGridItemButtonTemplate")})
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoSpotlightView1.html b/packages/microsoft.zunevideo/Components/Video/VideoSpotlightView1.html
new file mode 100644
index 00000000..f5ecb24b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoSpotlightView1.html
@@ -0,0 +1,957 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoStartupIA.js b/packages/microsoft.zunevideo/Components/Video/VideoStartupIA.js
new file mode 100644
index 00000000..bb178ff8
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoStartupIA.js
@@ -0,0 +1,18 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/iaservice.js", "/Framework/serviceLocator.js", "/Monikers.js");
+(function() {
+ "use strict";
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.informationArchitecture)) {
+ Trace.fail("VideoStartup - Information Architecture not registered. This should be impossible, but is always fatal");
+ throw new Error("VideoStartup - Information Architecture not registered");
+ }
+ var ia = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ var videoStartupIA = function videoStartupIA() {
+ var fullScreenVideoNowPlaying = ia.createNode(String.empty, MS.Entertainment.UI.Monikers.fullScreenNowPlaying);
+ var postRollEnabled = !!WinJS.UI.AutomaticFocus;
+ var nowPlayingPageFragmentUrl = postRollEnabled ? "/Components/Video/VideoPostRollPage.html" : "/Components/Video/VideoFullScreenNowPlaying.html";
+ MS.Entertainment.InformationArchitecture.Node.overridePageFragmentUrl(fullScreenVideoNowPlaying, nowPlayingPageFragmentUrl)
+ };
+ videoStartupIA();
+ ia.addIAHandler(videoStartupIA, true)
+})()
diff --git a/packages/microsoft.zunevideo/Components/Video/VideoStartupTemplates.html b/packages/microsoft.zunevideo/Components/Video/VideoStartupTemplates.html
new file mode 100644
index 00000000..929c564c
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video/VideoStartupTemplates.html
@@ -0,0 +1,286 @@
+
+
+
+
+ Video Startup Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/EpisodeDetails.html b/packages/microsoft.zunevideo/Components/Video_Win/EpisodeDetails.html
new file mode 100644
index 00000000..0882d5c7
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/EpisodeDetails.html
@@ -0,0 +1,266 @@
+
+
+
+
+ Episode Details Page and Item Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/MovieDetails.html b/packages/microsoft.zunevideo/Components/Video_Win/MovieDetails.html
new file mode 100644
index 00000000..17e1bcff
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/MovieDetails.html
@@ -0,0 +1,559 @@
+
+
+
+
+ Movie Details Page and Item Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/MoviesStore.html b/packages/microsoft.zunevideo/Components/Video_Win/MoviesStore.html
new file mode 100644
index 00000000..c0788f97
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/MoviesStore.html
@@ -0,0 +1,379 @@
+
+
+
+
+ Video Movies Store Page and Item Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/SearchResultsPage.html b/packages/microsoft.zunevideo/Components/Video_Win/SearchResultsPage.html
new file mode 100644
index 00000000..74d57b17
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/SearchResultsPage.html
@@ -0,0 +1,328 @@
+
+
+
+
+ Video Search Results Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/TvDetails.html b/packages/microsoft.zunevideo/Components/Video_Win/TvDetails.html
new file mode 100644
index 00000000..28be6b64
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/TvDetails.html
@@ -0,0 +1,386 @@
+
+
+
+
+ TV Details Page and Item Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/TvStore.html b/packages/microsoft.zunevideo/Components/Video_Win/TvStore.html
new file mode 100644
index 00000000..713d1897
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/TvStore.html
@@ -0,0 +1,408 @@
+
+
+
+
+ Video TV Store Page and Item Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/VideoCollection.html b/packages/microsoft.zunevideo/Components/Video_Win/VideoCollection.html
new file mode 100644
index 00000000..a45da149
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/VideoCollection.html
@@ -0,0 +1,346 @@
+
+
+
+
+ Video Collection Content Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/VideoCollectionDelayedScripts.html b/packages/microsoft.zunevideo/Components/Video_Win/VideoCollectionDelayedScripts.html
new file mode 100644
index 00000000..1518e94e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/VideoCollectionDelayedScripts.html
@@ -0,0 +1,29 @@
+
+
+
+
+ Video Collection Content Templates - Delayed Scripts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/Video_Win/VideoMarketplacePageTemplate.html b/packages/microsoft.zunevideo/Components/Video_Win/VideoMarketplacePageTemplate.html
new file mode 100644
index 00000000..16387bba
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/Video_Win/VideoMarketplacePageTemplate.html
@@ -0,0 +1,441 @@
+
+
+
+
+ Video Marketplace Page Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/shell/AdControl.html b/packages/microsoft.zunevideo/Components/shell/AdControl.html
new file mode 100644
index 00000000..a4729cf8
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/AdControl.html
@@ -0,0 +1,45 @@
+
+
+
+
+ Ad Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/shell/AdControl.js b/packages/microsoft.zunevideo/Components/shell/AdControl.js
new file mode 100644
index 00000000..3468f56f
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/AdControl.js
@@ -0,0 +1,269 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Components.Shell");
+(function() {
+ "use strict";
+ var uacConsoleErrorMap = {
+ ClientConfiguration: "clientConfiguration", ServerSideError: "serverSideError", InvalidServerResponse: "invalidServerResponse", NoAdAvailable: "noAdAvailable", NetworkConnectionFailure: "networkConnectionFailure", RefreshNotAllowed: "refreshNotAllowed", Other: "other", Unknown: "unknown"
+ };
+ WinJS.Namespace.define("MS.Entertainment.UI.Components.Shell", {
+ AdControl: MS.Entertainment.UI.Framework.defineUserControl(null, function adControlConstructor() {
+ this._eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell
+ }, {
+ ad: null, applicationId: null, adUnitId: null, countryOrRegion: null, isAutoRefreshEnabled: true, hideAdLabel: false, passThroughClickEvents: false, template: "/Components/Shell/AdControl.html#adControlTemplate", _errorValues: null, _eventProvider: null, _frozen: false, _errorOccurred: false, _uiStateServiceBinding: null, _resizeEventHandler: null, _clickEventHandler: null, initialize: function initialize() {
+ WinJS.Promise.timeout(MS.Entertainment.UI.Components.Shell.AdControl._createAdControlDelay).done(function timeoutComplete() {
+ if (this._unloaded || !this.domElement)
+ return;
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._uiStateServiceBinding = WinJS.Binding.bind(uiState, {shouldShowAdsForFreePlay: this._showAdsForFreePlayChanged.bind(this)})
+ }
+ else
+ this._loadAdControl()
+ }.bind(this))
+ }, _showAdsForFreePlayChanged: function() {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!uiState.shouldShowAdsForFreePlay || !this.domElement || this._unloaded)
+ return;
+ if (this._isVisible)
+ this._loadAdControl();
+ else if (!this._resizeEventHandler)
+ this._resizeEventHandler = MS.Entertainment.Utilities.attachResizeEvent(this.domElement, function onResize() {
+ if (this._isVisible && uiState.shouldShowAdsForFreePlay) {
+ this._clearResizeEventHandler();
+ this._loadAdControl()
+ }
+ }.bind(this))
+ }, _isVisible: {get: function() {
+ return (!this._unloaded && this.domElement && this.domElement.clientWidth > 0 && this.domElement.clientHeight > 0)
+ }}, _loadAdControl: function _loadAdControl() {
+ if (this._unloaded || !this.domElement)
+ return;
+ var regionCode;
+ var languageCode;
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ regionCode = globalizationManager.getRegion();
+ var resourceLanguage = MS.Entertainment.Utilities.getResourceLanguage();
+ languageCode = MS.Entertainment.Utilities.getLanguageCodeFromLocale(resourceLanguage);
+ this.countryOrRegion = regionCode;
+ this.applicationId = MS.Entertainment.UI.Components.Shell.AdControl._getAdApplicationId();
+ this.adUnitId = MS.Entertainment.UI.Components.Shell.AdControl._getAdUnitId(this.ad, regionCode, languageCode);
+ var loadTemplatePromise;
+ if (this.adUnitId && this.applicationId)
+ loadTemplatePromise = MS.Entertainment.UI.Framework.loadTemplate(this.template);
+ else
+ loadTemplatePromise = WinJS.Promise.wrap();
+ loadTemplatePromise.then(function loadTemplateComplete(templateInstance) {
+ if (!this._unloaded && templateInstance)
+ return templateInstance.render(this, this.domElement);
+ else
+ return WinJS.Promise.wrap()
+ }.bind(this)).then(function templateRenderComplete() {
+ if (!this._unloaded) {
+ MS.Entertainment.UI.Framework.processDeclMembers(this.domElement, this);
+ if (this.adControl) {
+ if (this._frozen)
+ this._disableAdControl();
+ if (this.adControl.addAdTag) {
+ this.adControl.addAdTag("tts", "false");
+ if (this.hideAdLabel)
+ this.adControl.addAdTag("adLabel", "false")
+ }
+ this.adControl.onEngagedChanged = function onEngagedChanged() {
+ if (this.adControl.isEngaged) {
+ this._pausePlayback();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.typeToSearch))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).disableTypeToSearch()
+ }
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.typeToSearch))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).enableTypeToSearch()
+ }.bind(this);
+ this._createErrorEnumMap();
+ this.adControl.onErrorOccurred = function onErrorOccurred(ad, error) {
+ var errorCode = error.errorCode;
+ if (this._errorValues)
+ switch (errorCode) {
+ case this._errorValues.ClientConfiguration:
+ case this._errorValues.ServerSideError:
+ case this._errorValues.InvalidServerResponse:
+ MS.Entertainment.UI.Components.Shell.fail("Ad load failure was encountered.\n\tError: {0}\n\tMessage: {1}".format(error.errorCode, error.errorMessage), null, MS.Entertainment.UI.Debug.errorLevel.low);
+ case this._errorValues.NoAdAvailable:
+ case this._errorValues.NetworkConnectionFailure:
+ this.adLoadFailed = true;
+ this._hideAdControl();
+ return;
+ case this._errorValues.RefreshNotAllowed:
+ return;
+ case this._errorValues.Other:
+ case this._errorValues.Unknown:
+ default:
+ break
+ }
+ this._errorOccurred = true;
+ WinJS.Promise.timeout(1000).done(function _setAdFailureState() {
+ if (this._errorOccurred) {
+ this.adLoadFailed = true;
+ this.adLoaded = false;
+ this._hideAdControl()
+ }
+ }.bind(this))
+ }.bind(this);
+ this.adControl.onAdRefreshed = function onAdRefreshed() {
+ this._errorOccurred = false;
+ this.adLoadFailed = false;
+ this.adLoaded = true;
+ this._showAdControl();
+ this._clearFocusAttributeOnAdContainer();
+ this._eventProvider.traceAdControl_Refreshed(this.applicationId, this.adUnitId)
+ }.bind(this);
+ this._clearFocusAttributeOnAdContainer();
+ if (this.passThroughClickEvents)
+ this._clickEventHandler = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {click: this._handleClick.bind(this)}, true)
+ }
+ }
+ }.bind(this))
+ }, unload: function unload() {
+ if (this.adControl) {
+ this.adControl.dispose();
+ this.adControl = null
+ }
+ if (this._uiStateServiceBinding) {
+ this._uiStateServiceBinding.cancel();
+ this._uiStateServiceBinding = null
+ }
+ if (this._clickEventHandler) {
+ this._clickEventHandler.cancel();
+ this._clickEventHandler = null
+ }
+ this._clearResizeEventHandler();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _clearResizeEventHandler: function _clearResizeEventHandler() {
+ if (this._resizeEventHandler) {
+ this._resizeEventHandler.cancel();
+ this._resizeEventHandler = null
+ }
+ }, _pausePlayback: function _pausePlayback() {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionManager && sessionManager.primarySession.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying)
+ switch (sessionManager.primarySession.currentTransportState) {
+ case MS.Entertainment.Platform.Playback.TransportState.playing:
+ case MS.Entertainment.Platform.Playback.TransportState.starting:
+ case MS.Entertainment.Platform.Playback.TransportState.buffering:
+ sessionManager.primarySession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ break
+ }
+ }, _hideAdControl: function _hideAdControl() {
+ if (this._unloaded || !MS.Entertainment.Utilities.isApp2)
+ return;
+ WinJS.Utilities.removeClass(this.domElement, "win-focusable");
+ MS.Entertainment.UI.Framework.beginHideAnimations(this.adControlWrapper)
+ }, _showAdControl: function _showAdControl() {
+ if (this._unloaded || !MS.Entertainment.Utilities.isApp2)
+ return;
+ WinJS.Utilities.addClass(this.domElement, "win-focusable");
+ MS.Entertainment.UI.Framework.beginShowAnimations(this.adControlWrapper)
+ }, _disableAdControl: function _disableAdControl() {
+ if (this.adControl) {
+ if (this.adControl._stopViewableChangeMonitoring)
+ this.adControl._stopViewableChangeMonitoring();
+ if (this.adControl.suspend) {
+ this.adControl.isAutoRefreshEnabled = false;
+ this.adControl.suspend()
+ }
+ if (this.adControl._domElement)
+ WinJS.Utilities.addClass(this.adControl._domElement, "disabledAdControl")
+ }
+ if (this.domElement)
+ this.domElement.disabled = true
+ }, _enableAdControl: function _enableAdControl() {
+ if (this.domElement)
+ this.domElement.disabled = false;
+ if (this.adControl) {
+ if (this.adControl._domElement)
+ WinJS.Utilities.removeClass(this.adControl._domElement, "disabledAdControl");
+ if (this.adControl.resume) {
+ this.adControl.resume();
+ this.adControl.isAutoRefreshEnabled = true
+ }
+ if (this.adControl._startViewableChangeMonitoring)
+ this.adControl._startViewableChangeMonitoring()
+ }
+ }, _handleClick: function _handleClick() {
+ if (!this._unloaded && this.adControl && this.adControl._click)
+ this.adControl._click()
+ }, _clearFocusAttributeOnAdContainer: function _clearFocusAttributeOnAdContainer() {
+ if (this.passThroughClickEvents) {
+ var focusableElement = this.domElement.querySelector("iframe");
+ if (focusableElement)
+ WinJS.Utilities.removeClass(focusableElement, "win-focusable")
+ }
+ }, _createErrorEnumMap: function _createErrorEnumMap() {
+ this._errorValues = MS.Entertainment.Utilities.isApp2 ? uacConsoleErrorMap : this.adControl._ERROR_ENUM
+ }, freeze: function freeze() {
+ this._frozen = true;
+ WinJS.Promise.timeout(1).done(function() {
+ if (this._frozen)
+ this._disableAdControl()
+ }.bind(this));
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._frozen = false;
+ this._enableAdControl()
+ }
+ }, {
+ adLoaded: false, adLoadFailed: false
+ }, {
+ _createAdControlDelay: 2000, _getAdApplicationId: function _getAdApplicationId() {
+ var adApplicationId;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ adApplicationId = configurationManager.ads.videoAdApplicationId;
+ else if (MS.Entertainment.Utilities.isVideoApp2)
+ adApplicationId = configurationManager.ads.video2AdApplicationId;
+ else if (MS.Entertainment.Utilities.isMusicApp)
+ adApplicationId = configurationManager.ads.musicAdApplicationId;
+ MS.Entertainment.UI.Components.Shell.assert(adApplicationId, "Ad configuration application id not found.");
+ return adApplicationId
+ }, _getAdUnitId: function _getAdUnitId(ad, regionCode, languageCode) {
+ var adUnitId;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var adIds = configurationManager.ads[ad];
+ MS.Entertainment.UI.Components.Shell.assert(adIds, "Ad configuration unit ids not found: configuration.ads." + ad);
+ if (adIds) {
+ adUnitId = MS.Entertainment.Utilities.getValueFromCsvList(adIds, languageCode + "-" + regionCode);
+ if (!adUnitId)
+ adUnitId = MS.Entertainment.Utilities.getValueFromCsvList(adIds, regionCode)
+ }
+ return adUnitId
+ }, AdIds: {
+ musicDashboard: "musicDashboardAdUnitIds", musicPopularSidebar: "musicPopularSidebarAdUnitIds", musicSpotlightSidebar: "musicSpotlightSidebarAdUnitIds", video2DashboardMovie: "video2MovieAdUnitIds", video2DashboardTv: "video2TvAdUnitIds", videoDashboardMovie: "videoMovieAdUnitIds", videoDashboardTv: "videoTvAdUnitIds"
+ }
+ }), SidebarAdControl: MS.Entertainment.UI.Framework.defineUserControl("/Components/Shell/AdControl.html#sidebarAdControl", null, {
+ _signInBindings: null, _signedInUserBindings: null, initialize: function initialize() {
+ this._adControl.ad = this.ad;
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signInBindings = WinJS.Binding.bind(signIn, {isSignedIn: this._updateSubscriptionLinkVisibility.bind(this)});
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this._signedInUserBindings = WinJS.Binding.bind(signedInUser, {isSubscription: this._updateSubscriptionLinkVisibility.bind(this)});
+ if (this._subscriptionLink && this._subscriptionLink.action)
+ this._subscriptionLink.action.parameter = MS.Entertainment.Music.Freeplay.Events.musicPassUpsellMarketplaceLinkInvoked
+ }, unload: function unload() {
+ if (this._signInBindings) {
+ this._signInBindings.cancel();
+ this._signInBindings = null
+ }
+ if (this._signedInUserBindings) {
+ this._signedInUserBindings.cancel();
+ this._signedInUserBindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _updateSubscriptionLinkVisibility: function _updateSubscriptionLinkVisibility() {
+ if (this._subscriptionLink && this._subscriptionLink.action)
+ this.showSignupLink = this._subscriptionLink.action.canExecute();
+ else
+ this.showSignupLink = false
+ }
+ }, {showSignupLink: false})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/BackButtonService.js b/packages/microsoft.zunevideo/Components/shell/BackButtonService.js
new file mode 100644
index 00000000..65210442
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/BackButtonService.js
@@ -0,0 +1,111 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Shell");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Shell", {BackButton: MS.Entertainment.UI.Framework.define(function BackButton() {
+ this._navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._backButton = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.backButton);
+ this._backButtonBling = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.backButtonBling);
+ this._navigationWrapper = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.navigationWrapper);
+ this.setButtonMode(MS.Entertainment.Shell.BackButton.ButtonMode.homeButton);
+ this._navigation.addEventListener("canNavigateBackChanged", this._backButtonCallBack.bind(this));
+ this._navigation.addEventListener("hasBackStackChanged", this._backStackChangedCallback.bind(this));
+ this._backStackChangedCallback();
+ this._backButtonCallBack()
+ }, {
+ _initialized: false, _backButton: null, _backButtonBling: null, _navigation: null, _navigationWrapped: null, _overrideShowBackButton: false, _overrideBackButtonMode: null, overrideShowBackButton: {
+ get: function() {
+ return this._overrideShowBackButton
+ }, set: function(value) {
+ this._overrideShowBackButton = value;
+ this._backButtonCallBack();
+ this._backStackChangedCallback()
+ }
+ }, overrideBackButtonMode: {
+ get: function() {
+ return this._overrideBackButtonMode
+ }, set: function(value) {
+ this._overrideBackButtonMode = value;
+ this._backStackChangedCallback()
+ }
+ }, _backButtonCallBack: function() {
+ if (this.overrideShowBackButton || (this._navigation && this._navigation.canNavigateBack && !this._navigation.overrideHideBackButton))
+ this.showBackButton(false);
+ else
+ this.hideBackButton(false)
+ }, _backStackChangedCallback: function _backStackChangedCallback() {
+ if (MS.Entertainment.Utilities.isApp2)
+ this.setButtonMode(MS.Entertainment.Shell.BackButton.ButtonMode.backButton);
+ else if (this.overrideBackButtonMode)
+ this.setButtonMode(this.overrideBackButtonMode);
+ else if (this._navigation.canNavigateBack)
+ if (this._navigation.hasBackStack)
+ this.setButtonMode(MS.Entertainment.Shell.BackButton.ButtonMode.backButton);
+ else
+ this.setButtonMode(MS.Entertainment.Shell.BackButton.ButtonMode.homeButton)
+ }, showBackButton: function showBackButton(fastShow) {
+ if (this.overrideShowBackButton || (this._navigation && this._navigation.canNavigateBack))
+ if (fastShow)
+ this._showBackButtonContainer();
+ else if (this._backButton && this._backButton.domElement) {
+ this._navigationWrapper.style.opacity = String.empty;
+ this._backButton.domElement.style.display = String.empty;
+ if (this._backButtonBling)
+ this._backButtonBling.style.display = String.empty;
+ MS.Entertainment.Utilities.showElement(this._backButton.domElement)
+ }
+ }, _showBackButtonContainer: function _showBackButtonContainer() {
+ if (this._backButton && this._backButton.domElement && WinJS.Utilities.hasClass(this._backButton.domElement, "hideFromDisplay")) {
+ this._backButton.domElement.style.display = String.empty;
+ if (this._backButtonBling)
+ this._backButtonBling.style.display = String.empty;
+ WinJS.Utilities.removeClass(this._backButton.domElement, "hideFromDisplay");
+ WinJS.Utilities.removeClass(this._backButton.domElement, "exitPage")
+ }
+ if (this._navigationWrapper)
+ this._navigationWrapper.style.opacity = String.empty
+ }, hideBackButton: function hideBackButton(fastHide) {
+ if (fastHide)
+ this._hideBackButtonContainer();
+ else if (this._backButton && this._backButton.domElement) {
+ var completionHandler = function forceHide() {
+ this._backButton.domElement.style.display = "none";
+ if (this._backButtonBling)
+ this._backButtonBling.style.display = "none";
+ this._navigationWrapper.style.opacity = 0
+ }.bind(this);
+ MS.Entertainment.Utilities.hideElement(this._backButton.domElement, 200).done(completionHandler, completionHandler)
+ }
+ }, _hideBackButtonContainer: function _hideBackButtonContainer() {
+ if (this._navigationWrapper)
+ this._navigationWrapper.style.opacity = 0;
+ if (this._backButton && this._backButton.domElement) {
+ this._backButton.domElement.style.display = String.empty;
+ if (this._backButtonBling)
+ this._backButtonBling.style.display = String.empty;
+ WinJS.Utilities.addClass(this._backButton.domElement, "hideFromDisplay");
+ WinJS.Utilities.addClass(this._backButton.domElement, "exitPage")
+ }
+ }, setButtonMode: function setButtonMode(buttonMode) {
+ if (this._backButton && this._backButton.domElement) {
+ var backButtonButton = this._backButton.domElement.querySelector(".win-backbutton");
+ if (buttonMode === MS.Entertainment.Shell.BackButton.ButtonMode.backButton) {
+ WinJS.Utilities.removeClass(backButtonButton, "homeIcon");
+ backButtonButton.setAttribute("aria-label", String.load(String.id.IDS_ACC_BACK_BUTTON))
+ }
+ else if (buttonMode === MS.Entertainment.Shell.BackButton.ButtonMode.homeButton) {
+ WinJS.Utilities.addClass(backButtonButton, "homeIcon");
+ backButtonButton.setAttribute("aria-label", String.load(String.id.IDS_ACC_HOME_BUTTON))
+ }
+ else
+ MS.Entertainment.UI.Shell.fail("Unexpected buttonMode passed to setButtonMode: " + buttonMode)
+ }
+ }
+ }, {ButtonMode: {
+ backButton: "backButton", homeButton: "homeButton"
+ }})});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.backButton, function getBackButtonService() {
+ return new MS.Entertainment.Shell.BackButton
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/ContentNotificationList.html b/packages/microsoft.zunevideo/Components/shell/ContentNotificationList.html
new file mode 100644
index 00000000..e78d7922
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/ContentNotificationList.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+ EditBox Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Components/shell/DeepLinkActions.js b/packages/microsoft.zunevideo/Components/shell/DeepLinkActions.js
new file mode 100644
index 00000000..040256e1
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/DeepLinkActions.js
@@ -0,0 +1,1204 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Components.Shell");
+ var testIaPath = "/Test/InformationArchitecture.js";
+ WinJS.Namespace.define("MS.Entertainment.UI.Components.Shell", {DeepLinkMarketplaceRequiredAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {canExecute: function canExecute(parameter) {
+ var supportedAction = true;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var hasMarketplace = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ supportedAction = hasMarketplace
+ }
+ return supportedAction
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Components.Shell", {
+ testMarketplaceLogic: null, MarketplaceFeaturesLogic: (function() {
+ function Features() {
+ var features = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ function getFeatureEnabled(featureName) {
+ try {
+ return !!features.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem[featureName])
+ }
+ catch(ex) {
+ return false
+ }
+ }
+ for (var featureName in Microsoft.Entertainment.FeatureEnablement.FeatureItem)
+ try {
+ Object.defineProperty(this, featureName, {
+ get: getFeatureEnabled.bind(this, featureName), enumerable: true, configurable: false
+ })
+ }
+ catch(ex) {
+ {}
+ }
+ }
+ {};
+ function userHasSubscription() {
+ if (MS.Entertainment.UI.Components.Shell.testDeeplinkSubStatus !== undefined)
+ return !!MS.Entertainment.UI.Components.Shell.testDeeplinkSubStatus;
+ else
+ return MS.Entertainment.Utilities.currentOrLastUserSubscriptionEnabled()
+ }
+ function isDeepPlayAction(action) {
+ return action.automationId.indexOf("deepLinkPlay") === 0
+ }
+ function AnyMarket() {
+ this.deepLinkPlayMedia2 = function AnyMarket_deepLinkPlayMedia2(media, options) {
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(media, options)
+ };
+ this.name = "AnyMarket";
+ this.toString = function AnyMarket_toString() {
+ return this.name
+ };
+ this._enableFallbackToPreview = function AnyMarket_enableFallbackToPreview(obj) {
+ obj.enableFallbackToPreview = true;
+ MS.Entertainment.Platform.Playback.Etw.traceString(this.toString() + " rules: enabling fallbackToPreview")
+ };
+ this._playPreviewOnly = function AnyMarket_playPreviewOnly(obj) {
+ obj.playPreviewOnly = true;
+ MS.Entertainment.Platform.Playback.Etw.traceString(this.toString() + " rules: requesting playPreviewOnly")
+ }
+ }
+ function FreeStreamingMarket() {
+ this.processDeepLinkAction = function FreeStreamingMarket_processAction(playAction) {
+ if (isDeepPlayAction(playAction) && playAction.parameter.mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ this._enableFallbackToPreview(playAction.parameter)
+ }
+ }
+ FreeStreamingMarket.prototype = new AnyMarket;
+ FreeStreamingMarket.prototype.name = "FreeStreamingMarket";
+ function PremiumMarket() {
+ this.processDeepLinkAction = function PremiumMarket_processAction(playAction) {
+ if (isDeepPlayAction(playAction))
+ if (userHasSubscription()) {
+ if (playAction.parameter.mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ this._enableFallbackToPreview(playAction.parameter)
+ }
+ else
+ this._enableFallbackToPreview(playAction.parameter)
+ }
+ }
+ PremiumMarket.prototype = new AnyMarket;
+ PremiumMarket.prototype.name = "PremiumMarket";
+ var premiumBasePlay = PremiumMarket.prototype.deepLinkPlayMedia2;
+ PremiumMarket.prototype.deepLinkPlayMedia2 = function PremiumMarket_deepLinkPlayMedia2(media, options) {
+ if (!userHasSubscription())
+ this._enableFallbackToPreview(options);
+ premiumBasePlay.bind(this)(media, options)
+ };
+ function DTOMarket() {
+ this.processDeepLinkAction = function DTOMarket_processAction(playAction) {
+ if (isDeepPlayAction(playAction)) {
+ playAction.parameter.navigateToDetailsPage = true;
+ this._enableFallbackToPreview(playAction.parameter)
+ }
+ }
+ }
+ DTOMarket.prototype = new AnyMarket;
+ DTOMarket.prototype.name = "DTOMarket";
+ var dtoBasePlay = DTOMarket.prototype.deepLinkPlayMedia2;
+ DTOMarket.prototype.deepLinkPlayMedia2 = function DTOMarket_deepLinkPlayMedia2(media, options) {
+ this._enableFallbackToPreview(options);
+ dtoBasePlay.bind(this)(media, options)
+ };
+ function NoMarket() {
+ this.processDeepLinkAction = function NoMarket_processAction(action){}
+ }
+ NoMarket.prototype = new AnyMarket;
+ NoMarket.prototype.name = "NoMarket";
+ var marketInstance = {
+ freeStreamingMarket: new FreeStreamingMarket, premiumMarket: new PremiumMarket, dtoMarket: new DTOMarket, noMarket: new NoMarket
+ };
+ function createMarketplaceFeaturesLogicImplementation() {
+ var market = new Features;
+ var impl = null;
+ if (market.musicMarketplace)
+ if (market.musicFreePlay)
+ impl = marketInstance.freeStreamingMarket;
+ else if (market.musicSubscription)
+ impl = marketInstance.premiumMarket;
+ else
+ impl = marketInstance.dtoMarket;
+ else
+ impl = marketInstance.noMarket;
+ return impl
+ }
+ var logicImplementation = createMarketplaceFeaturesLogicImplementation();
+ function MarketplaceFeaturesLogic() {
+ var impl = MS.Entertainment.UI.Components.Shell.testMarketplaceLogic === null ? logicImplementation : marketInstance[MS.Entertainment.UI.Components.Shell.testMarketplaceLogic];
+ if (!impl)
+ MS.Entertainment.UI.Components.Shell.fail("No MarketplaceFeatureLogic for deep linking found.");
+ this.processDeepLinkAction = function MarketplaceFeaturesLogic_processPlayAction(action) {
+ return impl ? impl.processDeepLinkAction(action) : undefined
+ };
+ this.deepLinkPlayMedia2 = function MarketplaceFeaturesLogic_deepLinkPlayMedia2(media, options) {
+ return impl ? impl.deepLinkPlayMedia2(media, options) : undefined
+ };
+ this.toString = function() {
+ return impl ? impl.toString() : "undefined implementation"
+ }
+ }
+ {};
+ return MarketplaceFeaturesLogic
+ })(), DeepLinkLocationAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Components.Shell.DeepLinkMarketplaceRequiredAction", function() {
+ this.base()
+ }, {executed: function executed(params) {
+ MS.Entertainment.UI.Components.Shell.assert(params.id, "DeepLinkLocationAction: params.id not defined");
+ var navigationPromise;
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!params.dialogOnly)
+ navigationService.clearBackStackOnNextNavigate(true);
+ else if (!navigationService.currentPage)
+ navigationService.navigateToDefaultPage();
+ var promise = WinJS.Promise.as();
+ if (params.navigationDelay)
+ promise = WinJS.Promise.timeout(params.navigationDelay);
+ promise.then(function executeNavigation() {
+ if (MS.Entertainment.Utilities.isMusicApp2 && !MS.Entertainment.Utilities.appRegionMatchesMachineRegion())
+ return MS.Entertainment.UI.Shell.showRegionMismatchDialog(String.load(String.id.IDS_MUSIC2_REGION_MISMATCH_CANT_DEEPLINK_HEADER), String.load(String.id.IDS_MUSIC2_REGION_MISMATCH_CANT_DEEPLINK_BODY)).then(function completed(regionData) {
+ return WinJS.Promise.wrapError(new Error("DeepLinkActions::_deeplinkLocationAction: App region doesn't match console region. App Region: {0} Console Region: {1}".format(regionData.appRegionCode, regionData.machineRegionCode)))
+ });
+ var moniker = MS.Entertainment.UI.Monikers[params.id];
+ if (moniker) {
+ var args = null;
+ var forcePageNavigation = false;
+ var mapping = {
+ homeHub: MS.Entertainment.UI.Monikers.root, movieMarketplaceNewReleases: MS.Entertainment.UI.Monikers.movieMarketplace, movieMarketplaceFeatured: MS.Entertainment.UI.Monikers.movieMarketplace, tvMarketplaceNewReleases: MS.Entertainment.UI.Monikers.tvMarketplace, tvMarketplaceFeatured: MS.Entertainment.UI.Monikers.tvMarketplace, musicMarketplaceFeatured: MS.Entertainment.UI.Monikers.musicMarketplace, flexHub: MS.Entertainment.UI.Monikers.flexHubPage
+ };
+ var mappedMoniker = mapping[params.id];
+ if (mappedMoniker) {
+ if (mappedMoniker === MS.Entertainment.UI.Monikers.flexHubPage) {
+ MS.Entertainment.UI.Components.Shell.assert(params.targetId, "DeepLinkLocationAction: targetId required for a flexhub deeplink");
+ args = {query: params.targetId};
+ forcePageNavigation = true
+ }
+ MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver();
+ navigationService.navigateTo(mappedMoniker, moniker, null, args, forcePageNavigation)
+ }
+ else
+ navigationService.navigateTo(moniker, null, null, args, forcePageNavigation)
+ }
+ }.bind(this)).done(null, function handleDeeplinkFailed() {
+ if (!params.dialogOnly)
+ navigationService.navigateToDefaultPage()
+ })
+ }}), DeepLinkDetailsAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Components.Shell.DeepLinkMarketplaceRequiredAction", function() {
+ this.base()
+ }, {
+ executed: function executed(params) {
+ var navigationPromise;
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!params.dialogOnly)
+ navigationService.clearBackStackOnNextNavigate(true);
+ else if (!navigationService.currentPage) {
+ navigationService.navigateToDefaultPage();
+ navigationPromise = WinJS.Promise.timeout(params.navigationDelay || 0)
+ }
+ WinJS.Promise.as(navigationPromise).then(function executeNavigation() {
+ if (MS.Entertainment.Utilities.isMusicApp && params.desiredMediaItemType)
+ return this._executeMusicDetails(params);
+ else if (MS.Entertainment.Utilities.isVideoApp && params.desiredMediaItemType)
+ return this._executeVideoDetails(params);
+ else
+ return this._executeUnknownMediaTypeDetails(params)
+ }.bind(this)).done(null, function handleDeeplinkFailed(error) {
+ if (!params.dialogOnly || MS.Entertainment.Utilities.isMusicApp2)
+ navigationService.navigateToDefaultPage();
+ if (MS.Entertainment.Utilities.isVideoApp && (!error || !error.doNotShowErrorDialog))
+ WinJS.Promise.timeout(1).done(function showErrorDialog() {
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE), String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC), {dismissOnNavigateDelay: 30000})
+ })
+ })
+ }, _executeMusicDetails: function _executeMusicDetails(params) {
+ var navigationPromise;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isMusicApp2 && !MS.Entertainment.Utilities.appRegionMatchesMachineRegion())
+ return WinJS.Promise.timeout(1).then(function showMismatchDialog() {
+ return MS.Entertainment.UI.Shell.showRegionMismatchDialog(String.load(String.id.IDS_MUSIC2_REGION_MISMATCH_CANT_DEEPLINK_HEADER), String.load(String.id.IDS_MUSIC2_REGION_MISMATCH_CANT_DEEPLINK_BODY))
+ }).then(function dialogDismissed(regionData) {
+ return WinJS.Promise.wrapError(new Error("DeepLinkActions::_executeMusicDetails: App region doesn't match console region. App Region: {0} Console Region: {1}".format(regionData.appRegionCode, regionData.machineRegionCode)))
+ });
+ var isMusicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (!isMusicMarketplaceEnabled) {
+ navigationPromise = WinJS.Promise.wrapError(new Error("Music maretkplace is not enabled. Cannot execute to music details deeplink."));
+ WinJS.Promise.timeout().done(function _showNonMarketplaceError() {
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_TITLE), String.load(String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_DESC))
+ })
+ }
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ if (!isMusicMarketplaceNetworkEnabled && !navigationPromise)
+ navigationPromise = WinJS.Promise.wrapError(new Error("Music maretkplace network is not enabled. Cannot execute to music details deeplink."));
+ MS.Entertainment.UI.Components.Shell.assert(params.id, "DeepLinkDetailsAction: params.id not defined");
+ var useCanonicalId = true;
+ if (params.idType && !navigationPromise) {
+ var idType = params.idType.toLocaleLowerCase();
+ if (idType === MS.Entertainment.Data.Query.edsIdType.canonical.toLocaleLowerCase())
+ useCanonicalId = true;
+ else if (idType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsIdType.zuneCatalog.toLocaleLowerCase())
+ useCanonicalId = false;
+ else
+ MS.Entertainment.UI.Components.Shell.fail("Unknown media ID type.")
+ }
+ if (params.id && !navigationPromise) {
+ var dialogOnly = !!params.dialogOnly;
+ var item = useCanonicalId ? {ID: params.id} : {ZuneId: params.id};
+ item.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ switch (params.desiredMediaItemType.toLocaleLowerCase()) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicArtist.toLocaleLowerCase():
+ navigationPromise = this._processArtistDeeplink(item, dialogOnly);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.album.toLocaleLowerCase():
+ navigationPromise = this._processAlbumDeeplink(item, dialogOnly);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.track.toLocaleLowerCase():
+ navigationPromise = this._processTrackDeeplink(item, dialogOnly);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.musicPlaylist.toLocaleLowerCase():
+ navigationPromise = this._processPlaylistDeeplink(params.id, dialogOnly);
+ break;
+ default:
+ MS.Entertainment.UI.Components.Shell.fail("Unknown desired media type.");
+ break
+ }
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid id. Cannot execute to music details deeplink."));
+ return navigationPromise
+ }, _executeUnknownMediaTypeDetails: function _executeUnknownMediaTypeDetails(params) {
+ MS.Entertainment.UI.Components.Shell.assert(params.id, "DeepLinkDetailsAction: params.id not defined");
+ MS.Entertainment.Platform.PlaybackHelpers.getMediaByServiceId(params.id, params.idType).then(function getMediaByServiceIdSuccess(media) {
+ if (!media)
+ return WinJS.Promise.wrapError(new Error("Invalid id. Cannot execute to details deeplink."));
+ if (MS.Entertainment.Utilities.isVideoApp)
+ media.hydrate().done(function onHydrated() {
+ if (media.isValid)
+ this._showVideoImmersive(media, params)
+ }.bind(this));
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(media)
+ }.bind(this), function getMediaByServiceIdError(errorCode) {
+ if (errorCode)
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_MEDIA_ERROR_CAPTION), errorCode);
+ MS.Entertainment.UI.Components.Shell._navigateToDefaultPage()
+ })
+ }, _executeVideoDetails: function _executeVideoDetails(params) {
+ return this._getSignInPromise().then(function onSignInComplete() {
+ var navigationPromise;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMoviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var isTvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var isVideoMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.videoMarketplace);
+ var isMovieDeeplink = params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.movie.toLocaleLowerCase();
+ var isTvDeeplink = params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.tvSeries.toLocaleLowerCase() || params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.tvSeason.toLocaleLowerCase() || params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.tvEpisode.toLocaleLowerCase();
+ var showRegionMismatchDialog = MS.Entertainment.Utilities.isVideoApp2 && !MS.Entertainment.Utilities.appRegionMatchesMachineRegion();
+ MS.Entertainment.UI.Components.Shell.assert(params.desiredMediaItemType && (isMovieDeeplink || isTvDeeplink), "Unknown desiredMediaItemType.");
+ if (isMovieDeeplink && !isMoviesMarketplaceEnabled)
+ navigationPromise = WinJS.Promise.wrapError(new Error("Movies marketplace is not enabled. Cannot execute to movie deeplink."));
+ if (isTvDeeplink && !isTvMarketplaceEnabled)
+ navigationPromise = WinJS.Promise.wrapError(new Error("TV marketplace is not enabled. Cannot execute to tv deeplink."));
+ if (!isVideoMarketplaceNetworkEnabled && !navigationPromise)
+ navigationPromise = WinJS.Promise.wrapError(new Error("Video marketplace network is not enabled. Cannot execute to video details deeplink."));
+ if (showRegionMismatchDialog && !navigationPromise)
+ navigationPromise = MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_VIDEO2_REGION_WARNING_TITLE), String.load(String.id.IDS_VIDEO2_REGION_WARNING_BODY), {dismissOnNavigateDelay: 30000}).then(function onDialogDismissed() {
+ var errorInfo = new Error("Deeplink failed due to region mismatch between machine and user");
+ errorInfo.doNotShowErrorDialog = true;
+ return WinJS.Promise.wrapError(errorInfo)
+ });
+ MS.Entertainment.UI.Components.Shell.assert(params.id, "DeepLinkDetailsAction: params.id not defined");
+ var useCanonicalId = true;
+ if (params.idType && !navigationPromise) {
+ var idType = params.idType.toLocaleLowerCase();
+ if (idType === MS.Entertainment.Data.Query.edsIdType.canonical.toLocaleLowerCase())
+ useCanonicalId = true;
+ else if (idType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsIdType.zuneCatalog.toLocaleLowerCase())
+ useCanonicalId = false;
+ else
+ MS.Entertainment.UI.Components.Shell.fail("Unknown media ID type.")
+ }
+ if (params.id && !navigationPromise) {
+ var item = useCanonicalId ? {ID: params.id} : {ZuneId: params.id};
+ item.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ switch (params.desiredMediaItemType.toLocaleLowerCase()) {
+ case MS.Entertainment.Data.Query.edsMediaType.movie.toLocaleLowerCase():
+ navigationPromise = this._processMovieDeeplink(item, params);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeries.toLocaleLowerCase():
+ navigationPromise = this._processTvSeriesDeeplink(item, params);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeason.toLocaleLowerCase():
+ navigationPromise = this._processTvSeasonDeeplink(item, params);
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvEpisode.toLocaleLowerCase():
+ navigationPromise = this._processTvEpisodeDeeplink(item, params);
+ break;
+ default:
+ MS.Entertainment.UI.Components.Shell.fail("Unknown desired media type.");
+ navigationPromise = WinJS.Promise.wrapError(new Error("Unknown desired media type."));
+ break
+ }
+ }
+ else if (!navigationPromise)
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid id. Cannot execute to video details deeplink."));
+ return navigationPromise
+ }.bind(this))
+ }, _processArtistDeeplink: function _processArtistDeeplink(item, dialogOnly) {
+ var navigationPromise;
+ var artist = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSArtist);
+ if (artist) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(artist);
+ navigationPromise = artist.hydrate().then(function _onArtistHydrated() {
+ if (artist.hasServiceId)
+ if (dialogOnly) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var artistDetailsNavigateAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.artistDetailsNavigate);
+ artistDetailsNavigateAction.parameter = {
+ data: artist, clearBackStackOnExecute: true
+ };
+ MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver();
+ return artistDetailsNavigateAction.execute()
+ }
+ else {
+ var immersiveOptions = {
+ startFullScreen: false, overridePageChange: MS.Entertainment.Utilities.isMusicApp2
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(artist, immersiveOptions)
+ }
+ else
+ return WinJS.Promise.wrapError(new Error("Invalid artist id. Cannot execute to music artist details deeplink."))
+ }.bind(this))
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid artist object. Cannot execute to music artist details deeplink."));
+ return navigationPromise
+ }, _processAlbumDeeplink: function _processAlbumDeeplink(item, dialogOnly) {
+ var navigationPromise;
+ var album = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSAlbum);
+ if (album) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(album);
+ navigationPromise = album.hydrate().then(function _onAlbumHydrated() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var albumDetailsNavigateAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate);
+ albumDetailsNavigateAction.parameter = {
+ data: album, clearBackStackOnExecute: true
+ };
+ return albumDetailsNavigateAction.execute()
+ }.bind(this))
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid album object. Cannot execute to music album details deeplink."));
+ return navigationPromise
+ }, _processTrackDeeplink: function _processTrackDeeplink(item, dialogOnly) {
+ var navigationPromise;
+ var track = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EDSTrack);
+ if (track) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(track);
+ navigationPromise = track.hydrate({forceUpdate: true}).then(function _onTrackHydrated() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var albumDetailsNavigateAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.albumDetailsNavigate);
+ albumDetailsNavigateAction.parameter = {
+ data: track, clearBackStackOnExecute: true
+ };
+ return albumDetailsNavigateAction.execute()
+ }.bind(this))
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid track object. Cannot execute to music track details deeplink."));
+ return navigationPromise
+ }, _processPlaylistDeeplink: function _processPlaylistDeeplink(id, dialogOnly) {
+ return MS.Entertainment.UI.Actions.Playlists.queryPlaylistById(id, true).then(null, function fallbackOnLibraryPlaylist(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ return MS.Entertainment.UI.Actions.Playlists.getCloudPlaylist(id);
+ return WinJS.Promise.wrapError(error)
+ }).then(function showPlaylistPopover(playlist) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var playlistDetailsNavigateAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.playlistDetailsNavigate);
+ playlistDetailsNavigateAction.parameter = {
+ data: playlist, clearBackStackOnExecute: true
+ };
+ MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver();
+ return playlistDetailsNavigateAction.execute()
+ }.bind(this))
+ }, _getSignInPromise: function _getSignInPromise() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInSignal = new MS.Entertainment.UI.Framework.Signal;
+ var signInBindings;
+ var signInPromise = WinJS.Promise.wrap();
+ var cleanupSignInBindings = function cleanupSignInBindings() {
+ if (!signInBindings)
+ return;
+ signInBindings.cancel();
+ signInBindings = null;
+ signedInSignal.complete()
+ };
+ if (signIn.isSigningIn) {
+ signInBindings = WinJS.Binding.bind(signIn, {isSigningIn: cleanupSignInBindings});
+ signInPromise = signedInSignal.promise
+ }
+ return signInPromise
+ }, _getOfferIds: function _getOfferIds(mediaItem) {
+ var offerIds = [];
+ var defaultClientTypeFromApp = MS.Entertainment.Utilities.defaultClientTypeFromApp;
+ var rights = MS.Entertainment.ViewModels.SmartBuyStateHandlers.getMatchingRights(mediaItem, defaultClientTypeFromApp, [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.SeasonPurchase, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.SeasonPurchaseStream, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Purchase, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.PurchaseStream, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream, ]);
+ for (var i = 0; i < rights.length; ++i) {
+ var currentRight = rights[i];
+ if (currentRight && offerIds.indexOf(currentRight.offerId) === -1) {
+ MS.Entertainment.assert(currentRight.offerId, "DeepLinkActions: Invalid offerId: " + currentRight.offerId);
+ offerIds.push(currentRight.offerId)
+ }
+ }
+ return offerIds
+ }, _prepareMediaItemForPlayback: function _prepareMediaItemForPlayback(mediaItem) {
+ MS.Entertainment.assert(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn);
+ var offerIds = this._getOfferIds(mediaItem);
+ return MS.Entertainment.UI.PurchaseHistoryService.refreshVideoOffersAsync(offerIds).then(function addToDatabaseComplete() {
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(mediaItem)
+ }).then(null, function onError(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ return WinJS.Promise.wrap();
+ else
+ return WinJS.Promise.wrapError(error)
+ })
+ }, _processMovieDeeplink: function _processMovieDeeplink(item, params) {
+ var navigationPromise;
+ var movie = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EdsMovie);
+ if (movie && MS.Entertainment.Platform.PlaybackHelpers.isMovie(movie)) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(movie);
+ navigationPromise = movie.hydrate().then(function _onMovieHydrated() {
+ if (movie.hasServiceId && movie.isValid)
+ this._prepareMediaItemForPlayback(movie).done(function mediaItemReady() {
+ this._showVideoImmersive(movie, params)
+ }.bind(this));
+ else
+ return WinJS.Promise.wrapError(new Error("Invalid movie id. Cannot execute to movie details deeplink. Service ID " + params.id))
+ }.bind(this))
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid movie object. Cannot execute to movie details deeplink. Service ID " + params.id));
+ return navigationPromise
+ }, _processTvSeriesDeeplink: function _processTvSeriesDeeplink(item, params) {
+ var navigationPromise;
+ var series = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EdsTVSeries);
+ if (series && MS.Entertainment.Platform.PlaybackHelpers.isTVSeries(series)) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(series);
+ navigationPromise = series.hydrate().then(function _onSeriesHydrated() {
+ if (series.hasServiceId && series.isValid)
+ this._showVideoImmersive(series, params);
+ else
+ return WinJS.Promise.wrapError(new Error("Invalid series id. Cannot execute to series details deeplink. Service ID " + params.id))
+ }.bind(this))
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid series object. Cannot execute to series details deeplink. Service ID " + params.id));
+ return navigationPromise
+ }, _processTvSeasonDeeplink: function _processTvSeasonDeeplink(item, params) {
+ var navigationPromise;
+ var season = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EdsTVSeason);
+ if (season && MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(season)) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(season);
+ navigationPromise = season.hydrate().then(function _onSeasonHydrated() {
+ if (season.hasServiceId && season.isValid)
+ this._showVideoImmersive(season, params);
+ else
+ return WinJS.Promise.wrapError(new Error("Invalid season object. Cannot execute to season details deeplink. Service ID " + params.id))
+ }.bind(this))
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid season object. Cannot execute to season details deeplink. Service ID " + params.id));
+ return navigationPromise
+ }, _processTvEpisodeDeeplink: function _processTvEpisodeDeeplink(item, params) {
+ var navigationPromise;
+ var episode = MS.Entertainment.Data.augment(item, MS.Entertainment.Data.Augmenter.Marketplace.EdsTVEpisode);
+ if (episode && MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(episode)) {
+ MS.Entertainment.ViewModels.MediaItemModel.augment(episode);
+ navigationPromise = episode.hydrate().then(function _onEpisodeHydrated() {
+ if (episode.hasServiceId && episode.isValid)
+ this._prepareMediaItemForPlayback(episode).done(function mediaItemReady() {
+ this._showVideoImmersive(episode, params)
+ }.bind(this));
+ else
+ return WinJS.Promise.wrapError(new Error("Invalid episode object. Cannot execute to episode details deeplink. Service ID " + params.id))
+ }.bind(this))
+ }
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("Invalid episode object. Cannot execute to episode details deeplink. Service ID " + params.id));
+ return navigationPromise
+ }, _showPopover: function _showPopover(mediaItem, popoverConstructor, isCollection) {
+ MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver();
+ var popOverParameters = {
+ itemConstructor: popoverConstructor, dataContext: {
+ data: mediaItem, location: isCollection ? MS.Entertainment.Data.ItemLocation.collection : MS.Entertainment.Data.ItemLocation.marketplace
+ }
+ };
+ if (MS.Entertainment.Utilities.isApp2) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.clearBackStackOnNextNavigate(true)
+ }
+ MS.Entertainment.UI.Controls.PopOver.showPopOver(popOverParameters)
+ }, _showItemDetailsAndPopover: function _showItemDetailsAndPopover(popOverMediaItem, immersiveMediaItem, popoverConstructor) {
+ var navigationPromise;
+ MS.Entertainment.ViewModels.MediaItemModel.augment(immersiveMediaItem);
+ navigationPromise = immersiveMediaItem.hydrate().then(MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver).then(function _onHydrated() {
+ return new WinJS.Promise(function initializePromise(complete) {
+ var immersiveOptions = {
+ startFullScreen: false, completeCallback: complete, forceDetails: true
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({dataContext: {data: immersiveMediaItem}}, immersiveOptions)
+ })
+ }).then(function _waitForImmersive(navigated) {
+ if (!navigated) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.clearBackStackOnNextNavigate(false)
+ }
+ return WinJS.Promise.timeout(1)
+ }).then(function _showMediaPopover() {
+ this._showPopover(popOverMediaItem, popoverConstructor)
+ }.bind(this));
+ return navigationPromise
+ }, _showImmersiveAndPopover: function _showImmersiveAndPopover(popOverMediaItem, immersiveMediaItem, popoverConstructor) {
+ if (!popOverMediaItem || !popOverMediaItem.hasServiceId || (!popOverMediaItem.hasArtistServiceId && MS.Entertainment.Utilities.isMusicApp) || !immersiveMediaItem)
+ return WinJS.Promise.wrapError(new Error("Invalid media object or id. Cannot execute to navigate to immersive details and show a pop-over."));
+ var navigationPromise;
+ MS.Entertainment.ViewModels.MediaItemModel.augment(immersiveMediaItem);
+ navigationPromise = immersiveMediaItem.hydrate().then(MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver).then(function _onHydrated() {
+ return new WinJS.Promise(function initializePromise(complete) {
+ var immersiveOptions = {
+ startFullScreen: false, completeCallback: complete
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(immersiveMediaItem, immersiveOptions)
+ })
+ }).then(function _waitForImmersive(navigated) {
+ if (!navigated) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.clearBackStackOnNextNavigate(false)
+ }
+ return WinJS.Promise.timeout()
+ }).then(function _showMediaPopover() {
+ this._showPopover(popOverMediaItem, popoverConstructor)
+ }.bind(this));
+ return navigationPromise
+ }, _getFreePlayPromise: function _getFreePlayPromise(media, isSeason) {
+ var freePlayPromise = WinJS.Promise.wrap(false);
+ var bestFreeRight = null;
+ if (isSeason)
+ bestFreeRight = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getBestFreeSeasonRight(media);
+ else
+ bestFreeRight = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getBestFreeRight(media, false);
+ if (bestFreeRight) {
+ var offerId = bestFreeRight.offerId;
+ var currencyCode = bestFreeRight.priceCurrencyCode;
+ var purchaseType = MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_BUY;
+ if (bestFreeRight.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent || bestFreeRight.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream)
+ purchaseType = MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_RENT;
+ freePlayPromise = MS.Entertainment.Platform.PurchaseHelpers.freePurchaseFlow(media, offerId, currencyCode, purchaseType, true, bestFreeRight.signedOffer, bestFreeRight, MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.deepLink).then(function freeJustPlaysInvoked() {
+ return WinJS.Promise.wrap(true)
+ }, function freeJustPlaysErrors() {
+ return WinJS.Promise.wrap(false)
+ })
+ }
+ return freePlayPromise
+ }, _showVideoImmersive: function _showVideoImmersive(media, params) {
+ MS.Entertainment.UI.Components.Shell.assert(media, "_showVideoImmersive. media argument is invalid");
+ var autoPlay = params.autoPlay;
+ var startPaused = params.startPaused;
+ var autoPlayPreview = params.autoPlayPreview && !!media.videoPreviewUrl;
+ if (autoPlayPreview)
+ media.playPreviewOnly = true;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var isMovie = MS.Entertainment.Platform.PlaybackHelpers.isMovie(media);
+ var isSeries = MS.Entertainment.Platform.PlaybackHelpers.isTVSeries(media);
+ var isSeason = MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(media);
+ var isEpisode = MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(media);
+ var canPlay = false;
+ var navToDetails = true;
+ var getVideoToPlayPromise = WinJS.Promise.wrap();
+ if ((autoPlay || autoPlayPreview || startPaused) && (!isSeries || configurationManager.video.videoPlaySeasonDeepLinkEnabled))
+ if (isSeries || isSeason) {
+ var hydrateSeries = WinJS.Promise.wrap();
+ var series = isSeason ? null : media;
+ var season = isSeason ? media : null;
+ if (isSeason) {
+ series = MS.Entertainment.Utilities.convertMediaItemToTvSeries(media);
+ hydrateSeries = media.hydrate()
+ }
+ getVideoToPlayPromise = hydrateSeries.then(function onSeriesHydrated() {
+ var episodeProgressionHelper = new MS.Entertainment.Components.Video.EpisodeProgressionHelper(series);
+ return episodeProgressionHelper.findNextEpisode(season).then(function foundWNR(results) {
+ if (results && results.episode && (!season || season.seasonNumber === results.episode.seasonNumber)) {
+ var playMedia = results.episode;
+ canPlay = playMedia.inCollection;
+ return WinJS.Promise.wrap(playMedia)
+ }
+ else if (season)
+ return this._getFreePlayPromise(season, true).then(function onGetFreePurchase(succeeded) {
+ canPlay = false;
+ navToDetails = !succeeded;
+ return WinJS.Promise.wrap(null)
+ }.bind(this));
+ else {
+ canPlay = false;
+ return WinJS.Promise.wrap(null)
+ }
+ }.bind(this))
+ }.bind(this))
+ }
+ else if (isMovie || isEpisode) {
+ getVideoToPlayPromise = WinJS.Promise.wrap(media);
+ canPlay = (media.inCollection || autoPlayPreview) && !media.isPresale
+ }
+ getVideoToPlayPromise.then(function gotVideoToPlay(video) {
+ if (!video)
+ return WinJS.Promise.wrap(null);
+ if (video && (video.inCollection || autoPlayPreview))
+ return WinJS.Promise.wrap(video);
+ return this._getFreePlayPromise(video, false).then(function onGetFreePurchase(succeeded) {
+ canPlay = false;
+ navToDetails = !video.inCollection;
+ return WinJS.Promise.wrap(video)
+ }.bind(this))
+ }.bind(this)).then(function handleMedia(video) {
+ if (canPlay && video)
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(video, {
+ autoPlay: autoPlay && !startPaused, playPreviewOnly: autoPlayPreview, startPositionMsec: params.startPositionMsec, showImmersive: true, immersiveOptions: {
+ startFullScreen: true, forcePageChange: true
+ }, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.deeplink
+ });
+ else if (navToDetails)
+ if (isEpisode && MS.Entertainment.Utilities.isVideoApp1)
+ this._showItemDetailsAndPopover(media, media, MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl());
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({dataContext: {data: media}}, {forceDetails: true})
+ }.bind(this))
+ }
+ }), DeepLinkPlayAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Components.Shell.DeepLinkMarketplaceRequiredAction", function() {
+ this.base()
+ }, {executed: function executed(params) {
+ MS.Entertainment.UI.Components.Shell.assert(params.id, "DeepLinkDetailsAction: params.id not defined");
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (MS.Entertainment.Utilities.isMusicApp && !isMusicMarketplaceEnabled) {
+ MS.Entertainment.UI.Components.Shell._navigateToDefaultPage();
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/MessageBox.html", "messageBoxTemplate", true).done(function onLoadCompleted() {
+ WinJS.Promise.timeout().done(function _showNonMarketplaceError() {
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_TITLE), String.load(String.id.IDS_MUSIC_DEEPLINK_NON_MARKETPLACE_ERROR_DESC))
+ })
+ }, function onLoadError(error) {
+ MS.Entertainment.UI.Components.Shell.fail("failed to load MessageBox loadTemplate for deeplink play action: " + error && error.message)
+ });
+ return
+ }
+ var marketplaceLogic = new MS.Entertainment.UI.Components.Shell.MarketplaceFeaturesLogic;
+ var mediaPromise = null;
+ if (params.desiredMediaItemType)
+ mediaPromise = MS.Entertainment.Platform.PlaybackHelpers.getMusicMediaByServiceId(params.id, params.idType, params.desiredMediaItemType);
+ else
+ mediaPromise = MS.Entertainment.Platform.PlaybackHelpers.getMediaByServiceId(params.id, params.idType);
+ mediaPromise.then(null, function onPlaylistErrorTryCollection(errorCode) {
+ if (params.desiredMediaItemType && params.desiredMediaItemType.toLowerCase() === MS.Entertainment.Data.Query.edsMediaType.musicPlaylist.toLowerCase())
+ return MS.Entertainment.UI.Actions.Playlists.queryPlaylistById(params.id, true).then(null, function fallbackOnLibraryPlaylist(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ return MS.Entertainment.UI.Actions.Playlists.getCloudPlaylist(params.id);
+ return WinJS.Promise.wrapError(error)
+ });
+ return WinJS.Promise.wrapError(errorCode)
+ }).done(function getMediaByServiceIdSuccess(media) {
+ if (!MS.Entertainment.Utilities.isMusicApp)
+ media.addProperty("playFromXbox", true);
+ var appSignIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var pollAttempt = 0;
+ checkSignInStatus();
+ function letsTryToPlay() {
+ MS.Entertainment.UI.Components.Shell.assert(appSignIn.isSignedIn || appSignIn.signInError, "signing in process should be finished!");
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService).showDialogForNonCriticalErrors = true;
+ switch (media.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ playTrackOrAlbum();
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ playArtistOrSmartDJ();
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ if (media.count > 0)
+ marketplaceLogic.deepLinkPlayMedia2(media, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, startPositionMsec: params.startPositionMsec, showImmersive: true, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true
+ }
+ });
+ break;
+ default:
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicVideo(media))
+ playTrackOrAlbum();
+ else
+ marketplaceLogic.deepLinkPlayMedia2(media, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, startPositionMsec: params.startPositionMsec, showImmersive: true, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true
+ }
+ })
+ }
+ }
+ function playTrackOrAlbum() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var playAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.playMedia);
+ playAction.automationId = MS.Entertainment.UI.AutomationIds.deepLinkPlay;
+ playAction.parameter = {
+ mediaItem: media, autoPlay: true, showImmersive: MS.Entertainment.Utilities.isMusicApp2, showDetails: false, showAppBar: true, startPositionMsec: params.startPositionMsec
+ };
+ marketplaceLogic.processDeepLinkAction(playAction);
+ var adService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.adService) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (adService && signInService.isSignedIn && !signedInUserService.isSubscription)
+ adService.playVideoAdIfRequired(media).done(function playVideoAdIfRequired_complete(adPlayedIfNeeded) {
+ if (adPlayedIfNeeded)
+ playAction.execute()
+ }, function playVideoAdIfRequired_failed(error) {
+ MS.Entertainment.UI.Components.Shell.fail("playVideoAdIfRequired_failed: " + error && error.message);
+ playAction.execute()
+ });
+ else
+ playAction.execute()
+ }
+ function playArtistOrSmartDJ() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var playAction = null;
+ if (params.playSmartDJ) {
+ playAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.playSmartDJ);
+ playAction.automationId = MS.Entertainment.UI.AutomationIds.deepLinkPlaySmartDJ
+ }
+ else {
+ playAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.playArtist);
+ playAction.automationId = MS.Entertainment.UI.AutomationIds.deepLinkPlayArtist
+ }
+ playAction.parameter = {
+ mediaItem: media, autoPlay: true, showImmersive: false, showDetails: false, showAppBar: true, startPositionMsec: params.startPositionMsec
+ };
+ marketplaceLogic.processDeepLinkAction(playAction);
+ playAction.execute()
+ }
+ function checkSignInStatus() {
+ if (appSignIn.isSigningIn)
+ var signingInBindings = WinJS.Binding.bind(appSignIn, {isSigningIn: function onIsSigningInChanged(isSigningIn, isSigningInOld) {
+ if (isSigningInOld !== undefined && !isSigningIn) {
+ letsTryToPlay();
+ signingInBindings.cancel()
+ }
+ }});
+ else
+ letsTryToPlay()
+ }
+ }, function getMediaByServiceIdError(errorCode) {
+ if (errorCode)
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_MEDIA_ERROR_CAPTION), errorCode);
+ MS.Entertainment.UI.Components.Shell._navigateToDefaultPage()
+ })
+ }}), DeepLinkPlayToAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Components.Shell.DeepLinkMarketplaceRequiredAction", function() {
+ this.base()
+ }, {executed: function executed(params) {
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.playToSpinner)
+ }}), DeepLinkPlayPinAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Components.Shell.DeepLinkMarketplaceRequiredAction", function() {
+ this.base()
+ }, {
+ executed: function executed(params) {
+ MS.Entertainment.UI.Components.Shell.assert(params.id, "DeepLinkPlayPinAction: params.id not defined");
+ var media = null;
+ var canPlay = false;
+ this._getMediaItemAsync(params).then(function _getMediaItemAsync_complete(mediaItem) {
+ if (!mediaItem)
+ return WinJS.Promise.wrapError("Could not find media item.");
+ media = mediaItem;
+ return this._waitForSigningInCompleteAsync()
+ }.bind(this)).then(function _waitForSigningInCompleteAsync_complete() {
+ switch (media.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ return this._navigateToMediaItemAsync(media, false);
+ default:
+ return MS.Entertainment.ViewModels.SmartBuyStateEngine.queryMediaStateAsync(media).then(function queryMediaStateAsync_complete(stateInfo) {
+ canPlay = stateInfo.canPlay || (MS.Entertainment.Utilities.isMusicApp && this._canStreamMusicMediaItem(media));
+ return this._navigateToMediaItemAsync(media, canPlay)
+ }.bind(this))
+ }
+ }.bind(this)).then(function _navigateToMediaItemAsync_complete() {
+ if (canPlay)
+ return this._playMediaItemAsync(media, params);
+ return WinJS.Promise.wrap()
+ }.bind(this)).done(function _playMediaItemAsync_complete() {
+ return WinJS.Promise.wrap()
+ }, function executePlayPinDeepLink_error(errorCode) {
+ if (errorCode)
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_MEDIA_ERROR_CAPTION), errorCode);
+ MS.Entertainment.UI.Components.Shell._navigateToDefaultPage()
+ })
+ }, _canStreamMusicMediaItem: function _canStreamMusicMediaItem(media) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (configurationManager.service.lastSignedInUserSubscription)
+ return true;
+ if (signIn.isSignedIn) {
+ var isFreeTrialCompleted = true;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits))
+ isFreeTrialCompleted = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits).isFreeTrialCompleted;
+ if (!isFreeTrialCompleted)
+ return true
+ }
+ return false
+ }, _showImmersiveAndPopoverAsync: function _showImmersiveAndPopoverAsync(popOverMediaItem, immersiveMediaItem, popoverConstructor) {
+ if (!popOverMediaItem || !popOverMediaItem.hasServiceId || (!popOverMediaItem.hasArtistServiceId && MS.Entertainment.Utilities.isMusicApp) || !immersiveMediaItem)
+ return WinJS.Promise.wrapError(new Error("Invalid media object or id. Cannot excute to navigate to immersive details and show a pop-over."));
+ MS.Entertainment.ViewModels.MediaItemModel.augment(immersiveMediaItem);
+ return immersiveMediaItem.hydrate().then(MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver).then(function hydrate_complete() {
+ return new WinJS.Promise(function showImmersiveForMedia(complete) {
+ var immersiveOptions = {
+ startFullScreen: false, completeCallback: complete
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(immersiveMediaItem, immersiveOptions)
+ })
+ }).then(function waitForShowImmersiveToComplete() {
+ return WinJS.Promise.timeout()
+ }).then(MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver).then(function dismissCurrentPopOver_complete() {
+ var popOverParameters = {
+ itemConstructor: popoverConstructor, dataContext: {
+ data: popOverMediaItem, location: MS.Entertainment.Data.ItemLocation.marketplace
+ }
+ };
+ MS.Entertainment.UI.Controls.PopOver.showPopOver(popOverParameters).done();
+ return WinJS.Promise.wrap()
+ })
+ }, _navigateToMediaItemAsync: function _navigateToMediaItemAsync(media, attemptingToAutoPlay) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.clearBackStackOnNextNavigate(true);
+ MS.Entertainment.ViewModels.MediaItemModel.augment(media);
+ if (!media.hydrate)
+ return WinJS.Promise.wrap();
+ return media.hydrate().then(function hydrate_complete() {
+ if (!media.hasZuneId && MS.Entertainment.Utilities.isVideoApp)
+ return WinJS.Promise.wrap();
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(media) && !attemptingToAutoPlay)
+ return this._showImmersiveAndPopoverAsync(media, media, MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl());
+ else {
+ var immersiveOptions = {startFullScreen: false};
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(media, immersiveOptions);
+ return WinJS.Promise.wrap()
+ }
+ }.bind(this), function hydrate_error(e) {
+ return WinJS.Promise.wrapError(new Error("Cannot navigate to the media because it could not be hydrated. Error message: " + (e && e.message)))
+ })
+ }, _playMediaItemAsync: function _playMediaItemAsync(media, params) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService)) {
+ var playbackErrorDisplayService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService);
+ playbackErrorDisplayService.showDialogForNonCriticalErrors = false
+ }
+ if (MS.Entertainment.Utilities.isMusicApp)
+ return this._playMusicMediaItemAsync(media, params);
+ else {
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(media, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, startPositionMsec: params.startPositionMsec, showImmersive: true, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.deepLink, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true
+ }
+ });
+ return WinJS.Promise.wrap()
+ }
+ }, _playMusicMediaItemAsync: function _playMusicMediaItemAsync(media, params) {
+ return this._playAdIfRequiredAsync(media, params).then(function _playAdIfRequiredAsync_complete(canPlayContent) {
+ if (canPlayContent) {
+ var marketplaceLogic = new MS.Entertainment.UI.Components.Shell.MarketplaceFeaturesLogic;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var playAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.playMedia);
+ playAction.automationId = MS.Entertainment.UI.AutomationIds.deepLinkPlay;
+ playAction.parameter = {
+ mediaItem: media, autoPlay: true, showImmersive: true, showDetails: false, showAppBar: true, startPositionMsec: params.startPositionMsec
+ };
+ marketplaceLogic.processDeepLinkAction(playAction);
+ playAction.execute()
+ }
+ return WinJS.Promise.wrap()
+ })
+ }, _playAdIfRequiredAsync: function _playAdIfRequiredAsync(media, params) {
+ var checkIfAdRequired = (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.track || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.album);
+ if (checkIfAdRequired) {
+ var adService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (adService && signInService.isSignedIn && !signedInUserService.isSubscription)
+ return adService.playVideoAdIfRequired(media)
+ }
+ return WinJS.Promise.wrap(true)
+ }, _getMediaItemAsync: function _getMediaItemAsync(params) {
+ if (!params.idType)
+ return MS.Entertainment.Utilities.createMediaItemByLibraryInfo(params.id, params.mediaType);
+ else {
+ var media;
+ return MS.Entertainment.Platform.PlaybackHelpers.getMediaByServiceId(params.id, params.idType).then(function getMediaByServiceId_success(mediaItem) {
+ media = mediaItem;
+ MS.Entertainment.ViewModels.MediaItemModel.augment(media);
+ return media.hydrate()
+ }).then(function _getMediaItemAsync_complete() {
+ return WinJS.Promise.wrap(media)
+ }, function _getMediaItemAsync_error(error) {
+ return MS.Entertainment.ViewModels.MediaItemModel.getLibraryIdAsync({
+ zuneId: params.id, seriesZuneId: params.seriesZuneId, seasonNumber: params.seasonNumber, mediaType: params.mediaType, libraryId: -1
+ }).then(function getLibraryIdAsync_complete(libraryId) {
+ return MS.Entertainment.Utilities.createMediaItemByLibraryInfo(libraryId, params.mediaType)
+ }.bind(this))
+ }.bind(this))
+ }
+ }, _waitForSigningInCompleteAsync: function _waitForSigningInComplete() {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (!signInService.isSigningIn)
+ return WinJS.Promise.wrap(signInService);
+ return new WinJS.Promise(function(complete, error, progress) {
+ if (signInService.isSigningIn)
+ var signingInBindings = WinJS.Binding.bind(signInService, {isSigningIn: function onIsSigningInChanged(isSigningIn, isSigningInOld) {
+ if (isSigningInOld !== undefined && !isSigningIn) {
+ complete();
+ signingInBindings.cancel()
+ }
+ }});
+ else
+ complete()
+ })
+ }
+ }), DeepLinkSearchAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Components.Shell.DeepLinkMarketplaceRequiredAction", function() {
+ this.base()
+ }, {executed: function executed(params) {
+ MS.Entertainment.UI.Components.Shell.assert(params.query, "DeepLinkSearchAction: params.query not defined");
+ MS.Entertainment.ViewModels.SearchContractViewModel._navigateToSearchPage({keyword: params.query})
+ }}), DeepLinkLaunchTitleAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {executed: function executed(params) {
+ MS.Entertainment.UI.Components.Shell.assert(params.titleId, "DeepLinkLaunchTitleAction: params.titleId not defined");
+ MS.Entertainment.UI.Components.Shell.assert(params.mediaType, "DeepLinkLaunchTitleAction: params.mediaType not defined");
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var session = sessionMgr.lrcSession;
+ var titleId = params.titleId;
+ var serviceId = params.serviceId;
+ var serviceIdType = params.serviceIdType || MS.Entertainment.Data.Query.edsIdType.zuneCatalog;
+ var mediaType = params.mediaType;
+ var startPositionMsec = params.startPositionMsec;
+ var deepLinkInfo = params.deepLinkInfo;
+ var getMediaItem = null;
+ if (deepLinkInfo)
+ deepLinkInfo = decodeURIComponent(deepLinkInfo);
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ getMediaItem = MS.Entertainment.Platform.PlaybackHelpers.getGameMediaByTitleId(titleId);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ getMediaItem = MS.Entertainment.Platform.PlaybackHelpers.getMusicMediaByServiceId(serviceId, serviceIdType, MS.Entertainment.Data.Query.edsMediaType.musicArtist);
+ break;
+ default:
+ if (serviceId)
+ getMediaItem = MS.Entertainment.Platform.PlaybackHelpers.getMediaByServiceId(serviceId);
+ else if (titleId)
+ getMediaItem = MS.Entertainment.Platform.PlaybackHelpers.getGameMediaByTitleId(titleId);
+ break
+ }
+ getMediaItem.then(function getMediaItemSuccess(media) {
+ MS.Entertainment.Platform.PlaybackHelpers.playMediaOnXbox(media, titleId, deepLinkInfo, startPositionMsec)
+ }, function getMediaItemFailed(errorCode) {
+ if (mediaType === Microsoft.Entertainment.Queries.ObjectType.video && titleId && deepLinkInfo) {
+ var fakeMedia = new MS.Entertainment.Data.Augmenter.Marketplace.VideoBase;
+ MS.Entertainment.Platform.PlaybackHelpers.playMediaOnXbox(fakeMedia, titleId, deepLinkInfo, startPositionMsec)
+ }
+ else {
+ if (errorCode)
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_MEDIA_ERROR_CAPTION), errorCode);
+ MS.Entertainment.UI.Components.Shell._navigateToDefaultPage()
+ }
+ })
+ }}), DeepLinkShowPerfTrackLog: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {
+ automationId: "deepLinkShowPerfTrackLog", executed: function executed(params) {
+ MS.Entertainment.UI.Components.Shell.assert(params.enable !== undefined, "DeepLinkShowPerfTrackLog: params.enable not defined");
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ config.generalSettings.showPerfTrackLog = params.enable
+ }
+ }), DeepLinkConfigureMemoryLeakTracking: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {
+ automationId: "deepLinkConfigureMemoryLeakTracking", executed: function executed(params) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configurationManager.shell.attachCookieToRemovedDomElements = params.enable;
+ configurationManager.shell.attachLargeObjectToUnloadedControl = params.enable
+ }
+ }), DeepLinkVideoProtocolConverter: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {executed: function executed(params) {
+ var action = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkDetails);
+ var actionParams = {
+ id: params.ContentID, idType: MS.Entertainment.Data.Query.edsIdType.canonical, desiredMediaItemType: params.ContentType
+ };
+ if (this.command === "media-playback") {
+ var playState = params.PlayState && params.PlayState.toLocaleLowerCase();
+ var startPaused = playState === MS.Entertainment.UI.DeepLink.PlayStateType.pause;
+ actionParams.startPaused = startPaused;
+ actionParams.autoPlay = !startPaused
+ }
+ {};
+ if (params.Time) {
+ var matches = /^([0-9][0-9]):([0-9][0-9]):([0-9][0-9])$/g.exec(params.Time);
+ if (matches && matches.length === 4) {
+ var hours = parseInt(matches[1]) || 0;
+ var minutes = parseInt(matches[2]) || 0;
+ var seconds = parseInt(matches[3]) || 0;
+ var startPositionMsec = 0;
+ startPositionMsec += (hours * 3600000);
+ startPositionMsec += (minutes * 60000);
+ startPositionMsec += (seconds * 1000);
+ actionParams.startPositionMsec = startPositionMsec
+ }
+ }
+ action.automationId = MS.Entertainment.UI.AutomationIds.deepLink;
+ action.parameter = actionParams;
+ action.execute()
+ }}), DeepLinkXBLDefaultAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {
+ automationId: "deepLinkXBLDefaultAction", executed: function executed(params) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!navigationService.currentPage)
+ navigationService.navigateToDefaultPage();
+ if (String.isString(params.PlayState)) {
+ var playbackSession;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ if (playbackSession)
+ switch (params.PlayState.toLowerCase()) {
+ case MS.Entertainment.UI.DeepLink.PlayStateType.play:
+ if (playbackSession.currentMedia)
+ switch (playbackSession.currentTransportState) {
+ case MS.Entertainment.Platform.Playback.TransportState.paused:
+ playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ break;
+ case MS.Entertainment.Platform.Playback.TransportState.stopped:
+ if (playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.error)
+ MS.Entertainment.Platform.PlaybackHelpers.showPlaybackError(playbackSession.errorDescriptor);
+ else if (playbackSession.pendingOrdinal >= 0)
+ playbackSession.playAt(playbackSession.pendingOrdinal);
+ break
+ }
+ else if (playbackSession.pendingOrdinal >= 0)
+ playbackSession.playAt(playbackSession.pendingOrdinal);
+ break;
+ case MS.Entertainment.UI.DeepLink.PlayStateType.pause:
+ if (playbackSession.currentMedia && playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ break
+ }
+ }
+ }
+ }), DeepLinkXBLDetailsAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {
+ automationId: "deepLinkXBLDetailsAction", executed: function executed(params) {
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkDetails);
+ if (!action.automationId)
+ action.automationId = MS.Entertainment.UI.AutomationIds.deepLink;
+ var isArtist = params.ContentType && params.ContentType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.musicArtist.toLocaleLowerCase();
+ action.parameter = {
+ id: params.ContentID, desiredMediaItemType: params.ContentType, idType: MS.Entertainment.Data.Query.edsIdType.canonical, dialogOnly: !isArtist, navigationDelay: params.navigationDelay
+ };
+ action.execute()
+ }
+ }), DeepLinkXBLPlaybackAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {
+ automationId: "deepLinkXBLPlaybackAction", executed: function executed(params) {
+ if (MS.Entertainment.Utilities.isMusicApp2 && !MS.Entertainment.Utilities.appRegionMatchesMachineRegion()) {
+ var navigationTimeout = WinJS.Promise.timeout(params.navigationDelay || 0);
+ return navigationTimeout.then(function navigationTimeoutComplete() {
+ return MS.Entertainment.UI.Shell.showRegionMismatchDialog(String.load(String.id.IDS_MUSIC2_REGION_MISMATCH_CANT_DEEPLINK_HEADER), String.load(String.id.IDS_MUSIC2_REGION_MISMATCH_CANT_DEEPLINK_BODY))
+ }).then(function messageBoxDismissed(regionData) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateToDefaultPage();
+ return WinJS.Promise.wrapError(new Error("DeepLinkActions::_deepLinkXBLPlaybackAction: App region doesn't match console region. App Region: {0} Console Region: {1}".format(regionData.appRegionCode, regionData.machineRegionCode)))
+ })
+ }
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlay);
+ if (!action.automationId)
+ action.automationId = MS.Entertainment.UI.AutomationIds.deepLink;
+ action.parameter = {
+ id: params.ContentID, desiredMediaItemType: params.ContentType, idType: MS.Entertainment.Data.Query.edsIdType.canonical, playSmartDJ: params.PlaySmartDJ
+ };
+ action.execute()
+ }
+ }), DeepLinkTunerConfigAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.deepLinkTunerConfig, executed: function executed(params) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.flighting.deeplinkTunerConfigEnabled)
+ if (configurationManager[params.namespace])
+ configurationManager[params.namespace][params.key] = params.value;
+ MS.Entertainment.UI.Components.Shell._navigateToDefaultPage(true)
+ }
+ }), _navigateToDefaultPage: function _navigateToDefaultPage(initService) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (initService && !navigationService.currentPage) {
+ var iaService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ if (iaService && !iaService.isInitialized)
+ iaService.initialize();
+ navigationService.init()
+ }
+ navigationService.navigateToDefaultPage()
+ }
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateToDefault()
+ }
+ }
+ });
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLocation, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkLocationAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlay, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkPlayAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlayTo, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkPlayToAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlayPin, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkPlayPinAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkDetails, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkDetailsAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkSearch, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkSearchAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLaunchTitle, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkLaunchTitleAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkShowPerfTrackLog, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkShowPerfTrackLog
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkConfigureMemoryLeakTracking, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkConfigureMemoryLeakTracking
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkVideoProtocolConverter, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkVideoProtocolConverter
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkXBLDefault, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkXBLDefaultAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkXBLDetails, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkXBLDetailsAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkXBLPlayback, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkXBLPlaybackAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deeplinkTunerConfig, function() {
+ return new MS.Entertainment.UI.Components.Shell.DeepLinkTunerConfigAction
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/DragDataService.js b/packages/microsoft.zunevideo/Components/shell/DragDataService.js
new file mode 100644
index 00000000..90666e80
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/DragDataService.js
@@ -0,0 +1,76 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Components) {
+ (function(Shell) {
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Components.Shell");
+ var DragDataService = (function() {
+ function DragDataService() {
+ var _this = this;
+ this._draggedItem = null;
+ this._draggedItemPromise = null;
+ this._documentDragEndHandler = null;
+ this._documentDragEndHandler = MS.Entertainment.Utilities.addEventHandlers(document.body, {dragend: function() {
+ if (_this._hasDragData) {
+ Shell.fail("DragDataService::onDragEndEvent: Drag data needs to be cleaned up by the component that called DragDataService::startDrag.");
+ _this.finishDrag()
+ }
+ }})
+ }
+ Object.defineProperty(DragDataService.prototype, "_hasDragData", {
+ get: function() {
+ return !!(this.draggedItem || this.draggedItemPromise)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DragDataService.prototype, "draggedItem", {
+ get: function() {
+ return this._draggedItem
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(DragDataService.prototype, "draggedItemPromise", {
+ get: function() {
+ return this._draggedItemPromise
+ }, enumerable: true, configurable: true
+ });
+ DragDataService.prototype.startDrag = function(draggedItemPromise) {
+ var _this = this;
+ Shell.assert(!this._hasDragData, "DragDataService::draggedItemPromise: Attempted to set a new drag context without clearing existing context.");
+ Shell.assert(draggedItemPromise, "DragDataService::draggedItemPromise: Attempted to start a drag operation without valid drag data.");
+ this._draggedItemPromise = draggedItemPromise && draggedItemPromise.then(function(item) {
+ Shell.assert(item && item.data, "DragDataService::draggedItemPromise: Expected to get item from dragged item promise.");
+ _this._draggedItem = item;
+ return _this._draggedItem
+ }, function(error) {
+ Shell.fail("DragDataService::draggedItemPromise: Failed to get item from promise: " + (error && error.message));
+ _this._draggedItem = null;
+ return WinJS.Promise.wrapError(error)
+ })
+ };
+ DragDataService.prototype.finishDrag = function() {
+ if (this._draggedItemPromise) {
+ this._draggedItemPromise.cancel();
+ this._draggedItemPromise = null
+ }
+ this._draggedItem = null;
+ var dragCompleteEvent = document.createEvent("Event");
+ dragCompleteEvent.initEvent(DragDataService.dragCompleteEvent, true, false);
+ document.body.dispatchEvent(dragCompleteEvent)
+ };
+ DragDataService.dragCompleteEvent = "dragComplete";
+ return DragDataService
+ })();
+ Shell.DragDataService = DragDataService;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.dragData, function() {
+ return new DragDataService
+ })
+ })(Components.Shell || (Components.Shell = {}));
+ var Shell = Components.Shell
+ })(UI.Components || (UI.Components = {}));
+ var Components = UI.Components
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Components/shell/FrontHubStrip.html b/packages/microsoft.zunevideo/Components/shell/FrontHubStrip.html
new file mode 100644
index 00000000..6b1d9f85
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/FrontHubStrip.html
@@ -0,0 +1,22 @@
+
+
+
+
+ Front Hub Strip Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/shell/FrontHubStrip.js b/packages/microsoft.zunevideo/Components/shell/FrontHubStrip.js
new file mode 100644
index 00000000..5ddce8d4
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/FrontHubStrip.js
@@ -0,0 +1,84 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Controls/hubstrip.js", "/Framework/corefx.js", "/Framework/serviceLocator.js");
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Shell");
+ WinJS.Namespace.define("MS.Entertainment.UI.Shell", {FrontHubStrip: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Shell.GalleryHubStrip", null, function constructFrontHubStrip() {
+ this._callShowElementOnHubLoad = false;
+ this._showPageTitle = true;
+ this._showAppPreview = true;
+ this._showPivots = false;
+ this._pageTitle = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).applicationTitle
+ }, {
+ controlName: "FrontHubStrip", getPageTitleFromNavigationService: false, _networkStatusBinding: null, _currentState: MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown, _isFrozen: false, initialize: function initialize() {
+ this._scroller.addEventListener("scroll", function() {
+ this._suppressOtherMoveToScrolling = true
+ }.bind(this));
+ MS.Entertainment.UI.Shell.GalleryHubStrip.prototype.initialize.apply(this, arguments);
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ this._onNetworkStatusChanged(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).networkStatus);
+ if (MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp) {
+ this.leftEdgeOffset = 120;
+ this.leftPanelOffset = 120
+ }
+ else {
+ this.leftEdgeOffset = 0;
+ this.leftPanelOffset = 0
+ }
+ this.rightEdgeOffset = 50
+ }, unload: function unload() {
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ MS.Entertainment.UI.Shell.GalleryHubStrip.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._isFrozen = true;
+ MS.Entertainment.UI.Shell.GalleryHubStrip.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Shell.GalleryHubStrip.prototype.thaw.call(this);
+ this._isFrozen = false;
+ this._onNetworkStatusChanged(this._currentState)
+ }, runHubStripAnimation: function runHubStripAnimation() {
+ var stripShownPromise = new WinJS.Promise.wrap;
+ stripShownPromise = this.moveTo(this.defaultIndex, true, true).then(function animateIn() {
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFirstLaunch) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFirstLaunch = false;
+ MS.Entertainment.Animations.HubStrip.showHubStrip(this._navigationContainer.domElement.parentElement, this._scroller).then(function updatePosition() {
+ this._updatePanelAnimations(this._scrollLeft);
+ this._focusFirstElement(this.hubs[this.defaultIndex])
+ }.bind(this))
+ }
+ else {
+ this._scroller.style.opacity = "1";
+ this._navigationContainer.domElement.parentElement.style.opacity = "1"
+ }
+ }.bind(this));
+ return stripShownPromise
+ }, _focusFirstElement: function _focusFirstElement(hub) {
+ if (hub && hub.domElement)
+ this._keyboardNavigationManager.focusFirstItemInContainer(hub.domElement, false)
+ }, setupAnimations: function setupAnimations() {
+ WinJS.Utilities.addClass(this._navigationContainer.domElement, "enterPageOffset2");
+ this._navigationContainer.domElement.setAttribute("data-ent-hideanimation", "exitPage");
+ this._navigationContainer.domElement.setAttribute("data-ent-showanimation", "enterPage")
+ }, _onCurrentHubChanged: function _onCurrentHubChanged() {
+ MS.Entertainment.UI.Shell.GalleryHubStrip.prototype._onCurrentHubChanged.apply(this, arguments)
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newValue) {
+ if (!this._isFrozen)
+ switch (newValue) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ WinJS.Utilities.removeClass(this.domElement, "offline");
+ break;
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ WinJS.Utilities.addClass(this.domElement, "offline");
+ break
+ }
+ this._currentState = newValue
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/GalleryHubStrip.html b/packages/microsoft.zunevideo/Components/shell/GalleryHubStrip.html
new file mode 100644
index 00000000..2127eac7
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/GalleryHubStrip.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Front Hub Strip Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/shell/GalleryHubStrip.js b/packages/microsoft.zunevideo/Components/shell/GalleryHubStrip.js
new file mode 100644
index 00000000..2f62f92b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/GalleryHubStrip.js
@@ -0,0 +1,112 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Controls/hubstrip.js", "/Framework/corefx.js", "/Framework/serviceLocator.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Shell", {GalleryHubStrip: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.HubStrip", null, function constructGalleryHubStrip() {
+ this._callShowElementOnHubLoad = true;
+ this._showPageTitle = true;
+ this._showPivots = true
+ }, {
+ _lastLoadedPage: null, _keyboardNavigationManager: null, getPageTitleFromNavigationService: true, _onCurrentHubChanged: function _onCurrentHubChanged() {
+ if (this.selectedIndex !== -1) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var currentHubMoniker = this.hubs[this.selectedIndex].id;
+ if (this._lastLoadedPage === WinJS.Binding.unwrap(navigation.currentPage))
+ if (navigation.currentHub.iaNode.moniker !== currentHubMoniker)
+ navigation.navigateTo(null, currentHubMoniker)
+ }
+ }, controlName: "GalleryHubStrip", initialize: function initialize() {
+ MS.Entertainment.UI.Controls.HubStrip.prototype.initialize.apply(this, arguments);
+ this.leftEdgeOffset = 0;
+ this.leftPanelOffset = 125;
+ this.rightEdgeOffset = 50;
+ if (this._callShowElementOnHubLoad) {
+ MS.Entertainment.Utilities.hideElement(this._scroller);
+ MS.Entertainment.Utilities.hideElement(this._navigationContainer.domElement)
+ }
+ this.setupAnimations(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigationDirection);
+ this.bind("selectedIndex", this._onCurrentHubChanged.bind(this));
+ this._keyboardNavigationManager = new MS.Entertainment.Framework.KeyboardNavigationManager(this._scroller, this._scroller);
+ if (this._navigationContainer)
+ this._navigationContainer.setTabPanel(this._scroller)
+ }, freeze: function freeze() {
+ if (this._initialized)
+ this.setupAnimations(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigationDirection);
+ MS.Entertainment.UI.Controls.HubStrip.prototype.freeze.call(this)
+ }, setupAnimations: function setupAnimations(navigationDirection) {
+ if (!navigationDirection)
+ navigationDirection = MS.Entertainment.Navigation.NavigationDirection.forward;
+ if (this._scroller && this._scroller.hasAttribute("data-ent-hideanimation"))
+ WinJS.Utilities.removeClass(this._scroller, this._scroller.getAttribute("data-ent-hideanimation"));
+ if (this._scroller && this._scroller.hasAttribute("data-ent-showanimation"))
+ WinJS.Utilities.removeClass(this._scroller, this._scroller.getAttribute("data-ent-showanimation"));
+ if (this._scroller) {
+ this._scroller.removeAttribute("data-ent-hideanimation");
+ this._scroller.removeAttribute("data-ent-showanimation")
+ }
+ if (this._navigationContainer.domElement.hasAttribute("data-ent-hideanimation"))
+ WinJS.Utilities.removeClass(this._navigationContainer.domElement, this._navigationContainer.domElement.getAttribute("data-ent-hideanimation"));
+ if (this._navigationContainer.domElement.hasAttribute("data-ent-showanimation"))
+ WinJS.Utilities.removeClass(this._navigationContainer.domElement, this._navigationContainer.domElement.getAttribute("data-ent-showanimation"));
+ this._navigationContainer.domElement.removeAttribute("data-ent-hideanimation");
+ this._navigationContainer.domElement.removeAttribute("data-ent-showanimation");
+ this._navigationContainer.domElement.setAttribute("data-ent-hideanimation", "exitPage");
+ this._navigationContainer.domElement.setAttribute("data-ent-showanimation", "enterPage");
+ WinJS.Utilities.addClass(this._navigationContainer, "enterPageOffset2");
+ if (this._scroller) {
+ this._scroller.setAttribute("data-ent-showanimation", "enterPage");
+ this._scroller.setAttribute("data-ent-hideanimation", "exitPage");
+ WinJS.Utilities.addClass(this._scroller, "enterPageOffset3")
+ }
+ }, onNavigateTo: function onNavigateTo(page, hub, panel) {
+ var destinationHubIndex;
+ var destinationPanelIndex;
+ if (this._lastLoadedPage !== page) {
+ this.id = page.iaNode.moniker;
+ this.isolateHubs = page.useStaticHubStrip;
+ this.hubs = page.hubs.map(function mapHubToHub(viewHub) {
+ var fragment = viewHub.overrideFragmentUrl || null;
+ var newHub = new MS.Entertainment.UI.Controls.HubStrip.Hub(viewHub.iaNode.moniker, viewHub.title, fragment, {
+ page: page, hub: viewHub
+ });
+ destinationPanelIndex = Math.max(viewHub.iaNode.children.indexOf(viewHub.iaNode.defaultChild), 0);
+ newHub.defaultPanelIndex = destinationPanelIndex;
+ newHub.panels = viewHub.panels.map(function createPanelData(viewPanel) {
+ var fragment = viewPanel.fragmentUrl || null;
+ var newPanel = new MS.Entertainment.UI.Controls.HubStrip.Panel(viewPanel.iaNode.moniker, viewPanel.title, fragment, null, {
+ page: page, hub: viewHub, panel: viewPanel
+ });
+ newPanel.showShadow = viewPanel.showShadow;
+ newPanel.hub = newHub;
+ return newPanel
+ });
+ return newHub
+ });
+ this._lastLoadedPage = page
+ }
+ destinationHubIndex = page.hubs.indexOf(hub);
+ if (destinationHubIndex !== this.selectedIndex)
+ this.moveTo(destinationHubIndex)
+ }, shift: function shift(direction) {
+ if (this.isolateHubs)
+ return;
+ var isRightKey = (direction === MS.Entertainment.UI.Actions.ShiftDashboard.Direction.right);
+ var isLeftKey = (direction === MS.Entertainment.UI.Actions.ShiftDashboard.Direction.left);
+ var currentPosition;
+ var desiredPosition;
+ if (isRightKey || isLeftKey) {
+ currentPosition = this.selectedIndex;
+ desiredPosition = currentPosition;
+ if (isRightKey) {
+ if (currentPosition < this._scroller.childNodes.length - 1)
+ desiredPosition = currentPosition + 1
+ }
+ else if (isLeftKey)
+ if (currentPosition > 0)
+ desiredPosition = currentPosition - 1;
+ this.moveTo(desiredPosition, true);
+ this._keyboardNavigationManager.focusFirstItemInContainer(this._scroller.childNodes[this.selectedIndex], true)
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/ListNotification.js b/packages/microsoft.zunevideo/Components/shell/ListNotification.js
new file mode 100644
index 00000000..80f47f24
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/ListNotification.js
@@ -0,0 +1,388 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ var ListNotification = (function() {
+ function ListNotification(){}
+ ListNotification.createNotification = function(category, messageText, detailsText, actionIds, actionOptionsArray, hidden, automationId, isDissmissable) {
+ var notification = new UI.Notification;
+ notification.category = category;
+ notification.icon = category.icon;
+ notification.title = messageText;
+ notification.subTitle = detailsText;
+ notification.actions = actionIds;
+ notification.actionParamsArray = actionOptionsArray;
+ notification.visible = !hidden;
+ notification.automationId = automationId;
+ if (isDissmissable) {
+ notification.dismissAction = UI.Actions.ActionIdentifiers.notificationClear;
+ notification.dismissActionParams = {category: category}
+ }
+ else
+ notification.dismissIcon = String.empty;
+ return notification
+ };
+ return ListNotification
+ })();
+ UI.ListNotification = ListNotification;
+ var NotificationCategory = (function() {
+ function NotificationCategory(priority, name, icon, firstTimeOnly, completed, visible) {
+ this.priority = priority;
+ this.name = name;
+ this.icon = icon;
+ this.firstTimeOnly = firstTimeOnly;
+ this.completed = completed;
+ this.visible = visible
+ }
+ return NotificationCategory
+ })();
+ UI.NotificationCategory = NotificationCategory;
+ (function(NotificationCategoryNames) {
+ NotificationCategoryNames[NotificationCategoryNames["userEngagementContent"] = 0] = "userEngagementContent";
+ NotificationCategoryNames[NotificationCategoryNames["networkStatus"] = 1] = "networkStatus";
+ NotificationCategoryNames[NotificationCategoryNames["localContent"] = 2] = "localContent";
+ NotificationCategoryNames[NotificationCategoryNames["partialContent"] = 3] = "partialContent";
+ NotificationCategoryNames[NotificationCategoryNames["cloudContent"] = 4] = "cloudContent";
+ NotificationCategoryNames[NotificationCategoryNames["cloudContentV2"] = 5] = "cloudContentV2";
+ NotificationCategoryNames[NotificationCategoryNames["explicitPrivileges"] = 6] = "explicitPrivileges";
+ NotificationCategoryNames[NotificationCategoryNames["playbackPrivileges"] = 7] = "playbackPrivileges"
+ })(UI.NotificationCategoryNames || (UI.NotificationCategoryNames = {}));
+ var NotificationCategoryNames = UI.NotificationCategoryNames;
+ var NotificationCategoryEnum = (function() {
+ function NotificationCategoryEnum(){}
+ NotificationCategoryEnum.isCollectionCategory = function(category) {
+ return category && (category.name === UI.NotificationCategoryNames[4] || category.name === UI.NotificationCategoryNames[5] || category.name === UI.NotificationCategoryNames[2] || category.name === UI.NotificationCategoryNames[1] || category.name === UI.NotificationCategoryNames[3] || category.name === UI.NotificationCategoryNames[0])
+ };
+ NotificationCategoryEnum.isCloudStorageCategory = function(category) {
+ return false
+ };
+ NotificationCategoryEnum.userEngagementContent = new NotificationCategory(0, NotificationCategoryNames[0], UI.Icon.notification, false);
+ NotificationCategoryEnum.networkStatus = new NotificationCategory(1, NotificationCategoryNames[1], UI.Icon.inlineStreaming, true);
+ NotificationCategoryEnum.localContent = new NotificationCategory(2, NotificationCategoryNames[2], UI.Icon.inlineNotification, true);
+ NotificationCategoryEnum.partialContent = new NotificationCategory(3, NotificationCategoryNames[3], UI.Icon.notification, false);
+ NotificationCategoryEnum.cloudContent = new NotificationCategory(4, NotificationCategoryNames[4], UI.Icon.devices, true);
+ NotificationCategoryEnum.explicitPrivileges = new NotificationCategory(6, NotificationCategoryNames[6], UI.Icon.notification, true);
+ NotificationCategoryEnum.playbackPrivileges = new NotificationCategory(6, NotificationCategoryNames[7], UI.Icon.notification, false);
+ NotificationCategoryEnum.cloudContentV2 = new NotificationCategory(5, NotificationCategoryNames[5], UI.Icon.oneDrive, true);
+ return NotificationCategoryEnum
+ })();
+ UI.NotificationCategoryEnum = NotificationCategoryEnum;
+ var ListNotificationService = (function(_super) {
+ __extends(ListNotificationService, _super);
+ function ListNotificationService() {
+ _super.call(this);
+ this._notificationVersionExpected = 1;
+ ListNotificationService._instanceCount++;
+ MS.Entertainment.UI.assert(ListNotificationService._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.listNotification);");
+ this._loadStoredNotifications()
+ }
+ Object.defineProperty(ListNotificationService.prototype, "notifications", {
+ get: function() {
+ var availableNotifications = this._notifications.filter(function(item) {
+ return !item.acknowledged && item.visible
+ });
+ if (ListNotificationService._notificationFilter)
+ availableNotifications = availableNotifications.filter(ListNotificationService._notificationFilter);
+ return availableNotifications
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ListNotificationService.prototype, "localAppSettings", {
+ get: function() {
+ var storedData = null;
+ if (Entertainment.Utilities.isApp1)
+ try {
+ storedData = Windows.Storage.ApplicationData.current.localSettings.values[ListNotificationService._localStorageKey]
+ }
+ catch(e) {
+ MS.Entertainment.fail("Failed to read from local app settings for the list notification service with the following error: " + e.toString())
+ }
+ return storedData
+ }, set: function(value) {
+ if (Entertainment.Utilities.isApp1)
+ try {
+ Windows.Storage.ApplicationData.current.localSettings.values[ListNotificationService._localStorageKey] = value
+ }
+ catch(e) {
+ MS.Entertainment.fail("Failed to write to local app settings for the list notification service with the following error: " + e.toString())
+ }
+ }, enumerable: true, configurable: true
+ });
+ ListNotificationService.applyCustonNotificationFilter = function(value) {
+ ListNotificationService._notificationFilter = value;
+ return {cancel: function() {
+ ListNotificationService._notificationFilter = null
+ }}
+ };
+ ListNotificationService.prototype.createAndSend = function(category, messageText, detailsText, actionIds, actionParamsArray, completeCategory, hidden, automationId) {
+ var notification = ListNotification.createNotification(category, messageText, detailsText, actionIds, actionParamsArray, hidden, automationId, true);
+ this.send(notification);
+ if (completeCategory)
+ notification.category.completed = true;
+ return notification
+ };
+ ListNotificationService.prototype.send = function(notification) {
+ MS.Entertainment.UI.assert(notification, "Null notification sent to the list notification service.");
+ var index = this.indexOfNotificationByCategory(notification.category);
+ if (index >= 0) {
+ if (this._notifications[index].category.completed)
+ return;
+ if (notification.category.firstTimeOnly && this._notifications[index].acknowledged)
+ return;
+ Entertainment.Utilities.Telemetry.logNotification(notification);
+ this._notifications[index] = notification;
+ this._notifications[index].acknowledged = false;
+ this.storeNotifications();
+ this.dispatchEvent(ListNotificationService.sendNotificationReceived, notification)
+ }
+ else {
+ Entertainment.Utilities.Telemetry.logNotification(notification, true);
+ this._notifications.push(notification);
+ this.storeNotifications();
+ this.dispatchEvent(ListNotificationService.sendNotificationReceived, notification)
+ }
+ };
+ ListNotificationService.prototype.clear = function(category, removeFromList) {
+ MS.Entertainment.UI.assert(category, "Cannot clear list notifications without category.");
+ var index = this.indexOfNotificationByCategory(category);
+ if (index >= 0) {
+ if (removeFromList)
+ this._notifications.splice(index, 1);
+ else
+ this._notifications[index].acknowledged = true;
+ this.storeNotifications();
+ this.dispatchEvent(ListNotificationService.clearNotificationReceived, category)
+ }
+ };
+ ListNotificationService.prototype.reset = function() {
+ this._notifications = [];
+ this.localAppSettings = []
+ };
+ ListNotificationService.prototype.getNotificationByCategory = function(category) {
+ var matches = this._notifications.filter(function(item) {
+ return item.category.name === category.name
+ });
+ return matches && matches.length > 0 ? matches[0] : null
+ };
+ ListNotificationService.prototype.indexOfNotificationByCategory = function(category) {
+ var notification = this.getNotificationByCategory(category);
+ return notification ? this._notifications.indexOf(notification) : -1
+ };
+ ListNotificationService.prototype.storeNotifications = function() {
+ this._notifications.sort(function(notification1, notification2) {
+ var notification1Pri = notification1 && notification1.category && notification1.category.priority ? notification1.category.priority : -1;
+ var notification2Pri = notification2 && notification2.category && notification2.category.priority ? notification2.category.priority : -1;
+ if (notification1Pri === notification2Pri)
+ return 0;
+ else if (notification1Pri > notification2Pri)
+ return 1;
+ else
+ return -1
+ });
+ var notificationsToSave = this._notifications.filter(function(item) {
+ return item.category.firstTimeOnly === true
+ });
+ try {
+ this.localAppSettings = JSON.stringify(notificationsToSave)
+ }
+ catch(error) {
+ MS.Entertainment.fail("Failed to stringify notifications to local storage with the following error: " + (error && error.message))
+ }
+ };
+ ListNotificationService.prototype._upgrade = function() {
+ var _this = this;
+ if (this._notifications) {
+ var notificationstoClear = this._notifications.filter(function(notification) {
+ return (!(notification.category.firstTimeOnly && notification.acknowledged) || !notification.category.completed)
+ });
+ notificationstoClear.forEach(function(notification) {
+ _this.clear(notification.category, true)
+ })
+ }
+ };
+ ListNotificationService.prototype._loadStoredNotifications = function() {
+ var _this = this;
+ var storedNotifications = this.localAppSettings;
+ if (storedNotifications)
+ try {
+ this._notifications = JSON.parse(storedNotifications)
+ }
+ catch(e) {
+ MS.Entertainment.fail("Failed to load notifications from local storage with the following error: " + e.toString())
+ }
+ if (!this._notifications || !Array.isArray(this._notifications))
+ this._notifications = [];
+ this._notifications = this._notifications.map(function(notification) {
+ return new UI.Notification(notification)
+ });
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var currentNotificationVersion = configurationManager.shell.notificationVersion || 0;
+ if (currentNotificationVersion < this._notificationVersionExpected) {
+ this._upgrade();
+ WinJS.Promise.timeout(30000).done(function() {
+ try {
+ configurationManager.shell.notificationVersion = _this._notificationVersionExpected
+ }
+ catch(error) {
+ UI.fail("ListNotification::_loadStoredNotifications. A failure occurred when trying to write the upgraded notification version back to the config store. Error message: " + (error && error.message), String.empty, UI.Debug.errorLevel.low)
+ }
+ }, function(timeOutFailure) {
+ UI.fail("ListNotification::_loadStoredNotifications. A failure occurred in the wait timeout for setting the notification version. Error message: " + (timeOutFailure && timeOutFailure.message), String.empty, UI.Debug.errorLevel.low)
+ })
+ }
+ };
+ ListNotificationService.factory = function() {
+ return new ListNotificationService
+ };
+ ListNotificationService._instanceCount = 0;
+ ListNotificationService._localStorageKey = "MusicNotifications";
+ ListNotificationService._notificationFilter = null;
+ ListNotificationService.sendNotificationReceived = "sendNotificationReceived";
+ ListNotificationService.clearNotificationReceived = "clearNotificationReceived";
+ return ListNotificationService
+ })(UI.Framework.ObservableBase);
+ UI.ListNotificationService = ListNotificationService;
+ var ObservableListNotificationAdapter = (function(_super) {
+ __extends(ObservableListNotificationAdapter, _super);
+ function ObservableListNotificationAdapter(filterAllGlobalNotifications, filterCallback) {
+ _super.call(this);
+ this._applyGlobalNotifications = !filterAllGlobalNotifications;
+ this._filterCallback = filterCallback;
+ this._initializeNotificationList()
+ }
+ ObservableListNotificationAdapter.prototype.dispose = function() {
+ this._isDisposed = true;
+ this._releaseGlobalNotifications();
+ this._filterCallback = null
+ };
+ Object.defineProperty(ObservableListNotificationAdapter.prototype, "dataSource", {
+ get: function() {
+ return this._dataSource
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ObservableListNotificationAdapter.prototype, "filterCallback", {
+ get: function() {
+ return this._filterCallback
+ }, set: function(value) {
+ if (!this._isDisposed)
+ this._filterCallback = value
+ }, enumerable: true, configurable: true
+ });
+ ObservableListNotificationAdapter.prototype.isEqual = function(adapter) {
+ var isEqual = this === adapter;
+ if (!isEqual && adapter)
+ isEqual = (!this.dataSource || this.dataSource.length === 0) && (!adapter.dataSource || adapter.dataSource.length === 0);
+ if (!isEqual && adapter && adapter.dataSource && this.dataSource && adapter.dataSource.length === this.dataSource.length) {
+ var thisItems = {};
+ var itemKey = null;
+ var item = null;
+ for (var i = 0; i < this.dataSource.length; i++) {
+ item = this.dataSource.item(i);
+ try {
+ itemKey = JSON.stringify(item, this._stringifyReplacer.bind(this))
+ }
+ catch(error) {
+ UI.fail("Failed to stringify this data. error: " + (error && error.message));
+ thisItems = null;
+ break
+ }
+ thisItems[itemKey] = thisItems[itemKey] ? thisItems[itemKey] + 1 : 1
+ }
+ if (thisItems) {
+ isEqual = true;
+ for (var j = 0; j < adapter.dataSource.length; j++) {
+ item = adapter.dataSource.item(j);
+ try {
+ itemKey = JSON.stringify(item, this._stringifyReplacer.bind(this))
+ }
+ catch(error) {
+ UI.fail("Failed to stringify adapter data. error: " + (error && error.message));
+ isEqual = false;
+ break
+ }
+ if (thisItems[itemKey] > 0)
+ thisItems[itemKey] = thisItems[itemKey] - 1;
+ else
+ isEqual = false
+ }
+ }
+ }
+ return isEqual
+ };
+ ObservableListNotificationAdapter.prototype.append = function(items) {
+ if (this.dataSource)
+ this.dataSource.spliceArray(this.dataSource.length, 0, items)
+ };
+ ObservableListNotificationAdapter.prototype._filterNotifications = function(notification) {
+ var result = false;
+ if (this.filterCallback)
+ result = this.filterCallback(notification);
+ return result
+ };
+ ObservableListNotificationAdapter.prototype._stringifyReplacer = function(key, value) {
+ if (key === "actionParams")
+ return String.empty;
+ else
+ return value
+ };
+ ObservableListNotificationAdapter.prototype._releaseGlobalNotifications = function() {
+ if (this._notificationServiceHandlers) {
+ this._notificationServiceHandlers.cancel();
+ this._notificationServiceHandlers = null
+ }
+ };
+ ObservableListNotificationAdapter.prototype._initializeNotificationList = function() {
+ var globalNotifications = null;
+ var result = null;
+ var listNotificationService;
+ this._releaseGlobalNotifications();
+ if (this._applyGlobalNotifications && Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.listNotification))
+ listNotificationService = Entertainment.ServiceLocator.getService(Entertainment.Services.listNotification);
+ if (listNotificationService) {
+ globalNotifications = new Entertainment.ObservableArray(listNotificationService.notifications.filter(this._filterNotifications.bind(this)));
+ this._notificationServiceHandlers = Entertainment.Utilities.addEventHandlers(listNotificationService, {
+ clearNotificationReceived: this._onClearNotification.bind(this), sendNotificationReceived: this._onSendNotification.bind(this)
+ })
+ }
+ this._setDataSource(globalNotifications)
+ };
+ ObservableListNotificationAdapter.prototype._setDataSource = function(value) {
+ this.updateAndNotify("dataSource", value || new Entertainment.ObservableArray)
+ };
+ ObservableListNotificationAdapter.prototype._onSendNotification = function(args) {
+ if (args && args.detail && this.dataSource && this._filterNotifications(args.detail))
+ this.dataSource.push(args.detail)
+ };
+ ObservableListNotificationAdapter.prototype._onClearNotification = function(args) {
+ var removeIndex = -1;
+ if (args && args.detail && this.dataSource)
+ this.dataSource.some(function(notification, index, items) {
+ if (notification && notification.category && args.detail && notification.category.name === args.detail.name) {
+ removeIndex = index;
+ return true
+ }
+ else
+ return false
+ });
+ if (removeIndex >= 0)
+ this.dataSource.splice(removeIndex, 1)
+ };
+ return ObservableListNotificationAdapter
+ })(UI.Framework.ObservableBase);
+ UI.ObservableListNotificationAdapter = ObservableListNotificationAdapter
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.listNotification, MS.Entertainment.UI.ListNotificationService.factory)
diff --git a/packages/microsoft.zunevideo/Components/shell/PrimaryNavigationButton.js b/packages/microsoft.zunevideo/Components/shell/PrimaryNavigationButton.js
new file mode 100644
index 00000000..0b7cbfa9
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/PrimaryNavigationButton.js
@@ -0,0 +1,16 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/servicelocator.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Shell", {PrimaryNavigationButton: MS.Entertainment.UI.Framework.defineUserControl(null, function PrimaryNavigationButton(){}, {
+ controlName: "PrimaryNavigationButton", index: -1, initialize: function initialize() {
+ this.domElement.addEventListener("click", function() {
+ if (this.domElement.doClick)
+ this.domElement.doClick.call(this.domElement)
+ }.bind(this))
+ }
+ }, {})})
+})();
+(function runVoiceMixins() {
+ MS.Entertainment.Utilities.runVoicePropertyMixins(MS.Entertainment.UI.Shell.PrimaryNavigationButton)
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/ShellKeyboardShortcuts.js b/packages/microsoft.zunevideo/Components/shell/ShellKeyboardShortcuts.js
new file mode 100644
index 00000000..65dce4fb
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/ShellKeyboardShortcuts.js
@@ -0,0 +1,78 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.UI.Shell", {createShellKeyboardShortcuts: function createShellKeyboardShortcuts() {
+ var openFileAction;
+ var navigateBackAction;
+ var shortcutManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shortcutManager);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var monikers = MS.Entertainment.UI.Monikers;
+ if (actionService.isRegistered(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate) && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ navigateBackAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateBackAction.automationId = "keyboardNavigateBack";
+ navigateBackAction.parameter = MS.Entertainment.UI.Actions.navigate.NavigateLocation.back
+ }
+ if (MS.Entertainment.Utilities.isApp2) {
+ if (actionService.isRegistered(MS.Entertainment.UI.Actions.ActionIdentifiers.invokeGlobalCommand)) {
+ var invokeGlobalCommandAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.invokeGlobalCommand);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.invokeGlobalCommand, allowInEditControls: false
+ }, invokeGlobalCommandAction);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ alt: true, key: WinJS.Utilities.Key.enter, allowInEditControls: false
+ }, invokeGlobalCommandAction)
+ }
+ if (actionService.isRegistered(MS.Entertainment.UI.Actions.ActionIdentifiers.search)) {
+ var startSearch = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.search);
+ startSearch.startWithExistingQuery = true;
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.searchButton, allowInEditControls: false
+ }, startSearch);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ alt: true, key: WinJS.Utilities.Key.y, allowInEditControls: false
+ }, startSearch)
+ }
+ if (navigateBackAction)
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.dismissButton, allowInEditControls: false
+ }, navigateBackAction);
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ var skipBackwardAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.skipBackward);
+ var skipForwardAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.skipForward);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.ltButton, allowInEditControls: false
+ }, skipBackwardAction);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.pageUp, allowInEditControls: false
+ }, skipBackwardAction);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.rtButton, allowInEditControls: false
+ }, skipForwardAction);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.pageDown, allowInEditControls: false
+ }, skipForwardAction)
+ }
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp) {
+ openFileAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.openFile);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ ctrl: true, key: WinJS.Utilities.Key.o, allowInEditControls: false
+ }, openFileAction)
+ }
+ if (navigateBackAction && !window.onNewVideoPage) {
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ ctrl: true, key: WinJS.Utilities.Key.b, allowInEditControls: false
+ }, navigateBackAction);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.backspace, allowInEditControls: false
+ }, navigateBackAction);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ alt: true, key: WinJS.Utilities.Key.leftArrow, allowInEditControls: false
+ }, navigateBackAction);
+ shortcutManager.registerShortcut(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, {
+ key: WinJS.Utilities.Key.browserBack, allowInEditControls: false
+ }, navigateBackAction)
+ }
+ }})
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/SnappedMode.html b/packages/microsoft.zunevideo/Components/shell/SnappedMode.html
new file mode 100644
index 00000000..6fb44d16
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/SnappedMode.html
@@ -0,0 +1,22 @@
+
+
+
+
+ Snapped Mode Template
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/Components/shell/SnappedMode.js b/packages/microsoft.zunevideo/Components/shell/SnappedMode.js
new file mode 100644
index 00000000..03a28965
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/SnappedMode.js
@@ -0,0 +1,356 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/debug.js", "/Framework/corefx.js", "/Framework/servicelocator.js");
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Components.Shell");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Components.Shell", {
+ SnappedMode: MS.Entertainment.UI.Framework.defineUserControl("/Components/Shell/SnappedMode.html#snappedModeTemplate", function snappedModeConstructor(element, options){}, {}), initializeSnappedMode: function initializeSnappedMode() {
+ var snappedElement = document.getElementById("htmlSnapped");
+ var unsnappedElement = document.getElementById("htmlUnsnapped");
+ var snappedUserControlElement = null;
+ var didMoveNowPlaying = false;
+ var transferredSnapToVideoNowPlaying = false;
+ var unsnappedFocusRoot = null;
+ var unsnappedContentContainer = null;
+ var unsnappedActiveElement = null;
+ var _uiStateEventHandler = null;
+ var controlsFrozen = false;
+ var _currentMediaPromise = null;
+ var freezeControls = function freezeControls() {
+ var itemsToFreeze = [];
+ var currentPage = document.querySelector("#pageContainer .currentPage");
+ if (currentPage)
+ itemsToFreeze.push(currentPage);
+ var overlays = document.querySelectorAll(".overlayAnchor:not(.noFreeze)");
+ Array.prototype.forEach.call(overlays, function(overlay) {
+ itemsToFreeze.push(overlay)
+ });
+ itemsToFreeze.forEach(function(item) {
+ MS.Entertainment.Utilities.freezeControlsInSubtree(item)
+ });
+ controlsFrozen = true
+ };
+ var thawControls = function thawControls() {
+ var itemsToThaw = [];
+ var currentPage = document.querySelector("#pageContainer .currentPage");
+ if (currentPage)
+ itemsToThaw.push(currentPage);
+ var overlays = document.querySelectorAll(".overlayAnchor:not(.noFreeze)");
+ Array.prototype.forEach.call(overlays, function(overlay) {
+ itemsToThaw.push(overlay)
+ });
+ itemsToThaw.forEach(function(item) {
+ MS.Entertainment.Utilities.thawControlsInSubtree(item)
+ });
+ controlsFrozen = false
+ };
+ var captureFocusState = function captureFocusState(targetContainer) {
+ if (MS.Entertainment.UI.Framework.currentContentContainer === targetContainer)
+ return;
+ MS.Entertainment.UI.Framework.addOverlayContainer(targetContainer);
+ if (document.activeElement && (document.activeElement !== document.body))
+ unsnappedActiveElement = document.activeElement;
+ if (WinJS.UI.AutomaticFocus) {
+ unsnappedFocusRoot = WinJS.UI.AutomaticFocus.focusRoot;
+ MS.Entertainment.UI.Framework.setFocusRoot(targetContainer)
+ }
+ };
+ var restoreFocusState = function restoreFocusState() {
+ MS.Entertainment.UI.Framework.removeOverlayContainer(snappedUserControlElement);
+ if (MS.Entertainment.Utilities.isApp2) {
+ if (!unsnappedFocusRoot)
+ unsnappedFocusRoot = document.querySelector("#pageContainer .currentPage");
+ if (unsnappedFocusRoot) {
+ MS.Entertainment.UI.Framework.setFocusRoot(unsnappedFocusRoot);
+ if (unsnappedActiveElement)
+ MS.Entertainment.UI.Framework.focusElement(unsnappedActiveElement);
+ else
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(unsnappedFocusRoot);
+ unsnappedFocusRoot = null
+ }
+ }
+ };
+ var navigateOnMedia = function navigateOnMedia(newValue, oldValue) {
+ if (oldValue === undefined)
+ return;
+ if (_currentMediaPromise) {
+ _currentMediaPromise.cancel();
+ _currentMediaPromise = null
+ }
+ if (newValue) {
+ if (!didMoveNowPlaying) {
+ if (snappedUserControlElement) {
+ MS.Entertainment.Utilities.empty(snappedUserControlElement);
+ MS.Entertainment.UI.Framework.removeOverlayContainer(snappedUserControlElement)
+ }
+ else {
+ snappedUserControlElement = document.createElement("div");
+ snappedElement.appendChild(snappedUserControlElement)
+ }
+ snappedUserControlElement.className = "musicSnappedNowPlaying snappedContainer win-ui-dark";
+ captureFocusState(snappedUserControlElement);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingTileVisible = false;
+ var controlElement = document.createElement("div");
+ controlElement.setAttribute("class", "nowPlayingControl");
+ controlElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.SnappedNowPlaying");
+ var nowPlayingControl = new MS.Entertainment.UI.Controls.SnappedNowPlaying(controlElement, {});
+ snappedUserControlElement.appendChild(nowPlayingControl.domElement);
+ didMoveNowPlaying = true
+ }
+ }
+ else
+ _currentMediaPromise = WinJS.Promise.timeout(1500).then(function createBrowseScreen() {
+ createSnapBrowseScreen()
+ })
+ };
+ var createSnapBrowseScreen = function createSnapBrowseScreen() {
+ var snappedTemplate = MS.Entertainment.Utilities.isMusicApp2 ? "/Components/Music/MusicSharedTemplates.html#music2SnappedTemplate" : "/Components/Music/MusicSharedTemplates.html#musicSnappedTemplate";
+ WinJS.Utilities.addClass(unsnappedElement, "hideFromDisplay");
+ MS.Entertainment.UI.Framework.loadTemplate(snappedTemplate).then(function renderControl(controlInstance) {
+ var dataContext = WinJS.Binding.as({unsnapAction: MS.Entertainment.UI.Components.Shell.getUnsnapAction()});
+ if (snappedUserControlElement) {
+ MS.Entertainment.Utilities.empty(snappedUserControlElement);
+ MS.Entertainment.UI.Framework.removeOverlayContainer(snappedUserControlElement)
+ }
+ else {
+ snappedUserControlElement = document.createElement("div");
+ snappedElement.appendChild(snappedUserControlElement)
+ }
+ didMoveNowPlaying = false;
+ return controlInstance.render(dataContext, snappedUserControlElement)
+ }.bind(this)).done(function templateLoadingShowContent() {
+ captureFocusState(snappedUserControlElement);
+ if (MS.Entertainment.Utilities.isApp2)
+ WinJS.Promise.timeout(500).done(function setFocus() {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(snappedUserControlElement)
+ })
+ });
+ freezeControls()
+ };
+ var snapMusic = function snapMusic() {
+ WinJS.Utilities.addClass(document.body, "snapped");
+ WinJS.Utilities.removeClass(snappedElement, "hideFromDisplay");
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ return;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.isSnapped = true;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionMgr.primarySession && sessionMgr.primarySession.currentMedia) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (MS.Entertainment.Utilities.isMusicApp2 || !uiStateService.nowPlayingVisible || !navigationService.currentPage || !navigationService.currentPage.iaNode || !(navigationService.currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.immersiveDetails || navigationService.currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.fullScreenNowPlaying)) {
+ WinJS.Utilities.addClass(unsnappedElement, "hideFromDisplay");
+ freezeControls();
+ navigateOnMedia(true, false)
+ }
+ else
+ WinJS.Utilities.addClass(snappedElement, "hideFromDisplay")
+ }
+ else
+ createSnapBrowseScreen();
+ sessionMgr.primarySession.bind("currentMedia", navigateOnMedia)
+ };
+ var unSnapMusic = function unSnapMusic() {
+ if (_currentMediaPromise) {
+ _currentMediaPromise.cancel();
+ _currentMediaPromise = null
+ }
+ WinJS.Utilities.removeClass(document.body, "snapped");
+ WinJS.Utilities.removeClass(unsnappedElement, "hideFromDisplay");
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ return;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ restoreFocusState();
+ uiStateService.isSnapped = false;
+ if (didMoveNowPlaying) {
+ var nowPlayingControl = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).getNowPlayingControl(MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying);
+ sessionMgr.relocateSession(nowPlayingControl, false);
+ didMoveNowPlaying = false
+ }
+ sessionMgr.primarySession.unbind("currentMedia", navigateOnMedia);
+ if (controlsFrozen)
+ thawControls();
+ if (uiStateService.nowPlayingConstrainedMode && !uiStateService.isFullScreenMusic)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: sessionMgr.primarySession.sessionId, startFullScreen: false
+ });
+ snappedUserControlElement = null;
+ WinJS.Utilities.addClass(snappedElement, "hideFromDisplay");
+ MS.Entertainment.Utilities.empty(snappedElement);
+ if (appBar)
+ appBar.hide()
+ };
+ var handleVideoErrorOnPlayback = function handleVideoErrorOnPlayback(currentPlayerState) {
+ if (currentPlayerState === MS.Entertainment.Platform.Playback.PlayerState.error && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ unSnapVideo();
+ WinJS.Promise.timeout(1).done(function delayReSnap() {
+ snapVideo(false)
+ })
+ }
+ };
+ var snapVideo = function snapVideo(transferSnapToVideoNowPlaying) {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ return;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ var moniker = WinJS.Utilities.getMember("currentPage.iaNode.moniker", navigationService);
+ var inNowPlaying = moniker === MS.Entertainment.UI.Monikers.fullScreenNowPlaying;
+ if (MS.Entertainment.Utilities.isVideoApp2 && (inNowPlaying || transferSnapToVideoNowPlaying) && !transferredSnapToVideoNowPlaying) {
+ transferredSnapToVideoNowPlaying = true;
+ WinJS.Utilities.addClass(unsnappedElement, "app2NowPlayingSnappedMode");
+ WinJS.Utilities.removeClass(unsnappedElement, "hideFromDisplay");
+ WinJS.Utilities.addClass(snappedElement, "hideFromDisplay");
+ WinJS.Utilities.addClass(document.body, "snapped");
+ if (snappedUserControlElement)
+ cleanupDefaultVideoSnapControl();
+ var mainHeader = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.mainHeader);
+ mainHeader.visibility = false;
+ WinJS.Promise.timeout(1000).then(function delayFocus() {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(MS.Entertainment.UI.Framework.currentFocusContainer, true, true)
+ })
+ }
+ else if (!transferSnapToVideoNowPlaying) {
+ if (transferredSnapToVideoNowPlaying) {
+ transferredSnapToVideoNowPlaying = false;
+ cleanupNowPlayingVideoSnapControl()
+ }
+ MS.Entertainment.UI.Components.Shell.assert(!snappedUserControlElement, "Did not clean up the previous snap controls.");
+ snappedUserControlElement = document.createElement("div");
+ snappedElement.appendChild(snappedUserControlElement);
+ new MS.Entertainment.UI.Components.Shell.SnappedMode(snappedUserControlElement, {});
+ captureFocusState(snappedUserControlElement);
+ WinJS.Utilities.addClass(unsnappedElement, "hideFromDisplay");
+ freezeControls();
+ WinJS.Utilities.removeClass(snappedElement, "hideFromDisplay")
+ }
+ playbackSession.bind("playerState", handleVideoErrorOnPlayback)
+ };
+ var unSnapVideo = function unSnapVideo() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ return;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ playbackSession.unbind("playerState", handleVideoErrorOnPlayback);
+ if (transferredSnapToVideoNowPlaying) {
+ transferredSnapToVideoNowPlaying = false;
+ cleanupNowPlayingVideoSnapControl()
+ }
+ cleanupDefaultVideoSnapControl();
+ uiStateService.updateAndNotify("isSnapped", false).done(function _delay() {
+ var actualControl = snappedControlsToRemove.pop();
+ while (actualControl) {
+ snappedElement.removeChild(actualControl);
+ actualControl = snappedControlsToRemove.pop()
+ }
+ }, function error() {
+ MS.Entertainment.fail("Error setting uiStateService.isSnapped")
+ })
+ };
+ var cleanupDefaultVideoSnapControl = function cleanupDefaultVideoSnapControl() {
+ thawControls();
+ WinJS.Utilities.removeClass(unsnappedElement, "hideFromDisplay");
+ WinJS.Utilities.addClass(snappedElement, "hideFromDisplay");
+ restoreFocusState();
+ snappedControlsToRemove.push(snappedUserControlElement);
+ snappedUserControlElement = null
+ };
+ var cleanupNowPlayingVideoSnapControl = function cleanupNowPlayingVideoSnapControl() {
+ WinJS.Utilities.removeClass(unsnappedElement, "app2NowPlayingSnappedMode");
+ WinJS.Utilities.removeClass(document.body, "snapped");
+ var mainHeader = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.mainHeader);
+ mainHeader.visibility = true
+ };
+ var matchSnappedWatcher = matchMedia("all and (min-width: 320px) and (max-width: 480px)");
+ var onSnappedMode = function onSnappedMode(matchSnapped) {
+ if (matchSnapped.matches) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped = true;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ snapMusic();
+ else {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var moviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var hasNoDashboard = !moviesMarketplaceEnabled && !tvMarketplaceEnabled && MS.Entertainment.Utilities.isVideoApp2;
+ if (uiStateService.stageThreeActivated || hasNoDashboard)
+ snapVideo();
+ else if (!_uiStateEventHandler)
+ _uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(uiStateService, {stageThreeActivatedChanged: function stageThreeActivatedChanged(activateEvent) {
+ var stageThreeActivated = activateEvent.detail.newValue;
+ var isSnapped = matchSnapped.matches;
+ if (stageThreeActivated && isSnapped) {
+ snapVideo();
+ _uiStateEventHandler.cancel();
+ _uiStateEventHandler = null
+ }
+ }})
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).switchedToSnappedMode()
+ }
+ };
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ document.addEventListener("SnappedMode_TransferSnapOwnershipToNowPlaying", function() {
+ snapVideo(true)
+ });
+ document.addEventListener("SnappedMode_TransferSnapOwnershipToDefault", function() {
+ snapVideo(false)
+ })
+ }
+ matchSnappedWatcher.addListener(onSnappedMode);
+ if (matchSnappedWatcher.matches)
+ onSnappedMode(matchSnappedWatcher);
+ var snappedControlsToRemove = [];
+ var matchUnsnappedWatcher = matchMedia("all and (min-width: 481px)");
+ var onUnsnappedMode = function onUnsnappedMode(matchUnsnapped) {
+ if (matchUnsnapped.matches) {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ unSnapMusic();
+ else
+ unSnapVideo();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).switchedToUnsnappedMode()
+ }
+ };
+ matchUnsnappedWatcher.addListener(onUnsnappedMode);
+ if (MS.Entertainment.Utilities.isApp2) {
+ var matchFilledWatcher = matchMedia("all and (min-width: 481px) and (max-width: 1919px)");
+ matchFilledWatcher.addListener(function onFilledMode(matchFilled) {
+ if (matchFilled.matches)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFilled = true
+ });
+ var matchNonfilledWatcher = matchMedia("all and (min-width: 1920px), all and (min-width: 320px) and (max-width: 480px)");
+ matchNonfilledWatcher.addListener(function onNonfilledMode(matchNonfilled) {
+ if (matchNonfilled.matches)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFilled = false
+ });
+ if (matchFilledWatcher.matches)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFilled = true
+ }
+ }, getUnsnapAction: function getUnsnapAction() {
+ var UnsnapButtonAction = MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function unsnapAction() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.unsnapButtonAction, executed: function executed(parameter) {
+ var appView = Windows.UI.ViewManagement.ApplicationView;
+ if (appView && Windows.Xbox)
+ appView.tryUnsnapToFullscreen();
+ else if (appView)
+ appView.tryUnsnap()
+ }, canExecute: function canExecute(parameter) {
+ return true
+ }
+ });
+ var action = new UnsnapButtonAction;
+ if (MS.Entertainment.Utilities.isApp2) {
+ action.title = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_GUI);
+ action.voicePhrase = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_ALM);
+ action.voicePhoneticPhrase = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_PRON);
+ action.voiceConfidence = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_CONF)
+ }
+ return action
+ }
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Components/shell/appNotification.html b/packages/microsoft.zunevideo/Components/shell/appNotification.html
new file mode 100644
index 00000000..78fe94a2
--- /dev/null
+++ b/packages/microsoft.zunevideo/Components/shell/appNotification.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+ Info Notification Template
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Fonts/segxmvr.woff b/packages/microsoft.zunevideo/Fonts/segxmvr.woff
new file mode 100644
index 00000000..75567213
Binary files /dev/null and b/packages/microsoft.zunevideo/Fonts/segxmvr.woff differ
diff --git a/packages/microsoft.zunevideo/Fonts/segxsym.woff b/packages/microsoft.zunevideo/Fonts/segxsym.woff
new file mode 100644
index 00000000..847fa080
Binary files /dev/null and b/packages/microsoft.zunevideo/Fonts/segxsym.woff differ
diff --git a/packages/microsoft.zunevideo/Framework/CoreFX_TSHelpers.js b/packages/microsoft.zunevideo/Framework/CoreFX_TSHelpers.js
new file mode 100644
index 00000000..1c60d98f
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/CoreFX_TSHelpers.js
@@ -0,0 +1,87 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Framework) {
+ var UserControl = (function(_super) {
+ __extends(UserControl, _super);
+ function UserControl(element, options) {
+ _super.call(this)
+ }
+ UserControl.prototype.initialize = function(){};
+ UserControl.prototype.delayInitialize = function(){};
+ UserControl.prototype.dispose = function(){};
+ UserControl.prototype.unload = function(){};
+ UserControl.prototype.freeze = function(){};
+ UserControl.prototype.thaw = function(){};
+ return UserControl
+ })(Framework.ObservableBase);
+ Framework.UserControl = UserControl
+ })(UI.Framework || (UI.Framework = {}));
+ var Framework = UI.Framework
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var Overlay = (function(_super) {
+ __extends(Overlay, _super);
+ function Overlay() {
+ _super.apply(this, arguments)
+ }
+ Overlay.prototype.show = function() {
+ return WinJS.Promise.as()
+ };
+ Overlay.prototype.lightDismiss = function() {
+ return true
+ };
+ Overlay.prototype.hide = function() {
+ return WinJS.Promise.as()
+ };
+ Overlay.prototype.setAccessibilityTitle = function(title){};
+ return Overlay
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.Overlay = Overlay;
+ var Dialog = (function(_super) {
+ __extends(Dialog, _super);
+ function Dialog() {
+ _super.apply(this, arguments)
+ }
+ return Dialog
+ })(Overlay);
+ Controls.Dialog = Dialog;
+ var EditBox = (function(_super) {
+ __extends(EditBox, _super);
+ function EditBox() {
+ _super.apply(this, arguments)
+ }
+ EditBox.prototype.setValue = function(value){};
+ EditBox.prototype.setPlaceholderText = function(watermark){};
+ EditBox.prototype.reinitialize = function(){};
+ EditBox.prototype.clearInput = function(){};
+ return EditBox
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.EditBox = EditBox
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Framework/DashboardRefresherService.js b/packages/microsoft.zunevideo/Framework/DashboardRefresherService.js
new file mode 100644
index 00000000..4812cc74
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/DashboardRefresherService.js
@@ -0,0 +1,50 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {DashboardRefresherService: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function(){}, {
+ _refreshTimeout: null, _contentRestrictionNotificationBinding: null, initialize: function initialize() {
+ WinJS.Promise.timeout(this._getCurrentTimeout()).done(this.dashboardRefreshTimeout.bind(this));
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ this._contentRestrictionNotificationBinding = MS.Entertainment.UI.Framework.addEventHandlers(contentRestrictionService, {browseRestrictionsChanged: this.dashboardRefreshTimeout.bind(this)})
+ }
+ }, dispose: function dispose() {
+ if (this._contentRestrictionNotificationBinding) {
+ this._contentRestrictionNotificationBinding.cancel();
+ this._contentRestrictionNotificationBinding = null
+ }
+ }, dashboardRefreshTimeout: function dashboardRefreshTimeout() {
+ if (this._refreshTimeout)
+ this._refreshTimeout.cancel();
+ this.dispatchEvent("refreshDashboard");
+ this._refreshTimeout = WinJS.Promise.timeout(this._getCurrentTimeout()).done(this.dashboardRefreshTimeout.bind(this))
+ }, _getCurrentTimeout: function _getCurrentTimeout() {
+ if (!this._configuration)
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var timeout = 43200000;
+ switch (MS.Entertainment.appMode) {
+ case Microsoft.Entertainment.Application.AppMode.games:
+ timeout = this._configuration.shell.gamesDashboardRefreshTimer;
+ break;
+ case Microsoft.Entertainment.Application.AppMode.music:
+ timeout = this._configuration.shell.musicDashboardRefreshTimer;
+ break;
+ case Microsoft.Entertainment.Application.AppMode.music2:
+ timeout = this._configuration.shell.music2DashboardRefreshTimer;
+ break;
+ case Microsoft.Entertainment.Application.AppMode.video:
+ timeout = this._configuration.shell.videoDashboardRefreshTimer;
+ break;
+ case Microsoft.Entertainment.Application.AppMode.video2:
+ timeout = this._configuration.shell.video2DashboardRefreshTimer;
+ break
+ }
+ if (!timeout)
+ timeout = 43200000;
+ return timeout
+ }, _configuration: null, refreshDashboard: MS.Entertainment.UI.Framework.observableProperty("refreshDashboard", false)
+ }, {refreshDelayTime: 3000})});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.dashboardRefresher, function createDashboardRefresherService() {
+ return new MS.Entertainment.UI.DashboardRefresherService
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Framework/DeviceGroupService.js b/packages/microsoft.zunevideo/Framework/DeviceGroupService.js
new file mode 100644
index 00000000..415b6cfd
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/DeviceGroupService.js
@@ -0,0 +1,33 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Platform) {
+ (function(Playback) {
+ (function(DeviceGroup) {
+ var DeviceGroupService = (function() {
+ function DeviceGroupService(){}
+ DeviceGroupService.prototype.deregisterDeviceAsync = function() {
+ return Microsoft.Entertainment.Service.Requests.DeviceGroup.DeviceGroupManagement.deregisterDeviceAsync()
+ };
+ DeviceGroupService.prototype.getDeviceFriendlyName = function() {
+ return Microsoft.Entertainment.Common.Infrastructure.TunerInfo.networkHostName
+ };
+ DeviceGroupService.prototype.getDeviceRegistrationStatus = function() {
+ return Microsoft.Entertainment.Service.Requests.DeviceGroup.DeviceGroupManagement.getDeviceRegisterationStatus()
+ };
+ return DeviceGroupService
+ })();
+ DeviceGroup.DeviceGroupService = DeviceGroupService;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.deviceGroupService, function() {
+ return new DeviceGroupService
+ })
+ })(Playback.DeviceGroup || (Playback.DeviceGroup = {}));
+ var DeviceGroup = Playback.DeviceGroup
+ })(Platform.Playback || (Platform.Playback = {}));
+ var Playback = Platform.Playback
+ })(Entertainment.Platform || (Entertainment.Platform = {}));
+ var Platform = Entertainment.Platform
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Framework/IAService.js b/packages/microsoft.zunevideo/Framework/IAService.js
new file mode 100644
index 00000000..7cb7e9bb
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/IAService.js
@@ -0,0 +1,319 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/debug.js", "/Framework/serviceLocator.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.InformationArchitecture");
+ WinJS.Namespace.define("MS.Entertainment.InformationArchitecture", {
+ ViewRole: {
+ page: "page", hub: "hub", panel: "panel"
+ }, Viewability: {
+ visible: "visible", passThroughToChildren: "passThroughToChildren", hidden: "hidden"
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.InformationArchitecture", {Node: MS.Entertainment.UI.Framework.define(function constructNode(title, moniker, panelFragmentUrl, viewabilityByRoles, alwaysPutOnBackStack) {
+ this.children = [];
+ this.title = title;
+ this.moniker = moniker;
+ this.panelFragmentUrl = panelFragmentUrl;
+ this.viewabilityByRoles = viewabilityByRoles;
+ this.alwaysPutOnBackStack = alwaysPutOnBackStack
+ }, {
+ title: "", moniker: "", viewabilityByRoles: null, children: null, defaultChild: null, parent: null, panelFragmentUrl: "", useStaticHubStrip: false, showShadow: true, alwaysPutOnBackStack: false, featureDisabled: false, showNotifications: true, titleProviderFactory: null, perfTrackStartPoint: null, addChild: function addChild(node) {
+ if (!node.featureDisabled)
+ this.children.push(node);
+ MS.Entertainment.InformationArchitecture.assert(!node.parent, "Child node added to multiple parents.", node.moniker);
+ node.parent = this
+ }, removeChild: function removeChild(node) {
+ this.children = this.children.filter(function isNotThatOneNode(element) {
+ return element !== node
+ });
+ MS.Entertainment.InformationArchitecture.assert(node.parent === this, "Cannot remove child of a different node", node.moniker);
+ node.parent = null
+ }, getPage: {
+ value: function getPage() {
+ var _dataContext;
+ var eventSource;
+ return {
+ title: this.title, showNotifications: this.showNotifications, useStaticHubStrip: this.useStaticHubStrip, perfTrackStartPoint: this.perfTrackStartPoint, iaNode: this, getDataContext: function getPageDataContext() {
+ if (!_dataContext)
+ _dataContext = this.iaNode.getDataContext();
+ return _dataContext
+ }, clearDataContext: function clearPanelDataContext() {
+ _dataContext = null;
+ if (this.hubs)
+ this.hubs.forEach(function(hub) {
+ hub.clearDataContext()
+ })
+ }, options: null, addEventListener: function addEventListener(eventType, listener, capture) {
+ if (!eventSource) {
+ var eventMixin = WinJS.Class.mix(WinJS.Class.define(null), WinJS.Utilities.eventMixin);
+ eventSource = new eventMixin
+ }
+ eventSource.addEventListener(eventType, listener, capture)
+ }, removeEventListener: function removeEventListener(eventType, listener, capture) {
+ if (eventSource)
+ eventSource.removeEventListener(eventType, listener, capture)
+ }, dispatchEvent: function dispatchEvent(eventType, details) {
+ if (eventSource)
+ return eventSource.dispatchEvent(eventType, details)
+ }
+ }
+ }, writable: true, enumerable: true, configurable: false
+ }, getHub: {
+ value: function getHub() {
+ var _dataContext;
+ return {
+ title: this.title, showNotifications: this.showNotifications, iaNode: this, titleProviderFactory: this.titleProviderFactory, getDataContext: function getHubDataContext() {
+ if (!_dataContext)
+ _dataContext = this.iaNode.getDataContext();
+ return _dataContext
+ }, clearDataContext: function clearPanelDataContext() {
+ _dataContext = null;
+ if (this.panels)
+ this.panels.forEach(function(panel) {
+ panel.clearDataContext()
+ })
+ }
+ }
+ }, writable: true, enumerable: true, configurable: false
+ }, getPanel: {
+ value: function getPanel() {
+ var _dataContext;
+ MS.Entertainment.InformationArchitecture.assert(!!this.panelFragmentUrl, "Default getPanel() called on a Node with no panel fragment URL.", this.moniker);
+ return {
+ title: this.title, iaNode: this, showShadow: this.showShadow, fragmentUrl: this.panelFragmentUrl, getDataContext: function getPanelDataContext() {
+ if (!_dataContext)
+ _dataContext = this.iaNode.getDataContext();
+ return _dataContext
+ }, clearDataContext: function clearPanelDataContext() {
+ _dataContext = null
+ }
+ }
+ }, writable: true, enumerable: true, configurable: false
+ }, getDataContext: {
+ value: function getDataContext() {
+ return null
+ }, writable: true, enumerable: true, configurable: false
+ }
+ }, {
+ preventBackNavigation: function preventBackNavigation(node) {
+ if (!node)
+ return;
+ var oldGetPage = node.getPage;
+ node.getPage = function preventBackNavigationGetPage() {
+ var page = oldGetPage.call(this);
+ var visited = false;
+ page.onNavigatingTo = function preventBackNavigationOnNavigatingTo() {
+ if (visited)
+ return true;
+ else {
+ visited = true;
+ return false
+ }
+ };
+ return page
+ }
+ }, overridePageFragmentUrl: function overridePageFragmentUrl(node, fragmentUrl) {
+ if (!node)
+ return;
+ var oldGetPage = node.getPage;
+ node.getPage = function createPageOverridePageFragmentUrl() {
+ var page = oldGetPage.call(this);
+ page.overrideFragmentUrl = fragmentUrl;
+ return page
+ }
+ }, overrideHubFragmentUrl: function overrideHubFragmentUrl(node, fragmentUrl) {
+ if (!node)
+ return;
+ var oldGetHub = node.getHub;
+ node.getHub = function createHubOverrideHubFragmentUrl() {
+ var hub = oldGetHub.call(this);
+ hub.overrideFragmentUrl = fragmentUrl;
+ return hub
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.InformationArchitecture", {IAService: MS.Entertainment.UI.Framework.define(function constructIAService() {
+ this._createRoot()
+ }, {
+ _nodesByMoniker: null, _featureEnablementModel: null, _handlers: [], _initialized: false, rootNode: null, isInitialized: {get: function get_initialized() {
+ return this._initialized
+ }}, _hasValue: function _hasValue(value) {
+ return typeof value !== "undefined" && value !== null
+ }, _createRoot: function _createRoot() {
+ this._nodesByMoniker = {};
+ var rootNode = this.createNode("", MS.Entertainment.UI.Monikers.root, null, null, MS.Entertainment.InformationArchitecture.ViewRole.page);
+ rootNode.getPage = (function() {
+ var oldGetPage = rootNode.getPage;
+ return function customRootGetPage() {
+ var page = oldGetPage.call(this);
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ page.overrideFragmentUrl = "/Components/Video2/HorizontalDashboardPage.html";
+ page.getDataContext = function getDataContext() {
+ return new MS.Entertainment.ViewModels.VideoDashboardViewModel
+ }
+ }
+ else if (MS.Entertainment.Utilities.isMusicApp2 && (new Microsoft.Entertainment.Configuration.ConfigurationManager).music.useDXDashboard) {
+ page.overrideFragmentUrl = "/Components/Music2/HorizontalDashboardPage.html";
+ page.getDataContext = function getDataContext() {
+ return new MS.Entertainment.ViewModels.MusicDashboardViewModel
+ }
+ }
+ else if (MS.Entertainment.Utilities.isApp2)
+ page.overrideFragmentUrl = "/Controls/PivotDashboard.html";
+ else if (MS.Entertainment.Utilities.isMusicApp1)
+ page.overrideFragmentUrl = "/Controls/Music8Dashboard.html";
+ else if (MS.Entertainment.Utilities.isVideoApp1)
+ page.overrideFragmentUrl = "/Components/Video/VideoSpotlightView1.html";
+ else
+ page.overrideFragmentUrl = "/Controls/Dashboard.html";
+ return page
+ }
+ })();
+ this.rootNode = rootNode
+ }, addIAHandler: function addIAHandler(handler, skipInitialization) {
+ if (!handler) {
+ MS.Entertainment.InformationArchitecture.fail("addIAHandler: No handler specified");
+ return
+ }
+ this._handlers.push({
+ handler: handler, skipInitialization: !!skipInitialization
+ })
+ }, initialize: function initialize(resetting) {
+ this._handlers.forEach(function forEachHandler(handlerInfo) {
+ if (handlerInfo)
+ if (!handlerInfo.skipInitialization || resetting)
+ handlerInfo.handler(this)
+ }.bind(this));
+ this._initialized = true
+ }, reset: function reset() {
+ this._createRoot();
+ this.initialize(true)
+ }, getNode: function getNode(moniker) {
+ MS.Entertainment.InformationArchitecture.assert(MS.Entertainment.UI.Monikers.hasOwnProperty(moniker), "Moniker passed to getNode() is not part of the Monikers enumeration.", moniker);
+ return this._nodesByMoniker[moniker]
+ }, createNode: function createNode(title, moniker, panelFragmentUrl, viewabilityByRoles, alwaysPutOnBackStack, feature) {
+ var Viewability = MS.Entertainment.InformationArchitecture.Viewability;
+ var ViewRole = MS.Entertainment.InformationArchitecture.ViewRole;
+ var addNode = true;
+ var newNode;
+ MS.Entertainment.InformationArchitecture.assert(MS.Entertainment.UI.Monikers.hasOwnProperty(moniker), "Moniker passed to createNode() is not part of the Monikers enumeration.", moniker);
+ MS.Entertainment.InformationArchitecture.assert(!this._nodesByMoniker[moniker], "Moniker passed to createNode() is already in use.", moniker);
+ panelFragmentUrl = panelFragmentUrl || null;
+ viewabilityByRoles = viewabilityByRoles || {};
+ if (!viewabilityByRoles[ViewRole.page])
+ viewabilityByRoles[ViewRole.page] = Viewability.visible;
+ MS.Entertainment.InformationArchitecture.assert(Viewability.hasOwnProperty(viewabilityByRoles[ViewRole.page]), "Invalid page viewability passed to createNode().", viewabilityByRoles[ViewRole.page]);
+ if (!viewabilityByRoles[ViewRole.hub])
+ viewabilityByRoles[ViewRole.hub] = Viewability.visible;
+ MS.Entertainment.InformationArchitecture.assert(Viewability.hasOwnProperty(viewabilityByRoles[ViewRole.hub]), "Invalid hub viewability passed to createNode().", viewabilityByRoles[ViewRole.hub]);
+ if (!viewabilityByRoles[ViewRole.panel])
+ viewabilityByRoles[ViewRole.panel] = panelFragmentUrl ? Viewability.visible : Viewability.passThroughToChildren;
+ MS.Entertainment.InformationArchitecture.assert(Viewability.hasOwnProperty(viewabilityByRoles[ViewRole.panel]), "Invalid panel viewability passed to createNode().", viewabilityByRoles[ViewRole.panel]);
+ newNode = new MS.Entertainment.InformationArchitecture.Node(title, moniker, panelFragmentUrl, viewabilityByRoles, alwaysPutOnBackStack);
+ if (feature) {
+ if (!this._featureEnablementModel)
+ this._featureEnablementModel = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ addNode = this._featureEnablementModel.isEnabled(feature)
+ }
+ if (addNode)
+ this._nodesByMoniker[moniker] = newNode;
+ else
+ newNode.featureDisabled = true;
+ return newNode
+ }, getViewFromNode: function getViewFromNode(node) {
+ var pages = this._getPagesForNode(node);
+ MS.Entertainment.InformationArchitecture.assert(pages.length === 1, "Wrong number of pages found for node in getViewForNode().", node.moniker);
+ return pages[0] || null
+ }, _getPagesForNode: function _getPageForNode(node) {
+ var Viewability = MS.Entertainment.InformationArchitecture.Viewability;
+ var result = [];
+ var page;
+ switch (node.viewabilityByRoles[MS.Entertainment.InformationArchitecture.ViewRole.page]) {
+ case Viewability.visible:
+ page = node.getPage();
+ if (this._hasValue(page.title) && page.iaNode) {
+ page.hubs = page.hubs || this._nestedMap(node.children, this._getHubsForNode);
+ result = [page]
+ }
+ else
+ MS.Entertainment.InformationArchitecture.assert(false, "Page returned by node is not really a Page.", node.moniker);
+ break;
+ case Viewability.passThroughToChildren:
+ result = this._nestedMap(node.children, this._getPagesForNode);
+ break;
+ case Viewability.hidden:
+ break;
+ default:
+ MS.Entertainment.InformationArchitecture.assert(false, "Unknown viewability detected for Page role of node.", node.moniker);
+ break
+ }
+ return result
+ }, _getHubsForNode: function _getHubsForNode(node) {
+ var Viewability = MS.Entertainment.InformationArchitecture.Viewability;
+ var result = [];
+ var hub;
+ switch (node.viewabilityByRoles[MS.Entertainment.InformationArchitecture.ViewRole.hub]) {
+ case Viewability.visible:
+ hub = node.getHub();
+ if (this._hasValue(hub.title) && hub.iaNode) {
+ hub.panels = hub.panels || this._nestedMap(node.children, this._getPanelsForNode);
+ result = [hub]
+ }
+ else
+ MS.Entertainment.InformationArchitecture.assert(false, "Hub returned by node is not really a Hub.", node.moniker);
+ break;
+ case Viewability.passThroughToChildren:
+ result = this._nestedMap(node.children, this._getHubsForNode);
+ break;
+ case Viewability.hidden:
+ break;
+ default:
+ MS.Entertainment.InformationArchitecture.assert(false, "Unknown viewability detected for Hub role of node.", node.moniker);
+ break
+ }
+ return result
+ }, _getPanelsForNode: function _getPanelsForNode(node) {
+ var Viewability = MS.Entertainment.InformationArchitecture.Viewability;
+ var result = [];
+ var panel;
+ switch (node.viewabilityByRoles[MS.Entertainment.InformationArchitecture.ViewRole.panel]) {
+ case Viewability.visible:
+ panel = node.getPanel();
+ if (this._hasValue(panel.title) && panel.iaNode && panel.fragmentUrl)
+ result = [panel];
+ else
+ MS.Entertainment.InformationArchitecture.assert(false, "Panel returned by node is not really a Panel.", node.moniker);
+ break;
+ case Viewability.passThroughToChildren:
+ result = this._nestedMap(node.children, this._getPanelsForNode);
+ break;
+ case Viewability.hidden:
+ break;
+ default:
+ MS.Entertainment.InformationArchitecture.assert(false, "Unknown viewability detected for Panel role of node.", node.moniker);
+ break
+ }
+ return result
+ }, _nestedMap: function _nestedMap(array, converter) {
+ var that = this;
+ var q = array.reduce(function convertThenFlatten(result, element) {
+ var conversionResult = converter.call(that, element);
+ conversionResult.forEach(function accumulateIfValid(element) {
+ if (element)
+ result.push(element)
+ });
+ return result
+ }, []);
+ return q
+ }, getTestHooks: function getTestHooks() {
+ var that = this;
+ return {getNodeRegistry: function getNodeRegistry() {
+ return that._nodesByMoniker
+ }}
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.informationArchitecture, function getNavigationService() {
+ return new MS.Entertainment.InformationArchitecture.IAService
+ }, true)
+})()
diff --git a/packages/microsoft.zunevideo/Framework/IdVision.js b/packages/microsoft.zunevideo/Framework/IdVision.js
new file mode 100644
index 00000000..de6644f9
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/IdVision.js
@@ -0,0 +1,16 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// IdVision.js
+//
+// This file was generated by the Stringer tool. Do not edit it!
+//
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+(function() {
+
+ String.idVisionIds = String.idVisionIds || {}
+
+
+})();
diff --git a/packages/microsoft.zunevideo/Framework/PlaybackErrorDisplayService.js b/packages/microsoft.zunevideo/Framework/PlaybackErrorDisplayService.js
new file mode 100644
index 00000000..052b58ec
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/PlaybackErrorDisplayService.js
@@ -0,0 +1,214 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ var BasePlaybackErrorDisplayServiceImpl = (function() {
+ function BasePlaybackErrorDisplayServiceImpl(){}
+ BasePlaybackErrorDisplayServiceImpl.prototype.postErrorNavigationHandler = function(errorCode, isCritical){};
+ return BasePlaybackErrorDisplayServiceImpl
+ })();
+ UI.BasePlaybackErrorDisplayServiceImpl = BasePlaybackErrorDisplayServiceImpl;
+ var VideoPlaybackErrorDisplayServiceImpl = (function(_super) {
+ __extends(VideoPlaybackErrorDisplayServiceImpl, _super);
+ function VideoPlaybackErrorDisplayServiceImpl() {
+ _super.apply(this, arguments)
+ }
+ VideoPlaybackErrorDisplayServiceImpl.prototype.postErrorNavigationHandler = function(errorCode, isCritical) {
+ try {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService && navigationService.currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.fullScreenNowPlaying)
+ navigationService.navigateBack();
+ else if (navigationService && navigationService.currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.homeHub) {
+ var appContainer = document.querySelector(".control-app");
+ MS.Entertainment.Utilities.toggleDisplayCollapseElement(appContainer, true)
+ }
+ }
+ catch(exception) {}
+ };
+ return VideoPlaybackErrorDisplayServiceImpl
+ })(BasePlaybackErrorDisplayServiceImpl);
+ UI.VideoPlaybackErrorDisplayServiceImpl = VideoPlaybackErrorDisplayServiceImpl;
+ function createPlaybackErrorDisplayServiceImpl() {
+ if (MS.Entertainment.Utilities.isVideoApp)
+ return new VideoPlaybackErrorDisplayServiceImpl;
+ return new BasePlaybackErrorDisplayServiceImpl
+ }
+ var PlaybackErrorDisplayService = (function() {
+ function PlaybackErrorDisplayService() {
+ this._playbackSession = null;
+ this._sessionMgr = null;
+ this._sessionEventHandlers = null;
+ this._uiStateService = null;
+ this._primarySessionIdBinding = null;
+ this._initialized = false;
+ this.suppressNextPlaybackErrorDialog = false;
+ this.showDialogForNonCriticalErrors = false;
+ this._impl = createPlaybackErrorDisplayServiceImpl()
+ }
+ PlaybackErrorDisplayService.prototype.initialize = function() {
+ var _this = this;
+ if (this._initialized)
+ return;
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._primarySessionIdBinding = WinJS.Binding.bind(this._uiStateService, {primarySessionId: function() {
+ _this.playbackSession = _this._sessionMgr.primarySession
+ }});
+ if (this.playbackSession.error)
+ this._handlePlaybackError(this.playbackSession.error);
+ this._initialized = true
+ };
+ PlaybackErrorDisplayService.prototype.dispose = function() {
+ this._detachBindings();
+ if (this._primarySessionIdBinding) {
+ this._primarySessionIdBinding.cancel();
+ this._primarySessionIdBinding = null
+ }
+ };
+ Object.defineProperty(PlaybackErrorDisplayService.prototype, "playbackSession", {
+ get: function() {
+ return this._playbackSession
+ }, set: function(newValue) {
+ this._playbackSession = newValue;
+ this._detachBindings();
+ this._sessionEventHandlers = MS.Entertainment.Utilities.addEvents(this.playbackSession, {errorChanged: this._errorStateChanged.bind(this)})
+ }, enumerable: true, configurable: true
+ });
+ PlaybackErrorDisplayService.prototype._errorStateChanged = function(e) {
+ var newVal = e.detail.newValue;
+ if (newVal)
+ this._handlePlaybackError(newVal)
+ };
+ PlaybackErrorDisplayService.prototype._detachBindings = function() {
+ if (this._sessionEventHandlers) {
+ this._sessionEventHandlers.cancel();
+ this._sessionEventHandlers = null
+ }
+ };
+ PlaybackErrorDisplayService.prototype._handlePlaybackError = function(errorDescriptor) {
+ if (this.playbackSession.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying) {
+ var error = errorDescriptor;
+ var errorCode = MS.Entertainment.Platform.Playback._mapMediaElementErrorCodes(error.code, error.msExtendedCode);
+ var isCritical = errorDescriptor.isCritical;
+ var postpendedText = errorDescriptor.postPendedText;
+ var additionalButton = this._createAdditionalButtonForError(error.msExtendedCode);
+ this._displayError(errorCode, isCritical, postpendedText, additionalButton)
+ }
+ };
+ PlaybackErrorDisplayService.prototype._displayError = function(errorCode, isCritical, postpendedText, additionalButton) {
+ if (!this.suppressNextPlaybackErrorDialog && !this._shouldIgnoreThisError(errorCode)) {
+ var title = this._getErrorDialogTitle(errorCode);
+ MS.Entertainment.UI.Shell.showError(title, errorCode, null, postpendedText, additionalButton).done(this._impl.postErrorNavigationHandler.bind(this._impl, errorCode, isCritical))
+ }
+ this.suppressNextPlaybackErrorDialog = false
+ };
+ PlaybackErrorDisplayService.prototype._getErrorDialogTitle = function(errorCode) {
+ var title;
+ if (MS.Entertainment.Utilities.isVideoApp)
+ switch (errorCode) {
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_E_UNEXPECTED.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_HEADER);
+ break;
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_MAX_DEVICES_REACHED.code:
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_MAX_ADDED_PER_MONTH_REACHED.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_HEADER);
+ break;
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_MAX_PCS_REACHED.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPC_ERROR_HEADER);
+ break;
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_MAX_PHONES_REACHED.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPHONE_ERROR_HEADER);
+ break;
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_MAX_TABLETS_REACHED.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXTABLET_ERROR_HEADER);
+ break;
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_MAX_CONSOLES_REACHED.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXCONSOLES_ERROR_HEADER);
+ break;
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.DEVICEGROUP_MAX_REMOVED_PER_MONTH_REACHED.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_NOTIME_HEADER);
+ break;
+ case MS.Entertainment.Platform.Playback.DeviceGroupError.MARKETPLACE_LICENSING_DEVICE_NOT_IN_DEVICEGROUP.code:
+ title = String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_OFFLINE_ERROR_HEADER);
+ break;
+ default:
+ title = String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE);
+ break
+ }
+ else
+ title = String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE);
+ return title
+ };
+ PlaybackErrorDisplayService.prototype._shouldIgnoreThisError = function(errorCode) {
+ var shouldIgnoreThisError = false;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ if (errorCode === MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_HDMI_OUTPUT_LOST.code)
+ shouldIgnoreThisError = true
+ }
+ else if (MS.Entertainment.Utilities.isAmsterdamApp)
+ if (this._uiStateService.isSnapped)
+ shouldIgnoreThisError = true;
+ return shouldIgnoreThisError
+ };
+ PlaybackErrorDisplayService.prototype._createAdditionalButtonForError = function(errorCode) {
+ if (errorCode)
+ switch (errorCode) {
+ case MS.Entertainment.Platform.Playback.Error.ZEST_E_UNAUTHENTICATED.code:
+ if (MS.Entertainment.Utilities.isApp2) {
+ var appSignIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return {
+ title: String.load(String.id.IDS_APP2_GLOBAL_COMMAND_SIGN_IN_VUI_GUI), execute: MS.Entertainment.UI.Shell.AccountPicker.showAccountPickerAsync
+ }
+ }
+ break
+ }
+ return null
+ };
+ return PlaybackErrorDisplayService
+ })();
+ UI.PlaybackErrorDisplayService = PlaybackErrorDisplayService;
+ var CriticalOnlyPlaybackErrorDisplayService = (function(_super) {
+ __extends(CriticalOnlyPlaybackErrorDisplayService, _super);
+ function CriticalOnlyPlaybackErrorDisplayService() {
+ _super.call(this);
+ this._errorPromise = null
+ }
+ CriticalOnlyPlaybackErrorDisplayService.prototype._displayError = function(errorCode, isCritical, postpendedText) {
+ if (this.playbackSession.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying) {
+ if (isCritical || this.showDialogForNonCriticalErrors) {
+ if (this._errorPromise) {
+ this._errorPromise.cancel();
+ this._errorPromise = null
+ }
+ this._errorPromise = WinJS.Promise.timeout(30).then(function showError() {
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE), errorCode, null, postpendedText)
+ })
+ }
+ this.showDialogForNonCriticalErrors = false
+ }
+ };
+ return CriticalOnlyPlaybackErrorDisplayService
+ })(PlaybackErrorDisplayService);
+ UI.CriticalOnlyPlaybackErrorDisplayService = CriticalOnlyPlaybackErrorDisplayService;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.playbackErrorDisplayService, function createPlaybackErrorDisplayService() {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ return new MS.Entertainment.UI.CriticalOnlyPlaybackErrorDisplayService;
+ else
+ return new MS.Entertainment.UI.PlaybackErrorDisplayService
+ })
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Framework/ProgressNotificationService.js b/packages/microsoft.zunevideo/Framework/ProgressNotificationService.js
new file mode 100644
index 00000000..238cb2ce
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/ProgressNotificationService.js
@@ -0,0 +1,34 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/debug.js", "/Framework/utilities.js");
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI");
+ WinJS.Namespace.define("MS.Entertainment.UI", {ProgressNotificationService: MS.Entertainment.UI.Framework.define(function ProgressNotificationServiceConstructor() {
+ this._appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification)
+ }, {
+ _progressCount: 0, _appNotificationService: null, beginProgress: function beginProgress() {
+ if (this._progressCount === 0)
+ WinJS.Binding.unwrap(this)._sendNotification(true);
+ this._progressCount++
+ }, completeProgress: function completeProgress() {
+ MS.Entertainment.UI.assert(this._progressCount > 0, "Progress has already completed");
+ if (this._progressCount <= 0)
+ return;
+ this._progressCount--;
+ if (this._progressCount === 0)
+ WinJS.Binding.unwrap(this)._sendNotification(false)
+ }, _sendNotification: function _sendNotification(inProgress) {
+ if (inProgress)
+ this._appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.empty, subTitle: String.empty, moreDetails: null, icon: WinJS.UI.AppBarIcon.refresh, action: null, category: MS.Entertainment.UI.ProgressNotificationService.NotificationCategory, isPersistent: true, iconClassName: MS.Entertainment.UI.ProgressNotificationService.NotificationIconClass
+ }));
+ else
+ this._appNotificationService.removeNotificationByCategory(MS.Entertainment.UI.ProgressNotificationService.NotificationCategory)
+ }
+ }, {
+ NotificationCategory: "progressNotification", NotificationIconClass: "rotate360Animation"
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.progressNotification, function ProgressNotificationServiceFactory() {
+ return new MS.Entertainment.UI.ProgressNotificationService
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Framework/VideoTileManager.js b/packages/microsoft.zunevideo/Framework/VideoTileManager.js
new file mode 100644
index 00000000..75c6fee2
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/VideoTileManager.js
@@ -0,0 +1,623 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Framework) {
+ var VideoTileManager = (function() {
+ function VideoTileManager() {
+ var _this = this;
+ this._xboxLogo = "\u26dd\ud83c\udfae";
+ this._tileCleared = null;
+ this._peekLargeImageFileName = "tileLargeSquareImage.jpeg";
+ this._tileWideImageFileName = "tileWideImage.jpeg";
+ this._nowPlayingTileTag = "nowplaying";
+ this._clearTileByTagExpiryTime = 15;
+ this.EMPTY_GUID = "00000000-0000-0000-0000-000000000000";
+ this._expiryTime = 30 * 60;
+ this._defaultLargeSquareTileSize = 310;
+ if (Windows.UI.Notifications.TileTemplateType.tileSquare310x310TextList01)
+ this._xboxLogo = "\uD83D\uDD32\uD83C\uDFAE";
+ this.tvGradient = "ms-appx:///images/tiles/Video_Tv_Resume_2x2." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ this.movieGradient = "ms-appx:///images/tiles/Video_Movie_Resume_2x2." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ this.noMetadataGradient = "ms-appx:///images/tiles/Video_Tv_Resume_2x2." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ this._wideTemplate = Windows.UI.Notifications.TileTemplateType.tileWideSmallImageAndText04;
+ this._wideSquareTemplate = Windows.UI.Notifications.TileTemplateType.tileWideSmallImageAndText02;
+ this._widePosterTemplate = Windows.UI.Notifications.TileTemplateType.tileWideSmallImageAndText05;
+ this._wideNoImageTemplate = Windows.UI.Notifications.TileTemplateType.tileWideText01;
+ this._squareTemplate = Windows.UI.Notifications.TileTemplateType.tileSquareText03;
+ this._defaultWideTemplate = Windows.UI.Notifications.TileTemplateType.tileWideImage;
+ this._defaultSquareTemplate = Windows.UI.Notifications.TileTemplateType.tileSquareImage;
+ this._largeSquareTemplate = Windows.UI.Notifications.TileTemplateType.tileSquare310x310TextList01;
+ this._largeSquarePeekTemplate = Windows.UI.Notifications.TileTemplateType.tileSquare310x310ImageAndTextOverlay03;
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ WinJS.Promise.timeout(2500).done(function() {
+ try {
+ _this._tileUpdater = Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication();
+ _this._tileUpdater.enableNotificationQueue(true);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoLiveTile)) {
+ var serviceConfig = (new Microsoft.Entertainment.Configuration.ConfigurationManager).service;
+ var uri = MS.Entertainment.Utilities.UriFactory.create(MS.Entertainment.Endpoint.id.seid_LiveTile, serviceConfig.videoAppLiveTileSuffix);
+ _this._tileUpdater.startPeriodicUpdate(new Windows.Foundation.Uri(uri), Windows.UI.Notifications.PeriodicUpdateRecurrence.daily)
+ }
+ else
+ _this._tileUpdater.stopPeriodicUpdate()
+ }
+ catch(err) {
+ MS.Entertainment.Framework.fail("Failure in calls to TileUpdateManager: " + err)
+ }
+ _this.initialize()
+ })
+ }
+ VideoTileManager.prototype.initialize = function() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._playbackSession = sessionMgr.primarySession;
+ if (!this._playbackSessionBindings)
+ this._playbackSessionBindings = WinJS.Binding.bind(this._playbackSession, {
+ currentMedia: this.updateMetadata.bind(this), currentTransportState: this.transportStateChanged.bind(this)
+ })
+ }
+ };
+ VideoTileManager.prototype.clearTile = function() {
+ try {
+ if (!this._tileUpdater)
+ this._tileUpdater = Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication();
+ this._lastItemTitle = null;
+ if (this._tileCleared !== true) {
+ this._tileUpdater.clear();
+ try {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ this.resetTileToDefaultNotifications();
+ this._tileCleared = true
+ }
+ }
+ catch(err) {
+ try {
+ MS.Entertainment.Framework.assert(false, "Failure in clearTile call to resetTileToDefaultNotifications: " + err);
+ this._tileUpdater.clear()
+ }
+ catch(ignoreErr) {}
+ }
+ }
+ }
+ catch(err) {
+ this._lastItemTitle = null;
+ MS.Entertainment.Framework.assert(false, "Failure in calls to TileUpdateManager: " + err)
+ }
+ };
+ VideoTileManager.prototype.resetTileToDefaultNotifications = function() {
+ var Notifications = Windows.UI.Notifications;
+ var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWideText09);
+ var tileVisualElements = tileXml.getElementsByTagName("visual");
+ tileVisualElements[0].setAttribute("branding", "name");
+ var tileTextAttributes = tileXml.getElementsByTagName("text");
+ tileTextAttributes[0].appendChild(tileXml.createTextNode(this._xboxLogo));
+ tileTextAttributes[1].appendChild(tileXml.createTextNode(String.load(String.id.IDS_VIDEO_TILE_NEW_MOVIES_AMP_TV)));
+ var squareTileXml = null;
+ try {
+ squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquareText02)
+ }
+ catch(ignoreErr) {}
+ if (!squareTileXml)
+ return;
+ var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
+ squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode(this._xboxLogo));
+ squareTileTextAttributes[1].appendChild(squareTileXml.createTextNode(String.load(String.id.IDS_VIDEO_TILE_NEW_MOVIES_AMP_TV)));
+ var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
+ tileXml.getElementsByTagName("visual").item(0).appendChild(node);
+ if (Notifications.TileTemplateType.tileSquare310x310TextList03) {
+ var largeTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquare310x310TextList03);
+ var largeTileTextAttributes = largeTileXml.getElementsByTagName("text");
+ largeTileTextAttributes[0].appendChild(largeTileXml.createTextNode(this._xboxLogo));
+ largeTileTextAttributes[5].appendChild(largeTileXml.createTextNode(String.load(String.id.IDS_VIDEO_TILE_NEW_MOVIES_AMP_TV)));
+ node = tileXml.importNode(largeTileXml.getElementsByTagName("binding").item(0), true);
+ tileXml.getElementsByTagName("visual").item(0).appendChild(node)
+ }
+ var tileNotification = new Notifications.TileNotification(tileXml);
+ tileNotification.tag = "info";
+ this._tileUpdater.update(tileNotification);
+ tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWideImage);
+ tileVisualElements = tileXml.getElementsByTagName("visual");
+ tileVisualElements[0].setAttribute("branding", "name");
+ var tileImageAttributes = tileXml.getElementsByTagName("image");
+ tileImageAttributes[0].setAttribute("src", "ms-appx:///images/tiles/XBL_VIDEO_310x150_C.png");
+ tileImageAttributes[0].setAttribute("alt", String.load(String.id.IDS_VIDEO_TILE_XBOX_VIDEO_TC));
+ squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquareImage);
+ var squareTileImageAttributes = squareTileXml.getElementsByTagName("image");
+ squareTileImageAttributes[0].setAttribute("src", "ms-appx:///images/tiles/XBL_VIDEO_150x150_A.png");
+ squareTileImageAttributes[0].setAttribute("alt", String.load(String.id.IDS_VIDEO_TILE_XBOX_VIDEO_TC));
+ node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
+ tileXml.getElementsByTagName("visual").item(0).appendChild(node);
+ if (Notifications.TileTemplateType.tileSquare310x310Image) {
+ var largeTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquare310x310Image);
+ var largeTileImageAttributes = largeTileXml.getElementsByTagName("image");
+ largeTileImageAttributes[0].setAttribute("src", "ms-appx:///images/tiles/XBL_VIDEO_310x310_A.png");
+ largeTileImageAttributes[0].setAttribute("alt", String.load(String.id.IDS_VIDEO_TILE_XBOX_VIDEO_TC));
+ node = tileXml.importNode(largeTileXml.getElementsByTagName("binding").item(0), true);
+ tileXml.getElementsByTagName("visual").item(0).appendChild(node)
+ }
+ tileNotification = new Notifications.TileNotification(tileXml);
+ tileNotification.tag = "default";
+ this._tileUpdater.update(tileNotification)
+ };
+ VideoTileManager.prototype.updateTile = function() {
+ this.updateMetadata()
+ };
+ VideoTileManager.prototype.updateMetadata = function() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var serviceAvailable = true;
+ if (!(featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)))
+ serviceAvailable = false;
+ if (this._playbackSession && this._playbackSession.currentMedia) {
+ if (this._playbackSession.currentMedia.name !== this._lastItemTitle) {
+ if (!serviceAvailable || (!this._playbackSession.currentMedia.serviceId || this._playbackSession.currentMedia.serviceId === this.EMPTY_GUID))
+ this.displayNoMetadataTile(this._playbackSession.currentMedia);
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMovie(this._playbackSession.currentMedia))
+ this.displayMovieTile(this._playbackSession.currentMedia);
+ else
+ this.displayTvTile(this._playbackSession.currentMedia);
+ this._lastItemTitle = this._playbackSession.currentMedia.name;
+ this._tileCleared = false
+ }
+ }
+ else
+ this.clearTile()
+ };
+ VideoTileManager.prototype.displayTvTile = function(currentMediaItem) {
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(currentMediaItem, 310, 310, null, null, null, MS.Entertainment.ImageContentType.png).done(function loadImage(uri) {
+ if (uri !== MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.tvEpisode)
+ this.completeTvTile(currentMediaItem, uri);
+ else
+ this.completeTvTile(currentMediaItem)
+ }.bind(this))
+ };
+ VideoTileManager.prototype.completeTvTile = function(currentMediaItem, imageUri) {
+ var Notifications = Windows.UI.Notifications;
+ try {
+ var bigImagePromise = WinJS.Promise.as();
+ if (imageUri)
+ bigImagePromise = this.createComposedLargePeekImage(imageUri, this.tvGradient);
+ bigImagePromise.done(function finishTvtile() {
+ var currentMediaName = currentMediaItem.seriesTitle;
+ var resumeString = String.load(String.id.IDS_MOGO_RESUME);
+ var seasonEpisodeInfoString = String.empty;
+ if (this._playbackSession && this._playbackSession.currentMedia && this._playbackSession.currentMedia.seasonNumber && this._playbackSession.currentMedia.episodeNumber)
+ seasonEpisodeInfoString = String.load(String.id.IDS_TV_NUMBERED_EPISODE_SEASON_NAME).format(this._playbackSession.currentMedia.seasonNumber, this._playbackSession.currentMedia.episodeNumber);
+ var squareTileXml = null;
+ try {
+ squareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._squareTemplate)
+ }
+ catch(ignoreErr) {}
+ if (!squareTileXml)
+ return;
+ squareTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
+ if (squareTileTextAttributes.length < 2)
+ return;
+ squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ squareTileTextAttributes[1].appendChild(squareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaName)));
+ var wideTileXml = null;
+ if (imageUri) {
+ wideTileXml = Notifications.TileUpdateManager.getTemplateContent(this._wideSquareTemplate);
+ var wideTileImageAttributes = wideTileXml.getElementsByTagName("image");
+ wideTileImageAttributes[0].setAttribute("src", imageUri)
+ }
+ else
+ wideTileXml = Notifications.TileUpdateManager.getTemplateContent(this._wideNoImageTemplate);
+ wideTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ var wideTileTextAttributes = wideTileXml.getElementsByTagName("text");
+ wideTileTextAttributes[0].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaName)));
+ if (seasonEpisodeInfoString)
+ wideTileTextAttributes[1].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(seasonEpisodeInfoString)));
+ wideTileTextAttributes[3].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(String.load(String.id.IDS_MOGO_XBOX_VIDEO_XENON).format(this._xboxLogo))));
+ wideTileXml.getElementsByTagName("visual")[0].appendChild(wideTileXml.importNode(squareTileXml.getElementsByTagName("binding")[0], true));
+ var largeSquareTileXml;
+ var largeSquareTileTextAttributes;
+ if (this._largeSquareTemplate) {
+ if (this._lastSavedLargePeekImage) {
+ largeSquareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._largeSquarePeekTemplate);
+ var largeSquareTileImageAttributes = largeSquareTileXml.getElementsByTagName("image");
+ largeSquareTileImageAttributes[0].setAttribute("src", "ms-appdata:///local/" + this._peekLargeImageFileName);
+ largeSquareTileTextAttributes = largeSquareTileXml.getElementsByTagName("text");
+ largeSquareTileTextAttributes[0].appendChild(largeSquareTileXml.createTextNode(this._xboxLogo));
+ largeSquareTileTextAttributes[1].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ largeSquareTileTextAttributes[2].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaName)));
+ if (seasonEpisodeInfoString)
+ largeSquareTileTextAttributes[3].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(seasonEpisodeInfoString)))
+ }
+ else {
+ largeSquareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._largeSquareTemplate);
+ largeSquareTileTextAttributes = largeSquareTileXml.getElementsByTagName("text");
+ largeSquareTileTextAttributes[6].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ largeSquareTileTextAttributes[7].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaName)));
+ if (seasonEpisodeInfoString)
+ largeSquareTileTextAttributes[8].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(seasonEpisodeInfoString)))
+ }
+ largeSquareTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ wideTileXml.getElementsByTagName("visual")[0].appendChild(wideTileXml.importNode(largeSquareTileXml.getElementsByTagName("binding")[0], true))
+ }
+ var tileNotification = new Notifications.TileNotification(wideTileXml);
+ tileNotification.tag = this._nowPlayingTileTag;
+ var currentTime = new Date;
+ var expiryTime = new Date(currentTime.getTime() + this._expiryTime * 1000);
+ tileNotification.expirationTime = expiryTime;
+ if (this._tileUpdater)
+ try {
+ this._tileUpdater.clear();
+ this._tileUpdater.update(tileNotification)
+ }
+ catch(ignoreErr) {}
+ }.bind(this))
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating tv tile: " + exception)
+ }
+ };
+ VideoTileManager.prototype.createComposedLargePeekImage = function(imageUri, gradientFile) {
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ try {
+ if (imageUri !== this._lastSavedLargePeekImage) {
+ var largeCanvas = document.createElement("canvas");
+ var scaleFactor = 1.0;
+ var displayProperties = MS.Entertainment.Utilities.getDisplayProperties();
+ switch (displayProperties.resolutionScale) {
+ case Windows.Graphics.Display.ResolutionScale.scale100Percent:
+ break;
+ case Windows.Graphics.Display.ResolutionScale.scale140Percent:
+ scaleFactor = 1.4;
+ break;
+ case Windows.Graphics.Display.ResolutionScale.scale180Percent:
+ scaleFactor = 1.8;
+ break;
+ default:
+ MS.Entertainment.fail("Unknown scale factor in tile manager. Scale: " + displayProperties.resolutionScale);
+ break
+ }
+ largeCanvas.width = largeCanvas.height = this._defaultLargeSquareTileSize * scaleFactor;
+ var context = largeCanvas.getContext("2d");
+ context.clearRect(0, 0, largeCanvas.width, largeCanvas.height);
+ context.fillStyle = "#000000";
+ context.fillRect(0, 0, largeCanvas.width, largeCanvas.height);
+ var peekImage = new Image;
+ peekImage.onload = function() {
+ var ratio = peekImage.naturalWidth / peekImage.naturalHeight;
+ var peekImageHeight = largeCanvas.height;
+ var peekImageWidth = ratio * largeCanvas.height;
+ var peekImageX = largeCanvas.width - peekImageWidth;
+ try {
+ context.drawImage(peekImage, peekImageX, 0, peekImageWidth, peekImageHeight);
+ var gradient = new Image;
+ gradient.onload = function loadGradient() {
+ try {
+ context.drawImage(gradient, 0, 0, largeCanvas.width, largeCanvas.height);
+ this.createTileImageFile(this._peekLargeImageFileName, largeCanvas.msToBlob(), scaleFactor).done(function(success) {
+ if (success)
+ this._lastSavedLargePeekImage = imageUri;
+ signal.complete()
+ }.bind(this))
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating peek images: " + exception);
+ this._lastSavedLargePeekImage = null;
+ signal.complete()
+ }
+ }.bind(this);
+ gradient.src = gradientFile
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating peek images: " + exception);
+ this._lastSavedLargePeekImage = null;
+ signal.complete()
+ }
+ }.bind(this);
+ peekImage.src = imageUri
+ }
+ else
+ signal.complete()
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating peek images: " + exception);
+ this._lastSavedLargePeekImage = null;
+ signal.complete()
+ }
+ return signal.promise
+ };
+ VideoTileManager.prototype.createWideTileImage = function(imageUri) {
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ try {
+ if (imageUri !== this._lastSavedWideTileImage) {
+ var largeCanvas = document.createElement("canvas");
+ var scaleFactor = 1.0;
+ var displayProperties = MS.Entertainment.Utilities.getDisplayProperties();
+ switch (displayProperties.resolutionScale) {
+ case Windows.Graphics.Display.ResolutionScale.scale100Percent:
+ break;
+ case Windows.Graphics.Display.ResolutionScale.scale140Percent:
+ scaleFactor = 1.4;
+ break;
+ case Windows.Graphics.Display.ResolutionScale.scale180Percent:
+ scaleFactor = 1.8;
+ break;
+ default:
+ MS.Entertainment.fail("Unknown scale factor in tile manager. Scale: " + displayProperties.resolutionScale);
+ break
+ }
+ largeCanvas.width = largeCanvas.height = this._defaultLargeSquareTileSize * scaleFactor;
+ var context = largeCanvas.getContext("2d");
+ context.clearRect(0, 0, largeCanvas.width, largeCanvas.height);
+ context.fillStyle = "#000000";
+ context.fillRect(0, 0, largeCanvas.width, largeCanvas.height);
+ var peekImage = new Image;
+ peekImage.onload = function() {
+ var peekImageHeight = largeCanvas.height;
+ var peekImageWidth = largeCanvas.width;
+ try {
+ context.drawImage(peekImage, 0, 0, peekImageWidth, peekImageHeight);
+ this.createTileImageFile(this._tileWideImageFileName, largeCanvas.msToBlob(), scaleFactor).done(function(success) {
+ if (success)
+ this._lastSavedWideTileImage = imageUri;
+ signal.complete()
+ }.bind(this))
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating peek images: " + exception);
+ this._lastSavedWideTileImage = null;
+ signal.complete()
+ }
+ }.bind(this);
+ peekImage.src = imageUri
+ }
+ else
+ signal.complete()
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating peek images: " + exception);
+ this._lastSavedWideTileImage = null;
+ signal.complete()
+ }
+ return signal.promise
+ };
+ VideoTileManager.prototype.displayMovieTile = function(currentMediaItem) {
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(currentMediaItem, 234, 320, null, null, null, MS.Entertainment.ImageContentType.png).done(function loadImage(uri) {
+ if (uri !== MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.movie)
+ this.completeMovieTile(currentMediaItem, uri);
+ else
+ this.completeMovieTile(currentMediaItem)
+ }.bind(this))
+ };
+ VideoTileManager.prototype.completeMovieTile = function(currentMediaItem, imageUri) {
+ var Notifications = Windows.UI.Notifications;
+ try {
+ var bigImagePromise = WinJS.Promise.as();
+ if (imageUri)
+ bigImagePromise = this.createComposedLargePeekImage(imageUri, this.movieGradient);
+ bigImagePromise.done(function finishMovieTile() {
+ var resumeString = String.load(String.id.IDS_MOGO_RESUME);
+ var squareTileXml = null;
+ try {
+ squareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._squareTemplate)
+ }
+ catch(ignoreErr) {}
+ if (!squareTileXml)
+ return;
+ squareTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
+ if (squareTileTextAttributes.length < 2)
+ return;
+ squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ squareTileTextAttributes[1].appendChild(squareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)));
+ var wideTileXml = null;
+ var wideTileTextAttributes = null;
+ if (imageUri) {
+ wideTileXml = Notifications.TileUpdateManager.getTemplateContent(this._widePosterTemplate);
+ var wideTileImageAttributes = wideTileXml.getElementsByTagName("image");
+ wideTileImageAttributes[0].setAttribute("src", imageUri);
+ wideTileTextAttributes = wideTileXml.getElementsByTagName("text");
+ wideTileTextAttributes[0].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)));
+ wideTileTextAttributes[1].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML("\r\n" + String.load(String.id.IDS_MOGO_XBOX_VIDEO_XENON).format(this._xboxLogo))))
+ }
+ else {
+ wideTileXml = Notifications.TileUpdateManager.getTemplateContent(this._wideNoImageTemplate);
+ wideTileTextAttributes = wideTileXml.getElementsByTagName("text");
+ wideTileTextAttributes[0].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)));
+ wideTileTextAttributes[2].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(String.load(String.id.IDS_MOGO_XBOX_VIDEO_XENON).format(this._xboxLogo))))
+ }
+ wideTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ wideTileXml.getElementsByTagName("visual")[0].appendChild(wideTileXml.importNode(squareTileXml.getElementsByTagName("binding")[0], true));
+ var largeSquareTileXml;
+ if (this._largeSquareTemplate) {
+ largeSquareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._largeSquareTemplate);
+ var largeSquareTileTextAttributes = largeSquareTileXml.getElementsByTagName("text");
+ if (this._lastSavedLargePeekImage) {
+ largeSquareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._largeSquarePeekTemplate);
+ var largeSquareTileImageAttributes = largeSquareTileXml.getElementsByTagName("image");
+ largeSquareTileImageAttributes[0].setAttribute("src", "ms-appdata:///local/" + this._peekLargeImageFileName);
+ largeSquareTileTextAttributes = largeSquareTileXml.getElementsByTagName("text");
+ largeSquareTileTextAttributes[0].appendChild(largeSquareTileXml.createTextNode(this._xboxLogo));
+ largeSquareTileTextAttributes[1].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ largeSquareTileTextAttributes[2].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)))
+ }
+ else {
+ largeSquareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._largeSquareTemplate);
+ largeSquareTileTextAttributes = largeSquareTileXml.getElementsByTagName("text");
+ largeSquareTileTextAttributes[6].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ largeSquareTileTextAttributes[7].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)))
+ }
+ largeSquareTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ wideTileXml.getElementsByTagName("visual")[0].appendChild(wideTileXml.importNode(largeSquareTileXml.getElementsByTagName("binding")[0], true))
+ }
+ var tileNotification = new Notifications.TileNotification(wideTileXml);
+ tileNotification.tag = this._nowPlayingTileTag;
+ var currentTime = new Date;
+ var expiryTime = new Date(currentTime.getTime() + this._expiryTime * 1000);
+ tileNotification.expirationTime = expiryTime;
+ if (this._tileUpdater)
+ try {
+ this._tileUpdater.clear();
+ this._tileUpdater.update(tileNotification)
+ }
+ catch(ignoreErr) {}
+ }.bind(this))
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating movie tile: " + exception)
+ }
+ };
+ VideoTileManager.prototype.displayNoMetadataTile = function(currentMediaItem) {
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(currentMediaItem, 310, 310, null, null, null, MS.Entertainment.ImageContentType.png).done(function loadImage(uri) {
+ if (uri !== MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.otherVideo)
+ this.completeNoMetadataTile(currentMediaItem, uri);
+ else
+ this.completeNoMetadataTile(currentMediaItem)
+ }.bind(this))
+ };
+ VideoTileManager.prototype.completeNoMetadataTile = function(currentMediaItem, imageUri) {
+ var Notifications = Windows.UI.Notifications;
+ try {
+ var bigImagePromise = WinJS.Promise.as();
+ var wideImagePromise = WinJS.Promise.as();
+ if (imageUri) {
+ bigImagePromise = this.createComposedLargePeekImage(imageUri, this.noMetadataGradient);
+ wideImagePromise = this.createWideTileImage(imageUri)
+ }
+ var imagePromises = [bigImagePromise, wideImagePromise];
+ WinJS.Promise.join(imagePromises).done(function finishNoMetadataTile() {
+ var resumeString = String.load(String.id.IDS_MOGO_RESUME);
+ var squareTileXml = null;
+ try {
+ squareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._squareTemplate)
+ }
+ catch(ignoreErr) {
+ return
+ }
+ if (!squareTileXml)
+ return;
+ try {
+ squareTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
+ if (squareTileTextAttributes.length < 2)
+ return;
+ squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ squareTileTextAttributes[1].appendChild(squareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)))
+ }
+ catch(ignoreErr) {
+ return
+ }
+ var wideTileXml = null;
+ if (imageUri) {
+ wideTileXml = Notifications.TileUpdateManager.getTemplateContent(this._wideSquareTemplate);
+ var wideTileImageAttributes = wideTileXml.getElementsByTagName("image");
+ wideTileImageAttributes[0].setAttribute("src", "ms-appdata:///local/" + this._tileWideImageFileName)
+ }
+ else
+ wideTileXml = Notifications.TileUpdateManager.getTemplateContent(this._wideNoImageTemplate);
+ wideTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ var wideTileTextAttributes = wideTileXml.getElementsByTagName("text");
+ wideTileTextAttributes[0].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ wideTileTextAttributes[1].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)));
+ wideTileTextAttributes[3].appendChild(wideTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(String.load(String.id.IDS_MOGO_XBOX_VIDEO_XENON).format(this._xboxLogo))));
+ wideTileXml.getElementsByTagName("visual")[0].appendChild(wideTileXml.importNode(squareTileXml.getElementsByTagName("binding")[0], true));
+ var largeSquareTileXml;
+ var largeSquareTileTextAttributes;
+ if (this._largeSquareTemplate) {
+ if (this._lastSavedLargePeekImage) {
+ largeSquareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._largeSquarePeekTemplate);
+ var largeSquareTileImageAttributes = largeSquareTileXml.getElementsByTagName("image");
+ largeSquareTileImageAttributes[0].setAttribute("src", "ms-appdata:///local/" + this._peekLargeImageFileName);
+ largeSquareTileTextAttributes = largeSquareTileXml.getElementsByTagName("text");
+ largeSquareTileTextAttributes[0].appendChild(largeSquareTileXml.createTextNode(this._xboxLogo));
+ largeSquareTileTextAttributes[1].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ largeSquareTileTextAttributes[2].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)))
+ }
+ else {
+ largeSquareTileXml = Notifications.TileUpdateManager.getTemplateContent(this._largeSquareTemplate);
+ largeSquareTileTextAttributes = largeSquareTileXml.getElementsByTagName("text");
+ largeSquareTileTextAttributes[6].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(resumeString)));
+ largeSquareTileTextAttributes[7].appendChild(largeSquareTileXml.createTextNode(MS.Entertainment.Utilities.simpleEscapeHTML(currentMediaItem.name)))
+ }
+ largeSquareTileXml.getElementsByTagName("binding")[0].setAttribute("branding", "name");
+ wideTileXml.getElementsByTagName("visual")[0].appendChild(wideTileXml.importNode(largeSquareTileXml.getElementsByTagName("binding")[0], true))
+ }
+ var tileNotification = new Notifications.TileNotification(wideTileXml);
+ tileNotification.tag = this._nowPlayingTileTag;
+ var currentTime = new Date;
+ var expiryTime = new Date(currentTime.getTime() + this._expiryTime * 1000);
+ tileNotification.expirationTime = expiryTime;
+ if (this._tileUpdater)
+ try {
+ this._tileUpdater.clear();
+ this._tileUpdater.update(tileNotification)
+ }
+ catch(ignoreErr) {}
+ }.bind(this))
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("Failure in tilemanager while creating non peek images: " + exception)
+ }
+ };
+ VideoTileManager.prototype.createTileImageFile = function(filename, imageBlob, scaleFactor) {
+ var fileName = filename;
+ var output = null;
+ var input = imageBlob.msDetachStream();
+ var pixels;
+ var pixelFormat;
+ var alphaMode;
+ var dpiX;
+ var dpiY;
+ var outputFilename;
+ return Windows.Graphics.Imaging.BitmapDecoder.createAsync(input).then(function convertBlob(decoder) {
+ var transform = new Windows.Graphics.Imaging.BitmapTransform;
+ transform.scaledHeight = decoder.orientedPixelHeight;
+ transform.scaledWidth = decoder.orientedPixelWidth;
+ transform.rotation = Windows.Graphics.Imaging.BitmapRotation.none;
+ pixelFormat = decoder.bitmapPixelFormat;
+ alphaMode = decoder.bitmapAlphaMode;
+ dpiX = decoder.dpiX;
+ dpiY = decoder.dpiY;
+ return decoder.getPixelDataAsync(pixelFormat, alphaMode, transform, Windows.Graphics.Imaging.ExifOrientationMode.respectExifOrientation, Windows.Graphics.Imaging.ColorManagementMode.colorManageToSRgb)
+ }.bind(this)).then(function(pixelProvider) {
+ pixels = pixelProvider.detachPixelData();
+ return Windows.Storage.ApplicationData.current.localFolder.createFileAsync(fileName, Windows.Storage.CreationCollisionOption.replaceExisting)
+ }.bind(this)).then(function getfileStream(file) {
+ return file.openAsync(Windows.Storage.FileAccessMode.readWrite)
+ }.bind(this)).then(function writeFile(fileStream) {
+ output = fileStream;
+ return Windows.Graphics.Imaging.BitmapEncoder.createAsync(Windows.Graphics.Imaging.BitmapEncoder.jpegEncoderId, fileStream)
+ }.bind(this)).then(function(encoder) {
+ encoder.setPixelData(pixelFormat, alphaMode, this._defaultLargeSquareTileSize * scaleFactor, this._defaultLargeSquareTileSize * scaleFactor, dpiX, dpiY, pixels);
+ return encoder.flushAsync()
+ }.bind(this)).then(function() {
+ input && input.close();
+ output && output.close();
+ return true
+ }.bind(this), function(error) {
+ this.canvasImageErrorHandler(error, input, output);
+ return false
+ }.bind(this))
+ };
+ VideoTileManager.prototype.canvasImageErrorHandler = function(error, input, output) {
+ if (input)
+ input.close();
+ if (output)
+ output.close();
+ MS.Entertainment.Framework.assert(false, "Failure while creating peek image file: " + error)
+ };
+ VideoTileManager.prototype.transportStateChanged = function() {
+ if (this._playbackSession && this._playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped)
+ this.clearTile();
+ else
+ this.updateMetadata()
+ };
+ return VideoTileManager
+ })();
+ Framework.VideoTileManager = VideoTileManager
+ })(Entertainment.Framework || (Entertainment.Framework = {}));
+ var Framework = Entertainment.Framework
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.tileManager, function TileManagerFactory() {
+ return new MS.Entertainment.Framework.VideoTileManager
+})
diff --git a/packages/microsoft.zunevideo/Framework/abTestingUtilities.js b/packages/microsoft.zunevideo/Framework/abTestingUtilities.js
new file mode 100644
index 00000000..0bd40000
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/abTestingUtilities.js
@@ -0,0 +1,145 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+this.scriptValidator("/Framework/debug.js");
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Utilities");
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Utilities) {
+ var ABTesting = (function() {
+ function ABTesting(){}
+ ABTesting.registerABTest = function(abTest, abGroups) {
+ MS.Entertainment.UI.Framework.assert(abTest, "Calling registerABTest with an empty abTest name");
+ MS.Entertainment.UI.Framework.assert(abGroups, "Calling registerABTest an empty list of groups");
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.UI.Framework.assert(configurationManager.abTestingOverrides[abTest] !== undefined, "Calling registerABTest on a test that was not registered in ConfigurationManager");
+ if (configurationManager.abTestingOverrides[abTest] === undefined)
+ return;
+ var numGroups = abGroups.length;
+ if (numGroups === 0)
+ return;
+ if (ABTesting._abGroups === null)
+ ABTesting._abGroups = [];
+ if (ABTesting._abGroups[abTest])
+ return;
+ var percentages = 0;
+ var i = 0;
+ var validPercentages = true;
+ for (i = 0; i < abGroups.length; i++) {
+ if (abGroups[i].percentage === undefined || typeof abGroups[i].percentage !== "number") {
+ validPercentages = false;
+ break
+ }
+ percentages = percentages + abGroups[i].percentage
+ }
+ validPercentages = validPercentages && percentages === 100;
+ if (!validPercentages) {
+ var numGroups = abGroups.length;
+ var percentPerGroup = 100 / numGroups;
+ for (i = 0; i < abGroups.length; i++)
+ abGroups[i].percentage = percentPerGroup
+ }
+ ABTesting._abGroups[abTest] = abGroups
+ };
+ ABTesting.isABTestRegistered = function(abTest) {
+ return (ABTesting._abGroups && ABTesting._abGroups[abTest])
+ };
+ ABTesting.getABGroupOverride = function(abTest) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.abTestingOverrides[abTest]
+ };
+ ABTesting.getABGroupNumber = function(abTest) {
+ MS.Entertainment.UI.Framework.assert(ABTesting.isABTestRegistered(abTest), "Calling getABGroupNumber on a group that is not registered");
+ var abGroupNumber = ABTesting.getABGroupOverride(abTest);
+ if (abGroupNumber !== undefined && abGroupNumber === -1) {
+ var settingsStorage = null;
+ if (MS.Entertainment.Utilities.isApp1)
+ settingsStorage = Windows.Storage.ApplicationData.current.roamingSettings;
+ else
+ settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ abGroupNumber = settingsStorage.values["ABTests_" + abTest]
+ }
+ return abGroupNumber
+ };
+ ABTesting.getABGroupName = function(abTest) {
+ MS.Entertainment.UI.Framework.assert(ABTesting.isABTestRegistered(abTest), "Calling getABGroupName on a group that is not registered");
+ if (!ABTesting.isABTestRegistered(abTest))
+ return String.empty;
+ var abGroupNumber = ABTesting.getABGroupNumber(abTest);
+ if (abGroupNumber !== undefined && abGroupNumber !== -1)
+ return ABTesting._abGroups[abTest][abGroupNumber] ? ABTesting._abGroups[abTest][abGroupNumber].abGroupName : String.empty;
+ return String.empty
+ };
+ ABTesting.createABGroupNumber = function(abTest) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.UI.Framework.assert(configurationManager.abTestingOverrides[abTest] !== undefined, "Calling createABGroupName on a test that was not registered in ConfigurationManager");
+ if (configurationManager.abTestingOverrides[abTest] === undefined)
+ return String.empty;
+ var abGroupName = ABTesting.getABGroupName(abTest);
+ if (!abGroupName) {
+ var abGroups = null;
+ MS.Entertainment.UI.Framework.assert(ABTesting.isABTestRegistered(abTest), "Calling createABGroupName on a group that is not registered");
+ if (ABTesting.isABTestRegistered(abTest))
+ abGroups = ABTesting._abGroups[abTest];
+ if (!abGroups)
+ return String.empty;
+ var flightNumber = configurationManager.telemetry.flightNumber;
+ var randNum = Math.floor(flightNumber / 100);
+ var sumPerc = 0;
+ var abGroupNumber = 0;
+ while (randNum > sumPerc) {
+ sumPerc += abGroups[abGroupNumber].percentage;
+ abGroupNumber++
+ }
+ abGroupNumber = abGroupNumber === 0 ? 0 : abGroupNumber - 1;
+ abGroupName = abGroups[abGroupNumber].abGroupName;
+ var settingsStorage = null;
+ if (MS.Entertainment.Utilities.isApp1)
+ settingsStorage = Windows.Storage.ApplicationData.current.roamingSettings;
+ else
+ settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ settingsStorage.values["ABTests_" + abTest] = abGroupNumber;
+ ABTesting.logABGroupCreate(abTest)
+ }
+ return abGroupName
+ };
+ ABTesting.getABGroupNameForTelemetry = function(abTest) {
+ var abGroupName = String.empty;
+ if (!ABTesting.isABTestRegistered(abTest))
+ return abGroupName;
+ var abGroupOverride = ABTesting.getABGroupOverride(abTest);
+ if (abGroupOverride === undefined || abGroupOverride === -1 || typeof abGroupOverride !== "number") {
+ var abGroupNameT = ABTesting.getABGroupName(abTest);
+ if (abGroupNameT)
+ abGroupName = abGroupNameT
+ }
+ return abGroupName
+ };
+ ABTesting.logABGroupCreate = function(abTest) {
+ var abGroupName = ABTesting.getABGroupNameForTelemetry(abTest);
+ if (abGroupName !== String.empty)
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray("ABGroupCreated", [{
+ parameterName: "GroupName", parameterValue: abGroupName
+ }])
+ };
+ ABTesting.logABGroupName = function(datapoint, abTest) {
+ var abGroupName = ABTesting.getABGroupNameForTelemetry(abTest);
+ if (!!abGroupName)
+ datapoint.appendParameter(abTest, abGroupName)
+ };
+ ABTesting.setABGroupNumber = function(abTest, abGroupNumber) {
+ var settingsStorage = null;
+ if (MS.Entertainment.Utilities.isApp1)
+ settingsStorage = Windows.Storage.ApplicationData.current.roamingSettings;
+ else
+ settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ settingsStorage.values["ABTests_" + abTest] = abGroupNumber
+ };
+ ABTesting._abGroups = null;
+ return ABTesting
+ })();
+ Utilities.ABTesting = ABTesting
+ })(Entertainment.Utilities || (Entertainment.Utilities = {}));
+ var Utilities = Entertainment.Utilities
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Framework/abTests.js b/packages/microsoft.zunevideo/Framework/abTests.js
new file mode 100644
index 00000000..dd7f6a9f
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/abTests.js
@@ -0,0 +1,80 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+this.scriptValidator("/Framework/debug.js");
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Utilities) {
+ var ABGroup = (function() {
+ function ABGroup(abGroupName, percentage) {
+ this.abGroupName = abGroupName;
+ this.percentage = percentage
+ }
+ return ABGroup
+ })();
+ Utilities.ABGroup = ABGroup
+ })(Entertainment.Utilities || (Entertainment.Utilities = {}));
+ var Utilities = Entertainment.Utilities
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Utilities) {
+ var ABTestsEnum = (function() {
+ function ABTestsEnum(){}
+ ABTestsEnum.testABTests = "testABTests";
+ ABTestsEnum.musicUpsellBannerMessage = "musicUpsellBannerMessage";
+ ABTestsEnum.musicUpsellBannerAction = "musicUpsellBannerAction";
+ ABTestsEnum.videoPostRoll = "videoPostRoll";
+ ABTestsEnum.videoPostRollNoMovieMarketplace = "videoPostRollNoMovieMarketplace";
+ ABTestsEnum.videoPostRollNoTvMarketplace = "videoPostRollNoTvMarketplace";
+ return ABTestsEnum
+ })();
+ Utilities.ABTestsEnum = ABTestsEnum;
+ (function(ABGroupNames) {
+ var MusicUpsellBannerMessage = (function() {
+ function MusicUpsellBannerMessage(){}
+ MusicUpsellBannerMessage.option1 = "IDS_MUSIC_UPSELL_BANNER_{0}TEXT";
+ MusicUpsellBannerMessage.option2 = "IDS_MUSIC_UPSELL_BANNER_{0}TEXT2";
+ MusicUpsellBannerMessage.option3 = "IDS_MUSIC_UPSELL_BANNER_{0}TEXT3";
+ MusicUpsellBannerMessage.option4 = "IDS_MUSIC_UPSELL_BANNER_{0}TEXT4";
+ return MusicUpsellBannerMessage
+ })();
+ ABGroupNames.MusicUpsellBannerMessage = MusicUpsellBannerMessage;
+ var MusicUpsellBannerAction = (function() {
+ function MusicUpsellBannerAction(){}
+ MusicUpsellBannerAction.option1 = "IDS_MUSIC_UPSELL_BANNER_SIGN_{0}_ACTION";
+ MusicUpsellBannerAction.option2 = "IDS_MUSIC_UPSELL_BANNER_SIGN_{0}_ACTION2";
+ return MusicUpsellBannerAction
+ })();
+ ABGroupNames.MusicUpsellBannerAction = MusicUpsellBannerAction;
+ var VideoPostRoll = (function() {
+ function VideoPostRoll(){}
+ VideoPostRoll.Control = "Control";
+ VideoPostRoll.MovieStore = "MovieStore";
+ VideoPostRoll.TvStore = "TvStore";
+ return VideoPostRoll
+ })();
+ ABGroupNames.VideoPostRoll = VideoPostRoll;
+ var VideoPostRollNoMovieMarketplace = (function() {
+ function VideoPostRollNoMovieMarketplace(){}
+ VideoPostRollNoMovieMarketplace.Control = "Control";
+ VideoPostRollNoMovieMarketplace.TvStore = "TvStore";
+ return VideoPostRollNoMovieMarketplace
+ })();
+ ABGroupNames.VideoPostRollNoMovieMarketplace = VideoPostRollNoMovieMarketplace;
+ var VideoPostRollNoTvMarketplace = (function() {
+ function VideoPostRollNoTvMarketplace(){}
+ VideoPostRollNoTvMarketplace.Control = "Control";
+ VideoPostRollNoTvMarketplace.MovieStore = "MovieStore";
+ return VideoPostRollNoTvMarketplace
+ })();
+ ABGroupNames.VideoPostRollNoTvMarketplace = VideoPostRollNoTvMarketplace
+ })(Utilities.ABGroupNames || (Utilities.ABGroupNames = {}));
+ var ABGroupNames = Utilities.ABGroupNames
+ })(Entertainment.Utilities || (Entertainment.Utilities = {}));
+ var Utilities = Entertainment.Utilities
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Framework/data/ObservableArrayVirtualListAdapter.js b/packages/microsoft.zunevideo/Framework/data/ObservableArrayVirtualListAdapter.js
new file mode 100644
index 00000000..0906c820
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/data/ObservableArrayVirtualListAdapter.js
@@ -0,0 +1,150 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Data) {
+ var ObservableArrayVirtualListAdapter = (function(_super) {
+ __extends(ObservableArrayVirtualListAdapter, _super);
+ function ObservableArrayVirtualListAdapter() {
+ _super.call(this);
+ this._virtualList = null;
+ this._disposed = false;
+ this._initialized = false;
+ this._itemFactory = null;
+ this._inNotificationBatch = false;
+ this.maxItems = Number.MAX_VALUE;
+ this.pagingDelayMS = 250;
+ this.pageInDataOnItemRemoved = false
+ }
+ ObservableArrayVirtualListAdapter.prototype.dispose = function() {
+ if (!this._disposed) {
+ this._clear();
+ this._disposed = true
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype.initialize = function(virtualList, itemFactory) {
+ MS.Entertainment.assert(virtualList, "virtualList argument expected");
+ MS.Entertainment.assert(itemFactory, "itemFactory argument expected");
+ MS.Entertainment.assert(!this._initialized, "initialize should only be called once!");
+ this._initialized = true;
+ this._itemFactory = itemFactory;
+ this._clear();
+ this._virtualList = virtualList;
+ return this._pageInVirtualListData()
+ };
+ ObservableArrayVirtualListAdapter.prototype._pageInVirtualListData = function() {
+ var _this = this;
+ var itemsPromise = WinJS.Promise.as();
+ if (this._virtualList && !this._disposed)
+ itemsPromise = this._virtualList.itemsFromIndex(this.length).then(function(result) {
+ if (_this._disposed)
+ return;
+ if (result && result.items && _this._virtualList && !_this._disposed) {
+ if (!_this.length)
+ _this._virtualList.setNotificationHandler({
+ beginNotifications: _this._beginNotifications.bind(_this), endNotifications: _this._endNotifications.bind(_this), invalidateAll: _this._invalidateAll.bind(_this), inserted: _this._inserted.bind(_this), removed: _this._removed.bind(_this), changed: _this._changed.bind(_this), moved: _this._moved.bind(_this)
+ });
+ var maxLength = Math.min(result.items.length, _this.maxItems);
+ for (var i = result.offset; (i < maxLength) && (_this.length < _this.maxItems); i++)
+ _this.push(_this._itemFactory(result.items[i].data));
+ if (result.totalCount > _this.length && _this.length < _this.maxItems)
+ WinJS.Promise.timeout(_this.pagingDelayMS).done(function() {
+ if (_this._disposed)
+ return;
+ _this._pageInVirtualListData()
+ })
+ }
+ }, function(error) {
+ MS.Entertainment.fail("itemsFromIndex failed!" + (error && error.message))
+ });
+ return itemsPromise
+ };
+ ObservableArrayVirtualListAdapter.prototype._clear = function() {
+ if (this._virtualList) {
+ this._virtualList.setNotificationHandler(null);
+ this._virtualList = null
+ }
+ if (this.length)
+ this.splice(0, this.length)
+ };
+ ObservableArrayVirtualListAdapter.prototype._beginNotifications = function() {
+ this._inNotificationBatch = true
+ };
+ ObservableArrayVirtualListAdapter.prototype._endNotifications = function() {
+ this._inNotificationBatch = false;
+ this._pageInDataForRemovedItems()
+ };
+ ObservableArrayVirtualListAdapter.prototype._pageInDataForRemovedItems = function() {
+ if (this._shouldPageInDataForRemovedItems())
+ this._invalidateAll()
+ };
+ ObservableArrayVirtualListAdapter.prototype._shouldPageInDataForRemovedItems = function() {
+ return this.pageInDataOnItemRemoved && !this._inNotificationBatch && (this.length < this.maxItems) && (this.length < this._virtualList.count)
+ };
+ ObservableArrayVirtualListAdapter.prototype._invalidateAll = function() {
+ if (!this._disposed) {
+ this.splice(0, this.length);
+ this._pageInVirtualListData()
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._inserted = function(item, keyBefore, keyAfter, index) {
+ if (!this._disposed) {
+ MS.Entertainment.assert(index >= 0 && (index <= this.length || index > this.maxItems), "index out of bounds");
+ if (index >= 0 && index <= this.length && index < this.maxItems) {
+ if (this.length === this.maxItems)
+ this.pop();
+ if (index >= this.length)
+ this.push(this._itemFactory(item.data));
+ else
+ this.splice(index, 0, this._itemFactory(item.data))
+ }
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._removed = function(key, index) {
+ if (!this._disposed) {
+ MS.Entertainment.assert(index >= 0 && (index < this.length || index >= this.maxItems), "index out of bounds");
+ if (index >= 0 && index < this.length) {
+ this.splice(index, 1);
+ this._pageInDataForRemovedItems()
+ }
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._changed = function(newValue, oldValue) {
+ if (!this._disposed) {
+ var index = this._virtualList.indexFromKey(oldValue.key);
+ MS.Entertainment.assert(index >= 0 && (index < this.length || index >= this.maxItems), "index out of bounds");
+ if (index >= 0 && index < this.length) {
+ var item = this.item(index);
+ item.data = newValue.data
+ }
+ }
+ };
+ ObservableArrayVirtualListAdapter.prototype._moved = function(item, keyBefore, keyAfter, oldIndex, newIndex) {
+ if (!this._disposed) {
+ MS.Entertainment.assert(this.maxItems === Number.MAX_VALUE, "move action is not currently supported when maxItems is set");
+ MS.Entertainment.assert(oldIndex >= 0 && (oldIndex < this.length || oldIndex >= this.maxItems), "oldIndex out of bounds");
+ MS.Entertainment.assert(newIndex >= 0 && (newIndex < this.length || newIndex >= this.maxItems), "newIndex out of bounds");
+ if (oldIndex >= 0 && oldIndex < this.length && newIndex >= 0 && newIndex < this.length) {
+ this.splice(oldIndex, 1);
+ this.splice(newIndex, 0, item)
+ }
+ }
+ };
+ return ObservableArrayVirtualListAdapter
+ })(Entertainment.ObservableArray);
+ Data.ObservableArrayVirtualListAdapter = ObservableArrayVirtualListAdapter
+ })(Entertainment.Data || (Entertainment.Data = {}));
+ var Data = Entertainment.Data
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/Framework/data/xboxLive.js b/packages/microsoft.zunevideo/Framework/data/xboxLive.js
new file mode 100644
index 00000000..2901d07b
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/data/xboxLive.js
@@ -0,0 +1,27 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/serviceLocator.js");
+(function(MSE) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {XboxLive: MS.Entertainment.UI.Framework.define(function xboxLive(){}, {createUser: function createUser(xuid, gamerTag) {
+ var user;
+ if (xuid && gamerTag)
+ user = new Microsoft.Xbox.User(xuid, gamerTag);
+ else if (xuid)
+ user = new Microsoft.Xbox.User(xuid);
+ else
+ user = new Microsoft.Xbox.User;
+ return user
+ }}, {
+ factory: function() {
+ return new MSE.Data.XboxLive
+ }, isHttpOfflineError: function(errorCode) {
+ var result = false;
+ if (errorCode === MS.Entertainment.Data.XboxLive.ErrorCodes.httpConnectionTimeout || errorCode === MS.Entertainment.Data.XboxLive.ErrorCodes.httpInternalServerError || errorCode === MS.Entertainment.Data.XboxLive.ErrorCodes.httpResourceNotFound)
+ result = true;
+ return result
+ }, ErrorCodes: {
+ httpInvalidRequest: -2146697204, httpAuthRequired: -2146697207, httpForbidden: -2146697209, httpObjectNotFound: -2146697210, httpConnectionTimeout: -2146697205, httpInternalServerError: -2146697208, httpResourceNotFound: -2146697211
+ }, MAX_TITLE_ACTIVITY_COUNT: 25000
+ })});
+ MSE.ServiceLocator.register(MSE.Services.xboxLive, MSE.Data.XboxLive.factory)
+})(WinJS.Namespace.define("MS.Entertainment", null))
diff --git a/packages/microsoft.zunevideo/Framework/data/xhr.js b/packages/microsoft.zunevideo/Framework/data/xhr.js
new file mode 100644
index 00000000..d955c4a2
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/data/xhr.js
@@ -0,0 +1,15 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/serviceLocator.js");
+(function(MSE) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {XhrService: MS.Entertainment.UI.Framework.define(function xhrServiceConstructor() {
+ throw"XhrService contains only static methods.";
+ }, {}, {
+ execute: function(values) {
+ return WinJS.xhr(values)
+ }, factory: function() {
+ return MSE.Data.XhrService
+ }
+ })});
+ MSE.ServiceLocator.register(MSE.Services.xhr, MSE.Data.XhrService.factory)
+})(WinJS.Namespace.define("MS.Entertainment", null))
diff --git a/packages/microsoft.zunevideo/Framework/featureEnablement.js b/packages/microsoft.zunevideo/Framework/featureEnablement.js
new file mode 100644
index 00000000..163706ac
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/featureEnablement.js
@@ -0,0 +1,51 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment", {FeatureEnablement: {
+ _featureEnablement: null, _featuresChangedCallback: null, initialize: function initialize() {
+ if (!MS.Entertainment.FeatureEnablement._featureEnablement) {
+ MS.Entertainment.FeatureEnablement._featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ MS.Entertainment.FeatureEnablement._featureEnablement.addEventListener("featureschangedevent", MS.Entertainment.FeatureEnablement.featuresChangedHandler, false)
+ }
+ }, featuresChangedHandler: function featuresChangedHandler(eventArgs) {
+ var oldFeatures = eventArgs.oldFeatures;
+ var newFeatures = eventArgs.newFeatures;
+ var featuresChanged = false;
+ var featuresDisabled = false;
+ var features = MS.Entertainment.Features.appFeatures || [];
+ for (var i = 0; i < features.length; i++) {
+ var feature = features[i];
+ if (oldFeatures && newFeatures && oldFeatures[feature] !== newFeatures[feature]) {
+ featuresChanged = true;
+ if (oldFeatures[feature] && !newFeatures[feature])
+ featuresDisabled = true
+ }
+ }
+ if (featuresChanged) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appNotification)) {
+ var notification;
+ var notificationType = MS.Entertainment.UI.Notification.Type.Informational;
+ var title = String.load(String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER);
+ var subTitle = featuresDisabled ? String.load(String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED) : String.load(String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED);
+ var icon = WinJS.UI.AppBarIcon.settings;
+ var category = MS.Entertainment.FeatureEnablement.featureNotificationCategory;
+ var isPersistent = false;
+ notification = new MS.Entertainment.UI.Notification({
+ notificationType: notificationType, title: title, subTitle: subTitle, icon: icon, category: category, isPersistent: isPersistent
+ });
+ var appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ appNotificationService.send(notification)
+ }
+ if (MS.Entertainment.Features.refreshApp)
+ MS.Entertainment.Features.refreshApp()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer).checkAndRunUpgradeReminder(true);
+ if (MS.Entertainment.FeatureEnablement._featuresChangedCallback)
+ MS.Entertainment.FeatureEnablement._featuresChangedCallback()
+ }, setFeaturesChangedCallback: function setFeaturesChangedCallback(callback) {
+ MS.Entertainment.FeatureEnablement._featuresChangedCallback = callback
+ }, featureNotificationCategory: "FeaturesChangedNotification"
+ }})
+})()
diff --git a/packages/microsoft.zunevideo/Framework/fileActivationHandler.js b/packages/microsoft.zunevideo/Framework/fileActivationHandler.js
new file mode 100644
index 00000000..8db04b07
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/fileActivationHandler.js
@@ -0,0 +1,522 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Activation", {
+ showNowDefaultDelayMS: 10000, localImageFileNameforMTC: "localImageFileForMTC.png", fileActivationHandler: function fileActivationHandler(e, isAppRunning, suppressNavigateToImmersive) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: start");
+ try {
+ if (MS.Entertainment.Utilities.isMusicApp && MS.Entertainment.Activation.isSingleSong(e)) {
+ var fileItem = e.files[0];
+ return MS.Entertainment.Activation.startTagPlaybackForSong(fileItem, isAppRunning).then(function onStartTagPlaybackForSong() {
+ return MS.Entertainment.Activation.handoffSongToPlaybackPlatform.bind(this, fileItem, suppressNavigateToImmersive, false)
+ }, function onStartTagPlaybackForSongError() {
+ return MS.Entertainment.Activation.handoffSongToPlaybackPlatform.bind(this, fileItem, suppressNavigateToImmersive, true)
+ }).done(null, function ignoreError(){})
+ }
+ else {
+ var fileItems = e.files;
+ if (fileItems.size === 1) {
+ var fileItem = fileItems[0];
+ var fileType = String.empty;
+ if (fileItem.fileType)
+ fileType = fileItem.fileType.toLowerCase();
+ if (MS.Entertainment.Utilities.isMusicApp && MS.Entertainment.Activation._isPlaylist(fileType))
+ return MS.Entertainment.Activation._processPlaylist(fileItem, suppressNavigateToImmersive);
+ else
+ return MS.Entertainment.Activation.retrievePropertiesAndPlay(fileItems, null, suppressNavigateToImmersive)
+ }
+ else if (fileItems.size > 1)
+ return MS.Entertainment.Activation.retrievePropertiesAndPlay(fileItems, e.acquisition, suppressNavigateToImmersive);
+ else
+ return WinJS.Promise.wrap()
+ }
+ }
+ catch(ex) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("fileActivationHandler() exception thrown: " + ex.message);
+ var title = String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE);
+ return MS.Entertainment.UI.Shell.showError(title, MS.Entertainment.Platform.Playback.Error.NS_E_WMP_ACCESS_DENIED)
+ }
+ }, startTagPlaybackForSong: function startTagPlaybackForSong(fileItem, isAppRunning) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: playLocalSong, name=" + fileItem.name);
+ if (isAppRunning) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ if (playbackSession && playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ sessionMgr.clearCachedPBMState()
+ }
+ else if (Windows && Windows.Media && Windows.Media.MediaControl) {
+ var mediaControls = Windows.Media.MediaControl;
+ try {
+ mediaControls.addEventListener("playpausetogglepressed", function audioControlPlayPause(){}, false);
+ mediaControls.addEventListener("playpressed", function audioControlPlay(){}, false);
+ mediaControls.addEventListener("stoppressed", function audioControlStop(){}, false);
+ mediaControls.addEventListener("pausepressed", function audioControlPause(){}, false);
+ mediaControls.addEventListener("soundlevelchanged", function audioSoundlevelchanged(){}, false)
+ }
+ catch(ex) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("Non-fatal exception caught in mediaControls.addEventListener: " + JSON.stringify(ex))
+ }
+ }
+ var beforeReady = new Date;
+ return WinJS.Utilities.ready().then(function doPlayLocalSong() {
+ var delayedBy = (new Date - beforeReady);
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: waiting for document ready for " + delayedBy + "ms");
+ var audioTag;
+ try {
+ audioTag = document.createElement("audio");
+ audioTag.setAttribute("msAudioCategory", "backgroundCapableMedia");
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var hasSubscription = configurationManager.service.lastSignedInUserSubscription;
+ if (hasSubscription) {
+ var mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager;
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
+ var copyProtectionSystems = new Windows.Foundation.Collections.PropertySet;
+ copyProtectionSystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput";
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = copyProtectionSystems;
+ audioTag.msSetMediaProtectionManager(mediaProtectionManager)
+ }
+ }
+ catch(exception) {
+ var description = "playLocalSong: audioTag creation failure: " + exception.description;
+ MS.Entertainment.UI.Controls.fail(description);
+ return WinJS.Promise.wrapError(description)
+ }
+ if (MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation) {
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation.pause();
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation.removeAttribute("src");
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation = null
+ }
+ MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation = audioTag;
+ var onPlaying = function onPlaying() {
+ if (MS.Entertainment.Activation.navigateToDefaultPromise)
+ MS.Entertainment.Activation.navigateToDefaultPromise.cancel();
+ MS.Entertainment.Activation.navigateToDefaultPromise = null;
+ if (fileItem.fileType && fileItem.fileType.toLowerCase() === ".wma")
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayProtectedContent();
+ else
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayNonProtectedContent();
+ audioTag.removeEventListener("playing", onPlaying)
+ };
+ audioTag.addEventListener("playing", onPlaying);
+ audioTag.autoplay = true;
+ audioTag.src = URL.createObjectURL(fileItem, {oneTimeOnly: false});
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ audioTag.volume = volumeControllerService.volume;
+ audioTag.muted = volumeControllerService.mute;
+ return WinJS.Promise.wrap(audioTag)
+ })
+ }, handoffSongToPlaybackPlatform: function handoffSongToPlaybackPlatform(fileItem, suppressNavigateToImmersive, autoPlay) {
+ var completion = null;
+ var error = null;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c;
+ error = e
+ });
+ var mediaItem;
+ var queryPromise;
+ if (fileItem.path)
+ queryPromise = WinJS.Promise.timeout(400).then(function queryForTrack() {
+ var trackQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ trackQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ trackQuery.chunkSize = 1;
+ trackQuery.aggregateChunks = false;
+ trackQuery.trackUrl = fileItem.path;
+ return trackQuery.getItemsArrayAndIgnoreErrors()
+ });
+ else
+ queryPromise = WinJS.Promise.wrap();
+ queryPromise = queryPromise.then(function getMediaItem(trackArray) {
+ if (trackArray && trackArray.length === 1)
+ mediaItem = trackArray[0];
+ else {
+ var dataToAugment = {
+ fileItem: fileItem, musicProps: {title: fileItem.displayName}
+ };
+ mediaItem = MS.Entertainment.Data.augment(dataToAugment, MS.Entertainment.Data.Augmenter.FileActivation.Track);
+ if (mediaItem)
+ mediaItem.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, Microsoft.Entertainment.Platform.AcquisitionContextType.track)
+ }
+ var retrievePropertiesPromise;
+ if (mediaItem && mediaItem.fileItem)
+ retrievePropertiesPromise = MS.Entertainment.Activation.retrieveProperties(mediaItem.fileItem, Microsoft.Entertainment.Platform.AcquisitionContextType.track).then(function onGetProperties(result) {
+ if (result && result.mediaItem && mediaItem.inCollection)
+ mediaItem.imageUri = result.mediaItem.imageUri;
+ else
+ mediaItem = result.mediaItem
+ });
+ return WinJS.Promise.as(retrievePropertiesPromise)
+ });
+ var waitPromise = WinJS.Promise.timeout(1200);
+ WinJS.Promise.join([waitPromise, queryPromise]).done(function playTrack() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService)) {
+ var displayService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService);
+ if (displayService)
+ displayService.showDialogForNonCriticalErrors = true
+ }
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(mediaItem, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: autoPlay, showImmersive: false, preventNavigateToDefault: true, showAppBar: false, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true
+ }, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, saveNowPlaying: false, playContext: {activationFilePath: mediaItem && mediaItem.activationFilePath}
+ })
+ }, function playTrack_error(e) {
+ MS.Entertainment.UI.Controls.fail("fileActivationHandler: Error in playTrack" + e)
+ });
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ MS.Entertainment.Activation.navigateToDefaultPromise = WinJS.Promise.timeout(MS.Entertainment.Activation.showNowDefaultDelayMS).then(function() {
+ if (sessionMgr.primarySession.errorDescriptor) {
+ var traceMsg = "File Activation Handler: playback failed ";
+ traceMsg += "- Player State :" + sessionMgr.primarySession.playerState;
+ traceMsg += " : Current transport State :" + sessionMgr.primarySession.currentTransportState;
+ traceMsg += " : Error Code :" + MS.Entertainment.Platform.Playback.errorToString(sessionMgr.primarySession.errorDescriptor.msExtendedCode);
+ MS.Entertainment.Platform.Playback.Etw.traceString(traceMsg)
+ }
+ error("fileActivationHandler::navigateToDefaultPromise");
+ sessionMgr.primarySession.unbind("currentTransportState", onCurrentTransportStateChanged)
+ }, function onError(){});
+ var onCurrentTransportStateChanged = function onCurrentTransportStateChanged(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("File Activation Handler: playback playing");
+ sessionMgr.primarySession.unbind("currentTransportState", onCurrentTransportStateChanged);
+ if (MS.Entertainment.Activation.navigateToDefaultPromise)
+ MS.Entertainment.Activation.navigateToDefaultPromise.cancel();
+ MS.Entertainment.Activation.navigateToDefaultPromise = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.clearBackStackOnNextNavigate(true)
+ }
+ if (suppressNavigateToImmersive)
+ completion();
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true, completeCallback: function completeLoad() {
+ WinJS.Promise.timeout(100).then(function complete() {
+ completion()
+ })
+ }
+ })
+ }
+ };
+ sessionMgr.primarySession.bind("currentTransportState", onCurrentTransportStateChanged)
+ }
+ else
+ completion();
+ return promise
+ }, retrieveProperties: function retrieveProperties(fileItem, acquisitionContextType, fileOptions) {
+ var promise;
+ var result = {
+ unsupportedType: true, mediaItem: null, error: null
+ };
+ var fileIsAudio = false;
+ var fileIsVideo = false;
+ var contentType = String.empty;
+ var fileType = String.empty;
+ var fileOptions = fileOptions || {};
+ contentType = MS.Entertainment.Utilities.getMediaFileContentType(fileItem);
+ fileType = MS.Entertainment.Utilities.getMediaFileFileType(fileItem);
+ if (MS.Entertainment.Activation._isPlaylist(fileType))
+ return MS.Entertainment.Activation._processPlaylist(fileItem);
+ else if (contentType.indexOf("audio", 0) === 0)
+ fileIsAudio = true;
+ else if (contentType.indexOf("video", 0) === 0 || fileType === ".ts" || fileType === ".divx" || fileType === ".xvid" || fileType === ".mkv")
+ fileIsVideo = true;
+ result.unsupportedType = !(fileIsAudio || fileIsVideo);
+ if (result.unsupportedType) {
+ MS.Entertainment.UI.Actions.assert(MS.Entertainment.Utilities.isAmsterdamApp, "We managed to open a file that is neither audio nor video, this should not happen");
+ fileIsVideo = MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isAmsterdamApp;
+ fileIsAudio = MS.Entertainment.Utilities.isMusicApp
+ }
+ try {
+ if ((MS.Entertainment.Utilities.isMusicApp && (fileIsAudio || (fileType === ".mp4"))) || (MS.Entertainment.Utilities.isAmsterdamApp && fileIsAudio)) {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp && fileItem.path)
+ promise = WinJS.Promise.timeout().then(function queryForTrack() {
+ var trackQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ trackQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, acquisitionContextType);
+ trackQuery.trackUrl = fileItem.path;
+ trackQuery.chunkSize = 1;
+ trackQuery.aggregateChunks = false;
+ return trackQuery.getItemsArrayAndIgnoreErrors()
+ });
+ else
+ promise = WinJS.Promise.wrap();
+ promise = promise.then(function getMediaItem(trackArray) {
+ if (trackArray && trackArray.length === 1) {
+ result.mediaItem = trackArray[0];
+ return result
+ }
+ var musicPropertiesRetrievalPromise;
+ try {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ musicPropertiesRetrievalPromise = fileItem.properties.getMusicPropertiesAsync();
+ else
+ musicPropertiesRetrievalPromise = MS.Entertainment.Data.Factory.MediaBrowser.storageItemToAugmentedItem(fileItem).hydrate()
+ }
+ catch(ex) {
+ MS.Entertainment.UI.Controls.fail("fileActivationHandler: Error in getMusicPropertiesAsync: ", ex.message);
+ MS.Entertainment.Platform.Playback.Etw.traceString("fileActivationHandler: Error in getMusicPropertiesAsync: " + ex.message);
+ result.error = ex;
+ return WinJS.Promise.wrapError(result)
+ }
+ return musicPropertiesRetrievalPromise.then(function onRetrievedMusicProps(musicProps) {
+ var dataToAugment = {};
+ dataToAugment.fileItem = fileItem;
+ dataToAugment.musicProps = musicProps;
+ var mediaItem = MS.Entertainment.Data.augment(dataToAugment, MS.Entertainment.Data.Augmenter.FileActivation.Track);
+ if (!mediaItem.name)
+ mediaItem.name = fileItem.name;
+ if (fileOptions.trackIndex >= 0)
+ musicProps.playlistIndex = fileOptions.trackIndex;
+ mediaItem.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.explorerFile, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ result.mediaItem = mediaItem;
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ return WinJS.Promise.timeout(2000)
+ }, function onRetrievedMusicPropsError(error) {
+ result.error = error;
+ return WinJS.Promise.wrapError(result)
+ }).then(function onPreGetThumbnailAsync() {
+ if (MS.Entertainment.Utilities.isAmsterdamApp)
+ return WinJS.Promise.as(null);
+ else
+ fileItem.getThumbnailAsync.bind(fileItem, Windows.Storage.FileProperties.ThumbnailMode.musicView, 100)
+ }).then(function onThumbnailRetrieved(thumbnail) {
+ if (thumbnail && result.mediaItem) {
+ result.mediaItem.imageUri = MS.Entertainment.Data.Factory.oneTimeUseBlob(thumbnail);
+ if (thumbnail.type !== Windows.Storage.FileProperties.ThumbnailType.icon)
+ MS.Entertainment.Platform.Playback.makeLocalImagePromise = MS.Entertainment.Platform.Playback.makeLocalImageFileFromThumbnailPromise(thumbnail);
+ else
+ result.mediaItem.imageUri = null;
+ return WinJS.Promise.as(result)
+ }
+ else if (result.mediaItem)
+ return WinJS.Promise.as(result)
+ }, function onThumbnailRetrieved_Error(error) {
+ result.error = error;
+ return WinJS.Promise.wrapError(result)
+ })
+ })
+ }
+ else if (fileIsVideo && (MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isAmsterdamApp)) {
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ var appView = Windows.UI.ViewManagement.ApplicationView;
+ if (appView)
+ appView.tryUnsnap()
+ }
+ var dataToAugment = {};
+ dataToAugment.fileItem = fileItem;
+ var mediaItem = MS.Entertainment.Data.augment(dataToAugment, MS.Entertainment.Data.Augmenter.FileActivation.Video);
+ if (!mediaItem.name)
+ mediaItem.name = fileItem.name;
+ result.mediaItem = mediaItem;
+ WinJS.Promise.timeout(2000).then(function getThumbnail() {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ fileItem.getThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.videosView, MS.Entertainment.UI.Shell.ImageLoader.DefaultThumbnailSizes.video).then(function onThumbnailRetrieved(thumbnail) {
+ if (thumbnail && mediaItem)
+ mediaItem.imageUri = MS.Entertainment.Data.Factory.oneTimeUseBlob(thumbnail);
+ {}
+ }, function onThumbnailRetrievedError(error) {
+ var description = "failed to retrieve thumbnail. error: " + error.message;
+ MS.Entertainment.UI.Controls.fail(description)
+ })
+ });
+ promise = WinJS.Promise.as(result)
+ }
+ else {
+ result.error = new Error("Invalid type");
+ promise = WinJS.Promise.as(result)
+ }
+ }
+ catch(exception) {
+ MS.Entertainment.UI.Controls.assert(false, exception.description);
+ promise = WinJS.Promise.wrapError(exception.description)
+ }
+ return promise
+ }, retrievePropertiesAndPlay: function retrievePropertiesAndPlay(fileItems, playlistAcquisition, suppressNavigateToImmersive, fileOptions) {
+ var firstItem = null;
+ var currentPromise;
+ var promises = [];
+ var i;
+ var fileOptions = fileOptions || {};
+ var videoPlayback = MS.Entertainment.Utilities.isVideoApp;
+ function _onFirstResolvedProperties(result) {
+ var completion = null;
+ var error = null;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c;
+ error = e
+ });
+ if (firstItem) {
+ completion();
+ return promise
+ }
+ else if (!result || !result.mediaItem || result.error) {
+ error(result);
+ return promise
+ }
+ var hasCurrentPage = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (videoPlayback)
+ navigationService.clearBackStackOnNextNavigate(true);
+ hasCurrentPage = !!navigationService.currentPage
+ }
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (videoPlayback || hasCurrentPage) {
+ var completePromise = function completePromise(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing || newValue === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ completion();
+ sessionMgr.primarySession.unbind("currentTransportState", completePromise);
+ sessionMgr.primarySession.unbind("playerState", completePromise)
+ }
+ };
+ sessionMgr.primarySession.bind("currentTransportState", completePromise);
+ sessionMgr.primarySession.bind("playerState", completePromise)
+ }
+ firstItem = result.mediaItem;
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(firstItem, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, autoPlay: true, showImmersive: videoPlayback, preventNavigateToDefault: !videoPlayback || suppressNavigateToImmersive, showAppBar: hasCurrentPage && !videoPlayback, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, immersiveOptions: {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true
+ }, playContext: {activationFilePath: firstItem.activationFilePath}, saveNowPlaying: false
+ });
+ if (!videoPlayback && !hasCurrentPage) {
+ var navigateToDefaultPromise = WinJS.Promise.timeout(MS.Entertainment.Activation.showNowDefaultDelayMS).then(function() {
+ error("fileActivationHandler::navigateToDefaultPromise");
+ sessionMgr.primarySession.unbind("currentTransportState", navigateToImmersive)
+ }, function onError(){});
+ var navigateToImmersive = function navigateToImmersive(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ navigateToDefaultPromise.cancel();
+ navigateToDefaultPromise = null;
+ if (navigationService)
+ navigationService.clearBackStackOnNextNavigate(true);
+ if (!suppressNavigateToImmersive && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, startFullScreen: true, completeCallback: function completeLoad() {
+ WinJS.Promise.timeout(100).then(function complete() {
+ completion()
+ })
+ }
+ });
+ else
+ completion();
+ sessionMgr.primarySession.unbind("currentTransportState", navigateToImmersive)
+ }
+ };
+ sessionMgr.primarySession.bind("currentTransportState", navigateToImmersive)
+ }
+ return promise
+ }
+ {};
+ function _onAllResolvedProperties(results) {
+ var j;
+ var unsupportedType;
+ var playingItems = !!firstItem;
+ if (!videoPlayback)
+ if (fileOptions.queueItems) {
+ var mediaItems = results.map(function extractMediaItems(result) {
+ if (result && result.mediaItem)
+ return result.mediaItem
+ });
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(mediaItems, {
+ queueMedia: true, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, preventNavigateToDefault: suppressNavigateToImmersive
+ })
+ }
+ else
+ for (var i = 0; i < results.length; i++) {
+ var result = results[i];
+ if (result && result.mediaItem && firstItem !== result.mediaItem)
+ if (!firstItem && !fileOptions.queueItems)
+ return _onFirstResolvedProperties(result).then(function processRemainingResults() {
+ return _onAllResolvedProperties(results)
+ });
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(result.mediaItem, {
+ queueMedia: true, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.fileActivation, preventNavigateToDefault: suppressNavigateToImmersive
+ });
+ else if (result && result.unsupportedType)
+ unsupportedType = true
+ }
+ if (!playingItems && unsupportedType)
+ this._showError(String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE), MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_SRC_NOT_SUPPORTED.code)
+ }
+ {};
+ var firstPromise = null;
+ for (i = 0; i < fileItems.length; i++) {
+ currentPromise = MS.Entertainment.Activation.retrieveProperties(fileItems[i], playlistAcquisition || Microsoft.Entertainment.Platform.AcquisitionContextType.track, {trackIndex: fileOptions.firstTrackIndex >= 0 ? fileOptions.firstTrackIndex + i : null});
+ if (i === 0 && !fileOptions.queueItems) {
+ firstPromise = currentPromise;
+ firstPromise.then(function onRetrieveProperties(result) {
+ return _onFirstResolvedProperties(result)
+ }).then(null, function onRetrievePropertiesError(result) {
+ if (videoPlayback && fileItems.length === 1) {
+ var title = String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE);
+ if (result && result.unsupportedType)
+ this._showError(title, MS.Entertainment.Platform.Playback.Error.MF_E_UNSUPPORTED_BYTESTREAM.code);
+ else
+ this._showError(title, MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_GENERIC.code)
+ }
+ }.bind(this))
+ }
+ else
+ promises.push(currentPromise)
+ }
+ var processRest = function processRest() {
+ return WinJS.Promise.join(promises).then(_onAllResolvedProperties.bind(this), function onJoinError(){})
+ };
+ if (!fileOptions.queueItems) {
+ firstPromise.then(processRest, processRest);
+ return firstPromise
+ }
+ else
+ return processRest()
+ }, isSingleSong: function isSingleSong(e) {
+ var fileItems = e.files;
+ var single = false;
+ try {
+ if (fileItems.size === 1) {
+ var fileItem = fileItems[0];
+ var contentType = String.empty;
+ var fileIsAudio = false;
+ if (fileItem.contentType)
+ contentType = fileItem.contentType.toLowerCase();
+ if (contentType)
+ fileIsAudio = (contentType.indexOf("audio", 0) === 0);
+ if (fileItem.fileType)
+ fileIsAudio = fileIsAudio && !MS.Entertainment.Activation._isPlaylist(fileItem.fileType.toLowerCase());
+ if (fileIsAudio)
+ single = true
+ }
+ }
+ catch(ex) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("isSingleSong() exception thrown: " + ex.message)
+ }
+ return single
+ }, _isPlaylist: function _isPlaylist(fileType) {
+ return (fileType === ".wpl" || fileType === ".zpl" || fileType === ".m3u")
+ }, _processPlaylist: function _processPlaylist(fileItem, suppressNavigateToImmersive) {
+ try {
+ return Windows.Media.Playlists.Playlist.loadAsync(fileItem).then(function processPlaylist(playlist) {
+ return MS.Entertainment.Activation.fileActivationHandler({
+ files: playlist.files, acquisition: Microsoft.Entertainment.Platform.AcquisitionContextType.playlist
+ }, null, suppressNavigateToImmersive)
+ }, function onError(error) {
+ if (error.number)
+ if (error.number === -2147024809)
+ this._showError(String.load(String.id.IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE), MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_PLAYLIST_PATH_NOT_SUPPORTED.code);
+ else
+ this._showError(String.load(String.id.IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE), error.number);
+ return WinJS.Promise.wrapError()
+ }.bind(this))
+ }
+ catch(e) {
+ return WinJS.Promise.wrapError()
+ }
+ }, _showError: function _showError(title, errorCode) {
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/MessageBox.html", "messageBoxTemplate", true).done(function onLoadCompleted() {
+ MS.Entertainment.UI.Shell.showError(title, errorCode)
+ }, function onLoadError(error) {
+ MS.Entertainment.UI.Components.Shell.fail("failed to load MessageBox loadTemplate for file activation: " + error && error.message)
+ })
+ }
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Framework/launchAppAction.js b/packages/microsoft.zunevideo/Framework/launchAppAction.js
new file mode 100644
index 00000000..82a16236
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/launchAppAction.js
@@ -0,0 +1,77 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function(undefined) {
+ "use strict";
+ scriptValidator();
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {LaunchApp: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function launchAppConstructor() {
+ this.base()
+ }, {
+ executed: function executed(param) {
+ try {
+ var uri = new Windows.Foundation.Uri(param.uri);
+ var options = new Windows.System.LauncherOptions;
+ options.displayApplicationPicker = false;
+ options.treatAsUntrusted = false;
+ var preferredApplicationPackageFamilyName;
+ var preferredApplicationDisplayName;
+ if (param.familyName && param.displayName) {
+ preferredApplicationPackageFamilyName = param.familyName;
+ preferredApplicationDisplayName = param.displayName
+ }
+ else {
+ var parts = param.uri.split(":");
+ MS.Entertainment.UI.Actions.assert(parts && parts.length > 1, "uri is invalid");
+ if (parts && parts.length > 1)
+ switch (parts[0]) {
+ case"microsoftmusic":
+ preferredApplicationPackageFamilyName = "Microsoft.ZuneMusic_8wekyb3d8bbwe";
+ preferredApplicationDisplayName = String.load(String.id.IDS_MUSIC_APP_TITLE);
+ break;
+ case"microsoftvideo":
+ preferredApplicationPackageFamilyName = "Microsoft.ZuneVideo_8wekyb3d8bbwe";
+ preferredApplicationDisplayName = String.load(String.id.IDS_VIDEO_APP_TITLE);
+ break
+ }
+ }
+ if (preferredApplicationPackageFamilyName && preferredApplicationDisplayName) {
+ options.preferredApplicationDisplayName = preferredApplicationDisplayName;
+ options.preferredApplicationPackageFamilyName = preferredApplicationPackageFamilyName
+ }
+ if (param.appendGamerTag) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (signIn.isSignedIn) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (uri.rawUri.indexOf("?") === -1)
+ uri = new Windows.Foundation.Uri(uri.rawUri + "?gamerTag=" + signedInUser.gamerTag);
+ else
+ uri = new Windows.Foundation.Uri(uri.rawUri + "&gamerTag=" + signedInUser.gamerTag)
+ }
+ }
+ if (param.appendSource)
+ for (var appMode in Microsoft.Entertainment.Application.AppMode)
+ if (MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode[appMode]) {
+ if (uri.rawUri.indexOf("?") === -1)
+ uri = new Windows.Foundation.Uri(uri.rawUri + "?source=" + appMode);
+ else
+ uri = new Windows.Foundation.Uri(uri.rawUri + "&source=" + appMode);
+ break
+ }
+ if (param.useFallback && preferredApplicationPackageFamilyName)
+ try {
+ options.fallbackUri = new Windows.Foundation.Uri("ms-windows-store:PDP?PFN=" + preferredApplicationPackageFamilyName)
+ }
+ catch(e) {}
+ Windows.System.Launcher.launchUriAsync(uri, options).then(function launchSuccess(s){}, function launchFailure(e){})
+ }
+ catch(error) {
+ MS.Entertainment.UI.Actions.assert(false, error)
+ }
+ }, canExecute: function canExecute(param) {
+ return (param && param.uri) && typeof param.uri === "string"
+ }
+ })});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp, function() {
+ return new MS.Entertainment.UI.Actions.LaunchApp
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Framework/navigation.js b/packages/microsoft.zunevideo/Framework/navigation.js
new file mode 100644
index 00000000..222261d5
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/navigation.js
@@ -0,0 +1,698 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Navigation");
+ WinJS.Namespace.define("MS.Entertainment.Navigation", {NavigationDirection: {
+ forward: "forward", backward: "backward"
+ }});
+ WinJS.Namespace.define("MS.Entertainment.Navigation", {
+ BackStack: MS.Entertainment.defineObservable(function backStackConstructor() {
+ this._stack = []
+ }, {
+ StackEntry: WinJS.Class.define(function stackEntryConstructor(page, hub, panel) {
+ this.page = page;
+ this.hub = hub;
+ this.panel = panel
+ }, {
+ page: null, hub: null, panel: null
+ }), _maxSize: 10, _stack: null, canNavigateBack: false, _updateCanNavigateBack: function _updateCanNavigateBack() {
+ this.canNavigateBack = this._stack.length > 0
+ }, navigateTo: function navigateTo(page, hub, panel) {
+ page.clearDataContext();
+ this._stack.push(new this.StackEntry(page, hub, panel));
+ if (this._stack.length > this._maxSize)
+ this._stack = this._stack.slice(this._stack.length - this._maxSize);
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.hide)
+ appBar.hide();
+ this._updateCanNavigateBack()
+ }, navigateBack: function navigateBack() {
+ var outboundEntry = null;
+ if (this.canNavigateBack)
+ outboundEntry = this._stack.pop();
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.hide)
+ appBar.hide();
+ this._updateCanNavigateBack();
+ return outboundEntry
+ }, peekNavigateBack: function peekNavigateBack() {
+ var outboundEntry;
+ if (this.canNavigateBack && this._stack.length)
+ outboundEntry = this._stack[this._stack.length - 1];
+ return outboundEntry
+ }, clear: function clear() {
+ this._stack = [];
+ this._updateCanNavigateBack()
+ }, getTestHooks: function getTestHooks() {
+ var that = this;
+ return {
+ getNavigationHistory: function getNavigationHistory() {
+ return that._stack.slice()
+ }, setMaxSize: function setMaxSize(newMax) {
+ that._maxSize = newMax
+ }, getMaxSize: function getMaxSize() {
+ return that._maxSize
+ }
+ }
+ }
+ }), Navigation: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function navigationConstructor(ia) {
+ this._ia = ia;
+ this._backStack = new MS.Entertainment.Navigation.BackStack;
+ if (MS.Entertainment.Utilities.isApp2) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ MS.Entertainment.UI.Framework.addEventHandlers(uiStateService, {isAppVisibleChanged: function() {
+ if (!uiStateService.isAppVisible)
+ this.forceExitToSystemOnBack = false
+ }.bind(this)})
+ }
+ }, {
+ _ia: null, _backStack: null, _clearBackStackOnNextNavigate: false, _domUpdatesEnabled: true, _navigationFocusTimeout: 5000, _maxEnterAnimationTimeout: 20000, canNavigateBack: MS.Entertainment.UI.Framework.observableProperty("canNavigateBack", false), overrideHideBackButton: MS.Entertainment.UI.Framework.observableProperty("overrideHideBackButton", false), navigationDirection: MS.Entertainment.UI.Framework.observableProperty("navigationDirection", MS.Entertainment.Navigation.NavigationDirection.forward), hasBackStack: MS.Entertainment.UI.Framework.observableProperty("hasBackStack", false), currentPage: MS.Entertainment.UI.Framework.observableProperty("currentPage", null, true), currentHub: MS.Entertainment.UI.Framework.observableProperty("currentHub", null), currentPanel: MS.Entertainment.UI.Framework.observableProperty("currentPanel", null), lastNavigationWasPage: MS.Entertainment.UI.Framework.observableProperty("lastNavigationWasPage", false), skipEnterAnimationOnNextNavigation: false, forceExitToSystemOnBack: false, _callOnNavigatingAway: function _callOnNavigatingAway(previous, next) {
+ if (previous) {
+ if (previous.dispatchEvent)
+ previous.dispatchEvent("onNavigatingAway", {
+ previous: previous, next: next
+ });
+ if (previous.onNavigatingAway)
+ return previous.onNavigatingAway(next)
+ }
+ }, _callOnNavigateAway: function _callOnNavigateAway(previous, next) {
+ if (previous) {
+ if (previous.dispatchEvent)
+ previous.dispatchEvent("onNavigateAway", {
+ previous: previous, next: next
+ });
+ if (previous.onNavigateAway)
+ return previous.onNavigateAway(next)
+ }
+ }, _callOnNavigatingTo: function _callOnNavigatingTo(previous, next) {
+ if (next) {
+ if (next.dispatchEvent)
+ next.dispatchEvent("onNavigatingTo", {
+ previous: previous, next: next
+ });
+ if (next.onNavigatingTo)
+ return next.onNavigatingTo(previous)
+ }
+ }, _callOnNavigateTo: function _callOnNavigateTo(previous, next) {
+ if (next) {
+ if (next.dispatchEvent)
+ next.dispatchEvent("onNavigateTo", {
+ previous: previous, next: next
+ });
+ if (next.onNavigateTo)
+ return next.onNavigateTo(previous)
+ }
+ }, _findViewModelSet: function _findViewModelSet(pageNode, hubNode, panelNode, forcePageChange) {
+ var pageViewModel = this._findPageViewModel(pageNode, forcePageChange);
+ var hubViewModel = this._findHubViewModel(pageNode, pageViewModel, hubNode, panelNode);
+ var panelViewModel = this._findPanelViewModel(pageNode, hubNode, hubViewModel, panelNode);
+ return {
+ page: pageViewModel, hub: hubViewModel, panel: panelViewModel
+ }
+ }, _findPageViewModel: function _findPageViewModel(pageNode, forcePageChange) {
+ var pageViewModel = null;
+ if (pageNode && (pageNode.alwaysPutOnBackStack || forcePageChange || !this.currentPage || pageNode !== WinJS.Binding.unwrap(this.currentPage).iaNode))
+ pageViewModel = this._ia.getViewFromNode(pageNode);
+ else
+ pageViewModel = WinJS.Binding.unwrap(this.currentPage);
+ MS.Entertainment.Navigation.assert(pageViewModel, "No page was found for the view model set.");
+ return pageViewModel
+ }, _findHubViewModel: function _findHubViewModel(pageNode, pageViewModel, hubNode, panelNode) {
+ var hubViewModel = null;
+ if (pageViewModel.hubs && pageViewModel.hubs.length) {
+ if (hubNode) {
+ hubViewModel = MS.Entertainment.Utilities.searchArray(pageViewModel.hubs, function hubMonikerMatch(candidateHub) {
+ return candidateHub.iaNode.moniker === hubNode.moniker
+ });
+ MS.Entertainment.Navigation.assert(hubViewModel, "Mismatched page and hub; that page does not contain that hub. Ignoring hub parameter…")
+ }
+ if (!hubViewModel)
+ if (pageNode) {
+ if (panelNode) {
+ hubViewModel = MS.Entertainment.Utilities.searchArray(pageViewModel.hubs, function panelsContainPanel(candidateHub) {
+ return !!MS.Entertainment.Utilities.searchArray(candidateHub.panels, function panelMonikerMatch(candidatePanel) {
+ return candidatePanel.iaNode.moniker === panelNode.moniker
+ })
+ }.bind(this));
+ MS.Entertainment.Navigation.assert(hubViewModel, "Mismatched page and panel; that page does not contain that panel. Ignoring panel parameter…")
+ }
+ if (!hubViewModel && pageViewModel.iaNode.defaultChild)
+ hubViewModel = MS.Entertainment.Utilities.searchArray(pageViewModel.hubs, function hubMonikerMatch(candidateHub) {
+ return candidateHub.iaNode.moniker === pageViewModel.iaNode.defaultChild.moniker
+ });
+ if (!hubViewModel)
+ hubViewModel = pageViewModel.hubs[0]
+ }
+ else
+ hubViewModel = WinJS.Binding.unwrap(this.currentHub)
+ }
+ return hubViewModel
+ }, _findPanelViewModel: function _findPanelViewModel(pageNode, hubNode, hubViewModel, panelNode) {
+ var panelViewModel = null;
+ if (hubViewModel && hubViewModel.panels && hubViewModel.panels.length) {
+ if (panelNode) {
+ panelViewModel = MS.Entertainment.Utilities.searchArray(hubViewModel.panels, function panelMonikerMatch(candidatePanel) {
+ return candidatePanel.iaNode.moniker === panelNode.moniker
+ });
+ MS.Entertainment.Navigation.assert(panelViewModel, "Mismatched hub and panel; that hub does not contain that panel. Ignoring panel parameter…")
+ }
+ if (!panelViewModel)
+ if (pageNode || hubNode) {
+ if (hubViewModel.iaNode.defaultChild)
+ panelViewModel = MS.Entertainment.Utilities.searchArray(hubViewModel.panels, function panelMonikerMatch(candidatePanel) {
+ return candidatePanel.iaNode.moniker === hubViewModel.iaNode.defaultChild.moniker
+ });
+ if (!panelViewModel)
+ panelViewModel = hubViewModel.panels[0]
+ }
+ else
+ panelViewModel = WinJS.Binding.unwrap(this.currentPanel)
+ }
+ return panelViewModel
+ }, _updateCurrentLocation: function _updateCurrentLocation(cacheOperation, page, hub, panel, args) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ var oldPage = WinJS.Binding.unwrap(this.currentPage);
+ var pageIsChanging = (page !== oldPage);
+ var oldHub = WinJS.Binding.unwrap(this.currentHub);
+ var hubIsChanging = (hub !== oldHub);
+ var oldPanel = WinJS.Binding.unwrap(this.currentPanel);
+ var panelIsChanging = (panel !== oldPanel);
+ var pageMoniker = page && page.iaNode.moniker;
+ var hubMoniker = hub && hub.iaNode.moniker;
+ var panelMoniker = panel && panel.iaNode.moniker;
+ eventProvider.traceLocation_Changed(pageMoniker || "", hubMoniker || "", panelMoniker || "");
+ if (pageIsChanging && page)
+ eventProvider.traceNavigation_Started(page.iaNode.moniker);
+ this.lastNavigationWasPage = pageIsChanging;
+ if (pageIsChanging)
+ if (this._callOnNavigateAway(oldPage, page))
+ return MS.Entertainment.Navigation.Navigation.MoveResult.leavingBlocked;
+ if (hubIsChanging)
+ if (this._callOnNavigateAway(oldHub, hub))
+ return MS.Entertainment.Navigation.Navigation.MoveResult.leavingBlocked;
+ if (panelIsChanging)
+ if (this._callOnNavigateAway(oldPanel, panel))
+ return MS.Entertainment.Navigation.Navigation.MoveResult.leavingBlocked;
+ if (pageIsChanging) {
+ if (this._callOnNavigatingTo(oldPage, page))
+ return MS.Entertainment.Navigation.Navigation.MoveResult.enteringBlocked;
+ {}
+ }
+ if (hubIsChanging) {
+ if (this._callOnNavigatingTo(oldHub, hub))
+ return MS.Entertainment.Navigation.Navigation.MoveResult.enteringBlocked;
+ {}
+ }
+ if (panelIsChanging) {
+ if (this._callOnNavigatingTo(oldPanel, panel))
+ return MS.Entertainment.Navigation.Navigation.MoveResult.enteringBlocked;
+ {}
+ }
+ if (pageIsChanging)
+ this.currentPage = page;
+ if (hubIsChanging)
+ this.currentHub = hub;
+ if (panelIsChanging)
+ this.currentPanel = panel;
+ if (args)
+ this.currentPage.options = args;
+ if (pageIsChanging || hubIsChanging || panelIsChanging)
+ this._updateDOM(pageIsChanging, cacheOperation, oldPage, page, hub, panel);
+ if (pageIsChanging)
+ this._callOnNavigateTo(oldPage, page);
+ if (hubIsChanging)
+ this._callOnNavigateTo(oldHub, hub);
+ if (panelIsChanging)
+ this._callOnNavigateTo(oldPanel, panel);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PageName, parameterValue: this.getUserLocation()
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.X8NewPage, telemetryParameterArray);
+ return MS.Entertainment.Navigation.Navigation.MoveResult.completed
+ }, _updateDOM: (function() {
+ var pageDOMNodeMap = [];
+ var cacheSizeLimit = 5;
+ var currentPageAutomationId = "currentPage";
+ function findCachedPageInformation(page) {
+ var cachedPageInformation;
+ for (var i = 0; i < pageDOMNodeMap.length; i++) {
+ cachedPageInformation = pageDOMNodeMap[i];
+ if (cachedPageInformation.page === page)
+ break;
+ else
+ cachedPageInformation = null
+ }
+ return cachedPageInformation
+ }
+ function insertPageToCache(pageToAdd, currentPage, rootNode, element) {
+ var indexOfPageToRemove;
+ var removedPage;
+ if (pageDOMNodeMap.length >= cacheSizeLimit) {
+ for (var i = 0; i < pageDOMNodeMap.length; i++)
+ if ((pageDOMNodeMap[i].page.iaNode !== rootNode) && (pageDOMNodeMap[i].page !== currentPage)) {
+ indexOfPageToRemove = i;
+ break
+ }
+ removedPage = pageDOMNodeMap.splice(indexOfPageToRemove, 1);
+ MS.Entertainment.Navigation.assert(removedPage.length === 1, "While cleaning up the cached navigation state, incorrect items were removed: " + removedPage.length);
+ removedPage[0].element.parentElement.removeChild(removedPage[0].element)
+ }
+ pageDOMNodeMap.push({
+ page: pageToAdd, element: element
+ })
+ }
+ function removePageFromCache(pageToRemove) {
+ MS.Entertainment.Navigation.assert(pageToRemove, "No page was supplied");
+ var indexToRemove = pageDOMNodeMap.indexOf(pageToRemove);
+ MS.Entertainment.Navigation.assert(indexToRemove > -1, "Page wasn't found in DOM cache");
+ pageDOMNodeMap.splice(indexToRemove, 1)
+ }
+ function hideOldPage(oldPageInformation, removeFromCache) {
+ return MS.Entertainment.Utilities.freezeControlsInSubtree(oldPageInformation.element).then(function() {
+ var returnPromise = null;
+ if (removeFromCache)
+ returnPromise = MS.Entertainment.Utilities.removeChild(oldPageInformation.element.parentElement, oldPageInformation.element, true).then(function afterRemove() {
+ removePageFromCache(oldPageInformation)
+ });
+ else {
+ if (oldPageInformation.page && oldPageInformation.page.specialFocusedElement) {
+ oldPageInformation.focusedElement = WinJS.Binding.unwrap(oldPageInformation.page).specialFocusedElement;
+ WinJS.Binding.unwrap(oldPageInformation.page).specialFocusedElement = null
+ }
+ else
+ oldPageInformation.focusedElement = document.activeElement;
+ if (MS.Entertainment.Utilities.isApp2)
+ oldPageInformation.blockingInput = MS.Entertainment.UI.Framework.addEventHandlers(oldPageInformation.element, {
+ keydown: dropInput, keyup: dropInput, keypress: dropInput
+ }, true);
+ returnPromise = MS.Entertainment.Utilities.exitElement(oldPageInformation.element)
+ }
+ returnPromise.done(function cleanUpPage() {
+ oldPageInformation.element.removeAttribute("data-win-automationid");
+ WinJS.Utilities.removeClass(oldPageInformation.element, currentPageAutomationId)
+ });
+ return returnPromise
+ })
+ }
+ function hideOldPages(cacheOperation, oldPage, newPage) {
+ var completed = WinJS.Promise.as();
+ if (cacheOperation === MS.Entertainment.Navigation.Navigation.DOMCacheOperation.removeAllPages) {
+ if (WinJS.Utilities.getMember("Social.UI")) {
+ var profilePicker = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePicker);
+ if (profilePicker) {
+ var profilePickerContainer = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePickerContainer);
+ if (profilePickerContainer && !profilePickerContainer.firstElementChild) {
+ profilePicker.domElement.suppressUnload = true;
+ profilePickerContainer.appendChild(profilePicker.domElement)
+ }
+ }
+ }
+ var removedPages = [];
+ for (var i = pageDOMNodeMap.length - 1; i >= 0; i--) {
+ var pageInformation = pageDOMNodeMap[i];
+ if (WinJS.Binding.unwrap(pageInformation.page) !== WinJS.Binding.unwrap(newPage))
+ removedPages.push(hideOldPage(pageInformation, true))
+ }
+ completed = WinJS.Promise.join(removedPages)
+ }
+ else {
+ var oldPageInformation = findCachedPageInformation(oldPage);
+ if (oldPageInformation) {
+ var removeFromCache = (cacheOperation === MS.Entertainment.Navigation.Navigation.DOMCacheOperation.removePage);
+ completed = hideOldPage(oldPageInformation, removeFromCache)
+ }
+ }
+ return completed
+ }
+ function updateClassesOnUnsnapped(oldPage, newPage) {
+ if (!newPage || !oldPage || newPage.iaNode.moniker !== oldPage.iaNode.moniker) {
+ var background = document.getElementById("htmlUnsnapped");
+ if (newPage)
+ WinJS.Utilities.addClass(background, newPage.iaNode.moniker);
+ if (oldPage)
+ WinJS.Utilities.removeClass(background, oldPage.iaNode.moniker)
+ }
+ }
+ function dropInput(e) {
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.invokeGlobalCommand:
+ case WinJS.Utilities.Key.searchButton:
+ case WinJS.Utilities.Key.dismissButton:
+ return
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ e.stopImmediatePropagation()
+ }
+ function restoreFocus(pageInformation, pageState, skipScroll) {
+ var focusTarget = pageInformation.focusedElement;
+ var pageElement = pageInformation.element;
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(pageElement))
+ return;
+ MS.Entertainment.UI.Framework.setFocusRoot(pageElement);
+ if (focusTarget && !MS.Entertainment.UI.Framework.focusedItemInContainer(pageElement)) {
+ if (!pageState.screenInteracted)
+ if (focusTarget.item && focusTarget.listView) {
+ if (MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus)
+ focusTarget.item.showFocus = true;
+ focusTarget.listView.currentItem = focusTarget.item
+ }
+ else
+ MS.Entertainment.UI.Framework.focusFirstFocusableAncestor(focusTarget, skipScroll);
+ if (document.activeElement)
+ pageInformation.focusedElement = null
+ }
+ }
+ return function _updateDOM(pageIsChanging, cacheOperation, oldPage, newPage, newHub, newPanel) {
+ var hubStrip;
+ var target;
+ var newPageInformation;
+ var oldPageInformation;
+ var oldPageElement;
+ if (this._domUpdatesEnabled)
+ if (pageIsChanging) {
+ var pageContainer = document.getElementById("pageContainer");
+ if (WinJS.UI.AutomaticFocus && pageContainer.contains(document.activeElement))
+ WinJS.UI.AutomaticFocus.focusRoot = null;
+ newPageInformation = findCachedPageInformation(newPage);
+ if ((cacheOperation === MS.Entertainment.Navigation.Navigation.DOMCacheOperation.removeAllPages) && !newPage) {
+ hideOldPages(cacheOperation, null, null);
+ updateClassesOnUnsnapped(oldPage)
+ }
+ else if (!newPageInformation) {
+ target = document.createElement("div");
+ target.setAttribute("data-win-automationid", currentPageAutomationId);
+ var pageTargetingMoniker = String.empty;
+ if (newPage.iaNode.useCurrentPageTargetingMoniker)
+ pageTargetingMoniker = " " + newPage.iaNode.moniker;
+ WinJS.Utilities.addClass(target, "pageContainer currentPage" + pageTargetingMoniker);
+ document.getElementById("pageContainer").appendChild(target);
+ MS.Entertainment.Utilities.hideElement(target);
+ insertPageToCache(newPage, oldPage, this._ia.rootNode, target);
+ updateClassesOnUnsnapped(oldPage, newPage);
+ hideOldPages(cacheOperation, oldPage, newPage);
+ var fragmentUrl = newPage.overrideFragmentUrl || "/Components/Shell/GalleryHubStrip.html";
+ var fragmentCompleted = MS.Entertainment.Utilities.loadHtmlPage(fragmentUrl, target).then(function navigationFragmentLoaded() {
+ this._updateDOM(false, cacheOperation, oldPage, newPage, newHub, newPanel);
+ MS.Entertainment.UI.Framework.currentContentContainer = target;
+ if (this.skipEnterAnimationOnNextNavigation) {
+ this.skipEnterAnimationOnNextNavigation = false;
+ return
+ }
+ return MS.Entertainment.Utilities.enterElement(target).then(function navigationPageEntered() {
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(target))
+ return;
+ MS.Entertainment.UI.Framework.setFocusRoot(target);
+ MS.Entertainment.UI.Framework.tryAndFocusElementInSubTreeWithTimer(target, this._navigationFocusTimeout);
+ var currentLocationTelemetry = this.getUserLocation();
+ var previousLocationTelemetry = null;
+ if (oldPage && oldPage.iaNode)
+ previousLocationTelemetry = oldPage.iaNode.moniker;
+ WinJS.Promise.timeout(this._navigationFocusTimeout).then(function sendPageView() {
+ MS.Entertainment.Utilities.Telemetry.logPageView(target, {uri: currentLocationTelemetry}, {uri: previousLocationTelemetry})
+ }.bind(this))
+ }.bind(this))
+ }.bind(this))
+ }
+ else {
+ hideOldPages(cacheOperation, oldPage, newPage);
+ WinJS.Promise.timeout().done(function showNewPage() {
+ updateClassesOnUnsnapped(oldPage, newPage);
+ newPageInformation.element.setAttribute("data-win-automationid", currentPageAutomationId);
+ WinJS.Utilities.addClass(newPageInformation.element, "currentPage");
+ var pageState = {screenInteracted: false};
+ var touchHandler = function touchHandler() {
+ pageState.screenInteracted = true
+ };
+ document.addEventListener("MSManipulationStateChanged", touchHandler, true);
+ if (newPageInformation.blockingInput) {
+ newPageInformation.blockingInput.cancel();
+ newPageInformation.blockingInput = null
+ }
+ MS.Entertainment.UI.Framework.currentContentContainer = newPageInformation.element;
+ var enterElementPromise = WinJS.Promise.timeout(this._maxEnterAnimationTimeout, MS.Entertainment.Utilities.enterElement(newPageInformation.element));
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Utilities.playBackButtonClick();
+ if (MS.Entertainment.Utilities.isApp2)
+ restoreFocus(newPageInformation, pageState, true);
+ enterElementPromise.done(function afterEnter() {
+ document.removeEventListener("MSManipulationStateChanged", touchHandler, true);
+ restoreFocus(newPageInformation, pageState);
+ var previousLocationTelemetry = null;
+ if (oldPage && oldPage.iaNode)
+ previousLocationTelemetry = oldPage.iaNode.moniker;
+ var currentLocationTelemetry = this.getUserLocation();
+ MS.Entertainment.Utilities.Telemetry.logPageView(target, {uri: currentLocationTelemetry}, {uri: previousLocationTelemetry})
+ }.bind(this), function enterAnimationError(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ MS.Entertainment.Navigation.fail("enterAnimations failed due to: " + (error && error.message));
+ document.removeEventListener("MSManipulationStateChanged", touchHandler, true)
+ });
+ MS.Entertainment.Utilities.thawControlsInSubtree(newPageInformation.element)
+ }.bind(this))
+ }
+ }
+ else {
+ newPageInformation = findCachedPageInformation(newPage);
+ MS.Entertainment.Navigation.assert(newPageInformation && newPageInformation.element, "No page DOM cache information found for: " + ((newPage && newPage.overrideFragmentUrl) || newPage));
+ var hubStripElement;
+ if (newPageInformation && newPageInformation.element)
+ hubStripElement = newPageInformation.element.querySelector(".navigationHost");
+ if (hubStripElement) {
+ hubStrip = hubStripElement.winControl;
+ hubStrip.onNavigateTo(newPage, newHub, newPanel)
+ }
+ }
+ }
+ })(), navigateTo: function navigateTo(page, hub, panel, navigationArguments, forcePageChange) {
+ this.navigationDirection = MS.Entertainment.Navigation.NavigationDirection.forward;
+ var viewSet = null;
+ var didFindValidDestination;
+ if (MS.Entertainment.Utilities.isApp2 && MS.Entertainment.Utilities.isAboveMemoryThreshold(App2.ApplicationModel.MemoryCleanupThreshold))
+ MS.Entertainment.UI.Framework.clearCaches(true);
+ if (typeof page === "string")
+ page = this._ia.getNode(page);
+ MS.Entertainment.Navigation.assert(!page || page instanceof MS.Entertainment.InformationArchitecture.Node, "The page argument to navigateTo() must be a string, an IA Node, or omitted.");
+ if (typeof hub === "string")
+ hub = this._ia.getNode(hub);
+ MS.Entertainment.Navigation.assert(!hub || hub instanceof MS.Entertainment.InformationArchitecture.Node, "The hub argument to navigateTo() must be a string, an IA Node, or omitted.");
+ if (typeof panel === "string")
+ panel = this._ia.getNode(panel);
+ MS.Entertainment.Navigation.assert(!panel || panel instanceof MS.Entertainment.InformationArchitecture.Node, "The panel argument to navigateTo() must be a string, an IA Node, or omitted.");
+ didFindValidDestination = !!(page || hub || panel);
+ MS.Entertainment.Navigation.assert(didFindValidDestination, "No valid destination found for navigation.");
+ if (!didFindValidDestination)
+ return didFindValidDestination;
+ viewSet = this._findViewModelSet(page, hub, panel, forcePageChange);
+ MS.Entertainment.Navigation.assert(viewSet && viewSet.hasOwnProperty("page") && viewSet.hasOwnProperty("hub") && viewSet.hasOwnProperty("panel"), "Navigation.navigateTo() was unable to find a view model set for the passed-in page, hub, and panel.");
+ if (this.currentPage && viewSet.page !== WinJS.Binding.unwrap(this.currentPage)) {
+ if (viewSet.page.perfTrackStartPoint)
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(viewSet.page.perfTrackStartPoint);
+ this._backStack.navigateTo(WinJS.Binding.unwrap(this.currentPage), WinJS.Binding.unwrap(this.currentHub), WinJS.Binding.unwrap(this.currentPanel));
+ this.overrideHideBackButton = ((navigationArguments && navigationArguments.hideBackButtonOnNavigate !== undefined && navigationArguments.hideBackButtonOnNavigate !== null) ? navigationArguments.hideBackButtonOnNavigate : false);
+ this.canNavigateBack = MS.Entertainment.Utilities.isApp2 || (viewSet.page.iaNode !== WinJS.Binding.unwrap(this._ia).rootNode);
+ this.hasBackStack = this._backStack.canNavigateBack;
+ if (navigationArguments && navigationArguments.showNotifications !== undefined && navigationArguments.showNotifications !== null)
+ viewSet.page.showNotifications = navigationArguments.showNotifications
+ }
+ else if (!this.currentPage && (viewSet.page.iaNode !== WinJS.Binding.unwrap(this._ia).rootNode))
+ this.canNavigateBack = true;
+ var cacheOperation = MS.Entertainment.Navigation.Navigation.DOMCacheOperation.cachePage;
+ if (this._clearBackStackOnNextNavigate) {
+ this._clearBackStackOnNextNavigate = false;
+ this._backStack.clear();
+ cacheOperation = MS.Entertainment.Navigation.Navigation.DOMCacheOperation.removeAllPages
+ }
+ if (this._updateCurrentLocation(cacheOperation, viewSet.page, viewSet.hub, viewSet.panel, navigationArguments) !== MS.Entertainment.Navigation.Navigation.MoveResult.completed)
+ this._backStack.navigateBack();
+ this.hasBackStack = this._backStack.canNavigateBack;
+ return didFindValidDestination
+ }, navigateBack: function navigateBack() {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.UI.Framework.clearCaches();
+ if (this._clearBackStackOnNextNavigate) {
+ this._clearBackStackOnNextNavigate = false;
+ this.navigateToDefaultPage();
+ return
+ }
+ var oldPage = WinJS.Binding.unwrap(this.currentPage);
+ var stopBackNavigate = this._callOnNavigatingAway(oldPage);
+ if (stopBackNavigate)
+ return;
+ this.navigationDirection = MS.Entertainment.Navigation.NavigationDirection.backward;
+ var stackEntry = null;
+ var result = MS.Entertainment.Navigation.Navigation.MoveResult.enteringBlocked;
+ if (this._backStack.canNavigateBack) {
+ stackEntry = this._backStack.peekNavigateBack();
+ if (WinJS.Binding.unwrap(stackEntry.page).iaNode === this._ia.rootNode)
+ this.canNavigateBack = MS.Entertainment.Utilities.isApp2 || false;
+ WinJS.Promise.timeout().done(function updateLocation() {
+ result = this._updateCurrentLocation(MS.Entertainment.Navigation.Navigation.DOMCacheOperation.removePage, stackEntry.page, stackEntry.hub, stackEntry.panel);
+ if (result !== MS.Entertainment.Navigation.Navigation.MoveResult.leavingBlocked)
+ this._backStack.navigateBack()
+ }.bind(this))
+ }
+ else if (this.canNavigateBack) {
+ if (MS.Entertainment.Utilities.isApp2 && App2.System.Launcher) {
+ var unwrappedCurrentPageNode = (this.currentPage && WinJS.Binding.unwrap(this.currentPage.iaNode));
+ if (this.forceExitToSystemOnBack || (unwrappedCurrentPageNode === this._ia.rootNode)) {
+ App2.System.Launcher.navigateBackAsync();
+ return
+ }
+ }
+ this.navigateToDefaultPage()
+ }
+ else
+ this._callOnNavigateAway(oldPage);
+ this.hasBackStack = this._backStack.canNavigateBack;
+ this._clearBackStackOnNextNavigate = false
+ }, clearAllNavigationState: function clearAllNavigationState() {
+ this._updateCurrentLocation(MS.Entertainment.Navigation.Navigation.DOMCacheOperation.removeAllPages);
+ this._backStack.clear();
+ this.hasBackStack = false;
+ this.canNavigateBack = false
+ }, navigateToDefaultPage: function navigateToDefaultPage() {
+ var viewSet = this._findViewModelSet(this._ia.rootNode);
+ var result = this._updateCurrentLocation(MS.Entertainment.Navigation.Navigation.DOMCacheOperation.removeAllPages, viewSet.page, viewSet.hub, viewSet.panel);
+ if (result === MS.Entertainment.Navigation.Navigation.MoveResult.completed) {
+ this._backStack.clear();
+ if (MS.Entertainment.Utilities.isApp2) {
+ this.hasBackStack = true;
+ this.canNavigateBack = true
+ }
+ else {
+ this.hasBackStack = false;
+ this.canNavigateBack = false
+ }
+ this._clearBackStackOnNextNavigate = false
+ }
+ }, clearBackStackOnNextNavigate: function clearBackStackOnNextNavigate(clear) {
+ this._clearBackStackOnNextNavigate = clear
+ }, init: function init(defaultMoniker) {
+ if (defaultMoniker)
+ this._ia.rootNode = this._ia.getNode(defaultMoniker);
+ if (MS.Entertainment.Utilities.isApp2) {
+ this.navigateToDefaultPage();
+ return
+ }
+ if (MS.Entertainment.Utilities.isMusicApp1 && window.onNewMusicPage) {
+ this.navigateToDefaultPage();
+ MS.Entertainment.Utilities.wasNavigatedToDashboard = true;
+ return
+ }
+ if (MS.Entertainment.Utilities.isVideoApp1 && window.onNewVideoPage) {
+ this.navigateToDefaultPage();
+ MS.Entertainment.Utilities.wasNavigatedToDashboard = true;
+ return
+ }
+ try {
+ var defaultLaunchSetting = Windows.Storage.ApplicationData.current.roamingSettings.values["launchLocation"];
+ var moniker = MS.Entertainment.UI.Monikers[defaultLaunchSetting];
+ MS.Entertainment.Navigation.assert(!defaultLaunchSetting || moniker, "Moniker specified in launch setting does not exist: " + defaultLaunchSetting)
+ }
+ catch(e) {
+ MS.Entertainment.Navigation.fail(e.toString());
+ MS.Entertainment.Utilities.wasNavigatedToDashboard = true;
+ this.navigateToDefaultPage();
+ return
+ }
+ var loadAdditionalFilesPromise = WinJS.Promise.as();
+ var loadNonDashboardStartupHtml = function loadNonDashboardStartupHtml() {
+ if (MS.Entertainment.Utilities.isApp1)
+ return MS.Entertainment.Utilities.loadHtmlPage("/launchToCollectionStartup.html", "delayedStartupContainer")
+ };
+ if (defaultLaunchSetting && moniker)
+ if ((MS.Entertainment.Utilities.isVideoApp && defaultLaunchSetting === "videoCollection") || (MS.Entertainment.Utilities.isMusicApp && defaultLaunchSetting === "musicCollection")) {
+ MS.Entertainment.Navigation.assert((defaultLaunchSetting === moniker), "Moniker and defaultLaunchSetting are not equal. launch:" + defaultLaunchSetting + ", moniker:" + moniker);
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioAppLaunch();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchToCollection();
+ loadNonDashboardStartupHtml().done(function loadLaunchToCollectionFiles() {
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var navigateToVideoCollection = new MS.Entertainment.UI.Actions.videoCollectionOtherNavigate;
+ navigateToVideoCollection.execute()
+ }
+ else if (MS.Entertainment.Utilities.isMusicApp) {
+ var navigateToMusicCollection = new MS.Entertainment.UI.Actions.musicCollectionNavigate;
+ navigateToMusicCollection.execute()
+ }
+ else {
+ MS.Entertainment.Utilities.wasNavigatedToDashboard = true;
+ this.navigateToDefaultPage()
+ }
+ })
+ }
+ else
+ loadNonDashboardStartupHtml().done(function loadLaunchToMoniker() {
+ this.navigateTo(moniker)
+ }.bind(this));
+ else {
+ if ((this._ia.rootNode.moniker !== "videoCollection") && (this._ia.rootNode.moniker !== "musicCollection"))
+ MS.Entertainment.Utilities.wasNavigatedToDashboard = true;
+ else
+ loadAdditionalFilesPromise = loadNonDashboardStartupHtml();
+ loadAdditionalFilesPromise.done(function loadAdditionalFiles() {
+ this.navigateToDefaultPage()
+ }.bind(this))
+ }
+ }, checkUserLocation: function checkUserLocation(moniker) {
+ return this.currentPage && this.currentPage.iaNode && this.currentPage.iaNode.moniker === moniker
+ }, getUserLocation: function getUserLocation() {
+ var userLocation = null;
+ if (this.currentPage) {
+ userLocation = WinJS.Binding.unwrap(this.currentPage).iaNode.moniker;
+ if (this.currentHub) {
+ userLocation = userLocation.concat("/", WinJS.Binding.unwrap(this.currentHub).iaNode.moniker);
+ if (this.currentPanel)
+ userLocation = userLocation.concat("/", WinJS.Binding.unwrap(this.currentPanel).iaNode.moniker)
+ }
+ }
+ else
+ userLocation = "Unknown";
+ return userLocation
+ }, getPreviousUserLocation: function getPreviousUserLocation() {
+ var previousLocation = this.getPreviousLocation();
+ var userLocation = null;
+ if (this.previousLocation && this.previousLocation.page) {
+ userLocation = WinJS.Binding.unwrap(this.previousLocation.page).iaNode.moniker;
+ if (this.previousLocation.hub) {
+ userLocation = userLocation.concat("/", WinJS.Binding.unwrap(this.previousLocation.hub).iaNode.moniker);
+ if (this.previousLocation.panel)
+ userLocation = userLocation.concat("/", WinJS.Binding.unwrap(this.previousLocation.panel).iaNode.moniker)
+ }
+ }
+ else
+ userLocation = null;
+ return userLocation
+ }, getPreviousLocation: function getPreviousLocation() {
+ var previousLocation;
+ if (this._backStack)
+ previousLocation = this._backStack.peekNavigateBack();
+ return previousLocation
+ }, getBackStackPageMonikers: function getBackStackPageMonikers() {
+ var pageMonikers = [];
+ if (this._backStack && this._backStack._stack && Array.isArray(this._backStack._stack))
+ pageMonikers = this._backStack._stack.map(function(stackItem) {
+ return WinJS.Utilities.getMember("page.iaNode.moniker", stackItem)
+ });
+ return pageMonikers
+ }, getTestHooks: function getTestHooks() {
+ var hooks = this._backStack.getTestHooks();
+ hooks.setDOMUpdatesEnabled = function setDOMUpdatesEnabled(enabled) {
+ this._domUpdatesEnabled = enabled
+ }.bind(this);
+ return hooks
+ }
+ }, {
+ MoveResult: {
+ completed: "completed", leavingBlocked: "leavingBlocked", enteringBlocked: "enteringBlocked"
+ }, DOMCacheOperation: {
+ cachePage: "cachePage", removePage: "removePage", removeAllPages: "removeAllPages"
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.navigation, function getNavigationService() {
+ var iaService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ return new MS.Entertainment.Navigation.Navigation(iaService)
+ }, true)
+})()
diff --git a/packages/microsoft.zunevideo/Framework/searchaction.js b/packages/microsoft.zunevideo/Framework/searchaction.js
new file mode 100644
index 00000000..61feada9
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/searchaction.js
@@ -0,0 +1,114 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {SearchAutomationIds: {
+ search: "search", searchByContext: "searchByContext", resetSearchFilter: "resetSearchFilter"
+ }});
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ SearchByContextAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function searchByContextActionConstructor() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.searchByContext, executed: function executed(param) {
+ if (this.canExecute(param)) {
+ var moniker = param.moniker;
+ if (moniker !== MS.Entertainment.UI.Monikers.searchPage)
+ if (MS.Entertainment.Utilities.isMusicApp)
+ if (moniker === MS.Entertainment.UI.Monikers.musicCollection)
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.localCollection;
+ else
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.all;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ if (param.defaultModifierIndex)
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = param.defaultModifierIndex;
+ else
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.all
+ }
+ }, canExecute: function canExecute(param) {
+ return param != null && param != undefined && param.moniker != null
+ }
+ }), SearchAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function searchAction() {
+ this.base()
+ }, {
+ defaultModifierIndex: null, automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.search, executed: function execute(param) {
+ if (MS.Entertainment.Utilities.isApp2 && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped)
+ return;
+ param = param || {};
+ var defaultModifierIndex = this.defaultModifierIndex || param.defaultModifierIndex || 0;
+ MS.Entertainment.UI.Actions.SearchAction.lastDefaultModifierIndex = defaultModifierIndex;
+ if (param && param.queryText) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSubmitted({
+ queryText: param.queryText, defaultModifierIndex: defaultModifierIndex
+ })
+ }
+ else {
+ var commandingPopOver = MS.Entertainment.UI.Controls.CommandingPopOver;
+ var searchActionCommandingPopoverHidden = function() {
+ var existingQuery = String.empty;
+ if (this.startWithExistingQuery) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService.checkUserLocation(MS.Entertainment.UI.Monikers.searchPage))
+ existingQuery = MS.Entertainment.ViewModels.SearchContractViewModel.current.lastSearchedTerm
+ }
+ if (!MS.Entertainment.ViewModels.SearchContractViewModel.showSearchPane(existingQuery))
+ MS.Entertainment.UI.Controls.TextInputOverlay.getTextInput({
+ submitText: String.load(String.id.IDS_GLOBAL_COMMAND_SEARCH), watermark: String.load(String.id.IDS_GLOBAL_COMMAND_SEARCH), initialText: existingQuery || null
+ }).done(function(query) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSubmitted({
+ queryText: query, defaultModifierIndex: defaultModifierIndex
+ })
+ }.bind(this), function searchCancelled(){})
+ }.bind(this);
+ if (commandingPopOver)
+ commandingPopOver.hideCurrentCommandingPopover().done(searchActionCommandingPopoverHidden);
+ else
+ searchActionCommandingPopoverHidden()
+ }
+ }, canExecute: function canExecute() {
+ return true
+ }, startWithExistingQuery: false
+ }, {lastDefaultModifierIndex: 0})
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {ResetSearchFilterAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function resetSearchFilterActionConstructor() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.resetSearchFilter, executed: function executed(param) {
+ if (this.canExecute(param)) {
+ var viewModel = param.viewModel;
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = MS.Entertainment.ViewModels.SearchFilter.all;
+ viewModel.modifierSelectionManager.selectedIndex = MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter
+ }
+ }, canExecute: function canExecute(param) {
+ return param !== null && param !== undefined && param.viewModel !== null
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {ResetSearchHubAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function resetSearchFilterActionConstructor() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.Actions.SearchAutomationIds.resetSearchFilter, executed: function executed(param) {
+ if (this.canExecute(param)) {
+ var viewModel = param.viewModel;
+ if (viewModel)
+ viewModel.pivotSelectedIndexOverride = 0
+ }
+ }, canExecute: function canExecute(param) {
+ return param && param.viewModel !== null
+ }
+ })});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.search, function() {
+ return new MS.Entertainment.UI.Actions.SearchAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.searchByContext, function() {
+ return new MS.Entertainment.UI.Actions.SearchByContextAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.resetSearchFilter, function() {
+ return new MS.Entertainment.UI.Actions.ResetSearchFilterAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.resetSearchHub, function() {
+ return new MS.Entertainment.UI.Actions.ResetSearchHubAction
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Framework/shiftDashboardAction.js b/packages/microsoft.zunevideo/Framework/shiftDashboardAction.js
new file mode 100644
index 00000000..7028096e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/shiftDashboardAction.js
@@ -0,0 +1,23 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {ShiftDashboard: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function shiftDashboardConstructor() {
+ this.base()
+ }, {
+ executed: function executed(param) {
+ var dashboard = document.querySelector(".dashboard");
+ if (dashboard)
+ dashboard.winControl.shift(param)
+ }, canExecute: function canExecute() {
+ return !!document.querySelector(".dashboard")
+ }
+ }, {Direction: {
+ left: "left", right: "right"
+ }})});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.shiftDashboard, function() {
+ return new MS.Entertainment.UI.Actions.ShiftDashboard
+ })
+})()
diff --git a/packages/microsoft.zunevideo/Framework/videoServiceIdentifiers.js b/packages/microsoft.zunevideo/Framework/videoServiceIdentifiers.js
new file mode 100644
index 00000000..c5363180
--- /dev/null
+++ b/packages/microsoft.zunevideo/Framework/videoServiceIdentifiers.js
@@ -0,0 +1,2 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
diff --git a/packages/microsoft.zunevideo/Images/AppBar_gradient.png b/packages/microsoft.zunevideo/Images/AppBar_gradient.png
new file mode 100644
index 00000000..577a4d8a
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/AppBar_gradient.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/actor_placeholder.png b/packages/microsoft.zunevideo/Images/GenericIcons/actor_placeholder.png
new file mode 100644
index 00000000..27cba598
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/actor_placeholder.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/cast_placeholder.png b/packages/microsoft.zunevideo/Images/GenericIcons/cast_placeholder.png
new file mode 100644
index 00000000..a913f4f1
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/cast_placeholder.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Large.scale-100.png b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Large.scale-100.png
new file mode 100644
index 00000000..d756e757
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Large.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_LargeMovie.scale-100.png b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_LargeMovie.scale-100.png
new file mode 100644
index 00000000..5fe17f97
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_LargeMovie.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Medium.scale-100.png b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Medium.scale-100.png
new file mode 100644
index 00000000..13f9fcdc
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Medium.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Small.scale-100.png b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Small.scale-100.png
new file mode 100644
index 00000000..783ba2ef
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/ico_74x_GenericVideo_Small.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/ico_GenericVideo_L3_Hero.scale-100.png b/packages/microsoft.zunevideo/Images/GenericIcons/ico_GenericVideo_L3_Hero.scale-100.png
new file mode 100644
index 00000000..f89f9b08
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/ico_GenericVideo_L3_Hero.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/GenericIcons/ico_GenericVideo_Wide.scale-100.png b/packages/microsoft.zunevideo/Images/GenericIcons/ico_GenericVideo_Wide.scale-100.png
new file mode 100644
index 00000000..01b67af5
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/GenericIcons/ico_GenericVideo_Wide.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/ListStripes/ListStripesDark.scale-100.png b/packages/microsoft.zunevideo/Images/ListStripes/ListStripesDark.scale-100.png
new file mode 100644
index 00000000..1c8468ba
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/ListStripes/ListStripesDark.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100.png
new file mode 100644
index 00000000..dd9c2393
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100_contrast-black.png
new file mode 100644
index 00000000..61d0adfa
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100_contrast-white.png
new file mode 100644
index 00000000..a7ae76e7
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100.png
new file mode 100644
index 00000000..5ce6f6e6
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100_contrast-black.png
new file mode 100644
index 00000000..1538667b
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100_contrast-white.png
new file mode 100644
index 00000000..e4a2cc1a
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOther.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100.png
new file mode 100644
index 00000000..f9a28c7c
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100_contrast-black.png
new file mode 100644
index 00000000..288ed46e
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100_contrast-white.png
new file mode 100644
index 00000000..ffc72c3e
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoOtherRTL.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100.png
new file mode 100644
index 00000000..10186bbd
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100_contrast-black.png
new file mode 100644
index 00000000..d7da9de0
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100_contrast-white.png
new file mode 100644
index 00000000..17327a96
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100.png
new file mode 100644
index 00000000..a04b192d
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100_contrast-black.png
new file mode 100644
index 00000000..811764b5
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100_contrast-white.png
new file mode 100644
index 00000000..1c60179f
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100.png
new file mode 100644
index 00000000..26ef2b77
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100_contrast-black.png
new file mode 100644
index 00000000..3efef363
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100_contrast-white.png
new file mode 100644
index 00000000..5d1920c9
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/NowPlaying/now_playing_mask.png b/packages/microsoft.zunevideo/Images/NowPlaying/now_playing_mask.png
new file mode 100644
index 00000000..76a9c8fe
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/NowPlaying/now_playing_mask.png differ
diff --git a/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_CertifiedFresh.png b/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_CertifiedFresh.png
new file mode 100644
index 00000000..31366980
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_CertifiedFresh.png differ
diff --git a/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_Fresh.png b/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_Fresh.png
new file mode 100644
index 00000000..c3ae8acb
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_Fresh.png differ
diff --git a/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_Rotten.png b/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_Rotten.png
new file mode 100644
index 00000000..4d4012b2
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/ThirdParty/ico_RottenTomatoes_Rotten.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.png b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.png
new file mode 100644
index 00000000..04371036
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-16.png b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-16.png
new file mode 100644
index 00000000..2514f2d9
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-16.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-256.png b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-256.png
new file mode 100644
index 00000000..488318ff
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-256.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-32.png b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-32.png
new file mode 100644
index 00000000..04371036
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-32.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-48.png b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-48.png
new file mode 100644
index 00000000..1e4ffac3
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/VideoIcon.targetsize-48.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/Video_Movie_Resume_2x2.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/Video_Movie_Resume_2x2.scale-100.png
new file mode 100644
index 00000000..fce06f30
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/Video_Movie_Resume_2x2.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/Video_Tv_Resume_2x2.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/Video_Tv_Resume_2x2.scale-100.png
new file mode 100644
index 00000000..7b3eceb7
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/Video_Tv_Resume_2x2.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100.png
new file mode 100644
index 00000000..c4c1a207
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100_contrast-black.png
new file mode 100644
index 00000000..ba880030
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100_contrast-white.png
new file mode 100644
index 00000000..2d9a5322
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80.png
new file mode 100644
index 00000000..2cc6a28f
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80_contrast-black.png
new file mode 100644
index 00000000..b92c8378
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80_contrast-white.png
new file mode 100644
index 00000000..6a35f8e9
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_150x150_A.scale-80_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100.png
new file mode 100644
index 00000000..3a4a80d3
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100_contrast-black.png
new file mode 100644
index 00000000..80ce96f6
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100_contrast-white.png
new file mode 100644
index 00000000..920eb9e7
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80.png
new file mode 100644
index 00000000..ddf4b41e
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80_contrast-black.png
new file mode 100644
index 00000000..513fb806
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80_contrast-white.png
new file mode 100644
index 00000000..fee18269
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.scale-80_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-16.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-16.png
new file mode 100644
index 00000000..2514f2d9
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-16.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-32.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-32.png
new file mode 100644
index 00000000..04371036
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-32.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-48.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-48.png
new file mode 100644
index 00000000..1e4ffac3
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_30x30_A.targetsize-48.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100.png
new file mode 100644
index 00000000..21516fd0
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100_contrast-black.png
new file mode 100644
index 00000000..1d9a9640
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100_contrast-white.png
new file mode 100644
index 00000000..23ab6698
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80.png
new file mode 100644
index 00000000..899a9b27
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80_contrast-black.png
new file mode 100644
index 00000000..a2036d05
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80_contrast-white.png
new file mode 100644
index 00000000..0650f413
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x150_C.scale-80_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100.png
new file mode 100644
index 00000000..92244c28
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100_contrast-black.png
new file mode 100644
index 00000000..92244c28
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100_contrast-white.png
new file mode 100644
index 00000000..5bc73160
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80.png
new file mode 100644
index 00000000..c8e28158
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80_contrast-black.png
new file mode 100644
index 00000000..c8e28158
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80_contrast-white.png
new file mode 100644
index 00000000..47beacba
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_310x310_A.scale-80_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.contrast-black.png
new file mode 100644
index 00000000..10e9bcae
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.contrast-white.png
new file mode 100644
index 00000000..91f7f3d6
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.png
new file mode 100644
index 00000000..7c72a7c6
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_50x50_A.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100.png
new file mode 100644
index 00000000..e273448e
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100_contrast-black.png
new file mode 100644
index 00000000..e273448e
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100_contrast-white.png
new file mode 100644
index 00000000..03d3e5e3
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_620x300_A.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100.png
new file mode 100644
index 00000000..48057cc6
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100_contrast-black.png
new file mode 100644
index 00000000..48057cc6
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100_contrast-white.png
new file mode 100644
index 00000000..08985adb
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-100_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80.png
new file mode 100644
index 00000000..14dc6055
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80_contrast-black.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80_contrast-black.png
new file mode 100644
index 00000000..14dc6055
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80_contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80_contrast-white.png b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80_contrast-white.png
new file mode 100644
index 00000000..046e74a1
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/Tiles/XBL_VIDEO_70x70_A.scale-80_contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.contrast-black.png b/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.contrast-black.png
new file mode 100644
index 00000000..3376dc14
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.contrast-white.png b/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.contrast-white.png
new file mode 100644
index 00000000..acd88f62
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.png b/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.png
new file mode 100644
index 00000000..3376dc14
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/TransportControls/leaf_default.png differ
diff --git a/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.contrast-black.png b/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.contrast-black.png
new file mode 100644
index 00000000..253710ff
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.contrast-black.png differ
diff --git a/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.contrast-white.png b/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.contrast-white.png
new file mode 100644
index 00000000..4f20aa71
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.contrast-white.png differ
diff --git a/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.png b/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.png
new file mode 100644
index 00000000..253710ff
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/TransportControls/leaf_touch.png differ
diff --git a/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_12.scale-100.png b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_12.scale-100.png
new file mode 100644
index 00000000..a7c1df8a
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_12.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_16.scale-100.png b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_16.scale-100.png
new file mode 100644
index 00000000..0de5c833
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_16.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_18.scale-100.png b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_18.scale-100.png
new file mode 100644
index 00000000..13881b83
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_18.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_7.scale-100.png b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_7.scale-100.png
new file mode 100644
index 00000000..d3be5b51
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_7.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_no_restriction.scale-100.png b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_no_restriction.scale-100.png
new file mode 100644
index 00000000..e35eea66
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/VideoRatings/video_poland_ratings_no_restriction.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/WebDialogResize/RotateResizeIcon.scale-100.png b/packages/microsoft.zunevideo/Images/WebDialogResize/RotateResizeIcon.scale-100.png
new file mode 100644
index 00000000..8f82d479
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/WebDialogResize/RotateResizeIcon.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/WebDialogResize/contrast-black/RotateResizeIcon.scale-100.png b/packages/microsoft.zunevideo/Images/WebDialogResize/contrast-black/RotateResizeIcon.scale-100.png
new file mode 100644
index 00000000..fe58d13a
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/WebDialogResize/contrast-black/RotateResizeIcon.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/WebDialogResize/contrast-white/RotateResizeIcon.scale-100.png b/packages/microsoft.zunevideo/Images/WebDialogResize/contrast-white/RotateResizeIcon.scale-100.png
new file mode 100644
index 00000000..9cd8c140
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/WebDialogResize/contrast-white/RotateResizeIcon.scale-100.png differ
diff --git a/packages/microsoft.zunevideo/Images/img_not_found.png b/packages/microsoft.zunevideo/Images/img_not_found.png
new file mode 100644
index 00000000..323e4e2e
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/img_not_found.png differ
diff --git a/packages/microsoft.zunevideo/Images/immersive_details_background_gradient.png b/packages/microsoft.zunevideo/Images/immersive_details_background_gradient.png
new file mode 100644
index 00000000..6c1efc47
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/immersive_details_background_gradient.png differ
diff --git a/packages/microsoft.zunevideo/Images/immersive_details_viewMore_background_gradient.png b/packages/microsoft.zunevideo/Images/immersive_details_viewMore_background_gradient.png
new file mode 100644
index 00000000..112b7fc3
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/immersive_details_viewMore_background_gradient.png differ
diff --git a/packages/microsoft.zunevideo/Images/link_asset.png b/packages/microsoft.zunevideo/Images/link_asset.png
new file mode 100644
index 00000000..300268d4
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/link_asset.png differ
diff --git a/packages/microsoft.zunevideo/Images/loading_image.png b/packages/microsoft.zunevideo/Images/loading_image.png
new file mode 100644
index 00000000..914c8981
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/loading_image.png differ
diff --git a/packages/microsoft.zunevideo/Images/notification_retry_ring_dark.png b/packages/microsoft.zunevideo/Images/notification_retry_ring_dark.png
new file mode 100644
index 00000000..ea4cfad8
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/notification_retry_ring_dark.png differ
diff --git a/packages/microsoft.zunevideo/Images/notification_retry_ring_light.png b/packages/microsoft.zunevideo/Images/notification_retry_ring_light.png
new file mode 100644
index 00000000..2b6eadc6
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/notification_retry_ring_light.png differ
diff --git a/packages/microsoft.zunevideo/Images/notification_retry_spinner_dark.png b/packages/microsoft.zunevideo/Images/notification_retry_spinner_dark.png
new file mode 100644
index 00000000..bdd7d97f
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/notification_retry_spinner_dark.png differ
diff --git a/packages/microsoft.zunevideo/Images/notification_retry_spinner_light.png b/packages/microsoft.zunevideo/Images/notification_retry_spinner_light.png
new file mode 100644
index 00000000..b668ea09
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/notification_retry_spinner_light.png differ
diff --git a/packages/microsoft.zunevideo/Images/squareLoading.png b/packages/microsoft.zunevideo/Images/squareLoading.png
new file mode 100644
index 00000000..26af72f1
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/squareLoading.png differ
diff --git a/packages/microsoft.zunevideo/Images/standard_card_square_art_overlay.png b/packages/microsoft.zunevideo/Images/standard_card_square_art_overlay.png
new file mode 100644
index 00000000..6b7ffc3d
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/standard_card_square_art_overlay.png differ
diff --git a/packages/microsoft.zunevideo/Images/streaming_dark.png b/packages/microsoft.zunevideo/Images/streaming_dark.png
new file mode 100644
index 00000000..d13b8e71
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/streaming_dark.png differ
diff --git a/packages/microsoft.zunevideo/Images/streaming_light.png b/packages/microsoft.zunevideo/Images/streaming_light.png
new file mode 100644
index 00000000..c3d3411a
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/streaming_light.png differ
diff --git a/packages/microsoft.zunevideo/Images/transparent.png b/packages/microsoft.zunevideo/Images/transparent.png
new file mode 100644
index 00000000..e3a67ea0
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/transparent.png differ
diff --git a/packages/microsoft.zunevideo/Images/x8_300x250_ad_error.png b/packages/microsoft.zunevideo/Images/x8_300x250_ad_error.png
new file mode 100644
index 00000000..9fc906d3
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/x8_300x250_ad_error.png differ
diff --git a/packages/microsoft.zunevideo/Images/x8_300x600_ad_error.png b/packages/microsoft.zunevideo/Images/x8_300x600_ad_error.png
new file mode 100644
index 00000000..2f8298aa
Binary files /dev/null and b/packages/microsoft.zunevideo/Images/x8_300x600_ad_error.png differ
diff --git a/packages/microsoft.zunevideo/LiveIdChange.js b/packages/microsoft.zunevideo/LiveIdChange.js
new file mode 100644
index 00000000..e9104d2f
--- /dev/null
+++ b/packages/microsoft.zunevideo/LiveIdChange.js
@@ -0,0 +1,7 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ var backgroundTaskInstance = Windows.UI.WebUI.WebUIBackgroundTaskInstance.current;
+ if (backgroundTaskInstance.task.name === "LiveIdChange")
+ close()
+})()
diff --git a/packages/microsoft.zunevideo/MSAdvertisingJS/ads/VASTAd.js b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/VASTAd.js
new file mode 100644
index 00000000..86c3d068
--- /dev/null
+++ b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/VASTAd.js
@@ -0,0 +1,165 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function(WinJS, undefined) {
+ "use strict";
+ WinJS.Namespace.define("MicrosoftNSJS.Advertising", {AdPackage: WinJS.Class.define(function(applicationId, adUnitId) {
+ this._onAdRefreshed = null;
+ this._onErrorOccurred = null;
+ this.applicationId = applicationId,
+ this.adUnitId = adUnitId;
+ this._placement = null;
+ this._requestInProgress = false;
+ this._initializeAdData()
+ }, {
+ onAdRefreshed: {
+ get: function() {
+ return this._onAdRefreshed
+ }, set: function(value) {
+ if (typeof(value) === 'function' || value === null || typeof(value) === 'undefined')
+ this._onAdRefreshed = value
+ }
+ }, onErrorOccurred: {
+ get: function() {
+ return this._onErrorOccurred
+ }, set: function(value) {
+ if (typeof(value) === 'function' || value === null || typeof(value) === 'undefined')
+ this._onErrorOccurred = value
+ }
+ }, refresh: function() {
+ if ((typeof(this.applicationId) === 'undefined' || this.applicationId === null) || (typeof(this.adUnitId) === 'undefined' || this.adUnitId === null)) {
+ this._fireErrorOccurred('applicationId and adUnitId are required', MicrosoftNSJS.Advertising.AdPackage._ERROR_ENUM.ClientConfiguration);
+ return
+ }
+ console.log('ad package refresh called');
+ if (!this._requestInProgress)
+ this._requestVastJson()
+ }, reportEvent: function(eventType) {
+ try {
+ console.log('received event ' + eventType);
+ if (this.fullAdPayload.VAST.Ad.length > 0)
+ if (eventType === MicrosoftNSJS.Advertising.AdPackage.eventType.AdImpression && this._impressionUrls.length > 0)
+ return this._placement.reportClientEvents(this._impressionUrls);
+ else if (eventType === MicrosoftNSJS.Advertising.AdPackage.eventType.AdError && this._errorEventUrl != null)
+ return this._placement.reportClientEvents(new Array(this._errorEventUrl));
+ else if (eventType === MicrosoftNSJS.Advertising.AdPackage.eventType.AdClickThru && this._videoClickThroughTrackingUrls.length > 0)
+ return this._placement.reportClientEvents(this._videoClickThroughTrackingUrls);
+ else {
+ var eventUrl = this._trackingEventUrls[eventType];
+ if (this._placement !== null && typeof(eventUrl) !== 'undefined')
+ return this._placement.reportClientEvents(new Array(eventUrl))
+ }
+ }
+ catch(e) {
+ this._fireErrorOccurred(e.message, MicrosoftNSJS.Advertising.AdPackage._ERROR_ENUM.Other)
+ }
+ console.log('no event found for' + eventType);
+ return new WinJS.Promise(function(){})
+ }, dispose: function() {
+ this._stopPingTimer();
+ if (this._placement !== null) {
+ this._placement.onadrefreshed = null;
+ this._placement.onerroroccurred = null;
+ this._placement = null
+ }
+ this._onAdRefreshed = null;
+ this._onErrorOccurred = null
+ }, _createAdPlacement: function() {
+ return new MicrosoftAdvertising.Shared.WinRT.VASTAdPlacement
+ }, _requestVastJson: function() {
+ try {
+ if (this._placement === null) {
+ this._placement = this._createAdPlacement();
+ var self = this;
+ this._placement.onadrefreshed = function(evt) {
+ self._adRefreshedCallback(evt)
+ };
+ this._placement.onerroroccurred = function(evt) {
+ self._errorOccurredCallback(evt)
+ };
+ this._placement.applicationId = this.applicationId;
+ this._placement.adUnitId = this.adUnitId
+ }
+ this._placement.adUnitId = this.adUnitId;
+ this._placement.latitude = '';
+ this._placement.longitude = '';
+ this._requestInProgress = true;
+ var ad = this._placement.getVASTAd();
+ this._startPingTimer()
+ }
+ catch(e) {
+ this._fireErrorOccurred(e.message, MicrosoftNSJS.Advertising.AdPackage._ERROR_ENUM.Other)
+ }
+ }, _pingTimerId: null, _startPingTimer: function() {
+ if (this._pingTimerId === null) {
+ var placement = this._placement;
+ this._pingTimerId = setInterval(function() {
+ placement.ping()
+ }, 100)
+ }
+ }, _stopPingTimer: function() {
+ if (this._pingTimerId !== null) {
+ clearInterval(this._pingTimerId);
+ this._pingTimerId = null
+ }
+ }, _loadData: function() {
+ if (typeof(this.fullAdPayload) === 'object' && typeof(this.fullAdPayload.VAST) === 'object' && typeof(this.fullAdPayload.VAST.Ad) === 'object' && this.fullAdPayload.VAST.Ad.length > 0 && typeof(this.fullAdPayload.VAST.Ad[0].InLine) === 'object') {
+ var creatives = this.fullAdPayload.VAST.Ad[0].InLine.Creatives;
+ for (var i = 0; i < creatives.length; i++)
+ if (this.linearCreative === null && creatives[i].type === 'linear') {
+ this.linearCreative = creatives[i].Linear;
+ if (this.linearCreative.TrackingEvents !== null && typeof(this.linearCreative.TrackingEvents) === 'object')
+ this._trackingEventUrls = this.linearCreative.TrackingEvents;
+ if (this.linearCreative.VideoClicks !== null && typeof(this.linearCreative.VideoClicks) === 'object' && this.linearCreative.VideoClicks.ClickTracking !== null && typeof(this.linearCreative.VideoClicks.ClickTracking) === 'object' && this.linearCreative.VideoClicks.ClickTracking.length > 0)
+ this._videoClickThroughTrackingUrls = this.linearCreative.VideoClicks.ClickTracking
+ }
+ else if (this.adCompanions === null && creatives[i].type === 'companionads')
+ this.adCompanions = creatives[i].CompanionAds;
+ if (typeof(this.fullAdPayload.VAST.Ad[0].InLine.Impressions) === 'object')
+ this._impressionUrls = this.fullAdPayload.VAST.Ad[0].InLine.Impressions;
+ if (typeof(this.fullAdPayload.VAST.Ad[0].InLine.Error) === 'string')
+ this._errorEventUrl = this.fullAdPayload.VAST.Ad[0].InLine.Error
+ }
+ }, _fireErrorOccurred: function(msg, errorCode) {
+ console.error("AdPackage: " + msg + " (" + errorCode + ")");
+ if (typeof(this._onErrorOccurred) === "function")
+ this._onErrorOccurred(this, {
+ errorMessage: msg, errorCode: errorCode
+ })
+ }, _adRefreshedCallback: function(evt) {
+ this._stopPingTimer();
+ var ad = this._placement.getVASTAd();
+ if (ad !== null)
+ this._onAdReceived(ad);
+ this._requestInProgress = false
+ }, _onAdReceived: function(ad) {
+ var fullAdPayload = JSON.parse(ad.vastjson);
+ if (fullAdPayload !== null) {
+ this._initializeAdData();
+ this.fullAdPayload = fullAdPayload;
+ this._loadData()
+ }
+ if (typeof(this._onAdRefreshed) === 'function')
+ this._onAdRefreshed(this)
+ }, _errorOccurredCallback: function(evt) {
+ this._stopPingTimer();
+ if (typeof(evt) !== "object")
+ this._fireErrorOccurred("Other", MicrosoftNSJS.Advertising.AdPackage._ERROR_ENUM.Other);
+ else
+ this._fireErrorOccurred(evt.errorMessage, evt.errorCode);
+ this._requestInProgress = false
+ }, _initializeAdData: function() {
+ this.fullAdPayload = null;
+ this.linearCreative = null;
+ this.adCompanions = null;
+ this._trackingEventUrls = {};
+ this._impressionUrls = [];
+ this._videoClickThroughTrackingUrls = [];
+ this._errorEventUrl = null
+ }
+ }, {
+ eventType: {
+ AdImpression: "Impression", AdClickThru: "AdClickThru", AdError: "Error", AdStarted: "creativeView", AdVideoStart: "start", AdVideoFirstQuartile: "firstQuartile", AdVideoMidpoint: "midpoint", AdVideoThirdQuartile: "thirdQuartile", AdComplete: "complete", AdMute: "mute", AdUnMute: "unmute", AdPaused: "pause", AdRewind: "rewind", AdPlaying: "resume", AdFullScreen: "fullscreen", AdExpand: "expand", AdCollapse: "collapse", AdAcceptInvitation: "acceptinvitation", AdClose: "close"
+ }, _ERROR_ENUM: {
+ Unknown: "Unknown", NoAdAvailable: "NoAdAvailable", NetworkConnectionFailure: "NetworkConnectionFailure", ClientConfiguration: "ClientConfiguration", ServerSideError: "ServerSideError", InvalidServerResponse: "InvalidServerResponse", Other: "Other"
+ }
+ })})
+})(WinJS)
diff --git a/packages/microsoft.zunevideo/MSAdvertisingJS/ads/ad.js b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/ad.js
new file mode 100644
index 00000000..f95f0688
--- /dev/null
+++ b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/ad.js
@@ -0,0 +1,1524 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/*!
+ Copyright (C) Microsoft. All rights reserved.
+ This library is supported for use in Windows Store apps only.
+*/
+(function(WinJS) {
+ "use strict";
+ WinJS.Namespace.define("MicrosoftNSJS.Advertising", {
+ AdGlobalEventManager: WinJS.Class.define(function() {
+ if (!this._isNullOrUndefined(window)) {
+ if (this._isNullOrUndefined(window._msAdsGlobalEventManager) || window._msAdsGlobalEventManager.isInitialized !== true) {
+ if (!this._isNullOrUndefined(window._msAdsGlobalEventManager) && window._msAdsGlobalEventManager.OBJECT_NAME !== MicrosoftNSJS.Advertising.AdGlobalEventManager.OBJECT_NAME)
+ this._logError("window._msAdsGlobalEventManager already exists but is not of correct object type [{0}]. Overwriting.", MicrosoftNSJS.Advertising.AdGlobalEventManager.OBJECT_NAME);
+ this._isInitialized = true;
+ window._msAdsGlobalEventManager = this
+ }
+ return window._msAdsGlobalEventManager
+ }
+ }, {
+ isInitialized: {get: function() {
+ return this._isInitialized
+ }}, _eventListeners: null, _isInitialized: false, addEventListener: function(eventType, listener) {
+ if (this._isNullOrUndefined(eventType) || this._isNullOrUndefined(listener)) {
+ this._logError("Could not add listener, eventType or listener null or undefined");
+ return
+ }
+ try {
+ this._initializeEventListenersContainer(eventType);
+ this._eventListeners[eventType].push(listener);
+ return listener
+ }
+ catch(err) {
+ this._logError("Could not add listener type '" + eventType + "', exception was thrown [{0}]", err);
+ return null
+ }
+ }, removeEventListener: function(eventType, listener) {
+ if (this._isNullOrUndefined(eventType) || this._isNullOrUndefined(listener)) {
+ this._logError("Could not remove listener, eventType or listener null or undefined.");
+ return
+ }
+ if (!this._eventArrayExists(eventType)) {
+ this._logError("Could not remove listener, no listener found for eventType: " + eventType);
+ return null
+ }
+ else
+ try {
+ var listeners = this._eventListeners[eventType];
+ for (var i = 0; i < listeners.length; i++)
+ if (listeners[i] === listener) {
+ var l = listeners.splice(i, 1);
+ return l[0]
+ }
+ }
+ catch(err) {
+ this._logError("Could not remove listener, exception was thrown [{0}]", err);
+ return null
+ }
+ }, broadcastEvent: function(eventType, args) {
+ if (this._isNullOrUndefined(eventType)) {
+ this._logError("Could not broadcast event, eventType null or undefined");
+ return
+ }
+ if (!this._eventArrayExists(eventType))
+ return;
+ else {
+ var listeners = this._eventListeners[eventType];
+ for (var i = 0; i < listeners.length; i++)
+ if (!this._isNullOrUndefined(listeners[i]))
+ listeners[i](args)
+ }
+ }, dispose: function(force) {
+ try {
+ if (force === true) {
+ this._dispose();
+ return
+ }
+ var eventsLeft = false;
+ for (var i in MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE)
+ if (this._eventArrayExists(MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE[i]) && this._eventListeners[MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE[i]].length > 0) {
+ eventsLeft = true;
+ break
+ }
+ if (eventsLeft === false)
+ this._dispose();
+ else
+ this._logError("Could not dispose, events collection is not empty.")
+ }
+ catch(err) {
+ try {
+ this._logError("Could not dispose, exception thrown [{0}].", err)
+ }
+ catch(err) {}
+ }
+ }, _dispose: function() {
+ this._eventListeners = null;
+ this._isInitialized = false;
+ window._msAdsGlobalEventManager = null
+ }, _initializeEventListenersContainer: function(eventType) {
+ if (this._eventListeners === null) {
+ this._eventListeners = {};
+ this._eventListeners[eventType] = []
+ }
+ else if (this._isNullOrUndefined(this._eventListeners[eventType]))
+ this._eventListeners[eventType] = []
+ }, _eventArrayExists: function(eventType) {
+ if (this._eventListeners === null || this._eventListeners[eventType] === null || typeof(this._eventListeners[eventType]) === "undefined")
+ return false;
+ return true
+ }, _isNullOrUndefined: function(object) {
+ if (typeof(object) === "undefined" || object === null)
+ return true;
+ return false
+ }, _logError: function(message, err){}
+ }, {
+ OBJECT_NAME: "MicrosoftNSJS.Advertising.AdGlobalEventManager", EVENT_TYPE: {
+ AD_ENGAGED: "msAdEngaged", AD_DISENGAGED: "msAdDisengaged"
+ }
+ }), AdControl: WinJS.Class.define(function(element, options) {
+ try {
+ element = element || document.createElement("div");
+ element.winControl = this;
+ this._adsGlobalEventManager = new MicrosoftNSJS.Advertising.AdGlobalEventManager;
+ try {
+ this._rendererOptions = new MicrosoftAdvertising.Shared.WinRT.RendererOptions
+ }
+ catch(err) {}
+ this._globalAdEngagedHandler = null;
+ this._globalAdDisengagedHandler = null;
+ this._ad = null;
+ this._adIFrame = null;
+ this._expandedIFrame = null;
+ this._applicationId = "";
+ this._adUnitId = "";
+ this._currentAdHeight = null;
+ this._currentAdWidth = null;
+ this._defaultStateSize = {};
+ this._isDisposed = false;
+ this._errorReportCount = 0;
+ this._expandProperties = null;
+ this._isAutoRefreshEnabled = true;
+ this._isExpanded = false;
+ this._isUserEngaged = false;
+ this._isSuspended = false;
+ this._ormmaState = "default";
+ this._placement = null;
+ this._previousOrmmaState = "";
+ this._refreshPeriodSeconds = 60;
+ this._refreshTimerId = null;
+ this._requestInProgress = false;
+ this._timeAtLastRotation = null;
+ this._currentCloseBandHeight = this._RESERVED_CLOSE_BAND_HEIGHT;
+ this._accelerometer = {
+ device: null, tiltHandlers: [], shakeHandlers: []
+ };
+ this._lastCoords = {
+ x: 0, y: 0, z: 0
+ };
+ this._viewableChangedTimer = null;
+ this._isViewable = false;
+ this._viewableCheckPeriodMs = 500;
+ this._orientationChangedHandler = null;
+ this._fadeOptions = {
+ timer: {linear: " cubic-bezier(0,0,1,1)"}, fadeInTimeS: 0.7, fadeOutTimeS: 0.7
+ };
+ this._sensorOptions = {accelerometer: {reportIntervalMS: 50}};
+ this._adInstanceState = null;
+ this._onAdRefreshedInternal = null;
+ this._onAdRefreshed = null;
+ this._onAdRendered = null;
+ this._onBeforeAdRender = null;
+ this._onErrorOccurred = null;
+ this._onEngagedChanged = null;
+ this._onPointerDown = null;
+ this._onPointerUp = null;
+ element.style.breakInside = "avoid";
+ element.style.overflow = "hidden";
+ WinJS.UI.setOptions(this, options);
+ this._setElement(element);
+ this._setupEvents();
+ var self = this;
+ setImmediate(function() {
+ if (!self._requestInProgress && self._ad === null)
+ self._refreshInternal()
+ })
+ }
+ catch(err) {
+ return
+ }
+ }, {
+ _MSG_TYPE_ADPARAMS: "adParams", _MSG_TYPE_PRMPARAMS: "prmParams", _MSG_TYPE_APPPARAMS: "appParams", _MSG_TYPE_INIT: "init", _MSG_TYPE_ORMMA_START: "ormmaStart", _MSG_TYPE_SCRIPT: "script", _MSG_TYPE_SETMAXSIZE: "setMaxSize", _MSG_TYPE_SETSCREENSIZE: "setScreenSize", _MSG_TYPE_SETSIZE: "setSize", _MSG_TYPE_SETSTATE: "setState", _MSG_TYPE_SETID: "setId", _MSG_TYPE_FIRESHAKE: "fireShake", _MSG_TYPE_UPDATETILTCOORDS: "updateTiltCoords", _MSG_TYPE_UPDATEORIENTATION: "updateOrienation", _MSG_TYPE_SETNETWORK: "setNetwork", _MSG_TYPE_VIEWABLECHANGE: "viewableChange", _MSG_TYPE_SETLOCALE: "setLocale", _MSG_TYPE_SETSDKINFO: "setSdkInfo", _MSG_TYPE_SETCAPABILITY: "setCapability", _MSG_TYPE_SETADINSTANCESTATE: "setAdInstanceState", _MSG_TYPE_RENDERED: "rendered", _MSG_TYPE_OPEN: "web", _MSG_TYPE_EXPAND: "expand", _MSG_TYPE_CLOSE: "close", _MSG_TYPE_RESIZE: "resize", _MSG_TYPE_HIDE: "hide", _MSG_TYPE_SHOW: "show", _MSG_TYPE_SETEXPANDPROPERTIES: "setexpandproperties", _MSG_TYPE_SETUSERENGAGED: "setuserengaged", _MSG_TYPE_TILT: "tilt", _MSG_TYPE_SHAKE: "shake", _MSG_TYPE_LISTENER: "listener", _MSG_TYPE_VALUESTART: "start", _MSG_TYPE_VALUESTOP: "stop", _MSG_TYPE_GETTILT: "gettilt", _MSG_TYPE_GETORIENTATION: "getorientation", _MSG_TYPE_REFRESH: "refresh", _MSG_TYPE_REQUEST: "request", _MSG_TYPE_STOREADINSTANCESTATE: "storeadinstancestate", _MSG_TYPE_ONPOINTERDOWN: "MSPointerDown", _MSG_TYPE_ONPOINTERUP: "MSPointerUp", _MSG_TYPE_USECUSTOMCLOSE: "usecustomclose", _MSG_TYPE_ERROR: "error", _ORMMA_STATE_DEFAULT: "default", _ORMMA_STATE_EXPANDED: "expanded", _ORMMA_STATE_HIDDEN: "hidden", _ORMMA_STATE_RESIZED: "resized", _ORMMA_STATE_SUSPENDED: "suspended", _ORMMA_NETWORK_OFFLINE: "offline", _ORMMA_NETWORK_WIFI: "wifi", _ORMMA_NETWORK_CELL: "cell", _ORMMA_NETWORK_UNKNOWN: "unknown", _ORMMA_RESPONSE_IGNORE: "ignore", _ORMMA_RESPONSE_PROXY: "proxy", _HTTP_HEADER_CACHE_CONTROL: "cache-control", _HTTP_HEADER_VALUE_CACHE_CONTROL_NO_CACHE: "no-cache", _RESERVED_CLOSE_BAND_HEIGHT: 2 * 50, _MIN_AD_REFRESH_INTERVAL_IN_MILLISECONDS_METERED: 60000, _MIN_AD_REFRESH_INTERVAL_IN_MILLISECONDS_UNMETERED: 30000, _MAX_ERROR_REPORT: 20, _MAX_ERROR_REPORT_MESSAGE: "error reporting maximum reached, no more errors will be reported", _MAX_URL_LENGTH: 2048, _ERROR_ENUM: {
+ Unknown: "Unknown", NoAdAvailable: "NoAdAvailable", NetworkConnectionFailure: "NetworkConnectionFailure", ClientConfiguration: "ClientConfiguration", ServerSideError: "ServerSideError", InvalidServerResponse: "InvalidServerResponse", Other: "Other"
+ }, onAdRefreshed: {
+ get: function() {
+ return this._onAdRefreshed
+ }, set: function(value) {
+ if (typeof(value) === "function" || value === null || typeof(value) === "undefined")
+ this._onAdRefreshed = value
+ }
+ }, onAdRendered: {
+ get: function() {
+ return this._onAdRendered
+ }, set: function(value) {
+ if (typeof(value) === "function" || value === null || typeof(value) === "undefined")
+ this._onAdRendered = value
+ }
+ }, onBeforeAdRender: {
+ get: function() {
+ return this._onBeforeAdRender
+ }, set: function(value) {
+ if (typeof(value) === "function" || value === null || typeof(value) === "undefined")
+ this._onBeforeAdRender = value
+ }
+ }, onErrorOccurred: {
+ get: function() {
+ return this._onErrorOccurred
+ }, set: function(value) {
+ if (typeof(value) === "function" || value === null || typeof(value) === "undefined")
+ this._onErrorOccurred = value
+ }
+ }, onEngagedChanged: {
+ get: function() {
+ return this._onEngagedChanged
+ }, set: function(value) {
+ if (typeof(value) === "function" || value === null || typeof(value) === "undefined")
+ this._onEngagedChanged = value
+ }
+ }, onPointerDown: {
+ get: function() {
+ return this._onPointerDown
+ }, set: function(value) {
+ if (typeof(value) === "function" || value === null || typeof(value) === "undefined")
+ this._onPointerDown = value
+ }
+ }, onPointerUp: {
+ get: function() {
+ return this._onPointerUp
+ }, set: function(value) {
+ if (typeof(value) === "function" || value === null || typeof(value) === "undefined")
+ this._onPointerUp = value
+ }
+ }, applicationId: {
+ get: function() {
+ return this._applicationId
+ }, set: function(value) {
+ if (this._applicationId !== value)
+ this._applicationId = value
+ }
+ }, adUnitId: {
+ get: function() {
+ return this._adUnitId
+ }, set: function(value) {
+ if (this._adUnitId !== value)
+ this._adUnitId = value
+ }
+ }, isAutoRefreshEnabled: {
+ get: function() {
+ return this._isAutoRefreshEnabled
+ }, set: function(value) {
+ if (this._isAutoRefreshEnabled !== value) {
+ this._isAutoRefreshEnabled = value;
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh();
+ else
+ this._unscheduleRefresh()
+ }
+ }
+ }, isEngaged: {get: function() {
+ return this._isExpanded || this._isUserEngaged
+ }}, latitude: {
+ get: function() {
+ return this._latitude
+ }, set: function(value) {
+ if (typeof(value) === "string")
+ this._latitude = parseFloat(value);
+ else
+ this._latitude = value
+ }
+ }, longitude: {
+ get: function() {
+ return this._longitude
+ }, set: function(value) {
+ if (typeof(value) === "string")
+ this._longitude = parseFloat(value);
+ else
+ this._longitude = value
+ }
+ }, element: {get: function() {
+ return this._domElement
+ }}, addAdTag: function(tagName, tagValue) {
+ if (typeof(tagName) === "string" && typeof(tagValue) === "string")
+ try {
+ this._rendererOptions.addRendererOption(tagName, tagValue)
+ }
+ catch(e) {
+ this._fireErrorOccurred(e.message, this._ERROR_ENUM.Other)
+ }
+ else
+ this._fireErrorOccurred("Error: Could not add renderer option or value as they were not strings.", this._ERROR_ENUM.Other)
+ }, refresh: function() {
+ if (this._isAutoRefreshEnabled) {
+ this._fireErrorOccurred("refresh() may not be called when auto-refresh is enabled (isAutoRefreshEnabled=true)", this._ERROR_ENUM.Other);
+ return
+ }
+ if (!this._checkIfRefreshIntervalMetAndRaiseError())
+ return;
+ this._refreshInternal()
+ }, _checkIfRefreshIntervalMetAndRaiseError: function() {
+ var isIntervalMet = false;
+ var refreshInterval = this._MIN_AD_REFRESH_INTERVAL_IN_MILLISECONDS_UNMETERED;
+ if (this._timeAtLastRotation !== null)
+ try {
+ var connectionProfile = Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile();
+ if (connectionProfile !== null) {
+ var currentConnectionCost = connectionProfile.getConnectionCost();
+ var isMeteredConnection = currentConnectionCost.NetworkCostType === Windows.Networking.Connectivity.NetworkCostType.fixed || currentConnectionCost.NetworkCostType === Windows.Networking.Connectivity.NetworkCostType.variable;
+ refreshInterval = isMeteredConnection ? this._MIN_AD_REFRESH_INTERVAL_IN_MILLISECONDS_METERED : this._MIN_AD_REFRESH_INTERVAL_IN_MILLISECONDS_UNMETERED
+ }
+ }
+ catch(err) {}
+ else {
+ this._timeAtLastRotation = new Date;
+ return true
+ }
+ isIntervalMet = new Date - this._timeAtLastRotation > refreshInterval;
+ if (!isIntervalMet)
+ this._fireErrorOccurred("refresh() may not be called more than once every " + refreshInterval / 1000 + " seconds.", this._ERROR_ENUM.Other);
+ return isIntervalMet
+ }, suspend: function() {
+ if (this._isExpanded)
+ this._closePopup();
+ this._unscheduleRefresh();
+ if (this._ormmaState !== this._ORMMA_STATE_SUSPENDED)
+ this._setState(this._ORMMA_STATE_SUSPENDED);
+ this._isSuspended = true
+ }, resume: function() {
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh();
+ if (this._ormmaState === this._ORMMA_STATE_SUSPENDED)
+ if (typeof(this._previousOrmmaState) === "undefined" || this._previousOrmmaState === null)
+ this._setState(this._ORMMA_STATE_DEFAULT);
+ else
+ this._setState(this._previousOrmmaState);
+ this._isSuspended = false
+ }, _log: function(msg){}, _getSdkInfo: function() {
+ try {
+ var info = MicrosoftAdvertising.Shared.WinRT.SdkInfoProvider.getSdkInfo();
+ return {
+ sdkVersion: info.sdkVersion, client: info.client, runtimeType: info.runtimeType
+ }
+ }
+ catch(err) {
+ return {}
+ }
+ }, _fadeIn: function(elem, callback) {
+ try {
+ if (typeof(elem) === "object" && elem !== null) {
+ elem.style.visibility = "inherit";
+ elem.style.transition = "opacity " + this._fadeOptions.fadeInTimeS + "s" + this._fadeOptions.timer.linear;
+ elem.style.opacity = 1;
+ if (typeof(callback) === "function")
+ window.setTimeout(function() {
+ callback(true)
+ }, this._fadeOptions.fadeInTimeS * 1000)
+ }
+ else if (typeof(callback) === "function")
+ callback(false)
+ }
+ catch(err) {}
+ }, _fadeOut: function(elem, callback) {
+ try {
+ if (typeof(elem) === "object" && elem !== null) {
+ elem.style.transition = "opacity " + this._fadeOptions.fadeInTimeS + "s" + this._fadeOptions.timer.linear;
+ elem.style.opacity = 0;
+ if (typeof(callback) === "function")
+ window.setTimeout(function() {
+ callback(true)
+ }, this._fadeOptions.fadeOutTimeS * 1000)
+ }
+ else if (typeof(callback) === "function")
+ callback(false)
+ }
+ catch(err) {}
+ }, _refreshInternal: function() {
+ if (this._requestInProgress) {
+ this._fireErrorOccurred("refresh triggered but request is already in progress", this._ERROR_ENUM.Other);
+ return
+ }
+ this._requestInProgress = true;
+ try {
+ if (Windows.ApplicationModel.DesignMode.designModeEnabled) {
+ this._requestInProgress = false;
+ return
+ }
+ }
+ catch(err) {}
+ if (window !== top) {
+ this._requestInProgress = false;
+ this._fireErrorOccurred("ad control may not be loaded in an iframe", this._ERROR_ENUM.Other);
+ return
+ }
+ if (this._domElement === null || this._domElement.offsetWidth === 0 || this._domElement.offsetHeight === 0) {
+ this._requestInProgress = false;
+ return
+ }
+ if (this._isExpanded) {
+ this._requestInProgress = false;
+ return
+ }
+ if (this._isSuspended) {
+ this._requestInProgress = false;
+ this._fireErrorOccurred("cannot refresh when suspended", this._ERROR_ENUM.Other);
+ return
+ }
+ if (this._isUserEngaged) {
+ this._requestInProgress = false;
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh();
+ return
+ }
+ if (typeof(window._msAdEngaged) !== "undefined" && window._msAdEngaged) {
+ this._requestInProgress = false;
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh();
+ return
+ }
+ if (!this._validateParameters()) {
+ this._requestInProgress = false;
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh();
+ return
+ }
+ if (this._adIFrame !== null && (document.hidden || !this._isOnScreen())) {
+ this._requestInProgress = false;
+ this._fireErrorOccurred("refresh not performed because ad is not on screen", this._ERROR_ENUM.Other);
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh();
+ return
+ }
+ if (this._placement === null)
+ try {
+ this._placement = new MicrosoftAdvertising.Shared.WinRT.AdPlacement
+ }
+ catch(err) {
+ this._requestInProgress = false;
+ this._fireErrorOccurred("could not initialize AdPlacement", this._ERROR_ENUM.Other);
+ return
+ }
+ this._placement.applicationId = this._applicationId;
+ this._placement.adUnitId = this._adUnitId;
+ this._placement.latitude = this.latitude;
+ this._placement.longitude = this.longitude;
+ this._placement.width = this._domElement.offsetWidth;
+ this._placement.height = this._domElement.offsetHeight;
+ if (this._rendererOptions !== null && typeof(this._rendererOptions) !== "undefined")
+ this._placement.adTags = this._rendererOptions.getOptions();
+ try {
+ var self = this;
+ this._placement.getAdAsync().done(function(ad) {
+ if (ad !== null)
+ self._adRefreshedCallback(ad);
+ else if (!self._isDisposed && self._placement !== null && typeof(self._placement) !== "undefined") {
+ var error = self._placement.lastError;
+ self._errorOccurredCallback(error)
+ }
+ }, function(evt) {
+ if (!self._isDisposed && self._placement !== null && typeof(self._placement) !== "undefined") {
+ var error = self._placement.lastError;
+ self._errorOccurredCallback(error)
+ }
+ });
+ this._timeAtLastRotation = new Date
+ }
+ catch(err) {
+ self._errorOccurredCallback({
+ errorMessage: err.message, errorCode: this._ERROR_ENUM.Other
+ })
+ }
+ }, removeAdTag: function(tagName) {
+ if (typeof(tagName) === "string")
+ try {
+ this._rendererOptions.removeRendererOption(tagName)
+ }
+ catch(e) {
+ this._fireErrorOccurred("Error: Could not remove renderer option or value.", this._ERROR_ENUM.Other)
+ }
+ }, _networkInfo: function() {
+ try {
+ return Windows.Networking.Connectivity.NetworkInformation
+ }
+ catch(err) {}
+ }(), _networkChangedEventHandler: function(){}, _isOnScreen: function() {
+ if (this._domElement === null)
+ return false;
+ var fractionAllowedOffScreen = 0.4;
+ var adRect = {};
+ try
+ {
+ adRect = this._domElement.getBoundingClientRect()
+ }
+ catch(e) {
+ return false
+ }
+ var xAllowedOff = this._domElement.offsetWidth * fractionAllowedOffScreen;
+ var yAllowedOff = this._domElement.offsetHeight * fractionAllowedOffScreen;
+ return (adRect.left >= -xAllowedOff) && (adRect.top >= -yAllowedOff) && (adRect.right < document.documentElement.offsetWidth + xAllowedOff) && (adRect.bottom < document.documentElement.offsetHeight + yAllowedOff)
+ }, _errorOccurredCallback: function(evt) {
+ if (this._isDisposed)
+ return;
+ if (typeof(evt) !== "object" || evt === null)
+ this._fireErrorOccurred("Other", this._ERROR_ENUM.Other);
+ else
+ this._fireErrorOccurred(evt.errorMessage, evt.errorCode);
+ this._currentAdHeight = null;
+ this._currentAdWidth = null;
+ this._requestInProgress = false;
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh()
+ }, _adRefreshedCallback: function(ad) {
+ if (this._isDisposed)
+ return;
+ if (ad !== null)
+ this._onAdReceived(ad);
+ this._requestInProgress = false;
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh()
+ }, _onAdReceived: function(ad) {
+ if (typeof(ad) !== "undefined" && ad !== null) {
+ this._adInstanceState = null;
+ this._disposeAccelerometer();
+ this._stopOrientationMonitoring();
+ this._stopViewableChangeMonitoring();
+ this._setUseCustomClose(false);
+ this._ad = ad;
+ var iFrameToRemove = null;
+ this._currentAdHeight = this._placement.height;
+ this._currentAdWidth = this._placement.width;
+ if (this._adIFrame !== null)
+ iFrameToRemove = this._adIFrame;
+ try {
+ var rendererUrl = this._ad.rendererUrl;
+ var adString = this._ad.adParameters;
+ var prmString = this._ad.prmParameters
+ }
+ catch(err) {
+ if (err !== null && typeof(err) === "object")
+ this._fireErrorOccurred(err.message, this._ERROR_ENUM.Other);
+ return
+ }
+ var self = this;
+ var createFrameAndLoadAd = function() {
+ var newFrame = self._createMainFrame();
+ if (newFrame === null || typeof(newFrame) !== "object") {
+ self._fireErrorOccurred("Error: Could not create iFrame", self._ERROR_ENUM.Other);
+ return
+ }
+ self._onAdRefreshedInternal = function() {
+ if (typeof(iFrameToRemove) === "object" && iFrameToRemove !== null)
+ self._fadeOut(iFrameToRemove, function() {
+ self._removeIFrame(iFrameToRemove);
+ self._fadeIn(newFrame, null)
+ });
+ else
+ self._showIFrame(newFrame);
+ self._adIFrame = newFrame;
+ self._onAdRefreshedInternal = null
+ };
+ self._loadAdInFrame(newFrame, rendererUrl, adString, prmString)
+ };
+ var promise = this._fireBeforeAdRender();
+ if (typeof(promise) === "object" && promise !== null && typeof(promise.then) === "function")
+ promise.then(createFrameAndLoadAd);
+ else
+ createFrameAndLoadAd()
+ }
+ }, _showIFrame: function(iFrame) {
+ if (typeof(iFrame) === "object" && iFrame !== null) {
+ iFrame.style.opacity = 1;
+ iFrame.style.visibility = "inherit"
+ }
+ }, _removeIFrame: function(iFrame) {
+ if (iFrame === null || typeof(iFrame) === "undefined")
+ iFrame = this._adIFrame;
+ this._removeFromParent(iFrame)
+ }, _removeFromParent: function(child) {
+ try {
+ if (child !== null && typeof(child) === "object") {
+ var parentElem = child.parentNode;
+ if (parentElem !== null && typeof(parentElem) === "object")
+ parentElem.removeChild(child)
+ }
+ }
+ catch(err) {}
+ }, _createMainFrame: function() {
+ return this._createIFrame(this._domElement.id + "_webFrame_" + (+new Date), this._domElement.offsetWidth, this._domElement.offsetHeight, this._domElement, "default")
+ }, _initializeOrmma: function(iframe, width, height, ormmaState) {
+ var adSize = {
+ height: height, width: width
+ };
+ var locale = "undefined";
+ try {
+ locale = Windows.Globalization.ApplicationLanguages.languages[0]
+ }
+ catch(err) {
+ this._log("locale init error: " + (typeof(err) === "object" ? err.message : err))
+ }
+ if (ormmaState === this._ORMMA_STATE_DEFAULT)
+ this._defaultStateSize = adSize;
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETSIZE + ":" + JSON.stringify(adSize));
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETMAXSIZE + ":" + JSON.stringify(adSize));
+ this._setOrmmaScreenSize(iframe);
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETSTATE + ":" + ormmaState);
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETLOCALE + ":" + locale);
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETNETWORK + ":" + this._getNetworkState());
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETSDKINFO + ":" + JSON.stringify(this._getSdkInfo()));
+ var isAccelerometerPresent = false;
+ try {
+ isAccelerometerPresent = Windows.Devices.Sensors.Accelerometer.getDefault() !== null
+ }
+ catch(err) {}
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETCAPABILITY + ":" + JSON.stringify({
+ capability: "tilt", value: isAccelerometerPresent
+ }));
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETCAPABILITY + ":" + JSON.stringify({
+ capability: "shake", value: isAccelerometerPresent
+ }));
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_ORMMA_START)
+ }, _createIFrame: function(frameId, width, height, parentElem, ormmaState) {
+ try {
+ var iframe = document.createElement("iframe");
+ iframe.src = "ms-appx-web:///MSAdvertisingJS/ads/bootstrap.html?bubblePointerEvents=1";
+ iframe.width = width + "px";
+ iframe.height = height + "px";
+ iframe.frameBorder = "0px";
+ iframe.marginwidth = "0px";
+ iframe.marginheight = "0px";
+ iframe.id = frameId;
+ iframe.scrolling = "no";
+ iframe.style.visibility = "hidden";
+ iframe.style.backgroundColor = "transparent";
+ iframe.style.opacity = 0;
+ parentElem.appendChild(iframe);
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETID + ":" + this._domElement.id);
+ this._initializeOrmma(iframe, width, height, ormmaState);
+ return iframe
+ }
+ catch(err) {
+ return
+ }
+ }, _setElement: function(element) {
+ if (element.id === null || element.id === "")
+ element.id = this._generateUniqueId();
+ this._domElement = element
+ }, _generateUniqueId: function() {
+ var generatedId = null;
+ var existingElem = null;
+ do {
+ generatedId = "ad" + Math.floor(Math.random() * 10000);
+ existingElem = document.getElementById(generatedId)
+ } while (existingElem !== null);
+ return generatedId
+ }, _loadAdInFrame: function(iframe, rendererUrl, adString, prmString) {
+ if (this._renderContent === null || typeof(this._renderContent) === "undefined") {
+ if (this._getNetworkState() === this._ORMMA_NETWORK_OFFLINE) {
+ this._removeIFrame(iframe);
+ this._fireErrorOccurred("no network is available", this._ERROR_ENUM.NetworkConnectionFailure);
+ return
+ }
+ var xhr = new XMLHttpRequest;
+ var self = this;
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === XMLHttpRequest.DONE)
+ if (xhr.status === 200) {
+ self._rendererContent = xhr.responseText;
+ self._loadAdInFrameB(iframe, self._rendererContent, adString, prmString)
+ }
+ else {
+ self._removeIFrame(iframe);
+ self._fireErrorOccurred("error loading ad renderer: code " + xhr.status, self._ERROR_ENUM.NetworkConnectionFailure)
+ }
+ };
+ xhr.open("GET", rendererUrl, true);
+ xhr.timeout = 10000;
+ try {
+ xhr.send(null)
+ }
+ catch(e) {
+ this._removeIFrame(iframe);
+ this._fireErrorOccurred("http request error: " + e.message, this._ERROR_ENUM.NetworkConnectionFailure);
+ return
+ }
+ }
+ else
+ this._loadAdInFrameB(iframe, this._rendererContent, adString, prmString)
+ }, _loadAdInFrameB: function(iframe, rendererContent, adString, prmString) {
+ this._rendererParams = adString;
+ this._prmParams = prmString;
+ this._sendAdDataToAdContainer(iframe, rendererContent, adString, prmString);
+ this._fireAdRefreshed()
+ }, _sendMessageToAdContainer: function(iframe, msg) {
+ if (iframe !== null && iframe !== undefined) {
+ var target = iframe.contentWindow;
+ var origin = "ms-appx-web://" + document.location.host;
+ var self = this;
+ setImmediate(function() {
+ if (target && !self._isDisposed)
+ try {
+ target.postMessage(msg, origin)
+ }
+ catch(err) {
+ if (err !== null && typeof(err) === "object")
+ self._log("postMessage error" + (typeof(err) !== "undefined" ? ": " + err.message : ""))
+ }
+ })
+ }
+ }, _sendMessageToAllAdContainers: function(msg) {
+ try {
+ this._sendMessageToAdContainer(this._adIFrame, msg);
+ this._sendMessageToAdContainer(this._expandedIFrame, msg)
+ }
+ catch(err) {}
+ }, _sendAdDataToAdContainer: function(iframe, renderer, ad, prm) {
+ try {
+ if (typeof(ad) === "string" && ad !== "")
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_ADPARAMS + ":" + ad);
+ if (typeof(prm) === "string" && prm !== "")
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_PRMPARAMS + ":" + prm);
+ try {
+ var appPrm = this._rendererOptions.getOptionsJson()
+ }
+ catch(e) {
+ this._log("error: could not get renderer options as json")
+ }
+ if (typeof(appPrm) === "string" && appPrm !== "")
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_APPPARAMS + ":" + appPrm);
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SCRIPT + ":" + renderer);
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_INIT)
+ }
+ catch(err) {}
+ }, _fireErrorOccurred: function(msg, errorCode) {
+ this._log(msg + " (" + errorCode + ")");
+ if (typeof(this._onErrorOccurred) === "function")
+ this._onErrorOccurred(this, {
+ errorMessage: msg, errorCode: errorCode
+ })
+ }, _firePointerDown: function(msg) {
+ if (typeof(this._onPointerDown) === "function")
+ this._onPointerDown(this, msg)
+ }, _firePointerUp: function() {
+ if (typeof(this._onPointerUp) === "function")
+ this._onPointerUp(this)
+ }, _fireEngagedChanged: function() {
+ if (typeof(this._onEngagedChanged) === "function")
+ this._onEngagedChanged(this)
+ }, _fireAdRendered: function() {
+ if (typeof(this._onAdRendered) === "function")
+ this._onAdRendered(this)
+ }, _fireAdRefreshed: function() {
+ if (typeof(this._onAdRefreshedInternal) === "function")
+ this._onAdRefreshedInternal();
+ if (typeof(this._onAdRefreshed) === "function")
+ this._onAdRefreshed(this)
+ }, _fireBeforeAdRender: function() {
+ if (typeof(this._onBeforeAdRender) === "function")
+ return this._onBeforeAdRender(this);
+ else
+ return null
+ }, _receiveMessage: function(msg) {
+ if (msg.origin !== "ms-appx-web://" + document.location.host)
+ return;
+ var msgStr = msg.data;
+ var colonIx = msgStr.indexOf(":");
+ if (colonIx < 0)
+ return;
+ var divId = msgStr.substr(0, colonIx);
+ if (divId === "null")
+ return;
+ msgStr = msgStr.substr(colonIx + 1);
+ var controlElem = document.getElementById(divId);
+ if (controlElem === null)
+ return;
+ var control = controlElem.winControl;
+ if (control === null || typeof(control) !== "object" || control._isDisposed)
+ return;
+ var msgType = null;
+ var msgParams = null;
+ colonIx = msgStr.indexOf(":");
+ if (colonIx < 0)
+ msgType = msgStr;
+ else {
+ msgType = msgStr.substr(0, colonIx);
+ msgParams = msgStr.substr(colonIx + 1)
+ }
+ if (msgType === control._MSG_TYPE_EXPAND)
+ try {
+ var props = JSON.parse(msgParams);
+ if (control._ormmaState === control._ORMMA_STATE_DEFAULT || control._ormmaState === control._ORMMA_STATE_RESIZED)
+ control._expand(props.url);
+ else
+ control._reportError("expand", "state is not default or resized, current state is:" + control._ormmaState)
+ }
+ catch(err) {
+ control._reportError(control._MSG_TYPE_EXPAND, "unable to parse expand properties as json")
+ }
+ else if (msgType === control._MSG_TYPE_CLOSE)
+ if (control._ormmaState === control._ORMMA_STATE_EXPANDED)
+ control._closePopup();
+ else if (control._ormmaState === control._ORMMA_STATE_DEFAULT)
+ control._resize(0, 0, control._ORMMA_STATE_HIDDEN);
+ else if (control._ormmaState === control._ORMMA_STATE_RESIZED)
+ control._resize(control._defaultStateSize.width, control._defaultStateSize.height, control._ORMMA_STATE_DEFAULT);
+ else
+ control._reportError("close", "state is not expanded, default or resized, current state is:" + control._ormmaState);
+ else if (msgType === control._MSG_TYPE_SETEXPANDPROPERTIES)
+ control._updateExpandProperties(msgParams);
+ else if (msgType === control._MSG_TYPE_SETUSERENGAGED)
+ control._processSetUserEngaged(msgParams);
+ else if (msgType === control._MSG_TYPE_RENDERED)
+ control._fireAdRendered();
+ else if (msgType === control._MSG_TYPE_TILT)
+ control._processTiltMessage(msgParams);
+ else if (msgType === control._MSG_TYPE_SHAKE)
+ control._processShakeMessage(msgParams);
+ else if (msgType === control._MSG_TYPE_GETORIENTATION)
+ control._processGetOrientationMessage(msgParams);
+ else if (msgType === control._MSG_TYPE_ERROR) {
+ control._removeIFrame();
+ control._fireErrorOccurred(msgParams, control._ERROR_ENUM.Other)
+ }
+ else if (msgType === control._MSG_TYPE_RESIZE)
+ if (control._ormmaState === control._ORMMA_STATE_DEFAULT) {
+ var resizeProps = JSON.parse(msgParams);
+ control._resize(resizeProps.width, resizeProps.height, control._ORMMA_STATE_RESIZED)
+ }
+ else
+ control._reportError("resize", "state is not default, current state is:" + control._ormmaState);
+ else if (msgType === control._MSG_TYPE_HIDE)
+ if (control._ormmaState === control._ORMMA_STATE_DEFAULT)
+ control._resize(0, 0, control._ORMMA_STATE_HIDDEN);
+ else
+ control._reportError("hide", "state is not default, current state is:" + control._ormmaState);
+ else if (msgType === control._MSG_TYPE_SHOW)
+ if (control._ormmaState === control._ORMMA_STATE_HIDDEN)
+ control._resize(control._defaultStateSize.width, control._defaultStateSize.height, control._ORMMA_STATE_DEFAULT);
+ else
+ control._reportError("show", "state is not hidden, current state is:" + control._ormmaState);
+ else if (msgType === control._MSG_TYPE_OPEN) {
+ var data = JSON.parse(msgParams);
+ var uri = control._getUri(data);
+ if (uri !== null)
+ try {
+ Windows.System.Launcher.launchUriAsync(uri)
+ }
+ catch(err) {
+ control._reportError("open", "unable to open URL")
+ }
+ else
+ control._reportError("open", "parameters are not valid")
+ }
+ else if (msgType === control._MSG_TYPE_REQUEST)
+ control._request(JSON.parse(msgParams));
+ else if (msgType === control._MSG_TYPE_VIEWABLECHANGE)
+ control._processViewableChangeMessage(msgParams);
+ else if (msgType === control._MSG_TYPE_STOREADINSTANCESTATE)
+ control._storeAdInstanceState(msgParams);
+ else if (msgType === control._MSG_TYPE_ONPOINTERDOWN)
+ control._firePointerDown(JSON.parse(msgParams));
+ else if (msgType === control._MSG_TYPE_ONPOINTERUP)
+ control._firePointerUp();
+ else if (msgType === control._MSG_TYPE_USECUSTOMCLOSE)
+ control._setUseCustomClose(JSON.parse(msgParams));
+ else
+ control._reportError("unknown", "unknown action")
+ }, _reportError: function(action, message) {
+ if (this._errorReportCount < this._MAX_ERROR_REPORT) {
+ this._errorReportCount++;
+ message = this._errorReportCount >= this._MAX_ERROR_REPORT ? this._MAX_ERROR_REPORT_MESSAGE : message;
+ this._sendMessageToAllAdContainers(this._MSG_TYPE_ERROR + ":" + JSON.stringify({
+ action: action, message: message
+ }))
+ }
+ }, _setupEvents: function() {
+ try {
+ window.addEventListener("message", this._receiveMessage);
+ var self = this;
+ this._domElement.onresize = function() {
+ self._onResize()
+ };
+ this._resizeHandler = this._onDocumentResize.bind(this);
+ window.addEventListener("resize", this._resizeHandler);
+ this._domNodeRemovedHandler = function(evt) {
+ if (evt.target === self._domElement)
+ self._onRemove()
+ };
+ this._domElement.addEventListener("DOMNodeRemoved", this._domNodeRemovedHandler);
+ this._networkChangedEventHandler = function(eventArgs) {
+ self._sendMessageToAllAdContainers(self._MSG_TYPE_SETNETWORK + ":" + self._getNetworkState())
+ };
+ this._networkInfo.addEventListener("networkstatuschanged", this._networkChangedEventHandler);
+ if (this._adsGlobalEventManager !== null && typeof(this._adsGlobalEventManager) !== "undefined" && this._adsGlobalEventManager.isInitialized === true) {
+ this._globalAdEngagedHandler = this._adsGlobalEventManager.addEventListener(MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE.AD_ENGAGED, function(engagedAdId) {
+ if (self.element !== null && typeof(self.element !== "undefined") && self.element.id !== engagedAdId)
+ self.suspend()
+ });
+ this._globalAdDisengagedHandler = this._adsGlobalEventManager.addEventListener(MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE.AD_DISENGAGED, function(disengagedAdId) {
+ if (self.element !== null && typeof(self.element !== "undefined") && self.element.id !== disengagedAdId)
+ self.resume()
+ })
+ }
+ }
+ catch(err) {}
+ }, dispose: function() {
+ try {
+ if (this._expandedIFrame !== null)
+ this._closePopup();
+ if (typeof(this._resizeHandler) === "function") {
+ window.removeEventListener("resize", this._resizeHandler);
+ this._resizeHandler = null
+ }
+ if (typeof(this._domNodeRemovedHandler) === "function") {
+ if (this._domElement !== null)
+ this._domElement.removeEventListener("DOMNodeRemoved", this._domNodeRemovedHandler);
+ this._domNodeRemovedHandler = null
+ }
+ if (this._adIFrame !== null) {
+ this._removeIFrame(this._adIFrame);
+ this._adIFrame = null
+ }
+ this._disposeAccelerometer();
+ this._stopOrientationMonitoring();
+ this._stopViewableChangeMonitoring();
+ this._onAdRefreshedInternal = null;
+ this._onAdRefreshed = null;
+ this._onAdRendered = null;
+ this._onBeforeAdRender = null;
+ this._onErrorOccurred = null;
+ this._onEngagedChanged = null;
+ this._onPointerDown = null;
+ this._onPointerUp = null;
+ this._onRemove();
+ this._adsGlobalEventManager.removeEventListener(MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE.AD_ENGAGED, this._globalAdEngagedHandler);
+ this._adsGlobalEventManager.removeEventListener(MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE.AD_DISENGAGED, this._globalAdDisengagedHandler);
+ this._adsGlobalEventManager.dispose();
+ if (this._domElement !== null) {
+ this._domElement.winControl = null;
+ this._domElement.onresize = null;
+ this._domElement = null
+ }
+ this._isDisposed = true
+ }
+ catch(err) {}
+ }, _setUseCustomClose: function(flag) {
+ var previousCloseBandHeight = this._currentCloseBandHeight;
+ if (flag)
+ this._currentCloseBandHeight = 0;
+ else
+ this._currentCloseBandHeight = this._RESERVED_CLOSE_BAND_HEIGHT;
+ if (previousCloseBandHeight !== this._currentCloseBandHeight)
+ this._setOrmmaScreenSize(this._adIFrame)
+ }, _disposeAdPlacement: function() {
+ if (this._placement !== null) {
+ this._placement.onadrefreshed = null;
+ this._placement.onerroroccurred = null;
+ this._placement = null
+ }
+ }, _onRemove: function() {
+ this._unscheduleRefresh();
+ this._stopOrientationMonitoring();
+ this._networkInfo.removeEventListener("networkstatuschanged", this._networkChangedEventHandler);
+ this._disposeAdPlacement()
+ }, _onDocumentResize: function() {
+ if (this._adIFrame !== null) {
+ this._setOrmmaScreenSize(this._adIFrame);
+ if (this._ormmaState === this._ORMMA_STATE_EXPANDED) {
+ this._positionExpandedFrame();
+ this._setOrmmaScreenSize(this._expandedIFrame)
+ }
+ }
+ }, _setOrmmaScreenSize: function(iframe) {
+ var screenSize = {
+ height: document.documentElement.offsetHeight - this._currentCloseBandHeight, width: document.documentElement.offsetWidth
+ };
+ if (screenSize.height < 0)
+ screenSize.height = 0;
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETSCREENSIZE + ":" + JSON.stringify(screenSize))
+ }, _onResize: function() {
+ var newWidth = this.element.offsetWidth;
+ var newHeight = this.element.offsetHeight;
+ var currentWidth = this._currentAdWidth;
+ var currentHeight = this._currentAdHeight;
+ if (newWidth !== currentWidth || newHeight !== currentHeight) {
+ if (!this._requestInProgress) {
+ this._unscheduleRefresh();
+ this._refreshInternal()
+ }
+ }
+ else if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh()
+ }, _updateExpandProperties: function(newExpandProps) {
+ try {
+ this._expandProperties = JSON.parse(newExpandProps)
+ }
+ catch(err) {
+ this._reportError(this._MSG_TYPE_SETEXPANDPROPERTIES, "unable to parse expand properties as json");
+ return
+ }
+ if (this._isExpanded && this._expandedIFrame !== null) {
+ var expandedBounds = this._getExpandedBounds();
+ this._expandedIFrame.style.top = expandedBounds.y + "px";
+ this._expandedIFrame.style.left = expandedBounds.x + "px";
+ this._expandedIFrame.width = expandedBounds.width + "px";
+ this._expandedIFrame.height = expandedBounds.height + "px";
+ this._setSize(this._expandedIFrame, expandedBounds.width, expandedBounds.height)
+ }
+ }, _getExpandedBounds: function() {
+ var screenHeight = document.documentElement.offsetHeight;
+ var screenWidth = document.documentElement.offsetWidth;
+ var expandedX = 0;
+ var expandedY = 0;
+ var expandedHeight = screenHeight - this._currentCloseBandHeight;
+ var expandedWidth = screenWidth;
+ if (this._expandProperties) {
+ expandedWidth = this._expandProperties.width !== undefined ? this._expandProperties.width : expandedWidth;
+ expandedHeight = this._expandProperties.height !== undefined ? this._expandProperties.height : expandedHeight;
+ if (expandedHeight > screenHeight - this._currentCloseBandHeight) {
+ expandedWidth = expandedWidth * (screenHeight - this._currentCloseBandHeight) / expandedHeight;
+ expandedHeight = screenHeight - this._currentCloseBandHeight
+ }
+ if (expandedWidth > screenWidth) {
+ expandedHeight = expandedHeight * (screenWidth / expandedWidth);
+ expandedWidth = screenWidth
+ }
+ expandedX = (screenWidth - expandedWidth) / 2;
+ expandedY = (screenHeight - expandedHeight) / 2
+ }
+ return {
+ x: expandedX, y: expandedY, width: expandedWidth, height: expandedHeight
+ }
+ }, _expand: function(url) {
+ if (this._isExpanded || (typeof(window._msAdEngaged) !== "undefined" && window._msAdEngaged))
+ return;
+ var screenHeight = document.documentElement.offsetHeight;
+ var screenWidth = document.documentElement.offsetWidth;
+ var expandedBounds = this._getExpandedBounds();
+ var expandedAdZIndex = 2147483647 - 10;
+ try {
+ this._overlayDiv = document.createElement("div");
+ this._overlayDiv.style.zIndex = expandedAdZIndex - 1;
+ this._overlayDiv.style.position = "absolute";
+ this._overlayDiv.style.top = "0px";
+ this._overlayDiv.style.left = "0px";
+ this._overlayDiv.style.width = screenWidth + "px";
+ this._overlayDiv.style.height = screenHeight + "px";
+ this._overlayDiv.id = this._domElement.id + "_overlayDiv";
+ this._overlayDiv.style.backgroundColor = "#000000";
+ this._overlayDiv.style.opacity = 0.8;
+ var control = this;
+ this._overlayDiv.onclick = function(evt) {
+ control._closePopup()
+ };
+ document.body.appendChild(this._overlayDiv);
+ this._expandedIFrame = document.createElement("iframe");
+ this._expandedIFrame.id = this._domElement.id + "_expandIframe";
+ this._expandedIFrame.style.top = expandedBounds.y + "px";
+ this._expandedIFrame.style.left = expandedBounds.x + "px";
+ this._expandedIFrame.style.zIndex = expandedAdZIndex;
+ this._expandedIFrame.style.position = "absolute";
+ this._expandedIFrame.width = expandedBounds.width + "px";
+ this._expandedIFrame.height = expandedBounds.height + "px";
+ this._expandedIFrame.marginwidth = "0px";
+ this._expandedIFrame.marginheight = "0px";
+ this._expandedIFrame.frameBorder = "0px";
+ this._expandedIFrame.onblur = function(evt) {
+ try {
+ evt.currentTarget.focus()
+ }
+ catch(err) {}
+ };
+ document.body.appendChild(this._expandedIFrame)
+ }
+ catch(err) {
+ this._overlayDiv = this._disposeElement(this._overlayDiv);
+ this._expandedIFrame = this._disposeElement(this._expandedIFrame);
+ return
+ }
+ if (typeof(url) === "string" && url.length !== 0) {
+ this._expandedIFrame.src = url;
+ this._expandedIFrame.style.backgroundColor = "#FFFFFF"
+ }
+ else {
+ this._expandedIFrame.src = "ms-appx-web:///MSAdvertisingJS/ads/bootstrap.html";
+ this._sendMessageToAdContainer(this._expandedIFrame, this._MSG_TYPE_SETID + ":" + this._domElement.id);
+ if (this._adInstanceState !== null)
+ this._sendMessageToAdContainer(this._expandedIFrame, this._MSG_TYPE_SETADINSTANCESTATE + ":" + this._adInstanceState);
+ this._initializeOrmma(this._expandedIFrame, expandedBounds.width, expandedBounds.height, this._ORMMA_STATE_EXPANDED);
+ this._sendAdDataToAdContainer(this._expandedIFrame, this._rendererContent, this._rendererParams, this._prmParams);
+ try {
+ this._adsGlobalEventManager.broadcastEvent(MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE.AD_ENGAGED, this.element.id)
+ }
+ catch(err) {
+ this._log("this._adsGlobalEventManager could not be called")
+ }
+ }
+ this._unscheduleRefresh();
+ this._setState(this._ORMMA_STATE_EXPANDED);
+ if (this._adIFrame !== null && typeof(this._adIFrame) === "object")
+ this._setSize(this._adIFrame, expandedBounds.width, expandedBounds.height);
+ var engagedBefore = this.isEngaged;
+ this._isExpanded = true;
+ window._msAdEngaged = true;
+ if (engagedBefore !== this.isEngaged)
+ this._fireEngagedChanged()
+ }, _disposeElement: function(node) {
+ if (node !== null && typeof(node) === "object")
+ try {
+ document.body.removeChild(node);
+ return null
+ }
+ catch(err) {
+ this._log("unable to remove node")
+ }
+ return node
+ }, _closePopup: function() {
+ if (this._overlayDiv !== null && typeof(this._overlayDiv) !== "undefined") {
+ this._removeFromParent(this._overlayDiv);
+ this._overlayDiv = null
+ }
+ if (this._expandedIFrame !== null) {
+ this._expandedIFrame.src = "about:blank";
+ this._removeFromParent(this._expandedIFrame);
+ this._expandedIFrame = null
+ }
+ this._setState(this._previousOrmmaState);
+ if (this._isAutoRefreshEnabled)
+ this._scheduleRefresh();
+ if (this._adIFrame !== null && typeof(this._adIFrame) === "object")
+ this._setSize(this._adIFrame, this._adIFrame.width, this._adIFrame.height);
+ var engagedBefore = this.isEngaged;
+ this._isExpanded = false;
+ window._msAdEngaged = false;
+ if (engagedBefore !== this.isEngaged)
+ this._fireEngagedChanged();
+ try {
+ this._adsGlobalEventManager.broadcastEvent(MicrosoftNSJS.Advertising.AdGlobalEventManager.EVENT_TYPE.AD_DISENGAGED, this.element.id)
+ }
+ catch(err) {
+ this._log("this._adsGlobalEventManager could not be called")
+ }
+ }, _positionExpandedFrame: function() {
+ if (this._expandedIFrame === null)
+ return;
+ var screenWidth = document.documentElement.offsetWidth;
+ var screenHeight = document.documentElement.offsetHeight;
+ if (this._overlayDiv !== null && typeof(this._overlayDiv) !== "undefined") {
+ this._overlayDiv.style.width = screenWidth + "px";
+ this._overlayDiv.style.height = screenHeight + "px"
+ }
+ var expandedX = (screenWidth - this._expandedIFrame.width) / 2;
+ var expandedY = (screenHeight - this._expandedIFrame.height) / 2;
+ this._expandedIFrame.style.left = expandedX + "px";
+ this._expandedIFrame.style.top = expandedY + "px"
+ }, _resize: function(width, height, state) {
+ if (this._adIFrame !== null && typeof(this._adIFrame) !== "undefined") {
+ this._adIFrame.height = height;
+ this._adIFrame.width = width;
+ this._setSize(this._adIFrame, width, height);
+ this._setState(state)
+ }
+ }, _setState: function(state) {
+ this._previousOrmmaState = this._ormmaState;
+ this._ormmaState = state;
+ this._sendMessageToAllAdContainers(this._MSG_TYPE_SETSTATE + ":" + state)
+ }, _setSize: function(iframe, width, height) {
+ this._sendMessageToAdContainer(iframe, this._MSG_TYPE_SETSIZE + ":" + JSON.stringify({
+ height: height, width: width
+ }))
+ }, _processSetUserEngaged: function(msgStr) {
+ if (msgStr === null || msgStr.indexOf("=") === -1)
+ this._log("invalid setUserEngaged message: " + msgStr);
+ else {
+ var msgArray = msgStr.split("=");
+ if (msgArray[0] === "engaged") {
+ var engagedBefore = this.isEngaged;
+ this._isUserEngaged = (msgArray[1] === "true");
+ if (this._isAutoRefreshEnabled)
+ if (this._isUserEngaged)
+ this._unscheduleRefresh();
+ else
+ this._scheduleRefresh();
+ if (engagedBefore !== this.isEngaged)
+ this._fireEngagedChanged()
+ }
+ else
+ this._log("invalid setUserEngaged message: " + msgStr)
+ }
+ }, _processTiltMessage: function(msgStr) {
+ if (msgStr === null || msgStr.indexOf("=") === -1)
+ this._log("invalid tilt message: " + msgStr);
+ else {
+ var msgArray = msgStr.split("=");
+ if (msgArray[0] === this._MSG_TYPE_LISTENER)
+ if (msgArray[1] === this._MSG_TYPE_VALUESTART)
+ this._startTiltAccelerometer();
+ else if (msgArray[1] === this._MSG_TYPE_VALUESTOP)
+ this._stopTiltAccelerometer();
+ else
+ this._log("invalid tilt message: " + msgStr);
+ else if (msgArray[0] === this._MSG_TYPE_GETTILT && msgArray[1] === this._MSG_TYPE_REFRESH)
+ this._getTilt();
+ else
+ this._log("invalid tilt message: " + msgStr)
+ }
+ }, _processShakeMessage: function(msgStr) {
+ if (msgStr === null || msgStr.indexOf("=") === -1)
+ this._log("invalid shake message: " + msgStr);
+ else {
+ var msgArray = msgStr.split("=");
+ if (msgArray[0] === this._MSG_TYPE_LISTENER)
+ if (msgArray[1] === this._MSG_TYPE_VALUESTART)
+ this._startShakeAccelerometer();
+ else if (msgArray[1] === this._MSG_TYPE_VALUESTOP)
+ this._stopShakeAccelerometer();
+ else
+ this._log("invalid shake message: " + msgStr);
+ else
+ this._log("invalid shake message: " + msgStr)
+ }
+ }, _startTiltAccelerometer: function() {
+ if (this._checkAndCreateAccelerometer())
+ try {
+ if (typeof(this._accelerometer.tiltHandlers[this._ad.guid]) === "undefined" || this._accelerometer.tiltHandlers[this._ad.guid] === null)
+ this._accelerometer.device.addEventListener("readingchanged", this._generateTiltListener())
+ }
+ catch(err) {}
+ }, _generateTiltListener: function() {
+ try {
+ var self = this;
+ var handler = function(eventArgs) {
+ var coords = self._generateCoordsMessage(eventArgs.reading.accelerationX, eventArgs.reading.accelerationY, eventArgs.reading.accelerationZ);
+ self._sendMessageToAllAdContainers(self._MSG_TYPE_UPDATETILTCOORDS + ":{" + coords + "}")
+ };
+ if (this._accelerometer !== null && typeof(this._accelerometer) !== "undefined")
+ this._accelerometer.tiltHandlers[self._ad.guid] = handler;
+ return handler
+ }
+ catch(err) {
+ return
+ }
+ }, _generateCoordsMessage: function(x, y, z) {
+ return '"x":"' + x + '","y":"' + y + '","z":"' + z + '"'
+ }, _stopTiltAccelerometer: function() {
+ try {
+ var handler = this._accelerometer.tiltHandlers[this._ad.guid];
+ if (handler !== null && typeof(handler) !== "undefined") {
+ this._accelerometer.device.removeEventListener("readingchanged", handler);
+ this._accelerometer.tiltHandlers[this._ad.guid] = null
+ }
+ }
+ catch(err) {
+ this._log("could not stop the tilt accelerometer")
+ }
+ }, _startShakeAccelerometer: function() {
+ if (this._checkAndCreateAccelerometer())
+ try {
+ if (typeof(this._accelerometer.shakeHandlers[this._ad.guid]) === "undefined" || this._accelerometer.shakeHandlers[this._ad.guid] === null)
+ this._accelerometer.device.addEventListener("shaken", this._generateShakeListener())
+ }
+ catch(err) {
+ this._log("could not start the shake accelerometer")
+ }
+ }, _generateShakeListener: function() {
+ var self = this;
+ var handler = function(eventArgs) {
+ self._sendMessageToAllAdContainers(self._MSG_TYPE_FIRESHAKE)
+ };
+ if (this._accelerometer !== null && typeof(this._accelerometer) !== "undefined")
+ this._accelerometer.shakeHandlers[self._ad.guid] = handler;
+ return handler
+ }, _stopShakeAccelerometer: function() {
+ try {
+ var handler = this._accelerometer.shakeHandlers[this._ad.guid];
+ if (handler !== null && typeof(handler) !== "undefined") {
+ this._accelerometer.device.removeEventListener("shaken", handler);
+ this._accelerometer.shakeHandlers[this._ad.guid] = null
+ }
+ }
+ catch(err) {
+ this._log("could not stop shake accelerometer")
+ }
+ }, _getTilt: function() {
+ if (this._checkAndCreateAccelerometer())
+ try {
+ var coords = this._lastCoords;
+ var strCoords = this._generateCoordsMessage(coords.x, coords.y, coords.z);
+ this._sendMessageToAllAdContainers(this._MSG_TYPE_UPDATETILTCOORDS + ":{" + strCoords + "}");
+ var reading = this._accelerometer.device.getCurrentReading();
+ this._lastCoords = {
+ x: reading.accelerationX, y: reading.accelerationY, z: reading.accelerationZ
+ }
+ }
+ catch(err) {
+ this._log("error in getTilt")
+ }
+ }, _disposeAccelerometer: function() {
+ if (this._accelerometer === null)
+ return;
+ else if (this._accelerometer.device !== null && typeof(this._accelerometer.device) === "object") {
+ this._stopShakeAccelerometer();
+ this._stopTiltAccelerometer()
+ }
+ }, _checkAndCreateAccelerometer: function() {
+ if (this._accelerometer === null || typeof(this._accelerometer.device) !== "object")
+ this._accelerometer = {};
+ try {
+ if (this._accelerometer.device === null || typeof(this._accelerometer.device) !== "object") {
+ this._accelerometer.device = Windows.Devices.Sensors.Accelerometer.getDefault();
+ this._accelerometer.device.reportInterval = this._sensorOptions.accelerometer.reportIntervalMS
+ }
+ if (this._accelerometer.device === null || typeof(this._accelerometer.device) !== "object") {
+ this._log("could not instantiate the accelerometer object, is the sensor online?");
+ return false
+ }
+ return true
+ }
+ catch(err) {
+ return false
+ }
+ }, _processViewableChangeMessage: function(msgStr) {
+ if (msgStr === null || msgStr.indexOf("=") === -1)
+ this._log("invalid viewable change message: " + msgStr);
+ else {
+ var msgArray = msgStr.split("=");
+ if (msgArray[0] === this._MSG_TYPE_LISTENER)
+ if (msgArray[1] === this._MSG_TYPE_VALUESTART)
+ this._startViewableChangeMonitoring();
+ else if (msgArray[1] === this._MSG_TYPE_VALUESTOP)
+ this._stopViewableChangeMonitoring();
+ else
+ this._log("invalid viewable change message: " + msgStr);
+ else
+ this._log("invalid viewably change message: " + msgStr)
+ }
+ }, _storeAdInstanceState: function(adInstanceState) {
+ this._adInstanceState = adInstanceState;
+ if (this._ormmaState === this._ORMMA_STATE_EXPANDED)
+ this._sendMessageToAdContainer(this._adIFrame, this._MSG_TYPE_SETADINSTANCESTATE + ":" + this._adInstanceState)
+ }, _startViewableChangeMonitoring: function() {
+ if (this._viewableChangedTimer === null) {
+ this._sendMessageToAdContainer(this._adIFrame, this._MSG_TYPE_VIEWABLECHANGE + ":" + JSON.stringify({viewable: this._isOnScreen()}));
+ var self = this;
+ this._viewableChangedTimer = window.setInterval(function() {
+ var onScreen = self._isOnScreen();
+ if (self._isViewable !== onScreen) {
+ self._isViewable = onScreen;
+ self._sendMessageToAdContainer(self._adIFrame, self._MSG_TYPE_VIEWABLECHANGE + ":" + JSON.stringify({viewable: onScreen}))
+ }
+ }, this._viewableCheckPeriodMs)
+ }
+ this._isViewable = this._isOnScreen();
+ this._sendMessageToAdContainer(this._adIFrame, this._MSG_TYPE_VIEWABLECHANGE + ":" + JSON.stringify({viewable: this._isViewable}))
+ }, _stopViewableChangeMonitoring: function() {
+ if (this._viewableChangedTimer !== null && typeof(this._viewableChangedTimer) === "number") {
+ window.clearInterval(this._viewableChangedTimer);
+ this._viewableChangedTimer = null
+ }
+ }, _processGetOrientationMessage: function(msgStr) {
+ if (msgStr === null || msgStr.indexOf("=") === -1)
+ this._updateOrienation();
+ else {
+ var msgArray = msgStr.split("=");
+ if (msgArray[0] === this._MSG_TYPE_LISTENER)
+ if (msgArray[1] === this._MSG_TYPE_VALUESTART)
+ this._startOrientationMonitoring();
+ else if (msgArray[1] === this._MSG_TYPE_VALUESTOP)
+ this._stopOrientationMonitoring();
+ else
+ this._log("invalid orientation message: " + msgStr);
+ else
+ this._log("invalid orientation message: " + msgStr)
+ }
+ }, _updateOrienation: function() {
+ var orientation = -1;
+ try {
+ switch (Windows.Graphics.Display.DisplayProperties.currentOrientation) {
+ case Windows.Graphics.Display.DisplayOrientations.landscape:
+ orientation = 270;
+ break;
+ case Windows.Graphics.Display.DisplayOrientations.landscapeFlipped:
+ orientation = 90;
+ break;
+ case Windows.Graphics.Display.DisplayOrientations.portraitFlipped:
+ orientation = 180;
+ break;
+ case Windows.Graphics.Display.DisplayOrientations.portrait:
+ orientation = 0;
+ break;
+ default:
+ orientation = -1;
+ break
+ }
+ this._sendMessageToAllAdContainers(this._MSG_TYPE_UPDATEORIENTATION + ":" + JSON.stringify({orientation: orientation}))
+ }
+ catch(err) {
+ control._reportError(control._MSG_TYPE_UPDATEORIENTATION, "Unable to communicate with orientation sensor.")
+ }
+ }, _startOrientationMonitoring: function() {
+ try {
+ if (typeof(this._orientationChangedHandler) !== "function") {
+ var self = this;
+ this._orientationChangedHandler = function(evt) {
+ self._updateOrienation()
+ };
+ Windows.Graphics.Display.DisplayProperties.addEventListener("orientationchanged", this._orientationChangedHandler)
+ }
+ }
+ catch(err) {
+ control._reportError(control._MSG_TYPE_UPDATEORIENTATION, "Unable to communicate with orientation sensor.")
+ }
+ }, _stopOrientationMonitoring: function() {
+ try {
+ if (typeof(this._orientationChangedHandler) === "function") {
+ Windows.Graphics.Display.DisplayProperties.removeEventListener("orientationchanged", this._orientationChangedHandler);
+ this._orientationChangedHandler = null
+ }
+ }
+ catch(err) {
+ control._reportError(control._MSG_TYPE_UPDATEORIENTATION, "Unable to communicate with orientation sensor.")
+ }
+ }, _scheduleRefresh: function() {
+ if (this._refreshTimerId === null) {
+ var self = this;
+ this._refreshTimerId = setTimeout(function() {
+ self._refreshTimerId = null;
+ self._refreshInternal()
+ }, this._refreshPeriodSeconds * 1000)
+ }
+ }, _unscheduleRefresh: function() {
+ if (this._refreshTimerId !== null) {
+ clearTimeout(this._refreshTimerId);
+ this._refreshTimerId = null
+ }
+ }, _request: function(data) {
+ if (this._getNetworkState() === this._ORMMA_NETWORK_OFFLINE) {
+ this._fireErrorOccurred("http request error, network offline", this._ERROR_ENUM.NetworkConnectionFailure);
+ return
+ }
+ var self = this;
+ var req = new XMLHttpRequest;
+ if (data.display.toLowerCase() !== this._ORMMA_RESPONSE_IGNORE)
+ req.onreadystatechange = function() {
+ if (this.readyState === XMLHttpRequest.DONE)
+ if (this.status === 200) {
+ var responseJSON = {
+ url: escape(data.url), response: escape(this.responseText)
+ };
+ self._sendMessageToAdContainer(self._adIFrame, "ormmaResponse:" + JSON.stringify(responseJSON))
+ }
+ else
+ self._fireErrorOccurred("error on request to url: " + data.url + ": code " + req.status, self._ERROR_ENUM.NetworkConnectionFailure)
+ };
+ req.open("GET", data.url, true);
+ req.setRequestHeader(this._HTTP_HEADER_CACHE_CONTROL, this._HTTP_HEADER_VALUE_CACHE_CONTROL_NO_CACHE);
+ req.timeout = 10000;
+ try {
+ req.send(null)
+ }
+ catch(e) {
+ this._fireErrorOccurred("http request error: " + e.message, this._ERROR_ENUM.NetworkConnectionFailure)
+ }
+ }, _validateParameters: function() {
+ if (this._applicationId === null || this._applicationId === "" || this._adUnitId === null || this._adUnitId === "") {
+ this._fireErrorOccurred("ad control requires applicationId and adUnitId properties to be set", this._ERROR_ENUM.ClientConfiguration);
+ return false
+ }
+ if (typeof(this.latitude) !== "undefined" && !this._validateNumber("latitude", this.latitude))
+ return false;
+ if (typeof(this.longitude) !== "undefined" && !this._validateNumber("longitude", this.longitude))
+ return false;
+ return true
+ }, _validateNumber: function(fieldName, value) {
+ if (typeof(value) === "number") {
+ if (isNaN(value)) {
+ this._fireErrorOccurred(fieldName + " value is not a valid number (NaN)", this._ERROR_ENUM.ClientConfiguration);
+ return false
+ }
+ }
+ else {
+ this._fireErrorOccurred(fieldName + " value is not a valid type: " + typeof(value), this._ERROR_ENUM.ClientConfiguration);
+ return false
+ }
+ return true
+ }, _getUri: function(data) {
+ if (data !== null && typeof(data) === "object" && typeof(data.url) === "string" && data.url.length <= this._MAX_URL_LENGTH)
+ try {
+ var uri = new Windows.Foundation.Uri(data.url);
+ if (uri.schemeName === "http" || uri.schemeName === "https" || uri.schemeName === "ms-windows-store" || uri.schemeName === "skype" || uri.schemeName === "microsoftmusic" || uri.schemeName === "xboxsmartglass" || uri.schemeName === "xboxgames" || uri.schemeName === "microsoftvideo" || uri.schemeName === "bingtravel" || uri.schemeName === "bingweather" || uri.schemeName === "bingmaps" || uri.schemeName === "bingfinance" || uri.schemeName === "bingsports" || uri.schemeName === "bingnews")
+ return uri
+ }
+ catch(err) {}
+ return null
+ }, _getNetworkState: function() {
+ var wifiThreshold = 1024000;
+ try {
+ var connProfile = this._networkInfo.getInternetConnectionProfile();
+ if (!connProfile || connProfile.getNetworkConnectivityLevel() === Windows.Networking.Connectivity.NetworkConnectivityLevel.none)
+ return this._ORMMA_NETWORK_OFFLINE;
+ else {
+ var interfaceType = connProfile.networkAdapter.ianaInterfaceType;
+ if (interfaceType === 6 || interfaceType === 71)
+ return this._ORMMA_NETWORK_WIFI;
+ else
+ return this._ORMMA_NETWORK_CELL
+ }
+ }
+ catch(err) {
+ if (err !== null && typeof(err) === "object")
+ this._fireErrorOccurred("error getting network state: " + err.message, this._ERROR_ENUM.Other);
+ else
+ this._fireErrorOccurred("error getting network state", this._ERROR_ENUM.Other)
+ }
+ return this._ORMMA_NETWORK_UNKNOWN
+ }
+ })
+ })
+})(WinJS)
diff --git a/packages/microsoft.zunevideo/MSAdvertisingJS/ads/bootstrap.html b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/bootstrap.html
new file mode 100644
index 00000000..8d0fb1e3
--- /dev/null
+++ b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/bootstrap.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/MSAdvertisingJS/ads/bootstrap.js b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/bootstrap.js
new file mode 100644
index 00000000..fa27182c
--- /dev/null
+++ b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/bootstrap.js
@@ -0,0 +1,213 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+"use strict";
+/*!
+ Copyright (C) Microsoft. All rights reserved.
+ This library is supported for use in Windows Store apps only.
+*/
+var localCompartment = null;
+var localCompartmentOrigin = "ms-appx://" + document.location.host;
+var adControlId = null;
+var adParams = null;
+var prmParams = null;
+var pointerDown = false;
+var appParams = null;
+var MSG_TYPE_SCRIPT = "script";
+var MSG_TYPE_ADPARAMS = "adParams";
+var MSG_TYPE_PRMPARAMS = "prmParams";
+var MSG_TYPE_APPPARAMS = "appParams";
+var MSG_TYPE_INIT = "init";
+var MSG_TYPE_SETID = "setId";
+var MSG_TYPE_ERROR = "error";
+var MSG_TYPE_SETMAXSIZE = "setMaxSize";
+var MSG_TYPE_SETSCREENSIZE = "setScreenSize";
+var MSG_TYPE_SETSIZE = "setSize";
+var MSG_TYPE_SETSTATE = "setState";
+var MSG_TYPE_START = "ormmaStart";
+var MSG_TYPE_ORMMA_RESPONSE = "ormmaResponse";
+var MSG_TYPE_FIRESHAKE = "fireShake";
+var MSG_TYPE_UPDATETILTCOORDS = "updateTiltCoords";
+var MSG_TYPE_UPDATEORIENTATION = "updateOrienation";
+var MSG_TYPE_VIEWABLECHANGE = "viewableChange";
+var MSG_TYPE_SETNETWORK = "setNetwork";
+var MSG_TYPE_SETLOCALE = "setLocale";
+var MSG_TYPE_SETSDKINFO = "setSdkInfo";
+var MSG_TYPE_SETCAPABILITY = "setCapability";
+var MSG_TYPE_SETADINSTANCESTATE = "setAdInstanceState";
+var MSG_TYPE_ONPOINTERDOWN = "MSPointerDown";
+var MSG_TYPE_ONPOINTERUP = "MSPointerUp";
+function injectJavaScript(scriptTxt) {
+ try {
+ var scr = document.createElement("script");
+ var headID = document.getElementsByTagName("head")[0];
+ scr.innerHTML = scriptTxt;
+ headID.appendChild(scr)
+ }
+ catch(err) {
+ var message = (err === null || typeof(err) === "undefined") ? "unknown" : err.message;
+ reportAdError("error injecting javascript: " + message)
+ }
+}
+function receiveMessage(msg) {
+ if (typeof(localCompartmentOrigin) === "undefined" || msg.origin !== localCompartmentOrigin)
+ return;
+ if (typeof(MSG_TYPE_SCRIPT) === "undefined" || typeof(JSON) === "undefined")
+ return;
+ if (localCompartment === null)
+ localCompartment = msg.source;
+ var msgType = null;
+ var msgContent = null;
+ var colonIx = msg.data.indexOf(":");
+ if (colonIx < 0)
+ msgType = msg.data;
+ else {
+ msgType = msg.data.substr(0, colonIx);
+ msgContent = msg.data.substr(colonIx + 1)
+ }
+ if (msgType === MSG_TYPE_SCRIPT) {
+ if (msgContent !== "")
+ injectJavaScript(msgContent)
+ }
+ else if (msgType === MSG_TYPE_ADPARAMS) {
+ if (msgContent !== "")
+ try {
+ adParams = JSON.parse(msgContent)
+ }
+ catch(err) {
+ reportAdError("Ad params JSON parse error: " + err.message)
+ }
+ }
+ else if (msgType === MSG_TYPE_PRMPARAMS) {
+ if (msgContent !== "")
+ try {
+ prmParams = JSON.parse(msgContent)
+ }
+ catch(err) {
+ reportAdError("Prm params JSON parse error: " + err.message)
+ }
+ }
+ else if (msgType === MSG_TYPE_APPPARAMS) {
+ if (msgContent !== "")
+ try {
+ appParams = JSON.parse(msgContent)
+ }
+ catch(err) {
+ reportAdError("App params JSON parse error: " + err.message)
+ }
+ }
+ else if (msgType === MSG_TYPE_SETID)
+ adControlId = msgContent;
+ else if (msgType === MSG_TYPE_INIT) {
+ if (Ormma.getState() === "expanded") {
+ document.addEventListener("keyup", function(e) {
+ if (e.keyCode === 27)
+ Ormma.close()
+ });
+ var adBodyEl = document.getElementById("adBody");
+ if (adBodyEl !== null)
+ adBodyEl.focus()
+ }
+ try {
+ window.renderer = new microsoft.advertising.renderer;
+ window.renderer.init({
+ creativeData: adParams, container: msMainAdDiv.id, prm: prmParams, appOptions: appParams
+ })
+ }
+ catch(msg) {
+ reportAdError("unable to initialize renderer: " + msg);
+ return
+ }
+ try {
+ window.renderer.renderAd();
+ postToLocal("rendered")
+ }
+ catch(msg) {
+ reportAdError("unable to render ad: " + msg)
+ }
+ }
+ else if (msgType === MSG_TYPE_SETADINSTANCESTATE)
+ Ormma._setAdInstanceState(msgContent);
+ else if (typeof(Ormma) !== "undefined" && Ormma !== null)
+ if (msgType === MSG_TYPE_SETSIZE) {
+ var size = JSON.parse(msgContent);
+ Ormma._setSize(size.width, size.height)
+ }
+ else if (msgType === MSG_TYPE_SETMAXSIZE) {
+ var maxSize = JSON.parse(msgContent);
+ Ormma._maxSize = maxSize
+ }
+ else if (msgType === MSG_TYPE_SETSCREENSIZE) {
+ var screenSize = JSON.parse(msgContent);
+ Ormma._setScreenSize(screenSize.width, screenSize.height)
+ }
+ else if (msgType === MSG_TYPE_SETSTATE)
+ Ormma._setState(msgContent);
+ else if (msgType === MSG_TYPE_SETLOCALE)
+ Ormma._setLocale(msgContent);
+ else if (msgType === MSG_TYPE_SETSDKINFO) {
+ var sdkInfo = JSON.parse(msgContent);
+ Ormma._setSdkVersion(sdkInfo.sdkVersion, sdkInfo.client, sdkInfo.runtimeType)
+ }
+ else if (msgType === MSG_TYPE_SETCAPABILITY) {
+ var capabilityInfo = JSON.parse(msgContent);
+ Ormma._setCapability(capabilityInfo.capability, capabilityInfo.value)
+ }
+ else if (msgType === MSG_TYPE_START)
+ Ormma._init(msgContent);
+ else if (msgType === MSG_TYPE_FIRESHAKE)
+ Ormma._shake();
+ else if (msgType === MSG_TYPE_ORMMA_RESPONSE)
+ Ormma._sendResponse(JSON.parse(msgContent));
+ else if (msgType === MSG_TYPE_UPDATETILTCOORDS) {
+ var coords = JSON.parse(msgContent);
+ Ormma._tiltChange(coords)
+ }
+ else if (msgType === MSG_TYPE_VIEWABLECHANGE) {
+ var viewable = JSON.parse(msgContent);
+ Ormma._viewableChange(viewable.viewable)
+ }
+ else if (msgType === MSG_TYPE_UPDATEORIENTATION) {
+ var orienation = JSON.parse(msgContent);
+ Ormma._setOrientation(orienation.orientation)
+ }
+ else if (msgType === MSG_TYPE_SETNETWORK)
+ Ormma._setNetwork(msgContent);
+ else if (msgType === MSG_TYPE_ERROR) {
+ var errorInfo = JSON.parse(msgContent);
+ Ormma._throwError(errorInfo.action, errorInfo.message)
+ }
+}
+function reportAdError(msg) {
+ postToLocal(MSG_TYPE_ERROR + ":" + msg)
+}
+function postToLocal(msg) {
+ if (localCompartment !== null)
+ localCompartment.postMessage(adControlId + ":" + msg, localCompartmentOrigin)
+}
+window.addEventListener("message", receiveMessage);
+var bubblePointerEvents = (location.search.match(/bubblePointerEvents=1/ig) !== null);
+if (bubblePointerEvents) {
+ document.body.addEventListener("MSPointerDown", function(evt) {
+ pointerDown = true;
+ postToLocal(MSG_TYPE_ONPOINTERDOWN + ":" + JSON.stringify({
+ clientX: evt.clientX, clientY: evt.clientY
+ }))
+ }, false);
+ document.body.addEventListener("MSPointerUp", function(evt) {
+ pointerDown = false;
+ postToLocal(MSG_TYPE_ONPOINTERUP)
+ }, false);
+ document.body.addEventListener("MSPointerCancel", function(evt) {
+ pointerDown = false;
+ postToLocal(MSG_TYPE_ONPOINTERUP)
+ }, false);
+ document.body.addEventListener("MSPointerOut", function(evt) {
+ if (pointerDown) {
+ pointerDown = false;
+ postToLocal(MSG_TYPE_ONPOINTERUP)
+ }
+ }, false);
+ document.body.addEventListener("MSLostPointerCapture", function(evt) {
+ pointerDown = false;
+ postToLocal(MSG_TYPE_ONPOINTERUP)
+ }, false)
+}
diff --git a/packages/microsoft.zunevideo/MSAdvertisingJS/ads/ormma.js b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/ormma.js
new file mode 100644
index 00000000..49d37243
--- /dev/null
+++ b/packages/microsoft.zunevideo/MSAdvertisingJS/ads/ormma.js
@@ -0,0 +1,602 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+"use strict";
+/*!
+ Copyright (C) Microsoft. All rights reserved.
+ This library is supported for use in Windows Store apps only.
+*/
+var ORMMA_STATE_UNKNOWN = "unknown";
+var ORMMA_STATE_HIDDEN = "hidden";
+var ORMMA_STATE_DEFAULT = "default";
+var ORMMA_STATE_EXPANDED = "expanded";
+var ORMMA_STATE_RESIZED = "resized";
+var ORMMA_STATE_SUSPENDED = "suspended";
+var ORMMA_EVENT_ERROR = "error";
+var ORMMA_EVENT_HEADING_CHANGE = "headingChange";
+var ORMMA_EVENT_KEYBOARD_CHANGE = "keyboardChange";
+var ORMMA_EVENT_LOCATION_CHANGE = "locationChange";
+var ORMMA_EVENT_NETWORK_CHANGE = "networkChange";
+var ORMMA_EVENT_ORIENTATION_CHANGE = "orientationChange";
+var ORMMA_EVENT_VIEWABLE_CHANGE = "viewableChange";
+var ORMMA_EVENT_READY = "ready";
+var ORMMA_EVENT_RESPONSE = "response";
+var ORMMA_EVENT_SCREEN_CHANGE = "screenChange";
+var ORMMA_EVENT_SHAKE = "shake";
+var ORMMA_EVENT_SIZE_CHANGE = "sizeChange";
+var ORMMA_EVENT_STATE_CHANGE = "stateChange";
+var ORMMA_EVENT_TILT_CHANGE = "tiltChange";
+var ORMMA_FEATURE_SCREEN = "screen";
+var ORMMA_FEATURE_ORIENTATION = "orientation";
+var ORMMA_FEATURE_LOCATION = "location";
+var ORMMA_FEATURE_SMS = "sms";
+var ORMMA_FEATURE_PHONE = "phone";
+var ORMMA_FEATURE_EMAIL = "email";
+var ORMMA_FEATURE_HEADING = "heading";
+var ORMMA_FEATURE_SHAKE = "shake";
+var ORMMA_FEATURE_TILT = "tilt";
+var ORMMA_FEATURE_NETWORK = "network";
+var ORMMA_FEATURE_CALENDAR = "calendar";
+var ORMMA_FEATURE_CAMERA = "camera";
+var ORMMA_FEATURE_MAP = "map";
+var ORMMA_FEATURE_AUDIO = "audio";
+var ORMMA_FEATURE_VIDEO = "video";
+var ORMMA_FEATURE_LEVEL1 = "level-1";
+var ORMMA_FEATURE_LEVEL2 = "level-2";
+var ORMMA_FEATURE_LEVEL3 = "level-3";
+var ORMMA_API_VERSION = "1.1.0";
+var MRAID_API_VERSION = "1.0";
+var MAPLE_MAX_STATE_DATA_SIZE = 65536;
+function setScreenSize(width, height) {
+ var convertWidth = parseInt(width);
+ convertWidth = convertWidth === NaN ? -1 : convertWidth;
+ var convertHeight = parseInt(height);
+ convertHeight = convertHeight === NaN ? -1 : convertHeight;
+ Ormma._setScreenSize(convertWidth, convertHeight)
+}
+function invokeInit() {
+ Ormma._init()
+}
+function reportError(action, msg) {
+ Ormma._throwError(action, msg)
+}
+function setOrmmaState(state) {
+ Ormma._setState(state)
+}
+function setOrmmaLocale(locale) {
+ Ormma._setLocale(locale)
+}
+function setSize(width, height) {
+ var convertWidth = parseInt(width);
+ convertWidth = convertWidth === NaN ? -1 : convertWidth;
+ var convertHeight = parseInt(height);
+ convertHeight = convertHeight === NaN ? -1 : convertHeight;
+ Ormma._setSize(convertWidth, convertHeight)
+}
+function setMaxSize(width, height) {
+ var convertWidth = parseInt(width);
+ convertWidth = convertWidth === NaN ? -1 : convertWidth;
+ var convertHeight = parseInt(height);
+ convertHeight = convertHeight === NaN ? -1 : convertHeight;
+ Ormma._setMaxSize(convertWidth, convertHeight)
+}
+function setOrientation(orientation) {
+ var convertOrientation = parseInt(orientation);
+ convertOrientation = convertOrientation === NaN ? -1 : convertOrientation;
+ Ormma._setOrientation(convertOrientation)
+}
+function fireShake() {
+ Ormma._shake()
+}
+function updateTiltCoords(x, y, z) {
+ Ormma._tiltChange({
+ x: x, y: y, z: z
+ })
+}
+function fireViewable(isViewable) {
+ var isViewableBool = stringToBoolean(isViewable);
+ Ormma._viewableChange(isViewableBool)
+}
+function setCapability(capability, value) {
+ Ormma._setCapability(capability, stringToBoolean(value))
+}
+function stringToBoolean(value) {
+ if (value.toLowerCase() === "true")
+ return true;
+ return false
+}
+function fireResponse(url, response) {
+ var data = {
+ url: escape(url), response: escape(response)
+ };
+ Ormma._sendResponse(data)
+}
+function setNetwork(networkType) {
+ Ormma._setNetwork(networkType)
+}
+function setSdkVersion(sdkVersion, client, runtimeType) {
+ Ormma._setSdkVersion(sdkVersion, client, runtimeType)
+}
+function setAdInstanceState(adInstanceState) {
+ Ormma._setAdInstanceState(adInstanceState)
+}
+(function() {
+ function AdClientData() {
+ this.listeners = []
+ }
+ var _adClient = new AdClientData;
+ window.ORMMA = window.ormma = window.Ormma = window.MAPLE = window.maple = window.Maple = {
+ _maxSize: {}, _dimensions: {}, _defaultDimensions: {}, _screenSize: null, _tiltCapability: false, _shakeCapability: false, _expandProperties: {
+ width: 480, height: 800, useCustomClose: false, lockOrientation: false, isModal: true
+ }, _shakeProperties: {}, _resizeProperties: {transition: "none"}, _state: ORMMA_STATE_DEFAULT, _locale: null, _location: null, _orientation: -1, _lastTiltCoords: {
+ x: 0, y: 0, z: 0
+ }, _lastNetworkState: ORMMA_STATE_UNKNOWN, _sdkInfo: null, _adInstanceState: null, storeAdInstanceState: function(adInstanceState) {
+ if (typeof(adInstanceState) === "string")
+ if (adInstanceState.length <= MAPLE_MAX_STATE_DATA_SIZE) {
+ this._adInstanceState = adInstanceState;
+ _notify("storeadinstancestate:" + this._adInstanceState)
+ }
+ else
+ this._throwError("storeAdInstanceState", "attempting to store state data greater than allowed length of " + MAPLE_MAX_STATE_DATA_SIZE + ", attempted store length " + adInstanceState.length);
+ else
+ this._throwError("storeAdInstanceState", "attempting to store state data that is not a string")
+ }, getAdInstanceState: function() {
+ if (this._adInstanceState !== null)
+ return this._adInstanceState
+ }, addEventListener: function(evt, callback) {
+ if (_adClient.listeners[evt] === null || typeof(_adClient.listeners[evt]) === "undefined")
+ _adClient.listeners[evt] = [];
+ if (evt === ORMMA_EVENT_TILT_CHANGE && !this._tiltCapability) {
+ this._throwError("tilt", "tilt capability is not supported, event listener not added");
+ return
+ }
+ else if (evt === ORMMA_EVENT_SHAKE && !this._shakeCapability) {
+ this._throwError("shake", "shake capability is not supported, event listener not added");
+ return
+ }
+ _logme("adding listener for " + evt);
+ _adClient.listeners[evt].push(callback);
+ if (evt === ORMMA_EVENT_TILT_CHANGE)
+ _notify("tilt:listener=start");
+ else if (evt === ORMMA_EVENT_SHAKE)
+ _notify("shake:listener=start");
+ else if (evt === ORMMA_EVENT_ORIENTATION_CHANGE)
+ _notify("getorientation:listener=start");
+ else if (evt === ORMMA_EVENT_VIEWABLE_CHANGE)
+ _notify("viewableChange:listener=start")
+ }, close: function() {
+ _logme("sending close request");
+ _notify("close")
+ }, createEvent: function(date, title, body) {
+ _logme("[not impl] createEvent called: " + date + ", " + title + ", " + body)
+ }, expand: function(url) {
+ if (!(this.getState() === ORMMA_STATE_DEFAULT || this.getState() === ORMMA_STATE_RESIZED)) {
+ reportError("expand", "can only expand from resized or default states");
+ return
+ }
+ if (typeof(url) === "undefined" || url === null)
+ url = "";
+ if (typeof(this._expandProperties) === "object")
+ if (_isEmbeddedBrowser());
+ else {
+ var propStr = JSON.stringify(this._expandProperties);
+ _notify("setexpandproperties:" + propStr)
+ }
+ _logme("sending expand request");
+ if (_isEmbeddedBrowser())
+ _notify("expand:url=" + encodeURIComponent(url));
+ else {
+ var msg = {url: url};
+ _notify("expand:" + JSON.stringify(msg))
+ }
+ }, getDefaultPosition: function() {
+ return this._defaultDimensions
+ }, getExpandProperties: function() {
+ return this._expandProperties
+ }, getHeading: function() {
+ _logme("[not impl] getHeading called");
+ return -1
+ }, getKeyboard: function() {
+ _logme("[not impl] getKeyboard called");
+ return false
+ }, getLocation: function() {
+ _logme("[not impl] getKeyboard called");
+ return this._location
+ }, getMaxSize: function() {
+ return this._maxSize
+ }, getNetwork: function() {
+ return this._lastNetworkState
+ }, getOrientation: function() {
+ _notify("getorientation");
+ return this._orientation
+ }, getPlacementType: function(none) {
+ _logme("[not impl] getPlacementType called");
+ return "unknown"
+ }, getScreenSize: function() {
+ if (this._screenSize === null)
+ this._screenSize = {
+ width: screen.availWidth, height: screen.availHeight - 100
+ };
+ return this._screenSize
+ }, getShakeProperties: function() {
+ return this._shakeProperties
+ }, getSize: function() {
+ if (typeof(this._dimensions) === "undefined")
+ this._dimensions = {};
+ return this._dimensions
+ }, getState: function() {
+ return this._state
+ }, getLocale: function() {
+ if (this._locale !== null)
+ return this._locale
+ }, getTilt: function() {
+ _logme("calling getTilt");
+ if (!this._tiltCapability) {
+ this._throwError("tilt", "tilt capability is not supported");
+ return
+ }
+ _notify("tilt:gettilt=refresh");
+ return this._lastTiltCoords
+ }, getViewable: function() {
+ _logme("[not impl] getViewable called")
+ }, hide: function() {
+ _logme("calling hide");
+ _notify("hide")
+ }, isViewable: function() {
+ _logme("[not impl] isViewable called")
+ }, makeCall: function(number) {
+ _logme("sending call request: " + number);
+ _notify("call:recipient=" + number)
+ }, open: function(url, controls) {
+ _logme("sending website request: " + url);
+ var msg;
+ if (_isEmbeddedBrowser())
+ msg = "url=" + encodeURIComponent(url);
+ else
+ msg = JSON.stringify({url: url});
+ _notify("web:" + msg)
+ }, openMap: function(poi, fullscreen) {
+ _logme("[not impl] openMap called: " + poi)
+ }, removeEventListener: function(evt, listener) {
+ _logme("removing listener for " + evt);
+ if (_adClient.listeners[evt] !== null && typeof(_adClient.listeners[evt]) !== "undefined") {
+ var callbacks = _adClient.listeners[evt];
+ for (var ix = 0; ix < callbacks.length; ix++)
+ if (callbacks[ix] === listener) {
+ var xxx = callbacks.splice(ix, 1);
+ break
+ }
+ if (_adClient.listeners[evt] === null || typeof(_adClient.listeners[evt]) === "undefined" || _adClient.listeners[evt].length === 0)
+ if (evt === ORMMA_EVENT_TILT_CHANGE) {
+ if (!this._tiltCapability) {
+ this._throwError("tilt", "tilt capability is not supported, no event listener");
+ return
+ }
+ _logme("stopping tilt device for event: " + evt + " (no more client listeners)");
+ _notify("tilt:listener=stop")
+ }
+ else if (evt === ORMMA_EVENT_SHAKE) {
+ if (!this._shakeCapability) {
+ this._throwError("shake", "shake capability is not supported, no event listener");
+ return
+ }
+ _logme("stopping shake device for event: " + evt + " (no more client listeners)");
+ _notify("shake:listener=stop")
+ }
+ else if (evt === ORMMA_EVENT_ORIENTATION_CHANGE) {
+ _logme("stopping orientation changed event: " + evt + " (no more client listeners)");
+ _notify("getorientation:listener=stop")
+ }
+ else if (evt === ORMMA_EVENT_VIEWABLE_CHANGE) {
+ _logme("stopping viewable changed event: " + evt + " (no more client listeners)");
+ _notify("viewableChange:listener=stop")
+ }
+ }
+ }, request: function(url, display) {
+ var requestParams = {
+ url: url, display: (typeof(display) !== "undefined" && display !== null ? display : "ignore")
+ };
+ _notify("request:" + JSON.stringify(requestParams));
+ return false
+ }, resize: function(width, height) {
+ if (width > this._maxSize.width || width < 0) {
+ this._throwError("resize", "width is greater than max allowed width (" + this._maxSize.width + ") or less than zero.");
+ return
+ }
+ if (height > this._maxSize.height || width < 0) {
+ this._throwError("resize", "height is greater than max allowed height (" + this._maxSize.height + ") or less than zero.");
+ return
+ }
+ _logme("calling resize:width=" + width + "&height=" + height);
+ if (_isEmbeddedBrowser())
+ _notify("resize:width=" + width + "&height=" + height);
+ else {
+ var msg = {
+ width: width, height: height
+ };
+ _notify("resize:" + JSON.stringify(msg))
+ }
+ }, sendMail: function(recipient, subject, body) {
+ _logme("sending mail request: " + recipient);
+ _notify("mail:recipient=" + recipient + "&subject=" + subject + "&body=" + body)
+ }, sendSMS: function(recipient, body) {
+ _logme("sending sms request: " + recipient);
+ _notify("sms:recipient=" + recipient + "&body=" + body)
+ }, setExpandProperties: function(properties) {
+ this._expandProperties = typeof(properties) !== "object" ? {} : properties;
+ var screenSize = (typeof(this.getScreenSize) === "function" ? this.getScreenSize() : window.ormma.getScreenSize());
+ this._expandProperties.width = _isValidExpandPropertiesDimension(this._expandProperties.width) ? this._expandProperties.width : screenSize.width;
+ this._expandProperties.height = _isValidExpandPropertiesDimension(this._expandProperties.height) ? this._expandProperties.height : screenSize.height;
+ this._expandProperties.useCustomClose = typeof(this._expandProperties.useCustomClose) === "undefined" ? false : this._expandProperties.useCustomClose;
+ this._expandProperties.lockOrientation = typeof(this._expandProperties.lockOrientation) === "undefined" ? false : this._expandProperties.lockOrientation;
+ this._expandProperties.isModal = true;
+ if (_isEmbeddedBrowser()) {
+ _logme("setting expand properties: width=" + this._expandProperties.width + "&height=" + this._expandProperties.height + "&usecustomclose=" + this._expandProperties.useCustomClose + "&lockorientation=" + this._expandProperties.lockOrientation);
+ _notify("setexpandproperties:width=" + this._expandProperties.width + "&height=" + this._expandProperties.height + "&usecustomclose=" + this._expandProperties.useCustomClose + "&lockorientation=" + this._expandProperties.lockOrientation)
+ }
+ else {
+ var propStr = JSON.stringify(this._expandProperties);
+ _logme("setting expand properties: " + propStr);
+ _notify("setexpandproperties:" + propStr)
+ }
+ }, setResizeProperties: function(properties) {
+ this._resizeProperties = typeof(properties) !== "object" ? {} : properties;
+ _logme("setting resize properties: " + JSON.stringify(this._resizeProperties))
+ }, setShakeProperties: function(properties) {
+ this._shakeProperties = typeof(properties) !== "object" ? {} : properties;
+ _logme("setting shake properties: " + JSON.stringify(this._shakeProperties))
+ }, setUserEngaged: function(isEngaged) {
+ this._isUserEngaged = typeof(isEngaged) === "boolean" ? isEngaged : false;
+ _logme("setting user engaged: " + this._isUserEngaged);
+ _notify("setuserengaged:engaged=" + this._isUserEngaged)
+ }, show: function() {
+ _logme("calling show");
+ _notify("show")
+ }, storePicture: function(url) {
+ _logme("sending storePicture request: " + url);
+ _notify("storePicture:url=" + encodeURIComponent(url))
+ }, supports: function(feature) {
+ switch (feature) {
+ case ORMMA_FEATURE_SCREEN:
+ case ORMMA_FEATURE_ORIENTATION:
+ case ORMMA_FEATURE_LEVEL1:
+ case ORMMA_FEATURE_LEVEL2:
+ case ORMMA_FEATURE_NETWORK:
+ return true;
+ case ORMMA_FEATURE_SHAKE:
+ return this._shakeCapability;
+ case ORMMA_FEATURE_TILT:
+ return this._tiltCapability;
+ case ORMMA_FEATURE_PHONE:
+ case ORMMA_FEATURE_SMS:
+ case ORMMA_FEATURE_EMAIL:
+ case ORMMA_FEATURE_LOCATION:
+ case ORMMA_FEATURE_HEADING:
+ case ORMMA_FEATURE_CALENDAR:
+ case ORMMA_FEATURE_AUDIO:
+ case ORMMA_FEATURE_VIDEO:
+ case ORMMA_FEATURE_LEVEL3:
+ default:
+ return false
+ }
+ }, useCustomClose: function(flag) {
+ if (typeof(flag) === "boolean") {
+ _logme("calling usecustomclose:" + flag);
+ _notify("usecustomclose:" + flag)
+ }
+ else
+ reportError("useCustomClose", "parameter 'flag' is not a boolean value")
+ }, playVideo: function(url){}, playAudio: function(url){}, addPhoneContact: function(phone) {
+ _logme("adding phone contact : " + phone);
+ _notify("addphonecontact:phonenumber=" + phone)
+ }, addEmailContact: function(email) {
+ _logme("adding email contact : " + email);
+ _notify("addemailcontact:email=" + email)
+ }, fanOnFacebook: function(url) {
+ _logme("sending fanOnFacebook request: " + url);
+ this.open(url)
+ }, fanOnTwitter: function(url) {
+ _logme("sending fanOnTwitter request: " + url);
+ this.open(url)
+ }, openMarketplace: function(applicationId) {
+ _logme("opening marketplace appId: " + applicationId);
+ _notify("marketplace:appid=" + applicationId)
+ }, getVersion: function() {
+ return ORMMA_API_VERSION
+ }, getSdkVersion: function() {
+ if (this._sdkInfo !== null)
+ return this._sdkInfo
+ }, _tiltChange: function(data) {
+ this._lastTiltCoords = data;
+ _fireEvent(ORMMA_EVENT_TILT_CHANGE, data)
+ }, _shake: function() {
+ _fireEvent(ORMMA_EVENT_SHAKE)
+ }, _viewableChange: function(data) {
+ _fireEvent(ORMMA_EVENT_VIEWABLE_CHANGE, data)
+ }, _orientationChange: function(change){}, _networkChange: function(change){}, _headingChange: function(heading){}, _locationChanged: function(lat, lon, accuracy){}, _sendResponse: function(data) {
+ _fireEvent(ORMMA_EVENT_RESPONSE, data)
+ }, _throwError: function(action, message) {
+ var data = {
+ message: message, action: action
+ };
+ _fireEvent(ORMMA_EVENT_ERROR, data)
+ }, _init: function() {
+ _logme("Ormma is ready");
+ _fireEvent(ORMMA_EVENT_READY, null);
+ if (typeof(window.ORMMAReady) === "function") {
+ _logme("Ormma calling ORMMAReady()");
+ window.ORMMAReady()
+ }
+ }, _setOrientation: function(orientation) {
+ var oldOrientation = this._orientation;
+ this._orientation = orientation;
+ if (oldOrientation !== this._orientation)
+ _fireEvent(ORMMA_EVENT_ORIENTATION_CHANGE, this._orientation)
+ }, _setState: function(state) {
+ var oldState = this._state;
+ this._state = state;
+ if (oldState !== state)
+ _fireEvent(ORMMA_EVENT_STATE_CHANGE, this._state)
+ }, _setLocale: function(locale) {
+ this._locale = locale
+ }, _setSize: function(width, height) {
+ if (typeof(this._dimensions) === "undefined")
+ this._dimensions = {};
+ var currWidth = typeof(this._dimensions.width) === "undefined" ? 0 : this._dimensions.width;
+ var currHeight = typeof(this._dimensions.height) === "undefined" ? 0 : this._dimensions.height;
+ this._dimensions.width = width;
+ this._dimensions.height = height;
+ if (currWidth !== width || currHeight !== height)
+ _fireEvent(ORMMA_EVENT_SIZE_CHANGE, this._dimensions)
+ }, _setSdkVersion: function(sdkVersion, client, runtimeType) {
+ this._sdkInfo = {
+ sdkVersion: sdkVersion, client: client, runtimeType: runtimeType, appName: navigator.appName, appVersion: navigator.appVersion, userAgent: navigator.userAgent, platform: navigator.platform
+ }
+ }, _setCapability: function(capability, value) {
+ if (typeof(value) !== "boolean")
+ return;
+ if (capability === ORMMA_FEATURE_TILT)
+ this._tiltCapability = value;
+ else if (capability === ORMMA_FEATURE_SHAKE)
+ this._shakeCapability = value
+ }, _setMaxSize: function(width, height) {
+ if (typeof(this._maxSize) === "undefined")
+ this._maxSize = {};
+ this._maxSize.width = width;
+ this._maxSize.height = height
+ }, _setScreenSize: function(width, height) {
+ if (this._screenSize === null || typeof(this._screenSize) === "undefined")
+ this._screenSize = {};
+ var currWidth = typeof(this._screenSize.width) === "undefined" ? 0 : this._screenSize.width;
+ var currHeight = typeof(this._screenSize.height) === "undefined" ? 0 : this._screenSize.height;
+ this._screenSize.width = width;
+ this._screenSize.height = height;
+ if (currWidth !== this._screenSize.width || currHeight !== this._screenSize.height)
+ _fireEvent(ORMMA_EVENT_SCREEN_CHANGE, this._screenSize)
+ }, _setNetwork: function(networkState) {
+ _logme("setting network state: " + networkState);
+ if (typeof(this._lastNetworkState) === "undefined")
+ this._lastNetworkState = "";
+ if (networkState !== this._lastNetworkState) {
+ this._lastNetworkState = networkState;
+ _fireEvent(ORMMA_EVENT_NETWORK_CHANGE, {
+ online: (networkState !== "offline"), connection: networkState
+ })
+ }
+ }, _setAdInstanceState: function(adInstanceState) {
+ this._adInstanceState = adInstanceState
+ }
+ };
+ function _logme(msg) {
+ if (_isEmbeddedBrowser())
+ window.external.notify("$log - " + msg);
+ else {
+ var debg = document.getElementById("debg");
+ if (debg !== null)
+ if (debg.innerHTML === null)
+ debg.innerHTML = msg;
+ else {
+ var oldval = debg.innerHTML;
+ debg.innerHTML = msg + "
" + oldval
+ }
+ }
+ }
+ function _isValidExpandPropertiesDimension(val) {
+ if (typeof(val) === "undefined" || val === null || val <= 0)
+ return false;
+ else
+ return true
+ }
+ function _isEmbeddedBrowser() {
+ return (typeof(window.external) === "object" && typeof(window.external.notify) !== "undefined")
+ }
+ function _notify(msg) {
+ if (_isEmbeddedBrowser())
+ window.external.notify(msg);
+ else
+ postToLocal(msg)
+ }
+ function _fireEvent(eventType, data) {
+ _logme("raising event " + eventType + " with data " + data);
+ if (_adClient.listeners[eventType] !== null && typeof(_adClient.listeners[eventType]) !== "undefined")
+ try {
+ var callbacks = _adClient.listeners[eventType].slice();
+ var ix;
+ switch (eventType) {
+ case ORMMA_EVENT_ERROR:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data.message, data.action);
+ break;
+ case ORMMA_EVENT_NETWORK_CHANGE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data.online, data.connection);
+ break;
+ case ORMMA_EVENT_ORIENTATION_CHANGE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data);
+ break;
+ case ORMMA_EVENT_READY:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix]();
+ break;
+ case ORMMA_EVENT_SCREEN_CHANGE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data.width, data.height);
+ break;
+ case ORMMA_EVENT_SHAKE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix]();
+ break;
+ case ORMMA_EVENT_SIZE_CHANGE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data.width, data.height);
+ break;
+ case ORMMA_EVENT_STATE_CHANGE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data);
+ break;
+ case ORMMA_EVENT_TILT_CHANGE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data.x, data.y, data.z);
+ break;
+ case ORMMA_EVENT_VIEWABLE_CHANGE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](data);
+ break;
+ case ORMMA_EVENT_RESPONSE:
+ for (ix = 0; ix < callbacks.length; ix++)
+ callbacks[ix](unescape(data.url), unescape(data.response));
+ break;
+ case ORMMA_EVENT_HEADING_CHANGE:
+ case ORMMA_EVENT_KEYBOARD_CHANGE:
+ case ORMMA_EVENT_LOCATION_CHANGE:
+ default:
+ return false
+ }
+ }
+ catch(err) {
+ _logme("exception thrown while firing event: " + err.message)
+ }
+ else
+ _logme("no listeners for event " + eventType)
+ }
+ window.mraid = window.MRAID = {
+ addEventListener: function(evt, callback) {
+ if (this._mraidSupportedEvts === null)
+ this._mraidSupportedEvts = this._initEventList();
+ if (this._mraidSupportedEvts[evt])
+ window.ormma.addEventListener(evt, callback)
+ }, close: window.ormma.close, expand: window.ormma.expand, getExpandProperties: window.ormma.getExpandProperties, getPlacementType: window.ormma.getPlacementType, getState: function() {
+ return window.ormma._state
+ }, getVersion: function() {
+ return MRAID_API_VERSION
+ }, isViewable: window.ormma.isViewable, open: window.ormma.open, removeEventListener: function(evt, callback) {
+ if (this._mraidSupportedEvts === null)
+ this._mraidSupportedEvts = this._initEventList();
+ if (this._mraidSupportedEvts[evt])
+ window.ormma.removeEventListener(evt, callback)
+ }, setExpandProperties: window.ormma.setExpandProperties, useCustomClose: window.ormma.useCustomClose, _mraidSupportedEvts: null, _initEventList: function() {
+ var evtArray = [];
+ evtArray[ORMMA_EVENT_ERROR] = evtArray[ORMMA_EVENT_READY] = evtArray[ORMMA_EVENT_STATE_CHANGE] = evtArray[ORMMA_EVENT_VIEWABLE_CHANGE] = true;
+ return evtArray
+ }
+ }
+})()
diff --git a/packages/microsoft.zunevideo/MovieDetails_merged.js b/packages/microsoft.zunevideo/MovieDetails_merged.js
new file mode 100644
index 00000000..080e8c85
--- /dev/null
+++ b/packages/microsoft.zunevideo/MovieDetails_merged.js
@@ -0,0 +1,5484 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/controls/video/videodownloadmanager.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {DownloadManagerGroupActions: {
+ PauseAll: "PauseAll", ResumeAll: "ResumeAll", CancelAll: "CancelAll"
+ }});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ VideoDownloadManagerDialog: MS.Entertainment.UI.Framework.defineUserControl("/Controls/Video/VideoDownloadManager.html#videoDownloadManagerDialogTemplate", function VideoDownloadManagerDialog() {
+ this.templateSelectorConstructor = MS.Entertainment.UI.Controls.VideoDownloadTemplateSelector
+ }, {
+ _hasPopulatedList: false, _updatingGalleryItems: false, _overlay: null, _refreshTimer: null, _refreshInterval: 3, setOverlay: function setOverlay(instance) {
+ this._overlay = instance;
+ var that = this;
+ this._overlay.buttons = [WinJS.Binding.as({
+ title: String.load(String.id.IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE_ALL), isEnabled: true, isAvailable: false, execute: function onPauseAll() {
+ that._onPauseAll()
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_VIDEO_DOWNLOAD_MANAGER_RESUME_All), isEnabled: true, isAvailable: false, execute: function onResumeAll() {
+ that._onResumeAll()
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL_ALL), isEnabled: true, isAvailable: false, execute: function onCancelAll() {
+ that._onCancelAll()
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_VIDEO_DOWNLOAD_MANAGER_CLOSE), isEnabled: true, execute: function onClose() {
+ that._onClose()
+ }
+ })];
+ this._overlay.defaultButtonIndex = 2;
+ this._overlay.cancelButtonIndex = 2;
+ this._setInitialState()
+ }, _setInitialState: function _setInitialState() {
+ this._enablePauseAllButton(false);
+ this._enableResumeAllButton(false);
+ this._enableCancelAllButton(false);
+ this._queryDatabaseItems()
+ }, _applyGroupAction: function applyGroupAction(groupActionType) {
+ return this.getMarketplaceNativeFileDownloadsAsync().then(function getMarketplaceNativeFileDownloadsAsync_complete(nativeItems) {
+ if (!nativeItems)
+ return;
+ for (var i = 0; i < nativeItems.length; i++) {
+ var nativeItem = nativeItems[i];
+ if (nativeItem.libraryTypeId !== Microsoft.Entertainment.Queries.ObjectType.video)
+ continue;
+ if (nativeItem.taskStatus !== Microsoft.Entertainment.FileTransferStatus.completed && nativeItem.taskStatus !== Microsoft.Entertainment.FileTransferStatus.canceled && !nativeItem.isClosed)
+ switch (groupActionType) {
+ case MS.Entertainment.UI.Controls.DownloadManagerGroupActions.PauseAll:
+ nativeItem.pause();
+ break;
+ case MS.Entertainment.UI.Controls.DownloadManagerGroupActions.CancelAll:
+ nativeItem.cancel();
+ break;
+ case MS.Entertainment.UI.Controls.DownloadManagerGroupActions.ResumeAll:
+ nativeItem.resume();
+ break
+ }
+ }
+ }.bind(this))
+ }, _queryDatabaseItems: function queryDatabaseItems() {
+ return this.getMarketplaceNativeFileDownloadsAsync().then(function getMarketplaceNativeFileDownloadsAsync_complete(nativeDownloadTasks) {
+ var downloadTasks = [];
+ var videoLibraryIds = [];
+ if (!nativeDownloadTasks)
+ return;
+ for (var i = 0; i < nativeDownloadTasks.length; i++) {
+ var downloadTask = nativeDownloadTasks[i];
+ if (downloadTask.libraryTypeId !== Microsoft.Entertainment.Queries.ObjectType.video)
+ continue;
+ if (downloadTask.taskStatus !== Microsoft.Entertainment.FileTransferStatus.completed && downloadTask.taskStatus !== Microsoft.Entertainment.FileTransferStatus.canceled && !downloadTask.isClosed) {
+ downloadTasks.push(downloadTask);
+ videoLibraryIds.push(downloadTask.libraryId)
+ }
+ }
+ return this._getVideoDetails(videoLibraryIds).then(function getVideoDetailsComplete(dbItems) {
+ if (!dbItems)
+ return;
+ var dbItemArray = [];
+ dbItems.forEach(function(currentDbItem) {
+ var currentMediaItem = currentDbItem.item.data;
+ downloadTasks.forEach(function(currentDownloadTask) {
+ if (currentDownloadTask.mediaId === currentMediaItem.serviceId) {
+ currentMediaItem.downloadTask = currentDownloadTask;
+ currentMediaItem.hydrated = true;
+ dbItemArray.push(currentMediaItem)
+ }
+ })
+ });
+ dbItemArray.sort(function(a, b) {
+ if (a.downloadTask.taskStatus < b.downloadTask.taskStatus)
+ return -1;
+ else if (a.downloadTask.taskStatus === b.downloadTask.taskStatus)
+ return b.downloadTask.percentage - a.downloadTask.percentage;
+ else
+ return 1
+ });
+ if (this._galleryControl)
+ this._galleryControl.dataSource = new MS.Entertainment.Data.VirtualList(null, dbItemArray);
+ this._hasPopulatedList = true;
+ this._updateGroupActions(downloadTasks);
+ this._resetTimer()
+ }.bind(this), function getVideoDetailsFailed(error) {
+ MS.Entertainment.UI.Controls.fail("Error while querying the DB for the active downloads in the Download Manager.")
+ })
+ }.bind(this))
+ }, _updateGalleryItems: function updateGalleryItems(newItems) {
+ if (!this._hasPopulatedList || !this._galleryControl || !this._galleryControl.dataSource || this._updatingGalleryItems)
+ return;
+ this._updatingGalleryItems = true;
+ this.getMarketplaceNativeFileDownloadsAsync().then(function getMarketplaceNativeFileDownloadsAsync_complete(nativeDownloadTasks) {
+ var downloadTasks = [];
+ if (!nativeDownloadTasks || nativeDownloadTasks.length === 0) {
+ if (this._galleryControl && this._galleryControl.dataSource) {
+ this._galleryControl.dataSource.setSource([]);
+ this._updateGroupActions(downloadTasks)
+ }
+ return
+ }
+ for (var i = 0; i < nativeDownloadTasks.length; i++) {
+ var downloadTask = nativeDownloadTasks[i];
+ if (downloadTask.libraryTypeId !== Microsoft.Entertainment.Queries.ObjectType.video)
+ continue;
+ if (downloadTask.taskStatus !== Microsoft.Entertainment.FileTransferStatus.canceled && downloadTask.taskStatus !== Microsoft.Entertainment.FileTransferStatus.completed && !downloadTask.isClosed)
+ downloadTasks.push(downloadTask)
+ }
+ downloadTasks.sort(function(a, b) {
+ if (a.taskStatus < b.taskStatus)
+ return -1;
+ else if (a.taskStatus === b.taskStatus)
+ return b.percentage - a.percentage;
+ else
+ return 1
+ });
+ for (var listIndex = 0; this._galleryControl && (listIndex < this._galleryControl.dataSource.count); listIndex++) {
+ var currentItem = this._galleryControl.dataSource.getItem(listIndex);
+ var found = false;
+ if (!currentItem || !currentItem.data)
+ continue;
+ for (var taskIndex = 0; taskIndex < downloadTasks.length; taskIndex++)
+ if (downloadTasks[taskIndex].mediaId === currentItem.data.serviceId) {
+ currentItem.data.downloadTask = downloadTasks[taskIndex];
+ found = true;
+ break
+ }
+ if (!found) {
+ this._galleryControl.clearSelection();
+ this._galleryControl.dataSource.removeAt(listIndex);
+ listIndex--
+ }
+ }
+ for (var sortIndex = 0; sortIndex < downloadTasks.length; sortIndex++) {
+ var currentTask = downloadTasks[sortIndex];
+ for (var listIndex = 0; listIndex < this._galleryControl.dataSource.count; listIndex++) {
+ var listItem = this._galleryControl.dataSource.getItem(listIndex);
+ if (listItem && currentTask.mediaId === listItem.data.serviceId) {
+ if (listIndex !== sortIndex)
+ this._galleryControl.dataSource.moveAt(listIndex, sortIndex);
+ break
+ }
+ }
+ }
+ this._updateGroupActions(downloadTasks);
+ this._resetTimer()
+ }.bind(this)).done(function() {
+ this._updatingGalleryItems = false
+ }.bind(this), function() {
+ this._updatingGalleryItems = false
+ }.bind(this))
+ }, _getVideoDetails: function getVideoDetails(libraryIds) {
+ var query = new MS.Entertainment.Data.Query.libraryVideos;
+ query.objectIds = libraryIds;
+ return query.execute().then(function getVideoDetailsComplete(q) {
+ return q.result.items
+ }.bind(this), function getVideoDetailsFailed(error) {
+ MS.Entertainment.UI.Controls.fail("Error while querying the DB for the active downloads in the Download Manager.")
+ })
+ }, _updateGroupActions: function updateGroupActions(downloadTasks) {
+ var active = 0;
+ var canRetry = 0;
+ var failed = 0;
+ var pending = 0;
+ var paused = 0;
+ for (var i = 0; i < downloadTasks.length; i++) {
+ var downloadTask = downloadTasks[i];
+ if (downloadTask.libraryTypeId !== Microsoft.Entertainment.Queries.ObjectType.video)
+ continue;
+ if (downloadTask.taskStatus !== Microsoft.Entertainment.FileTransferStatus.completed && downloadTask.taskStatus !== Microsoft.Entertainment.FileTransferStatus.canceled && !downloadTask.isClosed)
+ switch (downloadTask.taskStatus) {
+ case Microsoft.Entertainment.FileTransferStatus.pending:
+ case Microsoft.Entertainment.FileTransferStatus.notStarted:
+ ++pending;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.error:
+ if (downloadTask.canRetry)
+ ++canRetry;
+ ++failed;
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.canceled:
+ break;
+ case Microsoft.Entertainment.FileTransferStatus.paused:
+ ++paused;
+ break;
+ default:
+ ++active;
+ break
+ }
+ }
+ var hasPending = (pending > 0);
+ var hasActive = (active > 0);
+ var hasFailed = (failed > 0);
+ var hasRetryable = (canRetry > 0);
+ var hasPaused = (paused > 0);
+ this._enablePauseAllButton(hasPending || hasActive);
+ this._enableResumeAllButton(hasPaused);
+ this._enableCancelAllButton(hasPending || hasActive || hasFailed || hasPaused);
+ this.showDownloads = (this._galleryControl && this._galleryControl.dataSource && this._galleryControl.dataSource.count > 0);
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.showCopyingFilesHelpLink = (this.showDownloads && config.video.showDownloadCopyingHelpLink)
+ }, getMarketplaceNativeFileDownloadsAsync: function getMarketplaceNativeFileDownloadsAsync() {
+ if (Microsoft.Entertainment.FileTransferQuery) {
+ var query = new Microsoft.Entertainment.FileTransferQuery;
+ query.requestType = Microsoft.Entertainment.FileTransferRequestType.marketPlace;
+ if (query && Microsoft.Entertainment.FileTransferManager)
+ return Microsoft.Entertainment.FileTransferManager.getFileDownloadsByQueryAsync(query).then(function getFileDownloadsByQueryAsync_complete(nativeItems) {
+ if (nativeItems)
+ return WinJS.Promise.wrap(nativeItems);
+ return WinJS.Promise.wrap([])
+ }, function getFileDownloadsByQueryAsync_error(e) {
+ return WinJS.Promise.wrap([])
+ });
+ else
+ return WinJS.Promise.wrap([])
+ }
+ else
+ return WinJS.Promise.wrap([])
+ }, _enablePauseAllButton: function enablePauseAllButton(enable) {
+ if (this._overlay)
+ this._overlay.buttons[0].isAvailable = enable
+ }, _enableResumeAllButton: function enableResumeAllButton(enable) {
+ if (this._overlay)
+ this._overlay.buttons[1].isAvailable = enable
+ }, _enableCancelAllButton: function enableCancelAllButton(enable) {
+ if (this._overlay)
+ this._overlay.buttons[2].isAvailable = enable
+ }, _resetTimer: function _restartTimer() {
+ window.clearTimeout(this._timer);
+ var refreshListIntervalMs = this._refreshInterval * 1000;
+ this._timer = window.setTimeout(function() {
+ this._updateGalleryItems()
+ }.bind(this), refreshListIntervalMs)
+ }, _onPauseAll: function onPauseAll() {
+ return this._applyGroupAction(MS.Entertainment.UI.Controls.DownloadManagerGroupActions.PauseAll)
+ }, _onResumeAll: function onResumeAll() {
+ return this._applyGroupAction(MS.Entertainment.UI.Controls.DownloadManagerGroupActions.ResumeAll)
+ }, _onCancelAll: function onCancelAll() {
+ return this._applyGroupAction(MS.Entertainment.UI.Controls.DownloadManagerGroupActions.CancelAll)
+ }, _onClose: function onClose() {
+ if (this._overlay)
+ this._overlay.hide()
+ }
+ }, {
+ showDownloads: true, showCopyingFilesHelpLink: false, templateSelectorConstructor: MS.Entertainment.UI.Controls.GalleryTemplateSelector
+ }), VideoDownloadTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryTemplateSelector", function videoDownloadTemplateSelector(galleryView) {
+ MS.Entertainment.UI.Controls.GalleryTemplateSelector.prototype.constructor.call(this);
+ this._galleryView = galleryView;
+ this.addTemplate("episode", "/Controls/Video/VideoDownloadItem.html#episodeDownloadItemHost");
+ this.addTemplate("movie", "/Controls/Video/VideoDownloadItem.html#movieDownloadItemHost")
+ }, {onSelectTemplate: function onSelectTemplate(item) {
+ var template = null;
+ if (item && item.data) {
+ var data = item.data || {};
+ switch (data.videoType) {
+ case Microsoft.Entertainment.Queries.VideoType.tvEpisode:
+ template = "episode";
+ break;
+ case Microsoft.Entertainment.Queries.VideoType.movie:
+ template = "movie";
+ break;
+ default:
+ throw new Error("videoType not recognized for video download manager!");
+ }
+ }
+ this.ensureTemplatesLoaded([template]);
+ return this.getTemplateProvider(template)
+ }}), ShowVideoDownloadManagerDialogAction: MS.Entertainment.deferredDerive(MS.Entertainment.UI.Actions.Action, null, {
+ automationId: MS.Entertainment.UI.AutomationIds.showDownloadManager, canExecute: function canExecute() {
+ return true
+ }, executed: function() {
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_VIDEO_DOWNLOAD_MANAGER_TITLE), "MS.Entertainment.UI.Controls.VideoDownloadManagerDialog", {
+ width: null, height: null, customStyle: "videoDownloadManagerDialog"
+ })
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.showVideoDownloadManager, function() {
+ return new MS.Entertainment.UI.Controls.ShowVideoDownloadManagerDialogAction
+ })
+})()
+})();
+/* >>>>>>/framework/purchasehistoryservice.js:306 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI");
+ WinJS.Namespace.define("MS.Entertainment.UI", {PurchaseHistoryService: MS.Entertainment.defineObservable(function PurchaseHistoryServiceConstructor() {
+ this._grovelTimer = null;
+ this._grovelTimerStartDate = null;
+ this._sessionPurchaseFlowActivityCount = 0
+ }, {
+ inPurchaseFlow: false, isGroveling: false, hasGrovelEverCompleted: false, _hasPendingGrovelRequest: false, _grovelTimer: null, _grovelTimerStartDate: null, _previousAttemptFailed: false, _sessionPurchaseFlowActivityCount: null, _signInBindings: null, _purchasedEventHandler: null, _networkStatusBinding: null, _lastBookmarkSyncDate: null, isUsingXdlcForIngestion: function isUsingXdlcForIngestion() {
+ return MS.Entertainment.Utilities.isVideoApp
+ }, grovel: function grovel(resetLastUpdateDateTime, restoringPurchases, ignoreIfWithinMinimumIncrement) {
+ if (this.isGroveling || !MS.Entertainment.UI.PurchaseHistoryService.isFeatureEnabled) {
+ this._hasPendingGrovelRequest = true;
+ return
+ }
+ if (ignoreIfWithinMinimumIncrement && this._grovelTimerStartDate) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var minimumIncrement = configuration.service.purchaseHistoryMinimumIncrementInSeconds * 1000;
+ if ((this._grovelTimerStartDate.valueOf() + minimumIncrement) > (new Date).valueOf())
+ return
+ }
+ this._stopGrovelTimer();
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn && (MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp)) {
+ this.isGroveling = true;
+ var resetIsGroveling = function resetIsGroveling() {
+ this.isGroveling = false;
+ if (this._hasPendingGrovelRequest) {
+ this._hasPendingGrovelRequest = false;
+ this.grovel()
+ }
+ }.bind(this);
+ var grovelFunction;
+ if (this.isUsingXdlcForIngestion())
+ grovelFunction = this._grovelUsingXdlc.bind(this, restoringPurchases);
+ else
+ grovelFunction = this._grovelUsingMds.bind(this);
+ grovelFunction().then(function onGrovelingSuccess(hasFailures) {
+ if (!hasFailures && !this.hasGrovelEverCompleted)
+ this.hasGrovelEverCompleted = true;
+ resetIsGroveling();
+ this._startSync()
+ }.bind(this), function onGrovelingError(error) {
+ if (error && error.number && typeof error.number === "number")
+ error = error.number;
+ this._hasPendingGrovelRequest = false;
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ this._startGrovelTimer(true);
+ resetIsGroveling();
+ this._startSync()
+ }.bind(this)).done(function onGrovelingCompleted() {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ Microsoft.Entertainment.Marketplace.Marketplace.getLatestSeasonMetadataAsync()
+ })
+ }
+ }, _grovelUsingMds: function _grovelUsingMds() {
+ var config = MS.Entertainment.UI.PurchaseHistoryService._getConfig();
+ var historyToken = config.historyToken ? config.historyToken : "";
+ var aggressiveGrovel = config.incompletePurchaseFlows !== 0;
+ return Microsoft.Entertainment.Marketplace.Marketplace.grovelPastPurchasedMusic(historyToken, !!aggressiveGrovel).then(function grovelPastPurchasedMediaComplete(result) {
+ if (!result.hasFailures)
+ MS.Entertainment.UI.PurchaseHistoryService._setConfig(result.nextHistoryToken, 0);
+ this._startGrovelTimer(result.hasFailures);
+ return result.hasFailures
+ }.bind(this))
+ }, _grovelUsingXdlc: function _grovelUsingXdlc(restoringPurchases) {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var forceVideoIngestionRefreshSyncToken = configManager.fulfillment.forceVideoIngestionRefreshSyncToken;
+ var dontShortCircuitAndForceUpdateAllRights = forceVideoIngestionRefreshSyncToken !== configManager.fulfillment.lastHandledIngestionRefreshSyncToken;
+ return Microsoft.Entertainment.Fulfillment.Video.Entitlements.refreshAsync(null, !!(dontShortCircuitAndForceUpdateAllRights || restoringPurchases), !!dontShortCircuitAndForceUpdateAllRights, !!restoringPurchases, true).then(function refreshVideoOffersAsync_complete(result) {
+ if (dontShortCircuitAndForceUpdateAllRights && !result.hasFailures)
+ configManager.fulfillment.lastHandledIngestionRefreshSyncToken = forceVideoIngestionRefreshSyncToken;
+ this._startGrovelTimer(result.hasFailures);
+ return result.hasFailures
+ }.bind(this), function refreshVideoOffersAsync_error(error) {
+ this._startGrovelTimer(true);
+ return WinJS.Promise.wrapError(error)
+ }.bind(this))
+ }, _startGrovelTimer: function _startGrovelTimer(previousAttemptFailed) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var secondsBeforeNextGrovel = previousAttemptFailed ? configuration.service.purchaseHistoryReattemptAfterFailureInSeconds : configuration.service.purchaseHistoryFrequencyInSeconds;
+ this._previousAttemptFailed = previousAttemptFailed;
+ this._stopGrovelTimer();
+ this._grovelTimerStartDate = new Date;
+ this._grovelTimer = WinJS.Promise.timeout(secondsBeforeNextGrovel * 1000).then(this.grovel.bind(this))
+ }, _stopGrovelTimer: function _stopGrovelTimer() {
+ if (this._grovelTimer) {
+ var timer = WinJS.Binding.unwrap(this._grovelTimer);
+ if (timer)
+ timer.cancel();
+ this._grovelTimer = null
+ }
+ }, _startSync: function _startSync() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoCloudCollection)) {
+ if (this._lastBookmarkSyncDate) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var safetySyncIntervalInMs = configuration.sync.videoSafetySyncIntervalInSeconds * 1000;
+ if (this._lastBookmarkSyncDate.valueOf() + safetySyncIntervalInMs > (new Date).valueOf())
+ return
+ }
+ var videoCloudCollection = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoCloudCollection);
+ videoCloudCollection.startSync();
+ this._lastBookmarkSyncDate = new Date
+ }
+ }
+ }, {
+ isFeatureEnabled: {get: function isFeatureEnabled() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ return featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (MS.Entertainment.Utilities.isVideoApp)
+ return featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ return false
+ }}, enterPurchaseFlowActivity: function enterPurchaseFlowActivity() {
+ if (!MS.Entertainment.UI.PurchaseHistoryService.isFeatureEnabled)
+ return;
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ service._stopGrovelTimer();
+ if (++service._sessionPurchaseFlowActivityCount === 1) {
+ service.inPurchaseFlow = true;
+ var config = MS.Entertainment.UI.PurchaseHistoryService._getConfig();
+ MS.Entertainment.UI.PurchaseHistoryService._setConfig(config.historyToken, config.incompletePurchaseFlows + 1)
+ }
+ }, leavePurchaseFlowActivity: function leavePurchaseFlowActivity(failureOccurred) {
+ if (!MS.Entertainment.UI.PurchaseHistoryService.isFeatureEnabled)
+ return;
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ service._stopGrovelTimer();
+ var purchaseFlowSessionClosed = (service._sessionPurchaseFlowActivityCount !== 0 && --service._sessionPurchaseFlowActivityCount === 0);
+ if (failureOccurred) {
+ var config = MS.Entertainment.UI.PurchaseHistoryService._getConfig();
+ MS.Entertainment.UI.PurchaseHistoryService._setConfig(config.historyToken, config.incompletePurchaseFlows + 1)
+ }
+ if (purchaseFlowSessionClosed) {
+ service.inPurchaseFlow = false;
+ var config = MS.Entertainment.UI.PurchaseHistoryService._getConfig();
+ if (config.incompletePurchaseFlows !== 0)
+ MS.Entertainment.UI.PurchaseHistoryService._setConfig(config.historyToken, config.incompletePurchaseFlows - 1);
+ service.grovel()
+ }
+ }, initialize: function initialize() {
+ this._signInBindings = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).bind("isSignedIn", MS.Entertainment.UI.PurchaseHistoryService._onSignInChange);
+ MS.Entertainment.Utilities.SignIn.addEventListener("signInRefreshed", function _onSignInRefreshed() {
+ MS.Entertainment.UI.PurchaseHistoryService._onSignInChange(true)
+ });
+ if (WinJS.Utilities.getMember("App2.ApplicationModel.Store.Product"))
+ this._purchasedEventHandler = MS.Entertainment.Utilities.addEventHandlers(App2.ApplicationModel.Store.Product, {productpurchased: function onPurchaseCompleted(result) {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ if (purchaseHistoryService && !purchaseHistoryService.inPurchaseFlow)
+ purchaseHistoryService.grovel()
+ }});
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: MS.Entertainment.UI.PurchaseHistoryService._onNetworkStatusChanged})
+ }, dispose: function dispose() {
+ if (this._signInBindings) {
+ this._signInBindings.cancel();
+ this._signInBindings = null
+ }
+ if (this._purchasedEventHandler) {
+ this._purchasedEventHandler.cancel();
+ this._purchasedEventHandler = null
+ }
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ }, refreshVideoOffersAsync: function refreshVideoOffersAsync(offerIds) {
+ return Microsoft.Entertainment.Fulfillment.Video.Entitlements.refreshAsync(offerIds, true, true, true, false).then(function refreshVideoOffersAsync_complete(result) {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ if (result.hasFailures)
+ purchaseHistoryService._startGrovelTimer(true);
+ return result
+ }, function refreshVideoOffersAsync_error(error) {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ purchaseHistoryService._startGrovelTimer(true);
+ return WinJS.Promise.wrapError(error)
+ })
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newValue) {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ if (purchaseHistoryService._previousAttemptFailed && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ switch (newValue) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ WinJS.Promise.timeout(1000).then(function _onNetworkStatusChanged_delay() {
+ purchaseHistoryService.grovel()
+ });
+ break
+ }
+ }, _onSignInChange: function _onSignInChange(isSignedIn) {
+ if (!MS.Entertainment.UI.PurchaseHistoryService.isFeatureEnabled)
+ return;
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ if (isSignedIn)
+ service.grovel();
+ else {
+ service._stopGrovelTimer();
+ service.hasGrovelEverCompleted = false
+ }
+ }, _getConfig: function _getConfig() {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var configString = configuration.service.pastPurchaseData;
+ var config = configString ? JSON.parse(configString) : {};
+ if (!config.historyToken)
+ {
+ config.historyToken = null;
+ config.incompletePurchaseFlows = 1
+ }
+ if (!config.incompletePurchaseFlows && !(typeof config.incompletePurchaseFlows === "number"))
+ config.incompletePurchaseFlows = 1;
+ return config
+ }, _setConfig: function _setConfig(historyToken, incompletePurchaseFlows) {
+ var config = {
+ historyToken: historyToken, incompletePurchaseFlows: incompletePurchaseFlows
+ };
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configuration.service.pastPurchaseData = JSON.stringify(config)
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.purchaseHistory, function PurchaseHistoryServiceFactory() {
+ return new MS.Entertainment.UI.PurchaseHistoryService
+ })
+})()
+})();
+/* >>>>>>/components/playback/controls/mediaplayer.js:532 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ var DeviceGroup = WinJS.Namespace.define("Microsoft.Entertainment.Service.Requests.DeviceGroup", null);
+ var HNS_PER_MILLISECOND = 10000;
+ var FourCCMap = {
+ Unknown: "Unknown", "858604357": "EC-3", "1279476033": "AACL", "1212367169": "AACH", "875967048": "H.264"
+ };
+ function getPassportTicketAsync(returnEmptyOnFailure) {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ return WinJS.Promise.wrapError("No SessionMgr is registered");
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ return sessionMgr.getPassportTicketAsync(returnEmptyOnFailure)
+ }
+ function isBlobUrl(url) {
+ var blobUrlRegex = /^blob:/i;
+ return blobUrlRegex.test(url)
+ }
+ function enumToString(enumValue, enumeration) {
+ for (var name in enumeration)
+ if (enumValue === enumeration[name])
+ return name;
+ return "unknown"
+ }
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {
+ MediaPlayer: MS.Entertainment.UI.Framework.define(function MediaPlayer_constructor(playerType, mediaInstance, autoPlay) {
+ if (!this._tagPlayer)
+ this._tagPlayer = this._createHtmlTag(playerType, mediaInstance, autoPlay);
+ this._autoPlay = autoPlay;
+ this._media = mediaInstance
+ }, {
+ autoplay: {
+ get: function autoplay_get() {
+ return this._autoPlay
+ }, set: function autoplay_set(value) {
+ this._autoPlay = value
+ }
+ }, muted: {
+ get: function muted_get() {
+ return this._tagPlayer.muted
+ }, set: function muted_set(value) {
+ this._tagPlayer.muted = value
+ }
+ }, volume: {
+ get: function volume_get() {
+ return this._tagPlayer.volume
+ }, set: function volume_set(value) {
+ this._tagPlayer.volume = value
+ }
+ }, currentTime: {
+ get: function currentTime_get() {
+ return this._tagPlayer.currentTime
+ }, set: function currentTime_set(value) {
+ this._tagPlayer.currentTime = value
+ }
+ }, duration: {get: function duration_get() {
+ if (this._tagPlayer.durationOverrideMS)
+ return this._tagPlayer.durationOverrideMS / 1000;
+ return this._tagPlayer.duration
+ }}, error: {get: function error_get() {
+ return this._tagPlayer.error
+ }}, media: {get: function media_get() {
+ return this._media
+ }}, playerType: {get: function playerType_get() {
+ return this._tagPlayer.tagName
+ }}, playbackRate: {
+ get: function playbackRate_get() {
+ return this._tagPlayer.playbackRate
+ }, set: function playbackRate_set(value) {
+ this._tagPlayer.playbackRate = value
+ }
+ }, buffered: {get: function buffered_get() {
+ return this._tagPlayer.buffered
+ }}, ended: {get: function ended_get() {
+ return this._tagPlayer.ended
+ }}, isDisposed: {get: function isDisposed_get() {
+ return this._disposed
+ }}, skipThisError: {
+ get: function skipThisError_get() {
+ return this._skipThisError
+ }, set: function skipThisError_set(value) {
+ this._skipThisError = value
+ }
+ }, msPlayToDisabled: {get: function msPlayToDisabled_get() {
+ return this._tagPlayer.msPlayToDisabled
+ }}, msPlayToSource: {get: function msPlayToSource_get() {
+ return this._tagPlayer.msPlayToSource
+ }}, play: function MediaPlayer_play() {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::Play()");
+ this._tagPlayer.play()
+ }, pause: function MediaPlayer_pause() {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::Pause()");
+ this._tagPlayer.pause()
+ }, stop: function MediaPlayer_stop() {
+ this.pause()
+ }, seekToPosition: function MediaPlayer_seekToPosition(positionMsec) {
+ try {
+ var positionSec = positionMsec / 1000;
+ this._tagPlayer.currentTime = positionSec
+ }
+ catch(e) {
+ MSEPlatform.Playback.Etw.tracePlaybackError(e.code, e.msExtendedCode, "MediaPlayer::seekToPosition")
+ }
+ }, forceTimeUpdate: function MediaPlayer_forceTimeUpdate() {
+ return this._tagPlayer.currentTime * 1000
+ }, addEventListener: function MediaPlayer_addEventListener(type, listener, useCapture) {
+ this._tagPlayer.addEventListener(type, listener, useCapture)
+ }, removeEventListener: function MediaPlayer_removeEventListener(type, listener, useCapture) {
+ this._tagPlayer.removeEventListener(type, listener, useCapture)
+ }, getElement: function MediaPlayer_getElement() {
+ return this._tagPlayer
+ }, getMediaDurationMS: function MediaPlayer_getMediaDurationMS() {
+ function getDurationMS(duration) {
+ if (duration) {
+ if (duration.getMinutes)
+ duration = ((duration.getHours() * 60 * 60) + (duration.getMinutes() * 60) + duration.getSeconds()) * 1000
+ }
+ else
+ duration = 0;
+ return duration
+ }
+ var duration = null;
+ if (this._media && this._media._mediaItem && this._media._mediaItem.data)
+ duration = this._media._mediaItem.data.duration;
+ return getDurationMS(duration)
+ }, dispose: function MediaPlayer_dispose() {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::dispose: Disposing tag");
+ if (this._tagPlayer._mediaProtectionManagerBindings) {
+ this._tagPlayer._mediaProtectionManagerBindings.cancel();
+ this._tagPlayer._mediaProtectionManagerBindings = null
+ }
+ this._tagPlayer.removeAttribute("src");
+ this._tagPlayer.load();
+ this._media = null;
+ this._disposed = true
+ }, configureDRM: function MediaPlayer_configureDRM() {
+ var that = this;
+ var htmlTag = this._tagPlayer;
+ var mediaInstance = this._media;
+ var Playback = MSEPlatform.Playback;
+ var licenseLog = "";
+ var startLicenseAcquisitionTime = new Date;
+ MSEPlatform.Playback.assert(mediaInstance, "mediaInstance should not be null");
+ function getKidFromServiceRequest(e) {
+ return e && e.request && e.request.contentHeader ? e.request.contentHeader.keyIdString : String.empty
+ }
+ function serviceRequested(e) {
+ function onPlaySRCompleted(asyncOp) {
+ if (e && e.completion && e.completion.complete)
+ e.completion.complete(true);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "License acquisition succeeded");
+ var elapsedTime = new Date - startLicenseAcquisitionTime;
+ Playback.Etw.traceString("DRM:LA Time Elapsed (ms) : " + elapsedTime);
+ licenseLog = "";
+ if (Playback.AudioPlayer.fastStartBlockedOnLA)
+ Playback.AudioPlayer.fastStartBlockedOnLA = false;
+ if (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && !mediaInstance.trackLeafLicenseAcquired && mediaInstance.isLocal)
+ mediaInstance.trackLeafLicenseAcquired = true
+ }
+ function onPlaySRError(error) {
+ var errorCode = (error && error.number) ? error.number : "unknown";
+ Playback.Etw.traceString("DRM:onPlaySRError: " + errorCode);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "License acquisition failed with error " + errorCode);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (error && error.number === MSEPlatform.Playback.Error.NS_E_DRM_INVALID_LICENSE.code && (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track) && signedInUser && signedInUser.isSubscription && mediaInstance.isLocal) {
+ Playback.Etw.traceString("DRM:onPlaySRError: retry root LA for subscription downloaded content");
+ getPassportTicketAsync().then(function _gotTicket(ticket) {
+ MSEPlatform.Playback.drmIndividualizationPromise.then(function _doAcquireRootLicense() {
+ Microsoft.Entertainment.Util.PlayReadyHandler.acquireRootLicense(ticket)
+ })
+ }).then(function _rootSucceeded() {
+ Playback.Etw.traceString("DRM:onPlaySRError: root LA retry SUCCEEDED");
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("succeeded");
+ if (e && e.completion && e.completion.complete)
+ e.completion.complete(true)
+ }, function _rootFailed(error) {
+ Playback.Etw.traceString("DRM:onPlaySRError: root LA retry FAILED: " + errorCode);
+ MS.Entertainment.Utilities.Telemetry.logRootLicenseAcquisition("failed", errorCode);
+ that._drmNotifyError(error, "DRM ServiceRequest Error (Root LA Retry): " + licenseLog, e)
+ })
+ }
+ else if (error && error.number === MSEPlatform.Playback.Error.MF_E_UNSUPPORTED_RATE.code && mediaInstance.mediaType !== Microsoft.Entertainment.Queries.ObjectType.track && mediaInstance.smidEnablerInEffect && mediaInstance.isLocal)
+ that._drmNotifyError(MSEPlatform.Playback.Error.ZEST_E_ASSET_LICENSE_RIGHT_NOT_OWNED, "Protected Video Content SMID is not owned. " + licenseLog, e);
+ else
+ that._drmNotifyError(error, "DRM ServiceRequest Error: " + licenseLog, e)
+ }
+ function onPlaySRProgress(report) {
+ if (report.indexOf("lease") === -1) {
+ var elapsedTime = new Date - startLicenseAcquisitionTime;
+ Playback.Etw.traceString("DRM:" + elapsedTime + ":" + report);
+ licenseLog += elapsedTime + " : " + report + "\n"
+ }
+ else
+ try {
+ var leaseObject = JSON.parse(report);
+ mediaInstance.initialLease = leaseObject.lease
+ }
+ catch(e) {
+ Playback.Etw.traceString("Exception thrown when parsing the lease: " + report)
+ }
+ }
+ try {
+ if (!mediaInstance)
+ return;
+ if (e.request.type === Microsoft.Media.PlayReadyClient.PlayReadyStatics.individualizationServiceRequestType) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, String.empty, "Individualization Requested");
+ e.request.beginServiceRequest().then(function indiv_complete() {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, String.empty, "Individualization Successful");
+ try {
+ var next = e.request.nextServiceRequest();
+ if (next) {
+ e.request = next;
+ serviceRequested(e)
+ }
+ else
+ onPlaySRCompleted()
+ }
+ catch(ex) {
+ MSEPlatform.Playback.MediaPlayer.drmNotifyException(htmlTag, ex, "DRM Individualization Service Request")
+ }
+ }, function indiv_error() {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, String.empty, "Individualization Failed");
+ that._drmNotifyError(MSEPlatform.Playback.Error.NS_E_DRM_NEEDS_INDIVIDUALIZATION, null, e)
+ });
+ return
+ }
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "License Needed");
+ mediaInstance.fillDownloadSubscriptionInfoAsync().then(function fillDownloadSubscriptionInfoAsync_complete() {
+ if (!mediaInstance.nativeLicenseRight && mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && mediaInstance.isLocal)
+ mediaInstance.nativeLicenseRight = Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload;
+ var right = MSEPlatform.PurchaseHelpers.LicenseRightMap.toScript(mediaInstance.nativeLicenseRight);
+ return getPassportTicketAsync(right === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.FreeStream).then(function execute_drm_serviceRequest(ticket) {
+ var handler;
+ try {
+ if (MS.Entertainment.Utilities.isEmptyGuid(mediaInstance.mediaInstanceId) || !right) {
+ if (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Track has no MIID or no rights");
+ that._drmNotifyError(MSEPlatform.Playback.Error.ZUNE_E_NO_SUBSCRIPTION_DOWNLOAD_RIGHTS, "No rights to this content", e);
+ return
+ }
+ else if (mediaInstance.signedLicensePolicyTicket) {
+ handler = Microsoft.Entertainment.Util.PlayReadyHandler.createForVideoLicensePolicyTicket(mediaInstance.signedLicensePolicyTicket, !mediaInstance.isLocal);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting LPT enabler")
+ }
+ else if (!MS.Entertainment.Utilities.isEmptyGuid(mediaInstance.serviceIdSafe)) {
+ mediaInstance.smidEnablerInEffect = true;
+ handler = Microsoft.Entertainment.Util.PlayReadyHandler.createForVideoServiceMediaId(mediaInstance.serviceIdSafe, !mediaInstance.isLocal);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting SMID enabler")
+ }
+ else if (mediaInstance._mediaItem && mediaInstance._mediaItem.data && mediaInstance._mediaItem.data.fileItem) {
+ MSEPlatform.PurchaseHelpers.getServiceIdAsync(mediaInstance._mediaItem.data.fileItem).done(function crackedSmid(smid) {
+ if (smid) {
+ mediaInstance.smidEnablerInEffect = true;
+ mediaInstance._mediaItem.data.zuneId = smid;
+ handler = Microsoft.Entertainment.Util.PlayReadyHandler.createForVideoServiceMediaId(smid, !mediaInstance.isLocal);
+ handler.beginServiceRequest(e.request).then(onPlaySRCompleted, onPlaySRError, onPlaySRProgress)
+ }
+ else {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Media has no SMID assigned");
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED, "Media has no SMID assigned", e)
+ }
+ }, function cannotCrackSmid(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Cannot crack SMID" + error);
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED, "Cannot crack SMID " + error, e)
+ });
+ return
+ }
+ }
+ else if (mediaInstance.mediaType === Microsoft.Entertainment.Queries.ObjectType.track && mediaInstance.trackLeafLicenseAcquired) {
+ Playback.Etw.traceString("DRM:onPlaySRError: retry root LA for subscription downloaded content");
+ handler = new Microsoft.Entertainment.Util.PlayReadyHandler(ticket);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting root subscription enabler")
+ }
+ else {
+ handler = new Microsoft.Entertainment.Util.PlayReadyHandler(ticket, right, mediaInstance.shouldLogToDrmDownloadHistory, mediaInstance.offerId ? mediaInstance.offerId : MS.Entertainment.Utilities.EMPTY_GUID, mediaInstance.mediaInstanceId);
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Attempting MIID+Offer enabler")
+ }
+ handler.beginServiceRequest(e.request).then(onPlaySRCompleted, onPlaySRError, onPlaySRProgress)
+ }
+ catch(ex) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Unexpected exception thrown");
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, ex, "License Acquisition Service Request")
+ }
+ }, function sign_in_failure(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Sign in Failed");
+ that._drmNotifyError(MSEPlatform.Playback.Error.ZEST_E_SIGNIN_REQUIRED, null, e)
+ })
+ }, function fillDownloadSubscriptionInfoAsync_error(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Media Detail Query failed");
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED, "Media has no SMID assigned", e)
+ }).done(null, function reactiveLicenseAcquisitionFailed(error) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Unexpected outer exception thrown");
+ that._drmNotifyError(error, "serviceRequested", e)
+ })
+ }
+ catch(ex) {
+ MS.Entertainment.Utilities.Telemetry.logReactiveLicenseAcquisitionProgress(mediaInstance, getKidFromServiceRequest(e), "Unexpected outer exception thrown");
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, ex, "serviceRequested")
+ }
+ }
+ function componentLoadFailed(e) {
+ var traceMsg = "";
+ var postPendedText = "";
+ try {
+ traceMsg += e.information.items.size + " failed components!\n";
+ traceMsg += "Components:\n";
+ var size = e.information.items.size;
+ for (var i = 0; i < size; i++) {
+ traceMsg += e.information.items[i].name + "\nReasons=" + e.information.items[i].reasons + "\n" + "Renewal Id=" + e.information.items[i].renewalId + "\n";
+ postPendedText += (" - " + e.information.items[i].name + "\n")
+ }
+ e.completion.complete(true);
+ traceMsg += "Resumed source (false)\n";
+ MSEPlatform.Playback.Etw.traceString(traceMsg);
+ that._drmNotifyError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_COMPONENT_LOAD_FAILURE, null, null, postPendedText)
+ }
+ catch(e) {
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, e, "componentLoadFailed")
+ }
+ }
+ var mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager;
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
+ var copyProtectionSystems = new Windows.Foundation.Collections.PropertySet;
+ copyProtectionSystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput";
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = copyProtectionSystems;
+ if (MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isMusicApp2)
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionContainerGuid"] = "{9A04F079-9840-4286-AB92-E65BE0885F95}";
+ htmlTag._mediaProtectionManagerBindings = MS.Entertainment.Utilities.addEventHandlers(mediaProtectionManager, {
+ componentloadfailed: componentLoadFailed, servicerequested: serviceRequested
+ });
+ try {
+ htmlTag.msSetMediaProtectionManager(mediaProtectionManager)
+ }
+ catch(e) {
+ MS.Entertainment.Platform.Playback.fail("_configureTagForDRM: Unexpected exception on msSetMediaProtectionManager: " + e.message);
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(that, e, "configureTagForDRM_msSetMediaProtectionManager")
+ }
+ }, _createHtmlTag: function MediaPlayer_createHtmlTag(playerType, mediaInstance, autoPlay) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::createHtmlTag: creating audio/video tag. mediaInstance.source = " + mediaInstance.source);
+ var Playback = MSEPlatform.Playback;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var htmlTag = Playback.MediaPlayer.createMediaTag(playerType);
+ if (!htmlTag)
+ throw"MediaPlayer::createHtmlTag(): Error! cannot create " + playerType + " tag. Out of memory?";
+ if (playerType === "audio" && (MS.Entertainment.Utilities.isApp1 || configurationManager.music.backgroundAudioEnabled))
+ try {
+ htmlTag.setAttribute("msAudioCategory", "backgroundCapableMedia")
+ }
+ catch(ex) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::constructor: failed to set backgroundCapableMedia. exception: " + ex)
+ }
+ else
+ htmlTag.setAttribute("msAudioCategory", "foregroundOnlyMedia");
+ htmlTag.msPlayToDisabled = Playback.shouldDisableDlnaPlayTo(mediaInstance);
+ Playback.Etw.traceString("MediaPlayer::createHtmlTag(), autoplay= " + autoPlay);
+ htmlTag.autoplay = autoPlay;
+ htmlTag.style.width = "100%";
+ htmlTag.style.height = "100%";
+ return htmlTag
+ }, _drmNotifyError: function MediaPlayer_drmNotifyError(error, source, serviceRequest, postPendedText) {
+ var that = this;
+ var bubbleError = true;
+ var code = error.number ? error.number : error.code;
+ if (code === MSEPlatform.Playback.Error.ZEST_E_ASSET_LICENSE_RIGHT_NOT_OWNED.code)
+ if (this._media)
+ if (this._media._mediaItem && this._media._mediaItem.data && this._media._mediaItem.data["playFromXbox"]) {
+ bubbleError = false;
+ this._media._mediaItem.data["playPreviewOnly"] = true;
+ WinJS.Promise.timeout().then(function tryPreview() {
+ MSEPlatform.PlaybackHelpers.playMedia(that._media._mediaItem.data, true)
+ })
+ }
+ else if (this._media.smidEnablerInEffect) {
+ code = MSEPlatform.Playback.Error.X8_E_PLAYBACK_PROTECTED_MEDIA_NOT_IDENTIFIED.code;
+ error.code = code
+ }
+ if (bubbleError) {
+ MSEPlatform.Playback.MediaPlayer._fireTagPlaybackError(this, code, source, postPendedText);
+ if (serviceRequest && serviceRequest.completion && serviceRequest.completion.complete) {
+ this._skipThisError = true;
+ serviceRequest.completion.complete(false)
+ }
+ }
+ }, _setSourceFromMediaInstance: function MediaPlayer_setSourceFromMediaInstance() {
+ this._tagPlayer.src = this._media.source
+ }, _autoplay: false, _tagPlayer: null, _media: null, _disposed: false, _skipThisError: false
+ }, {
+ createMediaTag: function MediaPlayer_createMediaTag(type) {
+ return document.createElement(type)
+ }, _fireTagPlaybackError: function MediaPlayer_fireTagPlaybackError(player, error, context, postPendedText) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::_fireTagPlaybackError: error = " + MSEPlatform.Playback.mediaErrorToString(error));
+ MSEPlatform.Playback.assert(player && player.firePlaybackError, "Fix misconfigured media tag error handler");
+ if (player && player.firePlaybackError)
+ player.firePlaybackError(error, context, postPendedText)
+ }, _drmNotifyException: function MediaPlayer_drmNotifyException(player, ex, source) {
+ MSEPlatform.Playback.Etw.traceString("MediaPlayer::_drmNotifyException: " + JSON.stringify(ex) + " source: " + source);
+ WinJS.Promise.timeout().then(function notifyDrmException() {
+ MSEPlatform.Playback.MediaPlayer._fireTagPlaybackError(player, MSEPlatform.Playback.Error.NS_E_WMP_DRM_GENERIC_LICENSE_FAILURE.code, source)
+ })
+ }
+ }), AudioPlayer: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.MediaPlayer", function AudioPlayer_constructor(mediaInstance, autoPlay) {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::constructor: Creating audio player");
+ this.base("audio", mediaInstance, autoPlay);
+ if (!this._usingPreActivatedTag && mediaInstance.protectionState !== MSEPlatform.Playback.ProtectionState.unprotected)
+ this.configureDRM();
+ if (this._usingFastStartTag) {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::constructor: usingFastStart ");
+ MSEPlatform.Playback.assert(!mediaInstance.isLocal, "fast start tag should only be used with streaming content");
+ MSEPlatform.Playback.assert(mediaInstance.protectionState === MSEPlatform.Playback.ProtectionState.drmProtected, "fast start tag should only be used with protected content");
+ this._tagPlayer.fastStartProperties["Url"] = mediaInstance.source
+ }
+ else if (!this._usingPreActivatedTag)
+ this._setSourceFromMediaInstance()
+ }, {
+ isFastStartSource: {get: function isFastStartSource_get() {
+ return this._usingFastStartTag
+ }}, _createHtmlTag: function AudioPlayer_createHtmlTag(playerType, mediaInstance, autoPlay) {
+ var htmlTag;
+ this._usingFastStartTag = false;
+ this._usingPreActivatedTag = false;
+ var audioTagForFileActivation = MSEPlatform.Playback.AudioPlayer.audioTagForFileActivation;
+ if (audioTagForFileActivation) {
+ if (!audioTagForFileActivation.error) {
+ htmlTag = audioTagForFileActivation;
+ this._usingPreActivatedTag = true
+ }
+ else {
+ mediaInstance.mediaInstanceId = null;
+ autoPlay = true
+ }
+ MSEPlatform.Playback.AudioPlayer.audioTagForFileActivation = null
+ }
+ if (!this._usingPreActivatedTag)
+ if (!MS.Entertainment.Utilities.isMusicApp2 && autoPlay && MSEPlatform.Playback.AudioPlayer.fastStartTag && !mediaInstance.isLocal && !mediaInstance.disableFastStart && mediaInstance.protectionState === MSEPlatform.Playback.ProtectionState.drmProtected) {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::_createHtmlTag(): Using FastStart");
+ htmlTag = MSEPlatform.Playback.AudioPlayer.fastStartTag;
+ htmlTag.autoplay = autoPlay;
+ MSEPlatform.Playback.AudioPlayer.fastStartTag = null;
+ this._usingFastStartTag = true
+ }
+ else
+ htmlTag = MSEPlatform.Playback.MediaPlayer.prototype._createHtmlTag.call(this, playerType, mediaInstance, autoPlay);
+ return htmlTag
+ }, _usingFastStartTag: false, _usingPreActivatedTag: false
+ }, {
+ createFastStartTag: function AudioPlayer_createFastStartTag() {
+ function configureFastStartTagForDRM(htmlTag) {
+ var disableFastStart = function disableFastStart(e) {
+ if (this.fastStartTag)
+ this.disposeFastStartTag();
+ this.fastStartBlockedOnLA = true
+ }.bind(this);
+ var mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager;
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemId"] = "{F4637010-03C3-42CD-B932-B48ADF3A6A54}";
+ var copyProtectionSystems = new Windows.Foundation.Collections.PropertySet;
+ copyProtectionSystems["{F4637010-03C3-42CD-B932-B48ADF3A6A54}"] = "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput";
+ mediaProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = copyProtectionSystems;
+ htmlTag._mediaProtectionManagerBindings = MS.Entertainment.Utilities.addEventHandlers(mediaProtectionManager, {
+ componentloadfailed: disableFastStart, servicerequested: disableFastStart
+ });
+ try {
+ htmlTag.msSetMediaProtectionManager(mediaProtectionManager)
+ }
+ catch(e) {
+ MS.Entertainment.Platform.Playback.fail("_configureFastStartTagForDRM: Unexpected exception on msSetMediaProtectionManager: " + e.message);
+ MSEPlatform.Playback.MediaPlayer._drmNotifyException(htmlTag, e, "configureFastStartTagForDRM_msSetMediaProtectionManager")
+ }
+ }
+ if (this.fastStartTag) {
+ MSEPlatform.Playback.Etw.traceString("-AudioPlayer:_createFastStartTag exists already");
+ return
+ }
+ var extensionManager = new Windows.Media.MediaExtensionManager;
+ this.fastStartTag = MSEPlatform.Playback.MediaPlayer.createMediaTag("audio");
+ this.fastStartTag.fastStartProperties = new Windows.Foundation.Collections.PropertySet;
+ this.fastStartTag.fastStartProperties["Url"] = "";
+ extensionManager.registerSchemeHandler("Microsoft.Entertainment.Platform.Playback.FastStartSchemeHandler", "fsms:", this.fastStartTag.fastStartProperties);
+ this.fastStartTag.setAttribute("msAudioCategory", "backgroundCapableMedia");
+ this.fastStartTag.width = 0;
+ this.fastStartTag.height = 0;
+ this.fastStartTag.autoplay = false;
+ configureFastStartTagForDRM.call(this, this.fastStartTag);
+ this.fastStartTag.src = "fsms://#";
+ MSEPlatform.Playback.Etw.traceString("-AudioPlayer:createFastStartTag: created")
+ }, disposeFastStartTag: function AudioPlayer_disposeFastStartTag() {
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::disposeFastStartTag: Disposing tag");
+ if (this.fastStartTag) {
+ if (this.fastStartTag._mediaProtectionManagerBindings) {
+ this.fastStartTag._mediaProtectionManagerBindings.cancel();
+ this.fastStartTag._mediaProtectionManagerBindings = null
+ }
+ this.fastStartTag.removeAttribute("src");
+ this.fastStartTag.load();
+ this.fastStartTag = null;
+ this.fastStartBlockedOnLA = false
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("AudioPlayer::disposeFastStartTag: Nothing to dispose")
+ }, hasValidFastStartTag: function AudioPlayer_hasValidFastStartTag() {
+ return !!this.fastStartTag
+ }, audioTagForFileActivation: null, fastStartBlockedOnLA: false, fastStartTag: null
+ }), VideoPlayer: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.MediaPlayer", function VideoPlayer_constructor(mediaInstance, autoPlay) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::constructor: Creating video player");
+ this.base("video", mediaInstance, autoPlay);
+ if (!isBlobUrl(mediaInstance.source)) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (mediaInstance.videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264 && !configurationManager.playback.useC13ForH264Streaming) {
+ var adaptiveSourceOpenedEventHandler = this._adaptiveSourceOpened.bind(this);
+ MSEPlatform.Playback.VideoPlayer._adaptiveSourceManager.addEventListener("adaptivesourceopenedevent", adaptiveSourceOpenedEventHandler);
+ this._unhookEventHandlers = function _unhookEventHandlers() {
+ MSEPlatform.Playback.VideoPlayer._adaptiveSourceManager.removeEventListener("adaptivesourceopenedevent", adaptiveSourceOpenedEventHandler);
+ if (this._adaptiveStreamingEvents) {
+ this._adaptiveStreamingEvents.cancel();
+ this._adaptiveStreamingEvents = null
+ }
+ };
+ this._reporter = new Microsoft.Entertainment.Platform.Playback.SmoothStreamingPlaybackReporter;
+ this._reporter.setMainAttribute("URL", mediaInstance.source);
+ if (this._urlRetryMap)
+ this._urlRetryMap = {}
+ }
+ else if ((MS.Entertainment.Utilities.isVideoApp2 || MS.Entertainment.Utilities.isMusicApp2) && !MS.Entertainment.isAppModeOverride) {
+ var smoothStreamingSessionCreatedEventHandler = this._smoothStreamingSessionCreated.bind(this);
+ var resourceAvailabilityChanged = this._resourceAvailabilityChanged.bind(this);
+ MSEPlatform.Playback.VideoPlayer._smoothStreamingSessionManager.addEventListener("sessioncreated", smoothStreamingSessionCreatedEventHandler);
+ Windows.Xbox.ApplicationModel.ApplicationResourceLimits.addEventListener("resourceavailabilitychanged", resourceAvailabilityChanged);
+ this._unhookEventHandlers = function _unhookEventHandlers() {
+ MSEPlatform.Playback.VideoPlayer._smoothStreamingSessionManager.removeEventListener("sessioncreated", smoothStreamingSessionCreatedEventHandler);
+ Windows.Xbox.ApplicationModel.ApplicationResourceLimits.removeEventListener("resourceavailabilitychanged", resourceAvailabilityChanged)
+ }
+ }
+ if (configurationManager)
+ this._startBitrate = configurationManager.playback.defaultStartBitrate
+ }
+ MSEPlatform.Playback.VideoPlayer.registerByteStreamHandlerForURL(mediaInstance.source, mediaInstance.videoEncoding);
+ this._tagPlayer.videoEncoding = mediaInstance.videoEncoding;
+ if (mediaInstance.protectionState !== MSEPlatform.Playback.ProtectionState.unprotected)
+ this.configureDRM();
+ var deviceRegistrationCheckPromise = WinJS.Promise.as();
+ if (mediaInstance.isLocal && (mediaInstance.protectionState === MSEPlatform.Playback.ProtectionState.drmProtected || MS.Entertainment.Utilities.isLocalMarketplaceVideo(mediaInstance)))
+ deviceRegistrationCheckPromise = this._registerDeviceAsync();
+ deviceRegistrationCheckPromise.done(function setSource() {
+ this._setSourceFromMediaInstance()
+ }.bind(this), function registerDevice_Failed(error) {
+ var that = this;
+ WinJS.Promise.timeout().then(function notifyDeviceRegistrationFailure() {
+ MSEPlatform.Playback.MediaPlayer._fireTagPlaybackError(that, error.code, "VideoPlayer_registerDeviceAsync")
+ }.bind(this))
+ }.bind(this))
+ }, {
+ dispose: function VideoPlayer_dispose() {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::dispose: Disposing video player");
+ this._unhookEventHandlers();
+ if (this._tagPlayer.videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264) {
+ var that = this;
+ this._flushTelemetryBuffer();
+ this._reporter = null;
+ this._urlRetryMap = {};
+ this.videoStreamStatistics = null;
+ WinJS.Promise.timeout(1000).then(function() {
+ MSEPlatform.Playback.MediaPlayer.prototype.dispose.call(that)
+ })
+ }
+ else {
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride && this._smoothStreamingSession)
+ if (!this._isConstrained)
+ try {
+ var lastBitrate = this._smoothStreamingSession.currentBitrate;
+ if (lastBitrate > 0) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::dispose: Updating recorded last bitrate seen = " + lastBitrate);
+ MSEPlatform.Playback.VideoPlayer.lastBitrateUnconstrained = lastBitrate;
+ Windows.Storage.ApplicationData.current.localSettings.values[MSEPlatform.Playback.VideoPlayer.lastBitrateUnconstrainedKey] = lastBitrate
+ }
+ }
+ catch(e) {}
+ MSEPlatform.Playback.MediaPlayer.prototype.dispose.call(this)
+ }
+ }, _unhookEventHandlers: function VideoPlayer_unhookEventHandlers() {
+ return
+ }, _registerDeviceAsync: function VideoPlayer_registerDeviceAsync() {
+ function waitForSignIn() {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (signInService.isSignedIn)
+ return WinJS.Promise.wrap();
+ else if (signInService.isSigningIn)
+ return new WinJS.Promise(function(c, e, p) {
+ function onIsSigningInChanged(newValue, oldValue) {
+ if (!newValue) {
+ signInService.unbind("isSigningIn", onIsSigningInChanged);
+ if (signInService.isSignedIn)
+ c();
+ else
+ e("sign in failed or canceled")
+ }
+ }
+ signInService.bind("isSigningIn", onIsSigningInChanged)
+ });
+ else
+ return WinJS.Promise.wrapError(MSEPlatform.Playback.Error.ZEST_E_SIGNIN_REQUIRED)
+ }
+ if (DeviceGroup.DeviceGroupManagement.getDeviceRegisterationStatus() === DeviceGroup.DeviceRegisterationStatus.registered)
+ return WinJS.Promise.as();
+ else
+ return waitForSignIn().then(function signin_Complete() {
+ return DeviceGroup.DeviceGroupManagement.registerDeviceAsync(true).then(function registerDevice_Completed(deviceAssociationResult) {
+ if (deviceAssociationResult.result === DeviceGroup.Result.succeeded)
+ return WinJS.Promise.as();
+ else {
+ MSEPlatform.Playback.Etw.traceString("DeviceGroup:RegisterDeviceAsync registration not successful. Code: " + deviceAssociationResult.errorCode);
+ MS.Entertainment.Utilities.Telemetry.logDeviceGroupAction("DeviceGroup:RegisterDeviceAsync registration not successful", deviceAssociationResult.errorCode);
+ var playbackError = MSEPlatform.Playback.makePlaybackError(deviceAssociationResult.errorCode, "DeviceGroup", JSON.stringify(deviceAssociationResult));
+ return WinJS.Promise.wrapError(playbackError)
+ }
+ }, function registerDevice_Failed(errorResult) {
+ MSEPlatform.Playback.Etw.traceString("DeviceGroup:RegisterDeviceAsync failed. Code: " + JSON.stringify(errorResult));
+ MS.Entertainment.Utilities.Telemetry.logDeviceGroupAction("DeviceGroup:RegisterDeviceAsync registration not successful", errorResult.number);
+ var playbackError = MSEPlatform.Playback.makePlaybackError(MS.Entertainment.UI.DeviceGroupErrors.DEVICEGROUP_E_UNEXPECTED, "DeviceGroup", JSON.stringify(errorResult));
+ return WinJS.Promise.wrapError(playbackError)
+ })
+ }, function signin_Failed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, _isConstrained: {get: function VideoPlayer_isConstrained() {
+ return (Windows.Xbox.ApplicationModel.ApplicationResourceLimits.resourceAvailability === Windows.Xbox.ApplicationModel.ResourceAvailability.constrained)
+ }}, _smoothStreamingSessionCreated: function VideoPlayer_smoothStreamingSessionCreated(session) {
+ if (session.uri !== this._media.source)
+ return;
+ var Playback = MSEPlatform.Playback;
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_smoothStreamingSessionCreated: Event: smoothstreamingsessioncreated");
+ MS.Entertainment.Platform.assert(this._smoothStreamingSession === null, "_smoothStreamingSessionCreated called while this._smoothStreamingSession was non-null");
+ this._smoothStreamingSession = session;
+ if (Microsoft.Entertainment.Configuration.ConfigurationManager().playback.enableVideo2SmoothStreamingTelemetry && !isBlobUrl(session.uri))
+ try {
+ var reporter = new Microsoft.Entertainment.Platform.Playback.SmoothStreamingPlaybackReporter;
+ session.setReporter(reporter)
+ }
+ catch(e) {
+ MS.Entertainment.Platform.fail("Failed to set session reporter: " + (e && e.message) ? e.message : String.empty, e ? e.number : 0)
+ }
+ try {
+ Playback.VideoPlayer.lastBitrateUnconstrained = Windows.Storage.ApplicationData.current.localSettings.values[Playback.VideoPlayer.lastBitrateUnconstrainedKey]
+ }
+ catch(e) {
+ MS.Entertainment.Platform.fail("Failure to read " + Playback.VideoPlayer.lastBitrateUnconstrainedKey + " from localSettings: " + (e && e.message) ? e.message : "", e ? e.number : 0)
+ }
+ try {
+ if (this._isConstrained)
+ this._smoothStreamingSession.startBitrate = Math.min(this._startBitrate, Playback.VideoPlayer.maxBitrateConstrained);
+ else
+ this._smoothStreamingSession.startBitrate = Playback.VideoPlayer.lastBitrateUnconstrained ? Playback.VideoPlayer.lastBitrateUnconstrained : this._startBitrate
+ }
+ catch(e) {
+ MS.Entertainment.Platform.fail("Exception in _smoothStreamingSessionCreated: " + (e && e.message) ? e.message : 0, e ? e.number : 0)
+ }
+ if (this._smoothStreamingEvents) {
+ this._smoothStreamingEvents.cancel();
+ this._smoothStreamingEvents = null
+ }
+ this._smoothStreamingEvents = MS.Entertainment.Utilities.addEventHandlers(session, {closed: this._smoothStreamingSessionClosed.bind(this)});
+ this._updateSmoothStreamingSessionRates()
+ }, _smoothStreamingSessionClosed: function VideoPlayer_smoothStreamingSessionClosed(evt) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_smoothStreamingSessionClosed: Event: smoothstreamingsessionclosed(" + evt.errorCode + ")");
+ if (this._smoothStreamingEvents) {
+ this._smoothStreamingEvents.cancel();
+ this._smoothStreamingEvents = null
+ }
+ this._smoothStreamingSession = null
+ }, _resourceAvailabilityChanged: function _resourceAvailabilityChanged(evt) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_resourceAvailabilityChanged: Event: resourceavailabilitychanged");
+ var Playback = MSEPlatform.Playback;
+ if (this._smoothStreamingSession && Playback.VideoPlayer.respectConstrainedMode) {
+ this._updateSmoothStreamingSessionRates();
+ try {
+ if (this._isConstrained) {
+ var currentBitrate = this._smoothStreamingSession.currentBitrate;
+ if (currentBitrate > 0) {
+ Playback.VideoPlayer.lastBitrateUnconstrained = currentBitrate;
+ Windows.Storage.ApplicationData.current.localSettings.values[Playback.VideoPlayer.lastBitrateUnconstrainedKey] = currentBitrate
+ }
+ if (currentBitrate > Playback.VideoPlayer.maxBitrateConstrained) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_resourceAvailabilityChanged: Calling RequestBitrateChange(" + Playback.VideoPlayer.maxBitrateConstrained + ", false)");
+ this._smoothStreamingSession.requestBitrateChange(Playback.VideoPlayer.maxBitrateConstrained, true)
+ }
+ }
+ else {
+ var newBitrate = Playback.VideoPlayer.lastBitrateUnconstrained && Playback.VideoPlayer.lastBitrateUnconstrained > 0 ? Playback.VideoPlayer.lastBitrateUnconstrained : this._startBitrate;
+ if (newBitrate > this._smoothStreamingSession.currentBitrate) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_resourceAvailabilityChanged: Calling RequestBitrateChange(" + newBitrate + ", true)");
+ this._smoothStreamingSession.requestBitrateChange(newBitrate, true)
+ }
+ }
+ }
+ catch(e) {
+ MS.Entertainment.Platform.fail("Exception calling requestBitrateChange: " + (e && e.message) ? e.message : 0, e ? e.number : 0)
+ }
+ var positionMs = this.forceTimeUpdate();
+ this.seekToPosition(Math.max(positionMs - 100, 0))
+ }
+ }, _updateSmoothStreamingSessionRates: function VideoPlayer_updateSmoothStreamingSessionRates() {
+ try {
+ var Playback = MSEPlatform.Playback;
+ MS.Entertainment.Platform.assert(this._smoothStreamingSession, "_updateSmoothStreamingSessionRates called while this._smoothStreamingSession was null");
+ if (this._isConstrained) {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_updateSmoothStreamingSessionRates: mode values being applied to this._smoothStreamingSession");
+ this._smoothStreamingSession.maximumBitrate = Playback.VideoPlayer.maxBitrateConstrained;
+ this._smoothStreamingSession.maximumWidth = Playback.VideoPlayer.maxWidthConstrained;
+ this._smoothStreamingSession.maximumHeight = Playback.VideoPlayer.maxHeightConstrained
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_updateSmoothStreamingSessionRates: 'Full' (unconstrained) mode values being applied to this._smoothStreamingSession");
+ this._smoothStreamingSession.maximumBitrate = Playback.VideoPlayer.maxBitrateUnconstrained;
+ this._smoothStreamingSession.maximumWidth = Playback.VideoPlayer.maxWidthUnconstrained;
+ this._smoothStreamingSession.maximumHeight = Playback.VideoPlayer.maxHeightUnconstrained
+ }
+ }
+ catch(e) {
+ MS.Entertainment.Platform.fail("_updateSmoothStreamingSessionRates exception: " + (e && e.message) ? e.message : 0, e ? e.number : 0)
+ }
+ }, _adaptiveSourceOpened: function VideoPlayer_adaptiveSourceOpened(args) {
+ var adaptiveSource = args.adaptiveSource;
+ if (adaptiveSource.uri.absoluteUri !== this._media.source)
+ return;
+ this._adaptiveStreamingEvents = MS.Entertainment.Utilities.addEventHandlers(adaptiveSource, {
+ manifestreadyevent: this._onH264PiffManifestReady.bind(this), adaptivesourcestatusupdatedevent: this._onAdaptiveSourceStatusUpdated.bind(this), adaptivesourcefailedevent: this._onAdaptiveSourceFailed.bind(this)
+ })
+ }, _onH264PiffManifestReady: function VideoPlayer_onH264PiffManifestReady(args) {
+ this._currentH264VideoStream = null;
+ this._h264ChunksDownloaded = 0;
+ function getPreferredAudioStream(availableStreams) {
+ function AudioStreamDescriptor(fourCC, bitrate, index) {
+ this._fourCC = fourCC;
+ this._bitrate = bitrate;
+ this._index = index
+ }
+ function compareAudioStreamDescriptors(descriptorOne, descriptorTwo) {
+ var FourCCCodes = new Array(858604357, 1279476033, 1212367169);
+ if (descriptorOne._fourCC === descriptorTwo._fourCC)
+ return (descriptorTwo._bitrate - descriptorOne._bitrate);
+ else {
+ var fourCCAIndex = FourCCCodes.indexOf(descriptorOne._fourCC);
+ var fourCCBIndex = FourCCCodes.indexOf(descriptorTwo._fourCC);
+ return fourCCAIndex - fourCCBIndex
+ }
+ }
+ var audioStreamDescriptors = new Array;
+ for (var i = 0; i < availableStreams.size; i++)
+ if (availableStreams[i].type === Microsoft.Media.AdaptiveStreaming.MediaStreamType.audio) {
+ var firstTrack = availableStreams[i].availableTracks[0];
+ var fourCC = firstTrack.fourCC;
+ var bitrate = firstTrack.bitrate;
+ audioStreamDescriptors.push(new AudioStreamDescriptor(fourCC, bitrate, i))
+ }
+ var preferredAudioStream = null;
+ if (audioStreamDescriptors.length !== 0) {
+ audioStreamDescriptors.sort(compareAudioStreamDescriptors);
+ preferredAudioStream = availableStreams[audioStreamDescriptors[0]._index]
+ }
+ return preferredAudioStream
+ }
+ function selectVideoTracks(videoStream) {
+ var availableTracks = videoStream.availableTracks;
+ var availableBitrates = availableTracks.map(function getBitrate(track) {
+ if (track.bitrate)
+ return track.bitrate
+ });
+ this._media._mediaItem.data.availableVideoBitrates = availableBitrates;
+ var selectedVideoTracks = [];
+ for (var i = 0; i < availableTracks.size; i++)
+ if (availableTracks[i].maxWidth <= MSEPlatform.Playback.VideoPlayer.maxWidthUnconstrained && availableTracks[i].maxHeight <= MSEPlatform.Playback.VideoPlayer.maxHeightUnconstrained)
+ selectedVideoTracks.push(availableTracks[i]);
+ MS.Entertainment.Platform.Playback.assert(selectedVideoTracks.length > 0, "Video stream has no tracks available!");
+ videoStream.restrictTracks(selectedVideoTracks);
+ var topBitrate = 0;
+ for (var i = 0; i < selectedVideoTracks.length; i++)
+ if (selectedVideoTracks[i].bitrate >= topBitrate)
+ topBitrate = selectedVideoTracks[i].bitrate;
+ var startingVideoTracks = [];
+ var startingBitrate = Math.min(topBitrate, this._startBitrate);
+ for (var i = 0; i < selectedVideoTracks.length; i++)
+ if (selectedVideoTracks[i].bitrate >= startingBitrate)
+ startingVideoTracks.push(selectedVideoTracks[i]);
+ MS.Entertainment.Platform.Playback.assert(startingVideoTracks.length > 0, "Video stream has no tracks which can be selected!");
+ videoStream.selectTracks(startingVideoTracks)
+ }
+ function getPreferredVideoStream(availableStreams) {
+ var firstVideoStream = null;
+ for (var i = 0; i < availableStreams.size; i++)
+ if (availableStreams[i].type === Microsoft.Media.AdaptiveStreaming.MediaStreamType.video) {
+ firstVideoStream = availableStreams[i];
+ break
+ }
+ if (firstVideoStream)
+ selectVideoTracks.call(this, firstVideoStream);
+ return firstVideoStream
+ }
+ var manifest = args.adaptiveSource.manifest;
+ var availableStreams = manifest.availableStreams;
+ var selectedStreams = new Array;
+ var preferredAudioStream = getPreferredAudioStream(availableStreams);
+ if (preferredAudioStream) {
+ selectedStreams.push(preferredAudioStream);
+ var preferredVideoStream = getPreferredVideoStream.call(this, availableStreams);
+ if (preferredVideoStream) {
+ selectedStreams.push(preferredVideoStream);
+ manifest.selectStreamsAsync(selectedStreams);
+ this._currentH264VideoStream = preferredVideoStream
+ }
+ }
+ this._initializeVideoStreamStats(preferredVideoStream, preferredAudioStream)
+ }, _initializeVideoStreamStats: function VideoPlayer_initializeVideoStreamStats(preferredVideoStream, preferredAudioStream) {
+ this.videoStreamStatistics = {
+ history: [], failureEvents: [], maxVideoBitrate: 0, maxWidth: 0, maxHeight: 0, videoCodec: FourCCMap.Unknown, audioCodec: FourCCMap.Unknown
+ };
+ for (var i = 0; i < preferredVideoStream.availableTracks.length; i++) {
+ this.videoStreamStatistics.maxVideoBitrate = Math.max(preferredVideoStream.availableTracks[i].bitrate, this.videoStreamStatistics.maxVideoBitrate);
+ this.videoStreamStatistics.maxWidth = Math.max(preferredVideoStream.availableTracks[i].maxWidth, this.videoStreamStatistics.maxWidth);
+ this.videoStreamStatistics.maxHeight = Math.max(preferredVideoStream.availableTracks[i].maxHeight, this.videoStreamStatistics.maxHeight)
+ }
+ this.videoStreamStatistics.videoCodec = FourCCMap[preferredVideoStream.availableTracks[0].fourCC] || FourCCMap.Unknown;
+ this.videoStreamStatistics.audioCodec = FourCCMap[preferredAudioStream.availableTracks[0].fourCC] || FourCCMap.Unknown
+ }, _addVideoStreamFailureStats: function VideoPlayer_addVideoStreamFailureStats(stat)
+ {
+ if (this.videoStreamStatistics) {
+ var MAX_STREAM_FAILURE_ENTRIES = 30;
+ this.videoStreamStatistics.failureEvents.unshift(stat);
+ this.videoStreamStatistics.failureEvents.splice(MAX_STREAM_FAILURE_ENTRIES)
+ }
+ }, _addVideoStreamHistoryStats: function VideoPlayer_addVideoStreamHistoryStats(stat)
+ {
+ function ageOutHistoryBuffers(buffers, positionHNS, maxAgeHNS) {
+ if (!buffers)
+ return;
+ var prevHist = null;
+ for (var i = 0; i < buffers.length; i++) {
+ var hist = buffers[i];
+ if (hist.hnsStartTime < (positionHNS - maxAgeHNS))
+ buffers.splice(i);
+ if (prevHist)
+ if ((prevHist.hnsStartTime - hist.hnsStartTime) <= 0)
+ buffers.splice(i);
+ prevHist = hist
+ }
+ }
+ if (this.videoStreamStatistics) {
+ var MAX_STREAM_HISTORY_HNS = 600000000;
+ this.videoStreamStatistics.history.unshift(stat);
+ ageOutHistoryBuffers(this.videoStreamStatistics.history, this.forceTimeUpdate() * 10000, MAX_STREAM_HISTORY_HNS)
+ }
+ }, _onAdaptiveSourceStatusUpdated: function VideoPlayer_onAdaptiveSourceStatusUpdated(args) {
+ function populateUrlRetryMap(urlInfo) {
+ if (urlInfo)
+ if (this._urlRetryMap[urlInfo])
+ this._urlRetryMap[urlInfo]++;
+ else
+ this._urlRetryMap[urlInfo] = 1
+ }
+ if (args)
+ switch (args.updateType) {
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkDownloaded:
+ this._h264ChunksDownloaded++;
+ if (this._h264ChunksDownloaded === this._h264ChunksDownloadedThreshold && this._currentH264VideoStream)
+ this._currentH264VideoStream.selectTracks(this._currentH264VideoStream.availableTracks);
+ this._reportChunkDownloaded(args);
+ if ((this._h264ChunksDownloaded % 20) === 0 && this._reporter)
+ this._reporter.sendLogAsync("Report", false);
+ break;
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.rebuffer:
+ if (this._reporter) {
+ this._reporter.reportBuffering();
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceStatusUpdated: Rebuffering")
+ }
+ this._addVideoStreamFailureStats({
+ hnsTime: this.forceTimeUpdate() * HNS_PER_MILLISECOND, info: "Rebuffering due to poor network conditions"
+ });
+ break;
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkConnectHttpInvalid:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.nextChunkHttpInvalid:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkHdrHttpInvalid:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType.chunkHdrError:
+ populateUrlRetryMap.call(this, args.additionalInfo);
+ var responseValue = args.httpResponse ? args.httpResponse.toString() : "None";
+ var hresult = args.result ? args.result.toString() : "None";
+ var chunkUrl = args.additionalInfo || string.empty;
+ var errorString = enumToString(args.updateType, Microsoft.Media.AdaptiveStreaming.AdaptiveSourceStatusUpdateType) + "_" + responseValue + "_" + hresult;
+ if (this._reporter) {
+ this._reporter.setSubAttribute("hr", errorString);
+ this._reporter.setSubAttribute("ChunkUrl", chunkUrl);
+ this._reporter.sendLogAsync("MissingChunk", false);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceStatusUpdated: Missing chunk. Url:" + chunkUrl + " hr:" + errorString)
+ }
+ this._addVideoStreamFailureStats({
+ hnsTime: this.forceTimeUpdate() * HNS_PER_MILLISECOND, info: "Missing chunk: hr=" + errorString
+ });
+ break;
+ default:
+ break
+ }
+ }, _flushTelemetryBuffer: function VideoPlayer_flushTelemetryBuffer() {
+ if (this._reporter) {
+ this._reporter.sendLogAsync("Report", false);
+ this._reporter.sendLogAsync("Close", false)
+ }
+ }, _getTelemetryInfoFromChunkDownloadedArgs: function _getTelemetryInfoFromChunkDownloadedArgs(args) {
+ var TelemetryFields = {
+ chunkIndex: 0, url: 1, mediaStreamType: 2, chunkStartTimeHns: 3, chunkDurationns: 4, chunkBitrate: 5, chunkByteCount: 6, downloadRequestedTimeMs: 7, downloadCompletedTimeMs: 8, chunkPerceivedBandwidth: 9, avgPerceivedBandwidth: 10, bufferLevelAtRequested90kHz: 11, bufferLevelAtCompleted90kHz: 12, responseHeaders: 13
+ };
+ function uint32(val) {
+ var value = +val;
+ return isNaN(value) ? 0 : value
+ }
+ function getChunkIP(responseHeaders) {
+ function convertIPToDecimal(dottedIP) {
+ var decimalIP = 0;
+ var currentMultiplier = 1;
+ var splitIP = dottedIP.split(".");
+ for (var i = 0; i < splitIP.length; i++) {
+ decimalIP += (currentMultiplier * (+splitIP[i]));
+ currentMultiplier *= 256
+ }
+ return decimalIP
+ }
+ var cdnIPPatterns = [/x-cdn-info: \w+_([\d.]+)/, /X-CDN-Info: ([\d.]+)-\w+/, ];
+ for (var i = 0; i < cdnIPPatterns.length; i++) {
+ var matches = cdnIPPatterns[i].exec(responseHeaders);
+ if (matches && matches.length > 1)
+ return convertIPToDecimal(matches[1])
+ }
+ return 0
+ }
+ var BUFFER_UNITS_90KHZ_TO_HNS = (1 / 90) * HNS_PER_MILLISECOND;
+ var additionalInfo = args.additionalInfo.split(";");
+ var info = {};
+ info.chunkId = uint32(additionalInfo[TelemetryFields.chunkIndex]);
+ info.url = additionalInfo[TelemetryFields.url];
+ info.bitrate = uint32(additionalInfo[TelemetryFields.chunkBitrate]);
+ info.startTickMs = uint32(additionalInfo[TelemetryFields.downloadRequestedTimeMs]);
+ info.openedTickMs = uint32(additionalInfo[TelemetryFields.downloadRequestedTimeMs]);
+ info.completedTicksMs = uint32(additionalInfo[TelemetryFields.downloadCompletedTimeMs]);
+ info.sizeInBytes = uint32(additionalInfo[TelemetryFields.chunkByteCount]);
+ info.hnsStartTime = uint32(additionalInfo[TelemetryFields.chunkStartTimeHns]);
+ info.avgBandwidth = uint32(additionalInfo[TelemetryFields.avgPerceivedBandwidth]);
+ info.lastBandwidth = uint32(additionalInfo[TelemetryFields.chunkPerceivedBandwidth]);
+ info.hnsBuffer = uint32(additionalInfo[TelemetryFields.bufferLevelAtCompleted90kHz]) * BUFFER_UNITS_90KHZ_TO_HNS;
+ info.isVideo = uint32(additionalInfo[TelemetryFields.mediaStreamType]) === 1;
+ info.chunkIP = getChunkIP(additionalInfo[TelemetryFields.responseHeaders]);
+ info.chunkStartTimeHns = uint32(additionalInfo[TelemetryFields.chunkStartTimeHns]);
+ return info
+ }, _reportChunkDownloaded: function VideoPlayer_reportChunkDownloaded(args) {
+ var info = this._getTelemetryInfoFromChunkDownloadedArgs(args);
+ var bitrateIndex = 0;
+ var width = 0;
+ var height = 0;
+ if (info.isVideo) {
+ this._addVideoStreamHistoryStats(info);
+ if (this._reporter) {
+ if (!this._urlRetryMap[info.url])
+ this._reporter.setMainAttribute("DownloadRetries", "0");
+ else
+ this._reporter.setMainAttribute("DownloadRetries", this._urlRetryMap[info.url].toString());
+ for (var i = 0; i < this._currentH264VideoStream.availableTracks.length; i++)
+ if (this._currentH264VideoStream.availableTracks[i].bitrate === info.bitrate) {
+ bitrateIndex = this._currentH264VideoStream.availableTracks[i].trackIndex;
+ width = this._currentH264VideoStream.availableTracks[i].maxWidth;
+ height = this._currentH264VideoStream.availableTracks[i].maxHeight
+ }
+ this._reporter.addChunkInfo(bitrateIndex, info.bitrate, width, height);
+ this._reporter.addChunkHistory(info.chunkId, info.bitrate, info.bitrateIndex, info.hnsBuffer, info.avgBandwidth, info.lastBandwidth);
+ this._reporter.addDownloadData(info.startTickMs, info.openedTickMs, info.completedTicksMs, info.sizeInBytes, info.hnsStartTime, info.bitrate);
+ this._reporter.addChunkIP(info.chunkStartTimeHns, info.chunkIP)
+ }
+ }
+ }, selectVideoBitrate: function selectVideoBitrate(requestedBitrate) {
+ if (this._currentH264VideoStream) {
+ if (requestedBitrate) {
+ var requestedVideoTrack = [];
+ for (var i = 0; i < this._currentH264VideoStream.availableTracks.length; i++)
+ if (this._currentH264VideoStream.availableTracks[i].bitrate === +requestedBitrate) {
+ requestedVideoTrack.push(this._currentH264VideoStream.availableTracks[i]);
+ break
+ }
+ MS.Entertainment.Platform.Playback.assert(requestedVideoTrack.length > 0, "Video stream has no tracks with matching bitrate!");
+ if (requestedVideoTrack.length > 0)
+ this._currentH264VideoStream.selectTracks(requestedVideoTrack)
+ }
+ else
+ this._currentH264VideoStream.selectTracks(this._currentH264VideoStream.availableTracks);
+ var positionMs = this.forceTimeUpdate();
+ this.seekToPosition(Math.max(positionMs - 100, 0));
+ if (this.videoStreamStatistics && this.videoStreamStatistics.history)
+ this.videoStreamStatistics.history.length = 0
+ }
+ }, _onAdaptiveSourceFailed: function _onAdaptiveSourceFailed(args) {
+ if (this._reporter && args) {
+ var httpResponse = args.httpResponse ? args.httpResponse.toString() : "None";
+ var hresult = args.result ? args.result.toString() : "None";
+ var errorState = enumToString(args.failType, Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType) + "_" + httpResponse + "_" + hresult;
+ switch (args.failType) {
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestParseFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestVersionUnsupported:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestHttpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.manifestInvalid:
+ this._reporter.setSubAttribute("hr", errorState);
+ this._reporter.sendLogAsync("CorruptedManifest", true);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceFailed: Corrupted Manifest. hr:" + errorState);
+ break;
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpRecvFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpParseResponseFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpTooManyRedirect:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpRedirectFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpRedirectNotAllowed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpCreateFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpOpenFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.httpSendFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkConnectHttpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkNextHttpInvalidResult:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkHdrParseFailed:
+ case Microsoft.Media.AdaptiveStreaming.AdaptiveSourceFailedType.chunkInvalidData:
+ this.retryableError = true;
+ default:
+ this._reporter.setSubAttribute("hr", errorState);
+ this._reporter.sendLogAsync("Error", true);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_onAdaptiveSourceFailed: Error. hr:" + errorState)
+ }
+ }
+ }, getAudioTracks: function VideoPlayer_getAudioTracks() {
+ MSEPlatform.Playback.assert(this._tagPlayer);
+ return this._tagPlayer.audioTracks
+ }, getSelectedAudioTrack: function VideoPlayer_getSelectedAudioTrack() {
+ var selectedAudioTrack = -1;
+ for (var i = 0; i < this._tagPlayer.audioTracks.length; i++)
+ if (this._tagPlayer.audioTracks[i].enabled) {
+ selectedAudioTrack = i;
+ break
+ }
+ return selectedAudioTrack
+ }, selectAudioTrack: function VideoPlayer_selectAudioTrack(trackIndex) {
+ if (trackIndex === +trackIndex && trackIndex >= 0 && trackIndex < this._tagPlayer.audioTracks.length) {
+ this._tagPlayer.audioTracks[trackIndex].enabled = true;
+ for (var i = 0; i < this._tagPlayer.audioTracks.length; i++)
+ if (i !== trackIndex && this._tagPlayer.audioTracks[i].enabled)
+ this._tagPlayer.audioTracks[i].enabled = false
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::selectAudioTrack failed. Must provide a valid track index. Track index: " + trackIndex)
+ }, _smoothStreamingSession: null, _smoothStreamingEvents: null, _startBitrate: 2 * 1024 * 1024, _reporter: null, _adaptiveStreamingEvents: null, _currentH264VideoStream: null, _currentlyRegisteredByteStreamHandler: null, _h264ChunksDownloaded: 0, _h264ChunksDownloadedThreshold: 5, _urlRetryMap: {}, videoStreamStatistics: null, retryableError: false
+ }, {
+ initializeVideoExtensions: function VideoPlayer_initializeVideoExtensions() {
+ if (!MS.Entertainment.Utilities.isAmsterdamApp && (MS.Entertainment.Utilities.isVideoApp1 || MS.Entertainment.Utilities.isApp2 || MS.Entertainment.Utilities.isTestApp)) {
+ this._extensionManager = new Windows.Media.MediaExtensionManager;
+ this._adaptiveSourceManager = Microsoft.Media.AdaptiveStreaming.AdaptiveSourceManager.getDefault();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager && this._adaptiveSourceManager) {
+ this._adaptiveSourceManager.sendExtendedCommand("heuristichealthybufferpercent", String(configurationManager.playback.h264StreamingHealthyBufferPercentage));
+ this._adaptiveSourceManager.sendExtendedCommand("httpwaitentireresponse", String(configurationManager.playback.h264StreamingSendSamplesAfterDownloadCompletes));
+ this._adaptiveSourceManager.setDownloadBufferSec(configurationManager.playback.h264StreamingDownloadBufferSizeSecs)
+ }
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride) {
+ this._smoothStreamingSessionManager = new Windows.Xbox.Media.SmoothStreamingSessionManager;
+ if (configurationManager) {
+ this.maxBitrateConstrained = configurationManager.playback.maxBitrateConstrained;
+ this.maxWidthConstrained = configurationManager.playback.maxWidthConstrained;
+ this.maxHeightConstrained = configurationManager.playback.maxHeightConstrained;
+ this.respectConstrainedMode = configurationManager.playback.respectConstrainedMode
+ }
+ }
+ }
+ if (MS.Entertainment.Utilities.isVideoApp1 && !MS.Entertainment.Utilities.isWindowsBlue)
+ this._extensionManager.registerByteStreamHandler("Microsoft.Entertainment.Platform.Playback.CFFByteStreamHandler", ".mp4", String.empty);
+ if (MS.Entertainment.Utilities.isVideoApp1 && MS.Entertainment.Utilities.isWindowsBlue)
+ this._extensionManager.registerByteStreamHandler("Microsoft.Entertainment.Platform.Playback.MkvMfByteStreamHandler", ".mkv", String.empty)
+ }, registerByteStreamHandlerForURL: function VideoPlayer_registerByteStreamHandlerForURL(url, videoEncoding) {
+ if (!isBlobUrl(url) && (MS.Entertainment.Utilities.isVideoApp1 || MS.Entertainment.Utilities.isApp2 || MS.Entertainment.Utilities.isTestApp) && !MS.Entertainment.Utilities.isAmsterdamApp) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var isH264 = (videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264);
+ if (isH264 && !configurationManager.playback.useC13ForH264Streaming) {
+ if (this._currentlyRegisteredByteStreamHandler !== this.VideoStreamFormat.H264) {
+ this._currentlyRegisteredByteStreamHandler = this.VideoStreamFormat.H264;
+ var ps = new Windows.Foundation.Collections.PropertySet;
+ ps.insert("{A5CE1DE8-1D00-427B-ACEF-FB9A3C93DE2D}", this._adaptiveSourceManager);
+ this._extensionManager.registerByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", "", "text/xml", ps);
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_registerByteStreamHandlerForURL: Registered H.264 bytestream handler. Url:" + url)
+ }
+ }
+ else if (this._currentlyRegisteredByteStreamHandler !== this.VideoStreamFormat.VC1) {
+ this._currentlyRegisteredByteStreamHandler = this.VideoStreamFormat.VC1;
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride) {
+ var ps = new Windows.Foundation.Collections.PropertySet;
+ ps.insert("SmoothStreamingSessionManager", this._smoothStreamingSessionManager);
+ this._extensionManager.registerByteStreamHandler("Windows.Xbox.Media.SmoothStreamingByteStreamHandler", "", "text/xml", ps)
+ }
+ else {
+ this._extensionManager.registerByteStreamHandler("Microsoft.Entertainment.Platform.Playback.MBRByteStreamHandler", "", "text/xml");
+ if (isH264 && configurationManager.playback.useC13ForH264Streaming)
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_registerByteStreamHandlerForURL: Using MBRByteStreamHandler for H.264 streaming!")
+ }
+ MSEPlatform.Playback.Etw.traceString("VideoPlayer::_registerByteStreamHandlerForURL: Registered VC-1 bytestream handler. Url:" + url)
+ }
+ }
+ }, maxWidthUnconstrained: {get: function maxWidthUnconstrained_get() {
+ return (MS.Entertainment.Utilities.isApp1 && !MS.Entertainment.Utilities.isWindowsBlue) ? 1366 : 1920
+ }}, maxHeightUnconstrained: {get: function maxHeightUnconstrained_get() {
+ return (MS.Entertainment.Utilities.isApp1 && !MS.Entertainment.Utilities.isWindowsBlue) ? 768 : 1080
+ }}, maxWidthConstrained: 1920, maxHeightConstrained: 720, maxBitrateConstrained: 850000, maxBitrateUnconstrained: 4294967295, respectConstrainedMode: true, lastBitrateUnconstrained: 0, lastBitrateUnconstrainedKey: "VideoPlayer._lastBitrateUnconstrained", VideoStreamFormat: {
+ H264: "H264", VC1: "VC1"
+ }, _smoothStreamingSessionManager: null, _adaptiveSourceManager: null, _extensionManager: null, _currentlyRegisteredByteStreamHandler: null
+ })
+ })
+})()
+})();
+/* >>>>>>/components/playback/mediainstance.js:1647 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {MediaInstance: MS.Entertainment.UI.Framework.define(function MediaInstance_constructor(mediaObject) {
+ this._initialize(mediaObject)
+ }, {
+ source: String.empty, acquisitionData: null, alternateSource: null, mediaType: -1, protectionState: MS.Entertainment.Platform.Playback.ProtectionState.unknown, startPosition: 0, cookie: 1, isLocal: false, playlogEnabled: true, trackingId: String.empty, isAudioAd: false, isPreview: false, inCollection: false, inCloudCollectionV2: false, fromCollection: false, licenseKeyId: null, signedLicensePolicyTicket: null, serviceId: null, duration: null, videoAdSupported: false, videoEncoding: Microsoft.Entertainment.Marketplace.VideoEncoding.unknown, alternateVideoEncoding: null, _bookmark: 0, _played: false, _playcount: 0, _mediaItem: null, _provider: null, _errorDescriptor: null, _initializedPromise: null, _mediaStore: null, _bookmarkWatcher: null, _initialize: function MediaInstance_initialize(mediaObject) {
+ var that = this;
+ var playFromBookmark = true;
+ if (mediaObject) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (mediaObject.hasOwnProperty("source")) {
+ var source = mediaObject["source"];
+ var manifestHint = /_51.ism\/manifest/i;
+ if (source && source.toString().match(manifestHint) && !MS.Entertainment.Utilities.isVideoApp2) {
+ this["alternateSource"] = source;
+ this["source"] = source.toString().replace(manifestHint, "_ST.ism/manifest")
+ }
+ else
+ this["source"] = source
+ }
+ if (mediaObject.hasOwnProperty("mediaType"))
+ this["mediaType"] = mediaObject["mediaType"];
+ if (mediaObject.hasOwnProperty("startPosition") && mediaObject["startPosition"]) {
+ this["startPosition"] = mediaObject["startPosition"];
+ playFromBookmark = false
+ }
+ if (mediaObject.hasOwnProperty("cookie"))
+ this["cookie"] = mediaObject["cookie"];
+ this["isPreview"] = false;
+ if (mediaObject.hasOwnProperty("mediaItem")) {
+ this["_mediaItem"] = mediaObject["mediaItem"];
+ if (this._mediaItem && this._mediaItem.acquisitionData)
+ this["acquisitionData"] = this._mediaItem.acquisitionData;
+ if (this._mediaItem && this._mediaItem.data) {
+ if (this._mediaItem.data.libraryId)
+ this["libraryId"] = this._mediaItem.data.libraryId;
+ if (this._mediaItem.data.playPreviewOnly) {
+ this["playlogEnabled"] = false;
+ this["isPreview"] = true
+ }
+ if (this._mediaItem.data.playlistId && this._mediaItem.data.playlistId >= 0) {
+ this["containerLibraryId"] = this._mediaItem.data.playlistId;
+ this["containerMediaType"] = Microsoft.Entertainment.Queries.ObjectType.playlist
+ }
+ else if (this._mediaItem.data.albumId) {
+ this["containerLibraryId"] = this._mediaItem.data.albumId;
+ this["containerMediaType"] = Microsoft.Entertainment.Queries.ObjectType.album
+ }
+ if (this._mediaItem.data.inCollection)
+ this["inCollection"] = this._mediaItem.data.inCollection;
+ if (this._mediaItem.data.inCloudCollectionV2)
+ this["inCloudCollectionV2"] = this._mediaItem.data.inCloudCollectionV2;
+ if (this._mediaItem.data.duration)
+ this["duration"] = this._mediaItem.data.duration;
+ if (this._mediaItem.data.serviceId)
+ this["serviceId"] = this._mediaItem.data.serviceId;
+ if (this._mediaItem.data.fromCollection)
+ this["fromCollection"] = this._mediaItem.data.fromCollection
+ }
+ }
+ if (mediaObject.hasOwnProperty("mediaInstanceId"))
+ this["mediaInstanceId"] = mediaObject["mediaInstanceId"];
+ if (mediaObject.hasOwnProperty("licenseKeyId"))
+ this["licenseKeyId"] = mediaObject["licenseKeyId"];
+ if (mediaObject.hasOwnProperty("signedLicensePolicyTicket"))
+ this["signedLicensePolicyTicket"] = mediaObject["signedLicensePolicyTicket"];
+ if (mediaObject.hasOwnProperty("nativeLicenseRight"))
+ this["nativeLicenseRight"] = mediaObject["nativeLicenseRight"];
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var freeVideoWithAds = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoFreeWithAds);
+ if (mediaObject.hasOwnProperty("offerId")) {
+ this["offerId"] = mediaObject["offerId"];
+ var offerId = mediaObject["offerId"];
+ if (freeVideoWithAds && offerId && configurationManager.video.offerIdsVideoFreeWithAds) {
+ MS.Entertainment.Platform.Playback.assert(offerId.length > 3, "OfferId is invalid.");
+ offerId = offerId.substr(1, offerId.length - 2).toLowerCase();
+ var freeOfferWithAds = configurationManager.video.offerIdsVideoFreeWithAds.split(',');
+ for (var count = 0; count < freeOfferWithAds.length; count++)
+ if (offerId === freeOfferWithAds[count].toLowerCase()) {
+ this.videoAdSupported = true;
+ break
+ }
+ }
+ }
+ if (freeVideoWithAds && configurationManager.video.playVideoFreeWithAds)
+ this.videoAdSupported = true;
+ if (mediaObject.hasOwnProperty("libraryId"))
+ this["libraryId"] = mediaObject["libraryId"];
+ if (mediaObject.hasOwnProperty("isLocal"))
+ this["isLocal"] = mediaObject["isLocal"];
+ else if (this._mediaItem && this._mediaItem.data)
+ this["isLocal"] = this._mediaItem.data.canPlayLocally ? true : false;
+ if (mediaObject.hasOwnProperty("error"))
+ this["_errorDescriptor"] = mediaObject["error"];
+ if (mediaObject.hasOwnProperty("trackingId") && !!mediaObject.trackingId)
+ this["trackingId"] = mediaObject["trackingId"];
+ if (mediaObject.hasOwnProperty("isAudioAd"))
+ this["isAudioAd"] = mediaObject["isAudioAd"];
+ if (mediaObject.hasOwnProperty("protectionState"))
+ this["protectionState"] = mediaObject["protectionState"];
+ if (mediaObject.hasOwnProperty("videoEncoding")) {
+ this["videoEncoding"] = mediaObject["videoEncoding"];
+ this["alternateVideoEncoding"] = null
+ }
+ else if (this.isVideo() && this.isPreview) {
+ this["videoEncoding"] = Microsoft.Entertainment.Marketplace.VideoEncoding.h264;
+ this["alternateVideoEncoding"] = Microsoft.Entertainment.Marketplace.VideoEncoding.vc1
+ }
+ var protectionState = this["protectionState"];
+ if (this.isLocal && this.isMusicTrack() && (protectionState === MS.Entertainment.Platform.Playback.ProtectionState.drmProtected || protectionState === MS.Entertainment.Platform.Playback.ProtectionState.unknown)) {
+ var isSubscription = configurationManager.service.lastSignedInUserSubscription;
+ if (!isSubscription)
+ if (protectionState === MS.Entertainment.Platform.Playback.ProtectionState.drmProtected) {
+ this["_errorDescriptor"] = {msExtendedCode: MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_FREESTREAMING_NO_RIGHTS.code};
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_constructor : Free-streaming user trying to play protected content, setting error to 0xC1010094")
+ }
+ else if (protectionState === MS.Entertainment.Platform.Playback.ProtectionState.unknown) {
+ this["protectionState"] = MS.Entertainment.Platform.Playback.ProtectionState.unprotected;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_constructor : unknown protection state. We set to unprotected state")
+ }
+ }
+ }
+ this._initializedPromise = this._loadBookmarkAndPlayDataAsync(playFromBookmark);
+ this._maxPositionValueHolder = 0;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ this._ratedContentDescriptionPromise = contentRestrictionService.createRatedContentDescriptionFromMediaItemAsync(this._mediaItem && this._mediaItem.data, MS.Entertainment.Utilities.isMusicApp2)
+ }
+ }, maxPosition: {
+ get: function MediaInstance__position_get() {
+ return this._maxPositionValueHolder
+ }, set: function MediaInstance__position_set(value) {
+ if (value > this._maxPositionValueHolder && !this._remoteTrackingMode)
+ this._maxPositionValueHolder = value
+ }
+ }, _loadBookmarkAndPlayDataAsync: function MediaInstance_loadBookmarkAndPlayDataAsync(playFromBookmark) {
+ var provider = this._getProvider();
+ if (this.playlogEnabled && provider && this.libraryId && this.libraryId > 0) {
+ var getBookmarkAsync = provider.getBookmarkAsync(this.libraryId).then(function success(result) {
+ this._bookmark = result.value;
+ if (playFromBookmark)
+ this.startPosition = this._bookmark;
+ return WinJS.Promise.wrap()
+ }.bind(this), function error() {
+ this._bookmark = 0;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_loadBookmarkAndPlayDataAsync : Failed to load bookmark");
+ return WinJS.Promise.wrap()
+ }.bind(this));
+ var getPlaycountAsync = provider.getPlaycountAsync(this.libraryId).then(function success(result) {
+ this._playcount = result.value;
+ return WinJS.Promise.wrap()
+ }.bind(this), function error() {
+ this._playcount = 0;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_loadBookmarkAndPlayDataAsync : Failed to load play count");
+ return WinJS.Promise.wrap()
+ }.bind(this));
+ var getPlayedStatusAsync = provider.getPlayedStatusAsync(this.libraryId).then(function success(result) {
+ this._played = result.value;
+ return WinJS.Promise.wrap()
+ }.bind(this), function error() {
+ this._played = 0;
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_loadBookmarkAndPlayDataAsync : Failed to load played status");
+ return WinJS.Promise.wrap()
+ }.bind(this));
+ return WinJS.Promise.join([getBookmarkAsync, getPlaycountAsync, getPlayedStatusAsync]).then(function() {
+ return WinJS.Promise.wrap(this)
+ }.bind(this))
+ }
+ else
+ return WinJS.Promise.wrap(this)
+ }, isEqual: function MediaInstance_isEqual(mediaInstance) {
+ var isSame = false;
+ if (mediaInstance && this.source === mediaInstance.source && this.mediaType === mediaInstance.mediaType && this.protectionState === mediaInstance.protectionState && this.startPosition === mediaInstance.startPosition && this.cookie === mediaInstance.cookie)
+ isSame = true;
+ return isSame
+ }, toString: function MediaInstance_toString() {
+ var mediaString = this.source + " : " + this.mediaType + " : " + this.protectionState + " : " + this.startPosition + " : " + this.cookie;
+ return mediaString
+ }, _getProvider: function _getProvider() {
+ if (!this._mediaStore)
+ this._mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ if (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ return this._mediaStore.videoProvider;
+ else if (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ return this._mediaStore.trackProvider;
+ else
+ return null
+ }, _getContainerProvider: function _getContainerProvider() {
+ if (!this._mediaStore)
+ this._mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ switch (this.containerMediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ return this._mediaStore.albumProvider;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ return this._mediaStore.playlistProvider;
+ default:
+ return null
+ }
+ }, _getBookmarkWatcher: function _getBookmarkWatcher() {
+ if (!this._bookmarkWatcher)
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.bookmarkOperationsWatcher))
+ this._bookmarkWatcher = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.bookmarkOperationsWatcher);
+ return this._bookmarkWatcher
+ }, _getMediaItemProp: function MediaInstance_getMediaItemProp(name, defaultValue, validityCheckFunction) {
+ if (!name || typeof(name) !== "string" || name === String.empty)
+ throw new Error("Invalid property name.");
+ if (!validityCheckFunction || typeof(validityCheckFunction) !== "function")
+ throw new Error("Invalid validity check function.");
+ var result = this[name];
+ if (validityCheckFunction(result))
+ return result;
+ if (this._mediaItem) {
+ var result = this._mediaItem[name];
+ if (validityCheckFunction(result))
+ return result;
+ if (this._mediaItem.data) {
+ var result = this._mediaItem.data[name];
+ if (validityCheckFunction(result))
+ return result
+ }
+ }
+ return defaultValue
+ }, isMovie: function MediaInstance_isMovie() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && this._mediaItem.data.videoType === Microsoft.Entertainment.Queries.VideoType.movie);
+ return isType
+ }, isTVEpisode: function MediaInstance_isTVEpisode() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && this._mediaItem.data.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode);
+ return isType
+ }, isVideo: function MediaInstance_isVideo() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ }, isMusicVideo: function MediaInstance_isMusicVideo() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && this._mediaItem.data.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo);
+ return isType
+ }, isMusicTrack: function MediaInstance_isMusicTrack() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ }, isMusicAlbum: function MediaInstance_isMusicAlbum() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ }, isGame: function MediaInstance_isGame() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.game)
+ }, isArtist: function MediaInstance_isArtist() {
+ var isType = false;
+ if (this._mediaItem)
+ isType = (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.person && this._mediaItem.personType === Microsoft.Entertainment.Queries.PersonType.artist);
+ return isType
+ }, isGenre: function MediaInstance_isGenre() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.genre)
+ }, isPlaylist: function MediaInstance_isPlaylist() {
+ return (this.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist)
+ }, bookmark: {
+ set: function MediaInstance_setBookmark(newValue) {
+ this._bookmark = newValue;
+ if (this.libraryId && this.libraryId > 0) {
+ var provider = this._getProvider();
+ if (provider) {
+ var setBookmarkAsync = provider.setBookmarkAsync(this.libraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogBookmarkSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setBookmarkAsync : Failed to save bookmark")
+ });
+ var bookmarkWatcher = this._getBookmarkWatcher();
+ if (bookmarkWatcher)
+ bookmarkWatcher.registerOperation(setBookmarkAsync)
+ }
+ }
+ }, get: function MediaInstance_getBookmark() {
+ return this._bookmark
+ }
+ }, played: {
+ set: function MediaInstance_setPlayed(newValue) {
+ this._played = newValue;
+ if (this.libraryId && this.libraryId > 0) {
+ var provider = this._getProvider();
+ var containerProvider = this._getContainerProvider();
+ var bookmarkWatcher = this._getBookmarkWatcher();
+ if (provider) {
+ var setPlayedStatusAsync = provider.setPlayedStatusAsync(this.libraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogPlayedSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setPlayedStatusAsync : Failed to save played status")
+ });
+ if (bookmarkWatcher)
+ bookmarkWatcher.registerOperation(setPlayedStatusAsync)
+ }
+ if (containerProvider) {
+ var setPlayedStatusAsync = containerProvider.setPlayedStatusAsync(this.containerLibraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogPlayedSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setPlayedStatusAsync : Failed to save played status on container")
+ });
+ if (bookmarkWatcher)
+ bookmarkWatcher.registerOperation(setPlayedStatusAsync)
+ }
+ }
+ }, get: function MediaInstance_getPlayed() {
+ return this._played
+ }
+ }, playcount: {
+ set: function MediaInstance_setPlaycount(newValue) {
+ this._playcount = newValue;
+ if (this.libraryId && this.libraryId > 0) {
+ var provider = this._getProvider();
+ if (provider)
+ provider.setPlaycountAsync(this.libraryId, newValue).then(function success() {
+ MSEPlatform.Playback.Etw.tracePlaylogPlayCountSave(newValue)
+ }, function error() {
+ MSEPlatform.Playback.Etw.traceString("MediaInstance_setPlaycountAsync : Failed to save play count")
+ })
+ }
+ }, get: function MediaInstance_getPlaycount() {
+ return this._playcount
+ }
+ }, serviceIdSafe: {get: function MediaInstance_getServiceId() {
+ var serviceMediaIdSafe = this._getMediaItemProp("zuneId", MS.Entertainment.Utilities.EMPTY_GUID, function(value) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(value)
+ });
+ if (MS.Entertainment.Utilities.isValidServiceId(serviceMediaIdSafe))
+ return serviceMediaIdSafe;
+ else {
+ serviceMediaIdSafe = this._getMediaItemProp("serviceId", MS.Entertainment.Utilities.EMPTY_GUID, function(value) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(value)
+ });
+ var serviceIdType = this._getMediaItemProp("serviceIdType", "unknown", function(value) {
+ return value === MS.Entertainment.Data.Query.edsIdType.zuneCatalog || value === MS.Entertainment.Data.Query.edsIdType.canonical
+ });
+ if (serviceIdType === MS.Entertainment.Data.Query.edsIdType.zuneCatalog)
+ return serviceMediaIdSafe;
+ else
+ return MS.Entertainment.Utilities.EMPTY_GUID
+ }
+ }}, mediaTypeSafe: {get: function MediaInstance_getMediaTypeSafe() {
+ return this._getMediaItemProp("mediaType", -1, function(value) {
+ return value !== -1
+ })
+ }}, shouldLogToDrmDownloadHistory: {get: function MediaInstance_shouldLogToDownloadHistory() {
+ if (this.nativeLicenseRight !== undefined && this.nativeLicenseRight !== null && this.nativeLicenseRight !== Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.unknownMediaRight)
+ return this.nativeLicenseRight !== Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload;
+ return this.mediaTypeSafe !== Microsoft.Entertainment.Queries.ObjectType.track
+ }}, fillDownloadSubscriptionInfoAsync: function fillDownloadSubscriptionInfoAsync() {
+ if ((!this.mediaInstanceId || MS.Entertainment.Utilities.isEmptyGuid(this.mediaInstanceId)) && this._mediaItem && this.mediaTypeSafe === Microsoft.Entertainment.Queries.ObjectType.track)
+ return MS.Entertainment.Platform.PurchaseHelpers.queryMediaDetailForCacheItemAsync(this._mediaItem, this.mediaTypeSafe).then(function queryMediaDetailForCacheItemAsync_complete(detail) {
+ if (detail.result && detail.result.item && detail.result.item.rights) {
+ var right = MS.Entertainment.Platform.PurchaseHelpers.getPreferredRight(detail.result.item.rights, [Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload]);
+ if (right) {
+ this.mediaInstanceId = right.mediaInstanceId;
+ this.offerId = right.offerId;
+ this.nativeLicenseRight = Microsoft.Entertainment.Marketplace.MarketplaceMediaRights.subscriptionDownload
+ }
+ }
+ }.bind(this));
+ return WinJS.Promise.wrap()
+ }
+ }, {createInstanceAsync: function MediaInstance_CreateInstanceAsync(itemData) {
+ var mediaInstance = new MSEPlatform.Playback.MediaInstance(itemData);
+ return mediaInstance._initializedPromise
+ }})})
+})()
+})();
+/* >>>>>>/components/playback/controls/playbackcontrollervideo.js:2016 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {PlaybackControllerVideo: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.PlaybackController", function PlaybackController_constructor() {
+ MSEPlatform.Playback.PlaybackController.prototype.constructor.call(this)
+ }, {
+ _remapPlaybackError: function _remapPlaybackError(error) {
+ var remappedError = error;
+ if (MS.Entertainment.Utilities.isApp2 && error && error.msExtendedCode === -2147024891)
+ remappedError = MS.Entertainment.Platform.Playback.makePlaybackError(MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_HDMI_OUTPUT_LOST.code, "PlaybackController_handleCurrentMediaError");
+ return remappedError
+ }, _processPlaybackErrorPostMapping: function _processPlaybackErrorPostMapping(error) {
+ this._player.reset();
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped
+ }, _onPlayerEvent: function _onPlayerEvent(event) {
+ MSEPlatform.Playback.PlaybackController.prototype._onPlayerEvent.apply(this, arguments);
+ switch (event.type) {
+ case"playing":
+ this._displayRequestActive();
+ break;
+ case"pause":
+ case"ended":
+ case"error":
+ this._displayRequestRelease();
+ break
+ }
+ }, _displayRequestActive: function _displayRequestActive() {
+ this._sessionMgr.displayRequestActive()
+ }, _displayRequestRelease: function _displayRequestRelease() {
+ this._sessionMgr.displayRequestRelease()
+ }
+ }, {})})
+})()
+})();
+/* >>>>>>/components/playback/controls/playbackcontroller.js:2055 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Platform.Playback");
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ var Playback = WinJS.Namespace.define("MS.Entertainment.Platform.Playback", null);
+ var VideoRetrySkipTimeMs = 2000;
+ WinJS.Namespace.defineWithParent(MSEPlatform, "Playback", {PlaybackController: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function PlaybackController_constructor() {
+ var sessionMgr = null;
+ var eventHandlers = MS.Entertainment.Utilities.addEvents(this, {
+ currentMediaChanged: function currentMediaChanged(e) {
+ var newMedia = e.detail.newValue;
+ var oldMedia = e.detail.oldValue;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::currentMediaChanged: ");
+ this._setMedia(newMedia);
+ if (!sessionMgr && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager))
+ sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (newMedia && sessionMgr)
+ sessionMgr._notifyUpcomingStreaming(!newMedia.isLocal);
+ if (newMedia)
+ this._isVideo = newMedia.isVideo ? newMedia.isVideo() : false
+ }.bind(this), nextMediaChanged: function nextMediaChanged(e) {
+ var newMedia = e.detail.newValue;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::nextMediaChanged: " + (newMedia ? newMedia.source : "null"));
+ if (!!newMedia)
+ MS.Entertainment.Platform.Playback.Etw.tracePlaylistSetNextMedia(newMedia);
+ this._setNextMedia(newMedia)
+ }.bind(this), playerStateChanged: function playerStateChanged(e) {
+ var newState = e.detail.newValue;
+ var oldState = e.detail.oldValue;
+ if (!oldState)
+ oldState = "undefined";
+ MSEPlatform.Playback.Etw.tracePlayerStateChanged(newState, oldState)
+ }, currentTransportStateChanged: function currentTransportStateChanged(e) {
+ var newState = e.detail.newValue;
+ var oldState = e.detail.oldValue;
+ if (!oldState)
+ oldState = "undefined";
+ MSEPlatform.Playback.Etw.traceTransportStateChanged(newState, oldState, this._isVideo)
+ }.bind(this)
+ });
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.bind("currentTransportState", function onCurrentTransportStateChanged() {
+ this._reschedulePrerollCallback()
+ }.bind(this));
+ this._configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._offlineNetworkRequestDelay = this._configManager.playback.offlineNetworkRequestDelay;
+ var observablePromises = {};
+ var lastPlayerStateError = null;
+ this._observableNoLossAssign = function _observableNoLossAssign(name, value) {
+ if (name === "playerState")
+ if (value === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ if (!this._errorDescriptor.isCritical)
+ this._errorDescriptor.isCritical = this._isCriticalError(this._errorDescriptor);
+ if (this._currentMedia)
+ this._errorDescriptor.errorOrdinal = this._currentMedia.cookie;
+ this._observableNoLossAssign("error", this._errorDescriptor);
+ lastPlayerStateError = this._errorDescriptor
+ }
+ else if (lastPlayerStateError) {
+ this._observableNoLossAssign("error", null);
+ lastPlayerStateError = null
+ }
+ if (!observablePromises[name])
+ observablePromises[name] = this.updateAndNotify(name, value);
+ else
+ observablePromises[name] = observablePromises[name].then(function assign() {
+ return this.updateAndNotify(name, value)
+ }.bind(this))
+ };
+ this._observableNoLossAssignAsyncBegin = function _observableNoLossAssignAsyncBegin(name) {
+ var completion;
+ if (observablePromises[name]) {
+ observablePromises[name].cancel();
+ observablePromises[name] = null
+ }
+ observablePromises[name] = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ return {
+ complete: function(value) {
+ if (value)
+ this._observableNoLossAssign(name, value);
+ completion()
+ }.bind(this), cancel: function() {
+ if (observablePromises[name]) {
+ observablePromises[name].cancel();
+ observablePromises[name] = null
+ }
+ }.bind(this)
+ }
+ },
+ this.waitForNoLossAssignmentsComplete = function waitForNoLossAssignmentsComplete() {
+ return WinJS.Promise.join(observablePromises)
+ }
+ }, {
+ dispose: function dispose() {
+ this.reset();
+ this.unbind("currentTransportState");
+ if (this._playerEventHandlers) {
+ this._playerEventHandlers.cancel();
+ this._playerEventHandlers = null
+ }
+ this._player._currentMediaEventsCallback = null
+ }, targetTransportState: {
+ get: function targetTransportState_get() {
+ return this._targetTransportState
+ }, set: function targetTransportState_set(value) {
+ if (!this._isPlayerSet())
+ return;
+ MSEPlatform.Playback.Etw.traceTargetTransportStateSet(value, this.currentTransportState);
+ if (this._isPlayerState(MSEPlatform.Playback.PlayerState.ready)) {
+ if ((this._targetTransportState !== value) || (MS.Entertainment.Platform.Playback.TransportState.playing === value && (this.playbackRate > 1 || this.playbackRate < -1)))
+ this._applyTargetTransportState(value)
+ }
+ else if (this._isPlayerState(MSEPlatform.Playback.PlayerState.error))
+ try {
+ this._applyTargetTransportState(value)
+ }
+ catch(e) {}
+ else
+ this._targetTransportState = value
+ }
+ }, autoPlay: {
+ get: function autoPlay_get() {
+ if (!this._isPlayerSet())
+ return false;
+ return this._player.autoPlay
+ }, set: function autoPlay_set(value) {
+ if (!this._isPlayerSet())
+ return;
+ this._player.autoPlay = value
+ }
+ }, muted: {
+ get: function muted_get() {
+ if (!this._isPlayerSet())
+ return false;
+ return this._player.muted
+ }, set: function muted_set(value) {
+ if (!this._isPlayerSet())
+ return;
+ this._player.muted = value
+ }
+ }, videoEncoding: {get: function videoEncoding_get() {
+ return this.currentMedia ? this.currentMedia.videoEncoding : null
+ }}, videoStreamStatistics: {get: function videoStreamStatistics_get() {
+ if (!this._isPlayerSet())
+ return null;
+ return this._player.videoStreamStatistics
+ }}, _volume: {
+ get: function volume_get() {
+ if (!this._isPlayerSet())
+ return null;
+ return this._player._volume
+ }, set: function volume_set(value) {
+ MS.Entertainment.UI.assert(MS.Entertainment.Utilities.isApp2, "Apply volume directly on the tag should be limited to App2 only");
+ if (!this._isPlayerSet())
+ return;
+ this._player._volume = value
+ }
+ }, seekToPosition: function seekToPosition(positionMsec) {
+ if (!this._isPlayerSet())
+ return;
+ if (positionMsec < 0)
+ positionMsec = 0;
+ if (positionMsec > this.duration)
+ positionMsec = this.duration;
+ if (!this._isPlayerState(MSEPlatform.Playback.PlayerState.ready))
+ this._targetPosition = positionMsec;
+ else {
+ if (this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ MS.Entertainment.Utilities.Telemetry.logPauseHappened(this, this.forceTimeUpdate());
+ MS.Entertainment.Utilities.Telemetry.logPlayHappened(this, positionMsec)
+ }
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var isPlayToReceiverSessionRunning = sessionMgr && sessionMgr.primarySession && sessionMgr.primarySession.isPlayToReceiverSessionRunning;
+ if (!isPlayToReceiverSessionRunning)
+ if ((this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped) && (this._currentMedia && !this._currentMedia.videoAdSupported))
+ this._applyTargetTransportState(MS.Entertainment.Platform.Playback.TransportState.playing);
+ this._player.seekToPosition(positionMsec);
+ if (this.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.playing)
+ this._targetPosition = positionMsec
+ }
+ }, fastFwd: function fastFwd() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.fastFwd()
+ }, fastReverse: function fastReverse() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.rewind()
+ }, slowFwd: function slowFwd() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.slowFwd()
+ }, slowReverse: function slowReverse() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.slowRewind()
+ }, selectVideoBitrate: function selectVideoBitrate(requestedBitrate) {
+ if (!this._isPlayerSet())
+ return;
+ this.currentRequestedBitrate = +requestedBitrate;
+ this._player.selectVideoBitrate(requestedBitrate)
+ }, getAudioTracks: function getAudioTracks() {
+ if (!this._isPlayerSet())
+ return;
+ return this._player.getAudioTracks()
+ }, getSelectedAudioTrack: function getSelectedAudioTrack() {
+ if (!this._isPlayerSet())
+ return;
+ return this._player.getSelectedAudioTrack()
+ }, selectAudioTrack: function selectAudioTrack(trackIndex) {
+ if (!this._isPlayerSet())
+ return;
+ this._player.selectAudioTrack(trackIndex)
+ }, setPlaybackRate: function setPlaybackRate(playbackRate) {
+ if (!this._isPlayerSet())
+ return;
+ if (playbackRate === +playbackRate && playbackRate >= this.minPlaybackRate && playbackRate <= this.maxPlaybackRate)
+ this._player.playbackRate = playbackRate
+ }, reset: function reset(sendStop) {
+ this._internalCurrentMedia = null;
+ if (!this._isPlayerSet())
+ return;
+ if (sendStop && this._player && this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ this._player.reset(false);
+ this._player.reset(true);
+ if (this._prerollMediaItem) {
+ this._prerollMediaItem = null;
+ this._cancelPrerollCallback()
+ }
+ this.currentPosition = 0;
+ this._targetPosition = 0;
+ if (sendStop)
+ this.currentTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ this._targetTransportState = MS.Entertainment.Platform.Playback.TransportState.unInitialize;
+ this.duration = 0;
+ this.errorDescriptor = null;
+ this._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.notReady);
+ this.readyForNextMedia = false;
+ this.videoWidth = 0;
+ this.videoHeight = 0;
+ this.playbackRate = 1;
+ this.minPlaybackRate = -128;
+ this.maxPlaybackRate = 128;
+ this.currentRequestedBitrate = null
+ }, forceError: function forceError(errorCode) {
+ if (!this._isPlayerSet())
+ return;
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), errorCode, "forceError");
+ this.reset(true)
+ }, setPlayer: function setPlayer(player) {
+ if (player) {
+ this._player = player;
+ if (this._playerEventHandlers) {
+ this._playerEventHandlers.cancel();
+ this._playerEventHandlers = null
+ }
+ this._playerEventHandlers = MS.Entertainment.Utilities.addEvents(this._player, {
+ _nextMediaLoadedChanged: function _onNextMediaLoaded(e) {
+ var isLoaded = e.detail.newValue;
+ this._handleNextMediaLoaded(isLoaded, this)
+ }.bind(this), _nextMediaStartedChanged: function _onNextMediaStarted(e) {
+ var isStarted = e.detail.newValue;
+ this._handleNextMediaStarted(isStarted, this)
+ }.bind(this), _nextMediaErrorChanged: function _onNextMediaError(e) {
+ var isError = e.detail.newValue;
+ this._handleNextMediaError(isError)
+ }.bind(this), isRemoteSessionRunningChanged: function _onRemoteSessionChanged(e) {
+ var isRemoteSessionRunningValue = e.detail.newValue;
+ this.isRemoteSessionRunning = isRemoteSessionRunningValue
+ }.bind(this), playToSenderConnectionStateChanged: function _onPlayToSenderConnectionStateChanged(e) {
+ var playToSenderConnectionStateValue = e.detail.newValue;
+ this.playToSenderConnectionState = playToSenderConnectionStateValue
+ }.bind(this), mediaElementChanged: function _onMediaElementChanged(e) {
+ var mediaElementValue = e.detail.newValue;
+ this.mediaElement = mediaElementValue
+ }.bind(this)
+ });
+ this._player._currentMediaEventsCallback = this._onPlayerEvent.bind(this)
+ }
+ }, enableTimeUpdate: function enableTimeUpdate() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.enableTimeUpdate();
+ MSEPlatform.Playback.Etw.tracePlaybackEnableTimeUpdate(this.currentPosition)
+ }, disableTimeUpdate: function disableTimeUpdate() {
+ if (!this._isPlayerSet())
+ return;
+ this._player.disableTimeUpdate();
+ MSEPlatform.Playback.Etw.tracePlaybackDisableTimeUpdate(this.currentPosition)
+ }, forceTimeUpdate: function forceTimeUpdate() {
+ if (this._isPlayerSet() && this._player._currentPlayer) {
+ this.currentPosition = this._player.forceTimeUpdate();
+ MSEPlatform.Playback.Etw.tracePlaybackForceTimeUpdate(this.currentPosition)
+ }
+ return this.currentPosition
+ }, isRemoteSession: function isRemoteSession() {
+ if (this._isPlayerSet())
+ return this._player.isRemoteSession();
+ return false
+ }, notifyNetworkConnectionChanged: function notifyNetworkConnectionChanged(networkConnection) {
+ WinJS.Promise.timeout().then(this._handleNetworkConnectionChanged(networkConnection))
+ }, skipToNextPrerolled: function skipToNextPrerolled(fromSkipButton) {
+ this._reportPrerollErrors();
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ this._player._switchPlayerAsync().done(function switch_completed(succeeded) {
+ if (succeeded) {
+ if (this.targetTransportState === MSEPlatform.Playback.TransportState.playing || this.currentTransportState === MSEPlatform.Playback.TransportState.playing || (this.autoPlay && !fromSkipButton))
+ this._applyTargetTransportState(MSEPlatform.Playback.TransportState.playing)
+ }
+ else
+ this._skipButtonPressed = fromSkipButton
+ }.bind(this), null)
+ }, hasPrerolledMedia: function hasPrerolledMedia() {
+ return (this._player && this._player._nextPlayer)
+ }, _internalPrerollMediaItem: function _internalPrerollMediaItem(mediaItem) {
+ this._prerollMediaItem = mediaItem;
+ if (this._prerollMediaItem)
+ return WinJS.Promise.as(this._reschedulePrerollCallback());
+ else
+ return WinJS.Promise.as(this._setNextMedia(null))
+ }, prerollMediaItem: function PrerollMediaItem(mediaItem) {
+ var Playback = MS.Entertainment.Platform.Playback;
+ var name = (mediaItem && mediaItem.data) ? mediaItem.data.name : String.empty;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::prerollMediaItem: Control has been asked to preroll \"" + name + "\"");
+ this._cancelPrerollCallback();
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = true;
+ if (MS.Entertainment.Utilities.isMusicApp && mediaItem && mediaItem.data)
+ return MS.Entertainment.Utilities.playabilityTestAsync(mediaItem.data, {
+ mediaRights: MS.Entertainment.Utilities.isApp1, checkExplicit: MS.Entertainment.Utilities.isApp1
+ }).then(function onPlayabilityTest(playability) {
+ if (!playability.isPlayable)
+ return WinJS.Promise.wrapError(new Playback.UnplayableItemError(mediaItem, mediaItem.index));
+ else
+ return this._internalPrerollMediaItem(mediaItem)
+ }.bind(this));
+ return this._internalPrerollMediaItem(mediaItem)
+ }, _reschedulePrerollCallback: function _reschedulePrerollCallback() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback");
+ this._cancelPrerollCallback();
+ if (!this._prerollMediaItem) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Control has nothing to preroll. Dropping reschedule request.");
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = false;
+ return
+ }
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Control is scheduling next media.");
+ var myPrerollPromiseOrdinal = this._prerollPromiseOrdinal;
+ this._prerollPromise = this._collectPrerollInformation().then(function onCollectPrerollInformation(prerollInformation) {
+ if (myPrerollPromiseOrdinal !== this._prerollPromiseOrdinal) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Promise was canceled but completed anyway. Dropping.");
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = false;
+ return
+ }
+ if (this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Control was stopped, prerolling immediately.");
+ prerollInformation.delayTime = 0
+ }
+ if (prerollInformation.delayTime > 0 && this.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.playing)
+ if (this.currentMedia && this.currentMedia._errorDescriptor)
+ if (this._errorCount < this._maxSequentialErrors) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Not playing and in error, prerolling immediately.");
+ prerollInformation.delayTime = 0
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Not scheduling preroll. Too many errors. Report and deactivate playlist");
+ this._setNextMedia(null);
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Not scheduling preroll. Determined we should delay but pipeline is not playing");
+ return
+ }
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Scheduling preroll for " + (prerollInformation.delayTime / 1000) + " seconds from now");
+ return WinJS.Promise.timeout(prerollInformation.delayTime).then(function onPrerollTimeout() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: Preroll timeout fired at " + (this.currentPosition / 1000) + " seconds into the file. ");
+ return this._requestNetwork().then(function() {
+ return this._setPrerollItemAsNextInstance()
+ }.bind(this))
+ }.bind(this), function onPrerollTimeoutError(error) {
+ if (WinJS.Promise.isCanceledError(error))
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback: _prerollPromise canceled.")
+ })
+ }.bind(this), function onCollectPrerollInformationError(error) {
+ if (WinJS.Promise.isCanceledError(error))
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::reschedulePrerollCallback::onCollectPrerollInformationError: _prerollPromise canceled.")
+ })
+ }, _cancelPrerollCallback: function PlaylistCore_cancelPrerollCallback() {
+ if (this._prerollPromise) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::cancelPrerollCallback: Canceling scheduled preroll.");
+ this._prerollPromise.cancel();
+ this._prerollPromise = null;
+ this._prerollPromiseOrdinal++
+ }
+ }, _collectPrerollInformation: function PlaylistCore_collectPrerollInformation() {
+ return this._hydrateItemForPreroll(this._prerollMediaItem).then(function onHydrateItemForPreroll(result) {
+ var prerollInformation = {
+ isLocal: null, delayTime: 0
+ };
+ if (result && result.data) {
+ prerollInformation.isLocal = result.data.canPlayLocally;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::collectPrerollInformation: Preroll item can play locally: " + result.data.canPlayLocally + ".");
+ if (prerollInformation.isLocal === false)
+ prerollInformation.delayTime = this._calculatePrerollTimeout()
+ }
+ return prerollInformation
+ }.bind(this))
+ }, _hydrateItemForPreroll: function _hydrateItemForPreroll(mediaItem) {
+ if (mediaItem && !mediaItem.hydratedForPreroll && mediaItem.data && mediaItem.data.mediaType) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: >> hydrateLibraryInfoAsync");
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(mediaItem.data).then(function onHydrateLibraryInfoAsync() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: << hydrateLibraryInfoAsync");
+ mediaItem.hydratedForPreroll = true;
+ return WinJS.Promise.wrap(mediaItem)
+ }, function onHydrateLibraryInfoAsyncError(e) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: << hydrateLibraryInfoAsync Error");
+ return WinJS.Promise.wrapError(e)
+ })
+ }
+ else {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_hydrateItemForPreroll: mediaItem hydrated for preroll");
+ if (mediaItem)
+ mediaItem.hydratedForPreroll = true;
+ return WinJS.Promise.wrap(mediaItem)
+ }
+ }, _calculatePrerollTimeout: function PlaylistCore_calculatePrerollTimeout() {
+ var currentPosition = this.forceTimeUpdate();
+ var currentDuration = this.duration ? this.duration : 0;
+ var timeout = currentDuration - currentPosition;
+ timeout = timeout - this._configManager.playback.streamingPrerollMS;
+ if (timeout < 0)
+ timeout = 0;
+ MSEPlatform.Playback.Etw.traceString("calculatePrerollTimeout: Determining a preroll timeout position: " + currentPosition + " duration: " + currentDuration + " timeout: " + timeout);
+ return timeout
+ }, _setPrerollItemAsNextInstance: function _setPrerollItemAsNextInstance() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setPrerollItemAsNextInstance: Prerolling at " + (this.currentPosition / 1000) + " seconds into the file.");
+ var onSetComplete = function onSetComplete() {
+ this._prerollMediaItem = null
+ }.bind(this);
+ MS.Entertainment.Platform.Playback.assert(this._prerollMediaItem, "Tried to convert a null preroll item. Dropping.");
+ if (!this._prerollMediaItem) {
+ MSEPlatform.Playback.Etw.traceString("Tried to convert a null preroll item. Dropping.");
+ return
+ }
+ return MS.Entertainment.Platform.Playback.Playlist.PlaylistCore.convertMediaItemToMediaInstance(this._prerollMediaItem, null, MS.Entertainment.Platform.Playback.UsageContext.automatic).then(function onConvertMediaItemToMediaInstance(mediaInstance) {
+ MSEPlatform.Playback.Etw.traceString("onConvertMediaItemToMediaInstance: mediaInstance.source = " + mediaInstance.source);
+ this.nextMedia = mediaInstance;
+ onSetComplete()
+ }.bind(this), function onConvertMediaItemToMediaInstanceError(error) {
+ MSEPlatform.Playback.Etw.traceString("onConvertMediaItemToMediaInstanceError");
+ if (error && error.isUnplayableItemError) {
+ onSetComplete();
+ this._signalForNextMedia()
+ }
+ else if (!(WinJS.Promise.isCanceledError(error)))
+ return MSEPlatform.Playback.MediaInstance.createInstanceAsync({
+ cookie: this._prerollMediaItem.index, error: MSEPlatform.Playback.makePlaybackError(error, "prerollMediaItem_convertMediaItemToMediaInstance error"), mediaItem: this._prerollMediaItem
+ }).then(function(errorMediaInstance) {
+ this.nextMedia = errorMediaInstance;
+ onSetComplete()
+ }.bind(this));
+ else
+ MSEPlatform.Playback.Etw.traceString("onConvertMediaItemToMediaInstanceError: prerollMediaItem canceled")
+ }.bind(this))
+ }, _isPlayerSet: function _isPlayerSet() {
+ if (!this._player)
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::isPlayerSet: No, player is not set yet!");
+ return (this._player ? true : false)
+ }, _isPlayerState: function _isPlayerState(state) {
+ return (this.playerState === state)
+ }, _requestNetwork: function _requestNetwork() {
+ return WinJS.Promise.timeout(0)
+ }, _releaseNetwork: function _releaseNetwork() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::releaseNetwork");
+ if (this._networkUpRequest) {
+ var releaseMeLater = this._networkUpRequest;
+ this._networkUpRequest = null;
+ WinJS.Promise.timeout(5000).then(function() {
+ releaseMeLater.release()
+ })
+ }
+ }, _setMedia: function _setMedia(mediaInstance) {
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data) {
+ var itemData = mediaInstance._mediaItem.data;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setMedia: mediaInstance = { name: " + itemData.name + ", libraryId: " + itemData.libraryId + ", serviceId: " + itemData.serviceId + " }")
+ }
+ else
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setMedia: mediaInstance._mediaItem.data= undefined");
+ this._clearReportedErrors();
+ if (this._player)
+ this._player.controlIsProcessingNextMedia = false;
+ if (!mediaInstance) {
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ if (this._canResetOnNullMediaInstance)
+ this.reset(true);
+ else
+ this._canResetOnNullMediaInstance = true;
+ return
+ }
+ if (!this._isPlayerSet())
+ return;
+ if (mediaInstance.isEqual(this._internalCurrentMedia))
+ return;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackAttempted(mediaInstance);
+ this.endOfPlaylist = false;
+ if (this._player && ((this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing) || (this.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.paused)))
+ MS.Entertainment.Utilities.Telemetry.logSkipHappened(this, this.forceTimeUpdate());
+ this.isPreview = mediaInstance.isPreview;
+ if (mediaInstance.videoAdSupported)
+ this.autoPlay = false;
+ this._handleMediaInstance(mediaInstance)
+ }, _handleMediaInstance: function _handleMediaInstance(mediaInstance) {
+ this._nextMediaInstanceAfterAd = null;
+ this.isAudioAd = false;
+ this._setPlayerMedia(mediaInstance)
+ }, _clearReportedErrors: function _clearReportedErrors() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setPlayerMedia: clear all reported errors");
+ var playbackEventNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackEventNotifications);
+ playbackEventNotifications.clearErrors();
+ this._erroredMediaInstances = [];
+ this._lastErrorEncountered = null;
+ this._hasSameErrors = true;
+ this._hasPlayedSong = false;
+ this._errorCount = 0
+ }, _setPlayerMedia: function _setPlayerMedia(mediaInstance) {
+ MSEPlatform.Playback.Etw.traceSetMedia(mediaInstance);
+ this.reset(true);
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var errorCode = this._isParentallyBlocked(mediaInstance);
+ if (errorCode) {
+ var mediaItem = (mediaInstance._mediaItem ? mediaInstance._mediaItem.data : null);
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), errorCode, "_setMedia_isParentallyBlocked", mediaItem);
+ return
+ }
+ }
+ if (mediaInstance && mediaInstance._errorDescriptor) {
+ var mediaItem = (mediaInstance._mediaItem ? mediaInstance._mediaItem.data : null);
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), mediaInstance._errorDescriptor, "_setMedia_preexistingCondition", mediaItem);
+ return
+ }
+ if (this.autoPlay)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.starting;
+ this._canResetOnNullMediaInstance = !MS.Entertainment.Platform.Playback.XPlayer.audioTagForFileActivation;
+ this._player.currentMedia = mediaInstance
+ }, _setNextMedia: function _setNextMedia(mediaInstance) {
+ if (!this._isPlayerSet())
+ return;
+ var name = (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data) ? mediaInstance._mediaItem.data.name : String.empty;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_setNextMedia: name= " + name);
+ if (!mediaInstance) {
+ this._player.nextMedia = null;
+ this._player.controlIsProcessingNextMedia = false;
+ this.endOfPlaylist = true;
+ if ((this.autoPlay && !this.activating && (this.currentTransportState !== MSEPlatform.Playback.TransportState.playing && this.currentTransportState !== MSEPlatform.Playback.TransportState.starting)) || (this.currentTransportState === MSEPlatform.Playback.TransportState.starting && this.error))
+ this._handleErrorsOnEndOfPlaylist();
+ return
+ }
+ MS.Entertainment.Utilities.Telemetry.logPlaybackAttempted(mediaInstance);
+ MSEPlatform.Playback.Etw.traceSetNextMedia(this.readyForNextMedia, mediaInstance);
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var errorCode = this._isParentallyBlocked(mediaInstance);
+ if (errorCode) {
+ mediaInstance._errorDescriptor = {msExtendedCode: errorCode.code};
+ this._player.controlIsProcessingNextMedia = false;
+ this._handleNextMediaError(true, null, mediaInstance);
+ return
+ }
+ }
+ if (mediaInstance && mediaInstance._errorDescriptor) {
+ this._player.controlIsProcessingNextMedia = false;
+ this._handleNextMediaError(true, null, mediaInstance);
+ return
+ }
+ this._player.nextMedia = mediaInstance;
+ this._player.controlIsProcessingNextMedia = false
+ }, _isParentallyBlocked: function _isParentallyBlocked(mediaInstance) {
+ var errorCode = null;
+ if (mediaInstance._mediaItem) {
+ var mediaItem = mediaInstance._mediaItem.data;
+ if (mediaItem)
+ if (mediaItem.isExplicit && !mediaItem.inCollection) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (!signedInUser.xuid)
+ errorCode = MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_LOGON_TO_PLAY_EXPLICIT_CONTENT;
+ else if (!signedInUser.hasExplicitPrivilege)
+ errorCode = MS.Entertainment.Platform.Playback.makeParentallyBlockedError()
+ }
+ }
+ return errorCode
+ }, _onPlayerEvent: function _onPlayerEvent(event) {
+ switch (event.type)
+ {
+ case"loadedmetadata":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata");
+ this.errorDescriptor = null;
+ if (event.srcElement.durationOverrideMS)
+ this.duration = event.srcElement.durationOverrideMS;
+ else if (isFinite(event.srcElement.duration))
+ this.duration = Math.round(event.srcElement.duration * 1000);
+ if (!this._player) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata - player is null");
+ MS.Entertainment.Utilities.fail("loadedmetadata - player is null")
+ }
+ if (!this._player._currentMedia) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata - currentMedia is null");
+ MS.Entertainment.Utilities.fail("loadedmetadata - currentMedia is null")
+ }
+ MSEPlatform.Playback.Etw.traceMediaLoaded(false, this._player._currentMedia, this.duration);
+ if (this._player._currentMedia)
+ this._player._currentMedia.alternateSource = null;
+ this._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.ready);
+ if (this._player && this._player._currentMedia && !this._player._currentMedia.isAudioAd) {
+ if (!this.hasPrerolledMedia()) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata - raising readyForNextMedia");
+ this.readyForNextMedia = true
+ }
+ }
+ else if (this._nextMediaInstanceAfterAd)
+ this._setNextMedia(this._nextMediaInstanceAfterAd);
+ this.videoWidth = event.srcElement.videoWidth;
+ this.videoHeight = event.srcElement.videoHeight;
+ if (this._targetPosition === 0 && this._player && this._player._currentMedia && this._player._currentMedia.startPosition > 0 && !this.isRemoteSession())
+ this._targetPosition = this._player._currentMedia.startPosition;
+ if (this._targetTransportState !== MSEPlatform.Playback.TransportState.unInitialize && this._targetTransportState !== this.currentTransportState)
+ this._applyTargetTransportState(this._targetTransportState);
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata, autoplay=" + this.autoPlay);
+ if (this.autoPlay && this._player) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent, loadedmetadata: calling xplayer.play(), autoplay=true");
+ this._player.play()
+ }
+ break;
+ case"timeupdate":
+ if (event.srcElement && event.srcElement.currentTime)
+ this.currentPosition = Math.round(event.srcElement.currentTime * 1000);
+ break;
+ case"durationchange":
+ if (event.srcElement.durationOverrideMS)
+ this.duration = event.srcElement.durationOverrideMS;
+ else if (event.srcElement && event.srcElement.duration && isFinite(event.srcElement.duration))
+ this.duration = Math.round(event.srcElement.duration * 1000);
+ break;
+ case"ratechange":
+ this.playbackRate = event.srcElement.playbackRate;
+ break;
+ case"playing":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: Playing");
+ if (MS.Entertainment.Utilities.isVideoApp && this.currentPosition < 1000 && this._targetPosition < 1000) {
+ this.seekToPosition((this._targetPosition > this.currentPosition) ? this._targetPosition : (this.currentPosition + 50));
+ this._targetPosition = 0
+ }
+ else if (this._targetPosition > 0) {
+ this.seekToPosition(this._targetPosition);
+ this._targetPosition = 0
+ }
+ this._targetTransportState = MSEPlatform.Playback.TransportState.playing;
+ this.currentTransportState = MSEPlatform.Playback.TransportState.playing;
+ if (this._player && this._player.currentMedia && this._player.currentMedia.protectionState && (this._player.currentMedia.protectionState === MS.Entertainment.Platform.Playback.ProtectionState.drmProtected)) {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPlayProtectedInApp()
+ }
+ else {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunchPlayNonProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioPlayNonProtectedInApp()
+ }
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioAppLaunchPlayProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayProtectedInApp();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioAppLaunchPlayNonProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayNonProtectedInApp();
+ this._hasPlayedSong = true;
+ this._errorCount = 0;
+ MS.Entertainment.Utilities.Telemetry.logPlayHappened(this, this.forceTimeUpdate());
+ break;
+ case"pause":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: pause");
+ if (this._targetTransportState === MSEPlatform.Playback.TransportState.stopped)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ else if (this.currentTransportState === MSEPlatform.Playback.TransportState.stopped) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: pause - Current transport state is stopped. Ignoring paused request.");
+ return
+ }
+ else {
+ this._targetTransportState = MSEPlatform.Playback.TransportState.paused;
+ this.currentTransportState = MSEPlatform.Playback.TransportState.paused;
+ MS.Entertainment.Utilities.Telemetry.logPauseHappened(this, this.forceTimeUpdate())
+ }
+ break;
+ case"ended":
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: ended");
+ if (event.target.tagName === "VIDEO" && ((this.currentPosition / this.duration) <= 0.25))
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: playback ended at the start of the media. Ignoring ended event");
+ else {
+ if (!this.hasPrerolledMedia() && !this._player.controlIsProcessingNextMedia) {
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ this._targetTransportState = MSEPlatform.Playback.TransportState.stopped;
+ if (this.endOfPlaylist || (this._lastErrorEncountered && this._lastErrorEncountered.isCritical))
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ MS.Entertainment.Utilities.Telemetry.logEndHappened(this, this.duration);
+ this.currentPosition = 0;
+ this._reportPrerollErrors();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService)) {
+ var displayService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService);
+ if (displayService)
+ displayService.showDialogForNonCriticalErrors = false
+ }
+ }
+ break;
+ case"seeked":
+ this._fireSeekedPositionChanged(this.currentPosition);
+ break;
+ case"error":
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayProtectedInApp();
+ MS.Entertainment.Instrumentation.PerfTrack.disableScenarioPlayNonProtectedInApp();
+ this.activating = false;
+ var currentMediaInstance = this._player ? this._player.currentMedia || this._currentMedia : null;
+ if (currentMediaInstance === null || (this.isRemoteSessionRunning && event.target.error.code === MSEPlatform.Playback.MediaTagError.MEDIA_ERR_SRC_NOT_SUPPORTED.code && event.target.error.msExtendedCode !== MSEPlatform.Playback.Error.E_ENHANCED_STORAGE.code)) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: Error to ignore: error: code=" + MSEPlatform.Playback.errorToString(event.target.error.code));
+ break
+ }
+ if (event.target.error.msExtendedCode === MSEPlatform.Playback.Error.MF_E_NO_PMP_HOST.code)
+ break;
+ var name = (currentMediaInstance && currentMediaInstance._mediaItem && currentMediaInstance._mediaItem.data) ? currentMediaInstance._mediaItem.data.name : String.empty;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent: error: " + MSEPlatform.Playback.mediaErrorToString(event.target.error) + ", itemName=" + name);
+ if (event.srcElement)
+ event.srcElement.errorCode = event.target.error.code;
+ if (currentMediaInstance && currentMediaInstance.videoEncoding === Microsoft.Entertainment.Marketplace.VideoEncoding.h264 && event.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_FAIL.code && this._player.retryableError && MS.Entertainment.UI.NetworkStatusService.isOnline()) {
+ currentMediaInstance.startPosition = this.currentPosition + VideoRetrySkipTimeMs;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (currentMediaInstance && MS.Entertainment.UI.NetworkStatusService.isOnline() && event.target.error.msExtendedCode === MSEPlatform.Playback.Error.E_ENHANCED_STORAGE.code) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::onPlayerEvent error: Received PlayReady decryptor error. Restarting playback from last known position.");
+ currentMediaInstance.startPosition = this.currentPosition;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (currentMediaInstance && currentMediaInstance.alternateVideoEncoding !== null) {
+ currentMediaInstance.videoEncoding = currentMediaInstance.alternateVideoEncoding;
+ currentMediaInstance.alternateVideoEncoding = null;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (currentMediaInstance && currentMediaInstance.alternateSource) {
+ currentMediaInstance.source = currentMediaInstance.alternateSource;
+ currentMediaInstance.alternateSource = null;
+ this._setMedia(currentMediaInstance)
+ }
+ else if (event.srcElement && event.srcElement.fastStartProperties && event.srcElement.error && event.srcElement.error.msExtendedCode === MSEPlatform.Playback.Error.MF_E_DRM_UNSUPPORTED.code) {
+ currentMediaInstance.disableFastStart = true;
+ this._setMedia(currentMediaInstance)
+ }
+ else {
+ var err = event.target.error;
+ err.context = (err.context ? err.context + "; " : String.empty) + "onPlayerEvent: Error from tag";
+ this._handleCurrentMediaError(err)
+ }
+ break
+ }
+ }, _fireSeekedPositionChanged: function _fireSeekedPositionChanged(currentPosition) {
+ this.seekedPosition = currentPosition;
+ this._reschedulePrerollCallback()
+ }, _handleErrorsOnEndOfPlaylist: function _handleErrorsOnEndOfPlaylist() {
+ var displayError = null;
+ if (this._lastErrorEncountered) {
+ var displayError = MS.Entertainment.Platform.Playback.Error.NS_E_WMP_MULTIPLE_ERROR_IN_PLAYLIST;
+ if (this._hasSameErrors)
+ displayError = this._lastErrorEncountered;
+ if (!this._hasPlayedSong)
+ displayError.isCritical = true
+ }
+ var playerStateAsyncAssignment = this._observableNoLossAssignAsyncBegin("playerState");
+ this._player._nextMediaStarted = false;
+ this._player._switchPlayerAsync().done(function setErrorStateOnEnd() {
+ if (displayError) {
+ this.errorDescriptor = displayError;
+ playerStateAsyncAssignment.complete(MS.Entertainment.Platform.Playback.PlayerState.error);
+ this._lastErrorEncountered = null
+ }
+ else
+ playerStateAsyncAssignment.cancel()
+ }.bind(this), function dontcare(){})
+ }, _handleNextMediaLoaded: function _handleNextMediaLoaded(isLoaded, iPlayback) {
+ if (isLoaded) {
+ iPlayback.readyForNextMedia = false;
+ this._releaseNetwork();
+ MSEPlatform.Playback.Etw.traceMediaLoaded(true, iPlayback._player._nextMedia, iPlayback._player._nextPlayer ? iPlayback._player._nextPlayer.duration * 1000 : 0);
+ if (this._skipButtonPressed || (iPlayback.currentMedia && iPlayback.currentMedia._errorDescriptor)) {
+ this._skipButtonPressed = false;
+ iPlayback.skipToNextPrerolled()
+ }
+ }
+ }, _handleNextMediaStarted: function _handleNextMediaStarted(isStarted, iPlayback) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNextMediaStarted: " + isStarted);
+ if (isStarted) {
+ iPlayback._internalCurrentMedia = iPlayback._player._currentMedia;
+ if (!iPlayback._internalCurrentMedia) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNextMediaStarted: currentMedia null");
+ iPlayback.currentMedia = null
+ }
+ if (iPlayback._player._currentMedia && !iPlayback._player._currentMedia.isAudioAd) {
+ iPlayback.currentMedia = iPlayback._player._currentMedia;
+ iPlayback.errorDescriptor = iPlayback._player._currentMedia._errorDescriptor
+ }
+ iPlayback.isAudioAd = iPlayback._player._currentMedia && iPlayback._player._currentMedia.isAudioAd;
+ iPlayback._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.ready);
+ if (iPlayback._player._currentPlayer)
+ iPlayback.duration = Math.round(iPlayback._player._currentPlayer.duration * 1000);
+ if (iPlayback.currentTransportState !== MSEPlatform.Playback.TransportState.playing)
+ iPlayback.currentPosition = 0;
+ if (iPlayback.currentMedia) {
+ MSEPlatform.Playback.Etw.traceNextMediaStarted(iPlayback.currentMedia.source);
+ MS.Entertainment.Utilities.Telemetry.logPlaybackHappened(iPlayback.currentMedia)
+ }
+ this._startProcessingNextMedia()
+ }
+ }, _startProcessingNextMedia: function _startProcessingNextMedia() {
+ if (this._internalCurrentMedia) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNextMediaStarted - raising readyForNextMedia");
+ this._signalForNextMedia()
+ }
+ }, _handleNextMediaError: function _handleNextMediaError(isError, unReferrencedParam, mediaInstance) {
+ if (isError) {
+ var error;
+ if (!mediaInstance)
+ mediaInstance = this._player._nextMedia;
+ if (mediaInstance && mediaInstance.alternateVideoEncoding !== null) {
+ mediaInstance.videoEncoding = mediaInstance.alternateVideoEncoding;
+ mediaInstance.alternateVideoEncoding = null;
+ this._player._setNextMedia(mediaInstance);
+ return
+ }
+ if (mediaInstance) {
+ if (!this._shouldIgnoreThisErrorForBlocking(mediaInstance._errorDescriptor.code))
+ this._addErroredMediaInstance(mediaInstance);
+ error = this.errorDescriptor;
+ MS.Entertainment.Utilities.Telemetry.logPlaybackError(mediaInstance, error, "PlaybackController_handleNextMediaError")
+ }
+ this._player.reset(true);
+ this._reportPrerollErrors();
+ if (!this._isCriticalError(error)) {
+ var that = this;
+ var nowplayingSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ if (nowplayingSession.repeat && this._errorCount > 1)
+ nowplayingSession.mediaCollection.getCount().done(function onGetCount(playlistCount) {
+ if (that._errorCount >= playlistCount) {
+ that.endOfPlaylist = true;
+ that._handleErrorsOnEndOfPlaylist()
+ }
+ else
+ that._signalForNextMedia()
+ }, function onGetCountError(error) {
+ that._signalForNextMedia()
+ });
+ else
+ this._signalForNextMedia()
+ }
+ else if (!this._hasPlayedSong) {
+ this.endOfPlaylist = true;
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ }
+ }, _remapPlaybackError: function _remapPlaybackError(error) {
+ return error
+ }, _handleCurrentMediaError: function _handleCurrentMediaError(error) {
+ error = this._remapPlaybackError(error);
+ if (this.isRemoteSession() && error && error.code === 3)
+ this.errorDescriptor = {msExtendedCode: MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_PLAYTO_ERR_DECODE.code};
+ else {
+ this.errorDescriptor = error;
+ this.errorDescriptor.mediaItem = (this.currentMedia && this.currentMedia._mediaItem) ? this.currentMedia._mediaItem.data : null
+ }
+ if (this._player && this._player.currentMedia) {
+ error.errorOrdinal = this._player.currentMedia.cookie;
+ this._player.currentMedia._errorDescriptor = error
+ }
+ var errorContext = error.context || "PlaybackController_handleCurrentMediaError";
+ MSEPlatform.Playback.Etw.tracePlaybackError(error.code, error.msExtendedCode, errorContext);
+ this._lastErrorEncountered = error;
+ this._addErroredMediaInstance(this._player && this._player.currentMedia);
+ MS.Entertainment.Utilities.Telemetry.logPlaybackError(this.currentMedia, error, errorContext);
+ if (this._isCriticalError(error))
+ this.errorDescriptor.isCritical = true;
+ else
+ this._observableNoLossAssign("playerState", MS.Entertainment.Platform.Playback.PlayerState.error);
+ if (this.errorDescriptor.isCritical) {
+ MSEPlatform.Playback.AudioPlayer.disposeFastStartTag();
+ this._setNextMedia(null);
+ this._handleErrorsOnEndOfPlaylist()
+ }
+ this._processPlaybackErrorPostMapping(error)
+ }, _processPlaybackErrorPostMapping: function _processPlaybackErrorPostMapping(error){}, _signalForNextMedia: function _signalForNextMedia() {
+ this._player.controlIsProcessingNextMedia = true;
+ this.readyForNextMedia = false;
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::signalForNextMedia requested");
+ if (this._signalForNextMediaPromise) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::signalForNextMedia: cancel previous");
+ this._signalForNextMediaPromise.cancel()
+ }
+ this._signalForNextMediaPromise = WinJS.Promise.timeout(10);
+ this._signalForNextMediaPromise.then(function() {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::signalForNextMedia: raising readyForNextMedia");
+ this.readyForNextMedia = true;
+ this._signalForNextMediaPromise = null
+ }.bind(this))
+ }, _isCriticalError: function _isCriticalError(error) {
+ if (!error)
+ return false;
+ else if (this._errorCount >= this._maxSequentialErrors)
+ return true;
+ switch (error.msExtendedCode) {
+ case MSEPlatform.Playback.Error.X8_E_PLAYBACK_STOPPED_DATA_LIMIT_APPROACHING.code:
+ case MSEPlatform.Playback.Error.E_MDS_ROAMING_LIMIT.code:
+ case MSEPlatform.Playback.Error.ERROR_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED.code:
+ case MSEPlatform.Playback.Error.MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED.code:
+ case MSEPlatform.Playback.Error.MF_E_CANNOT_CREATE_SINK.code:
+ case MSEPlatform.Playback.Error.MF_E_DEBUGGING_NOT_ALLOWED.code:
+ case MSEPlatform.Playback.Error.MF_E_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED.code:
+ case MSEPlatform.Playback.Error.ZEST_E_MW_CONCURRENT_STREAM.code:
+ case MSEPlatform.Playback.Error.ZEST_E_MEDIAINSTANCE_STREAMING_OCCUPIED.code:
+ case MSEPlatform.Playback.Error.ZEST_E_MULTITUNER_CONCURRENTSTREAMING_DETECTED.code:
+ case MSEPlatform.Playback.Error.NS_E_COMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED.code:
+ case MSEPlatform.Playback.Error.NS_E_UNCOMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED.code:
+ case MSEPlatform.Playback.Error.NS_E_DRM_DRIVER_AUTH_FAILURE.code:
+ case MSEPlatform.Playback.Error.NS_E_DRM_NEEDS_INDIVIDUALIZATION.code:
+ case MSEPlatform.Playback.Error.NS_E_DRM_UNABLE_TO_INITIALIZE.code:
+ case MSEPlatform.Playback.Error.NS_E_WMP_AUDIO_HW_PROBLEM.code:
+ case MSEPlatform.Playback.Error.NS_E_WMP_BAD_DRIVER.code:
+ case MSEPlatform.Playback.Error.E_MDS_UNAUTHENTICATED_TRACK_LIMIT.code:
+ return true;
+ default:
+ return false
+ }
+ }, _fireCriticalPlaybackError: function _fireCriticalPlaybackError(error) {
+ var mediaItem = (this.currentMedia && this.currentMedia._mediaItem ? this.currentMedia._mediaItem.data : null);
+ error.isCritical = true;
+ MSEPlatform.Playback.firePlaybackError(this._onPlayerEvent.bind(this), error, "PlaybackController_fireCriticalError", mediaItem);
+ this._errorCount = 0
+ }, _shouldIgnoreThisErrorForBlocking: function _shouldIgnoreThisErrorForBlocking(error) {
+ return ((error === MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_ERR_NOT_LOCAL.code) || (error === MS.Entertainment.Platform.Playback.Error.MF_E_NO_PMP_HOST))
+ }, _addErroredMediaInstance: function _addErroredMediaInstance(mediaInstance) {
+ if (!mediaInstance)
+ return;
+ var error = null;
+ var errorCode = null;
+ if (mediaInstance._errorDescriptor) {
+ error = MS.Entertainment.Platform.Playback.makePlaybackError(mediaInstance._errorDescriptor);
+ errorCode = error.msExtendedCode;
+ error.errorOrdinal = mediaInstance.cookie
+ }
+ if (this._hasSameErrors && errorCode && this._lastErrorEncountered && this._lastErrorEncountered.msExtendedCode !== errorCode)
+ this._hasSameErrors = false;
+ this._lastErrorEncountered = error;
+ this._erroredMediaInstances.push(mediaInstance);
+ this._errorCount++;
+ if (this._isCriticalError(error)) {
+ error.isCritical = true;
+ this.errorDescriptor = error
+ }
+ }, _reportPrerollErrors: function _reportPrerollErrors() {
+ var playbackEventNotifications = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackEventNotifications);
+ while (this._erroredMediaInstances.length > 0) {
+ var mediaInstance = this._erroredMediaInstances.pop();
+ var mediaItem = null;
+ var errorCode = null;
+ if (mediaInstance) {
+ if (mediaInstance._mediaItem) {
+ mediaItem = mediaInstance._mediaItem.data;
+ if (mediaItem && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaInstance._mediaItem.trackItem)
+ mediaItem = mediaInstance._mediaItem.trackItem.data
+ }
+ if (mediaInstance._errorDescriptor) {
+ var error = MS.Entertainment.Platform.Playback.makePlaybackError(mediaInstance._errorDescriptor);
+ errorCode = error.msExtendedCode
+ }
+ }
+ playbackEventNotifications.setError(MS.Entertainment.Platform.Playback.PlaybackEventNotifications.getEventingMediaId(mediaItem), errorCode)
+ }
+ }, _handleNetworkConnectionChanged: function _handleNetworkConnectionChanged(networkConnection) {
+ switch (networkConnection) {
+ case MS.Entertainment.Platform.NetworkConnection.approachingDataLimit:
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNetworkConnectionChanged: approachingDataLimit");
+ this._pauseStreamingAndFireError(MSEPlatform.Playback.Error.X8_E_PLAYBACK_STOPPED_DATA_LIMIT_APPROACHING);
+ break;
+ case MS.Entertainment.Platform.NetworkConnection.overDataLimit:
+ case MS.Entertainment.Platform.NetworkConnection.switchedToMetered:
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_handleNetworkConnectionChanged: overDataLimit");
+ break
+ }
+ }, _pauseStreamingAndFireError: function _pauseStreamingAndFireError(error) {
+ MSEPlatform.Playback.Etw.traceString("PlaybackController::_pauseStreamingAndFireError");
+ if (!this._isPlayerSet() || this.currentTransportState === MSEPlatform.Playback.TransportState.unInitialize || this.currentTransportState === MSEPlatform.Playback.TransportState.stopped || this.currentTransportState === MSEPlatform.Playback.TransportState.paused)
+ return;
+ if (!this.currentMedia || this.currentMedia.isLocal)
+ return;
+ this._player.pause();
+ this._targetTransportState = MSEPlatform.Playback.TransportState.paused;
+ this._fireCriticalPlaybackError(error)
+ }, _applyTargetTransportState: function _applyTargetTransportState(value) {
+ this._targetTransportState = value;
+ try {
+ switch (value)
+ {
+ case MSEPlatform.Playback.TransportState.stopped:
+ if (this.currentTransportState === MSEPlatform.Playback.TransportState.paused)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ else if (this.currentTransportState !== MSEPlatform.Playback.TransportState.stopped)
+ this._player.stop();
+ break;
+ case MSEPlatform.Playback.TransportState.paused:
+ this._player.pause();
+ if (!this._currentMedia || !this._currentMedia.videoAdSupported)
+ this.autoPlay = false;
+ break;
+ case MSEPlatform.Playback.TransportState.playing:
+ if (this.currentTransportState !== MSEPlatform.Playback.TransportState.paused)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.starting;
+ this._player.play();
+ this.activating = false;
+ if (!this._currentMedia || !this._currentMedia.videoAdSupported)
+ this.autoPlay = true;
+ break;
+ default:
+ throw"PlaybackController_applyTargetTransportState: Error! Unsupported state - " + value;
+ }
+ }
+ catch(exception) {
+ if (this._player._currentPlayer === null)
+ this.currentTransportState = MSEPlatform.Playback.TransportState.stopped;
+ else
+ throw exception;
+ }
+ }, currentMedia: MS.Entertainment.UI.Framework.observableProperty("currentMedia", null), currentPosition: MS.Entertainment.UI.Framework.observableProperty("currentPosition", 0), currentTransportState: MS.Entertainment.UI.Framework.observableProperty("currentTransportState", MS.Entertainment.Platform.Playback.TransportState.stopped), isAudioAd: MS.Entertainment.UI.Framework.observableProperty("isAudioAd", false), isPreview: MS.Entertainment.UI.Framework.observableProperty("isPreview", false), duration: MS.Entertainment.UI.Framework.observableProperty("duration", 0), errorDescriptor: MS.Entertainment.UI.Framework.observableProperty("errorDescriptor", null), nextMedia: MS.Entertainment.UI.Framework.observableProperty("nextMedia", null), playerState: MS.Entertainment.UI.Framework.observableProperty("playerState", MS.Entertainment.Platform.Playback.PlayerState.notReady), readyForNextMedia: MS.Entertainment.UI.Framework.observableProperty("readyForNextMedia", false), videoWidth: MS.Entertainment.UI.Framework.observableProperty("videoWidth", 0), videoHeight: MS.Entertainment.UI.Framework.observableProperty("videoHeight", 0), playbackRate: MS.Entertainment.UI.Framework.observableProperty("playbackRate", 1), minPlaybackRate: MS.Entertainment.UI.Framework.observableProperty("minPlaybackRate", -128), maxPlaybackRate: MS.Entertainment.UI.Framework.observableProperty("maxPlaybackRate", 128), _isVideo: MS.Entertainment.UI.Framework.observableProperty("_isVideo", false), seekedPosition: MS.Entertainment.UI.Framework.observableProperty("seekedPosition", 0), isRemoteSessionRunning: MS.Entertainment.UI.Framework.observableProperty("isRemoteSessionRunning", false), playToSenderConnectionState: MS.Entertainment.UI.Framework.observableProperty("playToSenderConnectionState", Windows.Media.PlayTo.PlayToConnectionState.disconnected), mediaElement: MS.Entertainment.UI.Framework.observableProperty("mediaElement", false), error: MS.Entertainment.UI.Framework.observableProperty("error", null), currentRequestedBitrate: MS.Entertainment.UI.Framework.observableProperty("currentRequestedBitrate", null), _configManager: null, _offlineNetworkRequestDelay: 100, _internalCurrentMedia: null, _player: null, _targetTransportState: MSEPlatform.Playback.TransportState.unInitialize, _targetPosition: 0, _sessionMgr: null, _erroredMediaInstances: [], _signalForNextMediaPromise: null, _nextMediaInstanceAfterAd: null, _skipButtonPressed: false, _prerollPromise: null, _prerollPromiseOrdinal: 0, _lastErrorEncountered: null, _hasSameErrors: true, _hasPlayedSong: false, _errorCount: 0, _maxSequentialErrors: 25, _canResetOnNullMediaInstance: true
+ }, {createInstance: function createInstance() {
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ return new MS.Entertainment.Platform.Playback.PlaybackControllerMusic1;
+ else if (MS.Entertainment.Utilities.isMusicApp2)
+ return new MS.Entertainment.Platform.Playback.PlaybackControllerMusic;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ return new MS.Entertainment.Platform.Playback.PlaybackControllerVideo;
+ else if (MS.Entertainment.Utilities.isTestApp || MS.Entertainment.Utilities.isAmsterdamApp)
+ return new MS.Entertainment.Platform.Playback.PlaybackController;
+ else
+ MS.Entertainment.Utilities.fail("PlaybackController.createInstance() Wrong app mode")
+ }})})
+})()
+})();
+/* >>>>>>/components/playback/closedcaptions/presenter.js:3107 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MS.Entertainment.Platform.Playback, "ClosedCaptions", {PresenterObservables: MS.Entertainment.defineObservable(function PresenterObservables_ctor(){}, {})});
+ WinJS.Namespace.defineWithParent(MS.Entertainment.Platform.Playback, "ClosedCaptions", {Presenter: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.ClosedCaptions.PresenterObservables", function Presenter_ctor(renderer, rendererContainer) {
+ if (!renderer || !rendererContainer)
+ throw"Need to pass in a Renderer!";
+ MSEPlatform.Playback.ClosedCaptions.PresenterObservables.prototype.constructor.call(this);
+ this._ccRenderer = renderer;
+ this._iPlaybackControl = renderer._iPlaybackControl;
+ this._ccContainer = rendererContainer
+ }, {
+ flush: function Presenter_flush() {
+ this._presenterQueue = [];
+ this._ccContainer.innerHTML = ""
+ }, start: function Presenter_start() {
+ if (!this._ccContainer)
+ return;
+ if (this._animationFrameHandle)
+ window.cancelAnimationFrame(this._animationFrameHandle);
+ this._animationFrameHandle = window.requestAnimationFrame(this._presenterLoop.bind(this))
+ }, stop: function Presenter_stop() {
+ if (this._animationFrameHandle) {
+ window.cancelAnimationFrame(this._animationFrameHandle);
+ this._animationFrameHandle = 0
+ }
+ }, presentAt: function Presenter_present(dataGeneratedAt, dataValidUntil, htmlBlob) {
+ if (this._presenterQueue.length >= this._maxPresenterQueueSize) {
+ var droppedFrame = this._presenterQueue.shift();
+ MSEPlatform.Playback.Etw.traceCCDroppedFrame(droppedFrame.dataGeneratedAt, droppedFrame.dataValidUntil, this._currentPosition)
+ }
+ this._presenterQueue.push({
+ dataGeneratedAt: dataGeneratedAt, dataValidUntil: dataValidUntil, htmlBlob: htmlBlob
+ })
+ }, _ccRenderer: null, _iPlaybackControl: null, _ccContainer: null, _presenterQueue: [], _maxPresenterQueueSize: 100, _animationFrameHandle: 0, _currentPosition: 0, _lateToleranceMsec: 100, _scheduleAnimationCallback: function Presenter_scheduleAnimationCallback() {
+ this._animationFrameHandle = window.requestAnimationFrame(this._presenterLoop.bind(this))
+ }, _presenterLoop: function Presenter_presenterLoop() {
+ if (this._presenterQueue.length === 0) {
+ this._scheduleAnimationCallback();
+ return
+ }
+ var frameToBePresented = null;
+ this._currentPosition = this._iPlaybackControl.currentPosition;
+ do {
+ frameToBePresented = this._presenterQueue[0];
+ if (this._currentPosition < frameToBePresented.dataGeneratedAt) {
+ frameToBePresented = null;
+ break
+ }
+ if (this._currentPosition > frameToBePresented.dataValidUntil + this._lateToleranceMsec) {
+ frameToBePresented = null;
+ var droppedFrame = this._presenterQueue.shift();
+ MSEPlatform.Playback.Etw.traceCCDroppedFrame(droppedFrame.dataGeneratedAt, droppedFrame.dataValidUntil, this._currentPosition)
+ }
+ else {
+ frameToBePresented = this._presenterQueue.shift();
+ break
+ }
+ } while (this._presenterQueue.length > 0);
+ if (frameToBePresented)
+ try {
+ this._ccContainer.style.display = "none";
+ this._ccContainer.innerHTML = frameToBePresented.htmlBlob;
+ MS.Entertainment.Platform.Playback.ClosedCaptions.getUserSettings().applySettings(this._ccContainer);
+ this._ccContainer.style.display = ""
+ }
+ catch(ex) {
+ var msg = "CC Error: Malformed HTML ignored @(" + frameToBePresented.dataGeneratedAt + ") : " + frameToBePresented.htmlBlob;
+ MSEPlatform.Playback.Etw.traceString(msg);
+ var mediaId,
+ source;
+ try {
+ mediaId = this._iPlaybackControl.currentMedia.mediaInstanceId
+ }
+ catch(ex) {
+ {}
+ }
+ try {
+ source = this._iPlaybackControl.currentMedia.source
+ }
+ catch(ex) {
+ {}
+ }
+ if (!source)
+ source = "unknownSource";
+ if (!mediaId)
+ mediaId = "unknownMediaId";
+ MS.Entertainment.Platform.Playback.assert(false, msg, this._iPlaybackControl.currentMedia.serviceIdSafe + "/" + mediaId + " " + source)
+ }
+ this._scheduleAnimationCallback()
+ }
+ }, {})})
+})()
+})();
+/* >>>>>>/components/playback/closedcaptions/renderer.js:3205 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ var MSEPlatform = WinJS.Namespace.define("MS.Entertainment.Platform", null);
+ WinJS.Namespace.defineWithParent(MS.Entertainment.Platform.Playback, "ClosedCaptions", {
+ RendererObservables: MS.Entertainment.defineObservable(function RendererObservables_ctor(){}, {ccLcid: 0}), getUserSettings: (function() {
+ function app2SettingsSignature() {
+ var signature = "";
+ for (var p in MS.Entertainment.Platform.ClosedCaptions.ClosedCaptionProperties)
+ if (typeof p !== "function")
+ try {
+ signature += p + ": " + JSON.stringify(MS.Entertainment.Platform.ClosedCaptions.ClosedCaptionProperties[p])
+ }
+ catch(ex) {
+ signature += p
+ }
+ return signature
+ }
+ {};
+ var edgeToShadowConverter = {
+ 1: "none", 2: "-1px 0px 0px silver, 0px -1px 0px silver, 1px 1px 0px black, 2px 2px 0px black, 3px 3px 0px black", 3: "1px 1px 0px silver, 0px 1px 0px silver, -1px -1px 0px black, -1px 0px 0px black", 4: "0px 0px 4px black, 0px 0px 4px black, 0px 0px 4px black, 0px 0px 4px black", 5: "3px 3px 3px 2px black"
+ };
+ function textEdgeShadow(edgeEnum) {
+ return edgeToShadowConverter[+edgeEnum]
+ }
+ function BaseUserSettingsPlatform() {
+ this.needToModifyDOMToApplySetttings = false;
+ this.loadAndUpdateClosedCaptionStyleSettings = function base_loadAndUpdateClosedCaptionStyleSettings() {
+ var ccSettings = this.loadClosedCaptionStyleSettings();
+ if (ccSettings)
+ this.updateClosedCaptionStyleSettings(ccSettings)
+ };
+ this.loadClosedCaptionStyleSettings = function base_loadClosedCaptionStyleSettings() {
+ var settingsStorage = Windows.Storage.ApplicationData.current.roamingSettings;
+ if (settingsStorage)
+ return {
+ regionBackgroundColor: settingsStorage.values["CC_REGION_background-color"], regionOpacity: settingsStorage.values["CC_REGION_opacity"], textFontFamily: settingsStorage.values["CC_TEXT_font-family"], textFontSize: settingsStorage.values["CC_TEXT_font-size"], textEdgeAttributeEnum: settingsStorage.values["CC_TEXT_edge-attribute"], textColor: settingsStorage.values["CC_TEXT_color"], textOpacity: settingsStorage.values["CC_TEXT_opacity"], textBackgroundColor: settingsStorage.values["CC_TEXT_background-color"], textBackgroundOpacity: settingsStorage.values["CC_TEXT_background-opacity"]
+ };
+ else
+ return null
+ };
+ this.saveClosedCaptionStyleSettings = function base_saveClosedCaptionStyleSettings(ccSettings) {
+ if (!ccSettings)
+ return;
+ var settingsStorage = Windows.Storage.ApplicationData.current.roamingSettings;
+ if (ccSettings.hasOwnProperty("regionBackgroundColor"))
+ settingsStorage.values["CC_REGION_background-color"] = ccSettings["regionBackgroundColor"];
+ if (ccSettings.hasOwnProperty("regionOpacity"))
+ settingsStorage.values["CC_REGION_opacity"] = ccSettings["regionOpacity"];
+ if (ccSettings.hasOwnProperty("textFontFamily"))
+ settingsStorage.values["CC_TEXT_font-family"] = ccSettings["textFontFamily"];
+ if (ccSettings.hasOwnProperty("textFontSize"))
+ settingsStorage.values["CC_TEXT_font-size"] = ccSettings["textFontSize"];
+ if (ccSettings.hasOwnProperty("textEdgeAttributeEnum"))
+ settingsStorage.values["CC_TEXT_edge-attribute"] = ccSettings["textEdgeAttributeEnum"];
+ if (ccSettings.hasOwnProperty("textColor"))
+ settingsStorage.values["CC_TEXT_color"] = ccSettings["textColor"];
+ if (ccSettings.hasOwnProperty("textOpacity"))
+ settingsStorage.values["CC_TEXT_opacity"] = ccSettings["textOpacity"];
+ if (ccSettings.hasOwnProperty("textBackgroundColor"))
+ settingsStorage.values["CC_TEXT_background-color"] = ccSettings["textBackgroundColor"];
+ if (ccSettings.hasOwnProperty("textBackgroundOpacity"))
+ settingsStorage.values["CC_TEXT_background-opacity"] = ccSettings["textBackgroundOpacity"]
+ };
+ this.updateClosedCaptionStyleSettings = function base_updateClosedCaptionStyleSettings(ccSettings) {
+ var paragraphStyle = ".cc_layout P";
+ var spanStyle = ".cc_layout SPAN";
+ function rgbaFromSplitColor(settings, attr, opacity) {
+ var calculatedOpacity = opacity ? settings[opacity] : settings[attr + "Opacity"];
+ if (calculatedOpacity === String.empty)
+ return "rgb(" + settings[attr + "Color"] + ")";
+ return "rgba(" + settings[attr + "Color"] + "," + calculatedOpacity + ")"
+ }
+ var ccOverrideProcessor = {
+ regionOpacity: function(ctxt, ccSettings) {
+ if (ccSettings["regionOpacity"]) {
+ ctxt.rule(paragraphStyle).add("background-color", rgbaFromSplitColor(ccSettings, "regionBackground", "regionOpacity"));
+ ctxt.rule(paragraphStyle).add("outline", rgbaFromSplitColor(ccSettings, "regionBackground", "regionOpacity") + " 15px solid")
+ }
+ }, regionBackgroundColor: function(){}, textFontFamily: function(ctxt, ccSettings) {
+ var textFontFamily = ccSettings["textFontFamily"];
+ if (!textFontFamily)
+ return;
+ ctxt.rule(paragraphStyle).add("font-family", textFontFamily);
+ ctxt.rule(spanStyle).add("font-family", textFontFamily);
+ if (this.isFontUsedForSmallCaps(textFontFamily)) {
+ ctxt.rule(paragraphStyle).add("font-variant", "small-caps");
+ ctxt.rule(spanStyle).add("font-variant", "small-caps")
+ }
+ }, textFontSize: function(ctxt, ccSettings) {
+ ctxt.rule(paragraphStyle).add("font-size", ccSettings["textFontSize"])
+ }, textEdgeAttribute: function(ctxt, ccSettings) {
+ ctxt.rule(paragraphStyle).add("text-shadow", ccSettings["textEdgeAttribute"])
+ }, textEdgeAttributeEnum: function(ctxt, ccSettings) {
+ ctxt.rule(paragraphStyle).add("text-shadow", textEdgeShadow(ccSettings["textEdgeAttributeEnum"]))
+ }, textOpacity: function(){}, textColor: function(ctxt, ccSettings) {
+ ctxt.rule(paragraphStyle).add("color", rgbaFromSplitColor(ccSettings, "text"));
+ ctxt.rule(spanStyle).add("color", rgbaFromSplitColor(ccSettings, "text"))
+ }, textBackgroundColor: function(){}, textBackgroundOpacity: function(ctxt, ccSettings) {
+ this.needToModifyDOMToApplySetttings = (ccSettings["textBackgroundOpacity"] === String.empty) || (ccSettings["textBackgroundOpacity"] > 0);
+ ctxt.rule(spanStyle).add("background-color", rgbaFromSplitColor(ccSettings, "textBackground"))
+ }
+ };
+ function CSSRule() {
+ var attributes = {};
+ this.add = function(attribute, value, overridableByInline) {
+ if (value !== null && value !== undefined)
+ attributes[attribute] = {
+ value: value, overridableByInline: !!overridableByInline
+ }
+ };
+ this.toString = function() {
+ var firstAttribute = true;
+ var cssText = "";
+ for (var attribute in attributes) {
+ if (firstAttribute)
+ firstAttribute = false;
+ else
+ cssText += "; ";
+ cssText += attribute + ": ";
+ cssText += attributes[attribute].value;
+ if (!attributes[attribute].overridableByInline)
+ cssText += " !important"
+ }
+ return "{" + cssText + "}"
+ }
+ }
+ {};
+ function CSSContext() {
+ var selectors = {};
+ this.rule = function rule(cssSelector) {
+ if (!selectors[cssSelector])
+ selectors[cssSelector] = new CSSRule;
+ return selectors[cssSelector]
+ };
+ this.applyStyle = function() {
+ function getEmptyStyleElement() {
+ var id = "CCStyleSheet";
+ var ccStyleElement = document.getElementById(id);
+ if (!ccStyleElement) {
+ ccStyleElement = document.createElement("STYLE");
+ document.documentElement.firstChild.appendChild(ccStyleElement);
+ ccStyleElement.id = id
+ }
+ else if (ccStyleElement.sheet && ccStyleElement.sheet.rules) {
+ var total = ccStyleElement.sheet.rules.length;
+ for (var i = 0; i < total; i++)
+ ccStyleElement.sheet.deleteRule(0)
+ }
+ return ccStyleElement
+ }
+ var ccStyleElement = getEmptyStyleElement();
+ for (var selector in selectors)
+ ccStyleElement.sheet.insertRule(selector + selectors[selector], 0)
+ }
+ }
+ {};
+ this.needToModifyDOMToApplySetttings = false;
+ var overrideContext = new CSSContext;
+ for (var customSetting in ccSettings) {
+ MS.Entertainment.Platform.Playback.assert(ccOverrideProcessor[customSetting], "Fix this: Illegal CC custom setting or missing handler - " + customSetting);
+ if (ccOverrideProcessor[customSetting])
+ ccOverrideProcessor[customSetting].bind(this)(overrideContext, ccSettings)
+ }
+ overrideContext.applyStyle()
+ };
+ this.applySettings = function base_applySettings(ccContainer) {
+ if (this.needToModifyDOMToApplySetttings) {
+ var spanCandidates = ccContainer.querySelectorAll("P");
+ for (var i = 0; i < spanCandidates.length; i++) {
+ var pElements = ccContainer.querySelectorAll("P")[i].childNodes;
+ for (var j = 0; j < pElements.length; j++) {
+ var pChildNode = pElements[j];
+ if (pChildNode.nodeName === "#text") {
+ var span = document.createElement('SPAN');
+ span.className = "cc_text";
+ pChildNode.parentNode.replaceChild(span, pChildNode);
+ span.appendChild(pChildNode)
+ }
+ }
+ }
+ }
+ };
+ this.isFontUsedForSmallCaps = function base_isFontUsedForSmallCaps(fontName) {
+ return fontName === "trebuchet ms"
+ }
+ }
+ function App2UserSettingsPlatform(){}
+ {};
+ App2UserSettingsPlatform.prototype = new BaseUserSettingsPlatform;
+ App2UserSettingsPlatform.prototype.saveClosedCaptionStyleSettings = function(){};
+ var app2CCFontFamilyConverter = {
+ 0: String.empty, 1: "courier new", 2: "times new roman", 3: "lucida console", 4: "tahoma", 5: "comic sans ms", 6: "segoe script", 7: "trebuchet ms"
+ };
+ App2UserSettingsPlatform.prototype.loadClosedCaptionStyleSettings = function app2_loadClosedCaptionStyleSettings() {
+ var fontSizeEnumConverter = {
+ 0: "100%", 1: "50%", 2: "75%", 3: "150%", 4: "200%"
+ };
+ function fontFamily(app2Enum) {
+ return app2CCFontFamilyConverter[app2Enum]
+ }
+ {};
+ function percentagefontSize(enumFontSize) {
+ return fontSizeEnumConverter[enumFontSize]
+ }
+ function rgb(c) {
+ return c.r + "," + c.g + "," + c.b
+ }
+ function opacity(c) {
+ return c.a / 255
+ }
+ function addCCProperty(container, name, value) {
+ if (value === undefined || value === null)
+ return;
+ container[name] = value
+ }
+ var userSettings = MS.Entertainment.Platform.ClosedCaptions.ClosedCaptionProperties;
+ this.currentSignature = app2SettingsSignature();
+ var output = {};
+ if (userSettings.isEnabled && !userSettings.useDefaultOptions) {
+ addCCProperty(output, "regionBackgroundColor", rgb(userSettings.windowColor));
+ addCCProperty(output, "regionOpacity", opacity(userSettings.windowColor));
+ addCCProperty(output, "textFontFamily", fontFamily(userSettings.fontStyle));
+ addCCProperty(output, "textFontSize", percentagefontSize(userSettings.fontSize));
+ addCCProperty(output, "textEdgeAttribute", textEdgeShadow(userSettings.fontEdgeAttribute));
+ addCCProperty(output, "textColor", rgb(userSettings.fontColor));
+ addCCProperty(output, "textOpacity", opacity(userSettings.fontColor));
+ addCCProperty(output, "textBackgroundColor", rgb(userSettings.backgroundColor));
+ addCCProperty(output, "textBackgroundOpacity", opacity(userSettings.backgroundColor))
+ }
+ return output
+ };
+ var baseApplySettings = App2UserSettingsPlatform.prototype.applySettings;
+ App2UserSettingsPlatform.prototype.applySettings = function(ccContainer) {
+ if (this.currentSignature !== app2SettingsSignature())
+ this.loadAndUpdateClosedCaptionStyleSettings();
+ baseApplySettings.bind(this)(ccContainer)
+ };
+ App2UserSettingsPlatform.prototype.isFontUsedForSmallCaps = function app2_isFontUsedForSmallCaps(fontName) {
+ return fontName === app2CCFontFamilyConverter[MS.Entertainment.Platform.ClosedCaptions.Meta.FontStyle.smallCapitals]
+ };
+ var ccUserSettingsImplementation = null;
+ return function getUserSettingsPlatform() {
+ if (!ccUserSettingsImplementation)
+ try {
+ var testUserSettingsCapability = MS.Entertainment.Platform.ClosedCaptions.ClosedCaptionProperties;
+ ccUserSettingsImplementation = new App2UserSettingsPlatform
+ }
+ catch(ex) {
+ ccUserSettingsImplementation = new BaseUserSettingsPlatform
+ }
+ return ccUserSettingsImplementation
+ }
+ })()
+ });
+ WinJS.Namespace.defineWithParent(MS.Entertainment.Platform.Playback, "ClosedCaptions", {Renderer: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Platform.Playback.ClosedCaptions.RendererObservables", function Renderer_ctor(playbackControl, rendererContainer) {
+ if (!playbackControl || !rendererContainer)
+ return;
+ MSEPlatform.Playback.ClosedCaptions.RendererObservables.prototype.constructor.call(this);
+ WinJS.Utilities.addClass(rendererContainer, "hideFromDisplay");
+ this._iPlaybackControl = playbackControl;
+ this._ccContainer = rendererContainer;
+ this._initialize(rendererContainer)
+ }, {
+ closedCaptionsOn: {
+ set: function Renderer_closedCaptionsOn_set(value) {
+ MSEPlatform.Playback.Etw.traceClosedCaptionsOn(value);
+ if (value !== this._closedCaptionsOn)
+ this._onToggleCC(value)
+ }, get: function Renderer_closedCaptionsOn_get() {
+ return this._closedCaptionsOn
+ }
+ }, _closedCaptionsOn: false, _iPlaybackControl: null, _ccPresenter: null, _ttmlProcessor: null, _ccContainer: null, _ttmlFilepath: String.empty, _ttmlFileLoaded: false, _currentMedia: null, _currentMediaInstance: null, _renderingPaused: true, _playbackControlBindings: null, _resizeCallback: null, _processorLeadTime: 1000, _currentGeneratedAt: 0, _currentValidUntil: 0, _initialize: function Renderer_initialize(rendererContainer) {
+ if (!this._iPlaybackControl)
+ return;
+ if (MS.Entertainment.Utilities.isVideoApp || MS.Entertainment.Utilities.isMusicApp2) {
+ this._ttmlProcessor = new Microsoft.Entertainment.ClosedCaptions.TTMLProcessor;
+ this._ccPresenter = new MSEPlatform.Playback.ClosedCaptions.Presenter(this, rendererContainer);
+ if (this._closedCaptionsOn)
+ this._bindToPlaybackControl();
+ this.bind("ccLcid", this._onLcidChanged.bind(this))
+ }
+ else
+ this._closedCaptionsOn = false
+ }, _bindToPlaybackControl: function Renderer_bindToPlaybackControl() {
+ this._playbackControlBindings = WinJS.Binding.bind(this._iPlaybackControl, {
+ currentMedia: this._onMediaChanged.bind(this), videoHeight: this._onVideoSizeChanged.bind(this), currentPosition: this._onPositionChanged.bind(this), currentTransportState: this._onTransportStateChanged.bind(this), seekedPosition: this._onSeeked.bind(this)
+ });
+ this._resizeCallback = this._setupRenderingSurface.bind(this);
+ MS.Entertainment.Utilities.attachResizeEvent(this._ccContainer, this._resizeCallback)
+ }, _unbindFromPlaybackControl: function Renderer_unbindFromPlaybackControl() {
+ if (this._playbackControlBindings) {
+ this._playbackControlBindings.cancel();
+ this._playbackControlBindings = null
+ }
+ MS.Entertainment.Utilities.detachResizeEvent(this._ccContainer, this._resizeCallback)
+ }, _reset: function Renderer_reset() {
+ this._ttmlFileLoaded = false;
+ this._ccPresenter.flush();
+ this._invalidateRenderingTimeWindow()
+ }, _onToggleCC: function Renderer_onToggleCC(activate) {
+ this._closedCaptionsOn = activate;
+ if (activate) {
+ WinJS.Utilities.removeClass(this._ccContainer, "hideFromDisplay");
+ this._iPlaybackControl.enableTimeUpdate();
+ this._bindToPlaybackControl()
+ }
+ else {
+ WinJS.Utilities.addClass(this._ccContainer, "hideFromDisplay");
+ this._stopRendering();
+ this._unbindFromPlaybackControl()
+ }
+ }, _onLcidChanged: function Renderer_onLcidChanged(newLcid, oldLcid) {
+ if (!oldLcid || !newLcid || !this._closedCaptionsOn)
+ return;
+ var currentMediaInstance = this._currentMediaInstance;
+ if (currentMediaInstance) {
+ this._ttmlFileLoaded = false;
+ this._onMediaChanged(currentMediaInstance)
+ }
+ }, _onMediaChanged: function Renderer_onMediaChanged(newMedia) {
+ if (!newMedia)
+ return;
+ if (!this._closedCaptionsOn)
+ return;
+ if (newMedia.isEqual(this._currentMediaInstance) && this._ttmlFileLoaded) {
+ this._invalidateRenderingTimeWindow();
+ this._startRendering()
+ }
+ else {
+ this._reset();
+ this._currentMediaInstance = newMedia;
+ this._currentMedia = null;
+ if (newMedia._mediaItem)
+ this._currentMedia = newMedia._mediaItem.data;
+ this._getTTMLFilepath().then(function _gotTTMLFile(filePath) {
+ this._loadTTMLFile(filePath).then(function _loadedTTMLFile() {
+ this._startRendering()
+ }.bind(this), function _cantLoadTTMLFile(error){})
+ }.bind(this), function _noTTMLFile(error){})
+ }
+ this._setupRenderingSurface()
+ }, _onVideoSizeChanged: function Renderer_onVideoSizeChanged(videoHeight) {
+ this._setupRenderingSurface()
+ }, _onPositionChanged: function Renderer_onPositionChanged(playbackPosition) {
+ if (!this._closedCaptionsOn || !this._ttmlFileLoaded)
+ return;
+ this._checkAndProcessNextClosedCaptionsBlob(playbackPosition)
+ }, _onTransportStateChanged: function Renderer_onTransportStateChanged(newTS) {
+ if (!this._closedCaptionsOn || !this._ttmlFileLoaded)
+ return;
+ switch (newTS) {
+ case MSEPlatform.Playback.TransportState.playing:
+ WinJS.Promise.timeout(500).then(function onDelayedPlaying() {
+ this._setupRenderingSurface()
+ }.bind(this));
+ this._startRendering();
+ break;
+ case MSEPlatform.Playback.TransportState.paused:
+ this._stopRendering();
+ break;
+ case MSEPlatform.Playback.TransportState.stopped:
+ this._stopRendering();
+ break
+ }
+ }, _onSeeked: function Renderer_onSeeked(newPosition) {
+ if (!this._closedCaptionsOn || !this._ttmlFileLoaded)
+ return;
+ this._ccPresenter.flush();
+ this._invalidateRenderingTimeWindow();
+ this._renderingPaused = false;
+ this._checkAndProcessNextClosedCaptionsBlob(this._iPlaybackControl.currentPosition);
+ this._ccPresenter._presenterLoop()
+ }, _setupRenderingSurface: function _setupRenderingSurface() {
+ var surfaceHeight = 0;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (this._iPlaybackControl.videoWidth && this._iPlaybackControl.videoHeight) {
+ surfaceHeight = Math.floor(this._iPlaybackControl.videoHeight * (this._ccContainer.clientWidth / this._iPlaybackControl.videoWidth));
+ if (surfaceHeight && this._ccContainer.parentElement && this._ccContainer.parentElement.clientHeight) {
+ surfaceHeight = Math.min(surfaceHeight, this._ccContainer.parentElement.clientHeight);
+ this._ccContainer.style.height = surfaceHeight + "px";
+ this._ccContainer.style.top = ((this._ccContainer.parentElement.clientHeight - surfaceHeight) >> 1) + "px";
+ this._ccContainer.style.fontSize = Math.floor(surfaceHeight * 0.05) + "px"
+ }
+ }
+ this._startRendering()
+ }, _invalidateRenderingTimeWindow: function Renderer_invalidateRenderingTimeWindow() {
+ this._currentGeneratedAt = 0;
+ this._currentValidUntil = 0
+ }, _findClosedCaptionsUrl: function Renderer_findClosedCaptionsUrl(miid) {
+ var ccInfo = null;
+ if (miid && this._currentMedia && this._currentMedia.closedCaptionFiles) {
+ var ccFiles = this._currentMedia.closedCaptionFiles;
+ var mediaInstanceId = null;
+ var lcid = null;
+ miid = miid.replace(/{/g, '');
+ miid = miid.replace(/}/g, '');
+ for (var i = 0; i < ccFiles.length; i++) {
+ mediaInstanceId = ccFiles[i].mediaInstanceId;
+ lcid = ccFiles[i].lcid;
+ if (mediaInstanceId) {
+ mediaInstanceId = mediaInstanceId.replace(/{/g, '');
+ mediaInstanceId = mediaInstanceId.replace(/}/g, '');
+ if (mediaInstanceId.toLowerCase() === miid && (!this.ccLcid || +lcid === +(this.ccLcid))) {
+ ccInfo = {
+ url: ccFiles[i].fileUri, name: ccFiles[i].name
+ };
+ break
+ }
+ }
+ }
+ }
+ return ccInfo
+ }, _getTTMLFilepath: function Renderer_getTTMLFilepath() {
+ var smid = (this._currentMedia ? this._currentMedia.zuneId || this._currentMedia.serviceId : null);
+ var miid = (this._currentMediaInstance ? (this._currentMediaInstance.mediaInstanceId ? this._currentMediaInstance.mediaInstanceId.toLowerCase() : null) : null);
+ var url = String.empty;
+ var name = String.empty;
+ var ccInfo = this._findClosedCaptionsUrl(miid);
+ if (ccInfo) {
+ url = ccInfo.url;
+ name = ccInfo.name
+ }
+ MSEPlatform.Playback.Etw.traceCCRendererGetTTMLFilepath("begin", smid, miid, this.ccLcid, url);
+ if (smid && miid && url && name)
+ return new WinJS.Promise(function _getTTMLFilePromise(c, e, p) {
+ Microsoft.Entertainment.ClosedCaptionDownloader.getClosedCaptionFileAsync(url, smid, miid, name, this.ccLcid).then(function _getTTMLFile_success(path) {
+ MSEPlatform.Playback.Etw.traceCCRendererGetTTMLFilepath("end", smid, miid, this.ccLcid, path);
+ c(path)
+ }.bind(this), function _getTTMLFile_failed(error) {
+ MSEPlatform.Playback.Etw.traceCCRendererGetTTMLFilepath("failed: " + error, smid, miid, this.ccLcid, url);
+ e(error)
+ }.bind(this))
+ }.bind(this));
+ else {
+ MSEPlatform.Playback.Etw.traceCCRendererGetTTMLFilepath("failed: E_INVALIDARGS", smid, miid, this.ccLcid, url);
+ return WinJS.Promise.wrapError("E_INVALIDARGS")
+ }
+ }, _ttmlProcessorLoadAsync: function _ttmlProcessorLoad(storageFile) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return this._ttmlProcessor.loadFromStorageFile(storageFile);
+ else
+ return Windows.Storage.FileIO.readTextAsync(storageFile).then(function loadTTMLAsString(ttmlAsString) {
+ try {
+ this._ttmlProcessor.loadFromString(ttmlAsString)
+ }
+ catch(ex) {
+ return WinJS.Promise.wrapError("_ttmlProcessor.loadFromString failed with " + ex)
+ }
+ }.bind(this))
+ }, _loadTTMLFile: function Renderer_loadTTMLFile(filePath) {
+ if (!filePath)
+ return WinJS.Promise.wrapError("Renderer_loadTTMLFile: Error! Empty filePath.");
+ MSEPlatform.Playback.Etw.traceCCRendererLoadTTMLFile("begin", filePath);
+ return new WinJS.Promise(function _loadTTMLPromise(c, e, p) {
+ try {
+ Windows.Storage.StorageFile.getFileFromPathAsync(filePath).then(function _gotFile(storageFile) {
+ this._ttmlProcessorLoadAsync(storageFile).then(function _loadTTMLFile_success() {
+ MSEPlatform.Playback.Etw.traceCCRendererLoadTTMLFile("end", filePath);
+ this._ttmlFilepath = filePath;
+ this._ttmlFileLoaded = true;
+ c()
+ }.bind(this), function _loadTTMLFile_failed(errorFromLoad) {
+ MSEPlatform.Playback.Etw.traceCCRendererLoadTTMLFile("failed: " + errorFromLoad, filePath);
+ e(errorFromLoad)
+ }, function _loadTTMLFile_progress(progress) {
+ MSEPlatform.Playback.Etw.traceCCRendererLoadTTMLFile("progress : " + progress, filePath)
+ })
+ }.bind(this), function _noFileFromStorage(errorFromStorage) {
+ MSEPlatform.Playback.Etw.traceCCRendererLoadTTMLFile("failed: " + errorFromStorage, filePath);
+ e(errorFromStorage)
+ })
+ }
+ catch(ex) {
+ MSEPlatform.Playback.Etw.traceCCRendererLoadTTMLFile("failed: " + ex, filePath);
+ e(ex)
+ }
+ }.bind(this))
+ }, _getHtmlBlob: function Renderer_getHtmlBlob(msecPosition) {
+ var ttmlOutput = null;
+ try {
+ ttmlOutput = this._ttmlProcessor.renderAt(msecPosition)
+ }
+ catch(ex) {}
+ return (ttmlOutput ? JSON.parse(ttmlOutput) : null)
+ }, _applyUserSettings: function Renderer_applyUserSettings(htmlBlob) {
+ return htmlBlob
+ }, _startRendering: function Renderer_startRendering() {
+ if (this._renderingPaused) {
+ MSEPlatform.Playback.Etw.traceCCEnterRenderingLoop(this._iPlaybackControl.currentPosition, this._iPlaybackControl.currentTransportState);
+ this._renderingPaused = false;
+ this._ccPresenter.start()
+ }
+ }, _stopRendering: function Renderer_stopRendering() {
+ MSEPlatform.Playback.Etw.traceCCExitRenderingLoop(this._iPlaybackControl.currentPosition, this._iPlaybackControl.currentTransportState, this._closedCaptionsOn);
+ this._renderingPaused = true;
+ this._currentValidUntil = 0;
+ this._ccPresenter.stop()
+ }, _checkAndProcessNextClosedCaptionsBlob: function Renderer_checkAndProcessNextClosedCaptionsBlob(currentPlaybackPosition) {
+ if (this._ttmlFileLoaded && !this._renderingPaused)
+ while (currentPlaybackPosition + this._processorLeadTime >= this._currentValidUntil) {
+ var requestTime = (this._currentValidUntil === 0 ? currentPlaybackPosition : this._currentValidUntil + 1);
+ var blob = this._getHtmlBlob(requestTime);
+ if (blob) {
+ this._currentGeneratedAt = blob.generatedAt;
+ this._currentValidUntil = blob.validUntil;
+ var finalHtml = this._applyUserSettings(blob.html);
+ this._ccPresenter.presentAt(this._currentGeneratedAt, this._currentValidUntil, finalHtml)
+ }
+ else
+ break
+ }
+ }
+ }, {
+ _closedCaptionsStyleSheetId: "CCStyleSheet", loadAndUpdateClosedCaptionStyleSettings: function loadAndUpdateClosedCaptionStyleSettings() {
+ MS.Entertainment.Platform.Playback.ClosedCaptions.getUserSettings().loadAndUpdateClosedCaptionStyleSettings()
+ }, loadClosedCaptionStyleSettings: function loadAndUpdateClosedCaptionStyleSettings() {
+ return MS.Entertainment.Platform.Playback.ClosedCaptions.getUserSettings().loadClosedCaptionStyleSettings()
+ }, saveClosedCaptionStyleSettings: function saveClosedCaptionStyleSettings(ccSettings) {
+ MS.Entertainment.Platform.Playback.ClosedCaptions.getUserSettings().saveClosedCaptionStyleSettings(ccSettings)
+ }, updateClosedCaptionStyleSettings: function updateClosedCaptionStyleSettings(ccSettings, isPreviewOnly) {
+ MS.Entertainment.Platform.Playback.ClosedCaptions.getUserSettings().updateClosedCaptionStyleSettings(ccSettings, isPreviewOnly)
+ }
+ })})
+})()
+})();
+/* >>>>>>/controls/transportcontrols/transportcontrols.js:3734 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TransportControls: MS.Entertainment.UI.Framework.defineUserControl("/Controls/TransportControls/TransportControls.html#transportControlsTemplate", function(element, options) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService)) {
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this._volumeControllerService = volumeControllerService;
+ this._volumeStateBinds = WinJS.Binding.bind(volumeControllerService, {
+ volume: this._onVolumeValueChange.bind(this), mute: this._onMuteStateChange.bind(this), isAudioEndpointAvailable: this._onAudioEndpointChange.bind(this)
+ })
+ }
+ }, {
+ _initialized: false, _messageTimeout: null, _sessionMgr: null, _uiStateService: null, _bindings: null, _eventHandlers: null, _deferredUpdateTimer: null, _isNowPlayingControls: false, _appBarPlaybackOptionsMenu: null, playbackOptionsActions: null, _volumeStateBinds: null, focusPlayOnInitialize: false, _playToStateBinds: null, _volumeControllerService: null, initialize: function initialize() {
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var localShuffleAction = new MS.Entertainment.UI.ToolbarAction;
+ localShuffleAction.id = "appBarTransportControlsShuffle";
+ localShuffleAction.automationId = MS.Entertainment.UI.AutomationIds.transportShuffle;
+ localShuffleAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON);
+ localShuffleAction.icon = MS.Entertainment.UI.Icon.shuffleOn;
+ localShuffleAction.executed = function shuffleExecuted() {
+ this.shuffleButtonClick()
+ }.bind(this);
+ localShuffleAction.isPlaybackOption = true;
+ localShuffleAction.forceTitleChange = true;
+ localShuffleAction.addProperty("isVisible", false);
+ localShuffleAction.ariaLabelOverride = String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON);
+ localShuffleAction.enableAriaPressedOverride = true;
+ localShuffleAction.addProperty("ariaPressed", false);
+ localShuffleAction.isToggleAction = true;
+ this._shuffleAction = localShuffleAction;
+ var localRepeatAction = new MS.Entertainment.UI.ToolbarAction;
+ localRepeatAction.id = "appBarTransportControlsRepeat";
+ localRepeatAction.automationId = MS.Entertainment.UI.AutomationIds.transportRepeat;
+ localRepeatAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON);
+ localRepeatAction.icon = WinJS.UI.AppBarIcon.refresh;
+ localRepeatAction.executed = function repeatExecuted() {
+ this.repeatButtonClick()
+ }.bind(this);
+ localRepeatAction.isPlaybackOption = true;
+ localRepeatAction.forceTitleChange = true;
+ localRepeatAction.addProperty("isVisible", true);
+ localRepeatAction.ariaLabelOverride = String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON);
+ localRepeatAction.enableAriaPressedOverride = true;
+ localRepeatAction.addProperty("ariaPressed", false);
+ localRepeatAction.isToggleAction = true;
+ this._repeatAction = localRepeatAction;
+ var localSkipBackAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipBackAction.id = "appBarTransportControlsPrevious";
+ localSkipBackAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipBack;
+ localSkipBackAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON);
+ localSkipBackAction.icon = MS.Entertainment.UI.Icon.previous;
+ localSkipBackAction.executed = function skipBackExecuted() {
+ this.skipBackButtonClick()
+ }.bind(this);
+ localSkipBackAction.canExecute = function skipBackCanExecute(parameter) {
+ return !this.isDisabled && !this.skipBackDisabled
+ }.bind(this);
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ localSkipBackAction.voicePhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_PREVIOUS_SONG_VUI_ALM);
+ localSkipBackAction.voicePhoneticPhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_PREVIOUS_SONG_VUI_PRON);
+ localSkipBackAction.voiceConfidence = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_PREVIOUS_SONG_VUI_CONF)
+ }
+ this._skipBackAction = localSkipBackAction;
+ var localSkipBackHoldAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipBackHoldAction.id = "appBarTransportControlsPreviousHold";
+ localSkipBackHoldAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipBackHold;
+ localSkipBackHoldAction.canExecute = function skipBackHoldCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ localSkipBackHoldAction.executed = this.skipBackButtonHold.bind(this);
+ this._skipBackHoldAction = localSkipBackHoldAction;
+ var localPlayAction = new MS.Entertainment.UI.ToolbarAction;
+ localPlayAction.id = "appBarTransportControlsPlay";
+ localPlayAction.automationId = MS.Entertainment.UI.AutomationIds.transportPlay;
+ localPlayAction.title = String.load(MS.Entertainment.UI.Controls.TransportControls.playButtonStringId);
+ localPlayAction.icon = MS.Entertainment.UI.Icon.play;
+ localPlayAction.executed = function playExecuted() {
+ this.playPauseButtonClick()
+ }.bind(this);
+ localPlayAction.canExecute = function playCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ this._playAction = localPlayAction;
+ var localPauseAction = new MS.Entertainment.UI.ToolbarAction;
+ localPauseAction.id = "appBarTransportControlsPause";
+ localPauseAction.automationId = MS.Entertainment.UI.AutomationIds.transportPause;
+ localPauseAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON);
+ localPauseAction.icon = WinJS.UI.AppBarIcon.pause;
+ localPauseAction.executed = function pauseExecuted() {
+ this.pauseButtonClick()
+ }.bind(this);
+ localPauseAction.canExecute = function pauseCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ this._pauseAction = localPauseAction;
+ this._playPauseAction = this._playAction;
+ if (this._playPauseButton)
+ this.bind("playVisible", function _updatePlayPause() {
+ var voicePhraseStringId;
+ var voicePhoneticPhraseStringId;
+ var voiceConfidenceStringId;
+ if (this.playVisible) {
+ this._playPauseAction = this._playAction;
+ this._playPauseButton.text = this._playAction.title;
+ voicePhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PLAY_VUI_ALM;
+ voicePhoneticPhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PLAY_VUI_PRON;
+ voiceConfidenceStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PLAY_VUI_CONF
+ }
+ else {
+ this._playPauseAction = this._pauseAction;
+ this._playPauseButton.text = this._pauseAction.title;
+ voicePhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PAUSE_VUI_ALM;
+ voicePhoneticPhraseStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PAUSE_VUI_PRON;
+ voiceConfidenceStringId = String.id.IDS_MUSIC2_NOW_PLAYING_PAUSE_VUI_CONF
+ }
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this._playPauseAction.voicePhrase = String.load(voicePhraseStringId);
+ this._playPauseAction.voicePhoneticPhrase = String.load(voicePhoneticPhraseStringId);
+ this._playPauseAction.voiceConfidence = String.load(voiceConfidenceStringId);
+ XboxJS.UI.Voice.refreshVoiceElements()
+ }
+ }.bind(this));
+ var localSkipForwardAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipForwardAction.id = "appBarTransportControlsForward";
+ localSkipForwardAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipForward;
+ localSkipForwardAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_NEXT_BUTTON);
+ localSkipForwardAction.icon = MS.Entertainment.UI.Icon.next;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ localSkipForwardAction.voicePhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_NEXT_SONG_VUI_ALM);
+ localSkipForwardAction.voicePhoneticPhrase = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_NEXT_SONG_VUI_PRON);
+ localSkipForwardAction.voiceConfidence = String.load(String.id.IDS_MUSIC2_NOW_PLAYING_NEXT_SONG_VUI_CONF);
+ WinJS.Promise.timeout().then(function() {
+ XboxJS.UI.Voice.refreshVoiceElements()
+ })
+ }
+ localSkipForwardAction.executed = function skipForwardExecuted() {
+ this.skipForwardButtonClick()
+ }.bind(this);
+ localSkipForwardAction.canExecute = function skipForwardCanExecute(parameter) {
+ return !this.isDisabled && !this.skipForwardDisabled
+ }.bind(this);
+ this._skipForwardAction = localSkipForwardAction;
+ var localSkipForwardHoldAction = new MS.Entertainment.UI.ToolbarAction;
+ localSkipForwardHoldAction.id = "appBarTransportControlsForwardHold";
+ localSkipForwardHoldAction.automationId = MS.Entertainment.UI.AutomationIds.transportSkipForwardHold;
+ localSkipForwardHoldAction.canExecute = function skipForwardHoldCanExecute(parameter) {
+ return !this.isDisabled
+ }.bind(this);
+ localSkipForwardHoldAction.executed = this.skipForwardButtonHold.bind(this);
+ this._skipForwardHoldAction = localSkipForwardHoldAction;
+ this._initializeVolumeAction();
+ var localSmartGlassAction = new MS.Entertainment.UI.ToolbarAction;
+ localSmartGlassAction.id = "appBarTransportControlsSmartGlass";
+ localSmartGlassAction.automationId = MS.Entertainment.UI.AutomationIds.transportSmartGlass;
+ localSmartGlassAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON);
+ localSmartGlassAction.icon = MS.Entertainment.UI.Icon.game;
+ localSmartGlassAction.executed = function SmartGlassExecuted() {
+ this.smartGlassButtonClick()
+ }.bind(this);
+ localSmartGlassAction.canExecute = function SmartGlassCanExecute(parameter) {
+ return !this.smartGlassDisabled
+ }.bind(this);
+ this._smartGlassAction = localSmartGlassAction;
+ var localXboxAction = new MS.Entertainment.UI.ToolbarAction;
+ localXboxAction.id = "appBarTransportControlsXbox";
+ localXboxAction.automationId = MS.Entertainment.UI.AutomationIds.transportXbox;
+ localXboxAction.icon = MS.Entertainment.UI.Icon.takeFromXbox;
+ localXboxAction.adornerRing = MS.Entertainment.UI.Icon.takeFromXboxAdornerAppbar;
+ localXboxAction.adornerMode = MS.Entertainment.UI.Controls.IconButtonMode.Custom;
+ localXboxAction.hideDefaultRing = true;
+ localXboxAction.executed = function XboxExecuted() {
+ this.xboxButtonClick()
+ }.bind(this);
+ localXboxAction.canExecute = function XboxCanExecute(parameter) {
+ return !this.xboxDisabled
+ }.bind(this);
+ this._xboxAction = localXboxAction;
+ var localClosedCaptionAction = new MS.Entertainment.UI.ToolbarAction;
+ localClosedCaptionAction.id = "playbackOptionsClosedCaption";
+ localClosedCaptionAction.automationId = MS.Entertainment.UI.AutomationIds.transportClosedCaption;
+ localClosedCaptionAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL);
+ localClosedCaptionAction.icon = MS.Entertainment.UI.Icon.closedCaption;
+ localClosedCaptionAction.isComboPlaybackOption = true;
+ localClosedCaptionAction.addProperty("isComboBoxEnabled", false);
+ localClosedCaptionAction.addProperty("availableLanguages", []);
+ localClosedCaptionAction.addProperty("selectedIndex", 0);
+ localClosedCaptionAction.addProperty("isVisible", false);
+ localClosedCaptionAction.currentPlayingMediaInstance = 0;
+ this._closedCaptionAction = localClosedCaptionAction;
+ if (!this._isNowPlayingControls) {
+ this.playbackOptionsActions = [];
+ this.playbackOptionsActions.unshift({action: this._closedCaptionAction});
+ this.playbackOptionsActions.unshift({action: this._repeatAction});
+ this.playbackOptionsActions.unshift({action: this._shuffleAction});
+ this._createPlaybackOptionsMenu()
+ }
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this._initialized = true;
+ this._updateStates();
+ if (this.focusPlayOnInitialize && this._playPauseButton) {
+ var playPauseIconButton = this._playPauseButton.domElement.querySelector(".iconButton");
+ if (playPauseIconButton)
+ MS.Entertainment.UI.Framework.focusElement(playPauseIconButton);
+ else
+ MS.Entertainment.UI.Controls.fail("Expected an iconButton child beneath playPause control")
+ }
+ }, _initializeVolumeAction: function _initializeVolumeAction() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService))
+ return;
+ var localVolumeAction = new MS.Entertainment.UI.ToolbarAction;
+ localVolumeAction.id = "appBarTransportControlsVolume";
+ localVolumeAction.automationId = MS.Entertainment.UI.AutomationIds.transportVolume;
+ if (this._volumeControllerService.isAudioEndpointAvailable) {
+ if (this._volumeControllerService.mute) {
+ localVolumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON);
+ localVolumeAction.icon = WinJS.UI.AppBarIcon.mute
+ }
+ else {
+ var formattedValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(Math.round(this._volumeControllerService.volume * 100));
+ localVolumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON).format(formattedValue);
+ localVolumeAction.icon = WinJS.UI.AppBarIcon.volume
+ }
+ localVolumeAction.canExecute = function volumeActionCanExecute(parameter) {
+ if (this.playbackSession && this.playbackSession.isRemoteSessionRunning) {
+ this.volumeDisabled = true;
+ return false
+ }
+ else {
+ this.volumeDisabled = false;
+ return true
+ }
+ }.bind(this);
+ localVolumeAction.executed = function volumeButtonExecuted() {
+ this.volumeButtonClick()
+ }.bind(this)
+ }
+ else {
+ localVolumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON);
+ localVolumeAction.icon = MS.Entertainment.UI.Icon.volumeDisabled;
+ localVolumeAction.canExecute = function volumeActionCanExecute(parameter) {
+ return false
+ }
+ }
+ this._volumeAction = localVolumeAction;
+ var localVolumeHoldAction = new MS.Entertainment.UI.ToolbarAction;
+ localVolumeHoldAction.id = "appBarTransportControlsVolumeHold";
+ localVolumeHoldAction.automationId = MS.Entertainment.UI.AutomationIds.transportVolumeHold;
+ localVolumeHoldAction.canExecute = function volumeHoldCanExecute(parameter) {
+ return true
+ };
+ localVolumeHoldAction.executed = this.volumeButtonHold.bind(this);
+ this._volumeHoldAction = localVolumeHoldAction
+ }, _onVolumeValueChange: function volumeValueChange(newValue) {
+ var volumeValue = Math.round(newValue * 100);
+ if (this._volumeAction && this._volumeControllerService.isAudioEndpointAvailable)
+ this._updateTitleOnVolumeButton(volumeValue)
+ }, _onMuteStateChange: function muteStateChange(newState) {
+ var muteState = newState;
+ if (this._volumeAction && this._volumeButton && this._volumeControllerService.isAudioEndpointAvailable)
+ if (muteState) {
+ this._volumeButton.icon = WinJS.UI.AppBarIcon.mute;
+ this._volumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON)
+ }
+ else {
+ this._volumeButton.icon = WinJS.UI.AppBarIcon.volume;
+ var volumeValue = Math.round(this._volumeControllerService.volume * 100);
+ this._updateTitleOnVolumeButton(volumeValue)
+ }
+ }, _playToStateChanged: function _playToStateChanged() {
+ if (this._volumeAction)
+ this._volumeAction.requeryCanExecute();
+ if (this._closedCaptionAction)
+ this._handleCCVisibility()
+ }, _handleCCVisibility: function _handleCCVisibility() {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.nowPlayingSession;
+ var isPlayToSessionRunning = playbackSession.isRemoteSessionRunning;
+ if (isPlayToSessionRunning) {
+ this._ccSavedState = this._closedCaptionAction.isComboBoxEnabled;
+ this._closedCaptionAction.isComboBoxEnabled = false
+ }
+ else
+ this._closedCaptionAction.isComboBoxEnabled = this._ccSavedState
+ }, _onAudioEndpointChange: function audioEndpointChange(newState) {
+ this._initializeVolumeAction()
+ }, _updateTitleOnVolumeButton: function updateTitleOnVolumeButton(volumeValue) {
+ var formattedValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(volumeValue);
+ this._volumeAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON).format(formattedValue)
+ }, isVolumeServiceRequired: {get: function() {
+ return (MS.Entertainment.Utilities.isApp1)
+ }}, showMessage: function showMessage(messageTitle, messageText, showDuration, showAppBar) {
+ this.messageVisible = true;
+ this.messageTitle = messageTitle;
+ this.messageSubTitle = messageText;
+ if (this._messageTimeout) {
+ this._messageTimeout.cancel();
+ this._messageTimeout = null
+ }
+ if (showAppBar) {
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.show)
+ appBar.show()
+ }
+ if (showDuration)
+ this._messageTimeout = WinJS.Promise.timeout(showDuration).then(function _delay() {
+ this.clearMessage()
+ }.bind(this))
+ }, clearMessage: function clearMessage() {
+ this.messageVisible = false;
+ this.messageTitle = "";
+ this.messageSubTitle = ""
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ }, unload: function unload() {
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ if (this._volumeStateBinds) {
+ this._volumeStateBinds.cancel();
+ this._volumeStateBinds = null
+ }
+ this._detachBindings();
+ this.unbind("playbackSession");
+ this.unbind("volumeAction");
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _createPlaybackOptionsMenu: function _createPlaybackOptionsMenu() {
+ var container = document.createElement("div");
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.PlaybackOptionsList");
+ this._appBarPlaybackOptionsMenu = new MS.Entertainment.UI.Controls.PlaybackOptionsList(this._playbackOptionsContainer.appendChild(container), {_overflowTitleOverride: String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON)});
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.ActionList");
+ this.bind("playbackOptionsActions", function _updateActions() {
+ this._appBarPlaybackOptionsMenu.items = this.playbackOptionsActions
+ }.bind(this));
+ this._appBarPlaybackOptionsMenu.containerWidth = 100;
+ this._appBarPlaybackOptionsMenu._maxItems = 1;
+ if (this._appBarPlaybackOptionsMenu._getOverflowAction().action)
+ this._appBarPlaybackOptionsMenu._getOverflowAction().action.executed = this._appBarPlaybackOptionsMenu.executeActionUpdateCombo
+ }, updatePlaybackOptionsActionSet: function updatePlaybackOptionsActionSet() {
+ if (this._appBarPlaybackOptionsMenu)
+ this._appBarPlaybackOptionsMenu.updateActionSets()
+ }, _applyBindings: function _applyBindings() {
+ if (this._unloaded)
+ return;
+ this._detachBindings();
+ var mediaStateChanged = this._mediaStateChanged.bind(this);
+ var updateStates = this._updateStates.bind(this);
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.playbackSession, {
+ currentTitleIdChanged: mediaStateChanged, playerStateChanged: this._playerStateChanged.bind(this), currentMediaChanged: mediaStateChanged, currentTransportStateChanged: mediaStateChanged, shuffleChanged: mediaStateChanged, repeatChanged: mediaStateChanged, canSkipBackwardChanged: mediaStateChanged, canSkipForwardChanged: mediaStateChanged, playbackRateChanged: mediaStateChanged, canControlMediaChanged: mediaStateChanged
+ });
+ this._playerStateChanged();
+ this._bindings = WinJS.Binding.bind(this, {
+ _uiStateService: {
+ primarySessionId: mediaStateChanged, isSnapped: updateStates, nowPlayingTileVisible: updateStates
+ }, playbackSession: {isRemoteSessionRunning: this._playToStateChanged.bind(this)}
+ })
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ if (this._unloaded)
+ return;
+ if (this.playbackSession)
+ this._applyBindings();
+ this._mediaStateChanged()
+ }, _playerStateChanged: function _playerStateChanged(e) {
+ this._updateStates()
+ }, _mediaStateChanged: function _mediaStateChanged(e) {
+ this._updateStates()
+ }, _updateStates: function _updateStates() {
+ if (this._deferredUpdateTimer)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ }, _updateStatesDeferred: function _updateStatesDeferred() {
+ this._deferredUpdateTimer = null;
+ if (this._unloaded)
+ return;
+ if (this._initialized && this.playbackSession) {
+ var isPlaylist = MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia);
+ var showNowPlayingSkipAndVolumeButtons = this.playbackSession.currentMedia && (this.playbackSession === this._sessionMgr.nowPlayingSession && !MS.Entertainment.Platform.PlaybackHelpers.isVideo(this.playbackSession.currentMedia));
+ this.nowPlayingSkipBackVisible = showNowPlayingSkipAndVolumeButtons;
+ this.nowPlayingSkipForwardVisible = showNowPlayingSkipAndVolumeButtons;
+ this.nowPlayingVolumeVisible = (this.isVolumeServiceRequired && showNowPlayingSkipAndVolumeButtons);
+ var localPlayToXboxFeatureEnabled = MS.Entertainment.Platform.PlaybackHelpers.isPlayToXboxFeatureEnabled(this.playbackSession.currentMedia);
+ if (!this.playbackSession.currentMedia) {
+ this.isDisabled = true;
+ this.playVisible = true;
+ this.skipBackDisabled = true;
+ this.skipForwardDisabled = true;
+ this.playbackLabelId = MS.Entertainment.UI.Controls.TransportControls.playButtonStringId
+ }
+ else {
+ if (this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.unInitialize || this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.paused || this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped || this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.buffering || (this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.playing && this.playbackSession.playbackRate !== 1) || this.playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ this.playVisible = true;
+ this.playbackLabelId = MS.Entertainment.UI.Controls.TransportControls.playButtonStringId
+ }
+ else {
+ this.playVisible = false;
+ this.playbackLabelId = String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON
+ }
+ if (this.playbackSession.targetTransportState !== MS.Entertainment.Platform.Playback.TransportState.unInitialize && this.playbackSession.targetTransportState !== this.playbackSession.currentTransportState && this.playbackSession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.starting && this.playbackSession.playerState !== MS.Entertainment.Platform.Playback.PlayerState.error)
+ this.isDisabled = true;
+ else
+ this.isDisabled = !this.playbackSession.canControlMedia;
+ this.skipBackDisabled = this.isDisabled || (!this.playbackSession.canSkipBackward && isPlaylist);
+ this.skipForwardDisabled = this.isDisabled || (!this.playbackSession.canSkipForward && isPlaylist);
+ var skipNextIconButton = this._skipNextButton.domElement.querySelector(".iconButton");
+ if (this.skipForwardDisabled && this._playPauseButton && this._playPauseButton.domElement && skipNextIconButton === document.activeElement) {
+ var playPauseIconButton = this._playPauseButton.domElement.querySelector(".iconButton");
+ if (playPauseIconButton)
+ MS.Entertainment.UI.Framework.focusElement(playPauseIconButton);
+ else
+ MS.Entertainment.UI.Controls.fail("Expected an iconButton child beneath playPause control")
+ }
+ var currentPlayingMediaInstance = -1;
+ if (this.playbackSession._iPlayback && this.playbackSession._iPlayback.currentMedia && this.playbackSession._iPlayback.currentMedia.mediaInstanceId)
+ currentPlayingMediaInstance = this.playbackSession._iPlayback.currentMedia.mediaInstanceId;
+ if (!this._isNowPlayingControls && this._closedCaptionAction && this._closedCaptionAction.currentPlayingMediaInstance !== currentPlayingMediaInstance) {
+ this._closedCaptionAction.currentPlayingMediaInstance = currentPlayingMediaInstance;
+ this._closedCaptionAction.availableLanguages = [];
+ this._closedCaptionAction.isComboBoxEnabled = false;
+ if (this.playbackSession.currentMedia.closedCaptionFiles) {
+ var numTotalCaptionFiles = this.playbackSession.currentMedia.closedCaptionFiles.length;
+ var addOffLanguageOption = true;
+ var that = this;
+ this.playbackSession.currentMedia.closedCaptionFiles.forEach(function extractCaptionFiles(file) {
+ var ccFileMediaInstanceID = ("{" + file.mediaInstanceId + "}").toUpperCase();
+ if (ccFileMediaInstanceID === currentPlayingMediaInstance) {
+ if (addOffLanguageOption) {
+ that._closedCaptionAction.availableLanguages.push({
+ name: "Off", lcid: 0
+ });
+ addOffLanguageOption = false
+ }
+ var foundLcid = false;
+ for (var i = 0; i < that._closedCaptionAction.availableLanguages.length; i++)
+ if (that._closedCaptionAction.availableLanguages[i].lcid === file.lcid) {
+ foundLcid = true;
+ break
+ }
+ if (!foundLcid)
+ that._closedCaptionAction.availableLanguages.push(file)
+ }
+ });
+ this._closedCaptionAction.isComboBoxEnabled = this._closedCaptionAction.availableLanguages.length > 0 ? true : false;
+ var turnCaptionsOff = true;
+ if (this._closedCaptionAction.isComboBoxEnabled) {
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ var foundPreferredLanguage = false;
+ var englishLcidIndex = 0;
+ var ENGLISH_LCID = "1033";
+ if (settingsStorage.values["preferredCaptionLanguage"]) {
+ for (var i = 0; i < this._closedCaptionAction.availableLanguages.length; i++) {
+ if (!foundPreferredLanguage && this._closedCaptionAction.availableLanguages[i].lcid === settingsStorage.values["preferredCaptionLanguage"]) {
+ this.playbackSession.ccLcid = settingsStorage.values["preferredCaptionLanguage"];
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(true);
+ foundPreferredLanguage = true;
+ turnCaptionsOff = false
+ }
+ if (!englishLcidIndex && this._closedCaptionAction.availableLanguages[i].lcid === ENGLISH_LCID)
+ englishLcidIndex = i
+ }
+ if (!foundPreferredLanguage && englishLcidIndex) {
+ this.playbackSession.ccLcid = ENGLISH_LCID;
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(true);
+ turnCaptionsOff = false
+ }
+ }
+ }
+ if (turnCaptionsOff)
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(false)
+ }
+ }
+ }
+ this.dlnaTransferAvailable = ((this.playbackSession.currentMedia && !this.playbackSession.currentMedia.hasServiceId) || (this.playbackSession.currentMedia && MS.Entertainment.Utilities.isMusicApp));
+ if (this._sessionMgr.primarySession.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.remoteLRC)
+ this._xboxAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON);
+ else if (this.dlnaTransferAvailable || MS.Entertainment.Utilities.isMusicApp)
+ this._xboxAction.title = String.load(String.id.IDS_XBOX_PLAY_TO_DEVICE);
+ else
+ this._xboxAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON)
+ }
+ this.anyTransferAvailable = this.dlnaTransferAvailable;
+ this.xboxDisabled = (!this.anyTransferAvailable || this.isDisabled);
+ this.xboxVisible = MS.Entertainment.Platform.PlaybackHelpers.isXboxConsoleAvailableInRegion() && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped && !MS.Entertainment.Utilities.isMusicApp && !Windows.UI.ViewManagement.ViewSizePreference;
+ this.smartGlassDisabled = true;
+ this.smartGlassVisible = false;
+ this.volumeVisible = (this.isVolumeServiceRequired && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped);
+ this._updateIcons();
+ if (this._appBarPlaybackOptionsMenu && this._appBarPlaybackOptionsMenu._getOverflowAction().action) {
+ this._appBarPlaybackOptionsMenu._getOverflowAction().action.isEnabled = !this.isDisabled;
+ WinJS.Utilities.removeClass(this._playbackOptionsContainer, "removeFromDisplay")
+ }
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ if (this._appBarPlaybackOptionsMenu && this._appBarPlaybackOptionsMenu._getOverflowAction().action)
+ WinJS.Utilities.addClass(this._playbackOptionsContainer, "removeFromDisplay");
+ this._closedCaptionAction.isVisible = false;
+ this._shuffleAction.isVisible = false;
+ this._repeatAction.isVisible = false
+ }
+ else {
+ this._repeatAction.isVisible = true;
+ this._shuffleAction.isVisible = MS.Entertainment.Utilities.isMusicApp;
+ if (this._shuffleAction.isVisible)
+ this._updateShuffleButton();
+ if (this._repeatAction.isVisible)
+ this._updateRepeatButton();
+ this._closedCaptionAction.isVisible = MS.Entertainment.Platform.PlaybackHelpers.isClosedCaptionFeatureEnabled()
+ }
+ if (this._initialized) {
+ this._playAction.requeryCanExecute();
+ this._pauseAction.requeryCanExecute();
+ this._skipBackAction.requeryCanExecute();
+ this._skipForwardAction.requeryCanExecute();
+ this._xboxAction.requeryCanExecute();
+ this._smartGlassAction.requeryCanExecute();
+ if (this._volumeAction)
+ this._volumeAction.requeryCanExecute()
+ }
+ }, _updateIcons: function _updateIcons() {
+ if (this._xboxAction) {
+ if (this.dlnaTransferAvailable) {
+ this._xboxAction.icon = MS.Entertainment.UI.Icon.sendToXbox;
+ this._xboxAction.adornerRing = MS.Entertainment.UI.Icon.sendToXboxAdornerAppbar;
+ this._xboxAction.title = String.load(String.id.IDS_XBOX_PLAY_TO_DEVICE)
+ }
+ else {
+ this._xboxAction.icon = MS.Entertainment.UI.Icon.sendToXbox;
+ this._xboxAction.adornerRing = MS.Entertainment.UI.Icon.sendToXboxAdornerAppbar;
+ this._xboxAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON)
+ }
+ if (this._xboxButton)
+ this._xboxButton._updateAction()
+ }
+ }, xboxButtonClick: function xboxButtonClick() {
+ if (!this.visibility || !this.playbackSession)
+ return;
+ if (this.xboxTransferAvailable) {
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ MS.Entertainment.Platform.PlaybackHelpers.playToXbox(this.playbackSession.currentMedia, null, Math.round(this.playbackSession.currentPosition))
+ }
+ else
+ try {
+ Windows.Media.PlayTo.PlayToManager.showPlayToUI()
+ }
+ catch(ex) {
+ MS.Entertainment.UI.Debug.writeLine("Failed to show devices charm (may be disabled?): " + ex)
+ }
+ }, smartGlassButtonClick: function smartGlassButtonClick() {
+ if (!this.visibility || !this.playbackSession)
+ return;
+ this.smartGlassActive = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.xboxControls).visibility;
+ if (this.smartGlassActive)
+ MS.Entertainment.UI.Controls.XBoxControls.hide();
+ else
+ MS.Entertainment.UI.Controls.XBoxControls.show()
+ }, moreButtonClick: function moreButtonClick() {
+ this._updateStates()
+ }, playButtonClick: function playButtonClick() {
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked(this.domElement.className);
+ if (this._playPauseButton) {
+ this._playPauseAction = this._pauseAction;
+ this._playPauseButton.text = this._pauseAction.text;
+ this.playVisible = false
+ }
+ var isCurrentStateStoppedByError = (this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped) && !!this.playbackSession.errorDescriptor;
+ if (this.playbackSession.currentMedia !== null && (this.playbackSession.currentOrdinal === null || isCurrentStateStoppedByError))
+ this.playbackSession.activate(document.createElement("div"), this.playbackSession.pendingOrdinal);
+ else
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ if (this.playbackSession.targetTransportState !== MS.Entertainment.Platform.Playback.TransportState.unInitialize)
+ this._updateStates()
+ }, pauseButtonClick: function pauseButtonClick() {
+ MS.Entertainment.Utilities.Telemetry.logPauseClicked(this.domElement.className);
+ if (this._playPauseButton) {
+ this._playPauseAction = this._playAction;
+ this._playPauseButton.text = this._playAction.text;
+ this.playVisible = true
+ }
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ this._updateStates()
+ }, playPauseButtonClick: function playPauseButtonClick(e) {
+ if (!this.visibility || !this.playbackSession)
+ return;
+ if (this.playVisible)
+ this.playButtonClick();
+ else
+ this.pauseButtonClick()
+ }, skipForwardButtonClick: function skipForwardButtonClick(e) {
+ if (!this.visibility || this.skipForwardDisabled || !this.playbackSession)
+ return;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia))
+ this.playbackSession.skipFwd();
+ else {
+ var positionMs = this.playbackSession.getProperty("currentPosition");
+ this.playbackSession.seekToPosition(positionMs + 29000)
+ }
+ this._updateStates();
+ MS.Entertainment.Utilities.Telemetry.logNextClicked(this.domElement.className)
+ }, skipForwardButtonHold: function skipForwardButtonHold() {
+ if (this.playbackSession)
+ this.playbackSession.fastFwd()
+ }, volumeButtonClick: function volumeButtonClick(e) {
+ if (!this._volumeAction.isEnabled)
+ return;
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ appBar.sticky = true;
+ var position = WinJS.Utilities.getPosition(this._volumeButton.domElement);
+ var distanceFromBottom = (MS.Entertainment.Utilities.getWindowHeight() - position.top);
+ var left = (position.left >= 0 && position.width >= 0) ? (position.left + Math.round((0.5 * position.width) - 33)) + "px" : "auto";
+ var top = "auto";
+ var right = "auto";
+ var bottom = distanceFromBottom >= 0 ? distanceFromBottom + "px" : "auto";
+ var customStyle = "volumeContainer";
+ if (!this._volumeOverlay) {
+ this._volumeClickActionAvailable = false;
+ this._volumeOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.VolumeBar", {}, {
+ right: right, top: top, left: left, bottom: bottom
+ });
+ this._volumeOverlay.customStyle = customStyle;
+ this._volumeOverlay.enableKeyboardLightDismiss = true;
+ this._volumeOverlay.show().done(function overlayClosed() {
+ this._volumeOverlay = null
+ }.bind(this))
+ }
+ }, volumeButtonHold: function volumeButtonHold() {
+ return
+ }, skipBackButtonClick: function skipBackButtonClick(e) {
+ if (!this.visibility || this.skipBackDisabled || !this.playbackSession)
+ return;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia))
+ this.playbackSession.skipBack();
+ else {
+ var positionMs = this.playbackSession.getProperty("currentPosition");
+ this.playbackSession.seekToPosition(positionMs - 15000)
+ }
+ this._updateStates();
+ MS.Entertainment.Utilities.Telemetry.logPreviousClicked(this.domElement.className)
+ }, skipBackButtonHold: function skipBackButtonHold() {
+ if (this.playbackSession)
+ this.playbackSession.fastReverse()
+ }, repeatButtonClick: function repeatButtonClick() {
+ if (this.visibility && this.playbackSession) {
+ this.playbackSession.repeat = !this.playbackSession.repeat;
+ this._updateRepeatButton();
+ this._updateStates()
+ }
+ }, _updateRepeatButton: function _updateRepeatButton() {
+ var sessionRepeat = this.playbackSession && this.playbackSession.repeat;
+ this._repeatAction.title = sessionRepeat ? String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON);
+ this._repeatAction.ariaPressed = sessionRepeat
+ }, shuffleButtonClick: function shuffleButtonClick() {
+ if (this.visibility && this.playbackSession) {
+ this.playbackSession.shuffle = !this.playbackSession.shuffle;
+ this._updateShuffleButton();
+ this._updateStates()
+ }
+ }, _updateShuffleButton: function _updateShuffleButton() {
+ var sessionShuffle = this.playbackSession && this.playbackSession.shuffle;
+ this._shuffleAction.title = sessionShuffle ? String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON);
+ this._shuffleAction.ariaPressed = sessionShuffle
+ }
+ }, {
+ playbackLabelId: null, playbackSession: null, isDisabled: true, playVisible: false, nowPlayingSkipBackVisible: false, nowPlayingSkipForwardVisible: false, nowPlayingVolumeVisible: false, skipBackDisabled: true, skipForwardDisabled: true, messageTitle: "", messageSubTitle: "", messageVisible: false, shuffleEnabled: false, repeatEnabled: false, moreVisible: false, smartGlassVisible: false, smartGlassDisabled: true, smartGlassActive: false, volumeVisible: true, volumeDisabled: false, xboxJoined: false, xboxVisible: false, xboxDisabled: true, xboxTransferAvailable: false, dlnaTransferAvailable: false, anyTransferAvailable: false, _playAction: null, _pauseAction: null, _playPauseAction: null, _skipForwardAction: null, _skipForwardHoldAction: null, _smartGlassAction: null, _skipBackAction: null, _skipBackHoldAction: null, _repeatAction: null, _shuffleAction: null, _xboxAction: null, _volumeAction: null, _volumeHoldAction: null, _volumeOverlay: null, _decimalFormatter: null, _ccSavedState: null
+ }, {
+ _closedCaptionsInitialized: false, applySelectBoxOptionTemplate: function optionTemplate(container, item) {
+ container.textContent = item.name;
+ container.value = item.lcid
+ }, applySelectBoxChanged: function selectThingy() {
+ this.domElement.addEventListener("change", function selectionChanged(e) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.nowPlayingSession;
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ if (playbackSession)
+ if (e.target.selectedIndex) {
+ playbackSession.ccLcid = e.target.options[e.target.selectedIndex].value;
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(true);
+ settingsStorage.values["preferredCaptionLanguage"] = e.target.options[e.target.selectedIndex].value
+ }
+ else {
+ MS.Entertainment.UI.Controls.TransportControls.setClosedCaptions(false);
+ settingsStorage.values.remove("preferredCaptionLanguage")
+ }
+ })
+ }, playButtonStringId: {get: function getPlayButtonStringId() {
+ return MS.Entertainment.Utilities.isMusicApp ? String.id.IDS_PLAY_BUTTON : String.id.IDS_PLAY_BUTTON_VIDEO
+ }}, setClosedCaptions: function setClosedCaptions(value) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.nowPlayingSession;
+ if (playbackSession) {
+ if (!this._closedCaptionsInitialized && value) {
+ this._closedCaptionsInitialized = true;
+ MS.Entertainment.Platform.Playback.ClosedCaptions.Renderer.loadAndUpdateClosedCaptionStyleSettings()
+ }
+ playbackSession.closedCaptionsOn = !!value
+ }
+ }
+ })})
+})()
+})();
+/* >>>>>>/framework/externalnavigateaction.js:4443 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function(undefined) {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {externalNavigateAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function externalNavigateActionConstructor() {
+ this.base();
+ this.isExternalAction = true
+ }, {
+ executed: function executed(param) {
+ var link = this._extractLink(param);
+ window.open(link, "_blank")
+ }, canExecute: function canExecute(param) {
+ this.useOverrideTitleIfExists();
+ var link = this._extractLink(param);
+ this._applyAutomationId(param);
+ return (link) && (typeof link === "string")
+ }, _applyAutomationId: function _applyAutomationId(param) {
+ if (param && param.automationId)
+ this.automationId = param.automationId
+ }, _extractLink: function _extractLink(param) {
+ var url = null;
+ MS.Entertainment.UI.Actions.assert(param, "External navigation action requires a valid link.");
+ if (param && param.link)
+ url = param.link;
+ else if (typeof param === "string")
+ url = param;
+ return url
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {externalAdNavigateAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.externalNavigateAction", function externalAdNavigateActionConstructor() {
+ this.base()
+ }, {executed: function executed(param) {
+ var link = this._extractLink(param);
+ MS.Entertainment.Utilities.Telemetry.logAdClicked(link);
+ Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(link)).done(function launchSuccess(s){}, function launchFailure(e){})
+ }})});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate, function() {
+ return new MS.Entertainment.UI.Actions.externalNavigateAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.externalAdNavigate, function() {
+ return new MS.Entertainment.UI.Actions.externalAdNavigateAction
+ })
+})()
+})();
+/* >>>>>>/components/video/gracenoteservice.js:4491 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(Components) {
+ (function(Video) {
+ (function(Services) {
+ (function(GraceNoteImageSize) {
+ GraceNoteImageSize[GraceNoteImageSize["thumbnail"] = 0] = "thumbnail";
+ GraceNoteImageSize[GraceNoteImageSize["small"] = 1] = "small";
+ GraceNoteImageSize[GraceNoteImageSize["medium"] = 2] = "medium";
+ GraceNoteImageSize[GraceNoteImageSize["large"] = 3] = "large";
+ GraceNoteImageSize[GraceNoteImageSize["extraLarge"] = 4] = "extraLarge"
+ })(Services.GraceNoteImageSize || (Services.GraceNoteImageSize = {}));
+ var GraceNoteImageSize = Services.GraceNoteImageSize;
+ (function(GraceNoteSearchMode) {
+ GraceNoteSearchMode[GraceNoteSearchMode["singleBest"] = 0] = "singleBest";
+ GraceNoteSearchMode[GraceNoteSearchMode["multipleMatch"] = 1] = "multipleMatch"
+ })(Services.GraceNoteSearchMode || (Services.GraceNoteSearchMode = {}));
+ var GraceNoteSearchMode = Services.GraceNoteSearchMode;
+ var GraceNoteService = (function() {
+ function GraceNoteService() {
+ this._registerQueryString = null;
+ this._registerPromise = null;
+ this._graceNoteUser = null;
+ this._registerQueryString = this._buildRegisterQueryString();
+ this._graceNoteUser = MS.Entertainment.Utilities.getUserConfigurationValue("gracenote_user")
+ }
+ Object.defineProperty(GraceNoteService.prototype, "graceNoteUser", {
+ get: function() {
+ return this._graceNoteUser
+ }, set: function(value) {
+ this._graceNoteUser = value;
+ MS.Entertainment.Utilities.setUserConfigurationValue("gracenote_user", this._graceNoteUser)
+ }, enumerable: true, configurable: true
+ });
+ GraceNoteService.prototype.registerService = function() {
+ var registerUrl = GraceNoteService._baseUrl.format(GraceNoteService._shortClientId);
+ var registerOptions = {
+ type: "post", url: registerUrl, responseType: "document", data: this._registerQueryString
+ };
+ if (!this._registerPromise)
+ this._registerPromise = WinJS.xhr(registerOptions).then(this._parseRegisterResponse.bind(this), function error(result) {
+ return WinJS.Promise.wrapError(result)
+ });
+ return this._registerPromise
+ };
+ GraceNoteService.prototype.contributorSearch = function(searchTerm, imageSize, searchMode) {
+ var registerPromise;
+ if (!this.graceNoteUser)
+ registerPromise = this.registerService();
+ else
+ registerPromise = WinJS.Promise.as(this.graceNoteUser);
+ return registerPromise.then(function(user) {
+ var contributorSearchUrl = GraceNoteService._baseUrl.format(GraceNoteService._shortClientId);
+ var contributorSearchQuery = this._buildContributorSearchQueryString(searchTerm, user, imageSize, searchMode);
+ var contributorSearchOptions = {
+ type: "post", url: contributorSearchUrl, responseType: "document", data: contributorSearchQuery
+ };
+ var contributorSearchPromise = WinJS.xhr(contributorSearchOptions).then(this._parseContributorResponse.bind(this), function error(result) {
+ return WinJS.Promise.wrap(null)
+ });
+ return contributorSearchPromise
+ }.bind(this))
+ };
+ GraceNoteService.getIsoLanguageStringFromBcpString = function(bcpLanguageCode) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var languageString = MS.Entertainment.Utilities.getValueFromCsvList(configurationManager.service.graceNoteSupportedLanguageStringMap, bcpLanguageCode);
+ Entertainment.assert(languageString, "No GraceNote Language string mapping for language " + bcpLanguageCode + ". Update graceNoteSupportedLanguageStringMap.");
+ if (!languageString)
+ languageString = GraceNoteService._defaultLanguageString;
+ return languageString
+ };
+ GraceNoteService.prototype._buildRegisterQueryString = function() {
+ var registerQueryString = "" + "{0}" + "";
+ return registerQueryString.format(GraceNoteService._clientId)
+ };
+ GraceNoteService.prototype._buildAuthHeaderQueryString = function(user) {
+ var authHeaderString = "" + "{0}" + "{1}" + "";
+ return authHeaderString.format(GraceNoteService._clientId, user)
+ };
+ GraceNoteService.prototype._buildLanguageHeaderString = function() {
+ var languageHeaderString = "{0}";
+ var languageString = this._getRequestHeaderLanguageString();
+ return languageHeaderString.format(languageString)
+ };
+ GraceNoteService.prototype._getRequestHeaderLanguageString = function() {
+ var resourceLanguage = MS.Entertainment.Utilities.getResourceLanguage();
+ var languageCode = MS.Entertainment.Utilities.getLanguageCodeFromLocale(resourceLanguage);
+ var languageString = GraceNoteService.getIsoLanguageStringFromBcpString(languageCode);
+ return languageString
+ };
+ GraceNoteService.prototype._graceNoteImageSizeToString = function(imageSize) {
+ var imageSizeString = String.empty;
+ switch (imageSize) {
+ case 0:
+ imageSizeString = "THUMBNAIL";
+ break;
+ case 1:
+ imageSizeString = "SMALL";
+ break;
+ case 2:
+ imageSizeString = "MEDIUM";
+ break;
+ case 3:
+ imageSizeString = "LARGE";
+ break;
+ case 4:
+ imageSizeString = "XLARGE";
+ break;
+ default:
+ MS.Entertainment.Utilities.assert(false, "Unknown image size requested");
+ break
+ }
+ return imageSizeString
+ };
+ GraceNoteService.prototype._buildContributorSearchModeQueryString = function(searchMode) {
+ var searchModeQueryString = String.empty;
+ switch (searchMode) {
+ case 0:
+ searchModeQueryString = "SINGLE_BEST";
+ break;
+ case 1:
+ break;
+ default:
+ MS.Entertainment.Utilities.assert(false, "Unknown search mode requested");
+ break
+ }
+ return searchModeQueryString
+ };
+ GraceNoteService.prototype._buildContributorSearchQueryString = function(searchTerm, user, imageSize, searchMode) {
+ if (typeof imageSize === "undefined")
+ imageSize = 2;
+ if (typeof searchMode === "undefined")
+ searchMode = 0;
+ var contributorSearchQueryString = "" + "{0}" + "{1}" + "" + "{2}" + "{3}" + "" + "" + "" + "";
+ return contributorSearchQueryString.format(this._buildAuthHeaderQueryString(user), this._buildLanguageHeaderString(), this._buildContributorSearchModeQueryString(searchMode), searchTerm, this._graceNoteImageSizeToString(imageSize))
+ };
+ GraceNoteService.prototype._parseRegisterResponse = function(response) {
+ if (response) {
+ var responseXML = response.responseXML;
+ if (responseXML) {
+ var userElements = responseXML.getElementsByTagName("USER");
+ MS.Entertainment.Utilities.assert(userElements && userElements.length === 1, "Unexpected number of users returned.");
+ this.graceNoteUser = userElements && userElements.length && userElements[0].textContent
+ }
+ return WinJS.Promise.wrap(this.graceNoteUser)
+ }
+ else
+ return WinJS.Promise.wrap(null)
+ };
+ GraceNoteService.prototype._parseContributorResponse = function(response) {
+ var results = {items: []};
+ if (response) {
+ var responseXML = response.responseXML;
+ var contributorElements = responseXML && responseXML.getElementsByTagName("CONTRIBUTOR");
+ if (contributorElements)
+ for (var i = 0; i < contributorElements.length; i++) {
+ var contributorElement = contributorElements[i];
+ var dob = this._getResponseFieldValue(contributorElement, "DATE", null);
+ var defaultLanguage = this._getRequestHeaderLanguageString();
+ var contributor = {
+ id: this._getResponseFieldValue(contributorElement, "GN_ID", null), name: this._getResponseFieldValue(contributorElement, "NAME", null), dateOfBirth: dob ? this._createDateOfBirthFromResult(dob) : null, placeOfBirth: this._getResponseFieldValue(contributorElement, "PLACE", null), biography: this._getResponseFieldValue(contributorElement, "BIOGRAPHY", null), biographyLanguage: this._getResponseAttributeValue(contributorElement, "BIOGRAPHY", "LANG", defaultLanguage), image: this._getResponseFieldValue(contributorElement, "URL", null)
+ };
+ results.items.push(contributor)
+ }
+ }
+ return WinJS.Promise.wrap(results)
+ };
+ GraceNoteService.prototype._getResponseFieldValue = function(rootNode, tagName, defaultValue) {
+ var result = defaultValue;
+ if (rootNode && rootNode.getElementsByTagName) {
+ var nodes = rootNode.getElementsByTagName(tagName);
+ if (nodes && nodes.length)
+ result = nodes[0].textContent
+ }
+ return result
+ };
+ GraceNoteService.prototype._getResponseAttributeValue = function(rootNode, tagName, attributeName, defaultValue) {
+ var result = defaultValue;
+ if (rootNode && rootNode.getElementsByTagName) {
+ var nodes = rootNode.getElementsByTagName(tagName);
+ if (nodes && nodes.length && nodes[0].getAttribute) {
+ var attribute = nodes[0].getAttribute(attributeName);
+ if (attribute)
+ result = attribute
+ }
+ }
+ return result
+ };
+ GraceNoteService.prototype._createDateOfBirthFromResult = function(dateOfBirth) {
+ if (dateOfBirth && dateOfBirth.indexOf("T") === -1)
+ dateOfBirth += "T00:00";
+ return new Date(dateOfBirth)
+ };
+ GraceNoteService.factory = function() {
+ return new MS.Entertainment.Components.Video.Services.GraceNoteService
+ };
+ GraceNoteService._clientId = "5043456-342CC764E20FA10EAF0697D4E7F7601C";
+ GraceNoteService._shortClientId = GraceNoteService._clientId.substring(0, 7);
+ GraceNoteService._baseUrl = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_GraceNote);
+ GraceNoteService._defaultLanguageString = "eng";
+ return GraceNoteService
+ })();
+ Services.GraceNoteService = GraceNoteService
+ })(Video.Services || (Video.Services = {}));
+ var Services = Video.Services
+ })(Components.Video || (Components.Video = {}));
+ var Video = Components.Video
+ })(Entertainment.Components || (Entertainment.Components = {}));
+ var Components = Entertainment.Components
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+if (configurationManager.video.supportsGraceNote)
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.graceNoteService, MS.Entertainment.Components.Video.Services.GraceNoteService.factory)
+})();
+/* >>>>>>/viewmodels/video/castandcrewmodule.js:4711 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var CastAndCrewModule = (function(_super) {
+ __extends(CastAndCrewModule, _super);
+ function CastAndCrewModule(mediaItem) {
+ _super.call(this, "castAndCrew");
+ this.mediaItem = mediaItem;
+ this._setProperty = Entertainment.Utilities.BindingAgnostic.setProperty
+ }
+ CastAndCrewModule.prototype._createHeaderAction = function() {
+ return null
+ };
+ CastAndCrewModule.prototype.isAvailable = function() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return WinJS.Promise.as(featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.castAndCrew))
+ };
+ CastAndCrewModule.prototype.getItems = function() {
+ if (!this._getItemsPromise)
+ this._getItemsPromise = this.mediaItem.hydrate().then(function(mediaItem) {
+ if (mediaItem.contributors && mediaItem.contributors.length) {
+ var hydrateOptions = {graceNoteImageSize: 1};
+ var sortedContributors = mediaItem.contributors.sort(function(itemA, itemB) {
+ var returnVal;
+ if (!itemA && itemB)
+ returnVal = 1;
+ else if (itemA && !itemB)
+ returnVal = -1;
+ else if (!itemA && !itemB)
+ returnVal = 0;
+ else
+ returnVal = CastAndCrewModule._castAndCrewKeys[itemA.role] - CastAndCrewModule._castAndCrewKeys[itemB.role];
+ return returnVal
+ });
+ var hydratePromises = sortedContributors.slice(0, CastAndCrewModule.maxItemCount).map(function(item) {
+ if (CastAndCrewModule._castAndCrewKeys[item.role] === CastAndCrewModule._castAndCrewKeys.Actor)
+ item.isActor = true;
+ item.showRole = !item.isActor && !!item.localizedRole;
+ item.showCharacter = item.isActor && !!item.character;
+ return item.hydrate(hydrateOptions)
+ });
+ return WinJS.Promise.join(hydratePromises)
+ }
+ return null
+ }).then(function(items) {
+ items = items || [];
+ items.forEach(function(item) {
+ item.actionId = Entertainment.UI.Actions.ActionIdentifiers.searchResultsNavigate;
+ item.actionParameter = {searchText: item.name}
+ });
+ return {items: items}
+ });
+ return this._getItemsPromise
+ };
+ CastAndCrewModule._castAndCrewKeys = {
+ Creator: 1, Director: 2, Actor: 3, Writer: 4
+ };
+ CastAndCrewModule.maxItemCount = 15;
+ return CastAndCrewModule
+ })(ViewModels.ModuleBase);
+ ViewModels.CastAndCrewModule = CastAndCrewModule
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/bundlesmodule.js:4792 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+ var BundleItem = (function(_super) {
+ __extends(BundleItem, _super);
+ function BundleItem(mediaItem) {
+ this.mediaItem = mediaItem;
+ this.secondaryText = String.empty;
+ this._updateMediaItem(false);
+ this._updatePrimaryText();
+ this._mediaItemBinding = WinJS.Binding.bind(this.mediaItem, {bundleOffer: this._updateSecondaryText.bind(this)});
+ _super.call(this)
+ }
+ BundleItem.prototype.dispose = function() {
+ if (this._mediaItemBinding) {
+ this._mediaItemBinding.cancel();
+ this._mediaItemBinding = null
+ }
+ if (this._updateMediaItemPromise) {
+ this._updateMediaItemPromise.cancel();
+ this._updateMediaItemPromise = null
+ }
+ };
+ Object.defineProperty(BundleItem.prototype, "primaryText", {
+ get: function() {
+ return this._primaryText
+ }, set: function(value) {
+ this.updateAndNotify("primaryText", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(BundleItem.prototype, "secondaryText", {
+ get: function() {
+ return this._secondaryText
+ }, set: function(value) {
+ this.updateAndNotify("secondaryText", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(BundleItem.prototype, "languageText", {
+ get: function() {
+ return this._languageText
+ }, set: function(value) {
+ this.updateAndNotify("languageText", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(BundleItem.prototype, "mediaItem", {
+ get: function() {
+ return this._mediaItem
+ }, set: function(value) {
+ this.updateAndNotify("mediaItem", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(BundleItem.prototype, "ratingItem", {
+ get: function() {
+ return this._ratingItem
+ }, set: function(value) {
+ this.updateAndNotify("ratingItem", value)
+ }, enumerable: true, configurable: true
+ });
+ BundleItem.prototype._updatePrimaryText = function() {
+ if (this.mediaItem.isMovie)
+ if (this.mediaItem.primaryText)
+ this.primaryText = this.mediaItem.primaryText;
+ else
+ this.primaryText = String.empty;
+ else
+ this.primaryText = String.load(String.id.IDS_APP2_PAGE_TITLE_PRIMARY).format(this.mediaItem.seriesTitle, this.mediaItem.primaryText)
+ };
+ BundleItem.prototype._updateMediaItem = function(forceUpdate) {
+ var _this = this;
+ if (!this.mediaItem)
+ return;
+ if (this._updateMediaItemPromise) {
+ this._updateMediaItemPromise.cancel();
+ this._updateMediaItemPromise = null
+ }
+ var hydrateOptions = {isPartOfBundle: true};
+ var hydrateMediaItemPromise = WinJS.Promise.wrap();
+ if (forceUpdate && this.mediaItem.refresh)
+ hydrateMediaItemPromise = this.mediaItem.refresh(hydrateOptions);
+ else if (this.mediaItem.hydrate && !this.mediaItem.hydrated)
+ hydrateMediaItemPromise = this.mediaItem.hydrate(hydrateOptions);
+ this._updateMediaItemPromise = hydrateMediaItemPromise.then(function() {
+ var hydrateFirstEpisodePromise = WinJS.Promise.wrap();
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(_this.mediaItem) && _this.mediaItem.firstEpisode && _this.mediaItem.firstEpisode.hydrate && !_this.mediaItem.firstEpisode.hydrated)
+ hydrateFirstEpisodePromise = _this.mediaItem.firstEpisode.hydrate();
+ return hydrateFirstEpisodePromise
+ }).then(function() {
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(_this.mediaItem))
+ return MS.Entertainment.ViewModels.SmartBuyStateEngine.getMarketplaceFileAccessAsync(_this.mediaItem).then(function(stateInfo) {
+ return WinJS.Promise.wrap(stateInfo && (stateInfo.hasPurchased > 0 || stateInfo.hasPurchasedSeason))
+ });
+ else
+ return WinJS.Promise.wrap(_this.mediaItem.inCollection)
+ }).then(function(isOwned) {
+ if (_this._isOwned === null || _this._isOwned !== isOwned) {
+ _this._isOwned = isOwned;
+ _this._updateSecondaryText()
+ }
+ var ratingItemHydratePromise = WinJS.Promise.wrap();
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(_this.mediaItem) || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(_this.mediaItem)) {
+ var seriesItem = MS.Entertainment.Utilities.convertMediaItemToTvSeries(_this.mediaItem);
+ ratingItemHydratePromise = seriesItem.hydrate().then(function(series) {
+ _this.ratingItem = series
+ })
+ }
+ else
+ _this.ratingItem = _this.mediaItem;
+ return ratingItemHydratePromise
+ }).then(function() {
+ _this._updateMediaItemPromise = null
+ }, function(error) {
+ _this._updateMediaItemPromise = null;
+ if (!WinJS.Promise.isCanceledError(error))
+ return WinJS.Promise.wrapError(error);
+ return null
+ })
+ };
+ BundleItem.prototype._updateSecondaryText = function() {
+ if (this.mediaItem.isOwned)
+ this.secondaryText = String.load(String.id.IDS_VIDEO_IN_COLLECTION_LABEL);
+ else if (this.mediaItem.bundleOffer) {
+ var currentVideoDefinition = this.mediaItem.bundleOffer.videoDefinition;
+ var currentPrimaryAudioLanguage;
+ var variousLanguages = true;
+ if (this.mediaItem.bundleOffer.primaryAudioLanguage && this.mediaItem.bundleOffer.primaryAudioLanguage.toUpperCase() !== MS.Entertainment.Utilities.VARIOUS_LANGUAGES_CODE.toUpperCase()) {
+ currentPrimaryAudioLanguage = this.mediaItem.bundleOffer.primaryAudioLanguage;
+ variousLanguages = false
+ }
+ var isSeason = MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(this.mediaItem);
+ var isMovie = MS.Entertainment.Platform.PlaybackHelpers.isMovie(this.mediaItem);
+ var selectedOffer = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultBuyOffer(this.mediaItem, isSeason, currentVideoDefinition, currentPrimaryAudioLanguage);
+ if (!selectedOffer) {
+ var matchingOfferId;
+ var bundledItemOffers = this.mediaItem.bundleOffer.bundledItems;
+ for (var i = 0; i < bundledItemOffers.length; i++)
+ if (bundledItemOffers[i].mid.toUpperCase() === this.mediaItem.zuneId.toUpperCase()) {
+ matchingOfferId = bundledItemOffers[i].offerId;
+ break
+ }
+ var rights;
+ if (isMovie)
+ rights = this.mediaItem.unfilteredRights;
+ else
+ rights = this.mediaItem.rights;
+ if (matchingOfferId) {
+ var matchingOffers = [];
+ for (var i = 0; i < rights.length; i++) {
+ var currentOffer = rights[i];
+ if (currentOffer.offerId && currentOffer.offerId.toUpperCase() === matchingOfferId.toUpperCase())
+ matchingOffers.push(currentOffer)
+ }
+ }
+ if (matchingOffers && matchingOffers.length > 0) {
+ var bundledMediaItem = this.mediaItem.clone();
+ bundledMediaItem.rights = matchingOffers;
+ selectedOffer = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultBuyOffer(bundledMediaItem, isSeason, currentVideoDefinition, currentPrimaryAudioLanguage, true)
+ }
+ }
+ if (selectedOffer) {
+ this.secondaryText = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getPriceString(selectedOffer);
+ if (selectedOffer.primaryAudioLanguage && variousLanguages)
+ this.languageText = MS.Entertainment.Utilities.getDisplayLanguageFromLanguageCode(selectedOffer.primaryAudioLanguage);
+ else
+ this.languageText = String.empty
+ }
+ }
+ };
+ return BundleItem
+ })(Entertainment.UI.Framework.ObservableBase);
+ ViewModels.BundleItem = BundleItem;
+ var BundlesModule = (function(_super) {
+ __extends(BundlesModule, _super);
+ function BundlesModule(mediaItem) {
+ this._mediaItem = mediaItem;
+ var videoDetailsUiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoDetailsUiState);
+ MS.Entertainment.Utilities.addEventHandlers(videoDetailsUiStateService, {
+ videoDefinitionChange: this._onVideoDefinitionChanged.bind(this), videoLanguageChange: this._onVideoLanguageChange.bind(this)
+ });
+ this._selectedPurchaseDefinition = String.empty;
+ this._selectedPurchaseLanguage = String.empty;
+ _super.call(this, "itemsInBundle")
+ }
+ BundlesModule.prototype.dispose = function() {
+ if (this._videoPropertiesChangeEvents) {
+ this._videoPropertiesChangeEvents.cancel();
+ this._videoPropertiesChangeEvents = null
+ }
+ };
+ BundlesModule.prototype.isAvailable = function() {
+ return WinJS.Promise.wrap(this._mediaItem.isBundle)
+ };
+ BundlesModule.prototype.getItems = function() {
+ if (!this._getItemsPromise) {
+ var items = [];
+ this._updateBundledItemOfferIds();
+ if (this._mediaItem.bundledItems && this._mediaItem.bundledItems.length > 0)
+ for (var i = 0; i < this._mediaItem.bundledItems.length; i++) {
+ var bundleItem = this._mediaItem.bundledItems[i];
+ Trace.assert(bundleItem, "Bundled Item at index '{0}' in Bundle '{1}' with zuneId '{2}' is null".format(i, this._mediaItem.name, this._mediaItem.zuneId));
+ if (bundleItem) {
+ if (bundleItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ bundleItem.actionId = Entertainment.UI.Actions.ActionIdentifiers.navigateToVideoDetails;
+ else
+ bundleItem.actionId = Entertainment.UI.Actions.ActionIdentifiers.showImmersiveDetails;
+ bundleItem.actionParameter = {
+ data: bundleItem, viewModelParams: {
+ preferredLanguage: String.empty, preferredVideoResolution: String.empty
+ }, showDetails: true
+ };
+ items.push(new BundleItem(bundleItem))
+ }
+ }
+ this._getItemsPromise = WinJS.Promise.wrap({items: items})
+ }
+ return this._getItemsPromise
+ };
+ BundlesModule.prototype.setBundleInitialPreferredLanguage = function(preferredLanguage) {
+ this._selectedPurchaseLanguage = preferredLanguage;
+ if (this._mediaItem.bundledItems && this._mediaItem.bundledItems.length > 0)
+ this._mediaItem.bundledItems.forEach(function(mediaItem) {
+ if (mediaItem.actionParameter && mediaItem.actionParameter.viewModelParams)
+ mediaItem.actionParameter.viewModelParams.preferredLanguage = preferredLanguage
+ })
+ };
+ BundlesModule.prototype.setBundleInitialPreferredVideoResolution = function(preferredVideoResolution) {
+ this._selectedPurchaseDefinition = preferredVideoResolution;
+ if (this._mediaItem.bundledItems && this._mediaItem.bundledItems.length > 0)
+ this._mediaItem.bundledItems.forEach(function(mediaItem) {
+ if (mediaItem.actionParameter && mediaItem.actionParameter.viewModelParams)
+ mediaItem.actionParameter.viewModelParams.preferredVideoResolution = preferredVideoResolution
+ })
+ };
+ BundlesModule.prototype._onVideoDefinitionChanged = function(event) {
+ this.setBundleInitialPreferredVideoResolution(event.detail);
+ this._updateBundledItemOfferIds()
+ };
+ BundlesModule.prototype._onVideoLanguageChange = function(event) {
+ this.setBundleInitialPreferredLanguage(event.detail);
+ this._updateBundledItemOfferIds()
+ };
+ BundlesModule.prototype._updateBundledItemOfferIds = function() {
+ var buyOffer = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultBuyOffer(this._mediaItem, false, this._selectedPurchaseDefinition, this._selectedPurchaseLanguage);
+ if (this._mediaItem.bundledItems && this._mediaItem.bundledItems.length && buyOffer)
+ for (var i = 0; i < this._mediaItem.bundledItems.length; i++) {
+ var item = this._mediaItem.bundledItems[i];
+ if (item)
+ item.bundleOffer = buyOffer
+ }
+ };
+ return BundlesModule
+ })(ViewModels.ModuleBase);
+ ViewModels.BundlesModule = BundlesModule
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/rottentomatoesmodule.js:5065 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var RottenTomatoesModule = (function(_super) {
+ __extends(RottenTomatoesModule, _super);
+ function RottenTomatoesModule(mediaItem) {
+ ViewModels.assert(mediaItem, "RottenTomatoesModule::ctor(): Invalid media item provided.");
+ this._mediaItem = mediaItem;
+ _super.call(this, "rottenTomatoes");
+ this.setHeaderSummaryInformation()
+ }
+ Object.defineProperty(RottenTomatoesModule.prototype, "summaryScoreIcon", {
+ get: function() {
+ return this._summaryScoreIcon
+ }, set: function(value) {
+ this.updateAndNotify("summaryScoreIcon", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(RottenTomatoesModule.prototype, "summaryScoreText", {
+ get: function() {
+ return this._summaryScoreText
+ }, set: function(value) {
+ this.updateAndNotify("summaryScoreText", value)
+ }, enumerable: true, configurable: true
+ });
+ RottenTomatoesModule.prototype.setHeaderSummaryInformation = function() {
+ var reviewScore = WinJS.Utilities.getMember("criticReview.reviewScore", this._mediaItem);
+ var reviewScoreCount = WinJS.Utilities.getMember("criticReview.reviewScoreCount", this._mediaItem);
+ if (reviewScore) {
+ this.summaryScoreText = reviewScore ? "{0}%".format(reviewScore) : null;
+ if (reviewScore >= 75 && reviewScoreCount >= 40)
+ this.summaryScoreIcon = RottenTomatoesModule.IconCertifiedFresh;
+ else if (reviewScore >= 60)
+ this.summaryScoreIcon = RottenTomatoesModule.IconFresh;
+ else
+ this.summaryScoreIcon = RottenTomatoesModule.IconRotten
+ }
+ };
+ RottenTomatoesModule.prototype.wrapItems = function(criticReviews) {
+ var _this = this;
+ if (criticReviews && criticReviews.length > 0)
+ criticReviews.forEach(function(currentReview) {
+ _this.setTomatoIcon(currentReview);
+ _this.setItemAction(currentReview);
+ _this.setMetadata(currentReview)
+ })
+ };
+ RottenTomatoesModule.prototype.setMetadata = function(criticReview) {
+ if (!criticReview)
+ return;
+ var details = [];
+ if (criticReview.publication)
+ details.push(criticReview.publication);
+ if (criticReview.date) {
+ var formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).shortDate;
+ var date = new Date(criticReview.date);
+ var releaseDate = formatter.format(date);
+ details.push(releaseDate)
+ }
+ criticReview.metadata = details.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ };
+ RottenTomatoesModule.prototype.setItemAction = function(criticReview) {
+ if (criticReview && criticReview.publicationUrl && MS.Entertainment.Utilities.verifyUrl(criticReview.publicationUrl)) {
+ criticReview.actionId = Entertainment.UI.Actions.ActionIdentifiers.externalNavigate;
+ criticReview.actionParameter = {link: criticReview.publicationUrl};
+ criticReview.automationId = Entertainment.UI.AutomationIds.externalRottenTomatoesLinkNavigate
+ }
+ };
+ RottenTomatoesModule.prototype.canShowReview = function(criticReview) {
+ if (!criticReview)
+ return false;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.rottenTomatoes) && criticReview.criticName && criticReview.publication && criticReview.scoreDescription && criticReview.scoreDescription !== "none")
+ };
+ RottenTomatoesModule.prototype.setTomatoIcon = function(criticReview) {
+ if (!criticReview)
+ return;
+ switch (criticReview.scoreDescription) {
+ case"fresh":
+ criticReview.tomatoIcon = RottenTomatoesModule.IconFresh;
+ break;
+ case"rotten":
+ criticReview.tomatoIcon = RottenTomatoesModule.IconRotten;
+ break;
+ case"none":
+ criticReview.tomatoIcon = null;
+ break;
+ default:
+ Trace.fail("Unknown RottenTomatos ScoreDescription: " + criticReview.scoreDescription)
+ }
+ };
+ RottenTomatoesModule.prototype.getItems = function() {
+ var mediaReviews = WinJS.Utilities.getMember("_mediaItem.criticReview.criticReviews", this) || [];
+ if (mediaReviews && mediaReviews.length > 0) {
+ mediaReviews = mediaReviews.filter(this.canShowReview.bind(this));
+ this.wrapItems(mediaReviews)
+ }
+ return WinJS.Promise.as({items: mediaReviews})
+ };
+ RottenTomatoesModule.prototype._createHeaderAction = function(args) {
+ var externalNavigationAction = null;
+ var websiteUrl = WinJS.Utilities.getMember("_mediaItem.criticReview.url", this);
+ if (websiteUrl && MS.Entertainment.Utilities.verifyUrl(websiteUrl)) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ externalNavigationAction = actionService.getAction(Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = websiteUrl;
+ externalNavigationAction.automationId = Entertainment.UI.AutomationIds.externalRottenTomatoesLinkNavigate;
+ externalNavigationAction.title = String.load(String.id.IDS_APP1_MODULE_VIEW_ALL)
+ }
+ return externalNavigationAction
+ };
+ RottenTomatoesModule.IconCertifiedFresh = "/images/ThirdParty/ico_RottenTomatoes_CertifiedFresh." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ RottenTomatoesModule.IconFresh = "/images/ThirdParty/ico_RottenTomatoes_Fresh." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ RottenTomatoesModule.IconRotten = "/images/ThirdParty/ico_RottenTomatoes_Rotten." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ return RottenTomatoesModule
+ })(ViewModels.ModuleBase);
+ ViewModels.RottenTomatoesModule = RottenTomatoesModule
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/moviedetailsviewmodel.js:5203 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(MovieDetailsModuleKeys) {
+ MovieDetailsModuleKeys[MovieDetailsModuleKeys["similarMoviesModule"] = 0] = "similarMoviesModule";
+ MovieDetailsModuleKeys[MovieDetailsModuleKeys["castAndCrewModule"] = 1] = "castAndCrewModule";
+ MovieDetailsModuleKeys[MovieDetailsModuleKeys["rottenTomatoesModule"] = 2] = "rottenTomatoesModule";
+ MovieDetailsModuleKeys[MovieDetailsModuleKeys["bundlesModule"] = 3] = "bundlesModule"
+ })(ViewModels.MovieDetailsModuleKeys || (ViewModels.MovieDetailsModuleKeys = {}));
+ var MovieDetailsModuleKeys = ViewModels.MovieDetailsModuleKeys;
+ var MovieDetailsViewModel = (function(_super) {
+ __extends(MovieDetailsViewModel, _super);
+ function MovieDetailsViewModel(mediaItem, initialPreferences) {
+ Trace.assert(mediaItem, "MovieDetailsViewModel::ctor(): Invalid media item provided.");
+ this.mediaItem = mediaItem;
+ this._marketplaceEvents = MS.Entertainment.Utilities.addEventHandlers(Microsoft.Entertainment.Marketplace.Marketplace, {mediarightchanged: this._onMediaRightChanged.bind(this)});
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signinEvents = MS.Entertainment.Utilities.addEventHandlers(signInService, {isSignedInChanged: this._onSigninChanged.bind(this)});
+ _super.call(this, initialPreferences)
+ }
+ MovieDetailsViewModel.create = function(mediaItem, initialPreferences) {
+ if (!mediaItem || !MS.Entertainment.Platform.PlaybackHelpers.isMovie(mediaItem)) {
+ Trace.fail("Could not create MovieDetailsViewModel!");
+ return WinJS.Promise.wrapError(new Error("Could not create MovieDetailsViewModel!"))
+ }
+ return new MovieDetailsViewModel(mediaItem, initialPreferences)
+ };
+ MovieDetailsViewModel.prototype.dispose = function() {
+ if (this._refreshBundlePagePromise) {
+ this._refreshBundlePagePromise.cancel();
+ this._refreshBundlePagePromise = null
+ }
+ if (this._marketplaceEvents) {
+ this._marketplaceEvents.cancel();
+ this._marketplaceEvents = null
+ }
+ if (this._signinEvents) {
+ this._signinEvents.cancel();
+ this._signinEvents = null
+ }
+ _super.prototype.dispose.call(this)
+ };
+ Object.defineProperty(MovieDetailsViewModel.prototype, "similarMovies", {
+ get: function() {
+ return this.modules && this.modules[0]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MovieDetailsViewModel.prototype, "castAndCrew", {
+ get: function() {
+ return this.modules && this.modules[1]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MovieDetailsViewModel.prototype, "rottenTomatoes", {
+ get: function() {
+ return this.modules && this.modules[2]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MovieDetailsViewModel.prototype, "itemsInBundle", {
+ get: function() {
+ return this.modules && this.modules[3]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MovieDetailsViewModel.prototype, "primaryHeaderButtons", {
+ get: function() {
+ return this._primaryHeaderButtons
+ }, set: function(value) {
+ this.updateAndNotify("primaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MovieDetailsViewModel.prototype, "secondaryHeaderButtons", {
+ get: function() {
+ return this._secondaryHeaderButtons
+ }, set: function(value) {
+ this.updateAndNotify("secondaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MovieDetailsViewModel.prototype, "studio", {
+ get: function() {
+ return this._studio
+ }, set: function(value) {
+ this.updateAndNotify("studio", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MovieDetailsViewModel.prototype, "expirationString", {
+ get: function() {
+ return this._expirationString
+ }, set: function(val) {
+ this.updateAndNotify("expirationString", val)
+ }, enumerable: true, configurable: true
+ });
+ MovieDetailsViewModel.prototype._initializeModules = function() {
+ this.modules = [ViewModels.VideoModuleFactory.createSimilarMoviesModule(this.mediaItem), new ViewModels.CastAndCrewModule(this.mediaItem), new ViewModels.RottenTomatoesModule(this.mediaItem), new ViewModels.BundlesModule(this.mediaItem)]
+ };
+ MovieDetailsViewModel.prototype._getExpirationStringCallback = function(spanInMilliseconds, expirationTickTimer) {
+ this._expirationTickTimer = expirationTickTimer;
+ this.expirationString = MS.Entertainment.Formatters.formatRentalExpirationFromSpanInt(spanInMilliseconds, true)
+ };
+ MovieDetailsViewModel.prototype._getSmartBuyEngineButtons = function() {
+ return MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.canvas)
+ };
+ MovieDetailsViewModel.prototype._getSmartBuyEngineEventHandler = function() {
+ var _this = this;
+ return function(engine, stateInfo) {
+ var getStatePromise;
+ if (_this._smartBuyStateEngine)
+ getStatePromise = _this._smartBuyStateEngine.onVideoVerticalDetailsStateChanged(stateInfo).then(function(buttonState) {
+ _this._refreshPurchaseDetailsString(stateInfo);
+ var rentalExpirations = WinJS.Utilities.getMember("marketplace.rentalExpirations", stateInfo);
+ var rentalIsExpired = WinJS.Utilities.getMember("overall.isExpired", rentalExpirations);
+ var rentalLatestDate = WinJS.Utilities.getMember("overall.latestDate", rentalExpirations);
+ if (rentalExpirations && rentalExpirations.length && (rentalLatestDate || rentalIsExpired)) {
+ if (_this._expirationTickTimer) {
+ window.clearTimeout(_this._expirationTickTimer);
+ _this._expirationTickTimer = null
+ }
+ MS.Entertainment.UI.RentalExpirationService.getExpirationString(_this.mediaItem, rentalLatestDate, _this._getExpirationStringCallback.bind(_this))
+ }
+ else
+ _this.expirationString = String.empty;
+ return buttonState
+ });
+ return WinJS.Promise.as(getStatePromise)
+ }
+ };
+ MovieDetailsViewModel.prototype._refreshDetailString = function() {
+ if (!this.mediaItem)
+ return;
+ _super.prototype._refreshDetailsStrings.call(this);
+ var movie = this.mediaItem;
+ this.studio = movie.studios ? MS.Entertainment.Formatters.formatGenresListNonConverter(movie.studios) : String.empty
+ };
+ MovieDetailsViewModel.prototype._refreshPurchaseDetailsString = function(stateInfo) {
+ if (!stateInfo)
+ return;
+ var distributionType = WinJS.Utilities.getMember("_smartBuyStateEngine.buttons.buy.parameter.offer.distributionType", this);
+ if (distributionType && distributionType !== MS.Entertainment.Data.Augmenter.Marketplace.edsOfferDistributionType.presale)
+ return;
+ else {
+ var presaleMetadata = Entertainment.Formatters.formatMoviePresaleMetadata(this.mediaItem, stateInfo);
+ this.mediaItemPurchaseDetails = (presaleMetadata && presaleMetadata.title) ? String.load(String.id.IDS_VIDEO_DETAILS_COMMERCE_HEADER_FORMAT).format(presaleMetadata.title, presaleMetadata.text) : String.empty
+ }
+ };
+ MovieDetailsViewModel.prototype._reloadFilteredModules = function(){};
+ MovieDetailsViewModel.prototype._updateFilterDetails = function(){};
+ MovieDetailsViewModel.prototype._onButtonsChanged = function() {
+ if (!this.disposed && this._smartBuyStateEngine) {
+ this.primaryHeaderButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.VideoDetailsActionLocations.primaryHeader);
+ this.secondaryHeaderButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.VideoDetailsActionLocations.secondaryHeader)
+ }
+ };
+ MovieDetailsViewModel.prototype._onSigninChanged = function(isSignedIn) {
+ var _this = this;
+ if (this.disposed || !this.mediaItem)
+ return;
+ var movieItem = this.mediaItem;
+ if (!movieItem.isBundle)
+ return;
+ if (this._refreshBundlePagePromise) {
+ this._refreshBundlePagePromise.cancel();
+ this._refreshBundlePagePromise = null
+ }
+ this._refreshBundlePagePromise = WinJS.Promise.timeout(100).then(function() {
+ return _this.mediaItem.refresh()
+ }).then(function() {
+ return _this._smartBuyStateEngine.updateState()
+ })
+ };
+ MovieDetailsViewModel.prototype._onMediaRightChanged = function(serviceMediaId) {
+ var _this = this;
+ if (this.disposed || !this.mediaItem || !Entertainment.Utilities.isMovie(this.mediaItem))
+ return;
+ var movieItem = this.mediaItem;
+ if (!movieItem || !movieItem.isBundle || !movieItem.bundledItems)
+ return;
+ var checkAllBundledItemsPromises = movieItem.bundledItems.map(function(bundledItem) {
+ return MS.Entertainment.ViewModels.SmartBuyStateEngine.mediaContainsServiceMediaIdAsync(bundledItem, serviceMediaId).then(function(containsServiceId) {
+ return !_this.disposed && !!_this.mediaItem && containsServiceId
+ })
+ });
+ WinJS.Promise.join(checkAllBundledItemsPromises).done(function(results) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] && _this.mediaItem && _this.mediaItem.refresh) {
+ if (_this._refreshBundlePagePromise) {
+ _this._refreshBundlePagePromise.cancel();
+ _this._refreshBundlePagePromise = null
+ }
+ _this._refreshBundlePagePromise = WinJS.Promise.timeout(100).then(function() {
+ return _this.mediaItem.refresh()
+ });
+ break
+ }
+ })
+ };
+ return MovieDetailsViewModel
+ })(ViewModels.VideoDetailsViewModelBase);
+ ViewModels.MovieDetailsViewModel = MovieDetailsViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/controls/video_win/moviedetails.js:5419 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var MovieDetails = (function(_super) {
+ __extends(MovieDetails, _super);
+ function MovieDetails(element, options) {
+ _super.call(this, element, options);
+ MS.Entertainment.UI.Framework.processDeclarativeControlContainer(this)
+ }
+ MovieDetails.prototype.onFooterLinkClicked = function(event) {
+ var foundElement = this.domElement.querySelector(".videoDetails-footer");
+ if (foundElement && MS.Entertainment.Utilities.isInvocationEvent(event))
+ foundElement.scrollIntoView()
+ };
+ MovieDetails.selectTemplate = function(item) {
+ var templateProvider = null;
+ var templateId = "";
+ if (item.mediaItem.isMovie)
+ templateId = ".templateid-movieInBundle";
+ else
+ templateId = ".templateid-tvSeriesInBundle";
+ var template = document.querySelector(templateId);
+ if (template && template.winControl)
+ templateProvider = template.winControl;
+ return WinJS.Promise.wrap(templateProvider)
+ };
+ MovieDetails.getItemSize = function(item) {
+ var itemSize = null;
+ if (item.mediaItem.isMovie)
+ itemSize = MS.Entertainment.UI.Controls.MovieDetails.movieItemSize;
+ else
+ itemSize = MS.Entertainment.UI.Controls.MovieDetails.tvItemSize;
+ return WinJS.Promise.wrap(itemSize)
+ };
+ MovieDetails.isDeclarativeControlContainer = true;
+ MovieDetails.movieItemSize = 160;
+ MovieDetails.tvItemSize = 160;
+ return MovieDetails
+ })(Controls.PageViewBase);
+ Controls.MovieDetails = MovieDetails
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MovieDetails);
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MovieDetails.selectTemplate);
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MovieDetails.getItemSize)
+})();
diff --git a/packages/microsoft.zunevideo/MoviesStore_merged.js b/packages/microsoft.zunevideo/MoviesStore_merged.js
new file mode 100644
index 00000000..03cb7abe
--- /dev/null
+++ b/packages/microsoft.zunevideo/MoviesStore_merged.js
@@ -0,0 +1,140 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/viewmodels/video_win/moviesstorehubviewmodel.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(MoviesStoreHubModuleKeys) {
+ MoviesStoreHubModuleKeys[MoviesStoreHubModuleKeys["heroModule"] = 0] = "heroModule";
+ MoviesStoreHubModuleKeys[MoviesStoreHubModuleKeys["newMovies"] = 1] = "newMovies";
+ MoviesStoreHubModuleKeys[MoviesStoreHubModuleKeys["featuredMovies"] = 2] = "featuredMovies";
+ MoviesStoreHubModuleKeys[MoviesStoreHubModuleKeys["featuredSets"] = 3] = "featuredSets";
+ MoviesStoreHubModuleKeys[MoviesStoreHubModuleKeys["topSellingMovies"] = 4] = "topSellingMovies"
+ })(ViewModels.MoviesStoreHubModuleKeys || (ViewModels.MoviesStoreHubModuleKeys = {}));
+ var MoviesStoreHubModuleKeys = ViewModels.MoviesStoreHubModuleKeys;
+ var MoviesStoreHubViewModel = (function(_super) {
+ __extends(MoviesStoreHubViewModel, _super);
+ function MoviesStoreHubViewModel() {
+ _super.apply(this, arguments)
+ }
+ Object.defineProperty(MoviesStoreHubViewModel.prototype, "heroModule", {
+ get: function() {
+ return this.modules[0]
+ }, set: function(value) {
+ this._updateModuleAndNotify(0, "heroModule", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MoviesStoreHubViewModel.prototype, "newMovies", {
+ get: function() {
+ return this.modules[1]
+ }, set: function(value) {
+ this._updateModuleAndNotify(1, "newMovies", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MoviesStoreHubViewModel.prototype, "featuredMovies", {
+ get: function() {
+ return this.modules[2]
+ }, set: function(value) {
+ this._updateModuleAndNotify(2, "featuredMovies", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MoviesStoreHubViewModel.prototype, "featuredSets", {
+ get: function() {
+ return this.modules[3]
+ }, set: function(value) {
+ this._updateModuleAndNotify(3, "featuredSets", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(MoviesStoreHubViewModel.prototype, "topSellingMovies", {
+ get: function() {
+ return this.modules[4]
+ }, set: function(value) {
+ this._updateModuleAndNotify(4, "topSellingMovies", value)
+ }, enumerable: true, configurable: true
+ });
+ MoviesStoreHubViewModel.prototype._initializeModules = function() {
+ this.modules = [ViewModels.VideoModuleFactory.createMoviesHeroModule(), ViewModels.VideoModuleFactory.createNewMoviesModule(), ViewModels.VideoModuleFactory.createFeaturedMoviesModule(), ViewModels.VideoModuleFactory.createMovieFeaturedSetsModule(), ViewModels.VideoModuleFactory.createTopSellingMoviesModule()];
+ this._primaryModule = this.newMovies;
+ this._secondaryModule = this.featuredMovies;
+ this._tertiaryModules = [this.featuredSets, this.topSellingMovies]
+ };
+ return MoviesStoreHubViewModel
+ })(ViewModels.VideoStoreHubViewModelBase);
+ ViewModels.MoviesStoreHubViewModel = MoviesStoreHubViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/controls/video_win/moviesstorehub.js:83 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var MoviesStoreHub = (function(_super) {
+ __extends(MoviesStoreHub, _super);
+ function MoviesStoreHub(element, options) {
+ _super.call(this, element, options);
+ this.loadModulesImmediately = true;
+ MS.Entertainment.UI.Framework.processDeclarativeControlContainer(this)
+ }
+ MoviesStoreHub.prototype.onHeroCarouselInvoke = function(event) {
+ if (!MS.Entertainment.Utilities.isInvocationEvent(event))
+ return;
+ if (event.srcElement && !WinJS.Utilities.hasClass(event.srcElement, "win-navbutton"))
+ if (this._heroCarousel && this._heroCarousel.dataSource) {
+ var item = this._heroCarousel.dataSource[this._heroCarousel.currentFlipViewPage];
+ this.invokeModuleAction(item)
+ }
+ };
+ MoviesStoreHub.prototype.onModuleItemClicked = function(event) {
+ if (!MS.Entertainment.Utilities.isInvocationEvent(event))
+ return;
+ if (!MS.Entertainment.UI.NetworkStatusService.isOnline()) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ else
+ _super.prototype.onModuleItemClicked.call(this, event)
+ };
+ MoviesStoreHub.isDeclarativeControlContainer = true;
+ MoviesStoreHub.movieItemSize = 160;
+ return MoviesStoreHub
+ })(Controls.PageViewBase);
+ Controls.MoviesStoreHub = MoviesStoreHub
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.MoviesStoreHub)
+})();
diff --git a/packages/microsoft.zunevideo/NowPlaying_merged.js b/packages/microsoft.zunevideo/NowPlaying_merged.js
new file mode 100644
index 00000000..8c28d560
--- /dev/null
+++ b/packages/microsoft.zunevideo/NowPlaying_merged.js
@@ -0,0 +1,720 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/controls/video_win/videowinnowplayingoverlays.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var TransportStates = MS.Entertainment.Platform.Playback.TransportState;
+ var VideoWinNowPlayingOverlays = (function(_super) {
+ __extends(VideoWinNowPlayingOverlays, _super);
+ function VideoWinNowPlayingOverlays(element, options) {
+ this.suppressUnload = true;
+ this.templateStorage = (options && options.templateStorage) || "/Controls/Video_Win/VideoWinNowPlayingOverlays.html";
+ this.templateName = "nowPlayingTemplate";
+ _super.call(this, element, options);
+ this._overlaysVisible = false;
+ this._overlaysVisiblePromise = null;
+ this._backVisible = true;
+ this._deferredUpdateTimer = null;
+ this._eventHandlers = null;
+ this._seekBarManipulating = false;
+ this._lastMousePos = {
+ x: -10, y: -10
+ };
+ this._volumeOverlay = null;
+ this._volumeControllerService = null;
+ this._volumeStateBinds = null;
+ this._dateTimeFormatters = null;
+ this._playToStateBinds = null;
+ this._volumeEnabled = false;
+ this._closedCaptionPickerOverlay = null;
+ this._audioTrackPickerOverlay = null;
+ this._closedCaptionsInitialized = false
+ }
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "_backButtonService", {
+ get: function() {
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.backButton)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "controlInitialized", {
+ get: function() {
+ return this._controlInitialized
+ }, set: function(value) {
+ this.updateAndNotify("controlInitialized", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "frozen", {
+ get: function() {
+ return this._frozen
+ }, set: function(value) {
+ this.updateAndNotify("frozen", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "playbackSession", {
+ get: function() {
+ return this._playbackSession
+ }, set: function(value) {
+ this.updateAndNotify("playbackSession", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "backVisible", {
+ get: function() {
+ return this._backVisible
+ }, set: function(value) {
+ this.updateAndNotify("backVisible", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "seekBarManipulating", {
+ get: function() {
+ return this._seekBarManipulating
+ }, set: function(value) {
+ this.updateAndNotify("seekBarManipulating", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "overlaysVisible", {
+ get: function() {
+ return this._overlaysVisible
+ }, set: function(value) {
+ var _this = this;
+ if (this._overlaysVisible !== value) {
+ this._overlaysVisible = value;
+ if (this._overlaysVisiblePromise) {
+ this._overlaysVisiblePromise.cancel();
+ this._overlaysVisiblePromise = null
+ }
+ this._overlaysVisiblePromise = this._updateVisibility(this._videoTransportControlsOverlayContainer, value).then(function() {
+ _this._overlaysVisiblePromise = null
+ }, function(){})
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "ratingImageVisible", {
+ get: function() {
+ return this._ratingImageVisible
+ }, set: function(value) {
+ var _this = this;
+ if (this._ratingImageVisible !== value) {
+ this._ratingImageVisible = value;
+ if (this._ratingImageVisiblePromise) {
+ this._ratingImageVisiblePromise.cancel();
+ this._ratingImageVisiblePromise = null
+ }
+ this._ratingImageVisiblePromise = MS.Entertainment.Utilities.toggleDisplayCollapseElement(this._ratingImageContainer, value).then(function() {
+ _this._ratingImageVisiblePromise = null
+ }, function(){})
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoWinNowPlayingOverlays.prototype, "ratingImage", {
+ get: function() {
+ return this._ratingImageUrl
+ }, set: function(value) {
+ this._ratingImageUrl = value;
+ this.updateAndNotify("videoRatingImage", value)
+ }, enumerable: true, configurable: true
+ });
+ VideoWinNowPlayingOverlays.prototype.initialize = function() {
+ this._allowedKeys = [WinJS.Utilities.Key.leftArrow, WinJS.Utilities.Key.lArrow, WinJS.Utilities.Key.lOtherArrow, WinJS.Utilities.Key.rightArrow, WinJS.Utilities.Key.rArrow, WinJS.Utilities.Key.rOtherArrow, WinJS.Utilities.Key.upArrow, WinJS.Utilities.Key.uArrow, WinJS.Utilities.Key.uOtherArrow, WinJS.Utilities.Key.downArrow, WinJS.Utilities.Key.dArrow, WinJS.Utilities.Key.dOtherArrow, WinJS.Utilities.Key.tab, WinJS.Utilities.Key.space, WinJS.Utilities.Key.invokeButton];
+ this._mainHeader = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.mainHeader);
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._keyHandlers = MS.Entertainment.Utilities.addEventHandlers(document, {
+ keydown: this.nowPlayingKeyDown.bind(this), keyup: this.nowPlayingKeyUp.bind(this)
+ }, false);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService)) {
+ var volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this._volumeControllerService = volumeControllerService;
+ this._volumeStateBinds = WinJS.Binding.bind(volumeControllerService, {
+ volume: this._onVolumeValueChange.bind(this), mute: this._onAudioEndpointStateChange.bind(this), isAudioEndpointAvailable: this._onAudioEndpointStateChange.bind(this)
+ })
+ }
+ this.controlInitialized = true;
+ this._playbackSessionBinds = WinJS.Binding.bind(this._sessionMgr, {playbackSession: this._playbackSessionChanged.bind(this)});
+ this._playToStateBinds = WinJS.Binding.bind(this._playbackSession, {isRemoteSessionRunning: this._playToStateChanged.bind(this)});
+ this._closedCaptionStateBinds = WinJS.Binding.bind(this.playbackSession, {ccLcid: function() {
+ this._updateClosedCaptionButtonState()
+ }.bind(this)});
+ this._updateVolume();
+ this._updateRepeatButton();
+ this._updateClosedCaptionButtonState();
+ this._updateAudioTracksButtonState();
+ this.hideOverlays()
+ };
+ VideoWinNowPlayingOverlays.prototype.freeze = function() {
+ _super.prototype.freeze.call(this);
+ this._suspendControl();
+ this.frozen = true
+ };
+ VideoWinNowPlayingOverlays.prototype.thaw = function() {
+ _super.prototype.thaw.call(this);
+ this.showOverlays();
+ this.frozen = false;
+ this._resetAutoHideTimer();
+ if (this._mediaChangedWhileFrozen) {
+ this._playbackSessionChanged();
+ this._mediaChangedWhileFrozen = false
+ }
+ this._playbackSessionChanged();
+ if (!this._keyHandlers)
+ this._keyHandlers = MS.Entertainment.Utilities.addEventHandlers(document, {
+ keydown: this.nowPlayingKeyDown.bind(this), keyup: this.nowPlayingKeyUp.bind(this)
+ }, false)
+ };
+ VideoWinNowPlayingOverlays.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ this.controlInitialized = false;
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFullScreenVideo = false;
+ this._clearAutoHideTimer();
+ this._detachBindings();
+ if (this._keyHandlers) {
+ this._keyHandlers.cancel();
+ this._keyHandlers = null
+ }
+ if (this._playbackSessionBinds) {
+ this._playbackSessionBinds.cancel();
+ this._playbackSessionBinds = null
+ }
+ if (this._seekbarBinds) {
+ this._seekbarBinds.cancel();
+ this._seekbarBinds = null
+ }
+ if (this._volumeStateBinds) {
+ this._volumeStateBinds.cancel();
+ this._volumeStateBinds = null
+ }
+ if (this._playToStateBinds) {
+ this._playToStateBinds.cancel();
+ this._playToStateBinds = null
+ }
+ if (this._closedCaptionStateBinds) {
+ this._closedCaptionStateBinds.cancel();
+ this._closedCaptionStateBinds = null
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype.nowPlayingMouseDown = function(event) {
+ if (event.button === 2)
+ return;
+ var srcElement = event.srcElement;
+ if (srcElement.className === String.empty || WinJS.Utilities.hasClass(srcElement, "seekBarScroller") || WinJS.Utilities.hasClass(srcElement, "cc_bodyDiv") || WinJS.Utilities.hasClass(srcElement, "cc_text") || WinJS.Utilities.hasClass(srcElement, "closedCaptionsContainer") || event.srcElement.tagName === "path" || event.srcElement.tagName === "rect" || event.srcElement.tagName === "svg") {
+ if (!this.overlaysVisible)
+ this.showOverlays();
+ else
+ this.hideOverlays();
+ this._lastMousePos.x = event.x;
+ this._lastMousePos.y = event.y
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype.nowPlayingKeyUp = function(event) {
+ if (!this.controlInitialized || this.frozen)
+ return;
+ if (event && event.keyCode === WinJS.Utilities.Key.escape)
+ this.hideOverlays();
+ else if (event && this._allowedKeys && this._allowedKeys.indexOf(event.keyCode) >= 0)
+ this.showOverlays();
+ event.cancelBubble = true
+ };
+ VideoWinNowPlayingOverlays.prototype.nowPlayingKeyDown = function(event) {
+ if (event && event.keyCode === WinJS.Utilities.Key.dismissButton)
+ if (this.overlaysVisible) {
+ this.hideOverlays();
+ event.stopPropagation()
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype.nowPlayingMouseMove = function(event) {
+ if (this._seekBar && this._seekBar.isManipulating || Math.abs(event.x - this._lastMousePos.x) < 10 && Math.abs(event.y - this._lastMousePos.y) < 10)
+ return;
+ this.showOverlays()
+ };
+ VideoWinNowPlayingOverlays.prototype.showOverlays = function() {
+ if (!this.controlInitialized)
+ return;
+ if (this.overlaysVisible) {
+ this._resetAutoHideTimer();
+ return
+ }
+ this.playbackSession.forceTimeUpdate();
+ this.playbackSession.enableTimeUpdate();
+ this.overlaysVisible = true;
+ this.showBackButton();
+ this._resetAutoHideTimer();
+ if (MS.Entertainment.Platform.PlaybackHelpers.shouldDisplayRatingImage())
+ this.ratingImageVisible = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFullScreenVideo = false;
+ this._updateCursorVisibility(true);
+ this._updateStates()
+ };
+ VideoWinNowPlayingOverlays.prototype.hideOverlays = function() {
+ if (this._playbackSession && (this._playbackSession.isRemoteSessionRunning || this._playbackSession.currentTransportState === TransportStates.paused))
+ return;
+ if (((this._seekBar && this._seekBar.isManipulating) && this.playbackSession.currentTransportState !== TransportStates.starting) || (this._volumeOverlay && this._volumeOverlay.visible))
+ return;
+ else {
+ if (!this.playbackSession.closedCaptionsOn)
+ this.playbackSession.disableTimeUpdate();
+ if (this._closedCaptionPickerOverlay && this._closedCaptionPickerOverlay.visible)
+ this._closedCaptionPickerOverlay.hide();
+ if (this._audioTrackPickerOverlay && this._audioTrackPickerOverlay.visible)
+ this._audioTrackPickerOverlay.hide();
+ this.overlaysVisible = false;
+ if (this.playbackSession.currentTransportState === TransportStates.starting)
+ this.showBackButton();
+ else
+ this.hideBackButton();
+ this._clearAutoHideTimer();
+ if (MS.Entertainment.Platform.PlaybackHelpers.shouldDisplayRatingImage() && this.ratingImage !== String.empty)
+ this.ratingImageVisible = true;
+ this._updateCursorVisibility(false);
+ this._updateStates()
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype.hideBackButton = function() {
+ if (this._mainHeader && this.backVisible)
+ this.backVisible = false;
+ this._updateStates()
+ };
+ VideoWinNowPlayingOverlays.prototype.showBackButton = function() {
+ if (!this.backVisible)
+ this.backVisible = true;
+ this._updateStates()
+ };
+ VideoWinNowPlayingOverlays.prototype._detachBindings = function() {
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._suspendControl = function() {
+ this._detachBindings();
+ this.overlaysVisible = false;
+ if (this._keyHandlers) {
+ this._keyHandlers.cancel();
+ this._keyHandlers = null
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._resetAutoHideTimer = function() {
+ var _this = this;
+ this._clearAutoHideTimer();
+ var timeoutMs = MS.Entertainment.UI.Controls.VideoWinNowPlayingOverlays._autoHideOverlays;
+ var isHidden = !this.overlaysVisible && !this.backVisible;
+ if (timeoutMs > 0 && !isHidden)
+ this._autoHideTimeout = WinJS.Promise.timeout(timeoutMs).then(function() {
+ _this.hideOverlays()
+ })
+ };
+ VideoWinNowPlayingOverlays.prototype._clearAutoHideTimer = function() {
+ if (this._autoHideTimeout) {
+ this._autoHideTimeout.cancel();
+ this._autoHideTimeout = null
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._seekBarManipulatingChanged = function() {
+ if (this.playbackSession)
+ this.seekBarManipulating = this._seekBar.isManipulating;
+ this.showOverlays()
+ };
+ VideoWinNowPlayingOverlays.prototype._volumeOverlayVisibilityChanged = function(value) {
+ this.hideOverlays()
+ };
+ VideoWinNowPlayingOverlays.prototype._onVolumeValueChange = function(newValue) {
+ if (!this.controlInitialized)
+ return;
+ if (this._volumeText && this._volumeControllerService.isAudioEndpointAvailable)
+ this._updateVolumeText(newValue)
+ };
+ VideoWinNowPlayingOverlays.prototype._updateVolumeText = function(volumeLevel) {
+ if (!this.controlInitialized)
+ return;
+ if (this._volumeText) {
+ var roundedLevel = (this._volumeControllerService.mute) ? 0 : Math.round(volumeLevel * 100);
+ this._volumeText.textContent = this._formatNumber(roundedLevel)
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._onAudioEndpointStateChange = function(newValue) {
+ if (!this.controlInitialized)
+ return;
+ this._updateVolume()
+ };
+ VideoWinNowPlayingOverlays.prototype._playToStateChanged = function(newState) {
+ if (this._unloaded)
+ return;
+ this._updateVolume();
+ WinJS.Promise.timeout(MS.Entertainment.UI.Controls.VideoWinNowPlayingOverlays._updateButtonTimeout).done(this._updateAudioTracksButtonState.bind(this))
+ };
+ VideoWinNowPlayingOverlays.prototype._updateStates = function() {
+ if (this._deferredUpdateTimer || this.frozen)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ };
+ VideoWinNowPlayingOverlays.prototype._updateStatesDeferred = function() {
+ this._deferredUpdateTimer = null;
+ if (this.backVisible) {
+ this.ratingImageVisible = false;
+ this._backButtonService.showBackButton(true)
+ }
+ else
+ this._backButtonService.hideBackButton(true);
+ this._updatePlayPauseButton();
+ this._updateMetadata();
+ this._updateSeekbar()
+ };
+ VideoWinNowPlayingOverlays.prototype._mediaChanged = function() {
+ var _this = this;
+ if (!this.controlInitialized)
+ return;
+ else if (this.frozen) {
+ this._mediaChangedWhileFrozen = true;
+ return
+ }
+ if (this.playbackSession && this.playbackSession.currentMedia !== null) {
+ this._initializeClosedCaptionButtonState();
+ this._updateAudioTracksButtonState();
+ MS.Entertainment.Platform.PlaybackHelpers.getVideoRatingImageAsync().done(function(ratingImageUrl) {
+ if (ratingImageUrl === String.empty) {
+ _this.ratingImage = String.empty;
+ _this.ratingImageVisible = false
+ }
+ else if (MS.Entertainment.Platform.PlaybackHelpers.shouldDisplayRatingImage())
+ _this.ratingImage = ratingImageUrl
+ }, function(){})
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._mediaStateChanged = function(event) {
+ var newVal = event.detail.newValue;
+ var oldVal = event.detail.oldValue;
+ if (this.frozen || !this.controlInitialized)
+ return;
+ if (newVal === TransportStates.starting)
+ this.hideOverlays();
+ else if (newVal === TransportStates.paused)
+ this.showOverlays();
+ else if (oldVal)
+ if (newVal === TransportStates.stopped)
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ this.showOverlays();
+ if (this.playbackSession.currentMedia && !this.playbackSession.currentMedia.hasServiceId && this.playbackSession.currentMedia.activationFilePath && this.playbackSession.currentTransportState === TransportStates.stopped)
+ this._showVideoPostRoll()
+ }
+ if (newVal === TransportStates.playing || newVal === TransportStates.paused)
+ this._updateAudioTracksButtonState();
+ this._updatePlayPauseButton()
+ };
+ VideoWinNowPlayingOverlays.prototype._playbackSessionChanged = function() {
+ this._detachBindings();
+ if (this.playbackSession) {
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.playbackSession, {
+ currentMediaChanged: this._mediaChanged.bind(this), currentTransportStateChanged: this._mediaStateChanged.bind(this)
+ });
+ this._mediaChanged();
+ this._mediaStateChanged({detail: {newValue: this.playbackSession.currentTransportState}})
+ }
+ this._updateStates()
+ };
+ VideoWinNowPlayingOverlays.prototype._updateMetadata = function() {
+ if (!this.controlInitialized)
+ return;
+ var currentMedia = this.playbackSession.currentMedia;
+ if (currentMedia)
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(currentMedia)) {
+ if (currentMedia.seriesTitle)
+ this._metadataTitle.textContent = currentMedia.seriesTitle;
+ else if (currentMedia.ParentSeries)
+ this._metadataTitle.textContent = currentMedia.ParentSeries.Name;
+ if (currentMedia.seasonNumber > -1 && currentMedia.episodeNumber && currentMedia.name)
+ this._metadataSubtitle.textContent = String.load(String.id.IDS_TV_NUMBERED_EPISODE_SEASON_TITLE).format(currentMedia.seasonNumber, currentMedia.episodeNumber, currentMedia.name);
+ else if (currentMedia.name)
+ this._metadataSubtitle.textContent = currentMedia.name
+ }
+ else {
+ this._metadataTitle.textContent = currentMedia.title;
+ this._metadataSubtitle.textContent = MS.Entertainment.Formatters.formatGenre(currentMedia);
+ {}
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._updateSeekbar = function() {
+ if (this.playbackSession && this.playbackSession.currentMedia) {
+ if (!this._seekBar) {
+ this._seekBarContainer.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.PlaybackSeekBar");
+ this._seekBar = new MS.Entertainment.UI.Controls.PlaybackSeekBar(this._seekBarContainer, {});
+ this._seekBar.playbackSession = this.playbackSession;
+ this._seekBar.initializeDuration();
+ this._seekbarBinds = WinJS.Binding.bind(this._seekBar, {isManipulating: this._seekBarManipulatingChanged.bind(this)})
+ }
+ WinJS.Utilities.removeClass(this._seekBar.domElement, "hideFromDisplay")
+ }
+ if (this._seekBar)
+ this._seekBar.updateScrollerState()
+ };
+ VideoWinNowPlayingOverlays.prototype._updatePlayPauseButton = function() {
+ if (!this.playbackSession)
+ return;
+ if (this.playbackSession.targetTransportState !== TransportStates.playing) {
+ WinJS.Utilities.removeClass(this._playPauseButton, "icon-win-pause");
+ WinJS.Utilities.addClass(this._playPauseButton, "icon-win-play");
+ this._playPauseButton.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_BUTTON))
+ }
+ else {
+ WinJS.Utilities.removeClass(this._playPauseButton, "icon-win-play");
+ WinJS.Utilities.addClass(this._playPauseButton, "icon-win-pause");
+ this._playPauseButton.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON))
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._playPauseClick = function() {
+ if (!this.playbackSession)
+ return;
+ if (this.playbackSession.targetTransportState !== TransportStates.playing) {
+ this.playbackSession.targetTransportState = TransportStates.playing;
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportPlay, String.load(MS.Entertainment.UI.Controls.TransportControls.playButtonStringId));
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked(this._playPauseButton.className)
+ }
+ else {
+ this.playbackSession.targetTransportState = TransportStates.paused;
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportPause, String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON));
+ MS.Entertainment.Utilities.Telemetry.logPauseClicked(this._playPauseButton.className)
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._volumeKeyDown = function(event) {
+ switch (event.keyCode) {
+ case WinJS.Utilities.Key.enter:
+ case WinJS.Utilities.Key.space:
+ this._volumeClick();
+ break
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._updateVolume = function() {
+ if (!this._volumeControllerService || !this._volumeButton || !this._volumeText)
+ return;
+ this._volumeEnabled = false;
+ if (this._volumeControllerService.isAudioEndpointAvailable) {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-xbox-volumeDisabled");
+ if (this._volumeControllerService.mute) {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-win-volume");
+ WinJS.Utilities.addClass(this._volumeButton, "icon-win-mute");
+ this._volumeContainer.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON))
+ }
+ else {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-win-mute");
+ WinJS.Utilities.addClass(this._volumeButton, "icon-win-volume");
+ var formattedValue = this._formatNumber(Math.round(this._volumeControllerService.volume * 100));
+ this._volumeContainer.setAttribute("aria-label", String.load(String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON).format(formattedValue))
+ }
+ this._volumeEnabled = true;
+ if (this._playbackSession && this._playbackSession.isRemoteSessionRunning)
+ this._volumeEnabled = false;
+ this._updateVolumeText(this._volumeControllerService.volume)
+ }
+ else {
+ WinJS.Utilities.removeClass(this._volumeButton, "icon-win-volume icon-win-mute");
+ WinJS.Utilities.addClass(this._volumeButton, "icon-xbox-volumeDisabled");
+ this._volumeText.textContent = String.empty
+ }
+ this._updateButton(this._volumeButton, this._volumeEnabled)
+ };
+ VideoWinNowPlayingOverlays.prototype._volumeClick = function() {
+ var _this = this;
+ if (!this._volumeEnabled)
+ return;
+ var position = WinJS.Utilities.getPosition(this._volumeContainer);
+ var distanceFromBottom = (MS.Entertainment.Utilities.getWindowHeight() - position.top);
+ var left = (position.left >= 0 && position.width >= 0) ? (position.left + Math.round((0.5 * position.width) - 33)) + "px" : "auto";
+ var top = "auto";
+ var right = "auto";
+ var bottom = "77px";
+ var customStyle = "volumeContainer";
+ if (!this._volumeOverlay) {
+ this._volumeOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.VolumeBar", {}, {
+ right: right, top: top, left: left, bottom: bottom
+ });
+ this._volumeOverlay.customStyle = customStyle;
+ this._volumeOverlay.enableKeyboardLightDismiss = true;
+ this._volumeOverlay.show().done(function() {
+ _this.hideOverlays();
+ _this._volumeOverlay = null
+ }, function() {
+ _this._volumeOverlay = null
+ })
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._closedCaptionClick = function() {
+ var _this = this;
+ var position = WinJS.Utilities.getPosition(this._closedCaptionButton);
+ var transportControlsPosition = WinJS.Utilities.getPosition(this._videoTransportControlsOverlayContainer);
+ var distanceFromBottom = (MS.Entertainment.Utilities.getWindowHeight() - transportControlsPosition.top);
+ var left = (position.left >= 0 && position.width >= 0) ? (position.left + Math.round((0.5 * position.width) - 70)) + "px" : "auto";
+ var top = "auto";
+ var right = "auto";
+ var bottom = (distanceFromBottom + 5) + "px";
+ if (!this._closedCaptionPickerOverlay) {
+ this._closedCaptionPickerOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.ClosedCaptionPicker", {}, {
+ right: right, top: top, left: left, bottom: bottom
+ });
+ this._closedCaptionPickerOverlay.customStyle = "control-ClosedCaptionPicker-overlayAnchor";
+ this._closedCaptionPickerOverlay.enableKeyboardLightDismiss = true;
+ this._closedCaptionPickerOverlay.show().done(function() {
+ _this._closedCaptionPickerOverlay = null;
+ _this._updateClosedCaptionButtonState()
+ }, function() {
+ _this._closedCaptionPickerOverlay = null
+ })
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._initializeClosedCaptionButtonState = function() {
+ if (this.playbackSession) {
+ if (!this._closedCaptionsInitialized) {
+ MS.Entertainment.Platform.Playback.ClosedCaptions.Renderer.loadAndUpdateClosedCaptionStyleSettings();
+ this._closedCaptionsInitialized = true
+ }
+ var filteredClosedCaptions = this.playbackSession.filterClosedCaptions(this.playbackSession.currentMedia);
+ this._updateButton(this._closedCaptionButton, filteredClosedCaptions.length > 0);
+ var savedCCLcid = MS.Entertainment.UI.Controls.ClosedCaptionPicker.loadCaptionsLcidFromSettings();
+ (savedCCLcid !== String.empty) ? this.playbackSession.closedCaptionsOn = true : this.playbackSession.closedCaptionsOn = false;
+ this.playbackSession.ccLcid = savedCCLcid
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._updateClosedCaptionButtonState = function() {
+ if (this.playbackSession) {
+ this._resetAutoHideTimer();
+ (this.playbackSession.closedCaptionsOn) ? WinJS.Utilities.addClass(this._closedCaptionButton, "closedCaptionsEnabled") : WinJS.Utilities.removeClass(this._closedCaptionButton, "closedCaptionsEnabled");
+ this._updateStates()
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._audioTracksClick = function() {
+ var _this = this;
+ var position = WinJS.Utilities.getPosition(this._audioTracksButton);
+ var transportControlsPosition = WinJS.Utilities.getPosition(this._videoTransportControlsOverlayContainer);
+ var distanceFromBottom = (MS.Entertainment.Utilities.getWindowHeight() - transportControlsPosition.top);
+ var left = (position.left >= 0 && position.width >= 0) ? (position.left + Math.round((0.5 * position.width) - 70)) + "px" : "auto";
+ var top = "auto";
+ var right = "auto";
+ var bottom = (distanceFromBottom + 5) + "px";
+ if (!this._audioTrackPickerOverlay) {
+ this._audioTrackPickerOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.AudioTrackPicker", {}, {
+ right: right, top: top, left: left, bottom: bottom
+ });
+ this._audioTrackPickerOverlay.customStyle = "control-AudioTrackPicker-overlayAnchor";
+ this._audioTrackPickerOverlay.enableKeyboardLightDismiss = true;
+ this._audioTrackPickerOverlay.show().then(null, function(){}).done(function() {
+ _this._audioTrackPickerOverlay = null
+ })
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._updateAudioTracksButtonState = function() {
+ var audioTracksButtonEnabled = true;
+ if (this.playbackSession && this.playbackSession.currentTransportState !== TransportStates.stopped) {
+ this._audioTracks = this.playbackSession.getAudioTracks();
+ this._audioTracksLength = this._audioTracks.length;
+ if (this.playbackSession.isRemoteSessionRunning || this._audioTracksLength === 0)
+ audioTracksButtonEnabled = false;
+ else if (this._audioTracksLength > 1)
+ WinJS.Utilities.removeClass(this._playbackControls, "controls-AudioTracksButtonRemoved");
+ else
+ WinJS.Utilities.addClass(this._playbackControls, "controls-AudioTracksButtonRemoved");
+ this._updateButton(this._audioTracksButton, audioTracksButtonEnabled)
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._repeatClick = function() {
+ if (this._playbackSession) {
+ this._playbackSession.repeat = !this._playbackSession.repeat;
+ this._updateRepeatButton();
+ this._updateStates();
+ MS.Entertainment.Utilities.Telemetry.logTransportControlsCommand(MS.Entertainment.UI.AutomationIds.transportRepeat, String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON))
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._updateRepeatButton = function() {
+ var sessionRepeat = this._playbackSession && this._playbackSession.canRepeat && this._playbackSession.repeat;
+ var repeatText = sessionRepeat ? String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON);
+ var repeatTooltipText = sessionRepeat ? String.load(String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON) : String.load(String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON);
+ this._repeatButton.setAttribute("aria-label", repeatTooltipText);
+ this._repeatButton.title = repeatTooltipText;
+ sessionRepeat ? WinJS.Utilities.addClass(this._repeatButton, "repeatButtonOn") : WinJS.Utilities.removeClass(this._repeatButton, "repeatButtonOn")
+ };
+ VideoWinNowPlayingOverlays.prototype._metadataKeyDown = function(event) {
+ switch (event.keyCode) {
+ case WinJS.Utilities.Key.enter:
+ case WinJS.Utilities.Key.space:
+ this._metadataClick(event);
+ break
+ }
+ };
+ VideoWinNowPlayingOverlays.prototype._metadataClick = function(event) {
+ var showDetailsEvent = document.createEvent("Event");
+ showDetailsEvent.initEvent("NowPlaying_ShowDetails", true, false);
+ this.domElement.dispatchEvent(showDetailsEvent);
+ event.cancelBubble = true
+ };
+ VideoWinNowPlayingOverlays.prototype._updateVisibility = function(element, makeVisible) {
+ var timeout = 500;
+ var domElement = element;
+ if (element && element.domElement)
+ domElement = element.domElement;
+ if (!domElement)
+ return WinJS.Promise.as();
+ if (makeVisible) {
+ WinJS.Utilities.removeClass(domElement, VideoWinNowPlayingOverlays.nowPlayingControlsSlideDownClass);
+ WinJS.Utilities.addClass(domElement, VideoWinNowPlayingOverlays.nowPlayingControlsSlideUpClass);
+ return MS.Entertainment.Utilities.showElement(domElement)
+ }
+ else
+ return MS.Entertainment.Utilities.hideElement(domElement, timeout).then(null, function() {
+ WinJS.Utilities.removeClass(domElement, VideoWinNowPlayingOverlays.nowPlayingControlsSlideUpClass);
+ WinJS.Utilities.addClass(domElement, VideoWinNowPlayingOverlays.nowPlayingControlsSlideDownClass);
+ WinJS.Utilities.addClass(domElement, "hideFromDisplay")
+ })
+ };
+ VideoWinNowPlayingOverlays.prototype._updateCursorVisibility = function(makeVisible) {
+ var cursorStyle = makeVisible ? "default" : "none";
+ if (this.playbackSession && this.playbackSession._playbackControlHost && (!this.playbackSession.closedCaptionsOn || makeVisible) && this.playbackSession._playbackControlHost.style.cursor !== cursorStyle)
+ this.playbackSession._playbackControlHost.style.cursor = cursorStyle
+ };
+ VideoWinNowPlayingOverlays.prototype._showVideoPostRoll = function() {
+ var videoPostRollViewModel = new MS.Entertainment.ViewModels.VideoPostRollViewModel;
+ if (videoPostRollViewModel.isValid)
+ MS.Entertainment.UI.Controls.Video.VideoPostRoll.showVideoPostRollOverlay(videoPostRollViewModel)
+ };
+ VideoWinNowPlayingOverlays.prototype._formatNumber = function(num) {
+ if (!this._dateTimeFormatters) {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.dateTimeFormatters))
+ return String.empty;
+ this._dateTimeFormatters = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters)
+ }
+ return this._dateTimeFormatters.decimalNumber.format(num)
+ };
+ VideoWinNowPlayingOverlays.prototype._updateButton = function(button, enable) {
+ if (!button)
+ return;
+ if (enable !== true)
+ button.setAttribute("disabled", "disabled");
+ else
+ button.removeAttribute("disabled")
+ };
+ VideoWinNowPlayingOverlays._autoHideOverlays = 3000;
+ VideoWinNowPlayingOverlays._updateButtonTimeout = 100;
+ VideoWinNowPlayingOverlays.nowPlayingControlsSlideUpClass = "nowPlayingControlsSlideUp";
+ VideoWinNowPlayingOverlays.nowPlayingControlsSlideDownClass = "nowPlayingControlsSlideDown";
+ return VideoWinNowPlayingOverlays
+ })(UI.Framework.UserControl);
+ Controls.VideoWinNowPlayingOverlays = VideoWinNowPlayingOverlays
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.VideoWinNowPlayingOverlays)
+})();
diff --git a/packages/microsoft.zunevideo/SearchResultsPage_merged.js b/packages/microsoft.zunevideo/SearchResultsPage_merged.js
new file mode 100644
index 00000000..60c44175
--- /dev/null
+++ b/packages/microsoft.zunevideo/SearchResultsPage_merged.js
@@ -0,0 +1,1058 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/framework/scriptutilities.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(Framework) {
+ (function(ScriptUtilities) {
+ function setOptions(target, options, setPublicMembersOnly) {
+ if (!target || !options || typeof options !== "object")
+ return;
+ Object.keys(options).forEach(function(key) {
+ var privateKey = "_" + key;
+ var value = options[key];
+ if (privateKey in target && !setPublicMembersOnly)
+ target[privateKey] = value;
+ else if (key in target)
+ target[key] = value
+ })
+ }
+ ScriptUtilities.setOptions = setOptions;
+ function waitForSnappedIfNeeded(disallowUserDismiss) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var waitForSnappedPromise = WinJS.Promise.as();
+ if (uiStateService.isSnapped)
+ waitForSnappedPromise = Entertainment.UI.Framework.loadTemplate("/Controls/PleaseResizeDialog.html", "pleaseResizeDialog", true).then(function() {
+ return Entertainment.UI.Controls.PleaseResizeDialog.waitForWindowResize(!!disallowUserDismiss)
+ });
+ return waitForSnappedPromise
+ }
+ ScriptUtilities.waitForSnappedIfNeeded = waitForSnappedIfNeeded;
+ function _getTabStopsForElementsSubtree(element, includeNegativeTabStops) {
+ var tabStops = WinJS.Utilities.query("*", element).filter(function(candidateTabstop) {
+ if ((candidateTabstop.tabIndex < 0) && !includeNegativeTabStops)
+ return false;
+ if (candidateTabstop.hasAttribute("tabindex"))
+ return true;
+ switch (candidateTabstop.tagName.toLocaleLowerCase()) {
+ case"button":
+ return true;
+ default:
+ return false
+ }
+ });
+ return tabStops
+ }
+ function suppressTabbing(element) {
+ _getTabStopsForElementsSubtree(element, false).forEach(function(item) {
+ item.previousTabIndex = item.tabIndex;
+ item.tabIndex = -1
+ })
+ }
+ ScriptUtilities.suppressTabbing = suppressTabbing;
+ function restoreTabbing(element) {
+ _getTabStopsForElementsSubtree(element, true).forEach(function(item) {
+ if (item.previousTabIndex === undefined)
+ return;
+ item.tabIndex = item.previousTabIndex;
+ item.previousTabIndex = undefined
+ })
+ }
+ ScriptUtilities.restoreTabbing = restoreTabbing;
+ function initializeControlWithDeclarativeControls(control) {
+ Framework.assert(Entertainment.Utilities.isApp2, "initializeControlWithDeclarativeControls should only be called in app2");
+ var members = control.domElement.querySelectorAll("[data-win-blockbinding]");
+ var promises = [WinJS.UI.processAll(control.domElement.firstElementChild), function() {
+ return WinJS.UI.processAll(control.domElement)
+ }];
+ for (var i = members.length - 1; i >= 0; i--)
+ ScriptUtilities.addConstructionPromisesForElementTree(members[i], promises);
+ promises.push(function() {
+ MS.Entertainment.UI.Framework.processDeclMembers(control.domElement, control)
+ });
+ for (var i = 0; i < members.length; i++)
+ ScriptUtilities.addBindingsForElementTreePromise(members[i], promises);
+ ScriptUtilities.addBindingProcessPromise(control.domElement, promises);
+ for (var i = 0; i < members.length; i++)
+ ScriptUtilities.addBindingProcessPromise(members[i], promises);
+ return promises.reduce(function(current, next) {
+ return current.then(next)
+ }).then(null, function(error) {
+ Framework.fail("Error binding declarative controls: " + (error && error.message))
+ })
+ }
+ ScriptUtilities.initializeControlWithDeclarativeControls = initializeControlWithDeclarativeControls;
+ function addConstructionPromisesForElementTree(element, promises) {
+ promises.push(function() {
+ return WinJS.UI.processAll(element.firstElementChild)
+ });
+ promises.push(function() {
+ return WinJS.UI.processAll(element)
+ });
+ promises.push(function() {
+ MS.Entertainment.UI.Framework.processDeclMembers(element, element.winControl)
+ });
+ promises.push(function() {
+ MS.Entertainment.UI.Framework.processDeclEvents(element)
+ })
+ }
+ ScriptUtilities.addConstructionPromisesForElementTree = addConstructionPromisesForElementTree;
+ function addBindingsForElementTreePromise(element, promises) {
+ promises.push(function() {
+ var firstParentElement = element.parentElement;
+ while (firstParentElement && !firstParentElement.getAttribute("data-win-control"))
+ firstParentElement = firstParentElement.parentElement;
+ var promise = WinJS.Promise.as();
+ if (firstParentElement) {
+ var parentControl = firstParentElement.winControl;
+ var blockBinding = element.getAttribute("data-win-blockbinding");
+ var binds = blockBinding.split(';');
+ binds.forEach(function(bindingPairString) {
+ var bindingPair = bindingPairString.split(':');
+ if (bindingPair.length > 1) {
+ var paths = bindingPair[1].trim().split('.');
+ var bindingPath = {};
+ var workingPath = bindingPath;
+ for (var j = 0; j < paths.length - 1; j++) {
+ workingPath[paths[j]] = {};
+ workingPath = workingPath[paths[j]]
+ }
+ workingPath[paths[paths.length - 1]] = function(newValue) {
+ element.winControl[bindingPair[0].trim()] = newValue;
+ element.winControl.notify(bindingPair[0].trim(), newValue)
+ };
+ WinJS.Binding.bind(parentControl, bindingPath)
+ }
+ else if (bindingPair.length > 2)
+ Framework.fail("Binding block format is incorrect.")
+ })
+ }
+ return WinJS.Promise.as()
+ })
+ }
+ ScriptUtilities.addBindingsForElementTreePromise = addBindingsForElementTreePromise;
+ function addBindingProcessPromise(element, promises) {
+ promises.push(function() {
+ WinJS.Binding.processAll(element.firstElementChild, element.winControl)
+ })
+ }
+ ScriptUtilities.addBindingProcessPromise = addBindingProcessPromise
+ })(Framework.ScriptUtilities || (Framework.ScriptUtilities = {}));
+ var ScriptUtilities = Framework.ScriptUtilities;
+ (function(PlayValidation) {
+ var MediaPlayValidation = (function() {
+ function MediaPlayValidation(){}
+ MediaPlayValidation.prototype.validatePlayMedia = function(mediaItemToPlay) {
+ var _this = this;
+ return this.getSigningInPromise().then(function() {
+ return _this.mediaPlaybackPromise(mediaItemToPlay)
+ })
+ };
+ MediaPlayValidation.prototype.getSigningInPromise = function() {
+ var signIn = Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInSignal = new MS.Entertainment.UI.Framework.Signal;
+ var signInBindings;
+ var signInPromise = WinJS.Promise.wrap();
+ var cleanupSignInBindings = function() {
+ if (!signInBindings)
+ return;
+ signInBindings.cancel();
+ signInBindings = null;
+ if (signedInSignal)
+ signedInSignal.complete()
+ };
+ if (signIn.isSigningIn) {
+ signInBindings = WinJS.Binding.bind(signIn, {isSigningIn: cleanupSignInBindings});
+ signInPromise = signedInSignal.promise
+ }
+ return signInPromise
+ };
+ MediaPlayValidation.prototype.mediaPlaybackPromise = function(invokedMedia) {
+ if (!Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.adService))
+ return WinJS.Promise.wrap();
+ var signal = new Entertainment.UI.Framework.Signal;
+ var adService = Entertainment.ServiceLocator.getService(Entertainment.Services.adService);
+ adService.isStreamingBlocked(invokedMedia).done(function(signInNeeded) {
+ var dialogDismissedSignal = new Entertainment.UI.Framework.Signal;
+ var dialogDismissed = function() {
+ dialogDismissedSignal.complete()
+ };
+ dialogDismissedSignal.promise.then(function() {
+ var signIn = Entertainment.ServiceLocator.getService(Entertainment.Services.signIn);
+ return (!signInNeeded || signIn.isSignedIn) ? adService.playVideoAdIfRequired(invokedMedia, null) : false
+ }).then(function(adPlayedIfNeeded) {
+ if (adPlayedIfNeeded)
+ signal.complete();
+ else
+ signal.promise.cancel();
+ return WinJS.Promise.as()
+ }, function(error) {
+ Entertainment.ViewModels.fail("playVideoAdIfRequired_failed: " + (error && error.message));
+ signal.complete()
+ });
+ if (signInNeeded) {
+ var featureEnablement = Entertainment.ServiceLocator.getService(Entertainment.Services.featureEnablement);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlayAnonymous))
+ Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC), null, [Entertainment.Music.MusicBrandDialog.dialogButtonIds.signUp, Entertainment.Music.MusicBrandDialog.dialogButtonIds.cancel], dialogDismissed);
+ else if (configurationManager.service.lastSignedInUserXuid)
+ Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_EXISTING_USER_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC), null, [Entertainment.Music.MusicBrandDialog.dialogButtonIds.signInNowForExistingUser, Entertainment.Music.MusicBrandDialog.dialogButtonIds.cancel], dialogDismissed);
+ else
+ Entertainment.Music.MusicBrandDialog.show(String.load(String.id.IDS_MUSIC_STREAMING_KEEP_PLAYING_NEW_USER_TITLE), String.load(String.id.IDS_MUSIC_STREAMING_SIGN_IN_DESC), null, [Entertainment.Music.MusicBrandDialog.dialogButtonIds.signInNowForNewUser, Entertainment.Music.MusicBrandDialog.dialogButtonIds.cancel], dialogDismissed)
+ }
+ else
+ dialogDismissed()
+ }, function(error) {
+ Entertainment.ViewModels.fail("isStreamingBlocked_failed: " + (error && error.message));
+ signal.error(error)
+ });
+ return signal.promise
+ };
+ return MediaPlayValidation
+ })();
+ PlayValidation.MediaPlayValidation = MediaPlayValidation
+ })(Framework.PlayValidation || (Framework.PlayValidation = {}));
+ var PlayValidation = Framework.PlayValidation
+ })(Entertainment.Framework || (Entertainment.Framework = {}));
+ var Framework = Entertainment.Framework
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/searchviewmodelbase.js:224 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(SearchResultsScopes) {
+ SearchResultsScopes[SearchResultsScopes["collection"] = 0] = "collection";
+ SearchResultsScopes[SearchResultsScopes["catalog"] = 1] = "catalog"
+ })(ViewModels.SearchResultsScopes || (ViewModels.SearchResultsScopes = {}));
+ var SearchResultsScopes = ViewModels.SearchResultsScopes;
+ var SearchViewModelBase = (function(_super) {
+ __extends(SearchViewModelBase, _super);
+ function SearchViewModelBase(searchText, searchScope) {
+ _super.call(this);
+ this._catalogHeaderPivot = null;
+ this._catalogModules = [];
+ this._collectionHeaderPivot = null;
+ this._collectionModules = [];
+ this._bindings = [];
+ this._isMarketplaceEnabled = true;
+ this._pivotsSelectionManager = null;
+ this._searchText = String.empty;
+ this._searchResultText = String.empty;
+ this._searchScope = 0;
+ this._viewStateViewModel = null;
+ this._searchText = searchText;
+ this.searchResultsText = searchText;
+ this._searchScope = searchScope
+ }
+ Object.defineProperty(SearchViewModelBase.prototype, "isCatalogScope", {
+ get: function() {
+ return this._searchScope === 1
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "isCollectionScope", {
+ get: function() {
+ return this._searchScope === 0
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "isMarketplaceEnabled", {
+ get: function() {
+ return this._isMarketplaceEnabled
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "pivotsSelectionManager", {
+ get: function() {
+ return this._pivotsSelectionManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "searchResultsText", {
+ get: function() {
+ return this._searchResultText
+ }, set: function(value) {
+ this._searchResultText = String.load(SearchViewModelBase.RESULTS_STRING_FORMAT).format(value);
+ this.updateAndNotify("searchResultsText", this._searchResultText)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "searchScope", {
+ get: function() {
+ return this._searchScope
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchViewModelBase.prototype, "searchText", {
+ get: function() {
+ return this._searchText
+ }, enumerable: true, configurable: true
+ });
+ SearchViewModelBase.prototype.scheduledDelayInitialize = function() {
+ this.modules.forEach(function(searchModule) {
+ searchModule.delayInitialize()
+ })
+ };
+ SearchViewModelBase.prototype.dispose = function() {
+ this._bindings.forEach(function(binding) {
+ binding.cancel();
+ binding = null
+ });
+ if (this._pivotsSelectionManager) {
+ this._pivotsSelectionManager.dispose();
+ this._pivotsSelectionManager = null
+ }
+ _super.prototype.dispose.call(this)
+ };
+ SearchViewModelBase.prototype.navigatedBackTo = function() {
+ this.modules.forEach(function(searchModule) {
+ searchModule.refreshItems()
+ })
+ };
+ SearchViewModelBase.prototype.loadModules = function() {
+ if (!this.isOnline && this.isMarketplaceEnabled) {
+ this._searchScope = 0;
+ this._pivotsSelectionManager.selectedItem = this._collectionHeaderPivot
+ }
+ this._updateModuleSearchScope();
+ this.modules.forEach(function(searchModule) {
+ searchModule.load()
+ })
+ };
+ SearchViewModelBase.prototype._initializeModules = function() {
+ this.listenForModuleViewStateChanges()
+ };
+ SearchViewModelBase.prototype._addBinding = function(binding) {
+ this._bindings.push(binding)
+ };
+ SearchViewModelBase.prototype._addBindings = function(bindings) {
+ this._bindings = this._bindings.concat(bindings)
+ };
+ SearchViewModelBase.prototype._addCatalogModule = function(searchModule) {
+ this._catalogModules.push(searchModule);
+ this.modules = this._collectionModules.concat(this._catalogModules)
+ };
+ SearchViewModelBase.prototype._addCollectionModule = function(searchModule) {
+ this._collectionModules.push(searchModule);
+ this.modules = this._collectionModules.concat(this._catalogModules)
+ };
+ SearchViewModelBase.prototype._onPivotChanged = function() {
+ this.delayInitialize();
+ this._searchScope = this._collectionHeaderPivot.selected ? 0 : 1;
+ this._updateModuleSearchScope();
+ this._refreshEmptyViewState();
+ this.viewStateViewModel.viewState = -3
+ };
+ SearchViewModelBase.prototype._updateModuleSearchScope = function() {
+ var _this = this;
+ this._collectionModules.forEach(function(collectionModule) {
+ collectionModule.isExcludedFromPageState = _this.isCatalogScope
+ });
+ this._catalogModules.forEach(function(catalogModule) {
+ catalogModule.isExcludedFromPageState = _this.isCollectionScope
+ })
+ };
+ SearchViewModelBase.prototype._updatePivotCount = function(pivot, modules) {
+ var modulesCountable = modules.every(function(module) {
+ return module.moduleState === 2 || module.moduleState === 0
+ });
+ if (modulesCountable)
+ pivot.count = modules.map(function(module) {
+ return module.count
+ }).reduce(function(total, currentValue) {
+ return (total + currentValue)
+ });
+ else {
+ var isLoadCompleted = Entertainment.Utilities.ViewState.isStateCompleted(this.viewStateViewModel.viewState);
+ if (isLoadCompleted)
+ pivot.count = 0
+ }
+ };
+ SearchViewModelBase.prototype._updatePivotCounts = function() {
+ this._updatePivotCount(this._collectionHeaderPivot, this._collectionModules);
+ if (this.isMarketplaceEnabled)
+ this._updatePivotCount(this._catalogHeaderPivot, this._catalogModules)
+ };
+ SearchViewModelBase.CATALOG_PIVOT_ID = "catalog";
+ SearchViewModelBase.CATALOG_RESULT_COUNT_MAX_THRESHOLD = 1000;
+ SearchViewModelBase.COLLECTION_PIVOT_ID = "collection";
+ SearchViewModelBase.COLLECTION_RESULT_COUNT_MAX_THRESHOLD = 1000;
+ SearchViewModelBase.RESULTS_STRING_FORMAT = String.id.IDS_SEARCH_RESULT_TITLE_TC;
+ return SearchViewModelBase
+ })(ViewModels.PageViewModelBase);
+ ViewModels.SearchViewModelBase = SearchViewModelBase;
+ var SearchResultHeaderPivotItem = (function(_super) {
+ __extends(SearchResultHeaderPivotItem, _super);
+ function SearchResultHeaderPivotItem(labelWithoutCountStringId, labelWithCountStringId, labelWithMaxCountStringId, maxCount, id) {
+ _super.call(this);
+ this._selected = false;
+ this._labelWithoutCount = String.empty;
+ this._labelWithCount = String.empty;
+ this._labelWithMaxCount = String.empty;
+ this._maxCount = 0;
+ this._label = String.empty;
+ this._id = String.empty;
+ this._label = this._labelWithoutCount = String.load(labelWithoutCountStringId);
+ this._labelWithCount = String.load(labelWithCountStringId);
+ this._labelWithMaxCount = String.load(labelWithMaxCountStringId).format(maxCount);
+ this._maxCount = maxCount;
+ this._id = id
+ }
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "label", {
+ get: function() {
+ return this._label
+ }, set: function(value) {
+ this.updateAndNotify("label", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "selected", {
+ get: function() {
+ return this._selected
+ }, set: function(value) {
+ this.updateAndNotify("selected", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "id", {
+ get: function() {
+ return this._id
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchResultHeaderPivotItem.prototype, "count", {
+ set: function(value) {
+ MS.Entertainment.ViewModels.assert(value >= 0, "Negative count values are not valid in a search pivot.");
+ var decimalNumberFormatter = Entertainment.ServiceLocator.getService(Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var formattedCount = decimalNumberFormatter.format(value);
+ var label = this._labelWithoutCount;
+ if (value >= 0 && value < this._maxCount)
+ label = this._labelWithCount.format(formattedCount);
+ else if (value >= this._maxCount)
+ label = this._labelWithMaxCount;
+ this.label = label
+ }, enumerable: true, configurable: true
+ });
+ return SearchResultHeaderPivotItem
+ })(Entertainment.UI.Framework.ObservableBase);
+ ViewModels.SearchResultHeaderPivotItem = SearchResultHeaderPivotItem
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/searchgalleryviewmodelbase.js:454 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(SearchGalleryViewModelModuleKeys) {
+ SearchGalleryViewModelModuleKeys[SearchGalleryViewModelModuleKeys["collectionSearchModule"] = 0] = "collectionSearchModule";
+ SearchGalleryViewModelModuleKeys[SearchGalleryViewModelModuleKeys["catalogSearchModule"] = 1] = "catalogSearchModule"
+ })(ViewModels.SearchGalleryViewModelModuleKeys || (ViewModels.SearchGalleryViewModelModuleKeys = {}));
+ var SearchGalleryViewModelModuleKeys = ViewModels.SearchGalleryViewModelModuleKeys
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/searchmodule.js:472 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var SearchModule = (function(_super) {
+ __extends(SearchModule, _super);
+ function SearchModule(view, options) {
+ _super.call(this, view);
+ this._count = 0;
+ this._isExcludedFromPageState = false;
+ this._mediaContext = null;
+ this._searchText = null;
+ this._moduleState = -3;
+ Entertainment.Framework.ScriptUtilities.setOptions(this, options)
+ }
+ Object.defineProperty(SearchModule.prototype, "count", {
+ get: function() {
+ return this._count
+ }, set: function(value) {
+ this.updateAndNotify("count", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchModule.prototype, "isExcludedFromPageState", {
+ get: function() {
+ return this._isExcludedFromPageState
+ }, set: function(value) {
+ this.updateAndNotify("isExcludedFromPageState", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchModule.prototype, "mediaContext", {
+ get: function() {
+ return this._mediaContext
+ }, set: function(value) {
+ this.updateAndNotify("mediaContext", value);
+ if (this._mediaContext && this._mediaContext.containingMedia)
+ this.containingMedia = this._mediaContext.containingMedia
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchModule.prototype, "searchText", {
+ get: function() {
+ return this._searchText
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchModule.prototype, "moduleState", {
+ get: function() {
+ return this._moduleState
+ }, set: function(value) {
+ this.updateAndNotify("moduleState", value)
+ }, enumerable: true, configurable: true
+ });
+ SearchModule.prototype.cloneCurrentQuery = function() {
+ if (!this._lastUsedQuery || !this._lastUsedQuery.clone)
+ return null;
+ return this._lastUsedQuery.clone()
+ };
+ SearchModule.prototype.dispose = function() {
+ _super.prototype.dispose.call(this);
+ this._releaseResultsChangeHandler()
+ };
+ SearchModule.prototype.load = function() {
+ return this.refresh()
+ };
+ SearchModule.prototype.reload = function() {
+ return this.refresh()
+ };
+ SearchModule.prototype._listenForResultChanges = function() {
+ var _this = this;
+ this._releaseResultsChangeHandler();
+ this._resultsChangedBinding = Entertainment.Utilities.addEventHandlers(this.items, {countChanged: function(result) {
+ if (result && result.detail) {
+ var newCount = result.detail.newValue;
+ if (newCount === 0)
+ _this.moduleState = 0;
+ else
+ _this.moduleState = 2;
+ _this.count = newCount
+ }
+ }})
+ };
+ SearchModule.prototype._onBeginQuery = function(lastUsedQuery) {
+ ViewModels.assert(this.searchText || this.searchText === String.empty, "Expected search query terms to be defined before searching.");
+ lastUsedQuery.keyword = this.searchText;
+ lastUsedQuery.search = this.searchText;
+ this.moduleState = 1
+ };
+ SearchModule.prototype._onQueryCompleted = function(query, useItemsCount) {
+ _super.prototype._onQueryCompleted.call(this, query);
+ if (!query || !query.result)
+ this.moduleState = -1;
+ else {
+ var count = useItemsCount ? query.result.items && query.result.items.count : query.result.totalCount;
+ if (count <= 0) {
+ this.moduleState = 0;
+ this.count = 0
+ }
+ else {
+ this.moduleState = 2;
+ this.count = count
+ }
+ }
+ this._listenForResultChanges()
+ };
+ SearchModule.prototype._onQueryFailed = function(error) {
+ _super.prototype._onQueryFailed.call(this, error);
+ this.moduleState = -1
+ };
+ SearchModule.prototype._releaseResultsChangeHandler = function() {
+ if (this._resultsChangedBinding) {
+ this._resultsChangedBinding.cancel();
+ this._resultsChangedBinding = null
+ }
+ };
+ return SearchModule
+ })(ViewModels.QueryViewModel);
+ ViewModels.SearchModule = SearchModule
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/videosearchviewmodelbase.js:607 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var VideoSearchViewModelBase = (function(_super) {
+ __extends(VideoSearchViewModelBase, _super);
+ function VideoSearchViewModelBase(searchText, searchScope) {
+ _super.call(this, searchText, searchScope);
+ this._collectionSelectionManager = null;
+ this._catalogSelectionManager = null;
+ var featureEnablement = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.featureEnablement);
+ this._isMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ this.modules = [];
+ this._initializeModules();
+ this._initializePivots();
+ this._initializeModifiers()
+ }
+ Object.defineProperty(VideoSearchViewModelBase.prototype, "viewStateViewModel", {
+ get: function() {
+ if (!this._viewStateViewModel) {
+ var viewStateItems = new Array;
+ viewStateItems[-2] = new ViewModels.ViewStateItem(String.load(String.id.IDS_VIDEO_OFFLINE_HEADER), String.load(String.id.IDS_VIDEO_OFFLINE_DETAILS), []);
+ viewStateItems[-1] = new ViewModels.ViewStateItem(String.load(String.id.IDS_VIDEO_ERROR_HEADER), String.load(String.id.IDS_VIDEO_ERROR_DETAILS), []);
+ viewStateItems[0] = new ViewModels.ViewStateItem(String.load(String.id.IDS_VIDEO_LX_SEARCH_ALL_EMPTY_TITLE), String.load(String.id.IDS_VIDEO_LX_SEARCH_ALL_EMPTY_DESC), []);
+ this._viewStateViewModel = new ViewModels.ViewStateViewModel(viewStateItems)
+ }
+ return this._viewStateViewModel
+ }, enumerable: true, configurable: true
+ });
+ VideoSearchViewModelBase.prototype._initializePivots = function() {
+ var _this = this;
+ if (this.isMarketplaceEnabled) {
+ this._collectionHeaderPivot = new ViewModels.SearchResultHeaderPivotItem(String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_NO_COUNT, String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER, String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_MAX_RESULTS, 1000, "collection");
+ this._catalogHeaderPivot = new ViewModels.SearchResultHeaderPivotItem(String.id.IDS_VIDEO_LX_SEARCH_STORE_FILTER_NO_COUNT, String.id.IDS_VIDEO_LX_SEARCH_STORE_FILTER, String.id.IDS_VIDEO_LX_SEARCH_STORE_FILTER_MAX_RESULTS, 1000, "catalog");
+ this._pivotsSelectionManager = new Entertainment.UI.Framework.SelectionManager([this._collectionHeaderPivot, this._catalogHeaderPivot]);
+ this._pivotsSelectionManager.selectedItem = (this._searchScope === 0) ? this._collectionHeaderPivot : this._catalogHeaderPivot;
+ var selectionBinding = Entertainment.UI.Framework.addEventHandlers(this._pivotsSelectionManager, {selectedItemChanged: this._onPivotChanged.bind(this)});
+ this._addBinding(selectionBinding);
+ var countChangeBindings = this.modules.map(function(searchModule) {
+ return WinJS.Binding.bind(searchModule, {count: function() {
+ return _this._updatePivotCounts()
+ }})
+ });
+ this._addBindings(countChangeBindings)
+ }
+ };
+ VideoSearchViewModelBase.prototype._initializeModifiers = function() {
+ var _this = this;
+ var modifierSelectionChangedBindings = this.modules.map(function(searchModule) {
+ return WinJS.Binding.bind(searchModule, {modifierSelectionManager: function() {
+ return _this._updateModifierSelectionBindings()
+ }})
+ });
+ this._addBindings(modifierSelectionChangedBindings)
+ };
+ VideoSearchViewModelBase.prototype._updateModifierSelectionBindings = function() {
+ var collectionSearchModule = this.modules[0];
+ var catalogSearchModule = this.modules[1];
+ if (collectionSearchModule && collectionSearchModule.modifierSelectionManager && !this._collectionSelectionManager) {
+ this._collectionSelectionManager = collectionSearchModule.modifierSelectionManager;
+ this._collectionSelectionManager.selectedIndex = 0;
+ var collectionSelectionBinding = Entertainment.UI.Framework.addEventHandlers(this._collectionSelectionManager, {selectedItemChanged: this._onModifierChanged.bind(this)});
+ this._addBinding(collectionSelectionBinding)
+ }
+ if (catalogSearchModule && catalogSearchModule.modifierSelectionManager && !this._catalogSelectionManager) {
+ this._catalogSelectionManager = catalogSearchModule.modifierSelectionManager;
+ this._catalogSelectionManager.selectedIndex = 0;
+ var catalogSelectionBinding = Entertainment.UI.Framework.addEventHandlers(this._catalogSelectionManager, {selectedItemChanged: this._onModifierChanged.bind(this)});
+ this._addBinding(catalogSelectionBinding)
+ }
+ };
+ VideoSearchViewModelBase.prototype._updateSelectedModifier = function(updateCurrent) {
+ var currentKey = this.isCollectionScope ? 0 : 1;
+ var previousKey = currentKey === 0 ? 1 : 0;
+ var currentSelectionManager = this.modules[currentKey].modifierSelectionManager;
+ var previousSelectionManager = this.modules[previousKey].modifierSelectionManager;
+ if (updateCurrent)
+ currentSelectionManager.selectedIndex = previousSelectionManager.selectedIndex;
+ else
+ previousSelectionManager.selectedIndex = currentSelectionManager.selectedIndex
+ };
+ VideoSearchViewModelBase.prototype._onModifierChanged = function() {
+ this._updateSelectedModifier(false)
+ };
+ VideoSearchViewModelBase.prototype._refreshEmptyViewState = function() {
+ if (this.isMarketplaceEnabled)
+ if (this.modules.map(function(m) {
+ return m.moduleState
+ }).every(function(state) {
+ return state === 0
+ })) {
+ this.viewStateViewModel.viewState = -3;
+ this.viewStateViewModel.viewStateItems[0] = new ViewModels.ViewStateItem(String.load(String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE), String.load(String.id.IDS_VIDEO_LX_SEARCH_ALL_EMPTY_DESC), []);
+ this.viewStateViewModel.viewState = 0
+ }
+ else
+ this.viewStateViewModel.viewStateItems[0] = new ViewModels.ViewStateItem(String.load(this.isCollectionScope ? String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE : String.id.IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_TITLE), String.load(this.isCollectionScope ? String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_DESC : String.id.IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_DESC), []);
+ else
+ this.viewStateViewModel.viewStateItems[0] = new ViewModels.ViewStateItem(String.load(String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG), String.load(String.id.IDS_VIDEO_LX_SEARCH_ALL_EMPTY_DESC), [])
+ };
+ return VideoSearchViewModelBase
+ })(ViewModels.SearchViewModelBase);
+ ViewModels.VideoSearchViewModelBase = VideoSearchViewModelBase
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/videosearchmodule.js:729 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var VideoSearchCollectionTemplate = (function() {
+ function VideoSearchCollectionTemplate() {
+ this.itemTemplate = "select(.templateid-collectionMovieVerticalTile)";
+ this.tap = Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly;
+ this.layout = Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl.Layout.grid;
+ this.orientation = Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl.Orientation.vertical;
+ this.zoomedOutLayout = Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl.ZoomedOutLayout.list;
+ this.invokeHelperFactory = Entertainment.UI.Controls.GalleryControlInvocationHelper.create;
+ this.invokeBehavior = Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl.InvokeBehavior.action;
+ this.actionOptions = {id: Entertainment.UI.Actions.ActionIdentifiers.navigateToVideoDetails};
+ this.forceInteractive = true;
+ this.minimumListLength = 1;
+ this.maxRows = NaN;
+ this.grouped = false;
+ this.hideShadow = true;
+ this.allowZoom = false;
+ this.allowSelectAll = false;
+ this.delayHydrateLibraryId = false;
+ this.selectionStyleFilled = false;
+ this.itemsDraggable = false;
+ this.swipeBehavior = Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl.swipeBehavior.none;
+ this.selectionMode = Entertainment.UI.Controls.GalleryControl && Entertainment.UI.Controls.GalleryControl.SelectionMode.none
+ }
+ return VideoSearchCollectionTemplate
+ })();
+ ViewModels.VideoSearchCollectionTemplate = VideoSearchCollectionTemplate;
+ var VideoSearchCollectionMoviesTemplate = (function(_super) {
+ __extends(VideoSearchCollectionMoviesTemplate, _super);
+ function VideoSearchCollectionMoviesTemplate() {
+ _super.apply(this, arguments);
+ this.itemTemplate = "/Components/Video_Win/SearchResultsPage.html#collectionMovieVerticalTile";
+ this.listViewClassName = "gallery-movies"
+ }
+ return VideoSearchCollectionMoviesTemplate
+ })(VideoSearchCollectionTemplate);
+ ViewModels.VideoSearchCollectionMoviesTemplate = VideoSearchCollectionMoviesTemplate;
+ var VideoSearchCollectionTvTemplate = (function(_super) {
+ __extends(VideoSearchCollectionTvTemplate, _super);
+ function VideoSearchCollectionTvTemplate() {
+ _super.apply(this, arguments);
+ this.itemTemplate = "/Components/Video_Win/SearchResultsPage.html#collectionTvVerticalTile";
+ this.listViewClassName = "gallery-tv"
+ }
+ return VideoSearchCollectionTvTemplate
+ })(VideoSearchCollectionTemplate);
+ ViewModels.VideoSearchCollectionTvTemplate = VideoSearchCollectionTvTemplate;
+ var VideoSearchCollectionPersonalVideosTemplate = (function(_super) {
+ __extends(VideoSearchCollectionPersonalVideosTemplate, _super);
+ function VideoSearchCollectionPersonalVideosTemplate() {
+ _super.apply(this, arguments);
+ this.itemTemplate = "/Components/Video_Win/SearchResultsPage.html#collectionOtherVerticalTile";
+ this.actionOptions = {id: Entertainment.UI.Actions.ActionIdentifiers.personalVideoNavigate};
+ this.listViewClassName = "gallery-personal"
+ }
+ return VideoSearchCollectionPersonalVideosTemplate
+ })(VideoSearchCollectionTemplate);
+ ViewModels.VideoSearchCollectionPersonalVideosTemplate = VideoSearchCollectionPersonalVideosTemplate;
+ var VideoSearchCollectionTemplateSelector = (function(_super) {
+ __extends(VideoSearchCollectionTemplateSelector, _super);
+ function VideoSearchCollectionTemplateSelector(collectionView) {
+ _super.call(this);
+ this.addTemplate("collectionMovie", "/Components/Video_Win/SearchResultsPage.html#collectionMovieVerticalTile");
+ this.addTemplate("collectionTv", "/Components/Video_Win/SearchResultsPage.html#collectionTvVerticalTile");
+ this.addTemplate("collectionPersonalVideo", "/Components/Video_Win/SearchResultsPage.html#collectionOtherVerticalTile")
+ }
+ VideoSearchCollectionTemplateSelector.prototype.onSelectTemplate = function(item) {
+ var template = null;
+ if (item && item.data)
+ switch (item.data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ template = item.data.videoType && item.data.videoType === Microsoft.Entertainment.Queries.VideoType.movie ? "collectionMovie" : "collectionPersonalVideo";
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ template = "collectionTv";
+ break
+ }
+ this.ensureTemplatesLoaded([template]);
+ return _super.prototype.getTemplateProvider.call(this, template)
+ };
+ return VideoSearchCollectionTemplateSelector
+ })(Entertainment.UI.Controls.GalleryTemplateSelector);
+ ViewModels.VideoSearchCollectionTemplateSelector = VideoSearchCollectionTemplateSelector;
+ var VideoSearchCollectionAllTemplate = (function(_super) {
+ __extends(VideoSearchCollectionAllTemplate, _super);
+ function VideoSearchCollectionAllTemplate() {
+ _super.apply(this, arguments);
+ this.templateSelectorConstructor = VideoSearchCollectionTemplateSelector;
+ this.listViewClassName = "gallery-mixed"
+ }
+ return VideoSearchCollectionAllTemplate
+ })(VideoSearchCollectionTemplate);
+ ViewModels.VideoSearchCollectionAllTemplate = VideoSearchCollectionAllTemplate;
+ var VideoSearchCatalogTemplate = (function(_super) {
+ __extends(VideoSearchCatalogTemplate, _super);
+ function VideoSearchCatalogTemplate() {
+ _super.apply(this, arguments);
+ this.itemTemplate = "select(.templateid-movieVerticalTile)";
+ this.delayHydrateLibraryId = true
+ }
+ return VideoSearchCatalogTemplate
+ })(VideoSearchCollectionTemplate);
+ ViewModels.VideoSearchCatalogTemplate = VideoSearchCatalogTemplate;
+ var VideoSearchCatalogMoviesTemplate = (function(_super) {
+ __extends(VideoSearchCatalogMoviesTemplate, _super);
+ function VideoSearchCatalogMoviesTemplate() {
+ _super.apply(this, arguments);
+ this.itemTemplate = "/Components/Video_Win/SearchResultsPage.html#movieVerticalTile";
+ this.listViewClassName = "gallery-movies"
+ }
+ return VideoSearchCatalogMoviesTemplate
+ })(VideoSearchCatalogTemplate);
+ ViewModels.VideoSearchCatalogMoviesTemplate = VideoSearchCatalogMoviesTemplate;
+ var VideoSearchCatalogTvTemplate = (function(_super) {
+ __extends(VideoSearchCatalogTvTemplate, _super);
+ function VideoSearchCatalogTvTemplate() {
+ _super.apply(this, arguments);
+ this.itemTemplate = "/Components/Video_Win/SearchResultsPage.html#tvVerticalTile";
+ this.listViewClassName = "gallery-tv"
+ }
+ return VideoSearchCatalogTvTemplate
+ })(VideoSearchCatalogTemplate);
+ ViewModels.VideoSearchCatalogTvTemplate = VideoSearchCatalogTvTemplate;
+ var VideoSearchCatalogTemplateSelector = (function(_super) {
+ __extends(VideoSearchCatalogTemplateSelector, _super);
+ function VideoSearchCatalogTemplateSelector(collectionView) {
+ _super.call(this);
+ this.addTemplate("catalogMovie", "/Components/Video_Win/SearchResultsPage.html#movieVerticalTile");
+ this.addTemplate("catalogTv", "/Components/Video_Win/SearchResultsPage.html#tvVerticalTile")
+ }
+ VideoSearchCatalogTemplateSelector.prototype.onSelectTemplate = function(item) {
+ var template = null;
+ if (item && item.data)
+ switch (item.data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ template = "catalogMovie";
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ template = "catalogTv";
+ break;
+ default:
+ Trace.fail("Unknown media type passed to VideoSearchCatalogTemplateSelector.onSelectTemplate");
+ break
+ }
+ this.ensureTemplatesLoaded([template]);
+ return _super.prototype.getTemplateProvider.call(this, template)
+ };
+ return VideoSearchCatalogTemplateSelector
+ })(Entertainment.UI.Controls.GalleryTemplateSelector);
+ ViewModels.VideoSearchCatalogTemplateSelector = VideoSearchCatalogTemplateSelector;
+ var VideoSearchCatalogAllTemplate = (function(_super) {
+ __extends(VideoSearchCatalogAllTemplate, _super);
+ function VideoSearchCatalogAllTemplate() {
+ _super.apply(this, arguments);
+ this.templateSelectorConstructor = VideoSearchCatalogTemplateSelector;
+ this.listViewClassName = "gallery-mixed"
+ }
+ return VideoSearchCatalogAllTemplate
+ })(VideoSearchCatalogTemplate);
+ ViewModels.VideoSearchCatalogAllTemplate = VideoSearchCatalogAllTemplate;
+ var VideoSearchModule = (function(_super) {
+ __extends(VideoSearchModule, _super);
+ function VideoSearchModule(view, options) {
+ _super.call(this, view, options);
+ this.selectedTemplate = new VideoSearchCollectionTemplate
+ }
+ Object.defineProperty(VideoSearchModule.prototype, "enableDelayInitialize", {
+ get: function() {
+ return true
+ }, enumerable: true, configurable: true
+ });
+ VideoSearchModule.prototype.createSelectionHandlers = function() {
+ return []
+ };
+ VideoSearchModule.prototype.delayInitialize = function() {
+ _super.prototype.delayInitialize.call(this);
+ this._raiseDelayLoadedEvent()
+ };
+ VideoSearchModule.prototype.refreshItems = function(){};
+ VideoSearchModule.prototype._onQueryCompleted = function(query) {
+ _super.prototype._onQueryCompleted.call(this, query, true)
+ };
+ VideoSearchModule.prototype.getViewDefinition = function(view) {
+ return VideoSearchModule.Views[view]
+ };
+ VideoSearchModule.prototype.getModifierDefinition = function(view) {
+ this._modifiers = this._modifiers || this._createModifiers();
+ return this._modifiers[view]
+ };
+ VideoSearchModule.prototype._createModifiers = function() {
+ return new VideoSearchModuleModifiers.Modifiers
+ };
+ VideoSearchModule.ViewTypes = {
+ searchCollection: "searchCollection", searchCatalog: "searchCatalog"
+ };
+ VideoSearchModule.Views = {
+ searchCollection: ViewModels.NodeValues.create({
+ queryOptions: {
+ chunkSize: 25, aggregateChunks: false
+ }, modifierOptions: {settingsKey: "search-collection-modifier-selection"}
+ }), searchCatalog: ViewModels.NodeValues.create({
+ queryOptions: {
+ chunkSize: 25, aggregateChunks: false
+ }, modifierOptions: {settingsKey: "search-catalog-modifier-selection"}
+ })
+ };
+ return VideoSearchModule
+ })(ViewModels.SearchModule);
+ ViewModels.VideoSearchModule = VideoSearchModule;
+ (function(VideoSearchModuleModifiers) {
+ var Modifiers = (function() {
+ function Modifiers(){}
+ Object.defineProperty(Modifiers.prototype, "searchCollection", {
+ get: function() {
+ this._collection = this._collection || new VideoSearchModuleModifiers.Collection;
+ return this._collection
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Modifiers.prototype, "searchCatalog", {
+ get: function() {
+ this._catalog = this._catalog || new VideoSearchModuleModifiers.Catalog;
+ return this._catalog
+ }, enumerable: true, configurable: true
+ });
+ return Modifiers
+ })();
+ VideoSearchModuleModifiers.Modifiers = Modifiers;
+ var Collection = (function() {
+ function Collection(){}
+ Collection.prototype.itemFactory = function() {
+ return [new MS.Entertainment.ViewModels.Node(Entertainment.UI.AutomationIds.videoSearchFilterAll, String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_ALL, new MS.Entertainment.ViewModels.NodeValues(Entertainment.Data.Query.libraryMovieTVSeriesOther, {}, {selectedTemplate: new VideoSearchCollectionAllTemplate})), new MS.Entertainment.ViewModels.Node(Entertainment.UI.AutomationIds.videoSearchFilterMovies, String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_MOVIES, new MS.Entertainment.ViewModels.NodeValues(Entertainment.Data.Query.libraryVideoMovies, {}, {selectedTemplate: new VideoSearchCollectionMoviesTemplate})), new MS.Entertainment.ViewModels.Node(Entertainment.UI.AutomationIds.videoSearchFilterTv, String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_TV, new MS.Entertainment.ViewModels.NodeValues(Entertainment.Data.Query.libraryTVSeries, {}, {selectedTemplate: new VideoSearchCollectionTvTemplate}))]
+ };
+ return Collection
+ })();
+ VideoSearchModuleModifiers.Collection = Collection;
+ var Catalog = (function() {
+ function Catalog(){}
+ Catalog.prototype.itemFactory = function() {
+ return [new MS.Entertainment.ViewModels.Node(Entertainment.UI.AutomationIds.videoSearchFilterAll, String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_ALL, new MS.Entertainment.ViewModels.NodeValues(Entertainment.Data.Query.Video.EdsCrossVideoSearch, {}, {selectedTemplate: new VideoSearchCatalogAllTemplate})), new MS.Entertainment.ViewModels.Node(Entertainment.UI.AutomationIds.videoSearchFilterMovies, String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_MOVIES, new MS.Entertainment.ViewModels.NodeValues(Entertainment.Data.Query.Video.EdsSearchMovies, {}, {selectedTemplate: new VideoSearchCatalogMoviesTemplate})), new MS.Entertainment.ViewModels.Node(Entertainment.UI.AutomationIds.videoSearchFilterTv, String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_TV, new MS.Entertainment.ViewModels.NodeValues(Entertainment.Data.Query.Video.EdsSearchTVSeries, {}, {selectedTemplate: new VideoSearchCatalogTvTemplate}))]
+ };
+ return Catalog
+ })();
+ VideoSearchModuleModifiers.Catalog = Catalog
+ })(ViewModels.VideoSearchModuleModifiers || (ViewModels.VideoSearchModuleModifiers = {}));
+ var VideoSearchModuleModifiers = ViewModels.VideoSearchModuleModifiers
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/videosearchgalleryviewmodelbase.js:996 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var VideoSearchGalleryViewModelBase = (function(_super) {
+ __extends(VideoSearchGalleryViewModelBase, _super);
+ function VideoSearchGalleryViewModelBase(searchText, searchScope) {
+ _super.call(this, searchText, searchScope)
+ }
+ Object.defineProperty(VideoSearchGalleryViewModelBase.prototype, "searchResults", {
+ get: function() {
+ var key = this.isCollectionScope ? 0 : 1;
+ return this.modules[key]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoSearchGalleryViewModelBase.prototype, "searchModifierSelectionManager", {
+ get: function() {
+ this._updateSelectedModifier(true);
+ var key = this.isCollectionScope ? 0 : 1;
+ return this.modules[key].modifierSelectionManager
+ }, enumerable: true, configurable: true
+ });
+ VideoSearchGalleryViewModelBase.prototype._onPivotChanged = function() {
+ var _this = this;
+ _super.prototype._onPivotChanged.call(this);
+ this.dispatchChangeAndNotify("searchResults", this.searchResults, this.searchResults);
+ this.dispatchChangeAndNotify("searchModifierSelectionManager", this.searchModifierSelectionManager, this.searchModifierSelectionManager);
+ var waitForBindings = WinJS.Binding.bind(this, {searchResults: function() {
+ if (waitForBindings) {
+ waitForBindings.cancel();
+ _this.refreshViewState()
+ }
+ }})
+ };
+ VideoSearchGalleryViewModelBase.prototype._initializeModules = function() {
+ var options = {searchText: this.searchText};
+ this._addCollectionModule(new ViewModels.VideoSearchModule(ViewModels.VideoSearchModule.ViewTypes.searchCollection, options));
+ if (this.isMarketplaceEnabled)
+ this._addCatalogModule(new ViewModels.VideoSearchModule(ViewModels.VideoSearchModule.ViewTypes.searchCatalog, options));
+ _super.prototype._initializeModules.call(this)
+ };
+ return VideoSearchGalleryViewModelBase
+ })(ViewModels.VideoSearchViewModelBase);
+ ViewModels.VideoSearchGalleryViewModelBase = VideoSearchGalleryViewModelBase
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
diff --git a/packages/microsoft.zunevideo/Styles/Animations.css b/packages/microsoft.zunevideo/Styles/Animations.css
new file mode 100644
index 00000000..05c113f1
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/Animations.css
@@ -0,0 +1,218 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.tranFadeVeryShort
+{
+ transition-property: opacity;
+ transition-duration: .25s
+}
+.tranFadeShort
+{
+ transition-property: opacity;
+ transition-duration: .5s
+}
+.tranFadeLong
+{
+ transition-property: opacity;
+ transition-duration: 2s
+}
+.tranHeight
+{
+ transition-property: height;
+ transition-duration: .33s
+}
+.tranMargins
+{
+ transition-property: margin;
+ transition-duration: .33s
+}
+.tranMarginBottom
+{
+ transition-property: margin-bottom;
+ transition-duration: .33s
+}
+.tranMarginTop
+{
+ transition-property: margin-top;
+ transition-duration: .33s
+}
+.tranTop
+{
+ transition-property: top;
+ transition-duration: .33s
+}
+.tranImmersiveDetails
+{
+ transition-property: transform;
+ transition-duration: .33s
+}
+.tranSeekBarControl
+{
+ transition-property: margin-bottom,opacity;
+ transition-duration: .33s,.5s
+}
+.tranActionlistToggle
+{
+ transition-property: width;
+ transition-duration: .33s
+}
+.tranXboxArrowRotate
+{
+ transition-property: transform;
+ transition-duration: .66s
+}
+.tranSnappedPlaylistIndent
+{
+ transition-property: transform;
+ transition-duration: .5s
+}
+@keyframes rotate360
+{
+ from
+ {
+ transform: rotate(0)
+ }
+ to
+ {
+ transform: rotate(360deg)
+ }
+}
+.avatarSelectionRefreshAnimation, .spinNoticationRetrySpinner, .rotate360Animation, .xboxConnectingAnimation
+{
+ animation-name: rotate360;
+ animation-duration: 1s;
+ animation-iteration-count: infinite;
+ animation-timing-function: cubic-bezier(0,0,1,1)
+}
+.snappedNPAnimation
+{
+ transition-property: transform opacity;
+ transition-duration: .66s
+}
+.tranBackgroundColor
+{
+ transition-property: background-color;
+ transition-duration: .5s
+}
+.tranBackgroundColorInstant
+{
+ transition-property: background-color;
+ transition-duration: 0
+}
+.tranMusicImages
+{
+ transition-property: opacity;
+ transition-duration: 7s
+}
+@keyframes _showOverlayContainer {
+ from
+ {
+ opacity: 0
+ }
+ to
+ {
+ opacity: 1
+ }
+}
+@keyframes _hideOverlayContainer {
+ from
+ {
+ opacity: 1
+ }
+ to
+ {
+ opacity: 0
+ }
+}
+@keyframes _showOverlayBackground {
+ from
+ {
+ opacity: 0
+ }
+ to
+ {
+ opacity: 1
+ }
+}
+@keyframes _hideOverlayBackground {
+ from
+ {
+ opacity: 1
+ }
+ to
+ {
+ opacity: 0
+ }
+}
+.tranXboxTouchPadBottomRowOffset
+{
+ transition-duration: .33s;
+ transition-property: transform
+}
+.animShowOverlayContainer
+{
+ animation-name: _showOverlayContainer;
+ animation-duration: .1s;
+ animation-timing-function: ease-in
+}
+.animHideOverlayContainer
+{
+ animation-name: _hideOverlayContainer;
+ animation-duration: .1s;
+ animation-timing-function: ease-out
+}
+.animShowOverlayBackground
+{
+ animation-name: _showOverlayBackground;
+ animation-duration: 667ms;
+ animation-timing-function: cubic-bezier(.21,1,.19,.98)
+}
+.animHideOverlayBackground
+{
+ animation-name: _hideOverlayBackground;
+ animation-duration: 167ms;
+ animation-timing-function: cubic-bezier(0,0,1,1)
+}
+.animShowProgress
+{
+ animation-name: _showOverlayContainer;
+ animation-duration: 5s;
+ animation-timing-function: ease-in;
+ animation-iteration-count: 3;
+ animation-direction: alternate
+}
+.scrollAnimation
+{
+ transition-duration: 250ms;
+ transition-property: transform;
+ transition-timing-function: cubic-bezier(.24,1,0,.99)
+}
+.immersiveDetails .scrollAnimation
+{
+ transition-duration: 300ms;
+ transition-timing-function: ease
+}
+.pivotDashboard .scrollAnimation
+{
+ transition-duration: 500ms
+}
+.immersivePivots.scrollAnimation
+{
+ transition-property: opacity,transform
+}
+.immersivePivots
+{
+ transition-duration: 250ms;
+ transition-property: opacity;
+ transition-timing-function: cubic-bezier(.24,1,0,.99)
+}
+.companionFullBleedNowPlayingTile, .companionQuickplay .cardThumbnailButton, .dashboardPanel .cardThumbnailButton, .dashboardPanel .homeNowPlayingTile, .dashboardPanel .homeNowPlayingTilePoster, .dashboardGridItemContent .thumbnailButton, .games .achievementsGallery .achievementThumbnail.cardThumbnailButton, .games .achievementPageContainer .achievementGameDetailsThumbnail .imageContainer, .bigFindFriendButton, .pickProviderItemContainer, .relatedHeroItem, .related.albums .relatedListView .control-immersiveListViewItem, .related.activities .relatedListView .control-immersiveListViewItem, .related.games .relatedListView .control-immersiveListViewItem, .related.movies .relatedListView .control-immersiveListViewItem, .related.seasons .relatedListView .control-immersiveListViewItem, .games .engagePanel .actionTile button, .immersiveDetails .relatedListView .horizontalListItem .win-focusable, .template-relatedGridButtonContainer .template-fullBleedThumbnail, .ui-interactive
+{
+ transition-property: transform;
+ transition-duration: 100ms;
+ animation-timing-function: ease-out
+}
+.flipViewTransitionAnimation
+{
+ transition-duration: 300ms;
+ transition-property: transform;
+ transition-timing-function: cubic-bezier(.24,1,.6,.99)
+}
diff --git a/packages/microsoft.zunevideo/Styles/App.css b/packages/microsoft.zunevideo/Styles/App.css
new file mode 100644
index 00000000..ce2a3a80
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/App.css
@@ -0,0 +1,2 @@
+/*! Copyright (C) Microsoft Corporation. All rights reserved. */
+button.win-command.appBarIconButton.hideAdorner:hover:active .win-commandimage.iconSpanPressed{opacity:1;color:#fff}button.win-command.appBarIconButton.hideAdorner:hover:active .win-commandimage.iconSpan{opacity:0}button.win-command.appBarIconButton.hideAdorner:hover:active .win-commandring{background-color:transparent}.wecDialog .dialogContainer .dialogFooter .dialogButtons .dialogButton:disabled,.wecDialog .dialogContainer .dialogFooter .dialogButtons .dialogButton:disabled:hover,.wecDialog .dialogContainer .dialogFooter .dialogButtons .dialogButton:disabled:active{opacity:.4;color:#222;border-color:#646464;background-color:#646464}.wecDialog .dialogContainer .dialogFooter .dialogFooterText{color:#898989;position:absolute;bottom:45px;padding:2px}.template-accountProvisioningDialog .accountProvisioning-progressContainer{display:-ms-grid;-ms-grid-columns:1fr auto 1fr}.accountProvisioning-progress{-ms-grid-column:2}.manageFolders .dialogCaption{-ms-grid-column:2;-ms-grid-row:1}.manageFolders .dialogContent{-ms-grid-column:2;-ms-grid-row:2;overflow:hidden}.manageFolders .dialogContent .template-manageFolders .manageFolders-content{overflow:hidden}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-description{color:#222;margin-bottom:16px}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items{padding:1px 17px 4px 1px;max-height:54vh;overflow:auto;display:-ms-flexbox;-ms-flex-direction:row;-ms-flex-wrap:wrap}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template{-ms-flex:0 0 325px;min-width:50%}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem{position:relative;height:70px;display:-ms-grid;-ms-grid-columns:10px 1fr 10px auto 15px;-ms-grid-rows:10px 1fr 10px;margin:0 10px 10px 0;color:#ebebeb;background-color:#107c10}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem:focus,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem:focus{border:0 solid;outline-style:none}.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem.acc-keyboardFocusTarget:focus,.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem.acc-keyboardFocusTarget:focus:after,.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;left:3px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem.acc-keyboardFocusTarget:focus:after,.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem.acc-keyboardFocusTarget:focus.selected:after,.showKeyboardFocus .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}@media(-ms-high-contrast){.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem{border:1px solid WindowText}}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem:hover,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem:hover{background-color:#299c10}@media(-ms-high-contrast){.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem:hover,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem:hover{color:HighlightText;background-color:Highlight}}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem:active,.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem:active{background-color:#5dc21e}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem .addFolderItem-iconContainer{-ms-grid-column-span:5;-ms-grid-column-align:center;-ms-grid-row-span:3;-ms-grid-row-align:center;width:33px;height:33px;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;border:3px solid #ebebeb;border-radius:50%}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem .addFolderItem-iconContainer .addFolderItem-icon{-ms-grid-column-align:center;-ms-grid-row-align:center;padding:0 0 1px 1px}html[dir=rtl] .manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-addFolderItem .addFolderItem-iconContainer .addFolderItem-icon{padding:0 1px 1px 0}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem .removeFolderItem-textContainer{-ms-grid-column:2;-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:auto auto}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem .removeFolderItem-textContainer .removeFolderItem-path{-ms-grid-row:2}.manageFolders .dialogContent .template-manageFolders .manageFolders-content .manageFolders-items .win-template .template-removeFolderItem .removeFolderItem-icon{-ms-grid-column:4;-ms-grid-row:2}.manageFolders .dialogFooter{-ms-grid-column:2;-ms-grid-row:3}.manageFolders .dialogFooter .dialogButtons{-ms-grid-column:2}.template-acceptTOSDialog>div{margin-top:5px;margin-bottom:5px}.template-acceptTOSDialog .acceptTOSDialog-termsIFrame{width:100%;height:31vh}.template-acceptTOSDialog label{display:-ms-flexbox;-ms-flex-align:center}.win-appbarclickeater,.win-flyoutmenuclickeater{opacity:.01;outline:none}@font-face{font-family:"Segoe Xbox MVR Symbol";src:url('/fonts/segxmvr.woff') format('woff');font-weight:300;font-style:normal}@font-face{font-family:"Segoe Xbox Symbol";src:url('/fonts/segxsym.woff') format('woff');font-weight:300;font-style:normal}body,input,button,option,select,textarea,.win-textarea,.win-type-xx-large,.win-type-x-large,.win-type-large,.win-type-medium,.win-type-small,.win-type-x-small,.win-type-xx-small{font-feature-settings:"kern" 1,"dlig" 1,"ss20" 1}.text-fixedWidthNumerals{font-feature-settings:"kern" 1,"dlig" 1,"tnum" 1}.text-xxSmall,.text-subTitle,.text-metadata,.collectionFilterLink .text-panelHeader,.collectionMusicModifier .text-filterDescription,.immersiveOneColumn .textContainer p,.popOver .inPlaceDetailsItemActions .win-label.label,.actions .win-label.label.subtitle,.immersiveOneColumn .win-label.label.subtitle,.failedPanelDetails .win-label.label.subtitle,.failedPanelNotifications .win-label.label.subtitle,.inPlaceDetailsItemActions .iconButton .win-label.label,.noContentPaneDetails .win-label.label.subtitle,#htmlSnapped .metaDataContainer p,.snapped .metaDataContainer p,#htmlSnapped .appBarIconLabel.win-label.label,.snapped .appBarIconLabel.win-label.label,.control-starRating .part-totalRatings,.control-starRating .part-userRatedIndicator,.control-rottenTomatoesOverview .rottenTomatoesOverview-subtitle,.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-subtitle,.games .engagePanel .actionTile button.iconButton.win-command .win-label.subtitle,.cloudNotification button .textContainer .win-label.label.subtitle,.verticalListItem .win-semanticzoom-button::before{font-size:9pt;letter-spacing:.04em}.maxLines-two-xxSmall{max-height:24.75pt}.maxLines-three-xxSmall{max-height:38.25pt}.maxLines-four-xxSmall{max-height:65.25pt}.text-xSmall,.text-bodyContent,.text-preferencesGroupHeader,.text-notificationTitle,.verticalSubPivotItem .text-filterItem,.actionListFlyout .text-panelHeader,.musicSubscriptionLink .text-panelHeader,.relatedActionContainer .text-panelHeader,#htmlSnapped .opportunityTitle,.snapped .opportunityTitle,.popOver .win-label.label,.actions .win-label.label,.actionCell .win-label.label,.immersiveOneColumn .win-label.label,.immersiveViewMoreOneColumn .win-label.label,.immersiveHeroActions .win-label.label,#htmlSnapped .win-label.label,.snapped .win-label.label,.videoPostRoll-button button.win-command,.failedPanelNotifications .win-label.label,.cloudNotification .clearIcon button .win-commandimage.iconSpan,.cloudNotification .clearIcon button .win-commandimage.iconSpanPressed,.cloudNotification .clearIcon button.iconButton .win-commandimage.modifier,.control-rottenTomatoesOverview .rottenTomatoesOverview-title,.control-rottenTomatoesOverview .rottenTomatoesOverview-tomatometer,.musicBrandActionLink button.link.acc-keyboardFocusTarget.internalActionLink div.actionLinkLabel.label.text-panelHeader{font-size:11pt;letter-spacing:.04em}.maxLines-two-xSmall{max-height:24.75pt}.maxLines-three-xSmall{max-height:38.25pt}.maxLines-four-xSmall{max-height:65.25pt}.text-small,.text-listItem,.text-cardTitle,.text-listTitle,.text-filterItem,.text-zoomedOutTitle,.text-filterTitle,.text-filterDescription,.opportunityTitle,.text-hubSubTitle,.text-modifierPopupEntry,.dashboardHost .opportunitySubTitle,.companionSearchPanel input[type="search"],.text-immersiveHeroSubTitle,#htmlSnapped .text-immersiveHeroSubTitle,.snapped .text-immersiveHeroSubTitle,.dashboardHost .text-immersiveHeroSubTitle,.actionTile .win-label.label,.failedPanelDetails .win-label.label,.noContentPaneDetails .win-label.label,.snapped .bottomAppBar .appBarIconButton .win-commandimage.iconSpan,.video .headingRow .text-panelHeader,.win-groupheader .groupHeaderOfflineAchievement,.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-title,.selectArtistButton button.iconButton .win-commandring.win-commandicon .win-commandimage,.findAlbumInfo .albumListItem .primaryText{font-size:14pt;letter-spacing:.03em}.maxLines-two-small{max-height:32.25pt}.maxLines-three-small{max-height:48.75pt}.maxLines-four-small{max-height:65.25pt}.text-medium,.text-panelHeader,.text-popoverTitle,.userEngagementMessageTitle,.dashboardHost .text-immersiveHeroTitle,.companionNowPlayingPanel .homeNowPlayingMetadataTitle,.extendedSplashScreenTitle,#htmlSnapped .text-immersiveHeroTitle,.snapped .text-immersiveHeroTitle,.wecDialog_cloud .dialogCaption,.findAlbumInfo .dialogCaption{font-size:20pt;letter-spacing:.03em}html:-ms-lang(en) .offlineDialog .dialogCaption,html:-ms-lang(en) .viewStateControl-notifications .errorContainer-title{font-feature-settings:"kern" 1,"dlig" 0,"ss20" 1}.maxLines-two-medium{max-height:56pt}.maxLines-three-medium{max-height:76pt}.maxLines-four-medium{max-height:106pt}.text-large,.text-hubTitle,.control-rottenTomatoesOverview .rottenTomatoesOverview-percentScore,.games .dashboardHubContent .failedPanelTitle{font-size:24pt;letter-spacing:.02em}.text-xLarge,.text-immersiveHeroTitle,#htmlSnapped .text-appTitle,.snapped .text-appTitle,#htmlSnapped .opportunitySubTitle,.snapped .opportunitySubTitle{font-size:30pt;letter-spacing:.01em}.text-xxLarge,.text-appTitle,.previewBrowseTitle,.opportunitySubTitle,.dashboardHost .opportunityTitle{font-size:42pt;letter-spacing:.01em}.text-popOverEditTitleLabel,.control-textInputOverlay input[type="text"],.control-textInputOverlay .editBox .editError,.selectArtistEditBox input[type="text"]{font-size:26pt;letter-spacing:.01em}html:-ms-lang(en) .text-popOverEditTitleLabel,html:-ms-lang(en) .control-textInputOverlay input[type="text"],html:-ms-lang(en) .control-textInputOverlay .editBox .editError,html:-ms-lang(en) .selectArtistEditBox input[type="text"]{font-size:40pt;letter-spacing:.01em}.text-weightLight,.text-appTitle,.text-hubTitle,.text-immersiveHeroTitle,.opportunitySubTitle,.dashboardHost .opportunityTitle,.text-popOverEditTitleLabel,.previewBrowse .navArrow,.selectArtistEditBox input[type="text"]{font-weight:200}.text-weightNormal,.text-cardTitle,.text-filterItem,.dashboardHost .opportunitySubTitle,#htmlSnapped .opportunitySubTitle,.snapped .opportunitySubTitle,.games .achievements .secondaryUserProgressContainer .text-panelHeader,.inPlaceDetailsItemActions .iconButton .win-label.label,.cloudNotification button .textContainer .win-label.label,.cloudNotification .clearIcon button .win-commandimage.iconSpan,.cloudNotification .clearIcon button .win-commandimage.iconSpanPressed,.cloudNotification .clearIcon button.iconButton .win-commandimage.modifier,.template-episodeContent .navArrow,.previewBrowse .navArrow{font-weight:300}.text-weightBold,.text-panelHeader,.text-bodyContent,.text-popoverTitle,.text-notificationTitle,.webLinkContainer,.dashboardHost .text-immersiveHeroTitle,#htmlSnapped .opportunityTitle,.snapped .opportunityTitle,.actionTile .win-label.label,.avatarSelectionButton .win-label.label,.downloadDetailsVideo .text-metadata,.downloadDetailsVideo .inPlaceDetailsItemActions .win-label.label,.musicBrandActionLink button.link.acc-keyboardFocusTarget.internalActionLink div.actionLinkLabel.label.text-panelHeader{font-weight:400}.text-weightHeavy,.text-subTitle,.text-metadata,.text-listTitle,.text-filterTitle,.text-filterDescription,.text-preferencesGroupHeader,.text-filterItem.selected,.text-listItem.inlineDetailsPrimaryBold,.text-modifierDropDownArrow,.userEngagementMessageTitle,.actionListFlyout .text-panelHeader,.musicSubscriptionLink .text-panelHeader,.relatedActionContainer .text-panelHeader,.collectionFilterLink .text-panelHeader,.popOver .win-label.label,.actions .win-label.label,.actionCell .win-label.label,.noPlaylists .win-label.label,.adIconButton .win-label.label,.immersiveOneColumn .win-label.label,.immersiveViewMoreOneColumn .win-label.label,.immersiveHeroActions .win-label.label,.popOver .inPlaceDetailsItemActions .win-label.label,.avatarEditorGalleryPanelButtonsContainer .win-label.label,.findFriendFlyout .win-label.label,.failedPanelDetails .win-label.label.subtitle,.noContentPaneDetails .win-label.label.subtitle,.control-rottenTomatoesOverview .rottenTomatoesOverview-title,.control-rottenTomatoesOverview .rottenTomatoesOverview-tomatometer,.control-rottenTomatoesOverview .rottenTomatoesOverview-subtitle,.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-subtitle,.control-castAndCrewList .castAndCrewList-contributorList .contributorList-title,.immersiveOneColumn .textContainer p,#htmlSnapped .metaDataContainer p,.snapped .metaDataContainer p,.video .headingRow .text-panelHeader,.cloudNotification button .textContainer .win-label.label.subtitle{font-weight:600}.control-rottenTomatoesOverview .rottenTomatoesOverview-percentScore{font-weight:800}.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.maxLines-two,.maxLines-three,.maxLines-four{overflow:hidden;word-wrap:normal;white-space:normal}.text-breakWord{white-space:normal;word-wrap:break-word;word-break:keep-all;overflow:hidden}.cardThumbnailButton .primaryText{line-height:16.265pt}.text-popoverTitle,#htmlSnapped .opportunitySubTitle,.snapped .opportunitySubTitle,.games .relatedHeroItem .text-medium{line-height:1.26}.progressTextPercentage{line-height:1}.icon,.icon-xxxSmall,.icon-xxSmall,.icon-xSmall,.icon-small,.icon-medium,.icon-large,.icon-xLarge,.icon-xxLarge,.win-commandimage,.inlineGlyph,.inlineGlyphSmall,.infoNotificationIcon,.searchBoxIcon,.smartDJIcon,.xboxIcon,.smartGlassGem,.dashboardGridItemContent.thumbnailButtonGlyph .imageHolder,.win-backbutton.homeIcon:before,.musicBrandActionLink button .actionLinkLabel:after,.cloudGrovelInfoContent .cloudGrovelInfoLink:after{font-family:'Segoe Xbox MVR Symbol','Segoe Xbox Symbol','Segoe UI Symbol'!important;font-weight:400!important}.icon-xxxSmall,.dashboardMyMusic .smartDJIcon,.music .snapped .immersivePlaylist .smartDJIcon,.immersiveViewMorePopOverContentLayout .nowPlayingPlaylistGalleryHeader .smartDJIcon,.collectionMusicGalleryView .verticalSmartDJThumbnail .smartDJIcon{font-size:7pt}.icon-xxSmall,.icon.inCollectionIcon,.musicPage .verticalListCell2nd .icon{font-size:9pt}.icon-xSmall,.smartDJIcon,.modifierDropDownArrow,.popOver .iconButton .win-commandimage,.immersiveHeroActions .win-commandimage,.immersiveOneColumn .win-commandimage,.immersiveViewMoreOneColumn .win-commandimage,.immersiveTwoColumn:not(.immersiveHeroFrameColumn) .smartDj .win-commandimage,.immersiveViewMoreTwoColumn:not(.immersiveHeroFrameColumn) .smartDj .win-commandimage,.actionCell .win-commandimage,.noPlaylists .win-commandimage,.avatarEditorGalleryPanelButtonsContainer .win-commandimage,.companionSearchPanel .win-commandimage,.inPlaceDetailsItemActions .win-commandimage,.avatarSelectionButton .win-commandimage{font-size:10.75pt}.icon-small,.infoNotificationIcon,.videoAdOverlay .playPauseIconButton .win-commandimage,.videoAdOverlay .videoAdCloseButton .win-commandimage,.homeNowPlayingPlayButton .win-commandimage,.nowPlayingTransportControlsContainer .win-commandimage,.opportunityIconButton .win-commandimage,#htmlSnapped .win-commandimage,.snapped .win-commandimage,.hideNowPlayingButton .win-commandimage,.findFriendFlyout .win-commandimage{font-size:13.5pt}.icon-medium,.searchBoxIcon,.selectArtistButton .win-commandimage,.volumeIcon .win-commandimage{font-size:20pt}.icon-large,.videoAdOverlay .win-commandimage,.actionTile .win-commandimage{font-size:24pt}.icon-xLarge,.videoAdOverlay .win-commandimage,.appBarUpsellAction .win-commandimage,.games .engagePanel .actionTile .win-commandimage{font-size:34pt}.icon-xxLarge,.companion .dashboardGridItemContent{font-size:37.5pt}.icon-xxxLarge,.games .nowPlayingTransportControlsContainer .win-commandimage,.video .nowPlayingTransportControlsContainer .win-commandimage,.companion .nowPlayingTransportControlsContainer .win-commandimage{font-size:50pt}.previewBrowse .navArrow{font-size:85pt}.marketplaceTracks .mediaStatusIconContainer{line-height:11px}.music .snapped .smartDJIcon{line-height:19px}.popOver button.win-command.inlineTrackListStatusIcon,.popOver .inlineDetailsMoveTrackUpButton .iconButton .win-commandimage,.popOver .inlineDetailsMoveTrackDownButton .iconButton .win-commandimage{line-height:20px}.music .snapped .immersivePlaylist .smartDJIcon{line-height:25px}.homeNowPlayingPlayButton .win-commandimage,.popOver .iconButton .win-commandimage,.immersiveHeroActions .win-commandimage,.immersiveOneColumn .win-commandimage,.immersiveViewMoreOneColumn .win-commandimage,.immersiveTwoColumn:not(.immersiveHeroFrameColumn) .smartDj .win-commandimage,.immersiveViewMoreTwoColumn:not(.immersiveHeroFrameColumn) .smartDj .win-commandimage,.actionCell .win-commandimage,.noPlaylists .win-commandimage,.videoAdOverlay .videoAdCloseButton .win-commandimage,#htmlSnapped .win-commandimage,.snapped .win-commandimage,.video .nowPlayingTransportControlsContainer .win-commandimage,.inPlaceDetailsItemActions .win-commandimage,.findAlbumInfoBackButton .win-commandimage,.localGrovelInfoBackButton .win-commandimage,.cloudGrovelInfoBackButton .win-commandimage,.musicPage .verticalListItem .clearIcon .win-commandimage,.musicPage .verticalListItem .clearIcon .iconSpan{line-height:30px}.opportunityIconButton .win-commandimage,.videoAdOverlay .win-commandimage,.nowPlayingTransportControlsContainer .win-commandimage,.hideNowPlayingButton .win-commandimage,.volumeIcon .win-commandimage,#htmlSnapped .opportunityIconButton button.win-command.iconButton .win-commandimage,.snapped .opportunityIconButton button.win-command.iconButton .win-commandimage{line-height:40px}.activityOverlaySplashBranding .xboxIcon{line-height:55px}.video .homeNowPlayingTilePoster .nowPlayingTransportControlsPlayPauseButton .win-commandimage{line-height:60px}.actionTile .win-commandimage,.selectArtistButton .win-commandimage{line-height:66px}.inlineGlyph,.inlineGlyphSmall,.infoNotificationIcon,.searchBoxIcon{display:inline-block}.glyph,.inlineGlyph{font-size:12pt;font-weight:400;line-height:30px;text-align:center}.popOver.tv .rightColumn .glyph,.popOver.tv .rightColumn .inlineGlyph{font-size:11pt;font-weight:400;line-height:1.3636;text-align:center}.inlineGlyphSmall{font-size:10pt;font-weight:400;line-height:16px;letter-spacing:normal;text-align:center}.achievementGameDetailsMetaDataText{line-height:16px}.achievementThumbnail .quaternaryText,.achievementThumbnail .quaternaryText .inlineGlyphSmall{line-height:1.3636}#htmlSnapped .nowPlayingTransportControlsContainer .win-commandimage,.snapped .nowPlayingTransportControlsContainer .win-commandimage{font-size:14pt;line-height:41px}.smartGlassGem{font-size:18pt;font-weight:300}.avatarSelectionRefreshButton .win-commandimage{font-size:30pt;line-height:110px}.homeHubNowPlayingTile .opportunityIconButton .iconButton .win-commandimage{font-size:50pt;line-height:140px}.games .failedPanelIcon{font-size:85pt}html:-ms-lang(en) .win-groupheader .groupHeaderOfflineAchievement{font-size:20pt;letter-spacing:.03em}html:-ms-lang(ml,ta) h5,html:-ms-lang(ml,ta) body,html:-ms-lang(ml,ta) .win-type-small,html:-ms-lang(ml,ta) .panelTitle .actionLinkLabel,html:-ms-lang(ml,ta) button.iconButton.win-command .win-label,html:-ms-lang(ml,ta) .dashboardPanel .panelFailed .failedPanelTitle,html:-ms-lang(ml,ta) .actionTile button.iconButton.win-command .win-label,html:-ms-lang(ml,ta) .music .homeNowPlayingTile .homeNowPlayingMetadataTitle{line-height:1.3636}html:-ms-lang(ml,ta) .actionLinkLabel.specificLineCount{line-height:1.35}html:-ms-lang(ta) .musicPage .pageHeader,html:-ms-lang(ta) .inboxPage .pageHeader{font-size:20pt}html:-ms-lang(ta) .companion .dashboardGridItemContent .thumbnailButton .primaryText.label{font-size:13pt}html:-ms-lang(km) .companionHomeSearchBox .editInput,html:-ms-lang(ta) .immersiveViewMorePopoverContainer .modifierDescription.label,html:-ms-lang(ta) .immersiveViewMorePopoverContainer .modifierSelectedItem.label{font-size:12.5pt}html:-ms-lang(ja) .win-groupheader .tvHeaderLabel,html:-ms-lang(ja) .win-groupheader .videoHeaderLabel,html:-ms-lang(ja,pt) .win-groupheader .groupHeaderMonth{font-size:14pt}html:-ms-lang(ja) .inPlaceDetailsItemActions button .win-label.label,html:-ms-lang(ja) .popOver.playlist .invoked .inlineDetailsMusicTrack .iconButtonHost button .win-label.label{font-weight:normal}@media(max-height:1079px){html:-ms-lang(ml,ta,pa) .emptyFriendsListContainer .emptyFriendsListTitle{font-size:14pt}}.games .win-settingsflyout option:checked,.games .win-settingsflyout select:focus::-ms-value,.games input[type=text]::selection,.games textarea::selection,.companion input[type=text]::selection,.companion input[type=url]::selection,.companion input[type=search]::selection,.companion textarea::selection,.companion .win-settingsflyout option:checked,.companion .win-settingsflyout select:focus::-ms-value,.dashboardGridItemContent.gamesThumb .thumbnailButton,.games .dialogButton.defaultButton:hover,.games .win-ui-light .dialogButton.defaultButton,.companion .win-ui-light .dialogButton.defaultButton,.companion input[type=range]::-ms-fill-lower,.companion .settingsPanelHeaderBackground,.games .settingsPanelHeaderBackground,.companionFullBleedNowPlayingTile .bottomProgress::-ms-fill,.homeNowPlayingTilePoster.companion .bottomProgress::-ms-fill,.userEngagementMessageBottom,.games .dashboardPanel .signedOutPanel .failedPanelContainer,.games .emptyFriendsListContainer .failedPanelContainer{background-color:#008a00}.games .win-settingsflyout option:checked:hover,.games .win-settingsflyout select:focus option:checked:hover,.companion .win-settingsflyout option:checked:hover,.companion .win-settingsflyout select:focus option:checked:hover,.companion .companionConnectionDialog.win-ui-light .dialogButton.defaultButton:hover,.games input[type=range]:hover::-ms-fill-lower,.companion input[type=range]:hover::-ms-fill-lower{background-color:#007000}.games input[type=range]:active::-ms-fill-lower,.companion input[type=range]:active::-ms-fill-lower{background-color:#005700}.companion .win-ui-light .dialogButton.defaultButton:active,.companion .win-ui-light .dialogButton.defaultButton:active:hover,.companion .dialogButton.defaultButton:hover,.games .dialogButton.defaultButton,.games .dialogButton.defaultButton:active,.games .win-ui-light .dialogButton.defaultButton:hover{background-color:rgba(0,138,0,.87)}.companion .win-settingsflyout,.games .win-settingsflyout{border-color:#006e00}.beaconControlContainer .beaconLink,.beaconControlContainer .editBeacon,.games a,.companion a,.games .errorFeedbackLink,.companion .errorFeedbackLink,.companion .fcBulletContent,.userEngagementMessageTitle,.fullScreenNowPlayingGlobalCommands .nowPlayingPlaylistAction.enabled button.win-command .win-commandimage,.games .dashboardPanel .libraryGamesContent .noContentPane .noContentPaneTitle,.emptyFriendsListContainer .miniProfilePanelControlsSignedOut .emptyFriendsListTitle,.newUserProfileText,.games .emptyFriendsListContainer .failedPanelDetails button.iconButton:active .win-commandimage{color:#008a00}.immersiveDetails .beaconControlContainer .beaconLink,.immersiveDetails .beaconControlContainer .editBeacon,.immersiveViewMorePopOverLayout .beaconControlContainer .beaconLink{color:#8cd600}.beaconControlContainer .beaconLink:hover,.beaconControlContainer .editBeacon:hover,.games a:hover,.companion a:hover,.games .errorFeedbackLink:hover,.companion .errorFeedbackLink:hover{color:#007000}.beaconControlContainer .beaconLink:active,.beaconControlContainer .beaconLink:active:hover,.beaconControlContainer .beaconLink:-ms-keyboard-active,.beaconControlContainer .editBeacon:active,.beaconControlContainer .editBeacon:active:hover,.beaconControlContainer .editBeacon:-ms-keyboard-active,.games a:active,.games a:active:hover,.companion a:active,.companion a:active:hover,.companion .dialogButton.defaultButton:active,.companion .dialogButton.defaultButton:active:hover,.games .dialogButton.defaultButton:active,.games .dialogButton.defaultButton:active:hover,.games .errorFeedbackLink:active,.games .errorFeedbackLink:active:hover,.companion .errorFeedbackLink:active,.companion .errorFeedbackLink:active:hover{color:#005700}.games .engagePanel .actionTile button.win-command.iconButton,.games .engagePanel .actionTile button.win-command.iconButton:hover,.games .engagePanel .actionTile button.win-command.iconButton:active,.games .engagePanel .actionTile button.win-command.iconButton:hover:active{background-image:linear-gradient(180deg,#00b200 0%,#008a00 100%);opacity:1}.music .win-settingsflyout option:checked,.music .win-settingsflyout select:focus::-ms-value,.dashboardGridItemContent.musicThumb .thumbnailButton,.music input[type=text]::selection,.music textarea::selection,.music .dialogButton.defaultButton:hover,.music .win-ui-light .dialogButton.defaultButton,.music input[type=range]::-ms-fill-lower,.music .settingsPanelHeaderBackground,.musicOverlay .bottomProgress::-ms-fill,.addPlaylistFlyout .win-ui-light .dialogButton{background-color:#d24726}.music input[type=range]:hover::-ms-fill-lower,.music .win-settingsflyout option:checked:hover,.music .win-settingsflyout select:focus option:checked:hover,.addPlaylistFlyout .win-ui-light .dialogButton:hover{background-color:#aa2d0d}.music input[type=range]:active::-ms-fill-lower{background-color:#971f02}.music .dialogButton.defaultButton,.music .dialogButton.defaultButton:active,.music .win-ui-light .dialogButton.defaultButton:hover{background-color:rgba(210,71,38,.87)}.music .win-settingsflyout{border-color:#a8391e}.music .playPlaylistOverlay .inlineCaretButton,.music .relatedActionLink button .actionLinkLabel,.musicSubscriptionLink button .actionLinkLabel,.collectionFilterLink button .actionLinkLabel,.music a,.music .errorFeedbackLink,.music .findAlbumInfoSearchText{color:#d24726}.music .playPlaylistOverlay .inlineCaretButton:hover,.music .relatedActionLink button:hover .actionLinkLabel,.musicSubscriptionLink button:hover .actionLinkLabel,.collectionFilterLink button:hover .actionLinkLabel,.music a:hover,.music .errorFeedbackLink:hover,.music .findAlbumInfoSearchText:hover{color:#aa2d0d}.music .playPlaylistOverlay .inlineCaretButton:active,.music .relatedActionLink button:active .actionLinkLabel,.music .relatedActionLink button:active:hover .actionLinkLabel,.musicSubscriptionLink button:active .actionLinkLabel,.musicSubscriptionLink button:active:hover .actionLinkLabel,.collectionFilterLink button:active .actionLinkLabel,.collectionFilterLink button:active:hover .actionLinkLabel,.music a:active,.music a:active:hover,.music .errorFeedbackLink:active,.music .errorFeedbackLink .music .findAlbumInfoSearchText:active,.music .findAlbumInfoSearchText:active:hover{color:#971f02}.video input[type=text]::selection,.video textarea::selection,.video .win-settingsflyout option:checked,.video .win-settingsflyout select:focus::-ms-value,.dashboardGridItemContent.videoThumb .thumbnailButton,.video .dialogButton.defaultButton:hover,.video input[type=range]::-ms-fill-lower,.video .win-ui-light .dialogButton.defaultButton,.video .settingsPanelHeaderBackground{background-color:#ac193d}.video .win-settingsflyout option:checked:hover,.video .win-settingsflyout select:focus option:checked:hover,.video input[type=range]:hover::-ms-fill-lower{background-color:#911635}.video input[type=range]:active::-ms-fill-lower{background-color:#78122b}.video .dialogButton.defaultButton,.video .dialogButton.defaultButton:active,.video .win-ui-light .dialogButton.defaultButton:hover{background-color:rgba(172,25,61,.87)}.video .win-settingsflyout{border-color:#8a1431}.video a,.video .errorFeedbackLink,.video .showMoreLink{color:#ac193d}.video a:hover,.video .errorFeedbackLink:hover,.video .showMoreLink:hover{color:#911635}.video a:active,.video a:active:hover,.video .errorFeedbackLink:active,.video .errorFeedbackLink:active:hover,.video .showMoreLink:active,.video .showMoreLink:hover{color:#78122b}.win-ui-light .dialogButton{background-color:#ccc}.win-ui-light .dialogButton:disabled,.win-ui-light .dialogButton:disabled:hover,.win-ui-light .dialogButton:disabled:active,.win-ui-light .dialogButton:disabled:hover:active,.win-ui-light .dialogButton.defaultButton:disabled,.win-ui-light .dialogButton.defaultButton:disabled:hover,.win-ui-light .dialogButton.defaultButton:disabled:active,.win-ui-light .dialogButton.defaultButton:disabled:hover:active,.control-sendMessage .editBox textArea,.selectArtistOverlayAnchor .overlayContainer{background-color:#eaeaea}.win-ui-light .dialogButton:hover{background-color:rgba(204,204,204,.74)}.win-ui-light .dialogButton{background-color:rgba(204,204,204,.87)}.playbackOptionComboTitle,.playbackOptionComboTitle:hover,.playbackOptionFlyoutButton:hover,.actionButtonFlyoutButton:hover,.win-menu button.actionButtonFlyoutButton:focus:hover{background-color:#dedede}.appSignIn .signInRetry,.settingsSignIn .signInRetry,.pageTitle,.messageButton,.HCRMediaTypeName,.socialSummaryLabel,.miniProfileHeader,.immersiveDetailsOverviewReviewButton,.homeNowPlayingMetadataXboxJoin,.appBarTransportControlsMessageSubTitle,.mediaItemThumbnailButtonTertiaryText{color:#3b7812}.settingsSignIn .signInRetry:hover{color:#55c105}.PlayButton,.DetailButton,.BuyButton,.WatchOnXboxButton,.internalActionLink,.externalActionLink,.hubDestination,.summaryCollectionTile,.allButton,.detailsTVGallery .win-item.win-selected,.friendsActionLink,.immersiveDetailsOverviewActionButton,.inlineDetailsOverviewActionButtonAlbum,.inlineDetailsOverviewActionButtonArtist,.inlineDetailsOverviewActionButtonEpisode,.inlineDetailsOverviewActionButtonGame,.inlineDetailsOverviewActionButtonTrack,.inlineDetailsOverviewActionButtonTv,.inlineDetailsOverviewActionButtonVideo,.inlineDetailsOverviewActionButtonMusicVideo,.inPlaceDetailsItemActionButton,.inlineDetailsOverviewWideActionButton,.inlineDetailsContentRating,.inlineDetailsLeaderBoardEntry,.miniSocialGalleryContainer,.miniSocialGalleryContainer:active,.miniProfileControl,.miniProfileControl:active,.playlistImageCollage .thumbnailButtonImage,.collectionPlaylistGroupHeader,.immersiveDetailsExtrasOverviewBackground,.downloadVideoActionButton{background-color:#3b7812}.messageButton,.messageEditBox .editMultiline,.recipientEditBox .editInput{border-color:#3b7812}.appSignIn .signInRetry:hover,.messageButton:hover,.settingsWebLinkText:hover{color:#295c03}.internalActionLink:hover,.internalActionLink:active:hover,.externalActionLink:hover,.externalActionLink:active:hover,.miniSocialGalleryContainer:hover,.miniSocialGalleryContainer:active:hover,.miniProfileControl:hover,.miniProfileControl:active:hover,.immersiveDetailsOverviewActionButton:hover,.immersiveDetailsOverviewActionButton:active:hover,.inlineDetailsLeaderBoardEntry:hover,.inlineDetailsLeaderBoardEntry:active:hover,.inlineDetailsOverviewActionButtonAlbum:hover,.inlineDetailsOverviewActionButtonAlbum:active:hover,.inlineDetailsOverviewActionButtonArtist:hover,.inlineDetailsOverviewActionButtonArtist:active:hover,.inlineDetailsOverviewActionButtonEpisode:hover,.inlineDetailsOverviewActionButtonEpisode:active:hover,.inlineDetailsOverviewActionButtonGame:hover,.inlineDetailsOverviewActionButtonGame:active:hover,.inlineDetailsOverviewActionButtonTrack:hover,.inlineDetailsOverviewActionButtonTrack:active:hover,.inlineDetailsOverviewActionButtonTv:hover,.inlineDetailsOverviewActionButtonTv:active:hover,.inlineDetailsOverviewActionButtonVideo:hover,.inlineDetailsOverviewActionButtonVideo:active:hover,.inlineDetailsOverviewActionButtonMusicVideo:hover,.inlineDetailsOverviewActionButtonMusicVideo:active:hover,.inPlaceDetailsItemActionButton:hover,.inPlaceDetailsItemActionButton:active:hover,.inlineDetailsOverviewWideActionButton:hover,.inlineDetailsOverviewWideActionButton:active:hover,.downloadVideoActionButton:hover,.downloadVideoActionButton:active:hover{background-color:#295c03}.messageButton:hover{border-color:#295c03}.externalLinkBackground{background-color:#006bc9}.externalLinkBackground:hover{background-color:#224061}.errorButtonBackgroundColor{background-color:#7030a0}.PrimaryNavigationButton,.CreateAccountButton,.artistOverviewGeneric .metadataTitle,.immersiveDetailsFeaturedPrimaryText,.immersiveDetailsOverviewBoldMetadata,.snappedDetailsOverviewMetadata,.immersiveDetailsTableOfContentsSecondaryText,.immersiveFrame .subTitle,.immersiveFrame .tertiaryText,.control-immersiveListViewItem .part-subTitle,.leaderboardRankContainer .text-subTitle,.control-immersiveListViewItem .part-textContainer .part-secondaryText,.immersiveMoreGallery .listHeader,.overview .subTitle,.overview .metaDataContainer .textContainer .label,.overview .metaDataContainer .textContainer p,.snappedDetailsOverview .metaDataContainer .textContainer .label,.snappedDetailsOverview .metaDataContainer .textContainer p,.achievements .progressTextCount,.achievements .gamerscoreProgressText,.nowPlayingPlaylistGallery .nowPlayingPlaylistTitle,.secondaryPanelModifier,.tertiaryPanelModifier,.pickProvidersPrimary,.pickProvidersSecondary,.appBarNowPlayingProgressDuration,.nowPlayingPlaylistEntrySubTitlesSnapped,.primaryPanelComponent .thumbnailButtonSecondaryText,.secondaryPanelComponent .thumbnailButtonSecondaryText,.infoNotificationSubTitle,.criticalNotificationSubTitle,.notificationContent .inlineCaretButtonIcon,.seekBarDurationText,.hubStripTitle,.win-ui-dark .win-selectioncheckmark,.win-ui-dark .win-selectionhint,.win-container.win-selected .win-selectioncheckmark,.videoAdOverlay .label,.comboUnavailableLabel,.control-rottenTomatoesOverview .rottenTomatoesOverview-title,.control-rottenTomatoesOverview .rottenTomatoesOverview-subtitle,.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-subtitle,.contributorList-title,.modernGameExtrasMoreItem .subTitle,.games body>div:not(.root) .inboxPage .panelFragmentFailed .failedPanelMessage,.findAlbumInfo .win-container.win-selected .albumListItem .secondaryText,.immersiveDetails .iconButtonTwoLine button.iconButton.win-command .win-label.subtitle,.immersiveDetails .iconButtonWithSubtext button.iconButton.win-command .win-label.subtitle{color:#a7a7a7}.immersiveDetailsOverviewActionButton:disabled,.inlineDetailsOverviewActionButtonAlbum:disabled,.inlineDetailsOverviewActionButtonGame:disabled,.inlineDetailsOverviewActionButtonVideo:disabled,.inlineDetailsOverviewActionButtonArtist:disabled,.inlineDetailsOverviewActionButtonTv:disabled,.inlineDetailsOverviewActionButtonTrack:disabled,.inlineDetailsOverviewActionButtonEpisode:disabled,.inlineDetailsOverviewActionButtonMusicVideo:disabled,.inlineDetailsLeaderBoardEntry:disabled,.inPlaceDetailsItemActionButton:disabled,.nowPlayingMetadataArt,.internalActionLink:disabled,.findAlbumInfo .imagePlaceholder,.downloadDetailsVideo .progressBar{background-color:#a7a7a7}.companionSearchTermContainer,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectionbordercontainer .win-selectionborder,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected:hover .win-selectionbordercontainer .win-selectionborder,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected:hover .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-rtl.win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-rtl.win-listview:not(.win-selectionstylefilled) .win-container.win-selected:hover .win-selectioncheckmarkbackground{border-color:#a7a7a7}[data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .selectionLayout .checkBackground,[data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .selectionLayout,.inPlaceDetailsHorizontalRule{border-color:#b2b2b2}.appBarNowPlayingProgressPosition,.collectionVideoGallery .thumbnailButtonSecondaryText,.movieThumbnail .thumbnailButtonSecondaryText,.gamesThumbnail .thumbnailButtonSecondaryText,.tvSeriesThumbnail .thumbnailButtonSecondaryText,.albumThumbnail .thumbnailButtonSecondaryText .companionEventItemTime,.failedPanelMessage,.verticalListItem .secondaryText,.verticalListItem .icon,.inlineDetailsMusicTrack .inCollectionIcon,.read .messageSender,.read .messageDate,.read .messageText,.read .messageIcon,.cloudCollectionStateContainer .inCollectionIcon,.verticalListItem .win-semanticzoom-button{color:#b2b2b2}.PrimaryNavigationButton:active:hover,.editInput:-ms-input-placeholder,.compareAchievementSecondaryText,.textMessage .messageBubble .text-metadata{color:#828282}.modifierPopupEntryLabel,.collectionMusicSongsGallery .win-groupheader,.popOverProgressContainer .progressTextCount,.adControl .label{color:#666}.gameDetailsInviteMeta .text-metadata,.control-sendMessage .editBoxRemainingCharsText,.messageButton.disabled,.detailsGamesGallery .win-item,.detailsAlbumsGallery .win-item,.detailsTVGallery .win-item,.inlineDetailsTrackFullContainer .inlineDetailsDescription,.inlineDetailsAlbumImmersive .inlineDetailsInline,.inlineDetailsAlbumImmersive .inlineDetailsPrimaryBold.inlineDetailsInline,.inlineDetailsMusicVideoContainer .inlineDetailsFullDescription,.inlineDetailsTvContainer .inlineEpisodeName,.inlineDetailsTvContainer .inlineEpisodeNumber,.inlineDetailsTvContainer .inlineEpisodeDuration,.inlineDetailsTvContainer .inlineDetailsFullDescription,.inlineDetailsTvContainer .inlineDetailsDescription,.inlineDetailsTvImmersive .inlineDetailsInline,.inlineDetailsTvImmersive .inlineDetailsPrimaryBold.inlineDetailsInline,.inlineDetailsVideoContainer .inlineDetailsFullDescription,.musicPage .inPlaceDetailsItemDuration,.inboxPage .inPlaceDetailsItemDuration,.win-ui-dark .verticalListHost .inPlaceDetailsItemDuration,.musicPage .inPlaceDetailsItemInfo,.inboxPage .inPlaceDetailsItemInfo,.win-ui-dark .verticalListHost .inPlaceDetailsItemInfo,.collectionMusic .inPlaceDetailsItemDuration,.collectionMusic .inPlaceDetailsItemInfo,.collectionVideo .inPlaceDetailsItemDuration,.collectionVideo .inPlaceDetailsItemInfo,.panelFragmentLoadingProgress,.dashboardPanel>.panelLoading>.loadingLabel,.inlineDetailsPanelFragmentLoadingProgress,.companionEventItemData,.dashboardGridCaption,.searchSongListItem .label,.primaryPanelModifier.disabled,.achievementThumbnail .thumbnailButtonSecondaryText,.achievementThumbnail .thumbnailButtonTertiaryText,.achievementThumbnail .thumbnailButtonQuaternaryText,.findAlbumInfo .unmatchedTrack,.findAlbumInfo .noMatchedTracksLabel,.findAlbumInfo .noAlbumsLabel,.findAlbumInfo .loadingControl .loadingLabel,.findAlbumInfo .win-container:not(.win-selected) .albumListItem .secondaryText,.playPlaylistOverlay .playlistItem .secondaryText,.selectArtistAutoCompleteLabel{color:#666}.achievements .userProgressContainers,.messageButton.disabled,.immersiveFrame>.headingRow,.snappedNowPlayingMetadata,.videoScrubOverlay{border-color:#666}.musicPage .win-vertical .win-item .verticalListItem.cloudNotification{border-bottom-color:#46474c}.overview.game .listDivider,.immersiveDetails .listDivider,.initialSelectedModifierPopupEntry,.selectedModifierPopupEntry,.snappedNowPlayingProgress,.achievementGameDetailsButton .link,.verticalSubPivotItem,.adPlaceholder,.verticalSmartDJThumbnail{background-color:#666}.win-flyout hr{background-color:rgba(112,112,112,.5)}.dashboardGridItemContent .dashboardTileIcon,.companionSearchTermsTitle,.adThumbnail .textContainer,.playlistItemTemplate .nowPlayingPlaylistEntrySubTitle1,.playlistItemTemplate .nowPlayingPlaylistEntryDuration,.errorFeedbackLink,.video .immersiveStarting .immersiveStartingProgress,.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-progressControl{color:#747474}.message,.messageButton.disabled:hover,.hubRecommendedRow .thumbnailButtonSecondaryText,.hubFriendText1,.hubFriendText2,.hubFriendText3,.hubContainer h1,.editBox .watermark,.achievementsHeaderGameName,.achievementThumbnail .thumbnailButtonPrimaryText,.miniProfileGamerScore,.friendInlineSecondaryText,.compareGalleryDefaultText,.failedPanelDetails .actionLinkLabel,.noContentPaneDetails .actionLinkLabel,.musicCollectionSongTile,.searchSongListItem,.inPlaceDetailsItem,.inlineDetailsAlbumContainer,.inlineDetailsAlbumContainer .inlineDetailsPrimaryBold,.inlineDetailsAlbumContainer .inlineDetailsTitle,.inlineDetailsTrackFullContainer,.inlineDetailsTrackFullContainer .inlineDetailsPrimaryBold,.inlineDetailsTrackFullContainer .inlineDetailsTitle,.inlineDetailsGameContainer,.inlineDetailsMusicVideoContainer,.inlineDetailsMusicVideoContainer .inlineDetailsPrimaryBold,.inlineDetailsMusicVideoContainer .inlineDetailsTitle,.inlineDetailsTvContainer,.inlineDetailsTvContainer .inlineDetailsPrimaryBold,.inlineDetailsTvContainer .inlineDetailsTitle,.inlineDetailsVideoContainer,.inlineDetailsVideoContainer .inlineDetailsPrimaryBold,.inlineDetailsVideoContainer .inlineDetailsTitle,.friendInlineDetailsLoadingContainer,.searchSongListItem .inlineTrackListName,.friendInlineDetailsContainer .gamerScoreContainer,.friendInlineDetailsGamerTag,.friendInlineDisplayNameText,.appSignIn .signInError,.appSignIn .signInProgress,.appSignIn .signInComplete,.popOver,.immersivePreviousPage,.immersiveNextPage{color:#1f1f1f}.friendsList,.temporaryXboxPromoImage,.temporaryGameLargeImage,.temporaryGameSmallImage,.mediumGreyBackgroundColor,.immersiveDetailsGalleryLine,.immersiveDetailsTableOfContents:hover,.snappedAppBar,.collectionTVSeasonPage .win-groupheader,.collectionVideoGallery .win-groupheader,.marketplaceGallery .win-groupheader,.tvSeriesHeaderButtonFrame,.tvSeriesHeaderDetailsButton,.tvSeriesHeaderControl,.searchGroupHeader,.searchGroupHeaderInPlace,.collectionAlbumGroupHeader,.previewBrowseBar getDetailsButton:active:hover{background-color:#333}.immersiveNowPlayingColumn .immersiveFrame{background-color:#1f1f1f}button.iconButton.hideAdorner:active:hover .win-commandring,.win-ui-dark button.iconButton.hideAdorner:active:hover .win-commandring,.selectArtistFlyoutGrid .win-listview .win-container,.transparentBackground,.transparentBackground.immersiveHeroBackgroundImageContainer{background-color:transparent}.music body>div:not(.root) .failedPanelContainer,.musicPage .win-vertical .win-container:hover,.win-ui-dark .verticalListHost .win-container:hover,.inboxPage .win-vertical .win-container:hover,.games body>div:not(.root) .inboxPage .failedPanelContainer,.collectionTVEpisodePage .win-item,.collectionTVEpisodePage .win-container:hover,.collectionTVEpisodeSeriesPage .win-item,.collectionTVEpisodeSeriesPage .win-container:hover,.emptyGalleryContainerPrimaryColor,.miniSocialGalleryOverlay{background-color:rgba(51,51,51,.08)}.overlayBackground{background-color:rgba(255,255,255,0)}.control-textInputOverlay .overlayBackground,.wecDialog .overlayBackground,.previewBrowseItemDataContainer{background-color:rgba(0,0,0,.5)}.modifierPopupContainer .overlayBackground{background-color:rgba(51,51,51,0)}.achievementsGallery .achievementThumbnail{border-color:rgba(51,51,51,.08)}.inlineDetailsLeaderBoardContainer,.gameLeaderBoardGalleryItemRoot,.messageButton.disabled:hover,.immersiveDetailsTableOfContents{border-color:#333}.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground{border-top-color:#333;border-right-color:#333;border-left-color:transparent;border-bottom-color:transparent}.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground{border-top-color:#333;border-right-color:transparent;border-left-color:#333;border-bottom-color:transparent}.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected .win-selectionborder,.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectionborder,.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground,.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground{border-color:#1b1b1b}.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-rtl.win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-rtl.win-listview:not(.win-selectionstylefilled) .win-container.win-selected:hover .win-selectioncheckmarkbackground{border-right-color:transparent}.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected:hover .win-selectioncheckmarkbackground{border-left-color:transparent}.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground,.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-selectioncheckmarkbackground,.win-rtl.win-listview:not(.win-selectionstylefilled) .win-horizontal .win-container.win-selected:hover .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected:hover .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-rtl.win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectioncheckmarkbackground,.immersiveViewMorePopOverLayout .win-rtl.win-listview:not(.win-selectionstylefilled) .win-container.win-selected:hover .win-selectioncheckmarkbackground{border-bottom-color:transparent}.win-selectionhint,.immersiveViewMorePopOverLayout .win-listview:not(.win-selectionstylefilled) .win-container.win-selected .win-selectioncheckmark{color:#1b1b1b}.win-ui-light .win-vertical .win-selectioncheckmark,.downloadDetailsVideo .progressBar,progress:indeterminate{color:#333}.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton button .win-commandicon,.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton button:active .win-commandicon,.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton button:hover .win-commandicon,.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton button:active:hover .win-commandicon,.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton button:disabled .win-commandicon,progress:indeterminate,progress,.collectionGallery .cardThumbnailButton,.collectionVideoGallery .cardThumbnailButton,.companionSearchTermsList .win-listview .win-vertical .win-container,.nowPlayingPlaylistGalleryViewSnapped .win-listview .win-vertical .win-container,.selectArtistEditBox .editInput,.video .immersiveHeroBackgroundImageContainer{background-color:transparent}.bottomAppBar,.appBarTransportControlsMessage,.eventContainer,.companionEventItemContainer,.musicPage .imagePlaceholder,.win-ui-dark .verticalListHost .imagePlaceholder,.musicPage .imagePlaceholder,.win-ui-dark .verticalListHost .imagePlaceholder,.musicCollection .failedPanelNotifications,.collectionVideoGallery .folderVideoThumbnail .folderThumbnailButton,.pivotDashboard .dashBoardSignInControl{background-color:#232222}.companion .popOver.activity .bodyContainer .subTitle,.playbackOptionFlyoutButton .actionLinkLabel,.playbackOptionComboTitle .actionLinkLabel,.playbackOptionComboTitle:hover .label,.playbackOptionComboTitle .icon,.playbackOptionComboTitle:hover .icon,.pickProvidersMetadata .pickProvidersMetadataText.pickProvidersTitle,.switcherButtonControllerSelected .xBoxControls_switcherIcon,.switcherButtonControllerSelected .xBoxControls_switcherText,.switcherButtonBrowserSelected .xBoxControls_switcherIcon,.switcherButtonBrowserSelected .xBoxControls_switcherText,.familyPasscode_Button:active:hover,.familyPasscode_Button:active,.editBox.validationFailed .editError,.inlineTrackListStatusIcon.icon.inlineGlyph,.beaconControlContainer button.beaconComment:active span,.failedPanelContainer .failedPanelTitle,.failedPanelContainer .failedPanelMessage,.overlayContainer .failedPanelContainer .failedPanelTitle,.overlayContainer .failedPanelContainer .failedPanelMessage,.noContentPane .noContentPaneTitle,.noContentPane .noContentPaneDescription,.actionButtonFlyoutButton .actionLinkLabel,.dialogButton:active:hover,.dialogButton.defaultButton:active:hover,.editProfileEditBoxLabel,.popOver .inPlaceDetailsItemActions button.iconButton.win-command .win-label,.marketplaceGallery .win-groupheader,.musicPage .win-groupheader,.inboxPage .win-groupheader,.win-ui-dark .verticalListHost .win-groupheader,.cardThumbnailButton .primaryText,.hcrHubPanel .primaryText,.popOver .win-selectioncheckmark,.popOver .win-item,.popOver,.popOver .primaryText,.videoDownloadManagerContent .win-selectioncheckmark,.videoDownloadManagerContent .win-item,.videoDownloadManagerContent,button.iconButton .win-commandimage.iconSpan,button.iconButton.hideAdorner .win-commandimage.iconSpanPressed,button.iconButton .win-commandimage.modifier,.win-ui-dark button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.iconSpan,.win-ui-dark button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.iconSpanPressed,.win-ui-dark button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.modifierSpan,.win-ui-dark button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.modifierSpanPressed,.win-ui-dark .enablePressedState button.iconButton.hideAdorner:active:hover .win-commandimage.iconSpanPressed,.enablePressedState button.iconButton.hideAdorner:active:hover .win-commandimage.modifier,button.iconButton.toggleButton.checked .win-commandimage.iconSpan,button.iconButton.toggleButton.checked .win-commandimage.iconSpanPressed,button.appBarIconButton.toggleButton.checked .win-commandimage.iconSpan,button.appBarIconButton.toggleButton.checked .win-commandimage.iconSpanPressed,.homeNowPlayingTile.large .homeNowPlayingMetadataTitle,.companionSearchTermContainer,.popOver.playlist .immersiveInlineTrackListName,.compareGameThumbnail,.chatBubble,.dashboardPanel .panelFailed .failedPanelTitle,.popOverContainer .panelFragmentLoading .failedPanelTitle,.miniProfilePanelControlsSignedOut .failedPanelTitle,.popOver.playlist .immersiveInlineTrackListName,.pickProviderProviders .primaryText,.appCriticalNotification .win-flipview .win-navbutton:hover,.appCriticalNotification .win-flipview .win-navbutton:hover:active,.appInfoNotification .win-flipview .win-navbutton:hover,.appInfoNotification .win-flipview .win-navbutton:hover:active,.companionConnectionDialog.win-ui-light .dialogButton.defaultButton:active,.companionConnectionDialog.win-ui-light .dialogButton.defaultButton:active:hover,.findAlbumInfo .win-container:not(.win-selected) .albumListItem .primaryText,.playPlaylistOverlay .playlistItem .primaryText,.webHostDialogContent .loadingProgress.ringLoadingControl,.selectArtistFeaturedName,.selectArtistSuggestedPrefix,.selectArtistSuggestedSuffix,.selectArtistSuggestedRtlPrefix,.selectArtistGalleryHeader,.homeHubNowPlayingTile .homeNowPlayingPlayButton button:hover:active .win-commandimage,.volumeIcon button:active .win-commandimage{color:#000}.popOver .inPlaceDetailsItemActions button.iconButton:disabled .win-commandimage.iconSpanPressed,.popOver .inPlaceDetailsItemActions button.iconButton:disabled:active:hover .win-commandimage.iconSpanPressed,.popOver .inPlaceDetailsItemActions button.iconButton.win-command:disabled .win-label,button.iconButton:disabled .win-label,button.iconButton:disabled:active .win-label,button.iconButton:disabled .win-commandimage.iconSpan,button.iconButton:disabled .win-commandimage.iconSpanPressed,button.iconButton:disabled .win-commandimage.modifier button.iconButton:disabled:active:hover .win-commandimage.iconSpanPressed,button.iconButton:disabled .win-commandimage.modifier,button.iconButton:disabled .win-commandimage.modifierPressed{color:rgba(0,0,0,.25)}button:disabled .win-commandring,button:disabled:active .win-commandring{border-bottom-color:rgba(0,0,0,.25);border-left-color:rgba(0,0,0,.25);border-right-color:rgba(0,0,0,.25);border-top-color:rgba(0,0,0,.25)}.win-ui-light .dialogButton:disabled,.win-ui-light .dialogButton:disabled:hover,.win-ui-light .dialogButton:disabled:active,.win-ui-light .dialogButton:disabled:hover:active,.win-ui-light .dialogButton:disabled.defaultButton,.win-ui-light .dialogButton.defaultButton:disabled:hover,.win-ui-light .dialogButton.defaultButton:disabled:active,.win-ui-light .dialogButton.defaultButton:disabled:hover:active{color:rgba(0,0,0,.49)}.win-ui-light .dialogButton,.win-ui-light .dialogButton:hover{color:#212121}.win-container.win-selected .verticalListItem .icon,.dashboardPanel>.panelLoading>.win-ring,.playbackOptionComboTitle:-ms-keyboard-active .actionLinkLabel,.playbackOptionComboTitle:active:hover .actionLinkLabel,.playbackOptionComboTitle:-ms-keyboard-active .icon,.playbackOptionComboTitle:active:hover .icon,.playbackOptionFlyoutButton:-ms-keyboard-active .actionLinkLabel,.playbackOptionFlyoutButton:active:hover .actionLinkLabel,.dashboardGridItemContent .dashboardTileIcon.gameIcon,.musicPage .smartDJOverlay::before,.textInputKeyboardText,.dialogButton:active,.dialogButton:active:hover,.webHostDialogResizeCancelButton.dialogButton.defaultButton:active:hover,.webHostDialogResizeCancelButton.dialogButton.defaultButton:active,.webHostDialogResizeCancelButton.dialogButton.defaultButton:hover,.webHostDialogResizeCancelButton.dialogButton.defaultButton,.musicPage .verticalListStatusIcon.iconButton,.inboxPage .verticalListStatusIcon.iconButton,.win-ui-dark .verticalListHost .verticalListStatusIcon.iconButton,.music body>div:not(.root) .panelFragmentFailed .failedPanelTitle,.games body>div:not(.root) .inboxPage .panelFragmentFailed .failedPanelTitle,button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.iconSpan,button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.iconSpanPressed,button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.modifierSpan,button.iconButton:-ms-keyboard-active:not(:disabled) .win-commandimage.modifierSpanPressed,.enablePressedState button.iconButton.hideAdorner:active:hover .win-commandimage.iconSpanPressed,.notificationContainer .beaconControlContainer .label:active span,.notificationContainer .beaconControlContainer .label:active:hover span,.showKeyboardFocus .notificationContainer .beaconControlContainer .label:hover:focus span,.showKeyboardFocus .notificationContainer .beaconControlContainer .label:active:hover:focus span,.showKeyboardFocus .notificationContainer .beaconControlContainer .label:-ms-keyboard-active span,.companionSearchButton button:-ms-keyboard-active .win-commandimage,.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton button.win-command:hover:active .win-commandimage.iconSpan,.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton button.win-command:hover:active .win-commandimage.iconSpanPressed,.collectionMusicGalleryView .failedPanelContainer .failedPanelTitle,.collectionMessageGallery .failedPanelContainer .failedPanelTitle,.music .marketplaceGalleryView .failedPanelContainer .failedPanelTitle,.collectionMusicGalleryView .failedPanelContainer .failedPanelMessage,.music .marketplaceGalleryView .failedPanelContainer .failedPanelMessage,.music .marketplaceGalleryView .failedPanelContainer .failedPanelMessage,.actionButtonFlyoutButton:-ms-keyboard-active .actionLinkLabel,.actionButtonFlyoutButton:active:hover .actionLinkLabel,.win-ui-light .dialogButton:active:hover,.win-ui-light .dialogButton.defaultButton,.win-ui-light .dialogButton.defaultButton:hover,.win-ui-light .dialogButton.defaultButton:active,.win-ui-light .dialogButton.defaultButton:active:hover,.achievementGameDetailsControl .inlineGlyphSmall,.activityGallery .win-item,.albumThumbnail,.win-item,.collectionGamesGallery .win-item,.musicPage .win-item,.inboxPage .win-item,.win-ui-dark .verticalListHost .win-item,.collectionPlaylistGallery .win-item,.collectionVideoGallery .win-item,.companionConnectionDialog .dialogCaption,.companionConnectionDialog .dialogContent,.activityOverlaySplashMetadataTextContainer,.friendsSummaryGallery .win-item,.failedPanelTitle,.marketplaceGamesPage .marketplaceGallery .win-item,.marketplaceMoviePage .marketplaceGallery .win-item,.marketplaceMusicPage .marketplaceGallery .win-item,.marketplaceTvPage .marketplaceGallery .win-item,.marketplaceVideoSearchPage .marketplaceGallery .win-item,.marketplaceGamesSearchPage .marketplaceGallery .win-item,.socialSummaryGallery .win-item,.inlineDetailsExtrasList .win-item,.snappedDetailsHubStrip .PrimaryNavigationButton.selected,.snappedNowPlayingMetadata,.seekBarPositionText,.PlayButton,.WatchOnXboxButton,.BuyButton,.DetailButton,.searchGroupHeaderText,.dialogLink,.hubDestination,.summaryCollectionTile,.allButton,.appBarNowPlayingMetadataTitle,.appBarNowPlayingMetadataSubTitle,.appBarTransportControlsMessageTitle,.homeNowPlayingMetadataClock,.homeNowPlayingMetadataTitle,.homeNowPlayingMetadataSubTitle,.miniSocialControlLabel,.whiteFontColor,.snappedIconContainer .snappedIconAppTitle,.immersiveDetailsTitle,.immersiveDetailsHub,.immersiveDetailsExtrasOverviewGeneral,.immersiveViewMorePopOverContentLayout>.headingRow>.immersiveViewMorePopOverHeading.label,.immersiveViewMorePopOverContentLayout .closeButton .label,.snappedDetailsTitle,.snappedDetailsHubStrip,.immersiveDetailsFeaturedSecondaryText,.immersiveHeroSecondaryText,.immersiveSecondaryText,.inlineDetailsOverviewActionButtonAlbum,.inlineDetailsOverviewActionButtonArtist,.inlineDetailsOverviewActionButtonEpisode,.inlineDetailsOverviewActionButtonGame,.inlineDetailsOverviewActionButtonTrack,.inlineDetailsOverviewActionButtonTv,.inlineDetailsOverviewActionButtonVideo,.inlineDetailsOverviewActionButtonMusicVideo,.inlineDetailsLeaderBoardEntry,.inPlaceDetailsItemActionButton,.downloadVideoActionButton,.nowPlayingPlaylistEntryMainTitle,.nowPlayingPlaylistEntryMainTitleSnapped,.nowPlayingPlaylistEntrySubTitles,.nowPlayingMetadataSubTitle,.nowPlayingMetadataMainTitle,.nowPlayingMetadataTime,.nowPlayingPlaylistTitle,.actionLinkLabel,.actionLinkContainer .icon,.settingsPanelTitle,.actionButtonLabel,.collectionTVEpisodeSeriesPage .win-groupheader,.collectionTVEpisodePage .win-groupheader,.collectionTVSeasonPage .win-groupheader,.collectionTVSeasonSeriesPage .win-groupheader,.tvSeriesHeaderDetailsButton,.selectedModifierPopupEntry,.musicPage .win-groupheader,.inboxPage .win-groupheader,.win-ui-dark .verticalListHost .win-groupheader,.musicPage .win-commandimage,.inboxPage .win-commandimage,.win-ui-dark .verticalListHost .win-commandimage,.musicPage .win-label,.inboxPage .win-label,.win-ui-dark .verticalListHost .win-label,.achievementGameDetailsThumbnail,.collectionVideoGallery .win-groupheader,.marketplaceGallery .win-groupheader,.immersiveDetailsContainer .PrimaryNavigationButton.selected,.dashboardGridItemContent,.immersiveDetailsOverviewActionButton,.immersiveDetailsTableOfContentsPrimaryText,.inlineDetailsAlbumImmersive,.inlineDetailsAlbumImmersive .immersiveInlineTrackListNumber,.inlineDetailsAlbumImmersive .immersiveInlineTrackListName,.inlineDetailsAlbumImmersive .immersiveInlineTrackListDuration,.inlineDetailsAlbumImmersive .inlineDetailsInline.label,.inlineDetailsAlbumImmersive .inlineDetailsTitle,.inlineDetailsAlbumImmersive .inlineDetailsPrimaryBold,.inlineDetailsAlbumImmersive .inlineDetailsPrimaryBold.inlineDetailsInline.inlineDetailsContentRating,.inlineDetailsAlbumImmersive .inlineDetailsSubHeader,.inlineDetailsTvImmersive,.inlineDetailsTvImmersive .inlineDetailsInline.label,.inlineDetailsTvImmersive .inlineDetailsTitle,.inlineDetailsTvImmersive .inlineDetailsPrimaryBold.inlineDetailsInline.inlineDetailsContentRating,.inlineDetailsTvImmersive .inlineDetailsPrimaryBold,.inlineDetailsTvImmersive .inlineDetailsFullDescription,.inlineDetailsTvImmersive .inlineDetailsTvEpisodeNumber,.inlineDetailsTvImmersive .inlineDetailsTvEpisodeTitle,.inlineDetailsTvImmersive .inlineDetailsTvEpisodeDate,.emptyGalleryContainerImmersiveDetailsColor .failedPanelTitle,.emptyGalleryContainerImmersiveDetailsColor .failedPanelMessage,.companionEventItemData,.eventContainer,.detailsAlbumsGallery .thumbnailButtonPrimaryText,.detailsGamesGallery .thumbnailButtonPrimaryText,.detailsTVGallery .thumbnailButtonPrimaryText,.failedPanelDetailsMessage,.primaryPanelModifier,.PrimaryNavigationButton.selected,.hubStripTitle,.dashboardTite,.hubStripPreviewTitle,.snappedDetailsContentContainer,.panelTitle,.pageHeader,.horizontalPivotButton.selected,.verticalPivotButton.selected,button:hover:active.horizontalPivotButton.selected,button:hover:active.verticalPivotButton.selected,.achievementGameDetailsProgressLabel,.achievementGameDetailsMetaDataText,.infoNotificationTitle,.criticalNotificationItem,.notificationContent,.criticalNotificationSecAction,.criticalNotificationIcon .win-commandimage,.infoNotificationIcon,.searchBoxIcon,.hubNavigationTitle,.hubNavigationSubTitle,button.iconButton.toggleButton:active:hover .win-commandimage.iconSpanPressed,.win-ui-dark button.iconButton .win-commandimage.iconSpan,.win-ui-dark button.iconButton.hideAdorner .win-commandimage.iconSpanPressed,.win-ui-dark button.iconButton .win-commandimage.modifier,.win-ui-light button.iconButton.toggleButton.checked .win-commandimage.iconSpan,.win-ui-light button.iconButton.toggleButton.checked .win-commandimage.iconSpanPressed,.initialSelectedModifierPopupEntry .modifierPopupEntryDescriptionLabel,.initialSelectedModifierPopupEntry .modifierPopupEntryLabel,.modifierPopupEntry:active .modifierPopupEntryLabel,.modifierPopupEntry:focus .modifierPopupEntryLabel,.homeNowPlayingTilePoster .homeNowPlayingMetadataTextContainer,.homeNowPlayingTilePoster.companion .homeNowPlayingMetadataSubTitle,.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingMetadataClock,.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingMetadataDuration,.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingMetadataClockAndDuration,.homeHubNowPlayingTile.win-ui-dark:hover .homeNowPlayingPlayButton .win-commandimage,.homeHubNowPlayingTile.win-ui-dark:hover .opportunityIconButton .win-commandimage,.homeHubNowPlayingTile:hover .homeNowPlayingErrorButton .win-commandimage,.homeHubNowPlayingTile .homeNowPlayingPlayButton .win-commandicon.win-commandring .win-commandimage,.homeHubNowPlayingTile .opportunityIconButton .win-commandicon.win-commandring .win-commandimage,.homeHubNowPlayingTile.acc-keyboardFocusTarget .homeNowPlayingPlayButton .win-commandimage,.homeHubNowPlayingTile.acc-keyboardFocusTarget .opportunityIconButton .win-commandimage,.homeHubNowPlayingTile.acc-keyboardFocusTarget .homeNowPlayingErrorButton .win-commandimage,.homeHubNowPlayingTile.acc-keyboardFocusTarget .win-commandimage,.musicSnappedNowPlaying .win-commandicon.win-commandring .win-commandimage,.heroActivityTile .primaryText,.compareHeaderText,.appBarNowPlayingMetadata,.bottomAppBarContainer .actionButtonLabel,button.horizontalPivotButton.expanded,button.verticalPivotButton.expanded,.extendedSplashScreenTitle,.extendedSplashScreenMessage,.extendedSplashScreenProgress.win-ring,.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-progressControl.win-ring,.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-spinnerContainer,.win-ui-dark .galleryProgress.win-ring,.immersiveStarting,.dialogXenonTitle,.dashboardTitle,.nowPlayingBranding,.nowPlayingBrandingLabel,.appCriticalNotification .win-flipview .win-navbutton,.appInfoNotification .win-flipview .win-navbutton,.adCompanionCloseButton,.adCompanionLabel,.musicFlexHubBigItem .cardThumbnailButton .textContainer .primaryText,.smartDJPanel::before,.opportunityContainer,button.inlineCaretButton,button.inlineCaretButton:hover,button.inlineCaretButton:hover:active,.videoAd,.adIconButton button.win-command .label,.companionFullBleedNowPlayingTile .textContainer,.companionFullBleedNowPlayingTile .homeNowPlayingMetadataClockAndDuration,.xboxXenonBackground .textContainer,.video .homeNowPlayingTilePoster .homeNowPlayingMetadataSubTitle,.control-textInputOverlay .editBox .editError,.games .dashboardPanel .playGameAction .label,.games .dashboardPanel.homeSpotlight .cardThumbnailButton .primaryText,.seasons .template-fullBleedThumbnail .part-primaryText,.previewBrowseFlipView .win-navbutton,.music .failedPanelTitle,.music .failedPanelMessage,.music .failedPanelDetails .iconButtonTwoLine button.iconButton.win-command .win-label.subtitle,[data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .selectionLayout .checkMark,.music .musicBrandActionLink button .actionLinkLabel,.control-upgradeTileContainer,.immersivePivots .immersiveHeroPrimaryText,.userEngagementMessageSubText,.music a.userEngagementMessageExternalLink,.music a.userEngagementMessageExternalLink:hover,.music a.userEngagementMessageExternalLink:active,.music a.userEngagementMessageExternalLink:active:hover,.cloudNotification button .textContainer .win-label.label.subtitle,.cloudNotification .clearIcon button .win-commandimage.iconSpan,.cloudNotification .clearIcon button .win-commandimage.iconSpanPressed,.cloudNotification .clearIcon button.iconButton .win-commandimage.modifier,.immersivePageTitle .immersiveHeroPrimaryText,.games .dashboardHubContent .signedOutPanel .failedPanelTitle,.games .dashboardHubContent .signedOutPanel .failedPanelMessage,.games .dashboardHubContent .signedOutPanel .failedPanelDetails .label,.games .dashboardHubContent .signedOutPanel .failedPanelDetails .win-commandimage,.games .emptyFriendsListContainer .failedPanelTitle,.games .emptyFriendsListContainer .failedPanelMessage,.games .emptyFriendsListContainer .failedPanelDetails .label,.games .emptyFriendsListContainer .failedPanelDetails .win-commandimage,.games .failedPanelIcon,.games .nowPlayingPopover,.games .nowPlayingPopover .nowPlayingTransportControlsPause .win-commandimage,.games .nowPlayingPopover .nowPlayingTransportControlsPlay .win-commandimage,.selectArtistButton button.iconButton .win-commandring.win-commandicon .win-commandimage,.music .immersiveHeroSecondaryText,.pivotDashboard .dashBoardSignInControl{color:#fff}.appBarTransportControlsXboxContainer .appBarIconButton:disabled.checked .win-commandimage,.appBarTransportControlsXboxContainer .appBarIconButton:disabled:active.checked .win-commandimage,.dialogButton:disabled,.dialogButton:disabled:active,.dialogButton:disabled:hover,.dialogButton:disabled:active:hover,.dialogButton.defaultButton:disabled,.dialogButton.defaultButton:disabled:active,.dialogButton.defaultButton:disabled:hover,.dialogButton.defaultButton:disabled:active:hover,.nowPlayingTransportControlsButton,.previewBrowse .navArrow:active,.previewBrowse .navArrow:hover,.previewBrowse .navArrow:active:hover,.music .musicBrandActionLink button:active .actionLinkLabel,.music .musicBrandActionLink button:active:hover .actionLinkLabel,.win-ui-dark button.iconButton:disabled .win-label,.win-ui-dark button.iconButton:disabled .win-commandimage.iconSpan,.win-ui-dark button.iconButton:disabled .win-commandimage.iconSpanPressed,.win-ui-dark button.iconButton:disabled:active:hover .win-commandimage.iconSpanPressed,.win-ui-dark button.iconButton:disabled .win-commandimage.modifier,.win-ui-dark button.iconButton:disabled .win-commandimage.modifierPressed{color:rgba(255,255,255,.4)}.adPlaceholderText{color:rgba(255,255,255,.1)}.nowPlayingPlaylistGalleryViewSnapped .nowPlayingPlaylistEntrySubTitle1{color:#b3b5bd}.switcherButtonControllerSelected,.switcherButtonControllerSelected:hover,.switcherButtonControllerSelected:active,.switcherButtonControllerSelected:active:hover,.switcherButtonBrowserSelected,.switcherButtonBrowserSelected:hover,.switcherButtonBrowserSelected:active,.switcherButtonBrowserSelected:active:hover,.familyPasscode_Button:hover,.familyPasscode_Button:active:hover,.familyPasscode_Button:active,.actionListFlyout,.actionListFlyoutColors,.nowPlayingTransportControlsButton,.SearchEditBox,.overlayContainer,.inlineAlbum,.appBarNowPlayingProgressFill,.snappedNowPlayingProgress::-ms-fill,.companionHomeSearchBox,.seekbarEventTick,.seekBarFill,.bottomProgress::-ms-fill,.modifierPopupScroller,.createPlaylistFlyout.win-flyout,.findFriendFlyout.win-flyout,.appBarIconButton.toggleButton.checked .win-commandring,.win-ui-dark .enablePressedState button.iconButton.hideAdorner:active:hover .win-commandring,.flexHubPage .win-item .videoFlexHubBigItem .cardThumbnailButton,.recommendationsPage .win-item .videoFlexHubBigItem .cardThumbnailButton,html[dir=rtl] .flexHubPage .win-item .videoFlexHubBigItem .cardThumbnailButton,html[dir=rtl] .recommendationsPage .win-item .videoFlexHubBigItem .cardThumbnailButton,html[dir=rtl] .marketplaceVideoSearchPage .win-item .searchHCR .cardThumbnailButton,html[dir=rtl] .marketplaceGamesSearchPage .win-item .searchHCR .cardThumbnailButton,.companion .companionConnectionDialog.win-ui-light .dialogButton.defaultButton:active,.companion .companionConnectionDialog.win-ui-light .dialogButton.defaultButton:active:hover,.musicOverlay .seekBarThumb,.homeHubNowPlayingTile .homeNowPlayingPlayButton button:hover:active .win-commandicon.win-commandring,.userEngagementMessageTop,.games .emptyFriendsListContainer .failedPanelDetails button.iconButton:active .win-commandring,.games .popOver.friend .rightColumn,.selectArtistButton,.win-menu button.actionButtonFlyoutButton:focus,.win-menu button.actionButtonFlyoutButton:active{background-color:#fff}.emptyGalleryContainerImmersiveDetailsColor,.immersiveDetailsGallery .thumbnailButton,.immersiveDetailsGallery .win-listview:not(.win-selectionstylefilled) .win-selectionborder,.collectionGamesGallery .win-listview:not(.win-selectionstylefilled) .win-selectionborder,.musicPage .win-listview:not(.win-selectionstylefilled) .win-selectionborder,.inboxPage .win-listview:not(.win-selectionstylefilled) .win-selectionborder,.win-ui-dark .verticalListHost .win-listview:not(.win-selectionstylefilled) .win-selectionborder,.collectionVideoGallery .win-listview:not(.win-selectionstylefilled) .win-selectionborder,.marketplaceGallery .win-listview:not(.win-selectionstylefilled) .win-selectionborder,.searchGalleryView .win-listview:not(.win-selectionstylefilled) .win-selectionborder{background-color:rgba(255,255,255,.1)}.musicPage .bodyContainer>hr,.inboxPage .bodyContainer>hr,.win-ui-dark .verticalListHost .bodyContainer>hr{background-color:rgba(255,255,255,.2)}.musicPage .simpleHeader,.inboxPage .simpleHeader,.collectionVideo .simpleVideoGroupHeader .simpleHeader,.win-ui-dark .verticalListHost .simpleHeader,.musicPage .collectionHeader,.inboxPage .collectionHeader,.win-ui-dark .verticalListHost .collectionHeader,.verticalListItem .win-semanticzoom-button{border-color:rgba(255,255,255,.2)}.immersiveDetailsExtrasType,.inlineDetailsGameExtra,.compareAchievementsItemContainer{border-color:rgba(255,255,255,.25)}.dialogButton:disabled,.dialogButton:disabled:active,.dialogButton:disabled:hover,.dialogButton:disabled:active:hover,.dialogButton.defaultButton:disabled,.dialogButton.defaultButton:disabled:active,.dialogButton.defaultButton:disabled:hover,.dialogButton.defaultButton:disabled:active:hover,.appBarTransportControlsXboxContainer .appBarIconButton:disabled:not(.hideAdorner) .win-commandring,.win-ui-dark button:disabled:hover.iconButton .win-commandring{border-color:rgba(255,255,255,.4)}.showKeyboardFocus .notificationButtonContainer .imageActionLink:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button:hover:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button:active:hover:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button:-ms-keyboard-active,.showKeyboardFocus .notificationContainer .beaconControlContainer button.bodyContent.beaconComment.label:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button.bodyContent.beaconComment.label:hover:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button.bodyContent.beaconComment.label:active:hover:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button.bodyContent.beaconComment.label:-ms-keyboard-active,.showKeyboardFocus .notificationContainer .beaconControlContainer button.win-command.iconButton:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button.win-command.iconButton:hover:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button.win-command.iconButton:active:hover:focus,.showKeyboardFocus .notificationContainer .beaconControlContainer button.win-command.iconButton:-ms-keyboard-active,.showKeyboardFocus .engagePanel .actionTile button:focus,.nowPlayingMetadataArt,.musicPage .win-commandring,.inboxPage .win-commandring,.win-ui-dark .verticalListHost .win-commandring,.musicPage button:hover .win-commandring,.inboxPage button:hover .win-commandring,.win-ui-dark .verticalListHost button:hover .win-commandring,.musicPage button:active .win-commandring,.inboxPage button:active .win-commandring,.win-ui-dark .verticalListHost button:active .win-commandring,.homeNowPlayingMetadata:hover .win-commandring,.homeHubNowPlayingTile .homeNowPlayingPlayButton .win-commandring,.homeHubNowPlayingTile .opportunityIconButton .win-commandring,.musicSnappedNowPlaying .win-commandring,.musicSnappedNowPlaying .prevNextIconButton .win-commandring,.settingsPanelBackButton:focus,.companionConnectionDialog.win-ui-light .dialogButton.defaultButton,.companionConnectionDialog.win-ui-light .dialogButton:active:hover,.companionConnectionDialog.win-ui-light .dialogButton.defaultButton,.companionConnectionDialog.win-ui-light .dialogButton.defaultButton:hover,.companionConnectionDialog.win-ui-light .dialogButton.defaultButton:active,.companionConnectionDialog.win-ui-light .dialogButton.defaultButton:active:hover,.dialogButton:active:hover,.dialogButton.defaultButton,.dialogButton.defaultButton:hover,.dialogButton.defaultButton:active,.dialogButton.defaultButton:active:hover,.homeHubNowPlayingTile .homeNowPlayingPlayButton button:hover:active .win-commandicon.win-commandring,.games .dashboardHubContent .failedPanelDetails .win-commandring,.games .emptyFriendsListContainer .win-commandring,.games .nowPlayingPopover .win-commandring,.games .nowPlayingPopover .win-command,.games .emptyFriendsListContainer .failedPanelDetails button.iconButton:active .win-commandring,.selectArtistButton button .win-commandring.win-commandicon,.tvSeriesHeaderControl{border-color:#fff}.musicPage .win-viewport.win-vertical .win-container:hover .win-item>div,.win-ui-dark .verticalListHost .win-viewport.win-vertical .win-container:hover .win-item>div,.musicPage .win-viewport.win-vertical .win-container:hover .win-focusedoutline,.inboxPage .win-viewport.win-vertical .win-container:hover .win-focusedoutline,.win-ui-dark .verticalListHost.win-viewport.win-vertical .win-container:hover .win-focusedoutline{outline-color:rgba(255,255,255,.25)}.playbackOptionComboTitle:-ms-keyboard-active,.playbackOptionComboTitle:active:hover,html,body,.textInputControl_editBox .editBox,.iconButton .win-commandicon:active,.snappedContainer,.immersiveDetailsOverview,.immersiveDetailsTableOfContents,.immersiveDetailsOverview,.immersiveDetailsOverviewContainer,.immersiveDetailsHub,.immersiveHeroBackgroundImageContainer,.immersiveNowPlayingColumn .headingRow,.snapped .immersivePlaylist .headingRow,.inlineDetailsExtrasList,.nowPlayingTileBackground,.adThumbnail .primaryText.label,.dialogButton:active,.dialogButton:active:hover,.companion .artistDetailsOverviewPanel .nowPlayingContainer,.enablePressedState button.iconButton.hideAdorner:active:hover .win-commandring,button.iconButton:disabled:active .win-commandring,.seasons .template-fullBleedThumbnail .content,.modifierPopupEntry:hover:focus:not(.initialSelectedModifierPopupEntry),.modifierPopupEntry:focus:not(.initialSelectedModifierPopupEntry),.achievementGameDetailsButton .link:active,.videoAd,.adCompanion,.nowPlayingLargeArtBlackOverlay,.companionActivityContainer,.activityOverlaySplash,.nowPlayingLargeArtTransitionOverlay,.immersiveNowPlayingColumn .nowPlayingPlaylistGalleryHeader,.snapped .nowPlayingPlaylistGalleryHeader,.previewBrowse,.previewBrowseBar .getDetailsButton,.screenshotLocatorSelected,.control-videoFullScreenNowPlaying,.music1 .homeSpotlight .nowPlayingBackground{background-color:#000}.imageActionLink:focus,.showKeyboardFocus .beaconControlContainer button:focus,.showKeyboardFocus .beaconControlContainer button:hover:focus,.showKeyboardFocus .beaconControlContainer button:active:hover:focus,.showKeyboardFocus .beaconControlContainer button:-ms-keyboard-active,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:focus,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:hover:focus,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:active:hover:focus,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:-ms-keyboard-active,.showKeyboardFocus .beaconControlContainer button.win-command.iconButton:focus,.showKeyboardFocus .beaconControlContainer button.win-command.iconButton:hover:focus,.showKeyboardFocus .beaconControlContainer button.win-command.iconButton:active:hover:focus,.showKeyboardFocus .beaconControlContainer button.win-command.iconButton:-ms-keyboard-active,.webHostIFrame{border-color:#000}.musicPage .verticalPivotButton.expanded,.win-ui-dark .verticalListHost .verticalPivotButton.expanded,.musicPage .horizontalPivotButton.expanded,.inboxPage .verticalPivotButton.expanded{border-bottom-color:rgba(0,0,0,.12)}.selectArtistGalleryHeader,.popOverList.verticalListHost .simpleHeader,.popOver .divider{border-bottom-color:rgba(0,0,0,.2)}.collectionGamesGallery .win-selectionborder,.musicPage .win-selectionborder,.inboxPage .win-selectionborder,.win-ui-dark .verticalListHost .win-selectionborder,.collectionVideoGallery .win-selectionborder,.marketplaceGallery .win-selectionborder,.searchGalleryView .win-selectionborder{outline-color:rgba(0,0,0,.1)}.listDivider,.musicPage button.verticalPivotButton.expanded,.musicPage button.horizontalPivotButton.expanded,.win-ui-dark .verticalListHost button.verticalPivotButton.expanded,.inboxPage button.verticalPivotButton.expanded,.musicPage button:hover.verticalPivotButton.expanded,.musicPage button:hover.horizontalPivotButton.expanded,.win-ui-dark .verticalListHost button:hover.verticalPivotButton.expanded,.inboxPage button:hover.verticalPivotButton.expanded,.musicPage button:active.horizontalPivotButton.expanded,.musicPage button:active.verticalPivotButton.expanded,.win-ui-dark .verticalListHost button:active.horizontalPivotButton.expanded,.inboxPage button:active.verticalPivotButton.expanded,.musicPage button:hover:active.horizontalPivotButton.expanded,.musicPage button:hover:active.verticalPivotButton.expanded,.win-ui-dark .verticalListHost button:hover:active.horizontalPivotButton.expanded,.inboxPage button:hover:active.verticalPivotButton.expanded,.collectionMusicSongsGallery.win-ui-dark .win-container:not(.invoked):not(.win-footprint):hover{background-color:rgba(0,0,0,.2)}.collectionMusicSongsGallery.win-ui-dark .win-container:active,.control-immersiveListViewItem .activitiesOverlay{background-color:rgba(0,0,0,.5)}.collectionMusicGalleryView .failedPanelContainer,.music .marketplaceGalleryView .failedPanelContainer,.collectionMessageGallery .failedPanelContainer,.verticalSubPivotItem,.modifierPopupEntry:hover:not(.initialSelectedModifierPopupEntry),.musicPage.win-ui-dark .win-listview .win-vertical .win-container:not(.invoked):not(.win-selected):not(.win-pressed),.inboxPage.win-ui-dark .win-listview .win-vertical .win-container:not(.invoked):not(.win-selected):not(.win-pressed),.sidebarHost .adPlaceholder{background-color:rgba(0,0,0,.12)}.ui-hitTestArea{background-color:rgba(0,0,0,0)}.popOver.game .contentNotificationListItems .contentNotificationImage button:active:hover.link.imageActionLink.internalActionLink,.showKeyboardFocus .beaconControlContainer button:-ms-keyboard-active,button.beaconLink:hover,button.beaconLink:focus,button.beaconLink:active,button.beaconLink:active:hover,button.iconButton:disabled .win-commandring,button.iconButton:disabled:active .win-commandring,button.iconButton:disabled:hover .win-commandring,button.iconButton:disabled:active:hover .win-commandring,.dialogButton:disabled,.dialogButton:disabled:active,.dialogButton:disabled:hover,.dialogButton:disabled:active:hover,.dialogButton.defaultButton:disabled,.dialogButton.defaultButton:disabled:active,.dialogButton.defaultButton:disabled:hover,.dialogButton.defaultButton:disabled:active:hover,.nowPlayingTransportControlsButton,.imageButton,.SearchButton,.CreateAccountButton,.backButton,.PrimaryNavigationButton,.horizontalPivotButton,.verticalPivotButton,.messageButton,.HCRDescription,.Metadata2,.Metadata1,.HCRThirdTitle,.HCRSubTitle,.HCRTitle,.HCRMediaTypeName,.searchGalleryViewAlbum,.searchGalleryViewArtist,.searchGalleryViewTVSeries,.searchGalleryViewMovie,.searchGalleryView,.seekBarTrack,.galleryViewHubPanel,.webHostIFrame,.thumbnailButtonImage,.albumThumbnail,.modifierPopupContainer .overlayContainer,.actionButtonFlyoutButton,.playbackOptionFlyoutButton,.playbackOptionComboTitle,.relatedActionLink .internalActionLink,.relatedActionLink .internalActionLink:hover,.relatedActionLink .internalActionLink:active:hover,.musicBrandActionLink .internalActionLink,.musicBrandActionLink .internalActionLink:hover,.musicBrandActionLink .internalActionLink:active:hover,.win-listview .win-item:hover,.win-listview .win-pressed.win-item,.companionHomeSearchBox .editInput,.errorFeedbackLink,.companion .nowPlayingContainer,.panelTitle .internalActionLink,.panelTitle .internalActionLink:hover,.panelTitle .internalActionLink:active:hover,.musicSubscriptionLink .internalActionLink,.musicSubscriptionLink .internalActionLink:hover,.musicSubscriptionLink .internalActionLink:active:hover,.collectionFilterLink .internalActionLink,.collectionFilterLink .internalActionLink:hover,.collectionFilterLink .internalActionLink:active:hover,.noContentPaneDetails .internalActionLink,.noContentPaneDetails .internalActionLink:hover,.noContentPaneDetails .internalActionLink:active:hover,.failedPanelDetailsLink .internalActionLink,.failedPanelDetailsLink .internalActionLink:hover,.failedPanelDetailsLink .internalActionLink:active:hover,.immersiveDetailsOverviewActionBlock,.inPlaceDetailsItemActions.win-ui-dark,.snappedUnsnapIcon.win-ui-dark,.songsGallery.win-ui-dark,.musicPage.win-ui-dark,.inboxPage.win-ui-dark,.dashboardGridItemContent.action .primaryText,button:hover.horizontalPivotButton,button:hover.verticalPivotButton,button:active.horizontalPivotButton,button:active.verticalPivotButton,button:hover:active.horizontalPivotButton,button:hover:active.verticalPivotButton,.companion .dashboardGridItemContent.action .thumbnailButton .imageContainer,.popOver.tv .rightColumn,.companion .gamesCollection .cardThumbnailButton .imageHolder,.companionNowPlaying .cardThumbnailButton .imageHolder,.notificationContent,.headingLink .internalActionLink:focus:not(:disabled),.headingLink .internalActionLink:hover:not(:disabled),.musicPage .win-listview .win-container:not(.win-footprint),.inboxPage .win-listview .win-container:not(.win-footprint),.win-ui-dark .verticalListHost .win-listview .win-container:not(.win-footprint),.collectionArtistGallery .win-listview .win-container:not(.win-footprint),.collectionVideoGallery .win-listview .win-container:not(.win-footprint),.marketplaceMoviePage .win-listview .win-container:not(.win-footprint),.marketplaceTvPage .win-listview .win-container:not(.win-footprint),.marketplaceVideoSearchPage .win-listview .win-container:not(.win-footprint),.marketplaceGamesSearchPage .win-listview .win-container:not(.win-footprint),.collectionGamesGallery .win-listview .win-container:not(.win-footprint),.achievementsGallery .win-listview .win-container:not(.win-footprint),button.inlineCaretButton:hover,button.inlineCaretButton:hover:active,.videoAdCloseButton button.win-command:hover .win-commandicon.win-commandring,.videoAdCloseButton button.win-command:active .win-commandicon.win-commandring,.videoAdCloseButton button.win-command:hover:active .win-commandicon.win-commandring,.windowsMarketplace .win-surface .win-container,.immersiveHeroContent,.previewBrowseFlipView .win-navbutton,.companion .collectionGamesGallery .gameThumbnail .cardThumbnailButton{background-color:transparent}.popOverContentContainer{background-color:#f5f5f5}.selectArtistButton.win-template button.iconButton{background-color:#2a2a2a}.selectArtistButton.win-template button.iconButton:hover{background-color:rgba(42,42,42,.8)}.selectArtistButton.win-template button.iconButton:active,.selectArtistButton.win-template button.iconButton:active:hover{background-color:rgba(42,42,42,.4)}.immersiveViewMoreBackground.overlayBackground,.actionListFlyoutColors button,.actionListFlyoutColors input[type="button"]{background-color:rgba(255,255,255,.001)}.appBarUpsellContainer .appBarUpsellAction:not(.appBarUpsellPlayPauseAction) button.win-command:active:hover .win-commandring,.appBarUpsellContainer .appBarUpsellAction:not(.appBarUpsellPlayPauseAction) button.win-command:-ms-keyboard-active .win-commandring,.adIconButton:not(.playPauseIconButton) button.win-command .win-commandring,.adIconButton:not(.playPauseIconButton) button.win-command:active:hover .win-commandring,.adIconButton:not(.playPauseIconButton) button.win-command:-ms-keyboard-active .win-commandring,.actionListFlyout,.playbackOptionListFlyoutColors,button.win-command.iconButtonVertical,button.win-command.iconButtonVertical:hover,button.win-command.iconButtonVertical:active:hover,button.win-command.iconButtonVertical:active:not(:-ms-keyboard-active),.appBarTransportControlsXboxContainer .appBarIconButton:disabled:active .win-commandring,.appBarTransportControlsXboxContainer .appBarIconButton:disabled:active:hover .win-commandring,.musicPage button.horizontalPivotButton,.musicPage button.verticalPivotButton,.win-ui-dark .verticalListHost button.verticalPivotButton,.inboxPage button.verticalPivotButton,button.iconButton.win-command:focus,button.iconButton.win-command:active,button.iconButton.hideAdorner .win-commandring,button.iconButton.hideAdorner:disabled:hover .win-commandring,button.appBarIconButton.hideAdorner .win-commandring,button.appBarIconButton.hideAdorner:disabled:hover .win-commandring,.immersiveDetailsGalleryLine,.immersiveNowPlayingColumn .headingRow,.win-listview:not(.win-selectionstylefilled) .win-vertical .win-selected.win-container .win-selectionborder,.win-listview:not(.win-selectionstylefilled) .win-vertical .win-selected.win-container:hover .win-selectionborder,.win-ui-light .dialogButton:active:hover,.win-ui-light .dialogButton.defaultButton,.win-ui-light .dialogButton.defaultButton:hover,.win-ui-light .dialogButton.defaultButton:active,.win-ui-light .dialogButton.defaultButton:active:hover,.games .engagePanel .actionTile button:active .win-commandicon,.games .engagePanel .actionTile button.win-command.iconButton,.games .engagePanel .actionTile button.win-command.iconButton:hover:focus,.games .engagePanel .actionTile button.win-command.iconButton:active,.games .engagePanel .actionTile button.win-command.iconButton:focus,.selectArtistButton button.hideAdorner .win-commandring.win-commandicon{border-color:transparent}.musicPage button.verticalPivotButton.expanded,.musicPage button.horizontalPivotButton.expanded,.inboxPage button.verticalPivotButton.expanded,.win-ui-dark .verticalListHost button.horizontalPivotButton.expanded{border-top-color:transparent}.musicPage .win-listview .win-viewport.win-vertical .win-pressed,.inboxPage .win-listview .win-viewport.win-vertical .win-pressed,.win-ui-dark .verticalListHost .win-listview .win-viewport.win-vertical .win-pressed,.musicPage .win-listview .win-viewport.win-vertical .invoked,.inboxPage .win-listview .win-viewport.win-vertical .invoked,.win-ui-dark .verticalListHost .win-listview .win-viewport.win-vertical .invoked,.musicPage .win-listview .win-viewport.win-vertical .invoked:hover,.inboxPage .win-listview .win-viewport.win-vertical .invoked:hover,.win-ui-dark .verticalListHost .win-listview .win-viewport.win-vertical .invoked:hover,.musicPage .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container,.inboxPage .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container,.win-ui-dark .verticalListHost .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container,.musicPage .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container .win-selectionbackground,.inboxPage .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container .win-selectionbackground,.win-ui-dark .verticalListHost .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container .win-selectionbackground,.musicPage .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover,.win-ui-dark .verticalListHost .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover,.musicPage .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover .win-selectionbackground,.win-ui-dark .verticalListHost .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover .win-selectionbackground,.inboxPage .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover .win-selectionbackground,.webHostDarkBackground{background-color:#232323}.musicPage .win-viewport.win-vertical .win-container.invoked,.inboxPage .win-viewport.win-vertical .win-container.invoked,.win-ui-dark .verticalListHost .win-viewport.win-vertical .win-container.invoked{outline-color:#232323}.settingsWebLinkText{color:#4ca805}.feedbackConnectionError{color:red}.nowPlayingOverlay{background-color:rgba(20,20,20,.2)}.musicOverlay .nowPlayingOverlay{background-color:transparent}.nowPlayingPlaylistEntryMetadata{border-color:rgba(200,200,200,.2)}.appBarNowPlaying{border-color:rgba(255,255,255,.7)}.appBarNowPlayingOverlay{background-color:rgba(20,20,20,.2)}.bottomProgressContainer{background-color:rgba(200,200,200,.2)}.win-ui-dark .win-rating .win-star.win-user.win-full,.win-ui-dark .win-rating .win-star.win-user.win-full.win-disabled{color:#5b2ec5}.win-ui-dark .win-rating .win-star.win-tentative.win-full{color:#8152ef}.win-ui-dark .win-rating .win-star.win-average.win-full,.win-ui-dark .win-rating .win-star.win-average.win-full.win-disabled{color:#2dab11}.win-ui-dark .win-rating .win-star.win-empty{color:#fff}.win-ui-dark .win-rating .win-star.win-user.win-full,.win-ui-dark .win-rating .win-star.win-user.win-full.win-disabled{color:#ac193d}.immersiveDetails .control-starRating .part-userRatedIndicator,.immersiveDetails .control-starRating .part-totalRatings,.win-ui-dark .win-rating .win-star.win-tentative.win-full{color:#a7a7a7}.win-ui-dark .win-rating .win-star.win-average.win-full,.win-ui-dark .win-rating .win-star.win-average.win-full.win-disabled{color:#fff}.win-ui-dark .win-rating .win-star.win-empty{color:rgba(255,255,255,.2)}.control-rottenTomatoesOverview .rottenTomatoesOverview-progressBar.state-scoreRotten{color:#93b13c}.control-rottenTomatoesOverview .rottenTomatoesOverview-progressBar.state-scoreFresh{color:red}.win-rating .win-star.win-user.win-full,.win-rating .win-star.win-user.win-full.win-disabled{color:#ac193d}.win-rating .win-star.win-tentative.win-full{color:#2b2b2b}.popOver .control-starRating .part-userRatedIndicator,.popOver .control-starRating .part-totalRatings,.win-rating .win-star.win-average.win-full,.win-rating .win-star.win-average.win-full.win-disabled,.inlineDetailsMusicTrack .icon,.popOverPrimaryList.albums .icon{color:#6b6b6b}.win-rating .win-star.win-empty{color:rgba(107,107,107,.2)}.HCRCoverArt{border-color:rgba(255,255,255,.1)}.inlineDetailsTvEpisode,.inlineDetailsMusicTrack,.popOverList.verticalListHost .verticalListItem{border-color:rgba(0,0,0,.15)}.inlineDetailsTvImmersive .inlineDetailsTvEpisode,.inlineDetailsAlbumImmersive .inlineDetailsMusicTrack{border-color:rgba(255,255,255,.15)}.seekBarTrackBackground{background-color:rgba(255,255,255,.4)}:not(.app-classicContainer)>#htmlUnsnapped{background-color:#fff;background-image:linear-gradient(180deg,#535358 0%,#ceced2 100%)}#htmlUnsnapped.musicNewReleases,#htmlUnsnapped.musicTopMusic,#htmlUnsnapped.musicMarketplace,#htmlUnsnapped.musicCollection,.music #htmlUnsnapped.searchPage,.games #htmlUnsnapped.socialInboxPage,.music #htmlUnsnapped.flexHubPage{background-color:#333;background-image:linear-gradient(180deg,#4a4b50 0%,#333337 100%)}.nowPlayingPlaylistControl,#htmlUnsnapped.immersiveDetails{background-repeat:repeat-x;background-position:top left;background-size:100% 100%}.thumbnailButtonTextContainer.thumbnailButtonTextContainerNoGradient{background-image:none}.noSpotlightContentPane,.panelFragmentFailed,.games .dashboard .socialFriendsPanel .panelFragmentFailed,.dashboardPanel>.panelFailed,.modifierPopupEntrySeparator{background-color:rgba(0,0,0,.1)}.related.relatedArtists .content,.dashboard .panelFragmentFailed{background-color:rgba(0,0,0,.8)}.modifierPopupBackground{background-color:#fff}.games .dashboardPanel .playGameAction{background-image:-ms-linear-gradient(top,#3c3c3c 0%,#3c3c3c 40%,#828282 100%)}.inlineDetailsTrackFullContainer,.inlineDetailsGameContainer,.inlineDetailsMusicVideoContainer,.inlineDetailsVideoContainer,.inlineDetailsTvContainer,.friendInlineDetailsLoadingContainer,.gameInlineDetailsPanelFragmentContainer.panelFragmentContainer,.movieInlineDetailsPanelFragmentContainer.panelFragmentContainer,.musicInlineDetailsPanelFragmentContainer.panelFragmentContainer,.tvInlineDetailsPanelFragmentContainer.panelFragmentContainer,.searchListView,.nowPlayingControlBackground{background-color:rgba(0,0,0,.04)}.musicPage .win-vertical .inPlaceDetailsHorizontalRule,.inboxPage .win-vertical .inPlaceDetailsHorizontalRule,.collectionVideoGallery .inPlaceDetailsHorizontalRule{border-color:rgba(51,51,51,.1)}.inlineDetailsItemSelected{color:#c8c8c8}.friendInlineMembershipType{color:#ff7200}body{scrollbar-face-color:#a7a7a7;scrollbar-arrow-color:#a7a7a7;scrollbar-track-color:#fff}.immersiveDetailsContainer{scrollbar-track-color:#2b2b2b}.dialogContent{scrollbar-face-color:#666;scrollbar-base-color:#666;scrollbar-arrow-color:#666;scrollbar-track-color:#333}.achievementThumbnail{background-color:transparent}.appBarNowPlayingProgressContainer,.immersiveHeroContent>hr,.bottomProgress{background-color:rgba(255,255,255,.2)}.music .homeHubNowPlayingTile:focus,.achievementsGallery .win-surface .win-container.win-footprint:hover,button.iconButton.win-command:focus,button.iconButton.win-command:active,button.appBarIconButton.win-command:focus,button.appBarIconButton.win-command:active,.label.acc-keyboardFocusTarget,.control-immersiveListViewItem:focus,.relatedHeroItem:focus{outline-style:none}button.iconButton.win-command,.musicCollection .failedPanelDetails .win-command.iconButton:focus{outline-color:#fff}.findFriendFlyout button.win-command.iconButton{outline-color:#000}.showKeyboardFocus button.iconButton.win-command:focus,.showKeyboardFocus button.iconButton.win-command:active,.showKeyboardFocus button.appBarIconButton.win-command:focus,.showKeyboardFocus button.appBarIconButton.win-command:active,.showKeyboardFocus .label.acc-keyboardFocusTarget:focus,.showKeyboardFocus .label.acc-keyboardFocusTarget:active{outline-style:solid}button.link:focus,button.link:active{outline-style:none}.showKeyboardFocus button.link:focus,.showKeyboardFocus button.link:active{outline-style:solid}.showKeyboardFocus .immersiveHeroContent button:focus,.showKeyboardFocus .welcomePanelContainer .closeButton:focus,.showKeyboardFocus .welcomePanelContainer .welcomePanelButton:focus,.showKeyboardFocus .settingsPanelHeader .win-backbutton:focus,.showKeyboardFocus .findAlbumInfoBackButton button.win-command:focus,.showKeyboardFocus .acc-keyboardFocusTarget:focus,.showKeyboardFocus .acc-keyboardFocusTarget:active,.music .showKeyboardFocus .homeHubNowPlayingTile.acc-keyboardFocusTarget,.win-command.iconButton.acc-keyboardFocusTarget{outline-style:solid;outline-width:2px;outline-color:#fff}.showKeyboardFocus .welcomePanelContainer .welcomePanelButton:focus,.noContentPaneDetails .win-command.iconButton.acc-keyboardFocusTarget,.failedPanelDetails .win-command.iconButton.acc-keyboardFocusTarget,.failedPanelDetails .win-command.iconButton:focus,.downloadDetailsVideoButtons .win-command.iconButton:focus,.downloadDetailsVideoButtons .win-command.iconButton.active,.popOver button.iconButton.win-command,.popOver a.acc-keyboardFocusTarget:focus,.popOver a.acc-keyboardFocusTarget:active,.popOver .modifierControl.acc-keyboardFocusTarget:focus,.popOver .modifierControl.acc-keyboardFocusTarget:active,.popOver .mediaRatingControl.acc-keyboardFocusTarget:focus,.popOver .mediaRatingControl.acc-keyboardFocusTarget:active,.companionSearchButton .acc-keyboardFocusTarget:focus,.companionSearchButton .acc-keyboardFocusTarget:active,.showMoreLink.acc-keyboardFocusTarget:focus,.showMoreLink.acc-keyboardFocusTarget:active,.showKeyboardFocus .win-ui-light .acc-keyboardFocusTarget:focus,.showKeyboardFocus .win-ui-light .acc-keyboardFocusTarget:active,.showKeyboardFocus.win-ui-light .acc-keyboardFocusTarget:focus,.showKeyboardFocus.win-ui-light .acc-keyboardFocusTarget:active,.showKeyboardFocus .findAlbumInfoBackButton button.win-command:focus,.webHostDialogResizeCancelButton.dialogButton.defaultButton:focus,.webHostDialogResizeCancelButton.dialogButton.defaultButton:active,.popOver.movie .bodyContainer{outline-color:#000}.showKeyboardFocus .win-ui-dark .acc-keyboardFocusTarget:focus,.showKeyboardFocus .win-ui-dark .acc-keyboardFocusTarget:active,.showKeyboardFocus.win-ui-dark .acc-keyboardFocusTarget:focus,.showKeyboardFocus.win-ui-dark .acc-keyboardFocusTarget:active{outline-color:#fff}.collectionMusicSongsGallery .win-focusedoutline,.nowPlayingPlaylistGalleryView .win-focusedoutline,.nowPlayingPlaylistGalleryViewSnapped .win-focusedoutline{top:2px;left:2px;width:calc(100% - 4px);height:calc(100% - 4px)}.win-container:focus{outline-style:none}.showKeyboardFocus .acc-keyboardFocusTargetAfter:focus,.showKeyboardFocus .acc-keyboardFocusTargetAfter:active,.showKeyboardFocus .acc-keyboardFocusTargetAfterSmaller:focus,.showKeyboardFocus .acc-keyboardFocusTargetAfterSmaller:active{outline:none}.showKeyboardFocus .acc-keyboardFocusTargetAfter,.showKeyboardFocus .acc-keyboardFocusTargetAfterSmaller{position:relative}.showKeyboardFocus .acc-keyboardFocusTargetAfter:focus::after,.showKeyboardFocus .acc-keyboardFocusTargetAfter:active::after{outline-style:solid;outline-width:2px;outline-color:#fff;content:"";height:100%;width:100%;position:absolute;top:0;left:0}.showKeyboardFocus .acc-keyboardFocusTargetAfterSmaller:focus::after,.showKeyboardFocus .acc-keyboardFocusTargetAfterSmaller:active::after{outline-style:solid;outline-width:2px;outline-color:#fff;content:"";height:calc(100% - 8px);width:calc(100% - 8px);position:absolute;top:4px;left:4px}.showKeyboardFocus .hcrHubPanel:focus>.hcrOutline{outline-style:solid;outline-width:2px;outline-color:#fff;display:block}.showKeyboardFocus .bottomAppBarContainer .win-command.appBarIconButton.acc-keyboardFocusTarget,.showKeyboardFocus .bottomAppBarContainer .win-command.appBarIconButton.acc-keyboardFocusTarget:focus{border-style:solid;border-width:2px;border-color:#fff;margin-top:-2px;outline-width:0}.iconButton .win-commandimage:active{color:#ebebeb}.popOverContentContainer .panelFragmentLoading div.failedPanelContainer,.failedPanelContainer,.noContentPane,.popOver .win-listview .win-container:hover,.popOver .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container,.popOver .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container .win-selectionbackground,.popOver .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover,.popOver .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover .win-selectionbackground,.popOver .invoked .inlineDetailsMusicTrack,.downloadDetailsEpisodeList .win-listview .win-container:hover,.downloadDetailsEpisodeList .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container,.downloadDetailsEpisodeList .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container .win-selectionbackground,.downloadDetailsEpisodeList .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover,.downloadDetailsEpisodeList .win-selectionstylefilled.win-listview .win-viewport.win-vertical .win-selected.win-container:hover .win-selectionbackground,.downloadDetailsEpisodeList .invoked .inlineDetailsMusicTrack,.achievementsGallery .cardThumbnailButton,.companion .gamesCollection .cardThumbnailButton,.companionNowPlaying .cardThumbnailButton,.dashboardPanel .heroActivityTile .cardThumbnailButton,.hcrHubPanel,.actionTile,.popOver .leftColumn,.popOverLeftColumnPlaceholder,.homeNowPlayingTile,.artistHeaderThumbnail,.albumHeaderThumbnail,.compareGamesColumn,.companionSearchPanelContent,.dashboardPanel .panelFailed,.dashboardGridItemContent .thumbnailButton .imageContainer,.miniProfilePanelControlsSignedOut,.games .dashboardPanel .signedOutPanel,.games .dashboardPanel .playGameAction button,.dashboardMyMusic button.iconButton,.musicCollection .appCriticalNotification .win-flipview .win-navbutton:hover,.musicCollection .appCriticalNotification .win-flipview .win-navbutton:hover:active,.musicCollection .appInfoNotification .win-flipview .win-navbutton:hover,.musicCollection .appInfoNotification .win-flipview .win-navbutton:hover:active,.musicMarketplace .appCriticalNotification .win-flipview .win-navbutton:hover,.musicMarketplace .appCriticalNotification .win-flipview .win-navbutton:hover:active,.musicMarketplace .appInfoNotification .win-flipview .win-navbutton:hover,.musicMarketplace .appInfoNotification .win-flipview .win-navbutton:hover:active,.musicNewReleases .appCriticalNotification .win-flipview .win-navbutton:hover,.musicNewReleases .appCriticalNotification .win-flipview .win-navbutton:hover:active,.musicNewReleases .appInfoNotification .win-flipview .win-navbutton:hover,.musicNewReleases .appInfoNotification .win-flipview .win-navbutton:hover:active,.music .searchPage .appCriticalNotification .win-flipview .win-navbutton:hover,.music .searchPage .appCriticalNotification .win-flipview .win-navbutton:hover:active,.music .searchPage .appInfoNotification .win-flipview .win-navbutton:hover,.music .searchPage .appInfoNotification .win-flipview .win-navbutton:hover:active,.musicTopMusic .appCriticalNotification .win-flipview .win-navbutton:hover,.musicTopMusic .appCriticalNotification .win-flipview .win-navbutton:hover:active,.musicTopMusic .appInfoNotification .win-flipview .win-navbutton:hover,.musicTopMusic .appInfoNotification .win-flipview .win-navbutton:hover:active,.popOver .messageBubble,.searchHCR .cardThumbnailButton,.pickProviderItemContainer:hover,.pickProviderItemContainer:hover:active{background-color:#ebebeb}.messageBubblePointer{border-color:#ebebeb}.popOver .win-listview .win-container,.popOver .win-listview .win-container:hover,.downloadDetailsEpisodeList .win-listview .win-container,.downloadDetailsEpisodeList .win-listview .win-container:hover{outline-color:#ebebeb}.achievementsGallery .achievementByGame,.musicCollection .notificationContent,.musicMarketplace .notificationContent,.musicNewReleases .notificationContent,.musicTopMusic .notificationContent,.app-classicContainer.hideFromDisplay .mainHeader .notificationContent,.music .searchPage .notificationContent,.music .flexHubPage .notificationContent,.music .immersiveDetails .notificationContent,.musicCollection .appCriticalNotification .win-flipview .win-navbutton,.musicCollection .appInfoNotification .win-flipview .win-navbutton,.musicMarketplace .appCriticalNotification .win-flipview .win-navbutton,.musicMarketplace .appInfoNotification .win-flipview .win-navbutton,.musicNewReleases .appCriticalNotification .win-flipview .win-navbutton,.musicNewReleases .appInfoNotification .win-flipview .win-navbutton,.music .searchPage .appCriticalNotification .win-flipview .win-navbutton,.music .searchPage .appInfoNotification .win-flipview .win-navbutton,.musicTopMusic .appCriticalNotification .win-flipview .win-navbutton,.musicTopMusic .appInfoNotification .win-flipview .win-navbutton{background-color:#1b1b1b}.playPlaylistOverlay .label.subText,.pickProvidersMetadataText,.beaconCommentContainer .beaconCommentText,.iconButtonTwoLine button.iconButton.win-command .win-label.subtitle,.iconButtonWithSubtext button.iconButton.win-command .win-label.subtitle,.mediaPropertiesFlyoutTemplateFlyoutGrid .metadataTitle,.popOver .listContainerTitle,.popOver .inlineDetailsTvEpisodeDuration,.popOver .inlineDetailsTvEpisodeDate,.popOver .bodyContainer .title,.popOver .immersiveInlineTrackListAlbumName,.popOver .immersiveInlineTrackListDuration,.popOver .immersiveInlineTrackListArtistName,.popOver .subTitle,.popOver .collectionFilterText,.popOver .mediaStatusIconContainer,.popOver .mediaStatusAriaLabelContainer,.popOverList.verticalListHost .verticalListItem,.popOverList.verticalListHost .verticalListItem .secondaryText,.popOverList.verticalListHost .win-container.win-selected .verticalListItem .icon,.titleContainer .secondaryText,.achievementThumbnail .secondaryText,.companionHomeSearchBox,.cardThumbnailButton .textContainer,.homeNowPlayingTile.large .homeNowPlayingMetadataSubTitle,.homeNowPlayingTilePoster .homeNowPlayingMetadataSubTitle,.homeNowPlayingTilePoster .seasonEpisodeNumber,.homeNowPlayingTilePoster .homeNowPlayingMetadataClock,.homeNowPlayingTilePoster .homeNowPlayingMetadataDuration,.homeNowPlayingTilePoster .homeNowPlayingMetadataClockAndDuration,.popOver .gamerInfoSubText .friendInlineDisplayNameText,.popOver .gamerInfoSubText .friendInlineGamerScore,.hcrHubPanel .textContainer,.unearnedAchievement .achievementThumbnail .primaryText,.appBarNowPlayingMetadata .metadataDuration,.searchGalleryView .Modern .cardThumbnailButton .secondaryText,.searchGalleryView .Xbox .cardThumbnailButton .secondaryText,.dashboardPanel .failedPanelMessage,.previewBrowse p,.previewBrowseBar p,.popOverContainer .panelFragmentLoading .failedPanelMessage,.chatBubbleSecondaryLabel,.primaryPanelModifier.immersiveColumnPadding.seasonsSelector{color:#6b6b6b}.achievementGameDetailsThumbnail .imageContainer,.achievementThumbnail.cardThumbnailButton .imageHolder,.chatBubbleStatusImageContainer,.compareGameThumbnail .imageContainer,.companion .gamesCollection .cardThumbnailButton .imageContainer,.companionNowPlaying .cardThumbnailButton .imageContainer,.gamerHeaderTileImage,.overview .metaDataContainer>.imageContainer,.popOver .gamerPic img,.homeNowPlayingTile.large .homeNowPlayingArtLarge,.HCRCoverArt .imageHolder,.searchHCR .imageContainer,.videoFlexHubBigItem .imageContainer,.gamesFlexHubBigItem .imageContainer,.companion .related.activities .control-immersiveListViewItem .part-imageContainer,.relatedHeroItem .imageContainer,.related .control-immersiveListViewItem .part-imageHolder,.immersiveMoreGalleryView .imageHolder,.part-imageContainer img,.pickProviderThumbnail,.pickProviderItemImageContainer,.homeNowPlayingTilePoster.companion .homeNowPlayingArt{box-shadow:1px 1px 4px rgba(0,0,0,.2)}.actionListFlyout,.playbackOptionListFlyoutColors,.adCompanion,.selectArtistFlyoutGrid,.playPlaylistOverlay,.popOverContainer,.overlayContainer .popOver.friend{box-shadow:0 4px 40px rgba(0,0,0,.2)}.related .control-immersiveListViewItem .part-imageHolder img{box-shadow:none}.companion .dashboardGridItemContent:not(.thumbnailButtonGlyph) .primaryText,.dashboardGridItemContent .primaryTextBg,.dashboardGridItemContent .secondaryText,.dashboardGridItemContent .tertiaryText,.dashboardGridItemContent .quaternaryText,.previewBrowse .previewBrowseBar .buttonContainer{background-color:rgba(0,0,0,.85)}.music .homeNowPlayingTile .nowPlayingTileBackground:after,.games .dashboardGridItemContent.engaged .content{background-color:rgba(0,0,0,.36)}.immersiveFrame .overview .notificationItemContainer{border-top:1px solid #666;border-bottom:1px solid #666}.immersiveViewMorePopOverContentLayout>.headingRow{border-bottom:1px solid #666}.companionFullBleedNowPlayingTile .imageOverlay,.smartDJIcon:not(.smartDJNowPlaying),.immersiveHeroBackgroundImageOverlay,.activityOverlaySplashBackgroundImageImageOverlay,.videoAd .videoAdOverlayContentContainer,.related.activities .relatedListView .control-immersiveListViewItem:hover .activitiesOverlay,.folderVideoThumbnail .content{background-color:rgba(0,0,0,.54)}.immersiveHeroBackgroundImageContainer.mediatype-game .immersiveHeroBackgroundImageOverlay.fullBleed{background-color:transparent;background-image:linear-gradient(180deg,rgba(0,0,0,.54) 30%,#000 100%)}.userEngagementMessageTop{background-image:linear-gradient(180deg,#ededed 0%,#d4d4d4 100%)}.companionSearchTermsList{border-top:1px solid #747474}.games .achievementPageContainer .achievementGameDetailsControl,.compareHeaderTextContainer,.music .engagePanel .actionTile,.music .engagePanel .horizontalFlow,.heroActivityTile .cardThumbnailButton,.companionNowPlayingRelatedContent .cardThumbnailButton{background-image:linear-gradient(180deg,#232525 0%,#1a1a1a 100%)}.immersiveHeroContent button:hover,.immersiveHeroContent button:focus,.immersiveHeroContent button:hover:active,.notificationContainer button:not(.beaconLink):hover,.notificationContainer button:not(.beaconLink):focus,.notificationContainer button:not(.beaconLink):hover:active,.closeButton button:hover,.closeButton button:focus,.closeButton button:hover:active,.cloudNotification .clearIcon:hover button .win-commandimage.iconSpan,.cloudNotification .clearIcon:hover button .win-commandimage.iconSpanPressed,.cloudNotification .clearIcon:hover button.iconButton .win-commandimage.modifier,.music .musicBrandActionLink button:hover .actionLinkLabel,.headingRow .internalActionLink:focus .actionLinkLabel.label,.headingRow .internalActionLink:hover .actionLinkLabel.label{background-color:transparent;color:rgba(255,255,255,.8)}.chatBubble{background-image:linear-gradient(180deg,#ebebeb 0%,#b2b2b2 100%)}.chatBubblePointer{border-color:#b2b2b2}html[dir=rtl] .chatBubblePointer{border-right-color:#b2b2b2}button.horizontalPivotButton,button.verticalPivotButton{color:#b2b2b2}button:hover.horizontalPivotButton,button:hover.verticalPivotButton,.primaryPanelModifier .modifierControl .modifierDescription,.modifierControl:hover,.modifierControl.showingList,.dropDownDisabled .modifierSelectedItem{color:#a5a5a7}button:hover:active.horizontalPivotButton,button:hover:active.verticalPivotButton{color:#7c7d80}.companion .snappedIconContainer,.companion #htmlSnapped,.wecDialog .companionConnectionOverlayBackground,.companionConnectionDialog,.games .snappedIconContainer,.games #htmlSnapped,.dashboardGridItemContent.gamesThumb .thumbnailButton,.games .extendedSplashScreen,.companion .extendedSplashScreen,.games .control-upgradeTileContainer{background-color:#008a00}.music .snappedIconContainer,.dashboardGridItemContent.musicThumb .thumbnailButton,.music .extendedSplashScreen,.music .control-upgradeTileContainer{background-color:#d24726}.video .snappedIconContainer,.video #htmlSnapped,.dashboardGridItemContent.videoThumb .thumbnailButton,.video .extendedSplashScreen,.video .control-upgradeTileContainer{background-color:#ac193d}.findAlbumInfo .searchContainer:not(.searchFocused) .searchIcon{color:#bababa;background-color:transparent;border:2px solid #bababa}.findAlbumInfo .searchContainer:hover .searchIcon{color:#8f8f8f;background-color:transparent;border:2px solid #8f8f8f}.findAlbumInfo .searchContainer.searchFocused .searchIcon{color:#000;border:2px solid #666;background-color:transparent}.findAlbumInfo .searchContainer.searchFocused .searchIcon:hover{background-color:#dedede}.findAlbumInfo .win-container.win-selected .win-selectioncheckmark,.findAlbumInfo .win-container.win-selected .win-selectioncheckmarkbackground{display:none}.findAlbumInfo .win-container.win-selected .win-selectionbackground{background-color:#333}@media(-ms-high-contrast){.findAlbumInfo .searchIcon:hover{color:HighlightText;border-color:WindowText;background-color:Highlight}}.popOver.playlist .inlineCaretButtonText,.popOver.playlist .inlineCaretButtonIcon{color:ButtonText}.popOver.playlist button.win-command.iconButton,.playPlaylistOverlay button.win-command.iconButton{outline-color:ButtonText}body:not(.app-newmusic) .musicDialog.orange .dialogContainerBackground{background-color:#be5f26}body:not(.app-newmusic) .musicDialog.blue .dialogContainerBackground{background-color:#345a69}body:not(.app-newmusic) .musicDialog.green .dialogContainerBackground{background-color:#467a79}body:not(.app-newmusic) .musicDialog.pink .dialogContainerBackground{background-color:#972a50}.companionFullBleedNowPlayingTile .bottomProgress,.homeNowPlayingTilePoster.companion .bottomProgress{background-color:rgba(146,146,146,.5)}.control-watchProgress .watchProgress-progressBar,.win-ui-light .control-watchProgress .watchProgress-progressBar{color:#008a00;background-color:#cacaca}.win-ui-dark .control-watchProgress .watchProgress-progressBar{color:#008a00;background-color:#1f1f1f}.overlayAnchor.volumeContainer,.snapped .overlayAnchor.volumeContainer{background-color:transparent}.volumeContainer{background-color:#fff}.volumeIcon{border-bottom:1px solid #c2c2c2}.volumeIcon .win-commandring,.volumeIcon button:active .win-commandring{border-color:transparent}.volumeIcon .win-commandimage{color:#000}.volumeRange input[type=range].win-vertical::-ms-thumb{background-color:#000}.volumeRange input[type=range].win-vertical::-ms-fill-upper{background-color:#d4d4d4}.volumeRange input[type=range].win-vertical::-ms-fill-lower{background-color:#d24726}.games .volumeRange input[type=range].win-vertical::-ms-fill-lower{background-color:#008a00}.video .volumeRange input[type=range].win-vertical::-ms-fill-lower{background-color:#ac193d}.volumeRange input[type=range].win-vertical.mute::-ms-fill-lower{background-color:#c4c4c4}.volumeIcon button.iconButton.win-command .win-commandicon.win-commandring,.volumeIcon button.iconButton.win-command .win-commandicon.win-commandring:hover,.musicPage .verticalListItem .clearIcon button.iconButton.win-command .win-commandicon.win-commandring,.musicPage .verticalListItem .clearIcon button.iconButton.win-command .win-commandicon.win-commandring:hover{border-bottom-style:none;border-color:transparent;border-width:0;background-color:transparent}.volumeIcon button.iconButton .win-commandimage.iconSpanPressed,.volumeIcon button.iconButton:active:hover .win-commandimage.iconSpan,.volumeIcon button.iconButton:active:hover .win-commandimage.modifier{opacity:1}.showKeyboardFocus .volumeRange input[type=range].win-vertical:focus,.showKeyboardFocus .volumeIcon button.iconButton.win-command:focus{outline:2px solid #000}@media(-ms-high-contrast){.immersiveHeroSecondaryText,.immersiveSecondaryText,.albumThumbnail .thumbnailButtonSecondaryText,.appBarNowPlayingProgressPosition,.collectionMusicGalleryView .secondaryText,.music .marketplaceGalleryView .secondaryText,.collectionMessageGalleryView .secondaryText,.collectionVideoGallery .thumbnailButtonSecondaryText,.companionEventItemTime,.failedPanelMessage,.movieThumbnail .thumbnailButtonSecondaryText,.gamesThumbnail .thumbnailButtonSecondaryText,.tvSeriesThumbnail .thumbnailButtonSecondaryText,.horizontalPivotButton,.verticalPivotButton,.marketplaceGallery .win-groupheader,.collectionMusicGallery .win-groupheader,.collectionMessageGallery .win-groupheader,.popOver .win-item,.popOver,.videoDownloadManagerContent .win-item,.videoDownloadManagerContent,.aboutPageTitles,.achievementGameDetailsMetaDataText,.achievementGameDetailsProgressLabel,.achievementGameDetailsThumbnail,.activityGallery .win-item,.albumThumbnail,.win-item,.appBarNowPlayingMetadataSubTitle,.appBarNowPlayingMetadataTitle,.appBarTransportControlsMessageTitle,.chatBubblePrimaryLabel,.companionEventItemData,.dashboardGridItemContent,.emptyGalleryContainerImmersiveDetailsColor .failedPanelMessage,.emptyGalleryContainerImmersiveDetailsColor .failedPanelTitle,.errorFeedbackLink,.eventContainer,.failedPanelTitle,.friendsSummaryGallery .win-item,.homeNowPlayingMetadataClock,.homeNowPlayingMetadataTitle,.hubDestination,.hubStripPreviewTitle,.hubStripTitle,.dialogXenonTitle,.dashboardTitle,.nowPlayingBranding,.immersiveDetailsContainer .PrimaryNavigationButton.selected,.immersiveDetailsExtrasOverviewGeneral,.immersiveDetailsFeaturedSecondaryText,.immersiveDetailsHub,.immersiveDetailsOverviewActionButton,.immersiveDetailsTitle,.inlineDetailsAlbumImmersive .immersiveInlineTrackListDuration,.inlineDetailsAlbumImmersive .immersiveInlineTrackListArtistName,.inlineDetailsAlbumImmersive .immersiveInlineTrackListName,.inlineDetailsAlbumImmersive .immersiveInlineTrackListNumber,.inlineDetailsAlbumImmersive .inlineDetailsInline.label,.inlineDetailsAlbumImmersive .inlineDetailsPrimaryBold,.inlineDetailsAlbumImmersive .inlineDetailsPrimaryBold.inlineDetailsInline.inlineDetailsContentRating,.inlineDetailsAlbumImmersive .inlineDetailsSubHeader,.inlineDetailsAlbumImmersive .inlineDetailsTitle,.inlineDetailsAlbumImmersive,.inlineDetailsExtrasList .win-item,.inlineDetailsLeaderBoardEntry,.inlineDetailsOverviewActionButtonAlbum,.inlineDetailsOverviewActionButtonArtist,.inlineDetailsOverviewActionButtonEpisode,.inlineDetailsOverviewActionButtonGame,.inlineDetailsOverviewActionButtonMusicVideo,.inlineDetailsOverviewActionButtonTrack,.inlineDetailsOverviewActionButtonTv,.inlineDetailsOverviewActionButtonVideo,.inlineDetailsTvImmersive .inlineDetailsFullDescription,.inlineDetailsTvImmersive .inlineDetailsInline.label,.inlineDetailsTvImmersive .inlineDetailsPrimaryBold,.inlineDetailsTvImmersive .inlineDetailsPrimaryBold.inlineDetailsInline.inlineDetailsContentRating,.inlineDetailsTvImmersive .inlineDetailsTitle,.inlineDetailsTvImmersive .inlineDetailsTvEpisodeNumber,.inlineDetailsTvImmersive .inlineDetailsTvEpisodeDate,.inlineDetailsTvImmersive .inlineDetailsTvEpisodeTitle,.inlineDetailsTvImmersive,.inPlaceDetailsItemActionButton,.marketplaceGallery .win-groupheader,.marketplaceGamesPage .marketplaceGallery .win-item,.marketplaceMoviePage .marketplaceGallery .win-item,.marketplaceMusicPage .marketplaceGallery .win-item,.marketplaceTvPage .marketplaceGallery .win-item,.marketplaceVideoSearchPage .marketplaceGallery .win-item,.marketplaceGamesSearchPage .marketplaceGallery .win-item,.miniSocialControlLabel,.nowPlayingMetadataMainTitle,.nowPlayingMetadataSubTitle,.nowPlayingMetadataTime,.nowPlayingPlaylistEntryMainTitle,.nowPlayingPlaylistEntryMainTitleSnapped,.nowPlayingPlaylistEntrySubTitles,.nowPlayingPlaylistTitle,.nowPlayingText,.pageHeader,.panelTitle,.pickProvidersTitle,.PlayButton,.primaryPanelModifier,.searchGroupHeaderText,.searchGroupHeaderInPlaceText,.searchResultTitle,.seekBarFont,.selectedModifierPopupEntry,.settingsFeedbackOptionLabel,.settingsPanelContent,.settingsPanelTitle,.settingsSignIn .signInComplete,.settingsSignIn .signInError,.settingsSignIn .signInProgress,.snappedDetailsHubStrip .PrimaryNavigationButton.selected,.snappedDetailsHubStrip,.snappedDetailsTitle,.snappedNowPlayingMetadata,.socialSummaryGallery .win-item,.summaryCollectionTile,.tvSeriesHeaderDetailsButton,.WatchOnXboxButton,.adCompanionCloseButton,.adCompanionLabel,.whiteFontColor,.games .win-container:hover .compareGamesColumn .label,.adIconButton button.win-command .label,.videoAdText,.selectArtistEditBox input[type=text].editInput,.selectArtistEditBox input[type=text]:focus.editInput,.selectArtistEditBox input[type=text]:hover.editInput,.verticalListItem .smartDJIcon:not(.smartDJNowPlaying),.control-sendMessage .editBox textarea,.playPlaylistOverlay .win-template:hover .playlistItem .primaryText,.playPlaylistOverlay .win-template:hover .playlistItem .secondaryText{color:WindowText}.actionListHRSeparator,.screenshotLocators .win-template{background-color:WindowText}html,body,.companion .artistDetailsOverviewPanel .nowPlayingContainer,.immersiveDetailsContainer,.immersiveDetailsHub,.immersiveDetailsOverview,.immersiveDetailsOverview,.immersiveDetailsOverviewContainer,.immersiveDetailsTableOfContents,.inlineDetailsExtrasList,.nowPlayingBackground,.nowPlayingPlaylistControl,.snappedContainer .SearchEditBox,.overlayContainer,.inlineAlbum,.appBarNowPlayingProgressFill,.snappedNowPlayingProgress::-ms-fill,.companionHomeSearchBox,.seekbarEventTick,.immersiveHeroContent,.homeNowPlayingMetadata,.nowPlayingTransportControls,.adCompanion,.metadataContainer,.videoAd .videoAdOverlayContentContainer,.seekBarContainer{background-color:Window}.companion .related.activities .control-immersiveListViewItem:focus,.companion .related.activities .control-immersiveListViewItem:hover,a:active:hover,.switcherButtonControllerSelected,.switcherButtonControllerSelected:hover,.switcherButtonControllerSelected:active,.switcherButtonControllerSelected:active:hover,.switcherButtonBrowserSelected,.switcherButtonBrowserSelected:hover,.switcherButtonBrowserSelected:active,.switcherButtonBrowserSelected:active:hover,.showKeyboardFocus .beaconControlContainer button.win-command.iconButton:focus:-ms-keyboard-active .win-label,button.iconButton:disabled .win-commandimage.modifier,button.iconButton:disabled .win-commandimage.modifierPressed button.iconButton:disabled:active:hover .win-commandimage.iconSpanPressed,.popOver .inPlaceDetailsItemActions button.iconButton:disabled .win-commandimage.iconSpanPressed,.popOver .inPlaceDetailsItemActions button.iconButton:disabled:active:hover .win-commandimage.iconSpanPressed,.PrimaryNavigationButton:active:hover,button.iconButton:hover:active .win-commandimage,.win-ui-dark button.iconButton:hover:active .win-commandimage.iconSpanPressed,button.appBarIconButton:hover:active:not(:disabled) .win-commandimage,button.nowPlayingTransportControlsPlayPauseButton:hover:active .win-commandimage,button.nowPlayingTransportControlsSkipButton:hover:active .win-commandimage,button.iconButton.toggleButton.checked .win-commandimage.iconSpan,button.iconButton.toggleButton.checked .win-commandimage.iconSpanPressed,button.appBarIconButton.toggleButton.checked .win-commandimage.iconSpan,button.appBarIconButton.toggleButton.checked .win-commandimage.iconSpanPressed,.homeNowPlayingTile:hover:active .win-commandimage,.win-container.win-focused .companionSearchTermContainer .label,.companionSearchTermContainer:hover:active .label,.control-extrasListItem:active:hover,.games .engagePanel .actionTile button.win-command.iconButton:hover .win-label,.games .engagePanel .actionTile button.win-command.iconButton:active .win-label,.games .engagePanel .actionTile button.win-command.iconButton:hover:active .win-label,.games .engagePanel .actionTile button.win-command.iconButton:focus .win-label,.games .engagePanel .actionTile button.win-command.iconButton:hover .win-commandimage,.games .engagePanel .actionTile button.win-command.iconButton:active .win-commandimage,.games .engagePanel .actionTile button.win-command.iconButton:hover:active .win-commandimage,.games .engagePanel .actionTile button.win-command.iconButton:focus .win-commandimage{color:ButtonFace}.allButton,.BuyButton,.collectionAlbumGroupHeader,.collectionPlaylistGroupHeader,.collectionTVSeasonPage .win-groupheader,.collectionVideoGallery .win-groupheader,.DetailButton,.detailsTVGallery .win-item.win-selected,.externalActionLink,.friendsActionLink,.hubDestination,.immersiveDetailsExtrasOverviewBackground,.immersiveDetailsOverviewActionButton,.inlineDetailsContentRating,.inlineDetailsLeaderBoardEntry,.inlineDetailsOverviewActionButtonAlbum,.inlineDetailsOverviewActionButtonArtist,.inlineDetailsOverviewActionButtonEpisode,.inlineDetailsOverviewActionButtonGame,.inlineDetailsOverviewActionButtonMusicVideo,.inlineDetailsOverviewActionButtonTrack,.inlineDetailsOverviewActionButtonTv,.inlineDetailsOverviewActionButtonVideo,.inlineDetailsOverviewWideActionButton,.inPlaceDetailsItemActionButton,.internalActionLink,.marketplaceGallery .win-groupheader,.miniProfileControl,.miniProfileControl:active,.miniSocialGalleryContainer,.miniSocialGalleryContainer:active,.PlayButton,.playlistImageCollage .thumbnailButtonImage,.searchGroupHeader,.searchGroupHeaderInPlace,.summaryCollectionTile,.tvSeriesHeaderButtonFrame,.tvSeriesHeaderControl,.tvSeriesHeaderDetailsButton,.WatchOnXboxButton,.headingLink .internalActionLink:not(:disabled),.externalActionLink:active:hover,.externalActionLink:hover,.immersiveDetailsOverviewActionButton:active:hover,.immersiveDetailsOverviewActionButton:hover,.inlineDetailsLeaderBoardEntry:active:hover,.inlineDetailsLeaderBoardEntry:hover,.inlineDetailsOverviewActionButtonAlbum:active:hover,.inlineDetailsOverviewActionButtonAlbum:hover,.inlineDetailsOverviewActionButtonArtist:active:hover,.inlineDetailsOverviewActionButtonArtist:hover,.inlineDetailsOverviewActionButtonEpisode:active:hover,.inlineDetailsOverviewActionButtonEpisode:hover,.inlineDetailsOverviewActionButtonGame:active:hover,.inlineDetailsOverviewActionButtonGame:hover,.inlineDetailsOverviewActionButtonMusicVideo:active:hover,.inlineDetailsOverviewActionButtonMusicVideo:hover,.inlineDetailsOverviewActionButtonTrack:active:hover,.inlineDetailsOverviewActionButtonTrack:hover,.inlineDetailsOverviewActionButtonTv:active:hover,.inlineDetailsOverviewActionButtonTv:hover,.inlineDetailsOverviewActionButtonVideo:active:hover,.inlineDetailsOverviewActionButtonVideo:hover,.inlineDetailsOverviewWideActionButton:active:hover,.inlineDetailsOverviewWideActionButton:hover,.inPlaceDetailsItemActionButton:active:hover,.inPlaceDetailsItemActionButton:hover,.internalActionLink:hover,.miniSocialGalleryContainer:active:hover,.miniSocialGalleryContainer:hover,.actionListFlyout,.appBarTransportControlsMessage,.bottomAppBar,.companionEventItemContainer,.companionSearchTermContainer,.eventContainer,.adThumbnail .primaryText.label,.dialogContainerBackground,.iconButton .win-commandicon:active,.nowPlayingTileBackground,.dashboardGridItemContent .primaryText,.dashboardGridItemContent .secondaryText,.dashboardGridItemContent .tertiaryText,.dashboardGridItemContent .quaternaryText,.homeNowPlayingTile,.iconButton .win-commandicon:active,.inlineDetailsMoveTrackDownButton button.iconButton[disabled] .win-commandring,.inlineDetailsMoveTrackDownButton button.iconButton[disabled]:hover .win-commandring,.inlineDetailsMoveTrackUpButton button.iconButton[disabled] .win-commandring,.inlineDetailsMoveTrackUpButton button.iconButton[disabled]:hover .win-commandring,.nowPlayingTileBackground,button.iconButton .win-commandring,.imageChatBubble,.homeNowPlayingMetadataAndProgress{background-color:ButtonFace}.messageButton,.messageEditBox .editMultiline,.recipientEditBox .editInput,.messageButton:hover,.immersiveDetailsTableOfContents,.messageButton.disabled:hover,button.iconButton:hover:active .win-commandimage,button.appBarIconButton:hover:active:not(:disabled) .win-commandimage,button.nowPlayingTransportControlsPlayPauseButton:hover:active .win-commandimage,button.nowPlayingTransportControlsSkipButton:hover:active .win-commandimage{border-color:ButtonFace}.companion .related.activities .control-immersiveListViewItem,.music .playPlaylistOverlay .inlineCaretButton,.music a,.games a,.video a,.companion a,button.iconButton.hideAdorner:active:hover .win-commandimage.iconSpanPressed,.appSignIn .signInRetry:hover,.messageButton:hover,.settingsWebLinkText:hover,.actionButtonLabel,.actionLinkLabel.label,.actionLinkContainer .icon,.allButton,.beaconLink,.BuyButton,.collectionGamesGallery .win-item,.collectionMusicGallery .win-groupheader,.collectionMusicGallery .win-item,.collectionMusicGalleryView .win-commandimage,.collectionMusicGalleryView .win-label,.music .marketplaceGalleryView .win-commandimage,.music .marketplaceGalleryView .win-label,.collectionMessageGallery .win-groupheader,.collectionMessageGallery .win-item,.collectionMessageGalleryView .win-commandimage,.collectionMessageGalleryView .win-label,.collectionMusicSongsGallery .win-groupheader,.collectionPlaylistGallery .win-item,.collectionTVEpisodePage .win-groupheader,.collectionTVEpisodeSeriesPage .win-groupheader,.collectionTVSeasonPage .win-groupheader,.collectionTVSeasonSeriesPage .win-groupheader,.collectionVideoGallery .win-groupheader,.collectionVideoGallery .win-item,.videoAdOverlayContentContainer .win-label,.DetailButton,.immersiveTableOfContentsItemContainer .label,.cardThumbnailButton .primaryText,.cardThumbnailButton .secondaryText,.cardThumbnailButton .tertiaryText,.cardThumbnailButton .quaternaryText,.cardThumbnailButton .activityTitleText,.detailsAlbumsGallery .thumbnailButtonPrimaryText,.detailsGamesGallery .thumbnailButtonPrimaryText,.detailsTVGallery .thumbnailButtonPrimaryText,.achievementsGallery .PrimaryText,.dialogCaption,.dialogContent,.dialogLink,.inlineDetailsTvContainer .inlineEpisodeName,.inlineDetailsTvContainer .inlineEpisodeNumber,.inlineDetailsTvContainer .inlineEpisodeDuration,.playlistItemTemplate .nowPlayingPlaylistEntrySubTitle1,.playlistItemTemplate .nowPlayingPlaylistEntryDuration,.internalActionLink .label,button.iconButton .win-commandimage,button.iconButton .win-commandimage.iconSpan,.win-ui-dark button.iconButton .win-commandimage.iconSpan,button.appBarIconButton:not(:disabled) .win-commandimage,button.playPauseIconButton .win-commandimage,button.nowPlayingTransportControlsPlayPauseButton .win-commandimage,button.nowPlayingTransportControlsSkipButton .win-commandimage,.homeNowPlayingMetadata .win-commandimage,.homeHubNowPlayingTile .homeNowPlayingPlayButton .win-commandicon.win-commandring .win-commandimage,.hcrHubPanel .primaryText,.hcrHubPanel .secondaryText,.chatBubblePrimaryLabel,.chatBubbleSecondaryLabel,.compareAchievementSecondaryText,.companionSearchTermContainer .label,.extrasItem,.inlineCaretButtonText,.inlineCaretButtonIcon,.verticalListItem .icon,.notificationContent .inlineCaretButton:hover .infoNotificationSubTitle.inlineCaretButtonText{color:ButtonText}a:active:hover,.switcherButtonControllerSelected,.switcherButtonControllerSelected:hover,.switcherButtonControllerSelected:active,.switcherButtonControllerSelected:active:hover,.switcherButtonBrowserSelected,.switcherButtonBrowserSelected:hover,.switcherButtonBrowserSelected:active,.switcherButtonBrowserSelected:active:hover,.showKeyboardFocus .beaconControlContainer button:focus:-ms-keyboard-active,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:focus:-ms-keyboard-active,.companionSearchButton button.win-command.iconButton.acc-keyboardFocusTarget:-ms-keyboard-active .win-commandring,.seekBarTrackBackground,.beaconLinkContainer:active .beaconLink,button.iconButton:hover:active .win-commandring,.panelTitle .internalActionLink:active:hover:not(:disabled),button.appBarIconButton:hover:active:not(:disabled) .win-commandring,button.nowPlayingTransportControlsPlayPauseButton:hover:active .win-commandring,button.nowPlayingTransportControlsSkipButton:hover:active .win-commandring,button.iconButton.toggleButton.checked .win-commandring,button.appBarIconButton.toggleButton.checked .win-commandring,.homeHubNowPlayingTile .homeNowPlayingPlayButton button:hover:active .win-commandicon.win-commandring,.closeButton button:hover:active,.closeLink button:hover:active,.companionSearchTermContainer:hover:active,.extrasItem:hover:active,.musicOverlay .seekBarThumb{background-color:ButtonText}.companionSearchButton button.win-command .win-commandring,.webHostIFrame,.cardThumbnailButton,.win-commandring,.win-commandicon.win-commandring,.homeHubNowPlayingTile .homeNowPlayingPlayButton .win-commandicon.win-commandring,.homeHubNowPlayingTile .homeNowPlayingPlayButton button:hover:active .win-commandicon.win-commandring,.inlineDetailsMoveTrackDownButton button.iconButton .win-commandring,.chatBubblePointer,.overlayContainer{border-color:ButtonText}html[dir=rtl] .chatBubblePointer{border-right-color:ButtonText}.music a:hover,.music a:focus,.games a:hover,.games a:focus,.video a:hover,.video a:focus,.companion a:hover,.companion a:focus,.showKeyboardFocus .webLinkContainer a:focus,.inlineDetailsExtrasList .win-item:hover,.win-container.win-focused .compareAchievementsItemContainer .label,.win-container.win-selected .compareAchievementsItemContainer .label,.compareAchievementsItemContainer .control-immersiveListViewItem.acc-keyboardFocusTarget,.win-container.win-focused .compareAchievementsItemContainer .control-immersiveListViewItem,.win-container.win-selected .compareAchievementsItemContainer .control-immersiveListViewItem,.win-container.win-focused .control-immersiveListViewItem,.relatedListView .control-immersiveListViewItem:focus,.relatedListView .control-immersiveListViewItem:hover,.win-container.invoked .control-immersiveListViewItem,.win-container .win-template.invoked .control-immersiveListViewItem,.control-immersiveListViewItem.acc-keyboardFocusTarget:hover,.control-extrasListItem:hover,.control-extrasListItem.focus,.win-container.win-focused .inlineDetailsTvEpisode,.win-container:hover .inlineDetailsTvEpisode,.inlineDetailsTvEpisode:hover .inlineDetailsTvEpisodeNumber,.win-container.win-focused .inlineDetailsTvEpisode .inlineDetailsTvEpisodeNumber,.inlineDetailsTvEpisode:hover .inlineDetailsTvEpisodeTitle,.win-container.win-focused .inlineDetailsTvEpisode .inlineDetailsTvEpisodeTitle,.inlineDetailsTvEpisode:hover .inlineDetailsTvEpisodeDate,.win-container.win-focused .inlineDetailsTvEpisode .inlineDetailsTvEpisodeDate,.modifierPopupEntry:hover .modifierPopupEntryLabel,.modifierPopupEntry:focus .modifierPopupEntryLabel,.playlistItemTemplate:hover .nowPlayingPlaylistEntryMainTitle,.win-container.win-focused .nowPlayingPlaylistEntryMainTitle,.playlistItemTemplate:hover .nowPlayingPlaylistEntrySubTitle1,.win-container.win-focused .nowPlayingPlaylistEntrySubTitle1,.playlistItemTemplate:hover .nowPlayingPlaylistEntryDuration,.win-container.win-focused .nowPlayingPlaylistEntryDuration,.PrimaryNavigationButton.selected,.internalActionLink:focus:not(:disabled) .actionLinkLabel.label,.internalActionLink:hover:not(:disabled) .actionLinkLabel.label,.internalActionLink:hover .actionLinkContainer .icon,.internalActionLink:focus .actionLinkContainer .icon,.snappedDetailsHubStrip .PrimaryNavigationButton.selected,.horizontalPivotButton.selected,.verticalPivotButton.selected,.win-container .primaryText .label,.beaconLink:focus,.beaconLink:hover,.cardThumbnailButton:hover .primaryText,.cardThumbnailButton:hover .secondaryText,.cardThumbnailButton:hover .tertiaryText,.cardThumbnailButton:hover .quaternaryText,.cardThumbnailButton:hover .activityTitleText,.cardThumbnailButton.acc-keyboardFocusTarget .primaryText,.cardThumbnailButton.acc-keyboardFocusTarget .secondaryText,.cardThumbnailButton.acc-keyboardFocusTarget .tertiaryText,.cardThumbnailButton.acc-keyboardFocusTarget .quaternaryText,.cardThumbnailButton.acc-keyboardFocusTarget .activityTitleText,.musicFlexHubBigItem:focus .primaryText,.musicFlexHubBigItem:focus .secondaryText,.closeButton button:hover .icon,.closeButton button:focus .icon,.closeButton button:hover:active .icon,.closeButton:focus .closeLink .icon,.closeButton:hover .closeLink .icon,.closeButton:hover:active .closeLink .icon,.thumbnailButton.acc-keyboardFocusTarget,.albumList .win-selected .primaryText,.albumList .win-selected .secondaryText,.win-container.win-selected .cardThumbnailButton .primaryText,.win-container.win-selected .cardThumbnailButton .secondaryText,.win-container.win-selected .cardThumbnailButton .tertiaryText,.win-container.win-selected .cardThumbnailButton .quaternaryText,.win-container.win-focused .cardThumbnailButton .primaryText,.win-container.win-focused .cardThumbnailButton .secondaryText,.win-container.win-focused .cardThumbnailButton .tertiaryText,.win-container.win-focused .cardThumbnailButton .quaternaryText,.win-container.win-focused .win-item.win-template .primaryText,.win-container.win-focused .win-item.win-template .secondaryText,.win-container.win-selected .verticalListItem .primaryText,.win-container.win-selected .verticalListItem .secondaryText,.win-container.invoked .verticalListItem .primaryText,.win-container.invoked .verticalListItem .secondaryText,.win-container .win-item.invoked .verticalListItem .primaryText,.win-container .win-item.invoked .verticalListItem .secondaryText,.popOverList .win-container.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListName,.popOverList .win-container.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListDurationStatus,.popOverList .win-container.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListAlbumName,.popOverList .win-container.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListNumber,.popOverList .win-container.invoked .inlineDetailsMusicTrack .inlineTrackListStatusIcon,.popOverList .win-container.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListArtistName,.popOverList .win-container:hover .inlineDetailsMusicTrack .inlineTrackListStatusIcon,.popOverList .win-container.invoked .iconButton .win-label.label,.popOverList .win-container .win-template.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListName,.popOverList .win-container .win-template.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListDurationStatus,.popOverList .win-container .win-template.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListAlbumName,.popOverList .win-container .win-template.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListNumber,.popOverList .win-container .win-template.invoked .inlineDetailsMusicTrack .immersiveInlineTrackListArtistName,.popOverList .win-container .win-template.invoked .win-label.label,.popOverList .win-container:hover .popOverCloudStateIcon,.popOverList .win-container.win-selected .popOverCloudStateIcon,.popOverList .win-template:focus .popOverCloudStateIcon,.popOverList .win-template:focus .inCollectionIcon,.popOverList .win-selected .inCollectionIcon,.immersiveTableOfContentsItemContainer:hover .label,.immersiveTableOfContentsItemContainer>button:focus,.win-container.win-selected .immersiveInlineTrackListNumber,.win-container.win-selected .immersiveInlineTrackListName,.win-container.win-selected .immersiveInlineTrackListDurationStatus,.win-container.win-selected .immersiveInlineTrackListAlbumName,.win-container.win-selected .verticalListItem .icon,.win-container.win-selected .immersiveInlineTrackListArtistName,.win-container.win-focused .immersiveInlineTrackListNumber,.win-container.win-focused .immersiveInlineTrackListName,.win-container.win-focused .immersiveInlineTrackListDurationStatus,.win-container.win-focused .immersiveInlineTrackListAlbumName,.win-container.win-focused .verticalListItem .icon,.win-container.win-focused .immersiveInlineTrackListArtistName,.win-container.win-focused .companionSearchTermContainer .label,.companionSearchTermContainer:hover .label,.win-container:hover .label,.win-container.win-focused .win-item.win-template .win-label.label,.win-container.invoked .win-item.win-template .win-label.label,.win-container.invoked .win-item.win-template,.win-container .win-template.invoked,.win-container .win-template.invoked .win-label.label,.immersiveMoreGalleryView .win-container.win-focused .control-immersiveListViewItem .win-label.label,.musicPage .win-container.win-focused .simpleHeader,.verticalListHost .win-container.win-focused .simpleHeader,.inboxPage .win-container.win-focused .simpleHeader,.musicPage .win-container:hover .simpleHeader,.inboxPage .win-container:hover .simpleHeader,.verticalListHost .win-container:hover .simpleHeader,button.iconButton:hover .win-commandimage,.win-ui-dark button.iconButton:hover .win-commandimage.iconSpan,button.iconButton.acc-keyboardFocusTarget .win-commandimage,.showKeyboardFocus button.iconButton.win-command:focus .win-commandimage,button.appBarIconButton:hover:not(:disabled) .win-commandimage,button.appBarIconButton:focus .win-commandimage,button.nowPlayingTransportControlsPlayPauseButton:hover .win-commandimage,button.nowPlayingTransportControlsSkipButton:hover .win-commandimage,.achievementGameDetailsButton:hover .actionLinkLabel,.homeNowPlayingTile.win-ui-dark:hover .homeNowPlayingPlayButton .win-commandimage,.homeNowPlayingTile.win-ui-dark:hover .opportunityIconButton .win-commandimage,.nowPlayingOverlaysContainer.win-ui-dark:hover .homeNowPlayingPlayButton .win-commandimage,.homeNowPlayingTile.win-ui-dark:hover .homeNowPlayingErrorButton .win-commandimage,.homeNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget .homeNowPlayingPlayButton .win-commandimage,.homeNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget .opportunityIconButton .win-commandimage,.nowPlayingOverlaysContainer.win-ui-dark.acc-keyboardFocusTarget .homeNowPlayingPlayButton .win-commandimage,.homeNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget .homeNowPlayingErrorButton .win-commandimage,.homeNowPlayingTile.acc-keyboardFocusTarget .win-commandimage,.homeHubNowPlayingTile.win-ui-dark:hover .nowPlayingTransportControlsPlayPauseButton .win-commandimage,.homeHubNowPlayingTile.win-ui-dark:hover .homeNowPlayingErrorButton .win-commandimage,.homeHubNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget .nowPlayingTransportControlsPlayPauseButton .win-commandimage,.homeHubNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget .homeNowPlayingErrorButton .win-commandimage,.homeHubNowPlayingTile.acc-keyboardFocusTarget .win-commandimage,.homeHubNowPlayingTile .homeNowPlayingPlayButton:hover .win-commandicon.win-commandring .win-commandimage,.hcrHubPanel:hover .primaryText,.hcrHubPanel:focus .primaryText,.hcrHubPanel:hover .secondaryText,.hcrHubPanel:focus .secondaryText,.win-template:active:hover>.miniProfileControl,.win-template:hover>.miniProfileControl,.actionButtonFlyoutButton:hover .label,.playbackOptionFlyoutButton:hover .label,.win-template.acc-keyboardFocusTarget .chatBubblePrimaryLabel,.win-template.acc-keyboardFocusTarget .chatBubbleSecondaryLabel,.dashboardGridItemContent .thumbnailButton:hover .dashboardTileIcon,.dashboardGridItemContent .thumbnailButton:hover .primaryText,.dashboardGridItemContent .thumbnailButton:hover .secondaryText,.dashboardGridItemContent .thumbnailButton:hover .tertiaryText,.dashboardGridItemContent .thumbnailButton:hover .quaternaryText,.homeNowPlayingTile.acc-keyboardFocusTarget .homeNowPlayingMetadataClock,.homeNowPlayingTile.acc-keyboardFocusTarget .homeNowPlayingMetadataTitle,.homeNowPlayingTile.acc-keyboardFocusTarget .homeNowPlayingMetadataSubTitle,.homeNowPlayingTile.acc-keyboardFocusTarget .nowPlayingText,.homeHubNowPlayingTile:hover .homeNowPlayingMetadataClock,.homeHubNowPlayingTile:hover .homeNowPlayingMetadataTitle,.homeHubNowPlayingTile:hover .homeNowPlayingMetadataSubTitle,.homeHubNowPlayingTile:hover .homeNowPlayingMetadataDuration,.homeHubNowPlayingTile:hover .nowPlayingText,.homeHubNowPlayingTile:focus .homeNowPlayingMetadataClock,.homeHubNowPlayingTile:focus .homeNowPlayingMetadataTitle,.homeHubNowPlayingTile:focus .homeNowPlayingMetadataSubTitle,.homeHubNowPlayingTile:focus .homeNowPlayingMetadataDuration,.homeHubNowPlayingTile:focus .nowPlayingText,.playPlaylistOverlay .acc-keyboardFocusTarget,.win-container.invoked .verticalListStatusIcon,.win-container.win-focused .verticalListStatusIcon,.win-container:hover .verticalListStatusIcon,.win-container.win-focused .inlineGlyph,.win-container:hover .inlineGlyph,.win-container.win-focused .searchGroupHeaderInPlaceText,.headingLink .internalActionLink:focus:not(:disabled),.headingLink .internalActionLink:hover:not(:disabled),.inlineCaretButton:hover .inlineCaretButtonText,.inlineCaretButton:hover .inlineCaretButtonIcon,.inlineCaretButton:focus .inlineCaretButtonText,.inlineCaretButton:focus .inlineCaretButtonIcon,.videoAd:hover,.videoAd:focus,.verticalListItem:hover .icon,.win-container.win-focused .verticalListItem .icon,.win-container.win-selected .verticalListItem .icon,.extrasItem:hover,.extrasItem:focus,.albumListItem:active .primaryText.label,.albumListItem:focus .primaryText,.games .engagePanel .actionTile button.win-command.iconButton:hover,.games .engagePanel .actionTile button.win-command.iconButton:active,.games .engagePanel .actionTile button.win-command.iconButton:hover:active,.games .engagePanel .actionTile button.win-command.iconButton:hover .win-commandimage,.games .engagePanel .actionTile button.win-command.iconButton:active .win-commandimage,.games .engagePanel .actionTile button.win-command.iconButton:hover:active .win-commandimage,.splitHeroRotatorViewAll .inlineCaretButtonText,.splitHeroRotatorViewAll .inlineCaretButtonIcon{color:HighlightText}.companion .related.activities .control-immersiveListViewItem:hover,a:hover,a:focus,.showKeyboardFocus .webLinkContainer a:focus,.albumThumbnail:hover,.closeButton:hover .closeLink,.closeButton .closeLink:focus,.modifierPopupEntry:hover,.modifierPopupEntry:focus,.PrimaryNavigationButton.selected,.beaconLink:focus,.panelTitle .internalActionLink:focus:not(:disabled),.panelTitle .internalActionLink:hover:not(:disabled),.horizontalPivotButton.selected,.verticalPivotButton.selected,button.iconButton:hover .win-commandring,button.iconButton.acc-keyboardFocusTarget .win-commandring,.showKeyboardFocus button.iconButton.win-command:focus .win-commandring,button.appBarIconButton:hover:not(:disabled) .win-commandring,button.appBarIconButton:focus .win-commandring,button.nowPlayingTransportControlsPlayPauseButton:hover .win-commandring,button.nowPlayingTransportControlsSkipButton:hover .win-commandring,.prevNextIconButton:hover .win-commandicon.win-commandring,.achievementGameDetailsButton:hover .internalActionLink,.win-template.acc-keyboardFocusTarget .chatBubble,.homeNowPlayingTile:hover .win-commandring,.homeNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget .win-commandring,.popOverList.verticalListHost .win-container.invoked,.popOverList.verticalListHost .win-container.win-focused,.popOverList.verticalListHost .win-container:hover,.popOverList.verticalListHost .win-container .win-template.invoked,.popOverList .win-listview .win-container.invoked,.popOverList .win-listview .win-container.win-focused,.popOverList .win-listview .win-container:hover,.popOverList .win-listview .win-container .win-template.invoked,.immersiveTableOfContentsItemContainer:hover,.immersiveTableOfContentsItemContainer>button:focus,.downloadDetailsEpisodeList .win-container:hover,.downloadDetailsEpisodeList .win-container.win-focused,.inlineDetailsEpisodeList .win-container:hover,.inlineDetailsEpisodeList .win-container.win-focused,.win-container.invoked,.win-container .win-template.invoked,.playlistItemTemplate:hover,.win-container.win-focused .playlistItemTemplate,.miniProfileControl:hover,.cardThumbnailButton:hover,.cardThumbnailButton.acc-keyboardFocusTarget,.musicFlexHubBigItem:focus .cardThumbnailButton,.win-container.win-selected .cardThumbnailButton,.win-container.win-focused .cardThumbnailButton,.win-container.win-selected .win-item.win-template,.achievementItemContainer .win-container:hover,.achievementItemContainer .win-container.win-focused,.music .marketplaceGallery .win-container:hover,.musicSubscriptionLink:hover .internalActionLink,.musicSubscriptionLink .internalActionLink:focus,.collectionFilterLink:hover .internalActionLink,.collectionFilterLink .internalActionLink:focus,.relatedActionLink:hover .internalActionLink,.relatedActionLink .internalActionLink:focus,.musicBrandActionLink:hover .internalActionLink,.musicBrandActionLink .internalActionLink:focus,.win-container.win-selected .verticalListItem,.win-container.win-focused .verticalListItem,.win-container.invoked .verticalListItem,.immersiveMoreGalleryView .control-immersiveListViewItem:focus,.immersiveMoreGalleryView .win-container.win-focused .control-immersiveListViewItem,.immersiveMoreGalleryView .control-immersiveListViewItem:hover,.relatedListView .control-immersiveListViewItem:focus,.relatedListView .control-immersiveListViewItem:hover,.win-container.win-focused .companionSearchTermContainer,.companionSearchTermContainer:hover,.searchGroupHeaderInPlace:hover,.win-container.win-focused .searchGroupHeaderInPlace,.win-container.win-focused .win-template.seasons,.win-template .miniProfileControl:hover,.win-template .miniProfileControl:hover:active,.dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .primaryTextBg,.dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .primaryText,.dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .secondaryText,.dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .tertiaryText,.dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .quaternaryText,.dashboardGridItemContent .thumbnailButton:hover .primaryTextBg,.dashboardGridItemContent .thumbnailButton:hover .primaryText,.dashboardGridItemContent .thumbnailButton:hover .secondaryText,.dashboardGridItemContent .thumbnailButton:hover .tertiaryText,.dashboardGridItemContent .thumbnailButton:hover .quaternaryText,.hcrHubPanel:hover,.hcrHubPanel:focus,.homeNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget .homeNowPlayingMetadataAndProgress,.homeNowPlayingTile.win-ui-dark:hover .homeNowPlayingMetadataAndProgress,.homeNowPlayingTile.win-ui-dark.acc-keyboardFocusTarget,.headingLink .internalActionLink:focus:not(:disabled),.headingLink .internalActionLink:hover:not(:disabled),.inlineCaretButton.nowPlayingMetadataShowPlaylistButton:hover,.inlineCaretButton:focus,.videoAdLearnMoreLink.inlineCaretButton:hover,.videoAd:focus,.videoAdCloseButton button.win-command:hover .win-commandicon.win-commandring,.videoAdCloseButton button.win-command:active .win-commandicon.win-commandring,.videoAdCloseButton button.win-command:hover:active .win-commandicon.win-commandring,.control-extrasListItem:hover,.control-extrasListItem:focus,.companionFullBleedNowPlayingTile:hover .textContainer,.companionHomeNowPlayingTileContainer:focus .companionFullBleedNowPlayingTile .textContainer,.homeNowPlayingTilePoster.companion:hover,.games .engagePanel .actionTile button.win-command.iconButton:hover,.games .engagePanel .actionTile button.win-command.iconButton:active,.games .engagePanel .actionTile button.win-command.iconButton:hover:active,.games .engagePanel .actionTile button.win-command.iconButton:focus,.video .seekBarTrackBackground,.cloudNotification:hover,.screenshotLocators .win-template .screenshotLocatorSelected{background-color:Highlight}.showKeyboardFocus button.iconButton.win-command:focus .win-commandring,.homeNowPlayingTile:hover .win-commandring,.homeNowPlayingTile.acc-keyboardFocusTarget .win-commandring{border-color:HighlightText}button.iconButton:hover .win-commandring,iconButtonHost:hover .win-commandring,button.appBarIconButton:hover:not(:disabled) .win-commandring,button.appBarIconButton:focus .win-commandring{border-color:Highlight}.comboUnavailableLabel,.selectArtistAutoCompleteLabel,.inlineDetailsMoveTrackDownButton button.iconButton[disabled] .win-commandimage.iconSpan,.inlineDetailsMoveTrackDownButton button.iconButton[disabled] .win-commandimage.iconSpanPressed,.inlineDetailsMoveTrackUpButton button.iconButton[disabled] .win-commandimage.iconSpan,.inlineDetailsMoveTrackUpButton button.iconButton[disabled] .win-commandimage.iconSpanPressed{color:GrayText}.seekBarFill,.bottomProgress::-ms-fill{background-color:GrayText}.inlineDetailsMoveTrackDownButton button.iconButton[disabled] .win-commandring,.inlineDetailsMoveTrackDownButton button.iconButton[disabled]:hover .win-commandring,.inlineDetailsMoveTrackDownButton button.iconButton[disabled] .win-command.iconButton:active .win-commandring .inlineDetailsMoveTrackUpButton button.iconButton[disabled] .win-commandring,.inlineDetailsMoveTrackUpButton button.iconButton[disabled]:hover .win-commandring,.inlineDetailsMoveTrackUpButton button.iconButton[disabled] .win-command.iconButton:active .win-commandring{border-color:GrayText}.companionSearchButton .acc-keyboardFocusTarget:focus,.popOver a.acc-keyboardFocusTarget:focus,.popOver a.acc-keyboardFocusTarget:active,.showKeyboardFocus .win-ui-dark .acc-keyboardFocusTarget:focus,.showKeyboardFocus .win-ui-dark .acc-keyboardFocusTarget:active,.showKeyboardFocus.win-ui-dark .acc-keyboardFocusTarget:focus,.showKeyboardFocus.win-ui-dark .acc-keyboardFocusTarget:active{outline-color:ButtonText}.popOver .win-template.invoked button.iconButton.win-command{outline-color:ButtonFace}.acc-backgroundTransparent,.video .nowPlayingTransportControls,button.iconButton.hideAdorner:active:hover .win-commandring,.companion .gamesCollection .cardThumbnailButton:after,.companionNowPlaying .cardThumbnailButton:after,button.appBarIconButton:focus,button.appBarIconButton:hover,.refreshButtonImage:hover,.cardThumbnailButton,.collectionMusicGalleryView .win-item.win-template:hover,.music .marketplaceGalleryView .win-item.win-template:hover,.collectionMessageGalleryView .win-item.win-template:hover,button.iconButton.win-command:hover,.win-ui-dark button.iconButton.win-command:hover,.musicPage .win-container .verticalListCellMain,.inboxPage .win-container .verticalListCellMain,.win-ui-dark .verticalListHost .win-container .verticalListCellMain,.iconButton.internalActionLink,.dashboardPanel .homeNowPlayingTile:after,.dashboardPanel .homeNowPlayingTilePoster:after,.dashboardGridItemContent .thumbnailButton:after,.companion .dashboardPanel.gamesCollection .cardThumbnailButton:after,.dashboardPanel.companionNowPlaying .cardThumbnailButton:after,.flexibleItemsControlItemContainer .cardThumbnailButton:after,.homeNowPlayingTilePoster.companion.musicVisualizationVisible .nowPlayingTileBackground:after,.music .homeNowPlayingTile .nowPlayingTileBackground:after,.cardThumbnailButton .imageHolder,.pickProviderItemContainer:after,.companionFullBleedNowPlayingTile.fullBleedTileVisible:after,.modifierControl:before,.extras .control-extrasListItem:after,.relatedHeroItem:after,.related.albums .relatedListView .control-immersiveListViewItem:after,.related.activities .relatedListView .control-immersiveListViewItem:after,.related.games .relatedListView .control-immersiveListViewItem:after,.related.movies .relatedListView .control-immersiveListViewItem:after,.related.seasons .relatedListView .control-immersiveListViewItem:after,.video .metadataContainer,.video .seekBarContainer{background-color:transparent}button.win-command.appBarIconButton.hideAdorner .win-commandring,button.iconButton.hideAdorner .win-commandring,.appBarTransportControlsXboxContainer .appBarIconButton .win-commandring,.appBarTransportControlsXboxContainer .appBarIconButton:disabled:active .win-commandring,.companionSearchButton button.win-command:hover .win-commandring,.musicPage .win-vertical .win-item .verticalListItem.cloudNotification{border-color:transparent}.companionSearchTermContainer,.companion .searchHubStrip .PrimaryNavigationButton,.companion .related.activities .control-immersiveListViewItem,a,.companion .companionFullBleedNowPlayingTile:hover,.companion .companionHomeNowPlayingTileContainer:focus .companionFullBleedNowPlayingTile,.showKeyboardFocus .beaconControlContainer button:focus,.showKeyboardFocus .beaconControlContainer button:hover:focus,.showKeyboardFocus .beaconControlContainer button:active:hover:focus,.showKeyboardFocus .beaconControlContainer button:-ms-keyboard-active,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:focus,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:hover:focus,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:active:hover:focus,.showKeyboardFocus .beaconControlContainer button.bodyContent.beaconComment.label:-ms-keyboard-active,.failedPanelContainer,.noContentPane,.marketplacePage .win-container,.collectionPage .win-container,.dialogContainer,.searchGalleryView .win-container,.cardThumbnailButton,.companion .homeNowPlayingTile.large,.achievementsGallery .win-container,.appBarNowPlayingOverlay,.dashboardGridItemContent,.dashboardHubContent .actionTile,.hcrHubPanel,.homeNowPlayingTile,.companionHomeSearchBox .editInput,.editProfileEditBox .editInput,.editProfileEditBox .editMultiline,.immersiveTableOfContentsItemContainer,.immersiveViewMorePopOverContentLayout,.popOverContainer,.popOver.friend,.nowPlayingPlaylistGallery,.overlayContainer,.bottomProgress::-ms-fill,.achievementGameDetailsButton.win-template,.win-template .miniProfileControl,.miniProfilePanelControlsSignedOut,.homeNowPlayingTilePoster,.compareGamesColumn,.compareActivitiesGallery .win-container,.achievementsGallery .win-groupheader,.chatBubble,.internalActionLink:not(:disabled),.music .nowPlayingControl,.noContentPane.noMusicContentPane,.companionFullBleedNowPlayingTile,.companionHomeNowPlayingTileContainer:focus .companionFullBleedNowPlayingTile,.music .selectArtistEditBox,.selectArtistButton,.webLinkContainer a,.homeNowPlayingTile .bottomProgress,.homeNowPlayingTilePoster .bottomProgress,.welcomePanelContainer,.welcomePanelButton{outline-style:solid;outline-width:2px;outline-color:ButtonText}.bottomAppBarContainer,.compareAchievementsItemContainer{outline-style:solid;outline-width:1px}.showKeyboardFocus .musicPage .verticalPivotButton:focus,.showKeyboardFocus .musicPage .horizontalPivotButton:focus,.showKeyboardFocus .inboxPage .verticalPivotButton:focus{outline-width:0}.overlayContainer,.control-sendMessage .editBox textarea,.dashboardPanel.homeSpotlight .heroItemContainer,.relatedHeroItem,.relatedHeroItem.selected{border-width:2px;border-style:solid;border-color:ButtonText;outline-style:none}.companion .related.activities .control-immersiveListViewItem .activitiesOverlay,.companion .related.activities .control-immersiveListViewItem .part-imageContainer,.emptyGalleryContainerImmersiveDetailsColor,.immersiveDetailsGallery .thumbnailButton,.immersiveDetailsGallery .win-selectionborder,.immersiveHeroBackgroundImageOverlay,.collectionGamesGallery .win-selectionborder,.musicPage .win-selectionborder,.inboxPage .win-selectionborder,.win-ui-dark .verticalListHost .win-selectionborder,.collectionVideoGallery .win-selectionborder,.marketplaceGallery .win-selectionborder,.searchGalleryView .win-selectionborder{display:none}.acc-preserveBackground,.selectArtistEditBox .editInput,.searchGalleryView .win-item,.dashboardMyMusic .cardThumbnailButton,.dashboardMyGames .cardThumbnailButton,.dashboardGridItemContent .thumbnailButton .imageContainer,.music .popOverContentContainer .leftColumn .imageContainer,.thumbnailButtonImageHolder,.cardThumbnailButton .imageHolder,.imageHolder,.smartDJIcon:not(.smartDJNowPlaying),.games .engaged .thumbnailButton,.splitHeroRotator,.video .seekBarThumb{-ms-high-contrast-adjust:none}.video .seekBarThumb{background-color:transparent}.imageCollageCell,.mediatype-artist.acc-preserveBackground>div,.dashboardMyMusic .artistThumbnail .cardThumbnailButton{-ms-high-contrast-adjust:auto}.nowPlayingPlaylistControl,.splitHeroRotatorViewAll{background-image:none}.fadedNavigationContainer,.notificationContent .inlineCaretButton:hover{opacity:1}.related.relatedArtists .horizontalListItem.mediatype-artist .imageContainer,.immersiveDetails .gamesImmersiveRelatedItems .gamesRelatedImage,.immersiveDetails .related .horizontalListItem.mediatype-tvSeries,.immersiveDetails .related .horizontalListItem.mediatype-movie{outline-color:ButtonText}.immersiveMoreGalleryView .control-immersiveListViewItem:focus>div,.immersiveMoreGalleryView .control-immersiveListViewItem:hover>div,.immersiveDetails .related .template-fullBleedThumbnail.mediatype-tvSeries:focus .content,.immersiveDetails .related .template-fullBleedThumbnail.mediatype-tvSeries:hover .content,.related.relatedArtists .horizontalListItem.mediatype-artist .win-focusable:focus .content,.related.relatedArtists .horizontalListItem.mediatype-artist .win-focusable:hover .content,.related.albums .relatedHeroItem:focus,.related.albums .relatedHeroItem:hover,.related.albums .relatedListView .control-immersiveListViewItem.selected,.compareAchievementsItemContainer .control-immersiveListViewItem:hover,.leaderboards .control-immersiveListViewItem:hover,.win-container:hover .modernGameExtrasMoreItem,button.splitHeroRotatorViewAllLink:hover{background-color:Highlight;color:HighlightText}.win-container:hover .modernGameExtrasMoreItem{outline-color:Highlight;outline-style:solid;outline-width:10px}.win-ui-light .dialogButton:disabled,.win-ui-light .dialogButton:disabled:hover,.win-ui-light .dialogButton:disabled:active,.win-ui-light .dialogButton:disabled:hover:active,.win-ui-light .dialogButton:disabled.defaultButton,.win-ui-light .dialogButton.defaultButton:disabled:hover,.win-ui-light .dialogButton.defaultButton:disabled:active,.win-ui-light .dialogButton.defaultButton:disabled:hover:active{background-color:Highlight;border-color:WindowFrame;color:HighlightText}.video .seekBarFill{background-color:Background}}@media(-ms-high-contrast:black-on-white){.engaged .textContainer .label,.engaged .textContainer .progressTextPercentage,.verticalListItem .smartDJIcon:not(.smartDJNowPlaying),.smartDJPanelImageContainer .smartDJIcon,.simpleHeader .text-zoomedOutTitle,.simpleHeader .text-metadata.description,.video .nowPlayingMetadataMainTitle,.video .nowPlayingMetadataSubTitle,.video .nowPlayingText,.video .seekBarPositionText,.video .seekBarDurationText,.video .seekBarThumbText{color:HighlightText}.verticalListItem .simpleHeader.lowCountResults .text-zoomedOutTitle,.verticalListItem .simpleHeader.lowCountResults .text-metadata.description{color:WindowText}}@media(-ms-high-contrast:white-on-black){.engaged .textContainer .label,.engaged .textContainer .progressTextPercentage,.win-container.win-selected .verticalListItem .smartDJIcon,.win-container .win-item:hover .smartDJIcon,.verticalListItem .simpleHeader.lowCountResults .text-zoomedOutTitle,.verticalListItem .simpleHeader.lowCountResults .text-metadata.description,.splitHeroRotatorViewAll .inlineCaretButtonText,.splitHeroRotatorViewAll .inlineCaretButtonIcon,.video .nowPlayingMetadataMainTitle,.video .nowPlayingMetadataSubTitle,.video .nowPlayingText,.video .seekBarPositionText,.video .seekBarDurationText,.video .seekBarThumbText{color:WindowText}.simpleHeader .text-zoomedOutTitle,.simpleHeader .text-metadata.description{color:HighlightText}}.video .dashboard .panelFragmentContainer{height:505px;-ms-grid-column:1}.video .dashboard .continuousHubStrip .homeSpotlight,.video .dashboard .continuousHubStrip .movieMarketplacePanel.panel,.video .dashboard .continuousHubStrip .tvMarketplacePanel.panel,.video .dashboard .continuousHubStrip .videoCollectionPanel.panel{margin-left:0;margin-right:0}.video .nowPlayingTileShowing .nowPlayingLocation{visibility:hidden}.video .dashboard .homeSpotlight .panelFragmentWrapper,.video .dashboard .movieMarketplacePanel .panelFragmentWrapper,.video .dashboard .tvMarketplacePanel .panelFragmentWrapper{width:1055px;display:-ms-grid;-ms-grid-columns:975px 80px}.video .dashboard .homeSpotlight .panelFragmentLoading,.video .dashboard .movieMarketplacePanel .panelFragmentLoading,.video .dashboard .tvMarketplacePanel .panelFragmentLoading,.video .dashboard .homeSpotlight .panelFragmentFailed,.video .dashboard .movieMarketplacePanel .panelFragmentFailed,.video .dashboard .tvMarketplacePanel .panelFragmentFailed{width:975px}.video .dashboardPanel>.panelFailed{width:445px;height:335px;left:80px}html[dir=rtl].video .dashboardPanel>.panelFailed{right:80px}@media(max-height:1079px){.video .dashboardPanel.tvMarketplacePanel>.panelFailed{top:214px}}@media(min-height:1080px){.video .dashboard .homeSpotlight .panelFragmentWrapper,.video .dashboard .movieMarketplacePanel .panelFragmentWrapper,.video .dashboard .tvMarketplacePanel .panelFragmentWrapper{width:830px;display:-ms-grid;-ms-grid-columns:750px 80px}.video .dashboard .homeSpotlight .panelFragmentLoading,.video .dashboard .movieMarketplacePanel .panelFragmentLoading,.video .dashboard .tvMarketplacePanel .panelFragmentLoading,.video .dashboard .homeSpotlight .panelFragmentFailed,.video .dashboard .movieMarketplacePanel .panelFragmentFailed,.video .dashboard .tvMarketplacePanel .panelFragmentFailed{width:750px}.video .dashboard .panelFragmentLoading{height:675px}.video .dashboard .panelFragmentContainer{height:675px}}.video .dashboard .videoCollectionPanel .panelFragmentWrapper{width:975px;display:-ms-grid;-ms-grid-columns:895px 80px}.video .dashboard .videoCollectionPanel .panelFragmentLoading{width:895px}.video .nowPlayingOverlaysContainer{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr}.video .homeNowPlayingArt{width:auto;height:100%}.video .dashboardGridItemContent .thumbnailButton{width:100%;height:100%;opacity:1}.video .dashboardGridItemContent .thumbnailButton .imageContainer{width:100%;height:auto;position:relative}.video .dashboardGridItemContent .thumbnailButton .content{width:100%;position:relative}.video .cardThumbnailButton .quaternaryText .label{white-space:normal;font-size:9pt;font-weight:600}html[dir=ltr] .cardThumbnailButton .tertiaryText.inlineGlyph{text-align:left}html[dir=rtl] .cardThumbnailButton .tertiaryText.inlineGlyph{text-align:right}.video .homeHubNowPlayingTile{display:none}.video .nowPlayingTileShowing .homeHubNowPlayingTile{display:block}.video.noMarketplace .galleryHubStrip .hubNavigationTitle{margin-top:52px;overflow:visible}.video .galleryHubStrip .hubStripScroller{overflow:visible}.video .immersiveHeroContent.mediatype-movie{display:none}.seasons .template-fullBleedThumbnail{-ms-grid-rows:1fr 40px}.seasons .template-fullBleedThumbnail .imageContainer{-ms-grid-row-span:1;height:220px}@media(min-height:1080px){.seasons .template-fullBleedThumbnail .imageContainer{height:265px}}.seasons .template-fullBleedThumbnail .content{-ms-grid-row:2;-ms-grid-row-align:end;height:100%;width:100%;display:-ms-grid;-ms-grid-columns:15px 1fr 15px;-ms-grid-rows:auto}.seasons .template-fullBleedThumbnail .content .part-primaryText{padding-top:6px}.immersiveDetails .contextButtonContainer{outline:none}.video .homeNowPlayingTilePoster .homeNowPlayingMetadataTimeContainer,.video .homeNowPlayingTilePoster .homeNowPlayingArt{display:none}.video .homeNowPlayingTilePoster>.homeNowPlayingArtAndTextContainer{-ms-grid-rows:auto 36px 1fr}.video .homeNowPlayingTilePoster{text-align:center;-ms-grid-rows:10px auto 5px 2px 4px 16px}.video .homeNowPlayingTilePoster .bottomProgress{bottom:-4px;left:-10px;height:4px;width:293px;max-width:none}.video .homeNowPlayingTilePoster .nowPlayingTransportControlsPlayPauseButton{width:60px;height:60px}.homeNowPlayingTilePoster .nowPlayingTransportControlsPlayPauseButton button.win-command{-ms-grid-columns:60px 1fr;margin-top:-10px}.video .homeNowPlayingTilePoster .nowPlayingTransportControlsPlayPauseButton button.win-command .win-commandicon{width:60px;height:60px;border-width:4px}.video .homeNowPlayingTilePoster .nowPlayingTransportControlsPlayPauseButton button.win-command .win-commandimage{line-height:32px;font-size:20pt}.video .homeNowPlayingTilePoster .label.homeNowPlayingMetadataTitle{white-space:nowrap;text-overflow:ellipsis}.verticalScrollContainer,.verticalScrollContainerAuto{height:100%}.immersiveFrame .tv .overview,.immersiveFrame .movie .overview{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:auto 1fr;overflow:hidden}.immersiveFrame .tv .overview .scrollableItemsContainer,.immersiveFrame .movie .overview .scrollableItemsContainer{-ms-grid-row:2}.control-metaCritic:not(.removeFromDisplay){display:-ms-grid}.control-metaCritic{padding:5px;margin:10px -5px}.control-metaCritic .part-metaCriticScore{-ms-grid-column:1;text-align:center;width:30px;height:26px;padding:4px 0 0 0}.control-metaCritic .part-metaCriticScore.metaCritic-red{background-color:#ff3600;color:#fff}.control-metaCritic .part-metaCriticScore.metaCritic-yellow{background-color:#ffe000;color:#000}.control-metaCritic .part-metaCriticScore.metaCritic-green{background-color:#6c3;color:#fff}.control-metaCritic .part-metaCriticLogo{-ms-grid-column:2;margin:0 14px}.control-rottenTomatoesOverview{padding-top:5px}.control-rottenTomatoesOverview .rottenTomatoesOverview-scoreDataGrid{display:-ms-grid;-ms-grid-columns:40px 15px 1fr;-ms-grid-rows:auto 1fr;padding:5px;margin:10px -5px}.control-rottenTomatoesOverview .rottenTomatoesOverview-title{-ms-grid-column:3;-ms-grid-row:1}.control-rottenTomatoesOverview .rottenTomatoesOverview-progressBar{border-radius:8px;background-color:#fff;height:16px;width:140px;margin:10px 0}.control-rottenTomatoesOverview .rottenTomatoesOverview-progressBar.state-scoreRotten{color:#93b13c}.control-rottenTomatoesOverview .rottenTomatoesOverview-progressBar.state-scoreFresh{color:#c24436}.control-rottenTomatoesOverview .rottenTomatoesOverview-percentScore{-ms-grid-column:3;-ms-grid-row:1;margin-top:-5px}.control-rottenTomatoesOverview .rottenTomatoesOverview-icon{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-span:2;width:40px;height:40px}.control-rottenTomatoesOverview .rottenTomatoesOverview-tomatometer{-ms-grid-column:3;-ms-grid-row:1}.control-rottenTomatoesOverview .rottenTomatoesOverview-subtitle{-ms-grid-column:3;-ms-grid-row:2;padding:3px 5px;margin:0 -5px}.control-rottenTomatoesReviewItem{padding:5px;margin:20px}.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-scoreDataGrid{display:-ms-grid;-ms-grid-columns:40px 15px 1fr;-ms-grid-rows:auto 1fr;margin-bottom:10px}.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-icon{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-span:2;width:40px;height:40px}.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-title{-ms-grid-column:3;-ms-grid-row:1}.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-subtitle{-ms-grid-column:3;-ms-grid-row:2}html[dir=rtl] .control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-metadata{direction:ltr}.control-castAndCrewList .castAndCrewList-contributorList .control-contributorList{padding-top:5px;padding-bottom:15px}.control-castAndCrewList .control-immersiveListViewItem{-ms-grid-columns:0 0 1fr;-ms-grid-rows:1fr;margin:10px 20px 15px;padding:5px}.template-watchNextEpisode{display:-ms-grid;-ms-grid-columns:auto;-ms-grid-rows:auto auto auto auto 1fr;margin:5px;height:100%}.template-watchNextEpisode .watchNextEpisode-clickArea{display:-ms-grid;-ms-grid-columns:auto 10px 1fr;-ms-grid-rows:auto auto auto;-ms-grid-column:1;-ms-grid-row:1}.template-watchNextEpisode .watchNextEpisode-episodeNumber{-ms-grid-column:1;-ms-grid-row:1}.template-watchNextEpisode .watchNextEpisode-title{-ms-grid-column:3;-ms-grid-row:1}.template-watchNextEpisode .watchNextEpisode-details{-ms-grid-column:1;-ms-grid-column-span:3;-ms-grid-row:2}.template-watchNextEpisode .watchNextEpisode-watchProgress{-ms-grid-column:1;-ms-grid-column-span:3;-ms-grid-row:2;margin-top:2px}.template-watchNextEpisode .watchNextEpisode-notifications{-ms-grid-column:1;-ms-grid-row:3;padding-top:2px}.template-watchNextEpisode .watchNextEpisode-metadata{-ms-grid-column:1;-ms-grid-row:4;margin-top:2px}.template-watchNextEpisode .watchNextEpisode-description{-ms-grid-column:1;-ms-grid-row:5;margin-top:2px}.related .template-fullBleedThumbnail .content{padding:0}.related .flexibleItemsControlItemContainer{margin-top:0;margin-bottom:5px;margin-right:5px;margin-left:0;position:relative}.tvEpisodeListPanel .inlineDetailsEpisodeList.episodeList_seasonExtras .template-episodeListItem{-ms-grid-columns:20px auto 0 1fr 20px auto 20px}.tvEpisodeListPanel .inlineDetailsEpisodeList.episodeList_seasonExtras .template-episodeListItem .episodeListItem-episodeNumber{display:none}.movieRelatedFrame.immersiveTwoColumn{width:855px}.immersivePageTitle{display:-ms-grid;-ms-grid-columns:120px 1fr auto 120px;-ms-grid-rows:1fr;width:100%}.immersivePageTitle .immersiveHeroPrimaryText{position:fixed;-ms-grid-column:2;-ms-grid-row:1}.immersivePageTitle .immersiveSecondaryText{-ms-grid-column:2;-ms-grid-row:2;-ms-grid-row-align:end}.immersiveFrame>.headingRow,.immersiveViewMorePopOverContentLayout>.headingRow{height:173px;border:none;margin-bottom:0}.immersiveTwoColumn.firstImmersiveTwoColumn{margin-top:0}.immersivePageTitle .immersiveSecondaryText{-ms-transform:translateY(-200px)}mediatype-tvseries .immersivePageTitle .immersiveSecondaryText{-ms-transform:translateY(0)}.mediatype-movie .immersivePageTitle .immersiveSecondaryText{-ms-transform:translateY(90px)}.immersivePageTitle{height:75px}.immersiveHeroBackgroundImageContainer.mediatype-movie{padding-top:44px}.immersiveTwoColumn.firstImmersiveTwoColumn{display:-ms-grid;-ms-grid-rows:auto auto;-ms-grid-columns:0 50px 1fr 50px;min-width:0;width:auto;height:715px}.immersiveHeroContentContainer{-ms-grid-row:4;-ms-grid-rows:auto auto}.immersiveHeroBackgroundImageContainer{height:100%;-ms-grid-column:2;-ms-grid-row:1;-ms-grid-column-span:3;-ms-grid-row-span:1;overflow:hidden;display:-ms-grid;-ms-grid-columns:100%;-ms-grid-rows:100%;background-size:100%;background-repeat:no-repeat;background-position:top}.immersiveHeroBackgroundImageContainer img{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-column-align:start;-ms-grid-row-align:start;max-height:100%;max-width:100%;min-width:100%}.mediatype-movie .immersiveHeroBackgroundImageContainer{width:464px;height:636px}.mediatype-tvSeries .immersiveHeroBackgroundImageContainer{width:550px;height:550px}.immersiveHeroBackgroundImageContainer .immersiveHeroBackgroundImageOverlay{display:none}@media(max-height:900px){.immersiveTwoColumn.firstImmersiveTwoColumn{height:525px}.immersiveHeroBackgroundImageContainer.mediatype-tvSeries{width:420px;height:420px}.immersiveHeroBackgroundImageContainer.mediatype-movie{width:307px;height:420px}}.immersiveTwoColumn .related,.video .overview .metaDataContainer{margin-top:8px}.overview .metaDataContainer{-ms-grid-columns:0 0 1fr}.video .horizontalListActionItem{position:relative;height:100%;display:-ms-flexbox;-ms-flex-direction:column;-ms-flex-wrap:wrap}.template-fullBleedThumbnail{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr auto;width:100%;height:100%;outline:none}.template-fullBleedThumbnail .imageContainer{-ms-grid-row-span:2}.template-fullBleedThumbnail .part-imageHolder{width:100%;height:auto;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;overflow:hidden}.template-fullBleedThumbnail .part-imageHolder img{-ms-grid-row-align:center;max-height:100%}.template-fullBleedThumbnail .content{-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:auto;-ms-grid-rows:auto}.template-fullBleedThumbnail .content .textContainer{-ms-grid-row-align:end;position:relative;height:100%;width:100%;display:-ms-grid;-ms-grid-columns:24px 1fr 24px;-ms-grid-rows:10px auto auto auto auto 14px;overflow:hidden}.template-fullBleedThumbnail .content .textContainer .part-primaryText,.template-fullBleedThumbnail .content .textContainer .part-secondaryText,.template-fullBleedThumbnail .content .textContainer .part-tertiaryText,.template-fullBleedThumbnail .content .textContainer .part-quaternaryText{-ms-grid-column:2}.template-fullBleedThumbnail .content .textContainer .part-primaryText{-ms-grid-row:2}.template-fullBleedThumbnail .content .textContainer .part-secondaryText{-ms-grid-row:3}.template-fullBleedThumbnail .content .textContainer .part-tertiaryText{-ms-grid-row:4}.template-fullBleedThumbnail .content .textContainer .part-quaternaryText{-ms-grid-row:5}.control-starRating{padding-top:5px;padding-bottom:5px;display:-ms-grid}.overview .control-starRating{padding-top:20px}.control-starRating .mediaRatingControl{-ms-grid-column:1}.control-starRating .win-rating{padding:5px;margin:0 -5px;height:20px}.popOver .control-starRating .win-rating{padding:0;margin:5px 0}.control-starRating .ratingInfo{-ms-grid-column:2}.control-starRating .win-rating .win-star{height:16px;width:16px;font-size:16px;padding:0 2px}.control-starRating .win-rating .win-star:before{content:""}.control-starRating .part-totalRatings,.control-starRating .part-userRatedIndicator{padding:5px 10px;margin-top:2px}.previewBrowse,.previewBrowseItemDataContainer{height:100%;width:100%;display:-ms-grid;-ms-grid-columns:100px 1fr 100px;-ms-grid-rows:215px 1fr 200px 1fr 215px}.previewBrowseFlipView{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-span:2}.previewBrowseFlipView,.previewBrowseItemDataContainer{position:absolute;left:0;top:0;height:100%;width:100%;border:none}.previewBrowseItemDataContainer .previewBrowseContainer{display:-ms-grid;-ms-grid-columns:auto 1fr;-ms-grid-rows:auto;-ms-grid-column:2;-ms-grid-row:3;margin:0 20px}.previewBrowseContainer .imageContainer{-ms-grid-column:1;-ms-grid-row:1;margin-top:45px}.previewBrowseContainer .metaDataContainer{display:-ms-flexbox;-ms-flex-direction:column;-ms-grid-column:2;-ms-grid-row:1;margin-top:36px}.previewBrowseContainer .metaDataContainer .textContainer{display:-ms-flexbox;-ms-flex-direction:row}.buttonContainer .metaDataContainer p,.previewBrowseContainer .metaDataContainer p{margin:0;padding:0 2px}.previewBrowseContainer .metaDataContainer .ratingsContainer{margin:10px 0}.previewBrowseContainer .metaDataContainer .noTrailerAvailableContainer{margin:8px 2px}.previewBrowseBar{display:-ms-grid;-ms-grid-columns:auto 1fr;-ms-grid-rows:1fr;width:100%;-ms-grid-column:1;-ms-grid-row:5;-ms-grid-column-span:3}.previewBrowseBar .buttonContainer{display:-ms-grid;-ms-grid-columns:1fr auto auto auto auto;-ms-grid-rows:1fr;-ms-grid-row:2;-ms-grid-column-span:2;height:165px;padding:0 30px}.previewBrowseBar .buttonContainer .getDetailsButton{display:-ms-grid;-ms-grid-columns:10px 75px 1fr 10px;-ms-grid-rows:10px 105px 10px;-ms-grid-row-align:center;padding:0;-ms-grid-column:1;-ms-grid-row:1;border:0;-ms-grid-column-align:start;width:auto}.previewBrowseBar .buttonContainer .imageContainer{-ms-grid-column:2;-ms-grid-row:2}.previewBrowseBar .buttonContainer .metaDataContainer{-ms-grid-column:3;-ms-grid-row:2;margin:5px 15px}.previewBrowseBar .buttonContainer .textContainer{display:-ms-flexbox;-ms-flex-direction:row;margin:0 -2px}.previewBrowseBar .buttonContainer .ratingsContainer{height:10px;margin-top:-10px;padding:5px 0}@media(max-width:750px){.previewBrowseBar .buttonContainer .purchaseButton.freeButton,.previewBrowseBar .buttonContainer .purchaseButton.buyButton,.previewBrowseBar .buttonContainer .purchaseButton.rentButton{display:none}.previewBrowseContainer .metaDataContainer .previewBrowseTitle{font-size:27pt;line-height:34pt}}.previewBrowseBar .control-starRating .win-rating .win-star{height:11px;width:11px;font-size:11px;padding:0 2px}html[dir=ltr] .previewBrowseBar .buttonContainer .barTitle{text-align:left}html[dir=rtl] .previewBrowseBar .buttonContainer .barTitle{text-align:right}.previewBrowseBar .getDetailsButton .inlineCaretButtonText{padding-top:2px}.previewBrowseBar .getDetailsButton .inlineCaretContainer{margin-top:10px}.previewBrowseBar .buttonContainer .playPauseButton,.previewBrowseBar .buttonContainer .volumeButton,.previewBrowseBar .buttonContainer .purchaseButton{-ms-grid-row:1;margin-top:25px}.previewBrowseBar .buttonContainer .purchaseButton.removeFromDisplay{display:none}.previewBrowseBar .buttonContainer .purchaseButton{display:-ms-grid;-ms-grid-rows:auto auto}.previewBrowseBar .buttonContainer .purchaseButton .appBarIconButton{-ms-grid-row:1}.previewBrowseBar .buttonContainer .purchaseButton .purchaseSubtitle{-ms-grid-row:2;margin:0;width:100px;text-align:center;word-wrap:normal}.previewBrowseBar .buttonContainer .buyButton{-ms-grid-column:2}.previewBrowseBar .buttonContainer .rentButton{-ms-grid-column:3}.previewBrowseBar .buttonContainer .playPauseButton{-ms-grid-column:4}.previewBrowseBar .buttonContainer .volumeButton{-ms-grid-column:5}.previewBrowse .playbackContainer{width:100%;height:100%;display:-ms-grid;-ms-grid-columns:100%;-ms-grid-rows:1fr 100% 1fr}.previewBrowse .playbackContainer .win-template{-ms-grid-column:1;-ms-grid-row:2}.previewBrowse .navArrowContainer{position:relative}.previewBrowse .navArrowContainer.left{-ms-grid-column:1;-ms-grid-row:3;text-align:right}.previewBrowse .navArrowContainer.right{-ms-grid-column:3;-ms-grid-row:3;text-align:left}html[dir=rtl] .previewBrowse .navArrowContainer{transform:scaleX(-1)}.previewBrowse .videoFullScreenNowPlaying-spinner{display:-ms-grid;-ms-grid-columns:1fr auto 1fr;-ms-grid-column:2;-ms-grid-row:4}.previewBrowse .videoFullScreenNowPlaying-spinner .videoFullScreenNowPlaying-spinnerContainer{-ms-grid-column:2}.previewBrowseFlipView .win-navbutton,.video .inlineGlyph.removeFromDisplay{display:none}.videoDownloadManagerDialog .dialogCaption{padding:0 10px}.control-videoFullScreenNowPlaying{width:100vw;height:100vh}.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-spinner{width:100vw;height:100vh;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:55% 1fr}.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-spinnerContainer{-ms-grid-row:2;-ms-grid-row-align:start;-ms-grid-column-align:center;-ms-touch-action:none;display:-ms-grid;-ms-grid-rows:auto auto}.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-progressControl{-ms-grid-column-align:center;color:#ebebeb}.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-progressLabel{margin-top:12px;-ms-grid-row:2}.control-videoFullScreenNowPlaying progress:indeterminate{color:#ebebeb}.cardThumbnailButton .textContainer-notifications{-ms-grid-row:3;display:-ms-grid;-ms-grid-columns:auto 1fr;-ms-grid-rows:1fr}.cardThumbnailButton .textContainer-notifications .tertiaryText{-ms-grid-column:1;-ms-grid-row:1;margin-top:0;line-height:inherit;display:inherit}.cardThumbnailButton .textContainer-notifications .quaternaryText:not(.removeFromDisplay){-ms-grid-column:2;-ms-grid-row:1;-ms-grid-row-align:start;display:inherit;margin-top:2px}html[dir=ltr] .cardThumbnailButton .textContainer-notifications .quaternaryText:not(.removeFromDisplay){margin-left:4px}html[dir=rtl] .cardThumbnailButton .textContainer-notifications .quaternaryText:not(.removeFromDisplay){margin-right:4px}.movieVideoTile .content,.movieVideoTile .imageContainer{width:180px;height:245px}.personalVideoTile .imageContainer{height:auto}.movieVideoTile .textContainer,.personalVideoTile .textContainer,.personalVideoTileL1Large .textContainer,.tvSeriesVideoTile .textContainer{width:245px;display:-ms-grid;-ms-grid-column:1;-ms-grid-row:2;-ms-grid-columns:auto 1fr;-ms-grid-rows:1fr auto}.movieVideoTile .folderTextBg,.personalVideoTile .folderTextBg,.personalVideoTileL1Large .folderTextBg,.tvSeriesVideoTile .folderTextBg{height:100%;-ms-grid-row:2;-ms-grid-column:1;-ms-grid-row-align:end;background-color:rgba(0,0,0,.85)}.movieVideoTile .content,.personalVideoTile .content,.personalVideoTileL1Large .content,.tvSeriesVideoTile .content{display:-ms-grid;-ms-grid-columns:100%;-ms-grid-rows:1fr auto}.movieVideoTile .content,.personalVideoTile .content,.personalVideoTileL1Large .content,.tvSeriesVideoTile .content,.movieVideoTile .imageContainer,.personalVideoTile .imageContainer,.personalVideoTileL1Large .imageContainer,.tvSeriesVideoTile .imageContainer{width:245px;height:245px;position:relative;-ms-grid-column:1;-ms-grid-row:1}.personalVideoTileL1Small .textContainer{width:160px;display:-ms-grid;-ms-grid-column:1;-ms-grid-row:2;-ms-grid-columns:auto 1fr;-ms-grid-rows:1fr auto}.personalVideoTileL1Small .folderTextBg{height:100%;-ms-grid-row:2;-ms-grid-column:1;-ms-grid-row-align:end;background-color:rgba(0,0,0,.85)}.personalVideoTileL1Small .content{display:-ms-grid;-ms-grid-columns:100%;-ms-grid-rows:1fr auto}.personalVideoTileL1Small .content,.personalVideoTileL1Small .imageContainer{width:160px;height:160px;position:relative;-ms-grid-column:1;-ms-grid-row:1}.movieVideoTile .textContainer,.movieVideoTile .imageContainer,.movieVideoTile .content{width:180px}.videoTile .textContainer-notifications{-ms-grid-column:1;-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:auto 1fr;-ms-grid-rows:1fr}.videoTile .textContainer-notifications .part-primaryIcon{-ms-grid-column:1;-ms-grid-row:1;padding-right:5px;line-height:inherit}.videoTile .textContainer-notifications .part-primaryText:not(.removeFromDisplay){-ms-grid-column:2;-ms-grid-row:1;-ms-grid-row-align:start;display:inherit}.movieVideoTile .movieVideoTileButton,.personalVideoTile .personalVideoTileButton,.personalVideoTileL1Large .personalVideoTileButton,.personalVideoTileL1Small .personalVideoTileButton,.tvSeriesVideoTile .tvSeriesVideoTileButton{-ms-grid-column:1;-ms-grid-row:1;width:100%;height:100%;opacity:1;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr}.movieVideoTile,.personalVideoTile,.personalVideoTileL1Large,.personalVideoTileL1Small,.tvSeriesVideoTile{width:100%;height:100%;opacity:1;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr}.dashboard-viewMoreRow{width:100%;display:-ms-grid;-ms-grid-columns:1fr auto 10px;-ms-grid-rows:64px}.dashboard-viewMoreRow .moreButton-container{-ms-grid-column:2;-ms-grid-row:1;-ms-grid-column-align:stretch;-ms-grid-row-align:stretch;padding:0;margin:0}.dashboard-viewMoreRow .moreButton-container .actionTile{color:#fff}.win-ui-dark,.win-ui-dark progress:indeterminate,.musicPage .ent-zoomedout .verticalListItem .simpleHeader,.welcomePanelContainer,.immersiveHeroContent.mediatype-tvSeries .immersiveHeroSecondaryText,.control-app,.overview .metaDataContainer .textContainer .label,.overview .metaDataContainer .textContainer p,.snappedDetailsOverview .metaDataContainer .textContainer .label,.snappedDetailsOverview .metaDataContainer .textContainer p,.panelHeaderLink .actionLinkContainer,.dashboardGridItemContent .textContainer .primaryText,.dashboardGridItemContent .textContainer .secondaryText,.navigationHost .dashboardTitleIcon,.navigationHost .dashboardTitleLabel,.hubNavigationContainer .modifierSelectedItem,.hubNavigationContainer .modifierDropDownArrow,.primaryPanelModifier .modifierSelectedItem,.primaryPanelModifier .modifierDropDownArrow,.immersivePageTitle .immersiveHeroPrimaryText,.hubNavigationTitle,.hubNavigationSubTitle,.video1 .videoSnappedMiniView{color:#ebebeb}.immersiveDetailsScrollContainer{background-image:none}.immersiveTwoColumn .immersiveHeroContent{background-color:#3a3a3a}.musicPage .ent-zoomedout .verticalListItem progress{background-color:transparent}.welcomePanelContainer .welcomePanelButton{background-color:#ebebeb}.video1 body>#htmlUnsnapped,.video1 .videoSnappedMiniView{background-color:#101010}.welcomePanelContainer .welcomePanelButton:hover{background-color:rgba(255,255,255,.8)}@media(-ms-high-contrast){.homeHubNowPlayingTile:hover .homeNowPlayingMetadataTextContainer,.homeHubNowPlayingTile .acc-keyboardFocusTarget .homeNowPlayingMetadataTextContainer{background-color:Highlight}.homeHubNowPlayingTile:hover .homeNowPlayingMetadataSubTitle,.homeHubNowPlayingTile .acc-keyboardFocusTarget .homeNowPlayingMetadataSubTitle,.homeHubNowPlayingTile:hover .homeNowPlayingMetadataTitle,.homeHubNowPlayingTile .acc-keyboardFocusTarget .homeNowPlayingMetadataTitle{color:HighlightText}[data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .selectionLayout .checkMark,.template-navHeaderButton.state_selected{color:HighlightText}.dashboardMyMusic .albumThumbnail [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .selectionLayout,.dashboardPanel.musicTopAlbumsPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .selectionLayout,.musicFlexHubBigItem [data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .selectionLayout{border-width:5px}.overlayAnchor.volumeContainer .overlayBackground{background-color:transparent}.template-navHeaderButton.state_selected{background-color:Highlight}}@media(-ms-high-contrast:black-on-white){.dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .selectionLayout,.dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .selectionLayout,.albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground{border-color:#000}.albums.related .relatedHeroItem.selected .imageContainer{outline:4px solid #000}.template-navHeaderButton{outline:1px solid #000}.dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.music1 .flexPanel.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.albums.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.musicFlexHubBigItem [data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .checkBackground{border-left-color:transparent}html[dir=rtl] .dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .music1 .flexPanel.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .albums.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .musicFlexHubBigItem [data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .checkBackground{border-right-color:transparent}}@media(-ms-high-contrast:white-on-black){.dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .selectionLayout,.dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .selectionLayout,.albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground{border-color:#fff}.albums.related .relatedHeroItem.selected .imageContainer{outline:4px solid #fff}.template-navHeaderButton{outline:1px solid #fff}.dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.music1 .flexPanel.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.albums.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,.musicFlexHubBigItem [data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .checkBackground{border-left-color:transparent}html[dir=rtl] .dashboardPanel [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .music1 .flexPanel.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .albums.related [data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .albums.related .relatedHeroItem[data-win-control='MS.Entertainment.UI.Controls.ItemControl']>.selectionContainer .checkBackground,html[dir=rtl] .musicFlexHubBigItem [data-win-control="MS.Entertainment.UI.Controls.ItemControl"]>.selectionContainer .checkBackground{border-right-color:transparent}}.dashboardHost .opportunityIconButton button.iconButton.win-command .win-commandicon.win-commandring,.dashboardHost .opportunityIconButton button.iconButton.win-command .win-commandicon.win-commandring:hover{border-bottom-style:none;border-color:transparent;border-width:0;background-color:transparent}.text-metadataAlt{font-size:9pt;font-weight:700;line-height:14pt}.text-metadataAlt.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:14pt;word-wrap:normal}.text-metadataAlt.maxLines-two{overflow:hidden;white-space:normal;max-height:28pt}.text-metadataAlt.maxLines-three{overflow:hidden;white-space:normal;max-height:42pt}.text-metadataAlt.maxLines-four{overflow:hidden;white-space:normal;max-height:56pt}.text-metadataAlt.maxLines-seven{overflow:hidden;white-space:normal;max-height:98pt}.overview .metaDataContainer .textContainer p,.snappedDetailsOverview .metaDataContainer .textContainer p{font-size:11pt;letter-spacing:.04em;font-weight:400}.text-spotlightSubtitle,.text-modifierPopupEpisode,.text-modifierPopupOwned,.text-metadata,.text-bodyContent,.text-featuredSetImageSubhead{font-size:11pt;font-weight:400;line-height:15pt}.text-spotlightSubtitle.maxLines-one,.text-modifierPopupEpisode.maxLines-one,.text-modifierPopupOwned.maxLines-one,.text-metadata.maxLines-one,.text-bodyContent.maxLines-one,.text-featuredSetImageSubhead.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-spotlightSubtitle.maxLines-two,.text-modifierPopupEpisode.maxLines-two,.text-modifierPopupOwned.maxLines-two,.text-metadata.maxLines-two,.text-bodyContent.maxLines-two,.text-featuredSetImageSubhead.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-spotlightSubtitle.maxLines-three,.text-modifierPopupEpisode.maxLines-three,.text-modifierPopupOwned.maxLines-three,.text-metadata.maxLines-three,.text-bodyContent.maxLines-three,.text-featuredSetImageSubhead.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-spotlightSubtitle.maxLines-four,.text-modifierPopupEpisode.maxLines-four,.text-modifierPopupOwned.maxLines-four,.text-metadata.maxLines-four,.text-bodyContent.maxLines-four,.text-featuredSetImageSubhead.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-spotlightSubtitle.maxLines-seven,.text-modifierPopupEpisode.maxLines-seven,.text-modifierPopupOwned.maxLines-seven,.text-metadata.maxLines-seven,.text-bodyContent.maxLines-seven,.text-featuredSetImageSubhead.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-subHeader2{font-size:11pt;font-weight:700;line-height:15pt}.text-subHeader2.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-subHeader2.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-subHeader2.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-subHeader2.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-subHeader2.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-recommendationCardTitle{font-size:11pt;font-weight:400}.text-recommendationCardTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:20px;word-wrap:normal}.text-recommendationCardTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:40px}.text-recommendationCardTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:60px}.text-recommendationCardTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:80px}.text-recommendationCardTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:140px}.text-recommendationCardSubtitle{font-size:11pt;font-weight:300}.text-recommendationCardSubtitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:20px;word-wrap:normal}.text-recommendationCardSubtitle.maxLines-two{overflow:hidden;white-space:normal;max-height:40px}.text-recommendationCardSubtitle.maxLines-three{overflow:hidden;white-space:normal;max-height:60px}.text-recommendationCardSubtitle.maxLines-four{overflow:hidden;white-space:normal;max-height:80px}.text-recommendationCardSubtitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:140px}.text-featuredTitle,.text-featuredSetCardTitle{font-size:11pt;font-weight:700}.text-featuredTitle.maxLines-one,.text-featuredSetCardTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:14.9996pt;word-wrap:normal}.text-featuredTitle.maxLines-two,.text-featuredSetCardTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-featuredTitle.maxLines-three,.text-featuredSetCardTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-featuredTitle.maxLines-four,.text-featuredSetCardTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-featuredTitle.maxLines-seven,.text-featuredSetCardTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-listTitle,.text-dailogSubheader{font-size:14pt;font-weight:400}.text-listTitle.maxLines-one,.text-dailogSubheader.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:25pt;word-wrap:normal}.text-listTitle.maxLines-two,.text-dailogSubheader.maxLines-two{overflow:hidden;white-space:normal;max-height:50pt}.text-listTitle.maxLines-three,.text-dailogSubheader.maxLines-three{overflow:hidden;white-space:normal;max-height:75pt}.text-listTitle.maxLines-four,.text-dailogSubheader.maxLines-four{overflow:hidden;white-space:normal;max-height:100pt}.text-listTitle.maxLines-seven,.text-dailogSubheader.maxLines-seven{overflow:hidden;white-space:normal;max-height:175pt}.text-cardTitle,.text-modifierPopupSeason,.text-listItem,.text-actionTileText{font-size:14pt;line-height:18.875pt;font-weight:400}.text-cardTitle.maxLines-one,.text-modifierPopupSeason.maxLines-one,.text-listItem.maxLines-one,.text-actionTileText.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:18.875pt;word-wrap:normal}.text-cardTitle.maxLines-two,.text-modifierPopupSeason.maxLines-two,.text-listItem.maxLines-two,.text-actionTileText.maxLines-two{overflow:hidden;white-space:normal;max-height:38pt}.text-cardTitle.maxLines-three,.text-modifierPopupSeason.maxLines-three,.text-listItem.maxLines-three,.text-actionTileText.maxLines-three{overflow:hidden;white-space:normal;max-height:57pt}.text-cardTitle.maxLines-four,.text-modifierPopupSeason.maxLines-four,.text-listItem.maxLines-four,.text-actionTileText.maxLines-four{overflow:hidden;white-space:normal;max-height:76pt}.text-cardTitle.maxLines-seven,.text-modifierPopupSeason.maxLines-seven,.text-listItem.maxLines-seven,.text-actionTileText.maxLines-seven{overflow:hidden;white-space:normal;max-height:132pt}.text-panelHeader{font-size:14pt;font-weight:400;line-height:30pt}.text-dialogHeader{font-size:20pt;font-weight:300;line-height:26.5pt}.text-dialogHeader.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:26.5pt;word-wrap:normal}.text-dialogHeader.maxLines-two{overflow:hidden;white-space:normal;max-height:53pt}.text-dialogHeader.maxLines-three{overflow:hidden;white-space:normal;max-height:80pt}.text-dialogHeader.maxLines-four{overflow:hidden;white-space:normal;max-height:106pt}.text-dialogHeader.maxLines-seven{overflow:hidden;white-space:normal;max-height:186pt}.text-postRollBody{font-size:20pt;font-weight:200;line-height:26.5pt}.text-postRollBody.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:26.5pt;word-wrap:normal}.text-postRollBody.maxLines-two{overflow:hidden;white-space:normal;max-height:53pt}.text-postRollBody.maxLines-three{overflow:hidden;white-space:normal;max-height:80pt}.text-postRollBody.maxLines-four{overflow:hidden;white-space:normal;max-height:106pt}.text-postRollBody.maxLines-seven{overflow:hidden;white-space:normal;max-height:186pt}.text-subhead2{font-size:24pt;font-weight:300;line-height:32pt}.text-subhead2.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:32pt;word-wrap:normal}.text-subhead2.maxLines-two{overflow:hidden;white-space:normal;max-height:64pt}.text-subhead2.maxLines-three{overflow:hidden;white-space:normal;max-height:96pt}.text-subhead2.maxLines-four{overflow:hidden;white-space:normal;max-height:128pt}.text-subhead2.maxLines-seven{overflow:hidden;white-space:normal;max-height:224pt}.text-episodeTitle{font-size:24pt;font-weight:200;line-height:31pt}.text-episodeTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:31pt;word-wrap:normal}.text-episodeTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:62pt}.text-episodeTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:93pt}.text-episodeTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:124pt}.text-episodeTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:217pt}.text-spotlightTitle,.text-featuredSetImageTitle{font-size:28pt;font-weight:700}.text-spotlightTitle.maxLines-one,.text-featuredSetImageTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:38.1808pt;word-wrap:normal}.text-spotlightTitle.maxLines-two,.text-featuredSetImageTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:76pt}.text-spotlightTitle.maxLines-three,.text-featuredSetImageTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:115pt}.text-spotlightTitle.maxLines-four,.text-featuredSetImageTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:153pt}.text-spotlightTitle.maxLines-seven,.text-featuredSetImageTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:267pt}.text-immersiveHeroTitle{font-size:30pt;line-height:41pt;font-weight:200}.text-immersiveHeroTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:41pt;word-wrap:normal}.text-immersiveHeroTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:82pt}.text-immersiveHeroTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:123pt}.text-immersiveHeroTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:164pt}.text-immersiveHeroTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:287pt}.text-appTitle,.text-hubTitle{font-size:42pt;line-height:57pt;font-weight:200}.text-appTitle.maxLines-one,.text-hubTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:57pt;word-wrap:normal}.text-appTitle.maxLines-two,.text-hubTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:114pt}.text-appTitle.maxLines-three,.text-hubTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:171pt}.text-appTitle.maxLines-four,.text-hubTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:228pt}.text-appTitle.maxLines-seven,.text-hubTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:399pt}.icon-manageFoldersRemove{font-size:9pt}.icon-manageFoldersAction{font-size:15pt}.icon-xxLarge{font-size:37.5pt;line-height:50pt}.icon-xxSmall{font-size:9pt}.icon-xenon{font-size:25pt;line-height:51pt}:not(.app-classicContainer)>#htmlUnsnapped{background-image:none}@media(min-height:900px){.mainHubStrip,.dashboardHost{-ms-grid-rows:110px 74px 1fr}}@media(min-height:1080px){.mainHubStrip,.dashboardHost{-ms-grid-rows:120px 25px 1fr}}@media(min-height:1200px){.mainHubStrip,.dashboardHost{-ms-grid-rows:140px 85px 1fr}}@media(min-height:1440px){.mainHubStrip,.dashboardHost{-ms-grid-rows:210px 95px 1fr}}@media(min-height:1440px){.mainHeader{-ms-grid-rows:140px 80px}}.video1 .modifierControl:before{background-color:rgba(16,16,16,.01)}.video1 .modifierControl:hover{opacity:.6}.hubNavigationContainer .modifierSelectedItem{font-size:42pt;letter-spacing:.01em;font-weight:200;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}@media(max-width:639px){.hubNavigationContainer .modifierSelectedItem{font-size:28pt;letter-spacing:.02em}}.hubNavigationContainer .modifierDropDownArrow{margin-top:20px;font-size:22pt;letter-spacing:.01em;font-weight:200}@media(max-width:639px){.hubNavigationContainer .modifierDropDownArrow{font-size:10.25pt;letter-spacing:.02em}}@media(max-height:1079px){.modifierPopupScroller{max-height:calc(100vh - 260px)}}.video1 .marketplaceGallery .win-listview .win-container.win-backdrop,.video1 .collectionVideoGallery .win-listview .win-container.win-backdrop{background-color:#222}.immersiveDetails .related .win-template:hover{opacity:1}.win-listview .win-focusedoutline{outline-style:none;border-style:none}@media(-ms-high-contrast){.tvMarketplace .win-container,.movieMarketplace .win-container,.collectionPage .win-container{outline-style:none}.dashboardGridItemContent{outline-style:none}}.showKeyboardFocus .immersiveHeroContent button:focus,.showKeyboardFocus .welcomePanelContainer .closeButton:focus,.showKeyboardFocus .welcomePanelContainer .welcomePanelButton:focus,.showKeyboardFocus .settingsPanelHeader .win-backbutton:focus,.showKeyboardFocus .acc-keyboardFocusTarget:focus,.showKeyboardFocus .acc-keyboardFocusTarget:active,.win-command.iconButton.acc-keyboardFocusTarget{outline-style:solid;outline-width:1px;outline-color:#ebebeb}.video1 .showKeyboardFocus .companionFullBleedNowPlayingTile.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .cardThumbnailButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .homeNowPlayingTile.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .homeNowPlayingTilePoster.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .tvSeriesVideoTileButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .movieVideoTileButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .personalVideoTileButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget{outline:1px solid #ebebeb;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.video1 .showKeyboardFocus .companionFullBleedNowPlayingTile.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .cardThumbnailButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .homeNowPlayingTile.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .homeNowPlayingTilePoster.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .tvSeriesVideoTileButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .movieVideoTileButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .personalVideoTileButton.acc-keyboardFocusTarget,.video1 .showKeyboardFocus .dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}.video1 .showKeyboardFocus .companionFullBleedNowPlayingTile.acc-keyboardFocusTarget .folderTextBg,.video1 .showKeyboardFocus .cardThumbnailButton.acc-keyboardFocusTarget .folderTextBg,.video1 .showKeyboardFocus .homeNowPlayingTile.acc-keyboardFocusTarget .folderTextBg,.video1 .showKeyboardFocus .homeNowPlayingTilePoster.acc-keyboardFocusTarget .folderTextBg,.video1 .showKeyboardFocus .tvSeriesVideoTileButton.acc-keyboardFocusTarget .folderTextBg,.video1 .showKeyboardFocus .movieVideoTileButton.acc-keyboardFocusTarget .folderTextBg,.video1 .showKeyboardFocus .personalVideoTileButton.acc-keyboardFocusTarget .folderTextBg,.video1 .showKeyboardFocus .dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .folderTextBg{background-color:Highlight;color:HighlightText}}@media(-ms-high-contrast){.video1 .showKeyboardFocus .dashboardRecommendationsColumn .thumbnailButton.acc-keyboardFocusTarget .textContainer{background-color:Highlight;color:HighlightText}}.video1 .showKeyboardFocus .marketplaceGallery .win-focused,.video1 .showKeyboardFocus .collectionVideoGallery .win-focused{outline:1px solid #ebebeb;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.video1 .showKeyboardFocus .marketplaceGallery .win-focused,.video1 .showKeyboardFocus .collectionVideoGallery .win-focused{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}.video1 .showKeyboardFocus .marketplaceGallery .win-focused .folderTextBg,.video1 .showKeyboardFocus .collectionVideoGallery .win-focused .folderTextBg,.video1 .showKeyboardFocus .marketplaceGallery .win-focused .label,.video1 .showKeyboardFocus .collectionVideoGallery .win-focused .label{background-color:Highlight;color:HighlightText}}.video1 .showKeyboardFocus .immersiveDetails .template-fullBleedThumbnail.acc-keyboardFocusTarget{outline:1px solid #ebebeb;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.video1 .showKeyboardFocus .immersiveDetails .template-fullBleedThumbnail.acc-keyboardFocusTarget{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}}.video1 .showKeyboardFocus button.win-command.iconButton:focus,.video1 .showKeyboardFocus button.win-command.iconButton:active{outline:1px solid #ebebeb;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.video1 .showKeyboardFocus .marketplace .actionTile:hover .label{background-color:Highlight;color:HighlightText}}.video1 .thumbnailButton:hover,.video1 .videoCollection .videoTile:hover,.video1 .marketplaceGallery .win-container:hover,.video1 .collectionVideoGallery .win-container:hover,.video1 .related .template-fullBleedThumbnail:hover{outline:4px solid #3a3a3a;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.video1 .thumbnailButton:hover,.video1 .videoCollection .videoTile:hover,.video1 .marketplaceGallery .win-container:hover,.video1 .collectionVideoGallery .win-container:hover,.video1 .related .template-fullBleedThumbnail:hover{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}}@media(-ms-high-contrast){.video1 .panelTitle :not(:disabled).internalActionLink:active{background-color:Highlight}}@media(-ms-high-contrast){.video1 .videoCollection .videoTile:hover .folderTextBg,.video1 .marketplace .videoTile:hover .textContainer-notifications,.video1 .marketplace .actionTile:hover .label{background-color:Highlight;color:HighlightText}.video1 .dashboardRecommendationsColumn .thumbnailButton:hover .textContainer{background-color:Highlight;color:HighlightText}}.grid_2RowHeroTopWidescreenWithCard{-ms-grid-columns:330px 10px 330px;-ms-grid-rows:330px 10px 160px}.grid_3RowHeroTopWidescreen{display:-ms-grid;-ms-grid-rows:372px 10px 181px 10px 181px;-ms-grid-columns:380px 10px 380px}.dashboardPanel{-ms-grid-columns:80px auto}.cardThumbnailButton .primaryText{line-height:1.3636}.dashboardMyVideo .otherVideoThumbnail .cardThumbnailButton,.dashboardMyVideo .movieThumbnail .cardThumbnailButton,.dashboardMyVideo .tvThumbnail .cardThumbnailButton,.marketplaceVideoSearchPage .win-item .cardThumbnailButton,.marketplaceVideoSearchPage .win-item .searchHCR .cardThumbnailButton,.collectionPage .otherVideoThumbnail .cardThumbnailButton,.collectionVideo .cardThumbnailButton,.flexHubPage .win-item .tvThumbnail .cardThumbnailButton,.flexHubPage .win-item .movieThumbnail .cardThumbnailButton,.flexHubPage .win-item .videoFlexHubBigItem .cardThumbnailButton,.marketplaceTvPage .win-item,.marketplaceGallery .win-item,.tvCollectionPanel .collectionVideoGallery .win-item,.searchHubStrip .videosPanel1 .win-item,.searchHubStrip .videosPanel2 .win-item,.searchHubStrip .videosPanel3 .win-item,.searchHubStrip .videosPanel4 .win-item,.marketplace .actionTile{background-image:none;background-color:#3a3a3a}html[dir=rtl] .dashboardMyVideo .otherVideoThumbnail .cardThumbnailButton,html[dir=rtl] .dashboardMyVideo .movieThumbnail .cardThumbnailButton,html[dir=rtl] .dashboardMyVideo .tvThumbnail .cardThumbnailButton,html[dir=rtl] .marketplaceVideoSearchPage .win-item .cardThumbnailButton,html[dir=rtl] .marketplaceVideoSearchPage .win-item .searchHCR .cardThumbnailButton,html[dir=rtl] .collectionPage .otherVideoThumbnail .cardThumbnailButton,html[dir=rtl] .collectionVideo .cardThumbnailButton,html[dir=rtl] .flexHubPage .win-item .tvThumbnail .cardThumbnailButton,html[dir=rtl] .flexHubPage .win-item .movieThumbnail .cardThumbnailButton,html[dir=rtl] .flexHubPage .win-item .videoFlexHubBigItem .cardThumbnailButton,html[dir=rtl] .marketplaceTvPage .win-item,html[dir=rtl] .marketplaceGallery .win-item,html[dir=rtl] .tvCollectionPanel .collectionVideoGallery .win-item,html[dir=rtl] .searchHubStrip .videosPanel1 .win-item,html[dir=rtl] .searchHubStrip .videosPanel2 .win-item,html[dir=rtl] .searchHubStrip .videosPanel3 .win-item,html[dir=rtl] .searchHubStrip .videosPanel4 .win-item,html[dir=rtl] .marketplace .actionTile{background-image:none;background-color:#3a3a3a}.dashboardGridItemContent .thumbnailButton,.dashboardRecommendationsColumn .thumbnailButton{background-color:#3a3a3a}.dashboardGridItemContent .thumbnailButton .imageContainer,.dashboardRecommendationsColumn .thumbnailButton .imageContainer{background-color:#3a3a3a}.movieThumbnail .cardThumbnailButton .textContainer,.tvThumbnail .cardThumbnailButton .textContainer,.otherVideoThumbnail .cardThumbnailButton .textContainer{overflow:hidden;padding-top:7px}.movieThumbnail .cardThumbnailButton .textContainer .primaryText,.tvThumbnail .cardThumbnailButton .textContainer .primaryText,.otherVideoThumbnail .cardThumbnailButton .textContainer .primaryText,.movieThumbnail .cardThumbnailButton .textContainer .secondaryText,.tvThumbnail .cardThumbnailButton .textContainer .secondaryText,.otherVideoThumbnail .cardThumbnailButton .textContainer .secondaryText{color:#ebebeb}.movieThumbnail .cardThumbnailButton .textContainer-notifications .tertiaryText,.tvThumbnail .cardThumbnailButton .textContainer-notifications .tertiaryText,.otherVideoThumbnail .cardThumbnailButton .textContainer-notifications .tertiaryText,.movieThumbnail .cardThumbnailButton .textContainer-notifications .quaternaryText,.tvThumbnail .cardThumbnailButton .textContainer-notifications .quaternaryText,.otherVideoThumbnail .cardThumbnailButton .textContainer-notifications .quaternaryText{color:#898989}.marketplace .actionTile .win-commandicon{border-color:#ebebeb}.marketplace .actionTile .label,.marketplace .actionTile .win-commandicon .iconSpan{color:#ebebeb}.companion :not(.thumbnailButtonGlyph).dashboardGridItemContent .primaryText,.dashboardGridItemContent .primaryTextBg,.dashboardGridItemContent .secondaryText,.dashboardGridItemContent .tertiaryText,.dashboardGridItemContent .quaternaryText,.previewBrowse .previewBrowseBar .buttonContainer{background-color:rgba(16,16,16,.85)}.videoTile .textContainer-notifications{-ms-grid-columns:10px auto 5px auto 10px;-ms-grid-rows:1fr auto auto;background:rgba(16,16,16,.8)}.videoTile .textContainer-notifications .primaryText,.videoTile .textContainer-notifications .part-primaryIcon,.videoTile .textContainer-notifications .part-primaryText:not(.removeFromDisplay){color:#ebebeb;word-wrap:normal;white-space:normal}.videoTile .textContainer-notifications .primaryText{-ms-grid-column:2;-ms-grid-column-span:3;-ms-grid-row:3;display:none;line-height:18pt;overflow:hidden;max-height:34pt;text-overflow:clip;white-space:normal}.videoTile .textContainer-notifications .part-primaryIcon{-ms-grid-column:2;-ms-grid-row:2;text-align:justify;opacity:1;padding:0;line-height:30pt}.videoTile .textContainer-notifications .part-primaryText:not(.removeFromDisplay){-ms-grid-column:4;-ms-grid-row:2;padding-top:9px}.videoTile div.content .textContainer .primaryText{display:block}.videoTile .hideMetadataOverImage div.content .textContainer .primaryText{display:none}.videoTile.hideMetadataOverImage div.content .textContainer .primaryText{display:none}.layout-hub .dashboardGridItemContent:not(.isFlexHub) div.content .textContainer{visibility:visible}.layout-hub .dashboardGridItemContent:not(.isFlexHub) .hideMetadataOverImage div.content .textContainer{visibility:hidden}.layout-hub .dashboardGridItemContent:not(.isFlexHub).hideMetadataOverImage div.content .textContainer{visibility:hidden}.shellBackButtonContainer:hover .win-backbutton{background-color:#3a3a3a}.dashboardTitle-searchIcon{margin-top:21px;margin-right:4px}html[dir=rtl] .dashboardTitle-searchIcon{margin-right:0;margin-left:4px}.dashboardTitle-searchIcon button.win-command.iconButton:hover .win-commandicon.win-commandring{background-color:#3a3a3a}.dashboardTitle-searchIcon button.win-command.iconButton .win-commandring{width:40px;height:40px}.dashboardTitle-searchIcon button.win-command.iconButton .win-commandimage{font-size:16pt;line-height:40px;width:40px;height:40px}.fullScreenNowPlaying .dashboardTitle-searchIcon,.movieTrailerBrowse .dashboardTitle-searchIcon{display:none}.failedPanelContainer{background-color:#3a3a3a}.failedPanelContainer .failedPanelDetails .acc-keyboardFocusTarget.iconButton.win-command,.failedPanelContainer .failedPanelDetails .iconButton.win-command:focus{outline-color:#ebebeb}.failedPanelContainer .failedPanelDetails .iconButtonTwoLine .win-commandicon{border-color:#ebebeb}.failedPanelContainer .failedPanelDetails .iconButtonTwoLine .win-commandicon .win-commandimage{color:#ebebeb}.failedPanelContainer .failedPanelDetails .textContainer{color:#ebebeb}.failedPanelContainer .failedPanelTextContainer .failedPanelTitle,.failedPanelContainer .failedPanelTextContainer .failedPanelMessage,.failedPanelContainer .failedPanelTextContainer .failedPanelDetails{color:#ebebeb}.popOverContainer .failedPanelContainer .failedPanelTextContainer .failedPanelTitle,.popOverContainer .failedPanelContainer .failedPanelTextContainer .failedPanelMessage,.popOverContainer .failedPanelContainer .failedPanelTextContainer .failedPanelDetails{color:#222}.noContentPane{background-color:#3a3a3a;height:500px}@media(min-height:1050px){.noContentPane{height:752px}}.noContentPane .noContentTextContainer .noContentPaneTitle,.noContentPane .noContentTextContainer .noContentPaneDescription,.noContentPane .noContentTextContainer .noContentPaneDetails{color:#ebebeb}.noContentPane .noContentTextContainer .noContentPaneDetails .acc-keyboardFocusTarget.iconButton.win-command{outline-color:#ebebeb}.noContentPane .noContentTextContainer .iconButtonTwoLine button.iconButton .win-commandicon{border-color:#ebebeb}.noContentPane .noContentTextContainer .iconButtonTwoLine button.iconButton .win-commandicon .win-commandimage{color:#ebebeb}.noContentPane .noContentTextContainer .iconButtonTwoLine button.iconButton .textContainer{color:#ebebeb}.noContentPane .noContentTextContainer .iconButtonTwoLine button.iconButton .textContainer .subtitle.win-label{color:#898989}.template-rentalOptionsDialog{display:-ms-grid;-ms-grid-columns:auto;-ms-grid-rows:auto 20px auto 15px auto 18px auto 10px auto}.template-rentalOptionsDialog .rentalOptionsDialog-title{-ms-grid-row:1;color:#222}.template-rentalOptionsDialog .rentalOptionsDialog-option{}.template-rentalOptionsDialog .rentalOptionsDialog-option .option-label{display:-ms-grid;-ms-grid-columns:auto 10px auto}.template-rentalOptionsDialog .rentalOptionsDialog-option .option-label .label-input{height:25px;width:25px;margin:0}.template-rentalOptionsDialog .rentalOptionsDialog-option .option-label .label-primaryText{-ms-grid-column:3;-ms-grid-row-align:center;display:block;color:#222}.template-rentalOptionsDialog .rentalOptionsDialog-option.option_streaming{-ms-grid-row:3}.template-rentalOptionsDialog .rentalOptionsDialog-option.option_download{-ms-grid-row:5}.template-rentalOptionsDialog .rentalOptionsDialog-primarytext{-ms-grid-row:7;color:#898989}.template-rentalOptionsDialog .rentalOptionsDialog-secondarytext{-ms-grid-row:9;color:#898989}.video1 .dashboardGridMovieItemContent,.video1 .dashboardGridTvItemContent,.video1 .dashboardGridPersonalItemContentLarge,.video1 .dashboardGridPersonalItemContentSmall{position:relative;margin:0 10px 10px 0}.video1 .dashboardGridMovieItemContent{width:180px;height:245px}.video1 .dashboardGridTvItemContent,.video1 .dashboardGridPersonalItemContentLarge{width:245px;height:245px}.video1 .dashboardGridPersonalItemContentSmall{width:160px;height:160px}.video1 .videoTile{background-color:#3a3a3a}.video1 .marketplaceMoviePage .win-item,.video1 .marketplaceMoviePage .actionTile,.video1 .marketplaceMoviePage .actionTile button.win-command.iconButton,.video1 .videoCollectionMoviesPage .win-item{width:180px;height:245px}.video1 .marketplaceTvPage .win-item,.video1 .marketplaceTvPage .actionTile,.video1 .marketplaceTvPage .actionTile button.win-command.iconButton,.video1 .videoCollectionFolderPage .win-item,.video1 .videoCollectionTvPage .win-item{width:245px;height:245px}.video1 .personalFolderTile .textContainer-notifications{background:none}.layout-hub{display:-ms-grid}.layout-hub .dashboardGridItemContent.isFlexHub .textContainer{-ms-grid-rows:1fr auto}.layout-hub .dashboardGridItemContent.isFlexHub .textContainer .primaryText{overflow:hidden;max-height:36pt;text-overflow:clip;white-space:normal}.layout-hub .dashboardGridItemContent.isFlexHub .textContainer .dashboardTileIcon{-ms-grid-row-align:start;margin:13px 0 0 10px}html[dir=rtl] .layout-hub .dashboardGridItemContent.isFlexHub .textContainer .dashboardTileIcon{margin:13px 10px 0 0}.layout-hub.hub_newMoviesHub{display:-ms-grid;-ms-grid-columns:180px 10px 180px 10px 180px;-ms-grid-rows:245px 10px 245px 10px 245px}@media(min-height:1050px){.layout-hub.hub_newMoviesHub{height:755px}}@media(max-height:1049px){.layout-hub.hub_newMoviesHub{height:500px}}.layout-hub.hub_newMoviesHub .imageHolder{-ms-grid-row-align:center}.layout-hub.hub_newMoviesHub img{height:100%;width:100%}.layout-hub.hub_newMoviesHub .dashboardGridItemContent:not(.isFlexHub) .content{display:block}.layout-hub.hub_newMoviesHub .dashboardGridItemContent:not(.isFlexHub) .hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_newMoviesHub .dashboardGridItemContent:not(.isFlexHub).hideMetadataOverImage .textContainer{display:none}@media(min-height:1050px){.layout-hub.hub_newMoviesHub .item0{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-column-span:3;-ms-grid-row-span:3}.layout-hub.hub_newMoviesHub .item1{-ms-grid-column:1;-ms-grid-row:5}.layout-hub.hub_newMoviesHub .item2{-ms-grid-column:3;-ms-grid-row:5}.layout-hub.hub_newMoviesHub .item3{-ms-grid-column:5;-ms-grid-row:1}.layout-hub.hub_newMoviesHub .item4{-ms-grid-column:5;-ms-grid-row:3}.layout-hub.hub_newMoviesHub .item5{-ms-grid-column:5;-ms-grid-row:5}}@media(max-height:1049px){.layout-hub.hub_newMoviesHub{}.layout-hub.hub_newMoviesHub .item0{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-column-span:3;-ms-grid-row-span:3}.layout-hub.hub_newMoviesHub .item1{-ms-grid-column:5;-ms-grid-row:1}.layout-hub.hub_newMoviesHub .item2{-ms-grid-column:5;-ms-grid-row:3}.layout-hub.hub_newMoviesHub .item3,.layout-hub.hub_newMoviesHub .item4,.layout-hub.hub_newMoviesHub .item5{display:none}}.layout-hub.hub_featuredMoviesHub{display:-ms-grid;-ms-grid-columns:180px 10px 180px;-ms-grid-rows:245px 10px 245px 10px 245px}@media(min-height:1050px){.layout-hub.hub_featuredMoviesHub{height:755px}}@media(max-height:1049px){.layout-hub.hub_featuredMoviesHub{height:500px}}.layout-hub.hub_featuredMoviesHub .imageHolder{-ms-grid-row-align:center}.layout-hub.hub_featuredMoviesHub img{height:100%;width:100%}.layout-hub.hub_featuredMoviesHub .dashboardGridItemContent:not(.isFlexHub) .content{display:block}.layout-hub.hub_featuredMoviesHub .dashboardGridItemContent:not(.isFlexHub) .hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_featuredMoviesHub .dashboardGridItemContent:not(.isFlexHub).hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_newTvHub{display:-ms-grid;-ms-grid-columns:245px 10px 245px;-ms-grid-rows:245px 10px 245px 10px 245px}@media(min-height:1050px){.layout-hub.hub_newTvHub{height:755px}}@media(max-height:1049px){.layout-hub.hub_newTvHub{height:500px}}.layout-hub.hub_newTvHub .imageHolder{-ms-grid-row-align:center}.layout-hub.hub_newTvHub img{height:100%;width:100%}.layout-hub.hub_newTvHub .dashboardGridItemContent:not(.isFlexHub) .content{display:block}.layout-hub.hub_newTvHub .dashboardGridItemContent:not(.isFlexHub) .hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_newTvHub .dashboardGridItemContent:not(.isFlexHub).hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_featuredMoviesHub,.layout-hub.hub_newTvHub{}@media(min-height:1050px){.layout-hub.hub_featuredMoviesHub .item0,.layout-hub.hub_newTvHub .item0{-ms-grid-column:1;-ms-grid-row:1}.layout-hub.hub_featuredMoviesHub .item1,.layout-hub.hub_newTvHub .item1{-ms-grid-column:1;-ms-grid-row:3}.layout-hub.hub_featuredMoviesHub .item2,.layout-hub.hub_newTvHub .item2{-ms-grid-column:1;-ms-grid-row:5}.layout-hub.hub_featuredMoviesHub .item3,.layout-hub.hub_newTvHub .item3{-ms-grid-column:3;-ms-grid-row:1}.layout-hub.hub_featuredMoviesHub .item4,.layout-hub.hub_newTvHub .item4{-ms-grid-column:3;-ms-grid-row:3}.layout-hub.hub_featuredMoviesHub .item5,.layout-hub.hub_newTvHub .item5{-ms-grid-column:3;-ms-grid-row:5}}@media(max-height:1049px){.layout-hub.hub_featuredMoviesHub .item0,.layout-hub.hub_newTvHub .item0{-ms-grid-column:1;-ms-grid-row:1}.layout-hub.hub_featuredMoviesHub .item1,.layout-hub.hub_newTvHub .item1{-ms-grid-column:1;-ms-grid-row:3}.layout-hub.hub_featuredMoviesHub .item2,.layout-hub.hub_newTvHub .item2{-ms-grid-column:3;-ms-grid-row:1}.layout-hub.hub_featuredMoviesHub .item3,.layout-hub.hub_newTvHub .item3{-ms-grid-column:3;-ms-grid-row:3}.layout-hub.hub_featuredMoviesHub .item4,.layout-hub.hub_newTvHub .item4,.layout-hub.hub_featuredMoviesHub .item5,.layout-hub.hub_newTvHub .item5{display:none}}.layout-hub.hub_featuredTvHub{display:-ms-grid;-ms-grid-columns:auto 10px auto;-ms-grid-rows:auto}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub{-ms-grid-column:1;display:-ms-grid;-ms-grid-columns:245px;-ms-grid-rows:245px 10px 245px 10px 245px}@media(min-height:1050px){.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub{height:755px}}@media(max-height:1049px){.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub{height:500px}}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .imageHolder{-ms-grid-row-align:center}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub img{height:100%;width:100%}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .dashboardGridItemContent:not(.isFlexHub) .content{display:block}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .dashboardGridItemContent:not(.isFlexHub) .hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .dashboardGridItemContent:not(.isFlexHub).hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .item0{-ms-grid-column:1;-ms-grid-row:1}.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .item1{-ms-grid-column:1;-ms-grid-row:3}@media(min-height:1050px){.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .item2{-ms-grid-column:1;-ms-grid-row:5}}@media(max-height:1049px){.layout-hub.hub_featuredTvHub .hub_featuredTvLeftHub .item2{display:none}}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub{-ms-grid-column:3;display:-ms-grid;-ms-grid-columns:181px 10px 181px;-ms-grid-rows:181px 10px 181px 10px 1fr}@media(min-height:1050px){.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub{height:755px}}@media(max-height:1049px){.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub{height:500px}}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .imageHolder{-ms-grid-row-align:center}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub img{height:100%;width:100%}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .dashboardGridItemContent:not(.isFlexHub) .content{display:block}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .dashboardGridItemContent:not(.isFlexHub) .hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .dashboardGridItemContent:not(.isFlexHub).hideMetadataOverImage .textContainer{display:none}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .adContainer{display:-ms-grid;-ms-grid-columns:1fr auto 1fr;-ms-grid-rows:1fr auto 1fr;background-color:#3a3a3a}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .adContainer .adControl.win-template{-ms-grid-column:2;-ms-grid-row:2;width:300px;height:250px}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .adContainer .adControl.win-template .adControl,.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .adContainer .adControl.win-template .adPlaceholder,.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .adContainer .adControl.win-template .adError{width:300px;height:250px}@media(min-height:1050px){.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item3{-ms-grid-column:1;-ms-grid-row:1}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item4{-ms-grid-column:1;-ms-grid-row:3}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item5{-ms-grid-column:3;-ms-grid-row:1}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item6{-ms-grid-column:3;-ms-grid-row:3}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .adContainer{-ms-grid-column:1;-ms-grid-row:5;-ms-grid-column-span:3}}@media(max-height:1049px){.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub{}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item2{-ms-grid-column:1;-ms-grid-row:1}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item3{-ms-grid-column:3;-ms-grid-row:1}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .adContainer{-ms-grid-column:1;-ms-grid-row:3;-ms-grid-column-span:3;-ms-grid-row-span:3}.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item4,.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item5,.layout-hub.hub_featuredTvHub .hub_featuredTvRightHub .item6{display:none}}.homeSpotlight .panelTitle{display:-ms-grid;-ms-grid-columns:678px auto}@media(min-height:1050px){.homeSpotlight .panelTitle{-ms-grid-columns:778px auto}}.video1 .featuredVideoContent .baseGrid2Column{-ms-grid-columns:auto 5px auto 5px auto 5px auto}.videoOtherCollectionPanel .panelContainer,.videoTvCollectionPanel .panelContainer{min-width:245px}.videoMovieCollectionPanel .panelContainer{min-width:180px}.personalVideoTileL1Large .personalVideoTileButton .personalVideoTileContainer,.personalVideoTileL1Small .personalVideoTileButton .personalVideoTileContainer{width:100%;height:100%;overflow:hidden;display:-ms-grid}.personalVideoTileL1Large .personalVideoTileButton .personalVideoTileContainer .textContainer,.personalVideoTileL1Small .personalVideoTileButton .personalVideoTileContainer .textContainer{background-color:rgba(16,16,16,.8)}.dashboardMyVideo .movieVideoTile{height:245px}.dashboardPanel.videoMovieCollectionPanel{-ms-grid-columns:40px auto}.dashboardPanel.videoTvCollectionPanel{-ms-grid-columns:40px auto}.dashboardMyTv .tvSeriesVideoTile{height:245px}.homeHub .panelTitle{display:-ms-grid;-ms-grid-columns:678px auto}@media(min-height:1050px){.homeHub .panelTitle{-ms-grid-columns:778px auto}}.homeHub .panelContainer .baseGrid,.homeHub .panelContainer .baseGrid2Column{-ms-grid-columns:auto 40px auto 40px auto}.homeHub .panelContainer .dashboardGridItemContent .imageHolder{width:100%}.homeHub .panelContainer .dashboardGridItemContent .content{-ms-grid-rows:1fr auto}.homeHub .panelContainer .dashboardGridItemContent .content .textContainer{-ms-grid-columns:15px auto 1fr 15px;-ms-grid-rows:1fr auto 11px}.homeHub .panelContainer .dashboardGridItemContent .content .textContainer .primaryTextBg{-ms-grid-row-span:2;background:none}.homeHub .panelContainer .dashboardGridItemContent .content .textContainer .primaryText{-ms-grid-column:3;padding-top:0;height:100%}.homeHub .panelContainer .dashboardGridItemContent .content .textContainer .dashboardTileIcon{-ms-grid-column:2;margin:0 10px 10px 0;color:#ebebeb}html[dir=rtl] .homeHub .panelContainer .dashboardGridItemContent .content .textContainer .dashboardTileIcon{margin:0 0 10px 10px}.homeHub .panelContainer .dashboardGridItemContent.large .textContainer{-ms-grid-rows:1fr auto auto 10px;background:none}.homeHub .panelContainer .dashboardGridItemContent.large .textContainer .primaryTextBg{-ms-grid-column:1;-ms-grid-column-span:4;-ms-grid-row:1;-ms-grid-row-span:4;background:none}.homeHub .panelContainer .dashboardGridItemContent.large .textContainer .primaryText{-ms-grid-column:2;-ms-grid-column-span:1;-ms-grid-row:1;background:none}.homeHub .panelContainer .dashboardGridItemContent.large .textContainer .secondaryText{-ms-grid-column:2;-ms-grid-column-span:1;-ms-grid-row:2;max-width:none;padding:0;background:none;height:auto}@media(-ms-high-contrast){.homeHub .panelContainer .dashboardGridItemContent .thumbnailButton .content .textContainer .primaryTextBg{background-color:ButtonFace}.homeHub .panelContainer .dashboardGridItemContent .thumbnailButton:hover .content .textContainer .primaryTextBg,.homeHub .panelContainer .dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .content .textContainer .primaryTextBg{background-color:Highlight}.homeHub .panelContainer .dashboardGridItemContent .thumbnailButton:hover .content .textContainer .primaryText,.homeHub .panelContainer .dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .content .textContainer .primaryText,.homeHub .panelContainer .dashboardGridItemContent .thumbnailButton:hover .content .textContainer .secondaryText,.homeHub .panelContainer .dashboardGridItemContent .thumbnailButton.acc-keyboardFocusTarget .content .textContainer .secondaryText{color:HighlightText}}.homeHub .panelContainer .dashboardRecommendationsColumn{-ms-grid-column:5;display:-ms-grid;-ms-grid-columns:330px;-ms-grid-rows:160px 10px 160px 10px 160px}@media(min-height:1050px){.homeHub .panelContainer .dashboardRecommendationsColumn{-ms-grid-columns:380px;-ms-grid-rows:181px 10px 181px 10px 181px 10px 181px}}.homeHub .panelContainer .dashboardRecommendationsColumn .recommendationTitle{margin-top:6px;-ms-grid-row:1;-ms-grid-column:1;transform:translateY(-55px)}.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton{-ms-grid-columns:auto 1fr}.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton .imageContainer{-ms-grid-column:1;-ms-grid-column-align:start}.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton .imageContainer .imageHolder{-ms-grid-column-align:start;width:auto;height:160px}@media(min-height:1050px){.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton .imageContainer .imageHolder{height:181px}}.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton .content{-ms-grid-rows:1fr;-ms-grid-column:2;background-color:#3a3a3a}.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton .content .textContainer{-ms-grid-row:1;-ms-grid-rows:10px auto auto}.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton .content .textContainer .primaryText{-ms-grid-row:2;color:#ebebeb;height:auto}.homeHub .panelContainer .dashboardRecommendationsColumn .thumbnailButton .content .textContainer .reasonText{-ms-grid-row:3;color:#898989}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay){-ms-grid-column:3;display:-ms-grid;-ms-grid-columns:330px;-ms-grid-rows:160px 10px 160px 10px 160px}@media(min-height:1050px){.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay){-ms-grid-columns:380px;-ms-grid-rows:181px 10px 181px 10px 181px 10px 181px}}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle{-ms-grid-row:1;-ms-grid-column:1;height:40px;padding-bottom:5px;transform:translate(-8px,-52px);background:none}html[dir=rtl] .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle{transform:translate(8px,-52px)}@media(-ms-high-contrast){.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle.internalActionLink:not(:disabled):hover,.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle.internalActionLink:not(:disabled):focus{background-color:Highlight}}.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle,.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:hover,.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:active,.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:focus{opacity:1}@media(-ms-high-contrast){.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle .label.actionLinkLabel,.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:hover .label.actionLinkLabel,.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:active .label.actionLinkLabel,.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:focus .label.actionLinkLabel{color:WindowText}}@media(-ms-high-contrast){.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle.internalActionLink:not(:disabled),.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:hover.internalActionLink:not(:disabled),.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:active.internalActionLink:not(:disabled),.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle:focus.internalActionLink:not(:disabled){background-color:transparent}}@media(-ms-high-contrast){.offline .homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .featuredSetsTitle{outline:none}}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .icon{padding:0 5px}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .thumbnailButton .imageContainer{-ms-grid-column:1;-ms-grid-column-align:start}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .thumbnailButton .imageContainer .imageHolder{-ms-grid-column-align:start;height:160px}@media(min-height:1050px){.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .thumbnailButton .imageContainer .imageHolder{height:181px}}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .thumbnailButton .content .textContainer{-ms-grid-row:2;-ms-grid-rows:1fr auto auto 11px;color:#ebebeb}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .thumbnailButton .content .textContainer .primaryTextBg{-ms-grid-row-span:3}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .thumbnailButton .content .textContainer .primaryText{-ms-grid-row:2}.homeHub .panelContainer .dashboardFeaturedSetsColumn:not(.removeFromDisplay) .thumbnailButton .content .textContainer .secondaryText{-ms-grid-row:3}@media(-ms-high-contrast:none){.homeHub .grid_3RowHeroTopWidescreen .dashboardGridItemContent.large .content,.homeHub .grid_2RowHeroTopWidescreenWithCard .dashboardGridItemContent.large .content,.homeHub .dashboardFeaturedSetsColumn .dashboardGridItemContent.large .content{background-image:-ms-linear-gradient(bottom,rgba(16,16,16,.4) 10%,rgba(16,16,16,0) 50%)}.homeHub .grid_3RowHeroTopWidescreen .dashboardGridItemContent .content,.homeHub .grid_2RowHeroTopWidescreenWithCard .dashboardGridItemContent .content,.homeHub .dashboardFeaturedSetsColumn .dashboardGridItemContent .content{background-image:-ms-linear-gradient(bottom,rgba(16,16,16,.6) 0%,rgba(16,16,16,0) 100%)}}.layout-hub .dashboardGridItemContent .content .textContainer{-ms-grid-columns:15px auto auto 15px;-ms-grid-rows:1fr auto;height:100%}.layout-hub .dashboardGridItemContent .content .textContainer .primaryText{padding-bottom:8px;overflow:hidden;max-height:34pt;text-overflow:clip;white-space:normal}.dashboardPanel.movieMarketplacePanel,.dashboardPanel.movieMarketplacePanel2,.dashboardPanel.tvMarketplacePanel2{-ms-grid-columns:40px auto}.video .nowPlayingOverlaysContainer .nowPlayingOverlay{-ms-grid-row-align:stretch;-ms-grid-column-align:stretch}.video .nowPlayingOverlaysContainer .nowPlayingOverlay .nowPlayingTransportControls{-ms-grid-row-align:center;-ms-grid-row:1;-ms-grid-row-span:3}.video .nowPlayingOverlaysContainer .nowPlayingOverlay .metadataContainer{-ms-flex-direction:column;-ms-grid-row:4}.video .nowPlayingOverlaysContainer .nowPlayingOverlay .nowPlayingMetadataMainTitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.video .nowPlayingOverlaysContainer .nowPlayingDetailsButtonContainer{-ms-grid-row-align:end;-ms-grid-column-align:end}.video .nowPlayingOverlaysContainer .nowPlayingRatingImageContainer{margin-top:63px;margin-left:33px;margin-right:33px;-ms-grid-row-align:start;-ms-grid-column-align:start;-ms-high-contrast-adjust:none;z-index:1}.video1 .homeHubNowPlayingTile{width:100%;height:100%;background:#3a3a3a;top:0}@media(min-height:1050px){.video1 .homeHubNowPlayingTile .homeNowPlayingTilePoster .bottomProgress{width:380px}}@media(max-height:1049px){.video1 .homeHubNowPlayingTile .homeNowPlayingTilePoster .bottomProgress{width:330px}}.control-videoFullScreenNowPlaying .videoFullScreenNowPlaying-progressLabel{font-weight:300}.nowPlayingMetadataContainer{-ms-grid-rows:auto auto 60px 10px}.nowPlayingMetadata{margin-bottom:0}.previewBrowseBar .getDetailsButton .control-starRating{padding:10px 5px 0}.previewBrowseBar .getDetailsButton .inlineCaretContainer{margin-top:5px}.actionListFlyout.win-flyout .playbackOptionComboTitle .actionLinkLabel{margin-top:6px}.videoPostRollOverlay .overlayContainer{position:absolute;left:0;top:0;width:100%;height:auto}.control-videoPostRoll{width:100%;height:100%;display:-ms-grid;-ms-grid-columns:40px 1fr 40px 1fr 40px;-ms-grid-rows:100px auto 1fr 20px 80px 40px;background-color:#101010}@media(-ms-high-contrast){.control-videoPostRoll{color:WindowText;background-color:Window}}.control-videoPostRoll .videoPostRoll-titleContainer{display:-ms-grid;-ms-grid-columns:auto 20px auto 60px 1fr 40px;-ms-grid-rows:auto;-ms-grid-row:1;-ms-grid-column:2;-ms-grid-row-align:end}html[dir=rtl] .control-videoPostRoll .videoPostRoll-titleContainer{direction:ltr;-ms-grid-column-align:start}.control-videoPostRoll .videoPostRoll-titleContainer .videoPostRoll-titleIcon{-ms-grid-column:1;-ms-grid-row:1;width:40px;height:40px;margin-top:11px;-ms-grid-row-align:start;unicode-bidi:bidi-override}.control-videoPostRoll .videoPostRoll-titleContainer .videoPostRoll-titleLabel{-ms-grid-column:3;-ms-grid-row:1}.control-videoPostRoll .videoPostRoll-messageContainer{-ms-grid-column:2;-ms-grid-row:3;display:-ms-grid;-ms-grid-columns:60px 1fr;-ms-grid-rows:1fr}.control-videoPostRoll .videoPostRoll-messageContainer .videoPostRoll-messageText{-ms-grid-column:2}.control-videoPostRoll .videoPostRoll-button{-ms-grid-column:2;-ms-grid-row:5;display:-ms-grid;-ms-grid-columns:60px auto;-ms-grid-rows:auto}@media(-ms-high-contrast){.control-videoPostRoll .videoPostRoll-button{color:ButtonText;background-color:transparent}}.control-videoPostRoll .videoPostRoll-button .videoPostRoll-iconButton{-ms-grid-column:2}.control-videoPostRoll .videoPostRoll-button .videoPostRoll-iconButton button{display:-ms-grid;-ms-grid-columns:15px auto 15px;-ms-grid-rows:15px auto 15px;background-color:#107c10}.control-videoPostRoll .videoPostRoll-button .videoPostRoll-iconButton button .win-commandicon{display:none}.control-videoPostRoll .videoPostRoll-button .videoPostRoll-iconButton button .win-label{padding:0;text-align:center;-ms-grid-column:2;-ms-grid-row:2;-ms-grid-row-span:1;-ms-grid-column-align:center;-ms-grid-row-align:center;width:100%}.control-videoPostRoll .videoPostRoll-items{-ms-grid-column:4;-ms-grid-row:2;-ms-grid-row-span:4;-ms-grid-column-align:end;-ms-flex-direction:row;-ms-flex-wrap:nowrap;width:100%;overflow-x:auto;height:280px}.control-videoPostRoll .videoPostRoll-items .horizontalFlow{margin:4px 5px;position:relative}.control-videoPostRoll .videoPostRoll-items .horizontalFlow .part-primaryText{display:none}.control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget,.control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}@media(-ms-high-contrast){.control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget,.control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 8px);height:calc(100% - 8px);top:4px;left:4px;outline:4px solid Highlight}}@media(-ms-high-contrast)and (-ms-high-contrast){.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast)and (-ms-high-contrast){.showKeyboardFocus .control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail.acc-keyboardFocusTarget.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail:hover{outline:4px solid #3a3a3a;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.control-videoPostRoll .videoPostRoll-items .horizontalFlow .template-fullBleedThumbnail:hover{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}}.galleryHubStrip .hubNavigationClippingContainer{width:100%;-ms-grid-columns:1fr 120px;-ms-grid-rows:1fr auto auto auto;-ms-grid-row:1}.galleryHubStrip .hubNavigationClippingContainer .hubNavigationContainer{-ms-grid-row:2}.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:40px 0 0 0;-ms-grid-row:3}@media(min-resolution:133dpi)and (min-height:771px){.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:38px 0 0 0}}@media(min-height:900px){.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:33px 0 0 0}}@media(min-resolution:133dpi)and (min-height:1028px){.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:38px 0 0 0}}@media(min-height:1050px){.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:35px 0 0 0}}@media(min-height:1080px){.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:49px 0 0 0}}@media(min-height:1200px){.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:69px 0 0 0}}@media(min-height:1440px){.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle{margin:139px 0 0 0}}.galleryHubStrip .hubNavigationClippingContainer .hubNavigationSubTitle{-ms-grid-row:4;margin-top:0}.galleryHubStrip .hubNavigationClippingContainer .hubNavigationTitle,.galleryHubStrip .hubNavigationClippingContainer .hubNavigationSubTitle{width:100%}.hubNavigationContainer{color:#fff;padding-left:10px;padding-right:10px}.hubNavigationContainer .modifierControl{width:auto;padding-left:0;padding-right:0;margin-left:0;margin-right:0;margin-bottom:-10px}.hubNavigationModifierContainer{-ms-grid-row:3;width:100%}.hubNavigationModifierContainer .modifierControl{-ms-grid-columns:auto 1fr auto}.overlayBackground{-ms-high-contrast-adjust:none}.videoCollection .otherVideoCollectionPanel .videoTile .imageHolder img{background-position-x:center;background-position-y:center;background-size:cover}.videoCollection .otherVideoCollectionPanel .videoTile .textContainer-notifications .part-primaryIcon{line-height:30pt}.videoCollection .otherVideoCollectionPanel .videoTile .textContainer-notifications .primaryText,.videoCollection .otherVideoCollectionPanel .videoTile .textContainer-notifications .part-primaryText:not(.removeFromDisplay){line-height:18pt}.videoCollection .otherVideoCollectionPanel .personalFolderTile .part-primaryIcon{padding-top:9px}.videoCollection .otherVideoCollectionPanel .personalFolderTile .folderTextBg{background-color:rgba(16,16,16,.5)}.videoCollection .otherVideoCollectionPanel .personalFolderTile .textContainer-notifications .part-primaryIcon{line-height:18pt}.marketplace .actionTile button.win-command.iconButton{-ms-grid-rows:20px 1fr auto;max-height:245px}.marketplace .actionTile button.win-command.iconButton .win-commandimage{font-size:24pt;line-height:66px}.marketplace .actionTile button.win-command.iconButton .win-commandicon{-ms-grid-row:2}.marketplace .actionTile button.win-command.iconButton .win-label.label{-ms-grid-row:3}.searchPage .win-listview .win-horizontal.win-viewport .win-container{margin:4px}.searchPage .movieThumbnail:not(.searchHCR) .imageContainer{height:135px}.flexHubPage .win-listview .win-horizontal.win-viewport .win-container{margin:4px}.flexHubPage .movieThumbnail:not(.videoFlexHubBigItem) .imageContainer,.flexHubPage .tvThumbnail:not(.videoFlexHubBigItem) .imageContainer{height:135px}.flexHubPage .hubNavigationClippingContainer{margin-bottom:-35px;overflow:hidden}.verticalSubPivotItem .modifierPopupEntry{background-color:#fff}.verticalSubPivotItem .modifierPopupEntry:hover:focus,.verticalSubPivotItem .modifierPopupEntry:focus{background-color:#ebebeb}.featuredSetsPage .mainHubStrip{-ms-grid-rows:60px 1fr}.featuredSetsPage .mainHubStrip .hubNavigationClippingContainer{overflow:visible}.featuredSetsPage .mainHubStrip .hubStripScroller{-ms-grid-row:1;-ms-grid-row-span:2}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer{-ms-grid-rows:auto auto 1fr}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelModifierContainer{display:none}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper{-ms-grid-row:1}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery{-ms-grid-rows:175px 1fr;-ms-grid-columns:auto 1fr;-ms-overflow-x:auto}@media(min-height:1440px){.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery{-ms-grid-rows:290px 1fr}}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image{-ms-grid-row-span:2;-ms-grid-column:1;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr auto}@media all and (orientation:portrait){.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image{display:none}}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image.image_featuredSetImage{width:680px}@media(min-height:1050px){.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image.image_featuredSetImage{width:956px}}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image .image-content{-ms-grid-row-span:2;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr auto;position:relative;background-image:-ms-linear-gradient(bottom,rgba(16,16,16,.6) 0%,rgba(16,16,16,0) 100%)}@media(-ms-high-contrast){.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image .image-content{background:transparent}}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image .image-content .content-textContainer{-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:40px 1fr 40px;-ms-grid-rows:auto auto 144px;color:#ebebeb}@media(-ms-high-contrast){.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image .image-content .content-textContainer{background-color:Window}}@media(-ms-high-contrast){.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image .image-content .content-textContainer{color:WindowText}}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image .image-content .content-textContainer .textContainer-primaryText{-ms-grid-column:2;-ms-grid-row:1}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image .image-content .content-textContainer .textContainer-secondaryText{-ms-grid-column:2;-ms-grid-row:2}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGallery-image img{-ms-grid-row-span:3}.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGalleryFlex{height:520px;padding:0 0 0 40px;-ms-grid-row:2;-ms-grid-column:2;display:-ms-flexbox;-ms-flex-direction:column;-ms-flex-wrap:wrap;-ms-flex-align:start;-ms-flex-pack:start;-ms-flex-line-pack:start}html[dir=rtl] .featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGalleryFlex{padding:0 40px 0 0}@media all and (orientation:landscape){.featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGalleryFlex.marketplaceGalleryFlex_featuredSetImage{padding:10px 0 0 40px}html[dir=rtl] .featuredSetsPage .mainHubStrip .hubStripScroller .panelContentContainer .panelFragmentWrapper .marketplaceGallery .marketplaceGalleryFlex.marketplaceGalleryFlex_featuredSetImage{padding:10px 40px 0 0}}.video1 .related .template-fullBleedThumbnail.mediatype-movie .content{display:none}.video1 .immersiveHeroContent.mediatype-movie:not(.removeFromDisplay){display:block}.folderVideoThumbnail .content,.folderVideoThumbnail .imageContainer{width:100%;position:relative;overflow:hidden;-ms-grid-column:1;-ms-grid-row:1}.folderVideoThumbnail .imageContainer{height:auto}.folderVideoThumbnail .content{display:-ms-grid;-ms-grid-columns:100%;-ms-grid-rows:98px 67px}.folderVideoThumbnail .textContainer{width:100%;display:-ms-grid;-ms-grid-column:1;-ms-grid-row:2;-ms-grid-columns:15px 265px 15px;-ms-grid-rows:25px 42px}.folderVideoThumbnail .folderTextBg{height:calc(100% - 8px);padding-top:8px;-ms-grid-row:2;-ms-grid-column:2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.folderVideoThumbnail .folderThumbnailButton{width:100%;height:100%;opacity:1;overflow:visible;display:-ms-grid;-ms-grid-columns:100%;-ms-grid-rows:100%}.folderVideoThumbnail .folderVideoImg{width:295px;height:auto}.marketplace .actionTile .win-command .win-label{display:block}.searchBoxIcon{-ms-grid-column:3;-ms-grid-row:2;margin-top:15px;position:relative}.searchBoxIcon button.win-command.iconButton .win-commandring{width:40px;height:40px}.searchBoxIcon button.win-command.iconButton .win-commandimage{font-size:16pt;line-height:40px;width:40px;height:40px}@media(-ms-high-contrast:none){.searchFlyoutContainerSearchBox{color:#646464}.searchFlyoutContainerSearchBox .win-searchbox-input{color:#ebebeb}.searchFlyoutContainerSearchBox .win-searchbox-input:focus{color:#222}.searchFlyoutContainerSearchBox .win-searchbox-button{color:#ebebeb;background-color:#303030}.searchFlyoutContainerSearchBox .win-searchbox-button.win-searchbox-button-input-focus{background-color:#107c10}.searchFlyoutContainerSearchBox .win-searchbox-button:hover{background-color:#299c10}.searchFlyoutContainerSearchBox .win-searchbox-button:active{background-color:#5dc21e}.searchFlyoutContainerSearchBox ::-ms-clear{color:#ebebeb;background-color:rgba(0,0,0,0)}.searchFlyoutContainerSearchBox ::-ms-clear:hover{background-color:#3a3a3a}.searchFlyoutContainerSearchBox ::-ms-clear:active{background-color:#646464}.searchFlyoutContainerSearchBox .win-searchbox-flyout{background-color:#ebebeb}.searchFlyoutContainerSearchBox .win-searchbox-flyout .win-searchbox-suggestion-query:hover{background-color:#e2e2e2}.searchFlyoutContainerSearchBox .win-searchbox-flyout .win-searchbox-suggestion-query.win-searchbox-suggestion-selected{background-color:#78122b;color:#ebebeb}.searchFlyoutContainerSearchBox .win-searchbox-flyout .win-searchbox-suggestion-query:active{background-color:#646464}}.video.video1 .homeNowPlayingTilePoster .nowPlayingTransportControlsPlayPauseButton button.win-command{margin-top:12px}.video1 .previewBrowseContainer .imageContainer,.video1 .previewBrowseContainer .ratingsContainer{display:none}.video.video1 .inPlaceDetailsItemActions,.video.video1 .verticalListHost .inPlaceDetailsItemActions{visibility:hidden;display:-ms-flexbox;-ms-grid-column:4;-ms-grid-column-span:1;-ms-grid-row:1;-ms-grid-row-span:4}.video.video1 .invoked .inPlaceDetailsItemActions,.video.video1 .verticalListHost .invoked .inPlaceDetailsItemActions{visibility:visible}.videoDownloadManagerDialog .dialogContainer form{width:640px}@media(min-width:479px)and (max-width:640px){.videoDownloadManagerDialog .dialogContainer form{width:100%}}.videoDownloadManagerDialog .dialogContainer form .dialogCaption{padding:20px 20px 10px 20px}.videoDownloadManagerDialog .dialogContainer form .dialogContent{padding:0}.videoDownloadManagerDialog .dialogContainer form .dialogContent .videoDownloadManagerContent-emptyLabel{padding:0 20px}.videoDownloadManagerDialog .dialogContainer form .dialogFooter{padding:0 12px}.videoDownloadManagerDialog .dialogContainer form .dialogFooter .dialogButton{margin:5px 8px}.videoDownloadManagerContent .downloadDetailsVideo{display:-ms-grid;-ms-grid-columns:80px 10px 1fr auto;-ms-grid-rows:25px 20px 20px 2px 3px;padding-top:5px;padding-bottom:5px}.videoDownloadManagerContent .downloadDetailsVideo .imageContainer{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-span:5;-ms-grid-column-align:center;-ms-grid-row-align:center}.videoDownloadManagerContent .downloadDetailsVideo .downloadDetailsVideoTitle{-ms-grid-column:3;-ms-grid-row:1}.videoDownloadManagerContent .downloadDetailsVideo .downloadDetailsVideoDescription{-ms-grid-column:3;-ms-grid-row:2}.videoDownloadManagerContent .downloadDetailsVideo .downloadDetailsVideoButtons{-ms-grid-column:4;-ms-grid-row:1;-ms-grid-row-span:4;-ms-grid-column-align:end}.videoDownloadManagerContent .downloadDetailsVideo .downloadDetailsVideoStatus{-ms-grid-column:4;-ms-grid-row:2;-ms-grid-column-align:end}.videoDownloadManagerContent .downloadDetailsVideo .downloadDetailsVideoError{-ms-grid-column:3;-ms-grid-row:3;-ms-grid-column-span:3}.videoDownloadManagerContent .downloadDetailsVideo .progressBar{width:100%;height:2px;-ms-grid-column:3;-ms-grid-row:5;-ms-grid-column-span:3}.videoDownloadManagerContent .invoked .downloadDetailsVideoStatus{display:none}.videoDownloadManagerContent .videoDownloadManagerContent-copyingFilesHelpLink{margin-top:10px;position:relative;float:right}html[dir=ltr] .videoDownloadManagerContent .videoDownloadManagerContent-copyingFilesHelpLink{margin-right:18px}html[dir=rtl] .videoDownloadManagerContent .videoDownloadManagerContent-copyingFilesHelpLink{margin-left:18px}html[dir=rtl] .videoDownloadManagerContent .videoDownloadManagerContent-copyingFilesHelpLink{float:left}.videoDownloadManagerContent .downloadDetailsEpisodeList .win-listview,.videoDownloadManagerContent .downloadDetailsEpisodeList .win-surface{padding:0}.videoDownloadManagerContent .downloadDetailsEpisodeList .win-item{height:100px}.videoDownloadManagerContent .downloadDetailsEpisodeList .win-container{margin:0}@media(-ms-high-contrast){.videoDownloadManagerContent .downloadDetailsEpisodeList .win-container:hover .downloadDetailsVideo{color:HighlightText}}.videoDownloadManagerContent .downloadDetailsEpisodeList .win-container:hover .downloadDetailsVideo .progressBar{background-color:#898989}.videoDownloadManagerContent .downloadDetailsEpisodeList .win-container .win-template.invoked,.videoDownloadManagerContent .downloadDetailsEpisodeList .win-container .win-template:focus{background-color:#ebebeb}.videoDownloadManagerContent .downloadDetailsEpisodeList .win-container .win-template.invoked .downloadDetailsVideo .progressBar,.videoDownloadManagerContent .downloadDetailsEpisodeList .win-container .win-template:focus .downloadDetailsVideo .progressBar{background-color:#a7a7a7}.videoDownloadManagerContent .downloadDetailsEpisodeList .episodeDownload,.videoDownloadManagerContent .downloadDetailsEpisodeList .movieDownload{padding:10px 0}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo{display:-ms-grid;-ms-grid-columns:80px 20px 1fr auto;-ms-grid-rows:29px 20px 18px 2px 3px;padding:0 20px}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .imageContainer{-ms-grid-row-align:start;height:80px}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .imageContainer .imageHolder{width:100%;height:100%}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .imageContainer .imageHolder.wide{width:100%;height:auto}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .imageContainer .imageHolder.tall{width:auto;height:100%}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoTitle,.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoDescription{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}html[dir=ltr] .videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoTitle,html[dir=ltr] .videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoDescription{padding-right:20px}html[dir=rtl] .videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoTitle,html[dir=rtl] .videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoDescription{padding-left:20px}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoTitle{-ms-grid-row-align:end}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoButtons button.win-command{margin:0;padding-top:10px}html[dir=ltr] .videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoButtons button.win-command{padding-right:10px}html[dir=rtl] .videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoButtons button.win-command{padding-left:10px}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoButtons button.win-command .win-commandicon{margin:0}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoButtons button.win-command .win-label{min-width:40px}.showKeyboardFocus .videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoButtons button.win-command:focus{outline:1px solid #222;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}.videoDownloadManagerContent .downloadDetailsEpisodeList .downloadDetailsVideo .downloadDetailsVideoButtons .verticalBox{flex-direction:row}.template-downloadQualityDialogForm{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:11px auto 10px auto 18px auto 20px}.template-downloadQualityDialogForm .downloadQualityDialogForm-optionsContainer{-ms-grid-row:2}.template-downloadQualityDialogForm .downloadQualityDialogForm-option,.template-downloadQualityDialogForm .downloadQualityDialogForm-checkbox{display:-ms-grid;-ms-grid-columns:auto 10px 1fr;margin-bottom:27px}.template-downloadQualityDialogForm .downloadQualityDialogForm-option input,.template-downloadQualityDialogForm .downloadQualityDialogForm-checkbox input{-ms-grid-column:1;margin:0;display:block}.template-downloadQualityDialogForm .downloadQualityDialogForm-option .option-label,.template-downloadQualityDialogForm .downloadQualityDialogForm-checkbox .option-label,.template-downloadQualityDialogForm .downloadQualityDialogForm-option .checkbox-label,.template-downloadQualityDialogForm .downloadQualityDialogForm-checkbox .checkbox-label{-ms-grid-column:3;margin-top:2px;display:block}.template-downloadQualityDialogForm .downloadQualityDialogForm-bodyText{-ms-grid-row:4}.template-downloadQualityDialogForm .downloadQualityDialogForm-checkbox{-ms-grid-row:6}.template-verticalCardTile{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:auto 1fr;background-color:#303030;margin:0 5px;height:420px;outline-style:none}.showKeyboardFocus .template-verticalCardTile:focus{outline:1px solid #ebebeb;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.showKeyboardFocus .template-verticalCardTile:focus{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a;background-color:Highlight}.showKeyboardFocus .template-verticalCardTile:focus .verticalCardTile-primaryText{color:HighlightText}}.template-verticalCardTile:hover{outline:4px solid #3a3a3a;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.template-verticalCardTile:hover{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a;background-color:Highlight}.template-verticalCardTile:hover .verticalCardTile-primaryText{color:HighlightText}}.template-verticalCardTile .verticalCardTile-imageContainer{-ms-grid-row:1;overflow:hidden}.template-verticalCardTile .verticalCardTile-imageContainer img{width:100%;height:100%}.template-verticalCardTile .verticalCardTile-content{-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:9px 1fr 9px;-ms-grid-rows:5px auto auto auto 1fr auto 5px}.template-verticalCardTile .verticalCardTile-content .verticalCardTile-primaryText{-ms-grid-row:2;-ms-grid-column:2;color:#ebebeb}.template-verticalCardTile .verticalCardTile-content .verticalCardTile-secondaryText{-ms-grid-row:3;-ms-grid-column:2;color:#898989}.template-verticalCardTile .verticalCardTile-content .verticalCardTile-tertiaryText{-ms-grid-row:4;-ms-grid-column:2;color:#898989}.template-verticalCardTile .verticalCardTile-content .verticalCardTile-starRating{-ms-grid-row:6;-ms-grid-column:2}.template-verticalCardTile .verticalCardTile-content .verticalCardTile-starRating .control-starRating{-ms-grid-rows:auto}.template-verticalCardTile .verticalCardTile-content .verticalCardTile-starRating .control-starRating .win-rating{padding:5px 2px}.template-verticalCardTile.verticalCardTile_tv{width:310px}.template-verticalCardTile.verticalCardTile_tv .verticalCardTile-imageContainer{width:310px;height:310px}.template-verticalCardTile.verticalCardTile_movie{width:226px}.template-verticalCardTile.verticalCardTile_movie .verticalCardTile-imageContainer{width:226px;height:310px}.template-featuredSetsCard{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;background-color:#303030;margin:0 5px 10px 5px;height:250px;width:516px}.template-featuredSetsCard .featuredSetsCard-imageContainer{overflow:hidden}.template-featuredSetsCard .featuredSetsCard-imageContainer img{width:100%;height:100%}.template-featuredSetsCard .featuredSetsCard-content{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr auto;position:relative}@media(-ms-high-contrast:none){.template-featuredSetsCard .featuredSetsCard-content{background-image:-ms-linear-gradient(bottom,rgba(16,16,16,.4) 10%,rgba(16,16,16,0) 50%)}}@media(-ms-high-contrast){.template-featuredSetsCard .featuredSetsCard-content .content-textContainer{background-color:ButtonFace}}.template-featuredSetsCard .featuredSetsCard-content .content-textContainer{-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:15px 1fr 15px;-ms-grid-rows:1fr auto 11px}.template-featuredSetsCard .featuredSetsCard-content .content-textContainer .textContainer-primaryText{-ms-grid-column:2;-ms-grid-row:2;color:#ebebeb}.showKeyboardFocus .template-featuredSetsCard:focus{outline:1px solid #ebebeb;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.showKeyboardFocus .template-featuredSetsCard:focus{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}.showKeyboardFocus .template-featuredSetsCard:focus .content-textContainer{background-color:Highlight}.showKeyboardFocus .template-featuredSetsCard:focus .content-textContainer .textContainer-primaryText{color:HighlightText}}.template-featuredSetsCard:hover{outline:4px solid #3a3a3a;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}@media(-ms-high-contrast){.template-featuredSetsCard:hover{outline:4px solid Highlight;overflow:visible;box-shadow:0 0 2px 1px #3a3a3a}.template-featuredSetsCard:hover .content-textContainer{background-color:Highlight}.template-featuredSetsCard:hover .content-textContainer .textContainer-primaryText{color:HighlightText}}.template-episodeListItem{display:-ms-grid;-ms-grid-columns:20px auto 5px 1fr 10px auto 20px;-ms-grid-rows:34px 20px 1fr;position:relative;padding:0 5px;height:60px;color:#ebebeb;outline:none}.template-episodeListItem,.template-episodeListItem:focus{border:0 solid;outline-style:none}.showKeyboardFocus .template-episodeListItem.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .template-episodeListItem.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .template-episodeListItem.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .template-episodeListItem.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.template-episodeListItem:hover{opacity:.6}.template-episodeListItem .episodeListItem-episodeNumber{-ms-grid-column:2;-ms-grid-row:1;-ms-grid-row-align:end;min-width:25px;max-width:60px}.template-episodeListItem .episodeListItem-title{-ms-grid-column:4;-ms-grid-row:1;-ms-grid-row-align:end}.template-episodeListItem .episodeListItem-duration{-ms-grid-column:6;-ms-grid-column-align:end;-ms-grid-row:1;-ms-grid-row-align:end;padding-top:7px;max-width:120px;color:#646464}.template-episodeListItem .episodeListItem-date{-ms-grid-column:4;-ms-grid-row:2;-ms-grid-row-align:end;padding-top:2px;color:#646464}.template-episodeListItem .episodeListItem-icon{-ms-grid-column:5;-ms-grid-column-span:2;-ms-grid-column-align:end;-ms-grid-row:2;-ms-grid-row-align:end}.template-episodeListItem .episodeListItem-watchProgress{-ms-grid-column:6;-ms-grid-row:2;-ms-grid-row-align:end;margin-top:2px}.template-episodeListItem .control-watchProgress .watchProgress-progressBar{height:10px;width:100px}.tvEpisodesFrame .episodeListTitle{color:#646464;border-bottom-width:1px;border-bottom-style:solid;padding:6px 0}.tvEpisodesFrame .inlineDetailsEpisodeList{padding-bottom:10px}.tvEpisodesFrame .inlineDetailsEpisodeList.latestEpisodeList,.tvEpisodesFrame .inlineDetailsEpisodeList.episodeList_seasonExtras{padding-bottom:30px}.immersiveDetails .immersiveTitleContainer{width:100vw;height:132px}.immersiveDetails .immersiveTitleContainer .immersivePageTitle{width:100%;height:100%}.immersiveDetails .immersiveTitleContainer .immersivePageTitle .immersiveMediaPageTitle{width:100%;height:100%}.immersiveDetails .immersiveTitleContainer .immersivePageTitle .immersiveHeroPrimaryText{width:calc(100vw - 220px);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;word-wrap:normal}.immersiveDetails .immersiveTitleContainer .immersivePageTitle .immersiveSecondaryText{color:#ebebeb}.immersiveDetails .immersiveFrame .headingRow .headingLink .actionLinkLabel{color:#ebebeb}@media(-ms-high-contrast){.immersiveDetails .immersiveFrame .headingRow .headingLink .actionLinkLabel{color:ButtonText}}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer{min-height:106px}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox{padding:3px 0 0 3px}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox .iconButtonHost{min-width:141px;margin-bottom:5px;height:45px}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox .iconButtonHost button.iconButton{-ms-grid-rows:5px 1fr 0}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox .iconButtonHost button.iconButton .win-commandring{border-color:#ebebeb}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox .iconButtonHost button.iconButton .label{color:#ebebeb}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox .iconButtonHost button.iconButton .subtitle{color:#898989}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox .iconButtonHost.iconButtonWithSubtext button.iconButton{-ms-grid-rows:0 1fr 0}.immersiveDetails .immersiveFrame .contentRow .nonScrollableItemsContainer .verticalBox .iconButtonHost.iconButtonWithSubtext button.iconButton .textContainer{-ms-grid-rows:auto 16px}@media(min-height:900px){.immersiveDetails .immersiveFrame .headingRow,.immersiveDetails .immersiveViewMorePopOverContentLayout .headingRow{height:231px}}@media(min-height:1080px){.immersiveDetails .immersiveFrame .headingRow,.immersiveDetails .immersiveViewMorePopOverContentLayout .headingRow{height:192px}}@media(min-height:1200px){.immersiveDetails .immersiveFrame .headingRow,.immersiveDetails .immersiveViewMorePopOverContentLayout .headingRow{height:272px}}@media(min-height:1440px){.immersiveDetails .immersiveFrame .headingRow,.immersiveDetails .immersiveViewMorePopOverContentLayout .headingRow{height:352px}}@media(min-height:900px){.immersiveDetails .immersiveHeroBackgroundImageContainer.mediatype-movie{padding-top:47px}}@media(min-height:1080px){.immersiveDetails .immersiveHeroBackgroundImageContainer.mediatype-movie{padding-top:43px}}@media(min-height:1200px){.immersiveDetails .immersiveHeroBackgroundImageContainer.mediatype-movie{padding-top:44px}}@media(min-height:1440px){.immersiveDetails .immersiveHeroBackgroundImageContainer.mediatype-movie{padding-top:44px}}@media(min-height:900px){.immersiveDetails .firstImmersiveTwoColumn.immersiveTwoColumn{-ms-grid-rows:180px auto 12px auto 1fr}}@media(min-height:1080px){.immersiveDetails .firstImmersiveTwoColumn.immersiveTwoColumn{-ms-grid-rows:145px auto 12px auto 1fr}}@media(min-height:1200px){.immersiveDetails .firstImmersiveTwoColumn.immersiveTwoColumn{-ms-grid-rows:224px auto 12px auto 1fr}}@media(min-height:1440px){.immersiveDetails .firstImmersiveTwoColumn.immersiveTwoColumn{-ms-grid-rows:304px auto 12px auto 1fr}}.immersiveMediaPageTitle{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;height:132px;margin:0 0 0 120px;padding:0}html[dir=rtl] .immersiveMediaPageTitle{margin:0 120px 0 0}.immersiveMediaPageTitle .immersiveHeroPrimaryText{position:fixed;-ms-grid-column:1;-ms-grid-column-align:start;-ms-grid-row:1;padding:50px 0 0}@media(min-height:1080px){.immersiveMediaPageTitle .immersiveHeroPrimaryText{padding:60px 0 0}}@media(min-height:1200px){.immersiveMediaPageTitle .immersiveHeroPrimaryText{padding:80px 0 0}}@media(min-height:1440px){.immersiveMediaPageTitle .immersiveHeroPrimaryText{padding:150px 0 0}}.castAndCrewList-contributorList .contributorList-title{margin-bottom:-10px}@media(-ms-high-contrast){.headingRow .internalActionLink:hover .label.actionLinkLabel{color:ButtonText}}html[dir=ltr] .immersiveDetailsContainer>.movieOverviewFrame,html[dir=ltr] .immersiveDetailsContainer>.tvOverviewFrame{padding-left:0}.tvOverviewFrame .seasonView .seasonView-passDisclaimer{padding:10px 0;border-bottom:1px solid #646464;border-top:1px solid #646464}.template-watchNextEpisode .watchNextEpisode-clickArea{outline:none}.template-watchNextEpisode .watchNextEpisode-clickArea:hover .watchNextEpisode-episodeNumber,.template-watchNextEpisode .watchNextEpisode-clickArea:hover .watchNextEpisode-title{opacity:.6}.template-watchNextEpisode .watchNextEpisode-watchProgress{margin-top:30px}.template-watchNextEpisode .watchNextEpisode-metadata{margin-top:35px}.template-watchNextEpisode .watchNextEpisode-description{margin-top:20px}.template-watchNextEpisode .watchNextEpisode-details{color:#646464;opacity:1}.win-ui-dark .control-watchProgress .watchProgress-progressBar{color:#299c10;background-color:#3a3a3a}.tvSeasonModifier .modifierPopupScroller .win-template{height:100px}.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry{-ms-grid-columns:80px 10px 1fr;-ms-grid-rows:10px 80px 10px}.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:hover{background-color:#ebebeb}.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:hover .modifierPopupSeasonLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:hover .modifierPopupEpisodeLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:hover .modifierPopupOwnedLabel{color:#222}.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:focus,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget{background-color:#ebebeb}.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:focus .modifierPopupSeasonLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget .modifierPopupSeasonLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:focus .modifierPopupEpisodeLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget .modifierPopupEpisodeLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:focus .modifierPopupOwnedLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget .modifierPopupOwnedLabel{color:#ebebeb}@media(-ms-high-contrast:black-on-white){.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:hover .modifierPopupSeasonLabel,.tvSeasonModifier .modifierPopupScroller .initialSelectedModifierPopupEntry .modifierPopupSeasonLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:hover .modifierPopupEpisodeLabel,.tvSeasonModifier .modifierPopupScroller .initialSelectedModifierPopupEntry .modifierPopupEpisodeLabel,.tvSeasonModifier .modifierPopupScroller .modifierPopupEntry:hover .modifierPopupOwnedLabel,.tvSeasonModifier .modifierPopupScroller .initialSelectedModifierPopupEntry .modifierPopupOwnedLabel{color:HighlightText}}.tvSeasonModifier .modifierEntryImgContainer{-ms-grid-column:1;-ms-grid-row:2;width:80px;height:80px}.tvSeasonModifier .modifierEntryImgContainer img{width:100%;animation-duration:100ms}.tvSeasonModifier .modifierEntryTextContainer{-ms-grid-row:2;-ms-grid-column:3;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:30px auto 25px;height:80px}.tvSeasonModifier .modifierEntryTextContainer .modifierPopupSeasonLabel{color:#222}.tvSeasonModifier .modifierEntryTextContainer .modifierPopupEpisodeLabel{-ms-grid-row:2;color:#222}.tvSeasonModifier .modifierEntryTextContainer .modifierPopupOwnedLabel{-ms-grid-row:3;color:#646464}.immersiveTwoColumn.firstImmersiveTwoColumn{-ms-grid-rows:125px auto 12px auto 1fr;-ms-grid-columns:120px 1fr;margin-left:0;height:100%}.immersiveTwoColumn.firstImmersiveTwoColumn .primaryPanelModifier{position:relative;-ms-grid-row:2;-ms-grid-column:2}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContentContainer{-ms-grid-column:2}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroBackgroundImageContainer{-ms-grid-column:2;-ms-grid-row:1;-ms-grid-column-span:1;position:relative}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie{-ms-grid-row:2;-ms-grid-column:2;-ms-grid-column-span:1;-ms-grid-row-align:start;padding:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText{margin-top:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails{display:-ms-grid;-ms-grid-rows:18px auto 1fr;-ms-grid-columns:auto;height:80px}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails .ratingContainer{-ms-grid-row:2}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating{display:-ms-grid;-ms-grid-columns:14px auto 14px;-ms-grid-rows:auto auto;padding:0;margin:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .mediaRatingControl{-ms-grid-column:2;padding-bottom:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .mediaRatingControl .win-rating .win-star{height:20px;width:20px;font-size:20px;padding:0 2px}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .ratingInfo{-ms-grid-column:2;-ms-grid-row:2}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .ratingInfo .part-totalRatings,.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-movie .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .ratingInfo .part-userRatedIndicator{margin:0 2px;padding:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries{-ms-grid-row:2;-ms-grid-column:2;-ms-grid-column-span:1;-ms-grid-row-align:start;padding:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText{margin-top:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails{display:-ms-grid;-ms-grid-columns:44px auto 1fr auto 18px;-ms-grid-rows:10px 15px 30px 1fr;height:80px}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .ratingLabel{-ms-grid-column:2;-ms-grid-row:2;font-size:9pt;color:#646464}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .ratingContainer{-ms-grid-column:2;-ms-grid-row:3}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating{padding:0;margin:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .win-rating{padding-left:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .win-rating .win-star{height:20px;width:20px;font-size:20px;padding:0 2px}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .ratingContainer .control-starRating .ratingInfo .part-totalRatings{font-size:9pt}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .immersiveHeroSecondaryText{-ms-grid-column:4;-ms-grid-row:3}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .immersiveHeroSecondaryText .control-metaCritic{padding:0;margin:0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .immersiveHeroSecondaryText .control-metaCritic .part-metaCriticScore{width:25px;height:23px;padding:2px 0 0 0}.immersiveTwoColumn.firstImmersiveTwoColumn .immersiveHeroContent.mediatype-tvSeries .immersiveHeroText .immersiveHeroSubDetails .immersiveHeroSecondaryText .control-metaCritic .part-metaCriticLogo{margin:2px 4px 0 4px}.verticalScrollContainer,.verticalScrollContainerAuto{overflow-x:hidden}.verticalScrollContainer{overflow-y:scroll}.verticalScrollContainerAuto{overflow-y:auto}.immersiveFrame .tv,.immersiveFrame .tv .overview,.immersiveFrame .movie,.immersiveFrame .movie .overview{height:100%}.immersiveFrame .tv .overview .immersiveColumnPadding,.immersiveFrame .movie .overview .immersiveColumnPadding{margin-left:20px;margin-right:20px}.movieRelatedFrame.immersiveTwoColumn{width:1395px}.movieRelatedFrame.immersiveTwoColumn .immersiveFrame{-ms-grid-rows:auto 1fr 60px}@media(max-height:900px){.movieRelatedFrame.immersiveTwoColumn{width:1045px}}.immersiveDetails .movie .contextButtonContainer{margin-bottom:0}.movie .immersiveDetails .contextButtonContainer{min-height:50px}.video1 .immersivePageTitle .immersiveSecondaryText{font-size:14pt;letter-spacing:.03em;font-weight:600;opacity:0}.seasonView .contentNotificationListItemWrapper{padding:0 20px}.contentNotificationListIcon,.contentNotificationListItemDescription{color:#646464;opacity:1}.popOver.tv{-ms-grid-columns:auto;width:470px;height:550px}.popOver.tv .rightColumn{-ms-grid-column:1;-ms-grid-columns:35px 400px 35px;-ms-grid-rows:20px auto auto 20px 1fr 22px}.popOver.tv .actions{-ms-grid-row:2;-ms-grid-row-span:1;-ms-grid-column-span:1;-ms-grid-columns:auto}.popOver.tv .actions .verticalBox{-ms-flex-direction:row;-ms-flex-wrap:wrap;width:400px;min-height:50px}.popOver.tv .actions .verticalBox .iconButtonHost{min-width:180px}.popOver.tv .actions .verticalBox .iconButtonHost .iconButton .win-label{line-height:1.3636}.popOver.tv .titleContainer{-ms-grid-column:2;-ms-grid-row:3;margin-top:20px}.popOver.tv .titleContainer .episodeTitle{display:-ms-grid;-ms-grid-columns:auto auto}.popOver.tv .titleContainer .episodeTitle .episodeNumber{margin-right:10px}html[dir=rtl] .popOver.tv .titleContainer .episodeTitle .episodeNumber{margin-left:10px;margin-right:0}.popOver.tv .titleContainer .episodeTitle .title{margin-top:0;-ms-grid-column:2}.popOver.tv .titleContainer .watchProgress .watchProgress-progressBar{margin-top:20px}.popOver.tv .titleContainer .watchProgress .watchProgress-progressBar.removeFromDisplay{margin-top:0}.popOver.tv .titleContainer .contentNotificationList{-ms-grid-row:2}.popOver.tv .bodyContainer{-ms-grid-column:2;-ms-grid-column-span:1}.popOver.tv .bodyContainer>div:not(.title){margin:0}html[dir=rtl] .popOver.tv .bodyContainer>div:not(.title){margin-left:20px;margin-right:0}.relatedArtists.related .mediatype-artist.horizontalListItem .imageContainer,.immersiveDetails .related .mediatype-tvSeries,.immersiveDetails .related .mediatype-movie{outline-style:none}html[dir=ltr] .immersiveDetailsContainer .firstImmersiveTwoColumn{padding-right:0}html[dir=rtl] .immersiveDetailsContainer .firstImmersiveTwoColumn{padding-left:0}.control-rottenTomatoesOverview .rottenTomatoesOverview-scoreDataGrid .rottenTomatoesOverview-percentScore{}.control-rottenTomatoesOverview .rottenTomatoesOverview-tomatometer{}.control-rottenTomatoesOverview .rottenTomatoesOverview-subtitle{}.control-rottenTomatoesReviewItem,.control-rottenTomatoesReviewItem:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-rottenTomatoesReviewItem.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .control-rottenTomatoesReviewItem.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-rottenTomatoesReviewItem.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .control-rottenTomatoesReviewItem.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-scoreDataGrid .rottenTomatoesReviewItem-title{}.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-scoreDataGrid .rottenTomatoesReviewItem-subtitle{}.control-rottenTomatoesReviewItem .rottenTomatoesReviewItem-metadata{}.control-immersiveListViewItem{outline:none;position:relative}.control-immersiveListViewItem:hover .part-title,.control-immersiveListViewItem:hover:active:not(.selected) .part-title,.control-immersiveListViewItem:hover .part-subTitle,.control-immersiveListViewItem:hover:active:not(.selected) .part-subTitle{opacity:.6}.icon,.win-commandimage,.inlineGlyph,.inlineGlyphSmall,.infoNotificationIcon{font-family:'Segoe Xbox MVR Symbol','Segoe Xbox Symbol','Segoe UI Symbol'!important;font-weight:400!important}.glyph,.inlineGlyph{line-height:30px}.icon-mvr-addTo:before{content:""}.icon-mvr-arrowNext:before{content:""}.icon-mvr-arrowPrevious:before{content:""}.icon-mvr-devices:before{content:""}.icon-mvr-inlineNowPlaying:before{content:""}.icon-mvr-mediaMusic:before{content:""}.icon-mvr-playlistMusic:before{content:""}.icon-mvr-radio:before{content:""}.icon-xbox-explore:before{content:""}.icon-xbox-inlineNowPlaying:before{content:""}.icon-xbox-playlistImport:before{content:""}.icon-xbox-shuffle:before{content:""}.icon-xbox-toggleMenu:before{content:""}.icon-xbox-volumeDisabled:before{content:""}.icon-xbox-xenon:before{content:""}.icon-xbox-devices:before{content:""}.icon-win-bullet:before{content:"᛫"}.icon-win-find:before{content:""}.icon-win-mute:before{content:""}.icon-win-more:before{content:""}.icon-win-next:before{content:""}.icon-win-play:before{content:""}.icon-win-pause:before{content:""}.icon-win-previous:before{content:""}.icon-win-volume:before{content:""}.icon-win-shuffle:before{content:""}.icon-win-repeat:before{content:""}.icon-win-closedCaption:before{content:""}.icon-win-audioTracks:before{content:""}.acc-preserveBackground{-ms-high-contrast-adjust:none}html[dir=ltr] .icon-previous-page:before{content:""}html[dir=ltr] .icon-next-page:before{content:""}html[dir=rtl] .icon-previous-page:before{content:""}html[dir=rtl] .icon-next-page:before{content:""}.icon-xenon{font-size:25pt;line-height:51pt}.icon-navBranding{font-size:19pt;line-height:25px;font-size:16pt}.icon-xbox-toggleMenu:before{content:""}.icon-xbox-xenon:before{content:""}@keyframes keys-fadeOut{100%{opacity:0}}@keyframes keys-fadeIn{100%{opacity:1}}@keyframes keys-fadeOut{100%{opacity:0}}@font-face{font-family:"Segoe Xbox MVR Symbol";src:url('/fonts/segxmvr.woff') format('woff');font-weight:300;font-style:normal}@font-face{font-family:"Segoe Xbox Symbol";src:url('/fonts/segxsym.woff') format('woff');font-weight:300;font-style:normal}body,input,button,option,select,textarea,.win-textarea,.win-type-xx-large,.win-type-x-large,.win-type-large,.win-type-medium,.win-type-small,.win-type-x-small,.win-type-xx-small{font-feature-settings:"kern" 1,"dlig" 1,"ss20" 1}html:-ms-lang(en) .offlineDialog .dialogCaption,html:-ms-lang(en) .viewStateControl-notifications .errorContainer-title{font-feature-settings:"kern" 1,"dlig" 0,"ss20" 1}.text-fixedWidthNumerals{font-feature-settings:"kern" 1,"dlig" 1,"tnum" 1}.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.maxLines-two,.maxLines-three,.maxLines-four{overflow:hidden;word-wrap:normal;white-space:normal}.text-breakWord{white-space:normal;word-wrap:break-word;word-break:keep-all;overflow:hidden}.maxLines-two-xxSmall{max-height:24.75pt}.maxLines-three-xxSmall{max-height:38.25pt}.maxLines-four-xxSmall{max-height:65.25pt}.maxLines-two-xSmall{max-height:24.75pt}.maxLines-three-xSmall{max-height:38.25pt}.maxLines-four-xSmall{max-height:65.25pt}.maxLines-two-small{max-height:32.25pt}.maxLines-three-small{max-height:48.75pt}.maxLines-four-small{max-height:65.25pt}.maxLines-two-medium{max-height:56pt}.maxLines-three-medium{max-height:76pt}.maxLines-four-medium{max-height:106pt}.icon,.icon-xxxSmall,.icon-xxSmall,.icon-xSmall,.icon-small,.icon-medium,.icon-large,.icon-xLarge,.icon-xxLarge,.win-commandimage,.inlineGlyph,.inlineGlyphSmall,.infoNotificationIcon,.searchBoxIcon,.smartDJIcon,.xboxIcon,.smartGlassGem,.dashboardGridItemContent.thumbnailButtonGlyph .imageHolder,.win-backbutton.homeIcon:before,.musicBrandActionLink button .actionLinkLabel:after,.cloudGrovelInfoContent .cloudGrovelInfoLink:after{font-family:'Segoe Xbox MVR Symbol','Segoe Xbox Symbol','Segoe UI Symbol'!important;font-weight:400!important}.icon-font-mvr{font-family:'Segoe Xbox MVR Symbol'!important}.icon-font-xbox{font-family:'Segoe Xbox Symbol'!important}.icon-font-win{font-family:'Segoe UI Symbol'!important}.text-bodyContent{font-size:11pt;font-weight:400;line-height:15pt}.text-bodyContent.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-bodyContent.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-bodyContent.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-bodyContent.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-bodyContent.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-bodyContent.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-bodyContent.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-bodyContent.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-bodyContent.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-bodyContent.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-bodyContent.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-bodyContent.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-bodyContent.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-bodyContent.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-bodyContent.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-numeralLarge{font-size:42pt;font-weight:200;line-height:52.5pt}.text-numeralLarge.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:52.5pt;word-wrap:normal}.text-numeralLarge.maxLines-two{overflow:hidden;white-space:normal;max-height:105pt}.text-numeralLarge.maxLines-three{overflow:hidden;white-space:normal;max-height:158pt}.text-numeralLarge.maxLines-four{overflow:hidden;white-space:normal;max-height:210pt}.text-numeralLarge.maxLines-seven{overflow:hidden;white-space:normal;max-height:368pt}.text-galleryNotificationSecondary{font-size:11pt;font-weight:400;line-height:15pt}.text-galleryNotificationSecondary.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-galleryNotificationSecondary.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-galleryNotificationSecondary.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-galleryNotificationSecondary.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-galleryNotificationSecondary.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-galleryNotificationSecondary.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-galleryNotificationSecondary.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-galleryNotificationSecondary.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-galleryNotificationSecondary.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-galleryNotificationSecondary.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-galleryNotificationSecondary.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-galleryNotificationSecondary.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-galleryNotificationSecondary.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-galleryNotificationSecondary.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-galleryNotificationSecondary.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-bodyContent,.text-itemTitle,.text-heroItemSubTitle,.text-metadata,.text-link,.text-tab,.text-dropdownMenu,.text-filterTitle,.text-filterDescription,.text-modifierDropDownArrow,.text-modifierPopupEntry,.text-navItemAlt,.text-notificationSubText,.text-bodyPanelMessagingItemTitle,.text-bodyPanelMessagingSecondary,.showMoreLink{font-size:11pt;font-weight:400;line-height:15pt}.text-bodyContent.maxLines-one,.text-itemTitle.maxLines-one,.text-heroItemSubTitle.maxLines-one,.text-metadata.maxLines-one,.text-link.maxLines-one,.text-tab.maxLines-one,.text-dropdownMenu.maxLines-one,.text-filterTitle.maxLines-one,.text-filterDescription.maxLines-one,.text-modifierDropDownArrow.maxLines-one,.text-modifierPopupEntry.maxLines-one,.text-navItemAlt.maxLines-one,.text-notificationSubText.maxLines-one,.text-bodyPanelMessagingItemTitle.maxLines-one,.text-bodyPanelMessagingSecondary.maxLines-one,.showMoreLink.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-bodyContent.maxLines-two,.text-itemTitle.maxLines-two,.text-heroItemSubTitle.maxLines-two,.text-metadata.maxLines-two,.text-link.maxLines-two,.text-tab.maxLines-two,.text-dropdownMenu.maxLines-two,.text-filterTitle.maxLines-two,.text-filterDescription.maxLines-two,.text-modifierDropDownArrow.maxLines-two,.text-modifierPopupEntry.maxLines-two,.text-navItemAlt.maxLines-two,.text-notificationSubText.maxLines-two,.text-bodyPanelMessagingItemTitle.maxLines-two,.text-bodyPanelMessagingSecondary.maxLines-two,.showMoreLink.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-bodyContent.maxLines-three,.text-itemTitle.maxLines-three,.text-heroItemSubTitle.maxLines-three,.text-metadata.maxLines-three,.text-link.maxLines-three,.text-tab.maxLines-three,.text-dropdownMenu.maxLines-three,.text-filterTitle.maxLines-three,.text-filterDescription.maxLines-three,.text-modifierDropDownArrow.maxLines-three,.text-modifierPopupEntry.maxLines-three,.text-navItemAlt.maxLines-three,.text-notificationSubText.maxLines-three,.text-bodyPanelMessagingItemTitle.maxLines-three,.text-bodyPanelMessagingSecondary.maxLines-three,.showMoreLink.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-bodyContent.maxLines-four,.text-itemTitle.maxLines-four,.text-heroItemSubTitle.maxLines-four,.text-metadata.maxLines-four,.text-link.maxLines-four,.text-tab.maxLines-four,.text-dropdownMenu.maxLines-four,.text-filterTitle.maxLines-four,.text-filterDescription.maxLines-four,.text-modifierDropDownArrow.maxLines-four,.text-modifierPopupEntry.maxLines-four,.text-navItemAlt.maxLines-four,.text-notificationSubText.maxLines-four,.text-bodyPanelMessagingItemTitle.maxLines-four,.text-bodyPanelMessagingSecondary.maxLines-four,.showMoreLink.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-bodyContent.maxLines-seven,.text-itemTitle.maxLines-seven,.text-heroItemSubTitle.maxLines-seven,.text-metadata.maxLines-seven,.text-link.maxLines-seven,.text-tab.maxLines-seven,.text-dropdownMenu.maxLines-seven,.text-filterTitle.maxLines-seven,.text-filterDescription.maxLines-seven,.text-modifierDropDownArrow.maxLines-seven,.text-modifierPopupEntry.maxLines-seven,.text-navItemAlt.maxLines-seven,.text-notificationSubText.maxLines-seven,.text-bodyPanelMessagingItemTitle.maxLines-seven,.text-bodyPanelMessagingSecondary.maxLines-seven,.showMoreLink.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-bodyContent.maxLines-one,.text-itemTitle.maxLines-one,.text-heroItemSubTitle.maxLines-one,.text-metadata.maxLines-one,.text-link.maxLines-one,.text-tab.maxLines-one,.text-dropdownMenu.maxLines-one,.text-filterTitle.maxLines-one,.text-filterDescription.maxLines-one,.text-modifierDropDownArrow.maxLines-one,.text-modifierPopupEntry.maxLines-one,.text-navItemAlt.maxLines-one,.text-notificationSubText.maxLines-one,.text-bodyPanelMessagingItemTitle.maxLines-one,.text-bodyPanelMessagingSecondary.maxLines-one,.showMoreLink.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-bodyContent.maxLines-two,.text-itemTitle.maxLines-two,.text-heroItemSubTitle.maxLines-two,.text-metadata.maxLines-two,.text-link.maxLines-two,.text-tab.maxLines-two,.text-dropdownMenu.maxLines-two,.text-filterTitle.maxLines-two,.text-filterDescription.maxLines-two,.text-modifierDropDownArrow.maxLines-two,.text-modifierPopupEntry.maxLines-two,.text-navItemAlt.maxLines-two,.text-notificationSubText.maxLines-two,.text-bodyPanelMessagingItemTitle.maxLines-two,.text-bodyPanelMessagingSecondary.maxLines-two,.showMoreLink.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-bodyContent.maxLines-three,.text-itemTitle.maxLines-three,.text-heroItemSubTitle.maxLines-three,.text-metadata.maxLines-three,.text-link.maxLines-three,.text-tab.maxLines-three,.text-dropdownMenu.maxLines-three,.text-filterTitle.maxLines-three,.text-filterDescription.maxLines-three,.text-modifierDropDownArrow.maxLines-three,.text-modifierPopupEntry.maxLines-three,.text-navItemAlt.maxLines-three,.text-notificationSubText.maxLines-three,.text-bodyPanelMessagingItemTitle.maxLines-three,.text-bodyPanelMessagingSecondary.maxLines-three,.showMoreLink.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-bodyContent.maxLines-four,.text-itemTitle.maxLines-four,.text-heroItemSubTitle.maxLines-four,.text-metadata.maxLines-four,.text-link.maxLines-four,.text-tab.maxLines-four,.text-dropdownMenu.maxLines-four,.text-filterTitle.maxLines-four,.text-filterDescription.maxLines-four,.text-modifierDropDownArrow.maxLines-four,.text-modifierPopupEntry.maxLines-four,.text-navItemAlt.maxLines-four,.text-notificationSubText.maxLines-four,.text-bodyPanelMessagingItemTitle.maxLines-four,.text-bodyPanelMessagingSecondary.maxLines-four,.showMoreLink.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-bodyContent.maxLines-seven,.text-itemTitle.maxLines-seven,.text-heroItemSubTitle.maxLines-seven,.text-metadata.maxLines-seven,.text-link.maxLines-seven,.text-tab.maxLines-seven,.text-dropdownMenu.maxLines-seven,.text-filterTitle.maxLines-seven,.text-filterDescription.maxLines-seven,.text-modifierDropDownArrow.maxLines-seven,.text-modifierPopupEntry.maxLines-seven,.text-navItemAlt.maxLines-seven,.text-notificationSubText.maxLines-seven,.text-bodyPanelMessagingItemTitle.maxLines-seven,.text-bodyPanelMessagingSecondary.maxLines-seven,.showMoreLink.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-bodyContent.maxLines-one,.text-itemTitle.maxLines-one,.text-heroItemSubTitle.maxLines-one,.text-metadata.maxLines-one,.text-link.maxLines-one,.text-tab.maxLines-one,.text-dropdownMenu.maxLines-one,.text-filterTitle.maxLines-one,.text-filterDescription.maxLines-one,.text-modifierDropDownArrow.maxLines-one,.text-modifierPopupEntry.maxLines-one,.text-navItemAlt.maxLines-one,.text-notificationSubText.maxLines-one,.text-bodyPanelMessagingItemTitle.maxLines-one,.text-bodyPanelMessagingSecondary.maxLines-one,.showMoreLink.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-bodyContent.maxLines-two,.text-itemTitle.maxLines-two,.text-heroItemSubTitle.maxLines-two,.text-metadata.maxLines-two,.text-link.maxLines-two,.text-tab.maxLines-two,.text-dropdownMenu.maxLines-two,.text-filterTitle.maxLines-two,.text-filterDescription.maxLines-two,.text-modifierDropDownArrow.maxLines-two,.text-modifierPopupEntry.maxLines-two,.text-navItemAlt.maxLines-two,.text-notificationSubText.maxLines-two,.text-bodyPanelMessagingItemTitle.maxLines-two,.text-bodyPanelMessagingSecondary.maxLines-two,.showMoreLink.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-bodyContent.maxLines-three,.text-itemTitle.maxLines-three,.text-heroItemSubTitle.maxLines-three,.text-metadata.maxLines-three,.text-link.maxLines-three,.text-tab.maxLines-three,.text-dropdownMenu.maxLines-three,.text-filterTitle.maxLines-three,.text-filterDescription.maxLines-three,.text-modifierDropDownArrow.maxLines-three,.text-modifierPopupEntry.maxLines-three,.text-navItemAlt.maxLines-three,.text-notificationSubText.maxLines-three,.text-bodyPanelMessagingItemTitle.maxLines-three,.text-bodyPanelMessagingSecondary.maxLines-three,.showMoreLink.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-bodyContent.maxLines-four,.text-itemTitle.maxLines-four,.text-heroItemSubTitle.maxLines-four,.text-metadata.maxLines-four,.text-link.maxLines-four,.text-tab.maxLines-four,.text-dropdownMenu.maxLines-four,.text-filterTitle.maxLines-four,.text-filterDescription.maxLines-four,.text-modifierDropDownArrow.maxLines-four,.text-modifierPopupEntry.maxLines-four,.text-navItemAlt.maxLines-four,.text-notificationSubText.maxLines-four,.text-bodyPanelMessagingItemTitle.maxLines-four,.text-bodyPanelMessagingSecondary.maxLines-four,.showMoreLink.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-bodyContent.maxLines-seven,.text-itemTitle.maxLines-seven,.text-heroItemSubTitle.maxLines-seven,.text-metadata.maxLines-seven,.text-link.maxLines-seven,.text-tab.maxLines-seven,.text-dropdownMenu.maxLines-seven,.text-filterTitle.maxLines-seven,.text-filterDescription.maxLines-seven,.text-modifierDropDownArrow.maxLines-seven,.text-modifierPopupEntry.maxLines-seven,.text-navItemAlt.maxLines-seven,.text-notificationSubText.maxLines-seven,.text-bodyPanelMessagingItemTitle.maxLines-seven,.text-bodyPanelMessagingSecondary.maxLines-seven,.showMoreLink.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-errorTitle,.text-heroTitle{font-size:42pt;line-height:52.5pt;font-weight:700}.text-errorTitle.maxLines-one,.text-heroTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:52.5pt;word-wrap:normal}.text-errorTitle.maxLines-two,.text-heroTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:105pt}.text-errorTitle.maxLines-three,.text-heroTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:158pt}.text-errorTitle.maxLines-four,.text-heroTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:210pt}.text-errorTitle.maxLines-seven,.text-heroTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:368pt}@media(max-width:1366px){.text-errorTitle,.text-heroTitle{font-size:28pt;line-height:33.75pt;font-weight:700}.text-errorTitle.maxLines-one,.text-heroTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:33.75pt;word-wrap:normal}.text-errorTitle.maxLines-two,.text-heroTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:68pt}.text-errorTitle.maxLines-three,.text-heroTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:101pt}.text-errorTitle.maxLines-four,.text-heroTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:135pt}.text-errorTitle.maxLines-seven,.text-heroTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:236pt}}.text-heroSubTitle{font-size:14pt;line-height:18.875pt;font-weight:400}.text-heroSubTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:18.875pt;word-wrap:normal}.text-heroSubTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:38pt}.text-heroSubTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:57pt}.text-heroSubTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:76pt}.text-heroSubTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:132pt}.text-subHeader{font-size:14pt;line-height:18.875pt;font-weight:700}.text-subHeader.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:18.875pt;word-wrap:normal}.text-subHeader.maxLines-two{overflow:hidden;white-space:normal;max-height:38pt}.text-subHeader.maxLines-three{overflow:hidden;white-space:normal;max-height:57pt}.text-subHeader.maxLines-four{overflow:hidden;white-space:normal;max-height:76pt}.text-subHeader.maxLines-seven{overflow:hidden;white-space:normal;max-height:132pt}.text-subHeader2{font-size:11pt;line-height:15pt;font-weight:700}.text-subHeader2.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-subHeader2.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-subHeader2.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-subHeader2.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-subHeader2.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-detailHeader,.text-navHeaderTitle{font-size:20pt;line-height:26.25pt;font-weight:700}.text-detailHeader.maxLines-one,.text-navHeaderTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:26.25pt;word-wrap:normal}.text-detailHeader.maxLines-two,.text-navHeaderTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:53pt}.text-detailHeader.maxLines-three,.text-navHeaderTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:79pt}.text-detailHeader.maxLines-four,.text-navHeaderTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:105pt}.text-detailHeader.maxLines-seven,.text-navHeaderTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:184pt}.text-textItemTitle{font-size:11pt;line-height:15pt;font-weight:700}.text-textItemTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-textItemTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-textItemTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-textItemTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-textItemTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-errorSubTitle{font-size:11pt;font-weight:400;line-height:15pt}.text-errorSubTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-errorSubTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-errorSubTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-errorSubTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-errorSubTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-errorSubTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-errorSubTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-errorSubTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-errorSubTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-errorSubTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.text-errorSubTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.text-errorSubTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.text-errorSubTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.text-errorSubTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.text-errorSubTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.icon-inlineAction{font-size:10.75pt}.icon-dialogControl{font-size:11pt}.iconbase-bodyPanelMessaging{font-size:12pt}.text-appLogoTitle{font-size:15pt;font-weight:400;line-height:1.3636}.text-bodyPanelMessagingHeader{font-size:14pt;line-height:18.875pt;font-weight:400}.text-bodyPanelMessagingHeader.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:18.875pt;word-wrap:normal}.text-bodyPanelMessagingHeader.maxLines-two{overflow:hidden;white-space:normal;max-height:38pt}.text-bodyPanelMessagingHeader.maxLines-three{overflow:hidden;white-space:normal;max-height:57pt}.text-bodyPanelMessagingHeader.maxLines-four{overflow:hidden;white-space:normal;max-height:76pt}.text-bodyPanelMessagingHeader.maxLines-seven{overflow:hidden;white-space:normal;max-height:132pt}.text-modifierDropDownArrow{line-height:11pt}::selection,input[type=text]::selection,input[type=search]::selection,input[type=number]::selection,select:focus::-ms-value,option:checked,option:checked:hover,.win-toggleswitch .win-switch::-ms-fill-lower{color:#ebebeb;background-color:#107c10}.control-pagedItemsControl{display:-ms-grid;-ms-grid-columns:40px 1fr 40px;-ms-grid-rows:1fr}.control-pagedItemsControl .pagedItemsControl-previousButton,.control-pagedItemsControl .pagedItemsControl-nextButton{font-weight:700;line-height:26.25pt;font-size:20pt;min-width:40px}@media(-ms-high-contrast:none){.control-pagedItemsControl .pagedItemsControl-previousButton:hover,.control-pagedItemsControl .pagedItemsControl-nextButton:hover{opacity:.8}.control-pagedItemsControl .pagedItemsControl-previousButton:active,.control-pagedItemsControl .pagedItemsControl-nextButton:active,.control-pagedItemsControl .pagedItemsControl-previousButton:hover:active,.control-pagedItemsControl .pagedItemsControl-nextButton:hover:active{opacity:.6}}.control-pagedItemsControl .pagedItemsControl-previousButton,.control-pagedItemsControl .pagedItemsControl-nextButton,.control-pagedItemsControl .pagedItemsControl-previousButton:focus,.control-pagedItemsControl .pagedItemsControl-nextButton:focus{border:none;outline:none}.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus,.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus{outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus,.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus{outline-color:-ms-hotlight}}.control-pagedItemsControl .pagedItemsControl-previousButton.maxLines-one,.control-pagedItemsControl .pagedItemsControl-nextButton.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:26.25pt;word-wrap:normal}.control-pagedItemsControl .pagedItemsControl-previousButton.maxLines-two,.control-pagedItemsControl .pagedItemsControl-nextButton.maxLines-two{overflow:hidden;white-space:normal;max-height:53pt}.control-pagedItemsControl .pagedItemsControl-previousButton.maxLines-three,.control-pagedItemsControl .pagedItemsControl-nextButton.maxLines-three{overflow:hidden;white-space:normal;max-height:79pt}.control-pagedItemsControl .pagedItemsControl-previousButton.maxLines-four,.control-pagedItemsControl .pagedItemsControl-nextButton.maxLines-four{overflow:hidden;white-space:normal;max-height:105pt}.control-pagedItemsControl .pagedItemsControl-previousButton.maxLines-seven,.control-pagedItemsControl .pagedItemsControl-nextButton.maxLines-seven{overflow:hidden;white-space:normal;max-height:184pt}.control-pagedItemsControl .pagedItemsControl-previousButton.state-pagedItemsControlButtonDisabled,.control-pagedItemsControl .pagedItemsControl-nextButton.state-pagedItemsControlButtonDisabled{display:none}.control-pagedItemsControl .pagedItemsControl-previousButton{-ms-grid-column:1}.control-pagedItemsControl .pagedItemsControl-nextButton{-ms-grid-column:3}.control-pagedItemsControl .pagedItemsControl-itemsControlContainer{-ms-grid-column:2;width:100%;overflow-x:auto;overflow-y:hidden;-ms-touch-action:pan-y;-ms-scroll-translation:none;-ms-overflow-style:none}.control-shrinkAndStayHeaderControl{width:100%;height:100%}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader{display:none;position:absolute;width:calc(100% - 17px);height:70px;top:0;-ms-grid-columns:40px auto minmax(50px,min-content) auto auto 1fr 40px;-ms-grid-rows:1fr;background-color:#303030;color:#222;transform:translateY(-70px);transition-property:transform}@media(-ms-high-contrast){.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader{color:WindowText}}.nav-currentPage .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader{display:-ms-grid}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader:not(.dropDownHeader_expanded):not(.dropDownHeader_collapsed){visibility:hidden}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader.dropDownHeader_expanded{transform:translateY(0);transition-duration:.25s;transition-timing-function:cubic-bezier(.24,.88,.68,.91)}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader.dropDownHeader_collapsed{transform:translateY(-70px);transition-duration:.2s;transition-timing-function:cubic-bezier(.68,.01,.91,.24)}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-backButton{-ms-grid-column:2;-ms-grid-row-align:center}html[dir=ltr] .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-backButton{margin-right:13px}html[dir=rtl] .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-backButton{margin-left:13px}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-title{-ms-grid-column:3;-ms-grid-row-align:center;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton{-ms-grid-column:4;-ms-grid-row-align:center}html[dir=ltr] .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton{margin-left:20px}html[dir=rtl] .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton{margin-right:20px}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button{width:30px;height:30px;padding:0;margin-top:3px;color:#222}html[dir=ltr] .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button{margin-right:20px}html[dir=rtl] .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button{margin-left:20px}@media(-ms-high-contrast:none){.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button:hover{opacity:.8}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button:active,.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button:hover:active{opacity:.6}}@media(-ms-high-contrast){.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button{color:Highlight}}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button,.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button:focus{border:none;outline:none}.showKeyboardFocus .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button:focus{outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton .actionButton-button:focus{outline-color:-ms-hotlight}}.win-zooming-x .shrinkAndStay-headerContainer>div,.win-zooming-y .shrinkAndStay-headerContainer>div{visibility:hidden}.template-carouselModule{display:-ms-grid;-ms-grid-column:1;-ms-grid-rows:auto auto 30px;-ms-grid-columns:40px 1fr 40px}.template-carouselModule .carouselModule-header{-ms-grid-row:1;-ms-grid-column:2;width:100%;display:-ms-grid;-ms-grid-columns:1fr 20px auto 8px;-ms-grid-rows:48px}html[dir=ltr] .template-carouselModule .carouselModule-header{padding-left:4px}html[dir=rtl] .template-carouselModule .carouselModule-header{padding-right:4px}.template-carouselModule .carouselModule-header .header-title{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-align:center;-ms-grid-column-align:start;width:100%}.template-carouselModule .carouselModule-header .header-link{-ms-grid-column:3;-ms-grid-row:1;-ms-grid-column-align:end;-ms-grid-row-align:center;color:#5dc21e}@media(-ms-high-contrast){.template-carouselModule .carouselModule-header .header-link{color:-ms-hotlight}}.template-carouselModule .carouselModule-header .header-link,.template-carouselModule .carouselModule-header .header-link:focus{border:none;outline:none}.showKeyboardFocus .template-carouselModule .carouselModule-header .header-link:focus{outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .template-carouselModule .carouselModule-header .header-link:focus{outline-color:-ms-hotlight}}.template-carouselModule .carouselModule-header .header-link:hover{color:#299c10}@media(-ms-high-contrast){.template-carouselModule .carouselModule-header .header-link:hover{color:HighlightText;background-color:Highlight}}.template-carouselModule .carouselModule-header .header-link:active{color:#107c10}@media(-ms-high-contrast){.template-carouselModule .carouselModule-header .header-link:active{color:ButtonFace;background-color:ButtonText}}.template-carouselModule .carouselModule-itemsContainer{-ms-grid-row:2;-ms-grid-column:1;-ms-grid-column-span:3;-ms-grid-column-align:start;width:calc(100% - 17px);color:#222}.template-carouselModule .carouselModule-itemsContainer .pagedItemsControl-rows .pagedItemsControl-itemsControl{display:-ms-flexbox;-ms-flex-direction:row;-ms-flex-wrap:nowrap}.template-carouselModule.carouselModule_itemWidth160 .carouselModule-header{width:calc(((100%) - ((100%) mod 160px)))}@media(max-width:768px){.template-carouselModule.carouselModule_itemWidth160 .carouselModule-header{width:calc(100% - 17px)}}.template-carouselModule.carouselModule_itemWidth160 .carouselModule-itemsContainer{width:calc(((100% - 80px) - ((100% - 80px) mod 160px)) + 80px)}@media(max-width:768px){.template-carouselModule.carouselModule_itemWidth160 .carouselModule-itemsContainer{width:calc(100% - 17px)}}.template-headerNotification{width:100%;height:80px;display:-ms-grid;-ms-grid-columns:1fr 40px auto;-ms-grid-rows:1fr;margin-bottom:20px;font-size:11pt;font-weight:400;line-height:15pt;color:#222;border-top:1px solid #898989;border-bottom:1px solid #898989}.template-headerNotification.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.template-headerNotification.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.template-headerNotification.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.template-headerNotification.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.template-headerNotification.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.template-headerNotification.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.template-headerNotification.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.template-headerNotification.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.template-headerNotification.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.template-headerNotification.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.template-headerNotification.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.template-headerNotification.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.template-headerNotification.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.template-headerNotification.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.template-headerNotification.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}@media(-ms-high-contrast){.template-headerNotification{color:WindowText}}.template-headerNotification .headerNotification-content{-ms-grid-row-align:center;display:-ms-grid;-ms-grid-columns:23px 1fr;-ms-grid-rows:auto auto auto}.template-headerNotification .headerNotification-content .content-icon{-ms-grid-row-span:3;-ms-grid-row-align:start;color:#646464}@media(-ms-high-contrast){.template-headerNotification .headerNotification-content .content-icon{color:WindowText}}.template-headerNotification .headerNotification-content .content-primaryText{-ms-grid-column:2;overflow:hidden;max-height:30pt;text-overflow:clip;white-space:normal}.template-headerNotification .headerNotification-content .content-secondaryText{-ms-grid-column:2;-ms-grid-row:2;color:#646464}@media(-ms-high-contrast){.template-headerNotification .headerNotification-content .content-secondaryText{color:WindowText}}.template-headerNotification .headerNotification-content .content-actions{-ms-grid-column:2;-ms-grid-row:3;display:-ms-flexbox;-ms-flex-direction:row;-ms-flex-wrap:wrap;max-height:21px;overflow:hidden}.template-headerNotification .headerNotification-content .content-actions .win-template{-ms-flex:0 0 auto;max-width:100%}.template-headerNotification .headerNotification-closeButton{-ms-grid-column:3;-ms-grid-row-align:center;padding:4px;transform:translateX(4px);color:#5dc21e}html[dir=rtl] .template-headerNotification .headerNotification-closeButton{transform:translateX(-4px)}.template-headerNotification .headerNotification-closeButton,.template-headerNotification .headerNotification-closeButton:focus{border:none;outline:none}.showKeyboardFocus .template-headerNotification .headerNotification-closeButton:focus{outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .template-headerNotification .headerNotification-closeButton:focus{outline-color:-ms-hotlight}}@media(-ms-high-contrast:none){.template-headerNotification .headerNotification-closeButton:hover{opacity:.8}.template-headerNotification .headerNotification-closeButton:active,.template-headerNotification .headerNotification-closeButton:hover:active{opacity:.6}}@media(-ms-high-contrast){.template-headerNotification .headerNotification-closeButton{color:Highlight}}.template-headerNotification .headerNotification-closeButton:hover{color:#5dc21e}@media(-ms-high-contrast){.template-headerNotification .headerNotification-closeButton:hover{color:HighlightText}}.template-headerNotification .headerNotification-closeButton:active{color:#5dc21e}@media(-ms-high-contrast){.template-headerNotification .headerNotification-closeButton:active{color:HighlightText}}.template-headerNotificationActionItem{display:-ms-grid;-ms-grid-columns:auto 1fr;-ms-grid-rows:auto}.template-headerNotificationActionItem .headerNotificationActionItem-separator{margin:0 10px;transform:translateY(3px);color:#646464}@media(-ms-high-contrast){.template-headerNotificationActionItem .headerNotificationActionItem-separator{color:WindowText}}.template-headerNotificationActionItem .headerNotificationActionItem-text{-ms-grid-column:2;padding:0;color:#5dc21e}.template-headerNotificationActionItem .headerNotificationActionItem-text,.template-headerNotificationActionItem .headerNotificationActionItem-text:focus{border:0 solid;outline-style:none}.showKeyboardFocus .template-headerNotificationActionItem .headerNotificationActionItem-text:focus{position:relative}.showKeyboardFocus .template-headerNotificationActionItem .headerNotificationActionItem-text:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .template-headerNotificationActionItem .headerNotificationActionItem-text:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .template-headerNotificationActionItem .headerNotificationActionItem-text:focus.selected:after{outline-color:HighlightText}}@media(-ms-high-contrast:none){.template-headerNotificationActionItem .headerNotificationActionItem-text:hover{opacity:.8}.template-headerNotificationActionItem .headerNotificationActionItem-text:active,.template-headerNotificationActionItem .headerNotificationActionItem-text:hover:active{opacity:.6}}@media(-ms-high-contrast){.template-headerNotificationActionItem .headerNotificationActionItem-text{color:Highlight}}.template-headerNotificationActionItem .headerNotificationActionItem-text:hover{color:#5dc21e}@media(-ms-high-contrast){.template-headerNotificationActionItem .headerNotificationActionItem-text:hover{color:HighlightText}}.template-headerNotificationActionItem .headerNotificationActionItem-text:active{color:#5dc21e}@media(-ms-high-contrast){.template-headerNotificationActionItem .headerNotificationActionItem-text:active{color:HighlightText}}.control-horizontalItemTile{position:relative;display:-ms-grid;-ms-grid-columns:4px 75px 1fr;-ms-grid-rows:4px 75px 4px;width:318px;height:83px;outline:none;color:#222}.control-horizontalItemTile:hover{background-color:#222}@media(-ms-high-contrast){.control-horizontalItemTile:hover{color:HighlightText;background-color:Highlight}}@media(-ms-high-contrast){.control-horizontalItemTile:hover .content-explicitIndicator{color:HighlightText}}@media(-ms-high-contrast){.control-horizontalItemTile:hover .content-explicitIndicator{border-color:HighlightText}}.control-horizontalItemTile:active{background-color:#101010}@media(-ms-high-contrast){.control-horizontalItemTile:active{color:HighlightText;background-color:Highlight}}.showKeyboardFocus .control-horizontalItemTile.acc-keyboardFocusTarget{outline:none}.control-horizontalItemTile,.control-horizontalItemTile:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-horizontalItemTile.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .control-horizontalItemTile.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .control-horizontalItemTile.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .control-horizontalItemTile.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.control-horizontalItemTile .horizontalItemTile-imageContainer{position:relative;-ms-grid-column:2;-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr}.control-horizontalItemTile .horizontalItemTile-imageContainer .horizontalItemTile-image{background-position:center top;background-size:cover;background-repeat:no-repeat;-ms-high-contrast-adjust:none;opacity:0}.control-horizontalItemTile .horizontalItemTile-imageContainer .horizontalItemTile-image.wide{width:100%;height:auto;-ms-grid-row-align:end}.control-horizontalItemTile .horizontalItemTile-imageContainer .horizontalItemTile-image.tall{height:100%;width:auto;-ms-grid-column-align:start}.control-horizontalItemTile .horizontalItemTile-imageContainer .horizontalItemTile-imagePlaceholder{width:100%;height:100%;background-color:#3a3a3a}.control-horizontalItemTile .horizontalItemTile-imageContainer.imageControl_loaded .horizontalItemTile-imagePlaceholder{animation-name:keys-fadeOut;animation-delay:0;animation-duration:250ms;animation-fill-mode:both}.control-horizontalItemTile .horizontalItemTile-imageContainer.imageControl_loaded .horizontalItemTile-image{animation-name:keys-fadeIn;animation-delay:0;animation-duration:250ms;animation-fill-mode:both}.control-horizontalItemTile .horizontalItemTile-content{-ms-grid-column:3;-ms-grid-row:2;-ms-grid-row-align:center;display:-ms-grid;-ms-grid-columns:15px 1fr 20px;-ms-grid-rows:auto auto}.control-horizontalItemTile .horizontalItemTile-icon{color:#222}.control-horizontalItemTile .horizontalItemTile-icon .icons-inCollectionIcon{color:#646464}html[dir=rtl] .control-horizontalItemTile .horizontalItemTile-icon{float:right;padding:0 0 0 5px}.control-horizontalItemTile .horizontalItemTile-cloudIcon,.control-horizontalItemTile .horizontalItemTile-inCollectionIcon{font-size:9pt;margin:0 0 0 1px}html[dir=rtl] .control-horizontalItemTile .horizontalItemTile-cloudIcon,html[dir=rtl] .control-horizontalItemTile .horizontalItemTile-inCollectionIcon{margin:0 1px 0 0}.win-itembox:not(.win-selected) .control-horizontalItemTile .horizontalItemTile-cloudIcon,.win-itembox:not(.win-selected) .control-horizontalItemTile .horizontalItemTile-inCollectionIcon{color:#898989}.control-horizontalItemTile .content-itemTitle{-ms-grid-column:2;-ms-grid-row:1}.control-horizontalItemTile .content-metadata{-ms-grid-column:2;-ms-grid-row:2}.win-itembox:not(.win-selected) .control-horizontalItemTile .content-metadata{color:#646464}.control-horizontalItemTile .content-explicitIndicator{display:none;-ms-grid-column:2;-ms-grid-column-align:start;-ms-grid-row-span:2}.control-horizontalItemTile.horizontalItemTile_explicit .horizontalItemTile-content{-ms-grid-rows:auto auto auto}.control-horizontalItemTile.horizontalItemTile_explicit .horizontalItemTile-content .content-itemTitle{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;word-wrap:normal;max-height:15pt}.control-horizontalItemTile.horizontalItemTile_explicit .horizontalItemTile-content .horizontalItemTile-explicitIndicator{display:block;-ms-grid-row:3;-ms-grid-row-span:1}.state_offline .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-imagePlaceholder::after{content:"";width:100%;height:100%;position:absolute;top:0;left:0;background-color:#303030;opacity:.5}@media(-ms-high-contrast){.state_offline .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-imagePlaceholder::after{background-color:transparent}}.state_offline .win-container:not(.win-selected) .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-itemTitle,.state_offline .win-container:not(.win-selected) .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-metadata,.state_offline .win-container:not(.win-selected) .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .horizontalItemTile-cloudIcon{color:#898989}@media(-ms-high-contrast){.state_offline .win-container:not(.win-selected) .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-itemTitle,.state_offline .win-container:not(.win-selected) .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-metadata,.state_offline .win-container:not(.win-selected) .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .horizontalItemTile-cloudIcon{color:WindowText}}.state_offline .win-container.win-selected .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-itemTitle,.state_offline .win-container.win-selected .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-metadata{color:rgba(235,235,235,.5)}@media(-ms-high-contrast){.state_offline .win-container.win-selected .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-itemTitle,.state_offline .win-container.win-selected .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-metadata{color:WindowText}}@media(-ms-high-contrast){.state_offline .win-container:hover .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-itemTitle,.state_offline .win-container.win-selected .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-itemTitle,.state_offline .win-container:hover .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-metadata,.state_offline .win-container.win-selected .win-item.state_streamingOnly .control-horizontalItemTile .horizontalItemTile-content .content-metadata{color:HighlightText}}.control-horizontalItemTile.mediatype-tv{-ms-grid-columns:4px 100px 1fr;-ms-grid-rows:4px 100px 4px;height:auto}.control-horizontalItemTile.mediatype-movie{-ms-grid-columns:4px 75px 1fr;-ms-grid-rows:4px 100px 4px;height:auto}.control-horizontalItemTile.horizontalItemTile_numbered{display:-ms-grid;-ms-grid-columns:4px 75px 15px auto 15px 1fr 20px}.control-horizontalItemTile.horizontalItemTile_numbered .horizontalItemTile-itemCount{-ms-grid-column:4;-ms-grid-row:2;-ms-grid-column-align:center;-ms-grid-row-align:center;margin-bottom:6px;text-align:center}.control-horizontalItemTile.horizontalItemTile_numbered .horizontalItemTile-content{-ms-grid-column:6;-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:auto auto;-ms-grid-row-align:center}.control-horizontalItemTile.horizontalItemTile_numbered .horizontalItemTile-content .content-itemTitle{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-align:end}.control-horizontalItemTile.horizontalItemTile_numbered .horizontalItemTile-content .content-metadata{-ms-grid-column:1;-ms-grid-row:2;-ms-grid-row-align:start}.control-horizontalItemTile.horizontalItemTile_numbered .horizontalItemTile-content .content-explicitIndicator{display:none}.control-horizontalItemTile.horizontalItemTile_numbered.mediatype-tv{-ms-grid-columns:4px 100px 15px auto 15px 1fr 20px;-ms-grid-rows:4px 100px 4px;height:auto}.control-horizontalItemTile.horizontalItemTile_numbered.mediatype-movie{-ms-grid-columns:4px 75px 15px auto 15px 1fr 20px;-ms-grid-rows:4px 100px 4px;height:auto}.control-horizontalItemTile.horizontalItemTile_numbered.horizontalItemTile_explicit .horizontalItemTile-content{-ms-grid-rows:auto auto auto}.control-horizontalItemTile.horizontalItemTile_numbered.horizontalItemTile_explicit .horizontalItemTile-content .content-itemTitle{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;word-wrap:normal;max-height:15pt}.control-horizontalItemTile.horizontalItemTile_numbered.horizontalItemTile_explicit .horizontalItemTile-content .content-explicitIndicator{display:block;-ms-grid-column:1;-ms-grid-column-align:start;-ms-grid-row:3;-ms-grid-row-span:1}.control-moduleHeader{-ms-grid-column-align:start;display:-ms-grid;-ms-grid-columns:minmax(50px,min-content) 17px auto 1fr auto;-ms-grid-rows:1fr;width:calc(100% - 100% mod 160px);height:48px;overflow:hidden;outline:none;margin:0 0 2px 4px}html[dir=rtl] .control-moduleHeader{margin:0 4px 2px 0}.control-moduleHeader .moduleHeader-title,.control-moduleHeader .moduleHeader-actions,.control-moduleHeader .moduleHeader-link{-ms-grid-row-align:center}.control-moduleHeader .moduleHeader-title{width:100%}.control-moduleHeader .moduleHeader-actions{-ms-grid-column:3;transform:translateY(1px);display:-ms-grid;-ms-grid-rows:1fr}.control-moduleHeader .moduleHeader-link{-ms-grid-column:5;-ms-grid-column-align:end;padding:0 3px;color:#5dc21e;transform:translateY(2px)}html[dir=ltr] .control-moduleHeader .moduleHeader-link{margin-right:4px}html[dir=rtl] .control-moduleHeader .moduleHeader-link{margin-left:4px}@media(-ms-high-contrast){.control-moduleHeader .moduleHeader-link{color:-ms-hotlight}}.control-moduleHeader .moduleHeader-link,.control-moduleHeader .moduleHeader-link:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-moduleHeader .moduleHeader-link.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .control-moduleHeader .moduleHeader-link.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .control-moduleHeader .moduleHeader-link.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .control-moduleHeader .moduleHeader-link.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.control-moduleHeader .moduleHeader-link:hover{color:#299c10}@media(-ms-high-contrast){.control-moduleHeader .moduleHeader-link:hover{color:HighlightText;background-color:Highlight}}.control-moduleHeader .moduleHeader-link:active{color:#107c10}@media(-ms-high-contrast){.control-moduleHeader .moduleHeader-link:active{color:ButtonFace;background-color:ButtonText}}.wecDialog .dialogCaption{color:#222}@media(-ms-high-contrast){.wecDialog .dialogCaption{color:WindowText}}.wecDialog .dialogContent{color:#222;font-size:11pt;font-weight:400;line-height:15pt}@media(-ms-high-contrast){.wecDialog .dialogContent{color:WindowText}}.wecDialog .dialogContent.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.wecDialog .dialogContent.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.wecDialog .dialogContent.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.wecDialog .dialogContent.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.wecDialog .dialogContent.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.wecDialog .dialogContent.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.wecDialog .dialogContent.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.wecDialog .dialogContent.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.wecDialog .dialogContent.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.wecDialog .dialogContent.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.wecDialog .dialogContent.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.wecDialog .dialogContent.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.wecDialog .dialogContent.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.wecDialog .dialogContent.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.wecDialog .dialogContent.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.wecDialog .dialogContent .dialogContent-errorContent{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:auto auto auto auto auto;margin-top:10px}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-subtitle{margin-bottom:10px}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-description{-ms-grid-row:2}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-link{-ms-grid-row:3}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-feedbackLink{-ms-grid-row:4;margin-top:0}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-errorCode{-ms-grid-row:5;font-size:9pt;font-weight:400;line-height:12pt}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-errorCode.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:12pt;word-wrap:normal}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-errorCode.maxLines-two{overflow:hidden;white-space:normal;max-height:24pt}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-errorCode.maxLines-three{overflow:hidden;white-space:normal;max-height:36pt}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-errorCode.maxLines-four{overflow:hidden;white-space:normal;max-height:48pt}.wecDialog .dialogContent .dialogContent-errorContent .errorContent-errorCode.maxLines-seven{overflow:hidden;white-space:normal;max-height:84pt}.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a{color:#5dc21e}@media(-ms-high-contrast:none){.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:hover{opacity:.8}.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:active,.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:hover:active{opacity:.6}}@media(-ms-high-contrast){.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a{color:-ms-hotlight}}.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a,.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:focus{border:none;outline:none}.showKeyboardFocus .wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:focus{outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:focus{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:hover{color:HighlightText;background-color:Highlight}}@media(-ms-high-contrast){.wecDialog .dialogContent .dialogContent-errorContent .webLinkContainer a:active{color:ButtonFace;background-color:ButtonText}}.control-seekBar{width:100%;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:67px auto;-ms-touch-action:none;outline:none;direction:ltr}.control-seekBar .seekBar-track,.control-seekBar .seekBar-scroller,.control-seekBar .thumbContainer-thumbText,.control-seekBar .thumbContainer-thumb,.control-seekBar .seekBar-metadata,.control-seekBar .metadata-positionText,.control-seekBar .metadata-durationText{transition-property:transform,opacity;transition-duration:.33s;transition-timing-function:cubic-bezier(.25,.1,.25,1)}.control-seekBar .seekBar-scrollerDisabled{-ms-touch-action:none}.control-seekBar .seekBar-scrollerDisabled .thumbContainer-thumb{display:none}.control-seekBar .seekBar-metadata{-ms-grid-column:1;-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:1fr 1fr;transform:translateY(-20px);margin:0 30px}.control-seekBar .seekBar-metadata .metadata-nowPlayingText{display:none}.control-seekBar .seekBar-metadata .metadata-positionText{-ms-grid-column-align:start;-ms-grid-column:1;color:#898989}@media(-ms-high-contrast){.control-seekBar .seekBar-metadata .metadata-positionText{color:WindowText}}.control-seekBar .seekBar-metadata .metadata-durationText{-ms-grid-column-align:end;-ms-grid-column:2;color:#898989}@media(-ms-high-contrast){.control-seekBar .seekBar-metadata .metadata-durationText{color:WindowText}}.control-seekBar .seekBar-track{height:5px;transform:translate(0,38px);outline:none;margin:0 30px;direction:ltr;background-color:#3a3a3a}@media(-ms-high-contrast){.control-seekBar .seekBar-track{background-color:Window}}@media(-ms-high-contrast){.control-seekBar .seekBar-track{outline:1px solid WindowText}}.control-seekBar .seekBar-track .seekBar-fill{height:5px;width:100%;transform-origin:left;outline:none;background-color:#ebebeb}@media(-ms-high-contrast){.control-seekBar .seekBar-track .seekBar-fill{background-color:Highlight}}.control-seekBar .seekBar-scroller{position:relative;direction:ltr;overflow-x:scroll;overflow-y:hidden;background-color:transparent;-ms-grid-column-align:stretch;-ms-overflow-style:none;-ms-scroll-translation:none;-ms-scroll-snap-type:mandatory;-ms-scroll-snap-points-x:snapInterval(.5%,.5%);-ms-scroll-chaining:none}.control-seekBar .seekBar-scroller .seekBar-thumbContainer{width:200%;height:0}.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumbText{height:20px;box-sizing:border-box;padding:0 10px;background-color:#107c10;color:#ebebeb;text-align:center;position:absolute;right:0;opacity:0;display:none;transform:translate(0,60px)}@media(-ms-high-contrast){.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumbText{color:HighlightText;background-color:Highlight}}.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb{position:absolute;right:0;width:9px;height:9px;transform-origin:center center;transform:translate(-22px,-12px);background-image:none;bottom:7px;-ms-high-contrast-adjust:none;background-color:#101010;outline-style:none;outline:none}@media(-ms-high-contrast){.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb{background-color:Window}}.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb,.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb:focus{border-style:solid;border-radius:50%;border-width:3px;border-color:#ebebeb}@media(-ms-high-contrast){.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb,.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb:focus{border-color:Highlight}}.control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb::after{content:"";position:absolute;width:15px;height:15px;top:-3px;left:-3px;border-radius:50%}.showKeyboardFocus .control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb:focus:after{content:"";outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-seekBar .seekBar-scroller .seekBar-thumbContainer .thumbContainer-thumb:focus:after{outline-color:-ms-hotlight}}.control-seekBar .seekBar-scroller .seekBar-thumbContainer .seekBarThumbTextEngaged{opacity:1;display:block;transform:translateY(8px)}.appNotifications{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:4;-ms-grid-column-align:end;display:-ms-grid;-ms-grid-columns:10px 1fr auto 10px;-ms-grid-rows:auto auto;width:100%;margin-top:10px}.appNotifications .appInfoNotification{-ms-grid-column:3}.appNotifications .appCriticalNotification{-ms-grid-column:2}.appNotifications .appCriticalNotification,.appNotifications .appInfoNotification{-ms-grid-row:1;-ms-grid-column-align:end}.appNotifications .appCriticalNotification .criticalNotificationContainer,.appNotifications .appInfoNotification .criticalNotificationContainer,.appNotifications .appCriticalNotification .infoNotificationContainer,.appNotifications .appInfoNotification .infoNotificationContainer{width:100%;height:100%;overflow-y:hidden;overflow-x:hidden;max-width:370px;max-height:120px;min-height:54px}html[dir=ltr] .appNotifications .appCriticalNotification .criticalNotificationContainer,html[dir=ltr] .appNotifications .appInfoNotification .criticalNotificationContainer,html[dir=ltr] .appNotifications .appCriticalNotification .infoNotificationContainer,html[dir=ltr] .appNotifications .appInfoNotification .infoNotificationContainer{margin-left:5px}html[dir=rtl] .appNotifications .appCriticalNotification .criticalNotificationContainer,html[dir=rtl] .appNotifications .appInfoNotification .criticalNotificationContainer,html[dir=rtl] .appNotifications .appCriticalNotification .infoNotificationContainer,html[dir=rtl] .appNotifications .appInfoNotification .infoNotificationContainer{margin-right:5px}.appNotifications .appCriticalNotification .criticalNotificationContainer .win-template,.appNotifications .appInfoNotification .criticalNotificationContainer .win-template,.appNotifications .appCriticalNotification .infoNotificationContainer .win-template,.appNotifications .appInfoNotification .infoNotificationContainer .win-template{display:none}.appNotifications .appCriticalNotification .criticalNotificationContainer .win-template .win-item,.appNotifications .appInfoNotification .criticalNotificationContainer .win-template .win-item,.appNotifications .appCriticalNotification .infoNotificationContainer .win-template .win-item,.appNotifications .appInfoNotification .infoNotificationContainer .win-template .win-item{-ms-flex-pack:end}.appNotifications .appCriticalNotification .criticalNotificationContainer .win-template:first-child,.appNotifications .appInfoNotification .criticalNotificationContainer .win-template:first-child,.appNotifications .appCriticalNotification .infoNotificationContainer .win-template:first-child,.appNotifications .appInfoNotification .infoNotificationContainer .win-template:first-child{display:-ms-grid}.appNotifications .notificationContent{display:-ms-grid;-ms-grid-columns:15px 35px 1fr 25px;-ms-grid-rows:1fr;min-height:46px;min-width:50px;margin:0;padding:0;border:none}.appNotifications .notificationContent .criticalNotificationIcon,.appNotifications .notificationContent .infoNotificationIcon{-ms-grid-column:2;-ms-grid-column-align:start;-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-row-align:center}.appNotifications .notificationContent .textContainer{-ms-grid-column:3;-ms-grid-row:1;-ms-grid-row-align:center;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;width:100%;height:100%;height:auto;-ms-grid-rows:6px auto auto 8px}.appNotifications .notificationContent .textContainer .infoNotificationTitle{-ms-grid-row:2;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;word-wrap:normal;max-height:15pt}.appNotifications .notificationContent .textContainer>.infoNotificationSubTitle{-ms-grid-row:3;overflow:hidden;max-height:30pt;text-overflow:clip;white-space:normal}.appNotifications .notificationContent .textContainer .inlineCaretButton{-ms-grid-row:3}.appNotifications .notificationContent .textContainer .inlineCaretButton .inlineCaretButtonText{overflow:hidden;max-height:30pt;text-overflow:clip;white-space:normal}.appNotifications .notificationContent .textContainer .inlineCaretButton .inlineCaretButtonIcon{margin-top:3px}.dialogContainer{overflow:visible}.video .win-toggleswitch .win-switch::-ms-fill-lower{background-color:#107c10}@media(-ms-high-contrast){.video .win-toggleswitch .win-switch::-ms-fill-lower{background-color:Highlight}}.video .win-toggleswitch .win-switch:hover::-ms-fill-lower{background-color:rgba(16,124,16,.8)}@media(-ms-high-contrast){.video .win-toggleswitch .win-switch:hover::-ms-fill-lower{background-color:Highlight}}@media(-ms-high-contrast:none){.video .dialogButton.defaultButton:hover{opacity:.8}.video .dialogButton.defaultButton:active,.video .dialogButton.defaultButton:hover:active{opacity:.6}}.video .dialogButton.defaultButton,.video .dialogButton.defaultButton:hover,.video .dialogButton.defaultButton:active{background-color:#107c10}.win-settingsflyout .settingsWrapper{-ms-grid-columns:25px 5px 1fr 35px}.win-settingsflyout .settingsWrapper .dialogButton{border-width:0}html[dir=ltr] .win-settingsflyout .settingsWrapper .dialogButton{margin-left:0}html[dir=rtl] .win-settingsflyout .settingsWrapper .dialogButton{margin-right:0}.win-settingsflyout .settingsWrapper .dialogButton.defaultButton,.win-settingsflyout .settingsWrapper .dialogButton.defaultButton:hover,.win-settingsflyout .settingsWrapper .dialogButton.defaultButton:active{background-color:#ac193d}@media(-ms-high-contrast){.win-settingsflyout .settingsWrapper .dialogButton{border:1px solid WindowText}.win-settingsflyout .settingsWrapper .dialogButton:hover{background-color:Highlight;color:HighlightText}}.win-settingsflyout .settingsWrapper .win-toggleswitch .win-switch::-ms-fill-lower{background-color:#ac193d}.win-settingsflyout .settingsWrapper .win-toggleswitch .win-switch:hover::-ms-fill-lower{background-color:rgba(172,25,61,.8)}.win-settingsflyout .settingsWrapper .offLineAccountPanel .signIn .signInRetry{color:#ac193d}@media(-ms-high-contrast){.win-settingsflyout .settingsWrapper .offLineAccountPanel .signIn .signInRetry{color:WindowText}}.win-settingsflyout .settingsWrapper .settingsFeedbackContent .feedbackButtons .dialogButton{margin:3px 0 3px 8px}html[dir=rtl] .win-settingsflyout .settingsWrapper .settingsFeedbackContent .feedbackButtons .dialogButton{margin:3px 8px 3px 0}.win-settingsflyout .settingsWrapper .settingsFeedbackContent .settingsFeedbackCommentBox .editMultiline{min-width:0}.actionListFlyout.win-flyout{padding:0;margin-bottom:-2px;border:none;box-shadow:none;background-color:#fff;outline:1px solid #c2c2c2}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link{width:100%;height:40px;margin:0;padding:0 15px 2px;background-color:#fff}@media(-ms-high-contrast){.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link{background-color:Window}}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:focus{border:0 solid;outline-style:none}.showKeyboardFocus .actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 8px);height:calc(100% - 8px);top:4px;left:4px;outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel{font-size:11pt;font-weight:400;line-height:15pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:focus{background-color:#fff}@media(-ms-high-contrast){.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:focus{background-color:ButtonFace}}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:focus .actionLinkLabel{color:#222}@media(-ms-high-contrast){.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link .actionLinkLabel,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:focus .actionLinkLabel{color:ButtonText}}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover:focus{background-color:#ebebeb}@media(-ms-high-contrast){.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover:focus{background-color:Highlight}}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover .actionLinkLabel,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover:focus .actionLinkLabel{color:#222}@media(-ms-high-contrast){.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover .actionLinkLabel,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:hover:focus .actionLinkLabel{color:HighlightText}}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active:hover{background-color:#e2e2e2}@media(-ms-high-contrast){.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active:hover{background-color:ButtonText}}.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active .actionLinkLabel,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active:hover .actionLinkLabel{color:#222}@media(-ms-high-contrast){.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active .actionLinkLabel,.actionListFlyout.win-flyout .actionListFlexBox .actionButtonFlyoutButton.link:active:hover .actionLinkLabel{color:ButtonFace}}.control-verticalItemTile{position:relative;display:-ms-grid;-ms-grid-columns:158px;-ms-grid-rows:auto 98px;width:158px;height:248px;background-color:#303030}.control-verticalItemTile,.control-verticalItemTile.keyboardFocusTarget-logical:focus,.control-verticalItemTile.keyboardFocusTarget-logical:hover{outline:none}.control-verticalItemTile:hover{background-color:#222}@media(-ms-high-contrast){.control-verticalItemTile:hover{color:HighlightText;background-color:Highlight}}.control-verticalItemTile:active{background-color:#101010}.control-verticalItemTile .verticalItemTile-imageContainer{-ms-grid-column:1;-ms-grid-row:1;position:relative;display:-ms-grid;-ms-grid-columns:4px 150px 4px;-ms-grid-rows:4px 150px}.control-verticalItemTile .verticalItemTile-imageContainer .verticalItemTile-image{-ms-grid-column:2;-ms-grid-row:2;background-position:center top;background-size:cover;background-repeat:no-repeat;-ms-high-contrast-adjust:none;background-size:100% 100%}.control-verticalItemTile .verticalItemTile-imageContainer .verticalItemTile-image.wide{width:100%;height:auto;-ms-grid-row-align:end}.control-verticalItemTile .verticalItemTile-imageContainer .verticalItemTile-image.tall{height:100%;width:auto;background-position:center}.control-verticalItemTile .verticalItemTile-imageContainer .verticalItemTile-imagePlaceholder{-ms-grid-column:2;-ms-grid-row:2;width:100%;height:100%;background-color:#3a3a3a}.control-verticalItemTile .verticalItemTile-content{-ms-grid-row:2;display:-ms-grid;-ms-grid-columns:8px 1fr 8px;-ms-grid-rows:14px auto auto auto auto auto}.control-verticalItemTile .verticalItemTile-content .verticalItemTile-primaryText{-ms-grid-column:2;-ms-grid-row:2;-ms-grid-row-align:start;overflow:hidden;word-wrap:break-word;color:#ebebeb}.control-verticalItemTile .verticalItemTile-content .verticalItemTile-primaryText.presale{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.control-verticalItemTile .verticalItemTile-content .verticalItemTile-secondaryText{-ms-grid-column:2;-ms-grid-row:3;color:#898989}.control-verticalItemTile .verticalItemTile-content .verticalItemTile-tertiaryText{-ms-grid-column:2;-ms-grid-row:4;color:#898989}.control-verticalItemTile .verticalItemTile-content .verticalItemTile-quaternaryText{-ms-grid-column:2;-ms-grid-row:5;color:#898989}.control-verticalItemTile .verticalItemTile-content .verticalItemTile-StarRating{-ms-grid-column:2;-ms-grid-row:6;padding:0;color:#ebebeb}.control-verticalItemTile.verticalItemTile_movie{height:303px}.control-verticalItemTile.verticalItemTile_movie .verticalItemTile-imageContainer{-ms-grid-rows:4px 205px}.control-verticalItemTile.verticalItemTile_featuredSet{width:318px;height:225px;-ms-grid-columns:1fr;-ms-grid-rows:auto 73px}.control-verticalItemTile.verticalItemTile_featuredSet .verticalItemTile-imageContainer{-ms-grid-columns:4px 310px 4px}.control-verticalItemTile.verticalItemTile_featuredSet .verticalItemTile-imageContainer .verticalItemTile-image{-ms-grid-row-align:stretch;background-size:cover}.control-verticalItemTile.verticalItemTile_file .verticalItemTile-imageContainer .verticalItemTile-image,.control-verticalItemTile.verticalItemTile_folder .verticalItemTile-imageContainer .verticalItemTile-image{background-size:cover}.template-verticalItemTileModule{display:-ms-flexbox;-ms-flex-direction:column;-ms-grid-column-align:start;-ms-grid-row:2;-ms-flex-wrap:wrap;width:158px;height:248px;overflow:hidden;margin-bottom:2px}.template-verticalItemTileModule.verticalItemTileModule_movie{height:303px}.template-verticalItemTileModule .verticalItemTileModule-item{-ms-flex:0 auto}.template-verticalItemTileModule .verticalItemTileModule-item,.template-verticalItemTileModule .verticalItemTileModule-item:focus{border:0 solid;outline-style:none}.showKeyboardFocus .template-verticalItemTileModule .verticalItemTileModule-item.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .template-verticalItemTileModule .verticalItemTileModule-item.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .template-verticalItemTileModule .verticalItemTileModule-item.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .template-verticalItemTileModule .verticalItemTileModule-item.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.template-verticalItemTileModule .verticalItemTileModule-item .win-focusedoutline{outline:none}.template-verticalItemTileModule .verticalItemTileModule-item:hover .control-verticalItemTile,.template-verticalItemTileModule .verticalItemTileModule-item:hover:focus .control-verticalItemTile{background-color:#222}@media(-ms-high-contrast){.template-verticalItemTileModule .verticalItemTileModule-item:hover .control-verticalItemTile,.template-verticalItemTileModule .verticalItemTileModule-item:hover:focus .control-verticalItemTile{background-color:Highlight}}@media(-ms-high-contrast){.template-verticalItemTileModule .verticalItemTileModule-item:hover .control-verticalItemTile .verticalItemTile-content .verticalItemTile-primaryText,.template-verticalItemTileModule .verticalItemTileModule-item:hover:focus .control-verticalItemTile .verticalItemTile-content .verticalItemTile-primaryText,.template-verticalItemTileModule .verticalItemTileModule-item:hover .control-verticalItemTile .verticalItemTile-content .verticalItemTile-secondaryText,.template-verticalItemTileModule .verticalItemTileModule-item:hover:focus .control-verticalItemTile .verticalItemTile-content .verticalItemTile-secondaryText,.template-verticalItemTileModule .verticalItemTileModule-item:hover .control-verticalItemTile .verticalItemTile-content .verticalItemTile-tertiaryText,.template-verticalItemTileModule .verticalItemTileModule-item:hover:focus .control-verticalItemTile .verticalItemTile-content .verticalItemTile-tertiaryText,.template-verticalItemTileModule .verticalItemTileModule-item:hover .control-verticalItemTile .verticalItemTile-content .verticalItemTile-quaternaryText,.template-verticalItemTileModule .verticalItemTileModule-item:hover:focus .control-verticalItemTile .verticalItemTile-content .verticalItemTile-quaternaryText{color:HighlightText}}.control-horizontalItemTile{color:#ebebeb;width:318px;height:83px}.control-horizontalItemTile .horizontalItemTile-imageContainer .horizontalItemTile-image.tall{background-position:center;-ms-grid-column-align:stretch}.control-horizontalItemTile .horizontalItemTile-content .content-metadata{color:#898989}.control-horizontalItemTile.horizontalItemTile_numbered{-ms-grid-rows:4px 75px 4px;-ms-grid-columns:4px 75px 20px auto 15px 1fr 20px}.control-horizontalItemTile.horizontalItemTile_movie{-ms-grid-rows:4px 100px 4px;height:108px}.control-horizontalItemTile.horizontalItemTile_movie .horizontalItemTile-imageContainer .horizontalItemTile-image.tall{background-size:100% 100%}.control-horizontalItemTile.horizontalItemTile_cast .horizontalItemTile-imageContainer .horizontalItemTile-image.wide{width:auto;height:100%}.control-horizontalItemTile.horizontalItemTile_cast .horizontalItemTile-imageContainer .horizontalItemTile-image.tall{width:100%;height:auto;background-position:center 20%}.template-horizontalItemTileModule{display:-ms-flexbox;-ms-flex-direction:column;-ms-grid-column-align:start;-ms-flex-wrap:wrap;max-height:285px;overflow:hidden;margin-bottom:25px;padding-bottom:4px;color:#ebebeb}.template-horizontalItemTileModule.horizontalItemTileModule_movie{max-height:360px}.template-horizontalItemTileModule .horizontalItemTileModule-item{-ms-flex:0 auto;margin-bottom:17px}.template-horizontalItemTileModule .horizontalItemTileModule-item.win-focusable.acc-keyboardFocusTarget{outline-style:none}.template-horizontalItemTileModule .horizontalItemTileModule-item,.template-horizontalItemTileModule .horizontalItemTileModule-item:focus{border:0 solid;outline-style:none}.showKeyboardFocus .template-horizontalItemTileModule .horizontalItemTileModule-item.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .template-horizontalItemTileModule .horizontalItemTileModule-item.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .template-horizontalItemTileModule .horizontalItemTileModule-item.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .template-horizontalItemTileModule .horizontalItemTileModule-item.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.control-moduleHeader .moduleHeader-title{color:#ebebeb}.control-moduleHeader .moduleHeader-actions .iconButton .win-commandicon{-ms-grid-column-align:center}.control-moduleHeader .moduleHeader-actions .iconButton .win-commandring{border:none;border-color:#ebebeb}@media(-ms-high-contrast){.control-moduleHeader .moduleHeader-actions .iconButton .win-commandring{background-color:transparent}}.control-moduleHeader .moduleHeader-actions .iconButton .win-commandimage{color:#ebebeb;font-size:10.75pt;line-height:30px}@media(-ms-high-contrast){.control-moduleHeader .moduleHeader-actions .iconButton .win-commandimage{color:ButtonText}}.control-moduleHeader .moduleHeader-actions .iconButton .win-label{display:none}.control-moduleHeader .moduleHeader-actions .iconButton:hover .win-commandicon{opacity:.8;background-color:transparent}.control-moduleHeader .moduleHeader-actions .iconButton:active .win-commandicon{opacity:.6;background-color:transparent}.control-moduleHeader .moduleHeader-actions .iconButton:focus{outline-color:#ebebeb}@media(-ms-high-contrast){.control-moduleHeader .moduleHeader-actions .iconButton:focus{border:1px solid ButtonText}}@media(-ms-high-contrast){.control-moduleHeader .moduleHeader-actions .iconButton{outline:none}}.control-moduleHeader .moduleHeader-link{padding:0 3px}html[dir=ltr] .control-moduleHeader .moduleHeader-link{margin-right:6px}html[dir=rtl] .control-moduleHeader .moduleHeader-link{margin-left:6px}.showKeyboardFocus .control-moduleHeader .moduleHeader-link.acc-keyboardFocusTarget:focus:after{outline-color:#ebebeb}.control-moduleHeader .moduleHeader-score{-ms-grid-column:4;-ms-grid-row-align:center}html[dir=ltr] .control-moduleHeader .moduleHeader-score{padding-left:5px}html[dir=rtl] .control-moduleHeader .moduleHeader-score{padding-right:5px}@media(max-width:768px){.control-moduleHeader{width:100%}html[dir=ltr] .control-moduleHeader .moduleHeader-link{margin-right:0}html[dir=rtl] .control-moduleHeader .moduleHeader-link{margin-left:0}}.template-heroCarouselItem{width:100%;height:100%;position:relative;display:-ms-grid;-ms-grid-columns:40px 1fr 40px;-ms-grid-rows:50px 1fr 1fr;background-color:#303030}@media(max-width:768px){.template-heroCarouselItem{-ms-grid-columns:30px 1fr 47px}}@media(-ms-high-contrast){.template-heroCarouselItem{background-color:Window}}.template-heroCarouselItem .heroCarouselItem-artwork,.template-heroCarouselItem .heroCarouselItem-artworkPlaceholder{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-column-span:3;-ms-grid-row-span:4;background-position:center top;background-size:cover;background-repeat:no-repeat;-ms-high-contrast-adjust:none}.template-heroCarouselItem .heroCarouselItem-artwork,.template-heroCarouselItem .heroCarouselItem-artworkPlaceholder,.template-heroCarouselItem .heroCarouselItem-artwork.narrow,.template-heroCarouselItem .heroCarouselItem-artworkPlaceholder.narrow,.template-heroCarouselItem .heroCarouselItem-artwork.wide,.template-heroCarouselItem .heroCarouselItem-artworkPlaceholder.wide{width:100%}.template-heroCarouselItem .heroCarouselItem-artworkPlaceholder:after{content:"";position:absolute;width:100%;height:100%;background-image:linear-gradient(180deg,rgba(0,0,0,.3) 0%,rgba(0,0,0,.1) 25%,rgba(0,0,0,.3) 62%,rgba(0,0,0,.5) 100%)}@media(-ms-high-contrast){.template-heroCarouselItem .heroCarouselItem-artworkPlaceholder:after{display:none}}.template-heroCarouselItem .heroCarouselItem-backButton{-ms-grid-column:2;-ms-grid-row:2;position:relative}.template-heroCarouselItem .heroCarouselItem-content{-ms-grid-column:2;-ms-grid-row:3;-ms-grid-row-align:end;padding-bottom:25px;width:100%;position:relative;display:-ms-flexbox;-ms-flex-direction:column;-ms-flex-align:start;-ms-flex-pack:center}.template-heroCarouselItem .heroCarouselItem-content .content-title,.template-heroCarouselItem .heroCarouselItem-content .content-subTitle{width:100%;color:#ebebeb}@media(-ms-high-contrast){.template-heroCarouselItem .heroCarouselItem-content .content-title,.template-heroCarouselItem .heroCarouselItem-content .content-subTitle{color:ButtonText;background-color:ButtonFace}}.control-viewStateControl,.control-viewStateControl .viewStateControl-layoutRoot,.control-viewStateControl .viewStateControl-content:not(.hideFromDisplay){height:100%}.control-viewStateControl .viewStateControl-layoutRoot .viewStateControl-notificationsContainer{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;width:100%;height:100%;color:#ebebeb}@media(-ms-high-contrast){.control-viewStateControl .viewStateControl-layoutRoot .viewStateControl-notificationsContainer{color:WindowText}}.control-viewStateControl .viewStateControl-layoutRoot .viewStateControl-notificationsContainer .viewStateControl-loadingContainer{-ms-grid-column-align:center;-ms-grid-row-align:center}.control-viewStateControl .viewStateControl-layoutRoot .viewStateControl-notificationsContainer .viewStateControl-loadingContainer progress:indeterminate{color:#ebebeb}@media(-ms-high-contrast){.control-viewStateControl .viewStateControl-layoutRoot .viewStateControl-notificationsContainer .viewStateControl-loadingContainer progress:indeterminate{color:WindowText}}.control-viewStateControl .viewStateControl-layoutRoot .viewStateControl-notificationsContainer .viewStateControl-errorContainer,.control-viewStateControl .viewStateControl-layoutRoot .viewStateControl-notificationsContainer .viewStateControl-offlineContainer{-ms-grid-column-align:start;-ms-grid-row-align:center;margin:0 40px 40px 40px;width:100%;display:-ms-flexbox;-ms-flex-direction:column;-ms-flex-align:start;-ms-flex-pack:center}.control-viewStateControl .viewStateControl-notifications{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;width:100%;height:100%;width:auto;box-sizing:border-box;margin:0 10px 0 10px;padding:0 30px}.control-viewStateControl .viewStateControl-notifications .notifications-loadingContainer{-ms-grid-column-align:center;-ms-grid-row-align:center}.control-viewStateControl .viewStateControl-notifications .notifications-loadingContainer progress:indeterminate{color:#ebebeb}.control-viewStateControl .viewStateControl-notifications .notifications-errorContainer .errorContainer-title{color:#ebebeb}.control-viewStateControl .viewStateControl-notifications .notifications-errorContainer .errorContainer-subTitle{color:#898989}.control-viewStateControl .viewStateControl-notifications .notifications-errorContainer .errorContainer-actions{margin-top:20px;-ms-grid-column-align:start}.viewStateControl-errorContainer .errorContainer-text{color:#ebebeb}.app-newvideo .template-carouselModule{display:-ms-grid;-ms-grid-columns:36px 1fr 36px;-ms-grid-rows:auto auto}@media(max-width:768px){.app-newvideo .template-carouselModule{-ms-grid-columns:26px 1fr 43px}}.app-newvideo .template-carouselModule .carouselModule-header{display:block}html[dir=ltr] .app-newvideo .template-carouselModule .carouselModule-header .control-moduleHeader{margin-left:0}html[dir=rtl] .app-newvideo .template-carouselModule .carouselModule-header .control-moduleHeader{margin-right:0}.app-newvideo .template-carouselModule .carouselModule-items{-ms-grid-row:2;-ms-grid-column:1;-ms-grid-column-span:3;-ms-grid-column-align:start;height:auto;width:calc(((100% - 72px) - ((100% - 72px) mod 160px)) + 72px)}.app-newvideo .template-carouselModule .carouselModule-items .horizontalFlow{margin:0 2px 0 0}html[dir=rtl] .app-newvideo .template-carouselModule .carouselModule-items .horizontalFlow{margin:0 0 0 2px}.app-newvideo .template-carouselModule .carouselModule-items .control-pagedItemsControl{display:-ms-grid;-ms-grid-columns:36px 1fr 36px;-ms-grid-rows:154px 1fr}@media(max-width:768px){.app-newvideo .template-carouselModule .carouselModule-items .control-pagedItemsControl{-ms-grid-columns:26px 1fr 43px}}.app-newvideo .template-carouselModule .carouselModule-items .control-pagedItemsControl .pagedItemsControl-itemsControlContainer{-ms-grid-row-span:2}.app-newvideo .template-carouselModule.module-newMovies .carouselModule-items .control-pagedItemsControl,.app-newvideo .template-carouselModule.module-featuredMovies .carouselModule-items .control-pagedItemsControl,.app-newvideo .template-carouselModule.module-similarMovies .carouselModule-items .control-pagedItemsControl{-ms-grid-rows:209px 1fr}.app-newvideo .template-carouselModule.module-newMovies .carouselModule-items .control-pagedItemsControl .pagedItemsControl-itemsControlContainer,.app-newvideo .template-carouselModule.module-featuredMovies .carouselModule-items .control-pagedItemsControl .pagedItemsControl-itemsControlContainer,.app-newvideo .template-carouselModule.module-similarMovies .carouselModule-items .control-pagedItemsControl .pagedItemsControl-itemsControlContainer{-ms-grid-row-span:2}@media(max-width:768px){.app-newvideo .template-carouselModule .carouselModule-header,.app-newvideo .template-carouselModule .carouselModule-itemsContainer,.app-newvideo .template-carouselModule .carouselModule-items{width:100%}}.template-contentModule{display:-ms-grid;-ms-grid-columns:36px 1fr 36px;-ms-grid-rows:auto auto}@media(max-width:768px){.template-contentModule{-ms-grid-columns:26px 1fr 43px}}.template-contentModule .contentModule-header{-ms-grid-row:1;-ms-grid-column:2}.template-contentModule .contentModule-items{-ms-grid-row:2;-ms-grid-column:2;-ms-grid-column-align:start;width:calc(100% - (100% mod 160px));height:auto}.template-contentModule .contentModule-items .horizontalFlow{margin:0 2px 0 0}html[dir=rtl] .template-contentModule .contentModule-items .horizontalFlow{margin:0 0 0 2px}@media(max-width:768px){.template-contentModule .contentModule-header,.template-contentModule .contentModule-itemsContainer,.template-contentModule .contentModule-items{width:100%}}.template-textItemModule{display:-ms-grid;-ms-grid-columns:40px 1fr 40px;-ms-grid-rows:50px auto}@media(max-width:768px){.template-textItemModule{-ms-grid-columns:30px 1fr 47px}}.template-textItemModule .textItemModule-header{-ms-grid-column:2;-ms-grid-row:1}.template-textItemModule .textItemModule-header .rottenTomatoesReviewItem-icon{width:20px;height:20px}html[dir=ltr] .template-textItemModule .textItemModule-header .rottenTomatoesReviewItem-icon{margin-left:3px}html[dir=rtl] .template-textItemModule .textItemModule-header .rottenTomatoesReviewItem-icon{margin-right:3px}.template-textItemModule .textItemModule-items{-ms-grid-column:2;-ms-grid-row:2;display:flex;flex-flow:row wrap;overflow:hidden;width:calc(100% - (100% mod 160px));max-height:175px}.template-textItemModule .textItemModule-items .horizontalFlow{flex:2 1 310px}.template-textItemModule .textItemModule-items .textItemModule-item,.template-textItemModule .textItemModule-items .textItemModule-item:focus{border:0 solid;outline-style:none}.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget,.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget:focus,.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget:active{outline:none}.showKeyboardFocus .template-textItemModule .textItemModule-items .textItemModule-item.acc-keyboardFocusTarget:focus::after{width:calc(100% - 22px);height:calc(100% - 12px)}@media(max-width:768px){.template-textItemModule .textItemModule-items,.template-textItemModule .textItemModule-items .win-template{width:100%}}.control-textItemTile{display:-ms-grid;-ms-grid-columns:40px 10px 1fr 20px;-ms-grid-rows:10px 20px 20px 5px auto 22px 10px;height:175px}.control-textItemTile .textItemTile-icon{-ms-grid-column:1;-ms-grid-row:2;-ms-grid-row-span:2}.control-textItemTile .textItemTile-title{-ms-grid-column:3;-ms-grid-row:2}.control-textItemTile .textItemTile-metadata{-ms-grid-column:3;-ms-grid-row:3;color:#898989}.control-textItemTile .textItemTile-content{-ms-grid-column:1;-ms-grid-row:5;-ms-grid-column-span:3}.control-textItemTile .textItemTile-link{-ms-grid-column:1;-ms-grid-row:6;-ms-grid-column-span:3}.control-iconButtonMessageAction{width:calc(100% + 60px);display:-ms-grid;-ms-grid-columns:15px 15px 1fr;-ms-grid-rows:1fr;border:0;padding:15px 30px 20px;margin:0 -30px;background-color:transparent}@media(-ms-high-contrast){.control-iconButtonMessageAction{color:ButtonText;background-color:ButtonFace}}button.control-iconButtonMessageAction:hover{background-color:#222}@media(-ms-high-contrast){button.control-iconButtonMessageAction:hover{color:HighlightText;background-color:Highlight}}button.control-iconButtonMessageAction:active,button.control-iconButtonMessageAction:active:hover{background-color:#101010}@media(-ms-high-contrast){button.control-iconButtonMessageAction:active,button.control-iconButtonMessageAction:active:hover{color:ButtonFace;background-color:ButtonText}}button.control-iconButtonMessageAction:focus{outline:none}.showKeyboardFocus button.control-iconButtonMessageAction.acc-keyboardFocusTarget:focus{outline-color:#ebebeb}.control-iconButtonMessageAction .iconButtonMessageAction-icon{display:block;color:#ebebeb;font-size:12pt;transform:translateY(3px)}.control-iconButtonMessageAction .iconButtonMessageAction-content{-ms-grid-column:3;-ms-grid-row-align:center;display:-ms-flexbox;-ms-flex-direction:column;-ms-flex-align:start;-ms-flex-pack:center;width:100%}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-title,.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle{width:100%;text-align:left}html[dir=rtl] .control-iconButtonMessageAction .iconButtonMessageAction-content .content-title,html[dir=rtl] .control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle{text-align:right}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-title{display:block;color:#ebebeb;font-size:14pt;line-height:18.875pt;font-weight:400}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-title.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:18.875pt;word-wrap:normal}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-title.maxLines-two{overflow:hidden;white-space:normal;max-height:38pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-title.maxLines-three{overflow:hidden;white-space:normal;max-height:57pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-title.maxLines-four{overflow:hidden;white-space:normal;max-height:76pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-title.maxLines-seven{overflow:hidden;white-space:normal;max-height:132pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle{display:block;color:#898989;font-size:11pt;font-weight:400;line-height:15pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-iconButtonMessageAction .iconButtonMessageAction-content .content-subTitle.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-iconButtonMessageAction .iconButtonMessageAction-parts{display:none}@media(-ms-high-contrast){.control-iconButtonMessageAction.internalActionLink{outline:none}}.control-navHeader{margin:51px 0 0}.control-navHeader .navHeader-container{display:-ms-grid;-ms-grid-columns:10px 30px auto minmax(50px,min-content) 20px auto 1fr 30px 10px;-ms-grid-rows:30px 29px}@media(max-width:768px){.control-navHeader .navHeader-container{-ms-grid-columns:0 30px auto minmax(50px,min-content) 20px auto 1fr 30px 17px}}.control-navHeader .navHeader-container.hasPivots,.control-navHeader .navHeader-container.hasModifiers{-ms-grid-rows:30px 29px auto 10px auto 10px auto}.control-navHeader .navHeader-container .navHeader-backButton{-ms-grid-column:3;margin:0 15px 0 0}html[dir=rtl] .control-navHeader .navHeader-container .navHeader-backButton{margin:0 0 0 15px}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command{display:block;overflow:visible;min-width:30px;height:30px;padding:0}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-label{display:none}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-commandicon{-ms-grid-column-align:center}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-back{border-color:#ebebeb;background-color:transparent}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-back{border-color:ButtonText}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-back{background-color:ButtonFace}}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-back{width:30px;height:30px;font-size:10.75pt;color:#ebebeb}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-back{color:ButtonText}}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-commandimage{line-height:30px}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command .win-back{line-height:27px}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-back{border-color:#ebebeb;background-color:rgba(235,235,235,.2)}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-back{border-color:HighlightText}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-back{background-color:Highlight}}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-back{color:#ebebeb}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover .win-back{color:HighlightText}}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-back,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-back{border-color:#ebebeb;background-color:#ebebeb}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-back,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-back{border-color:ButtonFace}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-commandring,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-back,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-back{background-color:ButtonText}}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-back,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-back{color:#222}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-commandimage,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active .win-back,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover:active .win-back{color:ButtonFace}}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:focus{position:relative}.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:focus:after{content:"";position:absolute;width:calc(100% - -8px);height:calc(100% - -8px);top:-4px;left:-4px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:focus:after{outline-color:-ms-hotlight}}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:hover,.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:active{opacity:1}.control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:focus,.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-backButton button.iconButton.win-command:focus{outline:none}.control-navHeader .navHeader-container .navHeader-title{-ms-grid-column:4;-ms-grid-row:1;-ms-grid-row-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-bottom:4px}html[dir=rtl] .control-navHeader .navHeader-container .navHeader-title{direction:rtl}.control-navHeader .navHeader-container .navHeader-titleActionButton{-ms-grid-column:6}.control-navHeader .navHeader-container .navHeader-titleActionButton button{width:30px;height:30px;padding:0;margin-top:1px;color:#ebebeb}@media(-ms-high-contrast:none){.control-navHeader .navHeader-container .navHeader-titleActionButton button:hover{opacity:.8}.control-navHeader .navHeader-container .navHeader-titleActionButton button:active,.control-navHeader .navHeader-container .navHeader-titleActionButton button:hover:active{opacity:.6}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-titleActionButton button{color:Highlight}}.control-navHeader .navHeader-container .navHeader-titleActionButton button,.control-navHeader .navHeader-container .navHeader-titleActionButton button:focus{border:none;outline:none}.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-titleActionButton button:focus{outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-titleActionButton button:focus{outline-color:-ms-hotlight}}@media(-ms-high-contrast:none){.control-navHeader .navHeader-container .navHeader-titleActionButton button:hover{opacity:.6}.control-navHeader .navHeader-container .navHeader-titleActionButton button:active,.control-navHeader .navHeader-container .navHeader-titleActionButton button:hover:active{opacity:.4}}.control-navHeader .navHeader-container .navHeader-buttonsContainer{-ms-grid-column:3;-ms-grid-column-span:5;-ms-grid-row:3;display:-ms-flexbox;-ms-flex-align:start;-ms-flex-direction:row;-ms-flex-line-pack:start;-ms-flex-pack:start;-ms-flex-wrap:nowrap}.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl{-ms-grid-column:2;margin:0 2px;padding:0 3px}.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled){color:#c2c2c2}@media(-ms-high-contrast:none){.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):hover{opacity:.8}.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):active,.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):hover:active{opacity:.6}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled){color:WindowText}}.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled),.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):focus{border:none;outline:none}.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):focus{outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):focus{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):hover{color:HighlightText;background-color:Highlight}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):active{color:ButtonText;background-color:ButtonFace}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled):hover::after{color:WindowText}}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-buttonsContainer .modifierControl:not(.dropDownDisabled){opacity:1}}html[dir=ltr] .control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-pivotsContainer{margin-right:24px}html[dir=rtl] .control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-pivotsContainer{margin-left:24px}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-pivotsContainer .pivotsContainer-buttons{display:-ms-flexbox}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-pivotsContainer .pivotsContainer-pivotsDropDown{padding:9px 10px 11px 0}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-pivotsContainer .pivotsContainer-pivotsDropDown .modifierControl{margin-left:0}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer{position:relative;display:-ms-flexbox;-ms-flex:10 1 auto;-ms-flex-direction:row;-ms-flex-wrap:wrap;max-height:40px;overflow:hidden}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-flexBoxClipper{-ms-flex:0 0 0}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters,.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-modifiers{position:relative;display:-ms-grid;-ms-grid-columns:auto auto 1fr;-ms-flex:0 0 auto;overflow:hidden;padding:9px 34px 11px 0;color:#c2c2c2}html[dir=rtl] .control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters,html[dir=rtl] .control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-modifiers{padding:9px 0 11px 34px}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters,.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-modifiers{color:WindowText}}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters .modifierDescription,.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-modifiers .modifierDescription{-ms-grid-column:1}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters .modifierControl,.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-modifiers .modifierControl{-ms-grid-column:2}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters{-ms-grid-column:2;display:-ms-grid}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters.state_modifierControlDropDownDisabled{min-width:inherit;display:none}.control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters .modifierDescription{min-width:34px;text-align:right}html[dir=rtl] .control-navHeader .navHeader-container .navHeader-buttonsContainer .buttonsContainer-sortsContainer .sortsContainer-filters .modifierDescription{text-align:left}.control-navHeader .navHeader-container .navHeader-notifications{-ms-grid-column:2;-ms-grid-column-span:5;-ms-grid-row:5}.control-navHeader .navHeader-container .navHeader-offlineNotification{-ms-grid-column:3;-ms-grid-column-span:5;-ms-grid-row:5;display:-ms-grid;-ms-grid-columns:auto 5px 1fr;-ms-grid-rows:auto;height:60px;padding-top:20px;margin-top:20px;border-top:1px solid #222;border-bottom:1px solid #222;color:#ebebeb}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-offlineNotification{color:WindowText}}.control-navHeader .navHeader-container .navHeader-offlineNotification .content-primaryText{-ms-grid-column:3;overflow:hidden;max-height:30pt;text-overflow:clip;white-space:normal}.control-navHeader .navHeader-container .navHeader-offlineNotification .content-secondaryText{-ms-grid-column-span:3;-ms-grid-row:2;color:#5dc21e}@media(-ms-high-contrast){.control-navHeader .navHeader-container .navHeader-offlineNotification .content-secondaryText{color:WindowText}}button.template-navHeaderButton{overflow:visible;min-width:85px;min-height:40px;padding:9px 20px 11px;border:none;color:#ebebeb;background-color:#222}button.template-navHeaderButton,button.template-navHeaderButton:focus{border:0 solid;outline-style:none}.showKeyboardFocus button.template-navHeaderButton.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus button.template-navHeaderButton.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;left:3px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus button.template-navHeaderButton.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus button.template-navHeaderButton.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}@media(-ms-high-contrast){button.template-navHeaderButton{color:ButtonText}}@media(-ms-high-contrast){button.template-navHeaderButton{background-color:ButtonFace}}button.template-navHeaderButton:hover{color:#ebebeb;background-color:#101010}@media(-ms-high-contrast){button.template-navHeaderButton:hover{color:HighlightText}}@media(-ms-high-contrast){button.template-navHeaderButton:hover{background-color:Highlight}}button.template-navHeaderButton:active,button.template-navHeaderButton:hover:active{color:#ebebeb;background-color:#101010}@media(-ms-high-contrast){button.template-navHeaderButton:active,button.template-navHeaderButton:hover:active{color:ButtonFace}}@media(-ms-high-contrast){button.template-navHeaderButton:active,button.template-navHeaderButton:hover:active{background-color:ButtonText}}button.template-navHeaderButton.selected,button.template-navHeaderButton.selected:active,button.template-navHeaderButton.selected:hover,button.template-navHeaderButton.selected:hover:active{color:#ebebeb;background-color:#107c10}@media(-ms-high-contrast){button.template-navHeaderButton.selected,button.template-navHeaderButton.selected:active,button.template-navHeaderButton.selected:hover,button.template-navHeaderButton.selected:hover:active{color:HighlightText}}@media(-ms-high-contrast){button.template-navHeaderButton.selected,button.template-navHeaderButton.selected:active,button.template-navHeaderButton.selected:hover,button.template-navHeaderButton.selected:hover:active{background-color:Highlight}}button.template-navHeaderButton:disabled,button.template-navHeaderButton:disabled:active,button.template-navHeaderButton:disabled:hover,button.template-navHeaderButton:disabled:hover:active{color:#ebebeb;background-color:#646464;opacity:.5}@media(-ms-high-contrast){button.template-navHeaderButton:disabled,button.template-navHeaderButton:disabled:active,button.template-navHeaderButton:disabled:hover,button.template-navHeaderButton:disabled:hover:active{color:GrayText}}@media(-ms-high-contrast){button.template-navHeaderButton:disabled,button.template-navHeaderButton:disabled:active,button.template-navHeaderButton:disabled:hover,button.template-navHeaderButton:disabled:hover:active{background-color:transparent}}@media(-ms-high-contrast){button.template-navHeaderButton,button.template-navHeaderButton.selected,button.template-navHeaderButton:active,button.template-navHeaderButton.selected:active,button.template-navHeaderButton:focus,button.template-navHeaderButton.selected:focus,button.template-navHeaderButton:hover,button.template-navHeaderButton.selected:hover,button.template-navHeaderButton:hover:active,button.template-navHeaderButton.selected:hover:active{border:1px solid ButtonText}button.template-navHeaderButton:disabled,button.template-navHeaderButton.selected:disabled{opacity:1;border:1px solid GrayText}}html[dir=ltr] button.template-navHeaderButton{margin-right:2px}html[dir=rtl] button.template-navHeaderButton{margin-left:2px}.modifierPopupScroller{background-color:#fff;outline:1px solid #c2c2c2;min-width:150px}.modifierPopupScroller .modifierPopupEntry{background-color:#fff}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry{background-color:Window}}.modifierPopupScroller .modifierPopupEntry,.modifierPopupScroller .modifierPopupEntry:focus{border:0 solid;outline-style:none}.showKeyboardFocus .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 8px);height:calc(100% - 8px);top:4px;left:4px;outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .modifierPopupScroller .modifierPopupEntry.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.modifierPopupScroller .modifierPopupEntry,.modifierPopupScroller .modifierPopupEntry:focus{background-color:#fff}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry,.modifierPopupScroller .modifierPopupEntry:focus{background-color:ButtonFace}}.modifierPopupScroller .modifierPopupEntry .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry:focus .modifierPopupEntryLabel{color:#222}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry:focus .modifierPopupEntryLabel{color:ButtonText}}.modifierPopupScroller .modifierPopupEntry:hover,.modifierPopupScroller .modifierPopupEntry:hover:focus{background-color:#ebebeb}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry:hover,.modifierPopupScroller .modifierPopupEntry:hover:focus{background-color:Highlight}}.modifierPopupScroller .modifierPopupEntry:hover .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry:hover:focus .modifierPopupEntryLabel{color:#222}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry:hover .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry:hover:focus .modifierPopupEntryLabel{color:HighlightText}}.modifierPopupScroller .modifierPopupEntry:active,.modifierPopupScroller .modifierPopupEntry:hover:active{background-color:#e2e2e2}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry:active,.modifierPopupScroller .modifierPopupEntry:hover:active{background-color:ButtonText}}.modifierPopupScroller .modifierPopupEntry:active .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry:hover:active .modifierPopupEntryLabel{color:#222}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry:active .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry:hover:active .modifierPopupEntryLabel{color:ButtonFace}}.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:hover,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:active,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:focus{background-color:#107c10}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:hover,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:active,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:focus{background-color:Highlight}}.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:hover .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:active .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:focus .modifierPopupEntryLabel{color:#ebebeb;padding:0 0 2px 0}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:hover .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:active .modifierPopupEntryLabel,.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:focus .modifierPopupEntryLabel{color:HighlightText}}html[dir=rtl] .modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry .modifierPopupEntryLabel,html[dir=rtl] .modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:hover .modifierPopupEntryLabel,html[dir=rtl] .modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:active .modifierPopupEntryLabel,html[dir=rtl] .modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry:focus .modifierPopupEntryLabel{padding:0 0 2px 0}@media(-ms-high-contrast){.modifierPopupScroller .modifierPopupEntry.initialSelectedModifierPopupEntry.acc-keyboardFocusTarget::after{outline-color:HighlightText}}@media(-ms-high-contrast){.modifierPopupScroller{outline:none;margin-top:0}}.control-galleryHost{width:100%;height:100%;position:relative}.control-gallery{width:100%;height:100%;margin:0}html[dir=rtl] .control-gallery{margin:0}.control-gallery .win-listview{height:100%}.control-gallery .win-listview :not(.win-footprint).win-itembox{background-color:transparent}.control-gallery .win-listview .win-viewport.win-vertical{}.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout{margin:0 36px 0 36px}.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container:hover,.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container:active,.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container:active:hover{outline:none}.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container:hover .win-itembox,.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container:active .win-itembox,.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container:active:hover .win-itembox{background-color:transparent}.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container .win-itembox.win-focused .win-focusedoutline{position:relative;position:absolute;top:0;left:0;width:100%;height:100%}.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container .win-itembox.win-focused .win-focusedoutline:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container .win-itembox.win-focused .win-focusedoutline:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout .win-container .win-itembox.win-focused .win-focusedoutline.selected:after{outline-color:HighlightText}}html[dir=rtl] .control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout{margin:0 36px 0 36px}@media(max-width:768px){html[dir=ltr] .control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout{margin-left:26px}html[dir=rtl] .control-gallery .win-listview .win-viewport.win-vertical .win-surface.win-gridlayout{margin-right:26px}}.control-pagedItemsControl .pagedItemsControl-previousButton,.control-pagedItemsControl .pagedItemsControl-nextButton{position:relative;-ms-grid-row-align:center;padding-bottom:10px;min-width:30px;width:30px;height:50px;color:#ebebeb}.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus,.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus,.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus:focus,.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus:after,.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;outline:1px solid #ebebeb}html[dir=ltr] .showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus:after,html[dir=ltr] .showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus:after{left:3px}html[dir=rtl] .showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus:after,html[dir=rtl] .showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus:after{right:3px}@media(-ms-high-contrast){.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-previousButton:focus:after,.showKeyboardFocus .control-pagedItemsControl .pagedItemsControl-nextButton:focus:after{outline:1px solid -ms-hotlight}}@media(-ms-high-contrast){.control-pagedItemsControl .pagedItemsControl-previousButton,.control-pagedItemsControl .pagedItemsControl-nextButton{opacity:1}}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader{color:#ebebeb;z-index:1}@media(-ms-high-contrast){.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader{color:WindowText}}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton{color:#ebebeb}@media(-ms-high-contrast:none){.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton:hover{opacity:.8}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton:active,.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton:hover:active{opacity:.6}}@media(-ms-high-contrast){.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton{color:Highlight}}.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton,.control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton:focus{border:none;outline:none}.showKeyboardFocus .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton:focus{outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-shrinkAndStayHeaderControl .shrinkAndStayHeaderControl-dropDownHeader .dropDownHeader-actionButton:focus{outline-color:-ms-hotlight}}button.win-navigation-backbutton{overflow:visible;min-width:30px;height:30px;padding:0}button.win-navigation-backbutton .win-label{display:none}button.win-navigation-backbutton .win-commandicon{-ms-grid-column-align:center}button.win-navigation-backbutton .win-commandring,button.win-navigation-backbutton .win-back{border-color:#ebebeb;background-color:transparent}@media(-ms-high-contrast){button.win-navigation-backbutton .win-commandring,button.win-navigation-backbutton .win-back{border-color:ButtonText}}@media(-ms-high-contrast){button.win-navigation-backbutton .win-commandring,button.win-navigation-backbutton .win-back{background-color:ButtonFace}}button.win-navigation-backbutton .win-commandimage,button.win-navigation-backbutton .win-back{width:30px;height:30px;font-size:10.75pt;color:#ebebeb}@media(-ms-high-contrast){button.win-navigation-backbutton .win-commandimage,button.win-navigation-backbutton .win-back{color:ButtonText}}button.win-navigation-backbutton .win-commandimage{line-height:30px}button.win-navigation-backbutton .win-back{line-height:27px}button.win-navigation-backbutton:hover .win-commandring,button.win-navigation-backbutton:hover .win-back{border-color:#ebebeb;background-color:rgba(235,235,235,.2)}@media(-ms-high-contrast){button.win-navigation-backbutton:hover .win-commandring,button.win-navigation-backbutton:hover .win-back{border-color:HighlightText}}@media(-ms-high-contrast){button.win-navigation-backbutton:hover .win-commandring,button.win-navigation-backbutton:hover .win-back{background-color:Highlight}}button.win-navigation-backbutton:hover .win-commandimage,button.win-navigation-backbutton:hover .win-back{color:#ebebeb}@media(-ms-high-contrast){button.win-navigation-backbutton:hover .win-commandimage,button.win-navigation-backbutton:hover .win-back{color:HighlightText}}button.win-navigation-backbutton:active .win-commandring,button.win-navigation-backbutton:hover:active .win-commandring,button.win-navigation-backbutton:active .win-back,button.win-navigation-backbutton:hover:active .win-back{border-color:#ebebeb;background-color:#ebebeb}@media(-ms-high-contrast){button.win-navigation-backbutton:active .win-commandring,button.win-navigation-backbutton:hover:active .win-commandring,button.win-navigation-backbutton:active .win-back,button.win-navigation-backbutton:hover:active .win-back{border-color:ButtonFace}}@media(-ms-high-contrast){button.win-navigation-backbutton:active .win-commandring,button.win-navigation-backbutton:hover:active .win-commandring,button.win-navigation-backbutton:active .win-back,button.win-navigation-backbutton:hover:active .win-back{background-color:ButtonText}}button.win-navigation-backbutton:active .win-commandimage,button.win-navigation-backbutton:hover:active .win-commandimage,button.win-navigation-backbutton:active .win-back,button.win-navigation-backbutton:hover:active .win-back{color:#222}@media(-ms-high-contrast){button.win-navigation-backbutton:active .win-commandimage,button.win-navigation-backbutton:hover:active .win-commandimage,button.win-navigation-backbutton:active .win-back,button.win-navigation-backbutton:hover:active .win-back{color:ButtonFace}}button.win-navigation-backbutton,button.win-navigation-backbutton:focus{border:0 solid;outline-style:none}.showKeyboardFocus button.win-navigation-backbutton.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus button.win-navigation-backbutton.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - -8px);height:calc(100% - -8px);top:-4px;left:-4px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus button.win-navigation-backbutton.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}button.win-navigation-backbutton,button.win-navigation-backbutton:active,button.win-navigation-backbutton:hover,button.win-navigation-backbutton:active:hover{width:30px;height:30px;padding:0}.control-starRating{padding:3px 0 0 0}.control-starRating .win-rating{height:auto;padding:0;margin:0}.control-starRating .win-rating .win-star{width:14px;height:14px;font-size:14px;padding:0 1px}.control-starRating .win-rating .win-star.win-full.win-user,.control-starRating .win-rating .win-star.win-full.win-user.win-disabled,.control-starRating .win-rating .win-star.win-full.win-tentative{color:#299c10}.control-starRating .win-rating .win-star.win-full.win-average,.control-starRating .win-rating .win-star.win-full.win-average.win-disabled{color:#ebebeb}.control-starRating .win-rating .win-star.win-empty{color:#898989}.control-starRating .ratingInfo{margin-top:-3px;padding:0 10px 0 4px}html[dir=rtl] .control-starRating .ratingInfo{padding:0 4px 0 10px}.control-starRating .part-userRatedIndicator,.control-starRating .part-totalRatings{margin-top:0;padding:0;color:#898989;font-size:11pt;font-weight:400;line-height:15pt}.control-starRating .part-userRatedIndicator.maxLines-one,.control-starRating .part-totalRatings.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-starRating .part-userRatedIndicator.maxLines-two,.control-starRating .part-totalRatings.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-starRating .part-userRatedIndicator.maxLines-three,.control-starRating .part-totalRatings.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-starRating .part-userRatedIndicator.maxLines-four,.control-starRating .part-totalRatings.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-starRating .part-userRatedIndicator.maxLines-seven,.control-starRating .part-totalRatings.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-starRating .part-userRatedIndicator.maxLines-one,.control-starRating .part-totalRatings.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-starRating .part-userRatedIndicator.maxLines-two,.control-starRating .part-totalRatings.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-starRating .part-userRatedIndicator.maxLines-three,.control-starRating .part-totalRatings.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-starRating .part-userRatedIndicator.maxLines-four,.control-starRating .part-totalRatings.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-starRating .part-userRatedIndicator.maxLines-seven,.control-starRating .part-totalRatings.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-starRating .part-userRatedIndicator.maxLines-one,.control-starRating .part-totalRatings.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-starRating .part-userRatedIndicator.maxLines-two,.control-starRating .part-totalRatings.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-starRating .part-userRatedIndicator.maxLines-three,.control-starRating .part-totalRatings.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-starRating .part-userRatedIndicator.maxLines-four,.control-starRating .part-totalRatings.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-starRating .part-userRatedIndicator.maxLines-seven,.control-starRating .part-totalRatings.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-starRating .mediaRatingControl,.control-starRating .mediaRatingControl:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-starRating .mediaRatingControl.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .control-starRating .mediaRatingControl.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 0%);height:calc(100% - 0%);top:0%;left:0%;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-starRating .mediaRatingControl.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}.control-metaCritic{padding:0;margin:0 8px -2px 0}html[dir=rtl] .control-metaCritic{margin:0 0 -2px 8px}.control-metaCritic .part-metaCriticScore{width:20px;height:19px;padding:0 0 1px;font-size:11pt;font-weight:400;line-height:15pt}.control-metaCritic .part-metaCriticScore.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-metaCritic .part-metaCriticScore.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-metaCritic .part-metaCriticScore.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-metaCritic .part-metaCriticScore.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-metaCritic .part-metaCriticScore.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-metaCritic .part-metaCriticScore.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-metaCritic .part-metaCriticScore.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-metaCritic .part-metaCriticScore.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-metaCritic .part-metaCriticScore.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-metaCritic .part-metaCriticScore.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-metaCritic .part-metaCriticScore.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-metaCritic .part-metaCriticScore.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-metaCritic .part-metaCriticScore.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-metaCritic .part-metaCriticScore.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-metaCritic .part-metaCriticScore.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.template-listItem{display:flex;flex-flow:row wrap;height:50px;overflow:hidden;padding:0 20px 0 30px}html[dir=rtl] .template-listItem{padding:0 30px 0 20px}.template-listItem,.template-listItem:focus{border:0 solid;outline-style:none}.showKeyboardFocus .template-listItem.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .template-listItem.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;left:3px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .template-listItem.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .template-listItem.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.template-listItem.episodeListItem_promoted{color:#107c10}@media(-ms-high-contrast){.template-listItem.episodeListItem_promoted{color:-ms-hotlight}}.template-listItem:hover{background-color:rgba(0,0,0,.05)}@media(-ms-high-contrast){.template-listItem:hover{color:HighlightText;background-color:Highlight}}@media(-ms-high-contrast){.template-listItem:hover .listItem-column.column_date,.template-listItem:hover .listItem-column.column_duration{color:HighlightText}}.template-listItem .listItem-column{height:36px;padding-top:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;text-overflow:clip}html[dir=ltr] .template-listItem .listItem-column{margin-right:10px}html[dir=rtl] .template-listItem .listItem-column{margin-left:10px}.template-listItem .listItem-column.column_title{flex:1 0 320px;display:-ms-grid;-ms-grid-columns:auto 1fr;-ms-grid-rows:1fr}.template-listItem .listItem-column.column_title .title-episodeNumber{-ms-grid-column:1;-ms-grid-row:1;width:30px}.template-listItem .listItem-column.column_title .title-name{-ms-grid-column:2;-ms-grid-row:1}.template-listItem .listItem-column.column_watchProgress{flex:0 1 240px}.template-listItem .listItem-column.column_watchProgress .control-watchProgress{max-width:80px}.template-listItem .listItem-column.column_watchProgress .control-watchProgress .watchProgress-progressBar{background-color:#101010}@media(-ms-high-contrast){.template-listItem .listItem-column.column_watchProgress .control-watchProgress .watchProgress-progressBar{width:calc(100% - 2px)}}.template-listItem .listItem-column.column_date{flex:0 1 160px;color:#898989}@media(-ms-high-contrast){.template-listItem .listItem-column.column_date{color:WindowText}}.template-listItem .listItem-column.column_duration{flex:0 0 80px;color:#898989}@media(-ms-high-contrast){.template-listItem .listItem-column.column_duration{color:WindowText}}@media(min-width:1660px){.template-listItem .listItem-column.column_watchProgress{flex:0 0 320px}.template-listItem .listItem-column.column_date{flex:0 0 320px}}@media(max-width:1024px){.template-listItem .listItem-column.column_title{flex:1 0 240px}.template-listItem .listItem-column.column_date{flex:1 1 80px}.template-listItem .listItem-column.column_watchProgress{flex:1 1 80px}}.control-audioTrackPicker,.control-closedCaptionPicker{background-color:#fff;outline:1px solid #c2c2c2;width:140px}.control-audioTrackPicker::after,.control-closedCaptionPicker::after{content:"";position:absolute;width:0;height:0;bottom:-7px;border:7px solid transparent;border-left-color:#fff;border-bottom-color:#fff;transform:rotate(-45deg)}html[dir=ltr] .control-audioTrackPicker::after,html[dir=ltr] .control-closedCaptionPicker::after{left:62px}html[dir=rtl] .control-audioTrackPicker::after,html[dir=rtl] .control-closedCaptionPicker::after{right:62px}@media(-ms-high-contrast){.control-audioTrackPicker::after,.control-closedCaptionPicker::after{display:none}}.control-audioTrackPicker::before,.control-closedCaptionPicker::before{content:"";position:absolute;width:0;height:0;bottom:-7px;border:9px solid transparent;border-left-color:#c2c2c2;border-bottom-color:#c2c2c2;transform:rotate(-45deg)}html[dir=ltr] .control-audioTrackPicker::before,html[dir=ltr] .control-closedCaptionPicker::before{left:60px}html[dir=rtl] .control-audioTrackPicker::before,html[dir=rtl] .control-closedCaptionPicker::before{right:60px}@media(-ms-high-contrast){.control-audioTrackPicker::before,.control-closedCaptionPicker::before{display:none}}.control-AudioTrackPicker-overlayAnchor,.control-ClosedCaptionPicker-overlayAnchor{background-color:transparent;display:block}@media(-ms-high-contrast){.control-AudioTrackPicker-overlayAnchor .overlayBackground,.control-ClosedCaptionPicker-overlayAnchor .overlayBackground{background-color:transparent}}.template-audioTrackPickerItem,.template-closedCaptionPickerItem{height:40px;position:relative;padding:0 20px;display:-ms-grid;-ms-grid-rows:1fr;background-color:#fff}@media(-ms-high-contrast){.template-audioTrackPickerItem,.template-closedCaptionPickerItem{background-color:Window}}.template-audioTrackPickerItem,.template-closedCaptionPickerItem,.template-audioTrackPickerItem:focus,.template-closedCaptionPickerItem:focus{border:0 solid;outline-style:none}.showKeyboardFocus .template-audioTrackPickerItem.acc-keyboardFocusTarget:focus,.showKeyboardFocus .template-closedCaptionPickerItem.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .template-audioTrackPickerItem.acc-keyboardFocusTarget:focus:after,.showKeyboardFocus .template-closedCaptionPickerItem.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 8px);height:calc(100% - 8px);top:4px;left:4px;outline:1px solid #222}@media(-ms-high-contrast){.showKeyboardFocus .template-audioTrackPickerItem.acc-keyboardFocusTarget:focus:after,.showKeyboardFocus .template-closedCaptionPickerItem.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .template-audioTrackPickerItem.acc-keyboardFocusTarget:focus.selected:after,.showKeyboardFocus .template-closedCaptionPickerItem.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.template-audioTrackPickerItem .audioTrackPickerItem-title,.template-closedCaptionPickerItem .audioTrackPickerItem-title,.template-audioTrackPickerItem .closedCaptionPickerItem-title,.template-closedCaptionPickerItem .closedCaptionPickerItem-title{max-width:110px;-ms-grid-row-align:center;-ms-grid-column-align:center}.template-audioTrackPickerItem,.template-closedCaptionPickerItem,.template-audioTrackPickerItem:focus,.template-closedCaptionPickerItem:focus{background-color:#fff}@media(-ms-high-contrast){.template-audioTrackPickerItem,.template-closedCaptionPickerItem,.template-audioTrackPickerItem:focus,.template-closedCaptionPickerItem:focus{background-color:ButtonFace}}.template-audioTrackPickerItem .audioTrackPickerItem-title,.template-closedCaptionPickerItem .audioTrackPickerItem-title,.template-audioTrackPickerItem:focus .audioTrackPickerItem-title,.template-closedCaptionPickerItem:focus .audioTrackPickerItem-title,.template-audioTrackPickerItem .closedCaptionPickerItem-title,.template-closedCaptionPickerItem .closedCaptionPickerItem-title,.template-audioTrackPickerItem:focus .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:focus .closedCaptionPickerItem-title{color:#222}@media(-ms-high-contrast){.template-audioTrackPickerItem .audioTrackPickerItem-title,.template-closedCaptionPickerItem .audioTrackPickerItem-title,.template-audioTrackPickerItem:focus .audioTrackPickerItem-title,.template-closedCaptionPickerItem:focus .audioTrackPickerItem-title,.template-audioTrackPickerItem .closedCaptionPickerItem-title,.template-closedCaptionPickerItem .closedCaptionPickerItem-title,.template-audioTrackPickerItem:focus .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:focus .closedCaptionPickerItem-title{color:ButtonText}}.template-audioTrackPickerItem:hover,.template-closedCaptionPickerItem:hover,.template-audioTrackPickerItem:hover:focus,.template-closedCaptionPickerItem:hover:focus{background-color:#ebebeb}@media(-ms-high-contrast){.template-audioTrackPickerItem:hover,.template-closedCaptionPickerItem:hover,.template-audioTrackPickerItem:hover:focus,.template-closedCaptionPickerItem:hover:focus{background-color:Highlight}}.template-audioTrackPickerItem:hover .audioTrackPickerItem-title,.template-closedCaptionPickerItem:hover .audioTrackPickerItem-title,.template-audioTrackPickerItem:hover:focus .audioTrackPickerItem-title,.template-closedCaptionPickerItem:hover:focus .audioTrackPickerItem-title,.template-audioTrackPickerItem:hover .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:hover .closedCaptionPickerItem-title,.template-audioTrackPickerItem:hover:focus .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:hover:focus .closedCaptionPickerItem-title{color:#222}@media(-ms-high-contrast){.template-audioTrackPickerItem:hover .audioTrackPickerItem-title,.template-closedCaptionPickerItem:hover .audioTrackPickerItem-title,.template-audioTrackPickerItem:hover:focus .audioTrackPickerItem-title,.template-closedCaptionPickerItem:hover:focus .audioTrackPickerItem-title,.template-audioTrackPickerItem:hover .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:hover .closedCaptionPickerItem-title,.template-audioTrackPickerItem:hover:focus .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:hover:focus .closedCaptionPickerItem-title{color:HighlightText}}.template-audioTrackPickerItem:active,.template-closedCaptionPickerItem:active,.template-audioTrackPickerItem:hover:active,.template-closedCaptionPickerItem:hover:active{background-color:#e2e2e2}@media(-ms-high-contrast){.template-audioTrackPickerItem:active,.template-closedCaptionPickerItem:active,.template-audioTrackPickerItem:hover:active,.template-closedCaptionPickerItem:hover:active{background-color:ButtonText}}.template-audioTrackPickerItem:active .audioTrackPickerItem-title,.template-closedCaptionPickerItem:active .audioTrackPickerItem-title,.template-audioTrackPickerItem:hover:active .audioTrackPickerItem-title,.template-closedCaptionPickerItem:hover:active .audioTrackPickerItem-title,.template-audioTrackPickerItem:active .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:active .closedCaptionPickerItem-title,.template-audioTrackPickerItem:hover:active .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:hover:active .closedCaptionPickerItem-title{color:#222}@media(-ms-high-contrast){.template-audioTrackPickerItem:active .audioTrackPickerItem-title,.template-closedCaptionPickerItem:active .audioTrackPickerItem-title,.template-audioTrackPickerItem:hover:active .audioTrackPickerItem-title,.template-closedCaptionPickerItem:hover:active .audioTrackPickerItem-title,.template-audioTrackPickerItem:active .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:active .closedCaptionPickerItem-title,.template-audioTrackPickerItem:hover:active .closedCaptionPickerItem-title,.template-closedCaptionPickerItem:hover:active .closedCaptionPickerItem-title{color:ButtonFace}}.template-audioTrackPickerItem.state_selected,.template-closedCaptionPickerItem.state_selected,.template-audioTrackPickerItem.state_selected:hover,.template-closedCaptionPickerItem.state_selected:hover,.template-audioTrackPickerItem.state_selected:active,.template-closedCaptionPickerItem.state_selected:active,.template-audioTrackPickerItem.state_selected:focus,.template-closedCaptionPickerItem.state_selected:focus{background-color:#107c10}@media(-ms-high-contrast){.template-audioTrackPickerItem.state_selected,.template-closedCaptionPickerItem.state_selected,.template-audioTrackPickerItem.state_selected:hover,.template-closedCaptionPickerItem.state_selected:hover,.template-audioTrackPickerItem.state_selected:active,.template-closedCaptionPickerItem.state_selected:active,.template-audioTrackPickerItem.state_selected:focus,.template-closedCaptionPickerItem.state_selected:focus{background-color:Highlight}}.template-audioTrackPickerItem.state_selected .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected:hover .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected:hover .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected:active .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected:active .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected:focus .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected:focus .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected .closedCaptionPickerItem-title,.template-audioTrackPickerItem.state_selected:hover .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected:hover .closedCaptionPickerItem-title,.template-audioTrackPickerItem.state_selected:active .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected:active .closedCaptionPickerItem-title,.template-audioTrackPickerItem.state_selected:focus .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected:focus .closedCaptionPickerItem-title{color:#ebebeb}@media(-ms-high-contrast){.template-audioTrackPickerItem.state_selected .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected:hover .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected:hover .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected:active .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected:active .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected:focus .audioTrackPickerItem-title,.template-closedCaptionPickerItem.state_selected:focus .audioTrackPickerItem-title,.template-audioTrackPickerItem.state_selected .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected .closedCaptionPickerItem-title,.template-audioTrackPickerItem.state_selected:hover .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected:hover .closedCaptionPickerItem-title,.template-audioTrackPickerItem.state_selected:active .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected:active .closedCaptionPickerItem-title,.template-audioTrackPickerItem.state_selected:focus .closedCaptionPickerItem-title,.template-closedCaptionPickerItem.state_selected:focus .closedCaptionPickerItem-title{color:HighlightText}}html{overflow:hidden;-ms-user-select:none}html,body{height:100%;width:100%;margin:0;padding:0;cursor:default;-ms-content-zooming:none;overflow:hidden}html{direction:ltr}html:lang(ar),html:lang(dv),html:lang(fa),html:lang(he),html:lang(ku-Arab),html:lang(pa-Arab),html:lang(prs),html:lang(ps),html:lang(sd-Arab),html:lang(syr),html:lang(ug),html:lang(ur),html:lang(qps-plocm){direction:rtl}header,footer,div,span,header,img,button,svg,object{z-index:0}.removeFromDisplay{display:none!important}.control-app{position:relative;overflow:hidden;width:100%;height:100%;background-color:#303030;display:-ms-grid;-ms-grid-columns:90px minmax(210px,.22fr) 1fr minmax(340px,.25fr);-ms-grid-rows:1fr}.control-app .app-body{background-color:#303030;-ms-grid-column:3;-ms-grid-row:1;-ms-grid-column-span:2;overflow-y:hidden;overflow-x:hidden;position:relative}.control-app .app-body>div{overflow-y:auto;overflow-x:hidden;height:100%;width:100%}.control-app .app-body.state-expanded{-ms-grid-column-span:3;-ms-grid-column:2}@media all and (max-width:1023px){.control-app .app-body{-ms-grid-column:2;-ms-grid-column-span:4}}.control-app .app-navpane{-ms-grid-column:1;-ms-grid-column-span:2;-ms-grid-row:1;color:#ebebeb;background-color:#101010;position:relative;z-index:1;display:-ms-grid;-ms-grid-rows:110px 40px 20px 1fr;-ms-grid-columns:1fr}.control-app .app-navpane.state-collapsing .button-content,.control-app .app-navpane.state-collapsing .verticalPlaylistItem-text{opacity:0}.control-app .app-navpane.state-collapsing .button-icon,.control-app .app-navpane.state-collapsing .verticalPlaylistItem-icon{opacity:0}.control-app .app-navpane .template-verticalPivotItem{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;width:100%;height:100%;height:50px}.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button{display:-ms-grid;-ms-grid-columns:35px 25px 1fr 35px;-ms-grid-rows:1fr;position:relative;height:50px;padding:0 0 1px 0;color:#ebebeb;background-color:#101010}.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button .button-icon{position:relative;-ms-grid-column:2;-ms-grid-column-span:1;-ms-grid-column-align:start;-ms-grid-row-align:center;transition-property:opacity;transition-duration:250ms}.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button .button-content{position:relative;-ms-grid-column:3;-ms-grid-column-align:start;-ms-grid-row-align:center;text-align:left;transition-property:opacity;transition-duration:250ms}html[dir=rtl] .control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button .button-content{text-align:right}.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button:hover{color:#ebebeb;background-color:#222}.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button:active:not(.selected),.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button:hover:active:not(.selected){color:#ebebeb;background-color:#222}.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button:focus{color:#ebebeb}.app-newvideo:not(.activepage-search) .control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button.selected{background-color:#107c10}@media(-ms-high-contrast){.app-newvideo:not(.activepage-search) .control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button.selected{color:HighlightText;background-color:Highlight}}.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button,.control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;left:3px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .control-app .app-navpane .template-verticalPivotItem .verticalPivotItem-button.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.control-app .app-navpane .template-verticalPivotItem.verticalPivotItem_collection .button-icon{transform:translateY(1px)}.control-app .app-navpane .navpane-header{margin-top:56px;display:-ms-grid;-ms-grid-columns:33px 32px 1fr auto 35px;-ms-grid-rows:40px;color:#ebebeb}.control-app .app-navpane .navpane-header .header-branded{-ms-grid-column:2;transform:translateY(-2px);width:131px;height:28px}.control-app .app-navpane .navpane-header .header-logo{-ms-grid-column:2}.control-app .app-navpane .navpane-header .header-label{-ms-grid-column:3;-ms-grid-row-align:start;text-transform:capitalize;transform:translateY(-2px)}.control-app .app-navpane .navpane-header.navpane-noMarketplace .header-branded{display:none}.control-app .app-navpane .navpane-header .header-toggleButton{-ms-grid-column:4;-ms-grid-row-align:start;padding:0;color:#107c10;margin-top:9px;transform:translateY(-5px)}.control-app .app-navpane .navpane-header .header-toggleButton,.control-app .app-navpane .navpane-header .header-toggleButton:focus{border:0 solid;outline-style:none}.showKeyboardFocus .control-app .app-navpane .navpane-header .header-toggleButton:focus{position:relative}.showKeyboardFocus .control-app .app-navpane .navpane-header .header-toggleButton:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .control-app .app-navpane .navpane-header .header-toggleButton:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .control-app .app-navpane .navpane-header .header-toggleButton:focus.selected:after{outline-color:HighlightText}}@media(-ms-high-contrast:none){.control-app .app-navpane .navpane-header .header-toggleButton:hover{opacity:.8}.control-app .app-navpane .navpane-header .header-toggleButton:active,.control-app .app-navpane .navpane-header .header-toggleButton:hover:active{opacity:.6}}.control-app .app-navpane .navpane-search{-ms-grid-row:2;margin:0 20px;width:calc(100% - 40px);height:40px;z-index:1}.control-app .app-navpane .navpane-search .win-searchbox-input{height:40px;width:calc(100% - 39px);font-size:11pt;font-weight:300;line-height:15pt}html[dir=ltr] .control-app .app-navpane .navpane-search .win-searchbox-input{padding-left:7px}html[dir=rtl] .control-app .app-navpane .navpane-search .win-searchbox-input{padding-right:7px}html[dir=ltr] .control-app .app-navpane .navpane-search .win-searchbox-input{padding-right:32px}html[dir=rtl] .control-app .app-navpane .navpane-search .win-searchbox-input{padding-left:32px}.control-app .app-navpane .navpane-search .win-searchbox-input.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.control-app .app-navpane .navpane-search .win-searchbox-input.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.control-app .app-navpane .navpane-search .win-searchbox-input.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.control-app .app-navpane .navpane-search .win-searchbox-input.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.control-app .app-navpane .navpane-search .win-searchbox-input.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear{display:block;width:22px;color:#222}html[dir=ltr] .control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear{margin-right:13px}html[dir=rtl] .control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear{margin-left:13px}@media(-ms-high-contrast:none){.control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear:hover{opacity:.8}.control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear:active,.control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear:hover:active{opacity:.6}}.control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear,.control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear:hover,.control-app .app-navpane .navpane-search .win-searchbox-input::-ms-clear:active{background-color:transparent}.control-app .app-navpane .navpane-search .win-searchbox-button{width:40px;height:40px;line-height:40px}@media(-ms-high-contrast:none){.control-app .app-navpane .navpane-search{color:#c2c2c2;background-color:#303030;border:0}.control-app .app-navpane .navpane-search .win-searchbox-input{color:#ebebeb;background-color:#303030}.control-app .app-navpane .navpane-search .win-searchbox-input:focus{color:#ebebeb}.control-app .app-navpane .navpane-search.win-searchbox-input-focus .win-searchbox-input,.activepage-search .control-app .app-navpane .navpane-search .win-searchbox-input{color:#222;background-color:#ebebeb}.control-app .app-navpane .navpane-search .win-searchbox-button{color:#c2c2c2;background-color:#303030}.control-app .app-navpane .navpane-search .win-searchbox-button.win-searchbox-button-input-focus,.activepage-search .control-app .app-navpane .navpane-search .win-searchbox-button{color:#ebebeb;background-color:#107c10}.control-app .app-navpane .navpane-search .win-searchbox-button:hover{color:#ebebeb;background-color:#299c10}.control-app .app-navpane .navpane-search .win-searchbox-button:active{color:#ebebeb;background-color:#5dc21e}.control-app .app-navpane .navpane-search ::-ms-clear{color:#ebebeb;background-color:rgba(0,0,0,0)}.control-app .app-navpane .navpane-search ::-ms-clear:hover{background-color:#3a3a3a}.control-app .app-navpane .navpane-search ::-ms-clear:active{background-color:#646464}.control-app .app-navpane .navpane-search .win-searchbox-flyout{width:100%;margin:0 0 0 -2px;background-color:#fff}html[dir=rtl] .control-app .app-navpane .navpane-search .win-searchbox-flyout{margin:0 -2px 0 0}.control-app .app-navpane .navpane-search .win-searchbox-flyout .win-searchbox-suggestion-query{padding:9px 20px 12px}.control-app .app-navpane .navpane-search .win-searchbox-flyout .win-searchbox-suggestion-query:hover{background-color:#ebebeb}.control-app .app-navpane .navpane-search .win-searchbox-flyout .win-searchbox-suggestion-query.win-searchbox-suggestion-selected{background-color:#ebebeb}.control-app .app-navpane .navpane-search .win-searchbox-flyout .win-searchbox-suggestion-query:active{color:#ebebeb;background-color:#e2e2e2}.control-app .app-navpane .navpane-search .win-searchbox-flyout .win-searchbox-suggestion-query .win-searchbox-flyout-highlighttext{color:#107c10}}.control-app .app-navpane .navpane-invokeSearch.template-verticalPivotItem{-ms-grid-row:2;-ms-grid-row-align:end;display:none}.control-app .app-navpane .navpane-invokeSearchSeparator{-ms-grid-row:3;margin:10px 10px 0 10px;border-top:1px solid #646464;opacity:0}.control-app .app-navpane .navpane-content{overflow-x:hidden;overflow-y:auto;display:-ms-grid;-ms-grid-row:4;-ms-grid-rows:auto auto auto auto 1fr 40px;-ms-grid-columns:1fr}.control-app .app-navpane .navpane-content .navpane-pivots{-ms-grid-row:2}.control-app .app-navpane .navpane-content .navpane-separator{-ms-grid-row:3;margin:27px 35px 20px 35px;border-top:1px solid #646464}@media all and (max-width:1023px){.control-app .app-navpane:not(.state-expanded){-ms-grid-column:1;-ms-grid-column-span:1}.control-app .app-navpane:not(.state-expanded) .navpane-search,.control-app .app-navpane:not(.state-expanded)>.navpane-content .navpane-playlists>:not(.playlists-createPlaylistButton):not(.playlists-showPlaylistsButton):not(.playlists-nowPlayingPlaylist){display:none}.control-app .app-navpane:not(.state-expanded) .navpane-header{-ms-grid-columns:1fr}.control-app .app-navpane:not(.state-expanded) .navpane-header .header-label,.control-app .app-navpane:not(.state-expanded) .navpane-header .header-logo{display:none}.control-app .app-navpane:not(.state-expanded) .navpane-header .header-toggleButton{-ms-grid-column:1;-ms-grid-column-align:center}.control-app .app-navpane:not(.state-expanded) .navpane-invokeSearch.template-verticalPivotItem{display:block}.control-app .app-navpane:not(.state-expanded) .navpane-invokeSearch.template-verticalPivotItem .button-icon{animation-name:fadeIn;animation-duration:250ms}.control-app .app-navpane:not(.state-expanded) .navpane-invokeSearchSeparator{opacity:1}.control-app .app-navpane:not(.state-expanded) .verticalPivotItem-button{-ms-grid-columns:1fr}.control-app .app-navpane:not(.state-expanded) .verticalPivotItem-button .button-content{display:none}.control-app .app-navpane:not(.state-expanded) .verticalPivotItem-button .button-icon{display:block;-ms-grid-column:1;-ms-grid-column-align:center}.control-app .app-navpane:not(.state-expanded) .navpane-content{color:#ebebeb}.control-app .app-navpane:not(.state-expanded) .navpane-content .navpane-separator{margin-left:10px;margin-right:10px}.control-app .app-navpane:not(.state-expanded) .navpane-content .navpane-playlists .playlists-showPlaylistsButton.template-verticalPlaylistItem{display:block}.control-app .app-navpane:not(.state-expanded) .navpane-content .navpane-playlists .verticalPlaylistItem-button{padding-left:0;padding-right:0;-ms-grid-columns:1fr}.control-app .app-navpane:not(.state-expanded) .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-icon{-ms-grid-column:1;-ms-grid-column-align:start;width:18px;display:block}html[dir=ltr] .control-app .app-navpane:not(.state-expanded) .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-icon{margin-left:35px}html[dir=rtl] .control-app .app-navpane:not(.state-expanded) .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-icon{margin-right:35px}.control-app .app-navpane:not(.state-expanded) .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-text{display:none}}@media all and (max-width:1023px)and (-ms-high-contrast){.control-app .app-navpane:not(.state-expanded) .navpane-header{-ms-grid-rows:1fr}.control-app .app-navpane:not(.state-expanded) .navpane-header .header-toggleButton{width:100%;height:100%;margin-top:0}.control-app .app-navpane:not(.state-expanded) .navpane-header .header-toggleButton::before{transform:translateY(-5px)}}@media all and (min-width:1024px){.control-app .app-navpane.state-collapsed{-ms-grid-column:1;-ms-grid-column-span:1}.control-app .app-navpane.state-collapsed .navpane-search,.control-app .app-navpane.state-collapsed>.navpane-content .navpane-playlists>:not(.playlists-createPlaylistButton):not(.playlists-showPlaylistsButton):not(.playlists-nowPlayingPlaylist){display:none}.control-app .app-navpane.state-collapsed .navpane-header{-ms-grid-columns:1fr}.control-app .app-navpane.state-collapsed .navpane-header .header-label,.control-app .app-navpane.state-collapsed .navpane-header .header-logo{display:none}.control-app .app-navpane.state-collapsed .navpane-header .header-toggleButton{-ms-grid-column:1;-ms-grid-column-align:center}.control-app .app-navpane.state-collapsed .navpane-invokeSearch.template-verticalPivotItem{display:block}.control-app .app-navpane.state-collapsed .navpane-invokeSearch.template-verticalPivotItem .button-icon{animation-name:fadeIn;animation-duration:250ms}.control-app .app-navpane.state-collapsed .navpane-invokeSearchSeparator{opacity:1}.control-app .app-navpane.state-collapsed .verticalPivotItem-button{-ms-grid-columns:1fr}.control-app .app-navpane.state-collapsed .verticalPivotItem-button .button-content{display:none}.control-app .app-navpane.state-collapsed .verticalPivotItem-button .button-icon{display:block;-ms-grid-column:1;-ms-grid-column-align:center}.control-app .app-navpane.state-collapsed .navpane-content{color:#ebebeb}.control-app .app-navpane.state-collapsed .navpane-content .navpane-separator{margin-left:10px;margin-right:10px}.control-app .app-navpane.state-collapsed .navpane-content .navpane-playlists .playlists-showPlaylistsButton.template-verticalPlaylistItem{display:block}.control-app .app-navpane.state-collapsed .navpane-content .navpane-playlists .verticalPlaylistItem-button{padding-left:0;padding-right:0;-ms-grid-columns:1fr}.control-app .app-navpane.state-collapsed .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-icon{-ms-grid-column:1;-ms-grid-column-align:start;width:18px;display:block}html[dir=ltr] .control-app .app-navpane.state-collapsed .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-icon{margin-left:35px}html[dir=rtl] .control-app .app-navpane.state-collapsed .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-icon{margin-right:35px}.control-app .app-navpane.state-collapsed .navpane-content .navpane-playlists .verticalPlaylistItem-button .verticalPlaylistItem-text{display:none}}@media all and (min-width:1024px)and (-ms-high-contrast){.control-app .app-navpane.state-collapsed .navpane-header{-ms-grid-rows:1fr}.control-app .app-navpane.state-collapsed .navpane-header .header-toggleButton{width:100%;height:100%;margin-top:0}.control-app .app-navpane.state-collapsed .navpane-header .header-toggleButton::before{transform:translateY(-5px)}}.control-app .app-sidebar{-ms-grid-column:4;-ms-grid-row:1}.control-app .app-sidebar:not(.state-visible){display:none}@media all and (max-width:1023px){.control-app{-ms-grid-columns:90px minmax(210px,.22fr) 1fr 0}.control-app .app-sidebar.state-visible,.control-app .app-sidebar{display:none}}.control-app .app-footer{display:none}.app-classicContainer{position:absolute;width:100vw;height:100vh;top:0;left:0}.app-classicContainer.hideFromDisplay{z-index:0}.app-classicContainer.hideFromDisplay .mainHeader .appInfoNotification,.app-classicContainer.hideFromDisplay .mainHeader .appCriticalNotification{visibility:visible}.app-classicContainer .appNotifications{-ms-grid-columns:30px 1fr auto 30px;-ms-grid-row-span:2}.app-classicContainer .appNotifications .win-flipview .win-navbutton.win-navright,.app-classicContainer .appNotifications .win-flipview .win-navbutton.win-navleft{background-color:transparent}.app-classicContainer .appNotifications .win-flipview .win-navbutton.win-navright:hover,.app-classicContainer .appNotifications .win-flipview .win-navbutton.win-navleft:hover{color:rgba(235,235,235,.4)}.app-classicContainer .appNotifications .win-flipview .win-navbutton.win-navright:hover:active,.app-classicContainer .appNotifications .win-flipview .win-navbutton.win-navleft:hover:active{color:rgba(235,235,235,.8)}.app-classicContainer .appNotifications .appInfoNotification .win-navbutton,.app-classicContainer .appNotifications .appCriticalNotification .win-navbutton{height:60px;top:28px;background-color:transparent;font-family:"none"}.app-classicContainer .appNotifications .appInfoNotification .win-navbutton::before,.app-classicContainer .appNotifications .appCriticalNotification .win-navbutton::before{font-family:"Segoe UI Symbol";position:absolute;top:9px}.app-classicContainer .appNotifications .appInfoNotification .win-navbutton:hover,.app-classicContainer .appNotifications .appCriticalNotification .win-navbutton:hover{color:rgba(235,235,235,.4)}.app-classicContainer .appNotifications .appInfoNotification .win-navbutton:hover:active,.app-classicContainer .appNotifications .appCriticalNotification .win-navbutton:hover:active{color:rgba(235,235,235,.8)}.app-classicContainer .appNotifications .appInfoNotification .win-navbutton.win-navleft::before,.app-classicContainer .appNotifications .appCriticalNotification .win-navbutton.win-navleft::before{content:"";right:15px}html[dir=rtl] .app-classicContainer .appNotifications .appInfoNotification .win-navbutton.win-navleft::before,html[dir=rtl] .app-classicContainer .appNotifications .appCriticalNotification .win-navbutton.win-navleft::before{content:""}.app-classicContainer .appNotifications .appInfoNotification .win-navbutton.win-navright::before,.app-classicContainer .appNotifications .appCriticalNotification .win-navbutton.win-navright::before{content:"";left:15px}html[dir=rtl] .app-classicContainer .appNotifications .appInfoNotification .win-navbutton.win-navright::before,html[dir=rtl] .app-classicContainer .appNotifications .appCriticalNotification .win-navbutton.win-navright::before{content:""}.app-classicContainer .appNotifications .appInfoNotification .notificationContent,.app-classicContainer .appNotifications .appCriticalNotification .notificationContent{margin-top:8px}@media(max-width:500px){.app-classicContainer .appNotifications .appInfoNotification .infoNotificationContainer,.app-classicContainer .appNotifications .appCriticalNotification .infoNotificationContainer,.app-classicContainer .appNotifications .appInfoNotification .criticalNotificationContainer,.app-classicContainer .appNotifications .appCriticalNotification .criticalNotificationContainer{max-width:300px}}.dashboardTitle-searchIcon{visibility:hidden}.app-newvideo .extendedSplashScreen{display:none}.template-headerNotification{color:#ebebeb;border-top:1px solid #222;border-bottom:1px solid #222}@media(-ms-high-contrast){.template-headerNotification{color:WindowText}}.template-headerNotification .headerNotification-content .content-icon{color:#ebebeb}@media(-ms-high-contrast){.template-headerNotification .headerNotification-content .content-icon{color:WindowText}}.template-headerNotification .headerNotification-content .content-secondaryText{color:#5dc21e}@media(-ms-high-contrast){.template-headerNotification .headerNotification-content .content-secondaryText{color:WindowText}}.page-store{height:100%;overflow-x:hidden;overflow-y:auto}.page-store .control-storeHub .storeHub-header{background-color:#303030;display:-ms-grid;-ms-grid-rows:1fr;-ms-grid-columns:1fr;margin-bottom:8px;height:360px;margin-bottom:13px;height:calc((100vw - 300px)/3);min-height:320px}.page-store .control-storeHub .storeHub-header .header-notificationsContainer{display:-ms-grid;-ms-grid-rows:1fr;-ms-grid-columns:1fr;color:#ebebeb}.page-store .control-storeHub .storeHub-header .header-notificationsContainer .viewStateControl-loadingContainer{-ms-grid-column-align:center;-ms-grid-row-align:center}.page-store .control-storeHub .storeHub-header .header-notificationsContainer .viewStateControl-loadingContainer progress:indeterminate{color:#ebebeb}.page-store .control-storeHub .storeHub-header .header-notificationsContainer .viewStateControl-errorContainer,.page-store .control-storeHub .storeHub-header .header-notificationsContainer .viewStateControl-offlineContainer{-ms-grid-column-align:start;-ms-grid-row-align:center;margin:0 40px 40px 40px;width:100%;display:-ms-flexbox;-ms-flex-direction:column;-ms-flex-align:start;-ms-flex-pack:center}.page-store .control-storeHub .storeHub-notifications{margin:30px 40px 0}@media(max-width:768px){.page-store .control-storeHub .storeHub-notifications{margin:30px 30px 0}}.page-store .storeHub-carouselContainer{display:-ms-grid;-ms-grid-columns:40px 1fr 60px;-ms-grid-rows:40px 1fr;height:100%}.page-store .storeHub-carouselContainer .carouselContainer-carousel{-ms-grid-column:1;-ms-grid-column-span:3;-ms-grid-row:1;-ms-grid-row-span:2;height:100%;width:calc((100% - 100% mod 1px) + 1px)}.page-store .storeHub-carouselContainer .carouselContainer-carousel .win-item .win-template:focus,.page-store .storeHub-carouselContainer .carouselContainer-carousel .win-item .win-template:focus:focus{border:0 solid;outline-style:none}.showKeyboardFocus .page-store .storeHub-carouselContainer .carouselContainer-carousel .win-item .win-template:focus:focus{position:relative}.showKeyboardFocus .page-store .storeHub-carouselContainer .carouselContainer-carousel .win-item .win-template:focus:focus:after{content:"";position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .page-store .storeHub-carouselContainer .carouselContainer-carousel .win-item .win-template:focus:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .page-store .storeHub-carouselContainer .carouselContainer-carousel .win-item .win-template:focus:focus.selected:after{outline-color:HighlightText}}.page-store .storeHub-carouselContainer .carouselContainer-jumpButtons{-ms-grid-column:2;-ms-grid-row:2;-ms-grid-row-align:end;-ms-grid-column-align:center;transform:translateY(30px);margin-top:10px}.page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton{background-color:#c2c2c2;width:5px;height:5px;border-radius:2.5px}@media(-ms-high-contrast){.page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton{background-color:ButtonText}}html[dir=ltr] .page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton{margin-right:5px}html[dir=rtl] .page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton{margin-left:5px}.page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton.selected{background-color:#107c10}@media(-ms-high-contrast){.page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton.selected{background-color:Highlight}}@media(-ms-high-contrast){.page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton.selected{width:9px;height:9px;border-radius:4.5px;margin:-2.25px 2px 0 0}html[dir=rtl] .page-store .storeHub-carouselContainer .carouselContainer-jumpButtons .carouselContainer-jumpButton.selected{margin:-2.25px 0 0 2px}}.page-store .storeHub-modulesContainer{max-width:calc(160px*12)}.page-store .storeHub-modulesContainer .topTvSeries-content,.page-store .storeHub-modulesContainer .topMovies-content{-ms-grid-column:2;-ms-grid-column-span:1}.page-gallery{position:relative;display:-ms-grid;-ms-grid-rows:auto 1fr;-ms-grid-columns:1fr;height:100%}.page-gallery .gallery-header.template-heroCarouselItemHost,.page-gallery .gallery-header .template-heroCarouselItemHost{background-color:#303030;display:-ms-grid;-ms-grid-rows:1fr;-ms-grid-columns:1fr;margin-bottom:8px;height:360px;margin-bottom:36px;height:calc((100vw - 300px)/3);min-height:320px}.page-gallery .gallery-content{-ms-grid-row:2}.page-gallery .gallery-content .content-viewStateControl{}.page-gallery .gallery-content .content-viewStateControl .win-container{margin:0 2px 2px 0}html[dir=rtl] .page-gallery .gallery-content .content-viewStateControl .win-container{margin:0 0 2px 2px}.page-gallery .gallery-content .content-viewStateControl .win-container,.page-gallery .gallery-content .content-viewStateControl .win-container .win-item{width:158px;height:248px}.page-gallery .gallery-content .content-viewStateControl.newMovies .win-container,.page-gallery .gallery-content .content-viewStateControl.featuredMovies .win-container,.page-gallery .gallery-content .content-viewStateControl .gallery-movies .win-container,.page-gallery .gallery-content .content-viewStateControl.newMovies .win-container .win-item,.page-gallery .gallery-content .content-viewStateControl.featuredMovies .win-container .win-item,.page-gallery .gallery-content .content-viewStateControl .gallery-movies .win-container .win-item{width:158px;height:303px}.page-gallery .gallery-content .content-viewStateControl.topMovies .win-container,.page-gallery .gallery-content .content-viewStateControl.topMovies .win-container .win-item{width:318px;height:108px}.page-gallery .gallery-content .content-viewStateControl.topTv .win-container,.page-gallery .gallery-content .content-viewStateControl.topTv .win-container .win-item{width:318px;height:83px}.page-gallery .gallery-content .content-viewStateControl.movieFeaturedSets .win-container,.page-gallery .gallery-content .content-viewStateControl.tvFeaturedSets .win-container,.page-gallery .gallery-content .content-viewStateControl.movieFeaturedSets .win-container .win-item,.page-gallery .gallery-content .content-viewStateControl.tvFeaturedSets .win-container .win-item{width:310px;height:248px}.page-gallery .gallery-content .content-viewStateControl.flexhub .win-container,.page-gallery .gallery-content .content-viewStateControl .gallery-mixed .win-container,.page-gallery .gallery-content .content-viewStateControl.flexhub .win-container .win-item,.page-gallery .gallery-content .content-viewStateControl .gallery-mixed .win-container .win-item{width:158px;height:303px}.page-gallery .gallery-content .content-viewStateControl.flexhub.flexhub_featuredsets .win-container,.page-gallery .gallery-content .content-viewStateControl .gallery-mixed.flexhub_featuredsets .win-container,.page-gallery .gallery-content .content-viewStateControl.flexhub.flexhub_featuredsets .win-container .win-item,.page-gallery .gallery-content .content-viewStateControl .gallery-mixed.flexhub_featuredsets .win-container .win-item{width:310px;height:303px}.page-gallery .gallery-content .content-viewStateControl.flexhub .verticalItemTileModule-item,.page-gallery .gallery-content .content-viewStateControl .gallery-mixed .verticalItemTileModule-item{display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;width:100%;height:100%}.page-gallery .gallery-content .content-viewStateControl.flexhub .verticalItemTileModule-item .control-verticalItemTile,.page-gallery .gallery-content .content-viewStateControl .gallery-mixed .verticalItemTileModule-item .control-verticalItemTile{-ms-grid-row-align:end;margin:0 2px 0 0}html[dir=rtl] .page-gallery .gallery-content .content-viewStateControl.flexhub .verticalItemTileModule-item .control-verticalItemTile,html[dir=rtl] .page-gallery .gallery-content .content-viewStateControl .gallery-mixed .verticalItemTileModule-item .control-verticalItemTile{margin:0 0 0 2px}.page-gallery .gallery-content .content-viewStateControl.topMovies .win-container,.page-gallery .gallery-content .content-viewStateControl.topTv .win-container{margin:0 2px 17px 0}html[dir=rtl] .page-gallery .gallery-content .content-viewStateControl.topMovies .win-container,html[dir=rtl] .page-gallery .gallery-content .content-viewStateControl.topTv .win-container{margin:0 0 17px 2px}.page-gallery .gallery-content.contentMovie .content-viewStateControl .win-container,.page-gallery .gallery-content.contentMovie .content-viewStateControl .win-container .win-item{width:158px;height:303px}.page-gallery.gallery_collection .gallery-header,.page-gallery.gallery_searchResults .gallery-header{padding-top:51px;margin-top:0}.page-gallery.gallery_collection .gallery-content,.page-gallery.gallery_searchResults .gallery-content{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-rows:auto 1fr}.page-gallery.gallery_collection .gallery-content .content-viewStateControl,.page-gallery.gallery_searchResults .gallery-content .content-viewStateControl{-ms-grid-row:2}.page-gallery.gallery_collection .gallery-content .content-viewStateControl .notifications-errorContainer,.page-gallery.gallery_searchResults .gallery-content .content-viewStateControl .notifications-errorContainer{margin-top:185px}.page-gallery.gallery_collection .shrinkAndStay-headerContainer,.page-gallery.gallery_searchResults .shrinkAndStay-headerContainer{height:185px}.page-gallery.gallery_collection.state_offline .content-viewStateControl .notifications-errorContainer,.page-gallery.gallery_searchResults.state_offline .content-viewStateControl .notifications-errorContainer{margin-top:277px}.page-gallery.gallery_collection.state_offline .shrinkAndStay-headerContainer,.page-gallery.gallery_searchResults.state_offline .shrinkAndStay-headerContainer{height:277px}.page-details{overflow-y:auto;position:relative;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr;width:100%;height:100%}.page-details .videoDetails-header{display:-ms-grid;-ms-grid-rows:110px auto 1fr 30px;-ms-grid-columns:40px 380px 25px 1fr 40px;background-color:#303030;color:#ebebeb;margin-bottom:18px;width:calc(((100% - 80px) - ((100% - 80px) mod 160px)) + 80px)}.page-details .videoDetails-header .artworkContainer-artwork{width:380px;height:380px}.page-details .videoDetails-header .artworkContainer-artwork.wide{width:506.66666667px}@media(min-width:839px)and (max-width:921px){.page-details .videoDetails-header .artworkContainer-artwork,.page-details .videoDetails-header .artworkContainer-artwork.wide{width:380px}}.page-details .videoDetails-header .artworkContainer-artworkPlaceholder{width:380px;height:380px}.page-details .videoDetails-header .header-backButton{-ms-grid-row:1;-ms-grid-column:2;-ms-grid-row-align:start;margin-top:50px}.page-details .videoDetails-header .header-artworkContainer{-ms-grid-row:2;-ms-grid-column:2;-ms-grid-row-span:2;display:-ms-grid;-ms-grid-rows:auto;-ms-grid-columns:1fr}.page-details .videoDetails-header .header-artworkContainer .artworkContainer-artwork,.page-details .videoDetails-header .header-artworkContainer .artworkContainer-artworkPlaceholder,.page-details .videoDetails-header .header-artworkContainer .artworkContainer-watchProgress{-ms-grid-row:1;-ms-grid-column:1;position:relative}.page-details .videoDetails-header .header-artworkContainer .artworkContainer-artworkPlaceholder{background-image:url("/Images/GenericIcons/Generic_Video_Medium.png");background-position:center;background-size:auto;background-repeat:no-repeat;background-color:#3a3a3a;-ms-high-contrast-adjust:none}@media(-ms-high-contrast){.page-details .videoDetails-header .header-artworkContainer .artworkContainer-artworkPlaceholder{background-color:Window}}.page-details .videoDetails-header .header-artworkContainer .artworkContainer-watchProgress{margin-bottom:-4px;-ms-grid-row-align:end}.page-details .videoDetails-header .header-artworkContainer .artworkContainer-watchProgress .control-watchProgress .watchProgress-progressBar{background-color:#101010}.page-details .videoDetails-header .header-content{-ms-grid-row:2;-ms-grid-column:4;margin-top:-8px;display:-ms-grid;-ms-grid-rows:auto auto auto 15px auto 5px;-ms-grid-columns:1fr}.page-details .videoDetails-header .header-content .content-title{-ms-grid-row:1}.page-details .videoDetails-header .header-content .content-subtitle{-ms-grid-row:2}.page-details .videoDetails-header .header-content .content-actions{-ms-grid-row:3}.page-details .videoDetails-header .header-content .content-actions .iconButtonHost{margin:15px 25px 0 0}html[dir=rtl] .page-details .videoDetails-header .header-content .content-actions .iconButtonHost{margin:15px 0 0 25px}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command{overflow:visible;min-width:30px;height:30px;padding:0}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-label{display:none}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-commandicon{-ms-grid-column-align:center}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-back{border-color:#ebebeb;background-color:transparent}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-back{border-color:ButtonText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-back{background-color:ButtonFace}}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-back{width:30px;height:30px;font-size:10.75pt;color:#ebebeb}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-back{color:ButtonText}}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-commandimage{line-height:30px}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command .win-back{line-height:27px}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-back{border-color:#ebebeb;background-color:rgba(235,235,235,.2)}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-back{border-color:HighlightText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-back{background-color:Highlight}}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-back{color:#ebebeb}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover .win-back{color:HighlightText}}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-back,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-back{border-color:#ebebeb;background-color:#ebebeb}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-back,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-back{border-color:ButtonFace}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-commandring,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-back,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-back{background-color:ButtonText}}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-back,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-back{color:#222}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-commandimage,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:active .win-back,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:hover:active .win-back{color:ButtonFace}}.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command,.page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:focus{border:0 solid;outline-style:none}.showKeyboardFocus .page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:focus{position:relative}.showKeyboardFocus .page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:focus:after{content:"";position:absolute;width:calc(100% - -8px);height:calc(100% - -8px);top:-4px;left:-4px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command:focus:after{outline-color:-ms-hotlight}}.showKeyboardFocus .page-details .videoDetails-header .header-content .content-actions button.iconButton.win-command::after{width:38px;left:-2px}.page-details .videoDetails-header .header-content .content-secondaryContainer{-ms-grid-row:5;color:#898989}.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details{height:auto;width:100%;display:flex;flex-direction:row;flex-wrap:wrap}.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-separator{display:inline-block;width:5px;height:5px;border-radius:2.5px;margin:8px 6px 0 0;background-color:#898989}html[dir=rtl] .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-separator{margin:8px 0 0 6px}@media(-ms-high-contrast){.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-separator{background-color:Highlight}}html[dir=ltr] .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-metadata,html[dir=ltr] .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles{margin-right:6px}html[dir=rtl] .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-metadata,html[dir=rtl] .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles{margin-left:6px}.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles{padding:0;overflow:visible}.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles,.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles:focus{border:0 solid;outline-style:none}.showKeyboardFocus .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 0%);height:calc(100% - 0%);top:0%;left:0%;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-details .details-subtitles.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-ratings{display:-ms-grid;-ms-grid-columns:auto 1fr;-ms-grid-rows:1fr;margin-top:2px}.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-ratings .ratings-metaCritic{-ms-grid-column:1}.page-details .videoDetails-header .header-content .content-secondaryContainer .secondaryContainer-ratings .ratings-starRating{-ms-grid-column:2}.page-details .videoDetails-header .header-content .content-secondaryContainer .inlineGlyph{line-height:15pt}.page-details .videoDetails-header .header-info{-ms-grid-row:3;-ms-grid-column:4;display:-ms-grid;-ms-grid-rows:1fr 7px auto auto auto;-ms-grid-columns:1fr}.page-details .videoDetails-header .header-info .info-description{-ms-grid-row:1}.page-details .videoDetails-header .header-info .info-description .showMoreLink{padding-left:0;padding-right:0}.page-details .videoDetails-header .header-info .info-actionsContainer{-ms-grid-row:3;display:-ms-flexbox}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions{display:-ms-flexbox}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost{margin:10px 10px 0 0}html[dir=rtl] .page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost{margin:10px 0 0 10px}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command{display:block;min-width:90px;min-height:32px;padding:9px 20px 11px;border:none;color:#ebebeb;background-color:#222}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:focus{border:0 solid;outline-style:none}.showKeyboardFocus .page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:focus{position:relative}.showKeyboardFocus .page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;left:3px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:focus.selected:after{outline-color:HighlightText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command{color:ButtonText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command{background-color:ButtonFace}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover{color:#ebebeb;background-color:#101010}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover{color:HighlightText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover{background-color:Highlight}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover:active{color:#ebebeb;background-color:#101010}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover:active{color:ButtonFace}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover:active{background-color:ButtonText}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover:active{color:#ebebeb;background-color:#107c10}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover:active{color:HighlightText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover:active{background-color:Highlight}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:hover:active{color:#ebebeb;background-color:#646464;opacity:.5}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:hover:active{color:GrayText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled:hover:active{background-color:transparent}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:focus,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:focus,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:hover:active{border:1px solid ButtonText}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command.selected:disabled{opacity:1;border:1px solid GrayText}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-commandicon{display:none}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label{display:inline;margin:0;padding:0;color:#ebebeb;font-size:11pt;font-weight:400;line-height:15pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-one{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:15pt;word-wrap:normal}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-two{overflow:hidden;white-space:normal;max-height:30pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-three{overflow:hidden;white-space:normal;max-height:45pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-four{overflow:hidden;white-space:normal;max-height:60pt}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command .win-label.maxLines-seven{overflow:hidden;white-space:normal;max-height:105pt}@media(-ms-high-contrast)and (-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .iconButtonHost button.iconButton.win-command:hover .win-label{color:HighlightText}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command{padding:9px 20px 11px;border:none;color:#ebebeb;background-color:#107c10}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command{color:ButtonText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command{background-color:ButtonFace}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover{color:#ebebeb;background-color:#299c10}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover{color:HighlightText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover{background-color:Highlight}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover:active{color:#ebebeb;background-color:#5dc21e}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover:active{color:ButtonFace}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover:active{background-color:ButtonText}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover:active{color:#ebebeb;background-color:#107c10}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover:active{color:HighlightText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover:active{background-color:Highlight}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:hover:active{color:#ebebeb;background-color:#646464;opacity:.5}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:hover:active{color:GrayText}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled:hover:active{background-color:transparent}}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:focus,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:focus,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:hover:active,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:hover:active{border:1px solid ButtonText}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command:disabled,.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-actions .win-template:first-of-type .iconButtonHost button.iconButton.win-command.selected:disabled{opacity:1;border:1px solid GrayText}}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-language{padding-top:4px}html[dir=ltr] .page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-language{margin-left:10px}html[dir=rtl] .page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-language{margin-right:10px}.page-details .videoDetails-header .header-info .info-actionsContainer .actionsContainer-language .text-filterTitle{white-space:nowrap}.page-details .videoDetails-header .header-info .info-notifications{-ms-grid-row:4}.page-details .videoDetails-header .header-info .info-notifications .notifications-prepurchase,.page-details .videoDetails-header .header-info .info-notifications .notifications-rentalExpiration,.page-details .videoDetails-header .header-info .info-notifications .notifications-contentNotifications .contentNotificationListItemWrapper{padding-top:20px;margin-bottom:-4px}.page-details .videoDetails-header .header-info .info-notifications .contentNotificationListIcon{margin-bottom:0}.page-details .videoDetails-header .header-info .info-notifications .contentNotificationListIcon,.page-details .videoDetails-header .header-info .info-notifications .contentNotificationListItemDescription{color:#ebebeb}@media(-ms-high-contrast){.page-details .videoDetails-header .header-info .info-notifications .contentNotificationListIcon,.page-details .videoDetails-header .header-info .info-notifications .contentNotificationListItemDescription{color:WindowText}}.page-details .videoDetails-header .header-divider{-ms-grid-row:5;-ms-grid-column:2;-ms-grid-column-span:3;height:15px;border-bottom:1px solid #222}.page-details .videoDetails-header .header-notifications{-ms-grid-row:6;-ms-grid-column:2;-ms-grid-column-span:3;margin-bottom:-15px}@media(max-width:1239px){.page-details .videoDetails-header{-ms-grid-rows:110px auto 1fr 20px;-ms-grid-columns:40px 200px 25px 1fr 40px}.page-details .videoDetails-header .header-artworkContainer{-ms-grid-row-span:1}.page-details .videoDetails-header .header-artworkContainer .artworkContainer-artwork,.page-details .videoDetails-header .header-artworkContainer .artworkContainer-artworkPlaceholder{width:200px;height:200px}.page-details .videoDetails-header .header-info{margin-top:24px;-ms-grid-column:2;-ms-grid-column-span:3}.page-details .videoDetails-header .header-divider{height:5px}}@media(max-width:839px){.page-details .videoDetails-header{-ms-grid-rows:110px auto 1fr 20px;-ms-grid-columns:40px 1fr 40px;height:auto;min-height:250px;max-height:290px}.page-details .videoDetails-header .header-artworkContainer{display:none}.page-details .videoDetails-header .header-content,.page-details .videoDetails-header .header-info,.page-details .videoDetails-header .header-notifications,.page-details .videoDetails-header .header-divider{-ms-grid-column:2;-ms-grid-column-span:1}}@media(max-width:768px){.page-details .videoDetails-header{-ms-grid-columns:30px 1fr 40px;width:100%}}.page-details .videoDetails-footer{display:-ms-grid;-ms-grid-columns:40px 1fr 40px;-ms-grid-rows:40px 1fr 40px;width:calc(((100% - 80px) - ((100% - 80px) mod 160px)) + 80px)}@media(max-width:768px){.page-details .videoDetails-footer{-ms-grid-columns:30px 1fr 47px}}.page-details .videoDetails-footer .footer-title{-ms-grid-row:1;-ms-grid-column:2;margin-top:2px}.page-details .videoDetails-footer .footer-content{-ms-grid-row:2;-ms-grid-column:2;display:flex;flex-flow:row wrap}.page-details .videoDetails-footer .footer-content .content-itemContainer{flex:1 2 290px;display:flex;flex-flow:column wrap}html[dir=ltr] .page-details .videoDetails-footer .footer-content .content-itemContainer{padding-right:20px}html[dir=rtl] .page-details .videoDetails-footer .footer-content .content-itemContainer{padding-left:20px}.page-details .videoDetails-footer .footer-content .content-itemContainer .itemContainer-item .item-metadata{color:#898989}@media(-ms-high-contrast){.page-details .videoDetails-footer .footer-content .content-itemContainer .itemContainer-item .item-metadata{color:WindowText}}@media(-ms-high-contrast){.page-details .videoDetails-footer .footer-content .content-itemContainer .itemContainer-item .item-title{font-weight:700}}.page-details.details_movie .videoDetails-header{-ms-grid-columns:40px 290px 25px 1fr 40px}.page-details.details_movie .videoDetails-header .artworkContainer-artwork{width:290px;height:390px}.page-details.details_movie .videoDetails-header .artworkContainer-artwork.wide{width:386.66666667px}@media(min-width:839px)and (max-width:831px){.page-details.details_movie .videoDetails-header .artworkContainer-artwork,.page-details.details_movie .videoDetails-header .artworkContainer-artwork.wide{width:290px}}.page-details.details_movie .videoDetails-header .artworkContainer-artworkPlaceholder{width:290px;height:390px}@media(max-width:1239px){.page-details.details_movie .videoDetails-header{-ms-grid-columns:40px 150px 25px 1fr 40px}.page-details.details_movie .videoDetails-header .header-artworkContainer .artworkContainer-artwork,.page-details.details_movie .videoDetails-header .header-artworkContainer .artworkContainer-artworkPlaceholder{width:150px;height:200px}}@media(max-width:839px){.page-details.details_movie .videoDetails-header{-ms-grid-columns:40px 1fr 40px}}@media(max-width:768px){.page-details.details_movie .videoDetails-header{-ms-grid-columns:30px 1fr 40px}}.page-details.details_tv .videoDetails-header{width:100%}.page-details.details_tv .videoDetails-header .header-content .content-subtitle{margin-top:3px}.page-details.details_tv .videoDetails-header .header-notifications{margin-top:15px}.page-details.details_tv .module-episodes{display:-ms-grid;-ms-grid-columns:10px 30px 1fr 30px 10px;-ms-grid-rows:auto auto;margin-bottom:25px}.page-details.details_tv .module-episodes .episodes-header{-ms-grid-column:3;margin-bottom:3px;transform:translateX(-4px)}html[dir=rtl] .page-details.details_tv .module-episodes .episodes-header{transform:translateX(4px)}.page-details.details_tv .module-episodes .episodes-list{-ms-grid-column:2;-ms-grid-column-span:3;-ms-grid-row:2;background-image:url("/images/ListStripes/ListStripesDark.png");background-size:100% 100px;background-repeat:repeat;background-clip:content-box}.page-details.details_tv .module-seasons{margin-bottom:25px}.page-details.details_episode .videoDetails-modules{min-height:10px}.page-details.details_movie .videoDetails-header .header-notifications .template-headerNotification:first-of-type,.page-details.details_episode .videoDetails-header .header-notifications .template-headerNotification:first-of-type{border-top:none}.text-link,.app-newvideo .showMoreLink{color:#5dc21e}@media(-ms-high-contrast){.text-link,.app-newvideo .showMoreLink{color:-ms-hotlight}}.text-link:hover,.app-newvideo .showMoreLink:hover{color:#299c10}@media(-ms-high-contrast){.text-link:hover,.app-newvideo .showMoreLink:hover{color:HighlightText}}@media(-ms-high-contrast){.text-link:hover,.app-newvideo .showMoreLink:hover{background-color:Highlight}}.text-link:active,.app-newvideo .showMoreLink:active{color:#107c10}@media(-ms-high-contrast){.text-link:active,.app-newvideo .showMoreLink:active{color:ButtonText}}@media(-ms-high-contrast){.text-link:active,.app-newvideo .showMoreLink:active{background-color:ButtonFace}}.win-listview .win-itembox,.win-itemcontainer .win-itembox{background:none}.win-ui-dark .win-backbutton,.win-ui-dark .win-back{color:#ebebeb;background-color:transparent;border-color:#ebebeb}@media(-ms-high-contrast){.win-ui-dark .win-backbutton,.win-ui-dark .win-back{color:ButtonText}}@media(-ms-high-contrast){.win-ui-dark .win-backbutton,.win-ui-dark .win-back{background-color:ButtonFace}}@media(-ms-high-contrast){.win-ui-dark .win-backbutton,.win-ui-dark .win-back{border-color:ButtonText}}.nowPlayingOverlaysContainer .control-videoTransportControls{-ms-grid-column:1;-ms-grid-row:2;-ms-grid-column-span:4;transition-property:transform;transform:translateY(80px)}.nowPlayingOverlaysContainer .control-videoTransportControls.nowPlayingControlsSlideUp{transform:translateY(0);transition-duration:.25s;transition-timing-function:cubic-bezier(.24,.88,.68,.91)}.nowPlayingOverlaysContainer .control-videoTransportControls.nowPlayingControlsSlideDown{transform:translateY(80px);transition-duration:.2s;transition-timing-function:cubic-bezier(.24,.88,.68,.91)}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay{display:-ms-grid;height:100%;-ms-grid-row:1;-ms-grid-columns:10px 220px 25px 1fr 60px auto;-ms-grid-rows:1fr;direction:ltr;height:80px;background-color:#101010}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay{background-color:Window}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata{-ms-grid-row:1;-ms-grid-column:2;-ms-grid-row-align:center;height:56px;padding:13px 10px 0;outline:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata:focus{border:0 solid;outline-style:none}.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;left:3px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .win-itembox{background-color:#101010}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .win-itembox{background-color:Window}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .win-itembox .win-item{height:100%}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .win-itembox .win-focusedoutline{outline:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .metadata-content{-ms-grid-column:2;-ms-grid-row:1;-ms-grid-row-align:center;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:auto auto}html[dir=rtl] .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .metadata-content{direction:rtl}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .metadata-content .content-title{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-align:start;color:#ebebeb}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .metadata-content .content-title{color:WindowText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .metadata-content .content-subTitle{-ms-grid-column:1;-ms-grid-row:2;-ms-grid-row-align:end;color:#898989}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata .metadata-content .content-subTitle{color:WindowText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-seekbar{-ms-grid-column:4;-ms-grid-row:1;display:-ms-grid;-ms-grid-columns:1fr;-ms-grid-rows:1fr 2px;height:100%;padding:0;margin:0 -30px}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-seekbar .seekbar-content{-ms-grid-column:1;-ms-grid-row:1;-ms-grid-row-align:end}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer{-ms-grid-column:6;-ms-grid-row:1;-ms-grid-column-align:end;height:100%}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls{display:-ms-grid;height:100%;-ms-grid-row:1;-ms-grid-columns:40px 30px 60px (30px 40px)[3] 25px;-ms-grid-rows:1fr;direction:ltr}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer{-ms-grid-row:1;-ms-grid-column-align:center;-ms-grid-row-align:center;outline:none;width:40px;height:40px;font-size:14pt;background-color:#101010}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer{background-color:Window}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:focus,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer:focus{border:0 solid;outline-style:none}.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button.acc-keyboardFocusTarget:focus,.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button.acc-keyboardFocusTarget:focus:after,.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - 6px);height:calc(100% - 6px);top:3px;left:3px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button.acc-keyboardFocusTarget:focus:after,.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}@media(-ms-high-contrast){.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button.acc-keyboardFocusTarget:focus.selected:after,.showKeyboardFocus .nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer.acc-keyboardFocusTarget:focus.selected:after{outline-color:HighlightText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button{color:#ebebeb}@media(-ms-high-contrast:none){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:hover{opacity:.8}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:active,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:hover:active{opacity:.6}}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button{color:WindowText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:hover{color:#ebebeb}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:hover{color:Highlight}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:active{color:#ebebeb}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button:active{color:Highlight}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button[disabled="disabled"],.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button[disabled="disabled"]:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button[disabled="disabled"]:active,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer[disabled="disabled"],.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer[disabled="disabled"]:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer[disabled="disabled"]:active{color:#646464;opacity:1}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button[disabled="disabled"],.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button[disabled="disabled"]:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls>button[disabled="disabled"]:active,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer[disabled="disabled"],.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer[disabled="disabled"]:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer[disabled="disabled"]:active{color:GrayText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-playPauseButton{-ms-grid-column:1}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer{-ms-grid-column:3;display:-ms-grid;-ms-grid-rows:1fr;-ms-grid-columns:1fr 6px 1fr;width:60px}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-align:end;border:none;outline:none;font-size:14pt;padding:0;background-color:#101010;color:#ebebeb}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton{background-color:Window}}@media(-ms-high-contrast:none){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton:hover{opacity:.8}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton:active,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton:hover:active{opacity:.6}}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton{color:WindowText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton:hover{color:#ebebeb}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton:hover{color:Highlight}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton:active{color:#ebebeb}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton:active{color:Highlight}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeText{-ms-grid-row:1;-ms-grid-column:3;-ms-grid-column-align:start;-ms-grid-row-align:center;color:#898989}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeText{color:WindowText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton[disabled="disabled"],.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton[disabled="disabled"]:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton[disabled="disabled"]:active{color:#646464;opacity:1}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton[disabled="disabled"],.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton[disabled="disabled"]:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer .volumeContainer-volumeButton[disabled="disabled"]:active{color:GrayText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton{-ms-grid-column:5}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton.closedCaptionsEnabled,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton.closedCaptionsEnabled:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton.closedCaptionsEnabled:active{color:#299c10}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton.closedCaptionsEnabled,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton.closedCaptionsEnabled:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton.closedCaptionsEnabled:active{color:HighlightText;background-color:Highlight}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton{-ms-grid-column:7}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton.audioTracksDisabled,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton.audioTracksDisabled:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton.audioTracksDisabled:active{color:#646464;opacity:1}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton.audioTracksDisabled,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton.audioTracksDisabled:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton.audioTracksDisabled:active{color:GrayText}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton{-ms-grid-column:9}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton.repeatButtonOn,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton.repeatButtonOn:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton.repeatButtonOn:active{color:#299c10}@media(-ms-high-contrast){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton.repeatButtonOn,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton.repeatButtonOn:hover,.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton.repeatButtonOn:active{color:HighlightText;background-color:Highlight}}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved{-ms-grid-columns:40px 30px 60px (30px 40px)[2] 25px}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved .controls-audioTracksButton{display:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved .controls-repeatButton{-ms-grid-column:7}@media(max-width:1023px){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay{-ms-grid-columns:10px 190px 25px 1fr 50px auto}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls{-ms-grid-columns:40px 10px 60px (10px 40px)[3] 15px}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved{-ms-grid-columns:40px 10px 60px (10px 40px)[2] 15px}}@media(max-width:767px){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls{-ms-grid-columns:(40px 10px)[3] 5px}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-volumeContainer{display:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-closedCaptionButton{-ms-grid-column:3}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-audioTracksButton{display:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls .controls-repeatButton{-ms-grid-column:5}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved{-ms-grid-columns:(40px 10px)[3] 5px}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved .controls-volumeContainer{display:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved .controls-closedCaptionButton{-ms-grid-column:3}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved .controls-audioTracksButton{display:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer .controlsContainer-controls.controls-AudioTracksButtonRemoved .controls-repeatButton{-ms-grid-column:5}}@media(max-width:682px){.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay{-ms-grid-columns:20px 1fr 50px auto}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-metadata{display:none}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-seekbar{-ms-grid-column:2}.nowPlayingOverlaysContainer .control-videoTransportControls .videoTransportControls-overlay .overlay-controlsContainer{-ms-grid-column:4}}.nowPlayingOverlaysContainer .nowPlayingRatingImageContainer{margin-top:63px;margin-left:33px;margin-right:33px;-ms-grid-row-align:start;-ms-grid-column-align:start;-ms-high-contrast-adjust:none;z-index:1}.fullScreenNowPlaying .mainParentGrid{-ms-grid-columns:200px 1fr;-ms-grid-rows:200px 1fr}.fullScreenNowPlaying .mainParentGrid .mainContentGrid{-ms-grid-column-span:2;-ms-grid-row-span:2}.fullScreenNowPlaying .mainParentGrid .mainHeader{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-rows:1fr;-ms-grid-columns:1fr;height:auto}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper{-ms-grid-row:1;width:100%;height:100%;-ms-grid-rows:1fr;-ms-grid-columns:1fr;position:relative}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer{-ms-grid-row:1;-ms-grid-column:1;display:-ms-grid;-ms-grid-rows:40px auto;-ms-grid-columns:50px auto;background-image:linear-gradient(135deg,rgba(0,0,0,.4) 0%,rgba(0,0,0,0) 50%)}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer{background:none}}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark{-ms-grid-row:2;-ms-grid-column:2;width:30px;height:30px;padding:0}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton{min-width:30px;width:30px;height:30px;line-height:27px;padding:0;overflow:visible;font-size:10.75pt;border-color:#ebebeb;background-color:transparent;color:#ebebeb}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton{border-color:ButtonText}}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton{background-color:ButtonFace}}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton{color:ButtonText}}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton,.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:focus{border:0 solid;outline-style:none}.showKeyboardFocus .fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton.acc-keyboardFocusTarget:focus{outline-width:0;outline-color:transparent;position:relative}.showKeyboardFocus .fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton.acc-keyboardFocusTarget:focus:after{content:"";position:absolute;width:calc(100% - -8px);height:calc(100% - -8px);top:-4px;left:-4px;outline:1px solid #ebebeb}@media(-ms-high-contrast){.showKeyboardFocus .fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton.acc-keyboardFocusTarget:focus:after{outline-color:-ms-hotlight}}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton,.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:focus{border-width:2px}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover{opacity:1;border-color:#ebebeb;background-color:rgba(235,235,235,.2);color:#ebebeb}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover{border-color:HighlightText}}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover{background-color:Highlight}}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover{color:HighlightText}}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:active,.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover:active{opacity:1;border-color:#ebebeb;background-color:#ebebeb;color:#222}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:active,.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover:active{border-color:ButtonFace}}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:active,.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover:active{background-color:ButtonText}}@media(-ms-high-contrast){.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:active,.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton:hover:active{color:ButtonFace}}.fullScreenNowPlaying .mainParentGrid .mainHeader .navigationWrapper .navigationContainer .shellBackButtonContainer.win-ui-dark button.win-backbutton.acc-keyboardFocusTarget::after{width:38px;height:38px}.video .volumeRange input[type=range].win-vertical::-ms-fill-lower{background-color:#107c10}@media(-ms-high-contrast){.video .volumeRange input[type=range].win-vertical::-ms-fill-lower{background-color:WindowText}}@media(-ms-high-contrast){.manageFolders .dialogContainer{outline-width:0}}@media(-ms-high-contrast){.showKeyboardFocus .wecDialog .webLinkContainer a:focus:not(:hover){background-color:transparent}}
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Styles/ClosedCaption.css b/packages/microsoft.zunevideo/Styles/ClosedCaption.css
new file mode 100644
index 00000000..0ffbc4bd
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/ClosedCaption.css
@@ -0,0 +1,19 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.cc_layout {
+ height: 100%
+}
+.cc_layout DIV, .cc_layout P {
+ display: inline-block
+}
+.cc_bodyDiv, .cc_textPreview {
+ color: #fff
+}
+.cc_textPreview {
+ background-color: #000
+}
+.cc_region, .cc_regionBody, .cc_bodyDiv {
+ width: 100%;
+ height: 100%;
+ position: relative;
+ display: inline-block
+}
diff --git a/packages/microsoft.zunevideo/Styles/DefaultStyles.css b/packages/microsoft.zunevideo/Styles/DefaultStyles.css
new file mode 100644
index 00000000..e6ab9252
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/DefaultStyles.css
@@ -0,0 +1,28 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+html
+{
+ overflow: hidden;
+ -ms-user-select: none
+}
+html, body
+{
+ height: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ cursor: default;
+ -ms-content-zooming: none;
+ overflow: hidden
+}
+html
+{
+ direction: ltr
+}
+html:lang(ar), html:lang(dv), html:lang(fa), html:lang(he), html:lang(ku-Arab), html:lang(pa-Arab), html:lang(prs), html:lang(ps), html:lang(sd-Arab), html:lang(syr), html:lang(ug), html:lang(ur), html:lang(qps-plocm)
+{
+ direction: rtl
+}
+header, footer, div, span, header, img, button, svg, object
+{
+ z-index: 0
+}
diff --git a/packages/microsoft.zunevideo/Styles/Images.css b/packages/microsoft.zunevideo/Styles/Images.css
new file mode 100644
index 00000000..9a6a826e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/Images.css
@@ -0,0 +1,2 @@
+/*! Copyright (C) Microsoft Corporation. All rights reserved. */
+.streamingStatusIconDark{background-image:url("/images/streaming_dark.png");background-repeat:no-repeat;background-size:20px 20px;width:20px;height:20px;padding-right:5px}.signInRetryRing{background-image:url("/images/notification_retry_ring_dark.png");background-repeat:no-repeat;background-position:top left;width:42px;height:42px}.signInRetrySpinner{background-image:url("/images/notification_retry_spinner_dark.png");background-repeat:no-repeat;background-position:top left;width:42px;height:42px}.externalLinkBackground{background-image:url("/Images/link_asset.png");background-repeat:no-repeat;background-size:19px 19px;background-position:10px center}.refreshButtonImage:hover{background-image:url("/images/refresh_hover.png")}.refreshButtonImage:active{background-image:url("/images/refresh_down.png")}.immersiveTwoColumn .related.relatedArtists .horizontalListItem{background-image:url("/Images/GenericIcons/ico_74x_GenericMusic_Large.png");background-repeat:no-repeat;background-position:center 20%}.nowPlayingBrandingContainer .xboxIcon{background-image:url("/images/NowPlaying/XenonSquare.png")}.nowPlayingBrandingContainer .xboxIconMaskAntialiasing{background-image:url("/images/NowPlaying/XenonMaskAntialiasing.png")}.albumThumbnail .imageOverlay,.artistThumbnail .imageOverlay,.otherVideoThumbnail .imageOverlay,.songThumbnail .imageOverlay,.tvThumbnail .imageOverlay{background-image:url("/images/standard_card_square_art_overlay.png");background-repeat:no-repeat;background-position:top left;background-size:100% 100%}.immersiveViewMorePopOverContentLayout{background-image:url("/images/immersive_details_viewMore_background_gradient.png");background-repeat:repeat-x;background-position:top left;background-size:100% 100%}.video2 .immersiveViewMorePopOverContentLayout{background-image:none}.layout-hub .dashboardGridItemContent .thumbnailButton,.dashboardGridItemContent .thumbnailButton .imageContainer,.dashboardGridTvItemContent .tvSeriesVideoTileButton .imageContainer,.dashboardGridMovieItemContent .movieVideoTileButton .imageContainer,.overview .metaDataContainer>.imageContainer,.popOverContentContainer .leftColumn .imageContainer,.popOver.activity .popoverSlideshow .win-item>.win-template,.searchHCR .imageContainer,.videoFlexHubBigItem .imageContainer,.musicFlexHubBigItem .imageContainer,.related .relatedHeroItem .imageContainer,.homeNowPlayingTilePoster.companion .homeNowPlayingArt,.xboxXenonBackground,.music .horizontalListItem .thumbnailButton,.video2 .template-fullBleedCardThumbnail .imageContainer,.video2 .template-searchHCR .imageContainer,.searchPage .cardThumbnailButton .imageContainer,.flexHubPage .cardThumbnailButton .imageContainer,.recommendationsPage .cardThumbnailButton .imageContainer,.music2 .dashboardMyMusic .cardThumbnailButton .imageContainer,.video .videoTile{background-repeat:no-repeat;background-position-x:center;background-position-y:center}.searchPage .cardThumbnailButton .imageContainer,.flexHubPage .cardThumbnailButton .imageContainer,.recommendationsPage .cardThumbnailButton .imageContainer{background-position-y:calc(29%)}.music .horizontalListItem .thumbnailButton{background-position-y:32%}.xboxXenonBackground{background-size:auto 100%}.movie .overview .metaDataContainer>.imageContainer,.tv .overview .metaDataContainer>.imageContainer,.video1 .dashboardGridItemContent .thumbnailButton .imageContainer,.video2 .dashboardGridItemContent.featuredSetsContent .thumbnailButton .imageContainer,.video2 .dashboardGridItemContent.spotlightContent-item1 .thumbnailButton .imageContainer,.video2 .dashboardGridItemContent.spotlightContent-item2 .thumbnailButton .imageContainer,.video2 .template-fullBleedCardThumbnail .imageContainer,.video1 .layout-hub .dashboardGridItemContent .thumbnailButton,.video1 .movieVideoTile,.video1 .tvSeriesVideoTile,.video1 .personalVideoTileL1Large,.video1 .personalVideoTileL1Small,.searchPage .cardThumbnailButton .imageContainer,.flexHubPage .cardThumbnailButton .imageContainer,.recommendationsPage .cardThumbnailButton .imageContainer{background-image:url("/images/GenericIcons/ico_74x_GenericVideo_Small.png")}.video2 .dashboardGridItemContent .thumbnailButton .imageContainer,.video2 .dashboardGridTvItemContent .tvSeriesVideoTileButton .imageContainer,.video2 .dashboardGridMovieItemContent .movieVideoTileButton .imageContainer,.related.movies .relatedHeroItem .imageContainer,.related.seasons .relatedHeroItem .imageContainer,.video .dashboardGridItemContent.medium .thumbnailButton .imageContainer,.video .popOverContentContainer .leftColumn .imageContainer,.video .searchHCR .imageContainer,.videoFlexHubBigItem .imageContainer,.video2 .template-searchHCR .imageContainer,.video1 .layout-hub .item0.dashboardGridItemContent .thumbnailButton{background-image:url("/images/GenericIcons/ico_74x_GenericVideo_Medium.png")}.video .dashboardGridItemContent.large .thumbnailButton .imageContainer,.video2 .hub_movieHub .dashboardGridItemContent.primaryContent-item0 .thumbnailButton .imageContainer{background-image:url("/images/GenericIcons/ico_74x_GenericVideo_Large.png")}.cloudMatchIcon .overlayContainer.dialogContainerBackground,.cloudMatchOptIn .overlayContainer.dialogContainerBackground,.cloudGrovelInfo .overlayContainer.dialogContainerBackground{background-image:url("/images/CloudDialog/bg-gradient-cloud-dialog.png");background-repeat:repeat-x}.cloudInfoImage{background-image:url("/images/CloudDialog/Cloud_3Screen_Dialog.png");background-repeat:no-repeat;background-position-x:-65px;background-position-y:top;background-size:1075px;overflow:visible;-ms-grid-row:1}.cloudGrovelInfoContentContainer .cloudInfoImage{height:325px}.cloudLegendIcon{background-position-y:bottom;background-repeat:no-repeat}.cloudLegendIcon.streamingOnly{background-image:url("/images/CloudDialog/streaming.png")}.cloudLegendIcon.localAndStreaming{background-image:url("/images/CloudDialog/cloud.png")}.cloudNotification{background-image:url("/images/cloudNotificationHeaderBlue1.png")}.cloudNotification.localContent{background-image:url("/images/cloudNotificationHeaderBlue2.png")}.cloudNotification.partialContent{background-image:url("/images/cloudNotificationHeaderBlue3.png")}.cloudNotification.cloudContent{background-image:url("/images/cloudNotificationHeaderBlue4.png")}.dashboardGridItemContent .adError{background-image:url("/images/x8_300x250_ad_error.png")}.sidebarAd .adError{background-image:url("/images/x8_300x600_ad_error.png")}body:not(.app-newmusic) .bottomAppBarContainer{background-image:url("/images/AppBar_gradient.png")}.nowPlayingPlaylistControl{background-image:url("/images/immersive_details_background_gradient.png")}.music .dashboardMyMusic .artistThumbnail .cardThumbnailButton{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Empty.png");background-position:center;background-repeat:no-repeat;background-size:contain}html[dir=rtl].music .dashboardMyMusic .artistThumbnail .cardThumbnailButton{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_EmptyRTL.png")}.music .dashboardMyMusic .cardThumbnailButton,.music .searchGalleryView .win-item,.searchHubStrip .musicPanel1 .win-item,.searchHubStrip .musicPanel2 .win-item,.searchHubStrip .musicPanel3 .win-item,.searchHubStrip .musicPanel4 .win-item,.searchHubStrip .musicPanel5 .win-item,.searchHubStrip .musicPanel6 .win-item{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Music.png");background-position:center;background-repeat:no-repeat;background-size:contain}html[dir=rtl].music .dashboardMyMusic .cardThumbnailButton,html[dir=rtl].music .searchGalleryView .win-item,html[dir=rtl] .searchHubStrip .musicPanel1 .win-item,html[dir=rtl] .searchHubStrip .musicPanel2 .win-item,html[dir=rtl] .searchHubStrip .musicPanel3 .win-item,html[dir=rtl] .searchHubStrip .musicPanel4 .win-item,html[dir=rtl] .searchHubStrip .musicPanel5 .win-item,html[dir=rtl] .searchHubStrip .musicPanel6 .win-item{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_MusicRTL.png")}.dashboardMyVideo .movieThumbnail .cardThumbnailButton,.marketplaceMoviePage .win-item,.marketplaceVideoSearchPage .win-item .cardThumbnailButton,.searchHubStrip .videosPanel1 .win-item,.searchHubStrip .videosPanel2 .win-item,.flexHubPage .win-item .movieThumbnail .cardThumbnailButton,.recommendationsPage .win-item .movieThumbnail .cardThumbnailButton{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.png");background-position:center;background-repeat:no-repeat;background-size:contain}.collectionVideoGallery .otherVideoThumbnail,.collectionVideoGallery .tvThumbnail{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.png");background-position:center;background-repeat:no-repeat;background-size:contain}.collectionVideoGallery .otherVideoThumbnail.moviePoster,.collectionVideoGallery .movieThumbnail{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_Video.png");background-position:center;background-repeat:no-repeat;background-size:contain}html[dir=rtl] .collectionVideoGallery .otherVideoThumbnail,html[dir=rtl] .collectionVideoGallery .tvThumbnail{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.png");background-position:center;background-repeat:no-repeat;background-size:contain}html[dir=rtl] .collectionVideoGallery .otherVideoThumbnail.moviePoster,html[dir=rtl] .collectionVideoGallery .movieThumbnail{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.png");background-position:center;background-repeat:no-repeat;background-size:contain}.dashboardMyVideo .otherVideoThumbnail .cardThumbnailButton,.dashboardMyVideo .tvThumbnail .cardThumbnailButton,.marketplaceTvPage .win-item,.tvCollectionPanel .collectionVideoGallery .win-item,.searchHubStrip .videosPanel3 .win-item,.searchHubStrip .videosPanel4 .win-item,.flexHubPage .win-item .tvThumbnail .cardThumbnailButton,.recommendationsPage .win-item .tvThumbnail .cardThumbnailButton{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquare.png");background-position:center;background-repeat:no-repeat;background-size:contain}html[dir=rtl] .dashboardMyVideo .otherVideoThumbnail .cardThumbnailButton,html[dir=rtl] .dashboardMyVideo .tvThumbnail .cardThumbnailButton,html[dir=rtl] .marketplaceTvPage .win-item,html[dir=rtl] .tvCollectionPanel .collectionVideoGallery .win-item,html[dir=rtl] .searchHubStrip .videosPanel3 .win-item,html[dir=rtl] .searchHubStrip .videosPanel4 .win-item,html[dir=rtl] .flexHubPage .win-item .tvThumbnail .cardThumbnailButton,html[dir=rtl] .recommendationsPage .win-item .tvThumbnail .cardThumbnailButton{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoSquareRTL.png")}html[dir=rtl] .dashboardMyVideo .movieThumbnail .cardThumbnailButton,html[dir=rtl] .marketplaceMoviePage .win-item,html[dir=rtl] .marketplaceVideoSearchPage .win-item .cardThumbnailButton,html[dir=rtl] .marketplaceGamesSearchPage .win-item .cardThumbnailButton,html[dir=rtl] .searchHubStrip .videosPanel1 .win-item,html[dir=rtl] .searchHubStrip .videosPanel2 .win-item,html[dir=rtl] .flexHubPage .win-item .movieThumbnail .cardThumbnailButton,html[dir=rtl] .recommendationsPage .win-item .movieThumbnail .cardThumbnailButton{background-image:url("/Images/LoadingCardTemplateBg/LoadingCardTemplateBg_VideoRTL.png")}.immersiveDetails-backgroundImage_gradient{background-image:url("/images/immersive_details_background_image_gradient.png")}.details-backgroundImage_gradient{background-image:url("/images/immersive_details_background_image_gradient.png")}.immersiveDetailsScrollContainer{background-image:url("/images/immersive_details_background_gradient.png")}body:not(.app-newmusic) .musicDialog.orange .dialogContainer{background-image:url("/images/musicDialogOrangePattern.png")}body:not(.app-newmusic) .musicDialog.green .dialogContainer{background-image:url("/images/musicDialogGreenPattern.png")}body:not(.app-newmusic) .musicDialog.blue .dialogContainer{background-image:url("/images/musicDialogBluePattern.png")}body:not(.app-newmusic) .musicDialog.pink .dialogContainer{background-image:url("/images/musicDialogPinkPattern.png")}.nowPlayingOverlay{background-image:url("/images/NowPlaying/now_playing_mask.png")}.seekBarThumb{background-image:url("/images/TransportControls/leaf_default.png")}.seekBarThumbEngaged{background-image:url("/images/TransportControls/leaf_touch.png")}.videoAdOverlay{background-image:url("/images/NowPlaying/now_playing_mask.png")}.snappedMusicAppIcon{background-image:url("/images/tiles/XBL_MUSIC_620x300_A.png")}.snappedVideoAppIcon{background-image:url("/images/tiles/XBL_VIDEO_620x300_A.png")}.snappedBackgroundImage{background-image:url("/images/immersive_details_background_gradient.png")}@media(max-height:800px){.cloudInfoImage,.cloudGrovelInfoContentContainer .cloudInfoImage{background-position-x:center;background-position-y:top;background-size:cover;height:260px}}@media(-ms-high-contrast){.albumThumbnail .imageOverlay,.artistThumbnail .imageOverlay,.otherVideoThumbnail .imageOverlay,.songThumbnail .imageOverlay,.tvThumbnail .imageOverlay{display:none}.signInRetryRing{background-image:url("/images/notification_retry_ring_light.png");background-repeat:no-repeat;background-position:top left;background-color:transparent;z-index:1}.signInRetrySpinner{background-image:url("/images/notification_retry_spinner_light.png");background-repeat:no-repeat;background-position:top left;background-color:transparent;z-index:2}}@media(-ms-high-contrast:black-on-white){.signInRetryRing{background-image:url("/images/notification_retry_ring_dark.png");background-repeat:no-repeat;background-position:top left;background-color:transparent;z-index:1}.signInRetrySpinner{background-image:url("/images/notification_retry_spinner_dark.png");background-repeat:no-repeat;background-position:top left;background-color:transparent;z-index:2}}
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/Styles/NowPlaying.css b/packages/microsoft.zunevideo/Styles/NowPlaying.css
new file mode 100644
index 00000000..b0a425ac
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/NowPlaying.css
@@ -0,0 +1,1510 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.nowPlayingContainer
+{
+ width: 100%;
+ height: 100%;
+ z-index: 1;
+ overflow: hidden;
+ -ms-grid-row-span: 2
+}
+.nowPlayingControl
+{
+ width: 100%;
+ height: 100%;
+ overflow: hidden
+}
+.nowPlayingTileBackground
+{
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ transform-origin: 0% 0%;
+ left: 0;
+ top: 0;
+ overflow: hidden
+}
+.nowPlayingOverlay
+{
+ display: -ms-grid;
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 50px 1fr auto auto;
+ background-position: 0 0;
+ background-size: cover
+}
+.musicOverlay .nowPlayingOverlay
+{
+ background-image: none
+}
+.nowPlayingBrandingContainer
+{
+ display: -ms-grid;
+ -ms-grid-columns: 38px auto;
+ -ms-grid-rows: 68px 40px
+}
+@media screen and (min-height: 1200px)
+{
+ .nowPlayingBrandingContainer
+ {
+ -ms-grid-rows: 88px 40px
+ }
+}
+@media screen and (min-height: 1440px)
+{
+ .nowPlayingBrandingContainer
+ {
+ -ms-grid-rows: 147px 40px
+ }
+}
+.nowPlayingBranding
+{
+ display: -ms-grid;
+ -ms-grid-columns: auto 20px auto;
+ -ms-grid-rows: auto;
+ -ms-grid-row: 2;
+ -ms-grid-column: 2;
+ -ms-grid-row-align: start
+}
+.nowPlayingBrandingIcon
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 1;
+ width: 40px;
+ height: 40px;
+ margin-top: 11px;
+ -ms-grid-row-align: start;
+ unicode-bidi: bidi-override
+}
+.nowPlayingBrandingLabel
+{
+ -ms-grid-column: 3;
+ -ms-grid-row: 1;
+ margin-top: -24px
+}
+.xboxBranding
+{
+ display: -ms-grid;
+ margin-left: 20px;
+ margin-top: 20px;
+ -ms-grid-columns: auto 12px auto
+}
+.xboxIconContainer {
+ width: 44px;
+ height: 45px;
+ position: relative;
+ opacity: 0
+}
+.xboxTitleContainer {
+ -ms-grid-column: 3;
+ opacity: 0
+}
+.xboxIconMask {
+ position: absolute;
+ width: 42px;
+ height: 43px;
+ overflow: hidden;
+ border-radius: 50%;
+ left: 1px;
+ top: 1px;
+ z-index: 0
+}
+.xboxIconMaskAntialiasing {
+ position: absolute;
+ z-index: 1;
+ left: 0;
+ top: 0
+}
+.xboxIcon {
+ width: 82px;
+ height: 43px;
+ opacity: 1;
+ z-index: 1;
+ position: absolute;
+ top: 0;
+ left: 0
+}
+.showBranding .xboxIcon {
+ animation-name: xboxIconTransformEnterKeys;
+ animation-duration: 5500ms;
+ animation-timing-function: cubic-bezier(.16,1,.29,.99);
+ animation-fill-mode: both
+}
+@keyframes xboxIconTransformEnterKeys
+{
+ 0%
+ {
+ transform: translateX(0)
+ }
+ 27%
+ {
+ transform: translateX(-35px)
+ }
+ 100%
+ {
+ transform: translateX(-35px)
+ }
+}
+.hideBranding .xboxIcon
+{
+ animation-name: xboxIconTransformExitKeys;
+ animation-duration: 1000ms;
+ animation-timing-function: cubic-bezier(.71,.01,.84,0);
+ animation-fill-mode: both
+}
+@keyframes xboxIconTransformExitKeys
+{
+ 0%
+ {
+ transform: translateX(-35px)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+.showBranding .xboxIconContainer, .showBranding .xboxTitleContainer
+{
+ animation-name: xboxIconContainerEnterKeys,xboxIconOpacityKeys;
+ animation-duration: 5500ms,5500ms;
+ animation-timing-function: cubic-bezier(.21,.84,.49,.95),linear;
+ animation-fill-mode: both
+}
+.showBranding .xboxTitleContainer
+{
+ animation-name: xboxTitleContainerEnterKeys,xboxIconOpacityKeys
+}
+@keyframes xboxIconContainerEnterKeys
+{
+ 0%
+ {
+ transform: translateX(30px)
+ }
+ 27%
+ {
+ transform: translateX(0)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes xboxTitleContainerEnterKeys
+{
+ 0%
+ {
+ transform: translateX(-30px)
+ }
+ 27%
+ {
+ transform: translateX(0)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes xboxIconOpacityKeys
+{
+ 0%
+ {
+ opacity: 0
+ }
+ 14%
+ {
+ opacity: 1
+ }
+ 78%
+ {
+ opacity: 1
+ }
+ 100%
+ {
+ opacity: 1
+ }
+}
+.hideBranding .xboxIconContainer, .hideBranding .xboxTitleContainer
+{
+ animation-name: xboxIconContainerExitKeys,xboxIconOpacityExitKeys;
+ animation-duration: 1000ms,1000ms;
+ animation-timing-function: cubic-bezier(.51,.05,.79,.14),linear;
+ animation-fill-mode: both
+}
+.hideBranding .xboxTitleContainer
+{
+ animation-name: xboxTitleContainerExitKeys,xboxIconOpacityExitKeys;
+ animation-duration: 850ms,850ms
+}
+@keyframes xboxIconContainerExitKeys
+{
+ 0%
+ {
+ transform: translateX(0)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes xboxTitleContainerExitKeys
+{
+ 0%
+ {
+ transform: translateX(0)
+ }
+ 100%
+ {
+ transform: translateX(-30px)
+ }
+}
+@keyframes xboxIconOpacityExitKeys
+{
+ 0%
+ {
+ opacity: 1
+ }
+ 100%
+ {
+ opacity: 0
+ }
+}
+.nowPlayingOverlay .seekBarControl
+{
+ -ms-grid-row: 3
+}
+.musicOverlay .seekBarControl
+{
+ -ms-grid-row: 2;
+ -ms-grid-row-align: end
+}
+.metadataContainer
+{
+ display: -ms-flexbox;
+ -ms-grid-row-align: end
+}
+.opportunityContainer
+{
+ display: -ms-grid;
+ bottom: 0
+}
+.opportunityContentContainer
+{
+ display: -ms-grid;
+ -ms-grid-column: 2;
+ -ms-grid-row: 2;
+ -ms-grid-row-align: center
+}
+.opportunityIconButton
+{
+ -ms-grid-column: 2
+}
+.opportunityIconButton .iconButton .win-command, .music2 .opportunityIconButton button.iconButton.win-command
+{
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 1fr;
+ width: inherit;
+ height: inherit;
+ overflow: visible
+}
+.opportunityIconButton .iconButton .win-commandimage
+{
+ width: inherit;
+ height: inherit
+}
+.opportunityTitle
+{
+ -ms-grid-column: 2;
+ -ms-grid-row-align: start;
+ -ms-grid-column-align: start
+}
+.opportunitySubTitle
+{
+ -ms-grid-column: 2;
+ -ms-grid-row-align: start;
+ -ms-grid-column-align: start;
+ min-height: 60px;
+ max-height: 4.09em
+}
+.dashboardHost .opportunityContainer
+{
+ -ms-grid-columns: 29px 1fr 29px;
+ -ms-grid-rows: 50px 1fr 50px
+}
+.dashboardHost .opportunityContentContainer
+{
+ -ms-grid-rows: 140px auto auto
+}
+.dashboardHost .opportunityIconButton
+{
+ -ms-grid-row: 1;
+ width: 140px;
+ height: 140px
+}
+.dashboardHost .opportunityIconButton.icon-play
+{
+ -ms-transform: translate(-54px)
+}
+.dashboardHost .opportunityIconButton.icon-smartDJ
+{
+ -ms-transform: translate(-25px)
+}
+.dashboardHost .opportunityIconButton.icon-playlist
+{
+ -ms-transform: translate(-31px)
+}
+.dashboardHost .opportunityIconButton button .win-commandring, .dashboardHost .opportunityIconButton button:hover .win-commandring, .dashboardHost .opportunityIconButton button:active .win-commandring, .dashboardHost .opportunityIconButton button:disabled.win-command .win-commandring, .dashboardHost .opportunityIconButton button:disabled.win-command:active .win-commandring
+{
+ width: 140px;
+ height: 140px;
+ border: 0
+}
+.dashboardHost .opportunityIconButton .iconButton .win-commandimage
+{
+ width: inherit;
+ height: inherit
+}
+.dashboardHost .opportunityTitle
+{
+ -ms-grid-row: 2;
+ margin-left: -4px;
+ margin-right: -4px;
+ max-height: 230px;
+ max-width: 635px
+}
+.dashboardHost .opportunitySubTitle
+{
+ -ms-grid-row: 3
+}
+@media screen and (max-height: 800px)
+{
+ .dashboardHost .opportunityContainer
+ {
+ -ms-grid-rows: 0 1fr 30px
+ }
+ .dashboardHost .opportunityTitle
+ {
+ max-height: 155px;
+ margin-top: -20px
+ }
+}
+.immersiveNowPlayingColumn
+{
+ width: 440px
+}
+.immersiveNowPlayingColumn .immersiveFrame
+{
+ -ms-grid-rows: auto 1fr 15px;
+ box-shadow: 1px 1px 4px rgba(0,0,0,.2)
+}
+.snapped .immersivePlaylist .headingRow, .immersiveNowPlayingColumn .immersiveFrame>.headingRow
+{
+ margin-bottom: 0
+}
+.immersiveNowPlayingColumn .headingRow, .snapped .immersivePlaylist .headingRow
+{
+ -ms-grid-column: 1;
+ -ms-grid-column-span: 3;
+ border: none
+}
+.immersiveNowPlayingColumn .headingRow
+{
+ width: calc(100% - 75px)
+}
+.snapped .immersivePlaylist .headingRow
+{
+ padding: 0 50px;
+ width: calc(100% - 100px)
+}
+html[dir=ltr] .immersiveNowPlayingColumn .headingRow
+{
+ padding-left: 50px;
+ padding-right: 25px
+}
+html[dir=rtl] .immersiveNowPlayingColumn .headingRow
+{
+ padding-right: 50px;
+ padding-left: 25px
+}
+.immersiveNowPlayingColumn .nowPlayingPlaylistGalleryHeader
+{
+ -ms-grid-columns: 50px 0 1fr 25px
+}
+.snapped .immersivePlaylist .nowPlayingPlaylistGalleryHeader
+{
+ -ms-grid-columns: 50px 0 1fr 50px
+}
+.immersiveNowPlayingColumn .nowPlayingPlaylistGalleryHeader .nowPlayingPlaylistTitle, .snapped .immersivePlaylist .nowPlayingPlaylistGalleryHeader .nowPlayingPlaylistTitle
+{
+ padding: 0
+}
+.immersiveNowPlayingColumn .nowPlayingPlaylistGalleryHeader .smartDJIcon, .snapped .immersivePlaylist .nowPlayingPlaylistGalleryHeader .smartDJIcon
+{
+ display: none
+}
+html[dir=ltr] .immersiveNowPlayingColumn .nowPlayingPlaylistGalleryView.verticalListGutter, html[dir=rtl] .immersiveNowPlayingColumn .nowPlayingPlaylistGalleryView.verticalListGutter, .nowPlayingPlaylistGalleryView.verticalListHost .win-vertical .win-item>div
+{
+ margin: 0
+}
+.immersiveNowPlayingColumn .verticalListHost.verticalListGutter .win-vertical .win-surface
+{
+ width: 100%
+}
+.nowPlayingPlaylistGalleryView.verticalListHost .win-vertical .win-container
+{
+ max-width: 100%;
+ margin: 0;
+ padding: 0
+}
+.nowPlayingPlaylistGalleryView.verticalListHost .verticalListCellMain
+{
+ display: -ms-grid;
+ -ms-grid-columns: 50px 1fr auto 0 0 50px
+}
+.nowPlayingPlaylistGalleryView.verticalListHost .verticalListStatusIcon.iconButton
+{
+ padding: 7px 0
+}
+.nowPlayingPlaylistGalleryView.verticalListHost .win-selectioncheckmark
+{
+ padding-left: 22px;
+ padding-right: 22px
+}
+.nowPlayingPlaylistGalleryView.verticalListHost .inPlaceDetailsItemActions
+{
+ margin-top: 0;
+ -ms-grid-column: 3
+}
+.immersiveDetails .opportunityContainer
+{
+ -ms-grid-columns: 60px 1fr 60px;
+ -ms-grid-rows: 1fr
+}
+.snapped .opportunityContainer, .immersiveDetails .opportunityContainer
+{
+ bottom: 320px;
+ height: 300px
+}
+@media screen and (min-height: 1080px)
+{
+ .snapped .opportunityContainer, .immersiveDetails .opportunityContainer
+ {
+ bottom: 400px;
+ height: 500px
+ }
+}
+.snapped .opportunityContentContainer, .immersiveDetails .opportunityContentContainer
+{
+ -ms-grid-rows: auto auto 40px;
+ -ms-grid-row: 1
+}
+.immersiveDetails .opportunityTitle
+{
+ -ms-grid-row: 1
+}
+.immersiveDetails .opportunitySubTitle
+{
+ -ms-grid-row: 2;
+ margin-left: -4px;
+ margin-right: -4px;
+ max-height: 152px;
+ margin-bottom: 10px
+}
+@media screen and (min-height: 1080px)
+{
+ .immersiveDetails .opportunitySubTitle
+ {
+ max-height: 305px
+ }
+}
+.immersiveDetails .opportunityIconButton
+{
+ -ms-grid-row: 3;
+ width: 40px;
+ height: 40px
+}
+.immersiveDetails .opportunityIconButton .iconButton .win-commandicon.win-commandring
+{
+ width: 40px;
+ height: 40px
+}
+.snapped .opportunityContainer
+{
+ -ms-grid-columns: 30px 1fr 30px;
+ -ms-grid-rows: 1fr;
+ height: 400px
+}
+.snapped .opportunityTitle
+{
+ -ms-grid-row: 1;
+ max-width: 260px
+}
+.snapped .opportunitySubTitle
+{
+ -ms-grid-row: 2;
+ max-height: 213px;
+ margin-left: -4px;
+ margin-right: -4px;
+ max-width: 260px;
+ line-height: normal
+}
+.snapped .opportunityIconButton
+{
+ -ms-grid-row: 3;
+ width: 40px;
+ height: 40px;
+ margin-top: 10px
+}
+.snapped .opportunityIconButton button.win-command.iconButton, .snapped .opportunityIconButton button.win-command.iconButton .win-commandring
+{
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 1fr;
+ width: 40px;
+ height: 40px;
+ margin: 0
+}
+.immersiveDetails .opportunityIconButton .iconButton .win-command
+{
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 1fr;
+ width: 100%;
+ height: 100%;
+ overflow: visible
+}
+.nowPlayingTransportControls
+{
+ width: 100%;
+ height: auto;
+ top: 30%;
+ margin-left: auto;
+ margin-right: auto;
+ padding-top: 10px;
+ padding-bottom: 30px
+}
+.musicOverlay .nowPlayingTransportControls
+{
+ padding-bottom: 10px
+}
+.nowPlayingLargeArtColorOverlay {
+ height: 100%;
+ width: 100%;
+ opacity: .5;
+ position: absolute
+}
+.nowPlayingLargeArtBlackOverlay
+{
+ height: 100%;
+ width: 100%;
+ opacity: .6;
+ position: absolute
+}
+.nowPlayingLargeArtTransitionOverlay
+{
+ height: 100%;
+ width: 100%;
+ opacity: 1;
+ position: absolute;
+ top: 0;
+ left: 0;
+ transition-property: opacity;
+ transition-duration: 4s
+}
+.nowPlayingBackdrop
+{
+ transition-property: opacity;
+ transition-duration: 4s
+}
+.nowPlayingPlaylistGrid
+{
+ display: -ms-grid;
+ -ms-grid-columns: 120px 595px 1fr;
+ -ms-grid-rows: 1fr;
+ width: 100vw;
+ height: 100vh
+}
+.snapped .nowPlayingPlaylistGrid
+{
+ display: -ms-grid;
+ -ms-grid-columns: 0 1fr 0;
+ -ms-grid-rows: 1fr;
+ width: 100vw;
+ height: 100vh
+}
+.nowPlayingPlaylistControl
+{
+ -ms-grid-column: 2;
+ -ms-grid-row: 1;
+ width: 595px;
+ margin-left: 10%;
+ margin-right: 10%
+}
+.snapped .nowPlayingPlaylistControl
+{
+ margin-left: 0;
+ margin-right: 0
+}
+@media screen and (min-height: 1080px)
+{
+ .nowPlayingPlaylistControl
+ {
+ margin-left: 20%;
+ margin-right: 20%
+ }
+}
+@media screen and (min-height: 1440px)
+{
+ .nowPlayingPlaylistControl
+ {
+ margin-left: 25%;
+ margin-right: 25%
+ }
+}
+.opacity0
+{
+ opacity: 0
+}
+.opacity10
+{
+ opacity: .1
+}
+.hideNowPlayingButton
+{
+ margin-bottom: 44px;
+ margin-left: 55px;
+ margin-right: 55px
+}
+@media screen and (min-height: 1080px)
+{
+ .hideNowPlayingButton
+ {
+ margin-bottom: 50px
+ }
+}
+.app-newmusic .hideNowPlayingButton {
+ display: none
+}
+.hideNowPlayingButton button.win-command
+{
+ width: 50px;
+ height: 50px;
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 1fr
+}
+.hideNowPlayingButton button.win-command .win-commandicon
+{
+ -ms-grid-row: 1;
+ -ms-grid-column-align: center;
+ -ms-grid-row-align: center
+}
+.hideNowPlayingButton button.win-command .win-commandicon, .hideNowPlayingButton button.win-command .win-commandimage
+{
+ width: 40px;
+ height: 40px
+}
+.hideNowPlayingButton button.win-command .win-label
+{
+ display: none
+}
+.nowPlayingMetadata
+{
+ display: block;
+ margin-bottom: 56px
+}
+@media screen and (min-height: 1080px)
+{
+ .nowPlayingMetadata
+ {
+ margin-bottom: 63px
+ }
+}
+.immersiveDetailsContainer .homeNowPlayingPlayButton, .homeHubNowPlayingTile .nowPlayingPlaylistGrid
+{
+ display: none
+}
+.homeNowPlayingPlayButton button.iconButton.win-command, .homeNowPlayingErrorButton button.iconButton.win-command
+{
+ width: 40px;
+ height: 50px
+}
+.homeNowPlayingPlayButton .iconButton .win-commandicon.win-commandring, .homeNowPlayingErrorButton .iconButton .win-commandicon.win-commandring, .homeNowPlayingPlayButton .iconButton .win-commandicon.win-commandimage, .homeNowPlayingErrorButton .iconButton .win-commandicon.win-commandimage
+{
+ width: 40px;
+ height: 40px
+}
+.musicVisualizationContainer, .musicVisualization, .nowPlayingOverlaysContainer
+{
+ height: 100%
+}
+.video .nowPlayingOverlaysContainer
+{
+ height: 100vh
+}
+.nowPlayingBackground
+{
+ z-index: 0
+}
+.musicVisualizationContainer
+{
+ z-index: 1
+}
+.nowPlayingOverlaysContainer
+{
+ z-index: 3
+}
+.musicVisualization
+{
+ position: relative;
+ overflow: hidden;
+ width: 100%
+}
+.nowPlayingMetadataContainer
+{
+ width: 100%;
+ height: 100%;
+ display: -ms-grid;
+ -ms-grid-columns: 60px 1fr 60px;
+ -ms-grid-rows: auto auto 60px 30px
+}
+.engage .metadataContainer
+{
+ display: none
+}
+.musicOverlay .nowPlayingMetadataMainTitle, .musicOverlay .nowPlayingMetadataSubTitle, .musicOverlay .nowPlayingMetadataTime
+{
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden
+}
+.engage .homeNowPlayingPlayButton
+{
+ display: none
+}
+.nowPlayingMetadataMainTitle, .nowPlayingMetadataSubTitle, .nowPlayingMetadataTime, .nowPlayingMetadataShowPlaylistButton
+{
+ -ms-grid-column: 2;
+ margin: 0
+}
+.nowPlayingMetadataMainTitle
+{
+ -ms-grid-row: 1
+}
+.snapped .nowPlayingMetadataMainTitle
+{
+ text-overflow: ellipsis;
+ overflow: hidden
+}
+.nowPlayingMetadataSubTitle
+{
+ -ms-grid-row: 2;
+ margin-top: 2px
+}
+.snapped .nowPlayingMetadataSubTitle
+{
+ text-overflow: ellipsis;
+ overflow: hidden;
+ padding-bottom: 8px
+}
+.nowPlayingMetadataTime
+{
+ -ms-grid-row: 3;
+ direction: ltr
+}
+html[dir=rtl] .nowPlayingMetadataTime
+{
+ -ms-grid-column-align: start
+}
+.nowPlayingMetadataShowPlaylistButton
+{
+ display: none;
+ -ms-grid-row: 3;
+ -ms-grid-column-align: start;
+ margin-top: 30px;
+ margin-bottom: -10px;
+ margin-left: 0;
+ margin-right: 0;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ border: none
+}
+.snapped .nowPlayingMetadataShowPlaylistButton
+{
+ margin-top: -10px;
+ -ms-grid-row: 4
+}
+.nowPlayingMetadataArt
+{
+ border-width: 2px;
+ border-style: solid;
+ width: 194px;
+ height: 194px
+}
+.nowPlayingPlaylistGallery
+{
+ height: 100%;
+ width: 100%;
+ display: -ms-grid;
+ -ms-grid-columns: 1fr 108px;
+ -ms-grid-rows: auto 30px 1fr 20px
+}
+.immersivePlaylist .nowPlayingPlaylistGallery
+{
+ -ms-grid-rows: 0 20px 1fr 20px
+}
+.snapped .immersivePlaylist .nowPlayingPlaylistGallery
+{
+ -ms-grid-columns: 1fr 75px;
+ -ms-grid-rows: auto 30px 1fr 20px
+}
+.nowPlayingPlaylistGalleryHeader
+{
+ height: 40px;
+ display: -ms-grid;
+ -ms-grid-column: 1;
+ -ms-grid-row: 1;
+ -ms-grid-column-span: 2;
+ -ms-grid-columns: auto 0 1fr 50px;
+ padding: 0
+}
+.nowPlayingPlaylistNameContainer
+{
+ height: 40px;
+ width: 100%;
+ display: -ms-grid;
+ -ms-grid-columns: 1fr auto 15px auto 50px;
+ margin-top: 68px
+}
+.nowPlayingPlaylistNameContainer .nowPlayingPlaylistTitle
+{
+ margin-top: 5px
+}
+.nowPlayingPlaylistGalleryHeader .listDivider
+{
+ margin-top: 11px;
+ margin-bottom: 24px
+}
+.nowPlayingPlaylistGallerySnapped
+{
+ width: 100%;
+ height: 100%
+}
+.nowPlayingPlaylistCloseButton
+{
+ position: relative;
+ margin-bottom: 10px
+}
+.nowPlayingPlaylistGalleryViewSnapped
+{
+ height: 100%;
+ width: 100%;
+ margin: 0
+}
+.nowPlayingPlaylistGalleryViewSnappedFlipView
+{
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: 0
+}
+.nowPlayingPlaylistGalleryView .win-item, .nowPlayingPlaylistGalleryViewSnapped .win-item
+{
+ margin: 0;
+ height: 70px;
+ width: 100%;
+ border-width: 0
+}
+.nowPlayingPlaylistGalleryViewSnapped .win-item
+{
+ height: 80px
+}
+.nowPlayingPlaylistGalleryViewSnapped .nowPlayingPlaylistEntrySubTitle1
+{
+ transform: translateY(-9px)
+}
+.nowPlayingPlaylistGalleryView .win-listview-browse, .nowPlayingPlaylistGalleryViewSnapped .win-listview-browse
+{
+ height: 100%;
+ width: 100%
+}
+.playlistItemTemplate
+{
+ margin: 0;
+ height: 100%;
+ width: 100%
+}
+.playlistItemTemplate .icon.inlineGlyph
+{
+ margin-top: 16px
+}
+.playlistItemTemplate .mediaStatusIconContainer
+{
+ margin-left: 5px
+}
+html[dir=rtl] .playlistItemTemplate .mediaStatusIconContainer
+{
+ margin-left: 0;
+ margin-right: 5px
+}
+.playlistItemTemplateSnappedFlipView
+{
+ text-align: center;
+ height: 145px;
+ width: 320px
+}
+.nowPlayingPlaylistEntryMetadata
+{
+ padding: 10px 0 10px 0;
+ margin: 0 48px 0 0;
+ border-width: 0;
+ border-style: solid
+}
+.snapped .nowPlayingPlaylistEntryMetadata
+{
+ margin: 0 30px 0 0
+}
+.snappedPlaylist .nowPlayingPlaylistEntryMetadata
+{
+ border-style: none
+}
+html[dir=rtl] .nowPlayingPlaylistEntryMetadata
+{
+ margin: 0 0 0 48px
+}
+html[dir=rtl] .snapped .nowPlayingPlaylistEntryMetadata
+{
+ margin: 0 0 0 30px
+}
+.nowPlayingPlaylistEntryMainTitle, .nowPlayingPlaylistEntrySubTitle1
+{
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden
+}
+.nowPlayingPlaylistGalleryViewSnapped .nowPlayingPlaylistEntryMetadata
+{
+ margin-right: 0
+}
+html[dir=rtl] .nowPlayingPlaylistGalleryViewSnapped .nowPlayingPlaylistEntryMetadata
+{
+ margin-right: 0;
+ margin-left: 20px
+}
+.nowPlayingPlaylistEntryDuration
+{
+ padding: 3px 0 0 0;
+ direction: ltr
+}
+.nowPlayingPlaylistEntryArt
+{
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ overflow: hidden
+}
+.homeHubNowPlayingTile
+{
+ position: relative;
+ top: 4px;
+ width: 145px;
+ height: 215px
+}
+html[dir=ltr].music1 .homeHubNowPlayingTile, html[dir=ltr].video .homeHubNowPlayingTile
+{
+ left: 0;
+ margin-right: 5px
+}
+html[dir=rtl].music1 .homeHubNowPlayingTile, html[dir=rtl].video .homeHubNowPlayingTile
+{
+ right: 0;
+ margin-left: 5px
+}
+.homeNowPlayingTile
+{
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0
+}
+.homeNowPlayingTilePoster
+{
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ display: -ms-grid;
+ -ms-grid-columns: 10px 1fr 10px;
+ -ms-grid-rows: 10px 120px 5px 2px 4px 16px
+}
+.companionHomeNowPlayingTileContainer
+{
+ width: 100%;
+ height: 100%
+}
+.homeNowPlayingTilePoster.companion
+{
+ -ms-grid-columns: 15px 1fr 15px;
+ -ms-grid-rows: 15px 1fr 15px
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible
+{
+ -ms-grid-columns: 30px 1fr 30px;
+ -ms-grid-rows: 20px 1fr 20px
+}
+.homeNowPlayingTilePoster.companion.fullBleedTileVisible
+{
+ display: none
+}
+.homeNowPlayingTilePoster.companion .nowPlayingTileBackground
+{
+ -ms-grid-column: 1;
+ -ms-grid-column-span: 3;
+ -ms-grid-row: 1;
+ -ms-grid-row-span: 6
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible .nowPlayingTileBackground
+{
+ -ms-grid-row-span: 3
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible .nowPlayingTileBackground:after
+{
+ content: "";
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0
+}
+.homeNowPlayingTilePoster .homeNowPlayingArtAndTextContainer
+{
+ display: -ms-grid;
+ -ms-grid-columns: auto 1fr;
+ -ms-grid-rows: auto 5px 1fr
+}
+.games .homeNowPlayingTilePoster .homeNowPlayingArtAndTextContainer img, .video .homeNowPlayingTilePoster .homeNowPlayingArtAndTextContainer img
+{
+ height: 110px
+}
+.video .homeNowPlayingTilePoster .homeNowPlayingArtAndTextContainer img.tvThumbnailVisible
+{
+ height: 90px
+}
+.homeNowPlayingTilePoster.companion .homeNowPlayingArtAndTextContainer
+{
+ -ms-grid-column: 2;
+ -ms-grid-row: 2;
+ -ms-grid-rows: 1fr
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingArtAndTextContainer
+{
+ -ms-grid-column: 2;
+ -ms-grid-row: 2;
+ position: absolute;
+ bottom: 21px
+}
+.homeNowPlayingArt
+{
+ width: 145px;
+ overflow: hidden;
+ text-align: center
+}
+.video .homeNowPlayingTilePoster .homeNowPlayingArt.artCollapsed
+{
+ display: none
+}
+.homeNowPlayingTilePoster .homeNowPlayingArt
+{
+ height: 100%;
+ text-align: left;
+ margin-right: 10px
+}
+html[dir=rtl] .homeNowPlayingTilePoster .homeNowPlayingArt
+{
+ margin-right: 0;
+ margin-left: 10px
+}
+.homeNowPlayingTilePoster.companion .homeNowPlayingArt
+{
+ width: auto;
+ min-width: 197px;
+ height: auto;
+ text-align: left;
+ margin-right: 15px;
+ overflow: hidden
+}
+html[dir=rtl] .homeNowPlayingTilePoster.companion .homeNowPlayingArt
+{
+ margin-right: 0;
+ margin-left: 15px
+}
+.homeNowPlayingTilePoster.companion .homeNowPlayingArt img
+{
+ height: 305px
+}
+.homeNowPlayingArt .artThumbnailContainer
+{
+ width: auto;
+ height: 100%
+}
+.video .homeNowPlayingArt .artThumbnailContainer
+{
+ max-width: 200px
+}
+body:not(.companion) .homeNowPlayingMetadata
+{
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 20px;
+ padding-left: 15px;
+ padding-right: 15px
+}
+.homeNowPlayingMetadataTextContainer
+{
+ display: -ms-grid;
+ -ms-grid-rows: auto 1fr auto;
+ -ms-grid-columns: 1fr
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingMetadataTextContainer
+{
+ width: 541px;
+ -ms-grid-rows: auto auto auto
+}
+.homeNowPlayingTilePoster .homeNowPlayingMetadataTitle.label
+{
+ margin-top: 2px;
+ white-space: normal;
+ max-height: 60px
+}
+.homeNowPlayingTilePoster.companion .homeNowPlayingMetadataTitle.label
+{
+ margin-top: 16px;
+ max-height: 110px
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingMetadataTitle.label
+{
+ margin-top: 4px;
+ max-height: 74px;
+ overflow: hidden
+}
+.homeNowPlayingTilePoster .homeNowPlayingMetadataSubTitle
+{
+ margin-top: 2px;
+ white-space: normal;
+ max-height: 35px
+}
+.homeNowPlayingTilePoster.companion .homeNowPlayingMetadataSubTitle
+{
+ margin-top: 13px;
+ max-width: 80%;
+ max-height: 34px
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingMetadataSubTitle
+{
+ margin-top: 3px
+}
+.homeNowPlayingTilePoster.companion.musicVisualizationVisible .homeNowPlayingMetadataArtist
+{
+ margin-top: 2px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ max-height: 51px;
+ max-width: 410px
+}
+.homeNowPlayingTilePoster.companion .homeNowPlayingMetadataGenre
+{
+ margin-top: 7px;
+ max-height: 80px
+}
+.blackAlphaGradient
+{
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ background-image: linear-gradient(180deg,rgba(0,0,0,0) 35%,rgba(0,0,0,1) 96%)
+}
+.homeNowPlayingTilePoster .seasonEpisodeNumber
+{
+ margin-top: 2px;
+ margin-bottom: 4px
+}
+.homeNowPlayingTilePoster .homeNowPlayingMetadataTimeContainer
+{
+ display: -ms-grid;
+ direction: ltr;
+ -ms-grid-columns: 100%;
+ max-width: 200px
+}
+.companionFullBleedNowPlayingTile .homeNowPlayingTimeAndProgressContainer, .homeNowPlayingTilePoster.companion .homeNowPlayingTimeAndProgressContainer
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 1;
+ -ms-grid-row-align: end;
+ display: -ms-grid;
+ -ms-grid-columns: 1fr 30px;
+ -ms-grid-rows: auto auto
+}
+.homeNowPlayingTilePoster.companion .homeNowPlayingTimeAndProgressContainer
+{
+ position: relative;
+ -ms-grid-column: 1;
+ -ms-grid-column-span: 3;
+ -ms-grid-row: 2;
+ -ms-grid-row-span: 2
+}
+.companionFullBleedNowPlayingTile .homeNowPlayingMetadataClockAndDuration, .homeNowPlayingTilePoster.companion .homeNowPlayingMetadataClockAndDuration
+{
+ -ms-grid-column-align: end;
+ max-width: 120px;
+ margin-bottom: 21px
+}
+.homeNowPlayingTilePoster .homeNowPlayingMetadataClock
+{
+ -ms-grid-column-align: start
+}
+.homeNowPlayingTilePoster .homeNowPlayingMetadataDuration
+{
+ -ms-grid-column-align: end
+}
+.companionFullBleedNowPlayingTile .bottomProgress, .homeNowPlayingTilePoster .bottomProgress
+{
+ position: relative;
+ width: 100%;
+ max-width: 200px;
+ height: 2px;
+ bottom: 0;
+ left: 0;
+ border: none
+}
+.companionFullBleedNowPlayingTile .bottomProgress, .homeNowPlayingTilePoster.companion .bottomProgress
+{
+ -ms-grid-column-span: 2;
+ -ms-grid-row: 2;
+ height: 5px;
+ max-width: none
+}
+.companionFullBleedNowPlayingTile
+{
+ display: none
+}
+.companionFullBleedNowPlayingTile.fullBleedTileVisible
+{
+ display: -ms-grid;
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 1fr;
+ width: 100%;
+ height: 100%
+}
+.companionFullBleedNowPlayingTile .contentContainer
+{
+ width: 100%;
+ height: 100%;
+ display: -ms-grid;
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 1fr auto
+}
+.companionFullBleedNowPlayingTile img, .companionFullBleedNowPlayingTile .imageOverlay, .companionFullBleedNowPlayingTile .tiledBackground
+{
+ -ms-grid-row-span: 2
+}
+.companionFullBleedNowPlayingTile .imageOverlay, .companionFullBleedNowPlayingTile .tiledBackground
+{
+ width: 100%;
+ height: 100%
+}
+.companionFullBleedNowPlayingTile .tiledBackground
+{
+ background-size: auto 100%;
+ background-position: center center;
+ background-repeat: repeat-x
+}
+.companionFullBleedNowPlayingTile .textContainer
+{
+ -ms-grid-row-align: end;
+ display: -ms-grid;
+ -ms-grid-columns: 30px 1fr 30px;
+ -ms-grid-rows: auto auto 25px
+}
+.companionFullBleedNowPlayingTile .textContainer .primaryText, .companionFullBleedNowPlayingTile .textContainer .secondaryText
+{
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis
+}
+.companionFullBleedNowPlayingTile .textContainer .secondaryText
+{
+ margin-top: 2px;
+ max-width: 410px
+}
+.xboxXenonBackground
+{
+ display: none
+}
+.xboxXenonBackground.xboxXenonBackgroundVisible
+{
+ position: absolute;
+ width: 100%;
+ height: 505px;
+ display: -ms-grid;
+ -ms-grid-columns: 30px 1fr 30px;
+ -ms-grid-rows: 1fr 30px
+}
+@media screen and (min-height: 1080px)
+{
+ .xboxXenonBackground.xboxXenonBackgroundVisible
+ {
+ height: 675px
+ }
+}
+.xboxXenonBackground .textContainer
+{
+ -ms-grid-row-align: end
+}
+.xboxXenonBackground .textContainer .secondaryText
+{
+ margin-top: 2px
+}
+.homeHubNowPlayingLarge
+{
+ position: relative;
+ left: 0;
+ width: 235px;
+ height: 505px
+}
+@media screen and (min-height: 1080px)
+{
+ .homeHubNowPlayingLarge
+ {
+ height: 675px
+ }
+}
+body:not(.companion) .homeHubNowPlayingLarge
+{
+ margin-top: 11px
+}
+.homeNowPlayingTile.large
+{
+ display: -ms-grid;
+ -ms-grid-columns: 20px 195px 20px;
+ -ms-grid-rows: 15px auto 15px 1fr 20px
+}
+.homeNowPlayingTile.large .nowPlayingTileBackground, .homeNowPlayingTile.large .homeNowPlayingMetadata, .homeNowPlayingTile.large .homeNowPlayingMetadataClock, .homeNowPlayingTile.large .nowPlayingOverlay
+{
+ position: relative
+}
+.homeNowPlayingTile.large .homeNowPlayingMetadataClock, .homeNowPlayingTile.large .homeNowPlayingPlayButton, .homeNowPlayingTile.large .homeNowPlayingErrorButton
+{
+ margin-left: 10px;
+ margin-right: 10px
+}
+.homeNowPlayingTile.large .homeNowPlayingArtLarge, .homeNowPlayingTile.large .homeNowPlayingTile .nowPlayingTileBackground
+{
+ width: 195px
+}
+.homeNowPlayingArtLarge
+{
+ height: calc(100% - 8px);
+ overflow: hidden;
+ text-align: center
+}
+.homeNowPlayingTile.large .homeNowPlayingMetadata
+{
+ bottom: 0;
+ padding-left: 0;
+ padding-right: 0;
+ padding-bottom: 6px
+}
+.offline .homeNowPlayingTile.large .homeNowPlayingMetadata .win-commandicon.win-commandring
+{
+ margin-left: 8px
+}
+html[dir=rtl] .homeNowPlayingTile.large .homeNowPlayingMetadata .win-commandicon.win-commandring
+{
+ margin-left: 0;
+ margin-right: 8px
+}
+.homeNowPlayingTile.large .homeNowPlayingMetadataTitle
+{
+ margin-top: 6px;
+ padding-bottom: 2px
+}
+.homeNowPlayingTile.large .nowPlayingTileBackground
+{
+ height: 100%
+}
+.homeNowPlayingTile.large .nowPlayingTileBackground.musicVisualizationVisible
+{
+ height: 267px
+}
+.homeNowPlayingTile.large .bottomProgress
+{
+ position: relative;
+ height: 3px;
+ bottom: auto
+}
+.companionNowPlayingTile
+{
+ position: relative;
+ width: 591px;
+ height: 335px;
+ margin-top: 4px
+}
+.shapeVisualizationEngine
+{
+ position: absolute;
+ width: 100%;
+ height: 100%
+}
+.shapeVisualizationEngine .spriteContainer, .shapeVisualizationEngine .shapeContainer
+{
+ position: absolute
+}
+.shapeVisualizationEngine .sprite
+{
+ transition-property: -ms-transform;
+ position: absolute;
+ transition-duration: 12500ms;
+ transition-timing-function: cubic-bezier(.2,.97,1,1);
+ animation-name: nodeAnimKeys;
+ animation-fill-mode: both;
+ animation-duration: 12500ms
+}
+.shapeVisualizationEngine .debugCellContainer
+{
+ position: absolute;
+ width: 100%;
+ height: 100%
+}
+.shapeVisualizationEngine .debugCell
+{
+ border: 1px solid #666;
+ position: absolute
+}
+.closedCaptionsOn, .mtcButtonOn
+{
+ color: rgba(7,255,0,1) !important
+}
+.closedCaptionsWithTransportControlsShowing
+{
+ opacity: .4
+}
+@keyframes nodeAnimKeys {
+ 0% {
+ opacity: 0
+ }
+ 45% {
+ opacity: .09
+ }
+ 100% {
+ opacity: 0
+ }
+}
+@media screen and (-ms-high-contrast)
+{
+ .blackAlphaGradient
+ {
+ display: none
+ }
+}
diff --git a/packages/microsoft.zunevideo/Styles/Settings.css b/packages/microsoft.zunevideo/Styles/Settings.css
new file mode 100644
index 00000000..b1d3a223
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/Settings.css
@@ -0,0 +1,206 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.win-settingsflyout {
+ z-index: 1001;
+ overflow: auto;
+ border-style: solid;
+ border-width: 2px;
+ position: fixed;
+ top: 0;
+ right: 0;
+ height: calc(100% - 4px);
+ width: 346px;
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 0;
+ visibility: hidden;
+ overflow: hidden
+}
+.win-settingsflyout.win-wide {
+ width: 646px
+}
+.win-settingsflyout .win-header {
+ padding-left: 40px;
+ padding-right: 40px;
+ padding-top: 32px;
+ height: 80px
+}
+.win-settingsflyout .win-backbutton {
+ position: relative;
+ width: 37px;
+ height: 37px;
+ font-size: 11pt;
+ line-height: 32px;
+ margin-top: 2px;
+ border-width: 3px
+}
+.win-settingsflyout .win-header .win-label {
+ display: inline-block;
+ padding-left: 40px;
+ font-size: 20pt;
+ line-height: 33px
+}
+.win-settingsflyout .win-content {
+ overflow: auto;
+ padding-left: 40px;
+ padding-right: 40px;
+ height: calc(100% - 80px)
+}
+.win-settingsflyout:lang(ar), .win-settingsflyout:lang(dv), .win-settingsflyout:lang(fa), .win-settingsflyout:lang(he), .win-settingsflyout:lang(ku-Arab), .win-settingsflyout:lang(pa-Arab), .win-settingsflyout:lang(prs), .win-settingsflyout:lang(ps), .win-settingsflyout:lang(sd-Arab), .win-settingsflyout:lang(syr), .win-settingsflyout:lang(ug), .win-settingsflyout:lang(ur), .win-settingsflyout:lang(qps-plocm) {
+ right: auto;
+ left: 0
+}
+.win-settingsflyout .win-header .win-label:lang(ar), .win-settingsflyout .win-header .win-label:lang(dv), .win-settingsflyout .win-header .win-label:lang(fa), .win-settingsflyout .win-header .win-label:lang(he), .win-settingsflyout .win-header .win-label:lang(ku-Arab), .win-settingsflyout .win-header .win-label:lang(pa-Arab), .win-settingsflyout .win-header .win-label:lang(prs), .win-settingsflyout .win-header .win-label:lang(ps), .win-settingsflyout .win-header .win-label:lang(sd-Arab), .win-settingsflyout .win-header .win-label:lang(syr), .win-settingsflyout .win-header .win-label:lang(ug), .win-settingsflyout .win-header .win-label:lang(ur), .win-settingsflyout .win-header .win-label:lang(qps-plocm) {
+ padding-right: 40px;
+ padding-left: 0
+}
+.settingsWrapper, .offLineAccountPanel, .onlineAccountPanel
+{
+ display: -ms-grid;
+ -ms-grid-columns: 35px 5px 1fr 60px;
+ -ms-grid-rows: 80px 20px 1fr;
+ width: 100%;
+ height: 100%;
+ overflow: auto
+}
+.settingsPanelHeader
+{
+ display: -ms-grid;
+ -ms-grid-columns: 40px 10px 1fr;
+ -ms-grid-rows: auto;
+ -ms-grid-column: 2;
+ -ms-grid-row: 1;
+ -ms-grid-column-span: 3;
+ margin-top: 30px
+}
+.settingsPanelHeaderBackground
+{
+ -ms-grid-column-span: 5
+}
+.settingsPanelBackButton
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 1
+}
+html[dir=rtl] .settingsPanelBackButton
+{
+ transform: scaleX(-1)
+}
+.settingsPanelTitle
+{
+ -ms-grid-column: 3;
+ -ms-grid-row: 1
+}
+.offLineAccountPanel, .onlineAccountPanel
+{
+ -ms-grid-column-span: 5;
+ -ms-grid-row-span: 3
+}
+.settingsSignIn, .settingsPanelContent
+{
+ -ms-grid-column: 3;
+ -ms-grid-row: 3
+}
+.settingsPanelContent
+{
+ margin-top: 18px
+}
+.preferenceSwitchUser
+{
+ margin-bottom: 8px
+}
+.preferenceUserDesc, .preferenceCurrentUser
+{
+ margin-bottom: 20px
+}
+.preferencePurchasesContainer
+{
+ margin-top: 20px
+}
+.genericContainer
+{
+ margin-bottom: 4px;
+ margin-top: 4px
+}
+.genericContainer p
+{
+ margin-bottom: 12px;
+ margin-top: 4px
+}
+.musicCloudGrovelInfoContainer .dialogButton
+{
+ margin-top: 10px
+}
+.settingsFeedbackPanelContentDialog
+{
+ margin-left: 0;
+ margin-top: 0
+}
+.settingsWebLinkText
+{
+ margin-top: 4px;
+ text-decoration: none;
+ display: block
+}
+.accountSettings.settingsWebLinkText
+{
+ margin-top: 20px
+}
+.settingsWebLinkText.removeFromDisplay
+{
+ display: none
+}
+.aboutPageTitles
+{
+ margin-top: 30px;
+ max-height: 80px;
+ overflow: hidden
+}
+.settingsAboutVersion
+{
+ margin-bottom: 10px
+}
+.settingsPreferenceGroup, .settingAccountsButton
+{
+ margin-bottom: 36px
+}
+.libraryPreferencesTitle, .launchToCollectionTitle, .cloudCollectionEnabledTitle, .musicPassDownloadEnabledLabel, .goOnlineForMetadataTitle
+{
+ margin-bottom: 4px
+}
+.settingsFeedbackContent
+{
+ margin-top: 10px
+}
+.settingsCaptionPreviewWindow
+{
+ margin-top: 6px;
+ margin-bottom: 20px;
+ padding: 20px;
+ font-size: 17pt;
+ height: auto;
+ width: auto;
+ outline: solid 2px #a9a9a9
+}
+.preferenceFreePlayLimitMeterContainer
+{
+ display: -ms-grid;
+ -ms-grid-rows: auto;
+ -ms-grid-columns: 1fr 8px auto
+}
+.preferenceFreePlayLimitMeter
+{
+ -ms-grid-row: 1;
+ -ms-grid-column: 1;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ width: 100%;
+ height: 20px;
+ border-width: 1px;
+ border-style: solid
+}
+.preferenceFreePlayLimitMeterPercentageLabel
+{
+ -ms-grid-row-align: center;
+ -ms-grid-row: 1;
+ -ms-grid-column: 3
+}
diff --git a/packages/microsoft.zunevideo/Styles/Shell.css b/packages/microsoft.zunevideo/Styles/Shell.css
new file mode 100644
index 00000000..05421e4f
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/Shell.css
@@ -0,0 +1,557 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+#htmlUnsnapped, #htmlSnapped
+{
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0
+}
+.mainHeader {
+ display: -ms-grid;
+ -ms-grid-columns: 120px 1fr auto 40px;
+ -ms-grid-rows: 40px 80px
+}
+@media screen and (min-height: 1080px)
+{
+ .mainHeader
+ {
+ -ms-grid-rows: 50px 80px
+ }
+}
+@media screen and (min-height: 1200px)
+{
+ .mainHeader
+ {
+ -ms-grid-rows: 70px 80px
+ }
+}
+@media screen and (min-height: 1440px)
+{
+ .mainHeader
+ {
+ -ms-grid-rows: 130px 80px
+ }
+}
+.mainParentGrid
+{
+ display: -ms-grid;
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: auto 1fr;
+ width: 100vw;
+ height: 100vh
+}
+.mainContentGrid
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 2
+}
+.navigationWrapper
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 2;
+ height: 80px;
+ width: 100%;
+ display: -ms-grid;
+ -ms-grid-columns: .5fr 80px .5fr;
+ -ms-grid-rows: 80px;
+ z-index: 1
+}
+.navigationWrapper .navigationContainer
+{
+ -ms-grid-column: 2;
+ -ms-grid-row: 1;
+ white-space: nowrap
+}
+.mainHubStrip, .dashboardHost
+{
+ height: 100vh;
+ width: 100vw;
+ display: -ms-grid;
+ -ms-grid-rows: 110px 10px 1fr
+}
+.mainHubStrip
+{
+ -ms-grid-columns: 120px 1fr
+}
+.dashboardHost
+{
+ -ms-grid-columns: 60px 1fr
+}
+@media screen and (min-height: 1080px)
+{
+ .mainHubStrip, .dashboardHost
+ {
+ -ms-grid-rows: 120px 25px 1fr
+ }
+}
+@media screen and (min-height: 1200px)
+{
+ .mainHubStrip, .dashboardHost
+ {
+ -ms-grid-rows: 140px 85px 1fr
+ }
+}
+@media screen and (min-height: 1440px)
+{
+ .mainHubStrip, .dashboardHost
+ {
+ -ms-grid-rows: 200px 125px 1fr
+ }
+}
+.hubNavigationClippingContainer
+{
+ -ms-grid-column: 2;
+ -ms-grid-row: 1;
+ display: -ms-grid;
+ -ms-grid-columns: 1fr 40px;
+ -ms-grid-rows: 1fr auto auto;
+ padding-bottom: 15px;
+ margin-bottom: -15px
+}
+html[dir=ltr] .hubNavigationClippingContainer
+{
+ padding-left: 12px;
+ margin-left: -12px
+}
+html[dir=rtl] .hubNavigationClippingContainer
+{
+ padding-right: 12px;
+ margin-right: -12px
+}
+@media screen and (max-width: 1365px)
+{
+ .hubNavigationClippingContainer
+ {
+ overflow-x: auto
+ }
+ .mainHeader
+ {
+ height: 40px
+ }
+}
+.mainHubStrip .hubStripScroller, .searchHubStrip .hubStripScroller
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 3;
+ -ms-grid-column-span: 2
+}
+.hubNavigationClippingContainer
+{
+ opacity: 0
+}
+.galleryPageHost .hubNavigationClippingContainer
+{
+ opacity: 1
+}
+.hubNavigationContainer
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 3;
+ height: auto;
+ display: inline-block;
+ white-space: nowrap;
+ padding: 2px;
+ margin: -19px -12px 1px -12px
+}
+.pivotDashboard .dashboardPivots
+{
+ margin-left: -12px
+}
+html[dir=rtl] .pivotDashboard .dashboardPivots
+{
+ margin-right: -12px;
+ margin-left: 0
+}
+.hubNavigationTitle
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 2;
+ height: auto;
+ margin-bottom: 11px
+}
+.hubNavigationSubTitle
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 3;
+ height: auto;
+ display: inline-block;
+ white-space: nowrap;
+ padding-bottom: 5px;
+ margin-top: -15px
+}
+.hubStripTitleContainer
+{
+ -ms-grid-column: 1;
+ -ms-grid-row: 3;
+ margin-bottom: 5px;
+ height: auto;
+ width: auto
+}
+.mainHubStripHub
+{
+ display: inline-block;
+ white-space: nowrap
+}
+.dashboard .panelFragmentLoading, .dashboard .panelFragmentFailed
+{
+ height: 435px
+}
+.dashboard .panelFragmentWrapper
+{
+ top: 0
+}
+.dashboard .panelFragmentLoading
+{
+ display: -ms-grid;
+ -ms-grid-columns: 1fr
+}
+.dashboard .panelFragmentLoadingProgress {
+ left: 0;
+ width: auto;
+ -ms-grid-column-align: center
+}
+.dashboard .panelContentContainer
+{
+ top: 0
+}
+.shellLoadingControl
+{
+ position: relative;
+ z-index: 1;
+ -ms-grid-column-align: stretch;
+ -ms-grid-row-align: start;
+ -ms-grid-column-span: 4
+}
+.pageTitle
+{
+ position: absolute;
+ top: -10px;
+ left: 100px
+}
+.pageContainer
+{
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: 100vw;
+ overflow: visible
+}
+.pageFooter
+{
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: 100vw;
+ height: 50px
+}
+.appSignIn
+{
+ -ms-grid-column: 3;
+ -ms-grid-row: 2
+}
+.PrimaryNavigationButton
+{
+ border: 0 solid;
+ outline: none
+}
+.fadedNavigationContainer
+{
+ opacity: .4
+}
+.win-backbutton.homeIcon::before
+{
+ content: ""
+}
+.CreateAccountButton
+{
+ position: absolute;
+ margin: 5px 10px 0 0;
+ border: 0 solid;
+ outline: none;
+ top: 0;
+ right: 0;
+ text-align: right
+}
+.SearchEditBox
+{
+ width: 140px;
+ height: 20px;
+ top: 15px;
+ margin-top: 13px;
+ border: 0 solid;
+ -ms-grid-column: 2;
+ -ms-grid-row: 2
+}
+.SearchButton
+{
+ position: absolute;
+ width: 48px;
+ height: 48px;
+ right: 10px;
+ border: 0 solid;
+ outline: none;
+ top: 30px
+}
+@media(min-width: 320px) and (max-width: 480px)
+{
+ body:not(.app-newmusic) .appBarActionList, .appBarNowPlaying
+ {
+ display: none
+ }
+}
+.bottomProgressBar
+{
+ position: absolute;
+ bottom: 0;
+ height: 3px;
+ width: 100vw;
+ z-index: 50
+}
+.imageButton
+{
+ border: 0;
+ background-repeat: no-repeat;
+ background-position: 50% 50%;
+ outline: none
+}
+.fullScreen
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100vh
+}
+.dashboard
+{
+ width: 100%
+}
+.games .dashboard .hubNavigationClippingContainer
+{
+ left: 240px;
+ width: calc(100% - 240px)
+}
+.dashboard .hub
+{
+ height: 100%
+}
+.galleryHubStrip .win-surface
+{
+ margin-left: 116px
+}
+html[dir=rtl] .galleryHubStrip .win-surface
+{
+ margin-left: 0;
+ margin-right: 116px
+}
+.galleryHubStrip .panelFragmentLoading, .galleryHubStrip .panelModifierContainer, .galleryHubStrip .panelFragmentFailed
+{
+ margin-left: 120px
+}
+html[dir=rtl] .galleryHubStrip .panelFragmentLoading, html[dir=rtl] .galleryHubStrip .panelModifierContainer, html[dir=rtl] .galleryHubStrip .panelFragmentFailed
+{
+ margin-left: 0;
+ margin-right: 120px
+}
+.galleryHubStrip .panelFragmentLoading, .galleryHubStrip .panelFragmentFailed
+{
+ width: calc(100vw - 200px)
+}
+.galleryHubStrip .win-surface
+{
+ padding-right: 75px
+}
+.galleryHubStrip .hubStripScroller
+{
+ overflow: hidden
+}
+#homePageContent
+{
+ top: 0;
+ width: auto;
+ display: -ms-grid;
+ -ms-grid-columns: 2278px;
+ -ms-grid-rows: 1fr
+}
+#musicPageContent, #videoPageContent
+{
+ top: 0;
+ width: auto;
+ display: -ms-grid;
+ -ms-grid-columns: 2103px;
+ -ms-grid-rows: 1fr
+}
+.panelContainer
+{
+ display: inline-block;
+ width: 100%;
+ height: 100%;
+ min-width: 300px
+}
+.panelContainer.noWidth
+{
+ min-width: 0
+}
+.panelActionWrapper
+{
+ position: absolute;
+ left: -120px;
+ display: inline-block;
+ vertical-align: top;
+ padding-top: 47px;
+ width: 115px
+}
+.panelActionContainer
+{
+ position: relative;
+ margin-right: -5px
+}
+.panelFragmentContainer
+{
+ display: inline-block
+}
+.panelActionLink
+{
+ margin-bottom: 5px;
+ height: 115px;
+ width: 115px
+}
+.panelContentContainer
+{
+ display: -ms-grid;
+ -ms-grid-columns: 100%;
+ -ms-grid-rows: 40px 11px 1fr;
+ height: 100%;
+ width: 100%
+}
+.panelContentContainer .panelTitle
+{
+ height: auto
+}
+.panelContainer.noWidth .panelTitle
+{
+ height: 36px
+}
+.adControl
+{
+ width: 100%;
+ height: 100%
+}
+.disabledAdControl
+{
+ width: 0;
+ height: 0
+}
+.videoAdContainer .overlayContent
+{
+ height: 100%;
+ width: 100%
+}
+.videoAdOverlay
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+ display: -ms-grid;
+ -ms-grid-columns: 1fr;
+ -ms-grid-rows: 1fr 208px;
+ background-position: 0 0;
+ background-size: cover
+}
+.videoAd
+{
+ height: 100%;
+ width: 100%
+}
+.videoAdOverlayContentContainer
+{
+ display: -ms-grid;
+ -ms-grid-columns: 60px 1fr auto auto 40px;
+ -ms-grid-rows: 1fr
+}
+.videoAdCloseButton
+{
+ -ms-grid-column-align: end;
+ -ms-grid-row-align: start;
+ width: 30px;
+ height: 30px;
+ margin-top: 40px;
+ margin-left: 50px;
+ margin-right: 50px
+}
+.videoAdCloseButton .win-commandicon.win-commandring
+{
+ border: none
+}
+.videoAdText
+{
+ display: -ms-grid;
+ -ms-grid-columns: auto;
+ -ms-grid-rows: auto auto auto auto;
+ margin-top: 30px
+}
+a.videoAdReasonLink, a.videoAdLearnMoreLink
+{
+ margin-top: 30px;
+ -ms-grid-column-align: start
+}
+a.videoAdReasonLink .inlineCaretButtonIcon, a.videoAdLearnMoreLink .inlineCaretButtonIcon
+{
+ margin-top: 1px
+}
+a.nowPlayingMoreInfoLink
+{
+ margin-top: 10px
+}
+.welcomeDialog .welcomeDialogContent
+{
+ display: -ms-grid;
+ -ms-grid-rows: 480px 60px auto 57px auto;
+ -ms-grid-columns: 424px 1072px 424px
+}
+.welcomeDialog .welcomeDialogTitle
+{
+ -ms-grid-row: 2;
+ -ms-grid-column: 2
+}
+.welcomeDialog .welcomeDialogSubText
+{
+ -ms-grid-row: 3;
+ -ms-grid-column: 2
+}
+.welcomeDialog.win-ui-dark progress:indeterminate
+{
+ -ms-grid-row: 3;
+ -ms-grid-column: 2;
+ -ms-grid-column-align: center
+}
+.welcomeDialog .welcomeNextButton
+{
+ width: 475px;
+ height: 84px;
+ -ms-grid-row: 5;
+ -ms-grid-column: 2
+}
+.welcomeDialog button.win-command, .welcomeDialog button.win-command.iconButton, .welcomeDialog button.win-command.iconButton:hover:focus, .welcomeDialog button.win-command.iconButton:active, .welcomeDialog button.win-command.iconButton:focus
+{
+ height: 100%
+}
+.welcomeDialog .welcomeNextButton .win-commandicon
+{
+ margin-left: 13px;
+ margin-bottom: 10px
+}
+.welcomeDialog .welcomeNextButton button.win-command .win-label
+{
+ margin-left: 15px;
+ margin-bottom: 4px
+}
diff --git a/packages/microsoft.zunevideo/Styles/TransportControls.css b/packages/microsoft.zunevideo/Styles/TransportControls.css
new file mode 100644
index 00000000..136c8e7e
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/TransportControls.css
@@ -0,0 +1,110 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.appBarTransportControlsXboxContainer .appBarIconButton
+{
+ overflow: visible
+}
+.appBarTransportControlsMessageTitle, .appBarTransportControlsMessageSubTitle
+{
+ margin: 0 10px 0 0
+}
+.nowPlayingTransportControlsContainer
+{
+ display: -ms-grid;
+ -ms-grid-columns: 1fr 33% 1fr;
+ -ms-grid-rows: auto;
+ margin-left: 0;
+ margin-right: 0;
+ direction: ltr
+}
+.musicOverlay .nowPlayingTransportControlsContainer
+{
+ -ms-grid-columns: 80px 80px 80px 80px;
+ margin-left: 60px;
+ margin-right: 60px;
+ width: 200px
+}
+html[dir=rtl] .musicOverlay .nowPlayingTransportControlsContainer
+{
+ margin-right: 140px
+}
+.nowPlayingTransportControls
+{
+ -ms-grid-row-align: center;
+ -ms-grid-row: 2
+}
+.musicOverlay .nowPlayingTransportControls
+{
+ -ms-grid-row: 3;
+ -ms-grid-row-align: end
+}
+.nowPlayingTransportControlsPlayPauseButton
+{
+ -ms-grid-row: 1;
+ -ms-grid-column: 2;
+ width: 131px;
+ height: 131px;
+ border: 0;
+ outline: none;
+ background-color: transparent;
+ background-repeat: no-repeat;
+ -ms-grid-row-align: center;
+ -ms-grid-column-align: center
+}
+.nowPlayingTransportControlsNext
+{
+ -ms-grid-column: 3
+}
+.nowPlayingTransportControlsPlayPauseButton .label
+{
+ visibility: hidden
+}
+.nowPlayingTransportControlsPlayPauseButton button.iconButton.win-command
+{
+ -ms-grid-columns: 131px 1fr
+}
+.musicOverlay .nowPlayingTransportControlsPlayPauseButton button.iconButton.win-command, .videoAd .nowPlayingTransportControlsPlayPauseButton button.iconButton.win-command
+{
+ -ms-grid-columns: auto 1fr
+}
+.nowPlayingContainer:not(.musicTrack) .nowPlayingTransportControlsSkipButton, .games .nowPlayingContainer .nowPlayingTransportControlsVolume
+{
+ display: none;
+ width: 65px;
+ height: 65px;
+ border: 0;
+ background-position-x: center;
+ outline: none;
+ background-color: transparent;
+ background-repeat: no-repeat;
+ -ms-grid-row-align: center;
+ -ms-grid-column-align: center
+}
+.musicOverlay .nowPlayingTransportControlsPlayPauseButton, .musicOverlay .nowPlayingTransportControlsSkipButton
+{
+ width: 40px;
+ height: 40px;
+ -ms-grid-column-align: start
+}
+.nowPlayingTransportControlsPlayPauseButton:disabled, .nowPlayingTransportControlsSkipButton:disabled
+{
+ opacity: .4
+}
+.nowPlayingTransportControlsPlayPauseButton:hover, .nowPlayingTransportControlsPrevious:hover
+{
+ opacity: .9
+}
+.nowPlayingTransportControlsPause .win-commandimage:before
+{
+ content: ""
+}
+.nowPlayingTransportControlsPlay .win-commandimage:before
+{
+ content: ""
+}
+@media screen and (-ms-high-contrast)
+{
+ .nowPlayingTransportControlsSkipButton .win-commandicon.win-commandring
+ {
+ border-radius: 0%
+ }
+}
diff --git a/packages/microsoft.zunevideo/Styles/ui-overrides.css b/packages/microsoft.zunevideo/Styles/ui-overrides.css
new file mode 100644
index 00000000..4b55c6b3
--- /dev/null
+++ b/packages/microsoft.zunevideo/Styles/ui-overrides.css
@@ -0,0 +1,141 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+a, a:hover, a:hover:active
+{
+ color: #747474
+}
+button, input[type=button], input[type=reset], input[type=submit] {
+ min-height: 1px;
+ min-width: 1px
+}
+.hubNavigationContainer button, .dashboardPivots button, .immersivePivots button, .hubNavigationContainer input[type=button], .hubNavigationContainer input[type=reset], .hubNavigationContainer input[type=submit]
+{
+ padding: 2px 12px 2px 12px
+}
+button, button:hover, button:hover:active, button:disabled {
+ background-color: transparent;
+ border-color: transparent
+}
+button[type=submit]:hover {
+ background-color: #295c03;
+ border-color: #295c03
+}
+.win-listview .win-container.win-selected:hover {
+ background-color: transparent
+}
+.win-listview.win-selectionstylefilled .win-selected button, .win-listview.win-selectionstylefilled .win-selected input[type=button], .win-listview.win-selectionstylefilled .win-selected input[type=reset], .win-listview.win-selectionstylefilled .win-selected input[type=text], .win-listview.win-selectionstylefilled .win-selected input[type=password], .win-listview.win-selectionstylefilled .win-selected input[type=email], .win-listview.win-selectionstylefilled .win-selected input[type=number], .win-listview.win-selectionstylefilled .win-selected input[type=tel], .win-listview.win-selectionstylefilled .win-selected input[type=url], .win-listview.win-selectionstylefilled .win-selected input[type=search], .win-listview.win-selectionstylefilled .win-selected input::-ms-check, .win-listview.win-selectionstylefilled .win-selected textarea, .win-listview.win-selectionstylefilled .win-selected .win-textarea, .win-listview.win-selectionstylefilled .win-selected select {
+ background-color: transparent
+}
+.win-listview .win-item.win-selected, .win-listview .win-item.win-selected:hover, .companionSearchTermsList .win-focused
+{
+ background-color: rgba(255,255,255,.15)
+}
+.win-listview .win-focusedoutline, .nowPlayingPlaylistGalleryView .win-vertical .win-focusedoutline, .nowPlayingPlaylistGallerySnapped .win-vertical .win-focusedoutline, .musicPage .win-vertical .win-focusedoutline, .inboxPage .win-vertical .win-focusedoutline
+{
+ outline: #fff solid 2px;
+ border-style: none
+}
+.win-vertical .win-focusedoutline
+{
+ outline: #000 solid 2px;
+ border-style: none
+}
+body:not(.showKeyboardFocus) .win-vertical .win-focusedoutline
+{
+ outline-color: transparent
+}
+.win-command.iconButtonVertical, .win-command.iconButtonVertical:hover:focus, .win-command.iconButtonVertical:active, .win-command.iconButtonVertical:focus, .collectionMusicSongsGallery.win-ui-dark .win-container:hover, .win-command.playPauseIconButton, .win-command.playPauseIconButton:hover:focus, .win-command.playPauseIconButton:focus, .win-command.playPauseIconButton:active, .win-command.appBarIconButton:hover:focus, .win-command.appBarIconButton:active, .win-command.appBarIconButton:focus, button.win-command.appBarIconButton, button.win-command.appBarIconButton:hover:focus, button.win-command.appBarIconButton:active, button.win-command.appBarIconButton:focus, button.win-command.iconButton, button.win-command.iconButton:hover:focus, button.win-command.iconButton:active, button.win-command.iconButton:focus
+{
+ outline-style: none;
+ border-color: transparent;
+ background-clip: padding-box;
+ border: 0
+}
+.win-ui-light .dialogButton:active:hover, .win-ui-light .dialogButton.defaultButton, .win-ui-light .dialogButton.defaultButton:hover, .win-ui-light .dialogButton.defaultButton:active, .win-ui-light .dialogButton.defaultButton:active:hover
+{
+ background-clip: padding-box
+}
+@media(min-width: 481px) and (max-width: 1023px)
+{
+ button.win-command .win-label
+ {
+ display: inherit
+ }
+ button.win-command .win-commandicon
+ {
+ margin: inherit
+ }
+}
+@media screen and (min-width: 768px)
+{
+ button.win-command.iconButton .win-label
+ {
+ display: block
+ }
+}
+.win-ui-dark.shellBackButtonContainer
+{
+ width: 40px;
+ height: 40px;
+ padding: 20px;
+ position: relative
+}
+.collectionMusicSongsGallery.win-ui-dark.win-template, .win-appbar .win-ui-dark button:hover:active
+{
+ background-color: transparent
+}
+button.iconButton.win-command:focus, button.iconButton.win-command:active
+{
+ border-color: transparent
+}
+#html_immersiveLayout.win-ui-dark
+{
+ background-color: transparent
+}
+.win-backbutton
+{
+ width: 40px;
+ height: 40px
+}
+.win-backbutton:focus
+{
+ outline: 0
+}
+html[dir=rtl] .iconButton
+{
+ writing-mode: rl-tb
+}
+html[dir=ltr] .iconButton
+{
+ writing-mode: lr-tb
+}
+.win-selectionborder.win-selectionborderbottom
+{
+ top: inherit
+}
+.win-selectionborder.win-selectionborderright
+{
+ left: inherit
+}
+.win-selectionborder.win-selectionborderleft
+{
+ right: inherit
+}
+.win-ui-dark .win-listview .win-viewport.win-vertical .win-container {
+ background-color: transparent
+}
+.win-backdrop
+{
+ background-color: transparent
+}
+.win-ui-light {
+ background-color: transparent
+}
+.win-ui-dark {
+ background-color: transparent
+}
+.win-backbutton:disabled, .win-backbutton:disabled:active, .win-navigation-backbutton:disabled, .win-navigation-backbutton:disabled:active, .mediaBrowser2.snapped .win-navigation-backbutton {
+ display: none
+}
+body:-ms-lang(pa-Arab), .win-type-xx-large:-ms-lang(pa-Arab), .win-type-x-large:-ms-lang(pa-Arab), .win-type-large:-ms-lang(pa-Arab), .win-type-medium:-ms-lang(pa-Arab), .win-type-small:-ms-lang(pa-Arab), .win-type-x-small:-ms-lang(pa-Arab), .win-type-xx-small:-ms-lang(pa-Arab), input:-ms-lang(pa-Arab), textarea:-ms-lang(pa-Arab), .win-textarea:-ms-lang(pa-Arab), button:-ms-lang(pa-Arab), select:-ms-lang(pa-Arab), option:-ms-lang(pa-Arab) {
+ font-family: "Segoe UI","Ebrima","Nirmala UI","Gadugi","Segoe UI Symbol","Meiryo UI","Khmer UI","Tunga","Lao UI","Raavi","Iskoola Pota","Latha","Leelawadee","Microsoft YaHei UI","Microsoft JhengHei UI","Malgun Gothic","Estrangelo Edessa","Microsoft Himalaya","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Yi Baiti","Mongolian Baiti","MV Boli","Myanmar Text","Cambria Math"
+}
diff --git a/packages/microsoft.zunevideo/TvDetails_merged.js b/packages/microsoft.zunevideo/TvDetails_merged.js
new file mode 100644
index 00000000..bd2282be
--- /dev/null
+++ b/packages/microsoft.zunevideo/TvDetails_merged.js
@@ -0,0 +1,893 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/viewmodels/video_win/episodesmodule.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var EpisodesModule = (function(_super) {
+ __extends(EpisodesModule, _super);
+ function EpisodesModule(_model) {
+ _super.call(this, "episodes");
+ this._model = _model;
+ Trace.assert(this._model, "Invalid TV Details model")
+ }
+ EpisodesModule.prototype.getItems = function() {
+ if (!this._getItemsPromise)
+ var items = (this._model.episodes || []).concat(this._model.extrasForSeason || []).concat(this._model.extrasForSeries || []).map(function(item) {
+ return {
+ actionId: Entertainment.UI.Actions.ActionIdentifiers.navigateToVideoDetails, actionParameter: {data: item}, mediaItem: item
+ }
+ });
+ this._getItemsPromise = WinJS.Promise.as({items: items});
+ return this._getItemsPromise
+ };
+ return EpisodesModule
+ })(ViewModels.ModuleBase);
+ ViewModels.EpisodesModule = EpisodesModule
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/seriesseasonsmodule.js:45 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var SeriesSeasonsModule = (function(_super) {
+ __extends(SeriesSeasonsModule, _super);
+ function SeriesSeasonsModule(_model, _viewModel) {
+ _super.call(this, "seasons");
+ this._model = _model;
+ this._viewModel = _viewModel;
+ Trace.assert(this._model, "Invalid TV Details model")
+ }
+ SeriesSeasonsModule.prototype._createHeaderAction = function() {
+ return null
+ };
+ SeriesSeasonsModule.prototype.getItems = function() {
+ var _this = this;
+ if (!this._getItemsPromise)
+ this._getItemsPromise = Entertainment.Utilities.schedulePromiseNormal().then(function() {
+ var seasons = (_this._model && _this._model.seasons) || [];
+ seasons = seasons.sort(function(itemA, itemB) {
+ return itemB.seasonNumber - itemA.seasonNumber
+ });
+ var items = seasons.map(function(season) {
+ return {
+ actionId: Entertainment.UI.Actions.ActionIdentifiers.changeTvSeason, actionParameter: {
+ data: season, model: _this._model
+ }, mediaItem: season
+ }
+ });
+ return {items: items}
+ });
+ return this._getItemsPromise
+ };
+ return SeriesSeasonsModule
+ })(ViewModels.ModuleBase);
+ ViewModels.SeriesSeasonsModule = SeriesSeasonsModule
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/tvdetailsviewmodel.js:101 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(TvDetailsModuleKeys) {
+ TvDetailsModuleKeys[TvDetailsModuleKeys["episodesModule"] = 0] = "episodesModule";
+ TvDetailsModuleKeys[TvDetailsModuleKeys["seriesSeasonsModule"] = 1] = "seriesSeasonsModule"
+ })(ViewModels.TvDetailsModuleKeys || (ViewModels.TvDetailsModuleKeys = {}));
+ var TvDetailsModuleKeys = ViewModels.TvDetailsModuleKeys;
+ var TvDetailsViewModel = (function(_super) {
+ __extends(TvDetailsViewModel, _super);
+ function TvDetailsViewModel(model, initialPreferences) {
+ this._model = model;
+ this._primaryHeaderButtons = new Entertainment.ObservableArray;
+ this._secondaryHeaderButtons = new Entertainment.ObservableArray;
+ this._refreshHeaderButtons = this._refreshHeaderButtons.bind(this);
+ _super.call(this, initialPreferences)
+ }
+ TvDetailsViewModel.create = function(mediaItem, initialPreferences) {
+ if (!mediaItem || !Entertainment.Utilities.isAnyTV(mediaItem)) {
+ Trace.fail("Could not create TvDetailsViewModel");
+ return null
+ }
+ var tvDetailsModel = new Entertainment.Components.Video.TvDetailsModel;
+ tvDetailsModel.start(mediaItem);
+ return new TvDetailsViewModel(tvDetailsModel, initialPreferences)
+ };
+ TvDetailsViewModel.prototype._hydrateMedia = function() {
+ var _this = this;
+ return this._model.start().then(function() {
+ Trace.assert(_this._model, "TvDetailsViewModel::_hydrateMedia(): Expected TV model to be populated");
+ var season = _this._model.season;
+ var series = _this._model.series;
+ Trace.assert(season, "TvDetailsViewModel::_hydrateMedia(): Invalid season provided!");
+ Trace.assert(Entertainment.Platform.PlaybackHelpers.isTVSeason(season), "TvDetailsViewModel::_hydrateMedia(): Invalid season provided!");
+ Trace.assert(series, "TvDetailsViewModel::_hydrateMedia(): Invalid series provided!");
+ Trace.assert(Entertainment.Platform.PlaybackHelpers.isTVSeries(series), "TvDetailsViewModel::_hydrateMedia(): Invalid series provided!");
+ _this.mediaItem = season;
+ _this.season = season;
+ _this.series = series
+ })
+ };
+ TvDetailsViewModel.prototype._initializeFromMedia = function() {
+ var _this = this;
+ this._viewModelBindings = new Array;
+ this._viewModelBindings.push(WinJS.Binding.bind(this._model, {updating: function() {
+ return _this.refreshContent()
+ }}))
+ };
+ TvDetailsViewModel.prototype._initializeModules = function() {
+ this.modules = [new ViewModels.EpisodesModule(this._model), new ViewModels.SeriesSeasonsModule(this._model, this)]
+ };
+ TvDetailsViewModel.prototype._onMediaItemDeletion = function(deletionEvent) {
+ this.refreshContent();
+ this.refreshEpisodeList()
+ };
+ TvDetailsViewModel.prototype.delayInitialize = function() {
+ var _this = this;
+ var navigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.navigation);
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ this._viewModelBindings.push(Entertainment.UI.Framework.addEventHandlers(page, {onNavigateTo: function(args) {
+ if (navigationService.navigationDirection === Entertainment.Navigation.NavigationDirection.backward)
+ _this._findNextPromotedEpisode(_this.season)
+ }}));
+ try {
+ this._viewModelBindings.push(MS.Entertainment.Utilities.addEventHandlers(Microsoft.Entertainment.Marketplace.Marketplace, {mediarightchanged: this._mediaRightChanged.bind(this)}))
+ }
+ catch(e) {
+ var message = (e && e.message) || e;
+ var errorCode = e && e.number;
+ ViewModels.fail("Microsoft.Entertainment.Marketplace.Marketplace.addEventListener failed with error:" + errorCode + "; message:" + message)
+ }
+ _super.prototype.delayInitialize.call(this)
+ };
+ Object.defineProperty(TvDetailsViewModel.prototype, "title", {
+ get: function() {
+ return this._title
+ }, set: function(value) {
+ this.updateAndNotify("title", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "subTitle", {
+ get: function() {
+ return this._subTitle
+ }, set: function(value) {
+ this.updateAndNotify("subTitle", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "description", {
+ get: function() {
+ return this._description
+ }, set: function(value) {
+ this.updateAndNotify("description", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "episode", {
+ get: function() {
+ return this._episode
+ }, enumerable: true, configurable: true
+ });
+ TvDetailsViewModel.prototype.refreshEpisodeList = function() {
+ if (this.episodes)
+ this.episodes.reload()
+ };
+ TvDetailsViewModel.prototype.refreshContent = function() {
+ if (this._model && !this._model.updating) {
+ var updatedSeason = (this._model && this._model.season) ? this._model.season : null;
+ this.season = updatedSeason;
+ this.refreshPromotedEpisode()
+ }
+ };
+ TvDetailsViewModel.prototype.refreshPromotedEpisode = function() {
+ var _this = this;
+ var updatedEpisode = (this._model && this._model.seasonHasPromotedEpisode) ? this._model.episode : null;
+ this.updateAndNotify("episode", updatedEpisode);
+ this._disposeEpisodeSmartBuyStateEngine();
+ this._onButtonsChanged();
+ if (this.episode) {
+ this._episodeSmartBuyStateEngine = new ViewModels.VideoSmartBuyStateEngine;
+ this._episodeSmartBuyStateEngine.purchaseOptions = this.purchaseOptions;
+ this._episodeSmartBuyStateEngineBinding = WinJS.Binding.bind(this._episodeSmartBuyStateEngine, {
+ currentAppbarActions: function() {
+ return _this._onAppbarActionsChanged()
+ }, currentButtons: function() {
+ return _this._onButtonsChanged()
+ }
+ });
+ var episodeButtons = ViewModels.SmartBuyButtons.getWatchNextEpisodeButtons(this.episode, Entertainment.UI.Actions.ExecutionLocation.canvas);
+ this._episodeSmartBuyStateEngine.initialize(this.episode, episodeButtons, ViewModels.VideoSmartBuyStateEngine.prototype.onWatchNextStateChanged)
+ }
+ this._refreshDetailString()
+ };
+ Object.defineProperty(TvDetailsViewModel.prototype, "episodes", {
+ get: function() {
+ return this.modules && this.modules[0]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "seasons", {
+ get: function() {
+ return this.modules && this.modules[1]
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "season", {
+ get: function() {
+ return this._season
+ }, set: function(value) {
+ if (value && !value.isEqual(this.season)) {
+ this.updateAndNotify("season", value);
+ this._mediaItemHydratePromise = this.season ? this.season.hydrate() : WinJS.Promise.as(null);
+ this._disposeSmartBuyStateEngine();
+ if (this.purchaseOptions)
+ this.purchaseOptions = new ViewModels.PurchaseOptions(this.purchaseOptions.selectedDefinition, this.purchaseOptions.selectedLanguageCode);
+ this._createSmartBuyStateEngine();
+ this._initializeSmartBuyStateEngine(false);
+ this.refreshEpisodeList()
+ }
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "series", {
+ get: function() {
+ return this._series
+ }, set: function(value) {
+ this.updateAndNotify("series", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "episodePrimaryHeaderButtons", {
+ get: function() {
+ return this._episodePrimaryHeaderButtons
+ }, set: function(value) {
+ this._updateButtonList("_episodePrimaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "episodeSecondaryHeaderButtons", {
+ get: function() {
+ return this._episodeSecondaryHeaderButtons
+ }, set: function(value) {
+ this._updateButtonList("_episodeSecondaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "seasonPrimaryHeaderButtons", {
+ get: function() {
+ return this._seasonPrimaryHeaderButtons
+ }, set: function(value) {
+ this._updateButtonList("_seasonPrimaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "seasonSecondaryHeaderButtons", {
+ get: function() {
+ return this._seasonSecondaryHeaderButtons
+ }, set: function(value) {
+ this._updateButtonList("_seasonSecondaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "primaryHeaderButtons", {
+ get: function() {
+ return this._primaryHeaderButtons
+ }, set: function(value) {
+ this._primaryHeaderButtons = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "secondaryHeaderButtons", {
+ get: function() {
+ return this._secondaryHeaderButtons
+ }, set: function(value) {
+ this._secondaryHeaderButtons = value
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "seasonName", {
+ get: function() {
+ return this._seasonName
+ }, set: function(value) {
+ this.updateAndNotify("seasonName", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "episodeCount", {
+ get: function() {
+ return this._episodeCount
+ }, set: function(value) {
+ this.updateAndNotify("episodeCount", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvDetailsViewModel.prototype, "network", {
+ get: function() {
+ return this._network
+ }, set: function(value) {
+ this.updateAndNotify("network", value)
+ }, enumerable: true, configurable: true
+ });
+ TvDetailsViewModel.prototype.dispose = function() {
+ this._disposeEpisodeSmartBuyStateEngine();
+ if (this._viewModelBindings) {
+ this._viewModelBindings.forEach(function(binding) {
+ return binding.cancel()
+ });
+ this._viewModelBindings = null
+ }
+ if (this._model) {
+ this._model.dispose();
+ this._model = null
+ }
+ _super.prototype.dispose.call(this)
+ };
+ TvDetailsViewModel.prototype._disposeSmartBuyStateEngine = function() {
+ _super.prototype._disposeSmartBuyStateEngine.call(this)
+ };
+ TvDetailsViewModel.prototype._getSmartBuyEngineButtons = function() {
+ return ViewModels.SmartBuyButtons.getTVDetailsButtons(this.mediaItem, Entertainment.UI.Actions.ExecutionLocation.canvas, {includeDownloadButtons: true})
+ };
+ TvDetailsViewModel.prototype._getSmartBuyEngineEventHandler = function() {
+ var _this = this;
+ return function(engine, stateInfo) {
+ var getStatePromise;
+ if (_this._smartBuyStateEngine)
+ getStatePromise = _this._smartBuyStateEngine.onSeasonDetailsStateChanged(stateInfo).then(function(buttonState) {
+ _this._refreshPurchaseDetailsString(stateInfo);
+ return buttonState
+ });
+ return WinJS.Promise.as(getStatePromise)
+ }
+ };
+ TvDetailsViewModel.prototype._refreshDetailString = function() {
+ if (!this.season || !this.series)
+ return;
+ _super.prototype._refreshDetailsStrings.call(this);
+ var episode = this.episode;
+ var season = this.season;
+ var series = this.series;
+ if (season.seasonNumber > -1)
+ this.seasonName = Entertainment.Formatters.formatTVSeasonNumberInt(season.seasonNumber, false) || String.empty;
+ var count = 0;
+ if (this._model.episodes)
+ count = this._model.episodes.length;
+ if (count >= 0)
+ this.episodeCount = Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_TV_EPISODES_LABEL_PLURAL, count).format(count);
+ this.network = season.networks ? Entertainment.Formatters.formatGenresListNonConverter(season.networks) : String.empty;
+ if (episode && episode.seasonNumber === season.seasonNumber) {
+ this.title = String.load(String.id.IDS_VIDEO_LX_DETAILS_HEADER_EPISODE_TITLE).format(episode.episodeNumber, episode.name);
+ this.subTitle = String.load(String.id.IDS_VIDEO_LX_DETAILS_HEADER_SERIES_SEASON_SUBTITLE).format(series.name, season.name);
+ this.description = episode.description
+ }
+ else {
+ this.title = series.name;
+ this.subTitle = season.name;
+ this.description = season.description
+ }
+ };
+ TvDetailsViewModel.prototype._refreshPurchaseDetailsString = function(stateInfo) {
+ var season = this.season;
+ if (!season)
+ return;
+ var purchaseDetails = String.empty;
+ if (!season.isComplete) {
+ var entireSeasonIsOwned = stateInfo.marketplace.hasPurchasedSeason;
+ if (!entireSeasonIsOwned) {
+ var bestFreeRight = ViewModels.VideoSmartBuyStateEngine.getBestFreeSeasonRight(season);
+ var seasonPassOffer = ViewModels.VideoSmartBuyStateEngine.getDefaultSeasonBuyOffer(season, Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd, String.empty);
+ if (!!seasonPassOffer && !bestFreeRight)
+ purchaseDetails = String.load(String.id.IDS_VIDEO_SEASON_PASS_EXPLANATION)
+ }
+ }
+ this.mediaItemPurchaseDetails = purchaseDetails
+ };
+ TvDetailsViewModel.prototype._getMediaItemForProviderDetails = function() {
+ return (this.season && this.season.firstEpisode)
+ };
+ TvDetailsViewModel.prototype._reloadFilteredModules = function(){};
+ TvDetailsViewModel.prototype._updateFilterDetails = function(){};
+ TvDetailsViewModel.prototype._onButtonsChanged = function() {
+ if (this.disposed)
+ return;
+ if (this._episodeSmartBuyStateEngine) {
+ this.episodePrimaryHeaderButtons = this._episodeSmartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.TvDetailsActionLocations.primaryHeader);
+ this.episodeSecondaryHeaderButtons = this._episodeSmartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.TvDetailsActionLocations.secondaryHeader)
+ }
+ if (this._smartBuyStateEngine) {
+ this.seasonPrimaryHeaderButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.TvDetailsActionLocations.primaryHeader);
+ this.seasonSecondaryHeaderButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.TvDetailsActionLocations.secondaryHeader)
+ }
+ this._refreshHeaderButtons()
+ };
+ TvDetailsViewModel.prototype._updateButtonList = function(oldButtonListName, newButtonList) {
+ this._clearHeaderButtonChangeListener(this[oldButtonListName]);
+ this[oldButtonListName] = newButtonList;
+ this._addHeaderButtonChangeListener(newButtonList)
+ };
+ TvDetailsViewModel.prototype._addHeaderButtonChangeListener = function(buttonList) {
+ if (buttonList)
+ buttonList.addChangeListener(this._refreshHeaderButtons)
+ };
+ TvDetailsViewModel.prototype._clearHeaderButtonChangeListener = function(buttonList) {
+ if (buttonList)
+ buttonList.removeChangeListener(this._refreshHeaderButtons)
+ };
+ TvDetailsViewModel.prototype._disposeEpisodeSmartBuyStateEngine = function() {
+ this._clearHeaderButtonChangeListener(this.episodePrimaryHeaderButtons);
+ this._clearHeaderButtonChangeListener(this.episodeSecondaryHeaderButtons);
+ if (this._episodeSmartBuyStateEngineBinding) {
+ this._episodeSmartBuyStateEngineBinding.cancel();
+ this._episodeSmartBuyStateEngineBinding = null
+ }
+ if (this._episodeSmartBuyStateEngine) {
+ this._episodeSmartBuyStateEngine.unload();
+ this._episodeSmartBuyStateEngine = null
+ }
+ };
+ TvDetailsViewModel.prototype._findNextPromotedEpisode = function(selectedSeason) {
+ var _this = this;
+ if (!this._model)
+ return;
+ if (this._findNextPromotedEpisodePromise) {
+ this._findNextPromotedEpisodePromise.cancel();
+ this._findNextPromotedEpisodePromise = null
+ }
+ this._findNextPromotedEpisodePromise = WinJS.Promise.timeout(1000).then(function() {
+ return _this._model.findNextEpisode(selectedSeason)
+ })
+ };
+ TvDetailsViewModel.prototype._mediaRightChanged = function(serviceMediaId) {
+ var _this = this;
+ if (this.disposed)
+ return;
+ ViewModels.SmartBuyStateEngine.mediaContainsServiceMediaIdAsync(this.season, serviceMediaId).done(function(containsServiceId) {
+ return (containsServiceId && _this.season.seasonNumber && _this._findNextPromotedEpisode(_this.season))
+ })
+ };
+ TvDetailsViewModel.prototype._refreshHeaderButtons = function() {
+ var _this = this;
+ this.primaryHeaderButtons.clear();
+ this.secondaryHeaderButtons.clear();
+ if (this._episodeSmartBuyStateEngine) {
+ if (this.episodePrimaryHeaderButtons)
+ this.episodePrimaryHeaderButtons.forEach(function(button) {
+ return _this.primaryHeaderButtons.push(button)
+ });
+ if (this.episodeSecondaryHeaderButtons)
+ this.episodeSecondaryHeaderButtons.forEach(function(button) {
+ return _this.secondaryHeaderButtons.push(button)
+ })
+ }
+ if (this._smartBuyStateEngine) {
+ if (this.seasonPrimaryHeaderButtons)
+ this.seasonPrimaryHeaderButtons.forEach(function(button) {
+ return _this.primaryHeaderButtons.push(button)
+ });
+ if (!this._episodeSmartBuyStateEngine && this.seasonSecondaryHeaderButtons)
+ this.seasonSecondaryHeaderButtons.forEach(function(button) {
+ return _this.secondaryHeaderButtons.push(button)
+ })
+ }
+ };
+ return TvDetailsViewModel
+ })(ViewModels.VideoDetailsViewModelBase);
+ ViewModels.TvDetailsViewModel = TvDetailsViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/components/video/metacriticreview.js:513 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels.Video");
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.ViewModels.Video.assert(MS.Entertainment.appMode !== undefined, "File was loaded in startup path, this make slow down perf since we are creating a config object");
+ WinJS.Namespace.define("MS.Entertainment.ViewModels.Video", {metaCriticTemplate: MS.Entertainment.Utilities.isVideoApp1 ? "/Components/Video_win/TVDetails.html#metaCriticTemplate" : "/Components/Video2/TvDetailsPage.html#metaCriticTemplate"});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MetaCriticControl: MS.Entertainment.UI.Framework.defineUserControl(MS.Entertainment.ViewModels.Video.metaCriticTemplate, function MetaCriticControl(element) {
+ this.clickHandlerWithContext = WinJS.Utilities.markSupportedForProcessing(this._onClick.bind(this))
+ }, {
+ controlName: "MetaCriticControl", allowAnimations: false, voicePhrase: "metacritic", clickHandlerWithContext: null, _metaCriticScoreDomElement: null, _mediaItemBindings: null, initialize: function initialize() {
+ this._mediaItemBindings = WinJS.Binding.bind(this, {mediaItem: this._onMediaItemChanded.bind(this)})
+ }, unload: function unload() {
+ if (this._mediaItemBindings) {
+ this._mediaItemBindings.cancel();
+ this._mediaItemBindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _onMediaItemChanded: function _onMediaItemChanded() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ this.visible = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.metaCritic) && this.mediaItem && this.mediaItem.criticReview && this.mediaItem.criticReview.reviewScore >= 0);
+ if (this.visible) {
+ this._updateColor = this._updateColor.bind(this);
+ this._onClick = this._onClick.bind(this);
+ this._updateColor()
+ }
+ this._setControlFocusability()
+ }, _setControlFocusability: function _setControlFocusability() {
+ if (!this._metaCriticControl)
+ return;
+ if (this.visible && MS.Entertainment.Utilities.isApp1) {
+ WinJS.Utilities.addClass(this._metaCriticControl, "win-focusable");
+ WinJS.Utilities.addClass(this._metaCriticControl, "acc-keyboardFocusTarget")
+ }
+ }, _onKeyDown: function _onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space || event.keyCode === WinJS.Utilities.Key.invokeButton)
+ this._onClick()
+ }, _onClick: function onClick() {
+ if (this.mediaItem && this.mediaItem.criticReview && this.mediaItem.criticReview.url && MS.Entertainment.Utilities.verifyUrl(this.mediaItem.criticReview.url))
+ Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(this.mediaItem.criticReview.url))
+ }, _updateColor: function updateColor() {
+ if (this.mediaItem && this.mediaItem.criticReview && this.mediaItem.criticReview.reviewScore >= 0 && this._metaCriticScoreDomElement) {
+ WinJS.Utilities.removeClass(this._metaCriticScoreDomElement, "metaCritic-red");
+ WinJS.Utilities.removeClass(this._metaCriticScoreDomElement, "metaCritic-yellow");
+ WinJS.Utilities.removeClass(this._metaCriticScoreDomElement, "metaCritic-green");
+ if (this.mediaItem.criticReview.reviewScore < 40)
+ WinJS.Utilities.addClass(this._metaCriticScoreDomElement, "metaCritic-red");
+ else if (this.mediaItem.criticReview.reviewScore < 61)
+ WinJS.Utilities.addClass(this._metaCriticScoreDomElement, "metaCritic-yellow");
+ else if (this.mediaItem.criticReview.reviewScore <= 100)
+ WinJS.Utilities.addClass(this._metaCriticScoreDomElement, "metaCritic-green")
+ }
+ }
+ }, {
+ visible: false, mediaItem: null
+ })})
+})()
+})();
+/* >>>>>>/components/video/episodeprogressionhelper.js:574 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(Components) {
+ (function(Video) {
+ var EpisodeProgressionHelper = (function() {
+ function EpisodeProgressionHelper(series) {
+ this._series = series;
+ if (!this._series)
+ Trace.fail("No series provided")
+ }
+ EpisodeProgressionHelper.prototype.findNextEpisode = function(selectedSeason, lastWatchedEpisode) {
+ var _this = this;
+ if (!this._series) {
+ Trace.fail("No series provided");
+ return null
+ }
+ return this._hydrateModel(this._series, selectedSeason).then(function(hydrateResults) {
+ _this._series = hydrateResults.series;
+ selectedSeason = hydrateResults.season;
+ return _this._findNextEpisode(selectedSeason, lastWatchedEpisode)
+ }).then(function() {
+ return _this._hydrateModel(_this._series, _this._season, _this._episode)
+ })
+ };
+ EpisodeProgressionHelper.prototype._findNextEpisode = function(selectedSeason, lastWatchedEpisode) {
+ var _this = this;
+ var useBookmark = !lastWatchedEpisode;
+ var libraryEpisodesPromise = WinJS.Promise.wrap();
+ var lastWatchedPromise;
+ libraryEpisodesPromise = EpisodeProgressionHelper.getLibraryEpisodes(this._series).then(function(episodes) {
+ return WinJS.Promise.wrap(episodes)
+ }, function() {
+ return WinJS.Promise.wrap(null)
+ });
+ if (useBookmark)
+ lastWatchedPromise = this._getLastWatchedBookmark().then(function(bookmark) {
+ return WinJS.Promise.wrap(bookmark)
+ }, function() {
+ return WinJS.Promise.wrap(null)
+ });
+ return WinJS.Promise.join({
+ libraryEpisodes: libraryEpisodesPromise, lastWatchedEpisodeBookmark: lastWatchedPromise
+ }).then(function(results) {
+ if (!results)
+ return WinJS.Promise.wrapError("No results from previous Promise");
+ var lastWatchedEpisodeBookmark = results.lastWatchedEpisodeBookmark;
+ var libraryEpisodes = results.libraryEpisodes;
+ var foundLastWatchedEpisode = false;
+ var lastWatchedSeasonNumber = null;
+ var lastWatchedEpisodeNumber = null;
+ var lastWatchedEpisodeLibraryId = -1;
+ var lastWatchedComplete = false;
+ var minWatchedPercentage = 0.95;
+ if (!selectedSeason && !libraryEpisodes)
+ if (_this._series && _this._series.seasons)
+ return _this._series.seasons.toArrayAll().then(function(seasons) {
+ _this._season = (seasons[seasons.length - 1]);
+ return WinJS.Promise.wrap(_this._season)
+ });
+ if (lastWatchedEpisode) {
+ foundLastWatchedEpisode = true;
+ lastWatchedSeasonNumber = lastWatchedEpisode.seasonNumber;
+ lastWatchedEpisodeNumber = lastWatchedEpisode.episodeNumber;
+ lastWatchedEpisodeLibraryId = lastWatchedEpisode.libraryId;
+ lastWatchedComplete = true
+ }
+ else if (lastWatchedEpisodeBookmark) {
+ foundLastWatchedEpisode = true;
+ lastWatchedSeasonNumber = lastWatchedEpisodeBookmark.tvSeasonNumber;
+ lastWatchedEpisodeNumber = lastWatchedEpisodeBookmark.tvEpisodeNumber;
+ lastWatchedEpisodeLibraryId = lastWatchedEpisodeBookmark.tvEpisodeId;
+ var lastPosition = lastWatchedEpisodeBookmark.tvEpisodeBookmark;
+ var duration = lastWatchedEpisodeBookmark.tvEpisodeDuration;
+ if (lastPosition > 0)
+ lastWatchedComplete = ((lastPosition / duration) > minWatchedPercentage);
+ else
+ lastWatchedComplete = lastWatchedEpisodeBookmark.hasPlayed
+ }
+ var seasonHydrationPromise = WinJS.Promise.wrap();
+ var nextEpisodeNumber = -1;
+ var currentEpisode = null;
+ var nextEpisode = null;
+ if (libraryEpisodes && !foundLastWatchedEpisode) {
+ for (var x = 0; x < libraryEpisodes.length; x++)
+ if (libraryEpisodes[x].episodeNumber > 0 && libraryEpisodes[x].seasonNumber > 0) {
+ _this._episode = libraryEpisodes[x];
+ break
+ }
+ }
+ else if (libraryEpisodes) {
+ var useNextEpisode = false;
+ var nextEpisodeByNumber = null;
+ var nextEpisodeByPosition = null;
+ nextEpisodeNumber = (lastWatchedEpisodeNumber + 1);
+ for (var x = 0; x < libraryEpisodes.length; x++) {
+ if (lastWatchedEpisodeLibraryId === libraryEpisodes[x].libraryId) {
+ currentEpisode = libraryEpisodes[x];
+ useNextEpisode = true
+ }
+ if (useNextEpisode && !nextEpisodeByPosition && lastWatchedEpisodeNumber === libraryEpisodes[x].episodeNumber && lastWatchedSeasonNumber === libraryEpisodes[x].seasonNumber && lastWatchedEpisodeLibraryId !== libraryEpisodes[x].libraryId)
+ nextEpisodeByPosition = libraryEpisodes[x];
+ if (nextEpisodeNumber === libraryEpisodes[x].episodeNumber && lastWatchedSeasonNumber === libraryEpisodes[x].seasonNumber) {
+ nextEpisodeByNumber = libraryEpisodes[x];
+ break
+ }
+ }
+ nextEpisode = nextEpisodeByNumber || nextEpisodeByPosition;
+ if (!lastWatchedComplete && currentEpisode)
+ _this._episode = currentEpisode;
+ else if (lastWatchedComplete && nextEpisode)
+ _this._episode = nextEpisode;
+ else if (lastWatchedComplete && _this._series && _this._series.seasons) {
+ var jumpToNextSeason = false;
+ _this._series.seasons.toArrayAll().then(function(seasons) {
+ for (var x = 0; x < seasons.length; x++) {
+ var currentSeason = seasons[x];
+ if (jumpToNextSeason) {
+ nextEpisodeNumber = 1;
+ seasonHydrationPromise = currentSeason.refresh();
+ break
+ }
+ else if (lastWatchedSeasonNumber === currentSeason.seasonNumber)
+ if (lastWatchedEpisodeNumber === currentSeason.latestEpisode) {
+ jumpToNextSeason = true;
+ seasonHydrationPromise = currentSeason.refresh()
+ }
+ else if (nextEpisodeNumber <= currentSeason.latestEpisode) {
+ seasonHydrationPromise = currentSeason.refresh();
+ break
+ }
+ }
+ })
+ }
+ }
+ return seasonHydrationPromise.then(function(season) {
+ if (season && season.episodes)
+ season.episodes.toArrayAll().then(function(episodes) {
+ for (var x = 0; x < episodes.length; x++)
+ if (nextEpisodeNumber === episodes[x].episodeNumber) {
+ _this._episode = episodes[x];
+ break
+ }
+ if (!_this._episode)
+ _this._episode = currentEpisode
+ });
+ var seasons = null;
+ if (_this._series)
+ if (_this._series.seasons && _this._series.seasons.count > 0)
+ seasons = _this._series.seasons;
+ else
+ seasons = _this._series.librarySeasons;
+ Trace.assert(seasons && seasons.count, ("No seasons found for this series! " + "Series: Name {0}, CanonicalID {1}").format(_this._series.name, _this._series.canonicalId));
+ if (seasons)
+ return seasons.toArrayAll().then(function(seasons) {
+ if (selectedSeason)
+ for (var x = 0; x < seasons.length; x++)
+ if (selectedSeason.seasonNumber === seasons[x].seasonNumber) {
+ _this._season = seasons[x];
+ return WinJS.Promise.wrap(_this._season)
+ }
+ for (var x = 0; x < seasons.length; x++)
+ if (_this._episode && _this._episode.seasonNumber === seasons[x].seasonNumber) {
+ _this._season = seasons[x];
+ return WinJS.Promise.wrap(_this._season)
+ }
+ if (seasons.length > 0) {
+ _this._season = seasons[seasons.length - 1];
+ return WinJS.Promise.wrap(_this._season)
+ }
+ });
+ Trace.assert(_this._season, ("No season found for this series! " + "Series: Name {0}, CanonicalID {1}").format(_this._series.name, _this._series.canonicalId))
+ });
+ return WinJS.Promise.wrap(_this._season)
+ })
+ };
+ EpisodeProgressionHelper.prototype._getLastWatchedBookmark = function() {
+ if (!this._series || this._series.libraryId === undefined || this._series.libraryId === -1)
+ return WinJS.Promise.wrap(null);
+ var findSeriesZuneIdPromise = WinJS.Promise.wrap(this._series.zuneId);
+ if (!this._series.hasZuneId && this._series.librarySeasons)
+ findSeriesZuneIdPromise = this._series.librarySeasons.toArrayAll().then(function(sortedLibrarySeasons) {
+ for (var x = 0; x < sortedLibrarySeasons.length; x++)
+ if (!MS.Entertainment.Utilities.isEmptyGuid(sortedLibrarySeasons[x].seriesZuneId))
+ return WinJS.Promise.wrap(sortedLibrarySeasons[x].seriesZuneId)
+ });
+ var pendingBookmarkWriteOperations;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.bookmarkOperationsWatcher)) {
+ var bookmarkWatcher = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.bookmarkOperationsWatcher);
+ pendingBookmarkWriteOperations = bookmarkWatcher.waitForPendingOperations()
+ }
+ return WinJS.Promise.join({
+ zuneId: findSeriesZuneIdPromise, pendingBookmarkWriteOperations: WinJS.Promise.as(pendingBookmarkWriteOperations)
+ }).then(function(results) {
+ var zuneId = results && results.zuneId;
+ if (MS.Entertainment.Utilities.isEmptyGuid(zuneId))
+ return WinJS.Promise.wrap(null);
+ var ms = new Microsoft.Entertainment.Platform.MediaStore;
+ return ms.videoProvider.getLastWatchedEpisodeForSeriesAsync(zuneId)
+ }).then(function(bookmark) {
+ if (bookmark && bookmark.tvEpisodeId >= 0)
+ return WinJS.Promise.wrap(bookmark);
+ else
+ return WinJS.Promise.wrap(null)
+ }, function() {
+ return WinJS.Promise.wrap(null)
+ })
+ };
+ EpisodeProgressionHelper.prototype._hydrateModel = function(series, season, episode) {
+ var seriesHydrate;
+ if (series && series.hydrate && !series.hydrated)
+ seriesHydrate = series.hydrate();
+ else
+ seriesHydrate = WinJS.Promise.as(series);
+ var seasonHydrate;
+ if (season && season.hydrate && !season.hydrated)
+ seasonHydrate = season.hydrate();
+ else
+ seasonHydrate = WinJS.Promise.as(season);
+ var episodeHydrate;
+ if (episode && episode.hydrate && !episode.hydrated)
+ episodeHydrate = episode.hydrate();
+ else
+ episodeHydrate = WinJS.Promise.as(episode);
+ return WinJS.Promise.join({
+ series: seriesHydrate, season: seasonHydrate, episode: episodeHydrate
+ })
+ };
+ EpisodeProgressionHelper.getLibraryEpisodes = function(series) {
+ if (!series)
+ return WinJS.Promise.wrap(null);
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(series).then(function() {
+ if (!series || series.libraryId === -1)
+ return WinJS.Promise.wrap(null);
+ var query = new MS.Entertainment.Data.Query.libraryVideoTV;
+ query.seriesId = series.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.VideosSortBy.seriesTitleSeasonNumberEpisodeNumber;
+ query.isLive = false;
+ query.chunkSize = 1000;
+ return query.getItemsArrayAndIgnoreErrors()
+ })
+ };
+ return EpisodeProgressionHelper
+ })();
+ Video.EpisodeProgressionHelper = EpisodeProgressionHelper
+ })(Components.Video || (Components.Video = {}));
+ var Video = Components.Video
+ })(Entertainment.Components || (Entertainment.Components = {}));
+ var Components = Entertainment.Components
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/controls/video_win/tvdetails.js:830 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var TvDetails = (function(_super) {
+ __extends(TvDetails, _super);
+ function TvDetails(element, options) {
+ _super.call(this, element, options);
+ this._displayedSeason = null;
+ MS.Entertainment.UI.Framework.processDeclarativeControlContainer(this);
+ this._viewModelBindings = new Array;
+ this._viewModelBindings.push(WinJS.Binding.bind(this, {dataContext: {season: this._onTvSeasonChanged.bind(this)}}))
+ }
+ TvDetails.prototype.dispose = function() {
+ if (this._viewModelBindings) {
+ this._viewModelBindings.forEach(function(binding) {
+ return binding.cancel()
+ });
+ this._viewModelBindings = null
+ }
+ _super.prototype.dispose.call(this)
+ };
+ TvDetails.prototype.onFooterLinkClicked = function(event) {
+ var foundElement = this.domElement.querySelector(".videoDetails-footer");
+ if (foundElement && MS.Entertainment.Utilities.isInvocationEvent(event))
+ foundElement.scrollIntoView()
+ };
+ TvDetails.prototype._onTvSeasonChanged = function() {
+ var newSeason = this.dataContext && this.dataContext.season;
+ if (newSeason && this._displayedSeason && (newSeason !== this._displayedSeason)) {
+ var foundElement = document.querySelector(".nav-currentPage .header-backButton");
+ if (foundElement)
+ foundElement.scrollIntoView()
+ }
+ this._displayedSeason = newSeason
+ };
+ TvDetails.isDeclarativeControlContainer = true;
+ TvDetails.tvSeasonItemSize = 160;
+ return TvDetails
+ })(Controls.PageViewBase);
+ Controls.TvDetails = TvDetails
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.TvDetails)
+})();
diff --git a/packages/microsoft.zunevideo/TvStore_merged.js b/packages/microsoft.zunevideo/TvStore_merged.js
new file mode 100644
index 00000000..c4e63bc6
--- /dev/null
+++ b/packages/microsoft.zunevideo/TvStore_merged.js
@@ -0,0 +1,148 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/viewmodels/video_win/tvstorehubviewmodel.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(TvStoreHubModuleKeys) {
+ TvStoreHubModuleKeys[TvStoreHubModuleKeys["heroModule"] = 0] = "heroModule";
+ TvStoreHubModuleKeys[TvStoreHubModuleKeys["newTv"] = 1] = "newTv";
+ TvStoreHubModuleKeys[TvStoreHubModuleKeys["featuredTv"] = 2] = "featuredTv";
+ TvStoreHubModuleKeys[TvStoreHubModuleKeys["lastNightTv"] = 3] = "lastNightTv";
+ TvStoreHubModuleKeys[TvStoreHubModuleKeys["featuredSets"] = 4] = "featuredSets";
+ TvStoreHubModuleKeys[TvStoreHubModuleKeys["topSellingTv"] = 5] = "topSellingTv"
+ })(ViewModels.TvStoreHubModuleKeys || (ViewModels.TvStoreHubModuleKeys = {}));
+ var TvStoreHubModuleKeys = ViewModels.TvStoreHubModuleKeys;
+ var TvStoreHubViewModel = (function(_super) {
+ __extends(TvStoreHubViewModel, _super);
+ function TvStoreHubViewModel() {
+ _super.apply(this, arguments)
+ }
+ Object.defineProperty(TvStoreHubViewModel.prototype, "heroModule", {
+ get: function() {
+ return this.modules[0]
+ }, set: function(value) {
+ this._updateModuleAndNotify(0, "heroModule", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvStoreHubViewModel.prototype, "newTv", {
+ get: function() {
+ return this.modules[1]
+ }, set: function(value) {
+ this._updateModuleAndNotify(1, "newTv", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvStoreHubViewModel.prototype, "featuredTv", {
+ get: function() {
+ return this.modules[2]
+ }, set: function(value) {
+ this._updateModuleAndNotify(2, "featuredTv", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvStoreHubViewModel.prototype, "lastNightTv", {
+ get: function() {
+ return this.modules[3]
+ }, set: function(value) {
+ this._updateModuleAndNotify(3, "lastNightTv", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvStoreHubViewModel.prototype, "featuredSets", {
+ get: function() {
+ return this.modules[4]
+ }, set: function(value) {
+ this._updateModuleAndNotify(4, "featuredSets", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(TvStoreHubViewModel.prototype, "topSellingTv", {
+ get: function() {
+ return this.modules[5]
+ }, set: function(value) {
+ this._updateModuleAndNotify(5, "topSellingTv", value)
+ }, enumerable: true, configurable: true
+ });
+ TvStoreHubViewModel.prototype._initializeModules = function() {
+ this.modules = [ViewModels.VideoModuleFactory.createTVHeroModule(), ViewModels.VideoModuleFactory.createNewTvSeriesModule(), ViewModels.VideoModuleFactory.createFeaturedTvSeriesModule(), ViewModels.VideoModuleFactory.createLastNightTvModule(), ViewModels.VideoModuleFactory.createTvFeaturedSetsModule(), ViewModels.VideoModuleFactory.createTopSellingTvModule()];
+ this._primaryModule = this.newTv;
+ this._secondaryModule = this.featuredTv;
+ this._tertiaryModules = [this.lastNightTv, this.featuredSets, this.topSellingTv]
+ };
+ return TvStoreHubViewModel
+ })(ViewModels.VideoStoreHubViewModelBase);
+ ViewModels.TvStoreHubViewModel = TvStoreHubViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/controls/video_win/tvstorehub.js:91 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var TvStoreHub = (function(_super) {
+ __extends(TvStoreHub, _super);
+ function TvStoreHub(element, options) {
+ _super.call(this, element, options);
+ this.loadModulesImmediately = true;
+ MS.Entertainment.UI.Framework.processDeclarativeControlContainer(this)
+ }
+ TvStoreHub.prototype.onHeroCarouselInvoke = function(event) {
+ if (!MS.Entertainment.Utilities.isInvocationEvent(event))
+ return;
+ if (event.srcElement && !WinJS.Utilities.hasClass(event.srcElement, "win-navbutton"))
+ if (this._heroCarousel && this._heroCarousel.dataSource) {
+ var item = this._heroCarousel.dataSource[this._heroCarousel.currentFlipViewPage];
+ this.invokeModuleAction(item)
+ }
+ };
+ TvStoreHub.prototype.onModuleItemClicked = function(event) {
+ if (!MS.Entertainment.Utilities.isInvocationEvent(event))
+ return;
+ if (!MS.Entertainment.UI.NetworkStatusService.isOnline()) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ else
+ _super.prototype.onModuleItemClicked.call(this, event)
+ };
+ TvStoreHub.isDeclarativeControlContainer = true;
+ TvStoreHub.tvItemSize = 160;
+ return TvStoreHub
+ })(Controls.PageViewBase);
+ Controls.TvStoreHub = TvStoreHub
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.TvStoreHub)
+})();
diff --git a/packages/microsoft.zunevideo/UpdateApp.js b/packages/microsoft.zunevideo/UpdateApp.js
new file mode 100644
index 00000000..cb71736f
--- /dev/null
+++ b/packages/microsoft.zunevideo/UpdateApp.js
@@ -0,0 +1,12 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Application", {updatePage: function updatePage() {
+ updateAppTitle.textContent = WinJS.Resources.getString('IDS_VERSION_CHECK_UPGRADE_CAPTION').value;
+ updateAppDescription.textContent = WinJS.Resources.getString('IDS_VERSION_CHECK_UPGRADE_TEXT').value;
+ launchStoreLink.textContent = WinJS.Resources.getString('IDS_VERSION_CHECK_UPGRADE_LINK').value;
+ var launchInfo = "ms-windows-store:Updates";
+ launchStoreLink.href = launchInfo;
+ window.sessionStorage.setItem("HardBlockEnabled", "true")
+ }})
+})()
diff --git a/packages/microsoft.zunevideo/Version.json b/packages/microsoft.zunevideo/Version.json
new file mode 100644
index 00000000..e2398271
--- /dev/null
+++ b/packages/microsoft.zunevideo/Version.json
@@ -0,0 +1 @@
+{ "version": "2.6.446.0", "branch": "wec_main_release_v8.1_video", "isFreeBuild": 1, "architecture": "x86", "systemVersion": "6.3.0.0" }
diff --git a/packages/microsoft.zunevideo/VideoCollection_merged.js b/packages/microsoft.zunevideo/VideoCollection_merged.js
new file mode 100644
index 00000000..83f3ffea
--- /dev/null
+++ b/packages/microsoft.zunevideo/VideoCollection_merged.js
@@ -0,0 +1,1069 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/framework/shell.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Shell");
+ WinJS.Namespace.define("MS.Entertainment.UI.Shell", {
+ showDialog: function showDialog(title, userControl, options) {
+ if (!title)
+ throw"showDialog: title parameter is mandatory";
+ if (!userControl)
+ throw"showDialog: userControl parameter is mandatory";
+ options = options ? options : {};
+ options.title = title;
+ options.userControl = userControl;
+ var dialogElement = document.createElement("div");
+ dialogElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.Dialog");
+ var dialog = new MS.Entertainment.UI.Controls.Dialog(dialogElement, options);
+ return dialog.show()
+ }, createOverlay: function createOverlay(userControl, userControlOptions, overlayOptions) {
+ var options = overlayOptions || {};
+ options.userControl = userControl;
+ options.userControlOptions = userControlOptions;
+ var overlayElement = document.createElement("div");
+ overlayElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.Overlay");
+ return new MS.Entertainment.UI.Controls.Overlay(overlayElement, options)
+ }, showMessageBox: function showMessageBox(title, description, options) {
+ if (!title)
+ throw"showMessageBox: title parameter is mandatory";
+ if (!description)
+ throw"showMessageBox: description parameter is mandatory";
+ options = options ? options : {};
+ options.userControlOptions = {description: description};
+ return MS.Entertainment.UI.Shell.showDialog(title, "MS.Entertainment.UI.Controls.MessageBox", options)
+ }, showMessageLinkBox: function showMessageLinkBox(title, description, webLink) {
+ if (!title)
+ throw"showMessageLinkBox: title parameter is mandatory";
+ if (!description)
+ throw"showMessageLinkBox: description parameter is mandatory";
+ if (!webLink)
+ throw"showMessageLinkBox: webLink parameter is mandatory";
+ var options = {};
+ options.userControlOptions = {
+ description: description, webLink: webLink
+ };
+ return MS.Entertainment.UI.Shell.showDialog(title, "MS.Entertainment.UI.Controls.MessageLinkBox", options)
+ }, showFeedbackDialog: function showFeedbackDialog() {
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_SETTINGS_FEEDBACK_TITLE), "MS.Entertainment.UI.Controls.UserFeedbackDialog", {
+ width: null, height: null, buttons: [], customStyle: "wecDialog_feedback", persistOnNavigate: true
+ })
+ }, showRegionMismatchDialog: function showRegionMismatchDialog(title, description) {
+ if (description.indexOf("{0}") < 0 || description.indexOf("{1}") < 0) {
+ MS.Entertainment.UI.Shell.fail("showRegionMismatchDialog requires two string placeholders in description to function properly");
+ return WinJS.Promise.wrapError()
+ }
+ var appRegionCode = (new Microsoft.Entertainment.Util.GlobalizationManager).getRegion();
+ var machineRegionCode = (new Windows.Globalization.GeographicRegion).codeTwoLetter;
+ var appRegionName = (new Windows.Globalization.GeographicRegion(appRegionCode)).displayName;
+ var machineRegionName = (new Windows.Globalization.GeographicRegion(machineRegionCode)).displayName;
+ var regionUnavailableDescription = description.format(appRegionName, machineRegionName);
+ return MS.Entertainment.UI.Shell.showMessageBox(title, regionUnavailableDescription).then(function completed() {
+ return {
+ appRegionCode: appRegionCode, machineRegionCode: machineRegionCode
+ }
+ })
+ }, navigateBackAndShowMessageBox: function navigateBackAndShowMessageBox(title, description) {
+ Trace.assert(title, "navigateBackAndShowMessageBox: title is null or undefined");
+ Trace.assert(description, "navigateBackAndShowMessageBox: description is null or undefined");
+ var promise;
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiState.isSnapped && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation))
+ promise = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation).navigateToDefault();
+ else
+ promise = MS.Entertainment.UI.Shell.showMessageBox(title, description).then(function() {
+ var navigateBackPromise;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation))
+ navigateBackPromise = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation).navigateBack();
+ return WinJS.Promise.as(navigateBackPromise)
+ });
+ return WinJS.Promise.as(promise)
+ }, showAppUpdateDialog: function showAppUpdateDialog() {
+ var cancelConfirmDialogButtons = [{
+ title: String.load(String.id.IDS_VERSION_CHECK_UPGRADE_LINK), execute: function onOk(overlay) {
+ MS.Entertainment.Utilities.launchStoreUpdatePage();
+ overlay.hide()
+ }
+ }, {
+ title: String.load(String.id.IDS_CANCEL_BUTTON), execute: function onCancel(overlay) {
+ overlay.hide()
+ }
+ }];
+ return MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_VERSION_CHECK_SERVICE_TITLE), String.load(String.id.IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT), {
+ buttons: cancelConfirmDialogButtons, defaultButtonIndex: 0, cancelButtonIndex: 1
+ })
+ }, showWebHostDialog: function showWebHostDialog(title, dialogOptions, userControlOptions) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride && userControlOptions.offer)
+ return MS.Entertainment.UI.Shell.ModernWebBlend.showModernPurchaseFlowAsync(userControlOptions.offer);
+ else {
+ var buttons = [];
+ dialogOptions.title = title;
+ userControlOptions.title = title;
+ dialogOptions.userControlOptions = userControlOptions;
+ dialogOptions.buttons = buttons;
+ dialogOptions.defaultButtonIndex = -1;
+ var webHostDialogElement = document.createElement("div");
+ webHostDialogElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.WebHostDialog");
+ var dialog = new MS.Entertainment.UI.Controls.WebHostDialog(webHostDialogElement, dialogOptions);
+ return dialog.show()
+ }
+ }, uiStateEventShowSearchFlyoutHandler: null, showSearchFlyout: function showSearchFlyout() {
+ if (MS.Entertainment.UI.Shell.uiStateEventShowSearchFlyoutHandler) {
+ MS.Entertainment.UI.Shell.uiStateEventShowSearchFlyoutHandler.cancel();
+ MS.Entertainment.UI.Shell.uiStateEventShowSearchFlyoutHandler = null
+ }
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.stageThreeActivated)
+ if (!Windows.ApplicationModel.Search.Core) {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithUIPath(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchGlyphClick);
+ var searchAction = new MS.Entertainment.UI.Actions.SearchAction;
+ return searchAction.execute()
+ }
+ else {
+ var height = "100px";
+ var bottom = "auto";
+ var template = "MS.Entertainment.UI.Controls.SearchFlyout";
+ var _centeredStyle = "calc(50% - {0}px)";
+ var top = _centeredStyle.format(parseInt(height) / 2);
+ var overlayOptions = {
+ left: "20%", bottom: bottom, right: "20%", top: top, dontWaitForContent: true, enableKeyboardLightDismiss: true
+ };
+ var openPopup = MS.Entertainment.UI.Shell.createOverlay(template, {}, overlayOptions);
+ return openPopup.show()
+ }
+ else
+ MS.Entertainment.UI.Shell.uiStateEventShowSearchFlyoutHandler = MS.Entertainment.Utilities.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {stageThreeActivatedChanged: function stageThreeActivatedChanged(e) {
+ if (e.detail.newValue)
+ MS.Entertainment.UI.Shell.showSearchFlyout()
+ }.bind(this)})
+ }, showError: (function() {
+ var _displayedErrors = [];
+ var displayError = function displayError(caption, description, errorCode, webUrlPromise, subTitle, additionalButton) {
+ var errorId = description;
+ if (errorCode)
+ errorId = errorCode;
+ var isErrorDisplayed = false;
+ for (var i = 0; i < _displayedErrors.length; i++)
+ if (_displayedErrors[i] === errorId) {
+ isErrorDisplayed = true;
+ break
+ }
+ if (!isErrorDisplayed) {
+ _displayedErrors.push(errorId);
+ var bottomRowAdditionalText = MS.Entertainment.Utilities.isApp2 ? String.empty : errorCode;
+ var options = {
+ description: description, errorCode: errorCode, webLinkPromise: webUrlPromise, subTitle: subTitle ? subTitle : String.empty, showLinks: !MS.Entertainment.Utilities.isApp2, showErrorCodeInContent: MS.Entertainment.Utilities.isApp2, additionalButton: additionalButton
+ };
+ return MS.Entertainment.UI.Shell.showDialog(caption, "MS.Entertainment.UI.Controls.ErrorDialog", {
+ buttonRowAdditionalText: bottomRowAdditionalText, userControlOptions: options, persistOnNavigate: true
+ }).then(function() {
+ for (var i = 0; i < _displayedErrors.length; i++)
+ if (_displayedErrors[i] === errorId) {
+ _displayedErrors.splice(i, 1);
+ break
+ }
+ })
+ }
+ else
+ return WinJS.Promise.wrap()
+ };
+ var formatError = function formatError(errorCode, mappedErrorCode, message) {
+ switch (errorCode) {
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_INVALID_REGION:
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var lastAccountRegion = configurationManager.service.lastSignInAccountRegion;
+ if (lastAccountRegion)
+ return message.format((new Windows.Globalization.GeographicRegion(lastAccountRegion)).displayName);
+ else {
+ MS.Entertainment.UI.Shell.assert(false, "lastAccountRegion was not defined");
+ return message
+ }
+ break
+ }
+ {};
+ switch (mappedErrorCode) {
+ case Microsoft.Entertainment.Sync.CollectionSyncError.syncError:
+ return String.load(String.id.IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE);
+ case MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_CANT_PLAYTO.code:
+ return String.load(String.id.IDS_MUSIC_PLAY_TO_STREAMING_ERROR_TEXT);
+ case MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_MEDIA_CANT_PLAYTO_PREMIUM.code:
+ return String.load(String.id.IDS_MUSIC_PLAY_TO_PREMIUM_STREAMING_ERROR_TEXT);
+ case MS.Entertainment.Platform.Playback.Error.ZEST_E_DEVICE_ACTIVATION_LIMIT_EXCEEDED.code:
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay) && !featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSubscription))
+ return String.load(String.id.IDS_ACTIVATION_LIMIT_EXCEEDED_DTO);
+ return message;
+ case MS.Entertainment.Platform.Playback.Error.ZUNE_E_DOWNLOAD_LIBRARY_DISK_FULL.code:
+ case MS.Entertainment.Platform.Playback.Error.ZUNE_E_DOWNLOAD_SYSTEM_DISK_FULL.code:
+ return String.load(String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG);
+ default:
+ return message
+ }
+ };
+ var toHexString = function toHexString(value) {
+ if (value < 0)
+ value += 0xFFFFFFFF + 1;
+ return "0x" + value.toString(16)
+ };
+ return function showError(caption, error, subTitle, postpendedText, additionalButton) {
+ var errorMapper = new Microsoft.Entertainment.Util.ErrorMapper;
+ var mappedError = errorMapper.getMappedError(error);
+ var hexError = toHexString(mappedError.error) + " (" + toHexString(error) + ")";
+ var errorMessage = formatError(error, mappedError.error, mappedError.description);
+ if (postpendedText)
+ errorMessage += ("\n" + postpendedText);
+ var originalErrorQuery = new MS.Entertainment.Data.Query.errorCodeWrapperQuery(error);
+ var mappedErrorQueryPromise = function mappedErrorQueryPromise() {
+ var mappedErrorQuery = new MS.Entertainment.Data.Query.errorCodeWrapperQuery(mappedError.error);
+ return mappedErrorQuery.execute().then(function mappedErrorQueryComplete(query) {
+ if (query && query.result && query.result.exactMatches)
+ return query.result.errorCodeUrl;
+ else
+ return mappedError.webUrl
+ }, function mappedErrorQueryFailed(event) {
+ if (event && event.message === "Canceled") {
+ var networkStatus = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).networkStatus;
+ MS.Entertainment.UI.Shell.fail("Error Code Lookup request canceled. Network status is: " + networkStatus, null, MS.Entertainment.UI.Debug.errorLevel.low)
+ }
+ return mappedError.webUrl
+ })
+ };
+ var errorQuery = originalErrorQuery.execute().then(function originalErrorQueryComplete(query) {
+ if (query && query.result && query.result.exactMatches)
+ return query.result.errorCodeUrl;
+ else
+ return mappedErrorQueryPromise()
+ }, function originalErrorQueryFailed() {
+ return mappedErrorQueryPromise()
+ });
+ return displayError(caption, errorMessage, hexError, errorQuery, subTitle, additionalButton)
+ }
+ })()
+ })
+})()
+})();
+/* >>>>>>/controls/video_win/videocollection.js:248 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var VideoCollectionHeaderControl = (function(_super) {
+ __extends(VideoCollectionHeaderControl, _super);
+ function VideoCollectionHeaderControl(element, options) {
+ _super.call(this, element, options);
+ this._isBackButtonVisible = true;
+ this._videoContextBindings = WinJS.Binding.bind(this, {dataContext: {isChildFolder: this._updateBackButtonVisibility.bind(this)}})
+ }
+ Object.defineProperty(VideoCollectionHeaderControl.prototype, "isBackButtonVisible", {
+ get: function() {
+ return this._isBackButtonVisible
+ }, set: function(value) {
+ this.updateAndNotify("isBackButtonVisible", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoCollectionHeaderControl.prototype, "videoCollectionQueryViewModel", {
+ get: function() {
+ return this.dataContext
+ }, enumerable: true, configurable: true
+ });
+ VideoCollectionHeaderControl.prototype._updateBackButtonVisibility = function() {
+ this.isBackButtonVisible = (this.videoCollectionQueryViewModel ? this.videoCollectionQueryViewModel.isChildFolder : true)
+ };
+ VideoCollectionHeaderControl.prototype.onBackButtonClicked = function(event) {
+ if (!MS.Entertainment.Utilities.isInvocationEvent(event))
+ return;
+ if (this.videoCollectionQueryViewModel && this.videoCollectionQueryViewModel.goToParentFolder)
+ this.videoCollectionQueryViewModel.goToParentFolder()
+ };
+ return VideoCollectionHeaderControl
+ })(MS.Entertainment.UI.Controls.HeaderControl);
+ Controls.VideoCollectionHeaderControl = VideoCollectionHeaderControl
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.VideoCollectionHeaderControl)
+})();
+/* >>>>>>/viewmodels/video_win/videocollectionviewmodel.js:306 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var Data = MS.Entertainment.Data;
+ var UI = MS.Entertainment.UI;
+ (function(VideoCollectionLXTemplates) {
+ var VideoCollectionLXTemplateBase = (function() {
+ function VideoCollectionLXTemplateBase() {
+ this.itemTemplate = "select(.templateid-collectionOtherVerticalTile)";
+ this.layout = UI.Controls.GalleryControl && UI.Controls.GalleryControl.Layout.grid;
+ this.orientation = UI.Controls.GalleryControl && UI.Controls.GalleryControl.Orientation.vertical;
+ this.zoomedOutLayout = UI.Controls.GalleryControl && UI.Controls.GalleryControl.ZoomedOutLayout.list;
+ this.headerPosition = UI.Controls.GalleryControl && UI.Controls.GalleryControl.HeaderPosition.top;
+ this.maxRows = NaN;
+ this.minimumListLength = 1;
+ this.forceInteractive = true;
+ this.delayHydrateLibraryId = false;
+ this.selectionStyleFilled = false;
+ this.allowSelectAll = false;
+ this.allowZoom = false;
+ this.itemsDraggable = false;
+ this.swipeBehavior = UI.Controls.GalleryControl && UI.Controls.GalleryControl.swipeBehavior.none;
+ this.invokeBehavior = UI.Controls.GalleryControl && UI.Controls.GalleryControl.InvokeBehavior.action;
+ this.actionOptions = {id: UI.Actions.ActionIdentifiers.navigateToVideoDetails};
+ this.tap = UI.Controls.GalleryControl && UI.Controls.GalleryControl.Tap.invokeOnly;
+ this.selectionMode = UI.Controls.GalleryControl && UI.Controls.GalleryControl.SelectionMode.none
+ }
+ return VideoCollectionLXTemplateBase
+ })();
+ VideoCollectionLXTemplates.VideoCollectionLXTemplateBase = VideoCollectionLXTemplateBase;
+ var MovieTemplate = (function(_super) {
+ __extends(MovieTemplate, _super);
+ function MovieTemplate() {
+ _super.apply(this, arguments);
+ this.templateSelectorConstructor = MS.Entertainment.UI.Controls.GalleryTemplateSelector;
+ this.debugId = "movie";
+ this.itemTemplate = "select(.templateid-collectionMovieVerticalTile)";
+ this.actionOptions = {id: UI.Actions.ActionIdentifiers.navigateToVideoDetails}
+ }
+ return MovieTemplate
+ })(VideoCollectionLXTemplateBase);
+ VideoCollectionLXTemplates.MovieTemplate = MovieTemplate;
+ var TvSeriesTemplate = (function(_super) {
+ __extends(TvSeriesTemplate, _super);
+ function TvSeriesTemplate() {
+ _super.apply(this, arguments);
+ this.templateSelectorConstructor = MS.Entertainment.UI.Controls.GalleryTemplateSelector;
+ this.debugId = "tvSeries";
+ this.itemTemplate = "select(.templateid-collectionTVVerticalTile)"
+ }
+ return TvSeriesTemplate
+ })(VideoCollectionLXTemplateBase);
+ VideoCollectionLXTemplates.TvSeriesTemplate = TvSeriesTemplate;
+ var PersonalVideosTemplate = (function(_super) {
+ __extends(PersonalVideosTemplate, _super);
+ function PersonalVideosTemplate() {
+ _super.apply(this, arguments);
+ this.debugId = "personalVideos";
+ this.itemTemplate = "select(.templateid-collectionOtherVerticalTile)";
+ this.actionOptions = {id: UI.Actions.ActionIdentifiers.personalVideoNavigate}
+ }
+ return PersonalVideosTemplate
+ })(VideoCollectionLXTemplateBase);
+ VideoCollectionLXTemplates.PersonalVideosTemplate = PersonalVideosTemplate
+ })(ViewModels.VideoCollectionLXTemplates || (ViewModels.VideoCollectionLXTemplates = {}));
+ var VideoCollectionLXTemplates = ViewModels.VideoCollectionLXTemplates;
+ var VideoCollectionTemplateSelector = (function(_super) {
+ __extends(VideoCollectionTemplateSelector, _super);
+ function VideoCollectionTemplateSelector(collectionView) {
+ _super.call(this);
+ this.addTemplate("personalFolder", "/Components/Video_Win/VideoCollection.html#videoCollectionFolderVerticalTile");
+ this.addTemplate("personalFile", "/Components/Video_Win/VideoCollection.html#videoCollectionFileVerticalTile")
+ }
+ VideoCollectionTemplateSelector.prototype.onSelectTemplate = function(item) {
+ var template = null;
+ if (item && item.data) {
+ var data = item.data || {};
+ if (data.type === Microsoft.Entertainment.Queries.ObjectType.folder)
+ template = "personalFolder";
+ else
+ template = "personalFile"
+ }
+ this.ensureTemplatesLoaded([template]);
+ return _super.prototype.getTemplateProvider.call(this, template)
+ };
+ return VideoCollectionTemplateSelector
+ })(UI.Controls.GalleryTemplateSelector);
+ ViewModels.VideoCollectionTemplateSelector = VideoCollectionTemplateSelector;
+ var VideoPersonalCollectionItems = (function(_super) {
+ __extends(VideoPersonalCollectionItems, _super);
+ function VideoPersonalCollectionItems() {
+ _super.apply(this, arguments);
+ this.templateSelectorConstructor = MS.Entertainment.ViewModels.VideoCollectionTemplateSelector
+ }
+ return VideoPersonalCollectionItems
+ })(MS.Entertainment.ViewModels.VideoCollectionLXTemplates.PersonalVideosTemplate);
+ ViewModels.VideoPersonalCollectionItems = VideoPersonalCollectionItems;
+ var VideoCollectionLX = (function(_super) {
+ __extends(VideoCollectionLX, _super);
+ function VideoCollectionLX(view, defaultPivotIndex, overridePivotSetting) {
+ this._viewModelId = "videoCollection";
+ this._defaultPivotIndex = defaultPivotIndex || 0;
+ this._overridePivotSetting = overridePivotSetting || false;
+ this._folderStack = [];
+ _super.call(this, view);
+ window.msWriteProfilerMark("ent:VideoCollectionLX.constructor,StartTM");
+ this.title = String.load(String.id.IDS_VIDEO_LX_COLLECTION_PIVOT_TC);
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signInBindings = WinJS.Binding.bind(signInService, {isSignedIn: this._updateEmptyActions.bind(this)});
+ this._networkStatusBindings = UI.Framework.addEventHandlers(Entertainment.ServiceLocator.getService(Entertainment.Services.uiState), {networkStatusChanged: this._onNetworkStatusChanged.bind(this)});
+ this.refresh();
+ window.msWriteProfilerMark("ent:VideoCollectionLX.constructor,StopTM")
+ }
+ VideoCollectionLX.prototype.dispose = function() {
+ _super.prototype.dispose.call(this);
+ if (this._delayInitializeScripts) {
+ this._delayInitializeScripts.cancel();
+ this._delayInitializeScripts = null
+ }
+ if (this._signInBindings) {
+ this._signInBindings.cancel();
+ this._signInBindings = null
+ }
+ };
+ VideoCollectionLX.prototype.clearFilter = function() {
+ if (this.filterSelectionManager)
+ this.filterSelectionManager.selectedIndex = 0
+ };
+ VideoCollectionLX.prototype._clearQueryBindings = function() {
+ if (this._collectionQueryBindings) {
+ this._collectionQueryBindings.cancel();
+ this._collectionQueryBindings = null
+ }
+ };
+ VideoCollectionLX.prototype._refresh = function() {
+ var _this = this;
+ this.isDisplayingMovies = (this.selectedPivot && (this.selectedPivot.id === VideoCollectionLX.PivotTypes.movies));
+ this.isOffline = !MS.Entertainment.UI.NetworkStatusService.isOnline();
+ if (!this._lastUsedView)
+ _super.prototype._refresh.call(this);
+ else
+ MS.Entertainment.Utilities.schedulePromiseBelowNormal().done(function() {
+ return _super.prototype._refresh.call(_this)
+ })
+ };
+ VideoCollectionLX.prototype._onBeginQuery = function(query) {
+ var isQueryingChildFolder = false;
+ this._clearQueryBindings();
+ this.isDisplayingMovies = (this.selectedPivot && (this.selectedPivot.id === VideoCollectionLX.PivotTypes.movies));
+ if (this.selectedPivot && this.selectedPivot.id === VideoCollectionLX.PivotTypes.personalVideos)
+ if (this._folderStack.length > 0) {
+ isQueryingChildFolder = true;
+ query.folderId = this._folderStack[this._folderStack.length - 1]
+ }
+ else
+ query.folderId = -1;
+ this.isChildFolder = isQueryingChildFolder;
+ _super.prototype._onBeginQuery.call(this, query)
+ };
+ Object.defineProperty(VideoCollectionLX.prototype, "isDisplayingMovies", {
+ get: function() {
+ return this._isDisplayingMovies
+ }, set: function(value) {
+ this.updateAndNotify("isDisplayingMovies", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoCollectionLX.prototype, "isOffline", {
+ get: function() {
+ return this._isOffline
+ }, set: function(value) {
+ this.updateAndNotify("isOffline", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoCollectionLX.prototype, "isChildFolder", {
+ get: function() {
+ return this._isChildFolder
+ }, set: function(value) {
+ this.updateAndNotify("isChildFolder", value)
+ }, enumerable: true, configurable: true
+ });
+ VideoCollectionLX.prototype._onTotalCountChanged = function(newValue, oldValue) {
+ this._totalCount = newValue;
+ var countFormatter = Entertainment.ServiceLocator.getService(Entertainment.Services.dateTimeFormatters).decimalNumber;
+ this.totalCountString = countFormatter.format(this._totalCount);
+ if (this._totalCount === 0) {
+ this.viewStateViewModel.viewState = 0;
+ this._updateEmptyActions()
+ }
+ else
+ this.viewStateViewModel.viewState = 2
+ };
+ Object.defineProperty(VideoCollectionLX.prototype, "totalCountString", {
+ get: function() {
+ return this._totalCountString
+ }, set: function(value) {
+ this.updateAndNotify("totalCountString", value)
+ }, enumerable: true, configurable: true
+ });
+ VideoCollectionLX.prototype._onQueryCompleted = function(query) {
+ this._clearQueryBindings();
+ this._collectionQueryBindings = WinJS.Binding.bind(query, {totalCount: this._onTotalCountChanged.bind(this)});
+ this.filterValue = this._getCollectionFilter()
+ };
+ VideoCollectionLX.prototype.goToParentFolder = function() {
+ if (this._folderStack && this._folderStack.length > 0) {
+ this._folderStack.pop();
+ this.refresh()
+ }
+ };
+ VideoCollectionLX.prototype.openFolder = function(folderId) {
+ if (this._folderStack && folderId >= 0) {
+ this._folderStack.push(folderId);
+ this.refresh()
+ }
+ };
+ VideoCollectionLX.prototype.delayInitialize = function() {
+ var _this = this;
+ this._delayInitializeScripts = Entertainment.Utilities.schedulePromiseBelowNormal(null, "VideoCollectionDelayedScripts").then(function() {
+ return WinJS.UI.Fragments.renderCopy("/Components/Video_Win/VideoCollectionDelayedScripts.html")
+ }).then(function(){}, function(error) {
+ ViewModels.assert(WinJS.Promise.isCanceledError(error), "Failed to load delayed scripts. error: " + (error && error.message))
+ }).then(function() {
+ if (_this._disposed)
+ return;
+ _super.prototype.delayInitialize.call(_this);
+ _this._delayInitializeScripts = null;
+ _this._initializeEmptyViewStateActions();
+ _this._raiseDelayLoadedEvent()
+ })
+ };
+ VideoCollectionLX.prototype.loadModules = function(){};
+ VideoCollectionLX.prototype.freeze = function(){};
+ VideoCollectionLX.prototype.thaw = function(){};
+ Object.defineProperty(VideoCollectionLX.prototype, "delayInitializePromise", {
+ get: function() {
+ return this.delayInitializeSignal.promise
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoCollectionLX.prototype, "delayInitializeSignal", {
+ get: function() {
+ if (!this._delayInitializeSignal)
+ this._delayInitializeSignal = new UI.Framework.Signal;
+ return this._delayInitializeSignal
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoCollectionLX.prototype, "viewStateViewModel", {
+ get: function() {
+ if (!this._viewStateViewModel) {
+ var viewStateItems = [];
+ viewStateItems[-1] = new ViewModels.ViewStateItem(String.load(String.id.IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER), String.load(String.id.IDS_SERVICE_UNAVAILABLE_CAPTION), []);
+ viewStateItems[0] = new ViewModels.ViewStateItem(String.load(String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY), String.load(String.id.IDS_COLLECTION_ALL_VIDEO_EMPTY), this._initializeEmptyViewStateActions());
+ this._viewStateViewModel = new ViewModels.ViewStateViewModel(viewStateItems)
+ }
+ return this._viewStateViewModel
+ }, enumerable: true, configurable: true
+ });
+ VideoCollectionLX.prototype._initializeEmptyViewStateActions = function() {
+ if (!this._emptyViewActions)
+ this._emptyViewActions = new Entertainment.ObservableArray;
+ if (this.isDelayInitialized && this._emptyViewActions.length === 0)
+ this._populateObservableArrayWithEmptyActions(this._emptyViewActions);
+ return this._emptyViewActions
+ };
+ VideoCollectionLX.prototype._populateObservableArrayWithEmptyActions = function(array) {
+ var actions = this._createEmptyViewStateActions();
+ if (array && actions && actions.length)
+ array.spliceArray(0, 0, actions)
+ };
+ VideoCollectionLX.prototype._createEmptyViewStateActions = function() {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var emptyActions = [];
+ var pivot = this.selectedPivot;
+ if (pivot && pivot.id !== VideoCollectionLX.PivotTypes.personalVideos && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoSignInAvailable)) {
+ var signIn = Entertainment.ServiceLocator.getService(Entertainment.Services.signIn);
+ if (!signIn.isSignedIn) {
+ var signInAction = actionService.getAction(UI.Actions.ActionIdentifiers.signIn);
+ signInAction.automationId = VideoCollectionLxAutomationIds.SignIn;
+ emptyActions.push(new ViewModels.ActionItem(String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN, String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN_DESCRIPTION, signInAction, UI.Icon.actionLinkArrow));
+ var signUpAction = actionService.getAction(UI.Actions.ActionIdentifiers.signIn);
+ signUpAction.automationId = VideoCollectionLxAutomationIds.SignUp;
+ emptyActions.push(new ViewModels.ActionItem(String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP, String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP_DESCRIPTION, signUpAction, UI.Icon.actionLinkArrow))
+ }
+ }
+ if (pivot && pivot.id === VideoCollectionLX.PivotTypes.movies) {
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace))
+ emptyActions.push(new ViewModels.ActionItem(String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_MOVIES, String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_DESCRIPTION, actionService.getAction(UI.Actions.ActionIdentifiers.moviesStoreNavigate), UI.Icon.movies))
+ }
+ else if (pivot && pivot.id === VideoCollectionLX.PivotTypes.tvSeries) {
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace))
+ emptyActions.push(new ViewModels.ActionItem(String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_TV, String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_DESCRIPTION, actionService.getAction(UI.Actions.ActionIdentifiers.tvStoreNavigate), UI.Icon.tvMonitor))
+ }
+ else if (pivot && pivot.id === VideoCollectionLX.PivotTypes.personalVideos)
+ emptyActions.push(new ViewModels.ActionItem(String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE, String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE_DESCRIPTION, actionService.getAction(UI.Actions.ActionIdentifiers.showLocalGrovelInfoDialog), UI.Icon.folder));
+ return emptyActions
+ };
+ VideoCollectionLX.prototype._updateEmptyActions = function() {
+ if (!this._emptyViewActions || !this.isDelayInitialized)
+ return;
+ this._emptyViewActions.clear();
+ this._populateObservableArrayWithEmptyActions(this._emptyViewActions)
+ };
+ VideoCollectionLX.prototype._onNetworkStatusChanged = function() {
+ this.isOffline = !UI.NetworkStatusService.isOnline()
+ };
+ VideoCollectionLX.createVideoCollectionLX = function() {
+ var defaultPivotIndex = 0;
+ var overridePivotSetting = false;
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation).isFirstLocationLoaded && MS.Entertainment.Utilities.isLaunchToCollectionSettingEnabled) {
+ defaultPivotIndex = 2;
+ overridePivotSetting = true
+ }
+ return new VideoCollectionLX(VideoCollectionLX.ViewTypes.collection, defaultPivotIndex, overridePivotSetting)
+ };
+ Object.defineProperty(VideoCollectionLX.prototype, "selectedPivot", {
+ get: function() {
+ return this.pivotsSelectionManager ? this.pivotsSelectionManager.selectedItem : null
+ }, enumerable: true, configurable: true
+ });
+ VideoCollectionLX.prototype.getViewDefinition = function(view) {
+ return VideoCollectionLX.Views[view]
+ };
+ VideoCollectionLX.prototype.getPivotDefinition = function(view) {
+ return VideoCollectionLX.Pivots[view]
+ };
+ VideoCollectionLX.prototype.getModifierDefinition = function(view) {
+ this._modifiers = this._modifiers || this._createModifiers();
+ var id = this.selectedPivot && this.selectedPivot.id;
+ var modifierDefinition = id && this._modifiers ? this._modifiers[id] : null;
+ return modifierDefinition
+ };
+ VideoCollectionLX.prototype.getFilterDefinition = function(view) {
+ var pivot = this.selectedPivot;
+ if (pivot && pivot.id !== VideoCollectionLX.PivotTypes.personalVideos)
+ return VideoCollectionLX.Filters
+ };
+ VideoCollectionLX.prototype.getModifierOptions = function(view) {
+ var definition = this.getViewDefinition(view);
+ var pivot = this.selectedPivot;
+ return Entertainment.Utilities.uniteObjects(WinJS.Binding.unwrap(pivot && pivot.value && pivot.value.modifierOptions), WinJS.Binding.unwrap(definition && definition.modelOptions))
+ };
+ VideoCollectionLX.prototype._createModifiers = function() {
+ return new VideoCollectionLxModifiers.Modifiers
+ };
+ VideoCollectionLX.prototype._getCollectionFilter = function() {
+ var collectionFilter;
+ var selectedFilter;
+ if (this.filterSelectionManager)
+ selectedFilter = WinJS.Binding.unwrap(this.filterSelectionManager.selectedItem);
+ if (selectedFilter && selectedFilter.value && selectedFilter.value.queryOptions)
+ collectionFilter = selectedFilter.value.queryOptions.mediaAvailability;
+ return collectionFilter
+ };
+ VideoCollectionLX.prototype.cloneCurrentQuery = function() {
+ if (!this._lastUsedQuery)
+ return null;
+ var clonedQuery = this._lastUsedQuery.clone();
+ if (clonedQuery)
+ clonedQuery.allowGroupHints = false;
+ return clonedQuery
+ };
+ VideoCollectionLX.prototype._onQueryFailed = function(error) {
+ _super.prototype._onQueryFailed.call(this, error);
+ if (!WinJS.Promise.isCanceledError(error)) {
+ this.filterValue = this._getCollectionFilter();
+ this.viewStateViewModel.viewState = -1;
+ Entertainment.Utilities.assertError("VideoCollectionLX::_onQueryFailed() Unexpected failure from the database query.", error)
+ }
+ };
+ Object.defineProperty(VideoCollectionLX, "Filters", {
+ get: function() {
+ return {options: [new ViewModels.Node(VideoCollectionLxAutomationIds.FilterAll, String.load(String.id.IDS_VIDEO_LX_COLLECTION_FILTER_ALL), ViewModels.NodeValues.create({
+ queryOptions: {mediaAvailability: Microsoft.Entertainment.Platform.MediaAvailability.available}, modelOptions: {showLocalEmptyAction: true}
+ })), new ViewModels.Node(VideoCollectionLxAutomationIds.FilterOffline, String.load(String.id.IDS_VIDEO_LX_COLLECTION_FILTER_PC), ViewModels.NodeValues.create({
+ queryOptions: {mediaAvailability: Microsoft.Entertainment.Platform.MediaAvailability.availableOffline}, modelOptions: {showLocalEmptyAction: true}
+ })), new ViewModels.Node(VideoCollectionLxAutomationIds.FilterCloud, String.load(String.id.IDS_VIDEO_LX_COLLECTION_FILTER_CLOUD), ViewModels.NodeValues.create({
+ queryOptions: {mediaAvailability: Microsoft.Entertainment.Platform.MediaAvailability.availableFromCloud}, modelOptions: {showLocalEmptyAction: true}
+ }))]}
+ }, enumerable: true, configurable: true
+ });
+ VideoCollectionLX.ViewTypes = {collection: "collection"};
+ VideoCollectionLX.PivotTypes = {
+ movies: "movies", tvSeries: "tvSeries", personalVideos: "personalVideos"
+ };
+ VideoCollectionLX.Views = {collection: ViewModels.NodeValues.create({
+ filterOptions: {
+ settingsKey: "collection-filter-selection", isRoamingSetting: false
+ }, pivotOptions: {settingsKey: "collection-pivot-selection"}, queryOptions: {
+ isLive: true, allowReset: true, chunkSize: 25
+ }
+ })};
+ VideoCollectionLX.Pivots = {collection: {itemFactory: function itemFactory() {
+ return [new ViewModels.Node(VideoCollectionLX.PivotTypes.movies, String.load(String.id.IDS_VIDEO_LX_COLLECTION_MODIFIER_MOVIES), ViewModels.NodeValues.create({
+ query: Data.Query.libraryVideoMovies, modelOptions: {
+ selectedTemplate: new VideoCollectionLXTemplates.MovieTemplate, propertyKey: "libraryId", taskKeyGetter: UI.FileTransferService.keyFromProperty("libraryId"), notifier: UI.FileTransferNotifiers.videoDownloadItem
+ }, modifierOptions: {settingsKey: "collection-movies-modifier-selection"}
+ })), new ViewModels.Node(VideoCollectionLX.PivotTypes.tvSeries, String.load(String.id.IDS_VIDEO_LX_COLLECTION_MODIFIER_TV), ViewModels.NodeValues.create({
+ query: Data.Query.libraryTVSeries, modelOptions: {
+ selectedTemplate: new VideoCollectionLXTemplates.TvSeriesTemplate, propertyKey: "libraryId", taskKeyGetter: UI.FileTransferService.keyFromProperty("seriesLibraryId"), notifier: UI.FileTransferNotifiers.episodeCollection
+ }, modifierOptions: {settingsKey: "collection-tvSeries-modifier-selection"}
+ })), new ViewModels.Node(VideoCollectionLX.PivotTypes.personalVideos, String.load(String.id.IDS_VIDEO_LX_COLLECTION_MODIFIER_PERSONAL), ViewModels.NodeValues.create({
+ query: Data.Query.LibraryFolderAndVideosQuery, modelOptions: {
+ selectedTemplate: new VideoCollectionLXTemplates.PersonalVideosTemplate, propertyKey: "libraryId", taskKeyGetter: UI.FileTransferService.keyFromProperty("libraryId"), notifier: UI.FileTransferNotifiers.genericFile
+ }, modifierOptions: {settingsKey: "collection-other-modifier-selection"}
+ }))]
+ }}};
+ return VideoCollectionLX
+ })(ViewModels.QueryViewModel);
+ ViewModels.VideoCollectionLX = VideoCollectionLX;
+ (function(VideoCollectionLxModifiers) {
+ var Modifiers = (function() {
+ function Modifiers(){}
+ Object.defineProperty(Modifiers.prototype, "movies", {
+ get: function() {
+ this._movies = this._movies || new VideoCollectionLxModifiers.Movie;
+ return this._movies
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Modifiers.prototype, "tvSeries", {
+ get: function() {
+ this._series = this._series || new VideoCollectionLxModifiers.Series;
+ return this._series
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Modifiers.prototype, "personalVideos", {
+ get: function() {
+ this._personalVideos = this._personalVideos || new VideoCollectionLxModifiers.PersonalVideos;
+ return this._personalVideos
+ }, enumerable: true, configurable: true
+ });
+ return Modifiers
+ })();
+ VideoCollectionLxModifiers.Modifiers = Modifiers;
+ var Movie = (function() {
+ function Movie(){}
+ Movie.prototype.itemFactory = function() {
+ return [new ViewModels.Node(VideoCollectionLxAutomationIds.SortMoviesByDateAdded, String.id.IDS_VIDEO_LX_COLLECTION_SORT_DATE, ViewModels.NodeValues.create({
+ query: Data.Query.libraryVideoMovies, queryOptions: {sort: Microsoft.Entertainment.Queries.VideosSortBy.dateAddedDescending}, modelOptions: {selectedTemplate: new VideoCollectionLXTemplates.MovieTemplate}
+ })), new ViewModels.Node(VideoCollectionLxAutomationIds.SortMoviesByAlpha, String.id.IDS_VIDEO_LX_COLLECTION_SORT_ALPHA, ViewModels.NodeValues.create({
+ query: Data.Query.libraryVideoMovies, queryOptions: {sort: Microsoft.Entertainment.Queries.VideosSortBy.titleAscending}, modelOptions: {selectedTemplate: new VideoCollectionLXTemplates.MovieTemplate}
+ }))]
+ };
+ return Movie
+ })();
+ VideoCollectionLxModifiers.Movie = Movie;
+ var Series = (function() {
+ function Series(){}
+ Series.prototype.itemFactory = function() {
+ return [new ViewModels.Node(VideoCollectionLxAutomationIds.SortTvSeriesByDateAdded, String.id.IDS_VIDEO_LX_COLLECTION_SORT_DATE, ViewModels.NodeValues.create({
+ query: Data.Query.libraryTVSeries, queryOptions: {sort: Microsoft.Entertainment.Queries.TVSeriesSortBy.dateLastEpisodeAddedDescending}, modelOptions: {selectedTemplate: new VideoCollectionLXTemplates.TvSeriesTemplate}
+ })), new ViewModels.Node(VideoCollectionLxAutomationIds.SortTvSeriesByAlpha, String.id.IDS_VIDEO_LX_COLLECTION_SORT_ALPHA, ViewModels.NodeValues.create({
+ query: Data.Query.libraryTVSeries, queryOptions: {sort: Microsoft.Entertainment.Queries.TVSeriesSortBy.titleAscending}, modelOptions: {selectedTemplate: new VideoCollectionLXTemplates.TvSeriesTemplate}
+ }))]
+ };
+ return Series
+ })();
+ VideoCollectionLxModifiers.Series = Series;
+ var PersonalVideos = (function() {
+ function PersonalVideos(){}
+ PersonalVideos.prototype.itemFactory = function() {
+ return [new ViewModels.Node(VideoCollectionLxAutomationIds.SortPersonalVideosByDateAdded, String.id.IDS_VIDEO_LX_COLLECTION_SORT_DATE, ViewModels.NodeValues.create({
+ queryOptions: {sort: Microsoft.Entertainment.Queries.VideosSortBy.dateAddedDescending}, modelOptions: {selectedTemplate: new VideoPersonalCollectionItems}
+ })), new ViewModels.Node(VideoCollectionLxAutomationIds.SortPersonalVideosByAlpha, String.id.IDS_VIDEO_LX_COLLECTION_SORT_ALPHA, ViewModels.NodeValues.create({
+ queryOptions: {sort: Microsoft.Entertainment.Queries.VideosSortBy.titleAscending}, modelOptions: {selectedTemplate: new VideoPersonalCollectionItems}
+ }))]
+ };
+ return PersonalVideos
+ })();
+ VideoCollectionLxModifiers.PersonalVideos = PersonalVideos
+ })(ViewModels.VideoCollectionLxModifiers || (ViewModels.VideoCollectionLxModifiers = {}));
+ var VideoCollectionLxModifiers = ViewModels.VideoCollectionLxModifiers;
+ var VideoCollectionLxAutomationIds = (function() {
+ function VideoCollectionLxAutomationIds(){}
+ VideoCollectionLxAutomationIds.FilterAll = "FilterAll";
+ VideoCollectionLxAutomationIds.FilterOffline = "FilterOffline";
+ VideoCollectionLxAutomationIds.FilterCloud = "FilterCloud";
+ VideoCollectionLxAutomationIds.SignIn = "VideoCollectionSignIn";
+ VideoCollectionLxAutomationIds.SignUp = "VideoCollectionSignUp";
+ VideoCollectionLxAutomationIds.SortMoviesByAlpha = "SortMoviesByAlpha";
+ VideoCollectionLxAutomationIds.SortMoviesByDateAdded = "SortMoviesByDateAdded";
+ VideoCollectionLxAutomationIds.SortTvSeriesByAlpha = "SortTvSeriesByAlpha";
+ VideoCollectionLxAutomationIds.SortTvSeriesByDateAdded = "SortTvSeriesByDateAdded";
+ VideoCollectionLxAutomationIds.SortPersonalVideosByAlpha = "SortPersonalVideosByAlpha";
+ VideoCollectionLxAutomationIds.SortPersonalVideosByDateAdded = "SortPersonalVideosByDateAdded";
+ return VideoCollectionLxAutomationIds
+ })();
+ ViewModels.VideoCollectionLxAutomationIds = VideoCollectionLxAutomationIds
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/managefoldersaction.js:814 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Actions) {
+ var ManageFoldersAutomationIds = (function() {
+ function ManageFoldersAutomationIds(){}
+ ManageFoldersAutomationIds.manageFolders = "manageFolders";
+ return ManageFoldersAutomationIds
+ })();
+ Actions.ManageFoldersAutomationIds = ManageFoldersAutomationIds;
+ (function(ManageFoldersActions) {
+ var ManageFolders = (function(_super) {
+ __extends(ManageFolders, _super);
+ function ManageFolders() {
+ _super.apply(this, arguments);
+ this.automationId = ManageFoldersAutomationIds.manageFolders
+ }
+ ManageFolders.prototype.canExecute = function(param) {
+ this.useOverrideTitleIfExists();
+ return true
+ };
+ ManageFolders.prototype.executed = function(param) {
+ MS.Entertainment.UI.Framework.loadTemplate("/Controls/ManageFoldersPage.html#manageFoldersTemplate", null, true).done(function() {
+ MS.Entertainment.UI.Controls.ManageFoldersDialog.show()
+ })
+ };
+ return ManageFolders
+ })(Actions.Action);
+ ManageFoldersActions.ManageFolders = ManageFolders
+ })(Actions.ManageFoldersActions || (Actions.ManageFoldersActions = {}));
+ var ManageFoldersActions = Actions.ManageFoldersActions
+ })(UI.Actions || (UI.Actions = {}));
+ var Actions = UI.Actions
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+(function() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.manageFolders, function() {
+ return new MS.Entertainment.UI.Actions.ManageFoldersActions.ManageFolders
+ })
+})()
+})();
+/* >>>>>>/controls/managefoldersview.js:873 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var FolderItem = (function(_super) {
+ __extends(FolderItem, _super);
+ function FolderItem(folder) {
+ _super.call(this);
+ if (folder) {
+ this._isAddFolderButton = false;
+ this._name = folder.name;
+ this._path = folder.path;
+ this._folder = folder
+ }
+ else
+ this._isAddFolderButton = true
+ }
+ Object.defineProperty(FolderItem.prototype, "name", {
+ get: function() {
+ return this._name
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(FolderItem.prototype, "path", {
+ get: function() {
+ return this._path
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(FolderItem.prototype, "isAddFolderButton", {
+ get: function() {
+ return this._isAddFolderButton
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(FolderItem.prototype, "folder", {
+ get: function() {
+ return this._folder
+ }, enumerable: true, configurable: true
+ });
+ return FolderItem
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ var ManageFoldersDialog = (function(_super) {
+ __extends(ManageFoldersDialog, _super);
+ function ManageFoldersDialog(element, options) {
+ this.templateStorage = "/Controls/ManageFoldersPage.html";
+ this.templateName = "dialogTemplate";
+ _super.call(this, element, options)
+ }
+ ManageFoldersDialog.show = function() {
+ if (ManageFoldersDialog._dialog && ManageFoldersDialog._dialog.visible)
+ return;
+ var options = {
+ width: "60%", height: "100%", buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_MANAGE_FOLDERS_DONE_BUTTON), execute: function execute_done(dialog) {
+ dialog.hide();
+ ManageFoldersDialog._dialog = null
+ }
+ })], defaultButtonIndex: 0, title: MS.Entertainment.Utilities.isVideoApp1 ? String.load(String.id.IDS_VIDEO1_MANAGE_FOLDERS_TITLE) : String.load(String.id.IDS_MUSIC_MANAGE_FOLDERS_TITLE), userControl: "MS.Entertainment.UI.Controls.ManageFolders", userControlOptions: {}, persistOnNavigate: false
+ };
+ if (!ManageFoldersDialog._dialog)
+ ManageFoldersDialog._dialog = new MS.Entertainment.UI.Controls.ManageFoldersDialog(document.createElement("div"), options);
+ if (!ManageFoldersDialog._dialog.visible)
+ ManageFoldersDialog._dialog.show()
+ };
+ ManageFoldersDialog.hide = function() {
+ var returnValue = ManageFoldersDialog._dialog.hide();
+ ManageFoldersDialog._dialog = null;
+ return returnValue
+ };
+ return ManageFoldersDialog
+ })(MS.Entertainment.UI.Controls.Dialog);
+ Controls.ManageFoldersDialog = ManageFoldersDialog;
+ var ManageFolders = (function(_super) {
+ __extends(ManageFolders, _super);
+ function ManageFolders(element, options) {
+ this.templateStorage = "/Controls/ManageFoldersPage.html";
+ this.templateName = "manageFoldersTemplate";
+ _super.call(this, element, options)
+ }
+ Object.defineProperty(ManageFolders.prototype, "items", {
+ get: function() {
+ return this._items
+ }, set: function(value) {
+ this.updateAndNotify("items", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(ManageFolders.prototype, "itemCounts", {
+ get: function() {
+ return this._itemCounts
+ }, enumerable: true, configurable: true
+ });
+ ManageFolders.prototype._load = function() {
+ var _this = this;
+ var addFolderItem = new Array;
+ var itemsInLibrary = new Array;
+ var libraryId;
+ libraryId = MS.Entertainment.Utilities.isVideoApp1 ? Windows.Storage.KnownLibraryId.videos : Windows.Storage.KnownLibraryId.music;
+ addFolderItem.push(new FolderItem(null));
+ Windows.Storage.StorageLibrary.getLibraryAsync(libraryId).then(function(library) {
+ if (library)
+ library.folders.forEach(function(folder) {
+ itemsInLibrary.push(new FolderItem(folder))
+ })
+ }).done(function() {
+ _this._itemCounts = itemsInLibrary.length;
+ if (_this._itemCounts > 0)
+ itemsInLibrary.reverse();
+ _this.items = new MS.Entertainment.ObservableArray(addFolderItem.concat(itemsInLibrary))
+ }, function(error) {
+ MS.Entertainment.Utilities.assertError("ManageFolders::_load() failed to get library items.", error)
+ })
+ };
+ ManageFolders.prototype.initialize = function() {
+ this._load()
+ };
+ ManageFolders.showLastFolderDialog = function() {
+ return MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE), String.load(String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT), {
+ width: "60%", height: "100%", buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_CLOSE_BUTTON), execute: function execute_done(dialog) {
+ dialog.hide()
+ }
+ })], defaultButtonIndex: 0
+ })
+ };
+ ManageFolders.folderTemplateSelector = function(item) {
+ function loadItemTemplate(itemTemplate) {
+ return MS.Entertainment.UI.Framework.loadTemplate(itemTemplate, null, true).then(function(templateControl) {
+ return templateControl
+ })
+ }
+ if (item.isAddFolderButton)
+ return loadItemTemplate("/Controls/ManageFoldersPage.html#addFolderItemTemplate");
+ else
+ return loadItemTemplate("/Controls/ManageFoldersPage.html#removeFolderItemTemplate")
+ };
+ ManageFolders.prototype.onModuleItemClicked = function(event) {
+ var element = event.srcElement;
+ while (element && element !== this.domElement) {
+ if (element.clickDataContext) {
+ this._invokeModuleItem(element.clickDataContext);
+ event.stopPropagation();
+ break
+ }
+ element = element.parentElement
+ }
+ };
+ ManageFolders.prototype._invokeModuleItem = function(item) {
+ var _this = this;
+ if (!item)
+ return;
+ var libraryId;
+ libraryId = MS.Entertainment.Utilities.isVideoApp1 ? Windows.Storage.KnownLibraryId.videos : Windows.Storage.KnownLibraryId.music;
+ if (item.isAddFolderButton)
+ Windows.Storage.StorageLibrary.getLibraryAsync(libraryId).then(function(library) {
+ return library.requestAddFolderAsync()
+ }).done(function() {
+ _this._load()
+ }, function(error) {
+ MS.Entertainment.fail("AddFolder Failed: " + (error && error.message))
+ });
+ else
+ Windows.Storage.StorageLibrary.getLibraryAsync(libraryId).then(function(library) {
+ MS.Entertainment.UI.Controls.ManageFoldersDialog.hide();
+ if (_this.itemCounts === 1)
+ return MS.Entertainment.UI.Controls.ManageFolders.showLastFolderDialog();
+ else
+ return library.requestRemoveFolderAsync(item.folder)
+ }).done(function() {
+ MS.Entertainment.UI.Controls.ManageFoldersDialog.show()
+ }, function(error) {
+ MS.Entertainment.fail("RemoveFolder Failed: " + (error && error.message))
+ })
+ };
+ return ManageFolders
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.ManageFolders = ManageFolders;
+ WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.ManageFolders.folderTemplateSelector)
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
diff --git a/packages/microsoft.zunevideo/VideoMarketplacePageTemplate_merged.js b/packages/microsoft.zunevideo/VideoMarketplacePageTemplate_merged.js
new file mode 100644
index 00000000..5bbd223b
--- /dev/null
+++ b/packages/microsoft.zunevideo/VideoMarketplacePageTemplate_merged.js
@@ -0,0 +1,450 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* >>>>>>/viewmodels/video_win/editorialvideomarketplaceviewmodel.js:2 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var EditorialVideoMarketplaceViewModel = (function(_super) {
+ __extends(EditorialVideoMarketplaceViewModel, _super);
+ function EditorialVideoMarketplaceViewModel(view) {
+ this._maxCount = 200;
+ var stringId = EditorialVideoMarketplaceViewModel.Titles[view];
+ Trace.assert(stringId, "EditorialVideoMarketplaceViewModel::constructor: Expected a string ID to be supplied for the gallery title.");
+ this.title = String.load(stringId);
+ _super.call(this, view);
+ this.refresh()
+ }
+ EditorialVideoMarketplaceViewModel.prototype.getViewDefinition = function(view) {
+ return EditorialVideoMarketplaceViewModel.Views[view]
+ };
+ EditorialVideoMarketplaceViewModel.prototype.getModifierDefinition = function(view) {
+ return EditorialVideoMarketplaceViewModel.Modifiers[view]
+ };
+ EditorialVideoMarketplaceViewModel.prototype.getModifierOptions = function(view) {
+ var definition = this.getViewDefinition(view);
+ return definition && definition.modelOptions
+ };
+ EditorialVideoMarketplaceViewModel.prototype.getSecondaryModifierDefinition = function(view) {
+ return EditorialVideoMarketplaceViewModel.SecondaryModifiers[view]
+ };
+ EditorialVideoMarketplaceViewModel.prototype._onItemsChanging = function(newItems, oldItems) {
+ _super.prototype._onItemsChanging.call(this, newItems, oldItems);
+ if (newItems)
+ newItems.maxCount = this._maxCount
+ };
+ EditorialVideoMarketplaceViewModel.ViewTypes = {
+ newMovies: "newMovies", featuredMovies: "featuredMovies", newTv: "newTv", featuredTv: "featuredTv", lastNightTv: "lastNightTv"
+ };
+ EditorialVideoMarketplaceViewModel.Titles = {
+ newMovies: String.id.IDS_VIDEO_LX_MOVIE_NEW_GALLERY_TITLE, featuredMovies: String.id.IDS_VIDEO_LX_MOVIE_FEATURED_GALLERY_TITLE, newTv: String.id.IDS_VIDEO_LX_TV_NEW_GALLERY_TITLE, featuredTv: String.id.IDS_VIDEO_LX_TV_FEATURED_GALLERY_TITLE, lastNightTv: String.id.IDS_VIDEO_LX_TV_LAST_NIGHT_GALLERY_TITLE
+ };
+ EditorialVideoMarketplaceViewModel.Views = {
+ newMovies: ViewModels.NodeValues.create({
+ query: function() {
+ return new Entertainment.Data.Query.Video.MovieNewReleasesQuery
+ }, queryOptions: {autoUpdateOnSignIn: true}, modelOptions: {
+ selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.Movies, propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.videoDownloadItem
+ }
+ }), featuredMovies: ViewModels.NodeValues.create({
+ query: function() {
+ return new Entertainment.Data.Query.MovieHubFeaturedQuery
+ }, queryOptions: {autoUpdateOnSignIn: true}, modelOptions: {
+ selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.Movies, propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.videoDownloadItem
+ }
+ }), newTv: ViewModels.NodeValues.create({
+ query: function() {
+ return new Entertainment.Data.Query.Video.TvNewReleasesQuery
+ }, queryOptions: {autoUpdateOnSignIn: true}, modelOptions: {
+ selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TvSeries, propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.episodeCollection
+ }
+ }), featuredTv: ViewModels.NodeValues.create({
+ query: function() {
+ return new Entertainment.Data.Query.TvHubFeaturedQuery
+ }, queryOptions: {autoUpdateOnSignIn: true}, modelOptions: {
+ selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TvSeries, propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.episodeCollection
+ }
+ }), lastNightTv: ViewModels.NodeValues.create({
+ query: function() {
+ return new Entertainment.Data.Query.browseTVFromLastNight
+ }, queryOptions: {autoUpdateOnSignIn: true}, modelOptions: {
+ selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TvSeries, propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.episodeCollection
+ }
+ })
+ };
+ EditorialVideoMarketplaceViewModel.Modifiers = {
+ newMovies: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataMovieGenres
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allGenres, String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_GENRES), ViewModels.NodeValues.create({queryOptions: {
+ genre: String.empty, studio: String.empty
+ }}))]
+ }
+ }, featuredMovies: null, newTv: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataTvGenres
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allGenres, String.load(String.id.IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_GENRES), ViewModels.NodeValues.create({queryOptions: {
+ genre: String.empty, network: String.empty
+ }}))]
+ }
+ }, featuredTv: null, lastNightTv: null
+ };
+ EditorialVideoMarketplaceViewModel.SecondaryModifiers = {
+ newMovies: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataMovieStudios
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allStudios, String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_STUDIOS), ViewModels.NodeValues.create({queryOptions: {studio: String.empty}}))]
+ }
+ }, featuredMovies: null, newTv: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataTvNetworks
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allNetworks, String.load(String.id.IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_NETWORKS), ViewModels.NodeValues.create({queryOptions: {network: String.empty}}))]
+ }
+ }, featuredTv: null, lastNightTv: null
+ };
+ return EditorialVideoMarketplaceViewModel
+ })(ViewModels.VideoMarketplaceViewModelBase);
+ ViewModels.EditorialVideoMarketplaceViewModel = EditorialVideoMarketplaceViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/featuredsetsmarketplaceviewmodel.js:129 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var FeaturedSetsMarketplaceViewModel = (function(_super) {
+ __extends(FeaturedSetsMarketplaceViewModel, _super);
+ function FeaturedSetsMarketplaceViewModel(view) {
+ var stringId = FeaturedSetsMarketplaceViewModel.Titles[view];
+ Trace.assert(stringId, "FeaturedSetsMarketplaceViewModel::constructor: Expected a string ID to be supplied for the gallery title.");
+ this.title = String.load(stringId);
+ _super.call(this, view);
+ this.refresh()
+ }
+ FeaturedSetsMarketplaceViewModel.prototype.getViewDefinition = function(view) {
+ return FeaturedSetsMarketplaceViewModel.Views[view]
+ };
+ FeaturedSetsMarketplaceViewModel.prototype.getModifierDefinition = function(view) {
+ return FeaturedSetsMarketplaceViewModel.Modifiers[view]
+ };
+ FeaturedSetsMarketplaceViewModel.prototype.getModifierOptions = function(view) {
+ var definition = this.getViewDefinition(view);
+ return definition && definition.modelOptions
+ };
+ FeaturedSetsMarketplaceViewModel.prototype.getSecondaryModifierDefinition = function(view) {
+ return FeaturedSetsMarketplaceViewModel.SecondaryModifiers[view]
+ };
+ FeaturedSetsMarketplaceViewModel.prototype._onItemsChanging = function(newItems, oldItems) {
+ _super.prototype._onItemsChanging.call(this, newItems, oldItems)
+ };
+ FeaturedSetsMarketplaceViewModel.prototype._onQueryCompleted = function(query) {
+ _super.prototype._onQueryCompleted.call(this, query);
+ var items = WinJS.Utilities.getMember("result.items", query);
+ var filteredItems = this._filterFeaturedSetItems(items, FeaturedSetsMarketplaceViewModel.ContentTypes[this.view]);
+ this._setItems(filteredItems)
+ };
+ FeaturedSetsMarketplaceViewModel.prototype._filterFeaturedSetItems = function(items, targetItemType) {
+ if (!items || !Array.isArray(items))
+ return;
+ var filtered = items.filter(function(item) {
+ var contentType = WinJS.Utilities.getMember("spotlightAction.contentType", item);
+ return contentType === MS.Entertainment.Data.Augmenter.Spotlight.ContentType.None || contentType === targetItemType
+ });
+ return filtered
+ };
+ FeaturedSetsMarketplaceViewModel.ViewTypes = {
+ tvFeaturedSets: "tvFeaturedSets", movieFeaturedSets: "movieFeaturedSets"
+ };
+ FeaturedSetsMarketplaceViewModel.Titles = {
+ tvFeaturedSets: String.id.IDS_VIDEO_FEATURED_SETS_TITLE, movieFeaturedSets: String.id.IDS_VIDEO_FEATURED_SETS_TITLE
+ };
+ FeaturedSetsMarketplaceViewModel.Views = {
+ tvFeaturedSets: ViewModels.NodeValues.create({
+ query: function() {
+ var query = new Entertainment.Data.Query.MediaDiscoveryVideoFlexHub;
+ query.target = ViewModels.QueryIds.featuredSets;
+ return query
+ }, queryOptions: {autoUpdateOnSignIn: true}, modelOptions: {
+ selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.FeaturedSet, propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.genericFile
+ }
+ }), movieFeaturedSets: ViewModels.NodeValues.create({
+ query: function() {
+ var query = new Entertainment.Data.Query.MediaDiscoveryVideoFlexHub;
+ query.target = ViewModels.QueryIds.featuredSets;
+ return query
+ }, queryOptions: {autoUpdateOnSignIn: true}, modelOptions: {
+ selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.FeaturedSet, propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.genericFile
+ }
+ })
+ };
+ FeaturedSetsMarketplaceViewModel.Modifiers = {
+ tvFeaturedSets: null, movieFeaturedSets: null
+ };
+ FeaturedSetsMarketplaceViewModel.SecondaryModifiers = {
+ tvFeaturedSets: null, movieFeaturedSets: null
+ };
+ FeaturedSetsMarketplaceViewModel.ContentTypes = {
+ tvFeaturedSets: MS.Entertainment.Data.Augmenter.Spotlight.ContentType.TV, movieFeaturedSets: MS.Entertainment.Data.Augmenter.Spotlight.ContentType.Movies
+ };
+ return FeaturedSetsMarketplaceViewModel
+ })(ViewModels.VideoMarketplaceViewModelBase);
+ ViewModels.FeaturedSetsMarketplaceViewModel = FeaturedSetsMarketplaceViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/topmoviesmarketplaceviewmodel.js:229 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(TopMoviesMarketplacePivotTypes) {
+ TopMoviesMarketplacePivotTypes[TopMoviesMarketplacePivotTypes["topSellingMovies"] = 0] = "topSellingMovies";
+ TopMoviesMarketplacePivotTypes[TopMoviesMarketplacePivotTypes["topRentedMovies"] = 1] = "topRentedMovies";
+ TopMoviesMarketplacePivotTypes[TopMoviesMarketplacePivotTypes["topRatedMovies"] = 2] = "topRatedMovies"
+ })(ViewModels.TopMoviesMarketplacePivotTypes || (ViewModels.TopMoviesMarketplacePivotTypes = {}));
+ var TopMoviesMarketplacePivotTypes = ViewModels.TopMoviesMarketplacePivotTypes;
+ var TopMoviesMarketplaceViewModel = (function(_super) {
+ __extends(TopMoviesMarketplaceViewModel, _super);
+ function TopMoviesMarketplaceViewModel(view, pivotType) {
+ this._maxCount = 200;
+ this.title = String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_TITLE);
+ var pivotIndex = this._getDefaultPivotIndex(pivotType);
+ _super.call(this, view, pivotIndex);
+ this.refresh()
+ }
+ TopMoviesMarketplaceViewModel.prototype.getViewDefinition = function(view) {
+ return TopMoviesMarketplaceViewModel.Views[view]
+ };
+ TopMoviesMarketplaceViewModel.prototype.getPivotDefinition = function(view) {
+ return TopMoviesMarketplaceViewModel.Pivots[view]
+ };
+ TopMoviesMarketplaceViewModel.prototype.getModifierDefinition = function(view) {
+ return TopMoviesMarketplaceViewModel.Modifiers.all
+ };
+ TopMoviesMarketplaceViewModel.prototype.getModifierOptions = function(view) {
+ var definition = this.getViewDefinition(view);
+ var pivot = this.getPivotDefinition(view);
+ return MS.Entertainment.Utilities.uniteObjects(WinJS.Utilities.getMember("value.modifierOptions", pivot), definition && definition.modelOptions)
+ };
+ TopMoviesMarketplaceViewModel.prototype.getSecondaryModifierDefinition = function(view) {
+ return TopMoviesMarketplaceViewModel.SecondaryModifiers.all
+ };
+ TopMoviesMarketplaceViewModel.prototype._getDefaultPivotIndex = function(pivotType) {
+ var pivotIndex;
+ switch (pivotType) {
+ case 0:
+ pivotIndex = 0;
+ break;
+ case 1:
+ pivotIndex = 1;
+ break;
+ case 2:
+ pivotIndex = 2;
+ break;
+ default:
+ pivotIndex = -1;
+ break
+ }
+ return pivotIndex
+ };
+ TopMoviesMarketplaceViewModel.prototype._onItemsChanging = function(newItems, oldItems) {
+ _super.prototype._onItemsChanging.call(this, newItems, oldItems);
+ if (newItems)
+ newItems.maxCount = this._maxCount
+ };
+ TopMoviesMarketplaceViewModel.ViewTypes = {topMovies: "topMovies"};
+ TopMoviesMarketplaceViewModel.Views = {topMovies: ViewModels.NodeValues.create({
+ queryOptions: {
+ autoUpdateOnSignIn: true, hasTotalCount: true
+ }, modelOptions: {
+ propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.videoDownloadItem
+ }
+ })};
+ TopMoviesMarketplaceViewModel.Pivots = {topMovies: {itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.topSellingMovies, String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_SELLING), ViewModels.NodeValues.create({
+ query: Entertainment.Data.Query.Video.EdsBrowseTopMoviesDetailed, queryOptions: {orderBy: MS.Entertainment.Data.Query.edsSortOrder.sevenDaysPurchaseCount}, modelOptions: {selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TopMovies}
+ })), new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.topRentedMovies, String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RENTALS), ViewModels.NodeValues.create({
+ query: Entertainment.Data.Query.Video.EdsBrowseTopMoviesDetailed, queryOptions: {orderBy: MS.Entertainment.Data.Query.edsSortOrder.sevenDaysRentalCount}, modelOptions: {selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TopMovies}
+ })), new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.topRatedMovies, String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RATED), ViewModels.NodeValues.create({
+ query: Entertainment.Data.Query.Video.EdsBrowseTopMoviesDetailed, queryOptions: {orderBy: MS.Entertainment.Data.Query.edsSortOrder.allTimeAverageRating}, modelOptions: {selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TopRatedMovies}
+ }))]
+ }}};
+ TopMoviesMarketplaceViewModel.Modifiers = {all: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataMovieGenres
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allGenres, String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_GENRES), ViewModels.NodeValues.create({queryOptions: {
+ genre: String.empty, studio: String.empty
+ }}))]
+ }
+ }};
+ TopMoviesMarketplaceViewModel.SecondaryModifiers = {all: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataMovieStudios
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allStudios, String.load(String.id.IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_STUDIOS), ViewModels.NodeValues.create({queryOptions: {studio: String.empty}}))]
+ }
+ }};
+ return TopMoviesMarketplaceViewModel
+ })(ViewModels.VideoMarketplaceViewModelBase);
+ ViewModels.TopMoviesMarketplaceViewModel = TopMoviesMarketplaceViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/viewmodels/video_win/toptvmarketplaceviewmodel.js:343 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ (function(TopTvMarketplacePivotTypes) {
+ TopTvMarketplacePivotTypes[TopTvMarketplacePivotTypes["topSellingTv"] = 0] = "topSellingTv";
+ TopTvMarketplacePivotTypes[TopTvMarketplacePivotTypes["topRatedTv"] = 1] = "topRatedTv"
+ })(ViewModels.TopTvMarketplacePivotTypes || (ViewModels.TopTvMarketplacePivotTypes = {}));
+ var TopTvMarketplacePivotTypes = ViewModels.TopTvMarketplacePivotTypes;
+ var TopTvMarketplaceViewModel = (function(_super) {
+ __extends(TopTvMarketplaceViewModel, _super);
+ function TopTvMarketplaceViewModel(view, pivotType) {
+ this._maxCount = 200;
+ this.title = String.load(String.id.IDS_VIDEO_LX_TV_GALLERY_TITLE);
+ var pivotIndex = this._getDefaultPivotIndex(pivotType);
+ _super.call(this, view, pivotIndex);
+ this.refresh()
+ }
+ TopTvMarketplaceViewModel.prototype.getViewDefinition = function(view) {
+ return TopTvMarketplaceViewModel.Views[view]
+ };
+ TopTvMarketplaceViewModel.prototype.getPivotDefinition = function(view) {
+ return TopTvMarketplaceViewModel.Pivots[view]
+ };
+ TopTvMarketplaceViewModel.prototype.getModifierDefinition = function(view) {
+ return TopTvMarketplaceViewModel.Modifiers.all
+ };
+ TopTvMarketplaceViewModel.prototype.getModifierOptions = function(view) {
+ var definition = this.getViewDefinition(view);
+ var pivot = this.getPivotDefinition(view);
+ return MS.Entertainment.Utilities.uniteObjects(WinJS.Utilities.getMember("value.modifierOptions", pivot), definition && definition.modelOptions)
+ };
+ TopTvMarketplaceViewModel.prototype.getSecondaryModifierDefinition = function(view) {
+ return TopTvMarketplaceViewModel.SecondaryModifiers.all
+ };
+ TopTvMarketplaceViewModel.prototype._getDefaultPivotIndex = function(pivotType) {
+ var pivotIndex;
+ switch (pivotType) {
+ case 0:
+ pivotIndex = 0;
+ break;
+ case 1:
+ pivotIndex = 1;
+ break;
+ default:
+ pivotIndex = -1;
+ break
+ }
+ return pivotIndex
+ };
+ TopTvMarketplaceViewModel.prototype._onItemsChanging = function(newItems, oldItems) {
+ _super.prototype._onItemsChanging.call(this, newItems, oldItems);
+ if (newItems)
+ newItems.maxCount = this._maxCount
+ };
+ TopTvMarketplaceViewModel.ViewTypes = {topTv: "topTv"};
+ TopTvMarketplaceViewModel.Views = {topTv: ViewModels.NodeValues.create({
+ queryOptions: {
+ autoUpdateOnSignIn: true, hasTotalCount: true
+ }, modelOptions: {
+ propertyKey: "serviceId", taskKeyGetter: Entertainment.UI.FileTransferService && Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true), notifier: Entertainment.UI.FileTransferNotifiers && Entertainment.UI.FileTransferNotifiers.episodeCollection
+ }
+ })};
+ TopTvMarketplaceViewModel.Pivots = {topTv: {itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.topSellingTv, String.load(String.id.IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_SELLING), ViewModels.NodeValues.create({
+ query: Entertainment.Data.Query.Video.EdsBrowseTvSeriesDetailed, queryOptions: {orderBy: MS.Entertainment.Data.Query.edsSortOrder.sevenDaysPurchaseCount}, modelOptions: {selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TopTvSeries}
+ })), new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.topRatedTv, String.load(String.id.IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_RATED), ViewModels.NodeValues.create({
+ query: Entertainment.Data.Query.Video.EdsBrowseTvSeriesDetailed, queryOptions: {orderBy: MS.Entertainment.Data.Query.edsSortOrder.allTimeAverageRating}, modelOptions: {selectedTemplate: new ViewModels.VideoMarketplaceLXTemplates.TopRatedTvSeries}
+ }))]
+ }}};
+ TopTvMarketplaceViewModel.Modifiers = {all: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataTvGenres
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allGenres, String.load(String.id.IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_GENRES), ViewModels.NodeValues.create({queryOptions: {
+ genre: String.empty, network: String.empty
+ }}))]
+ }
+ }};
+ TopTvMarketplaceViewModel.SecondaryModifiers = {all: {
+ itemQuery: function() {
+ return new Entertainment.Data.Query.Video.EdsMetadataTvNetworks
+ }, itemFactory: function() {
+ return [new ViewModels.Node(ViewModels.VideoLXMarketplaceAutomationIds.allStudios, String.load(String.id.IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_NETWORKS), ViewModels.NodeValues.create({queryOptions: {network: String.empty}}))]
+ }
+ }};
+ return TopTvMarketplaceViewModel
+ })(ViewModels.VideoMarketplaceViewModelBase);
+ ViewModels.TopTvMarketplaceViewModel = TopTvMarketplaceViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
diff --git a/packages/microsoft.zunevideo/ViewModels/Command.js b/packages/microsoft.zunevideo/ViewModels/Command.js
new file mode 100644
index 00000000..de99b544
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Command.js
@@ -0,0 +1,12 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {CommandViewModel: MS.Entertainment.UI.Framework.define(function(caption, isEnabled, clicked) {
+ this.caption = caption;
+ this.isEnabled = isEnabled;
+ this.clicked = clicked
+ }, {
+ caption: null, isEnabled: false, clicked: null
+ }, {})})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Home/FeaturedViewModel.js b/packages/microsoft.zunevideo/ViewModels/Home/FeaturedViewModel.js
new file mode 100644
index 00000000..b597253a
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Home/FeaturedViewModel.js
@@ -0,0 +1,410 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/observablearray.js", "/Framework/serviceLocator.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {FeaturedViewModel: MS.Entertainment.defineObservable(function featuredViewModelConstructor(query, overrideQuery, overrideFilterString) {
+ if (!query)
+ throw new Error("Query required for FeaturedViewModel");
+ this._itemMap = {};
+ this._query = query;
+ if (overrideQuery && !overrideFilterString)
+ throw new Error("Specified override query but not an override filter string");
+ this._overrideQuery = overrideQuery;
+ this._overrideFilterString = overrideFilterString;
+ this._queryWatcher = new MS.Entertainment.Framework.QueryWatcher("featuredViewModel");
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ this._dashboardRefreshBinding = MS.Entertainment.UI.Framework.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dashboardRefresher), {refreshDashboard: this._dashboardRefreshChanged.bind(this)});
+ this.wrapItem = MS.Entertainment.ViewModels.FeaturedViewModel.wrapItem
+ }, {
+ maxItems: 0, skipCount: 0, items: undefined, _itemMap: null, featuredObject: undefined, action: null, panelAction: null, wrapItem: null, _query: null, _overrideQuery: null, _overrideFilterString: null, _queryWatcher: null, _networkStatusBinding: null, _isOnline: null, _modelReady: false, _dashboardFrozen: false, _refreshOnDashboardThaw: false, _previousStringifiedItems: String.empty, _fileTransferListenerIds: null, _fileTransferHandlersRegistered: null, _addListenerIdForMediaType: function _addListenerIdForMediaType(mediaType) {
+ this._fileTransferListenerIds = this._fileTransferListenerIds || {};
+ if (!this._fileTransferListenerIds[mediaType])
+ this._fileTransferListenerIds[mediaType] = "featuredViewModel_" + mediaType + "_" + MS.Entertainment.Utilities.getSessionUniqueInteger()
+ }, _modifyQueryForContentNotifications: function _modifyQueryForContentNotifications(query) {
+ var notifications = null;
+ if (query.supportsContentNotifications && query.status === MS.Entertainment.Data.queryStatus.idle) {
+ var resultModifier = MS.Entertainment.UI.ContentNotification.listResult();
+ var notifications = new MS.Entertainment.UI.ContentNotification.NotificationModification(resultModifier, MS.Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true));
+ notifications.modifyQuery(this._query)
+ }
+ return notifications
+ }, _registerContentNotificationListener: function _registerContentNotificationListener(sender) {
+ var fileTransferService;
+ var taskKeyGetter;
+ var fileTransferNotifiers;
+ var currentItem;
+ var currentMediaType;
+ var notificationFilter;
+ var itemsLength = (this.items && this.items.length) ? this.items.length : 0;
+ if (!sender || itemsLength <= 0)
+ return;
+ MS.Entertainment.ViewModels.assert(!this._fileTransferHandlersRegistered, "_registerContentNotificationListener called more than once which was not expected");
+ this._fileTransferHandlersRegistered = {};
+ fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ notificationFilter = this._filterNotifications.bind(this);
+ for (var i = 0; i < itemsLength; i++) {
+ currentItem = this.items[i];
+ currentMediaType = currentItem && currentItem.mediaType;
+ if (!currentItem || currentItem.isFlexHub || this._fileTransferHandlersRegistered[currentMediaType])
+ continue;
+ switch (currentMediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("albumMediaId", false, true);
+ fileTransferNotifiers = MS.Entertainment.UI.FileTransferNotifiers.trackCollection;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true);
+ fileTransferNotifiers = MS.Entertainment.UI.FileTransferNotifiers.genericFile;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ break;
+ default:
+ MS.Entertainment.ViewModels.fail("Unexpected item type: " + currentItem.type);
+ break
+ }
+ if (taskKeyGetter && fileTransferNotifiers) {
+ this._addListenerIdForMediaType(currentMediaType);
+ fileTransferService.registerListener(this._fileTransferListenerIds[currentMediaType], taskKeyGetter, sender, fileTransferNotifiers, null, notificationFilter);
+ this._fileTransferHandlersRegistered[currentMediaType] = true
+ }
+ }
+ }, _filterNotifications: function _filterNotifications(notificationId) {
+ return (!notificationId || !this._itemMap || !this._itemMap[notificationId.toLowerCase()])
+ }, canDisplayMediaType: function filterUnsupportedTypes(item) {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var showEditorialEpisodes = config.video.supportsEditorialTVEpisodes;
+ var canDisplayMediaType = false;
+ if (item && item.actionType && item.actionType.mediaType)
+ if (item.isFlexHub)
+ canDisplayMediaType = true;
+ else
+ switch (item.actionType.mediaType) {
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.ModernGame:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.PhoneGame:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.WindowsGame:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.XboxGame:
+ canDisplayMediaType = false;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Album:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Artist:
+ canDisplayMediaType = MS.Entertainment.Utilities.isMusicApp;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Movie:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Season:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Series:
+ canDisplayMediaType = MS.Entertainment.Utilities.isVideoApp;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Episode:
+ canDisplayMediaType = (showEditorialEpisodes && MS.Entertainment.Utilities.isVideoApp);
+ break
+ }
+ return canDisplayMediaType
+ }, getItems: function getItems(refreshing) {
+ MS.Entertainment.ViewModels.assert(this.maxItems, "Must specify number of items for FeaturedViewModel");
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ if (!this.maxItems) {
+ this.items = null;
+ return
+ }
+ this._modelReady = true;
+ var notifications = this._modifyQueryForContentNotifications(this._query);
+ var sender = null;
+ if (notifications)
+ sender = notifications.createSender();
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var showMovieTrailers = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoShowMovieTrailers);
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var showEditorialEpisodes = config.video.supportsEditorialTVEpisodes;
+ var overrideQueryPromise = {};
+ this._queryWatcher.registerQuery(this._query);
+ if (this._overrideQuery) {
+ this._queryWatcher.registerQuery(this._overrideQuery);
+ overrideQueryPromise = this._overrideQuery.execute().then(function arrayOverrideResults(overrideResults) {
+ if (overrideResults.result.entries && overrideResults.result.entries.count)
+ return overrideResults.result.entries.toArray();
+ return null
+ }).then(function filterOverrideResults(overrideResultArray) {
+ if (!overrideResultArray)
+ return;
+ var overrideItem = null;
+ var overrideItemSplitSequenceId = null;
+ var goodOverrideItemArray = [];
+ var hasValidMediaTarget = function(checkOverrideItem) {
+ return (checkOverrideItem && checkOverrideItem.actionTarget && (checkOverrideItem.isFlexHub || (!MS.Entertainment.Utilities.isEmptyGuid(checkOverrideItem.actionTarget) && MS.Entertainment.Utilities.isValidGuid(checkOverrideItem.actionTarget))))
+ };
+ overrideResultArray.forEach(function iterateOverrideItems(overrideItem) {
+ if (overrideItem.items && overrideItem.items[0]) {
+ var itemIsFlexHub = overrideItem.items[0].actionType.mediaType === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub;
+ var itemIsZuneFlexHub = overrideItem.items[0].actionType.mediaType === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.ZuneFlexHub;
+ setProperty(overrideItem.items[0], "isFlexHub", itemIsFlexHub || itemIsZuneFlexHub);
+ setProperty(overrideItem.items[0], "queryId", this._overrideQuery.queryId);
+ if (hasValidMediaTarget(overrideItem.items[0]) && this.canDisplayMediaType(overrideItem.items[0]))
+ if (overrideItem.overrideSequenceId && overrideItem.overrideSequenceId.split) {
+ overrideItemSplitSequenceId = overrideItem.overrideSequenceId.split(".");
+ if (overrideItemSplitSequenceId.length === 3)
+ if (overrideItemSplitSequenceId[0].toLowerCase() === this._overrideFilterString) {
+ overrideItem.splitSequenceId = overrideItemSplitSequenceId;
+ goodOverrideItemArray.push(overrideItem)
+ }
+ }
+ }
+ }.bind(this));
+ return goodOverrideItemArray
+ }.bind(this), function overrideFailed() {
+ return null
+ })
+ }
+ var mainQueryPromise = this._query.execute().then(function queryComplete(q) {
+ return MS.Entertainment.ViewModels.FeaturedViewModel._safeGetFirstItem(q)
+ }.bind(this)).then(function filterMainQueryItems(result) {
+ var itemsEditorial = MS.Entertainment.ViewModels.FeaturedViewModel._safeGetEditorialItemsFromOuterItem(result).filter(function(item) {
+ return (item && item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Album || item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Artist || item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Track || item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season || item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series || item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie || (showEditorialEpisodes && item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode) || (showMovieTrailers && item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer) || (item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub))
+ });
+ var stringifiedNewItems = JSON.stringify(itemsEditorial);
+ if (stringifiedNewItems === this._previousStringifiedItems)
+ return;
+ this._previousStringifiedItems = stringifiedNewItems;
+ var goodItems = [];
+ for (var i = this.skipCount; i < itemsEditorial.length && goodItems.length < this.maxItems; i++) {
+ var item = itemsEditorial[i];
+ setProperty(item, "queryId", this._query.queryId);
+ if (notifications) {
+ notifications.modifyItem(item);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(item.serviceId))
+ this._itemMap[item.serviceId.toLowerCase()] = true
+ }
+ goodItems.push(this.wrapItem(item))
+ }
+ return goodItems
+ }.bind(this));
+ var joinedPromises = WinJS.Promise.join({
+ mainQuery: mainQueryPromise, overrideQuery: overrideQueryPromise
+ }).then(function populateItems(result) {
+ var finalItemsList = result.mainQuery;
+ if (result.overrideQuery && result.overrideQuery.length)
+ for (var r = 0; r < result.overrideQuery.length; r++) {
+ var currentOverrideItem = result.overrideQuery[r];
+ for (var o = 0; o < finalItemsList.length; o++)
+ if (currentOverrideItem.splitSequenceId[2] === finalItemsList[o].target) {
+ currentOverrideItem.items[0].overrideItemUseUrl = true;
+ finalItemsList[o] = MS.Entertainment.ViewModels.FeaturedViewModel.wrapOverrideItem(currentOverrideItem.items[0]);
+ break
+ }
+ }
+ if (this.action)
+ finalItemsList.splice(finalList.length - 1, 1, this.action);
+ if (finalItemsList) {
+ var featuredContentObject = MS.Entertainment.ViewModels.FeaturedViewModel.createFeaturedContentDataSource(finalItemsList);
+ if (this.panelAction)
+ featuredContentObject.panelAction = this.panelAction;
+ this.items = finalItemsList;
+ this.featuredObject = featuredContentObject
+ }
+ if (sender)
+ this._registerContentNotificationListener(sender)
+ }.bind(this), function queryFailed() {
+ if (!refreshing)
+ this._fillEmptyResults()
+ }.bind(this));
+ return joinedPromises
+ }, _fillEmptyResults: function _fillEmptyResults() {
+ var featuredItems = [];
+ for (var i = 0; i < this.maxItems; i++)
+ featuredItems.push(this.wrapItem({}));
+ this.items = null;
+ this.featuredObject = MS.Entertainment.ViewModels.FeaturedViewModel.createFeaturedContentDataSource(featuredItems);
+ if (this.panelAction)
+ this.featuredObject.panelAction = this.panelAction
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newValue) {
+ var isOnline = false;
+ switch (newValue) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ isOnline = true;
+ break;
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ isOnline = false;
+ break
+ }
+ if (isOnline !== this._isOnline) {
+ this._isOnline = isOnline;
+ if (this._modelReady && this._isOnline)
+ this.getItems()
+ }
+ }, _dashboardRefreshChanged: function _dashboardRefreshChanged() {
+ if (!this._dashboardFrozen) {
+ if (this._modelReady)
+ this.getItems(true)
+ }
+ else
+ this._refreshOnDashboardThaw = true
+ }, dashboardFreezeHandler: function dashboardFreezeHandler() {
+ this._dashboardFrozen = true
+ }, dashboardThawHandler: function dashboardThawHandler() {
+ if (this._refreshOnDashboardThaw) {
+ this._refreshOnDashboardThaw = false;
+ if (this._modelReady)
+ WinJS.Promise.timeout(MS.Entertainment.UI.DashboardRefresherService.refreshDelayTime).then(function timeoutFunction() {
+ this.getItems(true)
+ }.bind(this))
+ }
+ this._dashboardFrozen = false
+ }
+ }, {
+ _safeGetFirstItem: function _safeGetFirstItem(query) {
+ if (!query) {
+ MS.Entertainment.ViewModels.assert(false, "Unexpected null query passed to _safeGetFirstItem");
+ return WinJS.Promise.wrap(null)
+ }
+ var result = query.result;
+ if (!result) {
+ MS.Entertainment.ViewModels.assert(false, "Query without result passed to _safeGetFirstItem");
+ return WinJS.Promise.wrap(null)
+ }
+ var entries = result.entries;
+ if (!entries || !entries.itemsFromIndex(0)) {
+ MS.Entertainment.ViewModels.assert(false, "Query result passed to _safeGetFirstItem has no outer container");
+ return WinJS.Promise.wrap(null)
+ }
+ return entries.itemsFromIndex(0)
+ }, _safeGetEditorialItemsFromOuterItem: function _safeGetEditorialItemsFromOuterItem(item) {
+ if (!item || !item.items[0] || !item.items[0].data) {
+ MS.Entertainment.ViewModels.assert(false, "Item passed to _safeGetEditorialItemsFromOuterItem has no data");
+ return null
+ }
+ return item.items[0].data.editorialItems
+ }, createFeaturedContentDataSource: function createFeaturedContentDataSource(flatItems) {
+ return {bindableItems: new MS.Entertainment.ObservableArray(flatItems).bindableItems}
+ }, wrapOverrideItem: function wrapOverrideItem(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var popOverConstructor = null;
+ switch (item.actionType.mediaType) {
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Movie:
+ popOverConstructor = "MS.Entertainment.Pages.MovieInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Artist:
+ popOverConstructor = "MS.Entertainment.Pages.MusicArtistInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Album:
+ popOverConstructor = "MS.Entertainment.Pages.MusicAlbumInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Series:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Episode:
+ popOverConstructor = MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl();
+ break
+ }
+ var mediaItem = WinJS.Binding.unwrap(item);
+ if (mediaItem.actionType.location === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub || mediaItem.actionType.location === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.ZuneFlexHub) {
+ var flexHubClick = function flexHubClicked() {
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!stateService.servicesEnabled)
+ return MS.Entertainment.UI.Shell.showAppUpdateDialog();
+ mediaItem.overrideItemUseUrl = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.flexHubPage, MS.Entertainment.UI.Monikers.flexHub, null, {query: mediaItem.actionTarget})
+ };
+ setProperty(mediaItem, "doclick", flexHubClick)
+ }
+ else {
+ var itemClicked = function itemClicked() {
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!stateService.servicesEnabled)
+ return MS.Entertainment.UI.Shell.showAppUpdateDialog();
+ var popOverParameters = {itemConstructor: popOverConstructor};
+ popOverParameters.dataContext = {
+ data: mediaItem, location: MS.Entertainment.Data.ItemLocation.marketplace
+ };
+ mediaItem.overrideItemUseUrl = false;
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ };
+ setProperty(mediaItem, "doclick", itemClicked)
+ }
+ return mediaItem
+ }, wrapItem: function wrapItem(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var query;
+ var promoClicked;
+ var flexHubClicked;
+ var popOverConstructor;
+ var mediaItem = item;
+ var showItemDetails = true;
+ switch (item.type) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ popOverConstructor = "MS.Entertainment.Pages.MovieInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ popOverConstructor = MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl();
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Artist:
+ popOverConstructor = "MS.Entertainment.Pages.MusicArtistInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Album:
+ popOverConstructor = "MS.Entertainment.Pages.MusicAlbumInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Track:
+ popOverConstructor = "MS.Entertainment.Pages.MusicArtistInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ setProperty(item, "isFlexHub", true);
+ break;
+ default:
+ showItemDetails = false;
+ MS.Entertainment.ViewModels.assert(item.type === undefined, "Unknown type passed into wrapItem: " + item.type);
+ break
+ }
+ if (item.type !== MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub) {
+ var queriedData;
+ if (item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Track) {
+ query = new MS.Entertainment.Data.Query.Music.SongDetails;
+ if (query) {
+ query.id = item.serviceId;
+ query.idType = item.serviceIdType;
+ query.execute().done(function querySuccess(q) {
+ queriedData = q.result.item
+ }, function queryFailure(){})
+ }
+ }
+ else
+ queriedData = mediaItem;
+ promoClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function promoClicked(e) {
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!stateService.servicesEnabled)
+ return MS.Entertainment.UI.Shell.showAppUpdateDialog();
+ if (!this._isOnline) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ else if (queriedData && showItemDetails) {
+ var popOverParameters = {
+ itemConstructor: popOverConstructor, dataContext: {
+ location: MS.Entertainment.Data.ItemLocation.marketplace, data: queriedData
+ }
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ }, this);
+ setProperty(item, "doclick", promoClicked)
+ }
+ else {
+ flexHubClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function flexHubClicked(e) {
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!stateService.servicesEnabled)
+ return MS.Entertainment.UI.Shell.showAppUpdateDialog();
+ if (!this._isOnline) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.flexHubPage, MS.Entertainment.UI.Monikers.flexHub, null, {
+ query: item.target, sourceQueryId: item.queryId
+ })
+ }, this);
+ setProperty(item, "doclick", flexHubClicked)
+ }
+ return item
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Home/SpotlightViewModel.js b/packages/microsoft.zunevideo/ViewModels/Home/SpotlightViewModel.js
new file mode 100644
index 00000000..ac9b2f58
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Home/SpotlightViewModel.js
@@ -0,0 +1,373 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/observablearray.js", "/Framework/serviceLocator.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {SpotlightViewModel: MS.Entertainment.defineObservable(function spotlightViewModelConstructor(query) {
+ if (MS.Entertainment.ViewModels.SpotlightViewModel.currentSpotlightViewModel)
+ MS.Entertainment.ViewModels.SpotlightViewModel.currentSpotlightViewModel.cleanUp();
+ MS.Entertainment.ViewModels.SpotlightViewModel.currentSpotlightViewModel = this;
+ if (!query)
+ throw new Error("Query required for SpotlightViewModel");
+ this._query = query;
+ this._queryWatcher = new MS.Entertainment.Framework.QueryWatcher("spotlightViewModel");
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ this._dashboardRefreshBinding = MS.Entertainment.UI.Framework.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dashboardRefresher), {refreshDashboard: this._dashboardRefreshChanged.bind(this)});
+ this.itemClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this.itemClicked, this);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ MS.Entertainment.ViewModels.SpotlightViewModel._ignoreFirstBind = true;
+ if (!MS.Entertainment.ViewModels.SpotlightViewModel._signOutHandler)
+ MS.Entertainment.ViewModels.SpotlightViewModel._signOutHandler = WinJS.Binding.bind(signIn, {isSignedIn: this.handleSignOut.bind(this)});
+ if (!MS.Entertainment.ViewModels.SpotlightViewModel._signingInHandler)
+ MS.Entertainment.ViewModels.SpotlightViewModel._signingInHandler = WinJS.Binding.bind(signIn, {isSigningIn: this.handleIsSigningIn.bind(this)});
+ MS.Entertainment.ViewModels.SpotlightViewModel._ignoreFirstBind = false
+ }
+ }, {
+ maxItems: 0, action: null, items: undefined, featuredObject: undefined, filterWebBlendActions: false, _query: null, _queryWatcher: null, _networkStatusBinding: null, _dashboardRefreshBinding: null, _isOnline: null, _modelReady: false, _maxQueryTimeMS: 2000, _queryTimeoutPromise: null, _dashboardFrozen: false, _refreshOnDashboardThaw: false, _previousStringifiedItems: String.empty, _maxRecommendationItems: 4, _recommendationRefreshRate: 1800000, _recommendationUpdatePromise: null, _secondaryPanelTitleLoaded: false, cleanUp: function cleanUp(){}, getItems: function getItems(refreshing) {
+ MS.Entertainment.ViewModels.assert(this.maxItems, "Must specify number of items for SpotlightViewModel");
+ if (!this.maxItems) {
+ this.items = null;
+ return WinJS.Promise.wrap()
+ }
+ this._modelReady = true;
+ this._queryWatcher.registerQuery(this._query);
+ this._query.aggregateChunks = false;
+ this._queryTimeoutPromise = WinJS.Promise.timeout(this._maxQueryTimeMS).then(function showDefault() {
+ this._queryTimeoutPromise = null;
+ if (!this.featuredObject && !refreshing)
+ this._setDefaultItems(false)
+ }.bind(this));
+ return this._query.execute().then(function queryComplete(q) {
+ if (this._queryTimeoutPromise) {
+ WinJS.Binding.unwrap(this._queryTimeoutPromise).cancel();
+ this._queryTimeoutPromise = null
+ }
+ if (q.result.entries && q.result.entries.count)
+ return q.result.entries.toArray();
+ else
+ return WinJS.Promise.wrapError("no entries returned")
+ }.bind(this)).then(this.populateItems.bind(this), function queryError(q) {
+ if (!refreshing)
+ this._setDefaultItems(true)
+ }.bind(this)).then(function gotItems() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if ((signIn.isSignedIn || signIn.signInError) && !signIn.isSigningIn && !signIn.isSigningOut)
+ this.updateRecommendationPanel();
+ this.loadFeaturedSetsPanel()
+ }.bind(this))
+ }, populateItems: function populateItems(queryItems) {
+ var stringifiedNewItems = JSON.stringify(queryItems);
+ if (stringifiedNewItems === this._previousStringifiedItems)
+ return;
+ this._previousStringifiedItems = stringifiedNewItems;
+ queryItems.sort(function sortQueryItems(a, b) {
+ return a.sequenceId - b.sequenceId
+ });
+ var spotlightItems = new MS.Entertainment.ObservableArray;
+ var item;
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var maxItems = (this.maxItems > 0) ? this.maxItems : queryItems.length;
+ for (var i = 0; i < queryItems.length && spotlightItems.length < maxItems; i++) {
+ var items = WinJS.Utilities.getMember("items", queryItems[i]);
+ if (!items || !items.length)
+ continue;
+ item = this.wrapItem(items[0]);
+ var itemIsFlexHub = item.action && item.action.type === MS.Entertainment.Data.Augmenter.Spotlight.ActionType.FlexHub;
+ var itemIsZuneFlexHub = item.spotlightAction && item.spotlightAction.type === MS.Entertainment.Data.Augmenter.Spotlight.ActionType.ZuneFlexHub;
+ setProperty(item, "isFlexHub", itemIsFlexHub || itemIsZuneFlexHub);
+ setProperty(item, "sequenceId", queryItems[i].sequenceId);
+ setProperty(item, "queryId", queryItems[i].queryId);
+ var filterFlexHub = (itemIsFlexHub && MS.Entertainment.Utilities.isMusicApp);
+ if (!filterFlexHub && (!this.filterWebBlendActions || item.type !== MS.Entertainment.Data.Augmenter.Spotlight.ItemType.WebBlend) && (item.type !== MS.Entertainment.Data.Augmenter.Spotlight.ItemType.Media || (this._hasValidMediaTarget(item) && this._canDisplayMediaType(item))))
+ spotlightItems.push(item)
+ }
+ this.items = spotlightItems;
+ this.featuredObject = this._createFeaturedObject(spotlightItems)
+ }, handleIsSigningIn: function handleIsSigningIn(newValue, oldValue) {
+ if (MS.Entertainment.ViewModels.SpotlightViewModel._ignoreFirstBind)
+ return;
+ if (!newValue)
+ if (MS.Entertainment.ViewModels.SpotlightViewModel.currentSpotlightViewModel)
+ MS.Entertainment.ViewModels.SpotlightViewModel.currentSpotlightViewModel.updateRecommendationPanel()
+ }, handleSignOut: function handleSignOut(newValue, oldValue) {
+ if (MS.Entertainment.ViewModels.SpotlightViewModel._ignoreFirstBind)
+ return;
+ if (!newValue)
+ if (MS.Entertainment.ViewModels.SpotlightViewModel.currentSpotlightViewModel)
+ MS.Entertainment.ViewModels.SpotlightViewModel.currentSpotlightViewModel.updateRecommendationPanel()
+ }, updateRecommendationPanel: function updateRecommendationPanel() {
+ if (!MS.Entertainment.Utilities.isVideoApp1)
+ return;
+ if (this._recommendationUpdatePromise) {
+ WinJS.Binding.unwrap(this._recommendationUpdatePromise).cancel();
+ this._recommendationUpdatePromise = null
+ }
+ this._recommendationUpdatePromise = WinJS.Promise.timeout(this._recommendationRefreshRate).then(function recommendationUpdate() {
+ this.updateRecommendationPanel()
+ }.bind(this));
+ var recommendationQuery = new MS.Entertainment.Data.Query.EdsVideoRecommendations;
+ recommendationQuery.execute().then(function executed(q) {
+ var recommendationItems = WinJS.Utilities.getMember("result.filteredItemsArray", q);
+ var itemOffset = 0;
+ var itemsToDisplay = new MS.Entertainment.ObservableArray;
+ var zuneId = WinJS.Utilities.getMember("featuredObject.recommendationItems.item0.zuneId", this);
+ if (recommendationItems && (recommendationItems.length > 0)) {
+ if (zuneId === recommendationItems[0].zuneId)
+ itemOffset = this._maxRecommendationItems;
+ for (var i = itemOffset; i < recommendationItems.length && i - itemOffset < this._maxRecommendationItems; i++) {
+ var item = recommendationItems[i];
+ this._addDashboardInvokeHandler(item);
+ itemsToDisplay.push(item)
+ }
+ }
+ this._addRecommendationsToFeaturedObject(itemsToDisplay)
+ }.bind(this), function recommendationQueryError(q) {
+ return null
+ }.bind(this))
+ }, loadFeaturedSetsPanel: function loadFeaturedSetsPanel() {
+ if (!MS.Entertainment.Utilities.isVideoApp1)
+ return;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var featuredSetsEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoFeaturedSetsEnabled);
+ if (!featuredSetsEnabled) {
+ this.featuredObject.showFeaturedSets = false;
+ this.featuredObject.showFeaturedSetsPlaceholder = false;
+ return
+ }
+ var featuredSetsQuery = new MS.Entertainment.Data.Query.MediaDiscoveryVideoFlexHub;
+ featuredSetsQuery.target = WinJS.Utilities.getMember("parameter.targetFeed", this) || "featuredsets";
+ return featuredSetsQuery.execute().then(function executed(q) {
+ var featuredSets = WinJS.Utilities.getMember("result.featuredSetsArray", q) || [];
+ featuredSets.forEach(this._addDashboardInvokeHandler.bind(this));
+ this.featuredObject.featuredSets = new MS.Entertainment.ObservableArray(featuredSets).bindableItems;
+ this.featuredObject.showFeaturedSets = featuredSets.length > 0;
+ this.featuredObject.showFeaturedSetsPlaceholder = !this.featuredObject.showFeaturedSets;
+ this._addShowAllFeaturedSetsInvokeHandler(this.featuredObject.featuredSets)
+ }.bind(this), function featuredSetsQueryError(error) {
+ this.featuredObject.featuredSets = null
+ }.bind(this))
+ }, _addShowAllFeaturedSetsInvokeHandler: function _addShowAllFeaturedSetsInvokeHandler(featuredSets) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var featuredSetsClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function featuredSetsClicked(e) {
+ if (this._isOnline) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var featuredSetAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.featuredSetsNavigate);
+ featuredSetAction.parameter = {page: MS.Entertainment.UI.Monikers.homeSpotlight};
+ featuredSetAction.execute()
+ }
+ }, this);
+ setProperty(featuredSets, "doclick", featuredSetsClicked)
+ }, _addDashboardInvokeHandler: function _addDashboardInvokeHandler(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var itemClicked;
+ var popOverConstructor;
+ var mediaItem = item;
+ itemClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function itemClicked(e) {
+ var showItemDetails = mediaItem.mediaType && (mediaItem.mediaType !== Microsoft.Entertainment.Queries.ObjectType.editorial);
+ if (!this._isOnline) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ else if (mediaItem && showItemDetails) {
+ var popOverParameters = {
+ itemConstructor: popOverConstructor, dataContext: {
+ location: MS.Entertainment.Data.ItemLocation.marketplace, data: mediaItem
+ }
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ else if (mediaItem && !showItemDetails) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var featuredSetAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.featuredSetsNavigate);
+ featuredSetAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.homeSpotlight, targetFeed: mediaItem.actionTarget
+ };
+ featuredSetAction.execute()
+ }
+ }, this);
+ setProperty(item, "doclick", itemClicked)
+ }, _hasValidMediaTarget: function(spotlightItem) {
+ return (spotlightItem && spotlightItem.actionTarget && (spotlightItem.isFlexHub || (!MS.Entertainment.Utilities.isEmptyGuid(spotlightItem.actionTarget) && MS.Entertainment.Utilities.isValidGuid(spotlightItem.actionTarget))))
+ }, _canDisplayMediaType: function _canDisplayMediaType(item) {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var showEditorialEpisodes = config.video.supportsEditorialTVEpisodes;
+ var canDisplayMediaType = false;
+ if (item && item.actionType && item.actionType.mediaType)
+ if (item.isFlexHub)
+ canDisplayMediaType = true;
+ else
+ switch (item.actionType.mediaType) {
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Album:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Artist:
+ canDisplayMediaType = MS.Entertainment.Utilities.isMusicApp;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Season:
+ canDisplayMediaType = !!(MS.Entertainment.Utilities.isVideoApp && MS.Entertainment.Utilities.isValidServiceId(item.seriesId));
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Movie:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Series:
+ canDisplayMediaType = MS.Entertainment.Utilities.isVideoApp;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Episode:
+ canDisplayMediaType = (showEditorialEpisodes && MS.Entertainment.Utilities.isVideoApp);
+ break
+ }
+ return canDisplayMediaType
+ }, wrapItem: function wrapItem(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ if (item.type === MS.Entertainment.Data.Augmenter.Spotlight.ItemType.Ad)
+ MS.Entertainment.ViewModels.SpotlightViewModel.WrapAd(item);
+ else if (item.type === MS.Entertainment.Data.Augmenter.Spotlight.ItemType.WebBlend)
+ MS.Entertainment.ViewModels.SpotlightViewModel.WrapWebBlendAction(item);
+ else if (item.actionType)
+ setProperty(item, "doclick", this.itemClicked);
+ return item
+ }, itemClicked: function itemClicked(e) {
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!stateService.servicesEnabled)
+ return MS.Entertainment.UI.Shell.showAppUpdateDialog();
+ var spotlightItem = e.target;
+ if (spotlightItem.action || !spotlightItem.actionType)
+ if (!this._isOnline) {
+ var popOverParameters = null;
+ popOverParameters = {itemConstructor: "MS.Entertainment.UI.Controls.FailedPanel"};
+ return MS.Entertainment.UI.Controls.PopOver.showNonMediaPopOver(popOverParameters)
+ }
+ else
+ return;
+ if (spotlightItem.type === MS.Entertainment.Data.Augmenter.Spotlight.ItemType.Ad)
+ MS.Entertainment.Utilities.Telemetry.logAdClicked(spotlightItem);
+ var popOverConstructor = null;
+ switch (spotlightItem.actionType.mediaType) {
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Movie:
+ popOverConstructor = "MS.Entertainment.Pages.MovieInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Artist:
+ popOverConstructor = "MS.Entertainment.Pages.MusicArtistInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Album:
+ popOverConstructor = "MS.Entertainment.Pages.MusicAlbumInlineDetails";
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Series:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Episode:
+ popOverConstructor = MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl();
+ break
+ }
+ var mediaItem = WinJS.Binding.unwrap(spotlightItem);
+ if (spotlightItem.type === MS.Entertainment.Data.Augmenter.Spotlight.ItemType.Ad)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersiveDetails(mediaItem, true);
+ else if (spotlightItem.actionType.location === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub || spotlightItem.actionType.location === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.ZuneFlexHub) {
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (!stateService.servicesEnabled)
+ return MS.Entertainment.UI.Shell.showAppUpdateDialog();
+ if (!this._isOnline) {
+ var errorCode = MS.Entertainment.Platform.Playback.Error.NS_E_WMPIM_USEROFFLINE.code;
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_FAILED_PANEL_HEADER), errorCode)
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.flexHubPage, MS.Entertainment.UI.Monikers.flexHub, null, {query: mediaItem.actionTarget})
+ }
+ else {
+ var popOverParameters = {itemConstructor: popOverConstructor};
+ var hydrate = mediaItem && mediaItem.hydrate && mediaItem.hydrate();
+ popOverParameters.dataContext = {
+ data: mediaItem, location: MS.Entertainment.Data.ItemLocation.marketplace
+ };
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ areaName: "dashboardSpotlight", itemPropertyBag: mediaItem
+ }, {
+ uri: MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).getUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: popOverConstructor, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.PopUp
+ });
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ }, _createFeaturedObject: function _createFeaturedObject(spotlightItems) {
+ return {
+ bindableItems: spotlightItems.bindableItems, recommendationItems: WinJS.Utilities.getMember("featuredObject.recommendationItems", this), featuredSets: WinJS.Utilities.getMember("featuredObject.featuredSets", this), isOnline: this._isOnline, showFeaturedSets: true, showFeaturedSetsPlaceholder: true
+ }
+ }, _addRecommendationsToFeaturedObject: function _addRecommendationsToFeaturedObject(recommendationItems) {
+ if (this.featuredObject)
+ this.featuredObject.recommendationItems = recommendationItems.bindableItems
+ }, _setDefaultItems: function _setDefaultItems(markError) {
+ var spotlightItems = new MS.Entertainment.ObservableArray;
+ for (var i = 0; i < this.maxItems; i++)
+ spotlightItems.push(this.wrapItem(this._defaultItem()));
+ this.items = markError ? null : spotlightItems;
+ this.featuredObject = this._createFeaturedObject(spotlightItems);
+ if (markError)
+ WinJS.Promise.timeout().then(function setOfflinePanel() {
+ this.featuredObject = null
+ }.bind(this))
+ }, _defaultItem: function _defaultItem() {
+ return {primaryText: String.empty}
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newValue) {
+ window.msWriteProfilerMark("spotlightViewModel_ onNetworkStatusChanged: " + newValue);
+ var isOnline = false;
+ switch (newValue) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ isOnline = true;
+ break;
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ isOnline = false;
+ break
+ }
+ if (isOnline !== this._isOnline) {
+ this._isOnline = isOnline;
+ if (this._modelReady)
+ if (isOnline)
+ this.getItems()
+ }
+ if (this.featuredObject)
+ this.featuredObject.isOnline = this._isOnline
+ }, _dashboardRefreshChanged: function _dashboardRefreshChanged() {
+ if (!this._dashboardFrozen) {
+ if (this._modelReady)
+ this.getItems(true)
+ }
+ else
+ this._refreshOnDashboardThaw = true
+ }, dashboardFreezeHandler: function dashboardFreezeHandler() {
+ this._dashboardFrozen = true
+ }, dashboardThawHandler: function dashboardThawHandler() {
+ if (this._refreshOnDashboardThaw) {
+ this._refreshOnDashboardThaw = false;
+ if (this._modelReady)
+ WinJS.Promise.timeout(MS.Entertainment.UI.DashboardRefresherService.refreshDelayTime).then(function timeoutFunction() {
+ this.getItems(true)
+ }.bind(this))
+ }
+ this._dashboardFrozen = false
+ }
+ }, {
+ currentSpotlightViewModel: null, _signOutHandler: null, _signingInHandler: null, _ignoreFirstBind: false, WrapAd: function WrapAd(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ MS.Entertainment.ViewModels.assert(item.type === MS.Entertainment.Data.Augmenter.Spotlight.ItemType.Ad, "cant wrap a non-ad in an ad");
+ setProperty(item, "caption", String.load(String.id.IDS_ADVERTISEMENT));
+ if (item.actionType && item.actionType.location === MS.Entertainment.Data.Augmenter.Spotlight.ActionType.Web) {
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalAdNavigate);
+ action.parameter = {link: item.actionTarget};
+ setProperty(item, "action", action);
+ setProperty(item, "doclick", MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function executeAction() {
+ action.executed(item.actionTarget)
+ }))
+ }
+ }, WrapWebBlendAction: function WrapWebBlendAction(item) {
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var actionTarget = item.actionTarget && MS.Entertainment.UI.Actions.ActionIdentifiers[item.actionTarget];
+ MS.Entertainment.ViewModels.assert(item.type === MS.Entertainment.Data.Augmenter.Spotlight.ItemType.WebBlend, "cant wrap a non-WebBlend Action");
+ MS.Entertainment.ViewModels.assert(actionTarget, "invalid action target passed in");
+ if (item.actionType && item.actionType.location === MS.Entertainment.Data.Augmenter.Spotlight.ActionType.WebBlend && actionTarget)
+ setProperty(item, "doclick", MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(function executeAction() {
+ var action = actionService.getAction(actionTarget);
+ action.execute()
+ }))
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Immersive/ImmersiveViewModels.js b/packages/microsoft.zunevideo/ViewModels/Immersive/ImmersiveViewModels.js
new file mode 100644
index 00000000..7245d9ba
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Immersive/ImmersiveViewModels.js
@@ -0,0 +1,37 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {
+ BaseHeroViewModel: MS.Entertainment.deferredDerive(MS.Entertainment.Utilities.EventInvoker, function baseHeroViewModel(mediaItem) {
+ this.base();
+ this.mediaItem = mediaItem
+ }, {
+ mediaItem: null, buttons: null, actionDescription: null, sessionId: null, heroImageMediaItem: null, _addButtons: function _addButtons(buttons) {
+ var buttonKey;
+ if (!this.buttons)
+ this.buttons = new MS.Entertainment.ObservableArray([]);
+ if (buttons)
+ for (buttonKey in buttons)
+ if (buttons.hasOwnProperty(buttonKey) && buttons[buttonKey])
+ this.buttons.push(buttons[buttonKey])
+ }
+ }), BaseImmersiveListViewModel: MS.Entertainment.defineObservable(function baseImmersiveListViewModelConstructor(){}, {
+ items: null, heroItem: null, heroActionItem: null, selectedTemplate: null, columnSpan: 2, maxItems: 8, _heroAugmentation: null, _setItems: function _setItems(data) {
+ if (Array.isArray(data) && data.length)
+ if (this.columnSpan > 1) {
+ this.items = data.length > 1 ? data.slice(1, this.maxItems) : [];
+ this.heroItem = data[0] ? this._createHeroItem(data[0]) : null;
+ this.heroActionItem = data[0]
+ }
+ else
+ this.items = data.slice(0, this.maxItems)
+ }, _createHeroItem: function _createHeroItem(item) {
+ if (this._heroAugmentation)
+ return MS.Entertainment.Data.augment(item || {}, this._heroAugmentation);
+ else
+ return item
+ }
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Music/MusicHubCollectionPanel.js b/packages/microsoft.zunevideo/ViewModels/Music/MusicHubCollectionPanel.js
new file mode 100644
index 00000000..2fb3f9b9
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Music/MusicHubCollectionPanel.js
@@ -0,0 +1,120 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {MusicHubCollectionPanel: MS.Entertainment.UI.Framework.define(function musicHubCollectionPanelConstructor() {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var maxItemsPerRow = MS.Entertainment.Utilities.HIGH_RESOLUTION_ROWS;
+ var maxItems = maxItemsPerRow * 3;
+ var albumQuery = new MS.Entertainment.Data.Query.libraryAlbums;
+ albumQuery.queryId = MS.Entertainment.UI.Monikers.musicCollection;
+ albumQuery.sort = Microsoft.Entertainment.Queries.AlbumsSortBy.recentlyPlayedDescending;
+ albumQuery.isLive = true;
+ albumQuery.chunkSize = maxItems;
+ var playlistQuery = new MS.Entertainment.Data.Query.libraryPlaylists;
+ playlistQuery.queryId = MS.Entertainment.UI.Monikers.musicCollection;
+ playlistQuery.sort = Microsoft.Entertainment.Queries.PlaylistsSortBy.recentlyPlayedDescending;
+ playlistQuery.isLive = true;
+ playlistQuery.chunkSize = maxItems;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var musicSmartDJEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.smartDJMarketplace);
+ var freeStreamEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay);
+ var subscriptionEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSubscription);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (musicSmartDJEnabled && (subscriptionEnabled || freeStreamEnabled) && configurationManager.service.lastSignedInUserXuid) {
+ var smartDJQuery = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.smartDJList);
+ smartDJQuery.queryId = MS.Entertainment.UI.Monikers.musicCollection;
+ this.musicQuery = [albumQuery, playlistQuery, smartDJQuery]
+ }
+ else
+ this.musicQuery = [albumQuery, playlistQuery];
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var browseAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.musicCollectionNavigate);
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ browseAction.title = String.load(String.id.IDS_MY_MUSIC_BUTTON_DESC);
+ browseAction.mediaType = "actionButton";
+ browseAction.icon = MS.Entertainment.UI.Icon.flexhub;
+ this.panelAction = browseAction
+ }
+ else
+ browseAction.title = String.load(String.id.IDS_MUSIC_COLLECTION_PIVOT);
+ this.panelAction = {action: browseAction};
+ this._uiStateBindings = WinJS.Binding.bind(uiState, {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ this.emptyLibraryModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ this.emptyLibraryModel.primaryStringId = String.id.IDS_COLLECTION_MUSIC_EMPTY;
+ this.emptyLibraryModel.details = this._getEmptyCollectionDetails()
+ }, {
+ musicQuery: null, panelAction: null, emptyLibraryModel: null, doNotRaisePanelReady: true, dispose: function dispose() {
+ if (this._uiStateBindings) {
+ this._uiStateBindings.cancel();
+ this._uiStateBindings = null
+ }
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged() {
+ if (this._uiStateBindings && this.emptyLibraryModel)
+ this.emptyLibraryModel.details = this._getEmptyCollectionDetails()
+ }, _getEmptyCollectionDetails: function _getEmptyCollectionDetails() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var onMoreAboutLibrariesAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showLocalGrovelInfoDialog);
+ var details = [];
+ if (MS.Entertainment.Utilities.isMusicApp1)
+ details = [{
+ stringId: String.id.IDS_COLLECTION_MUSIC_EMPTY_2, linkStringId: String.id.IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK, linkAction: onMoreAboutLibrariesAction, linkIcon: MS.Entertainment.UI.Icon.search
+ }];
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var navigateToMusicMarketplace = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateToMusicMarketplace.disableWhenOffline = true;
+ navigateToMusicMarketplace.disableOnServicesDisabled = true;
+ navigateToMusicMarketplace.parameter = MS.Entertainment.UI.Monikers.musicMarketplace;
+ details.push({
+ stringId: String.id.IDS_MUSIC_COLLECTION_EMPTY_DESC, linkStringId: String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK, linkAction: navigateToMusicMarketplace, linkIcon: MS.Entertainment.UI.Icon.flexhub
+ })
+ }
+ return details
+ }, libraryClicked: WinJS.Utilities.markSupportedForProcessing(function libraryClicked(item) {
+ var mediaItem = item.target;
+ if (mediaItem.smartDJ) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var playSmartDJAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.playSmartDJ);
+ playSmartDJAction.automationId = MS.Entertainment.UI.AutomationIds.libraryPlaySmartDJ;
+ playSmartDJAction.parameter = {
+ mediaItem: mediaItem.artist, showAppBar: true
+ };
+ playSmartDJAction.execute()
+ }
+ else {
+ var popOverConstructor = null;
+ var collectionPanelData = {location: MS.Entertainment.Data.ItemLocation.collection};
+ if (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ popOverConstructor = "MS.Entertainment.Pages.MusicAlbumInlineDetails";
+ else
+ popOverConstructor = item.panelConstructor;
+ var popOverParameters = {itemConstructor: popOverConstructor};
+ popOverParameters.dataContext = {
+ data: mediaItem, location: MS.Entertainment.Data.ItemLocation.collection
+ };
+ popOverParameters.dataContext.data = mediaItem;
+ if (mediaItem.itemQuery)
+ if (Array.isArray(mediaItem.itemQuery))
+ mediaItem.itemQuery.forEach(function pauseQuery(query) {
+ if (query.pause)
+ query.pause()
+ });
+ else if (mediaItem.itemQuery.pause)
+ mediaItem.itemQuery.pause();
+ MS.Entertainment.UI.Controls.PopOver.showPopOver(popOverParameters).done(function unPauseQuery() {
+ if (mediaItem.itemQuery)
+ if (Array.isArray(mediaItem.itemQuery))
+ mediaItem.itemQuery.forEach(function unPauseQuery(query) {
+ if (query.unpause)
+ query.unpause()
+ });
+ else if (mediaItem.itemQuery.unpause)
+ mediaItem.itemQuery.unpause()
+ })
+ }
+ })
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Search/NewSearchViewModel.js b/packages/microsoft.zunevideo/ViewModels/Search/NewSearchViewModel.js
new file mode 100644
index 00000000..6e43827a
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Search/NewSearchViewModel.js
@@ -0,0 +1,352 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.ViewModels");
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {NewSearchViewModel: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.QueryViewModel", function newSearchViewModelConstructor(searchType, marketplaceEnabled, updateTitleOnFailureOnly) {
+ this._searchType = searchType;
+ this._updateTitleOnFailureOnly = updateTitleOnFailureOnly;
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ this._searchBindings = WinJS.Binding.bind(currentPage, {options: this._keywordChanged.bind(this)});
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.mediaDeleted)) {
+ var deleteService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.mediaDeleted);
+ this._deletedEvents = MS.Entertainment.Utilities.addEventHandlers(deleteService, {mediaDeleted: this._refreshOnDelete.bind(this)})
+ }
+ MS.Entertainment.ViewModels.QueryViewModel.prototype.constructor.call(this, searchType)
+ }, {
+ _searchType: String.empty, _useEDS: true, _query: String.empty, _linguisticAlternatives: null, _startedQuery: false, _resultIndices: null, _resultPopulated: null, _enabled: false, _searchBindings: null, _deletedEvents: null, _isOnline: true, _hideHcrIfOffline: false, _hasSearchedAtLeastOnce: false, _maxResultCount: 100, _views: null, _searchViewModel: null, _searchCallbacks: null, _searchTypeResults: null, _chosenSuggestion: null, _hcrResult: null, _addHcrToResults: false, _searchItems: null, _frozen: false, _disposed: false, _updateTitleOnFailureOnly: false, _keepPivotOnEmpty: false, dispose: function dispose() {
+ MS.Entertainment.ViewModels.QueryViewModel.prototype.dispose.call(this);
+ if (this._searchBindings) {
+ this._searchBindings.cancel();
+ this._searchBindings = null
+ }
+ if (this._deletedEvents) {
+ this._deletedEvents.cancel();
+ this._deletedEvents = null
+ }
+ this._disposed = true
+ }, freeze: function freeze() {
+ this._frozen = true
+ }, thaw: function thaw() {
+ if (this.refreshOnThaw)
+ this.refresh();
+ this._frozen = false
+ }, getViewDefinition: function getViewDefinition(view) {
+ return this._views[view]
+ }, getModifierDefinition: function getModifierDefinition(view) {
+ MS.Entertainment.ViewModels.assert(false, "base.getModifierDefinition should never be called")
+ }, createActionCells: function createActionCells() {
+ return this.selectedTemplate && this.selectedTemplate.showModifierActions ? this.createModifierActionCells(this.selectedTemplate.strings.modifierGroupHeader) : null
+ }, hasSearchedAtLeastOnce: function hasSearchedAtLeastOnce() {
+ return this._hasSearchedAtLeastOnce
+ }, _keywordChanged: function _keywordChanged(newValue, oldValue) {
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ if (this._query)
+ this.pivotSelectedIndexOverride = 0;
+ if (currentPage.options && currentPage.options.chosenSuggestion && currentPage.options.chosenSuggestion !== this._chosenSuggestion)
+ this._chosenSuggestion = currentPage.options.chosenSuggestion;
+ else
+ this._chosenSuggestion = null;
+ if (currentPage.options && currentPage.options.linguisticAlternatives)
+ this._linguisticAlternatives = currentPage.options.linguisticAlternatives;
+ else
+ this._linguisticAlternatives = null;
+ if (currentPage.options && currentPage.options.keyword) {
+ this._query = currentPage.options.keyword.trim();
+ this.titleFormatValues = this._query;
+ this.refresh()
+ }
+ }, _refreshOnDelete: function _refreshOnDelete() {
+ if (this._frozen) {
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ searchResultCounts.clearOnRestore = true;
+ this.refreshOnThaw = true
+ }
+ else {
+ MS.Entertainment.UI.Controls.PopOver.dismissCurrentPopOver();
+ this.refresh()
+ }
+ }, _handleBeginQuery: function _handleBeginQuery(view, pivot, modifier) {
+ if (this._disposed)
+ return;
+ this._isOnline = MS.Entertainment.UI.NetworkStatusService.isOnline();
+ this.isLoading = true;
+ if (this.items) {
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ searchResultCounts.clearCounts();
+ MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter = this.modifierSelectionManager.selectedIndex
+ }
+ this._setItems(null);
+ this._searchItems = new MS.Entertainment.Data.VirtualList;
+ this._clearSearch();
+ if (!this._query || this._query.length < 1)
+ this._searchCompleted();
+ else {
+ var typeLength = this._searchTypeResults[this.view].length;
+ var modelOptions;
+ if (this.modifierSelectionManager.selectedItem)
+ modelOptions = this.modifierSelectionManager.selectedItem.value.modelOptions;
+ else if (this.modifierSelectionManager.dataSource && this.modifierSelectionManager.dataSource.item(0))
+ modelOptions = this.modifierSelectionManager.dataSource.item(0).value.modelOptions;
+ else
+ modelOptions = {};
+ modelOptions.linguisticAlternatives = this._linguisticAlternatives;
+ for (var i = 0; i < typeLength; i++)
+ this[this._searchTypeResults[this.view][i].callFunction](this._query, i, modelOptions)
+ }
+ }, _clearSearch: function _clearSearch() {
+ this.isFailed = false;
+ if (this._updateTitleOnFailureOnly)
+ this.titleOverride = String.empty;
+ else if (MS.Entertainment.Utilities.isVideoApp1) {
+ var stringId = String.id.IDS_VIDEO_SEARCH_ALL_RESULT_TITLE;
+ if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchAll)
+ stringId = String.id.IDS_VIDEO_SEARCH_ALL_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchMovies)
+ stringId = String.id.IDS_VIDEO_SEARCH_MOVIE_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchTV)
+ stringId = String.id.IDS_VIDEO_SEARCH_TV_RESULT_TITLE;
+ this.titleOverride = String.load(stringId).format(this._query)
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp2) {
+ var stringId = String.id.IDS_VIDEO2_SEARCH_ALL_RESULT_TITLE;
+ if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchAll)
+ stringId = String.id.IDS_VIDEO2_SEARCH_ALL_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchMovies)
+ stringId = String.id.IDS_VIDEO2_SEARCH_MOVIE_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchTV)
+ stringId = String.id.IDS_VIDEO2_SEARCH_TV_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchCast)
+ stringId = String.id.IDS_VIDEO2_SEARCH_CAST_RESULT_TITLE;
+ this.titleOverride = String.load(stringId).format(this._query)
+ }
+ else
+ this.titleOverride = String.load(String.id.IDS_SEARCH_RESULT_TITLE).format(this._query);
+ this._searchCallbacks = [];
+ var searchTypeResult = this._searchTypeResults[this._searchType];
+ var typeLength = searchTypeResult.length;
+ this._resultPopulated = [];
+ this._resultIndices = [];
+ for (var i = 0; i < typeLength; i++)
+ this._resultIndices[i] = 0;
+ if (this._searchViewModel) {
+ this._searchViewModel.searchCompleted = null;
+ this._searchViewModel = null
+ }
+ if (this._hcrResult) {
+ this._hcrResult.searchCompleted = null;
+ this._hcrResult = null
+ }
+ }, _getHCRResult: function _getHCRResult() {
+ MS.Entertainment.ViewModels.assert(false, "base._getHCRResult should never be called")
+ }, _findHCR: function _findHCR(query, resultType, options) {
+ if (this._hideHcrIfOffline && !this._isOnline) {
+ this._setResultPopulated(resultType, 0, true);
+ return
+ }
+ if (this._chosenSuggestion) {
+ this._chosenSuggestion.isHCR = true;
+ MS.Entertainment.Data.VirtualList.wrapArray([this._chosenSuggestion]).then(function(result) {
+ if (this._addHcrToResults || options.showMarketplace || this._chosenSuggestion.inCollection)
+ this._addHcrResult(result, resultType);
+ else
+ this._setResultPopulated(resultType, 0, true)
+ }.bind(this))
+ }
+ else {
+ this._hcrResult = this._getHCRResult();
+ this._hcrResult.searchCompleted = function() {
+ if (this._hcrResult.hcrResult) {
+ var hcr = this._hcrResult.hcrResult;
+ hcr.isHCR = true;
+ MS.Entertainment.Data.VirtualList.wrapArray([hcr]).then(function(result) {
+ if (this._addHcrToResults || options.showMarketplace || hcr.inCollection)
+ this._addHcrResult(result, resultType);
+ else
+ this._setResultPopulated(resultType, 0, true)
+ }.bind(this))
+ }
+ else
+ this._setResultPopulated(resultType, 0, true)
+ }.bind(this);
+ this._hcrResult.startSearch(query, this._useEDS)
+ }
+ }, _addSearchCallback: function _addSearchCallback(query, resultType, options, resultName, resultEnabled) {
+ if (resultEnabled) {
+ this._search(query, options);
+ this._searchCallbacks.push(function _searchCallbacksCallback() {
+ this._addResult(this._searchViewModel[resultName], resultType)
+ }.bind(this))
+ }
+ else
+ this._setResultPopulated(resultType, 0, false)
+ }, _search: function _search(query, options) {
+ if (this._disposed)
+ return;
+ if (!this._searchViewModel) {
+ this._searchCallbacks = [];
+ this._searchViewModel = new MS.Entertainment.ViewModels.SearchViewModel(options);
+ this._searchViewModel._maxResultCount = this._maxResultCount;
+ this._searchViewModel.searchCompleted = function _searchViewModelCallback() {
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ if (searchResultCounts.allCount === -1)
+ this._updateResultCounts(options);
+ var callbacksLength = this._searchCallbacks.length;
+ for (var i = 0; i < callbacksLength; i++)
+ this._searchCallbacks[i]()
+ }.bind(this);
+ this._searchViewModel.startSearch(query)
+ }
+ }, _addHcrResult: function _addHcrResult(result, type) {
+ if (this._disposed)
+ return;
+ if (!this._hideHeaderForHCR)
+ return this._addResult(result, type);
+ else {
+ if (!result || (Array.isArray(result) && result.length === 0)) {
+ if (!this._searchTypeResults[this._searchType][type].includesHcrResult)
+ this._setResultPopulated(type);
+ return
+ }
+ var maxResults = this._searchTypeResults[this._searchType][type].maxResults;
+ result.itemsFromIndex(0, 0, maxResults - 1).done(function addRange(items) {
+ var count = items.items.length;
+ if (count > 0) {
+ var length = this._resultIndices.length;
+ for (var i = type + 1; i < length; i++)
+ this._resultIndices[i] += count;
+ this._setLargeItemIndex(0);
+ if (this._searchTypeResults[this._searchType][type].includesHcrResult) {
+ items.items[0].data.isHCR = true;
+ if (!this._hcrResult) {
+ this._hcrResult = {};
+ this._hcrResult.hcrResult = items.items[0].data
+ }
+ }
+ var wrappedHcr = new MS.Entertainment.Data.Factory.ListNoHeaderItemWrapper(items.items[0].data);
+ this._searchItems.insertAt(this._searchItems.noHeaderIndexFromSourceIndex(0), wrappedHcr, {isSourceData: true})
+ }
+ if (!this._searchTypeResults[this._searchType][type].includesHcrResult)
+ this._setResultPopulated(type)
+ }.bind(this))
+ }
+ }, _addResult: function _addResult(result, type) {
+ if (!result || (Array.isArray(result) && result.length === 0)) {
+ this._setResultPopulated(type);
+ return
+ }
+ var maxResults = this._searchTypeResults[this._searchType][type].maxResults;
+ result.toArray(0, maxResults).done(function addRange(array) {
+ if (this._searchTypeResults[this._searchType][type].includesHcrResult)
+ array.splice(0, 1);
+ var count = array.length;
+ if (count > 0) {
+ var length = this._resultIndices.length;
+ for (var i = type + 1; i < length; i++)
+ this._resultIndices[i] += count;
+ this._searchItems.insertRangeAt(this._searchItems.noHeaderIndexFromSourceIndex(this._resultIndices[type]), array, {isSourceData: true})
+ }
+ if (this._searchTypeResults[this._searchType][type].includesHcrResult)
+ this._addHcrResult(result, type);
+ this._setResultPopulated(type)
+ }.bind(this))
+ }, _setResultPopulated: function _setResultPopulated(type) {
+ this._resultPopulated[type] = true;
+ this._checkSearchCompleted()
+ }, _updateResultCounts: function _updateResultCounts(options) {
+ MS.Entertainment.ViewModels.assert(false, "base._updateResultCounts should never be called")
+ }, _addResultCount: function _addResultCount(resultName, countName, maxResultCount) {
+ var count;
+ var results = this._searchViewModel[resultName];
+ if (results && results.count) {
+ count = results.count;
+ if (maxResultCount !== undefined)
+ count = Math.min(count, maxResultCount)
+ }
+ else
+ count = 0;
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ if (searchResultCounts[countName] === -1)
+ searchResultCounts[countName] = count;
+ else
+ searchResultCounts[countName] += count;
+ if (searchResultCounts.allCount === -1)
+ searchResultCounts.allCount = count;
+ else
+ searchResultCounts.allCount += count
+ }, _checkSearchCompleted: function _checkSearchCompleted() {
+ if (this._disposed)
+ return;
+ var searchCompleted = true;
+ var resultsLength = this._searchTypeResults[this._searchType].length;
+ var waitingForRequiredResults = false;
+ for (var i = 0; i < resultsLength; i++)
+ if (!this._resultPopulated[i]) {
+ searchCompleted = false;
+ if (this._searchTypeResults[this._searchType][i].requiredForDisplay)
+ waitingForRequiredResults = true
+ }
+ if ((!waitingForRequiredResults && this._searchItems.count) || searchCompleted)
+ this._setItems(this._searchItems);
+ if (searchCompleted)
+ this._searchCompleted()
+ }, _searchCompleted: function _searchCompleted() {
+ if (this._disposed)
+ return;
+ this.isLoading = false;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceSearch_Completed();
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ if (this._searchItems.count === 0 && !this._keepPivotOnEmpty)
+ this.pivotSelectedIndexOverride = 0;
+ if (searchResultCounts.allCount === 0)
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var stringId = String.id.IDS_VIDEO_SEARCH_ALL_NORESULT_TITLE;
+ if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchAll)
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ stringId = String.id.IDS_VIDEO2_SEARCH_ALL_NORESULT_TITLE;
+ else
+ stringId = String.id.IDS_VIDEO_SEARCH_ALL_NORESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchMovies)
+ stringId = String.id.IDS_VIDEO_SEARCH_MOVIE_NORESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchTV)
+ stringId = String.id.IDS_VIDEO_SEARCH_TV_NORESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchCast)
+ stringId = String.id.IDS_VIDEO_SEARCH_CAST_NORESULT_TITLE;
+ this.failedGalleryModel = {primaryText: String.load(stringId).format(this._query)};
+ this.isFailed = true
+ }
+ else
+ this.titleOverride = String.load(String.id.IDS_SEARCH_NORESULT_TITLE).format(this._query);
+ else if (!this._updateTitleOnFailureOnly)
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ var stringId = String.id.IDS_VIDEO_SEARCH_ALL_RESULT_TITLE;
+ if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchAll)
+ stringId = String.id.IDS_VIDEO_SEARCH_ALL_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchMovies)
+ stringId = String.id.IDS_VIDEO_SEARCH_MOVIE_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchTV)
+ stringId = String.id.IDS_VIDEO_SEARCH_TV_RESULT_TITLE;
+ this.titleOverride = String.load(stringId).format(this._query)
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp2) {
+ var stringId = String.id.IDS_VIDEO2_SEARCH_ALL_RESULT_TITLE;
+ if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchAll)
+ stringId = String.id.IDS_VIDEO2_SEARCH_ALL_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchMovies)
+ stringId = String.id.IDS_VIDEO2_SEARCH_MOVIE_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchTV)
+ stringId = String.id.IDS_VIDEO2_SEARCH_TV_RESULT_TITLE;
+ else if (this._lastUsedModifierItem.id === MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchCast)
+ stringId = String.id.IDS_VIDEO2_SEARCH_CAST_RESULT_TITLE;
+ this.titleOverride = String.load(stringId).format(this._query)
+ }
+ else
+ this.titleOverride = String.load(String.id.IDS_SEARCH_RESULT_TITLE).format(this._query);
+ var media = this._hcrResult && this._hcrResult.hcrResult;
+ MS.Entertainment.Utilities.Telemetry.logSearchEnter(media);
+ this._hasSearchedAtLeastOnce = true;
+ if (this.searchCompleted)
+ this.searchCompleted(this._searchItems.count)
+ }
+ }, {SearchCurrentFilter: 0})})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Search/SearchContractViewModel.js b/packages/microsoft.zunevideo/ViewModels/Search/SearchContractViewModel.js
new file mode 100644
index 00000000..2cfdd8a0
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Search/SearchContractViewModel.js
@@ -0,0 +1,313 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {SearchContractViewModel: MS.Entertainment.UI.Framework.define(null, {
+ _searchPane: null, _linguisticAlternatives: null, _uiStateService: null, lastSearchedTerm: null, loadSearchObject: function loadSearchObject() {
+ if (this._searchPane)
+ return;
+ var searchPane = MS.Entertainment.ViewModels.SearchContractViewModel.getForCurrentView();
+ if (searchPane) {
+ this._searchPane = searchPane;
+ this._searchPane.addEventListener("querysubmitted", this.searchKeywordSubmitted.bind(this), false);
+ this._searchPane.addEventListener("suggestionsrequested", this.searchKeywordSuggestionRequested.bind(this), false);
+ this._searchPane.addEventListener("resultsuggestionchosen", this.searchResultSuggestionChosen.bind(this), false);
+ this._searchPane.addEventListener("visibilitychanged", this.searchVisibilityChanged.bind(this), false)
+ }
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)
+ }, showSearchPane: function showSearchPane() {
+ if (!this._searchPane)
+ this.loadSearchObject();
+ if (this._searchPane)
+ this._searchPane.show()
+ }, searchKeywordSubmitted: function searchKeywordSubmitted(e) {
+ var alternatives;
+ var alternativeNum;
+ var maxLinguisticAlternatives = 10;
+ var useAlternativesForLocalContent;
+ if (e && e.queryText) {
+ var searchKeyword = e.queryText.trim();
+ this.lastSearchedTerm = searchKeyword;
+ if (searchKeyword) {
+ useAlternativesForLocalContent = MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp;
+ if (useAlternativesForLocalContent && this._linguisticAlternatives) {
+ alternativeNum = Math.min(maxLinguisticAlternatives, this._linguisticAlternatives.size);
+ alternatives = [searchKeyword];
+ for (var i = 0; i < alternativeNum; i++)
+ alternatives.push(this._linguisticAlternatives.getAt(i));
+ this._linguisticAlternatives = null
+ }
+ var options = {
+ keyword: searchKeyword, linguisticAlternatives: alternatives, defaultModifierIndex: e.defaultModifierIndex || (MS.Entertainment.Utilities.isVideoApp2 && MS.Entertainment.UI.Actions.SearchAction.lastDefaultModifierIndex) || 0
+ };
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEvent(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchQuerySubmitted);
+ MS.Entertainment.ViewModels.SearchContractViewModel._navigateToSearchPage(options);
+ return true
+ }
+ }
+ return false
+ }, searchKeywordSuggestionRequested: function searchKeywordSuggestionRequested(e) {
+ var maxWordWheelCount = MS.Entertainment.Utilities.isApp1 ? 5 : 10;
+ var that = this;
+ if (e && e.queryText && e.request) {
+ var keyword = e.queryText.trim();
+ if (MS.Entertainment.Utilities.isApp1 && e.linguisticDetails && e.linguisticDetails.queryTextAlternatives.size)
+ this._linguisticAlternatives = e.linguisticDetails.queryTextAlternatives;
+ var suggestionRequest = e.request;
+ var deferral;
+ if (suggestionRequest.getDeferral)
+ deferral = suggestionRequest.getDeferral();
+ else if (suggestionRequest.setPromise) {
+ deferral = new MS.Entertainment.UI.Framework.Signal;
+ suggestionRequest.setPromise(deferral.promise)
+ }
+ var query = null;
+ if (keyword && deferral) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var movieEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ if (movieEnabled && !tvEnabled)
+ query = new MS.Entertainment.Data.Query.Video.AutoSuggestMovies;
+ else if (tvEnabled && !movieEnabled)
+ query = new MS.Entertainment.Data.Query.Video.AutoSuggestTV;
+ else if (movieEnabled && tvEnabled) {
+ var searchContext = MS.Entertainment.UI.Actions.SearchAction.lastDefaultModifierIndex;
+ if (MS.Entertainment.Utilities.isVideoApp2 && searchContext === MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.movies)
+ query = new MS.Entertainment.Data.Query.Video.AutoSuggestMovies;
+ else if (MS.Entertainment.Utilities.isVideoApp2 && searchContext === MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.tvShows)
+ query = new MS.Entertainment.Data.Query.Video.AutoSuggestTV;
+ else
+ query = new MS.Entertainment.Data.Query.Video.AutoSuggest
+ }
+ }
+ else if (MS.Entertainment.Utilities.isMusicApp) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (isMusicMarketplaceEnabled)
+ query = new MS.Entertainment.Data.Query.Music.AutoSuggest
+ }
+ if (query) {
+ query.keyword = keyword;
+ query.execute().then(function querySuccess(q) {
+ if (q.result.items)
+ return q.result.items.itemsFromIndex(0, 0, maxWordWheelCount);
+ else
+ return WinJS.Promise.wrap()
+ }, function queryFail(q) {
+ return WinJS.Promise.wrap()
+ }).then(function virtualListFilled(result) {
+ if (result) {
+ var suggestionsToProvide = Math.min(result.items.length, maxWordWheelCount);
+ for (var i = 0; i < result.items.length && i < maxWordWheelCount; i++)
+ (function addItemToSuggestions() {
+ var item = result.items[i].data;
+ var imageUrl;
+ var querySuggestion;
+ var typeName;
+ if (item) {
+ var mediaType = item.mediaType;
+ var videoType = -1;
+ if (item.isSuggestion)
+ querySuggestion = true;
+ else {
+ if (item.mediaType <= 0 && item.type)
+ switch (item.type.toLowerCase()) {
+ case"movie":
+ mediaType = Microsoft.Entertainment.Queries.ObjectType.video;
+ videoType = Microsoft.Entertainment.Queries.VideoType.movie;
+ break;
+ case"series":
+ mediaType = Microsoft.Entertainment.Queries.ObjectType.tvSeries;
+ break;
+ case"artist":
+ mediaType = Microsoft.Entertainment.Queries.ObjectType.person;
+ break;
+ case"album":
+ mediaType = Microsoft.Entertainment.Queries.ObjectType.album;
+ break;
+ case"track":
+ mediaType = Microsoft.Entertainment.Queries.ObjectType.track;
+ break
+ }
+ typeName = MS.Entertainment.Utilities.getMediaTypeName(mediaType, videoType, item.itemPlatformType)
+ }
+ var tag = item.name + ",:::" + item.serviceId + ",:::" + mediaType;
+ if (item.itemPlatformType)
+ tag = tag + ",:::" + item.itemPlatformType;
+ var addSuggestion = function addSuggestion() {
+ var imageSource;
+ var imageUri;
+ if (querySuggestion)
+ suggestionRequest.searchSuggestionCollection.appendQuerySuggestion(item.name);
+ else {
+ if (!imageUrl || imageUrl < 0)
+ imageUrl = "file://images/squareLoading." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ try {
+ imageUri = new Windows.Foundation.Uri(imageUrl)
+ }
+ catch(error_1) {
+ imageUrl = "file://images/squareLoading." + MS.Entertainment.Utilities.getPackageImageFileExtension();
+ imageUri = new Windows.Foundation.Uri(imageUrl)
+ }
+ imageSource = Windows.Storage.Streams.RandomAccessStreamReference.createFromUri(imageUri);
+ suggestionRequest.searchSuggestionCollection.appendResultSuggestion(item.name, typeName, tag, imageSource, String.empty)
+ }
+ suggestionsToProvide--;
+ if (suggestionsToProvide === 0)
+ deferral.complete()
+ };
+ imageUrl = item.imageUri;
+ if (!imageUrl && !querySuggestion)
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl({
+ serviceId: item.serviceId, mediaType: mediaType, videoType: videoType
+ }, 50, 50).then(function loadImage(uri) {
+ imageUrl = uri;
+ addSuggestion()
+ });
+ else
+ addSuggestion()
+ }
+ })()
+ }
+ })
+ }
+ }
+ }
+ }, searchResultSuggestionChosen: function searchResultSuggestionChosen(e) {
+ if (e) {
+ var tag = e.tag;
+ var values = e.tag.split(",:::");
+ if (values.length < 3)
+ return;
+ var item = {
+ id: values[1], title: {$value: values[0]}
+ };
+ var augmenter = null;
+ var mediaType = parseInt(values[2]);
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ augmenter = MS.Entertainment.Data.Augmenter.Marketplace.Movie;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ augmenter = MS.Entertainment.Data.Augmenter.Marketplace.TVSeries;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ augmenter = MS.Entertainment.Data.Augmenter.Marketplace.Music.Artist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ augmenter = MS.Entertainment.Data.Augmenter.Marketplace.GameSearchSuggestEDS;
+ if (values.length === 4 && values[3])
+ item.defaultPlatformType = values[3];
+ break
+ }
+ if (augmenter) {
+ item = MS.Entertainment.Data.augment(item, augmenter);
+ if (item)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersiveDetails(item, true, false);
+ MS.Entertainment.Utilities.Telemetry.logSearchWordWheelEnter(item.name, mediaType, item.videoType);
+ return
+ }
+ if (mediaType === Microsoft.Entertainment.Queries.ObjectType.album || mediaType === Microsoft.Entertainment.Queries.ObjectType.track) {
+ var queryWatcher = new MS.Entertainment.Framework.QueryWatcher("searchWordWheel");
+ var detailQuery = (mediaType === Microsoft.Entertainment.Queries.ObjectType.album) ? new MS.Entertainment.Data.Query.Music.AlbumWithTracks : new MS.Entertainment.Data.Query.Music.SongDetails;
+ detailQuery.id = values[1];
+ queryWatcher.registerQuery(detailQuery);
+ detailQuery.execute().then(function querySuccess(q) {
+ if (q.result.item) {
+ var options = {
+ keyword: values[0] + " " + q.result.item.artistName, chosenSuggestion: q.result.item
+ };
+ MS.Entertainment.ViewModels.SearchContractViewModel._navigateToSearchPage(options)
+ }
+ }, function queryFail(q) {
+ var options = {keyword: values[0]};
+ MS.Entertainment.ViewModels.SearchContractViewModel._navigateToSearchPage(options)
+ })
+ }
+ MS.Entertainment.Utilities.Telemetry.logSearchWordWheelEnter(item.name, mediaType, item.videoType)
+ }
+ }, searchVisibilityChanged: function searchVisibilityChanged(e) {
+ if (e.visible) {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithUIPath(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchPanelLaunch);
+ MS.Entertainment.ViewModels.SearchContractViewModel._searchPaneAppeared = true
+ }
+ this._uiStateService.isSearchPaneVisible = e.visible
+ }
+ }, {
+ current: null, _searchPaneAppeared: false, SEARCH_SHOW_TIMEOUT_MS: 10 * 1000, init: function() {
+ if (!MS.Entertainment.ViewModels.SearchContractViewModel.current)
+ MS.Entertainment.ViewModels.SearchContractViewModel.current = new MS.Entertainment.ViewModels.SearchContractViewModel
+ }, showSearchPane: function showSearchPane(query) {
+ var searchPane = MS.Entertainment.ViewModels.SearchContractViewModel.getForCurrentView();
+ if (!searchPane)
+ return false;
+ MS.Entertainment.ViewModels.SearchContractViewModel._searchPaneAppeared = false;
+ var validator = WinJS.Promise.timeout(MS.Entertainment.ViewModels.SearchContractViewModel.SEARCH_SHOW_TIMEOUT_MS).then(function validateSearch() {
+ if (!MS.Entertainment.ViewModels.SearchContractViewModel._searchPaneAppeared && !searchPane.visible) {
+ var params = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames, parameterValue: MS.Entertainment.ViewModels.SearchContractViewModel.SEARCH_SHOW_TIMEOUT_MS
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithUIPath(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchPanelLaunchFailure, params)
+ }
+ }.bind(this));
+ try {
+ if (query)
+ searchPane.show(query);
+ else
+ searchPane.show()
+ }
+ catch(ex) {
+ MS.Entertainment.ViewModels.fail("Search Dialog couldn't be shown: " + (ex && ex.message))
+ }
+ if (MS.Entertainment.ViewModels.SearchContractViewModel._searchPaneAppeared || searchPane.visible)
+ validator.cancel();
+ return true
+ }, getForCurrentView: function getForCurrentView() {
+ if (Windows.ApplicationModel.Search.Core)
+ return null;
+ try {
+ return Windows.ApplicationModel.Search.SearchPane.getForCurrentView()
+ }
+ catch(e) {
+ return null
+ }
+ }, _navigateToSearchPage: function navigateToSearchPage(options) {
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.SearchGalleryRequest);
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp) {
+ if (MS.Entertainment.ViewModels.SearchViewModel) {
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var videoMPQuery = null;
+ videoMPQuery = MS.Entertainment.ViewModels.SearchViewModel.createMovieQueryMP(null, null, options.defaultModifierIndex);
+ if (videoMPQuery) {
+ videoMPQuery.search = options.keyword;
+ videoMPQuery.chunkSize = 25;
+ MS.Entertainment.ViewModels.SearchViewModel.preloadedVideoMarketplaceQuery = videoMPQuery;
+ MS.Entertainment.ViewModels.SearchViewModel.preloadedVideoMarketplaceQueryPromise = videoMPQuery.execute()
+ }
+ }
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ searchResultCounts.clearCounts();
+ var context = null;
+ if (navigationService._currentPage && navigationService._currentPage.iaNode && navigationService._currentPage.iaNode.moniker)
+ context = navigationService._currentPage.iaNode.moniker;
+ if (context === MS.Entertainment.UI.Monikers.navigationPopover) {
+ var previousLocation = navigationService.getPreviousLocation();
+ if (previousLocation && previousLocation.page && previousLocation.page.iaNode && previousLocation.page.iaNode.moniker)
+ context = previousLocation.page.iaNode.moniker
+ }
+ var searchAction = new MS.Entertainment.UI.Actions.SearchByContextAction;
+ searchAction.parameter = {
+ moniker: context, defaultModifierIndex: options.defaultModifierIndex
+ };
+ searchAction.execute()
+ }
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.searchPage, null, null, options)
+ }
+ else
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.searchHub, null, null, options)
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Search/SearchViewModel.js b/packages/microsoft.zunevideo/ViewModels/Search/SearchViewModel.js
new file mode 100644
index 00000000..9e2aefe1
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Search/SearchViewModel.js
@@ -0,0 +1,755 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {
+ SearchFilter: {
+ all: 0, localCollection: 1
+ }, SearchViewModel: MS.Entertainment.defineObservable(function searchViewModelConstructor(options) {
+ this.options = options;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ this._useFileTransferService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer);
+ this._videoQueryList = [];
+ if (options && options.showCollection)
+ if (options.showMovies && !options.showTVSeries)
+ this._videoQueryList.push("libraryVideoMovies");
+ else if (!options.showMovies && options.showTVSeries)
+ this._videoQueryList.push("libraryTVSeries");
+ else if (options.showMovies || options.showTVSeries)
+ this._videoQueryList.push("libraryMovieTVSeries");
+ if (MS.Entertainment.UI.NetworkStatusService.isOnline() && (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) && options && (options.showMovies || options.showTVSeries))
+ this._videoQueryList.push("searchMovies");
+ this._noMarketplaceModeVideo = (MS.Entertainment.Utilities.isVideoApp && !featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) && !featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace));
+ if (this._noMarketplaceModeVideo)
+ this._videoQueryList = [];
+ this._videoQueryList.push("libraryVideoOther");
+ if (options && options.showCast)
+ this._videoQueryList.push("graceNoteCast");
+ this._musicQueryList = ["libraryArtists", "libraryAlbums", "libraryTracks"];
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this._musicQueryList.push("libraryPlaylists");
+ if (isMusicMarketplaceEnabled) {
+ this._musicQueryList.push("searchArtists");
+ this._musicQueryList.push("searchAlbums");
+ this._musicQueryList.push("searchTracks")
+ }
+ this.graceNoteCastResult = [];
+ this.videoOfflineResult = [];
+ this.videoOnlineResult = [];
+ this.otherVideoLocalResult = [];
+ this.artistLocalResult = [];
+ this.artistMPResult = [];
+ this.albumLocalResult = [];
+ this.albumMPResult = [];
+ this.songLocalResult = [];
+ this.songMPResult = [];
+ this.playlistLocalResult = [];
+ this.playlistMPResult = [];
+ this.musicVideoLocalResult = [];
+ this.musicVideoMPResult = [];
+ if (options && options.linguisticAlternatives)
+ this._linguisticAlternatives = options.linguisticAlternatives;
+ this.createMovieQueryLocal = function() {
+ if (options && options.showMovies && !options.showTVSeries)
+ return new MS.Entertainment.Data.Query.libraryVideoMovies;
+ else if (options && !options.showMovies && options.showTVSeries)
+ return new MS.Entertainment.Data.Query.libraryTVSeries;
+ else if (options && options.showMovies && options.showTVSeries)
+ return new MS.Entertainment.Data.Query.libraryMovieTVSeries;
+ else
+ return null
+ }.bind(this);
+ this.createMovieQueryMP = function(keyword) {
+ if (options && (options.showMovies || options.showTVSeries)) {
+ var videoMPQuery = MS.Entertainment.ViewModels.SearchViewModel.preloadedVideoMarketplaceQuery;
+ if (!videoMPQuery || videoMPQuery.search !== keyword) {
+ videoMPQuery = MS.Entertainment.ViewModels.SearchViewModel.createMovieQueryMP(this._edsAuthHeaderKey, this._edsAuthHeaderValue, this.options);
+ videoMPQuery.search = keyword;
+ videoMPQuery.chunkSize = this._maxResultCount
+ }
+ return videoMPQuery
+ }
+ else
+ return null
+ }.bind(this);
+ this.createGraceNoteCastQuery = function(keyword) {
+ if (options && options.showCast && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.graceNoteService)) {
+ var videoServices = MS.Entertainment.Components.Video.Services;
+ var graceNoteService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.graceNoteService);
+ return graceNoteService.contributorSearch(keyword, videoServices.GraceNoteImageSize.medium, videoServices.GraceNoteSearchMode.multipleMatch)
+ }
+ else
+ return null
+ }.bind(this);
+ this.createOtherVideoQueryLocal = function createOtherVideoQueryLocal() {
+ return new MS.Entertainment.Data.Query.libraryVideoOther
+ };
+ this.createArtistQueryLocal = function createArtistQueryLocal() {
+ var query = new MS.Entertainment.Data.Query.libraryAlbumArtists;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist);
+ return query
+ };
+ this.createArtistQueryMP = function createArtistQueryMP() {
+ var query = new MS.Entertainment.Data.Query.Music.ArtistSearch;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.artist);
+ return query
+ };
+ this.createAlbumQueryLocal = function createAlbumQueryLocal() {
+ var query = new MS.Entertainment.Data.Query.libraryAlbums;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.album);
+ return query
+ };
+ this.createAlbumQueryMP = function createAlbumQueryMP() {
+ var query = new MS.Entertainment.Data.Query.Music.AlbumSearch;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.album);
+ return query
+ };
+ this.createSongQueryLocal = function createSongQueryLocal() {
+ var query = new MS.Entertainment.Data.Query.libraryTracks;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ return query
+ };
+ this.createSongQueryMP = function createSongQueryMP() {
+ var query = new MS.Entertainment.Data.Query.Music.SongSearch;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ return query
+ };
+ this.createPlaylistQueryLocal = function createPlaylistQueryLocal() {
+ var query = new MS.Entertainment.Data.Query.libraryPlaylists;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.playlist);
+ return query
+ };
+ this.createPlaylistQueryMP = function createPlaylistQueryMP() {
+ var query = new MS.Entertainment.Data.Query.searchPlaylists;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.playlist);
+ return query
+ };
+ this.createMusicVideoQueryLocal = function createMusicVideoQueryLocal() {
+ return new MS.Entertainment.Data.Query.libraryVideos
+ };
+ this.createMusicVideoQueryMP = function createMusicVideoQueryMP() {
+ return new MS.Entertainment.Data.Query.searchMusicVideos
+ };
+ this._queryWatcher = new MS.Entertainment.Framework.QueryWatcher("searchViewModel")
+ }, {
+ _noMarketplaceModeVideo: false, _edsAuthHeaderKey: null, _edsAuthHeaderValue: null, _videoQueryList: null, _musicQueryList: null, graceNoteCastResult: null, videoOfflineResult: null, videoOnlineResult: null, otherVideoLocalResult: null, artistLocalResult: null, artistMPResult: null, albumLocalResult: null, albumMPResult: null, songLocalResult: null, songMPResult: null, playlistLocalResult: null, playlistMPResult: null, musicVideoLocalResult: null, musicVideoMPResult: null, _maxResultCount: 40, _maxResultCountNoVideoMarketplace: 100, searchCompleted: null, searchResultCount: 0, totalQueryCount: 0, completedQueryCount: 0, createMovieQueryLocal: null, createMovieQueryMP: null, createGraceNoteCastQuery: null, createOtherVideoQueryLocal: null, createArtistQueryLocal: null, createArtistQueryMP: null, createAlbumQueryLocal: null, createAlbumQueryMP: null, createSongQueryLocal: null, createSongQueryMP: null, createPlaylistQueryLocal: null, createPlaylistQueryMP: null, createMusicVideoQueryLocal: null, createMusicVideoQueryMP: null, _queryWatcher: null, _linguisticAlternatives: null, _useFileTransferService: false, startSearch: function startSearch(keyword, edsAuthHeader) {
+ if (edsAuthHeader) {
+ this._edsAuthHeaderKey = edsAuthHeader.key;
+ this._edsAuthHeaderValue = edsAuthHeader.value
+ }
+ else {
+ this._edsAuthHeaderKey = String.empty;
+ this._edsAuthHeaderValue = String.empty
+ }
+ this.completedQueryCount = 0;
+ this.searchResultCount = 0;
+ this.videoOfflineResult = [];
+ this.videoOnlineResult = [];
+ this.otherVideoLocalResult = [];
+ this.artistLocalResult = [];
+ this.artistMPResult = [];
+ this.albumLocalResult = [];
+ this.albumMPResult = [];
+ this.songLocalResult = [];
+ this.songMPResult = [];
+ this.playlistLocalResult = [];
+ this.playlistMPResult = [];
+ this.musicVideoLocalResult = [];
+ this.musicVideoMPResult = [];
+ if (!keyword || keyword.trim().length < 1) {
+ if (this.searchCompleted)
+ this.searchCompleted();
+ return
+ }
+ this.unregisterServices();
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ this.totalQueryCount = this._videoQueryList.length;
+ if (this.totalQueryCount > 0)
+ if (this._noMarketplaceModeVideo)
+ this.searchOtherVideos(keyword);
+ else
+ this.searchVideos(keyword);
+ else if (this.searchCompleted)
+ this.searchCompleted()
+ }
+ else if (MS.Entertainment.Utilities.isMusicApp) {
+ this.totalQueryCount = this._musicQueryList.length;
+ if (this.totalQueryCount > 0)
+ this.searchMusic(keyword);
+ else if (this.searchCompleted)
+ this.searchCompleted()
+ }
+ else {
+ this.totalQueryCount = this._videoQueryList.length + this._musicQueryList.length;
+ if (this.totalQueryCount > 0) {
+ this.searchVideos(keyword);
+ this.searchMusic(keyword)
+ }
+ else if (this.searchCompleted)
+ this.searchCompleted()
+ }
+ }, searchVideos: function searchVideos(keyword) {
+ this.searchOtherVideos(keyword);
+ this.searchMovieTVCast(keyword)
+ }, searchMusic: function searchMusic(keyword) {
+ this.searchArtists(keyword);
+ this.searchAlbums(keyword);
+ this.searchSongs(keyword);
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this.searchPlaylists(keyword)
+ }, searchMovieTVCast: function searchMovieTVCast(keyword) {
+ var that = this;
+ var localPromise,
+ marketplacePromise,
+ castPromise;
+ var notificationsCollection;
+ var senderCollection;
+ var senderMarketplace;
+ var filteredCastResultArray = [];
+ var videoLocalQuery = this.createMovieQueryLocal();
+ if (videoLocalQuery) {
+ if (this._useFileTransferService) {
+ notificationsCollection = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.ContentNotification.idFromProperty("libraryId"));
+ senderCollection = notificationsCollection.createSender();
+ notificationsCollection.modifyQuery(videoLocalQuery)
+ }
+ videoLocalQuery.keyword = (this._linguisticAlternatives || [keyword]);
+ videoLocalQuery.chunkSize = this._maxResultCount;
+ videoLocalQuery.aggregateChunks = false;
+ this._queryWatcher.registerQuery(videoLocalQuery);
+ localPromise = videoLocalQuery.execute().then(function localQuerySuccess(q) {
+ if (senderCollection) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchCollectionVideo", MS.Entertainment.UI.FileTransferService.keyFromProperty("libraryId"), senderCollection, MS.Entertainment.UI.FileTransferNotifiers.genericFile)
+ }
+ if (q.result.items)
+ that.videoOfflineResult = q.result.items;
+ else
+ that.videoOfflineResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(q.result.items);
+ that.checkSearchCompleted()
+ }, function localQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ })
+ }
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace))
+ return;
+ if (!MS.Entertainment.UI.NetworkStatusService.isOnline())
+ return;
+ var videoMPQuery = this.createMovieQueryMP(keyword);
+ if (videoMPQuery) {
+ this._queryWatcher.registerQuery(videoMPQuery);
+ var marketplacePromise = MS.Entertainment.ViewModels.SearchViewModel.preloadedVideoMarketplaceQueryPromise;
+ if (!marketplacePromise)
+ marketplacePromise = videoMPQuery.execute();
+ MS.Entertainment.ViewModels.SearchViewModel.preloadedVideoMarketplaceQuery = null;
+ MS.Entertainment.ViewModels.SearchViewModel.preloadedVideoMarketplaceQueryPromise = null;
+ marketplacePromise.then(function MPQuerySuccess(q) {
+ if (senderMarketplace) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchMarketplaceVideo", MS.Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true), senderMarketplace, MS.Entertainment.UI.FileTransferNotifiers.genericFile)
+ }
+ }, function MPQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ })
+ }
+ var castQuery = this.createGraceNoteCastQuery(keyword);
+ if (castQuery)
+ castPromise = castQuery.then(function castPromiseSuccess(result) {
+ filteredCastResultArray = MS.Entertainment.ViewModels.SearchViewModel.filterCastResults(result.items);
+ return MS.Entertainment.Data.VirtualList.wrapArray(filteredCastResultArray).then(function wrappedItems(list) {
+ that.graceNoteCastResult = list;
+ that.completedQueryCount++;
+ that.checkSearchCompleted()
+ })
+ }, function castPromiseError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ WinJS.Promise.join({
+ local: localPromise, marketplace: marketplacePromise, cast: castPromise
+ }).then(function allQueriesSuccess() {
+ if (videoLocalQuery && videoMPQuery)
+ return MS.Entertainment.ViewModels.SearchViewModel.mergeResults(videoLocalQuery.result.items, videoMPQuery.result.items);
+ else if (videoMPQuery && videoMPQuery.result && videoMPQuery.result.items)
+ return videoMPQuery.result.items;
+ else
+ return []
+ }, function someQueryError() {
+ return videoMPQuery.result ? videoMPQuery.result.items : []
+ }).then(function spliceInActorsList(mergedList) {
+ if (that.graceNoteCastResult && that.graceNoteCastResult.count && mergedList && mergedList.count)
+ return MS.Entertainment.ViewModels.SearchViewModel.mergeCastResults(filteredCastResultArray, mergedList, keyword);
+ else if (that.graceNoteCastResult && that.graceNoteCastResult.count)
+ return that.graceNoteCastResult;
+ else
+ return mergedList
+ }).then(function marketplaceProcessingDone(mergedList) {
+ if (mergedList && mergedList.count > 0) {
+ that.videoOnlineResult = mergedList;
+ that.videoOfflineResult = []
+ }
+ else
+ that.videoOnlineResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(mergedList);
+ that.checkSearchCompleted()
+ })
+ }, searchOtherVideos: function searchOtherVideos(keyword) {
+ var that = this;
+ var localPromise;
+ var otherVideoLocalQuery = this.createOtherVideoQueryLocal();
+ otherVideoLocalQuery.keyword = (this._linguisticAlternatives || [keyword]);
+ otherVideoLocalQuery.chunkSize = (this._noMarketplaceModeVideo ? this._maxResultCountNoVideoMarketplace : this._maxResultCount);
+ otherVideoLocalQuery.aggregateChunks = false;
+ this._queryWatcher.registerQuery(otherVideoLocalQuery);
+ localPromise = otherVideoLocalQuery.execute().then(function localQuerySuccess(q) {
+ if (q.result.items)
+ that.otherVideoLocalResult = q.result.items;
+ else
+ that.otherVideoLocalResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(q.result.items);
+ that.checkSearchCompleted()
+ }, function localQueryError(q) {
+ that.otherVideoLocalResult = [];
+ that.completedQueryCount++;
+ that.checkSearchCompleted()
+ })
+ }, checkSearchCompleted: function checkSearchCompleted() {
+ if (this.totalQueryCount === this.completedQueryCount)
+ if (this.searchCompleted)
+ this.searchCompleted()
+ }, addResultCount: function addResultCount(list) {
+ if (list && list.count !== undefined)
+ this.searchResultCount += list.count
+ }, searchArtists: function searchArtists(keyword) {
+ var that = this;
+ var localPromise,
+ marketplacePromise;
+ var artistLocalQuery = this.createArtistQueryLocal();
+ var notificationsCollection;
+ var senderCollection;
+ if (this._useFileTransferService) {
+ notificationsCollection = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.ContentNotification.idFromProperty("libraryId"));
+ senderCollection = notificationsCollection.createSender();
+ notificationsCollection.modifyQuery(artistLocalQuery)
+ }
+ artistLocalQuery.keyword = (this._linguisticAlternatives || [keyword]);
+ artistLocalQuery.chunkSize = this._maxResultCount;
+ artistLocalQuery.aggregateChunks = false;
+ this._queryWatcher.registerQuery(artistLocalQuery);
+ localPromise = artistLocalQuery.execute().then(function localQuerySuccess(q) {
+ if (senderCollection) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchCollectionMusicArtist", MS.Entertainment.UI.FileTransferService.keyFromProperty("albumArtistLibraryId"), senderCollection, MS.Entertainment.UI.FileTransferNotifiers.trackCollection)
+ }
+ if (q.result.items)
+ that.artistLocalResult = q.result.items;
+ else
+ that.artistLocalResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(q.result.items);
+ that.checkSearchCompleted()
+ }, function localQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (!isMusicMarketplaceEnabled)
+ return;
+ var artistMPQuery = this.createArtistQueryMP();
+ var notificationsMarketplace;
+ var senderMarketplace;
+ if (this._useFileTransferService) {
+ notificationsMarketplace = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true));
+ senderMarketplace = notificationsMarketplace.createSender();
+ notificationsMarketplace.modifyQuery(artistMPQuery)
+ }
+ artistMPQuery.search = keyword;
+ this._queryWatcher.registerQuery(artistMPQuery);
+ marketplacePromise = artistMPQuery.execute().then(function MPQuerySuccess(q) {
+ if (senderMarketplace) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchMarketplaceMusicArtist", MS.Entertainment.UI.FileTransferService.keyFromProperty("albumMediaId", false, true), senderMarketplace, MS.Entertainment.UI.FileTransferNotifiers.trackCollection)
+ }
+ }, function MPQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ WinJS.Promise.join({
+ local: localPromise, marketplace: marketplacePromise
+ }).then(function allQueriesSuccess() {
+ return MS.Entertainment.ViewModels.SearchViewModel.deDup(artistLocalQuery.result && artistLocalQuery.result.items, artistMPQuery.result && artistMPQuery.result.items)
+ }, function someQueryError() {
+ return artistMPQuery.result ? artistMPQuery.result.items : []
+ }).then(function marketplaceProcessingDone(marketplaceList) {
+ if (marketplaceList)
+ that.artistMPResult = marketplaceList;
+ else
+ that.artistMPResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(marketplaceList);
+ that.checkSearchCompleted()
+ })
+ }, searchAlbums: function searchAlbums(keyword) {
+ var that = this;
+ var localPromise,
+ marketplacePromise;
+ var albumLocalQuery = this.createAlbumQueryLocal();
+ var notificationsCollection;
+ var senderCollection;
+ if (this._useFileTransferService) {
+ notificationsCollection = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.ContentNotification.idFromProperty("libraryId"));
+ senderCollection = notificationsCollection.createSender();
+ notificationsCollection.modifyQuery(albumLocalQuery)
+ }
+ albumLocalQuery.keyword = (this._linguisticAlternatives || [keyword]);
+ albumLocalQuery.chunkSize = this._maxResultCount;
+ albumLocalQuery.aggregateChunks = false;
+ this._queryWatcher.registerQuery(albumLocalQuery);
+ localPromise = albumLocalQuery.execute().then(function localQuerySuccess(q) {
+ if (senderCollection) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchCollectionMusicAlbum", MS.Entertainment.UI.FileTransferService.keyFromProperty("albumLibraryId"), senderCollection, MS.Entertainment.UI.FileTransferNotifiers.trackCollection)
+ }
+ if (q.result.items)
+ that.albumLocalResult = q.result.items;
+ else
+ that.albumLocalResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(q.result.items);
+ that.checkSearchCompleted()
+ }, function localQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (!isMusicMarketplaceEnabled)
+ return;
+ var albumMPQuery = this.createAlbumQueryMP();
+ var notificationsMarketplace;
+ var senderMarketplace;
+ if (this._useFileTransferService) {
+ notificationsMarketplace = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true));
+ senderMarketplace = notificationsMarketplace.createSender();
+ notificationsMarketplace.modifyQuery(albumMPQuery)
+ }
+ albumMPQuery.search = keyword;
+ this._queryWatcher.registerQuery(albumMPQuery);
+ marketplacePromise = albumMPQuery.execute().then(function MPQuerySuccess(q) {
+ if (senderMarketplace) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchMarketplaceMusicAlbum", MS.Entertainment.UI.FileTransferService.keyFromProperty("albumMediaId", false, true), senderMarketplace, MS.Entertainment.UI.FileTransferNotifiers.trackCollection)
+ }
+ }, function MPQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ WinJS.Promise.join({
+ local: localPromise, marketplace: marketplacePromise
+ }).then(function allQueriesSuccess() {
+ return MS.Entertainment.ViewModels.SearchViewModel.deDup(albumLocalQuery.result.items, albumMPQuery.result.items)
+ }, function someQueryError() {
+ return albumMPQuery.result ? albumMPQuery.result.items : []
+ }).then(function marketplaceProcessingDone(marketplaceList) {
+ if (marketplaceList)
+ that.albumMPResult = marketplaceList;
+ else
+ that.albumMPResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(marketplaceList);
+ that.checkSearchCompleted()
+ })
+ }, searchSongs: function searchSongs(keyword) {
+ var that = this;
+ var localPromise,
+ marketplacePromise;
+ var songLocalQuery = this.createSongQueryLocal();
+ var notificationsCollection;
+ var senderCollection;
+ if (this._useFileTransferService) {
+ notificationsCollection = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.ContentNotification.idFromProperty("libraryId"));
+ senderCollection = notificationsCollection.createSender();
+ notificationsCollection.modifyQuery(songLocalQuery)
+ }
+ songLocalQuery.keyword = (this._linguisticAlternatives || [keyword]);
+ songLocalQuery.chunkSize = this._maxResultCount;
+ songLocalQuery.aggregateChunks = false;
+ this._queryWatcher.registerQuery(songLocalQuery);
+ localPromise = songLocalQuery.execute().then(function localQuerySuccess(q) {
+ if (senderCollection) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchCollectionTrack", MS.Entertainment.UI.FileTransferService.keyFromProperty("libraryId"), senderCollection, MS.Entertainment.UI.FileTransferNotifiers.genericFile)
+ }
+ if (q.result.items)
+ that.songLocalResult = q.result.items;
+ else
+ that.songLocalResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(q.result.items);
+ that.checkSearchCompleted()
+ }, function localQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (!isMusicMarketplaceEnabled)
+ return;
+ var notificationsMarketplace;
+ var senderMarketplace = null;
+ var songMPQuery = this.createSongQueryMP();
+ if (this._useFileTransferService) {
+ notificationsMarketplace = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true));
+ senderMarketplace = notificationsMarketplace.createSender();
+ notificationsMarketplace.modifyQuery(songMPQuery)
+ }
+ songMPQuery.search = keyword;
+ this._queryWatcher.registerQuery(songMPQuery);
+ marketplacePromise = songMPQuery.execute().then(function MPQuerySuccess(q) {
+ if (senderMarketplace) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("searchMarketplaceTrack", MS.Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true), senderMarketplace, MS.Entertainment.UI.FileTransferNotifiers.genericFile)
+ }
+ }, function MPQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ WinJS.Promise.join({
+ local: localPromise, marketplace: marketplacePromise
+ }).then(function allQueriesSuccess() {
+ return MS.Entertainment.ViewModels.SearchViewModel.deDup(songLocalQuery.result.items, songMPQuery.result.items)
+ }, function someQueryError() {
+ return songMPQuery.result ? songMPQuery.result.items : []
+ }).then(function marketplaceProcessingDone(marketplaceList) {
+ if (marketplaceList)
+ that.songMPResult = marketplaceList;
+ else
+ that.songMPResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(marketplaceList);
+ that.checkSearchCompleted()
+ })
+ }, searchPlaylists: function searchPlaylists(keyword) {
+ var that = this;
+ var localPromise,
+ marketplacePromise;
+ var playlistLocalQuery = this.createPlaylistQueryLocal();
+ playlistLocalQuery.keyword = (this._linguisticAlternatives || [keyword]);
+ playlistLocalQuery.chunkSize = this._maxResultCount;
+ playlistLocalQuery.aggregateChunks = false;
+ this._queryWatcher.registerQuery(playlistLocalQuery);
+ localPromise = playlistLocalQuery.execute().then(function localQuerySuccess(q) {
+ if (q.result.items)
+ that.playlistLocalResult = q.result.items;
+ else
+ that.playlistLocalResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(q.result.items);
+ that.checkSearchCompleted()
+ }, function localQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ })
+ }, searchMusicVideos: function searchMusicVideos(keyword) {
+ var that = this;
+ var localPromise,
+ marketplacePromise;
+ var musicVideoLocalQuery = this.createMusicVideoQueryLocal();
+ musicVideoLocalQuery.keyword = (this._linguisticAlternatives || [keyword]);
+ musicVideoLocalQuery.chunkSize = this._maxResultCount;
+ musicVideoLocalQuery.aggregateChunks = false;
+ this._queryWatcher.registerQuery(musicVideoLocalQuery);
+ localPromise = musicVideoLocalQuery.execute().then(function localQuerySuccess(q) {
+ if (q.result.items)
+ that.musicVideoLocalResult = q.result.items;
+ else
+ that.musicVideoLocalResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(q.result.items);
+ that.checkSearchCompleted()
+ }, function localQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ var musicVideoMPQuery = this.createMusicVideoQueryMP();
+ musicVideoMPQuery.search = keyword;
+ musicVideoMPQuery.chunkSize = this._maxResultCount;
+ this._queryWatcher.registerQuery(musicVideoMPQuery);
+ marketplacePromise = musicVideoMPQuery.execute().then(function MPQuerySuccess(q){}, function MPQueryError(q) {
+ return WinJS.Promise.wrapError(q)
+ });
+ WinJS.Promise.join({
+ local: localPromise, marketplace: marketplacePromise
+ }).then(function allQueriesSuccess() {
+ return MS.Entertainment.ViewModels.SearchViewModel.deDup(musicVideoLocalQuery.result.items, musicVideoMPQuery.result.items)
+ }, function someQueryError() {
+ return musicVideoMPQuery.result ? musicVideoMPQuery.result.items : []
+ }).then(function marketplaceProcessingDone(marketplaceList) {
+ if (marketplaceList)
+ that.musicVideoMPResult = marketplaceList;
+ else
+ that.musicVideoMPResult = [];
+ that.completedQueryCount++;
+ that.addResultCount(marketplaceList);
+ that.checkSearchCompleted()
+ })
+ }, unregisterServices: function unregisterServices() {
+ if (!this._useFileTransferService)
+ return;
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.unregisterListener("searchCollectionTrack");
+ fileTransferService.unregisterListener("searchMarketplaceTrack");
+ fileTransferService.unregisterListener("searchCollectionMusicAlbum");
+ fileTransferService.unregisterListener("searchMarketplaceMusicAlbum");
+ fileTransferService.unregisterListener("searchCollectionMusicArtist");
+ fileTransferService.unregisterListener("searchMarketplaceMusicArtist");
+ fileTransferService.unregisterListener("searchCollectionVideo");
+ fileTransferService.unregisterListener("searchMarketplaceVideo")
+ }
+ }, {
+ preloadedVideoMarketplaceQuery: null, preloadedVideoMarketplaceQueryPromise: null, createMovieQueryMP: function staticCreateMovieQueryMP(edsAuthHeaderKey, edsAuthHeaderValue, searchOptions) {
+ var searchModifier = MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.allVideo;
+ searchOptions = searchOptions || MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.allVideo;
+ if (typeof(searchOptions) === "number")
+ searchModifier = searchOptions;
+ else if (typeof(searchOptions) === "object") {
+ if (searchOptions.showMovies && !searchOptions.showTVSeries)
+ searchModifier = MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.movies;
+ if (!searchOptions.showMovies && searchOptions.showTVSeries)
+ searchModifier = MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.tvShows
+ }
+ var query;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) && searchModifier === MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.allVideo)
+ query = new MS.Entertainment.Data.Query.Video.EdsCrossVideoSearch;
+ else if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) && (searchModifier === MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.allVideo || searchModifier === MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.movies))
+ query = new MS.Entertainment.Data.Query.Video.EdsSearchMovies;
+ else if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) && (searchModifier === MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.allVideo || searchModifier === MS.Entertainment.ViewModels.VideoSearchViewModel.ViewIndex.tvShows))
+ query = new MS.Entertainment.Data.Query.Video.EdsSearchTVSeries;
+ if (query && edsAuthHeaderKey)
+ query.addHeader(edsAuthHeaderKey, edsAuthHeaderValue);
+ return query
+ }, mergeResults: function videoMerge(localList, mpList) {
+ if (!localList || localList.count === 0)
+ return WinJS.Promise.wrap(mpList);
+ else if (!mpList || mpList.count === 0)
+ return WinJS.Promise.wrap(localList);
+ var localItems = {};
+ var mergedList = [];
+ var hcrItem = null;
+ return mpList.itemsFromIndex(0, 0, 0).then(function hcrLookup(args) {
+ hcrItem = args.items[0].data
+ }).then(function() {
+ return localList.forEach(function localListForEach(localArgs) {
+ if (localArgs.item && localArgs.item.data && localArgs.item.data.serviceId) {
+ localItems[localArgs.item.data.serviceId] = localArgs.item.data;
+ if (localArgs.item.data.serviceId !== hcrItem.serviceId) {
+ if (!MS.Entertainment.Utilities.isVideoApp2)
+ mergedList.push(localArgs.item.data)
+ }
+ else {
+ hcrItem.libraryId = localArgs.item.data.libraryId;
+ hcrItem.hasPurchased = localArgs.item.data.hasPurchased
+ }
+ }
+ })
+ }).then(function() {
+ return mpList.forEach(function mpListForEach(mpArgs) {
+ if (mpArgs.item && mpArgs.item.data && mpArgs.item.data.serviceId)
+ if (hcrItem && hcrItem.serviceId && hcrItem.serviceId === mpArgs.item.data.serviceId)
+ mergedList.unshift(hcrItem);
+ else {
+ var localItem = localItems[mpArgs.item.data.serviceId];
+ if (!localItem)
+ mergedList.push(mpArgs.item.data);
+ else if (mpArgs.item.data.zuneId === localItem.zuneId || mpArgs.item.data.canonicalId === localItem.canonicalId) {
+ localItem.impressionGuid = mpArgs.item.data.impressionGuid;
+ localItem.relevancyTrackingContent = mpArgs.item.data.relevancyTrackingContent;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ mpArgs.item.data.libraryId = localItem.libraryId;
+ mpArgs.item.data.hasPurchased = localItem.hasPurchased;
+ mergedList.push(mpArgs.item.data)
+ }
+ }
+ else
+ mergedList.push(mpArgs.item.data)
+ }
+ })
+ }).then(function mergeCompleted() {
+ return MS.Entertainment.Data.VirtualList.wrapArray(mergedList)
+ })
+ }, filterCastResults: function(castArray) {
+ if (!castArray)
+ return;
+ var graceNoteEnabled = false;
+ var languageString = String.empty;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.graceNoteService)) {
+ var resourceLanguage = MS.Entertainment.Utilities.getResourceLanguage();
+ var languageCode = MS.Entertainment.Utilities.getLanguageCodeFromLocale(resourceLanguage);
+ languageString = MS.Entertainment.Components.Video.Services.GraceNoteService.getIsoLanguageStringFromBcpString(languageCode);
+ graceNoteEnabled = true
+ }
+ return castArray.filter(function filterItem(item) {
+ return graceNoteEnabled && item && item.biography && item.biographyLanguage && item.biographyLanguage.toLocaleLowerCase() === languageString.toLocaleLowerCase() && item.image && item.image !== MS.Entertainment.UI.ImagePaths.genericVideoActorPlaceholder
+ })
+ }, mergeCastResults: function(castList, mergedList, keyword) {
+ if (!castList || !Array.isArray(castList) || !mergedList || !keyword)
+ return;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var targetSlots = [{
+ index: 0, targetEditDistance: configurationManager.video.actorSearchSlot0EditValue
+ }, {
+ index: 2, targetEditDistance: configurationManager.video.actorSearchSlot2EditValue
+ }, {
+ index: 5, targetEditDistance: configurationManager.video.actorSearchSlot5EditValue
+ }, {
+ index: 8, targetEditDistance: configurationManager.video.actorSearchSlot8EditValue
+ }, {
+ index: 11, targetEditDistance: configurationManager.video.actorSearchSlot11EditValue
+ }, {
+ index: 14, targetEditDistance: configurationManager.video.actorSearchSlot14EditValue
+ }, {
+ index: 17, targetEditDistance: configurationManager.video.actorSearchSlot17EditValue
+ }, ];
+ var castIndex = 0;
+ for (var i = 0; i < targetSlots.length; i++) {
+ var closestMatch = castList[castIndex];
+ if (closestMatch) {
+ var castEditDistance = closestMatch.name.toLocaleLowerCase().editDistanceFrom(keyword.toLocaleLowerCase());
+ if (castEditDistance <= targetSlots[i].targetEditDistance || targetSlots[i].index >= mergedList.count) {
+ var targetIndex = targetSlots[i].index <= mergedList.count ? targetSlots[i].index : mergedList.count;
+ mergedList.insertAt(targetIndex, closestMatch);
+ castIndex++
+ }
+ }
+ }
+ return mergedList
+ }, deDup: function deDup(localList, mpList) {
+ if (!localList || localList.count === 0 || !mpList || mpList.count === 0)
+ return WinJS.Promise.wrap(mpList);
+ var that = this;
+ var deDupedList = [];
+ return mpList.forEach(function mpListForEach(mpArgs) {
+ var found = false;
+ return localList.forEach(function localListForEach(localArgs) {
+ if (localArgs.item && localArgs.item.data && localArgs.item.data.serviceId && mpArgs.item && mpArgs.item.data && mpArgs.item.data.serviceId)
+ if (localArgs.item.data.serviceId === mpArgs.item.data.serviceId || localArgs.item.data.zuneId === mpArgs.item.data.zuneId || localArgs.item.data.canonicalId === mpArgs.item.data.canonicalId) {
+ found = true;
+ localArgs.item.data.impressionGuid = mpArgs.item.data.impressionGuid;
+ localArgs.item.data.relevancyTrackingContent = mpArgs.item.data.relevancyTrackingContent;
+ localArgs.item.data.fromCollection = mpArgs.item.data.fromCollection;
+ localArgs.stop = true
+ }
+ }).then(function() {
+ if (!found)
+ deDupedList.push(mpArgs.item.data)
+ })
+ }).then(function forEachCompleted() {
+ return MS.Entertainment.Data.VirtualList.wrapArray(deDupedList)
+ })
+ }
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Search/VideoSearchTemplates1.js b/packages/microsoft.zunevideo/ViewModels/Search/VideoSearchTemplates1.js
new file mode 100644
index 00000000..74bc0cfb
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Search/VideoSearchTemplates1.js
@@ -0,0 +1,18 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/ViewModels/Video/VideoMarketplaceTemplates.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoSearchTemplates: {
+ all: {
+ tap: MS.Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly, layout: MS.Entertainment.UI.Controls.GalleryControl.Layout.grid, invokeBehavior: MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.popOver, invokeHelperFactory: MS.Entertainment.UI.Controls.GalleryControlInvocationHelper.create, emptyGalleryTemplate: "/Controls/GalleryControl.html#listViewEmptySearchGalleryTemplate", allowEmpty: false, forceInteractive: true, grouped: false, headerType: MS.Entertainment.UI.Controls.GalleryControl.HeaderType.inPlace, horizontal: true, groupHeaderPosition: "inline", hideShadow: true, backdropColor: MS.Entertainment.ViewModels.VideoGalleryColors.backdropColor, multiSize: true, startNewColumnOnHeaders: false, slotSize: {
+ width: 295, height: 165
+ }, itemSize: {
+ width: 295, height: 165
+ }, itemMargin: {
+ top: 4, bottom: 4
+ }, maxRows: MS.Entertainment.Utilities.getLegacyVideoRowCountForResolution()
+ }, noMarketplace: {
+ tap: MS.Entertainment.UI.Controls.GalleryControl.Tap.invokeOnly, layout: MS.Entertainment.UI.Controls.GalleryControl.Layout.grid, invokeBehavior: MS.Entertainment.UI.Controls.GalleryControl.InvokeBehavior.popOver, invokeHelperFactory: MS.Entertainment.UI.Controls.GalleryControlInvocationHelper.create, emptyGalleryTemplate: "/Controls/GalleryControl.html#listViewEmptySearchGalleryTemplate", allowEmpty: false, forceInteractive: true, grouped: false, horizontal: true, hideShadow: true, backdropColor: MS.Entertainment.ViewModels.VideoGalleryColors.backdropColor
+ }
+ }})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Search/VideoSearchViewModel.js b/packages/microsoft.zunevideo/ViewModels/Search/VideoSearchViewModel.js
new file mode 100644
index 00000000..12db1702
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Search/VideoSearchViewModel.js
@@ -0,0 +1,137 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoSearchResultCounts: MS.Entertainment.defineObservable(function videoSearchResultCountsConstructor(){}, {
+ allCount: -1, hcrCount: -1, videoOfflineCount: -1, videoOnlineCount: -1, otherVideoLocalResultCount: -1, backup: function backup() {
+ return {
+ allCount: this.allCount, hcrCount: this.hcrCount, videoOfflineCount: this.videoOfflineCount, videoOnlineCount: this.videoOnlineCount, otherVideoLocalResultCount: this.otherVideoLocalResultCount
+ }
+ }, restore: function restore(savedSearchResultCounts) {
+ this.allCount = savedSearchResultCounts.allCount;
+ this.hcrCount = savedSearchResultCounts.hcrCount;
+ this.videoOfflineCount = savedSearchResultCounts.videoOfflineCount;
+ this.videoOnlineCount = savedSearchResultCounts.videoOnlineCount;
+ this.otherVideoLocalResultCount = savedSearchResultCounts.otherVideoLocalResultCount
+ }, clearCounts: function clearCounts() {
+ this.allCount = -1;
+ this.hcrCount = -1;
+ this.videoOfflineCount = -1;
+ this.videoOnlineCount = -1;
+ this.otherVideoLocalResultCount = -1
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.searchResultCounts, function getSearchResultCountsService() {
+ return new MS.Entertainment.ViewModels.VideoSearchResultCounts
+ });
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoSearchAutomationIds: {
+ videoSearchAll: "videoSearchAll_modifier", videoSearchMarketplace: "videoSearchMarketplace_modifier", videoSearchMovies: "videoSearchMovies_modifier", videoSearchTV: "videoSearchTV_modifier", videoSearchCast: "videoSearchCast_modifier"
+ }});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoSearchViewModel: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.NewSearchViewModel", function videoSearchViewModelConstructor(searchType, movieMarketplaceEnabled, tvMarketplaceEnabled, actorSearchEnabled) {
+ this._defaultModifierSelection = MS.Entertainment.ViewModels.SearchViewModel.SearchCurrentFilter;
+ this._searchTypeResults = MS.Entertainment.ViewModels.VideoSearchViewModel.searchTypeResults;
+ this._views = MS.Entertainment.ViewModels.VideoSearchViewModel.Views;
+ this._movieMarketplaceEnabled = movieMarketplaceEnabled;
+ this._tvMarketplaceEnabled = tvMarketplaceEnabled;
+ this._actorSearchEnabled = actorSearchEnabled;
+ this._maxResultCount = 25;
+ this._hideHcrIfOffline = true;
+ this._addHcrToResults = true;
+ this._hideHeaderForHCR = true;
+ MS.Entertainment.ViewModels.NewSearchViewModel.prototype.constructor.call(this, searchType)
+ }, {
+ _movieMarketplaceEnabled: false, _tvMarketplaceEnabled: false, _actorSearchEnabled: false, getModifierDefinition: function getModifierDefinition(view) {
+ var modifiers = {itemFactory: function() {
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ var hasLocalMovieResults = searchResultCounts.videoOfflineCount > 0;
+ var hasLocalTVResults = searchResultCounts.videoOfflineCount > 0;
+ var showMarketplace = (this._movieMarketplaceEnabled || this._tvMarketplaceEnabled);
+ var showMovies = (this._movieMarketplaceEnabled || hasLocalMovieResults);
+ var showTV = (this._tvMarketplaceEnabled || hasLocalTVResults);
+ var showCast = this._actorSearchEnabled && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.graceNoteService);
+ var nodes = [];
+ if (showMarketplace) {
+ if (showMovies && showTV)
+ nodes = nodes.concat([new MS.Entertainment.ViewModels.Node(MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchAll, String.id.IDS_SEARCH_FILTER_ALL, new MS.Entertainment.ViewModels.NodeValues(null, null, {
+ showMarketplace: true, showCollection: true, showMovies: true, showTVSeries: true, showCast: showCast, showOtherVideos: !MS.Entertainment.Utilities.isVideoApp2
+ }))]);
+ if (showMovies)
+ nodes = nodes.concat([new MS.Entertainment.ViewModels.Node(MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchMovies, String.id.IDS_MOVIE_COLLECTION_TITLE, new MS.Entertainment.ViewModels.NodeValues(null, null, {
+ showMarketplace: true, showCollection: true, showMovies: true, showTVSeries: false, showCast: false, showOtherVideos: false
+ }))]);
+ if (showTV)
+ nodes = nodes.concat([new MS.Entertainment.ViewModels.Node(MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchTV, String.id.IDS_TV_COLLECTION_TITLE, new MS.Entertainment.ViewModels.NodeValues(null, null, {
+ showMarketplace: true, showCollection: true, showMovies: false, showTVSeries: true, showCast: false, showOtherVideos: false
+ }))]);
+ if (showCast)
+ nodes = nodes.concat([new MS.Entertainment.ViewModels.Node(MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchCast, String.id.IDS_VIDEO2_SEARCH_CAST_FILTER_VUI_GUI, new MS.Entertainment.ViewModels.NodeValues(null, null, {
+ showMarketplace: false, showCollection: false, showMovies: false, showTVSeries: false, showCast: true, showOtherVideos: false
+ }))])
+ }
+ else
+ nodes = [new MS.Entertainment.ViewModels.Node(MS.Entertainment.ViewModels.VideoSearchAutomationIds.videoSearchAll, String.id.IDS_SEARCH_FILTER_ALL, new MS.Entertainment.ViewModels.NodeValues(null, null, {
+ showMarketplace: false, showCollection: false, showMovies: false, showTVSeries: false, showCast: false, showOtherVideos: true
+ }))];
+ return nodes
+ }.bind(this)};
+ return modifiers
+ }, _collectionVideos: function _collectionVideos(query, resultType, options) {
+ this._addSearchCallback(query, resultType, options, "videoOfflineResult", options.showCollection && (options.showMovies || options.showTVSeries))
+ }, _marketplaceVideos: function _marketplaceVideos(query, resultType, options) {
+ if (this._isOnline)
+ this._addSearchCallback(query, resultType, options, "videoOnlineResult", options.showMarketplace && (options.showMovies || options.showTVSeries));
+ else
+ this._setResultPopulated(resultType, 0, true)
+ }, _otherVideos: function _otherVideos(query, resultType, options) {
+ this._addSearchCallback(query, resultType, options, "otherVideoLocalResult", options.showOtherVideos)
+ }, _graceNoteCast: function _cast(query, resultType, options) {
+ this._addSearchCallback(query, resultType, options, "graceNoteCastResult", options.showCast && !options.showMovies && !options.showTVSeries)
+ }, _updateResultCounts: function _updateResultCounts(options) {
+ if (options.showCollection && (options.showMovies || options.showTVSeries))
+ this._addResultCount("videoOfflineResult", "videoOfflineCount", 25);
+ if (options.showMarketplace && (options.showMovies || options.showTVSeries))
+ this._addResultCount("videoOnlineResult", "videoOnlineCount", 25);
+ if (options.showOtherVideos)
+ this._addResultCount("otherVideoLocalResult", "otherVideoLocalResultCount", 25);
+ if (options.showCast)
+ this._addResultCount("graceNoteCastResult", "graceNoteCastResult", 10);
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ searchResultCounts.hcrCount = (this._hcrResult && this._hcrResult.hcrResult) ? 1 : 0;
+ searchResultCounts.allCount += searchResultCounts.hcrCount
+ }, _getHCRResult: function _getHCRResult() {
+ return new MS.Entertainment.ViewModels.VideoHCRResult
+ }, _searchCompleted: function _searchCompleted() {
+ MS.Entertainment.ViewModels.NewSearchViewModel.prototype._searchCompleted.call(this);
+ var searchResultCounts = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.searchResultCounts);
+ if (searchResultCounts.allCount === -1) {
+ searchResultCounts.allCount = 0;
+ searchResultCounts.hcrCount = 0;
+ searchResultCounts.videoOfflineCount = 0;
+ searchResultCounts.videoOnlineCount = 0;
+ searchResultCounts.otherVideoLocalResultCount = 0
+ }
+ }, _clearSearch: function _clearSearch() {
+ this._setLargeItemIndex(-1);
+ MS.Entertainment.ViewModels.NewSearchViewModel.prototype._clearSearch.call(this)
+ }
+ }, {
+ ViewTypes: {
+ allVideo: "allVideo", movies: "movies", tvShows: "tvShows", noMarketplace: "noMarketplace"
+ }, ViewIndex: {
+ allVideo: 0, movies: 1, tvShows: 2, noMarketplace: 0
+ }, Views: {
+ allVideo: new MS.Entertainment.ViewModels.NodeValues(null, null, {selectedTemplate: MS.Entertainment.ViewModels.VideoSearchTemplates.all}), noMarketplace: new MS.Entertainment.ViewModels.NodeValues(null, null, {selectedTemplate: MS.Entertainment.ViewModels.VideoSearchTemplates.noMarketplace})
+ }, searchTypeResults: {
+ allVideo: [{
+ callFunction: "_otherVideos", maxResults: 25, mediaType: Microsoft.Entertainment.Queries.ObjectType.video, videoType: Microsoft.Entertainment.Queries.VideoType.other
+ }, {
+ callFunction: "_collectionVideos", maxResults: 50, mediaType: Microsoft.Entertainment.Queries.ObjectType.video, videoType: Microsoft.Entertainment.Queries.VideoType.movie, includesHcrResult: true
+ }, {
+ callFunction: "_marketplaceVideos", maxResults: 50, mediaType: Microsoft.Entertainment.Queries.ObjectType.video, videoType: Microsoft.Entertainment.Queries.VideoType.movie, includesHcrResult: true
+ }, {
+ callFunction: "_graceNoteCast", maxResults: 10, mediaType: Microsoft.Entertainment.Queries.ObjectType.video, videoType: Microsoft.Entertainment.Queries.VideoType.other
+ }], noMarketplace: [{
+ callFunction: "_otherVideos", maxResults: 25, mediaType: Microsoft.Entertainment.Queries.ObjectType.video, videoType: Microsoft.Entertainment.Queries.VideoType.other
+ }, ]
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/MovieImmersiveViewModel.js b/packages/microsoft.zunevideo/ViewModels/Video/MovieImmersiveViewModel.js
new file mode 100644
index 00000000..14186bde
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/MovieImmersiveViewModel.js
@@ -0,0 +1,362 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {
+ MovieImmersiveViewModel: MS.Entertainment.UI.Framework.define(function movieImmersiveViewModel() {
+ this.frames = new MS.Entertainment.ObservableArray;
+ this.addMediaClassToImmersiveDetails()
+ }, {
+ frames: null, createOverviewFrame: false, _mediaDeletedBindingMethod: null, _sessionMgrBindings: null, _relatedViewModel: null, _activitiesViewModel: null, _criticReviewViewModel: null, _mediaItem: null, primaryText: String.empty, secondaryText: String.empty, backgroundImageUri: String.empty, mediaTypeClassName: "mediatype-movie", dispose: function dispose() {
+ this.clearSessionBindings();
+ if (this._mediaDeletedBindingMethod) {
+ this._mediaDeletedBindingMethod.cancel();
+ this._mediaDeletedBindingMethod = null
+ }
+ this.removeOtherMediaClasses(true)
+ }, freeze: function movieImmersiveViewModel_freeze() {
+ this.removeOtherMediaClasses(true)
+ }, thaw: function movieImmersiveViewModel_thaw() {
+ this.addMediaClassToImmersiveDetails()
+ }, viewMoreInfo: {get: function() {
+ return MS.Entertainment.Utilities.isVideoApp1 ? {
+ icon: MS.Entertainment.UI.Icon.nowPlayingNext, title: String.load(String.id.IDS_DETAILS_VIEW_MORE)
+ } : {
+ icon: MS.Entertainment.UI.Icon.moreActions, title: null
+ }
+ }}, clearSessionBindings: function clearSessionBindings() {
+ if (this._sessionMgrBindings) {
+ this._sessionMgrBindings.cancel();
+ this._sessionMgrBindings = null
+ }
+ }, setupMediaDeleteMonitor: function setupMediaDeleteMonitor() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.mediaDeleted)) {
+ var deleteService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.mediaDeleted);
+ this._mediaDeletedBindingMethod = MS.Entertainment.Utilities.addEventHandlers(deleteService, {mediaDeleted: this.handleDeleteMedia.bind(this)})
+ }
+ }, handleDeleteMedia: function handleDeleteMedia(deletedMedia) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var currentPage = WinJS.Utilities.getMember("currentPage", navigationService);
+ if (!currentPage || WinJS.Utilities.getMember("iaNode.moniker", currentPage) !== MS.Entertainment.UI.Monikers.immersiveDetails)
+ return;
+ var mediaItem = WinJS.Utilities.getMember("_mediaItem", this);
+ var pageMediaItem = WinJS.Utilities.getMember("options.mediaItem", currentPage);
+ var deletedMediaItem = WinJS.Utilities.getMember("detail", deletedMedia);
+ if (mediaItem && mediaItem.isEqual(pageMediaItem) && pageMediaItem.isEqual(deletedMediaItem))
+ navigationService.navigateBack()
+ }
+ }, updateMetaData: function updateMetaData(mediaItem, deferAdditionalFrames) {
+ MS.Entertainment.ViewModels.assert(!deferAdditionalFrames, "Calling MovieImmersiveViewModel with deferAdditionalFrames = true is not supported anymore");
+ this._mediaItem = mediaItem;
+ var hydratePromise;
+ if (mediaItem.refresh) {
+ this.createOverviewFrame = true;
+ hydratePromise = mediaItem.refresh({listenForDBUpdates: true}).then(function mediaHydrated() {
+ this._mediaItem = mediaItem;
+ return mediaItem
+ }.bind(this), function mediaHydrateFailed() {
+ return mediaItem
+ }.bind(this))
+ }
+ else
+ hydratePromise = WinJS.Promise.wrap(mediaItem);
+ this.frames = this.buildFrames(hydratePromise, deferAdditionalFrames);
+ hydratePromise.then(function mediaHydrateComplete(value) {
+ if (this._mediaItem && this._mediaItem.name) {
+ this.primaryText = this._mediaItem.name;
+ this.secondaryText = String.load(String.id.IDS_MOVIE_HERO_HEADING);
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ if (this._mediaItem.xboxBackgroundImageUri !== this._mediaItem.studioBackgroundImageUri)
+ this.backgroundImageUri = this._mediaItem.xboxBackgroundImageResizeUri;
+ return WinJS.Promise.timeout(500)
+ }
+ }.bind(this)).done(function delayFadeInSecondaryText() {
+ var subTitleElement = document.querySelector(MS.Entertainment.UI.Controls.ImmersiveVideoHero.cssSelectors.immersiveSecondaryText);
+ if (subTitleElement)
+ WinJS.UI.Animation.fadeIn(subTitleElement)
+ });
+ return hydratePromise
+ }, removeOtherMediaClasses: function removeOtherMediaClasses(clearAll) {
+ var immersiveDetailsElement = document.querySelector(".immersiveDetails");
+ for (var type in MS.Entertainment.UI.Controls.VideoHeroMediaTypes) {
+ var typeClass = MS.Entertainment.UI.Controls.VideoHeroMediaTypes[type];
+ if (typeClass && (clearAll || typeClass !== this.mediaTypeClassName))
+ if (immersiveDetailsElement && typeClass && WinJS.Utilities.hasClass(immersiveDetailsElement, typeClass))
+ WinJS.Utilities.removeClass(immersiveDetailsElement, typeClass)
+ }
+ }, addMediaClassToImmersiveDetails: function addMediaClassToImmersiveDetails() {
+ var immersiveDetailsElement = document.querySelector(".immersiveDetails");
+ if (immersiveDetailsElement && this.mediaTypeClassName && !WinJS.Utilities.hasClass(immersiveDetailsElement, this.mediaTypeClassName)) {
+ this.removeOtherMediaClasses();
+ WinJS.Utilities.addClass(immersiveDetailsElement, this.mediaTypeClassName)
+ }
+ }, buildFrames: function buildFrames(mediaHydratePromise, deferAdditionalFrames) {
+ var heroControl = MS.Entertainment.UI.Controls.ImmersiveMovieHero;
+ var frames = new MS.Entertainment.ObservableArray([function makeHeroFrame() {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(String.empty, 2, heroControl);
+ frame.columnStyle = "firstImmersiveTwoColumn";
+ frame.getData = function frameGetData() {
+ return mediaHydratePromise.then(function mediaHydrateComplete(value) {
+ var dataContext = new MS.Entertainment.ViewModels.MovieHeroViewModel(value);
+ return WinJS.Promise.wrap(dataContext)
+ }.bind(this))
+ }.bind(this);
+ return frame
+ }.bind(this)()]);
+ this.clearSessionBindings();
+ this.setupMediaDeleteMonitor();
+ if (deferAdditionalFrames) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var completePromise = function completePromise(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing || newValue === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ WinJS.Promise.timeout().then(function _delayed() {
+ this.loadAdditionalFrames(mediaHydratePromise)
+ }.bind(this));
+ this.clearSessionBindings()
+ }
+ }.bind(this);
+ this._sessionMgrBindings = WinJS.Binding.bind(sessionMgr.primarySession, {
+ currentTransportState: completePromise, playerState: completePromise
+ })
+ }
+ else
+ WinJS.Promise.timeout().then(function _delayed() {
+ this.loadAdditionalFrames(mediaHydratePromise)
+ }.bind(this));
+ return frames
+ }, loadAdditionalFrames: function loadAdditionalFrames(mediaHydratePromise) {
+ var heroVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var overviewVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var criticVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var castAndCrewVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var relatedVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var previousVisibleSignal = heroVisibleSignal;
+ mediaHydratePromise.then(function beginLoadingOverviewFrame(value) {
+ heroVisibleSignal.complete();
+ return this.loadOverviewFrame(value, previousVisibleSignal, overviewVisibleSignal)
+ }.bind(this)).then(function addOverviewFrame(overviewFrame) {
+ if (overviewFrame) {
+ this.frames.push(overviewFrame);
+ previousVisibleSignal = overviewVisibleSignal
+ }
+ return WinJS.Promise.wrap()
+ }.bind(this)).then(function beginLoadingCriticReviewFrame() {
+ return previousVisibleSignal.promise.then(function _delay() {
+ return this.loadCriticReviewFrame(this._mediaItem, previousVisibleSignal, criticVisibleSignal).then(function addCriticReviewFrame(criticReviewFrame) {
+ if (criticReviewFrame) {
+ this.frames.push(criticReviewFrame);
+ previousVisibleSignal = criticVisibleSignal
+ }
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }.bind(this))
+ }.bind(this)).then(function beginLoadingCastAndCrewFrame() {
+ return previousVisibleSignal.promise.then(function _delay() {
+ return MS.Entertainment.UI.Controls.CastAndCrewList.makeCastAndCrewFrame(this._mediaItem, previousVisibleSignal, castAndCrewVisibleSignal).then(function addCastAndCrewFrame(castAndCrewFrame) {
+ if (castAndCrewFrame) {
+ var viewMoreInfo = this.viewMoreInfo;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ viewMoreInfo.voicePhrase = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_CAST_BUTTON_VUI_ALM);
+ viewMoreInfo.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_CAST_BUTTON_VUI_PRON);
+ viewMoreInfo.voiceConfidence = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_CAST_BUTTON_VUI_CONF)
+ }
+ castAndCrewFrame.viewMoreInfo = viewMoreInfo;
+ this.frames.push(castAndCrewFrame);
+ previousVisibleSignal = castAndCrewVisibleSignal
+ }
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }.bind(this))
+ }.bind(this)).then(function addRelatedFrame() {
+ return WinJS.Promise.timeout().then(function _delay() {
+ return this.loadRelatedFrame(previousVisibleSignal, relatedVisibleSignal).then(function addRelatedFrame(relatedFrame) {
+ if (relatedFrame)
+ this.frames.push(relatedFrame);
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }.bind(this))
+ }.bind(this))
+ }, loadOverviewFrame: function loadOverviewFrame(mediaItem, previousSignal, visibleSignal) {
+ if (this.createOverviewFrame) {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(" ", 1, MS.Entertainment.UI.Controls.MovieImmersiveOverviewSummary, "/Components/Immersive/Video/MoreVideoOverview.html");
+ frame.hideViewMoreIfEnoughSpace = true;
+ frame.columnStyle = "movieOverviewFrame";
+ frame.viewMoreColumnStyle = "movieOverviewViewMore";
+ var viewMoreInfo = this.viewMoreInfo;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ viewMoreInfo.voicePhrase = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_DESCRIPTION_BUTTON_VUI_ALM);
+ viewMoreInfo.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_DESCRIPTION_BUTTON_VUI_PRON);
+ viewMoreInfo.voiceConfidence = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_DESCRIPTION_BUTTON_VUI_CONF)
+ }
+ frame.viewMoreInfo = viewMoreInfo;
+ frame.viewMoreHeading = String.load(String.id.IDS_NOW_PLAYING_DETAILS_BUTTON);
+ frame.visibleSignal = visibleSignal;
+ frame.getData = function frameGetData() {
+ return WinJS.Promise.wrap({
+ mediaItem: mediaItem, expirationString: null, showButtons: true, previousSignal: previousSignal, visibleSignal: visibleSignal
+ })
+ }.bind(this);
+ return WinJS.Promise.wrap(frame)
+ }
+ else
+ return WinJS.Promise.wrap()
+ }, loadCriticReviewFrame: function loadCriticReviewFrame(mediaItem, previousSignal, visibleSignal) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var rottenTomatoesEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.rottenTomatoes);
+ if (!MS.Entertainment.UI.NetworkStatusService.isOnline() || !rottenTomatoesEnabled || !mediaItem || !mediaItem.criticReview || isNaN(mediaItem.criticReview.reviewScore) || mediaItem.criticReview.reviewScore <= 0)
+ return WinJS.Promise.wrap();
+ if (!this._criticReviewViewModel) {
+ this._criticReviewViewModel = new MS.Entertainment.ViewModels.CriticReviewViewModel(mediaItem);
+ this._criticReviewViewModel.previousSignal = previousSignal;
+ this._criticReviewViewModel.visibleSignal = visibleSignal
+ }
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame("rotten tomatoes\u00AE", 1, MS.Entertainment.UI.Controls.RottenTomatoesImmersivePanel, "/Components/Immersive/Video/CriticReviewMore.html", MS.Entertainment.ViewModels.MovieImmersiveViewModel.Monikers.reviews, MS.Entertainment.Utilities.isVideoApp2);
+ frame.hideViewMoreIfEnoughSpace = this._criticReviewViewModel.maxItems === 0 || this._criticReviewViewModel.fullCriticReviewList.length <= this._criticReviewViewModel.maxItems;
+ frame.columnStyle = "movieCriticReviewFrame";
+ frame.viewMoreColumnStyle = "movieCriticReviewViewMore";
+ var viewMoreInfo = this.viewMoreInfo;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ viewMoreInfo.voicePhrase = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_REVIEWS_BUTTON_VUI_ALM);
+ viewMoreInfo.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_REVIEWS_BUTTON_VUI_PRON);
+ viewMoreInfo.voiceConfidence = String.load(String.id.IDS_VIDEO2_L3_MOVIES_MORE_REVIEWS_BUTTON_VUI_CONF)
+ }
+ frame.viewMoreInfo = viewMoreInfo;
+ frame.visibleSignal = visibleSignal;
+ frame.getData = function criticGetData() {
+ this._criticReviewViewModel.frame = frame;
+ return WinJS.Promise.wrap(this._criticReviewViewModel)
+ }.bind(this);
+ return WinJS.Promise.wrap(frame)
+ }, loadRelatedFrame: function loadRelatedFrame(previousSignal, visibleSignal) {
+ if (!this._mediaItem || !MS.Entertainment.UI.NetworkStatusService.isOnline())
+ return WinJS.Promise.wrap();
+ if (!this._relatedViewModel) {
+ this._relatedViewModel = new MS.Entertainment.ViewModels.MovieRelatedViewModel(this._mediaItem);
+ this._relatedViewModel.previousSignal = previousSignal;
+ this._relatedViewModel.visibleSignal = visibleSignal
+ }
+ return this._relatedViewModel.getItems().then(function relatedSuccess(relatedItems) {
+ if (relatedItems && relatedItems.length) {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(String.load(String.id.IDS_DETAILS_VIDEO_HUB_RELATED), 2, MS.Entertainment.UI.Controls.ImmersiveRelatedGridItems, null, null, MS.Entertainment.Utilities.isVideoApp2);
+ frame.hideViewMoreIfEnoughSpace = true;
+ frame.columnStyle = "movieRelatedFrame";
+ frame.visibleSignal = visibleSignal;
+ frame.getData = function relatedGetData() {
+ return WinJS.Promise.wrap(this._relatedViewModel)
+ }.bind(this);
+ return frame
+ }
+ }.bind(this), function relatedError(e) {
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }
+ }, {Monikers: {
+ overview: "overview", activities: "activities", related: "related", cast: "cast", reviews: "reviews"
+ }}), MovieHeroViewModel: MS.Entertainment.deferredDerive(MS.Entertainment.ViewModels.BaseHeroViewModel, function movieHeroViewModel(mediaItem) {
+ this.base(mediaItem);
+ this._initialize()
+ }, {_initialize: function _initialize() {
+ if (this.buttons)
+ this.buttons.clear();
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var trailerEnabled = false;
+ trailerEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace) && ((this.mediaItem.hasCanonicalId && this.mediaItem.videoPreviewUrl) || (this.mediaItem.hasServiceId && MS.Entertainment.ViewModels.SmartBuyStateHandlers._mediaHasAnyRight(this.mediaItem, MS.Entertainment.Utilities.defaultClientTypeFromApp, [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Preview, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.PreviewStream])));
+ if (trailerEnabled) {
+ var buttons = MS.Entertainment.ViewModels.SmartBuyButtons.getVideoImmersiveDetailsHeroButtons(this.mediaItem);
+ this.actionDescription = String.load(String.id.IDS_DETAILS_FEATURED_TRAILER_TITLE);
+ this._addButtons(buttons)
+ }
+ }}), MovieRelatedViewModel: MS.Entertainment.deferredDerive(MS.Entertainment.ViewModels.BaseImmersiveListViewModel, function relatedMoviesViewModelConstructor(mediaItem) {
+ this.base();
+ MS.Entertainment.ViewModels.assert(mediaItem, "MoviesRelatedViewModel requires a mediaItem");
+ if (!mediaItem)
+ throw new Error("MoviesRelatedViewModel requires a mediaItem");
+ this._mediaItem = mediaItem;
+ this._queryWatcher = new MS.Entertainment.Framework.QueryWatcher("relatedMovies");
+ this.columnSpan = 1;
+ this._heroAugmentation = MS.Entertainment.ViewModels.MovieRelatedViewModel.HeroAugmentation;
+ this.selectedTemplate = MS.Entertainment.ViewModels.MovieRelatedViewModel.GridTemplate;
+ this.maxItems = 10;
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ var screenHeight = MS.Entertainment.Utilities.getWindowHeight();
+ if (screenHeight <= 900) {
+ this.selectedTemplate.itemTemplates[0].template = "/Components/Video/VideoMarketplaceTemplates.html#movieRelatedGridItemSmallTemplate";
+ this.selectedTemplate.itemSize = MS.Entertainment.Utilities.relatedMovieGridItemSizeSmall
+ }
+ else {
+ this.selectedTemplate.itemTemplates[0].template = "/Components/Video/VideoMarketplaceTemplates.html#movieRelatedGridItemTemplate";
+ this.selectedTemplate.itemSize = MS.Entertainment.Utilities.relatedMovieGridItemSize
+ }
+ }
+ else {
+ this.selectedTemplate.itemTemplates[0].template = "/Components/Video/VideoMarketplaceTemplates2.html#movieRelatedGridItemTemplate";
+ this.selectedTemplate.itemSize = MS.Entertainment.Utilities.relatedMovieGridItemSize2
+ }
+ }, {
+ _mediaItem: null, _queryWatcher: null, items: null, fullItemList: null, maxItems: -1, visibleSignal: null, previousSignal: null, getItems: function getItems() {
+ if (this.items)
+ return WinJS.Promise.wrap(this.items);
+ return this._beginQuery()
+ }, _beginQuery: function _beginQuery() {
+ var relatedQuery = new MS.Entertainment.Data.Query.Video.EdsMovieRelatedItems;
+ relatedQuery.serviceId = this._mediaItem.canonicalId;
+ relatedQuery.impressionGuid = this._mediaItem.impressionGuid;
+ relatedQuery.relevancyTrackingContent = this._mediaItem.relevancyTrackingContent;
+ this._queryWatcher.registerQuery(relatedQuery);
+ return relatedQuery.execute().then(function relatedSuccess(q) {
+ if (q.result.items)
+ return q.result.items.toArray().then(function(data) {
+ this._setItems(data);
+ this.fullItemList = {items: data};
+ this.fullItemList.getItems = this.getItems.bind(this.fullItemList);
+ return this.items
+ }.bind(this));
+ else
+ return null
+ }.bind(this), function relatedFailure(e){}.bind(this))
+ }
+ }, {
+ HeroAugmentation: MS.Entertainment.Data.define(null, {heroLabel: MS.Entertainment.Data.Property.convertNoDeflate("releaseDate", MS.Entertainment.Data.Factory.year, null)}), GridTemplate: {
+ fixedColumnCount: null, fixedRowCount: 2, rowLayout: true, itemSize: MS.Entertainment.Utilities.relatedMovieGridItemSize, itemTemplates: [{
+ value: Microsoft.Entertainment.Queries.VideoType.movie, template: "/Components/Video/VideoMarketplaceTemplates.html#movieRelatedGridItemTemplate"
+ }], propertyName: ['videoType', 'mediaType'], className: "relatedMoviesGrid"
+ }
+ }), CastAndCrewViewModel: MS.Entertainment.deferredDerive(MS.Entertainment.ViewModels.BaseImmersiveListViewModel, function castAndCrewConstructor(mediaItem) {
+ this.base();
+ this.columnSpan = 1;
+ this.maxItems = MS.Entertainment.Utilities.isApp2 ? 7 : 0;
+ MS.Entertainment.ViewModels.assert(mediaItem, "CastAndCrewViewModel requires a mediaItem");
+ if (!mediaItem)
+ throw new Error("CastAndCrewViewModel requires a mediaItem");
+ this._mediaItem = mediaItem;
+ this.selectedTemplate = MS.Entertainment.ViewModels.CastAndCrewViewModel.DefaultTemplate;
+ this._setItems(mediaItem.contributors)
+ }, {
+ fullItemList: null, visibleSignal: null, previousSignal: null, _setItems: function _setItems(items) {
+ this.items = this.maxItems ? items.slice(0, this.maxItems) : items;
+ this.fullItemList = items
+ }
+ }, {DefaultTemplate: {
+ templateUrl: "/Components/Video/VideoMarketplaceTemplates.html#castAndCrewTemplate", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace}, className: "castAndCrew"
+ }}), CriticReviewViewModel: MS.Entertainment.defineObservable(function criticReviewConstructor(mediaItem) {
+ MS.Entertainment.ViewModels.assert(mediaItem, "CriticReviewModel requires a mediaItem");
+ if (!mediaItem)
+ throw new Error("CriticReviewViewModel requires a mediaItem");
+ this.mediaItem = mediaItem;
+ if (mediaItem && mediaItem.criticReview && mediaItem.criticReview.criticReviews) {
+ this.maxItems = MS.Entertainment.Utilities.isApp2 ? 1 : 0;
+ this._setItems(mediaItem.criticReview.criticReviews)
+ }
+ }, {
+ maxItems: 0, mediaItem: null, fullCriticReviewList: null, criticReviews: null, visibleSignal: null, previousSignal: null, _setItems: function _setItems(items) {
+ if (items) {
+ var filteredItems = items.filter(function filterIncompleteReviews(review) {
+ return (review && review.criticName && review.publication && review.scoreDescription && review.scoreDescription !== "none")
+ });
+ this.criticReviews = this.maxItems ? filteredItems.slice(0, this.maxItems) : filteredItems;
+ this.fullCriticReviewList = filteredItems
+ }
+ }
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/TvImmersiveViewModel.js b/packages/microsoft.zunevideo/ViewModels/Video/TvImmersiveViewModel.js
new file mode 100644
index 00000000..ba8461ed
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/TvImmersiveViewModel.js
@@ -0,0 +1,685 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {
+ TvHeroViewModel: MS.Entertainment.deferredDerive(MS.Entertainment.ViewModels.BaseHeroViewModel, function tvHeroViewModel(mediaItem) {
+ this.base(mediaItem)
+ }, {}), TvImmersiveViewModel: MS.Entertainment.defineOptionalObservable(function tvImmersiveViewModel() {
+ this.frames = new MS.Entertainment.ObservableArray;
+ this.setupMediaRightsMonitor();
+ this.setupMediaDeleteMonitor();
+ this.addMediaClassToImmersiveDetails()
+ }, {
+ _bookmarkedEpisode: null, _refreshEpisodePromise: null, frames: null, handleNavigationCompleteCallback: true, navigationCompleteCallback: null, _sessionMgrBindings: null, _appBarBindings: null, _mediaDeletedBindingMethod: null, _mediaRightChangedBindingMethod: null, _navigationEventHandlers: null, _mediaContext: null, _firedNavigationComplete: false, _purchaseOptions: null, mediaTypeClassName: "mediatype-tvSeries", wasDirectMediaLink: false, _shareOperation: null, viewMoreInfo: {get: function() {
+ return MS.Entertainment.Utilities.isVideoApp1 ? {
+ icon: MS.Entertainment.UI.Icon.nowPlayingNext, title: String.load(String.id.IDS_DETAILS_VIEW_MORE)
+ } : {
+ icon: MS.Entertainment.UI.Icon.moreActions, title: null
+ }
+ }}, clearSessionBindings: function clearSessionBindings() {
+ if (this._sessionMgrBindings) {
+ this._sessionMgrBindings.cancel();
+ this._sessionMgrBindings = null
+ }
+ }, setupMediaRightsMonitor: function setupMediaRightsMonitor() {
+ try {
+ this._mediaRightChangedBindingMethod = this._mediaRightChanged.bind(this);
+ Microsoft.Entertainment.Marketplace.Marketplace.addEventListener("mediarightchanged", this._mediaRightChangedBindingMethod)
+ }
+ catch(e) {
+ var message = (e && e.message) || e;
+ var errorCode = e && e.number;
+ MS.Entertainment.ViewModels.fail("Microsoft.Entertainment.Marketplace.Marketplace.addEventListener failed with error:" + errorCode + "; message:" + message);
+ this._mediaRightChangedBindingMethod = null
+ }
+ }, setupMediaDeleteMonitor: function setupMediaDeleteMonitor() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.mediaDeleted)) {
+ var deleteService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.mediaDeleted);
+ this._mediaDeletedBindingMethod = MS.Entertainment.Utilities.addEventHandlers(deleteService, {mediaDeleted: this.handleDeleteMedia.bind(this)})
+ }
+ }, updateMetaData: function updateMetaData(mediaItem, deferAdditionalFrames) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (this._navigationEventHandlers) {
+ this._navigationEventHandlers.cancel();
+ this._navigationEventHandlers = null
+ }
+ var seasonHydratePromise = null;
+ var seriesHydratePromise = null;
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ this._navigationEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(page, {onNavigateTo: function onNavigateTo(args) {
+ var fromMoniker = WinJS.Utilities.getMember("detail.previous.iaNode.moniker", args);
+ if (fromMoniker === MS.Entertainment.UI.Monikers.fullScreenNowPlaying && !this.isLastPlayedMediaAnExtraOrError() && !this.wasDirectMediaLink)
+ this.findNextEpisode(null, true);
+ else
+ this.getLibraryEpisodes().done(function libraryEpisodesFound(episodes) {
+ this.libraryEpisodes = episodes
+ }.bind(this), function libraryEpisodesFailed(error){})
+ }.bind(this)});
+ var directMediaLink = null;
+ if (mediaItem && MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(mediaItem)) {
+ this.series = MS.Entertainment.Utilities.convertMediaItemToTvSeries(mediaItem);
+ this.episode = mediaItem;
+ directMediaLink = mediaItem
+ }
+ else if (mediaItem && MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(mediaItem)) {
+ this.series = MS.Entertainment.Utilities.convertMediaItemToTvSeries(mediaItem);
+ seasonHydratePromise = mediaItem.hydrate().then(function setSeasonOnHydrated() {
+ this.setSeason(mediaItem);
+ return mediaItem
+ }.bind(this));
+ directMediaLink = mediaItem
+ }
+ else
+ this.series = mediaItem;
+ this.wasDirectMediaLink = !!directMediaLink;
+ if (this.series && this.series.refresh)
+ seriesHydratePromise = this.series.refresh().then(function seriesHydrated(mediaItem) {
+ this.series = mediaItem;
+ return WinJS.Promise.wrap(mediaItem)
+ }.bind(this), function seriesHydrateFailed(mediaItem) {
+ return WinJS.Promise.wrap(mediaItem)
+ });
+ else
+ seriesHydratePromise = WinJS.Promise.wrap(this.series);
+ var combinedPromise = WinJS.Promise.join({
+ season: seasonHydratePromise, series: seriesHydratePromise
+ }).then(function seriesHydrated(data) {
+ var series = data.series;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ if (series.xboxBackgroundImageUri !== series.networkBackgroundImageUri)
+ this.backgroundImageUri = series.xboxBackgroundImageResizeUri;
+ this.seriesSmartBuyStateEngine = new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine;
+ this.seriesSmartBuyStateEngine.initialize(this.series, MS.Entertainment.ViewModels.SmartBuyButtons.getTVSeriesDetailsButtons(this.series, MS.Entertainment.UI.Actions.ExecutionLocation.canvas, this), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onTVSeriesDetailsStateChanged)
+ }
+ return this.findNextEpisode(directMediaLink)
+ }.bind(this), function seriesFailed() {
+ return WinJS.Promise.wrap(this.series)
+ }.bind(this));
+ this.frames = this.buildFrames(combinedPromise, deferAdditionalFrames);
+ return combinedPromise
+ }, handleDeleteMedia: function handleDeleteMedia(deletedMedia) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var currentPage = WinJS.Utilities.getMember("currentPage", navigationService);
+ if (!currentPage || WinJS.Utilities.getMember("iaNode.moniker", currentPage) !== MS.Entertainment.UI.Monikers.immersiveDetails)
+ return;
+ var mediaItem = WinJS.Utilities.getMember("episode", this);
+ var deletedMediaItem = WinJS.Utilities.getMember("detail", deletedMedia);
+ if (mediaItem && mediaItem.isEqual(deletedMediaItem))
+ return this.findNextEpisode(this.season)
+ }
+ }, findNextEpisode: function findNextEpisode(directMediaLink, isBackNavigate) {
+ var libraryEpisodesPromise = WinJS.Promise.wrap();
+ var lastWatchedPromise = WinJS.Promise.wrap();
+ if (this.series) {
+ libraryEpisodesPromise = this.getLibraryEpisodes().then(function libraryEpisodesFound(episodes) {
+ this.libraryEpisodes = episodes;
+ return WinJS.Promise.wrap(episodes)
+ }.bind(this), function libraryEpisodesFailed(episodes) {
+ return WinJS.Promise.wrap(null)
+ });
+ lastWatchedPromise = this.getLastWatchedBookmark(isBackNavigate).then(function lastWatchedFound(bookmark) {
+ this._bookmarkedEpisode = bookmark;
+ return WinJS.Promise.wrap(bookmark)
+ }.bind(this), function lastWatchedFailed(bookmark) {
+ return WinJS.Promise.wrap(null)
+ })
+ }
+ return WinJS.Promise.join([libraryEpisodesPromise, lastWatchedPromise]).then(function queriesCompleted() {
+ var lastWatchedSeason = null;
+ var lastWatchedEpisode = null;
+ var lastWatchedEpisodeLibraryId = -1;
+ var lastWatchedComplete = false;
+ var minWatchedPercentage = 0.95;
+ if (!directMediaLink && !this.libraryEpisodes)
+ if (this.series && this.series.seasons)
+ return this.series.seasons.itemsFromIndex(0).then(function scanSeasons(seasons) {
+ if (seasons.items && seasons.items.length > 0) {
+ var seasonToSet = seasons.items[seasons.items.length - 1];
+ if (seasonToSet && seasonToSet.data)
+ this.setSeason(seasonToSet.data)
+ }
+ return WinJS.Promise.wrap(this.season)
+ }.bind(this));
+ if (this._bookmarkedEpisode) {
+ lastWatchedSeason = this._bookmarkedEpisode.tvSeasonNumber;
+ lastWatchedEpisode = this._bookmarkedEpisode.tvEpisodeNumber;
+ lastWatchedEpisodeLibraryId = this._bookmarkedEpisode.tvEpisodeId;
+ var lastPosition = this._bookmarkedEpisode.tvEpisodeBookmark;
+ var duration = this._bookmarkedEpisode.tvEpisodeDuration;
+ if (lastPosition > 0)
+ lastWatchedComplete = ((lastPosition / duration) > minWatchedPercentage);
+ else
+ lastWatchedComplete = this._bookmarkedEpisode.hasPlayed
+ }
+ if ((!MS.Entertainment.UI.NetworkStatusService.isOnline() && this.libraryEpisodes) || (!this.series.seasons && this.libraryEpisodes)) {
+ var useNextEpisode = false;
+ var currentEpisode = null;
+ var nextEpisode = null;
+ return this.libraryEpisodes.itemsFromIndex(0).then(function scanLibrary(sortedLibraryEpisodes) {
+ if (lastWatchedEpisodeLibraryId === -1 && sortedLibraryEpisodes.items.length > 0) {
+ for (var x = 0; x < sortedLibraryEpisodes.items.length; x++)
+ if (sortedLibraryEpisodes.items[x].data.episodeNumber > 0 && sortedLibraryEpisodes.items[x].data.seasonNumber > 0) {
+ currentEpisode = sortedLibraryEpisodes.items[x].data;
+ break
+ }
+ }
+ else
+ for (var x = 0; x < sortedLibraryEpisodes.items.length; x++) {
+ if (useNextEpisode) {
+ nextEpisode = sortedLibraryEpisodes.items[x].data;
+ break
+ }
+ if (lastWatchedEpisodeLibraryId === sortedLibraryEpisodes.items[x].data.libraryId) {
+ if (lastWatchedComplete)
+ useNextEpisode = true;
+ currentEpisode = sortedLibraryEpisodes.items[x].data
+ }
+ }
+ if (nextEpisode)
+ this.setEpisode(nextEpisode);
+ else if (currentEpisode)
+ this.setEpisode(currentEpisode);
+ if (this.series.librarySeasons)
+ return this.series.librarySeasons.itemsFromIndex(0).then(function scanLibrarySeasons(sortedLibrarySeasons) {
+ var latestSeason = null;
+ var seasonToUse = null;
+ for (var x = 0; x < sortedLibrarySeasons.items.length; x++) {
+ var season = sortedLibrarySeasons.items[x].data;
+ latestSeason = season;
+ if (this.episode && this.episode.seasonNumber === season.seasonNumber) {
+ seasonToUse = season;
+ break
+ }
+ }
+ seasonToUse = seasonToUse || latestSeason;
+ this.setSeason(seasonToUse);
+ return WinJS.Promise.wrap(this.season)
+ }.bind(this))
+ }.bind(this))
+ }
+ var scanLibraryEpisodesPromise = this.libraryEpisodes ? this.libraryEpisodes.itemsFromIndex(0) : WinJS.Promise.wrap(null);
+ return scanLibraryEpisodesPromise.then(function scanLibrary(sortedLibraryEpisodes) {
+ var seasonHydrationPromise = WinJS.Promise.wrap();
+ var nextEpisodeNumber = -1;
+ var currentEpisode = null;
+ var nextEpisode = null;
+ if (sortedLibraryEpisodes && !this._bookmarkedEpisode) {
+ for (var x = 0; x < sortedLibraryEpisodes.items.length; x++)
+ if (sortedLibraryEpisodes.items[x].data.episodeNumber > 0 && sortedLibraryEpisodes.items[x].data.seasonNumber > 0) {
+ this.setEpisode(sortedLibraryEpisodes.items[x].data);
+ break
+ }
+ }
+ else if (sortedLibraryEpisodes) {
+ nextEpisodeNumber = (lastWatchedEpisode + 1);
+ for (var x = 0; x < sortedLibraryEpisodes.items.length; x++) {
+ if (lastWatchedEpisodeLibraryId === sortedLibraryEpisodes.items[x].data.libraryId) {
+ currentEpisode = sortedLibraryEpisodes.items[x].data;
+ useNextEpisode = true
+ }
+ if (useNextEpisode && lastWatchedEpisode === sortedLibraryEpisodes.items[x].data.episodeNumber && lastWatchedSeason === sortedLibraryEpisodes.items[x].data.seasonNumber && lastWatchedEpisodeLibraryId !== sortedLibraryEpisodes.items[x].data.libraryId) {
+ nextEpisode = sortedLibraryEpisodes.items[x].data;
+ break
+ }
+ if (nextEpisodeNumber === sortedLibraryEpisodes.items[x].data.episodeNumber && lastWatchedSeason === sortedLibraryEpisodes.items[x].data.seasonNumber) {
+ nextEpisode = sortedLibraryEpisodes.items[x].data;
+ break
+ }
+ }
+ if (!lastWatchedComplete && currentEpisode)
+ this.setEpisode(currentEpisode);
+ else if (lastWatchedComplete && nextEpisode)
+ this.setEpisode(nextEpisode);
+ else if (lastWatchedComplete && this.series && this.series.seasons) {
+ var jumpToNextSeason = false;
+ this.series.seasons.itemsFromIndex(0).then(function scanSeasons(seasons) {
+ for (var x = 0; x < seasons.items.length; x++) {
+ var currentSeason = seasons.items[x].data;
+ if (jumpToNextSeason) {
+ nextEpisodeNumber = 1;
+ seasonHydrationPromise = currentSeason.hydrate();
+ break
+ }
+ else if (lastWatchedSeason === currentSeason.seasonNumber)
+ if (lastWatchedEpisode === currentSeason.latestEpisode) {
+ jumpToNextSeason = true;
+ seasonHydrationPromise = currentSeason.hydrate()
+ }
+ else if (nextEpisodeNumber <= currentSeason.latestEpisode) {
+ seasonHydrationPromise = currentSeason.hydrate();
+ break
+ }
+ }
+ }.bind(this))
+ }
+ }
+ return seasonHydrationPromise.then(function seasonHydrated(season) {
+ if (season && season.episodes)
+ season.episodes.itemsFromIndex(0).then(function scanEpisodes(episodes) {
+ for (var x = 0; x < episodes.items.length; x++)
+ if (nextEpisodeNumber === episodes.items[x].data.episodeNumber) {
+ this.setEpisode(episodes.items[x].data);
+ break
+ }
+ if (!this.episode)
+ this.setEpisode(currentEpisode)
+ }.bind(this));
+ var seasons = null;
+ if (this.series)
+ seasons = this.series.seasons || this.series.librarySeasons;
+ if (seasons)
+ return seasons.itemsFromIndex(0).then(function scanSeasons(seasons) {
+ if (directMediaLink)
+ for (var x = 0; x < seasons.items.length; x++)
+ if (directMediaLink.seasonNumber === seasons.items[x].data.seasonNumber) {
+ this.setSeason(seasons.items[x].data);
+ return WinJS.Promise.wrap(this.season)
+ }
+ for (var x = 0; x < seasons.items.length; x++)
+ if (this.episode && this.episode.seasonNumber === seasons.items[x].data.seasonNumber) {
+ this.setSeason(seasons.items[x].data);
+ return WinJS.Promise.wrap(this.season)
+ }
+ if (seasons.items.length > 0) {
+ this.setSeason(seasons.items[seasons.items.length - 1].data);
+ return WinJS.Promise.wrap(this.season)
+ }
+ }.bind(this))
+ }.bind(this));
+ return WinJS.Promise.wrap(this.season)
+ }.bind(this), function failed() {
+ return WinJS.Promise.wrap(this.season)
+ })
+ }.bind(this))
+ }, isLastPlayedMediaAnExtraOrError: function isLastPlayedMediaAnExtraOrError() {
+ var isExtraOrError = false;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ if (playbackSession && (playbackSession.errorDescriptor || (playbackSession.lastPlayedMedia && (playbackSession.lastPlayedMedia.seasonNumber === 0 || playbackSession.lastPlayedMedia.episodeNumber === 0))))
+ isExtraOrError = true;
+ return isExtraOrError
+ }, removeOtherMediaClasses: function removeOtherMediaClasses(clearAll) {
+ var immersiveDetailsElement = document.querySelector(".immersiveDetails");
+ for (var type in MS.Entertainment.UI.Controls.VideoHeroMediaTypes) {
+ var typeClass = MS.Entertainment.UI.Controls.VideoHeroMediaTypes[type];
+ if (typeClass && (clearAll || typeClass !== this.mediaTypeClassName))
+ if (immersiveDetailsElement && typeClass && WinJS.Utilities.hasClass(immersiveDetailsElement, typeClass))
+ WinJS.Utilities.removeClass(immersiveDetailsElement, typeClass)
+ }
+ }, addMediaClassToImmersiveDetails: function addMediaClassToImmersiveDetails() {
+ var immersiveDetailsElement = document.querySelector(".immersiveDetails");
+ if (immersiveDetailsElement && this.mediaTypeClassName && !WinJS.Utilities.hasClass(immersiveDetailsElement, this.mediaTypeClassName)) {
+ this.removeOtherMediaClasses();
+ WinJS.Utilities.addClass(immersiveDetailsElement, this.mediaTypeClassName)
+ }
+ }, buildFrames: function buildFrames(mediaHydratePromise, deferAdditionalFrames) {
+ var heroControl = MS.Entertainment.UI.Controls.ImmersiveTvHero;
+ var frames = new MS.Entertainment.ObservableArray([function makeHeroFrame() {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(String.load(String.id.IDS_DETAILS_OVERVIEW), 2, heroControl);
+ frame.columnStyle = "firstImmersiveTwoColumn";
+ frame.getData = function frameGetData() {
+ return mediaHydratePromise.then(function mediaHydrateComplete(value) {
+ var dataContext = new MS.Entertainment.ViewModels.TvHeroViewModel(this.series);
+ dataContext.tvImmersiveViewModel = this;
+ dataContext.mediaItem = this.series;
+ dataContext.selectedItem = this.season;
+ dataContext.episode = this.episode;
+ dataContext.season = this.season;
+ dataContext.series = this.series;
+ return WinJS.Promise.wrap(dataContext)
+ }.bind(this))
+ }.bind(this);
+ return frame
+ }.bind(this)()]);
+ this.clearSessionBindings();
+ if (deferAdditionalFrames) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var completePromise = function completePromise(newValue) {
+ if (newValue === MS.Entertainment.Platform.Playback.TransportState.playing || newValue === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ WinJS.Promise.timeout().then(function _delayed() {
+ this.loadAdditionalFrames(mediaHydratePromise)
+ }.bind(this));
+ this.clearSessionBindings()
+ }
+ }.bind(this);
+ this._sessionMgrBindings = WinJS.Binding.bind(sessionMgr.primarySession, {
+ currentTransportState: completePromise, playerState: completePromise
+ })
+ }
+ else
+ WinJS.Promise.timeout().then(function _delayed() {
+ this.loadAdditionalFrames(mediaHydratePromise)
+ }.bind(this));
+ return frames
+ }, loadAdditionalFrames: function loadAdditionalFrames(mediaHydratePromise) {
+ var heroVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var overviewVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var episodesVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var extrasVisibleSignal = new MS.Entertainment.UI.Framework.Signal;
+ var previousVisibleSignal = heroVisibleSignal;
+ function makeOverviewFrame(previousSignal, visibleSignal) {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(" ", 1, MS.Entertainment.UI.Controls.TvImmersiveOverviewSummary, "/Components/Immersive/Video/MoreVideoOverview.html");
+ frame.hideViewMoreIfEnoughSpace = true;
+ frame.columnStyle = "tvOverviewFrame";
+ frame.viewMoreColumnStyle = "tvOverviewViewMore";
+ var viewMoreInfo = this.viewMoreInfo;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ viewMoreInfo.voicePhrase = String.load(String.id.IDS_VIDEO2_TV_MORE_DESCRIPTION_BUTTON_VUI_ALM);
+ viewMoreInfo.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_TV_MORE_DESCRIPTION_BUTTON_VUI_PRON);
+ viewMoreInfo.voiceConfidence = String.load(String.id.IDS_VIDEO2_TV_MORE_DESCRIPTION_BUTTON_VUI_CONF)
+ }
+ frame.viewMoreInfo = viewMoreInfo;
+ frame.viewMoreHeading = String.load(String.id.IDS_NOW_PLAYING_DETAILS_BUTTON);
+ frame.visibleSignal = visibleSignal;
+ frame.getData = function frameGetData() {
+ frame.viewMoreSubHeading = MS.Entertainment.Utilities.isVideoApp2 ? this.secondaryText : null;
+ return WinJS.Promise.wrap({
+ series: this.series, season: this.season, episode: this.episode, mediaItem: (this.season && this.season.episode) ? this.season.episode : this.season, tvImmersiveViewModel: this, previousSignal: previousSignal, visibleSignal: visibleSignal
+ })
+ }.bind(this);
+ return frame
+ }
+ {};
+ function makeErrorFrame(error, headerText) {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(headerText, 1, MS.Entertainment.UI.Controls.BaseImmersiveSummary);
+ frame.hideViewMoreIfEnoughSpace = true;
+ frame.getData = function frameGetData() {
+ return WinJS.Promise.wrapError(error)
+ };
+ return frame
+ }
+ {};
+ heroVisibleSignal.complete();
+ mediaHydratePromise.then(function beginLoadingOverview(value) {
+ if (MS.Entertainment.UI.NetworkStatusService.isOnline() || this.libraryEpisodes) {
+ this.frames.push(makeOverviewFrame.call(this, previousVisibleSignal, overviewVisibleSignal));
+ previousVisibleSignal = overviewVisibleSignal
+ }
+ return WinJS.Promise.wrap()
+ }.bind(this)).then(function addEpisodesPanel() {
+ return previousVisibleSignal.promise.then(function _delay() {
+ this.loadEpisodesFrame(previousVisibleSignal, episodesVisibleSignal).then(function loadEpisodesFrameComplete(episodesFrame) {
+ if (episodesFrame) {
+ this.frames.push(episodesFrame);
+ previousVisibleSignal = episodesVisibleSignal
+ }
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }.bind(this))
+ }.bind(this)).then(function addExtrasPanel() {
+ return previousVisibleSignal.promise.then(function _delay() {
+ this.loadExtrasFrame(previousVisibleSignal, extrasVisibleSignal).then(function loadExtrasFrameComplete(extrasFrame) {
+ if (extrasFrame) {
+ this.frames.push(extrasFrame);
+ previousVisibleSignal = extrasVisibleSignal
+ }
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }.bind(this))
+ }.bind(this))
+ }, loadEpisodesFrame: function loadEpisodesFrame(previousSignal, visibleSignal) {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(String.load(String.id.IDS_DETAILS_EPISODES_LABEL_LC), 1, MS.Entertainment.UI.Controls.EpisodeList, "/Components/Immersive/Video/EpisodesMore.html", null, MS.Entertainment.Utilities.isVideoApp2);
+ frame.hideViewMoreIfEnoughSpace = true;
+ frame.columnStyle = "tvEpisodesFrame";
+ frame.viewMoreColumnStyle = "tvEpisodesViewMore";
+ var viewMoreInfo = this.viewMoreInfo;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ viewMoreInfo.voicePhrase = String.load(String.id.IDS_VIDEO2_TV_MORE_EPISODES_BUTTON_VUI_ALM);
+ viewMoreInfo.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_TV_MORE_EPISODES_BUTTON_VUI_PRON);
+ viewMoreInfo.voiceConfidence = String.load(String.id.IDS_VIDEO2_TV_MORE_EPISODES_BUTTON_VUI_CONF)
+ }
+ frame.viewMoreInfo = viewMoreInfo;
+ frame.visibleSignal = visibleSignal;
+ frame.getData = function frameGetData() {
+ var dataContext = {};
+ dataContext.frame = frame;
+ dataContext.tvImmersiveViewModel = this;
+ dataContext.maxItems = MS.Entertainment.Utilities.isVideoApp1 ? 0 : 5;
+ dataContext.previousSignal = previousSignal;
+ dataContext.visibleSignal = visibleSignal;
+ frame.viewMoreSubHeading = MS.Entertainment.Utilities.isVideoApp2 ? this.secondaryText : null;
+ return WinJS.Promise.wrap(dataContext)
+ }.bind(this);
+ return WinJS.Promise.wrap(frame)
+ }, loadExtrasFrame: function loadExtrasFrame(previousSignal, visibleSignal) {
+ var frame = MS.Entertainment.UI.Controls.Immersive.makeFrame(String.load(String.id.IDS_DETAILS_EXTRA_EPISODE_LABEL_LC), 1, MS.Entertainment.UI.Controls.ExtrasList, "/Components/Immersive/Video/ExtrasMore.html", null, MS.Entertainment.Utilities.isVideoApp2);
+ frame.hideViewMoreIfEnoughSpace = true;
+ frame.columnStyle = "tvEpisodesFrame";
+ frame.viewMoreColumnStyle = "tvEpisodesViewMore";
+ var viewMoreInfo = this.viewMoreInfo;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ viewMoreInfo.voicePhrase = String.load(String.id.IDS_VIDEO2_TV_MORE_EXTRAS_BUTTON_VUI_ALM);
+ viewMoreInfo.voicePhoneticPhrase = String.load(String.id.IDS_VIDEO2_TV_MORE_EXTRAS_BUTTON_VUI_PRON);
+ viewMoreInfo.voiceConfidence = String.load(String.id.IDS_VIDEO2_TV_MORE_EXTRAS_BUTTON_VUI_CONF)
+ }
+ frame.viewMoreInfo = viewMoreInfo;
+ frame.visibleSignal = visibleSignal;
+ frame.getData = function frameGetData() {
+ var dataContext = {};
+ dataContext.frame = frame;
+ dataContext.tvImmersiveViewModel = this;
+ dataContext.maxItems = MS.Entertainment.Utilities.isVideoApp1 ? 0 : 5;
+ dataContext.previousSignal = previousSignal;
+ dataContext.visibleSignal = visibleSignal;
+ frame.viewMoreSubHeading = MS.Entertainment.Utilities.isVideoApp2 ? this.secondaryText : null;
+ return WinJS.Promise.wrap(dataContext)
+ }.bind(this);
+ return WinJS.Promise.wrap(frame)
+ }, _mediaRightChanged: function _mediaRightChanged(serviceMediaId) {
+ if (this._unloaded)
+ return;
+ MS.Entertainment.ViewModels.SmartBuyStateEngine.mediaContainsServiceMediaIdAsync(this.season, serviceMediaId).done(function mediaContainsServiceMediaIdAsync_complete(containsServiceId) {
+ if (containsServiceId && this.season.seasonNumber) {
+ if (this._refreshEpisodePromise) {
+ this._refreshEpisodePromise.cancel();
+ this._refreshEpisodePromise = null
+ }
+ this._refreshEpisodePromise = WinJS.Promise.timeout(1000).done(function refreshNextEpisode() {
+ return this.findNextEpisode(this.season)
+ }.bind(this))
+ }
+ }.bind(this))
+ }, getLibraryEpisodes: function getLibraryEpisodes() {
+ if (!this.series)
+ return WinJS.Promise.wrap(null);
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(this.series).then(function hydratedLibraryInfo() {
+ if (!this.series || this.series.libraryId === -1)
+ return WinJS.Promise.wrap(null);
+ var query = new MS.Entertainment.Data.Query.libraryVideoTV;
+ query.seriesId = this.series.libraryId;
+ query.sort = Microsoft.Entertainment.Queries.VideosSortBy.seriesTitleSeasonNumberEpisodeNumber;
+ query.isLive = false;
+ query.chunkSize = 1000;
+ return query.execute().then(function queryComplete(q) {
+ if (q && q.result && q.result.items)
+ return WinJS.Promise.wrap(q.result.items)
+ }.bind(this), function queryFailed(q) {
+ return WinJS.Promise.wrap(null)
+ })
+ }.bind(this))
+ }, getLastWatchedBookmark: function getLastWatchedBookmark(isBackNavigate) {
+ if (!this.series || this.series.libraryId === undefined || this.series.libraryId === -1)
+ return WinJS.Promise.wrap(null);
+ var queryDelay = isBackNavigate ? 1000 : 0;
+ var findSeriesZuneIdPromise = WinJS.Promise.wrap(this.series.zuneId);
+ if (!this.series.hasZuneId && this.series.librarySeasons)
+ findSeriesZuneIdPromise = this.series.librarySeasons.itemsFromIndex(0).then(function scanLibrarySeasons(sortedLibrarySeasons) {
+ for (var x = 0; x < sortedLibrarySeasons.items.length; x++)
+ if (!MS.Entertainment.Utilities.isEmptyGuid(sortedLibrarySeasons.items[x].data.seriesZuneId))
+ return WinJS.Promise.wrap(sortedLibrarySeasons.items[x].data.seriesZuneId)
+ }.bind(this));
+ return WinJS.Promise.timeout(queryDelay).then(function waitDelay() {
+ return findSeriesZuneIdPromise.then(function foundZuneId(zuneId) {
+ if (MS.Entertainment.Utilities.isEmptyGuid(zuneId))
+ return WinJS.Promise.wrap(null);
+ var ms = new Microsoft.Entertainment.Platform.MediaStore;
+ return ms.videoProvider.getLastWatchedEpisodeForSeriesAsync(zuneId).then(function checkBookmark(bookmark) {
+ if (bookmark && bookmark.tvEpisodeId >= 0)
+ return WinJS.Promise.wrap(bookmark);
+ else
+ return WinJS.Promise.wrap(null)
+ }, function bookmarkNotFound(bookmark) {
+ return WinJS.Promise.wrap(null)
+ })
+ })
+ }.bind(this))
+ }, updateAppBar: function updateAppBar(newValue, oldValue) {
+ var combinedAppBarActions = [];
+ if (this.season && this.seasonSmartBuyStateEngine && this.seasonSmartBuyStateEngine.currentAppbarActions)
+ combinedAppBarActions = combinedAppBarActions.concat(this.seasonSmartBuyStateEngine.currentAppbarActions);
+ if (this.season && this.season.episode && this.episodeSmartBuyStateEngine && this.episodeSmartBuyStateEngine.currentAppbarActions)
+ combinedAppBarActions = combinedAppBarActions.concat(this.episodeSmartBuyStateEngine.currentAppbarActions);
+ if (this._mediaContext)
+ this._mediaContext.setToolbarActions(combinedAppBarActions);
+ if (!this._firedNavigationComplete) {
+ if (this.navigationCompleteCallback)
+ this.navigationCompleteCallback(true);
+ this._firedNavigationComplete = true
+ }
+ }, setupAppBarBindings: function setupAppBarBindings() {
+ if (this._appBarBindings)
+ this._appBarBindings.cancel();
+ if (this.episodeSmartBuyStateEngine)
+ this._appBarBindings = WinJS.Binding.bind(this.episodeSmartBuyStateEngine, {currentAppbarActions: this.updateAppBar.bind(this)});
+ if (this.seasonSmartBuyStateEngine)
+ this._appBarBindings = WinJS.Binding.bind(this.seasonSmartBuyStateEngine, {currentAppbarActions: this.updateAppBar.bind(this)})
+ }, dispose: function dispose() {
+ this.clearSessionBindings();
+ this.removeOtherMediaClasses(true);
+ if (this._appBarBindings) {
+ this._appBarBindings.cancel();
+ this._appBarBindings = null
+ }
+ if (this._navigationEventHandlers) {
+ this._navigationEventHandlers.cancel();
+ this._navigationEventHandlers = null
+ }
+ if (this._mediaRightChangedBindingMethod) {
+ Microsoft.Entertainment.Marketplace.Marketplace.removeEventListener("mediarightchanged", this._mediaRightChangedBindingMethod);
+ this._mediaRightChangedBindingMethod = null
+ }
+ if (this._mediaDeletedBindingMethod) {
+ this._mediaDeletedBindingMethod.cancel();
+ this._mediaDeletedBindingMethod = null
+ }
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ if (this.episodeSmartBuyStateEngine) {
+ this.episodeSmartBuyStateEngine.unload();
+ this.episodeSmartBuyStateEngine = null
+ }
+ if (this.seasonSmartBuyStateEngine) {
+ this.seasonSmartBuyStateEngine.unload();
+ this.seasonSmartBuyStateEngine = null
+ }
+ if (this.seriesSmartBuyStateEngine) {
+ this.seriesSmartBuyStateEngine.unload();
+ this.seriesSmartBuyStateEngine = null
+ }
+ }, freeze: function tvImmersiveViewModel_freeze() {
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ this.removeOtherMediaClasses(true)
+ }, thaw: function tvImmersiveViewModel_thaw() {
+ this.addMediaClassToImmersiveDetails();
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._mediaContext = appBarService.pushMediaContext(this.season, null, null, {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.canvas});
+ this.updateAppBar()
+ }, setEpisode: function setEpisode(episode) {
+ if (!this.episode || !this.episode.isEqual(episode)) {
+ this.episode = episode;
+ if (this.season && (!this.season.episode || !this.season.episode.isEqual(episode)))
+ this.season.episode = (this.episode && this.season.seasonNumber === this.episode.seasonNumber) ? this.episode : null;
+ if (this.episode)
+ if (!this.episode.contentNotifications)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(this.episode, "contentNotifications", new MS.Entertainment.UI.ContentNotification.ObservableNotificationArray);
+ else
+ this.episode.contentNotifications.clear();
+ if (this.episodeSmartBuyStateEngine) {
+ this.episodeSmartBuyStateEngine.unload();
+ this.episodeSmartBuyStateEngine = null
+ }
+ var hydratePromise = WinJS.Promise.wrap();
+ if (this.season && this.season.episode && this.season.episode.hydrate)
+ hydratePromise = this.season.episode.hydrate();
+ hydratePromise.done(function hydratedEpisode() {
+ this.episodeSmartBuyStateEngine = new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine;
+ this.episodeSmartBuyStateEngine.purchaseOptions = this._getPurchaseOptions();
+ var episodeButtons = MS.Entertainment.ViewModels.SmartBuyButtons.getWatchNextEpisodeButtons(this.episode, MS.Entertainment.UI.Actions.ExecutionLocation.canvas);
+ this.episodeSmartBuyStateEngine.initialize(this.episode, episodeButtons, MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onWatchNextStateChanged);
+ this.setupAppBarBindings()
+ }.bind(this))
+ }
+ }, _getPurchaseOptions: function _getPurchaseOptions() {
+ if (!this._purchaseOptions)
+ this._purchaseOptions = new MS.Entertainment.ViewModels.PurchaseOptions;
+ return this._purchaseOptions
+ }, _shareMediaItem: function _shareMediaItem(mediaItem) {
+ var sender = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ if (sender) {
+ if (this._shareOperation) {
+ this._shareOperation.cancel();
+ this._shareOperation = null
+ }
+ this._shareOperation = sender.pendingShare(mediaItem)
+ }
+ }, setSeason: function setSeason(season) {
+ if (!season || season.mediaType !== Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ return;
+ if (!this.season || (season && !season.isEqual(this.season))) {
+ this.primaryText = season.seriesTitle || String.empty;
+ this.secondaryText = MS.Entertainment.Formatters.formatTVSeasonNumberInt(season.seasonNumber, true) || String.empty;
+ this.season = season;
+ this.season.addProperty("episode", null);
+ this.season.seriesLibraryId = this.series.libraryId;
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ if (!this.season)
+ this._mediaContext = appBarService.pushDefaultContext([]);
+ else
+ this._mediaContext = appBarService.pushMediaContext(this.season, null, null, {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.canvas});
+ if (this.season)
+ if (!this.season.contentNotifications)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(this.season, "contentNotifications", new MS.Entertainment.UI.ContentNotification.ObservableNotificationArray);
+ else
+ this.season.contentNotifications.clear();
+ if (this.seasonSmartBuyStateEngine) {
+ this.seasonSmartBuyStateEngine.unload();
+ this.seasonSmartBuyStateEngine = null
+ }
+ this.seasonSmartBuyStateEngine = new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine;
+ this.seasonSmartBuyStateEngine.purchaseOptions = this._getPurchaseOptions();
+ var seasonButtons = MS.Entertainment.ViewModels.SmartBuyButtons.getTVDetailsButtons(this.season, MS.Entertainment.UI.Actions.ExecutionLocation.canvas);
+ var onStateInfoRetrieved = function onStateInfoRetrieved(stateInfo) {
+ return MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onSeasonDetailsStateChanged.apply(this.seasonSmartBuyStateEngine, arguments).then(function onSeasonDetailsStateChanged(buttonState) {
+ if (this.seasonStateInfoCallback)
+ this.seasonStateInfoCallback(stateInfo);
+ this.seasonStateInfo = stateInfo;
+ return buttonState
+ }.bind(this))
+ }.bind(this);
+ this.seasonSmartBuyStateEngine.initialize(this.season, seasonButtons, onStateInfoRetrieved);
+ this.setupAppBarBindings();
+ this._shareMediaItem(this.season);
+ var subTitleElement = document.querySelector(MS.Entertainment.UI.Controls.ImmersiveTvHero.cssSelectors.immersiveSecondaryText);
+ if (subTitleElement)
+ WinJS.UI.Animation.fadeIn(subTitleElement)
+ }
+ if (this.season && (!this.season.episode || !this.season.episode.isEqual(this.episode)))
+ this.season.episode = (this.episode && this.season.seasonNumber === this.episode.seasonNumber) ? this.episode : null
+ }
+ }, {
+ series: null, episode: null, season: null, primaryText: String.empty, secondaryText: String.empty, backgroundImageUri: String.empty, episodeSmartBuyStateEngine: null, seasonSmartBuyStateEngine: null, seasonStateInfoCallback: null, seasonStateInfo: null, seriesSmartBuyStateEngine: null, libraryEpisodes: null
+ }, {Monikers: {
+ promoted: "promoted", seasons: "seasons", activities: "activities"
+ }})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/VideoCollectionTemplates.js b/packages/microsoft.zunevideo/ViewModels/Video/VideoCollectionTemplates.js
new file mode 100644
index 00000000..198c4b66
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/VideoCollectionTemplates.js
@@ -0,0 +1,50 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoCollectionTemplates: {
+ movies: {
+ dateAdded: {
+ template: "/Components/Video/VideoMarketplaceTemplates.html#moviePosterTileL2", panelTemplate: "MS.Entertainment.Pages.MovieInlineDetails", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection}, slotSize: {
+ width: 180, height: 245
+ }, itemSize: {
+ width: 180, height: 245
+ }, grouped: false
+ }, title: {
+ template: "/Components/Video/VideoMarketplaceTemplates.html#moviePosterTileL2", panelTemplate: "MS.Entertainment.Pages.MovieInlineDetails", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection}, slotSize: {
+ width: 180, height: 245
+ }, itemSize: {
+ width: 180, height: 245
+ }, grouped: false
+ }
+ }, tv: {
+ dateAdded: {
+ template: "/Components/Video/VideoMarketplaceTemplates.html#tvSeriesTileL2", panelTemplate: "MS.Entertainment.Pages.TvEpisodeInlineDetails", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection}, slotSize: {
+ width: 245, height: 245
+ }, itemSize: {
+ width: 245, height: 245
+ }, grouped: false
+ }, series: {
+ template: "/Components/Video/VideoMarketplaceTemplates.html#tvSeriesTileL2", galleryClass: "collectionTVSeasonSeriesPage", panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl(), panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection}, slotSize: {
+ width: 245, height: 245
+ }, itemSize: {
+ width: 245, height: 245
+ }, grouperKeyAsData: false, grouped: false, groupHeaderPosition: MS.Entertainment.UI.Controls.GalleryControl.HeaderPosition.left, grouperType: MS.Entertainment.UI.Controls.GalleryAlphaWordGrouper, grouperField: "name"
+ }
+ }, other: {
+ title: {
+ template: "/Components/Video/VideoStartupTemplates.html#personalFileTile", panelTemplate: "MS.Entertainment.Pages.OtherVideoInlineDetails", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection}, slotSize: {
+ width: 245, height: 245
+ }, itemSize: {
+ width: 245, height: 245
+ }, grouped: false
+ }, dateAdded: {
+ template: "/Components/Video/VideoStartupTemplates.html#personalFileTile", panelTemplate: "MS.Entertainment.Pages.OtherVideoInlineDetails", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection}, slotSize: {
+ width: 245, height: 245
+ }, itemSize: {
+ width: 245, height: 245
+ }, grouped: false
+ }
+ }
+ }})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/VideoCollectionViewModel.js b/packages/microsoft.zunevideo/ViewModels/Video/VideoCollectionViewModel.js
new file mode 100644
index 00000000..2fbd10ba
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/VideoCollectionViewModel.js
@@ -0,0 +1,305 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoCollectionQueryViewModelBaseMixIn: {
+ items: null, titleOverride: null, hideHubs: false, modifierSelectionManager: null
+ }});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoCollectionQueryViewModelBase: WinJS.Class.mix(function observableQuery() {
+ this._initObservable(Object.create(MS.Entertainment.ViewModels.VideoCollectionQueryViewModelBaseMixIn))
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin, WinJS.Binding.expandProperties(MS.Entertainment.ViewModels.VideoCollectionQueryViewModelBaseMixIn))});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoCollection: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.VideoCollectionQueryViewModelBase", function collectionConstructor(view, hub) {
+ MS.Entertainment.ViewModels.VideoCollectionQueryViewModelBase.prototype.constructor.call(this);
+ if (this.isValidView(view))
+ this.view = view;
+ this.hub = hub;
+ this.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(null, 0, this.settingsKey);
+ this.queryWatcher = new MS.Entertainment.Framework.QueryWatcher("videos");
+ this._updateNavigationHandler();
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var moviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ this._isMarketplaceEnabled = (moviesMarketplaceEnabled || tvMarketplaceEnabled)
+ }, {
+ hub: null, isDisposed: true, _isMarketplaceEnabled: false, _folderQuery: null, _requestQuery: null, _responseQuery: null, _folderStack: [], isCurrentQuery: function isCurrentQuery() {
+ return this._requestQuery === this._responseQuery
+ }, _view: null, view: {
+ get: function() {
+ return this._view
+ }, set: function(value) {
+ if (this._view !== value) {
+ this._view = value;
+ this._viewChanged()
+ }
+ }
+ }, settingsKey: {get: function() {
+ return "videoCollectionModifier-" + this.view
+ }}, _sort: null, sort: {
+ get: function() {
+ return this._sort
+ }, set: function(value) {
+ if (this._sort !== value) {
+ this._sort = value;
+ this._sortChanged()
+ }
+ }
+ }, tvSubType: "episodes", queryWatcher: null, beginQuery: function collectionBeginQuery() {
+ if (!this.sort)
+ return;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ var query;
+ var taskKeyGetter = null;
+ var notifier = null;
+ var titleOverride = null;
+ var hideHubs = false;
+ if (this.view === "tv")
+ query = new MS.Entertainment.ViewModels.VideoCollection.Queries[this.view][this.tvSubType];
+ else
+ query = new MS.Entertainment.ViewModels.VideoCollection.Queries[this.view];
+ query.category = MS.Entertainment.ViewModels.VideoCollection.Categories[this.view];
+ query.sort = MS.Entertainment.ViewModels.VideoCollection.Sorts[this.view]().types[this.sort];
+ query.chunkSize = 10;
+ query.queryId = MS.Entertainment.UI.Monikers.videoCollectionPanel;
+ if (MS.Entertainment.UI.FileTransferService)
+ switch (this.view) {
+ case MS.Entertainment.ViewModels.VideoCollection.ViewTypes.movies:
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("libraryId");
+ notifier = MS.Entertainment.UI.FileTransferNotifiers.genericFile;
+ break;
+ case MS.Entertainment.ViewModels.VideoCollection.ViewTypes.tv:
+ switch (this.tvSubType) {
+ case MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.episodes:
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("libraryId");
+ notifier = MS.Entertainment.UI.FileTransferNotifiers.genericFile;
+ break;
+ case MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.seasons:
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("seasonLibraryId");
+ notifier = MS.Entertainment.UI.FileTransferNotifiers.episodeCollection;
+ break;
+ case MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.series:
+ taskKeyGetter = MS.Entertainment.UI.FileTransferService.keyFromProperty("seriesLibraryId");
+ notifier = MS.Entertainment.UI.FileTransferNotifiers.episodeCollection;
+ break
+ }
+ break
+ }
+ if (taskKeyGetter) {
+ var notifications = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.ContentNotification.idFromProperty("libraryId"));
+ var sender = notifications.createSender();
+ notifications.modifyQuery(query)
+ }
+ query.isLive = true;
+ this.disposeQuery();
+ this._requestQuery = query;
+ this.queryWatcher.registerQuery(query);
+ var clearListTimeout = WinJS.Promise.timeout(500).then(function clearList() {
+ this._setItems(null)
+ }.bind(this));
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ if (this.hub && this.hub.title && this.modifierSelectionManager && this.modifierSelectionManager.selectedItem && this.modifierSelectionManager.selectedItem.label)
+ titleOverride = String.load(String.id.IDS_VIDEO_VIEW_BY_TITLE).format(this.hub.title, String.load(this.modifierSelectionManager.selectedItem.label));
+ if (this.view === MS.Entertainment.ViewModels.VideoCollection.ViewTypes.other) {
+ var folderQuery = new MS.Entertainment.Data.Query.LibraryFolders;
+ this.queryWatcher.registerQuery(folderQuery);
+ this._folderQuery = folderQuery;
+ if (this._folderStack.length > 0) {
+ this._overrideShellBackButton(true, MS.Entertainment.Shell.BackButton.ButtonMode.backButton);
+ var parentFolder = this._folderStack[this._folderStack.length - 1];
+ folderQuery.parentFolderId = parentFolder.folderId;
+ query.folderId = parentFolder.folderId;
+ titleOverride = parentFolder.name;
+ hideHubs = true
+ }
+ else {
+ this._overrideShellBackButton(this._isMarketplaceEnabled);
+ query.folderId = -1
+ }
+ folderQuery.chunkSize = 10000;
+ folderQuery.sort = (MS.Entertainment.ViewModels.VideoCollection.Sorts[this.view]().types[this.sort] === MS.Entertainment.ViewModels.VideoCollection.Sorts.other().types.dateAdded) ? Microsoft.Entertainment.Queries.FoldersSortBy.dateModifiedDescending : Microsoft.Entertainment.Queries.FoldersSortBy.titleAscending;
+ this._responseQuery = query;
+ folderQuery.execute().then(function(folderResults) {
+ query.getItems().then(function(videoResults) {
+ clearListTimeout.cancel();
+ clearListTimeout = null;
+ this._responseQuery = query;
+ if (videoResults && videoResults.insertRangeAtStart && folderResults && folderResults.result && folderResults.result.itemsArray && folderResults.result.itemsArray.length > 0)
+ videoResults.insertRangeAtStart(folderResults.result.itemsArray);
+ this._setItems(videoResults);
+ eventProvider.traceNavigable_Loading_Done("videos")
+ }.bind(this))
+ }.bind(this))
+ }
+ else
+ query.execute().then(function(q) {
+ clearListTimeout.cancel();
+ this._responseQuery = query;
+ this._setItems(q.result.items);
+ if (taskKeyGetter) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener("videoCollection", taskKeyGetter, sender, notifier)
+ }
+ eventProvider.traceNavigable_Loading_Done("videos")
+ }.bind(this), function(q) {
+ MS.Entertainment.ViewModels.fail("VideoCollectionViewModel_beginQuery failed while retrieving videos from the database.")
+ });
+ this.titleOverride = titleOverride;
+ this.hideHubs = hideHubs;
+ if (this.view !== MS.Entertainment.ViewModels.VideoCollection.ViewTypes.other) {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ purchaseHistoryService.grovel(false, false, true)
+ }
+ }, _overrideShellBackButton: function _overrideShellBackButton(alwaysShow, backButtonMode) {
+ var backButtonService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.backButton);
+ if (backButtonService) {
+ backButtonService.overrideShowBackButton = alwaysShow;
+ backButtonService.overrideBackButtonMode = backButtonMode
+ }
+ }, _setItems: function _setItems(items) {
+ if (this.items !== items) {
+ var oldValue = this.items;
+ this.items = items;
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoCollection.events.itemsChanged, {
+ sender: this, newValue: this.items, oldValue: oldValue
+ })
+ }
+ }, _viewChanged: function collectionViewChanged() {
+ try {
+ Windows.Storage.ApplicationData.current.localSettings.values["VideoCollectionView"] = this.view
+ }
+ catch(e) {}
+ }, _sortChanged: function collectionSortChanged() {
+ if (this.view === MS.Entertainment.ViewModels.VideoCollection.ViewTypes.tv)
+ switch (this.sort) {
+ case MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.seasons:
+ this.tvSubType = MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.seasons;
+ break;
+ case MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.episodes:
+ this.tvSubType = MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.episodes;
+ break;
+ default:
+ this.tvSubType = MS.Entertainment.ViewModels.VideoCollection.SubViewTypes.series;
+ break
+ }
+ }, _updateNavigationHandler: function _updateNavigationHandler() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ page.onNavigateTo = function() {
+ this._overrideShellBackButton(true)
+ }.bind(this);
+ var oldNavigateAway = page.onNavigateAway || function(){};
+ page.onNavigateAway = function() {
+ var currentHub = WinJS.Binding.unwrap(navigationService.currentHub);
+ if (currentHub && currentHub.iaNode && currentHub.iaNode.moniker === MS.Entertainment.UI.Monikers.otherVideoCollection) {
+ if (navigationService.navigationDirection === MS.Entertainment.Navigation.NavigationDirection.forward) {
+ oldNavigateAway();
+ if (this._isMarketplaceEnabled)
+ this._overrideShellBackButton(false);
+ return false
+ }
+ if (navigationService.navigationDirection === MS.Entertainment.Navigation.NavigationDirection.backward) {
+ var canOpenParentFolder = (this._folderStack && this._folderStack.length > 0);
+ if (canOpenParentFolder) {
+ this._overrideShellBackButton(true);
+ this._folderStack.pop();
+ this.beginQuery();
+ return true
+ }
+ else {
+ page.onNavigateAway = oldNavigateAway;
+ this._overrideShellBackButton(false);
+ oldNavigateAway();
+ return false
+ }
+ }
+ }
+ this._overrideShellBackButton(false)
+ }.bind(this)
+ }, isValidView: function isValidView(view) {
+ return (view in MS.Entertainment.ViewModels.VideoCollection.ViewTypes)
+ }, resetDefaults: function resetDefaults() {
+ for (var view in MS.Entertainment.ViewModels.VideoCollection.ViewTypes)
+ try {
+ delete Windows.Storage.ApplicationData.current.localSettings.values["CollectionFilter-" + view]
+ }
+ catch(e) {}
+ }, openFolder: function openFolder(folder) {
+ if (folder.folderId >= 0) {
+ this._folderStack.push(folder);
+ this.beginQuery()
+ }
+ }, getQuery: function getQuery() {
+ return this._requestQuery
+ }, dispose: function dispose() {
+ this.disposeQuery();
+ this.isDisposed = true
+ }, disposeQuery: function disposeQuery() {
+ if (this._folderQuery && this._folderQuery.dispose) {
+ this._folderQuery.dispose();
+ this._folderQuery = null
+ }
+ if (this._requestQuery && this._requestQuery.dispose) {
+ this._requestQuery.dispose();
+ this._requestQuery = null
+ }
+ var fileTransferService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ if (fileTransferService)
+ fileTransferService.unregisterListener("videoCollection")
+ }
+ }, {
+ ViewTypes: {
+ movies: "movies", tv: "tv", other: "other"
+ }, SubViewTypes: {
+ episodes: "episodes", seasons: "seasons", series: "series"
+ }, Categories: {get: function categories_get() {
+ return {
+ movies: Microsoft.Entertainment.Queries.VideoType.movie, tv: Microsoft.Entertainment.Queries.VideoType.tvEpisode, other: Microsoft.Entertainment.Queries.VideoType.other
+ }
+ }}, Sorts: {
+ movies: function sorts_movies_get() {
+ return {
+ values: ["mostRecent", "dateAdded", "title"], mostRecent: {
+ value: "mostRecent", title: String.id.IDS_VIDEO2_SORTS_MOST_RECENT_VUI_GUI
+ }, dateAdded: {
+ value: "dateAdded", title: String.id.IDS_VIDEO_COLLECTION_DATEADDED_SORT_2
+ }, title: {
+ value: "title", title: String.id.IDS_VIDEO_COLLECTION_ALPHA_SORT_2
+ }, types: {
+ mostRecent: Microsoft.Entertainment.Queries.VideosSortBy.dateAddedOrLastPlayingDescending, dateAdded: Microsoft.Entertainment.Queries.VideosSortBy.dateAddedDescending, title: Microsoft.Entertainment.Queries.VideosSortBy.titleAscending
+ }
+ }
+ }, tv: function sorts_tv_get() {
+ return {
+ values: ["mostRecent", "dateAdded", "series"], mostRecent: {
+ value: "mostRecent", title: String.id.IDS_VIDEO2_SORTS_MOST_RECENT_VUI_GUI
+ }, dateAdded: {
+ value: "dateAdded", title: String.id.IDS_VIDEO_COLLECTION_DATEADDED_SORT_2
+ }, series: {
+ value: "series", title: String.id.IDS_VIDEO_COLLECTION_ALPHA_SORT_2
+ }, types: {
+ mostRecent: Microsoft.Entertainment.Queries.TVSeriesSortBy.latestActivityDescending, dateAdded: Microsoft.Entertainment.Queries.TVSeriesSortBy.dateLastEpisodeAddedDescending, series: Microsoft.Entertainment.Queries.TVSeriesSortBy.titleAscending
+ }
+ }
+ }, other: function sorts_other_get() {
+ return {
+ values: ["dateAdded", "title"], dateAdded: {
+ value: "dateAdded", title: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_VIDEO_COLLECTION_DATEADDED_SORT : String.id.IDS_VIDEO_COLLECTION_DATEADDED_SORT_2
+ }, title: {
+ value: "title", title: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_VIDEO_COLLECTION_ALPHA_SORT : String.id.IDS_VIDEO_COLLECTION_ALPHA_SORT_2
+ }, types: {
+ dateAdded: Microsoft.Entertainment.Queries.VideosSortBy.dateAddedDescending, title: Microsoft.Entertainment.Queries.VideosSortBy.titleAscending
+ }
+ }
+ }
+ }, Queries: {get: function queries_get() {
+ return {
+ movies: MS.Entertainment.Data.Query.libraryVideoMovies, tv: {
+ episodes: MS.Entertainment.Data.Query.libraryVideoTV, seasons: MS.Entertainment.Data.Query.libraryTVSeasons, series: MS.Entertainment.Data.Query.libraryTVSeries
+ }, other: MS.Entertainment.Data.Query.LibraryVideoFolder
+ }
+ }}, Templates: {get: function templates_get() {
+ return MS.Entertainment.ViewModels.VideoCollectionTemplates
+ }}, events: {
+ itemsChanged: "itemsChanged", modelActionsChanged: "modelActionsChanged"
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/VideoHubCollectionPanel.js b/packages/microsoft.zunevideo/ViewModels/Video/VideoHubCollectionPanel.js
new file mode 100644
index 00000000..cfd53fe5
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/VideoHubCollectionPanel.js
@@ -0,0 +1,215 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoHubSharedData: MS.Entertainment.defineOptionalObservable(function() {
+ this._setupBindings()
+ }, {
+ _localBindings: null, _signInBinding: null, _grovelingBinding: null, _delayRefreshPromise: null, _grovelTimeLimitPromise: null, _minMovies: 6, _minTv: 4, _setupBindings: function _setupBindings() {
+ if (this._localBindings) {
+ this._localBindings.cancel();
+ this._localBindings = null
+ }
+ if (this._signInBinding) {
+ this._signInBinding.cancel();
+ this._signInBinding = null
+ }
+ if (this._grovelingBinding) {
+ this._grovelingBinding.cancel();
+ this._grovelingBinding = null
+ }
+ var videoCountsChanged = this._videoCountsChanged.bind(this);
+ var onSignInChange = this._onSignInChange.bind(this);
+ this._localBindings = WinJS.Binding.bind(this, {
+ tvCount: videoCountsChanged, movieCount: videoCountsChanged, isSignedIn: onSignInChange
+ });
+ var appSignIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signInBinding = WinJS.Binding.bind(appSignIn, {
+ isSignedIn: onSignInChange, isApp2UserAvailable: onSignInChange, isSigningIn: this._onSigningInChange.bind(this)
+ });
+ var purchaseService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ this._grovelingBinding = WinJS.Binding.bind(purchaseService, {isGroveling: this._onIsGrovelingChanged.bind(this)})
+ }, unload: function unload() {
+ if (this._localBindings) {
+ this._localBindings.cancel();
+ this._localBindings = null
+ }
+ if (this._signInBinding) {
+ this._signInBinding.cancel();
+ this._signInBinding = null
+ }
+ if (this._grovelingBinding) {
+ this._grovelingBinding.cancel();
+ this._grovelingBinding = null
+ }
+ }, _onSigningInChange: function _onSigningInChange(isSigningIn) {
+ this.isSigningIn = isSigningIn;
+ this._updateState()
+ }, _onSignInChange: function _onSignInChange(isSignedIn) {
+ this.isSignedIn = isSignedIn;
+ this._updateState()
+ }, _onIsGrovelingChanged: function _onIsGrovelingChanged(isGrovelling) {
+ this.isGrovelling = isGrovelling;
+ if (this._grovelTimeLimitPromise) {
+ this._grovelTimeLimitPromise.cancel();
+ this._grovelTimeLimitPromise = null
+ }
+ if (this.isGrovelling)
+ this._grovelTimeLimitPromise = WinJS.Promise.timeout(60000).then(function showLibraryContent() {
+ if (this.isGrovelling) {
+ this.hasGrovelledTooLong = true;
+ this._updateState()
+ }
+ }.bind(this));
+ this._updateState()
+ }, _videoCountsChanged: function videoCountsChanged() {
+ this._updateState()
+ }, _updateState: function _updateState() {
+ if (this._delayRefreshPromise) {
+ this._delayRefreshPromise.cancel();
+ this._delayRefreshPromise = null
+ }
+ this._delayRefreshPromise = WinJS.Promise.timeout(250).then(function delayRefresh() {
+ var isQuerying = (this.movieCount === -1 || this.tvCount === -1);
+ var isGrovelling = (this.isGrovelling && !this.hasGrovelledTooLong);
+ var hasMovies = (!isGrovelling && this.movieCount > 0) || (this.movieCount >= this._minMovies);
+ var hasTv = (!isGrovelling && this.tvCount > 0) || (this.tvCount >= this._minTv);
+ if (this.isSignedIn && !isQuerying) {
+ this.isQuerying = isQuerying;
+ this.showMovieCollection = hasMovies;
+ this.showTvCollection = hasTv;
+ this.showEmptyMessage = (!this.showMovieCollection && !this.showTvCollection)
+ }
+ else {
+ this.showMovieCollection = false;
+ this.showTvCollection = false;
+ this.showEmptyMessage = true
+ }
+ }.bind(this))
+ }
+ }, {
+ tvCount: -1, movieCount: -1, showEmptyMessage: false, showMovieCollection: false, showTvCollection: false, isQuerying: true, isSigningIn: false, isSignedIn: false, isGrovelling: false, hasGrovelledTooLong: false
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoHubCollectionPanelBase: MS.Entertainment.UI.Framework.define(function() {
+ if (this.videoQuery) {
+ this.videoQuery.chunkSize = 12;
+ this.videoQuery.queryId = MS.Entertainment.UI.Monikers.videoCollectionPanel
+ }
+ if (this.browseAction) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var browseAction = actionService.getAction(this.browseAction);
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ browseAction.title = String.load(String.id.IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK);
+ browseAction.icon = MS.Entertainment.UI.Icon.genericVideo
+ }
+ this.panelAction = {action: browseAction};
+ if (this.voicePhraseStringId)
+ this.panelAction.voicePhrase = String.load(this.voicePhraseStringId);
+ if (this.voicePhoneticPhraseStringId)
+ this.panelAction.voicePhoneticPhrase = String.load(this.voicePhoneticPhraseStringId);
+ if (this.voiceConfidenceStringId)
+ this.panelAction.voiceConfidence = String.load(this.voiceConfidenceStringId)
+ }
+ this.emptyLibraryModel = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ this.emptyLibraryModel.primaryStringId = this.emptyPrimaryStringId;
+ if (MS.Entertainment.Utilities.isApp2)
+ this.emptyLibraryModel.secondaryStringId = this.emptySecondaryStringId;
+ if (this.hasEmptyDetails)
+ this.emptyLibraryModel.details = this._getEmptyCollectionDetails()
+ }, {
+ hasEmptyDetails: false, browseAction: null, videoQuery: null, panelAction: null, emptyLibraryModel: null, doNotRaisePanelReady: true, _uiStateEventHandler: null, emptyPrimaryStringId: null, emptySecondaryStringId: null, libraryClicked: WinJS.Utilities.markSupportedForProcessing(function libraryClicked(item) {
+ if (this._uiStateEventHandler) {
+ this._uiStateEventHandler.cancel();
+ this._uiStateEventHandler = null
+ }
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.stageThreeActivated)
+ return MS.Entertainment.ViewModels.VideoHubCollectionPanelBase.libraryClickedInt(item);
+ else
+ this._uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(uiStateService, {stageThreeActivatedChanged: function stageThreeActivatedChanged(activateEvent) {
+ if (activateEvent.detail.newValue)
+ MS.Entertainment.ViewModels.VideoHubCollectionPanelBase.libraryClickedInt(item)
+ }.bind(this)})
+ }), _getEmptyCollectionDetails: function _getEmptyCollectionDetails() {
+ var details = null;
+ if (MS.Entertainment.Utilities.isApp1) {
+ var isStorageLibrarySupported = WinJS.Utilities.getMember("Windows.Storage.StorageLibrary") ? true : false;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var openFileAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.openFile);
+ var onManageFoldersAction = isStorageLibrarySupported ? actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.manageFolders) : null;
+ var onMoreAboutLibrariesAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ onMoreAboutLibrariesAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppMoreAboutLibraries;
+ onMoreAboutLibrariesAction.parameter = {
+ uri: MS.Entertainment.UI.FWLink.videoLibraries, appendSource: false
+ };
+ details = [{
+ stringId: String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2, linkStringId: isStorageLibrarySupported ? String.id.IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK : String.id.IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK, linkAction: isStorageLibrarySupported ? onManageFoldersAction : onMoreAboutLibrariesAction, linkIcon: MS.Entertainment.UI.Icon.search
+ }, {
+ stringId: String.id.IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE, linkStringId: String.id.IDS_COLLECTION_OPEN_FILES_LINK, linkAction: openFileAction, linkIcon: WinJS.UI.AppBarIcon.folder
+ }]
+ }
+ return details
+ }
+ }, {
+ hideHubs: true, libraryClickedInt: function libraryClickedInt(item) {
+ var mediaItem = item.target;
+ if (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && (mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.other || mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo)) {
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.PlayCommand);
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayNonProtectedInApp();
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersiveDetails(mediaItem, false, true)
+ }
+ else {
+ var popOverConstructor = null;
+ if (mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries)
+ popOverConstructor = MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl();
+ else if (mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ popOverConstructor = "MS.Entertainment.Pages.MovieInlineDetails";
+ var popOverParameters = {itemConstructor: popOverConstructor};
+ popOverParameters.dataContext = {
+ data: mediaItem, location: MS.Entertainment.Data.ItemLocation.collection
+ };
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails(popOverParameters)
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {MovieHubCollectionPanel: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.VideoHubCollectionPanelBase", function videoHubCollectionPanelConstructor() {
+ this.videoQuery.sort = Microsoft.Entertainment.Queries.VideosSortBy.dateAddedDescending;
+ MS.Entertainment.ViewModels.VideoHubCollectionPanelBase.prototype.constructor.call(this)
+ }, {
+ emptyPrimaryStringId: String.id.IDS_COLLECTION_MOVIE_EMPTY, emptySecondaryStringId: String.id.IDS_VIDEO_COLLECTION_EMPTY, browseAction: MS.Entertainment.UI.Actions.ActionIdentifiers.videoCollectionMovieNavigate, _videoQuery: null, videoQuery: {get: function videoquery_get() {
+ if (!this._videoQuery)
+ this._videoQuery = new MS.Entertainment.Data.Query.libraryVideoMovies;
+ return this._videoQuery
+ }}, itemsColumns: 2, hidePanelWhenEmpty: true
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {Video2MovieHubCollectionPanel: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.MovieHubCollectionPanel", function videoHubCollectionPanelConstructor() {
+ MS.Entertainment.ViewModels.MovieHubCollectionPanel.prototype.constructor.call(this)
+ }, {
+ itemsColumns: 3, hidePanelWhenEmpty: false, voicePhraseStringId: String.id.IDS_VIDEO2_L1_MORE_MOVIES_BUTTON_VUI_ALM, voicePhoneticPhraseStringId: String.id.IDS_VIDEO2_L1_MORE_MOVIES_BUTTON_VUI_PRON, voiceConfidenceStringId: String.id.IDS_VIDEO2_L1_MORE_MOVIES_BUTTON_VUI_CONF
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {TvHubCollectionPanel: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.VideoHubCollectionPanelBase", function TvHubCollectionPanel() {
+ this.videoQuery.sort = Microsoft.Entertainment.Queries.TVSeriesSortBy.dateLastEpisodeAddedDescending;
+ MS.Entertainment.ViewModels.VideoHubCollectionPanelBase.prototype.constructor.call(this)
+ }, {
+ emptyPrimaryStringId: String.id.IDS_COLLECTION_TV_EMPTY, emptySecondaryStringId: String.id.IDS_VIDEO_COLLECTION_EMPTY, browseAction: MS.Entertainment.UI.Actions.ActionIdentifiers.videoCollectionTvNavigate, _videoQuery: null, videoQuery: {get: function videoquery_get() {
+ if (!this._videoQuery)
+ this._videoQuery = new MS.Entertainment.Data.Query.libraryTVSeries;
+ return this._videoQuery
+ }}, itemsColumns: 2, hidePanelWhenEmpty: true
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {Video2TvHubCollectionPanel: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.TvHubCollectionPanel", function Video2TvHubCollectionPanel() {
+ MS.Entertainment.ViewModels.TvHubCollectionPanel.prototype.constructor.call(this)
+ }, {
+ itemsColumns: 2, hidePanelWhenEmpty: false, voicePhraseStringId: String.id.IDS_VIDEO2_L1_MORE_TV_BUTTON_VUI_ALM, voicePhoneticPhraseStringId: String.id.IDS_VIDEO2_L1_MORE_TV_BUTTON_VUI_PRON, voiceConfidenceStringId: String.id.IDS_VIDEO2_L1_MORE_TV_BUTTON_VUI_CONF
+ })});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {OtherHubCollectionPanel: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.VideoHubCollectionPanelBase", function videoHubCollectionPanelConstructor() {
+ this.videoQuery.sort = Microsoft.Entertainment.Queries.VideosSortBy.dateAddedDescending;
+ MS.Entertainment.ViewModels.VideoHubCollectionPanelBase.prototype.constructor.call(this)
+ }, {
+ emptyPrimaryStringId: String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY, emptySecondaryStringId: String.id.IDS_VIDEO_COLLECTION_EMPTY, browseAction: MS.Entertainment.UI.Actions.ActionIdentifiers.videoCollectionOtherNavigate, _videoQuery: null, videoQuery: {get: function videoquery_get() {
+ if (!this._videoQuery)
+ this._videoQuery = new MS.Entertainment.Data.Query.libraryVideoOther;
+ return this._videoQuery
+ }}, itemsColumns: 2, hidePanelWhenEmpty: false, hasEmptyDetails: true
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/VideoMarketplaceTemplates.js b/packages/microsoft.zunevideo/ViewModels/Video/VideoMarketplaceTemplates.js
new file mode 100644
index 00000000..5a3dfa1f
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/VideoMarketplaceTemplates.js
@@ -0,0 +1,65 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoGalleryColors: {backdropColor: "#222222"}});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoMarketplaceTemplates: {
+ movie: {
+ templateUrl: "/Components/Video/VideoMarketplaceTemplates.html#moviePosterTileL2", actionTemplateUrl: "/Components/Video/VideoMarketplaceTemplates.html#horizontalActionTemplate", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace}, slotSize: {
+ width: 180, height: 245
+ }, itemSize: {
+ width: 180, height: 245
+ }, mediaType: "video", emptyGalleryTemplate: "/Controls/GalleryControl.html#listViewEmptySearchGalleryTemplate", allowEmpty: false, grouped: false, backdropColor: MS.Entertainment.ViewModels.VideoGalleryColors.backdropColor, panelTemplateTypeMappings: [{
+ key: "mediaType", value: Microsoft.Entertainment.Queries.ObjectType.tvSeason, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "mediaType", value: Microsoft.Entertainment.Queries.ObjectType.tvSeries, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.movie, panelTemplate: "MS.Entertainment.Pages.MovieInlineDetails"
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.tvEpisode, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.other, panelTemplate: "MS.Entertainment.Pages.OtherVideoInlineDetails"
+ }]
+ }, tvSeries: {
+ templateUrl: "/Components/Video/VideoMarketplaceTemplates.html#tvSeriesTileL2", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace}, slotSize: {
+ width: 245, height: 245
+ }, itemSize: {
+ width: 245, height: 245
+ }, mediaType: "video", emptyGalleryTemplate: "/Controls/GalleryControl.html#listViewEmptySearchGalleryTemplate", allowEmpty: false, grouped: false, backdropColor: MS.Entertainment.ViewModels.VideoGalleryColors.backdropColor, panelTemplateTypeMappings: [{
+ key: "mediaType", value: Microsoft.Entertainment.Queries.ObjectType.tvSeason, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "mediaType", value: Microsoft.Entertainment.Queries.ObjectType.tvSeries, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.movie, panelTemplate: "MS.Entertainment.Pages.MovieInlineDetails"
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.tvEpisode, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.other, panelTemplate: "MS.Entertainment.Pages.OtherVideoInlineDetails"
+ }]
+ }, tvSeason: {
+ templateUrl: "/Components/Video/VideoMarketplaceTemplates.html#tvSeriesTileL2", panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace}, slotSize: {
+ width: 245, height: 245
+ }, itemSize: {
+ width: 245, height: 245
+ }, mediaType: "video", emptyGalleryTemplate: "/Controls/GalleryControl.html#listViewEmptySearchGalleryTemplate", allowEmpty: false, grouped: false, backdropColor: MS.Entertainment.ViewModels.VideoGalleryColors.backdropColor, panelTemplateTypeMappings: [{
+ key: "mediaType", value: Microsoft.Entertainment.Queries.ObjectType.tvSeason, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "mediaType", value: Microsoft.Entertainment.Queries.ObjectType.tvSeries, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.movie, panelTemplate: "MS.Entertainment.Pages.MovieInlineDetails"
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.tvEpisode, panelTemplate: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ }, {
+ key: "videoType", value: Microsoft.Entertainment.Queries.VideoType.other, panelTemplate: "MS.Entertainment.Pages.OtherVideoInlineDetails"
+ }]
+ }, flexHub: {
+ panelOptions: {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace}, slotSize: {
+ width: 295, height: 165
+ }, itemSize: {
+ width: 295, height: 165
+ }, mediaType: "video", grouped: false, multiSize: true, itemMargin: {
+ top: 4, bottom: 4
+ }, backdropColor: MS.Entertainment.ViewModels.VideoGalleryColors.backdropColor, maxRows: MS.Entertainment.Utilities.getLegacyVideoRowCountForResolution()
+ }
+ }})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/VideoMarketplaceViewModel.js b/packages/microsoft.zunevideo/ViewModels/Video/VideoMarketplaceViewModel.js
new file mode 100644
index 00000000..16a57a84
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/VideoMarketplaceViewModel.js
@@ -0,0 +1,1341 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoMarketplaceQueryViewModelBaseMixIn: {
+ items: null, modifierSelectionManager: null, secondaryModifierSelectionManager: null, modelActions: null, isFailed: false, isLoading: false, failedGalleryModel: null, galleryImageUrl: null, titleOverride: null, subTitleOverride: null, heroImageUrl: null, heroPrimaryText: String.empty, heroSecondaryText: String.empty, hideHubs: false, largeItemIndex: -1
+ }});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoMarketplaceQueryViewModelBase: WinJS.Class.mix(function observableQuery() {
+ this._initObservable(Object.create(MS.Entertainment.ViewModels.VideoMarketplaceQueryViewModelBaseMixIn))
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin, WinJS.Binding.expandProperties(MS.Entertainment.ViewModels.VideoMarketplaceQueryViewModelBaseMixIn))});
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoMarketplace: MS.Entertainment.UI.Framework.derive("MS.Entertainment.ViewModels.VideoMarketplaceQueryViewModelBase", function videoMarketplaceConstructor(view, hub) {
+ MS.Entertainment.ViewModels.VideoMarketplaceQueryViewModelBase.prototype.constructor.call(this);
+ this.view = view;
+ this.hub = hub;
+ this.items = {};
+ this._setGalleryImageUrl(null);
+ this._queryWatcher = new MS.Entertainment.Framework.QueryWatcher("video_marketplace");
+ this._fileTransferListenerId = "videoMarketplace_" + Date.now() + "_" + Math.random();
+ this.addActionCellsToList = MS.Entertainment.Utilities.isVideoApp1;
+ if (this.view === "flexHub" || this.view === "featuredSet") {
+ this.templateSelectorConstructor = MS.Entertainment.Pages.VideoFlexHubTemplateSelector;
+ this.hideHubs = true
+ }
+ }, {
+ query: null, _queryWatcher: null, _pendingQueryExecute: null, _lastQuery: null, templateSelectorConstructor: null, addActionCellsToList: false, combinedQueryOptions: null, failOnEmpty: true, isDisposed: false, dispose: function dispose() {
+ if (this._pendingQueryExecute) {
+ WinJS.Binding.unwrap(this._pendingQueryExecute).cancel();
+ this._pendingQueryExecute = null
+ }
+ if (this.modifierSelectionManager) {
+ this.modifierSelectionManager.dispose();
+ this.modifierSelectionManager = null
+ }
+ if (this.secondaryModifierSelectionManager) {
+ this.secondaryModifierSelectionManager.dispose();
+ this.secondaryModifierSelectionManager = null
+ }
+ this.isDisposed = true
+ }, thaw: function thaw() {
+ if (this.view === "watchlist")
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.modifierChanged, {
+ sender: this, newValue: this.modifierSelectionManager, oldValue: null
+ })
+ }, isCurrentQuery: function isCurrentQuery() {
+ return !this._pendingQueryExecute
+ }, _isEmptyListFromQuery: function _isEmptyListFromQuery(query) {
+ return WinJS.Utilities.getMember("result.items.count", query) <= 0 && WinJS.Utilities.getMember("result.entries.count", query) <= 0 && WinJS.Utilities.getMember("result.filteredItemsArray.length", query) <= 0 && WinJS.Utilities.getMember("length", query) <= 0
+ }, _handleQueryFailure: function _handleQueryFailure(e) {
+ this._pendingQueryExecute = null;
+ if (!(e && (e.message === "Canceled" || e.name === "Canceled"))) {
+ this._setModelActions(null);
+ this._setItems(MS.Entertainment.Data.VirtualList.wrapArray([]));
+ this._setIsFailed(true)
+ }
+ }, createActionCells: function createActionCells() {
+ var selectedTemplate = this.Templates[this.combinedQueryOptions.template];
+ var actionCells = [];
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var viewSupportsPreviewBrowse = this.view === "movieNewReleases" || this.view === "movieFeatured" || this.view === "movieTopPurchased" || this.view === "movieTopRented" || this.view === "movieTopRated";
+ var isPreviewBrowseEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.previewMovieTrailers);
+ if (viewSupportsPreviewBrowse && isPreviewBrowseEnabled) {
+ var actionCell = new MS.Entertainment.ViewModels.ActionCell(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate, {
+ disableWhenOffline: true, suppressMessageInNetworkBind: true, offlineMessageTitle: String.load(String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE), parameter: {
+ page: MS.Entertainment.UI.Monikers.movieTrailerBrowse, args: {
+ showNotifications: false, getItems: function getItems() {
+ if (this._lastQuery) {
+ var queryClone = this._lastQuery.clone();
+ return queryClone.execute().then(function getContentQuerySuccess(q) {
+ return this.getItemsFromQuery(q)
+ }.bind(this), function getContentQueryFailure(q) {
+ return []
+ }.bind(this))
+ }
+ else
+ return WinJS.Promise.wrap([])
+ }.bind(this)
+ }
+ }, automationId: MS.Entertainment.UI.AutomationIds.videoNavigateToPreviewBrowse, icon: MS.Entertainment.UI.Icon.play, voiceGuiTextStringId: String.id.IDS_VIDEO2_L2_MOVIES_PLAY_ALL_TRAILERS_BUTTON_VUI_GUI, voicePhraseStringId: String.id.IDS_VIDEO2_L2_MOVIES_PLAY_ALL_TRAILERS_BUTTON_VUI_ALM, voicePhoneticPhraseStringId: String.id.IDS_VIDEO2_L2_MOVIES_PLAY_ALL_TRAILERS_BUTTON_VUI_PRON, voiceConfidenceStringId: String.id.IDS_VIDEO2_L2_MOVIES_PLAY_ALL_TRAILERS_BUTTON_VUI_CONF
+ });
+ actionCell.icon = MS.Entertainment.UI.Icon.play;
+ actionCell.stringId = String.id.IDS_VIDEO_PREVIEW_BROWSE_BUTTON;
+ actionCell.automationId = "trailerBrowse";
+ actionCells.push(actionCell)
+ }
+ return actionCells
+ }, isEditorialView: function isEditorialView() {
+ switch (this.view) {
+ case"tvAiredLastNight":
+ case"flexHub":
+ case"featuredSet":
+ return true;
+ case"movieFeatured":
+ case"movieNewReleases":
+ case"tvFeatured":
+ case"tvNewReleases":
+ var genreModifierSelected = this.modifierSelectionManager && this.modifierSelectionManager.selectedIndex > 0;
+ var studioModifierSelected = this.secondaryModifierSelectionManager && this.secondaryModifierSelectionManager.selectedIndex > 0;
+ return !genreModifierSelected && !studioModifierSelected;
+ default:
+ break
+ }
+ return false
+ }, parseEditorialItems: function parseEditorialItems(editorialItemsArray, notifications) {
+ var getItemsPromise;
+ if (this.isEditorialView()) {
+ var goodItems = [];
+ editorialItemsArray.forEach(function accumulateValidEditorialItems(currentEntry) {
+ var item = currentEntry && currentEntry.editorialItem;
+ var editorialType = WinJS.Utilities.getMember("actionType.mediaType", item);
+ if (!MS.Entertainment.Utilities.isSupportedVideoEditorialType(item, editorialType))
+ return;
+ if (notifications)
+ notifications.modifyItem(item);
+ if (editorialType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(item, "seriesTitle", item.name || String.empty);
+ if (editorialType !== MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub && editorialType !== MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub)
+ item = MS.Entertainment.Utilities.convertEditorialItem(item);
+ goodItems.push(item)
+ });
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ getItemsPromise = contentRestrictionService.getBrowsePolicyUpdatePromise().then(function gotBrowsePolicy() {
+ return contentRestrictionService.filterRestrictedMediaItems(goodItems)
+ })
+ }
+ else
+ getItemsPromise = WinJS.Promise.wrap(goodItems)
+ }
+ else
+ getItemsPromise = WinJS.Promise.wrap(editorialItemsArray);
+ return getItemsPromise.then(function gotItems(itemsArray) {
+ return MS.Entertainment.Data.VirtualList.wrapArray(itemsArray)
+ })
+ }, removeMarketplaceItem: function removeMarketplaceItem(mediaItem) {
+ if (this.items && mediaItem) {
+ var itemIndex;
+ return this.items.forEachAll(function findItem(args) {
+ var serviceId = WinJS.Utilities.getMember("item.data.serviceId", args);
+ if (serviceId === mediaItem.serviceId) {
+ itemIndex = this.items.indexFromKey(args.item.key);
+ args.stop = true
+ }
+ }.bind(this)).then(function itemFound() {
+ if (itemIndex !== null && itemIndex !== undefined)
+ this.items.removeAt(itemIndex).then(function itemRemoved(item) {
+ if (this.items && !this.items.count)
+ this._handleQueryFailure()
+ }.bind(this));
+ return itemIndex
+ }.bind(this))
+ }
+ else
+ return WinJS.Promise.wrapError()
+ }, _isRecommendationsView: function _isRecommendationsView() {
+ var isRecommendationsView = false;
+ switch (this.view) {
+ case"recommendations":
+ isRecommendationsView = true;
+ break;
+ case"movieRecommendations":
+ isRecommendationsView = true;
+ break;
+ case"tvRecommendations":
+ isRecommendationsView = true;
+ break
+ }
+ return isRecommendationsView
+ }, getItemsFromQuery: function getItemsFromQuery(q, notifications) {
+ this.isLoading = false;
+ if (this._isRecommendationsView() && q.length > 0)
+ return WinJS.Promise.wrap(MS.Entertainment.Data.VirtualList.wrapArray(q));
+ else if (q.result.filteredItemsArray && this._isRecommendationsView()) {
+ var recommendationItems = WinJS.Utilities.getMember("result.filteredItemsArray", q);
+ return WinJS.Promise.wrap(MS.Entertainment.Data.VirtualList.wrapArray(recommendationItems))
+ }
+ else if (q.result.entries) {
+ var listIndex = (this.view === "movieFeatured" || this.view === "tvFeatured" || this.view === "tvTopPurchased") ? 1 : 0;
+ return q.result.entries.itemsFromIndex(listIndex, 0, 0).then(function firstItemGotten(result) {
+ var editorialItemsArray = result.items[0].data.editorialItems;
+ return this.parseEditorialItems(editorialItemsArray, notifications)
+ }.bind(this))
+ }
+ else if (q.result.items) {
+ if (this.isEditorialView(this.view)) {
+ var rawItems = q.result.items;
+ if (!Array.isArray(rawItems)) {
+ if (rawItems.toArray)
+ return rawItems.toArray().then(function(items) {
+ return this.parseEditorialItems(items, notifications)
+ }.bind(this));
+ MS.Entertainment.Pages.fail("Editorial augmenter is not producing an array");
+ return MS.Entertainment.Data.VirtualList.wrapArray(rawItems)
+ }
+ return this.parseEditorialItems(rawItems, notifications)
+ }
+ return WinJS.Promise.wrap(q.result.items)
+ }
+ return WinJS.Promise.wrap(MS.Entertainment.Data.VirtualList.wrapArray([]))
+ }, beginQuery: function beginQuery(contentQuery, imageQuery, galleryImage) {
+ var currentPage;
+ var resultModifier = null;
+ var taskKeyGetter = null;
+ var notifier = null;
+ var notifications = null;
+ var sender = null;
+ this.isLoading = true;
+ this._calculateTitle();
+ this._setIsFailed(false);
+ if (!this.addActionCellsToList) {
+ var action = this.createActionCells();
+ if (action && action.length > 0)
+ this._setModelActions(action)
+ }
+ if (this.view === "flexHub" || this.view === "featuredSet") {
+ currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ if (currentPage.options) {
+ contentQuery.target = currentPage.options.query;
+ if (!MS.Entertainment.Utilities.isVideoApp2)
+ this._setLargeItemIndex(0)
+ }
+ }
+ if (this.view === "browseByActor" && this._lastQuery)
+ contentQuery.actor = this._lastQuery.actor;
+ this._setGalleryImageUrl(null);
+ if (galleryImage)
+ this._setGalleryImageUrl(galleryImage);
+ else if (imageQuery) {
+ this._queryWatcher.registerQuery(imageQuery);
+ imageQuery.execute().then(function getImageQuerySuccess(q) {
+ var imageUrl = null;
+ if (q.result.item) {
+ var studio = q.result.item;
+ var studioLogoDimensions = {
+ x: 0, y: 40
+ };
+ if (studio.imageId) {
+ var imageUrl = MS.Entertainment.UI.Shell.ImageLoader.makeCatalogImageUri(studio.imageId, MS.Entertainment.Data.ImageIdType.image, {
+ x: 0, y: 40
+ }, true, true, MS.Entertainment.ImageRequested.primaryImage, 0, MS.Entertainment.ImageContentType.png);
+ var imageManager = new Microsoft.Entertainment.ImageManager;
+ imageManager.retrieveImageFromUrlAsync(Microsoft.Entertainment.NetworkUsage.normal, imageUrl, String.empty, String.empty).then(function setImagePrimaryUrl(uri) {
+ this._setGalleryImageUrl(uri)
+ }.bind(this))
+ }
+ }
+ }.bind(this))
+ }
+ var executePromise = null;
+ if (WinJS.Utilities.getMember("Entertainment.ViewModels.VideoMarketplace.preloadedVideoMarketplaceQueryInfo.query.queryType", MS) === contentQuery.queryType && WinJS.Utilities.getMember("Entertainment.ViewModels.VideoMarketplace.preloadedVideoMarketplaceQueryInfo.promise", MS)) {
+ contentQuery = MS.Entertainment.ViewModels.VideoMarketplace.preloadedVideoMarketplaceQueryInfo.query;
+ executePromise = MS.Entertainment.ViewModels.VideoMarketplace.preloadedVideoMarketplaceQueryInfo.promise;
+ notifications = MS.Entertainment.ViewModels.VideoMarketplace.preloadedVideoMarketplaceQueryInfo.notifications;
+ sender = MS.Entertainment.ViewModels.VideoMarketplace.preloadedVideoMarketplaceQueryInfo.sender;
+ MS.Entertainment.ViewModels.VideoMarketplace.preloadedVideoMarketplaceQueryInfo = null
+ }
+ else {
+ var notificationInfo = MS.Entertainment.ViewModels.VideoMarketplace.getNotificationInfo(this.view);
+ if (notificationInfo) {
+ resultModifier = notificationInfo.resultModifier;
+ taskKeyGetter = notificationInfo.taskKeyGetter;
+ notifier = notificationInfo.notifier;
+ var modQueryInfo = MS.Entertainment.ViewModels.VideoMarketplace.modifyQuery(contentQuery, resultModifier, taskKeyGetter, notifier);
+ if (modQueryInfo) {
+ notifications = modQueryInfo.notifications;
+ sender = modQueryInfo.sender
+ }
+ }
+ }
+ if (this._pendingQueryExecute) {
+ WinJS.Binding.unwrap(this._pendingQueryExecute).cancel();
+ this._pendingQueryExecute = null
+ }
+ this._queryWatcher.registerQuery(contentQuery);
+ this._lastQuery = contentQuery;
+ if (this.view === "browseByActor")
+ this._calculateTitle();
+ if (this.view === "watchlist" && !executePromise) {
+ var watchlistService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.watchlistService);
+ executePromise = watchlistService.initialize().then(function() {
+ contentQuery.watchlistId = watchlistService.watchlistId;
+ return contentQuery.execute()
+ })
+ }
+ if (!executePromise)
+ executePromise = contentQuery.execute();
+ this._pendingQueryExecute = executePromise.then(function getContentQuerySuccess(q) {
+ if (this.failOnEmpty && (this._isEmptyListFromQuery(q) || !MS.Entertainment.UI.NetworkStatusService.isOnline()))
+ this._handleQueryFailure();
+ else {
+ this._pendingQueryExecute = null;
+ if (this.view === "flexHub" || this.view === "featuredSet") {
+ var name = String.empty;
+ var description = String.empty;
+ if (q.result.name)
+ name = q.result.name;
+ if (q.result.description && typeof q.result.description === "string")
+ description = q.result.description;
+ if (q.result.backgroundImageUrl && (!MS.Entertainment.Utilities.isVideoApp1 || this.view !== "flexHub")) {
+ this._setHeroImageObject({
+ imageUrl: q.result.backgroundImageUrl, primaryText: name, secondaryText: description
+ });
+ this.titleOverride = String.nbsp;
+ this.subTitleOverride = String.empty
+ }
+ else {
+ this.titleOverride = name;
+ this.subTitleOverride = description
+ }
+ }
+ this.getItemsFromQuery(q, notifications).then(function gotItems(items) {
+ if (!items.count)
+ this._handleQueryFailure();
+ else
+ this._setItems(items)
+ }.bind(this));
+ if (taskKeyGetter) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener(this._fileTransferListenerId, taskKeyGetter, sender, notifier)
+ }
+ }
+ }.bind(this), function getContentQueryError(e) {
+ this._handleQueryFailure(e)
+ }.bind(this))
+ }, _setLargeItemIndex: function _setLargeItemIndex(value) {
+ if (this.largeItemIndex !== value) {
+ var oldValue = this.largeItemIndex;
+ this.largeItemIndex = value;
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.largeItemIndexChanged, {
+ sender: this, newValue: this.largeItemIndex, oldValue: oldValue
+ })
+ }
+ }, _setModelActions: function _setModelActions(value) {
+ if (this.modelActions !== value) {
+ var oldValue = this.modelActions;
+ this.modelActions = value;
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.modelActionsChanged, {
+ sender: this, newValue: this.modelActions, oldValue: oldValue
+ })
+ }
+ }, _setItems: function _setItems(items) {
+ if (this.items !== items) {
+ var action;
+ if (items && items.count && this.addActionCellsToList) {
+ action = this.createActionCells();
+ if (action && !Array.isArray(action))
+ action = [action];
+ if (action && action.length > 0) {
+ action = action.map(function(currentAction) {
+ return new MS.Entertainment.Data.Factory.ListActionItemWrapper(currentAction)
+ });
+ items.insertRangeAt(0, action)
+ }
+ }
+ var oldValue = this.items;
+ this.items = items;
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.itemsChanged, {
+ sender: this, newValue: this.items, oldValue: oldValue
+ })
+ }
+ }, _setIsFailed: function _setIsFailed(value) {
+ if (this.isFailed !== value) {
+ var oldValue = this.isFailed;
+ this.isFailed = value;
+ this.failedGalleryModel = {
+ primaryText: String.load(String.id.IDS_VIDEO_MARKETPLACE_EMPTY_TITLE), secondaryText: String.load(String.id.IDS_VIDEO_MARKETPLACE_EMPTY_DESC)
+ };
+ if (this._isRecommendationsView())
+ this.failedGalleryModel.secondaryText = String.load(String.id.IDS_VIDEO_RECOMMEND_EMPTY_GALLERIES);
+ if (this.view === "watchlist")
+ this.failedGalleryModel.secondaryText = String.load(String.id.IDS_VIDEO2_WISHLIST_EMPTY_GALLERY);
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.isFailedChanged, {
+ sender: this, newValue: this.isFailed, oldValue: oldValue
+ })
+ }
+ }, _setPrimaryFilterItems: function _setPrimaryFilterItems(primaryFilterItems) {
+ var oldValue = this.modifierSelectionManager;
+ var settings = this._getFilterSettings(this.view);
+ this.modifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(primaryFilterItems, 0, settings.primaryFilter);
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ var primaryModifierOverride = WinJS.Utilities.getMember("options.selectPrimaryModifier", currentPage);
+ if (primaryModifierOverride) {
+ var selectedIndex = -1;
+ for (var i = 0; i < primaryFilterItems.length; i++)
+ if (primaryFilterItems[i].label.toUpperCase() === primaryModifierOverride.toUpperCase()) {
+ selectedIndex = i;
+ break
+ }
+ if (selectedIndex >= 0)
+ this.modifierSelectionManager.selectedIndex = selectedIndex
+ }
+ else if (MS.Entertainment.ViewModels.VideoMarketplace.defaultPrimaryFilter) {
+ this.modifierSelectionManager.selectedIndex = MS.Entertainment.ViewModels.VideoMarketplace.defaultPrimaryFilter;
+ MS.Entertainment.ViewModels.VideoMarketplace.defaultPrimaryFilter = null
+ }
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.modifierChanged, {
+ sender: this, newValue: this.modifierSelectionManager, oldValue: oldValue
+ })
+ }, _setSecondaryFilterItems: function _setSecondaryFilterItems(secondaryFilterItems) {
+ var oldValue = this.secondaryModifierSelectionManager;
+ var settings = this._getFilterSettings(this.view);
+ this.secondaryModifierSelectionManager = new MS.Entertainment.UI.Framework.SelectionManager(secondaryFilterItems, 0, settings.secondaryFilter);
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ var secondaryModifierOverride = WinJS.Utilities.getMember("options.selectSecondaryModifier", currentPage);
+ if (secondaryModifierOverride) {
+ var selectedIndex = -1;
+ for (var i = 0; i < secondaryFilterItems.length; i++)
+ if (secondaryFilterItems[i].label.toUpperCase() === secondaryModifierOverride.toUpperCase()) {
+ selectedIndex = i;
+ break
+ }
+ if (selectedIndex >= 0)
+ this.secondaryModifierSelectionManager.selectedIndex = selectedIndex
+ }
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.secondaryModifierChanged, {
+ sender: this, newValue: this.secondaryModifierSelectionManager, oldValue: oldValue
+ })
+ }, _setGalleryImageUrl: function _setGalleryImageUrl(galleryImageUrl) {
+ if (this.galleryImageUrl !== galleryImageUrl) {
+ var oldValue = this.galleryImageUrl;
+ this.galleryImageUrl = galleryImageUrl;
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.galleryImageUrlChanged, {
+ sender: this, newValue: this.galleryImageUrl, oldValue: oldValue
+ })
+ }
+ }, _setHeroImageObject: function _setHeroImageObject(heroImageObject) {
+ if (!heroImageObject)
+ return;
+ var imageUrl = heroImageObject.imageUrl;
+ if (this.heroImageUrl !== imageUrl) {
+ var oldValue = this.heroImageUrl;
+ this.heroImageUrl = imageUrl;
+ this.heroPrimaryText = heroImageObject.primaryText;
+ this.heroSecondaryText = heroImageObject.secondaryText;
+ this.dispatchEvent(MS.Entertainment.ViewModels.VideoMarketplace.events.heroImageUrlChanged, {
+ sender: this, newValue: this.heroImageUrl, oldValue: oldValue
+ })
+ }
+ }, unregisterServices: function unregisterServices() {
+ var fileTransferService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ if (fileTransferService)
+ fileTransferService.unregisterListener(this._fileTransferListenerId)
+ }, _getFilterSettings: function _getFilterSettings(view) {
+ var settings = {};
+ switch (view) {
+ case"movieNewReleases":
+ case"movieTopPurchased":
+ case"movieTopRented":
+ case"movieTopRated":
+ settings.primaryFilter = "movieMarketplaceFilter";
+ settings.secondaryFilter = "movieMarketplaceSecondaryFilter";
+ break;
+ case"tvNewReleases":
+ case"tvTopPurchased":
+ case"tvTopRated":
+ settings.primaryFilter = "tvMarketplaceFilter";
+ settings.secondaryFilter = "tvMarketplaceSecondaryFilter";
+ break
+ }
+ return settings
+ }, _getModifierText: function _getModifierText(modifier) {
+ var text = String.empty;
+ if (modifier)
+ if (modifier.selectedIndex > 0)
+ text = modifier.selectedItem.label;
+ return text
+ }, _calculateTitle: function _calculateTitle() {
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ if (this.hub && this.hub.title) {
+ var view = this.hub.title;
+ var genre = this._getModifierText(this.modifierSelectionManager);
+ var studio = this._getModifierText(this.secondaryModifierSelectionManager);
+ var title = String.empty;
+ if (genre && studio)
+ title = String.load(String.id.IDS_VIDEO_VIEW_IN_GENRE_FROM_STUDIO_LABEL).format(view, genre, studio);
+ else if (genre)
+ title = String.load(String.id.IDS_VIDEO_VIEW_IN_GENRE_LABEL).format(view, genre);
+ else if (studio)
+ title = String.load(String.id.IDS_VIDEO_VIEW_FROM_STUDIO_LABEL).format(view, studio);
+ else
+ title = view;
+ this.titleOverride = title
+ }
+ if (this.view === "movieRecommendations")
+ this.titleOverride = String.load(String.id.IDS_VIDEO_RECOMMEND_MOVIES_TITLE_TC);
+ else if (this.view === "tvRecommendations")
+ this.titleOverride = String.load(String.id.IDS_VIDEO_RECOMMEND_TV_TITLE_TC);
+ else if (this.view === "recommendations")
+ this.titleOverride = String.load(String.id.IDS_VIDEO_RECOMMEND_TITLE_TC);
+ if (this.view === "browseByActor") {
+ var stringId = String.id.IDS_VIDEO2_CONTRIBUTOR_MOVIES_GALLERY_TITLE;
+ var filter = this._getModifierText(this.modifierSelectionManager);
+ if (filter === "IDS_VIDEO2_DETAILS_TV_DROPDOWN_LC")
+ stringId = String.id.IDS_VIDEO2_CONTRIBUTOR_TV_GALLERY_TITLE;
+ if (this._lastQuery && this._lastQuery.actor)
+ this.titleOverride = String.load(stringId).format(this._lastQuery.actor)
+ }
+ }
+ }, _expandFilter: function _expandFilter(filter) {
+ var promises = [];
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (filter)
+ filter.forEach(function addFilterItem(filterItem) {
+ if (filterItem.feature && !featureEnablement.isEnabled(filterItem.feature))
+ return;
+ if (!filterItem.label || typeof filterItem.label === "string" || typeof filterItem.label === "number")
+ promises.push(WinJS.Promise.wrap([filterItem]));
+ else if (Array.isArray(filterItem.label)) {
+ var filterItemsToAdd = filterItem.label.map(function map(filterSubItem) {
+ return MS.Entertainment.Utilities.uniteObjects(filterItem, filterSubItem)
+ }.bind(this));
+ promises.push(WinJS.Promise.wrap(filterItemsToAdd))
+ }
+ else {
+ var getFiltersQuery = new filterItem.label;
+ this._queryWatcher.registerQuery(getFiltersQuery);
+ promises.push(getFiltersQuery.execute().then(function getFiltersQuerySuccess(q) {
+ if (!q || !q.result || !q.result.items)
+ return WinJS.Promise.wrap([]);
+ var filterItemsToAdd = [];
+ q.result.items.forEach(function copy(args) {
+ var copiedFilterItem = {};
+ for (var property in filterItem)
+ copiedFilterItem[property] = filterItem[property];
+ copiedFilterItem.label = (args.item && args.item.data ? args.item.data.name : args.name);
+ copiedFilterItem.serviceId = (args.item && args.item.data ? args.item.data.serviceId : args.serviceId);
+ copiedFilterItem.imageUri = (args.item && args.item.data ? args.item.data.imageUri : args.imageUri);
+ if (args.item && args.item.data) {
+ if (args.item.data.genre)
+ copiedFilterItem.genre = args.item.data.genre;
+ if (args.item.data.studio)
+ copiedFilterItem.studio = args.item.data.studio;
+ if (args.item.data.network)
+ copiedFilterItem.network = args.item.data.network
+ }
+ filterItemsToAdd.push(copiedFilterItem)
+ });
+ return WinJS.Promise.wrap(filterItemsToAdd)
+ }.bind(this), function getFiltersQueryError() {
+ return WinJS.Promise.wrap([])
+ }.bind(this)))
+ }
+ }.bind(this));
+ return WinJS.Promise.join(promises).then(function complete(results) {
+ var filterItemsToAdd = [];
+ results.forEach(function forEachResult(result) {
+ filterItemsToAdd = filterItemsToAdd.concat(result)
+ });
+ return filterItemsToAdd
+ }.bind(this), function error() {
+ return []
+ }.bind(this))
+ }, populateSecondaryFilter: function populateSecondaryFilter(primaryFilterItem) {
+ if (primaryFilterItem && primaryFilterItem.secondaryFilter)
+ this._expandFilter(this.SecondaryFilters[primaryFilterItem.secondaryFilter]).then(function complete(filtersToAdd) {
+ this._setSecondaryFilterItems(filtersToAdd)
+ }.bind(this))
+ }, populatePrimaryFilter: function populatePrimaryFilter() {
+ this._setIsFailed(false);
+ var primaryFilter = this.PrimaryFilters[this.view]();
+ this._expandFilter(primaryFilter).then(function complete(filtersToAdd) {
+ this._setPrimaryFilterItems(filtersToAdd)
+ }.bind(this))
+ }, SecondaryFilters: (function() {
+ var secondaryFilters;
+ return {get: function() {
+ if (!secondaryFilters) {
+ var allStudiosLabel = MS.Entertainment.Utilities.isVideoApp1 ? String.load(String.id.IDS_FILTER_ALL_STUDIOS_LC) : String.load(String.id.IDS_FILTER_ALL_STUDIOS_SC);
+ var allNetworksLabel = MS.Entertainment.Utilities.isVideoApp1 ? String.load(String.id.IDS_FILTER_ALL_NETWORKS_LC) : String.load(String.id.IDS_FILTER_ALL_NETWORKS_SC);
+ secondaryFilters = {
+ movieNewReleaseSecondaryFilter: [{label: allStudiosLabel}, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieStudios, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.releaseDate)
+ }], movieTopPurchasedStudios: [{label: allStudiosLabel}, {label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieStudios}], movieTopRentedStudios: [{label: allStudiosLabel}, {label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieStudios}], movieTopRatedStudios: [{label: allStudiosLabel}, {label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieStudios}], tvNewReleaseFilter: [{label: allNetworksLabel}, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataTvNetworks, query: MS.Entertainment.Data.Query.Video.EdsBrowseTVByGenreNetwork, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.releaseDate)
+ }], tvTopPurchasedNetworks: [{label: allNetworksLabel}, {label: MS.Entertainment.Data.Query.Video.EdsMetadataTvNetworks}], tvTopRatedNetworks: [{label: allNetworksLabel}, {label: MS.Entertainment.Data.Query.Video.EdsMetadataTvNetworks}], watchlistSorts: [{
+ label: String.load(String.id.IDS_VIDEO_COLLECTION_DATEADDED_SORT_2), sort: Microsoft.Entertainment.Queries.WatchlistItemsSortBy.dateCreatedDescending
+ }, {
+ label: String.load(String.id.IDS_VIDEO_COLLECTION_ALPHA_SORT_2), sort: Microsoft.Entertainment.Queries.WatchlistItemsSortBy.nameAscending
+ }]
+ }
+ }
+ return secondaryFilters
+ }}
+ })(), PrimaryFilters: {get: function() {
+ var secondaryFilters = this.SecondaryFilters;
+ return {
+ movieNewReleases: function primaryFilters_movieNewReleases_get() {
+ return [{
+ label: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_FILTER_ALL_GENRES : String.id.IDS_FILTER_ALL_GENRES_2, query: MS.Entertainment.Data.Query.MovieHub, secondaryFilter: "movieNewReleaseSecondaryFilter", template: "movie", mediaType: "editorialVideo"
+ }, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieGenres, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.releaseDate), secondaryFilter: "movieNewReleaseSecondaryFilter", template: "movie", mediaType: "editorialVideo"
+ }]
+ }, movieFeatured: function primaryFilters_movieFeatured_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.MovieHub, template: "movie", mediaType: "editorialVideo"
+ }]
+ }, movieTopPurchased: function primaryFilters_movieTopPurchased_get() {
+ return [{
+ label: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_FILTER_ALL_GENRES : String.id.IDS_FILTER_ALL_GENRES_2, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.sevenDaysPurchaseCount), secondaryFilter: "movieTopPurchasedStudios", template: "movie"
+ }, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieGenres, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.sevenDaysPurchaseCount), secondaryFilter: "movieTopPurchasedStudios", template: "movie"
+ }]
+ }, movieTopRented: function primaryFilters_movieTopRented_get() {
+ return [{
+ label: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_FILTER_ALL_GENRES : String.id.IDS_FILTER_ALL_GENRES_2, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.sevenDaysRentalCount), secondaryFilter: "movieTopRentedStudios", template: "movie"
+ }, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieGenres, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.sevenDaysRentalCount), secondaryFilter: "movieTopRentedStudios", template: "movie"
+ }]
+ }, movieTopRated: function primaryFilters_movieTopRated_get() {
+ return [{
+ label: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_FILTER_ALL_GENRES : String.id.IDS_FILTER_ALL_GENRES_2, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.allTimeAverageRating), secondaryFilter: "movieTopRatedStudios", template: "movie"
+ }, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataMovieGenres, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByGenreStudio, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.allTimeAverageRating), secondaryFilter: "movieTopRatedStudios", template: "movie"
+ }]
+ }, tvFeatured: function primaryFilters_tvFeatured_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.TvHub, template: "tvSeries", mediaType: "editorialVideo"
+ }]
+ }, browseByActor: function primaryFilters_browseByActor_get() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var moviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var movieFilter = {
+ label: String.id.IDS_VIDEO2_DETAILS_MOVIE_DROPDOWN_LC, query: MS.Entertainment.Data.Query.Video.EdsBrowseMoviesByActor, template: "movie"
+ };
+ var tvFilter = {
+ label: String.id.IDS_VIDEO2_DETAILS_TV_DROPDOWN_LC, query: MS.Entertainment.Data.Query.Video.EdsBrowseTVByActor, template: "tvSeries"
+ };
+ var filterSet = [];
+ if (moviesMarketplaceEnabled)
+ filterSet.push(movieFilter);
+ if (tvMarketplaceEnabled)
+ filterSet.push(tvFilter);
+ return filterSet
+ }, tvNewReleases: function primaryFilters_tvNewReleases_get() {
+ return [{
+ label: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_FILTER_ALL_GENRES : String.id.IDS_FILTER_ALL_GENRES_2, query: MS.Entertainment.Data.Query.TvHub, secondaryFilter: "tvNewReleaseFilter", template: "tvSeries", mediaType: "editorialVideo"
+ }, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataTvGenres, query: MS.Entertainment.Data.Query.Video.EdsBrowseNewReleaseTvSeries, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.releaseDate), secondaryFilter: "tvNewReleaseFilter", template: "tvSeries", mediaType: "editorialVideo"
+ }]
+ }, tvAiredLastNight: function primaryFilters_tvAiredLastNight_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.browseTVFromLastNight, template: "tvSeason", mediaType: "editorialVideo"
+ }]
+ }, tvTopPurchased: function primaryFilters_tvTopPurchased_get() {
+ return [{
+ label: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_FILTER_ALL_GENRES : String.id.IDS_FILTER_ALL_GENRES_2, query: MS.Entertainment.Data.Query.Video.EdsBrowseTVByGenreNetwork, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.sevenDaysPurchaseCount), secondaryFilter: "tvTopPurchasedNetworks", template: "tvSeries"
+ }, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataTvGenres, query: MS.Entertainment.Data.Query.Video.EdsBrowseTVByGenreNetwork, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.sevenDaysPurchaseCount), secondaryFilter: "tvTopPurchasedNetworks", template: "tvSeries"
+ }]
+ }, tvTopRated: function primaryFilters_tvTopRated_get() {
+ return [{
+ label: MS.Entertainment.Utilities.isApp1 ? String.id.IDS_FILTER_ALL_GENRES : String.id.IDS_FILTER_ALL_GENRES_2, query: MS.Entertainment.Data.Query.Video.EdsBrowseTVByGenreNetwork, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.allTimeAverageRating), secondaryFilter: "tvTopRatedNetworks", template: "tvSeries"
+ }, {
+ label: MS.Entertainment.Data.Query.Video.EdsMetadataTvGenres, query: MS.Entertainment.Data.Query.Video.EdsBrowseTVByGenreNetwork, orderBy: MS.Entertainment.Data.Query.convertToLegacySortIfNeeded(MS.Entertainment.Data.Query.edsSortOrder.allTimeAverageRating), secondaryFilter: "tvTopRatedNetworks", template: "tvSeries"
+ }]
+ }, flexHub: function primaryFilters_flexHub_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.MediaDiscoveryVideoFlexHub, template: "flexHub", mediaType: "editorialVideo"
+ }]
+ }, studiosHub: function primaryFilters_studiosHub_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.Video.EdsMetadataMovieStudios, template: "studiosHub", mediaType: "studioTemplate"
+ }]
+ }, networksHub: function primaryFilters_networksHub_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.Video.EdsMetadataTvNetworks, template: "networksHub", mediaType: "networkTemplate"
+ }]
+ }, featuredSet: function primaryFilters_featuredSet_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.MediaDiscoveryVideoFlexHub, template: "featuredSet", mediaType: "editorialVideo"
+ }]
+ }, recommendations: function primaryFilters_recommendations_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.EdsVideoRecommendations, template: "recommendations", mediaType: "editorialVideo"
+ }]
+ }, movieRecommendations: function primaryFilters_movieRecommendations_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.EdsVideoRecommendations, template: "recommendations", mediaType: "editorialVideo", desiredMediaItemTypes: "movies"
+ }]
+ }, tvRecommendations: function primaryFilters_tvRecommendations_get() {
+ return [{
+ label: String.empty, query: MS.Entertainment.Data.Query.EdsVideoRecommendations, template: "recommendations", mediaType: "editorialVideo", desiredMediaItemTypes: "tv"
+ }]
+ }, watchlist: function primaryFilters_watchlist_get() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var moviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var watchlistFilters = [{
+ label: String.id.IDS_VIDEO2_WISHLIST_ALL_FILTER_VUI_GUI, secondaryFilter: "watchlistSorts", query: MS.Entertainment.Data.Query.libraryWatchlistMediaItems
+ }];
+ if (moviesMarketplaceEnabled) {
+ watchlistFilters.push({
+ label: String.id.IDS_VIDEO2_WISHLIST_MOVIES_FILTER_VUI_GUI, secondaryFilter: "watchlistSorts", query: MS.Entertainment.Data.Query.libraryWatchlistMediaItems, mediaItemObjectType: Microsoft.Entertainment.Queries.ObjectType.video
+ });
+ watchlistFilters.push({
+ label: String.id.IDS_VIDEO2_WISHLIST_BUNDLES_FILTER_VUI_GUI, secondaryFilter: "watchlistSorts", query: MS.Entertainment.Data.Query.libraryWatchlistMediaItems, mediaItemObjectType: Microsoft.Entertainment.Queries.ObjectType.bundle
+ })
+ }
+ return watchlistFilters
+ }
+ }
+ }}, Templates: MS.Entertainment.ViewModels.VideoMarketplaceTemplates
+ }, {
+ preloadedVideoMarketplaceQueryInfo: null, defaultPrimaryFilter: 0, getNotificationInfo: function getNotificationInfo(view) {
+ var notificationInfo = null;
+ if (MS.Entertainment.UI.ContentNotification && MS.Entertainment.UI.FileTransferService)
+ switch (view) {
+ case"movieFeatured":
+ case"movieNewReleases":
+ case"movieTopPurchased":
+ case"movieTopRented":
+ case"movieTopRated":
+ case"tvFeatured":
+ case"tvNewReleases":
+ case"tvAiredLastNight":
+ case"tvTopPurchased":
+ case"tvTopRated":
+ case"flexHub":
+ case"featuredSet":
+ case"browseByActor":
+ notificationInfo = {
+ resultModifier: MS.Entertainment.UI.ContentNotification.listResult(), taskKeyGetter: MS.Entertainment.UI.FileTransferService.keyFromProperty("mediaId", false, true), notifier: MS.Entertainment.UI.FileTransferNotifiers.genericFile
+ };
+ break;
+ default:
+ MS.Entertainment.Pages.assert(false, "getNotificationInfo received an unknown view")
+ }
+ return notificationInfo
+ }, modifyQuery: function modifyQuery(contentQuery, resultModifier, taskKeyGetter, notifier) {
+ var queryModInfo = null;
+ var notifications = null;
+ var sender = null;
+ if (taskKeyGetter) {
+ notifications = new MS.Entertainment.UI.ContentNotification.NotificationModification(resultModifier, MS.Entertainment.UI.FileTransferService.keyFromProperty("serviceId", false, true));
+ var sender = notifications.createSender();
+ notifications.modifyQuery(contentQuery);
+ queryModInfo = {
+ notifications: notifications, sender: sender
+ }
+ }
+ return queryModInfo
+ }, events: {
+ itemsChanged: "itemsChanged", isFailedChanged: "isFailedChanged", modifierChanged: "modifierChanged", secondaryModifierChanged: "secondaryModifierChanged", galleryImageUrlChanged: "galleryImageUrlChanged", heroImageUrlChanged: "heroImageUrlChanged", largeItemIndexChanged: "largeItemIndexChanged", selectedItemChanged: "selectedItemChanged", modelActionsChanged: "modelActionsChanged"
+ }, tvSeriesLowDensityCardTemplateSize: 440, movieLowDensityCardTemplateSize: 324, tvSeriesWatchlistGalleryWidth: 648, movieWatchlistGalleryWidth: 468
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {VideoFlexHubTemplateSelector: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.GalleryTemplateSelector", function galleryTemplateSelector(galleryView) {
+ MS.Entertainment.UI.Controls.GalleryTemplateSelector.prototype.constructor.call(this);
+ this._galleryView = galleryView;
+ this.addTemplate("marketplaceMovie", "/Components/Video/VideoMarketplaceTemplates.html#movieFlexHubTemplate");
+ this.addTemplate("marketplaceTVSeries", "/Components/Video/VideoMarketplaceTemplates.html#tvFlexHubTemplate");
+ this.addTemplate("flexHubBigItem", "/Components/Video/VideoMarketplaceTemplates.html#videoFlexHubBigItemTemplate")
+ }, {
+ onSelectTemplate: function onSelectTemplate(item) {
+ var template = null;
+ if (item && item.isHeader)
+ template = "header";
+ else if (item && item.index === 0 && !MS.Entertainment.Utilities.isVideoApp2)
+ template = "flexHubBigItem";
+ else {
+ var editorialType = WinJS.Utilities.getMember("data.actionType.mediaType", item);
+ switch (editorialType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ template = "marketplaceTVSeries";
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer:
+ template = "marketplaceMovie";
+ break;
+ default:
+ MS.Entertainment.Pages.fail("no template defined");
+ break
+ }
+ }
+ this.ensureTemplatesLoaded([template]);
+ return this.getTemplateProvider(template)
+ }, getPanelTemplatePath: function getPanelTemplatePath(item) {
+ return this._getPanelTemplatePath(item, false)
+ }, _getPanelTemplatePath: function getPanelTemplatePath(item, forceMarketplace) {
+ var data = (item && item.data) ? item.data : {};
+ this._galleryView.panelOptions = (data && data.inCollection && (!forceMarketplace || !data.hasServiceId)) ? {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.collection} : {location: MS.Entertainment.Pages.BaseMediaInlineDetails.Location.marketplace};
+ switch (data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.tvEpisode:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ return MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl();
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (data.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ return "MS.Entertainment.Pages.MovieInlineDetails";
+ else if (data.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ return MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl();
+ MS.Entertainment.Pages.assert(data.videoType === Microsoft.Entertainment.Queries.VideoType.other, "unknown video type");
+ return String.empty;
+ default:
+ MS.Entertainment.Pages.assert(false, "no template defined");
+ return null
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Video2FlexHub: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.Marketplace", "/Components/Video/VideoMarketplaceTemplates.html#flexHubGalleryTemplate", null, {}, {}, {
+ featuredSetFlexHubTemplateSize: 576, computeFlexHubItemSize: function computeFlexHubItemSize(item, itemIndex) {
+ itemIndex = itemIndex || 0;
+ var itemType = WinJS.Utilities.getMember("actionType.mediaType", item);
+ switch (itemType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ return MS.Entertainment.ViewModels.VideoMarketplace.tvSeriesLowDensityCardTemplateSize;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ return (itemIndex % 2) ? 0 : MS.Entertainment.Pages.Video2FlexHub.featuredSetFlexHubTemplateSize;
+ default:
+ MS.Entertainment.Pages.assert(itemType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie || itemType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer, "Unexpected media type found in Flex Hub: " + itemType);
+ return MS.Entertainment.ViewModels.VideoMarketplace.movieLowDensityCardTemplateSize
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Video2StudioAndNetworkGallery: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.Marketplace", "/Components/Video/VideoMarketplaceTemplates.html#studioAndNetworkGalleryTemplate", null, {}, {}, {
+ hubTemplateSize: 576, computeHubItemSize: function computeFlexHubItemSize(item, itemIndex) {
+ itemIndex = itemIndex || 0;
+ return (itemIndex % 2) ? 0 : MS.Entertainment.Pages.Video2StudioAndNetworkGallery.hubTemplateSize
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {BrowseByActorHub: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.Marketplace", "/Components/Video/VideoMarketplaceTemplates.html#browseByActorTemplate", null, {}, {}, {computeBrowseByActorHubItemSize: function computeBrowseByActorHubItemSize(item, itemIndex) {
+ itemIndex = itemIndex || 0;
+ var itemType = WinJS.Utilities.getMember("mediaType", item);
+ switch (itemType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ return MS.Entertainment.ViewModels.VideoMarketplace.tvSeriesLowDensityCardTemplateSize;
+ default:
+ return MS.Entertainment.ViewModels.VideoMarketplace.movieLowDensityCardTemplateSize
+ }
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Video1FeaturedSets: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.Marketplace", "/Components/Video/VideoMarketplaceTemplates.html#featuredSetsGalleryTemplate", null, {}, {}, {
+ tvSeriesFlexHubTemplateSize: 320, movieFlexHubTemplateSize: 236, featuredSetFlexHubTemplateSize: 526, computeFlexHubItemSize: function computeFlexHubItemSize(item, itemIndex) {
+ itemIndex = itemIndex || 0;
+ var itemType = WinJS.Utilities.getMember("actionType.mediaType", item) || item.mediaType;
+ switch (itemType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ return MS.Entertainment.Pages.Video1FeaturedSets.tvSeriesFlexHubTemplateSize;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ return (itemIndex % 2) ? 0 : MS.Entertainment.Pages.Video1FeaturedSets.featuredSetFlexHubTemplateSize;
+ default:
+ MS.Entertainment.Pages.assert(itemType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie || itemType === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer, "Unexpected media type found in Flex Hub: " + itemType);
+ return MS.Entertainment.Pages.Video1FeaturedSets.movieFlexHubTemplateSize
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {MarketplacePageWithRemoveButton: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.Marketplace", null, null, {
+ _galleryViewEventHandlers: null, initialize: function initialize() {
+ MS.Entertainment.Pages.Marketplace.prototype.initialize.call(this);
+ if (this._galleryView)
+ this._galleryViewEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._galleryView, {removeItem: this._onItemRemoved.bind(this)})
+ }, unload: function unload() {
+ if (this._galleryViewEventHandlers) {
+ this._galleryViewEventHandlers.cancel();
+ this._galleryViewEventHandlers = null
+ }
+ MS.Entertainment.Pages.Marketplace.prototype.unload.call(this)
+ }, _onItemRemoved: function _onItemRemoved(eventArgs) {
+ if (this._viewModel && this._viewModel.removeMarketplaceItem) {
+ var mediaItem = WinJS.Utilities.getMember("detail.mediaItem", eventArgs);
+ this._viewModel.removeMarketplaceItem(mediaItem).done(function focusItem(removedIndex) {
+ MS.Entertainment.Pages.assert(removedIndex > -1, "Unexpected item removed index");
+ if (this._galleryView && !this._unloaded) {
+ var items = WinJS.Utilities.query("[data-ent-type~='removableGalleryItem']", this._galleryView.domElement);
+ if (items && items.length) {
+ var itemToFocus = items[removedIndex] || items[items.length - 1];
+ if (itemToFocus)
+ itemToFocus.focus()
+ }
+ }
+ }.bind(this))
+ }
+ }
+ }, {}, {})});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Video2Recommendations: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MarketplacePageWithRemoveButton", "/Components/Video/VideoMarketplaceTemplates.html#recommendationsGalleryTemplate", null, {}, {}, {
+ tvSeriesRecommendationsTemplateSize: 440, movieRecommendationsTemplateSize: 324, computeRecommendationsItemSize: function computeRecommendationsItemSize(item) {
+ var itemType = WinJS.Utilities.getMember("actionType.mediaType", item) || item.mediaType;
+ switch (itemType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ return MS.Entertainment.ViewModels.VideoMarketplace.tvSeriesLowDensityCardTemplateSize;
+ default:
+ return MS.Entertainment.ViewModels.VideoMarketplace.movieLowDensityCardTemplateSize
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Pages", {Video2Watchlist: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.Pages.MarketplacePageWithRemoveButton", "/Components/Video/VideoMarketplaceTemplates.html#watchlistGalleryTemplate", function video2Watchlist() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.watchlistService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.watchlistService).initialize()
+ }, {
+ _lastSelectedIndex: 0, freeze: function freeze() {
+ if (this._galleryView && !this._unloaded) {
+ var selectedElement = WinJS.Utilities.query(".template-verticalCardTile:focus", this._galleryView.domElement);
+ if (selectedElement && selectedElement[0]) {
+ this._lastSelectedIndex = this._galleryView.getIndexForElement(selectedElement[0]);
+ this._galleryView.focusFirstItemOnRender = false
+ }
+ }
+ MS.Entertainment.Pages.MarketplacePageWithRemoveButton.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.Pages.MarketplacePageWithRemoveButton.prototype.thaw.call(this);
+ WinJS.Promise.timeout(200).then(function restoreFocus() {
+ if (this._galleryView && !this._unloaded) {
+ var items = WinJS.Utilities.query(".template-verticalCardTile", this._galleryView.domElement);
+ if (items && items.length) {
+ var itemToFocus = items[this._lastSelectedIndex] || items[0];
+ if (itemToFocus)
+ itemToFocus.focus()
+ }
+ }
+ }.bind(this))
+ }
+ }, {}, {computeWatchlistHubItemSize: function computeWatchlistHubItemSize(item, itemIndex) {
+ itemIndex = itemIndex || 0;
+ var itemType = WinJS.Utilities.getMember("mediaType", item);
+ switch (itemType) {
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ return MS.Entertainment.ViewModels.VideoMarketplace.tvSeriesWatchlistGalleryWidth;
+ default:
+ return MS.Entertainment.ViewModels.VideoMarketplace.movieWatchlistGalleryWidth
+ }
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VerticalCardGalleryItem: MS.Entertainment.UI.Framework.defineUserControl(null, function VerticalCardGalleryItem(){}, {
+ mediaItem: null, frozen: false, _showPopoverPromise: null, freeze: function freeze() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ if (this._showPopoverPromise) {
+ this._showPopoverPromise.cancel();
+ this._showPopoverPromise = null
+ }
+ this.frozen = true
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this.frozen = false
+ }, _onClick: function _onClick() {
+ var initialPreferences = {};
+ if (MS.Entertainment.Utilities.isVideoApp2 && this.mediaItem && this.mediaItem.bundleOffer) {
+ if (this.mediaItem.bundleOffer.videoDefinition)
+ initialPreferences.preferredVideoResolution = this._getVideoDefinitionFromResolutionFormat(this.mediaItem.bundleOffer.videoDefinition);
+ if (this.mediaItem.bundleOffer.primaryAudioLanguage)
+ initialPreferences.preferredLanguage = this.mediaItem.bundleOffer.primaryAudioLanguage
+ }
+ if (MS.Entertainment.Utilities.isApp2 && MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.mediaItem)) {
+ if (this._showPopoverPromise)
+ return;
+ this._showPopoverPromise = this.mediaItem.hydrate().then(function hydrateSeries(mediaItem) {
+ if (!mediaItem.hydrated)
+ return WinJS.Promise.wrapError(new Error("mediaItem not hydrated"));
+ var seriesItem = MS.Entertainment.Utilities.convertMediaItemToTvSeries(mediaItem);
+ return seriesItem.hydrate()
+ }).then(function openEpisode(seriesItem) {
+ if (!seriesItem.hydrated)
+ return WinJS.Promise.wrapError(new Error("seriesItem not hydrated"));
+ return MS.Entertainment.Video2.EpisodeDetailsOverlay.show(this.mediaItem, {}, seriesItem, initialPreferences)
+ }.bind(this));
+ this._showPopoverPromise.done(function() {
+ this._showPopoverPromise = null
+ }.bind(this), function() {
+ this._showPopoverPromise = null
+ }.bind(this))
+ }
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({
+ dataContext: {
+ data: this.mediaItem, preferences: initialPreferences
+ }, itemConstructor: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ })
+ }, _getVideoDefinitionFromResolutionFormat: function _getVideoDefinitionFromResolutionFormat(resolutionFormat) {
+ var edsResolutionFormats = MS.Entertainment.Data.Augmenter.Marketplace.edsResolutionFormat;
+ var videoDefinition;
+ if (resolutionFormat === edsResolutionFormats.hd1080p || resolutionFormat === edsResolutionFormats.hd)
+ videoDefinition = MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd;
+ else if (resolutionFormat === edsResolutionFormats.sd || resolutionFormat === edsResolutionFormats.xd)
+ videoDefinition = MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd;
+ else
+ MS.Entertainment.UI.Controls.fail("Resolution format '{0}'not recognized".format(resolutionFormat));
+ return videoDefinition
+ }
+ }, {}, {
+ templates: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ var templates = ["/Components/Video/VideoMarketplaceTemplates.html#featuredSetsTVTemplate", "/Components/Video/VideoMarketplaceTemplates.html#featuredSetsMovieTemplate", "/Components/Video/VideoMarketplaceTemplates.html#video1FeaturedSetTemplate", "/Components/Video/VideoMarketplaceTemplates.html#bundledTvVerticalItemTemplate", "/Components/Video/VideoMarketplaceTemplates.html#tvVerticalItemTemplate", "/Components/Video/VideoMarketplaceTemplates.html#bundledMovieVerticalItemTemplate", "/Components/Video/VideoMarketplaceTemplates.html#movieVerticalItemTemplate", "/Components/Video/VideoMarketplaceTemplates.html#featuredSetItemTemplate", "/Components/Video/VideoMarketplaceTemplates.html#castVerticalItemTemplate", ];
+ return templates
+ }), selectVerticalItemTemplate: function selectVerticalItemTemplate(item) {
+ var template = String.empty;
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(item))
+ template = "/Components/Video/VideoMarketplaceTemplates.html#featuredSetsTVTemplate";
+ else if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ template = "/Components/Video/VideoMarketplaceTemplates.html#featuredSetsMovieTemplate";
+ else if (item.type === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub)
+ template = "/Components/Video/VideoMarketplaceTemplates.html#video1FeaturedSetTemplate"
+ }
+ else if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(item))
+ if (item.isPartOfBundle)
+ template = "/Components/Video/VideoMarketplaceTemplates.html#bundledTvVerticalItemTemplate";
+ else
+ template = "/Components/Video/VideoMarketplaceTemplates.html#tvVerticalItemTemplate";
+ else if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.video)
+ if (item.isPartOfBundle)
+ template = "/Components/Video/VideoMarketplaceTemplates.html#bundledMovieVerticalItemTemplate";
+ else
+ template = "/Components/Video/VideoMarketplaceTemplates.html#movieVerticalItemTemplate";
+ else if (item.type === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub)
+ template = "/Components/Video/VideoMarketplaceTemplates.html#featuredSetItemTemplate";
+ else if (item.studio || item.network)
+ template = "/Components/Video/VideoMarketplaceTemplates.html#studioAndNetworkGalleryItemTemplate";
+ else
+ template = "/Components/Video/VideoMarketplaceTemplates.html#castVerticalItemTemplate";
+ if (!template)
+ return WinJS.Promise.wrapError(new Error("Unsupported item for Video1 Featured Sets."));
+ return MS.Entertainment.UI.Framework.loadTemplate(template, null, true)
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VerticalGalleryItemWithRemoveButton: MS.Entertainment.UI.Framework.defineUserControl(null, function verticalGalleryItemWithRemoveButton(element) {
+ if (element && element.parentElement)
+ this.containerElement = element.parentElement
+ }, {
+ mediaItem: null, containerElement: null, _onClick: function _onClick() {
+ MS.Entertainment.Platform.PlaybackHelpers.showItemDetails({
+ dataContext: {data: this.mediaItem}, itemConstructor: MS.Entertainment.Utilities.getTvInlineDetailsPopoverControl()
+ })
+ }, _onFocusIn: function _onFocusIn() {
+ if (this.containerElement)
+ WinJS.Utilities.addClass(this.containerElement, "focused")
+ }, _onFocusOut: function _onFocusOut() {
+ if (this.containerElement)
+ WinJS.Utilities.removeClass(this.containerElement, "focused")
+ }
+ }, {}, {})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VerticalRecommendationsGalleryItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalGalleryItemWithRemoveButton", null, function VerticalRecommendationsGalleryItem(element){}, {}, {}, {selectRecommendationsItemTemplate: function selectRecommendationsItemTemplate(item) {
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ var template = "/Components/Video/VideoMarketplaceTemplates.html#movieRecommendationsItemTemplate";
+ if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(item))
+ template = "/Components/Video/VideoMarketplaceTemplates.html#tvRecommendationsItemTemplate";
+ return MS.Entertainment.UI.Framework.loadTemplate(template, null, true).then(function(templateControl) {
+ return templateControl
+ })
+ }
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VerticalWatchlistsGalleryItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalGalleryItemWithRemoveButton", null, function VerticalWatchlistsGalleryItem(element){}, {}, {}, {
+ templates: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ var templates = ["/Components/Video/VideoMarketplaceTemplates.html#movieWatchlistsItemTemplate", "/Components/Video/VideoMarketplaceTemplates.html#tvWatchlistsItemTemplate", ];
+ return templates
+ }), selectWatchlistItemTemplate: function selectWatchlistItemTemplate(item) {
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ var template = "/Components/Video/VideoMarketplaceTemplates.html#movieWatchlistsItemTemplate";
+ if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(item))
+ template = "/Components/Video/VideoMarketplaceTemplates.html#tvWatchlistsItemTemplate";
+ return MS.Entertainment.UI.Framework.loadTemplate(template, null, true).then(function(templateControl) {
+ return templateControl
+ })
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MovieVerticalItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalCardGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#largeMovieTitleRatingTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BundledVerticalItemBase: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalCardGalleryItem", null, function bundledVerticalItem() {
+ this._marketplaceEvents = MS.Entertainment.Utilities.addEventHandlers(Microsoft.Entertainment.Marketplace.Marketplace, {mediarightchanged: this._mediaRightChanged.bind(this)})
+ }, {
+ _isOwned: null, _marketplaceEvents: null, _updateMediaItemPromise: null, _mediaRightChangedPromise: null, _mediaItemBinding: null, initialize: function initialize() {
+ this._updatePrimaryText();
+ this._updateMediaItem();
+ this._mediaItemBinding = WinJS.Binding.bind(this.mediaItem, {bundleOffer: this._updateSecondaryText.bind(this)})
+ }, unload: function unload() {
+ if (this._marketplaceEvents) {
+ this._marketplaceEvents.cancel();
+ this._marketplaceEvents = null
+ }
+ if (this._updateMediaItemPromise) {
+ this._updateMediaItemPromise.cancel();
+ this._updateMediaItemPromise = null
+ }
+ if (this._mediaRightChangedPromise) {
+ this._mediaRightChangedPromise.cancel();
+ this._mediaRightChangedPromise = null
+ }
+ if (this._mediaItemBinding) {
+ this._mediaItemBinding.cancel();
+ this._mediaItemBinding = null
+ }
+ MS.Entertainment.UI.Controls.VerticalCardGalleryItem.prototype.unload.call(this)
+ }, _updateMediaItem: function _updateMediaItem(forceUpdate) {
+ if (this._unloaded || !this.mediaItem)
+ return;
+ if (this._updateMediaItemPromise) {
+ this._updateMediaItemPromise.cancel();
+ this._updateMediaItemPromise = null
+ }
+ var hydrateOptions = {isPartOfBundle: true};
+ var hydrateMediaItemPromise = WinJS.Promise.wrap();
+ if (forceUpdate && this.mediaItem.refresh)
+ hydrateMediaItemPromise = this.mediaItem.refresh(hydrateOptions);
+ else if (this.mediaItem.hydrate && !this.mediaItem.hydrated)
+ hydrateMediaItemPromise = this.mediaItem.hydrate(hydrateOptions);
+ this._updateMediaItemPromise = hydrateMediaItemPromise.then(function onHydrateMediaItem() {
+ var hydrateFirstEpisodePromise = WinJS.Promise.wrap();
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(this.mediaItem) && this.mediaItem.firstEpisode && this.mediaItem.firstEpisode.hydrate && !this.mediaItem.firstEpisode.hydrated)
+ hydrateFirstEpisodePromise = this.mediaItem.firstEpisode.hydrate();
+ return hydrateFirstEpisodePromise
+ }.bind(this)).then(function onHydrateEpisode() {
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(this.mediaItem))
+ return MS.Entertainment.ViewModels.SmartBuyStateEngine.getMarketplaceFileAccessAsync(this.mediaItem).then(function stateInfoToIsOwned(stateInfo) {
+ return WinJS.Promise.wrap(stateInfo && (stateInfo.hasPurchased > 0 || stateInfo.hasPurchasedSeason))
+ });
+ else
+ return WinJS.Promise.wrap(this.mediaItem.inCollection)
+ }.bind(this)).then(function updateOwnedAndRatingItem(isOwned) {
+ if (this._isOwned === null || this._isOwned !== isOwned) {
+ this._isOwned = isOwned;
+ this._updateSecondaryText()
+ }
+ var ratingItemHydratePromise = WinJS.Promise.wrap();
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(this.mediaItem) || MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.mediaItem)) {
+ var seriesItem = MS.Entertainment.Utilities.convertMediaItemToTvSeries(this.mediaItem);
+ ratingItemHydratePromise = seriesItem.hydrate().then(function seriesItemHydrated(series) {
+ this.ratingItem = series
+ }.bind(this))
+ }
+ else
+ this.ratingItem = this.mediaItem;
+ return ratingItemHydratePromise
+ }.bind(this)).then(function complete() {
+ this._updateMediaItemPromise = null
+ }.bind(this), function onError(error) {
+ this._updateMediaItemPromise = null;
+ if (!WinJS.Promise.isCanceledError(error))
+ return WinJS.Promise.wrapError(error);
+ return null
+ }.bind(this))
+ }, _mediaRightChanged: function _mediaRightChanged(serviceMediaId) {
+ if (this._unloaded || !this.mediaItem)
+ return;
+ if (this._mediaRightChangedPromise) {
+ this._mediaRightChangedPromise.cancel();
+ this._mediaRightChangedPromise = null
+ }
+ this._mediaRightChangedPromise = MS.Entertainment.ViewModels.SmartBuyStateEngine.mediaContainsServiceMediaIdAsync(this.mediaItem, serviceMediaId).then(function onMediaContainsServiceIdComplete(containsServiceId) {
+ if (this._unloaded || !this.mediaItem || !containsServiceId)
+ return;
+ return this._updateMediaItem(true)
+ }.bind(this)).then(function() {
+ this._mediaRightChangedPromise = null
+ }.bind(this), function onError(error) {
+ this._mediaRightChangedPromise = null;
+ if (!WinJS.Promise.isCanceledError(error))
+ return WinJS.Promise.wrapError(error);
+ return null
+ }.bind(this))
+ }, _updatePrimaryText: function _updatePrimaryText() {
+ if (this.mediaItem.primaryText)
+ this.primaryText = this.mediaItem.primaryText;
+ else
+ this.primaryText = String.empty
+ }, _updateSecondaryText: function _updateSecondaryText() {
+ if (this._isOwned)
+ this.secondaryText = String.load(String.id.IDS_VIDEO_IN_COLLECTION_LABEL);
+ else if (this.mediaItem.bundleOffer) {
+ var currentVideoDefinition = this.mediaItem.bundleOffer.videoDefinition;
+ var currentPrimaryAudioLanguage;
+ var variousLanguages = true;
+ if (this.mediaItem.bundleOffer.primaryAudioLanguage && this.mediaItem.bundleOffer.primaryAudioLanguage.toUpperCase() !== MS.Entertainment.Utilities.VARIOUS_LANGUAGES_CODE.toUpperCase()) {
+ currentPrimaryAudioLanguage = this.mediaItem.bundleOffer.primaryAudioLanguage;
+ variousLanguages = false
+ }
+ var isSeason = MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(this.mediaItem);
+ var isMovie = MS.Entertainment.Platform.PlaybackHelpers.isMovie(this.mediaItem);
+ var selectedOffer = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultBuyOffer(this.mediaItem, isSeason, currentVideoDefinition, currentPrimaryAudioLanguage);
+ if (!selectedOffer) {
+ var matchingOfferId;
+ var bundledItemOffers = this.mediaItem.bundleOffer.bundledItems;
+ for (var i = 0; i < bundledItemOffers.length; i++)
+ if (bundledItemOffers[i].mid.toUpperCase() === this.mediaItem.zuneId.toUpperCase()) {
+ matchingOfferId = bundledItemOffers[i].offerId;
+ break
+ }
+ var rights;
+ if (isMovie)
+ rights = this.mediaItem.unfilteredRights;
+ else
+ rights = this.mediaItem.rights;
+ if (matchingOfferId) {
+ var matchingOffers = [];
+ for (var i = 0; i < rights.length; i++) {
+ var currentOffer = rights[i];
+ if (currentOffer.offerId && currentOffer.offerId.toUpperCase() === matchingOfferId.toUpperCase())
+ matchingOffers.push(currentOffer)
+ }
+ }
+ if (matchingOffers && matchingOffers.length > 0) {
+ var bundledMediaItem = this.mediaItem.clone();
+ bundledMediaItem.rights = matchingOffers;
+ selectedOffer = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getDefaultBuyOffer(bundledMediaItem, isSeason, currentVideoDefinition, currentPrimaryAudioLanguage, true)
+ }
+ }
+ if (selectedOffer) {
+ this.secondaryText = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getPriceString(selectedOffer);
+ if (selectedOffer.primaryAudioLanguage && variousLanguages)
+ this.languageText = MS.Entertainment.Utilities.getDisplayLanguageFromLanguageCode(selectedOffer.primaryAudioLanguage);
+ else
+ this.languageText = String.empty
+ }
+ }
+ }
+ }, {
+ primaryText: String.empty, secondaryText: String.empty, languageText: String.empty, ratingItem: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BundledMovieVerticalItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BundledVerticalItemBase", "/Components/Video/VideoMarketplaceTemplates.html#largeBundledMovieTitlePriceRatingTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BundledTvVerticalItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.BundledVerticalItemBase", "/Components/Video/VideoMarketplaceTemplates.html#largeBundledTvTitlePriceTemplate", null, {_updatePrimaryText: function _updatePrimaryText() {
+ if (this.mediaItem.seriesTitle)
+ this.primaryText = String.load(String.id.IDS_APP2_PAGE_TITLE_PRIMARY).format(this.mediaItem.seriesTitle, this.mediaItem.primaryText);
+ else
+ MS.Entertainment.UI.Controls.BundledVerticalItemBase.prototype._updatePrimaryText.call(this)
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MovieRecommendationsItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalRecommendationsGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#largeMovieRecommendationsTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MovieWatchlistItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalWatchlistsGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#largeMovieWatchlistItemTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TvVerticalItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalCardGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#largeTvTitleRatingTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TvRecommendationsItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalRecommendationsGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#largeTvRecommendationsTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TvWatchlistItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalWatchlistsGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#largeTvWatchlistsTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MarketplaceRemoveButton: MS.Entertainment.UI.Framework.defineUserControl(null, function marketplaceRemoveButton(element) {
+ if (element && element.parentElement)
+ this.containerElement = element.parentElement
+ }, {
+ mediaItem: null, containerElement: null, _hideContainerElement: function _hideContainerElement() {
+ if (this.containerElement)
+ return MS.Entertainment.Utilities.hideElement(this.containerElement);
+ else
+ return WinJS.Promise.wrap()
+ }, _dispatchRemoveEvent: function _dispatchRemoveEvent(mediaItem) {
+ var itemsControlElement = WinJS.Utilities.query(".currentPage .watchlistPage .marketplaceGalleryFlex");
+ var itemsControl = itemsControlElement && itemsControlElement[0] && itemsControlElement[0].winControl;
+ MS.Entertainment.UI.Controls.assert(itemsControl, "ItemsControl not found in MarketplaceRemoveButton");
+ if (itemsControl && !this._unloaded)
+ itemsControl.dispatchEvent(MS.Entertainment.UI.Controls.MarketplaceRemoveButton.events.removeItem, {
+ sender: this, mediaItem: mediaItem
+ })
+ }, _onFocusIn: function _onFocusIn() {
+ if (this.containerElement)
+ WinJS.Utilities.addClass(this.containerElement, "focused")
+ }, _onFocusOut: function _onFocusOut() {
+ if (this.containerElement)
+ WinJS.Utilities.removeClass(this.containerElement, "focused")
+ }
+ }, {}, {events: {removeItem: "removeItem"}})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {RecommendationsNotInterestedButton: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MarketplaceRemoveButton", "/Components/Video/VideoMarketplaceTemplates.html#recommendationsNotInterestedTemplate", function recommendationsNotInterestedButton(element){}, {
+ mediaItem: null, _onClick: function _onClick() {
+ if (this.mediaItem) {
+ MS.Entertainment.Utilities.addNotInterestedRecommendationsItem(this.mediaItem);
+ this._hideContainerElement().then(function fireNotInterested() {
+ this._dispatchRemoveEvent(this.mediaItem)
+ }.bind(this));
+ MS.Entertainment.Utilities.postNotInterestedRecommendationsItem(this.mediaItem)
+ }
+ }
+ }, {}, {})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {WatchlistRemoveButton: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MarketplaceRemoveButton", "/Components/Video/VideoMarketplaceTemplates.html#watchlistRemoveButtonTemplate", function watchlistRemoveButton(element){}, {
+ mediaItem: null, _onClick: function _onClick() {
+ if (this.mediaItem) {
+ this._hideContainerElement().then(function fireWatchlistRemove() {
+ this._dispatchRemoveEvent(this.mediaItem)
+ }.bind(this));
+ var watchlistService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.watchlistService);
+ watchlistService.removeItemFromWatchlist(this.mediaItem)
+ }
+ }
+ }, {}, {})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {Video1FeaturedSetMediaItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalCardGalleryItem", null, null, {
+ _onClick: function _onClick() {
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(this.mediaItem)
+ }, _onFocusIn: function _onFocusIn(event) {
+ var galleryScroller = document.querySelector(".currentPage .marketplace.marketplaceGalleryView.marketplaceGallery.flexHubPage");
+ MS.Entertainment.Pages.assert(galleryScroller, "no scroll container found for Video 1 Featured Sets");
+ if (!galleryScroller)
+ return;
+ var itemsToCheck = [];
+ var elementsInItemsControl = galleryScroller.querySelectorAll(".win-focusable");
+ if (elementsInItemsControl && elementsInItemsControl.length) {
+ var itemsToCheck = [elementsInItemsControl[0]];
+ var firstItemLeft = WinJS.Utilities.getPosition(elementsInItemsControl[0]).left;
+ for (var i = 1; i < elementsInItemsControl.length; i++) {
+ var itemLeft = WinJS.Utilities.getPosition(elementsInItemsControl[i]).left;
+ if (itemLeft === firstItemLeft)
+ itemsToCheck.push(elementsInItemsControl[i]);
+ else
+ break
+ }
+ for (var j = 0; j < itemsToCheck.length; j++)
+ if (event && event.target === itemsToCheck[j])
+ galleryScroller.scrollLeft = 0
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FeaturedSetMovieItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Video1FeaturedSetMediaItem", "/Components/Video/VideoMarketplaceTemplates.html#featuredSetsMovieCardItemTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FeaturedSetTVItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Video1FeaturedSetMediaItem", "/Components/Video/VideoMarketplaceTemplates.html#featuredSetsTVCardItemTemplate")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {CastVerticalItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalCardGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#largeCastTemplate", null, {_onClick: function _onClick() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateTo(MS.Entertainment.UI.Monikers.actorDetailsPage, null, null, {mediaItem: this.mediaItem}, true)
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FeaturedSetItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Video1FeaturedSetMediaItem", "/Components/Video/VideoMarketplaceTemplates.html#wideFeaturedSetItemTemplate", null, {_onClick: function _onClick() {
+ if (this.mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.editorial) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var featuredSetAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.featuredSetsNavigate);
+ featuredSetAction.parameter = {
+ page: MS.Entertainment.UI.Monikers.flexHubPage, targetFeed: this.mediaItem.actionTarget
+ };
+ featuredSetAction.execute()
+ }
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {StudioAndNetworkGalleryItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalCardGalleryItem", "/Components/Video/VideoMarketplaceTemplates.html#studioAndNetworkGalleryWideItemTemplate", null, {_onClick: function _onClick() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var navigateAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.videoMarketplaceNavigate);
+ if (this.mediaItem.studio)
+ navigateAction.parameter = {
+ moniker: MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, page: MS.Entertainment.UI.Monikers.movieMarketplace, hub: MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, args: {
+ selectHub: true, selectSecondaryModifier: this.mediaItem.studio
+ }
+ };
+ else if (this.mediaItem.network)
+ navigateAction.parameter = {
+ moniker: MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases, page: MS.Entertainment.UI.Monikers.tvMarketplace, hub: MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases, args: {
+ selectHub: true, selectSecondaryModifier: this.mediaItem.network
+ }
+ };
+ else {
+ MS.Entertainment.UI.Actions.fail("Media Item is not a network or a studio");
+ return
+ }
+ navigateAction.execute()
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {Video1FeaturedSetItem: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.FeaturedSetItem", "/Components/Video/VideoMarketplaceTemplates.html#video1FeaturedSetItemTemplate")})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video/VideoSpotlight.js b/packages/microsoft.zunevideo/ViewModels/Video/VideoSpotlight.js
new file mode 100644
index 00000000..14cfda85
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video/VideoSpotlight.js
@@ -0,0 +1,21 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.ViewModels", {VideoSpotlight: MS.Entertainment.UI.Framework.define(function videoSpotlightConstructor()
+ {
+ var query = new MS.Entertainment.Data.Query.videoSpotlightQuery;
+ query.queryId = MS.Entertainment.UI.Monikers.homeSpotlight;
+ this.viewModel = new MS.Entertainment.ViewModels.SpotlightViewModel(query);
+ this.viewModel.maxItems = 5;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ this.viewModel.getItems();
+ this.viewModel.isFeatureEnabled = true
+ }
+ this.panelAction = new MS.Entertainment.UI.Actions.Action;
+ this.panelAction.isEnabled = false
+ }, {
+ viewModel: null, doNotRaisePanelReady: true, features: null, panelAction: null
+ }, {startupVideoSpotlight: null})})
+})()
diff --git a/packages/microsoft.zunevideo/ViewModels/Video_Win/EpisodeDetailsViewModel.js b/packages/microsoft.zunevideo/ViewModels/Video_Win/EpisodeDetailsViewModel.js
new file mode 100644
index 00000000..3778855a
--- /dev/null
+++ b/packages/microsoft.zunevideo/ViewModels/Video_Win/EpisodeDetailsViewModel.js
@@ -0,0 +1,119 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var EpisodeDetailsViewModel = (function(_super) {
+ __extends(EpisodeDetailsViewModel, _super);
+ function EpisodeDetailsViewModel(mediaItem, initialPreferences) {
+ Trace.assert(mediaItem, "EpisodeDetailsViewModel::ctor(): Invalid media item provided.");
+ this.mediaItem = mediaItem;
+ _super.call(this, initialPreferences)
+ }
+ EpisodeDetailsViewModel.create = function(mediaItem, initialPreferences) {
+ if (!mediaItem || !Entertainment.Utilities.isTVEpisode(mediaItem)) {
+ Trace.fail("Could not create EpisodeDetailsViewModel");
+ return null
+ }
+ return new EpisodeDetailsViewModel(mediaItem, initialPreferences)
+ };
+ Object.defineProperty(EpisodeDetailsViewModel.prototype, "primaryHeaderButtons", {
+ get: function() {
+ return this._primaryHeaderButtons
+ }, set: function(value) {
+ this.updateAndNotify("primaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EpisodeDetailsViewModel.prototype, "secondaryHeaderButtons", {
+ get: function() {
+ return this._secondaryHeaderButtons
+ }, set: function(value) {
+ this.updateAndNotify("secondaryHeaderButtons", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EpisodeDetailsViewModel.prototype, "network", {
+ get: function() {
+ return this._network
+ }, set: function(value) {
+ this.updateAndNotify("network", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EpisodeDetailsViewModel.prototype, "title", {
+ get: function() {
+ return this._title
+ }, set: function(value) {
+ this.updateAndNotify("title", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(EpisodeDetailsViewModel.prototype, "subTitle", {
+ get: function() {
+ return this._subTitle
+ }, set: function(value) {
+ this.updateAndNotify("subTitle", value)
+ }, enumerable: true, configurable: true
+ });
+ EpisodeDetailsViewModel.prototype._initializeModules = function() {
+ this.modules = []
+ };
+ EpisodeDetailsViewModel.prototype.loadModules = function() {
+ _super.prototype.loadModules.call(this);
+ this.viewStateViewModel.viewState = 2
+ };
+ EpisodeDetailsViewModel.prototype._getSmartBuyEngineButtons = function() {
+ return MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDetailsButtons(this.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.canvas)
+ };
+ EpisodeDetailsViewModel.prototype._getSmartBuyEngineEventHandler = function() {
+ var _this = this;
+ return function(engine, stateInfo) {
+ var getStatePromise;
+ if (_this._smartBuyStateEngine)
+ getStatePromise = _this._smartBuyStateEngine.onVideoVerticalDetailsStateChanged(stateInfo).then(function(buttonState) {
+ _this._refreshPurchaseDetailsString(stateInfo);
+ return buttonState
+ });
+ return WinJS.Promise.as(getStatePromise)
+ }
+ };
+ EpisodeDetailsViewModel.prototype._refreshDetailString = function() {
+ if (!this.mediaItem)
+ return;
+ _super.prototype._refreshDetailsStrings.call(this);
+ var episode = this.mediaItem;
+ this.network = episode.networks ? MS.Entertainment.Formatters.formatGenresListNonConverter(episode.networks) : String.empty;
+ var formattedSeasonNumber = String.load(String.id.IDS_TV_SEASON_NAME).format(episode.formattedSeasonNumber);
+ if (episode.episodeNumber > 0)
+ this.title = String.load(String.id.IDS_VIDEO_LX_DETAILS_HEADER_EPISODE_TITLE).format(episode.episodeNumber, episode.name);
+ else
+ this.title = episode.name;
+ if (episode.seasonNumber > 0)
+ this.subTitle = String.load(String.id.IDS_VIDEO_LX_DETAILS_HEADER_SERIES_SEASON_SUBTITLE).format(episode.seriesTitle, formattedSeasonNumber);
+ else
+ this.subTitle = episode.seriesTitle
+ };
+ EpisodeDetailsViewModel.prototype._refreshPurchaseDetailsString = function(stateInfo){};
+ EpisodeDetailsViewModel.prototype._reloadFilteredModules = function(){};
+ EpisodeDetailsViewModel.prototype._updateFilterDetails = function(){};
+ EpisodeDetailsViewModel.prototype._onButtonsChanged = function() {
+ if (!this.disposed && this._smartBuyStateEngine) {
+ this.primaryHeaderButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.VideoDetailsActionLocations.primaryHeader);
+ this.secondaryHeaderButtons = this._smartBuyStateEngine.getCurrentButtonsForLocation(ViewModels.VideoDetailsActionLocations.secondaryHeader)
+ }
+ };
+ return EpisodeDetailsViewModel
+ })(ViewModels.VideoDetailsViewModelBase);
+ ViewModels.EpisodeDetailsViewModel = EpisodeDetailsViewModel
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/WarmupCode.js b/packages/microsoft.zunevideo/WarmupCode.js
new file mode 100644
index 00000000..7dc07c2e
--- /dev/null
+++ b/packages/microsoft.zunevideo/WarmupCode.js
@@ -0,0 +1,25 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ try {
+ if (Windows && !Windows.Xbox && Windows.Storage && Windows.Storage.ApplicationData && Windows.Storage.ApplicationData.current && Windows.Storage.ApplicationData.current.roamingSettings)
+ var roamingSettings = Windows.Storage.ApplicationData.current.roamingSettings
+ }
+ catch(e) {
+ debugger;
+ var shipAssertProvider = new Microsoft.Entertainment.Infrastructure.ShipAssertProvider;
+ shipAssertProvider.shipAssert("WarmupCode", "WarmupCode()", "WarmupCode()", "Message: " + e.toString() + e.stack, "")
+ }
+ try {
+ var microsoftEntertainmentApplication = Microsoft.Entertainment.Application;
+ var microsoftEntertainmentMarketplaceMarketplace = Microsoft.Entertainment.Marketplace.Marketplace;
+ var microsoftEntertainmentConfigurationConfigurationManager = Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var microsoftEntertainmentInstrumentationProvidersShell = Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ var microsoftEntertainmentInstrumentationProvidersPipeline = Microsoft.Entertainment.Instrumentation.Providers.Pipeline
+ }
+ catch(e) {
+ debugger;
+ var shipAssertProvider = new Microsoft.Entertainment.Infrastructure.ShipAssertProvider;
+ shipAssertProvider.shipAssert("WarmupCode", "WarmupCode()", "WarmupCode()", "Message: " + e.toString() + e.stack, "")
+ }
+})()
diff --git a/packages/microsoft.zunevideo/animations/HubStripAnimations.js b/packages/microsoft.zunevideo/animations/HubStripAnimations.js
new file mode 100644
index 00000000..78fa1f15
--- /dev/null
+++ b/packages/microsoft.zunevideo/animations/HubStripAnimations.js
@@ -0,0 +1,191 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.Animations.HubStrip", {
+ panelContainerClass: "panelContainer", showHubStrip: function showNavigationContainer(navigationContainer, strip) {
+ var navigationContainerPromise = MS.Entertainment.Animations.HubStrip._fadeInNavigationContainer(navigationContainer);
+ var stripPromise = MS.Entertainment.Animations.HubStrip._fadeInStrip(strip);
+ return WinJS.Promise.join([navigationContainerPromise, stripPromise])
+ }, _fadeInNavigationContainer: function _fadeInNavigationContainer(navigationContainer) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ var eventCount = 0;
+ var animationEnd = function(event) {
+ if (event.srcElement === navigationContainer) {
+ eventCount++;
+ if (eventCount === 2) {
+ navigationContainer.removeEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.removeClass(navigationContainer, "navigationContainerStartLocation");
+ WinJS.Utilities.removeClass(navigationContainer, "hubStripFadeIn");
+ completion()
+ }
+ }
+ };
+ if (!MS.Entertainment.ServiceLocator || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled) {
+ WinJS.Utilities.addClass(navigationContainer, "navigationContainerStartLocation");
+ navigationContainer.addEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.addClass(navigationContainer, "hubStripFadeIn");
+ WinJS.Utilities.addClass(navigationContainer, "navigationContainerEndLocation")
+ }
+ else {
+ WinJS.Utilities.addClass(navigationContainer, "navigationContainerEndLocation");
+ completion()
+ }
+ return promise
+ }, _fadeInStrip: function _fadeInStrip(strip) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ var eventCount = 0;
+ var animationEnd = function(event) {
+ if (event.srcElement === strip) {
+ eventCount++;
+ if (eventCount === 2) {
+ strip.removeEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.removeClass(strip, "scrollerStartLocation");
+ WinJS.Utilities.removeClass(strip, "hubStripFadeIn");
+ completion()
+ }
+ }
+ };
+ if (!MS.Entertainment.ServiceLocator || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled) {
+ WinJS.Utilities.addClass(strip, "scrollerStartLocation");
+ strip.addEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.addClass(strip, "hubStripFadeIn");
+ WinJS.Utilities.addClass(strip, "scrollerEndLocation")
+ }
+ else {
+ WinJS.Utilities.addClass(strip, "scrollerEndLocation");
+ completion()
+ }
+ return promise
+ }, _slideInPanelComponents: function _slideInPanelComponents(panel, expand) {
+ var baseDelay = 570;
+ var offsetDelay = 50;
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ var panelContainer = panel.domElement.querySelector(".panelContainer");
+ var panelItems = panel.domElement.querySelectorAll(".secondaryPanelComponent");
+ var subPromises = [];
+ subPromises.push(MS.Entertainment.Animations.HubStrip._togglePanelItemExpansion(panelContainer, expand, 0));
+ var item = null;
+ for (var index = 0; index < panelItems.length; index++) {
+ item = panelItems[index].parentElement;
+ WinJS.Utilities.addClass(item, "collapsed");
+ WinJS.Utilities.addClass(item, "panelItemTransition");
+ var subPromise = MS.Entertainment.Animations.HubStrip._togglePanelItemExpansion(item, expand, (index * offsetDelay) + baseDelay).then(function removeTransition() {
+ WinJS.Utilities.removeClass(item, "panelItemTransition")
+ });
+ subPromises.push(subPromise)
+ }
+ return WinJS.Promise.join(subPromises)
+ }, _togglePanelContainerExpansion: function _togglePanelContainerExpansion(panel, expand) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ var panelContainer = panel.domElement.querySelector(".panelContainer");
+ return MS.Entertainment.Animations.HubStrip._togglePanelItemExpansion(panelContainer, expand, 0)
+ }, _togglePanelItemExpansion: function _togglePanelItemExpansion(panelItem, expand, delay) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ var animationEnd = function animationEnd(event) {
+ if (event.srcElement === panelItem) {
+ panelItem.removeEventListener("transitionend", animationEnd, false);
+ completion()
+ }
+ };
+ var expandCollapse = function expandCollapse() {
+ if (WinJS.Utilities.hasClass(panelItem, "collapsed") && expand) {
+ panelItem.addEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.removeClass(panelItem, "collapsed");
+ WinJS.Utilities.addClass(panelItem, "expanded")
+ }
+ else if (WinJS.Utilities.hasClass(panelItem, "expanded") && !expand) {
+ panelItem.addEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.removeClass(panelItem, "expanded");
+ WinJS.Utilities.addClass(panelItem, "collapsed")
+ }
+ else
+ completion();
+ if (MS.Entertainment.ServiceLocator && !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled)
+ completion()
+ };
+ if (delay && delay > 0)
+ window.setTimeout(function delayExpansion() {
+ expandCollapse()
+ }, delay);
+ else
+ expandCollapse();
+ return promise
+ }, setupDeclarativeAnimsHubStripPanels: function setupDeclarativeAnimsHubStripPanels(activePanelContainer) {
+ var hubScroller = MS.Entertainment.Utilities.findParentElementByClassName(activePanelContainer, "hubStripScroller");
+ if (hubScroller) {
+ hubScroller.setAttribute("data-ent-hideanimation", "exitPage");
+ hubScroller.setAttribute("data-ent-showanimation", "enterPage");
+ WinJS.Utilities.addClass(hubScroller, "enterPageOffset3")
+ }
+ }, scrollHubStrip: function scrollHubStrip(hubStrip, destinationOffset, extraAnimations) {
+ var completion;
+ var extraAnimationsComplete = false;
+ var animationComplete = false;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ function animationEnd(event) {
+ if (event.srcElement === hubStrip._scroller) {
+ hubStrip._scroller.removeEventListener("transitionend", animationEnd, false);
+ hubStrip.animationEnd = null;
+ animationComplete = true;
+ cleanupStrip()
+ }
+ }
+ {};
+ function cleanupStrip() {
+ if (!animationComplete || (extraAnimations && !extraAnimationsComplete))
+ return;
+ WinJS.Utilities.removeClass(hubStrip._scroller, "hubStripScrollTransition");
+ hubStrip._scroller.style.msTransform = "";
+ hubStrip._scroller.style.overflow = "";
+ hubStrip._scroller.scrollLeft = destinationOffset;
+ hubStrip.animating = false;
+ animationComplete = false;
+ completion()
+ }
+ if (!MS.Entertainment.ServiceLocator || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled) {
+ if (!hubStrip.animating) {
+ var offset = hubStrip._scroller.scrollLeft;
+ hubStrip._scroller.style.overflow = "visible";
+ hubStrip._scroller.style.msTransform = "translateX(-" + offset + "px)";
+ hubStrip.animating = true
+ }
+ else {
+ hubStrip._scroller.removeEventListener("transitionend", hubStrip.animationEnd, false);
+ hubStrip.animationEnd = null
+ }
+ hubStrip.animationEnd = animationEnd;
+ hubStrip._scroller.addEventListener("transitionend", animationEnd, false);
+ if (extraAnimations)
+ extraAnimations().then(function completeExtraAnimations() {
+ extraAnimationsComplete = true;
+ cleanupStrip()
+ });
+ WinJS.Utilities.addClass(hubStrip._scroller, "hubStripScrollTransition");
+ hubStrip._scroller.style.msTransform = "translateX(-" + destinationOffset + "px)"
+ }
+ else {
+ hubStrip._scroller.scrollLeft = destinationOffset;
+ completion()
+ }
+ return promise
+ }
+ })
+})()
diff --git a/packages/microsoft.zunevideo/animations/ShellAnimations.css b/packages/microsoft.zunevideo/animations/ShellAnimations.css
new file mode 100644
index 00000000..18ac0cb8
--- /dev/null
+++ b/packages/microsoft.zunevideo/animations/ShellAnimations.css
@@ -0,0 +1,128 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.backButtonFadeIn, .mainHeaderShow
+{
+ animation-name: fadeIn;
+ animation-duration: 500ms;
+ animation-timingfunction: cubic-bezier(.16,1,.23,.98);
+ animation-fill-mode: forwards
+}
+.backButtonFadeOut, .mainHeaderHide
+{
+ animation-name: fadeOut;
+ animation-duration: 500ms;
+ animation-timingfunction: cubic-bezier(.16,1,.23,.98);
+ animation-fill-mode: forwards
+}
+.animFadingNavigationContainer
+{
+ transition-property: opacity;
+ transition-duration: 110ms;
+ transition-timing-function: cubic-bezier(0,0,1,1)
+}
+.animHideModifierControlPopup
+{
+ animation-name: fadeOut;
+ animation-duration: 200ms;
+ animation-timing-function: cubic-bezier(0,0,1,1);
+ animation-fill-mode: forwards
+}
+.modifierPopupBackground
+{
+ opacity: 0;
+ transform: scaleY(0);
+ transition-property: transform,opacity;
+ transition-duration: 600ms,200ms;
+ transition-timing-function: cubic-bezier(.21,1,.19,.98),cubic-bezier(0,0,1,1)
+}
+.modifierPopupBackgroundFinal
+{
+ opacity: 1;
+ transform: scaleY(1)
+}
+.modifierPopupScrollerFinal
+{
+ opacity: 1
+}
+.animModifierPopupEntrySlideIntoPlace
+{
+ transition-property: transform;
+ transition-duration: 100ms;
+ transition-timing-function: cubic-bezier(.21,1,.19,.98)
+}
+.modifierShow
+{
+ animation-name: modifierShowKeys;
+ animation-duration: 1200ms;
+ animation-delay: 800ms;
+ animation-timing-function: cubic-bezier(.16,.99,.22,.99);
+ animation-fill-mode: both
+}
+@keyframes modifierShowKeys
+{
+ 0%
+ {
+ transform: translateX(50px);
+ opacity: 0
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+.primaryPanelModifier .modifierShow
+{
+ animation-name: primaryModifierShowKeys;
+ animation-duration: 800ms;
+ animation-delay: 300ms;
+ animation-timing-function: cubic-bezier(.16,.99,.22,.99);
+ animation-fill-mode: both
+}
+@keyframes primaryModifierShowKeys
+{
+ 0%
+ {
+ transform: translateX(125px);
+ opacity: 0
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+.modifierHide
+{
+ animation-name: modifierHideKeys;
+ animation-duration: 500ms;
+ animation-delay: 0;
+ animation-timing-function: cubic-bezier(.16,.99,.22,.99);
+ animation-fill-mode: both
+}
+@keyframes modifierHideKeys
+{
+ 0%
+ {
+ transform: translateX(-125px);
+ opacity: 0
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+.adCompanion
+{
+ transition-property: transform opacity;
+ transition-duration: 550ms;
+ transition-delay: 167ms;
+ transition-timing-function: cubic-bezier(.1,.9,.2,1);
+ opacity: 0
+}
+.adCompanionSlideIn
+{
+ transform: translateX(-40px);
+ opacity: 1
+}
+html[dir=rtl] .adCompanionSlideIn
+{
+ transform: translateX(40px)
+}
diff --git a/packages/microsoft.zunevideo/animations/SocialAnimations.js b/packages/microsoft.zunevideo/animations/SocialAnimations.js
new file mode 100644
index 00000000..615ef141
--- /dev/null
+++ b/packages/microsoft.zunevideo/animations/SocialAnimations.js
@@ -0,0 +1,45 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.Animations.Social", {
+ enableChatBubbleFade: function enableTextContainerFade(container) {
+ if (!MS.Entertainment.ServiceLocator || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled)
+ if (!WinJS.Utilities.hasClass(container, "hideFromDisplay"))
+ WinJS.Utilities.addClass(container, "hideFromDisplay")
+ }, fadeInContainer: function fadeInContainer(container) {
+ return MS.Entertainment.Animations.Social._fadeContainer(container, true)
+ }, fadeOutContainer: function fadeOutContainer(container) {
+ return MS.Entertainment.Animations.Social._fadeContainer(container, false)
+ }, _fadeContainer: function _fadeContainer(container, fadeIn) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ var transitionEnd = function(event) {
+ container.removeEventListener("transitionend", transitionEnd, false);
+ completion()
+ };
+ if (!MS.Entertainment.ServiceLocator || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled) {
+ if (fadeIn && WinJS.Utilities.hasClass(container, "hideFromDisplay")) {
+ container.addEventListener("transitionend", transitionEnd, false);
+ WinJS.Utilities.addClass(container, "chatBubbleFadeIn");
+ WinJS.Utilities.removeClass(container, "hideFromDisplay")
+ }
+ else if (!fadeIn) {
+ WinJS.Utilities.addClass(container, "hideFromDisplay");
+ WinJS.Utilities.removeClass(container, "chatBubbleFadeIn");
+ completion()
+ }
+ }
+ else {
+ if (fadeIn)
+ WinJS.Utilities.removeClass(container, "hidden");
+ else
+ WinJS.Utilities.addClass(container, "hidden");
+ completion()
+ }
+ return promise
+ }
+ })
+})()
diff --git a/packages/microsoft.zunevideo/animations/animations.css b/packages/microsoft.zunevideo/animations/animations.css
new file mode 100644
index 00000000..0ced3568
--- /dev/null
+++ b/packages/microsoft.zunevideo/animations/animations.css
@@ -0,0 +1,207 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+.fadeIn
+{
+ animation-name: fadeIn;
+ animation-duration: 250ms;
+ animation-timing-function: linear;
+ animation-fill-mode: both
+}
+.fadeOut
+{
+ animation-name: fadeOut;
+ animation-duration: 167ms;
+ animation-timing-function: linear;
+ animation-fill-mode: both
+}
+@keyframes fadeIn
+{
+ 0%
+ {
+ opacity: 0;
+ transform: translatex(0)
+ }
+ 100%
+ {
+ opacity: 1;
+ transform: translatex(0)
+ }
+}
+@keyframes fadeOut
+{
+ 0%
+ {
+ opacity: 1;
+ transform: translatex(0)
+ }
+ 100%
+ {
+ opacity: 0;
+ transform: translatex(0)
+ }
+}
+.enterPage
+{
+ animation-name: baseEnterKeys,baseFadeInKeys;
+ animation-duration: 1000ms,170ms;
+ animation-delay: 167ms,167ms;
+ animation-timing-function: cubic-bezier(.1,.89,.2,1),linear;
+ animation-fill-mode: both
+}
+html[dir=rtl] .enterPage {
+ animation-name: baseEnterKeysRTL,baseFadeInKeys
+}
+.enterPage.enterPageOffset2 {
+ animation-delay: 250ms,250ms
+}
+.enterPage.enterPageOffset3 {
+ animation-delay: 333ms,333ms
+}
+@keyframes baseEnterKeys
+{
+ 0%
+ {
+ transform: translateX(100px)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes baseEnterKeysRTL
+{
+ 0%
+ {
+ transform: translateX(-100px)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes baseFadeInKeys
+{
+ 0%
+ {
+ opacity: 0
+ }
+ 30%
+ {
+ opacity: 0
+ }
+ 100%
+ {
+ opacity: 1
+ }
+}
+.exitPage
+{
+ animation-name: baseExitKeys,baseFadeOutKeys;
+ animation-duration: 167ms,167ms;
+ animation-delay: 0,0;
+ animation-timing-function: linear,linear;
+ animation-fill-mode: both,both
+}
+html[dir=rtl] .exitPage {
+ animation-name: baseExitKeysRTL,baseFadeOutKeys
+}
+@keyframes baseFadeOutKeys
+{
+ 0%
+ {
+ opacity: 1
+ }
+ 100%
+ {
+ opacity: 0
+ }
+}
+@keyframes baseExitKeys
+{
+ 0%
+ {
+ transform: translateX(0)
+ }
+ 100%
+ {
+ transform: translateX(-10px)
+ }
+}
+@keyframes baseExitKeysRTL
+{
+ 0%
+ {
+ transform: translateX(0)
+ }
+ 100%
+ {
+ transform: translateX(10px)
+ }
+}
+.enterContent
+{
+ animation-name: contentEnterKeys,baseFadeInKeys;
+ animation-duration: 550ms,170ms;
+ animation-delay: 167ms,167ms;
+ animation-timing-function: cubic-bezier(.1,.9,.2,1),cubic-bezier(.1,.9,.2,1);
+ animation-fill-mode: both
+}
+html[dir=rtl] .enterContent
+{
+ animation-name: baseEnterKeysRTL,baseFadeInKeys
+}
+.enterContentSnapped
+{
+ animation-name: contentEnterSnappedKeys,baseFadeInKeys;
+ animation-duration: 550ms,170ms;
+ animation-delay: 167ms,167ms;
+ animation-timing-function: cubic-bezier(.1,.9,.2,1),cubic-bezier(.1,.9,.2,1);
+ animation-fill-mode: both
+}
+html[dir=rtl] .enterContentSnapped
+{
+ animation-name: baseEnterSnappedKeysRTL,baseFadeInKeys
+}
+@keyframes contentEnterKeys
+{
+ 0%
+ {
+ transform: translateX(40px)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes contentEnterKeysRTL
+{
+ 0%
+ {
+ transform: translateX(-40px)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes contentEnterSnappedKeys
+{
+ 0%
+ {
+ transform: translateX(20px)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
+@keyframes contentEnterSnappedKeysRTL
+{
+ 0%
+ {
+ transform: translateX(-20px)
+ }
+ 100%
+ {
+ transform: translateX(0)
+ }
+}
diff --git a/packages/microsoft.zunevideo/config.json b/packages/microsoft.zunevideo/config.json
new file mode 100644
index 00000000..c908c532
--- /dev/null
+++ b/packages/microsoft.zunevideo/config.json
@@ -0,0 +1,5 @@
+{
+ "environment" : "",
+ "tmf_environment" : "",
+ "addtotitlehistory" : 0
+}
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/AppBar/BottomAppBar.html b/packages/microsoft.zunevideo/controls/AppBar/BottomAppBar.html
new file mode 100644
index 00000000..670dc649
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/AppBar/BottomAppBar.html
@@ -0,0 +1,81 @@
+
+
+
+
+ BottomAppBar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/AppBar/BottomAppBar.js b/packages/microsoft.zunevideo/controls/AppBar/BottomAppBar.js
new file mode 100644
index 00000000..dd74fcb5
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/AppBar/BottomAppBar.js
@@ -0,0 +1,520 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Components/Playback/Controls/playbackcontrol.js", "/Components/Playback/playbackhelpers.js", "/Framework/corefx.js", "/Framework/imageloader.js", "/Framework/servicelocator.js", "/Framework/utilities.js");
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ BottomAppBar: MS.Entertainment.UI.Framework.defineUserControl("/Controls/AppBar/BottomAppBar.html#bottomAppBarTemplate", function(element, options) {
+ this._handleFocusOnPopoverElement = this._handleFocusOnPopoverElement.bind(this)
+ }, {
+ hideAppBarOnSoftKeyboard: true, _initialized: false, _isNewMusicPage: false, _isNewVideoPage: false, _appbar: null, _sessionMgr: null, _bindings: null, _uiStateService: null, _inputCurrentView: null, _keyboardNavigationManager: null, _eventHandlers: null, _sessionEventHandlers: null, _sticky: undefined, _programmaticallyShown: false, _appBarActionList: null, _metadataControl: null, _transportControls: null, _upsellControls: null, _upsellPlaybackControls: null, _upsellBindings: null, _pendingDeferredInit: false, _deferredUpdateTimer: null, _errorPromise: null, _disabled: false, _actionListBindings: null, initialize: function initialize() {
+ this._appbar = document.querySelector("[data-win-control='WinJS.UI.AppBar']").winControl;
+ this._isNewMusicPage = window.onNewMusicPage;
+ this._isNewVideoPage = window.onNewVideoPage;
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._inputCurrentView = Windows.UI.ViewManagement.InputPane.getForCurrentView();
+ if (this._sticky !== undefined)
+ this._appbar.stick = this._sticky;
+ this._uiStateService.bind("nowPlayingVisible", function _onNowPlayingVisibleChanged() {
+ this._updateStates()
+ }.bind(this));
+ var appBarBeforeShow = function appBarBeforeShowFn() {
+ if (this._appbar) {
+ this._appbar.disabled = this.disabled;
+ if (this._appbar.disabled)
+ this._appbar.hide()
+ }
+ this._updateSize();
+ this._onAppBarEvent("beforeshow")
+ }.bind(this);
+ var appBarAfterShow = function appBarAfterShowFn() {
+ if (WinJS.Utilities.getMember("_appbar.disabled", this)) {
+ this._appbar.hide();
+ return
+ }
+ if (!this._programmaticallyShown)
+ this._keyboardNavigationManager.focusFirstItemInContainer(this.domElement, true);
+ this._programmaticallyShown = false;
+ var userLocation = String.empty;
+ userLocation = MS.Entertainment.Utilities.getCurrentUserLocation();
+ MS.Entertainment.Utilities.Telemetry.logPageView(this.container, {
+ uri: MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.AppBar, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.AppBar
+ }, {uri: userLocation})
+ }.bind(this);
+ this._appbar.addEventListener("beforeshow", appBarBeforeShow, false);
+ this._appbar.addEventListener("aftershow", appBarAfterShow, false);
+ this._appbar.addEventListener("afterhide", function onAppBarAfterHide() {
+ this._onAppBarEvent("afterhide")
+ }.bind(this), false);
+ window.addEventListener("resize", function onWindowSizeChanged() {
+ this._updateSize()
+ }.bind(this));
+ this._keyboardNavigationManager = new MS.Entertainment.Framework.KeyboardNavigationManager(this.domElement);
+ this._initialized = true;
+ this.hide();
+ this._updateStates();
+ if (this._pendingDeferredInit) {
+ this._pendingDeferredInit = false;
+ this.deferredInit()
+ }
+ this._popOverFocusHelper.addEventListener("focus", this._handleFocusOnPopoverElement)
+ }, _handleFocusOnPopoverElement: function _handleFocusOnPopoverElement() {
+ var container = this._containerToRefocusId && document.getElementById(this._containerToRefocusId);
+ if (container && this._appbar.sticky)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(container, true);
+ else {
+ this._containerToRefocusId = null;
+ this._keyboardNavigationManager.focusFirstItemInContainer(this.domElement, true)
+ }
+ }, _containerToRefocusId: null, focusAppBar: function focusAppBar(containerToFocus) {
+ if (containerToFocus) {
+ if (!containerToFocus.id)
+ containerToFocus.id = containerToFocus.uniqueID;
+ this._containerToRefocusId = containerToFocus.id;
+ this._popOverFocusHelper.setAttribute("tabindex", 0)
+ }
+ else
+ this._popOverFocusHelper.setAttribute("tabindex", MS.Entertainment.Utilities.optionsAppTypeTabIndexHelper);
+ this._keyboardNavigationManager.focusFirstItemInContainer(this.domElement, true)
+ }, deferredInit: function deferredInit() {
+ if (!this._initialized) {
+ this._pendingDeferredInit = true;
+ return
+ }
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._uiStateService.bind("primarySessionId", function primarySessionIdChanged() {
+ this.playbackSession = this._sessionMgr.primarySession
+ }.bind(this));
+ this._createActionList();
+ if (!(this._isNewMusicPage || this._isNewVideoPage)) {
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this._createMetadataControl();
+ this._createUpsellControls()
+ }
+ }, _createActionList: function _createActionList() {
+ var container = document.createElement("div");
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.ActionList");
+ MS.Entertainment.UI.Framework.waitForControlToInitialize(container).then(function initAppBarActionList() {
+ var appToolbarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._appBarActionList.items = appToolbarService.currentAppbarActions
+ }.bind(this));
+ this._appBarActionList = new MS.Entertainment.UI.Controls.ActionList(this._actionListContainer.appendChild(container), {adjustButtonSizeForSnappedMode: true});
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.ActionList");
+ this._appBarActionList.bind("workingItems", this._updateSize.bind(this));
+ this._actionListBindings = MS.Entertainment.UI.Framework.addEventHandlers(this._appBarActionList, {itemCountChanged: function appBarActionList_itemCountChanged() {
+ if (this._appbar)
+ this._appbar.disabled = this.disabled
+ }.bind(this)})
+ }, _createMetadataControl: function _createMetadataControl() {
+ var container = document.createElement("div");
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.BottomAppBarNowPlayingMetadata");
+ this._metadataControl = new MS.Entertainment.UI.Controls.BottomAppBarNowPlayingMetadata(this._metadataContainer.domElement.appendChild(container), {});
+ this._metadataControl.playbackSession = this.playbackSession
+ }, _createUpsellControls: function _createUpsellControls() {
+ if (!MS.Entertainment.Utilities.isMusicApp)
+ return;
+ var playPauseAction = new MS.Entertainment.UI.ToolbarAction;
+ playPauseAction.id = "appBarUpsellControlsPlayPause";
+ playPauseAction.automationId = MS.Entertainment.UI.AutomationIds.appBarUpsellPlayPause;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var subscriptionSignupAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionSignup);
+ var actionText = String.load(String.id.IDS_MUSIC_STREAMING_UPSELL_LABEL);
+ subscriptionSignupAction.title = actionText;
+ subscriptionSignupAction.automationId = MS.Entertainment.UI.AutomationIds.appBarSubscriptionSignup;
+ subscriptionSignupAction.icon = MS.Entertainment.UI.Icon.xboxXenonLogo;
+ subscriptionSignupAction.hideDefaultRing = true;
+ subscriptionSignupAction.accessibilityText = actionText;
+ subscriptionSignupAction.parameter = MS.Entertainment.Music.Freeplay.Events.musicPassUpsellAppBarInvoked;
+ WinJS.Utilities.addClass(this._upsellContainer, "appBarUpsellContainer");
+ var updateState = function updateState() {
+ if (!this.playbackSession || !this.playbackSession.isAudioAd || !this._upsellPlaybackControls)
+ return;
+ subscriptionSignupAction.requeryCanExecute();
+ if (this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.playing) {
+ this._upsellPlaybackControls.action.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON);
+ this._upsellPlaybackControls.icon = WinJS.UI.AppBarIcon.pause
+ }
+ else {
+ this._upsellPlaybackControls.action.title = String.load(MS.Entertainment.UI.Controls.TransportControls.playButtonStringId);
+ this._upsellPlaybackControls.icon = MS.Entertainment.UI.Icon.play
+ }
+ }.bind(this);
+ playPauseAction.executed = function playPauseActionExecuted() {
+ if (this.playbackSession && this.playbackSession.targetTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.paused;
+ else
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ updateState()
+ }.bind(this);
+ playPauseAction.canExecute = function playCanExecute(parameter) {
+ return true
+ };
+ this._upsellBindings = WinJS.Binding.bind(this, {playbackSession: {
+ isAudioAd: updateState, currentTransportState: updateState
+ }});
+ var container = document.createElement("div");
+ WinJS.Utilities.addClass(container, "appBarUpsellPlayPauseAction");
+ this._upsellPlaybackControls = new MS.Entertainment.UI.Controls.ActionListButton(this._upsellContainer.appendChild(container), {action: playPauseAction});
+ container = document.createElement("div");
+ WinJS.Utilities.addClass(container, "appBarUpsellAction");
+ this._upsellControls = new MS.Entertainment.UI.Controls.ActionListButton(this._upsellContainer.appendChild(container), {action: subscriptionSignupAction})
+ }, unload: function unload() {
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ if (this._upsellBindings) {
+ this._upsellBindings.cancel();
+ this._upsellBindings = null
+ }
+ if (this._actionListBindings) {
+ this._actionListBindings.cancel();
+ this._actionListBindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, sticky: {
+ get: function sticky_get() {
+ if (!this._appbar)
+ return this._sticky;
+ else
+ return this._appbar.sticky
+ }, set: function sticky_set(value) {
+ if (!this._appbar)
+ this._sticky = value;
+ else
+ this._appbar.sticky = value
+ }
+ }, disabled: {
+ get: function disabled_get() {
+ var isAppBarEmpty = false;
+ if (MS.Entertainment.Utilities.isMusicApp1 || MS.Entertainment.Utilities.isVideoApp1)
+ if (!this._transportControls && !(WinJS.Utilities.getMember("_appBarActionList.items.length", this) > 0))
+ isAppBarEmpty = true;
+ return MS.Entertainment.Utilities.isApp2 || isAppBarEmpty || this._disabled
+ }, set: function disabled_set(value) {
+ this._disabled = value
+ }
+ }, _updateSize: function _updateSize() {
+ if (!this._appBarActionList)
+ return;
+ var clientWidth = this._actionListContainer.clientWidth;
+ if (clientWidth > 0) {
+ this._appBarActionList.containerWidth = clientWidth;
+ if (this._transportControls)
+ this._transportControls.updatePlaybackOptionsActionSet()
+ }
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._sessionEventHandlers) {
+ this._sessionEventHandlers.cancel();
+ this._sessionEventHandlers = null
+ }
+ if (this._inputEventHandlers) {
+ this._inputEventHandlers.cancel();
+ this._inputEventHandlers = null
+ }
+ }, _playbackSessionChanged: function _playbackSessionChanged(newValue, oldValue) {
+ if (oldValue === undefined)
+ return;
+ this._detachBindings();
+ this._sessionEventHandlers = MS.Entertainment.Utilities.addEvents(this.playbackSession, {
+ currentTitleIdChanged: this._titleChanged.bind(this), sessionStateChanged: this._updateStates.bind(this), playerStateChanged: this._playerStateChanged.bind(this), currentMediaChanged: this._mediaChanged.bind(this), currentTransportStateChanged: this._updateStates.bind(this), currentPositionChanged: this._mediaPositionChanged.bind(this), isAudioAdChanged: this._isAudioAdChanged.bind(this), errorDescriptorChanged: this._errorDescriptorChanged.bind(this)
+ });
+ this._titleChanged();
+ this._updateStates();
+ this._playerStateChanged({detail: {newValue: this.playbackSession.playerState}});
+ this._mediaChanged();
+ this._mediaPositionChanged();
+ this._isAudioAdChanged({detail: {newValue: this.playbackSession.isAudioAd}});
+ this._errorDescriptorChanged({detail: {newValue: this.playbackSession.errorDescriptor}});
+ this._bindings = WinJS.Binding.bind(this, {_uiStateService: {
+ primarySessionId: this._updateStates.bind(this), isFullScreenVideo: this._mediaPositionChanged.bind(this), activityOverlayVisible: this._updateStates.bind(this), xboxControllerVisible: this._updateStates.bind(this)
+ }});
+ this._inputEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._inputCurrentView, {
+ showing: function uiStateService_SoftKeyboardShown() {
+ this._onSoftKeyboardOpen(true)
+ }.bind(this), hiding: function uiStateService_SoftKeyboardHiding() {
+ this._onSoftKeyboardOpen(false)
+ }.bind(this)
+ });
+ if (this._transportControls)
+ this._transportControls.playbackSession = this.playbackSession;
+ if (this._metadataControl)
+ this._metadataControl.playbackSession = this.playbackSession;
+ this._updateStates()
+ }, _onSoftKeyboardOpen: function _onSoftKeyboardOpen(newValue) {
+ if (!this._appbar || !this._appbar._element)
+ return;
+ if (this.hideAppBarOnSoftKeyboard && newValue)
+ WinJS.Utilities.addClass(this._appbar._element, "removeFromDisplay");
+ else
+ WinJS.Utilities.removeClass(this._appbar._element, "removeFromDisplay")
+ }, _feedbackButtonClicked: function _feedbackButtonClicked() {
+ MS.Entertainment.UI.Shell.showFeedbackDialog()
+ }, show: function show() {
+ this._programmaticallyShown = true;
+ this.sticky = true;
+ if (this._appbar) {
+ this._appbar.disabled = this.disabled;
+ this._appbar.show();
+ this._updateStates()
+ }
+ }, hide: function hide(suspendActionListChanges) {
+ if (suspendActionListChanges && this.visible && !(MS.Entertainment.Utilities.isMusicApp1 || MS.Entertainment.Utilities.isVideoApp1))
+ this.suspendActionListChanges();
+ if (this._appbar) {
+ this.visible = false;
+ this._appbar.hide();
+ this._updateStates()
+ }
+ this.sticky = false
+ }, repossessNowPlaying: function repossessNowPlaying() {
+ if (this._metadataControl)
+ this._metadataControl.repossessNowPlaying()
+ }, suspendActionListChanges: function suspendActionListChanges() {
+ if (!this._appBarActionList)
+ return;
+ this._appBarActionList.freeze()
+ }, resumeActionListChanges: function resumeActionListChanges() {
+ if (!this._appBarActionList)
+ return;
+ this._appBarActionList.thaw()
+ }, _appBarFocused: function _appBarFocused(e) {
+ WinJS.Promise.timeout().then(function() {
+ if (document.activeElement === this.container)
+ this._keyboardNavigationManager.focusFirstItemInContainer(this.domElement, true)
+ }.bind(this))
+ }, _onAppBarEvent: function _onAppBarEvent(event) {
+ switch (event)
+ {
+ case"beforeshow":
+ this.visible = true;
+ this._mediaPositionChanged();
+ this._updateStates();
+ break;
+ case"afterhide":
+ if (!(MS.Entertainment.Utilities.isMusicApp1 || MS.Entertainment.Utilities.isVideoApp1))
+ this.resumeActionListChanges();
+ this.visible = false;
+ this._updateStates();
+ break
+ }
+ }, _titleChanged: function _titleChanged(e) {
+ if (!this._initialized)
+ return;
+ if (this._metadataControl)
+ this._metadataControl.updateMetadata()
+ }, _mediaChanged: function _mediaChanged(e) {
+ if (!this._initialized)
+ return;
+ if (this._metadataControl)
+ this._metadataControl.updateMetadata()
+ }, _mediaPositionChanged: function _mediaPositionChanged() {
+ if (!this._initialized || !this.playbackSession || !this.visible || this._uiStateService.isFullScreenVideo)
+ return;
+ var durationMs = this.playbackSession.duration;
+ var positionMs = parseInt(this.playbackSession.currentPosition);
+ var value = Math.min(durationMs, positionMs);
+ var max = durationMs;
+ this.progressPercent = (value / max * 100) + "%";
+ if (this._metadataControl)
+ this._metadataControl.updatePositionDuration(value, max)
+ }, _isAudioAdChanged: function _isAudioAdChanged(e) {
+ if (this._isNewMusicPage)
+ return;
+ var newVal = e.detail.newValue;
+ var oldVal = e.detail.oldValue;
+ if (newVal) {
+ WinJS.Utilities.addClass(this._transportControlsContainer, "hideFromDisplay");
+ WinJS.Utilities.removeClass(this._upsellContainer, "hideFromDisplay");
+ this._metadataControl.moreInfoClickUrl = MS.Entertainment.UI.FWLink.advertisementReason;
+ this._metadataControl.moreInfoLinkText = String.load(String.id.IDS_MUSIC_STREAMING_AD_DESC_LINK);
+ this._metadataControl.moreInfoLinkCallback = this._logAudioAdReasonClick.bind(this)
+ }
+ else {
+ WinJS.Utilities.addClass(this._upsellContainer, "hideFromDisplay");
+ WinJS.Utilities.removeClass(this._transportControlsContainer, "hideFromDisplay");
+ this._metadataControl.moreInfoClickUrl = String.empty;
+ this._metadataControl.moreInfoLinkText = String.empty;
+ this._metadataControl.moreInfoLinkCallback = null
+ }
+ }, _logAudioAdReasonClick: function _logAudioAdReasonClick() {
+ var adService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ adService.sendAudioAdReasonClickTelemetryInfo()
+ }, _errorDescriptorChanged: function _errorDescriptorChanged(e) {
+ var newVal = e.detail.newValue;
+ if (MS.Entertainment.Utilities.isMusicApp && newVal)
+ this._updateStates()
+ }, _playerStateChanged: function _playerStateChanged(e) {
+ var newVal = e.detail.newValue;
+ if (newVal === MS.Entertainment.Platform.Playback.PlayerState.error)
+ this._updateStates()
+ }, _updateStates: function _updateStates() {
+ if (this._deferredUpdateTimer || !this._initialized)
+ return;
+ this._appbar.disabled = this.disabled;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ }, _updateStatesDeferred: function _updateStatesDeferred() {
+ this._deferredUpdateTimer = null;
+ if (this._uiStateService.appBarVisible !== this.visible)
+ this._uiStateService.appBarVisible = this.visible;
+ if (!this._uiStateService.isSnapped && !this._uiStateService.activityOverlayVisible && !this._uiStateService.xboxControllerVisible && ((!MS.Entertainment.Utilities.isMusicApp && this._uiStateService.nowPlayingVisible) || !this.playbackSession)) {
+ this.appBarNowPlayingVisible = false;
+ this.appBarNowPlayingProgressVisible = false;
+ this.appBarTransportControlsContainerVisible = !MS.Entertainment.Utilities.useModalNowPlaying || (this.playbackSession && this.playbackSession.currentMedia && this.playbackSession.canControlMedia && this.playbackSession.duration > 0)
+ }
+ else if (this.playbackSession) {
+ this.appBarNowPlayingVisible = !!this.playbackSession.currentMedia && !MS.Entertainment.Utilities.useModalNowPlaying;
+ if (this._metadataControl)
+ this._metadataControl.updateStates();
+ var isValidMedia = this.playbackSession && this.playbackSession.currentMedia && this.playbackSession.canControlMedia && this.playbackSession.duration > 0;
+ this.appBarNowPlayingProgressVisible = isValidMedia && !MS.Entertainment.Utilities.useModalNowPlaying && !this._isNewMusicPage && !this._isNewVideoPage;
+ this.appBarTransportControlsContainerVisible = isValidMedia || !MS.Entertainment.Utilities.useModalNowPlaying
+ }
+ }
+ }, {
+ visible: false, playbackSession: null, appBarNowPlayingVisible: false, appBarNowPlayingProgressVisible: false, appBarTransportControlsContainerVisible: true, progressPercent: 0
+ }, {
+ defaultHideTimeoutMS: 10000, defaultCompanionHideTimeoutMS: 5000
+ }), BottomAppBarNowPlayingMetadata: MS.Entertainment.UI.Framework.defineUserControl("/Controls/AppBar/BottomAppBar.html#bottomAppBarNowPlayingMetadataTemplate", function(element, options){}, {
+ _initialized: false, _sessionMgr: null, _title: String.empty, _metadataArtistAlbumName: String.empty, _metadataSeriesTitle: String.empty, _lastAlbumId: null, moreInfoLinkCallback: null, initialize: function initialize() {
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.bind("playbackSession", this.updateMetadata.bind(this))
+ }, title: {
+ get: function() {
+ return this._title
+ }, set: function(value) {
+ this._title = value;
+ if (this._initialized && !this._unloaded && value !== this._titleText.textContent) {
+ this._titleText.textContent = value;
+ if (value)
+ WinJS.Utilities.removeClass(this._titleText, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._titleText, "removeFromDisplay")
+ }
+ }
+ }, metadataArtistAlbumName: {
+ get: function() {
+ return this._metadataArtistAlbumName
+ }, set: function(value) {
+ this._metadataArtistAlbumName = value;
+ if (this._initialized && !this._unloaded && value !== this._metadataArtistAlbumNameText.textContent) {
+ this._metadataArtistAlbumNameText.textContent = value;
+ if (value)
+ WinJS.Utilities.removeClass(this._metadataArtistAlbumNameText, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._metadataArtistAlbumNameText, "removeFromDisplay")
+ }
+ }
+ }, metadataSeriesTitle: {
+ get: function() {
+ return this._metadataSeriesTitle
+ }, set: function(value) {
+ this._metadataSeriesTitle = value;
+ if (this._initialized && !this._unloaded && value !== this._metadataSeriesTitleText.textContent) {
+ this._metadataSeriesTitleText.textContent = value;
+ if (value)
+ WinJS.Utilities.removeClass(this._metadataSeriesTitleText, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._metadataSeriesTitleText, "removeFromDisplay")
+ }
+ }
+ }, repossessNowPlaying: function repossessNowPlaying() {
+ if (this._sessionMgr)
+ this._sessionMgr.relocateSession(this._nowPlayingThumbnail, false)
+ }, updateMetadata: function updateMetadata() {
+ if (!this.playbackSession)
+ return;
+ if (this.playbackSession.currentMedia) {
+ if (!this.playbackSession.currentMedia.sharesDirectParentWith(this.nowPlayingImageMediaItem)) {
+ this.nowPlayingImageMediaItem = this.playbackSession.currentMedia;
+ this._lastAlbumId = this.playbackSession.currentMedia.albumServiceId
+ }
+ this.metadataTitle = this.playbackSession.currentMedia.name;
+ var metadataArtistName = this.playbackSession.currentMedia.artistName;
+ var metadataAlbumName = this.playbackSession.currentMedia.albumName;
+ if (metadataArtistName && metadataAlbumName)
+ this.metadataArtistAlbumName = String.load(String.id.IDS_COMMA_SEPARATOR).format(metadataArtistName, metadataAlbumName);
+ else if (metadataArtistName)
+ this.metadataArtistAlbumName = metadataArtistName;
+ else if (metadataAlbumName)
+ this.metadataArtistAlbumName = metadataAlbumName;
+ else
+ this.metadataArtistAlbumName = String.empty;
+ if (this.playbackSession.currentMedia.seriesTitle)
+ this.metadataSeriesTitle = this.playbackSession.currentMedia.seriesTitle;
+ else
+ this.metadataSeriesTitle = String.empty
+ }
+ else {
+ this.nowPlayingImageMediaItem = null;
+ this.metadataTitle = String.empty
+ }
+ if (!this.metadataTitle && typeof this.metadataTitle !== "string")
+ this.metadataTitle = String.load(String.id.IDS_UNKNOWN_VALUE);
+ this.title = this.metadataTitle;
+ this.updateStates()
+ }, updateStates: function updateStates() {
+ if (this._deferredUpdateTimer)
+ return;
+ if (this.playbackSession) {
+ if (this.playbackSession.isRemoteSession && !this.playbackSession.isRemoteSession() && this.playbackSession.currentMedia && (this.playbackSession.currentMedia.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || (this.playbackSession.currentMedia.mediaType === Microsoft.Entertainment.Queries.ObjectType.game && this.playbackSession.canControlMedia))) {
+ if (this._appBarNowPlaying)
+ this.nowPlayingWidth = (this.playbackSession.videoWidth * (this._appBarNowPlaying.clientHeight / this.playbackSession.videoHeight)) + "px";
+ this.thumbnailVisible = true;
+ this.artVisible = false
+ }
+ else {
+ this.nowPlayingWidth = this.moreInfoClickUrl ? "400px" : "auto";
+ this.thumbnailVisible = false;
+ this.artVisible = true
+ }
+ this.positionDurationVisible = this.playbackSession && this.playbackSession.currentMedia && this.playbackSession.canControlMedia && this.playbackSession.duration > 0
+ }
+ if (this.playbackSession.sessionId === "nowPlaying")
+ this.nowPlayingText = String.load(String.id.IDS_HOME_NOW_PLAYING);
+ else
+ this.nowPlayingText = String.load(String.id.IDS_HOME_NOW_PLAYING_XBOX)
+ }, updatePositionDuration: function updatePositionDuration(value, max) {
+ if (value && max) {
+ this.positionText = MS.Entertainment.Utilities.millisecondsToTimeCode(value);
+ this.durationText = "/" + MS.Entertainment.Utilities.millisecondsToTimeCode(max)
+ }
+ }, onMoreInfoClick: function onMoreInfoClick(e) {
+ if (e)
+ e.stopPropagation();
+ if (this.moreInfoLinkCallback)
+ this.moreInfoLinkCallback()
+ }, thumbnailClick: function thumbnailClick() {
+ MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar).hide();
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var currentPage = navigation.currentPage;
+ var onSamePage = false;
+ if (currentPage && currentPage.options && currentPage.options.mediaItem && currentPage.options.mediaItem.isEqual)
+ onSamePage = currentPage.options.mediaItem.isEqual(this.playbackSession.currentMedia);
+ var startFullScreen = this.playbackSession.sessionId === MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ startFullScreen = false;
+ if (startFullScreen && onSamePage) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible = true
+ }
+ if (MS.Entertainment.Utilities.isMusicApp && this.playbackSession.currentMedia !== null && this.playbackSession.currentOrdinal === null)
+ this.playbackSession.activate(document.createElement("div"));
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.showImmersiveDetails);
+ action.parameter = {
+ sessionId: this.playbackSession.sessionId, startFullScreen: startFullScreen, showNowPlaying: true
+ };
+ action.title = action.parameter.sessionId;
+ action.execute();
+ this.updateStates()
+ }
+ }, {
+ playbackSession: null, nowPlayingText: String.empty, thumbnailVisible: false, artVisible: false, nowPlayingWidth: "auto", nowPlayingImageMediaItem: null, nowPlayingImageUri: String.empty, nowPlayingFallbackImageUri: String.empty, positionText: String.empty, durationText: String.empty, positionDurationVisible: false, desiredImageSize: {}, moreInfoClickUrl: String.empty, moreInfoLinkText: String.empty
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/AppBar/BottomProgressBar.html b/packages/microsoft.zunevideo/controls/AppBar/BottomProgressBar.html
new file mode 100644
index 00000000..5904b11d
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/AppBar/BottomProgressBar.html
@@ -0,0 +1,18 @@
+
+
+
+
+ BottomProgressBar
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/AppBar/BottomProgressBar.js b/packages/microsoft.zunevideo/controls/AppBar/BottomProgressBar.js
new file mode 100644
index 00000000..a5ac4f05
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/AppBar/BottomProgressBar.js
@@ -0,0 +1,42 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {BottomProgressBar: MS.Entertainment.UI.Framework.defineUserControl("/Controls/AppBar/BottomProgressBar.html#Template", function(element, options) {
+ this._bindingsToDetach = []
+ }, {
+ _initialized: false, _bindingsToDetach: null, initialize: function initialize() {
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this._initialized = true
+ }, _detachBindings: function _detachBindings() {
+ this._bindingsToDetach.forEach(function(e) {
+ e.source.unbind(e.name, e.action)
+ });
+ this._bindingsToDetach = []
+ }, _initializeBinding: function _initializeBinding(source, name, action) {
+ source.bind(name, action);
+ this._bindingsToDetach.push({
+ source: source, name: name, action: action
+ })
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ if (this.playbackSession)
+ this._initializeBinding(this.playbackSession, "currentPosition", this._mediaPositionChanged.bind(this))
+ }, _mediaPositionChanged: function _mediaPositionChanged() {
+ var durationMs = this.playbackSession.getProperty("duration");
+ var positionMs = this.playbackSession.getProperty("currentPosition");
+ this.value = Math.min(durationMs, positionMs);
+ this.max = durationMs;
+ this.min = 0
+ }
+ }, {
+ min: 0, max: 100, value: 0, playbackSession: null, appBarVisible: false, onMouseEvent: function onMouseEvent(event) {
+ switch (event.type)
+ {
+ case"click":
+ MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar).show();
+ break
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/AppBar/RemoveOverlay.html b/packages/microsoft.zunevideo/controls/AppBar/RemoveOverlay.html
new file mode 100644
index 00000000..634c641b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/AppBar/RemoveOverlay.html
@@ -0,0 +1,20 @@
+
+
+
+
+ Remove Dialog
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/AppBar/RemoveOverlay.js b/packages/microsoft.zunevideo/controls/AppBar/RemoveOverlay.js
new file mode 100644
index 00000000..cb40e1ac
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/AppBar/RemoveOverlay.js
@@ -0,0 +1,283 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {RemoveOverlay: MS.Entertainment.UI.Framework.defineUserControl("/Controls/AppBar/RemoveOverlay.html#removeOverlayTemplate", function removeOverlayConstructor(element, options) {
+ this._inputItems = options.items;
+ MS.Entertainment.UI.Controls.assert(this._inputItems, "Need item(s) for deletion in RemoveOverlay!");
+ this._inputItems = this._inputItems || []
+ }, {
+ items: null, collectionFilter: null, deleteLocalFilesOnly: false, removed: false, _inputItems: null, _dialog: null, _okEnabled: true, _cancelEnabled: true, _mediaType: null, _ids: null, initialize: function initialize() {
+ this._waitCursor.isBusy = true;
+ this._setOKEnabled(false);
+ var length = 0;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isCloudCollectionV2Enabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.cloudCollectionV2Enabled);
+ return this._getCount().then(function gotCount(count) {
+ length = count;
+ if (isCloudCollectionV2Enabled)
+ return MS.Entertainment.Data.List.listToArray(this._inputItems, 0, MS.Entertainment.UI.Controls.RemoveOverlay.DELETE_CONFIRMATION_VERIFICATION_LIMIT);
+ else
+ return MS.Entertainment.Data.List.listToArray(this._inputItems, 0, 3)
+ }.bind(this)).then(function copiedItems(arrayMediaItems) {
+ this._waitCursor.isBusy = false;
+ this._setOKEnabled(true);
+ var mediaItem = arrayMediaItems ? arrayMediaItems[0] : null;
+ if (!mediaItem || !mediaItem.isRemovable) {
+ MS.Entertainment.UI.Controls.fail("Item is invalid or has mediaType not supported for deletion.");
+ this._hide()
+ }
+ else if (length === 1)
+ if (!mediaItem.name && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ this._removeDescription.text = String.load(String.id.IDS_DELETE_DESCRIPTION_LOCAL_SINGLE).format(mediaItem.seriesTitle);
+ else if (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ this._removeDescription.text = mediaItem.inCloudCollectionV2 ? String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_ONEDRIVE).format(mediaItem.name) : String.load(String.id.IDS_MUSIC_DELETE_DIALOG_BODY_SINGLE_LIBRARY).format(mediaItem.name);
+ else
+ this._removeDescription.text = String.load(String.id.IDS_DELETE_DESCRIPTION_LOCAL_SINGLE).format(mediaItem.name);
+ else if (length !== 0) {
+ var decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ decimalFormatter.fractionDigits = 0;
+ var decimalFormattedNumber = decimalFormatter.format(length);
+ var messageId = String.id.IDS_DELETE_DESCRIPTION_LOCAL_PLURAL;
+ var isTrack = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track);
+ if (isTrack || mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ if (isCloudCollectionV2Enabled) {
+ messageId = isTrack ? String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_MIXED_PLURAL : String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_MIXED_PLURAL;
+ if (length <= MS.Entertainment.UI.Controls.RemoveOverlay.DELETE_CONFIRMATION_VERIFICATION_LIMIT) {
+ var mixedContent = false;
+ for (var i = 1; i < length; i++)
+ if (arrayMediaItems[i - 1].inCloudCollectionV2 !== arrayMediaItems[i].inCloudCollectionV2) {
+ mixedContent = true;
+ break
+ }
+ if (!mixedContent)
+ if (mediaItem.inCloudCollectionV2)
+ messageId = isTrack ? String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_ONEDRIVE_PLURAL : String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_ONEDRIVE_PLURAL;
+ else
+ messageId = isTrack ? String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL : String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL
+ }
+ }
+ else
+ messageId = isTrack ? String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_TRACKS_LIBRARY_PLURAL : String.id.IDS_MUSIC_DELETE_DIALOG_BODY_MULTIPLE_ALBUMS_LIBRARY_PLURAL;
+ this._removeDescription.text = MS.Entertainment.Utilities.Pluralization.getPluralizedString(messageId, length).format(decimalFormattedNumber)
+ }
+ else {
+ MS.Entertainment.UI.Controls.fail("Need item(s) for deletion in RemoveOverlay! List was empty");
+ this._hide()
+ }
+ this._mediaType = mediaItem ? mediaItem.mediaType : null
+ }.bind(this), function copiedFailed() {
+ MS.Entertainment.UI.Controls.fail("Error occured when attempting to get items to delete.");
+ this._waitCursor.isBusy = false;
+ this._hide()
+ }.bind(this))
+ }, setOverlay: function setOverlay(overlay) {
+ this._dialog = overlay;
+ this._setOKEnabled(this._okEnabled);
+ this._setCanceledEnabled(this._cancelEnabled)
+ }, submit: function submit() {
+ this._setOKEnabled(false);
+ this._setCanceledEnabled(false);
+ this.removed = true;
+ this._waitCursor.isBusy = true;
+ return this._getIds().then(function deleteItems() {
+ return this._deleteItems()
+ }.bind(this))
+ }, _hide: function _hide() {
+ if (this._dialog)
+ this._dialog.hide()
+ }, _setOKEnabled: function _setOKEnabled(enabled) {
+ if (this._dialog && this._dialog.buttons && (this._dialog.buttons.length > 0))
+ this._dialog.buttons[0].isEnabled = enabled;
+ this._okEnabled = enabled
+ }, _setCanceledEnabled: function _setCanceledEnabled(enabled) {
+ if (this._dialog && this._dialog.buttons && (this._dialog.buttons.length > 1))
+ this._dialog.buttons[1].isEnabled = enabled;
+ this._cancelEnabled = enabled
+ }, _getCount: function _getCount() {
+ var promise;
+ if (Array.isArray(this._inputItems))
+ promise = this._inputItems.length;
+ else if (MS.Entertainment.Data.List.isList(this._inputItems))
+ promise = this._inputItems.getCount();
+ else if (this._inputItems)
+ promise = 1;
+ else
+ promise = 0;
+ return WinJS.Promise.as(promise)
+ }, _clearCurrentMediaIfMatch: function _clearCurrentMediaIfMatch(playbackSession, id) {
+ if (playbackSession) {
+ if (playbackSession.isMediaCurrentlyLoaded(id)) {
+ var removeItemIfMatch = function removeItemIfMatch(item) {
+ if (item && item.data && item.data.libraryId === id) {
+ playbackSession.mediaCollection.remove(item.key);
+ if (MS.Entertainment.Utilities.useModalNowPlaying) {
+ playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.stopped;
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService.currentPage && navigationService.currentPage.iaNode && navigationService.currentPage.iaNode.moniker === "immersiveDetails")
+ navigationService.navigateBack()
+ }
+ }
+ return WinJS.Promise.wrap()
+ };
+ MS.Entertainment.Platform.Playback.Playlist.PlaylistCore.forEachItemSequentially(playbackSession.mediaCollection, removeItemIfMatch, null, null)
+ }
+ if (MS.Entertainment.Utilities.useModalNowPlaying && playbackSession.lastPlayedMedia && playbackSession.lastPlayedMedia.libraryId === id)
+ playbackSession.setLastPlayedMedia(null)
+ }
+ }, _getIds: function _getIds() {
+ var ids = [];
+ var promise = ids;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr.primarySession;
+ this._ids = ids;
+ if (Array.isArray(this._inputItems))
+ this._inputItems.forEach(function iteration(item) {
+ if (MS.Entertainment.Utilities.isValidLibraryId(item.libraryId)) {
+ ids.push(item.libraryId);
+ this._clearCurrentMediaIfMatch(playbackSession, item.libraryId)
+ }
+ }, this);
+ else if (MS.Entertainment.Data.List.isList(this._inputItems))
+ promise = this._inputItems.forEachAll(function iteration(args) {
+ if (args.item && args.item.data && MS.Entertainment.Utilities.isValidLibraryId(args.item.data.libraryId)) {
+ ids.push(args.item.data.libraryId);
+ this._clearCurrentMediaIfMatch(playbackSession, args.item.data.libraryId)
+ }
+ }.bind(this)).then(null, function ignoreErrors(){}).then(function returnIds() {
+ return ids
+ });
+ else if (this._inputItems && MS.Entertainment.Utilities.isValidLibraryId(this._inputItems.libraryId)) {
+ ids.push(this._inputItems.libraryId);
+ this._clearCurrentMediaIfMatch(playbackSession, this._inputItems.libraryId)
+ }
+ return WinJS.Promise.as(promise)
+ }, _deleteItems: function _deleteItems() {
+ var handleDeleteSuccess = this._handleDeleteSuccess.bind(this);
+ var handleDeleteFailure = this._handleDeleteCompleted.bind(this);
+ if (!this._ids || !this._ids.length || !this._mediaType) {
+ handleDeleteFailure();
+ return WinJS.Promise.wrapError(new Error("Ids are invalid or has mediaType not supported for deletion."))
+ }
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ var mediaProvider = mediaStore.mediaProvider;
+ var playlistProvider = mediaStore.playlistProvider;
+ var mediaAvailability = this.collectionFilter || Microsoft.Entertainment.Platform.MediaAvailability.available;
+ switch (this._mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ return playlistProvider.deletePlaylistAsync(this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (this.deleteLocalFilesOnly)
+ return mediaProvider.deleteFilesForMediaAsync(this._mediaType, this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ return mediaProvider.deleteMediaAsync(this._mediaType, this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ default:
+ this._waitCursor.isBusy = true;
+ var deletePromises = [];
+ var ids = [];
+ var mediaType = null;
+ this._ids.forEach(function deleteItem(collectionId) {
+ deletePromises.push(this._getIdsFromQuery(collectionId, this._mediaType).then(function addIds(deleteIds) {
+ ids = ids.concat(deleteIds.ids);
+ mediaType = deleteIds.mediaType
+ }))
+ }.bind(this));
+ return WinJS.Promise.join(deletePromises).then(function deleteQueryItems() {
+ if (ids.length === 0)
+ return WinJS.Promise.wrapError("No items to delete");
+ if (this.deleteLocalFilesOnly)
+ return mediaProvider.deleteFilesForMediaAsync(this._mediaType, this._ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure);
+ return mediaProvider.deleteMediaAsync(mediaType, ids, mediaAvailability).then(handleDeleteSuccess, handleDeleteFailure)
+ }.bind(this))
+ }
+ }, _handleDeleteSuccess: function _handleDeleteSuccess() {
+ return this._clearLibraryIds().then(this._handleDeleteCompleted.bind(this))
+ }, _handleDeleteCompleted: function _handleDeleteCompleted() {
+ this._waitCursor.isBusy = false;
+ this._hide()
+ }, _clearLibraryId: function _clearLibraryId(item) {
+ if (item && !item.fromCollection && MS.Entertainment.Utilities.isValidLibraryId(item.libraryId))
+ item.libraryId = MS.Entertainment.Utilities.invalidateLibraryId
+ }, _clearLibraryIds: function _clearLibraryIds() {
+ var promise;
+ if (Array.isArray(this._inputItems))
+ this._inputItems.forEach(this._clearLibraryId, this);
+ else if (MS.Entertainment.Data.List.isList(this._inputItems))
+ promise = this._inputItems.forEachAll(function iteration(args) {
+ this._clearLibraryId(args.item && args.item.data)
+ }.bind(this)).then(null, function ignoreErrors(error) {
+ MS.Entertainment.UI.Controls.fail("Failed to clear all library ids after delete. Error message: " + error && error.message)
+ });
+ else
+ this._clearLibraryId(this._inputItems);
+ return WinJS.Promise.as(promise)
+ }, _getIdsFromQuery: function _getIdsFromQuery(libraryId, mediaType) {
+ var currentId;
+ var ids = [];
+ var childMediaType = null;
+ var itemsPromise = WinJS.Promise.wrap();
+ var queryComplete = function queryComplete(q) {
+ return q.result.items.itemsFromIndex(0).then(function processItems(dataContext) {
+ for (var x = 0; x < dataContext.items.length; x++) {
+ currentId = dataContext.items[x].data.libraryId;
+ if (MS.Entertainment.Utilities.isValidLibraryId(currentId))
+ ids.push(currentId)
+ }
+ })
+ };
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ childMediaType = Microsoft.Entertainment.Queries.ObjectType.track;
+ var tracksQuery = new MS.Entertainment.Data.Query.libraryTracks;
+ tracksQuery.albumId = libraryId;
+ tracksQuery.mediaAvailability = this.collectionFilter;
+ itemsPromise = tracksQuery.execute().then(queryComplete);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ childMediaType = Microsoft.Entertainment.Queries.ObjectType.video;
+ var episodeQuery = new MS.Entertainment.Data.Query.libraryVideoTV;
+ episodeQuery.seasonId = libraryId;
+ itemsPromise = episodeQuery.execute().then(queryComplete);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ childMediaType = Microsoft.Entertainment.Queries.ObjectType.video;
+ var seriesEpisodesQuery = new MS.Entertainment.Data.Query.libraryVideoTV;
+ seriesEpisodesQuery.seriesId = libraryId;
+ itemsPromise = seriesEpisodesQuery.execute().then(queryComplete);
+ break
+ }
+ return itemsPromise.then(function returnIds() {
+ return {
+ ids: ids, mediaType: childMediaType
+ }
+ })
+ }
+ }, {}, {
+ _isRemoveOverlayOpen: false, DELETE_CONFIRMATION_VERIFICATION_LIMIT: 25, show: function show(dataSource, collectionFilter, deleteLocalFilesOnly) {
+ if (MS.Entertainment.UI.Controls.RemoveOverlay._isRemoveOverlayOpen)
+ return WinJS.Promise.wrap();
+ MS.Entertainment.UI.Controls.RemoveOverlay._isRemoveOverlayOpen = true;
+ return MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_DELETE_LABEL), "MS.Entertainment.UI.Controls.RemoveOverlay", {
+ userControlOptions: {
+ items: dataSource, collectionFilter: collectionFilter, deleteLocalFilesOnly: deleteLocalFilesOnly
+ }, width: "40%", height: "310px", buttons: [WinJS.Binding.as({
+ isEnabled: true, title: String.load(String.id.IDS_DELETE_BUTTON), execute: function execute_submit(dialog) {
+ WinJS.Promise.as(dialog.userControlInstance.submit()).done(null, function(error) {
+ MS.Entertainment.UI.Controls.fail("Submit failed in the delete dialog. Error message: " + error && error.message)
+ })
+ }
+ }), WinJS.Binding.as({
+ isEnabled: true, title: String.load(String.id.IDS_CANCEL_BUTTON_TC), execute: function execute_cancel(dialog) {
+ dialog.hide()
+ }
+ })], defaultButtonIndex: 0, cancelButtonIndex: 1
+ }).then(function onDismiss(overlay) {
+ if (overlay)
+ MS.Entertainment.UI.Controls.RemoveOverlay._isRemoveOverlayOpen = false;
+ return overlay
+ })
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/ArcProgress.html b/packages/microsoft.zunevideo/controls/ArcProgress.html
new file mode 100644
index 00000000..3db9e610
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ArcProgress.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ ArcProgress
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/ArcProgress.js b/packages/microsoft.zunevideo/controls/ArcProgress.js
new file mode 100644
index 00000000..0188c36a
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ArcProgress.js
@@ -0,0 +1,74 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ArcProgress: MS.Entertainment.UI.Framework.defineUserControl("/Controls/ArcProgress.html#arcProgressTemplate", function arcProgressConstructor() {
+ this._bindings = WinJS.Binding.bind(this, {progress: this._propertyChangedHandler.bind(this)})
+ }, {
+ initialize: function initialize() {
+ WinJS.Promise.timeout().then(function() {
+ this._initLayout()
+ }.bind(this))
+ }, unload: function unload() {
+ if (this._progressTimer) {
+ this._progressTimer.cancel();
+ this._progressTimer = null
+ }
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, resetOnUpdate: true, animationSpeed: 15, animationStep: 1, _bindings: null, _radians: (Math.PI) / 180, _radius: 50, _strokeOffset: 0, _progressTimer: null, _layoutInitCount: 0, _layoutRefreshMaxTries: 5, LAYOUT_INIT_DELAY: 300, _running: true, _propertyChangedHandler: function _propertyChangedHandler(newValue) {
+ if (!newValue && this.resetOnUpdate)
+ return;
+ this._layoutInitCount = 0;
+ if (this.foregroundPath)
+ this._initLayout()
+ }, _initLayout: function _initLayout() {
+ if (this.resetOnUpdate || !this.progress)
+ this.currentProgress = 0;
+ if (this.svgRoot.viewport.width !== 0) {
+ this._radius = Math.min(this.svgRoot.viewport.width, this.svgRoot.viewport.height) / 2;
+ this._strokeOffset = this.strokeThickness / 2;
+ this._radius = this._radius - this._strokeOffset;
+ this._renderArc(this.backgroundPath, 100, this.backgroundColor);
+ this._renderPath();
+ this._layoutInitCount = 0
+ }
+ else if (this._layoutInitCount < this._layoutRefreshMaxTries) {
+ this._layoutInitCount++;
+ WinJS.Promise.timeout(this.LAYOUT_INIT_DELAY).then(function() {
+ this._initLayout()
+ }.bind(this))
+ }
+ }, _renderPath: function _renderPath() {
+ if (this._progressTimer) {
+ this._progressTimer.cancel();
+ this._progressTimer = null
+ }
+ if (this.currentProgress <= this.progress) {
+ this._renderArc(this.foregroundPath, this.currentProgress, this.foregroundColor);
+ this._progressTimer = WinJS.Promise.timeout(this.animationSpeed).then(this._renderPath.bind(this));
+ this.currentProgress += this.animationStep
+ }
+ }, _renderArc: function _renderArc(targetPath, progress, color) {
+ if (progress === 100)
+ progress = 99.99;
+ var theta = this._radians * (360 * (progress - 25) / 100);
+ var endX = Math.cos(theta) * this._radius;
+ var endY = Math.sin(theta) * this._radius;
+ var arcFlag = (progress <= 50) ? "0,1" : "1,1";
+ var startPoint = (this._radius + this._strokeOffset) + " " + this._strokeOffset;
+ if (targetPath) {
+ targetPath.setAttribute("d", "M " + startPoint + " A" + this._radius + "," + this._radius + " 0 " + arcFlag + " " + (endX + this._radius + this._strokeOffset) + "," + (endY + this._radius + this._strokeOffset));
+ targetPath.setAttribute("stroke", color);
+ targetPath.setAttribute("stroke-width", this.strokeThickness);
+ targetPath.setAttribute("fill", "none")
+ }
+ }
+ }, {
+ strokeThickness: 25, foregroundColor: "#5CBB1D", backgroundColor: "rgba(255,255,255,0.10)", progress: 0, currentProgress: 0
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Dashboard.html b/packages/microsoft.zunevideo/controls/Dashboard.html
new file mode 100644
index 00000000..565edece
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Dashboard.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/Dashboard.js b/packages/microsoft.zunevideo/controls/Dashboard.js
new file mode 100644
index 00000000..8175ab55
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Dashboard.js
@@ -0,0 +1,480 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ Dashboard: MS.Entertainment.UI.Framework.defineUserControl(null, function dashboardConstructor(element, options) {
+ window.msWriteProfilerMark("ent:Dashboard.Start,StartTM");
+ this._panelReadyTimeouts = {};
+ this._adjustScrollLimit = this._adjustScrollLimit.bind(this);
+ this._calculateSnapPoints = this._calculateSnapPoints.bind(this);
+ this._handlersToCancel = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {
+ PanelLoadingStarted: this._handlePanelLoadingStarted.bind(this), PanelComplete: this._handlePanelLoadingComplete.bind(this)
+ });
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._onNetworkStatusChanged.bind(this)})
+ }, {
+ preventHideDuringInitialize: true, allowAnimations: false, doNotReversePanelsLeftOfHome: false, shouldCalculateSnapPoints: true, _data: null, _defaultHub: null, _leftOfHomeContainerWidth: 0, _panelsStillToLoad: null, _keyboardNavigationManager: null, _currentStatus: MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown, _isFrozen: false, _networkStatusBinding: null, _handlersToCancel: null, _currentLeftScrollLimit: 4000, _currentLeftScrollLimitAdjusted: false, _panelReadyTimeouts: null, _leftOfHomeOffset: 4000, _leftOfHomeControls: null, _leftOfHomeOnScreenPromise: null, _leftOfHomeOnScreen: true, _scrollLeft: 0, _ready: false, _frozenScrollPosition: null, _itemControlAppBarSelection: null, _snapPoints: null, _adjustScrollLimit: function _adjustScrollLimit() {
+ if (!this._leftOfHome || this._unloaded)
+ return;
+ if (this._leftOfHome && this._leftOfHome.children.length < 1)
+ return;
+ if (!this._leftOfHomeContainerWidth)
+ this._leftOfHomeContainerWidth = this._leftOfHome.clientWidth;
+ var left = WinJS.Utilities.getRelativeLeft(this._leftOfHome.firstElementChild, this._contentScroller);
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ left = (this._leftOfHomeContainerWidth - WinJS.Utilities.getRelativeLeft(this._leftOfHome.firstElementChild, this.domElement) - this._leftOfHome.firstElementChild.clientWidth);
+ if (left === this._currentLeftScrollLimit)
+ return;
+ this._currentLeftScrollLimit = left;
+ this._contentScroller.style.msScrollLimitXMin = left + "px";
+ this._currentLeftScrollLimitAdjusted = true
+ }, _getPanelForElement: function _getPanelForElement(element) {
+ var panel;
+ var panelIndex;
+ var childPanels = WinJS.Utilities.children(this._leftOfHome);
+ childPanels.include(this._homeAndToTheRight.children);
+ childPanels.forEach(function(child, index) {
+ if (child.contains(element)) {
+ panel = child;
+ panelIndex = index
+ }
+ });
+ if (!panel)
+ return;
+ return {
+ panel: panel, index: panelIndex
+ }
+ }, _createAndLoadPanel: function _createAndLoadPanel(panelItem, targetContainer) {
+ var panelDiv = document.createElement("div");
+ panelDiv.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.DashboardPanel");
+ panelDiv.setAttribute("data-ent-dashboardPanel", "true");
+ panelDiv.className = "dashboardPanel " + panelItem.moniker + " " + panelItem.hub.iaNode.moniker;
+ targetContainer.appendChild(panelDiv);
+ var readyTimeout = MS.Entertainment.Utilities.isApp2 ? MS.Entertainment.UI.Controls.Dashboard.APP2_READY_TIMEOUT_MS : MS.Entertainment.UI.Controls.Dashboard.READY_TIMEOUT_MS;
+ this._panelReadyTimeouts[panelItem.moniker] = WinJS.Promise.timeout(readyTimeout).then(function() {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelComplete", true, true);
+ domEvent.moniker = panelItem.moniker;
+ panelDiv.dispatchEvent(domEvent)
+ });
+ (new MS.Entertainment.UI.Controls.DashboardPanel(panelDiv, {panelInformation: panelItem}))
+ }, _handlePanelLoadingStarted: function _handlePanelLoadingStarted(e) {
+ MS.Entertainment.UI.Controls.assert(e.moniker, "Expected a moniker");
+ var indexOfMoniker = this._data.panelsToLoad.indexOf(e.moniker);
+ if (indexOfMoniker > -1)
+ this._data.panelsToLoad.splice(indexOfMoniker, 1)
+ }, _handlePanelLoadingComplete: function _handlePanelLoadingComplete(e) {
+ MS.Entertainment.UI.Controls.assert(e.moniker, "Expected a moniker");
+ var indexOfMoniker = this._data.panelsToComplete.indexOf(e.moniker);
+ if (e.moniker === this._data.defaultPanelMoniker && !this._ready) {
+ var event = document.createEvent("Event");
+ event.initEvent("HubStripVisible", true, false);
+ this.domElement.dispatchEvent(event);
+ if (MS.Entertainment.Utilities.isMusicApp1 && !this._itemControlAppBarSelection)
+ this._itemControlAppBarSelection = new MS.Entertainment.UI.Controls.AppBarSelectionManager(this.domElement);
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiState.isHubStripVisible = true;
+ window.msWriteProfilerMark("ent.Dashboard.Visible");
+ window.msWriteProfilerMark("ent:Dashboard.Navigate,StopTM");
+ WinJS.Promise.timeout(50).done(function focusFirstElement() {
+ this.focusHome();
+ this._handlePanelLoadingCompletePart2(e)
+ }.bind(this))
+ }
+ else
+ this._handlePanelLoadingCompletePart2(e)
+ }, focusHome: function focusHome() {
+ if (this._homeAndToTheRight && this._homeAndToTheRight.children)
+ this._keyboardNavigationManager.focusFirstItemInContainer(this._homeAndToTheRight.children[0], true, MS.Entertainment.UI.Controls.Overlay.anyVisible())
+ }, _handlePanelLoadingCompletePart2: function _handlePanelLoadingCompletePart2(e) {
+ var indexOfMoniker = this._data.panelsToComplete.indexOf(e.moniker);
+ if (indexOfMoniker > -1) {
+ this._data.panelsToComplete.splice(indexOfMoniker, 1);
+ if (this._panelReadyTimeouts[e.moniker])
+ this._panelReadyTimeouts[e.moniker].cancel()
+ }
+ if (!this._data.panelsToComplete.length) {
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceHubStrip_Load_End("dashboard");
+ var event = document.createEvent("Event");
+ event.initEvent("HubStripLoaded", true, false);
+ this.domElement.dispatchEvent(event);
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceHubStrip_Ready("dashboard");
+ var event = document.createEvent("Event");
+ event.initEvent("HubStripReady", true, false);
+ this.domElement.dispatchEvent(event);
+ if (!this._ready)
+ MS.Entertainment.Utilities.Telemetry.logPageView(this._contentScroller, {
+ uri: MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).getUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.None, pageTypeId: MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.None
+ });
+ this._ready = true;
+ this._calculateSnapPoints();
+ this.domElement.addEventListener("PanelReady", this._calculateSnapPoints)
+ }
+ if (this._panelsStillToLoad && this._panelsStillToLoad.length) {
+ var panelInfo = this._panelsStillToLoad.shift();
+ this._createAndLoadPanel(panelInfo.panel, panelInfo.target)
+ }
+ }, _calculateSnapPoints: function _calculateSnapPoints() {
+ window.requestAnimationFrame(function() {
+ if (this._unloaded)
+ return;
+ var updateScrollPositions = function(item) {
+ item.scrollPosition = nextOffSet;
+ var itemWidth;
+ if (this.shouldCalculateSnapPoints)
+ itemWidth = item.clientWidth;
+ else
+ itemWidth = MS.Entertainment.Utilities.getWindowWidth();
+ nextOffSet += itemWidth;
+ scrollPoints.push(nextOffSet);
+ this._snapPoints.push({
+ left: item.scrollPosition, right: nextOffSet
+ })
+ }.bind(this);
+ var scrollPoints = [];
+ this._snapPoints = [];
+ var nextOffSet = this._currentLeftScrollLimit;
+ if (this._leftOfHome && this._leftOfHome.children && this._leftOfHome.children.length)
+ Array.prototype.forEach.call(this._leftOfHome.children, updateScrollPositions);
+ if (this._homeAndToTheRight && this._homeAndToTheRight.children && this._homeAndToTheRight.children.length)
+ Array.prototype.forEach.call(this._homeAndToTheRight.children, updateScrollPositions);
+ var snapList;
+ if (!this.shouldCalculateSnapPoints)
+ snapList = "snapInterval(" + this._currentLeftScrollLimit + "px, 100%)";
+ else
+ snapList = "snapList(" + this._currentLeftScrollLimit + "px, " + scrollPoints.join("px, ") + "px)";
+ this._contentScroller.style.msScrollSnapPointsX = snapList
+ }.bind(this))
+ }, _buildPanelList: function _buildPanelList() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Load_Start("dashboard");
+ var homeAndToTheRight = this._data.homeAndToTheRight.concat([]);
+ var leftOfHome = this.doNotReversePanelsLeftOfHome ? this._data.leftOfHome.concat([]) : this._data.leftOfHome.reverse();
+ var panelsToLoad = [];
+ panelsToLoad.push({
+ panel: homeAndToTheRight.shift(), target: this._homeAndToTheRight
+ });
+ var max = Math.max(homeAndToTheRight.length, leftOfHome.length);
+ for (var i = 0; i < max; i++) {
+ if (i < leftOfHome.length)
+ panelsToLoad.push({
+ panel: leftOfHome[i], target: this._leftOfHome
+ });
+ if (i < homeAndToTheRight.length)
+ panelsToLoad.push({
+ panel: homeAndToTheRight[i], target: this._homeAndToTheRight
+ })
+ }
+ this._panelsStillToLoad = panelsToLoad;
+ this._leftOfHome.addEventListener("PanelReady", this._adjustScrollLimit);
+ this._leftOfHome.addEventListener("SizeAdjusted", this._adjustScrollLimit);
+ this._leftOfHome.addEventListener("PanelLoadingStarted", this._adjustScrollLimit);
+ if (!leftOfHome.length)
+ this._currentLeftScrollLimitAdjusted = true;
+ var firstPanel = panelsToLoad.shift();
+ if (firstPanel.panel)
+ this._createAndLoadPanel(firstPanel.panel, firstPanel.target)
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newValue) {
+ if (!this._isFrozen)
+ switch (newValue) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ WinJS.Utilities.removeClass(this.domElement, "offline");
+ break;
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ WinJS.Utilities.addClass(this.domElement, "offline");
+ break
+ }
+ this._currentState = newValue
+ }, initialize: function initialize() {
+ this._title.innerText = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).applicationTitle;
+ if (this._titleIcon)
+ this._titleIcon.innerText = MS.Entertainment.UI.Icon.xboxXenonLogo;
+ this._keyboardNavigationManager = new MS.Entertainment.Framework.DashboardKeyboardNavigationManager(this._contentScroller, this._contentScroller);
+ window.msWriteProfilerMark("ent:Dashboard.Start,StopTM")
+ }, freeze: function freeze() {
+ if (!Windows.UI.ViewManagement.ViewSizePreference)
+ if (this._contentScroller)
+ this._frozenScrollPosition = this._scrollLeft;
+ this._isFrozen = true;
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (!Windows.UI.ViewManagement.ViewSizePreference)
+ if (this._frozenScrollPosition !== this._contentScroller.scrollLeft) {
+ this._contentScroller.scrollLeft = this._frozenScrollPosition;
+ this._scrollLeft = this._frozenScrollPosition
+ }
+ this._isFrozen = false;
+ this._onNetworkStatusChanged(this._currentState)
+ }, unload: function unload() {
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ if (this._handlersToCancel) {
+ this._handlersToCancel.cancel();
+ this._handlersToCancel = null
+ }
+ if (this._itemControlAppBarSelection) {
+ this._itemControlAppBarSelection.dispose();
+ this._itemControlAppBarSelection = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, onNavigateTo: function onNavigateTo(page, hub, panel) {
+ window.msWriteProfilerMark("ent:Dashboard.Navigate,StartTM");
+ var defaultHub = {
+ hub: hub, index: page.hubs.indexOf(hub)
+ };
+ if (hub)
+ MS.Entertainment.UI.Controls.assert(defaultHub.index !== -1, "Didn't find the hub in the pages list of hubs: " + hub.title);
+ if (defaultHub.index === -1)
+ defaultHub.index = 0;
+ var leftOfHome = [];
+ var homeAndToTheRight = [];
+ var panelMonikers = [];
+ page.hubs.forEach(function mapHubToHub(viewHub, index) {
+ MS.Entertainment.UI.Controls.assert(!viewHub.overrideFragmentUrl, "Dashboard doesn't support custom hubs");
+ var bucket;
+ if (index < defaultHub.index)
+ bucket = leftOfHome;
+ else
+ bucket = homeAndToTheRight;
+ viewHub.panels.forEach(function createPanelData(viewPanel, index) {
+ MS.Entertainment.UI.Controls.assert(viewPanel.fragmentUrl, "Don't support not setting fragment for a panel in the dashboard");
+ var newPanel = {
+ moniker: viewPanel.iaNode.moniker, title: viewPanel.title, fragment: viewPanel.fragmentUrl, page: page, hub: viewHub, panel: viewPanel
+ };
+ bucket.push(newPanel);
+ panelMonikers.push(viewPanel.iaNode.moniker)
+ })
+ });
+ var panelMoniker = WinJS.Utilities.getMember("iaNode.moniker", panel) || "";
+ this._data = {
+ leftOfHome: leftOfHome, homeAndToTheRight: homeAndToTheRight, panelsToLoad: panelMonikers, panelsToComplete: panelMonikers.concat([]), defaultPanelMoniker: panelMoniker
+ };
+ this._buildPanelList()
+ }, onScroll: function onScroll() {
+ this._scrollLeft = this._contentScroller.scrollLeft;
+ if ((this._scrollLeft > this._leftOfHomeOffset && !this._leftOfHomeOnScreen) || (this._scrollLeft <= this._leftOfHomeOffset && this._leftOfHomeOnScreen))
+ return;
+ if (!this._leftOfHomeControls || !this._leftOfHomeControls.length)
+ this._leftOfHomeControls = this._leftOfHome.querySelectorAll("[data-win-control]");
+ if (this._leftOfHomeOnScreenPromise) {
+ this._leftOfHomeOnScreenPromise.cancel();
+ this._leftOfHomeOnScreenPromise = null
+ }
+ if (this._scrollLeft > this._leftOfHomeOffset && this._leftOfHomeControls.length) {
+ if (this._leftOfHomeControls) {
+ for (var i = 0; i < this._leftOfHomeControls.length; i++) {
+ var winControl = this._leftOfHomeControls[i].winControl;
+ if (winControl && winControl.onOffScreen)
+ winControl.onOffScreen()
+ }
+ this._leftOfHomeOnScreen = false
+ }
+ }
+ else if (this._leftOfHomeControls && this._leftOfHomeControls.length)
+ this._leftOfHomeOnScreenPromise = WinJS.Promise.timeout(200).then(function signalOnScreen() {
+ for (var i = 0; i < this._leftOfHomeControls.length; i++) {
+ var winControl = this._leftOfHomeControls[i].winControl;
+ if (winControl && winControl.onOnScreen) {
+ winControl.onOnScreen();
+ this._leftOfHomeOnScreenPromise = null
+ }
+ }
+ this._leftOfHomeOnScreen = true
+ }.bind(this))
+ }, onSearchClick: function onSearchClick() {
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithUIPath(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchGlyphClick);
+ var searchAction = new MS.Entertainment.UI.Actions.SearchAction;
+ searchAction.execute()
+ }, processChildren: true, controlName: "dashboard"
+ }, null, {
+ READY_TIMEOUT_MS: 3000, APP2_READY_TIMEOUT_MS: 10000
+ }), DashboardPanel: MS.Entertainment.UI.Framework.defineUserControl("/Controls/DashboardPanel.html#panelTemplate", function dashboardPanel_Constructor(element, options) {
+ this._panelTemplatePromise = MS.Entertainment.UI.Framework.loadTemplate(this.panelInformation.fragment);
+ this._applyPanelInformation(this.panelInformation);
+ this.domElement.addEventListener("PanelReady", this._handlePanelReady.bind(this));
+ window.msWriteProfilerMark("ent:DashboardPanel." + this.panelInformation.moniker + ".Start,StartTM")
+ }, {
+ _panelReadyEventArgs: null, _panelTemplatePromise: null, _dataContext: null, _panelAction: null, _isLoading: true, _isFailed: false, _failedModel: null, _applyPanelInformation: function _applyPanelInformation(panelInformation) {
+ MS.Entertainment.UI.Controls.assert(panelInformation, "Didn't get any panel infomration. Need that to render");
+ var dataContext;
+ var panelAction;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.tracePanel_Load_Start(panelInformation.moniker || String.empty);
+ if (panelInformation.panel) {
+ dataContext = panelInformation.panel.getDataContext();
+ if (!dataContext && panelInformation.hub)
+ dataContext = panelInformation.hub.getDataContext();
+ if (!dataContext && panelInformation.page)
+ dataContext = panelInformation.page.getDataContext()
+ }
+ if (dataContext && dataContext.panelAction)
+ panelAction = dataContext.panelAction;
+ this._dataContext = dataContext;
+ this._panelAction = panelAction
+ }, _handlePanelReady: function _handlePanelReady(e) {
+ if (this._unloaded)
+ return;
+ if (!this._initialized) {
+ this._panelReadyEventArgs = e;
+ return
+ }
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelComplete", true, true);
+ domEvent.moniker = this.panelInformation.moniker;
+ this.domElement.dispatchEvent(domEvent);
+ window.msWriteProfilerMark("ent:DashboardPanel." + this.panelInformation.moniker + ".Start,StopTM");
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).tracePanel_Ready(this.panelInformation.moniker);
+ if (e.failed || (!e.failed && this._isFailed)) {
+ this._failedModel = e.model;
+ this._isFailed = e.failed
+ }
+ this._isLoading = false;
+ this._adjustLoadingAndContainerPanels()
+ }, _handlePanelReset: function _handlePanelReset(e) {
+ if (!this._isLoading) {
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).tracePanel_Load_Start(this.panelInformation.moniker);
+ this._failedModel = null;
+ this._isFailed = false;
+ this._isLoading = true
+ }
+ this._adjustLoadingAndContainerPanels()
+ }, _adjustLoadingAndContainerPanels: function _adjustLoadingAndContainerPanels() {
+ var progressRing;
+ if (!this._isLoading && !this._isFailed) {
+ MS.Entertainment.Utilities.hideElement(this._loadingPanel);
+ MS.Entertainment.Utilities.empty(this._loadingPanel);
+ MS.Entertainment.Utilities.hideElement(this._failedPanel);
+ MS.Entertainment.Utilities.showElement(this._container);
+ WinJS.Utilities.removeClass(this.domElement, "failed");
+ if (this._panelAction)
+ this._panelTitle.action = this._panelAction.action;
+ this._checkAndSetTabIndexOnItem();
+ this._actionBindings = WinJS.Binding.bind(this._panelTitle, {action: {isEnabled: this._checkAndSetTabIndexOnItem.bind(this)}})
+ }
+ else if (!this._isLoading && this._isFailed) {
+ WinJS.Utilities.addClass(this.domElement, "failed");
+ MS.Entertainment.Utilities.hideElement(this._loadingPanel);
+ MS.Entertainment.Utilities.empty(this._loadingPanel);
+ MS.Entertainment.Utilities.showElement(this._container);
+ if (this._panelAction)
+ this._panelTitle.action = null;
+ if (!this._failedPanel.firstElementChild) {
+ var failedControlDiv = document.createElement("div");
+ failedControlDiv.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.FailedPanel");
+ this._failedPanel.appendChild(failedControlDiv);
+ (new MS.Entertainment.UI.Controls.FailedPanel(failedControlDiv))
+ }
+ this._failedPanel.firstElementChild.winControl.model = this._failedModel;
+ MS.Entertainment.Utilities.showElement(this._failedPanel)
+ }
+ else if (this._isLoading) {
+ WinJS.Utilities.removeClass(this.domElement, "failed");
+ MS.Entertainment.Utilities.showElement(this._loadingPanel);
+ if (this._loadingPanel.children && this._loadingPanel.children.length < 1) {
+ progressRing = document.createElement("progress");
+ progressRing.className = "fillParent win-medium win-ring";
+ this._loadingPanel.appendChild(progressRing)
+ }
+ MS.Entertainment.Utilities.hideElement(this._failedPanel);
+ MS.Entertainment.Utilities.hideElement(this._container)
+ }
+ if (this._panelTitle && this._panelTitle.action && !this._panelTitle.action.automationId)
+ this._panelTitle.action.automationId = this.panelInformation.moniker + "_panelHeader"
+ }, freeze: function freeze() {
+ if (this._dataContext && this._dataContext.viewModel && this._dataContext.viewModel.dashboardFreezeHandler)
+ this._dataContext.viewModel.dashboardFreezeHandler();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._dataContext && this._dataContext.viewModel && this._dataContext.viewModel.dashboardThawHandler)
+ this._dataContext.viewModel.dashboardThawHandler()
+ }, initialize: function initialize() {
+ window.msWriteProfilerMark("ent:DashboardPanel." + this.panelInformation.moniker + "Init");
+ if (this._panelTitle && this._panelTitle.domElement)
+ MS.Entertainment.Framework.AccUtils.createAndAddAriaLink(this._container, this._panelTitle.domElement, "aria-labelledby");
+ this._adjustLoadingAndContainerPanels();
+ this._panelTemplatePromise.then(function(render) {
+ render.render({dataContext: this._dataContext}, this._container).then(function() {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelLoadingStarted", true, true);
+ domEvent.moniker = this.panelInformation.moniker;
+ this.domElement.dispatchEvent(domEvent);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.tracePanel_Load_End(this.panelInformation.moniker || "");
+ if (!this._dataContext || !this._dataContext.doNotRaisePanelReady)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement);
+ if (this._panelReadyEventArgs) {
+ this._handlePanelReady(this._panelReadyEventArgs);
+ this._panelReadyEventArgs = null
+ }
+ }.bind(this))
+ }.bind(this));
+ this._panelTitle.text = this.panelInformation.title;
+ if (this._panelAction)
+ this._panelTitle.action = this._panelAction.action;
+ else if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience)
+ this._panelTitle.visibility = true;
+ else
+ this._panelTitle.visibility = false
+ }, _checkAndSetTabIndexOnItem: function _checkAndSetTabIndexOnItem() {
+ if (this._panelTitle.action && this._panelTitle.action.isEnabled) {
+ if (this.noTitleActionTabStop)
+ this.noTitleActionTabStop.setAttribute("tabindex", -1)
+ }
+ else if (!this.noTitleActionTabStop)
+ this._setupTabPanel(true)
+ }, _setupTabPanel: function _setupTabPanel(retry) {
+ var initialResults = this._container.querySelectorAll(".win-focusable");
+ var firstItem = null;
+ var actualTarget = null;
+ for (var j = 0; j < initialResults.length; j++) {
+ firstItem = initialResults[j];
+ if (this._checkItemValidTarget(firstItem)) {
+ this.noTitleActionTabStop = firstItem;
+ if (this.noTitleActionTabStop) {
+ this.noTitleActionTabStop.setAttribute("tabindex", 0);
+ break
+ }
+ }
+ }
+ if (!this.noTitleActionTabStop && initialResults.length > 0 && retry)
+ MS.Entertainment.UI.Framework.waitForControlToInitialize(initialResults[0]).then(function retryFunction() {
+ this._setupTabPanel(false)
+ }.bind(this))
+ }, _checkItemValidTarget: function _checkItemValidTarget(item) {
+ if (item) {
+ var disabledAttribute = item.getAttribute("disabled");
+ return item.currentStyle && item.currentStyle.visibility !== "hidden" && item.currentStyle.display !== "none" && disabledAttribute !== "disabled" && disabledAttribute !== "" && item.offsetHeight !== 0 && item.offsetWidth !== 0
+ }
+ else
+ return false
+ }, unload: function unload() {
+ if (this._dataContext && this._dataContext.dispose)
+ this._dataContext.dispose();
+ if (this._actionBindings) {
+ this._actionBindings.cancel();
+ this._actionBindings = null
+ }
+ if (this._panelReadyEventArgs)
+ this._panelReadyEventArgs = null;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, onOffScreen: function onOffScreen() {
+ if (this._dataContext && this._dataContext.onOffScreen)
+ this._dataContext.onOffScreen()
+ }, onOnScreen: function onOnScreen() {
+ if (this._dataContext && this._dataContext.onOnScreen)
+ this._dataContext.onOnScreen()
+ }, panelInformation: null, noTitleActionTabStop: null
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/DashboardPanel.html b/packages/microsoft.zunevideo/controls/DashboardPanel.html
new file mode 100644
index 00000000..8c0318e7
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/DashboardPanel.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/Dialog.html b/packages/microsoft.zunevideo/controls/Dialog.html
new file mode 100644
index 00000000..b783ed74
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Dialog.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+ Dialog Control Template
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/EditBox.html b/packages/microsoft.zunevideo/controls/EditBox.html
new file mode 100644
index 00000000..71ef9673
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/EditBox.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+ EditBox Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/EditBox.js b/packages/microsoft.zunevideo/controls/EditBox.js
new file mode 100644
index 00000000..187427b3
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/EditBox.js
@@ -0,0 +1,294 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {EditBox: MS.Entertainment.UI.Framework.defineUserControl("/Controls/EditBox.html#editBoxTemplate", function(element, options){}, {
+ autoFocus: false, editType: null, _maxLength: 10, textChanged: null, textUpdated: null, input: null, keyUp: null, keyPress: null, select: null, selectionStart: null, selectionEnd: null, validationFailedStyle: "validationFailed", validationFailedText: String.empty, validationFailedStringId: 0, validationExpression: null, emptyStringIsValid: true, _showRemainingChars: false, watermarkText: String.empty, watermarkStringId: null, defaultValue: null, width: null, _control: null, _validationTimeoutInMS: 250, _validationTimeoutPromise: null, _validationRegEx: null, _decimalFormatter: null, _focusHandlers: null, _value: String.empty, value: {
+ get: function get_value() {
+ return this._value
+ }, set: function set_value(value) {
+ value = value || String.empty;
+ if (value !== this._value) {
+ var oldValue = this._value;
+ this._value = value;
+ this.setValue(value);
+ this.dispatchChangeAndNotify("value", value, oldValue)
+ }
+ }
+ }, initialize: function initialize() {
+ this.reinitialize()
+ }, unload: function unload() {
+ this.cancelValidationTimeoutPromise();
+ if (this._focusHandlers) {
+ this._focusHandlers.cancel();
+ this._focusHandlers = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, cancelValidationTimeoutPromise: function cancelValidationTimeoutPromise() {
+ if (this._validationTimeoutPromise) {
+ this._validationTimeoutPromise.cancel();
+ this._validationTimeoutPromise = null
+ }
+ }, reinitialize: function create() {
+ this.setValue("");
+ var hasInputControl = false,
+ hasTextArea = false;
+ for (var i = 0; i < this.container.children.length; i++)
+ if (this.container.children[i] === this.inputControl)
+ hasInputControl = true;
+ else if (this.container.children[i] === this.textArea)
+ hasTextArea = true;
+ if (this._focusHandlers) {
+ this._focusHandlers.cancel();
+ this._focusHandlers = null
+ }
+ if (hasInputControl)
+ this.container.removeChild(this.inputControl);
+ if (hasTextArea)
+ this.container.removeChild(this.textArea);
+ if (this.editType === MS.Entertainment.UI.Controls.EditBox.EditTypes.multiLine) {
+ this.container.insertBefore(this.textArea, this._errorContainer);
+ this._control = this.textArea
+ }
+ else {
+ this.container.insertBefore(this.inputControl, this._errorContainer);
+ this._control = this.inputControl;
+ switch (this.editType) {
+ case MS.Entertainment.UI.Controls.EditBox.EditTypes.password:
+ this.inputControl.type = "password";
+ break;
+ case MS.Entertainment.UI.Controls.EditBox.EditTypes.number:
+ this.inputControl.type = "number";
+ break;
+ case MS.Entertainment.UI.Controls.EditBox.EditTypes.url:
+ this.inputControl.type = "url";
+ break;
+ case MS.Entertainment.UI.Controls.EditBox.EditTypes.telephone:
+ this.inputControl.type = "tel";
+ break;
+ case MS.Entertainment.UI.Controls.EditBox.EditTypes.search:
+ this.inputControl.type = "search";
+ break;
+ case MS.Entertainment.UI.Controls.EditBox.EditTypes.email:
+ this.inputControl.type = "email";
+ break;
+ default:
+ this.inputControl.type = "text";
+ break
+ }
+ }
+ this._focusHandlers = MS.Entertainment.Utilities.addEvents(this._control, {
+ focusout: this._handleBlur.bind(this), focusin: this._handleFocus.bind(this)
+ });
+ if (this.width)
+ this._control.style.width = this.width;
+ var watermarkText = this.watermarkText;
+ if (this.watermarkStringId) {
+ MS.Entertainment.UI.Controls.assert(!this.watermarkText, "Mixed usage of raw text and stringId as watermark.");
+ watermarkText = String.load(this.watermarkStringId)
+ }
+ this.setPlaceholderText(watermarkText);
+ this._control.setAttribute("maxlength", this.maxLength);
+ if (this.autoFocus)
+ this._control.setAttribute("autofocus", true);
+ if (this.defaultStringId)
+ this.setValue(String.load(this.defaultStringId));
+ else
+ this.setValue(this.defaultString || String.empty);
+ if (this.showRemainingChars) {
+ this._updateRemainingCharsLabel();
+ WinJS.Utilities.removeClass(this._remainingCharsLabel.domElement, "hidden")
+ }
+ this.bind("accessibleName", function _updateAccessibilityName() {
+ if (this.accessibleName)
+ this._control.setAttribute("aria-label", this.accessibleName)
+ }.bind(this));
+ this.bind("accessibleNameStringId", function _updateAccessibilityName() {
+ if (this.accessibleNameStringId)
+ this._control.setAttribute("aria-label", String.load(this.accessibleNameStringId))
+ }.bind(this));
+ MS.Entertainment.Framework.AccUtils.createAndAddAriaLink(this._control, this.errorControl, "aria-describedby");
+ this.bind("isValid", function _updateAccessibilityValidity() {
+ if (typeof this.isValid === "boolean")
+ this._control.setAttribute("aria-invalid", !this.isValid);
+ else
+ this._control.removeAttribute("aria-invalid")
+ }.bind(this));
+ if (this.rows > 1)
+ this._control.setAttribute("aria-multiline", true)
+ }, _handleBlur: function _handleBlur(e) {
+ this.isFocused = false
+ }, _handleFocus: function _handleFocus(e) {
+ this.isFocused = true
+ }, setPlaceholderText: function setPlaceholderText(newText) {
+ this._control.setAttribute("placeholder", newText)
+ }, getValue: function getValue() {
+ return this._control.value
+ }, setValue: function setValue(text) {
+ if (text || text === String.empty)
+ this.value = text;
+ this.validateText(this.value);
+ if (this.value) {
+ this._control.value = this.value;
+ this.scratchValue = this.value
+ }
+ this._updateText()
+ }, getSelectionStart: function getSelectionStart() {
+ return this._control.selectionStart
+ }, getSelectionEnd: function getSelectionEnd() {
+ return this._control.selectionEnd
+ }, setSelectionRange: function setSelectionRange(start, end) {
+ this._control.setSelectionRange(start, end)
+ }, clearInput: function clearInput() {
+ this.textArea.value = "";
+ this.inputControl.value = "";
+ this._updateText()
+ }, setFocus: function setFocus() {
+ if (this._control) {
+ MS.Entertainment.UI.Framework.focusElement(this._control);
+ if (document.activeElement !== this._control)
+ WinJS.Promise.timeout(150).done(function _focusEditBoxAfterWait() {
+ MS.Entertainment.UI.Framework.focusElement(this._control)
+ }.bind(this))
+ }
+ }, onKeyUp: function onKeyUp(e) {
+ if (this.keyUp)
+ this.keyUp(e);
+ if (e.keyCode === WinJS.Utilities.Key.backspace)
+ this.validateText(this._control.value)
+ }, onKeyPress: function onKeyPress(e) {
+ if (MS.Entertainment.Utilities.isApp2)
+ if (e.keyCode > 10000) {
+ e.preventDefault();
+ return
+ }
+ if (this.editType === MS.Entertainment.UI.Controls.EditBox.EditTypes.number) {
+ if (isNaN(e.char))
+ e.preventDefault()
+ }
+ else if (this.editType === MS.Entertainment.UI.Controls.EditBox.EditTypes.multiLine)
+ if (this.textArea.textContent.length >= this.maxLength)
+ e.preventDefault();
+ this.validateText(this._control.value + e.char);
+ if (this.keyPress)
+ this.keyPress(e)
+ }, onChanged: function onChanged() {
+ this.value = this._control.value;
+ this.validateText(this.value);
+ if (this.textChanged)
+ this.textChanged(this);
+ this._updateText()
+ }, onInput: function onInput(e) {
+ this.scratchValue = this._control.value;
+ this.validateText(this.scratchValue);
+ if (this.input)
+ this.input(e);
+ this._updateText()
+ }, onFocus: function onFocus(e) {
+ if (this.selectOnFocus && this._control)
+ try {
+ this._control.select()
+ }
+ catch(err) {}
+ }, onSelect: function onSelect(e) {
+ if (this.select)
+ this.select(e)
+ }, setError: function setError(text) {
+ this.isValid = false;
+ this.errorControl.textContent = text;
+ this.errorControl.setAttribute("aria-live", "off");
+ this.errorControl.setAttribute("aria-live", "assertive");
+ WinJS.Utilities.addClass(this.container, this.validationFailedStyle)
+ }, validateText: function validateText(text) {
+ var hasError = false;
+ if (this.editType === MS.Entertainment.UI.Controls.EditBox.EditTypes.number && isNaN(text)) {
+ this.isValid = false;
+ this.errorControl.textContent = String.load(String.id.IDS_EDITBOX_ERROR_NUMBER);
+ WinJS.Utilities.addClass(this.container, this.validationFailedStyle);
+ return
+ }
+ if (this.validationExpression !== null) {
+ if (!this._validationRegEx)
+ this._validationRegEx = new RegExp(this.validationExpression);
+ var result = this._validationRegEx.exec(text);
+ if (result === null || result.length === 0 || result[0] !== text) {
+ this.isValid = false;
+ if (text) {
+ MS.Entertainment.UI.Controls.assert(!(this.validationFailedStringId && this.validationFailedText), "Mixed usage of raw text and stringId as error text.");
+ this.errorControl.textContent = (this.validationFailedText) ? this.validationFailedText : String.load(this.validationFailedStringId);
+ WinJS.Utilities.addClass(this.container, this.validationFailedStyle)
+ }
+ return
+ }
+ }
+ if (!text && !this.emptyStringIsValid)
+ this.isValid = false;
+ else
+ this.isValid = true;
+ this.errorControl.textContent = String.empty;
+ WinJS.Utilities.removeClass(this.container, this.validationFailedStyle)
+ }, _updateText: function _updateText() {
+ if (this.textUpdated && this._control)
+ this.textUpdated(this._control.value);
+ if (this.showRemainingChars)
+ this._updateRemainingCharsLabel()
+ }, maxLength: {
+ get: function() {
+ return this._maxLength
+ }, set: function(numberOfChars) {
+ this._maxLength = numberOfChars
+ }
+ }, showRemainingChars: {
+ get: function() {
+ return this._showRemainingChars
+ }, set: function(showRemainingCharsLabel) {
+ if (this._remainingCharsLabel)
+ if (showRemainingCharsLabel) {
+ this._updateRemainingCharsLabel();
+ WinJS.Utilities.removeClass(this._remainingCharsLabel.domElement, "hidden")
+ }
+ else
+ WinJS.Utilities.addClass(this._remainingCharsLabel.domElement, "hidden");
+ this._showRemainingChars = !!showRemainingCharsLabel
+ }
+ }, _updateRemainingCharsLabel: function _updateRemainingCharsLabel() {
+ var currentRemaining = 0;
+ var controlText = String.empty;
+ if (this._control)
+ controlText = this._control.value;
+ if (this._control && this._control.placeholder && controlText === this._control.placeholder)
+ currentRemaining = this.maxLength;
+ else
+ currentRemaining = this.maxLength - controlText.length;
+ if (!this._decimalFormatter) {
+ this._decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ this._decimalFormatter.fractionDigits = 0
+ }
+ var decimalFormattedNumber = this._decimalFormatter.format(currentRemaining);
+ this._remainingCharsLabel.text = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_EDITBOX_REMAINING_PLURAL, currentRemaining).format(decimalFormattedNumber)
+ }
+ }, {
+ rows: 1, columns: 30, scratchValue: String.empty, defaultStringId: null, defaultString: null, disabled: false, isValid: false, isFocused: false, selectOnFocus: true, accessibleName: String.empty, accessibleNameStringId: null
+ }, {EditTypes: {
+ multiLine: "multiLine", number: "number", password: "password", text: "text", url: "url", telephone: "telephone", email: "email", search: "search"
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {EditBoxWithSubmit: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.EditBox", "/Controls/EditBox.html#editBoxWithSubmitTemplate", null, {
+ submit: null, submitButtonText: String.empty, submitButtonStringId: null, reinitialize: function reinitialize() {
+ MS.Entertainment.UI.Controls.EditBox.prototype.reinitialize.call(this);
+ var submitButtonText = this.submitButtonText;
+ if (this.submitButtonStringId) {
+ MS.Entertainment.UI.Controls.assert(!this.submitButtonText, "Mixed usage of raw text and stringId as submit button label.");
+ submitButtonText = String.load(this.submitButtonStringId)
+ }
+ this.submitButtonString = submitButtonText
+ }, onInvoke: function onInvoke(invokeEvent) {
+ if ((this.value || this.scratchValue) && !this.disabled && this.isValid && this.submit)
+ this.submit(invokeEvent)
+ }, onKeyPress: function onKeyPress(keyEvent) {
+ if (this.editType !== MS.Entertainment.UI.Controls.EditBox.EditTypes.multiLine && event.keyCode === WinJS.Utilities.Key.enter)
+ this.onInvoke(keyEvent);
+ MS.Entertainment.UI.Controls.EditBox.prototype.onKeyPress.call(this, keyEvent)
+ }
+ }, {submitButtonString: String.empty})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/ErrorDialog.html b/packages/microsoft.zunevideo/controls/ErrorDialog.html
new file mode 100644
index 00000000..db60dd55
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ErrorDialog.html
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Error Dialog Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/FailedPanel.html b/packages/microsoft.zunevideo/controls/FailedPanel.html
new file mode 100644
index 00000000..8595c418
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/FailedPanel.html
@@ -0,0 +1,150 @@
+
+
+
+
+
+ Failed Panel Controls
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/FailedPanel.js b/packages/microsoft.zunevideo/controls/FailedPanel.js
new file mode 100644
index 00000000..9c13b2dc
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/FailedPanel.js
@@ -0,0 +1,165 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FailedPanel: MS.Entertainment.UI.Framework.defineUserControl("/Controls/FailedPanel.html#failedPanelTemplate", function failedPanelConstructor(){}, {
+ defaultPrimaryStringId: String.id.IDS_FAILED_PANEL_HEADER, defaultSecondaryStringId: String.id.IDS_FAILED_PANEL_LABEL, _modelBinding: null, initialize: function initialize() {
+ if (!this.model) {
+ this.model = new MS.Entertainment.UI.Controls.DefaultFailedPanelModel;
+ this.model.primaryStringId = this.defaultPrimaryStringId;
+ this.model.secondaryStringId = this.defaultSecondaryStringId
+ }
+ this._updateFromModelProperties = this._updateFromModelProperties.bind(this);
+ this._modelBinding = WinJS.Binding.bind(this, {model: {
+ primaryText: this._updateFromModelProperties, primaryStringId: this._updateFromModelProperties, secondaryText: this._updateFromModelProperties, secondaryStringId: this._updateFromModelProperties, details: this._updateFromModelProperties, isVisible: this._updateFromModelProperties, className: this._updateFromModelProperties, showLoadingRing: this._updateFromModelProperties
+ }})
+ }, unload: function unload() {
+ if (this._modelBinding) {
+ this._modelBinding.cancel();
+ this._modelBinding = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, onPanelClicked: function onPanelClicked() {
+ if (this.model && this.model.action && this.model.action.canExecute)
+ this.model.action.execute()
+ }, _updateFromModelProperties: function _updateFromModelProperties() {
+ if (this.model) {
+ this.primaryStringId = null;
+ this.primaryText = this.model.primaryText;
+ this.primaryStringId = this.model.primaryStringId;
+ this.secondaryStringId = null;
+ this.secondaryText = this.model.secondaryText;
+ this.secondaryStringId = this.model.secondaryStringId;
+ this.details = this.model.details;
+ this.isVisible = this.model.isVisible !== undefined ? this.model.isVisible : true;
+ this.className = this.model.className;
+ this.showLoadingRing = this.model.showLoadingRing
+ }
+ else {
+ this.primaryText = null;
+ this.primaryStringId = this.defaultPrimaryStringId;
+ this.secondaryText = null;
+ this.secondaryStringId = this.defaultSecondaryStringId;
+ this.details = null;
+ this.isVisible = true;
+ this.className = null;
+ this.showLoadingRing = false
+ }
+ if (this.isVisible)
+ WinJS.Utilities.removeClass(this.failedPanelContainer, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this.failedPanelContainer, "removeFromDisplay")
+ }
+ }, {
+ model: null, primaryText: null, primaryStringId: null, secondaryText: null, secondaryStringId: null, details: null, isVisible: true, showLoadingRing: false, className: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ FailedPanelWithNotifications: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.FailedPanel", "/Controls/FailedPanel.html#failedPanelWithNotificationsTemplate", function failedPanelWithNotificationsConstructor(){}, {
+ _modelNotificationsBinding: null, initialize: function initialize() {
+ if (!this.model) {
+ this.model = new MS.Entertainment.UI.Controls.FailedPanelWithNotificationsModel;
+ this.model.primaryStringId = this.defaultPrimaryStringId;
+ this.model.secondaryStringId = this.defaultSecondaryStringId
+ }
+ this._modelNotificationsBinding = WinJS.Binding.bind(this, {model: {notifications: this._updateFromModelProperties.bind(this)}});
+ MS.Entertainment.UI.Controls.FailedPanel.prototype.initialize.call(this)
+ }, unload: function unload() {
+ if (this._modelNotificationsBinding) {
+ this._modelNotificationsBinding.cancel();
+ this._modelNotificationsBinding = null
+ }
+ MS.Entertainment.UI.Controls.FailedPanel.prototype.unload.call(this)
+ }, _updateFromModelProperties: function _updateFromModelProperties() {
+ if (this.model)
+ this.notifications = this.model.notifications;
+ else
+ this.notifications = null;
+ MS.Entertainment.UI.Controls.FailedPanel.prototype._updateFromModelProperties.call(this)
+ }
+ }, {notifications: null}), FailedPanelWithLink: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.FailedPanel", "/Controls/FailedPanel.html#failedPanelWithLinkTemplate", function failedPanelWithLinkConstructor(){}, {
+ _iconBinding: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.FailedPanel.prototype.initialize.call(this);
+ this._iconBinding = WinJS.Binding.bind(this.model, {linkIcon: this._updateIconFromModel.bind(this)})
+ }, unload: function unload() {
+ if (this._iconBinding) {
+ this._iconBinding.cancel();
+ this._iconBinding = null
+ }
+ MS.Entertainment.UI.Controls.FailedPanel.prototype.unload.call(this)
+ }, _updateIconFromModel: function _updateIconFromModel() {
+ if (this.model)
+ this.linkIcon = this.model.linkIcon;
+ else
+ this.linkIcon = null
+ }
+ }, {linkIcon: null}), FailedPanelWithQuery: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.FailedPanel", "/Controls/FailedPanel.html#failedPanelWithQueryTemplate", function failedPanelWithNotificationsConstructor(){}, {
+ _templateBinding: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.FailedPanel.prototype.initialize.call(this);
+ this._templateBinding = WinJS.Binding.bind(this.model, {itemTemplate: this._updateTemplateFromModel.bind(this)});
+ if (!this.model) {
+ this.model = new MS.Entertainment.UI.Controls.FailedPanelWithQueryModel;
+ this.model.primaryStringId = this.defaultPrimaryStringId;
+ this.model.secondaryStringId = this.defaultSecondaryStringId
+ }
+ if (this.model.query)
+ this.model.query.getItems().done(function populateAlbums(items) {
+ this.queryResults = items
+ }.bind(this), function onError(error) {
+ MS.Entertainment.Music.fail("Failed panel query failed: " + error && error.message)
+ })
+ }, applyAlbumGalleryItemTemplate: function applyAlbumGalleryItemTemplate(container, item, index) {
+ var element = container.querySelector(".imageHolder");
+ if (element !== null)
+ element.style.animationDelay = (index * 50) + "ms"
+ }, unload: function unload() {
+ if (this._templateBinding) {
+ this._templateBinding.cancel();
+ this._templateBinding = null
+ }
+ MS.Entertainment.UI.Controls.FailedPanel.prototype.unload.call(this)
+ }, _updateTemplateFromModel: function _updateTemplateFromModel() {
+ if (this.model)
+ this.itemTemplate = this.model.itemTemplate;
+ else
+ this.itemTemplate = null
+ }
+ }, {
+ queryResults: null, itemTemplate: null
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ DefaultFailedPanelModel: MS.Entertainment.defineObservable(function defaultFailedPanelModel() {
+ this.instance = this
+ }, {
+ showLoadingRing: false, primaryText: null, primaryStringId: null, secondaryText: null, secondaryStringId: null, details: null, action: null, instance: null, className: null
+ }), FailedPanelWithNotificationsModel: MS.Entertainment.defineObservable(function failedPanelWithNotificationsModel() {
+ this.instance = this
+ }, {
+ primaryText: null, primaryStringId: null, secondaryText: null, secondaryStringId: null, details: null, notifications: null, action: null, instance: null, className: null
+ }), FailedPanelWithQueryModel: MS.Entertainment.defineObservable(function FailedPanelWithQueryModel() {
+ this.instance = this
+ }, {
+ primaryText: null, primaryStringId: null, secondaryText: null, secondaryStringId: null, details: null, action: null, instance: null, itemTemplate: null, className: null, showLoadingRing: false
+ }), MarketplaceEmptyPanelModel: MS.Entertainment.defineObservable(function marketplaceEmptyPanelModel() {
+ this.instance = this
+ }, {
+ primaryStringId: String.id.IDS_MUSIC2_MARKETPLACE_MUSIC_GALLERY_EMPTY_DESC, secondaryStringId: null, details: null
+ }), SearchCollectionEmptyPanelModel: MS.Entertainment.defineObservable(function searchCollectionEmptyPanelModel() {
+ this.instance = this
+ }, {
+ primaryStringId: String.id.IDS_MUSIC_SEARCH_MY_EMPTY_TITLE, secondaryStringId: null, details: null, isVisible: false
+ }), Music2SearchCollectionEmptyPanelModel: MS.Entertainment.defineObservable(function searchCollectionEmptyPanelModel() {
+ this.instance = this
+ }, {
+ primaryStringId: String.id.IDS_MUSIC2_SEARCH_COLLECTION_EMPTY_TITLE, secondaryStringId: String.id.IDS_MUSIC2_SEARCH_COLLECTION_EMPTY_DESC, details: null, isVisible: false
+ }), SearchAllEmptyPanelModel: MS.Entertainment.defineObservable(function searchAllEmptyPanelModel() {
+ this.instance = this
+ }, {
+ primaryStringId: String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_TITLE, secondaryStringId: String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_DESC, details: null, isVisible: false
+ }), Music2SearchAllEmptyPanelModel: MS.Entertainment.defineObservable(function music2SearchAllEmptyPanelModel() {
+ this.instance = this
+ }, {
+ primaryStringId: String.id.IDS_MUSIC2_SEARCH_ALL_EMPTY_TITLE, secondaryStringId: String.id.IDS_MUSIC_SEARCH_ALL_EMPTY_DESC, details: null, isVisible: false
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/FeaturedContent.js b/packages/microsoft.zunevideo/controls/FeaturedContent.js
new file mode 100644
index 00000000..f9b6dfc6
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/FeaturedContent.js
@@ -0,0 +1,354 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/CoreFX.js", "/Framework/debug.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FeaturedContent: MS.Entertainment.UI.Framework.defineUserControl(null, function FeaturedContent_Constructor(element, options) {
+ this._view = this._getView()
+ }, {
+ enableClickEvents: false, doNotRaisePanelReady: false, _suppressFirstTimeBinds: false, _loadedTemplate: String.empty, _dataPromise: null, _dataComplete: null, _eventHandlers: null, _refreshingView: false, controlName: "FeaturedContent", _uiStateEventHandler: null, _refreshViewCallback: null, _bindings: null, initialize: function() {
+ this._dataPromise = new WinJS.Promise(function(c, e, p) {
+ this._dataComplete = c
+ }.bind(this));
+ this._suppressFirstTimeBinds = true;
+ this._clearBindings();
+ this._bindings = [];
+ this._bindings.push(WinJS.Binding.bind(this, {
+ _view: this._loadViewTemplate.bind(this), data: this._dataChanged.bind(this)
+ }));
+ if (this._refreshViewCallback) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).removeEventListener("windowresize", this._refreshViewCallback);
+ this._refreshViewCallback = null
+ }
+ this._refreshViewCallback = this._refreshView.bind(this);
+ if (this.templates)
+ this._bindings.push(WinJS.Binding.bind(this, {templates: this._loadViewTemplate.bind(this)}));
+ this._suppressFirstTimeBinds = false;
+ this._loadViewTemplate();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).addEventListener("windowresize", this._refreshViewCallback)
+ }, unload: function unload() {
+ if (this._refreshViewCallback) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).removeEventListener("windowresize", this._refreshViewCallback);
+ this._refreshViewCallback = null
+ }
+ if (this._uiStateEventHandler) {
+ this._uiStateEventHandler.cancel();
+ this._uiStateEventHandler = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ this._clearBindings();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _clearBindings: function _clearBindings() {
+ if (this._bindings)
+ this._bindings.forEach(function unbind(binding) {
+ binding.cancel()
+ });
+ this._bindings = null
+ }, _refreshView: function _refreshView() {
+ var newView = this._getView();
+ if (this._view !== newView) {
+ this._refreshingView = true;
+ this._view = newView
+ }
+ }, _dataChanged: function _dataChanged() {
+ if (this._suppressFirstTimeBinds)
+ return;
+ if (this.data === null) {
+ if (!this.doNotRaisePanelReady)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement, true);
+ return
+ }
+ if (this._dataComplete) {
+ this._dataComplete(this.data);
+ this._dataComplete = null
+ }
+ else {
+ this._dataPromise = WinJS.Promise.as(this.data);
+ this._reloadViewTemplate(this._loadedTemplate)
+ }
+ }, _setDataOnPreLoadedTemplate: function _setDataOnPreLoadedTemplate() {
+ var dataContext = null;
+ var container = null;
+ for (var i = 0; i < this._numViews; i++) {
+ var child = this.domElement.children[i];
+ if (i === this._view) {
+ WinJS.Utilities.removeClass(child, "removeFromDisplay");
+ container = child
+ }
+ else
+ WinJS.Utilities.addClass(child, "removeFromDisplay")
+ }
+ this._onTemplateLoaded(container);
+ if (WinJS.Utilities.hasClass(container, "bindingBlock"))
+ container = container.children[0];
+ this._dataPromise.then(function processAll(data) {
+ dataContext = data;
+ if (WinJS.Utilities.hasClass(container, "bindingBlock"))
+ return MS.Entertainment.UI.Framework.processDeclarativeControlContainer(container.winControl);
+ else
+ return WinJS.UI.processAll(container)
+ }).then(function processAll() {
+ return WinJS.Binding.processAll(container, dataContext)
+ }).done(function updatePlaybackControlBinds() {
+ var nowPlayingChild = this._nowPlaying && this._nowPlaying.children[0];
+ if (nowPlayingChild && this._nowPlayingControl)
+ WinJS.Binding.processAll(nowPlayingChild, this._nowPlayingControl);
+ if (this._upgradeTile && this._upgradeTile.domElement)
+ WinJS.Binding.processAll(this._upgradeTile.domElement, this._upgradeTile)
+ }.bind(this), function onError(error) {
+ if (error && error.message !== "Canceled")
+ MS.Entertainment.UI.Controls.fail("Error occurred while processing featured content changes: " + (error && error.message))
+ })
+ }, _loadViewTemplate: function _loadViewTemplate(newValue, oldValue) {
+ MS.Entertainment.UI.Controls.assert(this._view > -1, "No view set");
+ if (this._suppressFirstTimeBinds) {
+ if (!this._suppressFirstTimeBinds)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement, true);
+ return
+ }
+ if (this.templates) {
+ var maxSuppliedTemplateIndex = this.templates.length - 1;
+ var selectedTemplate = this.templates[Math.min(this._view, maxSuppliedTemplateIndex)];
+ if (selectedTemplate !== this._loadedTemplate) {
+ MS.Entertainment.Utilities.empty(this.domElement);
+ if (selectedTemplate)
+ this._reloadViewTemplate(selectedTemplate);
+ else
+ this._loadedTemplate = String.empty
+ }
+ }
+ else if (this.domElement)
+ this._setDataOnPreLoadedTemplate()
+ }, _reloadViewTemplate: function _reloadViewTemplate(template) {
+ if (!template || !this.domElement) {
+ if (this.domElement)
+ this._setDataOnPreLoadedTemplate();
+ return
+ }
+ MS.Entertainment.Utilities.empty(this.domElement);
+ var container = document.createElement("div");
+ this.domElement.appendChild(container);
+ MS.Entertainment.Utilities.loadHtmlPage(template, container, this._dataPromise).then(function() {
+ if (this._unloaded)
+ return;
+ this._loadedTemplate = template;
+ this._onTemplateLoaded(container)
+ }.bind(this))
+ }, _onTemplateLoaded: function _onTemplateLoaded(container) {
+ this._refreshingView = false;
+ if (!this.doNotRaisePanelReady)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement);
+ if (this.enableClickEvents) {
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(container, {click: this._onItemClicked.bind(this)})
+ }
+ }, _onItemClicked: function _onItemClicked(e) {
+ if (this._uiStateEventHandler) {
+ this._uiStateEventHandler.cancel();
+ this._uiStateEventHandler = null
+ }
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.stageThreeActivated) {
+ var element = e.srcElement;
+ while (element && element !== this.domElement) {
+ if (element.clickDataContext && element.clickDataContext.doclick) {
+ element.clickDataContext.doclick({
+ target: element.clickDataContext, domElement: element
+ });
+ e.stopPropagation();
+ return
+ }
+ else if (element === this._dashboardNowPlaying && this._nowPlayingControl) {
+ this._nowPlayingControl.nowPlayingClick();
+ e.stopPropagation();
+ return
+ }
+ element = element.parentElement
+ }
+ }
+ else {
+ var oldEvent = e;
+ this._uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(uiStateService, {stageThreeActivatedChanged: function stageThreeActivatedChanged(activateEvent) {
+ if (activateEvent.detail.newValue)
+ this._onItemClicked(oldEvent)
+ }.bind(this)})
+ }
+ }, _getView: function _getView() {
+ return MS.Entertainment.UI.Controls.FeaturedContent.getViewByResolution()
+ }
+ }, {
+ _view: -1, _numViews: 2, data: undefined, templates: null
+ }, {getViewByResolution: function getViewByResolution() {
+ return (MS.Entertainment.Utilities.isHighResolution() ? 1 : 0)
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SpotlightFeaturedContent: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.FeaturedContent", null, null, {
+ _nowPlayingControl: null, _nowPlayingBindings: null, _upgradeServiceBindings: null, _scriptsLoadedEventHandler: null, unload: function unload() {
+ if (this._nowPlayingBindings) {
+ this._nowPlayingBindings.cancel();
+ this._nowPlayingBindings = null
+ }
+ if (this._upgradeServiceBindings) {
+ this._upgradeServiceBindings.cancel();
+ this._upgradeServiceBindings = null
+ }
+ if (this._nowPlayingControl)
+ this._nowPlayingControl = null;
+ MS.Entertainment.UI.Controls.FeaturedContent.prototype.unload.call(this)
+ }, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.FeaturedContent.prototype.initialize.call(this);
+ if (!MS.Entertainment.Utilities.isApp2) {
+ var upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ this._upgradeServiceBindings = MS.Entertainment.Utilities.addEventHandlers(upgradeService, {upgradeRequiredChanged: this._displayUpgradeMessageIfNeeded.bind(this)})
+ }
+ }, _onTemplateLoaded: function _onTemplateLoaded(container) {
+ if (this._scriptsLoadedEventHandler) {
+ this._scriptsLoadedEventHandler.cancel();
+ this._scriptsLoadedEventHandler = null
+ }
+ MS.Entertainment.UI.Controls.FeaturedContent.prototype._onTemplateLoaded.apply(this, arguments);
+ MS.Entertainment.UI.Framework.processDeclMembers(container, this, true);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.stageThreeActivated)
+ this._loadNowPlayingTile(container);
+ else
+ this._scriptsLoadedEventHandler = MS.Entertainment.Utilities.addEventHandlers(uiStateService, {stageThreeActivatedChanged: function stageThreeActivatedChanged(activateEvent) {
+ if (activateEvent.detail.newValue) {
+ if (this._scriptsLoadedEventHandler) {
+ this._scriptsLoadedEventHandler.cancel();
+ this._scriptsLoadedEventHandler = null
+ }
+ this._loadNowPlayingTile(container)
+ }
+ }.bind(this)})
+ }, _loadNowPlayingTile: function loadNowPlayingTile(container) {
+ var host = null;
+ if (this._nowPlaying && this._nowPlaying.appendChild && !this._nowPlayingControl) {
+ MS.Entertainment.Utilities.empty(this._nowPlaying);
+ host = document.createElement("div");
+ host.className = "fillParent homeHubNowPlayingTile";
+ this._nowPlaying.appendChild(host);
+ MS.Entertainment.Utilities.toggleHideOnElement(this._nowPlaying, false);
+ var options = {
+ allowAnimations: false, preventHideDuringInitialize: true, isRemoteSession: false
+ };
+ if (host)
+ this._nowPlayingControl = new MS.Entertainment.UI.Controls.HomeNowPlayingTilePoster(host, options);
+ if (this._nowPlayingControl) {
+ WinJS.Binding.processAll(host, this._nowPlayingControl);
+ this._nowPlayingBindings = WinJS.Binding.bind(this._nowPlayingControl, {visible: function bind_nowPlaying() {
+ if (this._nowPlayingControl.visible)
+ WinJS.Utilities.addClass(this.domElement.parentElement.parentElement, "nowPlayingTileShowing");
+ else
+ WinJS.Utilities.removeClass(this.domElement.parentElement.parentElement, "nowPlayingTileShowing")
+ }.bind(this)})
+ }
+ }
+ this._displayUpgradeMessageIfNeeded()
+ }, _upgradeTile: null, _displayUpgradeMessageIfNeeded: function _displayUpgradeMessageIfNeeded() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer) || !MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer).upgradeRequired || !this._upgradeContainer)
+ return;
+ MS.Entertainment.Utilities.empty(this._upgradeContainer);
+ var host = document.createElement("div");
+ host.className = "fillParent";
+ this._upgradeContainer.appendChild(host);
+ MS.Entertainment.Utilities.toggleHideOnElement(this._upgradeContainer, false);
+ MS.Entertainment.UI.Controls.UpgradeTile.getUpgradeFeedInformation().done(function(data) {
+ this._upgradeTile = new MS.Entertainment.UI.Controls.UpgradeTile(host, data)
+ }.bind(this))
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NowPlayingFeaturedContent: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.SpotlightFeaturedContent", null, null, {
+ controlName: "NowPlayingFeaturedContent", _nowPlayingControl: null, _userEngagementBinding: null, _userEngagementMessage: null, _userEngagementService: null, _uiStateService: {get: function() {
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)
+ }}, freeze: function freeze() {
+ this._releaseNowPlayingControl();
+ MS.Entertainment.UI.Controls.SpotlightFeaturedContent.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.SpotlightFeaturedContent.prototype.thaw.call(this);
+ if (!this._refreshingView)
+ this._reclaimNowPlayingControl()
+ }, unload: function unloaded() {
+ this._releaseNowPlayingControl();
+ if (this._userEngagementBinding) {
+ this._userEngagementBinding.cancel();
+ this._userEngagementBinding = null
+ }
+ MS.Entertainment.UI.Controls.SpotlightFeaturedContent.prototype.unload.call(this)
+ }, _onTemplateLoaded: function _onTemplateLoaded(container) {
+ MS.Entertainment.UI.Controls.FeaturedContent.prototype._onTemplateLoaded.apply(this, arguments);
+ MS.Entertainment.UI.Framework.processDeclMembers(container, this, true);
+ if (!this._uiStateService.isSnapped)
+ this._reclaimNowPlayingControl();
+ this._displayUpgradeMessageIfNeeded();
+ if (this.outOfBandMessagingContainer) {
+ if (!this._userEngagementService)
+ this._userEngagementService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userEngagementService);
+ if (this._userEngagementService.userEngagementMessageContent)
+ this._showUserEngagementMessage();
+ if (!this._userEngagementBinding)
+ this._userEngagementBinding = MS.Entertainment.UI.Framework.addEventHandlers(this._userEngagementService, {
+ displayUserEngagementServiceVisuals: this._showUserEngagementMessage.bind(this), hideUserEngagementServiceVisuals: this._hideUserEngagementMessage.bind(this)
+ })
+ }
+ }, _showUserEngagementMessage: function _showUserEngagementMessage() {
+ WinJS.Utilities.removeClass(this.outOfBandMessagingContainer, "removeFromDisplay");
+ MS.Entertainment.Utilities.empty(this.outOfBandMessagingContainer);
+ var messagingContainerInnerDiv = document.createElement("div");
+ messagingContainerInnerDiv.className = this.outOfBandMessagingContainer.className;
+ this._userEngagementMessage = new MS.Entertainment.UI.UserEngagementServiceMessage(messagingContainerInnerDiv, {userMessageResponse: this._userEngagementService.userEngagementMessageContent});
+ this.outOfBandMessagingContainer.appendChild(messagingContainerInnerDiv);
+ this._hideSecondColumnItemsFromAccessibility()
+ }, _hideSecondColumnItemsFromAccessibility: function _hideSecondColumnItemsFromAccessibility() {
+ if (this.columnTwoFirstItem && this.columnTwoFirstItem.domElement) {
+ WinJS.Utilities.removeClass(this.columnTwoFirstItem.domElement, "win-focusable");
+ this.columnTwoFirstItem.domElement.setAttribute("aria-hidden", "true")
+ }
+ if (this.columnTwoSecondItem && this.columnTwoSecondItem.domElement) {
+ WinJS.Utilities.removeClass(this.columnTwoSecondItem.domElement, "win-focusable");
+ this.columnTwoSecondItem.domElement.setAttribute("aria-hidden", "true")
+ }
+ if (this.columnTwoThirdItem && this.columnTwoThirdItem.domElement) {
+ WinJS.Utilities.removeClass(this.columnTwoThirdItem.domElement, "win-focusable");
+ this.columnTwoThirdItem.domElement.setAttribute("aria-hidden", "true")
+ }
+ }, _hideUserEngagementMessage: function _hideUserEngagementMessage() {
+ this._showSecondColumnItemsToAccessibility();
+ WinJS.Utilities.addClass(this.outOfBandMessagingContainer, "removeFromDisplay");
+ MS.Entertainment.Utilities.empty(this.outOfBandMessagingContainer);
+ this._userEngagementMessage = null
+ }, _showSecondColumnItemsToAccessibility: function _showSecondColumnItemsToAccessibility() {
+ if (this.columnTwoFirstItem && this.columnTwoFirstItem.domElement) {
+ WinJS.Utilities.addClass(this.columnTwoFirstItem.domElement, "win-focusable");
+ this.columnTwoFirstItem.domElement.setAttribute("aria-hidden", "false")
+ }
+ if (this.columnTwoSecondItem && this.columnTwoSecondItem.domElement) {
+ WinJS.Utilities.addClass(this.columnTwoSecondItem.domElement, "win-focusable");
+ this.columnTwoSecondItem.domElement.setAttribute("aria-hidden", "false")
+ }
+ if (this.columnTwoThirdItem && this.columnTwoThirdItem.domElement) {
+ WinJS.Utilities.addClass(this.columnTwoThirdItem.domElement, "win-focusable");
+ this.columnTwoThirdItem.domElement.setAttribute("aria-hidden", "false")
+ }
+ }, _reclaimNowPlayingControl: function _getNowPlayingControl() {
+ if (!this._uiStateService.isSnapped) {
+ this._uiStateService.nowPlayingTileVisible = true;
+ this._nowPlayingControl = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).getNowPlayingControl(MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying);
+ if (this._dashboardNowPlaying) {
+ MS.Entertainment.Utilities.empty(this._dashboardNowPlaying);
+ this._dashboardNowPlaying.appendChild(this._nowPlayingControl.domElement)
+ }
+ }
+ }, _releaseNowPlayingControl: function _releaseNowPlayingControl() {
+ if (this._nowPlayingControl) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).releaseNowPlayingControl(MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying);
+ this._nowPlayingControl = null
+ }
+ this._uiStateService.nowPlayingTileVisible = false
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/FlipView.html b/packages/microsoft.zunevideo/controls/FlipView.html
new file mode 100644
index 00000000..73a63e4e
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/FlipView.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+ Flip View Template
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/FlipView.js b/packages/microsoft.zunevideo/controls/FlipView.js
new file mode 100644
index 00000000..e3729513
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/FlipView.js
@@ -0,0 +1,104 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FlipView: MS.Entertainment.UI.Framework.defineUserControl("/Controls/FlipView.html#flipViewTemplate", function flipViewConstructor(element, options){}, {
+ horizontal: false, itemClicked: null, mediaType: "video", _pendingSelectIndex: -1, _itemTemplateProvider: null, _itemTemplate: null, itemTemplate: {
+ get: function() {
+ return this._itemTemplate
+ }, set: function(value) {
+ if (value !== this._itemTemplate) {
+ this._itemTemplateProvider = null;
+ this._itemTemplate = value;
+ if (this._itemTemplate)
+ this._loadTemplate(this._itemTemplate, this, "_itemTemplateProvider")
+ }
+ }
+ }, selectIndex: function selectIndex(index) {
+ this._pendingSelectIndex = (index !== undefined) ? index : this._pendingSelectIndex;
+ if (this._pendingSelectIndex >= 0 && this.flipViewContainer.winControl)
+ if (this._pendingSelectIndex !== this.flipViewContainer.winControl.currentPage) {
+ if (this._pendingSelectIndex === this.flipViewContainer.winControl.currentPage - 1)
+ this.flipViewContainer.winControl.previous();
+ else
+ this.flipViewContainer.winControl.currentPage = this._pendingSelectIndex;
+ this._pendingSelectIndex = -1
+ }
+ }, initialize: function initialize() {
+ var that = this;
+ this.bind("dataSource", this._beginUpdateLayout.bind(this));
+ this.bind("selectedIndex", this._selectedIndexChanged.bind(this))
+ }, ensureVisible: function ensureVisible(index) {
+ this.selectIndex(index)
+ }, _loadTemplate: function flipViewLoadTemplate(fragment, element, name, finish) {
+ MS.Entertainment.UI.Framework.loadTemplate(fragment).then(function(frag) {
+ element[name] = frag;
+ if (!finish && typeof finish === "function")
+ finish()
+ })
+ }, _beginUpdateLayout: function flipViewBeginUpdateLayout() {
+ var that = this;
+ if (!this.dataSource || (that.dataSource.items !== null && that.dataSource.items !== undefined && this.dataSource.items.count === undefined)) {
+ MS.Entertainment.Utilities.empty(that.flipViewContainer);
+ return
+ }
+ if (this.itemTemplate === null)
+ throw new Error("No item rendering template specified.");
+ if (this.grouped && !this.groupTemplate)
+ throw new Error("No group header template specified for grouped list.");
+ if (this._itemTemplate && !this._itemTemplateProvider) {
+ MS.Entertainment.UI.Framework.loadTemplate(this._itemTemplate).then(function(frag) {
+ that._itemTemplateProvider = frag;
+ that._beginUpdateLayout()
+ });
+ return
+ }
+ this._updateLayout()
+ }, _selectedIndexChanged: function _selectedIndexChanged() {
+ this.selectIndex(this.selectedIndex)
+ }, _updateLayout: function flipViewUpdateLayout() {
+ var that = this;
+ if (this.dataSource === null || this.dataSource.length === 0) {
+ MS.Entertainment.Utilities.empty(that.flipViewContainer);
+ return
+ }
+ if (this._itemTemplateProvider === null)
+ throw new Error("No item rendering template loaded.");
+ var flipView = new WinJS.UI.FlipView(this.flipViewContainer, {
+ horizontal: this.horizontal, itemDataSource: this.dataSource, itemTemplate: WinJS.UI.simpleItemRenderer(function flipViewItemRenderer(item) {
+ var dataObject = item.data;
+ var tagName = that._itemTemplateProvider.element.tagName;
+ if (tagName === null || tagName === undefined)
+ tagName = "DIV";
+ var container = document.createElement(tagName);
+ var requestedImage;
+ if (that.mediaType === "track")
+ requestedImage = MS.Entertainment.ImageRequested.albumImage;
+ else
+ requestedImage = MS.Entertainment.ImageRequested.primaryImage;
+ MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(dataObject, 300, 300, requestedImage).then(function imageUriAvailable(uri) {
+ dataObject.imageUri = uri;
+ that._itemTemplateProvider.render(dataObject, container);
+ container.serviceId = dataObject.serviceId
+ }.bind(this));
+ return container
+ })
+ });
+ if (this._pendingSelectIndex >= 0)
+ this.selectIndex();
+ flipView.addEventListener("pageselected", function(event) {
+ if (that.selectedIndex !== flipView.currentPage) {
+ this.selectedIndex = flipView.currentPage;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("iteminvoked", true, true);
+ domEvent.detail = {
+ itemPromise: this.dataSource.itemFromIndex(flipView.currentPage), itemIndex: flipView.currentPage
+ };
+ this.domElement.dispatchEvent(domEvent)
+ }
+ }.bind(this), false)
+ }
+ }, {
+ dataSource: null, selectedIndex: 0
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Flyout.html b/packages/microsoft.zunevideo/controls/Flyout.html
new file mode 100644
index 00000000..a2c1f1d9
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Flyout.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ FlyOut Control Template
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Flyout.js b/packages/microsoft.zunevideo/controls/Flyout.js
new file mode 100644
index 00000000..ef779f7e
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Flyout.js
@@ -0,0 +1,6 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {Flyout: MS.Entertainment.UI.Framework.defineUserControl("/Controls/Flyout.html#flyoutTemplate", function Flyout_Constructor(element, options){}, {})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/GalleryControl.html b/packages/microsoft.zunevideo/controls/GalleryControl.html
new file mode 100644
index 00000000..0634c515
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/GalleryControl.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+ Gallery Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/GalleryThumbnail.js b/packages/microsoft.zunevideo/controls/GalleryThumbnail.js
new file mode 100644
index 00000000..d074a777
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/GalleryThumbnail.js
@@ -0,0 +1,9 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {GalleryThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MediaItemThumbnail", "/Controls/ThumbnailButton.html#thumbnailButtonTemplate", null, {initialize: function galleryThumbnail_initialize() {
+ MS.Entertainment.UI.Controls.MediaItemThumbnail.prototype.initialize.apply(this, arguments);
+ this.imageLoadAnimation = MS.Entertainment.Animations.Gallery.loadImage
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Hub.html b/packages/microsoft.zunevideo/controls/Hub.html
new file mode 100644
index 00000000..12e6d0c4
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Hub.html
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ Hub Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Hub.js b/packages/microsoft.zunevideo/controls/Hub.js
new file mode 100644
index 00000000..5dd9935f
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Hub.js
@@ -0,0 +1,315 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ Hub: MS.Entertainment.UI.Framework.defineUserControl("/Controls/Hub.html#hubControlTemplate", function hubStripConstructor(element, options) {
+ if (this.overrideTemplate)
+ this._initTemplate(this.overrideTemplate);
+ this.panels = [];
+ this.eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ this.domElement.addEventListener("PanelLoadingStarted", function countLoadedPanels(e) {
+ this.panelsCompleted++;
+ if (this.panelsCompleted === this.panels.length) {
+ this.eventProvider.traceHub_Load_End(this.id || "");
+ WinJS.Utilities.addClass(this.domElement, this.id);
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("HubLoaded", true, true);
+ domEvent.hubId = this.id;
+ this.domElement.dispatchEvent(domEvent)
+ }
+ }.bind(this));
+ this.domElement.addEventListener("PanelReady", function panelsReadyHandler() {
+ this.panelsReady++;
+ if (this.panelsReady === this.panels.length) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("HubReady", true, true);
+ domEvent.hubId = this.id;
+ this.domElement.dispatchEvent(domEvent);
+ this.eventProvider.traceHub_Ready(this.id || "")
+ }
+ }.bind(this))
+ }, {
+ id: null, eventProvider: null, overrideTemplate: "", panelsCompleted: 0, panelsReady: 0, initialize: function initialize() {
+ this.eventProvider.traceHub_Load_Start(this.id || "")
+ }
+ }, {panels: null}), Panel: MS.Entertainment.UI.Framework.defineUserControl("/Controls/Hub.html#panelControlTemplate", function constructPanel() {
+ this._dataContextChanged = this._dataContextChangedImpl.bind(this);
+ this._primaryModifierChanged = this._primaryModifierChangedImpl.bind(this);
+ this._primaryItemsChanged = this._primaryItemsChangedImpl.bind(this);
+ this._primarySelectedItemChanged = this._primarySelectedItemChangedImpl.bind(this);
+ this._secondaryModifierChanged = this._secondaryModifierChangedImpl.bind(this);
+ this._secondaryItemsChanged = this._secondaryItemsChangedImpl.bind(this);
+ this._secondarySelectedItemChanged = this._secondarySelectedItemChangedImpl.bind(this);
+ this._tertiaryModifierChanged = this._tertiaryModifierChangedImpl.bind(this);
+ this._tertiaryItemsChanged = this._tertiaryItemsChangedImpl.bind(this);
+ this._tertiarySelectedItemChanged = this._tertiarySelectedItemChangedImpl.bind(this)
+ }, {
+ fragmentUrl: "", initialize: function initialize() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.tracePanel_Load_Start(this.id || "");
+ if (this.primaryModifierControl)
+ this.primaryModifierControl.bind("selectedItem", this._primaryModifierControlSelectedItemChanged.bind(this));
+ if (this.secondaryModifierControl) {
+ this.secondaryModifierControl.bind("selectedItem", this._secondaryModifierControlSelectedItemChanged.bind(this));
+ this.secondaryModifierControl.setTabPanel(this.panelFragmentContainer)
+ }
+ if (this.tertiaryModifierControl) {
+ this.tertiaryModifierControl.bind("selectedItem", this._tertiaryModifierControlSelectedItemChanged.bind(this));
+ this.tertiaryModifierControl.setTabPanel(this.panelFragmentContainer)
+ }
+ MS.Entertainment.Framework.AccUtils.createAndAddAriaLink(this.panelContentContainer, this.titleLabel, "aria-labelledby");
+ if (!this.fragmentUrl)
+ return;
+ if (!this.dataContext && this.options && this.options.panel) {
+ this.dataContext = this.options.panel.getDataContext();
+ if (!this.dataContext && this.options.hub)
+ this.dataContext = this.options.hub.getDataContext();
+ if (!this.dataContext && this.options.page)
+ this.dataContext = this.options.page.getDataContext()
+ }
+ this.bind("dataContext", this._dataContextChanged);
+ if (this.dataContext && this.dataContext.panelAction)
+ this.panelAction = this.dataContext.panelAction;
+ this.bind("isLoading", function isLoadingChanged() {
+ if (!this.isLoading || this.hideLoadingPanel) {
+ MS.Entertainment.Utilities.hideElement(this.loadingControl);
+ if (!this.isFailed) {
+ if (this.titleLabel.text === " ") {
+ WinJS.Utilities.addClass(this.titleLabel.domElement, "removeFromDisplay");
+ this.titleLabel.text = String.empty
+ }
+ MS.Entertainment.Utilities.showElement(this.panelFragmentContainer)
+ }
+ }
+ else {
+ MS.Entertainment.Utilities.hideElement(this.panelFragmentContainer);
+ if (!this.titleLabel.text)
+ this.titleLabel.text = " ";
+ this.loadingLabel.textContent = String.load(String.id.IDS_LOADING_STATUS_LABEL);
+ MS.Entertainment.Utilities.showElement(this.loadingControl)
+ }
+ }.bind(this));
+ this.bind("isFailed", function isFailedChanged(newValue, oldValue) {
+ if (this.isFailed) {
+ WinJS.Utilities.addClass(this.domElement, "failed");
+ MS.Entertainment.Utilities.hideElement(this.loadingControl);
+ MS.Entertainment.Utilities.showElement(this.failedControl);
+ MS.Entertainment.Utilities.showElement(this.panelFragmentContainer);
+ var newControl = document.createElement("div");
+ newControl.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.FailedPanel");
+ if (!this.titleLabel.text)
+ this.titleLabel.text = " ";
+ this.failedControl.appendChild(newControl);
+ WinJS.UI.process(newControl).then(function setModel() {
+ newControl.winControl.model = this.failedModel
+ }.bind(this));
+ if (this.panelAction) {
+ var action = WinJS.Binding.unwrap(this.panelAction);
+ action.action.isEnabled = false
+ }
+ MS.Entertainment.Utilities.hideElement(this.primaryModifierControl.domElement);
+ MS.Entertainment.Utilities.hideElement(this.secondaryModifierControl.domElement);
+ MS.Entertainment.Utilities.hideElement(this.tertiaryModifierControl.domElement)
+ }
+ else {
+ WinJS.Utilities.removeClass(this.domElement, "failed");
+ MS.Entertainment.Utilities.hideElement(this.failedControl);
+ if (oldValue) {
+ MS.Entertainment.Utilities.showElement(this.panelFragmentContainer);
+ MS.Entertainment.Utilities.showElement(this.primaryModifierControl.domElement);
+ MS.Entertainment.Utilities.showElement(this.secondaryModifierControl.domElement);
+ MS.Entertainment.Utilities.showElement(this.tertiaryModifierControl.domElement);
+ MS.Entertainment.Utilities.hideElement(this.loadingControl);
+ if (this.panelAction) {
+ var action = WinJS.Binding.unwrap(this.panelAction);
+ action.action.isEnabled = true
+ }
+ }
+ }
+ }.bind(this));
+ MS.Entertainment.UI.Framework.loadTemplate(this.fragmentUrl).then(function renderControl(controlInstance) {
+ return controlInstance.render(this, this.panelFragmentContainer).then(function raiseEvent() {
+ if (this.id) {
+ this.domElement.setAttribute("data-win-automationid", this.id);
+ WinJS.Utilities.addClass(this.domElement, this.id)
+ }
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelLoadingStarted", true, true);
+ this.panelFragmentContainer.dispatchEvent(domEvent);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.tracePanel_Load_End(this.id || "")
+ }.bind(this))
+ }.bind(this)).then(function completePanelInit() {
+ if (!this.dataContext || !this.dataContext.doNotRaisePanelReady)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.panelFragmentContainer)
+ }.bind(this))
+ }, unload: function unload() {
+ this.unbind("dataContext", this._dataContextChanged);
+ if (this.dataContext) {
+ this.dataContext.unbind("primaryModifier", this._primaryModifierChanged);
+ this.dataContext.unbind("secondaryModifier", this._secondaryModifierChanged);
+ this.dataContext.unbind("tertiaryModifier", this._tertiaryModifierChanged);
+ if (this.dataContext.primaryModifier) {
+ this.dataContext.primaryModifier.unbind("items", this._primaryItemsChanged);
+ this.dataContext.primaryModifier.unbind("selectedItem", this._primarySelectedItemChanged)
+ }
+ if (this.dataContext.secondaryModifier) {
+ this.dataContext.secondaryModifier.unbind("items", this._primaryItemsChanged);
+ this.dataContext.secondaryModifier.unbind("selectedItem", this._primarySelectedItemChanged)
+ }
+ if (this.dataContext.tertiaryModifier) {
+ this.dataContext.tertiaryModifier.unbind("items", this._tertiaryItemsChanged);
+ this.dataContext.tertiaryModifier.unbind("selectedItem", this._tertiarySelectedItemChanged)
+ }
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, hideLoadingPanel: {get: function() {
+ return (this.dataContext) ? this.dataContext.hideLoadingPanel : false
+ }}, handlePanelReady: function handlePanelReady(event) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (event.failed || (!event.failed && this.isFailed)) {
+ this.failedModel = event.model;
+ this.isFailed = event.failed
+ }
+ event.panelId = this.id;
+ this.isLoading = false;
+ eventProvider.tracePanel_Ready(this.id || "")
+ }, handlePanelReset: function handlePanelReset(event) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (!this.isLoading) {
+ eventProvider.tracePanel_Load_Start(this.id || "");
+ this.failedModel = null;
+ this.isFailed = false;
+ this.isLoading = true
+ }
+ }, _dataContextChangedImpl: function _dataContextChangedImpl(newValue, oldValue) {
+ newValue = WinJS.Binding.as(newValue);
+ oldValue = WinJS.Binding.as(oldValue);
+ if (oldValue) {
+ oldValue.unbind("primaryModifier", this._primaryModifierChanged);
+ oldValue.unbind("secondaryModifier", this._secondaryModifierChanged);
+ oldValue.unbind("tertiaryModifier", this._tertiaryModifierChanged)
+ }
+ if (newValue) {
+ newValue.bind("primaryModifier", this._primaryModifierChanged);
+ this.panelAction = newValue.panelAction
+ }
+ else
+ this.panelAction = null
+ }, _dataContextChanged: null, _primaryModifierChangedImpl: function _primaryModifierChangedImpl(newValue, oldValue) {
+ newValue = WinJS.Binding.as(newValue);
+ oldValue = WinJS.Binding.as(oldValue);
+ if (oldValue) {
+ oldValue.unbind("items", this._primaryItemsChanged);
+ oldValue.unbind("selectedItem", this._primarySelectedItemChanged)
+ }
+ if (newValue) {
+ WinJS.Utilities.addClass(this.titleLabel.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.primaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.addClass(this.primaryModifierControl.domElement, "pivotModifier");
+ newValue.bind("items", this._primaryItemsChanged);
+ newValue.bind("selectedItem", this._primarySelectedItemChanged);
+ this.dataContext.bind("secondaryModifier", this._secondaryModifierChanged);
+ this.dataContext.bind("tertiaryModifier", this._tertiaryModifierChanged);
+ if (this.primaryModifierControl && newValue.settingsKey) {
+ this.primaryModifierControl.isRoamingSetting = !MS.Entertainment.Utilities.isVideoApp2 && newValue.isRoamingSetting;
+ this.primaryModifierControl.settingsKey = newValue.settingsKey
+ }
+ }
+ else {
+ WinJS.Utilities.removeClass(this.titleLabel.domElement, "removeFromDisplay");
+ if (this.primaryModifierControl) {
+ WinJS.Utilities.addClass(this.primaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.primaryModifierControl.domElement, "pivotModifier")
+ }
+ if (this.secondaryModifierControl) {
+ this.dataContext.unbind("secondaryModifier", this._secondaryModifierChanged);
+ WinJS.Utilities.addClass(this.secondaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.secondaryModifierControl.domElement, "pivotModifier")
+ }
+ if (this.tertiaryModifierControl) {
+ this.dataContext.unbind("tertiaryModifier", this._tertiaryModifierChanged);
+ WinJS.Utilities.addClass(this.tertiaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.tertiaryModifierControl.domElement, "pivotModifier")
+ }
+ }
+ }, _primaryModifierChanged: null, _primaryItemsChangedImpl: function _primaryItemsChangedImpl(newValue) {
+ if (this.primaryModifierControl.items !== newValue)
+ this.primaryModifierControl.items = newValue
+ }, _primaryItemsChanged: null, _primarySelectedItemChangedImpl: function _primarySelectedItemChangedImpl(newValue) {
+ if (this.primaryModifierControl.selectedItem !== newValue)
+ this.primaryModifierControl.selectedItem = newValue
+ }, _primarySelectedItemChanged: null, _primaryModifierControlSelectedItemChanged: function _primaryModifierControlSelectedItemChanged(newValue) {
+ if (this.dataContext && this.dataContext.primaryModifier && this.dataContext.primaryModifier.selectedItem !== newValue)
+ this.dataContext.primaryModifier.selectedItem = newValue
+ }, _secondaryModifierChangedImpl: function _secondaryModifierChangedImpl(newValue, oldValue) {
+ newValue = WinJS.Binding.as(newValue);
+ oldValue = WinJS.Binding.as(oldValue);
+ if (oldValue) {
+ oldValue.unbind("items", this._secondaryItemsChanged);
+ oldValue.unbind("selectedItem", this._secondarySelectedItemChanged)
+ }
+ if (newValue) {
+ newValue.bind("items", this._secondaryItemsChanged);
+ newValue.bind("selectedItem", this._secondarySelectedItemChanged)
+ }
+ else {
+ WinJS.Utilities.addClass(this.secondaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.secondaryModifierControl.domElement, "pivotModifier")
+ }
+ }, _secondaryModifierChanged: null, _secondaryItemsChangedImpl: function _secondaryItemsChangedImpl(newValue) {
+ if (!this.secondaryModifierControl)
+ return;
+ if (this.secondaryModifierControl.items !== newValue)
+ this.secondaryModifierControl.items = newValue;
+ if (this.secondaryModifierControl.items.length) {
+ WinJS.Utilities.removeClass(this.secondaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.addClass(this.secondaryModifierControl.domElement, "pivotModifier")
+ }
+ else {
+ WinJS.Utilities.addClass(this.secondaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.secondaryModifierControl.domElement, "pivotModifier")
+ }
+ }, _secondaryItemsChanged: null, _secondarySelectedItemChangedImpl: function _secondarySelectedItemChangedImpl(newValue) {
+ if (this.secondaryModifierControl.selectedItem !== newValue)
+ this.secondaryModifierControl.selectedItem = newValue
+ }, _secondarySelectedItemChanged: null, _secondaryModifierControlSelectedItemChanged: function _secondaryModifierControlSelectedItemChanged(newValue) {
+ if (this.dataContext && this.dataContext.secondaryModifier && this.dataContext.secondaryModifier.selectedItem !== newValue)
+ this.dataContext.secondaryModifier.selectedItem = newValue
+ }, _tertiaryModifierChangedImpl: function _tertiaryModifierChangedImpl(newValue, oldValue) {
+ newValue = WinJS.Binding.as(newValue);
+ oldValue = WinJS.Binding.as(oldValue);
+ if (oldValue) {
+ oldValue.unbind("items", this._tertiaryItemsChanged);
+ oldValue.unbind("selectedItem", this._tertiarySelectedItemChanged)
+ }
+ if (newValue) {
+ newValue.bind("items", this._tertiaryItemsChanged);
+ newValue.bind("selectedItem", this._tertiarySelectedItemChanged)
+ }
+ else {
+ WinJS.Utilities.addClass(this.tertiaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this.tertiaryModifierControl.domElement, "pivotModifier")
+ }
+ }, _tertiaryModifierChanged: null, _tertiaryItemsChangedImpl: function _tertiaryItemsChangedImpl(newValue) {
+ if (this.tertiaryModifierControl.items !== newValue)
+ this.tertiaryModifierControl.items = newValue;
+ if (this.tertiaryModifierControl.items.length) {
+ WinJS.Utilities.removeClass(this.tertiaryModifierControl.domElement, "removeFromDisplay");
+ WinJS.Utilities.addClass(this.tertiaryModifierControl.domElement, "pivotModifier")
+ }
+ }, _tertiaryItemsChanged: null, _tertiarySelectedItemChangedImpl: function _tertiarySelectedItemChangedImpl(newValue) {
+ if (this.tertiaryModifierControl.selectedItem !== newValue)
+ this.tertiaryModifierControl.selectedItem = newValue
+ }, _tertiarySelectedItemChanged: null, _tertiaryModifierControlSelectedItemChanged: function _tertiaryModifierControlSelectedItemChanged(newValue) {
+ if (this.dataContext && this.dataContext.tertiaryModifier && this.dataContext.tertiaryModifier.selectedItem !== newValue)
+ this.dataContext.tertiaryModifier.selectedItem = newValue
+ }
+ }, {
+ title: "", dataContext: null, options: null, panelAction: null, id: null, hub: null, isLoading: true, isFailed: false, failedModel: null, showShadow: true
+ }, {
+ raisePanelReady: MS.Entertainment.Utilities.raisePanelReady, raisePanelReadyTest: MS.Entertainment.Utilities.raisePanelReadyTest, raisePanelReset: MS.Entertainment.Utilities.raisePanelReset
+ })
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/HubStrip.html b/packages/microsoft.zunevideo/controls/HubStrip.html
new file mode 100644
index 00000000..93d8d0ca
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/HubStrip.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+ Hub Strip Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/HubStrip.js b/packages/microsoft.zunevideo/controls/HubStrip.js
new file mode 100644
index 00000000..ed7c0218
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/HubStrip.js
@@ -0,0 +1,447 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/utilities.js", "/Controls/PivotControls.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HubStrip: MS.Entertainment.UI.Framework.defineUserControl("/Controls/HubStrip.html#hubStripTemplate", function hubStripConstructor() {
+ this._rebuildUX = this._rebuildUX.bind(this);
+ this._handleResize = this._handleResize.bind(this);
+ this._currentLoadingHubs = [];
+ this._hubsById = {};
+ if (this.getPageTitleFromNavigationService) {
+ var page = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ this._pageTitle = page.title
+ }
+ }, {
+ ignoreChildrenInitialization: true, _callShowElementOnHubLoad: false, _doNotReshowAnimations: false, _clientWidth: -1, _scrollLeft: -1, _showPageTitle: false, _showAppPreview: false, _showPivots: false, _pageTitle: "", _forceDefaultHubReady: false, _showStarted: false, initialize: function initialize() {
+ var that = this;
+ this.bind("hubs", this.onHubsChanged.bind(this));
+ this.bind("selectedIndex", this.onSelectedIndexChanged.bind(this))
+ }, onSelectedIndexChanged: function onSelectedIndexChanged() {
+ if (this.hubs)
+ this.hubs.forEach(function(hub, indexer) {
+ hub.isSelected = (indexer === this.selectedIndex)
+ }, this)
+ }, hubLoadedHandler: function hubLoadedHandler(e) {
+ this._hubsLoaded++;
+ if (this._defaultHubIsReady || this.isolateHubs) {
+ var event = document.createEvent("Event");
+ event.initEvent("HubStripVisible", true, false);
+ this.domElement.dispatchEvent(event);
+ this.animateHubStripIn()
+ }
+ this._hubsById[e.hubId].isLoading = false;
+ if (this._hubsLoaded === this.renderedHubs.length) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("HubStripLoaded", true, true);
+ this.domElement.dispatchEvent(domEvent);
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceHubStrip_Load_End(this.id)
+ }
+ e.stopPropagation()
+ }, animateHubStripIn: function animateHubStripIn() {
+ if (!this._unloaded && ((this._defaultHubIsReady && (this.isolateHubs || (this._hubsLoaded === this.defaultIndex + 1) || (this._hubsLoaded === this.hubs.length))) || this._forceDefaultHubReady)) {
+ this._waitCursor.isBusy = false;
+ if (this._showStarted)
+ return;
+ this._showStarted = true;
+ if (!this.showPanelTitles)
+ this.hidePanelTitles();
+ var stripShownPromise = this.runHubStripAnimation();
+ if (stripShownPromise)
+ stripShownPromise = stripShownPromise.then(function hubStripPromiseComplete() {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiState.isHubStripVisible = true;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("HubStripReady", true, true);
+ this.domElement.dispatchEvent(domEvent);
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceHubStrip_Ready(this.id)
+ }.bind(this));
+ return stripShownPromise
+ }
+ }, runHubStripAnimation: function runHubStripAnimation() {
+ var stripShownPromise = new WinJS.Promise.wrap;
+ if (!this.isolateHubs) {
+ this.onScroll(null);
+ this._navigationContainer.domElement.parentElement.style.opacity = "1";
+ if (this._callShowElementOnHubLoad && !this._doNotReshowAnimations) {
+ this._doNotReshowAnimations = true;
+ MS.Entertainment.Utilities.showElement(this._navigationContainer.domElement);
+ stripShownPromise = MS.Entertainment.Utilities.showElement(this._scroller).then(function fixOpacity() {
+ this._scroller.style.opacity = "1"
+ }.bind(this))
+ }
+ else
+ this._scroller.style.opacity = "1"
+ }
+ else {
+ this._navigationContainer.domElement.parentElement.style.opacity = "1";
+ if (this._callShowElementOnHubLoad && !this._doNotReshowAnimations) {
+ this._doNotReshowAnimations = true;
+ MS.Entertainment.Utilities.showElement(this._navigationContainer.domElement);
+ stripShownPromise = MS.Entertainment.Utilities.showElement(this._scroller).then(function fixOpacity() {
+ this._scroller.style.opacity = "1"
+ }.bind(this))
+ }
+ else
+ this._scroller.style.opacity = "1"
+ }
+ return stripShownPromise
+ }, hubReadyHandler: function hubReadyHandler(e) {
+ this._hubsReady++;
+ this._hubsById[e.hubId].isReady = true;
+ if (!this._forceDefaultHubReady) {
+ if (!this._defaultHubIsReady)
+ if (this.hubs[this.defaultIndex].id === e.hubId) {
+ this._defaultHubIsReady = true;
+ this._setPageTitleVisibility();
+ this.animateHubStripIn();
+ for (var i = 0; i < this._scroller.children.length; i++) {
+ if (i === this.defaultIndex)
+ continue;
+ if (i < this.defaultIndex)
+ this._currentLoadingHubs.splice(0, 1)
+ }
+ if (this._currentLoadingHubs.length > 0)
+ WinJS.Utilities.removeClass(this._currentLoadingHubs[0].element, "removeFromDisplay")
+ }
+ if (this._currentLoadingHubs.length > 0 && e.hubId === this._currentLoadingHubs[0].hub.id)
+ do {
+ var justLoadedHub = this._currentLoadingHubs.splice(0, 1);
+ WinJS.Utilities.removeClass(justLoadedHub[0].element, "removeFromDisplay");
+ if (this._currentLoadingHubs.length > 0)
+ WinJS.Utilities.removeClass(this._currentLoadingHubs[0].element, "removeFromDisplay");
+ else
+ break
+ } while (this._currentLoadingHubs.length > 0 && this._currentLoadingHubs[0].hub.isReady)
+ }
+ }, _forceShowHubStrip: function _forceShowHubStrip() {
+ this._defaultHubIsReady = true;
+ this._setPageTitleVisibility();
+ this.animateHubStripIn();
+ for (var j = 0; j < this._currentLoadingHubs.length; j++)
+ WinJS.Utilities.removeClass(this._currentLoadingHubs[j].element, "removeFromDisplay");
+ this._currentLoadingHubs.length = 0
+ }, _setPageTitleVisibility: function _setPageTitleVisibility() {
+ if (!this._unloaded) {
+ if (this._showPageTitle && this._showAppPreview) {
+ WinJS.Utilities.removeClass(this._titleContainer.domElement, "removeFromDisplay");
+ MS.Entertainment.Utilities.showElement(this._titleContainer.domElement);
+ this._title.text = this._pageTitle
+ }
+ else if (this._showPageTitle && !this._showAppPreview && this.hubNavigationTitle) {
+ this.hubNavigationTitle.text = this._pageTitle;
+ WinJS.Utilities.removeClass(this.hubNavigationTitle.domElement, "removeFromDisplay");
+ MS.Entertainment.Utilities.showElement(this.hubNavigationTitle.domElement)
+ }
+ if (this._showPivots)
+ if (this.hubs && this.hubs.length > 1) {
+ WinJS.Utilities.removeClass(this._navigationContainer.domElement, "removeFromDisplay");
+ MS.Entertainment.Utilities.showElement(this._navigationContainer.domElement)
+ }
+ else if (this.hubs && this.hubs.length === 1 && this.hubNavigationTitle) {
+ this.hubNavigationTitle.text = this.hubs[0].title;
+ WinJS.Utilities.addClass(this._titleContainer.domElement, "removeFromDisplay")
+ }
+ }
+ }, _handleResize: function _handleResize() {
+ if (this._handleResizeBatch)
+ this._handleResizeBatch.cancel();
+ this._handleResizeBatch = WinJS.Promise.timeout(150).then(function batchRun() {
+ if (!this.isolateHubs)
+ this.selectedIndex = this._calculateCurrentHubIndexFromScrollPosition();
+ else
+ this.moveTo(this.selectedIndex, false, true)
+ }.bind(this))
+ }, defaultIndex: 0, isolateHubs: false, showPanelTitles: true, _defaultHubIsReady: false, _handleResizeBatch: null, _childResizeListeners: null, id: "", _scroller: null, _easeVelocity: 0, _easeInterval: -1, _hubsLoaded: 0, _hubsReady: 0, _scrollingInterval: -1, _currentLoadingHubs: null, _hubsById: null, _suppressOtherMoveToScrolling: false, hidePanelTitles: function hidePanelTitles() {
+ var titleElements = this.domElement.querySelectorAll(".panelTitle");
+ Array.prototype.forEach.call(titleElements, function hidePanelTitle(titleElement, indexer) {
+ WinJS.Utilities.addClass(titleElement, "removeFromDisplay")
+ })
+ }, buildHubInfoCache: function buildHubInfoCache() {
+ Array.prototype.filter.call(this._scroller.children, function filterFloaters(element) {
+ return !WinJS.Utilities.hasClass(element, "hubStripFloater")
+ }).forEach(function calculateOffsetForHubCache(hub, indexer) {
+ if (indexer <= this.renderedHubs.length - 1) {
+ this.renderedHubs[indexer].domElement = hub;
+ this.renderedHubs[indexer].hubOffset = hub.offsetLeft;
+ this.renderedHubs[indexer].width = hub.clientWidth
+ }
+ }.bind(this))
+ }, buildPanelInfoCache: function buildPanelInfoCache(hub, index) {
+ var panels = hub.querySelectorAll(".panel");
+ Array.prototype.forEach.call(panels, function calculateOffsetForPanelCache(panelDom, panelIndexer) {
+ var panel = this.renderedHubs[index].panels[panelIndexer];
+ if (panel) {
+ panel.domElement = panelDom;
+ panel.panelOffset = panelDom.parentElement.offsetLeft;
+ panel.width = panelDom.clientWidth
+ }
+ }.bind(this))
+ }, onHubsChanged: function onHubsChanged() {
+ var hubStrip = this;
+ this.selectedIndex = -1;
+ var lastSeenSelectedIndex;
+ if (this.hubs) {
+ this.hubs.forEach(function augmentHub(hub, indexer) {
+ hub.index = indexer;
+ hub.onNavigate = function onHubNavigate() {
+ hubStrip.moveTo(indexer, true)
+ }
+ });
+ if (this.isolateHubs) {
+ this.selectedIndex = this.defaultIndex;
+ this.bind("selectedIndex", function selectedIndexChangedFromHubsChanged() {
+ if (lastSeenSelectedIndex !== this.selectedIndex) {
+ lastSeenSelectedIndex = this.selectedIndex;
+ this._rebuildUX()
+ }
+ }.bind(this));
+ WinJS.Utilities.removeClass(this._scroller, "continuousHubStrip")
+ }
+ else {
+ WinJS.Utilities.addClass(this._scroller, "continuousHubStrip");
+ WinJS.Promise.timeout().then(this._rebuildUX)
+ }
+ }
+ }, _rebuildUX: function _rebuildUX() {
+ var that = this;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceHubStrip_Load_Start(this.id || "");
+ this._showStarted = false;
+ WinJS.Promise.timeout(MS.Entertainment.UI.Controls.HubStrip.DEFAULT_HUB_READY_TIMEOUT).then(function showHubStripIfTakenTooLong() {
+ if (!this._showStarted) {
+ this._forceDefaultHubReady = true;
+ this._forceShowHubStrip()
+ }
+ }.bind(this));
+ if (this.isolateHubs)
+ WinJS.Utilities.addClass(this.domElement, "isolateHubs");
+ else
+ WinJS.Utilities.removeClass(this.domElement, "isolateHubs");
+ if (this.isolateHubs && this._scroller.children.length > 0) {
+ this._scroller.firstChild.setAttribute("data-ent-hideanimation", "galleryPanelExit");
+ this._scroller.firstChild.setAttribute("data-ent-showanimation", "galleryPanelEnter");
+ MS.Entertainment.Utilities.removeChild(this._scroller, this._scroller.firstChild).then(function isolateHubExit() {
+ that._rebuildScrollerUX()
+ })
+ }
+ else
+ this._rebuildScrollerUX()
+ }, _rebuildScrollerUX: function _rebuildScrollerUX() {
+ var that = this;
+ MS.Entertainment.Utilities.empty(this._scroller);
+ this._waitCursor.isBusy = true;
+ if (!this.hubs || this.hubs.length === 0)
+ return;
+ if (this.isolateHubs) {
+ var index = this.selectedIndex >= 0 ? this.selectedIndex : 0;
+ this.renderedHubs = [this.hubs[index]]
+ }
+ else
+ this.renderedHubs = this.hubs;
+ this._hubsLoaded = 0;
+ this.renderedHubs.forEach(function loadHub(hub, indexer) {
+ if (hub.htmlPage !== "/Controls/Hub.html")
+ that._hubsLoaded++;
+ that._hubsById[hub.id] = hub;
+ var hubContainer = document.createElement("div");
+ hubContainer.className = "hub";
+ hubContainer.id = document.uniqueID;
+ hubContainer.setAttribute("data-win-automationId", hub.id);
+ that._scroller.appendChild(hubContainer);
+ if ((indexer !== that.defaultIndex) && !that.isolateHubs) {
+ that._currentLoadingHubs.push({
+ hub: hub, element: hubContainer
+ });
+ if (indexer > that.defaultIndex) {
+ hub.isLoading = true;
+ WinJS.Utilities.addClass(hubContainer, "removeFromDisplay")
+ }
+ }
+ else if ((indexer === that.defaultIndex) && (!that.isolateHubs) && (that.selectedIndex < 0))
+ that.selectedIndex = that.defaultIndex;
+ MS.Entertainment.Utilities.loadHtmlPage(hub.htmlPage, hubContainer, hub).then(function pageLoaded() {
+ if (hub.options)
+ Array.prototype.forEach.call(hubContainer.children, function passOptionsIfDesired(child) {
+ var control = child.winControl;
+ if (control && control.setHubOptions)
+ control.setHubOptions(hub.options)
+ })
+ })
+ })
+ }, onScroll: function onScroll(e) {
+ if (this.isolateHubs)
+ return;
+ this._scrollLeft = this._scroller.scrollLeft;
+ if (this._hubsLoaded === 0 || this._hubsLoaded < this.defaultIndex + 1)
+ return;
+ this._updateIsScrolling();
+ var currentScrollerIndex = this._calculateCurrentHubIndexFromScrollPosition();
+ this.selectedIndex = currentScrollerIndex;
+ this._updatePanelAnimations(this._scrollLeft)
+ }, _updatePanelAnimations: function _updatePanelAnimations(offset, updateAllPanels, slideInPanels) {
+ var allLoaded = (this._hubsLoaded > 0 && this._hubsLoaded >= this.defaultIndex + 1);
+ var subPromises = [];
+ if (allLoaded) {
+ if (this._clientWidth < 0)
+ this._clientWidth = this._scroller.clientWidth;
+ var scrollRight = this._scroller.offsetWidth + offset;
+ var gutterThreshold = offset + this._clientWidth - (this._clientWidth * .1);
+ var actionTileThreshold = offset + this._clientWidth - (this._clientWidth * .2);
+ for (var i = 0; i < this.renderedHubs.length; i++) {
+ var hub = this.renderedHubs[i];
+ if (!hub.domElement)
+ continue;
+ if (!updateAllPanels && i !== this.selectedIndex && i !== this.selectedIndex + 1) {
+ hub.isVisible = false;
+ continue
+ }
+ if (hub.width !== hub.domElement.clientWidth || hub.hubOffset !== hub.domElement.offsetLeft) {
+ hub.width = hub.domElement.clientWidth;
+ hub.hubOffset = hub.domElement.offsetLeft
+ }
+ this.buildPanelInfoCache(hub.domElement, i);
+ for (var j = 0; j < hub.panels.length; j++) {
+ var panel = hub.panels[j];
+ if (!panel || !panel.domElement)
+ continue;
+ if (panel.width !== panel.domElement.clientWidth || panel.panelOffset !== panel.domElement.offsetLeft) {
+ panel.width = panel.domElement.clientWidth;
+ panel.panelOffset = panel.domElement.offsetLeft
+ }
+ var panelOffset = panel.panelOffset + hub.hubOffset
+ }
+ hub.isVisible = hub.hubOffset <= scrollRight && hub.hubOffset + hub.width >= offset
+ }
+ }
+ return subPromises.length > 0 ? WinJS.Promise.join(subPromises) : WinJS.Promise.wrap()
+ }, _updateIsScrolling: function _updateIsScrolling() {
+ var that = this;
+ if (this._scrollingInterval !== -1)
+ window.clearTimeout(this._scrollingInterval);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isScrolling = true;
+ this._scrollingInterval = window.setTimeout(function clearScrollingFlag() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isScrolling = false;
+ that._scrollingInterval = -1
+ }, 1000)
+ }, _calculateCurrentHubIndexFromScrollPosition: function _calculateCurrentHubIndexFromScrollPosition(offset) {
+ if (this._clientWidth < 0)
+ this._clientWidth = this._scroller.clientWidth;
+ if (this._clientWidth <= 0)
+ return -1;
+ var index = 0;
+ var total = 0;
+ var left = offset ? offset : this._scrollLeft;
+ var currentPosition = left + (this._clientWidth / 2);
+ this.buildHubInfoCache();
+ for (index = 0; index < this.renderedHubs.length && total <= currentPosition; index++)
+ total += this.renderedHubs[index].width;
+ index--;
+ while (index > 0 && this.renderedHubs[index - 1].hubOffset >= left)
+ index--;
+ return index
+ }, moveTo: function moveToFn(index, snapToLeftEdge, skipAnimation, hubOffset) {
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isScrolling && this.selectedIndex === index)
+ return WinJS.Promise.wrap();
+ if (this.isolateHubs)
+ if (this._hubsLoaded === 0)
+ this.defaultIndex = index;
+ else
+ this.selectedIndex = index;
+ else {
+ var destination = 0;
+ if (this._hubsLoaded > 0 && (this._hubsLoaded - 1) >= index) {
+ if (index > this.renderedHubs.length)
+ return;
+ this.buildHubInfoCache();
+ var selectedHub = this.renderedHubs[index];
+ this.buildPanelInfoCache(selectedHub.domElement, index);
+ if (snapToLeftEdge)
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.LeftToRight)
+ destination = (selectedHub.hubOffset + selectedHub.panels[selectedHub.defaultPanelIndex].panelOffset) - this.leftEdgeOffset;
+ else
+ destination = this._scroller.clientWidth - selectedHub.hubOffset - selectedHub.width - this.leftEdgeOffset;
+ else
+ destination = (selectedHub.hubOffset + selectedHub.panels[selectedHub.defaultPanelIndex].panelOffset) + selectedHub.width - this._scrollWidth + this.rightEdgeOffset;
+ destination = Math.max(destination, 0);
+ if (hubOffset)
+ destination = destination + hubOffset;
+ if (this.animationEnabled)
+ this.scrollToAnimated(destination);
+ else if (!this._suppressOtherMoveToScrolling)
+ this.scrollTo(destination);
+ this.onScroll(null);
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceHubStrip_MoveToComplete(this.hubs[index].id)
+ }
+ else
+ this.defaultIndex = index;
+ completion();
+ return promise
+ }
+ }, scrollTo: function scrollToFn(pixelOffset) {
+ this._scroller.scrollLeft = pixelOffset;
+ this.onScroll(null)
+ }, scrollToAnimated: function scrollToAnimatedFn(pixelOffset) {
+ var that = this;
+ var completion;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c
+ });
+ var eventCount = this._scroller.children.length;
+ var animationEnd = function(event) {
+ eventCount--;
+ if (eventCount === 0) {
+ if (that._scroller !== undefined) {
+ for (var i = 0; i < that._scroller.children.length; i++) {
+ that._scroller.children[i].removeEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.removeClass(that._scroller.children[i], "hubStripScrollTransition");
+ that._scroller.children[i].style.msTransform = "translateX(0px)"
+ }
+ completion()
+ }
+ that.scrollTo(pixelOffset)
+ }
+ };
+ if (!MS.Entertainment.ServiceLocator || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled) {
+ var translateAmount = -(pixelOffset - this._scroller.scrollLeft);
+ for (var i = 0; i < this._scroller.children.length; i++) {
+ this._scroller.children[i].addEventListener("transitionend", animationEnd, false);
+ WinJS.Utilities.addClass(this._scroller.children[i], "hubStripScrollTransition");
+ this._scroller.children[i].style.msTransform = "translateX(" + translateAmount + "px)"
+ }
+ }
+ else
+ this.scrollTo(pixelOffset);
+ return promise
+ }
+ }, {
+ hubs: null, renderedHubs: [], selectedIndex: -1, leftEdgeOffset: 0, leftPanelOffset: 0, rightEdgeOffset: 0, animationEnabled: false
+ }, {
+ Hub: MS.Entertainment.defineObservable(function hubConstructor(id, title, overrideFragmentUrl, options) {
+ this.id = id;
+ this.title = title;
+ this.htmlPage = overrideFragmentUrl || "/Controls/Hub.html";
+ this.instance = this;
+ this.options = options;
+ this.panels = new MS.Entertainment.ObservableArray
+ }, {
+ id: "", title: "", htmlPage: "", onNavigate: null, instance: null, options: undefined, panels: null, isVisible: null, isSelected: false, isLoading: false, isReady: false, defaultPanelIndex: 0, doNavigation: function doNavigation() {
+ if (this.winControl.dataSource.instance.onNavigate !== null)
+ this.winControl.dataSource.onNavigate()
+ }
+ }), Panel: MS.Entertainment.defineObservable(function panelConstructor(id, title, fragmentUrl, dataContext, options, showShadow) {
+ this.id = id;
+ this.title = title;
+ this.fragmentUrl = fragmentUrl;
+ this.dataContext = dataContext;
+ this.options = options;
+ if (showShadow !== undefined)
+ this.showShadow = showShadow
+ }, {
+ id: "", title: "", fragmentUrl: "", dataContext: null, options: undefined, hub: null, showShadow: true
+ }), DEFAULT_HUB_READY_TIMEOUT: 10000
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/ImageCollage.html b/packages/microsoft.zunevideo/controls/ImageCollage.html
new file mode 100644
index 00000000..98123bc2
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ImageCollage.html
@@ -0,0 +1,29 @@
+
+
+
+
+ Image Collage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/ImageCollage.js b/packages/microsoft.zunevideo/controls/ImageCollage.js
new file mode 100644
index 00000000..84ff629a
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ImageCollage.js
@@ -0,0 +1,595 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ var fileScope = {
+ CELL_USED: 1, CELL_BAD_IMAGE: 2
+ };
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImageCollageCell: MS.Entertainment.UI.Framework.define(function(){}, {
+ domElement: null, _imageLoader: null, _svgImageElement: null, _colorOverlay: null, x: 0, y: 0, width: 0, height: 0, urlIndex: -1, _artUri: null, _loaded: false, _initialized: false, _pendingShow: false, _pendingToggle: false, _overlayListenerAdded: false, _transitionPromise: null, cellDefinition: null, initialize: function initialize(blockOffset, cellDefinition, cellSize, filter, backgroundColor) {
+ var that = this;
+ var cellSpacing = MS.Entertainment.Utilities.isMusicApp1 ? 2 : 0;
+ this.cellDefinition = cellDefinition;
+ this.x = blockOffset.x + cellDefinition.x * cellSize.x;
+ this.y = blockOffset.y + cellDefinition.y * cellSize.y;
+ this.width = cellDefinition.size * cellSize.x;
+ this.height = cellDefinition.size * cellSize.y;
+ var svgNS = "http://www.w3.org/2000/svg";
+ var svgElement = document.createElementNS(svgNS, "svg");
+ this._svgImageElement = document.createElementNS(svgNS, "image");
+ this._svgImageElement.setAttribute("x", cellSpacing);
+ this._svgImageElement.setAttribute("y", cellSpacing);
+ this._svgImageElement.setAttribute("width", this.width - (2 * cellSpacing));
+ this._svgImageElement.setAttribute("height", this.height - (2 * cellSpacing));
+ this._svgImageElement.setAttribute("preserveAspectRatio", "none");
+ this._svgImageElement.setAttribute("focusable", "false");
+ svgElement.setAttribute("focusable", "false");
+ this._loaded = false;
+ svgElement.appendChild(this._svgImageElement);
+ this._colorOverlay = document.createElement("div");
+ this._colorOverlay.className = "imageCollageCellColorOverlay";
+ this.domElement = document.createElement("div");
+ this.domElement.style.left = this.x + "px";
+ this.domElement.style.top = this.y + "px";
+ this.domElement.style.width = this.width + "px";
+ this.domElement.style.height = this.height + "px";
+ this.domElement.style.backgroundColor = backgroundColor ? backgroundColor : "#000000";
+ this.domElement.className = "imageCollageCell tranFadeShort";
+ this.domElement.appendChild(svgElement);
+ this.domElement.appendChild(this._colorOverlay);
+ this._cellTransitionEnd = this._cellTransitionEnd.bind(this);
+ this.domElement.addEventListener("transitionend", this._cellTransitionEnd, false)
+ }, unload: function unload() {
+ this.domElement.removeEventListener("transitionend", this._cellTransitionEnd, false);
+ if (this._transitionPromise) {
+ this._transitionPromise.cancel();
+ this._transitionPromise = null
+ }
+ }, setOverlay: function setOverlay(color, alpha, delay) {
+ var transitionEnd = function() {
+ this._colorOverlay.style.msTransitionDelay = String.empty;
+ this._colorOverlay.style.opacity = alpha
+ };
+ if (delay) {
+ this._colorOverlay.style.msTransitionDelay = delay;
+ if (!this._overlayListenerAdded) {
+ this._colorOverlay.addEventListener("transitionend", transitionEnd.bind(this), false);
+ this._overlayListenerAdded = true
+ }
+ }
+ else
+ this._colorOverlay.style.opacity = alpha;
+ this._colorOverlay.style.backgroundColor = color
+ }, setArt: function setArt(artUri) {
+ this._initialized = true;
+ var wasLoaded = this._loaded;
+ this._artUri = artUri;
+ this._loaded = false;
+ if (wasLoaded) {
+ this._pendingShow = true;
+ if (this._transitionPromise)
+ this._transitionPromise.cancel();
+ this._transitionPromise = WinJS.Promise.timeout(600).then(function showCell() {
+ if (this._pendingShow) {
+ this._pendingShow = false;
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ }
+ }.bind(this));
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.hide);
+ return
+ }
+ if (this._pendingToggle) {
+ this._pendingToggle = false;
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ }
+ }, toggleCell: function toggleCell(show, delay) {
+ if (!this._initialized) {
+ this._pendingToggle = (show === MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ return
+ }
+ if (show === MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show) {
+ if (!this._loaded) {
+ this._loaded = true;
+ var uri = this._artUri;
+ if (!uri)
+ uri = MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album;
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", uri)
+ }
+ if (delay)
+ this.domElement.style.msTransitionDelay = delay + "ms";
+ this.domElement.style.opacity = 1
+ }
+ else {
+ this._loaded = false;
+ if (delay)
+ this.domElement.style.msTransitionDelay = delay + "ms";
+ this.domElement.style.opacity = 0
+ }
+ }, _cellTransitionEnd: function _cellTransitionEnd() {
+ if (this._transitionPromise) {
+ this._transitionPromise.cancel();
+ this._transitionPromise = null
+ }
+ this.domElement.style.msTransitionDelay = String.empty;
+ if (this._pendingShow) {
+ this._pendingShow = false;
+ this.toggleCell(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ }
+ }
+ }, {
+ showDelay: 750, toggleCellState: {
+ show: "show", hide: "hide"
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LargeWallArt: MS.Entertainment.UI.Framework.define(function(){}, {
+ domElement: null, svgElement: null, currentImageUrl: null, _imageLoader: null, _svgImageElement: null, _svgColorElement: null, _svgBlackElement: null, _loaded: false, _x: 0, _y: 0, _width: 0, _height: 0, _colorOverlay: null, _blackOverlay: null, _animationOffsets: null, _lastAnimationOffset: -1, _hideArtDelayPromise: null, _artDelay: 0, initialize: function initialize(domElement, x, y, w, h, backgroundColor, filter, artDelay) {
+ var that = this;
+ if (window.clientInformation && window.clientInformation.cpuClass === "ARM")
+ this.disableScaling = true;
+ this._artDelay = artDelay !== null ? artDelay : MS.Entertainment.UI.Controls.LargeWallArt.showDelay;
+ this.domElement = domElement;
+ this._animationOffsets = ["25% 25%", "50% 25%", "75% 25%", "25% 50%", "50% 50%", "75% 50%"];
+ var svgNS = "http://www.w3.org/2000/svg";
+ this.svgElement = document.createElementNS(svgNS, "svg");
+ this.svgElement.style.zIndex = 1;
+ this._svgImageElement = document.createElementNS(svgNS, "image");
+ this._svgImageElement.style.zIndex = 0;
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", MS.Entertainment.UI.ImagePaths.imageNotFound);
+ this._svgImageElement.setAttribute("x", 0);
+ this._svgImageElement.setAttribute("y", 0);
+ this._svgImageElement.setAttribute("width", "100%");
+ this._svgImageElement.setAttribute("height", "100%");
+ this._svgImageElement.setAttribute("focusable", "false");
+ this._svgImageElement.setAttribute("preserveAspectRatio", "xMidYMid slice");
+ this.svgElement.setAttribute("focusable", "false");
+ this.svgElement.appendChild(this._svgImageElement);
+ if (filter && !this._svgColorElement) {
+ this._colorOverlay = document.createElement("div");
+ this._colorOverlay.className = "nowPlayingLargeArtColorOverlay tranFadeLong";
+ this._colorOverlay.style.zIndex = 2;
+ this._blackOverlay = document.createElement("div");
+ this._blackOverlay.className = "nowPlayingLargeArtBlackOverlay";
+ this._blackOverlay.style.zIndex = 3
+ }
+ this._imageLoader = new Image;
+ this._imageLoader.addEventListener("load", function imageLoaded(event) {
+ this._loaded = true;
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", this._imageLoader.src);
+ if (this._pendingShow)
+ this.showArt()
+ }.bind(this), false);
+ this._imageLoader.addEventListener("error", function imageError(event) {
+ this._pendingShow = false;
+ this._loaded = true;
+ this.toggleArt(MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.hide)
+ }.bind(this), false);
+ this.domElement.style.backgroundColor = backgroundColor ? backgroundColor : "#000000";
+ this.domElement.style.position = "absolute";
+ this.domElement.style.left = x;
+ this.domElement.style.top = y;
+ this.domElement.style.width = w;
+ this.domElement.style.height = h;
+ this.domElement.style.opacity = "1.0";
+ if (filter && !this._svgColorElement) {
+ this.domElement.appendChild(this._colorOverlay);
+ this.domElement.appendChild(this._blackOverlay)
+ }
+ this.domElement.appendChild(this.svgElement)
+ }, setOverlay: function setOverlay(color, alpha) {
+ if (this._svgColorElement)
+ this._svgColorElement.setAttribute("flood-color", color);
+ else if (color === this._colorOverlay.style.backgroundColor)
+ this._colorOverlay.style.opacity = alpha;
+ else {
+ this._colorOverlay.style.backgroundColor = color;
+ this._colorOverlay.style.opacity = alpha
+ }
+ }, showArt: function showArt() {
+ if (this._hideArtDelayPromise) {
+ this._hideArtDelayPromise.cancel();
+ this._hideArtDelayPromise = null
+ }
+ this.domElement.style.display = String.empty;
+ this.toggleArt(MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.show);
+ var index = Math.floor(Math.random() * this._animationOffsets.length);
+ while (index === this._lastAnimationOffset)
+ index = Math.floor(Math.random() * this._animationOffsets.length);
+ this._lastAnimationOffset = index;
+ this.domElement.className = String.empty;
+ this.domElement.style.transformOrigin = this._animationOffsets[index];
+ if (!this.disableScaling)
+ WinJS.Utilities.addClass(this.domElement, "imageCollageLargeArt");
+ WinJS.Utilities.addClass(this.domElement, "tranFadeVeryShort")
+ }, hideArt: function hideArt() {
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible) {
+ this.domElement.className = String.empty;
+ this.domElement.style.display = "none";
+ this._hideArtDelayPromise = WinJS.Promise.wrap()
+ }
+ else {
+ this.toggleArt(MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.hide);
+ if (this._imageLoader && this._imageLoader.src)
+ this._hideArtDelayPromise = WinJS.Promise.timeout(this._artDelay).then(function _delay() {
+ if (this._hideArtDelayPromise) {
+ this.domElement.className = String.empty;
+ this.domElement.style.display = "none";
+ this._hideArtDelayPromise = null
+ }
+ }.bind(this));
+ else
+ this._hideArtDelayPromise = WinJS.Promise.wrap()
+ }
+ return this._hideArtDelayPromise
+ }, clearArt: function clearArt() {
+ this.hideArt().done(function clearArtUrl() {
+ this.currentImageUrl = null;
+ if (this._svgImageElement)
+ this._svgImageElement.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", String.empty)
+ }.bind(this), function onError(){})
+ }, setArt: function setArt(artUri) {
+ var wasLoaded = this._loaded;
+ this._loaded = false;
+ this.hideArt();
+ if (!String.isString(artUri))
+ return;
+ return WinJS.Promise.timeout(wasLoaded ? this._artDelay : 0).then(function _delay() {
+ if (this._hideArtDelayPromise) {
+ this._hideArtDelayPromise.cancel();
+ this._hideArtDelayPromise = null
+ }
+ if (artUri) {
+ this.currentImageUrl = artUri;
+ this._imageLoader.setAttribute("src", artUri);
+ this.showArt()
+ }
+ else {
+ this.currentImageUrl = null;
+ this._pendingShow = false;
+ this.domElement.style.opacity = 0;
+ this._loaded = true
+ }
+ }.bind(this))
+ }, toggleArt: function toggleArt(show) {
+ if (show === MS.Entertainment.UI.Controls.LargeWallArt.toggleArtState.show || this._pendingShow)
+ if (this._loaded) {
+ this._pendingShow = false;
+ this.domElement.style.opacity = 1
+ }
+ else
+ this._pendingShow = true;
+ else
+ this.domElement.style.opacity = 0
+ }
+ }, {
+ showDelay: 2000, colorShowDelay: 2000, toggleArtState: {
+ show: "show", hide: "hide"
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ImageCollage: MS.Entertainment.UI.Framework.defineUserControl("Controls/ImageCollage.html#Template", function ImageCollage(element, options) {
+ this._cells = [];
+ this._cellDefinitions = [];
+ this._renderLoop = this._renderLoop.bind(this)
+ }, {
+ _initialized: false, _blockCountX: 0, _blockCountY: 0, _largeArt: null, _timerEnabled: false, _animationPaused: false, _frozen: false, _cells: null, _blockSizeInPixels: 0, _blockSizeInCells: 0, _cellSizeInPixels: 0, _artIndex: -1, _lastArtShow: 0, _lastArtSwap: 0, _lastCellSwap: 0, _lastColorChange: 0, _lastTimerTick: 0, _cellUsedList: null, _cellUsedCount: 0, _cellOffsetInPixels: 0, _resizeTimeoutPromise: null, _timerPromise: null, _minCellsForTimer: 10, _maxSearchCount: 20, _uiStateService: null, _renderLoopQueued: false, _lastWidth: 0, timerTickInterval: 1000, timerDelayPeriod: 3000, cellAddPeriod: 0, cellRepeatBuffer: 5, cellSwapPeriod: 5000, artShowPeriod: 30000, artSwapPeriod: 11000, artVisiblePeriod: 30000, colorChangePeriod: 0, cellDefinitions: null, cellFilter: null, backgroundColor: "#000000", largeArtDelay: null, initialize: function initialize(element, options, dom) {
+ this._updateSize = this._updateSize.bind(this);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)
+ }, _delayInitialized: function _delayInitialized() {
+ this.bind("cellIdList", this._onCellIdListChanged.bind(this));
+ this.bind("largeArtUrls", this._updateArt.bind(this));
+ MS.Entertainment.Utilities.attachResizeEvent(this.domElement, this._updateSize)
+ }, unload: function unload() {
+ MS.Entertainment.Utilities.detachResizeEvent(this.domElement, this._updateSize);
+ this._timerEnabled = false;
+ this._clearCells();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._frozen = false;
+ if (this._timerEnabled && !this._renderLoopQueued)
+ this._startRenderLoop();
+ this.play()
+ }, pause: function pause() {
+ this._animationPaused = true;
+ if (this._largeArt)
+ this._largeArt.hideArt()
+ }, play: function play() {
+ this._animationPaused = false;
+ if (this._largeArt && this.artVisible)
+ this._largeArt.showArt()
+ }, freeze: function freeze() {
+ this._frozen = true;
+ this.pause();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, _updateSize: function _updateSize() {
+ if (this.domElement.clientWidth > 0 && this._lastWidth === this.domElement.clientWidth)
+ return;
+ this._lastWidth = this.domElement.clientWidth;
+ if (this._resizeTimeoutPromise)
+ this._resizeTimeoutPromise.cancel();
+ this._resizeTimeoutPromise = WinJS.Promise.timeout(500).then(function updateCells() {
+ if (this.cellIdList)
+ this._setCellImages(true)
+ }.bind(this))
+ }, _clearCells: function _clearCells() {
+ if (!this.wallContainer)
+ this._timerEnabled = false;
+ else {
+ MS.Entertainment.Utilities.empty(this.wallContainer);
+ this._cells = [];
+ this._cellUsedList = []
+ }
+ }, _onCellIdListChanged: function _onCellIdListChanged(newValue) {
+ if (newValue)
+ this._setCellImages(false)
+ }, _setCellImages: function _setCellImages(clearCells) {
+ if (!this._cells || !this._cells.length || clearCells || !this.cellIdList || !this.cellIdList.length)
+ this._clearCells();
+ if (!this.cellIdList || !this.cellIdList.length || this._unloaded)
+ return;
+ if (this._cells && this._cells.length > 0) {
+ this._cellUsedCount = 0;
+ this._cellUsedList = [];
+ this._cellUsedList.length = this.cellIdList.length;
+ this._updateCellArts();
+ return
+ }
+ if (!this._cellUsedList)
+ this._cellUsedList = [];
+ this._cellUsedList.length = this.cellIdList.length;
+ var defaultWidth = (this.size && this.size.width) ? this.size.width : window.screen.width;
+ var defaultHeight = (this.size && this.size.height) ? this.size.height : window.screen.height;
+ var elementWidth = this.domElement.clientWidth ? this.domElement.clientWidth : defaultWidth;
+ var elementHeight = this.domElement.clientHeight ? this.domElement.clientHeight : defaultHeight;
+ this._blockCountX = Math.ceil(elementWidth / this._blockSizeInPixels.x);
+ this._blockCountY = Math.ceil(elementHeight / this._blockSizeInPixels.y);
+ this._lastWidth = elementWidth;
+ this._toggleStartTime = 0;
+ var color = this.backdropColor;
+ if (this.colorChangePeriod > 0) {
+ var randomColor = this._randomizeLayerColor();
+ color = "rgba(" + randomColor.r + "," + randomColor.g + "," + randomColor.b + "," + randomColor.a + ")"
+ }
+ var cellCount = this._blockCountX * this._blockCountY * this.cellDefinitions.length;
+ for (var i = 0; i < cellCount; i++) {
+ var newCell = this._initCell(i, elementWidth, elementHeight, color);
+ if (newCell)
+ this._cells.push(newCell)
+ }
+ if (!this.artVisible)
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ if (!this._timerEnabled && ((this.largeArtUrls && this.largeArtUrls.length > 0) || ((this.cellIdList && this.cellIdList.length > this._cells.length) || this._cells.length >= this._minCellsForTimer))) {
+ this._timerEnabled = true;
+ this._startRenderLoop()
+ }
+ else if (this._timerEnabled && ((!this.largeArtUrls || this.largeArtUrls.length === 0) && ((!this.cellIdList || this.cellIdList.length <= this._cells.length) && this._cells.length < this._minCellsForTimer)))
+ this._timerEnabled = false
+ }, _updateArt: function _updateArt(newVal, oldVal) {
+ if (oldVal === undefined || !this.artContainer)
+ return;
+ this._artIndex = -1;
+ if (!this.largeArtUrls) {
+ this._setArtVisible(false);
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ if (this._largeArt)
+ this._setLargeArt(null);
+ return
+ }
+ if (!this._largeArt) {
+ this._largeArt = new MS.Entertainment.UI.Controls.LargeWallArt;
+ this._largeArt.initialize(this.artContainer.domElement, 0, 0, "100%", "100%", this.backgroundColor, this.largeArtFilter, this.largeArtDelay);
+ if (this.colorChangePeriod > 0)
+ this._randomizeLayerColors()
+ }
+ if (!this.largeArtUrls)
+ this._setLargeArt(null);
+ if (this.largeArtUrls && (!this._timerEnabled || this.artVisible)) {
+ this._randomizeArt();
+ this._setArtVisible(true);
+ this._lastArtSwap = 0
+ }
+ else {
+ this._artIndex = -1;
+ this._setArtVisible(false)
+ }
+ if (!this._timerEnabled && (this.largeArtUrls.length > 1 || (this.largeArtUrls.length === 1 && this.largeArtUrls[0] === String.empty))) {
+ this._timerEnabled = true;
+ this._startRenderLoop()
+ }
+ this._lastArtShow = this.artShowPeriod - this.timerDelayPeriod
+ }, _initCell: function _initCell(cellIndex, maxWidth, maxHeight, color) {
+ var that = this;
+ var cell = new MS.Entertainment.UI.Controls.ImageCollageCell;
+ var blockSet = Math.floor(cellIndex / this.cellDefinitions.length);
+ var blockOffsetX = (blockSet % this._blockCountX) * this._blockSizeInCells.x * this._cellSizeInPixels.x - this._cellSizeInPixels.x * this._cellOffsetInPixels;
+ var blockOffsetY = (Math.floor(blockSet / this._blockCountX)) * this._blockSizeInCells.y * this._cellSizeInPixels.y - this._cellSizeInPixels.y * this._cellOffsetInPixels;
+ var cellDefinition = this.cellDefinitions[cellIndex % this.cellDefinitions.length];
+ if ((blockOffsetX + (cellDefinition.x * this._cellSizeInPixels.x) + (cellDefinition.size * this._cellSizeInPixels.x)) <= 0 || (blockOffsetX + (cellDefinition.x * this._cellSizeInPixels.x)) > maxWidth || (blockOffsetY + (cellDefinition.y * this._cellSizeInPixels.y) + (cellDefinition.size * this._cellSizeInPixels.y)) <= 0 || (blockOffsetY + (cellDefinition.y * this._cellSizeInPixels.y)) > maxHeight)
+ return null;
+ cell.initialize({
+ x: blockOffsetX, y: blockOffsetY
+ }, cellDefinition, this._cellSizeInPixels, this.cellFilter, this.backgroundColor);
+ cell.setOverlay(color, 0.5);
+ this._setCellArt(cell);
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement) || !this.wallContainer)
+ return null;
+ else
+ this.wallContainer.appendChild(cell.domElement);
+ return cell
+ }, _setCellArt: function _setCellArt(cell) {
+ if (!cell || !this.cellIdList || !this.cellIdList.length || this._unloaded)
+ return;
+ if (cell.urlIndex > 0 && cell.urlIndex < this.cellIdList.length - 1)
+ if (this._cellUsedList[cell.urlIndex]) {
+ if (this._cellUsedList[cell.urlIndex] < fileScope.CELL_BAD_IMAGE)
+ this._cellUsedList[cell.urlIndex] = 0;
+ if (this._cellUsedCount > 0)
+ this._cellUsedCount--
+ }
+ var random = -1;
+ var loopCount = 0;
+ var lastNonDefault = -1;
+ while (random < 0) {
+ var testIndex = Math.floor(Math.random() * this.cellIdList.length);
+ if (this._cellUsedList[testIndex] < fileScope.CELL_BAD_IMAGE)
+ lastNonDefault = testIndex;
+ if (!this._cellUsedList[testIndex] || loopCount > this._maxSearchCount || this._cellUsedCount >= this.cellIdList.length - this.cellRepeatBuffer)
+ random = testIndex;
+ loopCount++
+ }
+ if (this._cellUsedList[random] === fileScope.CELL_BAD_IMAGE && lastNonDefault >= 0)
+ random = lastNonDefault;
+ if (!this._cellUsedList[random]) {
+ this._cellUsedCount++;
+ this._cellUsedList[random] = fileScope.CELL_USED
+ }
+ cell.urlIndex = random;
+ WinJS.Promise.as(this._setUrlFromCellId(this.cellIdList[random], cell)).done(function checkIfSet(imageUrl) {
+ if (!imageUrl)
+ WinJS.Promise.timeout().done(function() {
+ this._cellUsedList[random] = fileScope.CELL_BAD_IMAGE;
+ this._setCellArt(cell)
+ }.bind(this))
+ }.bind(this))
+ }, _setUrlFromCellId: function _getUrlFromCellId(cellId, cell) {
+ return cell.setArt(cellId)
+ }, _setArtVisible: function _setArtVisible(visible) {
+ if (this.artVisible !== visible) {
+ this.artVisible = visible;
+ if (this._largeArt)
+ if (visible)
+ this._largeArt.showArt();
+ else
+ this._largeArt.hideArt()
+ }
+ }, _timerTick: function _timerTick() {
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement))
+ this._unloaded = true;
+ if (this._timerEnabled && !this._unloaded)
+ if (this._uiStateService.isAppVisible && !this._frozen) {
+ if (this._lastArtShow >= this.artShowPeriod && this._largeArt && this.largeArtUrls) {
+ if (!this.artVisible) {
+ this._lastArtSwap = 0;
+ this._randomizeArt();
+ this._setArtVisible(true);
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.hide)
+ }
+ else if (this.artVisible && this._lastArtSwap >= this.artSwapPeriod) {
+ this._lastArtSwap = 0;
+ this._randomizeArt()
+ }
+ else if (this.artVisible && this._cells && this._cells.length > 0 && this._lastArtShow >= this.artShowPeriod + this.artVisiblePeriod) {
+ this._setArtVisible(false);
+ this._lastCellSwap = 0;
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show);
+ this._lastArtShow = 0;
+ this._lastArtSwap = 0
+ }
+ }
+ else if (this._cells && this._cells.length > 0 && !this.artVisible && this._lastCellSwap >= this.cellSwapPeriod) {
+ this._lastCellSwap = 0;
+ var randomCell = this._cells[Math.floor(Math.random() * this._cells.length)];
+ this._setCellArt(randomCell)
+ }
+ if (this.colorChangePeriod > 0 && this._lastColorChange > this.colorChangePeriod) {
+ this._lastColorChange = 0;
+ this._randomizeLayerColors()
+ }
+ }
+ }, _startRenderLoop: function _startRenderLoop() {
+ this._lastInterval = (new Date).getTime();
+ window.requestAnimationFrame(this._renderLoop)
+ }, _lastInterval: 0, _renderLoop: function _renderLoop() {
+ this._renderLoopQueued = false;
+ if (this._frozen || this._unloaded || !this._timerEnabled)
+ return;
+ var elapsedTime = ((new Date).getTime()) - this._lastInterval;
+ if (elapsedTime > 20) {
+ this._lastInterval = (new Date).getTime();
+ if (!this._animationPaused) {
+ this._lastTimerTick += elapsedTime;
+ if (this._lastTimerTick > this.timerTickInterval) {
+ this._updateTimerValues();
+ this._timerTick();
+ this._lastTimerTick = 0
+ }
+ this._updateStartTime += elapsedTime;
+ if (this._cellsToUpdate && this._cellsToUpdate.length > 0) {
+ var updateInfo = this._cellsToUpdate[0];
+ if (updateInfo.sleep <= this._updateStartTime) {
+ this._setCellArt(updateInfo.cell);
+ this._cellsToUpdate.shift()
+ }
+ }
+ }
+ }
+ window.requestAnimationFrame(this._renderLoop);
+ this._renderLoopQueued = true
+ }, _updateTimerValues: function _updateTimerValues() {
+ this._lastArtShow += this.timerTickInterval;
+ this._lastArtSwap += this.timerTickInterval;
+ this._lastCellSwap += this.timerTickInterval;
+ this._lastColorChange += this.timerTickInterval
+ }, _toggleCells: function _toggleCells(show) {
+ this._cells.forEach(function(cell, index) {
+ var sleep = (cell.x + cell.x + cell.width + cell.y + cell.y + cell.height) / 2;
+ cell.toggleCell(show, sleep)
+ }.bind(this))
+ }, _cellsToUpdate: null, _updateStartTime: 0, _updateCellArts: function _updateCellArts() {
+ if (this._cellsToUpdate && this._cellsToUpdate.length > 0)
+ return;
+ this._cellsToUpdate = [];
+ this._cells.forEach(function(cell, index) {
+ var sleep = (cell.x + cell.x + cell.width + cell.y + cell.y + cell.height) / 2;
+ this._cellsToUpdate.push({
+ sleep: sleep, cell: cell
+ })
+ }.bind(this))
+ }, _randomizeLayerColor: function _randomizeLayerColor() {
+ var r1 = Math.floor(Math.random() * 255);
+ var g1 = Math.floor(Math.random() * 255);
+ var b1 = Math.floor(Math.random() * 255);
+ var a1 = 1;
+ return {
+ r: r1, g: g1, b: b1, a: a1
+ }
+ }, _randomizeLayerColors: function _randomizeLayerColors() {
+ var color = this._randomizeLayerColor();
+ var newColor = "rgba(" + color.r + "," + color.g + "," + color.b + "," + color.a + ")";
+ if (this.backgroundColor)
+ this.backdropColor = "rgba(" + color.r + "," + color.g + "," + color.b + ", .3)";
+ this._colorsToUpdate = [];
+ this._cells.forEach(function(cell, index) {
+ var sleep = (cell.x + cell.x + cell.width + cell.y + cell.y + cell.height) / 2;
+ cell.setOverlay(newColor, 0.5, sleep + "ms")
+ }.bind(this));
+ if (this._largeArt)
+ this._largeArt.setOverlay(newColor, 0.3)
+ }, _randomizeArt: function _randomizeArt() {
+ if (this.largeArtUrls) {
+ if (this._artIndex < 0)
+ this._artIndex = Math.floor(Math.random() * this.largeArtUrls.length);
+ else {
+ if (this.largeArtUrls.length === 1 && this._largeArt.currentImageUrl)
+ return false;
+ this._artIndex++;
+ if (this._artIndex >= this.largeArtUrls.length)
+ this._artIndex = 0
+ }
+ var imageUrl = this.largeArtUrls[this._artIndex];
+ this._setLargeArt(imageUrl);
+ this._toggleCells(MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.hide);
+ return true
+ }
+ else {
+ this._setLargeArt(null);
+ return false
+ }
+ }, _setLargeArt: function _setLargeArt(art) {
+ if (this._largeArt)
+ this._largeArt.setArt(art)
+ }
+ }, {
+ cellIdList: null, largeArtUrls: null, wallVisible: true, artVisible: false, backdropColor: "rgba(0,0,0,0.3)"
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/ImmersiveLayout.html b/packages/microsoft.zunevideo/controls/ImmersiveLayout.html
new file mode 100644
index 00000000..4295c008
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ImmersiveLayout.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+ Flip View Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/ImmersiveLayout.js b/packages/microsoft.zunevideo/controls/ImmersiveLayout.js
new file mode 100644
index 00000000..62ed6584
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ImmersiveLayout.js
@@ -0,0 +1,486 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ var _currentViewMorePopOver = null;
+ var CloseOverlayAction = MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function closeOverlayAction() {
+ this.base()
+ }, {
+ executed: function executed(parameter) {
+ parameter.hide()
+ }, canExecute: function canExecute(parameter) {
+ return true
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ ImmersiveLayout: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function ImmersiveLayout_Constructor(element, options) {
+ this._handleScroll = this._handleScroll.bind(this);
+ this._handleFocusIn = this._handleFocusIn.bind(this);
+ var navigationWrapper = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.navigationWrapper);
+ MS.Entertainment.UI.Controls.assert(navigationWrapper, "No navigation wrapper found");
+ var wrapperPosition = WinJS.Utilities.getPosition(navigationWrapper);
+ var leftEdge = wrapperPosition.left + wrapperPosition.width;
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ leftEdge = document.body.clientWidth - wrapperPosition.left;
+ if (MS.Entertainment.Utilities.isApp2)
+ this.bringIntoViewLeftMargin = 60;
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this.defaultHeroStyle = "immersiveHeroFrameColumn";
+ this._backButtonLeftEdge = leftEdge;
+ this._scroller.addEventListener("scroll", this._handleScroll);
+ this.domElement.addEventListener("focusin", this._handleFocusIn)
+ }, {
+ columnWidth: 400, defaultHeroStyle: "immersiveTwoColumn", bringIntoViewLeftMargin: 120, _backButtonMargin: 40, _calculatedHeroFrameWidth: 0, _backButtonLeftEdge: 120, _currentHeroFrame: null, _boundHandleHeroFrameFullScreenChange: null, currentFrameIndex: MS.Entertainment.UI.Framework.observableProperty("currentFrameIndex", 0), loadItemTemplate: function loadItemTemplate() {
+ this._itemTemplateProvider = {
+ render: function render(context, element) {
+ var completionPromise = WinJS.Promise.as(element);
+ element.setAttribute("data-win-control", "MS.Entertainment.UI.Framework.UserControl");
+ if (context === this._workingDataSource.item(0)) {
+ WinJS.Utilities.addClass(element, this.defaultHeroStyle);
+ completionPromise = context.getData().then(function(data) {
+ (new context.overviewConstructor(element, {
+ dataContext: data, frame: context, parent: this
+ }));
+ return element
+ }.bind(this), function failedToGetData(error) {
+ (new MS.Entertainment.UI.Controls.ImmersiveError(element, {dataContext: error}));
+ return element
+ })
+ }
+ else
+ (new MS.Entertainment.UI.Controls.ImmersiveFrame(element, {
+ frame: context, parent: this
+ }));
+ return completionPromise
+ }.bind(this), element: {tagName: "div"}
+ };
+ return WinJS.Promise.as()
+ }, applyItemTemplate: function applyItemTemplate(container, item) {
+ if (item.columnStyle)
+ WinJS.Utilities.addClass(container, item.columnStyle);
+ switch (item.columnSpan) {
+ case 1:
+ WinJS.Utilities.addClass(container, "immersiveOneColumn");
+ break;
+ case 2:
+ WinJS.Utilities.addClass(container, "immersiveTwoColumn");
+ break;
+ case 3:
+ WinJS.Utilities.addClass(container, "immersiveThreeColumn");
+ break;
+ default:
+ if (!item.columnStyle) {
+ WinJS.Utilities.addClass(container, "immersiveOneColumn");
+ MS.Entertainment.UI.Controls.assert(false, "Unsupported columnspan. defaulting to 1")
+ }
+ break
+ }
+ WinJS.Utilities.addClass(container, "immersiveFrameContainer");
+ container.setAttribute("data-ent-type", "pageScrollerFrame");
+ return container
+ }, itemsChanged: function itemsChanged() {
+ if (!this._boundHandleHeroFrameFullScreenChange)
+ this._boundHandleHeroFrameFullScreenChange = this._handleHeroFrameFullScreenChange.bind(this);
+ this.applyPanelTemplate();
+ if (!this._workingDataSource.length) {
+ if (this._currentHeroFrame)
+ this._currentHeroFrame.unbind(this._boundHandleHeroFrameFullScreenChange);
+ return
+ }
+ var heroItem = this._workingDataSource.item(0);
+ MS.Entertainment.UI.Controls.assert(heroItem._getObservable, "Frame 0 needs to be observable");
+ if (!heroItem._getObservable)
+ return;
+ if (heroItem !== this._currentHeroFrame) {
+ if (this._currentHeroFrame)
+ this._currentHeroFrame.unbind("isFullScreen", this._boundHandleHeroFrameFullScreenChange);
+ heroItem.bind("isFullScreen", this._boundHandleHeroFrameFullScreenChange);
+ this._currentHeroFrame = heroItem
+ }
+ }, _handleHeroFrameFullScreenChange: function _handleHeroFrameFullScreenChange(newVal, oldVal) {
+ if (this.domElement)
+ if (newVal)
+ WinJS.Utilities.addClass(this.domElement, "immersiveFullScreen");
+ else
+ WinJS.Utilities.removeClass(this.domElement, "immersiveFullScreen")
+ }, _handleScroll: function _handleScroll() {
+ if (!this._workingDataSource || !this._workingDataSource.length || MS.Entertainment.Utilities.isApp2 || MS.Entertainment.Utilities.isVideoApp)
+ return;
+ var currentScrollPosition = this._scroller.scrollLeft + (this._backButtonLeftEdge - this._backButtonMargin);
+ if (!this._calculatedHeroFrameWidth)
+ this._calculatedHeroFrameWidth = this.domElement.querySelector(".immersiveTwoColumn:first-of-type").clientWidth;
+ var currentFrameRightEdge = this._calculatedHeroFrameWidth;
+ var offScreenFrames = [];
+ var onScreenFrames = [];
+ for (var i = 1; i < this._workingDataSource.length; i++) {
+ var frame = this._workingDataSource.item(i);
+ if (currentFrameRightEdge < currentScrollPosition)
+ offScreenFrames.push(frame);
+ else
+ onScreenFrames.push(frame);
+ if (frame.columnSpan > 0)
+ currentFrameRightEdge += frame.columnSpan * this.columnWidth;
+ else {
+ var element = this.getElementForItem(frame);
+ currentFrameRightEdge += element.clientWidth
+ }
+ }
+ offScreenFrames.forEach(function(offScreenFrame) {
+ var element = this.getElementForItem(offScreenFrame);
+ var heading = element.querySelector(".headingRow > .headingLink");
+ if (heading && !heading.hasBeenHidden) {
+ heading.hasBeenHidden = true;
+ WinJS.UI.Animation.fadeOut(heading)
+ }
+ }.bind(this));
+ onScreenFrames.forEach(function(onScreenFrame) {
+ var element = this.getElementForItem(onScreenFrame);
+ var heading = element.querySelector(".headingRow > .headingLink");
+ if (heading && heading.hasBeenHidden) {
+ heading.hasBeenHidden = false;
+ WinJS.UI.Animation.fadeIn(heading)
+ }
+ }.bind(this))
+ }, _handleFocusIn: function _handleFocusIn() {
+ var children = WinJS.Utilities.children(this.domElement);
+ children.forEach(function(element, index) {
+ if (!element.contains(document.activeElement)) {
+ WinJS.Utilities.removeClass(element, "activeFrame");
+ return
+ }
+ WinJS.Utilities.addClass(element, "activeFrame");
+ this.currentFrameIndex = index
+ }.bind(this))
+ }, unload: function unload() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this);
+ if (!this._currentHeroFrame)
+ return;
+ this._currentHeroFrame.unbind(this._handleHeroFrameFullScreenChange)
+ }, applyPanelTemplate: function applyPanelTemplate() {
+ var positions = [];
+ var nextOffset = 0;
+ for (var i = 0; i < this._workingDataSource.length; i++) {
+ var item = this._workingDataSource.item(i);
+ if (nextOffset)
+ positions.push(nextOffset);
+ var columnWidth = (item.columnSpan * this.columnWidth);
+ if (i === 0) {
+ if (!this._calculatedHeroFrameWidth) {
+ var hero = this.domElement.querySelector(".immersiveTwoColumn:first-of-type");
+ if (hero)
+ this._calculatedHeroFrameWidth = hero.clientWidth
+ }
+ columnWidth = this._calculatedHeroFrameWidth - this._backButtonLeftEdge
+ }
+ nextOffset += columnWidth
+ }
+ var snaps = "snapList(0px, " + positions.join("px, ") + "px)";
+ this.domElement.style.msScrollSnapPointsX = snaps
+ }
+ }), ImmersiveFrame: MS.Entertainment.UI.Framework.defineUserControl("/Controls/ImmersiveLayout.html#Frame", function ImmersiveFrame_Constructor() {
+ this._contentReadyHandler = this._contentReadyHandler.bind(this);
+ this._viewMoreClicked = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._viewMoreClicked, this);
+ this.frame.showViewMore = this._viewMoreClicked;
+ this.frame.hideFrame = this.hideFrame.bind(this)
+ }, {
+ _frameBindings: null, _viewMoreButton: null, _content: null, _contentControl: null, _viewMoreOpened: false, _overlayResult: null, _hideFrame: false, frame: null, ignoreChildrenInitialization: true, initialize: function initialize() {
+ MS.Entertainment.UI.assert(this._content, "Need a content element to place control content");
+ this.frame.getData().then(function(data) {
+ this._content.setAttribute("data-win-control", "MS.Entertainment.UI.Framework.UserControl");
+ this._contentControl = new this.frame.overviewConstructor(this._content, {dataContext: data})
+ }.bind(this), function failedToGetData(error) {
+ this._content.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.ImmersiveError");
+ this._contentControl = new MS.Entertainment.UI.Controls.ImmersiveError(this._content, {dataContext: error})
+ }.bind(this));
+ this._frameBindings = WinJS.Binding.bind(this.frame, {hideViewMoreIfEnoughSpace: this._hideViewMoreIfEnoughSpaceChanged.bind(this)});
+ if (this.frame.disableHeaderButton)
+ this._viewMoreHeaderButton.disabled = true;
+ if (this.frame.visibleSignal) {
+ WinJS.Utilities.addClass(this.domElement, "hideFromDisplay");
+ this.frame.visibleSignal.promise.done(function showFrame() {
+ this.frame.visible = !this._hideFrame;
+ WinJS.Utilities.removeClass(this.domElement, "hideFromDisplay");
+ this.frame.visibleSignal = null
+ }.bind(this))
+ }
+ else
+ this.frame.visible = true
+ }, unload: function unload() {
+ if (this._overlayResult && this._overlayResult.viewMore)
+ this._overlayResult.viewMore.hide();
+ if (this._frameBindings) {
+ this._frameBindings.cancel();
+ this._frameBindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _hideViewMoreIfEnoughSpaceChanged: function _hideViewMoreIfEnoughSpaceChanged() {
+ this.viewMoreButtonVisible = !this.frame.hideViewMoreIfEnoughSpace;
+ this._viewMoreHeaderButton.disabled = this.frame.disableHeaderButton || !this.viewMoreButtonVisible;
+ if (this.viewMoreButtonVisible) {
+ this.viewMoreClickedHandler = this._viewMoreClicked;
+ this.domElement.removeEventListener("contentready", this._contentReadyHandler)
+ }
+ else
+ this.domElement.addEventListener("contentready", this._contentReadyHandler)
+ }, hideFrame: function hideFrameChanged(visible) {
+ this._hideFrame = !visible;
+ if (!this.frame.previousSignal)
+ this.frame.visible = visible;
+ if (this.domElement)
+ if (!visible)
+ WinJS.Utilities.addClass(this.domElement, "removeFromDisplay");
+ else
+ WinJS.Utilities.removeClass(this.domElement, "removeFromDisplay")
+ }, _viewMoreClicked: function _viewMoreClicked() {
+ if (this._viewMoreOpened)
+ return;
+ this._viewMoreOpened = true;
+ var telemetryParameters = {
+ title: this.frame.heading, automationId: MS.Entertainment.UI.AutomationIds.viewMoreImmersive
+ };
+ MS.Entertainment.Utilities.Telemetry.logCommandClicked(telemetryParameters);
+ WinJS.Binding.unwrap(this.parent).bringItemIntoView(this.frame, {
+ bringOnMinimally: true, animated: true
+ }).done(function viewMoreBroughtFrameIntoView() {
+ var framePosition = WinJS.Utilities.getPosition(this.domElement);
+ var frameIndex = -1;
+ if (this.frame.onShowMore)
+ this.frame.onShowMore();
+ if (this.parent && this.parent.dataSource)
+ frameIndex = this.parent.dataSource.indexOf(this.frame);
+ var result = MS.Entertainment.UI.Controls.ImmersiveViewMore.showPopOver({
+ frame: this.frame, framePosition: framePosition, frameIndex: frameIndex
+ });
+ var events = MS.Entertainment.Utilities.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {
+ windowresize: function viewMoreWindowResizeHandler() {
+ WinJS.Binding.unwrap(this.parent).bringItemIntoView(this.frame, {
+ bringOnMinimally: true, animated: false
+ }).done(function viewMoreWindowResizeHandlerScrolledIntoView() {
+ framePosition = WinJS.Utilities.getPosition(this.domElement);
+ result.viewMore.framePosition = framePosition
+ }.bind(this))
+ }.bind(this), isSnappedChanged: function viewMoreIsSnappedChanged(e) {
+ if (e.detail.newValue && result && result.viewMore)
+ result.viewMore.hide()
+ }
+ });
+ this._overlayResult = result;
+ result.completionPromise.done(function viewMorePopoverHiden() {
+ if (events)
+ events.cancel();
+ if (this.frame.onHideMore)
+ this.frame.onHideMore();
+ this._overlayResult = null;
+ this._viewMoreOpened = false
+ }.bind(this))
+ }.bind(this))
+ }, _contentReadyHandler: function _contentReadyHandler() {
+ if (this._content.clientHeight >= this._content.scrollHeight) {
+ this.viewMoreButtonVisible = false;
+ this.viewMoreClickedHandler = null;
+ this._viewMoreHeaderButton.disabled = true
+ }
+ else {
+ this.viewMoreButtonVisible = true;
+ this.viewMoreClickedHandler = this._viewMoreClicked;
+ this._viewMoreHeaderButton.disabled = false
+ }
+ if (this.frame.disableHeaderButton)
+ this._viewMoreHeaderButton.disabled = true
+ }
+ }, {
+ viewMoreButtonVisible: false, viewMoreClickedHandler: null
+ }), ImmersiveTableOfContents: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function ImmersiveTableOfContents_Constructor(element, options) {
+ var parent = element.parentNode;
+ while (parent) {
+ if (!parent.winControl) {
+ parent = parent.parentNode;
+ continue
+ }
+ if (parent.winControl instanceof MS.Entertainment.UI.Controls.ImmersiveLayout) {
+ this._immersiveLayoutControl = parent.winControl;
+ if (this._immersiveLayoutControl && this._immersiveLayoutControl.domElement)
+ this._heroHorizontalRule = this._immersiveLayoutControl.domElement.querySelector(".immersiveHeroContent .heroHorizonalRule");
+ break
+ }
+ parent = parent.parentNode
+ }
+ MS.Entertainment.UI.Controls.assert(this._immersiveLayoutControl, "Couldn't find immersive layout control. Make sure we're a child of it");
+ this._immersiveLayoutControl.bind("dataSource", function() {
+ this.dataSource = this._immersiveLayoutControl.dataSource
+ }.bind(this));
+ this._updateNavigationHandler()
+ }, {
+ itemTemplate: "/Controls/ImmersiveLayout.html#TableOfContentsItem", _immersiveLayoutControl: null, _heroHorizontalRule: null, _jumpedToScrollPosition: 0, _scrollMovementPercentage: 1.1, applyItemTemplate: function applyItemTemplate(container, item) {
+ if (!item.heading) {
+ WinJS.Utilities.addClass(container, "removeFromDisplay");
+ return container
+ }
+ WinJS.Utilities.addClass(container, "immersiveTableOfContentsItemContainer");
+ container.addEventListener("click", function tocItemClicked() {
+ this._immersiveLayoutControl.bringItemIntoView(item, {
+ bringOnMinimally: false, animated: true
+ }).done(function() {
+ this._jumpedToScrollPosition = this._immersiveLayoutControl.domElement.scrollLeft;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._immersiveLayoutControl.getElementForItem(item))
+ }.bind(this))
+ }.bind(this));
+ return container
+ }, itemsChanged: function itemsChanged() {
+ if (!this._workingDataSource || this._workingDataSource.length < 3) {
+ WinJS.Utilities.addClass(this.domElement, "hideFromDisplay");
+ if (this._heroHorizontalRule)
+ WinJS.Utilities.addClass(this._heroHorizontalRule, "hideFromDisplay")
+ }
+ else {
+ if (WinJS.Utilities.hasClass(this.domElement, "hideFromDisplay"))
+ WinJS.Utilities.removeClass(this.domElement, "hideFromDisplay");
+ if (this._heroHorizontalRule && WinJS.Utilities.hasClass(this._heroHorizontalRule, "hideFromDisplay"))
+ WinJS.Utilities.removeClass(this._heroHorizontalRule, "hideFromDisplay")
+ }
+ }, _updateNavigationHandler: function _updateNavigationHandler() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ var oldNavigateAway = page.onNavigateAway || function(){};
+ page.onNavigateAway = function() {
+ if (this._jumpedToScrollPosition) {
+ if (navigationService.navigationDirection === MS.Entertainment.Navigation.NavigationDirection.forward) {
+ oldNavigateAway();
+ return false
+ }
+ var layoutScrollPosition = 0;
+ if (this._immersiveLayoutControl && this._immersiveLayoutControl.domElement)
+ layoutScrollPosition = this._immersiveLayoutControl.domElement.scrollLeft;
+ MS.Entertainment.UI.Controls.assert(this._scrollMovementPercentage > 0.0, "Need an actual percentage to calculate");
+ var leftLimit = this._jumpedToScrollPosition / this._scrollMovementPercentage;
+ var rightLimit = this._jumpedToScrollPosition * this._scrollMovementPercentage;
+ var movedMoreThanXPercent = !((layoutScrollPosition > leftLimit) && (layoutScrollPosition < rightLimit));
+ if (!movedMoreThanXPercent) {
+ this._jumpedToScrollPosition = 0;
+ this._immersiveLayoutControl.bringItemIntoView(this.dataSource.item(0), {
+ bringOnMinimally: false, animated: true
+ }).done(null);
+ return true
+ }
+ }
+ page.onNavigateAway = oldNavigateAway;
+ oldNavigateAway();
+ return false
+ }.bind(this)
+ }
+ }), ImmersiveViewMore: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.PopOver", "/Controls/ImmersiveLayout.html#ViewMorePopOver", function ImmersiveViewMore_Constructor(element, options) {
+ options = options || {};
+ this.closeAction = new CloseOverlayAction;
+ this.closeAction.parameter = this;
+ if (this.frame.columnStyle)
+ WinJS.Utilities.addClass(element, this.frame.columnStyle);
+ if (options.frameIndex >= 0)
+ WinJS.Utilities.addClass(element, "immersiveViewMoreIndex" + options.frameIndex);
+ switch (this.frame.columnSpan) {
+ case 1:
+ WinJS.Utilities.addClass(element, "immersiveViewMoreOneColumn");
+ break;
+ case 2:
+ WinJS.Utilities.addClass(element, "immersiveViewMoreTwoColumn");
+ break;
+ default:
+ if (!this.frame.columnStyle) {
+ WinJS.Utilities.addClass(element, "immersiveViewMoreOneColumn");
+ MS.Entertainment.UI.Controls.assert(false, "Unsupported columnspan. defaulting to 1")
+ }
+ break
+ }
+ this._calculateGridDefinition = this._calculateGridDefinition.bind(this);
+ this.bind("framePosition", this._calculateGridDefinition)
+ }, {
+ closeAction: null, dontWaitForContent: true, autoSetFocus: false, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.PopOver.prototype.initialize.call(this);
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigation.hasBackStack) {
+ WinJS.Utilities.removeClass(this.backButton, "homeIcon");
+ this.backButton.setAttribute("aria-label", String.load(String.id.IDS_ACC_BACK_BUTTON))
+ }
+ else {
+ WinJS.Utilities.addClass(this.backButton, "homeIcon");
+ this.backButton.setAttribute("aria-label", String.load(String.id.IDS_ACC_HOME_BUTTON))
+ }
+ if (this.frame.viewMoreColumnStyle)
+ WinJS.Utilities.addClass(this._contentLayoutContainer, this.frame.viewMoreColumnStyle)
+ }, backButtonClick: function backButtonClick() {
+ this.hide().done(function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateBack()
+ })
+ }, suppressBubblingClicks: function suppressBubblingClicks(e) {
+ e.stopPropagation()
+ }, showAnimation: function showAnimation(element) {
+ return WinJS.Promise.as()
+ }, _calculateGridDefinition: function _calculateGridDefinition() {
+ if (!this.framePosition)
+ return;
+ var back = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.backButton).domElement;
+ var position = WinJS.Utilities.getPosition(back);
+ var offset = this.framePosition.left - position.left - position.width;
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft) {
+ var backEdge = MS.Entertainment.Utilities.getWindowWidth() - position.left;
+ var viewMoreEdge = MS.Entertainment.Utilities.getWindowWidth() - (this.framePosition.left + this.framePosition.width);
+ var adjustedEdge = viewMoreEdge - backEdge;
+ offset = adjustedEdge
+ }
+ this.gridDefinition = offset + "px 1fr"
+ }, handleTemplateLoaded: function handleTemplateLoaded() {
+ MS.Entertainment.UI.Framework.tryAndFocusElementInSubTreeWithTimer(this.overlayContent, 200).done(function focusCompleted() {
+ if (this._unloaded)
+ return;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.domElement)
+ }.bind(this))
+ }
+ }, {
+ gridDefinition: "", framePosition: null, headerVisible: true
+ }, {
+ showPopOver: function showPopOver(data) {
+ if (_currentViewMorePopOver)
+ return {completionPromise: WinJS.Promise.as()};
+ MS.Entertainment.UI.Controls.assert(data, "No data object supplied");
+ MS.Entertainment.UI.Controls.assert(data.frame, "No frame supplied");
+ MS.Entertainment.UI.Controls.assert(data.userControl || data.frame.viewMoreTemplate, "No user control supplied");
+ var userControlOptions = data.userControlOptions ? data.userControlOptions : {frame: data.frame};
+ var options = {
+ frame: data.frame, userControl: data.userControl || MS.Entertainment.UI.Controls.ImmersiveViewMore.TemplateRenderHelper, framePosition: data.framePosition, frameIndex: data.frameIndex, headerVisible: data.headerVisible !== undefined ? data.headerVisible : true, userControlOptions: userControlOptions, autoSetFocus: !!data.userControl
+ };
+ var viewMoreControl = new MS.Entertainment.UI.Controls.ImmersiveViewMore(document.createElement("div"), options);
+ _currentViewMorePopOver = viewMoreControl;
+ return {
+ viewMore: viewMoreControl, completionPromise: viewMoreControl.show().then(function() {
+ _currentViewMorePopOver = null
+ })
+ }
+ }, dismissCurrentPopOver: function dismissCurrentPopOver() {
+ if (!_currentViewMorePopOver)
+ return WinJS.Promise.wrap();
+ var currentViewMorePopover = _currentViewMorePopOver;
+ _currentViewMorePopOver = null;
+ return currentViewMorePopover.hide().then(function() {
+ currentViewMorePopover = null
+ })
+ }, TemplateRenderHelper: MS.Entertainment.UI.Framework.defineUserControl(null, function(element, options) {
+ this.viewMoreContentLoaded = this.frame.getData().then(function(data) {
+ MS.Entertainment.Utilities.loadHtmlPage(this.frame.viewMoreTemplate, element, data);
+ this.targetElement = element
+ }.bind(this))
+ }, {
+ ignoreChildrenInitialization: true, targetElement: null, viewMoreContentLoaded: null, initialize: function() {
+ this.viewMoreContentLoaded.then(function() {
+ return WinJS.Promise.timeout()
+ }.bind(this)).done(function() {
+ if (this.domElement) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PopOverTemplateLoaded", true, false);
+ this.domElement.dispatchEvent(domEvent)
+ }
+ }.bind(this))
+ }
+ })
+ }), ImmersiveError: MS.Entertainment.UI.Framework.defineUserControl("/Controls/ImmersiveLayout.html#Error", function ImmersiveError_Constructor(element, options){}, {initialize: function initialize(){}})
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/LibraryFeaturedContent.html b/packages/microsoft.zunevideo/controls/LibraryFeaturedContent.html
new file mode 100644
index 00000000..46465649
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/LibraryFeaturedContent.html
@@ -0,0 +1,158 @@
+
+
+
+
+ Template for the Hub control
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/LibraryFeaturedContent.js b/packages/microsoft.zunevideo/controls/LibraryFeaturedContent.js
new file mode 100644
index 00000000..22b3fc2d
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/LibraryFeaturedContent.js
@@ -0,0 +1,579 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ LibraryFeaturedDataNotificationHandler: MS.Entertainment.UI.Framework.define(function libraryFeaturedDataNotificationHandler(listUpdateCallback, itemUpdateCallback) {
+ this._listUpdateCallback = listUpdateCallback;
+ this._itemUpdateCallback = itemUpdateCallback
+ }, {
+ _listUpdateCallback: null, _itemUpdateCallback: null, dispose: function dispose() {
+ this._listUpdateCallback = null;
+ this._itemUpdateCallback = null
+ }, inserted: function inserted(item, previousKey, nextKey, index) {
+ if (this._listUpdateCallback)
+ this._listUpdateCallback(index)
+ }, changed: function changed(newItem, oldItem) {
+ if (this._itemUpdateCallback)
+ this._itemUpdateCallback(newItem, oldItem)
+ }, moved: function moved(item, previousKey, nextKey, oldIndex, newIndex){}, removed: function removed(key, index) {
+ if (this._listUpdateCallback)
+ this._listUpdateCallback(index, key)
+ }, countChanged: function countChanged(newCount, oldCount){}
+ }), NoContentPane: MS.Entertainment.UI.Framework.defineUserControl("/Controls/LibraryFeaturedContent.html#noContentPaneTemplate", null, {
+ _modelBindings: null, initialize: function initialize() {
+ if (this.model) {
+ if (this.model.primaryText)
+ this.title = this.model.primaryText;
+ else if (this.model.primaryStringId)
+ this.title = String.load(this.model.primaryStringId);
+ if (this.model.secondaryText)
+ this.description = this.model.secondaryText;
+ else if (this.model.secondaryStringId)
+ this.description = String.load(this.model.secondaryStringId);
+ this._modelBindings = WinJS.Binding.bind(this.model, {details: this._onDetailsChanged.bind(this)})
+ }
+ }, unload: function unload() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this);
+ if (this._modelBindings) {
+ this._modelBindings.cancel();
+ this._modelBindings = null
+ }
+ }, _onDetailsChanged: function _onDetailsChanged(newValue) {
+ this.details = newValue
+ }
+ }, {
+ title: null, description: null, details: null, model: null
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LibraryFeaturedContent: MS.Entertainment.UI.Framework.defineUserControl(null, function libraryFeaturedContentConstructor(element, options) {
+ this._queryWatcher = new MS.Entertainment.Framework.QueryWatcher("libraryFeaturedContent");
+ this._rebuildDataOnWindowSizeChange = this._rebuildDataOnWindowSizeChange.bind(this)
+ }, {
+ _queryResults: null, _itemsVisible: -1, _queryWatcher: null, _populateTimeout: null, controlName: "LibraryFeaturedContent", _fileTransferListenerId: null, _signInBinding: null, _queryBinding: null, _pendingLoadPromises: null, _queryPromise: null, _onScreen: true, _queryEventHandlers: null, _currentlySelectedItem: null, hidePanelWhenEmpty: false, _maxItems: {get: function get_maxItems() {
+ return MS.Entertainment.Utilities.HIGH_RESOLUTION_ROWS * 3
+ }}, initialize: function initialize() {
+ var librayQueryUpdated = function libraryQueryChanged() {
+ if (this._signInBinding) {
+ this._signInBinding.cancel();
+ this._signInBinding = null
+ }
+ var appSignIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signInBinding = WinJS.Binding.bind(appSignIn, {isSignedIn: this.refreshQueries.bind(this)})
+ };
+ this._queryBinding = WinJS.Binding.bind(this, {libraryQuery: librayQueryUpdated.bind(this)})
+ }, refreshQueries: function refreshQueries() {
+ if (this._queryPromise) {
+ this._queryPromise.cancel();
+ this._queryPromise = null
+ }
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (MS.Entertainment.Utilities.isVideoApp1 || signIn.isSignedIn)
+ this._queryPromise = WinJS.Promise.timeout(1000).then(function delayQuery() {
+ return this.executeQueries()
+ }.bind(this));
+ else
+ this._updateItems([])
+ }, executeQueries: function executeQueries() {
+ this._cancelPendingLoads();
+ this._unregisterContentNotificationListeners();
+ var pendingLoadPromisesArray = [];
+ var pendingLoadPromises;
+ if (this.libraryQuery && this._loadFeaturedItems)
+ if (Array.isArray(this.libraryQuery)) {
+ this._queryResults = [];
+ this._fileTransferListenerId = [];
+ for (var i = 0; i < this.libraryQuery.length; i++) {
+ this._fileTransferListenerId[i] = "LibraryFeaturedContent_" + Date.now() + "_" + Math.random();
+ pendingLoadPromisesArray.push(this._loadFeaturedItems(i))
+ }
+ }
+ else {
+ this._fileTransferListenerId = "LibraryFeaturedContent_" + Date.now() + "_" + Math.random();
+ pendingLoadPromisesArray.push(this._loadFeaturedItems())
+ }
+ pendingLoadPromises = WinJS.Promise.join(pendingLoadPromisesArray);
+ this._pendingLoadPromises = pendingLoadPromises;
+ pendingLoadPromises.done(function loadingComplete() {
+ if (pendingLoadPromises === this._pendingLoadPromises)
+ this._pendingLoadPromises = null
+ }.bind(this), function loadingFailed() {
+ if (pendingLoadPromises === this._pendingLoadPromises) {
+ this._pendingLoadPromises = null;
+ if (!this._queryResults || !this._queryResults.length)
+ this._updateItems([])
+ }
+ }.bind(this))
+ }, unload: function unload() {
+ if (this._queryBinding) {
+ this._queryBinding.cancel();
+ this._queryBinding = null
+ }
+ if (this._signInBinding) {
+ this._signInBinding.cancel();
+ this._signInBinding = null
+ }
+ this._cancelPendingLoads();
+ if (this._populateTimeout) {
+ this._populateTimeout.cancel();
+ this._populateTimeout = null
+ }
+ if (this._queryEventHandlers) {
+ this._queryEventHandlers.cancel();
+ this._queryEventHandlers = null
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).removeEventListener("windowresize", this._rebuildDataOnWindowSizeChange);
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this.onOffScreen();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this.onOnScreen()
+ }, onOffScreen: function onOffScreen() {
+ if (this._onScreen)
+ this._pauseQueries();
+ this._onScreen = false
+ }, onOnScreen: function onOnScreen() {
+ if (!this._onScreen)
+ this._unPauseQueries();
+ this._onScreen = true
+ }, onItemSelected: function onItemSelected(e) {
+ this._pauseQueries();
+ this._currentlySelectedItem = e.srcElement
+ }, onItemDeselected: function onItemDeselected(e) {
+ if (e.srcElement === this._currentlySelectedItem) {
+ this._unPauseQueries();
+ this._currentlySelectedItem = null
+ }
+ }, _pauseQueries: function _pauseQueries() {
+ if (this.libraryQuery)
+ if (Array.isArray(this.libraryQuery))
+ this.libraryQuery.forEach(function unpauseQuery(query) {
+ if (query.pause)
+ query.pause()
+ });
+ else if (this.libraryQuery.pause)
+ this.libraryQuery.pause()
+ }, _unPauseQueries: function _unPauseQueries() {
+ if (this.libraryQuery)
+ if (Array.isArray(this.libraryQuery))
+ this.libraryQuery.forEach(function unpauseQuery(query) {
+ if (query.unpause)
+ query.unpause()
+ });
+ else if (this.libraryQuery.unpause)
+ this.libraryQuery.unpause()
+ }, _cancelPendingLoads: function _cancelPendingLoads() {
+ if (this._pendingLoadPromises) {
+ this._pendingLoadPromises.cancel();
+ this._pendingLoadPromises = null
+ }
+ }, _loadFeaturedItems: function _loadFeaturedItems(index) {
+ var query = (index >= 0) ? this.libraryQuery[index] : this.libraryQuery;
+ var listenerId = (index >= 0) ? this._fileTransferListenerId[index] : this._fileTransferListenerId;
+ var sender = this._modifyQueryForContentNotifications(query);
+ this._queryWatcher.registerQuery(query);
+ if ("isLive" in query)
+ query.isLive = true;
+ if (this._queryEventHandlers) {
+ this._queryEventHandlers.cancel();
+ this._queryEventHandlers = null
+ }
+ return query.execute().then(function libraryFeaturedContentQueryComplete(q) {
+ if (index >= 0)
+ this._queryResults[index] = q.result.items;
+ else
+ this._queryResults = q.result.items;
+ this._registerContentNotificationListener(sender, listenerId);
+ if (q.isLive)
+ q.result.items.setNotificationHandler(new MS.Entertainment.UI.Controls.LibraryFeaturedDataNotificationHandler(this._handleDataNotifications.bind(this), this._handleDataUpdates.bind(this)));
+ this._queryEventHandlers = MS.Entertainment.Utilities.addEventHandlers(q, {resultChanged: function handleQueryResultChanged() {
+ this._handleQueryResultChanged(query, index)
+ }.bind(this)});
+ this._populateContent();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).addEventListener("windowresize", this._rebuildDataOnWindowSizeChange)
+ }.bind(this), function libraryFeaturedContentQueryError(q) {
+ return null
+ })
+ }, _handleQueryResultChanged: function _handleQueryResultChanged(query, index) {
+ if (index >= 0)
+ this._queryResults[index] = query.result && query.result.items;
+ else
+ this._queryResults = query.result && query.result.items;
+ this._populateContent()
+ }, _rebuildDataOnWindowSizeChange: function _rebuildDataOnWindowSizeChange() {
+ this._populateContent(true)
+ }, _handleDataUpdates: function _handleDateUpdates(newItem, oldItem){}, _handleDataNotifications: function _handleDataNotifications(index, key) {
+ MS.Entertainment.UI.Controls.assert(this._populateContent, "For db updates, LibraryFeaturedContent requires _populateContent defined");
+ if (index > this._maxItems)
+ return;
+ if (!key) {
+ if (!this.items || this._itemsVisible <= 0 || this.items.length < this._itemsVisible || index < this._itemsVisible)
+ this._deferredPopulateContent()
+ }
+ else
+ for (var i = 0; i < this.items.length; i++)
+ if (this.items[i].key === key) {
+ this._deferredPopulateContent();
+ break
+ }
+ }, _deferredPopulateContent: function _deferredPopulateContent() {
+ if (this._populateTimeout) {
+ this._populateTimeout.cancel();
+ this._populateTimeout = null
+ }
+ this._populateTimeout = WinJS.Promise.timeout(300).then(this._populateContent.bind(this), function cancelledHandler(error){})
+ }, _updateItems: function _updateItems(libraryItems) {
+ if (!this._content || !this._emptyContent)
+ return;
+ var hasItems = libraryItems && libraryItems.length > 0;
+ if (!hasItems) {
+ WinJS.Utilities.addClass(this._content.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._emptyContent.noContentPane, "removeFromDisplay");
+ WinJS.Utilities.addClass(this._emptyContent.noContentPane, this.emptyLibraryStyle)
+ }
+ else {
+ WinJS.Utilities.removeClass(this._content.domElement, "removeFromDisplay");
+ WinJS.Utilities.addClass(this._emptyContent.noContentPane, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._emptyContent.noContentPane, this.emptyLibraryStyle)
+ }
+ if (this.hidePanelWhenEmpty) {
+ var rootElement = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "dashboardPanel");
+ if (hasItems)
+ WinJS.Utilities.removeClass(rootElement, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(rootElement, "removeFromDisplay")
+ }
+ this.items = libraryItems;
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.domElement)
+ }, _unregisterContentNotificationListeners: function _unregisterContentNotificationListeners() {
+ if (this._fileTransferListenerId && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer)) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ if (Array.isArray(this._fileTransferListenerId))
+ for (var i = 0; i < this._fileTransferListenerId.length; i++) {
+ fileTransferService.unregisterListener(this._fileTransferListenerId[i]);
+ this._fileTransferListenerUnregistered(fileTransferService, this._fileTransferListenerId[i])
+ }
+ else {
+ fileTransferService.unregisterListener(this._fileTransferListenerId);
+ this._fileTransferListenerUnregistered(fileTransferService, this._fileTransferListenerId)
+ }
+ }
+ }, _modifyQueryForContentNotifications: function _modifyQueryForContentNotifications(query) {
+ var sender = null;
+ return sender
+ }, _registerContentNotificationListener: function _registerContentNotificationListener(sender, listenerId){}, _fileTransferListenerUnregistered: function _fileTransferListenerUnregistered(fileTransferService, listenerId){}, _filterNotifications: function _filterNotifications(notificationId) {
+ return false
+ }
+ }, {
+ items: undefined, emptyLibraryStyle: null, emptyLibraryModel: null, libraryClicked: null, libraryQuery: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LibraryVideoEmptyFeaturedContent: MS.Entertainment.UI.Framework.defineUserControl("/Controls/LibraryFeaturedContent.html#libraryEmptyContentTemplate", function LibraryVideoEmptyFeaturedContent(element, options){}, {
+ _bindings: null, _refreshPromise: null, _emptyCollectionPromise: null, initialize: function initialize() {
+ this._setupBindings()
+ }, _setupBindings: function _setupBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ var updateStateBinding = this._updateState.bind(this);
+ this._bindings = WinJS.Binding.bind(this, {sharedData: {
+ isSignedIn: updateStateBinding, isGrovelling: updateStateBinding, isQuerying: updateStateBinding, tvCount: updateStateBinding, movieCount: updateStateBinding
+ }})
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._emptyCollectionPromise) {
+ this._emptyCollectionPromise.cancel();
+ this._emptyCollectionPromise = null
+ }
+ if (this.sharedData) {
+ this.sharedData.unload();
+ this.sharedData = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, signInClickHandler: function signInClickHandler() {
+ var signInPromise = null;
+ var appSignIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (appSignIn)
+ signInPromise = appSignIn.signIn();
+ return WinJS.Promise.as(signInPromise).then(function onSignInComplete() {
+ if (this.sharedData)
+ this.sharedData.isSignedIn = appSignIn.isSignedIn
+ }.bind(this))
+ }, browseMoviesClickHandler: function browseMoviesClickHandler() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.movieMarketplace, MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases)
+ }, browseTvClickHandler: function browseTvClickHandler() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.tvMarketplace, MS.Entertainment.UI.Monikers.tvMarketplaceFeatured)
+ }, searchClickHandler: function searchClickHandler() {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ if (actionService) {
+ var searchAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.search);
+ return searchAction.execute()
+ }
+ }, _updateState: function _updateState() {
+ if (this._refreshPromise) {
+ this._refreshPromise.cancel();
+ this._refreshPromise = null
+ }
+ this._refreshPromise = WinJS.Promise.timeout(100).then(function refreshAfterDelay() {
+ var title = String.empty;
+ var description = String.empty;
+ var showSignInButton = false;
+ var showBrowseMoviesButton = false;
+ var showBrowseTvButton = false;
+ var showSearchButton = false;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var movieMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ if (this.sharedData) {
+ if (this._emptyCollectionPromise) {
+ this._emptyCollectionPromise.cancel();
+ this._emptyCollectionPromise = null
+ }
+ if (!this.sharedData.isSignedIn && !this.sharedData.isSigningIn) {
+ title = String.load(String.id.IDS_VIDEO2_COLLECTION_ANON_TITLE);
+ if (movieMarketplaceEnabled && tvMarketplaceEnabled)
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_ANON_DESCRIPTION);
+ else if (movieMarketplaceEnabled)
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_ANON_MOVIESMARKETPLACE_ONLY_DESCRIPTION);
+ else {
+ MS.Entertainment.UI.Controls.assert(tvMarketplaceEnabled, "No TV or movies marketplace was enabled");
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_ANON_TVMARKETPLACE_ONLY_DESCRIPTION)
+ }
+ showSignInButton = true
+ }
+ else if (this.sharedData.isSigningIn || this.sharedData.isGrovelling || this.sharedData.isQuerying) {
+ title = String.load(String.id.IDS_VIDEO2_COLLECTION_GROVEL_TITLE);
+ if (movieMarketplaceEnabled && tvMarketplaceEnabled)
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_GROVEL_DESCRIPTION);
+ else if (movieMarketplaceEnabled)
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_GROVEL_MOVIESMARKETPLACE_ONLY_DESCRIPTION);
+ else {
+ MS.Entertainment.UI.Controls.assert(tvMarketplaceEnabled, "No TV or movies marketplace was enabled");
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_GROVEL_TVMARKETPLACE_ONLY_DESCRIPTION)
+ }
+ showBrowseMoviesButton = movieMarketplaceEnabled;
+ showBrowseTvButton = tvMarketplaceEnabled;
+ showSearchButton = true
+ }
+ else if (this.sharedData.tvCount === 0 && this.sharedData.movieCount === 0)
+ this._emptyCollectionPromise = WinJS.Promise.timeout(3000).then(function showEmptyCollection() {
+ title = String.load(String.id.IDS_VIDEO2_COLLECTION_EMPTY_TITLE);
+ if (movieMarketplaceEnabled && tvMarketplaceEnabled)
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_EMPTY_DESCRIPTION_2);
+ else if (movieMarketplaceEnabled)
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_EMPTY_MOVIESMARKETPLACE_ONLY_DESCRIPTION_2);
+ else {
+ MS.Entertainment.UI.Controls.assert(tvMarketplaceEnabled, "No TV or movies marketplace was enabled");
+ description = String.load(String.id.IDS_VIDEO2_COLLECTION_EMPTY_TVMARKETPLACE_ONLY_DESCRIPTION_2)
+ }
+ showBrowseMoviesButton = movieMarketplaceEnabled;
+ showBrowseTvButton = tvMarketplaceEnabled;
+ showSearchButton = true
+ }.bind(this))
+ }
+ WinJS.Promise.as(this._emptyCollectionPromise).done(function updatePanel() {
+ this.titleText = title;
+ this.descriptionText = description;
+ this.showButtonSignIn = showSignInButton;
+ this.showButtonBrowseMovies = showBrowseMoviesButton;
+ this.showButtonBrowseTv = showBrowseTvButton;
+ this.showButtonSearch = showSearchButton
+ }.bind(this))
+ }.bind(this))
+ }
+ }, {
+ sharedData: null, titleText: String.empty, descriptionText: String.empty, showButtonSignIn: false, showButtonBrowseMovies: false, showButtonBrowseTv: false, showButtonSearch: false
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LibraryVideoFeaturedContent: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.LibraryFeaturedContent", "/Controls/LibraryFeaturedContent.html#libraryVideoContentTemplate", function(element, options) {
+ this.emptyLibraryStyle = "noVideoContentPane"
+ }, {
+ _itemsVisible: 0, itemsColumns: 2, propertyName: ['videoType', 'mediaType'], containerStyle: 'dashboardGridPersonalItemContent', itemSize: MS.Entertainment.Utilities.personalTileSize, showNavigateToCollectionButton: true, viewMoreInfo: {
+ icon: MS.Entertainment.UI.Icon.moreActions, title: null
+ }, _notifications: null, sharedData: null, sharedKey: "Video", initialize: function initialize() {
+ this.updateSettings();
+ MS.Entertainment.UI.Controls.LibraryFeaturedContent.prototype.initialize.call(this)
+ }, updateSettings: function updateSettings() {
+ if (this._content) {
+ this._content.itemSize = this.itemSize;
+ this._content.propertyName = this.propertyName;
+ this._content.containerStyle = this.containerStyle;
+ this._content.itemTemplates = MS.Entertainment.Utilities.isVideoApp1 ? [{
+ value: Microsoft.Entertainment.Queries.VideoType.movie, template: '/Components/Video/VideoStartupTemplates.html#moviePosterTile'
+ }, {
+ value: Microsoft.Entertainment.Queries.VideoType.other, template: '/Components/Video/VideoStartupTemplates.html#personalFileTileL1Small'
+ }, {
+ value: Microsoft.Entertainment.Queries.ObjectType.tvSeries, template: '/Components/Video/VideoStartupTemplates.html#tvSeriesTile'
+ }, {
+ value: 'actionButton', template: '/Components/Video/VideoStartupTemplates.html#dashboardEngagePanelButton'
+ }] : [{
+ value: Microsoft.Entertainment.Queries.VideoType.movie, template: '/Components/Video/VideoStartupTemplates2.html#moviePosterTile'
+ }, {
+ value: Microsoft.Entertainment.Queries.ObjectType.tvSeries, template: '/Components/Video/VideoStartupTemplates2.html#tvSeriesTile'
+ }, {
+ value: 'actionButton', template: '/Components/Video/VideoStartupTemplates2.html#dashboardEngagePanelButton'
+ }]
+ }
+ }, _maxItems: {get: function get_maxItems() {
+ return MS.Entertainment.Utilities.HIGH_RESOLUTION_VIDEO_ROWS * this.itemsColumns
+ }}, _loadFeaturedItems: function _loadFeaturedItems(index) {
+ if (this.sharedKey && this.sharedData)
+ this.sharedData[this.sharedKey] = -1;
+ MS.Entertainment.UI.Controls.LibraryFeaturedContent.prototype._loadFeaturedItems.apply(this, arguments)
+ }, _updateItems: function _updateItems(libraryItems) {
+ var totalItems = this.itemsColumns * MS.Entertainment.Utilities.getRowCountForResolution();
+ if (this.sharedKey && this.sharedData) {
+ var videoCount = libraryItems ? libraryItems.length : 0;
+ this.sharedData[this.sharedKey] = videoCount
+ }
+ this.viewMoreButtonVisible = (MS.Entertainment.Utilities.isApp2 && this.showNavigateToCollectionButton && libraryItems && libraryItems.length > 0 && libraryItems.length >= totalItems);
+ MS.Entertainment.UI.Controls.LibraryFeaturedContent.prototype._updateItems.apply(this, arguments)
+ }, _viewMoreClicked: function _viewMoreClicked() {
+ if (this.panelAction && this.panelAction.action)
+ this.panelAction.action.execute()
+ }, _getRowCountForResolution: function _getRowCountForResolution() {
+ return MS.Entertainment.Utilities.getRowCountForResolution()
+ }, _populateContent: function _populateContent(validateItemsNeeded) {
+ var totalItems = this.itemsColumns * this._getRowCountForResolution();
+ var setProperty = MS.Entertainment.Utilities.BindingAgnostic.setProperty;
+ this.updateSettings();
+ if (validateItemsNeeded && (totalItems === this._itemsVisible) && (this.items && this.items.length > 0) || !this._queryResults)
+ return;
+ this._itemsVisible = totalItems;
+ var goodItems = [];
+ return this._queryResults.forEachAll(function populateData(args) {
+ var item = args.item.data;
+ setProperty(item, "doclick", this.libraryClicked);
+ if (this.libraryQuery.queryId)
+ setProperty(item, "queryId", this.libraryQuery.queryId);
+ item.key = args.item.key;
+ if (item.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || item.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries)
+ goodItems.push(item);
+ if (goodItems.length >= this._itemsVisible)
+ args.stop = true
+ }.bind(this)).then(function updateItems() {
+ this._updateItems(goodItems)
+ }.bind(this))
+ }, _modifyQueryForContentNotifications: function _modifyQueryForContentNotifications(query) {
+ var sender = null;
+ if (query && query.status === MS.Entertainment.Data.queryStatus.idle) {
+ this._notifications = new MS.Entertainment.UI.ContentNotification.NotificationModification(MS.Entertainment.UI.ContentNotification.listResult(), MS.Entertainment.UI.ContentNotification.idFromProperty("libraryId"));
+ this._notifications.modifyQuery(query);
+ sender = this._notifications.createSender()
+ }
+ return sender
+ }, _handleDataUpdates: function _handleDataUpdates(newItem) {
+ MS.Entertainment.UI.Controls.LibraryFeaturedContent.prototype._handleDataUpdates.apply(this, arguments);
+ if (!newItem || !newItem.data || !this.items)
+ return;
+ var oldItem = null;
+ if (newItem.itemIndex >= 0 && this.items.length > newItem.itemIndex && this.items[newItem.itemIndex].libraryId === newItem.data.libraryId && this.items[newItem.itemIndex].mediaType === newItem.data.mediaType)
+ oldItem = this.items[newItem.itemIndex];
+ else {
+ var i = 0;
+ for (i = 0; i < this.items.length; i++) {
+ var currentItem = this.items[i];
+ if (currentItem.libraryId === newItem.data.libraryId && currentItem.mediaType === newItem.data.mediaType) {
+ oldItem = currentItem;
+ break
+ }
+ }
+ }
+ if (oldItem) {
+ if (oldItem.canPlayLocally !== newItem.data.canPlayLocally)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(oldItem, "canPlayLocally", newItem.data.canPlayLocally);
+ if (oldItem.downloadedEpisodesCount !== newItem.data.downloadedEpisodesCount)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(oldItem, "downloadedEpisodesCount", newItem.data.downloadedEpisodesCount)
+ }
+ }
+ }, {viewMoreButtonVisible: false})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LibraryPersonalFeaturedContent: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.LibraryVideoFeaturedContent", "/Controls/LibraryFeaturedContent.html#libraryVideoContentTemplate", function(element, options) {
+ this.emptyLibraryStyle = "noVideoContentPane"
+ }, {
+ rowCount: 3, itemsColumns: 2, containerStyle: 'dashboardGridPersonalItemContentSmall', itemSize: MS.Entertainment.Utilities.personalTileSize, _getRowCountForResolution: function _getRowCountForResolution() {
+ return this.rowCount
+ }, updateSettings: function updateSettings() {
+ if (this._content) {
+ var previousResolution = this._content.itemSize;
+ this._content.propertyName = this.propertyName;
+ if (MS.Entertainment.Utilities.isHighResolution()) {
+ this._content.itemSize = MS.Entertainment.Utilities.personalTileSize;
+ this._content.containerStyle = 'dashboardGridPersonalItemContentLarge';
+ this._content.itemTemplates = [{
+ value: Microsoft.Entertainment.Queries.VideoType.other, template: '/Components/Video/VideoStartupTemplates.html#personalFileTileL1Large'
+ }, {
+ value: 'actionButton', template: '/Components/Video/VideoStartupTemplates.html#dashboardEngagePanelButton'
+ }]
+ }
+ else {
+ this._content.itemSize = MS.Entertainment.Utilities.personalTileSizeL1Small;
+ this._content.containerStyle = 'dashboardGridPersonalItemContentSmall';
+ this._content.itemTemplates = [{
+ value: Microsoft.Entertainment.Queries.VideoType.other, template: '/Components/Video/VideoStartupTemplates.html#personalFileTileL1Small'
+ }, {
+ value: 'actionButton', template: '/Components/Video/VideoStartupTemplates.html#dashboardEngagePanelButton'
+ }]
+ }
+ if (previousResolution && previousResolution !== this._content.itemSize) {
+ this._content.applyPanelTemplate();
+ this._content.resetItemTemplate();
+ this._content.render(true)
+ }
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LibraryMovieFeaturedContent: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.LibraryVideoFeaturedContent", "/Controls/LibraryFeaturedContent.html#libraryMovieContentTemplate", function(element, options) {
+ this.emptyLibraryStyle = "noVideoContentPane";
+ this.itemSize = MS.Entertainment.Utilities.isVideoApp1 ? MS.Entertainment.Utilities.movieTileSize : MS.Entertainment.Utilities.movieLargeTileSize;
+ this.sharedKey = "movieCount";
+ this._uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {isFilledChanged: function isFilledChanged() {
+ this._populateContent()
+ }.bind(this)})
+ }, {
+ _itemsColumns: 2, itemsColumns: {get: function get_itemsColumns() {
+ this._itemsColumns = MS.Entertainment.Utilities.isApp1 ? 2 : (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFilled) ? 2 : 3;
+ var rootElement = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "dashboardContent");
+ if (this._itemsColumns > 2)
+ WinJS.Utilities.removeClass(rootElement, "fillMode");
+ else
+ WinJS.Utilities.addClass(rootElement, "fillMode");
+ return this._itemsColumns
+ }}, containerStyle: 'dashboardGridMovieItemContent', unload: function unload() {
+ if (this._uiStateEventHandler) {
+ this._uiStateEventHandler.cancel();
+ this._uiStateEventHandler = null
+ }
+ MS.Entertainment.UI.Controls.LibraryVideoFeaturedContent.prototype.unload.call(this)
+ }, _registerContentNotificationListener: function _registerContentNotificationListener(sender, listenerId) {
+ if (sender && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer)) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener(listenerId, function getTaskKey(task) {
+ return (task && (!task.seriesMediaId || MS.Entertainment.Utilities.isEmptyGuid(task.seriesMediaId)) && task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video) ? task.libraryId : null
+ }, sender, MS.Entertainment.UI.FileTransferNotifiers.genericFile)
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LibraryTvFeaturedContent: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.LibraryVideoFeaturedContent", "/Controls/LibraryFeaturedContent.html#libraryTvContentTemplate", function(element, options) {
+ this.emptyLibraryStyle = "noVideoContentPane";
+ this.itemSize = MS.Entertainment.Utilities.isVideoApp1 ? MS.Entertainment.Utilities.tvTileSize : MS.Entertainment.Utilities.tvLargeTileSize;
+ this.sharedKey = "tvCount"
+ }, {
+ itemsColumns: 1, containerStyle: 'dashboardGridTvItemContent', _registerContentNotificationListener: function _registerContentNotificationListener(sender, listenerId) {
+ if (sender && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer)) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener(listenerId, function getTaskKey(task) {
+ return (task && task.seriesMediaId && task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && !MS.Entertainment.Utilities.isEmptyGuid(task.seriesMediaId)) ? task.seriesLibraryId : null
+ }, sender, MS.Entertainment.UI.FileTransferNotifiers.episodeCollection)
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Link.html b/packages/microsoft.zunevideo/controls/Link.html
new file mode 100644
index 00000000..aa75b6e6
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Link.html
@@ -0,0 +1,91 @@
+
+
+
+
+
+ Link Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/LoadingControl.js b/packages/microsoft.zunevideo/controls/LoadingControl.js
new file mode 100644
index 00000000..19d90532
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/LoadingControl.js
@@ -0,0 +1,52 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {LoadingControl: MS.Entertainment.UI.Framework.defineUserControl(null, function loadingConstructor(element) {
+ element.value = 1;
+ WinJS.Utilities.addClass(element, "loadingProgress");
+ WinJS.Utilities.addClass(element, "loadingControlHidden");
+ this.bind("isBusy", function isBusyChanged(newValue) {
+ if (newValue && !this.currentlyDisplaying) {
+ var callback = function isBusyCallback() {
+ if (this.isBusy) {
+ if (!this.value)
+ this.domElement.removeAttribute("value");
+ WinJS.Utilities.removeClass(this.domElement, "loadingControlHidden");
+ this.currentlyDisplaying = true
+ }
+ }.bind(this);
+ if (this.displayDelay)
+ WinJS.Promise.timeout(this.displayDelay).then(callback);
+ else
+ callback()
+ }
+ else if (!newValue && this.currentlyDisplaying) {
+ WinJS.Utilities.addClass(this.domElement, "loadingControlHidden");
+ if (!this.domElement.getAttribute("value"))
+ this.domElement.value = 1;
+ this.currentlyDisplaying = false
+ }
+ }.bind(this));
+ this.bind("progress", function progressChanged(newValue) {
+ if (newValue)
+ this.domElement.value = newValue
+ }.bind(this));
+ if (this.height === this.width)
+ WinJS.Utilities.addClass(this.domElement, "ringLoadingControl")
+ }, {
+ controlName: "LoadingControl", displayDelay: 500, currentlyDisplaying: false, height: "5px", width: null, initialize: function initialize() {
+ if (this.height)
+ this.domElement.style.height = this.height;
+ if (this.width)
+ this.domElement.style.width = this.width;
+ if (this.value) {
+ this.progress = this.value;
+ if (this.max)
+ this.domElement.max = this.max
+ }
+ }
+ }, {
+ isBusy: false, progress: 0
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/ManageFoldersPage.html b/packages/microsoft.zunevideo/controls/ManageFoldersPage.html
new file mode 100644
index 00000000..1110ae24
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ManageFoldersPage.html
@@ -0,0 +1,87 @@
+
+
+
+
+ Manage Folders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/MediaImageCollage.js b/packages/microsoft.zunevideo/controls/MediaImageCollage.js
new file mode 100644
index 00000000..eee49cff
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/MediaImageCollage.js
@@ -0,0 +1,191 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MediaImageCollage: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ImageCollage", null, function mediaImageCollageConstructor(element, options) {
+ this.timerTickInterval = 10000;
+ this.timerDelayPeriod = 10 + Math.floor(Math.random() * 60000);
+ this.cellAddPeriod = 0;
+ this.cellSwapPeriod = 10000;
+ this.artShowPeriod = 20000;
+ this.artSwapPeriod = 40000;
+ this.artVisiblePeriod = 40000;
+ this.colorChangePeriod = 0;
+ this.cellRepeatBuffer = 0;
+ this._cellDefinitions = [];
+ this._cellDefinitions.push(this._6x6CellDefinitions1);
+ this._cellDefinitions.push(this._6x6CellDefinitions2);
+ this._cellDefinitions.push(this._6x6CellDefinitions3);
+ this._cellDefinitions.push(this._6x6CellDefinitions4);
+ if (MS.Entertainment.Utilities.isApp2)
+ this.backgroundColor = "#333333";
+ else
+ this.backgroundColor = "#ffffff"
+ }, {
+ _cellDefinitions: null, _4x4CellDefinitions: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 0, y: 1, size: 1
+ }, {
+ ordinal: 3, x: 1, y: 0, size: 1
+ }, {
+ ordinal: 4, x: 1, y: 1, size: 1
+ }, ], _6x6CellDefinitions1: [{
+ ordinal: 1, x: 0, y: 0, size: 2
+ }, {
+ ordinal: 2, x: 2, y: 0, size: 1
+ }, {
+ ordinal: 3, x: 2, y: 1, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 2, size: 1
+ }, {
+ ordinal: 5, x: 1, y: 2, size: 1
+ }, {
+ ordinal: 6, x: 2, y: 2, size: 1
+ }, ], _6x6CellDefinitions2: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 1, y: 0, size: 1
+ }, {
+ ordinal: 3, x: 2, y: 0, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 1, size: 2
+ }, {
+ ordinal: 5, x: 2, y: 1, size: 1
+ }, {
+ ordinal: 6, x: 2, y: 2, size: 1
+ }, ], _6x6CellDefinitions3: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 1, y: 0, size: 2
+ }, {
+ ordinal: 3, x: 0, y: 1, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 2, size: 1
+ }, {
+ ordinal: 5, x: 1, y: 2, size: 1
+ }, {
+ ordinal: 6, x: 2, y: 2, size: 1
+ }, ], _6x6CellDefinitions4: [{
+ ordinal: 1, x: 0, y: 0, size: 1
+ }, {
+ ordinal: 2, x: 1, y: 0, size: 1
+ }, {
+ ordinal: 3, x: 2, y: 0, size: 1
+ }, {
+ ordinal: 4, x: 0, y: 1, size: 1
+ }, {
+ ordinal: 5, x: 1, y: 1, size: 2
+ }, {
+ ordinal: 6, x: 0, y: 2, size: 1
+ }, ], _queryPromise: null, _imageCachePromises: null, _maxCellWidth: 0, _maxCellHeight: 0, _uiStateService: null, _networkStatusBinding: null, _delayInitializeFailed: false, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.initialize.apply(this, arguments);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._imageCachePromises = [];
+ this.artVisible = false;
+ if (this._delayInitializeFailed)
+ this._delayInitialized()
+ }, _delayInitialized: function _delayInitialized() {
+ if (!this._initialized) {
+ this._delayInitializeFailed = true;
+ return
+ }
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._delayInitialized.apply(this, arguments);
+ this.bind("media", this._mediaChanged.bind(this))
+ }, unload: function unload() {
+ if (this._queryPromise)
+ this._queryPromise.cancel();
+ if (this._imageCachePromises)
+ for (var i = 0; i < this._imageCachePromises.length; i++)
+ this._imageCachePromises[i].cancel();
+ this.cellIdList = null;
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.unload.call(this)
+ }, _mediaChanged: function _mediaChanged() {
+ if (!this._networkStatusBinding)
+ switch (this._uiStateService.networkStatus) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._networkStatusChanged.bind(this)});
+ break
+ }
+ this._loadImages()
+ }, _networkStatusChanged: function _networkStatusChanged(newValue, oldValue) {
+ if (oldValue === undefined)
+ return;
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ this._mediaChanged()
+ }, _loadImages: function _loadImages() {
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement))
+ return
+ }, _setCellDefinitions: function _setCellDefinitions(count) {
+ if (count > 6 && this.useDynamicLayouts) {
+ this.rows = 3;
+ this.columns = 3;
+ var definitionIndex = Math.floor(Math.random() * this._cellDefinitions.length);
+ this.cellDefinitions = this._cellDefinitions[definitionIndex];
+ this._maxCellWidth = this.size.width / 3 * 2;
+ this._maxCellHeight = this.size.height / 3 * 2
+ }
+ else {
+ this.rows = 2;
+ this.columns = 2;
+ this.cellDefinitions = this._4x4CellDefinitions;
+ this._maxCellWidth = this.size.width / 2;
+ this._maxCellHeight = this.size.height / 2
+ }
+ this._blockSizeInPixels = {
+ x: this.size.width, y: this.size.height
+ };
+ this._blockSizeInCells = {
+ x: this.columns, y: this.rows
+ };
+ this._cellSizeInPixels = {
+ x: this.size.width / this.columns, y: this.size.height / this.rows
+ };
+ this._cellOffsetInPixels = this.cellOffset
+ }, _setUrlFromCellId: function _getUrlFromCellId(media, cell) {
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement)) {
+ this.unload();
+ return
+ }
+ if (typeof media === "string") {
+ if (cell)
+ cell.setArt(media);
+ return media
+ }
+ if (media.cachedImageUrl) {
+ if (cell)
+ cell.setArt(media.cachedImageUrl);
+ return media.cachedImageUrl
+ }
+ var expectedWidth = Math.max(this._maxCellWidth, this.minimumSize.width);
+ var expectedHeight = Math.max(this._maxCellHeight, this.minimumSize.height);
+ var imageCachePromise = MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(media, expectedWidth, expectedHeight).then(function checkResult(url) {
+ media.cachedImageUrl = url;
+ if (url === MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album)
+ return null;
+ if (cell)
+ cell.setArt(media.cachedImageUrl);
+ return media.cachedImageUrl
+ });
+ if (imageCachePromise) {
+ this._imageCachePromises.push(imageCachePromise);
+ return imageCachePromise
+ }
+ }
+ }, {
+ media: null, size: {
+ width: 135, height: 135
+ }, minimumSize: {
+ width: 0, height: 0
+ }, columns: 2, rows: 2, useDynamicLayouts: true, cellOffset: 0
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/MediaItemThumbnail.js b/packages/microsoft.zunevideo/controls/MediaItemThumbnail.js
new file mode 100644
index 00000000..e70a2c83
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/MediaItemThumbnail.js
@@ -0,0 +1,93 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MediaItemThumbnail: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ThumbnailButton", "/Controls/ThumbnailButton.html#thumbnailButtonTemplate", function mediaItemThumbnailConstructor() {
+ this._findNotificationForDisplay = this._findNotificationForDisplay.bind(this);
+ this._displayedNotificationUpdated = this._displayedNotificationUpdated.bind(this)
+ }, {
+ _uniqueListenerId: null, _imageUrlCallbackToken: null, showNotifications: true, initialize: function mediaItemThumbnail_initialize() {
+ MS.Entertainment.UI.Controls.ThumbnailButton.prototype.initialize.call(this);
+ this.bind("mediaItem", this._mediaItemChanged.bind(this))
+ }, unload: function unload() {
+ this.unbind("mediaItem");
+ this._mediaItemChanged(null, this.mediaItem);
+ if (this._imageUrlCallbackToken)
+ MS.Entertainment.UI.Shell.ImageLoader.unregisterMediaItemImageUrlCallback(this._imageUrlCallbackToken);
+ MS.Entertainment.UI.Controls.ThumbnailButton.prototype.unload.call(this)
+ }, _mediaItemChanged: function _mediaItemChanged(newValue, oldValue) {
+ var calculatedImageWidth,
+ calculatedImageHeight;
+ if (newValue) {
+ this.target = newValue;
+ this.filePath = newValue.filePath;
+ this.imageFallbackUrl = MS.Entertainment.UI.Shell.ImageLoader.getMediaItemDefaultImageUrl(newValue)
+ }
+ if (oldValue && this._imageUrlCallbackToken) {
+ MS.Entertainment.UI.Shell.ImageLoader.unregisterMediaItemImageUrlCallback(this._imageUrlCallbackToken);
+ this._imageUrlCallbackToken = null
+ }
+ if (newValue && newValue.mediaType !== Microsoft.Entertainment.Queries.ObjectType.playlist && newValue.mediaType !== Microsoft.Entertainment.Queries.ObjectType.person) {
+ if (this.imageWidth !== null && (typeof this.imageWidth) === "string") {
+ var index = this.imageWidth.indexOf("px");
+ if (index > 0)
+ calculatedImageWidth = this.imageWidth.substr(0, index)
+ }
+ if (this.imageHeight !== null && (typeof this.imageHeight) === "string") {
+ var index = this.imageHeight.indexOf("px");
+ if (index > 0)
+ calculatedImageHeight = this.imageHeight.substr(0, index)
+ }
+ if (this.templateName === "videoThumbnailButtonTemplate" && (calculatedImageHeight <= 135 && calculatedImageWidth <= 99)) {
+ calculatedImageHeight = 160;
+ calculatedImageWidth = 107
+ }
+ this._imageUrlCallbackToken = MS.Entertainment.UI.Shell.ImageLoader.registerMediaItemImageUrlCallback(newValue, function setImagePrimaryUrl(url) {
+ if (this.imagePrimaryUrl !== url)
+ this.imagePrimaryUrl = url
+ }.bind(this), calculatedImageWidth, calculatedImageHeight)
+ }
+ if (this.showNotifications) {
+ if (oldValue && oldValue.contentNotifications)
+ oldValue.contentNotifications.removeChangeListener(this._findNotificationForDisplay);
+ this.displayedNotification = null;
+ if (newValue && newValue.contentNotifications) {
+ newValue.contentNotifications.addChangeListener(this._findNotificationForDisplay);
+ this._findNotificationForDisplay()
+ }
+ }
+ else
+ this.displayedNotification = null
+ }, _findNotificationForDisplay: function _findNotificationForDisplay() {
+ var i,
+ item;
+ var notifications = this.mediaItem.contentNotifications;
+ for (i = 0; i < notifications.length; i++) {
+ item = WinJS.Binding.unwrap(notifications).item(i);
+ if (item.shortText) {
+ if (item !== this._displayedNotification)
+ this.displayedNotification = item;
+ return
+ }
+ }
+ this.displayedNotification = null
+ }, displayedNotification: {
+ get: function get_displayedNotification() {
+ return this._displayedNotification
+ }, set: function set_displayedNotification(value) {
+ if (this._displayedNotification)
+ this._displayedNotification.unbind("shortText", this._displayedNotificationUpdated);
+ this._displayedNotification = value;
+ if (this._displayedNotification)
+ this._displayedNotification.bind("shortText", this._displayedNotificationUpdated);
+ else
+ this.quaternaryText = ""
+ }, enumerable: false
+ }, _displayedNotification: null, _displayedNotificationUpdated: function _displayedNotificationUpdated(newValue) {
+ if (newValue)
+ this.quaternaryText = newValue;
+ else
+ this._findNotificationForDisplay()
+ }
+ }, {mediaItem: null})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/MessageBox.html b/packages/microsoft.zunevideo/controls/MessageBox.html
new file mode 100644
index 00000000..555b87c0
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/MessageBox.html
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Message Box Template
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/MessageBox.js b/packages/microsoft.zunevideo/controls/MessageBox.js
new file mode 100644
index 00000000..0c9f482c
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/MessageBox.js
@@ -0,0 +1,6 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MessageBox: MS.Entertainment.UI.Framework.defineUserControl("/Controls/MessageBox.html#messageBoxTemplate", function messageBoxConstructor(element, options){}, {}, {description: null})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/MessageLinkBox.html b/packages/microsoft.zunevideo/controls/MessageLinkBox.html
new file mode 100644
index 00000000..55354bef
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/MessageLinkBox.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ Message Link Box Template
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/MessageLinkBox.js b/packages/microsoft.zunevideo/controls/MessageLinkBox.js
new file mode 100644
index 00000000..9cf487ec
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/MessageLinkBox.js
@@ -0,0 +1,8 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MessageLinkBox: MS.Entertainment.UI.Framework.defineUserControl("/Controls/MessageLinkBox.html#messageLinkBoxTemplate", function messageLinkBoxConstructor(element, options) {
+ this.webLinkText = String.load(String.id.IDS_COLLECTION_TOOLTIP_LEARN_MORE)
+ }, {}, {})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Modifier.html b/packages/microsoft.zunevideo/controls/Modifier.html
new file mode 100644
index 00000000..e54e076d
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Modifier.html
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+ Modifier Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/ModifierGalleryPage.html b/packages/microsoft.zunevideo/controls/ModifierGalleryPage.html
new file mode 100644
index 00000000..7fe3498c
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ModifierGalleryPage.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/ModifierGalleryPage.js b/packages/microsoft.zunevideo/controls/ModifierGalleryPage.js
new file mode 100644
index 00000000..5ecc7352
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ModifierGalleryPage.js
@@ -0,0 +1,283 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ModifierGalleryPage: MS.Entertainment.UI.Framework.defineUserControl(null, function(element, options) {
+ this._traceProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ var container = element.querySelector("[data-ent-member='_container']");
+ WinJS.UI.processAll(container).done(function() {
+ WinJS.Binding.processAll(container, this)
+ }.bind(this))
+ }, {
+ processChildren: true, deferInitialization: false, preventHideDuringInitialize: true, controlName: "ModifierGalleryPage", _hubsCalculated: false, initialize: function initialize() {
+ this._initialized = true;
+ this._populateHub();
+ this._calculateHubs();
+ this._modifierControlBindings = WinJS.Binding.bind(this, {
+ galleryModifier: {selectedItem: this._galleryModifierSelectedItemChanged.bind(this)}, primaryModifierControl: {selectedItem: this._primaryModifierSelectedItemChanged.bind(this)}, secondaryModifierControl: {selectedItem: this._secondaryModifierSelectedItemChanged.bind(this)}, tertiaryModifierControl: {selectedItem: this._tertiaryModifierSelectedItemChanged.bind(this)}
+ })
+ }, unload: function unload() {
+ if (this._modifierControlBindings) {
+ this._modifierControlBindings.cancel();
+ this._modifierControlBindings = null
+ }
+ if (this._modifierDataSourceBindings) {
+ this._modifierDataSourceBindings.cancel();
+ this._modifierDataSourceBindings = null
+ }
+ if (this._complexBindings) {
+ this._complexBindings.cancel();
+ this._complexBindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, onNavigateTo: function onNavigateTo(page, hub, panel) {
+ if (this._ownedPage && (this._ownedPage !== page)) {
+ MS.Entertainment.UI.Controls.fail("Expected to always be called on the same page");
+ return
+ }
+ if (!this._ownedPage)
+ this._ownedPage = page;
+ this._traceProvider.traceHubStrip_Load_Start(page.iaNode.moniker);
+ var selectedHub = page.hubs.indexOf(hub);
+ if (selectedHub !== this.selectedHub) {
+ var panelIndex = Math.max(hub.iaNode.children.indexOf(hub.iaNode.defaultChild), 0);
+ this._panelTemplatePromise = MS.Entertainment.UI.Framework.loadTemplate(hub.panels[panelIndex].fragmentUrl, null, true);
+ this.selectedHub = selectedHub;
+ this.selectedHubItem = page.hubs[this.selectedHub];
+ if (this._complexBindings) {
+ this._complexBindings.cancel();
+ this._complexBindings = null
+ }
+ this._populateHub();
+ if (this._initialized && !this._hubsCalculated)
+ this._calculateHubs()
+ }
+ }, handlePanelReady: function handlePanelReady(e) {
+ this._traceProvider.tracePanel_Ready(this._currentPanel.iaNode.moniker);
+ this._traceProvider.traceHub_Ready(this._currentHub.iaNode.moniker);
+ this._traceProvider.traceHubStrip_Ready(this._ownedPage.iaNode.moniker);
+ if (e.failed || (!e.failed && this._isFailed)) {
+ this._failedModel = e.model;
+ this._isFailed = e.failed
+ }
+ var event = document.createEvent("Event");
+ event.initEvent("HubStripVisible", true, false);
+ this.domElement.dispatchEvent(event);
+ this._traceProvider.traceHubStrip_Load_End(this._ownedPage.iaNode.moniker);
+ var event = document.createEvent("Event");
+ event.initEvent("HubStripLoaded", true, false);
+ this.domElement.dispatchEvent(event);
+ this._traceProvider.traceHubStrip_Ready("dashboard");
+ var event = document.createEvent("Event");
+ event.initEvent("HubStripReady", true, false);
+ this.domElement.dispatchEvent(event);
+ this._isLoading = false;
+ this._adjustLoadingAndContainerPanels()
+ }, handlePanelReset: function handlePanelReset(e) {
+ if (!this._isLoading) {
+ this._traceProvider.tracePanel_Load_Start(this._currentPanel.iaNode.moniker);
+ this._failedModel = null;
+ this._isFailed = false;
+ this._isLoading = !this.dataContext || this.dataContext.doNotRaisePanelReady
+ }
+ this._adjustLoadingAndContainerPanels()
+ }, _ownedPage: null, _currentHub: null, _currentPanel: null, _traceProvider: null, _modifierControlBindings: null, _modifierDataSourceBindings: null, _complexBindings: null, _panelTemplatePromise: null, _adjustLoadingAndContainerPanels: function _adjustLoadingAndContainerPanels() {
+ var progressRing;
+ var failedControlDiv;
+ if (!this._isLoading && !this._isFailed) {
+ MS.Entertainment.Utilities.hideElement(this._loadingPanel);
+ MS.Entertainment.Utilities.empty(this._loadingProgress);
+ MS.Entertainment.Utilities.hideElement(this._failedPanel);
+ MS.Entertainment.Utilities.showElement(this._panelContainer);
+ WinJS.Utilities.removeClass(this.domElement, "failed");
+ if (this._panelAction)
+ this._panelTitle.action = this._panelAction.action
+ }
+ else if (!this._isLoading && this._isFailed) {
+ WinJS.Utilities.addClass(this.domElement, "failed");
+ MS.Entertainment.Utilities.hideElement(this._loadingPanel);
+ MS.Entertainment.Utilities.empty(this._loadingProgress);
+ MS.Entertainment.Utilities.showElement(this._panelContainer);
+ if (this._panelAction)
+ this._panelTitle.action = null;
+ if (!this._failedPanel.firstElementChild) {
+ failedControlDiv = document.createElement("div");
+ failedControlDiv.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.FailedPanel");
+ this._failedPanel.appendChild(failedControlDiv);
+ (new MS.Entertainment.UI.Controls.FailedPanel(failedControlDiv))
+ }
+ this._failedPanel.firstElementChild.winControl.model = this._failedModel;
+ MS.Entertainment.Utilities.showElement(this._failedPanel)
+ }
+ else if (this._isLoading) {
+ WinJS.Utilities.removeClass(this.domElement, "failed");
+ MS.Entertainment.Utilities.showElement(this._loadingPanel);
+ if (this._loadingProgress.children && this._loadingProgress.children.length < 1) {
+ progressRing = document.createElement("progress");
+ progressRing.className = "galleryProgress win-medium win-ring";
+ this._loadingProgress.appendChild(progressRing)
+ }
+ MS.Entertainment.Utilities.hideElement(this._failedPanel);
+ MS.Entertainment.Utilities.hideElement(this._panelContainer)
+ }
+ }, _titleOverrideChanged: function _titleOverrideChanged(newValue, oldValue) {
+ if (newValue !== null && newValue !== undefined)
+ this.pageTitle = newValue;
+ else if (this._ownedPage)
+ this.pageTitle = this._ownedPage.title;
+ else
+ this.pageTitle = String.empty
+ }, _subTitleOverrideChanged: function _subTitleOverrideChanged(newValue, oldValue) {
+ if (newValue)
+ this.pageSubTitle = newValue;
+ else
+ this.pageSubTitle = String.empty
+ }, _secondaryModifierLabelChanged: function _secondaryModifierLabelChanged(newValue, oldValue) {
+ if (!this.secondaryModifierControl)
+ return;
+ if (newValue)
+ this.secondaryModifierControl.descriptionLabel = newValue
+ }, _hideHubsChanged: function _hideHubsChanged(newValue, oldValue) {
+ if (newValue === undefined)
+ return;
+ if (newValue) {
+ if (this.galleryModifier && this.galleryModifier.domElement)
+ WinJS.Utilities.addClass(this.galleryModifier.domElement, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._pageTitle, "removeFromDisplay");
+ WinJS.Utilities.removeClass(this._pageSubTitle, "removeFromDisplay")
+ }
+ else {
+ if (this.galleryModifier && this.galleryModifier.domElement)
+ WinJS.Utilities.removeClass(this.galleryModifier.domElement, "removeFromDisplay");
+ WinJS.Utilities.addClass(this._pageTitle, "removeFromDisplay");
+ WinJS.Utilities.addClass(this._pageSubTitle, "removeFromDisplay")
+ }
+ }, _refreshPrimaryModifier: function _refreshPrimaryModifier(value) {
+ this.primaryModifierControl.selectionManager = this.dataContext.viewModel.modifierSelectionManager
+ }, _refreshSecondaryModifier: function _refreshSecondaryModifier(value) {
+ this.secondaryModifierControl.selectionManager = this.dataContext.viewModel.secondaryModifierSelectionManager
+ }, _populateHub: function _populateHub() {
+ if (!this._initialized || !this._ownedPage)
+ return;
+ if (this._ownedPage.hubs[this.selectedHub] === this._currentHub)
+ return;
+ this._currentHub = this._ownedPage.hubs[this.selectedHub];
+ if (this._ownedPage.hubs.length === 1) {
+ if (this.galleryModifier && this.galleryModifier.domElement)
+ WinJS.Utilities.addClass(this.galleryModifier.domElement, "removeFromDisplay")
+ }
+ else {
+ WinJS.Utilities.addClass(this._pageTitle, "removeFromDisplay");
+ WinJS.Utilities.addClass(this._pageSubTitle, "removeFromDisplay")
+ }
+ MS.Entertainment.Utilities.empty(this._panelContainer);
+ var panelIndex = Math.max(this._currentHub.iaNode.children.indexOf(this._currentHub.iaNode.defaultChild), 0);
+ var oldPanel = this._currentPanel;
+ var panel = this._currentHub.panels[panelIndex];
+ this._currentPanel = panel;
+ var context = MS.Entertainment.UI.Controls.ModifierGalleryPage.extractContextForPanel(this._ownedPage, this._currentHub, panel);
+ this.dataContext = context;
+ if (this._modifierDataSourceBindings)
+ this._modifierDataSourceBindings.cancel();
+ this._modifierDataSourceBindings = WinJS.Binding.bind(context, {
+ primaryModifier: {items: this._hasPrimaryModifierItems.bind(this)}, secondaryModifier: {items: this._hasSecondaryModifierItems.bind(this)}, tertiaryModifier: {items: this._hasTertiaryModifierItems.bind(this)}
+ });
+ MS.Entertainment.UI.Framework.assert(!this._complexBindings, "bindings should have been cleared");
+ this._complexBindings = WinJS.Binding.bind(this.dataContext, {viewModel: {
+ titleOverride: this._titleOverrideChanged.bind(this), subTitleOverride: this._subTitleOverrideChanged.bind(this), secondaryModifierLabelOverride: this._secondaryModifierLabelChanged.bind(this), hideHubs: this._hideHubsChanged.bind(this), modifierSelectionManager: {dataSource: this._refreshPrimaryModifier.bind(this)}, secondaryModifierSelectionManager: {dataSource: this._refreshSecondaryModifier.bind(this)}
+ }});
+ this._traceProvider.traceHub_Load_Start(this._currentHub.iaNode.moniker);
+ this._isLoading = true;
+ this._adjustLoadingAndContainerPanels();
+ if (!this._panelTemplatePromise)
+ this._panelTemplatePromise = MS.Entertainment.UI.Framework.loadTemplate(panel.fragmentUrl, null, true);
+ this._panelTemplatePromise.then(function(render) {
+ if (oldPanel)
+ WinJS.Utilities.removeClass(this._panelContainer, oldPanel.iaNode.moniker);
+ WinJS.Utilities.addClass(this._panelContainer, panel.iaNode.moniker);
+ this._traceProvider.tracePanel_Load_Start(panel.iaNode.moniker);
+ return render.render({dataContext: context}, this._panelContainer)
+ }.bind(this)).done(function() {
+ this._traceProvider.tracePanel_Load_End(panel.iaNode.moniker);
+ this._traceProvider.traceHub_Load_End(this._currentHub.iaNode.moniker);
+ if (!this.dataContext || !this.dataContext.doNotRaisePanelReady)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this._panelContainer)
+ }.bind(this))
+ }, _calculateHubs: function _calculateHubs() {
+ if (!this._ownedPage)
+ return;
+ var page = this._ownedPage;
+ var selectedHubItem = this.selectedHubItem;
+ var hubs = page.hubs.map(function(iaHub) {
+ return WinJS.Binding.as({
+ title: iaHub.title, moniker: iaHub.iaNode.moniker
+ })
+ }.bind(this));
+ if (!this.pageTitle)
+ if (hubs.length === 1)
+ this.pageTitle = hubs[0].title;
+ else
+ this.pageTitle = page.title;
+ WinJS.Utilities.addClass(this.domElement, page.iaNode.moniker);
+ this.hubs = hubs;
+ if (this.galleryModifier) {
+ this.galleryModifier.items = page.hubs;
+ this.galleryModifier.selectedItem = selectedHubItem || this.galleryModifier.selectedItem
+ }
+ this._hubsCalculated = true
+ }, _hasPrimaryModifierItems: function _hasPrimaryModifierItems(newValue) {
+ if (!this.primaryModifierControl || !this.primaryModifierControl.domElement)
+ return;
+ if (newValue && newValue.length)
+ WinJS.Utilities.removeClass(this.primaryModifierControl.domElement, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this.primaryModifierControl.domElement, "removeFromDisplay")
+ }, _hasSecondaryModifierItems: function _hasSecondaryModifierItems(newValue) {
+ if (!this.secondaryModifierControl || !this.secondaryModifierControl.domElement)
+ return;
+ if (newValue && newValue.length)
+ WinJS.Utilities.removeClass(this.secondaryModifierControl.domElement, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this.secondaryModifierControl.domElement, "removeFromDisplay")
+ }, _hasTertiaryModifierItems: function _hasTertiaryModifierItems(newValue) {
+ if (!this.tertiaryModifierControl || !this.tertiaryModifierControl.domElement)
+ return;
+ if (newValue && newValue.length)
+ WinJS.Utilities.removeClass(this.tertiaryModifierControl.domElement, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this.tertiaryModifierControl.domElement, "removeFromDisplay")
+ }, _galleryModifierSelectedItemChanged: function _galleryModifierSelectedItemChanged(newValue, oldValue) {
+ if (!newValue || (WinJS.Utilities.getMember("iaNode.moniker", newValue) && WinJS.Utilities.getMember("iaNode.moniker", newValue) === WinJS.Utilities.getMember("selectedHubItem.iaNode.moniker", this)))
+ return;
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateTo(this._ownedPage.iaNode, newValue.iaNode)
+ }, _primaryModifierSelectedItemChanged: function _primaryModifierSelectedItemChanged(newValue, oldValue) {
+ if (this.dataContext && this.dataContext.primaryModifier && this.dataContext.primaryModifier.selectedItem !== newValue)
+ this.dataContext.primaryModifier.selectedItem = newValue
+ }, _secondaryModifierSelectedItemChanged: function _primaryModifierSelectedItemChanged(newValue, oldValue) {
+ if (this.dataContext && this.dataContext.secondaryModifier && this.dataContext.secondaryModifier.selectedItem !== newValue)
+ this.dataContext.secondaryModifier.selectedItem = newValue
+ }, _tertiaryModifierSelectedItemChanged: function _primaryModifierSelectedItemChanged(newValue, oldValue) {
+ if (this.dataContext && this.dataContext.tertiaryModifier && this.dataContext.tertiaryModifier.selectedItem !== newValue)
+ this.dataContext.tertiaryModifier.selectedItem = newValue
+ }, ignoreFirstOne: true
+ }, {
+ pageTitle: null, pageSubTitle: null, hubs: null, selectedHub: -1, selectedHubItem: null, dataContext: null
+ }, {extractContextForPanel: function extractContextForPanel(page, hub, panel) {
+ var getNodeDataContext = function getNodeDataContext(node) {
+ var dataContext = null;
+ if (node) {
+ if (node.clearDataContext)
+ node.clearDataContext();
+ dataContext = node.getDataContext()
+ }
+ return dataContext
+ };
+ var dataContext = getNodeDataContext(panel);
+ if (!dataContext)
+ dataContext = getNodeDataContext(hub);
+ if (!dataContext)
+ dataContext = getNodeDataContext(page);
+ MS.Entertainment.UI.Controls.assert(dataContext, "Didn't find a data context on the panel, hub, or page");
+ return dataContext || {}
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Music/ArtistImageCollage.js b/packages/microsoft.zunevideo/controls/Music/ArtistImageCollage.js
new file mode 100644
index 00000000..b50dea2d
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Music/ArtistImageCollage.js
@@ -0,0 +1,117 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ArtistImageCollage: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MediaImageCollage", null, null, {
+ allowLargeArt: true, _queryDelayPeriod: 3000, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.initialize.apply(this, arguments);
+ this.timerTickInterval = 10000;
+ this.timerDelayPeriod = 10 + Math.floor(Math.random() * 30000);
+ this.cellAddPeriod = 0;
+ this.cellSwapPeriod = 10000;
+ this.artShowPeriod = 20000;
+ this.artSwapPeriod = 40000;
+ this.artVisiblePeriod = 20000;
+ this.largeArtDelay = 700;
+ this.colorChangePeriod = 0;
+ this.cellRepeatBuffer = 0;
+ this.backgroundColor = "#ffffff"
+ }, _loadImages: function _loadImages() {
+ if (!this.media)
+ return;
+ var hydratePromise;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var isArtist = this.media && this.media.mediaType === Microsoft.Entertainment.Queries.ObjectType.person;
+ this._clearCells();
+ this.largeArtUrls = null;
+ if (isMusicMarketplaceEnabled && isArtist && !this.media.hasCanonicalId && this.media.hasZuneId)
+ hydratePromise = this.media.hydrate();
+ else
+ hydratePromise = WinJS.Promise.wrap();
+ hydratePromise.then(function loadMediaImage() {
+ return MS.Entertainment.UI.Shell.ImageLoader.getServiceImageUrl(this.media, this.size.width, this.size.height)
+ }.bind(this)).then(function addUrl(url) {
+ if (this.url && url !== MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album && this.allowLargeArt)
+ this._addLargeArtUrl(url);
+ else
+ this._queryDelayPeriod = 0;
+ return WinJS.Promise.timeout(this._queryDelayPeriod)
+ }.bind(this)).done(function getAlbums() {
+ if (isArtist && isMusicMarketplaceEnabled && this.media && this.media.hasCanonicalId) {
+ var marketplaceAlbumQuery = new MS.Entertainment.Data.Query.Music.ArtistTopAlbums;
+ marketplaceAlbumQuery.aggregateChunks = false;
+ marketplaceAlbumQuery.artistId = this.media.canonicalId;
+ this._queryPromise = marketplaceAlbumQuery.execute().then(function(query) {
+ this._queryPromise = null;
+ if (query.result && query.result.items)
+ query.result.items.toArray(0, 8).then(function processResults(albums) {
+ this._setAlbumCellsOrDefault(albums)
+ }.bind(this));
+ else
+ this._setAlbumCellsOrDefault(null)
+ }.bind(this))
+ }
+ else if (isArtist && this.media.libraryId >= 0) {
+ var localAlbumQuery = new MS.Entertainment.Data.Query.libraryAlbums;
+ localAlbumQuery.aggregateChunks = false;
+ localAlbumQuery.chunkSize = 8;
+ localAlbumQuery.artistId = this.media.libraryId;
+ this._queryPromise = localAlbumQuery.execute().then(function(query) {
+ this._queryPromise = null;
+ if (query.result && query.result.items)
+ query.result.items.toArray(0, 8).then(function processResults(albums) {
+ this._setAlbumCellsOrDefault(albums)
+ }.bind(this));
+ else
+ this._setAlbumCellsOrDefault(null)
+ }.bind(this))
+ }
+ else if (!this.largeArtUrls || this.largeArtUrls.length === 0)
+ this._addLargeArtUrl(MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album)
+ }.bind(this), function failedToLoadAlbums(){})
+ }, _addLargeArtUrl: function _addLargeArtUrl(url) {
+ var artUrls = [];
+ artUrls.push(url);
+ this.largeArtUrls = artUrls
+ }, _setAlbumCellsOrDefault: function _setAlbumCellsOrDefault(albums) {
+ if (albums && albums.length > 3) {
+ if (this._unloaded || !MS.Entertainment.Utilities.checkIfInDom(this.domElement))
+ return;
+ this._setCellDefinitions(albums.length);
+ this.cellIdList = albums
+ }
+ else if (!this.largeArtUrls || this.largeArtUrls.length === 0) {
+ var modifiedAlbums = [];
+ var albumsLength = albums ? albums.length : 0;
+ switch (albumsLength) {
+ case 1:
+ modifiedAlbums.push(albums[0]);
+ modifiedAlbums.push(MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album);
+ modifiedAlbums.push(albums[0]);
+ modifiedAlbums.push(MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album);
+ break;
+ case 2:
+ modifiedAlbums.push(albums[0]);
+ modifiedAlbums.push(albums[0]);
+ modifiedAlbums.push(albums[1]);
+ modifiedAlbums.push(albums[1]);
+ break;
+ case 3:
+ modifiedAlbums.push(albums[0]);
+ modifiedAlbums.push(albums[1]);
+ modifiedAlbums.push(albums[2]);
+ modifiedAlbums.push(albums[0]);
+ break
+ }
+ this._setCellDefinitions(modifiedAlbums.length);
+ this.cellIdList = modifiedAlbums
+ }
+ }
+ }, {
+ size: {
+ width: 135, height: 135
+ }, columns: 2, rows: 2, cellOffset: 0
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Music/PlaylistImageCollage.js b/packages/microsoft.zunevideo/controls/Music/PlaylistImageCollage.js
new file mode 100644
index 00000000..63e90ef5
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Music/PlaylistImageCollage.js
@@ -0,0 +1,218 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {PlaylistImageCollage: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.MediaImageCollage", null, null, {
+ _albumResultsLength: -1, _frozen: false, _mediaItemBinding: null, _focused: false, _unfocusedArt: null, _savedAlbums: null, _focusBindings: null, _focusInPromise: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.initialize.apply(this, arguments);
+ if (this.changeOnFocus) {
+ var focusedItem = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "win-focusable");
+ if (document.activeElement === focusedItem)
+ this._onFocusIn();
+ else
+ this._onFocusOut();
+ this._focusBindings = MS.Entertainment.Utilities.addEventHandlers(focusedItem, {
+ focusin: this._onFocusIn.bind(this), focusout: this._onFocusOut.bind(this)
+ })
+ }
+ this.timerTickInterval = 30000;
+ this.timerDelayPeriod = Math.floor(Math.random() * this.timerTickInterval);
+ this.cellAddPeriod = 0;
+ this.cellSwapPeriod = 20 + Math.floor(Math.random() * this.timerTickInterval - 20);
+ this.artShowPeriod = 30000;
+ this.artSwapPeriod = 11000;
+ this.artVisiblePeriod = 30000;
+ this.colorChangePeriod = 0;
+ this.cellRepeatBuffer = 0;
+ this.minimumSize = {
+ width: 60, height: 60
+ };
+ if (this.media && this.media.libraryId === -1)
+ this._mediaItemBinding = WinJS.Binding.bind(this.media, {libraryId: function libraryIdChanged() {
+ if (this.media.libraryId !== -1) {
+ this._mediaItemBinding.cancel();
+ this._mediaItemBinding = null;
+ if (!this._frozen)
+ this._loadImages()
+ }
+ }.bind(this)})
+ }, unload: function unload() {
+ if (this._focusBindings) {
+ this._focusBindings.cancel();
+ this._focusBindings = null
+ }
+ if (this._mediaItemBinding) {
+ this._mediaItemBinding.cancel();
+ this._mediaItemBinding = null
+ }
+ if (this._focusInPromise) {
+ this._focusInPromise.cancel();
+ this._focusInPromise = null
+ }
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._frozen = true;
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ this._frozen = false;
+ if (this.media && MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId) && (this._albumResultsLength <= 0 || this.refreshOnThaw))
+ this._loadImages();
+ MS.Entertainment.UI.Controls.MediaImageCollage.prototype.thaw.call(this)
+ }, _loadImages: function _loadImages() {
+ if (!this.media)
+ return;
+ var hydratePromise = WinJS.Promise.as();
+ if (!MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId) && this.media.hydrate)
+ hydratePromise = this.media.hydrate();
+ hydratePromise.then(function renderAlbums() {
+ return WinJS.Promise.timeout(this.loadDelay)
+ }.bind(this)).done(function getAlbums() {
+ if (this._unloaded || (!MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId) && !this.media.hasServiceId))
+ return;
+ if (this._queryPromise) {
+ this._queryPromise.cancel();
+ this._queryPromise = null
+ }
+ if (MS.Entertainment.Utilities.isValidLibraryId(this.media.libraryId)) {
+ var localAlbumQuery;
+ localAlbumQuery = new MS.Entertainment.Data.Query.libraryAlbums;
+ localAlbumQuery.aggregateChunks = false;
+ localAlbumQuery.chunkSize = 8;
+ localAlbumQuery.playlistId = this.media.libraryId;
+ this._queryPromise = localAlbumQuery.execute().then(function returnItems(q) {
+ if (q.result && q.result.items)
+ return q.result.items.toArray(0, 8);
+ return null
+ })
+ }
+ else if (this.media.albumImages)
+ this._queryPromise = WinJS.Promise.as(this.media.albumImages);
+ if (this._queryPromise)
+ this._queryPromise.done(function(itemArray) {
+ if (itemArray) {
+ if (this._unloaded)
+ return;
+ if (this._savedAlbums) {
+ if (this._savedAlbums.length === itemArray.length) {
+ var sameAlbums = true;
+ for (var j = 0; j < itemArray.length; j++)
+ if (!itemArray[j].isEqual || !itemArray[j].isEqual(this._savedAlbums[j])) {
+ sameAlbums = false;
+ break
+ }
+ if (sameAlbums)
+ return
+ }
+ this._clearCells();
+ this._cellUsedCount = 0;
+ this._unfocusedArt = null
+ }
+ if (this.refreshOnThaw)
+ this._savedAlbums = itemArray;
+ this._albumResultsLength = itemArray.length;
+ this._setCellDefinitions(itemArray.length);
+ if (itemArray.length === 0 && this.useDefaultImages)
+ if (this.size.width > 316 && this.size.height > 316 || this.changeOnFocus)
+ itemArray.push(MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.playlistLarge);
+ else
+ itemArray.push(MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.playlist);
+ if (itemArray.length < 4) {
+ var modifiedAlbums = [];
+ switch (itemArray.length) {
+ case 1:
+ modifiedAlbums.push(itemArray[0]);
+ break;
+ case 2:
+ modifiedAlbums.push(itemArray[0]);
+ modifiedAlbums.push(itemArray[0]);
+ modifiedAlbums.push(itemArray[1]);
+ modifiedAlbums.push(itemArray[1]);
+ break;
+ case 3:
+ modifiedAlbums.push(itemArray[0]);
+ modifiedAlbums.push(itemArray[1]);
+ modifiedAlbums.push(itemArray[2]);
+ modifiedAlbums.push(itemArray[0]);
+ break
+ }
+ this.cellIdList = modifiedAlbums
+ }
+ else
+ this.cellIdList = itemArray
+ }
+ else
+ this.cellIdList = [MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.playlist];
+ this._queryPromise = null
+ }.bind(this))
+ }.bind(this))
+ }, _setCellImages: function _setCellImages() {
+ var getUnfocusedImageUrl = WinJS.Promise.as();
+ if (this._albumResultsLength >= 0) {
+ if (this.domElement && this.domElement.clientWidth && this.domElement.clientHeight)
+ this.size = {
+ width: this.domElement.clientWidth, height: this.domElement.clientHeight
+ };
+ if (this.changeOnFocus && !this._unfocusedArt) {
+ this._maxCellWidth = this.size.width;
+ this._maxCellHeight = this.size.height;
+ if (this.cellIdList && this.cellIdList.length)
+ getUnfocusedImageUrl = WinJS.Promise.as(this._setUrlFromCellId(this.cellIdList[0]))
+ }
+ this._setCellDefinitions(this._albumResultsLength)
+ }
+ var originalArguments = arguments;
+ getUnfocusedImageUrl.done(function setUnfocusedImage(imageUrl) {
+ if (imageUrl)
+ this._unfocusedArt = imageUrl;
+ else if (imageUrl === null && !this._unfocusedArt)
+ this._unfocusedArt = MS.Entertainment.UI.Shell.ImageLoader.MediaDefaultUrls.album;
+ if (!this._focused && this._unfocusedArt) {
+ if (!this.largeArtUrls || this.largeArtUrls[0] !== this._unfocusedArt)
+ this.largeArtUrls = [this._unfocusedArt]
+ }
+ else
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._setCellImages.apply(this, originalArguments)
+ }.bind(this), function error() {
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._setCellImages.apply(this, originalArguments)
+ }.bind(this))
+ }, _onFocusIn: function _onFocusIn() {
+ if (this._focusInPromise || this._albumResultsLength === 0)
+ return;
+ this._focusInPromise = WinJS.Promise.timeout(250).then(function updateFocus() {
+ this._focused = true;
+ WinJS.Utilities.removeClass(this.wallContainer, "hideFromDisplay");
+ this._setArtVisible(false);
+ this._timerEnabled = false;
+ if (!this._cells || this._cells.length === 0)
+ this._setCellImages();
+ this._focusInPromise = null
+ }.bind(this))
+ }, _onFocusOut: function _onFocusOut() {
+ if (this._focusInPromise) {
+ this._focusInPromise.cancel();
+ this._focusInPromise = null
+ }
+ this._focused = false;
+ if (this._unfocusedArt) {
+ if (!this.largeArtUrls)
+ this.largeArtUrls = [this._unfocusedArt];
+ WinJS.Utilities.addClass(this.wallContainer, "hideFromDisplay")
+ }
+ this._setArtVisible(true)
+ }, _toggleCells: function _toggleCells(show) {
+ if (this.changeOnFocus) {
+ if (show === MS.Entertainment.UI.Controls.ImageCollageCell.toggleCellState.show)
+ this._cells.forEach(function(cell) {
+ var sleep = (cell.width + cell.height) / 4;
+ cell.toggleCell(show, sleep)
+ }.bind(this))
+ }
+ else
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._toggleCells.apply(this, arguments)
+ }
+ }, {
+ size: {
+ width: 135, height: 135
+ }, columns: 2, rows: 2, changeOnFocus: false, refreshOnThaw: false, cellOffset: 0, useDefaultImages: true, loadDelay: 500
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Music8Dashboard.html b/packages/microsoft.zunevideo/controls/Music8Dashboard.html
new file mode 100644
index 00000000..9f75df67
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Music8Dashboard.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/HomeNowPlayingTile.html b/packages/microsoft.zunevideo/controls/NowPlaying/HomeNowPlayingTile.html
new file mode 100644
index 00000000..b1d5f013
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/HomeNowPlayingTile.html
@@ -0,0 +1,227 @@
+
+
+
+
+ HomeNowPlayingTile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/HomeNowPlayingTile.js b/packages/microsoft.zunevideo/controls/NowPlaying/HomeNowPlayingTile.js
new file mode 100644
index 00000000..f22f359b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/HomeNowPlayingTile.js
@@ -0,0 +1,317 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/playbackcontrol.js", "/Components/Playback/playbackhelpers.js", "/Framework/corefx.js", "/Framework/imageloader.js", "/Framework/servicelocator.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HomeNowPlayingTile: MS.Entertainment.UI.Framework.defineUserControl("/Controls/NowPlaying/HomeNowPlayingTile.html#template", function(element, options){}, {
+ _initialized: false, _playbackSessionBinding: null, _bindings: null, _musicVisualizationControl: null, _frozen: false, _uiStateService: null, _deferredUpdateTimer: null, _musicVisualizationDelay: 0, _musicVisualizationCellSize: {
+ width: 75, height: 75
+ }, _minArtistImageWidth: 500, initialize: function initialize() {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._playbackSessionBinding = WinJS.Binding.bind(this, {playbackSession: this._playbackSessionChanged.bind(this)});
+ this.playbackSession = sessionMgr.primarySession;
+ this._initialized = true;
+ this._updateStates()
+ }, freeze: function freeze() {
+ this._frozen = true;
+ this._detachBindings();
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._frozen = false;
+ this._playbackSessionChanged();
+ if (this.playbackSession) {
+ this._updateMetadata();
+ this._mediaPositionChanged(true)
+ }
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }, unload: function unload() {
+ if (this._playbackSessionBinding) {
+ this._playbackSessionBinding.cancel();
+ this._playbackSessionBinding = null
+ }
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ this._detachBindings();
+ this._frozen = true;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _createNowPlayingVisualization: function _createNowPlayingVisualization() {
+ var container = document.createElement("div");
+ container.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.MusicVisualization");
+ WinJS.Utilities.addClass(container, "nowPlayingTileBackground");
+ this._clearNowPlayingVisualization();
+ this._musicVisualizationControl = new MS.Entertainment.UI.Controls.MusicVisualization(this._musicVisualizationContainer.domElement.appendChild(container), {});
+ this._musicVisualizationControl.minArtistImageWidth = this._minArtistImageWidth
+ }, _clearNowPlayingVisualization: function _clearNowPlayingVisualization() {
+ if (this._musicVisualizationControl) {
+ this._musicVisualizationControl.unload();
+ MS.Entertainment.Utilities.empty(this._musicVisualizationContainer.domElement);
+ this._musicVisualizationControl = null
+ }
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ if (this._frozen)
+ return;
+ this._detachBindings();
+ if (this.playbackSession)
+ this._bindings = WinJS.Binding.bind(this, {
+ playbackSession: {
+ currentTitleId: this._updateMetadata.bind(this), sessionState: this._updateStates.bind(this), playerState: this._updateStates.bind(this), currentMedia: this._updateMetadata.bind(this), currentTransportState: this._updateStates.bind(this), currentPosition: this._mediaPositionChanged.bind(this), duration: this._mediaPositionChanged.bind(this), lastPlayedMedia: this._updateMetadata.bind(this)
+ }, _uiStateService: {
+ isSnapped: this._updateMetadata.bind(this), isFullScreenVideo: this._updateStatesDeferred.bind(this), primarySessionId: this._updateStates.bind(this)
+ }
+ });
+ this._updateStates()
+ }, _updateMetadata: function _updateMetadata() {
+ var nowPlayingImageMediaItem = null;
+ if (this._frozen)
+ return;
+ var spotlightMedia = this.playbackSession.currentMedia;
+ if (MS.Entertainment.Utilities.useModalNowPlaying)
+ spotlightMedia = this.playbackSession.lastPlayedMedia;
+ if (spotlightMedia) {
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(spotlightMedia)) {
+ if (!this._musicVisualizationControl)
+ if (this._musicVisualizationDelay)
+ WinJS.Promise.timeout(this._musicVisualizationDelay).then(function createDelayedNowPlayingVisualization() {
+ this._createNowPlayingVisualization();
+ this._updateMusicVisualization()
+ }.bind(this));
+ else
+ this._createNowPlayingVisualization();
+ this._updateMusicVisualization()
+ }
+ else {
+ this.musicVisualizationVisible = false;
+ this._clearNowPlayingVisualization()
+ }
+ if (spotlightMedia.serviceId && MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(spotlightMedia) && spotlightMedia.artistServiceId !== MS.Entertainment.Utilities.EMPTY_GUID)
+ if ((!this.nowPlayingImageMediaItem) || (this.nowPlayingImageMediaItem.serviceId !== spotlightMedia.artistServiceId)) {
+ var artistMediaItem = MS.Entertainment.Data.augment({id: spotlightMedia.artistServiceId}, MS.Entertainment.Data.Augmenter.Marketplace.Music.Artist);
+ nowPlayingImageMediaItem = artistMediaItem
+ }
+ else
+ nowPlayingImageMediaItem = this.nowPlayingImageMediaItem;
+ else
+ nowPlayingImageMediaItem = spotlightMedia;
+ this.companionTileContentVisible = false;
+ this.fullBleedArtUrl = "";
+ this.fullBleedTileVisible = false;
+ if (!MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(spotlightMedia) && spotlightMedia.backgroundImageUri && !(!spotlightMedia.isGame && spotlightMedia.edsMediaItemTypeString === "XboxApp")) {
+ var pendingBackgroundImage = new Image;
+ pendingBackgroundImage.addEventListener("load", function imageLoaded(event) {
+ if (pendingBackgroundImage.naturalWidth > pendingBackgroundImage.naturalHeight) {
+ this.fullBleedArtUrl = pendingBackgroundImage.src;
+ this.fullBleedTileVisible = true
+ }
+ this.companionTileContentVisible = true
+ }.bind(this), false);
+ pendingBackgroundImage.addEventListener("error", function imageError(event) {
+ this.companionTileContentVisible = true
+ }.bind(this), false);
+ pendingBackgroundImage.setAttribute("src", spotlightMedia.backgroundImageUri)
+ }
+ else
+ this.companionTileContentVisible = true;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isGame(spotlightMedia))
+ this.gameThumbnailVisible = true;
+ else
+ this.gameThumbnailVisible = false;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMovie(spotlightMedia))
+ this.movieThumbnailVisible = true;
+ else
+ this.movieThumbnailVisible = false;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(spotlightMedia)) {
+ this.tvThumbnailVisible = true;
+ if (spotlightMedia.seriesTitle)
+ this.metadataTitle = spotlightMedia.seriesTitle;
+ else if (spotlightMedia.ParentSeries)
+ this.metadataTitle = spotlightMedia.ParentSeries.Name;
+ else
+ this.metadataTitle = String.load(String.id.IDS_UNKNOWN_VALUE);
+ if (spotlightMedia.seasonNumber > -1 && spotlightMedia.episodeNumber && spotlightMedia.name)
+ this.metadataGenre = String.load(String.id.IDS_TV_NUMBERED_EPISODE_SEASON_TITLE).format(spotlightMedia.seasonNumber, spotlightMedia.episodeNumber, spotlightMedia.name);
+ else if (spotlightMedia.name)
+ this.metadataGenre = spotlightMedia.name;
+ else
+ this.metadataGenre = MS.Entertainment.Formatters.formatGenre(spotlightMedia)
+ }
+ else {
+ this.tvThumbnailVisible = false;
+ this.metadataTitle = spotlightMedia.name;
+ this.metadataGenre = MS.Entertainment.Formatters.formatGenre(spotlightMedia)
+ }
+ this.nowPlayingImageMediaItem = nowPlayingImageMediaItem;
+ this.metadataDuration = MS.Entertainment.Utilities.millisecondsToTimeCode(this.playbackSession.duration);
+ this.artVisible = spotlightMedia.primaryImageUri;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(spotlightMedia)) {
+ this.metadataArtist = MS.Entertainment.Formatters.formatAlbumAndArtistHelper(spotlightMedia);
+ if (spotlightMedia.AlbumName)
+ this.metadataSource = spotlightMedia.AlbumName
+ }
+ }
+ if (this.playbackSession._sessionState === "disconnected" && spotlightMedia && spotlightMedia.titleId === 0) {
+ this.metadataTitle = String.load(String.id.IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE);
+ this.metadataGenre = String.load(String.id.IDS_COMPANION_HOME_NOW_PLAYING_EMPTY);
+ this.xboxXenonBackgroundVisible = true
+ }
+ else
+ this.xboxXenonBackgroundVisible = false;
+ if (!this.metadataTitle)
+ this.metadataTitle = String.load(String.id.IDS_UNKNOWN_VALUE);
+ if (!this.metadataGenre)
+ this.metadataGenre = String.empty;
+ this._updateStates()
+ }, _updateMusicVisualization: function _updateMusicVisualization() {
+ if (this._musicVisualizationControl) {
+ this._musicVisualizationControl.mediaItem = this.playbackSession.currentMedia;
+ this._musicVisualizationControl.cellSize = this._musicVisualizationCellSize;
+ this.metadataSubTitle = this.playbackSession.currentMedia.artistName;
+ this.musicVisualizationVisible = true
+ }
+ }, _mediaPositionChanged: function _mediaPositionChanged(forceUpdate) {
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFullScreenVideo || this.playbackSession.currentPosition === undefined)
+ return;
+ var durationMs = MS.Entertainment.Utilities.useModalNowPlaying ? this.playbackSession.lastPlayedDuration : this.playbackSession.duration;
+ var positionMs = MS.Entertainment.Utilities.useModalNowPlaying ? this.playbackSession.lastPlayedPosition : this.playbackSession.currentPosition;
+ this.progressMax = durationMs;
+ this.progressValue = Math.min(durationMs, positionMs);
+ if (forceUpdate || (this.playbackSession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.paused && this.playbackSession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.stopped))
+ this.metadataClock = this.seekBarPositionText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.progressValue);
+ var duration = MS.Entertainment.Utilities.formatTimeString(this.progressMax);
+ var progress = MS.Entertainment.Utilities.formatTimeString(this.progressValue);
+ var progressText = String.load(String.id.IDS_PROGRESS_NAR).format(progress, duration);
+ this._progressBar.setAttribute("aria-valuetext", progressText);
+ this._progressBar.setAttribute("aria-label", progressText);
+ if (this._companionFullBleedProgressBar) {
+ this._companionFullBleedProgressBar.setAttribute("aria-valuetext", progressText);
+ this._companionFullBleedProgressBar.setAttribute("aria-label", progressText)
+ }
+ this.metadataDuration = MS.Entertainment.Utilities.millisecondsToTimeCode(durationMs);
+ this.metadataClockAndDuration = this.metadataClock + "/" + this.metadataDuration
+ }, _canJoinRemote: function _canJoinRemote() {
+ return this.playbackSession.currentMedia && this.playbackSession.currentMedia.mediaType !== Microsoft.Entertainment.Queries.ObjectType.game
+ }, _updateStates: function _updateStates() {
+ if (this._deferredUpdateTimer)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(250).then(this._updateStatesDeferred.bind(this))
+ }, _updateStatesDeferred: function _updateStatesDeferred() {
+ this._deferredUpdateTimer = null;
+ if (!this.playbackSession || MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFullScreenVideo)
+ return;
+ if (this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.paused || this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped) {
+ this.playVisible = true;
+ this.errorVisible = false;
+ this.progressBarVisible = false
+ }
+ else if (this.playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.error) {
+ this.errorVisible = true;
+ this.playVisible = false;
+ this.progressBarVisible = false
+ }
+ else {
+ this.playVisible = false;
+ this.errorVisible = false;
+ this.progressBarVisible = true
+ }
+ var spotlightMedia = this.playbackSession.currentMedia;
+ var shouldBeHidden = this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped;
+ if (MS.Entertainment.Utilities.useModalNowPlaying) {
+ spotlightMedia = this.playbackSession.lastPlayedMedia;
+ shouldBeHidden = this.playbackSession.lastPlayedMedia === null
+ }
+ if (!MS.Entertainment.Utilities.isMusicApp && shouldBeHidden)
+ this.visible = false;
+ else if (!this.visible && spotlightMedia)
+ this.visible = true;
+ else if (!MS.Entertainment.Utilities.isMusicApp && this.visible && !spotlightMedia)
+ this.visible = false;
+ if (!MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(spotlightMedia))
+ if (MS.Entertainment.Utilities.useModalNowPlaying) {
+ this.metadataSubTitle = String.load(String.id.IDS_HOME_NOW_PLAYING_RESUME);
+ if (spotlightMedia)
+ this._homeNowPlayingTile.setAttribute("aria-label", String.load(String.id.IDS_HOME_NOW_PLAYING_RESUME_ARIA).format(this.metadataTitle));
+ else
+ this._homeNowPlayingTile.setAttribute("aria-label", String.load(String.id.IDS_HOME_NOW_PLAYING_RESUME))
+ }
+ else
+ this.metadataSubTitle = String.load(String.id.IDS_HOME_NOW_PLAYING);
+ this.clockVisible = true
+ }
+ }, {
+ visible: false, isRemoteSession: false, clockVisible: false, companionTileContentVisible: false, fullBleedArtUrl: "", fullBleedTileVisible: false, xboxXenonBackgroundVisible: false, playVisible: false, errorVisible: false, progressBarVisible: false, artVisible: true, movieThumbnailVisible: false, tvThumbnailVisible: false, gameThumbnailVisible: false, playbackSession: null, nowPlayingImageMediaItem: null, metadataTitle: "", metadataSource: "", metadataSubTitle: "", metadataClock: "", metadataDuration: "", metadataClockAndDuration: "", metadataArtist: "", metadataGenre: "", musicVisualizationVisible: false, progressMax: 100, progressValue: 0, thumbnailClick: function thumbnailClick() {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (this.isRemoteSession) {
+ sessionMgr.setPrimarySession(this.playbackSession.sessionId);
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {sessionId: this.playbackSession.sessionId})
+ }
+ else {
+ if (!this.playbackSession.currentMedia && this.playbackSession.lastPlayedMedia)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersiveDetails(this.playbackSession.lastPlayedMedia, false, true, undefined, undefined, undefined, undefined, undefined, undefined, this.playbackSession.lastPlayedMedia.libraryId === -1 ? this.playbackSession.lastPlayedPosition : undefined);
+ else {
+ sessionMgr.setPrimarySession(this.playbackSession.sessionId);
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: this.playbackSession.sessionId, startFullScreen: true
+ })
+ }
+ MS.Entertainment.Utilities.Telemetry.logPlayClicked(this.domElement.className)
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HomeNowPlayingTileLarge: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.HomeNowPlayingTile", "/Controls/NowPlaying/HomeNowPlayingTile.html#templateLarge")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HomeNowPlayingTilePoster: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.HomeNowPlayingTile", "/Controls/NowPlaying/HomeNowPlayingTile.html#templatePoster")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HomeNowPlayingTileCompanion: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.HomeNowPlayingTile", "/Controls/NowPlaying/HomeNowPlayingTile.html#templatePosterCompanion")});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HomeNowPlayingTileMusic: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.HomeNowPlayingTile", null, function homeNowPlayingTileMusicConstructor() {
+ this.thumbnailClick = MS.Entertainment.Utilities.bindAndMarkSupportedForProcessing(this._thumbnailClick, this)
+ }, {_thumbnailClick: function _thumbnailClick() {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ switch (this.playbackSession.currentTransportState) {
+ case MS.Entertainment.Platform.Playback.TransportState.playing:
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ sessionMgr.setPrimarySession(this.playbackSession.sessionId);
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: this.playbackSession.sessionId, startFullScreen: false
+ })
+ }
+ break;
+ case MS.Entertainment.Platform.Playback.TransportState.stopped:
+ if (this.playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.error)
+ MS.Entertainment.Platform.PlaybackHelpers.showPlaybackError(this.playbackSession.errorDescriptor);
+ else
+ this.playbackSession.playAt(0);
+ break;
+ default:
+ this.playbackSession.targetTransportState = MS.Entertainment.Platform.Playback.TransportState.playing;
+ break
+ }
+ }})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HomeNowPlayingTileMusicSnapped: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.HomeNowPlayingTileMusic", "/Controls/NowPlaying/HomeNowPlayingTile.html#templateMusicSnapped", function homeNowPlayingTileMusicSnapped() {
+ this._musicVisualizationDelay = 1000
+ }, {
+ _musicVisualizationCellSize: {
+ width: 50, height: 50
+ }, _mediaPositionChanged: function _mediaPositionChanged(forceUpdate) {
+ var durationMs = this.playbackSession.duration;
+ var positionMs = this.playbackSession.currentPosition;
+ this.progressMax = durationMs;
+ this.progressValue = Math.min(durationMs, positionMs);
+ if (forceUpdate || (this.playbackSession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.paused && this.playbackSession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.stopped))
+ this.metadataClock = this.seekBarPositionText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.progressValue) + "/" + MS.Entertainment.Utilities.millisecondsToTimeCode(durationMs);
+ var duration = MS.Entertainment.Utilities.formatTimeString(this.progressMax);
+ var progress = MS.Entertainment.Utilities.formatTimeString(this.progressValue);
+ var progressText = String.load(String.id.IDS_PROGRESS_NAR).format(progress, duration);
+ this._progressBar.setAttribute("aria-valuetext", progressText);
+ this._progressBar.setAttribute("aria-label", progressText);
+ if (this._companionFullBleedProgressBar) {
+ this._companionFullBleedProgressBar.setAttribute("aria-valuetext", progressText);
+ this._companionFullBleedProgressBar.setAttribute("aria-label", progressText)
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/MusicVisualization.html b/packages/microsoft.zunevideo/controls/NowPlaying/MusicVisualization.html
new file mode 100644
index 00000000..7931e349
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/MusicVisualization.html
@@ -0,0 +1,45 @@
+
+
+
+
+ Music Visualization
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/MusicVisualization.js b/packages/microsoft.zunevideo/controls/NowPlaying/MusicVisualization.js
new file mode 100644
index 00000000..1bc48372
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/MusicVisualization.js
@@ -0,0 +1,565 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {MusicVisualization: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ImageCollage", "Controls/NowPlaying/MusicVisualization.html", function(element, options) {
+ this._colorPalettes = MS.Entertainment.Utilities.isMusicApp1 ? MS.Entertainment.UI.Controls.MusicVisualization.colorPalettes1 : MS.Entertainment.UI.Controls.MusicVisualization.colorPalettes2;
+ this.timerTickInterval = 1000;
+ this.timerDelayPeriod = 3000;
+ this.artShowPeriod = 20000;
+ this.artSwapPeriod = 20000;
+ this.artVisiblePeriod = 40000;
+ this.artVisible = true;
+ this.colorChangePeriod = 0;
+ this.largeArtFilter = "url(\#ColorFilter)";
+ this.largeArtDelay = 2000;
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._mediaItem = {isEmpty: true};
+ var hideAppbar = function hideAppbar() {
+ var appbar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appbar)
+ appbar.hide()
+ };
+ this._appbarOpportunityEventHandlers = {};
+ this._appbarOpportunityEventHandlers[MS.Entertainment.UI.AppBarActions.addToMyMusic] = hideAppbar;
+ this._appbarOpportunityEventHandlers[MS.Entertainment.UI.AppBarActions.addToPlaylist] = hideAppbar;
+ this._appbarOpportunityEventHandlers[MS.Entertainment.UI.AppBarActions.addToActivePlaylist] = hideAppbar;
+ this._appbarOpportunityEventHandlers[MS.Entertainment.UI.AppBarActions.playOnXbox360] = hideAppbar;
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this.backdropColor = "rgba(34,34,34,1)"
+ }, {
+ _mediaItem: null, _playbackSession: null, _sessionMgr: null, _sessionBindings: null, _eventHandlers: null, _appbarOpportunityEventHandlers: null, _artistQueryPromise: null, _disableShapesAndColors: false, _lastArtistId: -1, _lastAlbumId: -1, _lastColorIndex: -1, _isMarketplaceEnabled: false, _shapeVisualizationEngine: null, _pendingColorChange: false, _uiStateService: null, _smartBuyStateEngine: null, _mediaContext: null, _opportunities: null, _currentOpportunityAction: null, _lastOpportunity: null, _lastOpportunityIndex: -1, _lastOpportunityShow: 0, _lastOpportunitySwap: 0, _lastMediaItem: null, _opportunityUpdatePromise: null, _firstColor: true, _transitionTimeoutMS: 2200, _transitionPromise: null, _transitionTimeoutPromise: null, _defaultOpportunityOffset: 20000, _defaultOpportunitySwapPeriod: 40000, _defaultOpportunityShowPeriod: 20000, _defaultOpportunityClickReset: 5000, _pickNewOpportunityAttempts: 10, _bindings: null, opportunityOffset: 20000, opportunityShowPeriod: 20000, opportunitySwapPeriod: 40000, opportunityClickReset: 5000, engageOpportunityOffset: 0, engageOpportunityShowPeriod: 5000, engageOpportunitySwapPeriod: 6000, engageOpportunityClickReset: 0, minArtistImageWidth: 500, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.initialize.apply(this, arguments);
+ this._initialized = true;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this._disableShapesAndColors = true;
+ this.backgroundColor = null;
+ this.engageOpportunitySwapPeriod = -1
+ }
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ this._isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ this._bindings = WinJS.Binding.bind(this, {_uiStateService: {
+ nowPlayingTileVisible: this._updateOpportunities.bind(this), engageVisible: this._updateEngageOpportunities.bind(this), primarySessionId: this._playbackSessionChanged.bind(this)
+ }});
+ MS.Entertainment.UI.Controls.MusicVisualization.instance = this;
+ if (this.mediaItem)
+ this._mediaChanged(this.mediaItem)
+ }, mediaItem: {
+ get: function() {
+ return this._mediaItem
+ }, set: function(value) {
+ if (value !== this._mediaItem) {
+ var oldValue = this._mediaItem;
+ this._mediaItem = value;
+ this.notify("mediaItem", value, oldValue);
+ this._mediaChanged(value, oldValue)
+ }
+ }
+ }, unload: function unload() {
+ if (this._artistQueryPromise) {
+ this._artistQueryPromise.cancel();
+ this._artistQueryPromise = null
+ }
+ this._releaseSmartBuyEngine();
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._sessionBindings) {
+ this._sessionBindings.cancel();
+ this._sessionBindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.unload.call(this)
+ }, thaw: function thaw() {
+ if (!this._frozen) {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ return
+ }
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.thaw.call(this);
+ if (!this.mediaItem)
+ this.mediaItem = this._playbackSession.currentMedia;
+ else {
+ this._mediaChanged(this.mediaItem);
+ this._updateOpportunities()
+ }
+ if (!this._uiStateService.nowPlayingTileVisible && !this._mediaContext && this._smartBuyStateEngine) {
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._mediaContext = appBarService.pushMediaContext(this.mediaItem, this._appbarOpportunityEventHandlers, this._smartBuyStateEngine.currentAppbarActions, {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.opportunity})
+ }
+ }, freeze: function freeze() {
+ if (this._frozen) {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ return
+ }
+ if (this._artistQueryPromise) {
+ this._artistQueryPromise.cancel();
+ this._artistQueryPromise = null
+ }
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ this._artIndex = -1;
+ MS.Entertainment.UI.Controls.ImageCollage.prototype.freeze.call(this)
+ }, nowPlayingMouseDown: function nowPlayingMouseDown(event) {
+ if (!this._uiStateService.nowPlayingTileVisible)
+ this._reShowOpportunity()
+ }, nowPlayingMouseMove: function nowPlayingMouseMove(event) {
+ if (!this._uiStateService.nowPlayingTileVisible)
+ this._reShowOpportunity()
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ if (this._sessionBindings) {
+ this._sessionBindings.cancel();
+ this._sessionBindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ if (!this._sessionMgr)
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._playbackSession = this._sessionMgr.primarySession;
+ if (this._playbackSession) {
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this._playbackSession, {currentMediaChanged: function updateMediaItem(e) {
+ this.mediaItem = this._playbackSession.currentMedia
+ }.bind(this)});
+ this.mediaItem = this._playbackSession.currentMedia
+ }
+ }, _reShowOpportunity: function _reShowOpportunity() {
+ if (this._lastOpportunity) {
+ if (this._opportunityUpdatePromise) {
+ this._opportunityUpdatePromise.cancel();
+ this._opportunityUpdatePromise = null
+ }
+ this.currentOpportunity = this._lastOpportunity;
+ this._lastOpportunity = null;
+ this._lastOpportunityShow = this.opportunityShowPeriod - this.opportunityClickReset;
+ this._lastOpportunitySwap = this._lastOpportunityShow
+ }
+ }, _mediaChanged: function _mediaChanged(newValue, oldValue) {
+ if (!this._initialized || this._unloaded)
+ return;
+ if (!this._uiStateService.isAppVisible || this._frozen) {
+ this._clearCurrentLargeArt();
+ this._mediaItem = null;
+ return
+ }
+ if (this._opportunityUpdatePromise) {
+ this._opportunityUpdatePromise.cancel();
+ this._opportunityUpdatePromise = null
+ }
+ this._opportunities = null;
+ this._lastOpportunity = null;
+ this.currentOpportunity = null;
+ if (!this._shapeVisualizationEngine)
+ this._createVisualizationEngine();
+ this._lastMediaItem = this.mediaItem;
+ this._pendingColorChange = true;
+ if (!this.mediaItem) {
+ if (this._largeArt)
+ this._largeArt.clearArt();
+ this.largeArtUrls = null;
+ if (!this._timerEnabled) {
+ this._timerEnabled = true;
+ this._startRenderLoop()
+ }
+ this.transitionOverlay.style.opacity = 0
+ }
+ else {
+ this._hideShapeLayer();
+ if (this._largeArt)
+ this._largeArt.clearArt();
+ this._transitionVisualization(function _delay() {
+ this._notifyMediaChanged(this.mediaItem, oldValue);
+ if (!this._updateMediaItemArt()) {
+ var artChanged = this._randomizeArt();
+ this._randomizeLayerColors(artChanged)
+ }
+ else
+ this._notifyColorChanged(MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette);
+ this._lastArtSwap = 0;
+ this._showShapeLayer()
+ }.bind(this))
+ }
+ this._updateOpportunities()
+ }, _hideShapeLayer: function _hideShapeLayer() {
+ if (this._initialized && !this._frozen && this._shapeVisualizationEngine && this.shapeVisualizationContainer) {
+ var completePromise = MS.Entertainment.Utilities.waitForStartedTransitionsToComplete(this.shapeVisualizationContainer, true);
+ this.shapeVisualizationContainer.style.opacity = 0;
+ return completePromise
+ }
+ }, _showShapeLayer: function _showShapeLayer() {
+ if (this._initialized && !this._frozen && this._shapeVisualizationEngine && this.shapeVisualizationContainer && !MS.Entertainment.UI.Controls.MusicVisualization.disableShapeEngine)
+ this.shapeVisualizationContainer.style.opacity = 1
+ }, _notifyMediaChanged: function _notifyMediaChanged(newValue, oldValue) {
+ if (this._shapeVisualizationEngine && !MS.Entertainment.UI.Controls.MusicVisualization.disableShapeEngine)
+ this._shapeVisualizationEngine.notifyMediaChanged(newValue, oldValue)
+ }, _notifyColorChanged: function _notifyColorChanged(newValue) {
+ if (this._shapeVisualizationEngine)
+ this._shapeVisualizationEngine.notifyColorChanged(newValue)
+ }, _transitionVisualization: function _transitionVisualization(callback) {
+ if (this._disableShapesAndColors) {
+ if (callback)
+ callback();
+ return
+ }
+ if (this._transitionTimeoutPromise) {
+ this._transitionTimeoutPromise.cancel();
+ this._transitionTimeoutPromise = null
+ }
+ if (this._transitionPromise) {
+ this._transitionPromise.cancel();
+ this._transitionPromise = null
+ }
+ var completeCallback = function completeTransition() {
+ if (this._transitionPromise) {
+ this._transitionPromise.cancel();
+ this._transitionPromise = null
+ }
+ if (this._transitionTimeoutPromise) {
+ this._transitionTimeoutPromise.cancel();
+ this._transitionTimeoutPromise = null
+ }
+ if (callback)
+ callback();
+ WinJS.Promise.timeout(this.largeArtDelay).done(function transitionBack() {
+ if (this.transitionOverlay)
+ this.transitionOverlay.style.opacity = 0;
+ if (this.backdrop)
+ this.backdrop.style.opacity = 1
+ }.bind(this))
+ }.bind(this);
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ completeCallback();
+ else {
+ this._transitionTimeoutPromise = WinJS.Promise.timeout(this._transitionTimeoutMS).then(completeCallback);
+ this._transitionPromise = MS.Entertainment.Utilities.waitForStartedTransitionsToComplete(this.transitionOverlay, true).then(completeCallback);
+ this.transitionOverlay.style.opacity = 1;
+ this.backdrop.style.opacity = 0
+ }
+ }, _clearCurrentLargeArt: function _clearMediaItemArt() {
+ if (!this.mediaItem || this._lastArtistId === this.mediaItem.artistServiceId && this._lastAlbumId === this.mediaItem.albumServiceId)
+ return;
+ MS.Entertainment.UI.Controls.MusicVisualization.currentLargeArt = null
+ }, _updateMediaItemArt: function _updateMediaItemArt() {
+ if (this._frozen || !this.mediaItem)
+ return false;
+ if (this.largeArtUrls && this._lastArtistId && this._lastArtistId === this.mediaItem.artistServiceId && this._lastAlbumId === this.mediaItem.albumServiceId)
+ return false;
+ this._lastArtistId = null;
+ this._lastAlbumId = null;
+ MS.Entertainment.UI.Controls.MusicVisualization.currentLargeArt = null;
+ this.largeArtUrls = null;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMusicMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace);
+ var isMusicMarketplaceEnabled = isMusicMarketplaceNetworkEnabled && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ if (isMusicMarketplaceEnabled && this.mediaItem.artist && this.mediaItem.artist.hasServiceId) {
+ var artistArtQuery = new MS.Entertainment.Data.Query.Music.ArtistImages;
+ artistArtQuery.id = this.mediaItem.artist.serviceId;
+ artistArtQuery.idType = this.mediaItem.artist.serviceIdType;
+ artistArtQuery.impressionGuid = this.mediaItem.artist.impressionGuid;
+ artistArtQuery.minWidth = this.minArtistImageWidth;
+ this._artistQueryPromise = artistArtQuery.execute().then(function success(q) {
+ if (this._frozen) {
+ this.largeArtUrls = null;
+ return
+ }
+ var artistArtUrls = [];
+ if (q.result.items) {
+ for (var i = 0; i < q.result.items.length; i++)
+ if (q.result.items[i].width >= this.minArtistImageWidth && q.result.items[i].width >= q.result.items[i].height)
+ artistArtUrls.push({uri: MS.Entertainment.Utilities.UriFactory.appendQuery(q.result.items[i].url, {format: MS.Entertainment.ImageFormat.png})});
+ if (artistArtUrls.length < 3)
+ if (this.mediaItem.images)
+ this.mediaItem.images.forEach(function addLargeImages(image) {
+ if (image.width >= this.minArtistImageWidth)
+ artistArtUrls.push({uri: image.url})
+ }.bind(this));
+ else
+ artistArtUrls.push({uri: this.mediaItem.imageUri});
+ this._setLargeArtUrls(artistArtUrls);
+ this._lastArtistId = this.mediaItem ? this.mediaItem.artistServiceId : null;
+ this._lastAlbumId = this.mediaItem ? this.mediaItem.albumServiceId : null
+ }
+ else
+ this._setLargeArtUrls([{uri: this.mediaItem.imageUri}])
+ }.bind(this), function failed(q) {
+ this._setLargeArtUrls([{uri: this.mediaItem.imageUri}])
+ }.bind(this))
+ }
+ else
+ this._setLargeArtUrls([{uri: this.mediaItem.imageUri}]);
+ return true
+ }, _createVisualizationEngine: function _createVisualizationEngine() {
+ if (!this._initialized || this._disableShapesAndColors)
+ return;
+ if (MS.Entertainment.UI.Controls.MusicVisualization.disableShapeEngine)
+ return;
+ var controlElement = document.createElement("div");
+ controlElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.ShapeVisualizationEngine");
+ WinJS.Utilities.addClass(controlElement, "shapeVisualizationEngine");
+ this.shapeVisualizationContainer.appendChild(controlElement);
+ if (!MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette)
+ this._randomizeLayerColors();
+ this._shapeVisualizationEngine = new MS.Entertainment.UI.Controls.ShapeVisualizationEngine(controlElement, {currentColorPalette: MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette})
+ }, _randomizeLayerColors: function _randomizeLayerColors(forceTransition) {
+ if (this._disableShapesAndColors) {
+ MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette = this._colorPalettes[0];
+ return
+ }
+ var index = Math.floor(Math.random() * this._colorPalettes.length);
+ while (index === this._lastColorIndex)
+ index = Math.floor(Math.random() * this._colorPalettes.length);
+ this._lastColorIndex = index;
+ var colorPalette = this._colorPalettes[index];
+ var primaryColor = colorPalette[2];
+ this._setColor(primaryColor, forceTransition);
+ this._notifyColorChanged(colorPalette);
+ MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette = colorPalette
+ }, _setColor: function _setColor(color, forceTransition) {
+ var hexColor = this._hexColorToRgb(color);
+ MS.Entertainment.UI.Controls.MusicVisualization.currentPrimaryColor = hexColor;
+ if (this._disableShapesAndColors)
+ this.backdropColor = "rgba(0, 0, 0, 1)";
+ else
+ this.backdropColor = "rgba(" + hexColor.r + "," + hexColor.g + "," + hexColor.b + ", .3)";
+ var colorAlpha = MS.Entertainment.UI.Controls.MusicVisualization.currentLargeArt === String.empty ? 1.0 : MS.Entertainment.UI.Controls.MusicVisualization.defaultColorWashOpacity;
+ if (this._largeArt) {
+ this._largeArt.setOverlay(color, colorAlpha, forceTransition);
+ this._firstColor = false
+ }
+ }, _hexColorToRgb: function _hexColorToRgb(hexColor) {
+ var hexString = hexColor.charAt(0) === "#" ? hexColor.substring(1, 7) : hexColor;
+ return {
+ r: parseInt(hexString.substring(0, 2), 16), g: parseInt(hexString.substring(2, 4), 16), b: parseInt(hexString.substring(4, 6), 16), a: 1
+ }
+ }, _timerTick: function _timerTick() {
+ var artChanged;
+ if (!MS.Entertainment.Utilities.checkIfInDom(this.domElement))
+ this._unloaded = true;
+ if (this._timerEnabled && !this._unloaded)
+ if (this._uiStateService.isAppVisible && !this._frozen) {
+ if (this._lastArtSwap >= this.artSwapPeriod) {
+ this._lastArtSwap = 0;
+ if (this.largeArtUrls && this.largeArtUrls.length > 1) {
+ if (this._largeArt)
+ this._largeArt.clearArt();
+ this._transitionVisualization(function updateArtAndColor() {
+ artChanged = this._randomizeArt();
+ this._randomizeLayerColors(!artChanged)
+ }.bind(this))
+ }
+ else
+ this._randomizeLayerColors(!artChanged)
+ }
+ if (this._opportunities && this._lastOpportunitySwap >= this.opportunitySwapPeriod)
+ this._randomizeOpportunity();
+ if (this.currentOpportunity && this._lastOpportunityShow >= this.opportunityShowPeriod && this.opportunityShowPeriod !== -1)
+ this._hideOpportunity()
+ }
+ }, _updateTimerValues: function _updateTimerValues() {
+ MS.Entertainment.UI.Controls.ImageCollage.prototype._updateTimerValues.call(this);
+ if (this._opportunities) {
+ this._lastOpportunityShow += this.timerTickInterval;
+ this._lastOpportunitySwap += this.timerTickInterval
+ }
+ }, _setLargeArtUrls: function _setLargeArtUrls(urls) {
+ this._setArtVisible(true);
+ this.largeArtUrls = urls
+ }, _setLargeArt: function _setLargeArt(art) {
+ if (art !== null && art !== undefined)
+ if (art.cachedImage) {
+ if (this._largeArt)
+ this._largeArt.setArt(art.cachedImage);
+ MS.Entertainment.UI.Controls.MusicVisualization.currentLargeArt = art.cachedImage;
+ if (this._pendingColorChange && MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette) {
+ this._pendingColorChange = false;
+ this._setColor(MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette[2])
+ }
+ }
+ else
+ this._cacheImage(art).done(function setUrl(url) {
+ if (this._largeArt)
+ this._largeArt.setArt(url);
+ MS.Entertainment.UI.Controls.MusicVisualization.currentLargeArt = url;
+ if (this._pendingColorChange && MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette) {
+ this._pendingColorChange = false;
+ this._setColor(MS.Entertainment.UI.Controls.MusicVisualization.currentColorPalette[2])
+ }
+ }.bind(this));
+ if (!this._timerEnabled) {
+ this._timerEnabled = true;
+ this._startRenderLoop()
+ }
+ this._lastArtSwap = 0
+ }, _cacheImage: function _cacheImage(art) {
+ if (art.uri)
+ return MS.Entertainment.UI.Shell.ImageLoader.cacheImage(art.uri, String.empty).then(function cacheImage(url) {
+ art.cachedImage = url;
+ return WinJS.Promise.wrap(url)
+ }, function useDefaultImage(url) {
+ art.cachedImage = String.empty;
+ return WinJS.Promise.wrap(String.empty)
+ });
+ else
+ return WinJS.Promise.wrap(art)
+ }, _randomizeOpportunity: function _randomizeOpportunity() {
+ if (!this._opportunities === null || !this._opportunities.length)
+ return;
+ this._hideOpportunity();
+ if (this.currentOpportunity)
+ this._lastOpportunity = this.currentOpportunity;
+ var index = Math.floor(Math.random() * this._opportunities.length);
+ var attemptNumber = 1;
+ while (this._opportunities.length > 1 && (index === this._lastOpportunityIndex || !this._opportunities[index] || !this._opportunities[index].isEnabled) && attemptNumber < this._pickNewOpportunityAttempts) {
+ var index = Math.floor(Math.random() * this._opportunities.length);
+ attemptNumber++
+ }
+ var previousIconClassName = String.empty;
+ if (this._opportunities[this._lastOpportunityIndex] && this._opportunities[this._lastOpportunityIndex].iconInfo.className)
+ previousIconClassName = this._opportunities[this._lastOpportunityIndex].iconInfo.className;
+ this._lastOpportunityIndex = index;
+ if (this._opportunities[index] && this._opportunities[index].isEnabled) {
+ this._currentOpportunityAction = this._opportunities[index];
+ this.currentOpportunity = {
+ title: this._currentOpportunityAction ? this._currentOpportunityAction.title : String.empty, subTitle: (this._currentOpportunityAction && this._currentOpportunityAction.parameter && this._currentOpportunityAction.parameter.subTitle) ? this._currentOpportunityAction.parameter.subTitle : (this._currentOpportunityAction && this.mediaItem) ? this.mediaItem.name : String.empty, icon: this._currentOpportunityAction ? this._currentOpportunityAction.iconInfo.icon : String.empty, iconPressed: this._currentOpportunityAction ? this._currentOpportunityAction.iconInfo.iconPressed : String.empty, iconClassName: this._currentOpportunityAction ? this._currentOpportunityAction.iconInfo.className : String.empty, previousIconClassName: previousIconClassName, hideDefaultRing: this._currentOpportunityAction ? this._currentOpportunityAction.iconInfo.hideDefaultRing : false, action: this._currentOpportunityAction || {}
+ }
+ }
+ this._lastOpportunitySwap = 0;
+ this._lastOpportunityShow = 0
+ }, _hideOpportunity: function _hideOpportunity() {
+ if (!this.currentOpportunity)
+ return;
+ this._lastOpportunity = this.currentOpportunity;
+ this.currentOpportunity = null;
+ this._opportunityUpdatePromise = WinJS.Promise.timeout(this.opportunityClickReset).then(function clearLastOpportunity() {
+ this._lastOpportunity = null;
+ this._opportunityUpdatePromise = null
+ }.bind(this))
+ }, _updateEngageOpportunities: function _updateEngageOpportunities(newVal, oldVal) {
+ if (newVal)
+ this._mediaChanged()
+ }, _releaseSmartBuyEngine: function _releaseSmartBuyEngine() {
+ if (this._smartBuyStateEngineBindings) {
+ this._smartBuyStateEngineBindings.cancel();
+ this._smartBuyStateEngineBindings = null
+ }
+ if (this._smartBuyStateEngine) {
+ this._smartBuyStateEngine.unload();
+ this._smartBuyStateEngine = null
+ }
+ }, _updateOpportunities: function _updateOpportunities() {
+ if (this._frozen || (!this.mediaItem && (!this._uiStateService.engageVisible && !MS.Entertainment.Utilities.isMusicApp2)))
+ return;
+ this._hideOpportunity();
+ this._lastOpportunitySwap = this.opportunitySwapPeriod / 2;
+ this._lastOpportunityShow = 0;
+ this._lastOpportunityIndex = 0;
+ if (!MS.Entertainment.Utilities.isMusicApp)
+ return;
+ this._hideOpportunity();
+ this._opportunities = null;
+ this._currentOpportunityAction = null;
+ this.currentOpportunity = null;
+ this._lastOpportunity = null;
+ if (this._opportunityUpdatePromise) {
+ this._opportunityUpdatePromise.cancel();
+ this._opportunityUpdatePromise = null
+ }
+ this._releaseSmartBuyEngine();
+ if (!this._uiStateService.nowPlayingTileVisible || !this.mediaItem || this.mediaItem.isEmpty) {
+ this._smartBuyStateEngine = new MS.Entertainment.ViewModels.SmartBuyStateEngine;
+ this._smartBuyStateEngine.initialize(this.mediaItem || {}, MS.Entertainment.ViewModels.SmartBuyButtons.getTrackOpportunityButtons(this.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.opportunity), MS.Entertainment.ViewModels.MusicStateHandlers.onMusicOpportunitiesChanged, {
+ updateOnAppSnappedModeChange: true, executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.opportunity
+ });
+ if (this.mediaItem)
+ if (!this._mediaContext) {
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._mediaContext = appBarService.pushMediaContext(this.mediaItem, this._appbarOpportunityEventHandlers, null, {executeLocation: MS.Entertainment.UI.Actions.ExecutionLocation.opportunity})
+ }
+ else
+ this._mediaContext.updateMediaItem(this.mediaItem);
+ this._smartBuyStateEngineBindings = WinJS.Binding.bind(this._smartBuyStateEngine, {
+ currentButtons: this._opportunitiesChanged.bind(this), currentAppbarActions: this._appBarOpportunitiesChanged.bind(this)
+ })
+ }
+ if (this._uiStateService.nowPlayingTileVisible && !this.mediaItem) {
+ this.opportunityOffset = this.engageOpportunityOffset;
+ this.opportunitySwapPeriod = this.engageOpportunitySwapPeriod;
+ this.opportunityShowPeriod = this.engageOpportunityShowPeriod;
+ this.opportunityClickReset = this.engageOpportunityClickReset
+ }
+ else {
+ this.opportunityOffset = this._defaultOpportunityOffset;
+ this.opportunitySwapPeriod = this._defaultOpportunitySwapPeriod;
+ this.opportunityShowPeriod = this._defaultOpportunityShowPeriod;
+ this.opportunityClickReset = this._defaultOpportunityClickReset
+ }
+ }, _opportunitiesChanged: function _opportunitiesChanged(newValue, oldValue) {
+ this.currentOpportunity = null;
+ this._lastOpportunity = null;
+ this._opportunities = newValue
+ }, _appBarOpportunitiesChanged: function _appBarOpportunitiesChanged(newValue, oldValue) {
+ if (this._mediaContext)
+ this._mediaContext.setToolbarActions(newValue)
+ }
+ }, {
+ opportunityVisible: false, currentOpportunity: null
+ }, {
+ colorPalettes1: [["#CFB9FA", "#7777D9", "#CFB9FA"], ["#B9CFFA", "#77B8D9", "#B9CFFA"], ["#B9FAFA", "#77D9B8", "#B9FAFA"], ["#B9FACF", "#77D977", "#B9FACF"], ["#CFFAB9", "#B8D977", "#CFFAB9"], ["#C7A35C", "#D9B877", "#C7A35C"], ["#FACFB9", "#D97777", "#FACFB9"], ["#FAB9CF", "#D977B8", "#FAB9CF"], ["#FAB9FA", "#B877D9", "#FAB9FA"]], colorPalettes2: [["#FFFFFF", "#FFFFFF", "6230fc"], ["#FFFFFF", "#FFFFFF", "1981ea"], ["#FFFFFF", "#FFFFFF", "14e2c0"], ["#FFFFFF", "#FFFFFF", "07ef5a"], ["#90ea28", "#90ea28", "90ea28"], ["#f4cb1c", "#f4cb1c", "f4cb1c"], ["#FFFFFF", "#FFFFFF", "ed411e"], ["#FFFFFF", "#FFFFFF", "e82788"], ["#FFFFFF", "#FFFFFF", "b220cf"]], defaultColorWashOpacity: .3, currentColorPalette: null, currentPrimaryColor: null, currentLargeArt: String.empty, currentShape: null, instance: null, disableShapeEngine: false, musicVisualizationsEnabled: true, freezeOnVisualizationsEnabled: false, freezeShapes: function freezeShapes() {
+ if (!MS.Entertainment.UI.Controls.MusicVisualization.musicVisualizationsEnabled) {
+ MS.Entertainment.UI.Controls.MusicVisualization.freezeOnVisualizationsEnabled = true;
+ return
+ }
+ MS.Entertainment.UI.Controls.MusicVisualization.disableShapeEngine = true;
+ if (!MS.Entertainment.UI.Controls.MusicVisualization.instance)
+ return;
+ var freezeShapes = function disableShapeEngine() {
+ if (!MS.Entertainment.UI.Controls.MusicVisualization.disableShapeEngine)
+ return;
+ if (MS.Entertainment.UI.Controls.MusicVisualization.instance && MS.Entertainment.UI.Controls.MusicVisualization.instance._shapeVisualizationEngine)
+ MS.Entertainment.UI.Controls.MusicVisualization.instance._shapeVisualizationEngine.freeze()
+ };
+ if (MS.Entertainment.UI.Controls.MusicVisualization.instance)
+ WinJS.Promise.timeout(2000, MS.Entertainment.UI.Controls.MusicVisualization.instance._hideShapeLayer()).done(freezeShapes, freezeShapes)
+ }, thawShapes: function thawShapes() {
+ if (!MS.Entertainment.UI.Controls.MusicVisualization.musicVisualizationsEnabled) {
+ MS.Entertainment.UI.Controls.MusicVisualization.freezeOnVisualizationsEnabled = false;
+ return
+ }
+ MS.Entertainment.UI.Controls.MusicVisualization.disableShapeEngine = false;
+ if (MS.Entertainment.UI.Controls.MusicVisualization.instance) {
+ MS.Entertainment.UI.Controls.MusicVisualization.instance._showShapeLayer();
+ if (MS.Entertainment.UI.Controls.MusicVisualization.instance && MS.Entertainment.UI.Controls.MusicVisualization.instance._shapeVisualizationEngine)
+ MS.Entertainment.UI.Controls.MusicVisualization.instance._shapeVisualizationEngine.thaw()
+ }
+ }, disableMusicVisualizations: function disableMusicVisualizations() {
+ if (MS.Entertainment.UI.Controls.MusicVisualization.disableShapeEngine)
+ MS.Entertainment.UI.Controls.MusicVisualization.freezeOnVisualizationsEnabled = true;
+ else
+ MS.Entertainment.UI.Controls.MusicVisualization.freezeShapes();
+ MS.Entertainment.UI.Controls.MusicVisualization.musicVisualizationsEnabled = false
+ }, enableMusicVisualizations: function enableMusicVisualizations() {
+ MS.Entertainment.UI.Controls.MusicVisualization.musicVisualizationsEnabled = true;
+ if (!MS.Entertainment.UI.Controls.MusicVisualization.freezeOnVisualizationsEnabled)
+ MS.Entertainment.UI.Controls.MusicVisualization.thawShapes();
+ else
+ MS.Entertainment.UI.Controls.MusicVisualization.freezeOnVisualizationsEnabled = false
+ }, disableLargeArtScaling: function disableLargeArtScaling() {
+ if (MS.Entertainment.UI.Controls.MusicVisualization.instance && MS.Entertainment.UI.Controls.MusicVisualization.instance._largeArt) {
+ MS.Entertainment.UI.Controls.MusicVisualization.instance._largeArt.disableScaling = true;
+ WinJS.Utilities.removeClass(MS.Entertainment.UI.Controls.MusicVisualization.instance._largeArt.domElement, "imageCollageLargeArt")
+ }
+ }, enableLargeArtScaling: function enableLargeArtScaling() {
+ if (MS.Entertainment.UI.Controls.MusicVisualization.instance && MS.Entertainment.UI.Controls.MusicVisualization.instance._largeArt) {
+ MS.Entertainment.UI.Controls.MusicVisualization.instance._largeArt.disableScaling = false;
+ WinJS.Utilities.addClass(MS.Entertainment.UI.Controls.MusicVisualization.instance._largeArt.domElement, "imageCollageLargeArt")
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlaying.html b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlaying.html
new file mode 100644
index 00000000..82aa0edb
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlaying.html
@@ -0,0 +1,26 @@
+
+
+
+
+ NowPlaying
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlaying.js b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlaying.js
new file mode 100644
index 00000000..b21d1c0b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlaying.js
@@ -0,0 +1,401 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ NowPlaying: MS.Entertainment.UI.Framework.defineUserControl("/Controls/NowPlaying/NowPlaying.html#nowPlayingTemplate", function(element, options){}, {
+ hostAudioVideoControl: true, _mediaStoppedTimeout: 1500, _mediaStoppedGoBackTimeout: 10000, _uiStateService: MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), _bindings: null, _eventHandlers: null, _musicVisualizationControl: null, _musicVisualizationBindings: null, _nowPlayingOverlaysControl: null, _shareOperation: null, _sessionMgr: null, _deferredUpdateTimer: null, _pointerHandlers: null, _freezeDelayPromise: null, _navigateBackOnUnSnap: false, _seekBarManipulatingChangedBound: null, _uiStateEventHandlers: null, _nowPlayingViewModel: null, _playbackSessionHandler: null, _freezeDelayTimerMS: 1000, suppressUnload: true, initialize: function initialize() {
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._nowPlayingViewModel = new MS.Entertainment.ViewModels.Music2NowPlayingVisualizationViewModel;
+ this._playbackSessionHandler = WinJS.Binding.bind(this, {playbackSession: this._playbackSessionChanged.bind(this)});
+ if (!this.hostAudioVideoControl) {
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._uiStateEventHandlers = MS.Entertainment.Utilities.addEventHandlers(uiState, {primarySessionIdChanged: this._primarySessionIdChanged.bind(this)});
+ this._primarySessionIdChanged()
+ }
+ if ((MS.Entertainment.Utilities.isMusicApp2 && !this.hostAudioVideoControl) || (MS.Entertainment.Utilities.isMusicApp1 && (this._uiStateService.nowPlayingTileVisible || this._uiStateService.isSnapped))) {
+ this._createOverlays();
+ this._updatePointerHandlers()
+ }
+ this.initialized = true
+ }, onReparented: function onReparented() {
+ if (this._nowPlayingOverlaysControl && this._nowPlayingOverlaysControl.onReparented)
+ this._nowPlayingOverlaysControl.onReparented()
+ }, nowPlayingMouseDown: function nowPlayingMouseDown(event) {
+ if (this._nowPlayingOverlaysControl)
+ this._nowPlayingOverlaysControl.nowPlayingMouseDown(event)
+ }, nowPlayingMouseUp: function nowPlayingMouseUp(event) {
+ if (this._nowPlayingOverlaysControl && this._nowPlayingOverlaysControl.nowPlayingMouseUp)
+ this._nowPlayingOverlaysControl.nowPlayingMouseUp(event)
+ }, nowPlayingMouseMove: function nowPlayingMouseMove(event) {
+ if (this._nowPlayingOverlaysControl)
+ this._nowPlayingOverlaysControl.nowPlayingMouseMove(event)
+ }, nowPlayingMouseHover: function nowPlayingMouseHover(event) {
+ if (this._nowPlayingOverlaysControl && this._nowPlayingOverlaysControl.nowPlayingMouseHover)
+ this._nowPlayingOverlaysControl.nowPlayingMouseHover(event)
+ }, nowPlayingClick: function nowPlayingClick(event) {
+ if ((!this._uiStateService.nowPlayingTileVisible || !event) && this._nowPlayingOverlaysControl && this._nowPlayingOverlaysControl.nowPlayingClick)
+ this._nowPlayingOverlaysControl.nowPlayingClick(event)
+ }, _nowPlayingTileVisibleChanged: function _nowPlayingTileVisibleChanged() {
+ if (this._nowPlayingContainer)
+ if (this._uiStateService.nowPlayingTileVisible)
+ this._nowPlayingContainer.setAttribute("role", "button");
+ else
+ this._nowPlayingContainer.removeAttribute("role")
+ }, _fullScreenVideoChanged: function _fullScreenVideoChanged(isFullScreenVideo) {
+ if (this.playbackSession && MS.Entertainment.Utilities.isVideoApp)
+ if (isFullScreenVideo && MS.Entertainment.Utilities.isVideoApp1) {
+ if (!this.playbackSession.closedCaptionsOn)
+ this.playbackSession.disableTimeUpdate()
+ }
+ else {
+ this.playbackSession.forceTimeUpdate();
+ this.playbackSession.enableTimeUpdate()
+ }
+ }, _updatePointerHandlers: function _updatePointerHandlers() {
+ if (!this._pointerHandlers && this._nowPlayingContainer) {
+ var handlePointerDown = this.nowPlayingMouseDown.bind(this);
+ var handlePointerUp = this.nowPlayingMouseUp.bind(this);
+ var handlePointerMove = this.nowPlayingMouseMove.bind(this);
+ var handlePointerHover = this.nowPlayingMouseHover.bind(this);
+ this._pointerHandlers = MS.Entertainment.Utilities.addEventHandlers(this._nowPlayingContainer, {
+ MSPointerDown: handlePointerDown, pointerdown: handlePointerDown, MSPointerUp: handlePointerUp, pointerup: handlePointerUp, MSPointerMove: handlePointerMove, pointermove: handlePointerMove, MSPointerHover: handlePointerHover, pointerhover: handlePointerHover, click: this.nowPlayingClick.bind(this)
+ })
+ }
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ }, freeze: function freeze() {
+ if (this.frozen) {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ return
+ }
+ if (this._freezeDelayPromise) {
+ this._freezeDelayPromise.cancel();
+ this._freezeDelayPromise = null
+ }
+ this._freezeDelayPromise = WinJS.Promise.timeout(this._freezeDelayTimerMS).then(function freezeControl() {
+ WinJS.Utilities.addClass(this.domElement, "removeFromDisplay");
+ this._suspendControl();
+ this.frozen = true;
+ this._freezeDelayPromise = null
+ }.bind(this));
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ WinJS.Utilities.removeClass(this.domElement, "removeFromDisplay");
+ MS.Entertainment.Utilities.showElement(this.domElement);
+ if (this._freezeDelayPromise) {
+ this._freezeDelayPromise.cancel();
+ this._freezeDelayPromise = null;
+ if (!this._pointerHandlers)
+ this._updatePointerHandlers();
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ return
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this.frozen) {
+ this.frozen = false;
+ this._updatePointerHandlers();
+ if (!this._nowPlayingOverlaysControl && this._initialized) {
+ this._createOverlays();
+ this._nowPlayingOverlaysControl.playbackSession = this.playbackSession
+ }
+ this._playbackSessionChanged()
+ }
+ }, _suspendControl: function _suspendControl() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFullScreenVideo = false;
+ if (this.playbackSession && MS.Entertainment.Utilities.isVideoApp) {
+ this.playbackSession.forceTimeUpdate();
+ this.playbackSession.enableTimeUpdate()
+ }
+ if (this._pointerHandlers) {
+ this._pointerHandlers.cancel();
+ this._pointerHandlers = null
+ }
+ this._cancelShareMedia();
+ this._detachBindings()
+ }, unload: function unload() {
+ this.initialized = false;
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ this._suspendControl();
+ if (this._musicVisualizationBindings) {
+ this._musicVisualizationBindings.cancel();
+ this._musicVisualizationBindings = null
+ }
+ if (this._musicVisualizationControl) {
+ this._musicVisualizationControl.unload();
+ this._musicVisualizationControl = null
+ }
+ if (this._seekBarManipulatingChangedBound) {
+ this._nowPlayingOverlaysControl.unbind("seekBarManipulating", this._seekBarManipulatingChangedBound);
+ this._seekBarManipulatingChangedBound = null
+ }
+ if (this._uiStateEventHandlers) {
+ this._uiStateEventHandlers.cancel();
+ this._uiStateEventHandlers = null
+ }
+ if (this._nowPlayingViewModel) {
+ this._nowPlayingViewModel.dispose();
+ this._nowPlayingViewModel = null
+ }
+ if (this._nowPlayingOverlaysControl) {
+ this._nowPlayingOverlaysControl.unload();
+ this._nowPlayingOverlaysControl = null
+ }
+ if (this._playbackSessionHandler) {
+ this._playbackSessionHandler.cancel();
+ this._playbackSessionHandler = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _primarySessionIdChanged: function _primarySessionIdChanged(newValue) {
+ this.playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ if (this.playbackSession) {
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.playbackSession, {
+ currentMediaChanged: this._mediaChanged.bind(this), currentTransportStateChanged: this._mediaStateChanged.bind(this)
+ });
+ this._mediaChanged();
+ this._mediaStateChanged({detail: {newValue: this.playbackSession.currentTransportState}});
+ this._bindings = WinJS.Binding.bind(this, {
+ enableShare: this._shareMedia.bind(this), _uiStateService: {
+ isFullScreenVideo: this._fullScreenVideoChanged.bind(this), nowPlayingTileVisible: this._nowPlayingTileVisibleChanged.bind(this), isSnapped: function isSnappedChanged(newVal, oldVal) {
+ if (this._navigateBackOnUnSnap && !newVal) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack();
+ this._navigateBackOnUnSnap = false
+ }
+ }.bind(this)
+ }
+ })
+ }
+ if (this._nowPlayingOverlaysControl)
+ this._nowPlayingOverlaysControl.playbackSession = this.playbackSession;
+ this._updateStates()
+ }, repossessNowPlaying: function repossessNowPlaying() {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ return;
+ if (this.hostAudioVideoControl && this._playbackContainer && this._playbackContainer.domElement && this._playbackContainer.domElement.children.length === 0)
+ this._sessionMgr.relocateSession(this._playbackContainer.domElement, false);
+ this._mediaChanged();
+ if (((MS.Entertainment.Utilities.isMusicApp2 && !this.hostAudioVideoControl) || (MS.Entertainment.Utilities.isMusicApp1 && (this._uiStateService.nowPlayingTileVisible || this._uiStateService.isSnapped))) || !this._nowPlayingOverlaysControl) {
+ this._createOverlays();
+ this._nowPlayingOverlaysControl.playbackSession = this.playbackSession
+ }
+ }, _mediaChanged: function _mediaChanged(e) {
+ if (this.frozen || this._unloaded)
+ return;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia) || this._uiStateService.nowPlayingTileVisible) {
+ this._updateNowPlayingArt();
+ this.videoVisible = false;
+ this.musicVisualizationVisible = true
+ }
+ else {
+ if (this._playbackContainer && this._playbackContainer.domElement)
+ WinJS.Utilities.removeClass(this._playbackContainer.domElement, "hideFromDisplay");
+ this.videoVisible = true;
+ this.musicVisualizationVisible = false;
+ if (this._musicVisualizationControl)
+ this._musicVisualizationControl.albumIdList = null
+ }
+ this._shareMedia()
+ }, _createOverlays: function _createOverlays() {
+ if (this._nowPlayingOverlaysContainer) {
+ var controlElement = document.createElement("div");
+ if (window.onNewVideoPage) {
+ controlElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.VideoWinNowPlayingOverlays");
+ this._nowPlayingOverlaysContainer.domElement.appendChild(controlElement);
+ this._nowPlayingOverlaysControl = new MS.Entertainment.UI.Controls.VideoWinNowPlayingOverlays(controlElement, {})
+ }
+ else {
+ controlElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.NowPlayingOverlays");
+ this._nowPlayingOverlaysContainer.domElement.appendChild(controlElement);
+ this._nowPlayingOverlaysControl = new MS.Entertainment.UI.Controls.NowPlayingOverlays(controlElement, {})
+ }
+ this._nowPlayingOverlaysControl.dataContext = this._nowPlayingViewModel;
+ this._updateStates();
+ if (!MS.Entertainment.Utilities.isMusicApp2 && !this._seekBarManipulatingChangedBound) {
+ this._seekBarManipulatingChangedBound = this._seekBarManipulatingChanged.bind(this);
+ this._nowPlayingOverlaysControl.bind("seekBarManipulating", this._seekBarManipulatingChangedBound)
+ }
+ if (!this.hostAudioVideoControl && this.playbackSession)
+ this._nowPlayingOverlaysControl.playbackSession = this.playbackSession
+ }
+ }, _createNowPlayingVisualization: function _createNowPlayingVisualization() {
+ var controlElement = document.createElement("div");
+ controlElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.Music2NowPlayingVisualization");
+ WinJS.Utilities.addClass(controlElement, "musicVisualization");
+ this._musicVisualizationContainer.domElement.appendChild(controlElement);
+ this._musicVisualizationControl = new MS.Entertainment.UI.Controls.Music2NowPlayingVisualization(controlElement, {});
+ this._musicVisualizationControl.dataContext = this._nowPlayingViewModel;
+ this._nowPlayingViewModel.load();
+ this._updateStates()
+ }, _updateNowPlayingArt: function _updateNowPlayingArt() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.playback.enableMusicVisualization)
+ if (!this._musicVisualizationControl)
+ this._createNowPlayingVisualization()
+ }, _seekBarManipulatingChanged: function _seekBarManipulatingChanged(newVal) {
+ if (newVal) {
+ if (this._pointerHandlers) {
+ this._pointerHandlers.cancel();
+ this._pointerHandlers = null
+ }
+ if (this._musicVisualizationControl)
+ this._musicVisualizationControl.pause()
+ }
+ else {
+ this._updatePointerHandlers();
+ if (this._musicVisualizationControl)
+ this._musicVisualizationControl.play()
+ }
+ }, _mediaStateChanged: function _mediaStateChanged(e) {
+ var newVal = e.detail.newValue;
+ var oldVal = e.detail.oldValue;
+ if (this.frozen)
+ return;
+ if (oldVal && newVal === MS.Entertainment.Platform.Playback.TransportState.stopped) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!MS.Entertainment.Utilities.isMusicApp || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace))
+ WinJS.Promise.timeout(this._mediaStoppedTimeout).then(function _delay() {
+ if (!this.frozen && this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible)
+ if (this.playbackSession.currentMedia && this.playbackSession.currentMedia.hasServiceId && !this._uiStateService.nowPlayingConstrainedMode) {
+ if (!this._uiStateService.isSnapped) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset = true;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible = false;
+ this._nowPlayingOverlaysControl.showBackButton()
+ }
+ }
+ else if (this.playbackSession.currentMedia && !this.playbackSession.currentMedia.hasServiceId && MS.Entertainment.Utilities.isVideoApp) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingInset = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nowPlayingVisible = true
+ }
+ else if (oldVal !== newVal)
+ if (!this._uiStateService.isSnapped)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack();
+ else
+ this._navigateBackOnUnSnap = true
+ }.bind(this));
+ else
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack()
+ }
+ }, _updateStates: function _updateStates() {
+ if (this._deferredUpdateTimer)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ }, _updateStatesDeferred: function _updateStatesDeferred() {
+ this._deferredUpdateTimer = null;
+ if (!this.playbackSession) {
+ if (this._uiStateService.nowPlayingTileVisible)
+ this.backgroundVisible = true;
+ return
+ }
+ if (this.playbackSession && this.playbackSession.isRemoteSession)
+ this.backgroundVisible = MS.Entertainment.Utilities.isWindowsBlue || !this.playbackSession.isRemoteSession() || MS.Entertainment.Platform.PlaybackHelpers.isMusicTrackOrMusicVideo(this.playbackSession.currentMedia);
+ else
+ this.backgroundVisible = false
+ }, _shareMedia: function _shareMedia() {
+ if (this._uiStateService.nowPlayingTileVisible || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender))
+ return;
+ this._cancelShareMedia();
+ if (this.enableSharing && this.playbackSession && this.playbackSession.currentMedia) {
+ var sender = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ this._shareOperation = sender.pendingShare(this.playbackSession.currentMedia)
+ }
+ }, _cancelShareMedia: function _cancelShareMedia() {
+ if (this._shareOperation) {
+ this._shareOperation.cancel();
+ this._shareOperation = null
+ }
+ }
+ }, {
+ initialized: false, playbackSession: null, videoVisible: false, backgroundVisible: true, musicVisualizationVisible: false, enableSharing: true, frozen: false
+ }), NowPlayingControlManager: MS.Entertainment.UI.Framework.define(function nowPlayingControlManager() {
+ this._nowPlayingControls = {};
+ this._parkedNowPlayingHosts = {};
+ this._nowPlayingControlTimers = {}
+ }, {
+ controlCleanupTimeout: 1800000, cleanupTimerEnabled: false, _parkedNowPlayingHosts: null, _nowPlayingControls: null, _nowPlayingControlTimers: null, preloadNowPlayingControls: function preloadNowPlayingControls(force) {
+ this.getNowPlayingControl(MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying, true)
+ }, getNowPlayingControl: function getNowPlayingControl(sessionId, preload) {
+ if (preload && this._nowPlayingControls[sessionId])
+ return this._nowPlayingControls[sessionId];
+ if (!this._parkedNowPlayingHosts[sessionId] || this._parkedNowPlayingHosts[sessionId].children.length === 0) {
+ var parkedNowPlayingHost = document.createElement("div");
+ parkedNowPlayingHost.style.position = "absolute";
+ parkedNowPlayingHost.style.zIndex = -1;
+ WinJS.Utilities.addClass(parkedNowPlayingHost, "removeFromDisplay");
+ document.body.appendChild(parkedNowPlayingHost);
+ this._parkedNowPlayingHosts[sessionId] = parkedNowPlayingHost;
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ this._nowPlayingControls[sessionId] = parkedNowPlayingHost;
+ else {
+ var controlElement = document.createElement("div");
+ controlElement.setAttribute("class", "nowPlayingControl");
+ controlElement.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.NowPlaying");
+ this._nowPlayingControls[sessionId] = new MS.Entertainment.UI.Controls.NowPlaying(controlElement, {});
+ this.releaseNowPlayingControl(sessionId);
+ var onInitialize = function onInitialize(newVal) {
+ if (newVal) {
+ this._nowPlayingControls[sessionId].unbind("initialized", onInitialize);
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._nowPlayingControls[sessionId].playbackSession = sessionMgr.getSession(sessionId);
+ if (this._parkedNowPlayingHosts[sessionId].children.length > 0)
+ MS.Entertainment.Utilities.freezeControlsInSubtree(this._parkedNowPlayingHosts[sessionId])
+ }
+ };
+ this._nowPlayingControls[sessionId].bind("initialized", onInitialize.bind(this))
+ }
+ }
+ else if (!MS.Entertainment.Utilities.isMusicApp2)
+ MS.Entertainment.Utilities.thawControlsInSubtree(this._parkedNowPlayingHosts[sessionId]);
+ if (!preload && this._nowPlayingControlTimers[sessionId]) {
+ this._nowPlayingControlTimers[sessionId].cancel();
+ this._nowPlayingControlTimers[sessionId] = null
+ }
+ return this._nowPlayingControls[sessionId]
+ }, releaseNowPlayingControl: function releaseNowPlayingControl(sessionId) {
+ if (!this._parkedNowPlayingHosts || !this._parkedNowPlayingHosts[sessionId] || this._parkedNowPlayingHosts[sessionId].children.length > 0 || !this._nowPlayingControls || !this._nowPlayingControls[sessionId])
+ return;
+ MS.Entertainment.Utilities.freezeControlsInSubtree(this._nowPlayingControls[sessionId].domElement);
+ this._parkedNowPlayingHosts[sessionId].appendChild(this._nowPlayingControls[sessionId].domElement);
+ if (this._nowPlayingControlTimers[sessionId]) {
+ this._nowPlayingControlTimers[sessionId].cancel();
+ this._nowPlayingControlTimers[sessionId] = null
+ }
+ if (this.cleanupTimerEnabled)
+ this._nowPlayingControlTimers[sessionId] = WinJS.Promise.timeout(this.controlCleanupTimeout).then(function _delay() {
+ this._releaseControl(sessionId)
+ }.bind(this))
+ }, releaseNowPlayingControls: function releaseNowPlayingControls() {
+ if (this._nowPlayingControlTimers[MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying])
+ this._releaseControl(MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying)
+ }, _releaseControl: function releaseControl(sessionId) {
+ if (this._nowPlayingControlTimers[sessionId]) {
+ this._nowPlayingControlTimers[sessionId].cancel();
+ this._nowPlayingControlTimers[sessionId] = null
+ }
+ document.body.removeChild(this._parkedNowPlayingHosts[sessionId]);
+ MS.Entertainment.Utilities.empty(this._parkedNowPlayingHosts[sessionId]);
+ this._parkedNowPlayingHosts[sessionId] = null;
+ if (this._nowPlayingControls[sessionId] && this._nowPlayingControls[sessionId].unload) {
+ this._nowPlayingControls[sessionId].suppressUnload = false;
+ this._nowPlayingControls[sessionId].unload();
+ this._nowPlayingControls[sessionId] = null
+ }
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.nowPlayingControlManager, function nowPlayingControlManagerFactory() {
+ return new MS.Entertainment.UI.Controls.NowPlayingControlManager
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingMetadata.html b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingMetadata.html
new file mode 100644
index 00000000..dac1018b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingMetadata.html
@@ -0,0 +1,29 @@
+
+
+
+
+ Now Playing Metadata Template
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingMetadata.js b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingMetadata.js
new file mode 100644
index 00000000..a542a001
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingMetadata.js
@@ -0,0 +1,148 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/imageidtypes.js", "/Framework/imageloader.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NowPlayingMetadata: MS.Entertainment.UI.Framework.defineUserControl("/Controls/NowPlaying/NowPlayingMetadata.html#nowPlayingMetadataTemplate", function(element, options) {
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState)
+ }, {
+ _uiStateService: null, _modelItem: null, _mainTitle: String.empty, _secondaryTitle: String.empty, _durationText: String.empty, _playlistButtonVisible: false, initialize: function initialize(){}, modelItem: {
+ get: function() {
+ return this._modelItem
+ }, set: function(value) {
+ if (value !== this._modelItem) {
+ var oldValue = this._modelItem;
+ this._modelItem = value;
+ this.notify("modelItem", value, oldValue);
+ if (this._initialized && !this._unloaded)
+ this._modelItemChanged(value, oldValue)
+ }
+ }
+ }, mainTitle: {
+ get: function() {
+ return this._mainTitle
+ }, set: function(value) {
+ if (value !== this._mainTitle) {
+ var oldValue = this._mainTitle;
+ this._mainTitle = value;
+ this.notify("mainTitle", value, oldValue);
+ if (this._initialized && !this._unloaded) {
+ this._mainTitleText.textContent = value;
+ if (value)
+ WinJS.Utilities.removeClass(this._mainTitleText, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._mainTitleText, "removeFromDisplay")
+ }
+ }
+ }
+ }, subTitle: {
+ get: function() {
+ return this._subTitle
+ }, set: function(value) {
+ if (value !== this._subTitle) {
+ var oldValue = this._subTitle;
+ this._subTitle = value;
+ this.notify("subTitle", value, oldValue);
+ if (this._initialized && !this._unloaded) {
+ this._subTitleText.textContent = value;
+ if (value)
+ WinJS.Utilities.removeClass(this._subTitleText, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._subTitleText, "removeFromDisplay")
+ }
+ }
+ }
+ }, durationText: {
+ get: function() {
+ return this._durationText
+ }, set: function(value) {
+ if (value !== this._durationText) {
+ var oldValue = this._durationText;
+ this._durationText = value;
+ this.notify("durationText", value, oldValue);
+ if (this._initialized && !this._unloaded) {
+ this._timeText.textContent = value;
+ if (!MS.Entertainment.Utilities.isMusicApp2)
+ if (value)
+ WinJS.Utilities.removeClass(this._timeText, "removeFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._timeText, "removeFromDisplay")
+ }
+ }
+ }
+ }, playlistButtonVisible: {
+ get: function() {
+ return this._playlistButtonVisible
+ }, set: function(value) {
+ if (value !== this._playlistButtonVisible) {
+ var oldValue = this._playlistButtonVisible;
+ this._playlistButtonVisible = value;
+ this.notify("playlistButtonVisible", value, oldValue);
+ if (this._initialized && !this._unloaded)
+ if (value)
+ WinJS.Utilities.removeClass(this._playlistButton, "hideFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._playlistButton, "hideFromDisplay")
+ }
+ }
+ }, unload: function unload() {
+ if (this._modelPropertyChangedHandlers) {
+ this._modelPropertyChangedHandlers.cancel();
+ this._modelPropertyChangedHandlers = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _modelItemChanged: function _modelItemChanged() {
+ var that = this;
+ if (this.modelItem && this.modelItem.mediaType >= 0) {
+ switch (this.modelItem.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ this.mainTitle = this.modelItem.name;
+ this.subTitle = MS.Entertainment.Formatters.formatGenre(this.modelItem);
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(this.modelItem)) {
+ if (this.modelItem.seriesTitle)
+ this.mainTitle = this.modelItem.seriesTitle;
+ else if (this.modelItem.ParentSeries)
+ this.mainTitle = this.modelItem.ParentSeries.Name;
+ if (this.modelItem.seasonNumber > -1 && this.modelItem.episodeNumber && this.modelItem.name)
+ this.subTitle = String.load(String.id.IDS_TV_NUMBERED_EPISODE_SEASON_TITLE).format(this.modelItem.seasonNumber, this.modelItem.episodeNumber, this.modelItem.name);
+ else if (this.modelItem.name)
+ this.subTitle = this.modelItem.name
+ }
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ this.mainTitle = this.modelItem.name;
+ this.subTitle = String.empty;
+ if (this._modelPropertyChangedHandlers) {
+ this._modelPropertyChangedHandlers.cancel();
+ this._modelPropertyChangedHandlers = null
+ }
+ this._modelPropertyChangedHandlers = WinJS.Binding.bind(this.modelItem, {
+ name: function _modelItemPropertyChanged() {
+ this.mainTitle = that.modelItem.name
+ }.bind(this), artistName: function _modelItemPropertyChanged() {
+ this.subTitle = MS.Entertainment.Formatters.formatAlbumAndArtistHelper(that.modelItem)
+ }.bind(this)
+ }, false);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ this.mainTitle = this.modelItem.name;
+ this.subTitle = this.modelItem.primaryGenre;
+ break;
+ default:
+ this.mainTitle = this.modelItem.name;
+ this.subTitle = MS.Entertainment.Formatters.formatAlbumAndArtistHelper(this.modelItem);
+ break
+ }
+ var doNothing = function doNothing(){};
+ if (this.modelItem.hydrate)
+ this.modelItem.hydrate({forceUpdate: this.modelItem.fromCollection}).done(doNothing, doNothing)
+ }
+ else {
+ this.mainTitle = String.empty;
+ this.subTitle = String.empty
+ }
+ }
+ }, {playlistButtonClick: function playlistButtonClick() {
+ if (this.onPlaylistClicked)
+ this.onPlaylistClicked()
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingOverlays.html b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingOverlays.html
new file mode 100644
index 00000000..3b418c52
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingOverlays.html
@@ -0,0 +1,87 @@
+
+
+
+
+ NowPlaying
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingPlaylist.html b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingPlaylist.html
new file mode 100644
index 00000000..7159540e
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingPlaylist.html
@@ -0,0 +1,119 @@
+
+
+
+
+ Now Playing Playlist Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingPlaylist.js b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingPlaylist.js
new file mode 100644
index 00000000..56537f24
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingPlaylist.js
@@ -0,0 +1,142 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js", "/Components/Playback/PlaybackEventNotifications.js");
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NowPlayingPlaylist: MS.Entertainment.UI.Framework.defineUserControl("/Controls/NowPlaying/NowPlayingPlaylist.html#nowPlayingPlaylistTemplate", function nowPlayingPlaylistConstructor(element, options) {
+ this._bindingsToDetach = [];
+ this.closeAction = new MS.Entertainment.UI.Actions.Action;
+ this.closeAction.executed = this.closeButtonClick.bind(this);
+ this.closeAction.canExecute = function closeButtonCanExecute() {
+ return true
+ };
+ if (options.dataContext) {
+ this.dataSource = options.dataContext.dataSource || this.dataSource;
+ this.playbackSession = options.dataContext.playbackSession || this.playbackSession;
+ this.galleryTemplate = options.dataContext.galleryTemplate || this.galleryTemplate
+ }
+ }, {
+ _bindingsToDetach: null, _eventHandlers: null, _hasSetFocus: false, _uiStateBindings: null, _selectionEvents: null, _invocationHelperEvents: null, galleryTemplate: null, jumpToCurrentIndex: true, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.assert(this.galleryTemplate, "No gallery template was supplied to the NowPlayingPlaylist. This needs to happen before initialization");
+ if (this.galleryView)
+ this.galleryView.mediaContext = {containingMedia: null};
+ if (this.galleryView && this.galleryTemplate) {
+ this.galleryView.itemTemplate = this.galleryTemplate.itemTemplate || this.galleryView.itemTemplate;
+ this.galleryView.layout = this.galleryTemplate.layout || this.galleryView.layout;
+ if (this.galleryTemplate.galleryClass)
+ WinJS.Utilities.addClass(this.galleryView.domElement, this.galleryTemplate.galleryClass);
+ if (this.galleryView.setReadyStateCallback && this._handleReadyStateChanges)
+ this.galleryView.setReadyStateCallback(this._handleReadyStateChanges.bind(this))
+ }
+ if (this.galleryTemplate.ensureNextItemVisibleCount > 0)
+ this.galleryView.ensureNextItemVisibleCount = this.galleryTemplate.ensureNextItemVisibleCount;
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this.bind("dataSource", this._dataSourceChanged.bind(this));
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {
+ MSPointerDown: this.galleryMouseDown, pointerdown: this.galleryMousedown, keydown: this._keyDown.bind(this)
+ });
+ this._uiStateBindings = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {isSnapped: this._onSnappedChanged.bind(this)});
+ this._updateContainingMedia()
+ }, unload: function unload() {
+ this._detachBindings();
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ if (this._uiStateBindings) {
+ this._uiStateBindings.cancel();
+ this._uiStateBindings = null
+ }
+ if (this._invocationHelperEvents) {
+ this._invocationHelperEvents.cancel();
+ this._invocationHelperEvents = null
+ }
+ if (this._selectionEvents) {
+ this._selectionEvents.cancel();
+ this._selectionEvents = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _onSnappedChanged: function _onSnappedChanged(newValue, oldValue) {
+ if (oldValue !== undefined && newValue && this.galleryView) {
+ this.galleryView.clearSelection();
+ this.galleryView.clearInvocation()
+ }
+ }, _detachBindings: function _detachBindings() {
+ this._bindingsToDetach.forEach(function(e) {
+ e.source.unbind(e.name, e.action)
+ });
+ this._bindingsToDetach = []
+ }, _initializeBinding: function _initializeBinding(source, name, action) {
+ source.bind(name, action);
+ this._bindingsToDetach.push({
+ source: source, name: name, action: action
+ })
+ }, _keyDown: function _keyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.escape)
+ this.closeButtonClick()
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ if (this.playbackSession) {
+ this._initializeBinding(this.playbackSession, "currentOrdinal", this._currentOrdinalChanged.bind(this));
+ this._initializeBinding(this.playbackSession, "mediaCollection", this._mediaCollectionChanged.bind(this));
+ this._initializeBinding(this.playbackSession, "smartDJSeed", this._smartDJSeedChanged.bind(this))
+ }
+ this._updateContainingMedia()
+ }, _smartDJSeedChanged: function _smartDJSeedChanged() {
+ if (this._unloaded)
+ return;
+ this.playlistTitle = this._getPlaylistTitle()
+ }, _mediaCollectionChanged: function _mediaCollectionChanged(newVal, oldVal) {
+ if (this._unloaded)
+ return;
+ var showHeader = false;
+ if (this.playbackSession) {
+ showHeader = !!this.playbackSession.smartDJSeed;
+ var oldDataSource = this.dataSource;
+ this.dataSource = this.playbackSession.mediaCollection || null;
+ this._dataSourceChanged(this.dataSource, oldDataSource)
+ }
+ this.playlistTitle = this._getPlaylistTitle()
+ }, _getPlaylistTitle: function _getPlaylistTitle() {
+ var playlistTitle = String.empty;
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var smartDJSeed = this.playbackSession && this.playbackSession.smartDJSeed;
+ if (!uiState.isSnapped)
+ playlistTitle = smartDJSeed ? String.load(String.id.IDS_SMARTDJ_CARD_LABEL) : String.empty;
+ else if (smartDJSeed)
+ playlistTitle = smartDJSeed.name;
+ return playlistTitle
+ }, _dataSourceChanged: function _dataSourceChanged(newVal, oldVal) {
+ if (this.galleryView && this.galleryView.dataSource !== newVal)
+ this.galleryView.dataSource = newVal
+ }, _updateContainingMedia: function _updateContainingMedia() {
+ if (this.galleryView && this.galleryView.mediaContext)
+ this.galleryView.mediaContext.containingMedia = {
+ playbackItemSource: this.playbackSession || this.dataSource, playbackOffset: 0
+ }
+ }, _currentOrdinalChanged: function _currentOrdinalChanged() {
+ if (!this.jumpToCurrentIndex)
+ return;
+ if (this.playbackSession && this.galleryView)
+ if (this.playbackSession.currentOrdinal !== null && this.playbackSession.currentOrdinal !== undefined) {
+ this.selectedIndex = this.playbackSession.currentOrdinal;
+ if (this.galleryView.dataSource)
+ this.galleryView.ensureVisible(this.playbackSession.currentOrdinal);
+ else
+ this.galleryView.initialVisible = this.playbackSession.currentOrdinal
+ }
+ else
+ this.selectedIndex = -1
+ }
+ }, {
+ items: null, dataSource: null, playbackSession: null, playlistTitle: "", selectedIndex: -1, closeClicked: null, saveButtonClick: function saveButtonClick() {
+ MS.Entertainment.UI.Controls.NewPlaylistOverlay.show(this.playbackSession.mediaCollection)
+ }, closeButtonClick: function closeButtonClick(event) {
+ if (this.closeClicked)
+ this.closeClicked()
+ }, galleryMouseDown: function galleryMouseDown(event) {
+ event.cancelBubble = true
+ }
+ }, {})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingTransportControls.html b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingTransportControls.html
new file mode 100644
index 00000000..397e5149
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingTransportControls.html
@@ -0,0 +1,79 @@
+
+
+
+
+ NowPlayingTransportControls
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingTransportControls.js b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingTransportControls.js
new file mode 100644
index 00000000..df61835e
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/NowPlayingTransportControls.js
@@ -0,0 +1,46 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Controls/TransportControls/TransportControls.js", "/Framework/corefx.js");
+(function(undefined) {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NowPlayingTransportControls: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.TransportControls", "/Controls/NowPlaying/NowPlayingTransportControls.html#transportControlsTemplate", function nowPlayingTransportControls() {
+ this._isNowPlayingControls = true
+ }, {initialize: function initialize() {
+ MS.Entertainment.UI.Controls.TransportControls.prototype.initialize.call(this);
+ this._skipBackAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportSkipBack;
+ this._skipBackHoldAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportSkipBackHold;
+ this._playAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportPlay;
+ this._pauseAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportPause;
+ this._skipForwardAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportSkipForward;
+ this._skipForwardHoldAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportSkipForwardHold;
+ if (this._volumeAction) {
+ this._volumeAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportVolume;
+ this._volumeHoldAction.automationId = MS.Entertainment.UI.AutomationIds.nowPlayingTransportVolumeHold
+ }
+ this._skipBackAction.icon = null;
+ this._skipBackHoldAction.icon = null;
+ this._playAction.icon = null;
+ this._pauseAction.icon = null;
+ this._skipForwardAction.icon = null;
+ this._skipForwardHoldAction.icon = null;
+ if (this._volumeAction) {
+ this._volumeAction.icon = null;
+ this._volumeHoldAction.icon = null
+ }
+ this._skipBackAction.title = null;
+ this._skipBackHoldAction.title = null;
+ this._playAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PLAY_BUTTON);
+ this._pauseAction.title = String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON);
+ this._skipForwardAction.title = null;
+ this._skipForwardHoldAction.title = null;
+ if (this._volumeAction) {
+ this._volumeAction.title = null;
+ this._volumeHoldAction.title = null
+ }
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ this.nowPlayingSkipBackVisible = true;
+ this.nowPlayingSkipForwardVisible = true;
+ this._skipForwardAction.title = String.load(String.id.IDS_MUSIC2_APP_MENU_NEXT_SONG_BUTTON_VUI_GUI);
+ this._skipBackAction.title = String.load(String.id.IDS_MUSIC2_APP_MENU_PREVIOUS_SONG_BUTTON_VUI_GUI)
+ }
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlaying.html b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlaying.html
new file mode 100644
index 00000000..49346c23
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlaying.html
@@ -0,0 +1,84 @@
+
+
+
+
+ NowPlaying
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlaying.js b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlaying.js
new file mode 100644
index 00000000..64a1b5fc
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlaying.js
@@ -0,0 +1,234 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/corefx.js", "/Framework/utilities.js", "/Framework/servicelocator.js");
+ var UnsnapButtonAction = MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function unsnapAction() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.unsnapButtonAction, executed: function executed(parameter) {
+ parameter.appIconClick()
+ }, canExecute: function canExecute(parameter) {
+ return true
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SnappedNowPlaying: MS.Entertainment.UI.Framework.defineUserControl("/Controls/NowPlaying/SnappedNowPlaying.html#template", function snappedNowPlayingConstructor(element, options) {
+ this._bindingsToDetach = [];
+ this._unsnapAction = new UnsnapButtonAction;
+ this._unsnapAction.parameter = this
+ }, {
+ _initialized: false, _bindingsToDetach: null, _unsnapAction: null, _deferredUpdateTimer: null, _uiStateEventHandler: null, _ratingImageVisible: false, _ratingImageVisiblePromise: null, _ratingImageUrl: String.empty, initialize: function initialize() {
+ this.delayInitialize()
+ }, _delayInitialized: function _delayInitialized() {
+ if (this._uiStateEventHandler) {
+ this._uiStateEventHandler.cancel();
+ this._uiStateEventHandler = null
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this.options = {};
+ this._loadAppIcon();
+ this.appTitleLabel.displayText = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).applicationTitle;
+ var displayText = String.empty;
+ if (MS.Entertainment.Utilities.isVideoApp2) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var hasMarketplace = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ displayText = hasMarketplace ? String.load(String.id.IDS_VIDEO2_SNAPPED_UNSNAP_LONG_TEXT) : String.load(String.id.IDS_VIDEO2_WELCOME_DIALOG_TITLE_NO_MARKETPLACE)
+ }
+ this.appSnappedSecondaryText.displayText = displayText;
+ this.secondaryTextVisible = MS.Entertainment.Utilities.isVideoApp2;
+ this._setUnsnapButtonText();
+ this._snappedDetails.bind("detailsReady", function metadataImageChanged() {
+ WinJS.Promise.timeout().then(function _delay() {
+ this.visible = !MS.Entertainment.Utilities.isVideoApp2;
+ if (this.appIconVisible) {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.unsnapButton.domElement, true);
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.hide)
+ appBar.hide()
+ }
+ else {
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.show)
+ appBar.show()
+ }
+ }.bind(this));
+ this._updateStates()
+ }.bind(this));
+ this.playbackSession = sessionMgr.primarySession;
+ this._nowPlayingMetadata.bind("nowPlayingImageUri", function metadataImageChanged() {
+ this.nowPlayingImageUri = this._nowPlayingMetadata.nowPlayingImageUri
+ }.bind(this));
+ this._nowPlayingMetadata.bind("backgroundImageUri", function metadataBackgroundChanged() {
+ this.backgroundImageUri = this._nowPlayingMetadata.backgroundImageUri
+ }.bind(this));
+ this.repossessNowPlaying();
+ if (this.ratingImage && MS.Entertainment.Platform.PlaybackHelpers.shouldDisplayRatingImage() && this._ratingImageUrl !== String.empty)
+ this.ratingImageVisible = true;
+ this._initialized = true
+ }
+ else
+ this._uiStateEventHandler = MS.Entertainment.Utilities.addEventHandlers(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {stageThreeActivatedChanged: function stageThreeActivatedChanged(e) {
+ if (e.detail.newValue)
+ this._delayInitialized()
+ }.bind(this)})
+ }, _setUnsnapButtonText: function _setUnsnapButtonText() {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this.unsnapButton.text = String.load(String.id.IDS_SNAPPED_MUSIC_UNSNAP_TEXT);
+ else if (MS.Entertainment.Utilities.isVideoApp1)
+ this.unsnapButton.text = String.load(String.id.IDS_SNAPPED_VIDEO_UNSNAP_TEXT);
+ else if (MS.Entertainment.Utilities.isVideoApp2) {
+ this.unsnapButton.text = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_GUI);
+ this.unsnapVoicePhrase = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_ALM);
+ this.unsnapVoicePhoneticPhrase = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_PRON);
+ this.unsnapVoiceConfidence = String.load(String.id.IDS_GO_FULL_SCREEN_VUI_CONF)
+ }
+ else
+ MS.Entertainment.fail("Unable to find text for unsnap button.")
+ }, _loadAppIcon: function _loadAppIcon() {
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this.currentAppIconClass = "snappedAppIcon snappedMusicAppIcon";
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ this.currentAppIconClass = "snappedAppIcon snappedVideoAppIcon";
+ else
+ this.currentAppIconClass = "snappedAppIcon snappedGenericAppIcon"
+ }, _detachBindings: function _detachBindings() {
+ this._bindingsToDetach.forEach(function(e) {
+ e.source.unbind(e.name, e.action)
+ });
+ this._bindingsToDetach = []
+ }, _initializeBinding: function _initializeBinding(source, name, action) {
+ source.bind(name, action);
+ this._bindingsToDetach.push({
+ source: source, name: name, action: action
+ })
+ }, unload: function unload() {
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ this._detachBindings();
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.hide)
+ appBar.hide();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ this._snappedDetails.playbackSession = this.playbackSession;
+ if (this.playbackSession) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._initializeBinding(uiStateService, "isSnapped", function isSnappedChanged() {
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ this.visible = false;
+ if (this._nowPlayingThumbnail.children.length > 0) {
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.repossessNowPlaying)
+ appBar.repossessNowPlaying()
+ }
+ }
+ }.bind(this));
+ this._initializeBinding(this.playbackSession, "currentMedia", this._mediaChanged.bind(this));
+ this._initializeBinding(this.playbackSession, "currentTransportState", this._mediaStateChanged.bind(this))
+ }
+ }, repossessNowPlaying: function repossessNowPlaying() {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ sessionMgr.relocateSession(this._nowPlayingThumbnail, false)
+ }, _mediaChanged: function _mediaChanged() {
+ this._snappedDetails.updateModelItem(this.playbackSession.currentMedia);
+ this._nowPlayingMetadata.modelItem = this.playbackSession.currentMedia;
+ if (this.playbackSession.currentMedia) {
+ this.appIconVisible = false;
+ this.videoMiniSnappedViewVisible = false;
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.show)
+ appBar.show();
+ this.repossessNowPlaying();
+ MS.Entertainment.Platform.PlaybackHelpers.getVideoRatingImageAsync().done(function getRatingImageComplete(ratingImage) {
+ if (ratingImage === String.empty) {
+ this.ratingImage = String.empty;
+ this.ratingImageVisible = false
+ }
+ else {
+ this.ratingImage = ratingImage;
+ this.ratingImageVisible = true
+ }
+ }.bind(this), function getRatingImageError() {
+ this.ratingImage = String.empty
+ }.bind(this))
+ }
+ else if (Windows.UI.ViewManagement.ViewSizePreference && MS.Entertainment.Utilities.isVideoApp1) {
+ this.appIconVisible = false;
+ this.videoMiniSnappedViewVisible = true
+ }
+ else {
+ this.appIconVisible = true;
+ this.unsnapButtonVisible = true
+ }
+ }, _mediaStateChanged: function _mediaStateChanged() {
+ this._updateStates()
+ }, _updateStates: function _updateStates() {
+ if (this._deferredUpdateTimer)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ }, _updateStatesDeferred: function _updateStatesDeferred() {
+ this._deferredUpdateTimer = null;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.enabled = this.playbackSession && this.playbackSession.currentMedia;
+ this.videoVisible = false;
+ this.artVisible = false;
+ this.toggleButtonVisible = true;
+ if (this.playbackSession && this.playbackSession.currentMedia)
+ switch (this.playbackSession.currentMedia.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ this.artVisible = true;
+ this.videoVisible = false;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ this.videoHeight = (this.playbackSession.videoHeight * (320 / this.playbackSession.videoWidth)) + "px";
+ this.videoVisible = true;
+ this.artVisible = false;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ if (this.playbackSession.canControlMedia) {
+ this.videoHeight = (this.playbackSession.videoHeight * (320 / this.playbackSession.videoWidth)) + "px";
+ this.videoVisible = true;
+ this.artVisible = false
+ }
+ break;
+ default:
+ break
+ }
+ }, ratingImageVisible: {
+ get: function() {
+ return this._ratingImageVisible
+ }, set: function(value) {
+ if (this._ratingImageVisible !== value) {
+ this._ratingImageVisible = value;
+ if (this._ratingImageVisiblePromise) {
+ this._ratingImageVisiblePromise.cancel();
+ this._ratingImageVisiblePromise = null
+ }
+ this._ratingImageVisiblePromise = MS.Entertainment.Utilities.toggleDisplayCollapseElement(this._ratingImageContainer, value).then(function clearPromise() {
+ this._ratingImageVisiblePromise = null
+ }.bind(this), function ignoreError(){})
+ }
+ }
+ }, ratingImage: {
+ get: function() {
+ return this._ratingImage
+ }, set: function(value) {
+ this._ratingImageUrl = value;
+ this.updateAndNotify("videoRatingImage", value)
+ }
+ }
+ }, {
+ visible: false, enabled: false, playbackSession: null, options: null, appIconVisible: true, videoMiniSnappedViewVisible: false, unsnapButtonVisible: MS.Entertainment.Utilities.isVideoApp2, toggleButtonVisible: false, detailsVisible: !MS.Entertainment.Utilities.isVideoApp2, artVisible: false, videoVisible: false, videoHeight: "240px", backgroundVisible: false, nowPlayingImageUri: String.empty, backgroundImageUri: String.empty, currentAppIconClass: String.empty, secondaryTextVisible: false, unsnapVoicePhrase: String.empty, unsnapVoicePhoneticPhrase: String.empty, unsnapVoiceConfidence: String.empty, appIconClick: function appIconClick() {
+ var appView = Windows.UI.ViewManagement.ApplicationView;
+ if (appView)
+ if (Windows.Xbox)
+ appView.tryUnsnapToFullscreen();
+ else
+ appView.tryUnsnap()
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingMetadata.html b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingMetadata.html
new file mode 100644
index 00000000..eff8a686
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingMetadata.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Now Playing Metadata Template
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingMetadata.js b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingMetadata.js
new file mode 100644
index 00000000..fca3d0cb
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingMetadata.js
@@ -0,0 +1,3 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js");
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SnappedNowPlayingMetadata: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.NowPlayingMetadata", "/Controls/NowPlaying/SnappedNowPlayingMetadata.html#nowPlayingMetadataTemplate")})
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingPlaylist.js b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingPlaylist.js
new file mode 100644
index 00000000..4de3d3be
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingPlaylist.js
@@ -0,0 +1,3 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Controls/NowPlaying/NowPlayingPlaylist.js", "/Framework/corefx.js");
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NowPlayingPlaylistSnapped: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.NowPlayingPlaylist", "/Controls/NowPlaying/NowPlayingPlaylist.html#nowPlayingPlaylistTemplateSnapped", null, {galleryTemplate: MS.Entertainment.UI.Controls.NowPlayingPlaylistTemplates && MS.Entertainment.UI.Controls.NowPlayingPlaylistTemplates.snappedNowPlaying})})
diff --git a/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingPlaylistFlipView.js b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingPlaylistFlipView.js
new file mode 100644
index 00000000..74da5d89
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/NowPlaying/SnappedNowPlayingPlaylistFlipView.js
@@ -0,0 +1,3 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Controls/NowPlaying/NowPlayingPlaylist.js", "/Framework/corefx.js");
+WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NowPlayingPlaylistSnappedFlipView: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.NowPlayingPlaylist", "/Controls/NowPlaying/NowPlayingPlaylist.html#nowPlayingPlaylistFlipViewTemplate")})
diff --git a/packages/microsoft.zunevideo/controls/Overlay.html b/packages/microsoft.zunevideo/controls/Overlay.html
new file mode 100644
index 00000000..88ae56d3
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Overlay.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Overlay Control Template
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/PivotControls.html b/packages/microsoft.zunevideo/controls/PivotControls.html
new file mode 100644
index 00000000..d2b5595d
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/PivotControls.html
@@ -0,0 +1,83 @@
+
+
+
+
+ Navigation Controls Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/PleaseResizeDialog.js b/packages/microsoft.zunevideo/controls/PleaseResizeDialog.js
new file mode 100644
index 00000000..7345bf28
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/PleaseResizeDialog.js
@@ -0,0 +1,79 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var PleaseResizeDialog = (function(_super) {
+ __extends(PleaseResizeDialog, _super);
+ function PleaseResizeDialog(element, options) {
+ var _this = this;
+ this.templateName = "pleaseResizeDialog";
+ this.templateStorage = "/Controls/PleaseResizeDialog.html";
+ _super.call(this, element, options);
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._uiStateHandlers = MS.Entertainment.UI.Framework.addEventHandlers(this._uiStateService, {isSnappedChanged: function(e) {
+ var snapped = WinJS.Utilities.getMember("detail.newValue", e);
+ if (snapped)
+ return;
+ var dismissEvent = document.createEvent("CustomEvent");
+ dismissEvent.initEvent("dismissoverlay", true, true);
+ _this.domElement.dispatchEvent(dismissEvent)
+ }})
+ }
+ PleaseResizeDialog.prototype.initialize = function() {
+ if (this.resizeImage)
+ this.resizeImage.target = PleaseResizeDialog.RESIZE_IMAGE_URL + MS.Entertainment.Utilities.getPackageImageFileExtension()
+ };
+ PleaseResizeDialog.prototype.unload = function() {
+ if (this._uiStateHandlers) {
+ this._uiStateHandlers.cancel();
+ this._uiStateHandlers = null
+ }
+ _super.prototype.unload.call(this)
+ };
+ PleaseResizeDialog.waitForWindowResize = function(disallowUserDismiss) {
+ var existingDialogSignal = MS.Entertainment.UI.Controls.PleaseResizeDialog._currentCompletionSignal;
+ if (existingDialogSignal) {
+ existingDialogSignal.error(new Error("Canceled"));
+ existingDialogSignal = new MS.Entertainment.UI.Framework.Signal;
+ MS.Entertainment.UI.Controls.PleaseResizeDialog._currentCompletionSignal = existingDialogSignal;
+ return existingDialogSignal.promise
+ }
+ var options = {
+ customStyle: "template-resizeDialog", disallowUserDismiss: disallowUserDismiss
+ };
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_WEBHOST_RESIZE_WINDOW_TITLE), MS.Entertainment.UI.Controls.PleaseResizeDialog, options).done(function(dialog) {
+ var dialogSignal = MS.Entertainment.UI.Controls.PleaseResizeDialog._currentCompletionSignal;
+ if (dialog && dialog.wasCancelled)
+ dialogSignal.promise.cancel();
+ else
+ dialogSignal.complete();
+ MS.Entertainment.UI.Controls.PleaseResizeDialog._currentCompletionSignal = null
+ });
+ var dialogDismissed = new MS.Entertainment.UI.Framework.Signal;
+ MS.Entertainment.UI.Controls.PleaseResizeDialog._currentCompletionSignal = dialogDismissed;
+ return dialogDismissed.promise
+ };
+ PleaseResizeDialog.RESIZE_IMAGE_URL = "/images/WebDialogResize/Expand_Screen_Icon.";
+ return PleaseResizeDialog
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.PleaseResizeDialog = PleaseResizeDialog
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.PleaseResizeDialog)
diff --git a/packages/microsoft.zunevideo/controls/PopOver.html b/packages/microsoft.zunevideo/controls/PopOver.html
new file mode 100644
index 00000000..53966bfd
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/PopOver.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ Overlay Control Template
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/SearchFlyout.html b/packages/microsoft.zunevideo/controls/SearchFlyout.html
new file mode 100644
index 00000000..f813947a
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/SearchFlyout.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/SearchFlyout.js b/packages/microsoft.zunevideo/controls/SearchFlyout.js
new file mode 100644
index 00000000..299c368b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/SearchFlyout.js
@@ -0,0 +1,64 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var SearchFlyout = (function(_super) {
+ __extends(SearchFlyout, _super);
+ function SearchFlyout(element, options) {
+ _super.call(this, element, options)
+ }
+ Object.defineProperty(SearchFlyout.prototype, "templateStorage", {
+ get: function() {
+ return "/Controls/SearchFlyout.html"
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(SearchFlyout.prototype, "templateName", {
+ get: function() {
+ return "control-searchFlyout"
+ }, enumerable: true, configurable: true
+ });
+ SearchFlyout.prototype.initialize = function() {
+ var _this = this;
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function() {
+ if (_this._searchBox && _this._searchBox.element)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(_this._searchBox.element)
+ })
+ };
+ SearchFlyout.prototype.unload = function() {
+ _super.prototype.unload.call(this)
+ };
+ SearchFlyout.prototype.searchQuerySubmitted = function(event) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ return MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSubmitted({
+ language: event.detail.language, queryText: event.detail.queryText
+ })
+ };
+ SearchFlyout.prototype.searchSuggestionsRequested = function(event) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ return MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSuggestionRequested({
+ language: event.detail.language, linguisticDetails: event.detail.linguisticDetails, queryText: event.detail.queryText, request: event.detail
+ })
+ };
+ return SearchFlyout
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.SearchFlyout = SearchFlyout
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.SearchFlyout)
diff --git a/packages/microsoft.zunevideo/controls/ShowMore.html b/packages/microsoft.zunevideo/controls/ShowMore.html
new file mode 100644
index 00000000..b48bce5b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ShowMore.html
@@ -0,0 +1,19 @@
+
+
+
+
+
+ Show More Control
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/SignInControl.html b/packages/microsoft.zunevideo/controls/SignInControl.html
new file mode 100644
index 00000000..50e051e4
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/SignInControl.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+ Sign In Control Template
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/SignInControl.js b/packages/microsoft.zunevideo/controls/SignInControl.js
new file mode 100644
index 00000000..6118b190
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/SignInControl.js
@@ -0,0 +1,114 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var SignInControl = (function(_super) {
+ __extends(SignInControl, _super);
+ function SignInControl(element, options) {
+ this.templateStorage = "/Controls/SignInControl.html";
+ this.templateName = "signInControlTemplate";
+ _super.call(this, element, options)
+ }
+ SignInControl.prototype.initialize = function() {
+ var _this = this;
+ _super.prototype.initialize.call(this);
+ this._signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ this._navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._navigationBinding = WinJS.Binding.bind(this._navigation, {currentPage: function() {
+ return _this._onPropertyChange()
+ }})
+ }
+ this._signInBinding = WinJS.Binding.bind(this._signIn, {
+ isSigningIn: function() {
+ return _this._onPropertyChange()
+ }, signInError: function() {
+ return _this._onPropertyChange()
+ }
+ });
+ this._uiStateBinding = WinJS.Binding.bind(this._uiState, {isHubStripVisible: function() {
+ return _this._onPropertyChange()
+ }})
+ };
+ SignInControl.prototype.unload = function() {
+ if (this._signInBinding) {
+ this._signInBinding.cancel();
+ this._signInBinding = null
+ }
+ if (this._uiStateBinding) {
+ this._uiStateBinding.cancel();
+ this._uiStateBinding = null
+ }
+ if (this._navigationBinding) {
+ this._navigationBinding.cancel();
+ this._uiStateBinding = null
+ }
+ _super.prototype.unload.call(this)
+ };
+ SignInControl.prototype.onClick = function() {
+ if (!this._signIn.isSigningIn)
+ this._signIn.signIn().done(null, function signInError(){})
+ };
+ SignInControl.prototype._onPropertyChange = function() {
+ var _this = this;
+ var isSigningIn = this._signIn.isSigningIn;
+ var signInError = (this._signIn.signInError !== 0);
+ var hubStripVisible = this._uiState.isHubStripVisible;
+ var showNotifications = this.settings || (this._navigation && this._navigation.currentPage && this._navigation.currentPage.showNotifications);
+ if (isSigningIn)
+ this._showSignedIn = true;
+ else if (signInError)
+ this._showSignedIn = false;
+ var signInNotification = (isSigningIn || signInError || this._showSignedIn);
+ this.visibility = signInNotification && (this.settings || hubStripVisible) && showNotifications;
+ if (signInError) {
+ WinJS.Utilities.removeClass(this._signInError.domElement, "hideFromDisplay");
+ WinJS.Utilities.removeClass(this._signInRetry.domElement, "hideFromDisplay")
+ }
+ else {
+ WinJS.Utilities.addClass(this._signInError.domElement, "hideFromDisplay");
+ WinJS.Utilities.addClass(this._signInRetry.domElement, "hideFromDisplay")
+ }
+ if (isSigningIn)
+ WinJS.Utilities.removeClass(this._signInProgress.domElement, "hideFromDisplay");
+ else
+ WinJS.Utilities.addClass(this._signInProgress.domElement, "hideFromDisplay");
+ if (this._showSignedIn && !signInError && !isSigningIn) {
+ WinJS.Utilities.removeClass(this._signInComplete.domElement, "hideFromDisplay");
+ WinJS.Promise.timeout(2500).then(function() {
+ WinJS.Utilities.addClass(_this._signInComplete.domElement, "hideFromDisplay");
+ _this.visibility = false
+ });
+ this._showSignedIn = false
+ }
+ else
+ WinJS.Utilities.addClass(this._signInComplete.domElement, "hideFromDisplay");
+ if (isSigningIn)
+ WinJS.Utilities.addClass(this._signInRetrySpinner, "spinNoticationRetrySpinner");
+ else
+ WinJS.Utilities.removeClass(this._signInRetrySpinner, "spinNoticationRetrySpinner")
+ };
+ return SignInControl
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.SignInControl = SignInControl;
+ WinJS.Utilities.markSupportedForProcessing(SignInControl)
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/controls/StarRatingControl.html b/packages/microsoft.zunevideo/controls/StarRatingControl.html
new file mode 100644
index 00000000..be24acdd
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/StarRatingControl.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+ Star Rating Control Template
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/ToggleModifier.html b/packages/microsoft.zunevideo/controls/ToggleModifier.html
new file mode 100644
index 00000000..e010ed0f
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ToggleModifier.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+ Toggle Modifier Control Template
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/ToggleModifier.js b/packages/microsoft.zunevideo/controls/ToggleModifier.js
new file mode 100644
index 00000000..4b22b556
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/ToggleModifier.js
@@ -0,0 +1,93 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ToggleModifier: MS.Entertainment.UI.Framework.defineUserControl("/Controls/ToggleModifier.html#toggleModifierTemplate", function modifierConstructor() {
+ this._observableArrayChanged = this._observableArrayChanged.bind(this);
+ this.selectionManager = new MS.Entertainment.UI.Framework.SelectionManager
+ }, {
+ _selectionManagerBindings: null, openPopup: null, minItems: 0, identifier: "", initialize: function initialize() {
+ this.bind("items", this._itemsChanged.bind(this));
+ this.bind("selectedItem", this._selectedItemChanged.bind(this));
+ this._selectionManagerBindings = WinJS.Binding.bind(this, {selectionManager: {selectedIndex: this._selectionManagerSelectionChanged.bind(this)}})
+ }, unload: function unload() {
+ if (this._selectionManagerBindings) {
+ this._selectionManagerBindings.cancel();
+ this._selectionManagerBindings = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, setTabPanel: function setTabPanel(tabPanel) {
+ MS.Entertainment.Framework.AccUtils.createAndAddAriaLink(this.domElement, tabPanel, "aria-controls")
+ }, _itemsChanged: function _itemsChanged(newValue, oldValue) {
+ if (oldValue && oldValue instanceof MS.Entertainment.ObservableArray)
+ oldValue.removeChangeListener(this._observableArrayChanged);
+ if (newValue && newValue instanceof MS.Entertainment.ObservableArray)
+ newValue.addChangeListener(this._observableArrayChanged);
+ if (this.selectionManager)
+ this.selectionManager.dataSource = this.items;
+ this._constrainSelectedItem();
+ if (!isNaN(this.tabIndex))
+ if (this.items && this.items.length > 1)
+ this._modifierContainer.setAttribute("tabindex", this.tabIndex);
+ else
+ this._modifierContainer.setAttribute("tabIndex", -1)
+ }, _observableArrayChanged: function _observableArrayChanged() {
+ this._constrainSelectedItem()
+ }, _selectedItemChanged: function _selectedItemChanged() {
+ var label;
+ var labelType;
+ this._constrainSelectedItem();
+ if (this.selectionManager)
+ this.selectionManager.selectedItem = this.selectedItem;
+ label = this.selectedItem ? this.selectedItem.label : "";
+ labelType = typeof label;
+ switch (labelType) {
+ case"string":
+ this.labelControl.stringId = null;
+ this.labelControl.text = label;
+ break;
+ case"number":
+ this.labelControl.text = null;
+ this.labelControl.stringId = label;
+ label = String.load(label);
+ break;
+ default:
+ MS.Entertainment.UI.Controls.assert(false, "Unrecognized label type in modifier control.");
+ break
+ }
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceModifierControl_SelectionChanged(label, this.identifier)
+ }, _selectionManagerSelectionChanged: function _selectionManagerSelectionChanged(newValue, oldValue) {
+ if (oldValue !== undefined)
+ this.selectedItem = this.selectionManager.selectedItem
+ }, _constrainSelectedItem: function _constrainSelectedItem() {
+ if (!this.items)
+ this.selectedItem = null;
+ else if (this.items.length <= this.minItems)
+ this.selectedItem = null;
+ else if (this.items.indexOf(WinJS.Binding.unwrap(this.selectedItem)) < 0)
+ this.selectedItem = this.selectionManager.selectedItem
+ }, onKeyDown: function onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onClicked()
+ }, onClicked: function onClicked() {
+ if (!this.items || this.items.length <= 1)
+ return;
+ var index = this.items.indexOf(WinJS.Binding.unwrap(this.selectedItem));
+ index = (index + 1) % this.items.length;
+ var oldSelectedItem = this.selectedItem;
+ this.selectedItem = this.getItem(index);
+ this._selectedItemChanged(this.selectedItem, oldSelectedItem)
+ }, getItem: function getItem(index) {
+ var items = WinJS.Binding.unwrap(this.items);
+ if (items instanceof MS.Entertainment.ObservableArray)
+ return items.item(index);
+ else if (Array.isArray(items))
+ return items[index];
+ else
+ MS.Entertainment.UI.Controls.assert(false, "Unrecognized items list type in modifier control.")
+ }
+ }, {
+ tabIndex: 0, items: null, selectedItem: null, selectionManager: null, descriptionLabel: null, descriptionLabelText: null
+ }, null)})
+})()
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/SeekBar.html b/packages/microsoft.zunevideo/controls/TransportControls/SeekBar.html
new file mode 100644
index 00000000..07e34f20
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/SeekBar.html
@@ -0,0 +1,76 @@
+
+
+
+
+ SeekBar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/SeekBar.js b/packages/microsoft.zunevideo/controls/TransportControls/SeekBar.js
new file mode 100644
index 00000000..6dc44eed
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/SeekBar.js
@@ -0,0 +1,516 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/controls/playbackcontrol.js", "/Framework/corefx.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SeekBar: MS.Entertainment.UI.Framework.defineUserControl("/Controls/TransportControls/SeekBar.html#seekBarTemplate", function(element, options) {
+ this._renderLoop = this._renderLoop.bind(this);
+ this._updateSize = this._updateSize.bind(this)
+ }, {
+ _initialized: false, _uiStateService: MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), _bindings: null, _cachedValues: {
+ _trackWidth: 0, _seekbarPosition: 0, _thumbWidth: 0, msScrollLimitXMax: 0
+ }, _scrubValue: 0, _lastAriaSliderUpdate: 0, _musicThumbOffset: 30, _isKeyDownOnThumb: false, initialize: function initialize() {
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this.bind("metadataVisible", this._updateValues.bind(this));
+ this.bind("visibility", this._visibilityChanged.bind(this));
+ var handlePointerEvent = this._onPointerEvent.bind(this);
+ this._track.addEventListener("keydown", this._onKeyDownEvent.bind(this), true);
+ this._thumb.addEventListener("keyup", this._onKeyUpEvent.bind(this), true);
+ this._scroller.addEventListener("keydown", this._onKeyDownEvent.bind(this), true);
+ this._scroller.addEventListener("MSPointerDown", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerUp", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerMove", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerdown", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerup", handlePointerEvent, true);
+ this._scroller.addEventListener("pointermove", handlePointerEvent, true);
+ this._scroller.addEventListener("MSManipulationStateChanged", handlePointerEvent, true);
+ this._scroller.addEventListener("scroll", this._scrollPositionChanged.bind(this), true);
+ this._scroller.addEventListener("MSHoldVisual", function(e) {
+ e.preventDefault()
+ });
+ MS.Entertainment.Utilities.attachResizeEvent(this.domElement, this._updateSize);
+ this._initialized = true
+ }, _visibilityChanged: function _visibilityChanged(newVal) {
+ if (newVal)
+ this._updateSize()
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ }, freeze: function seekBar_freeze() {
+ if (this.frozen) {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ return
+ }
+ this._detachBindings();
+ this.frozen = true;
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function seekBar_thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this.frozen = false;
+ if (this._initialized)
+ this._playbackSessionChanged();
+ this._updateSize()
+ }, unload: function unload() {
+ this._detachBindings();
+ MS.Entertainment.Utilities.detachResizeEvent(this.domElement, this._updateSize);
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _updateSize: function _updateSize() {
+ if (this._track) {
+ this._cachedValues._seekbarPosition = WinJS.Utilities.getPosition(this._track);
+ this._cachedValues._trackWidth = this._track.clientWidth
+ }
+ if (this._thumb)
+ this._cachedValues._thumbWidth = this._thumb.clientWidth;
+ if (this._scroller) {
+ this._scroller.style.msScrollLimitXMin = "0px";
+ if (this.playbackSession && MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ this._scroller.style.msScrollLimitXMax = this._scroller.clientWidth - (this._cachedValues._thumbWidth * 6) + "px";
+ else
+ this._scroller.style.msScrollLimitXMax = this._scroller.clientWidth - (this._cachedValues._thumbWidth * 2) + "px";
+ this._cachedValues.msScrollLimitXMax = this._scroller.style.msScrollLimitXMax;
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth))
+ }
+ this._mediaPositionChanged()
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ if (this.playbackSession)
+ this._bindings = WinJS.Binding.bind(this, {
+ playbackSession: {
+ currentMedia: this._mediaChanged.bind(this), currentPosition: this._mediaPositionChanged.bind(this), currentTransportState: this._playbackStateChanged.bind(this)
+ }, _uiStateService: {
+ isSnapped: this._snappedStateChanged.bind(this), isFullScreenVideo: this._fullScreenVideoChanged.bind(this)
+ }
+ });
+ this._updateValues();
+ this._updateAriaSliderValues(true)
+ }, _playbackStateChanged: function _playbackStateChanged() {
+ this._updateAriaSliderValues(true)
+ }, _snappedStateChanged: function _snappedStateChanged(newVal) {
+ if (!newVal) {
+ this._updatePosition();
+ this._updateAriaSliderValues(true)
+ }
+ }, _fullScreenVideoChanged: function _fullScreenVideoChanged(isFullScreenVideo) {
+ if (!isFullScreenVideo) {
+ this._updatePosition();
+ this._updateAriaSliderValues(true)
+ }
+ }, _mediaChanged: function _mediaChanged() {
+ this._updatePosition();
+ this._updateAriaSliderValues();
+ this._updateNowPlayingText()
+ }, _mediaPositionChanged: function _mediaPositionChanged() {
+ if (document.hidden)
+ return;
+ this._updatePosition();
+ this._updateAriaSliderValues()
+ }, _updateNowPlayingText: function _updateNowPlayingText() {
+ this.nowPlayingText = String.load(String.id.IDS_HOME_NOW_PLAYING)
+ }, _updatePosition: function _updatePosition() {
+ if (this.frozen || !this.playbackSession)
+ return;
+ var durationMs = this.playbackSession.duration;
+ var positionMs = this.playbackSession.currentPosition;
+ positionMs = Math.min(durationMs, positionMs);
+ this.max = durationMs;
+ this.min = 0;
+ if (!this.isManipulating) {
+ MS.Entertainment.Framework.AccUtils.setAriaSliderBounds(this._track, this.min, this.max);
+ this.value = positionMs;
+ this._updateValues()
+ }
+ }, _scrollPositionChanged: function _scrollPositionChanged() {
+ if (this.disabled)
+ return;
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ var percentage = (scrollableWidth - this._scroller.scrollLeft) / scrollableWidth;
+ var newPosition = (this.max - this.min) * percentage + this.min;
+ this._scrubValue = newPosition;
+ this._scrubValue = this._scrubValue < 0 ? 0 : this._scrubValue;
+ this._scrubValue = this._scrubValue > this.max ? this.max : this._scrubValue
+ }, _captureSeekBarInput: function _captureSeekBarInput(e) {
+ if (e.pointerId && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType)) && this._scroller)
+ this._scroller.msSetPointerCapture(e.pointerId);
+ if (!this.isManipulating) {
+ this.metadataVisible = false;
+ this.isManipulating = true;
+ this._engage()
+ }
+ this._seekBarMove(e)
+ }, _releaseSeekBarInput: function _releaseSeekBarInput(e) {
+ if (this.isManipulating) {
+ this.isManipulating = false;
+ this.metadataVisible = true;
+ if (e.pointerId && this._isTouchPointerType(e.pointerType))
+ this._scrollPositionChanged();
+ else if (e.pointerId && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType)))
+ this._scroller.msReleasePointerCapture(e.pointerId);
+ this._disengage();
+ this._updatePlaybackSession();
+ this._updateValues();
+ this._updateAriaSliderValues(true)
+ }
+ }, _seekBarMove: function _seekBarMove(e, forceUpdate) {
+ if (!this._scroller)
+ return;
+ if (forceUpdate || (this.isManipulating && e.eventPhase === e.AT_TARGET && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType))))
+ if (this.playbackSession && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + 40;
+ else
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + this._musicThumbOffset
+ }, _onPointerEvent: function _onPointerEvent(e) {
+ if (this.disabled)
+ return;
+ switch (e.type) {
+ case"MSManipulationStateChanged":
+ if (e.currentState === e.MS_MANIPULATION_STATE_STOPPED || e.currentState === e.MS_MANIPULATION_STATE_INERTIA) {
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollLeft;
+ this._releaseSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case"MSPointerDown":
+ case"pointerdown":
+ if (!this.playbackSession || !this.playbackSession.canSeek)
+ return;
+ if (e.eventPhase === e.AT_TARGET) {
+ if (this._scroller) {
+ var offset = 0;
+ if (!MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ offset = this._cachedValues._thumbWidth;
+ else
+ offset = this._musicThumbOffset;
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + offset
+ }
+ this._scrollPositionChanged();
+ this.value = this._scrubValue;
+ this._updateValues();
+ this._updateAriaSliderValues(true);
+ this._updatePlaybackSession();
+ this._releaseSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case"MSPointerUp":
+ case"pointerup":
+ case"MSPointerCancel":
+ case"pointercancel":
+ this._releaseSeekBarInput(e);
+ e.cancelBubble = true;
+ break;
+ case"MSPointerMove":
+ case"pointermove":
+ this._seekBarMove(e);
+ e.cancelBubble = true;
+ e.stopImmediatePropagation();
+ break
+ }
+ }, _onKeyDownEvent: function _onKeyDownEvent(e) {
+ if (this.disabled)
+ return;
+ if (e && this.playbackSession && this.playbackSession.canSeek) {
+ var newPositionMs = this.value;
+ if (e.keyCode === WinJS.Utilities.Key.leftArrow) {
+ this._isKeyDownOnThumb = true;
+ if (e.ctrlKey)
+ newPositionMs -= this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.ctrlSkipPercentage);
+ else if (e.shiftKey)
+ newPositionMs -= MS.Entertainment.UI.Controls.SeekBar.shiftSkipMs;
+ else
+ newPositionMs -= this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.defaultSkipPercentage)
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow) {
+ this._isKeyDownOnThumb = true;
+ if (e.ctrlKey)
+ newPositionMs += this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.ctrlSkipPercentage);
+ else if (e.shiftKey)
+ newPositionMs += MS.Entertainment.UI.Controls.SeekBar.shiftSkipMs;
+ else
+ newPositionMs += this._percentageToMilliseconds(MS.Entertainment.UI.Controls.SeekBar.defaultSkipPercentage)
+ }
+ if (newPositionMs !== this.value) {
+ this.value = newPositionMs;
+ this._updateValues();
+ this._updateAriaSliderValues(true);
+ this._updatePlaybackSession();
+ e.preventDefault()
+ }
+ }
+ }, _onKeyUpEvent: function _onKeyUpEvent(e) {
+ if (this.disabled)
+ return;
+ this._isKeyDownOnThumb = false
+ }, _engage: function _engage() {
+ WinJS.Utilities.addClass(this._thumb, "seekBarThumbEngaged");
+ WinJS.Utilities.addClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (this.playbackSession && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ WinJS.Utilities.addClass(this._track, "seekBarTrackEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = false;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = false
+ }
+ window.requestAnimationFrame(this._renderLoop)
+ }, _disengage: function _disengage() {
+ WinJS.Utilities.removeClass(this._thumb, "seekBarThumbEngaged");
+ WinJS.Utilities.removeClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (this.playbackSession && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ WinJS.Utilities.removeClass(this._track, "seekBarTrackEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = true;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = true
+ }
+ this.value = this._scrubValue
+ }, _percentageToMilliseconds: function _percentageToMilliseconds(percentage) {
+ percentage = percentage < 0 ? 0 : percentage;
+ percentage = percentage > 100 ? 100 : percentage;
+ return this.min + ((percentage * (this.max - this.min)) / 100)
+ }, _millisecondsToDecimal: function _millisecondsToDecimal(milliseconds) {
+ milliseconds = milliseconds < 0 ? 0 : milliseconds;
+ milliseconds = milliseconds > this.max ? this.max : milliseconds;
+ var newPosition = (milliseconds - this.min) / (this.max - this.min);
+ newPosition = isNaN(newPosition) ? 0 : newPosition;
+ return newPosition
+ }, _millisecondsToPercentage: function _millisecondsToPercentage(milliseconds) {
+ return (this._millisecondsToDecimal(milliseconds) * 100) + "%"
+ }, _updatePlaybackSession: function _updatePlaybackSession() {
+ if (this.playbackSession !== null)
+ try {
+ this.playbackSession.seekToPosition(this.value)
+ }
+ catch(err) {}
+ }, _lastUpdate: 0, _renderLoop: function _renderLoop() {
+ if ((new Date) - this._lastUpdate > 20) {
+ this._lastUpdate = new Date;
+ this._updateValues();
+ this._updateAriaSliderValues(true)
+ }
+ if (this.isManipulating)
+ window.requestAnimationFrame(this._renderLoop)
+ }, _updateValues: function _updateValues() {
+ if (!this._initialized || this.frozen || !this.playbackSession || !this.playbackSession.currentMedia)
+ return;
+ var durationText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.max);
+ this.seekBarDurationText = durationText ? "/" + durationText : String.empty;
+ if (this.isManipulating) {
+ var scrubValueText = MS.Entertainment.Utilities.millisecondsToTimeCode(this._scrubValue);
+ if (MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))
+ this._thumbText.textContent = scrubValueText + this.seekBarDurationText;
+ else
+ this._thumbText.textContent = scrubValueText
+ }
+ else {
+ this.value = this.value < 0 ? 0 : this.value;
+ this.value = this.value > this.max ? this.max : this.value;
+ if (this._cachedValues._trackWidth > 0 && this.seekBarFill)
+ this.seekBarFill.style.msTransform = "scaleX(" + this._millisecondsToDecimal(this.value) + ")";
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth));
+ this.seekBarPositionText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.value);
+ this.thumbVisible = (this.metadataVisible || this.isManipulating || this._uiStateService.isSnapped) && this.playbackSession && this.playbackSession.canSeek
+ }
+ if (this.metadataVisible !== this.isManipulating ? false : this.metadataVisible)
+ this.metadataVisible = this.isManipulating ? false : this.metadataVisible
+ }, _updateAriaSliderValues: function _updateAriaSliderValues(alwaysUpdate) {
+ if (alwaysUpdate || (new Date) - this._lastAriaSliderUpdate > MS.Entertainment.UI.Controls.SeekBar.ariaUpdateDelayMs) {
+ MS.Entertainment.Framework.AccUtils.setAriaSliderPosition(this._track, this.value, this.seekBarPositionText);
+ this._lastAriaSliderUpdate = new Date
+ }
+ }, _isTouchPointerType: function _isTouchPointerType(pointerType) {
+ return pointerType === 2 || pointerType === "touch"
+ }, _isPenPointerType: function _isPenPointerType(pointerType) {
+ return pointerType === 3 || pointerType === "pen"
+ }, _isMousePointerType: function _isMousePointerType(pointerType) {
+ return pointerType === 4 || pointerType === "mouse"
+ }
+ }, {
+ disabled: false, min: 0, max: 100, value: 0, seekBarDurationText: "", seekBarPositionText: "", nowPlayingText: "", isManipulating: false, metadataVisible: true, thumbVisible: true, playbackSession: null, frozen: false
+ }, {
+ ariaUpdateDelayMs: 5000, shiftSkipMs: 1000, ctrlSkipPercentage: 20, defaultSkipPercentage: 5
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {PlaybackSeekBar: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.SeekBar", "/Controls/TransportControls/SeekBar.html#playbackSeekBarTemplate", function(element, options) {
+ this._renderLoop = this._renderLoop.bind(this);
+ this._updateSize = this._updateSize.bind(this);
+ this._cachedValues = {
+ _trackWidth: 0, _seekbarPosition: 0, _thumbWidth: 0, msScrollLimitXMax: 0
+ }
+ }, {
+ _seekbarThumbOffset: 30, initialize: function initialize() {
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this.bind("metadataVisible", this._updateValues.bind(this));
+ this.bind("visibility", this._visibilityChanged.bind(this));
+ var handlePointerEvent = this._onPointerEvent.bind(this);
+ this._thumb.addEventListener("keydown", this._onKeyDownEvent.bind(this), true);
+ this._thumb.addEventListener("keyup", this._onKeyUpEvent.bind(this), true);
+ this._scroller.addEventListener("MSPointerDown", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerUp", handlePointerEvent, true);
+ this._scroller.addEventListener("MSPointerMove", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerdown", handlePointerEvent, true);
+ this._scroller.addEventListener("pointerup", handlePointerEvent, true);
+ this._scroller.addEventListener("pointermove", handlePointerEvent, true);
+ this._scroller.addEventListener("MSManipulationStateChanged", handlePointerEvent, true);
+ this._scroller.addEventListener("scroll", this._scrollPositionChanged.bind(this), true);
+ this._scroller.addEventListener("MSHoldVisual", function(e) {
+ e.preventDefault()
+ });
+ MS.Entertainment.Utilities.attachResizeEvent(this.domElement, this._updateSize);
+ this.updateScrollerState();
+ this._initialized = true
+ }, _updateSize: function _updateSize() {
+ if (this._track) {
+ this._cachedValues._seekbarPosition = WinJS.Utilities.getPosition(this._track);
+ this._cachedValues._trackWidth = this._track.clientWidth
+ }
+ if (this._thumb)
+ this._cachedValues._thumbWidth = this._thumb.clientWidth;
+ if (this._scroller) {
+ this._scroller.style.msScrollLimitXMin = "0px";
+ var msScrollLimitXMax = this._scroller.clientWidth - 2 * this._seekbarThumbOffset;
+ msScrollLimitXMax = (msScrollLimitXMax > 0) ? msScrollLimitXMax : 0;
+ this._scroller.style.msScrollLimitXMax = msScrollLimitXMax + "px";
+ this._cachedValues.msScrollLimitXMax = this._scroller.style.msScrollLimitXMax;
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth))
+ }
+ this._mediaPositionChanged()
+ }, _updateValues: function _updateValues() {
+ if (!this._initialized || this.frozen || !this.playbackSession || !this.playbackSession.currentMedia)
+ return;
+ this.metadataVisible = true;
+ var durationText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.max);
+ this.seekBarDurationText = durationText ? durationText : String.empty;
+ if (this.isManipulating) {
+ var scrubValueText = MS.Entertainment.Utilities.millisecondsToTimeCode(this._scrubValue);
+ this._thumbText.textContent = scrubValueText
+ }
+ else {
+ this.value = this.value < 0 ? 0 : this.value;
+ this.value = this.value > this.max ? this.max : this.value;
+ if (this._cachedValues._trackWidth > 0 && this.seekBarFill)
+ this.seekBarFill.style.msTransform = "scaleX(" + this._millisecondsToDecimal(this.value) + ")";
+ var scrollableWidth = parseInt(this._cachedValues.msScrollLimitXMax);
+ if (this._scroller)
+ this._scroller.scrollLeft = (scrollableWidth - (this._millisecondsToDecimal(this.value) * scrollableWidth));
+ this.seekBarPositionText = MS.Entertainment.Utilities.millisecondsToTimeCode(this.value);
+ this.thumbVisible = this.playbackSession && this.playbackSession.canSeek
+ }
+ }, _engage: function _engage() {
+ WinJS.Utilities.addClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = false;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = false
+ }
+ window.requestAnimationFrame(this._renderLoop)
+ }, _disengage: function _disengage() {
+ WinJS.Utilities.removeClass(this._thumbText, "seekBarThumbTextEngaged");
+ if (Windows.UI.Input.PointerVisualizationSettings) {
+ var pointerVisualizationSettings = Windows.UI.Input.PointerVisualizationSettings.getForCurrentView();
+ pointerVisualizationSettings.isContactFeedbackEnabled = true;
+ pointerVisualizationSettings.isBarrelButtonFeedbackEnabled = true
+ }
+ this.value = this._scrubValue
+ }, _updatePosition: function _updatePosition() {
+ if (this.frozen || !this.playbackSession)
+ return;
+ var durationMs = this.playbackSession.duration;
+ if (!durationMs || typeof durationMs !== "number" || isNaN(durationMs))
+ if (this.playbackSession.currentMedia && typeof this.playbackSession.currentMedia.duration === "number" && !isNaN(this.playbackSession.currentMedia.duration))
+ durationMs = this.playbackSession.currentMedia.duration;
+ else if (this.playbackSession.currentMedia && this.playbackSession.currentMedia.duration.getSeconds && this.playbackSession.currentMedia.duration.getMinutes)
+ durationMs = 1000 * (this.playbackSession.currentMedia.duration.getSeconds() + 60 * this.playbackSession.currentMedia.duration.getMinutes());
+ else
+ durationMs = 0;
+ durationMs = (durationMs > 0) ? durationMs : 0;
+ var positionMs = this.playbackSession.currentPosition;
+ if (!positionMs || typeof positionMs !== "number" || isNaN(positionMs))
+ positionMs = 0;
+ positionMs = Math.min(durationMs, positionMs);
+ this.max = durationMs;
+ this.min = 0;
+ if (!this.isManipulating && !this._isKeyDownOnThumb) {
+ MS.Entertainment.Framework.AccUtils.setAriaSliderBounds(this._track, this.min, this.max);
+ this.value = positionMs;
+ this._updateValues()
+ }
+ }, initializeDuration: function initializeDuration() {
+ if (this.max === 0)
+ this._updatePosition()
+ }, _seekBarMove: function _seekBarMove(e, forceUpdate) {
+ if (!this._scroller)
+ return;
+ if (forceUpdate || (this.isManipulating && e.eventPhase === e.AT_TARGET && (this._isMousePointerType(e.pointerType) || this._isPenPointerType(e.pointerType))))
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + this._seekbarThumbOffset
+ }, _onPointerEvent: function _onPointerEvent(e) {
+ if (this.disabled)
+ return;
+ switch (e.type) {
+ case"MSManipulationStateChanged":
+ if (e.currentState === e.MS_MANIPULATION_STATE_STOPPED || e.currentState === e.MS_MANIPULATION_STATE_INERTIA) {
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollLeft;
+ this._releaseSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case"MSPointerDown":
+ case"pointerdown":
+ if (!this.playbackSession || !this.playbackSession.canSeek)
+ return;
+ if (event.button === 2)
+ return;
+ if (e.eventPhase === e.AT_TARGET) {
+ if (this._scroller) {
+ this._scroller.scrollLeft = (parseInt(this._cachedValues.msScrollLimitXMax) - e.x) + this._seekbarThumbOffset;
+ {}
+ }
+ this._scrollPositionChanged();
+ this.value = this._scrubValue;
+ this._updateValues();
+ this._updateAriaSliderValues(true);
+ this._updatePlaybackSession();
+ this._captureSeekBarInput(e)
+ }
+ else
+ this._captureSeekBarInput(e);
+ break;
+ case"MSPointerUp":
+ case"pointerup":
+ case"MSPointerCancel":
+ case"pointercancel":
+ this._releaseSeekBarInput(e);
+ e.cancelBubble = true;
+ break;
+ case"MSPointerMove":
+ case"pointermove":
+ this._seekBarMove(e);
+ break
+ }
+ }, updateScrollerState: function updateScrollerState() {
+ if (!this._scroller)
+ return;
+ if (this.disabled)
+ WinJS.Utilities.addClass(this._scroller, "seekBar-scrollerDisabled");
+ else
+ WinJS.Utilities.removeClass(this._scroller, "seekBar-scrollerDisabled")
+ }, _updateAriaSliderValues: function _updateAriaSliderValues(alwaysUpdate) {
+ if (alwaysUpdate || (new Date) - this._lastAriaSliderUpdate > MS.Entertainment.UI.Controls.SeekBar.ariaUpdateDelayMs) {
+ var ariaPositionText = this.seekBarPositionText;
+ if (ariaPositionText === String.load(String.id.IDS_TIME_DISPLAY_ZERO))
+ ariaPositionText = String.load(String.id.IDS_TIME_ARIA_ZERO);
+ MS.Entertainment.Framework.AccUtils.setAriaSliderPosition(this._thumb, this.value, ariaPositionText);
+ this._lastAriaSliderUpdate = new Date
+ }
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/TimelineEvent.html b/packages/microsoft.zunevideo/controls/TransportControls/TimelineEvent.html
new file mode 100644
index 00000000..afb93189
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/TimelineEvent.html
@@ -0,0 +1,22 @@
+
+
+
+
+ SeekBar
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/TimelineEvent.js b/packages/microsoft.zunevideo/controls/TransportControls/TimelineEvent.js
new file mode 100644
index 00000000..cb5286a2
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/TimelineEvent.js
@@ -0,0 +1,32 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TimelineEvent: MS.Entertainment.UI.Framework.defineUserControl("/Controls/TransportControls/TimelineEvent.html#template", function(element, options){}, {
+ initialize: function initialize() {
+ this.bind("event", this._updateValues.bind(this))
+ }, _updateValues: function _updateValues() {
+ if (this.event) {
+ this.eventText = this.event.text;
+ this.eventTitle = this.event.title;
+ this.imageThumbnail = this.event.imageThumbnail !== String.empty ? this.event.imageThumbnail : null;
+ this.eventPositionText = MS.Entertainment.Utilities.millisecondsToTimeCode(MS.Entertainment.UI.Controls.TimelineEvent.parseEventTime(this.event.startTime))
+ }
+ }, parseEventTime: function parseEventTime(strVal) {
+ var parts = strVal.split(":");
+ if (parts.length === 3) {
+ var ms = parseInt(parts[0]) * (60 * 60 * 1000);
+ ms += parseInt(parts[1]) * (60 * 1000);
+ ms += parseInt(parts[2]) * (1000);
+ return ms
+ }
+ else
+ return 0
+ }, eventClicked: function eventClicked() {
+ if (this.onInvoked)
+ this.onInvoked(this.event)
+ }
+ }, {
+ event: null, eventTitle: "", eventText: "", imageThumbnail: null, eventPositionText: "", onInvoked: null
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/TransportControls.html b/packages/microsoft.zunevideo/controls/TransportControls/TransportControls.html
new file mode 100644
index 00000000..c51c13ef
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/TransportControls.html
@@ -0,0 +1,110 @@
+
+
+
+
+ TransportControls
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/VideoScrub.html b/packages/microsoft.zunevideo/controls/TransportControls/VideoScrub.html
new file mode 100644
index 00000000..97742884
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/VideoScrub.html
@@ -0,0 +1,22 @@
+
+
+
+
+ SeekBar
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/VideoScrub.js b/packages/microsoft.zunevideo/controls/TransportControls/VideoScrub.js
new file mode 100644
index 00000000..9d1e6310
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/VideoScrub.js
@@ -0,0 +1,62 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VideoScrub: MS.Entertainment.UI.Framework.defineUserControl("/Controls/TransportControls/VideoScrub.html#videoScrubTemplate", function(element, options) {
+ this._bindingsToDetach = []
+ }, {
+ _initialized: false, _toUninitialize: null, _scrubPositionMs: 0, _lastScrubPositionSec: 0, initialize: function initialize() {
+ this.bind("playbackSession", this._playbackSessionChanged.bind(this));
+ this._initialized = true
+ }, _detachBindings: function _detachBindings() {
+ this._bindingsToDetach.forEach(function(e) {
+ e.source.unbind(e.name, e.action)
+ });
+ this._bindingsToDetach = []
+ }, _initializeBinding: function _initializeBinding(source, name, action) {
+ source.bind(name, action);
+ this._bindingsToDetach.push({
+ source: source, name: name, action: action
+ })
+ }, unload: function unload() {
+ this._detachBindings();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ if (this.playbackSession) {
+ this.playbackSession.pausePlaybackWhileScrubbing = false;
+ this.playbackSession.minScrubStep = 5000
+ }
+ this._updateValues()
+ }, startScrubbing: function startScrubbing() {
+ if (this.playbackSession && this.playbackSession.canScrub) {
+ this.playbackSession.scrubActive = true;
+ this.playbackSession.thumbnailDiv = this.videoScrubThumbnail;
+ this.playbackSession.scrubPosition = this.playbackSession.currentPosition;
+ this.videoScrubActive = true
+ }
+ else
+ this.videoScrubActive = false
+ }, stopScrubbing: function stopScrubbing() {
+ this.videoScrubActive = false;
+ if (this.playbackSession)
+ this.playbackSession.scrubActive = false
+ }, setScrubPosition: function setScrubPosition(value) {
+ if (this._lastScrubPositionSec !== parseInt(value / 1000)) {
+ this._lastScrubPositionSec = parseInt(value / 1000);
+ this._scrubPositionMs = value;
+ if (this.playbackSession)
+ this.playbackSession.scrubPosition = value;
+ this._updateValues()
+ }
+ }, _updateValues: function _updateValues() {
+ if (!this._initialized)
+ return;
+ var newVal = MS.Entertainment.Utilities.millisecondsToTimeCode(this._scrubPositionMs);
+ if (this.scrubPositionText.textContent !== newVal)
+ this.scrubPositionText.textContent = newVal
+ }
+ }, {
+ playbackSession: null, videoScrubActive: false
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/VolumeBar.html b/packages/microsoft.zunevideo/controls/TransportControls/VolumeBar.html
new file mode 100644
index 00000000..2bee5c02
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/VolumeBar.html
@@ -0,0 +1,25 @@
+
+
+
+
+ Volume Bar
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/TransportControls/VolumeBar.js b/packages/microsoft.zunevideo/controls/TransportControls/VolumeBar.js
new file mode 100644
index 00000000..5cf5ed31
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/TransportControls/VolumeBar.js
@@ -0,0 +1,116 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VolumeBar: MS.Entertainment.UI.Framework.defineUserControl("/Controls/TransportControls/VolumeBar.html#volumeControl", function volumeBarConstructor(element, options) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.volumeService)) {
+ this._volumeControllerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this.volumeValue = this._volumeControllerService.volume * 100;
+ this.iconType = this._volumeControllerService.mute ? WinJS.UI.AppBarIcon.mute : WinJS.UI.AppBarIcon.volume;
+ if (!MS.Entertainment.Utilities.isMusicApp1)
+ this._systemVolumeBinding = WinJS.Binding.bind(this._volumeControllerService, {
+ volume: this._onSystemVolumeValueChange.bind(this), mute: this._onSystemMuteStateChange.bind(this)
+ });
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._uiStateEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._uiStateService, {
+ windowresize: this._onUiStateChange.bind(this), isSnappedChanged: this._onUiStateChange.bind(this), isSettingsCharmVisibleChanged: this._onUiStateChange.bind(this), appBarVisibleChanged: this._onUiStateChange.bind(this)
+ });
+ var localMuteAction = new MS.Entertainment.UI.ToolbarAction;
+ localMuteAction.automationId = MS.Entertainment.UI.AutomationIds.muteVolume;
+ localMuteAction.id = "muteVolume";
+ localMuteAction.executed = function MuteExecuted() {
+ this.onStateChange()
+ }.bind(this);
+ this._muteAction = localMuteAction
+ }
+ else
+ MS.Entertainment.UI.Controls.assert(this._volumeControllerService, "Volume service not registered.")
+ }, {
+ _volumeControllerService: null, _systemVolumeBinding: null, _mouseWheelEventHandler: null, muteButton: null, _uiStateService: null, _uiStateEventHandlers: null, _autoHideDuration: 3000, initialize: function initialize() {
+ this._mouseWheelEventHandler = MS.Entertainment.Utilities.addEventHandlers(document.body, {mousewheel: this.onMouseWheelMove.bind(this)});
+ this._resetAutoHideTimer()
+ }, _onSystemVolumeValueChange: function _onSystemVolumeValueChange() {
+ if (this.volumeValue !== (this._volumeControllerService.volume * 100)) {
+ var oldValue = this.volumeValue;
+ this.volumeValue = this._volumeControllerService.volume * 100;
+ this.notify("volumeValue", this.volumeValue, oldValue)
+ }
+ }, _onSystemMuteStateChange: function _onSystemMuteStateChange() {
+ var oldValue = this.iconType;
+ this.iconType = this._volumeControllerService.mute ? WinJS.UI.AppBarIcon.mute : WinJS.UI.AppBarIcon.volume;
+ this.notify("iconType", this.iconType, oldValue)
+ }, _onUiStateChange: function _onUiStateChange() {
+ this._closeOverlay()
+ }, onMouseWheelMove: function onMouseWheelMove(args) {
+ var mouseWheelNormalizedDelta = Math.floor(args.wheelDelta / MS.Entertainment.UI.Controls.VolumeBar.MOUSE_WHEEL_DELTA_COEFFICIENT);
+ var delta = mouseWheelNormalizedDelta * MS.Entertainment.UI.Controls.VolumeBar.MOUSE_WHEEL_VOLUME_STEP;
+ var newVolume = (this._volumeControllerService.volume * 100) + delta;
+ if (newVolume > 100)
+ newVolume = 100;
+ else if (newVolume < 0)
+ newVolume = 0;
+ this._updateValue(newVolume);
+ this._onSystemVolumeValueChange()
+ }, onValueChange: function onValueChange(args) {
+ this._updateValue(args.target.value);
+ this._resetAutoHideTimer()
+ }, _updateValue: function _updateValue(newVolumeValue) {
+ if (this._volumeControllerService) {
+ if (this._volumeControllerService.mute)
+ this.onStateChange();
+ this._volumeControllerService.volume = (newVolumeValue) / 100
+ }
+ }, onStateChange: function onStateChange(args) {
+ if (this._volumeControllerService) {
+ this._volumeControllerService.mute = !this._volumeControllerService.mute;
+ var oldValue = this.iconType;
+ this.iconType = this._volumeControllerService.mute ? WinJS.UI.AppBarIcon.mute : WinJS.UI.AppBarIcon.volume;
+ this.notify("iconType", this.iconType, oldValue);
+ this.muteButton.isChecked = this._volumeControllerService.mute;
+ this.muteButton._button.setAttribute("aria-live", "assertive");
+ this.muteButton._button.removeAttribute("aria-live")
+ }
+ }, _closeOverlay: function _closeOverlay() {
+ if (this._unloaded)
+ return;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("dismissoverlay", true, true);
+ this.domElement.dispatchEvent(domEvent);
+ this._clearAutoHideTimer()
+ }, _resetAutoHideTimer: function _resetAutoHideTimer() {
+ this._clearAutoHideTimer();
+ if (this._autoHideDuration > 0)
+ this.autoHideTimeout = WinJS.Promise.timeout(this._autoHideDuration).then(function volumeControlAutoHide() {
+ this._closeOverlay()
+ }.bind(this))
+ }, _clearAutoHideTimer: function _clearAutoHideTimer() {
+ if (this.autoHideTimeout) {
+ this.autoHideTimeout.cancel();
+ this.autoHideTimeout = null
+ }
+ }, unload: function unload() {
+ if (this._volumeControllerService) {
+ MS.Entertainment.Utilities.Telemetry.logVolumeSelected(this._volumeControllerService.volume);
+ MS.Entertainment.Utilities.Telemetry.logMuteStateSelected(this._volumeControllerService.mute);
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && appBar.hide)
+ appBar.sticky = false;
+ if (this._systemVolumeBinding) {
+ this._systemVolumeBinding.cancel();
+ this._systemVolumeBinding = null
+ }
+ if (this._uiStateEventHandlers) {
+ this._uiStateEventHandlers.cancel();
+ this._uiStateEventHandlers = null
+ }
+ if (this._mouseWheelEventHandler) {
+ this._mouseWheelEventHandler.cancel();
+ this._mouseWheelEventHandler = null
+ }
+ this._clearAutoHideTimer()
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }
+ }, null, {
+ MOUSE_WHEEL_DELTA_COEFFICIENT: 30, MOUSE_WHEEL_VOLUME_STEP: 2
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/UpgradeTile.html b/packages/microsoft.zunevideo/controls/UpgradeTile.html
new file mode 100644
index 00000000..5e301435
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/UpgradeTile.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
![]()
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/UpgradeTile.js b/packages/microsoft.zunevideo/controls/UpgradeTile.js
new file mode 100644
index 00000000..f239a0d6
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/UpgradeTile.js
@@ -0,0 +1,65 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var UpgradeTile = (function(_super) {
+ __extends(UpgradeTile, _super);
+ function UpgradeTile(element, options) {
+ this.templateStorage = "/Controls/UpgradeTile.html";
+ this.templateName = "upgradeTile";
+ _super.call(this, element, options);
+ if (!this.imageUrl)
+ if (MS.Entertainment.Utilities.isMusicApp)
+ this.imageUrl = "/images/tiles/XBL_MUSIC_150x150_A.png";
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ this.imageUrl = "/images/tiles/XBL_VIDEO_150x150_A.png";
+ if (!this.bigMessage)
+ this.bigMessage = String.load(String.id.IDS_VERSION_CHECK_UPGRADE_CAPTION);
+ if (!this.littleMessage)
+ this.littleMessage = String.load(String.id.IDS_VERSION_CHECK_UPGRADE_LINK)
+ }
+ UpgradeTile.prototype.handleClick = function() {
+ var upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ upgradeService.launchStore()
+ };
+ UpgradeTile.getUpgradeFeedInformation = function() {
+ var query;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ query = new MS.Entertainment.Data.Query.MusicUpdatePanel;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ query = new MS.Entertainment.Data.Query.VideoUpdatePanel;
+ else
+ return WinJS.Promise.as();
+ return query.execute().then(function(queryResult) {
+ if (!queryResult)
+ return null;
+ var data = {
+ bigMessage: queryResult.result.item.title, littleMessage: queryResult.result.item.subtitle
+ };
+ return data
+ }, function(e) {
+ MS.Entertainment.UI.Controls.fail("Upgrade panel query failed: " + (e && e.originalError))
+ })
+ };
+ return UpgradeTile
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.UpgradeTile = UpgradeTile
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
diff --git a/packages/microsoft.zunevideo/controls/UserFeedbackDialog.html b/packages/microsoft.zunevideo/controls/UserFeedbackDialog.html
new file mode 100644
index 00000000..37c8d8b1
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/UserFeedbackDialog.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+ User Feedback Dialog Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/ChooseDownloadQuality.html b/packages/microsoft.zunevideo/controls/Video/ChooseDownloadQuality.html
new file mode 100644
index 00000000..418c7114
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/ChooseDownloadQuality.html
@@ -0,0 +1,39 @@
+
+
+
+
+ Choose Download Quality Dialog
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/RentalOptionsDialog.html b/packages/microsoft.zunevideo/controls/Video/RentalOptionsDialog.html
new file mode 100644
index 00000000..76e7f49e
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/RentalOptionsDialog.html
@@ -0,0 +1,37 @@
+
+
+
+
+
+ Rental Options Dialog Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/RentalOptionsDialog.js b/packages/microsoft.zunevideo/controls/Video/RentalOptionsDialog.js
new file mode 100644
index 00000000..3bea74a4
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/RentalOptionsDialog.js
@@ -0,0 +1,49 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {RentalOptionsDialog: MS.Entertainment.UI.Framework.defineUserControl("/Controls/Video/RentalOptionsDialog.html#rentalOptionsDialogTemplate", function rentalOptionsDialogConstructor(element, options){}, {
+ _selectedRadioButton: null, initialize: function initialize() {
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ var download = settingsStorage.values["preferRentalDownload"] || false;
+ this._selectedRadioButton = download ? this._download : this._streaming;
+ this._streaming.checked = !download;
+ this._download.checked = download
+ }, onSubmit: function _onSubmit() {
+ var offer = null;
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ if (this._selectedRadioButton === this._streaming) {
+ offer = this.streamingOffer;
+ settingsStorage.values["preferRentalDownload"] = false
+ }
+ else {
+ offer = this.downloadOffer;
+ settingsStorage.values["preferRentalDownload"] = true
+ }
+ return offer
+ }, _onDeliveryFormatChange: function _onDeliveryFormatChange(args) {
+ this._selectedRadioButton = args.target
+ }
+ }, {}, {showRentalOptionsDialog: function showRentalOptionsDialog(mediaItem, streamingOffer, downloadOffer) {
+ var completionSignal = new MS.Entertainment.UI.Framework.Signal;
+ var options = {
+ userControlOptions: {
+ movieTitle: mediaItem.name, streamingOffer: streamingOffer, downloadOffer: downloadOffer
+ }, width: "80%", height: "320px", buttons: [WinJS.Binding.as({
+ isEnabled: true, title: String.load(String.id.IDS_NEXT_BUTTON), execute: function execute_submit(dialog) {
+ var offer = dialog.userControlInstance.onSubmit();
+ completionSignal.complete({
+ offer: offer, dialog: dialog
+ })
+ }
+ }), WinJS.Binding.as({
+ isEnabled: true, title: String.load(String.id.IDS_CANCEL_BUTTON_TC), execute: function execute_cancel(dialog) {
+ dialog.hide();
+ completionSignal.promise.cancel()
+ }
+ })], defaultButtonIndex: 0, cancelButtonIndex: 1
+ };
+ MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_VIDEO_MOVIE_RENTAL_DIALOG_TITLE), "MS.Entertainment.UI.Controls.RentalOptionsDialog", options);
+ return completionSignal.promise
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Video/SeasonModifier.html b/packages/microsoft.zunevideo/controls/Video/SeasonModifier.html
new file mode 100644
index 00000000..b0adfe9b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/SeasonModifier.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/SeasonModifier.js b/packages/microsoft.zunevideo/controls/Video/SeasonModifier.js
new file mode 100644
index 00000000..cb9b4d8a
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/SeasonModifier.js
@@ -0,0 +1,23 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/Utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {SeasonModifierPopupEntry: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ModifierPopupEntry", "/Controls/Video/SeasonModifier.html#seasonModifierPopupEntryTemplate", null, {_gotData: function _gotData(data) {
+ var domEvent;
+ if (data.item) {
+ if (data.item.label)
+ this.text.textContent = data.item.label;
+ if (data.item.season)
+ this.boxArt.target = data.item.season;
+ if (data.item.ownedEpisodes)
+ this.ownedEpisodeCount.textContent = String.load(String.id.IDS_TV_OWNED_EPISODES_LABEL).format(data.item.ownedEpisodes)
+ }
+ if (data.isInitialSelected)
+ WinJS.Utilities.addClass(this.background, "initialSelectedModifierPopupEntry");
+ if (data.modifierControl._tabPanel)
+ MS.Entertainment.Framework.AccUtils.createAndAddAriaLink(this.domElement, data.modifierControl._tabPanel, "aria-controls");
+ domEvent = document.createEvent("Event");
+ domEvent.initEvent("ModifierPopupEntryLoaded", true, true);
+ this.domElement.dispatchEvent(domEvent)
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Video/TvEpisodeDownloadStatus.js b/packages/microsoft.zunevideo/controls/Video/TvEpisodeDownloadStatus.js
new file mode 100644
index 00000000..8ec5a230
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/TvEpisodeDownloadStatus.js
@@ -0,0 +1,133 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {TvEpisodeDownloadStatus: MS.Entertainment.UI.Framework.defineUserControl(null, function TvEpisodeDownloadStatus(element){}, {
+ controlName: "TvEpisodeDownloadStatus", allowAnimations: false, preventHideDuringInitialize: true, _hasNotificationMessage: false, _isLocallyPlayable: false, _canStream: false, _status: String.empty, _statusContainerDomElement: null, _ariaLabel: String.empty, _ariaLabelContainerDomElement: null, _alternateTextContainerDomElement: null, _visible: false, _bindings: null, _fileTransferListenerId: null, sendNotification: null, _attachedLibraryId: -1, _attachedServiceId: MS.Entertainment.Utilities.EMPTY_GUID, _attachedActivationFilePath: String.empty, _delayInitialized: function _delayInitialized() {
+ this._fileTransferListenerId = "TvEpisodeDownloadStatus_" + MS.Entertainment.Utilities.getSessionUniqueInteger();
+ this._statusContainerDomElement = this.domElement.querySelector(".mediaStatusIconContainer");
+ MS.Entertainment.UI.Controls.assert(this._statusContainerDomElement, "MediaStatusIcon control is missing required child element of class 'mediaStatusIconContainer'.");
+ this._alternateTextContainerDomElement = this.domElement.querySelector(".mediaStatusAlternateTextContainer");
+ this._ariaLabelContainerDomElement = this.domElement.querySelector(".mediaStatusAriaLabelContainer");
+ MS.Entertainment.UI.Controls.assert(this._ariaLabelContainerDomElement, "MediaStatusIcon control is missing required child element of class 'mediaStatusAriaLabelContainer'.");
+ this._handleMediaChange = this._handleMediaChange.bind(this);
+ this.sendNotification = this._fileTransferNotification.bind(this);
+ this._updateCanPlayLocally = this._updateCanPlayLocally.bind(this);
+ this._bindings = WinJS.Binding.bind(this, {mediaInstance: {
+ serviceId: this._handleMediaChange, libraryId: this._handleMediaChange, activationFilePath: this._handleMediaChange
+ }})
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null;
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.unregisterListener(this._fileTransferListenerId)
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _fileTransferNotification: function sendNotification(notification, notificationType, notificationMessage) {
+ if (notificationMessage && notificationMessage.shortText && !this._isLocallyPlayable) {
+ this._hasNotificationMessage = true;
+ this._updateState(notificationMessage.shortText)
+ }
+ if (!notificationMessage) {
+ this._updateCanPlayLocally();
+ this._hasNotificationMessage = false
+ }
+ }, _handleMediaChange: function _handleMediaChange(newMediaId, oldMediaId) {
+ if (this.mediaInstance) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.fileTransfer) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ if (this._isValidMediaId(oldMediaId) && (this._attachedServiceId === oldMediaId || this._attachedLibraryId === oldMediaId)) {
+ fileTransferNotifications.unregisterListener(this._fileTransferListenerId);
+ this._detachedMediaId(oldMediaId)
+ }
+ if (!this._unloaded && fileTransferService) {
+ if (this._isValidMediaId(newMediaId)) {
+ fileTransferService.registerListener(this._fileTransferListenerId, function getTaskKey(task) {
+ return (task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && task.libraryId === this.mediaInstance.libraryId) ? task.libraryId : null
+ }.bind(this), this, MS.Entertainment.UI.FileTransferNotifiers.episodeListItem);
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.mediaInstance)
+ }
+ this._updateCanPlayLocally();
+ this._updateCanStream()
+ }
+ }
+ }, _updateCanStream: function _updateCanStream() {
+ if (this.mediaInstance)
+ MS.Entertainment.ViewModels.SmartBuyStateEngine.queryMediaStateAsync(this.mediaInstance).then(function checkCanStream(stateInfo) {
+ this._canStream = WinJS.Utilities.getMember("marketplace.canStream", stateInfo);
+ this._updateState()
+ }.bind(this))
+ }, _updateCanPlayLocally: function updateCanPlayLocally() {
+ if (this.mediaInstance && this.mediaInstance.inCollection) {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ mediaStore.videoProvider.getPlayabilityByLibraryIdAsync(this.mediaInstance.libraryId).then(function getCanPlayLocally(nativePlayability) {
+ this._isLocallyPlayable = nativePlayability.locallyPlayable;
+ this._updateState()
+ }.bind(this))
+ }
+ else {
+ this._isLocallyPlayable = this.mediaInstance && this.mediaInstance.inCollection;
+ this._updateState()
+ }
+ }, _updateState: function _updateState(statusMessage, ariaMessage) {
+ var statusLabel = statusMessage || String.empty;
+ var ariaLabel = ariaMessage || String.empty;
+ var alternateLabel = String.empty;
+ var hasStreamingIcon = false;
+ var forceStatusLabelUpdate = false;
+ if (this._unloaded)
+ return;
+ if (this._isLocallyPlayable)
+ statusLabel = String.load(String.id.IDS_FILE_TRANSFER_DOWNLOADED);
+ else if (this.mediaInstance && (this._canStream || this.mediaInstance.inCollection) && !this._hasNotificationMessage) {
+ statusLabel = MS.Entertainment.UI.Icon.inlineStreaming;
+ hasStreamingIcon = true;
+ ariaLabel = String.load(String.id.IDS_MEDIA_STATUS_INLINE_STREAMING_ICON);
+ alternateLabel = this.alternateText
+ }
+ else if (this.mediaInstance.libraryId === -1) {
+ alternateLabel = this.alternateText;
+ forceStatusLabelUpdate = true
+ }
+ if (statusLabel || forceStatusLabelUpdate) {
+ if (this._status !== statusLabel) {
+ this._status = statusLabel;
+ this._statusContainerDomElement.textContent = statusLabel;
+ if (hasStreamingIcon) {
+ WinJS.Utilities.addClass(this._statusContainerDomElement, "icon");
+ WinJS.Utilities.removeClass(this._statusContainerDomElement, "text-metadata")
+ }
+ else {
+ WinJS.Utilities.removeClass(this._statusContainerDomElement, "icon");
+ WinJS.Utilities.addClass(this._statusContainerDomElement, "text-metadata")
+ }
+ }
+ if (this._ariaLabel !== ariaLabel)
+ this._ariaLabelContainerDomElement.textContent = ariaLabel
+ }
+ if (this._alternateTextContainerDomElement)
+ this._alternateTextContainerDomElement.textContent = alternateLabel
+ }, _attachedMediaId: function _attachedMediaId(mediaId) {
+ if (typeof mediaId === "number")
+ this._attachedLibraryId = mediaId;
+ else if (typeof mediaId === "string")
+ this._attachedServiceId = mediaId;
+ else
+ MS.Entertainment.UI.Controls.Music.fail("Attached unknown mediaId type")
+ }, _detachedMediaId: function _detachedMediaId(mediaId) {
+ if (typeof mediaId === "number")
+ this._attachedLibraryId = -1;
+ else if (typeof mediaId === "string")
+ if (this._isFilePath(mediaId))
+ this._attachedActivationFilePath = String.empty;
+ else
+ this._attachedServiceId = MS.Entertainment.Utilities.EMPTY_GUID;
+ else
+ MS.Entertainment.UI.Controls.fail("Detached unknown mediaId type")
+ }, _isValidMediaId: function _isValidMediaId(mediaId) {
+ return ((typeof mediaId === "number" && mediaId >= 0) || (typeof mediaId === "string" && !MS.Entertainment.Utilities.isEmptyGuid(mediaId)))
+ }
+ }, {
+ mediaInstance: null, alternateText: null
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Video/VideoDownloadItem.html b/packages/microsoft.zunevideo/controls/Video/VideoDownloadItem.html
new file mode 100644
index 00000000..4957f596
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/VideoDownloadItem.html
@@ -0,0 +1,99 @@
+
+
+
+
+ Video Download Item Templates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/VideoDownloadItem.js b/packages/microsoft.zunevideo/controls/Video/VideoDownloadItem.js
new file mode 100644
index 00000000..e6718c21
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/VideoDownloadItem.js
@@ -0,0 +1,140 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator("/Framework/corefx.js", "/Framework/debug.js", "/Framework/utilities.js");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VideoDownloadItem: MS.Entertainment.UI.Framework.defineUserControl("/Controls/Video/VideoDownloadItem.html#videoDownloadItemTemplate", function videoDownloadItem(element) {
+ this.smartBuyStateEngine = null
+ }, {
+ controlName: "VideoDownloadItem", sendNotification: null, _isLocallyPlayable: false, _downloadSize: null, _bindings: null, _fileTransferListenerId: null, initialize: function initialize() {
+ if (this.isDelayInitialized && this._imageControl && !this._imageControl._enabled && this._imageControl.supportsDelayInitialization)
+ this._imageControl.delayInitialize()
+ }, _delayInitialized: function _delayInitialized() {
+ this._fileTransferListenerId = "VideoDownloadItemStatus_" + MS.Entertainment.Utilities.getSessionUniqueInteger();
+ this._handleMediaChange = this._handleMediaChange.bind(this);
+ this.sendNotification = this._fileTransferNotification.bind(this);
+ this._updateCanPlayLocally = this._updateCanPlayLocally.bind(this);
+ this._bindings = WinJS.Binding.bind(this, {mediaItem: {
+ serviceId: this._handleMediaChange, libraryId: this._handleMediaChange, activationFilePath: this._handleMediaChange
+ }});
+ WinJS.Promise.timeout().then(function() {
+ if (!this.smartBuyStateEngine)
+ return;
+ this.smartBuyStateEngine.initialize(this.mediaItem, MS.Entertainment.ViewModels.SmartBuyButtons.getVideoDownloadItemButtons(this.mediaItem, MS.Entertainment.UI.Actions.ExecutionLocation.invokeInline), MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.prototype.onVideoDownloadItemStateChanged)
+ }.bind(this))
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._fileTransferListenerId) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.unregisterListener(this._fileTransferListenerId)
+ }
+ if (this.smartBuyStateEngine) {
+ this.smartBuyStateEngine.unload();
+ this.smartBuyStateEngine = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _fileTransferNotification: function sendNotification(notification, notificationType, notificationMessage) {
+ if (!this._downloadSize && notificationMessage && notificationMessage.task)
+ this._updateDownloadSize(notificationMessage.task.totalBytesToReceive);
+ if (notificationMessage && notificationMessage.shortText && !this._isLocallyPlayable)
+ this._updateState(notificationMessage.shortText);
+ if (notificationMessage && notificationMessage.task && !isNaN(notificationMessage.task.percentage))
+ this._updateProgressBar(notificationMessage.task.percentage);
+ if (!notificationMessage)
+ this._updateCanPlayLocally()
+ }, _handleMediaChange: function handleMediaChange(newMediaId, oldMediaId) {
+ if (this.mediaItem) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ if (!this._unloaded && this._isValidMediaId(newMediaId)) {
+ fileTransferService.registerListener(this._fileTransferListenerId, function getTaskKey(task) {
+ return (task.libraryTypeId === Microsoft.Entertainment.Queries.ObjectType.video && task.libraryId === this.mediaItem.libraryId) ? task.libraryId : null
+ }.bind(this), this, MS.Entertainment.UI.FileTransferNotifiers.videoDownloadItem);
+ MS.Entertainment.UI.FileTransferService.pulseAsync(this.mediaItem);
+ if (!this.smartBuyStateEngine)
+ this.smartBuyStateEngine = new MS.Entertainment.ViewModels.VideoSmartBuyStateEngine;
+ if (!this._downloadSize && this.mediaItem && this.mediaItem.downloadTask)
+ this._updateDownloadSize(this.mediaItem.downloadTask.totalBytesToReceive);
+ this._updateDescription();
+ this._updateCanPlayLocally()
+ }
+ }
+ }, _updateCanPlayLocally: function updateCanPlayLocally() {
+ if (this.mediaItem && this.mediaItem.libraryId !== 0) {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ mediaStore.videoProvider.getPlayabilityByLibraryIdAsync(this.mediaItem.libraryId).then(function getCanPlayLocally(nativePlayability) {
+ this._isLocallyPlayable = nativePlayability.locallyPlayable;
+ this._updateState()
+ }.bind(this))
+ }
+ }, _updateProgressBar: function updateProgressBar(percentDownloaded) {
+ if (!percentDownloaded)
+ return;
+ this.downloadProgress = Math.round(percentDownloaded * 100)
+ }, _updateState: function updateState(statusMessage) {
+ var statusLabel = statusMessage || String.empty;
+ if (this._unloaded)
+ return;
+ if (this._isLocallyPlayable)
+ statusLabel = String.load(String.id.IDS_FILE_TRANSFER_DOWNLOADED);
+ if (statusLabel)
+ this.statusText = statusLabel
+ }, _updateDownloadSize: function updateDownloadSize(totalBytes) {
+ var downloadSize = String.empty;
+ if (isNaN(totalBytes) || totalBytes <= 0)
+ return;
+ var kilobytes = (totalBytes / 1024);
+ var megabytes = (kilobytes / 1024);
+ if (megabytes < 1000) {
+ megabytes = Math.round(megabytes);
+ this._downloadSize = String.load(String.id.IDS_VIDEO_DOWNLOAD_MANAGER_MB_SIZE).format(megabytes)
+ }
+ else {
+ var gigabytes = (megabytes / 1024);
+ gigabytes = gigabytes.toFixed(1);
+ this._downloadSize = String.load(String.id.IDS_VIDEO_DOWNLOAD_MANAGER_GB_SIZE).format(gigabytes)
+ }
+ this._updateDescription()
+ }, _updateDescription: function updateDescription() {
+ var description = String.empty;
+ if (this.mediaItem) {
+ switch (this.mediaItem.videoType) {
+ case Microsoft.Entertainment.Queries.VideoType.movie:
+ if (this.mediaItem.genreName)
+ description = this.mediaItem.genreName;
+ if (this.mediaItem.releaseDate) {
+ var dateFormat = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ var year = dateFormat.format(this.mediaItem.releaseDate);
+ if (description.length > 0)
+ description = String.load(String.id.IDS_COMMA_SEPARATOR).format(description, year);
+ else
+ description = year
+ }
+ break;
+ case Microsoft.Entertainment.Queries.VideoType.tvEpisode:
+ var seasonEpisodeNumber = MS.Entertainment.Formatters.formatTVSeasonEpisodeNumberInt(this.mediaItem);
+ if (seasonEpisodeNumber)
+ if (description.length > 0)
+ description = String.load(String.id.IDS_COMMA_SEPARATOR).format(description, seasonEpisodeNumber);
+ else
+ description = seasonEpisodeNumber;
+ break;
+ default:
+ throw new Error("videoType not recognized for VideoDownloadItem control!");
+ break
+ }
+ if (this._downloadSize)
+ if (description.length > 0)
+ description = String.load(String.id.IDS_COMMA_SEPARATOR).format(description, this._downloadSize);
+ else
+ description = this._downloadSize
+ }
+ this.descriptionText = description
+ }, _isValidMediaId: function isValidMediaId(mediaId) {
+ return ((typeof mediaId === "number" && mediaId >= 0) || (typeof mediaId === "string" && !MS.Entertainment.Utilities.isEmptyGuid(mediaId)))
+ }
+ }, {
+ mediaItem: null, smartBuyStateEngine: null, titleText: "", descriptionText: "", statusText: "", errorText: "", downloadProgress: 0
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Video/VideoDownloadManager.html b/packages/microsoft.zunevideo/controls/Video/VideoDownloadManager.html
new file mode 100644
index 00000000..8fdb6596
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/VideoDownloadManager.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+ Video Download Manager Dialog Template
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/VideoNowPlayingOverlays.html b/packages/microsoft.zunevideo/controls/Video/VideoNowPlayingOverlays.html
new file mode 100644
index 00000000..f18a6627
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/VideoNowPlayingOverlays.html
@@ -0,0 +1,60 @@
+
+
+
+
+ NowPlaying
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/Video/VideoNowPlayingOverlays.js b/packages/microsoft.zunevideo/controls/Video/VideoNowPlayingOverlays.js
new file mode 100644
index 00000000..238f744b
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/VideoNowPlayingOverlays.js
@@ -0,0 +1,487 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Components/Playback/Controls/PlaybackControl.js", "/Framework/corefx.js", "/Framework/data/queries/marketplacequeries.js", "/Framework/imageloader.js", "/Framework/servicelocator.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {NowPlayingOverlays: MS.Entertainment.UI.Framework.defineUserControl("/Controls/Video/VideoNowPlayingOverlays.html#nowPlayingTemplate", function(element, options){}, {
+ autoHideVideoOverlays: 3000, positionChangedThreshold: 30000, _uiStateService: MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), _bindings: null, _eventHandlers: null, _keyHandlers: null, _mainHeader: null, _sessionMgr: null, _uiSettings: new Windows.UI.ViewManagement.UISettings, _deferredUpdateTimer: null, _lastMousePos: {
+ x: -10, y: -10
+ }, _freezeDelayPromise: null, _engageHideOffsetMS: 500, _navigationService: null, _backButtonServiceInternal: null, _mediaChangedWhileFrozen: false, _seekBarManipulatingChangedBound: null, _playbackSessionChangedBound: null, _ratingImageUrl: String.empty, _overlaysVisible: false, _overlaysVisiblePromise: null, _detailsButtonVisible: false, _detailsButtonVisiblePromise: null, _ratingImageVisible: false, _ratingImageVisiblePromise: null, _seekBarVisible: false, _seekBarVisiblePromise: null, _transportControlsVisible: false, _transportControlsVisiblePromise: null, _backButtonService: {get: function backButtonService_get() {
+ if (!this._backButtonServiceInternal)
+ this._backButtonServiceInternal = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.backButton);
+ return this._backButtonServiceInternal
+ }}, _allowedKeys: null, _freezeDelayTimerMS: 1000, initialize: function initialize() {
+ this._allowedKeys = [WinJS.Utilities.Key.leftArrow, WinJS.Utilities.Key.lArrow, WinJS.Utilities.Key.lOtherArrow, WinJS.Utilities.Key.rightArrow, WinJS.Utilities.Key.rArrow, WinJS.Utilities.Key.rOtherArrow, WinJS.Utilities.Key.upArrow, WinJS.Utilities.Key.uArrow, WinJS.Utilities.Key.uOtherArrow, WinJS.Utilities.Key.downArrow, WinJS.Utilities.Key.dArrow, WinJS.Utilities.Key.dOtherArrow, WinJS.Utilities.Key.tab, WinJS.Utilities.Key.space, WinJS.Utilities.Key.invokeButton];
+ this.showBackButton = this.showBackButton.bind(this);
+ this._mainHeader = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.mainHeader);
+ this._sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!this._seekBarManipulatingChangedBound) {
+ this._seekBarManipulatingChangedBound = this._seekBarManipulatingChanged.bind(this);
+ this._seekBar.bind("isManipulating", this._seekBarManipulatingChangedBound)
+ }
+ this.updateCursorVisibility(true);
+ this.initialized = true;
+ if (!this._playbackSessionChangedBound) {
+ this._playbackSessionChangedBound = this._playbackSessionChanged.bind(this);
+ this.bind("playbackSession", this._playbackSessionChangedBound)
+ }
+ this.hideOverlays();
+ var keyHandlerElement = MS.Entertainment.Utilities.isApp2 ? this.domElement : document;
+ this._keyHandlers = MS.Entertainment.Utilities.addEventHandlers(keyHandlerElement, {
+ keydown: this.nowPlayingKeyDown.bind(this), keyup: this.nowPlayingKeyUp.bind(this)
+ }, false);
+ if (MS.Entertainment.Utilities.isVideoApp2 && !MS.Entertainment.UI.Framework.focusedItemInContainer(this._overlaysContainer))
+ MS.Entertainment.UI.Framework.focusElement(this._overlaysContainer)
+ }, _showVideoPostRoll: function _showVideoPostRoll() {
+ var videoPostRollViewModel = new MS.Entertainment.ViewModels.VideoPostRollViewModel;
+ if (videoPostRollViewModel.isValid)
+ MS.Entertainment.UI.Controls.Video.VideoPostRoll.showVideoPostRollOverlay(videoPostRollViewModel)
+ }, nowPlayingMouseDown: function nowPlayingMouseDown(event) {
+ if (event.button === 2)
+ return;
+ if (event.srcElement.className === String.empty || event.srcElement.className === "nowPlayingTransportControlsContainer" || WinJS.Utilities.hasClass(event.srcElement, "seekBarScroller") || (this._transportControls && event.srcElement === this._transportControls.domElement) || (this._nowPlayingOverlayContainer && event.srcElement === this._nowPlayingOverlayContainer.domElement) || event.srcElement.tagName === "path" || event.srcElement.tagName === "rect" || event.srcElement.tagName === "svg") {
+ if (WinJS.Utilities.hasClass(event.srcElement, "seekBarScroller") || !this.transportControlsVisible || !this.overlaysVisible)
+ this.showOverlays();
+ else
+ this.hideOverlays();
+ this._lastMousePos.x = event.x;
+ this._lastMousePos.y = event.y
+ }
+ }, nowPlayingMouseMove: function nowPlayingMouseMove(event) {
+ if (this._seekbar && this._seekBar.isManipulating || (Math.abs(event.x - this._lastMousePos.x) < 10 && Math.abs(event.y - this._lastMousePos.y) < 10))
+ return;
+ if (!this._uiStateService.isSnapped)
+ this.showOverlays(this._uiStateService.isSnapped);
+ this.updateCursorVisibility(true)
+ }, nowPlayingKeyUp: function nowPlayingKeyUp(event) {
+ if (!this.initialized || this.frozen || this._freezeDelayPromise)
+ return;
+ if (event && event.keyCode === WinJS.Utilities.Key.escape)
+ this.hideOverlays();
+ else if (event && this._allowedKeys && this._allowedKeys.indexOf(event.keyCode) >= 0)
+ this.showOverlays()
+ }, nowPlayingKeyDown: function nowPlayingKeyDown(event) {
+ if (event && event.keyCode === WinJS.Utilities.Key.dismissButton)
+ if (this.overlaysVisible) {
+ this.hideOverlays();
+ event.stopPropagation()
+ }
+ }, _detachBindings: function _detachBindings() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._eventHandlers) {
+ this._eventHandlers.cancel();
+ this._eventHandlers = null
+ }
+ }, freeze: function freeze() {
+ if (this.frozen) {
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this);
+ return
+ }
+ this.frozen = true;
+ if (this._freezeDelayPromise) {
+ this._freezeDelayPromise.cancel();
+ this._freezeDelayPromise = null
+ }
+ this._freezeDelayPromise = WinJS.Promise.timeout(this._freezeDelayTimerMS).then(function freezeControl() {
+ this.backVisible = true;
+ this._backButtonService.showBackButton(true);
+ this._freezeDelayPromise = null;
+ this._suspendControl()
+ }.bind(this));
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ if (!this._uiStateService.nowPlayingVisible && !this._uiStateService.isSnapped) {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ return
+ }
+ this.showOverlays(true);
+ this.frozen = false;
+ this._resetAutoHideTimer(false);
+ if (this._mediaChangedWhileFrozen) {
+ this._playbackSessionChanged();
+ this._mediaChangedWhileFrozen = false
+ }
+ if (this._freezeDelayPromise) {
+ this._freezeDelayPromise.cancel();
+ this._freezeDelayPromise = null;
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ return
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._showTime = new Date;
+ this._playbackSessionChanged();
+ if (!this._keyHandlers) {
+ var keyHandlerElement = MS.Entertainment.Utilities.isApp2 ? this.domElement : document;
+ this._keyHandlers = MS.Entertainment.Utilities.addEventHandlers(keyHandlerElement, {
+ keydown: this.nowPlayingKeyDown.bind(this), keyup: this.nowPlayingKeyUp.bind(this)
+ }, false)
+ }
+ }, _suspendControl: function _suspendControl() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFullScreenVideo = false;
+ this.updateCursorVisibility(true);
+ this._detachBindings();
+ this.overlaysVisible = false;
+ this.detailsButtonVisible = false;
+ if (this._mainHeader)
+ this._mainHeader.visibility = true;
+ if (this._keyHandlers) {
+ this._keyHandlers.cancel();
+ this._keyHandlers = null
+ }
+ }, unload: function unload() {
+ this.initialized = false;
+ if (this._deferredUpdateTimer) {
+ this._deferredUpdateTimer.cancel();
+ this._deferredUpdateTimer = null
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isFullScreenVideo = false;
+ this._resetAutoHideTimer(true);
+ if (this.autoHideCursorTimeout) {
+ clearTimeout(this.autoHideCursorTimeout);
+ this.autoHideCursorTimeout = null
+ }
+ if (this._mainHeader)
+ this._mainHeader.visibility = true;
+ this._detachBindings();
+ if (this._keyHandlers) {
+ this._keyHandlers.cancel();
+ this._keyHandlers = null
+ }
+ if (this._seekBarManipulatingChangedBound) {
+ this._seekBar.unbind("isManipulating", this._seekBarManipulatingChangedBound);
+ this._seekBarManipulatingChangedBound = null
+ }
+ if (this._playbackSessionChangedBound) {
+ this.unbind("playbackSession", this._playbackSessionChangedBound);
+ this._playbackSessionChangedBound = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _playbackSessionChanged: function _playbackSessionChanged() {
+ this._detachBindings();
+ if (this.playbackSession) {
+ this._eventHandlers = MS.Entertainment.Utilities.addEvents(this.playbackSession, {
+ currentMediaChanged: this._mediaChanged.bind(this), currentTransportStateChanged: this._mediaStateChanged.bind(this), currentPositionChanged: this._mediaPositionChanged.bind(this)
+ });
+ this._mediaChanged({detail: {newValue: this.playbackSession.currentMedia}});
+ this._mediaStateChanged({detail: {newValue: this.playbackSession.currentTransportState}});
+ this._mediaPositionChanged({detail: {newValue: this.playbackSession.currentPosition}});
+ this._bindings = WinJS.Binding.bind(this, {_uiStateService: {
+ appBarVisible: this._appBarVisibleChanged.bind(this), isSnapped: this._isSnappedChanged.bind(this), isSettingsCharmVisible: this._settingsCharmVisibleChanged.bind(this), nowPlayingInset: this._updateStates.bind(this)
+ }})
+ }
+ if (this.initialized) {
+ this._seekBar.playbackSession = this.playbackSession;
+ this._transportControls.playbackSession = this.playbackSession
+ }
+ this._updateStates()
+ }, _appBarVisibleChanged: function _appBarVisibleChanged(newVal) {
+ if (this.frozen)
+ return;
+ if (newVal) {
+ this._resetAutoHideTimer(true);
+ if (!this._uiStateService.nowPlayingTileVisible)
+ this._hideTransportControls()
+ }
+ else
+ this._resetAutoHideTimer();
+ this._updateStates()
+ }, _settingsCharmVisibleChanged: function _settingsCharmVisibleChanged(newVal) {
+ if (newVal)
+ this.showOverlays();
+ else
+ this._updateStates()
+ }, _isSnappedChanged: function _isSnappedChanged(newVal, oldVal) {
+ if (this._uiStateService.isSnapped) {
+ WinJS.Utilities.removeClass(this.domElement, "engage");
+ this.showOverlays(true);
+ this._updateStates();
+ this.hideBackButton(true)
+ }
+ else if (!this.frozen && oldVal !== undefined)
+ this.showOverlays(true)
+ }, _hideTransportControls: function _hideTransportControls() {
+ if (this.playbackSession)
+ this.overlaysVisible = false;
+ else {
+ this.overlaysVisible = this._uiStateService.isSnapped;
+ if (!this._uiStateService.isSnapped) {
+ this._updateTransportControlsVisibility(false);
+ if (this._seekBar)
+ this._seekBar.metadataVisible = false
+ }
+ this.detailsButtonVisible = this._uiStateService.appBarVisible;
+ if (MS.Entertainment.Platform.PlaybackHelpers.shouldDisplayRatingImage() && this._ratingImageUrl !== String.empty)
+ this.ratingImageVisible = true
+ }
+ }, hideOverlays: function hideOverlays() {
+ if (!this._uiStateService.isSnapped && (((this._seekbar && this._seekBar.isManipulating) && this.playbackSession.currentTransportState !== MS.Entertainment.Platform.Playback.TransportState.starting) || (!this._useBranding && this.playbackSession && this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped)))
+ this.showOverlays();
+ else {
+ this._resetAutoHideTimer(true);
+ this.hideBackButton();
+ this._hideTransportControls();
+ this.updateCursorVisibility(false);
+ this.detailsButtonVisible = false;
+ if (MS.Entertainment.Platform.PlaybackHelpers.shouldDisplayRatingImage() && this._ratingImageUrl !== String.empty)
+ this.ratingImageVisible = true;
+ this._updateStates()
+ }
+ }, updateCursorVisibility: function updateCursorVisibility(visibility) {
+ var cursorStyle = visibility ? "default" : "none";
+ if (this._overlaysContainer && this._overlaysContainer.style.cursor !== cursorStyle)
+ this._overlaysContainer.style.cursor = cursorStyle;
+ if (this.autoHideCursorTimeout) {
+ clearTimeout(this.autoHideCursorTimeout);
+ this.autoHideCursorTimeout = null
+ }
+ if (visibility) {
+ var autoHideDurationMs = this._uiSettings.messageDuration * 1000;
+ this.autoHideCursorTimeout = setTimeout(function nowPlayingCursorAutoHide() {
+ this.updateCursorVisibility(false)
+ }.bind(this), autoHideDurationMs)
+ }
+ }, showOverlays: function showOverlays() {
+ if (!this.initialized)
+ return;
+ if (this.overlaysVisible && this.transportControlsVisible) {
+ this._resetAutoHideTimer(false);
+ return
+ }
+ if (this._uiStateService.isSnapped) {
+ this._updateStates();
+ this._updateTransportControlsVisibility(true);
+ this.seekBarVisible = true;
+ this.playIconVisible = false;
+ this._resetAutoHideTimer(false);
+ return
+ }
+ if (this.playbackSession && this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.starting) {
+ this.hideOverlays();
+ return
+ }
+ this.overlaysVisible = true;
+ this._updateTransportControlsVisibility(true);
+ this.playIconVisible = false;
+ this.updateCursorVisibility(true);
+ this.showBackButton();
+ this._resetAutoHideTimer(false);
+ this._updateStates()
+ }, hideBackButton: function hideBackButton(force) {
+ if (this._mainHeader && (force || !this._uiStateService.nowPlayingInset))
+ this.backVisible = false;
+ this._updateStates()
+ }, showBackButton: function showBackButton() {
+ if (!this._uiStateService.isSnapped && !this.backVisible) {
+ this.backVisible = true;
+ this._updateStates()
+ }
+ }, hide: function hide(){}, _resetAutoHideTimer: function _resetAutoHideTimer(clear) {
+ if (this.autoHideTimeout) {
+ clearTimeout(this.autoHideTimeout);
+ this.autoHideTimeout = null
+ }
+ var timeoutMs = this.autoHideVideoOverlays;
+ var isHidden = !this.overlaysVisible && !this._uiStateService.appBarVisible && !this._uiStateService.isSettingsCharmVisible && !this.backVisible;
+ if (!clear && timeoutMs > 0 && !isHidden)
+ this.autoHideTimeout = setTimeout(function nowPlayingAutoHide() {
+ if ((!this._seekBar || !this._seekBar.isManipulating) && (this._uiStateService.isSnapped || this._uiStateService.nowPlayingVisible))
+ this.hideOverlays()
+ }.bind(this), timeoutMs)
+ }, _seekBarManipulatingChanged: function _seekBarManipulatingChanged() {
+ if (this.playbackSession)
+ this.seekBarManipulating = this._seekBar.isManipulating;
+ this.showOverlays()
+ }, _mediaPositionChanged: function _mediaPositionChanged(e) {
+ var newVal = e.detail.newValue;
+ var oldVal = e.detail.oldValue;
+ if (this.frozen || !this.initialized)
+ return;
+ if (this.playbackSession && this.playbackSession.currentMedia && MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia) && (this.playbackSession.targetTransportState !== MS.Entertainment.Platform.Playback.TransportState.unInitialize || this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped)) {
+ var durationMs = this.playbackSession.duration;
+ var positionMs = this.playbackSession.currentPosition;
+ var metadataClock = MS.Entertainment.Utilities.millisecondsToTimeCode(Math.min(durationMs, positionMs));
+ var duration = MS.Entertainment.Utilities.formatTimeString(durationMs);
+ var progress = MS.Entertainment.Utilities.formatTimeString(Math.min(durationMs, positionMs));
+ var progressText = String.load(String.id.IDS_PROGRESS_NAR).format(progress, duration);
+ var metadataDuration = MS.Entertainment.Utilities.millisecondsToTimeCode(durationMs);
+ this._metadataControl.durationText = metadataClock + "/" + metadataDuration
+ }
+ else
+ this._metadataControl.durationText = String.empty
+ }, _mediaChanged: function _mediaChanged(e) {
+ var newVal = e.detail.newValue;
+ var oldVal = e.detail.oldValue;
+ if (!this.initialized)
+ return;
+ else if (this.frozen) {
+ this._mediaChangedWhileFrozen = true;
+ return
+ }
+ this._metadataControl.modelItem = this.playbackSession.currentMedia;
+ if (this.playbackSession && this.playbackSession.currentMedia !== null)
+ MS.Entertainment.Platform.PlaybackHelpers.getVideoRatingImageAsync().done(function getVideoRatingImageComplete(ratingImage) {
+ if (ratingImage === String.empty) {
+ this.ratingImage = String.empty;
+ this.ratingImageVisible = false
+ }
+ else if (MS.Entertainment.Platform.PlaybackHelpers.shouldDisplayRatingImage()) {
+ this.ratingImage = ratingImage;
+ this.ratingImageVisible = true
+ }
+ }.bind(this), function getVideoRatingImageError(){})
+ }, _mediaStateChanged: function _mediaStateChanged(e) {
+ var newVal = e.detail.newValue;
+ var oldVal = e.detail.oldValue;
+ if (this.frozen || !this.initialized)
+ return;
+ if (newVal === MS.Entertainment.Platform.Playback.TransportState.starting)
+ this.hideOverlays();
+ else if (oldVal)
+ if (newVal === MS.Entertainment.Platform.Playback.TransportState.stopped)
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ this.showOverlays();
+ if (this.playbackSession.currentMedia && !this.playbackSession.currentMedia.hasServiceId && this.playbackSession.currentMedia.activationFilePath && this.playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.stopped)
+ this._showVideoPostRoll()
+ }
+ }, _updateStates: function _updateStates() {
+ if (this._deferredUpdateTimer || this.frozen)
+ return;
+ this._deferredUpdateTimer = WinJS.Promise.timeout(MS.Entertainment.Platform.PlaybackHelpers.deferredUpdateTimeout).then(this._updateStatesDeferred.bind(this))
+ }, _updateStatesDeferred: function _updateStatesDeferred() {
+ this._deferredUpdateTimer = null;
+ if (!this.playbackSession || !this.initialized)
+ return;
+ var detailsButtonVisible = this.detailsButtonVisible;
+ this.overlaysVisible = this._uiStateService.isSnapped || this.overlaysVisible;
+ var showHeader = (this.backVisible || this.overlaysVisible);
+ if (this._mainHeader && (!this.playbackSession || (!this._uiStateService.engageVisible && !MS.Entertainment.Platform.PlaybackHelpers.isMusicTrack(this.playbackSession.currentMedia))))
+ this._mainHeader.visibility = showHeader;
+ if (this.backVisible)
+ this._backButtonService.showBackButton(true);
+ else
+ this._backButtonService.hideBackButton(true);
+ this.seekBarVisible = this.transportControlsVisible && this.playbackSession.duration > 0;
+ detailsButtonVisible = !MS.Entertainment.Utilities.isVideoApp2 && !this._uiStateService.isSnapped && (this.overlaysVisible && this.transportControlsVisible);
+ if (this.playbackSession.currentMedia && !this.playbackSession.currentMedia.hasServiceId) {
+ this._uiStateService.nowPlayingInset = false;
+ detailsButtonVisible = false
+ }
+ this.detailsButtonVisible = !this._uiStateService.isSnapped && !MS.Entertainment.Utilities.isVideoApp2 && detailsButtonVisible;
+ this.detailsButtonIcon = MS.Entertainment.UI.Icon.details;
+ if (this.overlaysVisible && this.transportControlsVisible && this.ratingImageVisible)
+ this.ratingImageVisible = false;
+ this._uiStateService.isFullScreenVideo = !this.frozen && !this._uiStateService.isSnapped && !this._uiStateService.appBarVisible && !this._uiStateService.isSettingsCharmVisible && !this.overlaysVisible;
+ if (this.transportControlsVisible && MS.Entertainment.Utilities.isVideoApp2)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this._transportControls.domElement)
+ }, _updateTransportControlsVisibility: function _updateTransportControlsVisibility(makeVisible) {
+ if (this.transportControlsVisible === makeVisible)
+ return;
+ this.transportControlsVisible = makeVisible
+ }, _updateVisibility: function _updateVisibility(element, makeVisible) {
+ var timeout = 500;
+ var domElement = element;
+ if (element && element.domElement)
+ domElement = element.domElement;
+ if (!domElement)
+ return WinJS.Promise.as();
+ if (makeVisible)
+ return MS.Entertainment.Utilities.showElement(domElement);
+ else
+ return MS.Entertainment.Utilities.hideElement(domElement, timeout).then(null, function onTimeout() {
+ WinJS.Utilities.addClass(domElement, "hideFromDisplay")
+ })
+ }, overlaysVisible: {
+ get: function() {
+ return this._overlaysVisible
+ }, set: function(value) {
+ if (this._overlaysVisible !== value) {
+ this._overlaysVisible = value;
+ if (this._overlaysVisiblePromise) {
+ this._overlaysVisiblePromise.cancel();
+ this._overlaysVisiblePromise = null
+ }
+ this._overlaysVisiblePromise = this._updateVisibility(this._nowPlayingOverlayContainer, value).then(function clearPromise() {
+ this._overlaysVisiblePromise = null
+ }.bind(this), function ignoreError(){})
+ }
+ }
+ }, detailsButtonVisible: {
+ get: function() {
+ return this._detailsButtonVisible
+ }, set: function(value) {
+ if (this._detailsButtonVisible !== value) {
+ this._detailsButtonVisible = value;
+ if (this._detailsButtonVisiblePromise) {
+ this._detailsButtonVisiblePromise.cancel();
+ this._detailsButtonVisiblePromise = null
+ }
+ this._detailsButtonVisiblePromise = this._updateVisibility(this._detailsButton, value).then(function clearPromise() {
+ this._detailsButtonVisiblePromise = null
+ }.bind(this), function ignoreError(){})
+ }
+ }
+ }, ratingImageVisible: {
+ get: function() {
+ return this._ratingImageVisible
+ }, set: function(value) {
+ if (this._ratingImageVisible !== value) {
+ this._ratingImageVisible = value;
+ if (this._ratingImageVisiblePromise) {
+ this._ratingImageVisiblePromise.cancel();
+ this._ratingImageVisiblePromise = null
+ }
+ this._ratingImageVisiblePromise = MS.Entertainment.Utilities.toggleDisplayCollapseElement(this._ratingImageContainer, value).then(function clearPromise() {
+ this._ratingImageVisiblePromise = null
+ }.bind(this), function ignoreError(){})
+ }
+ }
+ }, seekBarVisible: {
+ get: function() {
+ return this._seekBarVisible
+ }, set: function(value) {
+ if (this._seekBarVisible !== value) {
+ this._seekBarVisible = value;
+ if (this._seekBarVisiblePromise) {
+ this._seekBarVisiblePromise.cancel();
+ this._seekBarVisiblePromise = null
+ }
+ this._seekBarVisiblePromise = this._updateVisibility(this._seekBar, value).then(function clearPromise() {
+ this._seekBarVisiblePromise = null
+ }.bind(this), function ignoreError(){})
+ }
+ }
+ }, transportControlsVisible: {
+ get: function() {
+ return this._transportControlsVisible
+ }, set: function(value) {
+ if (this._transportControlsVisible !== value) {
+ this._transportControlsVisible = value;
+ if (this._transportControlsVisiblePromise) {
+ this._transportControlsVisiblePromise.cancel();
+ this._transportControlsVisiblePromise = null
+ }
+ this._transportControlsVisiblePromise = this._updateVisibility(this._transportControls, value).then(function clearPromise() {
+ this._transportControlsVisiblePromise = null
+ }.bind(this), function ignoreError(){})
+ }
+ }
+ }, ratingImage: {
+ get: function() {
+ return this._ratingImage
+ }, set: function(value) {
+ this._ratingImageUrl = value;
+ this.updateAndNotify("videoRatingImage", value)
+ }
+ }
+ }, {
+ initialized: false, playbackSession: null, seekBarManipulating: false, playIconVisible: false, backVisible: true, detailsButtonIcon: MS.Entertainment.UI.Icon.screenNormal, frozen: false, detailsButtonClick: function detailsButtonClick(event) {
+ var showDetailsEvent = document.createEvent("Event");
+ showDetailsEvent.initEvent("NowPlaying_ShowDetails", true, false);
+ this.domElement.dispatchEvent(showDetailsEvent);
+ event.cancelBubble = true
+ }
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Video/VideoPostRoll.html b/packages/microsoft.zunevideo/controls/Video/VideoPostRoll.html
new file mode 100644
index 00000000..f73f879d
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/VideoPostRoll.html
@@ -0,0 +1,60 @@
+
+
+
+
+ Video Post-Roll Control
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/VideoPostRoll.js b/packages/microsoft.zunevideo/controls/Video/VideoPostRoll.js
new file mode 100644
index 00000000..65fa2bd5
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/VideoPostRoll.js
@@ -0,0 +1,296 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ (function(Video) {
+ var VideoPostRoll = (function(_super) {
+ __extends(VideoPostRoll, _super);
+ function VideoPostRoll(element, options) {
+ this.templateStorage = "/Controls/Video/VideoPostRoll.html";
+ this.templateName = "template-videoPostRoll";
+ _super.call(this, element, options)
+ }
+ Object.defineProperty(VideoPostRoll.prototype, "viewModel", {
+ get: function() {
+ return this._viewModel
+ }, set: function(value) {
+ this.updateAndNotify("viewModel", value)
+ }, enumerable: true, configurable: true
+ });
+ VideoPostRoll.showVideoPostRollOverlay = function(viewModel) {
+ var overlay = new MS.Entertainment.UI.Controls.Overlay(null, {
+ userControl: MS.Entertainment.UI.Controls.Video.VideoPostRoll, userControlOptions: {viewModel: viewModel}, customStyle: "videoPostRollOverlay", dismissOnAppBarShown: true, enableKeyboardLightDismiss: true, top: null, left: null, right: null, bottom: null
+ });
+ overlay.setAccessibilityTitle(viewModel.upsellMessageText);
+ MS.Entertainment.Utilities.Telemetry.logVideoPostRollAction(viewModel.abTestName, viewModel.abGroupName, MS.Entertainment.ViewModels.VideoPostRollActions.ShowPostRoll);
+ overlay.show().done(function(overlay) {
+ if (overlay && overlay.hideReason === MS.Entertainment.UI.Controls.OverlayHideReasons.lightDismiss) {
+ MS.Entertainment.Utilities.Telemetry.logVideoPostRollAction(viewModel.abTestName, viewModel.abGroupName, MS.Entertainment.ViewModels.VideoPostRollActions.DismissPostRoll);
+ return
+ }
+ })
+ };
+ return VideoPostRoll
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Video.VideoPostRoll = VideoPostRoll
+ })(Controls.Video || (Controls.Video = {}));
+ var Video = Controls.Video
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(ViewModels) {
+ var VideoPostRollViewModel = (function(_super) {
+ __extends(VideoPostRollViewModel, _super);
+ function VideoPostRollViewModel() {
+ _super.call(this);
+ this._isValid = false;
+ this._abTestName = null;
+ this._abGroupName = null;
+ this._titleIcon = null;
+ this._titleText = null;
+ this._upsellMessageText = null;
+ this._upsellButtonText = null;
+ this._upsellButtonAction = null;
+ this._upsellItems = null;
+ this._cssClass = null;
+ this.initialize()
+ }
+ Object.defineProperty(VideoPostRollViewModel.prototype, "isValid", {
+ get: function() {
+ return this._isValid
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "abTestName", {
+ get: function() {
+ return this._abTestName
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "abGroupName", {
+ get: function() {
+ return this._abGroupName
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "titleIcon", {
+ get: function() {
+ return this._titleIcon
+ }, set: function(value) {
+ this.updateAndNotify("titleIcon", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "titleText", {
+ get: function() {
+ return this._titleText
+ }, set: function(value) {
+ this.updateAndNotify("titleText", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "upsellMessageText", {
+ get: function() {
+ return this._upsellMessageText
+ }, set: function(value) {
+ this.updateAndNotify("upsellMessageText", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "upsellButtonText", {
+ get: function() {
+ return this._upsellButtonText
+ }, set: function(value) {
+ this.updateAndNotify("upsellButtonText", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "upsellButtonAction", {
+ get: function() {
+ return this._upsellButtonAction
+ }, set: function(value) {
+ this.updateAndNotify("upsellButtonAction", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "upsellItems", {
+ get: function() {
+ return this._upsellItems
+ }, set: function(value) {
+ this.updateAndNotify("upsellItems", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollViewModel.prototype, "cssClass", {
+ get: function() {
+ return this._cssClass
+ }, set: function(value) {
+ this.updateAndNotify("cssClass", value)
+ }, enumerable: true, configurable: true
+ });
+ VideoPostRollViewModel.prototype.initialize = function() {
+ var _this = this;
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var videoPostRollLastReset = config.video.videoPostRollResetDate;
+ var videoPostRollNextReset = new Date(videoPostRollLastReset.getFullYear(), videoPostRollLastReset.getMonth(), (videoPostRollLastReset.getDate() + config.video.videoPostRollResetInterval));
+ var today = new Date;
+ if (today >= videoPostRollNextReset) {
+ config.video.showVideoPostRollCount = 0;
+ config.video.videoPostRollResetDate = today
+ }
+ if (config.shell.retailExperience || (config.video.showVideoPostRollCount >= config.video.showVideoPostRollMax))
+ return;
+ config.video.showVideoPostRollCount++;
+ VideoPostRollHelpers.registerABTests();
+ this._abTestName = VideoPostRollHelpers.abTestName;
+ this._abGroupName = VideoPostRollHelpers.abGroupName;
+ this._isValid = (Entertainment.Utilities.ABTesting.getABGroupNumber(this._abTestName) > 0);
+ if (this.isValid) {
+ this.titleIcon = Entertainment.UI.Icon.xboxXenonLogo;
+ this.titleText = Entertainment.ServiceLocator.getService(Entertainment.Services.uiState).applicationTitle;
+ var groupOptions = this.getGroupOptions(this._abGroupName);
+ this.cssClass = groupOptions.cssClass;
+ this.upsellMessageText = String.load(groupOptions.upsellMessageTextStringId);
+ this.upsellButtonText = String.load(groupOptions.upsellButtonTextStringId);
+ this.upsellButtonAction = groupOptions.upsellButtonAction;
+ if (groupOptions.upsellEditorialQuery) {
+ var listIndex = 0;
+ var query = groupOptions.upsellEditorialQuery;
+ query.queryId = "upsellEditorialQuery";
+ this.upsellItems = null;
+ query.execute().done(function(queryResult) {
+ query.dispose();
+ var editorialItems = [];
+ var randomItems = [];
+ if (WinJS.Utilities.getMember("result.entriesArray.length", queryResult) > listIndex) {
+ var listItems = queryResult.result.entriesArray[listIndex].editorialItems;
+ var maxRandomItems = groupOptions.upsellEditorialMaxItems;
+ if (listItems) {
+ for (var i = 0; i < maxRandomItems && listItems.length > 0; i++) {
+ var randomIndex = Math.floor(Math.random() * listItems.length);
+ var randomItem = listItems.splice(randomIndex, 1)[0];
+ randomItems.push(randomItem)
+ }
+ editorialItems = randomItems.map(function(item) {
+ return Entertainment.Utilities.convertEditorialItem(item.editorialItem)
+ })
+ }
+ }
+ _this.upsellItems = new Entertainment.ObservableArray(editorialItems)
+ }, function(error) {
+ query.dispose()
+ })
+ }
+ }
+ };
+ VideoPostRollViewModel.prototype.getGroupOptions = function(groupName) {
+ var upsellButtonTextStringId;
+ var upsellButtonAction = null;
+ var upsellEditorialQuery = null;
+ var upsellEditorialMaxItems = 2;
+ var navigatePage = Entertainment.UI.Monikers.root;
+ var navigatePanel = null;
+ switch (groupName) {
+ case Entertainment.Utilities.ABGroupNames.VideoPostRoll.MovieStore:
+ navigatePanel = Entertainment.UI.Monikers.movieMarketplacePanel;
+ upsellButtonTextStringId = String.id.IDS_VIDEO_UPSELL_BROWSE_NEW_MOVIES_SC;
+ upsellEditorialQuery = new Entertainment.Data.Query.MovieHub;
+ upsellEditorialMaxItems = 4;
+ break;
+ case Entertainment.Utilities.ABGroupNames.VideoPostRoll.TvStore:
+ navigatePanel = Entertainment.UI.Monikers.tvMarketplacePanel;
+ upsellButtonTextStringId = String.id.IDS_VIDEO_UPSELL_BROWSE_NEW_TV_SC;
+ upsellEditorialQuery = new Entertainment.Data.Query.TvHub;
+ upsellEditorialMaxItems = 3;
+ break
+ }
+ upsellButtonAction = this.createVideoPostRollNavigateAction(VideoPostRollActions.NavigateUpsell, navigatePanel);
+ return {
+ upsellMessageTextStringId: String.id.IDS_VIDEO_UPSELL_VIEW_NEW_RELEASES_SC, upsellButtonTextStringId: upsellButtonTextStringId, cssClass: "videoPostRoll-greyTheme", upsellButtonAction: upsellButtonAction, upsellEditorialQuery: upsellEditorialQuery, upsellEditorialMaxItems: upsellEditorialMaxItems
+ }
+ };
+ VideoPostRollViewModel.prototype.createVideoPostRollNavigateAction = function(videoPostRollAction, panel) {
+ if (!panel)
+ panel = null;
+ var action = Entertainment.ServiceLocator.getService(Entertainment.Services.actions).getAction(Entertainment.UI.Actions.ActionIdentifiers.videoPostRollNavigate);
+ action.parameter = {
+ page: Entertainment.UI.Monikers.root, panel: panel, abTestName: this._abTestName, abGroupName: this._abGroupName, videoPostRollAction: videoPostRollAction
+ };
+ return action
+ };
+ return VideoPostRollViewModel
+ })(Entertainment.UI.Framework.ObservableBase);
+ ViewModels.VideoPostRollViewModel = VideoPostRollViewModel;
+ var VideoPostRollHelpers = (function() {
+ function VideoPostRollHelpers(){}
+ Object.defineProperty(VideoPostRollHelpers, "abTestName", {
+ get: function() {
+ return this._abTestName
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoPostRollHelpers, "abGroupName", {
+ get: function() {
+ return this._abGroupName
+ }, enumerable: true, configurable: true
+ });
+ VideoPostRollHelpers.registerABTests = function() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var movieMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var marketplaceEnabled = movieMarketplaceEnabled || tvMarketplaceEnabled;
+ var abTestName = null;
+ if (movieMarketplaceEnabled && tvMarketplaceEnabled)
+ abTestName = MS.Entertainment.Utilities.ABTestsEnum.videoPostRoll;
+ else if (movieMarketplaceEnabled)
+ abTestName = MS.Entertainment.Utilities.ABTestsEnum.videoPostRollNoTvMarketplace;
+ else if (tvMarketplaceEnabled)
+ abTestName = MS.Entertainment.Utilities.ABTestsEnum.videoPostRollNoMovieMarketplace;
+ this._abTestName = abTestName;
+ var groups = new Array;
+ groups.push(new MS.Entertainment.Utilities.ABGroup(MS.Entertainment.Utilities.ABGroupNames.VideoPostRoll.Control));
+ if (movieMarketplaceEnabled)
+ groups.push(new MS.Entertainment.Utilities.ABGroup(MS.Entertainment.Utilities.ABGroupNames.VideoPostRoll.MovieStore));
+ if (tvMarketplaceEnabled)
+ groups.push(new MS.Entertainment.Utilities.ABGroup(MS.Entertainment.Utilities.ABGroupNames.VideoPostRoll.TvStore));
+ MS.Entertainment.Utilities.ABTesting.registerABTest(this._abTestName, groups);
+ MS.Entertainment.Utilities.ABTesting.createABGroupNumber(this._abTestName);
+ this._abGroupName = MS.Entertainment.Utilities.ABTesting.getABGroupName(this._abTestName)
+ };
+ VideoPostRollHelpers.unregisterTests = function() {
+ this._abTestName = null;
+ this._abGroupName = null;
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ config.abTestingOverrides.videoPostRoll = -1;
+ config.abTestingOverrides.videoPostRollNoMovieMarketplace = -1;
+ config.abTestingOverrides.videoPostRollNoTvMarketplace = -1
+ };
+ VideoPostRollHelpers._abTestName = null;
+ VideoPostRollHelpers._abGroupName = null;
+ return VideoPostRollHelpers
+ })();
+ ViewModels.VideoPostRollHelpers = VideoPostRollHelpers;
+ var VideoPostRollActions = (function() {
+ function VideoPostRollActions(){}
+ VideoPostRollActions.ShowPostRoll = "ShowPostRoll";
+ VideoPostRollActions.DismissPostRoll = "DismissPostRoll";
+ VideoPostRollActions.NavigateHome = "NavigateHome";
+ VideoPostRollActions.NavigateUpsell = "NavigateUpsell";
+ return VideoPostRollActions
+ })();
+ ViewModels.VideoPostRollActions = VideoPostRollActions
+ })(Entertainment.ViewModels || (Entertainment.ViewModels = {}));
+ var ViewModels = Entertainment.ViewModels
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.Video.VideoPostRoll)
diff --git a/packages/microsoft.zunevideo/controls/Video/WatchProgress.html b/packages/microsoft.zunevideo/controls/Video/WatchProgress.html
new file mode 100644
index 00000000..cee03567
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/WatchProgress.html
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video/WatchProgress.js b/packages/microsoft.zunevideo/controls/Video/WatchProgress.js
new file mode 100644
index 00000000..3c7a89de
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video/WatchProgress.js
@@ -0,0 +1,213 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ (function(Video) {
+ var WatchProgress = (function(_super) {
+ __extends(WatchProgress, _super);
+ function WatchProgress(element, options) {
+ this.templateStorage = (options && options.templateStorage) || "/Controls/Video/WatchProgress.html";
+ this.templateName = "watchProgress";
+ _super.call(this, element, options);
+ this.forceShowOnOwned = this.forceShowOnOwned || false;
+ this._showWatchProgress = this._showWatchProgress || true;
+ this._setupNavigationEventHandlers()
+ }
+ Object.defineProperty(WatchProgress.prototype, "forceShowOnOwned", {
+ get: function() {
+ return this._forceShowOnOwned
+ }, set: function(value) {
+ this._forceShowOnOwned = value;
+ this.updateAndNotify("forceShowOnOwned", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(WatchProgress.prototype, "showWatchProgress", {
+ get: function() {
+ return this._showWatchProgress
+ }, set: function(value) {
+ this._showWatchProgress = value;
+ this.updateAndNotify("_showWatchProgress", this._showWatchProgress)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(WatchProgress.prototype, "percentageWatched", {
+ get: function() {
+ return this._percentageWatched
+ }, set: function(value) {
+ this._percentageWatched = Math.max(0, Math.min(value, 100));
+ this.updateVisibility();
+ this.updateAndNotify("_percentageWatched", this._percentageWatched)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(WatchProgress.prototype, "viewModel", {
+ get: function() {
+ return this._viewModel
+ }, set: function(value) {
+ this._viewModel = value;
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ this._bindings = WinJS.Binding.bind(this, {_viewModel: {libraryId: this.getProgressWatched.bind(this)}});
+ this.getProgressWatched()
+ }, enumerable: true, configurable: true
+ });
+ WatchProgress.prototype.updateVisibility = function() {
+ this.showWatchProgress = (this.forceShowOnOwned && this._viewModel && this._viewModel.inCollection) || !!this.percentageWatched
+ };
+ WatchProgress.prototype.initialize = function() {
+ this.updateAccessibility()
+ };
+ WatchProgress.prototype.unload = function() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._navigationEventHandlers) {
+ this._navigationEventHandlers.cancel();
+ this._navigationEventHandlers = null
+ }
+ _super.prototype.unload.call(this)
+ };
+ WatchProgress.prototype.updateAccessibility = function() {
+ if (!this._progressBar || !this._ariaLabel)
+ return;
+ var progressText = String.load(String.id.IDS_DETAILS_PERC_WATCHED_LABEL).format(this.percentageWatched);
+ this._progressBar.setAttribute("aria-valuenow", this.percentageWatched);
+ this._ariaLabel.textContent = progressText;
+ this._ariaLabel.setAttribute("aria-valuetext", progressText);
+ this._ariaLabel.setAttribute("aria-label", progressText)
+ };
+ WatchProgress.prototype.getProgressWatched = function() {
+ var _this = this;
+ if (!this.viewModel) {
+ this.percentageWatched = 0;
+ return
+ }
+ if (this._viewModel.libraryId === undefined || this._viewModel.libraryId === -1) {
+ this.percentageWatched = 0;
+ return
+ }
+ var ms = new Microsoft.Entertainment.Platform.MediaStore;
+ var pendingBookmarkWriteOperations;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.bookmarkOperationsWatcher)) {
+ var bookmarkWatcher = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.bookmarkOperationsWatcher);
+ pendingBookmarkWriteOperations = bookmarkWatcher.waitForPendingOperations()
+ }
+ return WinJS.Promise.as(pendingBookmarkWriteOperations).then(function() {
+ return WinJS.Promise.timeout(500)
+ }).then(function() {
+ return WinJS.Promise.join({
+ bookmark: ms.videoProvider.getBookmarkAsync(_this._viewModel.libraryId), playedStatus: ms.videoProvider.getPlayedStatusAsync(_this._viewModel.libraryId)
+ })
+ }).then(function(results) {
+ var bookmark = results.bookmark;
+ var playedStatus = results.playedStatus;
+ if (bookmark && _this._viewModel)
+ _this._viewModel._bookmark = bookmark;
+ if (_this._viewModel && _this._viewModel._bookmark && _this._viewModel._bookmark.value > 0) {
+ var duration = _this._viewModel.duration;
+ var durationMilli = duration.getMilliseconds ? (duration.getMilliseconds() + (1000 * (duration.getSeconds() + (60 * (duration.getMinutes() + (60 * duration.getHours())))))) : duration;
+ _this.percentageWatched = Math.ceil((100 * _this._viewModel._bookmark.value) / durationMilli)
+ }
+ else if (playedStatus && playedStatus.value)
+ _this.percentageWatched = 100;
+ else
+ _this.percentageWatched = 0;
+ _this.updateAccessibility();
+ return WinJS.Promise.wrap(_this.percentageWatched)
+ })
+ };
+ WatchProgress.prototype._setupNavigationEventHandlers = function() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var page = WinJS.Binding.unwrap(navigationService.currentPage);
+ if (this._navigationEventHandlers) {
+ this._navigationEventHandlers.cancel();
+ this._navigationEventHandlers = null
+ }
+ this._navigationEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(page, {onNavigateTo: function onNavigateTo(args) {
+ this.getProgressWatched()
+ }.bind(this)})
+ }
+ };
+ return WatchProgress
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Video.WatchProgress = WatchProgress
+ })(Controls.Video || (Controls.Video = {}));
+ var Video = Controls.Video
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(Video) {
+ (function(Services) {
+ var BookmarkOperationsWatcher = (function() {
+ function BookmarkOperationsWatcher() {
+ this._pendingOperationsCount = 0;
+ this._signal = null
+ }
+ BookmarkOperationsWatcher.prototype.registerOperation = function(operation) {
+ var _this = this;
+ if (!operation) {
+ Trace.fail("Expected an operation!");
+ return
+ }
+ Trace.assert(this._pendingOperationsCount >= 0, "Unexpected _pendingOperationsCount: {0}".format(this._pendingOperationsCount));
+ this._pendingOperationsCount++;
+ operation.done(function() {
+ _this._onOperationComplete()
+ }, function() {
+ _this._onOperationComplete()
+ })
+ };
+ BookmarkOperationsWatcher.prototype.waitForPendingOperations = function() {
+ var promise;
+ if (this._pendingOperationsCount > 0) {
+ if (!this._signal)
+ this._signal = new MS.Entertainment.UI.Framework.Signal;
+ promise = this._signal.promise
+ }
+ return WinJS.Promise.as(promise)
+ };
+ BookmarkOperationsWatcher.prototype._onOperationComplete = function() {
+ Trace.assert(this._pendingOperationsCount > 0, "Unexpected _pendingOperationsCount: {0}".format(this._pendingOperationsCount));
+ this._pendingOperationsCount--;
+ if (this._pendingOperationsCount === 0 && this._signal) {
+ var signal = this._signal;
+ this._signal = null;
+ signal.complete()
+ }
+ };
+ BookmarkOperationsWatcher.factory = function() {
+ return new BookmarkOperationsWatcher
+ };
+ return BookmarkOperationsWatcher
+ })();
+ Services.BookmarkOperationsWatcher = BookmarkOperationsWatcher
+ })(Video.Services || (Video.Services = {}));
+ var Services = Video.Services
+ })(Entertainment.Video || (Entertainment.Video = {}));
+ var Video = Entertainment.Video
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.bookmarkOperationsWatcher, MS.Entertainment.Video.Services.BookmarkOperationsWatcher.factory, true);
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.Video.WatchProgress)
diff --git a/packages/microsoft.zunevideo/controls/VideoAd.html b/packages/microsoft.zunevideo/controls/VideoAd.html
new file mode 100644
index 00000000..621a33ee
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/VideoAd.html
@@ -0,0 +1,120 @@
+
+
+
+
+ Video Ad Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/VideoAd.js b/packages/microsoft.zunevideo/controls/VideoAd.js
new file mode 100644
index 00000000..af541331
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/VideoAd.js
@@ -0,0 +1,227 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js", "/Framework/utilities.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {VideoAd: MS.Entertainment.UI.Framework.defineUserControl("/Controls/VideoAd.html#videoAdTemplate", function videoAdConstructor(element, options) {
+ this._eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ this._playText = String.load(String.id.IDS_PLAY_BUTTON_VIDEO);
+ this._pauseText = String.load(String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON);
+ this.adReasonClickUrl = MS.Entertainment.UI.FWLink.advertisementReason
+ }, {
+ adClickUrl: null, adReasonClickUrl: null, adVideoUrl: null, adClickCallback: null, adCompleted: false, adErrorOccurred: false, playbackStartedCallback: null, _mediaContext: null, _eventProvider: null, _container: null, _resumePlayOnThaw: false, _overlayTimer: null, _playbackCheckTimer: null, _uiSettings: new Windows.UI.ViewManagement.UISettings, _lastTimeDuration: null, _volumeService: null, _volumeControllerBindings: null, _signIn: null, _signedInUser: null, _signInBinding: null, _subscriptionBinding: null, _uiStateBinding: null, tagMuted: true, tagVolume: null, initialize: function initialize() {
+ this._updateState();
+ this.overlay.domElement.setAttribute("aria-label", String.load(String.id.IDS_MUSIC_STREAMING_AD_LABEL));
+ this._signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ this._signInBinding = WinJS.Binding.bind(this._signIn, {isSignedIn: this._onUserStatusChanged.bind(this)});
+ this._subscriptionBinding = WinJS.Binding.bind(this._signedInUser, {isSubscription: this._onUserStatusChanged.bind(this)});
+ this._volumeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ this._volumeControllerBindings = WinJS.Binding.bind(this._volumeService, {
+ volume: this._onVolumeValueStateChange.bind(this), mute: this._onVolumeValueStateChange.bind(this)
+ });
+ this._uiStateBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {isSnapped: this._onSnappedChanged.bind(this)});
+ this._playbackCheckTimer = WinJS.Promise.timeout(MS.Entertainment.UI.Controls.VideoAd._playbackCheckTimeoutMS).then(function _playbackCheckTimeout() {
+ if (!this.playing)
+ this.onPlaybackError()
+ }.bind(this));
+ var appBarService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar);
+ this._mediaContext = appBarService.pushDefaultContext([]);
+ var appBarControl = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBarControl)
+ appBarControl.hide()
+ }, unload: function unload() {
+ if (this._playbackCheckTimer) {
+ this._playbackCheckTimer.cancel();
+ this._playbackCheckTimer = null
+ }
+ if (this._mediaContext) {
+ this._mediaContext.clearContext();
+ this._mediaContext = null
+ }
+ if (this.playbackStartedCallback)
+ this.playbackStartedCallback = null;
+ if (this._volumeControllerBindings) {
+ this._volumeControllerBindings.cancel();
+ this._volumeControllerBindings = null
+ }
+ if (this.video && this.video.src)
+ this.video.src = String.empty;
+ if (this._signInBinding) {
+ this._signInBinding.cancel();
+ this._signInBinding = null
+ }
+ if (this._subscriptionBinding) {
+ this._subscriptionBinding.cancel();
+ this._subscriptionBinding = null
+ }
+ if (this._uiStateBinding) {
+ this._uiStateBinding.cancel();
+ this._uiStateBinding = null
+ }
+ this._clearOverlayTimer();
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ if (this._initialized) {
+ this._hideOverlay();
+ this._resumePlayOnThaw = !this.video.paused;
+ if (this._resumePlayOnThaw)
+ this.video.pause()
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._initialized) {
+ this._showOverlay();
+ if (this._resumePlayOnThaw)
+ this.video.play()
+ }
+ }, setOverlay: function setOverlay(container) {
+ WinJS.Utilities.addClass(container.domElement, "videoAdContainer");
+ this._container = container
+ }, onPointerDown: function onPointerDown() {
+ if (!this.overlay.visibility)
+ this._showOverlay();
+ else
+ this._hideOverlay()
+ }, onKeyDown: function onKeyDown(e) {
+ if (e.keyCode === WinJS.Utilities.Key.escape)
+ this._hideOverlay();
+ else
+ this._showOverlay()
+ }, onPointerMove: function onPointerMove(e) {
+ if (e.pointerType !== e.MSPOINTER_TYPE_TOUCH && e.pointerType !== "touch")
+ this._showOverlay()
+ }, onPlayPauseClick: function onPlayPauseClick(event) {
+ if (this.video.paused)
+ this.video.play();
+ else
+ this.video.pause();
+ this._updateState();
+ this._showOverlay();
+ event.cancelBubble = true
+ }, onPlaybackTimeUpdate: function onPlaybackTimeUpdate() {
+ this._updateState()
+ }, onPlaybackPlaying: function onPlaybackPlaying() {
+ if (!this.playing) {
+ this.playing = true;
+ if (this._playbackCheckTimer) {
+ this._playbackCheckTimer.cancel();
+ this._playbackCheckTimer = null
+ }
+ if (this.playbackStartedCallback) {
+ this.playbackStartedCallback();
+ this.playbackStartedCallback = null
+ }
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdStart);
+ this._eventProvider.traceVideo_Ad_Started(this.adVideoUrl, this.adClickUrl)
+ }
+ this._showOverlay()
+ }, onPlaybackEnded: function onPlaybackEnded() {
+ this.adCompleted = true;
+ this._container.hide();
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdComplete);
+ this._eventProvider.traceVideo_Ad_Completed(this.adVideoUrl, this.adClickUrl)
+ }, onPlaybackError: function onPlaybackError() {
+ this.adCompleted = true;
+ this.adErrorOccurred = true;
+ this._container.hide();
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdError);
+ this._eventProvider.traceVideo_Ad_Error(this.adVideoUrl, this.adClickUrl)
+ }, onCloseClick: function onCloseClick() {
+ this.adCompleted = false;
+ this._container.hide();
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdClosed);
+ this._eventProvider.traceVideo_Ad_Skipped(this.adVideoUrl, this.adClickUrl)
+ }, onClickLearnMore: function onClickLearnMore() {
+ if (this.adClickCallback) {
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.videoAdClickThru);
+ this.adClickCallback()
+ }
+ }, onKeyDownLearnMore: function onKeyDownLearnMore(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onClickLearnMore()
+ }, onClickAdReason: function onClickAdReason() {
+ var adService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.adService);
+ adService.sendVideoAdReasonClickTelemetryInfo()
+ }, onClickUpSell: function onClickUpSell() {
+ this.video.pause();
+ this._updateState();
+ this._hideOverlay();
+ this._eventProvider.traceVideo_Ad_UpSell(this.adVideoUrl, this.adClickUrl);
+ MS.Entertainment.Music.Freeplay.sendTelemetryEvent(MS.Entertainment.Music.Freeplay.Events.musicPassUpsellVideoAdInvoked);
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.subscriptionSignup);
+ action.automationId = MS.Entertainment.UI.AutomationIds.videoAdSubscriptionSignup;
+ action.execute().done(function signUpComplete() {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser.isSubscription) {
+ this.adCompleted = true;
+ this._container.hide()
+ }
+ else {
+ this._showOverlay();
+ MS.Entertainment.UI.Framework.tryAndFocusElementInSubTreeWithTimer(this.upsellButton.domElement, 0)
+ }
+ }.bind(this), function signUpError(){})
+ }, _onUserStatusChanged: function _onUserStatusChanged() {
+ if (this._signIn.isSignedIn && this._signedInUser.isSubscription && this._initialized && !this._unloaded) {
+ this.adCompleted = true;
+ this._container.hide()
+ }
+ }, _onSnappedChanged: function _onSnappedChanged(newVal) {
+ if (newVal) {
+ this.video.pause();
+ MS.Entertainment.Framework.ScriptUtilities.waitForSnappedIfNeeded(true).done(function unsnappedCompleted() {
+ this.video.play()
+ }.bind(this), function unsnappedError(error) {
+ MS.Entertainment.UI.Controls.assert(WinJS.Promise.isCanceledError(error), "VideoAd::_onSnappedChanged: Failed to wait to snapped. Error:" + error + ": " + error.message)
+ })
+ }
+ }, _updateState: function _updateState() {
+ if (this.video.duration > 0) {
+ var secondsRemaining = Math.max(1, Math.ceil(this.video.duration - this.video.currentTime));
+ if (this._lastTimeDuration !== secondsRemaining) {
+ this.timeRemaining = String.load(String.id.IDS_VIDEO_AD_PROGRESS).format(secondsRemaining);
+ this.timeLabel.setAttribute("aria-label", this.timeRemaining);
+ this._lastTimeDuration = secondsRemaining
+ }
+ }
+ this.paused = this.video.paused;
+ this.playPauseButton.text = this.paused ? this._playText : this._pauseText
+ }, _clearOverlayTimer: function _clearOverlayTimer() {
+ if (this._overlayTimer) {
+ window.clearTimeout(this._overlayTimer);
+ this._overlayTimer = null
+ }
+ }, _hideOverlay: function _hideOverlay() {
+ this.overlay.visibility = false;
+ this._clearOverlayTimer()
+ }, _showOverlay: function _showOverlay() {
+ this.overlay.visibility = true;
+ this._clearOverlayTimer();
+ this._overlayTimer = window.setTimeout(function() {
+ if (!this._unloaded) {
+ this.overlay.visibility = false;
+ this._overlayTimer = null
+ }
+ }.bind(this), this._uiSettings.messageDuration * 1000)
+ }, _onVolumeValueStateChange: function _onVolumeValueStateChange() {
+ this.video.muted = this._volumeService.mute;
+ this.video.volume = this._volumeService.volume
+ }
+ }, {
+ timeRemaining: null, playing: false, paused: false
+ }, {
+ showVideoAd: function showVideoAd(adVideoUrl, adClickUrl, adClickCallback, playbackStartedCallback) {
+ if (!adVideoUrl)
+ throw"showVideoAd: adUrl parameter is mandatory";
+ var volumeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.volumeService);
+ var videoAdOverlay = MS.Entertainment.UI.Shell.createOverlay("MS.Entertainment.UI.Controls.VideoAd", {
+ adVideoUrl: adVideoUrl, adClickUrl: adClickUrl, adClickCallback: adClickCallback, playbackStartedCallback: playbackStartedCallback, tagMuted: volumeService.mute, tagVolume: volumeService.volume
+ }, {
+ left: "0px", top: "0px", right: "0px", bottom: "0px"
+ });
+ return videoAdOverlay.show()
+ }, _playbackCheckTimeoutMS: 10000
+ })})
+})()
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/AudioTrackPickerControl.html b/packages/microsoft.zunevideo/controls/Video_Win/AudioTrackPickerControl.html
new file mode 100644
index 00000000..6ce9de62
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/AudioTrackPickerControl.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/AudioTrackPickerControl.js b/packages/microsoft.zunevideo/controls/Video_Win/AudioTrackPickerControl.js
new file mode 100644
index 00000000..7a31a1f3
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/AudioTrackPickerControl.js
@@ -0,0 +1,139 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var AudioTrackPickerControlItem = (function(_super) {
+ __extends(AudioTrackPickerControlItem, _super);
+ function AudioTrackPickerControlItem(element, options) {
+ this.item = null;
+ this.templateStorage = "/Controls/Video_Win/AudioTrackPickerControl.html";
+ this.templateName = "templateid-audioTrackPickerItem";
+ _super.call(this, element, options)
+ }
+ AudioTrackPickerControlItem.prototype.initialize = function() {
+ if (this.item && this.item.itemSelectedHandler && this.item.selected)
+ this.item.itemSelectedHandler(this)
+ };
+ AudioTrackPickerControlItem.prototype.onClick = function(e) {
+ if (this.item && this.item.itemSelectedHandler)
+ this.item.itemSelectedHandler(this)
+ };
+ AudioTrackPickerControlItem.prototype.updateSelectedState = function(selected) {
+ if (this.item)
+ this.item.selected = selected;
+ if (selected)
+ WinJS.Utilities.addClass(this._itemElement, "state_selected");
+ else
+ WinJS.Utilities.removeClass(this._itemElement, "state_selected")
+ };
+ return AudioTrackPickerControlItem
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.AudioTrackPickerControlItem = AudioTrackPickerControlItem;
+ var AudioTrackPicker = (function(_super) {
+ __extends(AudioTrackPicker, _super);
+ function AudioTrackPicker(element, options) {
+ this.templateStorage = "/Controls/Video_Win/AudioTrackPickerControl.html";
+ this.templateName = "templateid-audioTrackPicker";
+ _super.call(this, element, options)
+ }
+ Object.defineProperty(AudioTrackPicker.prototype, "audioTracks", {
+ get: function() {
+ return this._audioTracks
+ }, set: function(value) {
+ this.updateAndNotify("audioTracks", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(AudioTrackPicker.prototype, "_selectedAudioTrackPickerControlItem", {
+ get: function() {
+ return this._selectedAudioTrackPickerControlItemValue
+ }, set: function(value) {
+ if (this._selectedAudioTrackPickerControlItemValue)
+ this._selectedAudioTrackPickerControlItem.updateSelectedState(false);
+ this._selectedAudioTrackPickerControlItemValue = value;
+ if (this._selectedAudioTrackPickerControlItemValue)
+ this._selectedAudioTrackPickerControlItemValue.updateSelectedState(true);
+ this._sessionManager.nowPlayingSession.selectAudioTrack(value.item.index)
+ }, enumerable: true, configurable: true
+ });
+ AudioTrackPicker.prototype.initialize = function() {
+ this._uiStateEventHandlers = null;
+ if (!this._sessionManager)
+ this._sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._updateAudioTracks();
+ this._uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ this._uiStateEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._uiStateService, {
+ windowresize: this._onUiStateChange.bind(this), isSnappedChanged: this._onUiStateChange.bind(this)
+ });
+ _super.prototype.initialize.call(this)
+ };
+ AudioTrackPicker.prototype.unload = function() {
+ _super.prototype.unload.call(this);
+ if (this._uiStateEventHandlers) {
+ this._uiStateEventHandlers.cancel();
+ this._uiStateEventHandlers = null
+ }
+ };
+ AudioTrackPicker.prototype._updateAudioTracks = function() {
+ if (!this.audioTracks) {
+ var rawAudioTracks = this._sessionManager.nowPlayingSession.getAudioTracks();
+ var audioTrackItems = [];
+ if (rawAudioTracks)
+ for (var i = 0; i < rawAudioTracks.length; i++) {
+ var rawAudioTrack = rawAudioTracks.item(i);
+ audioTrackItems.push(this._createAudioTrackItem(rawAudioTrack, i))
+ }
+ this.audioTracks = new Entertainment.ObservableArray(audioTrackItems);
+ this._audioTracksList.dataSource = this.audioTracks
+ }
+ };
+ AudioTrackPicker.prototype._createAudioTrackItem = function(rawAudioTrack, trackIndex) {
+ var ordinalPosition = trackIndex + 1;
+ var trackInfo = rawAudioTrack.label || this._getDisplayLanguage(rawAudioTrack) || String.empty;
+ var audioTrackTitle;
+ if (trackInfo)
+ audioTrackTitle = String.load(String.id.IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL_EXTENDED).format(ordinalPosition, trackInfo);
+ else
+ audioTrackTitle = String.load(String.id.IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL).format(ordinalPosition);
+ var selectedAudioTrack = this._sessionManager.nowPlayingSession.getSelectedAudioTrack();
+ return WinJS.Binding.as({item: {
+ index: trackIndex, label: audioTrackTitle, selected: (selectedAudioTrack === trackIndex), selectable: true, itemSelectedHandler: this._handleAudioTrackItemSelected.bind(this)
+ }})
+ };
+ AudioTrackPicker.prototype._getDisplayLanguage = function(rawAudioTrack) {
+ var originalLanguage = rawAudioTrack.language;
+ var twoLetterLanguageCode = MS.Entertainment.Utilities.Iso639ThreeLetterToTwoLetterLanguageMap[originalLanguage];
+ var displayLanguage = Entertainment.Utilities.getDisplayLanguageFromLanguageCode(originalLanguage) || Entertainment.Utilities.getDisplayLanguageFromLanguageCode(twoLetterLanguageCode) || originalLanguage;
+ return (displayLanguage !== "und") ? displayLanguage : String.empty
+ };
+ AudioTrackPicker.prototype._handleAudioTrackItemSelected = function(selectedAudioTrackPickerControlItem) {
+ if (selectedAudioTrackPickerControlItem && selectedAudioTrackPickerControlItem.item)
+ this._selectedAudioTrackPickerControlItem = selectedAudioTrackPickerControlItem
+ };
+ AudioTrackPicker.prototype._onUiStateChange = function() {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("dismissoverlay", true, true);
+ this.domElement.dispatchEvent(domEvent)
+ };
+ return AudioTrackPicker
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.AudioTrackPicker = AudioTrackPicker
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.AudioTrackPicker)
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/ClosedCaptionPickerControl.html b/packages/microsoft.zunevideo/controls/Video_Win/ClosedCaptionPickerControl.html
new file mode 100644
index 00000000..55c7ddc6
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/ClosedCaptionPickerControl.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/ClosedCaptionPickerControl.js b/packages/microsoft.zunevideo/controls/Video_Win/ClosedCaptionPickerControl.js
new file mode 100644
index 00000000..48216763
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/ClosedCaptionPickerControl.js
@@ -0,0 +1,146 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var MSEUIControls = MS.Entertainment.UI.Controls;
+ var ClosedCaptionPickerControlItem = (function(_super) {
+ __extends(ClosedCaptionPickerControlItem, _super);
+ function ClosedCaptionPickerControlItem(element, options) {
+ this.item = null;
+ this.templateStorage = "/Controls/Video_Win/ClosedCaptionPickerControl.html";
+ this.templateName = "templateid-closedCaptionPickerItem";
+ _super.call(this, element, options)
+ }
+ ClosedCaptionPickerControlItem.prototype.initialize = function() {
+ if (this.item && this.item.itemSelectedHandler && this.item.selected)
+ this.item.itemSelectedHandler(this)
+ };
+ ClosedCaptionPickerControlItem.prototype.onClick = function(e) {
+ if (this.item && this.item.itemSelectedHandler)
+ this.item.itemSelectedHandler(this)
+ };
+ ClosedCaptionPickerControlItem.prototype.updateSelectedState = function(selected) {
+ if (this.item)
+ this.item.selected = selected;
+ if (selected)
+ WinJS.Utilities.addClass(this._itemElement, "state_selected");
+ else
+ WinJS.Utilities.removeClass(this._itemElement, "state_selected")
+ };
+ return ClosedCaptionPickerControlItem
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.ClosedCaptionPickerControlItem = ClosedCaptionPickerControlItem;
+ var ClosedCaptionPicker = (function(_super) {
+ __extends(ClosedCaptionPicker, _super);
+ function ClosedCaptionPicker(element, options) {
+ this.templateStorage = "/Controls/Video_Win/ClosedCaptionPickerControl.html";
+ this.templateName = "templateid-closedCaptionPicker";
+ _super.call(this, element, options)
+ }
+ ClosedCaptionPicker.prototype.initialize = function() {
+ if (!this._sessionManager)
+ this._sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this._processCaptionLanguagesList()
+ };
+ Object.defineProperty(ClosedCaptionPicker.prototype, "_selectedClosedCaptionPickerControlItem", {
+ get: function() {
+ return this._selectedClosedCaptionPickerControlItemValue
+ }, set: function(value) {
+ if (this._selectedClosedCaptionPickerControlItemValue)
+ this._selectedClosedCaptionPickerControlItem.updateSelectedState(false);
+ this._selectedClosedCaptionPickerControlItemValue = value;
+ if (this._selectedClosedCaptionPickerControlItemValue)
+ this._selectedClosedCaptionPickerControlItemValue.updateSelectedState(true)
+ }, enumerable: true, configurable: true
+ });
+ ClosedCaptionPicker.prototype._createClosedCaptionPickerItem = function(closedCaption) {
+ var selectedLcid = this._sessionManager.nowPlayingSession.ccLcid;
+ return WinJS.Binding.as({item: {
+ lcid: closedCaption.lcid, label: closedCaption.name, selected: (selectedLcid === closedCaption.lcid), selectable: true, itemSelectedHandler: this._handleClosedCaptionItemSelected.bind(this)
+ }})
+ };
+ ClosedCaptionPicker.prototype._handleClosedCaptionItemSelected = function(selectedClosedCaptionPickerControlItem) {
+ if (selectedClosedCaptionPickerControlItem && selectedClosedCaptionPickerControlItem.item) {
+ if (selectedClosedCaptionPickerControlItem.item.lcid && selectedClosedCaptionPickerControlItem.item.lcid !== MSEUIControls.ClosedCaptionPicker.closedCaptionOffLcid) {
+ this._sessionManager.nowPlayingSession.closedCaptionsOn = true;
+ this._sessionManager.nowPlayingSession.ccLcid = selectedClosedCaptionPickerControlItem.item.lcid
+ }
+ else {
+ this._sessionManager.nowPlayingSession.closedCaptionsOn = false;
+ this._sessionManager.nowPlayingSession.ccLcid = String.empty
+ }
+ this._selectedClosedCaptionPickerControlItem = selectedClosedCaptionPickerControlItem;
+ if (selectedClosedCaptionPickerControlItem.item.selectable)
+ MSEUIControls.ClosedCaptionPicker._saveCaptionsLcidToSettings(selectedClosedCaptionPickerControlItem.item.lcid)
+ }
+ };
+ ClosedCaptionPicker.prototype._processCaptionLanguagesList = function() {
+ var _this = this;
+ var filteredClosedCaptions = MSEUIControls.ClosedCaptionPicker._getCaptionItems(this._sessionManager);
+ var closedCaptionItems = filteredClosedCaptions.map(function(closedCaption) {
+ return _this._createClosedCaptionPickerItem(closedCaption)
+ });
+ closedCaptionItems.push(WinJS.Binding.as({item: {
+ lcid: MSEUIControls.ClosedCaptionPicker.closedCaptionOffLcid, label: closedCaptionItems.length > 0 ? MSEUIControls.ClosedCaptionPicker.closedCaptionOffLcid : String.load(String.id.IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE), selected: !this._sessionManager.nowPlayingSession.closedCaptionsOn, selectable: closedCaptionItems.length > 0 ? true : false, itemSelectedHandler: this._handleClosedCaptionItemSelected.bind(this)
+ }}));
+ this._closedCaptionLanguagesList.dataSource = new MS.Entertainment.ObservableArray(closedCaptionItems)
+ };
+ ClosedCaptionPicker._getCaptionItems = function(sessionManager) {
+ var filteredClosedCaptions;
+ if (sessionManager) {
+ var mediaItem = sessionManager.nowPlayingSession.currentMedia;
+ filteredClosedCaptions = sessionManager.nowPlayingSession.filterClosedCaptions(mediaItem)
+ }
+ return filteredClosedCaptions
+ };
+ ClosedCaptionPicker.loadCaptionsLcidFromSettings = function() {
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ if (settingsStorage.values["preferredCaptionLanguage"]) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var filteredClosedCaptions = MSEUIControls.ClosedCaptionPicker._getCaptionItems(sessionManager);
+ var preferredLcid = String.empty;
+ var fallbackLcid = String.empty;
+ filteredClosedCaptions.forEach(function(value, index, array) {
+ if (value.lcid === settingsStorage.values["preferredCaptionLanguage"])
+ preferredLcid = value.lcid;
+ if (value.lcid === "1033")
+ fallbackLcid = value.lcid
+ });
+ if (preferredLcid !== String.empty)
+ return preferredLcid;
+ if (fallbackLcid !== String.empty)
+ return fallbackLcid
+ }
+ return String.empty
+ };
+ ClosedCaptionPicker._saveCaptionsLcidToSettings = function(ccLcid) {
+ var settingsStorage = Windows.Storage.ApplicationData.current.localSettings;
+ if (ccLcid !== MSEUIControls.ClosedCaptionPicker.closedCaptionOffLcid)
+ settingsStorage.values["preferredCaptionLanguage"] = ccLcid;
+ else
+ settingsStorage.values.remove("preferredCaptionLanguage")
+ };
+ ClosedCaptionPicker.closedCaptionOffLcid = "Off";
+ return ClosedCaptionPicker
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Controls.ClosedCaptionPicker = ClosedCaptionPicker
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.ClosedCaptionPicker)
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/DeviceLimitError.html b/packages/microsoft.zunevideo/controls/Video_Win/DeviceLimitError.html
new file mode 100644
index 00000000..c254c1e5
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/DeviceLimitError.html
@@ -0,0 +1,21 @@
+
+
+
+
+ Device Limit Dialog Template
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/EpisodeDetails.js b/packages/microsoft.zunevideo/controls/Video_Win/EpisodeDetails.js
new file mode 100644
index 00000000..bf822a1d
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/EpisodeDetails.js
@@ -0,0 +1,39 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+var MS;
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Controls) {
+ var EpisodeDetails = (function(_super) {
+ __extends(EpisodeDetails, _super);
+ function EpisodeDetails(element, options) {
+ _super.call(this, element, options);
+ MS.Entertainment.UI.Framework.processDeclarativeControlContainer(this)
+ }
+ EpisodeDetails.prototype.onFooterLinkClicked = function(event) {
+ var foundElement = this.domElement.querySelector(".videoDetails-footer");
+ if (foundElement && MS.Entertainment.Utilities.isInvocationEvent(event))
+ foundElement.scrollIntoView()
+ };
+ EpisodeDetails.isDeclarativeControlContainer = true;
+ return EpisodeDetails
+ })(Controls.PageViewBase);
+ Controls.EpisodeDetails = EpisodeDetails
+ })(UI.Controls || (UI.Controls = {}));
+ var Controls = UI.Controls
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+WinJS.Utilities.markSupportedForProcessing(MS.Entertainment.UI.Controls.EpisodeDetails)
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/LanguagePicker.html b/packages/microsoft.zunevideo/controls/Video_Win/LanguagePicker.html
new file mode 100644
index 00000000..5c6f4e41
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/LanguagePicker.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/Video_Win/VideoWinNowPlayingOverlays.html b/packages/microsoft.zunevideo/controls/Video_Win/VideoWinNowPlayingOverlays.html
new file mode 100644
index 00000000..7770dde6
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/Video_Win/VideoWinNowPlayingOverlays.html
@@ -0,0 +1,70 @@
+
+
+
+
+ VideoWinNowPlayingOverlays
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/controls/WebHost.html b/packages/microsoft.zunevideo/controls/WebHost.html
new file mode 100644
index 00000000..1cfaafa3
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/WebHost.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+ WebHost Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/WebHost.js b/packages/microsoft.zunevideo/controls/WebHost.js
new file mode 100644
index 00000000..73513193
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/WebHost.js
@@ -0,0 +1,450 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+scriptValidator("/Framework/corefx.js");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {WebHostPurchasePrompt: MS.Entertainment.UI.Framework.defineUserControl("/Controls/WebHost.html#webHostPurchasePromptTemplate", function webHostPurchasePromptConstructor(element, options){}, {
+ initialize: function initialize() {
+ this.promptOnPurchase.title = String.load(String.id.IDS_SETTINGS_PROMPT_TOGGLE_TITLE);
+ this.promptOnPurchase.checked = (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.alwaysPromptOnPurchase
+ }, submit: function submit() {
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.alwaysPromptOnPurchase = this.promptOnPurchase.checked
+ }
+ }, {description: null})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {WebHost: MS.Entertainment.UI.Framework.defineUserControl("/Controls/WebHost.html#webHostTemplate", function(element, options) {
+ this._signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ this.onIFrameLoadHandler = this.onIFrameLoad.bind(this);
+ this.onReadyStateChangeHandler = this.onReadyStateChange.bind(this)
+ }, {
+ _webIFrame: null, _authWithCTP: true, _signIn: null, _eventProvider: null, _loadAuthenticatedUrlOnInitialize: false, _initialized: false, _signInBound: false, _hasValidTicket: false, _signedInOnStart: false, _parentOverlay: null, onIFrameLoadHandler: null, onReadyStateChangeHandler: null, title: null, sourceUrl: null, authenticatedSourceUrl: null, webHostExperienceFactory: null, webHostExperience: null, firstPromptOnPurchaseTitle: null, firstPromptOnPurchaseDescription: null, cancelListener: null, finishedListener: null, errorListener: null, showBackButton: false, showCancelButton: false, isDialog: false, frameWidth: "100%", frameHeight: "100%", signInOverride: false, taskId: String.empty, flowId: String.empty, onMessage: null, timer: null, isSettingsFlow: false, skipPurchasePrompt: false, setOverlay: function setOverlay(instance) {
+ this._parentOverlay = instance
+ }, onSessionTimeout: function onSessionTimeout() {
+ var that = this;
+ WinJS.Promise.timeout().then(function() {
+ var buttons = [{
+ title: String.load(String.id.IDS_YES_BUTTON), isEnabled: true, isAvailable: true, execute: function onYes(overlay) {
+ overlay.hide();
+ that.loadAuthenticatedUrl()
+ }
+ }, {
+ title: String.load(String.id.IDS_NO_BUTTON), isEnabled: true, isAvailable: true, execute: function onNo(overlay) {
+ overlay.hide();
+ if (that.webHostExperience && that.webHostExperience.cancelReceived)
+ that.webHostExperience.cancelReceived();
+ if (that.cancelListener)
+ that.cancelListener()
+ }
+ }];
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_DIALOG_SESSION_TIMED_OUT_TITLE), String.load(String.id.IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE), {
+ buttons: buttons, defaultButtonIndex: 0, cancelButtonIndex: 1
+ })
+ })
+ }, onIFrameLoad: function onIFrameLoad() {
+ if (this.timer) {
+ window.clearTimeout(this.timer);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.timer = window.setTimeout(this.onTimerHandler.bind(this), configurationManager.shell.webBlendLoadTimeoutMS)
+ }
+ if (this._webIFrame && this._webIFrame.contentWindow)
+ this._webIFrame.contentWindow.focus()
+ }, onReadyStateChange: function onReadyStateChange() {
+ var readyStateProperty;
+ try {
+ readyStateProperty = this._webIFrame.readyState
+ }
+ catch(e) {
+ return
+ }
+ if (readyStateProperty && readyStateProperty === "loading") {
+ if (this._webHostWaitCursor && this._webIFrame) {
+ this._webHostWaitCursor.isBusy = true;
+ WinJS.UI.Animation.fadeOut(this._webIFrame)
+ }
+ }
+ else if (readyStateProperty && readyStateProperty === "interactive") {
+ window.clearTimeout(this.timer);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.timer = window.setTimeout(this.onTimerHandler.bind(this), configurationManager.shell.webBlendLoadTimeoutMS)
+ }
+ }, onErrorHandler: function onErrorHandler(errorCode, showError) {
+ if (this._unloaded)
+ return;
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false;
+ if (this.timer) {
+ window.clearTimeout(this.timer);
+ this.timer = null
+ }
+ if (this._eventProvider)
+ this._eventProvider.traceWebExperience_Error(this.currentUrl, errorCode);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CurrentPage, parameterValue: this.currentUrl || " "
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TaskId, parameterValue: this.taskId || " "
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, parameterValue: errorCode || " "
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.WebBlendError, telemetryParameterArray);
+ if (this.webHostExperience && this.webHostExperience.errorReceived)
+ this.webHostExperience.errorReceived(errorCode, !showError);
+ if (this.errorListener)
+ this.errorListener(errorCode)
+ }, onTimerHandler: function onTimerHandler() {
+ if (this.timer && this._hasValidTicket) {
+ window.clearTimeout(this.timer);
+ this.timer = null;
+ if (!this._unloaded)
+ this.onErrorHandler(0x80070461)
+ }
+ }, loadAuthenticatedUrl: function loadAuthenticatedUrl() {
+ if (!this._initialized) {
+ this._loadAuthenticatedUrlOnInitialize = true;
+ return
+ }
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = true;
+ if (this.signInOverride)
+ this._loadAuthenticatedUrlOnSignIn();
+ else {
+ this._signedInOnStart = this._signIn.isSignedIn;
+ var container = document.querySelector(".webHostOverlayContainer");
+ if (container)
+ WinJS.Utilities.addClass(container, "hideFromDisplay");
+ this._signIn.signIn().then(function(value) {
+ var shouldAllowFlow = true;
+ if (value === MS.Entertainment.Utilities.SignIn.SignInResult.success) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).isParentallyControlled) {
+ shouldAllowFlow = false;
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_CHILD_AGE_GATING_TITLE), String.load(String.id.IDS_CHILD_AGE_GATING_MESSAGE))
+ }
+ }
+ else
+ shouldAllowFlow = false;
+ if (shouldAllowFlow)
+ this._loadAuthenticatedUrlOnSignIn();
+ else
+ this._onFlowCancelled()
+ }.bind(this), this._onFlowCancelled.bind(this))
+ }
+ }, _onFlowCancelled: function _onFlowCancelled() {
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false;
+ if (this.cancelListener)
+ this.cancelListener()
+ }, _loadAuthenticatedUrlOnSignIn: function _loadAuthenticatedUrlOnSignIn() {
+ this._webIFrame.addEventListener("load", this.onIFrameLoadHandler.bind(this));
+ this._webIFrame.addEventListener("readystatechange", this.onReadyStateChangeHandler.bind(this));
+ WinJS.UI.Animation.fadeOut(this._webIFrame);
+ this._loadModernAuthenticatedUrlOnSignIn()
+ }, _loadModernAuthenticatedUrlOnSignIn: function _loadModernAuthenticatedUrlOnSignIn() {
+ var ticketType = MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL;
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (config.service.enableSecureAuth)
+ ticketType = MS.Entertainment.Utilities.SignIn.TicketType.SA_20MIN;
+ var promptType = this._getPromptTypeOnLoad();
+ this.postFirstPromptCallback = this.postFirstPromptCallback || WinJS.Promise.as;
+ this._signIn.getPassportTicket(ticketType, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_PassportTicket), this.signInOverride, promptType).then(function(xboxTicket) {
+ return this._firstPromptOnPurchase()
+ }.bind(this)).then(function() {
+ return this.postFirstPromptCallback(this.appPostDataParams)
+ }.bind(this)).then(function complete() {
+ this._hasValidTicket = true;
+ var container = document.querySelector(".webHostOverlayContainer");
+ if (container)
+ WinJS.Utilities.removeClass(container, "hideFromDisplay");
+ var form = document.createElement("form");
+ form.id = "xbl-webblender-nav-driver";
+ form.method = "post";
+ form.target = this._webIFrame.name;
+ var currentPackage = Windows.ApplicationModel.Package.current;
+ var aumid = currentPackage.id.familyName + "!" + currentPackage.id.name + ".Application";
+ this._addPostDataProperty(form, "Aumid", aumid);
+ var launchTime = (new Date).getTime();
+ this._addPostDataProperty(form, "_LaunchTime", launchTime);
+ this._addPostDataProperty(form, "Offer", this.offer);
+ this._addPostDataProperty(form, "FlowId", this.flowId);
+ this._addPostDataProperty(form, "client", "X13");
+ if (this.appPostDataParams)
+ this._addPostDataParams(this.appPostDataParams, form);
+ var formContainer = document.createElement("div");
+ formContainer.style.display = "none";
+ formContainer.appendChild(form);
+ this._webIFrame.appendChild(formContainer);
+ this.authenticatedSourceUrl = this._addCultureParam(this.authenticatedSourceUrl);
+ this.currentUrl = this.authenticatedSourceUrl;
+ form.action = this.authenticatedSourceUrl;
+ form.submit();
+ WinJS.UI.Animation.fadeIn(this._webIFrame);
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false;
+ if (this._eventProvider)
+ this._eventProvider.traceWebExperience_Start(this.taskId);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CurrentPage, parameterValue: this.currentUrl
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TaskId, parameterValue: this.taskId
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.WebBlendLaunch, telemetryParameterArray)
+ }.bind(this), function(err) {
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false;
+ if (this.cancelListener)
+ this.cancelListener()
+ }.bind(this))
+ }, _getPromptTypeOnLoad: function _getPromptTypeOnLoad() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var promptType = Microsoft.Entertainment.Util.SignInPromptType.promptIfNeeded;
+ var promptedOnSignIn = !this._signedInOnStart && signedInUser.canSignOut;
+ if (config.generalSettings.alwaysPromptOnPurchase && !this.isSettingsFlow && !this.skipPurchasePrompt && !promptedOnSignIn && (this.taskId !== MS.Entertainment.UI.Controls.WebHost.TaskId.CREATEACCOUNT) && (this.taskId !== MS.Entertainment.UI.Controls.WebHost.TaskId.TOU))
+ promptType = Microsoft.Entertainment.Util.SignInPromptType.retypeCredentials;
+ return promptType
+ }, _addCultureParam: function _addCultureParam(url) {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var cultureParam = "Culture=" + config.marketplace.marketplaceCulture;
+ if (url && url.indexOf("?") > -1)
+ url = url + "&" + cultureParam;
+ else
+ url = url + "?" + cultureParam;
+ return url
+ }, _addPostDataProperty: function _addPostDataProperty(form, name, value) {
+ var input = document.createElement("INPUT");
+ input.name = name;
+ input.type = "hidden";
+ input.value = value;
+ form.appendChild(input)
+ }, _firstPromptOnPurchase: function _firstPromptOnPurchase() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (config.generalSettings.promptOnPurchaseFirstRun && config.generalSettings.alwaysPromptOnPurchase && !this.isSettingsFlow && !this.skipPurchasePrompt && !MS.Entertainment.Utilities.isApp2 && (this.taskId !== MS.Entertainment.UI.Controls.WebHost.TaskId.CREATEACCOUNT) && (this.taskId !== MS.Entertainment.UI.Controls.WebHost.TaskId.TOU)) {
+ config.generalSettings.promptOnPurchaseFirstRun = false;
+ var firstPromptOnPurchaseTitle = this.firstPromptOnPurchaseTitle || String.load(String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE);
+ var firstPromptOnPurchaseDescription = this.firstPromptOnPurchaseDescription || String.load(String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION);
+ return MS.Entertainment.UI.Shell.showDialog(firstPromptOnPurchaseTitle, "MS.Entertainment.UI.Controls.WebHostPurchasePrompt", {
+ width: "100%", height: "410px", buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT), execute: function execute_next(dialog) {
+ dialog.userControlInstance.submit();
+ dialog.hide()
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_CANCEL_BUTTON_TC), execute: function execute_cancel(dialog) {
+ dialog.hide()
+ }
+ })], defaultButtonIndex: 0, cancelButtonIndex: 1, userControlOptions: {description: firstPromptOnPurchaseDescription}
+ })
+ }
+ else
+ return WinJS.Promise.wrap()
+ }, initialize: function initialize() {
+ this.debugWebMessages = [];
+ if (this.webHostExperienceFactory)
+ this.webHostExperience = this.webHostExperienceFactory();
+ if (this.webHostExperience && this.webHostExperience.startListener)
+ this.webHostExperience.startListener();
+ if (!this.flowId)
+ try {
+ this.flowId = Microsoft.Entertainment.Marketplace.Marketplace.generateGuid()
+ }
+ catch(e) {}
+ this.onMessage = function(event) {
+ this._onModernWebBlendMessage(event)
+ }.bind(this);
+ if (this.frameWidth) {
+ this._webIFrame.style.width = this.frameWidth;
+ this._webIFrame.style.marginLeft = "calc((100% - " + this.frameWidth + ") / 2)"
+ }
+ if (this.frameHeight) {
+ this._webIFrame.style.height = this.frameHeight;
+ this._webIFrame.style.marginTop = "calc((100% - " + this.frameHeight + ") / 2)"
+ }
+ window.addEventListener("message", this.onMessage, false);
+ this._onSignInChange = this._onSignInChange.bind(this);
+ this._signIn.bind("isSignedIn", this._onSignInChange);
+ this._initialized = true;
+ this._signInBound = true;
+ if (this.sourceUrl && this.sourceUrl !== "") {
+ var url = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_XBoxLiveSSL) + "/" + this.sourceUrl;
+ this._webIFrame.src = url;
+ this.currentUrl = url;
+ this._eventProvider.traceWebExperience_Start(this.title)
+ }
+ else if ((this.authenticatedSourceUrl && this.authenticatedSourceUrl !== "") || (this.taskId === "TOU") || this._loadAuthenticatedUrlOnInitialize)
+ this.loadAuthenticatedUrl()
+ }, _onModernWebBlendMessage: function _onModernWebBlendMessage(e) {
+ if ((e.origin !== MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_ModernPurchase)) && (e.origin !== "ms-appx://" + Windows.ApplicationModel.Package.current.id.name.toLowerCase()))
+ return;
+ var messageStruct;
+ var messageRaw = e.data;
+ if (this.debugWebMessages)
+ this.debugWebMessages.unshift(messageRaw);
+ MS.Entertainment.UI.Controls.assert(messageRaw.match(/^{/i), "Message received in non-JSON format");
+ try {
+ messageStruct = JSON.parse(messageRaw)
+ }
+ catch(error_1) {
+ MS.Entertainment.UI.Controls.fail(messageRaw);
+ return
+ }
+ if (!messageStruct.message)
+ return;
+ messageStruct.message = messageStruct.message.trim();
+ messageStruct.verb = messageStruct.message;
+ if (!MS.Entertainment.UI.Controls.WebHostMessage.validateWebHostMessage(this.taskId, messageStruct))
+ return;
+ if (messageStruct.flowId !== this.flowId && messageStruct.message !== "NAVIGATION_ERROR")
+ return;
+ switch (messageStruct.verb) {
+ case"done":
+ if (messageStruct.status === "success") {
+ this._eventProvider.traceWebExperience_Finish(this.title);
+ if (this.webHostExperience && this.webHostExperience.finishedReceived)
+ this.webHostExperience.finishedReceived();
+ if (this.finishedListener)
+ this.finishedListener()
+ }
+ else if (messageStruct.status === "cancel") {
+ this._eventProvider.traceWebExperience_Cancel(this.title);
+ if (this.webHostExperience && this.webHostExperience.cancelReceived)
+ this.webHostExperience.cancelReceived();
+ if (this.cancelListener)
+ this.cancelListener()
+ }
+ else if (messageStruct.status === "error")
+ this.onErrorHandler(messageStruct.errorCode);
+ else if (messageStruct.status === "parent_actor_required") {
+ if (this.webHostExperience && this.webHostExperience.cancelReceived)
+ this.webHostExperience.cancelReceived();
+ if (this.cancelListener)
+ this.cancelListener()
+ }
+ break;
+ case"error":
+ if (this.timer) {
+ window.clearTimeout(this.timer);
+ this.timer = null;
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false
+ }
+ this.onErrorHandler(messageStruct.code);
+ break;
+ case"ready":
+ if (this._parentOverlay && this.taskId !== MS.Entertainment.UI.Controls.WebHost.TaskId.TOU)
+ this._parentOverlay.lightDismissEnabled = false;
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false;
+ WinJS.UI.Animation.fadeIn(this._webIFrame);
+ if (this.timer) {
+ window.clearTimeout(this.timer);
+ this.timer = null
+ }
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioWebBlendRequestToLoad(this.currentUrl);
+ this._eventProvider.traceWebExperience_PageLoad(this.currentUrl);
+ if (this.webHostExperience && this.webHostExperience.pageLoadReceived)
+ this.webHostExperience.pageLoadReceived(this.currentUrl);
+ break;
+ case"authRequest":
+ var relyingParty = messageStruct.relyingParty;
+ var isValidUrl = MS.Entertainment.Utilities.verifyUrl(relyingParty);
+ MS.Entertainment.UI.Controls.assert(isValidUrl, "Relying party received is not a http url");
+ if (isValidUrl)
+ this._signIn.getXTokenByRelyingParty(relyingParty, this.signInOverride).done(function success(header) {
+ if (this._webIFrame && this._webIFrame.contentWindow) {
+ var json = JSON.stringify({
+ message: "authResponse", relyingParty: relyingParty, auth: header.value, flowId: this.flowId
+ });
+ this._webIFrame.contentWindow.postMessage(json, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_ModernPurchase))
+ }
+ }.bind(this), function err(){});
+ break;
+ case"NAVIGATION_ERROR":
+ if (this.timer) {
+ window.clearTimeout(this.timer);
+ this.timer = null;
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false
+ }
+ this.onErrorHandler(messageStruct.httpStatus, true);
+ break
+ }
+ if (this.webHostExperience && this.webHostExperience.messageReceived) {
+ var sendMessageFunction = function(message) {
+ if (this._webIFrame && this._webIFrame.contentWindow)
+ this._webIFrame.contentWindow.postMessage(message, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_AuthTransfer))
+ };
+ this.webHostExperience.messageReceived(messageStruct, this, sendMessageFunction)
+ }
+ }, _onSignInChange: function _onSignInChange(isSignedIn) {
+ if (this._signInBound && !isSignedIn && (this.taskId !== MS.Entertainment.UI.Controls.WebHost.TaskId.CREATEACCOUNT) && (this.taskId !== MS.Entertainment.UI.Controls.WebHost.TaskId.TOU)) {
+ if (this._webHostWaitCursor)
+ this._webHostWaitCursor.isBusy = false;
+ if (this.timer) {
+ window.clearTimeout(this.timer);
+ this.timer = null
+ }
+ if (this.cancelListener)
+ this.cancelListener()
+ }
+ }, unload: function unload() {
+ window.removeEventListener("message", this.onMessage, false);
+ if (this._onSignInChange)
+ this._signIn.unbind("isSignedIn", this._onSignInChange);
+ this._signIn = null;
+ this._eventProvider = null;
+ if (this.webHostExperience) {
+ this.webHostExperience.dispose();
+ this.webHostExperience = null
+ }
+ this.cancelListener = null;
+ this.finishedListener = null;
+ this.errorListener = null;
+ this._webIFrame.removeEventListener("load", this.onIFrameLoadHandler);
+ this._webIFrame.removeEventListener("readystatechange", this.onReadyStateChangeHandler);
+ this._webIFrame.src = "";
+ this._webHostWaitCursor = null;
+ this.debugWebMessages = null;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, _appendWebBlendParams: function _appendWebBlendParams(url) {
+ var webBlendParams = "skin=x8&client=x8&hev=1.0&clientRelease=X8GA";
+ var clientVersionString = MS.Entertainment.Utilities.getClientVersionString();
+ if (clientVersionString)
+ webBlendParams = webBlendParams + "&clientVersion=" + clientVersionString;
+ var appId;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ appId = "music";
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ appId = "video";
+ else
+ appId = String.empty;
+ if (appId)
+ webBlendParams = webBlendParams + "&appId=" + appId;
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.applyBackgroundOnAccountCreation && (this.taskId === MS.Entertainment.UI.Controls.WebHost.TaskId.TOU || this.taskId === MS.Entertainment.UI.Controls.WebHost.TaskId.CREATEACCOUNT))
+ WinJS.Utilities.addClass(this._webIFrame, "webHostDarkBackground");
+ if (this.isDialog)
+ webBlendParams = webBlendParams + "&dialog=true";
+ else
+ webBlendParams = webBlendParams + "&dialog=false";
+ if (url && url.indexOf("?") > -1)
+ url = url + "&" + webBlendParams;
+ else
+ url = url + "?" + webBlendParams;
+ return url
+ }, _addPostDataParams: function _addPostDataParams(postDataParams, form) {
+ var postDataParam;
+ for (name in postDataParams) {
+ postDataParam = postDataParams[name];
+ if (postDataParam !== null && typeof postDataParam != 'undefined' && postDataParam.key !== null && typeof postDataParam.key != 'undefined') {
+ var value;
+ if (postDataParam.value !== null)
+ value = postDataParam.value;
+ else
+ value = String.empty;
+ this._addPostDataProperty(form, postDataParam.key, value)
+ }
+ }
+ }
+ }, {
+ currentUrl: null, debugWebMessages: []
+ }, {TaskId: {
+ ACCOUNT: "ACCOUNT", CREATEACCOUNT: "CREATEACCOUNT", MUSIC: "MUSIC", SUBSCRIPTIONSIGNUP: "SUBSCRIPTIONSIGNUP", TOU: "TOU", VIDEO: "VIDEO"
+ }})})
+})()
diff --git a/packages/microsoft.zunevideo/controls/WebHostDialog.html b/packages/microsoft.zunevideo/controls/WebHostDialog.html
new file mode 100644
index 00000000..a84604eb
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/WebHostDialog.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+ WebHostDialog Control Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/controls/WebHostDialog.js b/packages/microsoft.zunevideo/controls/WebHostDialog.js
new file mode 100644
index 00000000..fa69dde5
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/WebHostDialog.js
@@ -0,0 +1,70 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {WebHostDialog: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.Dialog", "/Controls/WebHostDialog.html#webHostDialogTemplate", function webHostDialogConstructor(element, options) {
+ this.userControl = "MS.Entertainment.UI.Controls.WebHost";
+ this.lightDismissEnabled = true;
+ var that = this;
+ var finishedHandler = options.userControlOptions.finishedListener;
+ options.userControlOptions.finishedListener = WinJS.Utilities.markSupportedForProcessing(function() {
+ if (finishedHandler !== undefined)
+ finishedHandler();
+ that.hide()
+ });
+ var cancelHandler = options.userControlOptions.cancelListener;
+ options.userControlOptions.cancelListener = WinJS.Utilities.markSupportedForProcessing(function() {
+ if (cancelHandler !== undefined)
+ cancelHandler();
+ that.hide()
+ });
+ var errorHandler = options.userControlOptions.errorListener;
+ options.userControlOptions.errorListener = WinJS.Utilities.markSupportedForProcessing(function(error) {
+ if (errorHandler !== undefined)
+ errorHandler(error);
+ that.hide()
+ });
+ this.keyPressEvent = function(event) {
+ if (event.keyCode === WinJS.Utilities.Key.escape) {
+ event.stopPropagation();
+ options.userControlOptions.cancelListener()
+ }
+ };
+ this.domElement.addEventListener("keypress", this.keyPressEvent, true);
+ if (this.desiredLeft !== null && this.desiredLeft !== undefined && this.desiredLeft !== 0)
+ this.left = this.right = this.desiredLeft;
+ if (this.desiredTop !== null && this.desiredTop !== undefined && this.desiredTop !== 0)
+ this.top = this.bottom = this.desiredTop;
+ if (this.desiredHeight)
+ this.top = this.bottom = "calc((100% - " + this.desiredHeight + ") / 2)"
+ }, {
+ autoSetFocus: true, keyPressEvent: null, _resizeImageUrl: "/images/WebDialogResize/RotateResizeIcon.", initialize: function initialize() {
+ MS.Entertainment.UI.Controls.Dialog.prototype.initialize.call(this, arguments);
+ this._tabConstrainerHelper.excludeEndPointElements = false;
+ this._initialized = true;
+ if (this.desiredZIndex !== null)
+ this.overlayContainer.style.zIndex = this.desiredZIndex;
+ if (this.resizeImage)
+ this.resizeImage.target = this._resizeImageUrl + MS.Entertainment.Utilities.getPackageImageFileExtension()
+ }, unload: function unload() {
+ this.domElement.removeEventListener("keypress", this.keyPressEvent);
+ MS.Entertainment.UI.Controls.Dialog.prototype.unload.call(this)
+ }, backClick: function backClick(){}, closeClick: function closeClick() {
+ this.hide()
+ }
+ }, {
+ showBackButton: null, showCancelButton: null, desiredLeft: null, desiredTop: null, desiredZIndex: null
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ShowWebHostDialogAction: MS.Entertainment.deferredDerive(MS.Entertainment.UI.Actions.Action, null, {
+ canExecute: function canExecute() {
+ return this.parameter && this.parameter.dataContext && this.parameter.dataContext.options
+ }, executed: function() {
+ return MS.Entertainment.UI.Shell.showWebHostDialog(this.parameter.dataContext.title || null, {
+ desiredLeft: "0%", desiredTop: "10%", showBackButton: false, showCancelButton: false, desiredZIndex: 1002
+ }, this.parameter.dataContext.options)
+ }
+ })});
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.showWebHostDialog, function() {
+ return new MS.Entertainment.UI.Controls.ShowWebHostDialogAction
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/WebHostMessage.js b/packages/microsoft.zunevideo/controls/WebHostMessage.js
new file mode 100644
index 00000000..1925adc1
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/WebHostMessage.js
@@ -0,0 +1,701 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ scriptValidator();
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls.WebHostMessage");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls.WebHostMessage", {
+ _webHostMessageFactories: {}, registerWebHostMessageFactory: function registerWebHostMessageFactory(taskId, factory) {
+ MS.Entertainment.UI.Controls.WebHostMessage._webHostMessageFactories[taskId] = factory
+ }, ParamType: {
+ guid: /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/g, boolean: /^true|false$/gi, integer: /^[-+]?[0-9]+$/g, string: /.+/g, uri: /^https:\/\//gi
+ }, validateWebHostMessage: (function validateWebHostMessage(taskId, message) {
+ var _taskWebHostMessages = [];
+ return function validateWebHostMessage(taskId, message) {
+ if (!taskId)
+ throw"validateWebHostMessage: taskId parameter is mandatory";
+ if (!message)
+ throw"validateWebHostMessage: message parameter is mandatory";
+ var _webHostMessages = _taskWebHostMessages[taskId];
+ if (!_webHostMessages) {
+ var factory = MS.Entertainment.UI.Controls.WebHostMessage._webHostMessageFactories[taskId];
+ if (factory)
+ _webHostMessages = _taskWebHostMessages[taskId] = factory();
+ if (!_webHostMessages)
+ return false;
+ for (var name in _webHostMessages) {
+ var webHostMessage = _webHostMessages[name];
+ MS.Entertainment.UI.Controls.WebHostMessage.assert(webHostMessage.fields, "WebHostMessage definition: 'fields' field not specified");
+ for (var fieldName in webHostMessage.fields) {
+ var field = webHostMessage.fields[fieldName];
+ MS.Entertainment.UI.Controls.WebHostMessage.assert(typeof field.required === "boolean", "WebHostMessage definition: 'required' field not specified");
+ MS.Entertainment.UI.Controls.WebHostMessage.assert(field.type, "WebHostMessage definition: 'type' field not specified")
+ }
+ }
+ }
+ webHostMessage = _webHostMessages[message.verb];
+ if (!webHostMessage)
+ return false;
+ for (name in webHostMessage.fields)
+ if (webHostMessage.fields[name].required && !message[name])
+ return false;
+ for (name in message) {
+ if (name === "verb")
+ continue;
+ if (!webHostMessage.fields[name])
+ return false;
+ webHostMessage.fields[name].type.lastIndex = 0;
+ if (!webHostMessage.fields[name].type.test(message[name]))
+ return false;
+ if (webHostMessage.fields[name].values)
+ if (webHostMessage.fields[name].values.indexOf(message[name]) === -1)
+ return false
+ }
+ return true
+ }
+ })()
+ });
+ MS.Entertainment.UI.Controls.WebHostMessage.registerWebHostMessageFactory(MS.Entertainment.UI.Controls.WebHost.TaskId.ACCOUNT, function() {
+ var type = MS.Entertainment.UI.Controls.WebHostMessage.ParamType;
+ return {
+ CLOSE_DIALOG: {fields: {
+ reason: {
+ type: type.string, required: true, values: ["SUCCESS", "ERROR", "CANCEL", "REJECTION", ]
+ }, errorCode: {
+ type: type.string, required: false
+ }, info: {
+ type: type.string, required: false
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, OPEN_DIALOG: {fields: {
+ reason: {
+ type: type.string, required: true, values: ["xblmembership", "redeemcode", "zunepass", ]
+ }, targetUrl: {
+ type: type.string, required: true
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CURRENT_PAGE: {fields: {
+ uri: {
+ type: type.uri, required: true
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, AUTH_REQUEST: {fields: {
+ domain: {
+ type: type.string, required: true, values: ["XBOX", "BILLING"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, BEGIN_NAVIGATE: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, UPGRADE_MEMBERSHIP: {fields: {
+ message: {
+ type: type.string, required: false, values: ["UPGRADE_MEMBERSHIP"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, MEMBERSHIP_UPGRADE_SUCESSFUL: {fields: {
+ message: {
+ type: type.string, required: false, values: ["MEMBERSHIP_UPGRADE_SUCESSFUL"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, MEMBERSHIP_UPGRADE_NAVIGATE: {fields: {
+ reason: {
+ type: type.string, required: false, values: ["NEXT"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, TOKEN_REDEMPTION_SUCCESSFUL: {fields: {
+ message: {
+ type: type.string, required: false, values: ["TOKEN_REDEMPTION_SUCCESSFUL"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, NAVIGATION_ERROR: {fields: {
+ httpStatus: {
+ type: type.string, required: false
+ }, failureName: {
+ type: type.string, required: false
+ }, failureUrl: {
+ type: type.uri, required: false
+ }, header: {
+ type: type.string, required: true
+ }, message: {
+ type: type.string, required: true
+ }
+ }}, SIGNOUT_CLICKED: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, ready: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, busy: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, error: {fields: {
+ source: {
+ type: type.string, required: false
+ }, code: {
+ type: type.string, required: false
+ }, description: {
+ type: type.string, required: false
+ }, errorDetails: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, done: {fields: {
+ status: {
+ type: type.string, required: false
+ }, title: {
+ type: type.string, required: false
+ }, price: {
+ type: type.string, required: false
+ }, receipt: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }, offerId: {
+ type: type.string, required: false
+ }, entitlementType: {
+ type: type.string, required: false
+ }
+ }}, authRequest: {fields: {
+ relyingParty: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}
+ }
+ });
+ MS.Entertainment.UI.Controls.WebHostMessage.registerWebHostMessageFactory(MS.Entertainment.UI.Controls.WebHost.TaskId.CREATEACCOUNT, function() {
+ var type = MS.Entertainment.UI.Controls.WebHostMessage.ParamType;
+ return {
+ CLOSE_DIALOG: {fields: {
+ reason: {
+ type: type.string, required: true, values: ["SUCCESS", "ERROR", "CANCEL", "REJECTION", ]
+ }, errorCode: {
+ type: type.string, required: false
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CURRENT_PAGE: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, AUTH_REQUEST: {fields: {
+ domain: {
+ type: type.string, required: true, values: ["XBOX", "BILLING"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, BEGIN_NAVIGATE: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, NAVIGATION_ERROR: {fields: {
+ httpStatus: {
+ type: type.string, required: false
+ }, failureName: {
+ type: type.string, required: false
+ }, failureUrl: {
+ type: type.uri, required: false
+ }, header: {
+ type: type.string, required: true
+ }, message: {
+ type: type.string, required: true
+ }
+ }}
+ }
+ });
+ MS.Entertainment.UI.Controls.WebHostMessage.registerWebHostMessageFactory(MS.Entertainment.UI.Controls.WebHost.TaskId.MUSIC, function() {
+ var type = MS.Entertainment.UI.Controls.WebHostMessage.ParamType;
+ return {
+ CLOSE_DIALOG: {fields: {
+ reason: {
+ type: type.string, required: true, values: ["SUCCESS", "ERROR", "CANCEL", "REJECTION"]
+ }, errorCode: {
+ type: type.string, required: false
+ }, info: {
+ type: type.string, required: false
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CURRENT_PAGE: {fields: {
+ uri: {
+ type: type.uri, required: true
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, AUTH_REQUEST: {fields: {
+ domain: {
+ type: type.string, required: true, values: ["XBOX", "BILLING"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, BEGIN_NAVIGATE: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CONTENT_ADDED: {fields: {
+ offerIds: {
+ type: type.string, required: true
+ }, reason: {
+ type: type.string, required: false, values: ["CONGRATS"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, NAVIGATION_ERROR: {fields: {
+ httpStatus: {
+ type: type.string, required: false
+ }, failureName: {
+ type: type.string, required: false
+ }, failureUrl: {
+ type: type.uri, required: false
+ }, header: {
+ type: type.string, required: true
+ }, message: {
+ type: type.string, required: true
+ }
+ }}, ready: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, busy: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, error: {fields: {
+ source: {
+ type: type.string, required: false
+ }, code: {
+ type: type.string, required: false
+ }, description: {
+ type: type.string, required: false
+ }, errorDetails: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, done: {fields: {
+ status: {
+ type: type.string, required: false
+ }, title: {
+ type: type.string, required: false
+ }, price: {
+ type: type.string, required: false
+ }, receipt: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, authRequest: {fields: {
+ relyingParty: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}
+ }
+ });
+ MS.Entertainment.UI.Controls.WebHostMessage.registerWebHostMessageFactory(MS.Entertainment.UI.Controls.WebHost.TaskId.SUBSCRIPTIONSIGNUP, function() {
+ var type = MS.Entertainment.UI.Controls.WebHostMessage.ParamType;
+ return {
+ CLOSE_DIALOG: {fields: {
+ reason: {
+ type: type.string, required: true, values: ["SUCCESS", "ERROR", "CANCEL", "REJECTION"]
+ }, errorCode: {
+ type: type.string, required: false
+ }, info: {
+ type: type.string, required: false
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, UPGRADE_MEMBERSHIP: {fields: {
+ message: {
+ type: type.string, required: false, values: ["UPGRADE_MEMBERSHIP"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, MEMBERSHIP_UPGRADE_SUCESSFUL: {fields: {
+ message: {
+ type: type.string, required: false, values: ["MEMBERSHIP_UPGRADE_SUCESSFUL"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, TOKEN_REDEMPTION_SUCCESSFUL: {fields: {
+ message: {
+ type: type.string, required: false, values: ["TOKEN_REDEMPTION_SUCCESSFUL"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CURRENT_PAGE: {fields: {
+ uri: {
+ type: type.uri, required: true
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, AUTH_REQUEST: {fields: {
+ domain: {
+ type: type.string, required: true, values: ["XBOX", "BILLING"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, BEGIN_NAVIGATE: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, NAVIGATION_ERROR: {fields: {
+ httpStatus: {
+ type: type.string, required: false
+ }, failureName: {
+ type: type.string, required: false
+ }, failureUrl: {
+ type: type.uri, required: false
+ }, header: {
+ type: type.string, required: true
+ }, message: {
+ type: type.string, required: true
+ }
+ }}
+ }
+ });
+ MS.Entertainment.UI.Controls.WebHostMessage.registerWebHostMessageFactory(MS.Entertainment.UI.Controls.WebHost.TaskId.TOU, function() {
+ var type = MS.Entertainment.UI.Controls.WebHostMessage.ParamType;
+ return {
+ CLOSE_DIALOG: {fields: {
+ reason: {
+ type: type.string, required: true, values: ["SUCCESS", "ERROR", "CANCEL", "REJECTION", ]
+ }, errorCode: {
+ type: type.string, required: false
+ }, info: {
+ type: type.string, required: false
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CURRENT_PAGE: {fields: {
+ uri: {
+ type: type.uri, required: true
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, AUTH_REQUEST: {fields: {
+ domain: {
+ type: type.string, required: true, values: ["XBOX", "BILLING"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, BEGIN_NAVIGATE: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, NAVIGATION_ERROR: {fields: {
+ httpStatus: {
+ type: type.string, required: false
+ }, failureName: {
+ type: type.string, required: false
+ }, failureUrl: {
+ type: type.uri, required: false
+ }, header: {
+ type: type.string, required: true
+ }, message: {
+ type: type.string, required: true
+ }
+ }}, ready: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, busy: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, error: {fields: {
+ source: {
+ type: type.string, required: false
+ }, code: {
+ type: type.string, required: false
+ }, description: {
+ type: type.string, required: false
+ }, errorDetails: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, done: {fields: {
+ status: {
+ type: type.string, required: false
+ }, title: {
+ type: type.string, required: false
+ }, price: {
+ type: type.string, required: false
+ }, receipt: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, authRequest: {fields: {
+ relyingParty: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}
+ }
+ });
+ MS.Entertainment.UI.Controls.WebHostMessage.registerWebHostMessageFactory(MS.Entertainment.UI.Controls.WebHost.TaskId.VIDEO, function() {
+ var type = MS.Entertainment.UI.Controls.WebHostMessage.ParamType;
+ return {
+ CLOSE_DIALOG: {fields: {
+ reason: {
+ type: type.string, required: true, values: ["SUCCESS", "ERROR", "CANCEL", "REJECTION"]
+ }, errorCode: {
+ type: type.string, required: false
+ }, info: {
+ type: type.string, required: false
+ }, offerIds: {
+ type: type.string, required: false
+ }, option: {
+ type: type.string, required: false, values: ["PC_STREAM", "PC_DOWNLOAD_NOW"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CURRENT_PAGE: {fields: {
+ uri: {
+ type: type.uri, required: true
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, AUTH_REQUEST: {fields: {
+ domain: {
+ type: type.string, required: true, values: ["XBOX", "BILLING"]
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, BEGIN_NAVIGATE: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, CONTENT_ADDED: {fields: {
+ offerIds: {
+ type: type.string, required: true
+ }, header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, BANDWIDTH_CHECK: {fields: {
+ header: {
+ type: type.string, required: true
+ }, url: {
+ type: type.string, required: false
+ }
+ }}, NAVIGATION_ERROR: {fields: {
+ httpStatus: {
+ type: type.string, required: false
+ }, failureName: {
+ type: type.string, required: false
+ }, failureUrl: {
+ type: type.uri, required: false
+ }, header: {
+ type: type.string, required: true
+ }, message: {
+ type: type.string, required: true
+ }
+ }}, ready: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, busy: {fields: {
+ flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, error: {fields: {
+ source: {
+ type: type.string, required: false
+ }, code: {
+ type: type.string, required: false
+ }, description: {
+ type: type.string, required: false
+ }, errorDetails: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, done: {fields: {
+ status: {
+ type: type.string, required: false
+ }, title: {
+ type: type.string, required: false
+ }, price: {
+ type: type.string, required: false
+ }, receipt: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}, authRequest: {fields: {
+ relyingParty: {
+ type: type.string, required: false
+ }, flowId: {
+ type: type.guid, required: true
+ }, message: {
+ type: type.string, required: true
+ }, version: {
+ type: type.string, required: false
+ }
+ }}
+ }
+ })
+})()
diff --git a/packages/microsoft.zunevideo/controls/actionList.html b/packages/microsoft.zunevideo/controls/actionList.html
new file mode 100644
index 00000000..2a8999ff
--- /dev/null
+++ b/packages/microsoft.zunevideo/controls/actionList.html
@@ -0,0 +1,95 @@
+
+
+
+
+
+ actionList
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ")
+ }
+ };
+ return shareTemplates
+ }}
+ })()});
+ WinJS.Namespace.define("MS.Entertainment.Social", {EncoderHelper: {
+ encode: function(data, dataAugmentation, html, htmlLines, result) {
+ if (dataAugmentation) {
+ var htmlArguments;
+ var augmentedData = MS.Entertainment.Data.augment(WinJS.Binding.unwrap(data), dataAugmentation);
+ if (augmentedData.emptyMessage > 0)
+ result.emptyMessage = String.load(augmentedData.emptyMessage);
+ else
+ result.emptyMessage = String.empty;
+ if (Array.isArray(augmentedData.title)) {
+ var newTitle;
+ for (var i = 0; i < augmentedData.title.length; i++)
+ if (augmentedData.title[i] !== String.empty)
+ if (newTitle)
+ newTitle = String.load(String.id.IDS_COMMA_SEPARATOR).format(newTitle, augmentedData.title[i]);
+ else
+ newTitle = augmentedData.title[i];
+ result.package.title = newTitle || " "
+ }
+ else
+ result.package.title = augmentedData.title || " ";
+ var oneLineDescription = MS.Entertainment.Data.Factory.stringNoNewLines(augmentedData.description);
+ result.package.description = oneLineDescription || " ";
+ if (!MS.Entertainment.Utilities.isEmptyGuid(augmentedData.mediaId)) {
+ if (Array.isArray(augmentedData.mediaTitle)) {
+ var newMediaTitle;
+ for (var i = 0; i < augmentedData.mediaTitle.length; i++)
+ if (augmentedData.mediaTitle[i] !== String.empty)
+ if (newMediaTitle)
+ newMediaTitle = String.load(String.id.IDS_COMMA_SEPARATOR).format(newMediaTitle, augmentedData.mediaTitle[i]);
+ else
+ newMediaTitle = augmentedData.mediaTitle[i];
+ result.package.mediaTitle = newMediaTitle
+ }
+ else
+ result.package.mediaTitle = augmentedData.mediaTitle;
+ if (Array.isArray(augmentedData.text)) {
+ var newText;
+ for (var i = 0; i < augmentedData.text.length; i++)
+ if (augmentedData.text[i] !== String.empty)
+ if (newText)
+ newText = String.load(String.id.IDS_COMMA_SEPARATOR).format(newText, augmentedData.text[i]);
+ else
+ newText = augmentedData.text[i];
+ result.package.text = newText || String.empty
+ }
+ else
+ result.package.text = augmentedData.text || String.empty;
+ result.package.uri = augmentedData.uri || String.empty;
+ result.package.mediaType = augmentedData.mediaType;
+ result.package.mediaId = augmentedData.mediaId;
+ if (html) {
+ htmlArguments = [];
+ htmlArguments.push(augmentedData.uri || String.empty);
+ var imageUri = String.empty;
+ if (augmentedData.htmlImages)
+ augmentedData.htmlImages.forEach(function(item) {
+ if (!imageUri && item)
+ imageUri = item
+ });
+ htmlArguments.push(imageUri);
+ var linkUri = String.empty;
+ if (augmentedData.htmlUri !== null && augmentedData.htmlUri !== undefined)
+ linkUri = MS.Entertainment.Social.ShareTemplates.createWebLink(augmentedData.htmlUri, augmentedData.htmlUriStringId) || String.empty;
+ htmlArguments.push(linkUri);
+ if (augmentedData.htmlLines)
+ augmentedData.htmlLines.forEach(function(item) {
+ htmlArguments.push((item === undefined || item === null) ? String.empty : item)
+ });
+ if (htmlLines)
+ htmlLines.forEach(function(item) {
+ htmlArguments.push((item === undefined || item === null) ? String.empty : item)
+ });
+ try {
+ result.package.html = html.format.apply(html, htmlArguments)
+ }
+ catch(error) {
+ result.package.html = String.empty
+ }
+ }
+ }
+ }
+ }, encodeMusicMedia: function encodeMusicMedia(data, result, setTitleAndDescription) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicShareToPhone)) {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ var sharingProvider = mediaStore.sharingProvider;
+ var libraryIds = [];
+ var libraryTypes = [];
+ var shareString = String.empty;
+ var libraryTypeCounts = [];
+ var libraryTypesUnique = [];
+ if (!Array.isArray(data))
+ data = [data];
+ for (var i = 0; i < data.length; i++)
+ switch (data[i].mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ libraryIds.push(data[i].libraryId);
+ libraryTypes.push(data[i].mediaType);
+ if (!libraryTypeCounts[data[i].mediaType])
+ libraryTypeCounts[data[i].mediaType] = 1;
+ else
+ libraryTypeCounts[data[i].mediaType]++;
+ if (libraryTypesUnique.indexOf(data[i].mediaType) === -1)
+ libraryTypesUnique.push(data[i].mediaType);
+ break;
+ default:
+ break
+ }
+ for (var i = 0; i < libraryTypesUnique.length; i++) {
+ var typeCount = libraryTypeCounts[libraryTypesUnique[i]];
+ var toAdd = String.empty;
+ switch (libraryTypesUnique[i]) {
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ toAdd = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_SHARE_MUSIC_SONG_COUNT_PLURAL, typeCount).format(typeCount);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ toAdd = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL, typeCount).format(typeCount);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ toAdd = MS.Entertainment.Utilities.Pluralization.getPluralizedString(String.id.IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL, typeCount).format(typeCount);
+ break;
+ default:
+ break
+ }
+ if (toAdd !== String.empty)
+ if (shareString === String.empty)
+ shareString = toAdd;
+ else
+ shareString = String.load(String.id.IDS_SHARE_MUSIC_CONCATENATION).format(shareString, toAdd)
+ }
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ if (setTitleAndDescription) {
+ result.package.title = shareString;
+ result.package.description = String.load(String.id.IDS_SHARE_FILES_MUSIC_DESCRIPTION)
+ }
+ result.package.shouldShareFiles = true;
+ result.package.libraryIds = libraryIds;
+ result.package.libraryTypes = libraryTypes;
+ result.package.mediaAvailabilityFilter = mediaContext.collectionFilter
+ }
+ return WinJS.Promise.wrap(result)
+ }, encodeLeaderBoardTable: function encodeLeaderBoardTable(leaderBoardData) {
+ var leadersArray,
+ rowHtml,
+ i,
+ item;
+ var tableHtml = String.empty;
+ if (leaderBoardData.leaders && leaderBoardData.userRow) {
+ if (Array.isArray(leaderBoardData.leaders))
+ leadersArray = leaderBoardData.leaders;
+ else
+ leaderBoardData.leaders.toArray().then(function(array) {
+ leadersArray = array
+ });
+ if (leadersArray)
+ for (i = leadersArray.length - 1; i >= 0; i--) {
+ item = leadersArray[i];
+ if (item.gamerTag === leaderBoardData.userRow.gamerTag)
+ rowHtml = MS.Entertainment.Social.ShareTemplates.leaderBoardSelectedItem;
+ else
+ rowHtml = MS.Entertainment.Social.ShareTemplates.leaderBoardItem;
+ tableHtml = rowHtml.format(item.rank, item.gamerTag, item.rating) + tableHtml
+ }
+ }
+ return tableHtml
+ }
+ }});
+ var shareEncoderFactory = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareEncoder);
+ shareEncoderFactory.register(function canEncode(data) {
+ return data && (data.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.person || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.track || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.album || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.game || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.folder)
+ }, function encode(data, result) {
+ var dataAugmentation,
+ html;
+ if (data.mediaType)
+ switch (data.mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (data.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode) {
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.TVEpisodeSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.tvEpisode
+ }
+ else if (data.videoType === Microsoft.Entertainment.Queries.VideoType.movie) {
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.MovieSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.media
+ }
+ else {
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.OtherVideoSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.media
+ }
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.folder:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.FolderVideoSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.media;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.TVSeasonSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.tvSeason;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.TVSeriesSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.media;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.MediaSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.media;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.ArtistSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.artist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.TrackSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.media;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.AlbumSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.album;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ switch (data.defaultPlatformType) {
+ case MS.Entertainment.Data.Augmenter.GamePlatform.Modern:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.MetroGameSharePackage;
+ break;
+ default:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.Marketplace.GameSharePackage;
+ break
+ }
+ html = MS.Entertainment.Social.ShareTemplates.game;
+ break
+ }
+ MS.Entertainment.Social.EncoderHelper.encode(data, dataAugmentation, html, null, result);
+ if (data.mediaType === Microsoft.Entertainment.Queries.ObjectType.track || data.mediaType === Microsoft.Entertainment.Queries.ObjectType.album)
+ result = MS.Entertainment.Social.EncoderHelper.encodeMusicMedia(data, result, false);
+ else if (data.mediaType === Microsoft.Entertainment.Queries.ObjectType.playlist)
+ result = MS.Entertainment.Social.EncoderHelper.encodeMusicMedia(data, result, true);
+ return WinJS.Promise.as(result)
+ });
+ shareEncoderFactory.register(function canEncode(data) {
+ return data && MS.Entertainment.Data.Augmenter.XboxLive && MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType && (data.socialDataType === MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.profile || data.socialDataType === MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.achievement || data.socialDataType === MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.activity || data.socialDataType === MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.leaderBoard)
+ }, function encode(data, result) {
+ var dataAugmentation,
+ html,
+ additionalHtmlLines;
+ switch (data.socialDataType) {
+ case MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.profile:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.XboxLive.ProfileSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.profile;
+ break;
+ case MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.achievement:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.XboxLive.AchievementSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.achievement;
+ break;
+ case MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.activity:
+ shareEncoderFactory.encode(data.media, result);
+ break;
+ case MS.Entertainment.Data.Augmenter.XboxLive.SocialDataType.leaderBoard:
+ dataAugmentation = MS.Entertainment.Data.Augmenter.XboxLive.LeaderBoardSharePackage;
+ html = MS.Entertainment.Social.ShareTemplates.leaderBoard;
+ additionalHtmlLines = [MS.Entertainment.Social.EncoderHelper.encodeLeaderBoardTable(data)];
+ break
+ }
+ MS.Entertainment.Social.EncoderHelper.encode(data, dataAugmentation, html, additionalHtmlLines, result);
+ return WinJS.Promise.as(result)
+ });
+ shareEncoderFactory.register(function canEncode(data) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (data && (MS.Entertainment.Data.VirtualList.is(data) || Array.isArray(data)) && MS.Entertainment.Utilities.isMusicApp1 && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicShareToPhone))
+ return true;
+ else
+ return false
+ }, function encode(data, result) {
+ var encodePromise = null;
+ if (MS.Entertainment.Data.VirtualList.is(data))
+ encodePromise = data.toArrayAll().then(function success(items) {
+ return MS.Entertainment.Social.EncoderHelper.encodeMusicMedia(items, result, true)
+ });
+ else
+ encodePromise = MS.Entertainment.Social.EncoderHelper.encodeMusicMedia(data, result, true);
+ return WinJS.Promise.as(encodePromise)
+ })
+})()
+})();
+/* >>>>>>/components/playback/addtonowplayingaction.js:18257 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(undefined) {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ AddToNowPlaying: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function addToNowPlaying() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.addToNowPlaying, translateDragAndDropParams: function translateDragAndDropParams(source) {
+ return {mediaItem: source && source.data}
+ }, executed: function executed(param) {
+ var executeActionObject = new MS.Entertainment.UI.Actions.AddToNowPlaying.AddToNowPlayingExecution(new MS.Entertainment.UI.Actions.AddToNowPlaying.AddToNowPlayingActionAppState);
+ executeActionObject.execute(param)
+ }, canExecute: function canExecute(param) {
+ var canExecuteResult = true;
+ var mediaItem = MS.Entertainment.UI.Actions.extractMediaItemFromParam(param);
+ var appState = new MS.Entertainment.UI.Actions.AddToNowPlaying.AddToNowPlayingActionAppState;
+ if (!mediaItem)
+ canExecuteResult = false;
+ else if (Array.isArray(mediaItem))
+ canExecuteResult = mediaItem.length > 0;
+ else if (MS.Entertainment.Data.List.isList(mediaItem))
+ canExecuteResult = mediaItem.count > 0;
+ else if (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ canExecuteResult = appState.canAddToNowPlaying(mediaItem);
+ return canExecuteResult
+ }
+ }), AddArtistToNowPlayingAction: MS.Entertainment.deferredDerive(MS.Entertainment.UI.Actions.Action, function addArtistToNowPlayingAction() {
+ this.base()
+ }, {
+ executed: function executed(param) {
+ var query,
+ id;
+ var mediaItem = MS.Entertainment.UI.Actions.extractMediaItemFromParam(param);
+ var mediaItems = Array.isArray(mediaItem) ? mediaItem : [mediaItem];
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ var collectionFilter = mediaContext.collectionFilter;
+ MS.Entertainment.ViewModels.assert(mediaItems[0].mediaType === Microsoft.Entertainment.Queries.ObjectType.person && mediaItems[0].personType === Microsoft.Entertainment.Queries.PersonType.artist, "Invalid media type. Was expecting an artist media object");
+ mediaItems.forEach(function addMediaItemToNowPlaying(mediaItem) {
+ var itemCollection = null;
+ if (param.playCollectionItemsOnly) {
+ itemCollection = new MS.Entertainment.Data.Query.libraryTracks;
+ itemCollection.mediaAvailability = collectionFilter;
+ itemCollection.artistId = mediaItem.libraryId;
+ itemCollection.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist, MS.Entertainment.Utilities.isValidServiceId(mediaItem.canonicalId) ? mediaItem.canonicalId : String.empty);
+ if (param.librarySort)
+ itemCollection.sort = param.librarySort
+ }
+ else if (param.shouldUseTopSongsForArtistAddTo) {
+ itemCollection = new MS.Entertainment.Data.Query.Music.ArtistTopSongs;
+ itemCollection.id = mediaItem.canonicalId;
+ itemCollection.impressionGuid = mediaItem.impressionGuid;
+ itemCollection.hasTotalCount = true;
+ itemCollection.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist, MS.Entertainment.Utilities.isValidServiceId(mediaItem.canonicalId) ? mediaItem.canonicalId : String.empty)
+ }
+ else
+ itemCollection = mediaItem;
+ if (itemCollection)
+ MS.Entertainment.Platform.PlaybackHelpers.addToNowPlaying(itemCollection)
+ });
+ if (!param.suppressNotification)
+ MS.Entertainment.UI.Actions.Playlists._showPlaylistNotification(null, mediaItems, mediaItems[0].mediaType, true)
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions.AddToNowPlaying", {
+ AddToNowPlayingActionAppState: MS.Entertainment.UI.Framework.define(function addToNowPlayingActionAppState() {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ this.primarySessionIsSmartDJ = !!sessionMgr.primarySession.smartDJSeed;
+ var signedInUserService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var featureEnablement = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.featureEnablement);
+ this.marketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace);
+ var freeStreamEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicFreePlay);
+ var freePlayLimits = null;
+ if (freeStreamEnabled && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.freePlayLimits))
+ freePlayLimits = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits);
+ this.userCanSubscriptionStream = this.marketplaceEnabled && signedInUserService && signedInUserService.isSubscription;
+ this.userFreePlayLimitsNotExceeded = !freePlayLimits || !freePlayLimits.isMonthlyFreeLimitExceeded;
+ this.userCanFreeStream = this.userFreePlayLimitsNotExceeded && this.marketplaceEnabled && freeStreamEnabled
+ }, {
+ marketplaceEnabled: false, primarySessionIsSmartDJ: false, purchaseErrors: 0, subscriptionErrors: 0, userCanFreeStream: false, userCanSubscriptionStream: false, userFreePlayLimitsNotExceeded: false, canAddToNowPlaying: function canAddToNowPlaying(track) {
+ var canAddToNowPlaying = false;
+ if (track.inCollection && (track.canPlayLocally || track.roamingViaOneDrive))
+ canAddToNowPlaying = true;
+ else if (this.marketplaceEnabled) {
+ canAddToNowPlaying = (track.canSubscriptionStream && track.hasPurchased) || (track.canSubscriptionStream && this.userCanSubscriptionStream) || (track.canFreeStream && this.userCanFreeStream);
+ if (!canAddToNowPlaying)
+ if (track.canSubscriptionStream && !this.userCanSubscriptionStream)
+ this.subscriptionErrors++;
+ else if (track.canPurchase || track.canPurchaseAlbum)
+ this.purchaseErrors++
+ }
+ return canAddToNowPlaying
+ }
+ }), AddToNowPlayingExecution: MS.Entertainment.UI.Framework.define(function addToNowPlayingExecution(appState) {
+ this._appState = appState || new MS.Entertainment.UI.Actions.AddToNowPlaying.AddToNowPlayingActionAppState;
+ this._appNotificationService = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appNotification) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification)
+ }, {
+ _appState: null, _appNotificationService: null, _nowPlayingNotificationCategory: "addToNowPlaying", execute: function execute(param) {
+ var mediaContext = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appToolbar).currentMediaContext;
+ var collectionFilter = mediaContext && mediaContext.collectionFilter;
+ var mediaItemParam = MS.Entertainment.UI.Actions.extractMediaItemFromParam(param);
+ var mediaItems = null;
+ var mediaItemType = null;
+ var showNotification = true;
+ var numMediaItemsAdded = 0;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionMgr.primarySession.smartDJSeed) {
+ if (!param.suppressNotification)
+ this._showPlaylistNotification(numMediaItemsAdded, mediaItemType)
+ }
+ else {
+ var sentCompleteNotification = false;
+ if (!param.suppressNotification && this._appNotificationService)
+ WinJS.Promise.timeout(500).done(function updateTrackNotifications() {
+ if (!sentCompleteNotification)
+ this._appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_MUSIC_NOTIFICATION_ADDING_TO_NOW_PLAYING), subTitle: String.empty, moreDetails: null, icon: MS.Entertainment.UI.Icon.playlist, iconClassName: "icon-playlist", action: null, category: this._nowPlayingNotificationCategory, isPersistent: false
+ }))
+ }.bind(this));
+ MS.Entertainment.Data.VirtualList.copy(mediaItemParam).then(function gotVirtualList(mediaItemsVirtualList) {
+ return mediaItemsVirtualList.forEachAll(function addMediaItem(args) {
+ var returnPromise = null;
+ var mediaItem = args && args.item.data;
+ var preventPlay = numMediaItemsAdded > 0;
+ if (!mediaItem)
+ return;
+ mediaItemType = mediaItem.mediaType;
+ if (MS.Entertainment.Utilities.isApp2) {
+ MS.Entertainment.Platform.PlaybackHelpers.addToNowPlaying(mediaItem, collectionFilter, preventPlay);
+ returnPromise = WinJS.Promise.as(1)
+ }
+ else if (mediaItemType === Microsoft.Entertainment.Queries.ObjectType.album)
+ if (mediaItem.fromCollection && this._appState.userFreePlayLimitsNotExceeded) {
+ MS.Entertainment.Platform.PlaybackHelpers.addToNowPlaying(mediaItem, collectionFilter, preventPlay);
+ returnPromise = WinJS.Promise.as(1)
+ }
+ else
+ returnPromise = this._expandAlbum(mediaItem, collectionFilter, preventPlay);
+ else if (mediaItemType === Microsoft.Entertainment.Queries.ObjectType.track)
+ returnPromise = this._addTrackToNowPlaying(mediaItem, collectionFilter, preventPlay);
+ else if (mediaItem) {
+ MS.Entertainment.Platform.PlaybackHelpers.addToNowPlaying(mediaItem, collectionFilter, preventPlay);
+ returnPromise = WinJS.Promise.as(1)
+ }
+ return returnPromise.then(function addTotal(addedCount) {
+ numMediaItemsAdded += addedCount
+ })
+ }.bind(this))
+ }.bind(this)).then(null, function failure(error) {
+ MS.Entertainment.UI.Actions.fail("Add to Now Playing encountered an error. Error message " + error && error.message)
+ }).done(function addMediaCompleted() {
+ if (!param.suppressNotification) {
+ this._showPlaylistNotification(numMediaItemsAdded, mediaItemType);
+ sentCompleteNotification = true
+ }
+ if (param.completeAction)
+ param.completeAction()
+ }.bind(this))
+ }
+ }, _addTrackToNowPlaying: function _addTrackToNowPlaying(track, collectionFilter, preventPlay) {
+ if (!track) {
+ MS.Entertainment.UI.Actions.fail("Attempting to add a null track.");
+ return WinJS.Promise.as(0)
+ }
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(track).then(function libraryInfoHydrated() {
+ var addedCount = 0;
+ if (this._appState.canAddToNowPlaying(track)) {
+ addedCount = 1;
+ MS.Entertainment.Platform.PlaybackHelpers.addToNowPlaying(track, collectionFilter, preventPlay)
+ }
+ return addedCount
+ }.bind(this), function libraryInfoHydrateFailed(error) {
+ MS.Entertainment.UI.Actions.fail("Failed to hydrate media item. Error message " + error && error.message);
+ return 0
+ })
+ }, _expandAlbum: function _expandAlbum(album, collectionFilter, preventPlay) {
+ if (!album)
+ return WinJS.Promise.as(0);
+ var tracksAdded = 0;
+ return this._getTracks(album).then(function handleTracks(tracks) {
+ var tracksPromise = null;
+ if (tracks)
+ tracksPromise = tracks.forEachAll(function addTracks(track) {
+ return this._addTrackToNowPlaying(track && track.item && track.item.data, collectionFilter, preventPlay || tracksAdded > 0).then(function addedTrack(addedCount) {
+ tracksAdded += addedCount
+ })
+ }.bind(this));
+ return WinJS.Promise.as(tracksPromise)
+ }.bind(this)).then(function returnTotalAdded() {
+ return tracksAdded > 0 ? 1 : 0
+ })
+ }, _getTracks: function getTracks(album) {
+ var tracks;
+ if (album.tracks && album.tracks.count)
+ tracks = album.tracks;
+ else if (album.hasCanonicalId) {
+ var query = new MS.Entertainment.Data.Query.Music.AlbumSongs;
+ query.id = album.canonicalId;
+ query.impressionGuid = album.impressionGuid;
+ query.acquisitionData = album.acquisitionData;
+ query.relevancyTrackingContent = album.relevancyTrackingContent;
+ tracks = query.getItems()
+ }
+ else {
+ album = album.cloneWithHydration();
+ tracks = album.hydrate().then(function returnTracks() {
+ return album.tracks
+ })
+ }
+ return WinJS.Promise.as(tracks)
+ }, _showPlaylistNotification: function _showPlaylistNotification(numMediaItemsAdded, mediaItemType) {
+ if (this._appNotificationService)
+ this._appNotificationService.removeNotificationByCategory(this._nowPlayingNotificationCategory);
+ if (numMediaItemsAdded)
+ MS.Entertainment.UI.Actions.Playlists._showPlaylistNotification(null, null, mediaItemType, true, null, null, numMediaItemsAdded);
+ else if (this._appNotificationService) {
+ var subTitle = String.empty;
+ if (this._appState.primarySessionIsSmartDJ)
+ subTitle = String.load(String.id.IDS_MUSIC_NOTIFICATION_RADIO_LOCKED);
+ else if (this._appState.subscriptionErrors)
+ subTitle = String.load(String.id.IDS_MUSIC_NOTIFICATION_MUSIC_PASS_ONLY);
+ else
+ subTitle = String.load(String.id.IDS_MUSIC_NOTIFICATION_PURCHASE_ONLY);
+ this._appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_MUSIC_NOTIFICATION_ADD_ERROR), subTitle: subTitle, moreDetails: null, icon: MS.Entertainment.UI.Icon.playlist, iconClassName: "icon-playlist", action: null, category: this._nowPlayingNotificationCategory, isPersistent: false
+ }))
+ }
+ }
+ })
+ });
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.addToNowPlaying, function() {
+ return new MS.Entertainment.UI.Actions.AddToNowPlaying
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.addArtistToNowPlaying, function() {
+ return new MS.Entertainment.UI.Actions.AddArtistToNowPlayingAction
+ })
+})()
+})();
+/* >>>>>>/controls/webhostexperience.js:18502 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {WebHostExperienceObservables: MS.Entertainment.defineObservable(function WebHostExperienceObservables_constructor(){}, {})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {WebHostExperience: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Controls.WebHostExperienceObservables", function webHostExperience() {
+ MS.Entertainment.UI.Controls.WebHostExperienceObservables.prototype.constructor.call(this);
+ this.eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell
+ }, {
+ disposed: false, onStartEvent: null, onMessageEvent: null, onErrorEvent: null, onFinishedEvent: null, onCancelEvent: null, onPageLoadEvent: null, eventProvider: null, startListener: function startListener() {
+ if (!this.disposed)
+ if (this.onStartEvent)
+ this.onStartEvent()
+ }, messageReceived: function messageReceived(message, webHost, sendMessageFunc) {
+ if (!this.disposed)
+ if (this.onMessageEvent)
+ this.onMessageEvent(message, webHost, sendMessageFunc)
+ }, errorReceived: function errorReceived(message, dontShowError) {
+ if (!this.disposed) {
+ var hr = 0x80004005;
+ if (message === "400")
+ hr = 0x80190190;
+ else if (message === "401")
+ hr = 0x80190191;
+ else if (message === "403")
+ hr = 0x80190193;
+ else if (message === "404")
+ hr = 0x80190194;
+ else if (message === "410")
+ hr = 0x8019019A;
+ else if (message === "500")
+ hr = 0x801901F4;
+ else if (message === "501")
+ hr = 0x801901F5;
+ else if (message === "502")
+ hr = 0x801901F6;
+ else if (message === "503")
+ hr = 0x801901F7;
+ else if (message === "504")
+ hr = 0x801901F8;
+ else if (message === 0x80070461)
+ hr = 0x80070461;
+ if (!dontShowError)
+ MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SERVICE_UNAVAILABLE_CAPTION), hr);
+ if (this.onErrorEvent)
+ this.onErrorEvent(message);
+ return {hr: hr}
+ }
+ return {hr: null}
+ }, finishedReceived: function finishedReceived() {
+ if (!this.disposed)
+ if (this.onFinishedEvent)
+ this.onFinishedEvent()
+ }, cancelReceived: function cancelReceived() {
+ if (!this.disposed)
+ if (this.onCancelEvent)
+ this.onCancelEvent()
+ }, pageLoadReceived: function pageLoadReceived(message) {
+ if (!this.disposed)
+ if (this.onPageLoadEvent)
+ this.onPageLoadEvent()
+ }, dispose: function dispose() {
+ this.disposed = true;
+ this.onStartEvent = null;
+ this.onMessageEvent = null;
+ this.onErrorEvent = null;
+ this.onFinishedEvent = null;
+ this.onCancelEvent = null;
+ this.onPageLoadEvent = null;
+ this.eventProvider = null
+ }
+ })})
+})()
+})();
+/* >>>>>>/framework/disabled.js:18578 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function(undefined) {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {disabled: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function disabledConstructor() {
+ this.base()
+ }, {
+ executed: function executed(param){}, canExecute: function canExecute(param) {
+ return false
+ }, isEnabled: false
+ })});
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.disabled, function() {
+ return new MS.Entertainment.UI.Actions.disabled
+ })
+})()
+})();
+/* >>>>>>/controls/errordialog.js:18598 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ErrorDialog: MS.Entertainment.UI.Framework.defineUserControl("/Controls/ErrorDialog.html#errorDialogTemplate", function messageBoxConstructor(element, options) {
+ this.webLinkText = String.load(String.id.IDS_DIALOG_ERROR_MORE_INFO);
+ this.feedbackLinkText = String.load(String.id.IDS_DIALOG_ERROR_FEEDBACKLINK);
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.App2.VoiceStatics"))
+ this.webLinkVoiceConfidence = MS.Entertainment.UI.App2.VoiceStatics.defaultConfidence
+ }, {
+ webLinkPromise: null, _parentOverlay: null, additionalButton: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.assert(this.errorDialogErrorCode, "Overlay: Element with data-ent-member='errorDialogErrorCode' not found");
+ if (!this.errorCode)
+ this.errorDialogErrorCode.style.visibility = "hidden";
+ if (!this.subTitle)
+ WinJS.Utilities.addClass(this.errorDialogDescription, "text-small")
+ }, onFeedbackLinkClick: function onFeedbackLinkClick() {
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.errorId = this.errorCode;
+ MS.Entertainment.UI.Controls.UserFeedbackDialog.timestamp = (new Date).toUTCString();
+ this._parentOverlay.hide();
+ MS.Entertainment.UI.Shell.showFeedbackDialog();
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: this.errorDialogFeedbackLink}, {
+ uri: "errorDialogTemplate", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ }, {
+ uri: "userFeedbackDialogTemplate", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ })
+ }, onWebLinkClick: function onWebLinkClick(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var webUrlPromise;
+ var onWeblinkPromiseClicked = function onWeblinkPromiseClicked(url) {
+ this._parentOverlay.hide();
+ window.open(url, "_blank");
+ MS.Entertainment.Utilities.Telemetry.logPageAction({domElement: this.errorDialogWebLink}, {
+ uri: "errorDialogTemplate", pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Popup
+ }, {
+ uri: url, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.WebPage
+ })
+ }.bind(this);
+ MS.Entertainment.UI.Controls.assert(this.webLinkPromise, "webLinkPromise was null");
+ webUrlPromise = WinJS.Promise.as(this.webLinkPromise);
+ WinJS.Promise.timeout(500, webUrlPromise).done(onWeblinkPromiseClicked, onWeblinkPromiseClicked);
+ if (e.stopPropagation && e.preventDefault) {
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }, setOverlay: function setOverlay(instance) {
+ this._parentOverlay = instance;
+ if (MS.Entertainment.Utilities.isApp2 && instance && instance.buttons) {
+ instance.cancelButtonIndex = 0;
+ var newButtons = [];
+ if (this.additionalButton) {
+ var cancelButton = instance.buttons[instance.cancelButtonIndex];
+ instance.buttons = [];
+ var dismissBeforeExecute = function() {
+ this._parentOverlay.hide();
+ this.additionalButton.execute()
+ }.bind(this);
+ newButtons.push({
+ title: this.additionalButton.title, execute: dismissBeforeExecute
+ }, cancelButton);
+ instance.cancelButtonIndex = 1
+ }
+ newButtons.push({
+ title: String.load(String.id.IDS_DIALOG_ERROR_MORE_INFO_BUTTON_VUI_GUI), execute: this.onWebLinkClick.bind(this)
+ }, {
+ title: String.load(String.id.IDS_DIALOG_ERROR_FEEDBACKBUTTON_VUI_GUI), execute: this.onFeedbackLinkClick.bind(this)
+ });
+ instance.buttons = instance.buttons.concat(newButtons)
+ }
+ }
+ }, {
+ subTitle: null, description: null, errorCode: null, webLinkText: null, feedbackLinkText: null, webLinkVoiceConfidence: 0.2, showLinks: true, showErrorCodeInContent: true
+ })})
+})()
+})();
diff --git a/packages/microsoft.zunevideo/launchToCollectionStartup.html b/packages/microsoft.zunevideo/launchToCollectionStartup.html
new file mode 100644
index 00000000..95b44dce
--- /dev/null
+++ b/packages/microsoft.zunevideo/launchToCollectionStartup.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/main.html b/packages/microsoft.zunevideo/main.html
new file mode 100644
index 00000000..5581d034
--- /dev/null
+++ b/packages/microsoft.zunevideo/main.html
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/main.js b/packages/microsoft.zunevideo/main.js
new file mode 100644
index 00000000..0f9fa8dd
--- /dev/null
+++ b/packages/microsoft.zunevideo/main.js
@@ -0,0 +1,969 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.strictProcessing();
+ WinJS.Binding.optimizeBindingReferences = true;
+ scriptValidator();
+ MS.Entertainment.Utilities.updateHtmlDirectionAttribute();
+ MS.Entertainment.UI.Framework.unblockCriticalPreloading();
+ MS.Entertainment.UI.Framework.enableAutoControlCleanup();
+ MS.Entertainment.UI.Framework.enableSetImmediateBatching();
+ var appDisplayName = "";
+ if (window.usingNewMusicPage)
+ return;
+ var applicationLifetimeManager = null;
+ var commonEventProvider = null;
+ var tileManager = null;
+ var initialized = false;
+ var alreadyHandledLaunch = false;
+ var startPlaybackOnLaunch = false;
+ var stageTwoInitialized = false;
+ var stageThreePromise = null;
+ var stageFourPromise = null;
+ var stageFourDelay = 5000;
+ var shouldShowAppBar = false;
+ var showAppBarDelay = 0;
+ var wasRecentlyResumed = false;
+ var isPrelaunched = false;
+ if (window.clientInformation && window.clientInformation.cpuClass === "ARM")
+ showAppBarDelay = 5000;
+ WinJS.Application.onerror = MS.Entertainment.UI.Debug.unhandledPromiseErrorHandler;
+ WinJS.Namespace.define("MS.Entertainment.UI.Application", {Activation: MS.Entertainment.UI.Framework.define(null, null, {
+ handlePrelaunch: function handlePrelaunch(args) {
+ isPrelaunched = true;
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ var delayedStageThreePath = "/delayedStageThreeStartup.html";
+ if (window.useNewVideoPage)
+ delayedStageThreePath = "/Classic" + delayedStageThreePath;
+ MS.Entertainment.Utilities.loadHtmlPage(delayedStageThreePath, "delayedStartupContainer");
+ var activationArgsClone = MS.Entertainment.Utilities.cloneActivationArguments(args);
+ var madeVisibleCount = 0;
+ var documentEvents = MS.Entertainment.UI.Framework.addEventHandlers(document, {visibilitychange: function() {
+ if (document.hidden)
+ return;
+ isPrelaunched = false;
+ documentEvents.cancel();
+ MS.Entertainment.Utilities.resetPerfTrackStartTime();
+ MS.Entertainment.UI.Application.Activation.activated(activationArgsClone, false, true)
+ }})
+ }, activated: function activated(activationArgs, isNonRootActivationHandler, preLaunched) {
+ if (window.sessionStorage["HardBlockEnabled"] === "true") {
+ WinJS.Promise.timeout().then(function _delay() {
+ window.location.href = "UpdateApp.html"
+ });
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ if (activationArgs.prelaunchActivated) {
+ MS.Entertainment.UI.Application.Activation.handlePrelaunch(activationArgs);
+ return
+ }
+ if (!isNonRootActivationHandler) {
+ if (activationArgs.arguments === MS.Entertainment.Utilities.retailExperienceArgument)
+ MS.Entertainment.Utilities.setRetailExperienceState(true);
+ WinJS.Application.start();
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceProcessInitializeEventStart();
+ var startTime = new Date;
+ if (!applicationLifetimeManager)
+ applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ if (!preLaunched)
+ applicationLifetimeManager.raiseActivated(activationArgs)
+ }
+ var isFirstRun = !initialized;
+ var isSupported = true;
+ if (!initialized) {
+ var className;
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData = [];
+ if (!isNonRootActivationHandler) {
+ var demoModeAppStateReset = MS.Entertainment.Utilities.resetAppStateForRetailExperienceIfNeeded();
+ (new Microsoft.Entertainment.Application.Application).init(Microsoft.Entertainment.Application.ExecMode.foreground);
+ if (demoModeAppStateReset)
+ MS.Entertainment.Utilities.removeAllPlaylistsIfDemoMode()
+ }
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var currentPackage = Windows.ApplicationModel.Package.current;
+ var currentVersion = currentPackage.id.version;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var minVersionSupported;
+ var minServiceVersionSupported;
+ if (MS.Entertainment.Utilities.valueFromPropertyPathFragments(Windows, ["ApplicationModel", "Search", "SearchPane", "hideThisApplication"]))
+ Windows.ApplicationModel.Search.SearchPane.hideThisApplication();
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ appDisplayName = String.load(String.id.IDS_MANIFEST_MUSIC_APP_NAME);
+ className = "music music2 app2";
+ stateService.applicationTitle = String.load(String.id.IDS_XBOX_MUSIC2_APP_TITLE);
+ minVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.fue.minMusicAppSupportedVersion);
+ minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.service.minMusicServiceSupportedVersion)
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp) {
+ appDisplayName = String.load(String.id.IDS_MANIFEST_VIDEO_APP_NAME);
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ className = "video video1 app1";
+ stateService.applicationTitle = String.load(String.id.IDS_XBOX_VIDEO_APP_TITLE)
+ }
+ else {
+ className = "video video2 app2";
+ stateService.applicationTitle = String.load(String.id.IDS_XBOX_VIDEO2_APP_TITLE)
+ }
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) && !featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace))
+ className += " " + MS.Entertainment.Utilities.noMarketplaceRootClassName;
+ minVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.fue.minVideoAppSupportedVersion);
+ minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString(configurationManager.service.minVideoServiceSupportedVersion)
+ }
+ else if (MS.Entertainment.Utilities.isTestApp) {
+ appDisplayName = "test";
+ className = "test";
+ minVersionSupported = MS.Entertainment.Utilities.parseVersionString("1.0.0.0");
+ minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString("1.0.0.0")
+ }
+ else
+ className = String.empty;
+ if (configurationManager.shell.retailExperience)
+ className += " demo";
+ var versionSupported = (MS.Entertainment.Utilities.compareVersions(currentVersion, minVersionSupported) >= 0);
+ stateService.servicesEnabled = (MS.Entertainment.Utilities.compareVersions(currentVersion, minServiceVersionSupported) >= 0);
+ if (!versionSupported) {
+ WinJS.Promise.timeout().then(function _delay() {
+ window.location.href = "UpdateApp.html"
+ });
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ WinJS.Utilities.addClass(document.documentElement, className);
+ MS.Entertainment.UI.Framework.flags.attachCookieToRemovedDomElements = configurationManager.shell.attachCookieToRemovedDomElements;
+ MS.Entertainment.UI.Framework.flags.attachLargeObjectToUnloadedControl = configurationManager.shell.attachLargeObjectToUnloadedControl;
+ if (MS.Entertainment.Utilities.isApp2) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation))
+ MS.Entertainment.ServiceLocator.unregister(MS.Entertainment.Services.winJSNavigation);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoQueryCacheService)) {
+ var videoQueryCacheService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoQueryCacheService);
+ videoQueryCacheService.startQueries()
+ }
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signInApp2User();
+ if (!MS.Entertainment.isAppModeOverride);
+ document.body.addEventListener("keyup", function(e) {
+ if (e.keyCode === WinJS.Utilities.Key.invokeButton || (!e.altKey && e.keyCode === WinJS.Utilities.Key.enter && !MS.Entertainment.Utilities.doesElementSupportKeyboardInput(e.target))) {
+ if (document.activeElement && document.activeElement.click && e.target && e.target.tagName && e.target.tagName.toLowerCase() !== "button") {
+ MS.Entertainment.Utilities.playSelectButtonClick();
+ document.activeElement.click();
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }
+ else if ((e.keyCode === WinJS.Utilities.Key.resetFocus) || (e.altKey && e.keyCode === WinJS.Utilities.Key.f))
+ MS.Entertainment.UI.Framework.resetFocusToTopMostContent();
+ else if (e.altKey && e.keyCode === WinJS.Utilities.Key.m);
+ }, false)
+ }
+ if (MS.Entertainment.Utilities.isMusicApp)
+ MS.Entertainment.Utilities.useRadioStrings();
+ initialized = true
+ }
+ else
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ if (!isNonRootActivationHandler) {
+ var stopTime = new Date;
+ var duration = stopTime.valueOf() - startTime.valueOf();
+ commonEventProvider.traceProcessInitializeEventStop(duration)
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appActivated();
+ var doActivate = function doActivate(evt) {
+ var navigationService;
+ var eventKind;
+ var deeplinkUri;
+ var launchArgs;
+ var previousExecutionState;
+ var PlatLog = Microsoft.Entertainment.Platform.Logging;
+ var dataPoint = new PlatLog.DataPoint(PlatLog.LoggingLevel.telemetry, PlatLog.TelemetryAuthMethod.unauthenticated);
+ dataPoint.appendEventName("X8Run");
+ dataPoint.appendParameter("ClientResolution", screen.width + "x" + screen.height);
+ try {
+ eventKind = evt.kind;
+ previousExecutionState = evt.previousExecutionState
+ }
+ catch(e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception;
+ MS.Entertainment.fail("Exception while trying to acquire activation arguments. Error exception was:" + description + "." + "\n Error was:" + error);
+ return
+ }
+ try {
+ if (evt && evt.uri && evt.uri.rawUri)
+ deeplinkUri = new Windows.Foundation.Uri(evt.uri.rawUri)
+ }
+ catch(e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception;
+ MS.Entertainment.fail("Could not access activation event URI. Error exception was: " + description + "." + "\n Error was " + error)
+ }
+ try {
+ if (evt && evt.arguments)
+ launchArgs = evt.arguments
+ }
+ catch(e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception;
+ MS.Entertainment.fail("Could not access activation event arguments. Error exception was: " + description + "." + "\n Error was " + error)
+ }
+ if (eventKind === Windows.ApplicationModel.Activation.ActivationKind.launch && !deeplinkUri && launchArgs)
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.protocol;
+ else if (eventKind === Windows.ApplicationModel.Activation.ActivationKind.protocol && deeplinkUri && (!deeplinkUri.host || deeplinkUri.host === "default" || deeplinkUri.host === "media-default") && (!deeplinkUri.query || !alreadyHandledLaunch))
+ if (deeplinkUri.schemeName && deeplinkUri.schemeName.toLowerCase().indexOf("playto") !== -1)
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.protocol;
+ else
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.launch;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.applicationStateManager)) {
+ var applicationStateManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.applicationStateManager);
+ var previousStateDeeplinkUri = applicationStateManager.getPreviousApplicationStateDeeplink(previousExecutionState, eventKind);
+ var appAndMachineRegionMatch = !MS.Entertainment.Utilities.isVideoApp2 || MS.Entertainment.Utilities.appRegionMatchesMachineRegion();
+ var isSnapped = MS.Entertainment.Utilities.getWindowWidth() <= 480;
+ if (!deeplinkUri && appAndMachineRegionMatch && previousStateDeeplinkUri && !isSnapped) {
+ deeplinkUri = previousStateDeeplinkUri;
+ eventKind = Windows.ApplicationModel.Activation.ActivationKind.protocol
+ }
+ else
+ applicationStateManager.clearPreviousApplicationState()
+ }
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind = eventKind;
+ switch (eventKind) {
+ case Windows.ApplicationModel.Activation.ActivationKind.protocol:
+ alreadyHandledLaunch = true;
+ var deepLinkProcessed = false;
+ var preProcessPromise = WinJS.Promise.as();
+ var finishInitializing = function finishInitializing(){};
+ var processStageTwo = function processStageTwo() {
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isSnapped && !(deeplinkUri && deeplinkUri.host === "media-playback"))
+ MS.Entertainment.UI.Components.Shell.getUnsnapAction().execute()
+ };
+ if (MS.Entertainment.Utilities.isApp1) {
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ processStageTwo();
+ preProcessPromise = MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }
+ else {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ processStageTwo();
+ finishInitializing = function finishInitializing() {
+ processStageTwo();
+ MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }
+ }
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signInOnStart();
+ preProcessPromise.done(function preProcessFinished() {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ var playToUris = {
+ microsoftMusic: new Windows.Foundation.Uri("microsoftmusic://playto?"), microsoftVideo: new Windows.Foundation.Uri("microsoftvideo://playto?")
+ };
+ var playToStartedFrom = {
+ xboxVideo: "PlayTo-XboxVideo", xboxMusic: "PlayTo-XboxMusic", uknown: "PlayTo-Unknown"
+ };
+ if (!deeplinkUri && launchArgs)
+ dataPoint.appendParameter("StartedFrom", "Deeplink");
+ else if (MS.Entertainment.Utilities.isApp2 && deeplinkUri.schemeName && deeplinkUri.schemeName.toLowerCase().indexOf("playto") !== -1)
+ switch (deeplinkUri.schemeName.toLowerCase()) {
+ case"ms-playto-audio":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.uknown);
+ deeplinkUri = playToUris.microsoftMusic;
+ break;
+ case"ms-playtoapp-xboxmusic":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.xboxMusic);
+ deeplinkUri = playToUris.microsoftMusic;
+ break;
+ case"ms-playto-video":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.uknown);
+ deeplinkUri = playToUris.microsoftVideo;
+ break;
+ case"ms-playtoapp-xboxvideo":
+ dataPoint.appendParameter("StartedFrom", playToStartedFrom.xboxVideo);
+ deeplinkUri = playToUris.microsoftVideo;
+ break;
+ default:
+ break
+ }
+ else
+ dataPoint.appendParameter("StartedFrom", "Tile");
+ if (!deepLinkProcessed)
+ WinJS.Promise.join({
+ validDeepLink: (deeplinkUri), showWelcomeDialog: MS.Entertainment.UI.Application.Helpers.shouldShowWelcomeDialog(), isLocationDeeplink: (deeplinkUri && deeplinkUri.host === "location"), isTestDeeplink: (deeplinkUri && deeplinkUri.host === "runTest")
+ }).then(function(result) {
+ var showWelcomeDialog = result.validDeepLink && result.validDeepLink !== playToUris.microsoftVideo && result.showWelcomeDialog && !result.isTestDeeplink;
+ MS.Entertainment.UI.Application.Helpers.appConfig.showWelcomeDialog = showWelcomeDialog;
+ var stage3Promise = WinJS.Promise.as();
+ if (result.isLocationDeeplink || result.isTestDeeplink) {
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ if (result.isTestDeeplink)
+ stage3Promise = MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }
+ if (showWelcomeDialog)
+ return stage3Promise.then(function() {
+ return MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen()
+ });
+ else
+ return stage3Promise
+ }).done(function processDeeplink() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!MS.Entertainment.UI.DeepLink.processProtocol((deeplinkUri && deeplinkUri.rawUri), dataPoint, launchArgs)) {
+ finishInitializing();
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ navigationService.clearBackStackOnNextNavigate(false);
+ if (!navigationService.currentPage)
+ navigationService.init();
+ else
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ var title = MS.Entertainment.Utilities.isVideoApp ? String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE) : String.load(String.id.IDS_MUSIC_DEEPLINK_ERROR_GENERIC_TITLE);
+ var description = MS.Entertainment.Utilities.isVideoApp ? String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC) : String.load(String.id.IDS_MUSIC_DEEPLINK_ERROR_GENERIC_DESC);
+ WinJS.Promise.timeout(1).done(function showErrorDialog() {
+ MS.Entertainment.UI.Shell.showMessageBox(title, description)
+ })
+ }
+ else {
+ finishInitializing();
+ var forceExitToSystemOnBack = true;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.applicationStateManager)) {
+ var applicationStateManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.applicationStateManager);
+ if (applicationStateManager.previousApplicationState && applicationStateManager.previousApplicationState.hasBackStack)
+ forceExitToSystemOnBack = false
+ }
+ navigationService.forceExitToSystemOnBack = forceExitToSystemOnBack;
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ if (isFirstRun)
+ if ((MS.Entertainment.Utilities.isVideoApp) || (MS.Entertainment.Utilities.isMusicApp))
+ if (deeplinkUri && deeplinkUri.host && deeplinkUri.host === "play")
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayProtectedContent()
+ }
+ })
+ });
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.file:
+ MS.Entertainment.UI.Application.Helpers.waitForDatabaseUpdated();
+ if (isFirstRun && !isNonRootActivationHandler)
+ if ((MS.Entertainment.Utilities.isVideoApp) || (MS.Entertainment.Utilities.isMusicApp)) {
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayNonProtectedContent();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchPlayProtectedContent()
+ }
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ var loadFileActivationHtmlPromise = null;
+ if (MS.Entertainment.Utilities.isApp1)
+ loadFileActivationHtmlPromise = MS.Entertainment.Utilities.loadHtmlPage("/fileActivationStartup.html", "delayedStartupContainer");
+ else
+ loadFileActivationHtmlPromise = WinJS.Promise.wrap();
+ loadFileActivationHtmlPromise.done(function loadFileActivationFiles() {
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.none;
+ var suppressNavigateToImmersive = false;
+ var beginPlaybackPromise = new WinJS.Promise.as;
+ if (!isNonRootActivationHandler)
+ beginPlaybackPromise = MS.Entertainment.Activation.fileActivationHandler(evt, !isFirstRun, suppressNavigateToImmersive);
+ beginPlaybackPromise.then(function continueStageTwo() {
+ if (!suppressNavigateToImmersive)
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.startup;
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ if (isFirstRun && suppressNavigateToImmersive) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!isNonRootActivationHandler && !preLaunched)
+ navigationService.skipEnterAnimationOnNextNavigation = true;
+ navigationService.init()
+ }
+ else
+ MS.Entertainment.UI.Application.Activation.activateStageThree()
+ }, function onError() {
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).init()
+ })
+ });
+ dataPoint.appendParameter("StartedFrom", "File");
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.launch:
+ if (alreadyHandledLaunch)
+ return;
+ alreadyHandledLaunch = true;
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ if (deeplinkUri && deeplinkUri.query && deeplinkUri.host === "default")
+ try {
+ var playState = deeplinkUri.queryParsed.getFirstValueByName("PlayState");
+ startPlaybackOnLaunch = playState && playState.toLowerCase() === MS.Entertainment.UI.DeepLink.PlayStateType.play
+ }
+ catch(e) {
+ startPlaybackOnLaunch = false
+ }
+ else
+ startPlaybackOnLaunch = MS.Entertainment.Utilities.isMusicApp2;
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ if (MS.Entertainment.Utilities.isVideoApp) {
+ var defaultLaunchSetting = String.Empty;
+ var moniker = String.empty;
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ defaultLaunchSetting = Windows.Storage.ApplicationData.current.roamingSettings.values["launchLocation"];
+ moniker = MS.Entertainment.UI.Monikers[defaultLaunchSetting]
+ }
+ if (!defaultLaunchSetting || !moniker)
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ MS.Entertainment.ViewModels.VideoSpotlight.startupVideoSpotlight = new MS.Entertainment.ViewModels.VideoSpotlight
+ }
+ navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (!isNonRootActivationHandler && !preLaunched)
+ navigationService.skipEnterAnimationOnNextNavigation = true;
+ navigationService.init();
+ dataPoint.appendParameter("StartedFrom", "Tile");
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.search:
+ MS.Entertainment.UI.Application.Helpers.showExtendedSplashScreen(evt.splashScreen);
+ MS.Entertainment.UI.Application.Activation.activateStageTwo();
+ MS.Entertainment.UI.Application.Activation.activateStageThree().done(function stageThreeActivated() {
+ var handled = false;
+ if (evt && evt.queryText) {
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ if (MS.Entertainment.ViewModels.SearchContractViewModel.current)
+ handled = MS.Entertainment.ViewModels.SearchContractViewModel.current.searchKeywordSubmitted(evt)
+ }
+ if (!handled)
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).init();
+ dataPoint.appendParameter("StartedFrom", "Deeplink");
+ dataPoint.appendParameter("DeeplinkSource", "Search")
+ });
+ break
+ }
+ {};
+ if (!isNonRootActivationHandler)
+ MS.Entertainment.Utilities.Telemetry.closeDataPoint(dataPoint)
+ };
+ doActivate(activationArgs)
+ }, resuming: function resuming(e) {
+ if (isPrelaunched)
+ return;
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceProcessResumeEventStart();
+ var startTime = new Date;
+ if (!applicationLifetimeManager)
+ applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ applicationLifetimeManager.raiseResuming();
+ if (tileManager && MS.Entertainment.Utilities.isApp1)
+ tileManager.updateTile();
+ commonEventProvider.traceProcessResumeTelemetryStart();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appResumed();
+ commonEventProvider.traceProcessResumeTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onResuming();
+ wasRecentlyResumed = true;
+ var stopTime = new Date;
+ var duration = stopTime.valueOf() - startTime.valueOf();
+ commonEventProvider.traceProcessResumeEventStop(duration);
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Platform.PlayTo.initPlayToReceiver().done(null, function onInitPlayToReceiverError(){})
+ }, suspending: function suspending(e) {
+ if (isPrelaunched)
+ return;
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceProcessSuspendEventStart();
+ var startTime = new Date;
+ if (!applicationLifetimeManager)
+ applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ applicationLifetimeManager.raiseSuspending();
+ commonEventProvider.traceProcessSuspendTelemetryStart();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appSuspended();
+ commonEventProvider.traceProcessSuspendTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onSuspending();
+ var stopTime = new Date;
+ var duration = stopTime.valueOf() - startTime.valueOf();
+ commonEventProvider.traceProcessSuspendEventStop(duration);
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Platform.PlayTo.stopPlayToReceiver(e.suspendingOperation.getDeferral()).done(function onStopPlayToReceiver(){}, function onStopPlayToReceiverError(){})
+ }, unload: function unload(e) {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionMgr)
+ sessionMgr.displayRequestRelease()
+ }
+ var app = new Microsoft.Entertainment.Application.Application;
+ app.shutdownAsync();
+ window.removeEventListener("unload", MS.Entertainment.UI.Application.Activation.unload)
+ }, activateStageTwo: function activateStageTwo() {
+ if (stageTwoInitialized)
+ return;
+ stageTwoInitialized = true;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService).initialize();
+ MS.Entertainment.UI.Components.Shell.initializeSnappedMode();
+ if (MS.Entertainment.Utilities.isApp2) {
+ WinJS.Utilities.addClass(document.body, "showKeyboardFocus");
+ MS.Entertainment.Platform.PlayTo.initPlayToReceiver().done(null, function onInitPlayToReceiverError(){})
+ }
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var attemptedReload = false;
+ if (startPlaybackOnLaunch) {
+ signIn.signInOnStart();
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ attemptedReload = true;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.nowPlayingControlManager).preloadNowPlayingControls();
+ if (signedInUser && signedInUser.gamerTag === configurationManager.service.lastSignedInUserGamerTag)
+ MS.Entertainment.Platform.PlaybackHelpers.reloadNowPlaying(true);
+ else
+ attemptedReload = false
+ }
+ else
+ MS.Entertainment.Platform.PlaybackHelpers.reloadNowPlaying(false);
+ var binding = MS.Entertainment.Utilities.addEventHandlers(signIn, {isSignedInChanged: function onSignInChange(event) {
+ var isSignedIn = event.detail.newValue;
+ if (isSignedIn) {
+ if (startPlaybackOnLaunch && !attemptedReload) {
+ MS.Entertainment.Platform.PlaybackHelpers.reloadNowPlaying(true);
+ attemptedReload = true
+ }
+ }
+ else {
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ if (playbackSession) {
+ playbackSession.setDataSource(null);
+ playbackSession.currentMedia = null;
+ playbackSession.pendingOrdinal = null;
+ MS.Entertainment.Platform.PlaybackHelpers.playActionInitiated = false
+ }
+ attemptedReload = false;
+ playbackSession = null
+ }
+ }})
+ }
+ var iaService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.informationArchitecture);
+ iaService.initialize();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus);
+ if (MS.Entertainment.FeatureEnablement)
+ MS.Entertainment.FeatureEnablement.initialize()
+ }, activateStageThree: function activateStageThree() {
+ var _delayTimerMS = 50;
+ if (shouldShowAppBar && !window.onNewMusicPage)
+ WinJS.Promise.timeout(showAppBarDelay).done(function() {
+ var appBarControl = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBarControl)
+ appBarControl.show(MS.Entertainment.UI.Controls.BottomAppBar.defaultHideTimeoutMS);
+ shouldShowAppBar = false;
+ showAppBarDelay = 0
+ });
+ if (stageThreePromise)
+ return stageThreePromise;
+ var delayedStageThreePath = "/delayedStageThreeStartup.html";
+ if (window.onNewVideoPage)
+ delayedStageThreePath = "/Classic" + delayedStageThreePath;
+ stageThreePromise = MS.Entertainment.Utilities.loadHtmlPage(delayedStageThreePath, "delayedStartupContainer").then(function loadStageThreeFiles() {
+ if (MS.Entertainment.UI.Application.Helpers.activationTelemetryData && MS.Entertainment.UI.Application.Helpers.activationTelemetryData.length > 0) {
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData.forEach(function itemIterator(dataPoint) {
+ dataPoint.write()
+ });
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData = null
+ }
+ if (MS.Entertainment.UI.FileTransferNotificationHandlers) {
+ MS.Entertainment.UI.fileTransferNotificationHandler = new MS.Entertainment.UI.FileTransferNotificationHandlers;
+ MS.Entertainment.UI.fileTransferNotificationHandler.startTransferListener()
+ }
+ if (MS.Entertainment.Utilities.isMusicApp)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.freePlayLimits).initialize();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dashboardRefresher).initialize();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.backButton);
+ if (!window.onNewVideoPage) {
+ var pointerUpHandler = function mouseClickHandler(event) {
+ if (event.button === 3) {
+ var navigateBackAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateBackAction.automationId = MS.Entertainment.UI.AutomationIds.mouseNavigateBack;
+ navigateBackAction.parameter = MS.Entertainment.UI.Actions.navigate.NavigateLocation.back;
+ navigateBackAction.execute()
+ }
+ };
+ document.addEventListener("MSPointerUp", pointerUpHandler);
+ document.addEventListener("pointerup", pointerUpHandler)
+ }
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ if (MS.Entertainment.ViewModels.SearchContractViewModel.current)
+ MS.Entertainment.ViewModels.SearchContractViewModel.current.loadSearchObject();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.typeToSearch))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).enableTypeToSearch();
+ if (MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp)
+ MS.Entertainment.Utilities.DRM.individualizationAsync();
+ if (!window.onNewVideoPage) {
+ MS.Entertainment.Framework.KeyboardInteractionListener.init();
+ MS.Entertainment.Framework.KeyboardShortcutHandler.instance.initialize();
+ MS.Entertainment.UI.Shell.createShellKeyboardShortcuts()
+ }
+ if (MS.Entertainment.UI.Shell.createShellVoiceShortcuts)
+ MS.Entertainment.UI.Shell.createShellVoiceShortcuts();
+ if (MS.Entertainment.UI.App2 && MS.Entertainment.UI.App2.registerForVoiceEvents)
+ MS.Entertainment.UI.App2.registerForVoiceEvents();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.pinnedList))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.pinnedList);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender)) {
+ var sender = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ sender.setDefaultEmptyMessage()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionStateHandler))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionStateHandler).initialize();
+ MS.Entertainment.UI.PurchaseHistoryService.initialize();
+ if (MS.Entertainment.Utilities.isMusicApp) {
+ var cloudCollectionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.cloudCollection);
+ cloudCollectionService.startListening()
+ }
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).bind("isSignedIn", function onSignInChange(isSignedIn) {
+ if (isSignedIn) {
+ MS.Entertainment.Utilities.Telemetry.ensureKeystoneStarted();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoCloudCollection)) {
+ var videoCloudCollection = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoCloudCollection);
+ videoCloudCollection.startSync()
+ }
+ if (Microsoft.Entertainment.FileTransferManager)
+ Microsoft.Entertainment.FileTransferManager.scheduleProgressCheck()
+ }
+ });
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.systemMTCMetadataUpdater))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.systemMTCMetadataUpdater);
+ var appNotificationInitPromise = WinJS.Promise.as();
+ if (!MS.Entertainment.Utilities.isApp2)
+ appNotificationInitPromise = WinJS.Promise.timeout(_delayTimerMS).then(function delay1() {
+ return WinJS.UI.process(MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appInfoNotification))
+ }).then(function initializeControl(control) {
+ if (control)
+ control.delayedInitialize()
+ }).then(function loadCriticalNotification() {
+ return WinJS.UI.process(MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appCriticalNotification)).then(function(control) {
+ control.delayedInitialize()
+ })
+ });
+ return appNotificationInitPromise.then(function delay() {
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience)
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification).send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_DEMO_IN_DEMO_MODE), subTitle: "", moreDetails: "", action: null, category: "demo", isPersistent: true
+ }));
+ if (MS.Entertainment.Utilities.isVideoApp2 && WinJS.Utilities.getMember("Microsoft.Entertainment.BackgroundTasks.EpgChannelUpdateTask"))
+ WinJS.Promise.timeout(2000).then(function() {
+ var epg = new Microsoft.Entertainment.BackgroundTasks.EpgChannelUpdateTask;
+ epg.scheduleBackgroundTask();
+ epg.updateChannelsNow()
+ });
+ return WinJS.Promise.timeout(_delayTimerMS).then(function processAppBar() {
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ var processAppBarPromise = WinJS.Promise.wrap();
+ if (bottomAppBar && bottomAppBar.domElement === undefined)
+ processAppBarPromise = WinJS.UI.processAll(bottomAppBar);
+ processAppBarPromise.done(function loadAppBar() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.tileManager) && MS.Entertainment.Utilities.isApp1)
+ tileManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.tileManager);
+ if (!MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar).deferredInit();
+ else
+ MS.Entertainment.UI.Controls.CommandingPopOver.enableEdgeGlobalCommands();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).stageThreeActivated = true
+ }.bind(this))
+ }).then(function delay3() {
+ return WinJS.Promise.timeout(_delayTimerMS).then(function signIn() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return signIn.signInOnStart()
+ })
+ }).then(function delay4() {
+ return WinJS.Promise.timeout(_delayTimerMS).then(function initializePlaybackErrorDisplayService() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService).initialize()
+ })
+ }).then(function delay5() {
+ var stageFourTimer = WinJS.Promise.timeout(stageFourDelay).then(MS.Entertainment.UI.Application.Activation.activateStageFour);
+ return stageFourTimer
+ })
+ })
+ });
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ var isSnappedBinding = WinJS.Binding.bind(uiStateService, {isSnapped: function _isSnappedChanged(isSnapped) {
+ if (isSnapped)
+ return MS.Entertainment.Video.Video2WelcomeDialog.hide();
+ else
+ return MS.Entertainment.Video.Video2WelcomeDialog.show()
+ }});
+ return stageThreePromise
+ }, activateStageFour: function activateStageFour() {
+ if (stageFourPromise)
+ return stageFourPromise;
+ stageFourPromise = MS.Entertainment.Utilities.loadHtmlPage("/delayedStageFourStartup.html", "delayedStartupContainer").then(function stageFourLoadFiles() {
+ if (MS.Entertainment.UI.Actions.ImportPlaylists)
+ MS.Entertainment.UI.Actions.ImportPlaylists.resumeLastPlaylistImport();
+ if (MS.Entertainment.Utilities.isMusicApp2) {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.idleApplicationService).initialize();
+ MS.Entertainment.UI.Application.Helpers.loadNavigateToNowPlayingOnIdleService()
+ }
+ if (MS.Entertainment.Utilities.isApp1 && MS.Entertainment.Framework.UpgradeToBlueNotification)
+ MS.Entertainment.Framework.UpgradeToBlueNotification.showNotification();
+ if (!MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.UI.Framework.unblockPreloading();
+ if (MS.Entertainment.Utilities.isVideoApp)
+ MS.Entertainment.Data.Query.Video.requestFields.cacheRequestFields()
+ });
+ return stageFourPromise
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Application.Helpers", {
+ splashScreenCleared: function splashScreenCleared() {
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceSplashScreen_Removed()
+ }, activationTelemetryData: null, windowResizeSplashScreenHandler: null, showExtendedSplashScreen: function showExtendedSplashScreen(splashDetails) {
+ var splashScreenImage = document.querySelector(".extendedSplashScreenImage");
+ var splashScreenProgressContainer = document.querySelector(".extendedSplashScreenProgressContainer");
+ if (!splashScreenImage)
+ return;
+ if (!splashDetails) {
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ return
+ }
+ MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler = function() {
+ try {
+ var imageLocation = splashDetails.imageLocation;
+ splashScreenImage.style.top = imageLocation.y + "px";
+ splashScreenImage.style.left = imageLocation.x + "px";
+ splashScreenImage.style.height = imageLocation.height + "px";
+ splashScreenImage.style.width = imageLocation.width + "px";
+ splashScreenProgressContainer.style.marginTop = imageLocation.y + imageLocation.height + 32 + "px"
+ }
+ catch(e) {
+ MS.Entertainment.fail("Exception trying to get splash screen information: " + e.toString())
+ }
+ };
+ MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler();
+ window.addEventListener("resize", MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler)
+ }, updateExtendedSplashScreenMessage: function updateExtendedSplashScreenMessage(title, message) {
+ var splashScreenTitle = document.querySelector(".extendedSplashScreenTitle");
+ var splashScreenMessage = document.querySelector(".extendedSplashScreenMessage");
+ if (splashScreenTitle)
+ splashScreenTitle.innerText = title;
+ if (splashScreenMessage)
+ splashScreenMessage.innerText = message
+ }, waitForDatabaseUpdated: function waitForDatabaseUpdated() {
+ var mediaStore;
+ var promise;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ if (mediaStore && mediaStore.databaseNeedsUpgrade) {
+ var query;
+ var waitTitle = String.load(String.id.IDS_APP_UPDATE_SPLASH_TITLE);
+ var waitMessage = String.load(String.id.IDS_APP_UPDATE_SPLASH_SUBTITLE);
+ MS.Entertainment.UI.Application.Helpers.updateExtendedSplashScreenMessage(waitTitle, waitMessage);
+ promise = mediaStore.ensureDatabaseOpenedAsync().then(null, function ignoreError(){})
+ }
+ return WinJS.Promise.as(promise)
+ }, _inProgressRemoveExtendedSplashScreen: false, removeExtendedSplashScreenDOM: function removeExtendedSplashScreenDOM() {
+ var extendedSplashScreen = document.querySelector(".extendedSplashScreen");
+ if (!extendedSplashScreen)
+ return;
+ window.removeEventListener("resize", MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler);
+ MS.Entertainment.UI.Application.Helpers.windowResizeSplashScreenHandler = null;
+ MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen = false;
+ if (extendedSplashScreen.parentElement)
+ extendedSplashScreen.parentElement.removeChild(extendedSplashScreen);
+ if (isPrelaunched) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.skipEnterAnimationOnNextNavigation = false;
+ var unsnappedElement = document.getElementById("htmlUnsnapped");
+ if (unsnappedElement)
+ WinJS.Utilities.removeClass(unsnappedElement, "hideFromDisplay")
+ }
+ }, removeExtendedSplashScreen: function removeExtendedSplashScreen() {
+ if (MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen)
+ return WinJS.Promise.as();
+ if (isPrelaunched) {
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreenDOM();
+ return WinJS.Promise.as()
+ }
+ MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen = true;
+ return MS.Entertainment.UI.Application.Helpers.waitForDatabaseUpdated().then(function databaseUpdateFinishedOrNotNeeded() {
+ return MS.Entertainment.Utilities.loadDemoScripts()
+ }).then(function demoScriptsLoaded() {
+ var extendedSplashScreen = document.querySelector(".extendedSplashScreen");
+ var welcomeScreenDisplayed = WinJS.Promise.as();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService))
+ welcomeScreenDisplayed = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.welcomeDialogService).initialize();
+ if (!extendedSplashScreen) {
+ MS.Entertainment.UI.Application.Helpers._inProgressRemoveExtendedSplashScreen = false;
+ return
+ }
+ welcomeScreenDisplayed.done(MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreenDOM, MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreenDOM);
+ var unsnappedElement = document.getElementById("htmlUnsnapped");
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (unsnappedElement && !uiStateService.isSnapped)
+ WinJS.Utilities.removeClass(unsnappedElement, "hideFromDisplay");
+ if (MS.Entertainment.Utilities.isApp2)
+ WinJS.Utilities.addClass(document.body, "showKeyboardFocus");
+ var currentPage = document.querySelector(".pageContainer.currentPage");
+ if (currentPage) {
+ MS.Entertainment.Utilities.enterElement(currentPage).done(function() {
+ MS.Entertainment.UI.Framework.setFocusRoot(currentPage)
+ });
+ if (MS.Entertainment.Utilities.isApp2 && document.activeElement)
+ WinJS.Utilities.addClass(document.activeElement, "acc-keyboardFocusTarget")
+ }
+ else {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.skipEnterAnimationOnNextNavigation = false
+ }
+ return MS.Entertainment.UI.Application.Helpers.shouldShowWelcomeDialog().then(function(shouldShowWelcomeDialog) {
+ if (!shouldShowWelcomeDialog)
+ return;
+ MS.Entertainment.assert(MS.Entertainment.Utilities.isApp2, "Only allowed in App2");
+ var showPromise = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.welcomeDialogService).show() : MS.Entertainment.Video.Video2WelcomeDialog.show();
+ var onDialogDismissed = function onDialogDismissed() {
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService))
+ MS.Entertainment.UI.Application.Helpers.setShowWelcomeDialogState(false);
+ if (unsnappedElement && !uiStateService.isSnapped) {
+ var dashboardElement = document.querySelector(".currentPage .navigationHost.dashboardHost");
+ if (dashboardElement && dashboardElement.winControl && dashboardElement.winControl.focusHome)
+ dashboardElement.winControl.focusHome()
+ }
+ };
+ return showPromise.then(onDialogDismissed, onDialogDismissed)
+ })
+ })
+ }, appConfig: {get: function get() {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return MS.Entertainment.Utilities.isMusicApp ? configManager.music : configManager.video
+ }}, shouldShowWelcomeDialog: function shouldShowWelcomeDialog() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return WinJS.Promise.as(false);
+ var showWelcomeDialog = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService) || MS.Entertainment.UI.Application.Helpers.appConfig.showWelcomeDialog;
+ var welcomeDialogRequired;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.welcomeDialogService))
+ welcomeDialogRequired = MS.Entertainment.UI.WelcomeDialogService.isWelcomeScreenRequired();
+ else if (MS.Entertainment.Utilities.isVideoApp2) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var hasMarketplace = (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace));
+ showWelcomeDialog = (!uiStateService.isSnapped && !hasMarketplace)
+ }
+ else if (!MS.Entertainment.isAppModeOverride && MS.Entertainment.Utilities.supportsProtectedContent)
+ showWelcomeDialog = false;
+ return WinJS.Promise.join({
+ shouldShowWelcomeDialog: showWelcomeDialog, welcomeDialogRequired: welcomeDialogRequired || showWelcomeDialog
+ }).then(function(result) {
+ return result.shouldShowWelcomeDialog && WinJS.Utilities.getMember("welcomeDialogRequired.shouldDisplayWelcomeScreen", result)
+ })
+ }, setShowWelcomeDialogState: function setShowWelcomeDialogState(value) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ MS.Entertainment.UI.Application.Helpers.appConfig.showWelcomeDialog = value
+ }, visibilityChanged: function visibilityChanged() {
+ var isVisible = !document.hidden;
+ if (!commonEventProvider)
+ commonEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ commonEventProvider.traceAppVisibilityChanged(isVisible);
+ var freezeThawTargets = [];
+ var pageContainer;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.isAppVisible = !document.hidden;
+ var freezeThawPageContainer = function freezeThawPageContainer() {
+ pageContainer = document.getElementById("pageContainer");
+ if (pageContainer && pageContainer.childElementCount > 0)
+ (function() {
+ var target = document.querySelector("#pageContainer .currentPage");
+ MS.Entertainment.assert(target, "Didn't find the current page to thaw");
+ if (target)
+ freezeThawTargets.push(target)
+ })();
+ var overlays = document.querySelectorAll(".overlayAnchor");
+ if (overlays)
+ Array.prototype.forEach.call(overlays, function(overlay) {
+ freezeThawTargets.push(overlay)
+ })
+ };
+ if (!uiStateService.isSnapped)
+ freezeThawPageContainer();
+ else
+ (function() {
+ var target = document.querySelector("#htmlSnapped");
+ if (WinJS.Utilities.hasClass(target, "hideFromDisplay"))
+ freezeThawPageContainer();
+ else {
+ MS.Entertainment.assert(target, "Didn't find the current page to thaw");
+ freezeThawTargets.push(target)
+ }
+ })();
+ if (freezeThawTargets && freezeThawTargets.length)
+ if (document.hidden)
+ freezeThawTargets.forEach(function(freezeThawTarget) {
+ MS.Entertainment.Utilities.freezeControlsInSubtree(freezeThawTarget)
+ });
+ else {
+ freezeThawTargets.forEach(function(freezeThawTarget) {
+ MS.Entertainment.Utilities.thawControlsInSubtree(freezeThawTarget)
+ });
+ if (WinJS.Utilities.getMember("Microsoft.PerfTrack.PerfTrackTimePoint.responsive"))
+ if (wasRecentlyResumed)
+ MS.Entertainment.Instrumentation.PerfTrack.getLogger().writeResumeStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive)
+ }
+ wasRecentlyResumed = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appVisibilityChanged();
+ if (isVisible && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.richPresence)) {
+ var richPresenceService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.richPresence);
+ richPresenceService.refreshRichPresence()
+ }
+ try {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ mediaStore.prepareDatabaseForSuspend(!isVisible)
+ }
+ catch(e) {}
+ if (isVisible && MS.Entertainment.Utilities.isVideoApp2 && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoCloudCollection)) {
+ var videoCloudCollection = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoCloudCollection);
+ videoCloudCollection.startSync()
+ }
+ }, handleDashboardVisible: function handleDashboardVisible() {
+ if (!MS.Entertainment.Utilities.isApp2) {
+ var appBar = document.querySelector(".bottomAppBar");
+ WinJS.Utilities.removeClass(appBar, "removeFromDisplay")
+ }
+ document.removeEventListener("HubStripVisible", MS.Entertainment.UI.Application.Helpers.handleDashboardVisible);
+ MS.Entertainment.UI.Application.Helpers.removeExtendedSplashScreen();
+ WinJS.Promise.timeout(1).done(function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunch()
+ })
+ }, handleDashboardReady: function handleDashboardReady() {
+ document.removeEventListener("HubStripReady", MS.Entertainment.UI.Application.Helpers.handleDashboardReady);
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.normal;
+ WinJS.Promise.timeout().then(function _delayHandleDashboardReady() {
+ MS.Entertainment.UI.Application.Activation.activateStageThree()
+ })
+ }, rejectImageDrags: function rejectImageDrags(event) {
+ if (event.target.tagName === "IMG")
+ event.preventDefault()
+ }, navigateBack: function navigateBack() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateBack()
+ }, loadNavigateToNowPlayingOnIdleService: function loadNavigateToNowPlayingOnIdleService() {
+ var idleApplicationService = new MS.Entertainment.Framework.IdleApplicationService;
+ idleApplicationService.initialize();
+ idleApplicationService.setIdleTime(60000);
+ var playbackSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).primarySession;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ idleApplicationService.addEventListener(idleApplicationService.applicationIdleEvent, function navigateToNowPlaying() {
+ if (uiStateService && !uiStateService.isSnapped && !uiStateService.nowPlayingVisible && !uiStateService.isSearchPaneVisible && !uiStateService.overlayVisible && !uiStateService.activeListening && !uiStateService.nuiEngaged && playbackSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing && playbackSession.playerState === MS.Entertainment.Platform.Playback.PlayerState.ready)
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersive(null, {
+ sessionId: playbackSession.sessionId, startFullScreen: false
+ })
+ })
+ }
+ });
+ if (!MS.Entertainment.Utilities.systemAppListenersAttached) {
+ Windows.UI.WebUI.WebUIApplication.addEventListener("activated", MS.Entertainment.UI.Application.Activation.activated);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", MS.Entertainment.UI.Application.Activation.resuming);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", MS.Entertainment.UI.Application.Activation.suspending);
+ window.addEventListener("unload", MS.Entertainment.UI.Application.Activation.unload, false);
+ document.addEventListener("dragstart", MS.Entertainment.UI.Application.Helpers.rejectImageDrags, true);
+ MS.Entertainment.Utilities.systemAppListenersAttached = true
+ }
+ document.addEventListener("visibilitychange", MS.Entertainment.UI.Application.Helpers.visibilityChanged, false);
+ document.addEventListener("HubStripVisible", MS.Entertainment.UI.Application.Helpers.handleDashboardVisible);
+ document.addEventListener("HubStripReady", MS.Entertainment.UI.Application.Helpers.handleDashboardReady);
+ MS.Entertainment.Utilities.processAllOnDocumentLoaded().then(function mainLoaded() {
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceFinish_ProcessAll()
+ })
+})()
diff --git a/packages/microsoft.zunevideo/main_merged.js b/packages/microsoft.zunevideo/main_merged.js
new file mode 100644
index 00000000..afd197d3
--- /dev/null
+++ b/packages/microsoft.zunevideo/main_merged.js
@@ -0,0 +1,31968 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ scriptMappings: {
+ "/winrttemplateproviderstubs.js": "/main_merged.js",
+ "/components/perftrack/perftrack.js": "/main_merged.js",
+ "/framework/commonstringids.js": "/main_merged.js",
+ "/framework/nativestringids.js": "/main_merged.js",
+ "/framework/lockedstringids.js": "/main_merged.js",
+ "/framework/videostringids.js": "/main_merged.js",
+ "/framework/video1stringids.js": "/main_merged.js",
+ "/framework/corefx.js": "/main_merged.js",
+ "/framework/scriptvalidator.js": "/main_merged.js",
+ "/framework/debug.js": "/main_merged.js",
+ "/framework/utilities.js": "/main_merged.js",
+ "/framework/servicelocator.js": "/main_merged.js",
+ "/framework/featureenablementservice.js": "/main_merged.js",
+ "/framework/telemetryutilities.js": "/main_merged.js",
+ "/framework/usertimetelemetrymanager.js": "/main_merged.js",
+ "/monikers.js": "/main_merged.js",
+ "/framework/uistateservice.js": "/main_merged.js",
+ "/framework/observablearray.js": "/main_merged.js",
+ "/framework/data/factory.js": "/main_merged.js",
+ "/framework/data/ranges.js": "/main_merged.js",
+ "/framework/data/grouper.js": "/main_merged.js",
+ "/framework/data/list.js": "/main_merged.js",
+ "/framework/data/virtuallist.js": "/main_merged.js",
+ "/framework/data/query.js": "/main_merged.js",
+ "/framework/keyboardnavigationmanager.js": "/main_merged.js",
+ "/framework/querywatcher.js": "/main_merged.js",
+ "/framework/actionidentifiers.js": "/main_merged.js",
+ "/framework/videoactionidentifiers.js": "/main_merged.js",
+ "/framework/automationidentifiers.js": "/main_merged.js",
+ "/framework/videoautomationidentifiers.js": "/main_merged.js",
+ "/framework/action.js": "/main_merged.js",
+ "/controls/listcontrols.js": "/main_merged.js",
+ "/framework/selectionmanager.js": "/main_merged.js",
+ "/controls/pivotcontrols.js": "/main_merged.js",
+ "/framework/winjsnavigation.js": "/main_merged.js",
+ "/components/signin/signinerrors.js": "/main_merged.js",
+ "/components/signin/signin.js": "/main_merged.js",
+ "/framework/endpoints.js": "/main_merged.js",
+ "/framework/accutils.js": "/main_merged.js",
+ "/framework/pluralizationutilities.js": "/main_merged.js",
+ "/framework/formatters.js": "/main_merged.js",
+ "/framework/navigatetopageaction.js": "/main_merged.js",
+ "/framework/video_win/videonavigationactions.js": "/main_merged.js",
+ "/framework/deeplink.js": "/main_merged.js",
+ "/framework/video_win/videodeeplinks.js": "/main_merged.js",
+ "/framework/video_win/videodeeplinksactions.js": "/main_merged.js",
+ "/framework/shortcutmanager.js": "/main_merged.js",
+ "/framework/keyboardshortcuthandler.js": "/main_merged.js",
+ "/framework/networkstatusservice.js": "/main_merged.js",
+ "/components/search/typetosearchservice.js": "/main_merged.js",
+ "/components/shell/appnotification.js": "/main_merged.js",
+ "/controls/video_win/devicelimiterror.js": "/main_merged.js",
+ "/coreapplication.js": "/main_merged.js",
+ "/videowinmain.js": "/main_merged.js",
+ "/components/shell/apptoolbarservice.js": "/group_2_merged.js",
+ "/components/shell/openfileaction.js": "/group_2_merged.js",
+ "/components/playback/concurrentstreamingrestriction.js": "/group_2_merged.js",
+ "/components/playback/playbackerrors.js": "/group_2_merged.js",
+ "/components/playback/playlist/playlist.js": "/group_2_merged.js",
+ "/components/playback/playbackeventnotifications.js": "/group_2_merged.js",
+ "/components/playback/controls/mediaplayer.js": "/moviedetails_merged.js",
+ "/components/playback/controls/xplayer.js": "/group_2_merged.js",
+ "/components/playback/playbackhelpers.js": "/group_2_merged.js",
+ "/components/shell/purchasehelpers.js": "/group_2_merged.js",
+ "/components/playback/playbacktrace.js": "/group_1_merged.js",
+ "/components/playback/volumecontroller.js": "/group_2_merged.js",
+ "/components/playback/playlog.js": "/group_2_merged.js",
+ "/components/playback/playbackstates.js": "/group_2_merged.js",
+ "/components/playback/session/playbacksession.js": "/group_2_merged.js",
+ "/components/playback/mediainstance.js": "/moviedetails_merged.js",
+ "/components/playback/controls/playbackcontrollervideo.js": "/moviedetails_merged.js",
+ "/components/playback/controls/playbackcontroller.js": "/moviedetails_merged.js",
+ "/components/playback/controls/playbackcontrol.js": "/group_2_merged.js",
+ "/controls/transportcontrols/transportcontrols.js": "/moviedetails_merged.js",
+ "/components/session/sessionmgr.js": "/group_2_merged.js",
+ "/components/playback/closedcaptions/renderer.js": "/moviedetails_merged.js",
+ "/components/playback/closedcaptions/presenter.js": "/moviedetails_merged.js",
+ "/controls/actionlist.js": "/group_2_merged.js",
+ "/controls/video_win/videowinnowplayingoverlays.js": "/nowplaying_merged.js",
+ "/components/immersivedetails/showimmersivedetailsaction.js": "/group_2_merged.js",
+ "/controls/dialog.js": "/group_1_merged.js",
+ "/viewmodels/purchaseflow/smartbuybuttons.js": "/group_2_merged.js",
+ "/components/inlinedetails/actionbuttonscontrol.js": "/group_2_merged.js",
+ "/viewmodels/social/sharefactory.js": "/group_2_merged.js",
+ "/viewmodels/social/sharesender.js": "/group_2_merged.js",
+ "/viewmodels/social/sharehost.js": "/group_2_merged.js",
+ "/viewmodels/purchaseflow/videosmartbuystateengine.js": "/group_2_merged.js",
+ "/framework/downloadaction.js": "/group_2_merged.js",
+ "/framework/deleteaction.js": "/group_2_merged.js",
+ "/controls/video/choosedownloadquality.js": "/group_2_merged.js",
+ "/controls/gallerygrouper.js": "/group_1_merged.js",
+ "/controls/modifier.js": "/group_1_merged.js",
+ "/framework/data/queries/videoqueries.js": "/group_1_merged.js",
+ "/framework/acquisitiondata.js": "/group_1_merged.js",
+ "/controls/mediastatusicon.js": "/group_2_merged.js",
+ "/components/playback/addtonowplayingaction.js": "/group_2_merged.js",
+ "/controls/userfeedbackdialog.js": "/group_2_merged.js",
+ "/framework/interactionnotifier.js": "/group_1_merged.js",
+ "/controls/webhostexperience.js": "/group_2_merged.js",
+ "/framework/purchasehistoryservice.js": "/moviedetails_merged.js",
+ "/components/social/sharetemplates.js": "/group_2_merged.js",
+ "/viewmodels/queryviewmodel.js": "/group_1_merged.js",
+ "/controls/managefoldersview.js": "/videocollection_merged.js",
+ "/framework/scriptutilities.js": "/searchresultspage_merged.js",
+ "/framework/imageloader.js": "/group_1_merged.js",
+ "/framework/filetransfernotificationservice.js": "/group_1_merged.js",
+ "/framework/filetransferservice.js": "/group_1_merged.js",
+ "/controls/label.js": "/group_2_merged.js",
+ "/controls/overlay.js": "/group_1_merged.js",
+ "/framework/urifactory.js": "/group_1_merged.js",
+ "/framework/data/augmenters/commonhydrators.js": "/group_1_merged.js",
+ "/framework/data/augmenters/commonaugmenters.js": "/group_1_merged.js",
+ "/framework/data/augmenters/edsaugmenters.js": "/group_1_merged.js",
+ "/framework/data/augmenters/spotlightaugmenters.js": "/group_1_merged.js",
+ "/framework/shell.js": "/videocollection_merged.js",
+ "/framework/externalnavigateaction.js": "/moviedetails_merged.js",
+ "/animations/galleryanimations.js": "/group_2_merged.js",
+ "/controls/gallerycontrol.js": "/group_1_merged.js",
+ "/framework/navigateaction.js": "/group_1_merged.js",
+ "/framework/contentnotification.js": "/group_1_merged.js",
+ "/components/shell/contentnotificationlist.js": "/group_1_merged.js",
+ "/viewmodels/mediaitemmodel.js": "/group_1_merged.js",
+ "/framework/upgradereminderdisplayer.js": "/group_2_merged.js",
+ "/controls/popover.js": "/group_2_merged.js",
+ "/controls/link.js": "/group_1_merged.js",
+ "/controls/iconbutton.js": "/group_1_merged.js",
+ "/framework/imageidtypes.js": "/group_1_merged.js",
+ "/viewmodels/purchaseflow/smartbuystateengine.js": "/group_2_merged.js",
+ "/framework/downloadinfo.js": "/group_1_merged.js",
+ "/framework/disabled.js": "/group_2_merged.js",
+ "/viewmodels/purchaseflow/smartappbaractions.js": "/group_2_merged.js",
+ "/controls/errordialog.js": "/group_2_merged.js",
+ "/controls/video/videodownloadmanager.js": "/moviedetails_merged.js",
+ "/components/video/episodeprogressionhelper.js": "/tvdetails_merged.js",
+ "/framework/data/queries/libraryqueries.js": "/group_1_merged.js",
+ "/framework/data/queries/marketplacequeries.js": "/group_1_merged.js",
+ "/framework/data/augmenters/videoaugmenters.js": "/group_1_merged.js",
+ "/components/video/metacriticreview.js": "/tvdetails_merged.js",
+ "/components/video/videodetailsuistateservice.js": "/group_2_merged.js",
+ "/controls/starratingcontrol.js": "/group_2_merged.js",
+ "/controls/showmore.js": "/group_2_merged.js",
+ "/framework/data/queries/edsqueries.js": "/group_1_merged.js",
+ "/framework/data/augmenters/videohydrators.js": "/group_1_merged.js",
+ "/framework/data/queries/spotlightqueries.js": "/group_1_merged.js",
+ "/controls/pageditemscontrol.js": "/group_1_merged.js",
+ "/components/moreaction.js": "/group_2_merged.js",
+ "/framework/moduleselectionmanager.js": "/group_1_merged.js",
+ "/components/video/gracenoteservice.js": "/moviedetails_merged.js",
+ "/controls/carousel.js": "/group_1_merged.js",
+ "/viewmodels/viewstateviewmodel.js": "/group_1_merged.js",
+ "/viewmodels/modulebase.js": "/group_1_merged.js",
+ "/viewmodels/pageviewmodelbase.js": "/group_1_merged.js",
+ "/viewmodels/contentquerymodule.js": "/group_1_merged.js",
+ "/viewmodels/coremodulebase.js": "/group_1_merged.js",
+ "/viewmodels/video/castandcrewmodule.js": "/moviedetails_merged.js",
+ "/viewmodels/video_win/bundlesmodule.js": "/moviedetails_merged.js",
+ "/viewmodels/detailspageviewmodelbase.js": "/group_2_merged.js",
+ "/viewmodels/video_win/rottentomatoesmodule.js": "/moviedetails_merged.js",
+ "/viewmodels/video_win/videomodulefactory.js": "/group_1_merged.js",
+ "/viewmodels/video_win/videodetailsviewmodelbase.js": "/group_2_merged.js",
+ "/controls/pageviewbase.js": "/group_1_merged.js",
+ "/controls/viewstatecontrol.js": "/group_1_merged.js",
+ "/controls/video_win/languagepicker.js": "/group_2_merged.js",
+ "/viewmodels/video_win/videomarketplaceviewmodelbase.js": "/group_1_merged.js",
+ "/viewmodels/video_win/moviedetailsviewmodel.js": "/moviedetails_merged.js",
+ "/controls/video_win/moviedetails.js": "/moviedetails_merged.js",
+ "/viewmodels/video_win/videostorehubviewmodel.js": "/group_1_merged.js",
+ "/viewmodels/video_win/moviesstorehubviewmodel.js": "/moviesstore_merged.js",
+ "/components/video/tvdetailsmodel.js": "/group_1_merged.js",
+ "/controls/video_win/moviesstorehub.js": "/moviesstore_merged.js",
+ "/viewmodels/video_win/videoflexhubviewmodel.js": "/group_1_merged.js",
+ "/framework/data/listgrouper.js": "/group_1_merged.js",
+ "/controls/headercontrol.js": "/group_1_merged.js",
+ "/controls/galleryhost.js": "/group_1_merged.js",
+ "/controls/shrinkandstayheadercontrol.js": "/group_1_merged.js",
+ "/controls/shrinkandstaylistviewlayout.js": "/group_1_merged.js",
+ "/viewmodels/searchviewmodelbase.js": "/searchresultspage_merged.js",
+ "/viewmodels/searchgalleryviewmodelbase.js": "/searchresultspage_merged.js",
+ "/viewmodels/searchmodule.js": "/searchresultspage_merged.js",
+ "/viewmodels/video_win/videosearchviewmodelbase.js": "/searchresultspage_merged.js",
+ "/viewmodels/video_win/videosearchmodule.js": "/searchresultspage_merged.js",
+ "/viewmodels/video_win/videosearchgalleryviewmodelbase.js": "/searchresultspage_merged.js",
+ "/viewmodels/video_win/episodesmodule.js": "/tvdetails_merged.js",
+ "/viewmodels/video_win/seriesseasonsmodule.js": "/tvdetails_merged.js",
+ "/viewmodels/video_win/tvdetailsviewmodel.js": "/tvdetails_merged.js",
+ "/controls/video_win/tvdetails.js": "/tvdetails_merged.js",
+ "/viewmodels/video_win/tvstorehubviewmodel.js": "/tvstore_merged.js",
+ "/controls/video_win/tvstorehub.js": "/tvstore_merged.js",
+ "/controls/video_win/offlinenotification.js": "/group_1_merged.js",
+ "/controls/video_win/videocollection.js": "/videocollection_merged.js",
+ "/viewmodels/video_win/videocollectionviewmodel.js": "/videocollection_merged.js",
+ "/framework/managefoldersaction.js": "/videocollection_merged.js",
+ "/viewmodels/video_win/editorialvideomarketplaceviewmodel.js": "/videomarketplacepagetemplate_merged.js",
+ "/viewmodels/video_win/featuredsetsmarketplaceviewmodel.js": "/videomarketplacepagetemplate_merged.js",
+ "/viewmodels/video_win/topmoviesmarketplaceviewmodel.js": "/videomarketplacepagetemplate_merged.js",
+ "/viewmodels/video_win/toptvmarketplaceviewmodel.js": "/videomarketplacepagetemplate_merged.js",
+ }
+ });
+})();
+/* >>>>>>/winrttemplateproviderstubs.js:204 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function initMicrosoft_Zune_Common(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Common = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.CommonTemplate
+ };
+ var proto = ns.Common.prototype;
+ proto.is_ShipAssertEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.trace_ShipAssert = function(id, param, message, hResult, functionName, file, line) {
+ providerTemplates.traceTemplate_qqzdzzq(0, id, param, message, hResult, functionName, file, line)
+ };
+ proto.isBusinessIntelligenceScalarDataPointEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceBusinessIntelligenceScalarDataPoint = function(id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qjiqqtzq(1, id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterName, parameterValue)
+ };
+ proto.isBusinessIntelligenceStreamDataPointEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceBusinessIntelligenceStreamDataPoint = function(id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterCount) {
+ providerTemplates.traceTemplate_qjiqqtq(2, id, userId, timestamp, classId, typeId, allowedByPrivacySettings, parameterCount)
+ };
+ proto.isBusinessIntelligenceStreamIntParameterEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceBusinessIntelligenceStreamIntParameter = function(id, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qzq(3, id, parameterName, parameterValue)
+ };
+ proto.isBusinessIntelligenceStreamBooleanParameterEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceBusinessIntelligenceStreamBooleanParameter = function(id, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qzt(4, id, parameterName, parameterValue)
+ };
+ proto.isBusinessIntelligenceStreamStringParameterEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceBusinessIntelligenceStreamStringParameter = function(id, parameterName, parameterValue) {
+ providerTemplates.traceTemplate_qzz(5, id, parameterName, parameterValue)
+ };
+ proto.isClientLaunchEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceClientLaunch = function() {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isClientShutdownEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceClientShutdown = function(code) {
+ providerTemplates.traceTemplate_d(7, code)
+ };
+ proto.isEventSystemErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceEventSystemError = function(errorCode, provider, eventChannel, eventId, eventKeywords, eventLevel, eventOpcode, eventTask, eventVersion) {
+ providerTemplates.traceTemplate_qjqqxqqqq(8, errorCode, provider, eventChannel, eventId, eventKeywords, eventLevel, eventOpcode, eventTask, eventVersion)
+ };
+ proto.isZuneHostLaunchEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceZuneHostLaunch = function(isElevated, parameter) {
+ providerTemplates.traceTemplate_tz(9, isElevated, parameter)
+ };
+ proto.isZuneHostShutdownEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceZuneHostShutdown = function(code) {
+ providerTemplates.traceTemplate_d(10, code)
+ };
+ proto.isLogFileUploadedToWatsonEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceLogFileUploadedToWatson = function(filePath) {
+ providerTemplates.traceTemplate_z(11, filePath)
+ };
+ proto.isProcessInitializeEventStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceProcessInitializeEventStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isProcessInitializeEventStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceProcessInitializeEventStop = function(durationMsec) {
+ providerTemplates.traceTemplate_q(13, durationMsec)
+ };
+ proto.isProcessSuspendEventStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceProcessSuspendEventStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isProcessSuspendEventStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceProcessSuspendEventStop = function(durationMsec) {
+ providerTemplates.traceTemplate_q(15, durationMsec)
+ };
+ proto.isProcessResumeEventStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceProcessResumeEventStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(16)
+ };
+ proto.isProcessResumeEventStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceProcessResumeEventStop = function(durationMsec) {
+ providerTemplates.traceTemplate_q(17, durationMsec)
+ };
+ proto.isProcessSuspendEventSingletonStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceProcessSuspendEventSingletonStart = function(singletonEnumValue) {
+ providerTemplates.traceTemplate_q(18, singletonEnumValue)
+ };
+ proto.isProcessSuspendEventSingletonStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceProcessSuspendEventSingletonStop = function(singletonEnumValue) {
+ providerTemplates.traceTemplate_q(19, singletonEnumValue)
+ };
+ proto.isProcessResumeEventSingletonStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceProcessResumeEventSingletonStart = function(singletonEnumValue) {
+ providerTemplates.traceTemplate_q(20, singletonEnumValue)
+ };
+ proto.isProcessResumeEventSingletonStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceProcessResumeEventSingletonStop = function(singletonEnumValue) {
+ providerTemplates.traceTemplate_q(21, singletonEnumValue)
+ };
+ proto.isProcessSuspendTelemetryStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceProcessSuspendTelemetryStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isProcessSuspendTelemetryStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceProcessSuspendTelemetryStop = function() {
+ providerTemplates.traceTemplateEventDescriptor(23)
+ };
+ proto.isProcessResumeTelemetryStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceProcessResumeTelemetryStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(24)
+ };
+ proto.isProcessResumeTelemetryStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceProcessResumeTelemetryStop = function() {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isSingletonInitializationStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceSingletonInitializationStarted = function(singletonEnumValue) {
+ providerTemplates.traceTemplate_q(26, singletonEnumValue)
+ };
+ proto.isSingletonInitializationCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceSingletonInitializationCompleted = function(singletonEnumValue) {
+ providerTemplates.traceTemplate_q(27, singletonEnumValue)
+ };
+ proto.isFileTransferManagerInitializationStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceFileTransferManagerInitializationStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(28)
+ };
+ proto.isFileTransferManagerInitializationStopEnabled = function() {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceFileTransferManagerInitializationStop = function() {
+ providerTemplates.traceTemplateEventDescriptor(29)
+ };
+ proto.isFileTransferBackgroundTransferStartFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceFileTransferBackgroundTransferStartFailed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(30, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferAttachFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceFileTransferBackgroundTransferAttachFailed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(31, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceFileTransferBackgroundTransferCompleted = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(32, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceFileTransferBackgroundTransferError = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(33, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferBackgroundTransferCanceledEnabled = function() {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceFileTransferBackgroundTransferCanceled = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(34, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferMoveToLibraryFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceFileTransferMoveToLibraryFailed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(35, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferDownloadInfoFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceFileTransferDownloadInfoFailed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(36, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferQueuedEnabled = function() {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceFileTransferQueued = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(37, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceFileTransferFailed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(38, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferStart_SuccessedEnabled = function() {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceFileTransferStart_Successed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(39, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferStart_FailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceFileTransferStart_Failed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(40, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceFileTransferCompleted = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(41, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isFileTransferClosedEnabled = function() {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceFileTransferClosed = function(hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status) {
+ providerTemplates.traceTemplate_ddjxxdddjzzd(42, hResult, taskId, backgroundTransferId, bytes, totalBytes, fileId, libraryId, libraryTypeId, mediaId, isolatedStoragePath, targetPath, status)
+ };
+ proto.isClosedCaptionDownloadStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceClosedCaptionDownloadStarted = function(hResult, path, url, isXHR) {
+ providerTemplates.traceTemplate_dzzt(43, hResult, path, url, isXHR)
+ };
+ proto.isClosedCaptionDownloadFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceClosedCaptionDownloadFailed = function(hResult, path, url, isXHR) {
+ providerTemplates.traceTemplate_dzzt(44, hResult, path, url, isXHR)
+ };
+ proto.isClosedCaptionDownloadCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceClosedCaptionDownloadCompleted = function(hResult, path, url, isXHR) {
+ providerTemplates.traceTemplate_dzzt(45, hResult, path, url, isXHR)
+ };
+ proto.isAppVisibilityChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceAppVisibilityChanged = function(appVisible) {
+ providerTemplates.traceTemplate_t(46, appVisible)
+ }
+})(this);
+(function initMicrosoft_Zune_Library(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Library = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.LibraryTemplate
+ };
+ var proto = ns.Library.prototype;
+ proto.isEasyTransferIterationStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceEasyTransferIterationStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(0)
+ };
+ proto.isEasyTransferFoundConfigEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceEasyTransferFoundConfig = function() {
+ providerTemplates.traceTemplateEventDescriptor(1)
+ };
+ proto.isEasyTransferNoConfigEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceEasyTransferNoConfig = function() {
+ providerTemplates.traceTemplateEventDescriptor(2)
+ };
+ proto.isEasyTransferParsingConfigEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceEasyTransferParsingConfig = function() {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isEasyTransferConfigParseFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceEasyTransferConfigParseFailed = function() {
+ providerTemplates.traceTemplateEventDescriptor(4)
+ };
+ proto.isEasyTransferConfigParseSucceededEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceEasyTransferConfigParseSucceeded = function() {
+ providerTemplates.traceTemplateEventDescriptor(5)
+ };
+ proto.isEasyTransferAddingPathsEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceEasyTransferAddingPaths = function() {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isEasyTransferNoPathsToAddEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceEasyTransferNoPathsToAdd = function() {
+ providerTemplates.traceTemplateEventDescriptor(7)
+ };
+ proto.isEasyTransferBeginImportingMetadataEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceEasyTransferBeginImportingMetadata = function() {
+ providerTemplates.traceTemplateEventDescriptor(8)
+ };
+ proto.isEasyTransferCompletedImportingMetadataEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceEasyTransferCompletedImportingMetadata = function() {
+ providerTemplates.traceTemplateEventDescriptor(9)
+ };
+ proto.isEasyTransferBeginImportingPlaylistsEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceEasyTransferBeginImportingPlaylists = function() {
+ providerTemplates.traceTemplateEventDescriptor(10)
+ };
+ proto.isEasyTransferCompletedImportingPlaylistsEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceEasyTransferCompletedImportingPlaylists = function() {
+ providerTemplates.traceTemplateEventDescriptor(11)
+ };
+ proto.isEasyTransferIterationCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceEasyTransferIterationComplete = function() {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isEasyTransferCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceEasyTransferComplete = function() {
+ providerTemplates.traceTemplateEventDescriptor(13)
+ };
+ proto.isEasyTransferIterationFailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceEasyTransferIterationFailed = function() {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isEasyTransferParseErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceEasyTransferParseError = function(line, column, message) {
+ providerTemplates.traceTemplate_qqz(15, line, column, message)
+ };
+ proto.isEasyTransferImportedMetadataEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceEasyTransferImportedMetadata = function(mediaId, rating, playCount) {
+ providerTemplates.traceTemplate_qqq(16, mediaId, rating, playCount)
+ };
+ proto.isEasyTransferImportedPlaylistEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceEasyTransferImportedPlaylist = function(name, trackCount, imported) {
+ providerTemplates.traceTemplate_zqt(17, name, trackCount, imported)
+ };
+ proto.isEasyTransferLocatingMediaItemEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceEasyTransferLocatingMediaItem = function(location) {
+ providerTemplates.traceTemplate_z(18, location)
+ };
+ proto.isEasyTransferLocatedMediaItemEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceEasyTransferLocatedMediaItem = function(mediaId, created) {
+ providerTemplates.traceTemplate_qt(19, mediaId, created)
+ };
+ proto.isEasyTransferStateChangeEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceEasyTransferStateChange = function(oldState, newState) {
+ providerTemplates.traceTemplate_qq(20, oldState, newState)
+ };
+ proto.isEasyTransferFailedToLocateMediaItemEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceEasyTransferFailedToLocateMediaItem = function(hResult) {
+ providerTemplates.traceTemplate_d(21, hResult)
+ };
+ proto.isEasyTransferMatchedByFileUrlEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceEasyTransferMatchedByFileUrl = function() {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isGrovelerScanStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceGrovelerScanStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(23)
+ };
+ proto.isGrovelerScanCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceGrovelerScanCompleted = function(fileCount) {
+ providerTemplates.traceTemplate_q(24, fileCount)
+ };
+ proto.isGrovelerQuickScanStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceGrovelerQuickScanStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isGrovelerQuickScanCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceGrovelerQuickScanCompleted = function(receivedFileCount, modifiedFileCount) {
+ providerTemplates.traceTemplate_qq(26, receivedFileCount, modifiedFileCount)
+ };
+ proto.isGrovelerDeleteScanStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceGrovelerDeleteScanStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isGrovelerDeleteScanCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceGrovelerDeleteScanCompleted = function(fileCount) {
+ providerTemplates.traceTemplate_q(28, fileCount)
+ };
+ proto.isGrovelerPlaylistScanStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceGrovelerPlaylistScanStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(29)
+ };
+ proto.isGrovelerPlaylistScanCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceGrovelerPlaylistScanCompleted = function(fileCount) {
+ providerTemplates.traceTemplate_q(30, fileCount)
+ };
+ proto.isGrovelerAdditionScanStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceGrovelerAdditionScanStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isGrovelerAdditionScanCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceGrovelerAdditionScanCompleted = function(fileCount) {
+ providerTemplates.traceTemplate_q(32, fileCount)
+ };
+ proto.isGrovelerFullScanSkippedEnabled = function() {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceGrovelerFullScanSkipped = function() {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isGrovelerTopLevelFolderAddedEnabled = function() {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceGrovelerTopLevelFolderAdded = function() {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ };
+ proto.isGrovelerNotificationReceivedEnabled = function() {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceGrovelerNotificationReceived = function() {
+ providerTemplates.traceTemplateEventDescriptor(35)
+ };
+ proto.isGrovelerNetworkConnectedEnabled = function() {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceGrovelerNetworkConnected = function() {
+ providerTemplates.traceTemplateEventDescriptor(36)
+ };
+ proto.isGrovelerNetworkShareAccessedEnabled = function() {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceGrovelerNetworkShareAccessed = function() {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isGrovelerMasterRatingFileDirtySetEnabled = function() {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceGrovelerMasterRatingFileDirtySet = function() {
+ providerTemplates.traceTemplateEventDescriptor(38)
+ };
+ proto.isGrovelerWriteMasterRatingFileTriggeredEnabled = function() {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceGrovelerWriteMasterRatingFileTriggered = function() {
+ providerTemplates.traceTemplateEventDescriptor(39)
+ };
+ proto.isGrovelerWriteMasterRatingFileStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceGrovelerWriteMasterRatingFileStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(40)
+ };
+ proto.isGrovelerWriteMasterRatingFileCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceGrovelerWriteMasterRatingFileCompleted = function(hResult, ratingCount) {
+ providerTemplates.traceTemplate_dq(41, hResult, ratingCount)
+ };
+ proto.isGrovelerReadMasterRatingFileTriggeredEnabled = function() {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceGrovelerReadMasterRatingFileTriggered = function() {
+ providerTemplates.traceTemplateEventDescriptor(42)
+ };
+ proto.isGrovelerReadMasterRatingFileStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceGrovelerReadMasterRatingFileStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isGrovelerReadMasterRatingFileCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceGrovelerReadMasterRatingFileCompleted = function(hResult, ratingCount) {
+ providerTemplates.traceTemplate_dq(44, hResult, ratingCount)
+ };
+ proto.isGrovelerQueryIndexerDiffEnabled = function() {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceGrovelerQueryIndexerDiff = function(timestamp) {
+ providerTemplates.traceTemplate_z(45, timestamp)
+ };
+ proto.isGrovelerIsQuickGrovelNeededEnabled = function() {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceGrovelerIsQuickGrovelNeeded = function(currentCount, changedCount, quickScanNeeded) {
+ providerTemplates.traceTemplate_qqt(46, currentCount, changedCount, quickScanNeeded)
+ };
+ proto.isGrovelerGetFilesAsyncRetryEnabled = function() {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceGrovelerGetFilesAsyncRetry = function(hResult, retryCount) {
+ providerTemplates.traceTemplate_dq(47, hResult, retryCount)
+ };
+ proto.isGrovelerWaitForCompletionRetryEnabled = function() {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceGrovelerWaitForCompletionRetry = function(hResult, retryCount) {
+ providerTemplates.traceTemplate_dq(48, hResult, retryCount)
+ };
+ proto.isGrovelerGetResultsErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceGrovelerGetResultsError = function(hResult) {
+ providerTemplates.traceTemplate_d(49, hResult)
+ };
+ proto.isGrovelerGetEmptyItemListEnabled = function() {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceGrovelerGetEmptyItemList = function(hResult) {
+ providerTemplates.traceTemplate_d(50, hResult)
+ };
+ proto.isGrovelerRefreshLicenseStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceGrovelerRefreshLicenseStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(51)
+ };
+ proto.isGrovelerRefreshLicenseCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceGrovelerRefreshLicenseCompleted = function(hResult) {
+ providerTemplates.traceTemplate_d(52, hResult)
+ };
+ proto.isGrovelerDefinitionChangedNotificationReceivedEnabled = function() {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceGrovelerDefinitionChangedNotificationReceived = function() {
+ providerTemplates.traceTemplateEventDescriptor(53)
+ };
+ proto.isGrovelerRetriesExhaustedEnabled = function() {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceGrovelerRetriesExhausted = function(hResult, fileCount) {
+ providerTemplates.traceTemplate_dq(54, hResult, fileCount)
+ };
+ proto.isGrovelerAddFileEnabled = function() {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceGrovelerAddFile = function(hResult, fileUrl) {
+ providerTemplates.traceTemplate_dz(55, hResult, fileUrl)
+ };
+ proto.isGrovelerSetFileAvailableEnabled = function() {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceGrovelerSetFileAvailable = function(fileUrl) {
+ providerTemplates.traceTemplate_z(56, fileUrl)
+ };
+ proto.isGrovelerSetFileUnavailableEnabled = function() {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.traceGrovelerSetFileUnavailable = function(fileUrl) {
+ providerTemplates.traceTemplate_z(57, fileUrl)
+ };
+ proto.isGrovelerSecondScanStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.traceGrovelerSecondScanStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(58)
+ };
+ proto.isGrovelerSecondScanCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.traceGrovelerSecondScanCompleted = function(fileCount, unindexedFileCount, unknownFileCount) {
+ providerTemplates.traceTemplate_qqq(59, fileCount, unindexedFileCount, unknownFileCount)
+ };
+ proto.isMDLCStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.traceMDLCStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(60)
+ };
+ proto.isMDLCCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.traceMDLCCompleted = function() {
+ providerTemplates.traceTemplateEventDescriptor(61)
+ };
+ proto.isDatabaseOpenStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceDatabaseOpenStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(62)
+ };
+ proto.isDatabaseOpenCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceDatabaseOpenCompleted = function() {
+ providerTemplates.traceTemplateEventDescriptor(63)
+ };
+ proto.isDatabaseCloseStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceDatabaseCloseStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(64)
+ };
+ proto.isDatabaseCloseCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceDatabaseCloseCompleted = function() {
+ providerTemplates.traceTemplateEventDescriptor(65)
+ };
+ proto.isDbCleanupOnUserSignedOutStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.traceDbCleanupOnUserSignedOutStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(66)
+ };
+ proto.isDbCleanupOnUserSignedOutCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.traceDbCleanupOnUserSignedOutCompleted = function() {
+ providerTemplates.traceTemplateEventDescriptor(67)
+ };
+ proto.isQueryStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.traceQueryStarted = function(queryObjectInstanceId, queryType, actionName) {
+ providerTemplates.traceTemplate_dzz(68, queryObjectInstanceId, queryType, actionName)
+ };
+ proto.isQueryCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(69)
+ };
+ proto.traceQueryCompleted = function(queryObjectInstanceId, queryType, actionName) {
+ providerTemplates.traceTemplate_dzz(69, queryObjectInstanceId, queryType, actionName)
+ };
+ proto.isPlaylistIOStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(70)
+ };
+ proto.tracePlaylistIOStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(70)
+ };
+ proto.isPlaylistIOCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(71)
+ };
+ proto.tracePlaylistIOCompleted = function(readFileCount) {
+ providerTemplates.traceTemplate_q(71, readFileCount)
+ };
+ proto.isBackgroundWorkLock_RequestedEnabled = function() {
+ return !!providerTemplates.eventEnabled(72)
+ };
+ proto.traceBackgroundWorkLock_Requested = function(requestor) {
+ providerTemplates.traceTemplate_z(72, requestor)
+ };
+ proto.isBackgroundWorkLock_AcquiredEnabled = function() {
+ return !!providerTemplates.eventEnabled(73)
+ };
+ proto.traceBackgroundWorkLock_Acquired = function(requestor) {
+ providerTemplates.traceTemplate_z(73, requestor)
+ };
+ proto.isBackgroundWorkLock_ReleasedEnabled = function() {
+ return !!providerTemplates.eventEnabled(74)
+ };
+ proto.traceBackgroundWorkLock_Released = function(requestor) {
+ providerTemplates.traceTemplate_z(74, requestor)
+ };
+ proto.isCollectionBuildingBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(75)
+ };
+ proto.traceCollectionBuildingBegin = function(eventSource) {
+ providerTemplates.traceTemplate_q(75, eventSource)
+ };
+ proto.isCollectionBuildingEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(76)
+ };
+ proto.traceCollectionBuildingEnd = function(eventSource, itemsAdded, itemsTotal, errorState) {
+ providerTemplates.traceTemplate_qqqq(76, eventSource, itemsAdded, itemsTotal, errorState)
+ };
+ proto.isCollectionBuildingProgressEnabled = function() {
+ return !!providerTemplates.eventEnabled(77)
+ };
+ proto.traceCollectionBuildingProgress = function(itemsProcessed) {
+ providerTemplates.traceTemplate_q(77, itemsProcessed)
+ };
+ proto.isCollectionBuildingMediaSyncedEnabled = function() {
+ return !!providerTemplates.eventEnabled(78)
+ };
+ proto.traceCollectionBuildingMediaSynced = function() {
+ providerTemplates.traceTemplateEventDescriptor(78)
+ };
+ proto.isCollectionBuildingMissingMetadataEnabled = function() {
+ return !!providerTemplates.eventEnabled(79)
+ };
+ proto.traceCollectionBuildingMissingMetadata = function() {
+ providerTemplates.traceTemplateEventDescriptor(79)
+ };
+ proto.isCollectionBuildingMDLCProgressEnabled = function() {
+ return !!providerTemplates.eventEnabled(80)
+ };
+ proto.traceCollectionBuildingMDLCProgress = function(itemsProcessed) {
+ providerTemplates.traceTemplate_q(80, itemsProcessed)
+ };
+ proto.isCollectionBuildingCloudCollectionV2FirstTrackAddedEnabled = function() {
+ return !!providerTemplates.eventEnabled(81)
+ };
+ proto.traceCollectionBuildingCloudCollectionV2FirstTrackAdded = function() {
+ providerTemplates.traceTemplateEventDescriptor(81)
+ };
+ proto.isFingerprintingStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(82)
+ };
+ proto.traceFingerprintingStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(82)
+ };
+ proto.isFingerprintingCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(83)
+ };
+ proto.traceFingerprintingComplete = function(hResult, canceled, processedFileCount, remainingFileCount, failedFileCount) {
+ providerTemplates.traceTemplate_dtqqq(83, hResult, canceled, processedFileCount, remainingFileCount, failedFileCount)
+ };
+ proto.isProcessRemainingFilesStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(84)
+ };
+ proto.traceProcessRemainingFilesStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(84)
+ };
+ proto.isProcessRemainingFilesCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(85)
+ };
+ proto.traceProcessRemainingFilesComplete = function(hResult) {
+ providerTemplates.traceTemplate_d(85, hResult)
+ };
+ proto.isFileProcessedEnabled = function() {
+ return !!providerTemplates.eventEnabled(86)
+ };
+ proto.traceFileProcessed = function(fileId, foreground, allowGracenoteId, hResult) {
+ providerTemplates.traceTemplate_qttd(86, fileId, foreground, allowGracenoteId, hResult)
+ };
+ proto.isFingerprintIdFoundEnabled = function() {
+ return !!providerTemplates.eventEnabled(87)
+ };
+ proto.traceFingerprintIdFound = function(fileId, fileUrl) {
+ providerTemplates.traceTemplate_qz(87, fileId, fileUrl)
+ };
+ proto.isFingerprintComputedEnabled = function() {
+ return !!providerTemplates.eventEnabled(88)
+ };
+ proto.traceFingerprintComputed = function(fileId, fileUrl) {
+ providerTemplates.traceTemplate_qz(88, fileId, fileUrl)
+ };
+ proto.isFingerprintGeneration_InternalErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(89)
+ };
+ proto.traceFingerprintGeneration_InternalError = function(fileUrl, error) {
+ providerTemplates.traceTemplate_zd(89, fileUrl, error)
+ };
+ proto.isFingerprintGeneration_EndOfStreamReachedEnabled = function() {
+ return !!providerTemplates.eventEnabled(90)
+ };
+ proto.traceFingerprintGeneration_EndOfStreamReached = function(fileUrl) {
+ providerTemplates.traceTemplate_z(90, fileUrl)
+ };
+ proto.isFingerprintGeneration_SourceReaderErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(91)
+ };
+ proto.traceFingerprintGeneration_SourceReaderError = function(fileUrl, flags) {
+ providerTemplates.traceTemplate_zq(91, fileUrl, flags)
+ };
+ proto.isFingerprintGeneration_FingerprintRetrievedEnabled = function() {
+ return !!providerTemplates.eventEnabled(92)
+ };
+ proto.traceFingerprintGeneration_FingerprintRetrieved = function(fileUrl, qualities) {
+ providerTemplates.traceTemplate_zq(92, fileUrl, qualities)
+ };
+ proto.isGetImmediateFingerprintsStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(93)
+ };
+ proto.traceGetImmediateFingerprintsStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(93)
+ };
+ proto.isGetImmediateFingerprintsCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(94)
+ };
+ proto.traceGetImmediateFingerprintsComplete = function(processedFileCount) {
+ providerTemplates.traceTemplate_q(94, processedFileCount)
+ };
+ proto.isImmediateFingerprintRetrievedEnabled = function() {
+ return !!providerTemplates.eventEnabled(95)
+ };
+ proto.traceImmediateFingerprintRetrieved = function(fileId, hResult, resultType) {
+ providerTemplates.traceTemplate_qdd(95, fileId, hResult, resultType)
+ }
+})(this);
+(function initMicrosoft_Zune_Pipeline(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Pipeline = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.PipelineTemplate
+ };
+ var proto = ns.Pipeline.prototype;
+ proto.isMBR_Pause_EnterEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceMBR_Pause_Enter = function(currentStreamTimeHns) {
+ providerTemplates.traceTemplate_x(0, currentStreamTimeHns)
+ };
+ proto.isMBR_Pause_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceMBR_Pause_Exit = function(currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(1, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_Run_EnterEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceMBR_Run_Enter = function(startTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_xx(2, startTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_Run_LockEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceMBR_Run_Lock = function(currentStreamTimeHns) {
+ providerTemplates.traceTemplate_x(3, currentStreamTimeHns)
+ };
+ proto.isMBR_Run_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceMBR_Run_Exit = function(currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(4, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_Seek_EnterEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceMBR_Seek_Enter = function(possitionHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_ix(5, possitionHns, currentStreamTimeHns)
+ };
+ proto.isMBR_Seek_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceMBR_Seek_Exit = function(currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(6, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_Stop_EnterEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceMBR_Stop_Enter = function(currentStreamTimeHns) {
+ providerTemplates.traceTemplate_x(7, currentStreamTimeHns)
+ };
+ proto.isMBR_Stop_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceMBR_Stop_Exit = function(currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_xd(8, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_SourceState_ChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceMBR_SourceState_Changed = function(filterState, oldState, newState) {
+ providerTemplates.traceTemplate_ddd(9, filterState, oldState, newState)
+ };
+ proto.isMBR_PinPumpState_ChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceMBR_PinPumpState_Changed = function(streamType, oldState, newState) {
+ providerTemplates.traceTemplate_qdd(10, streamType, oldState, newState)
+ };
+ proto.isMBR_EOSEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceMBR_EOS = function(streamType, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qx(11, streamType, currentStreamTimeHns)
+ };
+ proto.isMBR_Preroll_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceMBR_Preroll_Exit = function(streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns) {
+ providerTemplates.traceTemplate_dxxx(12, streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns)
+ };
+ proto.isMBR_Preroll_Forced_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceMBR_Preroll_Forced_Exit = function(streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns) {
+ providerTemplates.traceTemplate_dxxx(13, streamType, initialAudioTimeHns, initialVideoTimeHns, newStartBaseTimeHns)
+ };
+ proto.isMBR_PinBeginFlush_EnterEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceMBR_PinBeginFlush_Enter = function(streamType, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qx(14, streamType, currentStreamTimeHns)
+ };
+ proto.isMBR_PinBeginFlush_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceMBR_PinBeginFlush_Exit = function(streamType, currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_qxd(15, streamType, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_PinEndFlush_EnterEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceMBR_PinEndFlush_Enter = function(streamType, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qx(16, streamType, currentStreamTimeHns)
+ };
+ proto.isMBR_PinEndFlush_ExitEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceMBR_PinEndFlush_Exit = function(streamType, currentStreamTimeHns, hResult) {
+ providerTemplates.traceTemplate_qxd(17, streamType, currentStreamTimeHns, hResult)
+ };
+ proto.isMBR_GotNewSampleEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceMBR_GotNewSample = function(streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(18, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_SamplePushedToPinPumpEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceMBR_SamplePushedToPinPump = function(streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(19, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_SamplePushedDownStream_BeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceMBR_SamplePushedDownStream_Begin = function(streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(20, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_SamplePushedDownStream_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceMBR_SamplePushedDownStream_End = function(streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(21, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_BufferStatusEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceMBR_BufferStatus = function(currentStreamTimeHns, bufferSizeMs) {
+ providerTemplates.traceTemplate_xx(22, currentStreamTimeHns, bufferSizeMs)
+ };
+ proto.isMBR_DropFrameEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceMBR_DropFrame = function(totalFramesDropped, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(23, totalFramesDropped, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_PinDecompress_BeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceMBR_PinDecompress_Begin = function(streamType, sampleTimeHns, currentStreamTimeHns) {
+ providerTemplates.traceTemplate_qxx(24, streamType, sampleTimeHns, currentStreamTimeHns)
+ };
+ proto.isMBR_PinDecompress_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceMBR_PinDecompress_End = function(streamType, frameSizeInBytes, durationHns) {
+ providerTemplates.traceTemplate_qqx(25, streamType, frameSizeInBytes, durationHns)
+ };
+ proto.isMBR_PinDecompress_CallEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceMBR_PinDecompress_Call = function(streamType) {
+ providerTemplates.traceTemplate_q(26, streamType)
+ };
+ proto.isMBR_PinDecompress_ReturnEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceMBR_PinDecompress_Return = function(streamType) {
+ providerTemplates.traceTemplate_q(27, streamType)
+ };
+ proto.isMBR_Transcrypt_BeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceMBR_Transcrypt_Begin = function(streamType) {
+ providerTemplates.traceTemplate_q(28, streamType)
+ };
+ proto.isMBR_Transcrypt_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceMBR_Transcrypt_End = function(streamType) {
+ providerTemplates.traceTemplate_q(29, streamType)
+ };
+ proto.isMBR_DMO_ProcessInput_ReturnEnabled = function() {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceMBR_DMO_ProcessInput_Return = function(streamType, sampleTimeHns, hResult) {
+ providerTemplates.traceTemplate_qxd(30, streamType, sampleTimeHns, hResult)
+ };
+ proto.isMBR_DMO_ProcessOutput_ReturnEnabled = function() {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceMBR_DMO_ProcessOutput_Return = function(streamType, hResult, durationHns) {
+ providerTemplates.traceTemplate_qdx(31, streamType, hResult, durationHns)
+ };
+ proto.isMBR_NextChunkEnabled = function() {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceMBR_NextChunk = function(streamType, chunkIndex, bitrateBps, sampleTimeHns, durationHns, sizeInBytes, quality, targetQuality, totalBandwidthBps, targetBandwidthBps, bufferSizeMs) {
+ providerTemplates.traceTemplate_qdqxxqqqqqq(32, streamType, chunkIndex, bitrateBps, sampleTimeHns, durationHns, sizeInBytes, quality, targetQuality, totalBandwidthBps, targetBandwidthBps, bufferSizeMs)
+ };
+ proto.isMBR_ManifestStreamEnabled = function() {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceMBR_ManifestStream = function(streamType, iD, bitrate, width, height, channels) {
+ providerTemplates.traceTemplate_qqqqqq(33, streamType, iD, bitrate, width, height, channels)
+ };
+ proto.isTranscoding_JobTypeEnabled = function() {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceTranscoding_JobType = function(jobType) {
+ providerTemplates.traceTemplate_d(34, jobType)
+ };
+ proto.isTranscoding_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceTranscoding_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(35)
+ };
+ proto.isTranscoding_CompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceTranscoding_Complete = function(hResult) {
+ providerTemplates.traceTemplate_d(36, hResult)
+ };
+ proto.isTranscoding_MF_DShow_FallbackEnabled = function() {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceTranscoding_MF_DShow_Fallback = function() {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isTranscoding_MF_HW_SW_FallbackEnabled = function() {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceTranscoding_MF_HW_SW_Fallback = function() {
+ providerTemplates.traceTemplateEventDescriptor(38)
+ };
+ proto.isTranscoding_MF_HW_StatusEnabled = function() {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceTranscoding_MF_HW_Status = function(hW_Status) {
+ providerTemplates.traceTemplate_t(39, hW_Status)
+ };
+ proto.isTranscoding_Crash_StatusEnabled = function() {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceTranscoding_Crash_Status = function(crashCount, maxCrashCount, hW_Status, isConfirmed, hResult) {
+ providerTemplates.traceTemplate_qqttd(40, crashCount, maxCrashCount, hW_Status, isConfirmed, hResult)
+ };
+ proto.isTranscoding_Disable_HW_AccelerationEnabled = function() {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceTranscoding_Disable_HW_Acceleration = function() {
+ providerTemplates.traceTemplateEventDescriptor(41)
+ };
+ proto.isTranscoding_Reenable_HW_AccelerationEnabled = function() {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceTranscoding_Reenable_HW_Acceleration = function() {
+ providerTemplates.traceTemplateEventDescriptor(42)
+ };
+ proto.isTranscoding_SW_Retranscode_After_CrashEnabled = function() {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceTranscoding_SW_Retranscode_After_Crash = function() {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isPresenter_DownresEnabled = function() {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.tracePresenter_Downres = function(width, height) {
+ providerTemplates.traceTemplate_qq(44, width, height)
+ };
+ proto.isPresenter_Native_Video_SizeEnabled = function() {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.tracePresenter_Native_Video_Size = function(width, height) {
+ providerTemplates.traceTemplate_qq(45, width, height)
+ };
+ proto.isPresenter_Target_Video_SizeEnabled = function() {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.tracePresenter_Target_Video_Size = function(width, height) {
+ providerTemplates.traceTemplate_qq(46, width, height)
+ };
+ proto.isPresenter_Display_Video_SizeEnabled = function() {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.tracePresenter_Display_Video_Size = function(width, height) {
+ providerTemplates.traceTemplate_qq(47, width, height)
+ };
+ proto.isPresenter_FrameTimesEnabled = function() {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.tracePresenter_FrameTimes = function(frameNumber, timestampStream, timestampQPC, systime100ns, streamtime100ns, freqQPC) {
+ providerTemplates.traceTemplate_xxxxxx(48, frameNumber, timestampStream, timestampQPC, systime100ns, streamtime100ns, freqQPC)
+ };
+ proto.isPresenter_FrameDroppedEnabled = function() {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.tracePresenter_FrameDropped = function(framesDropped) {
+ providerTemplates.traceTemplate_q(49, framesDropped)
+ };
+ proto.isPresenter_OperationEnabled = function() {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.tracePresenter_Operation = function(op, lastPTS, splashOwnedFrameCount, stepCount, state, connectedState) {
+ providerTemplates.traceTemplate_zxqqdd(50, op, lastPTS, splashOwnedFrameCount, stepCount, state, connectedState)
+ };
+ proto.isLEQ_EnabledEnabled = function() {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceLEQ_Enabled = function(enabled) {
+ providerTemplates.traceTemplate_t(51, enabled)
+ };
+ proto.isLEQ_SetFormatEnabled = function() {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceLEQ_SetFormat = function(format, channels, samplesPerChannel, action, hResult) {
+ providerTemplates.traceTemplate_qqqqd(52, format, channels, samplesPerChannel, action, hResult)
+ };
+ proto.isLEQ_Process_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceLEQ_Process_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(53)
+ };
+ proto.isLEQ_Process_CompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceLEQ_Process_Complete = function(passthrough, hResult) {
+ providerTemplates.traceTemplate_td(54, passthrough, hResult)
+ };
+ proto.isPlaybackInterop_PlayerStateChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.tracePlaybackInterop_PlayerStateChanged = function(state) {
+ providerTemplates.traceTemplate_q(55, state)
+ };
+ proto.isPlaybackInterop_PositionChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.tracePlaybackInterop_PositionChanged = function(position, minSeekPosition, maxSeekPosition, endOfMedia, canSeek) {
+ providerTemplates.traceTemplate_xxxtt(56, position, minSeekPosition, maxSeekPosition, endOfMedia, canSeek)
+ };
+ proto.isPlaybackInterop_TransportStateChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.tracePlaybackInterop_TransportStateChanged = function(state) {
+ providerTemplates.traceTemplate_q(57, state)
+ };
+ proto.isPlaybackInterop_TrickPlayStateChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.tracePlaybackInterop_TrickPlayStateChanged = function(state) {
+ providerTemplates.traceTemplate_q(58, state)
+ };
+ proto.isPlayback_MCPlayerAdapter_CreateInstanceEnabled = function() {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.tracePlayback_MCPlayerAdapter_CreateInstance = function(hResult) {
+ providerTemplates.traceTemplate_d(59, hResult)
+ };
+ proto.isPlayback_MFPlayer_CreateInstanceEnabled = function() {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.tracePlayback_MFPlayer_CreateInstance = function(hResult) {
+ providerTemplates.traceTemplate_d(60, hResult)
+ };
+ proto.isPlayback_ControlInitializedEnabled = function() {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.tracePlayback_ControlInitialized = function() {
+ providerTemplates.traceTemplateEventDescriptor(61)
+ };
+ proto.isPlayback_SessionInitializedEnabled = function() {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.tracePlayback_SessionInitialized = function() {
+ providerTemplates.traceTemplateEventDescriptor(62)
+ };
+ proto.isPlayback_PlayerStateChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.tracePlayback_PlayerStateChanged = function(newState, oldState) {
+ providerTemplates.traceTemplate_zz(63, newState, oldState)
+ };
+ proto.isPlayback_TransportStateChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.tracePlayback_TransportStateChanged = function(newState, oldState) {
+ providerTemplates.traceTemplate_zz(64, newState, oldState)
+ };
+ proto.isPlayback_SetMediaEnabled = function() {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.tracePlayback_SetMedia = function(source, mediaType, protectionState, startPosition, cookie, durationMsec) {
+ providerTemplates.traceTemplate_zzzqqq(65, source, mediaType, protectionState, startPosition, cookie, durationMsec)
+ };
+ proto.isPlayback_SetNextMediaEnabled = function() {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.tracePlayback_SetNextMedia = function(readyForNext, source, mediaType, protectionState, startPosition, cookie) {
+ providerTemplates.traceTemplate_tzzzqq(66, readyForNext, source, mediaType, protectionState, startPosition, cookie)
+ };
+ proto.isPlayback_CurrentMediaLoadedEnabled = function() {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.tracePlayback_CurrentMediaLoaded = function(source, mediaType, protectionState, startPosition, cookie, durationMsec) {
+ providerTemplates.traceTemplate_zzzqqq(67, source, mediaType, protectionState, startPosition, cookie, durationMsec)
+ };
+ proto.isPlayback_NextMediaLoadedEnabled = function() {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.tracePlayback_NextMediaLoaded = function(source, mediaType, protectionState, startPosition, cookie, durationMsec) {
+ providerTemplates.traceTemplate_zzzqqq(68, source, mediaType, protectionState, startPosition, cookie, durationMsec)
+ };
+ proto.isPlayback_SwitchingToNextMediaEnabled = function() {
+ return !!providerTemplates.eventEnabled(69)
+ };
+ proto.tracePlayback_SwitchingToNextMedia = function(source) {
+ providerTemplates.traceTemplate_z(69, source)
+ };
+ proto.isPlayback_NextMediaStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(70)
+ };
+ proto.tracePlayback_NextMediaStarted = function(source) {
+ providerTemplates.traceTemplate_z(70, source)
+ };
+ proto.isPlayback_ErrorOccurredEnabled = function() {
+ return !!providerTemplates.eventEnabled(71)
+ };
+ proto.tracePlayback_ErrorOccurred = function(errorCode, extendedCode, context) {
+ providerTemplates.traceTemplate_qqz(71, errorCode, extendedCode, context)
+ };
+ proto.isPlayback_EnableTimeUpdateEnabled = function() {
+ return !!providerTemplates.eventEnabled(72)
+ };
+ proto.tracePlayback_EnableTimeUpdate = function(currentPositionMsec) {
+ providerTemplates.traceTemplate_q(72, currentPositionMsec)
+ };
+ proto.isPlayback_DisableTimeUpdateEnabled = function() {
+ return !!providerTemplates.eventEnabled(73)
+ };
+ proto.tracePlayback_DisableTimeUpdate = function(currentPositionMsec) {
+ providerTemplates.traceTemplate_q(73, currentPositionMsec)
+ };
+ proto.isPlayback_ForceTimeUpdateEnabled = function() {
+ return !!providerTemplates.eventEnabled(74)
+ };
+ proto.tracePlayback_ForceTimeUpdate = function(currentPositionMsec) {
+ providerTemplates.traceTemplate_q(74, currentPositionMsec)
+ };
+ proto.isPlayback_PBMSoundLevelChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(75)
+ };
+ proto.tracePlayback_PBMSoundLevelChanged = function(soundLevel, currentTransportState) {
+ providerTemplates.traceTemplate_zz(75, soundLevel, currentTransportState)
+ };
+ proto.isPlayback_TargetTransportStateSetEnabled = function() {
+ return !!providerTemplates.eventEnabled(76)
+ };
+ proto.tracePlayback_TargetTransportStateSet = function(wannaBe, current) {
+ providerTemplates.traceTemplate_zz(76, wannaBe, current)
+ };
+ proto.isPlaylist_SetDataSourceBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(77)
+ };
+ proto.tracePlaylist_SetDataSourceBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(77)
+ };
+ proto.isPlaylist_SetDataSourceEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(78)
+ };
+ proto.tracePlaylist_SetDataSourceEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(78)
+ };
+ proto.isPlaylist_InterpretingDataEnabled = function() {
+ return !!providerTemplates.eventEnabled(79)
+ };
+ proto.tracePlaylist_InterpretingData = function() {
+ providerTemplates.traceTemplateEventDescriptor(79)
+ };
+ proto.isPlaylist_ActivateEnabled = function() {
+ return !!providerTemplates.eventEnabled(80)
+ };
+ proto.tracePlaylist_Activate = function(index, startPosition, shuffle, repeat) {
+ providerTemplates.traceTemplate_qqtt(80, index, startPosition, shuffle, repeat)
+ };
+ proto.isPlaylist_SetMediaEnabled = function() {
+ return !!providerTemplates.eventEnabled(81)
+ };
+ proto.tracePlaylist_SetMedia = function(source, mediaType, protectionState, startPosition, cookie) {
+ providerTemplates.traceTemplate_zzzqq(81, source, mediaType, protectionState, startPosition, cookie)
+ };
+ proto.isPlaylist_SetNextMediaEnabled = function() {
+ return !!providerTemplates.eventEnabled(82)
+ };
+ proto.tracePlaylist_SetNextMedia = function(source, mediaType, protectionState, startPosition, cookie) {
+ providerTemplates.traceTemplate_zzzqq(82, source, mediaType, protectionState, startPosition, cookie)
+ };
+ proto.isPlaylist_CreatedEnabled = function() {
+ return !!providerTemplates.eventEnabled(83)
+ };
+ proto.tracePlaylist_Created = function() {
+ providerTemplates.traceTemplateEventDescriptor(83)
+ };
+ proto.isPlaylog_BookmarkLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(84)
+ };
+ proto.tracePlaylog_BookmarkLoad = function(positionMS, playFromBookmark) {
+ providerTemplates.traceTemplate_qt(84, positionMS, playFromBookmark)
+ };
+ proto.isPlaylog_BookmarkSaveEnabled = function() {
+ return !!providerTemplates.eventEnabled(85)
+ };
+ proto.tracePlaylog_BookmarkSave = function(positionMS) {
+ providerTemplates.traceTemplate_q(85, positionMS)
+ };
+ proto.isPlaylog_PlayCountLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(86)
+ };
+ proto.tracePlaylog_PlayCountLoad = function(playCount) {
+ providerTemplates.traceTemplate_q(86, playCount)
+ };
+ proto.isPlaylog_PlayCountSaveEnabled = function() {
+ return !!providerTemplates.eventEnabled(87)
+ };
+ proto.tracePlaylog_PlayCountSave = function(playCount) {
+ providerTemplates.traceTemplate_q(87, playCount)
+ };
+ proto.isPlaylog_PlayedLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(88)
+ };
+ proto.tracePlaylog_PlayedLoad = function(played) {
+ providerTemplates.traceTemplate_t(88, played)
+ };
+ proto.isPlaylog_PlayedSaveEnabled = function() {
+ return !!providerTemplates.eventEnabled(89)
+ };
+ proto.tracePlaylog_PlayedSave = function(played) {
+ providerTemplates.traceTemplate_t(89, played)
+ };
+ proto.isDRM_RootLicenseRefresh_AccountEnabled = function() {
+ return !!providerTemplates.eventEnabled(90)
+ };
+ proto.traceDRM_RootLicenseRefresh_Account = function(subscription, tunerActivated) {
+ providerTemplates.traceTemplate_tt(90, subscription, tunerActivated)
+ };
+ proto.isDRM_RootLicenseRefresh_DetailsEnabled = function() {
+ return !!providerTemplates.eventEnabled(91)
+ };
+ proto.traceDRM_RootLicenseRefresh_Details = function(now, lastRefresh, spanMs) {
+ providerTemplates.traceTemplate_zzx(91, now, lastRefresh, spanMs)
+ };
+ proto.isDRM_RootLicenseRefresh_InvokedEnabled = function() {
+ return !!providerTemplates.eventEnabled(92)
+ };
+ proto.traceDRM_RootLicenseRefresh_Invoked = function() {
+ providerTemplates.traceTemplateEventDescriptor(92)
+ };
+ proto.isDRM_RootLicenseRefresh_CompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(93)
+ };
+ proto.traceDRM_RootLicenseRefresh_Completed = function(status) {
+ providerTemplates.traceTemplate_z(93, status)
+ };
+ proto.isDRM_ReportMetering_AccountEnabled = function() {
+ return !!providerTemplates.eventEnabled(94)
+ };
+ proto.traceDRM_ReportMetering_Account = function(subscription, tunerActivated, meteringCertificate) {
+ providerTemplates.traceTemplate_ttz(94, subscription, tunerActivated, meteringCertificate)
+ };
+ proto.isDRM_ReportMetering_InvokedEnabled = function() {
+ return !!providerTemplates.eventEnabled(95)
+ };
+ proto.traceDRM_ReportMetering_Invoked = function() {
+ providerTemplates.traceTemplateEventDescriptor(95)
+ };
+ proto.isDRM_ReportMetering_CompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(96)
+ };
+ proto.traceDRM_ReportMetering_Completed = function(status) {
+ providerTemplates.traceTemplate_z(96, status)
+ };
+ proto.isDRM_ReportMetering_NoDataToReportEnabled = function() {
+ return !!providerTemplates.eventEnabled(97)
+ };
+ proto.traceDRM_ReportMetering_NoDataToReport = function() {
+ providerTemplates.traceTemplateEventDescriptor(97)
+ };
+ proto.isDRM_DeleteLicense_InvokedEnabled = function() {
+ return !!providerTemplates.eventEnabled(98)
+ };
+ proto.traceDRM_DeleteLicense_Invoked = function(kid) {
+ providerTemplates.traceTemplate_z(98, kid)
+ };
+ proto.isDRM_DeleteLicense_CompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(99)
+ };
+ proto.traceDRM_DeleteLicense_Completed = function(kid, hResult) {
+ providerTemplates.traceTemplate_zd(99, kid, hResult)
+ };
+ proto.isClosedCaptions_RendererGetTTMLFilepathEnabled = function() {
+ return !!providerTemplates.eventEnabled(100)
+ };
+ proto.traceClosedCaptions_RendererGetTTMLFilepath = function(state, smid, miid, lcid, filepath) {
+ providerTemplates.traceTemplate_zzzqz(100, state, smid, miid, lcid, filepath)
+ };
+ proto.isClosedCaptions_RendererLoadTTMLFileEnabled = function() {
+ return !!providerTemplates.eventEnabled(101)
+ };
+ proto.traceClosedCaptions_RendererLoadTTMLFile = function(state, filepath) {
+ providerTemplates.traceTemplate_zz(101, state, filepath)
+ };
+ proto.isClosedCaptions_EnterRenderingLoopEnabled = function() {
+ return !!providerTemplates.eventEnabled(102)
+ };
+ proto.traceClosedCaptions_EnterRenderingLoop = function(currentPosition, transportState) {
+ providerTemplates.traceTemplate_qz(102, currentPosition, transportState)
+ };
+ proto.isClosedCaptions_ExitRenderingLoopEnabled = function() {
+ return !!providerTemplates.eventEnabled(103)
+ };
+ proto.traceClosedCaptions_ExitRenderingLoop = function(currentPosition, transportState, closedCaptionsOn) {
+ providerTemplates.traceTemplate_qzt(103, currentPosition, transportState, closedCaptionsOn)
+ };
+ proto.isClosedCaptions_OnEnabled = function() {
+ return !!providerTemplates.eventEnabled(104)
+ };
+ proto.traceClosedCaptions_On = function(enabled) {
+ providerTemplates.traceTemplate_t(104, enabled)
+ };
+ proto.isClosedCaptions_DroppedFrameEnabled = function() {
+ return !!providerTemplates.eventEnabled(105)
+ };
+ proto.traceClosedCaptions_DroppedFrame = function(generatedAt, validUntil, currentPosition) {
+ providerTemplates.traceTemplate_qqq(105, generatedAt, validUntil, currentPosition)
+ };
+ proto.isFastStartMediaSource_CreatedEnabled = function() {
+ return !!providerTemplates.eventEnabled(106)
+ };
+ proto.traceFastStartMediaSource_Created = function() {
+ providerTemplates.traceTemplateEventDescriptor(106)
+ };
+ proto.isFastStartMediaSource_ReceivedUrlEnabled = function() {
+ return !!providerTemplates.eventEnabled(107)
+ };
+ proto.traceFastStartMediaSource_ReceivedUrl = function(info) {
+ providerTemplates.traceTemplate_z(107, info)
+ };
+ proto.isFastStartMediaSource_PlaybackStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(108)
+ };
+ proto.traceFastStartMediaSource_PlaybackStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(108)
+ };
+ proto.isPlayback_WPPEnabled = function() {
+ return !!providerTemplates.eventEnabled(109)
+ };
+ proto.tracePlayback_WPP = function(info) {
+ providerTemplates.traceTemplate_z(109, info)
+ }
+})(this);
+(function initMicrosoft_Zune_Service(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.ServiceEventProvider = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProviderTemplate
+ };
+ var proto = ns.ServiceEventProvider.prototype;
+ proto.isServiceSignInErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceServiceSignInError = function(hResult) {
+ providerTemplates.traceTemplate_d(0, hResult)
+ };
+ proto.isServiceGetTicketStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceServiceGetTicketStarted = function(message) {
+ providerTemplates.traceTemplate_z(1, message)
+ };
+ proto.isServiceGetTicketCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceServiceGetTicketCompleted = function(message) {
+ providerTemplates.traceTemplate_z(2, message)
+ };
+ proto.isServiceGetTicketErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceServiceGetTicketError = function(hResult) {
+ providerTemplates.traceTemplate_d(3, hResult)
+ };
+ proto.isServiceSignOutStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceServiceSignOutStarted = function(message) {
+ providerTemplates.traceTemplate_z(4, message)
+ };
+ proto.isServiceSignOutCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceServiceSignOutCompleted = function(message) {
+ providerTemplates.traceTemplate_z(5, message)
+ };
+ proto.isServiceZestSignInStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceServiceZestSignInStarted = function(message) {
+ providerTemplates.traceTemplate_z(6, message)
+ };
+ proto.isServiceZestSignInCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceServiceZestSignInCompleted = function(message) {
+ providerTemplates.traceTemplate_z(7, message)
+ };
+ proto.isServiceRefreshSignInStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceServiceRefreshSignInStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(8)
+ };
+ proto.isServiceRefreshSignInCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceServiceRefreshSignInCompleted = function() {
+ providerTemplates.traceTemplateEventDescriptor(9)
+ };
+ proto.isServiceAuthHeaderEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceServiceAuthHeader = function(message) {
+ providerTemplates.traceTemplate_z(10, message)
+ };
+ proto.isServiceUserProfilePropertyEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceServiceUserProfileProperty = function(name, value) {
+ providerTemplates.traceTemplate_zz(11, name, value)
+ };
+ proto.isServiceUserProfileStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceServiceUserProfileStarted = function(message) {
+ providerTemplates.traceTemplate_z(12, message)
+ };
+ proto.isServiceUserProfileCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceServiceUserProfileCompleted = function(message) {
+ providerTemplates.traceTemplate_z(13, message)
+ };
+ proto.isFamilyUserPropertyEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceFamilyUserProperty = function(name, value) {
+ providerTemplates.traceTemplate_zz(14, name, value)
+ };
+ proto.isServiceFamilyUserStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceServiceFamilyUserStarted = function(message) {
+ providerTemplates.traceTemplate_z(15, message)
+ };
+ proto.isServiceFamilyUserCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceServiceFamilyUserCompleted = function(message) {
+ providerTemplates.traceTemplate_z(16, message)
+ };
+ proto.isSubscriptionInfoPropertyEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceSubscriptionInfoProperty = function(name, value) {
+ providerTemplates.traceTemplate_zz(17, name, value)
+ };
+ proto.isServiceSubscriptionInfoStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceServiceSubscriptionInfoStarted = function(message) {
+ providerTemplates.traceTemplate_z(18, message)
+ };
+ proto.isServiceSubscriptionInfoCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceServiceSubscriptionInfoCompleted = function(message) {
+ providerTemplates.traceTemplate_z(19, message)
+ };
+ proto.isServiceUserChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceServiceUserChanged = function(message) {
+ providerTemplates.traceTemplate_z(20, message)
+ };
+ proto.isServiceForgetUserInformationStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceServiceForgetUserInformationStarted = function(message) {
+ providerTemplates.traceTemplate_z(21, message)
+ };
+ proto.isServiceForgetUserInformationCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceServiceForgetUserInformationCompleted = function(message) {
+ providerTemplates.traceTemplate_z(22, message)
+ };
+ proto.isServiceSignInStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceServiceSignInStarted = function(message) {
+ providerTemplates.traceTemplate_z(23, message)
+ };
+ proto.isServiceSignInCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceServiceSignInCompleted = function(message) {
+ providerTemplates.traceTemplate_z(24, message)
+ };
+ proto.isServiceAuthHeaderErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceServiceAuthHeaderError = function(hResult) {
+ providerTemplates.traceTemplate_d(25, hResult)
+ };
+ proto.isPurchaseHistoryGrovelStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.tracePurchaseHistoryGrovelStarted = function() {
+ providerTemplates.traceTemplateEventDescriptor(26)
+ };
+ proto.isPurchaseHistoryGrovelCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.tracePurchaseHistoryGrovelCompleted = function(hResult) {
+ providerTemplates.traceTemplate_d(27, hResult)
+ };
+ proto.isPurchaseHistoryGrovelErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.tracePurchaseHistoryGrovelError = function(hResult) {
+ providerTemplates.traceTemplate_d(28, hResult)
+ }
+})(this);
+(function initMicrosoft_Zune_Shell(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Shell = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.ShellTemplate
+ };
+ var proto = ns.Shell.prototype;
+ proto.isNavigable_Loading_DoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceNavigable_Loading_Done = function(moniker) {
+ providerTemplates.traceTemplate_z(0, moniker)
+ };
+ proto.isQueries_BeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceQueries_Begin = function(moniker) {
+ providerTemplates.traceTemplate_z(1, moniker)
+ };
+ proto.isQueries_CompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceQueries_Complete = function(moniker) {
+ providerTemplates.traceTemplate_z(2, moniker)
+ };
+ proto.isJavascript_Load_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceJavascript_Load_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isSplashScreen_RemovedEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceSplashScreen_Removed = function() {
+ providerTemplates.traceTemplateEventDescriptor(4)
+ };
+ proto.isJavascript_Load_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceJavascript_Load_End = function() {
+ providerTemplates.traceTemplateEventDescriptor(5)
+ };
+ proto.isDom_Content_LoadedEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceDom_Content_Loaded = function() {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isFinish_ProcessAllEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceFinish_ProcessAll = function() {
+ providerTemplates.traceTemplateEventDescriptor(7)
+ };
+ proto.isNavigation_StartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceNavigation_Started = function(moniker) {
+ providerTemplates.traceTemplate_z(8, moniker)
+ };
+ proto.isLocation_ChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceLocation_Changed = function(pageMoniker, hubMoniker, panelMoniker) {
+ providerTemplates.traceTemplate_zzz(9, pageMoniker, hubMoniker, panelMoniker)
+ };
+ proto.isOverlay_ShownEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceOverlay_Shown = function(templateId) {
+ providerTemplates.traceTemplate_z(10, templateId)
+ };
+ proto.isOverlay_DismissedEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceOverlay_Dismissed = function(templateId) {
+ providerTemplates.traceTemplate_z(11, templateId)
+ };
+ proto.isAction_InvokedEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceAction_Invoked = function(actionId) {
+ providerTemplates.traceTemplate_z(12, actionId)
+ };
+ proto.isDeepLink_Protocol_InvokedEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceDeepLink_Protocol_Invoked = function(url) {
+ providerTemplates.traceTemplate_z(13, url)
+ };
+ proto.isDeepLink_Protocol_FailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceDeepLink_Protocol_Failed = function(url) {
+ providerTemplates.traceTemplate_z(14, url)
+ };
+ proto.isDeepLink_Tile_InvokedEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceDeepLink_Tile_Invoked = function(arguments) {
+ providerTemplates.traceTemplate_z(15, arguments)
+ };
+ proto.isDeepLink_Tile_FailedEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceDeepLink_Tile_Failed = function(arguments) {
+ providerTemplates.traceTemplate_z(16, arguments)
+ };
+ proto.isSearch_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceSearch_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(17)
+ };
+ proto.isSearch_CompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceSearch_Completed = function() {
+ providerTemplates.traceTemplateEventDescriptor(18)
+ };
+ proto.isWebExperience_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceWebExperience_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(19, templateId)
+ };
+ proto.isWebExperience_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceWebExperience_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(20, templateId)
+ };
+ proto.isWebExperience_CancelEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceWebExperience_Cancel = function(templateId) {
+ providerTemplates.traceTemplate_z(21, templateId)
+ };
+ proto.isWebExperience_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceWebExperience_Error = function(templateId) {
+ providerTemplates.traceTemplate_z(22, templateId)
+ };
+ proto.isWebExperience_PageLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceWebExperience_PageLoad = function(templateId) {
+ providerTemplates.traceTemplate_z(23, templateId)
+ };
+ proto.isTest_Event_ResultEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceTest_Event_Result = function(result, message) {
+ providerTemplates.traceTemplate_tz(24, result, message)
+ };
+ proto.isTest_Event_TraceEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceTest_Event_Trace = function(id, message) {
+ providerTemplates.traceTemplate_dz(25, id, message)
+ };
+ proto.isTest_Event_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceTest_Event_Error = function(id, message) {
+ providerTemplates.traceTemplate_dz(26, id, message)
+ };
+ proto.isHubStrip_Load_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceHubStrip_Load_Start = function(moniker) {
+ providerTemplates.traceTemplate_z(27, moniker)
+ };
+ proto.isHubStrip_Load_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceHubStrip_Load_End = function(moniker) {
+ providerTemplates.traceTemplate_z(28, moniker)
+ };
+ proto.isHub_Load_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceHub_Load_Start = function(moniker) {
+ providerTemplates.traceTemplate_z(29, moniker)
+ };
+ proto.isHub_Load_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceHub_Load_End = function(moniker) {
+ providerTemplates.traceTemplate_z(30, moniker)
+ };
+ proto.isPanel_Load_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.tracePanel_Load_Start = function(moniker) {
+ providerTemplates.traceTemplate_z(31, moniker)
+ };
+ proto.isPanel_Load_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.tracePanel_Load_End = function(moniker) {
+ providerTemplates.traceTemplate_z(32, moniker)
+ };
+ proto.isHubStrip_ReadyEnabled = function() {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceHubStrip_Ready = function(moniker) {
+ providerTemplates.traceTemplate_z(33, moniker)
+ };
+ proto.isHub_ReadyEnabled = function() {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceHub_Ready = function(moniker) {
+ providerTemplates.traceTemplate_z(34, moniker)
+ };
+ proto.isPanel_ReadyEnabled = function() {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.tracePanel_Ready = function(moniker) {
+ providerTemplates.traceTemplate_z(35, moniker)
+ };
+ proto.isHubStrip_MoveToCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceHubStrip_MoveToComplete = function(moniker) {
+ providerTemplates.traceTemplate_z(36, moniker)
+ };
+ proto.isCreateAccount_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceCreateAccount_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(37, templateId)
+ };
+ proto.isCreateAccount_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceCreateAccount_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(38, templateId)
+ };
+ proto.isCreateAccount_CancelEnabled = function() {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceCreateAccount_Cancel = function(templateId) {
+ providerTemplates.traceTemplate_z(39, templateId)
+ };
+ proto.isCreateAccount_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceCreateAccount_Error = function(templateId) {
+ providerTemplates.traceTemplate_z(40, templateId)
+ };
+ proto.isAcceptTermsOfService_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceAcceptTermsOfService_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(41, templateId)
+ };
+ proto.isAcceptTermsOfService_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceAcceptTermsOfService_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(42, templateId)
+ };
+ proto.isAcceptTermsOfService_CancelEnabled = function() {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceAcceptTermsOfService_Cancel = function(templateId) {
+ providerTemplates.traceTemplate_z(43, templateId)
+ };
+ proto.isSignInResultEnabled = function() {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceSignInResult = function(templateId) {
+ providerTemplates.traceTemplate_z(44, templateId)
+ };
+ proto.isSettingsHome_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceSettingsHome_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(45, templateId)
+ };
+ proto.isSettingsHome_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceSettingsHome_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(46, templateId)
+ };
+ proto.isSettingsAccount_LaunchEnabled = function() {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceSettingsAccount_Launch = function(templateId) {
+ providerTemplates.traceTemplate_z(47, templateId)
+ };
+ proto.isSettingsAccount_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceSettingsAccount_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(48, templateId)
+ };
+ proto.isSettingsAccount_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceSettingsAccount_Error = function(templateId) {
+ providerTemplates.traceTemplate_z(49, templateId)
+ };
+ proto.isSettingsPreferences_LaunchEnabled = function() {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceSettingsPreferences_Launch = function(templateId) {
+ providerTemplates.traceTemplate_z(50, templateId)
+ };
+ proto.isSettingsAbout_LaunchEnabled = function() {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceSettingsAbout_Launch = function(templateId) {
+ providerTemplates.traceTemplate_z(51, templateId)
+ };
+ proto.isSettingsFeedback_LaunchEnabled = function() {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceSettingsFeedback_Launch = function(templateId) {
+ providerTemplates.traceTemplate_z(52, templateId)
+ };
+ proto.isSettingsCaptions_LaunchEnabled = function() {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceSettingsCaptions_Launch = function(templateId) {
+ providerTemplates.traceTemplate_z(53, templateId)
+ };
+ proto.isSettingsPopulate_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceSettingsPopulate_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(54, templateId)
+ };
+ proto.isSettingsWinJSPopulate_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceSettingsWinJSPopulate_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(55, templateId)
+ };
+ proto.isSettingsPopulate_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceSettingsPopulate_End = function(templateId) {
+ providerTemplates.traceTemplate_z(56, templateId)
+ };
+ proto.isPurchaseFlowGames_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.tracePurchaseFlowGames_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(57, templateId)
+ };
+ proto.isPurchaseFlowGames_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.tracePurchaseFlowGames_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(58, templateId)
+ };
+ proto.isPurchaseFlowGames_CancelEnabled = function() {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.tracePurchaseFlowGames_Cancel = function(templateId) {
+ providerTemplates.traceTemplate_z(59, templateId)
+ };
+ proto.isPurchaseFlowGames_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.tracePurchaseFlowGames_Error = function(templateId) {
+ providerTemplates.traceTemplate_z(60, templateId)
+ };
+ proto.isPurchaseFlowGames_RejectionEnabled = function() {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.tracePurchaseFlowGames_Rejection = function(templateId) {
+ providerTemplates.traceTemplate_z(61, templateId)
+ };
+ proto.isMarketplaceBrowse_PageLoadStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceMarketplaceBrowse_PageLoadStart = function(templateId) {
+ providerTemplates.traceTemplate_z(62, templateId)
+ };
+ proto.isServiceQuery_QueryStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceServiceQuery_QueryStart = function(templateId) {
+ providerTemplates.traceTemplate_z(63, templateId)
+ };
+ proto.isServiceQuery_QueryReturnEnabled = function() {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceServiceQuery_QueryReturn = function(templateId) {
+ providerTemplates.traceTemplate_z(64, templateId)
+ };
+ proto.isServiceQuery_ParseCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceServiceQuery_ParseComplete = function(templateId) {
+ providerTemplates.traceTemplate_z(65, templateId)
+ };
+ proto.isSettingsAccount_LaunchCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.traceSettingsAccount_LaunchComplete = function(templateId) {
+ providerTemplates.traceTemplate_z(66, templateId)
+ };
+ proto.isSettingsPreferences_LaunchCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.traceSettingsPreferences_LaunchComplete = function(templateId) {
+ providerTemplates.traceTemplate_z(67, templateId)
+ };
+ proto.isSettingsAbout_LaunchCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.traceSettingsAbout_LaunchComplete = function(templateId) {
+ providerTemplates.traceTemplate_z(68, templateId)
+ };
+ proto.isSettings_BackToHomeEnabled = function() {
+ return !!providerTemplates.eventEnabled(69)
+ };
+ proto.traceSettings_BackToHome = function(templateId) {
+ providerTemplates.traceTemplate_z(69, templateId)
+ };
+ proto.isSettingsFeedback_LaunchCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(70)
+ };
+ proto.traceSettingsFeedback_LaunchComplete = function(templateId) {
+ providerTemplates.traceTemplate_z(70, templateId)
+ };
+ proto.isSettingsCaptions_LaunchCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(71)
+ };
+ proto.traceSettingsCaptions_LaunchComplete = function(templateId) {
+ providerTemplates.traceTemplate_z(71, templateId)
+ };
+ proto.isHomeHub_Load_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(72)
+ };
+ proto.traceHomeHub_Load_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(72)
+ };
+ proto.isHomeHub_Load_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(73)
+ };
+ proto.traceHomeHub_Load_End = function() {
+ providerTemplates.traceTemplateEventDescriptor(73)
+ };
+ proto.isHomeHub_ReadyEnabled = function() {
+ return !!providerTemplates.eventEnabled(74)
+ };
+ proto.traceHomeHub_Ready = function() {
+ providerTemplates.traceTemplateEventDescriptor(74)
+ };
+ proto.isPurchaseFlowMusic_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(75)
+ };
+ proto.tracePurchaseFlowMusic_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(75, templateId)
+ };
+ proto.isPurchaseFlowMusic_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(76)
+ };
+ proto.tracePurchaseFlowMusic_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(76, templateId)
+ };
+ proto.isPurchaseFlowMusic_CancelEnabled = function() {
+ return !!providerTemplates.eventEnabled(77)
+ };
+ proto.tracePurchaseFlowMusic_Cancel = function(templateId) {
+ providerTemplates.traceTemplate_z(77, templateId)
+ };
+ proto.isPurchaseFlowMusic_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(78)
+ };
+ proto.tracePurchaseFlowMusic_Error = function(templateId) {
+ providerTemplates.traceTemplate_z(78, templateId)
+ };
+ proto.isPurchaseFlowMusic_RejectionEnabled = function() {
+ return !!providerTemplates.eventEnabled(79)
+ };
+ proto.tracePurchaseFlowMusic_Rejection = function(templateId) {
+ providerTemplates.traceTemplate_z(79, templateId)
+ };
+ proto.isPurchaseFlowVideo_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(80)
+ };
+ proto.tracePurchaseFlowVideo_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(80, templateId)
+ };
+ proto.isPurchaseFlowVideo_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(81)
+ };
+ proto.tracePurchaseFlowVideo_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(81, templateId)
+ };
+ proto.isPurchaseFlowVideo_CancelEnabled = function() {
+ return !!providerTemplates.eventEnabled(82)
+ };
+ proto.tracePurchaseFlowVideo_Cancel = function(templateId) {
+ providerTemplates.traceTemplate_z(82, templateId)
+ };
+ proto.isPurchaseFlowVideo_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(83)
+ };
+ proto.tracePurchaseFlowVideo_Error = function(templateId) {
+ providerTemplates.traceTemplate_z(83, templateId)
+ };
+ proto.isPurchaseFlowVideo_Start_Bandwidth_TestEnabled = function() {
+ return !!providerTemplates.eventEnabled(84)
+ };
+ proto.tracePurchaseFlowVideo_Start_Bandwidth_Test = function(templateId) {
+ providerTemplates.traceTemplate_z(84, templateId)
+ };
+ proto.isPurchaseFlowVideo_DownloadEnabled = function() {
+ return !!providerTemplates.eventEnabled(85)
+ };
+ proto.tracePurchaseFlowVideo_Download = function(templateId) {
+ providerTemplates.traceTemplate_z(85, templateId)
+ };
+ proto.isPurchaseFlowVideo_StreamEnabled = function() {
+ return !!providerTemplates.eventEnabled(86)
+ };
+ proto.tracePurchaseFlowVideo_Stream = function(templateId) {
+ providerTemplates.traceTemplate_z(86, templateId)
+ };
+ proto.isPurchaseFlowVideo_DoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(87)
+ };
+ proto.tracePurchaseFlowVideo_Done = function(templateId) {
+ providerTemplates.traceTemplate_z(87, templateId)
+ };
+ proto.isPurchaseFlowVideo_RejectionEnabled = function() {
+ return !!providerTemplates.eventEnabled(88)
+ };
+ proto.tracePurchaseFlowVideo_Rejection = function(templateId) {
+ providerTemplates.traceTemplate_z(88, templateId)
+ };
+ proto.isGalleryControl_Load_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(89)
+ };
+ proto.traceGalleryControl_Load_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(89)
+ };
+ proto.isGalleryControl_Load_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(90)
+ };
+ proto.traceGalleryControl_Load_End = function() {
+ providerTemplates.traceTemplateEventDescriptor(90)
+ };
+ proto.isGalleryControl_InLine_Open_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(91)
+ };
+ proto.traceGalleryControl_InLine_Open_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(91)
+ };
+ proto.isGalleryControl_InLine_Open_EndEnabled = function() {
+ return !!providerTemplates.eventEnabled(92)
+ };
+ proto.traceGalleryControl_InLine_Open_End = function() {
+ providerTemplates.traceTemplateEventDescriptor(92)
+ };
+ proto.isGalleryControl_InLine_Open_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(93)
+ };
+ proto.traceGalleryControl_InLine_Open_Error = function() {
+ providerTemplates.traceTemplateEventDescriptor(93)
+ };
+ proto.isGalleryControl_InLine_CloseEnabled = function() {
+ return !!providerTemplates.eventEnabled(94)
+ };
+ proto.traceGalleryControl_InLine_Close = function() {
+ providerTemplates.traceTemplateEventDescriptor(94)
+ };
+ proto.isGalleryControl_LoadingState_ChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(95)
+ };
+ proto.traceGalleryControl_LoadingState_Changed = function(newState) {
+ providerTemplates.traceTemplate_z(95, newState)
+ };
+ proto.isModifierControl_SelectionChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(96)
+ };
+ proto.traceModifierControl_SelectionChanged = function(value, source) {
+ providerTemplates.traceTemplate_zz(96, value, source)
+ };
+ proto.isModifierControl_PopupOpenedEnabled = function() {
+ return !!providerTemplates.eventEnabled(97)
+ };
+ proto.traceModifierControl_PopupOpened = function(templateId) {
+ providerTemplates.traceTemplate_z(97, templateId)
+ };
+ proto.isModifierControl_PopupClosedEnabled = function() {
+ return !!providerTemplates.eventEnabled(98)
+ };
+ proto.traceModifierControl_PopupClosed = function(templateId) {
+ providerTemplates.traceTemplate_z(98, templateId)
+ };
+ proto.isActionListControl_ItemAddedEnabled = function() {
+ return !!providerTemplates.eventEnabled(99)
+ };
+ proto.traceActionListControl_ItemAdded = function(templateId) {
+ providerTemplates.traceTemplate_z(99, templateId)
+ };
+ proto.isActionListControl_ItemRemovedEnabled = function() {
+ return !!providerTemplates.eventEnabled(100)
+ };
+ proto.traceActionListControl_ItemRemoved = function(templateId) {
+ providerTemplates.traceTemplate_z(100, templateId)
+ };
+ proto.isActionListControl_ItemsChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(101)
+ };
+ proto.traceActionListControl_ItemsChanged = function(templateId) {
+ providerTemplates.traceTemplate_z(101, templateId)
+ };
+ proto.isControlFramework_ControlConstructedEnabled = function() {
+ return !!providerTemplates.eventEnabled(102)
+ };
+ proto.traceControlFramework_ControlConstructed = function(templateId) {
+ providerTemplates.traceTemplate_z(102, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationQueuedEnabled = function() {
+ return !!providerTemplates.eventEnabled(103)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationQueued = function(templateId) {
+ providerTemplates.traceTemplate_z(103, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationRequeuedEnabled = function() {
+ return !!providerTemplates.eventEnabled(104)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationRequeued = function(templateId) {
+ providerTemplates.traceTemplate_z(104, templateId)
+ };
+ proto.isControlFramework_ControlInitializationStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(105)
+ };
+ proto.traceControlFramework_ControlInitializationStarted = function(templateId) {
+ providerTemplates.traceTemplate_z(105, templateId)
+ };
+ proto.isControlFramework_UserInitializationStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(106)
+ };
+ proto.traceControlFramework_UserInitializationStarted = function(templateId) {
+ providerTemplates.traceTemplate_z(106, templateId)
+ };
+ proto.isControlFramework_ControlTemplateLoadStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(107)
+ };
+ proto.traceControlFramework_ControlTemplateLoadStarted = function(templateId) {
+ providerTemplates.traceTemplate_z(107, templateId)
+ };
+ proto.isControlFramework_ControlTemplateLoadCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(108)
+ };
+ proto.traceControlFramework_ControlTemplateLoadCompleted = function(templateId) {
+ providerTemplates.traceTemplate_z(108, templateId)
+ };
+ proto.isControlFramework_TemplateLoadStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(109)
+ };
+ proto.traceControlFramework_TemplateLoadStarted = function(templateId) {
+ providerTemplates.traceTemplate_z(109, templateId)
+ };
+ proto.isControlFramework_TemplateLoadFragmentStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(110)
+ };
+ proto.traceControlFramework_TemplateLoadFragmentStarted = function(templateId) {
+ providerTemplates.traceTemplate_z(110, templateId)
+ };
+ proto.isControlFramework_TemplateLoadFragmentCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(111)
+ };
+ proto.traceControlFramework_TemplateLoadFragmentCompleted = function(templateId) {
+ providerTemplates.traceTemplate_z(111, templateId)
+ };
+ proto.isControlFramework_TemplateLoadTemplateExtractedEnabled = function() {
+ return !!providerTemplates.eventEnabled(112)
+ };
+ proto.traceControlFramework_TemplateLoadTemplateExtracted = function(templateId) {
+ providerTemplates.traceTemplate_z(112, templateId)
+ };
+ proto.isControlFramework_TemplateLoadCompletedFromCacheEnabled = function() {
+ return !!providerTemplates.eventEnabled(113)
+ };
+ proto.traceControlFramework_TemplateLoadCompletedFromCache = function(templateId) {
+ providerTemplates.traceTemplate_z(113, templateId)
+ };
+ proto.isControlFramework_TemplateLoadCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(114)
+ };
+ proto.traceControlFramework_TemplateLoadCompleted = function(templateId) {
+ providerTemplates.traceTemplate_z(114, templateId)
+ };
+ proto.isControlFramework_ControlInitializationCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(115)
+ };
+ proto.traceControlFramework_ControlInitializationCompleted = function(templateId) {
+ providerTemplates.traceTemplate_z(115, templateId)
+ };
+ proto.isControlFramework_UserInitializationCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(116)
+ };
+ proto.traceControlFramework_UserInitializationCompleted = function(templateId) {
+ providerTemplates.traceTemplate_z(116, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationQueuedForRootEnabled = function() {
+ return !!providerTemplates.eventEnabled(117)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationQueuedForRoot = function(templateId) {
+ providerTemplates.traceTemplate_z(117, templateId)
+ };
+ proto.isControlFramework_ControlCompleteInitializationDequeuedForRootEnabled = function() {
+ return !!providerTemplates.eventEnabled(118)
+ };
+ proto.traceControlFramework_ControlCompleteInitializationDequeuedForRoot = function(templateId) {
+ providerTemplates.traceTemplate_z(118, templateId)
+ };
+ proto.isSubscriptionSignup_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(119)
+ };
+ proto.traceSubscriptionSignup_Start = function(templateId) {
+ providerTemplates.traceTemplate_z(119, templateId)
+ };
+ proto.isSubscriptionSignup_FinishEnabled = function() {
+ return !!providerTemplates.eventEnabled(120)
+ };
+ proto.traceSubscriptionSignup_Finish = function(templateId) {
+ providerTemplates.traceTemplate_z(120, templateId)
+ };
+ proto.isSubscriptionSignup_CancelEnabled = function() {
+ return !!providerTemplates.eventEnabled(121)
+ };
+ proto.traceSubscriptionSignup_Cancel = function(templateId) {
+ providerTemplates.traceTemplate_z(121, templateId)
+ };
+ proto.isSubscriptionSignup_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(122)
+ };
+ proto.traceSubscriptionSignup_Error = function(templateId) {
+ providerTemplates.traceTemplate_z(122, templateId)
+ };
+ proto.isNotification_NotificationArrivedEnabled = function() {
+ return !!providerTemplates.eventEnabled(123)
+ };
+ proto.traceNotification_NotificationArrived = function(templateId) {
+ providerTemplates.traceTemplate_z(123, templateId)
+ };
+ proto.isNotification_PageSelectedEnabled = function() {
+ return !!providerTemplates.eventEnabled(124)
+ };
+ proto.traceNotification_PageSelected = function(templateId) {
+ providerTemplates.traceTemplate_z(124, templateId)
+ };
+ proto.isNotification_NotificationClickedEnabled = function() {
+ return !!providerTemplates.eventEnabled(125)
+ };
+ proto.traceNotification_NotificationClicked = function(templateId) {
+ providerTemplates.traceTemplate_z(125, templateId)
+ };
+ proto.isAd_Companion_ShownEnabled = function() {
+ return !!providerTemplates.eventEnabled(126)
+ };
+ proto.traceAd_Companion_Shown = function(linkUrl, imageUrl) {
+ providerTemplates.traceTemplate_zz(126, linkUrl, imageUrl)
+ };
+ proto.isAd_Companion_HiddenEnabled = function() {
+ return !!providerTemplates.eventEnabled(127)
+ };
+ proto.traceAd_Companion_Hidden = function(linkUrl, imageUrl) {
+ providerTemplates.traceTemplate_zz(127, linkUrl, imageUrl)
+ };
+ proto.isVideo_Ad_StartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(128)
+ };
+ proto.traceVideo_Ad_Started = function(videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(128, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_CompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(129)
+ };
+ proto.traceVideo_Ad_Completed = function(videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(129, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_SkippedEnabled = function() {
+ return !!providerTemplates.eventEnabled(130)
+ };
+ proto.traceVideo_Ad_Skipped = function(videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(130, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(131)
+ };
+ proto.traceVideo_Ad_Error = function(videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(131, videoUrl, clickUrl)
+ };
+ proto.isVideo_Ad_UpSellEnabled = function() {
+ return !!providerTemplates.eventEnabled(132)
+ };
+ proto.traceVideo_Ad_UpSell = function(videoUrl, clickUrl) {
+ providerTemplates.traceTemplate_zz(132, videoUrl, clickUrl)
+ };
+ proto.isAdControl_RefreshedEnabled = function() {
+ return !!providerTemplates.eventEnabled(133)
+ };
+ proto.traceAdControl_Refreshed = function(applicationId, unitId) {
+ providerTemplates.traceTemplate_zz(133, applicationId, unitId)
+ };
+ proto.isAdService_InitializedEnabled = function() {
+ return !!providerTemplates.eventEnabled(134)
+ };
+ proto.traceAdService_Initialized = function() {
+ providerTemplates.traceTemplateEventDescriptor(134)
+ };
+ proto.isAdService_UnloadedEnabled = function() {
+ return !!providerTemplates.eventEnabled(135)
+ };
+ proto.traceAdService_Unloaded = function() {
+ providerTemplates.traceTemplateEventDescriptor(135)
+ };
+ proto.isAdService_AudioAdRefreshingEnabled = function() {
+ return !!providerTemplates.eventEnabled(136)
+ };
+ proto.traceAdService_AudioAdRefreshing = function() {
+ providerTemplates.traceTemplateEventDescriptor(136)
+ };
+ proto.isAdService_AudioAdRefreshedEnabled = function() {
+ return !!providerTemplates.eventEnabled(137)
+ };
+ proto.traceAdService_AudioAdRefreshed = function() {
+ providerTemplates.traceTemplateEventDescriptor(137)
+ };
+ proto.isAdService_VideoAdRefreshingEnabled = function() {
+ return !!providerTemplates.eventEnabled(138)
+ };
+ proto.traceAdService_VideoAdRefreshing = function() {
+ providerTemplates.traceTemplateEventDescriptor(138)
+ };
+ proto.isAdService_VideoAdRefreshedEnabled = function() {
+ return !!providerTemplates.eventEnabled(139)
+ };
+ proto.traceAdService_VideoAdRefreshed = function() {
+ providerTemplates.traceTemplateEventDescriptor(139)
+ };
+ proto.isAdService_AudioAdPlayingEnabled = function() {
+ return !!providerTemplates.eventEnabled(140)
+ };
+ proto.traceAdService_AudioAdPlaying = function() {
+ providerTemplates.traceTemplateEventDescriptor(140)
+ };
+ proto.isAdService_AudioAdPlayedEnabled = function() {
+ return !!providerTemplates.eventEnabled(141)
+ };
+ proto.traceAdService_AudioAdPlayed = function() {
+ providerTemplates.traceTemplateEventDescriptor(141)
+ };
+ proto.isAdService_StreamingTrackPlayingEnabled = function() {
+ return !!providerTemplates.eventEnabled(142)
+ };
+ proto.traceAdService_StreamingTrackPlaying = function() {
+ providerTemplates.traceTemplateEventDescriptor(142)
+ };
+ proto.isAdService_StreamingTrackPlayedEnabled = function() {
+ return !!providerTemplates.eventEnabled(143)
+ };
+ proto.traceAdService_StreamingTrackPlayed = function() {
+ providerTemplates.traceTemplateEventDescriptor(143)
+ };
+ proto.isAdService_TrackPlayingEnabled = function() {
+ return !!providerTemplates.eventEnabled(144)
+ };
+ proto.traceAdService_TrackPlaying = function() {
+ providerTemplates.traceTemplateEventDescriptor(144)
+ };
+ proto.isMediaStateEngine_InitializedEnabled = function() {
+ return !!providerTemplates.eventEnabled(145)
+ };
+ proto.traceMediaStateEngine_Initialized = function(mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(145, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_UnloadedEnabled = function() {
+ return !!providerTemplates.eventEnabled(146)
+ };
+ proto.traceMediaStateEngine_Unloaded = function(mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(146, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_UpdateStateEnabled = function() {
+ return !!providerTemplates.eventEnabled(147)
+ };
+ proto.traceMediaStateEngine_UpdateState = function(mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(147, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_ButtonsChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(148)
+ };
+ proto.traceMediaStateEngine_ButtonsChanged = function(mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(148, mediaType, serviceId, libraryId)
+ };
+ proto.isMediaStateEngine_ActionsChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(149)
+ };
+ proto.traceMediaStateEngine_ActionsChanged = function(mediaType, serviceId, libraryId) {
+ providerTemplates.traceTemplate_zzz(149, mediaType, serviceId, libraryId)
+ };
+ proto.isWinJSNavigation_ContentCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(150)
+ };
+ proto.traceWinJSNavigation_ContentComplete = function(location) {
+ providerTemplates.traceTemplate_z(150, location)
+ };
+ proto.isShrinkAndStayHeader_ShownEnabled = function() {
+ return !!providerTemplates.eventEnabled(151)
+ };
+ proto.traceShrinkAndStayHeader_Shown = function() {
+ providerTemplates.traceTemplateEventDescriptor(151)
+ };
+ proto.isShrinkAndStayHeader_DismissedEnabled = function() {
+ return !!providerTemplates.eventEnabled(152)
+ };
+ proto.traceShrinkAndStayHeader_Dismissed = function() {
+ providerTemplates.traceTemplateEventDescriptor(152)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(153)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchCompleted = function(durationMsec) {
+ providerTemplates.traceTemplate_q(153, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToCollectionCompletedEnabled = function() {
+ return !!providerTemplates.eventEnabled(154)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToCollectionCompleted = function(durationMsec) {
+ providerTemplates.traceTemplate_q(154, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchPlayNonProtectedContentEnabled = function() {
+ return !!providerTemplates.eventEnabled(155)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchPlayNonProtectedContent = function(durationMsec) {
+ providerTemplates.traceTemplate_q(155, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchPlayProtectedContentEnabled = function() {
+ return !!providerTemplates.eventEnabled(156)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchPlayProtectedContent = function(durationMsec) {
+ providerTemplates.traceTemplate_q(156, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PlayProtectedInAppPlaybackStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(157)
+ };
+ proto.tracePerfTrack_Trigger_PlayProtectedInAppPlaybackStarted = function(durationMsec) {
+ providerTemplates.traceTemplate_q(157, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PlayNonProtectedInAppPlaybackStartedEnabled = function() {
+ return !!providerTemplates.eventEnabled(158)
+ };
+ proto.tracePerfTrack_Trigger_PlayNonProtectedInAppPlaybackStarted = function(durationMsec) {
+ providerTemplates.traceTemplate_q(158, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_CollectionGalleryRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(159)
+ };
+ proto.tracePerfTrack_Trigger_CollectionGalleryRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(159, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchGalleryRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(160)
+ };
+ proto.tracePerfTrack_Trigger_SearchGalleryRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(160, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PopoverRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(161)
+ };
+ proto.tracePerfTrack_Trigger_PopoverRequestToLoad = function(name, durationMsec) {
+ providerTemplates.traceTemplate_zq(161, name, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MarketplaceGalleryRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(162)
+ };
+ proto.tracePerfTrack_Trigger_MarketplaceGalleryRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(162, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_WebBlendRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(163)
+ };
+ proto.tracePerfTrack_Trigger_WebBlendRequestToLoad = function(url, durationMsec) {
+ providerTemplates.traceTemplate_zq(163, url, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ExplorePageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(164)
+ };
+ proto.tracePerfTrack_Trigger_ExplorePageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(164, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_RadioPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(165)
+ };
+ proto.tracePerfTrack_Trigger_RadioPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(165, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToExploreCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(166)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToExploreComplete = function(durationMsec) {
+ providerTemplates.traceTemplate_q(166, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToRadioCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(167)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToRadioComplete = function(durationMsec) {
+ providerTemplates.traceTemplate_q(167, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TVDetailsRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(168)
+ };
+ proto.tracePerfTrack_Trigger_TVDetailsRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(168, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MovieDetailsRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(169)
+ };
+ proto.tracePerfTrack_Trigger_MovieDetailsRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(169, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AlbumDetailsRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(170)
+ };
+ proto.tracePerfTrack_Trigger_AlbumDetailsRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(170, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ArtistDetailsRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(171)
+ };
+ proto.tracePerfTrack_Trigger_ArtistDetailsRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(171, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PlaylistDetailsRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(172)
+ };
+ proto.tracePerfTrack_Trigger_PlaylistDetailsRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(172, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_DevicesPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(173)
+ };
+ proto.tracePerfTrack_Trigger_DevicesPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(173, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_NowPlayingPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(174)
+ };
+ proto.tracePerfTrack_Trigger_NowPlayingPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(174, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MoviesStorePageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(175)
+ };
+ proto.tracePerfTrack_Trigger_MoviesStorePageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(175, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TvStorePageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(176)
+ };
+ proto.tracePerfTrack_Trigger_TvStorePageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(176, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_VideoCollectionPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(177)
+ };
+ proto.tracePerfTrack_Trigger_VideoCollectionPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(177, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ShopBooksPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(178)
+ };
+ proto.tracePerfTrack_Trigger_ShopBooksPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(178, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_ShopMagsPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(179)
+ };
+ proto.tracePerfTrack_Trigger_ShopMagsPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(179, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToShopBooksCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(180)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToShopBooksComplete = function(durationMsec) {
+ providerTemplates.traceTemplate_q(180, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToShopMagsCompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(181)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToShopMagsComplete = function(durationMsec) {
+ providerTemplates.traceTemplate_q(181, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToOOBECompleteEnabled = function() {
+ return !!providerTemplates.eventEnabled(182)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToOOBEComplete = function(durationMsec) {
+ providerTemplates.traceTemplate_q(182, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_CategoryGalleryRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(183)
+ };
+ proto.tracePerfTrack_Trigger_CategoryGalleryRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(183, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_IssuesGalleryRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(184)
+ };
+ proto.tracePerfTrack_Trigger_IssuesGalleryRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(184, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_StandardGalleryRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(185)
+ };
+ proto.tracePerfTrack_Trigger_StandardGalleryRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(185, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_BookDetailsRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(186)
+ };
+ proto.tracePerfTrack_Trigger_BookDetailsRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(186, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MagDetailsRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(187)
+ };
+ proto.tracePerfTrack_Trigger_MagDetailsRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(187, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchLibraryRequestToQueryResultsEnabled = function() {
+ return !!providerTemplates.eventEnabled(188)
+ };
+ proto.tracePerfTrack_Trigger_SearchLibraryRequestToQueryResults = function(durationMsec) {
+ providerTemplates.traceTemplate_q(188, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchCatalogRequestToQueryResultsEnabled = function() {
+ return !!providerTemplates.eventEnabled(189)
+ };
+ proto.tracePerfTrack_Trigger_SearchCatalogRequestToQueryResults = function(durationMsec) {
+ providerTemplates.traceTemplate_q(189, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_SearchAutoCompleteResultsReceivedEnabled = function() {
+ return !!providerTemplates.eventEnabled(190)
+ };
+ proto.tracePerfTrack_Trigger_SearchAutoCompleteResultsReceived = function(durationMsec) {
+ providerTemplates.traceTemplate_q(190, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_BNDeviceRegistrationRequestSucceededEnabled = function() {
+ return !!providerTemplates.eventEnabled(191)
+ };
+ proto.tracePerfTrack_Trigger_BNDeviceRegistrationRequestSucceeded = function(durationMsec) {
+ providerTemplates.traceTemplate_q(191, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_BNLoginRequestSucceededEnabled = function() {
+ return !!providerTemplates.eventEnabled(192)
+ };
+ proto.tracePerfTrack_Trigger_BNLoginRequestSucceeded = function(durationMsec) {
+ providerTemplates.traceTemplate_q(192, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToMoviesStoreEnabled = function() {
+ return !!providerTemplates.eventEnabled(193)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToMoviesStore = function(durationMsec) {
+ providerTemplates.traceTemplate_q(193, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToTvStoreEnabled = function() {
+ return !!providerTemplates.eventEnabled(194)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToTvStore = function(durationMsec) {
+ providerTemplates.traceTemplate_q(194, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_AppLaunchToVideoCollectionEnabled = function() {
+ return !!providerTemplates.eventEnabled(195)
+ };
+ proto.tracePerfTrack_Trigger_AppLaunchToVideoCollection = function(durationMsec) {
+ providerTemplates.traceTemplate_q(195, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_MoviesCollectionPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(196)
+ };
+ proto.tracePerfTrack_Trigger_MoviesCollectionPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(196, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TvCollectionPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(197)
+ };
+ proto.tracePerfTrack_Trigger_TvCollectionPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(197, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_PersonalCollectionPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(198)
+ };
+ proto.tracePerfTrack_Trigger_PersonalCollectionPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(198, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_FeaturedMoviesPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(199)
+ };
+ proto.tracePerfTrack_Trigger_FeaturedMoviesPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(199, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_NewMoviesPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(200)
+ };
+ proto.tracePerfTrack_Trigger_NewMoviesPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(200, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TopSellingMoviesPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(201)
+ };
+ proto.tracePerfTrack_Trigger_TopSellingMoviesPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(201, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_FeaturedTvPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(202)
+ };
+ proto.tracePerfTrack_Trigger_FeaturedTvPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(202, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_NewTvPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(203)
+ };
+ proto.tracePerfTrack_Trigger_NewTvPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(203, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_LastNightsTvPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(204)
+ };
+ proto.tracePerfTrack_Trigger_LastNightsTvPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(204, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_TopSellingTvPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(205)
+ };
+ proto.tracePerfTrack_Trigger_TopSellingTvPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(205, durationMsec)
+ };
+ proto.isPerfTrack_Trigger_FlexHubPageRequestToLoadEnabled = function() {
+ return !!providerTemplates.eventEnabled(206)
+ };
+ proto.tracePerfTrack_Trigger_FlexHubPageRequestToLoad = function(durationMsec) {
+ providerTemplates.traceTemplate_q(206, durationMsec)
+ }
+})(this);
+(function initMicrosoft_Zune_Sync(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.SyncEventProvider = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.SyncEventProviderTemplate
+ };
+ var proto = ns.SyncEventProvider.prototype;
+ proto.isCloudSync_Engine_Sync_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceCloudSync_Engine_Sync_Start = function(requestSyncOption) {
+ providerTemplates.traceTemplate_q(0, requestSyncOption)
+ };
+ proto.isCloudSync_Engine_Sync_StopEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceCloudSync_Engine_Sync_Stop = function(hResult) {
+ providerTemplates.traceTemplate_d(1, hResult)
+ };
+ proto.isCloudSync_Engine_BlockSync_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceCloudSync_Engine_BlockSync_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(2)
+ };
+ proto.isCloudSync_Engine_BlockSync_StopEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceCloudSync_Engine_BlockSync_Stop = function() {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isCloudSync_Engine_RequestSyncEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceCloudSync_Engine_RequestSync = function(requestSyncOption, cookieNextCompleteSync) {
+ providerTemplates.traceTemplate_qq(4, requestSyncOption, cookieNextCompleteSync)
+ };
+ proto.isCloudSync_Engine_SyncErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceCloudSync_Engine_SyncError = function(hResult) {
+ providerTemplates.traceTemplate_d(5, hResult)
+ };
+ proto.isCloudSync_Engine_SyncEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceCloudSync_Engine_SyncEnd = function(hResult, changes, cookieCompleteSync) {
+ providerTemplates.traceTemplate_dtq(6, hResult, changes, cookieCompleteSync)
+ };
+ proto.isCloudSync_Engine_ScheduleSyncEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceCloudSync_Engine_ScheduleSync = function(delayTimeMS) {
+ providerTemplates.traceTemplate_q(7, delayTimeMS)
+ };
+ proto.isCloudSync_Engine_CancelSyncEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceCloudSync_Engine_CancelSync = function(hResult) {
+ providerTemplates.traceTemplate_d(8, hResult)
+ };
+ proto.isCloudSync_Engine_NotificationEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceCloudSync_Engine_Notification = function(syncPointId) {
+ providerTemplates.traceTemplate_z(9, syncPointId)
+ };
+ proto.isCloudSync_LibraryProvider_LoadItemEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceCloudSync_LibraryProvider_LoadItem = function(syncType, mediaId) {
+ providerTemplates.traceTemplate_qd(10, syncType, mediaId)
+ };
+ proto.isCloudSync_LibraryProvider_AddItemEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceCloudSync_LibraryProvider_AddItem = function(syncType, mediaId, constraintConflict, conflictingMediaId) {
+ providerTemplates.traceTemplate_qdqd(11, syncType, mediaId, constraintConflict, conflictingMediaId)
+ };
+ proto.isCloudSync_LibraryProvider_UpdateItemEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceCloudSync_LibraryProvider_UpdateItem = function(syncType, mediaIdIn, mediaIdOut) {
+ providerTemplates.traceTemplate_qdd(12, syncType, mediaIdIn, mediaIdOut)
+ };
+ proto.isCloudSync_LibraryProvider_DeleteItemEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceCloudSync_LibraryProvider_DeleteItem = function(syncType, mediaId) {
+ providerTemplates.traceTemplate_qd(13, syncType, mediaId)
+ };
+ proto.isCloudSync_LibraryProvider_DirtyItemsEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceCloudSync_LibraryProvider_DirtyItems = function(syncType, dirtyItems) {
+ providerTemplates.traceTemplate_qz(14, syncType, dirtyItems)
+ };
+ proto.isCloudSync_LibraryProvider_DeletedItemsEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceCloudSync_LibraryProvider_DeletedItems = function(syncType, deletedItems) {
+ providerTemplates.traceTemplate_qz(15, syncType, deletedItems)
+ };
+ proto.isCloudSync_LibraryProvider_InvalidItemsEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceCloudSync_LibraryProvider_InvalidItems = function(syncType, invalidItems) {
+ providerTemplates.traceTemplate_qz(16, syncType, invalidItems)
+ };
+ proto.isCloudSync_LibraryProvider_IsDirtyEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceCloudSync_LibraryProvider_IsDirty = function(isDirty) {
+ providerTemplates.traceTemplate_t(17, isDirty)
+ };
+ proto.isCloudSync_LibraryProvider_IsAvailableEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceCloudSync_LibraryProvider_IsAvailable = function(isAvailable) {
+ providerTemplates.traceTemplate_t(18, isAvailable)
+ };
+ proto.isCloudSync_LibraryProvider_ContentChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceCloudSync_LibraryProvider_ContentChanged = function(notifyDelayMS) {
+ providerTemplates.traceTemplate_q(19, notifyDelayMS)
+ };
+ proto.isCloudSync_LibraryProvider_UpdateMetadata_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceCloudSync_LibraryProvider_UpdateMetadata_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(20)
+ };
+ proto.isCloudSync_LibraryProvider_UpdateMetadata_StopEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceCloudSync_LibraryProvider_UpdateMetadata_Stop = function() {
+ providerTemplates.traceTemplateEventDescriptor(21)
+ };
+ proto.isCloudSync_CloudProvider_ApplyItem_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyItem_Error = function(syncType, cloudId, hResult) {
+ providerTemplates.traceTemplate_qzd(22, syncType, cloudId, hResult)
+ };
+ proto.isCloudSync_CloudProvider_ApplyItem_SkippedEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyItem_Skipped = function(syncType, cloudId) {
+ providerTemplates.traceTemplate_qz(23, syncType, cloudId)
+ };
+ proto.isCloudSync_CloudProvider_LoadItem_ErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceCloudSync_CloudProvider_LoadItem_Error = function(syncType, cloudId, hResult) {
+ providerTemplates.traceTemplate_qzd(24, syncType, cloudId, hResult)
+ };
+ proto.isCloudSync_CloudProvider_IsDirtyEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceCloudSync_CloudProvider_IsDirty = function(isDirty, dirtyReason) {
+ providerTemplates.traceTemplate_tq(25, isDirty, dirtyReason)
+ };
+ proto.isCloudSync_CloudProvider_IsAvailableEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceCloudSync_CloudProvider_IsAvailable = function(availability) {
+ providerTemplates.traceTemplate_q(26, availability)
+ };
+ proto.isCloudSync_CloudProvider_ContentChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceCloudSync_CloudProvider_ContentChanged = function() {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isCloudSync_CloudProvider_FindChangesEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceCloudSync_CloudProvider_FindChanges = function(anchor, requestedBatchSize, hasMoreData) {
+ providerTemplates.traceTemplate_zqt(28, anchor, requestedBatchSize, hasMoreData)
+ };
+ proto.isCloudSync_CloudProvider_FoundChangeEnabled = function() {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceCloudSync_CloudProvider_FoundChange = function(syncType, cloudId, changeType) {
+ providerTemplates.traceTemplate_qzq(29, syncType, cloudId, changeType)
+ };
+ proto.isCloudSync_CloudProvider_TakeDownEnabled = function() {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceCloudSync_CloudProvider_TakeDown = function(cloudId) {
+ providerTemplates.traceTemplate_z(30, cloudId)
+ };
+ proto.isCloudSync_CloudProvider_UpdateMetadata_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceCloudSync_CloudProvider_UpdateMetadata_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isCloudSync_CloudProvider_UpdateMetadata_StopEnabled = function() {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceCloudSync_CloudProvider_UpdateMetadata_Stop = function() {
+ providerTemplates.traceTemplateEventDescriptor(32)
+ };
+ proto.isCloudSync_CloudProvider_ApplyBatch_StartEnabled = function() {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyBatch_Start = function() {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isCloudSync_CloudProvider_ApplyBatch_StopEnabled = function() {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceCloudSync_CloudProvider_ApplyBatch_Stop = function() {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ }
+})(this);
+(function initMicrosoft_Zune_LegacyPerfTrace(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.LegacyPerfTrace = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.LegacyPerfTraceTemplate
+ };
+ var proto = ns.LegacyPerfTrace.prototype;
+ proto.isLegacyPerfTraceHttpEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceLegacyPerfTraceHttpEvent = function(httpEvent, url) {
+ providerTemplates.traceTemplate_qz(0, httpEvent, url)
+ };
+ proto.isLegacyPerfTraceClientEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceLegacyPerfTraceClientEvent = function(reporterTag, actionType, reason) {
+ providerTemplates.traceTemplate_qqq(1, reporterTag, actionType, reason)
+ };
+ proto.isLegacyPerfTraceWMPPlaybackEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceLegacyPerfTraceWMPPlaybackEvent = function(type, fileName, graphType, lastHR) {
+ providerTemplates.traceTemplate_qzqd(2, type, fileName, graphType, lastHR)
+ };
+ proto.isLegacyPerfTraceDBMutexEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceLegacyPerfTraceDBMutexEvent = function(dBMutexEvent, threadId, time) {
+ providerTemplates.traceTemplate_qqq(3, dBMutexEvent, threadId, time)
+ };
+ proto.isLegacyPerfTraceLaunchEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceLegacyPerfTraceLaunchEvent = function(launchEvent, launchEventData) {
+ providerTemplates.traceTemplate_qq(4, launchEvent, launchEventData)
+ };
+ proto.isLegacyPerfTraceSyncEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceLegacyPerfTraceSyncEvent = function(syncEvent, syncEventData) {
+ providerTemplates.traceTemplate_qq(5, syncEvent, syncEventData)
+ };
+ proto.isLegacyPerfTraceQRSEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceLegacyPerfTraceQRSEvent = function(qRSEvent, qRSEventData) {
+ providerTemplates.traceTemplate_qq(6, qRSEvent, qRSEventData)
+ };
+ proto.isLegacyPerfTraceGenericEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceLegacyPerfTraceGenericEvent = function(reporterTag, type, action) {
+ providerTemplates.traceTemplate_qqq(7, reporterTag, type, action)
+ };
+ proto.isLegacyPerfTraceDriverEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceLegacyPerfTraceDriverEvent = function(driverEvent, driverEventData) {
+ providerTemplates.traceTemplate_qq(8, driverEvent, driverEventData)
+ };
+ proto.isLegacyPerfTraceCollectionEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceLegacyPerfTraceCollectionEvent = function(collectionEvent, detail) {
+ providerTemplates.traceTemplate_qz(9, collectionEvent, detail)
+ };
+ proto.isLegacyPerfTraceQuickMixEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceLegacyPerfTraceQuickMixEvent = function(quickMixEvent, quickMixEventData) {
+ providerTemplates.traceTemplate_qq(10, quickMixEvent, quickMixEventData)
+ };
+ proto.isLegacyPerfTraceDownloadEventEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceLegacyPerfTraceDownloadEvent = function(downloadEvent, id) {
+ providerTemplates.traceTemplate_qz(11, downloadEvent, id)
+ }
+})(this);
+(function initMicrosoft_Zune_Social(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Social = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.SocialTemplate
+ };
+ var proto = ns.Social.prototype;
+ proto.isAvatarRendererFrameStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceAvatarRendererFrameStart = function(id) {
+ providerTemplates.traceTemplate_z(0, id)
+ };
+ proto.isAvatarRendererFrameEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceAvatarRendererFrameEnd = function(id, duration) {
+ providerTemplates.traceTemplate_zf(1, id, duration)
+ };
+ proto.isAvatarRendererShutdownEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceAvatarRendererShutdown = function(id) {
+ providerTemplates.traceTemplate_z(2, id)
+ }
+})(this);
+(function initMicrosoft_Zune_Xbox(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Xbox = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.XboxTemplate
+ };
+ var proto = ns.Xbox.prototype;
+ proto.isXboxSessionStateChangeEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceXboxSessionStateChange = function(newState, oldState) {
+ providerTemplates.traceTemplate_zz(0, newState, oldState)
+ };
+ proto.isXboxTransportControlsLRCStateChangeEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceXboxTransportControlsLRCStateChange = function(newState, oldState) {
+ providerTemplates.traceTemplate_zz(1, newState, oldState)
+ };
+ proto.isXboxSigninTMFServiceSigninEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceXboxSigninTMFServiceSignin = function(tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(2, tag, hResult, errorText)
+ };
+ proto.isXboxSigninJoinSessionEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceXboxSigninJoinSession = function(tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(3, tag, hResult, errorText)
+ };
+ proto.isXboxSigninX8AppSigninEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceXboxSigninX8AppSignin = function(tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(4, tag, hResult, errorText)
+ };
+ proto.isXboxSigninNoUserSessionsEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceXboxSigninNoUserSessions = function(tag, hResult, errorText) {
+ providerTemplates.traceTemplate_zdz(5, tag, hResult, errorText)
+ };
+ proto.isXboxControlCommandSentEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceXboxControlCommandSent = function(controlKey, executionTimeMilliseconds) {
+ providerTemplates.traceTemplate_qf(6, controlKey, executionTimeMilliseconds)
+ };
+ proto.isXboxControlCommandErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceXboxControlCommandError = function(controlKey, executionTimeMilliseconds, responseCode) {
+ providerTemplates.traceTemplate_qfq(7, controlKey, executionTimeMilliseconds, responseCode)
+ };
+ proto.isXboxControlSeekCommandSentEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceXboxControlSeekCommandSent = function(seekPosition, executionTimeMilliseconds) {
+ providerTemplates.traceTemplate_xf(8, seekPosition, executionTimeMilliseconds)
+ };
+ proto.isXboxControlSeekCommandErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceXboxControlSeekCommandError = function(seekPosition, executionTimeMilliseconds, responseCode) {
+ providerTemplates.traceTemplate_xfq(9, seekPosition, executionTimeMilliseconds, responseCode)
+ };
+ proto.isXboxBogusMediaStateMessageIgnoredEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceXboxBogusMediaStateMessageIgnored = function(position, transportState, positionBeforeLastSeek, lastSeekPosition) {
+ providerTemplates.traceTemplate_xqxx(10, position, transportState, positionBeforeLastSeek, lastSeekPosition)
+ };
+ proto.isXboxGetMediaStateErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceXboxGetMediaStateError = function(executionTimeMilliseconds, responseCode) {
+ providerTemplates.traceTemplate_fq(11, executionTimeMilliseconds, responseCode)
+ };
+ proto.isXboxShowXboxControlsEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceXboxShowXboxControls = function() {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isXboxShowXboxControlsSetVisibleEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceXboxShowXboxControlsSetVisible = function() {
+ providerTemplates.traceTemplateEventDescriptor(13)
+ };
+ proto.isXboxHideXboxControlsEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceXboxHideXboxControls = function() {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isXboxOnlinePresenceBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceXboxOnlinePresenceBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(15)
+ };
+ proto.isXboxOnlinePresenceReceivedEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceXboxOnlinePresenceReceived = function(titleId, mediaAssetId) {
+ providerTemplates.traceTemplate_qz(16, titleId, mediaAssetId)
+ };
+ proto.isXboxOnlinePresenceErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceXboxOnlinePresenceError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(17, hResult, errorMessage)
+ };
+ proto.isXboxGetActiveTitleInformationBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceXboxGetActiveTitleInformationBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(18)
+ };
+ proto.isXboxGetActiveTitleInformationDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceXboxGetActiveTitleInformationDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(19)
+ };
+ proto.isXboxGetActiveTitleInformationErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceXboxGetActiveTitleInformationError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(20, hResult, errorMessage)
+ };
+ proto.isXboxEstablishTitleChannelBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceXboxEstablishTitleChannelBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(21)
+ };
+ proto.isXboxEstablishTitleChannelDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceXboxEstablishTitleChannelDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isXboxEstablishTitleChannelErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceXboxEstablishTitleChannelError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(23, hResult, errorMessage)
+ };
+ proto.isXboxSendTouchPointsBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceXboxSendTouchPointsBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(24)
+ };
+ proto.isXboxSendTouchPointsDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceXboxSendTouchPointsDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isXboxSendTouchPointsErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceXboxSendTouchPointsError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(26, hResult, errorMessage)
+ };
+ proto.isXboxGetKeyboardBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceXboxGetKeyboardBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isXboxGetKeyboardDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceXboxGetKeyboardDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(28)
+ };
+ proto.isXboxGetKeyboardErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceXboxGetKeyboardError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(29, hResult, errorMessage)
+ };
+ proto.isXboxGetKeyboardStateBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceXboxGetKeyboardStateBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(30)
+ };
+ proto.isXboxGetKeyboardStateDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceXboxGetKeyboardStateDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isXboxGetKeyboardStateErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceXboxGetKeyboardStateError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(32, hResult, errorMessage)
+ };
+ proto.isXboxGetKeyboardTextBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceXboxGetKeyboardTextBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isXboxGetKeyboardTextDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceXboxGetKeyboardTextDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ };
+ proto.isXboxGetKeyboardTextErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceXboxGetKeyboardTextError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(35, hResult, errorMessage)
+ };
+ proto.isXboxSetKeyboardTextBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceXboxSetKeyboardTextBegin = function(text) {
+ providerTemplates.traceTemplate_z(36, text)
+ };
+ proto.isXboxSetKeyboardTextDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceXboxSetKeyboardTextDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isXboxSetKeyboardTextErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceXboxSetKeyboardTextError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(38, hResult, errorMessage)
+ };
+ proto.isXboxSetKeyboardTextAndSelectionBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceXboxSetKeyboardTextAndSelectionBegin = function(text, selectionStart, selectionLength) {
+ providerTemplates.traceTemplate_zqq(39, text, selectionStart, selectionLength)
+ };
+ proto.isXboxSetKeyboardTextAndSelectionDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceXboxSetKeyboardTextAndSelectionDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(40)
+ };
+ proto.isXboxSetKeyboardTextAndSelectionErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceXboxSetKeyboardTextAndSelectionError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(41, hResult, errorMessage)
+ };
+ proto.isXboxSendTitleMessageBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.traceXboxSendTitleMessageBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(42)
+ };
+ proto.isXboxSendTitleMessageDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceXboxSendTitleMessageDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isXboxSendTitleMessageErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceXboxSendTitleMessageError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(44, hResult, errorMessage)
+ };
+ proto.isXboxDisconnectSessionBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceXboxDisconnectSessionBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(45)
+ };
+ proto.isXboxDisconnectSessionDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceXboxDisconnectSessionDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(46)
+ };
+ proto.isXboxDisconnectSessionErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceXboxDisconnectSessionError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(47, hResult, errorMessage)
+ };
+ proto.isXboxNewSessionObjectAssignedEnabled = function() {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceXboxNewSessionObjectAssigned = function() {
+ providerTemplates.traceTemplateEventDescriptor(48)
+ };
+ proto.isXboxSessionObjectReassignedEnabled = function() {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceXboxSessionObjectReassigned = function() {
+ providerTemplates.traceTemplateEventDescriptor(49)
+ };
+ proto.isXboxSessionObjectResetToNullEnabled = function() {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceXboxSessionObjectResetToNull = function() {
+ providerTemplates.traceTemplateEventDescriptor(50)
+ };
+ proto.isXboxTitleChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceXboxTitleChanged = function(titleId) {
+ providerTemplates.traceTemplate_q(51, titleId)
+ };
+ proto.isXboxTitleMessagingConfigChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceXboxTitleMessagingConfigChanged = function(titleId, titlePort, enabled) {
+ providerTemplates.traceTemplate_qqt(52, titleId, titlePort, enabled)
+ };
+ proto.isXboxTitleChannelStatusChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceXboxTitleChannelStatusChanged = function(status, titleId, titlePort, hResult) {
+ providerTemplates.traceTemplate_qqqd(53, status, titleId, titlePort, hResult)
+ };
+ proto.isXboxStreamingModeChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceXboxStreamingModeChanged = function(clientExclusiveModeStatus, consoleExclusiveModeStatus) {
+ providerTemplates.traceTemplate_qq(54, clientExclusiveModeStatus, consoleExclusiveModeStatus)
+ };
+ proto.isXboxLocalTransportStateChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceXboxLocalTransportStateChanged = function(localTransportConnected) {
+ providerTemplates.traceTemplate_t(55, localTransportConnected)
+ };
+ proto.isXboxSessionStatusChangedEnabled = function() {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceXboxSessionStatusChanged = function(sessionState) {
+ providerTemplates.traceTemplate_q(56, sessionState)
+ };
+ proto.isXboxAcquireExclusiveModeBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.traceXboxAcquireExclusiveModeBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(57)
+ };
+ proto.isXboxAcquireExclusiveModeDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.traceXboxAcquireExclusiveModeDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(58)
+ };
+ proto.isXboxAcquireExclusiveModeErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.traceXboxAcquireExclusiveModeError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(59, hResult, errorMessage)
+ };
+ proto.isXboxHeartBeatPingErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.traceXboxHeartBeatPingError = function(hResult, errorMessage, sessionState, isCurrentWinRTSessionReassigned, isCurrentWinRTSessionNull) {
+ providerTemplates.traceTemplate_dzztt(60, hResult, errorMessage, sessionState, isCurrentWinRTSessionReassigned, isCurrentWinRTSessionNull)
+ };
+ proto.isXboxSessionConnectCallEnabled = function() {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.traceXboxSessionConnectCall = function(sessionState, isRetry) {
+ providerTemplates.traceTemplate_zt(61, sessionState, isRetry)
+ };
+ proto.isXboxLaunchTitleCallEnabled = function() {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceXboxLaunchTitleCall = function(titleId, startTimeMilliseconds, firstAction) {
+ providerTemplates.traceTemplate_qfz(62, titleId, startTimeMilliseconds, firstAction)
+ };
+ proto.isXboxReleaseExclusiveModeBeginEnabled = function() {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceXboxReleaseExclusiveModeBegin = function() {
+ providerTemplates.traceTemplateEventDescriptor(63)
+ };
+ proto.isXboxReleaseExclusiveModeDoneEnabled = function() {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceXboxReleaseExclusiveModeDone = function() {
+ providerTemplates.traceTemplateEventDescriptor(64)
+ };
+ proto.isXboxReleaseExclusiveModeErrorEnabled = function() {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceXboxReleaseExclusiveModeError = function(hResult, errorMessage) {
+ providerTemplates.traceTemplate_dz(65, hResult, errorMessage)
+ }
+})(this);
+(function initMicrosoft_Zune_Providers(global) {
+ var providerTemplates = null;
+ var ns = global;
+ if (ns.Diagnostics === undefined)
+ ns.Diagnostics = {};
+ var ns = ns.Diagnostics;
+ if (ns.Tracing === undefined)
+ ns.Tracing = {};
+ var ns = ns.Tracing;
+ if (ns.Microsoft === undefined)
+ ns.Microsoft = {};
+ var ns = ns.Microsoft;
+ if (ns.Entertainment === undefined)
+ ns.Entertainment = {};
+ var ns = ns.Entertainment;
+ if (ns.Instrumentation === undefined)
+ ns.Instrumentation = {};
+ var ns = ns.Instrumentation;
+ if (ns.Providers === undefined)
+ ns.Providers = {};
+ var ns = ns.Providers;
+ ns.Providers = function() {
+ if (providerTemplates === null)
+ providerTemplates = new global.Microsoft.Entertainment.Instrumentation.Providers.ProvidersTemplate
+ };
+ var proto = ns.Providers.prototype;
+ proto.isAddMediaStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(0)
+ };
+ proto.traceAddMediaStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(0)
+ };
+ proto.isAddMediaEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(1)
+ };
+ proto.traceAddMediaEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(1)
+ };
+ proto.isAddTrackStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(2)
+ };
+ proto.traceAddTrackStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(2)
+ };
+ proto.isAddTrackEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(3)
+ };
+ proto.traceAddTrackEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(3)
+ };
+ proto.isAddAlbumAndFindTrackIdStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(4)
+ };
+ proto.traceAddAlbumAndFindTrackIdStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(4)
+ };
+ proto.isAddAlbumAndFindTrackIdEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(5)
+ };
+ proto.traceAddAlbumAndFindTrackIdEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(5)
+ };
+ proto.isFindTrackIdAndAlbumBasedOnTrackSmidStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(6)
+ };
+ proto.traceFindTrackIdAndAlbumBasedOnTrackSmidStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(6)
+ };
+ proto.isFindTrackIdAndAlbumBasedOnTrackSmidEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(7)
+ };
+ proto.traceFindTrackIdAndAlbumBasedOnTrackSmidEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(7)
+ };
+ proto.isAddAlbumAndFindTrackIdBasedOnMetadataStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(8)
+ };
+ proto.traceAddAlbumAndFindTrackIdBasedOnMetadataStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(8)
+ };
+ proto.isAddAlbumAndFindTrackIdBasedOnMetadataEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(9)
+ };
+ proto.traceAddAlbumAndFindTrackIdBasedOnMetadataEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(9)
+ };
+ proto.isAddAudioAlbumStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(10)
+ };
+ proto.traceAddAudioAlbumStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(10)
+ };
+ proto.isAddAudioAlbumEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(11)
+ };
+ proto.traceAddAudioAlbumEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(11)
+ };
+ proto.isFindArtistAndAlbumStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(12)
+ };
+ proto.traceFindArtistAndAlbumStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(12)
+ };
+ proto.isFindArtistAndAlbumEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(13)
+ };
+ proto.traceFindArtistAndAlbumEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(13)
+ };
+ proto.isUpdateCurrentAudioAlbumStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(14)
+ };
+ proto.traceUpdateCurrentAudioAlbumStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(14)
+ };
+ proto.isUpdateCurrentAudioAlbumEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(15)
+ };
+ proto.traceUpdateCurrentAudioAlbumEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(15)
+ };
+ proto.isAddPersonLinksStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(16)
+ };
+ proto.traceAddPersonLinksStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(16)
+ };
+ proto.isAddPersonLinksEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(17)
+ };
+ proto.traceAddPersonLinksEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(17)
+ };
+ proto.isAddPersonStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(18)
+ };
+ proto.traceAddPersonStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(18)
+ };
+ proto.isAddPersonEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(19)
+ };
+ proto.traceAddPersonEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(19)
+ };
+ proto.isAddPersonLinkStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(20)
+ };
+ proto.traceAddPersonLinkStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(20)
+ };
+ proto.isAddPersonLinkEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(21)
+ };
+ proto.traceAddPersonLinkEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(21)
+ };
+ proto.isFindAndGetAudioTrackStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(22)
+ };
+ proto.traceFindAndGetAudioTrackStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(22)
+ };
+ proto.isFindAndGetAudioTrackEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(23)
+ };
+ proto.traceFindAndGetAudioTrackEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(23)
+ };
+ proto.isUpdateCurrentTrackStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(24)
+ };
+ proto.traceUpdateCurrentTrackStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(24)
+ };
+ proto.isUpdateCurrentTrackEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(25)
+ };
+ proto.traceUpdateCurrentTrackEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(25)
+ };
+ proto.isRecomputeAlbumReleaseYearStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(26)
+ };
+ proto.traceRecomputeAlbumReleaseYearStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(26)
+ };
+ proto.isRecomputeAlbumReleaseYearEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(27)
+ };
+ proto.traceRecomputeAlbumReleaseYearEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(27)
+ };
+ proto.isAddTrackFileStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(28)
+ };
+ proto.traceAddTrackFileStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(28)
+ };
+ proto.isAddTrackFileEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(29)
+ };
+ proto.traceAddTrackFileEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(29)
+ };
+ proto.isReflectTrackFilesStateStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(30)
+ };
+ proto.traceReflectTrackFilesStateStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(30)
+ };
+ proto.isReflectTrackFilesStateEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(31)
+ };
+ proto.traceReflectTrackFilesStateEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(31)
+ };
+ proto.isAddFileStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(32)
+ };
+ proto.traceAddFileStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(32)
+ };
+ proto.isAddFileEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(33)
+ };
+ proto.traceAddFileEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(33)
+ };
+ proto.isUpdateFileStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(34)
+ };
+ proto.traceUpdateFileStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(34)
+ };
+ proto.isUpdateFileEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(35)
+ };
+ proto.traceUpdateFileEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(35)
+ };
+ proto.isAddFolderStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(36)
+ };
+ proto.traceAddFolderStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(36)
+ };
+ proto.isAddFolderEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(37)
+ };
+ proto.traceAddFolderEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(37)
+ };
+ proto.isUpdatePlaylistContentsStartEnabled = function() {
+ return !!providerTemplates.eventEnabled(38)
+ };
+ proto.traceUpdatePlaylistContentsStart = function() {
+ providerTemplates.traceTemplateEventDescriptor(38)
+ };
+ proto.isUpdatePlaylistContentsEndEnabled = function() {
+ return !!providerTemplates.eventEnabled(39)
+ };
+ proto.traceUpdatePlaylistContentsEnd = function() {
+ providerTemplates.traceTemplateEventDescriptor(39)
+ };
+ proto.isFoundTrackBySmidEnabled = function() {
+ return !!providerTemplates.eventEnabled(40)
+ };
+ proto.traceFoundTrackBySmid = function() {
+ providerTemplates.traceTemplateEventDescriptor(40)
+ };
+ proto.isFoundTrackAndAlbumEnabled = function() {
+ return !!providerTemplates.eventEnabled(41)
+ };
+ proto.traceFoundTrackAndAlbum = function(albumId, artistId, trackId) {
+ providerTemplates.traceTemplate_qqq(41, albumId, artistId, trackId)
+ };
+ proto.isPromotingTrackArtistEnabled = function() {
+ return !!providerTemplates.eventEnabled(42)
+ };
+ proto.tracePromotingTrackArtist = function(albumTitle) {
+ providerTemplates.traceTemplate_z(42, albumTitle)
+ };
+ proto.isAlbumAsVariousArtistsEnabled = function() {
+ return !!providerTemplates.eventEnabled(43)
+ };
+ proto.traceAlbumAsVariousArtists = function() {
+ providerTemplates.traceTemplateEventDescriptor(43)
+ };
+ proto.isAddingAlbumEnabled = function() {
+ return !!providerTemplates.eventEnabled(44)
+ };
+ proto.traceAddingAlbum = function(albumName) {
+ providerTemplates.traceTemplate_z(44, albumName)
+ };
+ proto.isAddAlbumWithTitleArtistEnabled = function() {
+ return !!providerTemplates.eventEnabled(45)
+ };
+ proto.traceAddAlbumWithTitleArtist = function(albumTitle, artistId) {
+ providerTemplates.traceTemplate_zq(45, albumTitle, artistId)
+ };
+ proto.isUpdatingAlbumEnabled = function() {
+ return !!providerTemplates.eventEnabled(46)
+ };
+ proto.traceUpdatingAlbum = function() {
+ providerTemplates.traceTemplateEventDescriptor(46)
+ };
+ proto.isAddingPersonEnabled = function() {
+ return !!providerTemplates.eventEnabled(47)
+ };
+ proto.traceAddingPerson = function(personName) {
+ providerTemplates.traceTemplate_z(47, personName)
+ };
+ proto.isUpdatingPersonEnabled = function() {
+ return !!providerTemplates.eventEnabled(48)
+ };
+ proto.traceUpdatingPerson = function(personName) {
+ providerTemplates.traceTemplate_z(48, personName)
+ };
+ proto.isAddingPersonLinkEnabled = function() {
+ return !!providerTemplates.eventEnabled(49)
+ };
+ proto.traceAddingPersonLink = function(personId, mediaId) {
+ providerTemplates.traceTemplate_qq(49, personId, mediaId)
+ };
+ proto.isAddingTrackEntryEnabled = function() {
+ return !!providerTemplates.eventEnabled(50)
+ };
+ proto.traceAddingTrackEntry = function(albumId, trackTitle, trackNumber) {
+ providerTemplates.traceTemplate_qzq(50, albumId, trackTitle, trackNumber)
+ };
+ proto.isTrackIsAudioBookEnabled = function() {
+ return !!providerTemplates.eventEnabled(51)
+ };
+ proto.traceTrackIsAudioBook = function() {
+ providerTemplates.traceTemplateEventDescriptor(51)
+ };
+ proto.isFoundExistingTrackEnabled = function() {
+ return !!providerTemplates.eventEnabled(52)
+ };
+ proto.traceFoundExistingTrack = function(trackId) {
+ providerTemplates.traceTemplate_q(52, trackId)
+ };
+ proto.isAddingUnknownArtistEnabled = function() {
+ return !!providerTemplates.eventEnabled(53)
+ };
+ proto.traceAddingUnknownArtist = function() {
+ providerTemplates.traceTemplateEventDescriptor(53)
+ };
+ proto.isUpdateAlbumSetGenreEnabled = function() {
+ return !!providerTemplates.eventEnabled(54)
+ };
+ proto.traceUpdateAlbumSetGenre = function(genreId) {
+ providerTemplates.traceTemplate_q(54, genreId)
+ };
+ proto.isSetUnknownGenreEnabled = function() {
+ return !!providerTemplates.eventEnabled(55)
+ };
+ proto.traceSetUnknownGenre = function() {
+ providerTemplates.traceTemplateEventDescriptor(55)
+ };
+ proto.isAddingTrackEnabled = function() {
+ return !!providerTemplates.eventEnabled(56)
+ };
+ proto.traceAddingTrack = function(trackName) {
+ providerTemplates.traceTemplate_z(56, trackName)
+ };
+ proto.isUpdatingTrackEnabled = function() {
+ return !!providerTemplates.eventEnabled(57)
+ };
+ proto.traceUpdatingTrack = function(trackName) {
+ providerTemplates.traceTemplate_z(57, trackName)
+ };
+ proto.isSetTrackRatingFromFileEnabled = function() {
+ return !!providerTemplates.eventEnabled(58)
+ };
+ proto.traceSetTrackRatingFromFile = function(trackTitle, rating) {
+ providerTemplates.traceTemplate_zq(58, trackTitle, rating)
+ };
+ proto.isSplitExistingFileEnabled = function() {
+ return !!providerTemplates.eventEnabled(59)
+ };
+ proto.traceSplitExistingFile = function(oldTrackId, newTrackId) {
+ providerTemplates.traceTemplate_qq(59, oldTrackId, newTrackId)
+ };
+ proto.isAddingFolderEnabled = function() {
+ return !!providerTemplates.eventEnabled(60)
+ };
+ proto.traceAddingFolder = function(folderPath) {
+ providerTemplates.traceTemplate_z(60, folderPath)
+ };
+ proto.isAddingFileEnabled = function() {
+ return !!providerTemplates.eventEnabled(61)
+ };
+ proto.traceAddingFile = function(filename) {
+ providerTemplates.traceTemplate_z(61, filename)
+ };
+ proto.isUpdatingFileEnabled = function() {
+ return !!providerTemplates.eventEnabled(62)
+ };
+ proto.traceUpdatingFile = function(filename) {
+ providerTemplates.traceTemplate_z(62, filename)
+ };
+ proto.isUpdatingFileCountsEnabled = function() {
+ return !!providerTemplates.eventEnabled(63)
+ };
+ proto.traceUpdatingFileCounts = function() {
+ providerTemplates.traceTemplateEventDescriptor(63)
+ };
+ proto.isUpdateOldAlbumVisibilityEnabled = function() {
+ return !!providerTemplates.eventEnabled(64)
+ };
+ proto.traceUpdateOldAlbumVisibility = function(albumId) {
+ providerTemplates.traceTemplate_q(64, albumId)
+ };
+ proto.isUpdateAlbumVisibilityEnabled = function() {
+ return !!providerTemplates.eventEnabled(65)
+ };
+ proto.traceUpdateAlbumVisibility = function(albumId) {
+ providerTemplates.traceTemplate_q(65, albumId)
+ };
+ proto.isUpdatingTrackAcquisitionDateEnabled = function() {
+ return !!providerTemplates.eventEnabled(66)
+ };
+ proto.traceUpdatingTrackAcquisitionDate = function(trackId) {
+ providerTemplates.traceTemplate_q(66, trackId)
+ };
+ proto.isUpdatingAlbumAcquisitionDateEnabled = function() {
+ return !!providerTemplates.eventEnabled(67)
+ };
+ proto.traceUpdatingAlbumAcquisitionDate = function(albumId) {
+ providerTemplates.traceTemplate_q(67, albumId)
+ };
+ proto.isUpdatingPlaylistItemWithMediaIdEnabled = function() {
+ return !!providerTemplates.eventEnabled(68)
+ };
+ proto.traceUpdatingPlaylistItemWithMediaId = function(playlistContentId, mediaId) {
+ providerTemplates.traceTemplate_qq(68, playlistContentId, mediaId)
+ }
+})(this)
+})();
+/* >>>>>>/components/perftrack/perftrack.js:4522 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Instrumentation", {PerfTrack: WinJS.Class.define(null, {}, {
+ triggerLog: [], StartPoints: {
+ AppLaunch: "AppLaunch", PlayCommand: "PlayCommand", CollectionGalleryRequest: "CollectionGalleryRequest", SearchGalleryRequest: "SearchGalleryRequest", PopoverRequest: "PopoverRequest", MarketplaceGalleryRequest: "MarketplaceGalleryRequest", WebBlendRequest: "WebBlendRequest", ExplorePageRequest: "ExplorePageRequest", RadioPageRequest: "RadioPageRequest", TVDetailsRequest: "TVDetailsRequest", MovieDetailsRequest: "MovieDetailsRequest", AlbumDetailsRequest: "AlbumDetailsRequest", ArtistDetailsRequest: "ArtistDetailsRequest", PlaylistDetailsRequest: "PlaylistDetailsRequest", DevicesPageRequest: "DevicesPageRequest", NowPlayingPageRequest: "NowPlayingPageRequest", MoviesStorePageRequest: "MoviesStorePageRequest", TvStorePageRequest: "TvStorePageRequest", VideoCollectionPageRequest: "VideoCollectionPageRequest", ShopBooksPageRequest: "ShopBooksPageRequest", ShopMagsPageRequest: "ShopMagsPageRequest", CategoryGalleryRequest: "CategoryGalleryRequest", IssuesGalleryRequest: "IssuesGalleryRequest", StandardGalleryRequest: "StandardGalleryRequest", BookDetailsRequest: "BookDetailsRequest", MagDetailsRequest: "MagDetailsRequest", SearchLibraryRequest: "SearchLibraryRequest", SearchCatalogRequest: "SearchCatalogRequest", SearchAutoCompleteRequest: "SearchAutoCompleteRequest", BNDeviceRegistrationRequest: "BNDeviceRegistrationRequest", BNLoginRequest: "BNLoginRequest", AppLaunchToMoviesStore: "AppLaunchToMoviesStore", AppLaunchToTvStore: "AppLaunchToTvStore", AppLaunchToVideoCollection: "AppLaunchToVideoCollection", MoviesCollectionPageRequest: "MoviesCollectionPageRequest", PersonalCollectionPageRequest: "PersonalCollectionPageRequest", FeaturedMoviesPageRequest: "FeaturedMoviesPageRequest", NewMoviesPageRequest: "NewMoviesPageRequest", TopSellingMoviesPageRequest: "TopSellingMoviesPageRequest", FeaturedTvPageRequest: "FeaturedTvPageRequest", NewTvPageRequest: "NewTvPageRequest", LastNightsTvPageRequest: "LastNightsTvPageRequest", TopSellingTvPageRequest: "TopSellingTvPageRequest", FlexHubPageRequest: "FlexHubPageRequest", TvCollectionPageRequest: "TvCollectionPageRequest"
+ }, logTrigger: function logTrigger(scenarioName) {
+ var text = scenarioName;
+ for (var i = 1; i < arguments.length; i++)
+ text += "\t" + arguments[i];
+ MS.Entertainment.Instrumentation.PerfTrack.triggerLog.push(text)
+ }, getLogger: (function _perfTrack_getLoggerClosure() {
+ var logger = null;
+ return function _perfTrack_getLoggerWorker() {
+ if (!logger)
+ logger = new Microsoft.PerfTrack.PerfTrackLogger(Microsoft.PerfTrack.PerfTrackLogger.windowsDataUploadEnabled);
+ return logger
+ }
+ })(), _truncateString: function _perfTrack_truncateString(s) {
+ var result = s;
+ if (result && typeof(result) === "string" && result.length > 120)
+ result = result.substr(0, 120) + "[...]";
+ return result
+ }, _getState: (function _perfTrack_getStateClosure() {
+ var startedScenarios = {};
+ var fireOnceScenarios = {};
+ var disabledScenarios = {};
+ var disabledScenariosByDefault = {};
+ var startTimes = {};
+ var applicationStartTime = null;
+ disabledScenariosByDefault[1318] = true;
+ disabledScenariosByDefault[1319] = true;
+ disabledScenariosByDefault[1320] = true;
+ disabledScenariosByDefault[1321] = true;
+ disabledScenariosByDefault[1322] = true;
+ disabledScenariosByDefault[1712] = true;
+ disabledScenariosByDefault[1713] = true;
+ disabledScenariosByDefault[1711] = true;
+ disabledScenariosByDefault[1582] = true;
+ disabledScenariosByDefault[1583] = true;
+ disabledScenariosByDefault[1591] = true;
+ disabledScenariosByDefault[1592] = true;
+ disabledScenariosByDefault[1593] = true;
+ var actions = {
+ isStarted: function _perfTrack_getState_isStarted(scenarioId, matchKey) {
+ var result = true;
+ var result = startedScenarios.hasOwnProperty(scenarioId);
+ if (result && (matchKey !== undefined))
+ result = startedScenarios[scenarioId].hasOwnProperty(matchKey);
+ return result
+ }, onBegin: function _perfTrack_getState_onBegin(scenarioId, matchKey) {
+ if (!startedScenarios[scenarioId])
+ startedScenarios[scenarioId] = {};
+ if (matchKey !== undefined)
+ startedScenarios[scenarioId][matchKey] = true
+ }, onEnd: function _perfTrack_getState_onEnd(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (startedScenarios[scenarioId])
+ delete startedScenarios[scenarioId][matchKey]
+ }
+ else
+ delete startedScenarios[scenarioId]
+ }, isFiredOnce: function _perfTrack_getState_isFiredOnce(scenarioId, matchKey) {
+ var result = true;
+ var result = fireOnceScenarios.hasOwnProperty(scenarioId);
+ if (result && (matchKey !== undefined))
+ result = fireOnceScenarios[scenarioId].hasOwnProperty(matchKey);
+ return result
+ }, onFiredOnce: function _perfTrack_getState_onFiredOnce(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (!fireOnceScenarios[scenarioId])
+ fireOnceScenarios[scenarioId] = {};
+ fireOnceScenarios[scenarioId][matchKey] = true
+ }
+ else
+ fireOnceScenarios[scenarioId] = true
+ }, isDisabled: function _perfTrack_getState_isDisabled(scenarioId, matchKey) {
+ var result = null;
+ if (matchKey !== undefined) {
+ if (disabledScenarios[scenarioId])
+ result = disabledScenarios[scenarioId][matchKey]
+ }
+ else
+ result = disabledScenarios[scenarioId];
+ if (result === null || result === undefined)
+ result = (disabledScenariosByDefault[scenarioId] || false);
+ return result
+ }, disableScenario: function _perfTrack_getState_disableScenario(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (!disabledScenarios[scenarioId])
+ disabledScenarios[scenarioId] = {};
+ disabledScenarios[scenarioId][matchKey] = true
+ }
+ else
+ disabledScenarios[scenarioId] = true
+ }, enableScenario: function _perfTrack_getState_enableScenario(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (!disabledScenarios[scenarioId])
+ disabledScenarios[scenarioId] = {};
+ disabledScenarios[scenarioId][matchKey] = false
+ }
+ else
+ disabledScenarios[scenarioId] = false
+ }, cleanupDynamicEnabledDisabledFlag: function _perfTrack_getState_cleanupDynamicEnabledDisabledFlag(scenarioId, matchKey) {
+ if (matchKey !== undefined) {
+ if (disabledScenarios[scenarioId])
+ delete disabledScenarios[scenarioId][matchKey]
+ }
+ else
+ delete disabledScenarios[scenarioId]
+ }, setStartTime: function _perfTrack_getState_setStartTime(startPoint, matchKey) {
+ if (startPoint)
+ if (matchKey !== undefined) {
+ if (!startTimes[startPoint])
+ startTimes[startPoint] = {};
+ startTimes[startPoint][matchKey] = new Date
+ }
+ else
+ startTimes[startPoint] = new Date
+ }, deleteStartTime: function _perfTrack_getState_deleteStartTime(startPoint, matchKey) {
+ if (startPoint)
+ if (matchKey !== undefined) {
+ if (startTimes[startPoint])
+ delete startTimes[startPoint][matchKey]
+ }
+ else
+ delete startTimes[startPoint]
+ }, getStartTime: function _perfTrack_getState_getStartTime(startPoint, matchKey) {
+ var result = null;
+ if (startPoint) {
+ if (matchKey !== undefined) {
+ if (startTimes[startPoint])
+ result = startTimes[startPoint][matchKey]
+ }
+ else
+ result = startTimes[startPoint];
+ if (!result)
+ if (startPoint === "AppLaunch")
+ if (applicationStartTime)
+ result = applicationStartTime;
+ else if (PerfTrack && PerfTrack.LaunchInformation && PerfTrack.LaunchInformation.getStartTime) {
+ applicationStartTime = PerfTrack.LaunchInformation.getStartTime();
+ result = applicationStartTime
+ }
+ }
+ return result
+ }, resetStartPoints: function _perfTrack_resetStartPoints() {
+ startTimes = {}
+ }
+ };
+ return function _perfTrack_getStateWorker() {
+ return actions
+ }
+ })(), setStartTime: function _perfTrack_setStartTime(startPoint, matchKey) {
+ var state = MS.Entertainment.Instrumentation.PerfTrack._getState();
+ state.setStartTime(startPoint, matchKey)
+ }, getStartTime: function _perfTrack_getStartTime(startPoint, matchKey) {
+ var state = MS.Entertainment.Instrumentation.PerfTrack._getState();
+ return state.getStartTime(startPoint, matchKey)
+ }, getShellEventProvider: (function _perfTrack_getShellEventProviderClosure() {
+ var eventProvider = null;
+ return function _perfTrack_getShellEventProviderWorker() {
+ if (!eventProvider)
+ eventProvider = new Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ return eventProvider
+ }
+ })(), enableScenarioAppLaunch: function _perfTrack_enableScenarioAppLaunch() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1317)
+ }, disableScenarioAppLaunch: function _perfTrack_disableScenarioAppLaunch() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1317)
+ }, triggerScenarioAppLaunch: function _perfTrack_triggerScenarioAppLaunch(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1317) && !state.isFiredOnce(1317)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchCompleted(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1317, "XBLW-AppLaunch", duration);
+ PT.logTrigger("XBLW-AppLaunch", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1317);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToCollection: function _perfTrack_enableScenarioAppLaunchToCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1318)
+ }, disableScenarioAppLaunchToCollection: function _perfTrack_disableScenarioAppLaunchToCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1318)
+ }, triggerScenarioAppLaunchToCollection: function _perfTrack_triggerScenarioAppLaunchToCollection(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1318) && !state.isFiredOnce(1318)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToCollectionCompleted(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1318, "XBLW-AppLaunchToCollection", duration);
+ PT.logTrigger("XBLW-AppLaunchToCollection", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1318);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchPlayNonProtectedContent: function _perfTrack_enableScenarioAppLaunchPlayNonProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1319)
+ }, disableScenarioAppLaunchPlayNonProtectedContent: function _perfTrack_disableScenarioAppLaunchPlayNonProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1319)
+ }, triggerScenarioAppLaunchPlayNonProtectedContent: function _perfTrack_triggerScenarioAppLaunchPlayNonProtectedContent(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1319) && !state.isFiredOnce(1319)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchPlayNonProtectedContent(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1319, "XBLW-AppLaunchPlayNonProtectedContent", duration);
+ PT.logTrigger("XBLW-AppLaunchPlayNonProtectedContent", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1319);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchPlayProtectedContent: function _perfTrack_enableScenarioAppLaunchPlayProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1320)
+ }, disableScenarioAppLaunchPlayProtectedContent: function _perfTrack_disableScenarioAppLaunchPlayProtectedContent() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1320)
+ }, triggerScenarioAppLaunchPlayProtectedContent: function _perfTrack_triggerScenarioAppLaunchPlayProtectedContent(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1320) && !state.isFiredOnce(1320)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchPlayProtectedContent(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1320, "XBLW-AppLaunchPlayProtectedContent", duration);
+ PT.logTrigger("XBLW-AppLaunchPlayProtectedContent", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1320);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioPlayProtectedInApp: function _perfTrack_enableScenarioPlayProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1321)
+ }, disableScenarioPlayProtectedInApp: function _perfTrack_disableScenarioPlayProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1321)
+ }, triggerScenarioPlayProtectedInApp: function _perfTrack_triggerScenarioPlayProtectedInApp(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1321)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PlayCommand");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PlayProtectedInAppPlaybackStarted(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1321, "XBLW-PlayProtectedInApp", duration);
+ PT.logTrigger("XBLW-PlayProtectedInApp", DurationMsec)
+ }
+ state.deleteStartTime("PlayCommand")
+ }
+ }
+ }, enableScenarioPlayNonProtectedInApp: function _perfTrack_enableScenarioPlayNonProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1322)
+ }, disableScenarioPlayNonProtectedInApp: function _perfTrack_disableScenarioPlayNonProtectedInApp() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1322)
+ }, triggerScenarioPlayNonProtectedInApp: function _perfTrack_triggerScenarioPlayNonProtectedInApp(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1322)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PlayCommand");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PlayNonProtectedInAppPlaybackStarted(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1322, "XBLW-PlayNonProtectedInApp", duration);
+ PT.logTrigger("XBLW-PlayNonProtectedInApp", DurationMsec)
+ }
+ state.deleteStartTime("PlayCommand")
+ }
+ }
+ }, enableScenarioCollectionGalleryRequestToLoad: function _perfTrack_enableScenarioCollectionGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1325)
+ }, disableScenarioCollectionGalleryRequestToLoad: function _perfTrack_disableScenarioCollectionGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1325)
+ }, triggerScenarioCollectionGalleryRequestToLoad: function _perfTrack_triggerScenarioCollectionGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1325)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("CollectionGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_CollectionGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1325, "XBLW-CollectionGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-CollectionGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("CollectionGalleryRequest")
+ }
+ }
+ }, enableScenarioSearchGalleryRequestToLoad: function _perfTrack_enableScenarioSearchGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1326)
+ }, disableScenarioSearchGalleryRequestToLoad: function _perfTrack_disableScenarioSearchGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1326)
+ }, triggerScenarioSearchGalleryRequestToLoad: function _perfTrack_triggerScenarioSearchGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1326)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1326, "XBLW-SearchGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-SearchGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("SearchGalleryRequest")
+ }
+ }
+ }, enableScenarioPopoverRequestToLoad: function _perfTrack_enableScenarioPopoverRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1327)
+ }, disableScenarioPopoverRequestToLoad: function _perfTrack_disableScenarioPopoverRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1327)
+ }, triggerScenarioPopoverRequestToLoad: function _perfTrack_triggerScenarioPopoverRequestToLoad(name, DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1327)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PopoverRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PopoverRequestToLoad(name, DurationMsec);
+ PT.getLogger().writeTriggerEventWithMetadata(1327, "XBLW-PopoverRequestToLoad", duration, 0, 0, 0, 0, 0, PT._truncateString(name), "");
+ PT.logTrigger("XBLW-PopoverRequestToLoad", name, DurationMsec)
+ }
+ state.deleteStartTime("PopoverRequest")
+ }
+ }
+ }, enableScenarioMarketplaceGalleryRequestToLoad: function _perfTrack_enableScenarioMarketplaceGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1333)
+ }, disableScenarioMarketplaceGalleryRequestToLoad: function _perfTrack_disableScenarioMarketplaceGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1333)
+ }, triggerScenarioMarketplaceGalleryRequestToLoad: function _perfTrack_triggerScenarioMarketplaceGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1333)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MarketplaceGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MarketplaceGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1333, "XBLW-MarketplaceGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-MarketplaceGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MarketplaceGalleryRequest")
+ }
+ }
+ }, enableScenarioWebBlendRequestToLoad: function _perfTrack_enableScenarioWebBlendRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1339)
+ }, disableScenarioWebBlendRequestToLoad: function _perfTrack_disableScenarioWebBlendRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1339)
+ }, triggerScenarioWebBlendRequestToLoad: function _perfTrack_triggerScenarioWebBlendRequestToLoad(url, DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1339)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("WebBlendRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_WebBlendRequestToLoad(url, DurationMsec);
+ PT.getLogger().writeTriggerEventWithMetadata(1339, "XBLW-WebBlendRequestToLoad", duration, 0, 0, 0, 0, 0, PT._truncateString(url), "");
+ PT.logTrigger("XBLW-WebBlendRequestToLoad", url, DurationMsec)
+ }
+ state.deleteStartTime("WebBlendRequest")
+ }
+ }
+ }, enableScenarioExplorePageRequestToLoad: function _perfTrack_enableScenarioExplorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1580)
+ }, disableScenarioExplorePageRequestToLoad: function _perfTrack_disableScenarioExplorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1580)
+ }, triggerScenarioExplorePageRequestToLoad: function _perfTrack_triggerScenarioExplorePageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1580)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ExplorePageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ExplorePageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1580, "XBLW-ExplorePageRequestToLoad", duration);
+ PT.logTrigger("XBLW-ExplorePageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ExplorePageRequest")
+ }
+ }
+ }, enableScenarioRadioPageRequestToLoad: function _perfTrack_enableScenarioRadioPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1581)
+ }, disableScenarioRadioPageRequestToLoad: function _perfTrack_disableScenarioRadioPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1581)
+ }, triggerScenarioRadioPageRequestToLoad: function _perfTrack_triggerScenarioRadioPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1581)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("RadioPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_RadioPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1581, "XBLW-RadioPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-RadioPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("RadioPageRequest")
+ }
+ }
+ }, enableScenarioDevicesPageRequestToLoad: function _perfTrack_enableScenarioDevicesPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1674)
+ }, disableScenarioDevicesPageRequestToLoad: function _perfTrack_disableScenarioDevicesPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1674)
+ }, triggerScenarioDevicesPageRequestToLoad: function _perfTrack_triggerScenarioDevicesPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1674)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("DevicesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_DevicesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1674, "XBLW-DevicesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-DevicesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("DevicesPageRequest")
+ }
+ }
+ }, enableScenarioNowPlayingPageRequestToLoad: function _perfTrack_enableScenarioNowPlayingPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1683)
+ }, disableScenarioNowPlayingPageRequestToLoad: function _perfTrack_disableScenarioNowPlayingPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1683)
+ }, triggerScenarioNowPlayingPageRequestToLoad: function _perfTrack_triggerScenarioNowPlayingPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1683)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("NowPlayingPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_NowPlayingPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1683, "XBLW-NowPlayingPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-NowPlayingPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("NowPlayingPageRequest")
+ }
+ }
+ }, enableScenarioMoviesStorePageRequestToLoad: function _perfTrack_enableScenarioMoviesStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1701)
+ }, disableScenarioMoviesStorePageRequestToLoad: function _perfTrack_disableScenarioMoviesStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1701)
+ }, triggerScenarioMoviesStorePageRequestToLoad: function _perfTrack_triggerScenarioMoviesStorePageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1701)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MoviesStorePageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MoviesStorePageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1701, "XBLW-MoviesStorePageRequestToLoad", duration);
+ PT.logTrigger("XBLW-MoviesStorePageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MoviesStorePageRequest")
+ }
+ }
+ }, enableScenarioTvStorePageRequestToLoad: function _perfTrack_enableScenarioTvStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1702)
+ }, disableScenarioTvStorePageRequestToLoad: function _perfTrack_disableScenarioTvStorePageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1702)
+ }, triggerScenarioTvStorePageRequestToLoad: function _perfTrack_triggerScenarioTvStorePageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1702)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TvStorePageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TvStorePageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1702, "XBLW-TvStorePageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TvStorePageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TvStorePageRequest")
+ }
+ }
+ }, enableScenarioVideoCollectionPageRequestToLoad: function _perfTrack_enableScenarioVideoCollectionPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1703)
+ }, disableScenarioVideoCollectionPageRequestToLoad: function _perfTrack_disableScenarioVideoCollectionPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1703)
+ }, triggerScenarioVideoCollectionPageRequestToLoad: function _perfTrack_triggerScenarioVideoCollectionPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1703)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("VideoCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_VideoCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1703, "XBLW-VideoCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-VideoCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("VideoCollectionPageRequest")
+ }
+ }
+ }, enableScenarioAppLaunchToMoviesStore: function _perfTrack_enableScenarioAppLaunchToMoviesStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1712)
+ }, disableScenarioAppLaunchToMoviesStore: function _perfTrack_disableScenarioAppLaunchToMoviesStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1712)
+ }, triggerScenarioAppLaunchToMoviesStore: function _perfTrack_triggerScenarioAppLaunchToMoviesStore(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1712) && !state.isFiredOnce(1712)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToMoviesStore(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1712, "XBLW-AppLaunchToMoviesStore", duration);
+ PT.logTrigger("XBLW-AppLaunchToMoviesStore", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1712);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToTvStore: function _perfTrack_enableScenarioAppLaunchToTvStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1713)
+ }, disableScenarioAppLaunchToTvStore: function _perfTrack_disableScenarioAppLaunchToTvStore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1713)
+ }, triggerScenarioAppLaunchToTvStore: function _perfTrack_triggerScenarioAppLaunchToTvStore(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1713) && !state.isFiredOnce(1713)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToTvStore(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1713, "XBLW-AppLaunchToTvStore", duration);
+ PT.logTrigger("XBLW-AppLaunchToTvStore", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1713);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToVideoCollection: function _perfTrack_enableScenarioAppLaunchToVideoCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1711)
+ }, disableScenarioAppLaunchToVideoCollection: function _perfTrack_disableScenarioAppLaunchToVideoCollection() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1711)
+ }, triggerScenarioAppLaunchToVideoCollection: function _perfTrack_triggerScenarioAppLaunchToVideoCollection(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1711) && !state.isFiredOnce(1711)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToVideoCollection(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1711, "XBLW-AppLaunchToVideoCollection", duration);
+ PT.logTrigger("XBLW-AppLaunchToVideoCollection", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1711);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioMoviesCollectionPageRequest: function _perfTrack_enableScenarioMoviesCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1721)
+ }, disableScenarioMoviesCollectionPageRequest: function _perfTrack_disableScenarioMoviesCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1721)
+ }, triggerScenarioMoviesCollectionPageRequest: function _perfTrack_triggerScenarioMoviesCollectionPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1721)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MoviesCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MoviesCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1721, "XBLW-MoviesCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-MoviesCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MoviesCollectionPageRequest")
+ }
+ }
+ }, enableScenarioTvCollectionPageRequest: function _perfTrack_enableScenarioTvCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1722)
+ }, disableScenarioTvCollectionPageRequest: function _perfTrack_disableScenarioTvCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1722)
+ }, triggerScenarioTvCollectionPageRequest: function _perfTrack_triggerScenarioTvCollectionPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1722)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TvCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TvCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1722, "XBLW-TvCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TvCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TvCollectionPageRequest")
+ }
+ }
+ }, enableScenarioPersonalCollectionPageRequest: function _perfTrack_enableScenarioPersonalCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1723)
+ }, disableScenarioPersonalCollectionPageRequest: function _perfTrack_disableScenarioPersonalCollectionPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1723)
+ }, triggerScenarioPersonalCollectionPageRequest: function _perfTrack_triggerScenarioPersonalCollectionPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1723)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PersonalCollectionPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PersonalCollectionPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1723, "XBLW-PersonalCollectionPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-PersonalCollectionPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("PersonalCollectionPageRequest")
+ }
+ }
+ }, enableScenarioFeaturedMoviesPageRequest: function _perfTrack_enableScenarioFeaturedMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1715)
+ }, disableScenarioFeaturedMoviesPageRequest: function _perfTrack_disableScenarioFeaturedMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1715)
+ }, triggerScenarioFeaturedMoviesPageRequest: function _perfTrack_triggerScenarioFeaturedMoviesPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1715)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("FeaturedMoviesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_FeaturedMoviesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1715, "XBLW-FeaturedMoviesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-FeaturedMoviesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("FeaturedMoviesPageRequest")
+ }
+ }
+ }, enableScenarioNewMoviesPageRequest: function _perfTrack_enableScenarioNewMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1714)
+ }, disableScenarioNewMoviesPageRequest: function _perfTrack_disableScenarioNewMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1714)
+ }, triggerScenarioNewMoviesPageRequest: function _perfTrack_triggerScenarioNewMoviesPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1714)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("NewMoviesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_NewMoviesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1714, "XBLW-NewMoviesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-NewMoviesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("NewMoviesPageRequest")
+ }
+ }
+ }, enableScenarioTopSellingMoviesPageRequest: function _perfTrack_enableScenarioTopSellingMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1716)
+ }, disableScenarioTopSellingMoviesPageRequest: function _perfTrack_disableScenarioTopSellingMoviesPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1716)
+ }, triggerScenarioTopSellingMoviesPageRequest: function _perfTrack_triggerScenarioTopSellingMoviesPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1716)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TopSellingMoviesPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TopSellingMoviesPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1716, "XBLW-TopSellingMoviesPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TopSellingMoviesPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TopSellingMoviesPageRequest")
+ }
+ }
+ }, enableScenarioFeaturedTvPageRequest: function _perfTrack_enableScenarioFeaturedTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1718)
+ }, disableScenarioFeaturedTvPageRequest: function _perfTrack_disableScenarioFeaturedTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1718)
+ }, triggerScenarioFeaturedTvPageRequest: function _perfTrack_triggerScenarioFeaturedTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1718)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("FeaturedTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_FeaturedTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1718, "XBLW-FeaturedTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-FeaturedTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("FeaturedTvPageRequest")
+ }
+ }
+ }, enableScenarioNewTvPageRequest: function _perfTrack_enableScenarioNewTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1717)
+ }, disableScenarioNewTvPageRequest: function _perfTrack_disableScenarioNewTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1717)
+ }, triggerScenarioNewTvPageRequest: function _perfTrack_triggerScenarioNewTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1717)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("NewTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_NewTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1717, "XBLW-NewTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-NewTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("NewTvPageRequest")
+ }
+ }
+ }, enableScenarioLastNightsTvPageRequest: function _perfTrack_enableScenarioLastNightsTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1719)
+ }, disableScenarioLastNightsTvPageRequest: function _perfTrack_disableScenarioLastNightsTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1719)
+ }, triggerScenarioLastNightsTvPageRequest: function _perfTrack_triggerScenarioLastNightsTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1719)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("LastNightsTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_LastNightsTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1719, "XBLW-LastNightsTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-LastNightsTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("LastNightsTvPageRequest")
+ }
+ }
+ }, enableScenarioTopSellingTvPageRequest: function _perfTrack_enableScenarioTopSellingTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1720)
+ }, disableScenarioTopSellingTvPageRequest: function _perfTrack_disableScenarioTopSellingTvPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1720)
+ }, triggerScenarioTopSellingTvPageRequest: function _perfTrack_triggerScenarioTopSellingTvPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1720)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TopSellingTvPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TopSellingTvPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1720, "XBLW-TopSellingTvPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-TopSellingTvPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TopSellingTvPageRequest")
+ }
+ }
+ }, enableScenarioFlexHubPageRequest: function _perfTrack_enableScenarioFlexHubPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1724)
+ }, disableScenarioFlexHubPageRequest: function _perfTrack_disableScenarioFlexHubPageRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1724)
+ }, triggerScenarioFlexHubPageRequest: function _perfTrack_triggerScenarioFlexHubPageRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1724)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("FlexHubPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_FlexHubPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1724, "XBLW-FlexHubPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-FlexHubPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("FlexHubPageRequest")
+ }
+ }
+ }, enableScenarioAppLaunchToExplore: function _perfTrack_enableScenarioAppLaunchToExplore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1582)
+ }, disableScenarioAppLaunchToExplore: function _perfTrack_disableScenarioAppLaunchToExplore() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1582)
+ }, triggerScenarioAppLaunchToExplore: function _perfTrack_triggerScenarioAppLaunchToExplore(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1582) && !state.isFiredOnce(1582)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToExploreComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1582, "XBLW-AppLaunchToExplore", duration);
+ PT.logTrigger("XBLW-AppLaunchToExplore", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1582);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToRadio: function _perfTrack_enableScenarioAppLaunchToRadio() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1583)
+ }, disableScenarioAppLaunchToRadio: function _perfTrack_disableScenarioAppLaunchToRadio() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1583)
+ }, triggerScenarioAppLaunchToRadio: function _perfTrack_triggerScenarioAppLaunchToRadio(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1583) && !state.isFiredOnce(1583)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToRadioComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1583, "XBLW-AppLaunchToRadio", duration);
+ PT.logTrigger("XBLW-AppLaunchToRadio", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1583);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioTVDetailsRequest: function _perfTrack_enableScenarioTVDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1584)
+ }, disableScenarioTVDetailsRequest: function _perfTrack_disableScenarioTVDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1584)
+ }, triggerScenarioTVDetailsRequest: function _perfTrack_triggerScenarioTVDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1584)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("TVDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_TVDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1584, "XBLW-TVDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-TVDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("TVDetailsRequest")
+ }
+ }
+ }, enableScenarioMovieDetailsRequest: function _perfTrack_enableScenarioMovieDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1585)
+ }, disableScenarioMovieDetailsRequest: function _perfTrack_disableScenarioMovieDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1585)
+ }, triggerScenarioMovieDetailsRequest: function _perfTrack_triggerScenarioMovieDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1585)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MovieDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MovieDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1585, "XBLW-MovieDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-MovieDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MovieDetailsRequest")
+ }
+ }
+ }, enableScenarioAlbumDetailsRequest: function _perfTrack_enableScenarioAlbumDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1586)
+ }, disableScenarioAlbumDetailsRequest: function _perfTrack_disableScenarioAlbumDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1586)
+ }, triggerScenarioAlbumDetailsRequest: function _perfTrack_triggerScenarioAlbumDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1586)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AlbumDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AlbumDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1586, "XBLW-AlbumDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-AlbumDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("AlbumDetailsRequest")
+ }
+ }
+ }, enableScenarioArtistDetailsRequest: function _perfTrack_enableScenarioArtistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1587)
+ }, disableScenarioArtistDetailsRequest: function _perfTrack_disableScenarioArtistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1587)
+ }, triggerScenarioArtistDetailsRequest: function _perfTrack_triggerScenarioArtistDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1587)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ArtistDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ArtistDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1587, "XBLW-ArtistDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-ArtistDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ArtistDetailsRequest")
+ }
+ }
+ }, enableScenarioPlaylistDetailsRequest: function _perfTrack_enableScenarioPlaylistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1588)
+ }, disableScenarioPlaylistDetailsRequest: function _perfTrack_disableScenarioPlaylistDetailsRequest() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1588)
+ }, triggerScenarioPlaylistDetailsRequest: function _perfTrack_triggerScenarioPlaylistDetailsRequest(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1588)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("PlaylistDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_PlaylistDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1588, "XBLW-PlaylistDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-PlaylistDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("PlaylistDetailsRequest")
+ }
+ }
+ }, enableScenarioShopBooksPageRequestToLoad: function _perfTrack_enableScenarioShopBooksPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1589)
+ }, disableScenarioShopBooksPageRequestToLoad: function _perfTrack_disableScenarioShopBooksPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1589)
+ }, triggerScenarioShopBooksPageRequestToLoad: function _perfTrack_triggerScenarioShopBooksPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1589)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ShopBooksPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ShopBooksPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1589, "XBLW-ShopBooksPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-ShopBooksPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ShopBooksPageRequest")
+ }
+ }
+ }, enableScenarioShopMagsPageRequestToLoad: function _perfTrack_enableScenarioShopMagsPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1590)
+ }, disableScenarioShopMagsPageRequestToLoad: function _perfTrack_disableScenarioShopMagsPageRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1590)
+ }, triggerScenarioShopMagsPageRequestToLoad: function _perfTrack_triggerScenarioShopMagsPageRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1590)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("ShopMagsPageRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_ShopMagsPageRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1590, "XBLW-ShopMagsPageRequestToLoad", duration);
+ PT.logTrigger("XBLW-ShopMagsPageRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("ShopMagsPageRequest")
+ }
+ }
+ }, enableScenarioAppLaunchToShopBooks: function _perfTrack_enableScenarioAppLaunchToShopBooks() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1591)
+ }, disableScenarioAppLaunchToShopBooks: function _perfTrack_disableScenarioAppLaunchToShopBooks() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1591)
+ }, triggerScenarioAppLaunchToShopBooks: function _perfTrack_triggerScenarioAppLaunchToShopBooks(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1591) && !state.isFiredOnce(1591)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToShopBooksComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1591, "XBLW-AppLaunchToShopBooks", duration);
+ PT.logTrigger("XBLW-AppLaunchToShopBooks", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1591);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToShopMags: function _perfTrack_enableScenarioAppLaunchToShopMags() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1592)
+ }, disableScenarioAppLaunchToShopMags: function _perfTrack_disableScenarioAppLaunchToShopMags() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1592)
+ }, triggerScenarioAppLaunchToShopMags: function _perfTrack_triggerScenarioAppLaunchToShopMags(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1592) && !state.isFiredOnce(1592)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToShopMagsComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1592, "XBLW-AppLaunchToShopMags", duration);
+ PT.logTrigger("XBLW-AppLaunchToShopMags", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1592);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioAppLaunchToOOBEComplete: function _perfTrack_enableScenarioAppLaunchToOOBEComplete() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1593)
+ }, disableScenarioAppLaunchToOOBEComplete: function _perfTrack_disableScenarioAppLaunchToOOBEComplete() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1593)
+ }, triggerScenarioAppLaunchToOOBEComplete: function _perfTrack_triggerScenarioAppLaunchToOOBEComplete(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1593) && !state.isFiredOnce(1593)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("AppLaunch");
+ if (startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_AppLaunchToOOBEComplete(DurationMsec);
+ if (PT.getLogger().writeLaunchStopEvent)
+ PT.getLogger().writeLaunchStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.visibleComplete, MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind);
+ PT.getLogger().writeTriggerEvent(1593, "XBLW-AppLaunchToOOBEComplete", duration);
+ PT.logTrigger("XBLW-AppLaunchToOOBEComplete", DurationMsec);
+ state.deleteStartTime("AppLaunch")
+ }
+ state.onFiredOnce(1593);
+ PT.disableAllStartupScenarios()
+ }
+ }, enableScenarioCategoryGalleryRequestToLoad: function _perfTrack_enableScenarioCategoryGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1594)
+ }, disableScenarioCategoryGalleryRequestToLoad: function _perfTrack_disableScenarioCategoryGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1594)
+ }, triggerScenarioCategoryGalleryRequestToLoad: function _perfTrack_triggerScenarioCategoryGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1594)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("CategoryGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_CategoryGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1594, "XBLW-CategoryGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-CategoryGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("CategoryGalleryRequest")
+ }
+ }
+ }, enableScenarioIssuesGalleryRequestToLoad: function _perfTrack_enableScenarioIssuesGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1595)
+ }, disableScenarioIssuesGalleryRequestToLoad: function _perfTrack_disableScenarioIssuesGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1595)
+ }, triggerScenarioIssuesGalleryRequestToLoad: function _perfTrack_triggerScenarioIssuesGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1595)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("IssuesGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_IssuesGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1595, "XBLW-IssuesGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-IssuesGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("IssuesGalleryRequest")
+ }
+ }
+ }, enableScenarioStandardGalleryRequestToLoad: function _perfTrack_enableScenarioStandardGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1596)
+ }, disableScenarioStandardGalleryRequestToLoad: function _perfTrack_disableScenarioStandardGalleryRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1596)
+ }, triggerScenarioStandardGalleryRequestToLoad: function _perfTrack_triggerScenarioStandardGalleryRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1596)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("StandardGalleryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_StandardGalleryRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1596, "XBLW-StandardGalleryRequestToLoad", duration);
+ PT.logTrigger("XBLW-StandardGalleryRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("StandardGalleryRequest")
+ }
+ }
+ }, enableScenarioBookDetailsRequestToLoad: function _perfTrack_enableScenarioBookDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1597)
+ }, disableScenarioBookDetailsRequestToLoad: function _perfTrack_disableScenarioBookDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1597)
+ }, triggerScenarioBookDetailsRequestToLoad: function _perfTrack_triggerScenarioBookDetailsRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1597)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("BookDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_BookDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1597, "XBLW-BookDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-BookDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("BookDetailsRequest")
+ }
+ }
+ }, enableScenarioMagDetailsRequestToLoad: function _perfTrack_enableScenarioMagDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1598)
+ }, disableScenarioMagDetailsRequestToLoad: function _perfTrack_disableScenarioMagDetailsRequestToLoad() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1598)
+ }, triggerScenarioMagDetailsRequestToLoad: function _perfTrack_triggerScenarioMagDetailsRequestToLoad(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1598)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("MagDetailsRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_MagDetailsRequestToLoad(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1598, "XBLW-MagDetailsRequestToLoad", duration);
+ PT.logTrigger("XBLW-MagDetailsRequestToLoad", DurationMsec)
+ }
+ state.deleteStartTime("MagDetailsRequest")
+ }
+ }
+ }, enableScenarioSearchLibraryRequestToQueryResults: function _perfTrack_enableScenarioSearchLibraryRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1599)
+ }, disableScenarioSearchLibraryRequestToQueryResults: function _perfTrack_disableScenarioSearchLibraryRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1599)
+ }, triggerScenarioSearchLibraryRequestToQueryResults: function _perfTrack_triggerScenarioSearchLibraryRequestToQueryResults(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1599)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchLibraryRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchLibraryRequestToQueryResults(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1599, "XBLW-SearchLibraryRequestToQueryResults", duration);
+ PT.logTrigger("XBLW-SearchLibraryRequestToQueryResults", DurationMsec)
+ }
+ state.deleteStartTime("SearchLibraryRequest")
+ }
+ }
+ }, enableScenarioSearchCatalogRequestToQueryResults: function _perfTrack_enableScenarioSearchCatalogRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1600)
+ }, disableScenarioSearchCatalogRequestToQueryResults: function _perfTrack_disableScenarioSearchCatalogRequestToQueryResults() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1600)
+ }, triggerScenarioSearchCatalogRequestToQueryResults: function _perfTrack_triggerScenarioSearchCatalogRequestToQueryResults(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1600)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchCatalogRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchCatalogRequestToQueryResults(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1600, "XBLW-SearchCatalogRequestToQueryResults", duration);
+ PT.logTrigger("XBLW-SearchCatalogRequestToQueryResults", DurationMsec)
+ }
+ state.deleteStartTime("SearchCatalogRequest")
+ }
+ }
+ }, enableScenarioSearchAutoCompleteResultsReceived: function _perfTrack_enableScenarioSearchAutoCompleteResultsReceived() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1601)
+ }, disableScenarioSearchAutoCompleteResultsReceived: function _perfTrack_disableScenarioSearchAutoCompleteResultsReceived() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1601)
+ }, triggerScenarioSearchAutoCompleteResultsReceived: function _perfTrack_triggerScenarioSearchAutoCompleteResultsReceived(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1601)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("SearchAutoCompleteRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_SearchAutoCompleteResultsReceived(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1601, "XBLW-SearchAutoCompleteResultsReceived", duration);
+ PT.logTrigger("XBLW-SearchAutoCompleteResultsReceived", DurationMsec)
+ }
+ state.deleteStartTime("SearchAutoCompleteRequest")
+ }
+ }
+ }, enableScenarioBNDeviceRegistrationRequestSucceeded: function _perfTrack_enableScenarioBNDeviceRegistrationRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1602)
+ }, disableScenarioBNDeviceRegistrationRequestSucceeded: function _perfTrack_disableScenarioBNDeviceRegistrationRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1602)
+ }, triggerScenarioBNDeviceRegistrationRequestSucceeded: function _perfTrack_triggerScenarioBNDeviceRegistrationRequestSucceeded(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1602)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("BNDeviceRegistrationRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_BNDeviceRegistrationRequestSucceeded(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1602, "XBLW-BNDeviceRegistrationRequestSucceeded", duration);
+ PT.logTrigger("XBLW-BNDeviceRegistrationRequestSucceeded", DurationMsec)
+ }
+ state.deleteStartTime("BNDeviceRegistrationRequest")
+ }
+ }
+ }, enableScenarioBNLoginRequestSucceeded: function _perfTrack_enableScenarioBNLoginRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().enableScenario(1603)
+ }, disableScenarioBNLoginRequestSucceeded: function _perfTrack_disableScenarioBNLoginRequestSucceeded() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().disableScenario(1603)
+ }, triggerScenarioBNLoginRequestSucceeded: function _perfTrack_triggerScenarioBNLoginRequestSucceeded(DurationMsec) {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ var state = PT._getState();
+ if (!state.isDisabled(1603)) {
+ var stopTime = new Date;
+ var startTime = state.getStartTime("BNLoginRequest");
+ if (startTime) {
+ if (stopTime >= startTime) {
+ var duration = ((stopTime >= startTime) ? (stopTime - startTime) : 0);
+ var DurationMsec = duration;
+ PT.getShellEventProvider().tracePerfTrack_Trigger_BNLoginRequestSucceeded(DurationMsec);
+ PT.getLogger().writeTriggerEvent(1603, "XBLW-BNLoginRequestSucceeded", duration);
+ PT.logTrigger("XBLW-BNLoginRequestSucceeded", DurationMsec)
+ }
+ state.deleteStartTime("BNLoginRequest")
+ }
+ }
+ }, disableAllStartupScenarios: function _perfTrack_disableAllStartupScenarios() {
+ var PT = MS.Entertainment.Instrumentation.PerfTrack;
+ PT.disableScenarioAppLaunch();
+ PT.disableScenarioAppLaunchToCollection();
+ PT.disableScenarioAppLaunchPlayNonProtectedContent();
+ PT.disableScenarioAppLaunchPlayProtectedContent();
+ PT.disableScenarioAppLaunchToMoviesStore();
+ PT.disableScenarioAppLaunchToTvStore();
+ PT.disableScenarioAppLaunchToVideoCollection();
+ PT.disableScenarioAppLaunchToExplore();
+ PT.disableScenarioAppLaunchToRadio();
+ PT.disableScenarioAppLaunchToShopBooks();
+ PT.disableScenarioAppLaunchToShopMags();
+ PT.disableScenarioAppLaunchToOOBEComplete()
+ }, onSuspending: function _perfTrack_onSuspending() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().resetStartPoints();
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios()
+ }, onResuming: function _perfTrack_onResuming() {
+ MS.Entertainment.Instrumentation.PerfTrack._getState().resetStartPoints()
+ }
+ })})
+})()
+})();
+/* >>>>>>/framework/commonstringids.js:5871 */
+(function() {
+/////////////////////////////////////////////////////////////////////////////
+//
+// commonStringIds.js
+//
+// This file was generated by the Stringer tool. Do not edit it!
+//
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+(function() {
+
+ String.id = String.id || {}
+
+ String.id.IDS_ACC_BACK_BUTTON = "IDS_ACC_BACK_BUTTON";
+ String.id.IDS_ACC_HOME_BUTTON = "IDS_ACC_HOME_BUTTON";
+ String.id.IDS_ACC_REFRESH_BUTTON = "IDS_ACC_REFRESH_BUTTON";
+ String.id.IDS_ACTIVATION_LIMIT_EXCEEDED_DTO = "IDS_ACTIVATION_LIMIT_EXCEEDED_DTO";
+ String.id.IDS_ADVERTISEMENT = "IDS_ADVERTISEMENT";
+ String.id.IDS_APP1_MODULE_VIEW_ALL = "IDS_APP1_MODULE_VIEW_ALL";
+ String.id.IDS_APP1_MODULE_VIEW_ALL_LABEL = "IDS_APP1_MODULE_VIEW_ALL_LABEL";
+ String.id.IDS_APP2_FILTER_SORTED_BY = "IDS_APP2_FILTER_SORTED_BY";
+ String.id.IDS_APP2_PAGE_TITLE_PRIMARY = "IDS_APP2_PAGE_TITLE_PRIMARY";
+ String.id.IDS_APP2_PAGE_TITLE_PRIMARY_SECONDARY = "IDS_APP2_PAGE_TITLE_PRIMARY_SECONDARY";
+ String.id.IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT = "IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT";
+ String.id.IDS_APP2_PARENTAL_NO_CONTENT_TITLE = "IDS_APP2_PARENTAL_NO_CONTENT_TITLE";
+ String.id.IDS_BETA_TOS_ACCEPT_MESSAGE = "IDS_BETA_TOS_ACCEPT_MESSAGE";
+ String.id.IDS_BETA_TOS_BUTTON_ACCEPT = "IDS_BETA_TOS_BUTTON_ACCEPT";
+ String.id.IDS_BETA_TOS_BUTTON_DECLINE = "IDS_BETA_TOS_BUTTON_DECLINE";
+ String.id.IDS_BETA_TOS_TITLE = "IDS_BETA_TOS_TITLE";
+ String.id.IDS_BROWSE_ACTION_TITLE = "IDS_BROWSE_ACTION_TITLE";
+ String.id.IDS_BUY_BUTTON = "IDS_BUY_BUTTON";
+ String.id.IDS_BUY_BUTTON_VIDEO = "IDS_BUY_BUTTON_VIDEO";
+ String.id.IDS_CANCEL_BUTTON = "IDS_CANCEL_BUTTON";
+ String.id.IDS_CANCEL_BUTTON_TC = "IDS_CANCEL_BUTTON_TC";
+ String.id.IDS_CHILD_AGE_GATING_MESSAGE = "IDS_CHILD_AGE_GATING_MESSAGE";
+ String.id.IDS_CHILD_AGE_GATING_TITLE = "IDS_CHILD_AGE_GATING_TITLE";
+ String.id.IDS_CLEAR_DOWNLOAD_ERROR_BUTTON = "IDS_CLEAR_DOWNLOAD_ERROR_BUTTON";
+ String.id.IDS_CLEAR_SELECTION = "IDS_CLEAR_SELECTION";
+ String.id.IDS_CLOSE_BUTTON = "IDS_CLOSE_BUTTON";
+ String.id.IDS_CLOSE_BUTTON_LC = "IDS_CLOSE_BUTTON_LC";
+ String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE = "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER = "IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER";
+ String.id.IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE = "IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER = "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER";
+ String.id.IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT = "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL = "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE = "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE = "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE = "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE";
+ String.id.IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER = "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER";
+ String.id.IDS_COLLECTION_ALL_VIDEO_EMPTY = "IDS_COLLECTION_ALL_VIDEO_EMPTY";
+ String.id.IDS_COLLECTION_CLOUD_MATCHED_ARIA = "IDS_COLLECTION_CLOUD_MATCHED_ARIA";
+ String.id.IDS_COLLECTION_CLOUD_SYNC_PENDING = "IDS_COLLECTION_CLOUD_SYNC_PENDING";
+ String.id.IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA = "IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA";
+ String.id.IDS_COLLECTION_HEADER_ZOOM_IN = "IDS_COLLECTION_HEADER_ZOOM_IN";
+ String.id.IDS_COLLECTION_HEADER_ZOOM_OUT = "IDS_COLLECTION_HEADER_ZOOM_OUT";
+ String.id.IDS_COLLECTION_IN_CLOUD = "IDS_COLLECTION_IN_CLOUD";
+ String.id.IDS_COLLECTION_IN_CLOUD_FREE = "IDS_COLLECTION_IN_CLOUD_FREE";
+ String.id.IDS_COLLECTION_IN_CLOUD_MATCHED = "IDS_COLLECTION_IN_CLOUD_MATCHED";
+ String.id.IDS_COLLECTION_MOVIE_EMPTY = "IDS_COLLECTION_MOVIE_EMPTY";
+ String.id.IDS_COLLECTION_MOVIE_EMPTY_LINK = "IDS_COLLECTION_MOVIE_EMPTY_LINK";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY = "IDS_COLLECTION_MUSIC_EMPTY";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_2 = "IDS_COLLECTION_MUSIC_EMPTY_2";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK = "IDS_COLLECTION_MUSIC_EMPTY_LINK";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM = "IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM = "IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE = "IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE";
+ String.id.IDS_COLLECTION_MUSIC_EMPTY_TITLE = "IDS_COLLECTION_MUSIC_EMPTY_TITLE";
+ String.id.IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT = "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT";
+ String.id.IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE = "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE";
+ String.id.IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE = "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE";
+ String.id.IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE = "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE";
+ String.id.IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK = "IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK";
+ String.id.IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK = "IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK";
+ String.id.IDS_COLLECTION_MUSIC_SETTINGS_TITLE = "IDS_COLLECTION_MUSIC_SETTINGS_TITLE";
+ String.id.IDS_COLLECTION_NOT_IN_CLOUD = "IDS_COLLECTION_NOT_IN_CLOUD";
+ String.id.IDS_COLLECTION_OPEN_FILES_LINK = "IDS_COLLECTION_OPEN_FILES_LINK";
+ String.id.IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE = "IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE";
+ String.id.IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE = "IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE";
+ String.id.IDS_COLLECTION_PIVOT = "IDS_COLLECTION_PIVOT";
+ String.id.IDS_COLLECTION_PIVOT_TC = "IDS_COLLECTION_PIVOT_TC";
+ String.id.IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD = "IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD";
+ String.id.IDS_COLLECTION_PURCHASES_RESTORE = "IDS_COLLECTION_PURCHASES_RESTORE";
+ String.id.IDS_COLLECTION_PURCHASES_RESTORE_TEXT = "IDS_COLLECTION_PURCHASES_RESTORE_TEXT";
+ String.id.IDS_COLLECTION_SONG_NOT_AVAILABLE = "IDS_COLLECTION_SONG_NOT_AVAILABLE";
+ String.id.IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE = "IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE";
+ String.id.IDS_COLLECTION_STREAMING_FROM_CLOUD = "IDS_COLLECTION_STREAMING_FROM_CLOUD";
+ String.id.IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE = "IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE";
+ String.id.IDS_COLLECTION_THIS_DEVICE_ONLY = "IDS_COLLECTION_THIS_DEVICE_ONLY";
+ String.id.IDS_COLLECTION_TOOLTIP_CLOUD_STATUS = "IDS_COLLECTION_TOOLTIP_CLOUD_STATUS";
+ String.id.IDS_COLLECTION_TOOLTIP_LEARN_MORE = "IDS_COLLECTION_TOOLTIP_LEARN_MORE";
+ String.id.IDS_COLLECTION_TOOLTIP_MATCHED = "IDS_COLLECTION_TOOLTIP_MATCHED";
+ String.id.IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD = "IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD";
+ String.id.IDS_COLLECTION_TOOLTIP_STREAMING = "IDS_COLLECTION_TOOLTIP_STREAMING";
+ String.id.IDS_COLLECTION_TOOLTIP_UNMATCHED = "IDS_COLLECTION_TOOLTIP_UNMATCHED";
+ String.id.IDS_COLLECTION_TV_EMPTY = "IDS_COLLECTION_TV_EMPTY";
+ String.id.IDS_COLLECTION_VIDEO_EMPTY = "IDS_COLLECTION_VIDEO_EMPTY";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY = "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2 = "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE = "IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT = "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT";
+ String.id.IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE = "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE";
+ String.id.IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK = "IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK";
+ String.id.IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK = "IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK";
+ String.id.IDS_COLLECTION_VIDEO_SETTINGS_TITLE = "IDS_COLLECTION_VIDEO_SETTINGS_TITLE";
+ String.id.IDS_COMMA_SEPARATOR = "IDS_COMMA_SEPARATOR";
+ String.id.IDS_COMPANION_HOME_NOW_PLAYING_EMPTY = "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY";
+ String.id.IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE = "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE";
+ String.id.IDS_COMPOSE_MESSAGE_SEND = "IDS_COMPOSE_MESSAGE_SEND";
+ String.id.IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL = "IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL";
+ String.id.IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL = "IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL";
+ String.id.IDS_CONTROLLER_DISMISS_KEYBOARD = "IDS_CONTROLLER_DISMISS_KEYBOARD";
+ String.id.IDS_CONTROLLER_EXCLUSIVE_WARNING = "IDS_CONTROLLER_EXCLUSIVE_WARNING";
+ String.id.IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON = "IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON";
+ String.id.IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE = "IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE";
+ String.id.IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL = "IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL";
+ String.id.IDS_CONTROLLER_INVOKE_KEYBOARD = "IDS_CONTROLLER_INVOKE_KEYBOARD";
+ String.id.IDS_CONTROLLER_SAME_WIRELESS_NETWORK = "IDS_CONTROLLER_SAME_WIRELESS_NETWORK";
+ String.id.IDS_CONTROLLER_SEPARATE_NETWORKS = "IDS_CONTROLLER_SEPARATE_NETWORKS";
+ String.id.IDS_CONTROLLER_SLOW_CONNECTION = "IDS_CONTROLLER_SLOW_CONNECTION";
+ String.id.IDS_CONTROLLER_SLOW_CONNECTION_BUTTON = "IDS_CONTROLLER_SLOW_CONNECTION_BUTTON";
+ String.id.IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO = "IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO";
+ String.id.IDS_CONTROLLER_SWITCHER_BROWSER = "IDS_CONTROLLER_SWITCHER_BROWSER";
+ String.id.IDS_CONTROLLER_SWITCHER_BUTTON = "IDS_CONTROLLER_SWITCHER_BUTTON";
+ String.id.IDS_CONTROLLER_SWITCHER_CONTROLLER = "IDS_CONTROLLER_SWITCHER_CONTROLLER";
+ String.id.IDS_CONTROLLER_SWITCHER_GUIDE = "IDS_CONTROLLER_SWITCHER_GUIDE";
+ String.id.IDS_CONTROLLER_SWITCHER_KEYBOARD = "IDS_CONTROLLER_SWITCHER_KEYBOARD";
+ String.id.IDS_CONTROLLER_TUTORIAL_SWIPE = "IDS_CONTROLLER_TUTORIAL_SWIPE";
+ String.id.IDS_CONTROLLER_TUTORIAL_TAP = "IDS_CONTROLLER_TUTORIAL_TAP";
+ String.id.IDS_CONTROLLER_WEB_HUB_BUTTON = "IDS_CONTROLLER_WEB_HUB_BUTTON";
+ String.id.IDS_CREATEACCOUNT_TITLE = "IDS_CREATEACCOUNT_TITLE";
+ String.id.IDS_DELETE_BUTTON = "IDS_DELETE_BUTTON";
+ String.id.IDS_DELETE_DESCRIPTION_LOCAL_PLURAL = "IDS_DELETE_DESCRIPTION_LOCAL_PLURAL";
+ String.id.IDS_DELETE_DESCRIPTION_LOCAL_SINGLE = "IDS_DELETE_DESCRIPTION_LOCAL_SINGLE";
+ String.id.IDS_DELETE_LABEL = "IDS_DELETE_LABEL";
+ String.id.IDS_DEMO_CONFIGURATION_COMPLETE = "IDS_DEMO_CONFIGURATION_COMPLETE";
+ String.id.IDS_DEMO_IN_DEMO_MODE = "IDS_DEMO_IN_DEMO_MODE";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER = "IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER = "IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_HEADER = "IDS_DEMO_MUSIC_EXPLORE_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1 = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2 = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3 = "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER = "IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER";
+ String.id.IDS_DEMO_MUSIC_EXPLORE_SUBTITLE = "IDS_DEMO_MUSIC_EXPLORE_SUBTITLE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE = "IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE = "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE";
+ String.id.IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE = "IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE";
+ String.id.IDS_DEMO_MUSIC_RADIO_HEADER = "IDS_DEMO_MUSIC_RADIO_HEADER";
+ String.id.IDS_DEMO_MUSIC_RADIO_MESSAGE_1 = "IDS_DEMO_MUSIC_RADIO_MESSAGE_1";
+ String.id.IDS_DEMO_MUSIC_RADIO_MESSAGE_2 = "IDS_DEMO_MUSIC_RADIO_MESSAGE_2";
+ String.id.IDS_DEMO_MUSIC_RADIO_MESSAGE_3 = "IDS_DEMO_MUSIC_RADIO_MESSAGE_3";
+ String.id.IDS_DEMO_MUSIC_RADIO_SUBTITLE = "IDS_DEMO_MUSIC_RADIO_SUBTITLE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE = "IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE = "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE";
+ String.id.IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE = "IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE = "IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE = "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE = "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE = "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF = "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF";
+ String.id.IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON = "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON = "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE = "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE";
+ String.id.IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV = "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV";
+ String.id.IDS_DETAILS_ADD_TO_NOW_PLAYING = "IDS_DETAILS_ADD_TO_NOW_PLAYING";
+ String.id.IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION = "IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION";
+ String.id.IDS_DETAILS_ALL_EPISODES_LABEL = "IDS_DETAILS_ALL_EPISODES_LABEL";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS = "IDS_DETAILS_ARTIST_ALBUMS";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_ALL = "IDS_DETAILS_ARTIST_ALBUMS_ALL";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_ALL_LC = "IDS_DETAILS_ARTIST_ALBUMS_ALL_LC";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_LOCAL = "IDS_DETAILS_ARTIST_ALBUMS_LOCAL";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC = "IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC";
+ String.id.IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL = "IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL";
+ String.id.IDS_DETAILS_AUDIO_LANGUAGE = "IDS_DETAILS_AUDIO_LANGUAGE";
+ String.id.IDS_DETAILS_BUY_ALBUM_LABEL = "IDS_DETAILS_BUY_ALBUM_LABEL";
+ String.id.IDS_DETAILS_BUY_BUNDLE = "IDS_DETAILS_BUY_BUNDLE";
+ String.id.IDS_DETAILS_BUY_EPISODE_LABEL = "IDS_DETAILS_BUY_EPISODE_LABEL";
+ String.id.IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL = "IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL";
+ String.id.IDS_DETAILS_BUY_EXTRA = "IDS_DETAILS_BUY_EXTRA";
+ String.id.IDS_DETAILS_BUY_SEASON_CURRENT_LABEL = "IDS_DETAILS_BUY_SEASON_CURRENT_LABEL";
+ String.id.IDS_DETAILS_BUY_SEASON_LABEL = "IDS_DETAILS_BUY_SEASON_LABEL";
+ String.id.IDS_DETAILS_BUY_SONG_LABEL = "IDS_DETAILS_BUY_SONG_LABEL";
+ String.id.IDS_DETAILS_COLLECTION_ALBUM_COUNT = "IDS_DETAILS_COLLECTION_ALBUM_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL = "IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL";
+ String.id.IDS_DETAILS_COLLECTION_ALBUMS_COUNT = "IDS_DETAILS_COLLECTION_ALBUMS_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_NO_SONGS = "IDS_DETAILS_COLLECTION_NO_SONGS";
+ String.id.IDS_DETAILS_COLLECTION_SONG_COUNT = "IDS_DETAILS_COLLECTION_SONG_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_SONGS_COUNT = "IDS_DETAILS_COLLECTION_SONGS_COUNT";
+ String.id.IDS_DETAILS_COLLECTION_SONGS_PLURAL = "IDS_DETAILS_COLLECTION_SONGS_PLURAL";
+ String.id.IDS_DETAILS_CURRENT_MEDIA_LABEL = "IDS_DETAILS_CURRENT_MEDIA_LABEL";
+ String.id.IDS_DETAILS_DEMO_PURCHASED_LABEL = "IDS_DETAILS_DEMO_PURCHASED_LABEL";
+ String.id.IDS_DETAILS_DESCRIPTION_LABEL = "IDS_DETAILS_DESCRIPTION_LABEL";
+ String.id.IDS_DETAILS_DEVELOPER_LABEL = "IDS_DETAILS_DEVELOPER_LABEL";
+ String.id.IDS_DETAILS_DOWNLOAD_FREE_EXTRA = "IDS_DETAILS_DOWNLOAD_FREE_EXTRA";
+ String.id.IDS_DETAILS_DOWNLOAD_LABEL = "IDS_DETAILS_DOWNLOAD_LABEL";
+ String.id.IDS_DETAILS_DOWNLOAD_LABEL_HD = "IDS_DETAILS_DOWNLOAD_LABEL_HD";
+ String.id.IDS_DETAILS_DOWNLOAD_LABEL_SD = "IDS_DETAILS_DOWNLOAD_LABEL_SD";
+ String.id.IDS_DETAILS_DURATION_HOURS_FORMAT = "IDS_DETAILS_DURATION_HOURS_FORMAT";
+ String.id.IDS_DETAILS_DURATION_LABEL = "IDS_DETAILS_DURATION_LABEL";
+ String.id.IDS_DETAILS_DURATION_MINS_FORMAT = "IDS_DETAILS_DURATION_MINS_FORMAT";
+ String.id.IDS_DETAILS_DURATION_MINSEC_FORMAT = "IDS_DETAILS_DURATION_MINSEC_FORMAT";
+ String.id.IDS_DETAILS_EPISODES_LABEL = "IDS_DETAILS_EPISODES_LABEL";
+ String.id.IDS_DETAILS_EPISODES_LABEL_LC = "IDS_DETAILS_EPISODES_LABEL_LC";
+ String.id.IDS_DETAILS_EPISODES_LABEL_UC = "IDS_DETAILS_EPISODES_LABEL_UC";
+ String.id.IDS_DETAILS_EXPLICIT_LABEL = "IDS_DETAILS_EXPLICIT_LABEL";
+ String.id.IDS_DETAILS_EXPLICIT_LABEL_UC = "IDS_DETAILS_EXPLICIT_LABEL_UC";
+ String.id.IDS_DETAILS_EXTRA_EPISODE_LABEL = "IDS_DETAILS_EXTRA_EPISODE_LABEL";
+ String.id.IDS_DETAILS_EXTRA_EPISODE_LABEL_LC = "IDS_DETAILS_EXTRA_EPISODE_LABEL_LC";
+ String.id.IDS_DETAILS_EXTRA_EPISODE_LABEL_UC = "IDS_DETAILS_EXTRA_EPISODE_LABEL_UC";
+ String.id.IDS_DETAILS_EXTRA_FOR_GAME = "IDS_DETAILS_EXTRA_FOR_GAME";
+ String.id.IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL = "IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL";
+ String.id.IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON = "IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON";
+ String.id.IDS_DETAILS_EXTRA_PURCHASED_LABEL = "IDS_DETAILS_EXTRA_PURCHASED_LABEL";
+ String.id.IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL = "IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL";
+ String.id.IDS_DETAILS_FEATURED_TRAILER_TITLE = "IDS_DETAILS_FEATURED_TRAILER_TITLE";
+ String.id.IDS_DETAILS_FEATURED_WATCH_TRAILER = "IDS_DETAILS_FEATURED_WATCH_TRAILER";
+ String.id.IDS_DETAILS_FILE_OPEN_LABEL = "IDS_DETAILS_FILE_OPEN_LABEL";
+ String.id.IDS_DETAILS_GAME_PURCHASED_LABEL = "IDS_DETAILS_GAME_PURCHASED_LABEL";
+ String.id.IDS_DETAILS_GENRE_LABEL = "IDS_DETAILS_GENRE_LABEL";
+ String.id.IDS_DETAILS_HUB_MUSIC_ALBUMS = "IDS_DETAILS_HUB_MUSIC_ALBUMS";
+ String.id.IDS_DETAILS_HUB_TV_SEASONS = "IDS_DETAILS_HUB_TV_SEASONS";
+ String.id.IDS_DETAILS_INFO_SEPERATOR = "IDS_DETAILS_INFO_SEPERATOR";
+ String.id.IDS_DETAILS_LATEST_EPISODE_LABEL = "IDS_DETAILS_LATEST_EPISODE_LABEL";
+ String.id.IDS_DETAILS_METADATA_SEPERATOR = "IDS_DETAILS_METADATA_SEPERATOR";
+ String.id.IDS_DETAILS_MORE_ACTION = "IDS_DETAILS_MORE_ACTION";
+ String.id.IDS_DETAILS_MY_ALBUMS = "IDS_DETAILS_MY_ALBUMS";
+ String.id.IDS_DETAILS_NETWORK_LABEL = "IDS_DETAILS_NETWORK_LABEL";
+ String.id.IDS_DETAILS_NEW_EPISODE_LABEL = "IDS_DETAILS_NEW_EPISODE_LABEL";
+ String.id.IDS_DETAILS_NOT_RATED_LABEL = "IDS_DETAILS_NOT_RATED_LABEL";
+ String.id.IDS_DETAILS_NOT_RATED_LONG_LABEL = "IDS_DETAILS_NOT_RATED_LONG_LABEL";
+ String.id.IDS_DETAILS_OVERVIEW = "IDS_DETAILS_OVERVIEW";
+ String.id.IDS_DETAILS_PERC_WATCHED_LABEL = "IDS_DETAILS_PERC_WATCHED_LABEL";
+ String.id.IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE = "IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE";
+ String.id.IDS_DETAILS_PLATFORM_LABEL = "IDS_DETAILS_PLATFORM_LABEL";
+ String.id.IDS_DETAILS_PLAY_ALBUM_BUTTON = "IDS_DETAILS_PLAY_ALBUM_BUTTON";
+ String.id.IDS_DETAILS_PLAY_NOW_LABEL = "IDS_DETAILS_PLAY_NOW_LABEL";
+ String.id.IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL = "IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL";
+ String.id.IDS_DETAILS_PLAY_ON_XBOX_LABEL = "IDS_DETAILS_PLAY_ON_XBOX_LABEL";
+ String.id.IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL = "IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL";
+ String.id.IDS_DETAILS_PLAY_SEASON_BUTTON = "IDS_DETAILS_PLAY_SEASON_BUTTON";
+ String.id.IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL = "IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL";
+ String.id.IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL = "IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL";
+ String.id.IDS_DETAILS_PLAY_TRAILER_LABEL = "IDS_DETAILS_PLAY_TRAILER_LABEL";
+ String.id.IDS_DETAILS_PLAYLIST_NO_SONGS = "IDS_DETAILS_PLAYLIST_NO_SONGS";
+ String.id.IDS_DETAILS_PLAYLIST_SONG_COUNT = "IDS_DETAILS_PLAYLIST_SONG_COUNT";
+ String.id.IDS_DETAILS_PLAYLIST_SONGS_COUNT = "IDS_DETAILS_PLAYLIST_SONGS_COUNT";
+ String.id.IDS_DETAILS_PLAYLIST_SONGS_PLURAL = "IDS_DETAILS_PLAYLIST_SONGS_PLURAL";
+ String.id.IDS_DETAILS_PREVIEW_ALBUM_LABEL = "IDS_DETAILS_PREVIEW_ALBUM_LABEL";
+ String.id.IDS_DETAILS_PREVIEW_ARTIST_LABEL = "IDS_DETAILS_PREVIEW_ARTIST_LABEL";
+ String.id.IDS_DETAILS_PREVIEW_EPISODE_LABEL = "IDS_DETAILS_PREVIEW_EPISODE_LABEL";
+ String.id.IDS_DETAILS_PREVIEW_SONG_LABEL = "IDS_DETAILS_PREVIEW_SONG_LABEL";
+ String.id.IDS_DETAILS_PUBLISHER_LABEL = "IDS_DETAILS_PUBLISHER_LABEL";
+ String.id.IDS_DETAILS_QUALITY_LABEL = "IDS_DETAILS_QUALITY_LABEL";
+ String.id.IDS_DETAILS_RATING_LABEL = "IDS_DETAILS_RATING_LABEL";
+ String.id.IDS_DETAILS_RATING_USERRATED = "IDS_DETAILS_RATING_USERRATED";
+ String.id.IDS_DETAILS_RATINGS_PLURAL = "IDS_DETAILS_RATINGS_PLURAL";
+ String.id.IDS_DETAILS_RECENT_ALBUMS = "IDS_DETAILS_RECENT_ALBUMS";
+ String.id.IDS_DETAILS_RELATED_ARTISTS = "IDS_DETAILS_RELATED_ARTISTS";
+ String.id.IDS_DETAILS_RELEASE_DATE_LABEL = "IDS_DETAILS_RELEASE_DATE_LABEL";
+ String.id.IDS_DETAILS_REVIEW_LABEL = "IDS_DETAILS_REVIEW_LABEL";
+ String.id.IDS_DETAILS_SEASONS_LABEL = "IDS_DETAILS_SEASONS_LABEL";
+ String.id.IDS_DETAILS_SHUFFLE_ALL = "IDS_DETAILS_SHUFFLE_ALL";
+ String.id.IDS_DETAILS_SIMILAR_MOVIES = "IDS_DETAILS_SIMILAR_MOVIES";
+ String.id.IDS_DETAILS_SLASH_SEPERATOR = "IDS_DETAILS_SLASH_SEPERATOR";
+ String.id.IDS_DETAILS_START_DOWNLOAD_LABEL = "IDS_DETAILS_START_DOWNLOAD_LABEL";
+ String.id.IDS_DETAILS_STUDIO_LABEL = "IDS_DETAILS_STUDIO_LABEL";
+ String.id.IDS_DETAILS_TITLE_NAR = "IDS_DETAILS_TITLE_NAR";
+ String.id.IDS_DETAILS_TOP_SONGS = "IDS_DETAILS_TOP_SONGS";
+ String.id.IDS_DETAILS_TRACK_NUM_FORMAT = "IDS_DETAILS_TRACK_NUM_FORMAT";
+ String.id.IDS_DETAILS_TRACKS_LABEL = "IDS_DETAILS_TRACKS_LABEL";
+ String.id.IDS_DETAILS_TRY_AGAIN_LABEL = "IDS_DETAILS_TRY_AGAIN_LABEL";
+ String.id.IDS_DETAILS_TRY_AGAIN_LABEL_HD = "IDS_DETAILS_TRY_AGAIN_LABEL_HD";
+ String.id.IDS_DETAILS_TRY_AGAIN_LABEL_SD = "IDS_DETAILS_TRY_AGAIN_LABEL_SD";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS = "IDS_DETAILS_TVSERIES_SEASONS";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS_ALL = "IDS_DETAILS_TVSERIES_SEASONS_ALL";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS_LOCAL = "IDS_DETAILS_TVSERIES_SEASONS_LOCAL";
+ String.id.IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL = "IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL";
+ String.id.IDS_DETAILS_UNRATED_LABEL = "IDS_DETAILS_UNRATED_LABEL";
+ String.id.IDS_DETAILS_UNRATED_LONG_LABEL = "IDS_DETAILS_UNRATED_LONG_LABEL";
+ String.id.IDS_DETAILS_VIDEO_HUB_RELATED = "IDS_DETAILS_VIDEO_HUB_RELATED";
+ String.id.IDS_DETAILS_VIDEO_HUB_RELATED_UC = "IDS_DETAILS_VIDEO_HUB_RELATED_UC";
+ String.id.IDS_DETAILS_VIEW_FULL_APP = "IDS_DETAILS_VIEW_FULL_APP";
+ String.id.IDS_DETAILS_VIEW_FULL_ARTIST = "IDS_DETAILS_VIEW_FULL_ARTIST";
+ String.id.IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR = "IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR";
+ String.id.IDS_DETAILS_VIEW_FULL_GAME = "IDS_DETAILS_VIEW_FULL_GAME";
+ String.id.IDS_DETAILS_VIEW_FULL_MOVIE = "IDS_DETAILS_VIEW_FULL_MOVIE";
+ String.id.IDS_DETAILS_VIEW_FULL_SEASON = "IDS_DETAILS_VIEW_FULL_SEASON";
+ String.id.IDS_DETAILS_VIEW_FULL_SERIES = "IDS_DETAILS_VIEW_FULL_SERIES";
+ String.id.IDS_DETAILS_VIEW_MORE = "IDS_DETAILS_VIEW_MORE";
+ String.id.IDS_DETAILS_WATCH_NOW_LABEL = "IDS_DETAILS_WATCH_NOW_LABEL";
+ String.id.IDS_DETAILS_WATCH_ON_XBOX_LABEL = "IDS_DETAILS_WATCH_ON_XBOX_LABEL";
+ String.id.IDS_DETAILS_WATCH_TRAILER_LABEL = "IDS_DETAILS_WATCH_TRAILER_LABEL";
+ String.id.IDS_DIALOG_ERROR_CODE = "IDS_DIALOG_ERROR_CODE";
+ String.id.IDS_DIALOG_ERROR_FEEDBACKLINK = "IDS_DIALOG_ERROR_FEEDBACKLINK";
+ String.id.IDS_DIALOG_ERROR_MORE_INFO = "IDS_DIALOG_ERROR_MORE_INFO";
+ String.id.IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE = "IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE";
+ String.id.IDS_DIALOG_SESSION_TIMED_OUT_TITLE = "IDS_DIALOG_SESSION_TIMED_OUT_TITLE";
+ String.id.IDS_DIALOG_UNEXPECTED_ERROR_CAPTION = "IDS_DIALOG_UNEXPECTED_ERROR_CAPTION";
+ String.id.IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD = "IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD";
+ String.id.IDS_DOWNLOAD_ERROR_CAPTION = "IDS_DOWNLOAD_ERROR_CAPTION";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL = "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD = "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS = "IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS = "IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS = "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS";
+ String.id.IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD = "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD";
+ String.id.IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER = "IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER";
+ String.id.IDS_DOWNLOAD_LABEL = "IDS_DOWNLOAD_LABEL";
+ String.id.IDS_EDIT_BUTTON = "IDS_EDIT_BUTTON";
+ String.id.IDS_EDITBOX_ERROR_NUMBER = "IDS_EDITBOX_ERROR_NUMBER";
+ String.id.IDS_EDITBOX_REMAINING_PLURAL = "IDS_EDITBOX_REMAINING_PLURAL";
+ String.id.IDS_EMPTY_SYMBOL = "IDS_EMPTY_SYMBOL";
+ String.id.IDS_EMPTY_VIEW = "IDS_EMPTY_VIEW";
+ String.id.IDS_FAILED_PANEL_HEADER = "IDS_FAILED_PANEL_HEADER";
+ String.id.IDS_FAILED_PANEL_LABEL = "IDS_FAILED_PANEL_LABEL";
+ String.id.IDS_FAILED_PANEL_OFFLINE_DESC = "IDS_FAILED_PANEL_OFFLINE_DESC";
+ String.id.IDS_FAILED_PANEL_OFFLINE_HEADER = "IDS_FAILED_PANEL_OFFLINE_HEADER";
+ String.id.IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE = "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE";
+ String.id.IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE = "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE";
+ String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER = "IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER";
+ String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED = "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED";
+ String.id.IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED = "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG";
+ String.id.IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT = "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG = "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT = "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADED = "IDS_FILE_TRANSFER_DOWNLOADED";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC = "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT";
+ String.id.IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL = "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT";
+ String.id.IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT = "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT";
+ String.id.IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG = "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG";
+ String.id.IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT = "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT";
+ String.id.IDS_FILTER_ALL = "IDS_FILTER_ALL";
+ String.id.IDS_FILTER_ALL_GENRES = "IDS_FILTER_ALL_GENRES";
+ String.id.IDS_FILTER_ALL_GENRES_SC = "IDS_FILTER_ALL_GENRES_SC";
+ String.id.IDS_FILTER_ALL_SUBGENRES_SC = "IDS_FILTER_ALL_SUBGENRES_SC";
+ String.id.IDS_FILTER_BY = "IDS_FILTER_BY";
+ String.id.IDS_FILTER_IN = "IDS_FILTER_IN";
+ String.id.IDS_FILTER_SORTED_BY = "IDS_FILTER_SORTED_BY";
+ String.id.IDS_GLOBAL_COMMAND_HELP = "IDS_GLOBAL_COMMAND_HELP";
+ String.id.IDS_GLOBAL_COMMAND_HOME = "IDS_GLOBAL_COMMAND_HOME";
+ String.id.IDS_GLOBAL_COMMAND_NOW_PLAYING = "IDS_GLOBAL_COMMAND_NOW_PLAYING";
+ String.id.IDS_GLOBAL_COMMAND_RESTORE_PURCHASES = "IDS_GLOBAL_COMMAND_RESTORE_PURCHASES";
+ String.id.IDS_GLOBAL_COMMAND_SEARCH = "IDS_GLOBAL_COMMAND_SEARCH";
+ String.id.IDS_HHMMSS_DURATION = "IDS_HHMMSS_DURATION";
+ String.id.IDS_HOME_NOW_PLAYING = "IDS_HOME_NOW_PLAYING";
+ String.id.IDS_HOME_NOW_PLAYING_EPISODE = "IDS_HOME_NOW_PLAYING_EPISODE";
+ String.id.IDS_HOME_NOW_PLAYING_JUMP_IN = "IDS_HOME_NOW_PLAYING_JUMP_IN";
+ String.id.IDS_HOME_NOW_PLAYING_LC = "IDS_HOME_NOW_PLAYING_LC";
+ String.id.IDS_HOME_NOW_PLAYING_RESUME = "IDS_HOME_NOW_PLAYING_RESUME";
+ String.id.IDS_HOME_NOW_PLAYING_RESUME_ARIA = "IDS_HOME_NOW_PLAYING_RESUME_ARIA";
+ String.id.IDS_HOME_NOW_PLAYING_XBOX = "IDS_HOME_NOW_PLAYING_XBOX";
+ String.id.IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED = "IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED";
+ String.id.IDS_HOME_PIVOT = "IDS_HOME_PIVOT";
+ String.id.IDS_HOME_TILE_PAUSED_LABEL = "IDS_HOME_TILE_PAUSED_LABEL";
+ String.id.IDS_LOADING_STATUS_LABEL = "IDS_LOADING_STATUS_LABEL";
+ String.id.IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR = "IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR";
+ String.id.IDS_MANAGE_FOLDERS_DESCRIPTION = "IDS_MANAGE_FOLDERS_DESCRIPTION";
+ String.id.IDS_MANAGE_FOLDERS_DONE_BUTTON = "IDS_MANAGE_FOLDERS_DONE_BUTTON";
+ String.id.IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR = "IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR";
+ String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT = "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT";
+ String.id.IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE = "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE";
+ String.id.IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION = "IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION = "IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION = "IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MUSIC_APP_DESCRIPTION = "IDS_MANIFEST_MUSIC_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_MUSIC_APP_NAME = "IDS_MANIFEST_MUSIC_APP_NAME";
+ String.id.IDS_MANIFEST_TEST_APP_DESCRIPTION = "IDS_MANIFEST_TEST_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_TEST_APP_NAME = "IDS_MANIFEST_TEST_APP_NAME";
+ String.id.IDS_MANIFEST_TEST_APP_SHORT_NAME = "IDS_MANIFEST_TEST_APP_SHORT_NAME";
+ String.id.IDS_MANIFEST_VIDEO_APP_DESCRIPTION = "IDS_MANIFEST_VIDEO_APP_DESCRIPTION";
+ String.id.IDS_MANIFEST_VIDEO_APP_NAME = "IDS_MANIFEST_VIDEO_APP_NAME";
+ String.id.IDS_MARKETPLACE_BY_PLAYRANK = "IDS_MARKETPLACE_BY_PLAYRANK";
+ String.id.IDS_MARKETPLACE_PIVOT = "IDS_MARKETPLACE_PIVOT";
+ String.id.IDS_MARKETPLACE_REGION_EMPTY = "IDS_MARKETPLACE_REGION_EMPTY";
+ String.id.IDS_MARKETPLACE_SORT_BEST_SELLING = "IDS_MARKETPLACE_SORT_BEST_SELLING";
+ String.id.IDS_MARKETPLACE_SORT_CRITIC_RATING = "IDS_MARKETPLACE_SORT_CRITIC_RATING";
+ String.id.IDS_MARKETPLACE_SORT_PLAY_RANK = "IDS_MARKETPLACE_SORT_PLAY_RANK";
+ String.id.IDS_MARKETPLACE_SORT_POPULARITY = "IDS_MARKETPLACE_SORT_POPULARITY";
+ String.id.IDS_MARKETPLACE_SORT_RELEASE_DATE = "IDS_MARKETPLACE_SORT_RELEASE_DATE";
+ String.id.IDS_MARKETPLACE_SORT_SALES_RANK = "IDS_MARKETPLACE_SORT_SALES_RANK";
+ String.id.IDS_MARKETPLACE_SORT_TITLE = "IDS_MARKETPLACE_SORT_TITLE";
+ String.id.IDS_MARKETPLACE_SORT_TOP_RENTED = "IDS_MARKETPLACE_SORT_TOP_RENTED";
+ String.id.IDS_MARKETPLACE_SORT_TOP_SELLING = "IDS_MARKETPLACE_SORT_TOP_SELLING";
+ String.id.IDS_MARKETPLACE_SORT_USER_RATING = "IDS_MARKETPLACE_SORT_USER_RATING";
+ String.id.IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION = "IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION";
+ String.id.IDS_MEDIA_ERROR_CAPTION = "IDS_MEDIA_ERROR_CAPTION";
+ String.id.IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON = "IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON";
+ String.id.IDS_MEDIA_STATUS_DOWNLOADING_ICON = "IDS_MEDIA_STATUS_DOWNLOADING_ICON";
+ String.id.IDS_MEDIA_STATUS_INLINE_STREAMING_ICON = "IDS_MEDIA_STATUS_INLINE_STREAMING_ICON";
+ String.id.IDS_MEDIA_STATUS_NOW_PLAYING_ICON = "IDS_MEDIA_STATUS_NOW_PLAYING_ICON";
+ String.id.IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON = "IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON";
+ String.id.IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON = "IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON";
+ String.id.IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON = "IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON";
+ String.id.IDS_MEDIATYPE_ALBUM = "IDS_MEDIATYPE_ALBUM";
+ String.id.IDS_MEDIATYPE_ARTIST = "IDS_MEDIATYPE_ARTIST";
+ String.id.IDS_MEDIATYPE_GAME = "IDS_MEDIATYPE_GAME";
+ String.id.IDS_MEDIATYPE_GAME_WINDOWS = "IDS_MEDIATYPE_GAME_WINDOWS";
+ String.id.IDS_MEDIATYPE_MOVIE = "IDS_MEDIATYPE_MOVIE";
+ String.id.IDS_MEDIATYPE_PLAYLIST = "IDS_MEDIATYPE_PLAYLIST";
+ String.id.IDS_MEDIATYPE_SONG = "IDS_MEDIATYPE_SONG";
+ String.id.IDS_MEDIATYPE_TVEPISODE = "IDS_MEDIATYPE_TVEPISODE";
+ String.id.IDS_MEDIATYPE_TVSEASON = "IDS_MEDIATYPE_TVSEASON";
+ String.id.IDS_MEDIATYPE_TVSERIES = "IDS_MEDIATYPE_TVSERIES";
+ String.id.IDS_MMSS_DURATION = "IDS_MMSS_DURATION";
+ String.id.IDS_MODIFIER_PREFIX_SORTBY = "IDS_MODIFIER_PREFIX_SORTBY";
+ String.id.IDS_MODIFIER_PREFIX_VIEW = "IDS_MODIFIER_PREFIX_VIEW";
+ String.id.IDS_MODIFIER_PREFIX_VIEWBY = "IDS_MODIFIER_PREFIX_VIEWBY";
+ String.id.IDS_MOGO_NOW_PLAYING = "IDS_MOGO_NOW_PLAYING";
+ String.id.IDS_MOGO_NOW_PLAYING_XBOXMUSIC = "IDS_MOGO_NOW_PLAYING_XBOXMUSIC";
+ String.id.IDS_MOGO_NOW_PLAYING_XBOXVIDEO = "IDS_MOGO_NOW_PLAYING_XBOXVIDEO";
+ String.id.IDS_MOGO_RESUME = "IDS_MOGO_RESUME";
+ String.id.IDS_MOGO_XBOX_MUSIC_XENON = "IDS_MOGO_XBOX_MUSIC_XENON";
+ String.id.IDS_MOGO_XBOX_VIDEO_XENON = "IDS_MOGO_XBOX_VIDEO_XENON";
+ String.id.IDS_MUSIC_ALBUMS_PIVOT = "IDS_MUSIC_ALBUMS_PIVOT";
+ String.id.IDS_MUSIC_ALBUMS_PIVOT_TC = "IDS_MUSIC_ALBUMS_PIVOT_TC";
+ String.id.IDS_MUSIC_APP_TITLE = "IDS_MUSIC_APP_TITLE";
+ String.id.IDS_MUSIC_APP_TITLE_TC = "IDS_MUSIC_APP_TITLE_TC";
+ String.id.IDS_MUSIC_ARTISTS_PIVOT = "IDS_MUSIC_ARTISTS_PIVOT";
+ String.id.IDS_MUSIC_ARTISTS_PIVOT_TC = "IDS_MUSIC_ARTISTS_PIVOT_TC";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK";
+ String.id.IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE = "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL = "IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL = "IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE = "IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE";
+ String.id.IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1 = "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1";
+ String.id.IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2 = "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2";
+ String.id.IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE = "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC = "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC = "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC = "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT = "IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT";
+ String.id.IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE = "IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_INFO_ACTION_DESC = "IDS_MUSIC_CLOUD_INFO_ACTION_DESC";
+ String.id.IDS_MUSIC_CLOUD_INFO_ACTION_TITLE = "IDS_MUSIC_CLOUD_INFO_ACTION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_INFO_DIALOG_BODY = "IDS_MUSIC_CLOUD_INFO_DIALOG_BODY";
+ String.id.IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK = "IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK";
+ String.id.IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE = "IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1 = "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1 = "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG = "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS = "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS";
+ String.id.IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL = "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY = "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY";
+ String.id.IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE = "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1 = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2 = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3 = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3";
+ String.id.IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE = "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE";
+ String.id.IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL = "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL";
+ String.id.IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2 = "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_DESC = "IDS_MUSIC_COLLECTION_EMPTY_DESC";
+ String.id.IDS_MUSIC_COLLECTION_EMPTY_TITLE = "IDS_MUSIC_COLLECTION_EMPTY_TITLE";
+ String.id.IDS_MUSIC_COLLECTION_PIVOT = "IDS_MUSIC_COLLECTION_PIVOT";
+ String.id.IDS_MUSIC_COLLECTION_PIVOT_TC = "IDS_MUSIC_COLLECTION_PIVOT_TC";
+ String.id.IDS_MUSIC_DEVICES_PIVOT = "IDS_MUSIC_DEVICES_PIVOT";
+ String.id.IDS_MUSIC_DEVICES_PIVOT_TC = "IDS_MUSIC_DEVICES_PIVOT_TC";
+ String.id.IDS_MUSIC_EXPLORE_PIVOT = "IDS_MUSIC_EXPLORE_PIVOT";
+ String.id.IDS_MUSIC_EXPLORE_PIVOT_TC = "IDS_MUSIC_EXPLORE_PIVOT_TC";
+ String.id.IDS_MUSIC_FEATURED_PIVOT = "IDS_MUSIC_FEATURED_PIVOT";
+ String.id.IDS_MUSIC_GENRES_PIVOT = "IDS_MUSIC_GENRES_PIVOT";
+ String.id.IDS_MUSIC_LOCATION_DMZ = "IDS_MUSIC_LOCATION_DMZ";
+ String.id.IDS_MUSIC_MARKETPLACE_EMPTY_DESC = "IDS_MUSIC_MARKETPLACE_EMPTY_DESC";
+ String.id.IDS_MUSIC_MARKETPLACE_EMPTY_TITLE = "IDS_MUSIC_MARKETPLACE_EMPTY_TITLE";
+ String.id.IDS_MUSIC_MARKETPLACE_PIVOT = "IDS_MUSIC_MARKETPLACE_PIVOT";
+ String.id.IDS_MUSIC_NEW_RELEASES_PIVOT = "IDS_MUSIC_NEW_RELEASES_PIVOT";
+ String.id.IDS_MUSIC_PIVOT = "IDS_MUSIC_PIVOT";
+ String.id.IDS_MUSIC_RADIO_PIVOT = "IDS_MUSIC_RADIO_PIVOT";
+ String.id.IDS_MUSIC_RADIO_PIVOT_TC = "IDS_MUSIC_RADIO_PIVOT_TC";
+ String.id.IDS_MUSIC_SMARTDJ_PIVOT = "IDS_MUSIC_SMARTDJ_PIVOT";
+ String.id.IDS_MUSIC_SMARTDJ_PIVOT_TC = "IDS_MUSIC_SMARTDJ_PIVOT_TC";
+ String.id.IDS_MUSIC_SONGS_PIVOT_TC = "IDS_MUSIC_SONGS_PIVOT_TC";
+ String.id.IDS_MUSIC_STORE_PIVOT = "IDS_MUSIC_STORE_PIVOT";
+ String.id.IDS_MUSIC_STORE_PIVOT_TC = "IDS_MUSIC_STORE_PIVOT_TC";
+ String.id.IDS_MUSIC_TOP_ALBUMS_PIVOT = "IDS_MUSIC_TOP_ALBUMS_PIVOT";
+ String.id.IDS_MUSIC_VIEW_PLAYLIST = "IDS_MUSIC_VIEW_PLAYLIST";
+ String.id.IDS_MY_MUSIC_BUTTON_DESC = "IDS_MY_MUSIC_BUTTON_DESC";
+ String.id.IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE = "IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE";
+ String.id.IDS_N_FILTER_IN = "IDS_N_FILTER_IN";
+ String.id.IDS_N_SORTED_BY = "IDS_N_SORTED_BY";
+ String.id.IDS_NAV_PANE_HIDE_MENU = "IDS_NAV_PANE_HIDE_MENU";
+ String.id.IDS_NAV_PANE_SHOW_MENU = "IDS_NAV_PANE_SHOW_MENU";
+ String.id.IDS_NETWORK_STATUS_HEADER = "IDS_NETWORK_STATUS_HEADER";
+ String.id.IDS_NETWORK_STATUS_LOCAL_ONLY = "IDS_NETWORK_STATUS_LOCAL_ONLY";
+ String.id.IDS_NETWORK_STATUS_NONE = "IDS_NETWORK_STATUS_NONE";
+ String.id.IDS_NETWORK_STATUS_OVER_THE_LIMIT = "IDS_NETWORK_STATUS_OVER_THE_LIMIT";
+ String.id.IDS_NETWORK_STATUS_ROAMING = "IDS_NETWORK_STATUS_ROAMING";
+ String.id.IDS_NETWORK_STATUS_THROTTLED = "IDS_NETWORK_STATUS_THROTTLED";
+ String.id.IDS_NETWORK_STATUS_UNRESTRICTED = "IDS_NETWORK_STATUS_UNRESTRICTED";
+ String.id.IDS_NEXT_BUTTON = "IDS_NEXT_BUTTON";
+ String.id.IDS_NO_BUTTON = "IDS_NO_BUTTON";
+ String.id.IDS_NOT_AVAILABLE_OFFLINE = "IDS_NOT_AVAILABLE_OFFLINE";
+ String.id.IDS_NOW_PLAYING_DETAILS_BUTTON = "IDS_NOW_PLAYING_DETAILS_BUTTON";
+ String.id.IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION = "IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_ADD_SONG_ACTION = "IDS_NOW_PLAYING_OP_ADD_SONG_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_BIO_ACTION = "IDS_NOW_PLAYING_OP_BIO_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION = "IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_RADIO_ACTION = "IDS_NOW_PLAYING_OP_RADIO_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION = "IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_SHARE_ACTION = "IDS_NOW_PLAYING_OP_SHARE_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_SMARTDJ_ACTION = "IDS_NOW_PLAYING_OP_SMARTDJ_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION = "IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION";
+ String.id.IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION = "IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION";
+ String.id.IDS_NOW_PLAYING_PANEL_TITLE_LC = "IDS_NOW_PLAYING_PANEL_TITLE_LC";
+ String.id.IDS_NOW_PLAYING_PLAYLIST_BUTTON = "IDS_NOW_PLAYING_PLAYLIST_BUTTON";
+ String.id.IDS_NOW_PLAYING_REMOVE_TRACK_ACTION = "IDS_NOW_PLAYING_REMOVE_TRACK_ACTION";
+ String.id.IDS_NUMBER_SYMBOL = "IDS_NUMBER_SYMBOL";
+ String.id.IDS_OK_BUTTON = "IDS_OK_BUTTON";
+ String.id.IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE = "IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE";
+ String.id.IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE = "IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE";
+ String.id.IDS_PIN_TO_START_LINK_ERROR_TEXT = "IDS_PIN_TO_START_LINK_ERROR_TEXT";
+ String.id.IDS_PIN_TO_START_SCREEN_BUTTON = "IDS_PIN_TO_START_SCREEN_BUTTON";
+ String.id.IDS_PLAY_ALL = "IDS_PLAY_ALL";
+ String.id.IDS_PLAY_ALL_DESC = "IDS_PLAY_ALL_DESC";
+ String.id.IDS_PLAY_ALL_LABEL = "IDS_PLAY_ALL_LABEL";
+ String.id.IDS_PLAY_ALL_SHUFFLED = "IDS_PLAY_ALL_SHUFFLED";
+ String.id.IDS_PLAY_BUTTON = "IDS_PLAY_BUTTON";
+ String.id.IDS_PLAY_BUTTON_VIDEO = "IDS_PLAY_BUTTON_VIDEO";
+ String.id.IDS_PLAYBACK_DURATION_PROGRESS = "IDS_PLAYBACK_DURATION_PROGRESS";
+ String.id.IDS_PLAYBACK_ERROR_MESSAGE_TITLE = "IDS_PLAYBACK_ERROR_MESSAGE_TITLE";
+ String.id.IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE = "IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE";
+ String.id.IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE = "IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE";
+ String.id.IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED = "IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED";
+ String.id.IDS_PLAYLIST_BUTTON_DESC = "IDS_PLAYLIST_BUTTON_DESC";
+ String.id.IDS_PROGRESS_NAR = "IDS_PROGRESS_NAR";
+ String.id.IDS_PROVISIONING_ACCEPT_BUTTON = "IDS_PROVISIONING_ACCEPT_BUTTON";
+ String.id.IDS_PROVISIONING_ACCEPTANCE_DESC = "IDS_PROVISIONING_ACCEPTANCE_DESC";
+ String.id.IDS_PROVISIONING_ALREADY_HAVE_BUTTON = "IDS_PROVISIONING_ALREADY_HAVE_BUTTON";
+ String.id.IDS_PROVISIONING_ALREADY_HAVE_DESC = "IDS_PROVISIONING_ALREADY_HAVE_DESC";
+ String.id.IDS_PROVISIONING_CANCEL_BUTTON = "IDS_PROVISIONING_CANCEL_BUTTON";
+ String.id.IDS_PROVISIONING_CHILD_LIST_COMEBACK = "IDS_PROVISIONING_CHILD_LIST_COMEBACK";
+ String.id.IDS_PROVISIONING_CHILD_LIST_SIGNIN = "IDS_PROVISIONING_CHILD_LIST_SIGNIN";
+ String.id.IDS_PROVISIONING_CHILD_LIST_TITLE = "IDS_PROVISIONING_CHILD_LIST_TITLE";
+ String.id.IDS_PROVISIONING_CHILD_LIST_XBOX_LINK = "IDS_PROVISIONING_CHILD_LIST_XBOX_LINK";
+ String.id.IDS_PROVISIONING_CHILD_SUBTITLE = "IDS_PROVISIONING_CHILD_SUBTITLE";
+ String.id.IDS_PROVISIONING_CHILD_TITLE = "IDS_PROVISIONING_CHILD_TITLE";
+ String.id.IDS_PROVISIONING_EXPLANATION = "IDS_PROVISIONING_EXPLANATION";
+ String.id.IDS_PROVISIONING_PRIVACY_LINK = "IDS_PROVISIONING_PRIVACY_LINK";
+ String.id.IDS_PROVISIONING_TITLE = "IDS_PROVISIONING_TITLE";
+ String.id.IDS_PROVISIONING_TOS_LINK = "IDS_PROVISIONING_TOS_LINK";
+ String.id.IDS_PROVISIONING_USER_EMAIL = "IDS_PROVISIONING_USER_EMAIL";
+ String.id.IDS_PURCHASE_ERROR_CAPTION = "IDS_PURCHASE_ERROR_CAPTION";
+ String.id.IDS_PURCHASE_ERROR_MESSAGE = "IDS_PURCHASE_ERROR_MESSAGE";
+ String.id.IDS_PURCHASE_ERROR_MESSAGE_TITLE = "IDS_PURCHASE_ERROR_MESSAGE_TITLE";
+ String.id.IDS_RADIO_ERROR_CAPTION = "IDS_RADIO_ERROR_CAPTION";
+ String.id.IDS_READ_LESS = "IDS_READ_LESS";
+ String.id.IDS_READ_MORE = "IDS_READ_MORE";
+ String.id.IDS_RECENT_LAST_WEEK = "IDS_RECENT_LAST_WEEK";
+ String.id.IDS_RECENT_THIS_MONTH = "IDS_RECENT_THIS_MONTH";
+ String.id.IDS_RECENT_THIS_WEEK = "IDS_RECENT_THIS_WEEK";
+ String.id.IDS_REMOVE_BUTTON = "IDS_REMOVE_BUTTON";
+ String.id.IDS_RENT_BUTTON = "IDS_RENT_BUTTON";
+ String.id.IDS_RESTART_BUTTON = "IDS_RESTART_BUTTON";
+ String.id.IDS_RESUME_BUTTON = "IDS_RESUME_BUTTON";
+ String.id.IDS_SAVE_BUTTON = "IDS_SAVE_BUTTON";
+ String.id.IDS_SEARCH_ALBUMLOCAL_LABEL = "IDS_SEARCH_ALBUMLOCAL_LABEL";
+ String.id.IDS_SEARCH_ALBUMMARKETPLACE_LABEL = "IDS_SEARCH_ALBUMMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL = "IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_ALBUMS_PIVOT_LABEL = "IDS_SEARCH_ALBUMS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_ALBUMS_RESULT_TITLE = "IDS_SEARCH_ALBUMS_RESULT_TITLE";
+ String.id.IDS_SEARCH_ALL_PIVOT_LABEL = "IDS_SEARCH_ALL_PIVOT_LABEL";
+ String.id.IDS_SEARCH_ARTISTLOCAL_LABEL = "IDS_SEARCH_ARTISTLOCAL_LABEL";
+ String.id.IDS_SEARCH_ARTISTMARKETPLACE_LABEL = "IDS_SEARCH_ARTISTMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL = "IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_ARTISTS_PIVOT_LABEL = "IDS_SEARCH_ARTISTS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_ARTISTS_RESULT_TITLE = "IDS_SEARCH_ARTISTS_RESULT_TITLE";
+ String.id.IDS_SEARCH_BUTTON = "IDS_SEARCH_BUTTON";
+ String.id.IDS_SEARCH_FILTER_ALL = "IDS_SEARCH_FILTER_ALL";
+ String.id.IDS_SEARCH_FILTER_COLLECTION = "IDS_SEARCH_FILTER_COLLECTION";
+ String.id.IDS_SEARCH_FILTER_MARKETPLACE = "IDS_SEARCH_FILTER_MARKETPLACE";
+ String.id.IDS_SEARCH_FILTER_MARKETPLACE_VIDEO = "IDS_SEARCH_FILTER_MARKETPLACE_VIDEO";
+ String.id.IDS_SEARCH_HCR_WITH_KEYWORD_NAR = "IDS_SEARCH_HCR_WITH_KEYWORD_NAR";
+ String.id.IDS_SEARCH_INMYVIDEOS_LABEL = "IDS_SEARCH_INMYVIDEOS_LABEL";
+ String.id.IDS_SEARCH_MODIFIER_PIVOT_LABEL = "IDS_SEARCH_MODIFIER_PIVOT_LABEL";
+ String.id.IDS_SEARCH_MOVIELOCAL_LABEL = "IDS_SEARCH_MOVIELOCAL_LABEL";
+ String.id.IDS_SEARCH_MOVIEMARKETPLACE_LABEL = "IDS_SEARCH_MOVIEMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_MUSICHUB_TITLE = "IDS_SEARCH_MUSICHUB_TITLE";
+ String.id.IDS_SEARCH_NORESULT_TITLE = "IDS_SEARCH_NORESULT_TITLE";
+ String.id.IDS_SEARCH_NORESULT_TITLE_TC = "IDS_SEARCH_NORESULT_TITLE_TC";
+ String.id.IDS_SEARCH_NOTSIGNEDIN = "IDS_SEARCH_NOTSIGNEDIN";
+ String.id.IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL = "IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL";
+ String.id.IDS_SEARCH_PIVOT = "IDS_SEARCH_PIVOT";
+ String.id.IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL = "IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_PLAYLISTS_PIVOT_LABEL = "IDS_SEARCH_PLAYLISTS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_RESULT_TITLE = "IDS_SEARCH_RESULT_TITLE";
+ String.id.IDS_SEARCH_RESULT_TITLE_TC = "IDS_SEARCH_RESULT_TITLE_TC";
+ String.id.IDS_SEARCH_SEARCHSTARTED = "IDS_SEARCH_SEARCHSTARTED";
+ String.id.IDS_SEARCH_SONGLOCAL_LABEL = "IDS_SEARCH_SONGLOCAL_LABEL";
+ String.id.IDS_SEARCH_SONGMARKETPLACE_LABEL = "IDS_SEARCH_SONGMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_SONGS_GROUP_HEADER_LABEL = "IDS_SEARCH_SONGS_GROUP_HEADER_LABEL";
+ String.id.IDS_SEARCH_SONGS_PIVOT_LABEL = "IDS_SEARCH_SONGS_PIVOT_LABEL";
+ String.id.IDS_SEARCH_TRACKS_RESULT_TITLE = "IDS_SEARCH_TRACKS_RESULT_TITLE";
+ String.id.IDS_SEARCH_TVSERIESLOCAL_LABEL = "IDS_SEARCH_TVSERIESLOCAL_LABEL";
+ String.id.IDS_SEARCH_TVSERIESMARKETPLACE_LABEL = "IDS_SEARCH_TVSERIESMARKETPLACE_LABEL";
+ String.id.IDS_SEARCH_VIDEOHUB_TITLE = "IDS_SEARCH_VIDEOHUB_TITLE";
+ String.id.IDS_SEE_ALL_BUTTON = "IDS_SEE_ALL_BUTTON";
+ String.id.IDS_SEE_LESS_BUTTON = "IDS_SEE_LESS_BUTTON";
+ String.id.IDS_SEE_MORE_BUTTON = "IDS_SEE_MORE_BUTTON";
+ String.id.IDS_SERVICE_UNAVAILABLE_CAPTION = "IDS_SERVICE_UNAVAILABLE_CAPTION";
+ String.id.IDS_SET_BUTTON = "IDS_SET_BUTTON";
+ String.id.IDS_SETTINGS_ABOUT_ABOUT_ADS = "IDS_SETTINGS_ABOUT_ABOUT_ADS";
+ String.id.IDS_SETTINGS_ABOUT_CODE_CONDUCT = "IDS_SETTINGS_ABOUT_CODE_CONDUCT";
+ String.id.IDS_SETTINGS_ABOUT_DESCRIPTION = "IDS_SETTINGS_ABOUT_DESCRIPTION";
+ String.id.IDS_SETTINGS_ABOUT_LEARN_MORE = "IDS_SETTINGS_ABOUT_LEARN_MORE";
+ String.id.IDS_SETTINGS_ABOUT_ONLINE_CONTENT = "IDS_SETTINGS_ABOUT_ONLINE_CONTENT";
+ String.id.IDS_SETTINGS_ABOUT_PRERELEASE_VERSION = "IDS_SETTINGS_ABOUT_PRERELEASE_VERSION";
+ String.id.IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT = "IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT";
+ String.id.IDS_SETTINGS_ABOUT_SUPPORT = "IDS_SETTINGS_ABOUT_SUPPORT";
+ String.id.IDS_SETTINGS_ABOUT_SUPPORT_WEB_LINK = "IDS_SETTINGS_ABOUT_SUPPORT_WEB_LINK";
+ String.id.IDS_SETTINGS_ABOUT_TITLE = "IDS_SETTINGS_ABOUT_TITLE";
+ String.id.IDS_SETTINGS_ABOUT_TOS = "IDS_SETTINGS_ABOUT_TOS";
+ String.id.IDS_SETTINGS_ABOUT_VERSION_FORMAT = "IDS_SETTINGS_ABOUT_VERSION_FORMAT";
+ String.id.IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC = "IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC = "IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC = "IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_CURRENT_USER = "IDS_SETTINGS_ACCOUNT_CURRENT_USER";
+ String.id.IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC = "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC = "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC = "IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL";
+ String.id.IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH = "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH";
+ String.id.IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC = "IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC = "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC = "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC = "IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_TITLE = "IDS_SETTINGS_ACCOUNT_TITLE";
+ String.id.IDS_SETTINGS_ACCOUNT_TITLE_TC = "IDS_SETTINGS_ACCOUNT_TITLE_TC";
+ String.id.IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC = "IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC";
+ String.id.IDS_SETTINGS_CAPTIONS_AUTO_MUTED = "IDS_SETTINGS_CAPTIONS_AUTO_MUTED";
+ String.id.IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR = "IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR";
+ String.id.IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY = "IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY";
+ String.id.IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR = "IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR";
+ String.id.IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY = "IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY";
+ String.id.IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE = "IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_BLACK = "IDS_SETTINGS_CAPTIONS_COLOR_BLACK";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_BLUE = "IDS_SETTINGS_CAPTIONS_COLOR_BLUE";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_CYAN = "IDS_SETTINGS_CAPTIONS_COLOR_CYAN";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_GREEN = "IDS_SETTINGS_CAPTIONS_COLOR_GREEN";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA = "IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_RED = "IDS_SETTINGS_CAPTIONS_COLOR_RED";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_WHITE = "IDS_SETTINGS_CAPTIONS_COLOR_WHITE";
+ String.id.IDS_SETTINGS_CAPTIONS_COLOR_YELLOW = "IDS_SETTINGS_CAPTIONS_COLOR_YELLOW";
+ String.id.IDS_SETTINGS_CAPTIONS_DEFAULT = "IDS_SETTINGS_CAPTIONS_DEFAULT";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE = "IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED = "IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_DROP = "IDS_SETTINGS_CAPTIONS_EDGE_DROP";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_NONE = "IDS_SETTINGS_CAPTIONS_EDGE_NONE";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_RAISED = "IDS_SETTINGS_CAPTIONS_EDGE_RAISED";
+ String.id.IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED = "IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_CASUAL = "IDS_SETTINGS_CAPTIONS_FONT_CASUAL";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_CURSIVE = "IDS_SETTINGS_CAPTIONS_FONT_CURSIVE";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS = "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF = "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS = "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF = "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS = "IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS";
+ String.id.IDS_SETTINGS_CAPTIONS_FONT_STYLE = "IDS_SETTINGS_CAPTIONS_FONT_STYLE";
+ String.id.IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE = "IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE";
+ String.id.IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT = "IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT";
+ String.id.IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT = "IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT";
+ String.id.IDS_SETTINGS_CAPTIONS_PREVIEW = "IDS_SETTINGS_CAPTIONS_PREVIEW";
+ String.id.IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE = "IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE";
+ String.id.IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT = "IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_100 = "IDS_SETTINGS_CAPTIONS_SIZE_100";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_150 = "IDS_SETTINGS_CAPTIONS_SIZE_150";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_200 = "IDS_SETTINGS_CAPTIONS_SIZE_200";
+ String.id.IDS_SETTINGS_CAPTIONS_SIZE_50 = "IDS_SETTINGS_CAPTIONS_SIZE_50";
+ String.id.IDS_SETTINGS_CAPTIONS_TITLE = "IDS_SETTINGS_CAPTIONS_TITLE";
+ String.id.IDS_SETTINGS_CAPTIONS_WINDOW_COLOR = "IDS_SETTINGS_CAPTIONS_WINDOW_COLOR";
+ String.id.IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY = "IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY";
+ String.id.IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE = "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE";
+ String.id.IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE = "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGMUSIC = "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGVIDEO = "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS = "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_CANCEL = "IDS_SETTINGS_FEEDBACK_CANCEL";
+ String.id.IDS_SETTINGS_FEEDBACK_CANTSIGNIN = "IDS_SETTINGS_FEEDBACK_CANTSIGNIN";
+ String.id.IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS = "IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW = "IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW";
+ String.id.IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION = "IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION";
+ String.id.IDS_SETTINGS_FEEDBACK_CONNECTED = "IDS_SETTINGS_FEEDBACK_CONNECTED";
+ String.id.IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS = "IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT = "IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT";
+ String.id.IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK = "IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK";
+ String.id.IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY = "IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY";
+ String.id.IDS_SETTINGS_FEEDBACK_DESCRIPTION = "IDS_SETTINGS_FEEDBACK_DESCRIPTION";
+ String.id.IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG = "IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG";
+ String.id.IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC = "IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO = "IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY = "IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY";
+ String.id.IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS = "IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_GENERALERRORS = "IDS_SETTINGS_FEEDBACK_GENERALERRORS";
+ String.id.IDS_SETTINGS_FEEDBACK_GHOSTTEXT = "IDS_SETTINGS_FEEDBACK_GHOSTTEXT";
+ String.id.IDS_SETTINGS_FEEDBACK_GREATAPP = "IDS_SETTINGS_FEEDBACK_GREATAPP";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICFORMAT = "IDS_SETTINGS_FEEDBACK_MUSICFORMAT";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS = "IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICMETADATA = "IDS_SETTINGS_FEEDBACK_MUSICMETADATA";
+ String.id.IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS = "IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_NOCONNECTION = "IDS_SETTINGS_FEEDBACK_NOCONNECTION";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE = "IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE = "IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION = "IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE = "IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE";
+ String.id.IDS_SETTINGS_FEEDBACK_OPTION_LIKE = "IDS_SETTINGS_FEEDBACK_OPTION_LIKE";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC = "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO = "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS = "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS = "IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS = "IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_REQUESTCONTENT = "IDS_SETTINGS_FEEDBACK_REQUESTCONTENT";
+ String.id.IDS_SETTINGS_FEEDBACK_SAS_TEXT = "IDS_SETTINGS_FEEDBACK_SAS_TEXT";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC = "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO = "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS = "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_SUBMIT = "IDS_SETTINGS_FEEDBACK_SUBMIT";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION = "IDS_SETTINGS_FEEDBACK_SUGGESTION";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS = "IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS = "IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC = "IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO = "IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC = "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO = "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_SYNC = "IDS_SETTINGS_FEEDBACK_SYNC";
+ String.id.IDS_SETTINGS_FEEDBACK_TITLE = "IDS_SETTINGS_FEEDBACK_TITLE";
+ String.id.IDS_SETTINGS_FEEDBACK_TRAILER = "IDS_SETTINGS_FEEDBACK_TRAILER";
+ String.id.IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS = "IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO = "IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO";
+ String.id.IDS_SETTINGS_FEEDBACK_VIDEOFORMAT = "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT";
+ String.id.IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS = "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_WRONGMUSIC = "IDS_SETTINGS_FEEDBACK_WRONGMUSIC";
+ String.id.IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS = "IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS";
+ String.id.IDS_SETTINGS_FEEDBACK_WRONGVIDEO = "IDS_SETTINGS_FEEDBACK_WRONGVIDEO";
+ String.id.IDS_SETTINGS_FORGET_ME = "IDS_SETTINGS_FORGET_ME";
+ String.id.IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE = "IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE";
+ String.id.IDS_SETTINGS_HELP_TITLE = "IDS_SETTINGS_HELP_TITLE";
+ String.id.IDS_SETTINGS_IMPRINT_LEGAL_LINK_TITLE = "IDS_SETTINGS_IMPRINT_LEGAL_LINK_TITLE";
+ String.id.IDS_SETTINGS_PREFERENCE_ACCOUNT = "IDS_SETTINGS_PREFERENCE_ACCOUNT";
+ String.id.IDS_SETTINGS_PREFERENCE_TITLE = "IDS_SETTINGS_PREFERENCE_TITLE";
+ String.id.IDS_SETTINGS_PROMPT_TOGGLE_TITLE = "IDS_SETTINGS_PROMPT_TOGGLE_TITLE";
+ String.id.IDS_SETTINGS_SWITCH_USER = "IDS_SETTINGS_SWITCH_USER";
+ String.id.IDS_SETTINGS_SWITCH_USER_DESCRIPTION = "IDS_SETTINGS_SWITCH_USER_DESCRIPTION";
+ String.id.IDS_SETTINGS_TITLE = "IDS_SETTINGS_TITLE";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_ALBUM = "IDS_SHARE_EMPTY_MESSAGE_ALBUM";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_ARTIST = "IDS_SHARE_EMPTY_MESSAGE_ARTIST";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_MOVIE = "IDS_SHARE_EMPTY_MESSAGE_MOVIE";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_MUSIC = "IDS_SHARE_EMPTY_MESSAGE_MUSIC";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO = "IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TRACK = "IDS_SHARE_EMPTY_MESSAGE_TRACK";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE = "IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TV_SEASON = "IDS_SHARE_EMPTY_MESSAGE_TV_SEASON";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_TV_SERIES = "IDS_SHARE_EMPTY_MESSAGE_TV_SERIES";
+ String.id.IDS_SHARE_EMPTY_MESSAGE_VIDEO = "IDS_SHARE_EMPTY_MESSAGE_VIDEO";
+ String.id.IDS_SHARE_FILES_MUSIC_DESCRIPTION = "IDS_SHARE_FILES_MUSIC_DESCRIPTION";
+ String.id.IDS_SHARE_FRIEND_REQUEST = "IDS_SHARE_FRIEND_REQUEST";
+ String.id.IDS_SHARE_FRIEND_REQUEST_LINK = "IDS_SHARE_FRIEND_REQUEST_LINK";
+ String.id.IDS_SHARE_GAME_TEXT = "IDS_SHARE_GAME_TEXT";
+ String.id.IDS_SHARE_LEADER_BOARD_TEXT = "IDS_SHARE_LEADER_BOARD_TEXT";
+ String.id.IDS_SHARE_MORE_MICROSOFT_DOT_COM = "IDS_SHARE_MORE_MICROSOFT_DOT_COM";
+ String.id.IDS_SHARE_MORE_XBOX_DOT_COM = "IDS_SHARE_MORE_XBOX_DOT_COM";
+ String.id.IDS_SHARE_MORE_XBOXVIDEO_DOT_COM = "IDS_SHARE_MORE_XBOXVIDEO_DOT_COM";
+ String.id.IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL = "IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL";
+ String.id.IDS_SHARE_MUSIC_CONCATENATION = "IDS_SHARE_MUSIC_CONCATENATION";
+ String.id.IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL = "IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL";
+ String.id.IDS_SHARE_MUSIC_SONG_COUNT_PLURAL = "IDS_SHARE_MUSIC_SONG_COUNT_PLURAL";
+ String.id.IDS_SHARE_PROFILE = "IDS_SHARE_PROFILE";
+ String.id.IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT = "IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT";
+ String.id.IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT = "IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT";
+ String.id.IDS_SHARE_TELL_FRIEND_ADD = "IDS_SHARE_TELL_FRIEND_ADD";
+ String.id.IDS_SHOW_ALL_MODIFIER = "IDS_SHOW_ALL_MODIFIER";
+ String.id.IDS_SHOW_FEATURED_MODIFIER = "IDS_SHOW_FEATURED_MODIFIER";
+ String.id.IDS_SIGNIN_COMPLETE = "IDS_SIGNIN_COMPLETE";
+ String.id.IDS_SIGNIN_ERROR = "IDS_SIGNIN_ERROR";
+ String.id.IDS_SIGNIN_ERROR_CAPTION = "IDS_SIGNIN_ERROR_CAPTION";
+ String.id.IDS_SIGNIN_ERROR_MORE_INFO = "IDS_SIGNIN_ERROR_MORE_INFO";
+ String.id.IDS_SIGNIN_MIXED_REGION_ERROR_DESC = "IDS_SIGNIN_MIXED_REGION_ERROR_DESC";
+ String.id.IDS_SIGNIN_MIXED_REGION_ERROR_TITLE = "IDS_SIGNIN_MIXED_REGION_ERROR_TITLE";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT = "IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE = "IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT = "IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT";
+ String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE = "IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE";
+ String.id.IDS_SIGNIN_PROGRESS = "IDS_SIGNIN_PROGRESS";
+ String.id.IDS_SIGNIN_RETRY = "IDS_SIGNIN_RETRY";
+ String.id.IDS_SMARTDJ_ERROR_CAPTION = "IDS_SMARTDJ_ERROR_CAPTION";
+ String.id.IDS_SNAPPED_DETAILS_OVERVIEW_TITLE = "IDS_SNAPPED_DETAILS_OVERVIEW_TITLE";
+ String.id.IDS_SNAPPED_DETAILS_PLAYLIST_TITLE = "IDS_SNAPPED_DETAILS_PLAYLIST_TITLE";
+ String.id.IDS_SNAPPED_DETAILS_POSTROLL_TITLE = "IDS_SNAPPED_DETAILS_POSTROLL_TITLE";
+ String.id.IDS_SNAPPED_DETAILS_RECOMMEND_LABEL = "IDS_SNAPPED_DETAILS_RECOMMEND_LABEL";
+ String.id.IDS_SNAPPED_DETAILS_REPLAY_LABEL = "IDS_SNAPPED_DETAILS_REPLAY_LABEL";
+ String.id.IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL = "IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL";
+ String.id.IDS_SNAPPED_GO_FULLSCREEN_MESSAGE = "IDS_SNAPPED_GO_FULLSCREEN_MESSAGE";
+ String.id.IDS_SNAPPED_MUSIC_GO_FULLSCREEN_TITLE = "IDS_SNAPPED_MUSIC_GO_FULLSCREEN_TITLE";
+ String.id.IDS_SNAPPED_MUSIC_HEADER = "IDS_SNAPPED_MUSIC_HEADER";
+ String.id.IDS_SNAPPED_MUSIC_UNSNAP_TEXT = "IDS_SNAPPED_MUSIC_UNSNAP_TEXT";
+ String.id.IDS_SNAPPED_VIDEO_GO_FULLSCREEN_TITLE = "IDS_SNAPPED_VIDEO_GO_FULLSCREEN_TITLE";
+ String.id.IDS_SNAPPED_VIDEO_UNSNAP_TEXT = "IDS_SNAPPED_VIDEO_UNSNAP_TEXT";
+ String.id.IDS_SOCIAL_PIVOT = "IDS_SOCIAL_PIVOT";
+ String.id.IDS_SORT_FILTER_CONTROL_ACC_FILTER = "IDS_SORT_FILTER_CONTROL_ACC_FILTER";
+ String.id.IDS_SORT_FILTER_CONTROL_ACC_SORT = "IDS_SORT_FILTER_CONTROL_ACC_SORT";
+ String.id.IDS_SORTED_BY = "IDS_SORTED_BY";
+ String.id.IDS_SWIPE_HORIZONTALLY_TO_SELECT = "IDS_SWIPE_HORIZONTALLY_TO_SELECT";
+ String.id.IDS_SWIPE_VERTICALLY_TO_SELECT = "IDS_SWIPE_VERTICALLY_TO_SELECT";
+ String.id.IDS_TIME_ARIA_ZERO = "IDS_TIME_ARIA_ZERO";
+ String.id.IDS_TIME_DISPLAY_ZERO = "IDS_TIME_DISPLAY_ZERO";
+ String.id.IDS_TITLE_SUBTITLE = "IDS_TITLE_SUBTITLE";
+ String.id.IDS_TOS_ACCEPT_BUTTON = "IDS_TOS_ACCEPT_BUTTON";
+ String.id.IDS_TOS_ACCEPT_CHECKBOX = "IDS_TOS_ACCEPT_CHECKBOX";
+ String.id.IDS_TOS_ACCEPT_ERROR = "IDS_TOS_ACCEPT_ERROR";
+ String.id.IDS_TOS_CANCEL = "IDS_TOS_CANCEL";
+ String.id.IDS_TOS_TEXT_HEADER = "IDS_TOS_TEXT_HEADER";
+ String.id.IDS_TOS_TITLE = "IDS_TOS_TITLE";
+ String.id.IDS_TOS_UPDATE_DESC = "IDS_TOS_UPDATE_DESC";
+ String.id.IDS_TOS_UPDATE_HEADER = "IDS_TOS_UPDATE_HEADER";
+ String.id.IDS_TOUCHPAD_SUBTITLE1 = "IDS_TOUCHPAD_SUBTITLE1";
+ String.id.IDS_TOUCHPAD_SUBTITLE2 = "IDS_TOUCHPAD_SUBTITLE2";
+ String.id.IDS_TOUCHPAD_TITLE = "IDS_TOUCHPAD_TITLE";
+ String.id.IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL = "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE = "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE";
+ String.id.IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON = "IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_MUTE_LABEL = "IDS_TRANSPORT_CONTROLS_MUTE_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_NEXT_BUTTON = "IDS_TRANSPORT_CONTROLS_NEXT_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON = "IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAY_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAY_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON = "IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON = "IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON = "IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON = "IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL = "IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON = "IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON = "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL = "IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON = "IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON = "IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON";
+ String.id.IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL = "IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL";
+ String.id.IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON = "IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON";
+ String.id.IDS_TV_SEASON_NAME = "IDS_TV_SEASON_NAME";
+ String.id.IDS_TV_SEASON_NAME_LC = "IDS_TV_SEASON_NAME_LC";
+ String.id.IDS_UNKNOWN_VALUE = "IDS_UNKNOWN_VALUE";
+ String.id.IDS_UNPIN_FROM_START_SCREEN_BUTTON = "IDS_UNPIN_FROM_START_SCREEN_BUTTON";
+ String.id.IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION = "IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION";
+ String.id.IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT = "IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT";
+ String.id.IDS_VERSION_CHECK_SERVICE_TITLE = "IDS_VERSION_CHECK_SERVICE_TITLE";
+ String.id.IDS_VERSION_CHECK_SIGNIN_TEXT = "IDS_VERSION_CHECK_SIGNIN_TEXT";
+ String.id.IDS_VERSION_CHECK_UPGRADE_CAPTION = "IDS_VERSION_CHECK_UPGRADE_CAPTION";
+ String.id.IDS_VERSION_CHECK_UPGRADE_LINK = "IDS_VERSION_CHECK_UPGRADE_LINK";
+ String.id.IDS_VERSION_CHECK_UPGRADE_TEXT = "IDS_VERSION_CHECK_UPGRADE_TEXT";
+ String.id.IDS_VIDEO_APP_TITLE = "IDS_VIDEO_APP_TITLE";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY = "IDS_VIDEO_COLLECTION_EMPTY";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK = "IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK = "IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK";
+ String.id.IDS_VIDEO_FEATURED_PIVOT = "IDS_VIDEO_FEATURED_PIVOT";
+ String.id.IDS_VIDEO_GENRES_PIVOT = "IDS_VIDEO_GENRES_PIVOT";
+ String.id.IDS_VIDEO_NETWORKS_PIVOT = "IDS_VIDEO_NETWORKS_PIVOT";
+ String.id.IDS_VIDEO_NEW_RELEASES_PIVOT = "IDS_VIDEO_NEW_RELEASES_PIVOT";
+ String.id.IDS_VIDEO_PIVOT = "IDS_VIDEO_PIVOT";
+ String.id.IDS_VIDEO_STUDIOS_PIVOT = "IDS_VIDEO_STUDIOS_PIVOT";
+ String.id.IDS_VIDEO_TOP_SELLING_PIVOT = "IDS_VIDEO_TOP_SELLING_PIVOT";
+ String.id.IDS_VIDEO_TV_FREE_EPISODES_PIVOT = "IDS_VIDEO_TV_FREE_EPISODES_PIVOT";
+ String.id.IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT = "IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT";
+ String.id.IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK = "IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK";
+ String.id.IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK = "IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK";
+ String.id.IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK = "IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK";
+ String.id.IDS_VIEW_ALL = "IDS_VIEW_ALL";
+ String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT = "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT";
+ String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION = "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION";
+ String.id.IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE = "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE";
+ String.id.IDS_WEBHOST_RESIZE_WINDOW_BODY = "IDS_WEBHOST_RESIZE_WINDOW_BODY";
+ String.id.IDS_WEBHOST_RESIZE_WINDOW_TITLE = "IDS_WEBHOST_RESIZE_WINDOW_TITLE";
+ String.id.IDS_WEBHOST_ROTATE_BODY = "IDS_WEBHOST_ROTATE_BODY";
+ String.id.IDS_WEBHOST_ROTATE_OR_RESIZE_BODY = "IDS_WEBHOST_ROTATE_OR_RESIZE_BODY";
+ String.id.IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY = "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY";
+ String.id.IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE = "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE";
+ String.id.IDS_WEBHOST_ROTATE_TITLE = "IDS_WEBHOST_ROTATE_TITLE";
+ String.id.IDS_WHATSNEW_NOTIFICATION_SUBTITLE = "IDS_WHATSNEW_NOTIFICATION_SUBTITLE";
+ String.id.IDS_WHATSNEW_POPUP_LINK = "IDS_WHATSNEW_POPUP_LINK";
+ String.id.IDS_WILD_CARD_SYMBOL = "IDS_WILD_CARD_SYMBOL";
+ String.id.IDS_XBOX_GET_FOR_XBOX = "IDS_XBOX_GET_FOR_XBOX";
+ String.id.IDS_XBOX_MUSIC_APP_TITLE = "IDS_XBOX_MUSIC_APP_TITLE";
+ String.id.IDS_XBOX_MUSIC2_APP_TITLE = "IDS_XBOX_MUSIC2_APP_TITLE";
+ String.id.IDS_XBOX_PLAY_TO_DEVICE = "IDS_XBOX_PLAY_TO_DEVICE";
+ String.id.IDS_XBOX_VIDEO_APP_TITLE = "IDS_XBOX_VIDEO_APP_TITLE";
+ String.id.IDS_XBOX_VIDEO2_APP_TITLE = "IDS_XBOX_VIDEO2_APP_TITLE";
+ String.id.IDS_YES_BUTTON = "IDS_YES_BUTTON";
+
+})();
+})();
+/* >>>>>>/framework/nativestringids.js:6873 */
+(function() {
+/////////////////////////////////////////////////////////////////////////////
+//
+// nativeStringIds.js
+//
+// This file was generated by the Stringer tool. Do not edit it!
+//
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+(function() {
+
+ String.id = String.id || {}
+
+ String.id.IDS_MEDIASTORE_UNKNOWN_TRACK_FORMAT = "101";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ALBUM_FORMAT = "102";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ALBUM_PREFIX = "103";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ARTIST = "104";
+ String.id.IDS_MEDIASTORE_UNKNOWN_TRACK_PREFIX = "105";
+ String.id.IDS_MEDIASTORE_IGNORED_ARTICLE_LIST = "106";
+ String.id.IDS_MEDIASTORE_VARIOUS_ARTISTS = "108";
+ String.id.IDS_MEDIASTORE_UNKNOWN_ALBUM = "109";
+ String.id.IDS_MEDIASTORE_UNKNOWN_GENRE = "110";
+ String.id.IDS_CDMDRCD_FORMAT_STRING = "213";
+ String.id.IDS_SERVICE_UNKNOWNTRACK = "250";
+ String.id.IDS_SERVICE_UNKNOWNARTIST = "251";
+ String.id.IDS_SERVICE_UNKNOWNALBUM = "252";
+ String.id.IDS_SERVICE_FILENAME_FORMAT_NO_DISC = "256";
+ String.id.IDS_SERVICE_FILENAME_FORMAT_WITH_DISC = "257";
+ String.id.IDS_SERVICE_UNKNOWNSERIES = "258";
+ String.id.IDS_SERVICE_UNKNOWNVIDEO = "259";
+ String.id.IDS_SERIES_UNKNOWNSERIES_TITLE = "260";
+ String.id.IDS_SERIES_UNKNOWNSERIES_DESCRIPTION = "261";
+ String.id.IDS_SERIES_GROVELLED_SERIES_DESCRIPTION = "262";
+ String.id.IDS_PLAYLISTFOLDERNAME = "27";
+ String.id.IDS_TEMPORARY_MUSIC_FOLDER_SUFFIX = "30";
+ String.id.IDS_DOWNLOAD_FOLDER_MUSIC = "320";
+ String.id.IDS_DOWNLOAD_FOLDER_TV = "321";
+ String.id.IDS_DOWNLOAD_FOLDER_TV_SHORT = "322";
+ String.id.IDS_DOWNLOAD_FOLDER_FORMAT_TV_SEASON = "323";
+ String.id.IDS_DOWNLOAD_FOLDER_MOVIES = "324";
+ String.id.IDS_DOWNLOAD_FOLDER_SUBSCRIPTION = "325";
+ String.id.IDS_DOWNLOAD_FOLDER_PURCHASES = "326";
+ String.id.IDS_DOWNLOAD_FOLDER_XBOX_MUSIC = "327";
+ String.id.IDS_DOWNLOAD_FOLDER_OFFLINE_CONTENT = "328";
+ String.id.IDS_DOWNLOAD_FOLDER_NAME = "329";
+ String.id.IDS_TITLE_SUBTITLE_NATIVE = "33";
+ String.id.IDS_CHANNEL_PLAYLIST_NAME_FORMAT = "360";
+ String.id.IDS_GENRE_AUDIOBOOK_0 = "361";
+ String.id.IDS_GENRE_AUDIOBOOK_1 = "362";
+ String.id.IDS_GENRE_COMEDY_SPOKEN_WORD = "363";
+ String.id.IDS_GENRE_PODCAST = "364";
+ String.id.IDS_SUBSTRING_KARAOKE = "365";
+ String.id.IDS_UAC_DIALOG_LOG_LEVELS_DESCRIPTION = "5000";
+ String.id.IDS_JUMP_LIST_QUICKMIX_CATEGORY = "607";
+ String.id.IDS_JUMP_LIST_RESUME_NOWPLAYING = "609";
+ String.id.IDS_JUMP_LIST_SHUFFLE_ALL = "610";
+ String.id.IDS_PODCAST_LIBRARY_NAME = "611";
+ String.id.IDS_PODCAST_LIBRARY_DESC = "612";
+ String.id.IDS_PODCAST_LIBRARY_TOOLTIP = "613";
+ String.id.IDS_CONVERSION_CACHE_NAME = "618";
+ String.id.IDS_ONEDRIVE_CACHE_FOLDER_NAME = "619";
+
+})();
+})();
+/* >>>>>>/framework/lockedstringids.js:6940 */
+(function() {
+/////////////////////////////////////////////////////////////////////////////
+//
+// lockedStringIds.js
+//
+// This file was generated by the Stringer tool. Do not edit it!
+//
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+(function() {
+
+ String.id = String.id || {}
+
+
+})();
+})();
+/* >>>>>>/framework/videostringids.js:6959 */
+(function() {
+/////////////////////////////////////////////////////////////////////////////
+//
+// videoStringIds.js
+//
+// This file was generated by the Stringer tool. Do not edit it!
+//
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+(function() {
+
+ String.id = String.id || {}
+
+ String.id.IDS_ALL_VIDEO_COLLECTION_TITLE = "IDS_ALL_VIDEO_COLLECTION_TITLE";
+ String.id.IDS_CHANGE_TV_SEASON_LABEL = "IDS_CHANGE_TV_SEASON_LABEL";
+ String.id.IDS_DIALOG_PURCHASE_DURING_GROVEL_CAPTION = "IDS_DIALOG_PURCHASE_DURING_GROVEL_CAPTION";
+ String.id.IDS_DIALOG_PURCHASE_DURING_GROVEL_TITLE = "IDS_DIALOG_PURCHASE_DURING_GROVEL_TITLE";
+ String.id.IDS_FILTER_ALL_GENRES_2 = "IDS_FILTER_ALL_GENRES_2";
+ String.id.IDS_FILTER_ALL_NETWORKS_LC = "IDS_FILTER_ALL_NETWORKS_LC";
+ String.id.IDS_FILTER_ALL_STUDIOS_LC = "IDS_FILTER_ALL_STUDIOS_LC";
+ String.id.IDS_MARKETPLACE_FEATURED_MOVIES = "IDS_MARKETPLACE_FEATURED_MOVIES";
+ String.id.IDS_MARKETPLACE_FEATURED_TELEVISION = "IDS_MARKETPLACE_FEATURED_TELEVISION";
+ String.id.IDS_MARKETPLACE_FREE_TV = "IDS_MARKETPLACE_FREE_TV";
+ String.id.IDS_MARKETPLACE_LAST_NIGHT_ON_TV = "IDS_MARKETPLACE_LAST_NIGHT_ON_TV";
+ String.id.IDS_MARKETPLACE_MOVIE_FEATURED_LC = "IDS_MARKETPLACE_MOVIE_FEATURED_LC";
+ String.id.IDS_MARKETPLACE_MOVIE_NEW_RELEASE_LC = "IDS_MARKETPLACE_MOVIE_NEW_RELEASE_LC";
+ String.id.IDS_MARKETPLACE_MOVIE_TOP_RATED_LC = "IDS_MARKETPLACE_MOVIE_TOP_RATED_LC";
+ String.id.IDS_MARKETPLACE_MOVIE_TOP_RENTED_LC = "IDS_MARKETPLACE_MOVIE_TOP_RENTED_LC";
+ String.id.IDS_MARKETPLACE_MOVIE_TOP_SALES_LC = "IDS_MARKETPLACE_MOVIE_TOP_SALES_LC";
+ String.id.IDS_MARKETPLACE_NEW_RELEASES = "IDS_MARKETPLACE_NEW_RELEASES";
+ String.id.IDS_MARKETPLACE_SORT_CRITIC_RATING_2 = "IDS_MARKETPLACE_SORT_CRITIC_RATING_2";
+ String.id.IDS_MARKETPLACE_SORT_RELEASE_DATE_2 = "IDS_MARKETPLACE_SORT_RELEASE_DATE_2";
+ String.id.IDS_MARKETPLACE_SORT_TOP_RENTED_2 = "IDS_MARKETPLACE_SORT_TOP_RENTED_2";
+ String.id.IDS_MARKETPLACE_SORT_TOP_SELLING_2 = "IDS_MARKETPLACE_SORT_TOP_SELLING_2";
+ String.id.IDS_MARKETPLACE_SORT_USER_RATING_2 = "IDS_MARKETPLACE_SORT_USER_RATING_2";
+ String.id.IDS_MARKETPLACE_TOP_MOVIE_RENTALS = "IDS_MARKETPLACE_TOP_MOVIE_RENTALS";
+ String.id.IDS_MARKETPLACE_TOP_MOVIE_RENTALS_2 = "IDS_MARKETPLACE_TOP_MOVIE_RENTALS_2";
+ String.id.IDS_MARKETPLACE_TOP_MOVIE_SALES = "IDS_MARKETPLACE_TOP_MOVIE_SALES";
+ String.id.IDS_MARKETPLACE_TOP_MOVIE_SALES_2 = "IDS_MARKETPLACE_TOP_MOVIE_SALES_2";
+ String.id.IDS_MARKETPLACE_TOP_TV_PURCHASES = "IDS_MARKETPLACE_TOP_TV_PURCHASES";
+ String.id.IDS_MARKETPLACE_TOP_VIDEO_SALES = "IDS_MARKETPLACE_TOP_VIDEO_SALES";
+ String.id.IDS_MARKETPLACE_TOP_VIDEO_SALES_2 = "IDS_MARKETPLACE_TOP_VIDEO_SALES_2";
+ String.id.IDS_MARKETPLACE_TV_FEATURED_LC = "IDS_MARKETPLACE_TV_FEATURED_LC";
+ String.id.IDS_MARKETPLACE_TV_NEW_RELEASE_LC = "IDS_MARKETPLACE_TV_NEW_RELEASE_LC";
+ String.id.IDS_MARKETPLACE_TV_TOP_RATED_LC = "IDS_MARKETPLACE_TV_TOP_RATED_LC";
+ String.id.IDS_MARKETPLACE_TV_TOP_SALES_LC = "IDS_MARKETPLACE_TV_TOP_SALES_LC";
+ String.id.IDS_MODIFIER_PREFIX_VIEWBY_2 = "IDS_MODIFIER_PREFIX_VIEWBY_2";
+ String.id.IDS_MOVIE_COLLECTION_TITLE = "IDS_MOVIE_COLLECTION_TITLE";
+ String.id.IDS_MOVIE_HERO_HEADING = "IDS_MOVIE_HERO_HEADING";
+ String.id.IDS_MOVIE_MARKETPLACE_TITLE_LC = "IDS_MOVIE_MARKETPLACE_TITLE_LC";
+ String.id.IDS_MOVIE_MARKETPLACE_TITLE_TC = "IDS_MOVIE_MARKETPLACE_TITLE_TC";
+ String.id.IDS_MOVIE_PLAY_MOVIE_BUTTON = "IDS_MOVIE_PLAY_MOVIE_BUTTON";
+ String.id.IDS_MOVIE_STUDIO_BROWSE_TITLE = "IDS_MOVIE_STUDIO_BROWSE_TITLE";
+ String.id.IDS_OTHER_VIDEO_COLLECTION_TITLE = "IDS_OTHER_VIDEO_COLLECTION_TITLE";
+ String.id.IDS_TV_COLLECTION_TITLE = "IDS_TV_COLLECTION_TITLE";
+ String.id.IDS_TV_DOWNLOAD_SEASON_BUTTON = "IDS_TV_DOWNLOAD_SEASON_BUTTON";
+ String.id.IDS_TV_DOWNLOAD_SEASON_BUTTON_HD = "IDS_TV_DOWNLOAD_SEASON_BUTTON_HD";
+ String.id.IDS_TV_DOWNLOAD_SEASON_BUTTON_SD = "IDS_TV_DOWNLOAD_SEASON_BUTTON_SD";
+ String.id.IDS_TV_EPISODE_LABEL = "IDS_TV_EPISODE_LABEL";
+ String.id.IDS_TV_EPISODE_NAME_NUMBER_FORMAT = "IDS_TV_EPISODE_NAME_NUMBER_FORMAT";
+ String.id.IDS_TV_EPISODES_LABEL = "IDS_TV_EPISODES_LABEL";
+ String.id.IDS_TV_EPISODES_LABEL_PLURAL = "IDS_TV_EPISODES_LABEL_PLURAL";
+ String.id.IDS_TV_MARKETPLACE_TITLE_LC = "IDS_TV_MARKETPLACE_TITLE_LC";
+ String.id.IDS_TV_MARKETPLACE_TITLE_TC = "IDS_TV_MARKETPLACE_TITLE_TC";
+ String.id.IDS_TV_NETWORK_BROWSE_TITLE = "IDS_TV_NETWORK_BROWSE_TITLE";
+ String.id.IDS_TV_NEW_EPISODE_HEADING = "IDS_TV_NEW_EPISODE_HEADING";
+ String.id.IDS_TV_NOEPISODES_LABEL = "IDS_TV_NOEPISODES_LABEL";
+ String.id.IDS_TV_NUMBERED_EPISODE_0_NAME = "IDS_TV_NUMBERED_EPISODE_0_NAME";
+ String.id.IDS_TV_NUMBERED_EPISODE_0_SEASON_NAME = "IDS_TV_NUMBERED_EPISODE_0_SEASON_NAME";
+ String.id.IDS_TV_NUMBERED_EPISODE_NAME = "IDS_TV_NUMBERED_EPISODE_NAME";
+ String.id.IDS_TV_NUMBERED_EPISODE_SEASON_NAME = "IDS_TV_NUMBERED_EPISODE_SEASON_NAME";
+ String.id.IDS_TV_NUMBERED_EPISODE_SEASON_TITLE = "IDS_TV_NUMBERED_EPISODE_SEASON_TITLE";
+ String.id.IDS_TV_OWNED_EPISODES_LABEL = "IDS_TV_OWNED_EPISODES_LABEL";
+ String.id.IDS_TV_OWNED_EPISODES_LABEL_PLURAL = "IDS_TV_OWNED_EPISODES_LABEL_PLURAL";
+ String.id.IDS_TV_PLAY_EPISODE_BUTTON = "IDS_TV_PLAY_EPISODE_BUTTON";
+ String.id.IDS_TV_SEASON_0_NAME = "IDS_TV_SEASON_0_NAME";
+ String.id.IDS_TV_SEASON_0_NAME_LC = "IDS_TV_SEASON_0_NAME_LC";
+ String.id.IDS_TV_SEASON_EXTRAS_HEADING_LC = "IDS_TV_SEASON_EXTRAS_HEADING_LC";
+ String.id.IDS_TV_SEASON_EXTRAS_HEADING_SC = "IDS_TV_SEASON_EXTRAS_HEADING_SC";
+ String.id.IDS_TV_SEASON_EXTRAS_HEADING_UC = "IDS_TV_SEASON_EXTRAS_HEADING_UC";
+ String.id.IDS_TV_SEASONS_LABEL_PLURAL = "IDS_TV_SEASONS_LABEL_PLURAL";
+ String.id.IDS_TV_SERIES_EXTRAS_HEADING = "IDS_TV_SERIES_EXTRAS_HEADING";
+ String.id.IDS_TV_SERIES_EXTRAS_HEADING_LC = "IDS_TV_SERIES_EXTRAS_HEADING_LC";
+ String.id.IDS_TV_SERIES_EXTRAS_HEADING_UC = "IDS_TV_SERIES_EXTRAS_HEADING_UC";
+ String.id.IDS_TV_SERIES_RATING_LABEL = "IDS_TV_SERIES_RATING_LABEL";
+ String.id.IDS_VIDEO_AVAILABLE_OFFLINE = "IDS_VIDEO_AVAILABLE_OFFLINE";
+ String.id.IDS_VIDEO_BUFFERING_SMOOTH = "IDS_VIDEO_BUFFERING_SMOOTH";
+ String.id.IDS_VIDEO_BUNDLE_ITEMS_IN_BUNDLE = "IDS_VIDEO_BUNDLE_ITEMS_IN_BUNDLE";
+ String.id.IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_BUTTON = "IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_BUTTON";
+ String.id.IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_METADATA = "IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_METADATA";
+ String.id.IDS_VIDEO_BUNDLES_DETAILS_BUY_BUTTON = "IDS_VIDEO_BUNDLES_DETAILS_BUY_BUTTON";
+ String.id.IDS_VIDEO_BUNDLES_DETAILS_VIEW_IN_COLLECTION_BUTTON = "IDS_VIDEO_BUNDLES_DETAILS_VIEW_IN_COLLECTION_BUTTON";
+ String.id.IDS_VIDEO_BUNDLES_DISABLED_BUTTON = "IDS_VIDEO_BUNDLES_DISABLED_BUTTON";
+ String.id.IDS_VIDEO_BUNDLES_PRE_PURCHASE_ITEM = "IDS_VIDEO_BUNDLES_PRE_PURCHASE_ITEM";
+ String.id.IDS_VIDEO_CANT_DELETE = "IDS_VIDEO_CANT_DELETE";
+ String.id.IDS_VIDEO_CAST_ACTOR = "IDS_VIDEO_CAST_ACTOR";
+ String.id.IDS_VIDEO_CAST_ACTORS = "IDS_VIDEO_CAST_ACTORS";
+ String.id.IDS_VIDEO_CAST_CREATOR = "IDS_VIDEO_CAST_CREATOR";
+ String.id.IDS_VIDEO_CAST_CREATORS = "IDS_VIDEO_CAST_CREATORS";
+ String.id.IDS_VIDEO_CAST_DIRECTOR = "IDS_VIDEO_CAST_DIRECTOR";
+ String.id.IDS_VIDEO_CAST_DIRECTORS = "IDS_VIDEO_CAST_DIRECTORS";
+ String.id.IDS_VIDEO_CAST_HEADING = "IDS_VIDEO_CAST_HEADING";
+ String.id.IDS_VIDEO_CAST_HEADING_UC = "IDS_VIDEO_CAST_HEADING_UC";
+ String.id.IDS_VIDEO_CAST_WRITER = "IDS_VIDEO_CAST_WRITER";
+ String.id.IDS_VIDEO_CAST_WRITERS = "IDS_VIDEO_CAST_WRITERS";
+ String.id.IDS_VIDEO_COLLECTION_ALPHA_SORT = "IDS_VIDEO_COLLECTION_ALPHA_SORT";
+ String.id.IDS_VIDEO_COLLECTION_ALPHA_SORT_2 = "IDS_VIDEO_COLLECTION_ALPHA_SORT_2";
+ String.id.IDS_VIDEO_COLLECTION_ARTIST_SORT = "IDS_VIDEO_COLLECTION_ARTIST_SORT";
+ String.id.IDS_VIDEO_COLLECTION_DATEADDED_SORT = "IDS_VIDEO_COLLECTION_DATEADDED_SORT";
+ String.id.IDS_VIDEO_COLLECTION_DATEADDED_SORT_2 = "IDS_VIDEO_COLLECTION_DATEADDED_SORT_2";
+ String.id.IDS_VIDEO_COLLECTION_DURATION_SORT = "IDS_VIDEO_COLLECTION_DURATION_SORT";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY_DESC = "IDS_VIDEO_COLLECTION_EMPTY_DESC";
+ String.id.IDS_VIDEO_COLLECTION_EMPTY_TITLE = "IDS_VIDEO_COLLECTION_EMPTY_TITLE";
+ String.id.IDS_VIDEO_COLLECTION_GENRE_SORT = "IDS_VIDEO_COLLECTION_GENRE_SORT";
+ String.id.IDS_VIDEO_COLLECTION_GENRE_SORT_2 = "IDS_VIDEO_COLLECTION_GENRE_SORT_2";
+ String.id.IDS_VIDEO_COLLECTION_MOVIES_PIVOT = "IDS_VIDEO_COLLECTION_MOVIES_PIVOT";
+ String.id.IDS_VIDEO_COLLECTION_MOVIES_PIVOT_UC = "IDS_VIDEO_COLLECTION_MOVIES_PIVOT_UC";
+ String.id.IDS_VIDEO_COLLECTION_PIVOT = "IDS_VIDEO_COLLECTION_PIVOT";
+ String.id.IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT = "IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT";
+ String.id.IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT_2 = "IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT_2";
+ String.id.IDS_VIDEO_COLLECTION_SERIES_EPISODES = "IDS_VIDEO_COLLECTION_SERIES_EPISODES";
+ String.id.IDS_VIDEO_COLLECTION_SERIES_EPISODES_2 = "IDS_VIDEO_COLLECTION_SERIES_EPISODES_2";
+ String.id.IDS_VIDEO_COLLECTION_SERIES_SEASONS = "IDS_VIDEO_COLLECTION_SERIES_SEASONS";
+ String.id.IDS_VIDEO_COLLECTION_SERIES_SEASONS_2 = "IDS_VIDEO_COLLECTION_SERIES_SEASONS_2";
+ String.id.IDS_VIDEO_COLLECTION_SETS_PIVOT_UC = "IDS_VIDEO_COLLECTION_SETS_PIVOT_UC";
+ String.id.IDS_VIDEO_COLLECTION_STUDIO_SORT = "IDS_VIDEO_COLLECTION_STUDIO_SORT";
+ String.id.IDS_VIDEO_COLLECTION_TV_PIVOT = "IDS_VIDEO_COLLECTION_TV_PIVOT";
+ String.id.IDS_VIDEO_COLLECTION_TV_PIVOT_UC = "IDS_VIDEO_COLLECTION_TV_PIVOT_UC";
+ String.id.IDS_VIDEO_COLLECTION_WISHLIST_PIVOT_UC = "IDS_VIDEO_COLLECTION_WISHLIST_PIVOT_UC";
+ String.id.IDS_VIDEO_DASH_FEATURED_SETS_LC = "IDS_VIDEO_DASH_FEATURED_SETS_LC";
+ String.id.IDS_VIDEO_DASH_FEATURED_SETS_UC = "IDS_VIDEO_DASH_FEATURED_SETS_UC";
+ String.id.IDS_VIDEO_DASH_MOVIE_FEATURED_LC = "IDS_VIDEO_DASH_MOVIE_FEATURED_LC";
+ String.id.IDS_VIDEO_DASH_MOVIE_FEATURED_UC = "IDS_VIDEO_DASH_MOVIE_FEATURED_UC";
+ String.id.IDS_VIDEO_DASH_MOVIE_NEW_LC = "IDS_VIDEO_DASH_MOVIE_NEW_LC";
+ String.id.IDS_VIDEO_DASH_MOVIE_NEW_UC = "IDS_VIDEO_DASH_MOVIE_NEW_UC";
+ String.id.IDS_VIDEO_DASH_SPOTIGHT_UC = "IDS_VIDEO_DASH_SPOTIGHT_UC";
+ String.id.IDS_VIDEO_DASH_TV_FEATURED_LC = "IDS_VIDEO_DASH_TV_FEATURED_LC";
+ String.id.IDS_VIDEO_DASH_TV_FEATURED_UC = "IDS_VIDEO_DASH_TV_FEATURED_UC";
+ String.id.IDS_VIDEO_DASH_TV_NEW_LC = "IDS_VIDEO_DASH_TV_NEW_LC";
+ String.id.IDS_VIDEO_DASH_TV_NEW_UC = "IDS_VIDEO_DASH_TV_NEW_UC";
+ String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC = "IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC";
+ String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE = "IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE";
+ String.id.IDS_VIDEO_DELETE_SERIES_BUTTON = "IDS_VIDEO_DELETE_SERIES_BUTTON";
+ String.id.IDS_VIDEO_DETAILS_COMMERCE_HEADER_FORMAT = "IDS_VIDEO_DETAILS_COMMERCE_HEADER_FORMAT";
+ String.id.IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASE_SC = "IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASE_SC";
+ String.id.IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASED_SC = "IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASED_SC";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_DOWNLOAD_TIME_DISCLAIMER = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_DOWNLOAD_TIME_DISCLAIMER";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD_SIMPLE = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD_SIMPLE";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_NEVER_SHOW = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_NEVER_SHOW";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_HD = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_HD";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT_SHORT = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT_SHORT";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_QUESTION = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_QUESTION";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD_SHORT = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD_SHORT";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_TITLE = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_TITLE";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD_SIMPLE = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD_SIMPLE";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_GB = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_GB";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_HOURS = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_HOURS";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_MB = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_MB";
+ String.id.IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_TITLE = "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_TITLE";
+ String.id.IDS_VIDEO_DOWNLOAD_COMPLETE = "IDS_VIDEO_DOWNLOAD_COMPLETE";
+ String.id.IDS_VIDEO_DOWNLOAD_ERROR = "IDS_VIDEO_DOWNLOAD_ERROR";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL = "IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL_ALL = "IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL_ALL";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_CLOSE = "IDS_VIDEO_DOWNLOAD_MANAGER_CLOSE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_COMPLETE = "IDS_VIDEO_DOWNLOAD_MANAGER_COMPLETE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_COPYING = "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_NOT_COMPLETE = "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_NOT_COMPLETE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_SLOW = "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_SLOW";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_STAY = "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_STAY";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_DONE = "IDS_VIDEO_DOWNLOAD_MANAGER_DONE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_GB_SIZE = "IDS_VIDEO_DOWNLOAD_MANAGER_GB_SIZE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_LINK = "IDS_VIDEO_DOWNLOAD_MANAGER_LINK";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_MB_SIZE = "IDS_VIDEO_DOWNLOAD_MANAGER_MB_SIZE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_NO_DOWNLOADS = "IDS_VIDEO_DOWNLOAD_MANAGER_NO_DOWNLOADS";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_NO_TEMP_SPACE = "IDS_VIDEO_DOWNLOAD_MANAGER_NO_TEMP_SPACE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE = "IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE_ALL = "IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE_ALL";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_PENDING = "IDS_VIDEO_DOWNLOAD_MANAGER_PENDING";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_LONG = "IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_LONG";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_SHORT = "IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_SHORT";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_RESUME = "IDS_VIDEO_DOWNLOAD_MANAGER_RESUME";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_RESUME_All = "IDS_VIDEO_DOWNLOAD_MANAGER_RESUME_All";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_RETRY = "IDS_VIDEO_DOWNLOAD_MANAGER_RETRY";
+ String.id.IDS_VIDEO_DOWNLOAD_MANAGER_TITLE = "IDS_VIDEO_DOWNLOAD_MANAGER_TITLE";
+ String.id.IDS_VIDEO_DOWNLOAD_MORE_INFO = "IDS_VIDEO_DOWNLOAD_MORE_INFO";
+ String.id.IDS_VIDEO_DOWNLOAD_NOTIFICATION = "IDS_VIDEO_DOWNLOAD_NOTIFICATION";
+ String.id.IDS_VIDEO_DOWNLOAD_PAUSED = "IDS_VIDEO_DOWNLOAD_PAUSED";
+ String.id.IDS_VIDEO_DOWNLOAD_PROGRESS_ITEMS_PLURAL = "IDS_VIDEO_DOWNLOAD_PROGRESS_ITEMS_PLURAL";
+ String.id.IDS_VIDEO_DOWNLOAD_SLOWED_ON_BATTERY = "IDS_VIDEO_DOWNLOAD_SLOWED_ON_BATTERY";
+ String.id.IDS_VIDEO_DOWNLOAD_TO_WATCH_OFFLINE = "IDS_VIDEO_DOWNLOAD_TO_WATCH_OFFLINE";
+ String.id.IDS_VIDEO_FIND_SOMETHING_TO_PLAY = "IDS_VIDEO_FIND_SOMETHING_TO_PLAY";
+ String.id.IDS_VIDEO_GET_FOR_XBOX360 = "IDS_VIDEO_GET_FOR_XBOX360";
+ String.id.IDS_VIDEO_GET_FOR_XBOX360_APPBAR = "IDS_VIDEO_GET_FOR_XBOX360_APPBAR";
+ String.id.IDS_VIDEO_IN_COLLECTION_LABEL = "IDS_VIDEO_IN_COLLECTION_LABEL";
+ String.id.IDS_VIDEO_ITEM_CAN_ONLY_BE_STREAMED = "IDS_VIDEO_ITEM_CAN_ONLY_BE_STREAMED";
+ String.id.IDS_VIDEO_ITEM_CANT_BE_STREAMED_DOWNLOAD_FIRST = "IDS_VIDEO_ITEM_CANT_BE_STREAMED_DOWNLOAD_FIRST";
+ String.id.IDS_VIDEO_ITEM_PURCHASED_IN_OTHER_REGION = "IDS_VIDEO_ITEM_PURCHASED_IN_OTHER_REGION";
+ String.id.IDS_VIDEO_ITEM_UNAVAILABLE_BETWEEN = "IDS_VIDEO_ITEM_UNAVAILABLE_BETWEEN";
+ String.id.IDS_VIDEO_MAKE_SURE_FILE_ISNT_IN_USE_READONLY = "IDS_VIDEO_MAKE_SURE_FILE_ISNT_IN_USE_READONLY";
+ String.id.IDS_VIDEO_MARKETPLACE_EMPTY_DESC = "IDS_VIDEO_MARKETPLACE_EMPTY_DESC";
+ String.id.IDS_VIDEO_MARKETPLACE_EMPTY_TITLE = "IDS_VIDEO_MARKETPLACE_EMPTY_TITLE";
+ String.id.IDS_VIDEO_MARKETPLACE_TITLE_LC = "IDS_VIDEO_MARKETPLACE_TITLE_LC";
+ String.id.IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE1 = "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE1";
+ String.id.IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE2 = "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE2";
+ String.id.IDS_VIDEO_MOVIE_RENTAL_DIALOG_DOWNLOAD_OPTION = "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DOWNLOAD_OPTION";
+ String.id.IDS_VIDEO_MOVIE_RENTAL_DIALOG_STREAMING_OPTION = "IDS_VIDEO_MOVIE_RENTAL_DIALOG_STREAMING_OPTION";
+ String.id.IDS_VIDEO_MOVIE_RENTAL_DIALOG_TITLE = "IDS_VIDEO_MOVIE_RENTAL_DIALOG_TITLE";
+ String.id.IDS_VIDEO_NEW_SEASON_NOTIFICATION = "IDS_VIDEO_NEW_SEASON_NOTIFICATION";
+ String.id.IDS_VIDEO_NOW_PLAYING = "IDS_VIDEO_NOW_PLAYING";
+ String.id.IDS_VIDEO_ON_BATTERY = "IDS_VIDEO_ON_BATTERY";
+ String.id.IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_KNOWN = "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_KNOWN";
+ String.id.IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_UNKNOWN = "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_UNKNOWN";
+ String.id.IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DAYS_PLURAL = "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DAYS_PLURAL";
+ String.id.IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_HOURS_PLURAL = "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_HOURS_PLURAL";
+ String.id.IDS_VIDEO_PREPURCHASE_DETAILS_BUY = "IDS_VIDEO_PREPURCHASE_DETAILS_BUY";
+ String.id.IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_KNOWN = "IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_KNOWN";
+ String.id.IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_UNKNOWN = "IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_UNKNOWN";
+ String.id.IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_KNOWN = "IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_KNOWN";
+ String.id.IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_UNKNOWN = "IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_UNKNOWN";
+ String.id.IDS_VIDEO_PREVIEW_BROWSE_BUTTON = "IDS_VIDEO_PREVIEW_BROWSE_BUTTON";
+ String.id.IDS_VIDEO_PREVIEW_BUY_RENT_BUTTON = "IDS_VIDEO_PREVIEW_BUY_RENT_BUTTON";
+ String.id.IDS_VIDEO_PREVIEW_NOT_AVAILABLE = "IDS_VIDEO_PREVIEW_NOT_AVAILABLE";
+ String.id.IDS_VIDEO_PRICE_FREE = "IDS_VIDEO_PRICE_FREE";
+ String.id.IDS_VIDEO_PRICE_FREE_WITH_ADS = "IDS_VIDEO_PRICE_FREE_WITH_ADS";
+ String.id.IDS_VIDEO_PRICE_HD = "IDS_VIDEO_PRICE_HD";
+ String.id.IDS_VIDEO_PRICE_HD_SD = "IDS_VIDEO_PRICE_HD_SD";
+ String.id.IDS_VIDEO_PRICE_ON_SALE = "IDS_VIDEO_PRICE_ON_SALE";
+ String.id.IDS_VIDEO_PRICE_PERCENT_OFF = "IDS_VIDEO_PRICE_PERCENT_OFF";
+ String.id.IDS_VIDEO_PRICE_SD = "IDS_VIDEO_PRICE_SD";
+ String.id.IDS_VIDEO_PRICE_STARTING_FROM = "IDS_VIDEO_PRICE_STARTING_FROM";
+ String.id.IDS_VIDEO_PRICE_SWITCH_HD = "IDS_VIDEO_PRICE_SWITCH_HD";
+ String.id.IDS_VIDEO_PRICE_SWITCH_SD = "IDS_VIDEO_PRICE_SWITCH_SD";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_BUTTON = "IDS_VIDEO_PURCHASE_OPTIONS_BUTTON";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_BUY = "IDS_VIDEO_PURCHASE_OPTIONS_BUY";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_AUDIO_LANGUAGE = "IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_AUDIO_LANGUAGE";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_LANGUAGE = "IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_LANGUAGE";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_HD = "IDS_VIDEO_PURCHASE_OPTIONS_HD";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_LANGUAGE = "IDS_VIDEO_PURCHASE_OPTIONS_LANGUAGE";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_QUALITY = "IDS_VIDEO_PURCHASE_OPTIONS_QUALITY";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_RENT = "IDS_VIDEO_PURCHASE_OPTIONS_RENT";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_SD = "IDS_VIDEO_PURCHASE_OPTIONS_SD";
+ String.id.IDS_VIDEO_PURCHASE_OPTIONS_TITLE = "IDS_VIDEO_PURCHASE_OPTIONS_TITLE";
+ String.id.IDS_VIDEO_PURCHASED_LABEL = "IDS_VIDEO_PURCHASED_LABEL";
+ String.id.IDS_VIDEO_RECOMMEND_ALL_LC = "IDS_VIDEO_RECOMMEND_ALL_LC";
+ String.id.IDS_VIDEO_RECOMMEND_ALL_SC = "IDS_VIDEO_RECOMMEND_ALL_SC";
+ String.id.IDS_VIDEO_RECOMMEND_EMPTY_GALLERIES = "IDS_VIDEO_RECOMMEND_EMPTY_GALLERIES";
+ String.id.IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_LC = "IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_LC";
+ String.id.IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_SC = "IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_SC";
+ String.id.IDS_VIDEO_RECOMMEND_MOVIES_LC = "IDS_VIDEO_RECOMMEND_MOVIES_LC";
+ String.id.IDS_VIDEO_RECOMMEND_MOVIES_TITLE_TC = "IDS_VIDEO_RECOMMEND_MOVIES_TITLE_TC";
+ String.id.IDS_VIDEO_RECOMMEND_NOT_INTERESTED_LC = "IDS_VIDEO_RECOMMEND_NOT_INTERESTED_LC";
+ String.id.IDS_VIDEO_RECOMMEND_NOT_INTERESTED_TC = "IDS_VIDEO_RECOMMEND_NOT_INTERESTED_TC";
+ String.id.IDS_VIDEO_RECOMMEND_TITLE_LC = "IDS_VIDEO_RECOMMEND_TITLE_LC";
+ String.id.IDS_VIDEO_RECOMMEND_TITLE_TC = "IDS_VIDEO_RECOMMEND_TITLE_TC";
+ String.id.IDS_VIDEO_RECOMMEND_TITLE_UC = "IDS_VIDEO_RECOMMEND_TITLE_UC";
+ String.id.IDS_VIDEO_RECOMMEND_TV_DROPDOWN_LC = "IDS_VIDEO_RECOMMEND_TV_DROPDOWN_LC";
+ String.id.IDS_VIDEO_RECOMMEND_TV_DROPDOWN_SC = "IDS_VIDEO_RECOMMEND_TV_DROPDOWN_SC";
+ String.id.IDS_VIDEO_RECOMMEND_TV_LC = "IDS_VIDEO_RECOMMEND_TV_LC";
+ String.id.IDS_VIDEO_RECOMMEND_TV_TITLE_TC = "IDS_VIDEO_RECOMMEND_TV_TITLE_TC";
+ String.id.IDS_VIDEO_RECOMMENDED = "IDS_VIDEO_RECOMMENDED";
+ String.id.IDS_VIDEO_RENTAL_EXPIRED = "IDS_VIDEO_RENTAL_EXPIRED";
+ String.id.IDS_VIDEO_RENTAL_EXPIRED_ONLY = "IDS_VIDEO_RENTAL_EXPIRED_ONLY";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_AT = "IDS_VIDEO_RENTAL_EXPIRES_AT";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_DAY = "IDS_VIDEO_RENTAL_EXPIRES_DAY";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_DAY_HR = "IDS_VIDEO_RENTAL_EXPIRES_DAY_HR";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_DAY_HRS = "IDS_VIDEO_RENTAL_EXPIRES_DAY_HRS";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_DAYS = "IDS_VIDEO_RENTAL_EXPIRES_DAYS";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_DAYS_HR = "IDS_VIDEO_RENTAL_EXPIRES_DAYS_HR";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_DAYS_HRS = "IDS_VIDEO_RENTAL_EXPIRES_DAYS_HRS";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_HR = "IDS_VIDEO_RENTAL_EXPIRES_HR";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_HR_MIN = "IDS_VIDEO_RENTAL_EXPIRES_HR_MIN";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_HR_MINS = "IDS_VIDEO_RENTAL_EXPIRES_HR_MINS";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_HRS = "IDS_VIDEO_RENTAL_EXPIRES_HRS";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_HRS_MIN = "IDS_VIDEO_RENTAL_EXPIRES_HRS_MIN";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_HRS_MINS = "IDS_VIDEO_RENTAL_EXPIRES_HRS_MINS";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_HR = "IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_HR";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_MIN = "IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_MIN";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_MIN = "IDS_VIDEO_RENTAL_EXPIRES_MIN";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_MINS = "IDS_VIDEO_RENTAL_EXPIRES_MINS";
+ String.id.IDS_VIDEO_RENTAL_EXPIRES_ON = "IDS_VIDEO_RENTAL_EXPIRES_ON";
+ String.id.IDS_VIDEO_REVIEW_COUNT_ONLY_PLURAL = "IDS_VIDEO_REVIEW_COUNT_ONLY_PLURAL";
+ String.id.IDS_VIDEO_REVIEW_HEADING = "IDS_VIDEO_REVIEW_HEADING";
+ String.id.IDS_VIDEO_REVIEW_ROTTEN_VIEW_MORE = "IDS_VIDEO_REVIEW_ROTTEN_VIEW_MORE";
+ String.id.IDS_VIDEO_SEARCH_ALL_NORESULT_TITLE = "IDS_VIDEO_SEARCH_ALL_NORESULT_TITLE";
+ String.id.IDS_VIDEO_SEARCH_ALL_RESULT_TITLE = "IDS_VIDEO_SEARCH_ALL_RESULT_TITLE";
+ String.id.IDS_VIDEO_SEARCH_CAST_NORESULT_TITLE = "IDS_VIDEO_SEARCH_CAST_NORESULT_TITLE";
+ String.id.IDS_VIDEO_SEARCH_MOVIE_NORESULT_TITLE = "IDS_VIDEO_SEARCH_MOVIE_NORESULT_TITLE";
+ String.id.IDS_VIDEO_SEARCH_MOVIE_RESULT_TITLE = "IDS_VIDEO_SEARCH_MOVIE_RESULT_TITLE";
+ String.id.IDS_VIDEO_SEARCH_TV_NORESULT_TITLE = "IDS_VIDEO_SEARCH_TV_NORESULT_TITLE";
+ String.id.IDS_VIDEO_SEARCH_TV_RESULT_TITLE = "IDS_VIDEO_SEARCH_TV_RESULT_TITLE";
+ String.id.IDS_VIDEO_SEASON_PASS_EXPLANATION = "IDS_VIDEO_SEASON_PASS_EXPLANATION";
+ String.id.IDS_VIDEO_SETTINGS_PURCHASES_LABEL = "IDS_VIDEO_SETTINGS_PURCHASES_LABEL";
+ String.id.IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_BUTTON = "IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_BUTTON";
+ String.id.IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_DESCRPTION = "IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_DESCRPTION";
+ String.id.IDS_VIDEO_SETTINGS_PURCHASES_RESTORING_BUTTON = "IDS_VIDEO_SETTINGS_PURCHASES_RESTORING_BUTTON";
+ String.id.IDS_VIDEO_SETTINGS_STARTUP_VIEW_DESC = "IDS_VIDEO_SETTINGS_STARTUP_VIEW_DESC";
+ String.id.IDS_VIDEO_SIGNOUT_WARNING_DIALOG_BODY = "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_BODY";
+ String.id.IDS_VIDEO_SIGNOUT_WARNING_DIALOG_SIGNOUT_BTN = "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_SIGNOUT_BTN";
+ String.id.IDS_VIDEO_SIGNOUT_WARNING_DIALOG_TITLE = "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_TITLE";
+ String.id.IDS_VIDEO_SPOTLIGHT = "IDS_VIDEO_SPOTLIGHT";
+ String.id.IDS_VIDEO_STARTING_SMOOTH = "IDS_VIDEO_STARTING_SMOOTH";
+ String.id.IDS_VIDEO_STREAMING_DOWNLOAD_AVAILABLE = "IDS_VIDEO_STREAMING_DOWNLOAD_AVAILABLE";
+ String.id.IDS_VIDEO_STREAMING_DOWNLOAD_TO_WATCH_OFFLINE = "IDS_VIDEO_STREAMING_DOWNLOAD_TO_WATCH_OFFLINE";
+ String.id.IDS_VIDEO_STREAMING_NOTIFICATION = "IDS_VIDEO_STREAMING_NOTIFICATION";
+ String.id.IDS_VIDEO_TILE_NEW_MOVIES_AMP_TV = "IDS_VIDEO_TILE_NEW_MOVIES_AMP_TV";
+ String.id.IDS_VIDEO_TILE_XBOX_VIDEO_TC = "IDS_VIDEO_TILE_XBOX_VIDEO_TC";
+ String.id.IDS_VIDEO_UPSELL_BROWSE_MOVIES_AND_TV_SC = "IDS_VIDEO_UPSELL_BROWSE_MOVIES_AND_TV_SC";
+ String.id.IDS_VIDEO_UPSELL_BROWSE_NEW_MOVIES_SC = "IDS_VIDEO_UPSELL_BROWSE_NEW_MOVIES_SC";
+ String.id.IDS_VIDEO_UPSELL_BROWSE_NEW_TV_SC = "IDS_VIDEO_UPSELL_BROWSE_NEW_TV_SC";
+ String.id.IDS_VIDEO_UPSELL_BROWSE_PERSONAL_SC = "IDS_VIDEO_UPSELL_BROWSE_PERSONAL_SC";
+ String.id.IDS_VIDEO_UPSELL_BUY_LABEL_SC = "IDS_VIDEO_UPSELL_BUY_LABEL_SC";
+ String.id.IDS_VIDEO_UPSELL_FIND_NEW_MOVIES_SC = "IDS_VIDEO_UPSELL_FIND_NEW_MOVIES_SC";
+ String.id.IDS_VIDEO_UPSELL_GET_TV_SHOWS_SC = "IDS_VIDEO_UPSELL_GET_TV_SHOWS_SC";
+ String.id.IDS_VIDEO_UPSELL_INSTANT_ON_HD_SC = "IDS_VIDEO_UPSELL_INSTANT_ON_HD_SC";
+ String.id.IDS_VIDEO_UPSELL_MOVIE_STORE_SC = "IDS_VIDEO_UPSELL_MOVIE_STORE_SC";
+ String.id.IDS_VIDEO_UPSELL_MY_VIDEO_SC = "IDS_VIDEO_UPSELL_MY_VIDEO_SC";
+ String.id.IDS_VIDEO_UPSELL_TV_STORE_SC = "IDS_VIDEO_UPSELL_TV_STORE_SC";
+ String.id.IDS_VIDEO_UPSELL_VIEW_NEW_RELEASES_SC = "IDS_VIDEO_UPSELL_VIEW_NEW_RELEASES_SC";
+ String.id.IDS_VIDEO_VIEW_BY_TITLE = "IDS_VIDEO_VIEW_BY_TITLE";
+ String.id.IDS_VIDEO_VIEW_FROM_STUDIO_LABEL = "IDS_VIDEO_VIEW_FROM_STUDIO_LABEL";
+ String.id.IDS_VIDEO_VIEW_IN_GENRE_FROM_STUDIO_LABEL = "IDS_VIDEO_VIEW_IN_GENRE_FROM_STUDIO_LABEL";
+ String.id.IDS_VIDEO_VIEW_IN_GENRE_LABEL = "IDS_VIDEO_VIEW_IN_GENRE_LABEL";
+ String.id.IDS_VIDEO_WATCH_NEXT_BUY_EPISODE_BUTTON = "IDS_VIDEO_WATCH_NEXT_BUY_EPISODE_BUTTON";
+ String.id.IDS_VIDEO_WATCH_NEXT_DELETE_EPISODE_BUTTON = "IDS_VIDEO_WATCH_NEXT_DELETE_EPISODE_BUTTON";
+ String.id.IDS_VIDEO_WATCH_NEXT_DELETE_SEASON_BUTTON = "IDS_VIDEO_WATCH_NEXT_DELETE_SEASON_BUTTON";
+ String.id.IDS_VIDEO_WATCH_NEXT_DOWNLOAD_EPISODE_BUTTON = "IDS_VIDEO_WATCH_NEXT_DOWNLOAD_EPISODE_BUTTON";
+ String.id.IDS_VIDEO_WATCH_NEXT_PLAY_EPISODE_BUTTON = "IDS_VIDEO_WATCH_NEXT_PLAY_EPISODE_BUTTON";
+ String.id.IDS_VIDEO_WATCH_NEXT_RESTART_EPISODE_BUTTON = "IDS_VIDEO_WATCH_NEXT_RESTART_EPISODE_BUTTON";
+ String.id.IDS_VIDEO_WATCH_NEXT_RESUME_EPISODE_BUTTON = "IDS_VIDEO_WATCH_NEXT_RESUME_EPISODE_BUTTON";
+ String.id.IDS_VIDEO_WATCHED_LABEL = "IDS_VIDEO_WATCHED_LABEL";
+
+})();
+})();
+/* >>>>>>/framework/video1stringids.js:7299 */
+(function() {
+/////////////////////////////////////////////////////////////////////////////
+//
+// video1StringIds.js
+//
+// This file was generated by the Stringer tool. Do not edit it!
+//
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+(function() {
+
+ String.id = String.id || {}
+
+ String.id.IDS_VIDEO_ALL_FEATURED_SETS_GALLERY_TITLE = "IDS_VIDEO_ALL_FEATURED_SETS_GALLERY_TITLE";
+ String.id.IDS_VIDEO_ERROR_DETAILS = "IDS_VIDEO_ERROR_DETAILS";
+ String.id.IDS_VIDEO_ERROR_HEADER = "IDS_VIDEO_ERROR_HEADER";
+ String.id.IDS_VIDEO_FEATURED_MOVIES_TITLE = "IDS_VIDEO_FEATURED_MOVIES_TITLE";
+ String.id.IDS_VIDEO_FEATURED_SETS_TITLE = "IDS_VIDEO_FEATURED_SETS_TITLE";
+ String.id.IDS_VIDEO_FEATURED_TV_TITLE = "IDS_VIDEO_FEATURED_TV_TITLE";
+ String.id.IDS_VIDEO_LAST_NIGHT_SHOWS_TITLE = "IDS_VIDEO_LAST_NIGHT_SHOWS_TITLE";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_ADD = "IDS_VIDEO_LX_COLLECTION_EMPTY_ADD";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_ADD_DESCRIPTION = "IDS_VIDEO_LX_COLLECTION_EMPTY_ADD_DESCRIPTION";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_DESCRIPTION = "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_DESCRIPTION";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_MOVIES = "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_MOVIES";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_TV = "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_TV";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE = "IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE_DESCRIPTION = "IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE_DESCRIPTION";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN = "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN_DESCRIPTION = "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN_DESCRIPTION";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP = "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP";
+ String.id.IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP_DESCRIPTION = "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP_DESCRIPTION";
+ String.id.IDS_VIDEO_LX_COLLECTION_FILTER_ALL = "IDS_VIDEO_LX_COLLECTION_FILTER_ALL";
+ String.id.IDS_VIDEO_LX_COLLECTION_FILTER_CLOUD = "IDS_VIDEO_LX_COLLECTION_FILTER_CLOUD";
+ String.id.IDS_VIDEO_LX_COLLECTION_FILTER_PC = "IDS_VIDEO_LX_COLLECTION_FILTER_PC";
+ String.id.IDS_VIDEO_LX_COLLECTION_MODIFIER_MOVIES = "IDS_VIDEO_LX_COLLECTION_MODIFIER_MOVIES";
+ String.id.IDS_VIDEO_LX_COLLECTION_MODIFIER_PERSONAL = "IDS_VIDEO_LX_COLLECTION_MODIFIER_PERSONAL";
+ String.id.IDS_VIDEO_LX_COLLECTION_MODIFIER_TV = "IDS_VIDEO_LX_COLLECTION_MODIFIER_TV";
+ String.id.IDS_VIDEO_LX_COLLECTION_PIVOT = "IDS_VIDEO_LX_COLLECTION_PIVOT";
+ String.id.IDS_VIDEO_LX_COLLECTION_PIVOT_TC = "IDS_VIDEO_LX_COLLECTION_PIVOT_TC";
+ String.id.IDS_VIDEO_LX_COLLECTION_SORT_ALPHA = "IDS_VIDEO_LX_COLLECTION_SORT_ALPHA";
+ String.id.IDS_VIDEO_LX_COLLECTION_SORT_DATE = "IDS_VIDEO_LX_COLLECTION_SORT_DATE";
+ String.id.IDS_VIDEO_LX_COLLECTION_VIDEO_COUNT = "IDS_VIDEO_LX_COLLECTION_VIDEO_COUNT";
+ String.id.IDS_VIDEO_LX_DELETE_CONFIRM_COLLECTION = "IDS_VIDEO_LX_DELETE_CONFIRM_COLLECTION";
+ String.id.IDS_VIDEO_LX_DELETE_CONFIRM_PC = "IDS_VIDEO_LX_DELETE_CONFIRM_PC";
+ String.id.IDS_VIDEO_LX_DELETE_CONFIRM_PC_AND_COLLECTION = "IDS_VIDEO_LX_DELETE_CONFIRM_PC_AND_COLLECTION";
+ String.id.IDS_VIDEO_LX_DELETE_FROM_COLLECTION = "IDS_VIDEO_LX_DELETE_FROM_COLLECTION";
+ String.id.IDS_VIDEO_LX_DELETE_FROM_PC = "IDS_VIDEO_LX_DELETE_FROM_PC";
+ String.id.IDS_VIDEO_LX_DELETE_FROM_PC_AND_COLLECTION = "IDS_VIDEO_LX_DELETE_FROM_PC_AND_COLLECTION";
+ String.id.IDS_VIDEO_LX_DETAILS_CAST_AND_CREW_TITLE = "IDS_VIDEO_LX_DETAILS_CAST_AND_CREW_TITLE";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_DURATION = "IDS_VIDEO_LX_DETAILS_FOOTER_DURATION";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_FILE_SIZE = "IDS_VIDEO_LX_DETAILS_FOOTER_FILE_SIZE";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_GENRE = "IDS_VIDEO_LX_DETAILS_FOOTER_GENRE";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_NETWORK = "IDS_VIDEO_LX_DETAILS_FOOTER_NETWORK";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_PARENTAL_RATING = "IDS_VIDEO_LX_DETAILS_FOOTER_PARENTAL_RATING";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_PRIMARY_LANG = "IDS_VIDEO_LX_DETAILS_FOOTER_PRIMARY_LANG";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_RELEASE_DATE = "IDS_VIDEO_LX_DETAILS_FOOTER_RELEASE_DATE";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_STUDIO = "IDS_VIDEO_LX_DETAILS_FOOTER_STUDIO";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_SUBTITLES = "IDS_VIDEO_LX_DETAILS_FOOTER_SUBTITLES";
+ String.id.IDS_VIDEO_LX_DETAILS_FOOTER_TITLE = "IDS_VIDEO_LX_DETAILS_FOOTER_TITLE";
+ String.id.IDS_VIDEO_LX_DETAILS_HEADER_EPISODE_TITLE = "IDS_VIDEO_LX_DETAILS_HEADER_EPISODE_TITLE";
+ String.id.IDS_VIDEO_LX_DETAILS_HEADER_LINK_SUBTITLES = "IDS_VIDEO_LX_DETAILS_HEADER_LINK_SUBTITLES";
+ String.id.IDS_VIDEO_LX_DETAILS_HEADER_SERIES_SEASON_SUBTITLE = "IDS_VIDEO_LX_DETAILS_HEADER_SERIES_SEASON_SUBTITLE";
+ String.id.IDS_VIDEO_LX_DETAILS_ROTTEN_TOMATOES_TITLE = "IDS_VIDEO_LX_DETAILS_ROTTEN_TOMATOES_TITLE";
+ String.id.IDS_VIDEO_LX_DETAILS_SIZE_GB_HD_FORMAT = "IDS_VIDEO_LX_DETAILS_SIZE_GB_HD_FORMAT";
+ String.id.IDS_VIDEO_LX_DETAILS_SIZE_GB_SD_FORMAT = "IDS_VIDEO_LX_DETAILS_SIZE_GB_SD_FORMAT";
+ String.id.IDS_VIDEO_LX_DETAILS_SIZE_MB_HD_FORMAT = "IDS_VIDEO_LX_DETAILS_SIZE_MB_HD_FORMAT";
+ String.id.IDS_VIDEO_LX_DETAILS_SIZE_MB_SD_FORMAT = "IDS_VIDEO_LX_DETAILS_SIZE_MB_SD_FORMAT";
+ String.id.IDS_VIDEO_LX_DETAILS_SIZE_SEPARATOR = "IDS_VIDEO_LX_DETAILS_SIZE_SEPARATOR";
+ String.id.IDS_VIDEO_LX_MOVIE_FEATURED_GALLERY_TITLE = "IDS_VIDEO_LX_MOVIE_FEATURED_GALLERY_TITLE";
+ String.id.IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_GENRES = "IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_GENRES";
+ String.id.IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_STUDIOS = "IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_STUDIOS";
+ String.id.IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RATED = "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RATED";
+ String.id.IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RENTALS = "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RENTALS";
+ String.id.IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_SELLING = "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_SELLING";
+ String.id.IDS_VIDEO_LX_MOVIE_GALLERY_TITLE = "IDS_VIDEO_LX_MOVIE_GALLERY_TITLE";
+ String.id.IDS_VIDEO_LX_MOVIE_NEW_GALLERY_TITLE = "IDS_VIDEO_LX_MOVIE_NEW_GALLERY_TITLE";
+ String.id.IDS_VIDEO_LX_MOVIES_STORE_PIVOT = "IDS_VIDEO_LX_MOVIES_STORE_PIVOT";
+ String.id.IDS_VIDEO_LX_MOVIES_STORE_PIVOT_TC = "IDS_VIDEO_LX_MOVIES_STORE_PIVOT_TC";
+ String.id.IDS_VIDEO_LX_SEARCH = "IDS_VIDEO_LX_SEARCH";
+ String.id.IDS_VIDEO_LX_SEARCH_ALL_EMPTY_DESC = "IDS_VIDEO_LX_SEARCH_ALL_EMPTY_DESC";
+ String.id.IDS_VIDEO_LX_SEARCH_ALL_EMPTY_TITLE = "IDS_VIDEO_LX_SEARCH_ALL_EMPTY_TITLE";
+ String.id.IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_DESC = "IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_DESC";
+ String.id.IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_TITLE = "IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_TITLE";
+ String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE = "IDS_VIDEO_LX_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE";
+ String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_DESC = "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_DESC";
+ String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE = "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE";
+ String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG = "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG";
+ String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER = "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER";
+ String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_MAX_RESULTS = "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_MAX_RESULTS";
+ String.id.IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_NO_COUNT = "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_NO_COUNT";
+ String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_ALL = "IDS_VIDEO_LX_SEARCH_MODIFIER_ALL";
+ String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_MOVIES = "IDS_VIDEO_LX_SEARCH_MODIFIER_MOVIES";
+ String.id.IDS_VIDEO_LX_SEARCH_MODIFIER_TV = "IDS_VIDEO_LX_SEARCH_MODIFIER_TV";
+ String.id.IDS_VIDEO_LX_SEARCH_MY_EMPTY_DESC = "IDS_VIDEO_LX_SEARCH_MY_EMPTY_DESC";
+ String.id.IDS_VIDEO_LX_SEARCH_MY_EMPTY_LINK = "IDS_VIDEO_LX_SEARCH_MY_EMPTY_LINK";
+ String.id.IDS_VIDEO_LX_SEARCH_MY_EMPTY_TITLE = "IDS_VIDEO_LX_SEARCH_MY_EMPTY_TITLE";
+ String.id.IDS_VIDEO_LX_SEARCH_PIVOT_COLLECTION = "IDS_VIDEO_LX_SEARCH_PIVOT_COLLECTION";
+ String.id.IDS_VIDEO_LX_SEARCH_PIVOT_STORE = "IDS_VIDEO_LX_SEARCH_PIVOT_STORE";
+ String.id.IDS_VIDEO_LX_SEARCH_STORE_FILTER = "IDS_VIDEO_LX_SEARCH_STORE_FILTER";
+ String.id.IDS_VIDEO_LX_SEARCH_STORE_FILTER_MAX_RESULTS = "IDS_VIDEO_LX_SEARCH_STORE_FILTER_MAX_RESULTS";
+ String.id.IDS_VIDEO_LX_SEARCH_STORE_FILTER_NO_COUNT = "IDS_VIDEO_LX_SEARCH_STORE_FILTER_NO_COUNT";
+ String.id.IDS_VIDEO_LX_TV_FEATURED_GALLERY_TITLE = "IDS_VIDEO_LX_TV_FEATURED_GALLERY_TITLE";
+ String.id.IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_GENRES = "IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_GENRES";
+ String.id.IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_NETWORKS = "IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_NETWORKS";
+ String.id.IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_RATED = "IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_RATED";
+ String.id.IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_SELLING = "IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_SELLING";
+ String.id.IDS_VIDEO_LX_TV_GALLERY_TITLE = "IDS_VIDEO_LX_TV_GALLERY_TITLE";
+ String.id.IDS_VIDEO_LX_TV_LAST_NIGHT_GALLERY_TITLE = "IDS_VIDEO_LX_TV_LAST_NIGHT_GALLERY_TITLE";
+ String.id.IDS_VIDEO_LX_TV_NEW_GALLERY_TITLE = "IDS_VIDEO_LX_TV_NEW_GALLERY_TITLE";
+ String.id.IDS_VIDEO_LX_TV_STORE_PIVOT = "IDS_VIDEO_LX_TV_STORE_PIVOT";
+ String.id.IDS_VIDEO_LX_TV_STORE_PIVOT_TC = "IDS_VIDEO_LX_TV_STORE_PIVOT_TC";
+ String.id.IDS_VIDEO_LX_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT = "IDS_VIDEO_LX_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT";
+ String.id.IDS_VIDEO_LX_VERSION_CHECK_SERVICE_TITLE = "IDS_VIDEO_LX_VERSION_CHECK_SERVICE_TITLE";
+ String.id.IDS_VIDEO_NEW_MOVIES_TITLE = "IDS_VIDEO_NEW_MOVIES_TITLE";
+ String.id.IDS_VIDEO_NEW_TV_TITLE = "IDS_VIDEO_NEW_TV_TITLE";
+ String.id.IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL = "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL";
+ String.id.IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL_EXTENDED = "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL_EXTENDED";
+ String.id.IDS_VIDEO_NOW_PLAYING_AUDIO_TRACKS_BUTTON = "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACKS_BUTTON";
+ String.id.IDS_VIDEO_OFFLINE_DETAILS = "IDS_VIDEO_OFFLINE_DETAILS";
+ String.id.IDS_VIDEO_OFFLINE_HEADER = "IDS_VIDEO_OFFLINE_HEADER";
+ String.id.IDS_VIDEO_STREAMING_QUALITY_OVERLAY_BODY = "IDS_VIDEO_STREAMING_QUALITY_OVERLAY_BODY";
+ String.id.IDS_VIDEO_STREAMING_QUALITY_SELECTOR_BODY = "IDS_VIDEO_STREAMING_QUALITY_SELECTOR_BODY";
+ String.id.IDS_VIDEO_STREAMING_QUALITY_SELECTOR_OPTION_AUTOMATIC = "IDS_VIDEO_STREAMING_QUALITY_SELECTOR_OPTION_AUTOMATIC";
+ String.id.IDS_VIDEO_STREAMING_QUALITY_SETTINGS_TITLE = "IDS_VIDEO_STREAMING_QUALITY_SETTINGS_TITLE";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_1 = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_1";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_2 = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_2";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_SHOWDEVICES_LINK = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_SHOWDEVICES_LINK";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXCONSOLES_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXCONSOLES_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPC_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPC_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPHONE_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPHONE_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXTABLET_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXTABLET_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_RENTAL_ERROR_MESSAGE = "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_RENTAL_ERROR_MESSAGE";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_HELP_LINK = "IDS_VIDEO_TH_DEVICEDOMAIN_HELP_LINK";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_OFFLINE_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_OFFLINE_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_CLOSE_BUTTON = "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_CLOSE_BUTTON";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_1 = "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_1";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_2 = "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_2";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_LINK = "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_LINK";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_MESSAGE = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_MESSAGE";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_CANCEL = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_CANCEL";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_MESSAGE = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_MESSAGE";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_REMOVE = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_REMOVE";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_LINK = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_LINK";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_HEADER";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_MESSAGE = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_MESSAGE";
+ String.id.IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_NOTIME_HEADER = "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_NOTIME_HEADER";
+ String.id.IDS_VIDEO_TOP_MOVIE_RENTALS_TITLE = "IDS_VIDEO_TOP_MOVIE_RENTALS_TITLE";
+ String.id.IDS_VIDEO_TOP_RATED_MOVIES_TITLE = "IDS_VIDEO_TOP_RATED_MOVIES_TITLE";
+ String.id.IDS_VIDEO_TOP_RATED_TV_TITLE = "IDS_VIDEO_TOP_RATED_TV_TITLE";
+ String.id.IDS_VIDEO_TOP_SELLING_MOVIES_TITLE = "IDS_VIDEO_TOP_SELLING_MOVIES_TITLE";
+ String.id.IDS_VIDEO_TOP_SELLING_TV_TITLE = "IDS_VIDEO_TOP_SELLING_TV_TITLE";
+ String.id.IDS_VIDEO1_MANAGE_FOLDERS_TITLE = "IDS_VIDEO1_MANAGE_FOLDERS_TITLE";
+ String.id.IDS_VIDEO1_SEARCH_PROMPT_TITLE = "IDS_VIDEO1_SEARCH_PROMPT_TITLE";
+
+})();
+})();
+/* >>>>>>/framework/corefx.js:7462 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ var isInUnitTest = window.isInUnitTest;
+ var controlId = 0;
+ var pendedControlsWeakRefTable;
+ var pendingCleanup = [];
+ var pendingElementRemovals = [];
+ var pendingCleanupTimer = null;
+ var alreadyHandlingElementRemove = false;
+ var templateCache = {};
+ var fragmentCache = {};
+ var garbageCollectPromise = null;
+ var queuedTemplatesToPreload = [];
+ var queuedCriticalTemplatesToPreload = [];
+ var currentTextDirection = "";
+ var placeholderCssProperties = {
+ fontWeight: "font-weight", color: "color", fontSize: "font-size", letterSpacing: "letter-spacing", overflow: "overflow", textOverflow: "-ms-text-overflow", lineHeight: "line-height", whiteSpace: "white-space", backgroundColor: "background-color"
+ };
+ var bindingElementTargetWeakRefTable;
+ function getBindingTargetWeakRefTable() {
+ if (!bindingElementTargetWeakRefTable)
+ bindingElementTargetWeakRefTable = new MS.Entertainment.UI.Framework.WeakRefTable("about://bindingElementTarget");
+ return bindingElementTargetWeakRefTable
+ }
+ function patchWindowAlert() {
+ var alertsToShow = [];
+ var dialogVisible = false;
+ function showPendingAlerts() {
+ if (dialogVisible || !alertsToShow.length)
+ return;
+ dialogVisible = true;
+ new Windows.UI.Popups.MessageDialog(alertsToShow.shift()).showAsync().done(function() {
+ dialogVisible = false;
+ showPendingAlerts()
+ })
+ }
+ window.alert = function(message) {
+ if (window.console && window.console.log)
+ window.console.log(message);
+ if (!isInUnitTest) {
+ alertsToShow.push(message);
+ showPendingAlerts()
+ }
+ }
+ }
+ if (!window.alert)
+ patchWindowAlert();
+ var fxassert = function fixupAssertHelper() {
+ var existingAssert = WinJS.Utilities.getMember("MS.Entertainment.UI.Framework.assert");
+ if (existingAssert)
+ fxassert = existingAssert;
+ else
+ fxassert = localFxassert;
+ fxassert.apply(null, arguments)
+ };
+ function localFxassert(assertion, message) {
+ if (assertion)
+ return;
+ debugger
+ }
+ {};
+ var EventMixinEvent = WinJS.Class.define(function EventMixinEvent_ctor(type, detail, target) {
+ this.detail = detail;
+ this.target = target;
+ this.srcElement = target;
+ this.timeStamp = Date.now();
+ this.type = type
+ }, {
+ bubbles: {
+ value: false, writable: false
+ }, cancelable: {
+ value: false, writable: false
+ }, currentTarget: {get: function() {
+ return this.target
+ }}, defaultPrevented: {get: function() {
+ return this._preventDefaultCalled
+ }}, trusted: {
+ value: false, writable: false
+ }, eventPhase: {
+ value: 0, writable: false
+ }, target: null, srcElement: null, timeStamp: null, type: null, preventDefault: function() {
+ this._preventDefaultCalled = true
+ }, stopImmediatePropagation: function() {
+ this._stopImmediatePropagationCalled = true
+ }, stopPropagation: function(){}
+ }, {supportedForProcessing: false});
+ var eventMixin = {
+ _eventListeners: null, addEventListener: function(type, listener, useCapture) {
+ useCapture = useCapture || false;
+ this._eventListeners = this._eventListeners || {};
+ var eventListeners = (this._eventListeners[type] = this._eventListeners[type] || []);
+ for (var i = 0, len = eventListeners.length; i < len; i++) {
+ var l = eventListeners[i];
+ if (l.useCapture === useCapture && l.listener === listener)
+ return
+ }
+ eventListeners.push({
+ listener: listener, useCapture: useCapture
+ })
+ }, dispatchEvent: function(type, details) {
+ var listeners = this._eventListeners && this._eventListeners[type];
+ if (listeners) {
+ var eventValue = new EventMixinEvent(type, details, this);
+ listeners = listeners.slice(0, listeners.length);
+ for (var i = 0, len = listeners.length; i < len && !eventValue._stopImmediatePropagationCalled; i++)
+ listeners[i].listener(eventValue);
+ return eventValue.defaultPrevented || false
+ }
+ return false
+ }, removeEventListener: function(type, listener, useCapture) {
+ useCapture = useCapture || false;
+ var listeners = this._eventListeners && this._eventListeners[type];
+ if (listeners)
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ var l = listeners[i];
+ if (l.listener === listener && l.useCapture === useCapture) {
+ listeners.splice(i, 1);
+ if (listeners.length === 0)
+ delete this._eventListeners[type];
+ break
+ }
+ }
+ }
+ };
+ var updatePropertyMixin = {
+ updateAndNotify: function updateAndNotifyProperty(name, newValue) {
+ var storageName = "_" + name;
+ var oldValue = this[storageName];
+ if (oldValue === newValue)
+ return WinJS.Promise.wrap();
+ this[storageName] = newValue;
+ return this.dispatchChangeAndNotify(name, newValue, oldValue)
+ }, dispatchChangeAndNotify: function dispatchChangeAndNotify(name, newValue, oldValue) {
+ this.dispatchEvent(name + "Changed", {
+ newValue: newValue, oldValue: oldValue
+ });
+ return this.notify(name, newValue, oldValue)
+ }
+ };
+ var scriptTagCache = {};
+ var baseAppUriLength = (window.location.protocol + "//" + window.location.host).length;
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ derive: function derive(baseClass, constructor, instanceMembers, staticMembers) {
+ var value;
+ return {
+ get: function derive_getter() {
+ if (value)
+ return value;
+ if (typeof baseClass === "string") {
+ var baseClassName = baseClass;
+ baseClass = WinJS.Utilities.getMember(baseClass);
+ fxassert(baseClass, "Could not resolve baseClass named " + baseClassName)
+ }
+ fxassert(baseClass, "Base class was not valid. Can't derive without something to derive from");
+ instanceMembers = instanceMembers || {};
+ if (!instanceMembers.base && baseClass instanceof Function)
+ instanceMembers.base = function() {
+ var original = this.base;
+ this.base = baseClass.prototype.base;
+ baseClass.apply(this, arguments);
+ this.base = original
+ };
+ value = WinJS.Class.derive(baseClass, constructor, instanceMembers, staticMembers);
+ return value
+ }, set: function derive_setter(v) {
+ value = v
+ }, configurable: true
+ }
+ }, define: function define(constructor, instanceMembers, staticMembers) {
+ var value;
+ return {
+ get: function define_getter() {
+ if (value)
+ return value;
+ value = WinJS.Class.define(constructor, instanceMembers, staticMembers);
+ return value
+ }, set: function define_setter(v) {
+ value = v
+ }
+ }
+ }, lazyDefine: function lazyDefine(work) {
+ var value;
+ return {
+ get: function lazyDefine_getter() {
+ if (value)
+ return value;
+ value = work();
+ return value
+ }, set: function lazyDefine_setter(v) {
+ value = v
+ }, configurable: true
+ }
+ }, _loadScriptsWork: function _loadScriptsWork(lazyLoad, fileList) {
+ var scriptsToLoad = Array.prototype.map.call(fileList, function(item) {
+ item = item.toLowerCase();
+ if (item.charAt(0) !== "/")
+ throw new Error("Must use absolute path: " + item);
+ return item
+ });
+ var refreshedCache = false;
+ var scriptsLoaded = scriptsToLoad.reduce(function(data, script) {
+ if (MS.Entertainment.UI.Framework.scriptMappings) {
+ var mappedScript = MS.Entertainment.UI.Framework.scriptMappings[script.toLowerCase()];
+ if (mappedScript)
+ script = mappedScript
+ }
+ if (scriptTagCache.hasOwnProperty(script))
+ return data;
+ if (!refreshedCache) {
+ MS.Entertainment.UI.Framework._refreshScriptLoaderCache();
+ refreshedCache = true
+ }
+ if (scriptTagCache.hasOwnProperty(script))
+ return data;
+ var complete = WinJS.Promise.as();
+ if (WinJS.Utilities.Scheduler && WinJS.Promise.is(data))
+ complete = data.then(function() {
+ return WinJS.Utilities.Scheduler.schedulePromiseNormal(null, "MS.Entertainment_LazyScriptLoader:" + script)
+ });
+ complete = complete.then(function() {
+ if (scriptTagCache.hasOwnProperty(script))
+ return;
+ var scriptTag = document.createElement("script");
+ scriptTag.setAttribute("async", "false");
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ var oncompleted = signal.complete.bind(signal);
+ scriptTag.addEventListener("error", oncompleted);
+ scriptTag.addEventListener("load", oncompleted);
+ scriptTagCache[script] = null;
+ scriptTag.setAttribute("src", script);
+ document.head.appendChild(scriptTag);
+ return signal.promise
+ });
+ if (Array.isArray(data))
+ data.push(complete);
+ else
+ data = complete;
+ return data
+ }, (lazyLoad ? WinJS.Promise.as() : []));
+ return (WinJS.Promise.is(scriptsLoaded) ? scriptsLoaded : WinJS.Promise.join(scriptsLoaded))
+ }, loadScripts: function loadScripts() {
+ return MS.Entertainment.UI.Framework._loadScriptsWork.call(this, false, arguments)
+ }, lazyLoadScripts: function lazyLoadScripts() {
+ return MS.Entertainment.UI.Framework._loadScriptsWork.call(this, true, arguments)
+ }, _refreshScriptLoaderCache: function _refreshScriptLoaderCache() {
+ var documentScripts = document.head.querySelectorAll("script[src]");
+ var scriptsLength = Object.keys(scriptTagCache).length;
+ var documentScriptsLength = documentScripts.length;
+ for (var i = scriptsLength; i < documentScriptsLength; i++)
+ scriptTagCache[documentScripts[i].src.substr(baseAppUriLength).toLowerCase()] = null
+ }, _clearScriptLoaderCache: function _clearScriptLoaderCache() {
+ scriptTagCache = {}
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ RIGHT_MOUSEBUTTON: 2, POINTER_TYPE_TOUCH: 2, flags: {
+ attachLargeObjectToUnloadedControl: false, attachCookieToRemovedDomElements: false, dontPendControlUnloadCleanup: false
+ }, enableSetImmediateBatching: function enableSetImmediateBatching() {
+ if (WinJS.Utilities.Scheduler)
+ return;
+ if (window.setImmediatePatched)
+ return;
+ var queue = [];
+ var originalSetImmediate = window.setImmediate;
+ var setImmediateCallback = function setImmediateCallback() {
+ var timeNow = Date.now();
+ do {
+ try {
+ queue[0].callback(queue[0].args)
+ }
+ catch(e) {
+ WinJS.Application.onerror(e)
+ }
+ queue.shift()
+ } while (queue.length && (Date.now() - timeNow) < MS.Entertainment.UI.Framework._setImmediateTimeSlice);
+ if (queue.length)
+ originalSetImmediate(setImmediateCallback)
+ };
+ window.setImmediate = function _setImmediate(callback, args) {
+ if (MS.Entertainment.UI.Framework._setImmediateTimeSlice) {
+ queue.push({
+ callback: callback, args: args
+ });
+ if (queue.length === 1)
+ originalSetImmediate(setImmediateCallback)
+ }
+ else
+ originalSetImmediate(callback, args)
+ };
+ window.setImmediatePatched = true;
+ if (!isInUnitTest)
+ MS.Entertainment.UI.Framework.setImmediateMode = MS.Entertainment.UI.Framework.setImmediateModes.startup
+ }, setImmediateMode: {set: function setImmediateMode(value) {
+ MS.Entertainment.UI.Framework._setImmediateTimeSlice = value
+ }}, setImmediateModes: {
+ startup: 300, normal: 100, panning: 0, none: 0
+ }, _setImmediateTimeSlice: 0, ObservableBase: WinJS.Class.mix(function observableBaseConstructor(){}, eventMixin, updatePropertyMixin, WinJS.Binding.mixin), PropertyChangedEventArgs: WinJS.Class.define(function ObservablePropertyChangeEventArgs(newValue, oldValue) {
+ this.detail = {
+ newValue: newValue, oldValue: oldValue
+ }
+ }, {detail: null}), EventMixin: eventMixin, UpdatePropertyMixin: updatePropertyMixin, observableProperty: function observableProperty(name, value, makeValueObservable) {
+ var storageName = "_" + name;
+ return {
+ get: function getter() {
+ if (!(storageName in this))
+ return value;
+ var currentValue = this[storageName];
+ if (makeValueObservable)
+ currentValue = WinJS.Binding.as(currentValue);
+ return currentValue
+ }, set: function setter(newValue) {
+ if (makeValueObservable)
+ newValue = WinJS.Binding.unwrap(newValue);
+ this.updateAndNotify(name, newValue)
+ }
+ }
+ }, preloadEnabled: false, preloadCriticalEnabled: false, preloadTemplate: function preloadTemplate(template, critical) {
+ if (critical && !MS.Entertainment.UI.Framework.preloadCriticalEnabled)
+ queuedCriticalTemplatesToPreload.push(template);
+ else if (!critical && !MS.Entertainment.UI.Framework.preloadEnabled)
+ queuedTemplatesToPreload.push(template);
+ else
+ MS.Entertainment.UI.Framework.loadTemplate(template, null, true)
+ }, unblockCriticalPreloading: function unblockCriticalPreloading() {
+ MS.Entertainment.UI.Framework.preloadCriticalEnabled = true;
+ var preloads = queuedCriticalTemplatesToPreload;
+ queuedCriticalTemplatesToPreload = [];
+ preloads.forEach(function(template) {
+ MS.Entertainment.UI.Framework.loadTemplate(template, null, true)
+ })
+ }, unblockPreloading: function unblockPreloading() {
+ MS.Entertainment.UI.Framework.preloadEnabled = true;
+ var preloads = queuedTemplatesToPreload;
+ queuedTemplatesToPreload = [];
+ preloads.forEach(function(template) {
+ MS.Entertainment.UI.Framework.loadTemplate(template, null, true)
+ })
+ }, parseTemplate: function parseTemplate(templatePath) {
+ if (!templatePath)
+ throw new Error("No valid template path supplied");
+ var parts = templatePath.split("#", 2);
+ var result = {
+ path: parts[0], id: ""
+ };
+ if (parts.length > 1)
+ result.id = parts[1];
+ return result
+ }, loadTemplate: function loadTemplate(templatePath, templateId, skipDefer) {
+ var templateParts;
+ var templateName;
+ var cacheKey;
+ if (!templatePath)
+ return WinJS.Promise.as();
+ if (!templateId) {
+ templateParts = MS.Entertainment.UI.Framework.parseTemplate(templatePath);
+ templatePath = templateParts.path;
+ templateId = templateParts.id
+ }
+ if (!templateId)
+ throw new Error("Couldn't find a templateid in the provided path: " + templatePath);
+ cacheKey = templatePath + "#" + templateId;
+ window.msWriteProfilerMark("corefx:LoadTemplate:" + cacheKey + ",StartTM");
+ function getTemplate() {
+ var cachedControl = templateCache[cacheKey];
+ if (cachedControl) {
+ window.msWriteProfilerMark("corefx:LoadTemplate:CompletedFromCache");
+ window.msWriteProfilerMark("corefx:LoadTemplate:" + cacheKey + ",StopTM");
+ return cachedControl
+ }
+ var fragmentPromise = fragmentCache[templatePath];
+ window.msWriteProfilerMark("corefx:LoadTemplate:NotInCache");
+ if (!fragmentPromise) {
+ try {
+ fragmentPromise = WinJS.UI.Fragments.renderCopy(templatePath)
+ }
+ catch(e) {
+ MS.Entertainment.UI.Framework.fail("Failed to renderCopy for " + templatePath + " Error: " + e.toString());
+ return
+ }
+ fragmentCache[templatePath] = fragmentPromise
+ }
+ return fragmentPromise.then(function renderFragment(v) {
+ window.msWriteProfilerMark("corefx:LoadTemplate:FragmentLoaded");
+ var elements = v.querySelectorAll("[data-ent-templateid]");
+ var requestedTemplatePromise;
+ Array.prototype.forEach.call(elements, function instantiateAllTemplatesInFragment(template) {
+ var control = WinJS.UI.process(template);
+ var controlId = template.getAttribute("data-ent-templateid");
+ if (controlId === templateId)
+ requestedTemplatePromise = control;
+ control.then(function insertTemplateIntoCache(templateInstance) {
+ if (templateInstance)
+ templateInstance.disableOptimizedProcessing = true;
+ return templateCache[templatePath + "#" + controlId] = templateInstance
+ })
+ });
+ if (!requestedTemplatePromise)
+ throw"Could not locate template: " + templateId;
+ window.msWriteProfilerMark("corefx:LoadTemplate:TemplateExtracted");
+ return requestedTemplatePromise
+ }).then(function(processedControl) {
+ fxassert(processedControl, "Template found was not a control");
+ processedControl.disableOptimizedProcessing = true;
+ window.msWriteProfilerMark("corefx:LoadTemplate:" + cacheKey + ",StopTM");
+ return (templateCache[cacheKey] = processedControl)
+ }).then(null, function(e) {
+ fragmentCache[templatePath] = null;
+ WinJS.UI.Fragments.clearCache(templatePath);
+ return WinJS.Promise.wrapError(e)
+ })
+ }
+ if (skipDefer)
+ return WinJS.Promise.as(getTemplate());
+ else
+ return WinJS.Promise.timeout().then(getTemplate)
+ }, unloadAndAssertIfFails: function unloadAndAssertIfFails(instance) {
+ if (instance._unloadBaseCalled)
+ return;
+ try {
+ instance._unloadBaseCalled = false;
+ instance.unload();
+ fxassert(instance._unloadBaseCalled, "base unload() not called for: " + instance.templateName || instance.itemTemplate || instance.controlName)
+ }
+ catch(e) {
+ fxassert(false, "Exception unloading control: " + e)
+ }
+ }, cleanupSingleControl: function cleanupSingleControl(controlToCleanup) {
+ if (!controlToCleanup || controlToCleanup._unloaded)
+ return;
+ if (controlToCleanup.unload && (controlToCleanup.unload !== MS.Entertainment.UI.Framework._UserControl.prototype.unload))
+ MS.Entertainment.UI.Framework.unloadAndAssertIfFails(controlToCleanup);
+ controlToCleanup._unloaded = true;
+ if (controlToCleanup._cleanupAttachedEvents)
+ controlToCleanup._cleanupAttachedEvents();
+ if (!MS.Entertainment.UI.Framework.flags.dontPendControlUnloadCleanup)
+ pendingCleanup.push(pendedControlsWeakRefTable.set(controlToCleanup))
+ }, domElementRemovedHandler: function(evt) {
+ if (evt.target.nodeType !== 1)
+ return;
+ var element = evt.target;
+ var suppressUnload = element.suppressUnload || (element.winControl && element.winControl.suppressUnload);
+ var isAppBar = element.winControl instanceof WinJS.UI.AppBar;
+ var isListViewItem = element.listViewReset || element.listViewItemContainer;
+ var isDirectChildOfSemanticZoom;
+ var isDirectChildOfScrollViewer;
+ var isDirectChildOfItemContainer;
+ var parentElement = element.parentElement;
+ if (parentElement) {
+ isDirectChildOfSemanticZoom = WinJS.Utilities.hasClass(parentElement, "win-semanticzoom");
+ isDirectChildOfScrollViewer = WinJS.Utilities.hasClass(parentElement, "win-scrollviewer");
+ isDirectChildOfItemContainer = WinJS.Utilities.hasClass(parentElement, "win-itemcontainer")
+ }
+ if (suppressUnload || isAppBar || isListViewItem || isDirectChildOfSemanticZoom || isDirectChildOfScrollViewer || isDirectChildOfItemContainer)
+ return;
+ if (element.unloadTimeout > 0) {
+ MS.Entertainment.UI.Framework.delayedControlCleanup(element, element.unloadTimeout, function cleanupCallback(element) {
+ MS.Entertainment.UI.Framework.unloadControlTree(element)
+ });
+ return
+ }
+ var listViewItem = null;
+ if (element && WinJS.Utilities.hasClass(element, "win-item"))
+ listViewItem = element;
+ else {
+ var confirmedListViewItemParent = null;
+ var possibleListViewItemParent = element;
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-itemscontainer")) {
+ confirmedListViewItemParent = possibleListViewItemParent;
+ possibleListViewItemParent = possibleListViewItemParent.firstElementChild
+ }
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-itemsblock")) {
+ confirmedListViewItemParent = possibleListViewItemParent;
+ possibleListViewItemParent = possibleListViewItemParent.firstElementChild
+ }
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-container")) {
+ confirmedListViewItemParent = possibleListViewItemParent;
+ possibleListViewItemParent = possibleListViewItemParent.firstElementChild
+ }
+ if (possibleListViewItemParent && WinJS.Utilities.hasClass(possibleListViewItemParent, "win-itembox"))
+ confirmedListViewItemParent = possibleListViewItemParent;
+ if (confirmedListViewItemParent && confirmedListViewItemParent.firstElementChild)
+ if (WinJS.Utilities.hasClass(confirmedListViewItemParent.firstElementChild, "win-item"))
+ listViewItem = confirmedListViewItemParent.firstElementChild;
+ else
+ listViewItem = confirmedListViewItemParent.querySelector(".win-item")
+ }
+ if (listViewItem && (listViewItem.listViewReset || listViewItem.listViewItemContainer))
+ return;
+ if (alreadyHandlingElementRemove) {
+ pendingElementRemovals.push(element);
+ return
+ }
+ alreadyHandlingElementRemove = true;
+ while (element) {
+ MS.Entertainment.UI.Framework.unloadControlTree(element);
+ element = pendingElementRemovals.shift()
+ }
+ alreadyHandlingElementRemove = false
+ }, unloadControlTree: function unloadControlTree(element) {
+ if (!element)
+ return;
+ if (element.firstElementChild && !WinJS.Utilities.hasClass(element, "win-profilepicker-usertile"))
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "img", function cleanUpImages(item) {
+ if (item.winControl && item.winControl.unloadTimeout > 0)
+ MS.Entertainment.UI.Framework.delayedControlCleanup(item, item.winControl.unloadTimeout, function cleanupCallback(element) {
+ element.src = String.empty;
+ element.setAttribute("src", String.empty)
+ });
+ else if (!(item.winControl && item.winControl.suppressSourceClear)) {
+ item.src = String.empty;
+ item.setAttribute("src", String.empty)
+ }
+ });
+ else if (element.tagName && element.tagName === "IMG")
+ if (!(element.winControl && element.winControl.suppressSourceClear)) {
+ element.src = String.empty;
+ element.setAttribute("src", String.empty)
+ }
+ var nodes = element.querySelectorAll("[data-win-control], .ent-control");
+ for (var i = nodes.length - 1; i > -1; i--) {
+ var node = nodes[i];
+ var control = node.winControl;
+ if (!control || control.suppressUnload)
+ continue;
+ if (control.unloadTimeout > 0)
+ MS.Entertainment.UI.Framework.delayedControlCleanup(node, control.unloadTimout, function cleanupSingleControlDelayed() {
+ MS.Entertainment.UI.Framework.cleanupSingleControl(control)
+ });
+ else
+ MS.Entertainment.UI.Framework.cleanupSingleControl(control)
+ }
+ if (element.winControl)
+ MS.Entertainment.UI.Framework.cleanupSingleControl(element.winControl);
+ if (!MS.Entertainment.UI.Framework.flags.dontPendControlUnloadCleanup) {
+ element.isTree = true;
+ pendingCleanup.push(pendedControlsWeakRefTable.set(element));
+ if (pendingCleanupTimer)
+ clearTimeout(pendingCleanupTimer);
+ pendingCleanupTimer = setTimeout(function() {
+ pendingCleanup.forEach(function(item) {
+ var control = pendedControlsWeakRefTable.get(item);
+ if (!control)
+ return;
+ if (control._cleanupSetMembers)
+ control._cleanupSetMembers();
+ if (control._parent)
+ control._parent = null;
+ if (WinJS.Utilities.disposeSubTree) {
+ if (control.isTree)
+ WinJS.Utilities.disposeSubTree(control);
+ if (control.domElement && !WinJS.Utilities.hasClass(control.domElement, "win-disposable"))
+ control.domElement = null
+ }
+ else
+ control.domElement = null
+ });
+ pendingCleanup = []
+ }, MS.Entertainment.UI.Framework.autoCleanupTimeout)
+ }
+ }, enableAutoControlCleanup: function enableAutoControlCleanup() {
+ pendedControlsWeakRefTable = new MS.Entertainment.UI.Framework.WeakRefTable("about://pendingCleanup");
+ document.addEventListener("DOMNodeRemoved", MS.Entertainment.UI.Framework.domElementRemovedHandler)
+ }, disableAutoControlCleanup: function disableAutoControlCleanup() {
+ document.removeEventListener("DOMNodeRemoved", MS.Entertainment.UI.Framework.domElementRemovedHandler)
+ }, autoCleanupTimeout: 5000, delayedControlCleanup: function delayedControlCleanup(element, unloadTimeout, cleanupCallback) {
+ WinJS.Promise.timeout(unloadTimeout).done(function cleanUpControlIfStillNotInDom() {
+ if (element && !element._unloaded && !document.body.contains(element))
+ cleanupCallback(element)
+ })
+ }, Placeholder: MS.Entertainment.UI.Framework.define(function placeholderConstructor(template, replacements) {
+ this._template = template;
+ this._replacements = replacements
+ }, {
+ _replacements: null, _template: null, render: function render(container, data) {
+ var renderedPlaceholder = this._replacements.reduce(function replaceTokensInPlaceholder(placeholder, item, index) {
+ var content = WinJS.Utilities.getMember(item, data) || String.empty;
+ if (content)
+ content = MS.Entertainment.Utilities.simpleEscapeHTML(content);
+ return placeholder.replace("{" + index + "}", content)
+ }, this._template);
+ container.innerHTML = renderedPlaceholder
+ }
+ }), getPlaceholderForElement: function getPlaceholderForElement(element) {
+ var placeholders = element.querySelectorAll(".placeholderItem");
+ if (placeholders.length === 0)
+ return null;
+ var template = "";
+ var replacements = [];
+ template = Array.prototype.reduce.call(placeholders, function(currentTemplate, item, index) {
+ var style = window.getComputedStyle(item);
+ var pos = MS.Entertainment.Utilities.getRelativeOffset(item, element);
+ var width = WinJS.Utilities.getContentWidth(item);
+ var height = WinJS.Utilities.getContentHeight(item);
+ var memberPath = item.getAttribute("data-ent-placeholderdatapath");
+ var extractedStyles = Object.keys(placeholderCssProperties).reduce(function(styleString, property) {
+ var styleValue = style[property];
+ if (styleValue)
+ styleString += placeholderCssProperties[property] + ": " + styleValue + "; ";
+ return styleString
+ }, String.empty);
+ currentTemplate += "
";
+ if (memberPath) {
+ currentTemplate += "{" + replacements.length + "}";
+ replacements.push(memberPath)
+ }
+ currentTemplate += "
";
+ return currentTemplate
+ }, template);
+ template += "
";
+ return new MS.Entertainment.UI.Framework.Placeholder(template, replacements)
+ }, WeakRefTable: MS.Entertainment.UI.Framework.define(function(anchorUri) {
+ fxassert(anchorUri, "No anchor URI supplied");
+ this._anchor = new Windows.Foundation.Uri(anchorUri)
+ }, {
+ _anchor: null, _nextKey: 0, set: function set(item, customKey) {
+ var key = customKey || ++this._nextKey;
+ fxassert(item, "Actually need an item to store in the weak ref table");
+ if (!item)
+ return key;
+ if (msSetWeakWinRTProperty)
+ msSetWeakWinRTProperty(this._anchor, key, item);
+ else
+ key = {key: item};
+ return key
+ }, get: function get(key) {
+ fxassert(key, "You need to supply a key");
+ if (!key)
+ return null;
+ if (msGetWeakWinRTProperty)
+ return msGetWeakWinRTProperty(this._anchor, key);
+ return key.item
+ }
+ }), ReferenceMap: MS.Entertainment.UI.Framework.define(function() {
+ this._references = [];
+ this._values = []
+ }, {
+ _references: null, _values: null, set: function set(reference, value) {
+ var index = this._references.indexOf(reference);
+ if (index < 0)
+ index = this._references.push(reference) - 1;
+ this._values[index] = value
+ }, get: function get(reference) {
+ var index = this._references.indexOf(reference);
+ if (index < 0)
+ return;
+ {};
+ return this._values[index]
+ }, remove: function remove(reference) {
+ var index = this._references.indexOf(reference);
+ if (index < 0)
+ return;
+ this._references.splice(index, 1);
+ this._values.splice(index, 1)
+ }
+ }), bindWorker: function bindWorker(bindable, sourceProperties, handler) {
+ if (sourceProperties.length > 1) {
+ var root = {};
+ var current = root;
+ for (var i = 0, length = sourceProperties.length - 1; i < length; i++)
+ current = current[sourceProperties[i]] = {};
+ current[sourceProperties[sourceProperties.length - 1]] = handler;
+ return WinJS.Binding.bind(bindable, root, true)
+ }
+ else if (sourceProperties.length === 1) {
+ bindable.bind(sourceProperties[0], handler, true);
+ return {cancel: function() {
+ bindable.unbind(sourceProperties[0], handler);
+ this.cancel = function(){}
+ }}
+ }
+ }, weakElementBindingInitializer: function weakElementBindingInitializer(handler) {
+ var elementTargetedHandler = function(source, sourceProperties, dest, destProperties) {
+ var weakRefTable = getBindingTargetWeakRefTable();
+ var id = weakRefTable.set(dest);
+ var propertyPath = destProperties.concat([]);
+ var bindResult;
+ var bindingHandler = function bindingHandler(value) {
+ var targetElement = getBindingTargetWeakRefTable().get(id);
+ if (targetElement)
+ handler(value, targetElement, propertyPath, source);
+ else if (bindResult) {
+ bindResult.cancel();
+ bindResult = null
+ }
+ };
+ bindResult = MS.Entertainment.Utilities.bindWorker(WinJS.Binding.as(source), sourceProperties, bindingHandler);
+ return bindResult
+ };
+ return WinJS.Utilities.markSupportedForProcessing(elementTargetedHandler)
+ }, thawControlsInSubtree: function thawControlsInSubtree(element) {
+ var promisesToWaitOn = [];
+ fxassert(element, "No element supplied");
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[data-win-control], .ent-control", function thawControl(candidateControl) {
+ if (!candidateControl.winControl || !candidateControl.winControl.thaw || (candidateControl.winControl.thaw === MS.Entertainment.UI.Framework._UserControl.prototype.thaw))
+ return;
+ var instance = candidateControl.winControl;
+ instance._thawBaseCalled = false;
+ var thawResult = instance.thaw();
+ fxassert(instance._thawBaseCalled, "base thaw() not called!");
+ if (WinJS.Promise.is(thawResult))
+ promisesToWaitOn.push(thawResult)
+ });
+ if (promisesToWaitOn.length > 0)
+ return WinJS.Promise.any(promisesToWaitOn);
+ else
+ return WinJS.Promise.timeout()
+ }, freezeControlsInSubtree: function freezeControlsInSubtree(element) {
+ var promises = [];
+ fxassert(element, "No element supplied");
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[data-win-control], .ent-control", function freezeControl(candidateControl) {
+ if (!candidateControl.winControl || !candidateControl.winControl.freeze || (candidateControl.winControl.freeze === MS.Entertainment.UI.Framework._UserControl.prototype.freeze))
+ return;
+ var instance = candidateControl.winControl;
+ instance._freezeBaseCalled = false;
+ var freezeResult = instance.freeze();
+ fxassert(instance._freezeBaseCalled, "base freeze() not called!");
+ if (WinJS.Promise.is(freezeResult))
+ promises.push(freezeResult)
+ });
+ if (promises.length > 0)
+ return WinJS.Promise.any(promises);
+ else
+ return WinJS.Promise.wrap()
+ }, applyWithSelector: function(root, query, operation, includeRoot) {
+ if (!root || !root.querySelectorAll) {
+ fxassert(false, "No valid root element provided");
+ return
+ }
+ if (includeRoot)
+ operation(root);
+ WinJS.Utilities.query(query, root).forEach(operation)
+ }, parseEventAttributes: function parse(input, handlerSource) {
+ var pairs;
+ var results = [];
+ fxassert(input, "No input specified");
+ if (!input)
+ return;
+ fxassert(handlerSource, "No handler source provided");
+ if (!handlerSource)
+ throw"No Handler source provided";
+ pairs = input.split(";");
+ if (!pairs || pairs.length < 1)
+ return;
+ pairs.forEach(function processEventItems(item) {
+ var eventName;
+ var handler;
+ var handlerMember;
+ if (!item)
+ return;
+ var pair = item.split(":");
+ if (!pair || (pair.length !== 2)) {
+ fxassert(false, "Pair couldn't be parsed: " + item);
+ return
+ }
+ handler = pair[1].trim();
+ if (handlerSource) {
+ handlerMember = WinJS.Utilities.getMember(handler, handlerSource);
+ if (handlerMember)
+ handler = handlerMember
+ }
+ eventName = pair[0].trim();
+ results.push({
+ event: eventName, handler: handler
+ })
+ });
+ return results
+ }, processDeclEvents: function processDeclEvents(elementToProcess) {
+ fxassert(elementToProcess, "Element was not supplied");
+ var control = elementToProcess.winControl;
+ if (!control)
+ return;
+ var attachedEventsToCleanup = [];
+ MS.Entertainment.UI.Framework.applyWithSelector(elementToProcess, "[data-ent-event]", function processDeclEventElement(elementToInspect) {
+ if (elementToInspect.alreadyProcessedForEntEvent)
+ return;
+ var eventAttributeData = elementToInspect.getAttribute("data-ent-event");
+ if (!eventAttributeData)
+ return;
+ elementToInspect.alreadyProcessedForEntEvent = true;
+ var eventsToBind = MS.Entertainment.UI.Framework.parseEventAttributes(eventAttributeData, control);
+ if (!eventsToBind || eventsToBind.length < 1)
+ return;
+ eventsToBind.forEach(function bindEvents(eventInfo) {
+ if (!eventInfo.handler)
+ return;
+ if (typeof eventInfo.handler === "string") {
+ var message = "Unable to find '" + eventInfo.handler + "' on '" + control.toString() + "'";
+ fxassert(false, message);
+ return
+ }
+ var domEventWrapper = function domEventWrapperHandler(evt) {
+ eventInfo.handler.call(control, evt)
+ };
+ elementToInspect.addEventListener(eventInfo.event, domEventWrapper);
+ attachedEventsToCleanup.push({
+ element: elementToInspect, eventName: eventInfo.event, handler: domEventWrapper
+ });
+ var additionalEventToAttach = null;
+ if (eventInfo.event === "pointerdown")
+ additionalEventToAttach = "MSPointerDown";
+ else if (eventInfo.event === "pointermove")
+ additionalEventToAttach = "MSPointerMove";
+ if (additionalEventToAttach) {
+ elementToInspect.addEventListener(additionalEventToAttach, domEventWrapper);
+ attachedEventsToCleanup.push({
+ element: elementToInspect, eventName: additionalEventToAttach, handler: domEventWrapper
+ })
+ }
+ })
+ });
+ if (attachedEventsToCleanup && attachedEventsToCleanup.length)
+ control._attachedEventsToCleanup = attachedEventsToCleanup
+ }, delayInitializeChildren: function delayInitializeChildren(container, requireDelayInitialization) {
+ if (!container)
+ return;
+ var itemsInDelayInitializeBlock = null;
+ var inDelayInitializeBlock = function inDelayInitializeBlock(element) {
+ var containsElement = false;
+ itemsInDelayInitializeBlock = itemsInDelayInitializeBlock || WinJS.Utilities.query(".ent-delayInitializeBlock", container) || [];
+ for (var i = 0; i < itemsInDelayInitializeBlock.length && !containsElement; i++)
+ containsElement = itemsInDelayInitializeBlock[i].contains(element);
+ return containsElement
+ };
+ MS.Entertainment.UI.Framework.applyWithSelector(container, ".ent-delayInitialize, [data-win-control], .ent-control", function executeDelayInitialize(element) {
+ var currentControl = element.winControl;
+ if (currentControl && currentControl.enableDelayInitialization && currentControl.delayInitialize && !inDelayInitializeBlock(element))
+ if (currentControl.isInitialized || !currentControl.initialize)
+ currentControl.delayInitialize();
+ else
+ currentControl.enableDelayInitialization = false
+ })
+ }, processDeclMembers: function(root, target, overwriteExistingMembers) {
+ fxassert(target, "No target instance supplied");
+ var setMembers = [];
+ MS.Entertainment.UI.Framework.applyWithSelector(root, "[data-ent-member]", function processDeclMemberElement(element) {
+ if (element.alreadyProcessedForEntMember)
+ return;
+ var targetMemberName = element.getAttribute("data-ent-member");
+ if (!targetMemberName)
+ return;
+ element.alreadyProcessedForEntMember = true;
+ if (target[targetMemberName] && !overwriteExistingMembers) {
+ fxassert(false, "Target already has a property named '" + targetMemberName + "', skipping");
+ return
+ }
+ var elementOnly = MS.Entertainment.UI.Framework.checkIsElementOnly(element);
+ var valueToSet = null;
+ if (elementOnly)
+ valueToSet = element;
+ else
+ valueToSet = element.winControl || element;
+ target[targetMemberName] = valueToSet;
+ setMembers.push(targetMemberName)
+ });
+ target._setMembers = setMembers
+ }, processDeclarativeControlContainer: function processDeclarativeControlContainer(winControl) {
+ var promise;
+ fxassert(winControl && winControl.domElement && winControl.domElement.children.length === 1, "A valid winControl with just one child container needs to be supplied");
+ if (winControl && winControl.domElement && winControl.domElement.firstElementChild)
+ promise = WinJS.UI.processAll(winControl.domElement.firstElementChild).then(function() {
+ WinJS.Binding.processAll(winControl.domElement.firstElementChild, winControl);
+ MS.Entertainment.UI.Framework.processDeclEvents(winControl.domElement);
+ MS.Entertainment.UI.Framework.processDeclMembers(winControl.domElement, winControl)
+ });
+ return WinJS.Promise.as(promise)
+ }, animationsEnabled: {get: function() {
+ return WinJS.UI.isAnimationEnabled()
+ }}, TextDirections: {
+ LeftToRight: "ltr", RightToLeft: "rtl"
+ }, updateHtmlDirectionAttribute: function updateHtmlDirectionAttribute() {
+ var element = document.getElementsByTagName("html")[0];
+ fxassert(element, "Where did HTML go? We should have at least one");
+ var currentAttributeValue = element.getAttribute("dir");
+ var currentStyleValue = MS.Entertainment.UI.Framework.getTextDirectionForElement(element);
+ if (currentAttributeValue !== currentStyleValue)
+ element.setAttribute("dir", currentStyleValue);
+ currentTextDirection = currentStyleValue
+ }, getTextDirection: function getTextDirection() {
+ return currentTextDirection
+ }, getTextDirectionForElement: function getTextDirectionForElement(element) {
+ fxassert(element, "No Element provided to determine text direction");
+ if (!element)
+ return MS.Entertainment.UI.Framework.TextDirections.LeftToRight;
+ var currentStyleValue = element.currentStyle && element.currentStyle.direction;
+ return currentStyleValue
+ }, checkIsElementOnly: function checkIsElementOnly(element) {
+ var elementOnly = element.getAttribute("data-ent-elementonly") || String.empty;
+ elementOnly = elementOnly.toLowerCase();
+ if (elementOnly === "true")
+ return true;
+ return false
+ }, markFunctionsOfObjectAsSupportedForProcessing: function markFunctionsOfObjectAsSupportedForProcessing(instance) {
+ for (var m in instance)
+ if (instance.hasOwnProperty(m) && (instance[m] instanceof Function))
+ instance[m] = WinJS.Utilities.markSupportedForProcessing(instance[m]);
+ return instance
+ }, waitForControlToInitialize: function waitForControlToInitialize(elementToWaitOn) {
+ var complete;
+ var initializedPromise = new WinJS.Promise(function(c, e, p) {
+ complete = c
+ });
+ var cleanupAndComplete = function cleanupAndComplete() {
+ elementToWaitOn.removeEventListener("UserControlInitialized", handleControlInitialized);
+ complete()
+ };
+ fxassert(elementToWaitOn, "Element needs to be supplied");
+ var handleControlInitialized = function handleControlInitialized(event) {
+ if (elementToWaitOn.winControl) {
+ if (elementToWaitOn.winControl === event.userControl)
+ cleanupAndComplete()
+ }
+ else
+ cleanupAndComplete()
+ };
+ if (elementToWaitOn.winControl && elementToWaitOn.winControl._initialized)
+ complete();
+ else
+ elementToWaitOn.addEventListener("UserControlInitialized", handleControlInitialized);
+ return initializedPromise
+ }, checkIfInDom: function checkIfInDom(element) {
+ var inDom = document.compareDocumentPosition(element) & document.DOCUMENT_POSITION_CONTAINED_BY;
+ return !!inDom
+ }, forceFullLayout: function forceFullLayout() {
+ var forceRelayout = document.body.offsetHeight
+ }, empty: function(element) {
+ if (!element)
+ return;
+ element.innerHTML = String.empty
+ }, addEventHandlers: function addEventHandlers(eventSource, events, capture) {
+ if (eventSource && events && eventSource.addEventListener)
+ for (var key in events)
+ eventSource.addEventListener(key, events[key], capture || false);
+ return {cancel: function() {
+ MS.Entertainment.UI.Framework.removeEvents(eventSource, events, capture);
+ eventSource = null;
+ events = null
+ }}
+ }, removeEvents: function removeEvents(eventSource, events, capture) {
+ if (eventSource && events && eventSource.removeEventListener)
+ for (var key in events)
+ eventSource.removeEventListener(key, events[key], capture || false)
+ }, scrollIntoViewWithAnimation: function _performScroll(scroller, scrollLeft, ignoreMissingStarts, animationRoots) {
+ if (scrollLeft < 0)
+ scrollLeft = 0;
+ if (!MS.Entertainment.UI.Framework.animationsEnabled) {
+ scroller.scrollLeft = scrollLeft;
+ return WinJS.Promise.as()
+ }
+ var scrollLeftDelta = (scroller.scrollLeft - scrollLeft);
+ if ((-scrollLeftDelta) + scroller.scrollLeft < 0)
+ scrollLeftDelta = 0 - scroller.scrollLeft;
+ if (MS.Entertainment.UI.Framework.getTextDirection() === MS.Entertainment.UI.Framework.TextDirections.RightToLeft)
+ scrollLeftDelta = -(scroller.scrollLeft - scrollLeft);
+ var animationChildren = [];
+ if (animationRoots && Array.isArray(animationRoots))
+ for (var i = 0; i < animationRoots.length; i++)
+ animationChildren = animationChildren.concat(Array.prototype.slice.call(animationRoots[i].children));
+ else
+ animationChildren = scroller.children;
+ var scrollComplete = scroller.isAnimatingScroll;
+ if (!scrollComplete)
+ scrollComplete = MS.Entertainment.UI.Framework.waitForStartedTransitionsToComplete(scroller, ignoreMissingStarts, "scrollAnimation").then(function() {
+ Array.prototype.forEach.call(animationChildren, function(item) {
+ WinJS.Utilities.removeClass(item, "scrollAnimation");
+ item.style.msTransform = ""
+ });
+ scroller.scrollLeft = scroller.targetScrollLeft;
+ scroller.targetScrollLeft = null;
+ scroller.isAnimatingScroll = null
+ }.bind(this));
+ else if (scroller.targetScrollLeft !== scrollLeft)
+ MS.Entertainment.UI.Framework.resetStartedTransitionCount(scroller);
+ if (scroller.targetScrollLeft !== scrollLeft) {
+ Array.prototype.forEach.call(animationChildren, function(item) {
+ WinJS.Utilities.addClass(item, "scrollAnimation");
+ if (WinJS.Utilities.hasClass(item, "fixed"))
+ return;
+ var transformStyle = "translateX(" + scrollLeftDelta + "px)";
+ item.style.msTransform = transformStyle
+ });
+ scroller.targetScrollLeft = scrollLeft;
+ scroller.isAnimatingScroll = scrollComplete
+ }
+ return scrollComplete
+ }, resetStartedTransitionCount: function resetStartedTransitionCount(element) {
+ element.startedTransitions = 0
+ }, waitForStartedTransitionsToComplete: function waitForStartedTransitionsToComplete(element, ignoreMissingStarts, className) {
+ fxassert(element, "Need an element to work with");
+ MS.Entertainment.UI.Framework.resetStartedTransitionCount(element);
+ var complete;
+ var allTransitionsComplete = new WinJS.Promise(function(c, e, p) {
+ complete = c
+ });
+ var startHandler = function waitForStartedTransitionsToCompleteStartedHandler(e) {
+ if (className && !WinJS.Utilities.hasClass(e.target, className))
+ return;
+ element.startedTransitions++
+ };
+ element.addEventListener("transitionstart", startHandler);
+ var endHandler = function waitForStartedTransitionsToCompleteEndedHandler(e) {
+ if (className && !WinJS.Utilities.hasClass(e.target, className))
+ return;
+ if (!ignoreMissingStarts)
+ fxassert(element.startedTransitions, "Expected something to have started before we end");
+ element.startedTransitions--;
+ if (element.startedTransitions > 0)
+ return;
+ element.removeEventListener("transitionstart", startHandler);
+ element.removeEventListener("transitionend", endHandler);
+ complete()
+ };
+ element.addEventListener("transitionend", endHandler);
+ return allTransitionsComplete
+ }, Signal: WinJS.Class.mix(WinJS.Class.define(function() {
+ var that = this;
+ this._wrappedPromise = new WinJS.Promise(function(c, e, p) {
+ that._complete = c;
+ that._error = e;
+ that._progress = p
+ }, this._handleCancelled.bind(this))
+ }, {
+ _wrappedPromise: null, _complete: null, _completed: false, _error: null, _progress: null, _handleCancelled: function _handleCancelled(e) {
+ this.dispatchEvent("cancelled", {signal: this})
+ }, promise: {get: function() {
+ return this._wrappedPromise
+ }}, complete: function signal_complete(value) {
+ if (this._completed)
+ throw new Error("Cannot complete an already completed promise");
+ this._complete(value);
+ this._completed = true
+ }, error: function signal_error(errorInfo) {
+ this._error(errorInfo)
+ }, progress: function signal_progress(progressInfo) {
+ this._progress(progressInfo)
+ }
+ }), WinJS.Utilities.eventMixin), BackOffTimer: WinJS.Class.define(function(){}, {
+ _disposed: false, _timer: null, _lastExecute: 0, _callback: null, _currentDelay: 0, initialDelay: 500, maxDelay: 4000, delayIncreaseFactor: 2, currentDelay: {get: function get_currentDelay() {
+ return this._currentDelay
+ }}, callback: {
+ get: function get_callback() {
+ return this._callback
+ }, set: function set_callback(value) {
+ if (!this._disposed && value !== this._callback) {
+ this._callback = value;
+ if (this._timer) {
+ this._timer.cancel();
+ this._timer = null
+ }
+ }
+ }
+ }, dispose: function dispose() {
+ this._disposed = true;
+ if (this._timer) {
+ this._timer.cancel();
+ this._timer = null
+ }
+ this._callback = null
+ }, execute: function execute() {
+ var result = null;
+ var time = Date.now();
+ if (this._lastExecute && time - this._lastExecute > this._currentDelay)
+ this._currentDelay = 0;
+ this._lastExecute = time;
+ var refreshSynchronously = this._currentDelay <= 0 && !this._timer;
+ if (refreshSynchronously) {
+ this._currentDelay = Math.min(this.maxDelay, this.initialDelay);
+ this._execute()
+ }
+ else if (!this._timer)
+ this._timer = new WinJS.Promise.timeout(this._currentDelay).then(function() {
+ this._currentDelay = this._currentDelay * this.delayIncreaseFactor;
+ this._currentDelay = Math.min(this.maxDelay, this._currentDelay);
+ this._execute()
+ }.bind(this), function(){}).then(function() {
+ this._timer = null
+ }.bind(this));
+ return WinJS.Promise.as(this._timer)
+ }, _execute: function _execute() {
+ if (this.callback)
+ this.callback()
+ }
+ }), clearCaches: function clearCaches(skipListViewClear) {
+ templateCache = {};
+ fragmentCache = {};
+ WinJS.UI._disposeControls();
+ WinJS.UI.Fragments.clearCache();
+ if (!skipListViewClear) {
+ var fakeListView = document.createElement("div");
+ fakeListView.style.display = "none";
+ fakeListView.id = "fakeListView";
+ document.body.appendChild(fakeListView);
+ (new WinJS.UI.ListView(fakeListView));
+ WinJS.Promise.timeout(1000).done(function() {
+ if (fakeListView.winControl && fakeListView.winControl.dispose)
+ fakeListView.winControl.dispose();
+ fakeListView.parentElement.removeChild(fakeListView)
+ })
+ }
+ if (garbageCollectPromise) {
+ garbageCollectPromise.cancel();
+ garbageCollectPromise = null
+ }
+ var collectGarbageFn = function collectGarbageFn() {
+ CollectGarbage();
+ return WinJS.Promise.timeout(1000)
+ };
+ garbageCollectPromise = WinJS.Promise.timeout(3000).then(collectGarbageFn).then(collectGarbageFn).then(function updateMemoryCounter(){});
+ return garbageCollectPromise
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ _UserControl: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function userControlConstructor(element, options) {
+ fxassert(!element.winControl, "This element has already had the control initialized for it. It shouldn't be happening again");
+ fxassert(this !== window, "Invoked against global object. Bad");
+ this._controlId = ++controlId;
+ this.domElement = element;
+ this._controlsPendingInitialization = [];
+ this._userControlConstructedHandler = this._userControlConstructedHandler.bind(this);
+ this.domElement.addEventListener("UserControlConstructed", this._userControlConstructedHandler);
+ this._userControlConstructedInitialized = this._userControlConstructedInitialized.bind(this);
+ this.domElement.addEventListener("UserControlInitialized", this._userControlConstructedInitialized);
+ WinJS.UI.setOptions(this, options);
+ element.winControl = this;
+ if (this.templateStorage) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("UserControlConstructed", true, false);
+ domEvent.userControl = this;
+ this.domElement.dispatchEvent(domEvent)
+ }
+ }, {
+ _beginInitializeCount: 0, _childControlHandlersAdded: false, _controlId: -1, _controlsPendingInitialization: null, templateStorage: null, templateName: null, domElement: null, _attachedEventsToCleanup: null, _setMembers: null, visibility: {
+ get: function() {
+ if (!this.domElement || !this.domElement.style)
+ return false;
+ var currentStyle = this.domElement.currentStyle;
+ return (currentStyle && currentStyle.visibility !== "hidden" && currentStyle.display !== "none" && currentStyle.opacity !== 0.0)
+ }, set: function(value) {
+ if (!this.domElement)
+ return;
+ var oldValue = this.visibility;
+ if (value)
+ MS.Entertainment.Utilities.showElement(this.domElement);
+ else
+ MS.Entertainment.Utilities.hideElement(this.domElement);
+ if (value !== oldValue)
+ this.notify("visibility", value, oldValue)
+ }, enumerable: true, configurable: false
+ }, action: null, _unloadBaseCalled: false, _freezeBaseCalled: false, _thawBaseCalled: false, preventHideDuringInitialize: false, allowAnimations: true, _initialized: false, _isDelayInitialized: false, _unloaded: false, unload: function unload() {
+ this._unloadBaseCalled = true
+ }, freeze: function freeze() {
+ this._freezeBaseCalled = true
+ }, thaw: function thaw() {
+ this._thawBaseCalled = true
+ }, dispose: function() {
+ if (this.domElement)
+ WinJS.Utilities.disposeSubTree(this.domElement);
+ MS.Entertainment.UI.Framework.cleanupSingleControl(this);
+ if (this.domElement)
+ this.domElement = null
+ }, _userControlConstructedHandler: function _userControlConstructedHandler(e) {
+ fxassert(e, "No event args provided to constructor handler");
+ fxassert(e.userControl, "No user control instance provided on event args for control construction");
+ if (e.userControl === this)
+ return;
+ e.stopPropagation();
+ fxassert(!e.userControl._parent, "This control already had a parent set. That doesn't seem right");
+ fxassert(e.userControl !== this, "Why are we hearing about this for ourselves?");
+ e.userControl._parent = this;
+ if (this.ignoreChildrenInitialization)
+ return;
+ fxassert(this._controlsPendingInitialization.indexOf(e.userControl) === -1, "Control was already pending it's initialization");
+ this._controlsPendingInitialization.push(e.userControl)
+ }, _userControlConstructedInitialized: function _userControlConstructedInitialized(e) {
+ fxassert(e, "No event args provided to constructor handler");
+ fxassert(e.userControl, "No user control instance provided on event args for control construction");
+ if (e.userControl === this)
+ return;
+ e.stopPropagation();
+ if (this._unloaded)
+ return;
+ if (this.ignoreChildrenInitialization)
+ return;
+ var index = this._controlsPendingInitialization.indexOf(e.userControl);
+ if (index === -1)
+ return;
+ this._controlsPendingInitialization.splice(index, 1);
+ this._completeInitialize()
+ }, initialize: function(){}, isInitialized: {get: function UserControl_getIsInitialized() {
+ return this._initialized
+ }}, delayInitialize: function delayInitialize() {
+ fxassert(!this.isDelayInitialized, "The user control has already been delay initialized.");
+ if (!this.isDelayInitialized) {
+ this._isDelayInitialized = true;
+ if (this.supportsDelayInitialization)
+ this._delayInitialized()
+ }
+ }, isDelayInitialized: {get: function get_isDelayInitialized() {
+ return this._isDelayInitialized
+ }}, supportsDelayInitialization: {get: function get_supportsDelayInitialization() {
+ return !!this._delayInitialized
+ }}, _completeInitialize: function _completeInitialize() {
+ if ((this._controlsPendingInitialization.length > 0) || (this.templateStorage && !this._templateLoaded))
+ return;
+ if (this._unloaded)
+ return;
+ this.domElement.removeEventListener("UserControlConstructed", this._userControlConstructedHandler);
+ this.domElement.removeEventListener("UserControlInitialized", this._userControlConstructedInitialized);
+ this._initialized = true;
+ var actionName = this.domElement.getAttribute("data-ent-action");
+ if (actionName) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(WinJS.Utilities.getMember(actionName));
+ this.action = action;
+ this.domElement.removeAttribute("data-ent-action")
+ }
+ if (this.templateStorage || this.processChildren) {
+ MS.Entertainment.UI.Framework.processDeclEvents(this.domElement);
+ MS.Entertainment.UI.Framework.processDeclMembers(this.domElement, this)
+ }
+ if (!this.preventHideDuringInitialize)
+ WinJS.Utilities.removeClass(this.domElement, "hideDuringInitialize");
+ if (this.initialize) {
+ var controlName = ((this.templateStorage && this.templateName) ? this.templateStorage + "#" + this.templateName : this.controlName) + ":" + this._controlId;
+ window.msWriteProfilerMark("corefx:UserControlUserInitialization:" + controlName + ",StartTM");
+ this.initialize();
+ window.msWriteProfilerMark("corefx:UserControlUserInitialization:" + controlName + ",StopTM")
+ }
+ if (!this.enableDelayInitialization)
+ this.delayInitialize();
+ if (this.allowAnimations && MS.Entertainment.UI.Framework.beginShowAnimations)
+ MS.Entertainment.UI.Framework.beginShowAnimations(this.domElement);
+ fxassert(this._controlsPendingInitialization.length === 0, "There were controls pending initialization when this one called it's initializer");
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("UserControlInitialized", true, false);
+ domEvent.userControl = this;
+ this.domElement.dispatchEvent(domEvent)
+ }, _beginInitialize: function _beginInitialize() {
+ var controlTraceString = (this.controlName || "Non templated control without control name") + ":" + this._controlId;
+ var templateTraceString = this.templateStorage + "#" + this.templateName + ":" + this._controlId;
+ if ((!this.templateStorage) && (this.initialize)) {
+ window.msWriteProfilerMark("corefx:UserControlInitialization: " + controlTraceString + ",StartTM");
+ if (this.deferInitialization) {
+ WinJS.Promise.timeout().then(this._completeInitialize.bind(this));
+ return
+ }
+ this._completeInitialize();
+ window.msWriteProfilerMark("corefx:UserControlInitialization: " + controlTraceString + ",StopTM");
+ return
+ }
+ window.msWriteProfilerMark("corefx:UserControlInitialization: " + controlTraceString + ",StartTM");
+ if (!this.templateStorage)
+ return;
+ window.msWriteProfilerMark("corefx:UserControlInitializationTemplateLoading:" + templateTraceString + ",StartTM");
+ MS.Entertainment.UI.Framework.loadTemplate(this.templateStorage, this.templateName, this._skipDefer).then(function renderControl(controlInstance) {
+ if (this._unloaded)
+ return WinJS.Promise.wrapError({controlUnloaded: true});
+ return controlInstance.render(this, this.domElement)
+ }.bind(this)).then(function appendAndInit(renderedElement) {
+ var targetElement = this.domElement;
+ if (!targetElement.getAttribute("data-win-automationId"))
+ targetElement.setAttribute("data-win-automationId", this.templateName);
+ this._templateLoaded = true;
+ window.msWriteProfilerMark("corefx:UserControlInitializationTemplateLoading:" + templateTraceString + ",StopTM");
+ this._completeInitialize()
+ }.bind(this)).done(null, function error(errorObject) {
+ if (errorObject.controlUnloaded)
+ return;
+ fxassert(false, "Failure loading template: '" + this.templateStorage + "#" + this.templateName + "'");
+ return WinJS.Promise.wrapError(errorObject)
+ }.bind(this))
+ }, _cleanupAttachedEvents: function _cleanupAttachedEvents() {
+ if (!this._attachedEventsToCleanup || !this._attachedEventsToCleanup.length)
+ return;
+ this._attachedEventsToCleanup.forEach(function(item) {
+ item.element.removeEventListener(item.eventName, item.handler)
+ });
+ this._attachedEventsToCleanup = []
+ }, _cleanupSetMembers: function _cleanupSetMembers() {
+ if (!this._setMembers || !this._setMembers.length)
+ return;
+ this._setMembers.forEach(function(member) {
+ this[member] = null
+ }.bind(this));
+ this._setMembers = []
+ }
+ }), deriveUserControl: function(userControl, template, constructor, members, observableMembers, statics) {
+ var value;
+ var templateParts;
+ if (template) {
+ templateParts = MS.Entertainment.UI.Framework.parseTemplate(template);
+ members = members || {};
+ if (!members.templateName || !members.templateStorage) {
+ members.templateStorage = templateParts.path;
+ if (templateParts.id)
+ members.templateName = templateParts.id
+ }
+ if (members.templateName)
+ MS.Entertainment.UI.Framework.preloadTemplate(template, members.criticalTemplate)
+ }
+ return {get: function() {
+ if (!value)
+ value = MS.Entertainment.UI.Framework.deriveUserControlWork(userControl, template, constructor, members, observableMembers, statics);
+ return value
+ }}
+ }, deriveUserControlWork: function(userControl, template, constructor, members, observableMembers, statics) {
+ if (typeof userControl === "string") {
+ var controlMemberName = userControl;
+ userControl = WinJS.Utilities.getMember(userControl);
+ fxassert(userControl, "Could not resolve user control named " + controlMemberName)
+ }
+ fxassert(userControl, "User Control was not valid. Can't derive without something to derive from");
+ if (members)
+ MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(members);
+ if (statics)
+ MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(statics);
+ var type = WinJS.Class.derive(userControl, function defineUserControlWrapperConstructor(element, options) {
+ if (this === window)
+ throw new Error("Need to use 'new' to invoke the constructor");
+ element = element || document.createElement("div");
+ if (!this.preventHideDuringInitialize && (!options || !options.preventHideDuringInitialize))
+ WinJS.Utilities.addClass(element, "hideDuringInitialize");
+ if (observableMembers)
+ if (!this._backingData)
+ this._initObservable(Object.create(observableMembers));
+ else {
+ var item;
+ for (item in observableMembers)
+ if (!(item in this._backingData))
+ this._backingData[item] = observableMembers[item]
+ }
+ this._beginInitializeCount++;
+ userControl.call(this, element, options);
+ this._beginInitializeCount--;
+ if (typeof constructor === "function") {
+ window.msWriteProfilerMark("corefx:UserControlConstructed:" + (template || this.controlName || "No-template name") + ":" + this._controlId);
+ constructor.call(this, element, options)
+ }
+ if (this._beginInitializeCount === 0)
+ this._beginInitialize()
+ }, members, statics);
+ if (observableMembers)
+ type = WinJS.Class.mix(type, WinJS.Binding.expandProperties(observableMembers));
+ return type
+ }, defineUserControl: function(template, constructor, members, observableMembers, statics) {
+ return MS.Entertainment.UI.Framework.deriveUserControl(MS.Entertainment.UI.Framework._UserControl, template, constructor, members, observableMembers, statics)
+ }
+ });
+ var _emptySourcePath;
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ BindingBlock: MS.Entertainment.UI.Framework.define(function(){}, {}, {isDeclarativeControlContainer: true}), UserControl: MS.Entertainment.UI.Framework.defineUserControl(null, function(){}), ImageControl: MS.Entertainment.UI.Framework.defineUserControl(null, function(element, options) {
+ this._handleError = this._handleError.bind(this);
+ this._handleLoaded = this._handleLoaded.bind(this);
+ if (MS.Entertainment.Utilities.isApp2)
+ this._removeEventHandlersOnError = false
+ }, {
+ loadDelay: false, disableLazyDecode: false, clearSrcOnEmptyTarget: false, controlName: "ImageControl", desiredImageSize: null, defaultImagePath: null, errorImage: null, imageIdType: null, bindTargetProperties: false, applyImageAsBackground: false, propagateImageLoadCompleteEvent: false, imageLoadCompleteEventFired: false, parentStyleIfNotEmpty: null, skipImageResetOnThaw: false, _target: null, _enabled: false, _loadPromise: null, _removeEventHandlersOnError: true, _frozen: false, _emptySourcePath: {get: function imageControl_emptySourcePath_get() {
+ if (!_emptySourcePath)
+ _emptySourcePath = window.location.protocol + "//" + window.location.host + "/";
+ return _emptySourcePath
+ }}, _previousSrc: null, _previousBackgroundImage: null, _freezePromise: null, _transparentImage: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.UI.ImagePaths.transparent
+ }), freeze: function() {
+ if (!this._frozen) {
+ this._frozen = true;
+ if (!document.hidden || MS.Entertainment.Utilities.isApp2)
+ this._freezePromise = WinJS.Promise.timeout(167).then(function clearImagesAfterFreeze() {
+ if (this._unloaded || !this._frozen)
+ return;
+ var currentSrc = this.domElement.src;
+ if (currentSrc && this._emptySourcePath !== currentSrc) {
+ this._previousSrc = currentSrc;
+ this.domElement.src = String.empty
+ }
+ if (this.domElement.style.backgroundImage) {
+ this._previousBackgroundImage = this.domElement.style.backgroundImage;
+ this.domElement.style.backgroundImage = String.empty
+ }
+ if (this.disableLazyDecode)
+ var touchImage = this.domElement.complete;
+ this._freezePromise = null
+ }.bind(this))
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ if (this._frozen && !this._unloaded) {
+ this._frozen = false;
+ if (this._freezePromise) {
+ this._freezePromise.cancel();
+ this._freezePromise = null
+ }
+ if (this._previousSrc && (!this.domElement.src || this.domElement.src === this._emptySourcePath) && !this.skipImageResetOnThaw)
+ this.domElement.src = this._previousSrc;
+ this._previousSrc = String.empty;
+ if (this._previousBackgroundImage && !this.domElement.style.backgroundImage && !this.skipImageResetOnThaw)
+ this.domElement.style.backgroundImage = this._previousBackgroundImage;
+ this._previousBackgroundImage = String.empty;
+ if (this.disableLazyDecode)
+ var touchImage = this.domElement.complete
+ }
+ }, _handleError: function _handleError(error) {
+ if (WinJS.Utilities.getMember("domElement.complete", this))
+ return;
+ if (!error || error.message !== "Canceled")
+ if (this.domElement) {
+ this.domElement.removeEventListener("error", this._handleError);
+ if (this.errorImage) {
+ if (this.applyImageAsBackground) {
+ this.domElement.style.backgroundImage = "url(" + this.errorImage + ")";
+ this._setImgSrc(this._transparentImage)
+ }
+ else
+ this._setImgSrc(this.errorImage);
+ this.domElement.setAttribute("imageLoaded", String.empty)
+ }
+ else {
+ if (this._removeEventHandlersOnError)
+ this.domElement.removeEventListener("load", this._handleLoaded);
+ this.hide(this.domElement);
+ this.domElement.removeAttribute("imageLoaded");
+ this._propagateImageLoadCompleteEventIfNeeded()
+ }
+ }
+ }, _handleLoaded: function _handleLoaded() {
+ if (this.domElement) {
+ this.domElement.removeEventListener("error", this._handleError);
+ this.domElement.removeEventListener("load", this._handleLoaded);
+ this.domElement.setAttribute("imageLoaded", String.empty);
+ var transparentImage = this._transparentImage;
+ if (this.applyImageAsBackground && this.domElement.src && this.domElement.src.indexOf(transparentImage, this.domElement.src.length - transparentImage.length) < 0) {
+ this.domElement.style.backgroundImage = "url(" + this.domElement.src.toString() + ")";
+ this._setImgSrc(transparentImage)
+ }
+ this._propagateImageLoadCompleteEventIfNeeded();
+ this.show(this.domElement)
+ }
+ }, _propagateImageLoadCompleteEventIfNeeded: function _propagateImageLoadCompleteEventIfNeeded() {
+ if (this.propagateImageLoadCompleteEvent) {
+ var imageLoadCompleteEvent = document.createEvent("Event");
+ imageLoadCompleteEvent.initEvent("imageLoadComplete", true, true);
+ imageLoadCompleteEvent.detail = {loaded: this.domElement ? this.domElement.hasAttribute("imageLoaded") : false};
+ this.domElement._naturalWidth = this.naturalWidth;
+ this.domElement._naturalHeight = this.naturalHeight;
+ this.domElement.dispatchEvent(imageLoadCompleteEvent);
+ this.imageLoadCompleteEventFired = true
+ }
+ }, loadImage: function loadImage(target) {
+ return WinJS.Promise.as(target)
+ }, _setImgSrc: function _setImgSrc(url) {
+ this.domElement.src = url;
+ if (this.disableLazyDecode)
+ var touchImage = this.domElement.complete;
+ if (this.domElement && this.domElement.parentElement && this.parentStyleIfNotEmpty)
+ if (url)
+ WinJS.Utilities.addClass(this.domElement.parentElement, this.parentStyleIfNotEmpty);
+ else
+ WinJS.Utilities.removeClass(this.domElement.parentElement, this.parentStyleIfNotEmpty)
+ }, _loadImage: function _loadImage(target) {
+ if (!this._enabled || !this.domElement)
+ return;
+ this.hide(this.domElement);
+ if (!target) {
+ if (this.clearSrcOnEmptyTarget) {
+ if (this.applyImageAsBackground)
+ this.domElement.style.backgroundImage = String.empty;
+ this._setImgSrc(String.empty)
+ }
+ return
+ }
+ if (this._loadPromise) {
+ this._loadPromise.cancel();
+ this._loadPromise = null
+ }
+ this._loadPromise = this.loadImage(target).done(function(result) {
+ if (this.domElement) {
+ this.domElement.addEventListener("load", this._handleLoaded);
+ this.domElement.addEventListener("error", this._handleError);
+ result = result || this.defaultImagePath;
+ if (!this.domElement.hasAttribute("imageLoaded") || result !== this.defaultImagePath)
+ try {
+ this._setImgSrc(result)
+ }
+ catch(e) {
+ fxassert(false, "Error setting image URL: " + result);
+ this._handleError()
+ }
+ }
+ this._loadPromise = null
+ }.bind(this), this._handleError.bind(this))
+ }, hide: function hide(element){}, show: function show(element){}, _delayInitialized: function _delayInitialized() {
+ if (!this._enabled) {
+ this._enabled = true;
+ this._loadImage(this.target)
+ }
+ }, unload: function unload() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._loadPromise) {
+ this._loadPromise.cancel();
+ this._loadPromise = null
+ }
+ if (this._freezePromise) {
+ this._freezePromise.cancel();
+ this._freezePromise = null
+ }
+ this._previousSrc = null;
+ this._previousBackgroundImage = null;
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, target: {
+ get: function target_get() {
+ return this._target
+ }, set: function target_set(value) {
+ if (this.target !== value) {
+ this._target = value;
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ if (this._target && this.bindTargetProperties)
+ this._bindings = WinJS.Binding.bind(this, {target: {imageUri: function() {
+ this._loadImage(value)
+ }.bind(this)}});
+ else
+ this._loadImage(value)
+ }
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {ReferenceDisposer: MS.Entertainment.UI.Framework.define(function ReferenceDisposer(classInstance) {
+ fxassert(classInstance, "Must provide a class to define properties with");
+ this._classInstance = classInstance;
+ this._attachedReferences = []
+ }, {
+ _attachedReferences: null, _classInstance: null, _disposeReference: function _disposeReference(reference) {
+ if (reference) {
+ if (Array.isArray(reference))
+ while (reference.length > 0)
+ this._disposeReference(reference.pop());
+ if (reference.cancel)
+ reference.cancel();
+ if (reference.dispose)
+ reference.dispose()
+ }
+ }, createReference: function createReference(variableName) {
+ var referenceNumber = null;
+ var initialVariableValue = this._classInstance[variableName];
+ Object.defineProperty(this._classInstance, variableName, {
+ set: function setReference(value) {
+ if (referenceNumber === null || referenceNumber >= this._attachedReferences.length) {
+ referenceNumber = this._attachedReferences.push(value) - 1;
+ initialVariableValue = null
+ }
+ else {
+ this._disposeReference(this._attachedReferences[referenceNumber]);
+ this._attachedReferences[referenceNumber] = value
+ }
+ }.bind(this), get: function getReference() {
+ return this._attachedReferences[referenceNumber]
+ }.bind(this)
+ });
+ return initialVariableValue
+ }, dispose: function dispose() {
+ while (this._attachedReferences.length > 0)
+ this._disposeReference(this._attachedReferences.pop())
+ }
+ })})
+})()
+})();
+/* >>>>>>/framework/scriptvalidator.js:9042 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ var skipValidation = true;
+ if (!skipValidation) {
+ var baseLength = (window.location.protocol + "//" + window.location.host).length;
+ var isInUnitTest = (window.isInUnitTest);
+ var existingScripts = [];
+ var scriptsAfterMainChecked = false
+ }
+ function getCurrentScripts(currentScripts, headScripts) {
+ if (skipValidation)
+ return [];
+ var scripts = currentScripts || [];
+ var documentScripts = headScripts || document.head.querySelectorAll("script[src]");
+ var scriptsLength = scripts.length;
+ var documentScriptsLength = documentScripts.length;
+ for (var i = scriptsLength; i < documentScriptsLength; i++)
+ scripts.push(documentScripts[i].src.substr(baseLength).toLowerCase());
+ return scripts
+ }
+ function scriptValidator(files) {
+ if (isInUnitTest || skipValidation || window.loadingMergedJsFile)
+ return;
+ if (!existingScripts.length)
+ existingScripts = getCurrentScripts(existingScripts, headScripts);
+ var scriptsToCheck = Array.prototype.map.call(arguments, function(item) {
+ return item.toLowerCase()
+ });
+ scriptsToCheck.forEach(function(path) {
+ if (MS && MS.Entertainment && MS.Entertainment.UI && MS.Entertainment.UI.Framework && MS.Entertainment.UI.Framework.scriptMappings && MS.Entertainment.UI.Framework.scriptMappings[path])
+ path = MS.Entertainment.UI.Framework.scriptMappings[path];
+ var isAbsolute = (path.charAt(0) === "/");
+ if (!isAbsolute)
+ fail("File: " + path + " was not an absolute path");
+ validateScriptIncluded(path, existingScripts);
+ if (existingScripts.indexOf(path) < 0)
+ existingScripts.push(path)
+ });
+ var headScripts = document.head.querySelectorAll("script[src]");
+ if (headScripts.length !== existingScripts.length)
+ existingScripts = getCurrentScripts(existingScripts, headScripts)
+ }
+ {};
+ Object.defineProperty(window, "scriptValidator", {
+ value: scriptValidator, writable: false, enumerable: true, configurable: false
+ });
+ window.scriptValidator.getUnreferencedScripts = function getUnreferencedScripts() {
+ var unreferencedScripts = [];
+ getCurrentScripts().forEach(function(item) {
+ if (existingScripts.indexOf(item) < 0)
+ unreferencedScripts.push(item)
+ });
+ return unreferencedScripts
+ };
+ function validateScriptIncluded(script, currentScripts) {
+ var foundAt = currentScripts.indexOf(script);
+ if (foundAt < 0) {
+ fail("Script: " + script + " was not found in the script tags");
+ return
+ }
+ }
+ function fail(message) {
+ if (MS && MS.Entertainment && MS.Entertainment.assert)
+ MS.Entertainment.assert(false, message);
+ else {
+ alert(message);
+ debugger
+ }
+ }
+})()
+})();
+/* >>>>>>/framework/debug.js:9116 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ var e = WinJS.Promise.wrapError();
+ var d = Object.getPrototypeOf(e).done;
+ Object.getPrototypeOf(e).done = function(c, e, p) {
+ e = e || function(v) {
+ if (!(v instanceof Error)) {
+ var description;
+ try {
+ if (v && Object.keys(v).length === 0)
+ description = "Empty object: " + JSON.stringify(v);
+ else
+ description = JSON.stringify(v)
+ }
+ catch(e) {
+ description = "[unknown]"
+ }
+ v = {
+ number: 0, stack: "", description: description
+ }
+ }
+ else if (v.name === "Canceled")
+ return;
+ debugger;
+ MSApp.terminateApp(v)
+ };
+ d.call(this, c, e, p)
+ };
+ var c = WinJS.Promise.wrap();
+ Object.getPrototypeOf(c).done = function(c) {
+ this.then(c).then(null, function(v) {
+ if (!(v instanceof Error)) {
+ var description;
+ try {
+ description = JSON.stringify(v)
+ }
+ catch(e) {
+ description = "[unknown]"
+ }
+ v = {
+ number: 0, stack: "", description: description
+ }
+ }
+ else if (v.name === "Canceled")
+ return;
+ debugger;
+ MSApp.terminateApp(v)
+ })
+ };
+ var isInUnitTest = window.isInUnitTest;
+ var alertsToShow = [];
+ var dialogVisible = false;
+ var showPendingAlerts = function showPendingAlerts() {
+ if (dialogVisible || !alertsToShow.length)
+ return;
+ dialogVisible = true;
+ if (!MS.Entertainment.Utilities.isApp2Platform)
+ new Windows.UI.Popups.MessageDialog(alertsToShow.shift()).showAsync().done(function() {
+ dialogVisible = false;
+ showPendingAlerts()
+ })
+ };
+ window.alert = function(message) {
+ if (window.console && window.console.log)
+ window.console.log(message);
+ if (!isInUnitTest) {
+ alertsToShow.push(message);
+ showPendingAlerts()
+ }
+ }
+})();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Debug", {
+ write: (function() {
+ var debugUtility = null;
+ var console = window.console;
+ return function write(text) {
+ text = (new Date).toLocaleTimeString() + ": " + text;
+ if (console && console.log)
+ console.log(text);
+ if (!debugUtility)
+ debugUtility = new Microsoft.Entertainment.Util.Debug;
+ debugUtility.outputDebugString(text)
+ }
+ })(), writeLine: function writeLine(text) {
+ MS.Entertainment.UI.Debug.write(text + "\n")
+ }, defineAssert: function defineAssert(ns) {
+ var resolvedNamespace = WinJS.Utilities.getMember(ns);
+ if (resolvedNamespace && resolvedNamespace.assert)
+ return;
+ WinJS.Namespace.define(ns, {
+ assert: function assert(condition, message, optional_parameter, optional_errorLevel) {
+ optional_errorLevel = optional_errorLevel || MS.Entertainment.UI.Debug.errorLevel.high;
+ return MS.Entertainment.UI.Debug._doAssert(condition, ns, message, optional_parameter, optional_errorLevel)
+ }, fail: function fail(message, optional_parameter, optional_errorLevel) {
+ WinJS.Utilities.getMember(ns).assert(false, message, optional_parameter, optional_errorLevel)
+ }
+ })
+ }, errorLevel: {
+ high: 0, low: 10
+ }, getStackTrace: function getStackTrace() {
+ var stackTrace = "";
+ try {
+ throw new Error;
+ }
+ catch(e) {
+ stackTrace = e.stack
+ }
+ return stackTrace
+ }, unhandledPromiseErrorHandler: function unhandledPromiseErrorHandler(error) {
+ try {
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios()
+ }
+ catch(e) {}
+ if (MS.Entertainment.handleError && MS.Entertainment.handleError(error))
+ return true;
+ else if (error.detail && error.detail.promise) {
+ var errorString = String.empty;
+ try {
+ errorString = JSON.stringify(error.detail)
+ }
+ catch(e) {}
+ if (error.detail.exception && error.detail.exception.stack)
+ MS.Entertainment.fail("Unhandled error in a promise. Error exception was:" + error.detail.exception + ".\n " + "Stack: " + error.detail.exception.stack + ".\n " + "Detailed Error Info was: " + errorString);
+ else {
+ var detailedErrorInfo;
+ if (error.detail.error) {
+ detailedErrorInfo = {
+ errorCode: error.detail.error.errorCode, description: error.detail.error.description
+ };
+ if (error.detail.error.asyncOpSource)
+ detailedErrorInfo.asyncOpSourceStack = error.detail.error.asyncOpSource.stack
+ }
+ var detailedErrorInfoString = String.empty;
+ try {
+ detailedErrorInfoString = JSON.stringify(detailedErrorInfo)
+ }
+ catch(e) {}
+ MS.Entertainment.fail("Unhandled error in a promise. Error exception was:" + error.detail.exception + ".\n " + "Error was:" + error.detail.error + ".\n " + "Detailed Error Info was: " + detailedErrorInfoString + ".\n " + "Additional Error Data: " + errorString)
+ }
+ return true
+ }
+ return false
+ }, handleAssert: function handleAssert(condition, area, message, parameter, errorLevel) {
+ if (MS.Entertainment.UI.Debug._configurationManager === null)
+ MS.Entertainment.UI.Debug._configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var ignoreLowPriorityAsserts;
+ if (MS.Entertainment.UI.Debug._configurationManager && MS.Entertainment.UI.Debug._configurationManager.shell)
+ ignoreLowPriorityAsserts = MS.Entertainment.UI.Debug._configurationManager.shell.ignoreLowPriorityAsserts;
+ else
+ ignoreLowPriorityAsserts = false;
+ if (errorLevel !== MS.Entertainment.UI.Debug.errorLevel.low || !ignoreLowPriorityAsserts)
+ return false;
+ else
+ return true
+ }, _doAssert: (function() {
+ var shipAssertProvider;
+ return function _doAssert(condition, area, message, parameter, errorLevel) {
+ if (!(condition) && (!MS.Entertainment.UI.Debug.handleAssert || !MS.Entertainment.UI.Debug.handleAssert(condition, area, message, parameter, errorLevel))) {
+ var stack = MS.Entertainment.UI.Debug.getStackTrace();
+ var signature = MS.Entertainment.UI.Debug._getFunctionSignature(stack);
+ try {
+ if (!shipAssertProvider)
+ shipAssertProvider = new Microsoft.Entertainment.Infrastructure.ShipAssertProvider;
+ shipAssertProvider.shipAssert(area, signature, stack, message, parameter)
+ }
+ catch(e) {}
+ }
+ }
+ })(), _getFunctionSignature: function _getFunctionSignature(stackTrace) {
+ var fnString = stackTrace.split("\n")[4];
+ var signature = fnString.substring(fnString.indexOf("at ") + 3, fnString.indexOf("(") - 1).trim();
+ return signature
+ }, _configurationManager: null
+ })
+})();
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Application.Helpers", {
+ animationsRunning: 0, failedAnimations: 0
+ });
+ var dumpElementInformation = function dumpElementInformation(message, element) {
+ if (console && console.msIsIndependentlyComposed)
+ console.log(message + element.id + ", classes: " + element.className + ", independent: " + console.msIsIndependentlyComposed(element) + ", control: " + element.getAttribute("data-win-control"))
+ };
+ var dumpHiddenInfo = function dumpHiddenInfo(element) {
+ var computedStyle;
+ var workingElement = element;
+ while (workingElement) {
+ computedStyle = window.getComputedStyle(workingElement);
+ if (workingElement.className.indexOf && workingElement.className.indexOf("hideFromDisplay") >= 0)
+ dumpElementInformation("Element has the 'hideFromDisplay' class applied. ID:", workingElement);
+ else if (workingElement.currentStyle && workingElement.currentStyle.visibility && workingElement.currentStyle.visibility === "hidden")
+ dumpElementInformation("Element has visibility set directly. visibility: " + workingElement.currentStyle.visibility + " ID:", workingElement);
+ else if (computedStyle["visibility"] && computedStyle["visibility"] === "hidden")
+ dumpElementInformation("Element, or parent is hidden. visibility: " + workingElement.style.visibility + " ID:", workingElement);
+ else if (computedStyle["display"] === "none")
+ dumpElementInformation("Element, or parent is display: none. ID:", workingElement);
+ if (computedStyle["opacity"] === 0)
+ dumpElementInformation("Element, or parent has an opacity of 0. ID:", workingElement);
+ if (computedStyle["z-index"] < 0)
+ dumpElementInformation("Element, or parent has a negative z-index. ID:", workingElement);
+ workingElement = workingElement.parentElement
+ }
+ };
+ window.addEventListener("animationstart", function animationsStartedTracing(e) {
+ if (console && console.msIsIndependentlyComposed) {
+ if (!console.msIsIndependentlyComposed(e.srcElement)) {
+ dumpElementInformation("****animation not independently composed:" + e.animationName + ", ", e.srcElement);
+ dumpHiddenInfo(e.srcElement);
+ MS.Entertainment.UI.Application.Helpers.failedAnimations++
+ }
+ }
+ else
+ MS.Entertainment.UI.Application.Helpers.failedAnimations = "N/A";
+ MS.Entertainment.UI.Application.Helpers.animationsRunning++
+ });
+ window.addEventListener("animationend", function animationsStartedTracing(e) {
+ MS.Entertainment.UI.Application.Helpers.animationsRunning--
+ });
+ window.addEventListener("transitionstart", function transitionsStartedTracing(e) {
+ if (console && console.msIsIndependentlyComposed && !console.msIsIndependentlyComposed(e.srcElement)) {
+ dumpElementInformation("****transition not independently composed:" + e.propertyName + ", ", e.srcElement);
+ dumpHiddenInfo(e.srcElement);
+ MS.Entertainment.UI.Application.Helpers.failedAnimations++
+ }
+ {}
+ });
+ MS.Entertainment.UI.Debug.defineAssert("Trace")
+})()
+})();
+/* >>>>>>/framework/utilities.js:9352 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment");
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI");
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Framework");
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Utilities");
+(function() {
+ "use strict";
+ Object.defineProperty(Array.prototype, 'unique', {
+ value: function() {
+ var isUnique = function isUnique(element, index, array) {
+ return array.indexOf(element) === index
+ };
+ return this.filter(isUnique)
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'merge', {
+ value: function() {
+ var result = [];
+ if (this && this.length > 0)
+ this.forEach(function(array) {
+ result = result.concat(array)
+ });
+ return result
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'interleave', {
+ value: function() {
+ var result = [];
+ if (this && this.length > 0) {
+ var maxLength = -1;
+ this.forEach(function(array) {
+ if (!isNaN(array.length))
+ maxLength = Math.max(maxLength, array.length)
+ });
+ for (var i = 0; i < maxLength; i++)
+ this.forEach(function(array) {
+ if (!isNaN(array.length) && i < array.length)
+ result.push(array[i])
+ })
+ }
+ return result
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'spliceArray', {
+ value: function(index, deleteCount, items) {
+ var args = [index, deleteCount].concat(items);
+ return this.splice.apply(this, args)
+ }, enumerable: false
+ });
+ Object.defineProperty(Array.prototype, 'clone', {
+ value: function() {
+ return this.slice(0)
+ }, enumerable: false
+ });
+ (function() {
+ if (String['load'])
+ throw"String function already has a load function defined";
+ else if (String.prototype['format'])
+ throw"String prototype already has a format function defined";
+ if (!String.empty)
+ Object.defineProperty(String, "empty", {
+ value: "", writable: false, enumerable: true
+ });
+ if (!String.isString)
+ Object.defineProperty(String, "isString", {
+ value: function(value) {
+ return typeof value === "string"
+ }, writable: false, enumerable: true
+ });
+ if (!String.nbsp)
+ Object.defineProperty(String, "nbsp", {
+ value: "\u00A0", writable: false, enumerable: true
+ });
+ if (!String.ltrm)
+ Object.defineProperty(String, "ltrm", {
+ value: "\u200E", writable: false, enumerable: true
+ });
+ if (!String.ltrmCode)
+ Object.defineProperty(String, "ltrmCode", {
+ value: 0x200E, writable: false, enumerable: true
+ });
+ if (!String.rtlm)
+ Object.defineProperty(String, "rtlm", {
+ value: "\u200F", writable: false, enumerable: true
+ });
+ if (!String.rtlmCode)
+ Object.defineProperty(String, "rtlmCode", {
+ value: 0x200F, writable: false, enumerable: true
+ });
+ var resourceLoader;
+ try {
+ resourceLoader = new Windows.ApplicationModel.Resources.ResourceLoader
+ }
+ catch(err) {
+ MS.Entertainment.fail("Windows.ApplicationModel.Resources.ResourceLoader failed with error: " + err)
+ }
+ String.idOverride = [];
+ String.load = function loadString(stringId, skipIdVision) {
+ if (!resourceLoader)
+ return String.empty;
+ if (String.idOverride[stringId])
+ stringId = String.idOverride[stringId];
+ MS.Entertainment.assert(stringId, "Can't find stringId: '" + stringId + "'");
+ var loadedString = resourceLoader.getString(stringId);
+ MS.Entertainment.assert(loadedString, "String lookup failed: '" + stringId + "'");
+ return loadedString
+ }
+ })();
+ String.prototype.format = function formatString() {
+ var argumentList = arguments;
+ var matchNum = this.match(/{(\d+)}/g);
+ if (!matchNum) {
+ MS.Entertainment.assert(false, "string value, '" + this.toString() + "', has no placeholders to allow for replacement");
+ return this.toString()
+ }
+ if (matchNum.length !== argumentList.length) {
+ MS.Entertainment.assert(false, "Incorrect number of arguments passed into format function. String: {0} Expected: {1}; Received: {2}".format(this.toString(), matchNum.length, argumentList.length));
+ return String.empty
+ }
+ return this.replace(/{(\d+)}/g, function(placeholder, index) {
+ return argumentList[index] !== undefined ? argumentList[index] : placeholder
+ })
+ };
+ String.prototype.editDistanceFrom = function editDistanceFrom(targetString) {
+ if (!targetString)
+ return -1;
+ var editMatrix = new Array(this.length + 1);
+ for (var i = 0; i <= this.length; i++)
+ editMatrix[i] = new Array(targetString.length + 1);
+ for (var i = 0; i <= this.length; i++)
+ editMatrix[i][0] = i;
+ for (var j = 0; j <= targetString.length; j++)
+ editMatrix[0][j] = j;
+ for (var j = 0; j < targetString.length; j++)
+ for (var i = 0; i < this.length; i++)
+ if (this[i] === targetString[j])
+ editMatrix[i + 1][j + 1] = editMatrix[i][j];
+ else {
+ var deleteDistance = editMatrix[i][j + 1] + 1;
+ var insertDistance = editMatrix[i + 1][j] + 1;
+ var substituteDistance = editMatrix[i][j] + 1;
+ editMatrix[i + 1][j + 1] = Math.min(deleteDistance, insertDistance, substituteDistance)
+ }
+ return editMatrix[this.length][targetString.length]
+ };
+ (function() {
+ if (WinJS && WinJS.Promise && !WinJS.Promise.isCanceledError)
+ Object.defineProperty(WinJS.Promise, "isCanceledError", {
+ value: function isCanceled(error) {
+ return (error && error.name === "Canceled")
+ }, writable: false, enumerable: true
+ })
+ })();
+ (function() {
+ var secondMS = 1000;
+ var minuteMS = 60 * secondMS;
+ var hourMS = 60 * minuteMS;
+ var dayMS = 24 * hourMS;
+ Date.minValue = new Date(0);
+ Date.getTimeUTC = function toUTC(date) {
+ return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())
+ };
+ Date.subtract = function subtract(date1, date2) {
+ var delta = Date.getTimeUTC(date1) - Date.getTimeUTC(date2);
+ var result = {
+ days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0
+ };
+ result.days = Math.floor(delta / dayMS);
+ delta = delta - (result.days * dayMS);
+ result.hours = Math.floor(delta / hourMS);
+ delta = delta - (result.hours * hourMS);
+ result.minutes = Math.floor(delta / minuteMS);
+ delta = delta - (result.minutes * minuteMS);
+ result.seconds = Math.floor(delta / secondMS);
+ delta = delta - (result.seconds * secondMS);
+ result.milliseconds = delta;
+ return result
+ };
+ Date.isValidExpirationDate = function isValidExpirationDate(date) {
+ var now = new Date;
+ if (date.getFullYear() - now.getFullYear() < 100)
+ return true;
+ else
+ return false
+ };
+ function getNewConstructorFunction() {
+ return function() {
+ if (this === window)
+ throw new Error("Need to use 'new' to invoke the constructor");
+ this.base()
+ }
+ }
+ WinJS.Namespace.define("MS.Entertainment", {
+ derive: function derive(baseClass, constructor, instanceMembers, staticMembers) {
+ return MS.Entertainment.deferredDerive(baseClass, constructor, instanceMembers, staticMembers).get()
+ }, deferredDerive: function deferredDerive(baseClass, constructor, instanceMembers, staticMembers) {
+ var value;
+ return {
+ get: function entertainmentDerive_getter() {
+ if (value)
+ return value;
+ if (typeof baseClass === "string") {
+ var baseClassName = baseClass;
+ baseClass = WinJS.Utilities.getMember(baseClass);
+ MS.Entertainment.Utilities.assert(baseClass, "Could not resolve baseClass named " + baseClassName)
+ }
+ MS.Entertainment.Utilities.assert(baseClass, "Base class was not valid. Can't derive without something to derive from");
+ if (!constructor)
+ constructor = getNewConstructorFunction();
+ if (instanceMembers.base)
+ throw"Deriving requires that there is no existing 'base' property";
+ var localInstanceMembers = MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(instanceMembers);
+ var helperConstructor = function(){};
+ if (baseClass.prototype._initObservable && !baseClass.prototype._preventObservableInheritance) {
+ localInstanceMembers = WinJS.Binding.expandProperties(instanceMembers);
+ helperConstructor = function() {
+ MS.Entertainment.assert(this._backingData, "We thought this was observable. It's not, reconsider...");
+ for (var member in instanceMembers)
+ if (instanceMembers.hasOwnProperty(member))
+ this._backingData[member] = instanceMembers[member]
+ }
+ }
+ var baseConstructors = [function() {
+ baseClass.prototype.constructor.apply(this, arguments);
+ helperConstructor.call(this)
+ }];
+ if (baseClass.prototype._baseConstructors)
+ baseConstructors = baseClass.prototype._baseConstructors.concat(baseConstructors);
+ localInstanceMembers._baseConstructors = baseConstructors;
+ localInstanceMembers.base = function() {
+ if (this._baseConstructors === baseConstructors)
+ this._baseConstructors = this._baseConstructors.concat();
+ var baseConstructor = this._baseConstructors.pop();
+ if (baseConstructor)
+ baseConstructor.apply(this, arguments)
+ };
+ value = WinJS.Class.derive(baseClass, constructor, localInstanceMembers, MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(staticMembers));
+ return value
+ }, configurable: true
+ }
+ }
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment", {defineObservable: function(constructor, instanceMembers, staticMembers) {
+ return MS.Entertainment.UI.Framework.derive(WinJS.Binding.define(instanceMembers), function defineObservableConstructor() {
+ this._initObservable(Object.create(MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(instanceMembers)));
+ constructor.apply(this, arguments)
+ }, null, MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(staticMembers))
+ }});
+ WinJS.Namespace.define("MS.Entertainment", {defineOptionalObservable: function(constructor, instanceMembers, observableMembers, staticMembers) {
+ return MS.Entertainment.UI.Framework.derive(WinJS.Binding.define(observableMembers), function defineOptionalObservableConstructor() {
+ if (this === window)
+ throw new Error("Need to use 'new' to invoke the constructor");
+ if (observableMembers)
+ this._initObservable(Object.create(observableMembers));
+ constructor.apply(this, arguments)
+ }, instanceMembers, MS.Entertainment.UI.Framework.markFunctionsOfObjectAsSupportedForProcessing(staticMembers))
+ }});
+ WinJS.Namespace.define("MS.Entertainment", {
+ _appMode: null, appMode: {
+ get: function() {
+ if (this._appMode === null)
+ this._appMode = (new Microsoft.Entertainment.Application.ApplicationStatics).appMode;
+ return this._appMode
+ }, set: function(value) {
+ this._appMode = value
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {EventSource: MS.Entertainment.UI.Framework.define(function eventSource() {
+ this._eventhandlers = [];
+ this._eventSource = new MS.Entertainment.UI.Framework.ObservableBase
+ }, {
+ _eventSource: null, _eventhandlers: null, addEventHandlers: function addEventHandlers(events) {
+ MS.Entertainment.UI.assert(!Array.isArray(events), "Events passed in cannot be an array");
+ var eventHandlers;
+ eventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._eventSource, events);
+ this._eventhandlers.push(eventHandlers);
+ return eventHandlers
+ }, dispose: function dispose() {
+ for (var i = 0; i < this._eventhandlers.length; i++)
+ this._eventhandlers[i].cancel();
+ this._eventhandlers = []
+ }, dispatchEvent: function dispatchEvent(eventName, parameters) {
+ this._eventSource.dispatchEvent(eventName, parameters)
+ }
+ })});
+ var isNetworkAvailable = function isNetworkAvailable() {
+ try {
+ return MS.Entertainment.UI.NetworkStatusService.isOnline()
+ }
+ catch(ex) {
+ MS.Entertainment.fail("Exception in isNetworkAvailable, make sure uiState service has been registered prior playback attempt: " + MS.Entertainment.Utilities.stringify(ex));
+ return true
+ }
+ };
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ playabilityTest: function(mediaItem, options) {
+ var mediaRightsConditions = null;
+ var returnObj = {notificationText: null};
+ if (!mediaItem)
+ return returnObj;
+ var ServiceLocator = MS.Entertainment.ServiceLocator;
+ var Services = MS.Entertainment.Services;
+ if (options.cloudRights && ServiceLocator.isServiceRegistered(Services.cloudRestrictionCollection))
+ mediaRightsConditions = ServiceLocator.getService(Services.cloudRestrictionCollection);
+ var leastRestrictiveRights;
+ if (!mediaItem.fileItem) {
+ if (!mediaRightsConditions && ServiceLocator.isServiceRegistered(Services.trackRestrictionCollection) && options.mediaRights)
+ mediaRightsConditions = ServiceLocator.getService(Services.trackRestrictionCollection);
+ if (mediaRightsConditions)
+ leastRestrictiveRights = mediaRightsConditions.getLeastRestrictive(mediaItem, options.rights);
+ if (leastRestrictiveRights && leastRestrictiveRights.description) {
+ returnObj.notificationText = leastRestrictiveRights.description;
+ returnObj.isUnplayable = leastRestrictiveRights.isUnplayable;
+ returnObj.isUnavailable = !!leastRestrictiveRights.isUnavailable;
+ returnObj.leastRestrictiveRights = leastRestrictiveRights;
+ if (leastRestrictiveRights.actionId) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ returnObj.notificationAction = actionService.getAction(leastRestrictiveRights.actionId)
+ }
+ }
+ }
+ else {
+ returnObj.isUnavailable = !mediaItem.fileItem.isAvailable;
+ returnObj.isPlayable = !returnObj.isUnavailable;
+ mediaItem.canPlayLocally = returnObj.isPlayable;
+ return returnObj
+ }
+ var shouldSkipItem = !mediaItem.playPreviewOnly && (returnObj.isUnavailable || returnObj.isUnplayable);
+ returnObj.notConnected = false;
+ if (!shouldSkipItem && !mediaItem.canPlayLocally && !isNetworkAvailable()) {
+ returnObj.notConnected = true;
+ shouldSkipItem = true
+ }
+ returnObj.explicitAllowed = true;
+ if (options.checkExplicit && mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ if (mediaItem.isExplicit && !mediaItem.inCollection && mediaItem.libraryId === -1) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ var canPlayExplicit = signedInUser.hasExplicitPrivilege;
+ if ((signInService.isSignedIn && !canPlayExplicit) || !signInService.isSignedIn) {
+ returnObj.explicitAllowed = false;
+ returnObj.notificationText = String.load(String.id.IDS_MUSIC_ALBUM_DETAILS_ITEM_EXPLICIT_BANNER_NOTIFICATION_TITLE);
+ shouldSkipItem = true
+ }
+ }
+ returnObj.isPlayable = !shouldSkipItem;
+ return returnObj
+ }, playabilityTestAsync: (function playabilityTestAsync_closure() {
+ function shouldQueryMediaState(playability) {
+ return !playability.isPlayable && !playability.notConnected && playability.explicitAllowed
+ }
+ return function playabilityTestAsync(mediaItem, options) {
+ var playability = MS.Entertainment.Utilities.playabilityTest(mediaItem, options);
+ if (shouldQueryMediaState(playability))
+ return MS.Entertainment.ViewModels.SmartBuyStateEngine.queryMediaStateAsync(mediaItem, null).then(function onMediaState(state) {
+ if (state.canPlay)
+ playability.isPlayable = true;
+ return playability
+ }, function queryStateFailed(error) {
+ return playability
+ });
+ else
+ return WinJS.Promise.wrap(playability)
+ }
+ })()
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities.DRM", {individualizationAsync: function() {
+ if (MS.Entertainment.Platform.Playback.drmIndividualizationPromise)
+ return MS.Entertainment.Platform.Playback.drmIndividualizationPromise;
+ var drmIndivSignal = new MS.Entertainment.UI.Framework.Signal;
+ var versionCheckPromise = drmIndivSignal.promise;
+ MS.Entertainment.Platform.Playback.individualizationWorker = new Worker("/Components/Playback/IndivWorker.js");
+ MS.Entertainment.Platform.Playback.individualizationWorker.onmessage = function(event) {
+ drmIndivSignal.complete(event.data)
+ };
+ MS.Entertainment.Platform.Playback.drmIndividualizationPromise = versionCheckPromise.then(function checkComplete(individualizedAlready) {
+ if (individualizedAlready)
+ return true;
+ try {
+ var individualizationRequest = new Microsoft.Media.PlayReadyClient.PlayReadyIndividualizationServiceRequest;
+ return individualizationRequest.beginServiceRequest().then(function individualizationRequest_success() {
+ return true
+ }, function individualizationRequest_failure() {
+ return false
+ })
+ }
+ catch(ex) {
+ return false
+ }
+ }).then(function(isIndividualized) {
+ MS.Entertainment.Utilities.isDrmIndividualized = isIndividualized;
+ var status = isIndividualized ? "Success" : "Failure";
+ MS.Entertainment.Utilities.Telemetry.logDRMIndividualization(status);
+ return isIndividualized
+ });
+ return MS.Entertainment.Platform.Playback.drmIndividualizationPromise
+ }});
+ WinJS.Namespace.define("MS.Entertainment", {ProxyHelpers: MS.Entertainment.UI.Framework.define(null, {}, {
+ proxyObservables: function(outerObject, innerObject, observables) {
+ observables.forEach(function(observable) {
+ var externalSet = function(v) {
+ var oldValue = outerObject[observable];
+ outerObject.setProperty(observable, v);
+ if (outerObject.dispatchEvent)
+ outerObject.dispatchEvent(observable + "Changed", {
+ newValue: v, oldValue: oldValue
+ })
+ };
+ innerObject.bind(observable, externalSet);
+ Object.defineProperty(outerObject, observable, {
+ set: function(v) {
+ innerObject[observable] = v
+ }, get: function() {
+ return innerObject[observable]
+ }, enumerable: true, configurable: false
+ })
+ })
+ }, proxyProperties: function(outerObject, innerObject, properties) {
+ properties.forEach(function(property) {
+ Object.defineProperty(outerObject, property, {
+ set: function(v) {
+ innerObject[property] = v
+ }, get: function() {
+ return innerObject[property]
+ }, enumerable: true, configurable: false
+ })
+ })
+ }, delegateFunctions: function(outerObject, innerObject, methods) {
+ methods.forEach(function(method) {
+ Object.defineProperty(outerObject, method, {
+ value: function() {
+ return innerObject[method].apply(innerObject, arguments)
+ }, enumerable: true, configurable: false
+ })
+ })
+ }
+ })});
+ (function() {
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ bindWorker: MS.Entertainment.UI.Framework.bindWorker, weakElementBindingInitializer: MS.Entertainment.UI.Framework.weakElementBindingInitializer, checkIfInDom: MS.Entertainment.UI.Framework.checkIfInDom, forceFullLayout: MS.Entertainment.UI.Framework.forceFullLayout, thawControlsInSubtree: MS.Entertainment.UI.Framework.thawControlsInSubtree, freezeControlsInSubtree: MS.Entertainment.UI.Framework.freezeControlsInSubtree, empty: MS.Entertainment.UI.Framework.empty, addEventHandlers: MS.Entertainment.UI.Framework.addEventHandlers, removeEvents: MS.Entertainment.UI.Framework.removeEvents
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ EventInvoker: WinJS.Class.mix(function() {
+ this._initObservable()
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin), assertError: function assertError(message, error) {
+ if (!error)
+ return;
+ MS.Entertainment.Utilities.assert(WinJS.Promise.isCanceledError(error), "{0} [Error Number: {1}] [Error Code: {2}] [Error Async Type: {3}] [Error Async Causality: {4}] [Error Message: {5}] [Error Stack: {6}]".format(message, error.number, error.errorCode, error.asyncOpType, error.asyncOpCausalityId, error.message, error.stack))
+ }, attachResizeEvent: function attachEvent(object, callback) {
+ if (object.attachEvent)
+ object.attachEvent("onresize", callback);
+ else
+ object.addEventListener("mselementresize", callback);
+ return {cancel: function() {
+ MS.Entertainment.Utilities.detachResizeEvent(object, callback)
+ }}
+ }, detachResizeEvent: function detachEvent(object, callback) {
+ if (object.detachEvent)
+ object.detachEvent("onresize", callback);
+ else
+ object.removeEventListener("mselementresize", callback)
+ }, attachPropertyChangeEvent: function attachPropertyChangeEvent(object, callback) {
+ if (object.attachEvent)
+ object.attachEvent("onpropertychange", callback);
+ else {
+ var callbackWrapper = function callbackWrapper(evt) {
+ var element = null;
+ var propertyName = null;
+ if (evt && evt[0]) {
+ element = evt[0].target;
+ propertyName = evt[0].attributeName
+ }
+ callback({
+ srcElement: element, propertyName: propertyName
+ })
+ };
+ return new MutationObserver(callbackWrapper).observe(object, {
+ attributes: true, attributeFilter: ["aria-selected", "aria-pressed"]
+ })
+ }
+ }, detachPropertyChangeEvent: function detachPropertyChangeEvent(object, callback) {
+ if (object.detachEvent)
+ object.detachEvent("onpropertychange", callback)
+ }, waitForDomEvent: function waitForDomEvent(eventName, element, capture) {
+ return MS.Entertainment.Utilities.waitForDomEventMultipleTimes(eventName, element, 1, capture)
+ }, waitForDomEventMultipleTimes: function waitForDomEventMultipleTimes(eventName, element, numEvents, capture) {
+ if (!element || !element.addEventListener || !eventName)
+ throw new Error("Invalid args: eventName: {0}, element: {1}".format(eventName, element && JSON.stringify(element)));
+ numEvents = numEvents || 1;
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ var onEvent = function onEvent(event) {
+ numEvents--;
+ if (numEvents === 0) {
+ element.removeEventListener(eventName, onEvent, capture);
+ signal.complete(event)
+ }
+ };
+ element.addEventListener(eventName, onEvent, capture);
+ return signal.promise.then(function onComplete(result) {
+ return result
+ }, function onError(err) {
+ element.removeEventListener(eventName, onEvent, capture);
+ return err
+ })
+ }, waitForPropertyValue: function waitForPropertyValue(source, propertyName, propertyValueToWaitFor) {
+ Trace.assert(source, "waitForPropertyValue - no source specified.");
+ Trace.assert(propertyName, "waitForPropertyValue - no propertyName specified.");
+ if (source[propertyName] === propertyValueToWaitFor)
+ return WinJS.Promise.as();
+ var bindings;
+ var bindingMap = {};
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ var onPropertyChanged = function onPropertyChanged(value) {
+ if (value === propertyValueToWaitFor)
+ signal.complete()
+ };
+ var cancelBindings = function cancelBindings() {
+ if (bindings) {
+ bindings.cancel();
+ bindings = null
+ }
+ };
+ bindingMap[propertyName] = onPropertyChanged;
+ bindings = WinJS.Binding.bind(source, bindingMap);
+ return signal.promise.then(cancelBindings, cancelBindings)
+ }, validateIsMemberOrThrow: function validateIsMemberOrThrow(value, object) {
+ var member = "";
+ for (member in object)
+ if (object.hasOwnProperty(member) && value === object[member])
+ return;
+ throw"validateIsMemberOrThrow: Value not found in object.";
+ }, loadHtmlPage: function loadHtmlPage(filePath, targetElement, dataContext) {
+ MS.Entertainment.Utilities.assert(targetElement, "No destination element was passed");
+ var container;
+ var load;
+ return WinJS.UI.Fragments.renderCopy(filePath).then(function placeHtmlPageInDom(fragment) {
+ var loadName;
+ var loadTags;
+ if (typeof targetElement === "string")
+ container = document.getElementById(targetElement);
+ else
+ container = targetElement;
+ MS.Entertainment.Utilities.assert(container, "Page container supplied couldn't be found");
+ MS.Entertainment.Utilities.empty(container);
+ loadTags = fragment.querySelectorAll("[data-ent-fragmentLoad]");
+ if (loadTags && loadTags.length > 0)
+ for (var i = 0, l = loadTags.length; i < l; i++)
+ if (loadTags[i].nodeName !== "BODY") {
+ loadName = loadTags[i].getAttribute("data-ent-fragmentLoad");
+ break
+ }
+ if (loadName) {
+ load = WinJS.Utilities.getMember(loadName);
+ MS.Entertainment.Utilities.assert(load, "Load function was not located: " + loadName)
+ }
+ container.appendChild(fragment)
+ }).then(function waitOnData() {
+ return dataContext
+ }).then(function(data) {
+ dataContext = data;
+ return WinJS.UI.processAll(container)
+ }).then(function() {
+ return WinJS.Binding.processAll(container, dataContext)
+ }).then(function callCallbacks() {
+ if (load)
+ load(container.children[0])
+ })
+ }, documentAlreadyProcessed: false, systemAppListenersAttached: false, processAllOnDocumentLoaded: function processAllOnDocumentLoaded(element, dataContext) {
+ if (MS.Entertainment.Utilities.documentAlreadyProcessed)
+ return WinJS.Promise.timeout();
+ MS.Entertainment.Utilities.documentAlreadyProcessed = true;
+ return WinJS.Utilities.ready().then(function processAllAfterDocumentReady() {
+ return WinJS.UI.processAll(element)
+ }).then(function bindingProcessAllAfterControlProcessAll() {
+ return WinJS.Binding.processAll(element, dataContext)
+ })
+ }, isAboveMemoryCleanupThreshold: function isAboveMemoryCleanupThreshold() {
+ return MS.Entertainment.Utilities.isApp2 && MS.Entertainment.Utilities.isAboveMemoryThreshold(App2.ApplicationModel.MemoryCleanupThreshold)
+ }, isAboveMemoryThreshold: function isAboveMemoryThreshold(thresholdPercentage) {
+ MS.Entertainment.Utilities.assert(thresholdPercentage > 0.0 && thresholdPercentage <= 1.0, "thresholdPercentage must be between 0.0 and 1.0");
+ var isAboveThreshold = false;
+ var resourceLimitsObject = WinJS.Utilities.getMember("App2.ApplicationModel.ApplicationResourceLimits");
+ if (!resourceLimitsObject || thresholdPercentage <= 0.0 || thresholdPercentage > 1.0)
+ return false;
+ try {
+ var currentMemoryUsageInKB = Math.max((resourceLimitsObject.currentMemoryUsage / 1024) | 0, 1);
+ var currentPercentage = (currentMemoryUsageInKB / App2.ApplicationModel.MemoryThresholdInKB);
+ isAboveThreshold = (thresholdPercentage < currentPercentage && !isNaN(currentPercentage))
+ }
+ catch(e) {
+ MS.Entertainment.Utilities.fail("isAboveMemoryThreshold failed: " + e)
+ }
+ return isAboveThreshold
+ }, _backgroundLinkHrefCache: [], enterRestrictedBackground: function enterRestrictedBackground() {
+ var navigatonService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigatonService.clearAllNavigationState();
+ WinJS.Promise.timeout(MS.Entertainment.UI.Framework.autoCleanupTimeout + 100).then(function() {
+ MS.Entertainment.UI.Framework.currentContentContainer = null;
+ var cssLinkElements = WinJS.Utilities.query("link[href$='css']", document.head);
+ MS.Entertainment.Utilities._backgroundLinkHrefCache = cssLinkElements.map(function getLinkHref(element) {
+ element.parentElement.removeChild(element);
+ return element.href
+ });
+ MS.Entertainment.UI.Framework.clearCaches();
+ MS.Entertainment.ServiceLocator.cleanupNonCriticalServices();
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isInRestrictedBackground = true
+ })
+ }, leaveRestrictedBackground: function leaveRestrictedBackground() {
+ MS.Entertainment.Utilities._backgroundLinkHrefCache.forEach(function createLink(hrefValue) {
+ var linkElement = document.createElement("link");
+ linkElement.setAttribute("href", hrefValue);
+ linkElement.setAttribute("rel", "stylesheet");
+ linkElement.setAttribute("type", "text/css");
+ document.head.appendChild(linkElement)
+ });
+ MS.Entertainment.Utilities._backgroundLinkHrefCache = [];
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isInRestrictedBackground = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).navigateToDefaultPage()
+ }, multiStateToggleClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function multiStateToggleClassNameHelper(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var maxStates = 5;
+ for (var i = 1; i < maxStates; i++)
+ WinJS.Utilities.removeClass(targetElement, cssClassName + "_" + i);
+ if (sourceValue)
+ WinJS.Utilities.addClass(targetElement, cssClassName + "_" + sourceValue)
+ }), toggleTabIndex: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleTabIndex(sourceValue, targetElement) {
+ if (sourceValue)
+ targetElement.setAttribute("tabIndex", 0);
+ else
+ targetElement.removeAttribute("tabIndex")
+ }), toggleTabIndexNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleTabIndexNegate(sourceValue, targetElement) {
+ if (!sourceValue)
+ targetElement.setAttribute("tabIndex", 0);
+ else
+ targetElement.removeAttribute("tabIndex")
+ }), toggleClassNameOnObservableArrayLength: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLength(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length === 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), toggleClassNameOnObservableArrayLengthNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLengthNegate(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length === 0)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), toggleClassNameOnObservableArrayLengthMoreThanOne: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLengthMoreThanOne(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length > 1)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), toggleClassNameOnObservableArrayLengthMoreThanOneNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnObservableArrayLengthMoreThanOneNegate(sourceValue, targetElement, cssClassName) {
+ if (!(sourceValue instanceof MS.Entertainment.ObservableArray))
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var handleArrayChanges = function handleArrayChanges(notification) {
+ if (sourceValue.length > 1)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ };
+ sourceValue.addChangeListener(handleArrayChanges);
+ handleArrayChanges()
+ }), setAttributeValue: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassName(sourceValue, targetElement, attributeName) {
+ if (!attributeName || !targetElement)
+ return;
+ if (Array.isArray(attributeName))
+ attributeName = attributeName[0];
+ switch (attributeName) {
+ case"dataWinAutomationId":
+ attributeName = "data-win-automationId";
+ break;
+ default:
+ break
+ }
+ if (sourceValue)
+ targetElement.setAttribute(attributeName, sourceValue);
+ else if (targetElement.hasAttribute(attributeName))
+ targetElement.removeAttribute(attributeName)
+ }), toggleClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassName(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameNegate(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (!sourceValue)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleShowHideElement: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElement(sourceValue, targetElement, cssClassName) {
+ if (sourceValue)
+ MS.Entertainment.Utilities.showElement(targetElement);
+ else
+ MS.Entertainment.Utilities.hideElement(targetElement)
+ }), toggleShowHideElementNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElementNegate(sourceValue, targetElement, cssClassName) {
+ if (!sourceValue)
+ MS.Entertainment.Utilities.showElement(targetElement);
+ else
+ MS.Entertainment.Utilities.hideElement(targetElement)
+ }), getConfigValueOneTime: WinJS.Utilities.markSupportedForProcessing(function getConfigValueOneTime(source, sourceProperties, dest, destProperties) {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var configurationValue = MS.Entertainment.Utilities.valueFromPropertyPathFragments(configManager, sourceProperties);
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, configurationValue)
+ }), formatDirection: MS.Entertainment.Utilities.weakElementBindingInitializer(function formatDirection(sourceValue, targetElement) {
+ if (sourceValue) {
+ var textDirection = MS.Entertainment.Utilities.detectStringDirection(sourceValue);
+ if (textDirection && textDirection !== MS.Entertainment.Utilities.getTextDirection())
+ switch (textDirection) {
+ case MS.Entertainment.UI.Framework.TextDirections.LeftToRight:
+ WinJS.Utilities.addClass(targetElement, "ui-direction-ltr");
+ break;
+ case MS.Entertainment.UI.Framework.TextDirections.RightToLeft:
+ WinJS.Utilities.addClass(targetElement, "ui-direction-rtl");
+ break
+ }
+ else
+ WinJS.Utilities.removeClass(targetElement, "ui-direction-ltr ui-direction-rtl")
+ }
+ }), toggleClassNameViewStateNotReady: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameViewStateNotReady(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== MS.Entertainment.UI.ViewState.ready)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleShowHideElementViewStateNotReady: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElementViewStateReady(sourceValue, targetElement, cssClassName) {
+ if (sourceValue !== MS.Entertainment.UI.ViewState.ready)
+ MS.Entertainment.Utilities.hideElement(targetElement);
+ else
+ MS.Entertainment.Utilities.showElement(targetElement)
+ }), toggleShowHideElementVIewStateNotComplete: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleShowHideElementVIewStateNotComplete(sourceValue, targetElement, cssClassName) {
+ if (sourceValue !== MS.Entertainment.UI.ViewState.loading)
+ MS.Entertainment.Utilities.showElement(targetElement);
+ else
+ MS.Entertainment.Utilities.hideElement(targetElement)
+ }), toggleClassNameViewStateNotLoading: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameViewStateNotLoading(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== MS.Entertainment.UI.ViewState.loading)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameViewStateError: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameViewStateError(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue === MS.Entertainment.UI.ViewState.error)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnFeatureDisabledAndNoSubscription: WinJS.Utilities.markSupportedForProcessing(function toggleClassNameOnFeatureDisabledAndNoSubscription(source, sourceProperty, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var featureItem;
+ if (sourceProperty && sourceProperty[0])
+ featureItem = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Utilities.assert(!!featureItem, "Feature enablement feature item not defined. featureItem: " + featureItem + ", sourceProperty: " + sourceProperty + ", targetElement: " + targetElement);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (!MS.Entertainment.Utilities.currentOrLastUserSubscriptionEnabled() && featureItem && !featureEnablement.isEnabled(featureItem))
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnFeatureDisabled: WinJS.Utilities.markSupportedForProcessing(function toggleClassNameOnFeatureDisabled(source, sourceProperty, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var featureItem;
+ if (sourceProperty && sourceProperty[0])
+ featureItem = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Utilities.assert(!!featureItem, "Feature enablement feature item not defined. featureItem: " + featureItem + ", sourceProperty: " + sourceProperty + ", targetElement: " + targetElement);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureItem && !featureEnablement.isEnabled(featureItem))
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnEmptyGuid: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnEmptyGuid(smid, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (!smid || smid === MS.Entertainment.Utilities.EMPTY_GUID)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnNonNegativeNumber: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNonNegativeNumber(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue && (typeof(sourceValue) === "number") && sourceValue >= 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnNegativeNumber: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNegativeNumber(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var sourceValueIsNumber = (sourceValue || sourceValue === 0) && (typeof(sourceValue) === "number");
+ if ((sourceValueIsNumber && sourceValue < 0) || !sourceValueIsNumber)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnNonPositiveNumber: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNonPositiveNumber(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue === undefined || sourceValue === null || typeof(sourceValue) !== "number" || sourceValue <= 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleClassNameOnEmptyString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnEmptyString(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== null && sourceValue !== undefined)
+ sourceValue += String.empty;
+ if (sourceValue && sourceValue.length > 0)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ }), toggleClassNameOnEmptyOrBlankString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnEmptyOrBlankString(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== null && sourceValue !== undefined)
+ sourceValue += String.empty;
+ if (sourceValue && sourceValue.trim().length > 0)
+ WinJS.Utilities.removeClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.addClass(targetElement, cssClassName)
+ }), toggleClassNameOnNonEmptyString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameOnNonEmptyString(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue !== null && sourceValue !== undefined)
+ sourceValue += String.empty;
+ if (sourceValue && sourceValue.length > 0)
+ WinJS.Utilities.addClass(targetElement, cssClassName);
+ else
+ WinJS.Utilities.removeClass(targetElement, cssClassName)
+ }), toggleTextContentOrEmptyString: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleTextContentOrEmptyString(toggleValue, targetElement, stringID) {
+ if (toggleValue && stringID && stringID[0])
+ targetElement.innerText = String.load(stringID[0]);
+ else
+ targetElement.innerText = String.empty
+ }), appendClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function appendClassName(sourceValue, targetElement, targetProperty) {
+ if (!sourceValue)
+ return;
+ var sourceValueArray = sourceValue.split(" ");
+ for (var i = 0; i < sourceValueArray.length; i++)
+ if (sourceValueArray[i] && !WinJS.Utilities.hasClass(targetElement, sourceValueArray[i]))
+ WinJS.Utilities.addClass(targetElement, sourceValueArray[i])
+ }), removeClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function removeClassName(sourceValue, targetElement, targetProperty) {
+ if (sourceValue && WinJS.Utilities.hasClass(targetElement, sourceValue))
+ WinJS.Utilities.removeClass(targetElement, sourceValue)
+ }), limitClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function limitClassName(sourceValue, targetElement, targetProperty) {
+ if (!sourceValue || !targetElement)
+ return;
+ for (var i = 0; i < targetElement.classList.length; ) {
+ var className = targetElement.classList[i];
+ if (className && className.indexOf(targetProperty) === 0)
+ WinJS.Utilities.removeClass(targetElement, className);
+ else
+ i++
+ }
+ var sourceValueArray = sourceValue.split(" ");
+ for (var i = 0; i < sourceValueArray.length; i++) {
+ var className = sourceValueArray[i];
+ if (className && !WinJS.Utilities.hasClass(targetElement, className))
+ WinJS.Utilities.addClass(targetElement, className)
+ }
+ }), toggleMediaTypeClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleMediaTypeClassName(sourceValue, targetElement, cssClassName) {
+ if (!targetElement)
+ return;
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ var i;
+ var cssPrefix = cssClassName.toLowerCase() + "-";
+ var classList = targetElement.classList || [];
+ var mediaClasses = [];
+ for (i = 0; i < classList.length; ++i) {
+ var className = classList[i];
+ if (className.indexOf(cssPrefix) === 0)
+ mediaClasses.push(className)
+ }
+ for (i = 0; i < mediaClasses.length; ++i)
+ WinJS.Utilities.removeClass(targetElement, mediaClasses[i]);
+ if (sourceValue && sourceValue.mediaType) {
+ var mediaTypeString = MS.Entertainment.Data.Factory.Marketplace.edsMediaTypeFromDatabaseType(sourceValue.mediaType);
+ if (mediaTypeString)
+ WinJS.Utilities.addClass(targetElement, (cssPrefix + mediaTypeString).toLowerCase())
+ }
+ }), appendMediaTypeClassName: MS.Entertainment.Utilities.weakElementBindingInitializer(function appendMediaTypeClassName(sourceValue, targetElement, cssClassName) {
+ if (Array.isArray(cssClassName))
+ cssClassName = cssClassName[0];
+ if (sourceValue && sourceValue.mediaType) {
+ var mediaTypeString = MS.Entertainment.Data.Factory.Marketplace.edsMediaTypeFromDatabaseType(sourceValue.mediaType);
+ if (mediaTypeString)
+ WinJS.Utilities.addClass(targetElement, (cssClassName + "-" + mediaTypeString).toLowerCase())
+ }
+ }), toggleBoolean: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function toggleBoolean(sourceValue) {
+ return !sourceValue
+ })), toggleHideOnElement: WinJS.Utilities.markSupportedForProcessing(function toggleHideOnElement(element, switchToHidden) {
+ if (switchToHidden)
+ WinJS.Utilities.addClass(element, "removeFromDisplay");
+ else
+ WinJS.Utilities.removeClass(element, "removeFromDisplay")
+ }), useShowHideAnimationsOnValueChange: MS.Entertainment.Utilities.weakElementBindingInitializer(function useShowHideAnimationsOnValueChange(sourceValue, targetElement, elementProperty) {
+ if (sourceValue === targetElement[elementProperty])
+ return;
+ var hidePromise = null;
+ if (!WinJS.Utilities.hasClass(targetElement, "hideFromDisplay"))
+ hidePromise = MS.Entertainment.Utilities.hideElement(targetElement);
+ else
+ hidePromise = WinJS.Promise.wrap();
+ hidePromise.then(function elementHidden() {
+ targetElement[elementProperty] = sourceValue;
+ MS.Entertainment.Utilities.showElement(targetElement)
+ })
+ }), forceShowAnimationOnLoad: MS.Entertainment.Utilities.weakElementBindingInitializer(function forceShowAnimationOnLoad(sourceValue, targetElement, elementProperty) {
+ if (sourceValue && !(Array.isArray(sourceValue) && sourceValue.length === 0))
+ MS.Entertainment.Utilities.showElement(targetElement)
+ }), toggleClassOnElement: WinJS.Utilities.markSupportedForProcessing(function toggleHideOnElement(element, switchOn, className) {
+ if (Array.isArray(className))
+ className = className[0];
+ if (switchOn)
+ WinJS.Utilities.addClass(element, className);
+ else
+ WinJS.Utilities.removeClass(element, className)
+ }), toggleVoiceTarget: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassName(sourceValue, targetElement) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (sourceValue)
+ WinJS.Utilities.addClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle);
+ else
+ WinJS.Utilities.removeClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle)
+ }), toggleVoiceTargetNegate: MS.Entertainment.Utilities.weakElementBindingInitializer(function toggleClassNameNegate(sourceValue, targetElement) {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (!sourceValue)
+ WinJS.Utilities.addClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle);
+ else
+ WinJS.Utilities.removeClass(targetElement, MS.Entertainment.UI.App2.VoiceStatics.voiceTextCssStyle)
+ }), createActionFromBind: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function createActionFromBind(value) {
+ var action = value;
+ if (String.isString(action))
+ action = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(value);
+ return action
+ })), bindAndMarkSupportedForProcessing: function(fn, thisPointer) {
+ var boundFunction = fn.bind(thisPointer);
+ return WinJS.Utilities.markSupportedForProcessing(boundFunction)
+ }, findParentElementByClassName: function findParentElementByClassName(childElement, className) {
+ var parent = childElement.parentElement;
+ while (parent) {
+ if (WinJS.Utilities.hasClass(parent, className))
+ return parent;
+ parent = parent.parentElement
+ }
+ }, isNumeric: function Utilities_isNumeric(sourceString) {
+ if (sourceString === null || sourceString === undefined || typeof sourceString === "object")
+ return false;
+ var validChars = "0123456789.";
+ for (var i = sourceString.length - 1; i >= 0; i--)
+ if (validChars.indexOf(sourceString.charAt(i)) === -1)
+ return false;
+ return true
+ }, simpleEscapeHTML: function simpleEscapeHtml(text) {
+ if (text.indexOf("<") !== -1)
+ text = text.replace(/") !== -1)
+ text = text.replace(/>/g, ">");
+ return text
+ }, escapeHTML: (function escapeHTML(text) {
+ var element = null;
+ return function escapeHTML(text) {
+ if (!element)
+ element = document.createElement("div");
+ element.textContent = text;
+ return element.innerHTML
+ }
+ })(), unEscapeHTML: (function unEscapeHTML(html) {
+ var element = null;
+ return function unEscapeHTML(html) {
+ if (!element)
+ element = document.createElement("div");
+ element.innerHTML = html;
+ return element.textContent
+ }
+ })(), getChildControl: function Utilities_getChildControl(dom, name) {
+ var element;
+ try {
+ element = dom.querySelector("[data-ent-id='" + name + "']");
+ if (element && (element.winControl !== null && element.winControl !== undefined))
+ element = element.winControl
+ }
+ catch(error) {
+ MS.Entertainment.fail("Exception in getChildControl. error: " + error + " name: " + name);
+ element = null
+ }
+ return element
+ }, _millisecondsToDate: function millisecondsToDate(milliseconds) {
+ var seconds = Math.floor(milliseconds / 1000);
+ milliseconds = milliseconds % 1000;
+ var minutes = Math.floor(seconds / 60);
+ seconds = seconds % 60;
+ var hours = Math.floor(minutes / 60);
+ minutes = minutes % 60;
+ return new Date(null, null, null, hours, minutes, seconds, milliseconds)
+ }, millisecondsToTimeCode: function millisecondsToTimeCode(duration) {
+ var durationType = typeof duration;
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.dateTimeFormatters))
+ return String.empty;
+ else if (durationType === "number")
+ if (duration < 0)
+ return String.empty;
+ else
+ duration = MS.Entertainment.Utilities._millisecondsToDate(duration);
+ else if (durationType === "string")
+ duration = MS.Entertainment.Utilities._millisecondsToDate(parseInt(duration));
+ else if (!duration)
+ return String.empty;
+ var formatter;
+ var hoursString;
+ var minutesString;
+ var secondsString;
+ var hours = duration.getHours();
+ var minutes = duration.getMinutes();
+ var seconds = duration.getSeconds();
+ if (isNaN(hours))
+ hours = 0;
+ if (isNaN(minutes))
+ minutes = 0;
+ if (isNaN(seconds))
+ seconds = 0;
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var timeString;
+ if (hours > 0) {
+ hoursString = formatter.format(hours);
+ formatter.integerDigits = 2;
+ minutesString = formatter.format(minutes);
+ secondsString = formatter.format(seconds);
+ timeString = String.load(String.id.IDS_HHMMSS_DURATION).format(hoursString, minutesString, secondsString)
+ }
+ else {
+ minutesString = formatter.format(minutes);
+ formatter.integerDigits = 2;
+ secondsString = formatter.format(seconds);
+ timeString = String.load(String.id.IDS_MMSS_DURATION).format(minutesString, secondsString)
+ }
+ formatter.integerDigits = MS.Entertainment.Formatters.DateTimeFormatters.defaultDecimalDigits;
+ return timeString
+ }, formatTimeString: function formatTimeString(duration, options) {
+ if (typeof duration === "number" && duration < 0)
+ return String.empty;
+ var formatter;
+ var hoursString;
+ var minutesString;
+ var secondsString;
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var timeString = String.empty;
+ var hours = 0;
+ var minutes = 0;
+ var seconds = 0;
+ options = options || {};
+ var excludeSeconds = options.excludeSeconds || false;
+ if (typeof duration === "number") {
+ hours = Math.floor(duration / (1000 * 60 * 60));
+ duration = duration - (hours * 1000 * 60 * 60);
+ minutes = Math.floor(duration / (1000 * 60));
+ duration = duration - (minutes * 1000 * 60);
+ seconds = Math.floor(duration / 1000)
+ }
+ else if (duration) {
+ hours = duration.getHours();
+ minutes = duration.getMinutes();
+ seconds = duration.getSeconds()
+ }
+ if (hours > 0) {
+ hoursString = formatter.format(hours);
+ minutesString = formatter.format(minutes);
+ timeString = String.load(String.id.IDS_DETAILS_DURATION_HOURS_FORMAT).format(hoursString, minutesString)
+ }
+ else {
+ minutesString = formatter.format(minutes);
+ secondsString = formatter.format(seconds);
+ if (!excludeSeconds)
+ timeString = String.load(String.id.IDS_DETAILS_DURATION_MINSEC_FORMAT).format(minutesString, secondsString);
+ else
+ timeString = String.load(String.id.IDS_DETAILS_DURATION_MINS_FORMAT).format(minutesString)
+ }
+ return timeString
+ }, getTotalMinutesFromDate: function getTotalMinutesFromDate(date) {
+ var minutes = 0;
+ if (date)
+ minutes = date.getHours() * 60 + date.getMinutes();
+ return minutes
+ }, millisecondsFromTimeSpan: function millisecondsFromTimeSpan(timeSpan) {
+ var milliSeconds = 0;
+ if (timeSpan && timeSpan instanceof Date) {
+ var zero = new Date(0, 0, 0, 0, 0, 0, 0);
+ milliSeconds = timeSpan.getTime() - zero.getTime()
+ }
+ return milliSeconds
+ }, secondsFromTimeSpan: function secondsFromTimeSpan(timeSpan) {
+ var seconds = MS.Entertainment.Utilities.millisecondsFromTimeSpan(timeSpan) / 1000;
+ return seconds
+ }, removeFileExtension: function removeFileExtension(fileName) {
+ if (!fileName)
+ return String.empty;
+ return fileName.replace(/\.[^\.\s]+$/, String.empty)
+ }, ensureDurationIsNumber: function ensureDurationIsNumber(duration) {
+ var ms = 0;
+ if (typeof duration === "number")
+ ms = duration;
+ else if (duration.getHours) {
+ ms += duration.getHours() * 60 * 60 * 1000;
+ ms += duration.getMinutes() * 60 * 1000;
+ ms += duration.getSeconds() * 1000;
+ ms += duration.getMilliseconds()
+ }
+ else
+ MS.Entertainment.Utilities.fail("Expected number or date");
+ return ms
+ }, isBlobUrl: function isBlobUrl(url) {
+ var blobUrlRegex = /^blob:/i;
+ return blobUrlRegex.test(url)
+ }, handleSearchInput: function handleSearchInput(input) {
+ if (!input)
+ return null;
+ var result = String.empty;
+ var trimmed = input.trim();
+ if (trimmed)
+ for (var i = 0; i < trimmed.length; i++) {
+ var ch = trimmed[i];
+ switch (ch) {
+ case"%":
+ case";":
+ case"(":
+ case")":
+ case"{":
+ case"}":
+ case"!":
+ case"\r":
+ case"\t":
+ case"\n":
+ case">":
+ case"<":
+ case"+":
+ case"&":
+ case"-":
+ result = result + " ";
+ break;
+ default:
+ result = result + ch;
+ break
+ }
+ }
+ return result.trim()
+ }, processServiceLinks: function processServiceLinks(text, linkMappings) {
+ var ignoreTags = ["", "", "", "", "", "", "", ""];
+ var isIgnorableTag = function isIgnoreableTag(tagStart, isClosingTag) {
+ var ignore = false;
+ for (var i = 0; i < ignoreTags.length; i++)
+ if (tagStart.lastIndexOf(ignoreTags[i], 0) === 0) {
+ ignore = true;
+ break
+ }
+ return ignore
+ };
+ var skipLinkClose = false;
+ return MS.Entertainment.Utilities.processServiceTextBlob(text, function handleTag(tagStart) {
+ tagStart = tagStart || String.empty;
+ if (isIgnorableTag(tagStart))
+ return String.empty;
+ var result = String.empty;
+ var match = /^\/.exec(tagStart);
+ if (match) {
+ if (match[1] && match[2]) {
+ var stringFormat = linkMappings[match[1]];
+ if (stringFormat)
+ result = stringFormat.format(match[2])
+ }
+ skipLinkClose = (result === String.empty)
+ }
+ else if (tagStart.indexOf("") === 0 && !skipLinkClose)
+ result = linkMappings["$close"];
+ return result
+ })
+ }, processServiceTextBlob: function processServiceTextBlob(textBlob, tagCallback) {
+ var buff = "";
+ var lastCh = "";
+ if (textBlob) {
+ var inTag = false;
+ for (var i = 0; i < textBlob.length; i++) {
+ var ch = textBlob[i];
+ if (ch === "<")
+ inTag = true;
+ if (!inTag)
+ if (ch === "\n") {
+ if (lastCh !== "\n")
+ buff = buff + "
"
+ }
+ else if (ch === ">")
+ buff = buff + ">";
+ else
+ buff = buff + ch;
+ else if (ch === "<" && tagCallback)
+ buff = buff + tagCallback(textBlob.substr(i));
+ if (ch === ">")
+ inTag = false;
+ lastCh = ch
+ }
+ }
+ return buff
+ }, getMediaTypeName: function getMediaTypeName(mediaType, videoType, gameType, downloadTypeText) {
+ var name;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ name = String.load(String.id.IDS_MEDIATYPE_TVEPISODE);
+ else
+ name = String.load(String.id.IDS_MEDIATYPE_MOVIE);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ name = String.load(String.id.IDS_MEDIATYPE_TVSERIES);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ name = String.load(String.id.IDS_MEDIATYPE_TVSEASON);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ name = String.load(String.id.IDS_MEDIATYPE_ARTIST);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ name = String.load(String.id.IDS_MEDIATYPE_ALBUM);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ name = String.load(String.id.IDS_MEDIATYPE_SONG);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ name = String.load(String.id.IDS_MEDIATYPE_PLAYLIST);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ if (gameType === MS.Entertainment.Data.Augmenter.GamePlatform.Modern)
+ name = String.load(String.id.IDS_MEDIATYPE_GAME_WINDOWS);
+ else {
+ name = downloadTypeText;
+ if (!name)
+ name = String.load(String.id.IDS_MEDIATYPE_GAME)
+ }
+ break;
+ default:
+ name = String.load(String.id.IDS_UNKNOWN_VALUE);
+ break
+ }
+ return name
+ }, getMediaTypeNameFromMedia: function getMediaTypeNameFromMedia(media) {
+ return MS.Entertainment.Utilities.getMediaTypeName(media.mediaType, media.videoType, media.defaultPlatformType, media.downloadTypeText)
+ }, isEDSAuthRequired: function isEDSAuthRequired() {
+ var isAuthRequired = false;
+ var edsUri = MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_EDSSearch);
+ isAuthRequired = edsUri.toLowerCase().substr(0, 8) === "https://";
+ return isAuthRequired
+ }, isTouchDevicePresent: function isTouchDevicePresent() {
+ var touchCapabilities = new Windows.Devices.Input.TouchCapabilities;
+ return touchCapabilities && touchCapabilities.touchPresent
+ }, EMPTY_GUID: "00000000-0000-0000-0000-000000000000", isEmptyGuid: function isEmptyGuid(guid) {
+ return !guid || guid === MS.Entertainment.Utilities.EMPTY_GUID
+ }, isValidGuid: function isValidGuid(guid) {
+ return guid && typeof guid === "string" && guid.match(/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/)
+ }, trimGuid: function trimGuid(guid) {
+ var trimmed = guid.replace('{', '');
+ trimmed = trimmed.replace('}', '');
+ return trimmed
+ }, isSameGuid: function isSameGuid(guid1, guid2) {
+ if (!MS.Entertainment.Utilities.isValidGuid(guid1) || !MS.Entertainment.Utilities.isValidGuid(guid2))
+ return false;
+ return MS.Entertainment.Utilities.trimGuid(guid1).trim().toLowerCase() === MS.Entertainment.Utilities.trimGuid(guid2).trim().toLowerCase()
+ }, isValidServiceId: function isValidServiceId(guid) {
+ return !MS.Entertainment.Utilities.isEmptyGuid(guid) && MS.Entertainment.Utilities.isValidGuid(guid)
+ }, isValidLibraryId: function isValidLibraryId(id) {
+ return id > 0
+ }, isValidWatchlistId: function isValidWatchlistId(id) {
+ return isFinite(id) && id >= 0
+ }, invalidateLibraryId: -1, _executeQueryAndGetMediaItemAsync: function _executeQueryAndGetMediaItemAsync(query) {
+ var media;
+ return query.getItems().then(function queryGetItems_success(virtualList) {
+ if (virtualList.count !== 1)
+ return WinJS.Promise.wrap();
+ return virtualList.itemsFromIndex(0, 0, 0)
+ }).then(function itemsFromIndex_complete(args) {
+ if (args) {
+ media = args.items[0].data;
+ MS.Entertainment.ViewModels.MediaItemModel.augment(media);
+ if (media.hydrate)
+ return media.hydrate()
+ }
+ return WinJS.Promise.wrap()
+ }).then(function hydrate_complete() {
+ return WinJS.Promise.wrap(media)
+ }, function _executeQueryAndGetMediaItemAsync_error() {
+ return WinJS.Promise.wrap()
+ })
+ }, createMediaItemByLibraryInfo: function createMediaItemByLibraryInfo(libraryId, mediaType) {
+ var query;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ return MS.Entertainment.UI.Actions.Playlists.queryPlaylistById(libraryId);
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ var query = new MS.Entertainment.Data.Query.libraryTracks;
+ query.trackId = libraryId;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.track);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ var query = new MS.Entertainment.Data.Query.libraryAlbums;
+ query.albumId = libraryId;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.album);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ var query = new MS.Entertainment.Data.Query.libraryArtists;
+ query.personId = libraryId;
+ query.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.collection, Microsoft.Entertainment.Platform.AcquisitionContextType.artist);
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ var query = new MS.Entertainment.Data.Query.libraryVideos;
+ query.objectIds = [libraryId];
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ var query = new MS.Entertainment.Data.Query.libraryTVSeasons;
+ query.tvSeasonId = libraryId;
+ break;
+ default:
+ return WinJS.Promise.wrap()
+ }
+ return MS.Entertainment.Utilities._executeQueryAndGetMediaItemAsync(query)
+ }, convertToHexString: function convertToHexString(value) {
+ if (!value)
+ value = 0;
+ else if (value < 0)
+ value += 0xFFFFFFFF + 1;
+ return "0x" + value.toString(16)
+ }, getSpotlightItemAugmentation: function getSpotlightItemAugmentation(spotlightType) {
+ var augmentation = null;
+ switch (spotlightType) {
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Movie:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightMovie;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Artist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.SpotlightArtist;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.SpotlightAlbum;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Playlist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.SpotlightPlaylist;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Series:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightTVSeries;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Season:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightTVSeason;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Episode:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.SpotlightTVEpisode;
+ break;
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.None:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.Web:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.WebBlend:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Spotlight.MediaType.ZuneFlexHub:
+ augmentation = MS.Entertainment.Data.Augmenter.Spotlight.SpotlightItem;
+ break;
+ default:
+ var shipAssertProvider = new Microsoft.Entertainment.Infrastructure.ShipAssertProvider;
+ shipAssertProvider.shipAssert("MS.Entertainment.UI.Controls", "getSpotlightItemAugmentation()", MS.Entertainment.UI.Debug.getStackTrace(), "Message: " + "Unsupported spotlight media type. Could not find augmentation for type: " + spotlightType, "");
+ break
+ }
+ {};
+ return augmentation
+ }, getEditorialItemAugmentation: function getEditorialItemAugmentation(editorialType) {
+ var augmentation = null;
+ switch (editorialType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialMovie;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ augmentation = MS.Entertainment.Utilities.isMusicApp2 ? MS.Entertainment.Data.Augmenter.Marketplace.EditorialMusicHub : MS.Entertainment.Data.Augmenter.Marketplace.EditorialHub;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialTVSeries;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialTVSeason;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Video.EditorialEpisode;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialAlbum;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Artist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialArtist;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Track:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialTrack;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MusicVideo:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.Music.EditorialMusicVideo;
+ break;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Playlist:
+ break;
+ default:
+ MS.Entertainment.UI.Controls.fail("Unsupported editorial media type. Could not find augmentation for type: " + editorialType);
+ break
+ }
+ {};
+ return augmentation
+ }, getPinnedItemAugmentation: function getPinnedItemAugmentation(pinnedType) {
+ var augmentation = null;
+ switch (pinnedType) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicPlaylist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedPlaylist;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedAlbum;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.musicArtist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedArtist;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.movie:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedMovie;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeason:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedTvSeason;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeries:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.PinnedTvSeries;
+ break;
+ default:
+ break
+ }
+ {};
+ return augmentation
+ }, getRecentItemAugmentation: function getRecentItemAugmentation(recentType, acquisitionContext) {
+ var augmentation = null;
+ switch (recentType) {
+ case MS.Entertainment.Data.Query.edsMediaType.musicPlaylist:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentPlaylist;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.album:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentAlbum;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.musicArtist:
+ switch (acquisitionContext) {
+ case MS.Entertainment.Utilities.AcquisitionContext.SmartDJ:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentSmartDJ;
+ break;
+ default:
+ augmentation = MS.Entertainment.Data.Augmenter.Marketplace.RecentArtist;
+ break
+ }
+ break;
+ default:
+ break
+ }
+ {};
+ return augmentation
+ }, isSupportedVideoEditorialType: function isSupportedVideoEditorialType(item, editorialType) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var showMovieTrailers = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoShowMovieTrailers);
+ var featuredSetsEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoFeaturedSetsEnabled);
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var showEditorialEpisodes = config.video.supportsEditorialTVEpisodes;
+ switch (editorialType) {
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer:
+ return showMovieTrailers;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Episode:
+ return showEditorialEpisodes;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season:
+ return MS.Entertainment.Utilities.isValidServiceId(item.seriesId);
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.FlexHub:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Hub:
+ return featuredSetsEnabled;
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Series:
+ case MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Movie:
+ return true;
+ default:
+ break
+ }
+ return false
+ }, convertEditorialItem: function convertEditorialItem(mediaItem) {
+ var newMediaItem = mediaItem;
+ var augmenter;
+ if (mediaItem && !mediaItem.mediaType)
+ augmenter = MS.Entertainment.Utilities.getEditorialItemAugmentation(mediaItem && mediaItem.type);
+ if (augmenter) {
+ var oldItem = WinJS.Binding.unwrap(mediaItem);
+ newMediaItem = MS.Entertainment.Data.augment(MS.Entertainment.Data.deflate(oldItem), augmenter);
+ if (oldItem.contentNotifications)
+ newMediaItem.contentNotifications = oldItem.contentNotifications
+ }
+ return newMediaItem
+ }, uninitializeChildControls: function disposeChildControls(dom) {
+ var element = dom.querySelector("[data-win-control], .ent-control");
+ var controls = dom.querySelectorAll("[data-win-control], .ent-control");
+ if (controls && controls.length > 0)
+ for (var i = 0, l = controls.length; i < l; i++)
+ if (controls[i] && controls[i].winControl && controls[i].winControl.uninitialize)
+ controls[i].winControl.uninitialize()
+ }, runVoiceControlMixins: function runVoiceMixins(classConstructor) {
+ Trace.assert(classConstructor, "runVoiceControlMixins: classConstructor not defined");
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.App2.VoicePropertyMixin"))
+ WinJS.Class.mix(classConstructor, MS.Entertainment.UI.App2.VoiceControlMixin);
+ else
+ Trace.assert(!WinJS.UI.AutomaticFocus, "MS.Entertainment.UI.App2.VoicePropertyMixin not defined. Make sure VoiceControl.js is loaded before the class constructor's file.")
+ }, runVoicePropertyMixins: function runVoiceMixins(classConstructor) {
+ Trace.assert(classConstructor, "runVoicePropertyMixins: classConstructor not defined");
+ if (WinJS.Utilities.getMember("MS.Entertainment.UI.App2.VoicePropertyMixin"))
+ WinJS.Class.mix(classConstructor, MS.Entertainment.UI.App2.VoicePropertyMixin);
+ else
+ Trace.assert(!WinJS.UI.AutomaticFocus, "MS.Entertainment.UI.App2.VoicePropertyMixin not defined. Make sure VoiceControl.js is loaded before the class constructor's file.")
+ }, searchArray: function searchArray(array, predicate) {
+ var index = 0;
+ var candidate = null;
+ for (index = 0; index < array.length; index++) {
+ candidate = array[index];
+ if (predicate(candidate))
+ return candidate
+ }
+ return null
+ }, getPropertyPathFragments: function getPropertyPathFragments(propertyPath) {
+ var propertyPathFragments = (propertyPath) ? propertyPath.split(/(?:\]\.)|\.|\[|\]/) : [];
+ if (propertyPathFragments[propertyPathFragments.length - 1] === String.empty)
+ propertyPathFragments.pop();
+ if (propertyPathFragments[0] === String.empty)
+ propertyPathFragments.splice(0, 1);
+ return propertyPathFragments
+ }, valueFromPropertyPath: function valueFromPropertyPath(data, propertyPath) {
+ return MS.Entertainment.Utilities.valueFromPropertyPathFragments(data, MS.Entertainment.Utilities.getPropertyPathFragments(propertyPath))
+ }, valuesFromPropertyPath: function valuesFromPropertyPath(item, propertyPath) {
+ var result = [];
+ if (item && propertyPath)
+ if (Array.isArray(item) && item.length > 0)
+ result = item.map(function(element) {
+ return MS.Entertainment.Utilities.valuesFromPropertyPath(element, propertyPath)
+ }.bind(this)).reduce(function(a, b) {
+ if (Array.isArray(a))
+ return a.concat(b);
+ else
+ return [a, b]
+ });
+ else {
+ var pathSeperatorIndex = propertyPath.indexOf(".");
+ if (pathSeperatorIndex === -1) {
+ if (propertyPath in item)
+ result = item[propertyPath]
+ }
+ else {
+ var pathSegment = propertyPath.substr(0, pathSeperatorIndex);
+ if (pathSegment) {
+ propertyPath = propertyPath.substr(pathSeperatorIndex + 1);
+ if (pathSegment in item) {
+ var property = item[pathSegment];
+ result = MS.Entertainment.Utilities.valuesFromPropertyPath(property, propertyPath)
+ }
+ }
+ }
+ }
+ return result
+ }, valueFromPropertyPathFragments: function valueFromPropertyPathFragments(data, propertyPath, max) {
+ var max = isNaN(max) ? propertyPath.length : max;
+ for (var i = 0; i < max && data; i++)
+ try {
+ data = data[propertyPath[i]]
+ }
+ catch(e) {
+ MS.Entertainment.fail("Exception in valueFromPropertyPathFragments: " + e.toString() + " Property: " + propertyPath.toString())
+ }
+ return data
+ }, hasPropertyPath: function hasProperty(data, propertyPath) {
+ return MS.Entertainment.Utilities.hasPropertyPathFragments(data, MS.Entertainment.Utilities.getPropertyPathFragments(propertyPath))
+ }, hasPropertyPathFragments: function hasPropertyPathFragments(data, propertyPath) {
+ var len = propertyPath.length - 1;
+ for (var i = 0; i < len && data; i++)
+ data = data[propertyPath[i]];
+ return data && (len < 0 || (typeof data === "object" && propertyPath[len] in data))
+ }, setFromPropertyPath: function setFromPropertyPath(data, propertyPath, value) {
+ return MS.Entertainment.Utilities.setFromPropertyPathFragments(data, MS.Entertainment.Utilities.getPropertyPathFragments(propertyPath), value)
+ }, setFromPropertyPathFragments: function setFromPropertyPathFragments(data, propertyPath, value) {
+ for (var i = 0, len = propertyPath.length - 1; i < len && data; i++) {
+ if (!(propertyPath[i] in data))
+ data[propertyPath[i]] = {};
+ data = data[propertyPath[i]]
+ }
+ data[propertyPath[len]] = value;
+ return data
+ }, random: function random(min, max) {
+ return Math.floor(Math.random() * (max - min + 1)) + min
+ }, getRelativeOffset: function getRelativeOffset(element, parent) {
+ MS.Entertainment.Utilities.assert(element, "No element provided");
+ MS.Entertainment.Utilities.assert(parent, "No parent provided");
+ if (!element || !parent)
+ return {
+ top: 0, left: 0
+ };
+ var left = 0;
+ var top = 0;
+ var e = element;
+ while (e && parent && (e.offsetParent !== parent.offsetParent)) {
+ left += e.offsetLeft;
+ top += e.offsetTop;
+ e = e.offsetParent;
+ if (!e)
+ return {
+ left: left, top: top
+ }
+ }
+ left += (e.offsetLeft - parent.offsetLeft);
+ top += (e.offsetTop - parent.offsetTop);
+ return {
+ left: left, top: top
+ }
+ }, onRootPage: function onRootPage() {
+ var currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ return currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.root
+ }, isElementInViewportOfParent: function isElementInViewportOfParent(item, parent) {
+ return MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(item, parent) && MS.Entertainment.Utilities.isElementInVerticalViewportOfParent(item, parent)
+ }, isElementInHorizontalViewportOfParent: function isElementInHorizontalViewportOfParent(item, parent, adjustmentFactor) {
+ adjustmentFactor = adjustmentFactor || 0;
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(item, parent);
+ if (relativePosition && item) {
+ var leftEdge = (relativePosition.left - adjustmentFactor) >= parent.scrollLeft;
+ var rightEdge = Math.min(parent.scrollWidth, relativePosition.left + item.offsetWidth + adjustmentFactor) <= (parent.offsetWidth + parent.scrollLeft);
+ return leftEdge && rightEdge
+ }
+ else
+ return false
+ }, isElementInVerticalViewportOfParent: function isElementInVerticalViewportOfParent(item, parent) {
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(item, parent);
+ if (relativePosition) {
+ var topEdge = relativePosition.top >= (parent.scrollTop);
+ var bottomEdge = (relativePosition.top + item.offsetHeight) <= (parent.offsetHeight + parent.scrollTop);
+ return topEdge && bottomEdge
+ }
+ else
+ return false
+ }, getEdgeWithinViewport: function getEdgeWithinViewport(desiredEdgePosition, size, viewportSize) {
+ var edgePosition = Math.min(desiredEdgePosition, viewportSize - size);
+ return Math.max(edgePosition, 0)
+ }, parseVersionString: function parseVersionString(inputString) {
+ MS.Entertainment.Utilities.assert(inputString, "Empty input string");
+ var versionArray = inputString.split(".");
+ MS.Entertainment.Utilities.assert(versionArray.length === 4, "Version string should have four parts");
+ return {
+ major: parseInt(versionArray[0]), minor: parseInt(versionArray[1]), build: parseInt(versionArray[2]), revision: parseInt(versionArray[3])
+ }
+ }, compareVersions: function compareVersions(ver1, ver2) {
+ var properties = ["major", "minor", "build", "revision"];
+ MS.Entertainment.Utilities.assert((ver1.major >= 0) && (ver1.minor >= 0) && (ver1.build >= 0) && (ver1.revision >= 0), " Input version1 is invalid");
+ MS.Entertainment.Utilities.assert((ver2.major >= 0) && (ver2.minor >= 0) && (ver2.build >= 0) && (ver2.revision >= 0), " Input version2 is invalid");
+ for (var i = 0; i < properties.length; i++)
+ if (ver1[properties[i]] < ver2[properties[i]])
+ return -1;
+ else if (ver1[properties[i]] > ver2[properties[i]])
+ return 1;
+ return 0
+ }, getClientVersionString: function getClientVersionString() {
+ var ver = Windows.ApplicationModel.Package.current.id.version;
+ return [ver.major, ver.minor, ver.build, ver.revision].join(".")
+ }, getVersionString: function getVersionString() {
+ return WinJS.xhr({url: "version.json"}).then(function(data) {
+ var versionInformation = JSON.parse(data.responseText);
+ return versionInformation.version
+ })
+ }, navigateToUrl: function navigateToUrl(url, automationId) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var externalNavigationAction = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = url;
+ externalNavigationAction.automationId = automationId;
+ externalNavigationAction.execute()
+ }, launchStoreUpdatePage: function launchStoreUpdatePage() {
+ var launchInfo = "ms-windows-store:Updates";
+ var appAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ appAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppStoreUpgrade;
+ appAction.parameter = {
+ uri: launchInfo, appendSource: true, appendGamerTag: false
+ };
+ appAction.execute()
+ }, doesElementSupportKeyboardInput: function doesElementSupportKeyboardInput(element) {
+ var result = false;
+ if (!element)
+ return result;
+ if (element.tagName === "TEXTAREA" || element.tagName === "SELECT")
+ result = true;
+ else if (element.tagName === "INPUT")
+ switch (element.getAttribute("type")) {
+ case"text":
+ case"password":
+ case"number":
+ case"email":
+ case"tel":
+ case"url":
+ case"search":
+ result = true;
+ break
+ }
+ return result
+ }, suppressSubtreeKeyboardFocus: function suppressSubtreeKeyboardFocus(element) {
+ var suppressed = [];
+ if (element) {
+ var elements = element.querySelectorAll("*[tabindex]");
+ if (elements)
+ for (var i = 0; i < elements.length; i++) {
+ var element = elements[i];
+ var tabIndex = element.getAttribute("tabindex");
+ if (tabIndex && tabIndex !== -1) {
+ suppressed.push({
+ element: element, tabIndex: tabIndex
+ });
+ element.setAttribute("tabindex", -1)
+ }
+ }
+ }
+ return suppressed
+ }, restoreSubtreeKeyboardFocus: function restoreSubtreeKeyboardFocus(suppressedList) {
+ if (suppressedList)
+ for (var i = 0; i < suppressedList.length; i++) {
+ var suppressedItem = suppressedList[i];
+ suppressedItem.element.setAttribute("tabindex", suppressedItem.tabIndex)
+ }
+ }, isHighResolution: function isHighResolution() {
+ var screenHeight = MS.Entertainment.Utilities.getWindowHeight();
+ var isHighResolution = MS.Entertainment.Utilities.isVideoApp ? (screenHeight >= MS.Entertainment.Utilities.VIEW1_VIDEO_VERTICAL_HEIGHT_LIMIT) : (screenHeight >= MS.Entertainment.Utilities.VIEW1_VERTICAL_HEIGHT_LIMIT);
+ return isHighResolution
+ }, getRowCountForResolution: function getRowCountForResolution() {
+ var screenHeight = MS.Entertainment.Utilities.getWindowHeight();
+ var standardResolutionRows = MS.Entertainment.Utilities.isVideoApp ? MS.Entertainment.Utilities.STANDARD_RESOLUTION_VIDEO_ROWS : MS.Entertainment.Utilities.STANDARD_RESOLUTION_ROWS;
+ var highResolutionRows = MS.Entertainment.Utilities.isVideoApp ? MS.Entertainment.Utilities.HIGH_RESOLUTION_VIDEO_ROWS : MS.Entertainment.Utilities.HIGH_RESOLUTION_ROWS;
+ var highResolutionHeight = MS.Entertainment.Utilities.isVideoApp ? MS.Entertainment.Utilities.VIEW1_VIDEO_VERTICAL_HEIGHT_LIMIT : MS.Entertainment.Utilities.VIEW1_VERTICAL_HEIGHT_LIMIT;
+ var rowCount = standardResolutionRows;
+ if (screenHeight >= highResolutionHeight)
+ rowCount = highResolutionRows;
+ return rowCount
+ }, getLandscapeScreenSize: function getLandscapeScreenSize() {
+ var size = {
+ width: 0, height: 0
+ };
+ if (window.screen)
+ if (window.screen.msOrientation === "portrait-primary" || window.screen.msOrientation === "portrait-secondary") {
+ size.width = window.screen.height;
+ size.height = window.screen.width
+ }
+ else {
+ size.width = window.screen.width;
+ size.height = window.screen.height
+ }
+ return size
+ }, getWindowHeight: function getWindowHeight() {
+ var heightProperty = "outerHeight";
+ if (!document.attachEvent)
+ heightProperty = "innerHeight";
+ return window[heightProperty]
+ }, getWindowWidth: function getWindowWidth() {
+ var widthProperty = "outerWidth";
+ if (!document.attachEvent)
+ widthProperty = "innerWidth";
+ return window[widthProperty]
+ }, getDisplayProperties: function getDisplayProperties() {
+ var hasDisplayInformation = MS.Entertainment.Utilities.valueFromPropertyPathFragments(Windows, ["Graphics", "Display", "DisplayInformation"]);
+ if (hasDisplayInformation)
+ return Windows.Graphics.Display.DisplayInformation.getForCurrentView();
+ return Windows.Graphics.Display.DisplayProperties
+ }, isMusicApp1: {get: function getIsMusicApp1() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music
+ }}, isMusicApp2: {get: function getIsMusicApp2() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music2
+ }}, isMusicApp: {get: function getIsMusicApp() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music2
+ }}, isAmsterdamApp: {get: function getIsAmsterdamApp() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.amsterdam
+ }}, isVideoApp1: {get: function getIsVideoApp1() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video
+ }}, isVideoApp2: {get: function getIsVideoApp2() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video2
+ }}, isVideoApp: {get: function getIsVideoApp() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video2
+ }}, isTestApp: {get: function getIsTestApp() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.test
+ }}, isApp1: {get: function getIsApp1() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video
+ }}, isApp2: {get: function getIsApp2() {
+ return MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.music2 || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.video2 || MS.Entertainment.appMode === Microsoft.Entertainment.Application.AppMode.amsterdam
+ }}, _isApp2Platform: false, isApp2Platform: {
+ get: function isApp2Platform() {
+ return !MS.Entertainment.isAppModeOverride && (MS.Entertainment.Utilities._isApp2Platform || MS.Entertainment.Utilities.isApp2)
+ }, set: function isApp2Platform(value) {
+ MS.Entertainment.Utilities._isApp2Platform = value
+ }
+ }, isWindowsBlue: {get: function getIsWindowsBlue() {
+ return !!Windows.UI.ViewManagement.ViewSizePreference
+ }}, isMain: {get: function getIsMain() {
+ var mainString = "main.html";
+ var href = window.location.href;
+ return href.indexOf(mainString, href.length - mainString.length) >= 0
+ }}, titleId: {get: function getTitleId() {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ return "0x3D705025";
+ else if (MS.Entertainment.Utilities.isMusicApp2)
+ return "0x18FFC9F4";
+ else
+ return null
+ }}, shortTitleId: {get: function getTitleId() {
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ return "3D705025";
+ else if (MS.Entertainment.Utilities.isMusicApp2)
+ return "18FFC9F4";
+ else
+ return null
+ }}, supportsProtectedContent: {get: function getSupportsProtectedContent() {
+ try {
+ return Microsoft.Media.PlayReadyClient.PlayReadyStatics.playReadyCertificateSecurityLevel === 2000
+ }
+ catch(e) {
+ return false
+ }
+ }}, _isDrmIndividualized: false, isDrmIndividualized: {
+ get: function get_isDrmIndividualized() {
+ return MS.Entertainment.Utilities._isDrmIndividualized
+ }, set: function set_isDrmIndividualized(newValue) {
+ MS.Entertainment.Utilities._isDrmIndividualized = newValue
+ }
+ }, clientSupportsFreeJustPlays: {get: function getClientSupportsFreeJustPlays() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.service.enableFreeJustPlays
+ }}, isRightFree: function isRightFree(right) {
+ var retVal = false;
+ if (right.acceptablePaymentInstrumentTypes)
+ for (var i = 0; i < right.acceptablePaymentInstrumentTypes.length; i++)
+ if (right.acceptablePaymentInstrumentTypes[i] === MS.Entertainment.Data.Augmenter.Marketplace.edsAcceptedPaymentTypes.none)
+ retVal = true;
+ return retVal
+ }, useModalNowPlaying: {get: function getUseModalNowPlaying() {
+ return MS.Entertainment.Utilities.isVideoApp
+ }}, noMarketplaceRootClassName: {get: function noMarketplaceRootClassName() {
+ return "noMarketplace"
+ }}, isLaunchToCollectionSettingEnabled: {get: function getIsLaunchToCollectionSettingEnabled() {
+ var moniker = null;
+ try {
+ var defaultLaunchSetting = Windows.Storage.ApplicationData.current.roamingSettings.values["launchLocation"];
+ moniker = MS.Entertainment.UI.Monikers[defaultLaunchSetting]
+ }
+ catch(e) {}
+ return (moniker === "videoCollection")
+ }}, getMediaByServiceId: function getMediaByServiceId(serviceId, idType) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return new WinJS.Promise(function(c, e, p) {
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace) || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicVideosMarketplace)) {
+ var contentTypeQuery = new MS.Entertainment.Data.Query.GenericDetails;
+ contentTypeQuery.serviceId = serviceId;
+ contentTypeQuery.idType = (idType && idType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsIdType.canonical.toLocaleLowerCase()) ? MS.Entertainment.Data.Query.edsIdType.canonical : MS.Entertainment.Data.Query.edsIdType.zuneCatalog;
+ contentTypeQuery.execute().then(function contentTypeQuerySuccess(query) {
+ var mediaItemQuery = null;
+ if (query.result.item)
+ switch (query.result.item.contentType) {
+ case"Movie":
+ if (query.result.item.type === MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.MovieTrailer) {
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailMovie;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ }
+ else if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailMovie;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ break;
+ case"MovieTrailer":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.movieTrailersMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailMovie;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ break;
+ case"Track":
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.SongDetails;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.track)
+ }
+ break;
+ case"Album":
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.AlbumWithTracks;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.album)
+ }
+ break;
+ case"Artist":
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(MS.Entertainment.UI.NetworkStatusService.NetworkedFeature.musicMarketplace) && featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.ArtistDetails;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.acquisitionData = new MS.Entertainment.Utilities.AcquisitionData(Microsoft.Entertainment.Platform.AcquisitionContext.store, Microsoft.Entertainment.Platform.AcquisitionContextType.artist)
+ }
+ break;
+ case"MusicVideo":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Music.MusicVideoDetails;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid
+ }
+ break;
+ case"Episode":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailTVEpisode;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid
+ }
+ break;
+ case"Series":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailTVSeries;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid;
+ mediaItemQuery.relevancyTrackingContent = query.result.item.relevancyTrackingContent
+ }
+ break;
+ case"Season":
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace)) {
+ mediaItemQuery = new MS.Entertainment.Data.Query.Video.EdsDetailTVSeason;
+ mediaItemQuery.id = query.result.item.serviceId;
+ mediaItemQuery.idType = query.result.item.serviceIdType;
+ mediaItemQuery.impressionGuid = query.result.item.impressionGuid
+ }
+ break;
+ default:
+ break
+ }
+ if (mediaItemQuery)
+ mediaItemQuery.execute().then(function mediaItemQuerySuccess(query) {
+ c(query.result.item)
+ }, function mediaItemQueryError(error) {
+ e(error.errorCode)
+ });
+ else
+ e()
+ }, function contentTypeQueryError(error) {
+ e(error.errorCode)
+ })
+ }
+ else
+ e()
+ })
+ }, isMovie: function isMovie(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie);
+ return isType
+ }, isTVEpisode: function isTVEpisode(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode);
+ return isType
+ }, isTVSeason: function isTVSeason(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = Microsoft.Entertainment.Queries.ObjectType.tvSeason === mediaItem.mediaType || (MS.Entertainment.Data.Augmenter.ServiceTypes.editorialItem === mediaItem.serviceType && MS.Entertainment.Data.Augmenter.Marketplace.EditorialType.Season === mediaItem.type);
+ return isType
+ }, isTVSeries: function isTVSeries(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeries);
+ return isType
+ }, isAnyTV: function isAnyTV(mediaItem) {
+ if (mediaItem)
+ return this.isTVEpisode(mediaItem) || this.isTVSeason(mediaItem) || this.isTVSeries(mediaItem)
+ }, isVideo: function isVideo(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType !== Microsoft.Entertainment.Queries.VideoType.musicVideo);
+ return isType
+ }, isBundle: function isBundle(mediaItem) {
+ var isType = false;
+ if (mediaItem)
+ isType = mediaItem.isBundle && (mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.movie);
+ return isType
+ }, raisePanelReadyTest: function raisePanelReadyTest(element, failed, model) {
+ if (!element)
+ return;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelReadyTest", true, true);
+ domEvent.failed = failed;
+ domEvent.model = model;
+ element.dispatchEvent(domEvent)
+ }, raisePanelReady: function raisePanelReady(element, failed, model) {
+ if (!element)
+ return;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelReady", true, true);
+ domEvent.failed = failed;
+ domEvent.model = model;
+ element.dispatchEvent(domEvent)
+ }, raiseDomEvent: function raiseDomEvent(element, eventName) {
+ if (!element || !eventName)
+ return;
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent(eventName, true, true);
+ element.dispatchEvent(domEvent)
+ }, raisePanelReset: function raisePanelReset(element) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("PanelReset", true, true);
+ element.dispatchEvent(domEvent)
+ }, resetPerfTrackStartTime: function resetPerfTrackStartTime() {
+ window.PerfTrack = {LaunchInformation: {getStartTime: (function _perfTrackLaunchInformation_getStartTimeClosure() {
+ var startTime = new Date;
+ return function _perfTrackLaunchInformation_getStartTimeWorker() {
+ return startTime
+ }
+ })()}}
+ }, cloneActivationArguments: function cloneActivationArguments(args) {
+ var copy = {};
+ for (var name in args)
+ switch (name) {
+ case"activatedOperation":
+ case"prelaunchActivated":
+ case"splashScreen":
+ case"detail":
+ case"linguisticDetails":
+ continue;
+ default:
+ copy[name] = args[name];
+ break
+ }
+ return copy
+ }, getDirectionFromGlobalKeyInput: function getDirectionFromGlobalKeyInput(e) {
+ MS.Entertainment.Utilities.assert(e, "Need an event to decide which direction to go in");
+ if (!e)
+ return;
+ var direction;
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rGlobal:
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.right;
+ break;
+ case WinJS.Utilities.Key.lGlobal:
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.left;
+ break;
+ case WinJS.Utilities.Key.pageUp:
+ if (e.altKey)
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.right;
+ break;
+ case WinJS.Utilities.Key.pageDown:
+ if (e.altKey)
+ direction = MS.Entertainment.Utilities.GlobalKeyDirection.left;
+ break
+ }
+ return direction
+ }, GlobalKeyDirection: {
+ left: "left", right: "right"
+ }, isInvocationEvent: function isInvocationEvent(eventArgs) {
+ var keyCode = eventArgs && eventArgs.keyCode;
+ if (!keyCode)
+ return true;
+ var isInvocationEvent = false;
+ switch (keyCode) {
+ case WinJS.Utilities.Key.enter:
+ case WinJS.Utilities.Key.space:
+ case WinJS.Utilities.Key.invokeButton:
+ isInvocationEvent = true;
+ break
+ }
+ return isInvocationEvent
+ }, defaultClientTypeFromApp: {get: function defaultClientTypeFromApp() {
+ var tuner = MS.Entertainment.Data.Augmenter.Marketplace.Tuner.Windows;
+ if (MS.Entertainment.Utilities.isApp2 && !MS.Entertainment.isAppModeOverride)
+ tuner = MS.Entertainment.Data.Augmenter.Marketplace.Tuner.XboxOne;
+ return tuner
+ }}, _defaultEdsTargetDeviceTypeFromApp: null, defaultEdsTargetDeviceTypeFromApp: {get: function defaultEdsDeviceTypeFromApp() {
+ if (!MS.Entertainment.Utilities._defaultEdsTargetDeviceTypeFromApp) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.Utilities._defaultEdsTargetDeviceTypeFromApp = configuration.service.defaultTargetDeviceType
+ }
+ return MS.Entertainment.Utilities._defaultEdsTargetDeviceTypeFromApp
+ }}, _defaultEdsHeaderDeviceTypeFromApp: null, defaultEdsHeaderDeviceTypeFromApp: {get: function defaultEdsDeviceTypeFromApp() {
+ if (!MS.Entertainment.Utilities._defaultEdsHeaderDeviceTypeFromApp) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.Utilities._defaultEdsHeaderDeviceTypeFromApp = configuration.service.defaultHeaderDeviceType
+ }
+ return MS.Entertainment.Utilities._defaultEdsHeaderDeviceTypeFromApp
+ }}, rightSupportsTuner: function rightSupportsTuner(right, tuner) {
+ var foundTuner = false;
+ if (right.clientTypes && right.clientTypes.length > 0)
+ for (var k = 0; k < right.clientTypes.length; k++)
+ if (tuner === right.clientTypes[k] || right.clientTypes[k] === MS.Entertainment.Data.Augmenter.Marketplace.Tuner.All) {
+ foundTuner = true;
+ break
+ }
+ return foundTuner
+ }, optionsAppTypeTabIndexHelper: {get: function optionsAppTypeTabIndexHelper() {
+ return MS.Entertainment.Utilities.isApp2 ? 0 : -1
+ }}, bindingAppTypeTabIndexHelper: WinJS.Utilities.markSupportedForProcessing(function bindingAppTypeTabIndexHelper(source, sourceProperties, destination, destinationProperties) {
+ destination.tabIndex = MS.Entertainment.Utilities.optionsAppTypeTabIndexHelper
+ }), toggleClass: function toggleClass(element, className, classEnabled) {
+ if (classEnabled)
+ WinJS.Utilities.addClass(element, className);
+ else
+ WinJS.Utilities.removeClass(element, className)
+ }, SNAPPED_MODE_WIDTH: 480, STANDARD_RESOLUTION_VIDEO_ROWS: 2, HIGH_RESOLUTION_VIDEO_ROWS: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return 2;
+ else
+ return 3
+ }}, STANDARD_RESOLUTION_ROWS: 3, HIGH_RESOLUTION_ROWS: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return 3;
+ else
+ return 4
+ }}, VIEW1_VERTICAL_HEIGHT_LIMIT: 900, VIEW1_VIDEO_VERTICAL_HEIGHT_LIMIT: 1050, popOverDefaultSize: {get: function() {
+ if (MS.Entertainment.Utilities.isVideoApp && !MS.Entertainment.Utilities.getRetailExperienceState())
+ return {
+ width: 470, height: 550
+ };
+ else
+ return {
+ width: 730, height: 530
+ }
+ }}, cardItemSizeWithMargin: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return {
+ width: 476, height: 240
+ };
+ else
+ return {
+ width: 300, height: 170
+ }
+ }}, tileImageSize: {get: function() {
+ return {
+ width: 316, height: 316
+ }
+ }}, immersiveBackgroundArtSize: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return {
+ width: 1080, height: 1080
+ };
+ else
+ return {
+ width: 1366, height: 768
+ }
+ }}, playlistPinImageSize: {get: function() {
+ return {
+ width: 240, height: 240
+ }
+ }}, VARIOUS_LANGUAGES_CODE: "zz-ZZ"
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {FlipViewUnloadHelper: MS.Entertainment.UI.Framework.defineUserControl(null, function FlipViewUnloadHelper(element) {
+ if (element && element.parentElement)
+ element.parentElement.unloadTimeout = 3000
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {User: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function user_constructor(userXuidOrNativeUser, gamerTag) {
+ if (isNaN(userXuidOrNativeUser))
+ this.nativeUserModel = [userXuidOrNativeUser || null];
+ else
+ this.nativeUserModel = this._createNativeUserModel(userXuidOrNativeUser, gamerTag)
+ }, {
+ nativeUserModel: null, getIsValid: function getIsValid() {
+ return Array.isArray(this.nativeUserModel) && this.nativeUserModel[0]
+ }, _createNativeUserModel: function _createNativeUserModel(userXuid, gamerTag) {
+ return [MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.xboxLive).createUser(userXuid, gamerTag)]
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities.BindingAgnostic", {
+ setProperty: function setProperty(target, property, value) {
+ if (!(property in target) && target._backingData)
+ target.addProperty(property, value);
+ else
+ target[property] = value
+ }, setProperties: function setProperties(target, source) {
+ var key;
+ if (source)
+ for (key in source)
+ if (key.indexOf("_") !== 0 && key !== "instance" && key !== "constructor")
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(target, key, source[key])
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ showElementNoAnimation: WinJS.Utilities.markSupportedForProcessing(function showElementNoAnimation(element) {
+ WinJS.Utilities.removeClass(element, "hideFromDisplay")
+ }), hideElementNoAnimation: WinJS.Utilities.markSupportedForProcessing(function hideElementNoAnimation(element) {
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ }), showElement: function showElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ if (!element)
+ return WinJS.Promise.as();
+ var result;
+ element.hideFromDisplay = false;
+ WinJS.Utilities.removeClass(element, "hideFromDisplay");
+ result = MS.Entertainment.UI.Framework.beginShowAnimations(element, overrideOldSelector, overrideNewSelector);
+ return WinJS.Promise.as(result)
+ }, hideElement: function hideElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ var hidePromise = null;
+ var timeoutPromise = null;
+ if (!element)
+ return WinJS.Promise.wrap();
+ element.hideFromDisplay = true;
+ if (timeoutMS)
+ timeoutPromise = WinJS.Promise.timeout(timeoutMS).then(function cancelHide() {
+ if (hidePromise) {
+ hidePromise.cancel();
+ hidePromise = null
+ }
+ if (element.hideFromDisplay)
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ });
+ hidePromise = MS.Entertainment.UI.Framework.beginHideAnimations(element, overrideOldSelector, overrideNewSelector).then(function hideAnimationsComplete() {
+ if (timeoutPromise) {
+ timeoutPromise.cancel();
+ timeoutPromise = null
+ }
+ if (element.hideFromDisplay)
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ });
+ return hidePromise
+ }, displayElement: function displayElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ if (!element)
+ return WinJS.Promise.as();
+ element.removeFromDisplay = false;
+ WinJS.Utilities.removeClass(element, "removeFromDisplay");
+ return MS.Entertainment.UI.Framework.beginShowAnimations(element, overrideOldSelector, overrideNewSelector)
+ }, collapseElement: function collapseElement(element, timeoutMS, overrideOldSelector, overrideNewSelector) {
+ var removePromise = null;
+ var timeoutPromise = null;
+ if (!element)
+ return WinJS.Promise.wrap();
+ element.removeFromDisplay = true;
+ if (timeoutMS)
+ timeoutPromise = WinJS.Promise.timeout(timeoutMS).then(function cancelHide() {
+ if (removePromise) {
+ removePromise.cancel();
+ removePromise = null
+ }
+ });
+ removePromise = MS.Entertainment.UI.Framework.beginHideAnimations(element, overrideOldSelector, overrideNewSelector).then(function hideAnimationsComplete() {
+ if (timeoutPromise) {
+ timeoutPromise.cancel();
+ timeoutPromise = null
+ }
+ if (element.removeFromDisplay)
+ WinJS.Utilities.addClass(element, "removeFromDisplay")
+ });
+ return removePromise
+ }, toggleDisplayCollapseElement: function toggleDisplayCollapseElement(element, makeVisible) {
+ var timeout = 500;
+ var domElement = element;
+ if (element && element.domElement)
+ domElement = element.domElement;
+ if (!domElement)
+ return WinJS.Promise.as();
+ if (makeVisible)
+ return MS.Entertainment.Utilities.displayElement(domElement);
+ else
+ return MS.Entertainment.Utilities.collapseElement(domElement, timeout).then(null, function onTimeout() {
+ WinJS.Utilities.addClass(domElement, "removeFromDisplay")
+ })
+ }, enterElement: function enterElement(element) {
+ if (!element)
+ return WinJS.Promise.as();
+ var result;
+ element.hideFromDisplay = false;
+ WinJS.Utilities.removeClass(element, "hideFromDisplay");
+ result = MS.Entertainment.UI.Framework.beginEnterAnimations(element);
+ return WinJS.Promise.as(result)
+ }, exitElement: function exitElement(element) {
+ if (!element)
+ return WinJS.Promise.as();
+ element.hideFromDisplay = true;
+ return MS.Entertainment.UI.Framework.beginExitAnimations(element).then(function hideAnimationsComplete() {
+ if (element.hideFromDisplay)
+ WinJS.Utilities.addClass(element, "hideFromDisplay")
+ })
+ }, appendChild: function appendChild(parent, child, hidden) {
+ parent.appendChild(child);
+ if (!hidden)
+ return MS.Entertainment.Utilities.showElement(child);
+ else {
+ WinJS.Utilities.addClass(child, "hideFromDisplay");
+ return WinJS.Promise.wrap()
+ }
+ }, insertBefore: function insertBefore(parent, newChild, refChild, hidden) {
+ parent.insertBefore(newChild, refChild);
+ if (!hidden)
+ return MS.Entertainment.Utilities.showElement(newChild);
+ else {
+ WinJS.Utilities.addClass(newChild, "hideFromDisplay");
+ return WinJS.Promise.wrap()
+ }
+ }, removeChild: function removeChild(parent, child, skipHideElement) {
+ var remove = function remove() {
+ if (child.parentElement) {
+ MS.Entertainment.UI.Framework.assert(child.parentElement === parent, "Supplied parent was not childs direct parent");
+ child.parentElement.removeChild(child)
+ }
+ };
+ if (skipHideElement) {
+ remove();
+ return WinJS.Promise.wrap()
+ }
+ else
+ return MS.Entertainment.Utilities.hideElement(child).then(function hideElementCompletes() {
+ remove()
+ })
+ }, replaceChild: function replaceChild(parent, newChild, oldChild, hidden) {
+ return MS.Entertainment.UI.Framework.beginHideAnimations(oldChild).then(function beginHideAnimationsCompletes() {
+ parent.replaceChild(newChild, oldChild);
+ if (!hidden)
+ MS.Entertainment.Utilities.showElement(newChild);
+ else {
+ WinJS.Utilities.addClass(newChild, "hideFromDisplay");
+ return WinJS.Promise.wrap()
+ }
+ })
+ }, isElementVisible: function isElementVisible(element) {
+ var style = window.getComputedStyle(element);
+ return !(style.display === "none" || style.visibility === "hidden" || style.opacity === 0.0)
+ }, safeAddClass: function safeAddClass(element, className) {
+ if (element)
+ WinJS.Utilities.addClass(element, className)
+ }, safeRemoveClass: function safeRemoveClass(element, className) {
+ if (element)
+ WinJS.Utilities.removeClass(element, className)
+ }, addEvents: function addEvents(element, events, capture) {
+ element = (element && element.domElement) ? element.domElement : element;
+ return MS.Entertainment.Utilities.addEventHandlers(element, events, capture)
+ }, waitForStartedTransitionsToComplete: MS.Entertainment.UI.Framework.waitForStartedTransitionsToComplete, redirectPromise: function redirectPromise(promise, value) {
+ return WinJS.Promise.as(promise).then(function redirectPromise() {
+ return value
+ })
+ }, _schedulePromise: function _schedulePromise(promiseFunction, promiseValue, jobName) {
+ var result;
+ if (WinJS.Utilities.Scheduler)
+ result = WinJS.Utilities.Scheduler[promiseFunction](promiseValue, jobName);
+ else {
+ jobName = jobName || String.empty;
+ msWriteProfilerMark("ent:_schedulePromise:" + promiseFunction + ":" + jobName + ",StartTM");
+ result = WinJS.Promise.timeout(1).then(function() {
+ msWriteProfilerMark("ent:_schedulePromise:" + promiseFunction + ":" + jobName + ",StopTM");
+ return promiseValue
+ })
+ }
+ return result
+ }, schedulePromiseHigh: function schedulePromiseHigh(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseHigh", promiseValue, jobName)
+ }, schedulePromiseAboveNormal: function schedulePromiseAboveNormal(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseAboveNormal", promiseValue, jobName)
+ }, schedulePromiseNormal: function schedulePromiseNormal(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseNormal", promiseValue, jobName)
+ }, schedulePromiseBelowNormal: function schedulePromiseNormal(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseBelowNormal", promiseValue, jobName)
+ }, schedulePromiseIdle: function schedulePromiseIdle(promiseValue, jobName) {
+ return MS.Entertainment.Utilities._schedulePromise("schedulePromiseIdle", promiseValue, jobName)
+ }, setAccessibilityTextFromStringId: function setAccessibilityTextFromStringId(element, stringId) {
+ MS.Entertainment.Utilities.setAccessibilityText(element, String.load(stringId))
+ }, setAccessibilityText: function setAccessibilityText(element, text) {
+ element = (element && element.domElement) ? element.domElement : element;
+ if (element)
+ if (text)
+ element.setAttribute("aria-label", text);
+ else
+ element.removeAttribute("aria-label")
+ }, setAccessibilityTextFromElement: function setAccessibilityTextFromElement(destinationElement, sourceElement) {
+ destinationElement = (destinationElement && destinationElement.domElement) ? destinationElement.domElement : destinationElement;
+ sourceElement = (sourceElement && sourceElement.domElement) ? sourceElement.domElement : sourceElement;
+ if (destinationElement) {
+ MS.Entertainment.Utilities.assert(!sourceElement || sourceElement.id, "A source element was provided, but the element did not have an id. For aria-labelledby to work an id is required.");
+ if (sourceElement && sourceElement.id)
+ destinationElement.setAttribute("aria-labelledby", sourceElement.id);
+ else
+ destinationElement.removeAttribute("aria-labelledby")
+ }
+ }, copyAugmentedProperties: function copyAugmentedProperties(from, to) {
+ var originalFrom = from;
+ var property;
+ var propertyDescriptor;
+ function copyAugmentedPropertiesEx(from, to) {
+ if (from && to) {
+ from = MS.Entertainment.Data.augmentationShape(WinJS.Binding.unwrap(from));
+ Object.getOwnPropertyNames(from).forEach(function(property) {
+ if (property.indexOf("_") !== 0 && property !== "instance")
+ MS.Entertainment.Utilities.BindingAgnostic.setProperty(to, property, originalFrom[property])
+ });
+ to.hydrated = originalFrom.hydrated
+ }
+ }
+ copyAugmentedPropertiesEx(from, to)
+ }, uniteObjects: function uniteObjects(lessSignificant, moreSignificant) {
+ if (lessSignificant && moreSignificant) {
+ var combinedItem = {};
+ for (var property in lessSignificant)
+ combinedItem[property] = lessSignificant[property];
+ for (property in moreSignificant)
+ combinedItem[property] = moreSignificant[property];
+ return combinedItem
+ }
+ else if (lessSignificant)
+ return lessSignificant;
+ else if (moreSignificant)
+ return moreSignificant;
+ else
+ return {}
+ }, clone: function clone(object) {
+ var result = null;
+ if (!object)
+ result = object;
+ else if (object.clone)
+ result = object.clone();
+ else if (object instanceof Array) {
+ result = [];
+ object.forEach(function(item) {
+ result.push(MS.Entertainment.Utilities.clone(item))
+ })
+ }
+ else if (object instanceof Object) {
+ result = {};
+ for (var key in object)
+ result[key] = object[key]
+ }
+ return result
+ }, doNothing: WinJS.Utilities.markSupportedForProcessing(function doNothing(){}), getAccountLocale: function getAccountLocale() {
+ var locale;
+ var signedInUser = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser))
+ signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ if (signedInUser && signedInUser.locale)
+ locale = signedInUser.locale;
+ else {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (config.service.lastSignedInUserAccountLocale)
+ locale = config.service.lastSignedInUserAccountLocale;
+ else
+ locale = MS.Entertainment.Utilities.getResourceLanguage()
+ }
+ return locale
+ }, appRegionMatchesMachineRegion: function doesAccountRegionMatchMachineRegion() {
+ var appRegion = (new Microsoft.Entertainment.Util.GlobalizationManager).getRegion();
+ var machineRegion = (new Windows.Globalization.GeographicRegion).codeTwoLetter;
+ return (appRegion === machineRegion)
+ }, getResourceLanguage: function getResourceLanguage() {
+ var resourceLanguage;
+ try {
+ var resourceContext = new Windows.ApplicationModel.Resources.Core.ResourceContext;
+ resourceLanguage = resourceContext.languages[0]
+ }
+ catch(e) {
+ Trace.fail("Unexpected error retrieving resource locale")
+ }
+ if (!resourceLanguage)
+ resourceLanguage = "en-US";
+ return resourceLanguage
+ }, getDisplayLanguageFromLanguageCode: function getDisplayLanguageFromLanguageCode(languageCode) {
+ if (!languageCode)
+ return String.empty;
+ var index = languageCode.lastIndexOf("-");
+ var language = (index > 0) ? languageCode.substr(0, index) : languageCode;
+ var languageObject = new Windows.Globalization.Language(language);
+ return languageObject.displayName ? languageObject.displayName : String.empty
+ }, getValueFromCsvList: function getValueFromCsvList(nameValuePairList, name) {
+ var value;
+ var regularExpression = "(^|,)\\s*" + name + "\\s*=\\s*([^=,\\s]+)";
+ var result = new RegExp(regularExpression).exec(nameValuePairList);
+ if (result)
+ value = result[2];
+ return value
+ }, getRegionCodeFromLocale: function getRegionCodeFromLocale(localeName) {
+ var regionCode = String.empty;
+ var lastDashIndex = localeName.lastIndexOf("-");
+ if (lastDashIndex >= 0)
+ regionCode = localeName.slice(lastDashIndex + 1);
+ return regionCode.toUpperCase()
+ }, getLanguageCodeFromLocale: function getLanguageCodeFromLocale(localeName) {
+ var languageCode;
+ var lastDashIndex = localeName.lastIndexOf("-");
+ if (lastDashIndex >= 0)
+ languageCode = localeName.slice(0, lastDashIndex);
+ else
+ languageCode = localeName;
+ return languageCode
+ }, instantiateControl: function instantiateControl(control, options, host) {
+ options = options || {};
+ var UserControlConstructor = control;
+ var controlAttribute;
+ if (typeof UserControlConstructor === "string") {
+ UserControlConstructor = WinJS.Utilities.getMember(control);
+ controlAttribute = control
+ }
+ else
+ controlAttribute = "MS.Entertainment.UI.Framework.UserControl";
+ if (!options.hasOwnProperty("_skipDefer"))
+ options._skipDefer = true;
+ MS.Entertainment.UI.Controls.assert(typeof UserControlConstructor === "function", "Overlay: " + control + " is not a function");
+ host.setAttribute("data-win-control", controlAttribute);
+ return new UserControlConstructor(host, options)
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities.DateFormatters", {
+ formatDay: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDay(sourceValue) {
+ if (sourceValue)
+ return sourceValue.getDate();
+ else
+ return String.empty
+ })), formatMonthAbbreviation: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatMonthAbbreviation(sourceValue) {
+ if (sourceValue) {
+ var superShortMonthPattern = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).abbreviatedMonth;
+ return superShortMonthPattern.format(sourceValue)
+ }
+ else
+ return String.empty
+ })), formatMonthAbbreviationYear: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatMonthAbbreviationYear(sourceValue) {
+ if (sourceValue) {
+ var superShortMonthPattern = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).abbreviatedMonthYear;
+ return superShortMonthPattern.format(sourceValue)
+ }
+ else
+ return String.empty
+ })), formatYearMonthDayLong: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatYearMonthDayLong(sourceValue) {
+ if (sourceValue) {
+ var longdate = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).dayMonthYear;
+ return longdate.format(sourceValue)
+ }
+ else
+ return String.empty
+ }))
+ });
+ WinJS.Namespace.define("MS.Entertainment.globalControls", {
+ GlobalControl: {
+ appBar: "BottomAppBar", appInfoNotification: "AppInfoNotification", appCriticalNotification: "AppCriticalNotification", bottomProgressBar: "BottomProgressBar", backButton: "BackButton", backButtonBling: "BackButtonBling", immersiveDetails: "ImmersiveDetails", mainHeader: "MainHeader", navigationWrapper: "NavigationWrapper", xboxControls: "xboxControls", musicTransportControls: "MusicTransportControls", profilePicker: "ProfilePicker", profilePickerContainer: "ProfilePickerContainer"
+ }, getControl: function getControl(identifier) {
+ return MS.Entertainment.Utilities.getChildControl(document.body, identifier)
+ }
+ });
+ (function() {
+ var currentOverlayContainers = [];
+ function sortOnTabIndex(a, b) {
+ if (a.tabIndex < b.tabIndex) {
+ if (a.tabIndex === -1)
+ return 1;
+ return -1
+ }
+ else if (a.tabIndex > b.tabIndex)
+ return 1;
+ else
+ return 0
+ }
+ function excludeNonFocusableElements(element) {
+ if (!element.getAttribute)
+ return false;
+ var disabledAttribute = element.getAttribute("disabled");
+ var currentStyle = element.currentStyle;
+ var isVisible = currentStyle && currentStyle.visibility !== "hidden" && currentStyle.display !== "none" && disabledAttribute !== "disabled" && disabledAttribute !== "";
+ if (!isVisible)
+ return false;
+ var tagName = element.tagName;
+ var isFocusableElementType = /INPUT|SELECT|TEXTAREA|BUTTON|IFRAME/.test(tagName);
+ var isFocusableLink = (tagName === "A" && element.href);
+ var actuallyHasTabStop = false;
+ var tabIndexAttribute = element.getAttribute("tabindex");
+ if (tabIndexAttribute && !isNaN(tabIndexAttribute))
+ actuallyHasTabStop = (tabIndexAttribute !== "-1");
+ else if ((isFocusableElementType || isFocusableLink) && element.tabIndex > -1)
+ actuallyHasTabStop = true;
+ var isKeyboardNavigationManagerFocusable = WinJS.Utilities.hasClass(element, "win-focusable");
+ return (isFocusableElementType && actuallyHasTabStop) || (isFocusableLink && actuallyHasTabStop) || actuallyHasTabStop || isKeyboardNavigationManagerFocusable
+ }
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ TabConstrainer: MS.Entertainment.UI.Framework.define(function(element, options) {
+ this.domElement = element;
+ if (options)
+ WinJS.UI.setOptions(this, options);
+ var firstDiv = document.createElement("div");
+ firstDiv.className = MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass;
+ firstDiv.setAttribute("role", "menuitem");
+ firstDiv.setAttribute("aria-hidden", "true");
+ if (this.enabled)
+ firstDiv.setAttribute("tabindex", 0);
+ firstDiv.addEventListener("focus", this._focusLandsOnFirstElement.bind(this), false);
+ element.insertAdjacentElement("AfterBegin", firstDiv);
+ var lastDiv = document.createElement("div");
+ lastDiv.className = MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass;
+ lastDiv.setAttribute("role", "menuitem");
+ lastDiv.setAttribute("aria-hidden", "true");
+ if (this.enabled)
+ lastDiv.setAttribute("tabindex", this.assumeTabIndexIsZero ? 0 : 10000);
+ lastDiv.addEventListener("focus", this._focusLandsOnLastElement.bind(this), false);
+ element.appendChild(lastDiv);
+ if (!this.assumeTabIndexIsZero)
+ this._fixUpLastDivTabIndexes()
+ }, {
+ assumeTabIndexIsZero: false, _enabled: true, enabled: {
+ get: function tabConstrainer_get() {
+ return this._enabled
+ }, set: function tabConstrainer_set(value) {
+ if (this._enabled === value)
+ return;
+ this._enabled = value;
+ if (this.enabled) {
+ this.domElement.firstElementChild.setAttribute("tabindex", 0);
+ this.domElement.lastElementChild.setAttribute("tabindex", this.assumeTabIndexIsZero ? 0 : 10000);
+ if (!this.assumeTabIndexIsZero)
+ this._fixUpLastDivTabIndexes()
+ }
+ else {
+ this.domElement.firstElementChild.removeAttribute("tabindex");
+ this.domElement.lastElementChild.removeAttribute("tabindex")
+ }
+ }
+ }, _focusLandsOnLastElement: function _focusLandsOnLastElement() {
+ if (!this.enabled)
+ return;
+ if (!WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass))
+ return;
+ var appBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (appBar && this.includeAppBarOnLastTab && appBar.visible)
+ appBar.focusAppBar(this.domElement);
+ else
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.domElement, this.excludeEndPointElements)
+ }, _focusLandsOnFirstElement: function _focusLandsOnFirstElement() {
+ if (!this.enabled)
+ return;
+ if (document.activeElement)
+ if (!WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass))
+ return;
+ if (this.domElement)
+ MS.Entertainment.UI.Framework.focusLastInSubTree(this.domElement)
+ }, _fixUpLastDivTabIndexes: function _fixUpLastDivTabIndexes() {
+ var otherLastItems = document.querySelectorAll("." + MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass);
+ var nextTabIndex = 10001;
+ if (otherLastItems && otherLastItems.length > 0)
+ Array.prototype.forEach.call(otherLastItems, function(item) {
+ if (this.domElement.lastElementChild === item) {
+ item.tabIndex = 10000;
+ return
+ }
+ if (item.parentElement && item.parentElement.winControl && item.parentElement.winControl.enabled) {
+ item.tabIndex = nextTabIndex;
+ nextTabIndex = item.tabIndex + 10000
+ }
+ }.bind(this))
+ }, excludeEndPointElements: true, includeAppBarOnLastTab: false
+ }, {
+ firstDivClass: "ent-firstdiv", lastDivClass: "ent-lastdiv"
+ }), focusLastInSubTree: function focusLastInSubTree(element) {
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(element))
+ return;
+ var children = element.getElementsByTagName("*");
+ var sorted = Array.prototype.filter.call(children, excludeNonFocusableElements).sort(sortOnTabIndex);
+ for (var i = (sorted.length - 1); i > -1; i--) {
+ var elementToFocus = sorted[i];
+ if (WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass) || WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass))
+ continue;
+ elementToFocus.focus();
+ if (elementToFocus === document.activeElement || MS.Entertainment.UI.Framework.focusedItemInContainer(element))
+ break
+ }
+ }, focusFirstInSubTree: function focusFirstInSubTree(element, excludeEndpointElements, force, skipScroll) {
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(element))
+ return false;
+ if (!force && MS.Entertainment.UI.Framework.focusedItemInContainer(element))
+ return true;
+ var successfullyFocused = false;
+ var firstDiv = null;
+ var children = element.getElementsByTagName("*");
+ var sorted = Array.prototype.filter.call(children, excludeNonFocusableElements).sort(sortOnTabIndex);
+ for (var i = 0; i < sorted.length; i++) {
+ var elementToFocus = sorted[i];
+ if (excludeEndpointElements)
+ if (WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass)) {
+ firstDiv = elementToFocus;
+ continue
+ }
+ else if (WinJS.Utilities.hasClass(elementToFocus, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass))
+ continue;
+ MS.Entertainment.UI.Framework.focusElement(elementToFocus, skipScroll, false, force);
+ if (elementToFocus === document.activeElement || MS.Entertainment.UI.Framework.focusedItemInContainer(element)) {
+ successfullyFocused = true;
+ break
+ }
+ }
+ if (!successfullyFocused)
+ if (firstDiv) {
+ MS.Entertainment.UI.Framework.focusElement(firstDiv, skipScroll, false, force);
+ successfullyFocused = (firstDiv === document.activeElement)
+ }
+ return successfullyFocused
+ }, tryAndFocusElementInSubTreeWithTimer: function tryAndFocusElementInSubTreeWithTimer(tree, timeout) {
+ MS.Entertainment.UI.Framework.assert(timeout > -1, "Invalid timeout provided to try and set focus");
+ MS.Entertainment.UI.Framework.assert(tree, "Need a valid tree to try and set focus");
+ if (timeout < 0)
+ return WinJS.Promise.as();
+ if (!tree)
+ return WinJS.Promise.as();
+ return WinJS.Promise.timeout(timeout).then(function trySetFocusOnTimeoutComplete() {
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(tree))
+ return;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(tree)
+ })
+ }, tryAndFocusElementInSubTreeWithRetry: function tryAndFocusElementInSubTreeWithRetry(tree, retryDelay, numberOfRetries) {
+ Trace.assert(typeof numberOfRetries === "number", "tryAndFocusElementInSubTreeWithRetry: numberOfRetries expected to be a number");
+ Trace.assert(typeof retryDelay === "number", "tryAndFocusElementInSubTreeWithRetry: retryDelay expected to be a number");
+ Trace.assert(retryDelay > -1, "tryAndFocusElementInSubTreeWithRetry: Invalid timeout delay");
+ Trace.assert(tree, "tryAndFocusElementInSubTreeWithRetry: Need a valid tree to try and set focus");
+ var isElementFocused = MS.Entertainment.UI.Framework.focusFirstInSubTree(tree);
+ if (isElementFocused || numberOfRetries <= 0)
+ return WinJS.Promise.as(isElementFocused);
+ else
+ return WinJS.Promise.timeout(retryDelay).then(function delayComplete() {
+ return MS.Entertainment.UI.Framework.tryAndFocusElementInSubTreeWithRetry(tree, retryDelay, numberOfRetries - 1)
+ })
+ }, tryAndFocusElementWithRetry: function tryAndFocusElementWithRetry(element, retryDelay, numberOfRetries) {
+ Trace.assert(typeof numberOfRetries === "number", "tryAndFocusElementWithRetry: numberOfRetries expected to be a number");
+ Trace.assert(typeof retryDelay === "number", "tryAndFocusElementWithRetry: retryDelay expected to be a number");
+ Trace.assert(retryDelay > -1, "tryAndFocusElementWithRetry: Invalid timeout delay");
+ Trace.assert(element, "tryAndFocusElementWithRetry: Need a valid element to try and set focus");
+ MS.Entertainment.UI.Framework.focusElement(element);
+ var isElementFocused = document.activeElement === element;
+ if (isElementFocused || numberOfRetries <= 0)
+ return WinJS.Promise.as(isElementFocused);
+ else
+ return WinJS.Promise.timeout(retryDelay).then(function delayComplete() {
+ return MS.Entertainment.UI.Framework.tryAndFocusElementWithRetry(element, retryDelay, numberOfRetries - 1)
+ })
+ }, focusedItemInContainer: function focusedItemInContainer(container) {
+ if (document.activeElement)
+ if (container.contains(document.activeElement) && !(WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.firstDivClass) || WinJS.Utilities.hasClass(document.activeElement, MS.Entertainment.UI.Framework.TabConstrainer.lastDivClass)))
+ return true;
+ return false
+ }, focusFirstFocusableAncestor: function focusFirstFocusableAncestor(element, skipScroll) {
+ var ancestor = element;
+ do {
+ if (ancestor.domElement)
+ ancestor = ancestor.domElement;
+ if (excludeNonFocusableElements(ancestor)) {
+ MS.Entertainment.UI.Framework.focusElement(ancestor, skipScroll);
+ break
+ }
+ ancestor = ancestor.parentNode
+ } while (ancestor)
+ }, focusElement: function focusElement(elementToFocus, skipScroll, skipInputElementCheck, force) {
+ if (!force && !MS.Entertainment.UI.Framework.canMoveFocus(elementToFocus, skipInputElementCheck))
+ return;
+ if (skipScroll)
+ try {
+ elementToFocus.setActive()
+ }
+ catch(error) {
+ MS.Entertainment.Utilities.fail("Failed to set active element. Classes: " + elementToFocus.className + ", Error: " + (error && error.message), MS.Entertainment.UI.Debug.errorLevel.low)
+ }
+ else
+ elementToFocus.focus()
+ }, focusedElementHasClass: function focusedElementHasClass(classList) {
+ var hasClass = false;
+ if (document.activeElement && classList) {
+ if (!Array.isArray(classList))
+ classList = [classList];
+ for (var i = 0, l = classList.length; i < l; i++)
+ if (WinJS.Utilities.hasClass(document.activeElement, classList[i])) {
+ hasClass = true;
+ break
+ }
+ }
+ return hasClass
+ }, currentContentContainer: null, currentOverlayContainer: {get: function currentOverlayContainer_get() {
+ var currentIndex = currentOverlayContainers.length - 1;
+ return currentOverlayContainers[currentIndex]
+ }}, currentFocusContainer: {get: function currentFocusContainer_get() {
+ var focusableOverlay = MS.Entertainment.UI.Framework.currentOverlayContainer;
+ if (focusableOverlay && focusableOverlay.currentStyle && focusableOverlay.currentStyle.display === "none")
+ focusableOverlay = null;
+ return focusableOverlay || MS.Entertainment.UI.Framework.currentContentContainer
+ }}, addOverlayContainer: function addOverlayContainer(container) {
+ if (MS.Entertainment.UI.Framework.currentOverlayContainer && MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute)
+ MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute("aria-hidden", "true");
+ currentOverlayContainers.push(container)
+ }, removeOverlayContainer: function removeOverlayContainer(container) {
+ var indexOfItemToRemove = currentOverlayContainers.indexOf(container);
+ if (indexOfItemToRemove < 0)
+ return;
+ currentOverlayContainers.splice(indexOfItemToRemove, 1);
+ if (MS.Entertainment.UI.Framework.currentOverlayContainer && MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute)
+ MS.Entertainment.UI.Framework.currentOverlayContainer.setAttribute("aria-hidden", "false")
+ }, getVisibleFlyoutElement: function isFlyoutVisible() {
+ var flyouts = document.querySelectorAll(".win-flyout");
+ for (var i = 0; i < flyouts.length; i++) {
+ var flyout = flyouts[i];
+ if (flyout && flyout.winControl && !flyout.winControl.hidden)
+ return flyout
+ }
+ }, isFlyoutVisible: function isFlyoutVisible() {
+ return !!MS.Entertainment.UI.Framework.getVisibleFlyoutElement()
+ }, canMoveFocus: function canMoveFocus(targetContainer, skipInputElementCheck) {
+ if (!targetContainer)
+ return false;
+ var focusContainer = MS.Entertainment.UI.Framework.currentFocusContainer;
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ var targetingAppBar = false;
+ if (bottomAppBar && bottomAppBar.domElement)
+ targetingAppBar = bottomAppBar.domElement.contains(targetContainer);
+ if (focusContainer && !focusContainer.contains(targetContainer) && !targetingAppBar)
+ return false;
+ var flyout = MS.Entertainment.UI.Framework.getVisibleFlyoutElement();
+ if (flyout && !flyout.contains(targetContainer))
+ return false;
+ if (!skipInputElementCheck && MS.Entertainment.Utilities.isApp1 && document.activeElement && MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement))
+ return false;
+ return true
+ }, setFocusRoot: function setFocusRoot(prospectiveFocusRoot) {
+ var currentContentContainer = MS.Entertainment.UI.Framework.currentContentContainer || document.querySelector(".pageContainer.currentPage");
+ if (!prospectiveFocusRoot || !MS.Entertainment.UI.Framework.checkIfInDom(prospectiveFocusRoot) || (currentContentContainer !== prospectiveFocusRoot) || !currentContentContainer.contains(prospectiveFocusRoot))
+ prospectiveFocusRoot = currentContentContainer;
+ var overlay = MS.Entertainment.UI.Framework.currentOverlayContainer;
+ if (overlay && !overlay.contains(prospectiveFocusRoot))
+ prospectiveFocusRoot = overlay;
+ MS.Entertainment.UI.Framework.assert(prospectiveFocusRoot, "Somehow, we ended up without a focus root to set when we expected one");
+ if (WinJS.UI.AutomaticFocus && prospectiveFocusRoot)
+ WinJS.UI.AutomaticFocus.focusRoot = prospectiveFocusRoot
+ }, resetFocusToTopMostContent: function resetFocusToTopMostContent() {
+ var focusTarget = MS.Entertainment.UI.Framework.currentContentContainer;
+ if (MS.Entertainment.UI.Framework.currentOverlayContainer)
+ focusTarget = MS.Entertainment.UI.Framework.currentOverlayContainer;
+ var currentFocusedElementDetails = "No Focused element";
+ if (document.activeElement)
+ currentFocusedElementDetails = "ClassName: " + document.activeElement.className + ", " + "ID: " + document.activeElement.id;
+ MS.Entertainment.UI.Framework.fail("User manually reset focus. Focus was in this location: " + currentFocusedElementDetails);
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(focusTarget)
+ }, scrollViewerFocusHelper: function scrollViewerFocusHelper(scrollViewer) {
+ if (!scrollViewer)
+ return;
+ if (!WinJS.Utilities.hasClass(scrollViewer, "win-scrollviewer-scrollmode-list"))
+ return;
+ var scrollContainer = scrollViewer.querySelector(".win-scrollviewer-contentelement");
+ if (!scrollContainer)
+ return;
+ scrollContainer.addEventListener("focus", function(evt) {
+ if (evt.target)
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(evt.target, true, true)
+ })
+ }, setButtonListFocusOverrides: function setButtonListFocusOverrides(domElement, queryString) {
+ if (!domElement || !queryString)
+ return;
+ var noOp = ".currentPage :focus";
+ var actionButtons = domElement.querySelectorAll(queryString);
+ for (var i = 0; i < actionButtons.length; i++)
+ actionButtons[i].removeAttribute("data-win-focus");
+ if (actionButtons.length === 1)
+ actionButtons[0].setAttribute("data-win-focus", JSON.stringify({
+ up: noOp, down: noOp
+ }));
+ else if (actionButtons.length > 1) {
+ actionButtons[0].setAttribute("data-win-focus", JSON.stringify({up: noOp}));
+ actionButtons[actionButtons.length - 1].setAttribute("data-win-focus", JSON.stringify({down: noOp}))
+ }
+ }
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {VirtualizedDataSource: MS.Entertainment.UI.Framework.derive(WinJS.UI.VirtualizedDataSource, function(listDataAdapter, options) {
+ if (listDataAdapter && listDataAdapter.createListAdaptor)
+ listDataAdapter = listDataAdapter.createListAdaptor();
+ this._baseDataSourceConstructor(listDataAdapter, options)
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getRetailExperienceState: function getRetailExperienceState() {
+ return (new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience
+ }, setRetailExperienceState: function setRetailExperienceState(isEnabled) {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configuration.shell.retailExperience = isEnabled;
+ configuration.fue.showLXFUE = !isEnabled;
+ WinJS.Promise.timeout(10 * 1000).done(function retailExperienceInformCustomer() {
+ MSApp.terminateApp(new Error("Retail experience mode changed"))
+ })
+ }, resetAppStateForRetailExperienceIfNeeded: function resetAppStateForRetailExperienceIfNeeded() {
+ if (!MS.Entertainment.Utilities.getRetailExperienceState())
+ return false;
+ var previousExecutionDate = Windows.Storage.ApplicationData.current.localSettings[MS.Entertainment.Utilities.lastRunDemoModeDateKey];
+ var currentExecutionDate = (new Date).toLocaleDateString();
+ var wasReset = false;
+ if (previousExecutionDate && (previousExecutionDate !== currentExecutionDate)) {
+ var configManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configManager.groveler.fullGrovelCompleted = false;
+ wasReset = true
+ }
+ Windows.Storage.ApplicationData.current.localSettings[MS.Entertainment.Utilities.lastRunDemoModeDateKey] = currentExecutionDate;
+ return wasReset
+ }, loadDemoScripts: function loadDemoScripts() {
+ var loadPromise;
+ if (MS.Entertainment.Utilities.isVideoApp1 && MS.Entertainment.Utilities.getRetailExperienceState())
+ loadPromise = MS.Entertainment.UI.Framework.loadScripts("/components/video/DemoDashboardViewModel.js", "/components/inlinedetails/VideoInlineDetailsDemo.js");
+ return WinJS.Promise.as(loadPromise)
+ }, removeAllPlaylistsIfDemoMode: function removeAllPlayListsIfDemoMode() {
+ if (!MS.Entertainment.Utilities.getRetailExperienceState() || !MS.Entertainment.Utilities.isMusicApp)
+ return;
+ var playlistsToDelete = [];
+ var query = new MS.Entertainment.Data.Query.libraryPlaylists;
+ query.sort = Microsoft.Entertainment.Queries.PlaylistsSortBy.dateEditedDescending;
+ query.getItems().then(function demoModePlaylistQuery(playlists) {
+ return playlists.forEachAll(function demoModePlaylistForEach(playlist) {
+ var id = WinJS.Utilities.getMember("item.data.libraryId", playlist);
+ if (id < 1)
+ return;
+ playlistsToDelete.push(id)
+ })
+ }).then(function demoModePlaylistDeletePlaylists() {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ var playlistProvider = mediaStore.playlistProvider;
+ return playlistProvider.deletePlaylistAsync(playlistsToDelete, Microsoft.Entertainment.Platform.MediaAvailability.available)
+ }).done(null, function demoModePlaylistFailure(e) {
+ MS.Entertainment.Utilities.fail("Failure deleting playlists in demo mode: " + (e && e.message))
+ })
+ }, retailExperienceArgument: "RetailExperience", lastRunDemoModeDateKey: "RetailDemoMode"
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {getCurrentUserLocation: function getCurrentUserLocation() {
+ var classicNavServiceCurrentPage = String.empty;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ classicNavServiceCurrentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).getUserLocation();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation) && (classicNavServiceCurrentPage.indexOf("homeHub") === 0 || !classicNavServiceCurrentPage)) {
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ return navigationJournal ? navigationJournal.location : String.empty
+ }
+ else if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ return classicNavServiceCurrentPage;
+ else
+ return String.empty
+ }});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ wasNavigatedToDashboard: false, assertIfCalledBeforeCriticalWorkCompleted: function assertIfCalledBeforeCriticalWorkCompleted() {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var isFirstLocationLoaded = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation).isFirstLocationLoaded;
+ var wasNavigatedToDashboard = !MS.Entertainment.Utilities.wasNavigatedToDashboard || uiStateService.isHubStripVisible;
+ MS.Entertainment.UI.Framework.assert(isFirstLocationLoaded || wasNavigatedToDashboard, "Function was called before all start-up critical work has been completed")
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ updateHtmlDirectionAttribute: MS.Entertainment.UI.Framework.updateHtmlDirectionAttribute, getTextDirection: MS.Entertainment.UI.Framework.getTextDirection, TextDirections: MS.Entertainment.UI.Framework.TextDirections, TriggerSequence: function(keyArray, continuityTimeout, callback) {
+ var state = 0;
+ var lastTime = null;
+ this.inSequence = function() {
+ return state > 0
+ };
+ this.keyIn = function(key) {
+ if (lastTime === null || ((new Date) - lastTime) > continuityTimeout)
+ state = 0;
+ lastTime = new Date;
+ if (keyArray[state] === key)
+ state++;
+ else
+ lastTime = null;
+ if (lastTime !== null && state === keyArray.length) {
+ callback();
+ lastTime = null;
+ return true
+ }
+ return false
+ }
+ }, trimCharacterDirection: function trimCharacterDirection(string) {
+ if (string) {
+ var start = 0;
+ var end = string.length;
+ var firstChar = string.charCodeAt(0);
+ var lastChar = string.charCodeAt(end - 1);
+ if (firstChar === String.rtlmCode || firstChar === String.ltrmCode)
+ start++;
+ if (lastChar === String.rtlmCode || lastChar === String.ltrmCode)
+ end--;
+ if (start !== 0 || end !== string.length)
+ string = string.substr(start, end)
+ }
+ return string
+ }, detectCharacterDirection: function detectCharacterDirection(ch) {
+ if (ch < 0x249C) {
+ if (ch < 0x200E) {
+ if (ch >= 0x0041 && ch <= 0x005A || ch >= 0x0061 && ch <= 0x007A || ch >= 0x00C0 && ch <= 0x02B8 || ch >= 0x0370 && ch <= 0x0589 || ch >= 0x0900 && ch <= 0x1FFC)
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ else if (ch >= 0x0591 && ch <= 0x085E)
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft
+ }
+ else if (ch >= 0x2090 && ch <= 0x209C || ch >= 0x210A && ch <= 0x2188 || ch >= 0x2336 && ch <= 0x237A || ch === String.ltrmCode)
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ else if (ch === String.rtlmCode)
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft
+ }
+ else if (ch < 0xFD50) {
+ if (ch <= 0x24E9 || (ch >= 0x2800 && ch <= 0x28FF) || (ch >= 0x2C00 && ch <= 0x2DFF) || (ch >= 0x3021 && ch <= 0x4DB5) || (ch >= 0x4E00 && ch <= 0xFB17))
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ else if (ch >= 0xFB1D && ch <= 0xFD3D)
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft
+ }
+ else if (ch <= 0xFDFC || (ch >= 0xFE70 && ch <= 0xFEFC))
+ return MS.Entertainment.Utilities.TextDirections.RightToLeft;
+ else if ((ch >= 0xFF21 && ch <= 0xFF3A) || (ch >= 0xFF41 && ch <= 0xFF5A) || (ch >= 0xFF65 && ch <= 0xFFDC))
+ return MS.Entertainment.Utilities.TextDirections.LeftToRight;
+ return null
+ }, detectStringDirection: function detectStringDirection(value, min, max) {
+ var char;
+ var characterDirection;
+ max = isNaN(max) ? value.length : max;
+ for (var i = isNaN(min) ? 0 : min; i < max; i++) {
+ char = value.charCodeAt(i);
+ if (char !== 0x0020 && char !== 0x0009 && char !== 0x000A && char !== 0x000D) {
+ characterDirection = MS.Entertainment.Utilities.detectCharacterDirection(char);
+ if (characterDirection)
+ return characterDirection
+ }
+ }
+ return MS.Entertainment.Utilities.getTextDirection()
+ }, needsNormalizedBaseline: function needsNormalizedBaseline(value, min, max) {
+ var char;
+ max = isNaN(max) ? value.length : max;
+ min = isNaN(min) ? 0 : min;
+ for (var i = min; i < max; i++) {
+ char = value.charCodeAt(i);
+ if ((char < 0xAC00 || char > 0xD7AF) && (char !== 0x0020))
+ return false
+ }
+ return (max - min) ? true : false
+ }, verifyUrl: function verifyUrl(value, requireHttps) {
+ var requiredHttpsExpression = /^https:\/\//i;
+ var anyHttpExpression = /^http[s]?:\/\//i;
+ if (requireHttps)
+ return requiredHttpsExpression.test(value);
+ else
+ return anyHttpExpression.test(value)
+ }, sanitizeString: function sanitizeString(dirtyString) {
+ return dirtyString ? dirtyString.toLowerCase().replace(/[^\w\s]/g, String.empty) : String.empty
+ }, isStreamingUrl: function(url) {
+ return (url && url.match && url.match(/^zest:/i))
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ _cachedConfigurationXuid: null, _cachedConfigurationValues: null, _loadUserConfigurationValues: function _loadUserConfigurationValues(xuid) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!xuid)
+ MS.Entertainment.fail("loadUserConfigurationValues: xuid not defined");
+ try {
+ var setting = Windows.Storage.ApplicationData.current.localSettings.values[xuid];
+ var values = {};
+ if (setting)
+ try {
+ values = JSON.parse(setting)
+ }
+ catch(error) {
+ MS.Entertainment.UI.fail("Failed to parse user configuration values: " + error && error.message);
+ Windows.Storage.ApplicationData.current.localSettings.values[xuid] = null
+ }
+ MS.Entertainment.Utilities._cachedConfigurationXuid = xuid;
+ MS.Entertainment.Utilities._cachedConfigurationValues = values
+ }
+ catch(error) {}
+ }, getUserConfigurationValue: function getUserConfigurationValue(configurationKey) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var xuid = configurationManager.service.lastSignedInUserXuid;
+ if (!xuid)
+ xuid = "UnauthenticatedUser";
+ if (MS.Entertainment.Utilities.isApp2 && xuid !== MS.Entertainment.Utilities._cachedConfigurationXuid)
+ MS.Entertainment.Utilities._loadUserConfigurationValues(xuid);
+ return MS.Entertainment.Utilities._cachedConfigurationValues && MS.Entertainment.Utilities._cachedConfigurationValues[configurationKey]
+ }, setUserConfigurationValue: function setUserConfigurationValue(configurationKey, value) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var xuid = configurationManager.service.lastSignedInUserXuid;
+ if (!xuid)
+ xuid = "UnauthenticatedUser";
+ if (MS.Entertainment.Utilities.isApp2 && xuid !== MS.Entertainment.Utilities._cachedConfigurationXuid)
+ MS.Entertainment.Utilities._loadUserConfigurationValues(xuid);
+ if (MS.Entertainment.Utilities.isApp2)
+ try {
+ var values = MS.Entertainment.Utilities._cachedConfigurationValues || {};
+ var oldValue = values[configurationKey];
+ if (value === undefined)
+ delete values[configurationKey];
+ else
+ values[configurationKey] = value;
+ if (value !== oldValue)
+ Windows.Storage.ApplicationData.current.localSettings.values[xuid] = JSON.stringify(values);
+ MS.Entertainment.Utilities._cachedConfigurationValues = values
+ }
+ catch(error) {}
+ }, deleteUserConfigurationValue: function deleteUserConfigurationValue(configurationKey) {
+ MS.Entertainment.Utilities.setUserConfigurationValue(configurationKey, undefined)
+ }, UserConfigurationValues: {
+ albumArtistSyncScreenDismissed: "albumArtistSyncScreenDismissed", cachedGenre1: "cachedGenre1", cachedGenre2: "cachedGenre2", collectionDialogXuids: "collectionDialogXuids", homeEducationXuids: "homeEducationXuids", minimumListensForEducationPanelsReachedXuids: "minimumListensForEducationPanelsReachedXuids", musicVideosOpt: "musicVideosOpt", notInterestedRecommendations: "notInterestedRecommendations", nowPlayingEducationXuids: "nowPlayingEducationXuids", playlistDialogXuids: "playlistDialogXuids", playlistSyncScreenDismissed: "playlistSyncScreenDismissed", previousApplicationState: "previousApplicationState", welcomeDialogOverride: "welcomeDialogOverride"
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ isFileTypeInList: function isFileTypeInList(fileTypeList, fileType) {
+ if (!fileType || !fileTypeList)
+ return false;
+ var searchPattern = new RegExp("(^|;)" + fileType + ";", "i");
+ return fileTypeList.match(searchPattern) !== null
+ }, getMediaFileContentType: function getMediaFileContentType(media) {
+ var fileContentType = String.empty;
+ var fileSubContentType = String.empty;
+ try {
+ var contentTypeString = (media && media.contentType) || String.empty;
+ var typeParts = contentTypeString.split("/");
+ fileContentType = typeParts[0].toLowerCase();
+ fileSubContentType = typeParts.length > 0 ? typeParts[1].toLowerCase() : String.empty
+ }
+ catch(e) {}
+ if (fileContentType === "application" || fileContentType === "text") {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (MS.Entertainment.Utilities.isFileTypeInList(configurationManager.amsterdam.videoContentTypes, fileSubContentType))
+ fileContentType = "video";
+ else if (MS.Entertainment.Utilities.isFileTypeInList(configurationManager.amsterdam.musicContentTypes, fileSubContentType))
+ fileContentType = "audio"
+ }
+ return fileContentType
+ }, getMediaFileFileType: function getMediaFileFileType(media) {
+ var mediaFileType = String.empty;
+ try {
+ mediaFileType = (media && media.fileType) || String.empty
+ }
+ catch(e) {
+ if (e.number === MS.Entertainment.Platform.Playback.Error.E_NOTIMPL.code) {
+ var uri = new Windows.Foundation.Uri(media.path);
+ mediaFileType = uri.extension
+ }
+ }
+ return mediaFileType.toLowerCase()
+ }, isLocalMarketplaceVideo: function isLocalMarketplaceVideo(mediaInstance) {
+ function endsWith(str, suffix) {
+ return str.toLowerCase().indexOf(suffix, str.length - suffix.length) !== -1
+ }
+ var result = false;
+ if (mediaInstance && mediaInstance.isLocal && mediaInstance.protectionState !== MS.Entertainment.Platform.Playback.ProtectionState.unprotected) {
+ var filePath = null;
+ if (mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ if (mediaInstance._mediaItem.data.fileItem && mediaInstance._mediaItem.data.fileItem.path)
+ filePath = mediaInstance._mediaItem.data.fileItem.path;
+ else if (mediaInstance._mediaItem.data.filePath)
+ filePath = mediaInstance._mediaItem.data.filePath;
+ if (filePath && typeof filePath === "string" && ((endsWith(filePath, ".mp4") && filePath.match(/^.*SMID(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}.*$/)) || (endsWith(filePath, ".wmv") && mediaInstance.protectionState === MS.Entertainment.Platform.Playback.ProtectionState.protected)))
+ result = true
+ }
+ return result
+ }, getApp2OSVersion: function getApp2OSVersion() {
+ var developmentKitProperties = WinJS.Utilities.getMember("Windows.Xbox.System.Internal.DevelopmentKit.DevelopmentKitProperties");
+ var shellVersion = null;
+ if (developmentKitProperties)
+ shellVersion = developmentKitProperties["shellVersion"];
+ if (shellVersion) {
+ var versionNumberArrayUnformatted = shellVersion.match(/_\d\d\d\d\./);
+ if (versionNumberArrayUnformatted.length > 0)
+ return +versionNumberArrayUnformatted[0].substr(1, 4)
+ }
+ }, isDlnaSupported: function isDlnaSupported() {
+ if (MS.Entertainment.Utilities.isTestApp)
+ return true;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.amsterdam.minimumDlnaSupportedBuild > 0 && MS.Entertainment.Utilities.getApp2OSVersion() >= configurationManager.amsterdam.minimumDlnaSupportedBuild
+ }, isSetBackgroundImageSupported: function isSetBackgroundImageSupported() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return configurationManager.amsterdam.minimumSetBackgroundImageSupportedBuild > 0 && MS.Entertainment.Utilities.getApp2OSVersion() >= configurationManager.amsterdam.minimumSetBackgroundImageSupportedBuild && !!WinJS.Utilities.getMember("Windows.Xbox.System.Internal.UserSettings.UserSettings.setUserBackgroundImageAsync")
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getUserRoamingSetting: function getUserRoamingSetting(configurationKey) {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.Utilities.getUserConfigurationValue(configurationKey);
+ else
+ return Windows.Storage.ApplicationData.current.roamingSettings.values[configurationKey]
+ }, setUserRoamingSetting: function setUserRoamingSetting(configurationKey, value) {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Utilities.setUserConfigurationValue(configurationKey, value);
+ else
+ Windows.Storage.ApplicationData.current.roamingSettings.values[configurationKey] = value
+ }, deleteUserRoamingSetting: function deleteUserRoamingSetting(configurationKey) {
+ if (MS.Entertainment.Utilities.isApp2)
+ MS.Entertainment.Utilities.deleteUserConfigurationValue(configurationKey);
+ else
+ Windows.Storage.ApplicationData.current.roamingSettings.values.remove(configurationKey)
+ }
+ });
+ (function() {
+ var uniqueInteger = -1;
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {getSessionUniqueInteger: function getSessionUniqueInteger() {
+ uniqueInteger++;
+ return uniqueInteger
+ }})
+ })();
+ (function() {
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {
+ beginShowAnimations: function beginShowAnimations(element, overrideOldSelector, overrideNewSelector) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, overrideOldSelector || "data-ent-hideanimation", overrideNewSelector || "data-ent-showanimation")
+ }, beginHideAnimations: function beginHideAnimations(element, overrideOldSelector, overrideNewSelector) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, overrideOldSelector || "data-ent-showanimation", overrideNewSelector || "data-ent-hideanimation")
+ }, clearHideAnimations: function clearHideAnimations(element) {
+ return MS.Entertainment.UI.Framework._clearAnimations(element, "data-ent-hideanimation")
+ }, clearShowAnimations: function clearShowAnimations(element) {
+ return MS.Entertainment.UI.Framework._clearAnimations(element, "data-ent-showanimation")
+ }, beginEnterAnimations: function beginShowAnimations(element) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, "data-ent-exitanimation", "data-ent-enteranimation")
+ }, beginExitAnimations: function beginHideAnimations(element) {
+ return MS.Entertainment.UI.Framework._beginAnimations(element, "data-ent-enteranimation", "data-ent-exitanimation")
+ }, _clearAnimations: function _clearAnimations(element, oldSelector) {
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled)
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[" + oldSelector + "]", function(subElement) {
+ var animationClasses = subElement.getAttribute(oldSelector);
+ if (animationClasses)
+ animationClasses.split(" ").forEach(function(animationClass) {
+ WinJS.Utilities.removeClass(subElement, animationClass)
+ })
+ }, true)
+ }, _beginAnimations: function _beginAnimations(element, oldSelector, newSelector) {
+ var hasAnimations = false;
+ var promises = [];
+ var animationsEnabled = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState))
+ animationsEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).animationsEnabled;
+ if (animationsEnabled) {
+ MS.Entertainment.UI.Framework._clearAnimations(element, oldSelector);
+ MS.Entertainment.UI.Framework.applyWithSelector(element, "[" + newSelector + "]", function(subElement) {
+ if (MS.Entertainment.Utilities.isElementVisible(subElement)) {
+ var animationClasses = subElement.getAttribute(newSelector);
+ if (animationClasses) {
+ var complete;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ complete = c
+ });
+ promises.push(promise);
+ var processAnimationAndComplete = function processAnimationAndComplete(animationName) {
+ var index = animationNames.indexOf(animationName);
+ if (index > -1) {
+ animationNames.splice(index, 1);
+ if (animationNames.length === 0) {
+ subElement.removeEventListener("animationend", animationComplete);
+ complete()
+ }
+ return true
+ }
+ else
+ return false
+ };
+ var animationNames = [];
+ var animationComplete = function animationComplete(event) {
+ if (event.srcElement !== subElement)
+ return;
+ if (!processAnimationAndComplete(event.animationName))
+ if (subElement.currentStyle && subElement.currentStyle.animationName) {
+ animationNames = subElement.currentStyle.animationName.split(",").map(function(animationName) {
+ return animationName.trim()
+ });
+ if (!processAnimationAndComplete(event.animationName));
+ hasAnimations = true
+ }
+ };
+ subElement.addEventListener("animationend", animationComplete);
+ animationClasses.split(" ").forEach(function(animationClass) {
+ if (!WinJS.Utilities.hasClass(subElement, animationClass))
+ WinJS.Utilities.addClass(subElement, animationClass)
+ });
+ animationNames = subElement.currentStyle.msAnimationName.split(",").map(function(animationName) {
+ return animationName.trim()
+ });
+ if (animationNames.length <= 0 || (animationNames.length === 1 && animationNames[0] === "none")) {
+ subElement.removeEventListener("animationend", animationComplete);
+ complete()
+ }
+ else
+ hasAnimations = true;
+ if (!hasAnimations);
+ if (!hasAnimations) {
+ var transitionProperties = subElement.currentStyle.msTransitionProperty.split(",").map(function(transitionProperty) {
+ return transitionProperty.trim()
+ });
+ if (transitionProperties.length > 0) {
+ var transitionComplete = function transitionComplete(event) {
+ var index = transitionProperties.indexOf(event.propertyName);
+ if (index > -1) {
+ transitionProperties.splice(index, 1);
+ if (transitionProperties.length === 0) {
+ subElement.removeEventListener("transitionend", transitionComplete);
+ complete()
+ }
+ }
+ };
+ subElement.addEventListener("transitionend", transitionComplete);
+ hasAnimations = true
+ }
+ }
+ }
+ }
+ }, true)
+ }
+ if (promises.length)
+ return WinJS.Promise.join(promises);
+ else
+ return WinJS.Promise.wrap()
+ }
+ })
+ })();
+ (function() {
+ var lazyDefine = MS.Entertainment.UI.Framework.lazyDefine;
+ var imageExtension = "png";
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {getPackageImageFileExtension: function() {
+ return imageExtension
+ }});
+ WinJS.Namespace.define("MS.Entertainment.UI.ImagePaths", {
+ transparent: lazyDefine(function() {
+ return "ms-appx:///Images/transparent." + imageExtension
+ }), imageNotFound: lazyDefine(function() {
+ return "ms-appx:///Images/img_not_found." + imageExtension
+ }), genericVideoActorPlaceholder: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/actor_placeholder." + imageExtension
+ }), genericVideoCastPlaceholder: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/cast_placeholder." + imageExtension
+ }), genericVideoL3Hero: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/ico_GenericVideo_L3_Hero." + imageExtension
+ }), genericVideoSmall: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/ico_74x_GenericVideo_Small." + imageExtension
+ }), genericVideoMedium: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/ico_74x_GenericVideo_Medium." + imageExtension
+ }), genericVideoLarge: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/ico_74x_GenericVideo_Large." + imageExtension
+ }), genericVideoLargeMovie: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/ico_74x_GenericVideo_LargeMovie." + imageExtension
+ }), genericVideoWide: lazyDefine(function() {
+ return "ms-appx:///Images/GenericIcons/ico_GenericVideo_Wide." + imageExtension
+ }), videoDemoMoviePopover: lazyDefine(function() {
+ return "ms-appdata:///local/Images/movie_popover." + imageExtension
+ }), videoDemoTvPopover: lazyDefine(function() {
+ return "ms-appdata:///local/Images/tv_popover." + imageExtension
+ })
+ })
+ })();
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ getTryAgainDynamicText: function getTryAgainDynamicText() {
+ var stringId = String.id.IDS_DETAILS_TRY_AGAIN_LABEL;
+ if (MS.Entertainment.Utilities.isVideoApp)
+ if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd)
+ stringId = String.id.IDS_DETAILS_TRY_AGAIN_LABEL_HD;
+ else if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd)
+ stringId = String.id.IDS_DETAILS_TRY_AGAIN_LABEL_SD;
+ return stringId
+ }, getDownloadDynamicText: function getDownloadDynamicText() {
+ var stringId = String.id.IDS_DETAILS_DOWNLOAD_LABEL;
+ if (MS.Entertainment.Utilities.isVideoApp)
+ if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd)
+ stringId = String.id.IDS_DETAILS_DOWNLOAD_LABEL_HD;
+ else if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd)
+ stringId = String.id.IDS_DETAILS_DOWNLOAD_LABEL_SD;
+ return stringId
+ }, getDownloadSeasonDynamicText: function getDownloadSeasonDynamicText() {
+ var stringId = String.id.IDS_TV_DOWNLOAD_SEASON_BUTTON;
+ if (MS.Entertainment.Utilities.isVideoApp)
+ if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.hd)
+ stringId = String.id.IDS_TV_DOWNLOAD_SEASON_BUTTON_HD;
+ else if (MS.Entertainment.UI.Controls.ChooseDownloadQualityOverlay.storedDownloadPreference === MS.Entertainment.Data.Augmenter.Marketplace.videoDefinition.sd)
+ stringId = String.id.IDS_TV_DOWNLOAD_SEASON_BUTTON_SD;
+ return stringId
+ }, convertMediaItemToTvSeries: function convertMediaItemToTvSeries(mediaItem) {
+ if (!mediaItem) {
+ MS.Entertainment.Framework.fail("convertMediaItemToTvSeries requires a mediaItem");
+ return null
+ }
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeries(mediaItem))
+ return mediaItem;
+ var seriesData = null;
+ if (mediaItem.seriesId && MS.Entertainment.Utilities.isValidServiceId(mediaItem.seriesId)) {
+ seriesData = {
+ libraryId: mediaItem.seriesLibraryId, Name: mediaItem.seriesTitle
+ };
+ if (mediaItem.seriesIdType && mediaItem.seriesIdType === MS.Entertainment.Data.Query.edsIdType.zuneCatalog)
+ seriesData.ZuneId = mediaItem.seriesId;
+ else
+ seriesData.ID = mediaItem.seriesId
+ }
+ else if (mediaItem.canonicalSeriesId && MS.Entertainment.Utilities.isValidServiceId(mediaItem.canonicalSeriesId))
+ seriesData = {
+ ID: mediaItem.canonicalSeriesId, title: {$value: mediaItem.canonicalSeriesTitle}
+ };
+ else {
+ MS.Entertainment.UI.Framework.fail("convertMediaItemToTvSeries encountered an unsupported media type");
+ return null
+ }
+ var newMediaItem = MS.Entertainment.Data.augment(seriesData, MS.Entertainment.Data.Augmenter.Marketplace.EdsTVSeries);
+ return MS.Entertainment.ViewModels.MediaItemModel.augment(newMediaItem)
+ }, convertMediaItemToTvSeason: function convertMediaItemToTvSeason(mediaItem) {
+ if (!mediaItem) {
+ MS.Entertainment.Framework.fail("convertMediaItemToTvSeason requires a mediaItem");
+ return null
+ }
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(mediaItem))
+ return mediaItem;
+ var seasonData = null;
+ if (mediaItem.seasonId && MS.Entertainment.Utilities.isValidServiceId(mediaItem.seriesId)) {
+ seasonData = {
+ libraryId: mediaItem.seasonLibraryId, Name: mediaItem.seasonTitle
+ };
+ if (mediaItem.seasonIdType && mediaItem.seasonIdType === MS.Entertainment.Data.Query.edsIdType.zuneCatalog)
+ seasonData.ZuneId = mediaItem.seasonId;
+ else
+ seasonData.ID = mediaItem.seasonId
+ }
+ else if (mediaItem.canonicalSeasonId && MS.Entertainment.Utilities.isValidServiceId(mediaItem.canonicalSeriesId))
+ seasonData = {ID: mediaItem.canonicalSeasonId};
+ else {
+ MS.Entertainment.UI.Framework.fail("convertMediaItemToTvSeries encountered an unsupported media type");
+ return null
+ }
+ var newMediaItem = MS.Entertainment.Data.augment(seasonData, MS.Entertainment.Data.Augmenter.Marketplace.EdsTVSeason);
+ return MS.Entertainment.ViewModels.MediaItemModel.augment(newMediaItem)
+ }, getLegacyVideoRowCountForResolution: function getLegacyVideoRowCountForResolution() {
+ var standardResolutionRows = MS.Entertainment.Utilities.STANDARD_RESOLUTION_ROWS;
+ var highResolutionRows = MS.Entertainment.Utilities.HIGH_RESOLUTION_ROWS;
+ var rowCount = standardResolutionRows;
+ if (MS.Entertainment.Utilities.isHighResolution())
+ rowCount = highResolutionRows;
+ return rowCount
+ }, checkRecommendationsItemForNotInterested: function checkRecommendationsItemForNotInterested(item) {
+ var notInterestedRecommendations = MS.Entertainment.Utilities.getUserConfigurationValue(MS.Entertainment.Utilities.UserConfigurationValues.notInterestedRecommendations);
+ if (notInterestedRecommendations)
+ for (var i = 0; i < notInterestedRecommendations.length; i++)
+ if (notInterestedRecommendations[i] === item.serviceId)
+ return true;
+ return false
+ }, addNotInterestedRecommendationsItem: function addNotInterestedRecommendationsItem(item) {
+ var notInterestedRecommendations = MS.Entertainment.Utilities.getUserConfigurationValue(MS.Entertainment.Utilities.UserConfigurationValues.notInterestedRecommendations);
+ if (!notInterestedRecommendations)
+ notInterestedRecommendations = [];
+ notInterestedRecommendations = notInterestedRecommendations.concat([item.serviceId]);
+ MS.Entertainment.Utilities.setUserConfigurationValue(MS.Entertainment.Utilities.UserConfigurationValues.notInterestedRecommendations, notInterestedRecommendations)
+ }, postNotInterestedRecommendationsItem: function postNotInterestedRecommendationsItem(item) {
+ if (item) {
+ var queryData = {Feedback: {
+ FeedbackValue: MS.Entertainment.Data.Query.Shared.SetRecommendationFeeback.notInterestedFeedbackValue, MediaId: item.serviceId, MediaType: item.edsMediaItemType
+ }};
+ var query = new MS.Entertainment.Data.Query.Shared.SetRecommendationFeeback(queryData);
+ return query.execute().then(null, function error(){})
+ }
+ else
+ return WinJS.Promise.as()
+ }, getTvInlineDetailsPopoverControl: function getTvInlineDetailsPopoverControl() {
+ var popoverControl = "MS.Entertainment.Pages.TvSeriesInlineDetails";
+ if (MS.Entertainment.Utilities.isApp2)
+ popoverControl = "MS.Entertainment.Pages.TvSeriesInlineDetailsFullScreen";
+ return popoverControl
+ }, relatedMovieGridItemSizeSmall: {
+ width: 200, height: 265
+ }, relatedMovieGridItemSize: {
+ width: 270, height: 360
+ }, relatedMovieGridItemSize2: {
+ width: 238, height: 324
+ }, relatedTvGridItemSize2: {
+ width: 324, height: 324
+ }, seasonGridItemSizeSmall: {
+ width: 225, height: 265
+ }, seasonGridItemSize: {
+ width: 320, height: 360
+ }, seasonGridItemSize2: {
+ width: 275, height: 360
+ }, movieTileSize: {
+ width: 185, height: 255
+ }, movieLargeTileSize: {
+ width: 240, height: 326
+ }, personalTileSize: {
+ width: 250, height: 255
+ }, personalTileSizeL1Small: {
+ width: 165, height: 170
+ }, tvTileSize: {
+ width: 250, height: 255
+ }, tvLargeTileSize: {
+ width: 326, height: 326
+ }, tvHeroSize: {get: function() {
+ if (MS.Entertainment.Utilities.isVideoApp1)
+ return {
+ width: 550, height: 550
+ };
+ else
+ return {
+ width: 480, height: 480
+ }
+ }}
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Icon", {
+ achievements: "\uE288", actionLinkArrow: "\uE26B", actionLinkArrowRTL: "\uE26C", addToCollection: "\uE2B3", addToNowPlaying: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.addToNowPlaying2;
+ else
+ return MS.Entertainment.UI.Icon.addToNowPlaying1
+ }}, addToNowPlaying1: "\uE2AE", addToNowPlaying2: "\uE2E0", addToPlaylist: "\uE2B1", arrowNext: "\uE2EF", arrowPrevious: "\uE2EE", avatarItem: "\uE27B", background: "\uE39B", book: "\uE2EA", bookStore: "\uE2F8", bullet: "\u16EB", invokeButton: "\uE3CE", camera: "\uE41C", chevronDown: "\uE3AF", chevronDownLight: "\E09D", chevronUp: "\uE3B0", cloud: "\uE2C1", cloudNotAvailable: "\uE2BF", cloudSyncing: "\uE2DD", close: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE409";
+ else
+ return "\u2715"
+ }}, closedCaption: "\uE437", colorable: "\uE292", computer: "\uE39E", devices: "\uE2ED", details: "\uE28F", downloading: "\uE2BC", downloadingArrowPart: "\uE2BE", downloadingBasePart: "\uE2BD", downChevron: "\uE0A1", feedback: "\uE2E4", flexhub: "\uE2DE", friend: "\uE287", friendPending: "\uE2DC", friendRespond: "\uE289", friendRemove: "\uE28A", friendAdd: "\uE28B", genericVideo: "\uE29D", genericGame: "\uE29E", genericMusic: "\uE29F", game: "\uE279", gameAddon: "\uE277", gameCompare: "\uE286", gameDemo: "\uE276", gameJoin: "\uE278", hd: "\uE33F", home: "\uE274", info: "\uE2B6", inlineAchievements: "\uE2A1", inlineAwarded: "\uE2A2", inlineBeacon: "\uE2A3", inlineColorable: "\uE2A4", inlineFriend: "\uE2A8", inlineGame: "\uE2A5", inlineGamerScore: "\uE2A9", inlineError: "\uE2A6", inlineNotification: "\uE2E2", inlineLink: "\uE2A7", inlineLock: "\uE2A0", inlineNowPlaying: "\uE2B4", inlinePoints: "\uE2AA", inlineStreaming: "\uE2AB", list: "\uE331", magazine: "\uE2F7", magazineStore: "\uE2F9", modifierAvatarItem: "\uE295", modifierFriend: "\uE296", modifierXbox: "\uE297", modifierPlaylist: "\uE298", modifierAddRing: "\uE299", modifierAddRingPressed: "\uE29A", modifierRemoveRing: "\uE29B", modifierRemoveRingPressed: "\uE29C", moveToBottom: "\uE2FB", moveToTop: "\uE2FA", movies: "\uE410", musicInCollection: "\uE300", menu: "\uE27C", next: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE402";
+ else
+ return WinJS.UI.AppBarIcon.next
+ }}, noSelection: "\uE294", notification: "\uE2E5", nowPlayingNext: "\uE097", nowPlayingPrev: "\uE096", oneDrive: "\uE306", playlist: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE43E";
+ else
+ return "\uE28F"
+ }}, photo: "\uE282", previous: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE403";
+ else
+ return WinJS.UI.AppBarIcon.previous
+ }}, profile: "\uE285", related: "\uE280", repeat: "\uE290", repeatOnce: "\uE291", radio: "\uE2FD", readingCollection: "\uE2F5", readingSubscription: "\uE2EB", screenFull: "\uE272", fullScreen: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE45A";
+ else
+ return MS.Entertainment.UI.Icon.screenFull
+ }}, screenNormal: "\uE273", semanticZoom: "\uE2E7", shop: "\uE275", smartDj: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjWithRing
+ }}, smartDjPressed: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjPressedWithRing
+ }}, smartDjPressedWithRing: "\uE283", smartDjWithRing: "\uE284", smartDjAppbar: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjAppbarWithRing
+ }}, smartDjAppbarPressed: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.UI.Icon.smartDjNoRing;
+ else
+ return MS.Entertainment.UI.Icon.smartDjAppbarPressedWithRing
+ }}, smartDjAppbarWithRing: "\uE2BB", smartDjAppbarPressedWithRing: "\uE2BA", smartDjNoRing: "\uE2DF", smartGlassTablet: "\uE34E", streaming: "\uE2E3", smiley: "\uE293", subtitle: "\uE44D", switchDefinition: "\uE3C7", switchLanguage: "\uE413", tvMonitor: "\uE39D", themes: "\uE281", upChevron: "\uE0A0", usbDevice: "\uE377", video11: "\uE33E", sendToXbox: "\uE2AC", sendToXboxAdorner: "\uE2AD", sendToXboxAdornerAppbar: "\uE2B9", takeFromXbox: "\uE2AF", takeFromXboxAdorner: "\uE2B0", takeFromXboxAdornerAppbar: "\uE2B8", xbox: "\uE28C", xboxConnect: "\uE28D", xboxConnected: "\uE28E", xboxXenonLogo: "\uE3E3", videoCollection: "\uE2EA", joystickUp: "\uE2C2", joystickRight: "\uE2C3", joystickDown: "\uE2C4", joystickLeft: "\uE2C5", triggerRight: "\uE2C6", bumperRight: "\uE2C7", bumperLeft: "\uE2C8", triggerLeft: "\uE2C9", clear: "\uE2CA", webHub: "\uE2CB", swap: "\uE2CC", smartGlassGem: "\uE2B7", smartGlassConsole: "\uE2CD", smartGlassSlate: "\uE2CE", buttonBottomRight: "\uE2CF", buttonBottomLeft: "\uE2D0", buttonTopRight: "\uE2D1", buttonTopLeft: "\uE2D2", dpadLeft: "\uE2D3", dpadDown: "\uE2D4", dpadUp: "\uE2D5", dpadRight: "\uE2D6", fileFolder: "\uE3F5", keyboard: "\uE2D7", touchGuide: "\uE2D8", onscreenCursor: "\uE2D9", xenon: "\uE2DA", addTo: "\uE444", explore: "\uE42F", folder: "\uE188", help: "\uE405", mediaMusic: "\uE386", menuButton: "\uE3EC", moreActions: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE34B";
+ else
+ return WinJS.UI.AppBarIcon.more
+ }}, music: "\uE41A", nowPlaying: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE335";
+ else
+ return MS.Entertainment.UI.Icon.inlineNowPlaying
+ }}, pause: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE40C";
+ else
+ return "\uE103"
+ }}, play: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE40D";
+ else
+ return "\uE102"
+ }}, player: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE301";
+ else
+ return WinJS.UI.AppBarIcon.contact
+ }}, playerSignIn: "\uE2FC", playlistMusic: "\uE2E9", playlistImport: "\uE3CA", restart: "\uE3C0", toggleMenu: "\uE332", shuffleOn: "\uE3C9", store: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE3A0";
+ else
+ return WinJS.UI.AppBarIcon.shop
+ }}, refresh: "\uE3C3", "delete": {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE359";
+ else
+ return WinJS.UI.AppBarIcon.delete
+ }}, search: {get: function() {
+ if (MS.Entertainment.Utilities.isApp2)
+ return "\uE3F7";
+ else
+ return WinJS.UI.AppBarIcon.find
+ }}, volumeDisabled: "\uE2E6", watchlist: "\uE2E9", fixupIcons: function fixupIcons() {
+ if (WinJS.UI.AppBarIcon.previous.indexOf("ms") !== -1)
+ (function() {
+ delete WinJS.UI.AppBarIcon;
+ WinJS.Namespace.define("WinJS.UI.AppBarIcon", {
+ previous: "", next: "", play: "", pause: "", edit: "", save: "", clear: "", "delete": "", remove: "", add: "", cancel: "", accept: "", more: "", redo: "", undo: "", home: "", up: "", forward: "", right: "", back: "", left: "", favorite: "", camera: "", settings: "", video: "", sync: "", download: "", mail: "", find: "", help: "", upload: "", emoji: "", twopage: "", leavechat: "", mailforward: "", clock: "", send: "", crop: "", rotatecamera: "", people: "", closepane: "", openpane: "", world: "", flag: "", previewlink: "", globe: "", trim: "", attachcamera: "", zoomin: "", bookmarks: "", document: "", protecteddocument: "", page: "", bullets: "", comment: "", mail2: "", contactinfo: "", hangup: "", viewall: "", mappin: "", phone: "", videochat: "", "switch": "", contact: "", rename: "", pin: "", musicinfo: "", go: "", keyboard: "", dockleft: "", dockright: "", dockbottom: "", remote: "", refresh: "", rotate: "", shuffle: "", list: "", shop: "", selectall: "", orientation: "", "import": "", importall: "", browsephotos: "", webcam: "", pictures: "", savelocal: "", caption: "", stop: "", showresults: "", volume: "", repair: "", message: "", page2: "", calendarday: "", calendarweek: "", calendar: "", characters: "", mailreplyall: "", read: "", link: "", accounts: "", showbcc: "", hidebcc: "", cut: "", attach: "", paste: "", filter: "", copy: "", emoji2: "", important: "", mailreply: "", slideshow: "", sort: "", manage: "", allapps: "", disconnectdrive: "", mapdrive: "", newwindow: "", openwith: "", contactpresence: "", priority: "", uploadskydrive: "", gototoday: "", font: "", fontcolor: "", contact2: "", folder: "", audio: "", placeholder: "", view: "", setlockscreen: "", settile: "", cc: "", stopslideshow: "", permissions: "", highlight: "", disableupdates: "", unfavorite: "", unpin: "", openlocal: "", mute: "", italic: "", underline: "", bold: "", movetofolder: "", likedislike: "", dislike: "", like: "", alignright: "", aligncenter: "", alignleft: "", zoom: "", zoomout: "", openfile: "", otheruser: "", admin: "", street: "", map: "", clearselection: "", fontdecrease: "", fontincrease: "", fontsize: "", cellphone: "", reshare: "", tag: "", repeatone: "", repeatall: "", outlinestar: "", solidstar: "", calculator: "", directions: "", target: "", library: "", phonebook: "", memo: "", microphone: "", postupdate: "", backtowindow: "", fullscreen: "", newfolder: "", calendarreply: "", unsyncfolder: "", reporthacked: "", syncfolder: "", blockcontact: "", switchapps: "", addfriend: "", touchpointer: "", gotostart: "", zerobars: "", onebar: "", twobars: "", threebars: "", fourbars: ""
+ })
+ })()
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI", {FWLink: {
+ musicLibraries: "http://go.microsoft.com/fwlink/?LinkId=231829", videoLibraries: "http://go.microsoft.com/fwlink/?LinkId=267525", learnMore: "http://go.microsoft.com/fwlink/?LinkId=267489", cloudGrovelLearnMore: "http://go.microsoft.com/fwlink/?LinkId=280203", cloudGrovelPartialMatchLearnMore: "http://go.microsoft.com/fwlink/?LinkId=286257", cloudContentV2GetMoreInfo: "http://go.microsoft.com/fwlink/?LinkId=512463", advertisementReason: "http://go.microsoft.com/fwlink/?LinkID=282137", musicIntro: "http://go.microsoft.com/fwlink/?LinkID=285375"
+ }});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ _sounds: {
+ initialized: false, backButtonClick: null, disabledButtonClick: null, elementFocus1: null, elementFocus2: null, elementFocus3: null, elementFocus4: null, overlayIn: null, overlayOut: null, pageTransitionLeft: null, pageTransitionRight: null, selectButtonClick: null, selectButtonPressingKinect: null, virtualKeyboardFocus: null, virtualKeyboardSelect: null
+ }, initializeSounds: function initializeSounds() {
+ if (MS.Entertainment.Utilities.isApp2 && App2.SoundClips.Audio && !MS.Entertainment.Utilities._sounds.initialized) {
+ MS.Entertainment.Utilities._sounds.backButtonClick = App2.SoundClips.BackButtonClick;
+ MS.Entertainment.Utilities._sounds.disabledButtonClick = App2.SoundClips.DisabledButtonClick;
+ MS.Entertainment.Utilities._sounds.elementFocus1 = App2.SoundClips.ElementFocus1;
+ MS.Entertainment.Utilities._sounds.elementFocus2 = App2.SoundClips.ElementFocus2;
+ MS.Entertainment.Utilities._sounds.elementFocus3 = App2.SoundClips.ElementFocus3;
+ MS.Entertainment.Utilities._sounds.elementFocus4 = App2.SoundClips.ElementFocus4;
+ MS.Entertainment.Utilities._sounds.overlayIn = App2.SoundClips.OverlayIn;
+ MS.Entertainment.Utilities._sounds.overlayOut = App2.SoundClips.OverlayOut;
+ MS.Entertainment.Utilities._sounds.pageTransitionLeft = App2.SoundClips.PageTransitionLeft;
+ MS.Entertainment.Utilities._sounds.pageTransitionRight = App2.SoundClips.PageTransitionRight;
+ MS.Entertainment.Utilities._sounds.selectButtonClick = App2.SoundClips.SelectButtonClick;
+ MS.Entertainment.Utilities._sounds.initialized = true
+ }
+ }, playBackButtonClick: function playBackButtonClick() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.backButtonClick)
+ MS.Entertainment.Utilities._sounds.backButtonClick.play()
+ }, playDisabledButtonClick: function playDisabledButtonClick() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.disabledButtonClick)
+ MS.Entertainment.Utilities._sounds.disabledButtonClick.play()
+ }, playElementFocus1: function playElementFocus1() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus1)
+ MS.Entertainment.Utilities._sounds.elementFocus1.play()
+ }, playElementFocus2: function playElementFocus2() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus2)
+ MS.Entertainment.Utilities._sounds.elementFocus2.play()
+ }, playElementFocus3: function playElementFocus3() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus3)
+ MS.Entertainment.Utilities._sounds.elementFocus3.play()
+ }, playElementFocus4: function playElementFocus4() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.elementFocus4)
+ MS.Entertainment.Utilities._sounds.elementFocus4.play()
+ }, playOverlayIn: function playOverlayIn() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.overlayIn)
+ MS.Entertainment.Utilities._sounds.overlayIn.play()
+ }, playOverlayOut: function playOverlayOut() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.overlayOut)
+ MS.Entertainment.Utilities._sounds.overlayOut.play()
+ }, playPageTransitionLeft: function playPageTransitionLeft() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.pageTransitionLeft)
+ MS.Entertainment.Utilities._sounds.pageTransitionLeft.play()
+ }, playPageTransitionRight: function playPageTransitionRight() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.pageTransitionRight)
+ MS.Entertainment.Utilities._sounds.pageTransitionRight.play()
+ }, playSelectButtonClick: function playSelectButtonClick() {
+ MS.Entertainment.Utilities.initializeSounds();
+ if (MS.Entertainment.Utilities._sounds.selectButtonClick)
+ MS.Entertainment.Utilities._sounds.selectButtonClick.play()
+ }, playRandomFocusSound: function playRandomFocusSound() {
+ MS.Entertainment.Utilities.initializeSounds();
+ var indexOfFocusSoundToPlay = Math.ceil(Math.random() * 4);
+ switch (indexOfFocusSoundToPlay) {
+ case 1:
+ MS.Entertainment.Utilities.playElementFocus1();
+ break;
+ case 2:
+ MS.Entertainment.Utilities.playElementFocus2();
+ break;
+ case 3:
+ MS.Entertainment.Utilities.playElementFocus3();
+ break;
+ case 4:
+ MS.Entertainment.Utilities.playElementFocus4();
+ break;
+ default:
+ MS.Entertainment.Utilities.playElementFocus1();
+ break
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {stringify: function stringify(obj) {
+ try {
+ return JSON.stringify(obj)
+ }
+ catch(ex) {
+ return obj.toString()
+ }
+ }});
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {
+ MediaSubtypeIds: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return {
+ "00000016-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB32", "00000015-0000-0010-8000-00AA00389B71": "MFVideoFormat_ARGB32", "00000014-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB24", "00000018-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB555", "00000017-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB565", "00000029-0000-0010-8000-00AA00389B71": "MFVideoFormat_RGB8", "34344941-0000-0010-8000-00AA00389B71": "MFVideoFormat_AI44", "56555941-0000-0010-8000-00AA00389B71": "MFVideoFormat_AYUV", "32595559-0000-0010-8000-00AA00389B71": "MFVideoFormat_YUY2", "55595659-0000-0010-8000-00AA00389B71": "MFVideoFormat_YVYU", "39555659-0000-0010-8000-00AA00389B71": "MFVideoFormat_YVU9", "59565955-0000-0010-8000-00AA00389B71": "MFVideoFormat_UYVY", "3131564E-0000-0010-8000-00AA00389B71": "MFVideoFormat_NV11", "3231564E-0000-0010-8000-00AA00389B71": "MFVideoFormat_NV12", "32315659-0000-0010-8000-00AA00389B71": "MFVideoFormat_YV12", "30323449-0000-0010-8000-00AA00389B71": "MFVideoFormat_I420", "56555949-0000-0010-8000-00AA00389B71": "MFVideoFormat_IYUV", "30313259-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y210", "36313259-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y216", "30313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y410", "36313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y416", "50313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y41P", "54313459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y41T", "54323459-0000-0010-8000-00AA00389B71": "MFVideoFormat_Y42T", "30313250-0000-0010-8000-00AA00389B71": "MFVideoFormat_P210", "36313250-0000-0010-8000-00AA00389B71": "MFVideoFormat_P216", "30313050-0000-0010-8000-00AA00389B71": "MFVideoFormat_P010", "36313050-0000-0010-8000-00AA00389B71": "MFVideoFormat_P016", "30313276-0000-0010-8000-00AA00389B71": "MFVideoFormat_v210", "36313276-0000-0010-8000-00AA00389B71": "MFVideoFormat_v216", "30313476-0000-0010-8000-00AA00389B71": "MFVideoFormat_v410", "3334504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MP43", "5334504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MP4S", "3253344D-0000-0010-8000-00AA00389B71": "MFVideoFormat_M4S2", "5634504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MP4V", "31564D57-0000-0010-8000-00AA00389B71": "MFVideoFormat_WMV1", "32564D57-0000-0010-8000-00AA00389B71": "MFVideoFormat_WMV2", "33564D57-0000-0010-8000-00AA00389B71": "MFVideoFormat_WMV3", "31435657-0000-0010-8000-00AA00389B71": "MFVideoFormat_WVC1", "3153534D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MSS1", "3253534D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MSS2", "3147504D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MPG1", "6C737664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVSL", "64737664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVSD", "64687664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVHD", "35327664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DV25", "30357664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DV50", "31687664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVH1", "20637664-0000-0010-8000-00AA00389B71": "MFVideoFormat_DVC", "34363248-0000-0010-8000-00AA00389B71": "MFVideoFormat_H264", "47504A4D-0000-0010-8000-00AA00389B71": "MFVideoFormat_MJPG", "4F303234-0000-0010-8000-00AA00389B71": "MFVideoFormat_420O", "43564548-0000-0010-8000-00AA00389B71": "MFVideoFormat_HEVC", "53564548-0000-0010-8000-00AA00389B71": "MFVideoFormat_HEVC_ES", "33363248-0000-0010-8000-00AA00389B71": "MFVideoFormat_H263", "3F40F4F0-5622-4FF8-B6D8-A17A584BEE5E": "MFVideoFormat_H264_ES", "E06D8026-DB46-11CF-B4D1-00805F6CBBEA": "MFVideoFormat_MPEG2", "00000001-0000-0010-8000-00AA00389B71": "MFAudioFormat_PCM", "00000003-0000-0010-8000-00AA00389B71": "MFAudioFormat_Float", "00000008-0000-0010-8000-00AA00389B71": "MFAudioFormat_DTS", "00000092-0000-0010-8000-00AA00389B71": "MFAudioFormat_Dolby_AC3_SPDIF", "00000009-0000-0010-8000-00AA00389B71": "MFAudioFormat_DRM", "00000161-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMAudioV8", "00000162-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMAudioV9", "00000163-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMAudio_Lossless", "00000164-0000-0010-8000-00AA00389B71": "MFAudioFormat_WMASPDIF", "0000000A-0000-0010-8000-00AA00389B71": "MFAudioFormat_MSP1", "00000055-0000-0010-8000-00AA00389B71": "MFAudioFormat_MP3", "00000050-0000-0010-8000-00AA00389B71": "MFAudioFormat_MPEG", "00001610-0000-0010-8000-00AA00389B71": "MFAudioFormat_AAC", "00001600-0000-0010-8000-00AA00389B71": "MFAudioFormat_ADTS", "00007361-0000-0010-8000-00AA00389B71": "MFAudioFormat_AMR_NB", "00007362-0000-0010-8000-00AA00389B71": "MFAudioFormat_AMR_WB", "00007363-0000-0010-8000-00AA00389B71": "MFAudioFormat_AMR_WP", "E06D802C-DB46-11CF-B4D1-00805F6CBBEA": "MFAudioFormat_Dolby_AC3", "A7FB87AF-2D02-42FB-A4D4-05CD93843BDD": "MFAudioFormat_Dolby_DDPlus", "00000000-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_WAVEFORMATEX", "6DBA3190-67BD-11CF-A0F7-0020AFD156E4": "KSDATAFORMAT_SUBTYPE_ANALOG", "00000006-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_ALAW", "00000007-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_MULAW", "00000002-0000-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_ADPCM", "36523B21-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO", "36523B22-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO", "36523B23-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO", "36523B24-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO", "36523B25-8EE5-11D1-8CA3-0060B057664A": "KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO", "A0AF4F81-E163-11D0-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_DSS_VIDEO", "A0AF4F82-E163-11D0-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_DSS_AUDIO", "E436EB80-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_MPEG1Packet", "E436EB81-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_MPEG1Payload", "E436EB86-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_MPEG1Video", "E06D802B-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO", "E06D8032-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_LPCM_AUDIO", "00000003-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_MPEG1", "00000004-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_MPEG2", "00000005-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_MPEG3", "00000006-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_AAC", "00000008-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_ATRAC", "00000009-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_ONE_BIT_AUDIO", "0000000A-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_DIGITAL_PLUS", "0000000B-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DTS_HD", "0000000C-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DOLBY_MLP", "0000000D-0CEA-0010-8000-00AA00389B71": "KSDATAFORMAT_SUBTYPE_IEC61937_DST", "E06D8033-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_DTS_AUDIO", "E06D8034-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_SDDS_AUDIO", "E06D802D-DB46-11CF-B4D1-00805F6CBBEA": "KSDATAFORMAT_SUBTYPE_SUBPICTURE", "5A9B6A40-1A22-11D1-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_VPVideo", "5A9B6A41-1A22-11D1-BAD9-00609744111A": "KSDATAFORMAT_SUBTYPE_VPVBI", "19E4A5AA-5662-4FC5-A0C0-1758028E1057": "KSDATAFORMAT_SUBTYPE_JPEG", "CA20D9A0-3E3E-11D1-9BF9-00C04FBBDEBF": "KSDATAFORMAT_SUBTYPE_RAW8", "33214CC1-011F-11D2-B4B1-00A0D102CFBE": "KSDATAFORMAT_SUBTYPE_CC", "F72A76E2-EB0A-11D0-ACE4-0000C0CC16BA": "KSDATAFORMAT_SUBTYPE_NABTS", "F72A76E3-EB0A-11D0-ACE4-0000C0CC16BA": "KSDATAFORMAT_SUBTYPE_TELETEXT", "E757BCA1-39AC-11D1-A9F5-00C04FBBDE8F": "KSDATAFORMAT_SUBTYPE_NABTS_FEC", "E436EB7F-524F-11CE-9F53-0020AF0BA770": "KSDATAFORMAT_SUBTYPE_OVERLAY", "6E8D4A22-310C-11D0-B79A-00AA003767A7": "KSDATAFORMAT_SUBTYPE_Line21_BytePair", "6E8D4A23-310C-11D0-B79A-00AA003767A7": "KSDATAFORMAT_SUBTYPE_Line21_GOPPacket"
+ }
+ }), getMediaSubtypeNameFromGuid: function getMediaSubtypeNameFromGuid(guid) {
+ var subtypeName = String.empty;
+ if (guid) {
+ var trimmedGuid = MS.Entertainment.Utilities.trimGuid(guid).toUpperCase();
+ subtypeName = MS.Entertainment.Utilities.MediaSubtypeIds[trimmedGuid] || trimmedGuid || String.empty
+ }
+ return subtypeName
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {Iso639ThreeLetterToTwoLetterLanguageMap: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return {
+ aar: "aa", abk: "ab", afr: "af", aka: "ak", alb: "sq", amh: "am", ara: "ar", arg: "an", arm: "hy", asm: "as", ava: "av", ave: "ae", aym: "ay", aze: "az", bak: "ba", bam: "bm", baq: "eu", bel: "be", ben: "bn", bih: "bh", bis: "bi", bos: "bs", bre: "br", bul: "bg", bur: "my", cat: "ca", cha: "ch", che: "ce", chi: "zh", chu: "cu", chv: "cv", cor: "kw", cos: "co", cre: "cr", cze: "cs", dan: "da", div: "dv", dut: "nl", dzo: "dz", eng: "en", epo: "eo", est: "et", ewe: "ee", fao: "fo", fij: "fj", fin: "fi", fre: "fr", fry: "fy", ful: "ff", geo: "ka", ger: "de", gla: "gd", gle: "ga", glg: "gl", glv: "gv", gre: "el", grn: "gn", guj: "gu", hat: "ht", hau: "ha", heb: "he", her: "hz", hin: "hi", hmo: "ho", hrv: "hr", hun: "hu", ibo: "ig", ice: "is", ido: "io", iii: "ii", iku: "iu", ile: "ie", ina: "ia", ind: "id", ipk: "ik", ita: "it", jav: "jv", jpn: "ja", kal: "kl", kan: "kn", kas: "ks", kau: "kr", kaz: "kk", khm: "km", kik: "ki", kin: "rw", kir: "ky", kom: "kv", kon: "kg", kor: "ko", kua: "kj", kur: "ku", lao: "lo", lat: "la", lav: "lv", lim: "li", lin: "ln", lit: "lt", ltz: "lb", lub: "lu", lug: "lg", mac: "mk", mah: "mh", mal: "ml", mao: "mi", mar: "mr", may: "ms", mlg: "mg", mlt: "mt", mon: "mn", nau: "na", nav: "nv", nbl: "nr", nde: "nd", ndo: "ng", nep: "ne", nno: "nn", nob: "nb", nor: "no", nya: "ny", oci: "oc", oji: "oj", ori: "or", orm: "om", oss: "os", pan: "pa", per: "fa", pli: "pi", pol: "pl", por: "pt", pus: "ps", que: "qu", roh: "rm", rum: "ro", run: "rn", rus: "ru", sag: "sg", san: "sa", sin: "si", slo: "sk", slv: "sl", sme: "se", smo: "sm", sna: "sn", snd: "sd", som: "so", sot: "st", spa: "es", srd: "sc", srp: "sr", ssw: "ss", sun: "su", swa: "sw", swe: "sv", tah: "ty", tam: "ta", tat: "tt", tel: "te", tgk: "tg", tgl: "tl", tha: "th", tib: "bo", tir: "ti", ton: "to", tsn: "tn", tso: "ts", tuk: "tk", tur: "tr", twi: "tw", uig: "ug", ukr: "uk", urd: "ur", uzb: "uz", ven: "ve", vie: "vi", vol: "vo", wel: "cy", wln: "wa", wol: "wo", xho: "xh", yid: "yi", yor: "yo", zha: "za", zul: "zu"
+ }
+ })})
+})()
+})();
+/* >>>>>>/framework/servicelocator.js:13086 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Services");
+ var ServiceEntry = WinJS.Class.define(function(factory, isCritical) {
+ this._factory = factory;
+ this.isCritical = isCritical
+ }, {
+ isCritical: false, _factory: null, _cache: null, service: function service() {
+ if (!this._cache)
+ this._cache = this._factory();
+ return this._cache
+ }, reset: function reset() {
+ if (this._cache && this._cache.dispose)
+ this._cache.dispose();
+ this._cache = null
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment", {ServiceLocator: MS.Entertainment.UI.Framework.define(function() {
+ throw"ServiceLocator contains only static methods.";
+ }, {}, {
+ _serviceTable: {}, _validateIdentifierOrThrow: function _validateIdentifierOrThrow(candidateIdentifier) {
+ if (!MS.Entertainment.Services.hasOwnProperty(candidateIdentifier))
+ throw"Unknown service identifier passed into Service Locator: " + candidateIdentifier;
+ }, getService: function getService(identifier) {
+ var serviceTable = this._serviceTable;
+ var serviceEntry = null;
+ this._validateIdentifierOrThrow(identifier);
+ if (!serviceTable.hasOwnProperty(identifier)) {
+ MS.Entertainment.Services.fail("Attempt to retrieve a service that has not been registered: " + identifier);
+ return null
+ }
+ serviceEntry = serviceTable[identifier];
+ return serviceEntry.service()
+ }, isServiceRegistered: function isServiceRegistered(identifier) {
+ return !!this._serviceTable.hasOwnProperty(identifier)
+ }, register: function register(identifier, factory, isCritical) {
+ var serviceTable = this._serviceTable;
+ this._validateIdentifierOrThrow(identifier);
+ if (serviceTable.hasOwnProperty(identifier))
+ throw"Attempt to register a second service for an already registered service identifier: " + identifier;
+ if (typeof factory !== "function")
+ throw"Attempt to register something besides a function as a service factory: " + identifier;
+ serviceTable[identifier] = new ServiceEntry(factory, isCritical)
+ }, unregister: function unregister(identifier) {
+ var serviceEntry;
+ var serviceTable = this._serviceTable;
+ this._validateIdentifierOrThrow(identifier);
+ serviceEntry = serviceTable[identifier];
+ if (serviceEntry)
+ serviceEntry.reset();
+ delete serviceTable[identifier]
+ }, cleanupNonCriticalServices: function cleanupNonCriticalServices() {
+ var serviceTable = this._serviceTable;
+ for (var id in serviceTable) {
+ if (serviceTable[id].isCritical)
+ continue;
+ serviceTable[id].reset()
+ }
+ }, getTestHooks: function getTestHooks() {
+ var that = this;
+ var testHooks = null;
+ testHooks = {getServiceTable: function getServiceTable() {
+ return that._serviceTable
+ }};
+ return testHooks
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Services", {
+ actions: "actions", adService: "adService", anonymousFreePlay: "anonymousFreePlay", appNotification: "appNotification", appToolbar: "appToolbar", applicationStateManager: "applicationStateManager", assetDetails: "assetDetails", backButton: "backButton", bookmarkOperationsWatcher: "bookmarkOperationsWatcher", contentRestrictionService: "contentRestrictionService", contentRestrictionStateHandler: "contentRestrictionStateHandler", cloudCollection: "cloudCollection", cloudRestrictionCollection: "cloudRestrictionCollection", collectionChangeNotifier: "collectionChangeNotifier", contextualCommandService: "contextualCommandService", dashboardRefresher: "dashboardRefresher", dateTimeFormatters: "dateTimeFormatters", deviceGroupService: "deviceGroupService", dragData: "dragData", featureEnablement: "featureEnablement", findFriends: "findFriends", fileTransfer: "fileTransfer", fileTransferNotifications: "fileTransferNotifications", freePlayLimits: "freePlayLimits", gamesPurchaseHistory: "gamesPurchaseHistory", graceNoteService: "graceNoteService", idleApplicationService: "idleApplicationService", informationArchitecture: "informationArchitecture", interactionNotifier: "interactionNotifier", knownFolders: "knownFolders", listNotification: "listNotification", marketplace: "marketplace", mediaStore: "mediaStore", musicStateHandler: "musicStateHandler", navigation: "navigation", networkStatus: "networkStatus", nowPlayingControlManager: "nowPlayingControlManager", nowPlayingViewModel: "nowPlayingViewModel", mediaDeleted: "mediaDeleted", pinnedList: "pinnedList", pinToStartScreen: "pinToStartScreen", pinToStartScreenInterop: "pinToStartScreenInterop", playbackErrorDisplayService: "playbackErrorDisplayService", playbackEventNotifications: "playbackEventNotifications", playlists: "playlists", playToReceiverNativeService: "playToReceiverNativeService", progressNotification: "progressNotification", purchaseFlowProvider: "purchaseFlowProvider", purchaseHistory: "purchaseHistory", richPresence: "richPresence", readingCloudCollection: "readingCloudCollection", sessionManager: "sessionManager", searchResultCounts: "searchResultCounts", shareDecoder: "shareDecoder", shareEncoder: "shareEncoder", shareHost: "shareHost", shareSender: "shareSender", shareTarget: "shareTarget", shortcutManager: "shortcutManager", signedInUser: "signedInUser", signIn: "signIn", smartDJList: "smartDJList", syncManager: "syncManager", systemMTCMetadataUpdater: "systemMTCMetadataUpdater", tileManager: "tileManager", trackRestrictionCollection: "trackRestrictionCollection", typeToSearch: "typeToSearch", uiState: "uiState", upgradeReminderDisplayer: "upgradeReminderDisplayer", userEngagementService: "userEngagementService", userLibraryManager: "userLibraryManager", userTimeTelemetryManager: "userTimeTelemetryManager", userUsageData: "userUsageData", videoCloudCollection: "videoCloudCollection", videoDetailsUiState: "videoDetailsUiState", volumeService: "volumeService", watchlistService: "watchlistService", welcomeDialogService: "welcomeDialogService", winJSNavigation: "winJSNavigation", xboxLive: "xboxLive", xhr: "xhr"
+ })
+})()
+})();
+/* >>>>>>/framework/featureenablementservice.js:13162 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Framework) {
+ var FeatureEnablement = (function() {
+ function FeatureEnablement(){}
+ FeatureEnablement.prototype.isEnabled = function(featureItem) {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ return featureEnablement.isEnabled(featureItem)
+ };
+ FeatureEnablement.prototype.areAllFeaturesEnabled = function(featureItems) {
+ if (!featureItems)
+ return false;
+ var featuresEnabled = true;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ for (var i = 0; i < featureItems.length; i++) {
+ featuresEnabled = featureEnablement.isEnabled(featureItems[i]);
+ if (!featuresEnabled)
+ break
+ }
+ return featuresEnabled
+ };
+ return FeatureEnablement
+ })();
+ Framework.FeatureEnablement = FeatureEnablement;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.featureEnablement, function FeatureEnablementFactory() {
+ return new MS.Entertainment.UI.Framework.FeatureEnablement
+ })
+ })(UI.Framework || (UI.Framework = {}));
+ var Framework = UI.Framework
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/telemetryutilities.js:13203 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Utilities");
+ WinJS.Namespace.define("MS.Entertainment.Utilities.Telemetry", {
+ _adsClicked: [], _previewsPlayed: [], _enableLogging: false, _totalTimeCounterStart: 0, _somethingPlaying: false, _lastBufferedEvent: {}, openDataPoint: function openDataPoint() {
+ var platLog = Microsoft.Entertainment.Platform.Logging;
+ var dataPoint = new platLog.DataPoint(platLog.LoggingLevel.telemetry);
+ if (MS.Entertainment.Utilities.Telemetry._enableLogging && WebUnitExtensions.TelemetryDataPointWrapper)
+ dataPoint = new WebUnitExtensions.TelemetryDataPointWrapper(dataPoint);
+ return dataPoint
+ }, openKeystoneDataPoint: function openKeystoneDataPoint() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.keystone);
+ dataPoint.appendParameter(this.KeystoneParameterNames.Mode, this._getScreenMode());
+ return dataPoint
+ }, closeDataPoint: function closeDataPoint(dataPoint) {
+ if (MS.Entertainment.UI.Application && MS.Entertainment.UI.Application.Helpers && MS.Entertainment.UI.Application.Helpers.activationTelemetryData)
+ MS.Entertainment.UI.Application.Helpers.activationTelemetryData.push(dataPoint);
+ else
+ dataPoint.write()
+ }, appendUIPath: function appendUIPath(dataPoint) {
+ var currentLocation = MS.Entertainment.Utilities.getCurrentUserLocation();
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPath, currentLocation)
+ }, appendLastUIPath: function appendLastUIPath(dataPoint) {
+ var service = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (service.canNavigateBack) {
+ var backStack = service._backStack;
+ var lastPage = backStack._stack[backStack._stack.length - 1];
+ var lastLocation = "None";
+ if (lastPage)
+ lastLocation = lastPage.page.iaNode.moniker;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.LastUIPath, lastLocation)
+ }
+ }, isCurrentPageSearchPage: function isCurrentPageSearchPage() {
+ var currentPage;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation))
+ currentPage = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation).currentPage;
+ if (currentPage && currentPage.overrideFragmentUrl)
+ if (MS.Entertainment.Utilities.isMusicApp || MS.Entertainment.Utilities.isVideoApp)
+ return currentPage.iaNode && currentPage.iaNode.moniker === MS.Entertainment.UI.Monikers.searchPage;
+ else
+ return currentPage.overrideFragmentUrl.match(/SearchNavStub.html$/i);
+ return false
+ }, _getScreenMode: function _getScreenMode() {
+ var currentMode = "Unknown";
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService)
+ if (uiStateService.isSnapped)
+ currentMode = "ViewSnapped";
+ else if (uiStateService.isFilled)
+ currentMode = "ViewFilled";
+ else
+ currentMode = "ViewFullscreen";
+ return currentMode
+ }, _anonymousUserId: null, _getUserIdValue: function _getUserIdValue() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).xuid;
+ else {
+ if (!this._anonymousUserId)
+ this._anonymousUserId = Microsoft.Entertainment.Marketplace.Marketplace.generateGuid();
+ return this._anonymousUserId
+ }
+ }, _getUsersValue: function _getUsersValue() {
+ var userId;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ userId = "x:" + MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).xuid;
+ else {
+ if (!this._anonymousUserId)
+ this._anonymousUserId = Microsoft.Entertainment.Marketplace.Marketplace.generateGuid();
+ userId = "a:" + this._anonymousUserId
+ }
+ return userId
+ }, _keystoneStarted: false, ensureKeystoneStarted: function ensureKeystoneStarted() {
+ if (!MS.Entertainment.Utilities.isVideoApp2 || this._keystoneStarted)
+ return;
+ this._keystoneStarted = true;
+ this.startKeystoneHeartbeat()
+ }, _keystoneHeartbeatTimerId: undefined, startKeystoneHeartbeat: function startKeystoneHeartbeat() {
+ if (MS.Entertainment.Utilities.isVideoApp2 && !this._keystoneHeartbeatTimerId) {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var heartbeatInterval = isNaN(config.telemetry.keystoneHeartbeatInterval) ? 30 * 1000 : config.telemetry.keystoneHeartbeatInterval;
+ this._keystoneHeartbeatTimerId = setInterval(function() {
+ MS.Entertainment.Utilities.Telemetry.logKeystoneEvent(MS.Entertainment.Utilities.Telemetry.KeystoneEvents.AppHeartbeat)
+ }, heartbeatInterval)
+ }
+ }, priceFromOffer: function priceFromOffer(media, offer) {
+ var price = String.empty;
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.album || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.track)
+ if (offer && offer.price)
+ price = offer.price + " " + offer.priceCurrencyCode;
+ return price
+ }, mediaTypeNameForTelemetry: function mediaTypeNameForTelemetry(media) {
+ var name;
+ var mediaType = media && media.mediaType;
+ var defaultPlatformType = (media && media.defaultPlatformType) || String.empty;
+ var downloadType = media && media.downloadType;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (media.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo)
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicVideo;
+ else if (media.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.TVEpisode;
+ else
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Movie;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.TVSeries;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.TVSeason;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Artist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Album;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Song;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.playlist:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Playlist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.game:
+ if (defaultPlatformType)
+ name = defaultPlatformType + " " + MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Game;
+ else
+ name = downloadType || MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Game;
+ break;
+ default:
+ name = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ break
+ }
+ return name
+ }, internalLogTelemetryEvent: function internalLogTelemetryEvent(dataPoint, event)
+ {
+ dataPoint.appendEventName(event);
+ for (var i = 2; i < arguments.length - 1; i += 2) {
+ var key = arguments[i];
+ var value = arguments[i + 1];
+ if (key && value !== undefined)
+ dataPoint.appendParameter(key, value)
+ }
+ this.closeDataPoint(dataPoint)
+ }, logTelemetryEvent: function logTelemetryEvent(event) {
+ var dataPoint = this.openDataPoint();
+ var args = Array.prototype.slice.call(arguments);
+ args.unshift(dataPoint);
+ this.internalLogTelemetryEvent.apply(this, args)
+ }, logKeystoneEvent: function(event) {
+ if (!MS.Entertainment.Utilities.isVideoApp2)
+ return;
+ var dataPoint = this.openKeystoneDataPoint();
+ var args = Array.prototype.slice.call(arguments);
+ args.unshift(dataPoint);
+ this.internalLogTelemetryEvent.apply(this, args)
+ }, logTelemetryEventWithParameterArray: function logTelemetryEventWithParameterArray(event, parameterArray) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(event);
+ for (var i = 0; i < parameterArray.length; i++)
+ if (parameterArray[i].parameterName && parameterArray[i].parameterValue !== undefined && parameterArray[i].parameterValue !== null)
+ dataPoint.appendParameter(parameterArray[i].parameterName, parameterArray[i].parameterValue);
+ else
+ MS.Entertainment.Utilities.fail("logTelemetryEventWithParameterArray called with invalid parameterArray element. Event: " + event);
+ this.closeDataPoint(dataPoint)
+ }, logTelemetryEventWithUIPath: function logTelemetryEventWithUIPath(event, parameterArray) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(event);
+ this.appendUIPath(dataPoint);
+ if (parameterArray)
+ for (var i = 0; i < parameterArray.length; i++)
+ if (parameterArray[i].parameterName && parameterArray[i].parameterValue !== undefined && parameterArray[i].parameterValue !== null)
+ dataPoint.appendParameter(parameterArray[i].parameterName, parameterArray[i].parameterValue);
+ else
+ MS.Entertainment.Utilities.fail("logTelemetryEventWithUIPath called with invalid parameterArray element. Event: " + event);
+ this.closeDataPoint(dataPoint)
+ }, logSearchEnter: function logSearchEnter(media) {
+ var Queries = Microsoft.Entertainment.Queries;
+ if (!media || (media.videoType !== Queries.VideoType.movie && media.mediaType !== Queries.ObjectType.tvSeries && media.mediaType !== Queries.ObjectType.person && media.mediaType !== Queries.ObjectType.album && media.mediaType !== Queries.ObjectType.track))
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchEnter);
+ this.appendUIPath(dataPoint);
+ this.appendLastUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EDSSearch, true);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ var mediaName = media.name || String.empty;
+ var bingId = media.canonicalId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var zuneId = media.zuneId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var impressionGuid = media.impressionGuid || MS.Entertainment.Utilities.EMPTY_GUID;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SearchImpressionGuid, impressionGuid);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, mediaName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, bingId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, zuneId);
+ this.closeDataPoint(dataPoint)
+ }, logSearchExit: function logSearchExit(media) {
+ var Queries = Microsoft.Entertainment.Queries;
+ if (!media || (media.videoType !== Queries.VideoType.movie && media.mediaType !== Queries.ObjectType.tvSeries && media.mediaType !== Queries.ObjectType.person && media.mediaType !== Queries.ObjectType.album && media.mediaType !== Queries.ObjectType.track))
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchExit);
+ this.appendUIPath(dataPoint);
+ this.appendLastUIPath(dataPoint);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ var mediaName = media.name || String.empty;
+ var bingId = media.canonicalId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var zuneId = media.zuneId || MS.Entertainment.Utilities.EMPTY_GUID;
+ var inCollection = media.inCollection || false;
+ var impressionGuid = media.impressionGuid || MS.Entertainment.Utilities.EMPTY_GUID;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SearchImpressionGuid, impressionGuid);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, mediaName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, bingId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, zuneId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.InCollection, inCollection);
+ this.closeDataPoint(dataPoint)
+ }, logSearchWordWheelEnter: function logSearchWordWheel(title, mediaType, videoType) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SearchWordWheelEnter);
+ this.appendUIPath(dataPoint);
+ this.appendLastUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SelectedItemTitle, title);
+ var typeName = MS.Entertainment.Utilities.getMediaTypeName(mediaType, videoType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SelectedItemMediaType, typeName);
+ this.closeDataPoint(dataPoint)
+ }, logPlayPreview: function logPlayPreview(media, fromAd) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PreviewPlayed);
+ this.appendUIPath(dataPoint);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.FromAd, fromAd);
+ if (fromAd)
+ this._adsClicked.push(media.serviceId);
+ this._previewsPlayed.push(media.serviceId);
+ this.closeDataPoint(dataPoint)
+ }, logSubscriptionSignupPrePurchase: function logSubscriptionSignupPrePurchase(subscription) {
+ if (!subscription)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SubscriptionSignupPrePurchase);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OfferId, subscription.offerId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Title, subscription.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Price, subscription.price);
+ this.closeDataPoint(dataPoint)
+ }, logSubscriptionSignupPurchaseMade: function logSubscriptionSignupPurchaseMade(subscription) {
+ if (!subscription)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SubscriptionSignupPurchaseMade);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OfferId, subscription.offerId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Title, subscription.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Price, subscription.price);
+ this.closeDataPoint(dataPoint)
+ }, logPurchaseMade: function logPurchaseMade(media, offer) {
+ this.logPurchaseHappened(media, offer);
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PurchaseMade);
+ this.appendUIPath(dataPoint);
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.seriesTitle + " " + media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProductGuid, media.seasonServiceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.seasonServiceId))
+ }
+ else {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProductGuid, media.serviceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.serviceId))
+ }
+ var price = this.priceFromOffer(media, offer);
+ if (price)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Price, price);
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason) {
+ var licenseRight = offer.licenseRight;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.licenseRight, licenseRight)
+ }
+ if (MS.Entertainment.Utilities.isVideoApp1) {
+ var videoPostRollABTestName = MS.Entertainment.ViewModels.VideoPostRollHelpers.abTestName;
+ var videoPostRollABGroupName = MS.Entertainment.ViewModels.VideoPostRollHelpers.abGroupName;
+ if (videoPostRollABTestName && videoPostRollABGroupName) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABTestName, videoPostRollABTestName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABGroupName, videoPostRollABGroupName)
+ }
+ }
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.deepLinkSource) {
+ dataPoint.appendParameter("DeepLinkSource", uiStateService.deepLinkSource);
+ dataPoint.appendParameter("DeepLinkSourceID", uiStateService.deepLinkSourceID);
+ var secondsSinceLaunch = (Date.now() - uiStateService.deepLinkLaunchTime) / 1000;
+ dataPoint.appendParameter("DeepLinkSecondsSinceLaunch", secondsSinceLaunch)
+ }
+ var fromAd = false;
+ var fromPreview = false;
+ var i;
+ for (i = 0; i < this._adsClicked.length; i++)
+ if (this._adsClicked[i] === media.serviceId) {
+ fromAd = true;
+ break
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.FromAd, fromAd);
+ for (i = 0; i < this._previewsPlayed.length; i++)
+ if (this._previewsPlayed[i] === media.serviceId) {
+ fromPreview = true;
+ break
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.FromPreview, fromPreview);
+ this.closeDataPoint(dataPoint)
+ }, logVideoPurchaseAttempt: function logVideoPurchaseAttempt(media, offer, purchaseState) {
+ if (!media || !offer)
+ return;
+ this.logKeystoneVideoPurchase(media, offer, purchaseState);
+ if (!purchaseState || purchaseState === this.PurchaseStates.Succeeded)
+ this.logPurchaseMade(media, offer)
+ }, logKeystoneVideoPurchase: function logKeystoneVideoPurchase(media, offer, purchaseState) {
+ if (!media || !offer)
+ return;
+ var ObjectType = Microsoft.Entertainment.Queries.ObjectType;
+ var ServiceLocator = MS.Entertainment.ServiceLocator;
+ var Services = MS.Entertainment.Services;
+ var telemetryParams = [this.KeystoneEvents.Purchase];
+ var offerId = offer.offerId;
+ if (offerId)
+ telemetryParams.push(this.KeystoneParameterNames.OfferId, offerId);
+ var mediaType = media.mediaType;
+ var mediaTypeName = this.mediaTypeNameForTelemetry(media);
+ telemetryParams.push(this.KeystoneParameterNames.MediaType, mediaTypeName);
+ var mediaName,
+ mediaId;
+ if (mediaType === ObjectType.tvSeason) {
+ mediaName = media.seriesTitle + " " + media.name;
+ mediaId = media.seasonServiceId
+ }
+ else {
+ mediaName = media.name;
+ mediaId = media.serviceId
+ }
+ telemetryParams.push(this.KeystoneParameterNames.MediaName, mediaName);
+ var correlationId = MS.Entertainment.Utilities.Telemetry.getCorrelationId(mediaId);
+ if (correlationId)
+ telemetryParams.push(this.KeystoneParameterNames.CorrelationId, correlationId);
+ var price = this.priceFromOffer(media, offer);
+ if (price)
+ telemetryParams.push(this.KeystoneParameterNames.Price, price);
+ if (mediaType === ObjectType.video || mediaType === ObjectType.tvSeason) {
+ var rightsTelemetryParams = this._getKeystoneVideoRightsTelemetry(media, mediaType, offer);
+ if (rightsTelemetryParams && Array.isArray(rightsTelemetryParams))
+ telemetryParams = telemetryParams.concat(rightsTelemetryParams)
+ }
+ var bingId = media.canonicalId;
+ if (bingId && !MS.Entertainment.Utilities.isEmptyGuid(bingId))
+ telemetryParams.push(this.KeystoneParameterNames.BingId, bingId);
+ var zuneId = media.zuneId;
+ if (zuneId && !MS.Entertainment.Utilities.isEmptyGuid(zuneId))
+ telemetryParams.push(this.KeystoneParameterNames.ZuneId, zuneId);
+ if (ServiceLocator.isServiceRegistered(Services.signedInUser)) {
+ var signedInUserService = ServiceLocator.getService(Services.signedInUser);
+ var locale = signedInUserService.locale;
+ if (locale)
+ telemetryParams.push(this.KeystoneParameterNames.Locale, locale)
+ }
+ if (ServiceLocator.isServiceRegistered(Services.navigation)) {
+ var navigationService = ServiceLocator.getService(Services.navigation);
+ var pageMonikers = navigationService.getBackStackPageMonikers();
+ var currentPageMoniker = WinJS.Utilities.getMember("currentPage.iaNode.moniker", navigationService);
+ if (currentPageMoniker)
+ pageMonikers.push(currentPageMoniker);
+ var uiPath;
+ if (pageMonikers && Array.isArray(pageMonikers))
+ uiPath = pageMonikers.reduce(function(prev, curr) {
+ return prev + " / " + curr
+ });
+ if (uiPath)
+ telemetryParams.push(this.KeystoneParameterNames.UiPath, uiPath)
+ }
+ telemetryParams.push(this.KeystoneParameterNames.State, purchaseState);
+ this.logKeystoneEvent.apply(this, telemetryParams)
+ }, _getKeystoneVideoRightsTelemetry: function _getKeystoneVideoRightsTelemetry(media, mediaType, offer) {
+ var ObjectType = Microsoft.Entertainment.Queries.ObjectType;
+ var MarketplaceRight = MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight;
+ var telemetryParams = [];
+ if (mediaType === ObjectType.video) {
+ var mediaInstanceId = offer.mediaInstanceId;
+ if (mediaInstanceId)
+ telemetryParams.push(this.KeystoneParameterNames.MediaInstanceId, mediaInstanceId);
+ var videoDefinition = offer.videoDefinition;
+ if (videoDefinition)
+ telemetryParams.push(this.KeystoneParameterNames.VideoDefinition, videoDefinition);
+ var videoCodec = offer.videoEncoding;
+ if (videoCodec)
+ telemetryParams.push(this.KeystoneParameterNames.VideoCodec, videoCodec);
+ var audioLanguage = offer.primaryAudioLanguage;
+ if (audioLanguage)
+ telemetryParams.push(this.KeystoneParameterNames.AudioLanguage, audioLanguage);
+ var audioEncoding = offer.encoding;
+ if (audioEncoding)
+ telemetryParams.push(this.KeystoneParameterNames.AudioEncoding, audioEncoding);
+ var videoFileUrl = offer.videoFileUrl;
+ if (videoFileUrl)
+ telemetryParams.push(this.KeystoneParameterNames.VideoFileUrl, videoFileUrl);
+ var hasCaptions = media.hasCaptions;
+ telemetryParams.push(this.KeystoneParameterNames.HasCaptions, hasCaptions)
+ }
+ var deliveryFormat = offer.deliveryFormat;
+ if (deliveryFormat)
+ telemetryParams.push(this.KeystoneParameterNames.DeliveryFormat, deliveryFormat);
+ var paymentInstruments = offer.paymentInstruments;
+ var paymentInstrumentsString;
+ if (Array.isArray(paymentInstruments))
+ paymentInstrumentsString = paymentInstruments.join(", ");
+ else if (String.isString(paymentInstruments))
+ paymentInstrumentsString = paymentInstruments;
+ if (paymentInstrumentsString)
+ telemetryParams.push(this.KeystoneParameterNames.PaymentInstruments, paymentInstrumentsString);
+ var licenseRight = offer.licenseRight;
+ if (licenseRight) {
+ var acquisitionType;
+ if (licenseRight === MarketplaceRight.Rent || licenseRight === MarketplaceRight.RentStream)
+ acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Rental;
+ else
+ acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Purchase;
+ telemetryParams.push(this.KeystoneParameterNames.AcquisitionType, acquisitionType)
+ }
+ return telemetryParams
+ }, logShare: function logShare(sharePackage) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ShareCharm);
+ if (sharePackage && sharePackage.package) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ShareTitle, sharePackage.package.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ShareUri, sharePackage.package.uri);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaId, sharePackage.package.mediaId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, this.mediaTypeNameForTelemetry(sharePackage.package));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, sharePackage.package.mediaTitle)
+ }
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logAdClicked: function logAdClicked(adInfo) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.X8AdClicked);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AdInfo, adInfo);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, _logPlaybackControl: function _logPlaybackControl(controlUsed, whereUsed) {
+ var dataPoint = this.openDataPoint();
+ this.appendUIPath(dataPoint);
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackControl);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ControlUsed, controlUsed);
+ var whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown;
+ if (whereUsed.indexOf("nowPlayingTransportControls") !== -1 || whereUsed.indexOf("fullScreenNowPlaying-transportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.NowPlaying;
+ else if (whereUsed.indexOf("globalTransportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.GlobalAppbar;
+ else if (whereUsed.indexOf("appBarTransportControls") !== -1 || whereUsed.indexOf("appMenuHeader") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.AppBar;
+ else if (whereUsed.indexOf("homeHubNowPlayingTile") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.HomeNPTile;
+ else if (whereUsed.indexOf("snappedTransportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.SnappedAppBar;
+ else if (whereUsed.indexOf("mediaKey") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MediaKey;
+ else if (whereUsed.indexOf("voiceCommand") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.VoiceCommand;
+ else if (whereUsed.indexOf("controls-") !== -1 || whereUsed.indexOf("adControls-") !== -1 || whereUsed.indexOf("currentItem-") !== -1 || whereUsed.indexOf("commonOverlays-transportControls") !== -1)
+ whereUsedMapped = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicTransportControls;
+ else
+ MS.Entertainment.Utilities.assert(false, "unrecognised location for playback control telemetry");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.WhereUsed, whereUsedMapped);
+ this.closeDataPoint(dataPoint)
+ }, logPlayClicked: function logPlayClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Play, whereUsed)
+ }, logPauseClicked: function logPauseClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Pause, whereUsed)
+ }, logStopClicked: function logStopClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Stop, whereUsed)
+ }, logPreviousClicked: function logPreviousClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Previous, whereUsed)
+ }, logNextClicked: function logNextClicked(whereUsed) {
+ this._logPlaybackControl(MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Next, whereUsed)
+ }, logPlaybackAttempted: function logPlaybackAttempted(mediaInstance) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackAttempted);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, this._getNetworkStatus());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OSVersion, this._getOSVersion());
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logGetPreferredStreamSucceeded: function logGetPreferredStreamSucceeded(retries) {
+ this.logGetPreferredStreamResult(true, null, retries)
+ }, logGetPreferredStreamFailed: function logGetPreferredStreamFailed(reason, retries) {
+ this.logGetPreferredStreamResult(false, reason, retries)
+ }, logGetPreferredStreamResult: function logGetPreferredStreamResult(success, reason, retries) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.GetPreferredStreamResult);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Success, success);
+ if (reason)
+ if (reason.number)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Reason, reason.number);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Reason, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Reason, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Retries, retries ? retries : 0);
+ this.closeDataPoint(dataPoint)
+ }, logSemanticZoom: function logSemanticZoom(initMethod) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SemanticZoom);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MethodInitiated, initMethod);
+ this.closeDataPoint(dataPoint)
+ }, logVolumeSelected: function logVolumeSelected(value) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.VolumeSelected);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VolumeValue, value);
+ this.closeDataPoint(dataPoint)
+ }, logMuteStateSelected: function logMuteStateSelected(state) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MuteStateSelected);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MuteState, state);
+ this.closeDataPoint(dataPoint)
+ }, _correlationIds: {}, getCorrelationId: function getCorrelationId(serviceId) {
+ var correlationId = String.empty;
+ if (!MS.Entertainment.Utilities.isEmptyGuid(serviceId))
+ correlationId = MS.Entertainment.Utilities.Telemetry._correlationIds[serviceId] || String.empty;
+ return correlationId
+ }, setCorrelationId: function setCorrelationId(serviceId) {
+ if (!MS.Entertainment.Utilities.isEmptyGuid(serviceId))
+ MS.Entertainment.Utilities.Telemetry._correlationIds[serviceId] = Microsoft.Entertainment.Marketplace.Marketplace.generateGuid()
+ }, findCorrelationIdForMediaItem: function findCorrelationIdForMediaItem(mediaItem) {
+ var correlationId;
+ if (mediaItem) {
+ var possibleServiceIds = [mediaItem.serviceId, mediaItem.zuneId, mediaItem.canonicalId];
+ var mediaIsTVContent = MS.Entertainment.Utilities.isAnyTV(mediaItem);
+ if (mediaIsTVContent) {
+ possibleServiceIds.push(mediaItem.seriesId);
+ possibleServiceIds.push(mediaItem.seriesZuneId);
+ possibleServiceIds.push(mediaItem.seriesServiceId);
+ possibleServiceIds.push(mediaItem.canonicalSeriesId);
+ possibleServiceIds.push(mediaItem.seasonServiceId);
+ possibleServiceIds.push(mediaItem.canonicalSeasonId);
+ possibleServiceIds.push(mediaItem.seasonZuneId)
+ }
+ for (var i = 0; i < possibleServiceIds.length; i++) {
+ correlationId = MS.Entertainment.Utilities.Telemetry.getCorrelationId(possibleServiceIds[i]);
+ if (correlationId && MS.Entertainment.Utilities.isValidServiceId(correlationId))
+ break
+ }
+ }
+ return correlationId
+ }, getParentProductGuid: function getParentProductGuid(mediaItem) {
+ var parentProductId = String.empty;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVSeason(mediaItem))
+ parentProductId = mediaItem.seriesId;
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(mediaItem))
+ parentProductId = mediaItem.seasonServiceId || mediaItem.canonicalSeasonId || String.empty;
+ return parentProductId
+ }, _getNetworkStatus: function _getNetworkStatus() {
+ var isOnline = MS.Entertainment.UI.NetworkStatusService.isOnline() ? "online" : "offline";
+ var networkStatusStringArray = ["unknown", "unrestricted", "throttled", "onDemand", "localOnly", "none"];
+ return isOnline + ":" + networkStatusStringArray[MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).networkStatus]
+ }, _getOSVersion: function _getOSVersion() {
+ var osVersion = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (MS.Entertainment.Utilities.isApp1) {
+ var versionRegex = /NT\s[\d.]+/;
+ var version = versionRegex.exec(window.navigator.appVersion);
+ if (version.length > 0)
+ osVersion = version[0]
+ }
+ else {
+ var developmentKitProperties = WinJS.Utilities.getMember("Windows.Xbox.System.Internal.DevelopmentKit.DevelopmentKitProperties");
+ if (developmentKitProperties)
+ osVersion = developmentKitProperties["shellVersion"]
+ }
+ return osVersion
+ }, _getFileExtensionFromMediaInstance: function getFileExtensionFromMediaInstance(mediaInstance)
+ {
+ var extension = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ MS.Entertainment.Platform.Playback.assert(mediaInstance, "tried to determine path for undefined mediaInstance");
+ try {
+ if (mediaInstance) {
+ var path = String.empty;
+ if (!mediaInstance.isLocal && mediaInstance.source && !MS.Entertainment.Utilities.isBlobUrl(mediaInstance.source))
+ path = mediaInstance.source;
+ else if (mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ if (mediaInstance._mediaItem.data.filePath)
+ path = mediaInstance._mediaItem.data.filePath;
+ else if (mediaInstance._mediaItem.data.fileItem) {
+ if (mediaInstance._mediaItem.data.fileItem.fileType)
+ extension = mediaInstance._mediaItem.data.fileItem.fileType.toLowerCase();
+ else if (mediaInstance._mediaItem.data.fileItem.path)
+ path = mediaInstance._mediaItem.data.fileItem.path
+ }
+ else if (mediaInstance._mediaItem.data.fileType)
+ extension = mediaInstance._mediaItem.data.fileType.toLowerCase();
+ else if (mediaInstance._mediaItem.data.path)
+ path = mediaInstance._mediaItem.data.path;
+ if (path.length > 0)
+ extension = Windows.Foundation.Uri(path).extension.toLowerCase()
+ }
+ }
+ catch(e) {
+ MS.Entertainment.Platform.Playback.assert(false, "failed to determine extension for path")
+ }
+ if (!extension)
+ extension = "no extension";
+ return extension
+ }, _getUrlFromMediaInstance: function _getUrlFromMediaInstance(mediaInstance) {
+ var url = "undetermined";
+ MS.Entertainment.Platform.Playback.assert(mediaInstance, "tried to determine url for undefined mediaInstance");
+ if (mediaInstance)
+ if ((mediaInstance.isLocal && Microsoft.Entertainment.Configuration.ConfigurationManager().telemetry.flightId) || (!mediaInstance.isLocal && !MS.Entertainment.Utilities.isAmsterdamApp) || (!mediaInstance.isLocal && MS.Entertainment.Utilities.isAmsterdamApp && Microsoft.Entertainment.Configuration.ConfigurationManager().telemetry.flightId))
+ if (!mediaInstance.isLocal && mediaInstance.source && !MS.Entertainment.Utilities.isBlobUrl(mediaInstance.source))
+ url = mediaInstance.source;
+ else if (mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ if (mediaInstance._mediaItem.data.path)
+ url = mediaInstance._mediaItem.data.path;
+ else if (mediaInstance._mediaItem.data.fileItem && mediaInstance._mediaItem.data.fileItem.path)
+ url = mediaInstance._mediaItem.data.fileItem.path;
+ else if (mediaInstance._mediaItem.data.filePath)
+ url = mediaInstance._mediaItem.data.filePath;
+ return url
+ }, _getIsDrmFromMediaInstance: function _getDrmStateFromMediaInstance(mediaInstance) {
+ var isDRM = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (mediaInstance)
+ switch (mediaInstance.protectionState) {
+ case MS.Entertainment.Platform.Playback.ProtectionState.drmProtected:
+ isDRM = "true";
+ break;
+ case MS.Entertainment.Platform.Playback.ProtectionState.unprotected:
+ isDRM = "false";
+ break;
+ case MS.Entertainment.Platform.Playback.ProtectionState.unknown:
+ isDRM = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ break;
+ default:
+ MS.Entertainment.Platform.Playback.assert(false, "unknown protection state in logging");
+ break
+ }
+ return isDRM
+ }, _getIdFromMediaInstance: function _getIdFromMediaInstance(mediaInstance) {
+ var id = 0;
+ if (mediaInstance)
+ id = (mediaInstance.mediaInstanceId ? mediaInstance.mediaInstanceId : mediaInstance.libraryId);
+ return id
+ }, _getSmidFromMediaInstance: function _getSmidFromMediaInstance(mediaInstance) {
+ var id = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data && mediaInstance._mediaItem.data.zuneId)
+ id = mediaInstance._mediaItem.data.zuneId;
+ return id
+ }, _getParentSmidFromMediaInstance: function _getParentSmidFromMediaInstance(mediaInstance) {
+ return WinJS.Utilities.getMember("_mediaItem.data.seasonServiceId", mediaInstance) || WinJS.Utilities.getMember("_mediaItem.data.canonicalSeasonId", mediaInstance) || MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown
+ }, _getPlaybackSource: function _getPlaybackSource(mediaInstance) {
+ var playbackSource = MS.Entertainment.Platform.PlaybackHelpers.lastPlaybackSource;
+ var acquisitionData = WinJS.Utilities.getMember("_mediaItem.data.acquisitionData", mediaInstance);
+ if (acquisitionData) {
+ if (!playbackSource && acquisitionData.acquisitionContext)
+ playbackSource = MS.Entertainment.Utilities.getAcquisitionContextFromEnum(acquisitionData.acquisitionContext);
+ if (acquisitionData.acquisitionContextType)
+ playbackSource = (playbackSource ? playbackSource + ": " : String.empty) + MS.Entertainment.Utilities.getAcquisitionContextTypeFromEnum(acquisitionData.acquisitionContextType)
+ }
+ return playbackSource
+ }, _appendPlaybackCommonDataToDataPoint: function _appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint) {
+ try {
+ if (mediaInstance) {
+ var media = mediaInstance;
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ media = mediaInstance._mediaItem.data;
+ var typeName = this.mediaTypeNameForTelemetry(media);
+ var isSubscription = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).isSubscription : "false";
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaType, typeName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsSubscription, isSubscription);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsDrm, this._getIsDrmFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsStream, mediaInstance.isLocal ? "false" : "true");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Id, this._getIdFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Smid, this._getSmidFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ParentSmid, this._getParentSmidFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Extension, this._getFileExtensionFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Url, this._getUrlFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlaybackSource, this._getPlaybackSource(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsPreview, mediaInstance.isPreview ? "true" : "false");
+ var correlationId = MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.serviceId) || MS.Entertainment.Utilities.Telemetry.getCorrelationId(this._getParentSmidFromMediaInstance(mediaInstance));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, correlationId)
+ }
+ else
+ MS.Entertainment.Utilities.assert(mediaInstance, "MediaInstance is null")
+ }
+ catch(ex) {
+ MS.Entertainment.Utilities.fail("Unable to append parameter to data point")
+ }
+ }, logPlaybackHappened: function logPlaybackHappened(mediaInstance) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackHappened);
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.unknown;
+ if (uiStateService.isAppVisible) {
+ if (uiStateService.isSnapped)
+ playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.snapped;
+ else if (uiStateService.nowPlayingVisible || uiStateService.nowPlayingInset)
+ playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.nowplaying
+ }
+ else
+ playLocation = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.background;
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlayLocation, playLocation);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, this._getNetworkStatus());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OSVersion, this._getOSVersion());
+ this.closeDataPoint(dataPoint)
+ }, shouldSkipLoggingPlaybackError: function shouldSkipLoggingPlaybackError(error, context) {
+ var shouldSkip = false;
+ if (error) {
+ if (context.search("forceError") >= 0)
+ return true;
+ var errorCode = (error.msExtendedCode) ? error.msExtendedCode : error.code;
+ switch (errorCode) {
+ case MS.Entertainment.Platform.Playback.Error.X8_E_PLAYBACK_HDMI_OUTPUT_LOST.code:
+ shouldSkip = true;
+ break
+ }
+ }
+ return shouldSkip
+ }, logMediaPlayerPlayback: function logMediaPlayerPlayback(item) {
+ var ItemType = MS.Entertainment.Data.MediaBrowser.ItemType;
+ if (!item || !item.hydrate || (item.itemType !== ItemType.video && item.itemType !== ItemType.music))
+ return;
+ item.hydrate().done(function() {
+ var telemetryParameterArray = [];
+ this._packBaseItemTelemetry(item, telemetryParameterArray);
+ var telemetryEventName;
+ if (item.itemType === ItemType.video) {
+ telemetryEventName = this.TelemetryEvents.MediaPlayerVideoPlayback;
+ this._packVideoItemTelemetry(item, telemetryParameterArray)
+ }
+ else if (item.itemType === ItemType.music) {
+ telemetryEventName = this.TelemetryEvents.MediaPlayerMusicPlayback;
+ this._packMusicItemTelemetry(item, telemetryParameterArray)
+ }
+ this.logTelemetryEventWithParameterArray(telemetryEventName, telemetryParameterArray)
+ }.bind(this))
+ }, _packBaseItemTelemetry: function _packBaseItemTelemetry(item, telemetryParameterArray) {
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.DriveType, parameterValue: item.driveType || MS.Entertainment.Data.MediaBrowser.DriveType.unknown
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.FileType, parameterValue: item.fileType || String.empty
+ })
+ }, _packVideoItemTelemetry: function _packVideoItemTelemetry(item, telemetryParameterArray) {
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.AudioCodec, parameterValue: item.audioCodec || MS.Entertainment.Utilities.EMPTY_GUID
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.VideoCodec, parameterValue: item.videoCodec || MS.Entertainment.Utilities.EMPTY_GUID
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.ResolutionHeight, parameterValue: item.height || -1
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.ResolutionWidth, parameterValue: item.width || -1
+ });
+ var orientation = item.orientation;
+ if (!isFinite(orientation) || orientation < 0 || orientation > 270 || orientation % 90 !== 0)
+ orientation = -1;
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Orientation, parameterValue: orientation
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Bitrate, parameterValue: item.bitrate || -1
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Duration, parameterValue: item.duration || -1
+ })
+ }, _packMusicItemTelemetry: function _packMusicItemTelemetry(item, telemetryParameterArray) {
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.AudioCodec, parameterValue: item.audioCodec || MS.Entertainment.Utilities.EMPTY_GUID
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Bitrate, parameterValue: item.bitrate || -1
+ });
+ telemetryParameterArray.push({
+ parameterName: this.TelemetryParameterNames.Duration, parameterValue: item.duration || -1
+ })
+ }, logPlaybackError: function logPlaybackError(mediaInstance, error, context) {
+ if (!mediaInstance)
+ return;
+ MS.Entertainment.UI.Controls.assert(error || mediaInstance._errorDescriptor, "null error passed to logPlaybackError");
+ if (!error && mediaInstance._errorDescriptor)
+ error = mediaInstance._errorDescriptor;
+ var errorContext = context || String.empty;
+ if (mediaInstance._errorDescriptor && mediaInstance._errorDescriptor.context && mediaInstance._errorDescriptor.context !== errorContext)
+ errorContext += (errorContext ? "; " : String.empty) + mediaInstance._errorDescriptor.context;
+ if (error && error.context && (errorContext !== error.context))
+ errorContext += (errorContext ? "; " : String.empty) + error.context;
+ if (this.shouldSkipLoggingPlaybackError(error, errorContext))
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackError);
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ var isSubscription = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signedInUser) ? MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser).isSubscription : "false";
+ var mediaType = this.mediaTypeNameForTelemetry(mediaInstance._mediaItem.data);
+ var errorCode = error && error.code ? error.code : 0;
+ var msExtendedCode = error && error.msExtendedCode ? error.msExtendedCode : errorCode;
+ var networkStatus = this._getNetworkStatus();
+ var stackTraceLimitDefault = Error.stackTraceLimit;
+ Error.stackTraceLimit = Infinity;
+ var stackTrace = MS.Entertainment.UI.Debug.getStackTrace();
+ Error.stackTraceLimit = stackTraceLimitDefault;
+ stackTrace = stackTrace.replace(/.*at.*(winjs|Function\scode|CoreFX).*\)\n/g, String.empty).replace(/\(.+?.*\//g, "(").replace(/.*at\s/g, String.empty);
+ var stackTraceArray = stackTrace.split("\n");
+ stackTraceArray.reverse();
+ stackTrace = stackTraceArray.join("\n").substring(0, 2048);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, errorCode);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ExtendedCode, msExtendedCode);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorContext, errorContext);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, networkStatus);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.OSVersion, this._getOSVersion());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.StackTrace, stackTrace);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError:" + " ErrorCode=" + MS.Entertainment.Platform.Playback.errorToString(errorCode) + "| msExtendedCode=" + MS.Entertainment.Platform.Playback.errorToString(msExtendedCode) + "| ErrorContext=" + errorContext + "| MediaType=" + mediaType + "| isSubscription=" + isSubscription + "| NetworkStatus=" + networkStatus + "| StackTrace=" + stackTrace);
+ this._getMediaInfo(mediaInstance).then(function onSuccess(mediaDetail) {
+ var audioSubtype = String.empty;
+ var videoSubtype = String.empty;
+ var mimeType = String.empty;
+ var sourceCharacter = String.empty;
+ if (mediaDetail) {
+ audioSubtype = mediaDetail.audioSubtype;
+ videoSubtype = mediaDetail.videoSubtype;
+ mimeType = mediaDetail.mimeType;
+ sourceCharacter = mediaDetail.sourceCharacter
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRAudioSubtype, audioSubtype);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRVideoSubtype, videoSubtype);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRMimeType, mimeType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRSourceCharacter, sourceCharacter);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRIsDRM, "false");
+ this.closeDataPoint(dataPoint);
+ if (mediaInstance.source && mediaInstance.source.match && mediaInstance.source.match(/^blob*:/i))
+ URL.revokeObjectURL(mediaInstance.source);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError: data from MF Source Reader" + " audioSubtype=" + audioSubtype + "| videoSubtype=" + videoSubtype + "| mimeType=" + mimeType + "| sourceCharacter=" + sourceCharacter + "| isDRM=false")
+ }.bind(this), function onError(error) {
+ if (error && error.number === MS.Entertainment.Platform.Playback.Error.MF_E_DRM_UNSUPPORTED.code) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRIsDRM, "true");
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError: data from MF Source Reader isDRM=true")
+ }
+ else {
+ var mfSRError = String.empty;
+ if (error)
+ mfSRError = MS.Entertainment.Platform.Playback.errorToString(error.number);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MFSRError, mfSRError);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlaybackError: error from MF Source Reader" + " error=" + mfSRError)
+ }
+ this.closeDataPoint(dataPoint);
+ if (mediaInstance.source && mediaInstance.source.match && mediaInstance.source.match(/^blob*:/i))
+ URL.revokeObjectURL(mediaInstance.source)
+ }.bind(this))
+ }, _getMediaInfo: function _getMediaInfo(mediaInstance) {
+ var completion = null;
+ var error = null;
+ var promise = new WinJS.Promise(function(c, e, p) {
+ completion = c;
+ error = e
+ });
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (mediaInstance && mediaInstance.isLocal && mediaInstance.source && (MS.Entertainment.Utilities.isWindowsBlue || (MS.Entertainment.Utilities.isAmsterdamApp && configurationManager.amsterdam.onUsbErrorCodecRetrievalEnabled))) {
+ var getFileItemPromise = null;
+ var checkSizePromise = null;
+ var fileItem = null;
+ var retrieveCodecInfo = false;
+ if (mediaInstance._mediaItem.data.mediaType === "music")
+ fileItem = MS.Entertainment.Data.deflate(mediaInstance._mediaItem.data);
+ else if (mediaInstance._mediaItem.data.fileItem && (mediaInstance._mediaItem.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.video || mediaInstance._mediaItem.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.track))
+ fileItem = mediaInstance._mediaItem.data.fileItem;
+ if (fileItem)
+ getFileItemPromise = WinJS.Promise.as();
+ else {
+ var filePath = MS.Entertainment.Data.deflate(mediaInstance._mediaItem.data).FilePath;
+ if (filePath)
+ getFileItemPromise = Windows.Storage.StorageFile.getFileFromPathAsync(filePath).then(function onGetFileSuceeded(loadedFile) {
+ fileItem = loadedFile
+ }, function onGetFileFailed(error) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get a file item with error " + MS.Entertainment.Utilities.stringify(error));
+ completion(null);
+ return promise
+ });
+ else {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get a file item because the file path was invalid.");
+ completion(null);
+ return promise
+ }
+ }
+ return getFileItemPromise.then(function getFileSize() {
+ if (fileItem && WinJS.Utilities.getMember("properties.retrievePropertiesAsync", fileItem)) {
+ var requestedCodecProperties = ["System.Video.Compression", "System.Audio.Format", "System.MIMEType"];
+ return fileItem.properties.retrievePropertiesAsync(requestedCodecProperties).then(function onPropertiesRetrieved(codecProperties) {
+ var mediaDetail = {};
+ mediaDetail.videoSubtype = MS.Entertainment.Utilities.getMediaSubtypeNameFromGuid(codecProperties["System.Video.Compression"]);
+ mediaDetail.audioSubtype = MS.Entertainment.Utilities.getMediaSubtypeNameFromGuid(codecProperties["System.Audio.Format"]);
+ mediaDetail.mimeType = codecProperties["System.MIMEType"] ? codecProperties["System.MIMEType"] : "";
+ mediaDetail.sourceCharacter = String.empty;
+ completion(mediaDetail);
+ return promise
+ }, function onPropertiesFailed(error) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get file properties with error " + MS.Entertainment.Utilities.stringify(error));
+ completion(null)
+ })
+ }
+ else {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo() failed to get file properties because we don't have a valid fileItem.");
+ completion(null);
+ return promise
+ }
+ })
+ }
+ else {
+ MS.Entertainment.Platform.Playback.Etw.traceString("telemetryUtility::_getMediaInfo(): Codec retrieval was prohibited by policy.");
+ completion(null);
+ return promise
+ }
+ }, logPlayerBufferState: function logPlayerBufferState(buffered, currentPosition, duration, playerType) {
+ var bufferingLevel = 1.0;
+ var minBufferedEventsIntervalMs = 15000;
+ var maxBufferingLevel = 0.8;
+ if (!this._lastBufferedEvent[playerType])
+ this._lastBufferedEvent[playerType] = {};
+ var lastBufferedEvent = this._lastBufferedEvent[playerType];
+ var startPositions = String.empty,
+ endPositions = String.empty;
+ for (var i = 0; i < buffered.length; i++) {
+ startPositions += (buffered.start(i) + ";");
+ endPositions += (buffered.end(i) + ";");
+ bufferingLevel = Math.min(bufferingLevel, currentPosition / buffered.end(i));
+ if (Math.abs(duration - buffered.end(i)) <= 1.0) {
+ this._lastBufferedEvent[playerType] = null;
+ return
+ }
+ }
+ if (bufferingLevel < maxBufferingLevel && (lastBufferedEvent.timeStamp && Math.abs(Date.now() - lastBufferedEvent.timeStamp) < minBufferedEventsIntervalMs))
+ return;
+ if (startPositions !== String.empty || endPositions !== String.empty) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlayerBufferState);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventTime, Date.now());
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlayerType, playerType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BufferStart, startPositions);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BufferEnd, endPositions);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CurrentPosition, currentPosition);
+ this.closeDataPoint(dataPoint);
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlayerBufferState: PlayerType=" + playerType + " BufferStart=" + startPositions + " BufferEnd=" + endPositions + " CurrentPosition=" + currentPosition);
+ if (playerType === "currentPlayer")
+ if (lastBufferedEvent.currentPosition === currentPosition && !lastBufferedEvent.hasStopped) {
+ lastBufferedEvent.hasStopped = true;
+ lastBufferedEvent.lastStoppedTimeStamp = Date.now()
+ }
+ else {
+ if (lastBufferedEvent.hasStopped && lastBufferedEvent.lastStoppedTimeStamp) {
+ var stoppedTimeInterval = Date.now() - lastBufferedEvent.lastStoppedTimeStamp;
+ MS.Entertainment.Platform.Playback.Etw.traceString("Telemetry::Playback::PlayerBufferState: Playback has stopped for " + stoppedTimeInterval + "ms due to buffering.")
+ }
+ lastBufferedEvent.hasStopped = false;
+ lastBufferedEvent.lastStoppedTimeStamp = null
+ }
+ lastBufferedEvent.timeStamp = Date.now();
+ lastBufferedEvent.currentPosition = currentPosition
+ }
+ }, logPlayToReceiverError: function logPlayToReceiverError(exception, message) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlayToReceiverError);
+ var errorCode = "0x" + (0xFFFFFFFF + exception.number + 1).toString(16);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, errorCode);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Message, message);
+ this.closeDataPoint(dataPoint)
+ }, logCommandClicked: function logCommandClicked(commandAction) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.CommandUsage);
+ this.appendUIPath(dataPoint);
+ MS.Entertainment.Utilities.assert(!!commandAction.automationId, "commandAction.automationId is null or undefined, commandAction.id = " + commandAction.id);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandId, commandAction.automationId);
+ if (commandAction.title)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandLabel, commandAction.title);
+ if (commandAction.parameter) {
+ if (commandAction.parameter.abTests)
+ commandAction.parameter.abTests.forEach(function(abTest) {
+ if (abTest.abTestName)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABTestName, abTest.abTestName);
+ if (abTest.abGroupName)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABTestName, abTest.abGroupName)
+ });
+ if (commandAction.parameter.mediaItem) {
+ if (commandAction.parameter.mediaItem.mediaType === Microsoft.Entertainment.Queries.ObjectType.game) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.mediaType, commandAction.parameter.mediaItem.mediaType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.serviceId, commandAction.parameter.mediaItem.serviceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.titleType, commandAction.parameter.mediaItem.titleType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.titleId, commandAction.parameter.mediaItem.titleId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.defaultPlatformType, commandAction.parameter.mediaItem.defaultPlatformType)
+ }
+ if (commandAction.parameter.mediaItem.name)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.mediaName, commandAction.parameter.mediaItem.name);
+ if (commandAction.parameter.mediaItem.queryId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.queryId, commandAction.parameter.mediaItem.queryId);
+ if (commandAction.parameter.mediaItem.acquisitionData) {
+ if (commandAction.parameter.mediaItem.acquisitionData.acquisitionContext)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContext, MS.Entertainment.Utilities.getAcquisitionContextFromEnum(commandAction.parameter.mediaItem.acquisitionData.acquisitionContext));
+ if (commandAction.parameter.mediaItem.acquisitionData.acquisitionContextType)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextType, MS.Entertainment.Utilities.getAcquisitionContextTypeFromEnum(commandAction.parameter.mediaItem.acquisitionData.acquisitionContextType));
+ if (commandAction.parameter.mediaItem.acquisitionData.acquisitionContextID)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, commandAction.parameter.mediaItem.acquisitionData.acquisitionContextID)
+ }
+ }
+ else if (commandAction.parameter.hub || commandAction.parameter.page) {
+ if (commandAction.parameter.hub)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.hub, commandAction.parameter.hub);
+ if (commandAction.parameter.page)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.page, commandAction.parameter.page);
+ if (commandAction.parameter.queryId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.queryId, commandAction.parameter.queryId)
+ }
+ if (commandAction.parameter.actionType)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.actionType, commandAction.parameter.actionType);
+ if (commandAction.parameter.executeLocation)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.executeLocation, commandAction.parameter.executeLocation)
+ }
+ else if (commandAction.userModel)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.secondaryGamerTag, commandAction.userModel.gamerTag);
+ this.closeDataPoint(dataPoint)
+ }, logTransportControlsCommand: function logTransportControlsCommand(automationId, title) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.CommandUsage);
+ this.appendUIPath(dataPoint);
+ MS.Entertainment.Utilities.assert(!!automationId, "automationId is null or undefined, title = " + title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandId, automationId);
+ if (title)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandLabel, title);
+ this.closeDataPoint(dataPoint)
+ }, logPopoverShown: function logPopoverShown(commandId, mediaItem) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PopoverDisplay);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UIPart, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Popover);
+ this.appendUIPath(dataPoint);
+ if (commandId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.commandId, commandId);
+ if (mediaItem) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.mediaType, mediaItem.mediaType);
+ if (mediaItem.serviceId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.serviceId, mediaItem.serviceId);
+ if (mediaItem.seriesId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.seriesId, mediaItem.seriesId);
+ if (mediaItem.titleId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.titleId, mediaItem.titleId);
+ if (mediaItem.queryId)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.queryId, mediaItem.queryId);
+ if (mediaItem.name)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.name, mediaItem.name);
+ if (mediaItem.itemTypeQueryString)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.itemTypeQueryString, mediaItem.itemTypeQueryString)
+ }
+ this.closeDataPoint(dataPoint)
+ }, logModifierClicked: function logModifierClicked(id, label) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ModifierUsage);
+ this.appendUIPath(dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Label, label);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Id, id);
+ this.closeDataPoint(dataPoint)
+ }, logNotification: function logNotification(notification, isNewNotification) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.NotificationUsage);
+ this.appendUIPath(dataPoint);
+ MS.Entertainment.Utilities.assert(notification, "notification is null or undefined");
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NotificationTitle, notification.title);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NotificationCategory, notification.category.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsNewNotification, isNewNotification ? "Yes" : "No");
+ this.closeDataPoint(dataPoint)
+ }, logPageAction: function logPageAction(pageContentDataObject, currentLocation, destination, parameterArray) {
+ var telemetryParameterNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames;
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ if (!currentLocation) {
+ MS.Entertainment.Utilities.fail("Page Action call missing currentLocation");
+ return
+ }
+ if (!pageContentDataObject) {
+ MS.Entertainment.Utilities.fail("Page Action call missing pageContentDataObject");
+ return
+ }
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PageAction);
+ dataPoint.appendParameter(telemetryParameterNames.UserId, this._getUserIdValue());
+ dataPoint.appendParameter(telemetryParameterNames.Users, this._getUsersValue());
+ dataPoint.appendParameter(telemetryParameterNames.ActionTypeId, MS.Entertainment.Utilities.Telemetry.InputActionTypes.Click);
+ dataPoint.appendParameter(telemetryParameterNames.ActionInputMethodId, MS.Entertainment.Utilities.Telemetry.InputMethodTypes.Click);
+ if (currentLocation.uri) {
+ dataPoint.appendParameter(telemetryParameterNames.PageURI, currentLocation.uri);
+ var splitUri = currentLocation.uri.split("/");
+ if (splitUri)
+ dataPoint.appendParameter(telemetryParameterNames.PageName, splitUri[splitUri.length - 1]);
+ else
+ dataPoint.appendParameter(telemetryParameterNames.PageName, currentLocation.uri)
+ }
+ else {
+ dataPoint.appendParameter(telemetryParameterNames.PageURI, telemetryValueNames.Unknown);
+ dataPoint.appendParameter(telemetryParameterNames.PageName, telemetryValueNames.Unknown)
+ }
+ dataPoint.appendParameter(telemetryParameterNames.PageTypeId, currentLocation.pageTypeId);
+ dataPoint.appendParameter(telemetryParameterNames.TemplateId, String.empty);
+ if (destination) {
+ dataPoint.appendParameter(telemetryParameterNames.DestPageURI, destination.uri);
+ dataPoint.appendParameter(telemetryParameterNames.DestPageTypeId, destination.pageTypeId)
+ }
+ else {
+ dataPoint.appendParameter(telemetryParameterNames.DestPageURI, telemetryValueNames.None);
+ dataPoint.appendParameter(telemetryParameterNames.DestPageTypeId, telemetryValueNames.None)
+ }
+ dataPoint.appendParameter(telemetryParameterNames.CampaignId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.GroupId, String.empty);
+ var jsonString = null;
+ try {
+ jsonString = JSON.stringify(this._buildPageContentSlotForElement(pageContentDataObject))
+ }
+ catch(e) {
+ MS.Entertainment.Utilities.fail("failed to stringify page content: " + e);
+ jsonString = String.empty
+ }
+ dataPoint.appendParameter(telemetryParameterNames.ContentJsonVersion, 1.1);
+ dataPoint.appendParameter(telemetryParameterNames.Content, jsonString);
+ if (parameterArray && parameterArray.length)
+ for (var i = 0; i < parameterArray.length; i++)
+ if (parameterArray[i].parameterName && parameterArray[i].parameterValue !== undefined && parameterArray[i].parameterValue !== null)
+ dataPoint.appendParameter(parameterArray[i].parameterName, parameterArray[i].parameterValue);
+ else
+ MS.Entertainment.Utilities.fail("logPageAction called with invalid parameterArray element. parameterName: " + parameterArray[i].parameterName);
+ this.closeDataPoint(dataPoint)
+ }, logPageView: function logPageView(rootElement, newPageInformation, refererPageInformation) {
+ var telemetryParameterNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames;
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PageView);
+ dataPoint.appendParameter(telemetryParameterNames.UserId, this._getUserIdValue());
+ dataPoint.appendParameter(telemetryParameterNames.Users, this._getUsersValue());
+ var refererUri = telemetryValueNames.Unknown;
+ var refererTypeId = telemetryValueNames.Unknown;
+ if (refererPageInformation) {
+ if (refererPageInformation.uri)
+ refererUri = refererPageInformation.uri;
+ if (refererPageInformation.pageTypeId)
+ refererTypeId = refererPageInformation.pageTypeId
+ }
+ var newPageUri = telemetryValueNames.Unknown;
+ var newPageName = telemetryValueNames.Unknown;
+ var newPageType = telemetryValueNames.Unknown;
+ if (newPageInformation) {
+ if (newPageInformation.uri) {
+ newPageUri = newPageInformation.uri;
+ var splitUri = newPageInformation.uri.split("/");
+ if (splitUri)
+ newPageName = splitUri[splitUri.length - 1];
+ else
+ newPageName = newPageInformation.uri
+ }
+ if (newPageInformation.pageTypeId)
+ newPageType = newPageInformation.pageTypeId
+ }
+ dataPoint.appendParameter(telemetryParameterNames.PageURI, newPageUri);
+ dataPoint.appendParameter(telemetryParameterNames.PageName, newPageName);
+ dataPoint.appendParameter(telemetryParameterNames.RefererPageURI, refererUri);
+ dataPoint.appendParameter(telemetryParameterNames.PageTypeId, newPageType);
+ dataPoint.appendParameter(telemetryParameterNames.RefererPageTypeId, refererTypeId);
+ dataPoint.appendParameter(telemetryParameterNames.PageTags, this._buildPageTagInformation(rootElement));
+ dataPoint.appendParameter(telemetryParameterNames.PageParameters, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ProductCatalogId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ProductId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.TemplateId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ResolutionWidth, MS.Entertainment.Utilities.getWindowWidth());
+ dataPoint.appendParameter(telemetryParameterNames.ResolutionHeight, MS.Entertainment.Utilities.getWindowHeight());
+ var screenState = MS.Entertainment.Utilities.Telemetry.ScreenState.FullScreen;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped)
+ screenState = MS.Entertainment.Utilities.Telemetry.ScreenState.Snapped;
+ dataPoint.appendParameter(telemetryParameterNames.ScreenState, screenState);
+ dataPoint.appendParameter(telemetryParameterNames.ColorDepth, 24000);
+ dataPoint.appendParameter(telemetryParameterNames.SkinId, String.empty);
+ var authedParameter = MS.Entertainment.Utilities.Telemetry.SignInState.Anonymous;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn) && MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).isSignedIn)
+ authedParameter = MS.Entertainment.Utilities.Telemetry.SignInState.Authenticated;
+ dataPoint.appendParameter(telemetryParameterNames.AuthState, authedParameter);
+ dataPoint.appendParameter(telemetryParameterNames.CampaignId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.GroupId, String.empty);
+ dataPoint.appendParameter(telemetryParameterNames.ContentJsonVersion, 1.1);
+ dataPoint.appendParameter(telemetryParameterNames.Content, this._buildPageContentInformation(rootElement));
+ if (MS.Entertainment.Utilities.isVideoApp2 && (newPageInformation.uri === MS.Entertainment.UI.Monikers.movieDetailsPage || newPageInformation.uri === MS.Entertainment.UI.Monikers.tvDetailsPage)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var media = WinJS.Utilities.getMember("currentPage.options.mediaItem", navigationService);
+ if (media && media.hasServiceId) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaName, media.name);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProductGuid, media.serviceId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CorrelationID, MS.Entertainment.Utilities.Telemetry.getCorrelationId(media.serviceId))
+ }
+ }
+ this.closeDataPoint(dataPoint)
+ }, _buildPageTagInformation: function _buildPageTagInformation(rootElement) {
+ var rootToUse = rootElement ? rootElement : document.querySelector(".pageContainer.currentPage");
+ var attributeElements = null;
+ var resultString = String.empty;
+ var result = null;
+ if (rootToUse)
+ attributeElements = rootToUse.querySelectorAll("[data-ent-pagetag-name]");
+ if (attributeElements && attributeElements.length)
+ for (var i = 0; i < attributeElements.length; i++) {
+ var pageTagName = null;
+ var pageTagValuePath = null;
+ var pageTagValue = null;
+ var pageTagItem = null;
+ var currentElement = attributeElements[i];
+ if (currentElement.hasAttribute("data-ent-pagetag-name"))
+ pageTagName = currentElement.getAttribute("data-ent-pagetag-name");
+ if (currentElement.hasAttribute("data-ent-pagetag-value"))
+ pageTagValuePath = currentElement.getAttribute("data-ent-pagetag-value");
+ MS.Entertainment.Utilities.assert(pageTagName, "element has data-ent-pagetag-name, but was empty");
+ MS.Entertainment.Utilities.assert(pageTagValuePath, "element has data-ent-pagetag-name, but has no or empty value");
+ if (pageTagValuePath)
+ pageTagValue = WinJS.Utilities.getMember(pageTagValuePath, currentElement.winControl || currentElement);
+ if (pageTagName && pageTagValue) {
+ result = result || {};
+ result[pageTagName] = pageTagValue
+ }
+ }
+ if (result)
+ try {
+ resultString = JSON.stringify(result)
+ }
+ catch(e) {
+ MS.Entertainment.Utilities.fail("failed to stringify page tag: " + e)
+ }
+ return resultString
+ }, _buildPageContentInformation: function _buildPageContentInformation(rootElement) {
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ var rootToUse = rootElement ? rootElement : document.querySelector(".pageContainer.currentPage");
+ if (!rootToUse)
+ return String.empty;
+ var attributedElements = rootToUse.querySelectorAll("[data-ent-pagecontent]");
+ var pageContentDataArray = this._buildPageContentArrayForList(attributedElements);
+ var jsonString = String.empty;
+ var pageContentObject = {SVer: "1.00"};
+ pageContentObject.Slots = pageContentDataArray;
+ try {
+ jsonString = JSON.stringify(pageContentObject)
+ }
+ catch(e) {
+ MS.Entertainment.Utilities.fail("failed to stringify page content: " + e)
+ }
+ return jsonString
+ }, _buildPageContentArrayForList: function _buildPageContentObjectForElement(list) {
+ var currentElement = null;
+ var attributeValue = null;
+ var pageContentTelemetryObject = null;
+ var pageContentObjectProperty = null;
+ var contentArray = [];
+ for (var i = 0; i < list.length; i++) {
+ if (!list[i].hasAttribute("data-ent-pagecontent")) {
+ MS.Entertainment.Utilities.fail("element has invalid data-ent-pagecontent value");
+ continue
+ }
+ var attributeValue = list[i].getAttribute("data-ent-pagecontent");
+ if (!attributeValue) {
+ MS.Entertainment.Utilities.fail("element has data-ent-pagecontent, with no value");
+ continue
+ }
+ if (list[i].winControl)
+ pageContentObjectProperty = list[i].winControl[attributeValue];
+ else if (list[i][attributeValue])
+ pageContentObjectProperty = list[i][attributeValue];
+ else
+ pageContentObjectProperty = null;
+ if (pageContentObjectProperty && pageContentObjectProperty.mediaItem)
+ pageContentObjectProperty = pageContentObjectProperty.mediaItem;
+ pageContentTelemetryObject = this._buildPageContentSlotForElement({
+ slot: i, domElement: list[i], itemPropertyBag: pageContentObjectProperty
+ });
+ if (pageContentTelemetryObject)
+ contentArray.push(pageContentTelemetryObject)
+ }
+ return contentArray
+ }, _buildPageContentSlotForElement: function _buildPageContentSlotForElement(pageContentObject) {
+ var telemetryValueNames = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues;
+ var contentCatalogIds = MS.Entertainment.Utilities.Telemetry.ContentCatalogId;
+ var contentSourceIds = MS.Entertainment.Utilities.Telemetry.ContentSourceId;
+ var contentTypeIds = MS.Entertainment.Utilities.Telemetry.ContentTypeId;
+ var pageContentTelemetryObject = {};
+ if (!pageContentObject)
+ return pageContentTelemetryObject;
+ if (pageContentObject.slot >= 0)
+ pageContentTelemetryObject.SlotId = pageContentObject.slot.toString();
+ else
+ pageContentTelemetryObject.SlotId = "-1";
+ if (pageContentObject.itemPropertyBag) {
+ pageContentTelemetryObject.ContentId = pageContentObject.itemPropertyBag.serviceId;
+ pageContentTelemetryObject.ContentCatalogId = pageContentObject.itemPropertyBag.catalogId;
+ pageContentTelemetryObject.ContentSourceId = pageContentObject.itemPropertyBag.sourceId;
+ pageContentTelemetryObject.ContentTypeId = pageContentObject.itemPropertyBag.typeId || contentTypeIds.Editorial;
+ pageContentTelemetryObject.ContentName = pageContentObject.itemPropertyBag.name
+ }
+ else if (pageContentObject.domElement && pageContentObject.domElement.hasAttribute("data-win-automationid")) {
+ pageContentTelemetryObject.ContentId = pageContentObject.domElement.getAttribute("data-win-automationid");
+ pageContentTelemetryObject.ContentCatalogId = contentCatalogIds.App;
+ pageContentTelemetryObject.ContentSourceId = contentSourceIds.App;
+ pageContentTelemetryObject.ContentTypeId = contentTypeIds.App;
+ pageContentTelemetryObject.ContentName = pageContentTelemetryObject.ContentId
+ }
+ else {
+ pageContentTelemetryObject.ContentId = pageContentObject.contentId;
+ pageContentTelemetryObject.ContentCatalogId = pageContentObject.contentCatalogId;
+ pageContentTelemetryObject.ContentSourceId = pageContentObject.contentSourceId;
+ pageContentTelemetryObject.ContentTypeId = pageContentObject.contentTypeId;
+ pageContentTelemetryObject.ContentName = pageContentObject.contentName
+ }
+ var contentTagsValue = String.empty;
+ if (pageContentObject.contentTags)
+ try {
+ contentTagsValue = JSON.stringify(pageContentObject.contentTags)
+ }
+ catch(e) {
+ MS.Entertainment.Utilities.fail("failed to stringify content tag: " + e)
+ }
+ pageContentTelemetryObject.ContentTags = contentTagsValue;
+ pageContentTelemetryObject.ProductCatalogId = String.empty;
+ pageContentTelemetryObject.ProductId = String.empty;
+ if (pageContentObject.areaName)
+ pageContentTelemetryObject.AreaId = pageContentObject.areaName;
+ else if (pageContentObject.domElement)
+ pageContentTelemetryObject.AreaId = this._findAreaFromContentItem(pageContentObject.domElement);
+ else
+ pageContentTelemetryObject.AreaId = telemetryValueNames.Unknown;
+ pageContentTelemetryObject.CampaignId = String.empty;
+ pageContentTelemetryObject.GroupId = String.empty;
+ return pageContentTelemetryObject
+ }, _findAreaFromContentItem: function _findAreaFromContentItem(element) {
+ var currentElement = element;
+ var areaName = String.empty;
+ while (currentElement && !areaName) {
+ areaName = currentElement.getAttribute("data-ent-areaname") || String.empty;
+ currentElement = currentElement.parentElement
+ }
+ return areaName
+ }, mediaUsageContentTypeName: function mediaUsageContentTypeName(media) {
+ var name;
+ name = media.edsMediaItemTypeString;
+ if (!name) {
+ var mediaType = media.mediaType;
+ switch (mediaType) {
+ case Microsoft.Entertainment.Queries.ObjectType.video:
+ if (media.videoType === Microsoft.Entertainment.Queries.VideoType.tvEpisode)
+ name = MS.Entertainment.Data.Query.edsMediaType.tvEpisode;
+ else if (media.videoType === Microsoft.Entertainment.Queries.VideoType.musicVideo)
+ name = MS.Entertainment.Data.Query.edsMediaType.musicVideo;
+ else if (media.videoType === Microsoft.Entertainment.Queries.VideoType.movie)
+ name = MS.Entertainment.Data.Query.edsMediaType.movie;
+ else
+ name = String.empty;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeries:
+ name = MS.Entertainment.Data.Query.edsMediaType.tvSeries;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.tvSeason:
+ name = MS.Entertainment.Data.Query.edsMediaType.tvSeason;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.person:
+ name = MS.Entertainment.Data.Query.edsMediaType.musicArtist;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.album:
+ name = MS.Entertainment.Data.Query.edsMediaType.album;
+ break;
+ case Microsoft.Entertainment.Queries.ObjectType.track:
+ name = MS.Entertainment.Data.Query.edsMediaType.track;
+ break;
+ default:
+ name = String.empty;
+ break
+ }
+ }
+ return name
+ }, logMediaUsageHappened: function logMediaUsageHappened(playbackControl, position, eventType, isStartEvent) {
+ if (!playbackControl)
+ return;
+ var mediaInstance = playbackControl.currentMedia;
+ if (playbackControl._player && playbackControl._player._currentMedia)
+ mediaInstance = playbackControl._player._currentMedia;
+ var media = null;
+ if (mediaInstance && mediaInstance._mediaItem && mediaInstance._mediaItem.data)
+ media = mediaInstance._mediaItem.data;
+ if (!media)
+ return;
+ var contentType = this.mediaUsageContentTypeName(media);
+ if (contentType === MS.Entertainment.Data.Query.edsMediaType.track && mediaInstance) {
+ if (mediaInstance.isAudioAd)
+ contentType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicAd;
+ else if (mediaInstance.isPreview)
+ contentType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicPreview
+ }
+ else if (contentType === MS.Entertainment.Data.Query.edsMediaType.movie && mediaInstance && mediaInstance.isPreview)
+ contentType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.VideoPreview;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MediaUsageEvent);
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.mediaUsage);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventType, eventType);
+ if (position)
+ position = (position | 0);
+ if (position !== this.badPositionMs)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, position);
+ else {
+ MS.Entertainment.Utilities.assert(false, "playback position is 604800000(7days), duration is " + playbackControl.duration);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, String.empty)
+ }
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, media.canonicalId);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.zuneId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, media.zuneId);
+ if (MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId) && MS.Entertainment.Utilities.isEmptyGuid(media.zuneId)) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, String.empty);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, String.empty)
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, contentType);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsStream, mediaInstance && mediaInstance.isLocal ? "false" : "true");
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible)
+ if (uiStateService.isSnapped)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Docked);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Full);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Minimized);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.IsDrm, this._getIsDrmFromMediaInstance(mediaInstance));
+ var playbackDuration = 0;
+ if (isStartEvent) {
+ var now = Date.now();
+ this._totalTimeCounterStart = now
+ }
+ else if (this._totalTimeCounterStart !== 0) {
+ playbackDuration = Date.now() - this._totalTimeCounterStart;
+ this._totalTimeCounterStart = 0
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlaybackDurationMs, playbackDuration);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaInstanceId, mediaInstance && mediaInstance.mediaInstanceId ? mediaInstance.mediaInstanceId : String.empty);
+ if (playbackControl.duration && playbackControl.duration > 0)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaLengthMs, playbackControl.duration);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MediaLengthMs, mediaInstance && mediaInstance.duration ? mediaInstance.duration : String.empty);
+ var acquisitionData = media.acquisitionData ? media.acquisitionData : (mediaInstance && mediaInstance.acquisitionData);
+ if (acquisitionData) {
+ MS.Entertainment.Utilities.assert(acquisitionData.acquisitionContext, "Expected acquisition context to be defined for media usage event");
+ if (acquisitionData.acquisitionContext)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContext, MS.Entertainment.Utilities.getAcquisitionContextFromEnum(acquisitionData.acquisitionContext));
+ MS.Entertainment.Utilities.assert(acquisitionData.acquisitionContextType, "Expected acquisition context type to be defined for media usage event");
+ if (acquisitionData.acquisitionContextType)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextType, MS.Entertainment.Utilities.getAcquisitionContextTypeFromEnum(acquisitionData.acquisitionContextType));
+ if (!MS.Entertainment.Utilities.isEmptyGuid(acquisitionData.acquisitionContextID)) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, acquisitionData.acquisitionContextID);
+ if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.playlist)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AdditionalContext, acquisitionData.acquisitionAdditionalContext || media.playlistName)
+ }
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.track && !MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, (media.track && media.track.canonicalId) || media.canonicalId);
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.album && media.album && !MS.Entertainment.Utilities.isEmptyGuid(media.album.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, media.album.canonicalId);
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.artist && media.artist && !MS.Entertainment.Utilities.isEmptyGuid(media.artist.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, media.artist.canonicalId);
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.playlist && MS.Entertainment.Utilities.isValidServiceId(media.playlistCloudSyncId)) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, media.playlistCloudSyncId);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AdditionalContext, media.playlistName)
+ }
+ else if (acquisitionData.acquisitionContextType === Microsoft.Entertainment.Platform.AcquisitionContextType.musicVideo && !MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextId, (media.musicVideo && media.musicVideo.canonicalId) || media.canonicalId)
+ }
+ else if (mediaInstance && mediaInstance.isAudioAd) {
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContext, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicAd);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionContextType, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.MusicAd)
+ }
+ this.closeDataPoint(dataPoint)
+ }, logPlayHappened: function logPlayHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Resume, true);
+ else
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Play, true);
+ this._somethingPlaying = true
+ }, logPauseHappened: function logPauseHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Pause, false)
+ }, logEndHappened: function logEndHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.End, false);
+ this._somethingPlaying = false
+ }, logSkipHappened: function logSkipHappened(playbackControl, position) {
+ if (this._somethingPlaying)
+ this.logMediaUsageHappened(playbackControl, position, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Skip, false);
+ this._somethingPlaying = false
+ }, logPurchaseHappened: function logPurchaseHappened(media, offer) {
+ if (!media || !offer)
+ return;
+ var serviceIdToUse = null;
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.tvSeason)
+ serviceIdToUse = media.seasonServiceId;
+ else
+ serviceIdToUse = media.canonicalId;
+ if (MS.Entertainment.Utilities.isEmptyGuid(media.zuneId) && MS.Entertainment.Utilities.isEmptyGuid(serviceIdToUse))
+ return;
+ var contentType = this.mediaUsageContentTypeName(media);
+ if (!contentType)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MediaUsageEvent);
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.mediaUsage);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventType, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Purchase);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, 0);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, contentType);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(serviceIdToUse))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, serviceIdToUse);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.zuneId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, media.zuneId);
+ var acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Purchase;
+ if (media.mediaType === Microsoft.Entertainment.Queries.ObjectType.video) {
+ var licenseRight = offer.licenseRight;
+ if (licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent || licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream)
+ acquisitionType = MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Rental
+ }
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcquisitionType, acquisitionType);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible)
+ if (uiStateService.isSnapped)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Docked);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Full);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Minimized);
+ this.closeDataPoint(dataPoint)
+ }, logDownloadHappened: function logDownloadHappened(media) {
+ if (!media)
+ return;
+ if (MS.Entertainment.Utilities.isEmptyGuid(media.zuneId) && MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ return;
+ var contentType = this.mediaUsageContentTypeName(media);
+ if (!contentType)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.MediaUsageEvent);
+ dataPoint.appendDestination(Microsoft.Entertainment.Platform.Logging.TelemetryListener.mediaUsage);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.EventType, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Download);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Position, 0);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ContentType, contentType);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.canonicalId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.BingMediaId, media.canonicalId);
+ if (!MS.Entertainment.Utilities.isEmptyGuid(media.zuneId))
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ProviderMediaId, media.zuneId);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isAppVisible)
+ if (uiStateService.isSnapped)
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Docked);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Full);
+ else
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ScreenSize, MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Minimized);
+ this.closeDataPoint(dataPoint)
+ }, logPlaybackErrorConvertedToGeneric: function logPlaybackErrorConvertedToGeneric(originalCode, originalExtendedCode, context) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.PlaybackErrorConvertedToGeneric);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, (originalCode ? originalCode : 0));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ExtendedCode, (originalExtendedCode ? originalExtendedCode : 0));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Context, (context ? context : ""));
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.PlaybackSource, MS.Entertainment.Platform.PlaybackHelpers.lastPlaybackSource);
+ this.closeDataPoint(dataPoint)
+ }, logDeviceGroupAction: function logDeviceGroupAction(action, errorCode) {
+ if (!action)
+ return;
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.DeviceGroup);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Context, action);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, (errorCode ? errorCode : 0));
+ this.closeDataPoint(dataPoint)
+ }, logRootLicenseAcquisition: function logRootLicenseAcquisition(status, errorCode) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.RootLicenseAcquisition);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Status, status);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ErrorCode, (errorCode ? errorCode : 0));
+ this.closeDataPoint(dataPoint)
+ }, logReactiveLicenseAcquisitionProgress: function logReactiveLicenseAcquisitionProgress(mediaInstance, kid, state) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ReactiveLicenseAcquisition);
+ this._appendPlaybackCommonDataToDataPoint(mediaInstance, dataPoint);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.State, state);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Kid, kid ? kid : MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Miid, mediaInstance && mediaInstance.mediaInstanceId ? mediaInstance.mediaInstanceId : MS.Entertainment.Utilities.Telemetry.TelemetryParameterValues.Unknown);
+ this.closeDataPoint(dataPoint)
+ }, logDRMIndividualization: function logDRMIndividualization(status) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.DRMIndividualization);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Status, status);
+ this.closeDataPoint(dataPoint)
+ }, logWelcomePanelDismissed: function logWelcomePanelDismissed() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.WelcomePanelDismissed);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logWelcomePanelStartButton: function logWelcomePanelStartButton() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.WelcomePanelStartButtonClicked);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logSignInWelcomePanel: function logSignInWelcomePanel() {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignInWelcomePanel);
+ this.appendUIPath(dataPoint);
+ this.closeDataPoint(dataPoint)
+ }, logErrorInMediaTagRemoval: function logErrorInMediaTagRemoval(error) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.ErrorInMediaTagRemoval);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.Error, error);
+ this.closeDataPoint(dataPoint)
+ }, logVideoPostRollAction: function logVideoPostRollAction(abTestName, abGroupName, action) {
+ var dataPoint = this.openDataPoint();
+ dataPoint.appendEventName(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.VideoPostRollAction);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABTestName, abTestName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ABGroupName, abGroupName);
+ dataPoint.appendParameter(MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VideoPostRollAction, action);
+ this.closeDataPoint(dataPoint)
+ }, badPositionMs: 604800000, Events: {CloudMatchStateChangeMethod: "CloudMatchEnabledStateChangeMethod"}, StateChangeMethodValues: {
+ dialog: "dialog", toggle: "toggle", notification: "notification"
+ }, InputActionTypes: {Click: "1"}, InputMethodTypes: {Click: "8"}, ContentCatalogId: {
+ App: "1", Compass: "2", XboxCatalog: "3", EDS: "4"
+ }, ContentSourceId: {
+ UAD: "1", Compass: "2", App: "3", Recommendation: "4", SDS: "5"
+ }, ContentTypeId: {
+ Advertisement: "1", Editorial: "2", App: "3", Webpage: "4", Weblink: "5", TextEntry: "6"
+ }, PageTypeId: {
+ Dash: "1", Webblend: "2", WebPage: "3", Popup: "4", Charm: "5", Menu: "6", AppBar: "7", SmartDJ: "8", Featured: "9", TopMusic: "10", Details: "11", VideoPostRoll: "12", Store: "13"
+ }, ScreenState: {
+ FullScreen: "FullScreen", Snapped: "Snapped"
+ }, SignInState: {
+ Authenticated: "Authenticated", Anonymous: "Anonymous"
+ }, TelemetryEvents: {
+ AccountCreation: "AccountCreation", AuthHeaderResult: "AuthHeaderResult", BlockPurchaseAllItemsFoundOnce: "BlockPurchaseAllItemsFoundOnce", BlockPurchaseAllowed: "BlockPurchaseAllowed", BlockPurchaseFullyOwnedInDb: "BlockPurchaseFullyOwnedInDb", BlockPurchaseFullyOwnedInCloud: "BlockPurchaseFullyOwnedInCloud", BlockPurchaseInventoryCheck: "BlockPurchaseInventoryCheck", BlockPurchaseNavigatedAway: "BlockPurchaseNavigatedAway", BlockPurchaseNoSL2K: "BlockPurchaseNoSL2K", BlockPurchaseErrorGeneric: "BlockPurchaseErrorGeneric", BlockPurchaseErrorPurchase: "BlockPurchaseErrorPurchase", BlockPurchaseErrorRental: "BlockPurchaseErrorRental", BlockPurchaseRegionBlocked: "BlockPurchaseRegionBlocked", CommandUsage: "CommandUsage", DeviceGroup: "DeviceGroup", DlnaDriveBrowse: "DlnaDriveBrowse", DRMIndividualization: "DRMIndividualization", ErrorInMediaTagRemoval: "ErrorInMediaTagRemoval", GetPreferredStreamResult: "GetPreferredStreamResult", HydratorWrongMediaType: "HydratorWrongMediaType", ImmersiveDetailsMetaDataUpdated: "ImmersiveDetailsMetaDataUpdated", MediaPlayerMusicPlayback: "MediaPlayerMusicPlayback", MediaPlayerVideoPlayback: "MediaPlayerVideoPlayback", MediaUsageEvent: "MediaUsageEvent", MuteStateSelected: "MuteStateSelected", ModifierUsage: "ModifierUsage", NetworkService: "NetworkService", NotificationUsage: "NotificationUsage", PageAction: "PageAction", PageView: "PageView", PaymentInstrumentationResponse: "PaymentInstrumentationResponse", PlayAllMusic: "PlayAllMusic", PlaybackAttempted: "PlaybackAttempted", PlaybackControl: "PlaybackControl", PlaybackError: "PlaybackError", PlaybackErrorConvertedToGeneric: "PlaybackErrorConvertedToGeneric", PlaybackHappened: "PlaybackHappened", PlayerBufferState: "PlayerBufferState", PlayToReceiverError: "PlayToReceiverError", PlayToReceiverPlaybackError: "PlayToReceiverPlaybackError", PlayToReceiverSessionCompleted: "PlayToReceiverSessionCompleted", PlayToReceiverSessionRequested: "PlayToReceiverSessionRequested", PlayToSenderAttempted: "PlayToSenderAttempted", PlayToSenderError: "PlayToSenderError", PlayToSenderPlaybackHappened: "PlayToSenderPlaybackHappened", PopoverDisplay: "PopoverDisplay", PreviewPlayed: "PreviewPlayed", PurchaseEntitlementsNotFound: "PurchaseEntitlementsNotFound", PurchaseMade: "PurchaseMade", PurchaseResponse: "PurchaseResponse", PurchaseReviewStart: "PurchaseReviewStart", RecentUpsellPanelShown: "RecentUpsellPanelShown", ReactiveLicenseAcquisition: "ReactiveLicenseAcquisition", RootLicenseAcquisition: "RootLicenseAcquisition", SearchEnter: "SearchEnter", SearchExit: "SearchExit", SearchGlyphClick: "SearchGlyphClick", SearchPanelLaunch: "SearchPanelLaunch", SearchPanelLaunchFailure: "SearchPanelLaunchFailure", SearchQuerySubmitted: "SearchQuerySubmitted", SearchWordWheelEnter: "SearchWordWheelEnter", SemanticZoom: "SemanticZoom", SendASmile: "Send A Smile", Settings: "Settings", ShareCharm: "ShareCharm", ShareEDSWebQueryComplete: "ShareEDSWebQueryInitiated", ShareEDSWebQueryInitiated: "ShareEDSWebQueryInitiated", SignIn: "SignIn", SignInWelcomePanel: "SignInWelcomePanel", SignOut: "SignOut", SubscriptionDetail: "SubscriptionDetail", SubscriptionSignupPrePurchase: "SubscriptionSignupPrePurchase", SubscriptionSignupPurchaseMade: "SubscriptionSignupPurchaseMade", UIFailure: "UIFailure", UnknownDriveBrowse: "UnknownDriveBrowse", UpsellDialogDisplayed: "UpsellDialogDisplayed", UsbDriveBrowse: "UsbDriveBrowse", UserEngagementCollectionMessageClicked: "UserEngagementCollectionMessageClicked", UserEngagementExternalLinkClicked: "UserEngagementExternalLinkClicked", UserEngagementMessageClick: "UserEngagementMessageClick", UserEngagementMessageDisplayed: "UserEngagementMessageDisplayed", VideoPostRollAction: "VideoPostRollAction", VideoPrePurchaseBlocked: "VideoPrePurchaseBlocked", VolumeSelected: "VolumeSelected", WebBlendError: "WebBlendError", WebBlendLaunch: "WebBlendLaunch", WelcomePageEntered: "WelcomePageEntered", WelcomePanelDismissed: "WelcomePanelDismissed", WelcomePanelStartButtonClicked: "WelcomePanelStartButtonClicked", WhatsNewDismissed: "WhatsNewDismissed", X8AdClicked: "X8AdClicked", X8NewPage: "X8NewPage", X8UsageTime: "X8UsageTime"
+ }, TelemetryParameterNames: {
+ ABGroupName: "ABGroupName", ABTestName: "ABTestName", AcceptTermsOfService: "AcceptTermsOfService", AcquisitionContext: "AcquisitionContext", AcquisitionContextId: "AcquisitionContextId", AcquisitionContextType: "AcquisitionContextType", AcquisitionType: "AcquisitionType", ActionInputMethodId: "ActionInputMethodId", actionType: "actionType", ActionTypeId: "ActionTypeId", AdInfo: "AdInfo", AdditionalContext: "AdditionalContext", AppMode: "AppMode", ArtistServiceId: "ArtistServiceId", AudioCodec: "AudioCodec", AuthHeaderResultText: "AuthHeaderResultText", AuthState: "AuthState", AutomationId: "AutomationId", BingMediaId: "BingMediaId", Bitrate: "Bitrate", BlockPurchaseAllItemFoundOnce: "BlockPurchaseAllItemFoundOnce", BlockPurchaseDatabaseRights: "BlockPurchaseDatabaseRights", BlockPurchaseServiceFailure: "BlockPurchaseServiceFailure", BlockPurchaseServicePurchaseRights: "BlockPurchaseServicePurchaseRights", BlockPurchaseServiceRentalRights: "BlockPurchaseServiceRentalRights", BlockPurchaseRentalConfigSetting: "BlockPurchaseRentalConfigSetting", BlockPurchaseTotalItems: "BlockPurchaseTotalItems", BufferEnd: "BufferEnd", BufferStart: "BufferStart", CampaignId: "CampaignId", CanonicalId: "CanonicalId", CanSignOut: "CanSignOut", ColorDepth: "ColorDepth", commandId: "commandId", commandLabel: "commandLabel", CommentText: "CommentText", Content: "Content", ContentID: "ContentID", ContentIssueType: "ContentIssueType", ContentJsonVersion: "ContentJsonVersion", ContentType: "ContentType", Context: "Context", ControlUsed: "ControlUsed", CorrelationID: "CorrelationID", CreateAccount: "CreateAccount", CurrentPage: "currentPage", CurrentPosition: "CurrentPosition", defaultPlatformType: "defaultPlatformType", DeliveryFormat: "DeliveryFormat", DestPageTypeId: "DestPageTypeId", DestPageURI: "DestPageURI", DialogType: "DialogType", DisplayPrice: "DisplayPrice", DistributionRight: "DistributionRight", DMRFriendlyName: "DMRFriendlyName", DriveSize: "DriveSize", DriveType: "DriveType", DlnaManufacturer: "DlnaManufacturer", DlnaModelName: "DlnaModelName", DlnaModelNumber: "DlnaModelNumber", Duration: "Duration", EdsMediaType: "EdsMediaType", EDSSearch: "EDSSearch", Error: "Error", ErrorCode: "ErrorCode", ErrorContext: "ErrorContext", ErrorId: "ErrorId", ErrorTimestamp: "ErrorTimestamp", EventTime: "EventTime", EventType: "EventType", ExpectedMediaType: "ExpectedEdsMediaType", executeLocation: "executeLocation", ExtendedCode: "ExtendedCode", Extension: "Extension", ExternalLink: "ExternalLink", FeedbackType: "FeedbackType", FileType: "FileType", ForceSignOut: "ForceSignOut", FreePlaysLeft: "FreePlaysLeft", FromAd: "FromAd", FromCollection: "FromCollection", FromPreview: "FromPreview", GroupId: "GroupId", HasLocalContent: "HasLocalContent", HasPurchasedCount: "HasPurchasedCount", HCR: "HCR", hub: "hub", Id: "Id", InCollection: "InCollection", InteractiveUri: "InteractiveUri", IsDrm: "IsDrm", IsLibraryQuery: "IsLibraryQuery", IsNewNotification: "IsNewNotification", IsNextMediaInstance: "IsNextMediaInstance", IsPreview: "IsPreview", IsStream: "IsStream", IsSubscription: "IsSubscription", IssueType: "IssueType", ItemCount: "ItemCount", ItemType: "ItemType", itemTypeQueryString: "itemTypeQueryString", Kid: "Kid", Label: "Label", LastUIPath: "LastUIPath", LiveMembershipLevel: "LiveMembershipLevel", licenseRight: "licenseRight", LicenseRight: "LicenseRight", Location: "Location", MediaId: "MediaId", MediaItem: "MediaItem", MediaItemInstanceId: "MediaItemInstanceId", MediaLengthMs: "MediaLengthMs", MediaName: "MediaName", mediaName: "mediaName", MediaType: "MediaType", mediaType: "mediaType", Message: "Message", MessageText: "MessageText", MethodInitiated: "MethodInitiated", Miid: "Miid", MusicPlaybackBackground: "MusicPlaybackBackground", MusicPlaybackSnapped: "MusicPlaybackSnapped", MusicPlaybackUnsnapped: "MusicPlaybackUnsnapped", MuteState: "MuteState", name: "name", NetworkStatus: "NetworkStatus", NoConnectedAccount: "NoConnectedAccount", NotificationCategory: "NotificationCategory", NotificationTitle: "NotificationTitle", NotSnapped: "NotSnapped", OfferId: "OfferId", Orientation: "Orientation", OSVersion: "OSVersion", page: "page", PageName: "PageName", PageParameters: "PageParameters", PageTags: "PageTags", PageTypeId: "PageTypeId", PageURI: "PageURI", ParentProductGuid: "ParentProductGuid", ParentSmid: "ParentSmid", PivotSelected: "PivotSelected", PlayabilityCloudCounts: "PlayabilityCloudCounts", PlayabilityLocalCounts: "PlayabilityLocalCounts", PlaybackDurationMs: "PlaybackDurationMs", PlaybackSource: "PlaybackSource", PlayerType: "PlayerType", PlayLocation: "PlayLocation", PlayToType: "PlayToType", PurchaseEntitlementsFailureHasFailures: "PurchaseEntitlementsFailureHasFailures", PurchaseEntitlementsFailureAddedEntitlements: "PurchaseEntitlementsFailureAddedEntitlements", MFSRAudioSubtype: "MFSRAudioSubtype", MFSRVideoSubtype: "MFSRVideoSubtype", MFSRMimeType: "MFSRMimeType", MFSRSourceCharacter: "MFSRSourceCharacter", MFSRError: "MFSRError", MFSRIsDRM: "MFSRIsDRM", Position: "Position", Price: "Price", ProductCatalogId: "ProductCatalogId", ProductGuid: "ProductGuid", ProductId: "ProductId", ProtectionState: "ProtectionState", ProviderMediaId: "ProviderMediaId", ProviderMediaInstanceId: "ProviderMediaInstanceId", PurchaseHistoryServiceIsGroveling: "PurchaseHistoryServiceIsGroveling", PurchaseFlowId: "PurchaseFlowId", queryId: "queryId", Reason: "Reason", RefererPageTypeId: "RefererPageTypeId", RefererPageURI: "RefererPageURI", RefreshSignInResult: "RefreshSignInResult", ResolutionHeight: "ResolutionHeight", ResolutionWidth: "ResolutionWidth", Result: "Result", Retries: "Retries", ScreenSize: "ScreenSize", ScreenState: "ScreenState", SearchDestination: "SearchDestination", SearchHCRMediaName: "SearchHCRMediaName", SearchHCRMediaType: "SearchHCRMediaType", SearchImpressionGuid: "SearchImpressionGuid", secondaryGamerTag: "secondaryGamerTag", SelectedItemMediaType: "SelectedItemMediaType", SelectedItemTitle: "SelectedItemTitle", seriesId: "seriesId", ServiceId: "ServiceId", serviceId: "serviceId", SettingsAccountUsage: "SettingsAccountUsage", SettingsHelpUsage: "SettingsHelpUsage", ShareTitle: "ShareTitle", ShareUri: "ShareUri", ShareUrl: "ShareUrl", SignedOfferGuid: "SignedOfferGuid", SignInDuration: "SignInDuration", SignInResult: "SignInResult", SignOutResult: "SignOutResult", SkinId: "SkinId", SMID: "SMID", Smid: "Smid", SnappedMode: "SnappedMode", StackTrace: "StackTrace", State: "State", Status: "Status", Success: "Success", SystemErrorCode: "SystemErrorCode", TaskId: "taskId", TemplateId: "TemplateId", TimeSpent: "TimeSpent", Title: "Title", titleId: "titleId", titleType: "titleType", TotalAudioAdImpressions: "TotalAudioAdImpressions", TotalVideoAdImpressions: "TotalVideoAdImpressions", TrackCount: "TrackCount", TracksLeft: "TracksLeft", UIPart: "UIPart", UIPath: "UIPath", UnsupportedRegion: "UnsupportedRegion", Url: "Url", UserId: "UserId", Users: "Users", VideoCodec: "VideoCodec", VideoPlaybackBackground: "VideoPlaybackBackground", VideoPlaybackSnapped: "VideoPlaybackSnapped", VideoPlaybackUnsnapped: "VideoPlaybackUnsnapped", VideoPostRollAction: "VideoPostRollAction", VolumeValue: "VolumeValue", WhatsNewShownDuration: "WhatsNewOpenedDuration", WhereUsed: "WhereUsed", XCorrelationId: "XCorrelationId", ZuneId: "ZuneId", ZunePass: "ZunePass"
+ }, TelemetryParameterValues: {
+ Album: "Album", AppBar: "AppBar", Artist: "Artist", background: "background", BillingContactInfoClick: "BillingContactInfoClick", BillingHistoryClick: "BillingHistoryClick", Cancel: "Cancel", CancelSubscriptionSuccess: "CancelSubscriptionSuccess", CancelSubscriptionError: "CancelSubscriptionError", ContactPreferencesClick: "ContactPreferencesClick", Docked: "Docked", Download: "Download", End: "End", Error: "Error", Full: "Full", Game: "Game", GlobalAppbar: "GlobalAppbar", HomeNPTile: "HomeNPTile", Immersive: "Immersive", LoadXboxAccountSummaryPage: "LoadXboxAccountSummaryPage", ManageMusicDevices: "ManageMusicDevices", ManagePaymentOptionsClick: "ManagePaymentOptionsClick", MediaKey: "MediaKey", Minimized: "Minimized", Movie: "Movie", MusicAd: "MusicAd", MusicHelpClicked: "MusicHelpClicked", MusicPassSubscribeClick: "MusicPassSubscribeClick", MusicPreview: "MusicPreview", MusicTransportControls: "MusicTransportControls", MusicVideo: "MusicVideo", Next: "Next", None: "None", nowplaying: "nowplaying", NowPlaying: "NowPlaying", Overlay: "Overlay", Pause: "Pause", Play: "Play", Playlist: "Playlist", PlayToByRef: "PlayToByRef", PlayToUGC: "PlayToUGC", Popover: "Popover", Previous: "Previous", Purchase: "Purchase", PrivacyClick: "PrivacyClick", RedeemCodeClick: "RedeemCodeClick", Rental: "Rental", Resume: "Resume", Skip: "Skip", Song: "Song", snapped: "snapped", SnappedAppBar: "SnappedAppBar", Stop: "Stop", Success: "Success", TVEpisode: "TV Episode", TVSeason: "TV Season", TVSeries: "TV Series", unknown: "unknown", Unknown: "Unknown", UnknownHelpClicked: "UnknownHelpClicked", UserAccountLinkClicked: "UserAccountLinkClicked", VideoHelpClicked: "VideoHelpClicked", VideoPreview: "VideoPreview", VoiceCommand: "VoiceCommand"
+ }, KeystoneEvents: {
+ AppHeartbeat: "app_heartbeat", Purchase: "kpi_purchase"
+ }, KeystoneParameterNames: {
+ Mode: "mode", PreviousSessionId: "previous_session_id", OfferId: "offer_id", MediaType: "media_type", MediaName: "media_name", MediaId: "media_id", CorrelationId: "correlation_id", Price: "price", MediaInstanceId: "media_instance_id", VideoDefinition: "video_definition", VideoCodec: "video_codec", AudioLanguage: "audio_language", AudioEncoding: "audio_encoding", VideoFileUrl: "video_file_url", HasCaptions: "has_captions", DeliveryFormat: "delivery_format", PaymentInstruments: "payment_instruments", AcquisitionType: "acquisition_type", BingId: "bing_id", ZuneId: "zune_id", Locale: "locale", UiPath: "ui_path", State: "state"
+ }, PurchaseStates: {
+ Succeeded: "succeeded", Canceled: "canceled", Failed: "failed"
+ }
+ })
+})()
+})();
+/* >>>>>>/framework/usertimetelemetrymanager.js:14856 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ UserTimeTelemetryManager: MS.Entertainment.UI.Framework.define(function UserTimeTelemetryManager() {
+ this._musicPlaybackTimeTracker = new MS.Entertainment.Framework.PlaybackTimeTracker("Music");
+ this._videoPlaybackTimeTracker = new MS.Entertainment.Framework.PlaybackTimeTracker("Video");
+ var now = Date.now();
+ this._totalTimeCounterStart = now;
+ this._snappedModeTimeCounterStart = now;
+ this._unsnappedModeTimeCounterStart = now;
+ try {
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._userUsageTimeout = this._configuration.telemetry.userTimeEventTimeout
+ }
+ catch(e) {
+ MS.Entertainment.Framework.fail("Failed to access config to get the user time event timeout " + e.toString());
+ this._userUsageTimeout = 900000
+ }
+ if (!MS.Entertainment.Utilities.isTestApp && this._userUsageTimeout && this._userUsageTimeout > 0)
+ this._eventFireTimerPromise = WinJS.Promise.timeout(this._userUsageTimeout).then(this._fireTimerTelemetry.bind(this))
+ }, {
+ _totalTimeCounterStart: 0, _accumulatedTotalTime: 0, _snappedModeTimeCounterStart: 0, _accumulatedSnappedTime: 0, _unsnappedModeTimeCounterStart: 0, _accumulatedUnsnappedTime: 0, _musicPlaybackTimeTracker: null, _videoPlaybackTimeTracker: null, _configuration: null, _startedSnapped: false, _viewModeSwitched: false, _userUsageTimeout: 0, _eventFireTimerPromise: null, _sendDataPoint: function _sendDataPoint() {
+ var totalTime = 0;
+ var snappedTime = 0;
+ var notSnappedTime = 0;
+ var invalidNumbers = false;
+ if (!this._configuration)
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this._configuration.telemetry.timeSpent) {
+ totalTime = this._configuration.telemetry.timeSpent;
+ snappedTime = this._configuration.telemetry.snappedMode;
+ notSnappedTime = this._configuration.telemetry.notSnapped;
+ if ((totalTime < 0) || (snappedTime < 0) || (notSnappedTime < 0))
+ invalidNumbers = true;
+ if (!invalidNumbers) {
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.TimeSpent, parameterValue: totalTime
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SnappedMode, parameterValue: snappedTime
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NotSnapped, parameterValue: notSnappedTime
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MusicPlaybackBackground, parameterValue: this._configuration.telemetry.musicPlaybackBackground
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MusicPlaybackSnapped, parameterValue: this._configuration.telemetry.musicPlaybackSnapped
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.MusicPlaybackUnsnapped, parameterValue: this._configuration.telemetry.musicPlaybackUnsnapped
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VideoPlaybackBackground, parameterValue: this._configuration.telemetry.videoPlaybackBackground
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VideoPlaybackSnapped, parameterValue: this._configuration.telemetry.videoPlaybackSnapped
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.VideoPlaybackUnsnapped, parameterValue: this._configuration.telemetry.videoPlaybackUnsnapped
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.X8UsageTime, telemetryParameterArray)
+ }
+ this._configuration.telemetry.timeSpent = 0;
+ this._configuration.telemetry.snappedMode = 0;
+ this._configuration.telemetry.notSnapped = 0;
+ this._configuration.telemetry.musicPlaybackBackground = 0;
+ this._configuration.telemetry.musicPlaybackSnapped = 0;
+ this._configuration.telemetry.musicPlaybackUnsnapped = 0;
+ this._configuration.telemetry.videoPlaybackBackground = 0;
+ this._configuration.telemetry.videoPlaybackSnapped = 0;
+ this._configuration.telemetry.videoPlaybackUnsnapped = 0
+ }
+ if (!this._eventFireTimerPromise)
+ if (this._userUsageTimeout && this._userUsageTimeout > 0)
+ this._eventFireTimerPromise = WinJS.Promise.timeout(this._userUsageTimeout).then(this._fireTimerTelemetry.bind(this))
+ }, appActivated: function appActivated() {
+ this._sendDataPoint();
+ this._startedSnapped = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped
+ }, appResumed: function appResumed() {
+ var now = Date.now();
+ this._sendDataPoint();
+ this._totalTimeCounterStart = now;
+ this._accumulatedTotalTime = 0;
+ this._snappedModeTimeCounterStart = now;
+ this._accumulatedSnappedTime = 0;
+ this._unsnappedModeTimeCounterStart = now;
+ this._accumulatedUnsnappedTime = 0;
+ this._viewModeSwitched = false;
+ this._startedSnapped = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped;
+ var sessionManager = MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager);
+ if (sessionManager) {
+ var currentSession = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager).nowPlayingSession;
+ if (currentSession && currentSession.currentMedia && currentSession.currentTransportState === MS.Entertainment.Platform.Playback.TransportState.playing)
+ if (MS.Entertainment.Platform.PlaybackHelpers.isVideo(currentSession.currentMedia))
+ this._videoPlaybackTimeTracker.playbackStart();
+ else if (MS.Entertainment.Platform.PlaybackHelpers.isMusicOrMusicVideo(currentSession.currentMedia))
+ this._musicPlaybackTimeTracker.playbackStart()
+ }
+ }, _fireTimerTelemetry: function _fireTimerTelemetry() {
+ this.appSuspended();
+ this.appResumed()
+ }, appSuspended: function appSuspended() {
+ if (!this._configuration)
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var backgroundTime = 0;
+ this._musicPlaybackTimeTracker.playbackStop();
+ this._videoPlaybackTimeTracker.playbackStop();
+ if (this._eventFireTimerPromise) {
+ this._eventFireTimerPromise.cancel();
+ this._eventFireTimerPromise = null
+ }
+ if (MS.Entertainment.Utilities.isMusicApp)
+ backgroundTime = this._musicPlaybackTimeTracker.accumulatedBackgroundPlaybackTime;
+ this._musicPlaybackTimeTracker.dumpDataPoints();
+ this._videoPlaybackTimeTracker.dumpDataPoints();
+ var accumulatedTotalTimeChange = Date.now() - this._totalTimeCounterStart;
+ this._accumulatedTotalTime += accumulatedTotalTimeChange;
+ this._accumulatedUnsnappedTime += backgroundTime;
+ try
+ {
+ if (this._viewModeSwitched) {
+ this._fixCurrentAccumulatedTime();
+ this._configuration.telemetry.snappedMode = this._accumulatedSnappedTime;
+ this._configuration.telemetry.notSnapped = this._accumulatedUnsnappedTime
+ }
+ else if (this._startedSnapped) {
+ this._configuration.telemetry.snappedMode = this._accumulatedTotalTime / 1000;
+ this._configuration.telemetry.notSnapped = "0"
+ }
+ else {
+ this._configuration.telemetry.snappedMode = "0";
+ this._configuration.telemetry.notSnapped = this._accumulatedTotalTime / 1000
+ }
+ this._configuration.telemetry.timeSpent = this._accumulatedTotalTime / 1000
+ }
+ catch(exception) {
+ MS.Entertainment.Framework.fail("exception in suspend " + exception.toString())
+ }
+ }, _fixCurrentAccumulatedTime: function _fixCurrentAccumulatedTime() {
+ var now = Date.now();
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped) {
+ var accumulatedSnappedChange = now - this._snappedModeTimeCounterStart;
+ this._accumulatedSnappedTime += (accumulatedSnappedChange / 1000)
+ }
+ else {
+ var accumulatedUnsnappedChange = now - this._unsnappedModeTimeCounterStart;
+ this._accumulatedUnsnappedTime += (accumulatedUnsnappedChange / 1000)
+ }
+ }, switchedToSnappedMode: function switchedToSnappedMode() {
+ var now = Date.now();
+ var accumulatedUnsnappedChange = now - this._unsnappedModeTimeCounterStart;
+ this._accumulatedUnsnappedTime += (accumulatedUnsnappedChange / 1000);
+ this._unsnappedModeTimeCounterStart = now;
+ this._snappedModeTimeCounterStart = now;
+ this._musicPlaybackTimeTracker.snappedModeChanged();
+ this._videoPlaybackTimeTracker.snappedModeChanged();
+ this._viewModeSwitched = true
+ }, switchedToUnsnappedMode: function switchedToUnsnappedMode() {
+ var now = Date.now();
+ var accumulatedSnappedChange = now - this._snappedModeTimeCounterStart;
+ this._accumulatedSnappedTime += (accumulatedSnappedChange / 1000);
+ this._snappedModeTimeCounterStart = now;
+ this._unsnappedModeTimeCounterStart = now;
+ this._musicPlaybackTimeTracker.snappedModeChanged();
+ this._videoPlaybackTimeTracker.snappedModeChanged();
+ this._viewModeSwitched = true
+ }, appVisibilityChanged: function appVisibilityChanged() {
+ if (!MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible) {
+ var accumulatedTotalTimeChange = Date.now() - this._totalTimeCounterStart;
+ this._accumulatedTotalTime += accumulatedTotalTimeChange;
+ if (this._viewModeSwitched)
+ this._fixCurrentAccumulatedTime()
+ }
+ else {
+ var now = Date.now();
+ this._snappedModeTimeCounterStart = now;
+ this._unsnappedModeTimeCounterStart = now;
+ this._totalTimeCounterStart = now
+ }
+ this._musicPlaybackTimeTracker.appVisibilityChanged();
+ this._videoPlaybackTimeTracker.appVisibilityChanged()
+ }, musicPlaybackStart: function musicPlaybackStart() {
+ this._musicPlaybackTimeTracker.playbackStart()
+ }, videoPlaybackStart: function videoPlaybackStart() {
+ this._videoPlaybackTimeTracker.playbackStart()
+ }, musicPlaybackStop: function musicPlaybackStop() {
+ this._musicPlaybackTimeTracker.playbackStop()
+ }, videoPlaybackStop: function videoPlaybackStop() {
+ this._videoPlaybackTimeTracker.playbackStop()
+ }
+ }, null), PlaybackTimeTracker: MS.Entertainment.UI.Framework.define(function PlaybackTimeTracker(name) {
+ this._name = name
+ }, {
+ accumulatedUnsnappedPlaybackTime: 0, accumulatedSnappedPlaybackTime: 0, accumulatedBackgroundPlaybackTime: 0, _playbackTimeCounterStart: 0, _isSnapped: false, _isVisible: false, _name: "", _configuration: null, _accumulatedBackgroundConfig: null, _accumulatedSnappedConfig: null, _accumulatedUnsnappedConfig: null, lastStateChange: 0, currentlyPlaying: false, _sleepTimeFudgeFactor: 1500000, snappedModeChanged: function switchedSnappedMode() {
+ if (this._playbackTimeCounterStart !== 0)
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped !== this._isSnapped) {
+ this.playbackStop();
+ this.playbackStart()
+ }
+ }, appVisibilityChanged: function appVisibilityChanged() {
+ if (this._playbackTimeCounterStart !== 0)
+ if (MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible !== this._isVisible) {
+ this.playbackStop();
+ this.playbackStart()
+ }
+ }, playbackStart: function playbackStart() {
+ this.playbackStop();
+ this._playbackTimeCounterStart = Date.now();
+ this._isSnapped = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isSnapped;
+ this._isVisible = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).isAppVisible
+ }, playbackStop: function playbackStop() {
+ var now = Date.now();
+ if (this._playbackTimeCounterStart !== 0) {
+ if (this._isVisible)
+ if (this._isSnapped)
+ this.accumulatedSnappedPlaybackTime += (now - this._playbackTimeCounterStart) / 1000;
+ else
+ this.accumulatedUnsnappedPlaybackTime += (now - this._playbackTimeCounterStart) / 1000;
+ else if (this._name === "Music") {
+ if (now - this.lastStateChange <= this._sleepTimeFudgeFactor)
+ this.accumulatedBackgroundPlaybackTime += (now - this._playbackTimeCounterStart) / 1000
+ }
+ else
+ this.accumulatedBackgroundPlaybackTime += (now - this._playbackTimeCounterStart) / 1000;
+ this._playbackTimeCounterStart = 0;
+ this.lastStateChange = now
+ }
+ }, dumpDataPoints: function dumpDataPoints(dataPoint) {
+ try {
+ if (!this._configuration)
+ this._configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this._name === "Music") {
+ this._configuration.telemetry.musicPlaybackBackground = this.accumulatedBackgroundPlaybackTime;
+ this._configuration.telemetry.musicPlaybackSnapped = this.accumulatedSnappedPlaybackTime;
+ this._configuration.telemetry.musicPlaybackUnsnapped = this.accumulatedUnsnappedPlaybackTime
+ }
+ else if (this._name === "Video") {
+ this._configuration.telemetry.videoPlaybackBackground = this.accumulatedBackgroundPlaybackTime;
+ this._configuration.telemetry.videoPlaybackSnapped = this.accumulatedSnappedPlaybackTime;
+ this._configuration.telemetry.videoPlaybackUnsnapped = this.accumulatedUnsnappedPlaybackTime
+ }
+ this.accumulatedBackgroundPlaybackTime = 0;
+ this.accumulatedSnappedPlaybackTime = 0;
+ this.accumulatedUnsnappedPlaybackTime = 0
+ }
+ catch(error) {}
+ }
+ }, null)
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.userTimeTelemetryManager, function getUserTimeTelemetryManager() {
+ return new MS.Entertainment.Framework.UserTimeTelemetryManager
+ }, true);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager)
+})()
+})();
+/* >>>>>>/monikers.js:15109 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {Monikers: {
+ actorDetailsPage: "actorDetailsPage", albumDetails: "albumDetails", albumMusicVideos: "albumMusicVideos", albumMusicVideosMarketplace: "albumMusicVideosMarketplace", allVideoCollection: "allVideoCollection", allVideoCollectionPanel: "allVideoCollectionPanel", artistAlbums: "artistAlbums", artistAlbumsCollection: "artistAlbumsCollection", artistAlbumsMarketplace: "artistAlbumsMarketplace", artistMusicVideos: "artistMusicVideos", artistMusicVideosMarketplace: "artistMusicVideosMarketplace", artistSearchAction: "artistSearchAction", artistSearchActionPivot: "artistSearchActionPivot", browseByActor: "browseByActor", browseByActorHub: "browseByActorHub", browseMoviesByActor: "browseMoviesByActor", browseTVSeriesByActor: "browseTVSeriesByActor", companionFeatured: "companionFeatured", companionFeaturedGamesPanel: "companionFeaturedGamesPanel", companionFeaturedMusicPanel: "companionFeaturedMusicPanel", companionFeaturedMoviesPanel: "companionFeaturedMoviesPanel", companionFeaturedTVPanel: "companionFeaturedTVPanel", companionNowPlaying: "companionNowPlaying", companionNowPlayingPanel: "companionNowPlayingPanel", companionQuickplay: "companionQuickplay", companionQuickplayPanel: "companionQuickplayPanel", companionSearch: "companionSearch", companionSearchPanel: "companionSearchPanel", dashboard: "dashboard", fullScreenNowPlaying: "fullScreenNowPlaying", homeHub: "homeHub", homeSpotlight: "homeSpotlight", filteredMovieMarketplace: "filteredMovieMarketplace", filteredTvMarketplace: "filteredTvMarketplace", filteredMovieMarketplaceSingleStudio: "filteredMovieMarketplaceSingleStudio", filteredMovieMarketplaceSingleStudioPanel: "filteredMovieMarketplaceSingleStudioPanel", filteredTvMarketplaceSingleNetwork: "filteredTvMarketplaceSingleNetwork", filteredTvMarketplaceSingleNetworkPanel: "filteredTvMarketplaceSingleNetworkPanel", flexHubPage: "flexHubPage", flexHub: "flexHub", flexHubPanel: "flexHubPanel", featuredSetsPage: "featuredSetsPage", featuredSets: "featuredSets", featuredSetsPanel: "featuredSetsPanel", immersiveDetails: "immersiveDetails", albumsSearch: "albumsSearch", allMusicSearch: "allMusicSearch", allVideoSearch: "allVideoSearch", allVideoSearchPanel: "allVideoSearchPanel", artistsSearch: "artistsSearch", searchPage: "searchPage", playlistsSearch: "playlistsSearch", playlistDetails: "playlistDetails", tracksSearch: "tracksSearch", musicVideosSearch: "musicVideosSearch", movieCollection: "movieCollection", movieCollectionPanel: "movieCollectionPanel", movieDetailsPage: "movieDetailsPage", movieMarketplace: "movieMarketplace", movieMarketplaceFeatured: "movieMarketplaceFeatured", movieMarketplaceFeaturedPanel: "movieMarketplaceFeaturedPanel", movieMarketplaceNewReleases: "movieMarketplaceNewReleases", movieMarketplaceNewReleasesPanel: "movieMarketplaceNewReleasesPanel", movieMarketplaceTopPurchased: "movieMarketplaceTopPurchased", movieMarketplaceTopPurchasedPanel: "movieMarketplaceTopPurchasedPanel", movieMarketplaceTopRented: "movieMarketplaceTopRented", movieMarketplaceTopRentedPanel: "movieMarketplaceTopRentedPanel", movieMarketplaceTopRated: "movieMarketplaceTopRated", movieMarketplaceTopRatedPanel: "movieMarketplaceTopRatedPanel", movieMarketplaceHub: "movieMarketplaceHub", movieMarketplacePanel: "movieMarketplacePanel", movieMarketplacePanel2: "movieMarketplacePanel2", movieRecommendations: "movieRecommendations", movieRecommendationsPanel: "movieRecommendationsPanel", movieSpotlight: "movieSpotlight", studioAndNetworkGallery: "studioAndNetworkGallery", movieStudioGalleryHub: "movieStudioGalleryHub", movieStudioGalleryHubPanel: "movieStudioGalleryHubPanel", movieTrailerBrowse: "movieTrailerBrowse", musicHub: "musicHub", musicCollection: "musicCollection", musicCollectionHub: "musicCollectionHub", musicCollectionPanel: "musicCollectionPanel", musicPlaylistCollection: "musicPlaylistCollection", musicMarketplace: "musicMarketplace", musicMarketplaceAlbums: "musicMarketplaceAlbums", musicMarketplaceAlbumsPanel: "musicMarketplaceAlbumsPanel", musicMarketplaceArtists: "musicMarketplaceArtists", musicMarketplaceArtistsPanel: "musicMarketplaceArtistsPanel", musicMarketplaceFeatured: "musicMarketplaceFeatured", musicMarketplaceFeaturedPanel: "musicMarketplaceFeaturedPanel", musicMarketplaceGenres: "musicMarketplaceGenres", musicMarketplaceGenresPanel: "musicMarketplaceGenresPanel", musicMarketplaceHub: "musicMarketplaceHub", musicMarketplacePanel: "musicMarketplacePanel", musicCollectionByAlbum: "musicCollectionByAlbum", musicCollectionByAlbumPanel: "musicCollectionByAlbumPanel", musicCollectionByArtist: "musicCollectionByArtist", musicCollectionByArtistPanel: "musicCollectionByArtistPanel", musicCollectionSmartDJs: "musicCollectionSmartDJs", musicCollectionSmartDJsPivot: "musicCollectionSmartDJsPivot", musicCollectionBySong: "musicCollectionBySong", musicCollectionBySongPanel: "musicCollectionBySongPanel", musicCollectionPlaylists: "musicCollectionPlaylists", musicCollectionPlaylistsPanel: "musicCollectionPlaylistsPanel", musicCollectionNewlyAdded: "musicCollectionNewlyAdded", musicCollectionMusicVideos: "musicCollectionMusicVideos", musicExploreHub: "musicExploreHub", musicNewReleases: "musicNewReleases", musicNewReleasesPanel: "musicNewReleasesPanel", musicNewReleasesGallery: "musicNewReleasesGallery", musicNewVideosGallery: "musicNewVideosGallery", musicPopularGallery: "musicPopularGallery", musicRecentsPanel: "musicRecentsPanel", musicSmartDJs: "musicSmartDJs", musicSmartDJsPanel: "musicSmartDJsPanel", musicTopMusic: "musicTopMusic", musicTopArtistsPanel: "musicTopArtistsPanel", musicTopAlbumsPanel: "musicTopAlbumsPanel", musicTopVideosPanel: "musicTopVideosPanel", musicVideoCollection: "musicVideoCollection", musicVideoCollectionPanel: "musicVideoCollectionPanel", navigationPopover: "navigationPopover", otherVideoCollection: "otherVideoCollection", otherVideoCollectionPanel: "otherVideoCollectionPanel", playToSpinner: "playToSpinner", playToLandingPage: "playToLandingPage", recommendationsPage: "recommendationsPage", recommendations: "recommendations", recommendationsPanel: "recommendationsPanel", root: "root", searchHub: "searchHub", selectPlaylist: "selectPlaylist", selectPlaylistPivot: "selectPlaylistPivot", tempMusicPanel: "tempMusicPanel", tempSocialPanel: "tempSocialPanel", tempVideoPanel: "tempVideoPanel", tvCollection: "tvCollection", tvCollectionPanel: "tvCollectionPanel", tvDetailsPage: "tvDetailsPage", tvMarketplace: "tvMarketplace", tvMarketplaceFeatured: "tvMarketplaceFeatured", tvMarketplaceFeaturedPanel: "tvMarketplaceFeaturedPanel", tvMarketplaceNewReleases: "tvMarketplaceNewReleases", tvMarketplaceNewReleasesPanel: "tvMarketplaceNewReleasesPanel", tvMarketplaceLastNight: "tvMarketplaceLastNight", tvMarketplaceLastNightPanel: "tvMarketplaceLastNightPanel", tvMarketplaceTopPurchased: "tvMarketplaceTopPurchased", tvMarketplaceTopPurchasedPanel: "tvMarketplaceTopPurchasedPanel", tvMarketplaceTopRated: "tvMarketplaceTopRated", tvMarketplaceTopRatedPanel: "tvMarketplaceTopRatedPanel", tvMarketplaceGenres: "tvMarketplaceGenres", tvMarketplaceGenresPanel: "tvMarketplaceGenresPanel", tvMarketplaceHub: "tvMarketplaceHub", tvMarketplaceNetworks: "tvMarketplaceNetworks", tvMarketplaceNetworksPanel: "tvMarketplaceNetworksPanel", tvMarketplacePanel: "tvMarketplacePanel", tvMarketplacePanel2: "tvMarketplacePanel2", tvNetworkGallery: "tvNetworkGallery", tvNetworkGalleryHub: "tvNetworkGalleryHub", tvNetworkGalleryHubPanel: "tvNetworkGalleryHubPanel", tvRecommendations: "tvRecommendations", tvRecommendationsPanel: "tvRecommendationsPanel", tvSpotlight: "tvSpotlight", videoHub: "videoHub", videoHubIsolated: "videoHubIsolated", videoCollection: "videoCollection", videoCollectionHub: "videoCollectionHub", videoCollectionPanel: "videoCollectionPanel", videoMarketplace: "videoMarketplace", videoMovieCollectionPanel: "videoMovieCollectionPanel", videoOtherCollectionPanel: "videoOtherCollectionPanel", videoTvCollectionPanel: "videoTvCollectionPanel", videoWatchlist: "videoWatchlist", videoWatchlistPage: "videoWatchlistPage", videoWatchlistPanel: "videoWatchlistPanel", movieStorePage: "movieStorePage", tvStorePage: "tvStorePage", welcomeHub: "welcomeHub", welcomePanel: "welcomePanel"
+ }})
+})()
+})();
+/* >>>>>>/framework/uistateservice.js:15120 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ var observableProperty = MS.Entertainment.UI.Framework.observableProperty;
+ var UiStateService = WinJS.Class.derive(MS.Entertainment.UI.Framework.ObservableBase, function uiStateService() {
+ var currentView = Windows.UI.ViewManagement.InputPane.getForCurrentView();
+ currentView.addEventListener("showing", function uiStateService_SoftKeyboardShown() {
+ if (this._hidingPromise)
+ this._hidingPromise.cancel();
+ this.softKeyboardOpen = true
+ }.bind(this));
+ currentView.addEventListener("hiding", function uiStateService_SoftKeyboardHiding(e) {
+ this._hidingPromise = WinJS.Promise.timeout(250).then(function uiStateService_SoftKeyboardHidden() {
+ this._hidingPromise = null;
+ this.softKeyboardOpen = false
+ }.bind(this), function(){})
+ }.bind(this));
+ window.addEventListener("resize", function uiStateService_WindowResizing() {
+ if (!this.softKeyboardOpen)
+ this.dispatchEvent("windowresize")
+ }.bind(this))
+ }, {
+ animationsEnabled: {get: function() {
+ return MS.Entertainment.UI.Framework.animationsEnabled
+ }}, activationKind: observableProperty("activationKind", null), activeListening: observableProperty("activeListening", false), activityOverlayVisible: observableProperty("activityOverlayVisible", false), appBarVisible: observableProperty("appBarVisible", false), applicationTitle: observableProperty("applicationTitle", String.empty), deepLinkSource: observableProperty("deepLinkSource", String.empty), deepLinkSourceID: observableProperty("deepLinkSourceID", String.empty), deepLinkLaunchTime: observableProperty("deepLinkLaunchTime", String.empty), engageVisible: observableProperty("engageVisible", false), gestureEngaged: observableProperty("gestureEngaged", false), isAppVisible: observableProperty("isAppVisible", true, true), isInRestrictedBackground: observableProperty("isInRestrictedBackground", false), isFilled: observableProperty("isFilled", false, true), isFirstLaunch: observableProperty("isFirstLaunch", true), isFullScreenVideo: observableProperty("isFullScreenVideo", false), isFullScreenMusic: observableProperty("isFullScreenMusic", false), isHubStripVisible: observableProperty("isHubStripVisible", false), isScrolling: observableProperty("isScrolling", false), isSearchPaneVisible: observableProperty("isSearchPaneVisible", false), isSettingsCharmVisible: observableProperty("isSettingsCharmVisible", false), isSnapped: observableProperty("isSnapped", false, true), networkStatus: observableProperty("networkStatus", null), nowPlayingConstrainedMode: observableProperty("nowPlayingConstrainedMode", false), nowPlayingVisible: observableProperty("nowPlayingVisible", false), nowPlayingInset: observableProperty("nowPlayingInset", false), nowPlayingTileVisible: observableProperty("nowPlayingTileVisible", false), nuiEngaged: observableProperty("nuiEngaged", false), overlayVisible: observableProperty("overlayVisible", false), postRollAnimationState: observableProperty("postRollAnimationState", null), servicesEnabled: observableProperty("servicesEnabled", true), shouldShowAdsForFreePlay: observableProperty("shouldShowAdsForFreePlay", false), showingPostRoll: observableProperty("showingPostRoll", false), showingTransportControls: observableProperty("showingTransportControls", false), softKeyboardOpen: observableProperty("softKeyboardOpen", false), stageThreeActivated: observableProperty("stageThreeActivated", false), visibleButNotFocused: observableProperty("visibleButNotFocused", false), xboxControllerVisible: observableProperty("xboxControllerVisible", false), primarySessionId: observableProperty("primarySessionId", String.empty)
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.uiState, function getUiStateService() {
+ return new UiStateService
+ }, true)
+})()
+})();
+/* >>>>>>/framework/observablearray.js:15154 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment");
+ WinJS.Namespace.define("MS.Entertainment", {ObservableArray: MS.Entertainment.UI.Framework.define(function observableArrayConstructor(data) {
+ this._listeners = [];
+ this._indexableItems = WinJS.Binding.as({length: 0});
+ if (!data)
+ this._data = [];
+ else
+ this._data = data.slice();
+ this._updateBindableItems()
+ }, {
+ _getObservable: function() {
+ return this
+ }, _data: null, _listeners: null, _indexableItems: null, _validateIndex: function validateIndex(index) {
+ if ((index < 0) || (index > this.length - 1))
+ throw new Error("Index out of bounds");
+ }, _raiseChangeEvent: function raiseChangeEvent(operation, index, item) {
+ var changeObject = {
+ type: operation, index: index, item: item
+ };
+ for (var i = 0; i < this._listeners.length; i++) {
+ var listener = this._listeners[i];
+ if (listener)
+ listener(changeObject)
+ }
+ }, _updateBindableItems: function _updateBindableItems() {
+ if (this._data.length === this._indexableItems.length)
+ return;
+ var that = this;
+ var difference = this._data.length - this._indexableItems;
+ for (var i = 0; i < this._data.length; i++) {
+ if (this._indexableItems.hasOwnProperty("item" + i))
+ continue;
+ (function(index) {
+ Object.defineProperty(that._indexableItems, "item" + index, {get: function() {
+ return that._data[index]
+ }})
+ })(i)
+ }
+ if (difference > 0)
+ for (var j = this._data.length; j < this._indexableItems.length; j++)
+ delete this._indexableItems["item" + j];
+ this._indexableItems.length = this._data.length
+ }, addChangeListener: function addChangeListener(handler) {
+ if (!handler)
+ throw new Error("Argument was invalid: undefined/null");
+ this._listeners.push(handler)
+ }, removeChangeListener: function removeChangeListener(handler) {
+ var handlerIndex = this._listeners.indexOf(handler);
+ if (handlerIndex === -1)
+ return;
+ this._listeners.splice(handlerIndex, 1)
+ }, length: {get: function() {
+ return this._data.length
+ }}, getArray: function getArray() {
+ return [].concat(this._data)
+ }, indexOf: function indexOf(item) {
+ return this._data.indexOf(item)
+ }, lastIndexOf: function lastIndexOf(item, startFrom) {
+ return this._data.lastIndexOf(item, startFrom)
+ }, contains: function contains(item) {
+ return (this.indexOf(item) !== -1)
+ }, item: function item(index) {
+ this._validateIndex(index);
+ return this._data[index]
+ }, clear: function clear() {
+ this._data.length = 0;
+ this._indexableItems = WinJS.Binding.as({length: 0});
+ this._raiseChangeEvent(MS.Entertainment.ObservableArray.OperationTypes.reset, -1, null)
+ }, add: function add(item) {
+ this.insert(this.length, item)
+ }, remove: function remove(item) {
+ var index = this.indexOf(item);
+ if (index < 0)
+ return;
+ return this.removeAt(index)
+ }, removeAt: function removeAt(index) {
+ var removedItems = null;
+ this._validateIndex(index);
+ var item = this.item(index);
+ removedItems = this._data.splice(index, 1);
+ MS.Entertainment.assert(removedItems.length === 1, "expecting to remove more than one item. Removed: " + removedItems.length);
+ this._updateBindableItems();
+ this._raiseChangeEvent(MS.Entertainment.ObservableArray.OperationTypes.remove, index, item);
+ return removedItems.length > 0 ? removedItems[0] : null
+ }, insert: function insert(index, item) {
+ if ((index < 0) || (index > this.length))
+ throw new Error("Index out of bounds");
+ this._data.splice(index, 0, item);
+ this._updateBindableItems();
+ this._raiseChangeEvent(MS.Entertainment.ObservableArray.OperationTypes.add, index, item)
+ }, slice: function slice(start, end) {
+ return this._data.slice(start, end)
+ }, some: function some(callback) {
+ return this._data.some(callback)
+ }, spliceArray: function spliceArray(index, count, array) {
+ this.splice.bind(this, index, count).apply(this, array)
+ }, unique: function unique() {
+ var uniqueValues = this._data ? this._data.unique() : [];
+ return uniqueValues
+ }, clone: function clone() {
+ var clonedValues = this._data ? this._data.clone() : [];
+ return clonedValues
+ }, push: function push(item) {
+ this.add(item);
+ return this.length
+ }, pop: function pop() {
+ if (this.length < 1)
+ return;
+ var index = this.length - 1;
+ return this.removeAt(index)
+ }, filter: function filter(callback, that) {
+ if (!this._data)
+ return null;
+ return this._data.filter(callback, that)
+ }, shift: function shift() {
+ if (this.length < 1)
+ return;
+ return this.removeAt(0)
+ }, splice: function splice(index, count) {
+ var removedItems = [];
+ if (count !== 0)
+ this._validateIndex(index + count - 1);
+ for (var i = index; i < index + count; i++)
+ removedItems.push(this.removeAt(index));
+ if (arguments.length > 2)
+ for (var j = 2; j < arguments.length; j++)
+ this.insert(index + j - 2, arguments[j]);
+ return removedItems
+ }, unshift: function unshift(item) {
+ this.insert(0, item);
+ return this.length
+ }, bindableItems: {get: function() {
+ return this._indexableItems
+ }}, forEach: function(callback, that) {
+ if (this._data)
+ this._data.forEach(callback, that)
+ }
+ }, {OperationTypes: MS.Entertainment.UI.Framework.define(null, null, {
+ add: "add", remove: "remove", reset: "reset"
+ })})})
+})()
+})();
+/* >>>>>>/framework/data/factory.js:15302 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(undefined) {
+ "use strict";
+ var MSE = WinJS.Namespace.define("MS.Entertainment", null);
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+ var blockAssertValueNotHydrated = function blockAssertValueNotHydrated(){};
+ var unblockAssertValueNotHydrated = function unblockAssertValueNotHydrated(){};
+ var assertValueNotHydrated = function assertValueNotHydrated(property, propertyPath){};
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ stringParser: {
+ dateFromUTC: function(string, delimiter) {
+ var date = null;
+ if (string && string.constructor === String) {
+ if (delimiter === undefined)
+ delimiter = "-";
+ var pattern = new RegExp("(\\d{4})" + delimiter + "(\\d{2})" + delimiter + "(\\d{2})(.(\\d{2}):(\\d{2}):(\\d{2})){0,1}");
+ var parts = string.match(pattern);
+ MS.Entertainment.Data.assert(parts, "Parsing string dateFromUTC did not match RegExp pattern");
+ if (parts)
+ date = new Date(Date.UTC(parseInt(parts[1]), parseInt(parts[2], 10) - 1, parseInt(parts[3], 10), parseInt(parts[5] || "0", 10), parseInt(parts[6] || "0", 10), parseInt(parts[7] || "0", 10), 0))
+ }
+ return date
+ }, timeSpanFromXmlDuration: function timeSpanFromXmlDuration(data) {
+ var years = 0;
+ var months = 0;
+ var days = 0;
+ var hours = 0;
+ var minutes = 0;
+ var seconds = 0;
+ var regexp,
+ parts;
+ if (data) {
+ regexp = /(-?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?/i;
+ parts = data.match(regexp);
+ if (parts) {
+ years = parseInt(parts[2] || 0);
+ months = parseInt(parts[3] || 0);
+ days = parseInt(parts[4] || 0);
+ hours = parseInt(parts[5] || 0);
+ minutes = parseInt(parts[6] || 0);
+ seconds = parseInt(parts[7] || 0);
+ parts = null
+ }
+ else {
+ regexp = /^(-?)(\d+)\:(\d+)\:(\d+)$/i;
+ parts = data.match(regexp)
+ }
+ if (parts) {
+ hours = parseInt(parts[2] || 0);
+ minutes = parseInt(parts[3] || 0);
+ seconds = parseInt(parts[4] || 0)
+ }
+ }
+ var timeSpan = new Date(years, months, days, hours, minutes, seconds, 0);
+ return timeSpan
+ }
+ }, Augmentation: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function augmentation(augmentBackingData) {
+ this._cache = {};
+ this._backingAugmentation = {};
+ this._setAugmentBackingData(augmentBackingData || {})
+ }, {
+ _hydratePromise: null, _backingAugmentation: null, _preventObservableInheritance: true, _hydrated: false, hydrating: MS.Entertainment.UI.Framework.observableProperty("hydrating", false), isFailed: MS.Entertainment.UI.Framework.observableProperty("isFailed", false), hydrated: {
+ get: function get_hydrated() {
+ return this._hydrated
+ }, set: function set_hydrated(value) {
+ if (value !== this._hydrated) {
+ var oldValue = this._hydrated;
+ this._hydrated = value;
+ if (!value)
+ this._hydratePromise = null;
+ this.dispatchChangeAndNotify("hydrated", value, oldValue)
+ }
+ }
+ }, instance: {
+ get: function get_instance() {
+ return this._updatedInstance || this
+ }, set: function set_instance(value) {
+ this._updatedInstance = value
+ }, enumerable: true, configurable: false
+ }, _augmentBackingData: {
+ value: null, writable: true, enumerable: true, configurable: false
+ }, _backingData: {
+ get: function get_backingData() {
+ return this._cache
+ }, enumerable: true, configurable: false
+ }, _cache: {
+ value: null, writable: true, enumerable: true, configurable: false
+ }, _updatedInstance: {
+ value: null, writable: true, enumerable: true, configurable: false
+ }, _setCacheValue: {
+ value: function _setCacheValue(key, value) {
+ if (this._cache)
+ this._cache[key] = value
+ }, enumerable: true
+ }, _getAugmentBackingValue: {
+ value: function _getAugmentBackingValue(key, defaultValue) {
+ return (this._augmentBackingData && key in this._augmentBackingData) ? this._augmentBackingData[key] : defaultValue
+ }, enumerable: true, configurable: false
+ }, _setAugmentBackingValue: {
+ value: function _setAugmentBackingValue(key, newValue) {
+ if (this._augmentBackingData) {
+ var oldValue = this._getAugmentBackingValue(key);
+ this._augmentBackingData[key] = newValue;
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue)
+ }
+ }, enumerable: true, configurable: false
+ }, _getCacheValue: {
+ value: function _getCacheValue(key, defaultValue) {
+ return (this._cache && key in this._cache) ? this._cache[key] : defaultValue
+ }, enumerable: true
+ }, _getPropertyValueFromInner: function _getPropertyValueFromInner(key, innerProperty, source) {
+ var cache;
+ var cacheable = innerProperty ? innerProperty.cacheable : false;
+ source = source || this;
+ if (cacheable)
+ cache = this._getCacheValue(key);
+ if (cache === undefined) {
+ if (innerProperty && innerProperty.get)
+ cache = innerProperty.get.call(source, !source._augmentBackingData);
+ else
+ cache = innerProperty;
+ if (cacheable)
+ this._setCacheValue(key, cache)
+ }
+ return cache
+ }, _setPropertyValueFromInner: function _setPropertyValueFromInner(key, innerProperty, newValue, source) {
+ blockAssertValueNotHydrated();
+ source = source || this;
+ var cacheable = innerProperty ? innerProperty.cacheable : false;
+ var oldValue = this._getPropertyValueFromInner(key, innerProperty);
+ if (cacheable)
+ this._setCacheValue(key, newValue);
+ if (innerProperty && innerProperty.set)
+ innerProperty.set.call(source, newValue);
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue);
+ unblockAssertValueNotHydrated()
+ }, _getInitializablePropertyValueFromInner: function _getInitializablePropertyValueFromInner(key, innerProperty) {
+ var initialized = this._getCacheValue(key);
+ if (!initialized && innerProperty && innerProperty.initializer) {
+ innerProperty.initializer.call(this);
+ this._setCacheValue(key, true)
+ }
+ if (innerProperty && innerProperty.get)
+ return innerProperty.get.call(this)
+ }, _setInitializablePropertyValueFromInner: function _setInitializablePropertyValueFromInner(key, innerProperty, newValue) {
+ blockAssertValueNotHydrated();
+ var oldValue = this._getInitializablePropertyValueFromInner(key, innerProperty);
+ if (innerProperty && innerProperty.set)
+ innerProperty.set.call(this, newValue);
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue);
+ unblockAssertValueNotHydrated()
+ }, clone: function clone() {
+ var clone = MS.Entertainment.Data.augment(MS.Entertainment.Data.deflate(this), WinJS.Binding.unwrap(this).constructor);
+ return clone
+ }, cloneWithHydration: function cloneWithHydration() {
+ var clone = this.clone();
+ if (this.hydrated && clone)
+ clone._setHydratedValues(this);
+ return clone
+ }, hydrate: function hydrate(options) {
+ if (!this._hydratePromise && this.onHydrated) {
+ this.hydrated = false;
+ this.hydrating = true;
+ this.isFailed = false;
+ var hydratePromise = this._hydratePromise = WinJS.Promise.as(this.onHydrated.call(this, this, options));
+ hydratePromise = hydratePromise.then(function hydratedCompleted(values) {
+ if (hydratePromise === this._hydratePromise) {
+ this.hydrating = false;
+ if (values) {
+ this._setHydratedValues(values);
+ this.hydrated = true
+ }
+ else
+ this._hydratePromise = null
+ }
+ }.bind(this), function hydratedFailed(error) {
+ if (hydratePromise === this._hydratePromise) {
+ this.hydrating = false;
+ if (!error || error.message !== "Canceled")
+ this.isFailed = true;
+ this._hydratePromise = null
+ }
+ }.bind(this)).then(function hydratedFinally() {
+ return this
+ }.bind(this));
+ if (this._hydratePromise)
+ this._hydratePromise = hydratePromise
+ }
+ return WinJS.Promise.as(this._hydratePromise || this)
+ }, refresh: function refresh(options) {
+ if (!this.hydrating) {
+ this._hydratePromise = null;
+ this.hydrated = false;
+ return this.hydrate(options)
+ }
+ else
+ return WinJS.Promise.as(this._hydratePromise)
+ }, onHydrated: null, _setAugmentBackingData: function _setAugmentBackingData(data) {
+ var key;
+ if (!this._augmentBackingData && data)
+ this._augmentBackingData = data
+ }, _setHydratedValues: function _setHydratedValues(values) {
+ blockAssertValueNotHydrated();
+ var key,
+ property,
+ propertyValue,
+ override;
+ var augmentationShape = MSE.Data.augmentationShape(this);
+ values = values || {};
+ for (key in augmentationShape) {
+ property = augmentationShape[key];
+ if (property && property.hydrated)
+ if (key in values) {
+ propertyValue = values[key];
+ if (property.hydratedComparer)
+ override = property.hydratedComparer(this[key], values[key]) > 0;
+ else
+ override = MS.Entertainment.Data.Comparer.notFalsy(null, values[key]) > 0;
+ if (override)
+ this[key] = values[key]
+ }
+ else if (!property.hydratedIfAvailable)
+ MSE.Data.fail("Expected key missing from hydrated values. Key = " + key)
+ }
+ unblockAssertValueNotHydrated()
+ }, _assertValueNotHydrated: function _assertValueNotHydrated(property, propertyPath) {
+ if (!this.hydrated)
+ assertValueNotHydrated(property, propertyPath)
+ }
+ }, {
+ isAugmentation: function isAugmentation(object) {
+ return MS.Entertainment.Data.Augmentation.prototype.isPrototypeOf(object)
+ }, addProperties: function addProperties(object, innerPropertiesOrValues) {
+ if (object && innerPropertiesOrValues)
+ for (var key in innerPropertiesOrValues)
+ MS.Entertainment.Data.Augmentation.addProperty(object, key, innerPropertiesOrValues[key]);
+ return object
+ }, addProperty: function addProperty(object, key, innerPropertyOrValue) {
+ if (!object)
+ return object;
+ var override = (innerPropertyOrValue && innerPropertyOrValue.override);
+ if (!(key in object) || override) {
+ innerPropertyOrValue = MS.Entertainment.Data.Augmentation.defineProperty(key, innerPropertyOrValue);
+ if (innerPropertyOrValue.get || innerPropertyOrValue.set)
+ Object.defineProperty(object, key, innerPropertyOrValue)
+ }
+ else if (!innerPropertyOrValue)
+ object[key] = innerPropertyOrValue;
+ else if (!innerPropertyOrValue.get && !innerPropertyOrValue.set && innerPropertyOrValue !== "function")
+ object[key] = innerPropertyOrValue;
+ return object
+ }, defineProperty: function defineProperty(key, innerProperty) {
+ var result = innerProperty;
+ var type = typeof innerProperty;
+ var validObject = innerProperty && type === "object";
+ if (validObject && innerProperty.initializer)
+ result = MSE.Data.Augmentation.defineInitializerProperty(key, innerProperty);
+ else if (validObject && (innerProperty.get || innerProperty.set))
+ result = MSE.Data.Augmentation.defineCacheableProperty(key, innerProperty);
+ else if (innerProperty !== "function")
+ result = MSE.Data.Augmentation.defineNotifyProperty(key, innerProperty);
+ return result
+ }, defineAugmentProperty: function defineAugmentProperty(key) {
+ return {
+ get: function() {
+ return this._getAugmentBackingValue(key)
+ }, set: function(newValue) {
+ this._setAugmentBackingValue(key, newValue)
+ }, enumerable: true, configurable: true
+ }
+ }, defineNotifyProperty: function defineNotifyProperty(key, innerValue) {
+ return {
+ get: function() {
+ return this._getCacheValue(key, innerValue)
+ }, set: function(newValue) {
+ var oldValue = this._getCacheValue(key, innerValue);
+ this._setCacheValue(key, newValue);
+ if (newValue !== oldValue)
+ this.dispatchChangeAndNotify(key, newValue, oldValue)
+ }, enumerable: true, configurable: true
+ }
+ }, defineCacheableProperty: function defineCacheableProperty(key, innerProperty) {
+ return {
+ get: function() {
+ return this._getPropertyValueFromInner(key, innerProperty)
+ }, set: function(value) {
+ return this._setPropertyValueFromInner(key, innerProperty, value)
+ }, enumerable: (!innerProperty || innerProperty.enumerable === undefined) ? true : innerProperty.enumerable, configurable: (!innerProperty || innerProperty.configurable === undefined) ? true : innerProperty.configurable
+ }
+ }, defineInitializerProperty: function defineInitializer(key, innerProperty) {
+ return {
+ get: function() {
+ return this._getInitializablePropertyValueFromInner(key, innerProperty)
+ }, set: function(value) {
+ return this._setInitializablePropertyValueFromInner(key, innerProperty, value)
+ }, enumerable: (!innerProperty || innerProperty.enumerable === undefined) ? true : innerProperty.enumerable, configurable: (!innerProperty || innerProperty.configurable === undefined) ? true : innerProperty.configurable
+ }
+ }
+ }), _mix: (function() {
+ function defineMixedProperty(deflate, propertyPath, key, innerProperty) {
+ var hasGetter;
+ var hasSetter;
+ if (innerProperty && innerProperty.augmented) {
+ hasGetter = !!innerProperty.get;
+ hasSetter = !!innerProperty.set
+ }
+ if (!hasGetter && !hasSetter)
+ return innerProperty;
+ else {
+ var propertyPathFragments = MSE.Data.Property._getPropertyPathFragments(null, propertyPath);
+ return {
+ get: function() {
+ var result;
+ var that;
+ var source;
+ if (deflate)
+ source = MSE.Data.deflate(this);
+ else
+ source = this;
+ if (hasGetter && MSE.Data.Property._hasPropertyPathFragments(source, propertyPathFragments))
+ that = MSE.Data.Property._valueFromPropertyPathFragments(source, propertyPathFragments);
+ if (that && this._getPropertyValueFromInner)
+ result = this._getPropertyValueFromInner(key, innerProperty, that);
+ return result
+ }, set: function(value) {
+ var that;
+ var source;
+ if (deflate)
+ source = MSE.Data.deflate(this);
+ else
+ source = this;
+ if (hasSetter && MSE.Data.Property._hasPropertyPathFragments(source, propertyPathFragments))
+ that = MSE.Data.Property._valueFromPropertyPathFragments(source, propertyPathFragments);
+ if (that && this._setPropertyValueFromInner)
+ this._setPropertyValueFromInner(key, innerProperty, value, that)
+ }, augmented: true, cacheable: innerProperty.cacheable, enumerable: innerProperty.enumerable, configurable: innerProperty.configurable, hydrated: innerProperty.hydrated, hydratedRequired: innerProperty.hydratedRequired, hydratedComparer: innerProperty.hydratedComparer
+ }
+ }
+ }
+ {};
+ return function _mix(deflate, augmentations) {
+ var instanceMembers = {};
+ var shape;
+ var property;
+ var key;
+ var shapeKey;
+ var constructors = [];
+ for (key in augmentations) {
+ constructors.push(augmentations[key].prototype.constructor);
+ shape = MSE.Data.augmentationShape(augmentations[key].prototype);
+ for (shapeKey in shape) {
+ property = shape[shapeKey];
+ instanceMembers[shapeKey] = defineMixedProperty(deflate, key, shapeKey, shape[shapeKey])
+ }
+ }
+ var mixConstructor = function mixConstructor() {
+ var args = arguments;
+ constructors.forEach(function(constructor) {
+ constructor.apply(this, args)
+ }, this)
+ };
+ return MSE.Data.define(mixConstructor, instanceMembers)
+ }
+ })(), mix: function mix(augmentations) {
+ return this._mix(true, augmentations)
+ }, mixNoDeflate: function mixNoDeflate(augmentations) {
+ return this._mix(false, augmentations)
+ }, define: function define(constructor, instanceMembers, staticMembers) {
+ return MSE.Data.derive(null, constructor, instanceMembers, staticMembers)
+ }, derive: (function() {
+ return function derive(base, constructor, instanceMembers, staticMembers) {
+ base = base || MSE.Data.Augmentation;
+ if (!constructor)
+ constructor = function defaultConstructor() {
+ this.base.apply(this, arguments)
+ };
+ var adjustedInstanceMembers = {_augmentationShape: instanceMembers};
+ for (var key in instanceMembers)
+ adjustedInstanceMembers[key] = MSE.Data.Augmentation.defineProperty(key, instanceMembers[key]);
+ if (adjustedInstanceMembers._augmentationShape && base && base.prototype)
+ adjustedInstanceMembers._augmentationShape._baseAugmentationShape = base.prototype._augmentationShape;
+ return MS.Entertainment.derive(base, constructor, adjustedInstanceMembers, staticMembers)
+ }
+ })(), augment: function augment(data, Augmentation) {
+ var result;
+ if (data === null)
+ return null;
+ if (typeof data !== "object")
+ throw new Error("Can't augment a non-object types. " + (typeof data));
+ if (Augmentation) {
+ result = new Augmentation(data);
+ MSE.Data.assert(result._augmentBackingData === data, "During augmentation the the backing data didn't equal the expected value. Are you sure your Augmentation definition is calling the base constructor?")
+ }
+ else
+ result = data;
+ return result
+ }, augmentArrayItems: function(data, augmentationOrFactory) {
+ if (!Array.isArray(data))
+ throw new Error("Can't call augmentArrayItems a non-array types. " + (typeof data));
+ var itemFactory;
+ if (!augmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(augmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(augmentationOrFactory);
+ else
+ itemFactory = augmentationOrFactory;
+ var result = data;
+ if (itemFactory) {
+ result = [];
+ for (var i = 0; i < data.length; i++)
+ result[i] = itemFactory(data[i])
+ }
+ return result
+ }, augmentationShape: function augmentationShape(data) {
+ var key;
+ var result = {};
+ var shape = (data && data._augmentationShape) ? data._augmentationShape : (data && data.prototype) ? data.prototype._augmentationShape : null;
+ while (shape) {
+ for (key in shape)
+ if (!(key in result))
+ result[key] = shape[key];
+ shape = shape._baseAugmentationShape
+ }
+ return result
+ }, hydratedProperties: function hydratedProperties(data) {
+ var key;
+ var result = [];
+ var augmentationShape = MSE.Data.augmentationShape(data);
+ for (key in augmentationShape)
+ if (augmentationShape[key].hydrated)
+ result.push(key);
+ return result
+ }, deflate: function(data) {
+ return data ? WinJS.Binding.unwrap(data)._augmentBackingData || data : data
+ }, deflateOrFail: function(data) {
+ return WinJS.Binding.unwrap(data)._augmentBackingData
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Merger", {
+ defaultMerger: function defaultMerger(item1, item2) {
+ return new MSE.Data.Property.MergedItem(item1, item2)
+ }, self: function self(item1, item2) {
+ return item1 || item2
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Comparer", {
+ defaultComparer: function defaultComparer(item1, item2) {
+ if (item1 === item2)
+ return 0;
+ else if (item1 < item2 || item2 === null || item2 === undefined)
+ return -1;
+ else if (item1 > item2 || item1 === null || item1 === undefined)
+ return 1;
+ else
+ return 0
+ }, inverseDefaultComparer: function inverseDefaultComparer(item1, item2) {
+ if (item1 === item2)
+ return 0;
+ else if (item1 > item2 || item2 === null || item2 === undefined)
+ return -1;
+ else if (item1 < item2 || item1 === null || item1 === undefined)
+ return 1;
+ else
+ return 0
+ }, dateComparer: function dateComparer(date1, date2) {
+ var isDate1 = date1 && date1.getTime;
+ var isDate2 = date2 && date2.getTime;
+ if (isDate1 && isDate2)
+ return MS.Entertainment.Data.Comparer.defaultComparer(date1.getTime(), date2.getTime());
+ else if (isDate1 && !isDate2)
+ return -1;
+ else if (isDate2 && !isDate1)
+ return 1;
+ else
+ return 0
+ }, inverseDateComparer: function dateComparer(date1, date2) {
+ var isDate1 = date1 && date1.getTime;
+ var isDate2 = date2 && date2.getTime;
+ if (isDate1 && isDate2)
+ return MS.Entertainment.Data.Comparer.inverseDefaultComparer(date1.getTime(), date2.getTime());
+ else if (isDate1 && !isDate2)
+ return -1;
+ else if (isDate2 && !isDate1)
+ return 1;
+ else
+ return 0
+ }, notFalsy: function notFalsy(item1, item2) {
+ var emptyOrNull1 = item1 === null || item1 === undefined || item1 === String.empty;
+ var emptyOrNull2 = item2 === null || item2 === undefined || item2 === String.empty;
+ if (emptyOrNull1 && emptyOrNull2)
+ return NaN;
+ else if (emptyOrNull2)
+ return -1;
+ else if (emptyOrNull1)
+ return 1;
+ else
+ return 0
+ }, preferSecond: function preferSecond(item1, item2) {
+ return 1
+ }, createPropertyComparer: function(propertyPath, innerComparer, secondPropertyPath) {
+ innerComparer = innerComparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ return function propertyComparer(item1, item2) {
+ var propertyFragments = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ var secondPropertyFragments = (secondPropertyFragments === undefined) ? propertyFragments : MSE.Utilities.getPropertyPathFragments(secondPropertyPath);
+ item1 = MSE.Data.Property._valueFromPropertyPathFragments(item1, propertyFragments);
+ item2 = MSE.Data.Property._valueFromPropertyPathFragments(item2, secondPropertyFragments);
+ return innerComparer(item1, item2)
+ }
+ }, createFilterComparer: function(filter) {
+ filter = filter || MS.Entertainment.Data.Filter.defaultFilter;
+ return function filterComparer(item1, item2) {
+ var item = item1;
+ var result = -1;
+ if ((item1 === null || item1 === undefined) && (item2 !== null && item2 !== undefined)) {
+ item = item2;
+ result = 1
+ }
+ if (filter(item))
+ result = NaN;
+ return result
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Filter", {
+ defaultFilter: function defaultFilter(item) {
+ return false
+ }, createPropertyFilter: function createPropertyFilter(propertyPath, filterOrValue) {
+ if (typeof filterOrValue === "function")
+ return function filter(item) {
+ var propertyFragments = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ item = MSE.Data.Property._valueFromPropertyPathFragments(item, propertyFragments);
+ return filterOrValue(item)
+ };
+ else
+ return function filter(item) {
+ var propertyFragments = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ item = MSE.Data.Property._valueFromPropertyPathFragments(item, propertyFragments);
+ return item !== filterOrValue
+ }
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Property", {
+ _getArray: function _getArray(original, propertyPathFragments) {
+ var data;
+ var returnResult = {
+ length: 0, data: []
+ };
+ if (MSE.Data.Property._hasPropertyPathFragments(original, propertyPathFragments)) {
+ data = MSE.Data.Property._valueFromPropertyPathFragments(original, propertyPathFragments);
+ if (MSE.Data.VectorViewWrapper.isVectorView(data)) {
+ returnResult.length = MSE.Data.VectorViewWrapper.getLength(data);
+ returnResult.data = data
+ }
+ else if (Array.isArray(data)) {
+ returnResult.length = data.length;
+ returnResult.data = data
+ }
+ else {
+ returnResult.length = 1;
+ returnResult.data = [data]
+ }
+ }
+ return returnResult
+ }, MergedItem: MS.Entertainment.UI.Framework.define(function _mergedItem(source1, source2) {
+ this.source = [];
+ if (source1 !== undefined)
+ this.source[0] = source1;
+ if (source2 !== undefined)
+ this.source[1] = source2
+ }, {
+ source: null, primary: {get: function() {
+ return this.source[0] !== undefined ? this.source[0] : this.source[1]
+ }}
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data.Property", {
+ _getPropertyPathFragments: function _getPropertyPathFragments(source, propertyPath) {
+ if (Array.isArray(propertyPath) && source) {
+ var propertyPathArray = propertyPath;
+ propertyPath = null;
+ for (var i = 0; i < propertyPathArray.length; i++) {
+ propertyPath = propertyPathArray[i];
+ if (MSE.Data.Property._hasPropertyPath(source, propertyPath))
+ break
+ }
+ }
+ var result;
+ if (Array.isArray(propertyPath)) {
+ result = [];
+ for (var j = 0; j < propertyPath.length; j++)
+ result.push(MSE.Utilities.getPropertyPathFragments(propertyPath[j]))
+ }
+ else
+ result = MSE.Utilities.getPropertyPathFragments(propertyPath);
+ return result
+ }, _valueFromPropertyPathFragments: function _valueFromPropertyPathFragments(original, fragments) {
+ var result;
+ if (Array.isArray(fragments) && Array.isArray(fragments[0])) {
+ result = [];
+ for (var i = 0; i < fragments.length; i++)
+ result.push(MSE.Utilities.valueFromPropertyPathFragments(original, fragments[i]))
+ }
+ else
+ result = MSE.Utilities.valueFromPropertyPathFragments(original, fragments);
+ return result
+ }, _setFromPropertyPathFragments: function _setFromPropertyPathFragments(original, fragments, value) {
+ if (Array.isArray(fragments) && Array.isArray(fragments[0]))
+ MSE.Utilities.setFromPropertyPathFragments(original, fragments[0], value);
+ else
+ MSE.Utilities.setFromPropertyPathFragments(original, fragments, value)
+ }, _hasPropertyPath: function _hasPropertyPath(source, propertyPath) {
+ var hasPath = false;
+ if (Array.isArray(propertyPath)) {
+ for (var i = 0; i < propertyPath.length; i++)
+ if (MSE.Utilities.hasPropertyPath(source, propertyPath[i])) {
+ hasPath = true;
+ break
+ }
+ }
+ else
+ hasPath = MSE.Utilities.hasPropertyPath(source, propertyPath);
+ return hasPath
+ }, _hasPropertyPathFragments: function _hasPropertyPathFragments(source, propertyPathFragments) {
+ var hasPath = false;
+ if (Array.isArray(propertyPathFragments) && Array.isArray(propertyPathFragments[0])) {
+ for (var i = 0; i < propertyPathFragments.length; i++)
+ if (MSE.Utilities.hasPropertyPathFragments(source, propertyPathFragments[i])) {
+ hasPath = true;
+ break
+ }
+ }
+ else
+ hasPath = MSE.Utilities.hasPropertyPathFragments(source, propertyPathFragments);
+ return hasPath
+ }, _getDefaultValue: function _getDefaultValue(defaultValue, source) {
+ if (defaultValue && typeof defaultValue === "function")
+ defaultValue = defaultValue.call(source);
+ return defaultValue
+ }, _getFeatureEnabled: function _getFeatureEnabled(options) {
+ var featureEnabled = true;
+ if (options && options.feature !== undefined) {
+ var feature = options.feature;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (Array.isArray(feature))
+ for (var i = 0; i < feature.length; i++) {
+ featureEnabled = featureEnablement.isEnabled(feature[i]);
+ if (featureEnabled)
+ break
+ }
+ else
+ featureEnabled = featureEnablement.isEnabled(feature)
+ }
+ return featureEnabled
+ }, hydrated: function hydrated(property, overrideComparer) {
+ if (!property)
+ throw new Error("Invalid parameter. Property was not defined");
+ property.hydrated = true;
+ if (overrideComparer)
+ property.hydratedComparer = overrideComparer;
+ return property
+ }, hydratedRequired: function hydratedRequired(property, overrideComparer) {
+ property = MSE.Data.Property.hydrated(property, overrideComparer);
+ property.hydratedRequired = true;
+ return property
+ }, hydratedIfAvailable: function hydratedIfAvailable(property, overrideComparer) {
+ property = MSE.Data.Property.hydrated(property, overrideComparer);
+ property.hydratedIfAvailable = true;
+ return property
+ }, uncachable: function uncachable(property) {
+ property.cacheable = false;
+ return property
+ }, copyHydrated: function copyHydrated(destination, source) {
+ if (source && destination) {
+ destination.hydrated = source.hydrated;
+ destination.hydratedRequired = source.hydratedRequired;
+ destination.hydratedComparer = source.hydratedComparer
+ }
+ return destination
+ }, value: function value(defaultValue) {
+ var property = {
+ get: function() {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, _alias: function _alias(deflate, source, defaultValue) {
+ var property = {
+ get: function() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ return MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ }, set: function(value) {
+ if (this._cache) {
+ var original = (deflate) ? MSE.Data.deflate(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ MSE.Data.Property._setFromPropertyPathFragments(original, fragments, value)
+ }
+ }, augmented: true, enumerable: true, configurable: true
+ };
+ return property
+ }, alias: function(source, defaultValue) {
+ return MSE.Data.Property._alias(true, source, defaultValue)
+ }, _convertOriginal: function _convertOriginal(deflate, source, initializerCallback, defaultValue) {
+ if (!initializerCallback)
+ throw new Error("Invalid augument to convertOriginal. The given callback was null or undefined. Source = " + source);
+ var property = MSE.Data.Property._alias(deflate, source, defaultValue);
+ property.initializer = function initializer() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ initializerCallback(original, fragments, original, fragments);
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property)
+ };
+ return property
+ }, convertOriginal: function convertOriginal(source, callback, defaultValue) {
+ return MSE.Data.Property._convertOriginal(true, source, callback, defaultValue)
+ }, convertOriginalNoDeflate: function convertOriginalNoDeflate(source, callback, defaultValue) {
+ return MSE.Data.Property._convertOriginal(false, source, callback, defaultValue)
+ }, _convert: function _convert(deflate, source, parser, defaultValue, options) {
+ if (!parser)
+ throw new Error("Invalid augument. The given parser was null or undefined. Source = " + source);
+ var property = {
+ get: function() {
+ var result;
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ var featureEnabled = MSE.Data.Property._getFeatureEnabled(options);
+ if (!featureEnabled)
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this);
+ else if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ result = parser(MSE.Data.Property._valueFromPropertyPathFragments(original, fragments));
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, convert: function convert(source, parser, defaultValue, options) {
+ return MSE.Data.Property._convert(true, source, parser, defaultValue, options)
+ }, convertNoDeflate: function(source, parser, defaultValue, options) {
+ return MSE.Data.Property._convert(false, source, parser, defaultValue, options)
+ }, _augment: function(deflate, source, augmentationOrFactory, defaultValue) {
+ if (!augmentationOrFactory)
+ throw new Error("Invalid augument. The given augmentationOrFactory definition was null or undefined. Source = " + source);
+ var itemFactory;
+ if (!augmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(augmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(augmentationOrFactory);
+ else
+ itemFactory = augmentationOrFactory;
+ var property = {
+ get: function() {
+ var result;
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ original = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ if (Array.isArray(original))
+ result = MSE.Data.augmentArrayItems(original, itemFactory);
+ else
+ result = itemFactory(original)
+ }
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, augmentation: MSE.Data.Property._augment, augmentationOptions: {
+ deflate: deflate, source: source, augmentation: augmentationOrFactory, defaultValue: defaultValue
+ }
+ };
+ return property
+ }, augment: function(source, augmentation, defaultValue) {
+ return MSE.Data.Property._augment(true, source, augmentation, defaultValue)
+ }, augmentNoDeflate: function(source, augmentation, defaultValue) {
+ return MSE.Data.Property._augment(false, source, augmentation, defaultValue)
+ }, sortArray: function sortArray(source, comparer, augmentation, defaultValue) {
+ var result = MSE.Data.Property.augment(source, augmentation, defaultValue);
+ var oldGetter = result.get;
+ if (!comparer)
+ throw new Error("Invalid augument. The given comparer was null or undefined. Comparer = " + comparer);
+ return {
+ get: function() {
+ var result = oldGetter.apply(this);
+ if (Array.isArray(result))
+ result = result.sort(comparer);
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, augmentation: MSE.Data.Property.sortArray, augmentationOptions: {
+ source: source, comparer: comparer, augmentation: augmentation, defaultValue: defaultValue
+ }
+ }
+ }, format: function(source, stringId, defaultValue) {
+ if (!stringId) {
+ MSE.Data.fail("Invalid augument. The given stringId was null or undefined. Source = " + source);
+ return String.empty
+ }
+ var property = {
+ get: function() {
+ var result = defaultValue;
+ var byPassDeflate = arguments[0];
+ var original = !byPassDeflate ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (source === null)
+ result = String.load(stringId);
+ else if (MSE.Data.Property._hasPropertyPathFragments(original, fragments))
+ result = String.load(stringId).format(MSE.Data.Property._valueFromPropertyPathFragments(original, fragments));
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, _collect: function _collect(deflate, sources, parser, defaultValue) {
+ var property = {
+ get: function() {
+ var i,
+ currentParser,
+ fragments;
+ var result = [];
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ if (sources)
+ for (i = 0; i < sources.length; i += 1) {
+ currentParser = (Array.isArray(parser)) ? parser[i] : parser;
+ fragments = MSE.Data.Property._getPropertyPathFragments(original, sources[i]);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ var item = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ if (currentParser)
+ item = currentParser(item);
+ result.push(item)
+ }
+ else if (defaultValue !== undefined) {
+ var item = defaultValue;
+ if (currentParser)
+ item = currentParser(item);
+ result.push(item)
+ }
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, collect: function collect(sources, parser, defaultValue) {
+ return MS.Entertainment.Data.Property._collect(true, sources, parser, defaultValue)
+ }, collectNoDeflate: function collectNoDeflate(sources, parser, defaultValue) {
+ return MS.Entertainment.Data.Property._collect(false, sources, parser, defaultValue)
+ }, _filterArray: function _filterArray(deflate, source, filter, augmentation) {
+ var property = MSE.Data.Property._filter(deflate, source, filter, augmentation);
+ property.resultConstructor = Array.prototype.constructor;
+ var originalGet = property.get;
+ property.get = function get() {
+ MS.Entertainment.Data.Property.copyHydrated(originalGet, property);
+ var list = originalGet.call(this);
+ var array = (list && list.source) ? list.source : [];
+ return MS.Entertainment.Data.augmentArrayItems(array, augmentation)
+ };
+ property.augmentation = MSE.Data.Property._filterArray;
+ property.augmentationOptions = {
+ deflate: deflate, source: source, filter: filter, augmentation: augmentation
+ };
+ return property
+ }, filterArray: function filterArray(source, filter, augmentation) {
+ return MS.Entertainment.Data.Property._filterArray(true, source, filter, augmentation)
+ }, filterArrayNoDeflate: function filterArrayNoDeflate(source, filter, augmentation) {
+ return MS.Entertainment.Data.Property._filterArray(false, source, filter, augmentation)
+ }, _search: function _search(deflate, source, filter, defaultValue) {
+ if (!source)
+ throw new Error("Invalid augument. The given source was null or undefined. Source = " + source);
+ if (!filter)
+ throw new Error("Invalid augument. The given filter function was null or undefined. Filter = " + filter);
+ var property = {
+ get: function() {
+ var i;
+ var result = null;
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ var sourceValue = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ if (Array.isArray(sourceValue)) {
+ for (i = 0; i < sourceValue.length; i++)
+ if (!filter(sourceValue[i])) {
+ result = sourceValue[i];
+ break
+ }
+ }
+ else if (!filter(sourceValue))
+ result = sourceValue
+ }
+ else {
+ if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this)
+ }
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }, search: function search(source, filter, defaultValue) {
+ return MS.Entertainment.Data.Property._search(true, source, filter, defaultValue)
+ }, searchNoDeflate: function search(source, filter, defaultValue) {
+ return MS.Entertainment.Data.Property._search(false, source, filter, defaultValue)
+ }, isList: function isList(augmentation) {
+ return augmentation && augmentation.resultConstructor === MSE.Data.VirtualList.prototype.constructor
+ }, createAugmentation: function createAugmentation(original, optionOverrides) {
+ var result = null;
+ var key;
+ var augmentationOptions;
+ if (original && original.augmentation && original.augmentationOptions) {
+ optionOverrides = optionOverrides || {};
+ augmentationOptions = [];
+ for (key in original.augmentationOptions)
+ if (key in optionOverrides)
+ augmentationOptions.push(optionOverrides[key]);
+ else
+ augmentationOptions.push(original.augmentationOptions[key]);
+ result = original.augmentation.apply(this, augmentationOptions)
+ }
+ return result
+ }, list: function(source, itemAugmentationOrFactory, defaultValue) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ var property = {
+ get: function() {
+ var result = MS.Entertainment.Data.Property._getDefaultValue(defaultValue, this);
+ var byPassDeflate = arguments[0];
+ var original = !byPassDeflate ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, fragments)) {
+ result = MSE.Data.Property._valueFromPropertyPathFragments(original, fragments);
+ result = new MSE.Data.VirtualList(itemFactory, result)
+ }
+ else if (this._assertValueNotHydrated)
+ this._assertValueNotHydrated(property);
+ return result
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor, augmentation: MSE.Data.Property.list, augmentationOptions: {
+ source: source, itemAugmentationOrFactory: itemAugmentationOrFactory, defaultValue: defaultValue
+ }
+ };
+ return property
+ }, listWithContext: function listWithContext(source, context, itemAugmentationOrFactory, defaultValue) {
+ var innerItemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ innerItemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ innerItemFactory = itemAugmentationOrFactory;
+ var property = MSE.Data.Property.list(source, itemAugmentationOrFactory, defaultValue);
+ var oldGetter = property.get;
+ property.get = function() {
+ var result = oldGetter.apply(this, arguments);
+ var byPassDeflate = arguments[0];
+ var original = !byPassDeflate ? MSE.Data.deflateOrFail(this) : this;
+ var contextFragments = MSE.Data.Property._getPropertyPathFragments(original, context);
+ if (MSE.Data.Property._hasPropertyPathFragments(original, contextFragments)) {
+ var contextValue = MSE.Data.Property._valueFromPropertyPathFragments(original, contextFragments);
+ var itemFactoryWithContext = function itemFactoryWithContext(sourceItem) {
+ return innerItemFactory(sourceItem, contextValue)
+ };
+ itemFactoryWithContext.listItemFactory = innerItemFactory.listItemFactory;
+ result.setItemFactory(itemFactoryWithContext)
+ }
+ return result
+ };
+ property.augmentation = MSE.Data.Property.listWithContext,
+ property.augmentationOptions = {
+ source: source, context: context, itemAugmentationOrFactory: itemAugmentationOrFactory, defaultValue: defaultValue
+ };
+ return property
+ }, _sort: function _sort(deflate, source, comparer, filter, itemAugmentationOrFactory) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ comparer = comparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ var property = {
+ get: function union() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, source);
+ var array = source !== undefined ? MSE.Data.Property._getArray(original, fragments).data : [];
+ var arrayLength = array.length;
+ var sortedArray = [];
+ if (filter)
+ array = array.filter(filter);
+ sortedArray = array.sort(comparer);
+ return new MSE.Data.VirtualList(itemFactory, sortedArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor
+ };
+ return property
+ }, sort: function sort(source, comparer, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._sort(true, source, comparer, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.sort;
+ result.augmentationOptions = {
+ source: source, comparer: comparer, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, sortNoDeflate: function sortNoDeflate(source, comparer, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._sort(false, source, comparer, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.sortNoDeflate;
+ result.augmentationOptions = {
+ source: source, comparer: comparer, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, _union: function(deflate, source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ comparer = comparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ merger = merger || MS.Entertainment.Data.Merger.defaultMerger;
+ var property = {
+ get: function union() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var fragments1 = MSE.Data.Property._getPropertyPathFragments(original, source1);
+ var fragments2 = MSE.Data.Property._getPropertyPathFragments(original, source2);
+ var array1 = source1 !== undefined ? MSE.Data.Property._getArray(original, fragments1) : [];
+ var array2 = source2 !== undefined ? MSE.Data.Property._getArray(original, fragments2) : [];
+ var array1Length = array1.length;
+ var array2Length = array2.length;
+ var empty,
+ item1,
+ item2;
+ var combinedArray = [];
+ var i = 0,
+ j = 0;
+ array1 = array1.data;
+ array2 = array2.data;
+ while ((i < array1Length || j < array2Length) && (i <= array1Length && j <= array2Length)) {
+ item1 = (i < array1Length) ? array1[i] : empty;
+ item2 = (j < array2Length) ? array2[j] : empty;
+ var compareResult = comparer(item1, item2);
+ var mergedResult = null;
+ if (compareResult === 0) {
+ mergedResult = merger(item1, item2);
+ i++;
+ j++
+ }
+ else if (compareResult < 0) {
+ mergedResult = merger(item1);
+ i++
+ }
+ else if (!isNaN(compareResult)) {
+ mergedResult = merger(empty, item2);
+ j++
+ }
+ else {
+ if (i < array1Length)
+ i++;
+ {};
+ if (j < array2Length)
+ j++;
+ {}
+ }
+ if (mergedResult !== null && mergedResult !== undefined)
+ combinedArray.push(mergedResult)
+ }
+ return new MSE.Data.VirtualList(itemFactory, combinedArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor
+ };
+ return property
+ }, union: function(source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._union(true, source1, source2, comparer, merger, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.union;
+ result.augmentationOptions = {
+ source1: source1, source2: source2, comparer: comparer, merger: merger, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, unionNoDeflate: function(source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._union(false, source1, source2, comparer, merger, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.unionNoDeflate;
+ result.augmentationOptions = {
+ source1: source1, source2: source2, comparer: comparer, merger: merger, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, _reorder: function(deflate, orderSource, parentSource, itemAugmentationOrFactory, returnArray) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ var property = {
+ get: function reorder() {
+ var byPassDeflate = arguments[0];
+ var original = (deflate && !byPassDeflate) ? MSE.Data.deflateOrFail(this) : this;
+ var orderSourceFragments = MSE.Data.Property._getPropertyPathFragments(original, orderSource);
+ var orderArray = (orderSource !== undefined) ? MSE.Data.Property._getArray(original, orderSourceFragments) : [];
+ var newArray = [];
+ if (orderArray.data)
+ newArray = orderArray.data.map(function(key) {
+ var fragments = MSE.Data.Property._getPropertyPathFragments(original, parentSource + "." + key);
+ return MSE.Data.Property._valueFromPropertyPathFragments(original, fragments)
+ }.bind(this));
+ if (returnArray)
+ return MS.Entertainment.Data.augmentArrayItems(newArray, itemFactory);
+ else
+ return new MSE.Data.VirtualList(itemFactory, newArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: (returnArray) ? Array.prototype.constructor : MSE.Data.VirtualList.prototype.constructor
+ };
+ return property
+ }, reorder: function(orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(true, orderSource, parentSource, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, reorderNoDeflate: function(orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(false, orderSource, parentSource, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, reorderArray: function(orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(true, orderSource, parentSource, itemAugmentationOrFactory, true);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, reorderArrayNoDeflate: function(orderSource, parentSource, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._reorder(false, orderSource, parentSource, itemAugmentationOrFactory, true);
+ result.augmentation = MSE.Data.Property.reorder;
+ result.augmentationOptions = {
+ orderSource: orderSource, parentSource: parentSource, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, intersection: function(source1, source2, comparer, merger, itemAugmentationOrFactory) {
+ var itemFactory;
+ if (!itemAugmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(itemAugmentationOrFactory.prototype))
+ itemFactory = MSE.Data.Factory.createAugmentationFactory(itemAugmentationOrFactory);
+ else
+ itemFactory = itemAugmentationOrFactory;
+ comparer = comparer || MS.Entertainment.Data.Comparer.defaultComparer;
+ merger = merger || MS.Entertainment.Data.Merger.defaultMerger;
+ var property = {
+ get: function intersection() {
+ var original = MSE.Data.deflate(this);
+ var fragments1 = MSE.Data.Property._getPropertyPathFragments(original, source1);
+ var fragments2 = MSE.Data.Property._getPropertyPathFragments(original, source2);
+ var array1 = MSE.Data.Property._getArray(original, fragments1);
+ var array2 = MSE.Data.Property._getArray(original, fragments2);
+ var array1Length = array1.length;
+ var array2Length = array2.length;
+ var combinedArray = [];
+ var i = 0,
+ j = 0;
+ var empty,
+ item1,
+ item2;
+ array1 = array1.data;
+ array2 = array2.data;
+ while ((i < array1Length || j < array2Length) && (i <= array1Length && j <= array2Length)) {
+ item1 = (i < array1Length) ? array1[i] : empty;
+ item2 = (j < array2Length) ? array2[j] : empty;
+ var compareResult = comparer(item1, item2);
+ var mergedResult = null;
+ if (compareResult === 0) {
+ mergedResult = merger(item1, item2);
+ i++;
+ j++
+ }
+ else if (compareResult < 0)
+ i++;
+ else
+ j++;
+ if (mergedResult !== null && mergedResult !== undefined)
+ combinedArray.push(mergedResult)
+ }
+ return new MSE.Data.VirtualList(itemFactory, combinedArray)
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true, resultConstructor: MSE.Data.VirtualList.prototype.constructor, augmentation: MSE.Data.Property.list, augmentationOptions: {
+ source1: source1, source2: source2, comparer: comparer, merger: merger, itemAugmentationOrFactory: itemAugmentationOrFactory
+ }
+ };
+ return property
+ }, _filter: function _filter(deflate, source, filter, itemAugmentationOrFactory) {
+ var merger = MS.Entertainment.Data.Merger.self;
+ var comparer = MS.Entertainment.Data.Comparer.createFilterComparer(filter);
+ var undefinedVariable;
+ return MSE.Data.Property._union(deflate, source, undefinedVariable, comparer, merger, itemAugmentationOrFactory)
+ }, filter: function filter(source, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._filter(true, source, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.filter;
+ result.augmentationOptions = {
+ source: source, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, filterNoDeflate: function filterNoDeflate(source, filter, itemAugmentationOrFactory) {
+ var result = MSE.Data.Property._filter(false, source, filter, itemAugmentationOrFactory);
+ result.augmentation = MSE.Data.Property.filterNoDeflate;
+ result.augmentationOptions = {
+ source: source, filter: filter, itemAugmentationOrFactory: itemAugmentationOrFactory
+ };
+ return result
+ }, containsRight: function containsRight(right) {
+ var property = {
+ get: function() {
+ if (this.rights)
+ for (var i = 0; i < this.rights.length; i++)
+ if (this.rights[i].licenseRight === right)
+ return true;
+ return false
+ }, augmented: true, cacheable: true, enumerable: true, configurable: true
+ };
+ return property
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Factory", {
+ array: function(data) {
+ if (data !== undefined)
+ return [data];
+ else
+ return []
+ }, joinStrings: function joinStrings() {
+ var strings = [];
+ if (arguments)
+ for (var i = 0; i < arguments.length; i++)
+ strings.push(arguments[i]);
+ return strings.join()
+ }, arrayJoin: function arrayJoin(data, seperator) {
+ seperator = seperator || "/";
+ var result = String.empty;
+ if (Array.isArray(data)) {
+ data = data.filter(function removeNullsAndNonStrings(element) {
+ return element !== null && element !== undefined && typeof element === "string"
+ });
+ result = data.join(seperator)
+ }
+ return result
+ }, arrayJoinWithNewLines: function arrayJoinWithNewLines(data) {
+ return MSE.Data.Factory.arrayJoin(data, "\n\n")
+ }, bool: function bool(data) {
+ return (data) ? true : false
+ }, not: function not(data) {
+ return (!data) ? true : false
+ }, boolFromString: function boolFromString(data) {
+ var re = /^((t)|(true)|(1)|(y)|(yes))$/i;
+ var type = typeof(data);
+ if (type === "boolean")
+ return data;
+ else
+ return (data && typeof(data) === "string" && data.match(re)) ? true : false
+ }, string: function string(data) {
+ return (data) ? "" + data : null
+ }, stringNoNewLines: function stringNoNewLines(data) {
+ if (data) {
+ data = "" + data;
+ data = data.replace(/(\r\n)|(\r)|(\n)|(\u2028)|(\u2029)/g, " ")
+ }
+ {};
+ return data
+ }, stringOrEmpty: function stringOrEmpty(data) {
+ if (typeof data === "string")
+ return data;
+ else
+ return ""
+ }, stringOrUnknown: function stringOrUnknown(data) {
+ var result = MS.Entertainment.Data.Factory.string(data);
+ return result || String.load(String.id.IDS_UNKNOWN_VALUE)
+ }, intNumber: function intNumber(data) {
+ return parseInt(data)
+ }, formattedIntNumber: function formattedIntNumber(data) {
+ var intValue = parseInt(data);
+ var formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(intValue);
+ return formattedNum
+ }, floatNumber: function floatNumber(data) {
+ return parseFloat(data)
+ }, date: function date(data) {
+ var returnValue;
+ if (!data)
+ returnValue = null;
+ else if (data.constructor === Date)
+ returnValue = new Date(data);
+ else if (data.constructor === String) {
+ var matches = data.match(/^\/Date\((-{0,1}[0-9]*)(\+|-){0,1}([0-9]{4}){0,1}\)\/$/);
+ if (matches && matches[1]) {
+ returnValue = new Date(parseInt(matches[1]));
+ if (matches[2] && matches[3])
+ if (matches[2] === "+")
+ returnValue.setUTCHours(returnValue.getUTCHours() - parseInt(matches[3]));
+ else
+ returnValue.setUTCHours(returnValue.getUTCHours() + parseInt(matches[3]))
+ }
+ else
+ returnValue = MSE.Data.stringParser.dateFromUTC(data)
+ }
+ else if (data.universalTime !== undefined)
+ returnValue = new Date(data.universalTime);
+ else
+ returnValue = null;
+ return returnValue
+ }, databaseDateFromYear: function databaseDateFromYear(year) {
+ var date = null;
+ var databaseDate = null;
+ var parsedYear = parseInt(year);
+ if (parsedYear >= 0) {
+ date = new Date(year, 1, 2, 0, 0, 0, 0);
+ databaseDate = MS.Entertainment.Formatters.formatDatabaseDataFromReleaseDate(date)
+ }
+ else
+ MS.Entertainment.Data.fail("Factory::databaseDateFromYear. Invalid year: " + year);
+ return databaseDate
+ }, dateNow: function dateNow() {
+ return new Date
+ }, databaseDate: function databaseDate(data) {
+ var returnValue;
+ if (!data || (data.constructor === String && (data === "0001-01-01T00:00:00.000Z" || data === "1601-01-01T00:00:00Z")))
+ returnValue = null;
+ else
+ returnValue = MSE.Data.Factory.date(data);
+ return returnValue
+ }, secondsToMilliseconds: function secondsToMilliseconds(data) {
+ return parseInt(data) * 1000
+ }, year: function year(data) {
+ var resultValue = null;
+ if (!data)
+ resultValue = null;
+ else if (data.constructor === Date)
+ resultValue = data.getFullYear();
+ else
+ resultValue = data;
+ return resultValue
+ }, localizedYear: function localizedYear(date) {
+ var year = String.empty;
+ var yearNumber = NaN;
+ if (date && date.constructor !== Date) {
+ if (String.isString(date))
+ yearNumber = parseInt(date);
+ if (isNaN(yearNumber))
+ date = new Date(date);
+ else {
+ date = new Date;
+ date.setFullYear(yearNumber)
+ }
+ }
+ if (date && !isNaN(date.getTime())) {
+ var formattedYear = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ year = formattedYear.format(date)
+ }
+ return year
+ }, randomDate: function randomDate(data) {
+ var daysBefore = Math.floor(Math.random() * 9 + 1);
+ var daysBeforeMS = daysBefore * 24 * 60 * 60 * 1000;
+ var returnValue = new Date((new Date).getTime() - daysBeforeMS);
+ returnValue.setMilliseconds(0);
+ returnValue.setSeconds(0);
+ returnValue.setMinutes(0);
+ returnValue.setHours(0);
+ return returnValue
+ }, timeSpan: function timeSpan(data) {
+ var returnValue;
+ if (typeof data === "string")
+ returnValue = MSE.Data.stringParser.timeSpanFromXmlDuration(data);
+ return returnValue
+ }, guid: function guid(data) {
+ if (data && data.replace && data.toLowerCase) {
+ data = data.toLowerCase();
+ data = data.replace(/(^http.*%2f)|(^urn:uuid:)|(^\s)|(\s$)/ig, String.empty)
+ }
+ return data
+ }, normalizeSpacing: function normalizeSpacing(source) {
+ if (source)
+ source = (source + "").trim().replace(/(\s+)/g, " ");
+ return source
+ }, appendCharacterDirection: function appendCharacterDirection(value) {
+ var result = value;
+ if (value && String.isString(value)) {
+ var appTextDirection = MSE.Utilities.getTextDirection();
+ var dataTextDirection = MSE.Utilities.detectStringDirection(value);
+ if (appTextDirection !== dataTextDirection) {
+ var directionMarkerCharacter = (dataTextDirection === MSE.Utilities.TextDirections.RightToLeft) ? String.rtlm : String.ltrm;
+ var firstCharacterDirection = MSE.Utilities.detectCharacterDirection(value.charCodeAt(0));
+ if (!firstCharacterDirection)
+ result = [directionMarkerCharacter, value, directionMarkerCharacter].join(String.empty);
+ else
+ result = value + directionMarkerCharacter
+ }
+ }
+ return result
+ }, normalizeTextDirection: function normalizeTextDirection(source, sourcePropertyPath, destination, destinationPropertyPath) {
+ var newString;
+ var oldString = MSE.Data.Property._valueFromPropertyPathFragments(source, sourcePropertyPath);
+ if (oldString === null || oldString === undefined || typeof oldString === "object")
+ newString = String.empty;
+ else if (oldString)
+ newString = MSE.Data.Factory.appendCharacterDirection(oldString);
+ if (newString || newString === String.empty)
+ MSE.Data.Property._setFromPropertyPathFragments(destination, destinationPropertyPath, newString)
+ }, normalizeStringForVoice: function normalizeStringForVoice(stringToScrub) {
+ return MSE.Data.Factory.stringOrEmpty(stringToScrub)
+ }, normalizeStringForVoiceShort: function normalizeStringForVoiceShort(stringToScrub) {
+ return MSE.Data.Factory.stringOrEmpty(stringToScrub)
+ }, normalizeStringForVoiceLong: function normalizeStringForVoiceLong(stringToScrub) {
+ return MSE.Data.Factory.stringOrEmpty(stringToScrub)
+ }, oneTimeUseBlob: function oneTimeUseBlob(data) {
+ var resultValue = null;
+ if (data)
+ resultValue = URL.createObjectURL(data, {oneTimeOnly: true});
+ return resultValue
+ }, parseJSON: function parseJSON(data) {
+ var result = null;
+ if (data)
+ try {
+ result = JSON.parse(data)
+ }
+ catch(error) {
+ MS.Entertainment.Data.fail("Failed to parse JSON. Error: " + (error && error.message))
+ }
+ return result
+ }, self: function self(data) {
+ return data
+ }, ListItemWrapper: MS.Entertainment.UI.Framework.define(function listItemWrapper(source, factory, initializer) {
+ Object.defineProperty(this, "_privateDataCache", {
+ value: {
+ source: source, factory: factory, initializer: initializer, group: null, isNonSourceData: false, isHeader: false, itemIndex: -1, groupIndexHint: null, groupKey: null, groupData: null, firstItemDescription: null, firstItemIndexHint: -1, firstItemKey: null
+ }, enumerable: false
+ })
+ }, {
+ key: null, data: {get: function() {
+ if (this._privateDataCache.factory) {
+ this._privateDataCache.data = this._privateDataCache.factory(this._privateDataCache.source);
+ if (this._privateDataCache.initializer)
+ this._privateDataCache.initializer(this._source, this._privateData);
+ this._privateDataCache.initializer = null;
+ this._privateDataCache.source = null;
+ this._privateDataCache.factory = null
+ }
+ return this._privateDataCache.data
+ }}, itemIndex: {
+ get: function() {
+ return this._privateDataCache.itemIndex
+ }, set: function(value) {
+ this._privateDataCache.itemIndex = value
+ }, enumerable: false
+ }, firstItemDescription: {
+ get: function() {
+ return this._privateDataCache.firstItemDescription || {sourceIndexHint: this.data && typeof this.data.firstItemIndexSourceHint === "number" ? this.data.firstItemIndexSourceHint : -1}
+ }, set: function(value) {
+ this._privateDataCache.firstItemDescription = value
+ }, enumerable: false
+ }, firstItemIndexHint: {
+ get: function() {
+ return this._privateDataCache.firstItemIndexHint
+ }, set: function(value) {
+ this._privateDataCache.firstItemIndexHint = value
+ }, enumerable: false
+ }, firstItemKey: {
+ get: function() {
+ return this._privateDataCache.firstItemKey
+ }, set: function(value) {
+ this._privateDataCache.firstItemKey = value
+ }, enumerable: false
+ }, groupIndexHint: {
+ get: function() {
+ return this._privateDataCache.groupIndexHint
+ }, set: function(value) {
+ this._privateDataCache.groupIndexHint = value
+ }, enumerable: false
+ }, groupKey: {
+ get: function() {
+ return this._privateDataCache.groupKey || (this.group && this.group.parentKey)
+ }, set: function(value) {
+ this._privateDataCache.groupKey = value
+ }, enumerable: false
+ }, groupData: {
+ get: function() {
+ return this._privateDataCache.groupData || this.data
+ }, set: function(value) {
+ this._privateDataCache.groupData = value
+ }, enumerable: false
+ }, isNonSourceData: {
+ get: function() {
+ return this._privateDataCache.isNonSourceData
+ }, set: function(value) {
+ this._privateDataCache.isNonSourceData = value
+ }, enumerable: false
+ }, isHeader: {
+ get: function() {
+ return this._privateDataCache.isHeader
+ }, set: function(value) {
+ this._privateDataCache.isHeader = value
+ }, enumerable: false
+ }, group: {
+ get: function() {
+ return this._privateDataCache.group
+ }, set: function(value) {
+ this._privateDataCache.group = value
+ }, enumerable: false
+ }, cached: {
+ get: function() {
+ return (!!this._privateDataCache.factory) || (this._privateDataCache.data !== undefined && this._privateDataCache !== null)
+ }, enumerable: false
+ }, clearCache: function clearCache() {
+ this._privateDataCache.data = null;
+ this._privateDataCache.initializer = null;
+ this._privateDataCache.source = null;
+ this._privateDataCache.factory = null
+ }
+ }, {
+ copyData: function copyData(destination, source, factory, initializer) {
+ destination._privateDataCache.data = null;
+ destination._privateDataCache.source = source;
+ destination._privateDataCache.factory = factory;
+ destination._privateDataCache.initializer = initializer;
+ return destination
+ }, addFirstItemKey: function firstItemKey(item, callback) {
+ this._addProperty("firstItemKey", item, callback)
+ }, addFirstItemIndexHint: function addFirstItemIndexHint(item, callback) {
+ this._addProperty("firstItemIndexHint", item, callback)
+ }, _addProperty: function _addProperty(property, item, callback) {
+ if (callback)
+ Object.defineProperty(item, property, {
+ get: function() {
+ if (callback)
+ return callback();
+ else
+ return this._privateDataCache && this._privateDataCache["firstItemIndexHint"]
+ }, set: function(value) {
+ callback = null;
+ this._privateDataCache["firstItemIndexHint"] = value
+ }, enumerable: false
+ })
+ }
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE.Data, "Factory", {
+ GroupHintWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function groupHintWrapper(source, factory, initializer) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.apply(this, arguments)
+ }, {getHashCode: function getHashCode() {
+ return this.data && this.data.groupKey
+ }}), ListHeaderWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function listHeaderWrapper(group, firstItemIndexHint) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.call(this);
+ this._privateDataCache.data = group.data;
+ this.group = group;
+ this.isNonSourceData = true;
+ this.isHeader = true;
+ this.firstItemIndexHint = firstItemIndexHint
+ }, {preventAugmentation: true}), ListActionItemWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function listHeaderWrapper(data) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.call(this);
+ this._privateDataCache.data = data;
+ this.isNonSourceData = true;
+ this.groupKey = MS.Entertainment.Data.emptyGroupKey;
+ this.groupIndexHint = 0
+ }, {
+ isAction: true, preventAugmentation: true
+ }), ListNoHeaderItemWrapper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.Factory.ListItemWrapper", function listNoHeaderItemWrapper(data) {
+ MSE.Data.Factory.ListItemWrapper.prototype.constructor.call(this);
+ this._privateDataCache.data = data;
+ this.isNonSourceData = true;
+ this.groupKey = MS.Entertainment.Data.emptyGroupKey;
+ this.groupIndexHint = 0
+ }, {
+ noHeader: true, preventAugmentation: true
+ }), createAugmentationFactory: function createAugmentationFactory(augmentation) {
+ return function augmentationFactory(sourceItem) {
+ return MSE.Data.augment(sourceItem, augmentation)
+ }
+ }, createDerivedAugmentationOrFactory: function createDerivedAugmentationOrFactory(augmentationOrFactory, definition) {
+ var result;
+ if (!augmentationOrFactory || MSE.Data.Augmentation.prototype.isPrototypeOf(augmentationOrFactory.prototype))
+ result = MS.Entertainment.Data.derive(augmentationOrFactory || null, null, definition);
+ else
+ result = function augmentationFactory(sourceItem) {
+ var value = augmentationOrFactory(sourceItem);
+ return MS.Entertainment.Data.Augmentation.addProperties(value, definition)
+ };
+ return result
+ }, createListItemAugmentationFactory: function createListItemAugmentationFactory(augmentation, initializer, ListItemWrapperConstructor) {
+ return MSE.Data.Factory.createListItemFactory(MSE.Data.Factory.createAugmentationFactory(augmentation), initializer, ListItemWrapperConstructor)
+ }, createListItemFactory: function createListItemFactory(innerFactory, initializer, ListItemWrapperConstructor) {
+ if (!innerFactory)
+ throw"must provide an inner factory if creating a lazy factory method";
+ var factory = function factoryMethod(source, destination) {
+ if (source && source.preventAugmentation)
+ return source;
+ else if (destination)
+ return MS.Entertainment.Data.Factory.ListItemWrapper.copyData(destination, source, innerFactory, initializer);
+ else if (ListItemWrapperConstructor)
+ return new ListItemWrapperConstructor(source, innerFactory, initializer);
+ else
+ return new MS.Entertainment.Data.Factory.ListItemWrapper(source, innerFactory, initializer)
+ };
+ factory.listItemFactory = true;
+ return factory
+ }
+ })
+})()
+})();
+/* >>>>>>/framework/data/ranges.js:16918 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+(function(MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {Ranges: MS.Entertainment.UI.Framework.define(function ranges(initialRanges) {
+ this._ranges = [];
+ if (Array.isArray(initialRanges))
+ initialRanges.forEach(function addRange(range) {
+ this._ranges.push(this._createRange(range.start, range.end))
+ }, this);
+ else if (initialRanges)
+ this._ranges.push(this._createRange(initialRanges.start, initialRanges.end))
+ }, {
+ singleItems: false, _ranges: null, _cachedTotal: -1, _createRange: function _createRange(index, endIndex) {
+ return {
+ start: index, end: isNaN(endIndex) ? index : endIndex
+ }
+ }, total: {get: function get_total() {
+ this._initializeTotal();
+ return this._cachedTotal
+ }}, ranges: {get: function() {
+ return this._ranges.map(function(item) {
+ return this._createRange(item.start, item.end)
+ }, this)
+ }}, printRanges: function printRanges() {
+ Debug.console.log(0, "[START PRINT RANGES]");
+ this._ranges.forEach(function(item) {
+ Debug.console.log(0, "[RANGE] [start = " + item.start + "] [end = " + item.end + "]")
+ }, this);
+ Debug.console.log(0, "[END PRINT RANGES]")
+ }, shift: function shift(startIndex, forward) {
+ var i;
+ var increase = (forward) ? 1 : -1;
+ var foundRangeIndex = -1;
+ var foundRange;
+ for (i = 0; i < this._ranges.length; i++)
+ if ((this._ranges[i].start > startIndex) || (this._ranges[i].end >= startIndex)) {
+ foundRangeIndex = i;
+ break
+ }
+ if (foundRangeIndex >= 0) {
+ foundRange = this._ranges[foundRangeIndex];
+ if (foundRange.start < startIndex && foundRange.end >= startIndex) {
+ if (increase > 0) {
+ this._ranges.splice(foundRangeIndex, 0, this._createRange(foundRange.start, startIndex - 1));
+ foundRange.start = startIndex
+ }
+ else
+ foundRange.end += increase;
+ if (foundRange.end < foundRange.start)
+ this._ranges.splice(foundRangeIndex, 1);
+ else
+ foundRangeIndex++
+ }
+ for (i = foundRangeIndex; i < this._ranges.length; i++) {
+ this._ranges[i].start += increase;
+ this._ranges[i].end += increase
+ }
+ if (!this.singleItems) {
+ var right = this._ranges[foundRangeIndex + 1];
+ if (right && right.start <= foundRange.end + 1) {
+ foundRange.end = right.end;
+ this._ranges.splice(foundRangeIndex + 1, 1)
+ }
+ var left = this._ranges[foundRangeIndex - 1];
+ if (left && left.end >= foundRange.start - 1) {
+ foundRange.start = left.start;
+ this._ranges.splice(foundRangeIndex - 1, 1)
+ }
+ }
+ }
+ }, get: function get(index) {
+ return this._ranges ? this._ranges[index] : null
+ }, forEach: function forEach(callback, that) {
+ if (this._ranges)
+ for (var i = 0; i < this._ranges.length; i++)
+ if (callback.call(that || window, this._ranges[i]))
+ break
+ }, findLessThanOrEqual: function findLessThanOrEqual(index) {
+ var i;
+ var foundRangeIndex = -1;
+ for (i = 0; i < this._ranges.length; i++) {
+ if (this._ranges[i].end > index)
+ break;
+ foundRangeIndex = i
+ }
+ return foundRangeIndex
+ }, findIndex: function findIndex(index) {
+ var i;
+ var foundRangeIndex = -1;
+ for (i = 0; i < this._ranges.length; i++)
+ if (this._ranges[i].start <= index && this._ranges[i].end >= index) {
+ foundRangeIndex = i;
+ break
+ }
+ return foundRangeIndex
+ }, find: function find(index) {
+ var foundRange = null;
+ var foundRangeIndex = this.findIndex(index);
+ if (foundRangeIndex >= 0)
+ foundRange = this._ranges[foundRangeIndex];
+ return foundRange
+ }, insert: function insert(index) {
+ var i;
+ var foundRangeIndex = -1;
+ var foundRange;
+ var inserted = true;
+ for (i = 0; i < this._ranges.length; i++)
+ if (this._ranges[i].end + 1 >= index && this._ranges[i].start - 1 <= index && !this.singleItems) {
+ foundRangeIndex = i;
+ foundRange = this._ranges[foundRangeIndex];
+ break
+ }
+ else if (this._ranges[i].start > index) {
+ foundRangeIndex = i;
+ break
+ }
+ if (foundRangeIndex < 0)
+ foundRangeIndex = this._ranges.length;
+ if (!foundRange) {
+ foundRange = this._createRange(index);
+ this._ranges.splice(foundRangeIndex, 0, foundRange)
+ }
+ else if (foundRange.end + 1 === index)
+ foundRange.end = index;
+ else if (foundRange.start - 1 === index)
+ foundRange.start = index;
+ else
+ inserted = false;
+ if (!this.singleItems) {
+ var right = this._ranges[foundRangeIndex + 1];
+ if (right && right.start - 1 <= foundRange.end) {
+ foundRange.end = right.end;
+ this._ranges.splice(foundRangeIndex + 1, 1)
+ }
+ var left = this._ranges[foundRangeIndex - 1];
+ if (left && left.end + 1 >= foundRange.start) {
+ foundRange.start = left.start;
+ this._ranges.splice(foundRangeIndex - 1, 1)
+ }
+ }
+ if (inserted)
+ this._updateCachedTotal(1);
+ return foundRange
+ }, remove: function remove(index) {
+ var i;
+ var foundRangeIndex = -1;
+ var foundRange;
+ var rangeRemovedFrom;
+ var split = false;
+ var removed = false;
+ for (i = 0; i < this._ranges.length; i++)
+ if (this._ranges[i].end >= index && this._ranges[i].start <= index) {
+ foundRangeIndex = i;
+ break
+ }
+ rangeRemovedFrom = foundRange = this._ranges[foundRangeIndex];
+ if (foundRange && foundRange.start <= index) {
+ split = true;
+ removed = true;
+ if (foundRange.start === index) {
+ split = false;
+ foundRange.start = index + 1
+ }
+ if (foundRange.end === index) {
+ split = false;
+ foundRange.end = index - 1
+ }
+ if (foundRange.start > foundRange.end) {
+ split = false;
+ foundRange = null;
+ this._ranges.splice(foundRangeIndex, 1)
+ }
+ }
+ if (split) {
+ this._ranges.splice(foundRangeIndex + 1, 0, this._createRange(index + 1, foundRange.end));
+ foundRange.end = Math.max(0, index - 1)
+ }
+ if (foundRange && !this.singleItems) {
+ var right = this._ranges[foundRangeIndex + 1];
+ if (right && right.start - 1 <= foundRange.end) {
+ foundRange.end = right.end;
+ this._ranges.splice(foundRangeIndex + 1, 1)
+ }
+ var left = this._ranges[foundRangeIndex - 1];
+ if (left && left.end + 1 >= foundRange.start) {
+ foundRange.start = left.start;
+ this._ranges.splice(foundRangeIndex - 1, 1)
+ }
+ }
+ if (removed)
+ this._updateCachedTotal(-1);
+ return rangeRemovedFrom
+ }, exclusionCount: function exclusionCount(startIndex, endIndex, consecutive) {
+ return this._count(startIndex, endIndex, consecutive, true)
+ }, count: function count(startIndex, endIndex, consecutive) {
+ return this._count(startIndex, endIndex, consecutive, false)
+ }, _count: function _count(startIndex, endIndex, consecutive, exclusion) {
+ var i,
+ range,
+ start,
+ end,
+ delta;
+ var count = 0;
+ if (startIndex > endIndex && !isNaN(endIndex))
+ return count;
+ for (i = 0; i < this._ranges.length; i++) {
+ range = this._ranges[i];
+ start = range.start;
+ end = range.end;
+ if (exclusion && start === startIndex) {
+ delta = end - start + 1;
+ startIndex += delta;
+ endIndex += delta;
+ count += delta
+ }
+ if (end < startIndex)
+ continue;
+ else if (start > endIndex)
+ break;
+ if (start < startIndex)
+ start = startIndex;
+ if (end > endIndex)
+ end = endIndex;
+ delta = end - start + 1;
+ if (exclusion && startIndex !== endIndex)
+ endIndex += delta;
+ count += delta;
+ if (consecutive) {
+ if (start > startIndex)
+ count = 0;
+ break
+ }
+ }
+ return count
+ }, countFromEnd: function countFromEnd(startIndex, endIndex, inclusive) {
+ var i,
+ range,
+ start,
+ end;
+ var count = 0;
+ if (startIndex > endIndex)
+ return count;
+ for (i = this._ranges.length - 1; i >= 0; i--) {
+ range = this._ranges[i];
+ start = range.start;
+ end = range.end;
+ if (end < startIndex || start > endIndex)
+ continue;
+ if (start < startIndex)
+ start = startIndex;
+ if (end > endIndex)
+ end = endIndex;
+ count += end - start + 1;
+ if (inclusive) {
+ if (end < endIndex)
+ count = 0;
+ break
+ }
+ }
+ return count
+ }, _initializeTotal: function _initializeTotal() {
+ if (this._cachedTotal < 0)
+ this._cachedTotal = this.count(0);
+ return this._cachedTotal
+ }, _updateCachedTotal: function _updateCachedTotal(change) {
+ if (this._cachedTotal >= 0) {
+ this._cachedTotal += change;
+ MS.Entertainment.Data.assert(this._cachedTotal >= 0, "Cache total has gotten out of wack. cached total = " + this._cachedTotal)
+ }
+ return this._cachedTotal
+ }
+ })})
+})(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/grouper.js:17196 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+(function(MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ listGrouperEvents: {batchChange: "batchChange"}, emptyGrouper: {
+ isEmpty: true, noHeaderGroups: true, execute: function execute() {
+ return null
+ }
+ }, emptyGroupKey: "noGroupHeader", ListGrouperBase: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Utilities.EventInvoker", function listGrouper(grouper, dataSource) {
+ if (grouper && !grouper.execute)
+ throw new Error("Invalid galleryGrouper passed to ListGrouper");
+ if (dataSource && dataSource.setGrouper)
+ this._dataSource = dataSource;
+ this._grouper = grouper;
+ this._reset()
+ }, {
+ _dataSourceReadySignal: null, _dataSource: null, _grouper: null, _groups: null, _groupHints: null, _headerRanges: null, _pendingChanges: null, _stopInsertingGroupHintHeaders: false, _groupHintsDispatchCount: 100, _pendingInserts: 0, _tracingId: 0, dispose: function dispose() {
+ if (this._dataSourceReadySignal) {
+ this._dataSourceReadySignal.error(new Error("Grouper has been disposed"));
+ this._dataSourceReadySignal = null
+ }
+ if (this._dataSource) {
+ this._dataSource.setGrouper(null);
+ this._dataSource = null
+ }
+ }, dataSource: {get: function get_dataSource() {
+ return this._dataSource
+ }}, dataSourceReady: {get: function get_dataSourceReady() {
+ return WinJS.Promise.as(this._dataSourceReadySignal && this._dataSourceReadySignal.promise)
+ }}, groupHints: {
+ get: function() {
+ return this._groupHints
+ }, set: function(value) {
+ this.setGroupHints(value)
+ }
+ }, grouper: {get: function() {
+ return this._grouper
+ }}, isGrouperEmpty: {get: function() {
+ return !this._grouper || !!this._grouper.isEmpty
+ }}, isInlineGrouper: {get: function get_isInlineGrouper() {
+ MS.Entertainment.Data.fail("Derived classes must define isInlineGrouper.")
+ }}, headerRanges: {get: function() {
+ if (this._headerRanges)
+ return this._headerRanges.ranges;
+ else
+ return []
+ }}, headerIndices: {get: function() {
+ var result = [];
+ if (this._headerRanges)
+ this._headerRanges.ranges.forEach(function(item) {
+ result.push(item.start)
+ });
+ return result
+ }}, headerCount: {get: function get_headerCount() {
+ var result = 0;
+ if (this._headerRanges)
+ result = this._headerRanges.total;
+ return result
+ }}, reset: function reset() {
+ this._reset();
+ this._onReset()
+ }, _getTracingId: function _getTracingId() {
+ this._tracingId++;
+ return this._tracingId
+ }, _reset: function _reset() {
+ this._headerRanges = new MS.Entertainment.Data.Ranges;
+ this._headerRanges.singleItems = true;
+ this._groups = {};
+ this._groupHints = null;
+ this._pendingChanges = null;
+ this._stopInsertingGroupHintHeaders = false;
+ if (this._dataSourceReadySignal) {
+ this._dataSourceReadySignal.error(new Error("ListGrouper has been reset"));
+ this._dataSourceReadySignal = null
+ }
+ if (this.dataSource) {
+ this._dataSourceReadySignal = new MS.Entertainment.UI.Framework.Signal;
+ this.dataSource.setGrouper(this).done(function setGrouperSucceeded() {
+ if (this._dataSourceReadySignal)
+ this._dataSourceReadySignal.complete()
+ }.bind(this), function setGrouperFailed(error) {
+ if (this._dataSourceReadySignal)
+ this._dataSourceReadySignal.error(error)
+ }.bind(this))
+ }
+ }, _onReset: function _onReset(){}, clear: function clear() {
+ var ranges;
+ if (this._headerRanges && this.isInlineGrouper)
+ ranges = this._headerRanges.ranges;
+ else {
+ this._headerRanges = new MS.Entertainment.Data.Ranges;
+ this._headerRanges.singleItems = true
+ }
+ if (ranges)
+ for (var i = ranges.length - 1; i >= 0; i--)
+ this._removeHeader(ranges[i].start);
+ this._dispatchChanges();
+ this._groups = {}
+ }, setGroupHints: function setGroupHints(value) {
+ var result;
+ var tracingId = this._getTracingId();
+ if (this._groupHints !== value) {
+ msWriteProfilerMark("ent:ListGrouperBase:setGroupHints: " + tracingId + ",StartTM");
+ var oldValue = this._groupHints;
+ this._groupHints = value;
+ result = this._onGroupHintsChanged(value, oldValue).then(function setGroupHints(promiseResult) {
+ this._groupHints = value;
+ msWriteProfilerMark("ent:ListGrouperBase:setGroupHints: " + tracingId + ",StopTM");
+ return promiseResult
+ }.bind(this))
+ }
+ return WinJS.Promise.as(result)
+ }, groupHintIndexFromIndex: function groupHintIndexFromIndex(index) {
+ var result = -1;
+ if (this._groupHints && this._groupHints.forEach) {
+ var async = true;
+ this._groupHints.forEach(function(args) {
+ if (args.item.firstItemIndexHint <= index && args.item.firstItemIndexHint + args.item.data.totalCount - 1 >= index) {
+ result = args.item.itemIndex;
+ args.stop = true
+ }
+ }).done(function() {
+ async = false
+ }, function ignoreErrors(error) {
+ MS.Entertainment.Data.fail("Unexcepted error searching for source index. error: " + (error && error.message))
+ });
+ MS.Entertainment.Data.assert(!async, "The groupHints data source should not be an async data source.")
+ }
+ return result
+ }, groupHintIndexFromGroupHintKey: function groupHintIndexFromGroupHintKey(key) {
+ var result = -1;
+ if (key && this._groupHints && this._groupHints.indexFromKey)
+ result = this._groupHints.indexFromKey(key);
+ return result
+ }, firstItemIndexFromGroupHintKey: function firstItemIndexFromGroupHintKey(groupHintKey) {
+ var index = -1;
+ var groupHintIndex = -1;
+ var groupHint;
+ if (this._groupHints && this._groupHints.indexFromKey)
+ groupHintIndex = this._groupHints.indexFromKey(groupHintKey);
+ if (groupHintIndex >= 0 && groupHintIndex < this._groupHints.count)
+ groupHint = this._groupHints.getItem(groupHintIndex);
+ if (groupHint)
+ index = groupHint.firstItemIndexHint;
+ return index
+ }, groupIndexFromSourceIndex: function groupIndexFromSourceIndex(sourceIndex) {
+ var result = -1;
+ if (this._headerRanges)
+ result = this._headerRanges.findLessThanOrEqual(sourceIndex);
+ return result
+ }, groupSizeFromGroupIndex: function groupSizeFromGroupIndex(groupIndex) {
+ var groupSize = 0;
+ var groupCache = null;
+ var groupCacheAfter = null;
+ var listSize = 0;
+ if (this.dataSource)
+ listSize = this.dataSource.count;
+ if (this._headerRanges) {
+ groupCache = this._headerRanges.get(groupIndex);
+ groupCacheAfter = this._headerRanges.get(groupIndex + 1)
+ }
+ if (groupCache)
+ if (groupCacheAfter)
+ groupSize = groupCacheAfter.start - groupCache.start;
+ else if (listSize > 0)
+ groupSize = listSize - groupCache.start;
+ if (groupSize > 0 && this.isInlineGrouper)
+ groupSize--;
+ return groupSize
+ }, _leftGroupFromSourceIndex: function _leftGroupFromSourceIndex(sourceIndex) {
+ var group = null;
+ var index = -1;
+ var range = null;
+ if (this._headerRanges)
+ index = this._headerRanges.findLessThanOrEqual(sourceIndex);
+ if (index >= 0)
+ range = this._headerRanges.get(index);
+ if (range && range.data)
+ group = range.data;
+ return group
+ }, _leftGroupHintFromSourceIndex: function _leftGroupHintFromSourceIndex(sourceIndex) {
+ return this.groupHintIndexFromGroup(this._leftGroupFromSourceIndex(sourceIndex))
+ }, groupIndexFromKey: function groupIndexFromKey(groupKey) {
+ var result = -1;
+ var currentIndex = -1;
+ if (this._headerRanges)
+ this._headerRanges.forEach(function(range) {
+ var exit = false;
+ currentIndex++;
+ if (range.data && range.data.key === key) {
+ result = currentIndex;
+ exit = true
+ }
+ return exit
+ });
+ return result
+ }, firstGroupItemIndexFromKey: function firstGroupItemIndexFromKey(groupKey) {
+ var result = -1;
+ if (this._groups && this._groups[groupKey])
+ result = this._groups[groupKey].start;
+ return result
+ }, groupHintIndexFromGroup: function groupHintIndexFromGroup(group) {
+ var groupHintIndex = -1;
+ if (group && group.parentKey && this.groupHints && this.groupHints.indexFromKey) {
+ groupHintIndex = this.groupHints.indexFromKey(group.parentKey);
+ if (typeof groupHintIndex !== "number")
+ groupHintIndex = -1
+ }
+ return groupHintIndex
+ }, countHeaders: function countHeaders(startIndex, endIndex) {
+ return 0
+ }, exclusionCountHeaders: function exclusionCountHeaders(startIndex, endIndex) {
+ return 0
+ }, calculate: function calculate(item) {
+ return (item && item.group) || (this._grouper ? this._grouper.execute(item) : null)
+ }, copy: function copy(item, oldItem) {
+ if (item && oldItem) {
+ item.group = oldItem.group;
+ item.isHeader = oldItem.isHeader
+ }
+ return item
+ }, isValidGroupOrParentGroup: function isValidGroupOrParentGroup(group) {
+ return !!(group && group.key) || !!(group && group.parentKey)
+ }, isValidGroup: function isValidGroup(group) {
+ return !!(group && group.key)
+ }, update: function update(index, item, existingItems) {
+ return this._insert(index, item, existingItems, true)
+ }, insert: function insert(index, item, existingItems) {
+ return this._insert(index, item, existingItems, false)
+ }, remove: function remove(index, item, existingItems) {
+ return this._remove(index, item, existingItems)
+ }, _sourceIndexFromIndex: function _sourceIndexFromIndex(index) {
+ var sourceIndex = index;
+ if (this._dataSource && this._dataSource.indexToSourceIndex)
+ sourceIndex = this._dataSource.indexToSourceIndex(index);
+ return sourceIndex
+ }, _sourceIndexToIndex: function _sourceIndexToIndex(sourceIndex) {
+ var index = sourceIndex;
+ if (this._dataSource && this._dataSource.indexFromSourceIndex)
+ index = this._dataSource.indexFromSourceIndex(index);
+ return index
+ }, _addGetHashCode: function _addGetHashCode(listItem, group) {
+ if (listItem && !listItem.getHashCode && group && group.parentKey) {
+ var parentKey = group.parentKey;
+ listItem.getHashCode = function getHashCode() {
+ return parentKey
+ }
+ }
+ listItem = null;
+ group = null
+ }, _createGroupHintListItem: function _createGroupHintListItem(firstItemIndex, group) {
+ var groupHint = {
+ Name: group.parentData && group.parentData.title, GroupId: group.parentKey
+ };
+ if (this._groupHints && this._groupHints.createItem) {
+ groupHint = this._groupHints.createItem(groupHint);
+ groupHint.preventAugmentation = true;
+ this._addGetHashCode(groupHint, group)
+ }
+ return groupHint
+ }, _insertGroupHintFromGroupIfNeeded: function _insertGroupHintFromGroupIfNeeded(firstItemIndex, group, itemBefore, itemAfter) {
+ if (!this._groupHints || !group)
+ return false;
+ var inserted = false;
+ var groupHintIndex = this.groupHintIndexFromGroup(group);
+ if (this._groupHints && groupHintIndex >= 0 && groupHintIndex < this._groupHints.count)
+ this._updateGroupHintSize(this._groupHints.getItem(groupHintIndex), 1);
+ else {
+ var itemBeforeGroupHintIndex = this.groupHintIndexFromGroup(itemBefore && itemBefore.group);
+ var itemAfterGroupHintIndex = this.groupHintIndexFromGroup(itemAfter && itemAfter.group);
+ var groupHint = this._createGroupHintListItem(firstItemIndex, group);
+ if (itemBeforeGroupHintIndex >= 0)
+ groupHintIndex = itemBeforeGroupHintIndex + 1;
+ else if (itemAfterGroupHintIndex >= 0)
+ groupHintIndex = itemAfterGroupHintIndex;
+ else if (this._groupHints.count === 0 || this._isStartOrEnd(itemBefore))
+ groupHintIndex = 0;
+ else if (this._isStartOrEnd(itemAfter))
+ groupHintIndex = this._groupHints.count;
+ else
+ groupHintIndex = this._leftGroupHintFromSourceIndex(firstItemIndex);
+ MS.Entertainment.Data.assert(groupHintIndex >= 0 || (this._isUnknown(itemBefore) && this._isUnknown(itemAfter)), "Couldn't find a spot for the missing group hint.");
+ if (groupHintIndex >= 0) {
+ var async = true;
+ inserted = true;
+ this._groupHints.insertAt(groupHintIndex, groupHint).done(function() {
+ async = false
+ }, function ignoreError(error) {
+ MS.Entertainment.Data.assert(WinJS.Promise.isCanceledError(error), "An unknown error occurred while adding a new group hint. error: " + (error && error.message))
+ });
+ MS.Entertainment.Data.assert(!async, "The groupHints data source should not be an async data source.");
+ this._initializeGroupHintAndSizes(this._groupHints.getItem(groupHintIndex), this._sourceIndexFromIndex(firstItemIndex))
+ }
+ }
+ return inserted
+ }, _insertHeaderIfNeeded: function _insertHeaderIfNeeded(index, group, itemBefore, itemAfter) {
+ var inserted = false;
+ if (group && this.isValidGroup(group)) {
+ var lastKnownIndex = -1;
+ if (this._groups[group.key])
+ lastKnownIndex = this._groups[group.key].start;
+ if (lastKnownIndex < 0) {
+ this._insertHeader(index, group, itemBefore, itemAfter);
+ lastKnownIndex = index;
+ inserted = true
+ }
+ }
+ return inserted
+ }, _updateHeaderIfNeeded: function _updateHeaderIfNeeded(newGroup) {
+ if (newGroup && !newGroup.fromGroupHint) {
+ var groupRange = this._groups[newGroup.key];
+ var firstItemIndex = -1;
+ var groupListItem = null;
+ if (groupRange && groupRange.data && groupRange.data.fromGroupHint) {
+ firstItemIndex = groupRange.start;
+ groupRange.data = null
+ }
+ if (firstItemIndex >= 0) {
+ groupListItem = new MS.Entertainment.Data.Factory.ListHeaderWrapper(newGroup, firstItemIndex);
+ this._pushPendingChange({
+ change: "Update", absoluteIndex: firstItemIndex, value: groupListItem, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ });
+ this._onHeaderUpdated(firstItemIndex, groupListItem)
+ }
+ }
+ }, _onHeaderUpdated: function _onHeaderUpdated(firstItemIndex, groupListItem){}, _createHeaderItem: function _createHeaderItem(firstItemIndex, group) {
+ return new MS.Entertainment.Data.Factory.ListHeaderWrapper(group, firstItemIndex)
+ }, _insertItem: function _insertItem(index, item, itemBefore, itemAfter) {
+ this._insertGroupHintFromGroupIfNeeded(index, item && item.group, itemBefore, itemAfter)
+ }, _updateItem: function _updateItem(index, item, itemBefore, itemAfter, oldGroup) {
+ var groupHintIndex = -1;
+ var newGroup = item && item.group;
+ if (oldGroup && newGroup && !this._areGroupsEqual(oldGroup, newGroup))
+ groupHintIndex = this.groupHintIndexFromGroupHintKey(oldGroup.parentKey);
+ if (groupHintIndex >= 0) {
+ this._removeItemFromGroupHint(groupHintIndex);
+ this._insertGroupHintFromGroupIfNeeded(index, item && item.group, itemBefore, itemAfter)
+ }
+ }, _updateHeader: function _updateHeader(firstItemIndex, group) {
+ var groupListItem = this._createHeaderItem(firstItemIndex, group);
+ MS.Entertainment.Data.assert(group, "The group header being inserted is null");
+ MS.Entertainment.Data.assert(this._groups[group.key], "Updating a header that doesn't exist, this should not happen");
+ var groupCache = this._groups[group.key];
+ if (groupCache)
+ groupCache.data = group;
+ this._pushPendingChange({
+ change: "Update", absoluteIndex: firstItemIndex, value: groupListItem, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ })
+ }, _insertHeader: function _insertHeader(firstItemIndex, group, itemBefore, itemAfter) {
+ var groupListItem = this._createHeaderItem(firstItemIndex, group);
+ MS.Entertainment.Data.assert(group, "The group header being inserted is null");
+ MS.Entertainment.Data.assert(!group || group.key, "The group header key being inserted is null");
+ MS.Entertainment.Data.assert(!this._groups[group.key], "Inserting a header that already exists, this should not happen");
+ if (this.isInlineGrouper) {
+ this._insertItem(firstItemIndex, groupListItem, itemBefore, itemAfter);
+ this._headerRanges.shift(firstItemIndex, true)
+ }
+ this._groups[group.key] = this._headerRanges.insert(firstItemIndex);
+ this._groups[group.key].data = group;
+ this._pendingInserts++;
+ this._pushPendingChange({
+ change: "Add", absoluteIndex: firstItemIndex, value: groupListItem, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ });
+ this._onHeaderInserted(firstItemIndex, groupListItem)
+ }, _onHeaderInserted: function _onHeaderInserted(firstItemIndex, groupListItem){}, _removeItem: function _removeItem(index) {
+ var groupHintIndex = this.groupHintIndexFromIndex(index);
+ this._removeItemFromGroupHint(groupHintIndex)
+ }, _removeItemFromGroupHint: function _removeItemFromGroupHint(groupHintIndex) {
+ var groupHint;
+ if (this._groupHints && groupHintIndex >= 0 && groupHintIndex < this._groupHints.count)
+ groupHint = this._groupHints.getItem(groupHintIndex);
+ if (groupHint) {
+ this._updateGroupHintSize(groupHint, -1);
+ if (groupHint.data && groupHint.data.totalCount <= 0)
+ this._groupHints.removeAt(groupHintIndex)
+ }
+ }, _removeHeader: function _removeHeader(firstItemIndex, group) {
+ MS.Entertainment.Data.assert(firstItemIndex >= 0, "Item index should be negative");
+ this._pushPendingChange({
+ change: "Remove", absoluteIndex: firstItemIndex, groupIndex: this.groupIndexFromSourceIndex(firstItemIndex)
+ });
+ this._onHeaderRemoved(firstItemIndex);
+ var removedRange = !!this._headerRanges.remove(firstItemIndex);
+ MS.Entertainment.Data.assert(removedRange, "No range was removed");
+ if (!group && removedRange)
+ group = removedRange.data;
+ MS.Entertainment.Data.assert(!removedRange || !removedRange.data || !group || group.key === removedRange.data.key, "We removed the wrong range from the header ranges.");
+ if (group && group.key && group.key in this._groups)
+ delete this._groups[group.key];
+ if (this.isInlineGrouper) {
+ this._removeItem(firstItemIndex);
+ this._headerRanges.shift(firstItemIndex + 1, false)
+ }
+ }, _onHeaderRemoved: function _onHeaderRemoved(firstItemIndex){}, _onDispatchingChanges: function _onDispatchingChanges(changes){}, _pushPendingChange: function _pushPendingChange(change) {
+ this._pendingChanges = this._pendingChanges || [];
+ this._pendingChanges.push(change)
+ }, _dispatchChanges: function _dispatchChanges() {
+ var tracingId = this._getTracingId();
+ var pendingChanges = this._pendingChanges;
+ this._pendingChanges = null;
+ this._pendingInserts = 0;
+ if (pendingChanges && pendingChanges.length) {
+ msWriteProfilerMark("ent:ListGrouperBase:_dispatchChanges: " + tracingId + ",StartTM");
+ this._onDispatchingChanges(pendingChanges);
+ this.dispatchEvent(MS.Entertainment.Data.listGrouperEvents.batchChange, {
+ sender: this, changes: pendingChanges
+ });
+ msWriteProfilerMark("ent:ListGrouperBase:_dispatchChanges: " + tracingId + ",StopTM")
+ }
+ }, _onGroupHintsChanged: function _onGroupHintsChanged(newValue, oldValue) {
+ var firstGroupHints = !!newValue && !oldValue;
+ var ranges = [];
+ var headersInserted = 0;
+ var tracingId = this._getTracingId();
+ if (!firstGroupHints)
+ this._stopInsertingGroupHintHeaders = true;
+ if (!newValue)
+ return WinJS.Promise.wrap();
+ var returnPromise = newValue.forEachAll(function addItem(args) {
+ var item = args.item;
+ this._initializeGroupHint(item)
+ }.bind(this)).then(null, function handleError(error) {
+ MS.Entertainment.Data.fail("forEachAll failed when expanding group hints. error: " + (error && error.message))
+ });
+ if (!this._stopInsertingGroupHintHeaders) {
+ msWriteProfilerMark("ent:ListGrouperBase:instertGroupHintAsHeader: " + tracingId + ",StartTM");
+ newValue.forEachAll(function addItem(args) {
+ if (this._stopInsertingGroupHintHeaders) {
+ args.stop = true;
+ return
+ }
+ var item = args.item;
+ this._insertGroupFromGroupHint(item);
+ if (this._groupHintsDispatchCount > 0 && this.headerCount % this._groupHintsDispatchCount === 0) {
+ this._dispatchChanges();
+ return WinJS.Promise.timeout()
+ }
+ }.bind(this)).then(null, function ingoreError(){}).done(function dispatchChanges() {
+ this._dispatchChanges();
+ msWriteProfilerMark("ent:ListGrouperBase:instertGroupHintAsHeader: " + tracingId + ",StopTM")
+ }.bind(this))
+ }
+ return returnPromise
+ }, _insertGroupFromGroupHint: function _insertGroupFromGroupHint(groupHint) {
+ var group;
+ if (!groupHint || !groupHint.data)
+ return;
+ var subGroupHint;
+ var subGroupHintsLength = groupHint.data.subGroupHints ? groupHint.data.subGroupHints.length : 0;
+ if (subGroupHintsLength && groupHint.data.firstItemIndexSourceHint >= 0)
+ for (var i = 0; i < subGroupHintsLength; i++) {
+ subGroupHint = groupHint.data.subGroupHints[i];
+ this._insertGroupFromGroupHint({data: subGroupHint})
+ }
+ else if (!subGroupHintsLength && groupHint.data.firstItemIndexSourceHint >= 0)
+ group = this.calculate(groupHint);
+ if (group) {
+ group.fromGroupHint = true;
+ this._insertGroupHeaderFromGroupHint(groupHint, group)
+ }
+ }, _groupFromKey: function _groupFromKey(key) {
+ return (this._groups && this._groups[key] && this._groups[key].data) || null
+ }, _groupFromGroupIndex: function _groupFromGroupIndex(index) {
+ var groupCache = null;
+ var group = null;
+ if (this._groups)
+ groupCache = this._headerRanges.get(index);
+ if (groupCache)
+ group = groupCache.data;
+ return group
+ }, _isKnownGroup: function _isKnownGroup(group) {
+ return !!(group && this._groupFromKey(group.key))
+ }, _isStartOrEnd: function _isStartOrEnd(item) {
+ return item === undefined
+ }, _isHeader: function _isHeader(item) {
+ return !!(item && item.isHeader)
+ }, _isUnknown: function _isUnknown(item) {
+ return item === null
+ }, _areGroupsEqual: function _areGroupsEqual(group1, group2) {
+ var equal = false;
+ if (!group1 && !group2)
+ equal = true;
+ else
+ equal = !!(group1 && group2 && group1.key === group2.key);
+ return equal
+ }, _isMatch: function _isMatch(item, group) {
+ return !!(item && this._areGroupsEqual(group, item.group))
+ }, _isNotMatch: function _isNotMatch(item, group) {
+ return !!((this._isStartOrEnd(item)) || (item && group && item.group && item.group.key !== group.key))
+ }, _calculateAndApplyGroup: function _calculateAndApplyGroup(item) {
+ var group = this.calculate(item);
+ if (this.isValidGroupOrParentGroup(group)) {
+ if (this._isKnownGroup(group) && this.isValidGroup(group)) {
+ group = this._groups[group.key].data;
+ MS.Entertainment.Data.assert(!!group, "A known group shouldn't have null data")
+ }
+ this._setGroup(item, group)
+ }
+ return group
+ }, _setGroup: function _setGroup(listItem, group) {
+ if (listItem)
+ listItem.group = group;
+ return listItem
+ }, _shiftHeaderRanges: function _shiftHeaderRanges(startIndex, increase) {
+ this._headerRanges.shift(startIndex, increase)
+ }, _insert: function _insert(index, item, existingItems, updating) {
+ MS.Entertainment.Data.fail("Derived classes must define _insert")
+ }, _insertGroupHeaderFromGroupHint: function _insertGroupHeaderFromGroupHint(groupHint, group) {
+ MS.Entertainment.Data.fail("Derived classes must define _insertGroupHeaderFromGroupHint")
+ }, _remove: function _remove(index, item, existingItems) {
+ MS.Entertainment.Data.fail("Derived classes must define _remove")
+ }, _initializeGroupHintAndSizes: function _initializeGroupHintAndSizes(groupHint, firstItemIndexSourceHint) {
+ if (groupHint && this._groupHints) {
+ groupHint.data.firstItemIndexSourceHint = firstItemIndexSourceHint;
+ groupHint.data.totalCount = 0;
+ this._updateGroupHintSize(groupHint, 1);
+ this._initializeGroupHint(groupHint)
+ }
+ }, _initializeGroupHint: function _initializeGroupHint(groupHint) {
+ if (groupHint && groupHint.data) {
+ var dataSource = this._dataSource;
+ if (dataSource)
+ MS.Entertainment.Data.Factory.ListItemWrapper.addFirstItemIndexHint(groupHint, function() {
+ var index = groupHint.data.firstItemIndexSourceHint;
+ if (dataSource.indexFromSourceIndex)
+ index = dataSource.indexFromSourceIndex(index);
+ return index
+ })
+ }
+ }, _updateGroupHintSize: function _updateGroupHintSize(groupHint, increase) {
+ if (groupHint && this._groupHints) {
+ var groupHintIndex = groupHint.itemIndex;
+ var currentItem = groupHint;
+ if (increase >= 0 || currentItem.data.totalCount >= 0) {
+ currentItem.data.totalCount += increase;
+ for (var i = groupHintIndex + 1; i < this._groupHints.count; i++) {
+ currentItem = this._groupHints.getItem(i);
+ currentItem.data.firstItemIndexSourceHint += increase
+ }
+ }
+ }
+ }
+ }, {clearGroup: function clearGroup(item) {
+ if (item) {
+ item.group = null;
+ item.isHeader = false
+ }
+ }})
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {ListGrouper: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ListGrouperBase", function listGrouper(grouper, dataSource) {
+ MS.Entertainment.Data.ListGrouperBase.prototype.constructor.call(this, grouper, dataSource)
+ }, {
+ isInlineGrouper: {get: function get_isInlineGrouper() {
+ return true
+ }}, countHeaders: function countHeaders(startIndex, endIndex) {
+ return this._headerRanges.count(startIndex, endIndex)
+ }, exclusionCountHeaders: function exclusionCountHeaders(startIndex, endIndex) {
+ return this._headerRanges.exclusionCount(startIndex, endIndex)
+ }, _insert: function _insert(index, item, existingItems, updating) {
+ if (!item || item.isHeader || (updating && item.group) || this.isGrouperEmpty)
+ return index;
+ var itemBefore = existingItems(index - 1);
+ var itemAfter = existingItems(updating ? index + 1 : index);
+ var group = this.calculate(item);
+ if (!this.isValidGroup(group)) {
+ if (!updating)
+ this._insertItem(index, item, itemBefore, itemAfter);
+ return index
+ }
+ var groupHeaderIndex = -1;
+ if (this._isNotMatchingHeader(itemBefore, group)) {
+ if (updating)
+ this._removeHeader(index - 1, itemBefore.group);
+ else
+ itemAfter = itemBefore;
+ index--;
+ itemBefore = existingItems(index - 1)
+ }
+ if (this._canInsertHeaderUsingGroup(item, group))
+ index = this._moveOrInsertHeaderIfNeeded(index, group, itemBefore, itemAfter).index;
+ this._updateHeaderIfNeeded(group);
+ item.group = group;
+ if (!updating) {
+ this._shiftHeaderRanges(index, true);
+ this._insertItem(index, item, itemBefore, itemAfter)
+ }
+ if (itemAfter) {
+ if (this._canInsertHeaderUsingGroup(itemAfter, itemAfter.group)) {
+ var moveResult = this._moveOrInsertHeaderIfNeeded(index + 1, itemAfter.group, item, null);
+ if (moveResult.oldHeaderIndex >= 0 && moveResult.oldHeaderIndex < index && moveResult.oldHeaderIndex !== moveResult.newHeaderIndex)
+ index--
+ }
+ this._updateHeaderIfNeeded(itemAfter.group)
+ }
+ this._dispatchChanges();
+ return index
+ }, _isNotMatchingHeader: function isNotMatchingHeader(item, group) {
+ return !!(item && item.isHeader && this._isNotMatch(item, group))
+ }, _canInsertHeaderUsingGroup: function _canInsertHeaderUsingGroup(item, group) {
+ return !!(item && group && !item.isAction && !item.isHeader && !item.noHeader)
+ }, _canInsertHeader: function _canInsertHeader(item) {
+ return !!(item && this._canInsertHeaderUsingGroup(item, item.group))
+ }, _remove: function _remove(index, item, existingItems) {
+ item = item || {};
+ if (!item.isHeader && !this.isGrouperEmpty) {
+ var itemBefore = existingItems(index - 1);
+ var itemAfter = existingItems(index + 1);
+ this._removeItem(index, item);
+ if (this.isValidGroup(item && item.group)) {
+ if ((this._isStartOrEnd(itemBefore) || this._isHeader(itemBefore)) && (this._isStartOrEnd(itemAfter) || this._isHeader(itemAfter))) {
+ index--;
+ this._removeHeader(index, itemBefore && itemBefore.group)
+ }
+ this._shiftHeaderRanges(index + 1, false)
+ }
+ item.group = null;
+ this._dispatchChanges()
+ }
+ return index
+ }, _moveOrInsertHeaderIfNeeded: function _moveOrInsertHeaderIfNeeded(index, group, itemBefore, itemAfter) {
+ var result = {
+ index: index, oldHeaderIndex: -1, newHeaderIndex: -1
+ };
+ var atBoundary = this._isNotMatch(itemBefore, group);
+ if (this._groups[group.key])
+ result.oldHeaderIndex = result.newHeaderIndex = this._groups[group.key].start;
+ if (atBoundary)
+ if (result.oldHeaderIndex === index)
+ index++;
+ else if (result.oldHeaderIndex >= 0 && result.oldHeaderIndex !== index - 1) {
+ this._removeHeader(result.oldHeaderIndex, group);
+ if (result.oldHeaderIndex < index)
+ index--;
+ result.newHeaderIndex = index;
+ this._insertHeader(index, group, itemBefore, itemAfter);
+ index++
+ }
+ else if (this._insertHeaderIfNeeded(index, group, itemBefore, itemAfter)) {
+ result.newHeaderIndex = index;
+ index++
+ }
+ result.index = index;
+ return result
+ }, _insertGroupHeaderFromGroupHint: function _insertGroupHeaderFromGroupHint(groupHint, group) {
+ var firstItemIndexHint = this._sourceIndexToIndex(groupHint.data.firstItemIndexSourceHint);
+ this._insertHeaderIfNeeded(firstItemIndexHint + this._pendingInserts, group, null, null)
+ }
+ })})
+})(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/list.js:17850 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+(function(MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ chunkerEvents: {
+ batchChange: "batchChange", reset: "reset"
+ }, listEvents: {
+ itemChanged: "itemChanged", countChanged: "countChanged", itemInserted: "itemInserted", itemMoved: "itemMoved", itemRemoved: "itemRemoved", beginNotifications: "beginNotifications", endNotifications: "endNotifications"
+ }, observableListMixin: {
+ count: 0, itemFactory: null, instance: null
+ }
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {ObservableList: WinJS.Class.mix(function observableList() {
+ this._initObservable(Object.create(MS.Entertainment.Data.observableListMixin));
+ this.status = MSE.Data.queryStatus.idle
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin, MS.Entertainment.UI.Framework.UpdatePropertyMixin, WinJS.Binding.expandProperties(MS.Entertainment.Data.observableListMixin))});
+ WinJS.Namespace.defineWithParent(MSE, "Data", {List: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ObservableList", function listConstructor(itemFactory) {
+ MS.Entertainment.Data.ObservableList.prototype.constructor.call(this);
+ this._data = [];
+ this._keyMap = {};
+ this.instance = this;
+ this.setItemFactory(itemFactory)
+ }, {
+ _data: null, _keyMap: null, _nextDefaultKey: 0, _disposed: false, dispose: function dispose() {
+ this._data = [];
+ this._keyMap = {};
+ this._disposed = true
+ }, _maxCount: -1, isDisposed: {get: function get_isDisposed() {
+ return this._disposed
+ }}, maxCount: {
+ get: function() {
+ return this._maxCount
+ }, set: function(value) {
+ if (this._maxCount !== value) {
+ this._maxCount = value;
+ if (this._maxCount >= 0)
+ this._setCount(Math.min(this._maxCount, this.count))
+ }
+ }
+ }, hasMaxCount: {get: function() {
+ return this.maxCount >= 0
+ }}, count: {
+ get: function() {
+ var count = this.getProperty("count");
+ return (count < 0) ? 0 : count
+ }, set: function(value) {
+ if (this.hasMaxCount)
+ value = Math.min(this._maxCount, value);
+ this.setProperty("count", value)
+ }
+ }, hasCount: {get: function() {
+ return this.getProperty("count") >= 0
+ }}, setItemFactory: function setItemFactory(itemFactory) {
+ this.itemFactory = itemFactory || MSE.Data.Factory.self;
+ if (!this.itemFactory.listItemFactory)
+ this.itemFactory = MSE.Data.Factory.createListItemFactory(this.itemFactory)
+ }, createItem: function createItem(source) {
+ return this.itemFactory(source === undefined ? null : source)
+ }, copyItem: function copyItem(source, destination) {
+ return this.itemFactory(source === undefined ? null : source, destination)
+ }, insert: function insert() {
+ return this._insertAt(this.count, null)
+ }, insertAt: function insertAt(index, data) {
+ this._insertAt(index, data);
+ return WinJS.Promise.wrap(this._item(index))
+ }, forEach: function forEach(callback, index, countAfter) {
+ return this._forEach(callback, index, countAfter)
+ }, forEachAll: function forEachAll(callback, index, countAfter) {
+ return this.forEach(callback, index, countAfter)
+ }, toArray: function(startIndex, maxCount) {
+ return this._toArray(false, startIndex, maxCount)
+ }, toArrayAll: function(startIndex, maxCount) {
+ return this._toArray(true, startIndex, maxCount)
+ }, _toArray: function _toArray(all, startIndex, maxCount) {
+ startIndex = startIndex || 0;
+ var result = [];
+ var countAfter;
+ var forFunction = all ? this.forEachAll : this.forEach;
+ if (!isNaN(maxCount))
+ countAfter = maxCount - 1;
+ return forFunction.call(this, function addItem(args) {
+ if (args.item && args.item.data)
+ result.push(args.item.data)
+ }, 0, countAfter).then(null, function ignoreError(){}).then(function returnItems() {
+ return result
+ })
+ }, _indexFromItemDescription: function _indexFromItemDescription(itemDescription) {
+ var result = -1;
+ if (itemDescription && !isNaN(itemDescription.sourceIndexHint) && itemDescription.sourceIndexHint >= 0)
+ result = itemDescription.sourceIndexHint;
+ else
+ MSE.Data.fail("Invalid item description was given to _indexFromItemDescription(). Descriptions must have a valid sourceIndexHint");
+ return result
+ }, itemsFromDescription: function itemsFromDescription(itemDescription, countBefore, countAfter) {
+ var result;
+ var index = this._indexFromItemDescription(itemDescription);
+ if (index >= 0)
+ result = this.itemsFromIndex(index, 0, 0).then(function examineResult(result) {
+ return result
+ });
+ else
+ result = WinJS.Promise.wrapError(new Error("Unable to locate item from the given description"));
+ return result
+ }, itemsFromIndex: function itemsFromIndex(index, countBefore, countAfter) {
+ var result = this._onItemsFromIndex(index, countBefore, countAfter).then(function _itemsFromIndex() {
+ return _items(index, countBefore, countAfter)
+ }.bind(this));
+ return result
+ }, _onItemsFromIndex: function _onItemsFromIndex(index, countBefore, countAfter) {
+ return WinJS.Promise.wrap()
+ }, createListAdaptor: function createListAdaptor() {
+ return {
+ compareByIdentity: true, getCount: this.getCount.bind(this), itemsFromIndex: this.itemsFromIndex.bind(this), itemsFromDescription: this.itemsFromDescription.bind(this), insertAtStart: function insertAtStart(key, data) {
+ return WinJS.Promise.wrap(this._insertAt(0, data))
+ }, insertBefore: function insertBefore(key, data, nextKey, nextIndexHint) {
+ return WinJS.Promise.wrap(this._insertAt(this._indexFromKey(nextKey), data))
+ }, insertAfter: function insertAfter(key, data, previousKey, previousIndexHint) {
+ return WinJS.Promise.wrap(this._insertAt(this._indexFromKey(previousKey) + 1, data))
+ }, insertAtEnd: function insertAtEnd(key, data) {
+ return WinJS.Promise.wrap(this._insertAt(this.count, data))
+ }, change: function change(key, newData, indexHint) {
+ return WinJS.Promise.wrap(this._changeByKey(key, newData))
+ }, moveToStart: function moveToStart(key, indexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, 0))
+ }, moveBefore: function moveBefore(key, nextKey, indexHint, nextIndexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, this._indexFromKey(nextKey)))
+ }, moveAfter: function moveAfter(key, previousKey, indexHint, previousIndexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, this._indexFromKey(previousKey) + 1))
+ }, moveToEnd: function moveToEnd(key, indexHint) {
+ return WinJS.Promise.wrap(this._moveByKey(key, this.count))
+ }, remove: function remove(key, indexHint) {
+ return WinJS.Promise(this._removeAtKey(key))
+ }
+ }
+ }, getCount: function getCount() {
+ return this._onGetCount().then(function _getCount() {
+ if (this.count < 0)
+ return WinJS.Promise.wrapError(MSE.Data.List.CountResult.unknown);
+ else
+ return WinJS.Promise.wrap(this.count)
+ }.bind(this))
+ }, _onGetCount: function _onGetCount() {
+ return WinJS.Promise.wrap()
+ }, getItem: function getItem(destinationIndex) {
+ this._validateIndex(destinationIndex);
+ return this._item(destinationIndex)
+ }, keyFromIndex: function keyFromIndex(key) {
+ return this._keyFromIndex(key)
+ }, indexFromKey: function indexFromKey(key) {
+ return this._indexFromKey(key)
+ }, _insertAt: function _insertAt(index, data, noTranslation, isSourceData) {
+ this._validateInsertIndex(index);
+ var dataToCache = (noTranslation) ? data : this.createItem(data, !isSourceData);
+ dataToCache = this._cacheData(index, dataToCache);
+ this._addCount(1);
+ this._updateItemKeyMap(dataToCache.itemIndex);
+ return dataToCache
+ }, _insertRangeAt: function _insertRangeAt(startIndex, sourceData, noTranslation, isSourceData) {
+ var dataToCache;
+ var index = startIndex;
+ this._validateInsertIndex(index);
+ if (Array.isArray(sourceData))
+ sourceData.forEach(function _insertRangeAtLoop(item) {
+ dataToCache = (noTranslation) ? item : this.createItem(item, !isSourceData);
+ dataToCache = this._cacheData(index, dataToCache);
+ this._addCount(1);
+ index = dataToCache.itemIndex + 1
+ }, this);
+ this._updateItemKeyMap(startIndex);
+ return index - startIndex
+ }, _updateRangeAt: function _updateRangeAt(sourceStartIndex, sourceData, noTranslation) {
+ var dataToCache;
+ var sourceIndex = sourceStartIndex;
+ var startIndex = this.indexFromSourceIndex(sourceStartIndex);
+ var isSourceData = true;
+ this._validateInsertIndex(startIndex);
+ if (Array.isArray(sourceData))
+ sourceData.forEach(function _insertRangeAtLoop(item) {
+ dataToCache = (noTranslation) ? item : this.createItem(item, !isSourceData);
+ dataToCache = this._updateCacheData(this.indexFromSourceIndex(sourceIndex), dataToCache);
+ sourceIndex++
+ }, this);
+ this._updateItemKeyMap(startIndex);
+ return sourceIndex - sourceStartIndex
+ }, _removeAt: function _removeAt(index) {
+ this._validateIndex(index);
+ var data = this._uncacheData(index, 1)[0];
+ MSE.Data.assert(!data || data.itemIndex === index, "The index of the stored data didn't match the removed index.");
+ this._removeDataKey(data);
+ this._addCount(-1);
+ this._updateItemKeyMap(index);
+ return data
+ }, _removeDataKey: function _removeDataKey(data) {
+ var key;
+ if (data && data.key) {
+ key = data.key;
+ delete this._keyMap[data.key]
+ }
+ return key
+ }, _removeRangeAt: function _removeRangeAt(index, count) {
+ this._validateIndex(index);
+ this._validateIndex(index + count - 1);
+ var removed = this._uncacheData(index, count);
+ if (removed) {
+ this._addCount(-removed.length);
+ removed.forEach(function _removeRangeAtLoop(removedItem) {
+ delete this._keyMap[removedItem.key]
+ }, this);
+ this._updateItemKeyMap(removed.length ? removed[removed.length - 1].itemIndex : index)
+ }
+ return removed
+ }, _removeAtKey: function _removeAtKey(key) {
+ return this._removeAt(this._indexFromKey(key))
+ }, _validateInsertIndex: function _validateInsertIndex(index) {
+ if (index < 0 || (index > this.count && this.hasCount))
+ throw new Error("index out of range. index: " + index);
+ }, _validateIndex: function _validateIndex(index) {
+ if ((index < 0) || (index >= this.count && this.hasCount))
+ throw new Error("index out of range in List. index: " + index);
+ }, _validateIndexNoThrow: function _validateIndexNoThrow(index) {
+ return (index >= 0) && (index < this.count && this.hasCount)
+ }, _setCount: function _setCount(value) {
+ if (value < 0)
+ throw"new count is out of range";
+ if (value !== undefined && value !== null) {
+ var oldValue = this.count;
+ this.count = value;
+ if (oldValue !== value)
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.countChanged, {
+ newValue: value, oldValue: oldValue
+ })
+ }
+ }, _addCount: function _addCount(addition) {
+ this._setCount(this.count + addition)
+ }, _trimData: function _trimData(newLength) {
+ if (this._data.length > newLength)
+ this._uncacheData(newLength, this._data.length - newLength)
+ }, _forEach: function _forEach(callback, index, countAfter) {
+ index = index || 0;
+ countAfter = countAfter === undefined ? this.count : countAfter;
+ var totalCount = Math.min(this.count, this._data.length);
+ var first = Math.max(index, 0);
+ var last = Math.min(index + countAfter, totalCount - 1);
+ if (first >= this.count && !(first === 0 && this.count === 0))
+ throw"index is out of range";
+ return new WinJS.Promise(function promiseInitialization(completed, error) {
+ this._forEachIteration({
+ callback: callback, index: first, last: last, completed: completed, error: error, getCount: function getCount() {
+ return this.count
+ }.bind(this), getItem: function getItem(index) {
+ return this._item(index)
+ }.bind(this)
+ })
+ }.bind(this))
+ }, _forEachIteration: function _forEachIteration(iterationArgs) {
+ var promise,
+ args;
+ var promiseCompleted = true;
+ MSE.Data.assert(iterationArgs, "invalid argument. iterationArgs was null or undefined.");
+ while (iterationArgs.index <= iterationArgs.last && iterationArgs.index < iterationArgs.getCount()) {
+ args = {
+ item: iterationArgs.getItem(iterationArgs.index), stop: false
+ };
+ try {
+ promise = WinJS.Promise.as(iterationArgs.callback(args))
+ }
+ catch(exception) {
+ MS.Entertainment.Data.assert(false, "ForEach callback throw an exception. " + exception);
+ promise = WinJS.Promise.wrapError(exception)
+ }
+ promiseCompleted = false;
+ promise.done(function() {
+ if (args.stop) {
+ if (iterationArgs.cancel)
+ iterationArgs.cancel();
+ iterationArgs.index = iterationArgs.last + 1
+ }
+ else
+ iterationArgs.index = iterationArgs.index + 1;
+ promiseCompleted = true
+ }, function ignoreError(){});
+ if (!promiseCompleted) {
+ promise.done(function() {
+ this._forEachIteration(iterationArgs)
+ }.bind(this), function(error) {
+ iterationArgs.error(error)
+ });
+ break
+ }
+ }
+ if (promiseCompleted)
+ iterationArgs.completed()
+ }, _items: function _items(index, countBefore, countAfter) {
+ var safeCount = this._data.length;
+ var first = (countBefore !== undefined && !isNaN(countBefore)) ? Math.max(index - countBefore, 0) : 0;
+ var last = (countAfter !== undefined && !isNaN(countAfter)) ? Math.min(index + countAfter, safeCount - 1) : safeCount - 1;
+ var data = [];
+ var offset = Math.max(index - first, 0);
+ if (first < this.count && first <= last)
+ data = this._data.slice(first, last + 1);
+ return {
+ items: data, offset: offset, totalCount: this.count, absoluteIndex: first + offset
+ }
+ }, _emptyItems: function _emptyItems(index) {
+ return {
+ items: [], offset: 0, totalCount: this.count, absoluteIndex: index
+ }
+ }, _item: function _item(index) {
+ this._validateIndex(index);
+ return this._itemNoValidate(index)
+ }, _itemNoValidate: function(index) {
+ var data = this._data[index];
+ if (data) {
+ this._keyMap[this._itemKey(data)] = index;
+ data.itemIndex = index
+ }
+ else if ((index >= 0) && (index < this.count))
+ data = null;
+ return data
+ }, _itemFromKey: function _itemFromKey(key) {
+ return this._item(this._indexFromKey(key))
+ }, _updateCacheData: function _updateCacheData(index, data) {
+ this._validateIndex(index);
+ if (this._data.length <= index)
+ this._data.length = index + 1;
+ this._data[index] = data;
+ return data
+ }, _cacheData: function _cacheData(index, data) {
+ if (index < this._data.length)
+ this._data.splice(index, 0, data);
+ else if (index >= 0) {
+ if (this._data.length <= index)
+ this._data.length = index + 1;
+ this._data[index] = data
+ }
+ return data
+ }, _uncacheData: function _uncacheData(startIndex, count) {
+ return this._data.splice(startIndex, count)
+ }, _createEmptyItem: function _createEmptyItem() {
+ var emptyItem = new MS.Entertainment.Data.Factory.ListItemWrapper;
+ emptyItem.key = this._createItemKey(item);
+ return emptyItem
+ }, _createPlaceholderItem: function _createPlaceholderItem(index) {
+ var item = this._item(index);
+ if (!item)
+ item = this._cacheData(index, this._createEmptyItem());
+ return item
+ }, _createItemKey: function _createItemKey(data) {
+ var key;
+ if (data && data.getHashCode) {
+ key = data.getHashCode();
+ if (key !== null && key !== undefined)
+ key += String.empty;
+ if (!key || key in this._keyMap) {
+ MS.Entertainment.Data.fail("Key is null or undefined or already exists in list. Key = " + key);
+ key = null
+ }
+ }
+ while (!key || key in this._keyMap)
+ key = (this._nextDefaultKey++) + String.empty;
+ return key
+ }, _itemKey: function _itemKey(data) {
+ if (!data.key)
+ data.key = this._createItemKey(data);
+ return data.key
+ }, _updateItemKeyMap: function _updateItemKeyMap(startIndex, endIndex) {
+ endIndex = endIndex || this._data.length;
+ for (var i = startIndex; i < this._data.length && i <= endIndex; i++)
+ this._itemNoValidate(i)
+ }, _keyFromIndex: function _keyFromIndex(index) {
+ var data;
+ if (index >= 0 && index < this.count)
+ data = this._item(index);
+ if (data)
+ return data.key
+ }, _indexFromKey: function _indexFromKey(key) {
+ return this._keyMap[key]
+ }, indexFromSourceIndex: function indexFromSourceIndex(index) {
+ return index
+ }, indexToSourceIndex: function indexToSourceIndex(index) {
+ return index
+ }, _setAt: function _setAt(index, newData) {
+ this._validateIndex(index);
+ var oldItem = this._item(index);
+ var newItem = this.createItem(newData, oldItem.isNonSourceData);
+ this._updateCacheData(index, newItem);
+ newItem.key = oldItem.key;
+ return newItem
+ }, _changeByKey: function _changeByKey(key, newData) {
+ var index = this._indexFromKey(key);
+ return this._setAt(index, newData)
+ }, _moveByKey: function _moveByKey(fromKey, toIndex) {
+ var fromIndex = this._indexFromKey(fromKey);
+ return this._moveByIndex(fromIndex, toIndex)
+ }, _moveByIndex: function _moveByIndex(fromIndex, toIndex) {
+ this._validateIndex(fromIndex);
+ this._validateInsertIndex(toIndex);
+ if (fromIndex < toIndex)
+ toIndex--;
+ var data = this._uncacheData(fromIndex, 1)[0];
+ fromIndex = data.itemIndex;
+ data = this._cacheData(toIndex, data);
+ this._updateItemKeyMap(Math.min(fromIndex, toIndex));
+ return data
+ }
+ }, {
+ isList: function isList(list) {
+ return MS.Entertainment.Data.List.prototype.isPrototypeOf(list)
+ }, isListOrArray: function isListOrArray(listOrArray) {
+ return Array.isArray(listOrArray) || MS.Entertainment.Data.List.prototype.isPrototypeOf(listOrArray)
+ }, getData: function getData(list, index) {
+ var result;
+ if (Array.isArray(list))
+ result = list[index];
+ else if (MS.Entertainment.Data.List.isList(list))
+ result = list.itemsFromIndex(index, 0, 0).then(function(result) {
+ return result.items[result.offset].data
+ });
+ else
+ result = list;
+ return WinJS.Promise.as(result)
+ }, dataFromIndex: function dataFromIndex(list, index) {
+ var returnValue = list;
+ if (MS.Entertainment.Data.List.isList(list))
+ returnValue = list.itemsFromIndex(index, 0, 0).then(function gotItems(args) {
+ var item = args.items[args.offset];
+ return item ? item.data : null
+ });
+ return WinJS.Promise.as(returnValue)
+ }, listToArray: function listToArray(list, startIndex, maxCount) {
+ var result;
+ if (isNaN(startIndex))
+ startIndex = 0;
+ if (Array.isArray(list)) {
+ var endIndex = (!isNaN(maxCount)) ? startIndex + maxCount + 1 : undefined;
+ result = WinJS.Promise.wrap(list.slice(startIndex, endIndex))
+ }
+ else if (MS.Entertainment.Data.List.isList(list))
+ result = list.toArrayAll(startIndex, maxCount);
+ else if (list)
+ result = WinJS.Promise.wrap([list]);
+ else
+ result = WinJS.Promise.wrap([]);
+ return result
+ }, CountResult: {unknown: "unknown"}, FetchError: {
+ noResponse: "noResponse", doesNotExist: "doesNotExist"
+ }, ErrorMessage: {
+ ListChanged: "List has changed", isListChangedError: function isListChangedError(error) {
+ return error && error.message === MS.Entertainment.Data.List.ErrorMessage.ListChanged
+ }
+ }
+ })})
+})(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/virtuallist.js:18308 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+(function(MSE, undefined) {
+ "use strict";
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ chunkingType: {
+ nothing: 0, next: 1, previous: 2
+ }, VirtualListBase: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.List", function virtualListBaseConstructor(itemFactory, chunker) {
+ MS.Entertainment.Data.List.prototype.constructor.call(this, itemFactory);
+ this._chunker = chunker;
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._cacheLifespanMS = configurationManager.shell.randomAccessCacheLifespanMS
+ }, {
+ _uncacheTimer: null, _cacheLifespanMS: 0, _chunkingDirection: 0, _chunkingPreviousIndex: 0, _chunkingWorkerPromise: null, _chunkerEvents: null, _notificationHandler: null, _groupHinter: null, _pendingGroupHinter: null, _groupHinterExecuted: false, _currentGroupHinterPromise: null, _delayGroupHinterPromise: null, _chunker: null, _chunkerCount: -1, _loadedRanges: null, _loadedNonSourceRanges: null, _editCount: 0, _maxRandomAccessIndexSeen: -1, _allowValidateRanges: 0, _grouper: null, _grouperEvents: null, _groupHinterRefreshDelayMS: 1000, dispose: function dispose() {
+ MS.Entertainment.Data.List.prototype.dispose.call(this);
+ this._stopLazyValidation();
+ this._notificationHandler = null;
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ if (this._grouper)
+ this._grouper.dispose();
+ this.chunker = null;
+ if (this._grouperEvents) {
+ this._grouperEvents.cancel();
+ this._grouperEvents = null
+ }
+ if (this._currentGroupHinterPromise) {
+ this._currentGroupHinterPromise.cancel();
+ this._currentGroupHinterPromise = null
+ }
+ if (this._delayGroupHinterPromise) {
+ this._delayGroupHinterPromise.cancel();
+ this._delayGroupHinterPromise = null
+ }
+ this._grouper = null;
+ this._stopUncacheTimer()
+ }, chunkingEnabled: {get: function() {
+ return (!!this._chunker)
+ }}, chunker: {
+ get: function() {
+ return this._chunker
+ }, set: function(value) {
+ if (value !== this._chunker) {
+ var wasCacheClearingEnabled = this._randomAccessCachingEnabled;
+ var chunkerCount = (value) ? typeof value.totalCount === "number" ? value.totalCount : -1 : -1;
+ var count = chunkerCount;
+ this._chunker = value;
+ if (this._chunker && !this.randomAccessChunking && this.sequentialChunking)
+ this._chunker.chunkDestination = this.createSequentialChunkDestination();
+ if (this._chunker)
+ count = chunkerCount;
+ else if (wasCacheClearingEnabled)
+ this.clear();
+ else
+ count = this.sourceCount;
+ if (count >= 0)
+ this.count = count + this._loadedNonSourceRanges.count(0);
+ this._chunkerCount = chunkerCount;
+ this._updateChunkerEventHandlers();
+ this._notifyInvalidateList();
+ MS.Entertainment.Data.assert(!this._chunker || this.randomAccessChunking || this.sequentialChunking, "The chunker doesn't support sequential or random access chunking. The chunker can't be meaningfully used.")
+ }
+ }
+ }, handleChunkerChanges: {get: function() {
+ return !!this._chunkerEvents
+ }}, chunkerCount: {get: function() {
+ return this._chunkerCount
+ }}, loadedCount: {get: function get_loadedCount() {
+ var loadedCount;
+ if (this.randomAccessChunking)
+ loadedCount = this.count;
+ else
+ loadedCount = this._loadedRanges.count(0, this.count);
+ MS.Entertainment.Data.assert(loadedCount <= this._data.length, "The loaded count shouldn't be larger than the cached data length");
+ return loadedCount
+ }}, sourceCount: {get: function get_sourceCount() {
+ var count = this.loadedSourceCount;
+ if (!this.randomAccessChunking && count < this._sourceCount)
+ count = this._sourceCount;
+ return count
+ }}, loadedSourceCount: {get: function get_loadedSourceCount() {
+ var loadedCount = this.loadedCount;
+ var nonSourceCount = this.nonSourceCount;
+ MS.Entertainment.Data.assert(this.randomAccessChunking || nonSourceCount > 0 || loadedCount === this._data.length, "When sequential chunking and there is no non-source, the loaded count should equal the cached data length");
+ return loadedCount - nonSourceCount
+ }}, hasChunkerCount: {get: function() {
+ return this.chunkerCount >= 0
+ }}, sequentialChunking: {get: function() {
+ return (!!this._chunker && !!this._chunker.loadPreviousChunk && !!this._chunker.loadNextChunk)
+ }}, randomAccessChunking: {get: function() {
+ return (!!this._chunker && this.hasChunkerCount && !!this._chunker.loadChunk && !this._chunker.isDisposed)
+ }}, hasNextChunk: {get: function get_hasNextChunk() {
+ return (this._chunker) ? this._chunker.hasNextChunk && (!this.hasMaxCount || this.loadedCount < this.maxCount) : false
+ }}, hasPreviousChunk: {get: function() {
+ return (this._chunker) ? this._chunker.hasPreviousChunk : false
+ }}, chunkSize: {get: function() {
+ return (this._chunker) ? this._chunker.chunkSize : 0
+ }}, groupHinter: {
+ get: function() {
+ return this._pendingGroupHinter || this._groupHinter
+ }, set: function(value) {
+ if (this._groupHinter !== value && this._pendingGroupHinter !== value)
+ this._pendingGroupHinter = value
+ }
+ }, groups: {get: function get_groups() {
+ var groups = null;
+ if (this._grouper && this._grouper.groups)
+ groups = this._grouper.groups;
+ return groups
+ }}, groupHints: {get: function() {
+ return (this._grouper && this._grouper.groupHints)
+ }}, hasGroupHints: {get: function() {
+ var hasGroupHintsOrListIstEmpty = !!this.groupHints && (this.groupHints.count > 0 || this.count === 0);
+ return (!!this._groupHinter || !!this._pendingGroupHinter) && (!this._groupHinterExecuted || hasGroupHintsOrListIstEmpty)
+ }}, isGroupHintsReady: {get: function() {
+ return this.hasGroupHints && !!this.groupHints && this.groupHints.count > 0
+ }}, source: {get: function() {
+ return this._source
+ }}, grouper: {get: function() {
+ return (this._grouper) ? this._grouper.grouper : null
+ }}, headerIndices: {get: function() {
+ if (this._grouper)
+ return this._grouper.headerIndices;
+ else
+ return []
+ }}, nonSourceIndices: {get: function() {
+ var result = [];
+ if (this._loadedNonSourceRanges)
+ this._loadedNonSourceRanges.ranges.forEach(function(item) {
+ for (var i = item.start; i <= item.end; i++)
+ result.push(i)
+ });
+ return result
+ }}, nonSourceCount: {get: function() {
+ var result = 0;
+ if (this._loadedNonSourceRanges)
+ result = this._loadedNonSourceRanges.count(0, this.count);
+ return result
+ }}, _randomAccessCachingEnabled: {get: function() {
+ return (this._cacheLifespanMS > 0) && (this.randomAccessChunking)
+ }}, createItem: function createItem(source, isNonSourceData) {
+ var item = MS.Entertainment.Data.List.prototype.createItem.apply(this, arguments);
+ item.isNonSourceData = (isNonSourceData === undefined) ? true : isNonSourceData;
+ return item
+ }, setGrouper: function setGrouper(value) {
+ if ((this._disposed && value) || (this._grouper && this._grouper === value) || (!this._grouper && !value))
+ return WinJS.Promise.wrap();
+ return this._setGrouper(value)
+ }, _ensureGrouper: function _ensureGrouper() {
+ if (!this._grouper)
+ this._setGrouper(new MS.Entertainment.Data.ListGrouper(MS.Entertainment.Data.emptyGrouper, this))
+ }, _setGrouper: function _setGrouper(value) {
+ if (this._disposed && value)
+ return WinJS.Promise.wrap();
+ var oldGrouper = this._grouper;
+ this._grouper = null;
+ if (this._grouperEvents) {
+ this._grouperEvents.cancel();
+ this._grouperEvents = null
+ }
+ if (oldGrouper && !this._disposed)
+ oldGrouper.clear();
+ if (value) {
+ MS.Entertainment.Data.assert(value instanceof MS.Entertainment.Data.ListGrouperBase, "Invalid grouper passed to the virtual list");
+ this._grouper = value;
+ if (this._grouper.isInlineGrouper)
+ this._grouperEvents = MS.Entertainment.Utilities.addEventHandlers(this._grouper, {batchChange: this._onBatchChange.bind(this)})
+ }
+ if ((oldGrouper && oldGrouper.grouper && oldGrouper.isInlineGrouper) || (this._grouper && this._grouper.grouper && this._grouper.isInlineGrouper))
+ return this._updateGroups();
+ else
+ return WinJS.Promise.wrap()
+ }, getGroupHints: function getGroupHints() {
+ return this._loadPendingGroupHints(true).then(null, function ignoreError(){}).then(function returnGroupHints() {
+ return this.groupHints
+ }.bind(this))
+ }, _forceRefreshGroupHints: function forceRefreshGroupHints() {
+ return this._loadPendingGroupHints(true)
+ }, _loadPendingGroupHints: function _loadPendingGroupHints(refreshAlways, useTimeout) {
+ if (this._pendingGroupHinter) {
+ this._groupHinter = this._pendingGroupHinter;
+ this._pendingGroupHinter = null;
+ return this._refreshGroupHints(useTimeout)
+ }
+ else if (refreshAlways)
+ return this._refreshGroupHints(useTimeout)
+ }, _refreshGroupHints: function _refreshGroupHints(useTimeout) {
+ this._groupHinterExecuted = false;
+ if (useTimeout)
+ return this._delayRefreshGroupHints();
+ else
+ return this._noDelayRefreshGroupHints()
+ }, _delayRefreshGroupHints: function _delayRefreshGroupHints() {
+ if (this._delayGroupHinterPromise)
+ this._delayGroupHinterPromise.cancel();
+ this._delayGroupHinterPromise = WinJS.Promise.timeout(this._groupHinterRefreshDelayMS).then(this._noDelayRefreshGroupHints.bind(this), function ignoreError(){});
+ return this._delayGroupHinterPromise
+ }, _noDelayRefreshGroupHints: function _noDelayRefreshGroupHints() {
+ var groupHintsPromise = null;
+ var pauseOperation;
+ if (this._delayGroupHinterPromise) {
+ this._delayGroupHinterPromise.cancel();
+ this._delayGroupHinterPromise = null
+ }
+ if ((this._disposed) || (this._currentGroupHinterPromise) || (!this._groupHinter && !this.groupHints))
+ return WinJS.Promise.as(this._currentGroupHinterPromise);
+ this._currentGroupHinterPromise = groupHintsPromise = this._pauseChunkerEvents();
+ this._currentGroupHinterPromise = groupHintsPromise = groupHintsPromise.then(function pausedChunkerEvents(pauseResult) {
+ var result;
+ pauseOperation = pauseResult;
+ if (!this._groupHinter)
+ result = null;
+ else if (!this._groupHinter.getItems) {
+ MS.Entertainment.Data.fail("A groupHinter must implement a getItems() function");
+ result = null
+ }
+ else
+ result = this._groupHinter.getItems();
+ return result
+ }.bind(this)).then(function gotGroupHints(groupHints) {
+ return groupHints
+ }.bind(this), function handleGetGroupHintsError(error) {
+ MS.Entertainment.Data.assert(WinJS.Promise.isCanceledError(error), "For some reason getting the group hints failed. Error: " + (error && error.message));
+ return null
+ }.bind(this)).then(function setGroupHints(groupHints) {
+ if (this._currentGroupHinterPromise === groupHintsPromise) {
+ this._groupHinterExecuted = true;
+ return this._setGroupHints(groupHints)
+ }
+ }.bind(this)).then(function setGroupHintsCompleted() {
+ if (this._currentGroupHinterPromise === groupHintsPromise)
+ this._currentGroupHinterPromise = null;
+ if (pauseOperation)
+ pauseOperation.cancel();
+ return this.groupHints
+ }.bind(this));
+ return WinJS.Promise.as(groupHintsPromise)
+ }, _setGroupHints: function _setGroupHints(groupHints) {
+ if (groupHints)
+ this._ensureGrouper();
+ if (this._grouper && groupHints !== this._grouper.groupHints) {
+ var oldValue = this._grouper.groupHints;
+ return this._grouper.setGroupHints(groupHints).then(function notifyChanges() {
+ if (groupHints)
+ this._forceListenToAllRandomAccessChanges();
+ this.dispatchChangeAndNotify("groupHints", groupHints, oldValue)
+ }.bind(this), function handleSetGroupHintsError(error) {
+ MS.Entertainment.Data.fail("Failed to set group hints. Error message = " + (error && error.message))
+ })
+ }
+ }, _pauseChunkerEvents: function _pauseChunkerEvents() {
+ var promise;
+ var cancelOperation;
+ if (this.chunker && this.chunker.pause) {
+ promise = this.chunker.pause();
+ cancelOperation = {cancel: function cancel() {
+ if (cancelOperation) {
+ this._unpauseChunkerEvents();
+ cancelOperation = null
+ }
+ }.bind(this)}
+ }
+ return WinJS.Promise.as(promise).then(null, function ignoreError(){}).then(function pauseCompleted() {
+ return cancelOperation || {cancel: function(){}}
+ })
+ }, _unpauseChunkerEvents: function _unpauseChunkerEvents() {
+ var promise;
+ if (this.chunker && this.chunker.unpause)
+ promise = this.chunker.unpause();
+ return WinJS.Promise.as(promise)
+ }, _delayCancelOperation: function _delayCancelOperation(operation) {
+ if (operation && operation.cancel)
+ MS.Entertainment.Utilities.schedulePromiseBelowNormal(null, "VirtualList::_delayCancelOperation").done(function _delayCancelOperationWork() {
+ operation.cancel()
+ })
+ }, _needToUpdateRandomAccessChangesRange: {get: function() {
+ return this.chunker && this.randomAccessChunking && this.count && this.hasCount && this.groupHints && this._maxRandomAccessIndexSeen < this.count - 1
+ }}, _randomAccessIndexSeen: function _randomAccessIndexSeen(index) {
+ if (index > this._maxRandomAccessIndexSeen)
+ this._maxRandomAccessIndexSeen = index
+ }, _forceListenToAllRandomAccessChanges: function _forceListenToAllRandomAccessChanges() {
+ if (this._needToUpdateRandomAccessChangesRange) {
+ var pauseOperation;
+ this._pendingRandomAccessChangesRange = this._pendingRandomAccessChangesRange || this._pauseChunkerEvents().then(function chunkerPaused(result) {
+ pauseOperation = result;
+ return this._safeChunkWork(function loadLastChunk() {
+ if (this._needToUpdateRandomAccessChangesRange) {
+ this._pendingRandomAccessChangesRange = null;
+ this._randomAccessIndexSeen(this.count - 1);
+ return this.chunker.loadChunk(this.indexToSourceIndex(this.count - 1), 0, 0)
+ }
+ }.bind(this))
+ }.bind(this)).then(null, function ignoreError(){}).then(function unpauseChunker() {
+ if (pauseOperation)
+ pauseOperation.cancel()
+ })
+ }
+ }, setNotificationHandler: function setNotificationHandler(notificationHandler) {
+ if (this._disposed)
+ return;
+ this._notificationHandler = notificationHandler
+ }, preventNotifications: false, _clearChunkerEventHandlers: function _clearChunkerEventHandlers() {
+ if (this._chunkerEvents) {
+ this._chunkerEvents.cancel();
+ this._chunkerEvents = null
+ }
+ }, _updateChunkerEventHandlers: function _updateChunkerEventHandler() {
+ this._clearChunkerEventHandlers();
+ if (this.chunker)
+ this._chunkerEvents = MS.Entertainment.Utilities.addEvents(this.chunker, {
+ batchChange: this._onBatchChange.bind(this), reset: this._handleChunkerReset.bind(this)
+ })
+ }, _onBatchChange: function _onBatchChange(args) {
+ var nonSourceData = args.detail.sender === this._grouper;
+ var changes = args.detail.changes;
+ return this._handleBatchChanges(changes, nonSourceData)
+ }, applyBatchChanges: function applyBatchChanges(changes) {
+ return this._handleBatchChanges(changes, false)
+ }, _handleBatchChanges: function _handleBatchChanges(changes, nonSourceData) {
+ return this._copyFromSourceIfNeededAndEdit().then(function readyForEdit() {
+ var data,
+ oldData,
+ key,
+ index,
+ lastChange;
+ var lastChangeIndex = -1;
+ var startIndex = this.count;
+ var failure = false;
+ var reload = false;
+ var batch = this._startNotificationBatch(MSE.Data.VirtualListBase.changeType.source);
+ try {
+ changes.forEach(function applyChange(change) {
+ data = null;
+ lastChange = change;
+ lastChangeIndex++;
+ if (change.absoluteIndex >= 0)
+ index = change.absoluteIndex;
+ else
+ index = this._indexFromSourceIndex(change.index, change.change === "Add");
+ switch (change.change) {
+ case"Add":
+ this._validateInsertIndex(index);
+ data = this.createItem(change.value, nonSourceData);
+ this._ensureGroupLink(data);
+ this._addCount(1);
+ data = this._cacheData(index, data);
+ startIndex = Math.min(startIndex, data.itemIndex);
+ batch.inserted(data, this._keyFromIndex(data.itemIndex - 1), this._keyFromIndex(data.itemIndex + 1), data.itemIndex);
+ break;
+ case"Remove":
+ this._validateIndex(index);
+ startIndex = Math.min(startIndex, index);
+ data = this._uncacheData(index, 1)[0];
+ key = this._removeDataKey(data);
+ this._addCount(-1);
+ if (data)
+ batch.removed(key, data.itemIndex);
+ break;
+ case"Update":
+ oldData = this._itemNoValidate(index);
+ if (change.value) {
+ data = this.createItem(change.value, nonSourceData);
+ this._ensureGroupLink(data)
+ }
+ if (oldData && data) {
+ data = this._updateCacheData(index, data);
+ data.key = oldData.key;
+ batch.changed(data, oldData)
+ }
+ break;
+ case"Reload":
+ reload = true;
+ break
+ }
+ {}
+ }.bind(this))
+ }
+ catch(error) {
+ MS.Entertainment.Data.fail("Exception occured while handling change event. Error message: " + (error && error.message), null, MS.Entertainment.UI.Debug.errorLevel.low);
+ failure = true;
+ reload = false
+ }
+ if (failure && this._canResetCaches)
+ this._resetCaches();
+ else {
+ if (this._validateIndexNoThrow(startIndex))
+ this._updateItemKeyMap(startIndex);
+ if (reload) {
+ this._cancelNotificationBatch();
+ this._notifyReload()
+ }
+ else
+ this._endNotificationBatch();
+ this._safeStartUncacheTimer();
+ this._startLazyValidation()
+ }
+ }.bind(this))
+ }, forEach: function forEach(callback, index, countAfter) {
+ var that = this;
+ index = index || 0;
+ var sourceCount = countAfter !== undefined && countAfter !== null ? index + countAfter : undefined;
+ return this._copyFromSourceAsync(sourceCount).then(function copiedSourceItems() {
+ return that._forEach(callback, index, countAfter)
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, forEachAll: function forEachAll(callback, index, countAfter) {
+ index = index || 0;
+ var callbacks = {
+ iteration: callback, completed: null, error: null, cancel: function() {
+ callbacks.cancelled = true
+ }, cancelled: false
+ };
+ var promise = new WinJS.Promise(function startForEachAll(completed, error) {
+ callbacks.completed = completed;
+ callbacks.error = error;
+ this._forEachAll(callbacks, index, countAfter)
+ }.bind(this), function cancelForEachAll() {
+ callbacks.cancel()
+ });
+ promise.done(function forEachAllCompleted() {
+ callbacks = null
+ }, function forEachAllError() {
+ callbacks = null
+ });
+ return promise
+ }, _forEachAll: function _forEachAll(callbacks, index, countAfter) {
+ index = index || 0;
+ var itemsFromIndexCountAfter = countAfter;
+ var itemsFromIndexPromise;
+ if (isNaN(itemsFromIndexCountAfter))
+ itemsFromIndexCountAfter = this.chunkSize > 0 ? this.chunkSize : 100;
+ if (this._disposed)
+ itemsFromIndexPromise = WinJS.Promise.wrapError(new Error("forEachAll stopped because the list has been disposed."));
+ else
+ itemsFromIndexPromise = this.itemsFromIndex(index, 0, itemsFromIndexCountAfter);
+ itemsFromIndexPromise.then(function gotItems(result) {
+ if (callbacks.cancelled)
+ return;
+ var oldIndex = index;
+ var adjustedCountAfter = isNaN(countAfter) ? result.totalCount - index - 1 : Math.min(countAfter, result.totalCount - index - 1);
+ var lastNeededIndex = index + adjustedCountAfter;
+ var lastLoadedAfter = result.items.length - result.offset;
+ var lastLoadedIndex = index + lastLoadedAfter - 1;
+ var maxItemsIndex;
+ if (lastNeededIndex <= lastLoadedIndex) {
+ index = -1;
+ maxItemsIndex = result.items.length - (lastLoadedIndex - lastNeededIndex) - 1
+ }
+ else if (lastLoadedAfter >= 0) {
+ countAfter = countAfter - lastLoadedAfter;
+ index = lastLoadedIndex + 1;
+ maxItemsIndex = result.items.length - 1
+ }
+ else if (!this.randomAccessChunking)
+ index = -1;
+ return new WinJS.Promise(function promiseInitialization(completed, error) {
+ this._forEachIteration({
+ callback: callbacks.iteration, cancel: callbacks.cancel, index: result.offset, last: maxItemsIndex, completed: completed, error: error, stopped: false, getCount: function getCount() {
+ return !result.items ? 0 : result.items.length
+ }, getItem: function getItem(index) {
+ return !result.items ? null : result.items[index]
+ }
+ })
+ }.bind(this))
+ }.bind(this)).done(function checkIfMoreDataNeeded() {
+ if (callbacks.cancelled || index < 0)
+ callbacks.completed();
+ else
+ this._forEachAll(callbacks, index, countAfter)
+ }.bind(this), function forEachAllFailed(error) {
+ if (error && error.shouldRetry)
+ this._forEachAll(callbacks, index, countAfter);
+ else {
+ MS.Entertainment.Data.fail("forEachAll interation has failed. error: " + (error && error.message));
+ callbacks.error(error)
+ }
+ }.bind(this))
+ }, isHeader: function isHeader(index) {
+ return this._grouper ? this._grouper.countHeaders(index, index) === 1 : 0
+ }, headerCount: {get: function getHeaderCount() {
+ return this._grouper ? this._grouper.countHeaders(0, this.count) : 0
+ }}, _items: function _items(index, countBefore, countAfter) {
+ var result = MS.Entertainment.Data.List.prototype._items.apply(this, arguments);
+ if (this._shouldCalculateGroupIndexHint() && result && result.items)
+ result.items.forEach(this._ensureGroupLink.bind(this));
+ this._loadPendingGroupHints();
+ return result
+ }, _shouldCalculateGroupIndexHint: function _shouldCalculateGroupIndexHint() {
+ return this.groupHinter && (!this._grouper || (this._grouper.grouper && this._grouper.grouper.noHeaderGroups))
+ }, _ensureGroupLink: function _ensureGroupLink(item) {
+ if (this._shouldCalculateGroupIndexHint() && item) {
+ if (this._grouper)
+ item.groupIndexHint = this._grouper.groupHintIndexFromIndex(item.itemIndex);
+ if (item.groupIndexHint < 0 || !item.groupIndexHint)
+ item.groupIndexHint = 0
+ }
+ }, itemsFromKey: function itemsFromKey(key, countBefore, countAfter) {
+ var result;
+ var index = this._indexFromKey(key);
+ var validIndex = typeof index === "number" && index >= 0;
+ if (!validIndex) {
+ result = new Error("Invalid index supplied, likely the item has since been removed");
+ result.name = WinJS.UI.FetchError.doesNotExist;
+ result = WinJS.Promise.wrapError(result)
+ }
+ else
+ result = this._itemsFromIndex(index, countBefore, countAfter, key);
+ return result
+ }, itemsFromDescription: function itemsFromDescription(itemDescription, countBefore, countAfter) {
+ var result;
+ var index = this._indexFromItemDescription(itemDescription);
+ index = this._indexFromSourceIndex(index) - this._loadedNonSourceRanges.exclusionCount(index, index);
+ if (index >= 0)
+ result = this._itemsFromIndex(index, countBefore, countAfter, null).then(function examineResult(result) {
+ result.totalCount = null;
+ return result
+ }.bind(this));
+ else
+ result = WinJS.Promise.wrapError(new Error("Unable to locate item from the given description"));
+ return result
+ }, itemsFromIndex: function itemsFromIndex(index, countBefore, countAfter) {
+ return this._itemsFromIndex(index, countBefore, countAfter)
+ }, _itemsFromIndex: function _itemsFromIndex(index, countBefore, countAfter, keyHint) {
+ if (!this._indexFromKey(keyHint))
+ keyHint = null;
+ return this._onItemsFromIndex(index, countBefore, countAfter).then(function _itemsFromIndex() {
+ if (this.randomAccessChunking)
+ return this._itemsFromIndexRandomChunking(index, countBefore, countAfter, keyHint);
+ else
+ return this._itemsFromIndexSequentialChunking(index, countBefore, countAfter)
+ }.bind(this))
+ }, _itemsFromIndexRandomChunking: function _itemsFromIndexRandomChunking(index, countBefore, countAfter, keyHint) {
+ var cacheStartCount = 0;
+ var cacheEndCount = 0;
+ var cacheMiddleCount = 0;
+ var chunkingWorkerPromise = this._chunkingWorkerPromise || WinJS.Promise.wrap();
+ var editCount = this._editCount;
+ var originalBefore = countBefore;
+ var originalAfter = countAfter;
+ var clampRange = false;
+ if (isNaN(countBefore)) {
+ countBefore = 0;
+ clampRange = true
+ }
+ if (isNaN(countAfter)) {
+ countAfter = Math.max(0, this.chunkSize - 1);
+ clampRange = true
+ }
+ if (this.chunkSize) {
+ if (clampRange && countBefore + 1 + countAfter > this.chunkSize)
+ if (countBefore > countAfter) {
+ countAfter = Math.max(0, this.chunkSize - (countBefore + 1));
+ countBefore = Math.max(0, this.chunkSize - (countAfter + 1))
+ }
+ else {
+ countBefore = Math.max(0, this.chunkSize - (countAfter + 1));
+ countAfter = Math.max(0, this.chunkSize - (countBefore + 1))
+ }
+ countBefore = index - (Math.floor((index - countBefore) / this.chunkSize) * this.chunkSize);
+ countAfter = ((Math.floor((index + countAfter) / this.chunkSize) + 1) * this.chunkSize) - 1 - index
+ }
+ if (index - countBefore < 0 || countBefore < 0)
+ countBefore = index;
+ if (this.count >= 0 && index + countAfter >= this.count)
+ countAfter = this.count - index - 1;
+ var pauseChunkerEventsPromise = this._pauseChunkerEvents();
+ var pauseOperation = null;
+ var lastRandomChunkFinished = function lastRandomChunkFinished() {
+ return pauseChunkerEventsPromise.then(function chunkerPaused(operation) {
+ pauseOperation = operation;
+ if (editCount !== this._editCount)
+ return this._createRetryError(MS.Entertainment.Data.List.ErrorMessage.ListChanged);
+ this._stopUncacheTimer();
+ this._startNotificationBatch(MSE.Data.VirtualListBase.changeType.source);
+ return this._copyFromSourceIfNeeded()
+ }.bind(this))
+ }.bind(this);
+ return this._chunkingWorkerPromise = chunkingWorkerPromise.then(lastRandomChunkFinished, lastRandomChunkFinished).then(function copiedFromSource() {
+ if (!this.randomAccessChunking)
+ return WinJS.Promise.wrapError(new Error("Item request has failed because the list has likely been disposed"));
+ editCount = this._editCount;
+ var rangeCount0,
+ rangeCount1,
+ rangeCount2,
+ rangeCount3,
+ rangeCount4;
+ var cacheSourceOrigin,
+ cacheSourceStartToEnd,
+ cacheSourceStartToOrigin,
+ cacheSourceEndToOrigin;
+ var adjustedIndex,
+ adjustedBefore,
+ adjustedAfter,
+ firstIndex,
+ lastIndex,
+ requestLength;
+ var keyIndex;
+ if (keyHint) {
+ keyIndex = this._indexFromKey(keyHint);
+ index = (keyIndex !== undefined) ? keyIndex : index
+ }
+ firstIndex = index - countBefore;
+ lastIndex = index + countAfter;
+ requestLength = countBefore + 1 + countAfter;
+ cacheStartCount = this._loadedRanges.count(firstIndex, lastIndex, true);
+ cacheEndCount = this._loadedRanges.countFromEnd(index, lastIndex, true);
+ cacheMiddleCount = Math.max(0, this._loadedRanges.count(firstIndex, lastIndex) - cacheStartCount - cacheEndCount);
+ if (editCount !== this._editCount)
+ adjustedBefore = -1;
+ else if (cacheStartCount <= 0 && cacheEndCount <= 0 && cacheMiddleCount <= 0) {
+ adjustedIndex = index - this._loadedNonSourceRanges.count(0, index - countBefore - 1);
+ adjustedBefore = countBefore;
+ adjustedAfter = countAfter
+ }
+ else if (cacheStartCount === requestLength)
+ adjustedBefore = -1;
+ else {
+ rangeCount0 = this._loadedNonSourceRanges.count(index, index);
+ rangeCount1 = this._loadedNonSourceRanges.count(0, index - 1);
+ rangeCount2 = this._loadedNonSourceRanges.count(firstIndex, index - 1);
+ rangeCount3 = this._loadedNonSourceRanges.count(index + 1, lastIndex);
+ rangeCount4 = this._loadedNonSourceRanges.count(firstIndex, lastIndex);
+ cacheSourceOrigin = this._loadedRanges.count(index, index, true);
+ cacheSourceOrigin -= this._loadedNonSourceRanges.count(index, index + cacheSourceOrigin);
+ cacheSourceStartToEnd = cacheStartCount - this._loadedNonSourceRanges.count(firstIndex, firstIndex + cacheStartCount - 1);
+ cacheSourceStartToOrigin = this._loadedRanges.count(firstIndex, index - 1, true);
+ cacheSourceStartToOrigin -= this._loadedNonSourceRanges.count(firstIndex, firstIndex + cacheSourceStartToOrigin - 1);
+ cacheSourceEndToOrigin = this._loadedRanges.countFromEnd(index, lastIndex, true);
+ cacheSourceEndToOrigin -= this._loadedNonSourceRanges.count(lastIndex - cacheSourceEndToOrigin + 1, lastIndex);
+ adjustedIndex = index - rangeCount1 + (cacheSourceStartToEnd - cacheSourceStartToOrigin);
+ adjustedBefore = countBefore - rangeCount2 - cacheSourceStartToOrigin;
+ adjustedAfter = countAfter - rangeCount3 - (cacheSourceEndToOrigin) - (rangeCount0 + cacheSourceStartToEnd - cacheSourceStartToOrigin);
+ if (adjustedAfter < 0) {
+ adjustedIndex = adjustedIndex + adjustedAfter;
+ adjustedBefore = adjustedBefore + adjustedAfter;
+ adjustedAfter = 0
+ }
+ }
+ if (adjustedBefore >= 0 && adjustedAfter >= 0)
+ return this.chunker.loadChunk(adjustedIndex, adjustedBefore, adjustedAfter)
+ }.bind(this)).then(function loadedChunk(chunkResult) {
+ var j = 0;
+ var currentItem;
+ var lastCount = 0;
+ var chunkResultLength = (chunkResult) ? chunkResult.items.length : 0;
+ var chunkFailed = (chunkResult) ? chunkResult.error : false;
+ var absoluteIndex = index - countBefore;
+ var maxAbsoluteIndex = -1;
+ var result;
+ if (editCount === this._editCount) {
+ if (chunkResult)
+ this._setCountFromChunker(chunkResult.totalCount);
+ maxAbsoluteIndex = Math.min(this.count - 1, index + countAfter)
+ }
+ if (cacheStartCount > 0 && absoluteIndex <= maxAbsoluteIndex)
+ absoluteIndex += cacheStartCount;
+ while (absoluteIndex <= maxAbsoluteIndex && j < chunkResultLength) {
+ currentItem = this._item(absoluteIndex);
+ if (!currentItem || !currentItem.isNonSourceData) {
+ lastCount = this.count;
+ currentItem = this._cacheSourceItemData(absoluteIndex, chunkResult.items[j]);
+ maxAbsoluteIndex += (this.count - lastCount);
+ absoluteIndex += (currentItem.itemIndex - absoluteIndex);
+ j++
+ }
+ else if (currentItem && !currentItem.cached) {
+ result = new Error("Data is not up to data. Please try again.");
+ maxAbsoluteIndex = -1;
+ break
+ }
+ absoluteIndex += 1
+ }
+ if (chunkFailed)
+ result = this._emptyItems(index);
+ else if (maxAbsoluteIndex >= 0 || this.count === 0) {
+ var keyIndex;
+ if (keyHint)
+ keyIndex = this._indexFromKey(keyHint);
+ countAfter = Math.max(0, Math.min(maxAbsoluteIndex - index, countAfter));
+ if (keyIndex !== index && keyIndex !== undefined && keyIndex >= index - originalBefore && keyIndex <= index + originalAfter) {
+ var keyIndexDelta = keyIndex - index;
+ result = this._items(keyIndex, Math.max(originalBefore - keyIndexDelta, keyIndex - (index - originalBefore)), Math.min(Math.max(0, originalAfter + keyIndexDelta), (index + originalAfter) - keyIndex))
+ }
+ else
+ result = this._items(index, originalBefore, originalAfter)
+ }
+ if (!result)
+ result = this._createRetryError(MS.Entertainment.Data.List.ErrorMessage.ListChanged);
+ this._endNotificationBatch();
+ if (result.items)
+ this._startUncacheTimer();
+ else
+ result = WinJS.Promise.wrapError(result);
+ this._startLazyValidation();
+ return result
+ }.bind(this)).then(function handleSuccess(result) {
+ this._delayCancelOperation(pauseOperation);
+ return result
+ }.bind(this), function handleLoadChunkError(error) {
+ MS.Entertainment.Data.assert(this.isDisposed || WinJS.Promise.isCanceledError(error) || MS.Entertainment.Data.List.ErrorMessage.isListChangedError(error), "Couldn't load the chunk of data. error: " + (error && error.message));
+ this._delayCancelOperation(pauseOperation);
+ this._startLazyValidation();
+ return WinJS.Promise.wrapError(error)
+ }.bind(this))
+ }, _createRetryError: function _createRetryError(message) {
+ var error = new Error(message);
+ error.shouldRetry = true;
+ return error
+ }, _itemsFromIndexSequentialChunking: function _itemsFromIndexSequentialChunking(index, countBefore, countAfter) {
+ countBefore = isNaN(countBefore) ? 0 : countBefore;
+ countAfter = isNaN(countAfter) ? this.chunkSize - 1 : countAfter;
+ if (countBefore < 0)
+ countBefore = 0;
+ var maxEndIndex;
+ var maxStartIndex;
+ var minStartIndex;
+ var minEndIndex;
+ var startedAtEnd = countAfter + index + 1 >= this.count;
+ minStartIndex = Math.max(index - countBefore, 0);
+ minEndIndex = Math.min(index + countAfter, this.count - 1);
+ if (this.chunkSize > 0) {
+ maxEndIndex = Math.max(0, (minEndIndex + this.chunkSize - 1) - (minEndIndex % this.chunkSize));
+ maxStartIndex = Math.max(0, minStartIndex - (minStartIndex % this.chunkSize))
+ }
+ else {
+ maxEndIndex = this.count > 0 ? this.count - 1 : 0;
+ maxStartIndex = 0
+ }
+ return this._prefetchData(minStartIndex, minEndIndex, maxStartIndex, maxEndIndex).then(function prefetchCompleted() {
+ return this._copyFromSourceAsync(maxEndIndex)
+ }.bind(this)).then(function copiedFromSource() {
+ if (isNaN(countAfter) || countAfter < 0 || countAfter + index >= this.count)
+ countAfter = Math.max(0, this.count - index - 1);
+ if (this.hasNextChunk && startedAtEnd)
+ countAfter = countAfter - 1;
+ if (!this.hasNextChunk && !this.hasPreviousChunk)
+ this._setSequentialCount(this.loadedCount);
+ var itemsResult = this._items(index, countBefore, countAfter);
+ this._startLazyValidation();
+ return itemsResult
+ }.bind(this))
+ }, createSequentialChunkDestination: function createSequentialChunkDestination() {
+ var result = null;
+ if (this.sequentialChunking)
+ result = {
+ insertRangeAtEnd: this._insertSequentialChunkedSourceAtEnd.bind(this), insertRangeAtStart: this._insertSequentialChunkedSourceAtStart.bind(this), setItemFactory: this.setItemFactory.bind(this)
+ };
+ else
+ MS.Entertainment.Data.fail("Shouldn't be creating a 'sequential' chunk destination on something that doesn't support sequential loading of data.");
+ return result
+ }, createListAdaptor: function createListAdaptor() {
+ return {
+ compareByIdentity: !this.randomAccessChunking, getCount: this.getCount.bind(this), itemsFromKey: this.itemsFromKey.bind(this), itemsFromIndex: this.itemsFromIndex.bind(this), itemsFromDescription: this.itemsFromDescription.bind(this), setNotificationHandler: this.setNotificationHandler.bind(this), itemSignature: function(data) {
+ var result;
+ if (!data)
+ result = data;
+ else if (data.itemSignature !== undefined)
+ result = data.itemSignature;
+ else {
+ result = JSON.stringify(MS.Entertainment.Data.deflate(data));
+ if (!result === undefined)
+ throw new Error("item signature could not be created");
+ data.itemSignature = result
+ }
+ return result
+ }.bind(this), insertAtStart: function insertAtStart(key, data) {
+ return this._insertAtAsync(0, data)
+ }.bind(this), insertBefore: function insertBefore(key, data, nextKey, nextIndexHint) {
+ return this._insertAtAsync(this._indexFromKey(nextKey), data, nextKey)
+ }.bind(this), insertAfter: function insertAfter(key, data, previousKey, previousIndexHint) {
+ return this._insertAtAsync(this._indexFromKey(previousKey), data, previousKey, 1)
+ }.bind(this), insertAtEnd: function insertAtEnd(key, data) {
+ return this._insertAtAsync(this.count, data)
+ }.bind(this), change: function change(key, newData, indexHint) {
+ var that = this;
+ var index = this._indexFromKey(key);
+ return this._editingListPrivate(index).then(function copiedFromSource() {
+ var oldItem = that._item(index);
+ var newItem = that._changeByKey(key, newData);
+ this._dispatchItemChanged(newItem, oldItem, index);
+ return newItem
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }.bind(this), moveToStart: function moveToStart(key, indexHint) {
+ return this._moveByKeyAsync(key, 0)
+ }.bind(this), moveBefore: function moveBefore(key, nextKey, indexHint, nextIndexHint) {
+ return this._moveByKeyAsync(key, this._indexFromKey(nextKey), nextKey)
+ }.bind(this), moveAfter: function moveAfter(key, previousKey, indexHint, previousIndexHint) {
+ return this._moveByKeyAsync(key, this._indexFromKey(previousKey), previousKey, 1)
+ }.bind(this), moveToEnd: function moveToEnd(key, indexHint) {
+ return this._moveByKeyAsync(key, this.count)
+ }.bind(this), remove: function remove(key, indexHint) {
+ var that = this;
+ return this._editingListPrivate(this._indexFromKey(key), 0, this.count).then(function copiedFromSource() {
+ var index = that._indexFromKey(key);
+ var removedItem = that._removeAt(index);
+ this._dispatchRemoved(key, index);
+ return removedItem
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }.bind(this)
+ }
+ }, insertAt: function insertAt(index, data, options) {
+ var that = this;
+ var insertedData;
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function copiedFromSource() {
+ index = that._indexFromNoHeaderIndex(index, true);
+ insertedData = that._insertAt(index, data, false, options.isSourceData);
+ if (!options.suppressEvents)
+ that._notifyInsertedItem(insertedData, insertedData.itemIndex);
+ {};
+ return insertedData
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, removeAt: function removeAt(index, options) {
+ options = options || {};
+ var that = this;
+ return this._editingListPrivate(index, 0, this.count).then(function copiedFromSource() {
+ index = that._indexFromNoHeaderIndex(index);
+ var removedItem = that._removeAt(index);
+ if (removedItem && !options.suppressEvents)
+ that._notifyRemoved(removedItem.key, removedItem.itemIndex);
+ return removedItem
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, moveAt: function moveAt(fromIndex, toIndex, options) {
+ options = options || {};
+ var that = this;
+ return this._editingListPrivate(0, 0, Math.max(fromIndex, toIndex)).then(function copiedFromSource() {
+ fromIndex = that._indexFromNoHeaderIndex(fromIndex);
+ toIndex = that._indexFromNoHeaderIndex(toIndex, true);
+ var item = null;
+ if (fromIndex !== toIndex)
+ item = that._moveByIndex(fromIndex, toIndex);
+ if (item && !options.suppressEvents)
+ that._notifyMoved(item, fromIndex);
+ return item
+ }, function moveFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, moveIndices: function moveIndices(indices, toIndex, options) {
+ indices = indices || [];
+ var ranges = indices.map(function mapIndex(index) {
+ return {
+ firstIndex: index, lastIndex: index
+ }
+ });
+ return this.moveRanges(ranges, toIndex, options)
+ }, moveRanges: function moveRanges(ranges, toIndex, options) {
+ options = options || {};
+ if (!ranges)
+ throw new Error("Parameter 'ranges' was null or empty");
+ var minIndex = NaN;
+ ranges.forEach(function(range) {
+ minIndex = isNaN(minIndex) || minIndex > range.firstIndex ? range.firstIndex : minIndex
+ });
+ var that = this;
+ return this._editingListPrivate(minIndex, 0, this.count).then(function copiedFromSource() {
+ toIndex = that._indexFromNoHeaderIndex(toIndex, true);
+ var fromIndex = 0;
+ var adjustments = 0;
+ var item = null;
+ var movedItems = [];
+ if (!options.suppressEvents)
+ that._notifyBeginNotifications();
+ for (var i = ranges.length - 1; i >= 0; i--)
+ for (var j = ranges[i].lastIndex; j >= ranges[i].firstIndex; j--) {
+ fromIndex = that._indexFromNoHeaderIndex(j);
+ if (fromIndex >= toIndex) {
+ fromIndex += adjustments;
+ adjustments++
+ }
+ var item = that._moveByIndex(fromIndex, toIndex);
+ toIndex = item.itemIndex;
+ if (!options.suppressEvents)
+ that._notifyMoved(item, fromIndex);
+ movedItems.splice(0, 0, item)
+ }
+ if (!options.suppressEvents)
+ that._notifyEndNotifications();
+ return movedItems
+ })
+ }, changeAt: function changeAt(index, data, options) {
+ options = options || {};
+ return this._editingListPrivate(index, 0, 0).then(function copiedFromSource() {
+ var oldItem = this._item(index);
+ var newItem = this._setAt(index, data);
+ if (item && !options.suppressEvents)
+ this._notifyChanged(newItem, oldItem);
+ return newItem
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, insertRangeAtEnd: function insertRangeAtEnd(range, options) {
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function() {
+ var startIndex = this.count;
+ var count = this._insertRangeAt(startIndex, range, false, options.isSourceData);
+ if (!options.suppressEvents)
+ this._notifyRangeInserted(startIndex, count)
+ }.bind(this), function(error) {
+ throw error;
+ })
+ }, _insertSequentialChunkedSourceAtEnd: function _insertSequentialChunkedSourceAtEnd(range) {
+ if (!this.sequentialChunking)
+ return;
+ return this._copyFromSourceIfNeededAndEdit().then(function _insertSequentialChunkedSourceAtEndWork() {
+ if (!this.sequentialChunking)
+ return;
+ var insertOrUpdateAt = this.hasChunkerCount ? this._updateRangeAt : this._insertRangeAt;
+ var startIndex = this.loadedSourceCount;
+ insertOrUpdateAt.call(this, startIndex, range, false, true)
+ }.bind(this))
+ }, insertRangeAtStart: function insertRangeAtStart(range, options) {
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function() {
+ var count = this._insertRangeAt(0, range, false, options.isSourceData);
+ if (!options.suppressEvents)
+ this._notifyRangeInserted(0, count)
+ }.bind(this), function(error) {
+ throw error;
+ })
+ }, _insertSequentialChunkedSourceAtStart: function _insertSequentialChunkedSourceAtStart(range) {
+ if (!this.sequentialChunking)
+ return;
+ return this._copyFromSourceIfNeededAndEdit().then(function _insertSequentialChunkedSourceAtStartWork() {
+ if (!this.sequentialChunking)
+ return;
+ var insertOrUpdateAt = this.hasChunkerCount ? this._updateRangeAt : this._insertRangeAt;
+ insertOrUpdateAt.call(this, 0, range, false, true)
+ }.bind(this))
+ }, insertRangeAt: function insertRangeAt(index, range, options) {
+ options = options || {};
+ return this._testEditingSource(options).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function() {
+ index = this._indexFromNoHeaderIndex(index, true);
+ var count = this._insertRangeAt(index, range, false, options.isSourceData);
+ if (!options.suppressEvents)
+ this._notifyRangeInserted(index, count)
+ }.bind(this), function(error) {
+ throw error;
+ })
+ }, removeIndices: function removeIndices(indices, options) {
+ indices = indices || [];
+ var ranges = indices.map(function mapIndex(index) {
+ return {
+ firstIndex: index, lastIndex: index
+ }
+ });
+ return this.removeRanges(ranges, options)
+ }, removeRangeAt: function removeRangeAt(index, count, options) {
+ options = options || {};
+ return this._editingListPrivate(index, 0, this.count).then(function() {
+ index = this._indexFromNoHeaderIndex(index);
+ var removed = this._removeRangeAt(index, count);
+ if (!options.suppressEvents)
+ this._notifyRangeRemoved(removed)
+ }.bind(this), function(error) {
+ throw error;
+ })
+ }, removeRanges: function removeRanges(ranges, options) {
+ options = options || {};
+ if (!ranges)
+ throw new Error("Parameter 'ranges' was null or empty");
+ var minIndex = NaN;
+ ranges.forEach(function(range) {
+ minIndex = isNaN(minIndex) || minIndex > range.firstIndex ? range.firstIndex : minIndex
+ });
+ return this._editingListPrivate(minIndex, 0, this.count).then(function() {
+ var removed = [];
+ for (var i = ranges.length - 1; i >= 0; i--)
+ removed = removed.concat(this._removeRangeAt(ranges[i].firstIndex, ranges[i].lastIndex - ranges[i].firstIndex + 1));
+ if (!options.suppressEvents)
+ this._notifyRangeRemoved(removed);
+ return removed
+ }.bind(this), function(error) {
+ throw error;
+ })
+ }, _setCountFromChunker: function _setCountFromChunker(count) {
+ if (count >= 0) {
+ this.count = count + this._loadedNonSourceRanges.count(0);
+ this._chunkerCount = count;
+ this._forceListenToAllRandomAccessChanges()
+ }
+ }, _setSequentialCount: function _setSequentialCount(count) {
+ if (!this.randomAccessChunking)
+ this.count = count
+ }, _setEmptyCount: function _setEmptyCount(count) {
+ if (this.count < 0)
+ this.count = count
+ }, _insertAtAsync: function _insertAtAsync(index, data, key, offset, isSourceData) {
+ var that = this;
+ offset = offset || 0;
+ return this._testEditingSource({isSourceData: isSourceData}).then(function testEditingSourceDone() {
+ return this._copyFromSourceIfNeededAndEdit()
+ }.bind(this)).then(function copiedFromSource() {
+ index = (isNaN(index)) ? that._indexFromKey(key) : index;
+ var item = that._insertAt(index + offset, data, false, isSourceData);
+ if (item)
+ this._dispatchInsertedItem(item, item.itemIndex);
+ return item
+ }.bind(this), function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, _moveByKeyAsync: function _moveByKeyAsync(fromKey, toIndex, toKey, toOffset) {
+ var that = this;
+ toOffset = toOffset || 0;
+ toIndex = (isNaN(toIndex)) ? that._indexFromKey(toKey) : toIndex;
+ return this._editingListPrivate(0, 0, Math.max(this._indexFromKey(fromKey), toIndex)).then(function copiedFromSource() {
+ var oldIndex = that._indexFromKey(fromKey);
+ var item = that._moveByKey(fromKey, toIndex + toOffset);
+ that._dispatchMoved(item, oldIndex);
+ return item
+ }, function copyFailed(error) {
+ return WinJS.Promise.wrapError(error)
+ })
+ }, indexFromSourceIndex: function indexFromSourceIndex(index) {
+ return this._indexFromSourceIndex(index, false)
+ }, indexToSourceIndex: function indexToSourceIndex(index) {
+ return index - this._loadedNonSourceRanges.count(0, index)
+ }, noHeaderIndexFromSourceIndex: function noHeaderIndexFromSourceIndex(index) {
+ return this._indexToNoHeaderIndex(this._indexFromSourceIndex(index, false))
+ }, _indexFromSourceIndex: function _indexFromSourceIndex(index, insert) {
+ return index + this._loadedNonSourceRanges.exclusionCount(0, insert && index ? index - 1 : index)
+ }, _indexToNoHeaderIndex: function _indexToNoHeaderIndex(index) {
+ if (this._grouper)
+ index -= this._grouper.countHeaders(0, index);
+ return index
+ }, _indexFromNoHeaderIndex: function _indexFromNoHeaderIndex(index, insert) {
+ if (this._grouper)
+ index += this._grouper.exclusionCountHeaders(0, insert && index ? index - 1 : index);
+ return index
+ }, _copyItemTo: function _copyItemTo(item, oldItem) {
+ if (oldItem) {
+ item.key = oldItem.key;
+ item.itemIndex = oldItem.itemIndex;
+ if (this._grouper)
+ this._grouper.copy(item, oldItem)
+ }
+ }, _updateCacheData: function _updateCacheData(index, data) {
+ if (data && data.cached) {
+ if (this._grouper)
+ index = this._grouper.update(index, data, this._itemNoValidate.bind(this));
+ data.itemIndex = index
+ }
+ data = MSE.Data.List.prototype._updateCacheData.call(this, index, data);
+ this._updateCacheDataRanges(index, data);
+ this._randomAccessIndexSeen(index);
+ return data
+ }, _updateCacheDataRanges: function _updateCacheDataRanges(index, data) {
+ if (data) {
+ if (data.cached) {
+ this._loadedRanges.insert(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.insert(index)
+ }
+ else {
+ this._loadedRanges.remove(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.remove(index)
+ }
+ this._validateCacheAt(index - 1);
+ this._validateCacheAt(index);
+ this._validateCacheAt(index + 1);
+ this._validateRanges(data.isHeader)
+ }
+ }, _cacheData: function _cacheData(index, data) {
+ if (data && data.cached) {
+ if (this._grouper)
+ index = this._grouper.insert(index, data, this._itemNoValidate.bind(this));
+ data.itemIndex = index
+ }
+ data = MSE.Data.List.prototype._cacheData.call(this, index, data);
+ if (data) {
+ this._loadedRanges.shift(index, true);
+ this._loadedNonSourceRanges.shift(index, true);
+ if (data.cached) {
+ this._loadedRanges.insert(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.insert(index)
+ }
+ this._validateCacheAt(index);
+ this._validateRanges(data.isHeader);
+ this._randomAccessIndexSeen(index)
+ }
+ return data
+ }, _uncacheData: function _uncacheData(startIndex, count) {
+ var result = [];
+ var data;
+ for (var index = startIndex + count - 1, j = 0; j < count; index--, j++) {
+ if (this._grouper)
+ index = this._grouper.remove(index, this._itemNoValidate(index), this._itemNoValidate.bind(this));
+ data = MSE.Data.List.prototype._uncacheData.call(this, index, 1)[0];
+ if (data) {
+ if (data.cached) {
+ this._loadedRanges.remove(index);
+ if (data.isNonSourceData)
+ this._loadedNonSourceRanges.remove(index)
+ }
+ data.itemIndex = index
+ }
+ this._loadedRanges.shift(index + 1, false);
+ this._loadedNonSourceRanges.shift(index + 1, false);
+ result.push(data);
+ this._validateCacheAt(index);
+ this._validateRanges(data && data.isHeader)
+ }
+ return result
+ }, _validateCacheAt: function _validateCacheAt(index){}, _startLazyValidation: function _startLazyValidation(startIndex){}, _stopLazyValidation: function _stopLazyValidation(){}, _validateRangesFromData: function _validtaeRangesFromData(startIndex, count) {
+ var item;
+ var cached;
+ var nonSourceCached;
+ var isHeader;
+ var i = typeof startIndex === "number" ? startIndex : 0;
+ var length = Math.min(this._data.length, typeof count === "number" ? count : this._data.length);
+ for (; i < this._data.length; i++) {
+ item = this._data[i];
+ cached = this._loadedRanges.count(i, i) === 1;
+ nonSourceCached = this._loadedNonSourceRanges.count(i, i) === 1;
+ isHeader = !!this._grouper && this._grouper.countHeaders(i, i) === 1;
+ MS.Entertainment.Data.assert(!item || (item.cached && cached) || (!item.cached && !cached), "Item's cached flag and cache range do not match. index: " + i);
+ MS.Entertainment.Data.assert(!item || (item.isNonSourceData === nonSourceCached), "Item's isNonSourceData and the range indices do not match. index: " + i);
+ MS.Entertainment.Data.assert(!this._grouper || !item || (item.isHeader === isHeader), "Item's isHeader and the range indices do not match. index: " + i)
+ }
+ }, _validateRanges: function _validateRanges(disallowGroupValidates) {
+ if (this._allowValidateRanges <= 0)
+ return;
+ var ranges;
+ var item;
+ this._validateRangesFromData();
+ if (this._allowValidateRanges <= 1)
+ return;
+ ranges = this._loadedRanges.ranges;
+ ranges.forEach(function(item) {
+ MS.Entertainment.Data.assert(item && item.start <= item.end, "A loaded data range is not correct")
+ });
+ ranges = this._loadedNonSourceRanges.ranges;
+ ranges.forEach(function(item) {
+ MS.Entertainment.Data.assert(item && item.start <= item.end, "A loaded non-source data range is not correct")
+ });
+ if (this._allowValidateRanges <= 2)
+ return;
+ if (this._grouper && this._grouper.isInlineGrouper && !disallowGroupValidates) {
+ ranges = this._grouper.headerRanges;
+ ranges.forEach(function(item) {
+ if (!item)
+ return;
+ var listStartItem = this._itemNoValidate(item.start);
+ var listEndItem = this._itemNoValidate(item.end);
+ MS.Entertainment.Data.assert(listStartItem && listStartItem.isHeader, "A header range is invalid, was expecting a header item");
+ MS.Entertainment.Data.assert(listEndItem && listEndItem.isHeader, "A header range is invalid, was expecting a header item");
+ MS.Entertainment.Data.assert((item.start === item.end) || (item.start === item.end - 1 && listStartItem.isHeader && listEndItem.isHeader && listStartItem.group.key !== listEndItem.group.key), "A header range is larger than expected.")
+ }, this)
+ }
+ }, _cacheSourceItemData: function _cacheSourceItemData(index, sourceItem) {
+ var data;
+ if (!(index in this._data)) {
+ data = this.createItem(sourceItem, false);
+ data = this._updateCacheData(index, data);
+ this._updateItemKeyMap(data.itemIndex, data.itemIndex)
+ }
+ else {
+ data = this._item(index);
+ if (!data.cached) {
+ this.copyItem(sourceItem, data);
+ this._updateCacheDataRanges(index, data)
+ }
+ }
+ return data
+ }, _uncacheSourceItemData: function _uncacheSourceItemData(index) {
+ var uncachedItem;
+ var item = this._itemNoValidate(index);
+ if (item && !item.isNonSourceData) {
+ uncachedItem = new MS.Entertainment.Data.Factory.ListItemWrapper;
+ this._copyItemTo(uncachedItem, item);
+ this._updateCacheData(index, uncachedItem)
+ }
+ }, _safeChunkWork: function _safeChunkWork(worker) {
+ var chunkingWorkerPromise = this._chunkingWorkerPromise || WinJS.Promise.wrap();
+ var newChunkingWorkerPromise = this._chunkingWorkerPromise = new WinJS.Promise(function initializePromise(complete) {
+ chunkingWorkerPromise.then(function safeToWork() {
+ var promise;
+ if (worker)
+ promise = worker();
+ return WinJS.Promise.as(promise)
+ }, function ignoreChunkingWorkerPromiseError(){}).then(null, function handleSafeChunkWorkerError(error) {
+ MS.Entertainment.Data.fail("Failed to execute work inside _safeChunkWork. Error message = " + error && error.message)
+ }).done(function finallyCompleteWork() {
+ complete()
+ }.bind(this))
+ }.bind(this));
+ return this._chunkingWorkerPromise
+ }, _safeStartUncacheTimer: function _safeStartUncacheTimer() {
+ var noChunking = false;
+ if (this._randomAccessCachingEnabled)
+ WinJS.Promise.as(this._chunkingWorkerPromise).done(function testChunking() {
+ noChunking = true
+ }, function testChunkingHandleError() {
+ noChunking = true
+ });
+ if (noChunking)
+ this._startUncacheTimer()
+ }, _startUncacheTimer: function _startUncacheTimer() {
+ if (this._disposed)
+ return;
+ this._stopUncacheTimer();
+ if (this._randomAccessCachingEnabled)
+ this._uncacheTimer = WinJS.Promise.timeout(this._cacheLifespanMS).then(function _uncacheDataTimer() {
+ if (!this._uncacheTimer)
+ return;
+ var end,
+ i,
+ range;
+ this._loadedRanges.ranges.forEach(function(range) {
+ end = range.end;
+ for (i = range.start; i <= end; i++)
+ this._uncacheSourceItemData(i)
+ }, this);
+ this._uncacheTimer = null
+ }.bind(this), function _uncacheDataTimerFailed(error) {
+ if (!WinJS.Promise.isCanceledError(error))
+ MS.Entertainment.Data.fail("Uncache timer failed to fire. Error message = " + (error && error.message))
+ })
+ }, _stopUncacheTimer: function _stopUncacheTimer() {
+ if (this._uncacheTimer) {
+ this._uncacheTimer.cancel();
+ this._uncacheTimer = null
+ }
+ }, _handleChunkerReset: function _handleChunkerReset(args) {
+ this._resetCaches(args && args.detail && args.detail.totalCount)
+ }, _canResetCaches: {get: function get_canResetCaches() {
+ return this.randomAccessChunking
+ }}, clear: function clear() {
+ this._setSource([]).done(null, function ignoreError(){});
+ if (this._grouper)
+ this._grouper.reset();
+ this._notifyReload()
+ }, _resetCaches: function _resetCaches(totalCountHint) {
+ var pauseOperation;
+ if (this._canResetCaches) {
+ window.msWriteProfilerMark("ent:virtualList_resetCaches:" + this._debugId + ",StartTM");
+ this._pauseChunkerEvents().then(function resetCachesWork(operation) {
+ pauseOperation = operation;
+ var i;
+ var item;
+ var nonSourceData = [];
+ var nonSourceIndices = this.nonSourceIndices;
+ var headerCount = this.headerCount;
+ var totalCount = typeof totalCountHint === "number" && totalCountHint >= 0 ? totalCountHint : this.hasChunkerCount ? this.chunkerCount : 0;
+ this._clearChunkerEventHandlers();
+ this.preventNotifications = true;
+ this._clearChunkerEventHandlers();
+ for (i = 0; i < nonSourceIndices.length; i++) {
+ item = nonSourceIndices[i];
+ if (headerCount >= nonSourceIndices.length - i)
+ break;
+ if (!this.isHeader(item)) {
+ nonSourceData.length = item + 1;
+ nonSourceData[item] = this._data[item]
+ }
+ }
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ this._maxRandomAccessIndexSeen = -1;
+ this._setSource([]).done(null, function ignoreError(){});
+ this._setCount(totalCount);
+ this._forceListenToAllRandomAccessChanges();
+ this.preventNotifications = false;
+ this._notifyReload();
+ if (this._grouper)
+ this._grouper.reset();
+ for (i = 0; i < nonSourceData.length; i++) {
+ item = nonSourceData[i];
+ if (item)
+ this.insertAt(i, item, {suppressEvents: true})
+ }
+ this._updateChunkerEventHandlers();
+ return this._forceRefreshGroupHints()
+ }.bind(this)).then(null, function ignoreError(){}).done(function resetWorkComplete() {
+ if (pauseOperation)
+ pauseOperation.cancel();
+ window.msWriteProfilerMark("ent:virtualList_resetCaches:" + this._debugId + ",StopTM")
+ }.bind(this))
+ }
+ else
+ MS.Entertainment.Data.fail("This list's caches can't be cleared and restored. _resetCaches shouldn't be invoked")
+ }, _copyFromSourceAsync: function _copyFromSourceAsync(endIndex) {
+ if (this._copyingFromSource || this.isEmptySource())
+ return WinJS.Promise.wrap();
+ var startIndex = this._data.length;
+ this._copyingFromSource = true;
+ var allSourceLoaded = false;
+ var promise = this._getSourceCountAsync().then(function gotCount(count) {
+ if (!isNaN(count)) {
+ this._setEmptyCount(count);
+ endIndex = isNaN(endIndex) ? count - 1 : Math.min(count - 1, endIndex)
+ }
+ else
+ endIndex = isNaN(endIndex) ? startIndex : endIndex;
+ allSourceLoaded = endIndex + 1 >= count;
+ if (startIndex <= endIndex)
+ return this._getSourceItemsAsync(startIndex, endIndex)
+ }.bind(this), function getFailed(error) {
+ if (error !== MSE.Data.List.CountResult.unknown)
+ return new WinJS.Promise.wrapError(error)
+ }.bind(this)).then(function gotSourceItems(result) {
+ var absoluteIndex = startIndex;
+ var insertedItem;
+ if (result && result.items) {
+ if (!isNaN(result.totalCount))
+ this._setSequentialCount(result.totalCount);
+ for (var i = 0; i < result.items.length; i++) {
+ insertedItem = this._cacheSourceItemData(absoluteIndex, result.items[i]);
+ absoluteIndex = insertedItem.itemIndex + 1
+ }
+ if (allSourceLoaded)
+ this._clearSourceItems()
+ }
+ }.bind(this));
+ this._copyingFromSource = false;
+ return promise
+ }, _copyFromSourceIfNeeded: function _copyFromSourceIfNeeded() {
+ var result;
+ if (!this.isEmptySource || !this.isEmptySource())
+ result = this._copyFromSourceAsync();
+ return WinJS.Promise.as(result)
+ }, _copyFromSourceIfNeededAndEdit: function _copyFromSourceIfNeededAndEdit() {
+ return this._copyFromSourceIfNeeded().then(function copiedFromSource() {
+ return this._editingListPrivate()
+ }.bind(this))
+ }, _testEditingSource: function _testEditingSource(editOptions) {
+ var promise;
+ if (editOptions && editOptions.isSourceData)
+ promise = this._editingSource();
+ return WinJS.Promise.as(promise)
+ }, _editingSource: function _editingSource() {
+ this._clearChunkerEventHandlers();
+ this._preventCacheClearing();
+ return this._pauseChunkerEvents()
+ }, _preventCacheClearing: function _preventCacheClearing() {
+ this._stopUncacheTimer();
+ this._cacheLifespanMS = -1
+ }, _editingListPrivate: function _editingListPrivate(index, countBefore, countAfter) {
+ var loadingPromise;
+ this._editCount++;
+ if (index >= 0) {
+ countBefore = isNaN(countBefore) ? 0 : countBefore;
+ countAfter = isNaN(countAfter) ? 0 : countAfter;
+ loadingPromise = this.itemsFromIndex(index, countBefore, countAfter)
+ }
+ return WinJS.Promise.as(loadingPromise).then(function loadedData(result) {
+ var changingSourceItem = false;
+ var items = result && result.items;
+ if (items) {
+ var startIndex = Math.max(0, result.offset - countBefore);
+ var endIndex = Math.min(items.length - 1, result.offset + countAfter);
+ for (var i = startIndex; i <= endIndex && !changingSourceItem; i++)
+ changingSourceItem = !items[i].isNonSourceData
+ }
+ if (changingSourceItem)
+ return this._editingSource()
+ }.bind(this)).then(null, function ignoreError(error) {
+ MS.Entertainment.Data.assert(WinJS.Promise.isCanceledError(error) || MS.Entertainment.Data.List.ErrorMessage.isListChangedError(error), "Getting the list ready for editting has failed. error: " + (error && error.message))
+ }).then(function doneEditing() {
+ this._editCount++
+ }.bind(this))
+ }, isEmptySource: function isEmptySource() {
+ return false
+ }, _clearSourceItems: function _clearSourceItems() {
+ throw new Error("_clearSourceItems hasn't been defined");
+ }, _getSourceItemsAsync: function _getSourceItemsAsync(startIndex, endIndex) {
+ throw new Error("_getSourceItemsAync hasn't been defined");
+ }, _getSourceCountAsync: function _getSourceCountAsync() {
+ throw new Error("_getSourceCountAsync hasn't been defined");
+ }, _updateGroups: function _updateGroups() {
+ return this._copyFromSourceIfNeededAndEdit().then(function updateGroups() {
+ var item;
+ var absoluteIndex = 0;
+ this._startNotificationBatch(MSE.Data.VirtualListBase.changeType.source);
+ while (absoluteIndex < this._data.length) {
+ item = this._item(absoluteIndex);
+ if (item && !item.isHeader) {
+ MS.Entertainment.Data.ListGrouperBase.clearGroup(item);
+ item = this._updateCacheData(absoluteIndex, item);
+ absoluteIndex = item.itemIndex
+ }
+ absoluteIndex++
+ }
+ this._endNotificationBatch()
+ }.bind(this))
+ }, _prefetchWorker: function _prefetchWorker(chunkDirections, result) {
+ var returnPromise;
+ var countCurrent = this.count;
+ var loadFunction = this._preChunkStep(chunkDirections.pop());
+ if (loadFunction)
+ returnPromise = loadFunction().then(function handleLoadSuccess() {
+ if (this._isChunkingNext())
+ result.chunkedAfter = this.count - countCurrent;
+ else
+ result.chunkedBefore = this.count - countCurrent;
+ this._postChunkStep();
+ return this._prefetchWorker(chunkDirections, result)
+ }.bind(this), function handleLoadFailures() {
+ this._postChunkStep();
+ return result
+ }.bind(this));
+ else {
+ this._postChunkStep();
+ returnPromise = WinJS.Promise.wrap(result)
+ }
+ return returnPromise
+ }, _prefetchData: function _prefetchData(minStartIndex, minEndIndex, maxStartIndex, maxEndIndex) {
+ var chunkDirections;
+ var returnPromise;
+ var block = false;
+ var result = {
+ chunkedAfter: 0, chunkedBefore: 0
+ };
+ if (this.chunkingEnabled) {
+ if (this.hasNextChunk) {
+ var count = Math.max(this.sourceCount, this.loadedCount);
+ if (minEndIndex + 1 >= count) {
+ block = true;
+ chunkDirections = [MSE.Data.chunkingType.next]
+ }
+ else if (maxEndIndex + 1 >= count)
+ chunkDirections = [MSE.Data.chunkingType.next]
+ }
+ if (this.hasPreviousChunk)
+ if (minStartIndex < 0) {
+ block = true;
+ chunkDirections = chunkDirections || [];
+ chunkDirections.push(MSE.Data.chunkingType.previous)
+ }
+ else if (maxStartIndex <= 0) {
+ chunkDirections = chunkDirections || [];
+ chunkDirections.push(MSE.Data.chunkingType.previous)
+ }
+ }
+ if (!chunkDirections)
+ returnPromise = WinJS.Promise.wrap(result);
+ else {
+ if (!this._chunkingWorkerPromise) {
+ this._chunkingWorkerPromise = this._prefetchWorker(chunkDirections, result);
+ this._chunkingWorkerPromise.done(function() {
+ this._chunkingWorkerPromise = null;
+ block = false
+ }.bind(this))
+ }
+ if (block)
+ returnPromise = this._chunkingWorkerPromise.then(function() {
+ return this._prefetchData(minStartIndex, minEndIndex, maxStartIndex, maxEndIndex)
+ }.bind(this));
+ else
+ returnPromise = WinJS.Promise.wrap(result)
+ }
+ return WinJS.Promise.as(returnPromise)
+ }, _isChunking: function _isChunking() {
+ return this._chunkingDirection === MSE.Data.chunkingType.next || this._chunkingDirection === MSE.Data.chunkingType.previous
+ }, _isChunkingNext: function _isChunkingNext() {
+ return this._chunkingDirection === MSE.Data.chunkingType.next
+ }, _isChunkingPrevious: function _isChunkingPrevious() {
+ return this._chunkingDirection === MSE.Data.chunkingType.previous
+ }, _isChunkingNothing: function _isChunkingNothing() {
+ return this._chunkingDirection === MSE.Data.chunkingType.nothing
+ }, _preChunkStep: function _preChunkStep(newChunkingDirection) {
+ var that = this;
+ this._chunkingDirection = newChunkingDirection || MSE.Data.chunkingType.nothing;
+ return (this._isChunkingNext()) ? function() {
+ return that._chunker.loadNextChunk()
+ } : (this._isChunkingPrevious()) ? function() {
+ return that._chunker.loadPreviousChunk()
+ } : (null)
+ }, _postChunkStep: function _postChunkStep() {
+ this._chunkingDirection = MSE.Data.chunkingType.nothing;
+ this._chunkingPreviousIndex = 0
+ }, _startNotificationBatch: function _startNotificationBatch(changeType) {
+ if (!this._notificationBatch)
+ this._notificationBatch = new MS.Entertainment.Data.UpdateBatch(this._createNotificationHandler());
+ this._notificationBatch.changeType = changeType;
+ this._notificationBatch.start();
+ return this._notificationBatch
+ }, _endNotificationBatch: function _endNotificationBatch() {
+ if (this._notificationBatch)
+ if (this._notificationBatch.end())
+ this._notificationBatch = null
+ }, _cancelNotificationBatch: function _cancelNotificationBatch() {
+ this._notificationBatch = null
+ }, _notifyBeginNotifications: function _notifyBeginNotifications() {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.beginNotifications)
+ this._notificationHandler.beginNotifications();
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.beginNotifications, {sender: this})
+ }, _notifyEndNotifications: function _notifyEndNotifications() {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.endNotifications)
+ this._notificationHandler.endNotifications();
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.endNotifications, {sender: this})
+ }, _notifyInvalidateList: function _notifyInvalidateList() {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.invalidateAll)
+ this._notificationHandler.invalidateAll()
+ }, _notifyReload: function _notifyReload() {
+ if (!this.preventNotifications && this._notificationHandler)
+ if (this._notificationHandler.reload)
+ this._notificationHandler.reload();
+ else if (this._notificationHandler.invalidateAll)
+ this._notificationHandler.invalidateAll()
+ }, _notifyInsertedItem: function _notifyInsertedItem(item, index, changeType) {
+ this._notifyInsertedItemWithKeys(item, this._keyFromIndex(index - 1), this._keyFromIndex(index + 1), index, changeType)
+ }, _notifyInsertedItemWithKeys: function _notifyInsertedItem(item, keyBefore, keyAfter, index, changeType) {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.inserted)
+ this._notificationHandler.inserted(item, keyBefore, keyAfter, index);
+ this._dispatchInsertedItem(item, index, changeType)
+ }, _dispatchInsertedItem: function _dispatchInsertedItem(item, index, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemInserted, {
+ sender: this, newValue: item, index: index, changeType: changeType
+ })
+ }, _notifyRangeInserted: function _notifyRangeInserted(startIndex, count, changeType) {
+ if (count > 0 && count + startIndex <= this.count && startIndex >= 0 && startIndex < this.count && !this.preventNotifications) {
+ var batch = this._startNotificationBatch(changeType);
+ var previousKey = this._keyFromIndex(startIndex - 1);
+ var nextKey = this._keyFromIndex(startIndex + count);
+ var i;
+ if (!nextKey && !previousKey) {
+ batch.inserted(this._item(startIndex), null, null, startIndex);
+ previousKey = this._keyFromIndex(startIndex);
+ startIndex + 1
+ }
+ if (nextKey)
+ for (i = 0; i < count; i++)
+ batch.inserted(this._item(i + startIndex), null, nextKey, startIndex);
+ else
+ for (i = count - 1; i >= 0; i--)
+ batch.inserted(this._item(i + startIndex), previousKey, null, startIndex);
+ this._endNotificationBatch()
+ }
+ }, _notifyRangeRemoved: function _notifyRangeRemoved(itemsRemoved, changeType) {
+ var removedItem;
+ var i;
+ if (itemsRemoved && itemsRemoved.length > 0) {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.beginNotifications && this._notificationHandler.removed && this._notificationHandler.endNotifications) {
+ this._notificationHandler.beginNotifications();
+ itemsRemoved.forEach(function notifyHandler(removedItem) {
+ this._notificationHandler.removed(removedItem.key, removedItem.itemIndex)
+ }, this);
+ this._notificationHandler.endNotifications()
+ }
+ itemsRemoved.forEach(function notifyListeners(removedItem) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemRemoved, {
+ sender: this, key: removedItem.key, index: removedItem.itemIndex, changeType: changeType
+ })
+ }, this)
+ }
+ }, _notifyChanged: function _notifyChanged(newValue, oldValue, changeType) {
+ if (newValue) {
+ var index = this._indexFromKey(newValue.key);
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.changed)
+ this._notificationHandler.changed(newValue, oldValue);
+ this._dispatchItemChanged(newValue, oldValue, index, changeType)
+ }
+ }, _dispatchItemChanged: function _dispatchItemChanged(newValue, oldValue, index, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemChanged, {
+ sender: this, newValue: newValue, oldValue: oldValue, index: index, changeType: changeType
+ })
+ }, _notifyMoved: function _notifyMoved(item, oldIndex, changeType) {
+ if (!this.preventNotifications && this._notificationHandler && this._notificationHandler.moved) {
+ var newIndex = this._indexFromKey(item.key);
+ this._notificationHandler.moved(item, this._keyFromIndex(newIndex - 1), this._keyFromIndex(newIndex + 1), oldIndex, newIndex)
+ }
+ this._dispatchMoved(item, oldIndex, changeType)
+ }, _dispatchMoved: function _dispatchMoved(item, oldIndex, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemMoved, {
+ sender: this, value: item, oldIndex: oldIndex, newIndex: item.itemIndex, changeType: changeType
+ })
+ }, _notifyRemoved: function _notifyRemoved(key, index, changeType) {
+ if (key && !this.preventNotifications && this._notificationHandler && this._notificationHandler.removed)
+ this._notificationHandler.removed(key, index);
+ this._dispatchRemoved(key, index, changeType)
+ }, _dispatchRemoved: function _dispatchRemoved(key, index, changeType) {
+ this.dispatchEvent(MS.Entertainment.Data.listEvents.itemRemoved, {
+ sender: this, key: key, index: index, changeType: changeType
+ })
+ }, _createNotificationHandler: function _createNotificationHandler() {
+ return {
+ changed: this._notifyChanged.bind(this), removed: this._notifyRemoved.bind(this), moved: this._notifyMoved.bind(this), inserted: this._notifyInsertedItemWithKeys.bind(this), beginNotifications: this._notifyBeginNotifications.bind(this), endNotifications: this._notifyEndNotifications.bind(this)
+ }
+ }, _nextInsertIndex: function _nextInsertIndex() {
+ return this._isChunkingPrevious() ? this._chunkingPreviousIndex++ : this._data.length
+ }, _undoInsertIndex: function _undoInsertIndex() {
+ if (this._isChunkingPrevious())
+ this._chunkingPreviousIndex--
+ }
+ }, {changeType: {
+ source: "source", user: "user"
+ }}), UpdateBatch: MS.Entertainment.UI.Framework.define(function updateBatch(notificationHandler) {
+ if (!notificationHandler || !notificationHandler.changed || !notificationHandler.moved || !notificationHandler.removed || !notificationHandler.inserted || !notificationHandler.endNotifications || !notificationHandler.beginNotifications)
+ throw new Error("Invalid notification handler given to the update batch class");
+ this._notificationHandler = notificationHandler;
+ this._batch = []
+ }, {
+ _changeType: null, _notificationHandler: null, _batch: null, _startCount: 0, _createBatchItem: function _createBatchItem(callback, args) {
+ this._batch.push({
+ callback: callback, arguments: args
+ })
+ }, changeType: {
+ get: function get_changeType() {
+ return this._changeType || MSE.Data.VirtualListBase.changeType.user
+ }, set: function set_changeType(value) {
+ this._changeType = value
+ }
+ }, _appendChangeType: function _appendChangeType(args) {
+ var newArgs = [];
+ if (args)
+ for (var i = 0; i < args.length; i++)
+ newArgs.push(args[i]);
+ newArgs.push(this.changeType);
+ return newArgs
+ }, changed: function changed(newItem, oldItem) {
+ this._createBatchItem(this._notificationHandler.changed, this._appendChangeType(arguments))
+ }, moved: function moved(item, oldIndex) {
+ this._createBatchItem(this._notificationHandler.moved, this._appendChangeType(arguments))
+ }, removed: function removed(key, index) {
+ this._createBatchItem(this._notificationHandler.removed, this._appendChangeType(arguments))
+ }, inserted: function inserted(item, keyBefore, keyAfter, index) {
+ this._createBatchItem(this._notificationHandler.inserted, this._appendChangeType(arguments))
+ }, start: function start() {
+ this._startCount++
+ }, end: function end() {
+ var executed = false;
+ this._startCount--;
+ MS.Entertainment.Data.assert(this._startCount >= 0, "UpdateBatch::end called too many times");
+ if (this._startCount === 0) {
+ this.execute();
+ executed = true
+ }
+ else if (this._startCount < 0)
+ this._startCount = 0;
+ return executed
+ }, execute: function execute() {
+ this._notificationHandler.beginNotifications();
+ this._batch.forEach(function(event) {
+ if (event && event.callback)
+ event.callback.apply(null, event.arguments)
+ });
+ this._notificationHandler.endNotifications();
+ this._batch = []
+ }
+ }), DatabaseListWrapper: MS.Entertainment.UI.Framework.define(function databaseListWrapper(list) {
+ this._source = list
+ }, {
+ _source: null, length: {get: function() {
+ return this._source.dataItemsCount || 0
+ }}, getItem: function(index) {
+ return this._source.getItem(index)
+ }
+ }), VectorViewWrapper: MS.Entertainment.UI.Framework.define(function vectorViewWrapper(list) {
+ this._source = list
+ }, {
+ _source: null, length: {get: function() {
+ return this._source.length || this._source.size || 0
+ }}, getItem: function(index) {
+ return this._source[index]
+ }
+ }, {
+ isVectorView: function isVectorView(object) {
+ return object && !MS.Entertainment.Data.VectorViewWrapper.isVectorViewWrapper(object) && !Array.isArray(object) && (typeof object === "object") && (typeof object.size === "number" || typeof object.length === "number")
+ }, isVectorViewWrapper: function isVectorViewWrapper(object) {
+ return MS.Entertainment.Data.VectorViewWrapper.prototype.isPrototypeOf(object)
+ }, getLength: function getLength(object) {
+ return object.size
+ }
+ })
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {VirtualList: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.VirtualListBase", function virtualListConstructor(itemFactory, source, chunker) {
+ MS.Entertainment.Data.VirtualListBase.prototype.constructor.call(this, itemFactory, chunker);
+ this.setSource(source).done(null, function(){})
+ }, {
+ _source: null, _sourceCount: 0, dispose: function dispose() {
+ MS.Entertainment.Data.VirtualListBase.prototype.dispose.call(this);
+ this._source = null
+ }, isEmptySource: function isEmptySource() {
+ return this._source === MSE.Data.VirtualList.emptySource
+ }, isSourceArray: function isSourceArray() {
+ return this._source ? Array.isArray(this._source) : false
+ }, isSourceVector: function isSourceVector() {
+ return this._source ? typeof this._source.getItem === "function" : false
+ }, isSourceList: function isSourceList() {
+ return this._source ? typeof this._source.itemsFromIndex === "function" : false
+ }, setSource: function setSource(source) {
+ if (MSE.Data.VectorViewWrapper.isVectorView(source))
+ source = new MSE.Data.VectorViewWrapper(source);
+ else if (source && !Array.isArray(source) && !MSE.Data.VirtualList.is(source) && !MSE.Data.VectorViewWrapper.isVectorViewWrapper(source))
+ throw new Error("Invalid operation. Attempting to convert an unsupported source type to a virtual list");
+ source = source || MSE.Data.VirtualList.emptySource;
+ if (this._source !== source)
+ return this._setSource(source);
+ else
+ return WinJS.Promise.wrap()
+ }, _clearOldSource: function _clearOldSource() {
+ this._keyMap = {};
+ this._data = [];
+ this._loadedRanges = new MS.Entertainment.Data.Ranges;
+ this._loadedNonSourceRanges = new MS.Entertainment.Data.Ranges;
+ this._source = MSE.Data.VirtualList.emptySource;
+ this._sourceCount = 0;
+ this._selectionCountLocked = 0;
+ if (this._selectedItemsPromise) {
+ this._selectedItemsPromise.cancel();
+ this._selectedItemsPromise = null
+ }
+ }, _setSource: function _setSource(source) {
+ var returnPromise;
+ source = source || MSE.Data.VirtualList.emptySource;
+ this._clearOldSource();
+ this._source = source;
+ this._sourceCount = -1;
+ this.count = -1;
+ returnPromise = this._getSourceCountAsync().then(function gotCount(value) {
+ this._sourceCount = value;
+ if (this.randomAccessChunking)
+ this.count = this.chunkerCount;
+ else
+ this.count = value || 0;
+ if (!value)
+ this._source = MSE.Data.VirtualList.emptySource;
+ this._notifyInvalidateList()
+ }.bind(this));
+ return returnPromise
+ }, _clearSourceItems: function _clearSourceItems() {
+ this._source = MSE.Data.VirtualList.emptySource
+ }, _getSourceItemsAsync: function _getSourceItemsAsync(startIndex, lastIndex) {
+ var promise;
+ if (startIndex > lastIndex || startIndex < 0 || this.isEmptySource())
+ promise = this._getEmptySourceItems();
+ else if (this.isSourceArray())
+ promise = this._getArraySourceItems(this.source, startIndex, lastIndex);
+ else if (this.isSourceList())
+ promise = this._getVirtualListSourceItems(this.source, startIndex, lastIndex);
+ else if (this.isSourceVector())
+ promise = this._getVectorSourceItems(this.source, startIndex, lastIndex);
+ else
+ promise = WinJS.Promise.wrapError(new Error("Unknown source item type"));
+ return promise
+ }, _getSourceCountAsync: function _getSourceCountAsync() {
+ var promise;
+ if (this.isEmptySource())
+ promise = WinJS.Promise.wrapError(MSE.Data.List.CountResult.unknown);
+ else if (!this._source)
+ promise = WinJS.Promise.wrap(0);
+ else if (typeof this._source.length === "number")
+ promise = WinJS.Promise.wrap(this._source.length);
+ else if (typeof this._source.getCount === "function")
+ promise = this._source.getCount();
+ else
+ promise = WinJS.Promise.wrap(0);
+ return promise
+ }, _createSourceItemsResult: function _createSourceItemsResult(items, totalCount) {
+ if (isNaN(totalCount))
+ return {items: items};
+ else
+ return {
+ items: items, totalCount: totalCount
+ }
+ }, _getEmptySourceItems: function _getEmptySourceItems() {
+ return this._createSourceItemsResult([])
+ }, _getArraySourceItems: function _getArraySourceItems(source, startIndex, lastIndex) {
+ return WinJS.Promise.wrap(this._createSourceItemsResult(source.slice(startIndex, lastIndex + 1)))
+ }, _getVectorSourceItems: function _getVectorSourceItems(source, startIndex, lastIndex) {
+ var result = [];
+ for (var i = startIndex; i <= lastIndex; i++)
+ result.push(source.getItem(i));
+ return WinJS.Promise.wrap(this._createSourceItemsResult(result))
+ }, _getVirtualListSourceItems: function _getVirtualListSourceItems(source, startIndex, lastIndex) {
+ var count = Math.max(0, lastIndex - startIndex);
+ return source.itemsFromIndex(startIndex, 0, count).then(function handleResult(args) {
+ var result = [];
+ for (var i = args.offset; i < args.items.length; i++)
+ result.push(args.items[i].data);
+ return this._createSourceItemsResult(result)
+ }.bind(this))
+ }
+ }, {
+ emptySource: [], is: function isVirtualList(object) {
+ return MSE.Data.VirtualList.prototype.isPrototypeOf(object)
+ }, wrapArray: function wrapArray(array) {
+ var virtualList = new MS.Entertainment.Data.VirtualList;
+ return virtualList.setSource(array).then(function returnVirtualList() {
+ return virtualList
+ })
+ }, copy: function copy(list) {
+ var result = null;
+ if (MS.Entertainment.Data.List.isList(list))
+ result = list.toArrayAll().then(function gotArray(array) {
+ return new MS.Entertainment.Data.VirtualList(null, array)
+ });
+ else if (Array.isArray(list))
+ result = new MS.Entertainment.Data.VirtualList(null, list);
+ else if (list !== null && list !== undefined)
+ result = new MS.Entertainment.Data.VirtualList(null, [list]);
+ return WinJS.Promise.as(result)
+ }
+ })});
+ WinJS.Namespace.defineWithParent(MSE, "Data", {SelectionList: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.VirtualList", function selectionListConstructor() {
+ MSE.Data.VirtualList.prototype.constructor.call(this);
+ this._preventCacheClearing()
+ }, {
+ _chunkerSource: null, _selection: null, _selectedItemsPromise: null, _selectedEverything: false, _selectionCountLocked: 0, _selectionLocked: false, copy: function copy() {
+ var list = new MS.Entertainment.Data.SelectionList;
+ list.setSource(this._chunkerSource, this._selection, this._selectedEverything);
+ list._lockSelection();
+ return list
+ }, isLocked: {get: function get_isLocked() {
+ return !!this._selectedItemsPromise
+ }}, chunkSize: {get: function() {
+ return 100
+ }}, originalSelectionIndices: {get: function get_originalSelectionIndices() {
+ var result;
+ if (this._selection && this._selection.getIndices)
+ result = this._selection.getIndices();
+ return result || []
+ }}, originalSelectionSourceIndices: {get: function get_originalSelectionSourceIndices() {
+ var result = this.originalSelectionIndices;
+ if (this._chunkerSource && this._chunkerSource.indexToSourceIndex)
+ result = result.map(function(index) {
+ return this._chunkerSource.indexToSourceIndex(index)
+ }, this);
+ return result
+ }}, _selectionCount: {get: function() {
+ if (this._selectedEverything)
+ return this._chunkerSource ? this._chunkerSource.count - this._chunkerSource.nonSourceCount : 0;
+ else
+ return this._selection ? this._selection.count() : this._selectionCountLocked
+ }}, _createChunker: function() {
+ return {
+ totalCount: this._selectionCount, loadChunk: this._loadChunkFromSource.bind(this)
+ }
+ }, setSource: function setSource(source, selection, selectedEverything) {
+ if (selection && !selection.count && !selection.getItems && !selection.getIndices)
+ throw new Error("Invalid selection type was passed to SelectionList");
+ var initialCount = selection ? selection.count() : 0;
+ if (initialCount > 1 && source && !source.forEachAll)
+ throw new Error("Invalid source type was passed to SelectionList. At the moment multi-selection only supports a VirtualList source");
+ this._clearOldSource();
+ this._selection = selection;
+ this._selectedEverything = selectedEverything;
+ this._chunkerSource = source;
+ this.chunker = this._createChunker();
+ return MSE.Data.VirtualList.prototype.setSource.call(this, null)
+ }, _lockSelection: function _lockSelection() {
+ if (!this._selectedEverything && !this._selectedItemsPromise) {
+ this._selectionCountLocked = this._selection ? this._selection.count() : 0;
+ this._selectedItemsPromise = (this._selection ? this._selection.getItems() : WinJS.Promise.wrap([])).then(null, function ignoreCancels(error) {
+ var result = [];
+ if (!WinJS.Promise.isCanceledError(error))
+ result = WinJS.Promise.wrapError(error);
+ return result
+ });
+ this._selection = null
+ }
+ }, _getSelectedItems: function _getSelectedItems() {
+ if (this._selection)
+ return this._selection.getItems();
+ else if (this._selectedItemsPromise)
+ return this._selectedItemsPromise;
+ else
+ return WinJS.Promise.wrap([])
+ }, _getEmptyChunk: function _getEmptyChunk() {
+ return this._createChunkResult(null, null, null, true)
+ }, _createChunkResult: function _createChunkResult(items, offset, count, error) {
+ return WinJS.Promise.wrap({
+ items: items || [], offset: offset || 0, error: !!error, totalCount: count || this._selectionCount
+ })
+ }, _loadChunkFromSource: function _loadChunkFromSource(index, countBefore, countAfter) {
+ countAfter = countAfter || 0;
+ countBefore = countBefore || 0;
+ var selectionCount = this._selectionCount;
+ if (index - countBefore < 0 || countBefore < 0 || countAfter < 0 || selectionCount === 0)
+ return this._getEmptyChunk();
+ else if (this._selectedEverything && selectionCount > 1)
+ return this._getChunkAllSelected(index, countBefore, countAfter);
+ else
+ return this._getChunkSomeSelected(index, countBefore, countAfter)
+ }, _getChunkAllSelected: function _getChunkAllSelected(index, countBefore, countAfter) {
+ var items = [];
+ var offset = countBefore;
+ var startIndex = this._chunkerSource.indexFromSourceIndex(index - countBefore);
+ var totalNeeded = countBefore + 1 + countAfter;
+ return this._chunkerSource.forEachAll(function iteration(args) {
+ if (!args.item.isNonSourceData)
+ items.push(args.item.data);
+ if (items.length >= totalNeeded)
+ args.stop = true
+ }.bind(this), startIndex).then(function gotItems() {
+ return this._createChunkResult(items, offset)
+ }.bind(this))
+ }, _getChunkSomeSelected: function _getChunkSomeSelected(index, countBefore, countAfter) {
+ var selectionCount = this._selectionCount;
+ var startIndex = index - countBefore;
+ var endIndex = index + countAfter;
+ return this._getSelectedItems().then(function(selectionItems) {
+ var items = [];
+ selectionItems = selectionItems || [];
+ for (var i = startIndex; i <= endIndex && i < selectionItems.length; i++)
+ items.push(selectionItems[i] ? selectionItems[i].data : null);
+ return this._createChunkResult(items, countBefore, selectionCount)
+ }.bind(this))
+ }
+ })});
+ WinJS.Namespace.defineWithParent(MSE, "Data", {TrimmedList: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.VirtualList", function virtualListConstructor(itemFactory, source, chunker) {
+ MSE.Data.VirtualList.prototype.constructor.call(this, itemFactory, source, chunker)
+ }, {
+ _maxCount: -1, maxCount: {
+ get: function() {
+ return this._maxCount
+ }, set: function(value) {
+ if (this._maxCount !== value)
+ this._maxCount = value;
+ if (this._maxCount >= 0)
+ this.count = Math.min(this._maxCount, this.count)
+ }
+ }, count: {
+ get: function() {
+ return this.getProperty("count")
+ }, set: function(value) {
+ if (this.maxCount >= 0)
+ value = Math.min(this._maxCount, value);
+ this.setProperty("count", value)
+ }
+ }
+ })})
+})(WinJS.Namespace.define("MS.Entertainment", null))
+})();
+/* >>>>>>/framework/data/query.js:20256 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Data");
+(function(undefined) {
+ "use strict";
+ var MSE = WinJS.Namespace.define("MS.Entertainment", null);
+ var logJsonFailure = function logJsonFailure(message, error, json) {
+ MSE.Data.fail(["JSON parse failed. \n\t[message: ", (message), "] \n\t[error message: ", (error && error.message), "] \n\t[json string length: ", (json ? json.length : ""), "] \n\t[json string: \'", (json), "\']"].join(String.empty))
+ };
+ WinJS.Namespace.defineWithParent(MSE, "Data", {queryStatus: {
+ idle: 0, requestingData: 1, processingData: 2, augmentingData: 3, completed: 4, failed: 5, max: 5, isWorking: function isWorking(status) {
+ return status === MSE.Data.queryStatus.requestingData || status === MSE.Data.queryStatus.processingData || status === MSE.Data.queryStatus.augmentingData
+ }, hasCompleted: function isWorking(status) {
+ return status === MSE.Data.queryStatus.completed
+ }, hasFailed: function isWorking(status) {
+ return status === MSE.Data.queryStatus.failed
+ }, hasCompletedOrFailed: function isWorking(status) {
+ return status === MSE.Data.queryStatus.completed || status === MSE.Data.queryStatus.failed
+ }
+ }});
+ WinJS.Namespace.defineWithParent(MSE, "Data.Query.edsIdType", {
+ amg: "AMG", canonical: "Canonical", mediaNet: "MediaNet", offer: "Offer", providerContentId: "ProviderContentId", xboxHexTitle: "XboxHexTitle", zuneCatalog: "ZuneCatalog", zuneMediaInstance: "ZuneMediaInstance"
+ });
+ WinJS.Namespace.defineWithParent(MSE, "Data", {observableQueryMixin: {
+ enabled: false, status: MSE.Data.queryStatus.idle, cookie: null, errorCode: 0, errorObject: null, result: null, totalCount: -1
+ }});
+ WinJS.Namespace.defineWithParent(MSE, "Data", {ObservableQuery: WinJS.Class.mix(function observableQuery() {
+ this._initObservable(Object.create(MS.Entertainment.Data.observableQueryMixin))
+ }, WinJS.Utilities.eventMixin, WinJS.Binding.mixin, WinJS.Binding.expandProperties(MS.Entertainment.Data.observableQueryMixin))});
+ WinJS.Namespace.defineWithParent(MSE, "Data", {
+ Disposer: MS.Entertainment.UI.Framework.define(null, {
+ dispose: function dispose() {
+ var keys = Object.getOwnPropertyNames(this);
+ for (var key in keys)
+ this.disposeOnly(key)
+ }, disposeOnly: function disposeOnly(key) {
+ var object = this[key];
+ if (object && object.dispose)
+ object.dispose();
+ if (key !== "dispose" && key !== "disposeOnly")
+ delete this[key]
+ }
+ }), MainQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ObservableQuery", function mainQueryConstructor() {
+ MSE.Data.ObservableQuery.prototype.constructor.call(this);
+ this.status = MSE.Data.queryStatus.idle;
+ this.autoUpdateProperties = this.autoUpdateProperties || {};
+ this.autoUpdateProperties.enabled = true
+ }, {
+ _generation: 0, _referenceCount: 0, resultFactory: null, provider: null, autoUpdateProperties: null, debugInstanceId: null, listDestinationHint: null, generation: {get: function() {
+ return this._generation
+ }}, addReference: function addReference() {
+ this._logQueryActions("AddRef");
+ this._referenceCount++
+ }, release: function release() {
+ this._logQueryActions("Release");
+ if (this._referenceCount > 0)
+ this._referenceCount--;
+ else
+ MS.Entertainment.Platform.Playback.Etw.traceString("MainQuery::release() Reference count is already at zero.")
+ }, dispose: function dispose() {
+ this._logQueryActions("Dispose");
+ if (this._referenceCount > 0)
+ MS.Entertainment.Platform.Playback.Etw.traceString("MainQuery::dispose() Reference count is not zero. Could be disposing a query that is still being consumed by another component. Or query may not have been correctly released.")
+ }, createResultObject: function createResultObject() {
+ return this.resultFactory(null, this)
+ }, createPendingResultObject: function createPendingResultObject(resultOverride) {
+ this._generation++;
+ var result = {
+ generation: this._generation, result: ((resultOverride) || this.createResultObject())
+ };
+ return result
+ }, execute: function execute(cookie) {
+ return WinJS.Promise.wrapError(this)
+ }, refresh: function refresh() {
+ var promise;
+ if (this.enabled)
+ promise = this.execute();
+ else
+ promise = WinJS.Promise.wrap(this);
+ return promise
+ }, getItems: function getItems() {
+ return this.execute().then(function executeCompleted() {
+ return this._getList()
+ }.bind(this))
+ }, getItemsAndIgnoreErrors: function getItemsAndIgnoreErrors() {
+ return this.getItems().then(function handleResult(result) {
+ return result
+ }, function handleError(error) {
+ MS.Entertainment.Data.fail("getItems failed. error.message = " + error && error.message);
+ return null
+ })
+ }, getItemsArrayAndIgnoreErrors: function getItemsArrayAndIgnoreErrors() {
+ return this.getItemsAndIgnoreErrors().then(function handleResult(result) {
+ return result ? result.toArrayAll() : []
+ }, function handleError(error) {
+ MS.Entertainment.Data.fail("getItemsAndIgnoreErrors failed. error.message = " + error && error.message);
+ return []
+ }).then(function handleResult(result) {
+ return result
+ }, function handleError(error) {
+ MS.Entertainment.Data.fail("toArrayAll failed. error.message = " + error && error.message);
+ return []
+ })
+ }, createGroupsQuery: function createGroupsQuery() {
+ return null
+ }, restore: function restore(cookie) {
+ return this.execute(cookie)
+ }, loadPreviousChunk: function loadPreviousChunk() {
+ return WinJS.Promise.wrap(this)
+ }, loadNextChunk: function loadNextChunk() {
+ return WinJS.Promise.wrap(this)
+ }, notify: function notify(propertyName, newValue, oldValue) {
+ if (!this.isDisposed && this.autoUpdateProperties && newValue !== oldValue && this.autoUpdateProperties[propertyName])
+ this.refresh().done(null, function error(){});
+ MSE.Data.ObservableQuery.prototype.notify.apply(this, arguments)
+ }, clone: function clone() {
+ var prototype = Object.getPrototypeOf(this);
+ var QueryConstructor = (prototype.constructor);
+ var newQuery = new QueryConstructor;
+ var addToPropertyValues = function addToPropertyValues(key) {
+ if (key !== "isLive")
+ newQuery[key] = this[key]
+ }.bind(this);
+ while (prototype && prototype.constructor !== MS.Entertainment.Data.observableQueryMixin) {
+ Object.keys(prototype).forEach(addToPropertyValues);
+ prototype = Object.getPrototypeOf(prototype)
+ }
+ return newQuery
+ }, _getList: function _getList(resultOverride) {
+ var result = resultOverride || this.result;
+ var list = null;
+ if (this.listDestinationHint)
+ list = this._getListWorker(MS.Entertainment.Utilities.valueFromPropertyPath(result, this.listDestinationHint), 0, this.listDestinationHint);
+ if (!list)
+ list = this._getListWorker(result);
+ return list
+ }, _getListWorker: function _getListWorker(currentValue, depth, currentPath) {
+ var updatedPath,
+ key,
+ updatedValue;
+ var list = null;
+ depth = depth || 0;
+ currentPath = currentPath || String.empty;
+ currentValue = WinJS.Binding.unwrap(currentValue);
+ if (this._isListType(currentValue)) {
+ this.listDestinationHint = currentPath;
+ list = currentValue
+ }
+ else if (currentValue && typeof currentValue === "object" && !Array.isArray(currentValue) && depth < MSE.Data.MainQuery.maxListDepth)
+ for (key in currentValue)
+ if (key && key[0] !== "_")
+ try {
+ updatedValue = currentValue[key];
+ updatedPath = currentPath ? currentPath + "." + key : key;
+ list = this._getListWorker(updatedValue, depth + 1, updatedPath);
+ if (list)
+ break
+ }
+ catch(exception) {}
+ return list
+ }, _isListType: function _isListType(value) {
+ return MSE.Data.List.is(value)
+ }, _setResult: function _setResult(result, totalCount, error) {
+ this.result = result;
+ this.totalCount = totalCount;
+ this.dispatchEvent(MS.Entertainment.Data.MainQuery.events.resultChanged, {
+ sender: this, result: result, totalCount: totalCount, error: error
+ })
+ }, _handleEnabled: function _handleEnabled() {
+ this.refresh()
+ }, _logQueryActions: function _logActions(action) {
+ if (this.debugInstanceId && action && MSE.Platform && MSE.Platform.Playback && MSE.Platform.Playback.Etw) {
+ var queryType = "isLive" in this ? " LibraryWrapperQuery" : " PlaybackQuery";
+ var traceString = "MainQuery:: " + action.toUpperCase() + queryType + " id=" + this.debugInstanceId;
+ MSE.Platform.Playback.Etw.traceString(traceString)
+ }
+ }
+ }, {
+ maxListDepth: 3, events: {resultChanged: "resultChanged"}, isQuery: function MainQuery_isQuery(object) {
+ return MS.Entertainment.Data.MainQuery.prototype.isPrototypeOf(object)
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ RandomAccessChunk: MS.Entertainment.UI.Framework.define(function randomAccessChunk(startIndex, count) {
+ this.startIndex = startIndex;
+ this.count = count
+ }, {
+ startIndex: 0, count: 0
+ }, {is: function randomAccessChunk_is(object) {
+ return MS.Entertainment.Data.RandomAccessChunk.prototype.isPrototypeOf(object)
+ }}), AugmentQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.MainQuery", function() {
+ MSE.Data.MainQuery.prototype.constructor.call(this)
+ }, {
+ _originalChunkDestination: null, _chunkDestination: null, _nextChunk: null, _previousChunk: null, _resultShape: null, _disposed: false, lastChunkedResult: null, resultFactory: MSE.Data.Factory.self, resultAugmentation: null, allowGroupHints: false, hasTotalCount: false, aggregateChunks: false, chunked: true, chunkSize: 100, currentChunk: null, clearResultOnFailure: false, dispose: function dispose() {
+ MSE.Data.MainQuery.prototype.dispose.call(this);
+ this.createPendingResultObject();
+ if (this._originalChunkDestination && this._originalChunkDestination.dispose)
+ this._originalChunkDestination.dispose();
+ this._clearChunkDestination();
+ this._clearListQueryHinter();
+ this._disposed = true
+ }, isDisposed: {get: function() {
+ return this._disposed
+ }}, nextChunk: {
+ get: function() {
+ return this._nextChunk
+ }, set: function(value) {
+ this._nextChunk = value
+ }
+ }, previousChunk: {
+ get: function() {
+ return this._previousChunk
+ }, set: function(value) {
+ this._previousChunk = value
+ }
+ }, hasNextChunk: {get: function() {
+ return (this.nextChunk !== null && this.nextChunk !== undefined && this.nextChunk !== MSE.Data.AugmentQuery.invalidNextChunk)
+ }}, hasPreviousChunk: {get: function() {
+ return (this.previousChunk !== null && this.previousChunk !== undefined && this.previousChunk !== MSE.Data.AugmentQuery.invalidPreviousChunk)
+ }}, isLoadingFromStart: {get: function() {
+ return this.currentChunk === null || this.currentChunk === undefined
+ }}, chunkDestinationHint: {
+ get: function() {
+ return this.listDestinationHint
+ }, set: function(value) {
+ this.listDestinationHint = value
+ }
+ }, chunkDestination: {
+ get: function get_chunkDesination() {
+ return this._chunkDestination
+ }, set: function set_chunkDesination(value) {
+ if (this._disposed)
+ return;
+ this._chunkDestination = value
+ }
+ }, execute: function execute(cookie) {
+ this.currentChunk = (cookie === null || cookie === undefined) ? null : cookie;
+ return this._execute()
+ }, loadPreviousChunk: function loadPreviousChunk() {
+ if (this.previousChunk !== null && this.previousChunk !== undefined && this.previousChunk !== MSE.Data.AugmentQuery.invalidPreviousChunk) {
+ this.currentChunk = this.previousChunk;
+ return this._execute()
+ }
+ else
+ return WinJS.Promise.wrap(this)
+ }, loadNextChunk: function loadNextChunk() {
+ if (this.nextChunk !== null && this.nextChunk !== undefined && this.nextChunk !== MSE.Data.AugmentQuery.invalidNextChunk) {
+ this.currentChunk = this.nextChunk;
+ return this._execute()
+ }
+ else
+ return WinJS.Promise.wrap(this)
+ }, isValidChunk: function isValidChunk(chunk) {
+ return chunk !== null && chunk !== undefined && chunk !== MSE.Data.AugmentQuery.invalidNextChunk && chunk !== MSE.Data.AugmentQuery.invalidPreviousChunk
+ }, _isListType: function _isListType(value) {
+ return MSE.Data.VirtualList.is(value)
+ }, _getChunkDestination: function _getChunkDestination(resultOverride) {
+ return this._getList(resultOverride)
+ }, _setChunkDestination: function _setChunkDestination() {
+ if (this.aggregateChunks) {
+ this._chunkDestination = this._originalChunkDestination = this._getChunkDestination();
+ if (this._originalChunkDestination)
+ this._originalChunkDestination.chunker = this
+ }
+ else
+ this._clearChunkDestination()
+ }, _clearChunkDestination: function _clearChunkDestination() {
+ if (this._originalChunkDestination) {
+ if (WinJS.Binding.unwrap(this._originalChunkDestination.chunker) === this)
+ this._originalChunkDestination.chunker = null;
+ this._originalChunkDestination = null;
+ this._chunkDestination = null
+ }
+ }, _setListQueryHinter: function _setListQueryHinter() {
+ var groupHintsQuery;
+ this._clearListQueryHinter();
+ if (this.allowGroupHints) {
+ groupHintsQuery = this.createGroupsQuery();
+ this._queryHinterDestination = this._getList()
+ }
+ if (this._queryHinterDestination && groupHintsQuery)
+ this._queryHinterDestination.groupHinter = groupHintsQuery
+ }, _clearListQueryHinter: function _clearListQueryHints() {
+ if (this._queryHinterDestination) {
+ if (WinJS.Binding.unwrap(this._queryHinterDestination.groupHinter) === this)
+ this._queryHinterDestination.groupHinter = null;
+ this._queryHinterDestination = null
+ }
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ return result
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ return result
+ }, _parseTotalCount: function _parseTotalCount(result) {
+ return (!this.hasTotalCount || !result || isNaN(result.totalCount)) ? -1 : result.totalCount
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ return this.resultAugmentation
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ return MSE.Data.AugmentQuery.invalidNextChunk
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ return MSE.Data.AugmentQuery.invalidPreviousChunk
+ }, _startExecute: function _startExecute(){}, _preInnerExecute: function _preInnerExecute() {
+ return WinJS.Promise.wrap()
+ }, _startInnerExecute: function _startInnerExecute() {
+ return WinJS.Promise.wrapError()
+ }, _retryInnerExecute: function _retryInnerExecute(result, error) {
+ return false
+ }, _endInnerExecute: function _endInnerExecute(result){}, _preInsertChunk: function _preInsertChunk(destination, chunk){}, _execute: function _execute(chunkDestinationOverride) {
+ var innerPromise;
+ var that = this;
+ var pendingResult = this.createPendingResultObject();
+ var loadingFromStart = this.isLoadingFromStart;
+ var chunkingNext = this.nextChunk !== null && this.nextChunk !== undefined && this.currentChunk === this.nextChunk;
+ var chunkingPrevious = this.previousChunk !== null && this.previousChunk !== undefined && this.currentChunk === this.previousChunk;
+ var chunkingRandom = !loadingFromStart && MS.Entertainment.Data.RandomAccessChunk.is(this.currentChunk);
+ var aggregateChunking = this.aggregateChunks && (chunkingNext || chunkingPrevious || chunkingRandom);
+ var progressCallback;
+ function cleanUp() {
+ innerPromise = null;
+ pendingResult = null
+ }
+ {};
+ function cancelInnerPromiseNoError() {
+ if (innerPromise) {
+ if (pendingResult)
+ pendingResult.generation = -1;
+ try {
+ innerPromise.cancel()
+ }
+ catch(exception) {}
+ }
+ cleanUp()
+ }
+ {};
+ function cancelInnerPromise(cancelReason) {
+ cancelInnerPromiseNoError();
+ cancelReason = cancelReason || "unknown";
+ cancelReason = "Query was canceled. Cancel reason: " + cancelReason + ".";
+ return WinJS.Promise.wrapError(that._createError({
+ name: "Canceled", description: cancelReason, message: cancelReason
+ }))
+ }
+ {};
+ function updateStatus(status) {
+ that.status = status;
+ progressCallback(that)
+ }
+ {};
+ function updateError(error) {
+ that.errorObject = that._createError(error);
+ that.errorCode = that.errorObject.number
+ }
+ {};
+ function clearErrorCode() {
+ that.errorCode = 0;
+ that.errorObject = null
+ }
+ {};
+ function handleInnerPromiseEvent(result, callback, preventFailure) {
+ if (pendingResult && pendingResult.generation === that.generation)
+ return callback(result);
+ else if (!preventFailure && !pendingResult)
+ return cancelInnerPromise("the cancel was invoked on the execute promise");
+ else if (!preventFailure && pendingResult.generation >= 0)
+ return cancelInnerPromise("the query.execute was invoked after this execution, " + (that.generation - pendingResult.generation) + " time(s)")
+ }
+ {};
+ function parseInnerResult(result) {
+ updateStatus(MSE.Data.queryStatus.augmentingData);
+ result = that._parseInnerResult(result);
+ return MSE.Data.augment(result, that._getResultAugmentation())
+ }
+ {};
+ function handleInnerCompleted(result) {
+ pendingResult.result = result;
+ that._setResult(pendingResult.result, that._parseTotalCount(pendingResult.result));
+ that._setChunkDestination();
+ that._setListQueryHinter();
+ return WinJS.Promise.wrap()
+ }
+ {};
+ function handleInnerCompletedChunked(result) {
+ pendingResult.result = result;
+ that.totalCount = that._parseTotalCount(pendingResult.result);
+ if (chunkingRandom)
+ return that._insertChunkAt(that.currentChunk.startIndex, that._getChunkDestination(result), chunkDestinationOverride);
+ else
+ return that._insertChunk(chunkingNext, that._getChunkDestination(result), chunkDestinationOverride)
+ }
+ {};
+ function handleInnerFailure(result) {
+ updateStatus(MSE.Data.queryStatus.failed);
+ updateError(result);
+ var newResult = that.clearResultOnFailure ? null : that.result;
+ that._setResult(newResult, that._parseTotalCount(newResult), result);
+ return WinJS.Promise.wrapError(result)
+ }
+ {};
+ function handleInnerProgress(result) {
+ updateStatus(that._parseInnerProgress(result))
+ }
+ {};
+ function executeCompleted() {
+ if (!that.chunked || !that.chunkSize)
+ that._nextChunk = null;
+ else if (chunkingNext || loadingFromStart || chunkingRandom || that._nextChunk === null || that._nextChunk === undefined)
+ that._nextChunk = that._calculateNextChunkKey(pendingResult.result);
+ if (that._nextChunk === null || that._nextChunk === undefined)
+ that._nextChunk = MSE.Data.AugmentQuery.invalidNextChunk;
+ if (!that.chunked || !that.chunkSize)
+ that._previousChunk = null;
+ else if (chunkingPrevious || loadingFromStart || chunkingRandom || that._previousChunk === null || that._previousChunk === undefined)
+ that._previousChunk = that._calculatePreviousChunkKey(pendingResult.result);
+ if (that._previousChunk === null || that._previousChunk === undefined)
+ that._previousChunk = MSE.Data.AugmentQuery.invalidPreviousChunk;
+ if (chunkingPrevious || chunkingNext || chunkingRandom)
+ that.lastChunkedResult = pendingResult.result;
+ that._endInnerExecute(pendingResult.result);
+ updateStatus(MSE.Data.queryStatus.completed)
+ }
+ {};
+ function wrapPromiseHandler(callback, preventFailure) {
+ return function(result) {
+ return handleInnerPromiseEvent(result, callback, preventFailure)
+ }
+ }
+ {};
+ function handlePromiseFailure(error) {
+ return WinJS.Promise.wrapError(error)
+ }
+ {};
+ function testRetry(result, error) {
+ var promise;
+ if (result)
+ result = parseInnerResult(result);
+ if (that._retryInnerExecute(result, error))
+ promise = startInnerExecute();
+ else {
+ var promise = !!error ? wrapPromiseHandler(handleInnerFailure)(error) : wrapPromiseHandler(aggregateChunking ? handleInnerCompletedChunked : handleInnerCompleted)(result);
+ promise = WinJS.Promise.as(promise).then(wrapPromiseHandler(executeCompleted), handlePromiseFailure)
+ }
+ return promise
+ }
+ {};
+ function testRetryOnSuccess(result) {
+ return testRetry(result)
+ }
+ {};
+ function testRetryOnError(error) {
+ return testRetry(null, error)
+ }
+ {};
+ function createInnerPromise(completed, failed, progress) {
+ progressCallback = progressCallback || progress;
+ clearErrorCode();
+ updateStatus(MSE.Data.queryStatus.requestingData);
+ innerPromise = that._startInnerExecute().then(wrapPromiseHandler(testRetryOnSuccess), wrapPromiseHandler(testRetryOnError), wrapPromiseHandler(handleInnerProgress, true)).then(function innerPromiseCompleted() {
+ completed(that);
+ cleanUp()
+ }, function innerPromiseFailed(error) {
+ failed(that._createError(error));
+ cleanUp()
+ })
+ }
+ this._startExecute();
+ function startInnerExecute() {
+ if (!aggregateChunking)
+ that._clearChunkDestination();
+ return WinJS.Promise.as(that._preInnerExecute()).then(function() {
+ return new WinJS.Promise(createInnerPromise, cancelInnerPromiseNoError)
+ })
+ }
+ return startInnerExecute()
+ }, _createError: function _createError(error, description) {
+ var newError = new Error(description);
+ if (error)
+ MS.Entertainment.Utilities.BindingAgnostic.setProperties(newError, error);
+ newError.errorCode = newError.number;
+ newError.originalError = error;
+ newError.details = {query: this};
+ return newError
+ }, _insertChunkAt: function(startIndex, list, chunkDestinationOverride) {
+ var promise;
+ var destination = chunkDestinationOverride || this.chunkDestination;
+ if (!destination)
+ promise = WinJS.Promise.wrapError(new Error("no destination was found when inserting chunk at index"));
+ else if (list && destination.insertRangeAt) {
+ this._preInsertChunk(destination, list);
+ promise = destination.insertRangeAt(startIndex, list.source, {
+ suppressEvents: true, isSourceData: true
+ })
+ }
+ else
+ promise = WinJS.Promise.wrap()
+ }, _insertChunk: function(nextChunk, list, chunkDestinationOverride) {
+ var promise;
+ var destination = chunkDestinationOverride || this.chunkDestination;
+ if (!destination)
+ promise = WinJS.Promise.wrapError(new Error("no destination was found when inserting chunk"));
+ else if (list && destination.insertRangeAtEnd && destination.insertRangeAtStart) {
+ this._preInsertChunk(destination, list);
+ if (nextChunk)
+ promise = destination.insertRangeAtEnd(list.source, {
+ suppressEvents: true, isSourceData: true
+ });
+ else
+ promise = destination.insertRangeAtStart(list.source, {
+ suppressEvents: true, isSourceData: true
+ })
+ }
+ else
+ promise = WinJS.Promise.wrap();
+ return promise
+ }, _getChunkResultSize: function _getChunkResultSize(result) {
+ var resultSize = 0;
+ var listResult;
+ if (result && !isNaN(result.count))
+ resultSize = result.count;
+ else
+ listResult = this._getChunkDestination(result);
+ if (listResult)
+ if (listResult.hasCount)
+ resultSize = listResult.count;
+ else if (listResult.source)
+ resultSize - listResult.source.length;
+ return resultSize || 0
+ }
+ }, {
+ invalidNextChunk: {}, invalidPreviousChunk: {}, _findAugmentation: function _findAugmentation(augmentation, testCallback) {
+ var propertyName;
+ var propertyAugmentation;
+ var itemAugmentationOrFactory;
+ var key;
+ var augmentationShape = MS.Entertainment.Data.augmentationShape(augmentation);
+ if (augmentationShape)
+ for (key in augmentationShape) {
+ propertyAugmentation = augmentationShape[key];
+ if (testCallback(key, propertyAugmentation)) {
+ propertyName = key;
+ break
+ }
+ propertyAugmentation = null
+ }
+ if (propertyAugmentation && propertyAugmentation.augmentationOptions && propertyAugmentation.augmentationOptions.itemAugmentationOrFactory)
+ itemAugmentationOrFactory = propertyAugmentation.augmentationOptions.itemAugmentationOrFactory;
+ return {
+ key: propertyName, augmentation: propertyAugmentation, itemAugmentationOrFactory: itemAugmentationOrFactory
+ }
+ }, findAugmentation: function findAugmentation(augmentation, key) {
+ return MS.Entertainment.Data.AugmentQuery._findAugmentation(augmentation, function isList(testKey, testAugmentation) {
+ return testKey === key
+ })
+ }, findListAugmentation: function findListAugmentation(augmentation) {
+ return MS.Entertainment.Data.AugmentQuery._findAugmentation(augmentation, function isList(testKey, testAugmentation) {
+ return MS.Entertainment.Data.Property.isList(testAugmentation)
+ })
+ }, modifyResultAugmentation: function modifyResultAugmentation(augmentation, key, definition) {
+ var result = augmentation;
+ var itemAugmentation;
+ var rootDefinition;
+ var property = MS.Entertainment.Data.AugmentQuery.findAugmentation(augmentation, key);
+ if (property.key && property.augmentation) {
+ rootDefinition = {};
+ itemAugmentation = property.augmentation.augmentationOptions ? property.augmentation.augmentationOptions.augmentation : null;
+ itemAugmentation = MS.Entertainment.Data.Factory.createDerivedAugmentationOrFactory(itemAugmentation, definition);
+ rootDefinition[property.key] = MS.Entertainment.Data.Property.createAugmentation(property.augmentation, {augmentation: itemAugmentation})
+ }
+ if (augmentation && rootDefinition)
+ result = MS.Entertainment.Data.derive(augmentation, null, rootDefinition);
+ return result
+ }, modifyListResultAugmentation: function modifyListResultAugmentation(augmentation, definition) {
+ var result = augmentation;
+ var listPropertyAugmentation;
+ var listItemAugmentation;
+ var rootDefinition;
+ var listProperty = MS.Entertainment.Data.AugmentQuery.findListAugmentation(augmentation);
+ if (listProperty.key && listProperty.augmentation) {
+ rootDefinition = {};
+ listItemAugmentation = MS.Entertainment.Data.Factory.createDerivedAugmentationOrFactory(listProperty.itemAugmentationOrFactory, definition);
+ rootDefinition[listProperty.key] = MS.Entertainment.Data.Property.createAugmentation(listProperty.augmentation, {itemAugmentationOrFactory: listItemAugmentation})
+ }
+ if (augmentation && rootDefinition)
+ result = MS.Entertainment.Data.derive(augmentation, null, rootDefinition);
+ return result
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {AggregateQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function aggregateQuery() {
+ MSE.Data.AugmentQuery.prototype.constructor.call(this);
+ this.queries = []
+ }, {
+ queries: null, executeSequentially: false, resultAugmentationFactory: null, _handleIntermediateResult: function _handleIntermediateResult(sourceIndex, sourceResult){}, _startNonSequentialExecution: function _startSequentialExecution() {
+ var executePromises = [];
+ var index = 0;
+ var queryChunk = null;
+ this.queries.forEach(function executeQuery(query) {
+ queryChunk = this._getQueryChunk(index);
+ if (query && queryChunk !== undefined) {
+ query.aggregateChunks = this.chunked ? false : query.aggregateChunks;
+ executePromises.push(query.execute(queryChunk))
+ }
+ else
+ executePromises.push(WinJS.Promise.as({}));
+ index++
+ }, this);
+ return WinJS.Promise.join(executePromises)
+ }, _startSequentialExecution: function _startSequentialExecution() {
+ var results = [];
+ return new WinJS.Promise(function initializePromise(completeCallback, errorCallback) {
+ this._continueSequentialExecution(0, results, completeCallback, errorCallback)
+ }.bind(this))
+ }, _continueSequentialExecution: function _continueSequentialExecution(index, results, completeCallback, errorCallback) {
+ if (index >= this.queries.length) {
+ completeCallback(results);
+ return
+ }
+ var query = this.queries[index];
+ var queryChunk = this._getQueryChunk(index);
+ var queryExecutePromise;
+ if (query && queryChunk !== undefined) {
+ query.aggregateChunks = this.chunked ? false : query.aggregateChunks;
+ queryExecutePromise = query.execute(queryChunk)
+ }
+ else
+ queryExecutePromise = WinJS.Promise.as({});
+ queryExecutePromise.then(function queryFinished(result) {
+ results[index] = result;
+ this._handleIntermediateResult(index, result.result);
+ this._continueSequentialExecution(index + 1, results, completeCallback, errorCallback)
+ }.bind(this), function queryFailed(error) {
+ errorCallback(error)
+ }.bind(this))
+ }, _getQueryChunk: function _getQueryChunk(index) {
+ var executeChunk;
+ if (this.isLoadingFromStart || !this.chunked)
+ executeChunk = null;
+ else if (this.isValidChunk(this.currentChunk[index]))
+ executeChunk = this.currentChunk[index];
+ return executeChunk
+ }, _startInnerExecute: function _startInnerExecute() {
+ var innerPromise;
+ var lowestProgressValue = MSE.Data.queryStatus.max;
+ var loadingFromStart = this.isLoadingFromStart;
+ if (!this.resultAugmentation && this.resultAugmentationFactory && this.resultAugmentationFactory.create)
+ this.resultAugmentation = this.resultAugmentationFactory.create();
+ var returnedProgress;
+ function handleCompleted(result) {
+ returnedProgress(MSE.Data.queryStatus.processingData);
+ var wrapped = new MS.Entertainment.Data.Property.MergedItem;
+ result.forEach(function appendItem(item) {
+ wrapped.source.push(WinJS.Binding.unwrap(item ? item.result : {}))
+ }, this);
+ return wrapped
+ }
+ {};
+ function handleError(error) {
+ var result = error;
+ if (Array.isArray(error))
+ for (var i = 0; i < error.length; i++)
+ if (error[i] && error[i].errorObject) {
+ error = error[i].errorObject;
+ break
+ }
+ return WinJS.Promise.wrapError(error || {})
+ }
+ {};
+ function initializePromise(completed, failed, progress) {
+ returnedProgress = progress;
+ if (this.executeSequentially)
+ innerPromise = this._startSequentialExecution();
+ else
+ innerPromise = this._startNonSequentialExecution();
+ innerPromise.then(handleCompleted.bind(this), handleError.bind(this)).then(function innerCompleted(wrapped) {
+ completed(wrapped)
+ }.bind(this), function innerFailed(error) {
+ failed(error)
+ }.bind(this))
+ }
+ {};
+ function cancelPromise() {
+ if (innerPromise) {
+ innerPromise.cancel();
+ innerPromise = null
+ }
+ }
+ {};
+ return new WinJS.Promise(initializePromise.bind(this), cancelPromise.bind(this))
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ var nextChunk = null;
+ var index = 0;
+ if (this.queries && this.queries.length && (!this.aggregateChunks || this._getChunkResultSize(result)))
+ this.queries.forEach(function(query) {
+ if (query && query.nextChunk) {
+ nextChunk = nextChunk || [];
+ nextChunk.length = index + 1;
+ nextChunk[index] = query.nextChunk
+ }
+ index++
+ }, this);
+ return nextChunk
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ InnerGroupsQuery: MS.Entertainment.UI.Framework.define(function InnerGroupsQuery(innerQuery)
+ {
+ if (!innerQuery || !innerQuery.getGroupsAsync)
+ throw new Error("Invalid argument passed to InnerGroupsQuery");
+ this._innerQuery = innerQuery
+ }, {
+ _innerQuery: null, currentPage: null, previousPage: null, nextPage: null, dispose: function dispose() {
+ this._innerQuery = null
+ }, setCursorPosition: function setCursorPosition(){}, execute: function execute() {
+ return this.executeAsync()
+ }, executeAsync: function executeAsync() {
+ var result;
+ if (this._innerQuery)
+ result = this._innerQuery.getGroupsAsync().then(function extractJson(result) {
+ if (result && "json" in result)
+ result = result.json;
+ return result
+ });
+ else
+ result = WinJS.Promise.wrapError("InnerGroupsQuery has been disposed of");
+ return result
+ }
+ }), WrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function() {
+ MSE.Data.AugmentQuery.prototype.constructor.call(this)
+ }, {
+ _innerQuery: null, _innerGroupsQuery: null, _innerQueryChunked: true, queryId: null, acquisitionData: null, groupsAugmentation: null, dispose: function dispose() {
+ MSE.Data.AugmentQuery.prototype.dispose.call(this);
+ this.releaseInnerQuery()
+ }, createInnerQuery: function createInnerQuery() {
+ return null
+ }, createGroupsQuery: function createGroupsQuery() {
+ var result = this._innerGroupsQuery;
+ var innerQuery;
+ if (!result) {
+ if (this.allowGroupHints)
+ innerQuery = this._getInnerQuery();
+ if (innerQuery && innerQuery.getGroupsAsync) {
+ result = new MSE.Data.WrapperQuery;
+ result.resultAugmentation = WinJS.Binding.unwrap(this.groupsAugmentation);
+ result.chunked = false;
+ result._innerQuery = new MSE.Data.InnerGroupsQuery(innerQuery)
+ }
+ this._innerGroupsQuery = result
+ }
+ return result
+ }, releaseInnerQuery: function releaseInnerQuery() {
+ if (this._innerQuery && this._innerQuery.dispose) {
+ this._innerQuery.dispose();
+ this._innerQuery = null
+ }
+ if (this._innerQuery && this._innerQuery.close) {
+ this._innerQuery.close();
+ this._innerQuery = null
+ }
+ if (this._innerGroupsQuery && this._innerGroupsQuery.dispose) {
+ this._innerGroupsQuery.dispose();
+ this._innerGroupsQuery = null
+ }
+ if (this._innerGroupsQuery && this._innerGroupsQuery.close) {
+ this._innerGroupsQuery.close();
+ this._innerGroupsQuery = null
+ }
+ this._onReleaseInnerQuery()
+ }, _onReleaseInnerQuery: function _onReleaseInnerQuery(){}, _parseInnerResult: function _parseInnerResult(result) {
+ if (result)
+ try {
+ return JSON.parse(result)
+ }
+ catch(error) {
+ logJsonFailure("WrapperQuery::_parseInnerResult has failed because JSON.parse failed.", error, result);
+ throw error;
+ }
+ else
+ throw new Error("WrapperQuery._parseInnerResult failed. Result was null or empty");
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryReturn(this._innerQuery ? this._innerQuery.uri : String.empty);
+ return MSE.Data.queryStatus.processingData
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(query){}, _startInnerExecute: function _startInnerExecute() {
+ if (this.isDisposed) {
+ MSE.Data.assert(false, "Attempting to execute a disposed wrapper query.");
+ return WinJS.Promise.wrapError(new Error("Attempting to execute a disposed wrapper query."))
+ }
+ var returnPromise;
+ var innerQuery = this._getInnerQuery();
+ return this._startInnerExecuteWork(innerQuery)
+ }, _startInnerExecuteWork: function _startInnerExecuteWork(innerQuery) {
+ if (!MS.Entertainment.Data.RandomAccessChunk.is(this.currentChunk) && this._innerQueryChunked)
+ innerQuery.currentPage = this.currentChunk;
+ else
+ innerQuery.currentPage = null;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryStart(innerQuery.uri);
+ return (innerQuery.executeAsync) ? innerQuery.executeAsync() : innerQuery.execute()
+ }, _getInnerQuery: function _getInnerQuery() {
+ this._innerQuery = this._innerQuery || this.createInnerQuery();
+ this._prepareQueryForInnerExecute(this._innerQuery);
+ return this._innerQuery
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ if (this._innerQuery && this._getChunkResultSize(result))
+ return this._innerQuery.nextPage;
+ else
+ return null
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ if (this._innerQuery && this._getChunkResultSize(result))
+ return this._innerQuery.previousPage;
+ else
+ return null
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ if (this._innerQuery) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_ParseComplete(this._innerQuery.uri);
+ if (this._innerQueryChunked)
+ this.currentChunk = this._innerQuery.currentPage
+ }
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ var resultAugmentation = MSE.Data.AugmentQuery.prototype._getResultAugmentation.call(this);
+ var expandedAugmentation = null;
+ if (this.queryId) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.queryId = this.queryId
+ }
+ if (this.acquisitionData) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.acquisitionData = this.acquisitionData
+ }
+ if (resultAugmentation && expandedAugmentation) {
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyListResultAugmentation(resultAugmentation, expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "item", expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "itemsArray", expandedAugmentation)
+ }
+ return resultAugmentation
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ ServiceWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.WrapperQuery", function() {
+ MSE.Data.WrapperQuery.prototype.constructor.call(this)
+ }, {
+ _shouldAuthenticate: false, _signInHandler: null, autoEncodeUri: true, useCache: null, useIfMatchCache: null, serviceType: 0, expirationTimeSeconds: 0, resourceURI: null, parameters: null, pluralizers: null, headers: null, postData: null, requestType: null, requireResponseData: true, _authenticationHeader: null, forceLowercaseJsonProperties: false, stampChunkInformation: false, dispose: function dispose() {
+ MSE.Data.WrapperQuery.prototype.dispose.call(this);
+ this._unregisterForSignInEvents()
+ }, shouldAuthenticate: {
+ get: function() {
+ return this._shouldAuthenticate
+ }, set: function(value) {
+ if (this._shouldAuthenticate !== value) {
+ var oldValue = value;
+ this._shouldAuthenticate = value;
+ this.notify("shouldAuthenticate", value, oldValue);
+ this._unregisterForSignInEvents();
+ this._registerForSignInEvents()
+ }
+ }
+ }, endpointSupportsAuthentication: {get: function get_endpointSupportsAuthentication() {
+ return true
+ }}, addAuthenticationHeader: {get: function get_authenticate() {
+ var signedIn = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signedIn = signInService.isSignedIn || (this.useApp2UserIfAvailable && signInService.isApp2UserAvailable)
+ }
+ return (this.shouldAuthenticate && this.endpointSupportsAuthentication && signedIn)
+ }}, autoUpdateItemFactory: {get: function get_autoUpdateItemFactory() {
+ return this.stampChunkInformation
+ }}, getResourceEndpointID: function getResourceEndpointID() {
+ MSE.Data.fail("Derived classes must define this function in order for authentication to work.");
+ return null
+ }, getResourceEndpoint: function getResourceEndpoint() {
+ var endpoint = String.empty;
+ var endpointID = this.getResourceEndpointID();
+ if (endpointID)
+ endpoint = MS.Entertainment.Endpoint.load(endpointID);
+ return endpoint
+ }, createResourceURI: function createResourceURI() {
+ return this.resourceURI
+ }, createPostData: function createPostData() {
+ return WinJS.Binding.unwrap(this.postData)
+ }, createParameters: function createParameters() {
+ return WinJS.Binding.unwrap(this.parameters)
+ }, createHeaders: function createHeaders() {
+ return WinJS.Binding.unwrap(this.headers)
+ }, _createAuthenticationHeader: function _createAuthenticationHeader() {
+ return WinJS.Binding.unwrap(this._authenticationHeader)
+ }, hasAuthenticationHeader: function hasAuthenticationHeader() {
+ var header = this._createAuthenticationHeader();
+ return !!header && !!header.value
+ }, createPluralizers: function createPluralizers() {
+ return this.pluralizers
+ }, addHeader: function addHeader(key, value) {
+ if (!this.headers)
+ this.headers = {};
+ this.headers[key] = value
+ }, createInnerQuery: function createInnerQuery() {
+ return new Microsoft.Entertainment.Queries.ServiceXMLQuery
+ }, getResponseVersion: function getResponseVersion(result){}, _registerForSignInEvents: function _registerForSignInEvents() {
+ this._unregisterForSignInEvents();
+ if (this.shouldAuthenticate && this.endpointSupportsAuthentication && this.autoUpdateProperties && this.autoUpdateProperties.isSignedIn) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ this._signInHandler = WinJS.Binding.bind(signInService, {isSignedIn: function(value, oldValue) {
+ if (oldValue !== undefined)
+ this.notify("isSignedIn", value, oldValue)
+ }.bind(this)})
+ }
+ }, _unregisterForSignInEvents: function _unregisterForSignInEvents() {
+ if (this._signInHandler) {
+ this._signInHandler.cancel();
+ this._signInHandler = null
+ }
+ }, _addParameters: function _addParameters(query, parameters) {
+ var key;
+ var value;
+ if (parameters && query)
+ for (key in parameters)
+ if (parameters.hasOwnProperty(key)) {
+ value = parameters[key];
+ if (value || value === 0)
+ query.addParameter(window.encodeURIComponent(key), window.encodeURIComponent(value).replace(/%2B/gi, "+"))
+ }
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(query) {
+ var pluralizers;
+ var parameters;
+ var key;
+ var value;
+ var uri;
+ uri = this.createResourceURI();
+ query.uri = this.autoEncodeUri ? window.encodeURI(uri) : uri;
+ query.serviceType = this.serviceType;
+ pluralizers = this.createPluralizers();
+ if (pluralizers)
+ query.pluralizationRules = pluralizers;
+ this._addParameters(query, this.createParameters());
+ var headers = this.createHeaders();
+ if (headers)
+ for (key in headers)
+ if (headers.hasOwnProperty(key)) {
+ value = headers[key];
+ if (value || value === 0)
+ query.addHeader(key, value.toString())
+ }
+ var authenticationHeader = this._createAuthenticationHeader();
+ if (authenticationHeader)
+ query.addHeader(authenticationHeader.key, authenticationHeader.value.toString());
+ var postData = this.createPostData();
+ if (postData && postData.contentType && postData.data)
+ query.setPostData(postData.contentType, postData.data);
+ if (this.requestType)
+ query.requestType = this.requestType;
+ if (this.useCache !== null)
+ query.useCache = this.useCache;
+ if (this.expirationTimeSeconds !== 0)
+ query.expirationDate = new Date(Date.now() + (this.expirationTimeSeconds * 1000));
+ if (this.useIfMatchCache !== null)
+ query.useIfMatchCache = this.useIfMatchCache;
+ query.forceLowercaseJsonProperties = this.forceLowercaseJsonProperties;
+ this._registerForSignInEvents()
+ }, _getAuthHeader: function _getAuthHeader() {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ var promise = signInService.getXToken(this.getResourceEndpointID());
+ return promise
+ }, _preInnerExecute: function _preInnerExecute() {
+ var promise;
+ var signInService = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn))
+ signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ if (this.addAuthenticationHeader)
+ promise = this._getAuthHeader().then(function setAuthHeader(header) {
+ this._authenticationHeader = header
+ }.bind(this), function getAuthHeaderFailed(error) {
+ this._clearAuthentication();
+ return WinJS.Promise.wrapError(this._createError(error, "Invalid header for authenticated ServiceWrapperQuery"))
+ }.bind(this));
+ else
+ this._clearAuthentication();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.service.enableTimeTravel && !promise && signInService)
+ if (this.serviceType === MS.Entertainment.Data.ServiceWrapperQuery.ServiceTypes.json)
+ promise = signInService.signIn().then(function success() {
+ return this._getAuthHeader().then(function setAuthHeader(header) {
+ this._authenticationHeader = header
+ }.bind(this), function getAuthHeaderFailed(error) {
+ this._clearAuthentication();
+ return WinJS.Promise.wrapError(this._createError(error, "Invalid header for authenticated ServiceWrapperQuery"))
+ }.bind(this))
+ }.bind(this));
+ else
+ promise = signInService.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport), true, Microsoft.Entertainment.Util.SignInPromptType.doNotPrompt).then(function setHeader(ticket) {
+ this._authenticationHeader = {
+ key: "Authorization", value: "WLID1.0 " + ticket
+ }
+ }.bind(this), function getHeaderFailed(error) {
+ return WinJS.Promise.wrapError(this._createError(error, "Invalid header for authenticated ServiceWrapperQuery"))
+ }.bind(this));
+ return WinJS.Promise.as(promise)
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ MS.Entertainment.Data.WrapperQuery.prototype._endInnerExecute.apply(this, arguments);
+ var version = this.getResponseVersion(result);
+ if (version && this.useIfMatchCache) {
+ var mediaStore = new Microsoft.Entertainment.Platform.MediaStore;
+ mediaStore.offlineDetailProvider.setIfMatchValueWithKeyAsync(this._innerQuery.uri, version).done(function setIfMatchValueWithKeyAsync_completed(){}, function setIfMatchValueWithKeyAsync_error() {
+ MSE.Data.assert(false, "Failed to write cache version for if-match query")
+ })
+ }
+ }, _clearAuthentication: function _clearAuthentication() {
+ if (this._authenticationHeader)
+ this._authenticationHeader = {
+ key: this._authenticationHeader.key, value: String.empty
+ }
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ if (result && result.json)
+ try {
+ return JSON.parse(result.json)
+ }
+ catch(error) {
+ var uri = this._innerQuery && this._innerQuery.uri;
+ logJsonFailure("ServiceWrapperQuery::_parseInnerResult has failed because JSON.parse failed. Resource uri was \'" + uri + "\'", error, result && result.json);
+ throw error;
+ }
+ else if (this.requireResponseData)
+ throw new Error("ServiceWrapperQuery._parseInnerResult failed. Result was null or empty");
+ else
+ return WinJS.Promise.wrap({})
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ return MSE.Data.AugmentQuery.invalidPreviousChunk
+ }, _preInsertChunk: function _preInsertChunk(destination, chunk) {
+ MS.Entertainment.Data.WrapperQuery.prototype._preInsertChunk.apply(this, arguments);
+ if (this.autoUpdateItemFactory && destination && destination.setItemFactory && chunk && chunk.itemFactory)
+ destination.setItemFactory(chunk.itemFactory)
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ var resultAugmentation = MSE.Data.WrapperQuery.prototype._getResultAugmentation.call(this);
+ var expandedAugmentation = null;
+ if (this.stampChunkInformation) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.chunkInformation = this._createChunkInformation()
+ }
+ if (resultAugmentation && expandedAugmentation) {
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyListResultAugmentation(resultAugmentation, expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "item", expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "itemsArray", expandedAugmentation)
+ }
+ return resultAugmentation
+ }, _createChunkInformation: function _createChunkInformation() {
+ return this.currentChunk
+ }
+ }, {
+ ServiceTypes: {json: 1}, RequestTypes: {
+ head: 1, get: 2, post: 3, put: 4, deleteRequest: 5
+ }, isServiceWrapperQuery: function isServiceWrapperQuery(object) {
+ return MS.Entertainment.Data.ServiceWrapperQuery.prototype.isPrototypeOf(object)
+ }
+ }), LibraryWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.WrapperQuery", function() {
+ this.debugInstanceId = ++MSE.Data.DebugInstanceId;
+ this._logQueryActions("Creation");
+ MSE.Data.WrapperQuery.prototype.constructor.call(this);
+ this._currentStateChangePromise = WinJS.Promise.wrap()
+ }, {
+ hasTotalCount: true, allowReset: false, _isLive: false, _isAttached: false, _queryEventHandlers: null, _pauseCount: 0, _pausedQuery: null, _currentStateChangePromise: null, isLive: {
+ get: function get_isLive() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return this._isLive && configurationManager.shell.uiRefresh
+ }, set: function set_isLive(value) {
+ if (value !== this._isLive) {
+ if (this._isAttached) {
+ MSE.Data.assert(!value, "Cannot set a query back to live after it has been run.");
+ if (!value)
+ this.releaseInnerQuery()
+ }
+ this._isLive = value
+ }
+ }
+ }, isPaused: {get: function get_isPaused() {
+ return this._pauseCount > 0
+ }}, pause: function pause(innerQuery) {
+ if (this.isDisposed)
+ return WinJS.Promise.wrap();
+ this._pauseCount++;
+ return this._commitPause(this._innerQuery)
+ }, _commitPause: function _commitPause(innerQuery) {
+ if (this.isDisposed)
+ return WinJS.Promise.wrap();
+ var promise;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.shell.uiRefresh && innerQuery && this.isLive && this._pauseCount > 0) {
+ var queryPause = function queryPause() {
+ var paused = false;
+ if (innerQuery && innerQuery.pauseAsync && this.isLive)
+ paused = innerQuery.pauseAsync();
+ innerQuery = null;
+ return paused
+ }.bind(this);
+ if (this._pausedQuery !== innerQuery) {
+ this._pausedQuery = innerQuery;
+ promise = this._currentStateChangePromise = this._currentStateChangePromise.then(queryPause, queryPause)
+ }
+ else
+ promise = this._currentStateChangePromise
+ }
+ return WinJS.Promise.as(promise)
+ }, unpause: function unpause() {
+ if (this.isDisposed)
+ return WinJS.Promise.wrap();
+ var promise;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this._pauseCount--;
+ if (configurationManager.shell.uiRefresh && this._pausedQuery && this._pauseCount === 0 && this.isLive) {
+ var pausedQuery = this._pausedQuery;
+ this._pausedQuery = null;
+ var queryResume = function queryResume() {
+ var unpaused = false;
+ if (pausedQuery && pausedQuery.resumeAsync && this.isLive)
+ unpaused = pausedQuery.resumeAsync();
+ pausedQuery = null;
+ return unpaused
+ }.bind(this);
+ promise = this._currentStateChangePromise = this._currentStateChangePromise.then(queryResume, queryResume)
+ }
+ if (this._pauseCount < 0)
+ this._pauseCount = 0;
+ return WinJS.Promise.as(promise)
+ }, forceLiveRefresh: function forceLiveRefresh() {
+ var refreshPromise;
+ if (this.isLive && this._innerQuery && this._innerQuery.refreshAsync)
+ refreshPromise = this._innerQuery.refreshAsync();
+ return WinJS.Promise.as(refreshPromise)
+ }, loadChunk: function loadChunk(startIndex, countBefore, countAfter, destinationList) {
+ var endIndex = startIndex;
+ var originalStartIndex = startIndex;
+ destinationList = destinationList || true;
+ if (isNaN(startIndex))
+ throw new Error("loadChunk failed. startIndex is not a number: " + startIndex);
+ else if (startIndex < 0)
+ throw new Error("loadChunk failed. startIndex is out of range: " + startIndex);
+ else if (this.totalCount < 0)
+ throw new Error("loadChunk failed. totalCount is unknown, thus random access is not possible");
+ countBefore = (isNaN(countBefore) || countBefore < 0) ? 0 : countBefore;
+ countAfter = (isNaN(countAfter) || countAfter < 0) ? 0 : countAfter;
+ endIndex = startIndex + countAfter;
+ startIndex = Math.max(0, startIndex - countBefore);
+ this.currentChunk = new MS.Entertainment.Data.RandomAccessChunk(startIndex, endIndex - startIndex + 1);
+ this.nextChunk = MS.Entertainment.Data.AugmentQuery.invalidNextChunk;
+ this.previousChunk = MS.Entertainment.Data.AugmentQuery.invalidPreviousChunk;
+ return this._execute(destinationList).then(function(result) {
+ var list = this._getChunkDestination(this.lastChunkedResult);
+ list = (list) ? list.source : [];
+ return {
+ items: list, offset: originalStartIndex - startIndex, totalCount: this.totalCount
+ }
+ }.bind(this), function error() {
+ return {
+ items: [], offset: 0, error: true, totalCount: this.totalCount
+ }
+ }.bind(this))
+ }, execute: function execute(cookie) {
+ this.releaseInnerQuery();
+ return MSE.Data.WrapperQuery.prototype.execute.apply(this, arguments)
+ }, _onReleaseInnerQuery: function _onReleaseInnerQuery() {
+ if (this._pausedQuery) {
+ this._pauseCount = 0;
+ this._pausedQuery = null
+ }
+ this._isAttached = false;
+ this._cancelQueryEventHandlers()
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ if (result) {
+ var jsonString;
+ if (typeof result === "string")
+ jsonString = result;
+ else if (typeof result === "object" && result.json)
+ jsonString = result.json;
+ try {
+ return JSON.parse(jsonString)
+ }
+ catch(error) {
+ logJsonFailure("LibraryWrapperQuery::_parseInnerResult has failed because JSON.parse failed.", error, jsonString);
+ throw error;
+ }
+ }
+ throw new Error("LibraryWrapperQuery._parseInnerResult failed.");
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(innerQuery) {
+ if (MS.Entertainment.Data.RandomAccessChunk.is(this.currentChunk)) {
+ innerQuery.pageSize = this.currentChunk.count;
+ innerQuery.setCursorPosition(this.currentChunk.startIndex)
+ }
+ else {
+ innerQuery.pageSize = this.chunkSize;
+ innerQuery.setCursorPosition(0)
+ }
+ innerQuery.groupsEnabled = this.allowGroupHints;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.shell.uiRefresh && !this._isAttached) {
+ this._cancelQueryEventHandlers();
+ if (this.isLive)
+ this._queryEventHandlers = MS.Entertainment.Utilities.addEvents(innerQuery, {querychanged: this._resultChanged.bind(this)});
+ else if (innerQuery.dispose)
+ innerQuery.dispose();
+ else if (innerQuery.close)
+ innerQuery.close();
+ this._isAttached = true
+ }
+ }, _startInnerExecuteWork: function _startInnerExecuteWork(innerQuery) {
+ var promise = MSE.Data.WrapperQuery.prototype._startInnerExecuteWork.call(this, innerQuery);
+ if (this.isPaused)
+ this._commitPause(innerQuery);
+ return promise
+ }, _cancelQueryEventHandlers: function _cancelQueryEventHandlers() {
+ if (this._queryEventHandlers) {
+ this._queryEventHandlers.cancel();
+ this._queryEventHandlers = null
+ }
+ }, _resultChanged: function _resultChanged(args) {
+ if (args && args.target !== this._innerQuery)
+ return;
+ MSE.Data.assert(args && args.json, "Invalid args given to _resultsChanged");
+ var result;
+ var changes;
+ var maxChanges = 300;
+ var totalCount = NaN;
+ if (this.chunkDestination) {
+ try {
+ if (args)
+ result = JSON.parse(args.json);
+ else
+ result = {}
+ }
+ catch(error) {
+ logJsonFailure("LibraryWrapperQuery::_resultsChanged has failed because JSON.parse failed.", error, args && args.json);
+ result = {}
+ }
+ if (result.TotalCount !== null && !isNaN(result.TotalCount))
+ totalCount = this.totalCount = result.TotalCount;
+ changes = result.changes || [];
+ if (changes.length > maxChanges && this.allowReset)
+ this.dispatchEvent(MS.Entertainment.Data.chunkerEvents.reset, {
+ sender: this, totalCount: totalCount
+ });
+ else
+ this.dispatchEvent(MS.Entertainment.Data.chunkerEvents.batchChange, {
+ sender: this, changes: changes, totalCount: totalCount
+ })
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {JSonWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function() {
+ MSE.Data.AugmentQuery.prototype.constructor.call(this)
+ }, {
+ _innerQuery: null, headers: {}, createResourceUri: function createResourceUri() {
+ throw new Error("createResourceUri is not defined");
+ }, _parseInnerResult: function _parseInnerResult(result) {
+ if (result && result.response)
+ try {
+ return JSON.parse(result.response)
+ }
+ catch(error) {
+ logJsonFailure("JSonWrapperQuery::_parseInnerResult has failed because JSON.parse failed.", error, result && result.response);
+ throw error;
+ }
+ else
+ throw new Error("response was null or empty. status code: " + (result ? result.status : "null"));
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryReturn(this.currentChunk);
+ return MSE.Data.queryStatus.processingData
+ }, _startInnerExecute: function _startInnerExecute() {
+ var that = this;
+ var returnPromise;
+ if (!this.currentChunk)
+ this.currentChunk = this.createResourceUri();
+ if (this.currentChunk)
+ returnPromise = that._xmlHttpRequest({
+ url: this.currentChunk, async: true, headers: WinJS.Binding.unwrap(this.headers)
+ });
+ else
+ returnPromise = WinJS.Promise.WrapError(this);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_QueryStart(this.currentChunk);
+ return returnPromise
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ if (result)
+ return this._createUriFromChunkKey(result.nextPage);
+ else
+ return null
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ if (result)
+ return this._createUriFromChunkKey(result.previousPage);
+ else
+ return null
+ }, _createUriFromChunkKey: function _createUriFromChunkKey(chunkKey) {
+ var uri = null;
+ var baseUrl = this.createResourceUri();
+ var expression = /\?/;
+ if (expression.test(baseUrl))
+ baseUrl = baseUrl + "&";
+ else
+ baseUrl = baseUrl + "?";
+ if (chunkKey)
+ uri = baseUrl + chunkKey;
+ return uri
+ }, _xmlHttpRequest: function _xmlHttpRequest(values) {
+ return MSE.ServiceLocator.getService(MSE.Services.xhr).execute(values)
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceServiceQuery_ParseComplete(this.currentChunk)
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Data", {EDSWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.ServiceWrapperQuery", function edsServiceWrapperQuery() {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype.constructor.call(this);
+ this.shouldAuthenticate = true
+ }, {
+ serviceType: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.Data.ServiceWrapperQuery.ServiceTypes.json
+ }), requestFields: null, targetDeviceType: null, forceSecureEndpoint: false, useApp2UserIfAvailable: false, enabledImpressionGuid: false, impressionGuid: null, relevancyTrackingContent: null, includeContentRestrictionHeader: false, _requestFieldsToken: null, _anonymousClientIdHeader: null, _impressionGuids: null, _retryCount: 0, dispose: function dispose() {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype.dispose.call(this);
+ if (this._impressionGuids)
+ this._impressionGuids.splice(0)
+ }, autoUpdateOnSignIn: {
+ get: function() {
+ return this.autoUpdateProperties ? !!this.autoUpdateProperties.isSignedIn : false
+ }, set: function(value) {
+ this.autoUpdateProperties = this.autoUpdateProperties || {};
+ this.autoUpdateProperties.isSignedIn = value
+ }
+ }, autoUpdateItemFactory: {get: function get_autoUpdateItemFactory() {
+ return this.stampChunkInformation || this.enabledImpressionGuid
+ }}, endpointSupportsAuthentication: {get: function get_endpointSupportsAuthentication() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var secureEDSEndpointsEnabled = this.forceSecureEndpoint || featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.secureEDSEndpointsEnabled);
+ if (!MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps)
+ MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps = {};
+ var authenticatedEndpointID = this.getAuthenticatedResourceEndpointID();
+ if (!MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps[authenticatedEndpointID])
+ MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps[authenticatedEndpointID] = /^https:\/\//i.test(MS.Entertainment.Endpoint.load(authenticatedEndpointID));
+ return secureEDSEndpointsEnabled && MS.Entertainment.Data.EDSWrapperQuery._cachedIsHttps[authenticatedEndpointID]
+ }}, useAuthenticatedEndpoint: {get: function get_useAuthenticatedEndpoint() {
+ var useAuthenticatedEndpoint = false;
+ var signedInOrOffline = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signedInOrOffline = signInService.isSignedIn || (this.useApp2UserIfAvailable && signInService.isApp2UserAvailable)
+ }
+ if (!signedInOrOffline && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState) && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.networkStatus)) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var networkStatus = uiStateService.networkStatus;
+ signedInOrOffline = networkStatus !== MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown && networkStatus !== MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted && networkStatus !== MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled
+ }
+ return signedInOrOffline && this.endpointSupportsAuthentication && this.shouldAuthenticate
+ }}, addAuthenticationHeader: {get: function get_authenticate() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var signedIn = false;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signedIn = signInService.isSignedIn || (this.useApp2UserIfAvailable && signInService.isApp2UserAvailable)
+ }
+ return configurationManager.service.enableTimeTravel || (this.useAuthenticatedEndpoint && signedIn)
+ }}, edsHeaders: null, edsParameters: null, createRequestFields: function createRequestFields() {
+ return WinJS.Binding.unwrap(this.requestFields)
+ }, createTargetDeviceType: function createTargetDeviceType() {
+ return this.targetDeviceType
+ }, createEDSHeaders: function createEDSHeaders() {
+ var edsHeaders = WinJS.Binding.unwrap(this.edsHeaders);
+ if (!edsHeaders)
+ edsHeaders = {
+ Accept: "application/json", "x-xbl-contract-version": "3.2", "x-xbl-client-type": MS.Entertainment.Data.EDSWrapperQuery.clientType, "x-xbl-device-type": this.getHeaderDeviceType(), "x-xbl-client-version": MS.Entertainment.Data.EDSWrapperQuery.currentVersion, "x-xbl-build-version": "current"
+ };
+ if (this.includeContentRestrictionHeader && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionHeaderName = "x-xbl-contentRestrictions";
+ var contentRestrictionHeaderValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService).getContentRestrictionHeader();
+ if (edsHeaders[contentRestrictionHeaderName] && !contentRestrictionHeaderValue)
+ delete edsHeaders[contentRestrictionHeaderName];
+ else if (contentRestrictionHeaderValue)
+ edsHeaders[contentRestrictionHeaderName] = contentRestrictionHeaderValue
+ }
+ return edsHeaders
+ }, createEDSParameters: function createEDSParameters() {
+ var edsParameters = WinJS.Binding.unwrap(this.edsParameters);
+ if (this.includeContentRestrictionHeader && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionParameterName = "contentRestrictions";
+ var contentRestrictionParameterValue = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService).getContentRestrictionUrlParameter();
+ edsParameters = edsParameters || {};
+ if (edsParameters[contentRestrictionParameterName] && !contentRestrictionParameterValue)
+ delete edsParameters[contentRestrictionParameterName];
+ else if (contentRestrictionParameterValue)
+ edsParameters[contentRestrictionParameterName] = contentRestrictionParameterValue
+ }
+ return edsParameters
+ }, getHeaderDeviceType: function getHeaderDeviceType() {
+ return MS.Entertainment.Utilities.defaultEdsHeaderDeviceTypeFromApp
+ }, getAuthenticatedResourceEndpointID: function getAuthenticatedResourceEndpointID() {
+ return MS.Entertainment.Endpoint.id.seid_EDSServiceAuth
+ }, getResourceEndpointID: function getResourceEndpointID() {
+ var endpointID = null;
+ if (this.useAuthenticatedEndpoint)
+ endpointID = MS.Entertainment.Endpoint.id.seid_EDSServiceAuth;
+ else
+ endpointID = MS.Entertainment.Endpoint.id.seid_EDSServiceAnon;
+ return endpointID
+ }, getResourceEndpoint: function getResourceEndpoint(edsEndpointType) {
+ var endpoint = MS.Entertainment.Data.ServiceWrapperQuery.prototype.getResourceEndpoint.call(this);
+ if (endpoint && edsEndpointType)
+ endpoint = endpoint + "/" + edsEndpointType;
+ return endpoint
+ }, _clearAnonymousClientIdHeader: function _clearAnonymousClientIdHeader() {
+ if (this._anonymousClientIdHeader)
+ this._anonymousClientIdHeader = {
+ key: MS.Entertainment.Data.EDSWrapperQuery.clientIdHeader, value: String.empty
+ }
+ }, _createAnonymousClientIdHeader: function _createAnonymousClientIdHeader() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var visitorId = configurationManager.telemetry.visitorId;
+ if (visitorId)
+ this._anonymousClientIdHeader = {
+ key: MS.Entertainment.Data.EDSWrapperQuery.clientIdHeader, value: visitorId
+ };
+ else
+ this._clearAnonymousClientIdHeader()
+ }, _startExecute: function _startExecute() {
+ this._retryCount = 0
+ }, _preInnerExecute: function _preInnerExecute() {
+ var basePromise = MS.Entertainment.Data.ServiceWrapperQuery.prototype._preInnerExecute.apply(this, arguments);
+ var returnPromise = basePromise;
+ if (this.includeContentRestrictionHeader && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.contentRestrictionService)) {
+ var contentRestrictionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.contentRestrictionService);
+ returnPromise = returnPromise.then(function basePromiseCompleted() {
+ return contentRestrictionService.getBrowsePolicyUpdatePromise()
+ })
+ }
+ this._requestFieldsToken = null;
+ var fieldString;
+ var requestFields = this.createRequestFields();
+ MS.Entertainment.Data.assert(Array.isArray(requestFields), "createRequestFields() did not return a valid set of request fields. We must have a valid set of request fields before executing an EDS query. If it is known that the query doesn't except a fieldsToken, createRequestFields() should return an empty array.");
+ if (Array.isArray(requestFields) && requestFields.length) {
+ fieldString = requestFields.join(".");
+ returnPromise = returnPromise.then(function fetchFields() {
+ return MS.Entertainment.Data.EDSWrapperQuery.fetchRequestFields(fieldString).then(function setRequestFields(requestFieldsToken) {
+ this._requestFieldsToken = requestFieldsToken
+ }.bind(this))
+ }.bind(this))
+ }
+ return returnPromise
+ }, _prepareQueryForInnerExecute: function _prepareQueryForInnerExecute(query) {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype._prepareQueryForInnerExecute.apply(this, arguments);
+ var value;
+ if (!isNaN(this.chunkSize) && this.chunkSize > 0)
+ query.addParameter(window.encodeURIComponent(MS.Entertainment.Data.EDSWrapperQuery.maxItemsParameter), window.encodeURIComponent(this.chunkSize));
+ if (this._requestFieldsToken)
+ query.addParameter(window.encodeURIComponent(MS.Entertainment.Data.EDSWrapperQuery.fieldsParameter), window.encodeURIComponent(this._requestFieldsToken));
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.service.enableTimeTravel)
+ query.addParameter(window.encodeURIComponent(MS.Entertainment.Data.EDSWrapperQuery.timeTravelInstantParameter), window.encodeURIComponent(configurationManager.service.timeTravelStartDate));
+ var targetDeviceType = this.createTargetDeviceType();
+ if (targetDeviceType)
+ query.addParameter(MS.Entertainment.Data.EDSWrapperQuery.targetDevicesParameter, targetDeviceType);
+ var headers = this.createEDSHeaders();
+ if (headers)
+ for (var key in headers)
+ if (headers.hasOwnProperty(key)) {
+ value = headers[key];
+ if (value || value === 0)
+ query.addHeader(key, value.toString())
+ }
+ this._addParameters(query, this.createEDSParameters());
+ if (this.hasAuthenticationHeader())
+ this._clearAnonymousClientIdHeader();
+ else
+ this._createAnonymousClientIdHeader();
+ if (this._anonymousClientIdHeader)
+ query.addHeader(this._anonymousClientIdHeader.key, this._anonymousClientIdHeader.value.toString());
+ if (this.impressionGuid) {
+ query.addHeader(MS.Entertainment.Data.EDSWrapperQuery.impressionGuidHeader, this.impressionGuid);
+ if (this.relevancyTrackingContent && this.relevancyTrackingContent.kValue && this.relevancyTrackingContent.kValueNamespace) {
+ query.addHeader(MS.Entertainment.Data.EDSWrapperQuery.kValueHeader, this.relevancyTrackingContent.kValue);
+ query.addHeader(MS.Entertainment.Data.EDSWrapperQuery.kValueNamespaceHeader, this.relevancyTrackingContent.kValueNamespace)
+ }
+ }
+ else
+ query.removeHeader(MS.Entertainment.Data.EDSWrapperQuery.impressionGuidHeader)
+ }, _getResultAugmentation: function _getResultAugmentation() {
+ var resultAugmentation = MSE.Data.ServiceWrapperQuery.prototype._getResultAugmentation.call(this);
+ var expandedAugmentation = null;
+ if (this.enabledImpressionGuid)
+ expandedAugmentation = {impressionGuid: this._createNextImpressionGuidCallback()};
+ if (this.acquisitionData) {
+ expandedAugmentation = expandedAugmentation || {};
+ expandedAugmentation.acquisitionData = this.acquisitionData
+ }
+ if (resultAugmentation && expandedAugmentation) {
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyListResultAugmentation(resultAugmentation, expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "item", expandedAugmentation);
+ resultAugmentation = MS.Entertainment.Data.AugmentQuery.modifyResultAugmentation(resultAugmentation, "itemsArray", expandedAugmentation)
+ }
+ return resultAugmentation
+ }, _initializeImpressionGuids: function _initializeImpressionGuids() {
+ if (!this._disposed && !this._impressionGuids && this.enabledImpressionGuid)
+ this._impressionGuids = []
+ }, _createNextImpressionGuidCallback: function _createNextImpressionGuidCallback() {
+ this._initializeImpressionGuids();
+ var impressionGuids = this._impressionGuids;
+ var index = impressionGuids.length;
+ var propertyValue = MS.Entertainment.Data.Property.convert(String.empty, function getImpressionGuid() {
+ return impressionGuids ? impressionGuids[index] : null
+ });
+ propertyValue.override = true;
+ return propertyValue
+ }, _retryInnerExecute: function _retryInnerExecute(result, error) {
+ var retry = false;
+ if (result && result.responseInfo === MS.Entertainment.Data.EDSWrapperQuery.responseInfo.tryAgain && this._retryCount < MS.Entertainment.Data.EDSWrapperQuery._maxRetries) {
+ this._retryCount++;
+ retry = true
+ }
+ return retry
+ }, _endInnerExecute: function _endInnerExecute(result) {
+ MS.Entertainment.Data.ServiceWrapperQuery.prototype._endInnerExecute.apply(this, arguments);
+ this._initializeImpressionGuids();
+ if (this._impressionGuids)
+ this._impressionGuids.push(result ? result.impressionGuid : null)
+ }
+ }, {
+ requestFieldsNotNeeded: [], _cachedIsHttps: null, _cachedFieldTokens: {}, _maxRetries: 3, _currentVersion: null, clientType: {get: function get_clientType() {
+ return "X13"
+ }}, currentVersion: {get: function get_currentVersion() {
+ if (!MS.Entertainment.Data.EDSWrapperQuery._currentVersion) {
+ var currentPackage = Windows.ApplicationModel.Package.current;
+ var currentVersion = currentPackage && currentPackage.id && currentPackage.id.version;
+ if (currentVersion)
+ MS.Entertainment.Data.EDSWrapperQuery._currentVersion = currentVersion.major + "." + currentVersion.minor + "." + currentVersion.build + "." + currentVersion.revision
+ }
+ return MS.Entertainment.Data.EDSWrapperQuery._currentVersion
+ }}, fetchRequestFields: function fetchRequestFields(fieldString) {
+ var returnPromise = null;
+ if (MS.Entertainment.Data.EDSWrapperQuery._cachedFieldTokens[fieldString])
+ returnPromise = WinJS.Promise.as(MS.Entertainment.Data.EDSWrapperQuery._cachedFieldTokens[fieldString]);
+ else {
+ var query = new MS.Entertainment.Data.EDSFieldQuery;
+ query.fields = fieldString;
+ returnPromise = query.execute().then(function cacheQueryResult(completedQuery) {
+ MS.Entertainment.Data.EDSWrapperQuery._cachedFieldTokens[fieldString] = completedQuery.result.fields;
+ return completedQuery.result.fields
+ })
+ }
+ return returnPromise
+ }, maxItemsParameter: "maxItems", fieldsParameter: "fields", targetDevicesParameter: "targetDevices", timeTravelInstantParameter: "currentTime", clientIdHeader: "x-fd-client", impressionGuidHeader: "x-xbl-ig", kValueHeader: "x-xbl-kvalue", kValueNamespaceHeader: "x-xbl-kvalue-namespace", responseInfo: {tryAgain: "TryAgain"}
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Data", {EDSFieldQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.EDSWrapperQuery", function edsFieldQuery() {
+ MS.Entertainment.Data.EDSWrapperQuery.prototype.constructor.call(this)
+ }, {
+ fields: null, requestFields: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.Data.EDSWrapperQuery.requestFieldsNotNeeded
+ }), chunkSize: 0, createResourceURI: function() {
+ return this.getResourceEndpoint(MS.Entertainment.Data.Query.edsEndpointType.fields)
+ }, createParameters: function createParameters() {
+ return {desired: this.fields}
+ }, resultAugmentation: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.Data.define(null, {fields: MS.Entertainment.Data.Property.alias("Fields", null)})
+ })
+ })});
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ BrowseDetailQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AggregateQuery", function browseDetailQuery() {
+ MS.Entertainment.Data.AggregateQuery.prototype.constructor.apply(this, arguments);
+ this.queries.length = 2
+ }, {
+ browseConstructor: null, detailConstructor: null, executeSequentially: {
+ get: function() {
+ var sequentially = true;
+ if (this.detail && MS.Entertainment.Data.Query && MS.Entertainment.Data.Query.edsIdType && (!this.detail.idType || this.detail.idType === MS.Entertainment.Data.Query.edsIdType.canonical))
+ sequentially = false;
+ return sequentially
+ }, set: function(value) {
+ MSE.Data.fail("Shouldn't set executeSequentially on a BrowseDetailQuery.")
+ }
+ }, chunked: {
+ get: function() {
+ return false
+ }, set: function(value) {
+ MSE.Data.fail("Shouldn't set chunked on a BrowseDetailQuery.")
+ }
+ }, browse: {get: function() {
+ if (!this.browseConstructor)
+ return null;
+ if (!this.queries[1])
+ this.queries[1] = new this.browseConstructor;
+ return this.queries[1]
+ }}, detail: {get: function() {
+ if (!this.detailConstructor)
+ return null;
+ if (!this.queries[0])
+ this.queries[0] = new this.detailConstructor;
+ return this.queries[0]
+ }}, impressionGuid: {
+ get: function getImpressionGuid() {
+ return this.browse ? this.browse.impressionGuid : null
+ }, set: function setImpressionGuid(value) {
+ if (this.browse && "impressionGuid" in this.browse)
+ this.browse.impressionGuid = value;
+ if (this.detail && "impressionGuid" in this.detail)
+ this.detail.impressionGuid = value
+ }
+ }, relevancyTrackingContent: {
+ get: function getRelevancyTrackingContent() {
+ return this.detail ? this.detail.relevancyTrackingContent : null
+ }, set: function setRelevancyTrackingContent(value) {
+ if (this.detail && "relevancyTrackingContent" in this.detail)
+ this.detail.relevancyTrackingContent = value
+ }
+ }, _preInnerExecute: function _preInnerExecute() {
+ var browseQuery = this.browse;
+ var detailsQuery = this.detail;
+ return WinJS.Promise.as()
+ }, _handleIntermediateResult: function _handleIntermediateResult(sourceIndex, sourceResult) {
+ if (sourceIndex === 0 && sourceResult.item && (sourceResult.item.canonicalId || sourceResult.item.serviceId) && this.browse) {
+ this.browse.impressionGuid = sourceResult.item.impressionGuid;
+ this.browse.id = sourceResult.item.canonicalId || sourceResult.item.serviceId;
+ this.browse.idType = sourceResult.item.canonicalId ? MS.Entertainment.Data.Query.edsIdType.canonical : MS.Entertainment.Data.Query.edsIdType.zuneCatalog
+ }
+ }
+ }, {mixAugmentation: function mixAugmentation(browseAugmentation, detailAugmentation) {
+ var augmentations = {};
+ augmentations["source[0]"] = detailAugmentation;
+ augmentations["source[1]"] = browseAugmentation;
+ return MS.Entertainment.Data.mix(augmentations)
+ }}), AugmentationWrapperQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.MainQuery", function AugmentationWrapperQuery(query) {
+ MSE.Data.MainQuery.prototype.constructor.apply(this, arguments);
+ this.query = query
+ }, {
+ _query: null, _queryNotify: null, _queryEvents: null, autoDisposeQuery: true, query: {
+ get: function() {
+ return this._query
+ }, set: function(value) {
+ if (this.value !== this._query) {
+ if (this._query) {
+ this._query.notify = this._queryNotify;
+ this._queryNotify = null
+ }
+ if (this._queryEvents) {
+ this._queryEvents.cancel();
+ this._queryEvents = null
+ }
+ this._query = value;
+ if (this._query) {
+ this._queryNotify = this._query.notify;
+ this._query.notify = this._notifyProxy.bind(this);
+ this._queryEvents = MS.Entertainment.Utilities.addEvents(this._query, {resultChanged: this._queryResultChanged.bind(this)})
+ }
+ }
+ }
+ }, clearResultOnFailure: {
+ get: function() {
+ return this.query ? this.query.clearResultOnFailure : false
+ }, set: function(value) {
+ if (this.query)
+ this.query.clearResultOnFailure = value
+ }
+ }, chunkDestination: {
+ get: function get_chunkDesination() {
+ return this.query ? this.query.chunkDestination : null
+ }, set: function set_chunkDesination(value) {
+ if (this.query)
+ this.query.chunkDestination = value
+ }
+ }, enabled: {
+ get: function() {
+ return this.query ? this.query.enabled : false
+ }, set: function(value) {
+ if (this.query)
+ this.query.enabled = value
+ }
+ }, status: {
+ get: function() {
+ return this.query ? this.query.status : MSE.Data.queryStatus.idle
+ }, set: function(value) {
+ if (this.query)
+ this.query.status = value
+ }
+ }, cookie: {
+ get: function() {
+ return this.query ? this.query.cookie : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.cookie = value
+ }
+ }, errorCode: {
+ get: function() {
+ return this.query ? this.query.errorCode : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.errorCode = value
+ }
+ }, errorObject: {
+ get: function() {
+ return this.query ? this.query.errorObject : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.errorObject = value
+ }
+ }, result: {
+ get: function() {
+ return this.query ? this.query.result : null
+ }, set: function(value) {
+ if (this.query && this.query.result)
+ this.query.result = value
+ }
+ }, totalCount: {
+ get: function() {
+ return this.query ? this.query.totalCount : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.totalCount = value
+ }
+ }, impressionGuid: {
+ get: function getImpressionGuid() {
+ return this.query ? this.query.impressionGuid : null
+ }, set: function setImpressionGuid(value) {
+ if (this.query && "impressionGuid" in this.query)
+ this.query.impressionGuid = value
+ }
+ }, acquisitionData: {
+ get: function() {
+ return this.query ? this.query.acquisitionData : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.acquisitionData = value
+ }
+ }, lastChunkedResult: {
+ get: function() {
+ return this.query ? this.query.lastChunkedResult : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.lastChunkedResult = value
+ }
+ }, resultFactory: {
+ get: function() {
+ return this.query ? this.query.resultFactory : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.resultFactory = value
+ }
+ }, resultAugmentation: {
+ get: function() {
+ return this.query ? this.query.resultAugmentation : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.resultAugmentation = value
+ }
+ }, aggregateChunks: {
+ get: function() {
+ return this.query ? this.query.aggregateChunks : false
+ }, set: function(value) {
+ if (this.query)
+ this.query.aggregateChunks = value
+ }
+ }, chunked: {
+ get: function() {
+ return this.query ? this.query.chunked : false
+ }, set: function(value) {
+ if (this.query)
+ this.query.chunked = value
+ }
+ }, chunkSize: {
+ get: function() {
+ return this.query ? this.query.chunkSize : 0
+ }, set: function(value) {
+ if (this.query)
+ this.query.chunkSize = value
+ }
+ }, currentChunk: {
+ get: function() {
+ return this.query ? this.query.currentChunk : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.currentChunk = value
+ }
+ }, nextChunk: {
+ get: function() {
+ return this.query ? this.query.nextChunk : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.nextChunk = value
+ }
+ }, previousChunk: {
+ get: function() {
+ return this.query ? this.query.previousChunk : null
+ }, set: function(value) {
+ if (this.query)
+ this.query.previousChunk = value
+ }
+ }, hasNextChunk: {get: function() {
+ return this.query ? this.query.hasNextChunk : null
+ }}, hasPreviousChunk: {get: function() {
+ return this.query ? this.query.hasPreviousChunk : null
+ }}, isLoadingFromStart: {get: function() {
+ return this.query ? this.query.isLoadingFromStart : null
+ }}, isDisposed: {get: function() {
+ return this.query ? this.query.isDisposed : false
+ }}, dispose: function dispose() {
+ if (this.query && this.autoDisposeQuery) {
+ this.query.dispose();
+ this.query = null
+ }
+ if (this._queryEvents) {
+ this._queryEvents.cancel();
+ this._queryEvents = null
+ }
+ }, execute: function execute(cookie) {
+ var result;
+ if (this.query)
+ result = this.query.execute(cookie);
+ else
+ result = WinJS.Promise.wrapError(new Error("Invalid state for executing. The query property was not set to a valid value."));
+ return result
+ }, loadPreviousChunk: function loadPreviousChunk() {
+ var result;
+ if (this.query)
+ result = this.query.loadPreviousChunk();
+ else
+ result = WinJS.Promise.wrapError(new Error("Invalid state for loading previous chunk. The query property was not set to a valid value."));
+ return result
+ }, loadNextChunk: function loadNextChunk() {
+ var result;
+ if (this.query)
+ result = this.query.loadNextChunk();
+ else
+ result = WinJS.Promise.wrapError(new Error("Invalid state for loading next chunk. The query property was not set to a valid value."));
+ return result
+ }, isValidChunk: function isValidChunk(chunk) {
+ var result;
+ if (this.query)
+ result = this.query.isValidChunk(chunk);
+ else
+ result = false;
+ return result
+ }, _notifyProxy: function _notifyProxy(name, value, oldValue) {
+ if (this._queryNotify && this.query)
+ this._queryNotify.apply(this.query, arguments);
+ this.notify(name, value, oldValue)
+ }, _queryResultChanged: function _queryResultChanged(args) {
+ if (args && args.detail)
+ this.dispatchEvent(MS.Entertainment.Data.MainQuery.events.resultChanged, {
+ sender: this, result: args.detail.result, totalCount: args.detail.totalCount, error: args.detail.error
+ })
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {
+ DebugInstanceId: 0, PlaybackQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentationWrapperQuery", function PlaybackQuery(query) {
+ MSE.Data.AugmentationWrapperQuery.prototype.constructor.call(this, query);
+ this.debugInstanceId = ++MS.Entertainment.Data.DebugInstanceId;
+ this._logQueryActions("Creation");
+ query.debugInstanceId = this.debugInstanceId
+ }, {
+ _playbackSessionBindings: null, _hasStarted: false, _playbackOptions: null, _onLastTrackPromise: null, aggregateChunks: {
+ get: function() {
+ return false
+ }, set: function(value){}
+ }, chunked: {
+ get: function() {
+ return false
+ }, set: function(value){}
+ }, dispose: function dispose() {
+ if (this._onLastTrackPromise) {
+ this._onLastTrackPromise.cancel();
+ this._onLastTrackPromise = null
+ }
+ MS.Entertainment.Platform.Playback.Etw.traceString("Disposing PlaybackQuery id=" + this.debugInstanceId + ":" + (this.query ? this.query.id : "null"));
+ MSE.Data.AugmentationWrapperQuery.prototype.dispose.apply(this);
+ this._unbindPrimaryPlaybackSession();
+ this._playbackOptions = null
+ }, execute: function execute(cookie) {
+ if (this.isDisposed)
+ return;
+ this._hasStarted = false;
+ this._playbackOptions = this._getPlaybackOptions();
+ this._prepareInnerQuery();
+ var result = MSE.Data.AugmentationWrapperQuery.prototype.execute.call(this, cookie);
+ return result.then(function executeCompleted(promiseResult) {
+ this._bindPrimaryPlaybackSession();
+ return promiseResult
+ }.bind(this))
+ }, _loadNextChunk: function _loadNextChunk() {
+ if (this.isDisposed)
+ return WinJS.Promise.as();
+ this._prepareInnerQuery();
+ var result = MSE.Data.AugmentationWrapperQuery.prototype.loadNextChunk.call(this);
+ return result.then(function(promiseResult) {
+ var list = this._getChunkDestination();
+ var options = this._getPlaybackOptions();
+ if (list && !this.isDisposed && this._playbackOptions.smartDJSeed === options.smartDJSeed)
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(list, this._playbackOptions);
+ else if (!this.isDisposed)
+ this.dispose();
+ return promiseResult
+ }.bind(this))
+ }, _bindPrimaryPlaybackSession: function _bindPrimaryPlaybackSession() {
+ if (this._playbackSessionBindings || this.isDisposed)
+ return;
+ var sessionId = MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionManager && sessionManager.primarySession && sessionManager.primarySession.sessionId === sessionId) {
+ this._playbackSessionBindings = WinJS.Binding.bind(sessionManager.primarySession, {
+ currentTransportState: this._onCurrentTransportStateChanged.bind(this), mediaCollection: this._onMediaCollectionChanged.bind(this)
+ });
+ this._sessionEventHandlers = MS.Entertainment.Utilities.addEvents(sessionManager.primarySession, {
+ sessionStateChanged: this._onCurrentSessionStateChanged.bind(this), lastTrackPlayingChanged: this._onLastTrackPlayingChanged.bind(this)
+ })
+ }
+ }, _unbindPrimaryPlaybackSession: function _unbindPrimaryPlaybackSession() {
+ if (this._playbackSessionBindings) {
+ this._playbackSessionBindings.cancel();
+ this._playbackSessionBindings = null
+ }
+ if (this._sessionEventHandlers) {
+ this._sessionEventHandlers.cancel();
+ this._sessionEventHandlers = null
+ }
+ }, _onMediaCollectionChanged: function _onMediaCollectionChanged(newValue) {
+ if (this._playbackSessionBindings && this._hasStarted && newValue)
+ this.dispose()
+ }, _onCurrentTransportStateChanged: function _onCurrentTransportStateChanged(newValue) {
+ if (this._playbackSessionBindings && !this._hasStarted && newValue !== MS.Entertainment.Platform.Playback.TransportState.starting) {
+ this._hasStarted = newValue !== MS.Entertainment.Platform.Playback.TransportState.stopped;
+ if (this._hasStarted)
+ this._logQueryActions("Started")
+ }
+ }, _onLastTrack: function onLastTrack() {
+ var pagedPromise = WinJS.Promise.as();
+ if (this.isDisposed || !this._playbackSessionBindings)
+ return pagedPromise;
+ var sessionManager = this._getValidSessionManager();
+ if (sessionManager) {
+ var networkReleaseHandle = null;
+ pagedPromise = sessionManager.requestNetworkAndDelay("PlaybackQuery").then(function onNetworkAcquired(result) {
+ if (result) {
+ networkReleaseHandle = result;
+ return this._loadNextChunk()
+ }
+ }.bind(this)).then(null, function ignoreError(){}).then(function onLoadComplete() {
+ if (networkReleaseHandle)
+ networkReleaseHandle.release();
+ this._onLastTrackPromise = null
+ }.bind(this))
+ }
+ return pagedPromise
+ }, _pageMoreData: function _pageMoreData() {
+ if (this._onLastTrackPromise)
+ this._onLastTrackPromise.cancel();
+ this._onLastTrackPromise = MS.Entertainment.Utilities.schedulePromiseNormal().then(this._onLastTrack.bind(this), function(err){})
+ }, _onCurrentSessionStateChanged: function _onCurrentPlayerSSessionChanged(event) {
+ MS.Entertainment.Platform.Playback.Etw.traceString("Query.js: session state: " + event.detail.newValue);
+ if (this.isDisposed || !this._sessionEventHandlers)
+ return;
+ var sessionManager = this._getValidSessionManager();
+ var state = event.detail.newValue;
+ if (state === MS.Entertainment.Platform.Playback.SessionState.endedWithError || state === MS.Entertainment.Platform.Playback.SessionState.ended)
+ this._pageMoreData()
+ }, _onLastTrackPlayingChanged: function _onLastTrackPlayingChangedChanged(event) {
+ if (this.isDisposed || !this._sessionEventHandlers)
+ return;
+ var lastTrackPlaying = event.detail.newValue;
+ if (lastTrackPlaying)
+ this._pageMoreData()
+ }, _getValidSessionManager: function _getValidSessionManager() {
+ var sessionId = MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (!sessionManager || !sessionManager.primarySession || sessionManager.primarySession.sessionId !== sessionId || !sessionManager.primarySession.mediaCollection)
+ sessionManager = null;
+ return sessionManager
+ }, _prepareInnerQuery: function _prepareInnerQuery() {
+ if (this.query)
+ this.query.aggregateChunks = false
+ }, _getPlaybackOptions: function _getPlaybackOptions() {
+ var sessionId = MS.Entertainment.Platform.Playback.WellKnownPlaybackSessionId.nowPlaying;
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionManager.primarySession || {};
+ return {
+ autoPlay: true, preservePlayContext: true, queueMedia: true, smartDJSeed: playbackSession.smartDJSeed, sessionId: sessionId
+ }
+ }, _getChunkDestination: function _getChunkDestination() {
+ var result = null;
+ if (this.query)
+ result = this.query._getChunkDestination();
+ return result
+ }
+ }), ModelQuery: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Data.AugmentQuery", function() {
+ MSE.Data.AugmentQuery.prototype.constructor.apply(this, arguments)
+ }, {
+ _innerQuery: null, chunkSize: 0, currentIndex: {get: function() {
+ return ((this.currentChunk && typeof this.currentChunk.startIndex === "number") ? this.currentChunk.startIndex : 0)
+ }}, createModel: function createModel(startIndex, count) {
+ return null
+ }, createAsyncModel: function createAsyncModel(startIndex, count) {
+ return null
+ }, _parseInnerProgress: function _parseInnerProgress(result) {
+ return MSE.Data.queryStatus.processingData
+ }, _startInnerExecute: function _startInnerExecute() {
+ var that = this;
+ var requestPromise,
+ model;
+ var asyncModel = this.createAsyncModel(this.currentIndex, this.chunkSize);
+ if (asyncModel)
+ requestPromise = asyncModel;
+ else {
+ model = this.createModel(this.currentIndex, this.chunkSize);
+ if (model)
+ requestPromise = WinJS.Promise.wrap(model)
+ }
+ if (!requestPromise)
+ requestPromise = WinJS.Promise.wrapError(this);
+ return requestPromise
+ }, _getChunkResultSize: function _getChunkResultSize(result) {
+ return (result && result.items && result.items.source) ? result.items.source.length : 0
+ }, _calculateNextChunkKey: function _calculateNextChunkKey(result) {
+ var resultSize = this._getChunkResultSize(result);
+ var chunk = null;
+ if (resultSize && this.chunkSize && resultSize >= this.chunkSize)
+ chunk = {startIndex: this.currentIndex + resultSize};
+ return chunk
+ }, _calculatePreviousChunkKey: function _calculatePreviousChunkKey(result) {
+ var resultSize = this._getChunkResultSize(result);
+ var chunk = null;
+ if (resultSize && this.currentIndex > this.chunkSize && this.chunkSize)
+ chunk = {startIndex: this.currentIndex + resultSize};
+ return chunk
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Data", {QueryDebugger: MS.Entertainment.UI.Framework.define(null, {}, {
+ queryType: {
+ image: "image", service: "service", database: "database"
+ }, logQuery: (function() {
+ return function logQuery(){}
+ })()
+ })})
+})()
+})();
+/* >>>>>>/framework/keyboardnavigationmanager.js:22293 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.Framework", {KeyboardNavigationManager: MS.Entertainment.UI.Framework.define(function KeyboardNavigationManager(element, scroller, setTabIndex) {
+ this._element = element;
+ this._scroller = scroller || element;
+ this._setTabIndex = setTabIndex;
+ if (!MS.Entertainment.Utilities.isApp2)
+ this._element.addEventListener("keydown", this._handleKeyInput.bind(this));
+ this._element.addEventListener("focusout", this._handleBlur.bind(this));
+ this._element.addEventListener("focusin", this._handleFocus.bind(this))
+ }, {
+ _element: null, _scroller: null, _focusStyleClass: "acc-keyboardFocusTarget", _setTabIndex: null, _itemWithTabIndex: null, _currentlyFocusedItem: null, _handleKeyInput: function _handleKeyInput(e) {
+ if (MS.Entertainment.Framework.KeyboardNavigationManager._validKeys.indexOf(e.keyCode) === -1 || this.doesElementSupportKeyboardInput(document.activeElement, e.keyCode))
+ return;
+ if (e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space) {
+ this._handleClick(e);
+ return
+ }
+ var initialResults = this._element.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ var initialItemAvailable = true;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTarget(currentInitialItem))
+ results.push(currentInitialItem)
+ }
+ if (results.length < 1)
+ return;
+ if (!this._currentlyFocusedItem) {
+ initialItemAvailable = false;
+ for (var i = 0; i < results.length; i++)
+ if (MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ this._currentlyFocusedItem = results[i];
+ break
+ }
+ }
+ var currentItemOffset = {
+ left: 0, top: 0
+ };
+ if (!this._currentlyFocusedItem && (e.keyCode !== WinJS.Utilities.Key.home && e.keyCode !== WinJS.Utilities.Key.end))
+ return;
+ else
+ currentItemOffset = MS.Entertainment.Utilities.getRelativeOffset(this._currentlyFocusedItem, this._element);
+ var checkElementOffset;
+ var checkElementRight;
+ var checkElementBottom;
+ var currentClosest = null;
+ var currentEdge;
+ var currentItemCheck = null;
+ var currentBestItemCheck = null;
+ if ((initialItemAvailable && currentItemOffset) || (e.keyCode === WinJS.Utilities.Key.home) || (e.keyCode === WinJS.Utilities.Key.end))
+ if (results.length === 1 && !e.ctrlKey)
+ currentClosest = {element: results[0]};
+ else if (e.keyCode === WinJS.Utilities.Key.leftArrow && !e.ctrlKey) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left > checkElementOffset.left)
+ if (currentClosest) {
+ if (currentItemOffset.left - checkElementOffset.left > currentItemOffset.left - currentClosest.left)
+ continue;
+ currentItemCheck = Math.abs(checkElementRight - currentItemOffset.left);
+ currentBestItemCheck = Math.abs(currentClosest.right - currentItemOffset.left);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow && !e.ctrlKey) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (checkElementOffset.left >= currentEdge)
+ if (currentClosest) {
+ if (checkElementOffset.left - currentEdge > currentClosest.left - currentEdge)
+ continue;
+ currentItemCheck = Math.abs(checkElementOffset.left - currentEdge);
+ currentBestItemCheck = Math.abs(currentClosest.left - currentEdge);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.downArrow) {
+ currentEdge = this._currentlyFocusedItem.clientHeight + currentItemOffset.top;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementBottom = checkElementOffset.top + results[i].clientHeight;
+ if (checkElementBottom > currentEdge)
+ if (currentClosest) {
+ if (checkElementBottom - currentEdge > currentClosest.bottom - currentEdge)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left < currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.upArrow) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && currentItemOffset.top > checkElementOffset.top)
+ if (currentClosest) {
+ if (currentItemOffset.top - checkElementOffset.top > currentItemOffset.top - currentClosest.top)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left <= currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.home) {
+ currentClosest = {element: results[0]};
+ if (this._scroller)
+ this._scroller.scrollLeft = 0
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.end) {
+ currentClosest = {element: results[results.length - 1]};
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollWidth
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageDown) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && checkElementOffset.left - currentEdge >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = {element: results[i]};
+ break
+ }
+ }
+ if (!currentClosest)
+ currentClosest = {element: results[results.length - 1]}
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageUp) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left - checkElementRight >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = {element: results[i]};
+ break
+ }
+ }
+ }
+ if (!currentClosest)
+ currentClosest = {element: results[0]}
+ }
+ if (currentClosest && currentClosest.element)
+ this.setFocusedItem(currentClosest.element, true);
+ else if (this._currentlyFocusedItem)
+ this.setFocusedItem(this._currentlyFocusedItem, true);
+ e.preventDefault()
+ }, doesElementSupportKeyboardInput: function doesElementSupportKeyboardInput(element, keyCode) {
+ return MS.Entertainment.Utilities.doesElementSupportKeyboardInput(element)
+ }, getFocusedItem: function getFocusedItem() {
+ if (!this._currentlyFocusedItem)
+ this.focusFirstItemInContainer(this._element);
+ return this._currentlyFocusedItem
+ }, getTabIndexedItem: function getTabIndexedItem() {
+ return this._itemWithTabIndex
+ }, setFocusedItem: function setFocusedItem(item, setStyle, skipSettingFocus, skipScroll) {
+ if (item) {
+ this._setInternalFocusState(item, setStyle);
+ if (!skipSettingFocus && this._currentlyFocusedItem)
+ MS.Entertainment.UI.Framework.focusElement(this._currentlyFocusedItem, skipScroll)
+ }
+ }, _setInternalFocusState: function _setInternalFocusState(item, setStyle) {
+ if (item) {
+ if (this._currentlyFocusedItem)
+ WinJS.Utilities.removeClass(this._currentlyFocusedItem, this._focusStyleClass);
+ this._currentlyFocusedItem = item;
+ if (this._currentlyFocusedItem && setStyle)
+ WinJS.Utilities.addClass(this._currentlyFocusedItem, this._focusStyleClass);
+ if (this._setTabIndex)
+ this.setTabIndexedItem(this._currentlyFocusedItem)
+ }
+ }, setTabIndexedItem: function setTabIndexedItem(element) {
+ if (this._itemWithTabIndex)
+ this._itemWithTabIndex.setAttribute("tabindex", -1);
+ if (element) {
+ element.setAttribute("tabindex", "0");
+ this._itemWithTabIndex = element
+ }
+ }, getFocusableChildren: function getFocusableChildren() {
+ return WinJS.Utilities.query(".win-focusable", this._element) || []
+ }, focusFirstItemInContainer: function focusFirstItemInContainer(container, setStyle, skipSettingFocus, skipScroll) {
+ if (container && MS.Entertainment.UI.Framework.canMoveFocus(container)) {
+ var initialResults = container.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTarget(currentInitialItem)) {
+ this.setFocusedItem(currentInitialItem, setStyle, skipSettingFocus, skipScroll);
+ break
+ }
+ }
+ }
+ }, _checkItemValidTarget: function _checkItemValidTarget(item) {
+ if (item) {
+ var disabledAttribute = item.getAttribute("disabled");
+ return item.currentStyle && item.currentStyle.visibility !== "hidden" && item.currentStyle.display !== "none" && disabledAttribute !== "disabled" && disabledAttribute !== "" && item.clientHeight !== 0 && item.clientWidth !== 0
+ }
+ else
+ return false
+ }, _handleClick: function _handleClick(e) {
+ if (this._currentlyFocusedItem && this._currentlyFocusedItem.click && this._checkItemValidTarget(this._currentlyFocusedItem) && e.target && e.target.tagName && e.target.tagName.toLowerCase() !== "button") {
+ this._currentlyFocusedItem.click();
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }, _handleBlur: function _handleBlur(e) {
+ if (this._currentlyFocusedItem && document.activeElement !== this._currentlyFocusedItem) {
+ WinJS.Utilities.removeClass(this._currentlyFocusedItem, this._focusStyleClass);
+ this._currentlyFocusedItem = null
+ }
+ }, _handleFocus: function _handleFocus(e) {
+ var tryFocus = this._currentlyFocusedItem !== document.activeElement;
+ if (tryFocus) {
+ var listViews = this._element.querySelectorAll(".win-listview");
+ for (var i = 0; i < listViews.length; i++)
+ if (listViews[i].contains(document.activeElement)) {
+ tryFocus = false;
+ break
+ }
+ }
+ if (tryFocus)
+ this._setInternalFocusStateFromActiveElement()
+ }, _setInternalFocusStateFromActiveElement: function _setInternalFocusStateFromActiveElement() {
+ if (document.activeElement && WinJS.Utilities.hasClass(document.activeElement, "win-focusable"))
+ this._setInternalFocusState(document.activeElement, true)
+ }
+ }, {_validKeys: [WinJS.Utilities.Key.leftArrow, WinJS.Utilities.Key.rightArrow, WinJS.Utilities.Key.upArrow, WinJS.Utilities.Key.downArrow, WinJS.Utilities.Key.home, WinJS.Utilities.Key.end, WinJS.Utilities.Key.pageDown, WinJS.Utilities.Key.pageUp, WinJS.Utilities.Key.enter, WinJS.Utilities.Key.space, WinJS.Utilities.Key.g]})});
+ WinJS.Namespace.define("MS.Entertainment.Framework", {OnScreenKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function OnScreenKeyboardNavigationManager(element, scroller, setTabIndex) {
+ this.base(element, scroller, setTabIndex)
+ }, {setFocusedItem: function setFocusedItem(item, setStyle, skipSettingFocus) {
+ if (!item || !(MS.Entertainment.Utilities.isElementInViewportOfParent(item, this._scroller)))
+ return;
+ this._setInternalFocusState(item, setStyle);
+ if (!skipSettingFocus && this._currentlyFocusedItem)
+ MS.Entertainment.UI.Framework.focusElement(this._currentlyFocusedItem)
+ }}, null)});
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ VerticalKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function VerticalKeyboardNavigationManager(element, scroller, setTabIndex) {
+ this._element = element;
+ this._scroller = scroller || element;
+ this._setTabIndex = setTabIndex;
+ if (!MS.Entertainment.Utilities.isApp2)
+ this._element.addEventListener("keydown", this._handleKeyInput.bind(this));
+ this._element.addEventListener("focusout", this._handleBlur.bind(this));
+ this._element.addEventListener("focusin", this._handleFocus.bind(this))
+ }, {_handleKeyInput: function _handleKeyInput(e) {
+ if (MS.Entertainment.Framework.KeyboardNavigationManager._validKeys.indexOf(e.keyCode) === -1 || MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement))
+ return;
+ if (e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space) {
+ this._handleClick(e);
+ return
+ }
+ var initialResults = this._element.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ var initialItemAvailable = true;
+ var currentIndex = 0;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTarget(currentInitialItem))
+ results.push(currentInitialItem)
+ }
+ if (results.length < 1)
+ return;
+ if (!this._currentlyFocusedItem) {
+ initialItemAvailable = false;
+ for (var i = 0; i < results.length; i++)
+ if (MS.Entertainment.Utilities.isElementInVerticalViewportOfParent(results[i], this._scroller)) {
+ this._currentlyFocusedItem = results[i];
+ break
+ }
+ }
+ currentIndex = results.indexOf(this._currentlyFocusedItem);
+ if (!this._currentlyFocusedItem && (e.keyCode !== WinJS.Utilities.Key.home && e.keyCode !== WinJS.Utilities.Key.end) || currentIndex < 0)
+ return;
+ var currentClosest = null;
+ if (initialItemAvailable || (e.keyCode === WinJS.Utilities.Key.home) || (e.keyCode === WinJS.Utilities.Key.end))
+ if (results.length === 1 && !e.ctrlKey)
+ currentClosest = {element: results[0]};
+ else if (e.keyCode === WinJS.Utilities.Key.downArrow) {
+ if (currentIndex < results.length - 1)
+ currentClosest = {element: results[currentIndex + 1]}
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.upArrow) {
+ if (currentIndex > 0)
+ currentClosest = {element: results[currentIndex - 1]}
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.home) {
+ currentClosest = {element: results[0]};
+ if (this._scroller)
+ this._scroller.scrollLeft = 0
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.end) {
+ currentClosest = {element: results[results.length - 1]};
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollWidth
+ }
+ if (currentClosest && currentClosest.element)
+ this.setFocusedItem(currentClosest.element, true);
+ else if (this._currentlyFocusedItem)
+ this.setFocusedItem(this._currentlyFocusedItem, true);
+ e.preventDefault()
+ }}, null), FormKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function FormKeyboardNavigationManager(element, scroller) {
+ this.base(element, scroller, true);
+ var focusableChildern = this.getFocusableChildren();
+ if (focusableChildern.length)
+ this._setInternalFocusState(focusableChildern[0], true)
+ }, {
+ doesElementSupportKeyboardInput: function doesElementSupportKeyboardInput(element, keyCode) {
+ var supportsInput = false;
+ var tagName = element && element.tagName;
+ var isMultiLine = element && element.isMultiLine;
+ if ((tagName !== "INPUT") || (isMultiLine) || (keyCode !== WinJS.Utilities.Key.downArrow && keyCode !== WinJS.Utilities.Key.upArrow))
+ supportsInput = MS.Entertainment.Utilities.doesElementSupportKeyboardInput(element);
+ return supportsInput
+ }, setFocusedItem: function setFocusedItem(item, setStyle, skipSettingFocus, skipScroll) {
+ MS.Entertainment.Framework.KeyboardNavigationManager.prototype.setFocusedItem.call(this, item, setStyle, true, skipScroll);
+ if (item && !skipSettingFocus && this._currentlyFocusedItem)
+ MS.Entertainment.UI.Framework.focusElement(this._currentlyFocusedItem, skipScroll, true)
+ }, setTabIndexedItem: function setTabIndexedItem(element) {
+ if (this._itemWithTabIndex) {
+ var inputs = WinJS.Utilities.query("input,select", this._itemWithTabIndex) || [];
+ inputs.forEach(function(child) {
+ child.setAttribute("tabindex", "-1")
+ })
+ }
+ MS.Entertainment.Framework.KeyboardNavigationManager.prototype.setTabIndexedItem.call(this, element);
+ if (this._itemWithTabIndex) {
+ this._itemWithTabIndex.setAttribute("tabindex", "-1");
+ var inputs = WinJS.Utilities.query("input,select", this._itemWithTabIndex) || [];
+ inputs.forEach(function(child) {
+ child.setAttribute("tabindex", "0")
+ })
+ }
+ }, _setInternalFocusStateFromActiveElement: function _setInternalFocusStateFromActiveElement() {
+ if (document.activeElement)
+ if (WinJS.Utilities.hasClass(document.activeElement, "win-focusable"))
+ this._setInternalFocusState(document.activeElement, true);
+ else if (this._element.contains(document.activeElement)) {
+ var focusableChildern = this.getFocusableChildren();
+ var focusableChild;
+ for (var j = 0; j < focusableChildern.length; j++) {
+ focusableChild = focusableChildern[j];
+ if (focusableChild.contains(document.activeElement)) {
+ this._setInternalFocusState(focusableChild, true);
+ break
+ }
+ }
+ }
+ }
+ })
+ });
+ WinJS.Namespace.define("MS.Entertainment.Framework", {DashboardKeyboardNavigationManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Framework.KeyboardNavigationManager", function DashboardKeyboardNavigationManager(element, scroller, setTabIndex) {
+ this._element = element;
+ this._scroller = scroller || element;
+ this._setTabIndex = setTabIndex;
+ if (!MS.Entertainment.Utilities.isApp2)
+ this._element.addEventListener("keydown", this._handleKeyInput.bind(this));
+ this._element.addEventListener("focusout", this._handleBlur.bind(this));
+ this._element.addEventListener("focusin", this._handleFocus.bind(this))
+ }, {
+ _pivotsFocused: false, _handleKeyInput: function _handleKeyInput(e) {
+ if (MS.Entertainment.Framework.KeyboardNavigationManager._validKeys.indexOf(e.keyCode) === -1 || MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement))
+ return;
+ if (e.ctrlKey && e.altKey && e.keyCode === WinJS.Utilities.Key.g)
+ if (this._currentlyFocusedItem)
+ if (this._currentlyFocusedItem.getAttribute("data-ent-panelHeader") === "true" && this._currentlyFocusedItem.click)
+ this._currentlyFocusedItem.click();
+ else {
+ this._focusNearestPanelHeader(this._currentlyFocusedItem, true);
+ if (this._currentlyFocusedItem.getAttribute("data-ent-panelHeader") === "true")
+ this._handleClick(e)
+ }
+ if (e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space) {
+ this._handleClick(e);
+ return
+ }
+ if ((e.keyCode !== WinJS.Utilities.Key.home) && (e.keyCode !== WinJS.Utilities.Key.end) && this._currentlyFocusedItem && this._currentlyFocusedItem.getAttribute("data-ent-panelHeader") === "true")
+ if (e.keyCode === WinJS.Utilities.Key.downArrow)
+ this._focusFirstItemInPanelBody(this._currentlyFocusedItem, true);
+ else {
+ var initialPivotsResults = this._element.querySelectorAll("[data-ent-panelheader='true']");
+ var pivotsResults = [];
+ var initialItemIndex;
+ for (var j = 0; j < initialPivotsResults.length; j++) {
+ currentInitialItem = initialPivotsResults[j];
+ if (this._checkItemValidTarget(currentInitialItem))
+ pivotsResults.push(currentInitialItem)
+ }
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ pivotsResults.reverse();
+ initialItemIndex = pivotsResults.indexOf(this._currentlyFocusedItem);
+ if (pivotsResults.length > 0 && initialItemIndex >= 0)
+ if (e.keyCode === WinJS.Utilities.Key.leftArrow && !e.ctrlKey) {
+ if (initialItemIndex > 0)
+ this.setFocusedItem(pivotsResults[initialItemIndex - 1], true)
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow && !e.ctrlKey)
+ if (initialItemIndex < pivotsResults.length - 1)
+ this.setFocusedItem(pivotsResults[initialItemIndex + 1], true)
+ }
+ else {
+ var initialResults = this._element.querySelectorAll(".win-focusable");
+ var results = [];
+ var currentInitialItem = null;
+ var initialItemAvailable = true;
+ for (var j = 0; j < initialResults.length; j++) {
+ currentInitialItem = initialResults[j];
+ if (this._checkItemValidTargetNoPivot(currentInitialItem))
+ results.push(currentInitialItem)
+ }
+ if (results.length < 1)
+ return;
+ if (!this._currentlyFocusedItem) {
+ initialItemAvailable = false;
+ for (var i = 0; i < results.length; i++)
+ if (MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ this._currentlyFocusedItem = results[i];
+ break
+ }
+ }
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ results.reverse();
+ var currentItemOffset = {
+ left: 0, top: 0
+ };
+ if (!this._currentlyFocusedItem && (e.keyCode !== WinJS.Utilities.Key.home && e.keyCode !== WinJS.Utilities.Key.end))
+ return;
+ else
+ currentItemOffset = MS.Entertainment.Utilities.getRelativeOffset(this._currentlyFocusedItem, this._element);
+ var checkElementOffset;
+ var checkElementRight;
+ var checkElementBottom;
+ var currentClosest = null;
+ var currentEdge;
+ var currentItemCheck = null;
+ var currentBestItemCheck = null;
+ var goingUp = false;
+ if ((initialItemAvailable && currentItemOffset) || (e.keyCode === WinJS.Utilities.Key.home) || (e.keyCode === WinJS.Utilities.Key.end))
+ if (results.length === 1 && !e.ctrlKey)
+ currentClosest = {element: results[0]};
+ else if (e.keyCode === WinJS.Utilities.Key.leftArrow && !e.ctrlKey) {
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left > checkElementOffset.left)
+ if (currentClosest) {
+ if (currentItemOffset.left - checkElementOffset.left > currentItemOffset.left - currentClosest.left)
+ continue;
+ currentItemCheck = Math.abs(checkElementRight - currentItemOffset.left);
+ currentBestItemCheck = Math.abs(currentClosest.right - currentItemOffset.left);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], right: checkElementRight, left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.rightArrow && !e.ctrlKey) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (checkElementOffset.left > currentEdge)
+ if (currentClosest) {
+ if (checkElementOffset.left - currentEdge > currentClosest.left - currentEdge)
+ continue;
+ currentItemCheck = Math.abs(checkElementOffset.left - currentEdge);
+ currentBestItemCheck = Math.abs(currentClosest.left - currentEdge);
+ if (currentItemCheck < currentBestItemCheck)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ };
+ else if (currentItemCheck === currentBestItemCheck)
+ if (Math.abs(checkElementOffset.top - currentItemOffset.top) <= Math.abs(currentClosest.top - currentItemOffset.top))
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ else
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, right: checkElementRight, top: checkElementOffset.top
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.downArrow) {
+ currentEdge = this._currentlyFocusedItem.clientHeight + currentItemOffset.top;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementBottom = checkElementOffset.top + results[i].clientHeight;
+ if (checkElementBottom > currentEdge)
+ if (currentClosest) {
+ if (checkElementBottom - currentEdge > currentClosest.bottom - currentEdge)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left <= currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, bottom: checkElementBottom
+ }
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.upArrow) {
+ goingUp = true;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && currentItemOffset.top > checkElementOffset.top)
+ if (currentClosest) {
+ if (currentItemOffset.top - checkElementOffset.top > currentItemOffset.top - currentClosest.top)
+ continue;
+ if (checkElementOffset.left >= currentItemOffset.left && checkElementOffset.left - currentItemOffset.left <= currentClosest.left - currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ else if (checkElementOffset.left >= currentItemOffset.left)
+ currentClosest = {
+ element: results[i], left: checkElementOffset.left, top: checkElementOffset.top
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.home) {
+ currentClosest = {element: results[0]};
+ if (this._scroller)
+ this._scroller.scrollLeft = 0
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.end) {
+ currentClosest = {element: results[results.length - 1]};
+ if (this._scroller)
+ this._scroller.scrollLeft = this._scroller.scrollWidth
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageDown) {
+ currentEdge = this._currentlyFocusedItem.clientWidth + currentItemOffset.left;
+ for (var i = 0; i < results.length; i++)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset && checkElementOffset.left - currentEdge >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = {element: results[i]};
+ break
+ }
+ }
+ if (!currentClosest)
+ currentClosest = {element: results[results.length - 1]}
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.pageUp) {
+ for (var i = results.length - 1; i >= 0; i--)
+ if (results[i] !== this._currentlyFocusedItem) {
+ checkElementOffset = MS.Entertainment.Utilities.getRelativeOffset(results[i], this._element);
+ if (checkElementOffset) {
+ checkElementRight = checkElementOffset.left + results[i].clientWidth;
+ if (currentItemOffset.left - checkElementRight >= 0)
+ if (!MS.Entertainment.Utilities.isElementInHorizontalViewportOfParent(results[i], this._scroller)) {
+ currentClosest = {element: results[i]};
+ break
+ }
+ }
+ }
+ if (!currentClosest)
+ currentClosest = {element: results[0]}
+ }
+ }
+ if (currentClosest && currentClosest.element)
+ this.setFocusedItem(currentClosest.element, true);
+ else if (goingUp)
+ this._focusNearestPanelHeader(this._currentlyFocusedItem, true);
+ else if (this._currentlyFocusedItem)
+ this.setFocusedItem(this._currentlyFocusedItem, true);
+ e.preventDefault()
+ }, _findParentContainer: function _findParentContainer(item) {
+ var ancestor = item;
+ var container = null;
+ do {
+ if (ancestor.domElement)
+ ancestor = ancestor.domElement;
+ if (ancestor.getAttribute("data-ent-dashboardpanel") === "true") {
+ container = ancestor;
+ break
+ }
+ ancestor = ancestor.parentNode
+ } while (ancestor);
+ return container
+ }, _focusNearestPanelHeader: function _focusNearestPanelHeader(item, setStyle) {
+ var container = this._findParentContainer(item);
+ var panelHeader;
+ if (container)
+ this.focusFirstItemInContainer(container.querySelector(".panelTitle"), setStyle)
+ }, _focusFirstItemInPanelBody: function _focusFirstItemInPanelBody(item, setStyle) {
+ var container = this._findParentContainer(item);
+ var panelHeader;
+ if (container)
+ this.focusFirstItemInContainer(container.querySelector(".panelContainer"), setStyle)
+ }, _checkItemValidTargetNoPivot: function _checkItemValidTargetNoPivot(item) {
+ if (item) {
+ var disabledAttribute = item.getAttribute("disabled");
+ var pivotAttribute = item.getAttribute("data-ent-panelheader");
+ return item.currentStyle && pivotAttribute !== "true" && item.currentStyle.visibility !== "hidden" && item.currentStyle.display !== "none" && disabledAttribute !== "disabled" && disabledAttribute !== "" && item.clientHeight !== 0 && item.clientWidth !== 0
+ }
+ else
+ return false
+ }
+ }, null)})
+})()
+})();
+/* >>>>>>/framework/querywatcher.js:22976 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.Framework", {QueryWatcher: MS.Entertainment.defineObservable(function QueryWatcher(moniker) {
+ this._moniker = moniker;
+ this._queries = []
+ }, {
+ _firstQueryLogged: false, _moniker: null, _queries: null, autoClear: true, lowestStatus: MS.Entertainment.Data.queryStatus.idle, registerQuery: function registerQuery(query) {
+ if (query !== null) {
+ this._checkAndFireInitialEvent();
+ var that = this;
+ var callback = function statusChangeCallback(status) {
+ var i;
+ var currentStatus;
+ var newLowestStatus = MS.Entertainment.Data.queryStatus.max;
+ var fireCompletedEvent = true;
+ for (i = 0; i < that._queries.length; i++) {
+ currentStatus = that._queries[i].savedQuery.status;
+ if (currentStatus < newLowestStatus)
+ newLowestStatus = currentStatus;
+ if (currentStatus < MS.Entertainment.Data.queryStatus.completed)
+ fireCompletedEvent = false
+ }
+ that.lowestStatus = newLowestStatus;
+ if (fireCompletedEvent) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceQueries_Complete(that._moniker);
+ if (that.autoClear)
+ that.clearQueries()
+ }
+ };
+ this._queries.push({
+ savedQuery: query, savedCallback: callback
+ });
+ query.bind("status", callback)
+ }
+ }, _checkAndFireInitialEvent: function _checkAndFireInitialEvent() {
+ if (!this._firstQueryLogged) {
+ this._firstQueryLogged = true;
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceQueries_Begin(this._moniker)
+ }
+ }, clearQueries: function clearQueries() {
+ var i = this._queries.length;
+ for (i = 0; i < this._queries.length; i++)
+ this._queries[i].savedQuery.unbind("status", this._queries[i].savedCallback);
+ this._queries.length = 0;
+ this._firstQueryLogged = false
+ }
+ }, null)})
+})()
+})();
+/* >>>>>>/framework/actionidentifiers.js:23031 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+WinJS.Namespace.define("MS.Entertainment.UI.Actions.ActionIdentifiers", {
+ actionPassThrough: "actionPassThrough", addArtistToNowPlaying: "addArtistToNowPlaying", addTo: "addTo", addToNowPlaying: "addToNowPlaying", addToPlaylist: "addToPlaylist", addRemoveItemWatchlist: "addRemoveItemWatchlist", albumDetailsNavigate: "albumDetailsNavigate", albumDeviceDetailsNavigate: "albumDeviceDetailsNavigate", albumPurchase: "albumPurchase", artistMediaNavigate: "artistMediaNavigate", artistDetailsNavigate: "artistDetailsNavigate", collectionNavigate: "collectionNavigate", copy: "copy", createPlaylist: "createPlaylist", deepLinkConfigureMemoryLeakTracking: "deepLinkConfigureMemoryLeakTracking", deepLinkLocation: "deepLinkLocation", deepLinkSearch: "deepLinkSearch", deepLinkDetails: "deepLinkDetails", deepLinkPlay: "deepLinkPlay", deepLinkPlayPin: "deepLinkPlayPin", deepLinkPlayTo: "deepLinkPlayTo", deepLinkLaunchTitle: "deepLinkLaunchTitle", deepLinkLaunchFeedbackFlyout: "deepLinkLaunchFeedbackFlyout", deepLinkShowPerfTrackLog: "deepLinkShowPerfTrackLog", deeplinkSetDlna: "deeplinkSetDlna", deeplinkTunerConfig: "deeplinkTunerConfig", deepLinkVideoProtocolConverter: "deepLinkVideoProtocolConverter", deepLinkXBLDefault: "deepLinkXBLDefault", deepLinkXBLDetails: "deepLinkXBLDetails", deepLinkXBLPlayback: "deepLinkXBLPlayback", deleteMedia: "deleteMedia", deleteSmartDJ: "deleteSmartDJ", depthGalleryNavigate: "depthGalleryNavigate", disabled: "disabled", download: "download", downloadAgain: "downloadAgain", downloadCancel: "downloadCancel", downloadPause: "downloadPause", downloadResume: "downloadResume", downloadRemove: "downloadRemove", downloadSeason: "downloadSeason", downloadDemo: "downloadDemo", editMetadata: "editMetadata", editMetadataImage: "editMetadataImage", editMetadataMatchAlbumInfo: "editMetadataMatchAlbumInfo", exploreHubNavigate: "exploreHubNavigate", externalNavigate: "externalNavigate", externalAdNavigate: "externalAdNavigate", featuredSetsNavigate: "featuredSetsNavigate", findAlbumInfo: "findAlbumInfo", flexHubNavigate: "flexHubNavigate", genericPlay: "genericPlay", importPlaylists: "importPlaylists", invoke: "invoke", invokeGlobalCommand: "invokeGlobalCommand", launchApp: "launchApp", launchHelpApp: "launchHelpApp", launchInteractiveApp: "launchInteractiveApp", manageFolders: "manageFolders", mediaItemDetailsNavigate: "mediaItemDetailsNavigate", mediaStatusSubscriptionSignupAction: "mediaStatusSubscriptionSignupAction", more: "more", moveListItemDown: "moveListItemDown", moveListItemToBottom: "moveListItemToBottom", moveListItemToTop: "moveListItemToTop", moveListItemUp: "moveListItemUp", musicCollectionNavigate: "musicCollectionNavigate", musicDeepLinkDetails: "musicDeepLinkDetails", musicDeepLinkLocation: "musicDeepLinkLocation", musicPinToStartPlayAndNavigate: "musicPinToStartPlayAndNavigate", navigate: "navigate", navigateToDefault: "navigateToDefault", navigateToVideoDetails: "navigateToVideoDetails", newMusicMarketplaceNavigate: "newMusicMarketplaceNavigate", notificationClear: "notificationClear", nowPlayingNavigate: "nowPlayingNavigate", openAbout: "openAbout", openFeedbackDialog: "openFeedbackDialog", openFile: "openFile", pickPlaylist: "pickPlaylist", pinMediaItem: "pinMediaItem", pinToStartScreen: "pinToStartScreen", playAll: "playAll", playArtist: "playArtist", playFreeOffer: "playFreeOffer", playMedia: "playMedia", playPlaylist: "playPlaylist", playQuery: "playQuery", playSmartDJ: "playSmartDJ", playOnXbox: "playOnXbox", playlistDetailsNavigate: "playlistDetailsNavigate", purchase: "purchase", purchaseSubscriptionOffer: "purchaseSubscriptionOffer", radioNavigate: "radioNavigate", readerAction: "readerAction", refreshCollection: "refreshCollection", renamePlaylist: "renamePlaylist", removeFromPlaybackSession: "removeFromPlaybackSession", removeFromList: "removeFromList", removeFromPlaylist: "removeFromPlaylist", repeatNowPlaying: "repeatNowPlaying", resetSearchFilter: "resetSearchFilter", resetSearchHub: "resetSearchHub", restorePurchases: "restorePurchases", saveNowPlayingPlaylist: "saveNowPlayingPlaylist", search: "search", searchByContext: "searchByContext", searchArtist: "searchArtist", searchResultsNavigate: "searchResultsNavigate", selectArtist: "selectArtist", selectPlaylist: "selectPlaylist", setBackgroundImage: "setBackgroundImage", share: "share", shiftDashboard: "shiftDashboard", shuffleNowPlaying: "shuffleNowPlaying", showAccountPicker: "showAccountPicker", showFindFriendsFlyout: "showFindFriendsFlyout", showItemDetails: "showItemDetails", showImmersiveDetails: "showImmersiveDetails", showActivityOverlay: "showActivityOverlay", showLocalGrovelInfoDialog: "showLocalGrovelInfoDialog", showMusicVideoContextualAppbar: "showMusicVideoContextualAppbar", showPlaylistItemInformation: "showPlaylistItemInformation", showTrackContextualAppbar: "showTrackContextualAppbar", showSwitcherOverlay: "showSwitcherOverlay", showVideoDownloadManager: "showVideoDownloadManager", showWebHostDialog: "showWebHostDialog", showPopOver: "showPopOver", shuffleAllMusic: "shuffleAllMusic", signIn: "signIn", signInRequiredNavigate: "signInRequiredNavigate", signInAndOnlineRequiredNavigate: "signInAndOnlineRequiredNavigate", signOut: "signOut", skipBackward: "skipBackward", skipForward: "skipForward", studiosAndNetworksGalleryNavigate: "studiosAndNetworksGalleryNavigate", subscriptionAddToMyMusic: "subscriptionAddToMyMusic", subscriptionDownload: "subscriptionDownload", subscriptionSignup: "subscriptionSignup", subscriptionWithSignIn: "subscriptionWithSignIn", switchVideoDefinition: "switchVideoDefinition", toggleMusicVideoPlayback: "toggleMusicVideoPlayback", topMusicMarketplaceNavigate: "topMusicMarketplaceNavigate", trackPurchase: "trackPurchase", switchLanguage: "switchLanguage", unpinFromStartScreen: "unpinFromStartScreen", userEngagementCollectionMessage: "userEngagementCollectionMessage", videoCollectionMovieNavigate: "videoCollectionMovieNavigate", videoCollectionNavigate: "videoCollectionNavigate", videoCollectionOtherNavigate: "videoCollectionOtherNavigate", videoCollectionTvNavigate: "videoCollectionTvNavigate", videoDetailsNavigate: "videoDetailsNavigate", videoDeepLinkLocation: "videoDeepLinkLocation", videoMarketplaceNavigate: "videoMarketplaceNavigate", videoPostRollNavigate: "videoPostRollNavigate", videoRecommendationsNavigate: "videoRecommendationsNavigate", videoWatchlistNavigate: "videoWatchlistNavigate", watchOnXbox: "watchOnXbox", testAction: "testAction", testAction2: "testAction2", testPanelAction: "testPanelAction", testPanelAction2: "testPanelAction2", testPanelAction3: "testPanelAction3", testPanelAction4: "testPanelAction4", notificationCloudContent: "notificationCloudContent", notificationCloudContentV2: "notificationCloudContentV2", notificationDetailsNetworkStatus: "notificationDetailsNetworkStatus", notificationLocalContent: "notificationLocalContent", notificationNetworkStatus: "notificationNetworkStatus", notificationPartialContent: "notificationPartialContent"
+});
+WinJS.Namespace.define("MS.Entertainment.UI", {AppBarActions: {
+ addTo: "addTo", addToNowPlaying: "addToNowPlaying", addLocalArtistToNowPlaying: "addLocalArtistToNowPlaying", addMarketplaceArtistToNowPlaying: "addMarketplaceArtistToNowPlaying", addToMyMusic: "addToMyMusic", addToPlaylist: "addToPlaylist", addToOtherPlaylist: "addToOtherPlaylist", addTrackToPlaylist: "addTrackToPlaylist", artistDetails: "artistDetails", buyCurrentSeason: "buyCurrentSeason", buyEpisode: "buyEpisode", buySeason: "buySeason", buyVideo: "buyVideo", clearSelection: "clearSelection", closeSmartGlassActivity: "closeSmartglassActivity", closeSmartGlassController: "closeSmartGlassController", createNewPlaylist: "createNewPlaylist", deleteMedia: "deleteMedia", deleteSeries: "deleteSeries", deletePlaylist: "deletePlaylist", deleteSmartDJ: "deleteSmartDJ", downloadFromMarketplace: "downloadFromMarketplace", downloadSeason: "downloadSeason", editMetadata: "editMetadata", editMetadataImage: "editMetadataImage", editMetadataMatchAlbumInfo: "editMetadataMatchAlbumInfo", exploreAlbum: "exploreAlbum", findAlbumInfo: "findAlbumInfo", getOnXbox360: "getOnXbox360", globalCommandHelpApp: "globalCommandHelpApp", pinToStartScreen: "pinToStartScreen", unpinFromStartScreen: "unpinFromStartScreen", importPlaylists: "importPlaylists", mediaProperties: "mediaProperties", moveListItemDown: "moveListItemDown", moveListItemToBottom: "moveListItemToBottom", moveListItemToTop: "moveListItemToTop", moveListItemUp: "moveListItemUp", movieDetails: "movieDetails", navigateBack: "navigateBack", navigateToDefault: "navigateToDefault", navigateToHome: "navigateToHome", navigateToNowPlaying: "navigateToNowPlaying", navigateToWatchlist: "navigateToWatchlist", openAbout: "openAbout", openFeedbackDialog: "openFeedbackDialog", openFile: "openFile", playContinuous: "playContinuous", playFreeOffer: "playFreeOffer", playMusicVideo: "playMusicVideo", playMusicVideoFromTrack: "playMusicVideoFromTrack", playNow: "playNow", playDisabled: "playDisabled", playOnXbox360: "playOnXbox360", playTrackOnXbox360: "playTrackOnXbox360", playSelection: "playSelection", playSelectionContinuous: "playSelectionContinuous", playSmartDJ: "playSmartDJ", playTopSongs: "playTopSongs", playTrailer: "playTrailer", playVideo: "playVideo", previewSelection: "previewSelection", previewTrack: "previewTrack", purchaseTrackFromMarketplace: "purchaseTrackFromMarketplace", purchaseAlbumFromMarketplace: "purchaseAlbumFromMarketplace", removeFailedVideo: "removeFailedVideo", removeFromList: "removeFromList", removeFromPlaylist: "removeFromPlaylist", removeFromNowPlaying: "removeFromNowPlaying", removeFailedDownload: "removeFailedDownload", renamePlaylist: "renamePlaylist", rentVideo: "rentVideo", restorePurchases: "restorePurchases", restartVideo: "restartVideo", resumeVideo: "resumeVideo", saveNowPlayingPlaylist: "saveNowPlayingPlaylist", search: "search", seasonDetails: "seasonDetails", seriesDetails: "seriesDetails", setBackgroundImage: "setBackgroundImage", showDownloadManager: "showDownloadManager", showPlaylistItemInformation: "showPlaylistItemInformation", signIn: "signIn", subscriptionDownload: "subscriptionDownload", tryDownloadAgain: "tryDownloadAgain", toggleSwitcher: "toggleSwitcher", toggleMusicVideoPlayback: "toggleMusicVideoPlayback", subscriptionSignup: "subscriptionSignup"
+ }})
+})();
+/* >>>>>>/framework/videoactionidentifiers.js:23042 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Actions) {
+ (function(ActionIdentifiers) {
+ ActionIdentifiers.changeTvSeason = "changeTvSeason";
+ ActionIdentifiers.deepLinkConfigureVideoQualitySelector = "deepLinkConfigureVideoQualitySelector";
+ ActionIdentifiers.featuredMoviesMarketplaceNavigate = "featuredMoviesMarketplaceNavigate";
+ ActionIdentifiers.featuredTvMarketplaceNavigate = "featuredTvMarketplaceNavigate";
+ ActionIdentifiers.lastNightTvMarketplaceNavigate = "lastNightTvMarketplaceNavigate";
+ ActionIdentifiers.moviesFeaturedSetsMarketplaceNavigate = "moviesFeaturedSetsMarketplaceNavigate";
+ ActionIdentifiers.moviesStoreNavigate = "moviesStoreNavigate";
+ ActionIdentifiers.newMoviesMarketplaceNavigate = "newMoviesMarketplaceNavigate";
+ ActionIdentifiers.newTvMarketplaceNavigate = "newTvMarketplaceNavigate";
+ ActionIdentifiers.personalVideoNavigate = "personalVideoNavigate";
+ ActionIdentifiers.topMoviesMarketplaceNavigate = "topMoviesMarketplaceNavigate";
+ ActionIdentifiers.topTvMarketplaceNavigate = "topTvMarketplaceNavigate";
+ ActionIdentifiers.tvFeaturedSetsMarketplaceNavigate = "tvFeaturedSetsMarketplaceNavigate";
+ ActionIdentifiers.tvStoreNavigate = "tvStoreNavigate";
+ ActionIdentifiers.videoDeepLinkDetails = "videoDeepLinkDetails"
+ })(Actions.ActionIdentifiers || (Actions.ActionIdentifiers = {}));
+ var ActionIdentifiers = Actions.ActionIdentifiers
+ })(UI.Actions || (UI.Actions = {}));
+ var Actions = UI.Actions
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/automationidentifiers.js:23076 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.UI.AutomationIds", {
+ accountProvisioningChildWebLink: "accountProvisioningChildWebLink", accountProvisioningTOS: "accountProvisioningTOS", accountProvisioningPrivacy: "accountProvionsingPrivacy", addToPlaylistAction: "addToPlaylistAction", addToNowPlaying: "addToNowPlaying", albumDetailsNavigate: "albumDetailsNavigate", albumDeviceDetailsNavigate: "albumDeviceDetailsNavigate", albumPurchase: "albumPurchase", artistMediaNavigate: "artistMediaNavigate", artistDetailsNavigate: "artistDetailsNavigate", appBarAddLocalArtistToNowPlaying: "appBarAddLocalArtistToNowPlaying", appBarAddMarketplaceArtistToNowPlaying: "appBarAddMarketplaceArtistToNowPlaying", appBarAddTo: "appBarAddTo", appBarAddToMyMusic: "appBarAddToMyMusic", appBarSubscriptionAddToMyMusic: "appBarSubscriptionAddToMyMusic", appBarAddToCloud: "appBarAddToCloud", appBarAddToNowPlaying: "appBarAddToNowPlaying", appBarArtistDetails: "appBarArtistDetails", appBarBuyCurrentSeason: "appBarBuyCurrentSeason", appBarBuyEpisode: "appBarBuyEpisode", appBarBuySeason: "appBarBuySeason", appBarBuyVideo: "appBarBuyVideo", appBarCloseCommandingPopover: "appBarCloseCommandingPopover", appBarClearSelection: "appBarClearSelection", appBarCloseSmartGlassActivity: "appBarCloseSmartGlassActivity", appBarCloseSmartGlassController: "appBarCloseSmartGlassController", appBarDeleteSmartDJ: "appBarDeleteSmartDJ", appBarDownloadAgain: "appBarDownloadAgain", appBarDownloadFromMarketplace: "appBarDownloadFromMarketplace", appBarDownloadSeason: "appBarDownloadSeason", appBarExploreAlbum: "appBarExploreAlbum", appBarFindAlbumInfo: "appBarFindAlbumInfo", appBarGetOnXbox360: "appBarGetOnXbox360", appBarPinToStartScreen: "appBarPinToStartScreen", appBarMediaProperties: "appBarMediaProperties", appBarMovieDetails: "appBarMovieDetails", appBarNavigateBack: "appBarNavigateBack", appBarNavigateToDefault: "appBarNavigateToDefault", appBarNavigateToHome: "appBarNavigateToHome", appBarNavigateToNowPlaying: "appBarNavigateToNowPlaying", appBarNavigateToWatchlist: "appBarNavigateToWatchlist", appBarOpenAbout: "appBarOpenAbout", appBarOpenFile: "appBarOpenFile", appBarPlayFreeVideoOffer: "appBarPlayFreeVideoOffer", appBarPlayDisabled: "appBarPlayDisabled", appBarPlayNow: "appBarPlayNow", appBarPlayOnXbox360: "appBarPlayOnXbox360", appBarPlaySelection: "appBarPlaySelection", appBarPlaySmartDJ: "appBarPlaySmartDJ", appBarPlayTopSongs: "appBarPlayTopSongs", appBarPlayTrackOnXbox360: "appBarPlayTrackOnXbox360", appBarPlayTrailer: "appBarPlayTrailer", appBarPreviewTrack: "appBarPreviewTrack", appBarPurchaseAlbumFromMarketplace: "appBarPurchaseAlbumFromMarketplace", appBarPurchaseTrackFromMarketplace: "appBarPurchaseTrackFromMarketplace", appBarRemoveDownload: "appBarRemoveDownload", appBarRentVideo: "appBarRentVideo", appBarRestartVideo: "appBarRestartVideo", appBarResumeVideo: "appBarResumeVideo", appBarRestorePurchases: "appBarRestorePurchases", appBarSaveNowPlaying: "appBarSaveNowPlaying", appBarSeasonDetails: "appBarSeasonDetails", appBarSearch: "appBarSearch", appBarSeriesDetail: "appBarSeriesDetail", appBarShowDownloadManager: "appBarShowDownloadManager", appBarSignIn: "appBarSignIn", appBarSubscriptionDownload: "appBarSubscriptionDownload", appBarSubscriptionSignup: "appBarSubscriptionSignup", appBarToggleSwitcher: "appBarToggleSwitcher", appBarUnpinFromStartScreen: "appBarUnpinFromStartScreen", appBarUpsellPlayPause: "appBarUpsellPlayPause", criticReviewSelect: "criticReviewSelect", collectionCreatePlaylist: "collectionCreatePlaylist", collectionCreateSmartDJ: "collectionCreateSmartDJ", collectionEmptyShowAllMusicLink: "collectionEmptyShowAllMusicLink", collectionFilterLink: "collectionFilterLink", collectionNavigate: "collectionNavigate", collectionImportPlaylist: "collectionImportPlaylist", copy: "copy", createPlaylist: "createPlaylist", dashboardNewReleasesMoreButton: "dashboardNewReleasesMoreButton", dashboardNewMusicVideosButton: "dashboardNewMusicVideosButton", dashboardHomePlaylistsButton: "dashboardHomePlaylistsButton", dashboardHomeCollectionButton: "dashboardHomeCollectionButton", dashboardHomeSearch: "dashboardHomeSearch", dashboardFeaturedSearch: "dashboardFeaturedSearch", dashboardSmartDJCollection: "dashboardSmartDJCollection", dashboardSmartDJSearch: "dashboardSmartDJSearch", dashboardSmartDJSearchArtist: "dashboardSmartDJSearchArtist", dashboardTopMusicSearch: "dashboardTopMusicSearch", dashboardHomeUpsellPanelStartTrial: "dashboardHomeUpsellPanelStartTrial", dashboardHomeUpsellPanelLearnMore: "dashboardHomeUpsellPanelLearnMore", dashboardFeaturedMoreButton: "dashboardFeaturedMoreButton", dashboardTopMusicFirstColumnMoreButton: "dashboardTopMusicFirstColumnMoreButton", dashboardTopMusicSecondColumnMoreButton: "dashboardTopMusicSecondColumnMoreButton", dashboardVideoBrowseMovieMarketplace: "dashboardVideoBrowseMovieMarketplace", dashboardVideoBrowseTvMarketplace: "dashboardVideoBrowseTvMarketplace", dashboardVideoFeaturedSets: "dashboardVideoFeaturedSets", dashboardVideoRecommendations: "dashboardVideoRecommendations", deepLink: "deepLink", deepLinkFeatureEnablementAction: "deepLinkFeatureEnablementAction", deepLinkLaunchFeedbackFlyout: "deepLinkLaunchFeedbackFlyout", deepLinkShowPerfTrackLog: "deepLinkShowPerfTrackLog", deepLinkPlay: "deepLinkPlay", deepLinkPlayArtist: "deepLinkPlayArtist", deepLinkPlayPin: "deepLinkPlayPin", deepLinkPlaySmartDJ: "deepLinkPlaySmartDJ", deviceDomainHelpPage: "deviceDomainHelpPage", deviceDomainShowDevices: "deviceDomainShowDevices", doubleClickPlay: "doubleClickPlay", editMetadata: "editMetadata", editMetadataImage: "editMetadataImage", editMetadataMatchAlbumInfo: "editMetadataMatchAlbumInfo", explicitAlbumNotification: "explicitAlbumNotification", explicitAlbumMixedNotification: "explicitAlbumMixedNotification", exploreHubNavigate: "exploreHubNavigate", exploreUpsellLearnMore: "exploreUpsellLearnMore", exploreUpsellMusicPassSignIn: "exploreUpsellMusicPassSignIn", exploreUpsellMusicPassSignUp: "exploreUpsellMusicPassSignUp", failedPanelNavigateToMarketplace: "failedPanelNavigateToMarketplace", flexHubNavigate: "flexHubNavigate", flexHubSelected: "flexHubSelected", flyoutAddToPlaylist: "flyoutAddToPlaylist", flyoutAddTrackToPlaylist: "flyoutAddTrackToPlaylist", flyoutCreatePlaylist: "flyoutCreatePlaylist", flyoutPlayArtist: "flyoutPlayArtist", flyoutPlaySmartDJ: "flyoutPlaySmartDJ", flyoutOtherPlaylist: "flyoutOtherPlaylist", freeTrialButton: "freeTrialButton", freeLimitsSubscriptionSignup: "freeLimitsSubscriptionSignup", galleryPlaySmartDJ: "galleryPlaySmartDJ", genericPlay: "genericPlay", genrePivot: "genre", globalCommandHelpApp: "globalCommandHelpApp", invokeGlobalCommand: "invokeGlobalCommand", launchAppDeepLinkPurchasePDLC: "launchAppDeepLinkPurchasePDLC", launchAppMoreAboutLibraries: "launchAppMoreAboutLibraries", launchAppMusicApp: "launchAppMusicApp", launchAppPlayToXbox: "launchAppPlayToXbox", launchAppPurchaseGame: "launchAppPurchaseGame", launchAppStoreUpgrade: "launchAppStoreUpgrade", launchAppVideoApp: "launchAppVideoApp", libraryPlaySmartDJ: "libraryPlaySmartDJ", mediaItemDetailsNavigate: "mediaItemDetailsNavigate", miniProfileHubPanelSignIn: "miniProfileHubPanelSignIn", mouseNavigateBack: "mouseNavigateBack", moveListItemDown: "moveListItemDown", moveListItemToBottom: "moveListItemToBottom", moveListItemToTop: "moveListItemToTop", moveListItemUp: "moveListItemUp", musicDeepLinkLocation: "musicDeepLinkLocation", musicDeepLinkDetails: "musicDeepLinkDetails", musicPinToStartPlayAndNavigate: "musicPinToStartPlayAndNavigate", muteVolume: "muteVolume", navigate: "navigate", navigateToDefault: "navigateToDefault", navigateToVideoDetails: "navigateToVideoDetails", navPaneCreatePlaylist: "navPaneCreatePlaylist", navPaneImportPlaylists: "navPaneImportPlaylists", newMusicMarketplaceNavigate: "newMusicMarketplaceNavigate", nowPlayingNavigate: "nowPlayingNavigate", nowPlayingTransportPause: "nowPlayingTransportPause", nowPlayingTransportPlay: "nowPlayingTransportPlay", nowPlayingTransportPlayPause: "nowPlayingTransportPlayPause", nowPlayingTransportSkipBack: "nowPlayingTransportSkipBack", nowPlayingTransportSkipBackHold: "nowPlayingTransportSkipBackHold", nowPlayingTransportSkipForward: "nowPlayingTransportSkipForward", nowPlayingTransportSkipForwardHold: "nowPlayingTransportSkipForwardHold", nowPlayingTransportVolume: "nowPlayingTransportVolume", nowPlayingTransportVolumeHold: "nowPlayingTransportVolumeHold", offlineFullyStreamingAlbumNotification: "offlineFullyStreamingAlbumNotification", offlineFullyStreamingPlaylistNotification: "offlineFullyStreamingPlaylistNotification", offlinePartiallyStreamingAlbumNotification: "offlinePartiallyStreamingAlbumNotification", offlinePartiallyStreamingPlaylistNotification: "offlinePartiallyStreamingPlaylistNotification", openFeedbackDialog: "openFeedbackDialog", playbackSkipBackward: "playbackSkipBackward", playbackSkipForward: "playbackSkipForward", playMedia: "playMedia", playMusicVideo: "playMusicVideo", playMusicVideoFromTrack: "playMusicVideoFromTrack", playQueryAction: "playQueryAction", playlistAddToActivePlaylistAction: "playlistAddToActivePlaylistAction", playlistAddToPlaylistAction: "playlistAddToPlaylistAction", playlistAddTrackToActivePlaylistAction: "playlistAddTrackToActivePlaylistAction", playlistAddTrackToPlaylistAction: "playlistAddTrackToPlaylistAction", playlistCreatePlaylistAction: "playlistCreatePlaylistAction", playlistCreatePlaylistFromNowPlayingAction: "playlistCreatePlaylistFromNowPlayingAction", playlistDeletePlaylist: "playlistDeletePlaylist", playlistDetailsNavigate: "playlistDetailsNavigate", playlistFlyoutAddToPlaylist: "playlistFlyoutAddToPlaylist", playlistFlyoutAddTrackToPlaylist: "playlistFlyoutAddTrackToPlaylist", playlistFlyoutCreatePlaylist: "playlistFlyoutCreatePlaylist", playlistMoveTrackDown: "playlistMoveTrackDown", playlistMoveTrackUp: "playlistMoveTrackUp", playlistNewPlaylistNameEntry: "playlistNewPlaylistNameEntry", playlistRemoveFromPlaylist: "playlistRemoveFromPlaylist", playlistRemoveFromNowPlaying: "playlistRemoveFromNowPlaying", playlistRenamePlaylistAction: "playlistRenamePlaylistAction", playlistRenamePlaylistNameEntry: "playlistRenamePlaylistNameEntry", playlistSaveNowPlayingPlaylistNameEntry: "playlistSaveNowPlayingPlaylistNameEntry", playlistShowPlaylistInformation: "playlistShowPlaylistInformation", playlistSubscriptionAddToMyMusic: "playlistSubscriptionAddToMyMusic", playlistWebCreatePlaylistAction: "playlistWebCreatePlaylistAction", pinToStartPlay: "pinToStartPlay", radioNavigate: "radioNavigate", readerAction: "readerAction", removeFromList: "removeFromList", refreshPanel: "refreshPanel", runTestDeepLinkAction: "runTestDeepLinkAction", searchResultsNavigate: "searchResultsNavigate", setBackgroundImageAction: "setBackgroundImageAction", settingsAccountBillingContact: "settingsAccountBillingContact", settingsAccountBillingHistory: "settingsAccountBillingHistory", settingsAccountContactPreferences: "settingsAccountContactPreferences", settingsAccountManageDevices: "settingsAccountManageDevices", settingsAccountManagePayment: "settingsAccountManagePayment", settingsAccountPrivacy: "settingsAccountPrivacy", settingsShowDevice: "settingsShowDevice", settingsSubscriptionSignup: "settingsSubscriptionSignup", settingsHelp: "settingsHelp", showAccountPicker: "showAccountPicker", showDownloadManager: "showDownloadManager", showImmersiveDetails: "showImmersiveDetails", showItemDetails: "showItemDetails", showLocalGrovelInfoDialog: "showLocalGrovelInfoDialog", showMusicVideoContextualAppbar: "showMusicVideoContextualAppbar", showNowPlayingMoreActions: "showNowPlayingMoreActions", showTrackContextualAppbar: "showTrackContextualAppbar", showPlaylist: "showPlaylist", showPopover: "showPopover", shuffleAllMusic: "shuffleAllMusic", signIn: "signIn", smartButtonAddToDisabled: "smartButtonAddToDisabled", smartButtonAddToFromPopover: "smartButtonAddToFromPopover", smartButtonAddToFromTrackInline: "smartButtonAddToFromTrackInline", smartButtonAddToFromArtistImmersive: "smartButtonAddToFromArtistImmersive", smartButtonAddToFromAlbumDetails: "smartButtonAddToFromAlbumDetails", smartButtonLaunchInteractiveApp: "smartButtonLaunchInteractiveApp", smartButtonWatch: "smartButtonWatch", smartButtonBuyVideo: "smartButtonBuyVideo", smartButtonBuyEpisode: "smartButtonBuyEpisode", smartButtonRentVideo: "smartButtonRentVideo", smartBuyPlayFreeVideoOffer: "smartBuyPlayFreeVideoOffer", smartButtonPlay: "smartButtonPlay", smartButtonPlayTrack: "smartButtonPlayTrack", smartButtonPlayNowPlayingTrack: "smartButtonPlayNowPlayingTrack", smartButtonRestart: "smartButtonRestart", smartButtonResume: "smartButtonResume", smartButtonPlayDisabled: "smartButtonPlayDisabled", smartButtonSwitchVideoDefinition: "smartButtonSwitchVideoDefinition", smartButtonSwitchLanguage: "smartButtonSwitchLanguage", smartButtonFindAlbumInfo: "smartButtonFindAlbumInfo", smartButtonAddToNowPlaying: "smartButtonAddToNowPlaying", smartButtonAddAlbumToNowPlaying: "smartButtonAddAlbumToNowPlaying", smartButtonAddPlaylistToNowPlaying: "smartButtonAddPlaylistToNowPlaying", smartButtonAddTrackToNowPlaying: "smartButtonAddTrackToNowPlaying", smartButtonContentNotAvailable: "smartButtonContentNotAvailable", smartButtonAddMarketplaceArtistToNowPlaying: "smartButtonAddMarketplaceArtistToNowPlaying", smartButtonAddLocalArtistToNowPlaying: "smartButtonAddLocalArtistToNowPlaying", smartButtonAddRemoveItemWatchlist: "smartButtonAddRemoveItemWatchlist", smartButtonMoveListItemDown: "smartButtonMoveListItemDown", smartButtonMoveListItemToBottom: "smartButtonMoveListItemToBottom", smartButtonMoveListItemToTop: "smartButtonMoveListItemToTop", smartButtonMoveListItemUp: "smartButtonMoveListItemUp", smartButtonOverflowAction: "smartButtonOverflowAction", smartButtonPinToDashboard: "smartButtonPinToDashboard", smartButtonPlaySeason: "smartButtonPlaySeason", smartButtonPlayAnyArtist: "smartButtonPlayAnyArtist", smartButtonPlayPlaylist: "smartButtonPlayPlaylist", smartButtonNewSmartDj: "smartButtonNewSmartDj", smartButtonPinToStartScreen: "smartButtonPinToStartScreen", smartButtonUnpinFromStartScreen: "smartButtonUnpinFromStartScreen", smartButtonPlayArtist: "smartButtonPlayArtist", smartButtonPlayArtistSmartDj: "smartButtonPlayArtistSmartDj", smartButtonDelete: "smartButtonDelete", smartButtonDeleteSmartDj: "smartButtonDeleteSmartDj", smartButtonAddToMyMusic: "smartButtonAddToMyMusic", smartButtonAddToMyMusicAlbum: "smartButtonAddToMyMusicAlbum", smartButtonAddToMyMusicAlbumOp: "smartButtonAddToMyMusicAlbumOp", smartButtonAddToMyMusicTrack: "smartButtonAddToMyMusicTrack", smartButtonAddToMyMusicTrackOp: "smartButtonAddToMyMusicTrackOp", smartButtonDownload: "smartButtonDownload", smartButtonDownloadCancel: "smartButtonDownloadCancel", smartButtonDownloadFreeExtra: "smartButtonDownloadFreeExtra", smartButtonDownloadPause: "smartButtonDownloadPause", smartButtonDownloadResume: "smartButtonDownloadResume", smartButtonDownloadRetry: "smartButtonDownloadRetry", smartButtonDownloadSeason: "smartButtonDownloadSeason", smartButtonTryAgain: "smartButtonTryAgain", smartButtonRemove: "smartButtonRemove", smartButtonRenamePlaylist: "smartButtonRenamePlaylist", smartButtonMusicPassSignup: "smartButtonMusicPassSignup", smartButtonPlayTrailer: "smartButtonPlayTrailer", smartButtonPlayGameTrailer: "smartButtonPlayGameTrailer", smartButtonPlayOnXbox: "smartButtonPlayOnXbox", smartButtonWatchTrailer: "smartButtonWatchTrailer", smartButtonWatchOnXbox: "smartButtonWatchOnXbox", smartButtonMovieDetails: "smartButtonMovieDetails", smartButtonArtistDetails: "smartButtonArtistDetails", smartButtonSeriesDetails: "smartButtonSeriesDetails", smartButtonSeasonDetails: "smartButtonSeasonDetails", smartButtonGameDetails: "smartButtonGameDetails", smartButtonCompareGameActivities: "smartButtonCompareGameActivities", smartButtonGameExtras: "smartButtonGameExtras", smartButtonBuyModernGame: "smartButtonBuyModernGame", smartButtonPlayOnPc: "smartButtonPlayOnPc", smartButtonPlayAlbum: "smartButtonPlayAlbum", smartButtonPlayAlbumPreview: "smartButtonPlayAlbumPreview", smartButtonPlayTrackPreview: "smartButtonPlayTrackPreview", smartButtonPlayArtistPreview: "smartButtonPlayArtistPreview", smartButtonArtistLocalPlayAll: "smartButtonArtistLocalPlayAll", smartButtonArtistMarketplacePlayAll: "smartButtonArtistMarketplacePlayAll", smartButtonArtistPlayVideos: "smartButtonArtistPlayVideos", smartButtonBuyAlbum: "smartButtonBuyAlbum", smartButtonBuyTrack: "smartButtonBuyTrack", smartButtonDisabledBuyTrack: "smartButtonDisabledBuyTrack", smartButtonBuyExtra: "smartButtonBuyExtra", smartButtonBuyGame: "smartButtonBuyGame", smartButtonBuySeason: "smartButtonBuySeason", smartButtonBuyCurrentSeason: "smartButtonBuyCurrentSeason", smartButtonBuyCurrentSeasonPass: "smartButtonBuyCurrentSeasonPass", smartButtonBuyNextSeason: "smartButtonBuyNextSeason", smartButtonBuyNextSeasonPass: "smartButtonBuyNextSeasonPass", smartButtonExtraPurchasedDisabled: "smartButtonExtraPurchasedDisabled", smartButtonGamePurchasedDisabled: "smartButtonGamePurchasedDisabled", smartButtonDemoPurchasedDisabled: "smartButtonDemoPurchasedDisabled", smartButtonTryGameDemo: "smartButtonTryGameDemo", smartButtonShowDownloadManager: "smartButtonShowDownloadManager", smartButtonShowPlaylist: "smartButtonShowPlaylist", smartButtonRemoveFromList: "smartButtonRemoveFromList", smartButtonRemoveFromPlaylist: "smartButtonRemoveFromPlaylist", smartButtonRemoveFromNowPlaying: "smartButtonRemoveFromNowPlaying", smartButtonDeleteMedia: "smartButtonDeleteMedia", smartButtonDeleteSeries: "smartButtonDeleteSeries", smartButtonDeletePlaylist: "smartButtonDeletePlaylist", smartButtonMediaProperties: "smartButtonMediaProperties", smartButtonShuffleAll: "smartButtonShuffleAll", smartButtonBrowseAllMusic: "smartButtonBrowseAllMusic", smartButtonGetFreeMusicPassTrial: "smartButtonGetFreeMusicPassTrial", smartButtonBuyActivity: "smartButtonBuyActivity", smartButtonPlayActivity: "smartButtonPlayActivity", smartButtonGetGold: "smartButtonGetGold", smartButtonPlaylistItemInformation: "smartButtonPlaylistItemInformation", smartButtonSaveNowPlayingPlaylist: "smartButtonSaveNowPlayingPlaylist", smartButtonPlayRelatedArtist: "smartButtonPlayRelatedArtist", smartButtonRatingPicker: "smartButtonRatingPicker", smartButtonChangeSeason: "smartButtonChangeSeason", smartButtonInCollection: "smartButtonInCollection", smartButtonViewInCollection: "smartButtonViewInCollection", startRadioStation: "startRadioStation", subscriptionDownload: "subscriptionDownload", subscriptionSignup: "subscriptionSignup", subscriptionSignupWithSignIn: "subscriptionSignupWithSignIn", subscriptionSignupPurchaseOffer: "subscriptionSignupPurchaseOffer", subscriptionSignupRedeemCode: "subscriptionSignupRedeemCode", socialBuzzNavigateToProfile: "socialBuzzNavigateToProfile", subgenrePivot: "subgenre", textMessageDeleteButton: "textMessageDeleteButton", textMessageReplyButton: "textMessageReplyButton", toggleMusicVideoPlayback: "toggleMusicVideoPlayback", topMusicMarketplaceButton: "topMusicMarketplaceButton", topMusicMarketplaceNavigate: "topMusicMarketplaceNavigate", trackPurchase: "trackPurchase", transportClosedCaption: "transportClosedCaption", transportNextTrack: "transportNextTrack", transportPause: "transportPause", transportPlay: "transportPlay", transportPlayPause: "transportPlayPause", transportPreviousTrack: "transportPreviousTrack", transportRepeat: "transportRepeat", transportPlaybackOptions: "transportPlaybackOptions", transportShuffle: "transportShuffle", transportSkipBack: "transportSkipBack", transportSkipBackHold: "transportSkipBackHold", transportSkipForward: "transportSkipForward", transportSkipForwardHold: "transportSkipForwardHold", transportSmartGlass: "transportSmartGlass", transportXbox: "transportXbox", transportVolume: "transportVolume", transportVolumeHold: "transportVolumeHold", unsnapButtonAction: "unsnapButtonAction", userFeedbackDialogPrivacyLink: "userFeedbackDialogPrivacyLink", verticalPivotSelected: "verticalPivotSelected", videoAdSubscriptionSignup: "videoAdSubscriptionSignup", videoDeepLinkLocation: "videoDeepLinkLocation", videoNavigateToPreviewBrowse: "videoNavigateToPreviewBrowse", videoPostRollPlayTimer: "videoPostRollPlayTimer", viewMoreImmersive: "viewMoreImmersive", voiceNavigateBack: "voiceNavigateBack", whatsNewLink: "whatsNewLink"
+ })
+})()
+})();
+/* >>>>>>/framework/videoautomationidentifiers.js:23087 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(AutomationIds) {
+ AutomationIds.changeTvSeason = "changeTvSeason";
+ AutomationIds.externalRottenTomatoesLinkNavigate = "externalRottenTomatoesLinkNavigate";
+ AutomationIds.featuredMoviesMarketplaceNavigate = "featuredMoviesMarketplaceNavigate";
+ AutomationIds.featuredTvMarketplaceNavigate = "featuredTvMarketplaceNavigate";
+ AutomationIds.lastNightTvMarketplaceNavigate = "lastNightTvMarketplaceNavigate";
+ AutomationIds.moviesFeaturedSetsMarketplaceNavigate = "moviesFeaturedSetsMarketplaceNavigate";
+ AutomationIds.moviesStoreNavigate = "moviesStoreNavigate";
+ AutomationIds.newMoviesMarketplaceNavigate = "newMoviesMarketplaceNavigate";
+ AutomationIds.newTvMarketplaceNavigate = "newTvMarketplaceNavigate";
+ AutomationIds.offlineHeaderNotification = "offlineHeaderNotification";
+ AutomationIds.personalVideoNavigate = "personalVideoNavigate";
+ AutomationIds.showLocalGrovelInfoDialog = "showLocalGrovelInfoDialog";
+ AutomationIds.topMoviesMarketplaceNavigate = "topMoviesMarketplaceNavigate";
+ AutomationIds.topTvMarketplaceNavigate = "topTvMarketplaceNavigate";
+ AutomationIds.tvFeaturedSetsMarketplaceNavigate = "tvFeaturedSetsMarketplaceNavigate";
+ AutomationIds.tvStoreNavigate = "tvStoreNavigate";
+ AutomationIds.videoDeepLinkDetails = "videoDeepLinkDetails";
+ AutomationIds.videoSearchFilterAll = "videoSearchFilterAll";
+ AutomationIds.videoSearchFilterMovies = "videoSearchFilterMovies";
+ AutomationIds.videoSearchFilterTv = "videoSearchFilterTv"
+ })(UI.AutomationIds || (UI.AutomationIds = {}));
+ var AutomationIds = UI.AutomationIds
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/action.js:23123 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Actions");
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ ActionArray: MS.Entertainment.UI.Framework.derive("Array", null, {
+ subActions: null, actionsWithSubActions: null, pushSubAction: function addSubAction(actionId, subActionId) {
+ MS.Entertainment.UI.Actions.assert(actionId, "actionId must be defined");
+ MS.Entertainment.UI.Actions.assert(subActionId, "subActionId must be defined");
+ this.actionsWithSubActions = this.actionsWithSubActions || [];
+ this.subActions = this.subActions || {};
+ if (!this.subActions[actionId])
+ this.actionsWithSubActions.push(actionId);
+ this.subActions[actionId] = this.subActions[actionId] || [];
+ this.subActions[actionId].push(subActionId)
+ }, hasSubActions: function hasSubActions(actionId) {
+ MS.Entertainment.UI.Actions.assert(actionId, "actionId must be defined");
+ return this.subActions && this.subActions[actionId] && this.subActions[actionId].length > 0
+ }
+ }, {areSubActionsEqual: function areSubActionsEqual(actionArray1, actionArray2) {
+ var arraysAreEqual = true;
+ var subActions1 = (actionArray1 && actionArray1.subActions) || {};
+ var subActions2 = (actionArray2 && actionArray2.subActions) || {};
+ var actionsWithSubActions1 = (actionArray1 && actionArray1.actionsWithSubActions) || [];
+ var actionsWithSubActions2 = (actionArray2 && actionArray2.actionsWithSubActions) || [];
+ var subActionValues1;
+ var subActionValues2;
+ if (actionsWithSubActions1.length !== actionsWithSubActions2.length)
+ arraysAreEqual = false;
+ else
+ for (var i = 0; arraysAreEqual && i < actionsWithSubActions1.length; i++) {
+ subActionValues1 = subActions1[actionsWithSubActions1[i]];
+ subActionValues2 = subActions1[actionsWithSubActions2[i]];
+ for (var j = 0; j < subActionValues1.length; j++)
+ if (subActionValues1[j] !== subActionValues2[j]) {
+ arraysAreEqual = false;
+ break
+ }
+ }
+ return arraysAreEqual
+ }}), ExecutionLocation: {
+ activity: "activity", canvas: "canvas", engage: "engage", gallery: "gallery", invokeInline: "invokeInline", opportunity: "opportunity", popover: "popover", selection: "selection", nowPlaying: "nowPlaying"
+ }, ActionWrapperType: {
+ appbarAction: "appbarAction", button: "button"
+ }, ActionService: MS.Entertainment.UI.Framework.define(function actionServiceConstructor() {
+ this._actionFactories = {}
+ }, {
+ _actionFactories: null, register: function register(id, factory) {
+ MS.Entertainment.UI.Actions.assert(MS.Entertainment.UI.Actions.ActionIdentifiers.hasOwnProperty(id), "Identifier wasn't found in action list: " + id);
+ MS.Entertainment.UI.Actions.assert(!this._actionFactories.hasOwnProperty(id), "This action identifier has already been registered: " + id);
+ MS.Entertainment.UI.Actions.assert(typeof factory === "function", "Factory method was not a function");
+ this._actionFactories[id] = factory
+ }, isRegistered: function isRegistered(id) {
+ return this._actionFactories.hasOwnProperty(id)
+ }, getAction: function getAction(id) {
+ if (!this._actionFactories.hasOwnProperty(id))
+ throw"Supplied Action Identifier was not registered: " + id;
+ var newAction = this._actionFactories[id]();
+ newAction.id = id;
+ return newAction
+ }, _unregister: function _unregister(id) {
+ delete this._actionFactories[id]
+ }
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.actions, function actionServiceFactory() {
+ return new MS.Entertainment.UI.Actions.ActionService
+ }, true);
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ Action: MS.Entertainment.defineObservable(function actionConstructor() {
+ var that = this;
+ var firstCall = true;
+ this.bind("parameter", function parameterChanged() {
+ if (firstCall) {
+ firstCall = false;
+ return
+ }
+ that.requeryCanExecute();
+ that.requeryCanShow()
+ })
+ }, {
+ parameter: null, shouldShow: false, isEnabled: true, title: null, voiceDisableOverride: false, subActions: null, hasSubActions: false, onComplete: null, onExecuting: null, useRelativePositioning: false, id: null, automationId: null, shouldAutomaticallySendTelemetry: true, isDragAndDropResponse: false, type: null, label: null, section: null, tooltip: null, _getTranslatedDragAndDropParameters: function _getTranslatedDragAndDropParameters() {
+ if (!this.translateDragAndDropParams)
+ return this.parameter;
+ var source = this.parameter && this.parameter.source;
+ var target = this.parameter && this.parameter.target;
+ MS.Entertainment.UI.Actions.assert(source, "Drag-and-drop action parameters do not contain a source parameter, so we don't know what is being dragged.");
+ return this.translateDragAndDropParams(source, target)
+ }, execute: function execute(referenceDomElement) {
+ var result;
+ var onExecuting;
+ this.requeryCanExecute();
+ if (this.isEnabled && this.executed) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceAction_Invoked(this.id);
+ onExecuting = this.onExecuting && this.onExecuting();
+ onExecuting = WinJS.Promise.as(onExecuting);
+ var parameter = this.parameter;
+ if (this.isDragAndDropResponse)
+ parameter = this._getTranslatedDragAndDropParameters();
+ if (this.shouldAutomaticallySendTelemetry)
+ MS.Entertainment.Utilities.Telemetry.logCommandClicked(this);
+ result = onExecuting.then(function onExecutingComplete() {
+ return this.executed(parameter, referenceDomElement)
+ }.bind(this))
+ }
+ return WinJS.Promise.as(result).then(function onComplete() {
+ if (this.onComplete)
+ return this.onComplete();
+ else
+ return WinJS.Promise.wrap()
+ }.bind(this))
+ }, requeryCanShow: function requeryCanShow() {
+ var parameter = this.parameter;
+ if (this.isDragAndDropResponse)
+ parameter = this._getTranslatedDragAndDropParameters();
+ if (this.canShow)
+ this.shouldShow = !!this.canShow(parameter)
+ }, requeryCanExecute: function requeryCanExecute() {
+ if (!this.executed) {
+ this.isEnabled = false;
+ return
+ }
+ var parameter = this.parameter;
+ if (this.isDragAndDropResponse)
+ parameter = this._getTranslatedDragAndDropParameters();
+ if (this.canExecute)
+ this.isEnabled = !!this.canExecute(parameter)
+ }, setSubActions: function setSubActions(newSubActions) {
+ this.subActions = newSubActions
+ }, useOverrideTitleIfExists: function useOverrideTitleIfExists() {
+ if ("overrideTitle" in this)
+ this.title = this["overrideTitle"]
+ }
+ }), extractMediaItemFromParam: function extractMediaItemFromParam(param) {
+ var mediaItem;
+ if (param && param.mediaItem)
+ mediaItem = param.mediaItem;
+ else
+ mediaItem = param;
+ return mediaItem
+ }, extractButtonFromParam: function extractButtonFromParam(param) {
+ var button;
+ if (param && param.button)
+ button = param.button;
+ else
+ button = param;
+ return button
+ }
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {InvokeAction: MS.Entertainment.deferredDerive("MS.Entertainment.UI.Actions.Action", function invokeAction() {
+ this.base();
+ this.invoker = new MS.Entertainment.Utilities.EventInvoker
+ }, {
+ invoker: null, invokeEvent: "invoked", executed: function executed(param) {
+ return this.invoker.dispatchEvent(this.invokeEvent, param)
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })});
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.invoke, function() {
+ return new MS.Entertainment.UI.Actions.InvokeAction
+ })
+})();
+(function runVoiceMixins() {
+ MS.Entertainment.Utilities.runVoicePropertyMixins(MS.Entertainment.UI.Actions.Action)
+})()
+})();
+/* >>>>>>/controls/listcontrols.js:23294 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Controls");
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ItemsControl: MS.Entertainment.UI.Framework.defineUserControl(null, function itemsControlConstructor(element, options) {
+ this.repeaterContainer = element;
+ this._handleChangesInDataSource = this._handleChangesInDataSource.bind(this);
+ if (!this.keyboardNavigationManagerClass)
+ this.keyboardNavigationManagerClass = MS.Entertainment.Framework.KeyboardNavigationManager;
+ if (MS.Entertainment.UI.Framework.getTextDirection() === MS.Entertainment.UI.Framework.TextDirections.RightToLeft) {
+ var left = this.bringIntoViewLeftMargin;
+ var right = this.bringIntoViewRightMargin;
+ this.bringIntoViewLeftMargin = right;
+ this.bringIntoViewRightMargin = left
+ }
+ if (this.virtualize) {
+ if (!this.itemSize && !this.getItemSize)
+ throw new Error("itemSize required when using virtualization");
+ if (!this.virtualizationAxis)
+ throw new Error("virtualizationOrientation required when using virtualization");
+ if (!this.singleAxis && (!this.itemSize.width || !this.itemSize.height))
+ throw new Error("When using multiaxis, you need to supply an itemSize that has a width and height");
+ if (this._scroller.attachEvent)
+ this._scrollerAttachEvent = (function(handler, element) {
+ element.attachEvent("onresize", handler);
+ return {cancel: function() {
+ element.detachEvent("onresize", handler)
+ }}
+ })(this._handleElementResizing.bind(this), this._scroller);
+ this._scrollerEvents = MS.Entertainment.UI.Framework.addEventHandlers(this._scroller, {
+ mselementresize: this._handleElementResizing.bind(this), scroll: this._handleScrollingForVirtualization.bind(this)
+ })
+ }
+ this._constructed = true
+ }, {
+ delayInitializeChildren: false, _constructed: false, keyboardNavigable: false, keyboardNavigationManagerClass: null, keyboardNavigationSetTabIndex: false, _keyboardNavigationManager: null, raisePanelReady: false, ignoreChildrenInitialization: true, _restoreFocusAfterRender: false, deferForLongLists: false, longListDeferralItemLimit: 10, firstItemTabIndex: -1, itemSize: null, getItemSize: null, fireFirstTimeRenderedEventOnEmptyObservableArray: false, _firstTimeRenderCompleted: false, _internalDeclarativeRenderHelper: null, _declarativeRenderHelper: {get: function() {
+ if (!this._internalDeclarativeRenderHelper)
+ this._internalDeclarativeRenderHelper = new MS.Entertainment.UI.Controls.DeclarativeItemsControlRenderHelper;
+ return this._internalDeclarativeRenderHelper
+ }}, _scroller: {get: function() {
+ if (this.useParentAsScrollContainer)
+ if (this.parentScroller)
+ return this.parentScroller;
+ else
+ return this.repeaterContainer.parentElement;
+ return this.repeaterContainer
+ }}, _itemTemplate: null, _itemTemplateSet: null, itemTemplate: {
+ get: function() {
+ return this._itemTemplate
+ }, set: function(value) {
+ this._itemTemplate = value;
+ this._itemTemplateProvider = null;
+ if (this._itemTemplate && this._itemTemplateSet) {
+ this._itemTemplateSet(value);
+ this._itemTemplateSet = null
+ }
+ }
+ }, _virtualize: false, virtualize: {
+ get: function itemsControl_virtualize_get() {
+ return this._virtualize
+ }, set: function itemsControl_virtualize_set(value) {
+ if (this._constructed)
+ throw new Error("Can't set the virtualization setting after construction");
+ this._virtualize = value
+ }
+ }, singleAxis: true, containerStyle: null, animateIn: true, bringIntoViewRightMargin: 0, bringIntoViewLeftMargin: 0, _highestIndexItemToRender: -1, _scrollTopPosition: -1, _scrollLeftPosition: -1, _scrollerHeight: -1, _scrollerWidth: -1, _firstVerticalItemScrollOffset: -1, _firstHorizontalItemScrollOffset: -1, _itemTemplateProvider: null, _workingDataSource: null, _pendedBringItemIntoViewItem: null, controlName: "ItemsControl", _dataSource: undefined, _firstTimeRenderedCount: -1, _isRTL: null, _frozen: false, repeaterContainer: null, isFirstTimeRendered: false, dataSource: {
+ get: function() {
+ return this._dataSource
+ }, set: function(value) {
+ if (value === this._dataSource)
+ return;
+ var oldValue = this._dataSource;
+ this._dataSource = value;
+ if (this._dataBindingHandler)
+ this._dataBindingHandler(value, oldValue);
+ else
+ this._listChangedHandler(value, oldValue);
+ if (!oldValue && value)
+ this._initializeWithData();
+ this.notify("dataSource", value, oldValue)
+ }
+ }, initialize: function initialize() {
+ if (this.dataSource)
+ this._initializeWithData()
+ }, unload: function unload() {
+ if (this._workingDataSource) {
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = null
+ }
+ if (this._scrollerEvents) {
+ this._scrollerEvents.cancel();
+ this._scrollerEvents = null
+ }
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._frozen = true;
+ MS.Entertainment.UI.Framework.UserControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Framework.UserControl.prototype.thaw.call(this);
+ this._frozen = false
+ }, _initializeWithData: function _initializeWithData() {
+ this._loadItemTemplateIgnoreErrors();
+ if (this.keyboardNavigable)
+ this._keyboardNavigationManager = new this.keyboardNavigationManagerClass(this.repeaterContainer, null, this.keyboardNavigationSetTabIndex)
+ }, loadItemTemplate: function loadItemTemplate() {
+ var completePromise;
+ if (!this._itemTemplateProvider)
+ completePromise = this._loadTemplate(this.itemTemplate, null, true);
+ else
+ completePromise = WinJS.Promise.wrap(this._itemTemplateProvider);
+ completePromise = completePromise || WinJS.Promise.wrapError(new Error("No item template provided"));
+ return completePromise.then(function(template) {
+ this._itemTemplateProvider = template;
+ return template
+ }.bind(this))
+ }, _loadItemTemplateIgnoreErrors: function _loadItemTemplateIgnoreErrors() {
+ this.loadItemTemplate().done(null, function(){})
+ }, selectTemplate: function(item) {
+ return this.loadItemTemplate().then(function() {
+ return this._itemTemplateProvider
+ }.bind(this))
+ }, render: function(sourceChanged) {
+ if (this.virtualize)
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length === 0, "List should not have items");
+ this._setSizeForScrolling();
+ if (this._workingDataSource && this._workingDataSource.length) {
+ if (this.applyPanelTemplate)
+ this.applyPanelTemplate();
+ var loadTemplatePromise = null;
+ if ((!this._firstTimeRenderCompleted && this.repeaterContainer.children.length) || !this.itemTemplate)
+ loadTemplatePromise = WinJS.Promise.as();
+ else
+ loadTemplatePromise = this.loadItemTemplate();
+ loadTemplatePromise.then(function renderOnceTemplateProviderLoaded() {
+ var workingLength = this._workingDataSource ? this._workingDataSource.length : 0;
+ if (this.virtualize && this.highestIndexItemToRender !== 0)
+ workingLength = Math.min(this.highestIndexItemToRender, workingLength);
+ if (this._firstTimeRenderCompleted)
+ MS.Entertainment.UI.Framework.empty(this.repeaterContainer);
+ if (this._firstTimeRenderedCount === -1) {
+ this._firstTimeRenderedCount = this.deferForLongLists ? Math.min(workingLength, this.longListDeferalItemLimit) : workingLength;
+ for (var i = this.repeaterContainer.children.length - 1; i >= this._firstTimeRenderedCount; i--)
+ this.repeaterContainer.removeChild(this.repeaterContainer.children[i])
+ }
+ for (var i = 0; i < workingLength; i++) {
+ if (this.deferForLongLists && (i === this.longListDeferalItemLimit))
+ break;
+ this._renderItem(this._workingDataSource.item(i), i)
+ }
+ if (this.deferForLongLists && i < workingLength)
+ window.requestAnimationFrame(function() {
+ for (; i < workingLength; i++) {
+ if ((i % (this.longListDeferalItemLimit * 2)) === 0)
+ MS.Entertainment.UI.Framework.forceFullLayout();
+ this._renderItem(this._workingDataSource.item(i))
+ }
+ }.bind(this));
+ if (this.itemsRendered)
+ this.itemsRendered();
+ if (this.restoreFocus)
+ this.restoreFocus()
+ }.bind(this))
+ }
+ else {
+ if (sourceChanged)
+ MS.Entertainment.UI.Framework.empty(this.repeaterContainer);
+ var isEmptyArray = (this.dataSource && Array.isArray(this.dataSource) && this.dataSource.length === 0);
+ var isEmptyObservableArray = (this.dataSource && this.dataSource instanceof MS.Entertainment.ObservableArray && this.dataSource.length === 0);
+ if (isEmptyArray || (isEmptyObservableArray && this.fireFirstTimeRenderedEventOnEmptyObservableArray))
+ if (this._firstTimeRenderedCount === -1) {
+ this._firstTimeRenderedCount = 0;
+ this._sendFirstTimeRenderedEvent()
+ }
+ }
+ this._firstTimeRenderCompleted = true
+ }, highestIndexItemToRender: {get: function highestIndexItemToRender_get() {
+ if (this._highestIndexItemToRender === -1)
+ if (!this.virtualize)
+ this._highestIndexItemToRender = this._workingDataSource.length;
+ else {
+ var minTargetPositionWidth = WinJS.Utilities.getMember("domElement.currentStyle.maxWidth", this);
+ var minTargetPositionHeight = WinJS.Utilities.getMember("domElement.currentStyle.maxHeight", this);
+ minTargetPositionWidth = parseInt(minTargetPositionWidth) || 0;
+ minTargetPositionHeight = parseInt(minTargetPositionHeight) || 0;
+ var targetPosition = {
+ horizontal: this.scrollLeftPosition + Math.max(this.scrollerWidth, minTargetPositionWidth), vertical: this.scrollTopPosition + Math.max(this.scrollerHeight, minTargetPositionHeight)
+ };
+ this._highestIndexItemToRender = this.getHighestItemToRenderForScrollPosition(targetPosition)
+ }
+ return this._highestIndexItemToRender
+ }}, getHighestItemToRenderForScrollPosition: function getHighestItemToRenderForScrollPosition(targetPosition) {
+ var itemCount;
+ if (this.singleAxis) {
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "horizontal";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "vertical";
+ itemCount = (targetPosition[axis] - this.firstItemScrollOffset) / this.itemSize
+ }
+ else
+ itemCount = this._multipleAxisItemCount(targetPosition);
+ return Math.ceil(Math.abs(itemCount))
+ }, _getVerticalAxisItemCount: function _getVerticalAxisItemCount(targetVerticalPosition) {
+ var viewportHeight = targetVerticalPosition - this.firstVerticalItemScrollOffset;
+ var verticalItems = viewportHeight / this.itemSize.height;
+ return verticalItems
+ }, _getHorizontalAxisItemCount: function _getHorizontalAxisItemCount(targetHorizontalPosition) {
+ var viewportWidth = targetHorizontalPosition - this.firstHorizontalItemScrollOffset;
+ var horizontalItems = viewportWidth / this.itemSize.width;
+ return horizontalItems
+ }, _multipleAxisItemCount: function _multipleAxisItemCount(targetPosition) {
+ var verticalItems;
+ var horizontalItems;
+ switch (this.virtualizationAxis) {
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal:
+ verticalItems = Math.floor(this._getVerticalAxisItemCount(targetPosition.vertical));
+ horizontalItems = Math.ceil(this._getHorizontalAxisItemCount(targetPosition.horizontal));
+ break;
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical:
+ verticalItems = Math.ceil(this._getVerticalAxisItemCount(targetPosition.vertical));
+ horizontalItems = Math.floor(this._getHorizontalAxisItemCount(targetPosition.horizontal));
+ break;
+ default:
+ MS.Entertainment.UI.Controls.fail("Unexpected Axis: " + this.virtualizationAxis);
+ verticalItems = 0;
+ horizontalItems = 0;
+ break
+ }
+ return horizontalItems * verticalItems
+ }, firstItemScrollOffset: {get: function itemsControl_firstItemScrollOffset() {
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ return this.firstHorizontalItemScrollOffset;
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ return this.firstVerticalItemScrollOffset
+ }}, firstVerticalItemScrollOffset: {get: function itemsControl_firstVerticalItemScrollOffset() {
+ if (!this.useParentAsScrollContainer)
+ return 0;
+ if (this._firstVerticalItemScrollOffset === -1) {
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(this.repeaterContainer, this._scroller).top;
+ this._firstVerticalItemScrollOffset = relativePosition
+ }
+ return this._firstVerticalItemScrollOffset
+ }}, firstHorizontalItemScrollOffset: {get: function itemsControl_firstHorizonalItemScrollOffset() {
+ if (!this.useParentAsScrollContainer)
+ return 0;
+ if (this._firstHorizontalItemScrollOffset === -1) {
+ var relativePosition = MS.Entertainment.Utilities.getRelativeOffset(this.repeaterContainer, this._scroller).left;
+ if (this.isRTL)
+ relativePosition += ((this.repeaterContainer.calculatedSize || this.repeaterContainer.clientWidth) - this.scrollerWidth);
+ this._firstHorizontalItemScrollOffset = Math.abs(relativePosition)
+ }
+ return this._firstHorizontalItemScrollOffset
+ }}, getItemSizeForIndex: function getItemSizeForIndex(index) {
+ return this.itemSize
+ }, scrollLeftPosition: {get: function itemsControl_scrollLeftPosition() {
+ if (this._scrollLeftPosition === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollLeftPosition = this._scroller.scrollLeft;
+ this._skipResize = false
+ }
+ return this._scrollLeftPosition
+ }}, scrollTopPosition: {get: function itemsControl_scrollTopPosition() {
+ if (this._scrollTopPosition === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollTopPosition = this._scroller.scrollTop;
+ this._skipResize = false
+ }
+ return this._scrollTopPosition
+ }}, scrollerHeight: {get: function itemsControl_scrollerHeight() {
+ if (this._scrollerHeight === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollerHeight = this._scroller.clientHeight;
+ this._skipResize = false
+ }
+ return this._scrollerHeight
+ }}, scrollerWidth: {get: function itemsControl_scrollerWidth() {
+ if (this._scrollerWidth === -1 && this._scroller) {
+ this._skipResize = true;
+ this._scrollerWidth = this._scroller.clientWidth;
+ this._skipResize = false
+ }
+ return this._scrollerWidth
+ }}, viewportWidth: {get: function viewportWidth_get() {
+ return this.scrollLeftPosition + this.scrollerWidth - this.firstHorizontalItemScrollOffset
+ }}, viewportHeight: {get: function viewportHeight_get() {
+ return this.scrollTopPosition + this.scrollerHeight - this.firstVerticalItemScrollOffset
+ }}, itemsPerColumn: {get: function itemsPerColumn_get() {
+ return Math.floor(this.viewportHeight / this.itemSize.height)
+ }}, isRTL: {get: function isRTL_get() {
+ if (this._isRTL === null)
+ this._isRTL = (MS.Entertainment.UI.Framework.getTextDirectionForElement(this.domElement) === MS.Entertainment.UI.Framework.TextDirections.RightToLeft);
+ return this._isRTL
+ }}, _isIndexInRealizedArea: function _isIndexInRealizedArea(index) {
+ if (!this.virtualize)
+ return true;
+ if (index < this.highestIndexItemToRender)
+ return true;
+ return false
+ }, _ensureRealizedToRealizedItemLimit: function _ensureRealizedToRealizedItemLimit() {
+ if (!this._workingDataSource || !this._workingDataSource.length)
+ return;
+ if (this.repeaterContainer.children.length > this.highestIndexItemToRender)
+ return;
+ if ((this._workingDataSource.length < this.highestIndexItemToRender) && (this.repeaterContainer.children.length === this._workingDataSource.length))
+ return;
+ if (this.virtualize)
+ this._firstTimeRenderedCount = Math.min(this._firstTimeRenderedCount, this.highestIndexItemToRender);
+ if (!this._firstTimeRenderCompleted)
+ return;
+ for (var i = this.repeaterContainer.children.length; i < this._workingDataSource.length; i++)
+ this._renderItem(this._workingDataSource.item(i), i)
+ }, _handleElementResizing: function _handleElementResizing() {
+ if (this._skipResize)
+ return;
+ this._resetVirtualizationCaches();
+ this._ensureRealizedToRealizedItemLimit()
+ }, _resetVirtualizationCaches: function _resetVirtualizatonCaches() {
+ this._scrollerHeight = -1;
+ this._scrollerWidth = -1;
+ this._scrollLeftPosition = -1;
+ this._scrollTopPosition = -1;
+ this._firstHorizontalItemScrollOffset = -1;
+ this._firstVerticalItemScrollOffset = -1;
+ this._highestIndexItemToRender = -1;
+ if (this.repeaterContainer)
+ this.repeaterContainer.calculatedSize = undefined
+ }, _handleScrollingForVirtualization: function _handleScrollingForVirtualization() {
+ this._scrollLeftPosition = -1;
+ this._scrollTopPosition = -1;
+ this._highestIndexItemToRender = -1;
+ this._ensureRealizedToRealizedItemLimit();
+ this.dispatchEvent("itemsControlScrolled")
+ }, _setSizeForScrolling: function _setSizeForScrolling() {
+ if (!(this.useParentAsScrollContainer && this.virtualize))
+ return;
+ var size = 0;
+ if (this._workingDataSource && this._workingDataSource.length)
+ if (this.singleAxis)
+ size = (this.itemSize * this._workingDataSource.length);
+ else
+ size = this._getMultipleAxisScrollingSize();
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "width";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "height";
+ this.repeaterContainer.style[axis] = (size ? size + "px" : String.empty);
+ this.repeaterContainer.calculatedSize = size;
+ this.dispatchEvent("scrollSizeChanged")
+ }, _getMultipleAxisScrollingSize: function _getMultipleAxisScrollingSize() {
+ var itemCount;
+ var itemSize;
+ switch (this.virtualizationAxis) {
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal:
+ itemCount = this._workingDataSource.length / Math.floor(this._getVerticalAxisItemCount(this.viewportHeight));
+ itemSize = this.itemSize.width;
+ break;
+ case MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical:
+ itemCount = this._workingDataSource.length / Math.floor(this._getHorizontalAxisItemCount(this.viewportWidth));
+ itemSize = this.itemSize.height;
+ break;
+ default:
+ MS.Entertainment.UI.Controls.fail("Unexpected Axis: " + this.virtualizationAxis);
+ itemCount = 0;
+ itemSize = 0;
+ break
+ }
+ itemCount = Math.ceil(itemCount);
+ return itemSize * itemCount
+ }, processItemData: function processItemData(data, index) {
+ return data
+ }, bringItemIntoView: function bringItemIntoView(item, options) {
+ options = options || {};
+ MS.Entertainment.UI.Controls.assert(item, "You need an item to bring into view");
+ var itemBroughtIntoView = WinJS.Promise.as();
+ if (!item)
+ return itemBroughtIntoView;
+ if (!this._workingDataSource) {
+ var pendeditem = {
+ item: item, completePromise: null
+ };
+ this._pendedBringItemIntoViewItem = pendeditem;
+ return new WinJS.Promise(function(c) {
+ pendeditem.completePromise = c
+ })
+ }
+ var index = this._workingDataSource ? this._workingDataSource.indexOf(item) : -1;
+ MS.Entertainment.assert(index > -1, "item not found in data source");
+ var element = this.repeaterContainer.children[index];
+ if (!element) {
+ var pendeditem = {
+ item: item, completePromise: null
+ };
+ this._pendedBringItemIntoViewItem = pendeditem;
+ return new WinJS.Promise(function(c) {
+ pendeditem.completePromise = c
+ })
+ }
+ if (!options.bringOnMinimally && !options.animated)
+ element.scrollIntoView();
+ else {
+ var targetPosition = this.getScrollPositionToShowItem(item, {
+ bringOnMinimally: options.bringOnMinimally, alwaysAlignLeftEdge: options.alwaysAlignLeftEdge
+ });
+ if (targetPosition != -1)
+ itemBroughtIntoView = this._performScroll(targetPosition, options.animated, options.ignoreMissingStarts)
+ }
+ return itemBroughtIntoView
+ }, scrollToPosition: function scrollToPosition(scrollPosition, options) {
+ this._performScroll(scrollPosition, options.animated, options.ignoreMissingStarts, options.useZoomTo)
+ }, getScrollPositionToShowItemFromIndex: function getScrollPositionToShowItemFromIndex(index) {
+ if (this.singleAxis) {
+ if (index === 0)
+ return 0;
+ return Math.min(this.firstItemScrollOffset + ((index - 1) * this.itemSize), (this._scroller.scrollWidth - this.scrollerWidth))
+ }
+ else {
+ var verticalAxisItemCount = this.itemsPerColumn;
+ if (!verticalAxisItemCount)
+ return 0;
+ var column = Math.floor(index / verticalAxisItemCount);
+ return Math.min(this.firstItemScrollOffset + ((column - 1) * this.itemSize.width), (this._scroller.scrollWidth - this.scrollerWidth))
+ }
+ }, getScrollPositionToShowItem: function(item, options) {
+ options = options || {};
+ var result = -1;
+ MS.Entertainment.UI.Controls.assert(item, "Required an item");
+ if (!item)
+ return result;
+ var index = this._workingDataSource ? this._workingDataSource.indexOf(item) : -1;
+ MS.Entertainment.assert(index > -1, "item not found in data source");
+ var element = this.repeaterContainer.children[index];
+ if (!element)
+ return result;
+ var rightMargin = this.bringIntoViewRightMargin;
+ var leftMargin = this.bringIntoViewLeftMargin;
+ if (!options.bringOnMinimally) {
+ rightMargin = 0;
+ leftMargin = 0
+ }
+ var minRightEdgeOnScreen = (element.offsetLeft + element.clientWidth + rightMargin) - this._scroller.clientWidth;
+ var minLeftEdgeOnScreen = Math.max(0, element.offsetLeft - leftMargin);
+ if (MS.Entertainment.UI.Framework.getTextDirection() === MS.Entertainment.UI.Framework.TextDirections.RightToLeft) {
+ minLeftEdgeOnScreen = (this._scroller.clientWidth - element.offsetLeft - element.clientWidth - rightMargin);
+ minRightEdgeOnScreen = leftMargin - element.offsetLeft
+ }
+ var isRightEdgeOnScreen = this._scroller.scrollLeft >= minRightEdgeOnScreen;
+ var isLeftEdgeOnScreen = this._scroller.scrollLeft <= minLeftEdgeOnScreen;
+ var targetScrollPosition = -1;
+ if (options.alwaysAlignLeftEdge) {
+ minLeftEdgeOnScreen = Math.min(minLeftEdgeOnScreen, Math.max(0, (this._scroller.scrollWidth - this._scroller.clientWidth)));
+ targetScrollPosition = minLeftEdgeOnScreen
+ }
+ else if (!(isRightEdgeOnScreen && isLeftEdgeOnScreen))
+ if (!isRightEdgeOnScreen)
+ targetScrollPosition = minRightEdgeOnScreen;
+ else if (!isLeftEdgeOnScreen)
+ targetScrollPosition = minLeftEdgeOnScreen;
+ return targetScrollPosition
+ }, getElementForItem: function getElementForItem(item) {
+ var index = this._workingDataSource ? this._workingDataSource.indexOf(item) : -1;
+ return this.repeaterContainer.children[index]
+ }, getElementForIndex: function getElementForIndex(index) {
+ if (!(this.repeaterContainer && this.repeaterContainer.children)) {
+ MS.Entertainment.UI.Controls.fail("getElementForIndex called on items control with no repeater");
+ return null
+ }
+ return this.repeaterContainer.children[index]
+ }, getIndexForElement: function getElementForIndex(element) {
+ var currentItem = 0;
+ var returnIndex = -1;
+ if (this.repeaterContainer && this.repeaterContainer.children)
+ for (var i = 0; i < this.repeaterContainer.children.length; i++) {
+ currentItem = this.repeaterContainer.children[i];
+ if (currentItem === element || currentItem.contains(element)) {
+ returnIndex = i;
+ break
+ }
+ }
+ return returnIndex
+ }, _performScroll: function _performScroll(scrollLeft, animated, ignoreMissingStarts, useZoomTo) {
+ if (useZoomTo) {
+ this._scroller.msZoomTo({contentX: scrollLeft});
+ return WinJS.Promise.as()
+ }
+ if (!animated) {
+ this._scroller.scrollLeft = scrollLeft;
+ return WinJS.Promise.as()
+ }
+ return MS.Entertainment.UI.Framework.scrollIntoViewWithAnimation(this._scroller, scrollLeft, ignoreMissingStarts)
+ }, _loadTemplate: function _loadTemplate(template) {
+ var completePromise = WinJS.Promise.as(template);
+ if (!template)
+ completePromise = new WinJS.Promise(function(c, e, p) {
+ this._itemTemplateSet = c
+ }.bind(this));
+ completePromise = completePromise.then(function(validTemplate) {
+ if (typeof validTemplate === "string")
+ return MS.Entertainment.UI.Framework.loadTemplate(validTemplate, null, true);
+ else if (validTemplate)
+ return WinJS.Promise.wrap(validTemplate.winControl)
+ });
+ return completePromise
+ }, _listChangedHandler: function _listChangedHandler(newValue, oldValue) {
+ if (this._unloaded)
+ return;
+ if (!newValue) {
+ if (this._workingDataSource) {
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = null;
+ this._resetDomState()
+ }
+ if (newValue === null && this.itemsRendered)
+ this.itemsRendered();
+ return
+ }
+ if (this._workingDataSource)
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ var tempWorkingData = WinJS.Binding.unwrap(newValue);
+ if (!(newValue instanceof MS.Entertainment.ObservableArray))
+ tempWorkingData = new MS.Entertainment.ObservableArray(newValue);
+ if (tempWorkingData)
+ tempWorkingData.addChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = tempWorkingData;
+ if (this.itemsChanged)
+ this.itemsChanged();
+ if (newValue || oldValue) {
+ if (this._firstTimeRenderCompleted)
+ this._resetDomState();
+ this.render(newValue && oldValue)
+ }
+ }, _renderItem: function _renderItemToIndex(item, index) {
+ if (this.virtualize) {
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this._workingDataSource.length, "Found more children that we should have had");
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this.dataSource.length, "Found more children that we should have had")
+ }
+ if (!this._isIndexInRealizedArea(index))
+ return;
+ item = this.processItemData(item, index);
+ var container = null;
+ var selectionPromise = null;
+ if (!this._firstTimeRenderCompleted && index < this.repeaterContainer.children.length) {
+ container = this.repeaterContainer.children[index];
+ selectionPromise = WinJS.Promise.as(this._declarativeRenderHelper)
+ }
+ else
+ selectionPromise = this.selectTemplate(item);
+ selectionPromise.then(function withSelectedTemplate(itemTemplateProvider) {
+ var element;
+ if (!container)
+ container = document.createElement(itemTemplateProvider.element.tagName);
+ var that = this;
+ var upperBound = (this._workingDataSource && this._workingDataSource.length - 1) || 0;
+ var end;
+ var start;
+ if (upperBound < 0)
+ upperBound = 0;
+ end = (index >= upperBound) || (index === undefined);
+ start = (index < 1);
+ if (!end || !(end && start) && index)
+ element = this.repeaterContainer.children[index];
+ if (end || (end && start) || !element)
+ that.repeaterContainer.appendChild(container);
+ else
+ that.repeaterContainer.insertBefore(container, element);
+ if (that.containerStyle)
+ WinJS.Utilities.addClass(container, that.containerStyle);
+ if (this.virtualize) {
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this._workingDataSource.length, "Found more children that we should have had");
+ MS.Entertainment.UI.Controls.assert(this.repeaterContainer.children.length <= this.dataSource.length, "Found more children that we should have had")
+ }
+ itemTemplateProvider.render(item, container).then(function(child) {
+ var animationPromise;
+ if (that.applyItemTemplate)
+ container = that.applyItemTemplate(container, item, index);
+ if (that._pendedBringItemIntoViewItem && that._pendedBringItemIntoViewItem.item === item) {
+ var complete = that._pendedBringItemIntoViewItem.completePromise;
+ that._pendedBringItemIntoViewItem = null;
+ that.bringItemIntoView(item, {bringOnMinimally: true}).then(complete)
+ }
+ if (container && that.animateIn && MS.Entertainment.UI.Framework.beginShowAnimations) {
+ var elementToAnimate = container;
+ if (that.useFirstChildForAnimations && container.children.length)
+ elementToAnimate = container.children[0];
+ animationPromise = MS.Entertainment.UI.Framework.beginShowAnimations(elementToAnimate)
+ }
+ if (that._firstTimeRenderedCount > 0) {
+ that._firstTimeRenderedCount--;
+ if (that._firstTimeRenderedCount === 0)
+ that._sendFirstTimeRenderedEvent()
+ }
+ if (index === 0 && that.firstItemTabIndex !== -1) {
+ var firstFocusElement = container.querySelector(".win-focusable");
+ if (firstFocusElement)
+ firstFocusElement.tabIndex = that.firstItemTabIndex
+ }
+ if (index === 0 && that.focusFirstItemOnRender)
+ WinJS.Promise.as(animationPromise).done(function setFocusOnAnimationComplete() {
+ var firstFocusElement = container.querySelector(".win-focusable");
+ if (firstFocusElement)
+ MS.Entertainment.UI.Framework.focusElement(firstFocusElement)
+ });
+ if (that.delayInitializeChildren)
+ that._delayInitializeContainer(container);
+ that.dispatchEvent("itemRendered", {
+ element: container, item: item, index: index
+ })
+ })
+ }.bind(this))
+ }, itemsRendered: function itemsRendered() {
+ if (this.raisePanelReady)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReady(this.repeaterContainer);
+ if (MS.Entertainment.UI.Controls.Panel)
+ MS.Entertainment.UI.Controls.Panel.raisePanelReadyTest(this.repeaterContainer);
+ if (this.itemsRenderedCallback)
+ this.itemsRenderedCallback()
+ }, _delayInitializeContainer: function _delayInitializeContainer(container) {
+ if (!this.isDelayInitialized || !container || this._unloaded)
+ return;
+ MS.Entertainment.UI.Framework.delayInitializeChildren(container)
+ }, _sendFirstTimeRenderedEvent: function _sendFirstTimeRenderedEvent() {
+ WinJS.Promise.timeout(1).then(function sendFirstTimeRenderedEvent() {
+ this.isFirstTimeRendered = true;
+ if (this.repeaterContainer) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("firstTimeRendered", true, true);
+ this.repeaterContainer.dispatchEvent(domEvent)
+ }
+ }.bind(this))
+ }, _removeChildrenFromIndex: function _removeChildrenFromIndex(index) {
+ for (var i = this.repeaterContainer.children.length - 1; i >= index; i--)
+ this.repeaterContainer.removeChild(this.repeaterContainer.children[i])
+ }, _resetDomState: function _resetDomState() {
+ MS.Entertainment.UI.Framework.empty(this.repeaterContainer);
+ this._resetVirtualizationCaches()
+ }, _handleChangesInDataSource: function _handleChangesInDataSource(notification) {
+ if (this.itemsChanged)
+ this.itemsChanged(notification);
+ this._highestIndexItemToRender = -1;
+ switch (notification.type) {
+ case MS.Entertainment.ObservableArray.OperationTypes.add:
+ if (this.virtualize && !this._isIndexInRealizedArea(notification.index))
+ this._removeChildrenFromIndex(notification.index);
+ else
+ this._renderItem(notification.item, notification.index);
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.remove:
+ var child = this.repeaterContainer.children[notification.index];
+ if (child) {
+ this.repeaterContainer.removeChild(child);
+ if (this._handleItemRemoved)
+ this._handleItemRemoved(child);
+ if (this.virtualize && !this._isIndexInRealizedArea(notification.index))
+ this._removeChildrenFromIndex(notification.index);
+ this._scrollLeftPosition = -1
+ }
+ if (this.virtualize)
+ this._ensureRealizedToRealizedItemLimit();
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.reset:
+ this._resetDomState();
+ break;
+ default:
+ MS.Entertainment.assert(false, "unsupported notification type: " + notification.type);
+ break
+ }
+ this._setSizeForScrolling()
+ }
+ }, null, {
+ waitForItemsControlRenderEvents: function waitForItemsControlRenderEvents(domElement, numEvents) {
+ return MS.Entertainment.Utilities.waitForDomEventMultipleTimes("firstTimeRendered", domElement, numEvents)
+ }, loadAllItemTemplates: function loadAllItemTemplates() {
+ MS.Entertainment.UI.Controls.assert(Array.isArray(this.itemTemplate), "expected an array");
+ var templateLoadPromises = this.itemTemplate.map(function(templatePath) {
+ return MS.Entertainment.UI.Framework.loadTemplate(templatePath, null, true)
+ });
+ return WinJS.Promise.join(templateLoadPromises)
+ }, handleItemsChanged: function handleItemsChanged(domElement, numEvents) {
+ if (this.repeaterContainer.contains(document.activeElement))
+ this._restoreFocusAfterRender = true;
+ WinJS.Promise.timeout(700).done(function restoreFocus() {
+ if (!document.activeElement && this._restoreFocusAfterRender && MS.Entertainment.UI.Framework.canMoveFocus(this.repeaterContainer))
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.repeaterContainer);
+ this._restoreFocusAfterRender = false
+ }.bind(this))
+ }, ContainerStyles: {
+ none: "", horizontalFlow: "horizontalFlow", verticalFlow: "verticalFlow", listFlowLeft: "listFlowLeft"
+ }, VirtualizationAxis: {
+ horizontal: "horizontal", vertical: "vertical"
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FlexibleItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function(element, options) {
+ WinJS.Utilities.addClass(element, "flexibleItemsControlContainer");
+ this.applyPanelTemplate = this.applyPanelTemplate.bind(this);
+ this.onItemClicked = this._onItemClicked.bind(this)
+ }, {
+ dataContext: null, itemTemplates: null, itemSize: null, rowLayout: false, fixedRowCount: null, fixedColumnCount: null, skipSettingWidth: false, skipSettingHeight: false, reflowOnWindowSizeChanged: false, restoreFocusOnUpdate: false, restoreFocusAfterBackNavigate: false, enableClickEvents: false, _loadTemplatePromise: null, _restoreFocusAfterRender: false, _restoreFocusAfterBackNavigate: false, applyPanelTemplate: function applyPanelTemplate() {
+ var dataLength = this._workingDataSource ? this._workingDataSource.length : 1;
+ var rowCount;
+ var columnCount;
+ var hasFixedRowCount = typeof this.fixedRowCount === "number";
+ var hasFixedColumnCount = typeof this.fixedColumnCount === "number";
+ if (hasFixedRowCount && !hasFixedColumnCount) {
+ rowCount = this.fixedRowCount;
+ columnCount = Math.max(Math.ceil(dataLength / rowCount), 1)
+ }
+ else if (!hasFixedRowCount && hasFixedColumnCount) {
+ columnCount = this.fixedColumnCount;
+ rowCount = Math.max(Math.ceil(dataLength / columnCount), 1)
+ }
+ else if (hasFixedRowCount && hasFixedColumnCount) {
+ rowCount = this.fixedRowCount;
+ columnCount = this.fixedColumnCount
+ }
+ else {
+ rowCount = MS.Entertainment.Utilities.getRowCountForResolution();
+ columnCount = Math.max(Math.ceil(dataLength / rowCount), 1)
+ }
+ MS.Entertainment.UI.Controls.assert(dataLength <= (rowCount * columnCount), "FlexibleItemsControl_applyPanelTemplate: Items don't fit in the container.");
+ var explicitWidth = (columnCount * this.itemSize.width) + "px";
+ var explicitHeight = (rowCount * this.itemSize.height) + "px";
+ if (!this.skipSettingWidth && this.repeaterContainer.style.width !== explicitWidth)
+ this.repeaterContainer.style.width = explicitWidth;
+ if (!this.skipSettingHeight && this.repeaterContainer.style.height !== explicitHeight)
+ this.repeaterContainer.style.height = explicitHeight;
+ if (this.rowLayout)
+ WinJS.Utilities.addClass(this.repeaterContainer, "flexRowLayout");
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("SizeAdjusted", true, true);
+ this.repeaterContainer.dispatchEvent(domEvent)
+ }, itemsChanged: function itemsChanged() {
+ if (this.restoreFocusOnUpdate && this.repeaterContainer.contains(document.activeElement))
+ this._restoreFocusAfterRender = true;
+ this.applyPanelTemplate();
+ WinJS.Promise.timeout(1).done(function restoreFocus() {
+ if (!document.activeElement)
+ this.restoreFocus()
+ }.bind(this))
+ }, restoreFocus: function restoreFocus() {
+ if ((this._restoreFocusAfterRender || this._restoreFocusAfterBackNavigate) && MS.Entertainment.UI.Framework.canMoveFocus(this.repeaterContainer)) {
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(this.repeaterContainer);
+ this._restoreFocusAfterBackNavigate = false
+ }
+ this._restoreFocusAfterRender = false
+ }, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.apply(this, arguments);
+ if (this.reflowOnWindowSizeChanged && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).addEventListener("windowresize", this.applyPanelTemplate);
+ if (this.enableClickEvents)
+ this.repeaterContainer.addEventListener("click", this.onItemClicked)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.thaw.call(this);
+ if (this.dataContext && this.dataContext.thaw)
+ this.dataContext.thaw();
+ if (!document.activeElement && this.restoreFocusAfterBackNavigate)
+ this.restoreFocus()
+ }, unload: function unload() {
+ if (this.reflowOnWindowSizeChanged && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.uiState))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).removeEventListener("windowresize", this.applyPanelTemplate);
+ if (this.enableClickEvents)
+ this.repeaterContainer.removeEventListener("click", this.onItemClicked);
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, applyItemTemplate: function applyItemTemplate(container, item, index) {
+ WinJS.Utilities.addClass(container, "flexibleItemsControlItemContainer");
+ if (index !== null && index !== undefined) {
+ WinJS.Utilities.addClass(container, "item" + index);
+ if (item && item.automaticFocusOverride) {
+ var focusItem = container.querySelector(".win-focusable");
+ if (focusItem)
+ focusItem.setAttribute("data-win-focus", item.automaticFocusOverride)
+ }
+ }
+ return container
+ }, resetItemTemplate: function resetItemTemplate() {
+ if (this._loadTemplatePromise) {
+ this._loadTemplatePromise.cancel();
+ this._loadTemplatePromise = null
+ }
+ this.loadItemTemplate()
+ }, loadItemTemplate: function() {
+ MS.Entertainment.UI.Controls.assert(!this.itemTemplate, "Do not support non-array template");
+ MS.Entertainment.UI.Controls.assert(Array.isArray(this.itemTemplates), "expected an array");
+ if (this._loadTemplatePromise)
+ return this._loadTemplatePromise;
+ var templateLoadPromises = [];
+ var loadedTemplates = {};
+ this.itemTemplates.forEach(function(item) {
+ var promise = MS.Entertainment.UI.Framework.loadTemplate(item.template, null, true).then(function(template) {
+ loadedTemplates[item.value] = template
+ });
+ templateLoadPromises.push(promise)
+ });
+ this._loadTemplatePromise = WinJS.Promise.join(templateLoadPromises).then(function() {
+ this._itemTemplateProviders = loadedTemplates
+ }.bind(this));
+ return this._loadTemplatePromise
+ }, selectTemplate: function selectTemplate(item) {
+ return this.loadItemTemplate().then(function() {
+ var propertyValue = WinJS.Utilities.getMember(this._getPropertyToCheck(item), item);
+ MS.Entertainment.UI.Controls.assert(propertyValue, "Couldn't find that property on the data, it was falsey.");
+ var template = this._itemTemplateProviders[propertyValue];
+ MS.Entertainment.UI.Controls.assert(template, "Couldn't find a template for property: " + this.propertyName + " with value: " + propertyValue);
+ return template
+ }.bind(this))
+ }, _getPropertyToCheck: function _getPropertyToCheck(item) {
+ if (!Array.isArray(this.propertyName))
+ return this.propertyName;
+ var propertyName;
+ for (var i = 0; i < this.propertyName.length; i++)
+ if (item[this.propertyName[i]]) {
+ propertyName = this.propertyName[i];
+ break
+ }
+ return propertyName
+ }, _onItemClicked: function _onItemClicked(e) {
+ var element = e.srcElement;
+ while (element && element !== this.repeaterContainer) {
+ if (element.clickDataContext && element.clickDataContext.doclick) {
+ element.clickDataContext.doclick({
+ target: element.clickDataContext, domElement: element
+ });
+ e.stopPropagation();
+ if (this.restoreFocusAfterBackNavigate)
+ this._restoreFocusAfterBackNavigate = true;
+ return
+ }
+ element = element.parentElement
+ }
+ }
+ }, {})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ DeclarativeItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, null, null, {isDeclarativeControlContainer: true}), DeclarativeItemsControlRenderHelper: MS.Entertainment.UI.Framework.define(function DeclarativeItemsControlRenderHelper(){}, {render: function render(dataContext, container) {
+ return WinJS.UI.processAll(container).then(function bindingProcessAllAfterControlProcessAll() {
+ return WinJS.Binding.processAll(container, dataContext)
+ }).then(function returnContainer() {
+ return container
+ })
+ }})
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ItemsControlWithViewModel: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function itemsControlWithViewModel(element, options){}, {
+ listViewModel: null, controlName: "ItemsControlWithViewModel", processItemData: function processItemData(itemData, index) {
+ return new MS.Entertainment.UI.Controls.ItemsControlViewModel(itemData, this.listViewModel, index)
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ItemsControlWithVariableSizeItems: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function ItemsControlWithVariableSizeItems(element, options) {
+ if (!this.getItemSize)
+ throw new Error("getItemSize function is required when using variable sized items");
+ }, {
+ virtualize: true, additionalScrollContainerPadding: 0, additionalItemsToRealize: 0, _restoreFocusPromise: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.call(this);
+ this._restoreFocus = this._restoreFocus.bind(this);
+ WinJS.Utilities.addClass(this.domElement, "listContainer")
+ }, unload: function unload() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.freeze.call(this)
+ }, getHighestItemToRenderForScrollPosition: function getHighestItemToRenderForScrollPosition(targetPosition) {
+ var itemCount = 0;
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "horizontal";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "vertical";
+ var currentHighestViewportPosition = targetPosition[axis] - this.firstItemScrollOffset;
+ var summedSize = 0;
+ var workingLength = this._workingDataSource.length;
+ while (summedSize < currentHighestViewportPosition && itemCount < workingLength) {
+ summedSize += this.getItemSize(this._workingDataSource.item(itemCount), itemCount);
+ itemCount++
+ }
+ if (this.additionalItemsToRealize) {
+ var adjustedItemIndex = Math.min(itemCount + this.additionalItemsToRealize, workingLength);
+ itemCount = adjustedItemIndex
+ }
+ return itemCount
+ }, getScrollPositionToShowItemFromIndex: function getScrollPositionToShowItemFromIndex(index) {
+ var summedSize = 0;
+ for (var i = 0; i < index - 1; i++)
+ summedSize += this.getItemSize(this._workingDataSource.item(i), i);
+ return summedSize
+ }, _setSizeForScrolling: function _setSizeForScrolling() {
+ if (!(this.useParentAsScrollContainer && this.virtualize))
+ return;
+ var size = String.empty;
+ if (this._workingDataSource && this._workingDataSource.length) {
+ var summedSize = 0;
+ this._workingDataSource.forEach(function sumItemSize(item, index) {
+ summedSize += this.getItemSize(item, index)
+ }.bind(this));
+ summedSize += this.additionalScrollContainerPadding;
+ size = summedSize + "px"
+ }
+ var axis;
+ if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.horizontal)
+ axis = "width";
+ else if (this.virtualizationAxis === MS.Entertainment.UI.Controls.ItemsControl.VirtualizationAxis.vertical)
+ axis = "height";
+ this.repeaterContainer.style[axis] = size;
+ this.repeaterContainer.calculatedSize = size;
+ this.dispatchEvent("scrollSizeChanged")
+ }, getItemSizeForIndex: function getItemSizeForIndex(index) {
+ if (index < this._workingDataSource.length)
+ return this.getItemSize(this._workingDataSource.item(index))
+ }, itemsRendered: function itemsRendered() {
+ if (this.focusFirstItemOnRender)
+ this._restoreFocus();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.itemsRendered.call(this)
+ }, _restoreFocus: function _restoreFocus() {
+ this._clearFocusPromise();
+ var firstItemFocused = false;
+ if (this._unloaded)
+ return;
+ if (!MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer)) {
+ var firstItemFromSelector = this.repeaterContainer.querySelector(".listContainer > :first-child .win-focusable");
+ if (firstItemFromSelector)
+ MS.Entertainment.UI.Framework.focusElement(firstItemFromSelector)
+ }
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer))
+ firstItemFocused = true;
+ if (!firstItemFocused)
+ this._createFocusPromise()
+ }, _createFocusPromise: function _createFocusPromise(timeout) {
+ timeout = isNaN(timeout) ? 100 : timeout;
+ this._clearFocusPromise();
+ this._restoreFocusPromise = WinJS.Promise.timeout(timeout).then(this._restoreFocus)
+ }, _clearFocusPromise: function _clearFocusPromise() {
+ if (this._restoreFocusPromise) {
+ this._restoreFocusPromise.cancel();
+ this._restoreFocusPromise = null
+ }
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {ItemsControlViewModel: MS.Entertainment.UI.Framework.define(function itemsControlViewModel(data, listViewModel, index) {
+ this.data = data;
+ this.listViewModel = listViewModel;
+ this.index = index
+ }, {
+ listViewModel: null, data: null, index: -1, instance: {get: function() {
+ return this
+ }}
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {CarouselItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function carouselItemsControl(element, options) {
+ this.delayInitializeChildren = true;
+ if (!this.itemSize)
+ throw new Error("itemSize required when using a carousel");
+ if (!this.virtualizationAxis)
+ throw new Error("virtualizationOrientation required when using virtualization");
+ }, {
+ controlName: "CarouselItemsControl", leftOffset: 0, maxLeftOffset: 0, marginLeftOffset: 0, transitionDuration: 0, _defaultTimeoutMS: 500, _defaultTransitionDuration: 100, applyPanelTemplate: function applyPanelTemplate() {
+ if (this._workingDataSource) {
+ this.repeaterContainer.style.marginLeft = (this.marginLeftOffset - ((this.maxLeftOffset - this.leftOffset) * this.itemSize)) + "px";
+ var marginLeft = WinJS.Utilities.convertToPixels(this.repeaterContainer, window.getComputedStyle(this.repeaterContainer, null)["margin-Left"]);
+ var marginRight = WinJS.Utilities.convertToPixels(this.repeaterContainer, window.getComputedStyle(this.repeaterContainer, null)["margin-Right"]);
+ var buffer = marginLeft + marginRight;
+ this.repeaterContainer.style.width = (this._workingDataSource.length * this.itemSize + buffer) + "px"
+ }
+ }, applyItemTemplate: function applyItemTemplate(container, item, index) {
+ return container
+ }, scrollAnimated: function scrollAnimated(count, removeIndex, timeout) {
+ if (count === 0)
+ return WinJS.Promise.as();
+ if (!MS.Entertainment.UI.Framework.animationsEnabled)
+ return WinJS.Promise.as();
+ var translateDelta = -count * this.itemSize;
+ if (this.repeaterContainer.isAnimatingScroll)
+ return WinJS.Promise.as();
+ var updateItemPosition = function updateItemPosition() {
+ var marginLeft;
+ var actualOffsetLeft = (this.maxLeftOffset - this.leftOffset);
+ var actualOffset = actualOffsetLeft * this.itemSize;
+ marginLeft = (this.marginLeftOffset - actualOffset) + "px";
+ if (removeIndex >= 0) {
+ if (this.repeaterContainer.children.length > removeIndex) {
+ var child = this.repeaterContainer.children[removeIndex];
+ WinJS.Utilities.addClass(child, "removeFromDisplay")
+ }
+ this.dataSource.removeAt(removeIndex)
+ }
+ this.repeaterContainer.style.marginLeft = marginLeft;
+ WinJS.Utilities.removeClass(this.repeaterContainer, "scrollAnimation");
+ this.repeaterContainer.style.msTransform = "";
+ this.repeaterContainer.isAnimatingScroll = null
+ }.bind(this);
+ timeout = timeout || this._defaultTimeoutMS;
+ var timeoutPromise = WinJS.Promise.timeout(timeout).then(function resetAnimatingFlag() {
+ scrollComplete.cancel();
+ timeoutPromise = null
+ }.bind(this));
+ var scrollComplete = this.repeaterContainer.isAnimatingScroll;
+ if (!scrollComplete)
+ scrollComplete = MS.Entertainment.UI.Framework.waitForStartedTransitionsToComplete(this.repeaterContainer.parentElement, true, "scrollAnimation").then(function() {
+ if (timeoutPromise) {
+ timeoutPromise.cancel();
+ timeoutPromise = null
+ }
+ updateItemPosition()
+ }.bind(this), function animationFailed() {
+ updateItemPosition()
+ }.bind(this));
+ else
+ MS.Entertainment.UI.Framework.resetStartedTransitionCount(this.repeaterContainer);
+ WinJS.Utilities.addClass(this.repeaterContainer, "scrollAnimation");
+ var transformStyle = "translateX(" + translateDelta + "px)";
+ var duration = this._defaultTransitionDuration;
+ this.repeaterContainer.transitionDuration = duration;
+ this.repeaterContainer.style.msTransform = transformStyle;
+ this.repeaterContainer.isAnimatingScroll = scrollComplete;
+ return scrollComplete
+ }
+ })});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {FocusHandlingItemsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, null, {
+ _restoreFocusPromise: null, _actionsHadFocusOnButtonChange: false, ignoreNextRestoreFocus: false, useSetActive: false, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.call(this);
+ this._restoreFocus = this._restoreFocus.bind(this);
+ WinJS.Utilities.addClass(this.domElement, "listContainer")
+ }, unload: function unload() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ this._clearFocusPromise();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.freeze.call(this)
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.thaw.call(this);
+ this.restoreFocus()
+ }, itemsRendered: function itemsRendered() {
+ WinJS.Promise.timeout(1).done(function raiseReadyEvent() {
+ if (this.repeaterContainer) {
+ var domEvent = document.createEvent("Event");
+ domEvent.initEvent("itemsReady", true, true);
+ this.repeaterContainer.dispatchEvent(domEvent)
+ }
+ }.bind(this))
+ }, restoreFocus: function restoreFocus(forceSetFocus) {
+ if (this._frozen || this._unloaded)
+ return;
+ if (this.ignoreNextRestoreFocus) {
+ this.ignoreNextRestoreFocus = false;
+ return
+ }
+ this._clearFocusPromise();
+ if (forceSetFocus)
+ this._actionsHadFocusOnButtonChange = forceSetFocus;
+ if (!this._actionsHadFocusOnButtonChange)
+ return;
+ this._createFocusPromise()
+ }, _restoreFocus: function _restoreFocus() {
+ this._clearFocusPromise();
+ if (this._frozen || this._unloaded)
+ return;
+ if (MS.Entertainment.UI.Framework.isFlyoutVisible())
+ return;
+ if (MS.Entertainment.UI.Framework.isFlyoutVisible())
+ return;
+ if (this._actionsHadFocusOnButtonChange && !MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer)) {
+ var firstItemFromSelector = this.repeaterContainer.querySelector(".listContainer > :first-child .win-focusable");
+ if (firstItemFromSelector)
+ MS.Entertainment.UI.Framework.focusElement(firstItemFromSelector, this.useSetActive)
+ }
+ if (MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer))
+ this._actionsHadFocusOnButtonChange = false;
+ if (this._actionsHadFocusOnButtonChange)
+ this._createFocusPromise()
+ }, _listChangedHandler: function _listChangedHandler(newValue, oldValue) {
+ if (this._unloaded)
+ return;
+ this._actionsHadFocusOnButtonChange = this._actionsHadFocusOnButtonChange || !document.activeElement || MS.Entertainment.UI.Framework.focusedItemInContainer(this.repeaterContainer);
+ MS.Entertainment.UI.Controls.ItemsControl.prototype._listChangedHandler.apply(this, arguments)
+ }, _createFocusPromise: function _createFocusPromise(timeout) {
+ timeout = isNaN(timeout) ? 100 : timeout;
+ this._clearFocusPromise();
+ this._restoreFocusPromise = WinJS.Promise.timeout(timeout).then(this._restoreFocus)
+ }, _clearFocusPromise: function _clearFocusPromise() {
+ if (this._restoreFocusPromise) {
+ this._restoreFocusPromise.cancel();
+ this._restoreFocusPromise = null
+ }
+ }
+ })})
+})()
+})();
+/* >>>>>>/framework/selectionmanager.js:24380 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.Framework");
+ WinJS.Namespace.define("MS.Entertainment.UI.Framework", {SelectionManager: MS.Entertainment.UI.Framework.derive("MS.Entertainment.UI.Framework.ObservableBase", function selectionManager(dataSource, defaultSelectionIndex, settingsKey, overrideUserSettingOnce) {
+ MS.Entertainment.UI.Framework.ObservableBase.prototype.constructor.call(this);
+ this._handleChangesInDataSource = this._handleChangesInDataSource.bind(this);
+ this._dataSource = dataSource;
+ this._settingsKey = settingsKey;
+ this._defaultSelectionIndex = defaultSelectionIndex;
+ this._overrideUserSettingOnce = !!overrideUserSettingOnce;
+ this._updateWorkingDataSource();
+ this._updateDefaultSelection();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.enableSaving = !configurationManager.shell.preventSelectionManagerSettingSaves
+ }, {
+ _dataSource: null, _workingDataSource: null, _bindings: null, _settingsKey: null, _overrideUserSettingOnce: false, _isRoamingSetting: true, _defaultSelectionIndex: -1, _selectedItem: null, _selectedIndex: -1, _disposed: false, enableSaving: true, compareById: false, dispose: function dispose() {
+ if (this._bindings) {
+ this._bindings.cancel();
+ this._bindings = null
+ }
+ this._setSelected(this._selectedItem, false);
+ this._dataSource = null;
+ this._selectedItem = null;
+ this._disposed = true
+ }, dataSource: {
+ get: function() {
+ return this._dataSource
+ }, set: function(value) {
+ value = WinJS.Binding.unwrap(value);
+ var oldValue = this._dataSource;
+ var nullOrArray = !value || Array.isArray(value) || value instanceof MS.Entertainment.ObservableArray;
+ MS.Entertainment.UI.Framework.assert(nullOrArray, "Source was not an array. Only array's are supported");
+ if (value !== this._dataSource && nullOrArray && !this._disposed) {
+ this.updateAndNotify("dataSource", value);
+ this._updateWorkingDataSource();
+ this._updateDefaultSelection()
+ }
+ }
+ }, defaultSelectionIndex: {
+ get: function() {
+ return this._defaultSelectionIndex
+ }, set: function(value) {
+ this.updateAndNotify("defaultSelectionIndex", value)
+ }
+ }, isRoamingSetting: {
+ get: function() {
+ return this._isRoamingSetting
+ }, set: function(value) {
+ var oldValue = this._isRoamingSetting;
+ if (value !== this._isRoamingSetting) {
+ this._isRoamingSetting = value;
+ this.saveSelection();
+ this.dispatchChangeAndNotify("isRoamingSetting", value, oldValue)
+ }
+ }
+ }, settingsKey: {
+ get: function() {
+ return this._settingsKey
+ }, set: function(value) {
+ this.updateAndNotify("settingsKey", value)
+ }
+ }, selectedIndex: {
+ get: function() {
+ return this._selectedIndex
+ }, set: function(value) {
+ if (value !== this._selectedIndex) {
+ var oldValue = this._selectedIndex;
+ this._selectedIndex = value;
+ this._onSelectedIndexChanged(value, oldValue)
+ }
+ }
+ }, selectedItem: {
+ get: function() {
+ return this._item(this.selectedIndex)
+ }, set: function(value) {
+ var oldValue = WinJS.Binding.unwrap(this.selectedItem);
+ value = WinJS.Binding.unwrap(value);
+ if (value !== oldValue) {
+ var index = -1;
+ if (this._workingDataSource)
+ for (var i = 0; i < this._workingDataSource.length; i++)
+ if (WinJS.Binding.unwrap(this._workingDataSource.item(i)) === value) {
+ index = i;
+ break
+ }
+ this.selectedIndex = index
+ }
+ }
+ }, clear: function clear() {
+ if (this._selectedIndex !== -1) {
+ var oldValue = this._selectedIndex;
+ this._selectedIndex = -1;
+ this._onSelectedIndexChanged(this._selectedIndex, oldValue)
+ }
+ }, reselect: function reselect() {
+ this.dispatchEvent(MS.Entertainment.UI.Framework.SelectionManager.events.reselected, {
+ sender: this, selection: {
+ item: this.selectedItem, index: this.selectedIndex
+ }
+ })
+ }, _setSelected: function _setSelected(item, value) {
+ if (item && item instanceof Object && "selected" in item)
+ item.selected = value
+ }, _item: function _item(index) {
+ return (this._workingDataSource && index >= 0 && index < this._workingDataSource.length) ? this._workingDataSource.item(index) : null
+ }, _indexFromId: function _indexFromId(id) {
+ var index = -1;
+ if (this._workingDataSource)
+ this._workingDataSource.some(function(item, itemIndex) {
+ if (item && item.id === id) {
+ index = itemIndex;
+ return true
+ }
+ });
+ return index
+ }, _indexFromSettingsValue: function _indexFromSettingsValue(settingsValue) {
+ var index = settingsValue;
+ if (this.compareById)
+ index = this._indexFromId(settingsValue);
+ return index
+ }, _settingsValueFromIndex: function _settinsValueFromIndex(index) {
+ var settingsValue = index;
+ if (this.compareById) {
+ var item = this._item(index);
+ settingsValue = item && item.id;
+ settingsValue = settingsValue || String.empty
+ }
+ return settingsValue
+ }, _updateWorkingDataSource: function _updateWorkingDataSource() {
+ if (this._workingDataSource)
+ this._workingDataSource.removeChangeListener(this._handleChangesInDataSource);
+ if (!this._dataSource) {
+ this._workingDataSource = null;
+ return
+ }
+ var tempWorkingData = WinJS.Binding.unwrap(this._dataSource);
+ if (!(this._dataSource instanceof MS.Entertainment.ObservableArray))
+ tempWorkingData = new MS.Entertainment.ObservableArray(this._dataSource);
+ if (tempWorkingData)
+ tempWorkingData.addChangeListener(this._handleChangesInDataSource);
+ this._workingDataSource = tempWorkingData
+ }, _updateDefaultSelection: function _updateDefaultSelection() {
+ var newIndex = -1;
+ if (this.settingsKey && this.enableSaving)
+ if (this.isRoamingSetting && !MS.Entertainment.Utilities.isVideoApp2)
+ newIndex = this._indexFromSettingsValue(MS.Entertainment.Utilities.getUserRoamingSetting(this.settingsKey));
+ else
+ newIndex = this._indexFromSettingsValue(Windows.Storage.ApplicationData.current.localSettings.values[this.settingsKey]);
+ if (this._overrideUserSettingOnce || newIndex < 0 || isNaN(newIndex) || (this._workingDataSource && newIndex >= this._workingDataSource.length))
+ newIndex = (isNaN(this._defaultSelectionIndex)) ? 0 : this._defaultSelectionIndex;
+ if (!this._workingDataSource || newIndex >= this._workingDataSource.length)
+ newIndex = -1;
+ if (newIndex !== this.selectedIndex)
+ this.selectedIndex = newIndex;
+ else if (newIndex >= 0)
+ this._onSelectedIndexChanged(newIndex, newIndex)
+ }, _onSelectedIndexChanged: function _onSelectedIndexChanged(newValue, oldValue) {
+ if (!this._disposed) {
+ var oldSelectedItem = this._selectedItem;
+ var newSelectedItem = this._item(newValue);
+ var selectedIndexChanged = newValue !== oldValue;
+ var selectedItemChanged = newSelectedItem !== oldSelectedItem;
+ this._setSelected(oldSelectedItem, false);
+ if (selectedIndexChanged)
+ this.dispatchChangeAndNotify("selectedIndex", newValue, oldValue);
+ if (selectedItemChanged)
+ this.notify("selectedItem", newSelectedItem, oldSelectedItem);
+ this._selectedItem = newSelectedItem;
+ this._setSelected(newSelectedItem, true);
+ if (!this._overrideUserSettingOnce)
+ this._saveSelection(newValue);
+ else
+ this._overrideUserSettingOnce = false;
+ if (selectedItemChanged)
+ this.dispatchEvent(MS.Entertainment.UI.Framework.SelectionManager.events.selectedItemChanged, {
+ sender: this, newSelection: {
+ item: newSelectedItem, index: newValue
+ }, oldSelection: {
+ item: oldSelectedItem, index: oldValue
+ }
+ })
+ }
+ }, saveSelection: function saveSelection() {
+ if (this.dataSource && this.dataSource.length)
+ this._saveSelection(this.selectedIndex)
+ }, _saveSelection: function _saveSelection(value) {
+ if (this.settingsKey && this.enableSaving && value >= 0)
+ if (this.isRoamingSetting && !MS.Entertainment.Utilities.isVideoApp2)
+ MS.Entertainment.Utilities.setUserRoamingSetting(this.settingsKey, this._settingsValueFromIndex(value));
+ else
+ Windows.Storage.ApplicationData.current.localSettings.values[this.settingsKey] = this._settingsValueFromIndex(value)
+ }, _handleChangesInDataSource: function _handleChangesInDataSource(notification) {
+ var newIndex = this.selectedIndex;
+ switch (notification.type) {
+ case MS.Entertainment.ObservableArray.OperationTypes.add:
+ if (notification.index <= this.selectedIndex)
+ this.selectedIndex = this.selectedIndex + 1;
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.remove:
+ if (notification.index <= this.selectedIndex && this.selectedIndex > 0)
+ this.selectedIndex = this.selectedIndex - 1;
+ else if (notification.index === this.selectedIndex)
+ this._onSelectedIndexChanged(notification.index, this.selectedIndex);
+ break;
+ case MS.Entertainment.ObservableArray.OperationTypes.reset:
+ this.selectedIndex = this._defaultSelectionIndex;
+ break;
+ default:
+ MS.Entertainment.UI.Controls.assert(false, "unsupported notification type: " + notification.type);
+ break
+ }
+ if (this.selectedIndex < 0 && this._workingDataSource.length > this._defaultSelectionIndex)
+ this.selectedIndex = this._defaultSelectionIndex
+ }
+ }, {events: {
+ selectedItemChanged: "selectedItemChanged", reselected: "reselected"
+ }})})
+})()
+})();
+/* >>>>>>/controls/pivotcontrols.js:24603 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {
+ PivotsControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControl", null, function pivotsControlConstructor() {
+ this._keyDown = this._keyDown.bind(this);
+ this._onGlobalKeyDown = this._onGlobalKeyDown.bind(this);
+ this.domElement.addEventListener("keydown", this._keyDown);
+ if (MS.Entertainment.Utilities.isApp2)
+ this.selectedIndex = 0
+ }, {
+ _applyItemTemplateCounter: 0, focusItemOnSelectedIndexChanged: true, manageDownNavigation: false, delayListeningForGlobalNavigation: false, _globalHandlerEvents: null, focusOverrideData: {down: '.currentPage .modifierControl:not([tabIndex=\'-1\'])'}, controlName: "PivotsControl", initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.initialize.call(this, arguments);
+ this.bind("selectedIndex", this._selectedIndexChanged.bind(this));
+ if (!this.delayListeningForGlobalNavigation)
+ this._listenForGlobalNavigation()
+ }, applyItemTemplate: function applyItemTemplate(container, dataContext, index) {
+ var child = container.children[0];
+ child.setAttribute("data-win-automationId", "pivot{0}".format(index));
+ child.pivotPropertyChangeHandler = this._onPropertyChange.bind(this);
+ MS.Entertainment.Utilities.attachPropertyChangeEvent(child, child.pivotPropertyChangeHandler);
+ if (MS.Entertainment.Utilities.isApp2 && this.manageDownNavigation && this.focusOverrideData)
+ child.setAttribute("data-win-focus", JSON.stringify(this.focusOverrideData));
+ if (this.isVoiceEnabled) {
+ this.addVoiceAttribute(child, true, false);
+ WinJS.Utilities.addClass(child, this.voiceTextStyle);
+ if (child.winControl && dataContext && dataContext.options && dataContext.options.voice)
+ this.updateVoiceProperties(child.winControl, dataContext.options.voice)
+ }
+ if (this.selectedIndex === this._applyItemTemplateCounter) {
+ child.setAttribute("tabindex", "0");
+ WinJS.Utilities.addClass(child, "selected");
+ child.setAttribute("aria-selected", true);
+ if (this.focusItemOnSelectedIndexChanged)
+ MS.Entertainment.UI.Framework.focusElement(child)
+ }
+ this._applyItemTemplateCounter++;
+ return container
+ }, setTabPanel: function setTabPanel(tabPanel) {
+ for (var i = 0; i < this.domElement.children.length; i++)
+ MS.Entertainment.Framework.AccUtils.createAndAddAriaLink(this._getChildDomElement(i), tabPanel, "aria-controls")
+ }, enableGlobalNavigation: function enableGlobalNavigation() {
+ this._listenForGlobalNavigation()
+ }, _onPropertyChange: function _onPropertyChange(evt) {
+ if (evt && evt.propertyName === "aria-selected")
+ if (evt.srcElement.getAttribute("aria-selected") === "true")
+ if (this.focusItemOnSelectedIndexChanged) {
+ MS.Entertainment.UI.Framework.focusElement(evt.srcElement);
+ evt.srcElement.click()
+ }
+ }, unload: function unload() {
+ for (var i = 0; i < this.domElement.children.length; i++) {
+ var childElement = this._getChildDomElement(i);
+ MS.Entertainment.Utilities.detachPropertyChangeEvent(childElement, childElement.pivotPropertyChangeHandler);
+ childElement.pivotPropertyChangeHandler = null
+ }
+ this._stopListeningForGlobalNavigation();
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.freeze.call(this);
+ this._stopListeningForGlobalNavigation()
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.ItemsControl.prototype.thaw.call(this);
+ this._listenForGlobalNavigation()
+ }, _listenForGlobalNavigation: function _listenForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ var currentPage = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "currentPage");
+ if (!currentPage)
+ return;
+ this._globalHandlerEvents = MS.Entertainment.Utilities.addEventHandlers(currentPage, {keydown: this._onGlobalKeyDown})
+ }, _stopListeningForGlobalNavigation: function _stopListeningForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (!this._globalHandlerEvents)
+ return;
+ this._globalHandlerEvents.cancel()
+ }, focusLogicalRight: function focusLogicalRight() {
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ return this._focusLogicalLeftImpl();
+ return this._focusLogicalRightImpl()
+ }, _focusLogicalRightImpl: function _focusLogicalRightImpl() {
+ if (this.selectedIndex < this.domElement.children.length - 1) {
+ var childElement = this._getChildDomElement(this.selectedIndex + 1);
+ if (MS.Entertainment.Utilities.isApp2)
+ childElement.setAttribute("tabindex", 0);
+ if (!MS.Entertainment.Utilities.isApp2 || this.domElement.contains(document.activeElement))
+ MS.Entertainment.UI.Framework.focusElement(childElement);
+ childElement.click()
+ }
+ return true
+ }, focusLogicalLeft: function focusLogicalLeft() {
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ return this._focusLogicalRightImpl();
+ return this._focusLogicalLeftImpl()
+ }, _focusLogicalLeftImpl: function _focusLogicalLeftImpl() {
+ if (this.selectedIndex > 0) {
+ var childElement = this._getChildDomElement(this.selectedIndex - 1);
+ if (MS.Entertainment.Utilities.isApp2)
+ childElement.setAttribute("tabindex", 0);
+ if (!MS.Entertainment.Utilities.isApp2 || this.domElement.contains(document.activeElement))
+ MS.Entertainment.UI.Framework.focusElement(childElement);
+ childElement.click();
+ return true
+ }
+ else
+ return false
+ }, _onGlobalKeyDown: function _onGlobalKeyDown(e) {
+ if (MS.Entertainment.Utilities.getDirectionFromGlobalKeyInput(e))
+ this._keyDown(e);
+ return
+ }, _keyDown: function _keyDown(e) {
+ if (MS.Entertainment.Utilities.isApp1 && e.altKey)
+ return;
+ var handled = false;
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rightArrow:
+ case WinJS.Utilities.Key.rArrow:
+ case WinJS.Utilities.Key.rOtherArrow:
+ case WinJS.Utilities.Key.rGlobal:
+ case WinJS.Utilities.Key.pageDown:
+ handled = this.focusLogicalRight();
+ break;
+ case WinJS.Utilities.Key.leftArrow:
+ case WinJS.Utilities.Key.lArrow:
+ case WinJS.Utilities.Key.lOtherArrow:
+ case WinJS.Utilities.Key.lGlobal:
+ case WinJS.Utilities.Key.pageUp:
+ handled = this.focusLogicalLeft();
+ break;
+ default:
+ return
+ }
+ if (handled) {
+ e.stopPropagation();
+ e.preventDefault()
+ }
+ }, _selectedIndexChanged: function _selectedIndexChanged(newIndex, oldIndex) {
+ for (var i = 0; i < this.domElement.children.length; i++) {
+ var childElement = this._getChildDomElement(i);
+ WinJS.Utilities.removeClass(childElement, "selected");
+ childElement.setAttribute("tabindex", -1);
+ childElement.setAttribute("aria-selected", false)
+ }
+ var newSelectedChildElement = this._getChildDomElement(newIndex);
+ if (newSelectedChildElement) {
+ WinJS.Utilities.addClass(newSelectedChildElement, "selected");
+ newSelectedChildElement.setAttribute("tabindex", "0");
+ newSelectedChildElement.setAttribute("aria-selected", true);
+ if (this.focusItemOnSelectedIndexChanged || (this.domElement && this.domElement.contains(document.activeElement)))
+ MS.Entertainment.UI.Framework.focusElement(newSelectedChildElement);
+ this.selectedIndex = newIndex
+ }
+ }, _getChildDomElement: function _getChildDomElement(index) {
+ if (index >= 0 && index < this.domElement.children.length)
+ return this.domElement.children[index].children[0];
+ return null
+ }, _selectedIndex: -1, selectedIndex: {
+ get: function() {
+ return this._selectedIndex
+ }, set: function(val) {
+ if (val === this._selectedIndex)
+ return;
+ var old = this._selectedIndex;
+ this._selectedIndex = val;
+ this.notify("selectedIndex", val, old)
+ }
+ }
+ }, {}), VerticalPivotControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.ItemsControlWithViewModel", null, null, {
+ _expandedItems: null, _expandBindings: null, _navigationControlEvents: null, _navigationControlBindings: null, _dividerTemplateProvider: null, _selectionManagerHandlers: null, _selectionManager: null, _tabPanelId: null, keyboardNavigable: true, keyboardNavigationManagerClass: MS.Entertainment.Framework.VerticalKeyboardNavigationManager, keyboardNavigationSetTabIndex: true, focusItemOnSelectedIndexChanged: true, dividers: true, reselectWhenAlreadySelected: false, containerStyle: MS.Entertainment.UI.Controls.ItemsControl.ContainerStyles.verticalFlow, itemTemplate: "/Controls/PivotControls.html#verticalPivotButtonTemplate", dividerTemplate: "/Controls/PivotControls.html#verticalDividerTemplate", initialize: function initialize() {
+ MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.initialize.call(this);
+ this._navigationControlEvents = MS.Entertainment.Utilities.addEvents(this, {
+ click: this._onClick.bind(this), keydown: this._onKeyDown.bind(this)
+ })
+ }, unload: function unload() {
+ if (this._navigationControlBindings) {
+ this._navigationControlBindings.cancel();
+ this._navigationControlBindings = null
+ }
+ if (this._expandBindings) {
+ this._expandBindings.cancel();
+ this._expandBindings = null
+ }
+ if (this._navigationControlEvents) {
+ this._navigationControlEvents.cancel();
+ this._navigationControlEvents = null
+ }
+ for (var i = 0; i < this.domElement.children.length; i++)
+ this._detachItemListeners(this.domElement.children[i]);
+ MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.unload.call(this)
+ }, selectionManager: {
+ get: function() {
+ return this._selectionManager
+ }, set: function(value) {
+ if (this._selectionManager !== value) {
+ var oldValue = this._selectionManager;
+ this._selectionManager = value;
+ if (this._navigationControlBindings) {
+ this._navigationControlBindings.cancel();
+ this._navigationControlBindings = null
+ }
+ if (this._selectionManagerEvents) {
+ this._selectionManagerEvents.cancel();
+ this._selectionManagerEvents = null
+ }
+ this._navigationControlBindings = WinJS.Binding.bind(this._selectionManager, {
+ dataSource: this._selectionManagerDataSourceChangeHandler.bind(this), selectedIndex: this._expand.bind(this)
+ });
+ this._selectionManagerEvents = MS.Entertainment.UI.Framework.addEventHandlers(this._selectionManager, {selectedItemChanged: this._selectedItemChanged.bind(this)});
+ this.notify("selectionManager", value, oldValue)
+ }
+ }
+ }, loadItemTemplate: function loadItemTemplate() {
+ if (!this.dividers)
+ return MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.loadItemTemplate.apply(this, arguments);
+ var completePromise;
+ if (!this._dividerTemplateProvider)
+ completePromise = this._loadTemplate(this.dividerTemplate);
+ else
+ completePromise = WinJS.Promise.wrap(this._dividerTemplateProvider);
+ return completePromise.then(function baseLoadTemplate(template) {
+ this._dividerTemplateProvider = template;
+ return MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.loadItemTemplate.apply(this)
+ }.bind(this))
+ }, selectTemplate: function(item) {
+ if (!this.dividers)
+ return MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype.selectTemplate.apply(this, arguments);
+ return this.loadItemTemplate().then(function() {
+ if (item && WinJS.Binding.unwrap(item.data) === MS.Entertainment.UI.Controls.VerticalPivotControl.divider)
+ return this._dividerTemplateProvider;
+ else
+ return this._itemTemplateProvider
+ }.bind(this))
+ }, applyItemTemplate: function applyItemTemplate(container, dataContext) {
+ var item = this._item(dataContext.index);
+ if (item) {
+ item.tabPanelId = this._tabPanelId;
+ if (container) {
+ var buttonElement = this._getButtonElementFromItem(container);
+ if (buttonElement) {
+ var automationId = this._getAutomationId(item);
+ if (automationId)
+ buttonElement.setAttribute("data-win-automationId", automationId + "_view");
+ buttonElement.pivotPropertyChangeHandler = this._onPropertyChange.bind(this);
+ MS.Entertainment.Utilities.attachPropertyChangeEvent(buttonElement, buttonElement.pivotPropertyChangeHandler);
+ if (item.selected) {
+ WinJS.Utilities.query(".win-focusable.selected", this.domElement).forEach(function(element) {
+ WinJS.Utilities.removeClass(element, "selected")
+ });
+ WinJS.Utilities.addClass(buttonElement, "selected")
+ }
+ if (item.selected || (dataContext.index === 0 && this.selectionManager && !this.selectionManager.selectedItem))
+ if (this.keyboardNavigable)
+ WinJS.Promise.timeout().done(function _setTabIndexOnSelectedItem() {
+ if (this._keyboardNavigationManager)
+ this._keyboardNavigationManager.setTabIndexedItem(buttonElement)
+ }.bind(this))
+ }
+ }
+ }
+ return container
+ }, _getButtonElementFromItem: function _getButtonElementFromItem(element) {
+ var foundButtonElement;
+ if (element) {
+ if (element.tagName === "BUTTON")
+ foundButtonElement = element;
+ else
+ foundButtonElement = element.querySelector("BUTTON");
+ if (!foundButtonElement && element.firstElementChild)
+ foundButtonElement = element.firstElementChild.firstElementChild
+ }
+ return foundButtonElement
+ }, _onPropertyChange: function _onPropertyChange(evt) {
+ if (evt && evt.propertyName === "aria-selected" && evt.srcElement.getAttribute("aria-selected") === "true") {
+ if (this.focusItemOnSelectedIndexChanged)
+ MS.Entertainment.UI.Framework.focusElement(evt.srcElement);
+ var index = -1;
+ if (evt.srcElement.winControl && !MS.Entertainment.UI.Framework.checkIsElementOnly(evt.srcElement))
+ index = this._findIndexFromControl(evt.srcElement.winControl);
+ else
+ index = this._findIndexFromElement(evt.srcElement);
+ if (index >= 0 && index !== this.selectionManager.selectedIndex)
+ this._selectItemAt(index)
+ }
+ }, _selectItemAt: function _selectItemAt(index) {
+ if (this.selectionManager && this._isValidIndex(index))
+ if (index !== this.selectionManager.selectedIndex) {
+ var item = this._item(index) || {};
+ if (!item.isDisabled)
+ this.selectionManager.selectedIndex = index
+ }
+ else if (this.reselectWhenAlreadySelected)
+ this.selectionManager.reselect();
+ else if (this._expandedItems && this._expandedItems.indexOf(this._item(index)) < 0)
+ this._unexpand();
+ else
+ this._expand(index)
+ }, _nextValidIndex: function _nextValidIndex(direction) {
+ var newIndex = 0;
+ if (this.selectionManager && this.selectionManager.dataSource) {
+ var newItem = null;
+ var firstIndex = this.selectionManager.selectedIndex;
+ newIndex = firstIndex;
+ do {
+ newIndex += direction;
+ if (this._isValidIndex(newIndex))
+ newItem = this._item(newIndex);
+ else {
+ newIndex = firstIndex;
+ break
+ }
+ } while (!newItem || newItem.isDisabled)
+ }
+ return newIndex
+ }, setTabPanelId: function setTabPanelId(tabPanelId) {
+ this._tabPanelId = tabPanelId
+ }, _onClick: function _onClick(args) {
+ var target = args && args.target;
+ var winControl = target && target.winControl;
+ if (winControl && !MS.Entertainment.UI.Framework.checkIsElementOnly(target)) {
+ var index = this._findIndexFromControl(winControl);
+ this._selectItemAt(index)
+ }
+ else if (target) {
+ var index = this._findIndexFromElement(target);
+ this._selectItemAt(index)
+ }
+ }, _onKeyDown: function _onKeyDown(e) {
+ if (!this._keyboardNavigationManager)
+ return;
+ if (e.keyCode === WinJS.Utilities.Key.rightArrow) {
+ var focusedItem = this._keyboardNavigationManager.getFocusedItem();
+ var index = focusedItem ? this._findIndexFromControl(focusedItem.winControl) : -1;
+ if (this._isValidIndex(index) && !this._isSubItem(index)) {
+ var item = this._item(index);
+ if (item && "items" in item)
+ if (!item.expanded) {
+ if (this.selectionManager.selectedIndex !== index)
+ this.selectionManager.selectedIndex = index;
+ this._expand(index)
+ }
+ else if (this._expandedItems && this._expandedItems.length) {
+ var firstChildIndex = index + 2;
+ this._keyboardNavigationManager.setFocusedItem(this.domElement.children[firstChildIndex], true)
+ }
+ }
+ }
+ else if (e.keyCode === WinJS.Utilities.Key.leftArrow) {
+ var focusedItem = this._keyboardNavigationManager.getFocusedItem();
+ var index = focusedItem ? this._findIndexFromControl(focusedItem.winControl) : -1;
+ if (this._isValidIndex(index))
+ if (this._isSubItem(index)) {
+ var parentIndex = this._indexOf(this._expandedItems[0]) - 1;
+ this._keyboardNavigationManager.setFocusedItem(this.domElement.children[parentIndex], true)
+ }
+ else {
+ var item = this._item(index);
+ if (item && item.expanded) {
+ if (this.selectionManager.selectedIndex !== index)
+ this.selectionManager.selectedIndex = index;
+ this._unexpand()
+ }
+ }
+ }
+ return true
+ }, _findIndexFromElement: function _findIndexFromElement(element) {
+ var index = -1;
+ var children = this.domElement && this.domElement.children;
+ if (children)
+ for (var i = 0; i < children.length; i++)
+ if (children[i] === element || children[i].contains(element)) {
+ index = i;
+ break
+ }
+ return index
+ }, _findIndexFromControl: function _findIndexFromControl(winControl) {
+ var result;
+ if (!winControl)
+ return -1;
+ if (winControl.data)
+ result = this._indexOf(winControl.data);
+ if (!result && !isNaN(winControl.index))
+ result = winControl.index;
+ return result
+ }, _selectionManagerDataSourceChangeHandler: function _selectionManagerDataSourceChangeHandler(newValue, oldValue) {
+ if (newValue)
+ this.dataSource = newValue;
+ else if (this.dataSource === oldValue)
+ this.dataSource = null
+ }, _listChangedHandler: function _listChangedHandler(newValue, oldValue) {
+ if (this.selectionManager && newValue)
+ this.selectionManager.dataSource = newValue;
+ MS.Entertainment.UI.Controls.ItemsControlWithViewModel.prototype._listChangedHandler.apply(this, arguments)
+ }, _detachItemListeners: function _detachItemListeners(element) {
+ var buttonElement = this._getButtonElementFromItem(element);
+ if (buttonElement) {
+ MS.Entertainment.Utilities.detachPropertyChangeEvent(buttonElement, buttonElement.pivotPropertyChangeHandler);
+ buttonElement.pivotPropertyChangeHandler = null
+ }
+ }, _handleItemRemoved: function _handleItemRemoved(element) {
+ if (!element)
+ return;
+ this._detachItemListeners(element);
+ if (this.keyboardNavigable && this._keyboardNavigationManager) {
+ var currentItemWithTabIndex = this._keyboardNavigationManager.getTabIndexedItem();
+ if (currentItemWithTabIndex && (currentItemWithTabIndex === element || element.contains(currentItemWithTabIndex)))
+ this._keyboardNavigationManager.focusFirstItemInContainer(this.domElement, false, false, true)
+ }
+ }, _item: function _item(index) {
+ return this._isValidIndex(index) ? (Array.isArray(this.selectionManager.dataSource) ? this.selectionManager.dataSource[index] : this.selectionManager.dataSource.item(index)) : null
+ }, _isSubItem: function _isChildItem(index) {
+ return this._expandedItems && this._expandedItems.indexOf(this._item(index)) >= 0
+ }, _indexOf: function _indexOf(item) {
+ var result = -1;
+ if (this.selectionManager && this.selectionManager.dataSource) {
+ result = this.selectionManager.dataSource.indexOf(item);
+ if (result < 0)
+ result = this.selectionManager.dataSource.indexOf(WinJS.Binding.as(item))
+ }
+ return result
+ }, _lastIndexOf: function _indexOf(item, fromIndex) {
+ var result = -1;
+ if (this.selectionManager && this.selectionManager.dataSource) {
+ result = this.selectionManager.dataSource.lastIndexOf(item, fromIndex);
+ if (result < 0)
+ result = this.selectionManager.dataSource.lastIndexOf(WinJS.Binding.as(item))
+ }
+ return result
+ }, _selectedItemChanged: function _selectedItemChanged(args) {
+ var detail = args.detail;
+ WinJS.Utilities.query(".win-focusable.selected", this.domElement).forEach(function(element) {
+ WinJS.Utilities.removeClass(element, "selected")
+ });
+ if (!detail.newSelection)
+ return;
+ var newSelectedElement = this.domElement.children[detail.newSelection.index];
+ if (!newSelectedElement)
+ return;
+ if (newSelectedElement && !WinJS.Utilities.hasClass(newSelectedElement, "win-focusable"))
+ newSelectedElement = newSelectedElement.querySelector(".win-focusable");
+ if (!newSelectedElement)
+ return;
+ WinJS.Utilities.addClass(newSelectedElement, "selected")
+ }, _expand: function _expand(index, oldIndex, preventBinding) {
+ WinJS.Promise.timeout().done(function _updateTabIndexedItem() {
+ if (this._unloaded)
+ return;
+ if (!(this._keyboardNavigationManager && this.keyboardNavigable))
+ return;
+ if (index >= 0 && index < this.domElement.children.length) {
+ var child = this.domElement.children[index];
+ if (child && this._keyboardNavigationManager) {
+ var focusableElement = WinJS.Utilities.hasClass(child, "win-focusable") ? child : child.querySelector(".win-focusable");
+ this._keyboardNavigationManager.setTabIndexedItem(focusableElement)
+ }
+ }
+ }.bind(this));
+ var item = this._item(index);
+ if (item && oldIndex !== undefined && !preventBinding) {
+ var telemetryParameters = {
+ title: this._getAutomationId(item), automationId: MS.Entertainment.UI.AutomationIds.verticalPivotSelected
+ };
+ MS.Entertainment.Utilities.Telemetry.logCommandClicked(telemetryParameters)
+ }
+ if (this._expandedItems && (this._expandedItems.indexOf(this._item(index + 1)) >= 0 || this._expandedItems.indexOf(item) >= 0))
+ return;
+ this._unexpand();
+ if (this._expandBindings) {
+ this._expandBindings.cancel();
+ this._expandBindings = null
+ }
+ if (item && item.items && item.items.length !== 0 && this.selectionManager.selectedIndex === index) {
+ this._expandedItems = this._addExpandedItems(index + 1, item.items);
+ if ("expanded" in item)
+ item.expanded = true
+ }
+ else if (!preventBinding && item && this.selectionManager.selectedIndex === index)
+ this._expandBindings = WinJS.Binding.bind(item, {items: function(newValue, oldValue) {
+ if (oldValue !== undefined)
+ this._expand(index, oldIndex, true)
+ }.bind(this)})
+ }, _unexpand: function _unexpand() {
+ var items = this._expandedItems;
+ this._expandedItems = null;
+ if (!items || !items.length || !this.selectionManager || !this.selectionManager.dataSource)
+ return;
+ var startIndex = this._indexOf(items[0]);
+ var endIndex = this._lastIndexOf(items[items.length - 1], startIndex + items.length - 1);
+ var expandedItem = this._item(startIndex - 1);
+ if (startIndex >= 0 && endIndex >= 0 && endIndex >= startIndex)
+ this.selectionManager.dataSource.splice(startIndex, endIndex - startIndex + 1);
+ if (expandedItem) {
+ if ("childIds" in expandedItem)
+ expandedItem.childIds = null;
+ if ("expanded" in expandedItem)
+ expandedItem.expanded = false
+ }
+ }, _addExpandedItems: function _addExpandedItems(index, items) {
+ if (!items || !items.length || !this.selectionManager || !this.selectionManager.dataSource)
+ return null;
+ var parentItem = this._item(index - 1);
+ var divider = MS.Entertainment.UI.Controls.VerticalPivotControl.divider;
+ var result = [divider].concat(items, [divider]);
+ var args = [index, 0].concat(result);
+ this.selectionManager.dataSource.splice.apply(this.selectionManager.dataSource, args);
+ if (parentItem && "childIds" in parentItem) {
+ parentItem.childIds = [];
+ for (var i = index + 1; i < index + items.length + 1; i++) {
+ var childElement = this.domElement.children[i];
+ MS.Entertainment.Framework.AccUtils.createAriaLinkId(childElement);
+ parentItem.childIds.push(childElement.id)
+ }
+ }
+ return result
+ }, _isValidIndex: function _isValidIndex(index) {
+ return this.selectionManager && this.selectionManager.dataSource && this.selectionManager.dataSource.length > index && index >= 0
+ }, _getAutomationId: function _getAutomationId(item) {
+ return item.id || (item.isRoot ? MS.Entertainment.UI.AutomationIds.genrePivot : MS.Entertainment.UI.AutomationIds.subgenrePivot)
+ }
+ }, {}, {divider: {divider: true}})
+ });
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {DeclarativeVerticalPivotControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalPivotControl", null, null, null, null, {isDeclarativeControlContainer: true})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {HorizontalPivotControl: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.VerticalPivotControl", null, function() {
+ this._onGlobalKeyDown = this._onGlobalKeyDown.bind(this)
+ }, {
+ _globalHandlerEvents: null, focusOverrideData: {down: '.currentPage .modifierControl:not([tabIndex=\'-1\'])'}, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.initialize.apply(this, arguments);
+ this._listenForGlobalNavigation()
+ }, unload: function unload() {
+ this._stopListeningForGlobalNavigation();
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.unload.call(this)
+ }, freeze: function freeze() {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.freeze.call(this);
+ this._stopListeningForGlobalNavigation()
+ }, thaw: function thaw() {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.thaw.call(this);
+ this._listenForGlobalNavigation()
+ }, applyItemTemplate: function applyItemTemplate(container, dataContext) {
+ var result = MS.Entertainment.UI.Controls.VerticalPivotControl.prototype.applyItemTemplate.apply(this, arguments);
+ var child = result.querySelector("button");
+ if (child && MS.Entertainment.Utilities.isApp2 && this.focusOverrideData)
+ child.setAttribute("data-win-focus", JSON.stringify(this.focusOverrideData));
+ return result
+ }, _listenForGlobalNavigation: function _listenForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ var currentPage = MS.Entertainment.Utilities.findParentElementByClassName(this.domElement, "currentPage");
+ if (!currentPage)
+ return;
+ this._globalHandlerEvents = MS.Entertainment.Utilities.addEventHandlers(currentPage, {keydown: this._onGlobalKeyDown})
+ }, _stopListeningForGlobalNavigation: function _stopListeningForGlobalNavigation() {
+ if (!MS.Entertainment.Utilities.isApp2)
+ return;
+ if (!this._globalHandlerEvents)
+ return;
+ this._globalHandlerEvents.cancel()
+ }, _expand: function _expand(index, oldIndex, preventBinding) {
+ MS.Entertainment.UI.Controls.VerticalPivotControl.prototype._expand.apply(this, arguments);
+ var unselectedItems = WinJS.Utilities.query("button:not(.selected)", this.domElement);
+ unselectedItems.forEach(function(item) {
+ item.tabIndex = -1
+ })
+ }, _onGlobalKeyDown: function _onGlobalKeyDown(e) {
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rGlobal:
+ case WinJS.Utilities.Key.lGlobal:
+ this._onKeyDown(e);
+ break;
+ case WinJS.Utilities.Key.pageUp:
+ case WinJS.Utilities.Key.pageDown:
+ if (e.altKey)
+ this._onKeyDown(e);
+ break
+ }
+ return
+ }, _onKeyDown: function _onKeyDown(e) {
+ if (!this._keyboardNavigationManager)
+ return;
+ if (MS.Entertainment.Utilities.isApp1 && e.altKey)
+ return;
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.rightArrow:
+ case WinJS.Utilities.Key.rArrow:
+ case WinJS.Utilities.Key.rOtherArrow:
+ case WinJS.Utilities.Key.rGlobal:
+ case WinJS.Utilities.Key.pageDown:
+ this._selectItemAt(this._nextValidIndex(1));
+ break;
+ case WinJS.Utilities.Key.leftArrow:
+ case WinJS.Utilities.Key.lArrow:
+ case WinJS.Utilities.Key.lOtherArrow:
+ case WinJS.Utilities.Key.lGlobal:
+ case WinJS.Utilities.Key.pageUp:
+ this._selectItemAt(this._nextValidIndex(-1));
+ break;
+ default:
+ return
+ }
+ e.stopPropagation()
+ }, containerStyle: MS.Entertainment.UI.Controls.ItemsControl.ContainerStyles.horizontalFlow, itemTemplate: "/Controls/PivotControls.html#horizontalPivotButtonTemplate", dividerTemplate: "/Controls/PivotControls.html#horizontalDividerTemplate"
+ })})
+})();
+(function runVoiceMixins() {
+ MS.Entertainment.Utilities.runVoiceControlMixins(MS.Entertainment.UI.Controls.PivotsControl)
+})()
+})();
+/* >>>>>>/framework/winjsnavigation.js:25212 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Framework) {
+ var fx = MS.Entertainment.UI.Framework;
+ var PivotData = (function(_super) {
+ __extends(PivotData, _super);
+ function PivotData(dataContext, template, title, icon, moniker, onNavigateStart, onNavigateComplete, dropActionId, supportsSnapped) {
+ if (typeof supportsSnapped === "undefined")
+ supportsSnapped = false;
+ _super.call(this);
+ this.dataContext = dataContext;
+ this.template = template;
+ this.title = title;
+ this.icon = icon;
+ this.moniker = moniker;
+ this.onNavigateStart = onNavigateStart;
+ this.onNavigateComplete = onNavigateComplete;
+ this.dropActionId = dropActionId;
+ this.supportsSnapped = supportsSnapped;
+ this._selected = false
+ }
+ Object.defineProperty(PivotData.prototype, "selected", {
+ get: function() {
+ return this._selected
+ }, set: function(value) {
+ this.updateAndNotify("selected", value)
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PivotData.prototype, "id", {
+ get: function() {
+ return this.moniker
+ }, enumerable: true, configurable: true
+ });
+ return PivotData
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Framework.PivotData = PivotData;
+ var NavigationOperation = (function() {
+ function NavigationOperation(dataContext, template, contentComplete, skipUI, animatePageTransition, dataContextParameter, monikerData, supportsSnapped) {
+ if (typeof supportsSnapped === "undefined")
+ supportsSnapped = false;
+ this.dataContext = null;
+ this.template = null;
+ this.contentComplete = null;
+ this.skipUI = false;
+ this.animatePageTransition = false;
+ this.supportsSnapped = false;
+ this.dataContext = dataContext;
+ this.template = template;
+ this.contentComplete = contentComplete;
+ if (skipUI === null || skipUI === undefined)
+ this.skipUI = false;
+ else
+ this.skipUI = skipUI;
+ if (animatePageTransition === null || animatePageTransition === undefined)
+ this.animatePageTransition = true;
+ else
+ this.animatePageTransition = animatePageTransition;
+ this.dataContextParameter = dataContextParameter;
+ this.monikerData = monikerData;
+ this.supportsSnapped = supportsSnapped
+ }
+ return NavigationOperation
+ })();
+ Framework.NavigationOperation = NavigationOperation;
+ var Navigation = (function(_super) {
+ __extends(Navigation, _super);
+ function Navigation(_contentContainer, pivots) {
+ _super.call(this);
+ this._contentContainer = _contentContainer;
+ this._suppressNavigationOnNextSelectionChange = false;
+ this._skipUICreationOnNextPivotChange = false;
+ this._firstNavigate = true;
+ this.animatePageTransitions = false;
+ this.focusImmediatelyOnBackNavigation = false;
+ this.forceFUENavigation = false;
+ this.playBackNavigationSound = false;
+ this.clearCachesOnNavigation = false;
+ this.setFocusContainerOnNavigation = false;
+ this.blockInputOnHiddenPages = false;
+ this._onFUEPage = false;
+ this._isFirstLocationLoaded = false;
+ this._isNavigationInProgress = false;
+ this._deferTemplateLoads = false;
+ this._defaultPivotIndex = 0;
+ this.focusTimeout = Navigation.DEFAULT_FOCUS_TIMEOUT;
+ this._journal = Navigation.getJournal();
+ this._journalEvents = fx.addEventHandlers(this._journal, {
+ beforenavigate: this._handleBeforeNavigate.bind(this), navigating: this._handleNavigating.bind(this), navigated: this._handleNavigated.bind(this)
+ });
+ fx.currentContentContainer = document.querySelector(".control-app")
+ }
+ Object.defineProperty(Navigation.prototype, "primaryPivots", {
+ get: function() {
+ return this._primaryPivots
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "currentSupportsSnapped", {
+ get: function() {
+ var currentSupportsSnapped = false;
+ if (this._journal && this._journal.state)
+ currentSupportsSnapped = !!this._journal.state.supportsSnapped;
+ return currentSupportsSnapped
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "realizedDataContext", {
+ get: function() {
+ return this._journal && this._journal.state && this._journal.state.realizedDataContext
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "currentMonikerData", {
+ get: function() {
+ return WinJS.Utilities.getMember("_journal.state.monikerData", this)
+ }, enumerable: true, configurable: true
+ });
+ Navigation.prototype.initialize = function(pivots, defaultPivot, fueNavigationOperation) {
+ var _this = this;
+ if (fueNavigationOperation) {
+ this._fueNavigationOperation = fueNavigationOperation;
+ fueNavigationOperation.animatePageTransition = false;
+ var originalContentComplete = fueNavigationOperation.contentComplete;
+ fueNavigationOperation.contentComplete = function() {
+ _this._onFUEPage = true;
+ if (originalContentComplete)
+ originalContentComplete()
+ }
+ }
+ this._defaultPivotIndex = (typeof defaultPivot === "undefined") ? 0 : defaultPivot;
+ this._primaryPivots = pivots;
+ MS.Entertainment.UI.Framework.addEventHandlers(this._primaryPivots, {
+ selectedItemChanged: function(args) {
+ var selectedPivot = (args && args.detail && args.detail.newSelection && args.detail.newSelection.item);
+ if (selectedPivot)
+ _this._handlePivotChange(selectedPivot, args.detail.newSelection.index)
+ }, reselected: function(args) {
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ if (!navigationJournal.canGoBack) {
+ if (WinJS.Utilities.getMember("_journal.state.realizedDataContext.dataContextParameterChanged", _this)) {
+ _this._journal.state.realizedDataContext.dataContextParameterChanged(_this._dataContextParameterForNextPivotChange);
+ _this._dataContextParameterForNextPivotChange = null
+ }
+ return
+ }
+ var reselectedPivot = (WinJS.Utilities.getMember("detail.selection.item", args));
+ if (reselectedPivot)
+ _this._handlePivotChange(reselectedPivot, WinJS.Utilities.getMember("detail.selection.index", args))
+ }
+ })
+ };
+ Navigation.prototype._getCurrentPivotChangePromise = function() {
+ return this._inProgressNavigation
+ };
+ Navigation.prototype.cancelInProgressNavigation = function() {
+ if (this._inProgressNavigation) {
+ this._inProgressNavigation.cancel();
+ this._resetInProgressNavigation()
+ }
+ };
+ Navigation.prototype._handlePivotChange = function(selectedPivot, index) {
+ this.cancelInProgressNavigation();
+ if (this._suppressNavigationOnNextSelectionChange) {
+ this._suppressNavigationOnNextSelectionChange = false;
+ return WinJS.Promise.as()
+ }
+ if (selectedPivot.onNavigateStart)
+ selectedPivot.onNavigateStart();
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ var navigationPreviousLocation = navigationJournal ? navigationJournal.location : String.empty;
+ this.clearHistory();
+ var navigationPromise = this.navigateTo(new NavigationOperation(selectedPivot.dataContext, selectedPivot.template, selectedPivot.onNavigateComplete, this._skipUICreationOnNextPivotChange, undefined, this._dataContextParameterForNextPivotChange, selectedPivot.moniker, selectedPivot.supportsSnapped));
+ this._dataContextParameterForNextPivotChange = null;
+ var contentCatalogIds = MS.Entertainment.Utilities.Telemetry.ContentCatalogId;
+ var contentSourceIds = MS.Entertainment.Utilities.Telemetry.ContentSourceId;
+ var contentTypeIds = MS.Entertainment.Utilities.Telemetry.ContentTypeId;
+ var navigationLocation = navigationJournal ? navigationJournal.location : String.empty;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ slot: index, areaName: "NavBarArea1", contentId: selectedPivot.moniker, contentCatalogId: contentCatalogIds.App, contentSourceId: contentSourceIds.App, contentTypeId: contentTypeIds.App, contentName: selectedPivot.moniker
+ }, {
+ uri: navigationPreviousLocation, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: navigationLocation, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ return navigationPromise
+ };
+ Navigation.prototype._adjustScroller = function() {
+ if (this._contentContainer.children.length > 1) {
+ if (!this._contentContainerHeight)
+ this._contentContainerHeight = this.contentContainer.getBoundingClientRect().height;
+ var scrollLimit = ((this._contentContainer.children.length - 1) * this._contentContainerHeight);
+ this._contentContainer.style.msScrollLimitYMin = scrollLimit + "px"
+ }
+ else {
+ this._contentContainer.style.msScrollLimitYMin = "";
+ this._contentContainer.scrollTop = 0
+ }
+ };
+ Navigation.prototype._handleElementSizeChanged = function() {
+ var newWindowHeight = MS.Entertainment.Utilities.getWindowHeight();
+ if (this._previousWindowHeight && (this._previousWindowHeight === newWindowHeight))
+ return;
+ this._previousWindowHeight = newWindowHeight;
+ this._contentContainerHeight = 0;
+ this._adjustScroller()
+ };
+ Navigation.prototype._getPreviousStackLocation = function() {
+ var previousLocation = String.empty;
+ var oldState;
+ var backStack = this._journal.history.backStack;
+ if (backStack.length > 1) {
+ oldState = backStack[backStack.length - 1].state;
+ if (oldState && oldState.location)
+ previousLocation = oldState.location
+ }
+ return previousLocation
+ };
+ Navigation.prototype._dropInput = function(e) {
+ switch (e.keyCode) {
+ case WinJS.Utilities.Key.invokeGlobalCommand:
+ case WinJS.Utilities.Key.searchButton:
+ case WinJS.Utilities.Key.dismissButton:
+ return
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ e.stopImmediatePropagation()
+ };
+ Navigation.prototype._loadPage = function(state, template, removeOldContent, skipEnterPage) {
+ var _this = this;
+ var dataContext = state.initialDataContext;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.LoadTemplate:" + template + ",StartTM");
+ return fx.loadTemplate(template, null, !this._deferTemplateLoads).then(function(control) {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.LoadTemplate:" + template + ",StopTM");
+ var container = document.createElement("div");
+ WinJS.Utilities.addClass(container, "nav-currentPage");
+ WinJS.Utilities.addClass(container, "hideFromDisplay");
+ _this._waitOnContentComplete(container).done(function() {
+ MS.Entertainment.Utilities.Telemetry.logPageView(container, {uri: template}, {uri: _this._getPreviousStackLocation()})
+ });
+ _this.contentContainer.appendChild(container);
+ _this._adjustScroller();
+ state.domElement = container;
+ var realizedDataContext = null;
+ if (dataContext) {
+ if (!(dataContext instanceof Function))
+ throw new Error("You must supply a function as a data context");
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ":CreateDataContext,StartTM");
+ realizedDataContext = dataContext(state.dataContextCreationParameter);
+ state.dataContextCreationParameter = null;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ":CreateDataContext,StopTM")
+ }
+ container.__navigationState = state;
+ state.realizedDataContext = realizedDataContext;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.EnterPage:" + template + ",StartTM");
+ return WinJS.Promise.join({
+ element: control.render(realizedDataContext, container), exitPage: removeOldContent
+ })
+ }).then(function(result) {
+ var element = result.element;
+ var animateTransition = true;
+ if (!skipEnterPage) {
+ animateTransition = state.animatePageTransition;
+ WinJS.Utilities.removeClass(element, "hideFromDisplay")
+ }
+ else
+ animateTransition = false;
+ var enterPageResult = WinJS.Promise.join({
+ enterpage: _this._enterPage(element, animateTransition).then(function() {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.EnterPage:" + template + ",StopTM")
+ }), element: element
+ });
+ _this._resetInProgressNavigation();
+ return enterPageResult
+ })
+ };
+ Navigation.prototype._handleForwardNavigation = function(state, template) {
+ var _this = this;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ",StartTM");
+ if (state.skipUI) {
+ this._resetInProgressNavigation();
+ return WinJS.Promise.as()
+ }
+ if (this.clearCachesOnNavigation && Entertainment.Utilities.isAboveMemoryCleanupThreshold())
+ Framework.clearCaches(true);
+ var oldState;
+ var backStack = this._journal.history.backStack;
+ var removeOldContent;
+ if (this._firstNavigate) {
+ this.removeContent(this.contentContainer.firstElementChild);
+ removeOldContent = WinJS.Promise.as();
+ this._firstNavigate = false;
+ this._waitOnContentComplete(this.contentContainer).done(function() {
+ _this._isFirstLocationLoaded = true
+ })
+ }
+ else {
+ this._isFirstLocationLoaded = true;
+ if (this._journal.canGoBack && backStack[backStack.length - 1]) {
+ oldState = backStack[backStack.length - 1].state;
+ if (oldState.domElement) {
+ if (this.blockInputOnHiddenPages) {
+ var dropInput = this._dropInput.bind(this);
+ oldState.inputBlockEventHandlers = Framework.addEventHandlers(oldState.domElement, {
+ keydown: dropInput, keyup: dropInput, keypress: dropInput
+ }, true)
+ }
+ if (oldState.domElement.contains(document.activeElement))
+ oldState.previouslyFocusedItem = this._extractFocusElementInformation(oldState.domElement);
+ MS.Entertainment.assert(oldState, "Given we can go back, expected to be able to get information from the backstack");
+ removeOldContent = this._exitPage().then(function() {
+ WinJS.Utilities.removeClass(oldState.domElement, "nav-currentPage");
+ MS.Entertainment.UI.Framework.freezeControlsInSubtree(oldState.domElement)
+ })
+ }
+ else
+ removeOldContent = WinJS.Promise.as()
+ }
+ }
+ if (!template) {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:NoTemplate,StopTM");
+ return removeOldContent
+ }
+ var pageLoadedSignal = new fx.Signal;
+ this._wasInteractedBeforeTimeout(this.contentContainer, pageLoadedSignal.promise).then(function(wasInteracted) {
+ if (wasInteracted)
+ return;
+ if (state === _this._journal.state) {
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(state.domElement))
+ return;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(state.domElement)
+ }
+ }).done(null, function(error) {
+ MS.Entertainment.fail("Failure setting focus: " + (error && error.message))
+ });
+ return this._loadPage(state, template, removeOldContent).then(function(result) {
+ if (oldState && oldState.domElement && (oldState != _this._journal.state))
+ WinJS.Utilities.addClass(oldState.domElement, "hideFromDisplay");
+ if (!oldState || oldState !== _this._journal.state) {
+ if (_this.setFocusContainerOnNavigation)
+ fx.currentContentContainer = state.domElement;
+ MS.Entertainment.UI.Framework.setFocusRoot(state.domElement)
+ }
+ pageLoadedSignal.complete();
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigateTo:" + template + ",StopTM")
+ })
+ };
+ Navigation.prototype._handleBackNavigation = function(newState) {
+ var _this = this;
+ var oldContentRemovedPromise;
+ var createdPage = false;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigatingBack:" + newState.location + ",StartTM");
+ if (this.playBackNavigationSound)
+ Entertainment.Utilities.playBackButtonClick();
+ var historyItem = this._journal.history.forwardStack.shift();
+ MS.Entertainment.assert(historyItem, "Expected to find some history state");
+ if (historyItem && historyItem.state) {
+ var oldState = historyItem.state;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ slot: 0, areaName: "BackButtonArea", contentId: "BackButton", contentCatalogId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.App, contentSourceId: MS.Entertainment.Utilities.Telemetry.ContentCatalogId.App, contentTypeId: MS.Entertainment.Utilities.Telemetry.ContentTypeId.App, contentName: "BackButton"
+ }, {
+ uri: oldState.location, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: newState.location, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ oldContentRemovedPromise = this._exitPage().then(function() {
+ _this.removeContent(oldState.domElement)
+ })
+ }
+ else
+ oldContentRemovedPromise = WinJS.Promise.as();
+ return oldContentRemovedPromise.then(function() {
+ if (newState.domElement)
+ return;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigatingBack.CreatingPage:" + newState.location);
+ createdPage = true;
+ return _this._loadPage(newState, newState.location, oldContentRemovedPromise, true)
+ }).then(function() {
+ WinJS.Utilities.addClass(newState.domElement, "nav-currentPage");
+ WinJS.Utilities.removeClass(newState.domElement, "hideFromDisplay");
+ MS.Entertainment.UI.Framework.thawControlsInSubtree(newState.domElement);
+ if (_this.setFocusContainerOnNavigation)
+ fx.currentContentContainer = newState.domElement;
+ MS.Entertainment.UI.Framework.setFocusRoot(newState.domElement);
+ if (newState.inputBlockEventHandlers) {
+ newState.inputBlockEventHandlers.cancel();
+ newState.inputBlockEventHandlers = null
+ }
+ _this._journal.history.forwardStack = [];
+ var enterPagePromise = _this._enterPage(newState.domElement, newState.animatePageTransition);
+ if (createdPage)
+ return;
+ if (WinJS.Utilities.getMember("realizedDataContext.navigatedBackTo", newState))
+ newState.realizedDataContext.navigatedBackTo();
+ {};
+ _this._resetInProgressNavigation();
+ var checkForInteractionPromise;
+ if (_this.focusImmediatelyOnBackNavigation)
+ checkForInteractionPromise = WinJS.Promise.wrap(false);
+ else
+ checkForInteractionPromise = _this._wasInteractedBeforeTimeout(newState.domElement, enterPagePromise);
+ checkForInteractionPromise.then(function(wasInteraction) {
+ if (wasInteraction)
+ return;
+ if (!document.body.contains(newState.domElement))
+ return;
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(newState.domElement) || MS.Entertainment.UI.Framework.focusedItemInContainer(newState.domElement))
+ return;
+ var focusState = newState.previouslyFocusedItem;
+ newState.previouslyFocusedItem = null;
+ if (focusState)
+ if (focusState.listView && focusState.currentItem) {
+ focusState.currentItem.showFocus = MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus;
+ focusState.listView.currentItem = focusState.currentItem
+ }
+ else
+ MS.Entertainment.UI.Framework.focusFirstFocusableAncestor(focusState.focusedElement);
+ else if (newState === _this._journal.state) {
+ if (!MS.Entertainment.UI.Framework.canMoveFocus(newState.domElement))
+ return;
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(newState.domElement)
+ }
+ }).done(null, function(error) {
+ MS.Entertainment.fail("Failure setting focus: " + (error && error.message))
+ });
+ return enterPagePromise
+ }).then(function() {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.NavigatingBack:" + newState.location + ",StopTM");
+ MS.Entertainment.Utilities.Telemetry.logPageView(newState.domElement, {uri: newState.location}, {uri: oldState && oldState.location});
+ if (_this.clearCachesOnNavigation && Entertainment.Utilities.isAboveMemoryCleanupThreshold())
+ Framework.clearCaches(true).then(function() {
+ return WinJS.Promise.timeout(1000)
+ }).then(function() {
+ Framework.clearCaches(true)
+ })
+ })
+ };
+ Navigation.prototype._handleBeforeNavigate = function(args) {
+ var proposed = args.detail.state;
+ var current = this._journal.state;
+ var backstack = this._journal.history.backStack;
+ if (!current)
+ return;
+ if (window.onNewVideoPage && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ var isCurrentLocationOldPage = MS.Entertainment.UI.Monikers && navigationService && navigationService.currentPage && navigationService.currentPage.iaNode.moniker !== MS.Entertainment.UI.Monikers.homeHub;
+ if (isCurrentLocationOldPage) {
+ var navigateBackAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.navigate);
+ navigateBackAction.automationId = "newBackNavigate";
+ navigateBackAction.parameter = MS.Entertainment.UI.Actions.navigate.NavigateLocation.back;
+ navigateBackAction.execute();
+ args.preventDefault()
+ }
+ }
+ var backStack = this._journal.history.backStack;
+ if (WinJS.Utilities.getMember("length", backStack) && backStack[backStack.length - 1].state === proposed && WinJS.Utilities.getMember("realizedDataContext.goBack", current) && current.realizedDataContext.goBack())
+ args.preventDefault();
+ if (proposed && (current.location === proposed.location) && WinJS.Utilities.getMember("realizedDataContext.dataContextParameterChanged", current)) {
+ current.realizedDataContext.dataContextParameterChanged(proposed.dataContextCreationParameter);
+ args.preventDefault()
+ }
+ };
+ Navigation.prototype._handleNavigating = function(args) {
+ args.detail.setPromise(WinJS.Promise.as(args.detail.delta < 0))
+ };
+ Navigation.prototype._handleNavigated = function(args) {
+ var _this = this;
+ var isBackNavigation = args.detail.value;
+ var navigationDetail = args.detail;
+ var navigationPromise;
+ this._updatePivotSelection(navigationDetail.state.monikerData);
+ if (!isBackNavigation)
+ navigationPromise = this._handleForwardNavigation(navigationDetail.state, navigationDetail.location);
+ else
+ navigationPromise = this._handleBackNavigation(navigationDetail.state);
+ navigationDetail.setPromise(navigationPromise.then(null, function(error) {
+ var message = (error && error.toString()) || String.empty;
+ if (!WinJS.Promise.isCanceledError(error))
+ MS.Entertainment.fail("Navigation failed with: " + message);
+ _this._resetInProgressNavigation();
+ return WinJS.Promise.wrapError(error)
+ }))
+ };
+ Navigation.prototype._updatePivotSelection = function(monikerData) {
+ if (!monikerData)
+ return;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.UpdatePivotSelection:" + monikerData + ",StartTM");
+ var dataSource = WinJS.Utilities.getMember("_primaryPivots.dataSource", this) || [];
+ var itemToSelect = -1;
+ dataSource.forEach(function(item, index) {
+ if (item.moniker !== monikerData)
+ return;
+ itemToSelect = index
+ });
+ if (itemToSelect > -1) {
+ if (this.primaryPivots.selectedIndex !== itemToSelect) {
+ this._suppressNavigationOnNextSelectionChange = true;
+ this.primaryPivots.selectedIndex = itemToSelect
+ }
+ }
+ else
+ this.dispatchEvent("unknownMonikerEncountered", {monikerData: monikerData});
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.UpdatePivotSelection:" + monikerData + ",StopTM")
+ };
+ Navigation.prototype.navigateTo = function(operation) {
+ var _this = this;
+ if (this._isNavigationInProgress)
+ return WinJS.Promise.cancel;
+ operation = operation || new NavigationOperation(null);
+ if (this._onFUEPage) {
+ this._onFUEPage = false;
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ config.fue.showLXFUE = false;
+ this.forceFUENavigation = false
+ }
+ if (!operation.monikerData)
+ if (this._suppressedMoniker)
+ operation.monikerData = this._suppressedMoniker;
+ else if (this._journal.state)
+ operation.monikerData = this._journal.state.monikerData;
+ this._suppressedMoniker = null;
+ this._isNavigationInProgress = true;
+ this._inProgressNavigation = this._journal.navigate(operation.template, {
+ initialDataContext: operation.dataContext, location: operation.template, contentComplete: operation.contentComplete, skipUI: operation.skipUI, animatePageTransition: operation.animatePageTransition, supportsSnapped: operation.supportsSnapped, dataContextCreationParameter: operation.dataContextParameter, monikerData: operation.monikerData
+ }).then(null, function(error) {
+ _this._resetInProgressNavigation();
+ return WinJS.Promise.wrapError(error)
+ });
+ return this._inProgressNavigation
+ };
+ Navigation.prototype.navigateToDefault = function() {
+ if (!this.primaryPivots.dataSource || (this.primaryPivots.dataSource.length < 1))
+ return WinJS.Promise.wrapError(new Error("Nothing to navigate to"));
+ var showFUEPromise = this._showFUEIfNeeded();
+ if (showFUEPromise)
+ return showFUEPromise;
+ var defaultPivotIndex = this._defaultPivotIndex;
+ if (defaultPivotIndex < 0 || defaultPivotIndex > this.primaryPivots.dataSource.length - 1)
+ defaultPivotIndex = 0;
+ if (this.primaryPivots.selectedIndex !== defaultPivotIndex) {
+ this._suppressNavigationOnNextSelectionChange = true;
+ this.primaryPivots.selectedIndex = defaultPivotIndex
+ }
+ var selectedPivot = this.primaryPivots.selectedItem;
+ return this._handlePivotChange(this.primaryPivots.selectedItem, this.primaryPivots.selectedIndex)
+ };
+ Navigation.prototype._showFUEIfNeeded = function() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (this._fueNavigationOperation && (config.fue.showLXFUE || this.forceFUENavigation)) {
+ this.primaryPivots.clear();
+ return this.navigateTo(this._fueNavigationOperation)
+ }
+ return null
+ };
+ Navigation.prototype.navigateToMoniker = function(moniker, skipUI, skipBackStack, dataContextParameter) {
+ var dataSource = this._primaryPivots.dataSource;
+ if (!dataSource || !dataSource.length)
+ throw new Error("Nothing to navigate to");
+ var itemToSelect = -1;
+ dataSource.forEach(function(item, index) {
+ if (item.moniker != moniker)
+ return;
+ itemToSelect = index
+ });
+ if (itemToSelect === -1)
+ throw new Error("Moniker wasn't found in the list of pivots");
+ this._skipUICreationOnNextPivotChange = !!skipUI;
+ this._suppressNavigationOnNextSelectionChange = !!skipBackStack;
+ if (this._suppressNavigationOnNextSelectionChange)
+ this._suppressedMoniker = moniker;
+ this._dataContextParameterForNextPivotChange = dataContextParameter;
+ if (this._primaryPivots.selectedIndex === itemToSelect)
+ this._primaryPivots.reselect();
+ else
+ this._primaryPivots.selectedIndex = itemToSelect;
+ this._skipUICreationOnNextPivotChange = false;
+ this._dataContextParameterForNextPivotChange = null
+ };
+ Navigation.prototype.navigateBack = function() {
+ var result;
+ if (WinJS.Navigation.canGoBack)
+ result = WinJS.Navigation.back();
+ else
+ result = this.navigateToDefault();
+ return WinJS.Promise.as(result)
+ };
+ Object.defineProperty(Navigation.prototype, "contentContainer", {
+ get: function() {
+ if (!this._contentContainer) {
+ this._contentContainer = document.querySelector(".control-app .app-body");
+ this._containerEvents = fx.addEventHandlers(this._contentContainer, {mselementresize: this._handleElementSizeChanged.bind(this)})
+ }
+ return this._contentContainer
+ }, enumerable: true, configurable: true
+ });
+ Navigation.prototype.removeContent = function(container) {
+ if (!container)
+ return;
+ var context = container.__navigationState;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ContentRemoved,StartTM");
+ if (container.parentElement)
+ container.parentElement.removeChild(container);
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ContentRemoved,StopTM");
+ this._adjustScroller();
+ if (context) {
+ if (context.inputBlockEventHandlers) {
+ context.inputBlockEventHandlers.cancel();
+ context.inputBlockEventHandlers = null
+ }
+ if (context.realizedDataContext && context.realizedDataContext.dispose) {
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.DataContextDisposed,StartTM");
+ context.realizedDataContext.dispose();
+ context.realizedDataContext = null;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.DataContextDisposed,StopTM")
+ }
+ }
+ };
+ Navigation.prototype._extractFocusElementInformation = function(pageContainer) {
+ var listViews = WinJS.Utilities.query(".win-listview", pageContainer);
+ var result = {
+ listView: null, currentItem: null, focusedElement: document.activeElement
+ };
+ if (listViews.length < 1)
+ return result;
+ var containingListView = listViews.filter(function(item) {
+ return item.contains(document.activeElement)
+ });
+ if (containingListView.length < 1)
+ return result;
+ var listView = containingListView[0].winControl;
+ if (listView) {
+ result.listView = listView;
+ result.currentItem = listView.currentItem
+ }
+ return result
+ };
+ Navigation.prototype._waitOnContentComplete = function(el) {
+ var signal = new fx.Signal;
+ var _listeners = fx.addEventHandlers(el, {ContentComplete: function() {
+ if (_listeners) {
+ _listeners.cancel();
+ _listeners = null;
+ signal.complete()
+ }
+ }});
+ return signal.promise
+ };
+ Navigation.prototype._wasInteractedBeforeTimeout = function(element, waitPromise) {
+ var _this = this;
+ var signal = new fx.Signal;
+ var timeout;
+ waitPromise = waitPromise || WinJS.Promise.as();
+ var interactionHandler = function() {
+ if (bindings) {
+ bindings.cancel();
+ bindings = null
+ }
+ if (signal) {
+ signal.complete(true);
+ signal = null
+ }
+ if (timeout)
+ timeout.cancel()
+ };
+ var bindings = MS.Entertainment.UI.Framework.addEventHandlers(element, {
+ MSManipulationStateChanged: interactionHandler, mousewheel: interactionHandler
+ });
+ waitPromise.then(function() {
+ if (!signal)
+ return;
+ timeout = WinJS.Promise.timeout(_this.focusTimeout);
+ return timeout
+ }).done(function() {
+ if (bindings) {
+ bindings.cancel();
+ bindings = null
+ }
+ if (signal) {
+ signal.complete(false);
+ signal = null
+ }
+ }, function(){});
+ return signal.promise
+ };
+ Navigation.prototype._enterPage = function(el, animatePageTransition) {
+ var result;
+ if (this.animatePageTransitions && animatePageTransition) {
+ el.style.overflow = "hidden";
+ el.style.opacity = "0.0";
+ result = WinJS.UI.Animation.enterPage(el).then(function() {
+ el.style.overflow = String.empty;
+ el.style.opacity = String.empty
+ })
+ }
+ else
+ result = WinJS.Promise.as();
+ return WinJS.Promise.timeout().then(function() {
+ return result
+ })
+ };
+ Navigation.prototype._exitPage = function() {
+ return WinJS.Promise.timeout()
+ };
+ Navigation.prototype._resetInProgressNavigation = function() {
+ if (this._inProgressNavigation)
+ this._inProgressNavigation = null;
+ this._isNavigationInProgress = false
+ };
+ Navigation.prototype.clearHistory = function() {
+ var _this = this;
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ClearHistory,StartTM");
+ var children = WinJS.Utilities.children(this.contentContainer);
+ children.forEach(function(element) {
+ _this.removeContent(element)
+ });
+ this._journal.history = {};
+ window.msWriteProfilerMark("ent:Shell.WinJSNavigation.ClearHistory,StopTM")
+ };
+ Navigation.prototype.trimBackStack = function() {
+ var _this = this;
+ var backstackToTrim = this._journal.history.backStack;
+ backstackToTrim.forEach(function(historyItem) {
+ var state = historyItem.state;
+ _this.removeContent(state.domElement);
+ state.domElement = null;
+ state.previouslyFocusedItem = null
+ })
+ };
+ Navigation.prototype.freezeCurrentPage = function() {
+ var currentPageElement = WinJS.Utilities.getMember("_journal.state.domElement", this);
+ if (!currentPageElement)
+ return;
+ Framework.freezeControlsInSubtree(currentPageElement)
+ };
+ Navigation.prototype.thawCurrentPage = function() {
+ var currentPageElement = WinJS.Utilities.getMember("_journal.state.domElement", this);
+ if (!currentPageElement)
+ return;
+ Framework.thawControlsInSubtree(currentPageElement)
+ };
+ Object.defineProperty(Navigation.prototype, "location", {
+ get: function() {
+ var journal = Navigation.getJournal();
+ return journal && journal.location || String.empty
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(Navigation.prototype, "isFirstLocationLoaded", {
+ get: function() {
+ return this._isFirstLocationLoaded
+ }, enumerable: true, configurable: true
+ });
+ Navigation.prototype.setPreviouslyFocusedItem = function(focusedElement, listView, currentItem) {
+ var journal = Navigation.getJournal();
+ var state = journal && journal.state;
+ if (state)
+ state.previouslyFocusedItem = {
+ listView: listView, currentItem: currentItem, focusedElement: focusedElement
+ }
+ };
+ Navigation.prototype.clearPreviouslyFocusedItem = function() {
+ var journal = Navigation.getJournal();
+ var state = journal && journal.state;
+ if (state)
+ state.previouslyFocusedItem = null
+ };
+ Object.defineProperty(Navigation.prototype, "currentlySelectedPivotMoniker", {
+ get: function() {
+ if (!WinJS.Utilities.getMember("_primaryPivots.selectedItem", this))
+ return null;
+ return this._primaryPivots.selectedItem.moniker
+ }, enumerable: true, configurable: true
+ });
+ Navigation.raiseContentComplete = function(element) {
+ var domEvent = document.createEvent("event");
+ domEvent.initEvent("ContentComplete", true, true);
+ element.dispatchEvent(domEvent);
+ var journal = WinJS.Navigation;
+ if (journal && journal.state && journal.state.contentComplete) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceWinJSNavigation_ContentComplete(journal.state.location);
+ journal.state.contentComplete();
+ journal.state.contentComplete = null
+ }
+ };
+ Navigation.getJournal = function() {
+ return Navigation.testJournalInstance || WinJS.Navigation
+ };
+ Navigation.DEFAULT_FOCUS_TIMEOUT = 1000;
+ return Navigation
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Framework.Navigation = Navigation;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.winJSNavigation, function() {
+ return new Navigation
+ })
+ })(UI.Framework || (UI.Framework = {}));
+ var Framework = UI.Framework
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}));
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Actions) {
+ (function(NavigationActions) {
+ var NavigateToDefaultAction = (function(_super) {
+ __extends(NavigateToDefaultAction, _super);
+ function NavigateToDefaultAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.navigateToDefault
+ }
+ NavigateToDefaultAction.prototype.canExecute = function(param) {
+ return MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)
+ };
+ NavigateToDefaultAction.prototype.executed = function(param) {
+ var navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigation.navigateToDefault()
+ };
+ return NavigateToDefaultAction
+ })(Actions.Action);
+ NavigationActions.NavigateToDefaultAction = NavigateToDefaultAction
+ })(Actions.NavigationActions || (Actions.NavigationActions = {}));
+ var NavigationActions = Actions.NavigationActions;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).register(MS.Entertainment.UI.Actions.ActionIdentifiers.navigateToDefault, function() {
+ return new MS.Entertainment.UI.Actions.NavigationActions.NavigateToDefaultAction
+ })
+ })(UI.Actions || (UI.Actions = {}));
+ var Actions = UI.Actions
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/components/signin/signinerrors.js:26061 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+WinJS.Namespace.define("MS.Entertainment.Utilities.SignInErrors", {
+ NS_E_WMPIM_USEROFFLINE: 0xC00D1126 - 0xFFFFFFFF - 1, NS_E_SIGNIN_TAG_CHANGE_REQUIRED: 0xC00D1375 - 0xFFFFFFFF - 1, ZEST_E_TOS_NOT_ACCEPTED: 0xC101A21B - 0xFFFFFFFF - 1, ZUNE_E_SIGNIN_TERMS_OF_SERVICE_CHILD: 0xC1010017 - 0xFFFFFFFF - 1, NS_E_SIGNIN_TERMS_OF_SERVICE: 0xC00D1376 - 0xFFFFFFFF - 1, NS_E_SIGNIN_ACCOUNT_SUSPENDED: 0xC00D1377 - 0xFFFFFFFF - 1, NS_E_SIGNIN_SUBSCRIPTION_SUSPENDED: 0xC00D1378 - 0xFFFFFFFF - 1, NS_E_SIGNIN_BILLING_UNAVAILABLE: 0xC00D1379 - 0xFFFFFFFF - 1, NS_E_SIGNIN_PASSPORT_UNKNOWN_ERROR: 0xC00D1389 - 0xFFFFFFFF - 1, NS_E_SIGNIN_NOT_SUPPORTED_REGION: 0xC00D1388 - 0xFFFFFFFF - 1, NS_E_SIGNIN_INVALID_REGION: 0xC00D1353 - 0xFFFFFFFF - 1, NS_E_SIGNIN_VERSION_NOT_SUPPORTED: 0xC00D1390 - 0xFFFFFFFF - 1, NS_E_SIGNIN_CHILD_ACCOUNT_CREATION_BLOCKED: 0xC00D1394 - 0xFFFFFFFF - 1, NS_E_SIGNIN_REGION_MISMATCH_ERROR: 0xC00D1398 - 0xFFFFFFFF - 1, XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED: 0x80172008 - 0xFFFFFFFF - 1, NO_CONNECTED_ACCOUNT: 0x80070525 - 0xFFFFFFFF - 1, NS_E_INVALID_USERNAME_AND_PASSWORD: 0x8007052e - 0xFFFFFFFF - 1, ZUNE_E_SIGNIN_ERROR_CANCELLED: 0x800704C7 - 0xFFFFFFFF - 1, ERROR_NETWORK_UNREACHABLE: 0x800704CF - 0xFFFFFFFF - 1, NS_E_NO_ACCOUNT_PROOF: 0x800434ed - 0xFFFFFFFF - 1, NS_E_ACCOUNT_PROOF_NOT_VERIFIED: 0x800434ef - 0xFFFFFFFF - 1, INET_E_RESOURCE_NOT_FOUND: 0x800C0005 - 0xFFFFFFFF - 1, INET_E_DOWNLOAD_FAILURE: 0x800c0008 - 0xFFFFFFFF - 1, INET_E_CONNECTION_TIMEOUT: 0x800c000b - 0xFFFFFFFF - 1, HTTP_E_STATUS_DENIED: 0x80190191 - 0xFFFFFFFF - 1, ONL_E_ACCESS_DENIED_BY_TOU: 0x80860002 - 0xFFFFFFFF - 1, ONL_E_PASSWORD_UPDATE_REQUIRED: 0x80860004 - 0xFFFFFFFF - 1, ONL_E_ACCOUNT_UPDATE_REQUIRED: 0x80860005 - 0xFFFFFFFF - 1, ONL_E_FORCESIGNIN: 0x80860006 - 0xFFFFFFFF - 1, ONL_E_PARENTAL_CONSENT_REQUIRED: 0x80860008 - 0xFFFFFFFF - 1, ONL_E_EMAIL_VERIFICATION_REQUIRED: 0x80860009 - 0xFFFFFFFF - 1, ONL_E_ACTION_REQUIRED: 0x8086000C - 0xFFFFFFFF - 1, XBL_SERVER_CONNECTION_FAILURE: 0x82bc0008 - 0xFFFFFFFF - 1, XO_E_ACCOUNT_CREATION_REQUIRED: 0x8015DC09 - 0xFFFFFFFF - 1, XO_E_ACCOUNT_TERMS_OF_USE_NOT_ACCEPTED: 0x8015DC0A - 0xFFFFFFFF - 1, ZEST_E_SIGNIN_REQUIRED: 0xC101A24B - 0xFFFFFFFF - 1, X8_E_SIGNIN_MISMATCH: 0xC101010E - 0xFFFFFFFF - 1
+})
+})();
+/* >>>>>>/components/signin/signin.js:26069 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Utilities");
+(function() {
+ "use strict";
+ var observableProperty = MS.Entertainment.UI.Framework.observableProperty;
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {SignedInUser: MS.Entertainment.UI.Framework.derive("MS.Entertainment.Utilities.User", function signedInUser() {
+ MS.Entertainment.Utilities.SignedInUser._instanceCount++;
+ MS.Entertainment.Utilities.assert(MS.Entertainment.Utilities.SignedInUser._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser)");
+ this.refresh(null, true)
+ }, {
+ gamerTag: MS.Entertainment.UI.Framework.observableProperty("gamerTag", String.empty), xuid: MS.Entertainment.UI.Framework.observableProperty("xuid", String.empty), locale: MS.Entertainment.UI.Framework.observableProperty("locale", String.empty), isParentallyControlled: MS.Entertainment.UI.Framework.observableProperty("isParentallyControlled", false), hasExplicitPrivilege: MS.Entertainment.UI.Framework.observableProperty("hasExplicitPrivilege", false), isSubscription: MS.Entertainment.UI.Framework.observableProperty("isSubscription", false), membershipLevel: MS.Entertainment.UI.Framework.observableProperty("membershipLevel", String.empty), meteringCertificate: MS.Entertainment.UI.Framework.observableProperty("meteringCertificate", String.empty), signInName: MS.Entertainment.UI.Framework.observableProperty("signInName", String.empty), firstName: MS.Entertainment.UI.Framework.observableProperty("firstName", String.empty), lastName: MS.Entertainment.UI.Framework.observableProperty("lastName", String.empty), _userPuid: MS.Entertainment.UI.Framework.observableProperty("_userPuid", String.empty), _userCid: MS.Entertainment.UI.Framework.observableProperty("_userCid", String.empty), _userAnid: MS.Entertainment.UI.Framework.observableProperty("_userAnid", String.empty), canSignOut: MS.Entertainment.UI.Framework.observableProperty("canSignOut", false), isTunerActivated: MS.Entertainment.UI.Framework.observableProperty("isTunerActivated", false), isTunerActivatable: MS.Entertainment.UI.Framework.observableProperty("isTunerActivatable", false), isGamerTag: function isGamerTag(gamerTag) {
+ return gamerTag && this.gamerTag && this.gamerTag.match(new RegExp("^" + gamerTag + "$", "i")) !== null
+ }, isGold: function isGold() {
+ return this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Gold || this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.FamilyGold || this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Family
+ }, isSilver: function isSilver() {
+ return this.membershipLevel === MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Silver
+ }, getUserAnid: function getUserAnid() {
+ if (this._userAnid)
+ return this.userAnid;
+ if (!this._userPuid)
+ return String.empty;
+ var padding = [];
+ for (var w = 0; w < (MS.Entertainment.Utilities.SignedInUser._initialPuidLength - this._userPuid.length); w++)
+ padding[w] = "0";
+ var puidToUse = padding.join(String.empty).concat(this._userPuid);
+ try {
+ var macAlgorithmProvider = Windows.Security.Cryptography.Core.MacAlgorithmProvider.openAlgorithm("HMAC_MD5");
+ var keyMaterial = Windows.Security.Cryptography.CryptographicBuffer.createFromByteArray([99, 202, 90, 90, 191, 64, 70, 72, 58, 206, 107, 87, 165, 187, 152, 8]);
+ var key = macAlgorithmProvider.createKey(keyMaterial);
+ var encodedPuid = Windows.Security.Cryptography.CryptographicBuffer.convertStringToBinary(puidToUse, Windows.Security.Cryptography.BinaryStringEncoding.utf16LE);
+ var bytes = null;
+ bytes = Windows.Security.Cryptography.CryptographicBuffer.copyToByteArray(encodedPuid);
+ var bytes2 = [];
+ for (var i = 0; i < bytes.length; i++)
+ bytes2[i] = bytes[i];
+ for (var k = bytes.length - 1; k < MS.Entertainment.Utilities.SignedInUser._encodedMaterialLength; k++)
+ bytes2[k] = 0;
+ var finalEncodedPuid = Windows.Security.Cryptography.CryptographicBuffer.createFromByteArray(bytes2);
+ var signatureBuffer = Windows.Security.Cryptography.Core.CryptographicEngine.sign(key, finalEncodedPuid);
+ var signature = Windows.Security.Cryptography.CryptographicBuffer.encodeToHexString(signatureBuffer);
+ var finalString = signature.slice(0, MS.Entertainment.Utilities.SignedInUser._anidSliceLength).concat(MS.Entertainment.Utilities.SignedInUser._paddingForPuidHash);
+ this._userAnid = finalString
+ }
+ catch(e) {
+ MS.Entertainment.Utilities.fail("Failed to hash anid " + e);
+ return null
+ }
+ return finalString
+ }, refresh: function refresh(signInProvider, doNotUpdatePropertyCache) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ this.nativeUserModel = [null];
+ this._userAnid = null;
+ if (signInProvider) {
+ this.gamerTag = signInProvider.gamerTag;
+ this.xuid = signInProvider.xuid;
+ this.locale = signInProvider.locale;
+ this.isParentallyControlled = signInProvider.parentallyControlled;
+ this.hasExplicitPrivilege = signInProvider.explicitPrivilege;
+ this.isSubscription = signInProvider.isSubscription;
+ this.membershipLevel = signInProvider.membershipLevel;
+ this.subscriptionOfferID = signInProvider.subscriptionOfferID;
+ this.meteringCertificate = signInProvider.meteringCertificate;
+ this.signInName = signInProvider.signInName;
+ this.firstName = signInProvider.firstName;
+ this.lastName = signInProvider.lastName;
+ this._userPuid = signInProvider.id;
+ this._userCid = signInProvider.cid;
+ this.canSignOut = signInProvider.canSignOut;
+ this.isTunerActivated = signInProvider.isTunerActivated;
+ this.isTunerActivatable = signInProvider.isTunerActivatable
+ }
+ else {
+ this.gamerTag = String.empty;
+ this.xuid = String.empty;
+ this.locale = String.empty;
+ this.isParentallyControlled = false;
+ this.hasExplicitPrivilege = false;
+ this.isSubscription = false;
+ this.membershipLevel = String.empty;
+ this.subscriptionOfferID = String.empty;
+ this.meteringCertificate = String.empty;
+ this.signInName = String.empty;
+ this.firstName = String.empty;
+ this.lastName = String.empty;
+ this._userPuid = null;
+ this._userCid = null;
+ this.canSignOut = false;
+ this.isTunerActivated = false;
+ this.isTunerActivatable = false
+ }
+ if (!doNotUpdatePropertyCache)
+ this.updateLastSignedInUserPropertyCache()
+ }, updateLastSignedInUserPropertyCache: function updateLastSignedInUserPropertyCache() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!configurationManager.service.enableTimeTravel) {
+ configurationManager.service.lastSignedInUserParentControl = this.isParentallyControlled;
+ configurationManager.service.lastSignedInUserExplicitPrivilege = this.hasExplicitPrivilege;
+ configurationManager.service.lastSignedInUserSubscription = this.isSubscription;
+ configurationManager.service.lastSignedInUserMembership = this.membershipLevel ? MS.Entertainment.Utilities.SignedInUser.membershipStringMap[this.membershipLevel] : MS.Entertainment.Utilities.SignedInUser.membershipStringMap.Silver;
+ configurationManager.service.lastSignedInUserGamerTag = this.gamerTag;
+ configurationManager.service.lastSignedInUserXuid = this.xuid;
+ configurationManager.service.lastSignedInUserCid = this._userCid;
+ configurationManager.service.lastSignedInUserSignInName = this.signInName;
+ configurationManager.service.lastSignedInUserAccountLocale = this.locale
+ }
+ }
+ }, {
+ factory: function factory() {
+ return new MS.Entertainment.Utilities.SignedInUser
+ }, _instanceCount: 0, _initialPuidLength: 16, _anidSliceLength: 24, _paddingForPuidHash: "FFFFFFFF", _encodedMaterialLength: 66, membershipStringMap: {
+ None: "None", Silver: "Free", Gold: "Gold", Family: "Family", FamilyGold: "FamilyGold"
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.signedInUser, MS.Entertainment.Utilities.SignedInUser.factory, true);
+ WinJS.Namespace.define("MS.Entertainment.Utilities", {SignIn: MS.Entertainment.UI.Framework.derive(MS.Entertainment.UI.Framework.ObservableBase, function SignIn_constructor() {
+ MS.Entertainment.Utilities.SignIn._instanceCount++;
+ MS.Entertainment.Utilities.assert(MS.Entertainment.Utilities.SignIn._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn)");
+ this._signInProvider = new Microsoft.Entertainment.Util.SignIn;
+ this._liveIdChangeCompleteHandler = this._liveIdChangeCompleteHandler.bind(this);
+ Object.defineProperty(this, "appNotificationService", {get: function _getAppNotificationService() {
+ if (!this._appNotificationService && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.appNotification))
+ this._appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ return this._appNotificationService
+ }.bind(this)});
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).service.enableNativeSignIn) {
+ var serviceEventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProvider;
+ this._signInEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this._signInProvider, {
+ signinstarted: function handleSignInStartedEvent() {
+ serviceEventProvider.traceServiceSignInStarted()
+ }, signoutstarted: function handleSignOutStartedEvent() {
+ serviceEventProvider.traceServiceSignOutStarted()
+ }, signincompleted: function handleSignInCompletedEvent() {
+ serviceEventProvider.traceServiceSignInCompleted()
+ }, signoutcompleted: function handleSignOutCompletedEvent() {
+ serviceEventProvider.traceServiceSignOutCompleted()
+ }
+ })
+ }
+ if (WinJS.Utilities.getMember("Social.UI")) {
+ Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", this._handleApp2AppResume.bind(this));
+ var profilePickerContainer = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePickerContainer);
+ if (profilePickerContainer && profilePickerContainer.firstElementChild) {
+ var pickerControlElement = profilePickerContainer.firstElementChild;
+ this.handleApp2CurrentUserChanged = this.handleApp2CurrentUserChanged.bind(this);
+ pickerControlElement.addEventListener("currentuserchanged", this.handleApp2CurrentUserChanged);
+ pickerControlElement.suppressUnload = true;
+ if (pickerControlElement.winControl)
+ pickerControlElement.winControl.domElement = profilePickerContainer.firstElementChild
+ }
+ }
+ }, {
+ isSignedIn: observableProperty("isSignedIn", false), isApp2UserAvailable: observableProperty("isApp2UserAvailable", false), isSigningIn: observableProperty("isSigningIn", false), signInError: observableProperty("signInError", 0), isSigningOut: observableProperty("isSigningOut", false), isSignInEnabled: observableProperty("isSignInEnabled", true), _partnerToken: null, _appNotificationService: null, _liveIdChangeTaskName: "LiveIdChange", _networkStatusBinding: null, _lastSignedInUserRegion: null, _signInStartTime: null, _offlineErrorRetryCount: 0, _lastRefreshSignInFailed: false, signIn: function signIn(dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowCredUI, dontShowTOS) {
+ var that = this;
+ if (this.isSignedIn)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.success);
+ else if (this.isSigningIn)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.signingIn);
+ else if (this.isSigningOut)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.signingOut);
+ else {
+ this.signInError = 0;
+ this.isSigningIn = true;
+ return this._doSignIn(dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowCredUI, dontShowTOS)
+ }
+ }, signInApp2User: function signInApp2User() {
+ if (!MS.Entertainment.Utilities.isApp2 || MS.Entertainment.isAppModeOverride)
+ return;
+ var currentUser = this.getAppCurrentUser();
+ if (!currentUser && !WinJS.Utilities.getMember("App2.ApplicationModel.Core.CoreApplicationContext.currentUser")) {
+ this.isApp2UserAvailable = false;
+ return
+ }
+ currentUser = App2.ApplicationModel.Core.CoreApplicationContext.currentUser;
+ if (!currentUser.isGuest && currentUser.isSignedIn) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configurationManager.service.lastSignedInUserXuid = currentUser.xboxUserId;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.xuid = currentUser.xboxUserId;
+ signedInUser.gamerTag = currentUser.displayInfo.gamertag;
+ this._updateCurrentUser(currentUser);
+ this.isApp2UserAvailable = true
+ }
+ else
+ this.isApp2UserAvailable = false
+ }, _authenticateUserHelper: function _authenticateUserHelper(dontShowNotifications) {
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ this._lastSignedInUserRegion = globalizationManager.getRegion();
+ return this.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport), true, Microsoft.Entertainment.Util.SignInPromptType.promptIfNeeded).then(function(passportTicket) {
+ return this._signInProvider.authenticateUser(passportTicket)
+ }.bind(this)).then(function authenticateUserSuccess() {
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignIn.SignInResult.success, false, false, false, false)
+ }.bind(this), function intialPassportTicketError(err) {
+ return this._onSignInComplete(err.number, false, true, true, true)
+ }.bind(this))
+ }, _doSignIn: function _doSignIn(dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowCredUI, dontShowTOS) {
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.retailExperience)
+ return WinJS.Promise.as();
+ this._signInStartTime = this._signInProvider.startTime = new Date;
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).service.enableNativeSignIn)
+ return this._authenticateUserHelper(dontShowNotifications);
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isSignInAvailable = false;
+ var isSupported = true;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ isSignInAvailable = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.musicSignInAvailable);
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ isSignInAvailable = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.videoSignInAvailable);
+ else
+ isSignInAvailable = true;
+ var stateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ isSupported = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer).checkAndRunUpgradeReminder(!dontShowErrors);
+ if (!isSupported || !stateService.servicesEnabled) {
+ this.isSignInEnabled = false;
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_VERSION_NOT_SUPPORTED, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }
+ if (!isSignInAvailable) {
+ this.isSignInEnabled = false;
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION, (dontShowErrors || MS.Entertainment.Utilities.isVideoApp2), dontShowAccountCreation, true, dontShowTOS)
+ }
+ var promptType = Microsoft.Entertainment.Util.SignInPromptType.promptIfNeeded;
+ if (dontShowCredUI)
+ promptType = Microsoft.Entertainment.Util.SignInPromptType.doNotPrompt;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.networkStatus && (uiStateService.networkStatus === MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none || uiStateService.networkStatus === MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly))
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS);
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ this._lastSignedInUserRegion = globalizationManager.getRegion();
+ var accountPickerPromise = WinJS.Promise.as();
+ if (MS.Entertainment.Utilities.isApp2) {
+ var currentUser = this.getAppCurrentUser();
+ if (!currentUser && App2 && App2.ApplicationModel && App2.ApplicationModel.Core && App2.ApplicationModel.Core.CoreApplicationContext)
+ currentUser = App2.ApplicationModel.Core.CoreApplicationContext.currentUser;
+ var useAccountPicker = !dontShowCredUI;
+ if ((!currentUser || currentUser.isGuest || !currentUser.isSignedIn) && useAccountPicker)
+ accountPickerPromise = MS.Entertainment.UI.Shell.AccountPicker.showAccountPickerAsync().then(function showAccountPickerAsyncComplete(result) {
+ if (!result || !result.user)
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignInErrors.NO_CONNECTED_ACCOUNT, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS);
+ this._updateCurrentUser(result.user);
+ if (WinJS.Utilities.getMember("Social.UI")) {
+ var profilePicker = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePicker);
+ if (profilePicker)
+ profilePicker.currentUser = result.user
+ }
+ }.bind(this), function showAccountPickerAsyncError(error) {
+ var dontShowErrorMessage = dontShowErrors;
+ if (WinJS.Promise.isCanceledError(error))
+ dontShowErrorMessage = true;
+ return this._onSignInComplete(error, dontShowErrorMessage, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this));
+ else if (currentUser && currentUser.isSignedIn && !currentUser.isGuest)
+ this._updateCurrentUser(currentUser)
+ }
+ return accountPickerPromise.then(function accountPickerComplete() {
+ var intialPassportTicketRequest = WinJS.Promise.as(String.empty);
+ if (!MS.Entertainment.Utilities.isAmsterdamApp)
+ intialPassportTicketRequest = this.getPassportTicket(MS.Entertainment.Utilities.SignIn.TicketType.MBI_SSL, MS.Entertainment.Endpoint.load(MS.Entertainment.Endpoint.id.seid_Passport), true, promptType);
+ return intialPassportTicketRequest.then(function getPassportTicketSuccess(passportTicket) {
+ if (!(Windows.ApplicationModel.Search && MS.Entertainment.Utilities.isApp2))
+ MS.Entertainment.Utilities.assert(passportTicket, "No passport ticket");
+ if (this.appNotificationService) {
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError);
+ if (!dontShowNotifications)
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_SIGNIN_PROGRESS), subTitle: String.empty, moreDetails: String.empty, icon: WinJS.UI.AppBarIcon.sync, action: null, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo, isPersistent: true, iconClassName: MS.Entertainment.Utilities.SignIn.NotificationIconClass
+ }))
+ }
+ return this._signInInternal(passportTicket).then(function signInInternalSuccess() {
+ return this._onSignInComplete(MS.Entertainment.Utilities.SignIn.SignInResult.success, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this), function signInInternalError(err) {
+ return this._onSignInComplete(err.number, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this))
+ }.bind(this), function getPassportTicketError(errTicket) {
+ return this._onSignInComplete(errTicket.number, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS)
+ }.bind(this))
+ }.bind(this))
+ }, _registerUserChangedEvents: function _registerUserChangedEvents() {
+ if (!MS.Entertainment.Utilities.isApp2) {
+ this._unregisterLiveIdChangeEvent();
+ this._registerLiveIdChangeEvent()
+ }
+ }, _handleApp2AppResume: function _handleApp2AppResume(eventArgs) {
+ var profilePicker = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.profilePicker);
+ if (profilePicker && profilePicker._currentUserChanged)
+ profilePicker._currentUserChanged()
+ }, handleApp2CurrentUserChanged: function handleApp2CurrentUserChanged(eventArgs) {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProvider;
+ eventProvider.traceServiceUserChanged("handleApp2CurrentUserChanged invoked");
+ var newUser = null;
+ if (eventArgs && eventArgs.detail)
+ newUser = eventArgs.detail.newCurrentUser;
+ if (!newUser || (newUser.isGuest || !newUser.isSignedIn)) {
+ this.signOut();
+ return
+ }
+ eventProvider.traceServiceUserChanged("New User:" + newUser.xboxUserId);
+ var previousUser = null;
+ try {
+ previousUser = this._signInProvider.currentUser
+ }
+ catch(ex) {}
+ if (!this.isSignedIn || !previousUser || (previousUser.xboxUserId !== newUser.xboxUserId)) {
+ if (previousUser && newUser && (previousUser.xboxUserId !== newUser.xboxUserId))
+ this._showLoadingCursorOnUserSwitch();
+ this.signOut().then(function signOutComplete() {
+ this._updateCurrentUser(newUser);
+ this.signIn()
+ }.bind(this))
+ }
+ else if (previousUser && previousUser.xboxUserId === newUser.xboxUserId)
+ this._updateCurrentUser(newUser)
+ }, _showLoadingCursorOnUserSwitch: function _showLoadingCursorOnUserSwitch() {
+ MS.Entertainment.UI.Controls.Overlay.showLoadingOverlay({
+ userControl: "MS.Entertainment.UI.Controls.LoadingControl", hideOnNowPlaying: true, enableKeyboardLightDismiss: false, onInitialize: function setModel(overlayContent) {
+ var progressControl = document.createElement("progress");
+ WinJS.Utilities.addClass(progressControl, "loadingRing win-ring win-large");
+ overlayContent.appendChild(progressControl);
+ return WinJS.Promise.wrap()
+ }, userControlOptions: {
+ isBusy: true, height: null, displayDelay: 0
+ }, overlayCustomStyle: "loadingControlOverlayBackground", showAnimation: function showAnimation(element) {
+ WinJS.Utilities.addClass(element, "fadeIn");
+ return WinJS.Promise.as()
+ }, hideAnimation: function hideAnimation(element) {
+ WinJS.Utilities.removeClass(element, "fadeIn");
+ WinJS.Utilities.addClass(element, "fadeOut");
+ return WinJS.Promise.as()
+ }, closeTimeoutMS: MS.Entertainment.Utilities.SignIn.SIGNIN_SWITCH_USER_LOAD_TIMEOUT
+ })
+ }, _updateCurrentUser: function _updateCurrentUser(newUser) {
+ if (newUser === undefined)
+ MS.Entertainment.Utilities.fail("signIn.js _updateCurrentUser: newUser is undefined");
+ var oldUser = null;
+ try {
+ oldUser = this._signInProvider.currentUser
+ }
+ catch(ex) {}
+ this._signInProvider.currentUser = newUser
+ }, _registerLiveIdChangeEvent: function _registerLiveIdChangeEvent() {
+ try {
+ var trigger = new Windows.ApplicationModel.Background.SystemTrigger(Windows.ApplicationModel.Background.SystemTriggerType.onlineIdConnectedStateChange, false);
+ var taskBuilder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder;
+ taskBuilder.name = this._liveIdChangeTaskName;
+ taskBuilder.taskEntryPoint = "LiveIdChange.js";
+ taskBuilder.setTrigger(trigger);
+ var task = taskBuilder.register();
+ task.addEventListener("completed", this._liveIdChangeCompleteHandler)
+ }
+ catch(ex) {}
+ }, _unregisterLiveIdChangeEvent: function _unregisterLiveIdChangeEvent() {
+ var iterator = Windows.ApplicationModel.Background.BackgroundTaskRegistration.allTasks.first();
+ var hasCurrentTask = iterator.hasCurrent;
+ while (hasCurrentTask) {
+ var currentTask = iterator.current.value;
+ if (currentTask.name === this._liveIdChangeTaskName)
+ currentTask.unregister(true);
+ hasCurrentTask = iterator.moveNext()
+ }
+ }, _liveIdChangeCompleteHandler: function _liveIdChangeCompleteHandler() {
+ this.signOut().then(function signOutComplete() {
+ this.signInOnStart()
+ }.bind(this))
+ }, getAppCurrentUser: function getAppCurrentUser() {
+ var user;
+ try {
+ user = this._signInProvider.currentUser;
+ if (!(user && user.isSignedIn))
+ user = null
+ }
+ catch(ex) {}
+ return user
+ }, getToBeProvisionedUserName: function getToBeProvisionedUserName() {
+ var user;
+ try {
+ user = this._signInProvider.signInName
+ }
+ catch(ex) {}
+ return user
+ }, switchCurrentUser: function switchCurrentUser() {
+ MS.Entertainment.UI.Shell.AccountPicker.showAccountPickerAsync().done(function showAccountPickerAsyncComplete(result) {
+ if (!result || !result.user)
+ return;
+ var previousUser = this.getAppCurrentUser();
+ if (previousUser && previousUser.xboxUserId !== result.user.xboxUserId)
+ this.signOut().done(function signOutComplete() {
+ this._updateCurrentUser(result.user);
+ this.signIn()
+ }.bind(this))
+ }.bind(this), null)
+ }, signInOnStart: function signInOnStart() {
+ return this.signIn(true, true, false, true, false).then(null, function signInError(){})
+ }, getSignInPromise: function getSignInPromise() {
+ var signedInSignal = new MS.Entertainment.UI.Framework.Signal;
+ var signInBindings;
+ var signInPromise = WinJS.Promise.wrap();
+ var cleanupSignInBindings = function() {
+ if (!signInBindings)
+ return;
+ signInBindings.cancel();
+ signInBindings = null;
+ signedInSignal.complete()
+ };
+ if (this.isSigningIn) {
+ signInBindings = WinJS.Binding.bind(this, {isSigningIn: cleanupSignInBindings});
+ signInPromise = signedInSignal.promise
+ }
+ return signInPromise
+ }, signOut: function signOut(forceSignOut, persistUserDB, dontShowNotifications) {
+ if (this.isSigningOut)
+ return WinJS.Promise.wrap(MS.Entertainment.Utilities.SignIn.SignInResult.signingOut);
+ this.isSigningOut = true;
+ var signOutComplete = function signOutComplete(signOutResult, dontShowNotifications) {
+ if (this.isSignedIn) {
+ this.isSignedIn = this.isApp2UserAvailable = false;
+ if (MS.Entertainment.Utilities.isApp2)
+ this._updateCurrentUser(null);
+ this.signInError = MS.Entertainment.Utilities.SignInErrors.ZEST_E_SIGNIN_REQUIRED;
+ this.isSigningIn = false;
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.alwaysPromptOnPurchase = true;
+ (new Microsoft.Entertainment.Configuration.ConfigurationManager).generalSettings.promptOnPurchaseFirstRun = true;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.refresh(null, forceSignOut);
+ MS.Entertainment.Utilities.SignIn.dispatchEvent("signOutComplete", true);
+ if (!forceSignOut)
+ this._resetNavigationState()
+ }
+ this.isSigningOut = false;
+ if (this._refreshSignInPromise) {
+ this._refreshSignInPromise.cancel();
+ this._refreshSignInPromise = null
+ }
+ if (!dontShowNotifications)
+ this._showSignInNotification();
+ if (!forceSignOut) {
+ this._lastSignedInUserRegion = null;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configurationManager.service.lastSignInAccountRegion = ""
+ }
+ var signOutResultText = signOutResult;
+ if (typeof signOutResult === "number")
+ signOutResultText = MS.Entertainment.Utilities.convertToHexString(signOutResult);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SignOutResult, parameterValue: signOutResultText
+ }, {
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ForceSignOut, parameterValue: !!forceSignOut
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignOut, telemetryParameterArray);
+ return signOutResult
+ }.bind(this);
+ if (this.isSignedIn || forceSignOut)
+ return this._signOutInternal(persistUserDB).then(function(signIn) {
+ return signOutComplete(MS.Entertainment.Utilities.SignIn.SignInResult.success, dontShowNotifications)
+ }, function(err) {
+ return signOutComplete(err.number, dontShowNotifications)
+ });
+ else {
+ this.isSigningOut = false;
+ return WinJS.Promise.wrap()
+ }
+ }, forgetUserInformation: function forgetUserInformation()
+ {
+ return Microsoft.Entertainment.Fulfillment.Reading.Entitlements.clearUserHashAsync().then(function() {
+ return MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn)._forgetUserInformationInternal()
+ })
+ }, _resetNavigationState: function resetNavigationState() {
+ var navigationService = null;
+ var winJSNavigationService = null;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.videoQueryCacheService)) {
+ var videoQueryCacheService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.videoQueryCacheService);
+ videoQueryCacheService.reloadQueries()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ navigationService.navigateToDefaultPage()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)) {
+ winJSNavigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ winJSNavigationService.navigateToDefault()
+ }
+ }, getPassportTicket: function getPassportTicket(policy, service, ignoreSignInState, promptType) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if ((this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired)) || ignoreSignInState)
+ return this._getPassportTicketInternal(policy, service, ignoreSignInState, promptType).then(function(passport) {
+ if (passport)
+ return passport.passportTicket
+ });
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getWebAuthToken: function getWebAuthToken(startUri, endUri, ignoreSignInState, webAuthOptions) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ var WebAuthOptions = Windows.Security.Authentication.Web.WebAuthenticationOptions;
+ if ((this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired)) || ignoreSignInState)
+ return Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAsync(webAuthOptions || WebAuthOptions.none, startUri, endUri).then(function(result) {
+ var WebAuthStatus = Windows.Security.Authentication.Web.WebAuthenticationStatus;
+ switch (result.responseStatus) {
+ case WebAuthStatus.errorHttp:
+ return WinJS.Promise.wrapError(result.responseData);
+ break;
+ case WebAuthStatus.userCancel:
+ return WinJS.Promise.cancel;
+ break;
+ case WebAuthStatus.success:
+ return result.responseData;
+ break
+ }
+ });
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getAuthHeaderForEndpoint: function getAuthHeaderForEndpoint(endpointId, ignoreSignInState) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if (this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired))
+ return this._getAuthHeaderForEndpointInternal(endpointId, ignoreSignInState).then(function complete(result) {
+ this._triggerRefreshIfNeeded();
+ return result
+ }.bind(this), function error(err) {
+ if (err.number)
+ this._sendXSTSTelemetry(err.number);
+ return WinJS.Promise.wrapError(err)
+ }.bind(this));
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getAuthHeader: function getAuthHeader() {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if (this.isSignedIn && (!upgradeService || !upgradeService.upgradeRequired))
+ return this._getAuthHeaderInternal().then(function complete(result) {
+ this._triggerRefreshIfNeeded();
+ return result
+ }.bind(this), function error(err) {
+ if (err.number)
+ this._sendXSTSTelemetry(err.number);
+ return WinJS.Promise.wrapError(err)
+ }.bind(this));
+ else
+ return WinJS.Promise.wrapError(null)
+ }, getXToken: function getXToken(endpointId, ignoreSignInState) {
+ return this._getXToken(function() {
+ return this._getXTokenInternal(endpointId)
+ }.bind(this), ignoreSignInState)
+ }, getXTokenByRelyingParty: function getXTokenByRelyingParty(relyingParty, ignoreSignInState) {
+ return this._getXToken(function() {
+ return this._getXTokenByRelyingPartyInternal(relyingParty)
+ }.bind(this), ignoreSignInState)
+ }, _getXToken: function _getXToken(nativeOperation, ignoreSignInState) {
+ var upgradeService;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.upgradeReminderDisplayer))
+ upgradeService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.upgradeReminderDisplayer);
+ if ((this.isSignedIn || this.isApp2UserAvailable) && (!upgradeService || !upgradeService.upgradeRequired) || ignoreSignInState)
+ return nativeOperation().then(function complete(result) {
+ if (result) {
+ this._triggerRefreshIfNeeded();
+ return {
+ key: "Authorization", value: result.token
+ }
+ }
+ }.bind(this), function error(err) {
+ return WinJS.Promise.wrapError(err)
+ });
+ else
+ return WinJS.Promise.wrapError(null)
+ }, _triggerRefreshIfNeeded: function _triggerRefreshIfNeeded() {
+ if (this._lastRefreshSignInFailed) {
+ this._refreshSignIn(MS.Entertainment.Utilities.SignIn.SIGNIN_REFRESH_INTERVAL_OVERRIDE);
+ this._lastRefreshSignInFailed = false
+ }
+ }, setIsSignInSupported: function setIsSignInSupported(isSupported) {
+ this._signInProvider.isSignInSupported = isSupported
+ }, _sendXSTSTelemetry: function _sendXSTSTelemetry(result) {
+ var authHeaderResultText = result;
+ if (typeof result === "number")
+ authHeaderResultText = "0x" + (result + 0xFFFFFFFF + 1).toString(16);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AuthHeaderResultText, parameterValue: authHeaderResultText
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.AuthHeaderResult, telemetryParameterArray)
+ }, refreshSignInState: function refreshSignInState() {
+ this._signInProvider.clearTokenMap();
+ return this._doSignIn(true, true, true, true, true)
+ }, provisionUserAccount: function provisionUserAccount() {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.provisionUserAccount()
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _onSignInComplete: function _onSignInComplete(signInResult, dontShowErrors, dontShowAccountCreation, dontShowNotifications, dontShowTOS) {
+ this.isSigningIn = false;
+ this.isSignedIn = this.isApp2UserAvailable = this._signInProvider.isSignedIn();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (this.isSignedIn) {
+ this.signInError = 0;
+ if (this.appNotificationService) {
+ if (!dontShowNotifications)
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_SIGNIN_COMPLETE), subTitle: String.empty, moreDetails: null, icon: MS.Entertainment.UI.Icon.player, action: null, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo, isPersistent: false
+ }));
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError)
+ }
+ }
+ else {
+ if (this.appNotificationService)
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo);
+ this.signInError = signInResult
+ }
+ if (this.isSignedIn) {
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.refresh(this._signInProvider);
+ MS.Entertainment.Utilities.SignIn.dispatchEvent("signInComplete", true);
+ if (this._partnerToken)
+ this._sendPartnerTokenToMDS(this._partnerToken);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.richPresence)) {
+ var richPresenceService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.richPresence);
+ richPresenceService.setRichPresence(MS.Entertainment.Services.RichPresenceActionType.browsingApp)
+ }
+ }
+ this._sendTelemetry(signInResult);
+ this._registerUserChangedEvents();
+ var that = this;
+ switch (signInResult) {
+ case MS.Entertainment.Utilities.SignIn.SignInResult.success:
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ var userXboxRegion = globalizationManager.getRegion();
+ var userAccountRegion = this._lastSignedInUserRegion;
+ if (userAccountRegion !== userXboxRegion) {
+ var userRegionSupported = this._checkUserRegionIsSupported(userXboxRegion);
+ if (userRegionSupported)
+ if (MS.Entertainment.Utilities.isApp1)
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_SIGNIN_MIXED_REGION_ERROR_TITLE), String.load(String.id.IDS_SIGNIN_MIXED_REGION_ERROR_DESC)).done(function() {
+ MSApp.terminateApp(new Error("Region Changed because signed in user has different xbox live region"))
+ });
+ else
+ this._resetNavigationState();
+ else {
+ if (this.appNotificationService)
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo);
+ if (!userRegionSupported) {
+ this.signInError = MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION;
+ this._sendTelemetry(this.signInError)
+ }
+ this._lastSignedInUserRegion = null;
+ configurationManager.service.lastSignInAccountRegion = String.empty;
+ if (!dontShowErrors) {
+ var msgPromise = MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION);
+ return msgPromise.then(function showSignInErrorComplete() {
+ that.signOut(true, false, dontShowNotifications);
+ return MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION
+ })
+ }
+ else {
+ this.signOut(true, false, dontShowNotifications);
+ return WinJS.Promise.wrapError(MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION)
+ }
+ }
+ }
+ this._offlineErrorRetryCount = 0;
+ that._refreshSignIn();
+ return WinJS.Promise.wrap(signInResult);
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED:
+ case MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_CREATION_REQUIRED:
+ if (!dontShowAccountCreation && !MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.Accounts.AccountProvisioningDialog.showAccountProvisioningDialog().then(function createAccountComplete() {
+ return this.signIn(true, true, false, true, true)
+ }.bind(this), function createAccountError(error) {
+ if (error.number === MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_CHILD_ACCOUNT_CREATION_BLOCKED || error.number === MS.Entertainment.Utilities.SignInErrors.ONL_E_PARENTAL_CONSENT_REQUIRED)
+ return MS.Entertainment.Accounts.ChildAccountProvisioningDialog.showChildAccountProvisioningDialog().then(function childAccountProvisioningComplete() {
+ return this.signIn(true, true, false, true, true)
+ }.bind(this));
+ else
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), error.number).then(function callSignIn() {
+ return this.signIn(true, true, false, true, true)
+ }.bind(this))
+ }.bind(this));
+ else {
+ this.signOut(true, false, dontShowNotifications);
+ return WinJS.Promise.wrapError(signInResult)
+ }
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_TERMS_OF_SERVICE:
+ case MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_TERMS_OF_USE_NOT_ACCEPTED:
+ if (!dontShowTOS && !MS.Entertainment.Utilities.isApp2)
+ return MS.Entertainment.Accounts.AcceptTermsOfService.doAcceptTermsOfService().then(function acceptTermsOfServiceComplete() {
+ return that.signIn(true, true, false, true, true)
+ });
+ else {
+ this.signOut(true, true);
+ return WinJS.Promise.wrapError(signInResult)
+ }
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_VERSION_NOT_SUPPORTED:
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NO_CONNECTED_ACCOUNT:
+ this._showSignInNotification();
+ var persistUserDB = true;
+ if (configurationManager.service.lastSignedInUserGamerTag && configurationManager.service.lastSignedInUserGamerTag !== String.empty)
+ persistUserDB = false;
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ signedInUser.refresh(null);
+ this.signOut(true, persistUserDB, true);
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.ERROR_NETWORK_UNREACHABLE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_RESOURCE_NOT_FOUND:
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_DOWNLOAD_FAILURE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_CONNECTION_TIMEOUT:
+ case MS.Entertainment.Utilities.SignInErrors.XBL_SERVER_CONNECTION_FAILURE:
+ this._resetNetworkStatusBinding();
+ this._offlineErrorRetryCount++;
+ if (this._offlineErrorRetryCount < configurationManager.service.signInNetworkErrorRetryCount)
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this._onNetworkStatusChanged.bind(this)});
+ else
+ this._showSignInNotification();
+ if (!dontShowErrors)
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE).then(function showSignInErrorComplete() {
+ return signInResult
+ });
+ else
+ return WinJS.Promise.wrapError(signInResult);
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION:
+ if (!dontShowErrors)
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), signInResult).then(function showSignInErrorComplete() {
+ that.signOut(true, false, dontShowNotifications);
+ return signInResult
+ });
+ else {
+ this.signOut(true, false, dontShowNotifications);
+ return WinJS.Promise.wrapError(signInResult)
+ }
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_INVALID_USERNAME_AND_PASSWORD:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_FORCESIGNIN:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_ACCESS_DENIED_BY_TOU:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_PASSWORD_UPDATE_REQUIRED:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_ACCOUNT_UPDATE_REQUIRED:
+ case MS.Entertainment.Utilities.SignInErrors.ONL_E_ACTION_REQUIRED:
+ return this.signIn();
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_NO_ACCOUNT_PROOF:
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_ACCOUNT_PROOF_NOT_VERIFIED:
+ return this.signIn();
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.ZUNE_E_SIGNIN_ERROR_CANCELLED:
+ this._showSignInNotification();
+ return WinJS.Promise.wrapError(signInResult);
+ default:
+ var that = this;
+ var signInAction = WinJS.Utilities.markSupportedForProcessing(function() {
+ that.signIn()
+ });
+ if (this.appNotificationService)
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Critical, title: String.load(String.id.IDS_SIGNIN_ERROR), subTitle: String.load(String.id.IDS_SIGNIN_RETRY), moreDetails: null, icon: WinJS.UI.AppBarIcon.sync, action: signInAction, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError, isPersistent: true
+ }));
+ this.signOut(true, true);
+ if (!dontShowErrors)
+ return MS.Entertainment.UI.Shell.showError(String.load(String.id.IDS_SIGNIN_ERROR_CAPTION), signInResult).then(function showSignInErrorComplete() {
+ return signInResult
+ });
+ else
+ return WinJS.Promise.wrapError(signInResult);
+ break
+ }
+ return WinJS.Promise.wrapError(signInResult)
+ }, _checkUserRegionIsSupported: function _checkUserRegionIsSupported(userRegion) {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var supportedRegions;
+ var isSignInSupported = true;
+ if (MS.Entertainment.Utilities.isMusicApp)
+ supportedRegions = config.features.musicSignInAvailable;
+ else if (MS.Entertainment.Utilities.isVideoApp)
+ supportedRegions = config.features.videoSignInAvailable;
+ else
+ isSignInSupported = true;
+ if (supportedRegions !== "ALL" && supportedRegions.toLowerCase().indexOf(userRegion.toLowerCase()) < 0)
+ isSignInSupported = false;
+ return isSignInSupported
+ }, _onNetworkStatusChanged: function _onNetworkStatusChanged(newValue) {
+ switch (newValue) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ if (!this.isSignedIn)
+ WinJS.Promise.timeout(1000).then(function _delay() {
+ this.signIn(true, true, false, true, true).done(function success() {
+ this._resetNetworkStatusBinding()
+ }.bind(this), function error() {
+ this._resetNetworkStatusBinding()
+ }.bind(this))
+ }.bind(this));
+ break
+ }
+ }, _resetNetworkStatusBinding: function _resetNetworkStatusBinding() {
+ if (this._networkStatusBinding) {
+ this._networkStatusBinding.cancel();
+ this._networkStatusBinding = null
+ }
+ }, _launchStore: function _launchStore() {
+ var launchInfo = "ms-windows-store:Updates";
+ var appAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.launchApp);
+ appAction.automationId = MS.Entertainment.UI.AutomationIds.launchAppStoreUpgrade;
+ appAction.parameter = {
+ uri: launchInfo, appendSource: true, appendGamerTag: false
+ };
+ appAction.execute()
+ }, _isNetworkError: function _isNetworkError(error) {
+ switch (error) {
+ case MS.Entertainment.Utilities.SignInErrors.ERROR_NETWORK_UNREACHABLE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_RESOURCE_NOT_FOUND:
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_WMPIM_USEROFFLINE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_DOWNLOAD_FAILURE:
+ case MS.Entertainment.Utilities.SignInErrors.INET_E_CONNECTION_TIMEOUT:
+ case MS.Entertainment.Utilities.SignInErrors.XBL_SERVER_CONNECTION_FAILURE:
+ return true;
+ default:
+ return false
+ }
+ return false
+ }, _refreshSignIn: function _refreshSignIn(signInInterval) {
+ var refreshInterval = signInInterval ? signInInterval : MS.Entertainment.Utilities.SignIn.SIGNIN_REFRESH_INTERVAL;
+ if (this._refreshSignInPromise) {
+ this._refreshSignInPromise.cancel();
+ this._refreshSignInPromise = null
+ }
+ this._refreshSignInPromise = WinJS.Promise.timeout(refreshInterval).then(function _silentSignIn() {
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.ServiceEventProvider;
+ eventProvider.traceServiceRefreshSignInStarted();
+ var requestNetwork = function requestNetwork() {
+ if (MS.Entertainment.Utilities.isMusicApp1) {
+ var sessionManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ return sessionManager.requestNetworkAndDelay("SignIn")
+ }
+ else
+ return WinJS.Promise.as()
+ };
+ requestNetwork().then(function onNetworkRequested(networkReleaseHandle) {
+ this._doSignIn(true, true, true, true, true).then(function success() {
+ eventProvider.traceServiceRefreshSignInCompleted();
+ MS.Entertainment.Utilities.SignIn.dispatchEvent("signInRefreshed", true);
+ this._signInProvider.clearTokenMap();
+ MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount = 3;
+ this._lastRefreshSignInFailed = false;
+ if (networkReleaseHandle)
+ networkReleaseHandle.release()
+ }.bind(this), function error(signInResult) {
+ var signInResultText = signInResult;
+ if (typeof signInResult === "number")
+ signInResultText = MS.Entertainment.Utilities.convertToHexString(signInResult);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.RefreshSignInResult, parameterValue: signInResultText
+ }];
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignIn, telemetryParameterArray);
+ this._signInProvider.clearTokenMap();
+ if (this._isNetworkError(signInResult))
+ if (MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount > 0) {
+ MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount--;
+ this._refreshSignIn(MS.Entertainment.Utilities.SignIn.SIGNIN_REFRESH_INTERVAL_OVERRIDE)
+ }
+ else {
+ MS.Entertainment.Utilities.SignIn._signInRefreshRetryCount = 3;
+ this._lastRefreshSignInFailed = true
+ }
+ else
+ this._lastRefreshSignInFailed = true;
+ if (networkReleaseHandle)
+ networkReleaseHandle.release()
+ }.bind(this))
+ }.bind(this))
+ }.bind(this))
+ }, _signInInternal: function _signInInternal(passportTicket) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.signInUser(passportTicket)
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _signOutInternal: function _signOutInternal(persistUserDB) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.signOut(persistUserDB || false)
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _forgetUserInformationInternal: function _forgetUserInformationInternal() {
+ var asyncForgetUserInformationOp = null;
+ try {
+ asyncForgetUserInformationOp = this._signInProvider.forgetUserInformation()
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncForgetUserInformationOp
+ }, _getPassportTicketInternal: function _getPassportTicketInternal(policy, service, ignoreSignInState, promptType) {
+ var asyncSignInOp = null;
+ if (!promptType)
+ promptType = Microsoft.Entertainment.Util.SignInPromptType.promptIfNeeded;
+ try {
+ asyncSignInOp = this._signInProvider.getTicket(policy, service, ignoreSignInState, promptType)
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _getAuthHeaderForEndpointInternal: function _getAuthHeaderForEndpointInternal(endpointId, ignoreSignInState) {
+ var asyncAuthHeaderOp = null;
+ try {
+ asyncAuthHeaderOp = this._signInProvider.getAuthHeaderForEndpoint(endpointId, ignoreSignInState)
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncAuthHeaderOp
+ }, _getAuthHeaderInternal: function _getAuthHeaderInternal() {
+ var asyncAuthHeaderOp = null;
+ try {
+ asyncAuthHeaderOp = this._signInProvider.getAuthHeader()
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncAuthHeaderOp
+ }, _getXTokenInternal: function _getXTokenInternal(endpointId) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.getXTokenAsyncOp(endpointId)
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _getXTokenByRelyingPartyInternal: function _getXTokenByRelyingPartyInternal(endpointId) {
+ var asyncSignInOp = null;
+ try {
+ asyncSignInOp = this._signInProvider.getXTokenByRelyingPartyAsyncOp(endpointId)
+ }
+ catch(err) {
+ return WinJS.Promise.wrapError(err)
+ }
+ return asyncSignInOp
+ }, _sendTelemetry: function _sendTelemetry(signInResult) {
+ var signInResultText = signInResult;
+ if (typeof signInResult === "number")
+ signInResultText = MS.Entertainment.Utilities.convertToHexString(signInResult);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ eventProvider.traceSignInResult(signInResultText);
+ var telemetryParameterArray = [{
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SignInResult, parameterValue: signInResultText
+ }];
+ switch (signInResult) {
+ case MS.Entertainment.Utilities.SignIn.SignInResult.success:
+ var signedInUser = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signedInUser);
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.ZunePass, parameterValue: signedInUser.isSubscription
+ });
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CanSignOut, parameterValue: signedInUser.canSignOut
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NO_CONNECTED_ACCOUNT:
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.NoConnectedAccount, parameterValue: true
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED:
+ case MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_CREATION_REQUIRED:
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.CreateAccount, parameterValue: true
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_TERMS_OF_SERVICE:
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.AcceptTermsOfService, parameterValue: true
+ });
+ break;
+ case MS.Entertainment.Utilities.SignInErrors.NS_E_SIGNIN_NOT_SUPPORTED_REGION:
+ var region = (new Microsoft.Entertainment.Configuration.ConfigurationManager).service.lastSignInAccountRegion;
+ if (!region) {
+ var globalizationManager = new Microsoft.Entertainment.Util.GlobalizationManager;
+ region = globalizationManager.getRegion()
+ }
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.UnsupportedRegion, parameterValue: region
+ });
+ break;
+ default:
+ break
+ }
+ var stopTime = new Date;
+ var durationMsec;
+ if (this._signInStartTime) {
+ durationMsec = stopTime.valueOf() - this._signInStartTime.valueOf();
+ this._signInStartTime = null
+ }
+ if (durationMsec) {
+ if (durationMsec < 0)
+ durationMsec = -10 * 60 * 1000;
+ else if (durationMsec > 5 * 60 * 1000)
+ durationMsec = 10 * 60 * 1000;
+ telemetryParameterArray.push({
+ parameterName: MS.Entertainment.Utilities.Telemetry.TelemetryParameterNames.SignInDuration, parameterValue: durationMsec.toString()
+ })
+ }
+ MS.Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(MS.Entertainment.Utilities.Telemetry.TelemetryEvents.SignIn, telemetryParameterArray)
+ }, _showSignInNotification: function _showSignInNotification() {
+ if (!this.appNotificationService)
+ return;
+ var signInAction = WinJS.Utilities.markSupportedForProcessing(function() {
+ this.signIn().done(null, function(){})
+ }.bind(this));
+ var notificationTitle;
+ var notificationSubtitle;
+ var notificationIcon;
+ if (this.signInError === MS.Entertainment.Utilities.SignInErrors.XONLINE_E_WCMUSIC_ACCOUNT_NOT_PROVISIONED || this.signInError === MS.Entertainment.Utilities.SignInErrors.XO_E_ACCOUNT_CREATION_REQUIRED) {
+ notificationTitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE);
+ notificationSubtitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT);
+ notificationIcon = WinJS.UI.AppBarIcon.sync
+ }
+ else {
+ notificationTitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE);
+ notificationSubtitle = String.load(String.id.IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT);
+ notificationIcon = WinJS.UI.AppBarIcon.sync
+ }
+ this.appNotificationService.removeNotificationByCategory(MS.Entertainment.Utilities.SignIn.NotificationCategory.signInInfo);
+ this.appNotificationService.send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Critical, title: notificationTitle, subTitle: notificationSubtitle, moreDetails: null, icon: notificationIcon, action: signInAction, category: MS.Entertainment.Utilities.SignIn.NotificationCategory.signInError, isPersistent: true
+ }))
+ }, _sendPartnerTokenToMDS: function _sendPartnerTokenToMDS(partnerToken) {
+ var mdsCall = this._signInProvider.updatePartnerToken(partnerToken);
+ mdsCall.then(null, function(e) {
+ MS.Entertainment.Utilities.fail("Error trying to send partnerToken to MDS: " + (e & e.message))
+ }).done(function() {
+ this._partnerToken = null
+ }.bind(this))
+ }, updatePartnerToken: function updatePartnerToken(partnerToken) {
+ MS.Entertainment.Utilities.assert(partnerToken, "No partner token provided to sign in");
+ if (!partnerToken)
+ return;
+ if (this.isSignedIn)
+ this._sendPartnerTokenToMDS(partnerToken);
+ else
+ this._partnerToken = partnerToken
+ }
+ }, {
+ factory: function factory() {
+ return new MS.Entertainment.Utilities.SignIn
+ }, TicketType: {
+ MBI: "MBI", MBI_SSL: "MBI_SSL", HBI: "HBI", SA_20MIN: "SA_20MIN", JWT: "JWT"
+ }, SignInResult: {
+ success: "success", cancel: "cancel", signingIn: "signingIn", signingOut: "signingOut"
+ }, NotificationCategory: {
+ signInError: "signInError", signInInfo: "signInInfo"
+ }, NotificationIconClass: "rotate360Animation", _instanceCount: 0, listeners: null, SIGNIN_REFRESH_INTERVAL: 3 * 3600 * 1000, SIGNIN_REFRESH_INTERVAL_OVERRIDE: 900 * 1000, SIGNIN_SWITCH_USER_LOAD_TIMEOUT: 30 * 1000, _signInRefreshRetryCount: 3, addEventListener: function(eventType, listener, capture) {
+ if (MS.Entertainment.Utilities.SignIn.listeners === null) {
+ var ListenerType = WinJS.Class.mix(WinJS.Class.define(null), WinJS.Utilities.eventMixin);
+ MS.Entertainment.Utilities.SignIn.listeners = new ListenerType
+ }
+ MS.Entertainment.Utilities.SignIn.listeners.addEventListener(eventType, listener, capture)
+ }, dispatchEvent: function(eventType, details) {
+ if (MS.Entertainment.Utilities.SignIn.listeners !== null)
+ return MS.Entertainment.Utilities.SignIn.listeners.dispatchEvent(eventType, details)
+ }, removeEventListener: function(eventType, listener, capture) {
+ MS.Entertainment.Utilities.SignIn.listeners.removeEventListener(eventType, listener, capture)
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.signIn, MS.Entertainment.Utilities.SignIn.factory, true);
+ WinJS.Namespace.define("MS.Entertainment.UI.Actions", {
+ signIn: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function signInAction() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.signIn, executed: function executed() {
+ var commandingPopOver = MS.Entertainment.UI.Controls.CommandingPopOver;
+ if (commandingPopOver)
+ commandingPopOver.hideCurrentCommandingPopover();
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signIn().done(null, function(){})
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })
+ }), signInRequiredNavigate: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.navigate, function signInRequiredNavigate_constructor() {
+ this.base();
+ MS.Entertainment.Utilities.SignIn.addEventListener("signInComplete", this.requeryCanExecute.bind(this), false);
+ MS.Entertainment.Utilities.SignIn.addEventListener("signOutComplete", this.requeryCanExecute.bind(this), false)
+ }, {canExecute: function signInRequiredNavigate_canExecute(param) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return signIn.isSignedIn
+ }})
+ }), signInAndOnlineRequiredNavigate: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.signInRequiredNavigate, function signInAndOnlineRequiredNavigate_constructor() {
+ this.base();
+ this._networkStatusBinding = WinJS.Binding.bind(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState), {networkStatus: this.onNetworkStatusChanged.bind(this)})
+ }, {
+ _networkStatusBinding: null, _isOnline: null, canExecute: function signInAndOnlineRequiredNavigate_canExecute(param) {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return (signIn.isSignedIn && this._isOnline)
+ }, onNetworkStatusChanged: function onNetworkStatusChanged(newValue) {
+ var isOnline = this.isNetworkStatusCodeOnline(newValue);
+ if (isOnline !== this._isOnline)
+ this._isOnline = isOnline
+ }, isNetworkStatusCodeOnline: function isNetworkStatusCodeOnline(status) {
+ var isOnline = false;
+ switch (status) {
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unknown:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.unrestricted:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.throttled:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.onDemand:
+ isOnline = true;
+ break;
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.localOnly:
+ case MS.Entertainment.UI.NetworkStatusService.NetworkStatus.none:
+ isOnline = false;
+ break
+ }
+ return isOnline
+ }
+ })
+ }), showAccountPicker: MS.Entertainment.UI.Framework.lazyDefine(function() {
+ return MS.Entertainment.derive(MS.Entertainment.UI.Actions.Action, function showAccountPickerAction() {
+ this.base()
+ }, {
+ automationId: MS.Entertainment.UI.AutomationIds.showAccountPicker, executed: function executed() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.switchCurrentUser().done(null, function error(){})
+ }, canExecute: function canExecute(param) {
+ return true
+ }
+ })
+ })
+ });
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.signIn, function() {
+ return new MS.Entertainment.UI.Actions.signIn
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.signInRequiredNavigate, function() {
+ return new MS.Entertainment.UI.Actions.signInRequiredNavigate
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.signInAndOnlineRequiredNavigate, function() {
+ return new MS.Entertainment.UI.Actions.signInAndOnlineRequiredNavigate
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.showAccountPicker, function() {
+ return new MS.Entertainment.UI.Actions.showAccountPicker
+ })
+})()
+})();
+/* >>>>>>/framework/endpoints.js:27231 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment", {Endpoint: {
+ id: Microsoft.Entertainment.Util.Endpoints.EndpointId, load: function load(endpointId) {
+ var endpointManager = new Microsoft.Entertainment.Util.EndpointManager;
+ return endpointManager.getEndpointUri(endpointId)
+ }, getCulture: function getCulture() {
+ var endpointManager = new Microsoft.Entertainment.Util.EndpointManager;
+ return endpointManager.getEndpointCulture()
+ }
+ }})
+})()
+})();
+/* >>>>>>/framework/accutils.js:27248 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ KeyboardInteractionListener: MS.Entertainment.UI.Framework.define(function KeyboardInteractionListener() {
+ var keyboardHandler = this._onKeyDown.bind(this);
+ var mouseHandler = this._onMouseDown.bind(this);
+ var focusInHandler = this._handleFocusIn.bind(this);
+ var focusOutHandler = this._handleFocusOut.bind(this);
+ var keyDownHandler = this.handleKeyDown.bind(this);
+ var keyUpHandler = this._handleKeyUp.bind(this);
+ var pointerDownHandler = this._handlePointerDown.bind(this);
+ var pointerUpHandler = this._handlePointerUp.bind(this);
+ var pointOutHandler = this._handlePointerOut.bind(this);
+ var gestureEngagedHandler = this._gestureEngagedHandler.bind(this);
+ var gestureDisengagedHandler = this._gestureDisengagedHandler.bind(this);
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = MS.Entertainment.Utilities.isApp2;
+ document.addEventListener("keydown", keyboardHandler, true);
+ document.addEventListener("MSPointerDown", mouseHandler, false);
+ document.addEventListener("pointerdown", mouseHandler, false);
+ if (MS.Entertainment.Utilities.isApp2) {
+ document.addEventListener("MSPointerMove", mouseHandler, false);
+ document.addEventListener("MSPointerHover", mouseHandler, false);
+ document.addEventListener("pointermove", mouseHandler, false);
+ document.addEventListener("pointerhover", mouseHandler, false);
+ document.addEventListener("keydown", keyDownHandler, true);
+ document.addEventListener("keyup", keyUpHandler, true);
+ document.addEventListener("MSPointerDown", pointerDownHandler, false);
+ document.addEventListener("MSPointerUp", pointerUpHandler, false);
+ document.addEventListener("MSPointerOut", pointOutHandler, false);
+ window.addEventListener("focusin", focusInHandler, false);
+ window.addEventListener("focusout", focusOutHandler, false);
+ window.addEventListener("gestureengaged", gestureEngagedHandler, false);
+ window.addEventListener("gesturedisengaged", gestureDisengagedHandler, false);
+ this._documentLastHadFocus = document.hasFocus()
+ }
+ if (WinJS.Utilities.hasWinRT) {
+ var commandUI = Windows.UI.Input.EdgeGesture.getForCurrentView();
+ commandUI.addEventListener("completed", this._onAppBarGesture.bind(this))
+ }
+ }, {
+ _keyboardStyleSet: false, _mouseStyleSet: false, _mouseHoverTimeout: null, _mouseHoverResetTime: 10000, _documentLastHadFocus: false, _onKeyDown: function KeyboardInteractionListener_onKeyDown(evt) {
+ this.lastInputType = MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.keyboard;
+ if (!this._keyboardStyleSet && MS.Entertainment.Framework.KeyboardInteractionListener._isKeyboardNavigationEvent(evt))
+ this._setKeyboardMode(evt)
+ }, _setKeyboardMode: function _setKeyboardMode(evt) {
+ this._keyboardStyleSet = true;
+ this._mouseStyleSet = false;
+ WinJS.Utilities.addClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = true;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nuiEngaged = false
+ }, _onAppBarGesture: function _onAppBarGesture(evt) {
+ if (evt && evt.kind === Windows.UI.Input.EdgeGestureKind.keyboard) {
+ this._keyboardStyleSet = true;
+ WinJS.Utilities.addClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = true
+ }
+ }, _onMouseDown: function KeyboardInteractionListener_onMouseDown(evt) {
+ this.lastInputType = MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.mouse;
+ if (!this._mouseStyleSet) {
+ this._keyboardStyleSet = false;
+ this._mouseStyleSet = true;
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.addClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ if (MS.Entertainment.Utilities.isApp2) {
+ if (this._mouseHoverTimeout)
+ this._mouseHoverTimeout.cancel();
+ this._mouseHoverTimeout = WinJS.Promise.timeout(this._mouseHoverResetTime).then(this._setKeyboardMode.bind(this))
+ }
+ }
+ MS.Entertainment.Framework.KeyboardInteractionListener.showKeyboardFocus = false;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).nuiEngaged = true
+ }, _handleFocusIn: function _handleFocusIn(evt) {
+ var documentHasFocus = document.hasFocus();
+ if (documentHasFocus && !this._documentLastHadFocus) {
+ this._setKeyboardMode();
+ WinJS.Utilities.removeClass(document.body, "win-visiblebutnotfocused");
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).visibleButNotFocused = false
+ }
+ this._documentLastHadFocus = documentHasFocus
+ }, _handleFocusOut: function _handleFocusOut(evt) {
+ var documentHasFocus = document.hasFocus();
+ if (!documentHasFocus) {
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.keyboardFocusClassName);
+ WinJS.Utilities.removeClass(document.body, MS.Entertainment.Framework.KeyboardInteractionListener.mouseHoverClassName);
+ this._keyboardStyleSet = false;
+ this._mouseStyleSet = false;
+ WinJS.Utilities.addClass(document.body, "win-visiblebutnotfocused");
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).visibleButNotFocused = true
+ }
+ this._documentLastHadFocus = documentHasFocus
+ }, handleKeyDown: function handleKeyDown(evt) {
+ if (document.activeElement && (evt.key === "Spacebar" || evt.key === "Enter" || evt.keyCode === WinJS.Utilities.Key.invokeButton) && !evt.repeat)
+ WinJS.Utilities.addClass(document.activeElement, "win-itemcontainer-active")
+ }, _handleKeyUp: function _handleKeyUp(evt) {
+ if ((evt.key === "Spacebar" || evt.key === "Enter" || evt.keyCode === WinJS.Utilities.Key.invokeButton) && !evt.repeat)
+ MS.Entertainment.Framework.KeyboardInteractionListener._cleanUpActiveItemContainers()
+ }, _handlePointerDown: function _handlePointerDown() {
+ this.lastInputType = MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.touch;
+ if (document.activeElement)
+ WinJS.Utilities.addClass(document.activeElement, "win-itemcontainer-active")
+ }, _handlePointerUp: function _handlePointerUp() {
+ MS.Entertainment.Framework.KeyboardInteractionListener._cleanUpActiveItemContainers()
+ }, _handlePointerOut: function _handlePointerOut() {
+ MS.Entertainment.Framework.KeyboardInteractionListener._cleanUpActiveItemContainers()
+ }, _gestureEngagedHandler: function _gestureEngagedHandler() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).gestureEngaged = true
+ }, _gestureDisengagedHandler: function _gestureDisengagedHandler() {
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).gestureEngaged = false
+ }, lastInputType: -1
+ }, {
+ LastInputType: {
+ unknown: -1, mouse: 1, keyboard: 2, touch: 3
+ }, keyboardFocusClassName: "showKeyboardFocus", mouseHoverClassName: "showPointerHover", showKeyboardFocus: false, instance: null, _cleanUpActiveItemContainers: function _cleanUpActiveItemContainers() {
+ WinJS.Utilities.query(".win-itemcontainer-active").forEach(function(item) {
+ WinJS.Utilities.removeClass(item, "win-itemcontainer-active")
+ })
+ }, _isKeyboardNavigationEvent: function _isKeyboardNavigationEvent(evt) {
+ if (evt.keyCode === WinJS.Utilities.Key.tab)
+ return true;
+ else if (evt.keyCode === WinJS.Utilities.Key.leftArrow || evt.keyCode === WinJS.Utilities.Key.rightArrow || evt.keyCode === WinJS.Utilities.Key.downArrow || evt.keyCode === WinJS.Utilities.Key.upArrow || evt.keyCode === WinJS.Utilities.Key.home || evt.keyCode === WinJS.Utilities.Key.end || evt.keyCode === WinJS.Utilities.Key.pageUp || evt.keyCode === WinJS.Utilities.Key.pageDown || evt.keyCode === WinJS.Utilities.Key.escape || evt.keyCode === WinJS.Utilities.Key.backspace || evt.keyCode === WinJS.Utilities.Key.leftArrow || evt.keyCode === WinJS.Utilities.Key.lArrow || evt.keyCode === WinJS.Utilities.Key.lOtherArrow || evt.keyCode === WinJS.Utilities.Key.rightArrow || evt.keyCode === WinJS.Utilities.Key.rArrow || evt.keyCode === WinJS.Utilities.Key.rOtherArrow || evt.keyCode === WinJS.Utilities.Key.upArrow || evt.keyCode === WinJS.Utilities.Key.uArrow || evt.keyCode === WinJS.Utilities.Key.uOtherArrow || evt.keyCode === WinJS.Utilities.Key.downArrow || evt.keyCode === WinJS.Utilities.Key.dArrow || evt.keyCode === WinJS.Utilities.Key.dOtherArrow)
+ return !MS.Entertainment.Utilities.doesElementSupportKeyboardInput(document.activeElement);
+ return false
+ }, init: function KeyboardInteractionListener_init() {
+ if (!MS.Entertainment.Framework.KeyboardInteractionListener.instance)
+ MS.Entertainment.Framework.KeyboardInteractionListener.instance = new MS.Entertainment.Framework.KeyboardInteractionListener
+ }, wasLastInputMouse: {get: function KeyboardInteractionListener_get_wasLastInputMouse() {
+ var instance = MS.Entertainment.Framework.KeyboardInteractionListener.instance;
+ if (!instance)
+ return false;
+ return instance.lastInputType === MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.mouse
+ }}, wasLastInputTouch: {get: function KeyboardInteractionListener_get_wasLastInputTouch() {
+ var instance = MS.Entertainment.Framework.KeyboardInteractionListener.instance;
+ if (!instance)
+ return false;
+ return instance.lastInputType === MS.Entertainment.Framework.KeyboardInteractionListener.LastInputType.touch
+ }}
+ }), AccUtils: MS.Entertainment.UI.Framework.define(null, null, {
+ idCounter: 0, createAriaLinkId: function createAriaLinkId(linkedElement) {
+ if (!linkedElement.id) {
+ linkedElement.id = "accid" + MS.Entertainment.Framework.AccUtils.idCounter;
+ MS.Entertainment.Framework.AccUtils.idCounter++
+ }
+ }, addAriaLink: function addAriaAttribute(element, linkedElementId, attribute) {
+ element.setAttribute(attribute, linkedElementId)
+ }, createAndAddAriaLink: function createAndAddAriaLink(element, linkedElement, attribute) {
+ MS.Entertainment.Framework.AccUtils.createAriaLinkId(linkedElement);
+ MS.Entertainment.Framework.AccUtils.addAriaLink(element, linkedElement.id, attribute)
+ }, checkAndSetAriaAttribute: WinJS.Utilities.markSupportedForProcessing(function checkAndSetAriaAttribute(value, targetElement, targetProperty) {
+ targetProperty = "" + targetProperty;
+ switch (targetProperty) {
+ case"label":
+ MS.Entertainment.Utilities.setAccessibilityText(targetElement, value);
+ break;
+ case"role":
+ value ? targetElement.setAttribute("role", value) : targetElement.removeAttribute("role");
+ break;
+ case"level":
+ value ? targetElement.setAttribute("aria-level", value) : targetElement.removeAttribute("aria-level");
+ break;
+ case"setsize":
+ value || value === 0 ? targetElement.setAttribute("aria-setsize", value) : targetElement.removeAttribute("aria-setsize");
+ break;
+ case"posinset":
+ value || value === 0 ? targetElement.setAttribute("aria-posinset", value) : targetElement.removeAttribute("aria-posinset");
+ break;
+ case"expanded":
+ typeof value === "boolean" ? targetElement.setAttribute("aria-expanded", value) : targetElement.removeAttribute("aria-expanded");
+ break;
+ case"selected":
+ typeof value === "boolean" ? targetElement.setAttribute("aria-selected", value) : targetElement.removeAttribute("aria-selected");
+ break;
+ case"controls":
+ value ? targetElement.setAttribute("aria-controls", value) : targetElement.removeAttribute("aria-controls");
+ break;
+ case"owns":
+ Array.isArray(value) && value.length ? targetElement.setAttribute("aria-owns", value.join(" ")) : targetElement.removeAttribute("aria-owns");
+ break;
+ default:
+ MS.Entertainment.Utilities.assert(false, "Attempted to bind to invalid ARIA attribute: " + targetProperty);
+ break
+ }
+ }), setAriaAttribute: MS.Entertainment.Utilities.weakElementBindingInitializer(function setAriaAttribute(text, targetElement, targetProperty) {
+ if (Array.isArray(targetProperty))
+ targetProperty = targetProperty[0];
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(text, targetElement, targetProperty)
+ }), setAriaAttributeFromStringId: MS.Entertainment.Utilities.weakElementBindingInitializer(function setAriaAttributeFromStringId(stringId, targetElement, targetProperty) {
+ if (Array.isArray(targetProperty))
+ targetProperty = targetProperty[0];
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(stringId && String.load(stringId), targetElement, targetProperty)
+ }), setAriaAttributeFromStaticStringId: WinJS.Utilities.markSupportedForProcessing(function setAriaAttributeFromStaticStringId(sourceObject, staticStringId, targetElement, targetProperty) {
+ var data = String.id[staticStringId[0]];
+ MS.Entertainment.Formatters.assert(String.id[data], "Formatters_formatStringId must be passed a valid string id, received: " + data);
+ if (String.id[data])
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(String.load(data), targetElement, targetProperty)
+ }), setAriaSliderBounds: function setAriaSliderPosition(element, min, max) {
+ if (!element)
+ return;
+ element = element.domElement ? element.domElement : element;
+ if (element) {
+ MS.Entertainment.Utilities.assert(typeof min === "number", "Expected parameter min to be numeric in setAriaSliderBounds.");
+ MS.Entertainment.Utilities.assert(typeof max === "number", "Expected parameter max to be numeric in setAriaSliderBounds.");
+ element.setAttribute("aria-valuemin", min);
+ element.setAttribute("aria-valuemax", max)
+ }
+ }, setAriaSliderPosition: function setAriaSliderPosition(element, value, valueText) {
+ if (!element)
+ return;
+ element = element.domElement ? element.domElement : element;
+ if (element) {
+ MS.Entertainment.Utilities.assert(typeof value === "number", "Expected parameter value to be numeric in setAriaSliderPosition.");
+ element.setAttribute("aria-valuenow", value);
+ if (valueText)
+ element.setAttribute("aria-valuetext", valueText)
+ }
+ }
+ })
+ })
+})()
+})();
+/* >>>>>>/framework/pluralizationutilities.js:27473 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(Utilities) {
+ var PluralizationRule = (function() {
+ function PluralizationRule(captureExpression, resultString) {
+ this._matches = PluralizationRule._createMatchFunction(captureExpression);
+ this._resultString = resultString
+ }
+ PluralizationRule._stringStartsWith = function(str, expression) {
+ return str.length !== expression.length && str.lastIndexOf(expression, 0) === 0
+ };
+ PluralizationRule._countEndsWith = function(count, expression, expressionModuloFactor) {
+ return count !== expression && (count % expressionModuloFactor) === expression
+ };
+ PluralizationRule._createRangeRuleFunction = function(captureExpression, indexOfRange) {
+ var firstNumber = Number(captureExpression.substr(0, indexOfRange));
+ var lastNumber = Number(captureExpression.substr(indexOfRange + 1));
+ MS.Entertainment.Utilities.assert(firstNumber < lastNumber, "Malformed rule detected. First number in a range must be less than the last number.");
+ if (!isNaN(firstNumber) && !isNaN(lastNumber))
+ return function(count) {
+ return count >= firstNumber && count <= lastNumber
+ };
+ MS.Entertainment.Utilities.fail("Malformed rule detected. One or both ends of a range rule were not valid numbers.", captureExpression);
+ return function(count) {
+ return false
+ }
+ };
+ PluralizationRule._createWildcardRuleFunction = function(captureExpression, indexOfWildcard) {
+ if (captureExpression === "*")
+ return function(count) {
+ return true
+ };
+ else if (indexOfWildcard === 0) {
+ var captureExpressionEnding = Number(captureExpression.substr(1));
+ if (!isNaN(captureExpressionEnding)) {
+ var expressionModuloFactor = Math.pow(10, captureExpression.length - 1);
+ return function(count) {
+ return PluralizationRule._countEndsWith(count, captureExpressionEnding, expressionModuloFactor)
+ }
+ }
+ else
+ MS.Entertainment.Utilities.fail("Malformed rule detected. Wildcard rule must end with a number.")
+ }
+ else if (indexOfWildcard === captureExpression.length - 1) {
+ var captureExpressionBeginning = captureExpression.substr(0, captureExpression.length - 1);
+ return function(count) {
+ var countText = String.empty + count;
+ return PluralizationRule._stringStartsWith(countText, captureExpressionBeginning)
+ }
+ }
+ MS.Entertainment.Utilities.fail("Malformed rule detected. Wildcard was found in the middle of the expression.", captureExpression);
+ return function(count) {
+ return false
+ }
+ };
+ PluralizationRule._createMatchFunction = function(captureExpression) {
+ var indexOfRange = captureExpression.indexOf("-");
+ if (indexOfRange >= 0)
+ return PluralizationRule._createRangeRuleFunction(captureExpression, indexOfRange);
+ else {
+ var indexOfWildcard = captureExpression.indexOf("*");
+ if (indexOfWildcard >= 0)
+ return PluralizationRule._createWildcardRuleFunction(captureExpression, indexOfWildcard);
+ else {
+ var numericForm = Number(captureExpression);
+ if (!isNaN(numericForm))
+ if (numericForm >= 0)
+ return function(count) {
+ return count === numericForm
+ };
+ else
+ MS.Entertainment.Utilities.fail("Malformed rule detected. Negative numbers are not supported for pluralization.", captureExpression);
+ else
+ MS.Entertainment.Utilities.fail("Malformed rule detected.", captureExpression)
+ }
+ }
+ return function(count) {
+ return false
+ }
+ };
+ Object.defineProperty(PluralizationRule.prototype, "matches", {
+ get: function() {
+ return this._matches
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(PluralizationRule.prototype, "resultString", {
+ get: function() {
+ return this._resultString
+ }, enumerable: true, configurable: true
+ });
+ return PluralizationRule
+ })();
+ Utilities.PluralizationRule = PluralizationRule;
+ var Pluralization = (function() {
+ function Pluralization(){}
+ Pluralization._resetState = function() {
+ this._initializedIdVisionCheck = false;
+ this._initializedPseudoLocCheck = false;
+ MS.Entertainment.Utilities.Pluralization._pluralizationRulesets = {}
+ };
+ Pluralization.getPluralizedString = function(stringId, count) {
+ MS.Entertainment.Utilities.Pluralization._pluralizationRulesets = MS.Entertainment.Utilities.Pluralization._pluralizationRulesets || {};
+ if (!MS.Entertainment.Utilities.Pluralization._pluralizationRulesets[stringId]) {
+ var newRuleset = MS.Entertainment.Utilities.Pluralization._createRuleset(stringId);
+ if (!newRuleset || !Array.isArray(newRuleset)) {
+ MS.Entertainment.Utilities.fail("Expected ruleset for this string ID to be a defined array.", stringId);
+ newRuleset = []
+ }
+ MS.Entertainment.Utilities.Pluralization._pluralizationRulesets[stringId] = newRuleset
+ }
+ var resultString = String.empty;
+ var ruleset = MS.Entertainment.Utilities.Pluralization._pluralizationRulesets[stringId];
+ var matchFound = ruleset.some(function(rule) {
+ if (rule.matches(count)) {
+ resultString = rule.resultString;
+ return true
+ }
+ return false
+ });
+ if (!matchFound)
+ MS.Entertainment.Utilities.fail("Failed to find a pluralization rule that matches {0} in ruleset {1}.".format(count, stringId));
+ return resultString
+ };
+ Object.defineProperty(Pluralization, "_useIdVision", {
+ get: function() {
+ if (!Pluralization._initializedIdVisionCheck) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ Pluralization.__useIdVision = configurationManager.shell.idVision;
+ Pluralization._initializedIdVisionCheck = true
+ }
+ return Pluralization.__useIdVision
+ }, enumerable: true, configurable: true
+ });
+ Pluralization._createRuleset = function(stringId) {
+ var ruleset = [];
+ var rulesString = String.load(stringId, true);
+ if (rulesString) {
+ var firstPseudoLocSectionLength = 0;
+ var lastPseudoLocSectionLength = 0;
+ var hasPseudoLocSections = false;
+ if (!Pluralization._initializedPseudoLocCheck || Pluralization._isPseudoLoc) {
+ var firstPseudoLocSectionLength = rulesString.indexOf("[[");
+ var lastPseudoLocSectionLength = rulesString.length - rulesString.lastIndexOf("]") - 1;
+ hasPseudoLocSections = (firstPseudoLocSectionLength > 0 || lastPseudoLocSectionLength > 0);
+ if (!Pluralization._initializedPseudoLocCheck)
+ Pluralization._isPseudoLoc = hasPseudoLocSections;
+ Pluralization._initializedPseudoLocCheck = true
+ }
+ var actualRulesLength = rulesString.length - (firstPseudoLocSectionLength + lastPseudoLocSectionLength);
+ var idVisionId = null;
+ if (Pluralization._useIdVision)
+ idVisionId = "[" + String.idVisionIds[stringId] + "] ";
+ var regexp = /(?:\[\[([0-9\-\*]+)\]([^\]]*?)\])+?/g;
+ var numGroups = 3;
+ var parts;
+ while (parts = regexp.exec(rulesString)) {
+ MS.Entertainment.Utilities.assert(parts.length === numGroups, "Expected one result string for each capture expression.");
+ var captureExpression = parts[1];
+ var resultString = parts[2];
+ if (hasPseudoLocSections) {
+ var resultPseudoLocRatio = actualRulesLength > 0 ? resultString.length / actualRulesLength : 0;
+ var beginningPseudoLoc = firstPseudoLocSectionLength > 0 ? rulesString.substr(0, Math.ceil(firstPseudoLocSectionLength * resultPseudoLocRatio)) : String.empty;
+ var endingPseudoLoc = lastPseudoLocSectionLength > 0 ? rulesString.substr(rulesString.length - Math.ceil(lastPseudoLocSectionLength * resultPseudoLocRatio)) : String.empty;
+ resultString = beginningPseudoLoc + resultString + endingPseudoLoc
+ }
+ if (idVisionId)
+ resultString = idVisionId + resultString;
+ ruleset.push(new PluralizationRule(captureExpression, resultString))
+ }
+ MS.Entertainment.Utilities.assert(ruleset.length > 0, "Parsing failure for string " + stringId)
+ }
+ return ruleset
+ };
+ Pluralization._pluralizationRulesets = {};
+ return Pluralization
+ })();
+ Utilities.Pluralization = Pluralization
+ })(Entertainment.Utilities || (Entertainment.Utilities = {}));
+ var Utilities = Entertainment.Utilities
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/formatters.js:27660 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Formatters");
+ WinJS.Namespace.define("MS.Entertainment.Formatters", {DateTimeFormatters: MS.Entertainment.UI.Framework.define(function dateTimeFormatters(){}, {
+ _year: null, _monthYear: null, _abbreviatedMonthYear: null, _abbreviatedMonth: null, _dayMonthYear: null, _shortDate: null, _decimalNumber: null, _groupedDecimalNumber: null, _percentNumber: null, year: {get: function() {
+ if (!this._year)
+ try {
+ this._year = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("year")
+ }
+ catch(e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"year\") object. Error: " + error);
+ this._year = this._defaultFormatter
+ }
+ return this._year
+ }}, abbreviatedMonthYear: {get: function() {
+ if (!this._abbreviatedMonthYear)
+ try {
+ this._abbreviatedMonthYear = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("month.abbreviated year")
+ }
+ catch(e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"month.abbreviated year\") object. Error: " + error);
+ this._abbreviatedMonthYear = this._defaultFormatter
+ }
+ return this._abbreviatedMonthYear
+ }}, abbreviatedMonth: {get: function() {
+ if (!this._abbreviatedMonth)
+ try {
+ this._abbreviatedMonth = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("month.abbreviated")
+ }
+ catch(e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"month.abbreviated\") object. Error: " + error);
+ this._abbreviatedMonth = this._defaultFormatter
+ }
+ return this._abbreviatedMonth
+ }}, monthYear: {get: function() {
+ if (!this._monthYear)
+ try {
+ this._monthYear = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("month year")
+ }
+ catch(e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"month year\") object. Error: " + error);
+ this._abbreviatedMonth = this._defaultFormatter
+ }
+ return this._monthYear
+ }}, shortDate: {get: function() {
+ if (!this._shortDate)
+ try {
+ this._shortDate = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("shortdate")
+ }
+ catch(e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"shortdate\") object. Error: " + error);
+ this._shortDate = this._defaultFormatter
+ }
+ return this._shortDate
+ }}, dayMonthYear: {get: function() {
+ if (!this._dayMonthYear)
+ try {
+ this._dayMonthYear = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("day month year")
+ }
+ catch(e) {
+ var error = e && e.message;
+ MS.Entertainment.Formatters.fail("Could not instantiate new DateTimeFormatter(\"day month year\") object. Error: " + error);
+ this._dayMonthYear = this._defaultFormatter
+ }
+ return this._dayMonthYear
+ }}, decimalNumber: {get: function() {
+ if (!this._decimalNumber) {
+ this._decimalNumber = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ this._decimalNumber.fractionDigits = 0;
+ this._decimalNumber.isGrouped = false;
+ this._decimalNumber.integerDigits = MS.Entertainment.Formatters.DateTimeFormatters.defaultDecimalDigits
+ }
+ return this._decimalNumber
+ }}, groupedDecimalNumber: {get: function() {
+ if (!this._groupedDecimalNumber) {
+ this._groupedDecimalNumber = new Windows.Globalization.NumberFormatting.DecimalFormatter;
+ this._groupedDecimalNumber.fractionDigits = 0;
+ this._groupedDecimalNumber.isGrouped = true;
+ this._groupedDecimalNumber.integerDigits = MS.Entertainment.Formatters.DateTimeFormatters.defaultDecimalDigits
+ }
+ return this._groupedDecimalNumber
+ }}, percentNumber: {get: function() {
+ if (!this._percentNumber) {
+ this._percentNumber = new Windows.Globalization.NumberFormatting.PercentFormatter;
+ this._percentNumber.fractionDigits = 0;
+ this._percentNumber.integerDigits = 0;
+ this._percentNumber.isDecimalPointAlwaysDisplayed = false;
+ this._percentNumber.isGrouped = true
+ }
+ return this._percentNumber
+ }}, _defaultFormatter: {get: function() {
+ return {format: function format() {
+ return String.empty
+ }}
+ }}
+ }, {
+ create: function create() {
+ return new MS.Entertainment.Formatters.DateTimeFormatters
+ }, defaultDecimalDigits: 1
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.dateTimeFormatters, MS.Entertainment.Formatters.DateTimeFormatters.create);
+ WinJS.Namespace.define("MS.Entertainment.Formatters", {
+ MediaSortFormatter: MS.Entertainment.defineOptionalObservable(function mediaSortFormatter() {
+ this.bind("totalCount", this._updateResult.bind(this))
+ }, {
+ _countStringId: null, _unknownStringId: null, _countOnly: null, _filter: null, initialize: function initialize(countStringId, unknownStringId, countOnly, filter) {
+ this._countStringId = countStringId;
+ this._unknownStringId = unknownStringId;
+ this._countOnly = countOnly;
+ this._filter = filter;
+ this._updateResult()
+ }, _updateResult: function _updateResult() {
+ var countFormatter;
+ if (this.count >= 0) {
+ var mediaStringWithCount = MS.Entertainment.Utilities.Pluralization.getPluralizedString(this._countStringId, this.totalCount);
+ countFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ countFormatter.isGrouped = true;
+ this.result = String.load(this._filter ? String.id.IDS_N_FILTER_IN : String.id.IDS_N_SORTED_BY).format(countFormatter.format(this.totalCount), String.load(mediaStringWithCount));
+ countFormatter.isGrouped = false
+ }
+ else if (this._unknownStringId)
+ this.result = String.load(this._filter ? String.id.IDS_FILTER_IN : String.id.IDS_SORTED_BY).format(String.load(this._unknownStringId));
+ else if (this._countOnly) {
+ countFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ this.result = countFormatter.format(this.totalCount)
+ }
+ else
+ this.result = null
+ }
+ }, {
+ totalCount: 0, result: null
+ }), formatDestinationHelper: WinJS.Utilities.markSupportedForProcessing(function formatHelper(destination, destinationProperty, value) {
+ if (destinationProperty.length > 1) {
+ var prop = destination[destinationProperty[0]];
+ for (var x = 1; x < destinationProperty.length - 1; x++)
+ prop = prop[destinationProperty[x]];
+ prop[destinationProperty[x]] = value
+ }
+ else
+ destination[destinationProperty] = value
+ }), formatSourceHelper: WinJS.Utilities.markSupportedForProcessing(function formatSourceHelper(source, sourceProperty) {
+ var sourceData;
+ if (Array.isArray(sourceProperty)) {
+ sourceData = source[sourceProperty[0]];
+ for (var i = 1; i < sourceProperty.length; i++)
+ sourceData = sourceData[sourceProperty[i]]
+ }
+ else
+ sourceData = source[sourceProperty];
+ return sourceData
+ }), formatStringOrStringId: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function(value) {
+ var sourceDataType = typeof value;
+ var result = String.empty;
+ if (sourceDataType === "string")
+ result = (String.id[value]) ? String.load(value) : value;
+ else if (value)
+ MS.Entertainment.Formatters.fail("Unrecognized string type in formatter: " + sourceDataType);
+ return result
+ })), _formatStringStripHTML: function _formatStringStripHTML(value) {
+ var sourceDataType = typeof value;
+ var result = String.empty;
+ if (sourceDataType === "string") {
+ if (value)
+ result = toStaticHTML(value.replace(/<(?:.|\n)*?>/gm, ""))
+ }
+ else if (value)
+ MS.Entertainment.Formatters.fail("Unrecognized string type in formatter: " + sourceDataType);
+ return result
+ }, _formatStringStripHTMLAndDecode: function _formatStringStripHTMLAndDecode(value) {
+ var sourceDataType = typeof value;
+ var result = String.empty;
+ if (sourceDataType === "string") {
+ if (value)
+ result = MS.Entertainment.Utilities.unEscapeHTML(value)
+ }
+ else if (value)
+ MS.Entertainment.Formatters.fail("Unrecognized string type in formatter: " + sourceDataType);
+ return result
+ }, formatStringStripHTML: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function(value) {
+ return MS.Entertainment.Formatters._formatStringStripHTML(value)
+ })), formatStringStripHTMLAndDecode: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function(value) {
+ return MS.Entertainment.Formatters._formatStringStripHTMLAndDecode(value)
+ })), formatStringId: WinJS.Utilities.markSupportedForProcessing(function formatStringOrStringId(source, sourceProperty, destination, destinationProperty) {
+ MS.Entertainment.Formatters.assert(sourceProperty[0] === "String", "Formatters_formatStringId must be passed a valid string id");
+ var len = sourceProperty.length;
+ var data = String;
+ for (var i = 1; i < len && data; i++)
+ data = data[sourceProperty[i]];
+ MS.Entertainment.Formatters.assert(String.id[data], "Formatters_formatStringId must be passed a valid string id");
+ var result = (String.id[data] && String.load(data)) || String.empty;
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, result)
+ }), formatStringIdNoAssert: WinJS.Utilities.markSupportedForProcessing(function formatStringIdNoAssert(source, sourceProperty, destination, destinationProperty) {
+ MS.Entertainment.Formatters.assert(sourceProperty[0] === "String", "Formatters_formatStringId must be passed a valid string id");
+ var len = sourceProperty.length;
+ var data = String;
+ for (var i = 1; i < len && data; i++)
+ data = data[sourceProperty[i]];
+ var result = (String.id[data] && String.load(data)) || String.empty;
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, result)
+ }), formatYearFromDateNonConverter: function formatYearFromDateNonConverter(sourceData) {
+ var date = null;
+ var year = null;
+ if (sourceData) {
+ date = new Date(sourceData);
+ if (date) {
+ var formattedYear = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ year = formattedYear.format(date)
+ }
+ }
+ return year || String.empty
+ }, formatYearFromDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatReleaseYear(sourceData) {
+ return MS.Entertainment.Formatters.formatYearFromDateNonConverter(sourceData)
+ })), formatDatabaseDataFromReleaseDate: function formatDatabaseDataFromReleaseDate(sourceData) {
+ var date = null;
+ if (sourceData && sourceData.toISOString)
+ date = sourceData.toISOString().replace("T", " ").substring(0, 19);
+ else
+ MS.Entertainment.Formatters.fail("Expected date to be provided as source data. Cannot format releaseDate");
+ return date || String.empty
+ }, formatShortDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatYearMonthDate(sourceValue) {
+ return MS.Entertainment.Formatters.formatShortDateNonConverter(sourceValue)
+ })), formatShortDateNonConverter: function formatShortDateNonConverter(sourceValue) {
+ if (sourceValue) {
+ var dateFormat = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).shortDate;
+ sourceValue = dateFormat.format(sourceValue)
+ }
+ return sourceValue || String.empty
+ }, formatLongDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatYearMonthDate(sourceValue) {
+ if (sourceValue) {
+ var dateFormat = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).dayMonthYear;
+ sourceValue = dateFormat.format(sourceValue)
+ }
+ return sourceValue || String.empty
+ })), formatDurationFromDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDurationFromDate(sourceData) {
+ return MS.Entertainment.Formatters.formatDurationFromDateNonConverter(sourceData)
+ })), formatDurationFromDateNonConverter: function formatDurationFromDateNonConverter(sourceData) {
+ var date = sourceData;
+ if (typeof sourceData !== "number")
+ date = new Date(sourceData);
+ var duration = MS.Entertainment.Utilities.formatTimeString(date);
+ return duration
+ }, formatDurationFromDateNoSeconds: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDurationFromDateNoSeconds(sourceData) {
+ return MS.Entertainment.Formatters.formatDurationFromDateNoSecondsNonConverter(sourceData)
+ })), formatDurationFromDateNoSecondsNonConverter: function formatDurationFromDateNoSecondsNonConverter(sourceData) {
+ var duration = MS.Entertainment.Utilities.formatTimeString(sourceData, {excludeSeconds: true});
+ return duration
+ }, formatDurationGreaterThanZeroFromDate: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDurationGreaterThanZeroFromDate(sourceData) {
+ return MS.Entertainment.Formatters.formatDurationGreaterThanZeroFromDateNonConverter(sourceData)
+ })), formatDurationGreaterThanZeroFromDateNonConverter: function formatDurationGreaterThanZeroFromDateNonConverter(sourceData) {
+ var date = null;
+ var forceEmptyString = false;
+ if (typeof sourceData === "number")
+ if (sourceData > 0)
+ date = MS.Entertainment.Utilities._millisecondsToDate(sourceData);
+ else
+ forceEmptyString = true;
+ else
+ date = new Date(sourceData);
+ var duration = sourceData && !forceEmptyString ? MS.Entertainment.Utilities.formatTimeString(date) : String.empty;
+ return duration
+ }, milliSecondsFromTimeSpan: function milliSecondsFromTimeSpan(days, hours, minutes, seconds, milliseconds) {
+ return ((((days ? days : 0) * 24 + (hours ? hours : 0)) * 60 + (minutes ? minutes : 0)) * 60 + (seconds ? seconds : 0)) * 1000 + (milliseconds ? milliseconds : 0)
+ }, formatCount: function formatCount(count, countTextFunction) {
+ if (count === undefined || count === -1)
+ return String.empty;
+ return countTextFunction(count)
+ }, countText: function countText(count, countFormatStringId) {
+ var numberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ return MS.Entertainment.Formatters.countTextWithCustomFormatter(numberFormatter, count, countFormatStringId)
+ }, countTextWithoutOrderFormat: function countTextWithoutOrderFormat(count, countFormatStringId) {
+ var formatString = String.load(String.id.IDS_MUSIC_RELATED_PANEL_FORMAT);
+ var formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(count);
+ var countLabel = MS.Entertainment.Utilities.Pluralization.getPluralizedString(countFormatStringId, count);
+ return formatString.format(formattedCount, countLabel)
+ }, countTextWithCustomFormatter: function countTextWithCustomFormatter(numberFormatter, count, countFormatStringId) {
+ var formattedCount = numberFormatter.format(count);
+ return MS.Entertainment.Utilities.Pluralization.getPluralizedString(countFormatStringId, count).format(formattedCount)
+ }, formatGenresList: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatGenresList(genres) {
+ return MS.Entertainment.Formatters.formatGenresListNonConverter(genres)
+ })), formatGenresListNonConverter: function formatGenresListNonConverter(genres) {
+ if (!genres)
+ return String.empty;
+ var genreNames = [];
+ if (Array.isArray(genres)) {
+ genres.forEach(function forEachGenresList(genre) {
+ if (genre)
+ genreNames.push(genre.name)
+ });
+ return genreNames.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else if (typeof genres !== "string" && genres.forEach) {
+ MS.Entertainment.Formatters.fail("Supplied with virtual list. Don't know how to handle this. Don't think it's used any more");
+ return String.empty
+ }
+ else if (typeof genres === "string")
+ return genres
+ }, formatStringOrUnknown: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatStringOrUnknown(result) {
+ if (!result || result === "null")
+ result = String.load(String.id.IDS_UNKNOWN_VALUE);
+ return result
+ })), formatStringOrEmpty: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatStringOrEmpty(result) {
+ if (!result || result === "null")
+ result = String.empty;
+ return result
+ })), formatStringOrEmptyOneTime: WinJS.Utilities.markSupportedForProcessing(function formatStringOrEmptyOneTime(source, sourceProperties, dest, destProperties) {
+ var result = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperties);
+ if (!result || result === "null")
+ result = String.empty;
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, result)
+ }), formatDecimalNumber: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDecimalNumber(num) {
+ if (num === undefined || num === null || typeof(num) !== "number")
+ return String.empty;
+ var formattedNum;
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(num);
+ return formattedNum
+ })), formatDecimalNumberIncrement: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatDecimalNumberIncrement(num) {
+ if (num === undefined || num === null || typeof(num) !== "number")
+ return String.empty;
+ var formattedNum;
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(num + 1);
+ return formattedNum
+ })), formatDecimalNumberIncrementOneTime: WinJS.Utilities.markSupportedForProcessing(function formatDecimalNumberIncrementOneTime(source, sourceProperties, dest, destProperties) {
+ var formattedNum = String.empty;
+ var number = MS.Entertainment.Utilities.valueFromPropertyPathFragments(source, sourceProperties);
+ if (typeof number === "number" && !isNaN(number))
+ formattedNum = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(number + 1);
+ MS.Entertainment.Utilities.setFromPropertyPathFragments(dest, destProperties, formattedNum)
+ }), formatIcon: WinJS.Utilities.markSupportedForProcessing(function formatIcon(source, sourceProperty, destination, destinationProperty) {
+ var icon = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, icon)
+ }), setPropertyFromStatic: WinJS.Utilities.markSupportedForProcessing(function setPropertyFromStatic(source, sourceProperty, destination, destinationProperty) {
+ var valueFromProperty = MS.Entertainment.Utilities.valueFromPropertyPathFragments(WinJS.Utilities.getMember(sourceProperty[0]), sourceProperty.slice(1));
+ MS.Entertainment.Formatters.formatDestinationHelper(destination, destinationProperty, valueFromProperty)
+ }), formatGenre: function formatGenre(sourceValue) {
+ var result = String.empty;
+ if (sourceValue.genre)
+ if (Array.isArray(sourceValue.genre)) {
+ var genreNames = [];
+ sourceValue.genre.forEach(function(genre) {
+ if (genre)
+ genreNames.push(genre.name)
+ });
+ result = genreNames.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else if (sourceValue.genre.name)
+ result = sourceValue.genre.name;
+ else
+ result = sourceValue.genre;
+ else if (sourceValue.genreName)
+ result = sourceValue.genreName;
+ return result
+ }, getUsbDeviceNameForDashboard: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function getUsbDeviceNameForDashboard(sourceData) {
+ var text = String.load(String.id.IDS_MEDIABROWSER_LANDING_PAGE_USB_TITLE).format(sourceData);
+ return text
+ })), canShowExpiredFlag: function canShowExpiredFlag() {
+ var isUsingXdlcForIngestion = MS.Entertainment.Utilities.isVideoApp;
+ if (!isUsingXdlcForIngestion)
+ return true;
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.purchaseHistory)) {
+ var purchaseHistoryService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.purchaseHistory);
+ return !!(purchaseHistoryService && purchaseHistoryService.hasGrovelEverCompleted)
+ }
+ return false
+ }, formatRentalExpirationFromSpanInt: function formatRentalExpirationFromSpanInt(milliSeconds, useLongRentalExpiredString) {
+ var message;
+ var seconds = Math.floor(milliSeconds / 1000);
+ var minutes = Math.floor(seconds / 60);
+ var minutesNormalized = minutes % 60;
+ var hours = Math.floor(minutes / 60);
+ var hoursNormalized = hours % 24;
+ var days = Math.floor(hours / 24);
+ if (milliSeconds < 0)
+ if (MS.Entertainment.Formatters.canShowExpiredFlag())
+ message = (useLongRentalExpiredString ? String.load(String.id.IDS_VIDEO_RENTAL_EXPIRED) : String.load(String.id.IDS_VIDEO_RENTAL_EXPIRED_ONLY));
+ else
+ message = String.empty;
+ else if (milliSeconds >= MS.Entertainment.Formatters.milliSecondsFromTimeSpan(2))
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_DAYS).format(days);
+ else if (hours > 1)
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_HRS).format(hours);
+ else if (hoursNormalized === 1)
+ if (minutesNormalized === 0)
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_HR);
+ else if (minutesNormalized === 1)
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_HR_MIN);
+ else
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_HR_MINS).format(minutesNormalized);
+ else if (hoursNormalized === 0)
+ if (minutesNormalized === 0)
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_MIN);
+ else if (minutesNormalized === 1)
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_MIN);
+ else
+ message = String.load(String.id.IDS_VIDEO_RENTAL_EXPIRES_MINS).format(minutesNormalized);
+ return message
+ }, formatRentalExpirationFromSpan: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatRentalExpirationFromSpan(sourceData) {
+ return MS.Entertainment.Formatters.formatRentalExpirationFromSpanInt(sourceData)
+ })), formatSeason: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatSeason(value) {
+ return MS.Entertainment.Formatters.formatCount(value, MS.Entertainment.Formatters.seasonCountText)
+ })), seasonCountText: function seasonCountText(count) {
+ return MS.Entertainment.Formatters.countText(count, String.id.IDS_TV_SEASONS_LABEL_PLURAL)
+ }, formatNumberOfRatings: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatNumberOfRatings(number) {
+ if (!number)
+ return String.empty;
+ var groupedNumberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).groupedDecimalNumber;
+ return MS.Entertainment.Formatters.countTextWithCustomFormatter(groupedNumberFormatter, number, String.id.IDS_DETAILS_RATINGS_PLURAL)
+ })), formatNumberOfReviews: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatNumberOfReviews(number) {
+ if (!number)
+ return String.empty;
+ var groupedNumberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).groupedDecimalNumber;
+ return MS.Entertainment.Formatters.countTextWithCustomFormatter(groupedNumberFormatter, number, String.id.IDS_VIDEO_REVIEW_COUNT_ONLY_PLURAL)
+ })), formatPercentage: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatPercentage(number) {
+ number = Number(number);
+ if (!number)
+ return String.empty;
+ number = number / 100;
+ var percentNumber = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).percentNumber.format(number);
+ percentNumber = percentNumber.replace(" ", "");
+ return percentNumber
+ })), formatTVEpisode: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatTVEpisode(episodeCount) {
+ var formattedCount;
+ if (episodeCount === undefined || episodeCount < 0)
+ return String.empty;
+ formattedCount = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(episodeCount);
+ var result = String.empty;
+ if (episodeCount === 0)
+ result = String.load(String.id.IDS_TV_NOEPISODES_LABEL).format(formattedCount);
+ if (episodeCount === 1)
+ result = String.load(String.id.IDS_TV_EPISODE_LABEL).format(formattedCount);
+ else
+ result = String.load(String.id.IDS_TV_EPISODES_LABEL).format(formattedCount);
+ return result
+ })), formatSeasonOwnedEpisodes: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatSeasonOwnedEpisodes(sourceValue) {
+ var result = String.empty;
+ if (sourceValue)
+ result = String.load(String.id.IDS_VIDEO2_TV_SEASON_EPISODES_OWNED).format(sourceValue);
+ return result
+ })), formatAddPeriod: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatAddPeriod(sourceValue) {
+ var result = String.empty;
+ if (sourceValue)
+ result = String.load(String.id.IDS_DETAILS_TRACK_NUM_FORMAT).format(sourceValue);
+ return result
+ })), formatTVSeasonNumberInt: function formatTVSeasonNumberInt(seasonNumber, isLowerCase) {
+ var formattedNumber;
+ if (seasonNumber === undefined)
+ return String.empty;
+ var seasonExtraStringId = isLowerCase ? String.id.IDS_TV_SEASON_0_NAME_LC : String.id.IDS_TV_SEASON_0_NAME;
+ var seasonNameStringId = isLowerCase ? String.id.IDS_TV_SEASON_NAME_LC : String.id.IDS_TV_SEASON_NAME;
+ formattedNumber = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber.format(seasonNumber);
+ var result = (seasonNumber <= 0) ? String.load(seasonExtraStringId) : String.load(seasonNameStringId).format(formattedNumber);
+ return result
+ }, formatTVSeasonNumber: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatTVSeasonNumber(sourceValue) {
+ return MS.Entertainment.Formatters.formatTVSeasonNumberInt(sourceValue)
+ })), formatTVSeasonEpisodeNumberInt: function formatTVSeasonEpisodeNumberInt(sourceValue) {
+ var result = String.empty;
+ var formattedEpisodeNumber;
+ var formattedSeasonNumber;
+ var numberFormatter;
+ if (sourceValue === undefined || sourceValue === null)
+ return String.emtpy;
+ if ((sourceValue.seriesTitle && sourceValue.seasonNumber !== undefined && sourceValue.episodeNumber !== undefined) || (sourceValue.contentType === "TVEpisode")) {
+ numberFormatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).decimalNumber;
+ var seasonNumber = sourceValue.seasonNumber;
+ if (sourceValue.season && sourceValue.season.number)
+ seasonNumber = sourceValue.season.number;
+ formattedSeasonNumber = numberFormatter.format(seasonNumber);
+ var seasonNumber = (seasonNumber <= 0) ? String.load(String.id.IDS_TV_SEASON_0_NAME) : String.load(String.id.IDS_TV_SEASON_NAME).format(formattedSeasonNumber);
+ var episodeNumber;
+ if (sourceValue.episodeNumber > 0) {
+ formattedEpisodeNumber = numberFormatter.format(sourceValue.episodeNumber);
+ episodeNumber = String.load(String.id.IDS_TV_NUMBERED_EPISODE_NAME).format(formattedEpisodeNumber)
+ }
+ else
+ episodeNumber = String.load(String.id.IDS_TV_NUMBERED_EPISODE_0_NAME);
+ if (seasonNumber !== 0 || episodeNumber !== 0)
+ result = String.load(String.id.IDS_COMMA_SEPARATOR).format(seasonNumber, episodeNumber);
+ else
+ result = episodeNumber
+ }
+ return result
+ }, formatTVSeasonEpisodeNumber: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatTVSeasonEpisodeNumber(sourceValue) {
+ return MS.Entertainment.Formatters.formatTVSeasonEpisodeNumberInt(sourceValue)
+ })), formatEpisodeSeriesTitleSeasonEpisodeNumberFileSize: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatVideoDownloadMovieDescription(sourceValue) {
+ var result = String.empty;
+ if (sourceValue === undefined || sourceValue === null)
+ return String.emtpy;
+ if (sourceValue.seriesTitle)
+ result = sourceValue.seriesTitle;
+ var seasonEpisodeNumber = MS.Entertainment.Formatters.formatTVSeasonEpisodeNumberInt(sourceValue);
+ if (seasonEpisodeNumber)
+ if (result.length > 0)
+ result = String.load(String.id.IDS_COMMA_SEPARATOR).format(result, seasonEpisodeNumber);
+ else
+ result = seasonEpisodeNumber;
+ return result
+ })), formatMovieGenreReleaseYear: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatMovieGenreReleaseYear(sourceValue) {
+ var result = String.empty;
+ if (sourceValue === undefined || sourceValue === null)
+ return String.emtpy;
+ if (sourceValue.genreName)
+ result = sourceValue.genreName;
+ if (sourceValue.releaseDate) {
+ var dateFormat = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ var year = dateFormat.format(sourceValue.releaseDate);
+ if (result.length > 0)
+ result = String.load(String.id.IDS_COMMA_SEPARATOR).format(result, year);
+ else
+ result = year
+ }
+ return result
+ })), formatContentRatingsList: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatContentRatingsList(contentIncludes) {
+ if (!contentIncludes)
+ return Stirng.empty;
+ if (typeof contentIncludes !== "string") {
+ var contentFeatures = [];
+ contentIncludes.forEach(function forEachContentIncludes(contentIncludes) {
+ contentFeatures.push(contentIncludes.label)
+ });
+ return contentFeatures.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else
+ return contentIncludes
+ })), formatEpisodeMetadata: function formatEpisodeMetadata(episode, options) {
+ var values = [];
+ var options = options || {};
+ if (options.releaseDate) {
+ var releaseDate = null;
+ if (episode.releaseDate) {
+ var formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).year;
+ if (MS.Entertainment.Platform.PlaybackHelpers.isTVEpisode(episode))
+ formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).shortDate;
+ var date = new Date(episode.releaseDate);
+ releaseDate = formatter.format(date)
+ }
+ if (releaseDate)
+ values.push(releaseDate)
+ }
+ if (options.genres) {
+ var genres = null;
+ if (episode.genre)
+ if (Array.isArray(episode.genre)) {
+ var genreNames = [];
+ episode.genre.forEach(function(genre) {
+ if (genre)
+ genreNames.push(genre.name)
+ });
+ genres = genreNames.join(String.load(String.id.IDS_DETAILS_INFO_SEPERATOR))
+ }
+ else
+ genres = episode.genre;
+ else if (episode.genreName)
+ genres = episode.genreName;
+ if (genres)
+ values.push(genres)
+ }
+ if (options.network)
+ if (episode.network)
+ values.push(episode.network);
+ else if (episode.networks && episode.networks.length > 0 && episode.networks[0].name)
+ values.push(episode.networks[0].name);
+ if (options.languages) {
+ var languages = MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getLanguagesForRights(episode, MS.Entertainment.Utilities.defaultClientTypeFromApp);
+ if (languages && languages.length === 1)
+ values.push(String.load(String.id.IDS_DETAILS_AUDIO_LANGUAGE).format(MS.Entertainment.Utilities.getDisplayLanguageFromLanguageCode(languages[0])))
+ }
+ if (options.rating)
+ if (episode.localizedRatingStringLong)
+ values.push(episode.localizedRatingStringLong);
+ if (options.videoDefinition)
+ if (episode.libraryDefinitions)
+ values.push(episode.libraryDefinitions);
+ else if (episode.videoDefinitions && episode.videoDefinitions !== String.load(String.id.IDS_UNKNOWN_VALUE))
+ values.push(episode.videoDefinitions);
+ if (options.duration) {
+ var duration = null;
+ if (episode.duration && episode.duration !== -1)
+ duration = MS.Entertainment.Utilities.formatTimeString(episode.duration);
+ if (duration)
+ values.push(duration)
+ }
+ var seperator = String.load(String.id.IDS_DETAILS_INFO_SEPERATOR);
+ if (MS.Entertainment.Utilities.isVideoApp2)
+ seperator = String.load(String.id.IDS_DETAILS_METADATA_SEPERATOR);
+ return values.join(seperator)
+ }, formatPresaleFulfillmentDate: function formatPresaleFulfillmentDate(fulfillmentDate) {
+ if (!fulfillmentDate)
+ return;
+ var fulfillmentOffset = new Date(fulfillmentDate.getTime());
+ fulfillmentOffset.setHours(fulfillmentDate.getHours() + 12);
+ var formatter = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.dateTimeFormatters).shortDate;
+ var fulfillmentDayMonthYear = formatter.format(fulfillmentOffset);
+ return fulfillmentDayMonthYear
+ }, formatMoviePresaleMetadata: function formatMoviePresaleMetadata(mediaItem, stateInfo) {
+ if (!mediaItem || !stateInfo)
+ return;
+ var moviePresaleMetadata = null;
+ if (mediaItem.isPresale || stateInfo.marketplace.isPresale) {
+ var formattedFulfillmentDate = null;
+ var presaleFulfillmentDate = mediaItem.presaleFulfillmentDate || stateInfo.marketplace.presaleFulfillmentDate;
+ if (presaleFulfillmentDate) {
+ var fulfillmentDate = presaleFulfillmentDate;
+ if (Date.isValidExpirationDate(fulfillmentDate)) {
+ var now = new Date;
+ if (now < fulfillmentDate)
+ formattedFulfillmentDate = MS.Entertainment.Formatters.formatPresaleFulfillmentDate(fulfillmentDate)
+ }
+ }
+ moviePresaleMetadata = {};
+ if (stateInfo.marketplace.hasPurchased) {
+ moviePresaleMetadata.title = String.load(String.id.IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASED_SC);
+ if (formattedFulfillmentDate)
+ moviePresaleMetadata.text = String.load(String.id.IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_KNOWN).format(formattedFulfillmentDate);
+ else
+ moviePresaleMetadata.text = String.load(String.id.IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_UNKNOWN)
+ }
+ else {
+ moviePresaleMetadata.title = String.load(String.id.IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASE_SC);
+ if (formattedFulfillmentDate)
+ moviePresaleMetadata.text = String.load(String.id.IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_KNOWN).format(formattedFulfillmentDate);
+ else
+ moviePresaleMetadata.text = String.load(String.id.IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_UNKNOWN)
+ }
+ }
+ return moviePresaleMetadata
+ }, formatIsDownloaded: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatCanPlayLocally(source) {
+ var result = String.empty;
+ if (!source && MS.Entertainment.Utilities.isApp1)
+ result = MS.Entertainment.UI.Icon.inlineStreaming;
+ return result
+ })), issueCountText: function issueCountText(count) {
+ return MS.Entertainment.Formatters.countText(count, String.id.IDS_READ_ISSUE_COUNT_PLURAL)
+ }, formatIssueCount: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatIssueCount(count) {
+ return MS.Entertainment.Formatters.formatCount(count, MS.Entertainment.Formatters.issueCountText)
+ })), formatIsSample: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatIsSample(source) {
+ if (source && source === true)
+ return String.load(String.id.IDS_READ_SAMPLE_TEXT);
+ return String.empty
+ })), formatStringForVoice: WinJS.Binding.converter(WinJS.Utilities.markSupportedForProcessing(function formatStringForVoice(source) {
+ return MS.Entertainment.UI.App2.VoiceStatics.normalizeStringForVoice(source)
+ }))
+ })
+})()
+})();
+/* >>>>>>/framework/navigatetopageaction.js:28312 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Actions) {
+ var NavigateToPageAction = (function(_super) {
+ __extends(NavigateToPageAction, _super);
+ function NavigateToPageAction() {
+ _super.apply(this, arguments);
+ this.animatePageTransition = true
+ }
+ Object.defineProperty(NavigateToPageAction.prototype, "pivotMoniker", {
+ get: function() {
+ return this._pivotMoniker
+ }, set: function(value) {
+ this._pivotMoniker = value
+ }, enumerable: true, configurable: true
+ });
+ NavigateToPageAction.prototype.getPivotMoniker = function(key) {
+ Trace.fail("NavigateToPageAction::getPivotMoniker is abstract and must be subclassed.");
+ return null
+ };
+ NavigateToPageAction.prototype.canExecute = function(param) {
+ return Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.winJSNavigation)
+ };
+ NavigateToPageAction.prototype._navigateTo = function(dataContext, template, referenceElement, contentCompleteCallback, perfStartTime, itemPropertyBag, supportsSnapped) {
+ if (typeof supportsSnapped === "undefined")
+ supportsSnapped = false;
+ if (referenceElement)
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ domElement: referenceElement, itemPropertyBag: itemPropertyBag
+ }, {
+ uri: MS.Entertainment.Utilities.getCurrentUserLocation(), pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ }, {
+ uri: template, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ });
+ if (perfStartTime)
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(perfStartTime);
+ var pivotMoniker = null;
+ if (this.parameter && this.parameter.pivotMoniker)
+ pivotMoniker = this.getPivotMoniker(this.parameter.pivotMoniker);
+ else if (this.pivotMoniker)
+ pivotMoniker = this.getPivotMoniker(this.pivotMoniker);
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateTo(new MS.Entertainment.UI.Framework.NavigationOperation(dataContext, template, contentCompleteCallback, null, this.animatePageTransition, null, pivotMoniker, supportsSnapped))
+ };
+ return NavigateToPageAction
+ })(Actions.Action);
+ Actions.NavigateToPageAction = NavigateToPageAction
+ })(UI.Actions || (UI.Actions = {}));
+ var Actions = UI.Actions
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/video_win/videonavigationactions.js:28382 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Actions) {
+ (function(VideoNavigation) {
+ (function(Monikers) {
+ Monikers[Monikers["explore"] = 1] = "explore"
+ })(VideoNavigation.Monikers || (VideoNavigation.Monikers = {}));
+ var Monikers = VideoNavigation.Monikers
+ })(Actions.VideoNavigation || (Actions.VideoNavigation = {}));
+ var VideoNavigation = Actions.VideoNavigation;
+ var VideoNavigateToPageAction = (function(_super) {
+ __extends(VideoNavigateToPageAction, _super);
+ function VideoNavigateToPageAction() {
+ _super.apply(this, arguments)
+ }
+ VideoNavigateToPageAction.prototype.getPivotMoniker = function(key) {
+ return VideoNavigation.Monikers[key]
+ };
+ return VideoNavigateToPageAction
+ })(Actions.NavigateToPageAction);
+ Actions.VideoNavigateToPageAction = VideoNavigateToPageAction;
+ var MoviesStoreNavigateAction = (function(_super) {
+ __extends(MoviesStoreNavigateAction, _super);
+ function MoviesStoreNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.moviesStoreNavigate
+ }
+ MoviesStoreNavigateAction.prototype.executed = function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateToMoniker("moviesStore")
+ };
+ return MoviesStoreNavigateAction
+ })(VideoNavigateToPageAction);
+ Actions.MoviesStoreNavigateAction = MoviesStoreNavigateAction;
+ var TvStoreNavigateAction = (function(_super) {
+ __extends(TvStoreNavigateAction, _super);
+ function TvStoreNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.tvStoreNavigate
+ }
+ TvStoreNavigateAction.prototype.executed = function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ navigationService.navigateToMoniker("tvStore")
+ };
+ return TvStoreNavigateAction
+ })(VideoNavigateToPageAction);
+ Actions.TvStoreNavigateAction = TvStoreNavigateAction;
+ (function(VideoMarketplaceGalleryActions) {
+ var NavigateToMarketplaceGalleryAction = (function(_super) {
+ __extends(NavigateToMarketplaceGalleryAction, _super);
+ function NavigateToMarketplaceGalleryAction() {
+ _super.apply(this, arguments)
+ }
+ NavigateToMarketplaceGalleryAction.prototype._createViewModel = function(param) {
+ Trace.fail("NavigateToMarketplaceGalleryAction::_createViewModel must be overridden by subclass.")
+ };
+ NavigateToMarketplaceGalleryAction.prototype._perfTrackEventCompleteCallBack = function() {
+ Trace.fail("NavigateToMarketplaceGalleryAction::_perfTrackEventCompleteCallBack must be overridden by subclass.")
+ };
+ NavigateToMarketplaceGalleryAction.prototype._perfTrackStartTime = function() {
+ Trace.fail("NavigateToMarketplaceGalleryAction::_perfTrackStartTime must be overridden by subclass.")
+ };
+ NavigateToMarketplaceGalleryAction.prototype.executed = function(param, referenceElement) {
+ var _this = this;
+ this._navigateTo(function() {
+ return _this._createViewModel(param)
+ }, "/Components/Video_Win/VideoMarketplacePageTemplate.html#marketplacePageBody", referenceElement, function() {
+ return _this._perfTrackEventCompleteCallBack()
+ }, this._perfTrackStartTime())
+ };
+ return NavigateToMarketplaceGalleryAction
+ })(VideoNavigateToPageAction);
+ VideoMarketplaceGalleryActions.NavigateToMarketplaceGalleryAction = NavigateToMarketplaceGalleryAction;
+ var NewMoviesNavigateAction = (function(_super) {
+ __extends(NewMoviesNavigateAction, _super);
+ function NewMoviesNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.newMoviesMarketplaceNavigate
+ }
+ NewMoviesNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.NewMoviesPageRequest
+ };
+ NewMoviesNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioNewMoviesPageRequest()
+ };
+ NewMoviesNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.EditorialVideoMarketplaceViewModel(Entertainment.ViewModels.EditorialVideoMarketplaceViewModel.ViewTypes.newMovies)
+ };
+ return NewMoviesNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.NewMoviesNavigateAction = NewMoviesNavigateAction;
+ var FeaturedMoviesNavigateAction = (function(_super) {
+ __extends(FeaturedMoviesNavigateAction, _super);
+ function FeaturedMoviesNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.featuredMoviesMarketplaceNavigate
+ }
+ FeaturedMoviesNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.FeaturedMoviesPageRequest
+ };
+ FeaturedMoviesNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioFeaturedMoviesPageRequest()
+ };
+ FeaturedMoviesNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.EditorialVideoMarketplaceViewModel(Entertainment.ViewModels.EditorialVideoMarketplaceViewModel.ViewTypes.featuredMovies)
+ };
+ return FeaturedMoviesNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.FeaturedMoviesNavigateAction = FeaturedMoviesNavigateAction;
+ var FlexHubNavigateAction = (function(_super) {
+ __extends(FlexHubNavigateAction, _super);
+ function FlexHubNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.flexHubNavigate
+ }
+ FlexHubNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.FlexHubPageRequest
+ };
+ FlexHubNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioFlexHubPageRequest()
+ };
+ FlexHubNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.FlexHubViewModel(param.targetFeed)
+ };
+ return FlexHubNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.FlexHubNavigateAction = FlexHubNavigateAction;
+ var TopMoviesNavigateAction = (function(_super) {
+ __extends(TopMoviesNavigateAction, _super);
+ function TopMoviesNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.topMoviesMarketplaceNavigate
+ }
+ TopMoviesNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.TopSellingMoviesPageRequest
+ };
+ TopMoviesNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioTopSellingMoviesPageRequest()
+ };
+ TopMoviesNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.TopMoviesMarketplaceViewModel(Entertainment.ViewModels.TopMoviesMarketplaceViewModel.ViewTypes.topMovies, param.pivotType)
+ };
+ return TopMoviesNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.TopMoviesNavigateAction = TopMoviesNavigateAction;
+ var TopTvNavigateAction = (function(_super) {
+ __extends(TopTvNavigateAction, _super);
+ function TopTvNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.topTvMarketplaceNavigate
+ }
+ TopTvNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.TopSellingTvPageRequest
+ };
+ TopTvNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioTopSellingTvPageRequest()
+ };
+ TopTvNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.TopTvMarketplaceViewModel(Entertainment.ViewModels.TopTvMarketplaceViewModel.ViewTypes.topTv, param.pivotType)
+ };
+ return TopTvNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.TopTvNavigateAction = TopTvNavigateAction;
+ var NewTvNavigateAction = (function(_super) {
+ __extends(NewTvNavigateAction, _super);
+ function NewTvNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.newTvMarketplaceNavigate
+ }
+ NewTvNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.NewTvPageRequest
+ };
+ NewTvNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioNewTvPageRequest()
+ };
+ NewTvNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.EditorialVideoMarketplaceViewModel(Entertainment.ViewModels.EditorialVideoMarketplaceViewModel.ViewTypes.newTv)
+ };
+ return NewTvNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.NewTvNavigateAction = NewTvNavigateAction;
+ var FeaturedTvNavigateAction = (function(_super) {
+ __extends(FeaturedTvNavigateAction, _super);
+ function FeaturedTvNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.featuredTvMarketplaceNavigate
+ }
+ FeaturedTvNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.FeaturedTvPageRequest
+ };
+ FeaturedTvNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioFeaturedTvPageRequest()
+ };
+ FeaturedTvNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.EditorialVideoMarketplaceViewModel(Entertainment.ViewModels.EditorialVideoMarketplaceViewModel.ViewTypes.featuredTv)
+ };
+ return FeaturedTvNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.FeaturedTvNavigateAction = FeaturedTvNavigateAction;
+ var LastNightTvNavigateAction = (function(_super) {
+ __extends(LastNightTvNavigateAction, _super);
+ function LastNightTvNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.lastNightTvMarketplaceNavigate
+ }
+ LastNightTvNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.LastNightsTvPageRequest
+ };
+ LastNightTvNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioLastNightsTvPageRequest()
+ };
+ LastNightTvNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.EditorialVideoMarketplaceViewModel(Entertainment.ViewModels.EditorialVideoMarketplaceViewModel.ViewTypes.lastNightTv)
+ };
+ return LastNightTvNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.LastNightTvNavigateAction = LastNightTvNavigateAction;
+ var TvFeaturedSetsNavigateAction = (function(_super) {
+ __extends(TvFeaturedSetsNavigateAction, _super);
+ function TvFeaturedSetsNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.tvFeaturedSetsMarketplaceNavigate
+ }
+ TvFeaturedSetsNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.FlexHubPageRequest
+ };
+ TvFeaturedSetsNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioFlexHubPageRequest()
+ };
+ TvFeaturedSetsNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.FeaturedSetsMarketplaceViewModel(Entertainment.ViewModels.FeaturedSetsMarketplaceViewModel.ViewTypes.tvFeaturedSets)
+ };
+ return TvFeaturedSetsNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.TvFeaturedSetsNavigateAction = TvFeaturedSetsNavigateAction;
+ var MoviesFeaturedSetsNavigateAction = (function(_super) {
+ __extends(MoviesFeaturedSetsNavigateAction, _super);
+ function MoviesFeaturedSetsNavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.moviesFeaturedSetsMarketplaceNavigate
+ }
+ MoviesFeaturedSetsNavigateAction.prototype._perfTrackStartTime = function() {
+ return MS.Entertainment.Instrumentation.PerfTrack.StartPoints.FlexHubPageRequest
+ };
+ MoviesFeaturedSetsNavigateAction.prototype._perfTrackEventCompleteCallBack = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioFlexHubPageRequest()
+ };
+ MoviesFeaturedSetsNavigateAction.prototype._createViewModel = function(param) {
+ return new Entertainment.ViewModels.FeaturedSetsMarketplaceViewModel(Entertainment.ViewModels.FeaturedSetsMarketplaceViewModel.ViewTypes.movieFeaturedSets)
+ };
+ return MoviesFeaturedSetsNavigateAction
+ })(NavigateToMarketplaceGalleryAction);
+ VideoMarketplaceGalleryActions.MoviesFeaturedSetsNavigateAction = MoviesFeaturedSetsNavigateAction;
+ var ShowLocalGrovelInfoDialogAction = (function(_super) {
+ __extends(ShowLocalGrovelInfoDialogAction, _super);
+ function ShowLocalGrovelInfoDialogAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.showLocalGrovelInfoDialog
+ }
+ ShowLocalGrovelInfoDialogAction.prototype.canExecute = function(param) {
+ return WinJS.Utilities.getMember("Windows.Storage.StorageLibrary")
+ };
+ ShowLocalGrovelInfoDialogAction.prototype.executed = function() {
+ return UI.Controls.ManageFoldersDialog.show()
+ };
+ return ShowLocalGrovelInfoDialogAction
+ })(VideoNavigateToPageAction);
+ VideoMarketplaceGalleryActions.ShowLocalGrovelInfoDialogAction = ShowLocalGrovelInfoDialogAction;
+ var PersonalVideoNavigationAction = (function(_super) {
+ __extends(PersonalVideoNavigationAction, _super);
+ function PersonalVideoNavigationAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.personalVideoNavigate
+ }
+ Object.defineProperty(PersonalVideoNavigationAction.prototype, "currentDataContext", {
+ get: function() {
+ var winJSNavigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ return winJSNavigationService.realizedDataContext
+ }, enumerable: true, configurable: true
+ });
+ PersonalVideoNavigationAction.prototype.executed = function(event) {
+ MS.Entertainment.UI.Actions.assert(event, "Cannot navigate without defining parameter");
+ var folderId = WinJS.Utilities.getMember("data.folderId", event);
+ if (folderId) {
+ var currentDataContext = this.currentDataContext;
+ if (currentDataContext && currentDataContext.openFolder)
+ currentDataContext.openFolder(folderId)
+ }
+ else if (event.data.mediaType === Microsoft.Entertainment.Queries.ObjectType.video && event.data.videoType === Microsoft.Entertainment.Queries.VideoType.other) {
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.PlayCommand);
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayNonProtectedInApp();
+ MS.Entertainment.Platform.PlaybackHelpers.showImmersiveDetails(event.data, false, true)
+ }
+ };
+ return PersonalVideoNavigationAction
+ })(VideoNavigateToPageAction);
+ VideoMarketplaceGalleryActions.PersonalVideoNavigationAction = PersonalVideoNavigationAction
+ })(Actions.VideoMarketplaceGalleryActions || (Actions.VideoMarketplaceGalleryActions = {}));
+ var VideoMarketplaceGalleryActions = Actions.VideoMarketplaceGalleryActions;
+ (function(VideoDetailsActions) {
+ var NavigateToDetailsAction = (function(_super) {
+ __extends(NavigateToDetailsAction, _super);
+ function NavigateToDetailsAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.navigateToVideoDetails
+ }
+ NavigateToDetailsAction.prototype._createViewModel = function(param) {
+ var mediaItem = param && param.data;
+ var mediaType = WinJS.Utilities.getMember("actionType.mediaType", mediaItem);
+ if (mediaItem)
+ if (Entertainment.Utilities.isMovie(mediaItem))
+ return Entertainment.ViewModels.MovieDetailsViewModel.create(mediaItem, param.viewModelParams);
+ else if (Entertainment.Utilities.isTVSeason(mediaItem) || Entertainment.Utilities.isTVSeries(mediaItem))
+ return Entertainment.ViewModels.TvDetailsViewModel.create(mediaItem, param.viewModelParams);
+ else if (Entertainment.Utilities.isTVEpisode(mediaItem))
+ return Entertainment.ViewModels.EpisodeDetailsViewModel.create(mediaItem, param.viewModelParams);
+ else if (mediaType === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub)
+ return new Entertainment.ViewModels.FlexHubViewModel(mediaItem.actionTarget);
+ else {
+ Actions.fail("Unrecognized media item type!");
+ return null
+ }
+ };
+ NavigateToDetailsAction.prototype.canExecute = function(param) {
+ return Entertainment.ServiceLocator.isServiceRegistered(Entertainment.Services.winJSNavigation)
+ };
+ NavigateToDetailsAction.prototype.executed = function(param, referenceElement) {
+ var _this = this;
+ var mediaItem = param && param.data;
+ var mediaType = WinJS.Utilities.getMember("actionType.mediaType", mediaItem);
+ if (MS.Entertainment.Utilities.isMovie(mediaItem))
+ this._navigateTo(function() {
+ return _this._createViewModel(param)
+ }, "/Components/Video_Win/MovieDetails.html#movieDetailsBody", referenceElement, function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioMovieDetailsRequest()
+ }, MS.Entertainment.Instrumentation.PerfTrack.StartPoints.MovieDetailsRequest);
+ else if (MS.Entertainment.Utilities.isTVSeason(mediaItem) || MS.Entertainment.Utilities.isTVSeries(mediaItem))
+ this._navigateTo(function() {
+ return _this._createViewModel(param)
+ }, "/Components/Video_Win/TvDetails.html#tvDetailsBody", referenceElement, function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioTVDetailsRequest()
+ }, MS.Entertainment.Instrumentation.PerfTrack.StartPoints.TVDetailsRequest);
+ else if (MS.Entertainment.Utilities.isTVEpisode(mediaItem))
+ this._navigateTo(function() {
+ return _this._createViewModel(param)
+ }, "/Components/Video_Win/EpisodeDetails.html#episodeDetailsBody", referenceElement);
+ else if (mediaType === MS.Entertainment.Data.Augmenter.Spotlight.MediaType.FlexHub)
+ this._navigateTo(function() {
+ return _this._createViewModel(param)
+ }, "/Components/Video_Win/VideoMarketplacePageTemplate.html#marketplacePageBody", referenceElement, function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioFlexHubPageRequest()
+ }, MS.Entertainment.Instrumentation.PerfTrack.StartPoints.FlexHubPageRequest);
+ else if (mediaItem.videoType === Microsoft.Entertainment.Queries.VideoType.other) {
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.PlayCommand);
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayNonProtectedInApp();
+ var immersiveOptions = {startFullScreen: true};
+ var playPreviewOnly = (mediaItem && mediaItem.playPreviewOnly) ? mediaItem.playPreviewOnly : false;
+ var playOptions = {
+ autoPlay: true, showImmersive: true, immersiveOptions: immersiveOptions, playPreviewOnly: playPreviewOnly, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.details
+ };
+ if (MS.Entertainment.Platform && MS.Entertainment.Platform.PlaybackHelpers && MS.Entertainment.Platform.PlaybackHelpers.playMedia2)
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(mediaItem, playOptions)
+ }
+ else
+ Actions.fail("Unrecognized media item type!")
+ };
+ return NavigateToDetailsAction
+ })(VideoNavigateToPageAction);
+ VideoDetailsActions.NavigateToDetailsAction = NavigateToDetailsAction;
+ var ChangeTvSeasonAction = (function(_super) {
+ __extends(ChangeTvSeasonAction, _super);
+ function ChangeTvSeasonAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.changeTvSeason
+ }
+ ChangeTvSeasonAction.prototype.canExecute = function(param) {
+ var mediaItem = param && param.data;
+ var model = param && param.model;
+ return (MS.Entertainment.Utilities.isTVSeason(mediaItem) && model)
+ };
+ ChangeTvSeasonAction.prototype.executed = function(param, referenceElement) {
+ var mediaItem = param && param.data;
+ var model = param && param.model;
+ model.updateFromSeason(mediaItem)
+ };
+ return ChangeTvSeasonAction
+ })(Actions.Action);
+ VideoDetailsActions.ChangeTvSeasonAction = ChangeTvSeasonAction
+ })(Actions.VideoDetailsActions || (Actions.VideoDetailsActions = {}));
+ var VideoDetailsActions = Actions.VideoDetailsActions;
+ (function(VideoSearchActions) {
+ var NavigateAction = (function(_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = UI.AutomationIds.searchResultsNavigate
+ }
+ NavigateAction.prototype.canExecute = function(param) {
+ return !!param
+ };
+ NavigateAction.prototype.executed = function(param, referenceElement) {
+ var searchText = param.searchText;
+ var searchPageUri = NavigateAction._searchFullResultsPageUri;
+ var navigationService = Entertainment.ServiceLocator.getService(Entertainment.Services.winJSNavigation);
+ var existingSearchText = WinJS.Utilities.getMember("realizedDataContext.searchText", navigationService);
+ if (searchText === existingSearchText && searchPageUri === navigationService.location)
+ return;
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ var isViewingCollection = (navigationService && (navigationService.location === "/Components/Video_Win/VideoCollection.html#collectionBody"));
+ this._navigateTo(function() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isTvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var isMoviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var searchScope;
+ if ((!isTvMarketplaceEnabled && !isMoviesMarketplaceEnabled) || !UI.NetworkStatusService.isOnline() || isViewingCollection)
+ searchScope = 0;
+ else
+ searchScope = 1;
+ var viewModel = new Entertainment.ViewModels.VideoSearchGalleryViewModelBase(searchText, searchScope);
+ viewModel.loadModules();
+ return viewModel
+ }, searchPageUri, referenceElement, Entertainment.Instrumentation.PerfTrack.triggerScenarioSearchGalleryRequestToLoad, Entertainment.Instrumentation.PerfTrack.StartPoints.SearchGalleryRequest)
+ };
+ NavigateAction._searchFullResultsPageUri = "/Components/Video_Win/SearchResultsPage.html#searchResults";
+ return NavigateAction
+ })(VideoNavigateToPageAction);
+ VideoSearchActions.NavigateAction = NavigateAction
+ })(Actions.VideoSearchActions || (Actions.VideoSearchActions = {}));
+ var VideoSearchActions = Actions.VideoSearchActions;
+ (function() {
+ var actionService = Entertainment.ServiceLocator.getService(Entertainment.Services.actions);
+ actionService.register(Actions.ActionIdentifiers.changeTvSeason, function() {
+ return new VideoDetailsActions.ChangeTvSeasonAction
+ });
+ actionService.register(Actions.ActionIdentifiers.moviesStoreNavigate, function() {
+ return new MoviesStoreNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.featuredMoviesMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.FeaturedMoviesNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.flexHubNavigate, function() {
+ return new VideoMarketplaceGalleryActions.FlexHubNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.navigateToVideoDetails, function() {
+ return new VideoDetailsActions.NavigateToDetailsAction
+ });
+ actionService.register(Actions.ActionIdentifiers.newMoviesMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.NewMoviesNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.topMoviesMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.TopMoviesNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.topTvMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.TopTvNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.newTvMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.NewTvNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.featuredTvMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.FeaturedTvNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.lastNightTvMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.LastNightTvNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.tvFeaturedSetsMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.TvFeaturedSetsNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.moviesFeaturedSetsMarketplaceNavigate, function() {
+ return new VideoMarketplaceGalleryActions.MoviesFeaturedSetsNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.tvStoreNavigate, function() {
+ return new TvStoreNavigateAction
+ });
+ actionService.register(Actions.ActionIdentifiers.showLocalGrovelInfoDialog, function() {
+ return new VideoMarketplaceGalleryActions.ShowLocalGrovelInfoDialogAction
+ });
+ actionService.register(Actions.ActionIdentifiers.personalVideoNavigate, function() {
+ return new VideoMarketplaceGalleryActions.PersonalVideoNavigationAction
+ });
+ actionService.register(Actions.ActionIdentifiers.searchResultsNavigate, function() {
+ return new VideoSearchActions.NavigateAction
+ })
+ })()
+ })(UI.Actions || (UI.Actions = {}));
+ var Actions = UI.Actions
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/deeplink.js:28888 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI.DeepLink");
+ WinJS.Namespace.define("MS.Entertainment.UI.DeepLink", {
+ _hideDeepLinkLoadingOverlayTimeoutMS: 10000, _deepLinksFactories: {}, isRegistered: function isRegistered(appMode) {
+ return !!MS.Entertainment.UI.DeepLink._deepLinksFactories[appMode]
+ }, registerDeepLinksFactory: function registerDeepLinksFactory(appMode, factory) {
+ MS.Entertainment.UI.DeepLink._deepLinksFactories[appMode] = factory
+ }, getTestHooks: function getTestHooks() {
+ return {getRegisteredDeepLinksFactory: function getRegisteredDeepLinksFactory() {
+ return MS.Entertainment.UI.DeepLink._deepLinksFactories
+ }}
+ }, ParamType: {
+ identifier: /^[_a-zA-Z][_a-zA-Z0-9]*$/g, guid: /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/g, mediaId: /^((\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})|[0-9]+)$/g, boolean: /^true|false$/gi, integer: /^[-+]?[0-9]+$/g, unsigned_integer: /^[0-9]+$/g, stringFormat: /.+/g, test: function test(type, value) {
+ type.lastIndex = 0;
+ return type.test(value)
+ }
+ }, PlayStateType: {
+ play: "play", pause: "pause"
+ }, processDeepLink: (function processDeepLink(command, params) {
+ var _deepLinks = null;
+ function convertToActionableParam(paramInput, paramType) {
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ switch (paramType) {
+ case type.identifier:
+ case type.stringFormat:
+ case type.guid:
+ return paramInput;
+ case type.boolean:
+ return (paramInput.toLowerCase() === "true");
+ case type.integer:
+ case type.unsigned_integer:
+ return parseInt(paramInput);
+ case type.mediaId:
+ if (type.test(type.guid, paramInput))
+ return paramInput;
+ else if (type.test(type.unsigned_integer, paramInput))
+ return parseInt(paramInput);
+ else {
+ MS.Entertainment.UI.DeepLink.fail("The parameter input of type mediaId was invalid. ParamInput=" + paramInput);
+ return null
+ }
+ default:
+ MS.Entertainment.UI.DeepLink.fail("The parameter type is not known. ParamType=" + paramType);
+ return null
+ }
+ }
+ return function processDeepLink(command, params) {
+ if (!command)
+ throw"processDeepLink: command parameter is mandatory";
+ if (!params)
+ throw"processDeepLink: params parameter is mandatory";
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ if (!_deepLinks) {
+ var factory = MS.Entertainment.UI.DeepLink._deepLinksFactories[MS.Entertainment.appMode];
+ if (factory)
+ _deepLinks = factory();
+ if (!_deepLinks)
+ return false;
+ for (var name in _deepLinks) {
+ var deepLink = _deepLinks[name];
+ MS.Entertainment.UI.DeepLink.assert(deepLink.actionId, "DeepLink definition: 'actionId' field not specified");
+ MS.Entertainment.UI.DeepLink.assert(deepLink.params, "DeepLink definition: 'params' field not specified");
+ for (var paramName in deepLink.params) {
+ var param = deepLink.params[paramName];
+ MS.Entertainment.UI.DeepLink.assert(typeof param.required === "boolean", "DeepLink definition: 'required' field not specified");
+ MS.Entertainment.UI.DeepLink.assert(param.type, "DeepLink definition: 'type' field not specified")
+ }
+ }
+ }
+ deepLink = _deepLinks[command];
+ if (!deepLink)
+ return false;
+ if (MS.Entertainment.Utilities.isApp2)
+ params = this._normalizeObjectProperties(params, deepLink.params);
+ for (name in deepLink.params)
+ if (deepLink.params[name].required && !params[name])
+ return false;
+ for (name in params) {
+ var parameterInfo = deepLink.params[name];
+ if (!parameterInfo)
+ return false;
+ parameterInfo.type.lastIndex = 0;
+ if (!type.test(parameterInfo.type, params[name]))
+ return false;
+ if (parameterInfo.values)
+ if (parameterInfo.caseInsensitive) {
+ var parameterValue = params[name].toLocaleLowerCase();
+ var validValue = false;
+ for (var i = 0; i < parameterInfo.values.length; i++) {
+ var itemValue = parameterInfo.values[i];
+ if (itemValue && (itemValue.toLocaleLowerCase() === parameterValue)) {
+ validValue = true;
+ break
+ }
+ }
+ if (!validValue)
+ return false
+ }
+ else {
+ var actionParam = convertToActionableParam(params[name], deepLink.params[name].type);
+ if (actionParam === undefined || actionParam === null || deepLink.params[name].values.indexOf(actionParam) === -1)
+ return false
+ }
+ }
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ if (!actionService.isRegistered(deepLink.actionId))
+ return false;
+ var action = actionService.getAction(deepLink.actionId);
+ if (!action.automationId)
+ action.automationId = MS.Entertainment.UI.AutomationIds.deepLink;
+ var actionParams = {};
+ for (name in params) {
+ actionParams[name] = convertToActionableParam(params[name], deepLink.params[name].type);
+ if (actionParams[name] === undefined || actionParams[name] === null)
+ return false
+ }
+ if (MS.Entertainment.Utilities.isMusicApp2)
+ actionParams["navigationDelay"] = 2000;
+ action.parameter = actionParams;
+ action.command = command;
+ action.execute();
+ if (MS.Entertainment.Utilities.isMusicApp2 && !deepLink.hideOverlay)
+ MS.Entertainment.UI.DeepLink._showDeepLinkLoadingOverlay();
+ return true
+ }
+ })(), processProtocol: function processProtocol(url, dataPoint, parameters) {
+ var decodedUrl;
+ try {
+ decodedUrl = decodeURI(url)
+ }
+ catch(e) {
+ MS.Entertainment.UI.DeepLink.fail("processProtocol: decodeURI failed for " + url);
+ return false
+ }
+ var match = /^[a-zA-Z0-9-]+:\/\/([a-zA-Z-]+)\/?\?(.*)$/g.exec(decodedUrl);
+ if (!match && parameters)
+ match = /^([a-zA-Z-]+)\/?\?(.*)$/g.exec(parameters);
+ if (!match || !match[1])
+ return false;
+ var command = match[1];
+ var isValid = true;
+ var deepLinkSource = String.empty;
+ var params = {};
+ if (match[2]) {
+ var nameValuePairs = match[2].split("&");
+ for (var i = 0; i < nameValuePairs.length; i++) {
+ var nameValuePair = nameValuePairs[i];
+ match = /([_a-zA-Z][_a-zA-Z0-9-]*)=(.*)$/g.exec(nameValuePair);
+ if (match && match[1] && match[2] && !params[match[1]])
+ switch (match[1].toLowerCase()) {
+ case"source":
+ if (dataPoint)
+ dataPoint.appendParameter("DeeplinkSource", match[2]);
+ deepLinkSource = match[2];
+ break;
+ case"partnertoken":
+ MS.Entertainment.UI.DeepLink.assert(match[2], "No partner token received when processing deep link: " + url);
+ if (dataPoint)
+ dataPoint.appendParameter("DeepLinkPartnerToken", match[2]);
+ this._updateSignInWithPartnerToken(match[2]);
+ break;
+ case"eventtype":
+ break;
+ default:
+ params[match[1]] = match[2];
+ break
+ }
+ else {
+ isValid = false;
+ break
+ }
+ }
+ }
+ if (deepLinkSource) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.deepLinkSource = deepLinkSource;
+ if (params["ContentID"])
+ uiStateService.deepLinkSourceID = params["ContentID"];
+ uiStateService.deepLinkLaunchTime = Date.now();
+ if (dataPoint) {
+ dataPoint.appendParameter("DeepLinkSourceID", uiStateService.deepLinkSourceID);
+ dataPoint.appendParameter("DeepLinkLaunchTime", uiStateService.deepLinkLaunchTime)
+ }
+ }
+ if (isValid)
+ isValid = this.processDeepLink(command, params);
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (isValid)
+ eventProvider.traceDeepLink_Protocol_Invoked(url);
+ else
+ eventProvider.traceDeepLink_Protocol_Failed(url);
+ return isValid
+ }, _updateSignInWithPartnerToken: function _updateSignInWithPartnerToken(partnerToken) {
+ MS.Entertainment.UI.DeepLink.assert(partnerToken, "No partner token received when processing deep link");
+ if (!partnerToken || !MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn)) {
+ MS.Entertainment.UI.DeepLink.fail("Unable to get sign in service for registering partner token");
+ return
+ }
+ var signInService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signInService.updatePartnerToken(partnerToken)
+ }, processTile: function processTile(tileArgs) {
+ if (typeof tileArgs.command !== "string")
+ return false;
+ var command = tileArgs.command;
+ var params = {};
+ for (var name in tileArgs)
+ if (name !== "command" && typeof tileArgs[name] === "string")
+ params[name] = tileArgs[name];
+ var isValid = this.processDeepLink(command, params);
+ var argumentsAsText = "command=" + command;
+ for (name in params)
+ argumentsAsText = argumentsAsText + ", " + name + "=" + params[name];
+ var eventProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell;
+ if (isValid)
+ eventProvider.traceDeepLink_Tile_Invoked(argumentsAsText);
+ else
+ eventProvider.traceDeepLink_Tile_Failed(argumentsAsText);
+ return isValid
+ }, _showDeepLinkLoadingOverlay: function _showDeepLinkLoadingOverlay() {
+ MS.Entertainment.UI.Controls.Overlay.showLoadingOverlay({
+ userControl: "MS.Entertainment.UI.Controls.LoadingControl", hideOnNowPlaying: true, enableKeyboardLightDismiss: false, onInitialize: function setModel(overlayContent) {
+ var progressControl = document.createElement("progress");
+ WinJS.Utilities.addClass(progressControl, "loadingRing win-ring win-large");
+ overlayContent.appendChild(progressControl);
+ return WinJS.Promise.wrap()
+ }, userControlOptions: {
+ isBusy: true, height: null
+ }, closeTimeoutMS: MS.Entertainment.UI.DeepLink._hideDeepLinkLoadingOverlayTimeoutMS, focusFirstElementOnNavigate: false
+ })
+ }, _normalizeObjectProperties: function _normalizeObjectProperties(unNormalizedObject, templateObject) {
+ var normalizedObject = {};
+ for (var unNormalizedPropertyName in unNormalizedObject)
+ for (var templatePropertyName in templateObject)
+ if (templatePropertyName.toLocaleLowerCase() === unNormalizedPropertyName.toLocaleLowerCase()) {
+ normalizedObject[templatePropertyName] = unNormalizedObject[unNormalizedPropertyName];
+ break
+ }
+ return normalizedObject
+ }
+ });
+ MS.Entertainment.UI.DeepLink.registerDeepLinksFactory(Microsoft.Entertainment.Application.AppMode.video, function() {
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ return {
+ location: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLocation, params: {
+ id: {
+ type: type.identifier, required: true, values: [MS.Entertainment.UI.Monikers.homeHub, MS.Entertainment.UI.Monikers.movieMarketplaceFeatured, MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, MS.Entertainment.UI.Monikers.tvMarketplaceFeatured, MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases, ]
+ }, gamerTag: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, details: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkDetails, params: {
+ id: {
+ type: type.guid, required: true
+ }, autoPlayPreview: {
+ type: type.boolean, required: false
+ }, autoPlay: {
+ type: type.boolean, required: false
+ }, startPositionMsec: {
+ type: type.unsigned_integer, required: false
+ }, desiredMediaItemType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.movie, MS.Entertainment.Data.Query.edsMediaType.tvSeries, MS.Entertainment.Data.Query.edsMediaType.tvSeason, MS.Entertainment.Data.Query.edsMediaType.tvEpisode, ], caseInsensitive: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog, ], caseInsensitive: true
+ }
+ }
+ }, playPin: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlayPin, params: {
+ id: {
+ type: type.stringFormat, required: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog, ], caseInsensitive: true
+ }, mediaType: {
+ type: type.integer, required: true, values: [Microsoft.Entertainment.Queries.ObjectType.video, Microsoft.Entertainment.Queries.ObjectType.tvSeason, Microsoft.Entertainment.Queries.ObjectType.tvSeries, ]
+ }, seriesZuneId: {
+ type: type.stringFormat, required: false
+ }, seasonNumber: {
+ type: type.integer, required: false
+ }
+ }
+ }, showPerfTrackLog: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkShowPerfTrackLog, params: {enable: {
+ type: type.boolean, required: true
+ }}
+ }, configureMemoryLeakTracking: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkConfigureMemoryLeakTracking, params: {enable: {
+ type: type.boolean, required: true
+ }}
+ }
+ }
+ });
+ MS.Entertainment.UI.DeepLink.registerDeepLinksFactory(Microsoft.Entertainment.Application.AppMode.video2, function() {
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ return {
+ location: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLocation, params: {
+ id: {
+ type: type.identifier, required: true, values: [MS.Entertainment.UI.Monikers.homeHub, MS.Entertainment.UI.Monikers.movieMarketplaceFeatured, MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, MS.Entertainment.UI.Monikers.tvMarketplaceFeatured, MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases, MS.Entertainment.UI.Monikers.flexHub]
+ }, targetId: {
+ type: type.stringFormat, required: false
+ }, gamerTag: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, details: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkDetails, params: {
+ id: {
+ type: type.guid, required: true
+ }, autoPlayPreview: {
+ type: type.boolean, required: false
+ }, autoPlay: {
+ type: type.boolean, required: false
+ }, startPositionMsec: {
+ type: type.unsigned_integer, required: false
+ }, desiredMediaItemType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsMediaType.movie, MS.Entertainment.Data.Query.edsMediaType.tvSeries, MS.Entertainment.Data.Query.edsMediaType.tvSeason, MS.Entertainment.Data.Query.edsMediaType.tvEpisode, ], caseInsensitive: true
+ }, idType: {
+ type: type.identifier, required: false, values: [MS.Entertainment.Data.Query.edsIdType.canonical, MS.Entertainment.Data.Query.edsIdType.zuneCatalog, ], caseInsensitive: true
+ }
+ }
+ }, playto: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlayTo, params: {}
+ }, "media-details": {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkVideoProtocolConverter, params: {
+ ContentID: {
+ type: type.guid, required: true
+ }, ContentType: {
+ type: type.stringFormat, required: false
+ }, DeepLinkInfo: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, "media-playback": {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkVideoProtocolConverter, params: {
+ ContentID: {
+ type: type.guid, required: true
+ }, ContentType: {
+ type: type.stringFormat, required: false
+ }, DeepLinkInfo: {
+ type: type.stringFormat, required: false
+ }, Time: {
+ type: type.stringFormat, required: false
+ }, PlayState: {
+ type: type.stringFormat, required: false, caseInsensitive: true, values: [MS.Entertainment.UI.DeepLink.PlayStateType.play, MS.Entertainment.UI.DeepLink.PlayStateType.pause]
+ }
+ }
+ }, "media-purchase": {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkVideoProtocolConverter, params: {
+ ContentID: {
+ type: type.guid, required: true
+ }, ContentType: {
+ type: type.stringFormat, required: false
+ }, DeepLinkInfo: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, tunerConfig: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deeplinkTunerConfig, params: {
+ namespace: {
+ type: type.stringFormat, required: true, values: ["features"]
+ }, key: {
+ type: type.stringFormat, required: true, values: ["videoWatchlist", ]
+ }, value: {
+ type: type.stringFormat, required: true
+ }
+ }
+ }
+ }
+ })
+})()
+})();
+/* >>>>>>/framework/video_win/videodeeplinks.js:29265 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+MS.Entertainment.UI.DeepLink.registerDeepLinksFactory(Microsoft.Entertainment.Application.AppMode.video, function() {
+ var mediaTypes = ["Movie", "TvSeries", "TvSeason", "TvEpisode"];
+ var mediaIdTypes = ["Canonical", "ZuneCatalog"];
+ var type = MS.Entertainment.UI.DeepLink.ParamType;
+ return {
+ location: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.videoDeepLinkLocation, params: {
+ id: {
+ type: type.identifier, required: true, values: [MS.Entertainment.UI.Monikers.homeHub, MS.Entertainment.UI.Monikers.movieMarketplaceFeatured, MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases, MS.Entertainment.UI.Monikers.tvMarketplaceFeatured, MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases]
+ }, gamerTag: {
+ type: type.stringFormat, required: false
+ }
+ }
+ }, details: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.videoDeepLinkDetails, params: {
+ id: {
+ type: type.guid, required: true
+ }, autoPlayPreview: {
+ type: type.boolean, required: false
+ }, autoPlay: {
+ type: type.boolean, required: false
+ }, startPositionMsec: {
+ type: type.unsigned_integer, required: false
+ }, desiredMediaItemType: {
+ type: type.identifier, required: false, values: mediaTypes, caseInsensitive: true
+ }, idType: {
+ type: type.identifier, required: false, values: mediaIdTypes, caseInsensitive: true
+ }
+ }
+ }, playPin: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkPlayPin, params: {
+ id: {
+ type: type.stringFormat, required: true
+ }, idType: {
+ type: type.identifier, required: false, values: mediaIdTypes, caseInsensitive: true
+ }, mediaType: {
+ type: type.integer, required: true, values: [Microsoft.Entertainment.Queries.ObjectType.video, Microsoft.Entertainment.Queries.ObjectType.tvSeason, Microsoft.Entertainment.Queries.ObjectType.tvSeries]
+ }, seriesZuneId: {
+ type: type.stringFormat, required: false
+ }, seasonNumber: {
+ type: type.integer, required: false
+ }
+ }
+ }, showPerfTrackLog: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkShowPerfTrackLog, params: {enable: {
+ type: type.boolean, required: true
+ }}
+ }, configureMemoryLeakTracking: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkConfigureMemoryLeakTracking, params: {enable: {
+ type: type.boolean, required: true
+ }}
+ }, configureVideoQualitySelector: {
+ actionId: MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkConfigureVideoQualitySelector, params: {enable: {
+ type: type.boolean, required: true
+ }}
+ }
+ }
+})
+})();
+/* >>>>>>/framework/video_win/videodeeplinksactions.js:29327 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Actions) {
+ var DeepLinkActionBase = (function(_super) {
+ __extends(DeepLinkActionBase, _super);
+ function DeepLinkActionBase() {
+ _super.apply(this, arguments)
+ }
+ DeepLinkActionBase.prototype.executed = function(params) {
+ Actions.fail("executed should be overridden by its subclass");
+ return null
+ };
+ DeepLinkActionBase.prototype._loadScriptsForVideoDeepLinkActions = function() {
+ return MS.Entertainment.UI.Framework.loadScripts("/ViewModels/MediaItemModel.js", "/ViewModels/PurchaseFlow/SmartBuyStateEngine.js", "/ViewModels/PurchaseFlow/VideoSmartBuyStateEngine.js", "/framework/formatters.js", "/framework/iaservice.js", "/framework/navigation.js", "/framework/data/augmenters/commonaugmenters.js", "/framework/data/augmenters/commonHydrators.js", "/framework/data/augmenters/edsAugmenters.js", "/framework/data/augmenters/videoHydrators.js", "/framework/data/augmenters/videoAugmenters.js", "/framework/data/queries/edsqueries.js", "/Framework/data/queries/videoQueries.js", "/ViewModels/PurchaseFlow/SmartBuyButtons.js")
+ };
+ return DeepLinkActionBase
+ })(Actions.Action);
+ Actions.DeepLinkActionBase = DeepLinkActionBase;
+ (function(VideoDeepLinksActions) {
+ var NavigateAction = (function(_super) {
+ __extends(NavigateAction, _super);
+ function NavigateAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.videoDeepLinkLocation
+ }
+ NavigateAction.prototype._executeNavigateAction = function(actionId, params) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var action = actionService.getAction(actionId);
+ action.parameter = params;
+ if (!action.automationId)
+ action.automationId = MS.Entertainment.UI.AutomationIds.deepLink;
+ action.execute()
+ };
+ NavigateAction.prototype.executed = function(params) {
+ var _this = this;
+ switch (params.id) {
+ case MS.Entertainment.UI.Monikers.homeHub:
+ var winJSNavigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ winJSNavigation.navigateToDefault();
+ break;
+ case MS.Entertainment.UI.Monikers.movieMarketplaceFeatured:
+ this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.featuredMoviesMarketplaceNavigate, params);
+ break;
+ case MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases:
+ this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.newMoviesMarketplaceNavigate, params);
+ break;
+ case MS.Entertainment.UI.Monikers.movieMarketplaceTopPurchased:
+ this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.topMoviesMarketplaceNavigate, params);
+ break;
+ case MS.Entertainment.UI.Monikers.tvMarketplaceNewReleases:
+ this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.newTvMarketplaceNavigate, params);
+ break;
+ case MS.Entertainment.UI.Monikers.tvMarketplaceFeatured:
+ this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.featuredTvMarketplaceNavigate, params);
+ break;
+ case MS.Entertainment.UI.Monikers.tvMarketplaceLastNight:
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var lastNightOnTvEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvLastNightQuery);
+ if (lastNightOnTvEnabled)
+ this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.lastNightTvMarketplaceNavigate, params);
+ break;
+ case MS.Entertainment.UI.Monikers.tvMarketplaceTopPurchased:
+ this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.topTvMarketplaceNavigate, params);
+ break;
+ default:
+ var stageThreeCompleted = new MS.Entertainment.UI.Framework.Signal;
+ var uiState = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiState.stageThreeActivated)
+ stageThreeCompleted.complete(true);
+ else {
+ var handlers = MS.Entertainment.UI.Framework.addEventHandlers(uiState, {stageThreeActivatedChanged: function() {
+ if (!uiState.stageThreeActivated)
+ return;
+ handlers.cancel();
+ stageThreeCompleted.complete(true)
+ }});
+ var winJSNavigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ winJSNavigation.navigateToDefault()
+ }
+ stageThreeCompleted.promise.done(function() {
+ _this._executeNavigateAction(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkLocation, params)
+ });
+ break
+ }
+ };
+ return NavigateAction
+ })(Actions.Action);
+ VideoDeepLinksActions.NavigateAction = NavigateAction;
+ var DetailsAction = (function(_super) {
+ __extends(DetailsAction, _super);
+ function DetailsAction() {
+ _super.apply(this, arguments);
+ this.automationId = MS.Entertainment.UI.AutomationIds.videoDeepLinkDetails
+ }
+ DetailsAction.prototype._showVideoDetails = function(mediaItem, params) {
+ var _this = this;
+ if (!mediaItem)
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_showVideoDetails: invalid media item specified."));
+ var autoPlay = params.autoPlay;
+ var startPaused = params.startPaused;
+ var autoPlayPreview = params.autoPlayPreview && !!mediaItem.videoPreviewUrl;
+ if (autoPlayPreview)
+ mediaItem.playPreviewOnly = true;
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var isMovie = MS.Entertainment.Utilities.isMovie(mediaItem);
+ var isSeries = MS.Entertainment.Utilities.isTVSeries(mediaItem);
+ var isSeason = MS.Entertainment.Utilities.isTVSeason(mediaItem);
+ var isEpisode = MS.Entertainment.Utilities.isTVEpisode(mediaItem);
+ var canPlay = false;
+ var getVideoToPlayPromise;
+ if ((autoPlay || autoPlayPreview || startPaused) && (!isSeries || configurationManager.video.videoPlaySeasonDeepLinkEnabled))
+ if (isSeries || isSeason) {
+ var hydrateSeries = WinJS.Promise.wrap();
+ var series = isSeries ? mediaItem : null;
+ var season = isSeason ? mediaItem : null;
+ if (isSeason) {
+ series = MS.Entertainment.Utilities.convertMediaItemToTvSeries(mediaItem);
+ hydrateSeries = series.hydrate()
+ }
+ getVideoToPlayPromise = hydrateSeries.then(function() {
+ var episodeProgressionHelper = new MS.Entertainment.Components.Video.EpisodeProgressionHelper(series);
+ return episodeProgressionHelper.findNextEpisode(season)
+ }).then(function(results) {
+ if (!season || WinJS.Utilities.getMember("episode.seasonNumber", results) === season.seasonNumber) {
+ var playMedia = results.episode;
+ canPlay = playMedia && playMedia.inCollection;
+ return playMedia
+ }
+ else if (season)
+ return _this._getFreePlayPromise(season, true).then(function(succeeded) {
+ canPlay = false;
+ return null
+ });
+ else {
+ canPlay = false;
+ return null
+ }
+ })
+ }
+ else if (isMovie || isEpisode) {
+ getVideoToPlayPromise = WinJS.Promise.as(mediaItem);
+ canPlay = mediaItem.inCollection || autoPlayPreview
+ }
+ return WinJS.Promise.as(getVideoToPlayPromise).then(function(video) {
+ if (!video)
+ return mediaItem;
+ if (video && (video.inCollection || autoPlayPreview))
+ return video;
+ return _this._getFreePlayPromise(video, false).then(function(succeeded) {
+ canPlay = false;
+ return video
+ })
+ }).then(function(video) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var navigateAction = actionService.getAction(Actions.ActionIdentifiers.navigateToVideoDetails);
+ navigateAction.parameter = {data: video};
+ var navigatePromise = navigateAction.execute();
+ if (canPlay && video)
+ MS.Entertainment.Platform.PlaybackHelpers.playMedia2(video, {
+ autoPlay: autoPlay && !startPaused, playPreviewOnly: autoPlayPreview, startPositionMsec: params.startPositionMsec, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.deepLink
+ });
+ return navigatePromise
+ })
+ };
+ DetailsAction.prototype._executeUnknownMediaTypeDetails = function(params) {
+ var _this = this;
+ Trace.assert(params.id, "DeepLinkDetailsAction::_executeUnknownMediaTypeDetails: params.id is undefined.");
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus);
+ var idType = params.idType || MS.Entertainment.Data.Query.edsIdType.canonical;
+ return MS.Entertainment.Utilities.getMediaByServiceId(params.id, idType).then(function(mediaItem) {
+ if (!mediaItem)
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeUnknownMediaTypeDetails: getMediaByServiceId returned an invalid media item. "));
+ return mediaItem.hydrate()
+ }).then(function(mediaItem) {
+ if (mediaItem.isValid)
+ return _this._showVideoDetails(mediaItem, params);
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeUnknownMediaTypeDetails: hydrate returned and invalid media item."))
+ })
+ };
+ DetailsAction.prototype._executeVideoDetails = function(params) {
+ var _this = this;
+ if (!params)
+ WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: params is null."));
+ return this._getSignInPromise().then(function() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var isMoviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var isTvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ var isVideoMarketplaceNetworkEnabled = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus).isEnabled(1);
+ var isMovieDeeplink = params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.movie.toLocaleLowerCase();
+ var isTvDeeplink = params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.tvSeries.toLocaleLowerCase() || params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.tvSeason.toLocaleLowerCase() || params.desiredMediaItemType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsMediaType.tvEpisode.toLocaleLowerCase();
+ Trace.assert(params.desiredMediaItemType && (isMovieDeeplink || isTvDeeplink), "DeepLinkDetailsAction::_executeVideoDetails: Unknown desiredMediaItemType.");
+ if (isMovieDeeplink && !isMoviesMarketplaceEnabled)
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: Movies marketplace is not enabled. Cannot execute to movie deeplink."));
+ if (isTvDeeplink && !isTvMarketplaceEnabled)
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: TV marketplace is not enabled. Cannot execute to tv deeplink."));
+ if (!isVideoMarketplaceNetworkEnabled)
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: Video marketplace network is not enabled. Cannot execute to video details deeplink."));
+ Trace.assert(params.id, "DeepLinkDetailsAction::_executeVideoDetails: paramss.id not defined");
+ var useCanonicalId = true;
+ if (params.idType) {
+ var idType = params.idType.toLocaleLowerCase();
+ if (idType === MS.Entertainment.Data.Query.edsIdType.canonical.toLocaleLowerCase())
+ useCanonicalId = true;
+ else if (idType.toLocaleLowerCase() === MS.Entertainment.Data.Query.edsIdType.zuneCatalog.toLocaleLowerCase())
+ useCanonicalId = false;
+ else
+ Trace.fail("DeepLinkDetailsAction::_executeVideoDetails: Unknown media ID type.")
+ }
+ if (params.id) {
+ var mediaItem;
+ var augmenter;
+ var isValid;
+ if (useCanonicalId)
+ mediaItem = {ID: params.id};
+ else
+ mediaItem = {ZuneId: params.id};
+ mediaItem.location = MS.Entertainment.Data.ItemLocation.marketplace;
+ switch (params.desiredMediaItemType.toLocaleLowerCase()) {
+ case MS.Entertainment.Data.Query.edsMediaType.movie.toLocaleLowerCase():
+ augmenter = Entertainment.Data.Augmenter.Marketplace.EdsMovie;
+ isValid = MS.Entertainment.Utilities.isMovie;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeries.toLocaleLowerCase():
+ augmenter = Entertainment.Data.Augmenter.Marketplace.EdsTVSeries;
+ isValid = MS.Entertainment.Utilities.isTVSeries;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvSeason.toLocaleLowerCase():
+ augmenter = Entertainment.Data.Augmenter.Marketplace.EdsTVSeason;
+ isValid = MS.Entertainment.Utilities.isTVSeason;
+ break;
+ case MS.Entertainment.Data.Query.edsMediaType.tvEpisode.toLocaleLowerCase():
+ augmenter = Entertainment.Data.Augmenter.Marketplace.EdsTVEpisode;
+ isValid = MS.Entertainment.Utilities.isTVEpisode;
+ break;
+ default:
+ Trace.fail("DeepLinkDetailsAction::_executeVideoDetails: Unknown desired media type.");
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: Unknown desired media type."));
+ break
+ }
+ return _this._processMediaItemDeepLink(mediaItem, augmenter, isValid, params)
+ }
+ else
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: Invalid id. Cannot execute to video details deeplink."))
+ })
+ };
+ DetailsAction.prototype._processMediaItemDeepLink = function(item, augmenter, isValid, params) {
+ var _this = this;
+ if (!item || !augmenter || !isValid)
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: Function is missing required parameters."));
+ var navigationPromise;
+ var mediaItem = MS.Entertainment.Data.augment(item, augmenter);
+ if (mediaItem && isValid(mediaItem))
+ navigationPromise = mediaItem.hydrate().then(function() {
+ if (mediaItem.hasServiceId && mediaItem.isValid) {
+ if (params.autoPlay || params.startPaused)
+ return _this._prepareMediaItemForPlayback(mediaItem);
+ return mediaItem
+ }
+ return WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: Invalid mediaItem object. Cannot execute details deeplink. Service ID " + params.id))
+ }).then(function() {
+ return _this._showVideoDetails(mediaItem, params)
+ });
+ else
+ navigationPromise = WinJS.Promise.wrapError(new Error("DeepLinkDetailsAction::_executeVideoDetails: Invalid mediaItem object. Cannot execute details deeplink. Service ID " + params.id));
+ return navigationPromise
+ };
+ DetailsAction.prototype._getOfferIds = function(mediaItem) {
+ var offerIds = [];
+ var defaultClientTypeFromApp = MS.Entertainment.Utilities.defaultClientTypeFromApp;
+ var rights = MS.Entertainment.ViewModels.SmartBuyStateHandlers.getMatchingRights(mediaItem, defaultClientTypeFromApp, [MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.SeasonPurchase, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.SeasonPurchaseStream, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Purchase, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.PurchaseStream, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent, MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream]);
+ if (rights)
+ for (var i = 0; i < rights.length; ++i) {
+ var currentRight = rights[i];
+ if (currentRight && offerIds.indexOf(currentRight.offerId) === -1) {
+ Trace.assert(currentRight.offerId, "DeepLinkDetailsAction::_getOfferIds: Invalid offerId: " + currentRight.offerId);
+ offerIds.push(currentRight.offerId)
+ }
+ }
+ return offerIds
+ };
+ DetailsAction.prototype._prepareMediaItemForPlayback = function(mediaItem) {
+ var offerIds = this._getOfferIds(mediaItem);
+ return MS.Entertainment.UI.PurchaseHistoryService.refreshVideoOffersAsync(offerIds).then(function() {
+ return MS.Entertainment.ViewModels.MediaItemModel.hydrateLibraryInfoAsync(mediaItem)
+ }).then(null, function(error) {
+ if (WinJS.Promise.isCanceledError(error))
+ return WinJS.Promise.wrapError(error)
+ })
+ };
+ DetailsAction.prototype._getFreePlayPromise = function(media, isSeason) {
+ var freePlayPromise = WinJS.Promise.as(false);
+ var bestFreeRight = isSeason ? MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getBestFreeSeasonRight(media) : MS.Entertainment.ViewModels.VideoSmartBuyStateEngine.getBestFreeRight(media, false);
+ if (bestFreeRight) {
+ var offerId = bestFreeRight.offerId;
+ var currencyCode = bestFreeRight.priceCurrencyCode;
+ var purchaseType = MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_BUY;
+ if (bestFreeRight.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.Rent || bestFreeRight.licenseRight === MS.Entertainment.ViewModels.SmartBuyStateHandlers.MarketplaceRight.RentStream)
+ purchaseType = MS.Entertainment.Platform.PurchaseHelpers.PURCHASE_TYPE_RENT;
+ freePlayPromise = MS.Entertainment.Platform.PurchaseHelpers.freePurchaseFlow(media, offerId, currencyCode, purchaseType, true, bestFreeRight.signedOffer, bestFreeRight, MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.deepLink).then(function() {
+ return true
+ }, function() {
+ return false
+ })
+ }
+ return freePlayPromise
+ };
+ DetailsAction.prototype._getSignInPromise = function() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ return signIn.getSignInPromise()
+ };
+ DetailsAction.prototype.executed = function(params) {
+ var _this = this;
+ if (!params) {
+ Trace.assert(params, "DeepLinkDetailsAction: params not defined");
+ return
+ }
+ this._loadScriptsForVideoDeepLinkActions().then(function() {
+ return params.desiredMediaItemType ? _this._executeVideoDetails(params) : _this._executeUnknownMediaTypeDetails(params)
+ }).done(null, function(error) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ var navigateToDefaultPromise = navigationService.navigateToDefault();
+ if (!error || !error.doNotShowErrorDialog)
+ WinJS.Promise.join([MS.Entertainment.UI.Framework.loadTemplate("/Controls/MessageBox.html", "messageBoxTemplate", true), navigateToDefaultPromise]).done(function() {
+ MS.Entertainment.UI.Shell.showMessageBox(String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE), String.load(String.id.IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC), {dismissOnNavigateDelay: 30000})
+ }, function(error) {
+ return Actions.fail("Failed to load MessageBox loadTemplate for deeplink action: " + error && error.message)
+ })
+ })
+ };
+ return DetailsAction
+ })(DeepLinkActionBase);
+ VideoDeepLinksActions.DetailsAction = DetailsAction;
+ var deepLinkConfigureVideoQualitySelector = (function(_super) {
+ __extends(deepLinkConfigureVideoQualitySelector, _super);
+ function deepLinkConfigureVideoQualitySelector() {
+ _super.apply(this, arguments)
+ }
+ deepLinkConfigureVideoQualitySelector.prototype.executed = function(params) {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ configurationManager.playback.enableVideoQualitySelector = params.enable;
+ if (!params.enable && MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.sessionManager)) {
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ if (sessionMgr && sessionMgr.nowPlayingSession) {
+ if (sessionMgr.nowPlayingSession.enableVideoNetstats)
+ sessionMgr.nowPlayingSession.enableVideoNetstats = false;
+ if (sessionMgr.nowPlayingSession.currentMedia)
+ sessionMgr.nowPlayingSession.selectVideoBitrate(null)
+ }
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.winJSNavigation)) {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ if (!navigationService.currentPage)
+ navigationService.navigateToDefault()
+ }
+ };
+ return deepLinkConfigureVideoQualitySelector
+ })(Actions.Action);
+ VideoDeepLinksActions.deepLinkConfigureVideoQualitySelector = deepLinkConfigureVideoQualitySelector
+ })(Actions.VideoDeepLinksActions || (Actions.VideoDeepLinksActions = {}));
+ var VideoDeepLinksActions = Actions.VideoDeepLinksActions;
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.deepLinkConfigureVideoQualitySelector, function() {
+ return new MS.Entertainment.UI.Actions.VideoDeepLinksActions.deepLinkConfigureVideoQualitySelector
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.videoDeepLinkLocation, function() {
+ return new MS.Entertainment.UI.Actions.VideoDeepLinksActions.NavigateAction
+ });
+ actionService.register(MS.Entertainment.UI.Actions.ActionIdentifiers.videoDeepLinkDetails, function() {
+ return new MS.Entertainment.UI.Actions.VideoDeepLinksActions.DetailsAction
+ })
+ })(UI.Actions || (UI.Actions = {}));
+ var Actions = UI.Actions
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/framework/shortcutmanager.js:29720 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ ShortcutCategory: {keyboardShortcut: "keyboardShortcut"}, ShortcutManager: MS.Entertainment.UI.Framework.define(null, {
+ _registeredHandlers: [], _registeredShortcuts: [], blockKeyboardShortcuts: false, registerShortcutCategoryHandler: function registerShortcutCategoryHandler(shortcutCategory, handler) {
+ if (MS.Entertainment.Framework.ShortcutCategory.hasOwnProperty(shortcutCategory)) {
+ var registered = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (registered === -1)
+ if (handler && handler.registerShortcut && handler.unregisterShortcut)
+ this._registeredHandlers.push({
+ shortcutCategory: shortcutCategory, handler: handler
+ });
+ else
+ MS.Entertainment.Framework.assert(false, "Shortcut Handler does not meet contract");
+ else
+ MS.Entertainment.Framework.assert(false, "Already registered Handler for " + shortcutCategory)
+ }
+ else
+ MS.Entertainment.Framework.assert(false, "Unrecognized shortcut category " + shortcutCategory)
+ }, unregisterShortcutCategoryHandler: function unregisterShortcutCategoryHandler(shortcutCategory) {
+ var removed;
+ var index = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (index > -1)
+ removed = this._registeredHandlers.splice(index, 1);
+ if (removed && removed[0] && removed[0].handler && removed[0].handler.dispose)
+ removed[0].handler.dispose()
+ }, registerShortcut: function registerShortcut(shortcutCategory, shortcut, action) {
+ if (MS.Entertainment.Framework.ShortcutCategory.hasOwnProperty(shortcutCategory)) {
+ var index = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (index > -1)
+ this._registeredHandlers[index].handler.registerShortcut(shortcut, action);
+ else
+ MS.Entertainment.Framework.assert(false, "No registered Handler for " + shortcutCategory)
+ }
+ else
+ MS.Entertainment.Framework.assert(false, "Unrecognized shortcut category " + shortcutCategory)
+ }, unregisterShortcut: function unregisterShortcut(shortcutCategory, shortcut) {
+ var handlerIndex = this._getCategoryRegistrationIndex(shortcutCategory);
+ if (index > -1)
+ var success = this._registeredHandlers[index].handler.unregisterShortcut(shortcut)
+ }, _getCategoryRegistrationIndex: function _getCategoryRegistrationIndex(shortcutCategory) {
+ var index = -1;
+ for (var i = 0; i < this._registeredHandlers.length; i++)
+ if (this._registeredHandlers[i].shortcutCategory === shortcutCategory) {
+ index = i;
+ break
+ }
+ return index
+ }
+ }, null)
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.shortcutManager, function ShortcutManagerFactory() {
+ return new MS.Entertainment.Framework.ShortcutManager
+ })
+})()
+})();
+/* >>>>>>/framework/keyboardshortcuthandler.js:29781 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+
+ MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.Framework");
+ WinJS.Namespace.define("MS.Entertainment.Framework", {
+ KeyboardShortcutModifiers: {
+ ctrl: "ctrl", alt: "alt", shift: "shift"
+ }, KeyboardShortcutHandler: MS.Entertainment.UI.Framework.define(function KeyboardShortcutHandler() {
+ this._keyModifiers = MS.Entertainment.Framework.KeyboardShortcutModifiers
+ }, {
+ initialize: function initialize() {
+ if (this._documentEvents) {
+ this._documentEvents.cancel();
+ this._documentEvents = null
+ }
+ var documentEvents;
+ if (MS.Entertainment.Utilities.isApp2)
+ documentEvents = {keyup: this._handleKey.bind(this)};
+ else
+ documentEvents = {keydown: this._handleKey.bind(this)};
+ this._documentEvents = MS.Entertainment.Utilities.addEventHandlers(document, documentEvents, false)
+ }, _handleKey: function _handleKey(event) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var shortcutManagerService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shortcutManager);
+ var flyoutFocused = WinJS.UI.AutomaticFocus && WinJS.UI.AutomaticFocus.focusRoot && WinJS.Utilities.hasClass(WinJS.UI.AutomaticFocus.focusRoot, "win-flyout");
+ var overlayVisible = flyoutFocused || uiStateService.overlayVisible;
+ var globalButtonPressed = MS.Entertainment.Utilities.isApp2 && (event.keyCode === WinJS.Utilities.Key.invokeGlobalCommand || event.keyCode === WinJS.Utilities.Key.ltButton || event.keyCode === WinJS.Utilities.Key.rtButton || (event.altKey && event.keyCode === WinJS.Utilities.Key.enter));
+ var allowDismissButton = !overlayVisible || WinJS.Utilities.getMember("MS.Entertainment.UI.Framework.currentOverlayContainer.winControl.allowBackNavigate");
+ var dismissButtonPressed = event.keyCode === WinJS.Utilities.Key.dismissButton && allowDismissButton;
+ if (!dismissButtonPressed && shortcutManagerService.blockKeyboardShortcuts)
+ return;
+ if (overlayVisible && !globalButtonPressed && !dismissButtonPressed)
+ return;
+ var keys = {};
+ if (event.shiftKey)
+ keys.shift = true;
+ if (event.ctrlKey)
+ keys.ctrl = true;
+ if (event.altKey)
+ keys.alt = true;
+ if (event.keyCode)
+ keys.key = event.keyCode;
+ var index = this._checkShortcutRegistration(keys);
+ if (index > -1) {
+ var shortcut = this._registeredShortcuts[index];
+ if (!((MS.Entertainment.Utilities.doesElementSupportKeyboardInput(event.target) || event.target.isContentEditable) && !shortcut.shortcut.allowInEditControls))
+ shortcut.action.execute()
+ }
+ }, _registeredShortcuts: [], _keyModifiers: null, _windowEvents: null, _documentEvents: null, dispose: function dispose() {
+ if (this._windowEvents) {
+ this._windowEvents.cancel();
+ this._windowEvents = null
+ }
+ if (this._documentEvents) {
+ this._documentEvents.cancel();
+ this._documentEvents = null
+ }
+ }, registerShortcut: function registerShortcut(shortcut, action) {
+ if (shortcut && shortcut.key && action) {
+ var registered = this._checkShortcutRegistration(shortcut);
+ if (registered === -1)
+ this._registeredShortcuts.push({
+ shortcut: shortcut, action: action
+ });
+ else
+ Trace.fail("Shortcut already registered " + shortcut.key)
+ }
+ else {
+ Trace.assert(shortcut, "Invalid shortcut, shortcut variable is falsy");
+ Trace.assert(action, "Invalid shortcut, action variable is falsy")
+ }
+ }, unregisterShortcut: function unregisterShortcut(shortcut) {
+ var index = this._checkShortcutRegistration(shortcut);
+ if (index > -1)
+ this._registeredShortcuts.splice(index, 1)
+ }, _checkShortcutRegistration: function _checkShortcutRegistration(shortcut) {
+ var index = -1;
+ var registeredShortcut = null;
+ for (var i = 0; i < this._registeredShortcuts.length; i++) {
+ registeredShortcut = this._registeredShortcuts[i].shortcut;
+ if ((registeredShortcut.alt === shortcut.alt) && (registeredShortcut.ctrl === shortcut.ctrl) && (registeredShortcut.shift === shortcut.shift) && (registeredShortcut.key === shortcut.key)) {
+ index = i;
+ break
+ }
+ }
+ return index
+ }
+ }, {
+ _instance: null, instance: {get: function() {
+ if (!MS.Entertainment.Framework.KeyboardShortcutHandler._instance)
+ MS.Entertainment.Framework.KeyboardShortcutHandler._instance = new MS.Entertainment.Framework.KeyboardShortcutHandler;
+ return MS.Entertainment.Framework.KeyboardShortcutHandler._instance
+ }}
+ })
+ });
+ var shortcutManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shortcutManager);
+ shortcutManager.registerShortcutCategoryHandler(MS.Entertainment.Framework.ShortcutCategory.keyboardShortcut, MS.Entertainment.Framework.KeyboardShortcutHandler.instance)
+})()
+})();
+/* >>>>>>/framework/networkstatusservice.js:29883 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ var NetworkStatusService = (function(_super) {
+ __extends(NetworkStatusService, _super);
+ function NetworkStatusService() {
+ _super.call(this);
+ this._approachingDataLimit = false;
+ this._networkStatusChangedBinding = null;
+ this._overLimit = false;
+ this._uiStateService = null;
+ this._offlineDelayPromise = null;
+ this._offlineDelayTimerInMS = 5000;
+ this._networkedFeatureStatusTable = null;
+ this._lastNotificationId = "-1";
+ this._uiStateService = Entertainment.ServiceLocator.getService(Entertainment.Services.uiState);
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (configurationManager.shell.retailExperience || configurationManager.shell.mockNetworkStatusOffline)
+ this._uiStateService.networkStatus = 5;
+ else
+ this._startListening();
+ this._initializeNetworkedFeaturesTable()
+ }
+ Object.defineProperty(NetworkStatusService.prototype, "approachingDataLimit", {
+ get: function() {
+ return this._approachingDataLimit
+ }, set: function(value) {
+ this.updateAndNotify("approachingDataLimit", value)
+ }, enumerable: true, configurable: true
+ });
+ NetworkStatusService.isOnline = function() {
+ var isOnline = true;
+ switch (Entertainment.ServiceLocator.getService(Entertainment.Services.uiState).networkStatus) {
+ case null:
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ isOnline = true;
+ break;
+ case 4:
+ case 5:
+ isOnline = false;
+ break;
+ default:
+ UI.fail("Current network state is not a valid MS.Entertainment.UI.NetworkStatusService.NetworkStatus value.")
+ }
+ return isOnline
+ };
+ NetworkStatusService.prototype.isEnabled = function(feature) {
+ Entertainment.Utilities.validateIsMemberOrThrow(feature, NetworkStatusService.NetworkedFeature);
+ var networkStatus = !this._uiStateService.networkStatus ? 5 : this._uiStateService.networkStatus;
+ var featureStatusArray = this._networkedFeatureStatusTable[feature];
+ UI.assert(featureStatusArray, "Unknown feature");
+ UI.assert(featureStatusArray[networkStatus] !== undefined, "Unknown network status for this feature");
+ return featureStatusArray ? featureStatusArray[networkStatus] : false
+ };
+ NetworkStatusService.prototype.dispose = function() {
+ if (this._networkStatusChangedBinding) {
+ this._networkStatusChangedBinding.cancel();
+ this._networkStatusChangedBinding = null
+ }
+ };
+ NetworkStatusService.prototype._initializeNetworkedFeaturesTable = function() {
+ this._networkedFeatureStatusTable = {};
+ var musicMarketplace = {};
+ musicMarketplace[0] = true;
+ musicMarketplace[1] = true;
+ musicMarketplace[2] = true;
+ musicMarketplace[3] = false;
+ musicMarketplace[4] = false;
+ musicMarketplace[5] = false;
+ this._networkedFeatureStatusTable[0] = musicMarketplace;
+ var videoMarketplace = {};
+ videoMarketplace[0] = true;
+ videoMarketplace[1] = true;
+ videoMarketplace[2] = true;
+ videoMarketplace[3] = false;
+ videoMarketplace[4] = false;
+ videoMarketplace[5] = false;
+ this._networkedFeatureStatusTable[1] = videoMarketplace
+ };
+ NetworkStatusService.prototype._startListening = function() {
+ var _this = this;
+ this._networkStatusChangedBinding = Entertainment.Utilities.addEventHandlers(Windows.Networking.Connectivity.NetworkInformation, {networkstatuschanged: function() {
+ return _this._onNetworkStatusChanged()
+ }});
+ this._updateNetworkStatus(true)
+ };
+ NetworkStatusService.prototype._onNetworkStatusChanged = function() {
+ this._updateNetworkStatus(false)
+ };
+ NetworkStatusService.prototype._updateNetworkStatus = function(immediateStatusUpdate) {
+ var _this = this;
+ if (Entertainment.Utilities.isApp2) {
+ this._uiStateService.networkStatus = 1;
+ return
+ }
+ if (this._offlineDelayPromise) {
+ this._offlineDelayPromise.cancel();
+ this._offlineDelayPromise = null
+ }
+ var internetProfile = null;
+ try {
+ internetProfile = Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile()
+ }
+ catch(e) {
+ UI.fail("Exception accessing: NetworkInformation.getInternetConnectionProfile: " + e.toString())
+ }
+ if (!internetProfile) {
+ if (immediateStatusUpdate)
+ this._uiStateService.networkStatus = 5;
+ else
+ this._offlineDelayPromise = WinJS.Promise.timeout(this._offlineDelayTimerInMS).then(function() {
+ return _this._uiStateService.networkStatus = 5
+ });
+ return
+ }
+ var stringId = String.empty;
+ var raiseNotification = false;
+ var isCritical = false;
+ try {
+ switch (internetProfile.getNetworkConnectivityLevel()) {
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.none:
+ this._uiStateService.networkStatus = 5;
+ break;
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.localAccess:
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.constrainedInternetAccess:
+ this._uiStateService.networkStatus = 4;
+ stringId = String.id.IDS_NETWORK_STATUS_LOCAL_ONLY;
+ raiseNotification = false;
+ break;
+ case Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess:
+ var connectionCost = internetProfile.getConnectionCost();
+ try {
+ this.approachingDataLimit = connectionCost.approachingDataLimit;
+ switch (connectionCost.networkCostType) {
+ case Windows.Networking.Connectivity.NetworkCostType.unknown:
+ case Windows.Networking.Connectivity.NetworkCostType.unrestricted:
+ this._uiStateService.networkStatus = 1;
+ break;
+ case Windows.Networking.Connectivity.NetworkCostType.fixed:
+ case Windows.Networking.Connectivity.NetworkCostType.variable:
+ if (connectionCost.overDataLimit) {
+ this._uiStateService.networkStatus = 3;
+ stringId = String.id.IDS_NETWORK_STATUS_OVER_THE_LIMIT;
+ raiseNotification = true;
+ isCritical = true
+ }
+ else if (connectionCost.roaming) {
+ this._uiStateService.networkStatus = 3;
+ stringId = String.id.IDS_NETWORK_STATUS_ROAMING;
+ raiseNotification = true;
+ isCritical = true
+ }
+ else {
+ this._uiStateService.networkStatus = 2;
+ stringId = String.id.IDS_NETWORK_STATUS_THROTTLED;
+ raiseNotification = true
+ }
+ break;
+ default:
+ UI.assert(false, "Unknown ConnectivityLevel");
+ this._uiStateService.networkStatus = 0;
+ stringId = String.empty;
+ break
+ }
+ }
+ catch(e) {
+ UI.fail("Exception accessing: networkCostType: " + e.toString());
+ this._uiStateService.networkStatus = 0;
+ stringId = String.empty
+ }
+ break;
+ default:
+ this._uiStateService.networkStatus = 0;
+ stringId = String.empty;
+ break
+ }
+ }
+ catch(e) {
+ UI.fail("Exception accessing: Windows.Networking.Connectivity.NetworkConnectivityLevel: " + e.toString());
+ this._uiStateService.networkStatus = 5
+ }
+ if (this._uiStateService.networkStatus)
+ this._sendTelemetry(this._uiStateService.networkStatus);
+ if (raiseNotification)
+ this._sendNotification(stringId, isCritical);
+ else
+ this._lastNotificationId = stringId
+ };
+ NetworkStatusService.prototype._sendTelemetry = function(status) {
+ var telemetryParameterArray = [{
+ parameterName: Entertainment.Utilities.Telemetry.TelemetryParameterNames.NetworkStatus, parameterValue: NetworkStatusService.NetworkStatus[status]
+ }];
+ Entertainment.Utilities.Telemetry.logTelemetryEventWithParameterArray(Entertainment.Utilities.Telemetry.TelemetryEvents.NetworkService, telemetryParameterArray)
+ };
+ NetworkStatusService.prototype._sendNotification = function(stringId, isCritical) {
+ if (stringId === this._lastNotificationId)
+ return;
+ var appNotificationService = Entertainment.ServiceLocator.getService(Entertainment.Services.appNotification);
+ appNotificationService.removeNotificationByCategory(NetworkStatusService._notificationCategory);
+ this._lastNotificationId = stringId;
+ appNotificationService.send(new UI.Notification({
+ notificationType: isCritical ? UI.Notification.Type.Critical : UI.Notification.Type.Informational, title: String.load(String.id.IDS_NETWORK_STATUS_HEADER), subTitle: String.load(stringId), moreDetails: null, icon: UI.Icon.inlineStreaming, action: null, category: NetworkStatusService._notificationCategory, isPersistent: !!isCritical
+ }))
+ };
+ NetworkStatusService._notificationCategory = "networkStatus";
+ return NetworkStatusService
+ })(UI.Framework.ObservableBase);
+ UI.NetworkStatusService = NetworkStatusService;
+ (function(NetworkStatusService) {
+ (function(NetworkStatus) {
+ NetworkStatus[NetworkStatus["unknown"] = 0] = "unknown";
+ NetworkStatus[NetworkStatus["unrestricted"] = 1] = "unrestricted";
+ NetworkStatus[NetworkStatus["throttled"] = 2] = "throttled";
+ NetworkStatus[NetworkStatus["onDemand"] = 3] = "onDemand";
+ NetworkStatus[NetworkStatus["localOnly"] = 4] = "localOnly";
+ NetworkStatus[NetworkStatus["none"] = 5] = "none"
+ })(NetworkStatusService.NetworkStatus || (NetworkStatusService.NetworkStatus = {}));
+ var NetworkStatus = NetworkStatusService.NetworkStatus;
+ (function(NetworkedFeature) {
+ NetworkedFeature[NetworkedFeature["musicMarketplace"] = 0] = "musicMarketplace";
+ NetworkedFeature[NetworkedFeature["videoMarketplace"] = 1] = "videoMarketplace"
+ })(NetworkStatusService.NetworkedFeature || (NetworkStatusService.NetworkedFeature = {}));
+ var NetworkedFeature = NetworkStatusService.NetworkedFeature
+ })(UI.NetworkStatusService || (UI.NetworkStatusService = {}));
+ var NetworkStatusService = UI.NetworkStatusService;
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.networkStatus, function() {
+ return new NetworkStatusService
+ })
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/components/search/typetosearchservice.js:30134 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {TypeToSearchService: MS.Entertainment.UI.Framework.define(function() {
+ this._handleFocusIn = this._handleFocusIn.bind(this)
+ }, {
+ _isEnabledForApp: {get: function() {
+ var result = false;
+ if (MS.Entertainment.Utilities.isVideoApp1 || (MS.Entertainment.Utilities.isMusicApp1))
+ result = true;
+ return result
+ }}, typeToSearchPropertyName: "showOnKeyboardInput", getTypeToSearchHost: function getTypeToSearchHost() {
+ var host = MS.Entertainment.ViewModels.SearchContractViewModel.getForCurrentView();
+ if (!host)
+ host = {};
+ return host
+ }, shouldEnableTypeToSearchForElement: function shouldEnableTypeToSearchForElement(element) {
+ return MS.Entertainment.Utilities.doesElementSupportKeyboardInput(element)
+ }, _isListeningForFocus: false, _disabledCount: 0, _listenForFocus: function _listenForFocus() {
+ if (this._isListeningForFocus)
+ return;
+ this._isListeningForFocus = true;
+ document.body.addEventListener("focusin", this._handleFocusIn)
+ }, _stopListeningForFocus: function _stopListeningForFocus() {
+ if (!this._isListeningForFocus)
+ return;
+ document.body.removeEventListener("focusin", this._handleFocusIn);
+ this._isListeningForFocus = false
+ }, _handleFocusIn: function _handleFocusIn() {
+ if (this.shouldEnableTypeToSearchForElement(document.activeElement))
+ this._suspendTypeToSearch();
+ else
+ this._resumeTypeToSearch()
+ }, _suspendTypeToSearch: function _suspendTypeToSearch() {
+ this.getTypeToSearchHost()[this.typeToSearchPropertyName] = false;
+ window.msWriteProfilerMark("ent:TypeToSearch:Suspended")
+ }, _resumeTypeToSearch: function _resumeTypeToSearch() {
+ this.getTypeToSearchHost()[this.typeToSearchPropertyName] = true;
+ window.msWriteProfilerMark("ent:TypeToSearch:Resume")
+ }, disableTypeToSearch: function disableTypeToSearch() {
+ if (!this._isEnabledForApp)
+ return;
+ this._stopListeningForFocus();
+ this._suspendTypeToSearch();
+ this._disabledCount++;
+ window.msWriteProfilerMark("ent:TypeToSearch:Disabled")
+ }, enableTypeToSearch: function enableTypeToSearch() {
+ if (!this._isEnabledForApp)
+ return;
+ if (this._disabledCount > 0) {
+ this._disabledCount--;
+ if (this._disabledCount > 0)
+ return
+ }
+ this._resumeTypeToSearch();
+ window.msWriteProfilerMark("ent:TypeToSearch:Enabled");
+ this._listenForFocus()
+ }
+ })});
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.typeToSearch, function createTypeToSearchService() {
+ return new MS.Entertainment.UI.TypeToSearchService
+ })
+})()
+})();
+/* >>>>>>/components/shell/appnotification.js:30200 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+
+MS.Entertainment.UI.Debug.defineAssert("MS.Entertainment.UI");
+(function() {
+ "use strict";
+ WinJS.Namespace.define("MS.Entertainment.UI", {
+ Notification: WinJS.Class.define(function notificationConstructor(options) {
+ var property;
+ for (property in options)
+ this[property] = options[property]
+ }, {
+ notificationType: null, title: "", subTitle: "", subTitleCaret: false, moreDetails: "", icon: null, dismissIcon: MS.Entertainment.UI.Icon.close, category: null, isPersistent: false, iconClassName: "", acknowledged: false, visible: true, attachedNotification: null, dismissOnSignOut: false, hideDefaultRing: false, automationId: null, _action: null, _actionParams: null, _actions: null, _actionParamsArray: null, _actionArray: null, _dismissAction: null, _dismissActionObject: null, _dismissActionParams: null, action: {
+ get: function get_action() {
+ return this._action
+ }, set: function set_action(value) {
+ if (this._action !== value) {
+ this._action = value;
+ this._actionArray = null
+ }
+ }
+ }, actions: {
+ get: function get_actions() {
+ return this._actions
+ }, set: function set_actions(value) {
+ if (this._actions !== value) {
+ this._actions = value;
+ this._actionArray = null
+ }
+ }
+ }, actionParams: {
+ get: function get_actionParams() {
+ return this._actionParams
+ }, set: function set_actionParams(value) {
+ this._actionParams = value;
+ if (this._actionArray && this._actionArray.item(0))
+ this._actionArray.item(0) = value
+ }
+ }, actionParamsArray: {
+ get: function get_actionParamsArray() {
+ return this._actionParamsArray
+ }, set: function set_actionParamsArray(value) {
+ this._actionParamsArray = value;
+ if (this._actionArray && this._actionParamsArray)
+ for (var i = 0; i < this._actionParamsArray.length; i++)
+ if (this._actionParamsArray[i])
+ WinJS.UI.setOptions(this._actionArray.item(i), this._actionParamsArray[i])
+ }
+ }, bindableActionArray: {get: function get_bindableActionArray() {
+ return this.actionArray && this.actionArray.bindableItems
+ }}, actionArray: {
+ get: function get_actionArray() {
+ if (this._actionArray)
+ return this._actionArray;
+ var actions = null;
+ if (this._actions)
+ actions = this._actions;
+ else
+ actions = this._convertToArray(this._action);
+ this._actionArray = new MS.Entertainment.ObservableArray;
+ for (var i = 0; i < actions.length; i++)
+ if (actions[i] && typeof actions[i] === "string") {
+ this._actionArray.push(MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(actions[i]));
+ if (this._actionArray.item(i))
+ if (this._actionParamsArray && this._actionParamsArray[i])
+ WinJS.UI.setOptions(this._actionArray.item(i), this._actionParamsArray[i]);
+ else if (this._actionParams)
+ WinJS.UI.setOptions(this._actionArray.item(i), this._actionParams)
+ }
+ return this._actionArray
+ }, set: function set_actionArray(value) {
+ this._actionArray = value
+ }
+ }, dismissAction: {
+ get: function get_action() {
+ return this._dismissAction
+ }, set: function set_action(value) {
+ if (this._dismissAction !== value) {
+ this._dismissAction = value;
+ this._dismissActionObject = null
+ }
+ }
+ }, dismissActionParams: {
+ get: function get_dismissActionParamss() {
+ return this._dismissActionParams
+ }, set: function set_dismissActionParams(value) {
+ this._dismissActionParams = value;
+ if (this._dismissActionObject)
+ this._dismissActionObject.parameter = value
+ }
+ }, dismissActionObject: {get: function get_dismissActionObject() {
+ if (!this._dismissActionObject && this.dismissAction)
+ this._dismissActionObject = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(this.dismissAction);
+ if (this._dismissActionObject)
+ this._dismissActionObject.parameter = this.dismissActionParams;
+ return this._dismissActionObject
+ }}, toJSON: function toJSON() {
+ var resultObject = {};
+ for (var key in this)
+ if (key && key[0] !== "_" && key !== "toJSON" && key !== "actionArray" && key !== "bindableActionArray" && key !== "dismissActionObject")
+ resultObject[key] = this[key];
+ return resultObject
+ }, _convertToArray: function _convertToArray(item) {
+ var array = [];
+ if (!Array.isArray(item) && item)
+ array = [item];
+ return array
+ }
+ }, {Type: {
+ Informational: "Informational", Critical: "Critical"
+ }}), AppNotificationService: MS.Entertainment.defineObservable(function AppNotificationServiceConstructor() {
+ MS.Entertainment.UI.AppNotificationService._instanceCount++;
+ MS.Entertainment.Utilities.assert(MS.Entertainment.UI.AppNotificationService._instanceCount === 1, "Use MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification)");
+ this.infoNotifications = new MS.Entertainment.ObservableArray;
+ this.criticalNotifications = new MS.Entertainment.ObservableArray;
+ this._dismissOnSignOutCategories = [];
+ var waitPromise = WinJS.Promise.as();
+ if (!MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn))
+ waitPromise = WinJS.Promise.timeout(4000);
+ waitPromise.then(function() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.signIn))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn).bind("isSignedIn", this._onSignInChange.bind(this))
+ }.bind(this))
+ }, {
+ _dismissOnSignOutCategories: null, infoNotifications: null, _infoNotificationContainer: null, criticalNotifications: null, _criticalNotificationContainer: null, _filterNotification: function _filterNotification(notification) {
+ return MS.Entertainment.Utilities.isApp2 && (notification.notificationType === MS.Entertainment.UI.Notification.Type.Informational)
+ }, send: function send(notification) {
+ if (!notification || this._filterNotification(notification))
+ return;
+ if (!notification.isPersistent)
+ MS.Entertainment.UI.assert(notification.notificationType === MS.Entertainment.UI.Notification.Type.Informational, "Non-persistent notifications must be informational only");
+ if (!notification.category) {
+ MS.Entertainment.UI.assert(!notification.isPersistent, "Expected a category on persistent notifications.");
+ MS.Entertainment.UI.assert(!notification.dismissOnSignOut, "Expected a category on dismiss-on-signout notifications.")
+ }
+ else if (notification.dismissOnSignOut && this._dismissOnSignOutCategories.indexOf(notification.category) < 0)
+ this._dismissOnSignOutCategories.push(notification.category);
+ notification = WinJS.Binding.as(notification);
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceNotification_NotificationArrived(notification.title);
+ switch (notification.notificationType) {
+ case MS.Entertainment.UI.Notification.Type.Informational:
+ var existingIndex = this._indexOfNotification(this.infoNotifications, notification.category);
+ if (existingIndex >= 0)
+ if (!notification.isPersistent) {
+ this.infoNotifications.splice(existingIndex, 1);
+ this.infoNotifications.push(notification)
+ }
+ else {
+ this.infoNotifications.item(existingIndex).title = notification.title;
+ this.infoNotifications.item(existingIndex).subTitle = notification.subTitle
+ }
+ else
+ this.infoNotifications.push(notification);
+ break;
+ case MS.Entertainment.UI.Notification.Type.Critical:
+ var existingIndex = this._indexOfNotification(this.criticalNotifications, notification.category);
+ if (existingIndex < 0)
+ this.criticalNotifications.push(notification);
+ break
+ }
+ }, removeNotificationByCategory: function removeNotificationByCategory(category) {
+ var index = this._indexOfNotification(this.criticalNotifications, category);
+ if (index >= 0)
+ this.criticalNotifications.splice(index, 1);
+ index = this._indexOfNotification(this.infoNotifications, category);
+ if (index >= 0)
+ this.infoNotifications.splice(index, 1)
+ }, _indexOfNotification: function _indexOfNotification(queue, category) {
+ if (category)
+ for (var index = 0; index < queue.length; index++) {
+ var notification = queue.item(index);
+ if (notification.category === category)
+ return index
+ }
+ return -1
+ }, _onSignInChange: function _onSignInChange(isSignedIn) {
+ if (!isSignedIn) {
+ for (var i = 0; i < this._dismissOnSignOutCategories.length; i++)
+ this.removeNotificationByCategory(this._dismissOnSignOutCategories[i]);
+ this._dismissOnSignOutCategories = []
+ }
+ }
+ }, {
+ factory: function factory() {
+ var appNotificationService = new MS.Entertainment.UI.AppNotificationService;
+ Object.defineProperty(appNotificationService, "infoNotificationContainer", {get: function() {
+ if (!this._infoNotificationContainer)
+ this._infoNotificationContainer = document.querySelector(".infoNotificationContainer");
+ return this._infoNotificationContainer
+ }});
+ Object.defineProperty(appNotificationService, "criticalNotificationContainer", {get: function() {
+ if (!this._criticalNotificationContainer)
+ this._criticalNotificationContainer = document.querySelector(".criticalNotificationContainer");
+ return this._criticalNotificationContainer
+ }});
+ return appNotificationService
+ }, _instanceCount: 0
+ })
+ });
+ MS.Entertainment.ServiceLocator.register(MS.Entertainment.Services.appNotification, MS.Entertainment.UI.AppNotificationService.factory);
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {InfoNotification: MS.Entertainment.UI.Framework.defineUserControl("/Components/Shell/appNotification.html#infoNotificationTemplate", function infoNotification(element, options){}, {
+ _appNotificationService: null, _navigation: null, _timer: null, _notificationItemTemplate: null, _uiSettings: new Windows.UI.ViewManagement.UISettings, _initialized: false, _selfEventHandlers: null, _webUIApplicationEventHandlers: null, _navigationBindings: null, itemTemplate: "/Components/Shell/appNotification.html#infoNotificationItemTemplate", notificationDataSourcePropertyName: "infoNotifications", initialize: function initialize(){}, delayedInitialize: function delayedInitialize() {
+ return MS.Entertainment.UI.Framework.loadTemplate(this.itemTemplate).then(function(templateProvider) {
+ this._notificationItemTemplate = templateProvider.element;
+ this._appNotificationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification);
+ this._onPropertyChange = this._onPropertyChange.bind(this);
+ this._onDataSourceChanged = this._onDataSourceChanged.bind(this);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.navigation)) {
+ this._navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._navigationBindings = WinJS.Binding.bind(this._navigation, {currentPage: this._onPropertyChange})
+ }
+ this._selfEventHandlers = MS.Entertainment.Utilities.addEventHandlers(this.domElement, {keydown: this.onKeyDown.bind(this)});
+ this.notificationContainer.itemTemplate = this._notificationItemTemplate;
+ this._appNotificationService[this.notificationDataSourcePropertyName].addChangeListener(this._onDataSourceChanged);
+ this._initialized = true;
+ this.notificationContainer.dataSource = this._appNotificationService[this.notificationDataSourcePropertyName]
+ }.bind(this))
+ }, onKeyDown: function onKeyDown(event) {
+ if (event.keyCode === WinJS.Utilities.Key.enter || event.keyCode === WinJS.Utilities.Key.space)
+ this.onItemClick(event)
+ }, _playTransitionAnimation: function _playTransitionAnimation(element) {
+ var incomingPageMove = {
+ left: "60px", top: "0px"
+ };
+ element.style.left = "0px";
+ element.style.top = "0px";
+ element.style.opacity = 0.0;
+ return WinJS.UI.Animation.enterContent(element, [incomingPageMove], {mechanism: "transition"})
+ }, _onTimerHandler: function _onTimerHandler() {
+ if (this._appNotificationService[this.notificationDataSourcePropertyName].length === 1) {
+ var item = this._appNotificationService.infoNotifications.item(0);
+ if (item.isPersistent) {
+ this._resetTimer();
+ return
+ }
+ }
+ var elements = this.notificationContainer.domElement.querySelectorAll(".win-template");
+ var currentElement = elements[0];
+ var nextElement = elements[1];
+ if (currentElement)
+ WinJS.UI.Animation.fadeOut(currentElement).done(function() {
+ var item = this._appNotificationService.infoNotifications.shift();
+ if (item && item.isPersistent)
+ this._appNotificationService[this.notificationDataSourcePropertyName].push(item);
+ if (nextElement)
+ this._playTransitionAnimation(nextElement)
+ }.bind(this));
+ if (this._appNotificationService.infoNotifications.length > 0)
+ this._resetTimer();
+ else {
+ window.clearTimeout(this._timer);
+ this._timer = null
+ }
+ }, _resetTimer: function _restartTimer() {
+ window.clearTimeout(this._timer);
+ var notificationTimeoutMs = this._uiSettings.messageDuration * 1000;
+ this._timer = window.setTimeout(function() {
+ this._onTimerHandler()
+ }.bind(this), notificationTimeoutMs)
+ }, _shouldHideNotifications: function _shouldHideNotifications() {
+ var notificationVisibility = ((this._appNotificationService[this.notificationDataSourcePropertyName].length > 0) && this._initialized);
+ if (this._navigation && this._navigation.currentPage)
+ notificationVisibility = notificationVisibility && this._navigation.currentPage.showNotifications;
+ return !notificationVisibility
+ }, _onDataSourceChanged: function _onDataSourceChanged() {
+ this.hideNotifications = this._shouldHideNotifications();
+ if (!this.hideNotifications)
+ if (this.notificationDataSourcePropertyName === "infoNotifications")
+ if (!this._timer)
+ this._resetTimer();
+ this._updateLiveRegionContainer()
+ }, _updateLiveRegionContainer: function _updateLiveRegionContainer() {
+ WinJS.Promise.timeout(300).then(function() {
+ var items = this.notificationContainer.domElement.querySelectorAll(".notificationContent");
+ if (items && items[0] && this._liveRegionContainer && this._buttonContainer) {
+ this._buttonContainer.removeChild(this._liveRegionContainer);
+ this._liveRegionContainer = document.createElement("div");
+ WinJS.Utilities.addClass(this._liveRegionContainer, "removeFromDisplay");
+ this._liveRegionContainer.setAttribute("role", "tooltip");
+ this._liveRegionContainer.setAttribute("aria-live", "polite");
+ this._buttonContainer.appendChild(this._liveRegionContainer);
+ this._liveRegionContainer.setAttribute("aria-label", items[0].textContent)
+ }
+ }.bind(this))
+ }, unload: function unload() {
+ if (this._selfEventHandlers) {
+ this._selfEventHandlers.cancel();
+ this._selfEventHandlers = null
+ }
+ if (this._appNotificationService && this._appNotificationService.infoNotifications)
+ this._appNotificationService.infoNotifications.removeChangeListener(this._onDataSourceChanged);
+ MS.Entertainment.UI.Framework.UserControl.prototype.unload.call(this)
+ }, onItemClick: function onItemClick(event) {
+ if (this._appNotificationService.infoNotifications.length <= 0)
+ return;
+ var currentItem = this._appNotificationService.infoNotifications.item(0);
+ if (currentItem && currentItem.action) {
+ if (currentItem.action.execute)
+ currentItem.action.execute();
+ else if (typeof currentItem.action === "function")
+ currentItem.action();
+ return
+ }
+ }, _onPropertyChange: function _onPropertyChange() {
+ if (this._appNotificationService[this.notificationDataSourcePropertyName]) {
+ var dataSource = this._appNotificationService[this.notificationDataSourcePropertyName];
+ if (dataSource !== this.notificationContainer.dataSource)
+ this.notificationContainer.dataSource = this._appNotificationService[this.notificationDataSourcePropertyName]
+ }
+ this.hideNotifications = this._shouldHideNotifications();
+ if (!this.hideNotifications)
+ if (this.notificationDataSourcePropertyName === "infoNotifications")
+ if (!this._timer)
+ this._resetTimer()
+ }
+ }, {hideNotifications: true})});
+ WinJS.Namespace.define("MS.Entertainment.UI.Controls", {CriticalNotification: MS.Entertainment.UI.Framework.deriveUserControl("MS.Entertainment.UI.Controls.InfoNotification", "/Components/Shell/appNotification.html#criticalNotificationTemplate", function criticalNotification(element, options){}, {
+ itemTemplate: "/Components/Shell/appNotification.html#criticalNotificationItemTemplate", notificationDataSourcePropertyName: "criticalNotifications", _criticalSelfEventHandlers: null, initialize: function initialize() {
+ MS.Entertainment.UI.Controls.InfoNotification.prototype.initialize.call(this)
+ }, unload: function unload() {
+ MS.Entertainment.UI.Controls.InfoNotification.prototype.unload.call(this);
+ if (this._criticalSelfEventHandlers) {
+ this.this._criticalSelfEventHandlers.cancel();
+ this.this._criticalSelfEventHandlers = null
+ }
+ }, onItemClick: function onItemClick(event) {
+ var currentItem = this._appNotificationService.criticalNotifications.item(0);
+ var item = this._appNotificationService.criticalNotifications.shift();
+ if (item && item.action) {
+ item.action();
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceNotification_NotificationClicked(item.title)
+ }
+ }
+ })})
+})()
+})();
+/* >>>>>>/controls/video_win/devicelimiterror.js:30537 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Video) {
+ var DeviceLimitErrorDialog = (function(_super) {
+ __extends(DeviceLimitErrorDialog, _super);
+ function DeviceLimitErrorDialog(element, options) {
+ this.templateStorage = "/Controls/Video_Win/DeviceLimitError.html";
+ this.templateName = "deviceLimitErrorDialog";
+ this._actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ _super.call(this, element, options)
+ }
+ DeviceLimitErrorDialog.prototype.initialize = function(){};
+ DeviceLimitErrorDialog.prototype.showDevicesClicked = function(e) {
+ if (e && e.keyCode && !(e.keyCode === WinJS.Utilities.Key.enter || e.keyCode === WinJS.Utilities.Key.space))
+ return;
+ var externalNavigationAction = this._actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = "http://go.microsoft.com/fwlink/?LinkId=614900&ref=videosetting";
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.deviceDomainShowDevices;
+ externalNavigationAction.execute()
+ };
+ DeviceLimitErrorDialog._handleFileTransferNotification = function(notification) {
+ if (notification.transferType !== MS.Entertainment.UI.FileTransferType.download)
+ return;
+ var taskStatus = notification.task.taskStatus;
+ var shouldUnregister = (taskStatus === Microsoft.Entertainment.FileTransferStatus.error || taskStatus === Microsoft.Entertainment.FileTransferStatus.canceled || taskStatus === Microsoft.Entertainment.FileTransferStatus.completed);
+ if (shouldUnregister) {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.unregisterListener(MS.Entertainment.UI.Video.DeviceLimitErrorDialog._deviceLimitNotificationListenerId)
+ }
+ if (taskStatus === Microsoft.Entertainment.FileTransferStatus.error && notification.task.responseCode === MS.Entertainment.UI.Video.DeviceLimitErrorDialog.DEVICEGROUP_MAX_DEVICES_REACHED)
+ MS.Entertainment.UI.Video.DeviceLimitErrorDialog.showDeviceLimitErrorDialog()
+ };
+ DeviceLimitErrorDialog.listenForDownloadNotification = function() {
+ var fileTransferService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.fileTransfer);
+ fileTransferService.registerListener(MS.Entertainment.UI.Video.DeviceLimitErrorDialog._deviceLimitNotificationListenerId, MS.Entertainment.Framework.DownloadInfo.getMarketplaceDownloadTaskKeyFunction(Microsoft.Entertainment.Queries.ObjectType.video), null, {
+ add: MS.Entertainment.UI.Video.DeviceLimitErrorDialog._handleFileTransferNotification, pending: MS.Entertainment.UI.Video.DeviceLimitErrorDialog._handleFileTransferNotification, update: MS.Entertainment.UI.Video.DeviceLimitErrorDialog._handleFileTransferNotification, complete: MS.Entertainment.UI.Video.DeviceLimitErrorDialog._handleFileTransferNotification, error: MS.Entertainment.UI.Video.DeviceLimitErrorDialog._handleFileTransferNotification, cancel: MS.Entertainment.UI.Video.DeviceLimitErrorDialog._handleFileTransferNotification
+ }, this)
+ };
+ DeviceLimitErrorDialog.showDeviceLimitErrorDialog = function() {
+ if (MS.Entertainment.UI.Video.DeviceLimitErrorDialog._isDialogOpen)
+ return WinJS.Promise.wrap();
+ MS.Entertainment.UI.Video.DeviceLimitErrorDialog._isDialogOpen = true;
+ var controlOptions = {
+ defaultButtonIndex: -1, cancelButtonIndex: 1, persistOnNavigate: true, buttons: [WinJS.Binding.as({
+ title: String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_HELP_LINK), execute: function(d) {
+ var externalNavigationAction = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions).getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.externalNavigate);
+ externalNavigationAction.parameter = "http://go.microsoft.com/fwlink/?LinkId=532939";
+ externalNavigationAction.automationId = MS.Entertainment.UI.AutomationIds.deviceDomainHelpPage;
+ externalNavigationAction.execute();
+ MS.Entertainment.UI.Video.DeviceLimitErrorDialog._isDialogOpen = false;
+ d.hide()
+ }
+ }), WinJS.Binding.as({
+ title: String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_CLOSE_BUTTON), execute: function(d) {
+ MS.Entertainment.UI.Video.DeviceLimitErrorDialog._isDialogOpen = false;
+ d.hide()
+ }
+ })]
+ };
+ return MS.Entertainment.UI.Shell.showDialog(String.load(String.id.IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_HEADER), "MS.Entertainment.UI.Video.DeviceLimitErrorDialog", controlOptions).done(null, function(error) {
+ MS.Entertainment.fail("Error showing Device Limit Error Dialog: " + (error && error.message))
+ })
+ };
+ DeviceLimitErrorDialog.DEVICEGROUP_MAX_DEVICES_REACHED = 0xC3380262;
+ DeviceLimitErrorDialog._deviceLimitNotificationListenerId = "DeviceLimitDialogListener_" + MS.Entertainment.Utilities.getSessionUniqueInteger();
+ return DeviceLimitErrorDialog
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Video.DeviceLimitErrorDialog = DeviceLimitErrorDialog;
+ WinJS.Utilities.markSupportedForProcessing(DeviceLimitErrorDialog)
+ })(UI.Video || (UI.Video = {}));
+ var Video = UI.Video
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/coreapplication.js:30629 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Shell) {
+ var fx = MS.Entertainment.UI.Framework;
+ var utils = MS.Entertainment.Utilities;
+ var lightDismissLimit = 1024;
+ var stateCollapsedClass = "state-collapsed";
+ var stateExpandedClass = "state-expanded";
+ var collapsedNavBarWidth = 90;
+ var CoreApplication = (function(_super) {
+ __extends(CoreApplication, _super);
+ function CoreApplication() {
+ _super.apply(this, arguments);
+ this.clearLastActivatedEventArgsAfterHandling = true;
+ this._activated = false;
+ this._isPrelaunched = false;
+ this._navPaneToggleState = false;
+ this._wasRecentlyResumed = false;
+ this._snappedWatcher = null;
+ this._windowShrinksMediaMatch = null;
+ this.delayInitializationComplete = false;
+ this.setStageThreeCompletedOnFirstPage = true;
+ this.skipNotificationInitialization = false;
+ this._clearQueryAfterSearch = true;
+ this.hideMenuAriaLabelStringId = String.id.IDS_NAV_PANE_HIDE_MENU;
+ this.showMenuAriaLabelStringId = String.id.IDS_NAV_PANE_SHOW_MENU;
+ this.loadAppBar = true;
+ this.updateBranding = true;
+ this.snappedModeMaxWidthPx = 479
+ }
+ Object.defineProperty(CoreApplication.prototype, "marketPlaceEnabled", {
+ get: function() {
+ return false
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "defaultPivotIndex", {
+ get: function() {
+ return 0
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "minAppSupportedVersion", {
+ get: function() {
+ MS.Entertainment.UI.Actions.fail("minAppSupportedVersion() should be overrided by subclass");
+ return "1.0.0.0"
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "minServiceSupportedVersion", {
+ get: function() {
+ MS.Entertainment.UI.Actions.fail("minServiceSupportedVersion() should be overrided by subclass");
+ return "1.0.0.0"
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.afterAppReady = function(){};
+ CoreApplication.prototype.afterProcessAllCompleted = function(){};
+ CoreApplication.prototype.afterAppBarReady = function(){};
+ CoreApplication.prototype.beforeUICreation = function(){};
+ CoreApplication.prototype.getAppTitle = function() {
+ MS.Entertainment.UI.Actions.fail("getAppTitle() should be overrided by subclass");
+ return String.empty
+ };
+ CoreApplication.prototype.getAppPivots = function() {
+ MS.Entertainment.UI.Actions.fail("getAppPivots() should be overrided by subclass");
+ return []
+ };
+ CoreApplication.prototype.onNavPaneFirstTimeRender = function(){};
+ CoreApplication.prototype.onPrimaryPivotsSelectionChange = function(newPivot){};
+ CoreApplication.prototype.beforeProtocolProcessPromise = function(deepLink) {
+ return null
+ };
+ CoreApplication.prototype.afterProtocolProcessed = function(deepLink, requiredDependencies){};
+ CoreApplication.prototype.beforeAppActivation = function(){};
+ CoreApplication.prototype.beforeAppActivationHandling = function(){};
+ CoreApplication.prototype.beforeSearchActivation = function(){};
+ CoreApplication.prototype.handleFileActivation = function(isFirstRun, args) {
+ return false
+ };
+ Object.defineProperty(CoreApplication.prototype, "isNavPaneAnimating", {
+ get: function() {
+ return !!this._animatingNavBarPromise
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.afterSnappedSet = function(isSnapped){};
+ CoreApplication.prototype.beforeDelayInitializeCompletes = function(){};
+ CoreApplication.prototype.afterAppResume = function(){};
+ CoreApplication.prototype.afterAppSuspends = function(e){};
+ CoreApplication.prototype.getDeeplinkUri = function(args) {
+ var deeplinkUri = args.uri;
+ if (!deeplinkUri && args.arguments)
+ try {
+ deeplinkUri = new Windows.Foundation.Uri(this.appProtocolName + "://" + args.arguments)
+ }
+ catch(e) {
+ MS.Entertainment.fail("Failed to create a URI from an argument: " + (e && e.message));
+ return null
+ }
+ return deeplinkUri
+ };
+ CoreApplication.prototype.getStartedFromParamForProtocolActivation = function(args) {
+ var deeplinkUri = args.uri;
+ var startedFrom;
+ if (!deeplinkUri && args.arguments) {
+ var tile = args.tileId;
+ if (tile)
+ startedFrom = "Pin";
+ else
+ startedFrom = "Tile"
+ }
+ else
+ startedFrom = "Deeplink";
+ return startedFrom
+ };
+ Object.defineProperty(CoreApplication.prototype, "configurationManager", {
+ get: function() {
+ if (!this._configurationManager)
+ this._configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return this._configurationManager
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.getSavedNavigationMonikerData = function() {
+ return this.configurationManager.shell.lastUsedAppNavigationMonikerData
+ };
+ CoreApplication.prototype.setSavedNavigationMonikerData = function(value) {
+ this.configurationManager.shell.lastUsedAppNavigationMonikerData = value
+ };
+ CoreApplication.prototype.saveCurrentNavigationMonikerData = function() {
+ var monikerData = this.navigation.currentMonikerData;
+ if (monikerData)
+ this.setSavedNavigationMonikerData(monikerData.toString())
+ };
+ CoreApplication.prototype.clearNavigationMonikerData = function() {
+ this.setSavedNavigationMonikerData(String.empty)
+ };
+ CoreApplication.prototype.navigateToInitialPage = function() {
+ var savedMonikerData = this.getSavedNavigationMonikerData();
+ var validMonikerData = false;
+ if (savedMonikerData)
+ this.getAppPivots().forEach(function(item, index) {
+ if (item.moniker === savedMonikerData)
+ validMonikerData = true
+ });
+ if (validMonikerData) {
+ this.navigation.navigateToMoniker(savedMonikerData);
+ this.clearNavigationMonikerData()
+ }
+ else
+ this._navigateToDefault()
+ };
+ Object.defineProperty(CoreApplication.prototype, "applicationLifetimeManager", {
+ get: function() {
+ if (!this._applicationLifetimeManager)
+ this._applicationLifetimeManager = new Microsoft.Entertainment.ApplicationLifetimeManager;
+ return this._applicationLifetimeManager
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "commonTraceProvider", {
+ get: function() {
+ if (!this._commonTraceProvider)
+ this._commonTraceProvider = new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Common;
+ return this._commonTraceProvider
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(CoreApplication.prototype, "telemetryManager", {
+ get: function() {
+ if (!this._telemetryManager)
+ this._telemetryManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager);
+ return this._telemetryManager
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype.initialize = function() {
+ var _this = this;
+ WinJS.strictProcessing();
+ WinJS.Binding.optimizeBindingReferences = true;
+ MS.Entertainment.Utilities.updateHtmlDirectionAttribute();
+ fx.enableAutoControlCleanup();
+ WinJS.Application.onerror = MS.Entertainment.UI.Debug.unhandledPromiseErrorHandler;
+ var webUI = Windows.UI.WebUI.WebUIApplication;
+ this._webUIEvents,
+ fx.addEventHandlers(webUI, {
+ activated: this.activated.bind(this), suspending: this.suspending.bind(this), resuming: this.resuming.bind(this)
+ });
+ this._windowEvents = fx.addEventHandlers(window, {unload: this.unload.bind(this)});
+ this._documentEvents = fx.addEventHandlers(document, {
+ visibilitychange: this.visibilityChanged.bind(this), dragstart: function(e) {
+ if (e.target.tagName === "IMG")
+ e.preventDefault()
+ }
+ });
+ MS.Entertainment.Utilities.systemAppListenersAttached = true;
+ this.beforeUICreation();
+ this.startupBindingProcessed = new MS.Entertainment.UI.Framework.Signal;
+ window.msWriteProfilerMark("ent:Startup.ControlsProcessedAndDataBound,StartTM");
+ MS.Entertainment.Utilities.processAllOnDocumentLoaded(document.body, this).done(function() {
+ window.msWriteProfilerMark("ent:Startup.ControlsProcessedAndDataBound,StopTM");
+ _this.afterProcessAllCompleted();
+ if (_this.updateBranding)
+ _this._updateBranding();
+ _this.initializeControlEventHandlers();
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ MS.Entertainment.UI.Framework.flags.attachCookieToRemovedDomElements = configurationManager.shell.attachCookieToRemovedDomElements;
+ MS.Entertainment.UI.Framework.flags.attachLargeObjectToUnloadedControl = configurationManager.shell.attachLargeObjectToUnloadedControl;
+ _this.startupBindingProcessed.complete()
+ })
+ };
+ CoreApplication.prototype._updateBranding = function() {
+ var titleElement = document.querySelector("[data-ent-member=_appTitleLabel]");
+ var navPaneHeader = document.querySelector("[data-ent-member=_navPaneHeader]");
+ if (!(titleElement && navPaneHeader)) {
+ MS.Entertainment.fail("Unable to get branding elements. Something very bad is happening");
+ return
+ }
+ if (!this.marketPlaceEnabled)
+ WinJS.Utilities.addClass(navPaneHeader, "navpane-noMarketplace");
+ titleElement.textContent = this.getAppTitle()
+ };
+ CoreApplication.prototype._loadDelayedInitFragment = function(critical) {
+ var delayedStartupContainer = document.getElementById("delayedStartupContainer");
+ if (!this._delayedInitFragmentPromise) {
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ this._delayedInitFragmentPromise = signal.promise;
+ msWriteProfilerMark("ent:loadDelayedInitFragment,StartTM");
+ var loadDelayedInitFragment = function() {
+ msWriteProfilerMark("ent:loadDelayedInitFragment,StopTM");
+ MS.Entertainment.Utilities.loadHtmlPage("/delayedStageThreeStartup.html", delayedStartupContainer).then(function() {
+ signal.complete()
+ })
+ };
+ if (!critical)
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function() {
+ loadDelayedInitFragment()
+ });
+ else
+ loadDelayedInitFragment()
+ }
+ return this._delayedInitFragmentPromise
+ };
+ CoreApplication.prototype.delayInitializeApplication = function() {
+ var _this = this;
+ if (!this._delayedInitPromise)
+ this._delayedInitPromise = this._loadDelayedInitFragment().then(function() {
+ _this._delayInitializeWork()
+ });
+ return this._delayedInitPromise
+ };
+ CoreApplication.prototype.activated = function(args, wasPreviouslyPrelaunched) {
+ var _this = this;
+ this.lastActivatedEventArgs = utils.cloneActivationArguments(args);
+ var kind;
+ var isFirstRun = !this._activated;
+ try {
+ kind = args.kind
+ }
+ catch(e) {
+ var error = e && e.detail && e.detail.error;
+ var description = e && e.detail && e.detail.exception.toString();
+ MS.Entertainment.fail("Exception while trying to determine the activation kind. Error exception was:" + description + "." + "\n Error was:" + error);
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ var startTime;
+ if (!wasPreviouslyPrelaunched && args.prelaunchActivated) {
+ this._handlePrelaunch();
+ return
+ }
+ if (args.arguments === MS.Entertainment.Utilities.retailExperienceArgument)
+ MS.Entertainment.Utilities.setRetailExperienceState(true);
+ if (window.sessionStorage["NewAppNavigated"] !== "true" && !wasPreviouslyPrelaunched)
+ this.applicationLifetimeManager.raiseActivated(args);
+ if (this._activated)
+ this.telemetryManager.appActivated();
+ if (!this._activated) {
+ MS.Entertainment.Framework.KeyboardInteractionListener.init();
+ WinJS.Application.start();
+ this.commonTraceProvider.traceProcessInitializeEventStart();
+ startTime = new Date;
+ this._app = new Microsoft.Entertainment.Application.Application;
+ this._app.init(Microsoft.Entertainment.Application.ExecMode.foreground);
+ this.beforeAppActivation();
+ this._appInitDuration = (new Date).valueOf() - startTime.valueOf();
+ this._activated = true;
+ var deferSplashScreen;
+ if (args.activatedOperation)
+ deferSplashScreen = args.activatedOperation.getDeferral();
+ this._contentContainerEvents = MS.Entertainment.UI.Framework.addEventHandlers(this.navigation.contentContainer, {ContentComplete: this._waitForFirstPageCompleted.bind(this)});
+ this.startupBindingProcessed.promise.done(function() {
+ if (deferSplashScreen)
+ deferSplashScreen.complete()
+ })
+ }
+ this.beforeAppActivationHandling();
+ var dataPoint = new Microsoft.Entertainment.Platform.Logging.DataPoint(Microsoft.Entertainment.Platform.Logging.LoggingLevel.telemetry, Microsoft.Entertainment.Platform.Logging.TelemetryAuthMethod.unauthenticated);
+ dataPoint.appendEventName("X8Run");
+ dataPoint.appendParameter("ClientResolution", window.screen.width + "x" + window.screen.height);
+ if (kind === Windows.ApplicationModel.Activation.ActivationKind.launch && !args.url && args.arguments)
+ kind = Windows.ApplicationModel.Activation.ActivationKind.protocol;
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function() {
+ _this._handleVersionChecks()
+ });
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState).activationKind = kind;
+ switch (kind) {
+ case Windows.ApplicationModel.Activation.ActivationKind.launch:
+ dataPoint.appendParameter("StartedFrom", "launch");
+ this.navigateToInitialPage();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunch();
+ var navPane = document.getElementById("navPane");
+ MS.Entertainment.assert(navPane, "Nav-pane div does not exist!");
+ var navPaneRendered = MS.Entertainment.UI.Framework.addEventHandlers(navPane, {firstTimeRendered: function() {
+ _this.onNavPaneFirstTimeRender();
+ navPaneRendered.cancel();
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function() {
+ _this._focusPivots()
+ })
+ }});
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.file:
+ dataPoint.appendParameter("StartedFrom", "File");
+ this._navigateToDefault();
+ if (!this.handleFileActivation(isFirstRun, args))
+ this._loadDelayedInitFragment(true).done(function() {
+ MS.Entertainment.Activation.fileActivationHandler(args, !isFirstRun, true)
+ });
+ if (this.clearLastActivatedEventArgsAfterHandling)
+ this.lastActivatedEventArgs = null;
+ else {
+ this.lastActivatedEventArgs.files = null;
+ this.lastActivatedEventArgs.kind = Windows.ApplicationModel.Activation.ActivationKind.launch
+ }
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.protocol:
+ var deepLink = this.getDeeplinkUri(args);
+ if (!deepLink)
+ return this._navigateToDefault();
+ var startedFrom = this.getStartedFromParamForProtocolActivation(args);
+ dataPoint.appendParameter("StartedFrom", startedFrom);
+ var dependenciesPromise = this.beforeProtocolProcessPromise(deepLink);
+ WinJS.Promise.as(dependenciesPromise).done(function() {
+ if (!MS.Entertainment.UI.DeepLink.processProtocol(deepLink.rawUri, dataPoint, args.arguments)) {
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ _this._navigateToDefault()
+ }
+ else {
+ _this.afterProtocolProcessed(deepLink, !!dependenciesPromise);
+ if (_this.lastActivatedEventArgs) {
+ _this.lastActivatedEventArgs.uri = null;
+ _this.lastActivatedEventArgs.kind = Windows.ApplicationModel.Activation.ActivationKind.launch
+ }
+ }
+ });
+ break;
+ case Windows.ApplicationModel.Activation.ActivationKind.search:
+ this.beforeSearchActivation();
+ this._navigateToSearch(args.queryText, true);
+ if (this._clearQueryAfterSearch) {
+ this.lastActivatedEventArgs.kind = Windows.ApplicationModel.Activation.ActivationKind.launch;
+ this.lastActivatedEventArgs.queryText = null
+ }
+ break;
+ default:
+ this._navigateToDefault();
+ MS.Entertainment.fail("Unexpected Activation kind: " + kind);
+ break
+ }
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function() {
+ dataPoint.write()
+ })
+ };
+ CoreApplication.prototype.isCurrentVersionSupported = function() {
+ var configurationManager = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var currentPackage = Windows.ApplicationModel.Package.current;
+ var currentVersion = currentPackage.id.version;
+ var minVersionSupported = MS.Entertainment.Utilities.parseVersionString(this.minAppSupportedVersion);
+ var minServiceVersionSupported = MS.Entertainment.Utilities.parseVersionString(this.minServiceSupportedVersion);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ var versionSupported = (MS.Entertainment.Utilities.compareVersions(currentVersion, minVersionSupported) >= 0);
+ uiStateService.servicesEnabled = (MS.Entertainment.Utilities.compareVersions(currentVersion, minServiceVersionSupported) >= 0);
+ return versionSupported
+ };
+ CoreApplication.prototype._handleVersionChecks = function() {
+ var versionSupported = this.isCurrentVersionSupported();
+ if (!versionSupported) {
+ WinJS.Promise.timeout().done(function() {
+ window.location.href = "UpdateApp.html"
+ });
+ MS.Entertainment.Instrumentation.PerfTrack.disableAllStartupScenarios();
+ return
+ }
+ };
+ CoreApplication.prototype._waitForFirstPageCompleted = function() {
+ var _this = this;
+ this._cleanupContentContainerEvents();
+ this.telemetryManager.appActivated();
+ this.commonTraceProvider.traceProcessInitializeEventStop(this._appInitDuration);
+ this.delayInitializeApplication();
+ (new Diagnostics.Tracing.Microsoft.Entertainment.Instrumentation.Providers.Shell).traceHubStrip_Ready("dashboard");
+ this._windowShrinksMediaMatch = matchMedia("all and (max-width: 1023px)");
+ var windowShrinksHandlerFunction = this._windowMadeSmaller.bind(this);
+ this._windowShrinksMediaMatch.addListener(windowShrinksHandlerFunction);
+ this._windowShrinksHandler = {cancel: function() {
+ return _this._windowShrinksMediaMatch.removeListener(windowShrinksHandlerFunction)
+ }};
+ this._updateNavPaneToggleAriaLabel();
+ this._initializeSnappedWatcher();
+ var searchBoxElement = document.querySelector(".control-app .searchInputBox");
+ if (searchBoxElement) {
+ var searchBoxControl = searchBoxElement.winControl;
+ if (searchBoxControl)
+ searchBoxControl.searchHistoryDisabled = false
+ }
+ if (this.setStageThreeCompletedOnFirstPage) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.stageThreeActivated = true
+ }
+ this.afterAppReady()
+ };
+ CoreApplication.prototype._getFileTransferNotificationHandler = function() {
+ MS.Entertainment.UI.Actions.fail("_getFileTransfeNotificationHandler() should be overrided by subclass");
+ return null
+ };
+ CoreApplication.prototype._delayInitializeWork = function() {
+ var _this = this;
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.networkStatus);
+ if (MS.Entertainment.FeatureEnablement)
+ MS.Entertainment.FeatureEnablement.initialize();
+ this._initializeAppNotifications().then(function() {
+ return WinJS.Promise.timeout(1000)
+ }).done(function() {
+ var signIn = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.signIn);
+ signIn.signInOnStart()
+ });
+ var appFileTransferNotificationHandler = this._getFileTransferNotificationHandler();
+ if (appFileTransferNotificationHandler)
+ appFileTransferNotificationHandler.startTransferListener();
+ this.beforeDelayInitializeCompletes();
+ MS.Entertainment.Framework.KeyboardInteractionListener.init();
+ MS.Entertainment.Framework.KeyboardShortcutHandler.instance.initialize();
+ MS.Entertainment.UI.Shell.createShellKeyboardShortcuts();
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.shareSender)) {
+ var sender = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.shareSender);
+ sender.setDefaultEmptyMessage()
+ }
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.tileManager))
+ this._tileManager = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.tileManager);
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.typeToSearch))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch).enableTypeToSearch();
+ var delayedStartupContainer = document.getElementById("delayedStartupContainer");
+ var appBarPromise = WinJS.Promise.as();
+ if (this.loadAppBar)
+ appBarPromise = MS.Entertainment.UI.Framework.loadTemplate("/Controls/AppBar/BottomAppBar.html#bottomAppBarTemplate").then(function() {
+ var appBarDiv = document.createElement("div");
+ appBarDiv.setAttribute("data-win-control", "WinJS.UI.AppBar");
+ appBarDiv.setAttribute("data-win-options", JSON.stringify({
+ placement: "bottom", layout: "custom"
+ }));
+ appBarDiv.setAttribute("data-win-automationid", "bottomAppBar");
+ WinJS.Utilities.addClass(appBarDiv, "bottomAppBar");
+ var appBarContent = document.createElement("div");
+ appBarContent.setAttribute("data-ent-id", "BottomAppBar");
+ appBarContent.setAttribute("data-win-control", "MS.Entertainment.UI.Controls.BottomAppBar");
+ appBarDiv.appendChild(appBarContent);
+ document.body.appendChild(appBarDiv);
+ return WinJS.UI.processAll(appBarDiv).then(function() {
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (bottomAppBar)
+ bottomAppBar.deferredInit()
+ })
+ });
+ appBarPromise.done(function() {
+ _this.afterAppBarReady()
+ });
+ if (WinJS.Utilities.getMember("MS.Entertainment.ViewModels.SearchContractViewModel"))
+ MS.Entertainment.ViewModels.SearchContractViewModel.init();
+ this.delayInitializationComplete = true
+ };
+ CoreApplication.prototype._initializeAppNotifications = function() {
+ var infoNotification = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appInfoNotification);
+ var criticalNotification = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appCriticalNotification);
+ if (this.skipNotificationInitialization || !(infoNotification && criticalNotification))
+ return WinJS.Promise.as();
+ return WinJS.Promise.join({
+ info: WinJS.UI.process(infoNotification), critical: WinJS.UI.process(criticalNotification)
+ }).then(function(result) {
+ return WinJS.Promise.join([result.info.delayedInitialize(), result.critical.delayedInitialize()])
+ }).then(function() {
+ if (MS.Entertainment.Utilities.getRetailExperienceState())
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.appNotification).send(new MS.Entertainment.UI.Notification({
+ notificationType: MS.Entertainment.UI.Notification.Type.Informational, title: String.load(String.id.IDS_DEMO_IN_DEMO_MODE), subTitle: "", moreDetails: "", action: null, category: "demo", isPersistent: true
+ }))
+ })
+ };
+ CoreApplication.prototype._cleanupContentContainerEvents = function() {
+ if (!this._contentContainerEvents)
+ return;
+ this._contentContainerEvents.cancel();
+ this._contentContainerEvents = null
+ };
+ CoreApplication.prototype._focusPivots = function() {
+ var navContent = document.querySelector(".app-navpane .navpane-content");
+ MS.Entertainment.UI.Framework.focusFirstInSubTree(navContent)
+ };
+ CoreApplication.prototype._handlePrelaunch = function() {
+ var _this = this;
+ this._isPrelaunched = true;
+ var visibility = fx.addEventHandlers(document, {visibilitychange: function() {
+ if (document.hidden)
+ return;
+ visibility.cancel();
+ MS.Entertainment.Utilities.resetPerfTrackStartTime();
+ _this._isPrelaunched = false;
+ _this.activated(_this.lastActivatedEventArgs, true)
+ }})
+ };
+ CoreApplication.prototype.suspending = function(e) {
+ if (this._isPrelaunched)
+ return;
+ this._cancelPendingBackStackTrim();
+ var startTime = new Date;
+ this.commonTraceProvider.traceProcessSuspendEventStart();
+ this.applicationLifetimeManager.raiseSuspending();
+ this.saveCurrentNavigationMonikerData();
+ this.commonTraceProvider.traceProcessSuspendTelemetryStart();
+ this.telemetryManager.appSuspended();
+ this.commonTraceProvider.traceProcessSuspendTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onSuspending();
+ var duration = (new Date).valueOf() - startTime.valueOf();
+ this.commonTraceProvider.traceProcessSuspendEventStop(duration);
+ this.afterAppSuspends(e)
+ };
+ CoreApplication.prototype.resuming = function() {
+ if (this._isPrelaunched)
+ return;
+ this._cancelPendingBackStackTrim();
+ var startTime = new Date;
+ this.commonTraceProvider.traceProcessResumeEventStart();
+ this.applicationLifetimeManager.raiseResuming();
+ if (this._tileManager)
+ this._tileManager.updateTile();
+ this.commonTraceProvider.traceProcessResumeTelemetryStart();
+ this.telemetryManager.appResumed();
+ this.commonTraceProvider.traceProcessResumeTelemetryStop();
+ MS.Entertainment.Instrumentation.PerfTrack.onResuming();
+ this._wasRecentlyResumed = true;
+ var duration = (new Date).valueOf() - startTime.valueOf();
+ this.commonTraceProvider.traceProcessResumeEventStop(duration);
+ this.afterAppResume()
+ };
+ CoreApplication.prototype.visibilityChanged = function() {
+ if (this._isPrelaunched)
+ return;
+ var isVisible = !document.hidden;
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.isAppVisible = isVisible;
+ this.commonTraceProvider.traceAppVisibilityChanged(isVisible);
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.userTimeTelemetryManager).appVisibilityChanged();
+ if (isVisible) {
+ this._cancelPendingBackStackTrim();
+ this.navigation.thawCurrentPage();
+ WinJS.Utilities.query(".overlayAnchor", document.body).forEach(function(overlay) {
+ fx.thawControlsInSubtree(overlay)
+ });
+ if (this._wasRecentlyResumed) {
+ this._wasRecentlyResumed = false;
+ if (WinJS.Utilities.getMember("Microsoft.PerfTrack.PerfTrackTimePoint.responsive"))
+ MS.Entertainment.Instrumentation.PerfTrack.getLogger().writeResumeStopEvent(Microsoft.PerfTrack.PerfTrackTimePoint.responsive)
+ }
+ }
+ else {
+ this.navigation.freezeCurrentPage();
+ WinJS.Utilities.query(".overlayAnchor", document.body).forEach(function(overlay) {
+ fx.freezeControlsInSubtree(overlay)
+ });
+ this._trimBackStackAfterIdlePeriod()
+ }
+ };
+ CoreApplication.prototype._trimBackStackAfterIdlePeriod = function() {
+ var _this = this;
+ this._cancelPendingBackStackTrim();
+ if (!this.configurationManager.shell.backgroundBackStackTrimmingDelay)
+ return;
+ this._pendingBackStackTrim = WinJS.Promise.timeout(this.configurationManager.shell.backgroundBackStackTrimmingDelay).then(function() {
+ _this.navigation.trimBackStack();
+ _this._pendingBackStackTrim = null
+ }, function(){})
+ };
+ CoreApplication.prototype._cancelPendingBackStackTrim = function() {
+ if (!this._pendingBackStackTrim)
+ return;
+ this._pendingBackStackTrim.cancel();
+ this._pendingBackStackTrim = null
+ };
+ CoreApplication.prototype.unload = function() {
+ if (this._app)
+ this._app.shutdownAsync();
+ if (this._documentEvents) {
+ this._documentEvents.cancel();
+ this._documentEvents = null
+ }
+ if (this._windowEvents) {
+ this._windowEvents.cancel();
+ this._windowEvents = null
+ }
+ if (this._webUIEvents) {
+ this._webUIEvents.cancel();
+ this._webUIEvents = null
+ }
+ if (this._searchBoxEvents) {
+ this._searchBoxEvents.cancel();
+ this._searchBoxEvents = null
+ }
+ if (this._windowShrinksHandler) {
+ this._windowShrinksHandler.cancel();
+ this._windowShrinksHandler = null
+ }
+ if (this._toggleNavMenuEventHandlers) {
+ this._toggleNavMenuEventHandlers.cancel();
+ this._toggleNavMenuEventHandlers = null
+ }
+ if (this._dragEnterEventHandlers) {
+ this._dragEnterEventHandlers.cancel();
+ this._dragEnterEventHandlers = null
+ }
+ this._cleanupLightDismissNavPaneHandlers();
+ this._cleanupContentContainerEvents()
+ };
+ CoreApplication.prototype._handleNavMenuClicked = function() {
+ this._handleNavMenuClickedImpl()
+ };
+ CoreApplication.prototype._handleNavMenuClickedImpl = function(dontAnimate) {
+ var navPane = document.getElementById("navPane");
+ var contentPane = document.getElementById("contentHost");
+ if (!navPane)
+ return;
+ var navPaneExpanding = WinJS.Utilities.hasClass(navPane, stateCollapsedClass);
+ if (MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit)
+ this._toggleLightDismissNavPane(navPane, dontAnimate);
+ else {
+ if (this.isNavPaneAnimating)
+ return;
+ if (navPaneExpanding)
+ window.msWriteProfilerMark("ent:X13App.NavPane.Expanding");
+ else
+ window.msWriteProfilerMark("ent:X13App.NavPane.Collapsing");
+ this._toggleNavPane(navPaneExpanding, navPane, contentPane, dontAnimate)
+ }
+ var contentCatalogIds = MS.Entertainment.Utilities.Telemetry.ContentCatalogId;
+ var contentSourceIds = MS.Entertainment.Utilities.Telemetry.ContentSourceId;
+ var contentTypeIds = MS.Entertainment.Utilities.Telemetry.ContentTypeId;
+ if (this._navPaneToggleButton) {
+ var navButtonId = this._navPaneToggleButton.getAttribute("data-win-automationid");
+ if (navPaneExpanding)
+ navButtonId += ":Expanding";
+ else
+ navButtonId += ":Collapsing";
+ var navigationJournal = MS.Entertainment.UI.Framework.Navigation.getJournal();
+ var navigationLocation = navigationJournal ? navigationJournal.location : String.empty;
+ MS.Entertainment.Utilities.Telemetry.logPageAction({
+ slot: 0, areaName: "NavBarArea1", contentId: navButtonId, contentCatalogId: contentCatalogIds.App, contentSourceId: contentSourceIds.App, contentTypeId: contentTypeIds.App, contentName: navButtonId
+ }, {
+ uri: navigationLocation, pageTypeId: MS.Entertainment.Utilities.Telemetry.PageTypeId.Dash
+ })
+ }
+ };
+ CoreApplication.prototype._toggleNavPane = function(expanding, navPane, contentPane, dontAnimate) {
+ var _this = this;
+ if (contentPane || dontAnimate) {
+ if (contentPane) {
+ WinJS.Utilities.toggleClass(contentPane, stateExpandedClass);
+ WinJS.Utilities.toggleClass(navPane, stateCollapsedClass)
+ }
+ else
+ WinJS.Utilities.toggleClass(navPane, stateExpandedClass);
+ this.navPaneToggleState = !expanding;
+ return
+ }
+ var navPaneClientWidth = navPane.clientWidth;
+ if (expanding) {
+ this._animatingNavBarPromise = MS.Entertainment.Utilities.schedulePromiseNormal().then(function() {
+ WinJS.Utilities.toggleClass(navPane, stateExpandedClass);
+ return WinJS.UI.Animation.showPanel(navPane, {
+ top: "0px", left: "-" + navPaneClientWidth + "px", rtlflip: true
+ })
+ });
+ this._animatingNavBarPromise.done(function() {
+ _this.navPaneToggleState = false;
+ _this._animatingNavBarPromise = null
+ })
+ }
+ else {
+ var targetLeft = navPaneClientWidth - collapsedNavBarWidth;
+ this._animatingNavBarPromise = WinJS.Utilities.Scheduler.schedulePromiseNormal().then(function() {
+ var transformStyle = "translateX(-" + targetLeft + "px)";
+ if (MS.Entertainment.Utilities.getTextDirection() === MS.Entertainment.Utilities.TextDirections.RightToLeft)
+ transformStyle = "translateX(" + targetLeft + "px)";
+ navPane.style.msTransform = transformStyle;
+ WinJS.Utilities.addClass(navPane, "state-collapsing");
+ return WinJS.UI.Animation.hidePanel(navPane, {
+ top: "0px", left: "-" + targetLeft + "px", rtlflip: true
+ })
+ });
+ this._animatingNavBarPromise.done(function() {
+ WinJS.Utilities.toggleClass(navPane, stateExpandedClass);
+ _this._animatingNavBarPromise = null;
+ _this.navPaneToggleState = true;
+ navPane.style.msTransform = "";
+ WinJS.Utilities.removeClass(navPane, "state-collapsing")
+ })
+ }
+ };
+ CoreApplication.prototype._isNavMenuExpanded = function() {
+ var navPane = document.getElementById("navPane");
+ if (MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit)
+ return WinJS.Utilities.hasClass(navPane, stateExpandedClass);
+ else
+ return !WinJS.Utilities.hasClass(navPane, stateCollapsedClass)
+ };
+ CoreApplication.prototype._handleInvokeSearchClicked = function() {
+ var searchInputBox = document.querySelector("[data-ent-member=searchInputBox] .win-searchbox-input");
+ this._handleNavMenuClicked();
+ MS.Entertainment.Utilities.schedulePromiseIdle().done(function() {
+ var searchBoxControl = searchInputBox;
+ if (searchBoxControl)
+ MS.Entertainment.UI.Framework.focusElement(searchBoxControl, true, true)
+ })
+ };
+ CoreApplication.prototype._toggleLightDismissNavPane = function(navPane, dontAnimate) {
+ var _this = this;
+ if (!navPane)
+ return;
+ var expanding = !WinJS.Utilities.hasClass(navPane, stateExpandedClass);
+ if (expanding) {
+ window.msWriteProfilerMark("ent:X13App.NavPane.Expanding");
+ var bottomAppBar = MS.Entertainment.globalControls.getControl(MS.Entertainment.globalControls.GlobalControl.appBar);
+ if (bottomAppBar && bottomAppBar.hide)
+ bottomAppBar.hide();
+ navPane.winControl.enabled = true;
+ this._cleanupLightDismissNavPaneHandlers();
+ this._navPaneLightDismissHandlers = MS.Entertainment.UI.Framework.addEventHandlers(navPane, {
+ keydown: function(evt) {
+ if (evt.keyCode !== WinJS.Utilities.Key.escape)
+ return;
+ _this._toggleLightDismissNavPane(navPane)
+ }, focusout: function() {
+ if (navPane.contains(document.activeElement) || _this._focusIsInOverlayFromNavPane(document.activeElement))
+ return;
+ _this._toggleLightDismissNavPane(navPane)
+ }
+ });
+ var mediaWatcher = window.matchMedia("all and (min-width: 1024px)");
+ var mediaMatchedHandler = function() {
+ if (!mediaWatcher.matches)
+ return;
+ _this._toggleLightDismissNavPane(navPane, true)
+ };
+ mediaWatcher.addListener(mediaMatchedHandler);
+ this._navPaneWindowChangedHandlers = {cancel: function() {
+ mediaWatcher.removeListener(mediaMatchedHandler)
+ }}
+ }
+ else {
+ window.msWriteProfilerMark("ent:X13App.NavPane.Collapsing");
+ navPane.winControl.enabled = false;
+ this._cleanupLightDismissNavPaneHandlers()
+ }
+ this._toggleNavPane(expanding, navPane, null, dontAnimate)
+ };
+ CoreApplication.prototype._focusIsInOverlayFromNavPane = function(element) {
+ var navPane = document.getElementById("navPane");
+ var candidates = WinJS.Utilities.query(".overlayAnchor", document.body).filter(function(overlayElement) {
+ var containerElement = overlayElement.winControl && overlayElement.winControl.referenceContainer && overlayElement.winControl.referenceContainer.domElement;
+ return containerElement && navPane.contains(containerElement) && overlayElement.contains(element)
+ });
+ return candidates.length > 0
+ };
+ CoreApplication.prototype._cleanupLightDismissNavPaneHandlers = function() {
+ if (this._navPaneLightDismissHandlers) {
+ this._navPaneLightDismissHandlers.cancel();
+ this._navPaneLightDismissHandlers = null
+ }
+ if (this._navPaneWindowChangedHandlers) {
+ this._navPaneWindowChangedHandlers.cancel();
+ this._navPaneWindowChangedHandlers = null
+ }
+ };
+ Object.defineProperty(CoreApplication.prototype, "navPaneToggleState", {
+ get: function() {
+ return this._navPaneToggleState
+ }, set: function(value) {
+ this.updateAndNotify("navPaneToggleState", value);
+ this._updateNavPaneToggleAriaLabel()
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype._updateNavPaneToggleAriaLabel = function() {
+ if (!this._navPaneToggleButton)
+ return;
+ var navPane = document.getElementById("navPane");
+ var ariaLabelStringId = this.hideMenuAriaLabelStringId;
+ if (MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit)
+ if (WinJS.Utilities.hasClass(navPane, stateExpandedClass))
+ ariaLabelStringId = this.hideMenuAriaLabelStringId;
+ else
+ ariaLabelStringId = this.showMenuAriaLabelStringId;
+ else if (WinJS.Utilities.hasClass(navPane, stateCollapsedClass))
+ ariaLabelStringId = this.showMenuAriaLabelStringId;
+ else
+ ariaLabelStringId = this.hideMenuAriaLabelStringId;
+ if (ariaLabelStringId) {
+ MS.Entertainment.Framework.AccUtils.checkAndSetAriaAttribute(String.load(ariaLabelStringId), this._navPaneToggleButton, "label");
+ if (this._navPaneToggleButton.winControl)
+ this._navPaneToggleButton.winControl.innerHTML = String.load(ariaLabelStringId)
+ }
+ };
+ CoreApplication.prototype.initializeControlEventHandlers = function() {
+ var _this = this;
+ var searchBoxElement = document.querySelector(".control-app .searchInputBox");
+ var searchBoxControl;
+ if (searchBoxElement)
+ searchBoxControl = (searchBoxElement).winControl;
+ if (searchBoxControl) {
+ this._searchBoxElement = searchBoxElement;
+ searchBoxControl.placeholderText = String.load(String.id.IDS_SEARCH_BUTTON);
+ var typeToSearchService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.typeToSearch);
+ typeToSearchService.typeToSearchPropertyName = "focusOnKeyboardInput";
+ typeToSearchService.getTypeToSearchHost = function() {
+ return searchBoxControl
+ };
+ typeToSearchService.shouldEnableTypeToSearchForElement = function(element) {
+ if (searchBoxControl.element.contains(element))
+ return false;
+ return MS.Entertainment.UI.TypeToSearchService.prototype.shouldEnableTypeToSearchForElement.apply(_this, arguments)
+ };
+ this._searchBoxEvents = MS.Entertainment.UI.Framework.addEventHandlers(searchBoxControl, {
+ querysubmitted: function(e) {
+ if (_this._searchBoxElement) {
+ var submitButton = _this._searchBoxElement.querySelector(".win-searchbox-button");
+ if (submitButton)
+ submitButton.focus()
+ }
+ if (e.detail.queryText && e.detail.queryText.match(/\S/)) {
+ _this._navigateToSearch(e.detail.queryText, false, e.detail.language);
+ if ((MS.Entertainment.Utilities.getWindowWidth() < lightDismissLimit) && _this._isNavMenuExpanded())
+ _this._handleNavMenuClicked()
+ }
+ }, suggestionsrequested: function(e) {
+ var currentSearchContract = WinJS.Utilities.getMember("MS.Entertainment.ViewModels.SearchContractViewModel.current");
+ if (!currentSearchContract)
+ return null;
+ return currentSearchContract.searchKeywordSuggestionRequested({
+ language: e.detail.language, linguisticDetails: e.detail.linguisticDetails, queryText: e.detail.queryText, request: e.detail
+ })
+ }, receivingfocusonkeyboardinput: function() {
+ if (!searchBoxElement.contains(document.activeElement))
+ searchBoxControl.queryText = String.empty;
+ if (!_this._isNavMenuExpanded())
+ _this._handleNavMenuClickedImpl(true)
+ }
+ })
+ }
+ var toggleNavButton = document.querySelector("[data-ent-member=toggleNavMenu]");
+ if (toggleNavButton) {
+ this._navPaneToggleButton = toggleNavButton;
+ this._toggleNavMenuEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(toggleNavButton, {click: this._handleNavMenuClicked.bind(this)})
+ }
+ var invokeSearchButton = document.querySelector("[data-ent-member=invokeSearchButton]");
+ if (invokeSearchButton)
+ this._invokeSearchEventHandlers = MS.Entertainment.UI.Framework.addEventHandlers(invokeSearchButton, {click: this._handleInvokeSearchClicked.bind(this)});
+ var navPane = document.getElementById("navPane");
+ if (navPane)
+ this._dragEnterEventHandlers = UI.Framework.addEventHandlers(navPane, {dragenter: function() {
+ if (!_this._isNavMenuExpanded())
+ _this._handleNavMenuClicked()
+ }})
+ };
+ CoreApplication.prototype._navigateToDefault = function() {
+ var windowWidth = MS.Entertainment.Utilities.getWindowWidth();
+ if (windowWidth <= this.snappedModeMaxWidthPx)
+ this._setSnapped(true);
+ else
+ this.navigation.navigateToDefault()
+ };
+ CoreApplication.prototype._navigateToSearch = function(searchText, isCatalogSearch, searchLanguage) {
+ var actionService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.actions);
+ var navigateToSearchPage = actionService.getAction(MS.Entertainment.UI.Actions.ActionIdentifiers.searchResultsNavigate);
+ navigateToSearchPage.parameter = {
+ searchText: searchText, isCatalogSearch: isCatalogSearch
+ };
+ navigateToSearchPage.execute(document.querySelector(".control-app .searchInputBox"))
+ };
+ CoreApplication.prototype._initializeSnappedWatcher = function() {
+ var configuration = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ if (!this._snappedWatcher) {
+ this._snappedWatcher = window.matchMedia("all and (min-width: 320px) and (max-width: " + this.snappedModeMaxWidthPx + "px)");
+ this._snappedWatcher.addListener(this._onSnappedModeChanged.bind(this));
+ if (this._snappedWatcher.matches)
+ this._onSnappedModeChanged()
+ }
+ };
+ CoreApplication.prototype._onSnappedModeChanged = function() {
+ this._setSnapped(!!(this._snappedWatcher && this._snappedWatcher.matches))
+ };
+ CoreApplication.prototype._setSnapped = function(snapped) {
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ if (uiStateService.isSnapped !== snapped) {
+ uiStateService.isSnapped = snapped;
+ this.afterSnappedSet(snapped)
+ }
+ };
+ CoreApplication.prototype._windowMadeSmaller = function() {
+ var navPane = document.getElementById("navPane");
+ if (!navPane || !this._navPaneToggleButton)
+ return;
+ if (this._isNavMenuExpanded() && this._windowShrinksMediaMatch.matches)
+ this._toggleLightDismissNavPane(navPane);
+ if (!navPane.contains(document.activeElement) && !this._searchBoxElement.contains(document.activeElement))
+ return;
+ MS.Entertainment.UI.Framework.focusElement(this._navPaneToggleButton, false, true)
+ };
+ Object.defineProperty(CoreApplication.prototype, "navigation", {
+ get: function() {
+ var _this = this;
+ if (!this._navigation) {
+ var fueNavigationOperation = this._getFUENavigationOperation();
+ this._navigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.winJSNavigation);
+ this._navigation.initialize(this._getPrimaryPivots(), this.defaultPivotIndex, fueNavigationOperation);
+ this._initializeNavigation();
+ MS.Entertainment.UI.Framework.addEventHandlers(this._navigation.primaryPivots, {selectedItemChanged: function(args) {
+ var selectedPivot = (args && args.detail && args.detail.newSelection && args.detail.newSelection.item);
+ _this.onPrimaryPivotsSelectionChange(selectedPivot)
+ }})
+ }
+ return this._navigation
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype._initializeNavigation = function() {
+ this._navigation.animatePageTransitions = true
+ };
+ CoreApplication.prototype._getFUENavigationOperation = function() {
+ MS.Entertainment.UI.Actions.fail("_getFUENavigationOperation() should be overrided by subclass");
+ return null
+ };
+ CoreApplication.prototype._getPrimaryPivots = function() {
+ var appPivots = this.getAppPivots();
+ return new fx.SelectionManager(appPivots, -1)
+ };
+ Object.defineProperty(CoreApplication.prototype, "pivots", {
+ get: function() {
+ return this.navigation.primaryPivots
+ }, enumerable: true, configurable: true
+ });
+ CoreApplication.prototype._traceTimeFromStart = function(message) {
+ message = message + ": " + (Date.now() - window.PerfTrack.LaunchInformation.getStartTime());
+ WinJS.Promise.timeout(2000).done(function() {
+ return alert(message)
+ })
+ };
+ return CoreApplication
+ })(MS.Entertainment.UI.Framework.ObservableBase);
+ Shell.CoreApplication = CoreApplication
+ })(UI.Shell || (UI.Shell = {}));
+ var Shell = UI.Shell
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
+/* >>>>>>/videowinmain.js:31607 */
+(function() {
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+var __extends = this.__extends || function(d, b) {
+ for (var p in b)
+ if (b.hasOwnProperty(p))
+ d[p] = b[p];
+ function __() {
+ this.constructor = d
+ }
+ __.prototype = b.prototype;
+ d.prototype = new __
+ };
+
+(function(MS) {
+ (function(Entertainment) {
+ (function(UI) {
+ (function(Shell) {
+ var perfTrack = MS.Entertainment.Instrumentation.PerfTrack;
+ var fx = MS.Entertainment.UI.Framework;
+ window.onNewVideoPage = true;
+ var VideoApplication = (function(_super) {
+ __extends(VideoApplication, _super);
+ function VideoApplication() {
+ _super.call(this);
+ this.classicAppActivated = false;
+ this.setStageThreeCompletedOnFirstPage = false;
+ this.skipNotificationInitialization = true;
+ this.loadAppBar = false;
+ this.appProtocolName = "microsoftvideo";
+ this.clearLastActivatedEventArgsAfterHandling = false;
+ this._clearQueryAfterSearch = false
+ }
+ VideoApplication.prototype.cancelPendingVideoResume = function() {
+ if (WinJS.Utilities.getMember("Entertainment.Video.VideoFullScreenNowPlaying.pendingAutoResumeFilePath", MS))
+ MS.Entertainment.Video.VideoFullScreenNowPlaying.pendingAutoResumeFilePath = String.empty;
+ if (this._resumePersonalVideoPlaybackPromise) {
+ this._resumePersonalVideoPlaybackPromise.cancel();
+ this._resumePersonalVideoPlaybackPromise = null
+ }
+ };
+ VideoApplication.prototype.beforeAppActivationHandling = function() {
+ this.cancelPendingVideoResume()
+ };
+ VideoApplication.prototype.afterAppResume = function() {
+ var _this = this;
+ var pendingVideoToResume = WinJS.Utilities.getMember("Entertainment.Video.VideoFullScreenNowPlaying.pendingAutoResumeFilePath", MS);
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var isAutoResumeEnabled = config.video.videoLXAutoResumePersonalVideos;
+ if (!isAutoResumeEnabled || !pendingVideoToResume)
+ return;
+ var sessionMgr = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.sessionManager);
+ var playbackSession = sessionMgr && sessionMgr.primarySession;
+ if (!playbackSession)
+ return;
+ var lastPlayedMediaFilePath = WinJS.Utilities.getMember("lastPlayedMedia.fileItem.path", playbackSession) || WinJS.Utilities.getMember("lastPlayedMedia.filePath", playbackSession);
+ if (lastPlayedMediaFilePath && (pendingVideoToResume === lastPlayedMediaFilePath)) {
+ this.cancelPendingVideoResume();
+ var startPositionMs = playbackSession.lastPlayedPosition - 3000;
+ if (startPositionMs < 0)
+ startPositionMs = 1;
+ this._resumePersonalVideoPlaybackPromise = MS.Entertainment.Utilities.schedulePromiseBelowNormal().then(function() {
+ return _this.navigation.navigateToDefault()
+ }).then(function() {
+ return MS.Entertainment.Platform.PlaybackHelpers.playMedia2(playbackSession.lastPlayedMedia, {
+ autoPlay: true, playPreviewOnly: false, startPositionMsec: startPositionMs, playbackSource: MS.Entertainment.Platform.PlaybackHelpers.PlaybackSource.resumeApp
+ })
+ })
+ }
+ };
+ Object.defineProperty(VideoApplication.prototype, "defaultPivotIndex", {
+ get: function() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ var defaultPivotIndex = config.video.defaultPivotIndex;
+ if (MS.Entertainment.Utilities.isLaunchToCollectionSettingEnabled)
+ defaultPivotIndex = 0;
+ return defaultPivotIndex
+ }, enumerable: true, configurable: true
+ });
+ VideoApplication.prototype.getSavedNavigationMonikerData = function() {
+ return _super.prototype.getSavedNavigationMonikerData.call(this)
+ };
+ VideoApplication.prototype.setSavedNavigationMonikerData = function(value) {
+ if (!MS.Entertainment.Utilities.isLaunchToCollectionSettingEnabled)
+ _super.prototype.setSavedNavigationMonikerData.call(this, value)
+ };
+ Object.defineProperty(VideoApplication.prototype, "minAppSupportedVersion", {
+ get: function() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return config.fue.minVideoAppSupportedVersion
+ }, enumerable: true, configurable: true
+ });
+ Object.defineProperty(VideoApplication.prototype, "minServiceSupportedVersion", {
+ get: function() {
+ var config = new Microsoft.Entertainment.Configuration.ConfigurationManager;
+ return config.service.minVideoServiceSupportedVersion
+ }, enumerable: true, configurable: true
+ });
+ VideoApplication.prototype.getAppTitle = function() {
+ return this.marketPlaceEnabled ? String.load(String.id.IDS_XBOX_VIDEO_APP_TITLE) : String.load(String.id.IDS_VIDEO_APP_TITLE)
+ };
+ VideoApplication.prototype.getAppPivots = function() {
+ var videoPivots = new MS.Entertainment.ObservableArray;
+ videoPivots.push(this._createVideoCollectionPivot());
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace))
+ videoPivots.push(this._createMoviesStorePivot());
+ if (featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace))
+ videoPivots.push(this._createTvStorePivot());
+ return videoPivots
+ };
+ VideoApplication.prototype.handleFileActivation = function(isFirstRun, args) {
+ var loadDelayedInitFragmentPromise = this._loadDelayedInitFragment(true);
+ var loadClassicAppPromise = this.loadClassicApp(true);
+ MS.Entertainment.Instrumentation.PerfTrack.setStartTime(MS.Entertainment.Instrumentation.PerfTrack.StartPoints.PlayCommand);
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioPlayNonProtectedInApp();
+ WinJS.Promise.join([loadDelayedInitFragmentPromise, loadClassicAppPromise]).done(function() {
+ if (MS.Entertainment.ServiceLocator.isServiceRegistered(MS.Entertainment.Services.playbackErrorDisplayService))
+ MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.playbackErrorDisplayService).initialize();
+ MS.Entertainment.Activation.fileActivationHandler(args, !isFirstRun, true)
+ }, function(error) {
+ MS.Entertainment.Utilities.assertError("VideoWinMain::handleFileActivation: Unexpected Error from _loadDelayedInitFragment(): ", error)
+ });
+ return true
+ };
+ VideoApplication.prototype._createVideoCollectionPivot = function() {
+ return new UI.Framework.PivotData(function() {
+ return Entertainment.ViewModels.VideoCollectionLX.createVideoCollectionLX()
+ }, "/Components/Video_Win/VideoCollection.html#collectionBody", String.load(String.id.IDS_VIDEO_LX_COLLECTION_PIVOT_TC), UI.Icon.videoCollection, "collection", function() {
+ perfTrack.setStartTime(perfTrack.StartPoints.VideoCollectionPageRequest)
+ }, function() {
+ perfTrack.triggerScenarioVideoCollectionPageRequestToLoad();
+ perfTrack.triggerScenarioAppLaunchToVideoCollection()
+ })
+ };
+ VideoApplication.prototype._createMoviesStorePivot = function() {
+ return new UI.Framework.PivotData(function() {
+ return new Entertainment.ViewModels.MoviesStoreHubViewModel
+ }, "/Components/Video_Win/MoviesStore.html#moviesStoreBody", String.load(String.id.IDS_VIDEO_LX_MOVIES_STORE_PIVOT_TC), UI.Icon.movies, "moviesStore", function() {
+ perfTrack.setStartTime(perfTrack.StartPoints.MoviesStorePageRequest)
+ }, function() {
+ perfTrack.triggerScenarioMoviesStorePageRequestToLoad();
+ perfTrack.triggerScenarioAppLaunchToMoviesStore()
+ })
+ };
+ VideoApplication.prototype._createTvStorePivot = function() {
+ return new UI.Framework.PivotData(function() {
+ return new Entertainment.ViewModels.TvStoreHubViewModel
+ }, "/Components/Video_Win/TvStore.html#tvStoreBody", String.load(String.id.IDS_VIDEO_LX_TV_STORE_PIVOT_TC), UI.Icon.tvMonitor, "tvStore", function() {
+ perfTrack.setStartTime(perfTrack.StartPoints.TvStorePageRequest)
+ }, function() {
+ perfTrack.triggerScenarioTvStorePageRequestToLoad();
+ perfTrack.triggerScenarioAppLaunchToTvStore()
+ })
+ };
+ VideoApplication._tryGetDeeplinkParameter = function(queryParsed, paramName) {
+ if (queryParsed && queryParsed.size > 0)
+ try {
+ return queryParsed.getFirstValueByName(paramName)
+ }
+ catch(e) {}
+ return null
+ };
+ VideoApplication.prototype.beforeProtocolProcessPromise = function(deeplink) {
+ var autoPlayAttribute = VideoApplication._tryGetDeeplinkParameter(deeplink.queryParsed, "autoPlay");
+ var autoPlayPreviewAttribute = VideoApplication._tryGetDeeplinkParameter(deeplink.queryParsed, "autoPlayPreview");
+ if ((autoPlayAttribute && autoPlayAttribute.toLowerCase() === "true") || (autoPlayPreviewAttribute && autoPlayPreviewAttribute.toLowerCase() === "true"))
+ return WinJS.Promise.join([this._loadDelayedInitFragment(true), this.loadClassicApp(true, true)]);
+ return _super.prototype.beforeProtocolProcessPromise.call(this, deeplink)
+ };
+ VideoApplication.prototype.afterProcessAllCompleted = function() {
+ var _this = this;
+ var contentComplete = MS.Entertainment.UI.Framework.addEventHandlers(this.navigation.contentContainer, {ContentComplete: function() {
+ contentComplete.cancel();
+ _this.loadClassicApp()
+ }});
+ if ((new Microsoft.Entertainment.Configuration.ConfigurationManager).video.videoLXDefaultToClassic)
+ MS.Entertainment.UI.Framework.Navigation.raiseContentComplete(document.body.querySelector("[data-win-automationid=contentContainer]"))
+ };
+ Object.defineProperty(VideoApplication.prototype, "marketPlaceEnabled", {
+ get: function() {
+ var featureEnablement = new Microsoft.Entertainment.FeatureEnablement.FeatureEnablement;
+ var moviesMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.moviesMarketplace);
+ var tvMarketplaceEnabled = featureEnablement.isEnabled(Microsoft.Entertainment.FeatureEnablement.FeatureItem.tvMarketplace);
+ return !!(moviesMarketplaceEnabled || tvMarketplaceEnabled)
+ }, enumerable: true, configurable: true
+ });
+ VideoApplication.prototype._getFUENavigationOperation = function() {
+ return null
+ };
+ VideoApplication.prototype.onNavPaneFirstTimeRender = function() {
+ MS.Entertainment.Instrumentation.PerfTrack.triggerScenarioAppLaunch();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchToMoviesStore();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchToTvStore();
+ MS.Entertainment.Instrumentation.PerfTrack.enableScenarioAppLaunchToVideoCollection()
+ };
+ VideoApplication.prototype._getFileTransferNotificationHandler = function() {
+ if (MS.Entertainment.UI.FileTransferNotificationHandlers)
+ return new MS.Entertainment.UI.FileTransferNotificationHandlers;
+ return null
+ };
+ VideoApplication.prototype._loadClassicFragment = function(critical) {
+ var _this = this;
+ var shouldLoadClassicApp = (new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.loadClassicApp;
+ if (!shouldLoadClassicApp)
+ return WinJS.Promise.as();
+ var classicContainer = document.querySelector(".app-classicContainer");
+ if (!this._loadClassicFragmentPromise) {
+ var signal = new MS.Entertainment.UI.Framework.Signal;
+ this._loadClassicFragmentPromise = signal.promise;
+ msWriteProfilerMark("ent:loadClassicFragment,StartTM");
+ var loadClassicFragment = function() {
+ msWriteProfilerMark("ent:loadClassicFragment,StopTM");
+ MS.Entertainment.Utilities.loadHtmlPage("/Classic/main.html", classicContainer).then(function() {
+ var appBarContainer = classicContainer.querySelector(".bottomAppBar");
+ var flyoutEater = document.body.querySelector(".win-appbarclickeater");
+ document.body.insertBefore(appBarContainer, flyoutEater);
+ _this.startListeningForClassicNavigationChanges();
+ signal.complete()
+ })
+ };
+ if (!critical)
+ WinJS.Utilities.Scheduler.schedule(loadClassicFragment, WinJS.Utilities.Scheduler.Priority.idle);
+ else
+ loadClassicFragment()
+ }
+ return this._loadClassicFragmentPromise
+ };
+ VideoApplication.prototype.loadClassicApp = function(critical, mapToLaunchActivationKind) {
+ var _this = this;
+ if (!(new Microsoft.Entertainment.Configuration.ConfigurationManager).shell.loadClassicApp)
+ return WinJS.Promise.as();
+ if (!this._loadClassicAppPromise)
+ this._loadClassicAppPromise = this._loadClassicFragment(critical).then(function() {
+ var classicContainer = document.querySelector(".app-classicContainer");
+ if (_this.lastActivatedEventArgs) {
+ if (mapToLaunchActivationKind) {
+ _this.lastActivatedEventArgs.kind = Windows.ApplicationModel.Activation.ActivationKind.launch;
+ _this.lastActivatedEventArgs.arguments = null
+ }
+ MS.Entertainment.UI.Application.Activation.activated(_this.lastActivatedEventArgs, true);
+ _this.lastActivatedEventArgs = null
+ }
+ _this.classicAppActivated = true;
+ var hubStripVisible = new fx.Signal;
+ var classicNavigation = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (classicNavigation.currentPage)
+ hubStripVisible.complete();
+ else
+ var hubStripVisibleEvent = MS.Entertainment.UI.Framework.addEventHandlers(classicContainer, {HubStripVisible: function() {
+ hubStripVisibleEvent.cancel();
+ hubStripVisible.complete()
+ }});
+ return hubStripVisible.promise
+ });
+ return this._loadClassicAppPromise
+ };
+ VideoApplication.prototype.startListeningForClassicNavigationChanges = function() {
+ var classicNavigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ this._classicNavigationEvents = MS.Entertainment.UI.Framework.addEventHandlers(classicNavigationService, {canNavigateBackChanged: this._canNavigateBackChanged.bind(this)})
+ };
+ VideoApplication.prototype._canNavigateBackChanged = function(args) {
+ var classicContainer = document.querySelector(".app-classicContainer");
+ var newContainer = document.querySelector(".control-app");
+ if (args.detail.newValue || ((new Microsoft.Entertainment.Configuration.ConfigurationManager).video.videoLXDefaultToClassic))
+ WinJS.UI.Animation.fadeOut(newContainer).done(function() {
+ WinJS.Utilities.removeClass(classicContainer, "hideFromDisplay");
+ WinJS.Utilities.addClass(newContainer, "hideFromDisplay")
+ });
+ else {
+ WinJS.Utilities.addClass(classicContainer, "hideFromDisplay");
+ WinJS.Utilities.removeClass(newContainer, "hideFromDisplay");
+ if (args.detail.oldValue !== undefined)
+ WinJS.UI.Animation.fadeIn(newContainer)
+ }
+ };
+ VideoApplication.prototype.unload = function() {
+ if (this._classicNavigationEvents) {
+ this._classicNavigationEvents.cancel();
+ this._classicNavigationEvents = null
+ }
+ _super.prototype.unload.call(this)
+ };
+ return VideoApplication
+ })(MS.Entertainment.UI.Shell.CoreApplication);
+ Shell.VideoApplication = VideoApplication;
+ var ClassicAppHelper = (function(_super) {
+ __extends(ClassicAppHelper, _super);
+ function ClassicAppHelper(element, options) {
+ _super.call(this, element, options)
+ }
+ ClassicAppHelper.prototype.initialize = function() {
+ var hubStripVisibleEvent = document.createEvent("Event");
+ hubStripVisibleEvent.initEvent("HubStripVisible", true, true);
+ var hubStripReadyEvent = document.createEvent("Event");
+ hubStripReadyEvent.initEvent("HubStripReady", true, true);
+ this.domElement.dispatchEvent(hubStripVisibleEvent);
+ this.domElement.dispatchEvent(hubStripReadyEvent);
+ var uiStateService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.uiState);
+ uiStateService.isHubStripVisible = true;
+ WinJS.Promise.timeout(200).done(function() {
+ fx.currentContentContainer = document.querySelector(".control-app")
+ })
+ };
+ ClassicAppHelper.prototype.thaw = function() {
+ _super.prototype.thaw.call(this);
+ fx.currentContentContainer = document.querySelector(".control-app")
+ };
+ return ClassicAppHelper
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Shell.ClassicAppHelper = ClassicAppHelper;
+ WinJS.Utilities.markSupportedForProcessing(ClassicAppHelper);
+ var BlankPageHelper = (function(_super) {
+ __extends(BlankPageHelper, _super);
+ function BlankPageHelper(element, options) {
+ _super.call(this, element, options)
+ }
+ BlankPageHelper.prototype.initialize = function() {
+ var _this = this;
+ WinJS.Promise.timeout(750).done(function() {
+ MS.Entertainment.UI.Framework.Navigation.raiseContentComplete(_this.domElement)
+ })
+ };
+ BlankPageHelper.navigateToMovieGallery = function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.movieMarketplace, MS.Entertainment.UI.Monikers.movieMarketplaceNewReleases)
+ };
+ BlankPageHelper.navigateToTVGallery = function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.tvMarketplace, MS.Entertainment.UI.Monikers.tvMarketplaceFeatured)
+ };
+ BlankPageHelper.navigateToMovieCollection = function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.videoCollection, null, MS.Entertainment.UI.Monikers.movieCollectionPanel)
+ };
+ BlankPageHelper.navigateToTVCollection = function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.videoCollection, null, MS.Entertainment.UI.Monikers.tvCollectionPanel)
+ };
+ BlankPageHelper.navigateToOtherCollection = function() {
+ var navigationService = MS.Entertainment.ServiceLocator.getService(MS.Entertainment.Services.navigation);
+ if (navigationService)
+ navigationService.navigateTo(MS.Entertainment.UI.Monikers.videoCollection)
+ };
+ return BlankPageHelper
+ })(MS.Entertainment.UI.Framework.UserControl);
+ Shell.BlankPageHelper = BlankPageHelper;
+ WinJS.Utilities.markSupportedForProcessing(BlankPageHelper);
+ var videoApp = new VideoApplication;
+ videoApp.initialize()
+ })(UI.Shell || (UI.Shell = {}));
+ var Shell = UI.Shell
+ })(Entertainment.UI || (Entertainment.UI = {}));
+ var UI = Entertainment.UI
+ })(MS.Entertainment || (MS.Entertainment = {}));
+ var Entertainment = MS.Entertainment
+})(MS || (MS = {}))
+})();
diff --git a/packages/microsoft.zunevideo/microsoft.system.package.metadata/Autogen/JSByteCodeCache_32 b/packages/microsoft.zunevideo/microsoft.system.package.metadata/Autogen/JSByteCodeCache_32
new file mode 100644
index 00000000..1962173f
Binary files /dev/null and b/packages/microsoft.zunevideo/microsoft.system.package.metadata/Autogen/JSByteCodeCache_32 differ
diff --git a/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.pckgdep b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.pckgdep
new file mode 100644
index 00000000..c4d0f775
Binary files /dev/null and b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.pckgdep differ
diff --git a/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.recovery b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.recovery
new file mode 100644
index 00000000..de6e8b39
Binary files /dev/null and b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1001.recovery differ
diff --git a/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.pckgdep b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.pckgdep
new file mode 100644
index 00000000..c4d0f775
Binary files /dev/null and b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.pckgdep differ
diff --git a/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.recovery b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.recovery
new file mode 100644
index 00000000..4346454d
Binary files /dev/null and b/packages/microsoft.zunevideo/microsoft.system.package.metadata/S-1-5-21-139115680-2786715469-1878177833-1004.recovery differ
diff --git a/packages/microsoft.zunevideo/msapp-error.html b/packages/microsoft.zunevideo/msapp-error.html
new file mode 100644
index 00000000..4822693d
--- /dev/null
+++ b/packages/microsoft.zunevideo/msapp-error.html
@@ -0,0 +1,15 @@
+
+
+
+
+ IWX Entertainment Client
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/microsoft.zunevideo/msapp-error.js b/packages/microsoft.zunevideo/msapp-error.js
new file mode 100644
index 00000000..ac0515c8
--- /dev/null
+++ b/packages/microsoft.zunevideo/msapp-error.js
@@ -0,0 +1,36 @@
+/* Copyright (C) Microsoft Corporation. All rights reserved. */
+(function() {
+ "use strict";
+ function initialize() {
+ var json = {
+ httpStatus: "", failureName: "", failureUrl: ""
+ };
+ for (var property in json) {
+ var parameterValue = getQueryParameter(property);
+ if (parameterValue)
+ json[property] = unescape(parameterValue);
+ else
+ json[property] = "Unknown"
+ }
+ json["verb"] = json["message"] = "NAVIGATION_ERROR";
+ json["header"] = {
+ version: {
+ major: "1", minor: "0"
+ }, taskId: "OTHER"
+ };
+ var jsonString = JSON.stringify(json);
+ var origin = "ms-appx://" + document.location.host;
+ window.parent.postMessage(jsonString, origin)
+ }
+ function getQueryParameter(variable) {
+ var query = window.location.search.substring(1);
+ var vars = query.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] === variable)
+ return pair[1]
+ }
+ return ""
+ }
+ document.addEventListener("DOMContentLoaded", initialize, false)
+})()
diff --git a/packages/microsoft.zunevideo/raw/EntCommon.dll b/packages/microsoft.zunevideo/raw/EntCommon.dll
new file mode 100644
index 00000000..c3e03e9e
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/EntCommon.dll differ
diff --git a/packages/microsoft.zunevideo/raw/EntPlat.dll b/packages/microsoft.zunevideo/raw/EntPlat.dll
new file mode 100644
index 00000000..626e6a63
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/EntPlat.dll differ
diff --git a/packages/microsoft.zunevideo/raw/EntSyncFx.dll b/packages/microsoft.zunevideo/raw/EntSyncFx.dll
new file mode 100644
index 00000000..e4dd35df
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/EntSyncFx.dll differ
diff --git a/packages/microsoft.zunevideo/raw/Microsoft.Entertainment.Instrumentation.Providers.dll b/packages/microsoft.zunevideo/raw/Microsoft.Entertainment.Instrumentation.Providers.dll
new file mode 100644
index 00000000..3996b383
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/Microsoft.Entertainment.Instrumentation.Providers.dll differ
diff --git a/packages/microsoft.zunevideo/raw/Microsoft.Entertainment.winmd b/packages/microsoft.zunevideo/raw/Microsoft.Entertainment.winmd
new file mode 100644
index 00000000..1c2e9043
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/Microsoft.Entertainment.winmd differ
diff --git a/packages/microsoft.zunevideo/raw/Microsoft.Media.AdaptiveStreaming.dll b/packages/microsoft.zunevideo/raw/Microsoft.Media.AdaptiveStreaming.dll
new file mode 100644
index 00000000..72064737
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/Microsoft.Media.AdaptiveStreaming.dll differ
diff --git a/packages/microsoft.zunevideo/raw/Microsoft.Media.AdaptiveStreaming.winmd b/packages/microsoft.zunevideo/raw/Microsoft.Media.AdaptiveStreaming.winmd
new file mode 100644
index 00000000..1a160de9
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/Microsoft.Media.AdaptiveStreaming.winmd differ
diff --git a/packages/microsoft.zunevideo/raw/Microsoft.PerfTrack.dll b/packages/microsoft.zunevideo/raw/Microsoft.PerfTrack.dll
new file mode 100644
index 00000000..a7bab463
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/Microsoft.PerfTrack.dll differ
diff --git a/packages/microsoft.zunevideo/raw/Microsoft.PerfTrack.winmd b/packages/microsoft.zunevideo/raw/Microsoft.PerfTrack.winmd
new file mode 100644
index 00000000..46467cec
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/Microsoft.PerfTrack.winmd differ
diff --git a/packages/microsoft.zunevideo/raw/MicrosoftAdvertising.dll b/packages/microsoft.zunevideo/raw/MicrosoftAdvertising.dll
new file mode 100644
index 00000000..3a7cc9ca
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/MicrosoftAdvertising.dll differ
diff --git a/packages/microsoft.zunevideo/raw/MicrosoftAdvertising.winmd b/packages/microsoft.zunevideo/raw/MicrosoftAdvertising.winmd
new file mode 100644
index 00000000..3a675bcb
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/MicrosoftAdvertising.winmd differ
diff --git a/packages/microsoft.zunevideo/raw/gnsdk_fp.dll b/packages/microsoft.zunevideo/raw/gnsdk_fp.dll
new file mode 100644
index 00000000..830eddae
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/gnsdk_fp.dll differ
diff --git a/packages/microsoft.zunevideo/raw/resources.pri b/packages/microsoft.zunevideo/raw/resources.pri
new file mode 100644
index 00000000..c5b15943
Binary files /dev/null and b/packages/microsoft.zunevideo/raw/resources.pri differ
diff --git a/packages/microsoft.zunevideo/resources/en-gb.json b/packages/microsoft.zunevideo/resources/en-gb.json
new file mode 100644
index 00000000..dd23d87f
--- /dev/null
+++ b/packages/microsoft.zunevideo/resources/en-gb.json
@@ -0,0 +1,1844 @@
+{
+ "resources": {
+ "IDS_ACC_BACK_BUTTON": "Back",
+ "IDS_ACC_HOME_BUTTON": "Home",
+ "IDS_ACC_REFRESH_BUTTON": "Refresh",
+ "IDS_ACTIVATION_LIMIT_EXCEEDED_DTO": "You're already downloading on the maximum number of devices.",
+ "IDS_ADVERTISEMENT": "Advertisement",
+ "IDS_APP1_MODULE_VIEW_ALL": "View all",
+ "IDS_APP1_MODULE_VIEW_ALL_LABEL": "View all {0}",
+ "IDS_APP2_FILTER_SORTED_BY": "Sort by",
+ "IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT": "Content filtered. Appropriate up to age {0}.",
+ "IDS_APP2_PARENTAL_NO_CONTENT_TITLE": "Parental controls are enabled",
+ "IDS_BETA_TOS_ACCEPT_MESSAGE": "By clicking I Accept, you agree to the license terms required to use this app.",
+ "IDS_BETA_TOS_BUTTON_ACCEPT": "I accept",
+ "IDS_BETA_TOS_BUTTON_DECLINE": "Cancel",
+ "IDS_BETA_TOS_TITLE": "First things first.",
+ "IDS_BROWSE_ACTION_TITLE": "Show More",
+ "IDS_BUY_BUTTON": "Buy",
+ "IDS_BUY_BUTTON_VIDEO": "Buy",
+ "IDS_CANCEL_BUTTON": "Cancel",
+ "IDS_CANCEL_BUTTON_TC": "Cancel",
+ "IDS_CHILD_AGE_GATING_MESSAGE": "Purchase of this content is currently not allowed for child and teen accounts.",
+ "IDS_CHILD_AGE_GATING_TITLE": "Sorry",
+ "IDS_CLEAR_DOWNLOAD_ERROR_BUTTON": "Clear error",
+ "IDS_CLEAR_SELECTION": "Clear selection",
+ "IDS_CLOSE_BUTTON": "Close",
+ "IDS_CLOSE_BUTTON_LC": "close",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE": "You have more music than we can sync with the cloud. To keep your music in sync, limit your number of songs to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE": "Can't sync your music.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER": "Can't sync your music",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE": "We can't sync with the cloud right now. Until we do, changes you make here won't show up on other devices and changes on those devices won't show up here. We'll keep trying. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE": "Can't sync right now.",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER": "Can't sync",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT": "More info",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE": "Playlists can have only {0} songs. Choose fewer songs or remove some first.",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL": "[[1]Playlists can have only {0} song. Choose fewer songs or remove some first.][[*]Playlists can have only {0} songs. Choose fewer songs or remove some first.]",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE": "Can't add to {0}",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE": "You have more playlists than we can sync with the cloud. To keep your playlists in sync, limit their number to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE": "Can't sync playlists.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER": "Can't sync playlists",
+ "IDS_COLLECTION_ALL_VIDEO_EMPTY": "When you add videos to your Windows library, they'll appear here, too.",
+ "IDS_COLLECTION_CLOUD_MATCHED_ARIA": "Cloud matched",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING": "Checking Xbox Music availability",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA": "Cloud sync pending",
+ "IDS_COLLECTION_HEADER_ZOOM_IN": "Activate to zoom in",
+ "IDS_COLLECTION_HEADER_ZOOM_OUT": "Activate to zoom out",
+ "IDS_COLLECTION_IN_CLOUD": "In cloud",
+ "IDS_COLLECTION_IN_CLOUD_FREE": "Matched (available here and for streaming on other Windows 8/Windows RT devices)",
+ "IDS_COLLECTION_IN_CLOUD_MATCHED": "Matched (available here and for streaming on other Xbox Music devices)",
+ "IDS_COLLECTION_MOVIE_EMPTY": "It's lonely here. Find hit films at the Xbox Video Store.",
+ "IDS_COLLECTION_MOVIE_EMPTY_LINK": "Show me hit films at the Xbox Video Store",
+ "IDS_COLLECTION_MUSIC_EMPTY": "It’s lonely here. Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_2": "Go to the Windows desktop. Select Windows Explorer, then Music Library. Put your MP3s in this folder.",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK": "Browse millions of songs in Xbox Music",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM": "Find music to stream for free or buy and add to your collection",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM": "Browse all music",
+ "IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE": "Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_TITLE": "It's lonely here.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT": "This app plays music from your Windows library. To add music, go to the Windows desktop, select Windows Explorer and then Music Library.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE": "Collection",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE": "We'll add songs from any files you have on this PC.",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE": "Choose where we look",
+ "IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK": "Choose where we look for music on this PC",
+ "IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK": "Add music to your Windows music library",
+ "IDS_COLLECTION_MUSIC_SETTINGS_TITLE": "Settings",
+ "IDS_COLLECTION_NOT_IN_CLOUD": "Not in cloud",
+ "IDS_COLLECTION_OPEN_FILES_LINK": "Open or play something",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE": "Browse new, featured, and top music.",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE": "Explore music",
+ "IDS_COLLECTION_PIVOT": "collection",
+ "IDS_COLLECTION_PIVOT_TC": "Collection",
+ "IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD": "Add to cloud",
+ "IDS_COLLECTION_PURCHASES_RESTORE": "Restore",
+ "IDS_COLLECTION_PURCHASES_RESTORE_TEXT": "Where possible, restore all purchased music to my collection. Some purchases may no longer be available.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE": "This song is no longer available for streaming or download from Xbox Music. It might be available for purchase.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE": "Song not available.",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD": "Streaming",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE": "Streaming only",
+ "IDS_COLLECTION_THIS_DEVICE_ONLY": "This device only",
+ "IDS_COLLECTION_TOOLTIP_CLOUD_STATUS": "Streaming status",
+ "IDS_COLLECTION_TOOLTIP_LEARN_MORE": "Learn more",
+ "IDS_COLLECTION_TOOLTIP_MATCHED": "Listen offline here, also in Xbox Music catalogue",
+ "IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD": "Not in cloud (available only here)",
+ "IDS_COLLECTION_TOOLTIP_STREAMING": "Stream from Xbox Music catalogue (to listen offline, download this file)",
+ "IDS_COLLECTION_TOOLTIP_UNMATCHED": "Unmatched (available only here)",
+ "IDS_COLLECTION_TV_EMPTY": "Show me TV programmes at the Xbox Video Store",
+ "IDS_COLLECTION_VIDEO_EMPTY": "When you have videos that aren't films or TV programmes, they'll appear here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY": "It's lonely here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2": "Make sure your videos are part of your Windows library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE": "You can also open files directly, but playing them this way won't add them to your Video library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT": "This app plays videos from your Windows library. To add videos, go to the Windows desktop, select Windows Explorer, and then Videos Library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE": "My Videos",
+ "IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK": "Choose where we look for videos on this PC",
+ "IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK": "Add videos to your Windows video library",
+ "IDS_COLLECTION_VIDEO_SETTINGS_TITLE": "Settings",
+ "IDS_COMMA_SEPARATOR": "{0}, {1}",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY": "When you connect to your Xbox 360 with Xbox SmartGlass, what you play there will appear here.",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE": "Welcome!",
+ "IDS_COMPOSE_MESSAGE_SEND": "Send",
+ "IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL": "Move and tap with one finger.",
+ "IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL": "Zoom with two.",
+ "IDS_CONTROLLER_DISMISS_KEYBOARD": "Tap here when you're done typing.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING": "Someone else is using their Xbox SmartGlass remote.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON": "OK",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE": "Sorry, you can’t use the remote right now.",
+ "IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL": "Enter your Family Settings pass code to continue.",
+ "IDS_CONTROLLER_INVOKE_KEYBOARD": "Tap here to start typing.",
+ "IDS_CONTROLLER_SAME_WIRELESS_NETWORK": "For the best experience, your Xbox console and this device should be on the same wireless network.",
+ "IDS_CONTROLLER_SEPARATE_NETWORKS": "Xbox SmartGlass will work across separate networks, but you can't use the keyboard or browser control.",
+ "IDS_CONTROLLER_SLOW_CONNECTION": "Slow connection",
+ "IDS_CONTROLLER_SLOW_CONNECTION_BUTTON": "OK",
+ "IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO": "More info",
+ "IDS_CONTROLLER_SWITCHER_BROWSER": "Browser",
+ "IDS_CONTROLLER_SWITCHER_BUTTON": "Switch",
+ "IDS_CONTROLLER_SWITCHER_CONTROLLER": "Controller",
+ "IDS_CONTROLLER_SWITCHER_GUIDE": "Guide",
+ "IDS_CONTROLLER_SWITCHER_KEYBOARD": "Keyboard",
+ "IDS_CONTROLLER_TUTORIAL_SWIPE": "Swipe to move and hold to move faster",
+ "IDS_CONTROLLER_TUTORIAL_TAP": "Tap to select",
+ "IDS_CONTROLLER_WEB_HUB_BUTTON": "Web Hub",
+ "IDS_CREATEACCOUNT_TITLE": "Create Account",
+ "IDS_DELETE_BUTTON": "Delete",
+ "IDS_DELETE_DESCRIPTION_LOCAL_PLURAL": "[[1]Are you sure you want to delete this {0} item?][[*]Are you sure you want to delete these {0} items?]",
+ "IDS_DELETE_DESCRIPTION_LOCAL_SINGLE": "Are you sure you want to delete \"{0}\"?",
+ "IDS_DELETE_LABEL": "Delete",
+ "IDS_DEMO_CONFIGURATION_COMPLETE": "The application has been configured for the retail experience. It will now close.",
+ "IDS_DEMO_IN_DEMO_MODE": "Retail demo",
+ "IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER": "Featured Albums",
+ "IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER": "Featured Artists",
+ "IDS_DEMO_MUSIC_EXPLORE_HEADER": "Discover new music",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1": "Listen to millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE": "Browse and buy from a catalogue of millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2": "Find, play, and collect your favourites",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3": "Save them as playlists and see them on other devices",
+ "IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER": "Explore Xbox Music",
+ "IDS_DEMO_MUSIC_EXPLORE_SUBTITLE": "Xbox Music lets you listen to your favourite artists, and helps you to discover new ones.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE": "xbox music store",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE": "* Internet required. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE": "Buy individual songs or get unlimited access to millions of songs with Xbox Music Pass.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE": "Purchase songs and albums from the Xbox Music store to build your personal music collection.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE": "From the latest new releases to classic favourites.",
+ "IDS_DEMO_MUSIC_RADIO_HEADER": "Personalised radio",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_1": "Pick an artist and we will pick the tunes",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_2": "Save your favourite stations as playlists for easy listening",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_3": "Skip as many songs as you like — you are in complete control",
+ "IDS_DEMO_MUSIC_RADIO_SUBTITLE": "Xbox Music lets you listen to customised stations of music you will love.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE": "* Internet required. Limits on free streaming apply. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE": "Enjoy 6 months free unlimited music streaming on every Windows PC and tablet.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE": "Get Xbox Music Pass for unlimited access to millions of songs on all your devices.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE": "Xbox Music brings you all the music you love. Any way you want it.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE": "* Broadband internet and compatible devices required. See xbox.com/live.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE": "Play your purchased videos anywhere you go. Start on your tablet and pick up where you left off on your Xbox 360.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF": "Rent or buy the latest HD films.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON": "Rent or buy the latest HD films and buy TV programmes.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE": "* Content from Xbox Video Store. Internet required; carrier fees apply. HD capable display required.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE": "Watch what you love wherever you are, get instant-on HD to start watching right away.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON": "Get the latest TV programmes the day after they air.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE": "Xbox Video brings you the latest films and TV programmes you love, anywhere you are.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV": "Xbox Video brings you the latest films you love, anywhere you are.",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING": "Add to now playing",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION": "add to now playing",
+ "IDS_DETAILS_ALL_EPISODES_LABEL": "All episodes",
+ "IDS_DETAILS_ARTIST_ALBUMS": "albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL_LC": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL": "Show all albums",
+ "IDS_DETAILS_AUDIO_LANGUAGE": "{0} audio",
+ "IDS_DETAILS_BUY_ALBUM_LABEL": "Buy album",
+ "IDS_DETAILS_BUY_BUNDLE": "Buy bundle",
+ "IDS_DETAILS_BUY_EPISODE_LABEL": "Buy/rent",
+ "IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL": "Buy episode",
+ "IDS_DETAILS_BUY_EXTRA": "Buy extra",
+ "IDS_DETAILS_BUY_SEASON_CURRENT_LABEL": "Buy series pass",
+ "IDS_DETAILS_BUY_SEASON_LABEL": "Buy series",
+ "IDS_DETAILS_BUY_SONG_LABEL": "Buy song",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT": "1 album",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_DETAILS_COLLECTION_ALBUMS_COUNT": "{0} albums",
+ "IDS_DETAILS_COLLECTION_NO_SONGS": "no songs in collection",
+ "IDS_DETAILS_COLLECTION_SONG_COUNT": "1 song in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_COUNT": "{0} songs in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_PLURAL": "[[1]{0} song in collection][[*]{0} songs in collection]",
+ "IDS_DETAILS_CURRENT_MEDIA_LABEL": "Now playing",
+ "IDS_DETAILS_DEMO_PURCHASED_LABEL": "Demo purchased",
+ "IDS_DETAILS_DESCRIPTION_LABEL": "Description",
+ "IDS_DETAILS_DEVELOPER_LABEL": "Developer",
+ "IDS_DETAILS_DOWNLOAD_FREE_EXTRA": "Get for Xbox 360",
+ "IDS_DETAILS_DOWNLOAD_LABEL": "Download",
+ "IDS_DETAILS_DOWNLOAD_LABEL_HD": "Download (HD)",
+ "IDS_DETAILS_DOWNLOAD_LABEL_SD": "Download (SD)",
+ "IDS_DETAILS_DURATION_HOURS_FORMAT": "{0} hr {1} min",
+ "IDS_DETAILS_DURATION_LABEL": "Duration",
+ "IDS_DETAILS_DURATION_MINS_FORMAT": "{0} min",
+ "IDS_DETAILS_DURATION_MINSEC_FORMAT": "{0} min {1} sec",
+ "IDS_DETAILS_EPISODES_LABEL": "Episodes",
+ "IDS_DETAILS_EPISODES_LABEL_LC": "episodes",
+ "IDS_DETAILS_EPISODES_LABEL_UC": "EPISODES",
+ "IDS_DETAILS_EXPLICIT_LABEL": "Explicit",
+ "IDS_DETAILS_EXPLICIT_LABEL_UC": "EXPLICIT",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL": "Extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_LC": "extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_UC": "EXTRAS",
+ "IDS_DETAILS_EXTRA_FOR_GAME": "{0} for {1}",
+ "IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL": "{0}, last purchased on {1}",
+ "IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON": "{0}, purchased on {1}",
+ "IDS_DETAILS_EXTRA_PURCHASED_LABEL": "Extra purchased",
+ "IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL": "Purchased on {0}",
+ "IDS_DETAILS_FEATURED_TRAILER_TITLE": "Official trailer",
+ "IDS_DETAILS_FEATURED_WATCH_TRAILER": "Play trailer",
+ "IDS_DETAILS_FILE_OPEN_LABEL": "Open file",
+ "IDS_DETAILS_GAME_PURCHASED_LABEL": "Game purchased",
+ "IDS_DETAILS_GENRE_LABEL": "Genres",
+ "IDS_DETAILS_HUB_MUSIC_ALBUMS": "Show all available albums from this artist.",
+ "IDS_DETAILS_HUB_TV_SEASONS": "Show all available seasons from this series.",
+ "IDS_DETAILS_LATEST_EPISODE_LABEL": "New episode available",
+ "IDS_DETAILS_METADATA_SEPERATOR": " • ",
+ "IDS_DETAILS_MORE_ACTION": "More",
+ "IDS_DETAILS_MY_ALBUMS": "In Collection",
+ "IDS_DETAILS_NETWORK_LABEL": "Network",
+ "IDS_DETAILS_NEW_EPISODE_LABEL": "New episode",
+ "IDS_DETAILS_NOT_RATED_LABEL": "NR",
+ "IDS_DETAILS_NOT_RATED_LONG_LABEL": "Not rated",
+ "IDS_DETAILS_OVERVIEW": "overview",
+ "IDS_DETAILS_PERC_WATCHED_LABEL": "{0}% watched",
+ "IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE": "Choose an app",
+ "IDS_DETAILS_PLATFORM_LABEL": "Platform",
+ "IDS_DETAILS_PLAY_ALBUM_BUTTON": "Play album",
+ "IDS_DETAILS_PLAY_NOW_LABEL": "Play",
+ "IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_ON_XBOX_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL": "Start radio",
+ "IDS_DETAILS_PLAY_SEASON_BUTTON": "Play series",
+ "IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL": "Play Smart DJ",
+ "IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL": "Play song on Xbox",
+ "IDS_DETAILS_PLAY_TRAILER_LABEL": "Play trailer",
+ "IDS_DETAILS_PLAYLIST_NO_SONGS": "no songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONG_COUNT": "1 song in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_COUNT": "{0} songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_PLURAL": "[[1]{0} song in playlist][[*]{0} songs in playlist]",
+ "IDS_DETAILS_PREVIEW_ALBUM_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_ARTIST_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_EPISODE_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_SONG_LABEL": "Preview",
+ "IDS_DETAILS_PUBLISHER_LABEL": "Publisher",
+ "IDS_DETAILS_QUALITY_LABEL": "Quality",
+ "IDS_DETAILS_RATING_LABEL": "Rating",
+ "IDS_DETAILS_RATING_USERRATED": "Your rating",
+ "IDS_DETAILS_RATINGS_PLURAL": "[[1]{0} rating][[*]{0} ratings]",
+ "IDS_DETAILS_RECENT_ALBUMS": "Latest Albums",
+ "IDS_DETAILS_RELATED_ARTISTS": "Related Artists",
+ "IDS_DETAILS_RELEASE_DATE_LABEL": "Release date",
+ "IDS_DETAILS_REVIEW_LABEL": "Review",
+ "IDS_DETAILS_SEASONS_LABEL": "Series",
+ "IDS_DETAILS_SHUFFLE_ALL": "Shuffle all",
+ "IDS_DETAILS_SIMILAR_MOVIES": "Similar Films",
+ "IDS_DETAILS_START_DOWNLOAD_LABEL": "Start download",
+ "IDS_DETAILS_STUDIO_LABEL": "Studio",
+ "IDS_DETAILS_TITLE_NAR": "Details for {0}",
+ "IDS_DETAILS_TOP_SONGS": "Top Songs",
+ "IDS_DETAILS_TRACK_NUM_FORMAT": "{0}.",
+ "IDS_DETAILS_TRACKS_LABEL": "Songs",
+ "IDS_DETAILS_TRY_AGAIN_LABEL": "Try again",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_HD": "Try again (HD)",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_SD": "Try again (SD)",
+ "IDS_DETAILS_TVSERIES_SEASONS": "seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_ALL": "all seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_LOCAL": "my seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL": "Show all seasons",
+ "IDS_DETAILS_UNRATED_LABEL": "UR",
+ "IDS_DETAILS_UNRATED_LONG_LABEL": "Unrated",
+ "IDS_DETAILS_VIDEO_HUB_RELATED": "you may also like",
+ "IDS_DETAILS_VIDEO_HUB_RELATED_UC": "YOU MAY ALSO LIKE",
+ "IDS_DETAILS_VIEW_FULL_APP": "Explore app",
+ "IDS_DETAILS_VIEW_FULL_ARTIST": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_GAME": "Explore game",
+ "IDS_DETAILS_VIEW_FULL_MOVIE": "Explore film",
+ "IDS_DETAILS_VIEW_FULL_SEASON": "Show seasons",
+ "IDS_DETAILS_VIEW_FULL_SERIES": "Explore series",
+ "IDS_DETAILS_VIEW_MORE": "Show more",
+ "IDS_DETAILS_WATCH_NOW_LABEL": "Watch",
+ "IDS_DETAILS_WATCH_ON_XBOX_LABEL": "Buy/rent",
+ "IDS_DETAILS_WATCH_TRAILER_LABEL": "Watch trailer",
+ "IDS_DIALOG_ERROR_CODE": "STATUS CODE",
+ "IDS_DIALOG_ERROR_FEEDBACKLINK": "Give Microsoft feedback about this problem",
+ "IDS_DIALOG_ERROR_MORE_INFO": "Find help for this",
+ "IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE": "Your session has timed out. Try again?",
+ "IDS_DIALOG_SESSION_TIMED_OUT_TITLE": "Lost connection.",
+ "IDS_DIALOG_UNEXPECTED_ERROR_CAPTION": "There's a problem.",
+ "IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD": "Can't download",
+ "IDS_DOWNLOAD_ERROR_CAPTION": "Can't download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL": "Cancel all",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD": "Cancel Download",
+ "IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS": "There were problems with your download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS": "Tap a song to retry, or cancel a download to see detailed info on a problem.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS": "Retry all downloads",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD": "Retry download",
+ "IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER": "Try again later",
+ "IDS_DOWNLOAD_LABEL": "Keep Offline",
+ "IDS_EDIT_BUTTON": "Edit",
+ "IDS_EDITBOX_ERROR_NUMBER": "Use numbers in this field.",
+ "IDS_EDITBOX_REMAINING_PLURAL": "[[1]{0} character remaining][[*]{0} characters remaining]",
+ "IDS_EMPTY_VIEW": "There's nothing to show here right now. Please check back later.",
+ "IDS_FAILED_PANEL_HEADER": "We can't connect to Xbox services right now.",
+ "IDS_FAILED_PANEL_LABEL": "Make sure you have internet access, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_DESC": "To use Xbox services, connect to the internet, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_HEADER": "Your PC is offline.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE": "We've enabled new features! To see them, please restart this app.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE": "New features available",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER": "App update",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED": "Please restart the app.",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED": "Restart for new features.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY": "Could not download to your library. That path is no longer available. If you are using external storage, make sure it's available and connected.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG": "Download cancelled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT": "Download cancelled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOADED": "Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG": "Some things didn't download ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT": "Problem downloading ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG": "You're low on storage space",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT": "You're low on storage space",
+ "IDS_FILTER_ALL": "all",
+ "IDS_FILTER_ALL_GENRES": "all genres",
+ "IDS_FILTER_ALL_GENRES_SC": "All genres",
+ "IDS_FILTER_ALL_SUBGENRES_SC": "All subgenres",
+ "IDS_FILTER_BY": "By",
+ "IDS_FILTER_SORTED_BY": "arranged by",
+ "IDS_GLOBAL_COMMAND_HELP": "Help",
+ "IDS_GLOBAL_COMMAND_HOME": "Home",
+ "IDS_GLOBAL_COMMAND_NOW_PLAYING": "Now Playing",
+ "IDS_GLOBAL_COMMAND_RESTORE_PURCHASES": "Restore purchases",
+ "IDS_GLOBAL_COMMAND_SEARCH": "Search",
+ "IDS_HHMMSS_DURATION": "{0}:{1}:{2}",
+ "IDS_HOME_NOW_PLAYING": "Now Playing",
+ "IDS_HOME_NOW_PLAYING_EPISODE": "Now Playing - {0}",
+ "IDS_HOME_NOW_PLAYING_JUMP_IN": "Jump in",
+ "IDS_HOME_NOW_PLAYING_LC": "now playing",
+ "IDS_HOME_NOW_PLAYING_RESUME": "Resume",
+ "IDS_HOME_NOW_PLAYING_RESUME_ARIA": "Resume - {0}",
+ "IDS_HOME_NOW_PLAYING_XBOX": "On your Xbox",
+ "IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED": "Last played on your Xbox",
+ "IDS_HOME_PIVOT": "home",
+ "IDS_HOME_TILE_PAUSED_LABEL": "paused",
+ "IDS_LOADING_STATUS_LABEL": "Loading",
+ "IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR": "Add folder",
+ "IDS_MANAGE_FOLDERS_DESCRIPTION": "Right now, we're watching these folders:",
+ "IDS_MANAGE_FOLDERS_DONE_BUTTON": "Done",
+ "IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR": "Exclude folder",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT": "To remove this folder, add another one first.",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE": "Your collection needs at least one folder to work.",
+ "IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION": "Media Browser",
+ "IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION": "Media Player",
+ "IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION": "Media Player Preview",
+ "IDS_MANIFEST_MUSIC_APP_DESCRIPTION": "Music",
+ "IDS_MANIFEST_MUSIC_APP_NAME": "Music",
+ "IDS_MANIFEST_TEST_APP_DESCRIPTION": "Xbox on Windows",
+ "IDS_MANIFEST_VIDEO_APP_DESCRIPTION": "Video",
+ "IDS_MANIFEST_VIDEO_APP_NAME": "Video",
+ "IDS_MARKETPLACE_BY_PLAYRANK": "by most played",
+ "IDS_MARKETPLACE_PIVOT": "all music",
+ "IDS_MARKETPLACE_REGION_EMPTY": "There is nothing available in your region just yet. Please check back soon!",
+ "IDS_MARKETPLACE_SORT_BEST_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_CRITIC_RATING": "critic rating",
+ "IDS_MARKETPLACE_SORT_PLAY_RANK": "most played",
+ "IDS_MARKETPLACE_SORT_POPULARITY": "most played",
+ "IDS_MARKETPLACE_SORT_RELEASE_DATE": "release date",
+ "IDS_MARKETPLACE_SORT_SALES_RANK": "top selling",
+ "IDS_MARKETPLACE_SORT_TITLE": "title",
+ "IDS_MARKETPLACE_SORT_TOP_RENTED": "top rented",
+ "IDS_MARKETPLACE_SORT_TOP_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_USER_RATING": "customer rating",
+ "IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION": "In collection",
+ "IDS_MEDIA_ERROR_CAPTION": "Media problem.",
+ "IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON": "Song Download Error",
+ "IDS_MEDIA_STATUS_DOWNLOADING_ICON": "Song is Downloading",
+ "IDS_MEDIA_STATUS_INLINE_STREAMING_ICON": "Media is available for streaming",
+ "IDS_MEDIA_STATUS_NOW_PLAYING_ICON": "Song is playing",
+ "IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON": "Sorry, can't play. Please try again.",
+ "IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your monthly streaming limit.",
+ "IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your play limit for this song.",
+ "IDS_MEDIATYPE_ALBUM": "Album",
+ "IDS_MEDIATYPE_ARTIST": "Artist",
+ "IDS_MEDIATYPE_GAME": "Xbox 360 game",
+ "IDS_MEDIATYPE_GAME_WINDOWS": "Windows game",
+ "IDS_MEDIATYPE_MOVIE": "Film",
+ "IDS_MEDIATYPE_PLAYLIST": "Playlist",
+ "IDS_MEDIATYPE_SONG": "Song",
+ "IDS_MEDIATYPE_TVEPISODE": "TV Episode",
+ "IDS_MEDIATYPE_TVSEASON": "TV Season",
+ "IDS_MEDIATYPE_TVSERIES": "TV Series",
+ "IDS_MMSS_DURATION": "{0}:{1}",
+ "IDS_MODIFIER_PREFIX_SORTBY": "arrange by:",
+ "IDS_MODIFIER_PREFIX_VIEW": "show:",
+ "IDS_MODIFIER_PREFIX_VIEWBY": "arrange by",
+ "IDS_MOGO_NOW_PLAYING": "Now playing",
+ "IDS_MOGO_NOW_PLAYING_XBOXMUSIC": "Now playing on Xbox Music",
+ "IDS_MOGO_NOW_PLAYING_XBOXVIDEO": "Now playing on Xbox Video",
+ "IDS_MOGO_RESUME": "Resume",
+ "IDS_MOGO_XBOX_MUSIC_XENON": "{0} Xbox Music",
+ "IDS_MOGO_XBOX_VIDEO_XENON": "{0} Xbox Video",
+ "IDS_MUSIC_ALBUMS_PIVOT": "albums",
+ "IDS_MUSIC_ALBUMS_PIVOT_TC": "Albums",
+ "IDS_MUSIC_APP_TITLE": "music",
+ "IDS_MUSIC_APP_TITLE_TC": "Music",
+ "IDS_MUSIC_ARTISTS_PIVOT": "artists",
+ "IDS_MUSIC_ARTISTS_PIVOT_TC": "Artists",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY": "Music automatically finds songs in your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library at your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX": "Xbox Music automatically finds songs in your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library at your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK": "Tap for more info.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE": "Add music to your Windows music library.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY": "Learn how to fix it",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY": "We think we can help. Tap to learn more.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE": "It looks like a lot of your music isn't showing up right.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY": "Choose where we look",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE": "We're adding music from this PC.",
+ "IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} album added to your music][[*]{0} albums added to your music]",
+ "IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} artist added to your music][[*]{0} artists added to your music]",
+ "IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE": "You have nothing in the cloud just yet.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1": "Listen to millions of songs for free.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2": "Enjoy your music on all your PCs.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE": "Free",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC": "These are songs you own that aren't available in the cloud. To make them available, tap Add To and choose Cloud Collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE": "No icon",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC": "You can play these songs whether you're online or offline. This icon appears beside anything that's available in the cloud and anything you've downloaded using Xbox Music Pass.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE": "Available here and in the cloud",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC": "You can play these songs whenever you're online and signed in. While playing songs from Xbox Music, you'll see or hear occasional ads. To avoid interruptions, sign up for Xbox Music Pass and enjoy unlimited listening to millions of songs.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE": "Streaming only",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT": "You'll see the following icons on songs and albums in your music collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE": "Icons in your music collection",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_DESC": "Tap to learn about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_TITLE": "Tell me about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_BODY": "Your music in the cloud will automatically appear on your other Windows 8/Windows RT devices.\n\nWith Xbox Music Pass, you'll also see your cloud music on your phone and Xbox 360.",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK": "Learn more about Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE": "Music in the cloud",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY": "If you're not seeing all your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE": "All done! We've added the music from this PC.",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1": "Added your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1": "Adding your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG": "{0} song",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS": "{0} songs",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing your PC's Music library.",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE": "We didn't find any music on this PC.",
+ "IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY": "Learn more about how it works",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY": "Tap to learn more.",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE": "Your collection now includes music you've added from Xbox Music.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1": "Enjoy your pass on your mobile devices.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2": "Enjoy ad-free listening.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3": "Download songs to listen to later",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE": "Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} song added to your music][[*]{0} songs added to your music]",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2": "Also available on other devices",
+ "IDS_MUSIC_COLLECTION_EMPTY_DESC": "Find new tunes and old favourites.",
+ "IDS_MUSIC_COLLECTION_EMPTY_TITLE": "No music in your collection",
+ "IDS_MUSIC_COLLECTION_PIVOT": "my music",
+ "IDS_MUSIC_COLLECTION_PIVOT_TC": "My Music",
+ "IDS_MUSIC_DEVICES_PIVOT": "devices",
+ "IDS_MUSIC_DEVICES_PIVOT_TC": "Devices",
+ "IDS_MUSIC_EXPLORE_PIVOT": "explore",
+ "IDS_MUSIC_EXPLORE_PIVOT_TC": "Explore",
+ "IDS_MUSIC_FEATURED_PIVOT": "featured",
+ "IDS_MUSIC_GENRES_PIVOT": "genres",
+ "IDS_MUSIC_LOCATION_DMZ": "Temporary Cache",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_DESC": "Try a different genre or filter.",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_TITLE": "There's nothing to show here",
+ "IDS_MUSIC_MARKETPLACE_PIVOT": "all music",
+ "IDS_MUSIC_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_MUSIC_PIVOT": "music",
+ "IDS_MUSIC_RADIO_PIVOT": "radio",
+ "IDS_MUSIC_RADIO_PIVOT_TC": "Radio",
+ "IDS_MUSIC_SONGS_PIVOT_TC": "Songs",
+ "IDS_MUSIC_STORE_PIVOT": "store",
+ "IDS_MUSIC_STORE_PIVOT_TC": "Store",
+ "IDS_MUSIC_TOP_ALBUMS_PIVOT": "top",
+ "IDS_MUSIC_VIEW_PLAYLIST": "Show song list",
+ "IDS_MY_MUSIC_BUTTON_DESC": "My music",
+ "IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE": "My Music",
+ "IDS_N_FILTER_IN": "{0} {1}",
+ "IDS_N_SORTED_BY": "{0} {1} arranged by",
+ "IDS_NAV_PANE_HIDE_MENU": "Hide menu",
+ "IDS_NAV_PANE_SHOW_MENU": "Show menu",
+ "IDS_NETWORK_STATUS_HEADER": "Network status",
+ "IDS_NETWORK_STATUS_LOCAL_ONLY": "Now local only",
+ "IDS_NETWORK_STATUS_NONE": "Offline",
+ "IDS_NETWORK_STATUS_OVER_THE_LIMIT": "Over data limit",
+ "IDS_NETWORK_STATUS_ROAMING": "Roaming",
+ "IDS_NETWORK_STATUS_THROTTLED": "Limited network",
+ "IDS_NETWORK_STATUS_UNRESTRICTED": "Now unrestricted",
+ "IDS_NEXT_BUTTON": "Next",
+ "IDS_NO_BUTTON": "No",
+ "IDS_NOT_AVAILABLE_OFFLINE": "Not available offline",
+ "IDS_NOW_PLAYING_DETAILS_BUTTON": "Details",
+ "IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION": "Add this album to my music",
+ "IDS_NOW_PLAYING_OP_ADD_SONG_ACTION": "Add this song to my music",
+ "IDS_NOW_PLAYING_OP_BIO_ACTION": "Check out the bio",
+ "IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION": "See other albums from this artist",
+ "IDS_NOW_PLAYING_OP_RADIO_ACTION": "Start radio",
+ "IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION": "Save this as a playlist",
+ "IDS_NOW_PLAYING_OP_SHARE_ACTION": "Share with a friend",
+ "IDS_NOW_PLAYING_OP_SMARTDJ_ACTION": "Play Smart DJ",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION": "Play top songs",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION": "Play top songs for this related artist",
+ "IDS_NOW_PLAYING_PANEL_TITLE_LC": "now playing",
+ "IDS_NOW_PLAYING_PLAYLIST_BUTTON": "Now playing",
+ "IDS_NOW_PLAYING_REMOVE_TRACK_ACTION": "Remove from list",
+ "IDS_NUMBER_SYMBOL": "#",
+ "IDS_OK_BUTTON": "OK",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE": "Next Page",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE": "Previous Page",
+ "IDS_PIN_TO_START_LINK_ERROR_TEXT": "Sorry, we can't find that. It might have been moved or deleted.",
+ "IDS_PIN_TO_START_SCREEN_BUTTON": "Pin to start",
+ "IDS_PLAY_ALL": "Play all",
+ "IDS_PLAY_ALL_DESC": "Shuffle all music",
+ "IDS_PLAY_ALL_LABEL": "Play all music",
+ "IDS_PLAY_ALL_SHUFFLED": "Play all shuffled",
+ "IDS_PLAY_BUTTON": "Play",
+ "IDS_PLAY_BUTTON_VIDEO": "Play",
+ "IDS_PLAYBACK_DURATION_PROGRESS": "{0}/{1}",
+ "IDS_PLAYBACK_ERROR_MESSAGE_TITLE": "Can't play.",
+ "IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE": "This song isn't available when you're offline. To play it, connect to the internet.",
+ "IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE": "Try a different playlist.",
+ "IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED": "To play this song, you need to sign in.",
+ "IDS_PLAYLIST_BUTTON_DESC": "Playlists",
+ "IDS_PROGRESS_NAR": "{0} of {1}",
+ "IDS_PROVISIONING_ACCEPT_BUTTON": "I Accept",
+ "IDS_PROVISIONING_ACCEPTANCE_DESC": "Clicking \"I Accept\" means you have read and agree to the following:",
+ "IDS_PROVISIONING_ALREADY_HAVE_BUTTON": "Already have an Xbox profile?",
+ "IDS_PROVISIONING_ALREADY_HAVE_DESC": "Choose Cancel and sign in with your other Microsoft account.",
+ "IDS_PROVISIONING_CANCEL_BUTTON": "Cancel",
+ "IDS_PROVISIONING_CHILD_LIST_COMEBACK": "{0}. Come back here",
+ "IDS_PROVISIONING_CHILD_LIST_SIGNIN": "{0}. Click here to sign in",
+ "IDS_PROVISIONING_CHILD_LIST_TITLE": "Do the following:",
+ "IDS_PROVISIONING_CHILD_LIST_XBOX_LINK": "{0}. Create your profile at Xbox.com",
+ "IDS_PROVISIONING_CHILD_SUBTITLE": "To create your profile, please go to Xbox.com. You'll need a parent to approve it.",
+ "IDS_PROVISIONING_CHILD_TITLE": "Parent Needed",
+ "IDS_PROVISIONING_EXPLANATION": "Adding an online Xbox membership to your Microsoft account lets you participate in great Xbox gaming and entertainment.",
+ "IDS_PROVISIONING_PRIVACY_LINK": "Privacy Statement",
+ "IDS_PROVISIONING_TITLE": "To continue, create an Xbox profile",
+ "IDS_PROVISIONING_TOS_LINK": "Xbox Terms of Use",
+ "IDS_PROVISIONING_USER_EMAIL": "Your login: {0}",
+ "IDS_PURCHASE_ERROR_CAPTION": "There's a problem.",
+ "IDS_PURCHASE_ERROR_MESSAGE": "Sorry, we can't complete your purchase right now.",
+ "IDS_PURCHASE_ERROR_MESSAGE_TITLE": "Try again later",
+ "IDS_RADIO_ERROR_CAPTION": "Radio",
+ "IDS_READ_LESS": "Read less",
+ "IDS_READ_MORE": "Read more",
+ "IDS_RECENT_LAST_WEEK": "last week",
+ "IDS_RECENT_THIS_MONTH": "this month",
+ "IDS_RECENT_THIS_WEEK": "this week",
+ "IDS_REMOVE_BUTTON": "Remove",
+ "IDS_RENT_BUTTON": "Rent",
+ "IDS_RESTART_BUTTON": "Restart",
+ "IDS_RESUME_BUTTON": "Resume",
+ "IDS_SAVE_BUTTON": "Save",
+ "IDS_SEARCH_ALBUMLOCAL_LABEL": "Album \nCollection \n({0})",
+ "IDS_SEARCH_ALBUMMARKETPLACE_LABEL": "Music Store: \nAlbums \n({0})",
+ "IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL": "Albums ({0})",
+ "IDS_SEARCH_ALBUMS_PIVOT_LABEL": "albums ({0})",
+ "IDS_SEARCH_ALBUMS_RESULT_TITLE": "Album results for \"{0}\"",
+ "IDS_SEARCH_ALL_PIVOT_LABEL": "all results ({0})",
+ "IDS_SEARCH_ARTISTLOCAL_LABEL": "Artist \nCollection \n({0})",
+ "IDS_SEARCH_ARTISTMARKETPLACE_LABEL": "Music Store: \nArtists \n({0})",
+ "IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL": "Artists ({0})",
+ "IDS_SEARCH_ARTISTS_PIVOT_LABEL": "artists ({0})",
+ "IDS_SEARCH_ARTISTS_RESULT_TITLE": "Artist results for \"{0}\"",
+ "IDS_SEARCH_BUTTON": "Search",
+ "IDS_SEARCH_FILTER_ALL": "all results",
+ "IDS_SEARCH_FILTER_COLLECTION": "My videos",
+ "IDS_SEARCH_FILTER_MARKETPLACE": "all music",
+ "IDS_SEARCH_FILTER_MARKETPLACE_VIDEO": "Xbox Video Store",
+ "IDS_SEARCH_HCR_WITH_KEYWORD_NAR": "Best match for {0}",
+ "IDS_SEARCH_INMYVIDEOS_LABEL": "in my videos",
+ "IDS_SEARCH_MODIFIER_PIVOT_LABEL": "All",
+ "IDS_SEARCH_MOVIELOCAL_LABEL": "My \nFilms \n({0})",
+ "IDS_SEARCH_MOVIEMARKETPLACE_LABEL": "Video Store: \nFilms \n({0})",
+ "IDS_SEARCH_MUSICHUB_TITLE": "music ({0})",
+ "IDS_SEARCH_NORESULT_TITLE": "no results for \"{0}\"",
+ "IDS_SEARCH_NORESULT_TITLE_TC": "No Results for \"{0}\"",
+ "IDS_SEARCH_NOTSIGNEDIN": "Sign in to see full results.",
+ "IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL": "My \nvideos \n({0})",
+ "IDS_SEARCH_PIVOT": "search",
+ "IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL": "Playlists ({0})",
+ "IDS_SEARCH_PLAYLISTS_PIVOT_LABEL": "playlists ({0})",
+ "IDS_SEARCH_RESULT_TITLE": "results for \"{0}\"",
+ "IDS_SEARCH_RESULT_TITLE_TC": "Results for \"{0}\"",
+ "IDS_SEARCH_SEARCHSTARTED": "searching...",
+ "IDS_SEARCH_SONGLOCAL_LABEL": "My \nSongs \n({0})",
+ "IDS_SEARCH_SONGMARKETPLACE_LABEL": "Music Store: \nSongs \n({0})",
+ "IDS_SEARCH_SONGS_GROUP_HEADER_LABEL": "Songs ({0})",
+ "IDS_SEARCH_SONGS_PIVOT_LABEL": "songs ({0})",
+ "IDS_SEARCH_TRACKS_RESULT_TITLE": "Song results for \"{0}\"",
+ "IDS_SEARCH_TVSERIESLOCAL_LABEL": "My \nTV Programmes \n({0})",
+ "IDS_SEARCH_TVSERIESMARKETPLACE_LABEL": "Video Store: \nTV Programmes \n({0})",
+ "IDS_SEARCH_VIDEOHUB_TITLE": "videos ({0})",
+ "IDS_SEE_ALL_BUTTON": "Show all",
+ "IDS_SEE_LESS_BUTTON": "Show less",
+ "IDS_SEE_MORE_BUTTON": "Show more",
+ "IDS_SERVICE_UNAVAILABLE_CAPTION": "Sorry, the Xbox service isn't available right now.",
+ "IDS_SET_BUTTON": "Set",
+ "IDS_SETTINGS_ABOUT_ABOUT_ADS": "About our ads",
+ "IDS_SETTINGS_ABOUT_CODE_CONDUCT": "Code of Conduct",
+ "IDS_SETTINGS_ABOUT_DESCRIPTION": "This computer program is protected by copyright law and international treaties. Unauthorised reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.",
+ "IDS_SETTINGS_ABOUT_LEARN_MORE": "Learn more at Xbox.com",
+ "IDS_SETTINGS_ABOUT_ONLINE_CONTENT": "Online content",
+ "IDS_SETTINGS_ABOUT_PRERELEASE_VERSION": "Version: {0} ({1}, {2}{3})",
+ "IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT": "Privacy statement",
+ "IDS_SETTINGS_ABOUT_SUPPORT": "Support",
+ "IDS_SETTINGS_ABOUT_TITLE": "About",
+ "IDS_SETTINGS_ABOUT_TOS": "Terms of Service",
+ "IDS_SETTINGS_ABOUT_VERSION_FORMAT": "{0}.{1}.{2}.{3}",
+ "IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC": "Billing History",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC": "Billing Contact Information",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC": "Contact Preferences",
+ "IDS_SETTINGS_ACCOUNT_CURRENT_USER": "You're signed in as {0}",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC": "Manage Xbox Music Devices",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC": "Manage Payment Options",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC": "Get Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL": "Trial 14 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH": "Free 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH": "Free 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH": "Free 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC": "Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH": "1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH": "Prepaid 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH": "Prepaid 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH": "Prepaid 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL": "Trial 30 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH": "12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC": "Privacy and Online Settings",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC": "Enter a code to get a Gold Membership, Xbox Music Pass, or other stuff (where available).",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC": "Redeem Code",
+ "IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC": "Sign Out",
+ "IDS_SETTINGS_ACCOUNT_TITLE": "Account",
+ "IDS_SETTINGS_ACCOUNT_TITLE_TC": "My Account",
+ "IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC": "Your Account",
+ "IDS_SETTINGS_CAPTIONS_AUTO_MUTED": "Show captions when sound is muted",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR": "Caption background colour",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY": "Background transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR": "Character colour",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY": "Character transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE": "Character size",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLACK": "black",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLUE": "blue",
+ "IDS_SETTINGS_CAPTIONS_COLOR_CYAN": "cyan",
+ "IDS_SETTINGS_CAPTIONS_COLOR_GREEN": "green",
+ "IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA": "magenta",
+ "IDS_SETTINGS_CAPTIONS_COLOR_RED": "red",
+ "IDS_SETTINGS_CAPTIONS_COLOR_WHITE": "white",
+ "IDS_SETTINGS_CAPTIONS_COLOR_YELLOW": "yellow",
+ "IDS_SETTINGS_CAPTIONS_DEFAULT": "default",
+ "IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE": "Character edge style",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED": "depressed",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DROP": "dropshadow",
+ "IDS_SETTINGS_CAPTIONS_EDGE_NONE": "none",
+ "IDS_SETTINGS_CAPTIONS_EDGE_RAISED": "raised",
+ "IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED": "uniform",
+ "IDS_SETTINGS_CAPTIONS_FONT_CASUAL": "casual",
+ "IDS_SETTINGS_CAPTIONS_FONT_CURSIVE": "cursive",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS": "monospaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF": "monospaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS": "proportionally spaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF": "proportionally spaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS": "small capitals",
+ "IDS_SETTINGS_CAPTIONS_FONT_STYLE": "Font style",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE": "solid",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT": "semi-transparent",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT": "transparent",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW": "Preview",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE": "Caption preview",
+ "IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT": "Reset to default",
+ "IDS_SETTINGS_CAPTIONS_SIZE_100": "100% (default)",
+ "IDS_SETTINGS_CAPTIONS_SIZE_150": "150%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_200": "200%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_50": "50%",
+ "IDS_SETTINGS_CAPTIONS_TITLE": "Captions",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_COLOR": "Window colour",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY": "Window transparency",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE": "Automatically download songs here after you add or buy them on other devices",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE": "Automatically download songs here after you buy them on other devices",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC": "Buying music",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS": "Please tell us about your experience, including relevant album, song, and artist names. The more details, the better!",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO": "Buying or renting a video",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS": "Tell us about your experience, including relevant series name, season number, episode name and film title. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_CANCEL": "Cancel",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN": "Cannot sign in",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS": "Please tell us about your experience. The more details, the better!",
+ "IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW": "Viewing my collection",
+ "IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION": "Comments",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED": "Connected device",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS": "Please tell us about your experience, including the type of device you are using.",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT": "Problem with store info (wrong art, wrong name, etc.)",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK": "Media playback",
+ "IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY": "Discovering content",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION": "Thanks for your feedback! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG": "Thanks for your feedback, {0}! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC": "Downloading music",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO": "Downloading a video",
+ "IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY": "Auto-playing next episode",
+ "IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS": "Please tell us about what you were doing when you had the error occur.",
+ "IDS_SETTINGS_FEEDBACK_GENERALERRORS": "General error",
+ "IDS_SETTINGS_FEEDBACK_GHOSTTEXT": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_GREATAPP": "Great app",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT": "Music format",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS": "Please tell us about your experience, including the formats or file types you are needing to use.",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA": "Music metadata",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS": "Please give us your feedback, including relevant album and artist names and a description of the problem encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_NOCONNECTION": "Connect to the internet to submit your feedback.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE": "Problem in the app (error, confusing behaviour, etc.)",
+ "IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE": "Problem with the way something plays or appears in the app",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION": "Choose a category for your feedback and enter your comments below.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE": "Dislike",
+ "IDS_SETTINGS_FEEDBACK_OPTION_LIKE": "Like",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC": "Playing music",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS": "Please tell us about your experience, including whether you were playing your own music or songs from Xbox.",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO": "Playing a video",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS": "Please tell us about your experience, including whether you were playing your own video or something from Xbox Video.",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS": "Please provide artist, album and/or track name and describe the issue encountered.",
+ "IDS_SETTINGS_FEEDBACK_REQUESTCONTENT": "Request content",
+ "IDS_SETTINGS_FEEDBACK_SAS_TEXT": "Want to report an issue?",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC": "Music streaming",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS": "Please tell us about your experience, including relevant album, song, artist names, and if you're using a subscription. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO": "Streaming a video",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS": "Please tell us about your experience, including relevant series name, season number, episode name, film title, and if you were attempting to download or stream the video. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUBMIT": "Submit",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION": "Suggestion",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS": "Please tell us about changes you would like to see. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS": "Got Ideas?",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC": "Go to the Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO": "Go to the Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC": "Go to the Xbox Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO": "Go to the Xbox Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SYNC": "Sync/cloud",
+ "IDS_SETTINGS_FEEDBACK_TITLE": "Feedback",
+ "IDS_SETTINGS_FEEDBACK_TRAILER": "Watching a trailer",
+ "IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS": "Please tell us about your experience, including any relevant titles. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO": "Go to XboxVideoUserVoice.com and tell us what we should add.",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT": "Video format",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS": "Please tell us about your experience, including the formats or file types you want to use.",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC": "Wrong music info",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS": "Please give us your feedback including relevant album, song, artist names and a description of the problem you encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_WRONGVIDEO": "Wrong video info",
+ "IDS_SETTINGS_FORGET_ME": "Remove",
+ "IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE": "{0}%",
+ "IDS_SETTINGS_HELP_TITLE": "Help",
+ "IDS_SETTINGS_PREFERENCE_ACCOUNT": "Switch users",
+ "IDS_SETTINGS_PREFERENCE_TITLE": "Preferences",
+ "IDS_SETTINGS_PROMPT_TOGGLE_TITLE": "Ask me to sign in before completing purchases or managing my account",
+ "IDS_SETTINGS_SWITCH_USER": "Switch users",
+ "IDS_SETTINGS_SWITCH_USER_DESCRIPTION": "This app is designed for use by one person at a time. To switch users, select Remove. This will sign you out of the app and reset all app settings. Signing out will not delete any music or videos.",
+ "IDS_SETTINGS_TITLE": "Settings",
+ "IDS_SHARE_EMPTY_MESSAGE_ALBUM": "Sorry, that album can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_ARTIST": "Sorry, that artist can't be shared because they're not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MOVIE": "Sorry, that film can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MUSIC": "To share something, select an artist, album, or song.",
+ "IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO": "Sorry, that video can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TRACK": "Sorry, that song can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE": "Sorry, that episode can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SEASON": "Sorry, that season can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SERIES": "Sorry, that series can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_VIDEO": "First, choose a film or TV programme to share.",
+ "IDS_SHARE_FILES_MUSIC_DESCRIPTION": "Files from the Music app",
+ "IDS_SHARE_FRIEND_REQUEST": "{0} wants to be friends!",
+ "IDS_SHARE_FRIEND_REQUEST_LINK": "Add them on {0}Xbox.com{1}",
+ "IDS_SHARE_GAME_TEXT": "Check out {0}",
+ "IDS_SHARE_LEADER_BOARD_TEXT": "In {0}, {1} ranks {2} among their friends",
+ "IDS_SHARE_MORE_MICROSOFT_DOT_COM": "See more at {0}Microsoft.com{1}",
+ "IDS_SHARE_MORE_XBOX_DOT_COM": "See more at {0}Xbox.com{1}",
+ "IDS_SHARE_MORE_XBOXVIDEO_DOT_COM": "See more at {0}XboxVideo.com{1}",
+ "IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_SHARE_MUSIC_CONCATENATION": "{0} {1}",
+ "IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL": "[[1]{0} playlist][[*]{0} playlists]",
+ "IDS_SHARE_MUSIC_SONG_COUNT_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_SHARE_PROFILE": "Share profile",
+ "IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT": "{0} unlocked the {1} achievement in {2}",
+ "IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT": "{0} hasn't unlocked the {1} achievement in {2}",
+ "IDS_SHARE_TELL_FRIEND_ADD": "Tell your friends to add you",
+ "IDS_SHOW_ALL_MODIFIER": "show all",
+ "IDS_SHOW_FEATURED_MODIFIER": "show featured",
+ "IDS_SIGNIN_COMPLETE": "Signed in",
+ "IDS_SIGNIN_ERROR": "Can't sign in",
+ "IDS_SIGNIN_ERROR_CAPTION": "Sign in",
+ "IDS_SIGNIN_ERROR_MORE_INFO": "More info",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_DESC": "You can still use this app, but the app needs to restart. Click close to restart the app.",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_TITLE": "The region for your Xbox profile is different from your Windows region.",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT": "Click here to sign in",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE": "Sign In",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT": "Get the most from your apps",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE": "Sign up with Xbox",
+ "IDS_SIGNIN_PROGRESS": "Signing in",
+ "IDS_SIGNIN_RETRY": "Try again",
+ "IDS_SMARTDJ_ERROR_CAPTION": "Smart DJ",
+ "IDS_SNAPPED_DETAILS_OVERVIEW_TITLE": "overview",
+ "IDS_SNAPPED_DETAILS_PLAYLIST_TITLE": "playlist",
+ "IDS_SNAPPED_DETAILS_POSTROLL_TITLE": "what's next",
+ "IDS_SNAPPED_DETAILS_RECOMMEND_LABEL": "recommended",
+ "IDS_SNAPPED_DETAILS_REPLAY_LABEL": "Play Again",
+ "IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL": "Shuffle",
+ "IDS_SNAPPED_GO_FULLSCREEN_MESSAGE": "To start something, go to full screen.",
+ "IDS_SNAPPED_MUSIC_HEADER": "Start listening",
+ "IDS_SNAPPED_MUSIC_UNSNAP_TEXT": "Find something to play",
+ "IDS_SNAPPED_VIDEO_UNSNAP_TEXT": "Find something to watch",
+ "IDS_SOCIAL_PIVOT": "social",
+ "IDS_SORT_FILTER_CONTROL_ACC_FILTER": "Filter",
+ "IDS_SORT_FILTER_CONTROL_ACC_SORT": "Sort",
+ "IDS_SORTED_BY": "{0} by",
+ "IDS_SWIPE_HORIZONTALLY_TO_SELECT": "Swipe left to select",
+ "IDS_SWIPE_VERTICALLY_TO_SELECT": "Swipe down to select",
+ "IDS_TIME_ARIA_ZERO": "0:0",
+ "IDS_TIME_DISPLAY_ZERO": "0:00",
+ "IDS_TOS_ACCEPT_BUTTON": "I Accept",
+ "IDS_TOS_ACCEPT_CHECKBOX": "I accept the Xbox Live Terms of Use agreement",
+ "IDS_TOS_ACCEPT_ERROR": "You must accept the Terms of Use to proceed.",
+ "IDS_TOS_CANCEL": "Cancel",
+ "IDS_TOS_TEXT_HEADER": "Please review and accept",
+ "IDS_TOS_TITLE": "Attention",
+ "IDS_TOS_UPDATE_DESC": "The Xbox Terms of Use have recently been updated. Please review and accept the new Terms of Use agreement before you sign in.",
+ "IDS_TOS_UPDATE_HEADER": "Updated Terms of Use",
+ "IDS_TOUCHPAD_SUBTITLE1": "press and slide",
+ "IDS_TOUCHPAD_SUBTITLE2": "tap to select",
+ "IDS_TOUCHPAD_TITLE": "select",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL": "Closed captioning",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE": "Not available",
+ "IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON": "No speakers or headphones.",
+ "IDS_TRANSPORT_CONTROLS_MUTE_LABEL": "Mute",
+ "IDS_TRANSPORT_CONTROLS_NEXT_BUTTON": "Next",
+ "IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON": "Pause",
+ "IDS_TRANSPORT_CONTROLS_PLAY_BUTTON": "Play",
+ "IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON": "Play here",
+ "IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON": "Play on Xbox",
+ "IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON": "Playback options",
+ "IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON": "Previous",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON": "Repeat",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON": "Repeat: off",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON": "Repeat: on",
+ "IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON": "Resume on Xbox",
+ "IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL": "Progress bar",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON": "Shuffle",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON": "Shuffle: off",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON": "Shuffle: on",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON": "Turn repeat off",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON": "Turn repeat on",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON": "Turn shuffle off",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON": "Turn shuffle on",
+ "IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL": "Unmute",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON": "Volume \n{0}",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON": "Muted",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL": "Volume",
+ "IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON": "Remote",
+ "IDS_TV_SEASON_NAME": "Season {0}",
+ "IDS_TV_SEASON_NAME_LC": "season {0}",
+ "IDS_UNKNOWN_VALUE": "unknown",
+ "IDS_UNPIN_FROM_START_SCREEN_BUTTON": "Unpin from start",
+ "IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION": "Click to get Windows 8.1",
+ "IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT": "To use Xbox services, get the latest version of the app.",
+ "IDS_VERSION_CHECK_SERVICE_TITLE": "Update available",
+ "IDS_VERSION_CHECK_SIGNIN_TEXT": "Get the latest version of the app.",
+ "IDS_VERSION_CHECK_UPGRADE_CAPTION": "Your app needs an update.",
+ "IDS_VERSION_CHECK_UPGRADE_LINK": "Get the update",
+ "IDS_VERSION_CHECK_UPGRADE_TEXT": "To keep using this app, get the latest version at the Windows Store.",
+ "IDS_VIDEO_APP_TITLE": "video",
+ "IDS_VIDEO_COLLECTION_EMPTY": "Videos you purchase from Xbox Video will appear here.",
+ "IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK": "Xbox Video home",
+ "IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK": "Search",
+ "IDS_VIDEO_FEATURED_PIVOT": "featured",
+ "IDS_VIDEO_GENRES_PIVOT": "genres",
+ "IDS_VIDEO_NETWORKS_PIVOT": "networks",
+ "IDS_VIDEO_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_VIDEO_PIVOT": "videos",
+ "IDS_VIDEO_STUDIOS_PIVOT": "studios",
+ "IDS_VIDEO_TOP_SELLING_PIVOT": "top selling",
+ "IDS_VIDEO_TV_FREE_EPISODES_PIVOT": "free tv",
+ "IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT": "last night's programmes",
+ "IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK": "Film store",
+ "IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK": "My videos",
+ "IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK": "TV store",
+ "IDS_VIEW_ALL": "Show all",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT": "Next",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION": "Do you want us to ask for your password every time you make a purchase? You can change this preference later in Settings, Preferences.",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE": "Password prompt for purchase?",
+ "IDS_WEBHOST_RESIZE_WINDOW_BODY": "Make your window larger or rotate your device.",
+ "IDS_WEBHOST_RESIZE_WINDOW_TITLE": "Your screen needs to be wider",
+ "IDS_WEBHOST_ROTATE_BODY": "To use this feature, change your screen orientation by turning your device.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_BODY": "To work correctly, this feature needs more of your screen. Increase the size of the app window or rotate your device to continue.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY": "Increase the size of the app window (turning your device if needed).",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE": "The app needs more width on your screen to continue",
+ "IDS_WEBHOST_ROTATE_TITLE": "Please rotate your device",
+ "IDS_WHATSNEW_NOTIFICATION_SUBTITLE": "Click to see what's better",
+ "IDS_WHATSNEW_POPUP_LINK": "Read the full release notes",
+ "IDS_XBOX_GET_FOR_XBOX": "Get for Xbox 360",
+ "IDS_XBOX_MUSIC_APP_TITLE": "xbox music",
+ "IDS_XBOX_PLAY_TO_DEVICE": "Play To",
+ "IDS_XBOX_VIDEO_APP_TITLE": "xbox video",
+ "IDS_YES_BUTTON": "Yes",
+ "101": "Unknown Song %d",
+ "102": "Unknown Album (%s %s)",
+ "103": "Unknown Album (",
+ "104": "Unknown Artist",
+ "105": "Unknown Song",
+ "106": "the ;",
+ "108": "Various Artists",
+ "109": "Unknown Album",
+ "110": "Unknown Genre",
+ "250": "Unknown Song",
+ "251": "Unknown Artist",
+ "252": "Unknown Album",
+ "258": "Unknown Series",
+ "259": "Unknown Video",
+ "260": "Unknown Series",
+ "261": "We couldn't determine the original series for these podcast episodes. To subscribe, select one or more episodes and enter a URL.",
+ "262": "Couldn't determine the URL for this podcast series. To subscribe to it, select one or more episodes and enter a URL.",
+ "320": "Music",
+ "321": "TV",
+ "322": "Shorts",
+ "323": "Series %1!02d!",
+ "324": "Films",
+ "325": "Xbox Music Pass",
+ "326": "Purchases",
+ "328": "Subscription Cache",
+ "329": "Downloading",
+ "360": "%1: %2",
+ "361": "audiobook",
+ "362": "audiobook",
+ "363": "comedy / spoken word",
+ "364": "podcast",
+ "365": "karaoke",
+ "5000": "Xbox Event Log",
+ "607": "Smart DJ",
+ "609": "Resume playing",
+ "610": "Shuffle all music",
+ "611": "Podcasts",
+ "612": "Podcast Folder",
+ "613": "Podcast Folder",
+ "618": "Xbox temporary converted files",
+ "619": "OneDrive Cache",
+ "IDS_VIDEO_ALL_FEATURED_SETS_GALLERY_TITLE": "all featured sets",
+ "IDS_VIDEO_ERROR_DETAILS": "Xbox Video isn't available right now.",
+ "IDS_VIDEO_ERROR_HEADER": "Check back soon",
+ "IDS_VIDEO_FEATURED_MOVIES_TITLE": "Featured Films",
+ "IDS_VIDEO_FEATURED_SETS_TITLE": "Featured Sets",
+ "IDS_VIDEO_FEATURED_TV_TITLE": "Featured TV",
+ "IDS_VIDEO_LAST_NIGHT_SHOWS_TITLE": "Last Night's Programmes",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_ADD": "Add videos to your collection",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_ADD_DESCRIPTION": "There are no videos in your collection. Sign in or tell us where to look.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_DESCRIPTION": "Browse new, featured, and top films and TV.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_MOVIES": "Browse films",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_TV": "Browse TV",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE": "Choose where we look",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE_DESCRIPTION": "We'll add videos from any folders you have on this PC.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN": "Sign in",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN_DESCRIPTION": "Sign in to your Xbox Video account to see your films and TV programmes.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP": "Sign up",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP_DESCRIPTION": "Get an Xbox Video account and start watching.",
+ "IDS_VIDEO_LX_COLLECTION_FILTER_ALL": "All videos",
+ "IDS_VIDEO_LX_COLLECTION_FILTER_CLOUD": "In the cloud",
+ "IDS_VIDEO_LX_COLLECTION_FILTER_PC": "On this PC",
+ "IDS_VIDEO_LX_COLLECTION_MODIFIER_MOVIES": "Films",
+ "IDS_VIDEO_LX_COLLECTION_MODIFIER_PERSONAL": "Personal Videos",
+ "IDS_VIDEO_LX_COLLECTION_MODIFIER_TV": "TV",
+ "IDS_VIDEO_LX_COLLECTION_PIVOT": "collection",
+ "IDS_VIDEO_LX_COLLECTION_PIVOT_TC": "Collection",
+ "IDS_VIDEO_LX_COLLECTION_SORT_ALPHA": "By A to Z",
+ "IDS_VIDEO_LX_COLLECTION_SORT_DATE": "By date added",
+ "IDS_VIDEO_LX_COLLECTION_VIDEO_COUNT": "{0}",
+ "IDS_VIDEO_LX_DELETE_CONFIRM_COLLECTION": "You're about to delete {0} from your collection.",
+ "IDS_VIDEO_LX_DELETE_CONFIRM_PC": "You're about to delete {0} from this PC.",
+ "IDS_VIDEO_LX_DELETE_CONFIRM_PC_AND_COLLECTION": "You're about to delete {0} from this PC and your collection.",
+ "IDS_VIDEO_LX_DELETE_FROM_COLLECTION": "Delete from your collection",
+ "IDS_VIDEO_LX_DELETE_FROM_PC": "Delete from this PC",
+ "IDS_VIDEO_LX_DELETE_FROM_PC_AND_COLLECTION": "Delete from this PC and your collection",
+ "IDS_VIDEO_LX_DETAILS_CAST_AND_CREW_TITLE": "Cast",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_DURATION": "Duration",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_FILE_SIZE": "File Size",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_GENRE": "Genre",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_NETWORK": "Network",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_PARENTAL_RATING": "Age Rating",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_PRIMARY_LANG": "Primary Language",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_RELEASE_DATE": "Release Date",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_STUDIO": "Studio",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_SUBTITLES": "Subtitles",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_TITLE": "Information",
+ "IDS_VIDEO_LX_DETAILS_HEADER_EPISODE_TITLE": "{0}. {1}",
+ "IDS_VIDEO_LX_DETAILS_HEADER_LINK_SUBTITLES": "Subtitles",
+ "IDS_VIDEO_LX_DETAILS_HEADER_SERIES_SEASON_SUBTITLE": "{0} - {1}",
+ "IDS_VIDEO_LX_DETAILS_ROTTEN_TOMATOES_TITLE": "Rotten Tomatoes",
+ "IDS_VIDEO_LX_DETAILS_SIZE_GB_HD_FORMAT": "{0} GB (HD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_GB_SD_FORMAT": "{0} GB (SD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_MB_HD_FORMAT": "{0} MB (HD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_MB_SD_FORMAT": "{0} MB (SD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_SEPARATOR": " / ",
+ "IDS_VIDEO_LX_MOVIE_FEATURED_GALLERY_TITLE": "Featured Films",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_GENRES": "All genres",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_STUDIOS": "All studios",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RATED": "Top Rated",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RENTALS": "Top Rentals",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_SELLING": "Top Selling",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_TITLE": "Top Films",
+ "IDS_VIDEO_LX_MOVIE_NEW_GALLERY_TITLE": "New Films",
+ "IDS_VIDEO_LX_MOVIES_STORE_PIVOT": "Film store",
+ "IDS_VIDEO_LX_MOVIES_STORE_PIVOT_TC": "Film Store",
+ "IDS_VIDEO_LX_SEARCH": "Search",
+ "IDS_VIDEO_LX_SEARCH_ALL_EMPTY_DESC": "Try searching for something else.",
+ "IDS_VIDEO_LX_SEARCH_ALL_EMPTY_TITLE": "Sorry, we couldn't find that in your videos or the store.",
+ "IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_DESC": "Tap \"In collection\" to see results from your collection.",
+ "IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_TITLE": "Sorry, we didn't find that in the store.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE": "We don't see that in your collection or the store",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_DESC": "Tap \"Store\" to see results from Xbox Video.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE": "Sorry, we didn't find that in your collection.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG": "Sorry, we didn't find that in your collection.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER": "In collection ({0})",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_MAX_RESULTS": "In collection ({0}+)",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_NO_COUNT": "In collection",
+ "IDS_VIDEO_LX_SEARCH_MODIFIER_ALL": "All",
+ "IDS_VIDEO_LX_SEARCH_MODIFIER_MOVIES": "Films",
+ "IDS_VIDEO_LX_SEARCH_MODIFIER_TV": "TV",
+ "IDS_VIDEO_LX_SEARCH_MY_EMPTY_DESC": "Try searching the store.",
+ "IDS_VIDEO_LX_SEARCH_MY_EMPTY_LINK": "Show results from all videos",
+ "IDS_VIDEO_LX_SEARCH_MY_EMPTY_TITLE": "Sorry, we didn't find that in your collection.",
+ "IDS_VIDEO_LX_SEARCH_PIVOT_COLLECTION": "Collection",
+ "IDS_VIDEO_LX_SEARCH_PIVOT_STORE": "Store",
+ "IDS_VIDEO_LX_SEARCH_STORE_FILTER": "Store ({0})",
+ "IDS_VIDEO_LX_SEARCH_STORE_FILTER_MAX_RESULTS": "Store ({0}+)",
+ "IDS_VIDEO_LX_SEARCH_STORE_FILTER_NO_COUNT": "Store",
+ "IDS_VIDEO_LX_TV_FEATURED_GALLERY_TITLE": "Featured TV",
+ "IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_GENRES": "All genres",
+ "IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_NETWORKS": "All networks",
+ "IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_RATED": "Top Rated",
+ "IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_SELLING": "Top Selling",
+ "IDS_VIDEO_LX_TV_GALLERY_TITLE": "Top TV Shows",
+ "IDS_VIDEO_LX_TV_LAST_NIGHT_GALLERY_TITLE": "Last Night's TV",
+ "IDS_VIDEO_LX_TV_NEW_GALLERY_TITLE": "New TV Programmes",
+ "IDS_VIDEO_LX_TV_STORE_PIVOT": "TV store",
+ "IDS_VIDEO_LX_TV_STORE_PIVOT_TC": "TV Store",
+ "IDS_VIDEO_LX_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT": "Once you update, you can use Xbox services like watching downloaded films or TV programmes.",
+ "IDS_VIDEO_LX_VERSION_CHECK_SERVICE_TITLE": "Update Xbox Video to keep watching",
+ "IDS_VIDEO_NEW_MOVIES_TITLE": "New Films",
+ "IDS_VIDEO_NEW_TV_TITLE": "New TV Programmes",
+ "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL": "Track {0}",
+ "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL_EXTENDED": "Track {0}: {1}",
+ "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACKS_BUTTON": "Audio tracks",
+ "IDS_VIDEO_OFFLINE_DETAILS": "Connect to the internet, then we'll be able to show you more",
+ "IDS_VIDEO_OFFLINE_HEADER": "Looks like you're offline",
+ "IDS_VIDEO_STREAMING_QUALITY_OVERLAY_BODY": "Show streaming quality overlay on video playback:",
+ "IDS_VIDEO_STREAMING_QUALITY_SELECTOR_BODY": "Stream the video in selected bitrate:",
+ "IDS_VIDEO_STREAMING_QUALITY_SELECTOR_OPTION_AUTOMATIC": "Automatic",
+ "IDS_VIDEO_STREAMING_QUALITY_SETTINGS_TITLE": "Streaming Quality",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_HEADER": "First, remove a device",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_1": "Choose a device you no longer want to use for downloads from the store.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_2": "On that device, launch the Video app, go to Settings > Download devices and click Remove this device from your list of registered devices. Then you'll be able to download on this device.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_SHOWDEVICES_LINK": "Show my devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXCONSOLES_ERROR_HEADER": "First, remove one of your other Xbox consoles",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPC_ERROR_HEADER": "First, remove a device",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPHONE_ERROR_HEADER": "First, remove one of your other phones",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXTABLET_ERROR_HEADER": "First, remove one of your other tablets",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_RENTAL_ERROR_MESSAGE": "To download this rental, remove one of your other devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_HELP_LINK": "Help me with this",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_OFFLINE_ERROR_HEADER": "Please connect to the internet",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_CLOSE_BUTTON": "Close",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_1": "You can download purchases and rentals on multiple devices.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_2": "To remove one, sign in on that device, then go to Settings > Download devices and click Remove this device from your list of registered devices.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_HEADER": "Download devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_LINK": "Show my download devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_HEADER": "Please try again later",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_MESSAGE": "Sorry, our download service is not available",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_CANCEL": "Cancel",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_HEADER": "This also removes downloaded purchases and rentals",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_MESSAGE": "You can still download them again later, but you will not be able to remove another device in the next 30 days.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_REMOVE": "Remove",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_LINK": "Remove this device",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_HEADER": "Try again in {0} days",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_MESSAGE": "You can remove only one device per month from the devices you use for Store downloads.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_NOTIME_HEADER": "Try again next month",
+ "IDS_VIDEO_TOP_MOVIE_RENTALS_TITLE": "Top Film Rentals",
+ "IDS_VIDEO_TOP_RATED_MOVIES_TITLE": "Top Rated Films",
+ "IDS_VIDEO_TOP_RATED_TV_TITLE": "Top Rated TV",
+ "IDS_VIDEO_TOP_SELLING_MOVIES_TITLE": "Top Films",
+ "IDS_VIDEO_TOP_SELLING_TV_TITLE": "Top TV Programmes",
+ "IDS_VIDEO1_MANAGE_FOLDERS_TITLE": "Build your collection from your local video files",
+ "IDS_VIDEO1_SEARCH_PROMPT_TITLE": "Search for films, TV programmes, or your own videos",
+ "IDS_ALL_VIDEO_COLLECTION_TITLE": "all",
+ "IDS_CHANGE_TV_SEASON_LABEL": "Change series",
+ "IDS_DIALOG_PURCHASE_DURING_GROVEL_CAPTION": "We're syncing your purchases now. You'll be able to buy things, and play things you have already bought, in a few minutes",
+ "IDS_DIALOG_PURCHASE_DURING_GROVEL_TITLE": "Please try again soon.",
+ "IDS_FILTER_ALL_GENRES_2": "All genres",
+ "IDS_FILTER_ALL_NETWORKS_LC": "all networks",
+ "IDS_FILTER_ALL_STUDIOS_LC": "all studios",
+ "IDS_MARKETPLACE_FEATURED_MOVIES": "Featured films",
+ "IDS_MARKETPLACE_FEATURED_TELEVISION": "Featured TV",
+ "IDS_MARKETPLACE_FREE_TV": "Free TV",
+ "IDS_MARKETPLACE_LAST_NIGHT_ON_TV": "Last Night's Programmes",
+ "IDS_MARKETPLACE_MOVIE_FEATURED_LC": "featured films",
+ "IDS_MARKETPLACE_MOVIE_NEW_RELEASE_LC": "new films",
+ "IDS_MARKETPLACE_MOVIE_TOP_RATED_LC": "top rated films",
+ "IDS_MARKETPLACE_MOVIE_TOP_RENTED_LC": "top film rentals",
+ "IDS_MARKETPLACE_MOVIE_TOP_SALES_LC": "top selling films",
+ "IDS_MARKETPLACE_NEW_RELEASES": "New Releases",
+ "IDS_MARKETPLACE_SORT_CRITIC_RATING_2": "Critic rating",
+ "IDS_MARKETPLACE_SORT_RELEASE_DATE_2": "Release date",
+ "IDS_MARKETPLACE_SORT_TOP_RENTED_2": "Top rented",
+ "IDS_MARKETPLACE_SORT_TOP_SELLING_2": "Top selling",
+ "IDS_MARKETPLACE_SORT_USER_RATING_2": "Customer rating",
+ "IDS_MARKETPLACE_TOP_MOVIE_RENTALS": "top rentals",
+ "IDS_MARKETPLACE_TOP_MOVIE_RENTALS_2": "Top rentals",
+ "IDS_MARKETPLACE_TOP_MOVIE_SALES": "top selling",
+ "IDS_MARKETPLACE_TOP_MOVIE_SALES_2": "Top selling",
+ "IDS_MARKETPLACE_TOP_TV_PURCHASES": "Top Selling TV",
+ "IDS_MARKETPLACE_TOP_VIDEO_SALES": "top selling",
+ "IDS_MARKETPLACE_TOP_VIDEO_SALES_2": "Top selling",
+ "IDS_MARKETPLACE_TV_FEATURED_LC": "featured tv programmes",
+ "IDS_MARKETPLACE_TV_NEW_RELEASE_LC": "new tv programmes",
+ "IDS_MARKETPLACE_TV_TOP_RATED_LC": "top rated tv",
+ "IDS_MARKETPLACE_TV_TOP_SALES_LC": "top selling tv",
+ "IDS_MODIFIER_PREFIX_VIEWBY_2": "View by",
+ "IDS_MOVIE_COLLECTION_TITLE": "films",
+ "IDS_MOVIE_HERO_HEADING": "film details",
+ "IDS_MOVIE_MARKETPLACE_TITLE_LC": "film store",
+ "IDS_MOVIE_MARKETPLACE_TITLE_TC": "Film Store",
+ "IDS_MOVIE_PLAY_MOVIE_BUTTON": "Play film",
+ "IDS_MOVIE_STUDIO_BROWSE_TITLE": "STUDIOS - {0}",
+ "IDS_OTHER_VIDEO_COLLECTION_TITLE": "personal videos",
+ "IDS_TV_COLLECTION_TITLE": "tv programmes",
+ "IDS_TV_DOWNLOAD_SEASON_BUTTON": "Download season",
+ "IDS_TV_DOWNLOAD_SEASON_BUTTON_HD": "Download season (HD)",
+ "IDS_TV_DOWNLOAD_SEASON_BUTTON_SD": "Download season (SD)",
+ "IDS_TV_EPISODE_LABEL": "{0} episode",
+ "IDS_TV_EPISODE_NAME_NUMBER_FORMAT": "Episode {0}: {1}",
+ "IDS_TV_EPISODES_LABEL": "{0} episodes",
+ "IDS_TV_EPISODES_LABEL_PLURAL": "[[1]{0} episode][[*]{0} episodes]",
+ "IDS_TV_MARKETPLACE_TITLE_LC": "tv store",
+ "IDS_TV_MARKETPLACE_TITLE_TC": "TV Store",
+ "IDS_TV_NETWORK_BROWSE_TITLE": "NETWORKS - {0}",
+ "IDS_TV_NEW_EPISODE_HEADING": "This week's episode",
+ "IDS_TV_NOEPISODES_LABEL": "{0} episodes",
+ "IDS_TV_NUMBERED_EPISODE_0_NAME": "Extra",
+ "IDS_TV_NUMBERED_EPISODE_0_SEASON_NAME": "Season {0} extras",
+ "IDS_TV_NUMBERED_EPISODE_NAME": "Episode {0}",
+ "IDS_TV_NUMBERED_EPISODE_SEASON_NAME": "Season {0}, episode {1}",
+ "IDS_TV_NUMBERED_EPISODE_SEASON_TITLE": "Season {0}, episode {1}, \"{2}\"",
+ "IDS_TV_OWNED_EPISODES_LABEL": "{0} owned",
+ "IDS_TV_OWNED_EPISODES_LABEL_PLURAL": "[[*]{0} owned]",
+ "IDS_TV_PLAY_EPISODE_BUTTON": "Play episode",
+ "IDS_TV_SEASON_0_NAME": "Extras",
+ "IDS_TV_SEASON_0_NAME_LC": "extras",
+ "IDS_TV_SEASON_EXTRAS_HEADING_LC": "season extras",
+ "IDS_TV_SEASON_EXTRAS_HEADING_SC": "Season extras",
+ "IDS_TV_SEASON_EXTRAS_HEADING_UC": "SEASON EXTRAS",
+ "IDS_TV_SEASONS_LABEL_PLURAL": "[[1]{0} season][[*]{0} seasons]",
+ "IDS_TV_SERIES_EXTRAS_HEADING": "Series extras",
+ "IDS_TV_SERIES_EXTRAS_HEADING_LC": "series extras",
+ "IDS_TV_SERIES_EXTRAS_HEADING_UC": "SERIES EXTRAS",
+ "IDS_TV_SERIES_RATING_LABEL": "Series rating",
+ "IDS_VIDEO_AVAILABLE_OFFLINE": "Downloaded (available offline)",
+ "IDS_VIDEO_BUFFERING_SMOOTH": "Buffering...",
+ "IDS_VIDEO_BUNDLE_ITEMS_IN_BUNDLE": "In Bundle",
+ "IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_BUTTON": "Various ({0})",
+ "IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_METADATA": "Various audio languages",
+ "IDS_VIDEO_BUNDLES_DETAILS_BUY_BUTTON": "Buy Bundle",
+ "IDS_VIDEO_BUNDLES_DETAILS_VIEW_IN_COLLECTION_BUTTON": "View in collection",
+ "IDS_VIDEO_BUNDLES_DISABLED_BUTTON": "In collection",
+ "IDS_VIDEO_BUNDLES_PRE_PURCHASE_ITEM": "Pre-purchase",
+ "IDS_VIDEO_CANT_DELETE": "Can't delete.",
+ "IDS_VIDEO_CAST_ACTOR": "Actor",
+ "IDS_VIDEO_CAST_ACTORS": "Actors",
+ "IDS_VIDEO_CAST_CREATOR": "Creator",
+ "IDS_VIDEO_CAST_CREATORS": "Creators",
+ "IDS_VIDEO_CAST_DIRECTOR": "Director",
+ "IDS_VIDEO_CAST_DIRECTORS": "Directors",
+ "IDS_VIDEO_CAST_HEADING": "cast",
+ "IDS_VIDEO_CAST_HEADING_UC": "CAST",
+ "IDS_VIDEO_CAST_WRITER": "Writer",
+ "IDS_VIDEO_CAST_WRITERS": "Writers",
+ "IDS_VIDEO_COLLECTION_ALPHA_SORT": "a to z",
+ "IDS_VIDEO_COLLECTION_ALPHA_SORT_2": "A to Z",
+ "IDS_VIDEO_COLLECTION_ARTIST_SORT": "artist",
+ "IDS_VIDEO_COLLECTION_DATEADDED_SORT": "date added",
+ "IDS_VIDEO_COLLECTION_DATEADDED_SORT_2": "Date added",
+ "IDS_VIDEO_COLLECTION_DURATION_SORT": "duration",
+ "IDS_VIDEO_COLLECTION_EMPTY_DESC": "Find films at the Xbox Video Store",
+ "IDS_VIDEO_COLLECTION_EMPTY_TITLE": "No videos in your collection",
+ "IDS_VIDEO_COLLECTION_GENRE_SORT": "genre",
+ "IDS_VIDEO_COLLECTION_GENRE_SORT_2": "Genre",
+ "IDS_VIDEO_COLLECTION_MOVIES_PIVOT": "my films",
+ "IDS_VIDEO_COLLECTION_MOVIES_PIVOT_UC": "YOUR FILMS",
+ "IDS_VIDEO_COLLECTION_PIVOT": "personal videos",
+ "IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT": "release year",
+ "IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT_2": "Release year",
+ "IDS_VIDEO_COLLECTION_SERIES_EPISODES": "episodes arranged by series",
+ "IDS_VIDEO_COLLECTION_SERIES_EPISODES_2": "Episodes arranged by series",
+ "IDS_VIDEO_COLLECTION_SERIES_SEASONS": "seasons arranged by series",
+ "IDS_VIDEO_COLLECTION_SERIES_SEASONS_2": "Seasons arranged by series",
+ "IDS_VIDEO_COLLECTION_SETS_PIVOT_UC": "YOUR SETS",
+ "IDS_VIDEO_COLLECTION_STUDIO_SORT": "studio",
+ "IDS_VIDEO_COLLECTION_TV_PIVOT": "my tv",
+ "IDS_VIDEO_COLLECTION_TV_PIVOT_UC": "YOUR TV",
+ "IDS_VIDEO_COLLECTION_WISHLIST_PIVOT_UC": "YOUR WISHLIST",
+ "IDS_VIDEO_DASH_FEATURED_SETS_LC": "featured sets",
+ "IDS_VIDEO_DASH_FEATURED_SETS_UC": "FEATURED SETS",
+ "IDS_VIDEO_DASH_MOVIE_FEATURED_LC": "featured films",
+ "IDS_VIDEO_DASH_MOVIE_FEATURED_UC": "FEATURED FILMS",
+ "IDS_VIDEO_DASH_MOVIE_NEW_LC": "new films",
+ "IDS_VIDEO_DASH_MOVIE_NEW_UC": "NEW FILMS",
+ "IDS_VIDEO_DASH_SPOTIGHT_UC": "SPOTLIGHT",
+ "IDS_VIDEO_DASH_TV_FEATURED_LC": "featured tv programmes",
+ "IDS_VIDEO_DASH_TV_FEATURED_UC": "FEATURED TV PROGRAMMES",
+ "IDS_VIDEO_DASH_TV_NEW_LC": "new tv programmes",
+ "IDS_VIDEO_DASH_TV_NEW_UC": "NEW TV PROGRAMMES",
+ "IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC": "Choose a different program or try again later.",
+ "IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE": "Sorry, we can't take you there",
+ "IDS_VIDEO_DELETE_SERIES_BUTTON": "Delete series",
+ "IDS_VIDEO_DETAILS_COMMERCE_HEADER_FORMAT": "{0}. {1}",
+ "IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASE_SC": "Pre-purchase",
+ "IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASED_SC": "Pre-purchased",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_DOWNLOAD_TIME_DISCLAIMER": "Download times estimated for a basic broadband (1.5 Mbps) connection.",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD": "HD - {0}. Higher quality, approx. {1} to download",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD_SIMPLE": "HD - Higher quality, download takes longer and takes up more memory",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_NEVER_SHOW": "Set as the default for this device.",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_HD": "HD - High Definition",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT": "Ask me each time I download a video",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT_SHORT": "Ask me each time",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_QUESTION": "Always download my HD videos on this device in:",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD": "SD - Standard Definition (smaller size)",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD_SHORT": "SD - Standard Definition",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_TITLE": "Download Quality",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD": "SD - {0}. Lower quality, approx. {1} to download",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD_SIMPLE": "SD - Lower quality, faster download and takes up less memory",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_GB": "{0} GB",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_HOURS": "{0}h",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_MB": "{0} MB",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_TITLE": "Select download quality:",
+ "IDS_VIDEO_DOWNLOAD_COMPLETE": "Download complete",
+ "IDS_VIDEO_DOWNLOAD_ERROR": "Download error",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL": "Cancel",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL_ALL": "Cancel all",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_CLOSE": "Close",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COMPLETE": "Complete",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING": "Copying",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_NOT_COMPLETE": "Copying not completing?",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_SLOW": "Copying... may take ~{0} min",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_STAY": "Stay in the app while we finish up",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_DONE": "Done",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_GB_SIZE": "{0} GB",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_LINK": "Active downloads",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_MB_SIZE": "{0} MB",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_NO_DOWNLOADS": "Nothing is downloading right now.\n\n Completed downloads will appear in your video collection.",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_NO_TEMP_SPACE": "Can’t download (drive C needs temp space)",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE": "Pause",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE_ALL": "Pause all",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PENDING": "Pending",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_LONG": "{0}% downloaded",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_SHORT": "{0}%",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_RESUME": "Resume",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_RESUME_All": "Resume all",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_RETRY": "Retry",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_TITLE": "Active downloads",
+ "IDS_VIDEO_DOWNLOAD_MORE_INFO": "More info",
+ "IDS_VIDEO_DOWNLOAD_NOTIFICATION": "Downloading...",
+ "IDS_VIDEO_DOWNLOAD_PAUSED": "Downloads paused",
+ "IDS_VIDEO_DOWNLOAD_PROGRESS_ITEMS_PLURAL": "[[1]{0} item remaining][[*]{0} items remaining]",
+ "IDS_VIDEO_DOWNLOAD_SLOWED_ON_BATTERY": "To conserve power, your download might be slowed. For the quickest download, keep this app on screen or connect to AC power.",
+ "IDS_VIDEO_DOWNLOAD_TO_WATCH_OFFLINE": "Download to watch offline",
+ "IDS_VIDEO_FIND_SOMETHING_TO_PLAY": "Find something to play",
+ "IDS_VIDEO_GET_FOR_XBOX360": "Get for Xbox",
+ "IDS_VIDEO_GET_FOR_XBOX360_APPBAR": "Get for Xbox",
+ "IDS_VIDEO_IN_COLLECTION_LABEL": "In my videos",
+ "IDS_VIDEO_ITEM_CAN_ONLY_BE_STREAMED": "This item can only be streamed.",
+ "IDS_VIDEO_ITEM_CANT_BE_STREAMED_DOWNLOAD_FIRST": "This item can't be streamed. To play, download it first.",
+ "IDS_VIDEO_ITEM_PURCHASED_IN_OTHER_REGION": "This item was purchased in a region different from the region for your account.",
+ "IDS_VIDEO_ITEM_UNAVAILABLE_BETWEEN": "Can't be streamed or downloaded from {0}. To make sure you get it, download before {1}.",
+ "IDS_VIDEO_MAKE_SURE_FILE_ISNT_IN_USE_READONLY": "Make sure that the file isn't in use and isn't read-only.",
+ "IDS_VIDEO_MARKETPLACE_EMPTY_DESC": "Try a different genre or filter.",
+ "IDS_VIDEO_MARKETPLACE_EMPTY_TITLE": "There's nothing to show here",
+ "IDS_VIDEO_MARKETPLACE_TITLE_LC": "video store",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE1": "If you're sure your network is fast enough for streaming, choose HD or SD stream. To ensure uninterrupted viewing, or to watch offline, choose HD or SD download instead.",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE2": "You won't be charged yet.",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DOWNLOAD_OPTION": "Download film to this device to watch offline",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_STREAMING_OPTION": "Stream film online",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_TITLE": "Film rental options",
+ "IDS_VIDEO_NEW_SEASON_NOTIFICATION": "New season",
+ "IDS_VIDEO_NOW_PLAYING": "now playing",
+ "IDS_VIDEO_ON_BATTERY": "Downloads might be slower on battery power.",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_KNOWN": "Available on {0}",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_UNKNOWN": "Coming soon",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DAYS_PLURAL": "[[1]Available in {0} day][[*]Available in {0} days]",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_HOURS_PLURAL": "[[1]Available in {0} hour][[*]Available in {0} hours]",
+ "IDS_VIDEO_PREPURCHASE_DETAILS_BUY": "Pre-purchase",
+ "IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_KNOWN": "Come back and watch it as soon as it's released. Estimated release date: {0}.",
+ "IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_UNKNOWN": "Come back and watch it as soon as it's released. ",
+ "IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_KNOWN": "Buy now and watch it as soon as it's released. Estimated release date: {0}.",
+ "IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_UNKNOWN": "Buy now and watch it as soon as it's released.",
+ "IDS_VIDEO_PREVIEW_BROWSE_BUTTON": "Play all trailers",
+ "IDS_VIDEO_PREVIEW_BUY_RENT_BUTTON": "Get this film",
+ "IDS_VIDEO_PREVIEW_NOT_AVAILABLE": "The trailer isn't available",
+ "IDS_VIDEO_PRICE_FREE": "Free",
+ "IDS_VIDEO_PRICE_FREE_WITH_ADS": "Free with ads",
+ "IDS_VIDEO_PRICE_HD": "HD {0}",
+ "IDS_VIDEO_PRICE_HD_SD": "HD {0} SD {1}",
+ "IDS_VIDEO_PRICE_ON_SALE": "On sale!",
+ "IDS_VIDEO_PRICE_PERCENT_OFF": "{0} ({1}% off)",
+ "IDS_VIDEO_PRICE_SD": "SD {0}",
+ "IDS_VIDEO_PRICE_STARTING_FROM": "from {0}",
+ "IDS_VIDEO_PRICE_SWITCH_HD": "Switch to HD",
+ "IDS_VIDEO_PRICE_SWITCH_SD": "Switch to SD",
+ "IDS_VIDEO_PURCHASE_OPTIONS_BUTTON": "Purchase options",
+ "IDS_VIDEO_PURCHASE_OPTIONS_BUY": "Buy {0}",
+ "IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_AUDIO_LANGUAGE": "{0} audio",
+ "IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_LANGUAGE": "{0} ({1})",
+ "IDS_VIDEO_PURCHASE_OPTIONS_HD": "HD",
+ "IDS_VIDEO_PURCHASE_OPTIONS_LANGUAGE": "Language",
+ "IDS_VIDEO_PURCHASE_OPTIONS_QUALITY": "Format",
+ "IDS_VIDEO_PURCHASE_OPTIONS_RENT": "Rent {0}",
+ "IDS_VIDEO_PURCHASE_OPTIONS_SD": "SD",
+ "IDS_VIDEO_PURCHASE_OPTIONS_TITLE": "Purchase Options",
+ "IDS_VIDEO_PURCHASED_LABEL": "Purchased",
+ "IDS_VIDEO_RECOMMEND_ALL_LC": "all recommendations",
+ "IDS_VIDEO_RECOMMEND_ALL_SC": "All recommendations",
+ "IDS_VIDEO_RECOMMEND_EMPTY_GALLERIES": "We don’t have any recommendations to show you right now. Check back later.",
+ "IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_LC": "films",
+ "IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_SC": "Films",
+ "IDS_VIDEO_RECOMMEND_MOVIES_LC": "recommended films",
+ "IDS_VIDEO_RECOMMEND_MOVIES_TITLE_TC": "Recommendations in Films",
+ "IDS_VIDEO_RECOMMEND_NOT_INTERESTED_LC": "Not interested",
+ "IDS_VIDEO_RECOMMEND_NOT_INTERESTED_TC": "Not Interested",
+ "IDS_VIDEO_RECOMMEND_TITLE_LC": "recommendations",
+ "IDS_VIDEO_RECOMMEND_TITLE_TC": "Recommendations",
+ "IDS_VIDEO_RECOMMEND_TITLE_UC": "RECOMMENDATIONS",
+ "IDS_VIDEO_RECOMMEND_TV_DROPDOWN_LC": "tv programmes",
+ "IDS_VIDEO_RECOMMEND_TV_DROPDOWN_SC": "TV programmes",
+ "IDS_VIDEO_RECOMMEND_TV_LC": "recommended tv",
+ "IDS_VIDEO_RECOMMEND_TV_TITLE_TC": "Recommendations in TV",
+ "IDS_VIDEO_RECOMMENDED": "recommended",
+ "IDS_VIDEO_RENTAL_EXPIRED": "Rental expired",
+ "IDS_VIDEO_RENTAL_EXPIRED_ONLY": "Expired",
+ "IDS_VIDEO_RENTAL_EXPIRES_AT": "Rental expires at {0}",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAY": "Expires in 1 day",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAY_HR": "Expires in 1 day 1 hr",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAY_HRS": "Expires in 1 day {0} hrs",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAYS": "Expires in {0} days",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAYS_HR": "Expires in {0} days 1 hr",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAYS_HRS": "Expires in {0} days {1} hrs",
+ "IDS_VIDEO_RENTAL_EXPIRES_HR": "Expires in 1 hr",
+ "IDS_VIDEO_RENTAL_EXPIRES_HR_MIN": "Expires in 1 hr 1 min",
+ "IDS_VIDEO_RENTAL_EXPIRES_HR_MINS": "Expires in 1 hr {0} mins",
+ "IDS_VIDEO_RENTAL_EXPIRES_HRS": "Expires in {0} hrs",
+ "IDS_VIDEO_RENTAL_EXPIRES_HRS_MIN": "Expires in {0} hrs 1 min",
+ "IDS_VIDEO_RENTAL_EXPIRES_HRS_MINS": "Expires in {0} hrs {1} mins",
+ "IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_HR": "Expires in less than 1 hour",
+ "IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_MIN": "Expires in less than 1 minute",
+ "IDS_VIDEO_RENTAL_EXPIRES_MIN": "Expires in 1 min",
+ "IDS_VIDEO_RENTAL_EXPIRES_MINS": "Expires in {0} mins",
+ "IDS_VIDEO_RENTAL_EXPIRES_ON": "Rental expires on {0}",
+ "IDS_VIDEO_REVIEW_HEADING": "reviews",
+ "IDS_VIDEO_REVIEW_ROTTEN_VIEW_MORE": "Read more reviews",
+ "IDS_VIDEO_SEARCH_ALL_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in Films or TV",
+ "IDS_VIDEO_SEARCH_ALL_RESULT_TITLE": "results for \"{0}\" in Films and TV",
+ "IDS_VIDEO_SEARCH_CAST_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in Cast",
+ "IDS_VIDEO_SEARCH_MOVIE_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in Films",
+ "IDS_VIDEO_SEARCH_MOVIE_RESULT_TITLE": "results for \"{0}\" in Films",
+ "IDS_VIDEO_SEARCH_TV_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in TV",
+ "IDS_VIDEO_SEARCH_TV_RESULT_TITLE": "results for \"{0}\" in TV",
+ "IDS_VIDEO_SEASON_PASS_EXPLANATION": "Buy a Series Pass to get all current and future episodes in the series",
+ "IDS_VIDEO_SETTINGS_PURCHASES_LABEL": "Purchases",
+ "IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_BUTTON": "Restore",
+ "IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_DESCRPTION": "To restore available video purchases, click Restore Purchases.",
+ "IDS_VIDEO_SETTINGS_PURCHASES_RESTORING_BUTTON": "Restoring...",
+ "IDS_VIDEO_SETTINGS_STARTUP_VIEW_DESC": "Open my personal videos when I start the app",
+ "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_BODY": "You’ll lose any videos you’ve rented recently. To keep your rentals, or to check that you’ve already watched them, tap Cancel.",
+ "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_SIGNOUT_BTN": "Sign out",
+ "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_TITLE": "If you sign out...",
+ "IDS_VIDEO_SPOTLIGHT": "home",
+ "IDS_VIDEO_STARTING_SMOOTH": "Starting...",
+ "IDS_VIDEO_STREAMING_DOWNLOAD_AVAILABLE": "Streaming (download available)",
+ "IDS_VIDEO_STREAMING_DOWNLOAD_TO_WATCH_OFFLINE": "Streaming (download to watch offline)",
+ "IDS_VIDEO_STREAMING_NOTIFICATION": "Streaming only",
+ "IDS_VIDEO_TILE_NEW_MOVIES_AMP_TV": "New films & TV",
+ "IDS_VIDEO_TILE_XBOX_VIDEO_TC": "Xbox Video",
+ "IDS_VIDEO_UPSELL_BROWSE_MOVIES_AND_TV_SC": "Browse films & TV",
+ "IDS_VIDEO_UPSELL_BROWSE_NEW_MOVIES_SC": "Browse new films",
+ "IDS_VIDEO_UPSELL_BROWSE_NEW_TV_SC": "Browse new TV",
+ "IDS_VIDEO_UPSELL_BROWSE_PERSONAL_SC": "Browse your personal videos",
+ "IDS_VIDEO_UPSELL_BUY_LABEL_SC": "Buy your favourite films and programmes and watch them on your Xbox consoles and Windows 8 tablets and PCs",
+ "IDS_VIDEO_UPSELL_FIND_NEW_MOVIES_SC": "Find and watch the newest films — often before DVD",
+ "IDS_VIDEO_UPSELL_GET_TV_SHOWS_SC": "Get TV programmes the day after they air",
+ "IDS_VIDEO_UPSELL_INSTANT_ON_HD_SC": "Instant-on HD streaming — no more waiting for downloads",
+ "IDS_VIDEO_UPSELL_MOVIE_STORE_SC": "Film store",
+ "IDS_VIDEO_UPSELL_MY_VIDEO_SC": "My videos",
+ "IDS_VIDEO_UPSELL_TV_STORE_SC": "TV store",
+ "IDS_VIDEO_UPSELL_VIEW_NEW_RELEASES_SC": "You're using Xbox Video. Find this week's films and TV to watch on Windows 8, Xbox, Windows Phone 8 or XboxVideo.com.",
+ "IDS_VIDEO_VIEW_BY_TITLE": "{0} by {1}",
+ "IDS_VIDEO_VIEW_FROM_STUDIO_LABEL": "{0} from {1}",
+ "IDS_VIDEO_VIEW_IN_GENRE_FROM_STUDIO_LABEL": "{0} in {1} from {2}",
+ "IDS_VIDEO_VIEW_IN_GENRE_LABEL": "{0} in {1}",
+ "IDS_VIDEO_WATCH_NEXT_BUY_EPISODE_BUTTON": "Buy episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_DELETE_EPISODE_BUTTON": "Delete episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_DELETE_SEASON_BUTTON": "Delete season",
+ "IDS_VIDEO_WATCH_NEXT_DOWNLOAD_EPISODE_BUTTON": "Download episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_PLAY_EPISODE_BUTTON": "Play episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_RESTART_EPISODE_BUTTON": "Restart episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_RESUME_EPISODE_BUTTON": "Resume episode {0}",
+ "IDS_VIDEO_WATCHED_LABEL": "Watched",
+ "IDS_VIDEO_REVIEW_COUNT_ONLY_PLURAL": "[[1]{0} review][[*]{0} reviews]",
+ "000D1359": "This song is available only when you buy the whole album.",
+ "000D135E": "Sorry, can't go there. Please try again.",
+ "C00D001A": "The item is missing or we can't get to it.",
+ "C00D0029": "If the item is on an external hard drive or network location, make sure you have access to that device or location.",
+ "C00D0BBE": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D0BC0": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D0BCD": "The given property isn't supported.",
+ "C00D0FF5": "To preview or play explicit content, sign in.",
+ "C00D0FF6": "Your privacy & online settings don't allow you to buy explicit content.",
+ "C00D0FF7": "Your privacy & online settings don't allow you to buy things.",
+ "C00D0FF8": "Access to this content is blocked based on the online safety settings for this account. Please sign in to play this content.",
+ "C00D0FF9": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D0FFC": "Can't play the disc because the drive is in use.",
+ "C00D0FFD": "To download explicit content, sign in.",
+ "C00D1051": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1053": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1057": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D1077": "Sorry, this item is unavailable.",
+ "C00D10B7": "Sorry, we can't play this item right now. Please try again later.",
+ "C00D10BD": "Can't play videos because there's a problem with your video card. For troubleshooting help, contact the maker of your computer's video card.",
+ "C00D10D1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D10DE": "Can't play the video because there's a problem with the file. Try renting or buying the video at the Xbox Video Store.",
+ "C00D10DF": "Can't play because the item's file format isn't supported. Make sure your video doesn't have multiple soundtracks.",
+ "C00D10E0": "Can't play this item because the file is too big.",
+ "C00D10E1": "Can't play files that are incompletely downloaded or are corrupted.",
+ "C00D1117": "Sorry, this item is currently unavailable.",
+ "C00D1126": "Make sure you're connected to the internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1198": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1199": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11A1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11B5": "Sorry, we can't download because we can't check usage rights at the moment. Please try again soon!",
+ "C00D11BA": "Can't play. Make sure your computer has a working sound card, then try again.",
+ "C00D11C0": "Sorry, we can't play just now. You might be offline or our service could be down. Make sure you're connected to the Internet, and try again in a while.",
+ "C00D11C3": "Can't play. Make sure you have internet access, then try again.",
+ "C00D11C6": "Sorry, this app needs a restart. Go to Home, press the menu button on your controller, and choose Quit. Then start the app again.",
+ "C00D11CD": "Please try again. If the problem continues, visit www.xbox.com/support to check for guidance.",
+ "C00D11D1": "Can't play. Make sure your computer's sound and video cards are working and have the latest drivers, then try again.",
+ "C00D11D2": "Can't access the file. Make sure that the file isn't in use, that you can access the place the file is stored, and that your network's proxy settings are correct, then try again.",
+ "C00D11D3": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11D6": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D11DA": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11DF": "Can't play one or more songs. For more information, select an information icon in the now playing list.",
+ "C00D11E7": "Can't play or sync this protected file.",
+ "C00D1204": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D12A2": "Can't sign in. Please try again later.",
+ "C00D12A3": "Can't sign in because access requires a user name and password.",
+ "C00D12A4": "Can't sign in because the server has denied access. Please try again later.",
+ "C00D12A5": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A6": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A7": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A8": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A9": "Can't sign in due to a network error. Make sure you have network access and try again.",
+ "C00D12AA": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12D7": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C00D12DD": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D12E6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12E7": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12F7": "Can't check usage rights. Make sure you have internet access, then restart the app.",
+ "C00D12F8": "Sorry, can't check usage rights. Please try again in a few minutes.",
+ "C00D1313": "The app closed while trying to update this subscription. Further updates for this subscription will no longer download automatically. Try subscribing to it again or deleting it.",
+ "C00D1333": "Can't find a secure channel. The server certificate isn't valid.",
+ "C00D1334": "Can't find a secure channel. The server certificate is revoked or the revocation list can't be retrieved.",
+ "C00D1335": "Can't find a secure channel. The server certificate was issued by an untrusted certification authority.",
+ "C00D1336": "Can't find a secure channel. The server certificate name doesn't match the server address.",
+ "C00D1337": "Can't find a secure channel. The server certificate is expired.",
+ "C00D1338": "Can't perform this operation. Please try again later.",
+ "C00D1339": "Can't perform the requested action because access requires a user name and password.",
+ "C00D133B": "Can't perform the requested action because the website has denied access. Please try again later.",
+ "C00D133C": "Sorry, this item is no longer available from Xbox. Try searching for it - a newer version might be available.",
+ "C00D1342": "Can't perform the requested action because it's no longer on the website.",
+ "C00D134C": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134D": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134E": "Can't perform the requested action due to a network error. Make sure you have network access and try again.",
+ "C00D134F": "Can't do that because of a temporary server condition. Please try again later.",
+ "C00D1350": "Microsoft Update has encountered an unexpected error. Please try again later.",
+ "C00D1351": "Sorry, we can't connect to Xbox services. Please try again later.",
+ "C00D1352": "Wrong username and password combination.",
+ "C00D1354": "Please sign in to preview or play this item.",
+ "C00D1355": "You're not old enough to play explicit content.",
+ "C00D1356": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D1357": "Can't purchase or download media from multiple online stores.",
+ "C00D1358": "Can't purchase or download the item. It might not be available.",
+ "C00D135A": "Can't identify the provider of this item.",
+ "C00D135B": "This song can be downloaded only when you buy the whole album.",
+ "C00D135C": "You've used up all of your downloads for this item.",
+ "C00D135D": "You've reached the maximum number of things you can buy at one time.",
+ "C00D135F": "Can't sign in. Make sure you're using the right email address and password. The Xbox service might be temporarily unavailable.",
+ "C00D1360": "Can't download this item because the server isn't responding. The server might be temporarily unavailable or you may have lost your internet connection.",
+ "C00D1363": "The folder couldn't be opened. It might have been moved or deleted.",
+ "C00D1365": "To play this, we need to confirm usage rights. Please sign in with the Microsoft account you were using when you bought it.",
+ "C00D1366": "Can't download because there's not enough storage space for this item.",
+ "C00D1367": "Can't sign in. Please try again later.",
+ "C00D136C": "The email address and password that you entered are not linked to an Xbox profile. Enter a different Microsoft account (email address and password), or use these to create a new Microsoft account.",
+ "C00D136D": "Can't sign in because the Xbox service isn't yet available in your region.",
+ "C00D136E": "The email address and password that you entered are not linked to an Xbox profile. To use these credentials, first sign in at Xbox.com, then sign in to this app again.",
+ "C00D136F": "There's a serious error with your Xbox account.",
+ "C00D1371": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D1372": "Can't download. Make sure the media folder specified in software settings is accessible and that there's enough space on your hard disk.",
+ "C00D1374": "Sorry, can't sign in right now.",
+ "C00D1375": "You need to change your gamertag.",
+ "C00D1376": "Our terms of service have been updated. Select Terms of Service to read and accept the terms in a web browser, then return to this screen to sign in.",
+ "C00D1377": "Your Xbox account has been suspended.",
+ "C00D1378": "Your Xbox account has been suspended.",
+ "C00D1379": "Sorry, can't access your account right now. Please try again later.",
+ "C00D137B": "The item wasn't found. Please try again later.",
+ "C00D137C": "This item can't be previewed, purchased, or downloaded.",
+ "C00D137D": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C00D137E": "Sorry, we can't connect to Xbox services right now. Please try again later.",
+ "C00D137F": "Sorry, Xbox stores aren't yet available in your location. Please check back!",
+ "C00D1380": "That didn't work the way it was supposed to. Please try again.",
+ "C00D1381": "Sorry, we don't have the right album info for this.",
+ "C00D1382": "The Xbox service didn't return valid purchase information.",
+ "C00D1383": "The Xbox service didn't return valid sign in information.",
+ "C00D1384": "Can't provide your Microsoft Points balance right now.",
+ "C00D1385": "Need to check usage rights. Please sign in.",
+ "C00D1387": "The destination download folder doesn't exist. Check that the media folder in the software general settings is set correctly.",
+ "C00D1388": "Sorry, sign-in isn't supported in your region at this time.",
+ "C00D1391": "Before we can sign you in, we need you to verify your age. To continue, go to www.xbox.com/verifyage.",
+ "C00D1392": "Sorry, we can't sign you in due to age requirements for your region. For more information, go to www.xbox.com/verifyage.",
+ "C00D1393": "You are not old enough to download explicit content.",
+ "C00D1395": "Please sign in at Xbox.com and make sure your payment info is up to date.",
+ "C00D1396": "The app update is pending and this app needs a restart. Go to Home, press the menu button on your controller and choose Quit. Then start the app again.",
+ "C00D1397": "Before we can sign you in, we need you to verify your email account. To continue, go to https://account.live.com and sign in.",
+ "C00D2718": "Can't play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C00D2719": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one. If you have just renewed your Xbox Music Pass, please sign out and sign in again.",
+ "C00D271A": "To play this item, we need to check the usage rights for it. Please sign in with the profile you were using when you bought it.",
+ "C00D271D": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D271E": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2721": "Sorry, we can't do what you wanted because there's a problem with your computer's usage rights.%0.",
+ "C00D272B": "Sorry, can't play or download. Please try again in a few minutes.",
+ "C00D274D": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D2759": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2781": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D27D8": "Usage rights for this item have expired. To play it, sign in.",
+ "C00D27D9": "The usage rights for this item aren't active yet. Try again at a later date.",
+ "C00D27DB": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D280A": "Sorry, you need a newer computer to play or download this item.",
+ "C00D2841": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D284F": "Your rental has expired. To play this video, rent it again or buy it.",
+ "C00D2850": "You've already rented this video for this device. To get ready to watch it, select Download.",
+ "C00D2904": "To play this content, your computer's video card, video driver, analogue video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2905": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's video card doesn't work with it. Update your video card, then try again.",
+ "C00D2906": "To play this item, your video card, video driver, and screen must each be compliant with HDCP copy protection. One or more of them is not. To check HDCP compliance, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2907": "To play this content, your computer's video card, video driver, analogue video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2908": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D2909": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D290B": "Your current display setting is in clone (duplicate) mode. The current content cannot be viewed in this mode. Try changing the display settings to extended mode.",
+ "C00D2EED": "The proxy server couldn't be located. Please check your proxy server configuration.",
+ "C00D32E0": "To listen, connect speakers or headphones to your computer.",
+ "C00D36B2": "Choose a shorter path or file name. Current path or file name is too long. The file path and name can be up to 200 characters.",
+ "C00D36B4": "This item is in a format we don't support. Please choose something else.",
+ "C00D36C4": "This item's file format may be unsupported, the file extension may be incorrect, or the file may be corrupted.",
+ "C00D36E6": "Sorry, we're not sure what happened. Please try again later.",
+ "C00D36FA": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D36FF": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D4E86": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D5212": "This item was encoded in a format that's not supported.",
+ "C00D715D": "Sorry, you can't play rights-managed content while you're debugging. Finish your analysis, then try again.",
+ "C1010003": "To continue using this app, install the latest version.",
+ "C1010005": "Can't access the server. Make sure that there are no firewalls or proxy servers blocking access to the Xbox service, then try again.",
+ "C1010008": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C1010017": "The Xbox LIVE Terms of Service have been updated. The parent associated with this account must read and accept the new terms before you can sign in.",
+ "C101001C": "Can't retrieve the computer name.",
+ "C101001D": "Can't retrieve the computer name.",
+ "C101001F": "There might be a problem with your network connection or an error in the web address you entered. Check your network connection and, if applicable, the URL. Then try again.",
+ "C1010023": "Sign-in isn't available in your region.",
+ "C1010026": "This item can't be purchased on your computer. To download or watch it, use your Xbox 360 console.",
+ "C1010027": "Your network is too slow for instant playback, so your video will be downloaded to ensure optimal viewing. You'll find this item in your video collection once the download is complete.",
+ "C1010028": "Your network is too slow for instant playback. To ensure optimal viewing, download this video instead of trying to stream it.",
+ "C1010029": "This item is no longer available, or is available only for purchase and can't be downloaded using an Xbox Music Pass.",
+ "C101002A": "Can't complete the download. Please try again later.",
+ "C1010030": "You can leave feedback only on things you've bought. If you own this item, go to the Users page in PC settings and sign in to Windows with the Microsoft account you were using when you bought it, then try posting feedback again.",
+ "C1010036": "To continue, sign in.",
+ "C1010064": "Smart DJ is currently unavailable. Please try again later.",
+ "C1010065": "Songs from Xbox Music weren't added to this playlist because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010066": "This playlist wasn't refreshed because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010067": "This playlist couldn't be refreshed because similar songs couldn't be found.",
+ "C1010070": "Sorry, we can't post your review, due to either a network error or the contents of your review. Please check your internet connection. Also, make sure none of the language in your review is offensive. If the problem continues, wait a while and then try again.",
+ "C101008D": "Sorry, can't play. Please try again.",
+ "C101008E": "Couldn't play because of a network problem. Please try again.",
+ "C101008F": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010090": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010091": "Sorry, we're not sure what happened there. Please try again.",
+ "C1010094": "This song requires an Xbox Music Pass. To play the song, sign up for an Xbox Music Pass or sign in with an account that has one.",
+ "C1010095": "To stream rights-managed music or video to another device, that device needs to support the media rights management (DRM) for that content. Make sure you are signed in with the same account on both devices, or play content that's not rights-managed.",
+ "C1010098": "Access to this content is blocked based on the online safety settings for this account.",
+ "C1010099": "Make sure that this media file has been added to your media library and try to play it from the media library gallery of the application.",
+ "C101009A": "To play premium content, please ensure your build of Windows is signed with the official Microsoft Windows Production certificate.",
+ "C101009B": "Another app is controlling your sound at the moment. To listen here, close that app and try again.",
+ "C101009C": "That one is either corrupted or in a format we can't play.",
+ "C101009D": "If you are using remote desktop, try streaming or downloading on your local PC instead.",
+ "C101009E": "This song is not available on this device. The item doesn't match anything in the cloud, so we can't stream it for you here.",
+ "C101009F": "The connection to your TV was lost.",
+ "C10100A0": "We can't play from the file locations for those songs in that playlist.",
+ "C10100A1": "We cannot play on your receiver at this moment. Please disconnect your receiver and try again.",
+ "C10100A2": "Sorry, we couldn't play that. It looks like your audio or video device isn't using Windows certified drivers. Try again after installing the latest official drivers. The following files are not certified:",
+ "C10100C8": "Automatic refreshing has been disabled for this playlist due to poor performance. Editing the playlist rules to reduce list size might improve performance.",
+ "C10100C9": " ZUNE_E_MAXIMUM_PLAYLIST_LENGTH_EXCEEDED",
+ "C10100DD": "Could not download to your library. That path is no longer available. If you are using external storage, make sure it is available and connected.",
+ "C10100DE": "Your media library is currently write protected and preventing us from downloading. Please remove the write protection and try again.",
+ "C10100DF": "Couldn't download to your library. Your library doesn't contain any folders that are not associated with a cloud storage service.",
+ "C1010100": "Sorry, not sure what happened there. Close and reopen the app, then try again.",
+ "C1010101": "If the item is on an external hard drive, make sure the drive is connected and turned on.",
+ "C1010102": "Make sure you're connected to the internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C1010103": "This item is in a format we don't support. Please choose something else.",
+ "C1010104": "Make sure your video cable and TV both support HDCP copy protection. Also, check with the maker of your computer's video card to see if there's an HDCP-compliant driver for it.",
+ "C1010105": "Make sure the item you're trying to play is available locally. This app doesn't support playing over remote desktop.",
+ "C1010106": "Your version of Windows doesn't support playing music or video.",
+ "C1010107": "Wait a few moments, then try again.",
+ "C1010108": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one.",
+ "C1010109": "Can't Play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C101010B": "Can't play because we can't check usage rights. Make sure your PC's clock and time zone are set correctly, then try again.",
+ "C101010C": "Your TV or monitor does not support the copy protection technology required to play this content.",
+ "C101010D": "This song is not available through Xbox Music.",
+ "C101010F": "Can't play the song because it is being used by another application.",
+ "C1010140": "The item contains a sync ID reference to another item that does not exist in the local replica.",
+ "C1010141": "The item exists in the database but has not yet been assigned a sync ID.",
+ "C1010142": "The item contains a variable type sync ID reference but does not contain the sync type.",
+ "C1010143": "The item is missing a property that is required by the schema.",
+ "C1010144": "The message did not contain an item of the expected type.",
+ "C101014B": "Sorry, we can't download this right now. Wait a while, then try again.",
+ "C10101C2": "We've stopped playing because you've reached your data limit and we thought you should know. To resume, select Play.",
+ "C10101C3": "We've stopped playing because you're nearing your data limit and we don't want you to unknowingly exceed it. To resume, select Play.",
+ "C10101C4": "We've stopped playing because you're now connected to a metered network where you could quickly exceed your data limit. To resume, select Play.",
+ "C101A000": "Request completed successfully.",
+ "C101A001": "There was a problem. Please try again later.",
+ "C101A002": "There was a problem. Please try again later.",
+ "C101A003": "Can't complete your request. Make sure you've entered the right info, then try again.",
+ "C101A004": "To use this app, make sure you are signed in to your Xbox account.",
+ "C101A005": "Can't complete your request. Please try again later.",
+ "C101A006": "There was a problem. Please try again later.",
+ "C101A007": "There was a problem. Please try again later.",
+ "C101A008": "Can't complete your request because you have one or more duplicate entries. Check that you've entered valid information, then try again.",
+ "C101A009": "Can't complete your request. You've made too many service requests in a short time. Please try again later.",
+ "C101A010": "Can't complete your request. Check that you've entered valid information, then try again.",
+ "C101A053": "We can't check the playback rights for this item at the moment. Please try again later. Make sure you sign in with an account that matches the region setting of your device.",
+ "C101A054": "There was a problem. Please try again later. ",
+ "C101A055": "Sorry, this item is no longer available.",
+ "C101A1F8": "There was a problem. Please try again later.",
+ "C101A1F9": "To complete your request, a parent needs to sign in.",
+ "C101A1FA": "That isn't the right parent account. Please try again.",
+ "C101A1FB": "Sorry, we couldn't get the info we needed. Please try again later.",
+ "C101A1FC": "There was a problem. Please try again later.",
+ "C101A20D": "There was a problem. Please try again later.",
+ "C101A20E": "There was a problem. Please try again later.",
+ "C101A20F": "There was a problem. Please try again later.",
+ "C101A211": "There was a problem. Please try again later.",
+ "C101A212": "There was a problem. Please try again later.",
+ "C101A213": "There was a problem. Please try again later.",
+ "C101A214": "There was a problem. Please try again later.",
+ "C101A215": "There was a problem. Please try again later.",
+ "C101A216": "There was a problem. Please try again later.",
+ "C101A217": "There was a problem. Please try again later.",
+ "C101A218": "There was a problem. Please try again later.",
+ "C101A219": "There was a problem. Please try again later.",
+ "C101A21A": "There was a problem. Please try again later.",
+ "C101A21B": "You haven't accepted the Xbox LIVE Terms of Service. To continue, please review and accept the terms.",
+ "C101A21C": "There was a problem. Please try again later.",
+ "C101A230": "Please enter a gamertag and try again.",
+ "C101A231": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A232": "There was a problem. Please try again later.",
+ "C101A233": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A234": "There was a problem. Please try again later.",
+ "C101A235": "There was a problem. Please try again later.",
+ "C101A236": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A237": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A238": "Can't complete your request due to age restrictions. Your parent would need to change your account permissions in Account Settings, Privacy, Family Settings.",
+ "C101A239": "Can't sign in. Please check and correct your account details, then try again.",
+ "C101A23A": "There was a problem. Please try again later.",
+ "C101A23B": "There was a problem. Please try again later.",
+ "C101A23D": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A23E": "There was a problem. Please try again later.",
+ "C101A241": "Sorry, the item you're trying to buy is no longer available.",
+ "C101A242": "There was a problem. Please try again later.",
+ "C101A243": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A244": "Sorry, that subscription isn't available anymore.",
+ "C101A245": "There was a problem. Please try again later.",
+ "C101A246": "There's no Xbox profile associated with your current Microsoft account. To get the most from this app, create an Xbox profile using this email and password combination.",
+ "C101A247": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A248": "There was a problem. Please try again later.",
+ "C101A249": "There was a problem. Please try again later.",
+ "C101A24A": "There was a problem. Please try again later.",
+ "C101A24B": "You need to be signed in to play this. Sign in, then try again.",
+ "C101A24D": "Can't sign in right now. Please try again later.",
+ "C101A24E": "The Xbox LIVE Code of Conduct doesn't permit your gamertag. You must change it before you can use the Xbox service.",
+ "C101A3E9": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3EA": "This item's price has changed.",
+ "C101A3EB": "The item wasn't found. Please try again later.",
+ "C101A3EC": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3ED": "You've exhausted the number of times you can restore this item.",
+ "C101A3EE": "Sorry, you can't stream music or video when you're outside of the region for your profile.",
+ "C101A3EF": "You don't have enough Microsoft Points to complete the purchase.",
+ "C101A3F0": "You've used or purchased the maximum number of Microsoft Points for today. Please try again tomorrow.",
+ "C101A3F1": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A3F2": "To protect your account, Xbox limits the number of purchases in a 24-hour period. Please try again later.",
+ "C101A3F3": "Your Xbox Music Pass has expired. To play this music, sign up for a new pass in Settings, Account, Xbox Music Pass.",
+ "C101A3F4": "You're using an unsupported version of this Xbox app.",
+ "C101A3F5": "Can't play because the item's usage rights are no longer valid. Try deleting this item and downloading it again.",
+ "C101A3F6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C101A3F7": "Sorry, we're not sure what happened there. Please try again.",
+ "C101A3F8": "Xbox can't issue the requested rights.",
+ "C101A3F9": "You're using an unsupported version of this Xbox app.",
+ "C101A3FA": "Please use an SSL connection to sign in.",
+ "C101A3FB": "Can't sign in.",
+ "C101A3FC": "The license is corrupt or not valid.",
+ "C101A3FD": "The content owner for the license you just acquired requires that your device be linked to this computer.",
+ "C101A3FF": "Sorry, this item is unavailable.",
+ "C101A400": "To protect your account, the number of purchases you can make in a 24-hour period is limited. Please try again later.",
+ "C101A410": "Can't remove this computer or device. You've already removed one from this Xbox Music Pass in the last 30 days.",
+ "C101A411": "You're downloading songs from Xbox Music on the maximum allowed devices. You might still be able to stream music here, you just can't download it.",
+ "C101A412": "Sorry, you don't have enough song credits for this purchase. To complete your purchase, buy Microsoft Points in Account Settings.",
+ "C101A413": "Sorry, this code has already been redeemed. Enter a new code or use Microsoft Points for your purchase.",
+ "C101A414": "The offer you're trying to use isn't valid.",
+ "C101A415": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A416": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A417": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A418": "Can't purchase because the Xbox service isn't yet available in your region.",
+ "C101A419": "This song has been removed from Xbox Music at the request of the copyright holder.",
+ "C101A7D1": "Need to check usage rights. Please sign in to the account you used to purchase the item.",
+ "C101A7D2": "The item wasn't found. Please try again later.",
+ "C101A7D3": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A7D4": "This song is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "C101A7D5": "Sorry, we can't play or download because we can't check usage rights at the moment. Please try again soon!",
+ "C101A7D8": "You've exceeded the number of videos you can stream at the same time. To watch the current video, stop one of your other streams and then start this one again.",
+ "C101A7DA": "You've exceeded the number of videos you're allowed to stream at the same time. To watch the current video, stop one of your other streams, and then start this one again.",
+ "C101A7DB": "You've exceeded the number of songs you're allowed to stream at the same time. To listen to the current song, stop one of your other streams, and then start this one again.",
+ "C101A7DC": "This song can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "C101A7E1": "Sorry, you've used up the number of simultaneous streams for this video. Your video will stop.",
+ "C101A7E2": "Sorry, you've used up the number of simultaneous streams for this song. Your song will stop.",
+ "C101A9C5": "Can't sign in. Please try again later.",
+ "C101A9C6": "Can't sign in. Please try again later.",
+ "C101A9C7": "Can't sign in. Please try again later.",
+ "C101A9C8": "Can't sign in. Please try again later.",
+ "C101A9C9": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Devices.",
+ "C101A9CA": "Can't stream this song, possibly because you're already streaming from another location. Try again later.",
+ "C101A9CB": "Sorry, can't connect to Xbox services. Please try again later.",
+ "C101A9CC": "Can't complete your transaction. Please try again later.",
+ "C101A9CD": "Can't complete your transaction. Please try again later.",
+ "C101A9CE": "Can't connect to Xbox. Your account is in use somewhere else.",
+ "C101A9CF": "Can't complete your transaction. Please try again later.",
+ "C101A9D4": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D5": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D6": "This song is no longer available using Xbox Music Pass.",
+ "C101AB55": "You have reached the limit for the number of tracks you may play before logging in.",
+ "C101AB6A": "The licence for this content has expired. Please delete the file and download it again from your collection.",
+ "C101ABB9": "Can't complete your transaction. Please try again later.",
+ "C101ABBA": "Can't download media usage rights. Please try again later.",
+ "C333000B": "Failed to acquire a licence for the content. Make sure your device has all of the necessary certificates.",
+ "C33305DD": "Your parent has restricted your account.",
+ "C33307D2": "The content cannot be licensed in this country/region.",
+ "C33307D3": "To view this content you need to be in the region for your Xbox profile. If you've moved permanently, change your region at account.xbox.com.",
+ "C33307D5": "This rental has expired.",
+ "C33307D8": "The maximum download count has been reached.",
+ "C33307D9": "Please sign in.",
+ "C33307DA": "Unable to acquire usage rights for the content.",
+ "C3330835": "The maximum number of concurrent streams for this content has been reached.",
+ "C3330837": "Your account has reached the maximum number of simultaneous streams.",
+ "C3330838": "The maximum number of concurrent streams for this content has been reached.",
+ "C3340BBC": "To view this free content you need to be in the region for your Xbox profile. If you've moved permanently, change your region at account.xbox.com.",
+ "C33601F4": "We need to check rights for your device.",
+ "C3380000": "Try again in a while. We cannot connect to our service at the moment.",
+ "C3380262": "Choose one you no longer want to use for downloads from the Store. On that device, launch the Video app, go to Settings > Download devices, and remove that device. Then you'll be able to download on this device.",
+ "C3380263": "Choose one you no longer want to use for downloads from the Store. On that PC, launch the Video app, go to Settings > Download devices, and remove that PC. Then you'll be able to download on this PC.",
+ "C3380264": "Choose one you no longer want to use for downloads from the Store. On that phone, launch the Films & TV app, go to Settings > Download devices, and remove that phone. Then you'll be able to download on this phone.",
+ "C3380265": "Choose one you no longer want to use for downloads from the Store. On that tablet, launch the Video app, go to Settings > Download devices, and remove that tablet. Then you'll be able to download on this tablet.",
+ "C3380266": "Choose one you no longer want to use for downloads from the Store. On that Xbox, launch the Films & TV app, go to Settings > Download devices, and remove that Xbox. Then you'll be able to download on this Xbox.",
+ "C338026C": "On your other device, launch the Video app, go to Settings > Download devices, and remove that device.",
+ "C338026D": "You can remove only one device per month from the devices you use for Store downloads.",
+ "C338026E": "To download using your account, this device must be removed from another person's list of devices used for Store downloads. Ask someone else to sign in, then ask them to remove this device in Settings > Download devices."
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/resources/en-us.json b/packages/microsoft.zunevideo/resources/en-us.json
new file mode 100644
index 00000000..1d4d93bf
--- /dev/null
+++ b/packages/microsoft.zunevideo/resources/en-us.json
@@ -0,0 +1,1928 @@
+{
+ "resources": {
+ "IDS_ACC_BACK_BUTTON": "Back",
+ "IDS_ACC_HOME_BUTTON": "Home",
+ "IDS_ACC_REFRESH_BUTTON": "Refresh",
+ "IDS_ACTIVATION_LIMIT_EXCEEDED_DTO": "You're already downloading on the maximum number of devices.",
+ "IDS_ADVERTISEMENT": "Advertisement",
+ "IDS_APP1_MODULE_VIEW_ALL": "View all",
+ "IDS_APP1_MODULE_VIEW_ALL_LABEL": "View all {0}",
+ "IDS_APP2_FILTER_SORTED_BY": "Sort by",
+ "IDS_APP2_PARENTAL_FILTERED_CONTENT_NOTIFICATION_TEXT": "Content filtered. Appropriate up to age {0}.",
+ "IDS_APP2_PARENTAL_NO_CONTENT_TITLE": "Parental controls are enabled",
+ "IDS_BETA_TOS_ACCEPT_MESSAGE": "By clicking I Accept, you agree to the license terms required to use this app.",
+ "IDS_BETA_TOS_BUTTON_ACCEPT": "I accept",
+ "IDS_BETA_TOS_BUTTON_DECLINE": "Cancel",
+ "IDS_BETA_TOS_TITLE": "First things first.",
+ "IDS_BROWSE_ACTION_TITLE": "Show More",
+ "IDS_BUY_BUTTON": "Buy",
+ "IDS_BUY_BUTTON_VIDEO": "Buy",
+ "IDS_CANCEL_BUTTON": "Cancel",
+ "IDS_CANCEL_BUTTON_TC": "Cancel",
+ "IDS_CHILD_AGE_GATING_MESSAGE": "Purchase of this content is currently not allowed for child and teen accounts.",
+ "IDS_CHILD_AGE_GATING_TITLE": "Sorry",
+ "IDS_CLEAR_DOWNLOAD_ERROR_BUTTON": "Clear error",
+ "IDS_CLEAR_SELECTION": "Clear selection",
+ "IDS_CLOSE_BUTTON": "Close",
+ "IDS_CLOSE_BUTTON_LC": "close",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_MESSAGE": "You have more music than we can sync with the cloud. To keep your music in sync, limit your number of songs to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_DIALOG_TITLE": "Can't sync your music.",
+ "IDS_CLOUD_SYNC_COLLECTION_FULL_NOTIFICATION_HEADER": "Can't sync your music",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_MESSAGE": "We can't sync with the cloud right now. Until we do, changes you make here won't show up on other devices and changes on those devices won't show up here. We'll keep trying. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_ERROR_DIALOG_TITLE": "Can't sync right now.",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_HEADER": "Can't sync",
+ "IDS_CLOUD_SYNC_ERROR_NOTIFICATION_TEXT": "More info",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE": "Playlists can have only {0} songs. Choose fewer songs or remove some first.",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_MESSAGE_PLURAL": "[[1]Playlists can have only {0} song. Choose fewer songs or remove some first.][[*]Playlists can have only {0} songs. Choose fewer songs or remove some first.]",
+ "IDS_CLOUD_SYNC_PLAYLIST_FULL_DIALOG_TITLE": "Can't add to {0}",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_MESSAGE": "You have more playlists than we can sync with the cloud. To keep your playlists in sync, limit their number to {0}. To turn off cloud sync, go to settings.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_DIALOG_TITLE": "Can't sync playlists.",
+ "IDS_CLOUD_SYNC_PLAYLIST_LIMIT_EXCEEDED_NOTIFICATION_HEADER": "Can't sync playlists",
+ "IDS_COLLECTION_ALL_VIDEO_EMPTY": "When you add videos to your Windows library, they'll appear here, too.",
+ "IDS_COLLECTION_CLOUD_MATCHED_ARIA": "Cloud matched",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING": "Checking Xbox Music availability",
+ "IDS_COLLECTION_CLOUD_SYNC_PENDING_ARIA": "Cloud sync pending",
+ "IDS_COLLECTION_HEADER_ZOOM_IN": "Activate to zoom in",
+ "IDS_COLLECTION_HEADER_ZOOM_OUT": "Activate to zoom out",
+ "IDS_COLLECTION_IN_CLOUD": "In cloud",
+ "IDS_COLLECTION_IN_CLOUD_FREE": "Matched (available here and for streaming on other Windows 8/Windows RT devices)",
+ "IDS_COLLECTION_IN_CLOUD_MATCHED": "Matched (available here and for streaming on other Xbox Music devices)",
+ "IDS_COLLECTION_MOVIE_EMPTY": "It's lonely here. Find hit movies at the Xbox Video Store.",
+ "IDS_COLLECTION_MOVIE_EMPTY_LINK": "Show me hit movies at the Xbox Video Store",
+ "IDS_COLLECTION_MUSIC_EMPTY": "It’s lonely here. Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_2": "Go to the Windows desktop. Select Windows Explorer, then Music Library. Put your MP3s in this folder.",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK": "Browse millions of songs in Xbox Music",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_DESC_PREMIUM": "Find music to stream for free or buy and add to your collection",
+ "IDS_COLLECTION_MUSIC_EMPTY_LINK_PREMIUM": "Browse all music",
+ "IDS_COLLECTION_MUSIC_EMPTY_SUBTITLE": "Why not add some music?",
+ "IDS_COLLECTION_MUSIC_EMPTY_TITLE": "It’s lonely here.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TEXT": "This app plays music from your Windows library. To add music, go to the Windows desktop, select Windows Explorer and then Music Library.",
+ "IDS_COLLECTION_MUSIC_LIBRARY_SETTINGS_TITLE": "Collection",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_SUBTITLE": "We’ll add songs from any files you have on this PC.",
+ "IDS_COLLECTION_MUSIC_MANAGE_COLLECTION_TITLE": "Choose where we look",
+ "IDS_COLLECTION_MUSIC_MANAGE_FOLDERS_LINK": "Choose where we look for music on this PC",
+ "IDS_COLLECTION_MUSIC_MORE_LIBRARIES_LINK": "Add music to your Windows music library",
+ "IDS_COLLECTION_MUSIC_SETTINGS_TITLE": "Settings",
+ "IDS_COLLECTION_NOT_IN_CLOUD": "Not in cloud",
+ "IDS_COLLECTION_OPEN_FILES_LINK": "Open or play something",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_SUBTITLE": "Browse new, featured, and top music.",
+ "IDS_COLLECTION_PAGE_EMPTY_BROWSE_TITLE": "Explore music",
+ "IDS_COLLECTION_PIVOT": "collection",
+ "IDS_COLLECTION_PIVOT_TC": "Collection",
+ "IDS_COLLECTION_PURCHASES_ADD_TO_CLOUD": "Add to cloud",
+ "IDS_COLLECTION_PURCHASES_RESTORE": "Restore",
+ "IDS_COLLECTION_PURCHASES_RESTORE_TEXT": "Where possible, restore all purchased music to my collection. Some purchases may no longer be available.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE": "This song is no longer available for streaming or download from Xbox Music. It might be available for purchase.",
+ "IDS_COLLECTION_SONG_NOT_AVAILABLE_TITLE": "Song not available.",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD": "Streaming",
+ "IDS_COLLECTION_STREAMING_FROM_CLOUD_FREE": "Streaming only",
+ "IDS_COLLECTION_THIS_DEVICE_ONLY": "This device only",
+ "IDS_COLLECTION_TOOLTIP_CLOUD_STATUS": "Streaming status",
+ "IDS_COLLECTION_TOOLTIP_LEARN_MORE": "Learn more",
+ "IDS_COLLECTION_TOOLTIP_MATCHED": "Listen offline here, also in Xbox Music catalog",
+ "IDS_COLLECTION_TOOLTIP_NOT_IN_CLOUD": "Not in cloud (available only here)",
+ "IDS_COLLECTION_TOOLTIP_STREAMING": "Stream from Xbox Music catalog (to listen offline, download this file)",
+ "IDS_COLLECTION_TOOLTIP_UNMATCHED": "Unmatched (available only here)",
+ "IDS_COLLECTION_TV_EMPTY": "Show me TV shows at the Xbox Video Store",
+ "IDS_COLLECTION_VIDEO_EMPTY": "When you have videos that aren't movies or TV shows, they'll appear here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY": "It's lonely here.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_EMPTY_2": "Make sure your videos are part of your Windows library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_OPEN_FILE": "You can also open files directly, but playing them this way won't add them to your Video library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TEXT": "This app plays videos from your Windows library. To add videos, go to the Windows desktop, select Windows Explorer, and then Videos Library.",
+ "IDS_COLLECTION_VIDEO_LIBRARY_SETTINGS_TITLE": "My Videos",
+ "IDS_COLLECTION_VIDEO_MANAGE_FOLDERS_LINK": "Choose where we look for videos on this PC",
+ "IDS_COLLECTION_VIDEO_MORE_LIBRARIES_LINK": "Add videos to your Windows video library",
+ "IDS_COLLECTION_VIDEO_SETTINGS_TITLE": "Settings",
+ "IDS_COMMA_SEPARATOR": "{0}, {1}",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY": "When you connect to your Xbox 360 with Xbox SmartGlass, what you play there will appear here.",
+ "IDS_COMPANION_HOME_NOW_PLAYING_EMPTY_TITLE": "Welcome!",
+ "IDS_COMPOSE_MESSAGE_SEND": "Send",
+ "IDS_CONTROLLER_BROWSER_ONE_FINGER_TUTORIAL": "Move and tap with one finger.",
+ "IDS_CONTROLLER_BROWSER_TWO_FINGER_TUTORIAL": "Zoom with two.",
+ "IDS_CONTROLLER_DISMISS_KEYBOARD": "Tap here when you're done typing.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING": "Someone else is using their Xbox SmartGlass remote.",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_BUTTON": "OK",
+ "IDS_CONTROLLER_EXCLUSIVE_WARNING_TITLE": "Sorry, you can’t use the remote right now.",
+ "IDS_CONTROLLER_FAMILY_CONTROL_TUTORIAL": "Enter your Family Settings pass code to continue.",
+ "IDS_CONTROLLER_INVOKE_KEYBOARD": "Tap here to start typing.",
+ "IDS_CONTROLLER_SAME_WIRELESS_NETWORK": "For the best experience, your Xbox console and this device should be on the same wireless network.",
+ "IDS_CONTROLLER_SEPARATE_NETWORKS": "Xbox SmartGlass will work across separate networks, but you can't use the keyboard or browser control.",
+ "IDS_CONTROLLER_SLOW_CONNECTION": "Slow connection",
+ "IDS_CONTROLLER_SLOW_CONNECTION_BUTTON": "OK",
+ "IDS_CONTROLLER_SLOW_CONNECTION_MORE_INFO": "More info",
+ "IDS_CONTROLLER_SWITCHER_BROWSER": "Browser",
+ "IDS_CONTROLLER_SWITCHER_BUTTON": "Switch",
+ "IDS_CONTROLLER_SWITCHER_CONTROLLER": "Controller",
+ "IDS_CONTROLLER_SWITCHER_GUIDE": "Guide",
+ "IDS_CONTROLLER_SWITCHER_KEYBOARD": "Keyboard",
+ "IDS_CONTROLLER_TUTORIAL_SWIPE": "Swipe to move and hold to move faster",
+ "IDS_CONTROLLER_TUTORIAL_TAP": "Tap to select",
+ "IDS_CONTROLLER_WEB_HUB_BUTTON": "Web Hub",
+ "IDS_CREATEACCOUNT_TITLE": "Create Account",
+ "IDS_DELETE_BUTTON": "Delete",
+ "IDS_DELETE_DESCRIPTION_LOCAL_PLURAL": "[[1]Are you sure you want to delete this {0} item?][[*]Are you sure you want to delete these {0} items?]",
+ "IDS_DELETE_DESCRIPTION_LOCAL_SINGLE": "Are you sure you want to delete \"{0}\"?",
+ "IDS_DELETE_LABEL": "Delete",
+ "IDS_DEMO_CONFIGURATION_COMPLETE": "The application has been configured for the retail experience. It will now close.",
+ "IDS_DEMO_IN_DEMO_MODE": "Retail demo",
+ "IDS_DEMO_MUSIC_EXPLORE_ALBUMS_HEADER": "Featured Albums",
+ "IDS_DEMO_MUSIC_EXPLORE_ARTISTS_HEADER": "Featured Artists",
+ "IDS_DEMO_MUSIC_EXPLORE_HEADER": "Discover new music",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1": "Listen to millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_1_FREE": "Browse and buy from a catalog of millions of songs",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_2": "Find, play, and collect your favorites",
+ "IDS_DEMO_MUSIC_EXPLORE_MESSAGE_3": "Save them as playlists and see them on other devices",
+ "IDS_DEMO_MUSIC_EXPLORE_PAGE_HEADER": "Explore Xbox Music",
+ "IDS_DEMO_MUSIC_EXPLORE_SUBTITLE": "Xbox Music lets you listen to your favorite artists, and helps you discover new ones.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_FIRST_LINE": "xbox music store",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_FOOTNOTE": "* Internet required. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_FREE": "Buy individual songs or get unlimited access to millions of songs with Xbox Music Pass.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_POPOVER_SECOND_LINE_NONFREE": "Purchase songs and albums from the Xbox Music store to build your personal music collection.",
+ "IDS_DEMO_MUSIC_MARKETPLACE_SECOND_LINE": "From the latest new releases to classic favorites.",
+ "IDS_DEMO_MUSIC_RADIO_HEADER": "Personalized radio",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_1": "Pick an artist and we'll pick the tunes",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_2": "Save your favorite stations as playlists for easy listening",
+ "IDS_DEMO_MUSIC_RADIO_MESSAGE_3": "Skip as many songs as you like — you're in complete control",
+ "IDS_DEMO_MUSIC_RADIO_SUBTITLE": "Xbox Music lets you listen to customized stations of music you'll love.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox music",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_FOOTNOTE": "* Internet required. Limits on free streaming apply. Available Xbox Music Store content may vary over time. See xbox.com/music.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_FREE": "Enjoy 6 months free unlimited music streaming on every Windows PC and tablet.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_POPOVER_SECOND_LINE_NONFREE": "Get Xbox Music Pass for unlimited access to millions of songs on all your devices.",
+ "IDS_DEMO_MUSIC_SPOTLIGHT_SECOND_LINE": "Xbox Music brings you all the music you love. Any way you want it.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FIRST_LINE": "xbox video store",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_FOOTNOTE": "* Broadband Internet and compatible devices required. See xbox.com/live.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_POPOVER_SECOND_LINE": "Play your purchased videos anywhere you go. Start on your tablet and pick up where you left off on your Xbox 360.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_OFF": "Rent or buy the latest HD movies.",
+ "IDS_DEMO_VIDEO_MARKETPLACE_SECOND_LINE_TV_ON": "Rent or buy the latest HD movies and buy TV shows.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FIRST_LINE": "xbox video",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_FOOTNOTE": "* Content from Xbox Video Store. Internet required; carrier fees apply. HD capable display required.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE": "Watch what you love wherever you are, get instant-on HD to start watching right away.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_POPOVER_SECOND_LINE_TV_ON": "Get the latest TV shows the day after they air.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE": "Xbox Video brings you the latest movies and TV shows you love, anywhere you are.",
+ "IDS_DEMO_VIDEO_SPOTLIGHT_SECOND_LINE_NONTV": "Xbox Video brings you the latest movies you love, anywhere you are.",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING": "Add to now playing",
+ "IDS_DETAILS_ADD_TO_NOW_PLAYING_ACTION": "add to now playing",
+ "IDS_DETAILS_ALL_EPISODES_LABEL": "All episodes",
+ "IDS_DETAILS_ARTIST_ALBUMS": "albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_ALL_LC": "all albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_LOCAL_LC": "my albums",
+ "IDS_DETAILS_ARTIST_ALBUMS_VIEW_ALL": "Show all albums",
+ "IDS_DETAILS_AUDIO_LANGUAGE": "{0} audio",
+ "IDS_DETAILS_BUY_ALBUM_LABEL": "Buy album",
+ "IDS_DETAILS_BUY_BUNDLE": "Buy bundle",
+ "IDS_DETAILS_BUY_EPISODE_LABEL": "Buy/rent",
+ "IDS_DETAILS_BUY_EPISODE_POPOVER_LABEL": "Buy episode",
+ "IDS_DETAILS_BUY_EXTRA": "Buy extra",
+ "IDS_DETAILS_BUY_SEASON_CURRENT_LABEL": "Buy season pass",
+ "IDS_DETAILS_BUY_SEASON_LABEL": "Buy season",
+ "IDS_DETAILS_BUY_SONG_LABEL": "Buy song",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT": "1 album",
+ "IDS_DETAILS_COLLECTION_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_DETAILS_COLLECTION_ALBUMS_COUNT": "{0} albums",
+ "IDS_DETAILS_COLLECTION_NO_SONGS": "no songs in collection",
+ "IDS_DETAILS_COLLECTION_SONG_COUNT": "1 song in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_COUNT": "{0} songs in collection",
+ "IDS_DETAILS_COLLECTION_SONGS_PLURAL": "[[1]{0} song in collection][[*]{0} songs in collection]",
+ "IDS_DETAILS_CURRENT_MEDIA_LABEL": "Now playing",
+ "IDS_DETAILS_DEMO_PURCHASED_LABEL": "Demo purchased",
+ "IDS_DETAILS_DESCRIPTION_LABEL": "Description",
+ "IDS_DETAILS_DEVELOPER_LABEL": "Developer",
+ "IDS_DETAILS_DOWNLOAD_FREE_EXTRA": "Get for Xbox 360",
+ "IDS_DETAILS_DOWNLOAD_LABEL": "Download",
+ "IDS_DETAILS_DOWNLOAD_LABEL_HD": "Download (HD)",
+ "IDS_DETAILS_DOWNLOAD_LABEL_SD": "Download (SD)",
+ "IDS_DETAILS_DURATION_HOURS_FORMAT": "{0} hr {1} min",
+ "IDS_DETAILS_DURATION_LABEL": "Duration",
+ "IDS_DETAILS_DURATION_MINS_FORMAT": "{0} min",
+ "IDS_DETAILS_DURATION_MINSEC_FORMAT": "{0} min {1} sec",
+ "IDS_DETAILS_EPISODES_LABEL": "Episodes",
+ "IDS_DETAILS_EPISODES_LABEL_LC": "episodes",
+ "IDS_DETAILS_EPISODES_LABEL_UC": "EPISODES",
+ "IDS_DETAILS_EXPLICIT_LABEL": "Explicit",
+ "IDS_DETAILS_EXPLICIT_LABEL_UC": "EXPLICIT",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL": "Extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_LC": "extras",
+ "IDS_DETAILS_EXTRA_EPISODE_LABEL_UC": "EXTRAS",
+ "IDS_DETAILS_EXTRA_FOR_GAME": "{0} for {1}",
+ "IDS_DETAILS_EXTRA_LAST_PURCHASE_ON_LABEL": "{0}, last purchased on {1}",
+ "IDS_DETAILS_EXTRA_PRICE_PURCHASE_ON": "{0}, purchased on {1}",
+ "IDS_DETAILS_EXTRA_PURCHASED_LABEL": "Extra purchased",
+ "IDS_DETAILS_EXTRA_PURCHASED_ON_LABEL": "Purchased on {0}",
+ "IDS_DETAILS_FEATURED_TRAILER_TITLE": "Official trailer",
+ "IDS_DETAILS_FEATURED_WATCH_TRAILER": "Play trailer",
+ "IDS_DETAILS_FILE_OPEN_LABEL": "Open file",
+ "IDS_DETAILS_GAME_PURCHASED_LABEL": "Game purchased",
+ "IDS_DETAILS_GENRE_LABEL": "Genres",
+ "IDS_DETAILS_HUB_MUSIC_ALBUMS": "Show all available albums from this artist.",
+ "IDS_DETAILS_HUB_TV_SEASONS": "Show all available seasons from this series.",
+ "IDS_DETAILS_LATEST_EPISODE_LABEL": "New episode available",
+ "IDS_DETAILS_METADATA_SEPERATOR": " • ",
+ "IDS_DETAILS_MORE_ACTION": "More",
+ "IDS_DETAILS_MY_ALBUMS": "In Collection",
+ "IDS_DETAILS_NETWORK_LABEL": "Network",
+ "IDS_DETAILS_NEW_EPISODE_LABEL": "New episode",
+ "IDS_DETAILS_NOT_RATED_LABEL": "NR",
+ "IDS_DETAILS_NOT_RATED_LONG_LABEL": "Not rated",
+ "IDS_DETAILS_OVERVIEW": "overview",
+ "IDS_DETAILS_PERC_WATCHED_LABEL": "{0}% watched",
+ "IDS_DETAILS_PICK_PROVIDER_DIALOG_TITLE": "Choose an app",
+ "IDS_DETAILS_PLATFORM_LABEL": "Platform",
+ "IDS_DETAILS_PLAY_ALBUM_BUTTON": "Play album",
+ "IDS_DETAILS_PLAY_NOW_LABEL": "Play",
+ "IDS_DETAILS_PLAY_ON_XBOX_APPBAR_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_ON_XBOX_LABEL": "Play on Xbox",
+ "IDS_DETAILS_PLAY_RADIO_MIX_NOW_LABEL": "Start radio",
+ "IDS_DETAILS_PLAY_SEASON_BUTTON": "Play season",
+ "IDS_DETAILS_PLAY_SMART_DJ_MIX_NOW_LABEL": "Play Smart DJ",
+ "IDS_DETAILS_PLAY_SONG_ON_XBOX_APPBAR_LABEL": "Play song on Xbox",
+ "IDS_DETAILS_PLAY_TRAILER_LABEL": "Play trailer",
+ "IDS_DETAILS_PLAYLIST_NO_SONGS": "no songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONG_COUNT": "1 song in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_COUNT": "{0} songs in playlist",
+ "IDS_DETAILS_PLAYLIST_SONGS_PLURAL": "[[1]{0} song in playlist][[*]{0} songs in playlist]",
+ "IDS_DETAILS_PREVIEW_ALBUM_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_ARTIST_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_EPISODE_LABEL": "Preview",
+ "IDS_DETAILS_PREVIEW_SONG_LABEL": "Preview",
+ "IDS_DETAILS_PUBLISHER_LABEL": "Publisher",
+ "IDS_DETAILS_QUALITY_LABEL": "Quality",
+ "IDS_DETAILS_RATING_LABEL": "Rating",
+ "IDS_DETAILS_RATING_USERRATED": "Your rating",
+ "IDS_DETAILS_RATINGS_PLURAL": "[[1]{0} rating][[*]{0} ratings]",
+ "IDS_DETAILS_RECENT_ALBUMS": "Latest Albums",
+ "IDS_DETAILS_RELATED_ARTISTS": "Related Artists",
+ "IDS_DETAILS_RELEASE_DATE_LABEL": "Release date",
+ "IDS_DETAILS_REVIEW_LABEL": "Review",
+ "IDS_DETAILS_SEASONS_LABEL": "Seasons",
+ "IDS_DETAILS_SHUFFLE_ALL": "Shuffle all",
+ "IDS_DETAILS_SIMILAR_MOVIES": "Similar Movies",
+ "IDS_DETAILS_START_DOWNLOAD_LABEL": "Start download",
+ "IDS_DETAILS_STUDIO_LABEL": "Studio",
+ "IDS_DETAILS_TITLE_NAR": "Details for {0}",
+ "IDS_DETAILS_TOP_SONGS": "Top Songs",
+ "IDS_DETAILS_TRACK_NUM_FORMAT": "{0}.",
+ "IDS_DETAILS_TRACKS_LABEL": "Songs",
+ "IDS_DETAILS_TRY_AGAIN_LABEL": "Try again",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_HD": "Try again (HD)",
+ "IDS_DETAILS_TRY_AGAIN_LABEL_SD": "Try again (SD)",
+ "IDS_DETAILS_TVSERIES_SEASONS": "seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_ALL": "all seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_LOCAL": "my seasons",
+ "IDS_DETAILS_TVSERIES_SEASONS_VIEW_ALL": "Show all seasons",
+ "IDS_DETAILS_UNRATED_LABEL": "UR",
+ "IDS_DETAILS_UNRATED_LONG_LABEL": "Unrated",
+ "IDS_DETAILS_VIDEO_HUB_RELATED": "you may also like",
+ "IDS_DETAILS_VIDEO_HUB_RELATED_UC": "YOU MAY ALSO LIKE",
+ "IDS_DETAILS_VIEW_FULL_APP": "Explore app",
+ "IDS_DETAILS_VIEW_FULL_ARTIST": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_ARTIST_APPBAR": "Explore artist",
+ "IDS_DETAILS_VIEW_FULL_GAME": "Explore game",
+ "IDS_DETAILS_VIEW_FULL_MOVIE": "Explore movie",
+ "IDS_DETAILS_VIEW_FULL_SEASON": "Show seasons",
+ "IDS_DETAILS_VIEW_FULL_SERIES": "Explore series",
+ "IDS_DETAILS_VIEW_MORE": "Show more",
+ "IDS_DETAILS_WATCH_NOW_LABEL": "Watch",
+ "IDS_DETAILS_WATCH_ON_XBOX_LABEL": "Buy/rent",
+ "IDS_DETAILS_WATCH_TRAILER_LABEL": "Watch trailer",
+ "IDS_DIALOG_ERROR_CODE": "STATUS CODE",
+ "IDS_DIALOG_ERROR_FEEDBACKLINK": "Give Microsoft feedback about this problem",
+ "IDS_DIALOG_ERROR_MORE_INFO": "Find help for this",
+ "IDS_DIALOG_SESSION_TIMED_OUT_MESSAGE": "Your session has timed out. Try again?",
+ "IDS_DIALOG_SESSION_TIMED_OUT_TITLE": "Lost connection.",
+ "IDS_DIALOG_UNEXPECTED_ERROR_CAPTION": "There's a problem.",
+ "IDS_DOWNLOAD_ERROR_CANT_DOWNLOAD": "Can't download",
+ "IDS_DOWNLOAD_ERROR_CAPTION": "Can't download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_ALL": "Cancel all",
+ "IDS_DOWNLOAD_ERROR_DIALOG_CANCEL_DOWNLOAD": "Cancel Download",
+ "IDS_DOWNLOAD_ERROR_DIALOG_DOWNLOAD_ERRORS": "There were problems with your download.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_INSTRUCTIONS": "Tap a song to retry, or cancel a download to see detailed info on a problem.",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_ALL_DOWNLOADS": "Retry all downloads",
+ "IDS_DOWNLOAD_ERROR_DIALOG_RETRY_DOWNLOAD": "Retry download",
+ "IDS_DOWNLOAD_ERROR_TRY_AGAIN_LATER": "Try again later",
+ "IDS_DOWNLOAD_LABEL": "Keep Offline",
+ "IDS_EDIT_BUTTON": "Edit",
+ "IDS_EDITBOX_ERROR_NUMBER": "Use numbers in this field.",
+ "IDS_EDITBOX_REMAINING_PLURAL": "[[1]{0} character remaining][[*]{0} characters remaining]",
+ "IDS_EMPTY_VIEW": "There's nothing to show here right now. Please check back later.",
+ "IDS_FAILED_PANEL_HEADER": "We can't connect to Xbox services right now.",
+ "IDS_FAILED_PANEL_LABEL": "Make sure you have Internet access, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_DESC": "To use Xbox services, connect to the Internet, then try again.",
+ "IDS_FAILED_PANEL_OFFLINE_HEADER": "Your PC is offline.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_MESSAGE": "We've enabled new features! To see them, please restart this app.",
+ "IDS_FEATURE_ENABLEMENT_FEATURES_DIALOG_TITLE": "New features available",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_HEADER": "App update",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_DISABLED": "Please restart the app.",
+ "IDS_FEATURE_ENABLEMENT_NOTIFICATION_MESSAGE_ENABLED": "Restart for new features.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_LONG": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_LOW_DISK_SPACE_SHORT": "Can't download {0} (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_LONG": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_NO_RIGHTS_SHORT": "Can't download {0} (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_LONG": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_GLOBAL_TRY_AGAIN_LATER_SHORT": "Can't download {0} (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_LONG": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_LOW_DISK_SPACE_SHORT": "Can't download (low disk space)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_LONG": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NO_RIGHTS_SHORT": "Can't download (no rights)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_NOT_AVAILABLE_LIBRARY": "Couldn't download to your library. That path is no longer available. If you're using external storage, make sure it's available and connected.",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_LONG": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_CANT_DOWNLOAD_TRY_AGAIN_LATER_SHORT": "Can't download (try again later)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_LONG": "Download canceled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_CANCELED_SHORT": "Download canceled",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_LONG": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_COMPLETE_SHORT": "Download complete: {0}",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_LONG": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_LONG": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_METERED_NETWORK_SHORT": "Downloads paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_LONG": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_OFFLINE_SHORT": "Downloads paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_SHORT": "Downloads paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_LONG": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_APPROACHING_SHORT": "Downloads paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_LONG": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_GLOBAL_USAGE_LIMIT_SHORT": "Downloads paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_LONG": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_LONG": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_METERED_NETWORK_SHORT": "Download paused (metered network)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_LONG": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_OFFLINE_SHORT": "Download paused (offline)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_SHORT": "Download paused",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_LONG": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_APPROACHING_SHORT": "Download paused (usage limit approaching)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_LONG": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PAUSED_USAGE_LIMIT_SHORT": "Download paused (usage limit)",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_LONG": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOAD_PENDING_SHORT": "Download pending...",
+ "IDS_FILE_TRANSFER_DOWNLOADED": "Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_LONG": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_EPISODE_SHORT": "1 downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_LONG": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_1_TRACK_SHORT": "Downloading 1 song",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_LONG_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT": "{0} downloading",
+ "IDS_FILE_TRANSFER_DOWNLOADING_EPISODES_SHORT_PLURAL": "[[*]{0} downloading]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_LONG": "Some things didn't download ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_ERROR_SHORT": "Problem downloading ({0})",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_LONG_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT": "{0}% Downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_PERCENT_SHORT_LC": "{0}% downloaded",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_LONG": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_QUEUE_SHORT": "Queued for download",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_LONG_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT": "Downloading {0} songs",
+ "IDS_FILE_TRANSFER_DOWNLOADING_TRACKS_SHORT_PLURAL": "[[1]Downloading {0} song][[*]Downloading {0} songs]",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_LONG": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_GB_SHORT": "To download, first delete unnecessary items to free up {0} GB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_LONG": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_LONG": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_MB_SHORT": "To download, first delete unnecessary items to free up {0} MB.",
+ "IDS_FILE_TRANSFER_FIRST_DELETE_UNNECESSARY_ITEMS_SHORT": "To download, first delete unnecessary items to free up disk space.",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_LONG": "You're low on storage space",
+ "IDS_FILE_TRANSFER_LOW_ON_STORAGE_SPACE_SHORT": "You're low on storage space",
+ "IDS_FILTER_ALL": "all",
+ "IDS_FILTER_ALL_GENRES": "all genres",
+ "IDS_FILTER_ALL_GENRES_SC": "All genres",
+ "IDS_FILTER_ALL_SUBGENRES_SC": "All subgenres",
+ "IDS_FILTER_BY": "By",
+ "IDS_FILTER_SORTED_BY": "arranged by",
+ "IDS_GLOBAL_COMMAND_HELP": "Help",
+ "IDS_GLOBAL_COMMAND_HOME": "Home",
+ "IDS_GLOBAL_COMMAND_NOW_PLAYING": "Now Playing",
+ "IDS_GLOBAL_COMMAND_RESTORE_PURCHASES": "Restore purchases",
+ "IDS_GLOBAL_COMMAND_SEARCH": "Search",
+ "IDS_HHMMSS_DURATION": "{0}:{1}:{2}",
+ "IDS_HOME_NOW_PLAYING": "Now Playing",
+ "IDS_HOME_NOW_PLAYING_EPISODE": "Now Playing - {0}",
+ "IDS_HOME_NOW_PLAYING_JUMP_IN": "Jump in",
+ "IDS_HOME_NOW_PLAYING_LC": "now playing",
+ "IDS_HOME_NOW_PLAYING_RESUME": "Resume",
+ "IDS_HOME_NOW_PLAYING_RESUME_ARIA": "Resume - {0}",
+ "IDS_HOME_NOW_PLAYING_XBOX": "On your Xbox",
+ "IDS_HOME_NOW_PLAYING_XBOX_LAST_PLAYED": "Last played on your Xbox",
+ "IDS_HOME_PIVOT": "home",
+ "IDS_HOME_TILE_PAUSED_LABEL": "paused",
+ "IDS_LOADING_STATUS_LABEL": "Loading",
+ "IDS_MANAGE_FOLDERS_ADD_FOLDER_NAR": "Add folder",
+ "IDS_MANAGE_FOLDERS_DESCRIPTION": "Right now, we're watching these folders:",
+ "IDS_MANAGE_FOLDERS_DONE_BUTTON": "Done",
+ "IDS_MANAGE_FOLDERS_EXCLUDE_FOLDER_NAR": "Exclude folder",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TEXT": "To remove this folder, add another one first.",
+ "IDS_MANAGE_FOLDERS_LAST_FOLDER_ERROR_TITLE": "Your collection needs at least one folder to work.",
+ "IDS_MANIFEST_MEDIA_BROWSER2_APP_DESCRIPTION": "Media Browser",
+ "IDS_MANIFEST_MEDIA_PLAYER_APP_DESCRIPTION": "Media Player",
+ "IDS_MANIFEST_MEDIA_PLAYER_PREVIEW_APP_DESCRIPTION": "Media Player Preview",
+ "IDS_MANIFEST_MUSIC_APP_DESCRIPTION": "Music",
+ "IDS_MANIFEST_MUSIC_APP_NAME": "Music",
+ "IDS_MANIFEST_TEST_APP_DESCRIPTION": "Xbox on Windows",
+ "IDS_MANIFEST_VIDEO_APP_DESCRIPTION": "Video",
+ "IDS_MANIFEST_VIDEO_APP_NAME": "Video",
+ "IDS_MARKETPLACE_BY_PLAYRANK": "by most played",
+ "IDS_MARKETPLACE_PIVOT": "all music",
+ "IDS_MARKETPLACE_REGION_EMPTY": "There's nothing available in your region just yet. Please check back soon!",
+ "IDS_MARKETPLACE_SORT_BEST_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_CRITIC_RATING": "critic rating",
+ "IDS_MARKETPLACE_SORT_PLAY_RANK": "most played",
+ "IDS_MARKETPLACE_SORT_POPULARITY": "most played",
+ "IDS_MARKETPLACE_SORT_RELEASE_DATE": "release date",
+ "IDS_MARKETPLACE_SORT_SALES_RANK": "top selling",
+ "IDS_MARKETPLACE_SORT_TITLE": "title",
+ "IDS_MARKETPLACE_SORT_TOP_RENTED": "top rented",
+ "IDS_MARKETPLACE_SORT_TOP_SELLING": "top selling",
+ "IDS_MARKETPLACE_SORT_USER_RATING": "customer rating",
+ "IDS_MARKETPLACE_TOOLTIP_IN_COLLECTION": "In collection",
+ "IDS_MEDIA_ERROR_CAPTION": "Media problem.",
+ "IDS_MEDIA_STATUS_DOWNLOAD_ERROR_ICON": "Song Download Error",
+ "IDS_MEDIA_STATUS_DOWNLOADING_ICON": "Song is Downloading",
+ "IDS_MEDIA_STATUS_INLINE_STREAMING_ICON": "Media is available for streaming",
+ "IDS_MEDIA_STATUS_NOW_PLAYING_ICON": "Song is playing",
+ "IDS_MEDIA_STATUS_PLAYBACK_ERROR_ICON": "Sorry, can't play. Please try again.",
+ "IDS_MEDIA_STATUS_STREAMING_MONTHLY_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your monthly streaming limit.",
+ "IDS_MEDIA_STATUS_STREAMING_TRACK_LIMIT_HIT_ICON": "Sorry, can't play. You've reached your play limit for this song.",
+ "IDS_MEDIATYPE_ALBUM": "Album",
+ "IDS_MEDIATYPE_ARTIST": "Artist",
+ "IDS_MEDIATYPE_GAME": "Xbox 360 game",
+ "IDS_MEDIATYPE_GAME_WINDOWS": "Windows game",
+ "IDS_MEDIATYPE_MOVIE": "Movie",
+ "IDS_MEDIATYPE_PLAYLIST": "Playlist",
+ "IDS_MEDIATYPE_SONG": "Song",
+ "IDS_MEDIATYPE_TVEPISODE": "TV Episode",
+ "IDS_MEDIATYPE_TVSEASON": "TV Season",
+ "IDS_MEDIATYPE_TVSERIES": "TV Series",
+ "IDS_MMSS_DURATION": "{0}:{1}",
+ "IDS_MODIFIER_PREFIX_SORTBY": "arrange by:",
+ "IDS_MODIFIER_PREFIX_VIEW": "show:",
+ "IDS_MODIFIER_PREFIX_VIEWBY": "arrange by",
+ "IDS_MOGO_NOW_PLAYING": "Now playing",
+ "IDS_MOGO_NOW_PLAYING_XBOXMUSIC": "Now playing on Xbox Music",
+ "IDS_MOGO_NOW_PLAYING_XBOXVIDEO": "Now playing on Xbox Video",
+ "IDS_MOGO_RESUME": "Resume",
+ "IDS_MOGO_XBOX_MUSIC_XENON": "{0} Xbox Music",
+ "IDS_MOGO_XBOX_VIDEO_XENON": "{0} Xbox Video",
+ "IDS_MUSIC_ALBUMS_PIVOT": "albums",
+ "IDS_MUSIC_ALBUMS_PIVOT_TC": "Albums",
+ "IDS_MUSIC_APP_TITLE": "music",
+ "IDS_MUSIC_APP_TITLE_TC": "Music",
+ "IDS_MUSIC_ARTISTS_PIVOT": "artists",
+ "IDS_MUSIC_ARTISTS_PIVOT_TC": "Artists",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY": "Music automatically pulls in songs from your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library to your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_BODY_XBOX": "Xbox Music automatically pulls in music from your Windows music library. Go to File Explorer and tap Manage, Manage Library, Add, and then point the library to your music.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_LINK": "Tap for more info.",
+ "IDS_MUSIC_CLOUD_ADD_MUSIC_DIALOG_TITLE": "Add music to your Windows music library.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NEW_NOTIFICATION_BODY": "Learn how to fix it",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_BODY": "We think we can help. Tap to learn more.",
+ "IDS_MUSIC_CLOUD_ADDING_FAILED_NOTIFICATION_TITLE": "It looks like a lot of your music isn't showing up right.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NEW_NOTIFICATION_BODY": "Choose where we look",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_ADDING_MUSIC_NOTIFICATION_TITLE": "We're adding music from this PC.",
+ "IDS_MUSIC_CLOUD_ALBUMS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} album added to your music][[*]{0} albums added to your music]",
+ "IDS_MUSIC_CLOUD_ARTISTS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} artist added to your music][[*]{0} artists added to your music]",
+ "IDS_MUSIC_CLOUD_EMPTY_CLOUD_TITLE": "You have nothing in the cloud just yet.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY1": "Listen to millions of songs for free.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_BODY2": "Enjoy your music on all your PCs.",
+ "IDS_MUSIC_CLOUD_FREE_BENEFITS_DIALOG_TITLE": "Free",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_DESC": "These are songs you own that aren't available in the cloud. To make them available, tap Add To and choose Cloud Collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_LOCAL_TITLE": "No icon",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_DESC": "You can play these songs whether you're online or offline. This icon appears beside anything that's available in the cloud and anything you've downloaded using Xbox Music Pass.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_MATCHED_TITLE": "Available here and in the cloud",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_DESC": "You can play these songs whenever you're online and signed in. While playing songs from Xbox Music, you'll see or hear occasional ads. To avoid interruptions, sign up for Xbox Music Pass and enjoy unlimited listening to millions of songs.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_REMOTE_TITLE": "Streaming only",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_SUBTEXT": "You'll see the following icons on songs and albums in your music collection.",
+ "IDS_MUSIC_CLOUD_ICON_DIALOG_TITLE": "Icons in your music collection",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_DESC": "Tap to learn about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_ACTION_TITLE": "Tell me about music in the cloud",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_BODY": "Your music in the cloud will automatically appear on your other Windows 8/Windows RT devices.\n\nWith Xbox Music Pass, you'll also see your cloud music on your phone and Xbox 360.",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_PREMIUM_LINK": "Learn more about Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_INFO_DIALOG_TITLE": "Music in the cloud",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_BODY": "If you're not seeing all your music, tap here to learn about managing the music on your PC.",
+ "IDS_MUSIC_CLOUD_MUSIC_ADDED_NOTIFICATION_TITLE": "All done! We've added the music from this PC.",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDED_NOTIFICATION_LINE1": "Added your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_ADDING_NOTIFICATION_LINE1": "Adding your music",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_1_SONG": "{0} song",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_N_SONGS": "{0} songs",
+ "IDS_MUSIC_CLOUD_NEW_MUSIC_NOTIFICATION_LINE2_SONGS_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NEW_NOTIFICATION_BODY": "Change where we look",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_BODY": "If you're not seeing your music, tap here to learn about managing your PC's Music library.",
+ "IDS_MUSIC_CLOUD_NO_MUSIC_NOTIFICATION_TITLE": "We didn't find any music on this PC.",
+ "IDS_MUSIC_CLOUD_POPULATED_NEW_NOTIFICATION_BODY": "Learn more about how it works",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_BODY": "Tap to learn more.",
+ "IDS_MUSIC_CLOUD_POPULATED_NOTIFICATION_TITLE": "Your collection now includes music you've added from Xbox Music.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY1": "Enjoy your pass on your mobile devices.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY2": "Enjoy ad-free listening.",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_BODY3": "Download songs to listen to later",
+ "IDS_MUSIC_CLOUD_PREMIUM_BENEFITS_DIALOG_TITLE": "Xbox Music Pass",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE1_PLURAL": "[[1]{0} song added to your music][[*]{0} songs added to your music]",
+ "IDS_MUSIC_CLOUD_SONGS_ADDED_NOTIFICATION_LINE2": "Also available on other devices",
+ "IDS_MUSIC_COLLECTION_EMPTY_DESC": "Find new tunes and old favorites.",
+ "IDS_MUSIC_COLLECTION_EMPTY_TITLE": "No music in your collection",
+ "IDS_MUSIC_COLLECTION_PIVOT": "my music",
+ "IDS_MUSIC_COLLECTION_PIVOT_TC": "My Music",
+ "IDS_MUSIC_DEVICES_PIVOT": "devices",
+ "IDS_MUSIC_DEVICES_PIVOT_TC": "Devices",
+ "IDS_MUSIC_EXPLORE_PIVOT": "explore",
+ "IDS_MUSIC_EXPLORE_PIVOT_TC": "Explore",
+ "IDS_MUSIC_FEATURED_PIVOT": "featured",
+ "IDS_MUSIC_GENRES_PIVOT": "genres",
+ "IDS_MUSIC_LOCATION_DMZ": "Temporary Cache",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_DESC": "Try a different genre or filter.",
+ "IDS_MUSIC_MARKETPLACE_EMPTY_TITLE": "There's nothing to show here",
+ "IDS_MUSIC_MARKETPLACE_PIVOT": "all music",
+ "IDS_MUSIC_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_MUSIC_PIVOT": "music",
+ "IDS_MUSIC_RADIO_PIVOT": "radio",
+ "IDS_MUSIC_RADIO_PIVOT_TC": "Radio",
+ "IDS_MUSIC_SONGS_PIVOT_TC": "Songs",
+ "IDS_MUSIC_STORE_PIVOT": "store",
+ "IDS_MUSIC_STORE_PIVOT_TC": "Store",
+ "IDS_MUSIC_TOP_ALBUMS_PIVOT": "top",
+ "IDS_MUSIC_VIEW_PLAYLIST": "Show song list",
+ "IDS_MY_MUSIC_BUTTON_DESC": "My music",
+ "IDS_MY_MUSIC_LIBRARY_SETTINGS_TITLE": "My Music",
+ "IDS_N_FILTER_IN": "{0} {1}",
+ "IDS_N_SORTED_BY": "{0} {1} arranged by",
+ "IDS_NAV_PANE_HIDE_MENU": "Hide menu",
+ "IDS_NAV_PANE_SHOW_MENU": "Show menu",
+ "IDS_NETWORK_STATUS_HEADER": "Network status",
+ "IDS_NETWORK_STATUS_LOCAL_ONLY": "Now local only",
+ "IDS_NETWORK_STATUS_NONE": "Offline",
+ "IDS_NETWORK_STATUS_OVER_THE_LIMIT": "Over data limit",
+ "IDS_NETWORK_STATUS_ROAMING": "Roaming",
+ "IDS_NETWORK_STATUS_THROTTLED": "Limited network",
+ "IDS_NETWORK_STATUS_UNRESTRICTED": "Now unrestricted",
+ "IDS_NEXT_BUTTON": "Next",
+ "IDS_NO_BUTTON": "No",
+ "IDS_NOT_AVAILABLE_OFFLINE": "Not available offline",
+ "IDS_NOW_PLAYING_DETAILS_BUTTON": "Details",
+ "IDS_NOW_PLAYING_OP_ADD_ALBUM_ACTION": "Add this album to my music",
+ "IDS_NOW_PLAYING_OP_ADD_SONG_ACTION": "Add this song to my music",
+ "IDS_NOW_PLAYING_OP_BIO_ACTION": "Check out the bio",
+ "IDS_NOW_PLAYING_OP_DISCOGRAPHY_ACTION": "See other albums from this artist",
+ "IDS_NOW_PLAYING_OP_RADIO_ACTION": "Start radio",
+ "IDS_NOW_PLAYING_OP_SAVE_NOW_PLAYING_ACTION": "Save this as a playlist",
+ "IDS_NOW_PLAYING_OP_SHARE_ACTION": "Share with a friend",
+ "IDS_NOW_PLAYING_OP_SMARTDJ_ACTION": "Play Smart DJ",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_ACTION": "Play top songs",
+ "IDS_NOW_PLAYING_OP_TOP_SONGS_RELATED_ACTION": "Play top songs for this related artist",
+ "IDS_NOW_PLAYING_PANEL_TITLE_LC": "now playing",
+ "IDS_NOW_PLAYING_PLAYLIST_BUTTON": "Now playing",
+ "IDS_NOW_PLAYING_REMOVE_TRACK_ACTION": "Remove from list",
+ "IDS_NUMBER_SYMBOL": "#",
+ "IDS_OK_BUTTON": "OK",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_NEXT_PAGE": "Next Page",
+ "IDS_PAGED_ITEMS_CONTROL_ACC_PREVIOUS_PAGE": "Previous Page",
+ "IDS_PIN_TO_START_LINK_ERROR_TEXT": "Sorry, we can't find that. It might have been moved or deleted.",
+ "IDS_PIN_TO_START_SCREEN_BUTTON": "Pin to start",
+ "IDS_PLAY_ALL": "Play all",
+ "IDS_PLAY_ALL_DESC": "Shuffle all music",
+ "IDS_PLAY_ALL_LABEL": "Play all music",
+ "IDS_PLAY_ALL_SHUFFLED": "Play all shuffled",
+ "IDS_PLAY_BUTTON": "Play",
+ "IDS_PLAY_BUTTON_VIDEO": "Play",
+ "IDS_PLAYBACK_DURATION_PROGRESS": "{0}/{1}",
+ "IDS_PLAYBACK_ERROR_MESSAGE_TITLE": "Can't play.",
+ "IDS_PLAYBACK_ERROR_NOT_AVAILABLE_OFFLINE": "This song isn't available when you're offline. To play it, connect to the Internet.",
+ "IDS_PLAYBACK_ERROR_PLAYLIST_FILE_CORRUPT_TITLE": "Try a different playlist.",
+ "IDS_PLAYBACK_ERROR_SIGN_IN_REQUIRED": "To play this song, you need to sign in.",
+ "IDS_PLAYLIST_BUTTON_DESC": "Playlists",
+ "IDS_PROGRESS_NAR": "{0} of {1}",
+ "IDS_PROVISIONING_ACCEPT_BUTTON": "I Accept",
+ "IDS_PROVISIONING_ACCEPTANCE_DESC": "Clicking \"I Accept\" means you have read and agree to the following:",
+ "IDS_PROVISIONING_ALREADY_HAVE_BUTTON": "Already have an Xbox profile?",
+ "IDS_PROVISIONING_ALREADY_HAVE_DESC": "Choose Cancel and sign in with your other Microsoft account.",
+ "IDS_PROVISIONING_CANCEL_BUTTON": "Cancel",
+ "IDS_PROVISIONING_CHILD_LIST_COMEBACK": "{0}. Come back here",
+ "IDS_PROVISIONING_CHILD_LIST_SIGNIN": "{0}. Click here to sign in",
+ "IDS_PROVISIONING_CHILD_LIST_TITLE": "Do the following:",
+ "IDS_PROVISIONING_CHILD_LIST_XBOX_LINK": "{0}. Make your profile at Xbox.com",
+ "IDS_PROVISIONING_CHILD_SUBTITLE": "To make your profile, please go to Xbox.com. You'll need a parent to approve it.",
+ "IDS_PROVISIONING_CHILD_TITLE": "Parent Needed",
+ "IDS_PROVISIONING_EXPLANATION": "Adding an online Xbox membership to your Microsoft account lets you participate in great Xbox gaming and entertainment.",
+ "IDS_PROVISIONING_PRIVACY_LINK": "Privacy Statement",
+ "IDS_PROVISIONING_TITLE": "To continue, create an Xbox profile",
+ "IDS_PROVISIONING_TOS_LINK": "Xbox Terms of Use",
+ "IDS_PROVISIONING_USER_EMAIL": "Your login: {0}",
+ "IDS_PURCHASE_ERROR_CAPTION": "There's a problem.",
+ "IDS_PURCHASE_ERROR_MESSAGE": "Sorry, we can't complete your purchase right now.",
+ "IDS_PURCHASE_ERROR_MESSAGE_TITLE": "Try again later",
+ "IDS_RADIO_ERROR_CAPTION": "Radio",
+ "IDS_READ_LESS": "Read less",
+ "IDS_READ_MORE": "Read more",
+ "IDS_RECENT_LAST_WEEK": "last week",
+ "IDS_RECENT_THIS_MONTH": "this month",
+ "IDS_RECENT_THIS_WEEK": "this week",
+ "IDS_REMOVE_BUTTON": "Remove",
+ "IDS_RENT_BUTTON": "Rent",
+ "IDS_RESTART_BUTTON": "Restart",
+ "IDS_RESUME_BUTTON": "Resume",
+ "IDS_SAVE_BUTTON": "Save",
+ "IDS_SEARCH_ALBUMLOCAL_LABEL": "Album \nCollection \n({0})",
+ "IDS_SEARCH_ALBUMMARKETPLACE_LABEL": "Music Store: \nAlbums \n({0})",
+ "IDS_SEARCH_ALBUMS_GROUP_HEADER_LABEL": "Albums ({0})",
+ "IDS_SEARCH_ALBUMS_PIVOT_LABEL": "albums ({0})",
+ "IDS_SEARCH_ALBUMS_RESULT_TITLE": "Album results for \"{0}\"",
+ "IDS_SEARCH_ALL_PIVOT_LABEL": "all results ({0})",
+ "IDS_SEARCH_ARTISTLOCAL_LABEL": "Artist \nCollection \n({0})",
+ "IDS_SEARCH_ARTISTMARKETPLACE_LABEL": "Music Store: \nArtists \n({0})",
+ "IDS_SEARCH_ARTISTS_GROUP_HEADER_LABEL": "Artists ({0})",
+ "IDS_SEARCH_ARTISTS_PIVOT_LABEL": "artists ({0})",
+ "IDS_SEARCH_ARTISTS_RESULT_TITLE": "Artist results for \"{0}\"",
+ "IDS_SEARCH_BUTTON": "Search",
+ "IDS_SEARCH_FILTER_ALL": "all results",
+ "IDS_SEARCH_FILTER_COLLECTION": "My videos",
+ "IDS_SEARCH_FILTER_MARKETPLACE": "all music",
+ "IDS_SEARCH_FILTER_MARKETPLACE_VIDEO": "Xbox Video Store",
+ "IDS_SEARCH_HCR_WITH_KEYWORD_NAR": "Best match for {0}",
+ "IDS_SEARCH_INMYVIDEOS_LABEL": "in my videos",
+ "IDS_SEARCH_MODIFIER_PIVOT_LABEL": "All",
+ "IDS_SEARCH_MOVIELOCAL_LABEL": "My \nMovies \n({0})",
+ "IDS_SEARCH_MOVIEMARKETPLACE_LABEL": "Video Store: \nMovies \n({0})",
+ "IDS_SEARCH_MUSICHUB_TITLE": "music ({0})",
+ "IDS_SEARCH_NORESULT_TITLE": "no results for \"{0}\"",
+ "IDS_SEARCH_NORESULT_TITLE_TC": "No Results for \"{0}\"",
+ "IDS_SEARCH_NOTSIGNEDIN": "Sign in to see full results.",
+ "IDS_SEARCH_OTHERVIDEOSLOCAL_LABEL": "My \nvideos \n({0})",
+ "IDS_SEARCH_PIVOT": "search",
+ "IDS_SEARCH_PLAYLISTS_GROUP_HEADER_LABEL": "Playlists ({0})",
+ "IDS_SEARCH_PLAYLISTS_PIVOT_LABEL": "playlists ({0})",
+ "IDS_SEARCH_RESULT_TITLE": "results for \"{0}\"",
+ "IDS_SEARCH_RESULT_TITLE_TC": "Results for \"{0}\"",
+ "IDS_SEARCH_SEARCHSTARTED": "searching...",
+ "IDS_SEARCH_SONGLOCAL_LABEL": "My \nSongs \n({0})",
+ "IDS_SEARCH_SONGMARKETPLACE_LABEL": "Music Store: \nSongs \n({0})",
+ "IDS_SEARCH_SONGS_GROUP_HEADER_LABEL": "Songs ({0})",
+ "IDS_SEARCH_SONGS_PIVOT_LABEL": "songs ({0})",
+ "IDS_SEARCH_TRACKS_RESULT_TITLE": "Song results for \"{0}\"",
+ "IDS_SEARCH_TVSERIESLOCAL_LABEL": "My \nTV Shows \n({0})",
+ "IDS_SEARCH_TVSERIESMARKETPLACE_LABEL": "Video Store: \nTV Shows \n({0})",
+ "IDS_SEARCH_VIDEOHUB_TITLE": "videos ({0})",
+ "IDS_SEE_ALL_BUTTON": "Show all",
+ "IDS_SEE_LESS_BUTTON": "Show less",
+ "IDS_SEE_MORE_BUTTON": "Show more",
+ "IDS_SERVICE_UNAVAILABLE_CAPTION": "Sorry, the Xbox service isn't available right now.",
+ "IDS_SET_BUTTON": "Set",
+ "IDS_SETTINGS_ABOUT_ABOUT_ADS": "About our ads",
+ "IDS_SETTINGS_ABOUT_CODE_CONDUCT": "Code of Conduct",
+ "IDS_SETTINGS_ABOUT_DESCRIPTION": "This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.",
+ "IDS_SETTINGS_ABOUT_LEARN_MORE": "Learn more at Xbox.com",
+ "IDS_SETTINGS_ABOUT_ONLINE_CONTENT": "Online content",
+ "IDS_SETTINGS_ABOUT_PRERELEASE_VERSION": "Version: {0} ({1}, {2}{3})",
+ "IDS_SETTINGS_ABOUT_PRIVACY_STATEMENT": "Privacy statement",
+ "IDS_SETTINGS_ABOUT_SUPPORT": "Support",
+ "IDS_SETTINGS_ABOUT_TITLE": "About",
+ "IDS_SETTINGS_ABOUT_TOS": "Terms of Service",
+ "IDS_SETTINGS_ABOUT_VERSION_FORMAT": "{0}.{1}.{2}.{3}",
+ "IDS_SETTINGS_ACCOUNT_BILLING_HISTORY_TC": "Billing History",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_INFO_TC": "Billing Contact Information",
+ "IDS_SETTINGS_ACCOUNT_CONTACT_PREFERENCES_TC": "Contact Preferences",
+ "IDS_SETTINGS_ACCOUNT_CURRENT_USER": "You're signed in as {0}",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_DESC_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_DEVICES_HEADER_TC": "Manage Xbox Music Devices",
+ "IDS_SETTINGS_ACCOUNT_MANAGE_PAYMENT_TC": "Manage Payment Options",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_NONE_TC": "Get Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_DESC_UKNOWN_TC": "More",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FOURTEEN_DAY_TRIAL": "Trial 14 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_ONE_MONTH": "Free 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_THREE_MONTH": "Free 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_FREE_TWELVE_MONTH": "Free 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_HEADER_TC": "Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_ONE_MONTH": "1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_ONE_MONTH": "Prepaid 1 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_THREE_MONTH": "Prepaid 3 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_PREPAID_TWELVE_MONTH": "Prepaid 12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_THIRTY_DAY_TRIAL": "Trial 30 Day Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_MUSIC_PASS_TWELVE_MONTH": "12 Month Xbox Music Pass",
+ "IDS_SETTINGS_ACCOUNT_PRIVACY_SETTINGS_TC": "Privacy and Online Settings",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_DESC_TC": "Enter a code to get a Gold Membership, Xbox Music Pass, or other stuff (where available).",
+ "IDS_SETTINGS_ACCOUNT_REDEEM_CODE_HEADER_TC": "Redeem Code",
+ "IDS_SETTINGS_ACCOUNT_SIGN_OUT_TC": "Sign Out",
+ "IDS_SETTINGS_ACCOUNT_TITLE": "Account",
+ "IDS_SETTINGS_ACCOUNT_TITLE_TC": "My Account",
+ "IDS_SETTINGS_ACCOUNT_YOUR_ACCOUNT_TC": "Your Account",
+ "IDS_SETTINGS_CAPTIONS_AUTO_MUTED": "Show captions when sound is muted",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_COLOR": "Caption background color",
+ "IDS_SETTINGS_CAPTIONS_BACKGROUND_OPACITY": "Background transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_COLOR": "Character color",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_OPACITY": "Character transparency",
+ "IDS_SETTINGS_CAPTIONS_CHARACTER_SIZE": "Character size",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLACK": "black",
+ "IDS_SETTINGS_CAPTIONS_COLOR_BLUE": "blue",
+ "IDS_SETTINGS_CAPTIONS_COLOR_CYAN": "cyan",
+ "IDS_SETTINGS_CAPTIONS_COLOR_GREEN": "green",
+ "IDS_SETTINGS_CAPTIONS_COLOR_MAGENTA": "magenta",
+ "IDS_SETTINGS_CAPTIONS_COLOR_RED": "red",
+ "IDS_SETTINGS_CAPTIONS_COLOR_WHITE": "white",
+ "IDS_SETTINGS_CAPTIONS_COLOR_YELLOW": "yellow",
+ "IDS_SETTINGS_CAPTIONS_DEFAULT": "default",
+ "IDS_SETTINGS_CAPTIONS_EDGE_ATTRIBUTE": "Character edge style",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DEPRESSED": "depressed",
+ "IDS_SETTINGS_CAPTIONS_EDGE_DROP": "dropshadow",
+ "IDS_SETTINGS_CAPTIONS_EDGE_NONE": "none",
+ "IDS_SETTINGS_CAPTIONS_EDGE_RAISED": "raised",
+ "IDS_SETTINGS_CAPTIONS_EDGE_UNIFORMED": "uniform",
+ "IDS_SETTINGS_CAPTIONS_FONT_CASUAL": "casual",
+ "IDS_SETTINGS_CAPTIONS_FONT_CURSIVE": "cursive",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SANS": "monospaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_MONOSPACED_SERIF": "monospaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SANS": "proportionally spaced without serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_PROPORTIONAL_SERIF": "proportionally spaced with serifs",
+ "IDS_SETTINGS_CAPTIONS_FONT_SMALL_CAPS": "small capitals",
+ "IDS_SETTINGS_CAPTIONS_FONT_STYLE": "Font style",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_OPAQUE": "solid",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_SEMI_TRANSPARENT": "semitransparent",
+ "IDS_SETTINGS_CAPTIONS_OPACITY_TRANSPARENT": "transparent",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW": "Preview",
+ "IDS_SETTINGS_CAPTIONS_PREVIEW_TITLE": "Caption preview",
+ "IDS_SETTINGS_CAPTIONS_RESET_TO_DEFAULT": "Reset to default",
+ "IDS_SETTINGS_CAPTIONS_SIZE_100": "100% (default)",
+ "IDS_SETTINGS_CAPTIONS_SIZE_150": "150%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_200": "200%",
+ "IDS_SETTINGS_CAPTIONS_SIZE_50": "50%",
+ "IDS_SETTINGS_CAPTIONS_TITLE": "Captions",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_COLOR": "Window color",
+ "IDS_SETTINGS_CAPTIONS_WINDOW_OPACITY": "Window transparency",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE": "Automatically download songs here after you add or buy them on other devices",
+ "IDS_SETTINGS_CLOUD_COLLECTION_OFFLINE_TOGGLE_TITLE_FREE": "Automatically download songs here after you buy them on other devices",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC": "Buying music",
+ "IDS_SETTINGS_FEEDBACK_BUYINGMUSIC_DETAILS": "Tell us about your experience including relevant album, song, and artist names. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO": "Buying or renting a video",
+ "IDS_SETTINGS_FEEDBACK_BUYINGVIDEO_DETAILS": "Tell us about your experience, including relevant series name, season number, episode name, and movie title. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_CANCEL": "Cancel",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN": "Can't sign in",
+ "IDS_SETTINGS_FEEDBACK_CANTSIGNIN_DETAILS": "Tell us about your experience. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_COLLECTIONVIEW": "Viewing my collection",
+ "IDS_SETTINGS_FEEDBACK_COMMENT_DESCRIPTION": "Comments",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED": "Connected device",
+ "IDS_SETTINGS_FEEDBACK_CONNECTED_DETAILS": "Tell us about your experience, including the type of device you're using.",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_CONTENT": "Problem with store info (wrong art, wrong name, etc.)",
+ "IDS_SETTINGS_FEEDBACK_CONTENT_PLAYBACK": "Media playback",
+ "IDS_SETTINGS_FEEDBACK_CONTENTDISCOVERY": "Discovering content",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION": "Thanks for your feedback! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DESCRIPTION_GAMERTAG": "Thanks for your feedback, {0}! We'll use it to help improve this app.",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGMUSIC": "Downloading music",
+ "IDS_SETTINGS_FEEDBACK_DOWNLOADINGVIDEO": "Downloading a video",
+ "IDS_SETTINGS_FEEDBACK_EPISODEAUTOPLAY": "Auto-playing next episode",
+ "IDS_SETTINGS_FEEDBACK_GENERALERROR_DETAILS": "Tell us about what you were doing when you noticed the error.",
+ "IDS_SETTINGS_FEEDBACK_GENERALERRORS": "General error",
+ "IDS_SETTINGS_FEEDBACK_GHOSTTEXT": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_GREATAPP": "Great app",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT": "Music format",
+ "IDS_SETTINGS_FEEDBACK_MUSICFORMAT_DETAILS": "Tell us about your experience, including the formats or file types you're wanting to use.",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA": "Music metadata",
+ "IDS_SETTINGS_FEEDBACK_MUSICMETADATA_DETAILS": "Give us your feedback, including relevant album, artist names and a description of the problem encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_NOCONNECTION": "Connect to the Internet to submit your feedback.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_APPISSUE": "Problem in the app (error, confusing behavior, etc.)",
+ "IDS_SETTINGS_FEEDBACK_OPTION_CONTENTISSUE": "Problem with the way something plays or appears in the app",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DESCRIPTION": "Choose a category for your feedback and enter your comments below.",
+ "IDS_SETTINGS_FEEDBACK_OPTION_DISLIKE": "Dislike",
+ "IDS_SETTINGS_FEEDBACK_OPTION_LIKE": "Like",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC": "Playing music",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGMUSIC_DETAILS": "Tell us about your experience, including whether you were playing your own music or songs from Xbox.",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO": "Playing a video",
+ "IDS_SETTINGS_FEEDBACK_PLAYINGVIDEO_DETAILS": "Tell us about your experience, including whether you were playing your own video or something from Xbox Video.",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_DETAILS": "Provide details",
+ "IDS_SETTINGS_FEEDBACK_PROVIDE_VERBOSE_DETAILS": "Please provide artist, album and/or track name and describe the issue encountered.",
+ "IDS_SETTINGS_FEEDBACK_REQUESTCONTENT": "Request content",
+ "IDS_SETTINGS_FEEDBACK_SAS_TEXT": "Want to report an issue?",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC": "Music streaming",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGMUSIC_DETAILS": "Tell us about your experience including relevant album, song, artist names, and if you're using a subscription. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO": "Streaming a video",
+ "IDS_SETTINGS_FEEDBACK_STREAMINGVIDEO_DETAILS": "Tell us about your experience. Please include relevant series name, season number, episode name, movie title, and if you were attempting to download or stream the video. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUBMIT": "Submit",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION": "Suggestion",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_DETAILS": "Tell us about changes you'd like to see. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_GOTIDEAS": "Got Ideas?",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_MUSIC": "Go to the Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_VIDEO": "Go to the Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXMUSIC": "Go to the Xbox Music Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SUGGESTION_XBOXVIDEO": "Go to the Xbox Video Suggestion page and tell us what we should add",
+ "IDS_SETTINGS_FEEDBACK_SYNC": "Sync/cloud",
+ "IDS_SETTINGS_FEEDBACK_TITLE": "Feedback",
+ "IDS_SETTINGS_FEEDBACK_TRAILER": "Watching a trailer",
+ "IDS_SETTINGS_FEEDBACK_TRAILER_DETAILS": "Tell us about your experience, including any relevant titles. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_USERVOICE_XBOXVIDEO": "Go to XboxVideoUserVoice.com and tell us what we should add.",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT": "Video format",
+ "IDS_SETTINGS_FEEDBACK_VIDEOFORMAT_DETAILS": "Tell us about your experience, including the formats or file types you're wanting to use.",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC": "Wrong music info",
+ "IDS_SETTINGS_FEEDBACK_WRONGMUSIC_DETAILS": "Give us your feedback including relevant album, song, artist names and a description of the problem encountered. The more detail, the better!",
+ "IDS_SETTINGS_FEEDBACK_WRONGVIDEO": "Wrong video info",
+ "IDS_SETTINGS_FORGET_ME": "Remove",
+ "IDS_SETTINGS_FREE_PLAY_LIMITS_METER_PERCENTAGE": "{0}%",
+ "IDS_SETTINGS_HELP_TITLE": "Help",
+ "IDS_SETTINGS_PREFERENCE_ACCOUNT": "Switch users",
+ "IDS_SETTINGS_PREFERENCE_TITLE": "Preferences",
+ "IDS_SETTINGS_PROMPT_TOGGLE_TITLE": "Ask me to sign in before completing purchases or managing my account",
+ "IDS_SETTINGS_SWITCH_USER": "Switch users",
+ "IDS_SETTINGS_SWITCH_USER_DESCRIPTION": "This app is designed for use by one person at a time. To switch users, select Remove. This will sign you out of the app and reset all app settings. Signing out will not delete any music or videos.",
+ "IDS_SETTINGS_TITLE": "Settings",
+ "IDS_SHARE_EMPTY_MESSAGE_ALBUM": "Sorry, that album can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_ARTIST": "Sorry, that artist can't be shared because they're not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MOVIE": "Sorry, that movie can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_MUSIC": "To share something, select an artist, album, or song.",
+ "IDS_SHARE_EMPTY_MESSAGE_OTHER_VIDEO": "Sorry, that video can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TRACK": "Sorry, that song can't be shared because it's not in the Xbox Music Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_EPISODE": "Sorry, that episode can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SEASON": "Sorry, that season can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_TV_SERIES": "Sorry, that series can't be shared because it's not in the Xbox Video Store.",
+ "IDS_SHARE_EMPTY_MESSAGE_VIDEO": "First, choose a movie or TV show to share.",
+ "IDS_SHARE_FILES_MUSIC_DESCRIPTION": "Files from the Music app",
+ "IDS_SHARE_FRIEND_REQUEST": "{0} wants to be friends!",
+ "IDS_SHARE_FRIEND_REQUEST_LINK": "Add them on {0}Xbox.com{1}",
+ "IDS_SHARE_GAME_TEXT": "Check out {0}",
+ "IDS_SHARE_LEADER_BOARD_TEXT": "In {0}, {1} ranks {2} among their friends",
+ "IDS_SHARE_MORE_MICROSOFT_DOT_COM": "See more at {0}Microsoft.com{1}",
+ "IDS_SHARE_MORE_XBOX_DOT_COM": "See more at {0}Xbox.com{1}",
+ "IDS_SHARE_MORE_XBOXVIDEO_DOT_COM": "See more at {0}XboxVideo.com{1}",
+ "IDS_SHARE_MUSIC_ALBUM_COUNT_PLURAL": "[[1]{0} album][[*]{0} albums]",
+ "IDS_SHARE_MUSIC_CONCATENATION": "{0} {1}",
+ "IDS_SHARE_MUSIC_PLAYLIST_COUNT_PLURAL": "[[1]{0} playlist][[*]{0} playlists]",
+ "IDS_SHARE_MUSIC_SONG_COUNT_PLURAL": "[[1]{0} song][[*]{0} songs]",
+ "IDS_SHARE_PROFILE": "Share profile",
+ "IDS_SHARE_SOCIAL_ACHIEVEMENT_TEXT": "{0} unlocked the {1} achievement in {2}",
+ "IDS_SHARE_SOCIAL_UNACHIEVEMENT_TEXT": "{0} hasn't unlocked the {1} achievement in {2}",
+ "IDS_SHARE_TELL_FRIEND_ADD": "Tell your friends to add you",
+ "IDS_SHOW_ALL_MODIFIER": "show all",
+ "IDS_SHOW_FEATURED_MODIFIER": "show featured",
+ "IDS_SIGNIN_COMPLETE": "Signed in",
+ "IDS_SIGNIN_ERROR": "Can't sign in",
+ "IDS_SIGNIN_ERROR_CAPTION": "Sign in",
+ "IDS_SIGNIN_ERROR_MORE_INFO": "More info",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_DESC": "You can still use this app, but the app needs to restart. Click close to restart the app.",
+ "IDS_SIGNIN_MIXED_REGION_ERROR_TITLE": "The region for your Xbox profile is different from your Windows region.",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TEXT": "Click here to sign in",
+ "IDS_SIGNIN_NOTIFICATION_SIGNIN_TITLE": "Sign In",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TEXT": "Get the most from your apps",
+ "IDS_SIGNIN_NOTIFICATION_SIGNUP_TITLE": "Sign up with Xbox",
+ "IDS_SIGNIN_PROGRESS": "Signing in",
+ "IDS_SIGNIN_RETRY": "Try again",
+ "IDS_SMARTDJ_ERROR_CAPTION": "Smart DJ",
+ "IDS_SNAPPED_DETAILS_OVERVIEW_TITLE": "overview",
+ "IDS_SNAPPED_DETAILS_PLAYLIST_TITLE": "playlist",
+ "IDS_SNAPPED_DETAILS_POSTROLL_TITLE": "what's next",
+ "IDS_SNAPPED_DETAILS_RECOMMEND_LABEL": "recommended",
+ "IDS_SNAPPED_DETAILS_REPLAY_LABEL": "Play Again",
+ "IDS_SNAPPED_DETAILS_SHUFFLE_ALL_LABEL": "Shuffle",
+ "IDS_SNAPPED_GO_FULLSCREEN_MESSAGE": "To start something, go full screen.",
+ "IDS_SNAPPED_MUSIC_HEADER": "Start listening",
+ "IDS_SNAPPED_MUSIC_UNSNAP_TEXT": "Find something to play",
+ "IDS_SNAPPED_VIDEO_UNSNAP_TEXT": "Find something to watch",
+ "IDS_SOCIAL_PIVOT": "social",
+ "IDS_SORT_FILTER_CONTROL_ACC_FILTER": "Filter",
+ "IDS_SORT_FILTER_CONTROL_ACC_SORT": "Sort",
+ "IDS_SORTED_BY": "{0} by",
+ "IDS_SWIPE_HORIZONTALLY_TO_SELECT": "Swipe left to select",
+ "IDS_SWIPE_VERTICALLY_TO_SELECT": "Swipe down to select",
+ "IDS_TIME_ARIA_ZERO": "0:0",
+ "IDS_TIME_DISPLAY_ZERO": "0:00",
+ "IDS_TOS_ACCEPT_BUTTON": "I Accept",
+ "IDS_TOS_ACCEPT_CHECKBOX": "I accept the Xbox Live Terms of Use agreement",
+ "IDS_TOS_ACCEPT_ERROR": "You must accept the Terms of Use to proceed.",
+ "IDS_TOS_CANCEL": "Cancel",
+ "IDS_TOS_TEXT_HEADER": "Please review and accept",
+ "IDS_TOS_TITLE": "Attention",
+ "IDS_TOS_UPDATE_DESC": "The Xbox Terms of Use have recently been updated. Please review and accept the new Terms of User agreement before you sign in.",
+ "IDS_TOS_UPDATE_HEADER": "Updated Terms of Use",
+ "IDS_TOUCHPAD_SUBTITLE1": "press and slide",
+ "IDS_TOUCHPAD_SUBTITLE2": "tap to select",
+ "IDS_TOUCHPAD_TITLE": "select",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_LABEL": "Closed captioning",
+ "IDS_TRANSPORT_CONTROLS_CLOSED_CAPTION_NOT_AVAILABLE": "Not available",
+ "IDS_TRANSPORT_CONTROLS_DISABLED_VOLUME_BUTTON": "No speakers or headphones.",
+ "IDS_TRANSPORT_CONTROLS_MUTE_LABEL": "Mute",
+ "IDS_TRANSPORT_CONTROLS_NEXT_BUTTON": "Next",
+ "IDS_TRANSPORT_CONTROLS_PAUSE_BUTTON": "Pause",
+ "IDS_TRANSPORT_CONTROLS_PLAY_BUTTON": "Play",
+ "IDS_TRANSPORT_CONTROLS_PLAY_HERE_BUTTON": "Play here",
+ "IDS_TRANSPORT_CONTROLS_PLAY_ON_XBOX_BUTTON": "Play on Xbox",
+ "IDS_TRANSPORT_CONTROLS_PLAYBACK_OPTIONS_BUTTON": "Playback options",
+ "IDS_TRANSPORT_CONTROLS_PREVIOUS_BUTTON": "Previous",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_BUTTON": "Repeat",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_OFF_BUTTON": "Repeat: off",
+ "IDS_TRANSPORT_CONTROLS_REPEAT_ON_BUTTON": "Repeat: on",
+ "IDS_TRANSPORT_CONTROLS_RESUME_ON_XBOX_BUTTON": "Resume on Xbox",
+ "IDS_TRANSPORT_CONTROLS_SEEKBAR_LABEL": "Progress bar",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_BUTTON": "Shuffle",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_OFF_BUTTON": "Shuffle: off",
+ "IDS_TRANSPORT_CONTROLS_SHUFFLE_ON_BUTTON": "Shuffle: on",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_OFF_BUTTON": "Turn repeat off",
+ "IDS_TRANSPORT_CONTROLS_TURN_REPEAT_ON_BUTTON": "Turn repeat on",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_OFF_BUTTON": "Turn shuffle off",
+ "IDS_TRANSPORT_CONTROLS_TURN_SHUFFLE_ON_BUTTON": "Turn shuffle on",
+ "IDS_TRANSPORT_CONTROLS_UNMUTE_LABEL": "Unmute",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_BUTTON": "Volume \n{0}",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_MUTE_BUTTON": "Muted",
+ "IDS_TRANSPORT_CONTROLS_VOLUME_SLIDER_LABEL": "Volume",
+ "IDS_TRANSPORT_CONTROLS_XBOX_CONTROLLER_BUTTON": "Remote",
+ "IDS_TV_SEASON_NAME": "Season {0}",
+ "IDS_TV_SEASON_NAME_LC": "season {0}",
+ "IDS_UNKNOWN_VALUE": "unknown",
+ "IDS_UNPIN_FROM_START_SCREEN_BUTTON": "Unpin from start",
+ "IDS_UPGRADE_WINDOWS_8_1_NOTIFICATION": "Click to get Windows 8.1",
+ "IDS_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT": "To use Xbox services, get the latest version of the app.",
+ "IDS_VERSION_CHECK_SERVICE_TITLE": "Update available",
+ "IDS_VERSION_CHECK_SIGNIN_TEXT": "Get the latest version of the app.",
+ "IDS_VERSION_CHECK_UPGRADE_CAPTION": "Your app needs an update.",
+ "IDS_VERSION_CHECK_UPGRADE_LINK": "Get the update",
+ "IDS_VERSION_CHECK_UPGRADE_TEXT": "To keep using this app, get the latest version at the Windows Store.",
+ "IDS_VIDEO_APP_TITLE": "video",
+ "IDS_VIDEO_COLLECTION_EMPTY": "Videos you purchase from Xbox Video will appear here.",
+ "IDS_VIDEO_COLLECTION_EMPTY_HOME_LINK": "Xbox Video home",
+ "IDS_VIDEO_COLLECTION_EMPTY_SEARCH_LINK": "Search",
+ "IDS_VIDEO_FEATURED_PIVOT": "featured",
+ "IDS_VIDEO_GENRES_PIVOT": "genres",
+ "IDS_VIDEO_NETWORKS_PIVOT": "networks",
+ "IDS_VIDEO_NEW_RELEASES_PIVOT": "new releases",
+ "IDS_VIDEO_PIVOT": "videos",
+ "IDS_VIDEO_STUDIOS_PIVOT": "studios",
+ "IDS_VIDEO_TOP_SELLING_PIVOT": "top selling",
+ "IDS_VIDEO_TV_FREE_EPISODES_PIVOT": "free tv",
+ "IDS_VIDEO_TV_FROM_LAST_NIGHT_PIVOT": "last night's shows",
+ "IDS_VIDEO2_MOVIE_MARKETPLACE_ACTIONLINK": "Movies store",
+ "IDS_VIDEO2_MY_VIDEO_COLLECTION_ACTIONLINK": "My videos",
+ "IDS_VIDEO2_TELEVISION_MARKETPLACE_ACTIONLINK": "TV store",
+ "IDS_VIEW_ALL": "Show all",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_BUTTON_NEXT": "Next",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_DESCRIPTION": "Do you want us to ask for your password every time you make a purchase? You can change this preference later in Settings, Preferences.",
+ "IDS_WEBHOST_FIRST_PURCHASE_PROMPT_TITLE": "Password prompt for purchase?",
+ "IDS_WEBHOST_RESIZE_WINDOW_BODY": "Make your window larger or rotate your device.",
+ "IDS_WEBHOST_RESIZE_WINDOW_TITLE": "Your screen needs to be wider",
+ "IDS_WEBHOST_ROTATE_BODY": "To use this feature, change your screen orientation by turning your device.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_BODY": "To work right, this feature needs more of your screen. Increase the size of the app window or rotate your device to continue.",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_BODY": "Increase the size of the app window (turning your device if needed).",
+ "IDS_WEBHOST_ROTATE_OR_RESIZE_SHORT_TITLE": "The app needs more width on your screen to continue",
+ "IDS_WEBHOST_ROTATE_TITLE": "Please rotate your device",
+ "IDS_WHATSNEW_NOTIFICATION_SUBTITLE": "Click to see what's better",
+ "IDS_WHATSNEW_POPUP_LINK": "Read the full release notes",
+ "IDS_XBOX_GET_FOR_XBOX": "Get for Xbox 360",
+ "IDS_XBOX_MUSIC_APP_TITLE": "xbox music",
+ "IDS_XBOX_PLAY_TO_DEVICE": "Play To",
+ "IDS_XBOX_VIDEO_APP_TITLE": "xbox video",
+ "IDS_YES_BUTTON": "Yes",
+ "101": "Unknown Song %d",
+ "102": "Unknown Album (%s %s)",
+ "103": "Unknown Album (",
+ "104": "Unknown Artist",
+ "105": "Unknown Song",
+ "106": "the ;",
+ "108": "Various Artists",
+ "109": "Unknown Album",
+ "110": "Unknown Genre",
+ "250": "Unknown Song",
+ "251": "Unknown Artist",
+ "252": "Unknown Album",
+ "258": "Unknown Series",
+ "259": "Unknown Video",
+ "260": "Unknown Series",
+ "261": "We couldn't determine the original series for these podcast episodes. To subscribe, select one or more episodes and enter a URL.",
+ "262": "Couldn't determine the URL for this podcast series. To subscribe to it, select one or more episodes and enter a URL.",
+ "320": "Music",
+ "321": "TV",
+ "322": "Shorts",
+ "323": "Season %1!02d!",
+ "324": "Movies",
+ "325": "Xbox Music Pass",
+ "326": "Purchases",
+ "328": "Subscription Cache",
+ "329": "Downloading",
+ "360": "%1: %2",
+ "361": "audiobook",
+ "362": "audiobook",
+ "363": "comedy / spoken word",
+ "364": "podcast",
+ "365": "karaoke",
+ "5000": "Xbox Event Log",
+ "607": "Smart DJ",
+ "609": "Resume playing",
+ "610": "Shuffle all music",
+ "611": "Podcasts",
+ "612": "Podcast Folder",
+ "613": "Podcast Folder",
+ "618": "Xbox temporary converted files",
+ "619": "OneDrive Cache",
+ "IDS_VIDEO_ALL_FEATURED_SETS_GALLERY_TITLE": "all featured sets",
+ "IDS_VIDEO_ERROR_DETAILS": "Xbox Video isn't available right now.",
+ "IDS_VIDEO_ERROR_HEADER": "Check back soon",
+ "IDS_VIDEO_FEATURED_MOVIES_TITLE": "Featured Movies",
+ "IDS_VIDEO_FEATURED_SETS_TITLE": "Featured Sets",
+ "IDS_VIDEO_FEATURED_TV_TITLE": "Featured TV",
+ "IDS_VIDEO_LAST_NIGHT_SHOWS_TITLE": "Last Night's Shows",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_ADD": "Add videos to your collection",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_ADD_DESCRIPTION": "There are no videos in your collection. Sign in or tell us where to look.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_DESCRIPTION": "Browse new, featured, and top movies and TV.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_MOVIES": "Browse movies",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_BROWSE_TV": "Browse TV",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE": "Choose where we look",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_CHOOSE_DESCRIPTION": "We'll add videos from any folders you have on this PC.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN": "Sign in",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_IN_DESCRIPTION": "Sign in to your Xbox Video account to see your movies and TV shows.",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP": "Sign up",
+ "IDS_VIDEO_LX_COLLECTION_EMPTY_SIGN_UP_DESCRIPTION": "Get an Xbox Video account and start watching.",
+ "IDS_VIDEO_LX_COLLECTION_FILTER_ALL": "All videos",
+ "IDS_VIDEO_LX_COLLECTION_FILTER_CLOUD": "In the cloud",
+ "IDS_VIDEO_LX_COLLECTION_FILTER_PC": "On this PC",
+ "IDS_VIDEO_LX_COLLECTION_MODIFIER_MOVIES": "Movies",
+ "IDS_VIDEO_LX_COLLECTION_MODIFIER_PERSONAL": "Personal Videos",
+ "IDS_VIDEO_LX_COLLECTION_MODIFIER_TV": "TV",
+ "IDS_VIDEO_LX_COLLECTION_PIVOT": "collection",
+ "IDS_VIDEO_LX_COLLECTION_PIVOT_TC": "Collection",
+ "IDS_VIDEO_LX_COLLECTION_SORT_ALPHA": "By A to Z",
+ "IDS_VIDEO_LX_COLLECTION_SORT_DATE": "By date added",
+ "IDS_VIDEO_LX_COLLECTION_VIDEO_COUNT": "{0}",
+ "IDS_VIDEO_LX_DELETE_CONFIRM_COLLECTION": "You're about to delete {0} from your collection.",
+ "IDS_VIDEO_LX_DELETE_CONFIRM_PC": "You're about to delete {0} from this PC.",
+ "IDS_VIDEO_LX_DELETE_CONFIRM_PC_AND_COLLECTION": "You're about to delete {0} from this PC and your collection.",
+ "IDS_VIDEO_LX_DELETE_FROM_COLLECTION": "Delete from your collection",
+ "IDS_VIDEO_LX_DELETE_FROM_PC": "Delete from this PC",
+ "IDS_VIDEO_LX_DELETE_FROM_PC_AND_COLLECTION": "Delete from this PC and your collection",
+ "IDS_VIDEO_LX_DETAILS_CAST_AND_CREW_TITLE": "Cast",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_DURATION": "Duration",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_FILE_SIZE": "File Size",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_GENRE": "Genre",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_NETWORK": "Network",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_PARENTAL_RATING": "Parental Rating",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_PRIMARY_LANG": "Primary Language",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_RELEASE_DATE": "Release Date",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_STUDIO": "Studio",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_SUBTITLES": "Subtitles",
+ "IDS_VIDEO_LX_DETAILS_FOOTER_TITLE": "Information",
+ "IDS_VIDEO_LX_DETAILS_HEADER_EPISODE_TITLE": "{0}. {1}",
+ "IDS_VIDEO_LX_DETAILS_HEADER_LINK_SUBTITLES": "Subtitles",
+ "IDS_VIDEO_LX_DETAILS_HEADER_SERIES_SEASON_SUBTITLE": "{0} - {1}",
+ "IDS_VIDEO_LX_DETAILS_ROTTEN_TOMATOES_TITLE": "Rotten Tomatoes",
+ "IDS_VIDEO_LX_DETAILS_SIZE_GB_HD_FORMAT": "{0} GB (HD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_GB_SD_FORMAT": "{0} GB (SD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_MB_HD_FORMAT": "{0} MB (HD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_MB_SD_FORMAT": "{0} MB (SD)",
+ "IDS_VIDEO_LX_DETAILS_SIZE_SEPARATOR": " / ",
+ "IDS_VIDEO_LX_MOVIE_FEATURED_GALLERY_TITLE": "Featured Movies",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_GENRES": "All genres",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_MODIFIER_ALL_STUDIOS": "All studios",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RATED": "Top Rated",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_RENTALS": "Top Rentals",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_PIVOT_TOP_SELLING": "Top Selling",
+ "IDS_VIDEO_LX_MOVIE_GALLERY_TITLE": "Top Movies",
+ "IDS_VIDEO_LX_MOVIE_NEW_GALLERY_TITLE": "New Movies",
+ "IDS_VIDEO_LX_MOVIES_STORE_PIVOT": "Movies store",
+ "IDS_VIDEO_LX_MOVIES_STORE_PIVOT_TC": "Movies Store",
+ "IDS_VIDEO_LX_SEARCH": "Search",
+ "IDS_VIDEO_LX_SEARCH_ALL_EMPTY_DESC": "Try searching for something else.",
+ "IDS_VIDEO_LX_SEARCH_ALL_EMPTY_TITLE": "Sorry, we couldn't find that in your videos or the store.",
+ "IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_DESC": "Tap \"In collection\" to see results from your collection.",
+ "IDS_VIDEO_LX_SEARCH_CATALOG_EMPTY_TITLE": "Sorry, we didn't find that in the store.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_AND_CATALOG_EMPTY_TITLE": "We don't see that in your collection or the store",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_DESC": "Tap \"Store\" to see results from Xbox Video.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE": "Sorry, we didn't find that in your collection.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_EMPTY_TITLE_NO_CATALOG": "Sorry, we didn't find that in your collection.",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER": "In collection ({0})",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_MAX_RESULTS": "In collection ({0}+)",
+ "IDS_VIDEO_LX_SEARCH_COLLECTION_FILTER_NO_COUNT": "In collection",
+ "IDS_VIDEO_LX_SEARCH_MODIFIER_ALL": "All",
+ "IDS_VIDEO_LX_SEARCH_MODIFIER_MOVIES": "Movies",
+ "IDS_VIDEO_LX_SEARCH_MODIFIER_TV": "TV",
+ "IDS_VIDEO_LX_SEARCH_MY_EMPTY_DESC": "Try searching the store.",
+ "IDS_VIDEO_LX_SEARCH_MY_EMPTY_LINK": "Show results from all videos",
+ "IDS_VIDEO_LX_SEARCH_MY_EMPTY_TITLE": "Sorry, we didn't find that in your collection.",
+ "IDS_VIDEO_LX_SEARCH_PIVOT_COLLECTION": "Collection",
+ "IDS_VIDEO_LX_SEARCH_PIVOT_STORE": "Store",
+ "IDS_VIDEO_LX_SEARCH_STORE_FILTER": "Store ({0})",
+ "IDS_VIDEO_LX_SEARCH_STORE_FILTER_MAX_RESULTS": "Store ({0}+)",
+ "IDS_VIDEO_LX_SEARCH_STORE_FILTER_NO_COUNT": "Store",
+ "IDS_VIDEO_LX_TV_FEATURED_GALLERY_TITLE": "Featured TV",
+ "IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_GENRES": "All genres",
+ "IDS_VIDEO_LX_TV_GALLERY_MODIFIER_ALL_NETWORKS": "All networks",
+ "IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_RATED": "Top Rated",
+ "IDS_VIDEO_LX_TV_GALLERY_PIVOT_TOP_SELLING": "Top Selling",
+ "IDS_VIDEO_LX_TV_GALLERY_TITLE": "Top TV Shows",
+ "IDS_VIDEO_LX_TV_LAST_NIGHT_GALLERY_TITLE": "Last Night's TV",
+ "IDS_VIDEO_LX_TV_NEW_GALLERY_TITLE": "New TV Shows",
+ "IDS_VIDEO_LX_TV_STORE_PIVOT": "TV store",
+ "IDS_VIDEO_LX_TV_STORE_PIVOT_TC": "TV Store",
+ "IDS_VIDEO_LX_VERSION_CHECK_SERVICE_FOR_FEATURES_TEXT": "Once you update, you can use Xbox services like watching downloaded movies or TV shows.",
+ "IDS_VIDEO_LX_VERSION_CHECK_SERVICE_TITLE": "Update Xbox Video to keep watching",
+ "IDS_VIDEO_NEW_MOVIES_TITLE": "New Movies",
+ "IDS_VIDEO_NEW_TV_TITLE": "New TV Shows",
+ "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL": "Track {0}",
+ "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACK_LABEL_EXTENDED": "Track {0}: {1}",
+ "IDS_VIDEO_NOW_PLAYING_AUDIO_TRACKS_BUTTON": "Audio tracks",
+ "IDS_VIDEO_OFFLINE_DETAILS": "Connect to the internet, then we'll be able to show you more",
+ "IDS_VIDEO_OFFLINE_HEADER": "Looks like you're offline",
+ "IDS_VIDEO_STREAMING_QUALITY_OVERLAY_BODY": "Show streaming quality overlay on video playback:",
+ "IDS_VIDEO_STREAMING_QUALITY_SELECTOR_BODY": "Stream the video in selected bitrate:",
+ "IDS_VIDEO_STREAMING_QUALITY_SELECTOR_OPTION_AUTOMATIC": "Automatic",
+ "IDS_VIDEO_STREAMING_QUALITY_SETTINGS_TITLE": "Streaming Quality",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_HEADER": "First, remove a device",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_1": "Choose a device you no longer want to use for downloads from the store.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_MESSAGE_2": "On that device, launch the Video app, go to Settings > Download devices and click Remove this device from your list of registered devices. Then you'll be able to download on this device.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_ERROR_SHOWDEVICES_LINK": "Show my devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXCONSOLES_ERROR_HEADER": "First, remove one of your other Xbox consoles",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPC_ERROR_HEADER": "First, remove a device",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXPHONE_ERROR_HEADER": "First, remove one of your other phones",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_MAXTABLET_ERROR_HEADER": "First, remove one of your other tablets",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_DEVICELIMIT_RENTAL_ERROR_MESSAGE": "To download this rental, remove one of your other devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_HELP_LINK": "Help me with this",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_OFFLINE_ERROR_HEADER": "Please connect to the internet",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_CLOSE_BUTTON": "Close",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_1": "You can download purchases and rentals on multiple devices.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_DESCRIPTION_2": "To remove one, sign in on that device, then go to Settings > Download devices and click Remove this device from your list of registered devices.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_HEADER": "Download devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_REGISTEREDDEVICES_LINK": "Show my download devices",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_HEADER": "Please try again later",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREACHABLE_ERROR_MESSAGE": "Sorry, our download service is not available",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_CANCEL": "Cancel",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_HEADER": "This also removes downloaded purchases and rentals",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_MESSAGE": "You can still download them again later, but you will not be able to remove another device in the next 30 days.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_CONFIRM_REMOVE": "Remove",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_LINK": "Remove this device",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_HEADER": "Try again in {0} days",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_MESSAGE": "You can remove only one device per month from the devices you use for Store downloads.",
+ "IDS_VIDEO_TH_DEVICEDOMAIN_UNREGISTERDEVICE_TIMELIMIT_ERROR_NOTIME_HEADER": "Try again next month",
+ "IDS_VIDEO_TOP_MOVIE_RENTALS_TITLE": "Top Movie Rentals",
+ "IDS_VIDEO_TOP_RATED_MOVIES_TITLE": "Top Rated Movies",
+ "IDS_VIDEO_TOP_RATED_TV_TITLE": "Top Rated TV",
+ "IDS_VIDEO_TOP_SELLING_MOVIES_TITLE": "Top Movies",
+ "IDS_VIDEO_TOP_SELLING_TV_TITLE": "Top TV Shows",
+ "IDS_VIDEO1_MANAGE_FOLDERS_TITLE": "Build your collection from your local video files",
+ "IDS_VIDEO1_SEARCH_PROMPT_TITLE": "Search for movies, TV shows, or your own videos",
+ "IDS_ALL_VIDEO_COLLECTION_TITLE": "all",
+ "IDS_CHANGE_TV_SEASON_LABEL": "Change season",
+ "IDS_DIALOG_PURCHASE_DURING_GROVEL_CAPTION": "We're syncing your purchases now. You'll be able to buy things, and play things you already bought, in a few minutes.",
+ "IDS_DIALOG_PURCHASE_DURING_GROVEL_TITLE": "Please try again soon.",
+ "IDS_FILTER_ALL_GENRES_2": "All genres",
+ "IDS_FILTER_ALL_NETWORKS_LC": "all networks",
+ "IDS_FILTER_ALL_STUDIOS_LC": "all studios",
+ "IDS_MARKETPLACE_FEATURED_MOVIES": "Featured movies",
+ "IDS_MARKETPLACE_FEATURED_TELEVISION": "Featured TV",
+ "IDS_MARKETPLACE_FREE_TV": "Free TV",
+ "IDS_MARKETPLACE_LAST_NIGHT_ON_TV": "Last Night's Shows",
+ "IDS_MARKETPLACE_MOVIE_FEATURED_LC": "featured movies",
+ "IDS_MARKETPLACE_MOVIE_NEW_RELEASE_LC": "new movies",
+ "IDS_MARKETPLACE_MOVIE_TOP_RATED_LC": "top rated movies",
+ "IDS_MARKETPLACE_MOVIE_TOP_RENTED_LC": "top movie rentals",
+ "IDS_MARKETPLACE_MOVIE_TOP_SALES_LC": "top selling movies",
+ "IDS_MARKETPLACE_NEW_RELEASES": "New Releases",
+ "IDS_MARKETPLACE_SORT_CRITIC_RATING_2": "Critic rating",
+ "IDS_MARKETPLACE_SORT_RELEASE_DATE_2": "Release date",
+ "IDS_MARKETPLACE_SORT_TOP_RENTED_2": "Top rented",
+ "IDS_MARKETPLACE_SORT_TOP_SELLING_2": "Top selling",
+ "IDS_MARKETPLACE_SORT_USER_RATING_2": "Customer rating",
+ "IDS_MARKETPLACE_TOP_MOVIE_RENTALS": "top rentals",
+ "IDS_MARKETPLACE_TOP_MOVIE_RENTALS_2": "Top rentals",
+ "IDS_MARKETPLACE_TOP_MOVIE_SALES": "top selling",
+ "IDS_MARKETPLACE_TOP_MOVIE_SALES_2": "Top selling",
+ "IDS_MARKETPLACE_TOP_TV_PURCHASES": "Top Selling TV",
+ "IDS_MARKETPLACE_TOP_VIDEO_SALES": "top selling",
+ "IDS_MARKETPLACE_TOP_VIDEO_SALES_2": "Top selling",
+ "IDS_MARKETPLACE_TV_FEATURED_LC": "featured tv shows",
+ "IDS_MARKETPLACE_TV_NEW_RELEASE_LC": "new tv shows",
+ "IDS_MARKETPLACE_TV_TOP_RATED_LC": "top rated tv",
+ "IDS_MARKETPLACE_TV_TOP_SALES_LC": "top selling tv",
+ "IDS_MODIFIER_PREFIX_VIEWBY_2": "View by",
+ "IDS_MOVIE_COLLECTION_TITLE": "movies",
+ "IDS_MOVIE_HERO_HEADING": "movie details",
+ "IDS_MOVIE_MARKETPLACE_TITLE_LC": "movies store",
+ "IDS_MOVIE_MARKETPLACE_TITLE_TC": "Movies Store",
+ "IDS_MOVIE_PLAY_MOVIE_BUTTON": "Play movie",
+ "IDS_MOVIE_STUDIO_BROWSE_TITLE": "STUDIOS - {0}",
+ "IDS_OTHER_VIDEO_COLLECTION_TITLE": "personal videos",
+ "IDS_TV_COLLECTION_TITLE": "tv shows",
+ "IDS_TV_DOWNLOAD_SEASON_BUTTON": "Download season",
+ "IDS_TV_DOWNLOAD_SEASON_BUTTON_HD": "Download season (HD)",
+ "IDS_TV_DOWNLOAD_SEASON_BUTTON_SD": "Download season (SD)",
+ "IDS_TV_EPISODE_LABEL": "{0} episode",
+ "IDS_TV_EPISODE_NAME_NUMBER_FORMAT": "Episode {0}: {1}",
+ "IDS_TV_EPISODES_LABEL": "{0} episodes",
+ "IDS_TV_EPISODES_LABEL_PLURAL": "[[1]{0} episode][[*]{0} episodes]",
+ "IDS_TV_MARKETPLACE_TITLE_LC": "tv store",
+ "IDS_TV_MARKETPLACE_TITLE_TC": "TV Store",
+ "IDS_TV_NETWORK_BROWSE_TITLE": "NETWORKS - {0}",
+ "IDS_TV_NEW_EPISODE_HEADING": "This week's episode",
+ "IDS_TV_NOEPISODES_LABEL": "{0} episodes",
+ "IDS_TV_NUMBERED_EPISODE_0_NAME": "Extra",
+ "IDS_TV_NUMBERED_EPISODE_0_SEASON_NAME": "Season {0} extras",
+ "IDS_TV_NUMBERED_EPISODE_NAME": "Episode {0}",
+ "IDS_TV_NUMBERED_EPISODE_SEASON_NAME": "Season {0}, episode {1}",
+ "IDS_TV_NUMBERED_EPISODE_SEASON_TITLE": "Season {0}, episode {1}, \"{2}\"",
+ "IDS_TV_OWNED_EPISODES_LABEL": "{0} owned",
+ "IDS_TV_OWNED_EPISODES_LABEL_PLURAL": "[[*]{0} owned]",
+ "IDS_TV_PLAY_EPISODE_BUTTON": "Play episode",
+ "IDS_TV_SEASON_0_NAME": "Extras",
+ "IDS_TV_SEASON_0_NAME_LC": "extras",
+ "IDS_TV_SEASON_EXTRAS_HEADING_LC": "season extras",
+ "IDS_TV_SEASON_EXTRAS_HEADING_SC": "Season extras",
+ "IDS_TV_SEASON_EXTRAS_HEADING_UC": "SEASON EXTRAS",
+ "IDS_TV_SEASONS_LABEL_PLURAL": "[[1]{0} season][[*]{0} seasons]",
+ "IDS_TV_SERIES_EXTRAS_HEADING": "Series extras",
+ "IDS_TV_SERIES_EXTRAS_HEADING_LC": "series extras",
+ "IDS_TV_SERIES_EXTRAS_HEADING_UC": "SERIES EXTRAS",
+ "IDS_TV_SERIES_RATING_LABEL": "Series rating",
+ "IDS_VIDEO_AVAILABLE_OFFLINE": "Downloaded (available offline)",
+ "IDS_VIDEO_BUFFERING_SMOOTH": "Buffering...",
+ "IDS_VIDEO_BUNDLE_ITEMS_IN_BUNDLE": "In Bundle",
+ "IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_BUTTON": "Various ({0})",
+ "IDS_VIDEO_BUNDLES_AUDIO_LANGUAGE_METADATA": "Various audio languages",
+ "IDS_VIDEO_BUNDLES_DETAILS_BUY_BUTTON": "Buy Bundle",
+ "IDS_VIDEO_BUNDLES_DETAILS_VIEW_IN_COLLECTION_BUTTON": "View in collection",
+ "IDS_VIDEO_BUNDLES_DISABLED_BUTTON": "In collection",
+ "IDS_VIDEO_BUNDLES_PRE_PURCHASE_ITEM": "Pre-purchase",
+ "IDS_VIDEO_CANT_DELETE": "Can't delete.",
+ "IDS_VIDEO_CAST_ACTOR": "Actor",
+ "IDS_VIDEO_CAST_ACTORS": "Actors",
+ "IDS_VIDEO_CAST_CREATOR": "Creator",
+ "IDS_VIDEO_CAST_CREATORS": "Creators",
+ "IDS_VIDEO_CAST_DIRECTOR": "Director",
+ "IDS_VIDEO_CAST_DIRECTORS": "Directors",
+ "IDS_VIDEO_CAST_HEADING": "cast",
+ "IDS_VIDEO_CAST_HEADING_UC": "CAST",
+ "IDS_VIDEO_CAST_WRITER": "Writer",
+ "IDS_VIDEO_CAST_WRITERS": "Writers",
+ "IDS_VIDEO_COLLECTION_ALPHA_SORT": "a to z",
+ "IDS_VIDEO_COLLECTION_ALPHA_SORT_2": "A to Z",
+ "IDS_VIDEO_COLLECTION_ARTIST_SORT": "artist",
+ "IDS_VIDEO_COLLECTION_DATEADDED_SORT": "date added",
+ "IDS_VIDEO_COLLECTION_DATEADDED_SORT_2": "Date added",
+ "IDS_VIDEO_COLLECTION_DURATION_SORT": "duration",
+ "IDS_VIDEO_COLLECTION_EMPTY_DESC": "Find movies at the Xbox Video Store",
+ "IDS_VIDEO_COLLECTION_EMPTY_TITLE": "No videos in your collection",
+ "IDS_VIDEO_COLLECTION_GENRE_SORT": "genre",
+ "IDS_VIDEO_COLLECTION_GENRE_SORT_2": "Genre",
+ "IDS_VIDEO_COLLECTION_MOVIES_PIVOT": "my movies",
+ "IDS_VIDEO_COLLECTION_MOVIES_PIVOT_UC": "YOUR MOVIES",
+ "IDS_VIDEO_COLLECTION_PIVOT": "personal videos",
+ "IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT": "release year",
+ "IDS_VIDEO_COLLECTION_RELEASEYEAR_SORT_2": "Release year",
+ "IDS_VIDEO_COLLECTION_SERIES_EPISODES": "episodes arranged by series",
+ "IDS_VIDEO_COLLECTION_SERIES_EPISODES_2": "Episodes arranged by series",
+ "IDS_VIDEO_COLLECTION_SERIES_SEASONS": "seasons arranged by series",
+ "IDS_VIDEO_COLLECTION_SERIES_SEASONS_2": "Seasons arranged by series",
+ "IDS_VIDEO_COLLECTION_SETS_PIVOT_UC": "YOUR SETS",
+ "IDS_VIDEO_COLLECTION_STUDIO_SORT": "studio",
+ "IDS_VIDEO_COLLECTION_TV_PIVOT": "my tv",
+ "IDS_VIDEO_COLLECTION_TV_PIVOT_UC": "YOUR TV",
+ "IDS_VIDEO_COLLECTION_WISHLIST_PIVOT_UC": "YOUR WISHLIST",
+ "IDS_VIDEO_DASH_FEATURED_SETS_LC": "featured sets",
+ "IDS_VIDEO_DASH_FEATURED_SETS_UC": "FEATURED SETS",
+ "IDS_VIDEO_DASH_MOVIE_FEATURED_LC": "featured movies",
+ "IDS_VIDEO_DASH_MOVIE_FEATURED_UC": "FEATURED MOVIES",
+ "IDS_VIDEO_DASH_MOVIE_NEW_LC": "new movies",
+ "IDS_VIDEO_DASH_MOVIE_NEW_UC": "NEW MOVIES",
+ "IDS_VIDEO_DASH_SPOTIGHT_UC": "SPOTLIGHT",
+ "IDS_VIDEO_DASH_TV_FEATURED_LC": "featured tv shows",
+ "IDS_VIDEO_DASH_TV_FEATURED_UC": "FEATURED TV SHOWS",
+ "IDS_VIDEO_DASH_TV_NEW_LC": "new tv shows",
+ "IDS_VIDEO_DASH_TV_NEW_UC": "NEW TV SHOWS",
+ "IDS_VIDEO_DEEPLINK_ERROR_GENERIC_DESC": "Choose a different program or try again later.",
+ "IDS_VIDEO_DEEPLINK_ERROR_GENERIC_TITLE": "Sorry, we can't take you there",
+ "IDS_VIDEO_DELETE_SERIES_BUTTON": "Delete series",
+ "IDS_VIDEO_DETAILS_COMMERCE_HEADER_FORMAT": "{0}. {1}",
+ "IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASE_SC": "Pre-purchase",
+ "IDS_VIDEO_DETAILS_COMMERCE_HEADER_PREPURCHASED_SC": "Pre-purchased",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_DOWNLOAD_TIME_DISCLAIMER": "Download times estimated for a basic broadband (1.5 Mbps) connection.",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD": "HD - {0}. Higher quality, approx. {1} to download",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_HD_SIMPLE": "HD - Higher quality, download takes longer and takes up more memory",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_NEVER_SHOW": "Set as the default for this device.",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_HD": "HD - High Definition",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT": "Ask me each time I download a video",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_PROMPT_SHORT": "Ask me each time",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_QUESTION": "Always download my HD videos on this device in:",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD": "SD - Standard Definition (smaller size)",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_SD_SHORT": "SD - Standard Definition",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_PREFERENCES_DOWNLOAD_QUALITY_TITLE": "Download Quality",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD": "SD - {0}. Lower quality, approx. {1} to download",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SD_SIMPLE": "SD - Lower quality, faster download and takes up less memory",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_GB": "{0} GB",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_HOURS": "{0}h",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_SIZE_MB": "{0} MB",
+ "IDS_VIDEO_DETAILS_DOWNLOAD_CHOOSE_TITLE": "Select download quality:",
+ "IDS_VIDEO_DOWNLOAD_COMPLETE": "Download complete",
+ "IDS_VIDEO_DOWNLOAD_ERROR": "Download error",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL": "Cancel",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_CANCEL_ALL": "Cancel all",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_CLOSE": "Close",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COMPLETE": "Complete",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING": "Copying",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_NOT_COMPLETE": "Copying not completing?",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_SLOW": "Copying... may take ~{0} min",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_COPYING_STAY": "Stay in the app while we finish up",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_DONE": "Done",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_GB_SIZE": "{0} GB",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_LINK": "Active downloads",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_MB_SIZE": "{0} MB",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_NO_DOWNLOADS": "Nothing's downloading right now.\n\n Completed downloads will appear in your video collection.",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_NO_TEMP_SPACE": "Can’t download (drive C needs temp space)",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE": "Pause",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PAUSE_ALL": "Pause all",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PENDING": "Pending",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_LONG": "{0}% downloaded",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_PERCENT_SHORT": "{0}%",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_RESUME": "Resume",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_RESUME_All": "Resume all",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_RETRY": "Retry",
+ "IDS_VIDEO_DOWNLOAD_MANAGER_TITLE": "Active downloads",
+ "IDS_VIDEO_DOWNLOAD_MORE_INFO": "More info",
+ "IDS_VIDEO_DOWNLOAD_NOTIFICATION": "Downloading...",
+ "IDS_VIDEO_DOWNLOAD_PAUSED": "Downloads paused",
+ "IDS_VIDEO_DOWNLOAD_PROGRESS_ITEMS_PLURAL": "[[1]{0} item remaining][[*]{0} items remaining]",
+ "IDS_VIDEO_DOWNLOAD_SLOWED_ON_BATTERY": "To conserve power, your download might be slowed. For the quickest download, keep this app on screen or connect to AC power.",
+ "IDS_VIDEO_DOWNLOAD_TO_WATCH_OFFLINE": "Download to watch offline",
+ "IDS_VIDEO_FIND_SOMETHING_TO_PLAY": "Find something to play",
+ "IDS_VIDEO_GET_FOR_XBOX360": "Get for Xbox",
+ "IDS_VIDEO_GET_FOR_XBOX360_APPBAR": "Get for Xbox",
+ "IDS_VIDEO_IN_COLLECTION_LABEL": "In my videos",
+ "IDS_VIDEO_ITEM_CAN_ONLY_BE_STREAMED": "This item can only be streamed.",
+ "IDS_VIDEO_ITEM_CANT_BE_STREAMED_DOWNLOAD_FIRST": "This item can't be streamed. To play, download it first.",
+ "IDS_VIDEO_ITEM_PURCHASED_IN_OTHER_REGION": "This item was purchased in a region different from the region for your account.",
+ "IDS_VIDEO_ITEM_UNAVAILABLE_BETWEEN": "Can't be streamed or downloaded from {0}. To make sure you get it, download before {1}.",
+ "IDS_VIDEO_MAKE_SURE_FILE_ISNT_IN_USE_READONLY": "Make sure that the file isn't in use and isn't read-only.",
+ "IDS_VIDEO_MARKETPLACE_EMPTY_DESC": "Try a different genre or filter.",
+ "IDS_VIDEO_MARKETPLACE_EMPTY_TITLE": "There's nothing to show here",
+ "IDS_VIDEO_MARKETPLACE_TITLE_LC": "video store",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE1": "If you're sure your network is fast enough for streaming, choose HD or SD stream. To ensure uninterrupted viewing, or to watch offline, choose HD or SD download instead.",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DISCLAIMER_LINE2": "You won't be charged yet.",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_DOWNLOAD_OPTION": "Download movie to this device to watch offline",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_STREAMING_OPTION": "Stream movie online",
+ "IDS_VIDEO_MOVIE_RENTAL_DIALOG_TITLE": "Movie rental options",
+ "IDS_VIDEO_NEW_SEASON_NOTIFICATION": "New season",
+ "IDS_VIDEO_NOW_PLAYING": "now playing",
+ "IDS_VIDEO_ON_BATTERY": "Downloads might be slower on battery power.",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_KNOWN": "Available on {0}",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DATE_UNKNOWN": "Coming soon",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_DAYS_PLURAL": "[[1]Available in {0} day][[*]Available in {0} days]",
+ "IDS_VIDEO_PREPURCHASE_COLLECTION_NOTIFICATION_HOURS_PLURAL": "[[1]Available in {0} hour][[*]Available in {0} hours]",
+ "IDS_VIDEO_PREPURCHASE_DETAILS_BUY": "Pre-purchase",
+ "IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_KNOWN": "Come back and watch it as soon as it's released. Estimated release date: {0}.",
+ "IDS_VIDEO_PREPURCHASE_POST_UPSELL_DATE_UNKNOWN": "Come back and watch it as soon as it's released. ",
+ "IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_KNOWN": "Buy now and watch it as soon as it's released. Estimated release date: {0}.",
+ "IDS_VIDEO_PREPURCHASE_PRE_UPSELL_DATE_UNKNOWN": "Buy now and watch it as soon as it's released.",
+ "IDS_VIDEO_PREVIEW_BROWSE_BUTTON": "Play all trailers",
+ "IDS_VIDEO_PREVIEW_BUY_RENT_BUTTON": "Get this movie",
+ "IDS_VIDEO_PREVIEW_NOT_AVAILABLE": "The trailer isn't available",
+ "IDS_VIDEO_PRICE_FREE": "Free",
+ "IDS_VIDEO_PRICE_FREE_WITH_ADS": "Free with ads",
+ "IDS_VIDEO_PRICE_HD": "HD {0}",
+ "IDS_VIDEO_PRICE_HD_SD": "HD {0} SD {1}",
+ "IDS_VIDEO_PRICE_ON_SALE": "On sale!",
+ "IDS_VIDEO_PRICE_PERCENT_OFF": "{0} ({1}% off)",
+ "IDS_VIDEO_PRICE_SD": "SD {0}",
+ "IDS_VIDEO_PRICE_STARTING_FROM": "from {0}",
+ "IDS_VIDEO_PRICE_SWITCH_HD": "Switch to HD",
+ "IDS_VIDEO_PRICE_SWITCH_SD": "Switch to SD",
+ "IDS_VIDEO_PURCHASE_OPTIONS_BUTTON": "Purchase options",
+ "IDS_VIDEO_PURCHASE_OPTIONS_BUY": "Buy {0}",
+ "IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_AUDIO_LANGUAGE": "{0} audio",
+ "IDS_VIDEO_PURCHASE_OPTIONS_CURRENT_LANGUAGE": "{0} ({1})",
+ "IDS_VIDEO_PURCHASE_OPTIONS_HD": "HD",
+ "IDS_VIDEO_PURCHASE_OPTIONS_LANGUAGE": "Language",
+ "IDS_VIDEO_PURCHASE_OPTIONS_QUALITY": "Format",
+ "IDS_VIDEO_PURCHASE_OPTIONS_RENT": "Rent {0}",
+ "IDS_VIDEO_PURCHASE_OPTIONS_SD": "SD",
+ "IDS_VIDEO_PURCHASE_OPTIONS_TITLE": "Purchase Options",
+ "IDS_VIDEO_PURCHASED_LABEL": "Purchased",
+ "IDS_VIDEO_RECOMMEND_ALL_LC": "all recommendations",
+ "IDS_VIDEO_RECOMMEND_ALL_SC": "All recommendations",
+ "IDS_VIDEO_RECOMMEND_EMPTY_GALLERIES": "We don’t have any recommendations to show you right now. Check back later.",
+ "IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_LC": "movies",
+ "IDS_VIDEO_RECOMMEND_MOVIE_DROPDOWN_SC": "Movies",
+ "IDS_VIDEO_RECOMMEND_MOVIES_LC": "recommended movies",
+ "IDS_VIDEO_RECOMMEND_MOVIES_TITLE_TC": "Recommendations in Movies",
+ "IDS_VIDEO_RECOMMEND_NOT_INTERESTED_LC": "Not interested",
+ "IDS_VIDEO_RECOMMEND_NOT_INTERESTED_TC": "Not Interested",
+ "IDS_VIDEO_RECOMMEND_TITLE_LC": "recommendations",
+ "IDS_VIDEO_RECOMMEND_TITLE_TC": "Recommendations",
+ "IDS_VIDEO_RECOMMEND_TITLE_UC": "RECOMMENDATIONS",
+ "IDS_VIDEO_RECOMMEND_TV_DROPDOWN_LC": "tv shows",
+ "IDS_VIDEO_RECOMMEND_TV_DROPDOWN_SC": "TV shows",
+ "IDS_VIDEO_RECOMMEND_TV_LC": "recommended tv",
+ "IDS_VIDEO_RECOMMEND_TV_TITLE_TC": "Recommendations in TV",
+ "IDS_VIDEO_RECOMMENDED": "recommended",
+ "IDS_VIDEO_RENTAL_EXPIRED": "Rental expired",
+ "IDS_VIDEO_RENTAL_EXPIRED_ONLY": "Expired",
+ "IDS_VIDEO_RENTAL_EXPIRES_AT": "Rental expires at {0}",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAY": "Expires in 1 day",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAY_HR": "Expires in 1 day 1 hr",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAY_HRS": "Expires in 1 day {0} hrs",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAYS": "Expires in {0} days",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAYS_HR": "Expires in {0} days 1 hr",
+ "IDS_VIDEO_RENTAL_EXPIRES_DAYS_HRS": "Expires in {0} days {1} hrs",
+ "IDS_VIDEO_RENTAL_EXPIRES_HR": "Expires in 1 hr",
+ "IDS_VIDEO_RENTAL_EXPIRES_HR_MIN": "Expires in 1 hr 1 min",
+ "IDS_VIDEO_RENTAL_EXPIRES_HR_MINS": "Expires in 1 hr {0} mins",
+ "IDS_VIDEO_RENTAL_EXPIRES_HRS": "Expires in {0} hrs",
+ "IDS_VIDEO_RENTAL_EXPIRES_HRS_MIN": "Expires in {0} hrs 1 min",
+ "IDS_VIDEO_RENTAL_EXPIRES_HRS_MINS": "Expires in {0} hrs {1} mins",
+ "IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_HR": "Expires in less than 1 hour",
+ "IDS_VIDEO_RENTAL_EXPIRES_LESS_THAN_MIN": "Expires in less than 1 minute",
+ "IDS_VIDEO_RENTAL_EXPIRES_MIN": "Expires in 1 min",
+ "IDS_VIDEO_RENTAL_EXPIRES_MINS": "Expires in {0} mins",
+ "IDS_VIDEO_RENTAL_EXPIRES_ON": "Rental expires on {0}",
+ "IDS_VIDEO_REVIEW_HEADING": "reviews",
+ "IDS_VIDEO_REVIEW_ROTTEN_VIEW_MORE": "Read more reviews",
+ "IDS_VIDEO_SEARCH_ALL_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in Movies or TV",
+ "IDS_VIDEO_SEARCH_ALL_RESULT_TITLE": "results for \"{0}\" in Movies and TV",
+ "IDS_VIDEO_SEARCH_CAST_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in Cast",
+ "IDS_VIDEO_SEARCH_MOVIE_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in Movies",
+ "IDS_VIDEO_SEARCH_MOVIE_RESULT_TITLE": "results for \"{0}\" in Movies",
+ "IDS_VIDEO_SEARCH_TV_NORESULT_TITLE": "we couldn't find anything for \"{0}\" in TV",
+ "IDS_VIDEO_SEARCH_TV_RESULT_TITLE": "results for \"{0}\" in TV",
+ "IDS_VIDEO_SEASON_PASS_EXPLANATION": "Buy a Season Pass to get all current and future episodes for this season.",
+ "IDS_VIDEO_SETTINGS_PURCHASES_LABEL": "Purchases",
+ "IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_BUTTON": "Restore",
+ "IDS_VIDEO_SETTINGS_PURCHASES_RESTORE_DESCRPTION": "To restore available video purchases, click Restore Purchases.",
+ "IDS_VIDEO_SETTINGS_PURCHASES_RESTORING_BUTTON": "Restoring...",
+ "IDS_VIDEO_SETTINGS_STARTUP_VIEW_DESC": "Open my personal videos when I start the app",
+ "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_BODY": "You’ll lose any videos you’ve rented recently. To keep your rentals, or to check that you’ve already watched them, tap Cancel.",
+ "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_SIGNOUT_BTN": "Sign out",
+ "IDS_VIDEO_SIGNOUT_WARNING_DIALOG_TITLE": "If you sign out...",
+ "IDS_VIDEO_SPOTLIGHT": "home",
+ "IDS_VIDEO_STARTING_SMOOTH": "Starting...",
+ "IDS_VIDEO_STREAMING_DOWNLOAD_AVAILABLE": "Streaming (download available)",
+ "IDS_VIDEO_STREAMING_DOWNLOAD_TO_WATCH_OFFLINE": "Streaming (download to watch offline)",
+ "IDS_VIDEO_STREAMING_NOTIFICATION": "Streaming only",
+ "IDS_VIDEO_TILE_NEW_MOVIES_AMP_TV": "New movies & TV",
+ "IDS_VIDEO_TILE_XBOX_VIDEO_TC": "Xbox Video",
+ "IDS_VIDEO_UPSELL_BROWSE_MOVIES_AND_TV_SC": "Browse movies & TV",
+ "IDS_VIDEO_UPSELL_BROWSE_NEW_MOVIES_SC": "Browse new movies",
+ "IDS_VIDEO_UPSELL_BROWSE_NEW_TV_SC": "Browse new TV",
+ "IDS_VIDEO_UPSELL_BROWSE_PERSONAL_SC": "Browse your personal videos",
+ "IDS_VIDEO_UPSELL_BUY_LABEL_SC": "Buy your favorite movies and shows and watch them on your Xbox consoles and Windows 8 tablets and PCs",
+ "IDS_VIDEO_UPSELL_FIND_NEW_MOVIES_SC": "Find and watch the newest movies — often before DVD",
+ "IDS_VIDEO_UPSELL_GET_TV_SHOWS_SC": "Get TV shows the day after they air",
+ "IDS_VIDEO_UPSELL_INSTANT_ON_HD_SC": "Instant-on HD streaming — no more waiting for downloads",
+ "IDS_VIDEO_UPSELL_MOVIE_STORE_SC": "Movie store",
+ "IDS_VIDEO_UPSELL_MY_VIDEO_SC": "My videos",
+ "IDS_VIDEO_UPSELL_TV_STORE_SC": "TV store",
+ "IDS_VIDEO_UPSELL_VIEW_NEW_RELEASES_SC": "You're using Xbox Video. Find this week's movies and TV to watch on Windows 8, Xbox, Windows Phone 8 or XboxVideo.com.",
+ "IDS_VIDEO_VIEW_BY_TITLE": "{0} by {1}",
+ "IDS_VIDEO_VIEW_FROM_STUDIO_LABEL": "{0} from {1}",
+ "IDS_VIDEO_VIEW_IN_GENRE_FROM_STUDIO_LABEL": "{0} in {1} from {2}",
+ "IDS_VIDEO_VIEW_IN_GENRE_LABEL": "{0} in {1}",
+ "IDS_VIDEO_WATCH_NEXT_BUY_EPISODE_BUTTON": "Buy episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_DELETE_EPISODE_BUTTON": "Delete episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_DELETE_SEASON_BUTTON": "Delete season",
+ "IDS_VIDEO_WATCH_NEXT_DOWNLOAD_EPISODE_BUTTON": "Download episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_PLAY_EPISODE_BUTTON": "Play episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_RESTART_EPISODE_BUTTON": "Restart episode {0}",
+ "IDS_VIDEO_WATCH_NEXT_RESUME_EPISODE_BUTTON": "Resume episode {0}",
+ "IDS_VIDEO_WATCHED_LABEL": "Watched",
+ "IDS_VIDEO_REVIEW_COUNT_ONLY_PLURAL": "[[1]{0} review][[*]{0} reviews]",
+ "000D1359": "This song is available only when you buy the whole album.",
+ "000D135E": "Sorry, can't go there. Please try again.",
+ "C00D001A": "The item is missing or we can't get to it.",
+ "C00D0029": "If the item is on an external hard drive or network location, make sure you have access to that device or location.",
+ "C00D0BBE": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D0BC0": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D0BCD": "The given property isn't supported.",
+ "C00D0FF5": "To preview or play explicit content, sign in.",
+ "C00D0FF6": "Your privacy & online settings don't allow you to buy explicit content.",
+ "C00D0FF7": "Your privacy & online settings don't allow you to buy things.",
+ "C00D0FF8": "Access to this content is blocked based on the online safety settings for this account. Please sign in to play this content.",
+ "C00D0FF9": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D0FFC": "Can't play the disc because the drive is in use.",
+ "C00D0FFD": "To download explicit content, sign in.",
+ "C00D1051": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1053": "Can't play. Check with the maker of your computer's video card to see if there's a new driver available.",
+ "C00D1057": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D1077": "Sorry, this item is unavailable.",
+ "C00D10B7": "Sorry, we can't play this item right now. Please try again later.",
+ "C00D10BD": "Can't play videos because there's a problem with your video card. For troubleshooting help, contact the maker of your computer's video card.",
+ "C00D10D1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D10DE": "Can't play the video because there's a problem with the file. Try renting or buying the video at the Xbox Video Store.",
+ "C00D10DF": "Can't play because the item's file format isn't supported. Make sure your video doesn't have multiple soundtracks.",
+ "C00D10E0": "Can't play this item because the file is too big.",
+ "C00D10E1": "Can't play files that are incompletely downloaded or are corrupted.",
+ "C00D1117": "Sorry, this item is currently unavailable.",
+ "C00D1126": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1198": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C00D1199": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11A1": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C00D11B5": "Sorry, we can't download because we can't check usage rights at the moment. Please try again soon!",
+ "C00D11BA": "Can't play. Make sure your computer has a working sound card, then try again.",
+ "C00D11C0": "Sorry, we can't play just now. You might be offline or our service could be down. Make sure you're connected to the Internet, and try again in a while.",
+ "C00D11C3": "Can't play. Make sure you have Internet access, then try again.",
+ "C00D11C6": "Sorry, this app needs a restart. Go to Home, press the menu button on your controller, and choose Quit. Then start the app again.",
+ "C00D11CD": "Please try again. If the problem continues, visit www.xbox.com/support to check for guidance.",
+ "C00D11D1": "Can't play. Make sure your computer's sound and video cards are working and have the latest drivers, then try again.",
+ "C00D11D2": "Can't access the file. Make sure that the file isn't in use, that you can access the place the file is stored, and that your network's proxy settings are correct, then try again.",
+ "C00D11D3": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11D6": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D11DA": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D11DF": "Can't play one or more songs. For more information, select an information icon in the now playing list.",
+ "C00D11E7": "Can't play or sync this protected file.",
+ "C00D1204": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D12A2": "Can't sign in. Please try again later.",
+ "C00D12A3": "Can't sign in because access requires a user name and password.",
+ "C00D12A4": "Can't sign in because the server has denied access. Please try again later.",
+ "C00D12A5": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A6": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A7": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A8": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12A9": "Can't sign in due to a network error. Make sure you have network access and try again.",
+ "C00D12AA": "Can't sign in due to a temporary server problem. Please try again later.",
+ "C00D12D7": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C00D12DD": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D12E6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12E7": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C00D12F7": "Can't check usage rights. Make sure you have Internet access, then restart the app.",
+ "C00D12F8": "Sorry, can't check usage rights. Please try again in a few minutes.",
+ "C00D1313": "The app closed while trying to update this subscription. Further updates for this subscription will no longer download automatically. Try subscribing to it again or deleting it.",
+ "C00D1333": "Can't find a secure channel. The server certificate isn't valid.",
+ "C00D1334": "Can't find a secure channel. The server certificate is revoked or the revocation list can't be retrieved.",
+ "C00D1335": "Can't find a secure channel. The server certificate was issued by an untrusted certification authority.",
+ "C00D1336": "Can't find a secure channel. The server certificate name doesn't match the server address.",
+ "C00D1337": "Can't find a secure channel. The server certificate is expired.",
+ "C00D1338": "Can't perform this operation. Please try again later.",
+ "C00D1339": "Can't perform the requested action because access requires a user name and password.",
+ "C00D133B": "Can't perform the requested action because the website has denied access. Please try again later.",
+ "C00D133C": "Sorry, this item is no longer available from Xbox. Try searching for it - a newer version might be available.",
+ "C00D1342": "Can't perform the requested action because it's no longer on the website.",
+ "C00D134C": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134D": "Can't perform the requested action due to a temporary server error. Please try again later.",
+ "C00D134E": "Can't perform the requested action due to a network error. Make sure you have network access and try again.",
+ "C00D134F": "Can't do that because of a temporary server condition. Please try again later.",
+ "C00D1350": "Microsoft Update has encountered an unexpected error. Please try again later.",
+ "C00D1351": "Sorry, we can't connect to Xbox services. Please try again later.",
+ "C00D1352": "Wrong username and password combination.",
+ "C00D1354": "Please sign in to preview or play this item.",
+ "C00D1355": "You're not old enough to play explicit content.",
+ "C00D1356": "Can't play because the item's usage rights have expired. Try deleting this item and downloading it again.",
+ "C00D1357": "Can't purchase or download media from multiple online stores.",
+ "C00D1358": "Can't purchase or download the item. It might not be available.",
+ "C00D135A": "Can't identify the provider of this item.",
+ "C00D135B": "This song can be downloaded only when you buy the whole album.",
+ "C00D135C": "You've used up all of your downloads for this item.",
+ "C00D135D": "You've reached the maximum number of things you can buy at one time.",
+ "C00D135F": "Can't sign in. Make sure you're using the right email address and password. The Xbox service might be temporarily unavailable.",
+ "C00D1360": "Can't download this item because the server isn't responding. The server might be temporarily unavailable or you may have lost your Internet connection.",
+ "C00D1363": "The folder couldn't be opened. It might have been moved or deleted.",
+ "C00D1365": "To play this, we need to confirm usage rights. Please sign in with the Microsoft account you were using when you bought it.",
+ "C00D1366": "Can't download because there's not enough storage space for this item.",
+ "C00D1367": "Can't sign in. Please try again later.",
+ "C00D136C": "The email address and password that you entered are not linked to an Xbox profile. Enter a different Microsoft account (email address and password), or use these to create a new Microsoft account.",
+ "C00D136D": "Can't sign in because the Xbox service isn't yet available in your region.",
+ "C00D136E": "The email address and password that you entered are not linked to an Xbox profile. To use these credentials, first sign in at Xbox.com, then sign in to this app again.",
+ "C00D136F": "There's a serious error with your Xbox account.",
+ "C00D1371": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D1372": "Can't download. Make sure the media folder specified in software settings is accessible and that there's enough space on your hard disk.",
+ "C00D1374": "Sorry, can't sign in right now.",
+ "C00D1375": "You need to change your gamertag.",
+ "C00D1376": "Our terms of service have been updated. Select Terms of Service to read and accept the terms in a web browser, then return to this screen to sign in.",
+ "C00D1377": "Your Xbox account has been suspended.",
+ "C00D1378": "Your Xbox account has been suspended.",
+ "C00D1379": "Sorry, can't access your account right now. Please try again later.",
+ "C00D137B": "The item wasn't found. Please try again later.",
+ "C00D137C": "This item can't be previewed, purchased, or downloaded.",
+ "C00D137D": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C00D137E": "Sorry, we can't connect to Xbox services right now. Please try again later.",
+ "C00D137F": "Sorry, Xbox stores aren't yet available in your location. Please check back!",
+ "C00D1380": "That didn't work the way it was supposed to. Please try again.",
+ "C00D1381": "Sorry, we don't have the right album info for this.",
+ "C00D1382": "The Xbox service didn't return valid purchase information.",
+ "C00D1383": "The Xbox service didn't return valid sign in information.",
+ "C00D1384": "Can't provide your Microsoft Points balance right now.",
+ "C00D1385": "Need to check usage rights. Please sign in.",
+ "C00D1387": "The destination download folder doesn't exist. Check that the media folder in the software general settings is set correctly.",
+ "C00D1388": "Sorry, sign-in isn't supported in your region at this time.",
+ "C00D1391": "Before we can sign you in, we need you to verify your age. To continue, go to www.xbox.com/verifyage.",
+ "C00D1392": "Sorry, we can't sign you in due to age requirements for your region. For more information, go to www.xbox.com/verifyage.",
+ "C00D1393": "You're not old enough to download explicit content.",
+ "C00D1395": "Please sign in at Xbox.com and make sure your payment info is up to date.",
+ "C00D1396": "The app update is pending and this app needs a restart. Go to Home, press the menu button on your controller, and choose Quit. Then start the app again.",
+ "C00D1397": "Before we can sign you in, we need you to verify your email account. To continue, go to https://account.live.com and sign in.",
+ "C00D2718": "Can't play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C00D2719": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one. If you just renewed your Xbox Music Pass, please sign out and sign in again.",
+ "C00D271A": "To play this item, we need to check the usage rights for it. Please sign in with the profile you were using when you bought it.",
+ "C00D271D": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D271E": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2721": "Sorry, we can't do what you wanted because there's a problem with your computer's usage rights.%0.",
+ "C00D272B": "Sorry, can't play or download. Please try again in a few minutes.",
+ "C00D274D": "Can't play because your system needs an update. Check to see if updates are available.",
+ "C00D2759": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D2781": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D27D8": "Usage rights for this item have expired. To play it, sign in.",
+ "C00D27D9": "The usage rights for this item aren't active yet. Try again at a later date.",
+ "C00D27DB": "Sorry, there's a problem with usage rights. To continue using this app, install the latest version.",
+ "C00D280A": "Sorry, you need a newer computer to play or download this item.",
+ "C00D2841": "Sorry, can't check usage rights now. Please try again later.",
+ "C00D284F": "Your rental has expired. To play this video, rent it again or buy it.",
+ "C00D2850": "You've already rented this video for this device. To get ready to watch it, select Download.",
+ "C00D2904": "To play this content, your computer's video card, video driver, analog video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2905": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's video card doesn't work with it. Update your video card, then try again.",
+ "C00D2906": "To play this item, your video card, video driver, and screen must each be compliant with HDCP copy protection. One or more of them is not. To check HDCP compliance, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2907": "To play this content, your computer's video card, video driver, analog video output, and screen must each work with copy protection technology called CGMS-A. One or more of these components doesn't work with it. To check CGMS-A compatibility, refer to information provided by the maker of each of these components in your computer.",
+ "C00D2908": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D2909": "To play this content, your computer must work with copy protection technology called CGMS-A. Your computer's sound card doesn't work with it. Update your sound card, then try again.",
+ "C00D290B": "Your current display setting is in clone (duplicate) mode. The current content cannot be viewed in this mode. Try changing the display settings to extended mode.",
+ "C00D2EED": "The proxy server couldn't be located. Please check your proxy server configuration.",
+ "C00D32E0": "To listen, connect speakers or headphones to your computer.",
+ "C00D36B2": "Choose a shorter path or file name. Current path or file name is too long. The file path and name can be up to 200 characters.",
+ "C00D36B4": "This item is in a format we don't support. Please choose something else.",
+ "C00D36C4": "This item's file format may be unsupported, the file extension may be incorrect, or the file may be corrupted.",
+ "C00D36E6": "Sorry, we're not sure what happened. Please try again later.",
+ "C00D36FA": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D36FF": "We need to check usage rights. Sign in using an Xbox profile that's linked to an Xbox Music Pass.",
+ "C00D4E86": "We couldn't find your audio device - are your headphones or speakers connected? If that's not it, you can go to the desktop and tap the speaker icon in the system tray for more help.",
+ "C00D5212": "This item was encoded in a format that's not supported.",
+ "C00D715D": "Sorry, you can't play rights-managed content while you're debugging. Finish your analysis, then try again.",
+ "C1010003": "To continue using this app, install the latest version.",
+ "C1010005": "Can't access the server. Make sure that there are no firewalls or proxy servers blocking access to the Xbox service, then try again.",
+ "C1010008": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Music Devices.",
+ "C1010017": "The Xbox LIVE Terms of Service have been updated. The parent associated with this account must read and accept the new terms before you can sign in.",
+ "C101001C": "Can't retrieve the computer name.",
+ "C101001D": "Can't retrieve the computer name.",
+ "C101001F": "There might be a problem with your network connection or an error in the web address you entered. Check your network connection and, if applicable, the URL. Then try again.",
+ "C1010023": "Sign-in isn't available in your region.",
+ "C1010026": "This item can't be purchased on your computer. To download or watch it, use your Xbox 360 console.",
+ "C1010027": "Your network is too slow for instant playback, so your video will be downloaded to ensure optimal viewing. You'll find this item in your video collection once the download is complete.",
+ "C1010028": "Your network is too slow for instant playback. To ensure optimal viewing, download this video instead of trying to stream it.",
+ "C1010029": "This item is no longer available, or is available only for purchase and can't be downloaded using an Xbox Music Pass.",
+ "C101002A": "Can't complete the download. Please try again later.",
+ "C1010030": "You can leave feedback only on things you've bought. If you own this item, go to the Users page in PC settings and sign in to Windows with the Microsoft account you were using when you bought it, then try posting feedback again.",
+ "C1010036": "To continue, sign in.",
+ "C1010064": "Smart DJ is currently unavailable. Please try again later.",
+ "C1010065": "Songs from Xbox Music weren't added to this playlist because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010066": "This playlist wasn't refreshed because you weren't signed in. To keep this from happening, turn on automatic sign-in.",
+ "C1010067": "This playlist couldn't be refreshed because similar songs couldn't be found.",
+ "C1010070": "Sorry, we can't post your review, due to either a network error or the contents of your review. Please check your Internet connection. Also, make sure none of the language in your review is offensive. If the problem continues, wait a while and then try again.",
+ "C101008D": "Sorry, can't play. Please try again.",
+ "C101008E": "Couldn't play because of a network problem. Please try again.",
+ "C101008F": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010090": "Can't play because the item's file format isn't supported. Check the store to see if this item is available there.",
+ "C1010091": "Sorry, we're not sure what happened there. Please try again.",
+ "C1010094": "This song requires an Xbox Music Pass. To play the song, sign up for an Xbox Music Pass or sign in with an account that has one.",
+ "C1010095": "To stream rights-managed music or video to another device, that device needs to support the media rights management (DRM) for that content. Make sure you are signed in with the same account on both devices, or play content that's not rights-managed.",
+ "C1010098": "Access to this content is blocked based on the online safety settings for this account.",
+ "C1010099": "Make sure this media file has been added to your media library and try to play it from media library gallery of the application.",
+ "C101009A": "To play premium content, please ensure your build of Windows is signed with the official Microsoft Windows Production certificate.",
+ "C101009B": "Another app is controlling your sound right now. To listen here, close that app and try again.",
+ "C101009C": "That one is either corrupted or in a format we can't play.",
+ "C101009D": "If you are using remote desktop, try streaming or downloading on your local PC instead.",
+ "C101009E": "This song is not available on this device. The item doesn't match to anything in the cloud, so we can't stream it for you here.",
+ "C101009F": "The connection to your TV was lost.",
+ "C10100A0": "We cannot play from the file locations for those songs in that playlist.",
+ "C10100A1": "We cannot play on your receiver at this moment. Please disconnect your receiver and try again.",
+ "C10100A2": "Sorry, we couldn't play that. It looks like your audio or video device isn't using Windows certified drivers. Try again after installing the latest official drivers. The following files are not certified:",
+ "C10100C8": "Automatic refreshing has been disabled for this playlist due to poor performance. Editing the playlist rules to reduce list size might improve performance.",
+ "C10100C9": " ZUNE_E_MAXIMUM_PLAYLIST_LENGTH_EXCEEDED",
+ "C10100DD": "Couldn't download to your library. That path is no longer available. If you're using external storage, make sure it's available and connected.",
+ "C10100DE": "Your media library is currently write protected and preventing us from downloading. Please remove the write protection and try again.",
+ "C10100DF": "Couldn't download to your library. Your library doesn't contain any folders that are not associated with a cloud storage service.",
+ "C1010100": "Sorry, not sure what happened there. Close and reopen the app, then try again.",
+ "C1010101": "If the item is on an external hard drive, make sure the drive is connected and turned on.",
+ "C1010102": "Make sure you're connected to the Internet, then try again. If you're definitely connected, make sure no firewalls or proxy servers are blocking access to Xbox services.",
+ "C1010103": "This item is in a format we don't support. Please choose something else.",
+ "C1010104": "Make sure your video cable and TV both support HDCP copy protection. Also, check with the maker of your computer's video card to see if there's an HDCP-compliant driver for it.",
+ "C1010105": "Make sure the item you're trying to play is available locally. This app doesn't support playing over remote desktop.",
+ "C1010106": "Your version of Windows doesn't support playing music or video.",
+ "C1010107": "Wait a few moments, then try again.",
+ "C1010108": "This song requires Xbox Music Pass. To play the song, sign up for Xbox Music Pass or sign in with a profile that has one.",
+ "C1010109": "Can't Play because the item's usage rights are corrupt or no longer valid. Try deleting this item and downloading it again.",
+ "C101010B": "Can't play because we can't check usage rights. Make sure your PC's clock and time zone are set correctly, then try again.",
+ "C101010C": "Your TV or monitor does not support the copy protection technology required to play this content.",
+ "C101010D": "This song is not available through Xbox Music.",
+ "C101010F": "Can't play the song because it is being used by another application.",
+ "C1010140": "The item contains a sync ID reference to another item that does not exist in the local replica.",
+ "C1010141": "The item exists in the database but has not yet been assigned a sync ID.",
+ "C1010142": "The item contains a variable type sync ID reference but does not contain the sync type.",
+ "C1010143": "The item is missing a property that is required by the schema.",
+ "C1010144": "The message did not contain an item of the expected type.",
+ "C101014B": "Sorry, we can't download this right now. Wait a while, then try again.",
+ "C10101C2": "We've stopped playing because you've reached your data limit and we thought you should know. To resume, select Play.",
+ "C10101C3": "We've stopped playing because you're nearing your data limit and we don't want you to unknowingly exceed it. To resume, select Play.",
+ "C10101C4": "We've stopped playing because you're now connected to a metered network where you could quickly exceed your data limit. To resume, select Play.",
+ "C101A000": "Request completed successfully.",
+ "C101A001": "There was a problem. Please try again later.",
+ "C101A002": "There was a problem. Please try again later.",
+ "C101A003": "Can't complete your request. Make sure you've entered the right info, then try again.",
+ "C101A004": "To use this app, make sure you are signed in to your Xbox account.",
+ "C101A005": "Can't complete your request. Please try again later.",
+ "C101A006": "There was a problem. Please try again later.",
+ "C101A007": "There was a problem. Please try again later.",
+ "C101A008": "Can't complete your request because you have one or more duplicate entries. Check that you've entered valid information, then try again.",
+ "C101A009": "Can't complete your request. You've made too many service requests in a short time. Please try again later.",
+ "C101A010": "Can't complete your request. Check that you've entered valid information, then try again.",
+ "C101A053": "We can't check the playback rights for this item right now. Please try again later. Make sure to sign in with an account that matches the region setting of your device.",
+ "C101A054": "There was a problem. Please try again later. ",
+ "C101A055": "Sorry, this item is no longer available.",
+ "C101A1F8": "There was a problem. Please try again later.",
+ "C101A1F9": "To complete your request, a parent needs to sign in.",
+ "C101A1FA": "That isn't the right parent account. Please try again.",
+ "C101A1FB": "Sorry, we couldn't get the info we needed. Please try again later.",
+ "C101A1FC": "There was a problem. Please try again later.",
+ "C101A20D": "There was a problem. Please try again later.",
+ "C101A20E": "There was a problem. Please try again later.",
+ "C101A20F": "There was a problem. Please try again later.",
+ "C101A211": "There was a problem. Please try again later.",
+ "C101A212": "There was a problem. Please try again later.",
+ "C101A213": "There was a problem. Please try again later.",
+ "C101A214": "There was a problem. Please try again later.",
+ "C101A215": "There was a problem. Please try again later.",
+ "C101A216": "There was a problem. Please try again later.",
+ "C101A217": "There was a problem. Please try again later.",
+ "C101A218": "There was a problem. Please try again later.",
+ "C101A219": "There was a problem. Please try again later.",
+ "C101A21A": "There was a problem. Please try again later.",
+ "C101A21B": "You haven't accepted the Xbox LIVE Terms of Service. To continue, please review and accept the terms.",
+ "C101A21C": "There was a problem. Please try again later.",
+ "C101A230": "Please enter a gamertag and try again.",
+ "C101A231": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A232": "There was a problem. Please try again later.",
+ "C101A233": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A234": "There was a problem. Please try again later.",
+ "C101A235": "There was a problem. Please try again later.",
+ "C101A236": "Sorry, that gamertag is taken. Please try a different one.",
+ "C101A237": "Sorry, that one won't work. Gamertags can have letters and numbers, and can have single spaces between each letter or number. Please try a different gamertag.",
+ "C101A238": "Can't complete your request due to age restrictions. Your parent would need to change your account permissions in Account Settings, Privacy, Family Settings.",
+ "C101A239": "Can't sign in. Please check and correct your account details, then try again.",
+ "C101A23A": "There was a problem. Please try again later.",
+ "C101A23B": "There was a problem. Please try again later.",
+ "C101A23D": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A23E": "There was a problem. Please try again later.",
+ "C101A241": "Sorry, the item you're trying to buy is no longer available.",
+ "C101A242": "There was a problem. Please try again later.",
+ "C101A243": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A244": "Sorry, that subscription isn't available anymore.",
+ "C101A245": "There was a problem. Please try again later.",
+ "C101A246": "There's no Xbox profile associated with your current Microsoft account. To get the most from this app, create an Xbox profile using this email and password combination.",
+ "C101A247": "There's no Xbox profile associated with this Microsoft account. Sign in with a different email and password combination or create a new Xbox profile using this Microsoft account.",
+ "C101A248": "There was a problem. Please try again later.",
+ "C101A249": "There was a problem. Please try again later.",
+ "C101A24A": "There was a problem. Please try again later.",
+ "C101A24B": "You need to be signed in to play this. Sign in, then try again.",
+ "C101A24D": "Can't sign in right now. Please try again later.",
+ "C101A24E": "The Xbox LIVE Code of Conduct doesn't permit your gamertag. You must change it before you can use the Xbox service.",
+ "C101A3E9": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3EA": "This item's price has changed.",
+ "C101A3EB": "The item wasn't found. Please try again later.",
+ "C101A3EC": "This item can't be previewed, purchased, or downloaded.",
+ "C101A3ED": "You've exhausted the number of times you can restore this item.",
+ "C101A3EE": "Sorry, you can't stream music or video when you're outside of the region for your profile.",
+ "C101A3EF": "You don't have enough Microsoft Points to complete the purchase.",
+ "C101A3F0": "You've used or purchased the maximum number of Microsoft Points for today. Please try again tomorrow.",
+ "C101A3F1": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A3F2": "To protect your account, Xbox limits the number of purchases in a 24-hour period. Please try again later.",
+ "C101A3F3": "Your Xbox Music Pass has expired. To play this music, sign up for a new pass in Settings, Account, Xbox Music Pass.",
+ "C101A3F4": "You're using an unsupported version of this Xbox app.",
+ "C101A3F5": "Can't play because the item's usage rights are no longer valid. Try deleting this item and downloading it again.",
+ "C101A3F6": "Sorry, we can't check usage rights at the moment. Please try again soon.",
+ "C101A3F7": "Sorry, we're not sure what happened there. Please try again.",
+ "C101A3F8": "Xbox can't issue the requested rights.",
+ "C101A3F9": "You're using an unsupported version of this Xbox app.",
+ "C101A3FA": "Please use an SSL connection to sign in.",
+ "C101A3FB": "Can't sign in.",
+ "C101A3FC": "The license is corrupt or not valid.",
+ "C101A3FD": "The content owner for the license you just acquired requires that your device be linked to this computer.",
+ "C101A3FF": "Sorry, this item is unavailable.",
+ "C101A400": "To protect your account, the number of purchases you can make in a 24-hour period is limited. Please try again later.",
+ "C101A410": "Can't remove this computer or device. You've already removed one from this Xbox Music Pass in the last 30 days.",
+ "C101A411": "You're downloading songs from Xbox Music on the maximum allowed devices. You might still be able to stream music here, you just can't download it.",
+ "C101A412": "Sorry, you don't have enough song credits for this purchase. To complete your purchase, buy Microsoft Points in Account Settings.",
+ "C101A413": "Sorry, this code has already been redeemed. Enter a new code or use Microsoft Points for your purchase.",
+ "C101A414": "The offer you're trying to use isn't valid.",
+ "C101A415": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A416": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A417": "Sorry, we can't verify your code. Please try again later. ",
+ "C101A418": "Can't purchase because the Xbox service isn't yet available in your region.",
+ "C101A419": "This song has been removed from Xbox Music at the request of the copyright holder.",
+ "C101A7D1": "Need to check usage rights. Please sign in to the account you used to purchase the item.",
+ "C101A7D2": "The item wasn't found. Please try again later.",
+ "C101A7D3": "Sorry, you've used up your downloads for this item. To re-download, buy it again.",
+ "C101A7D4": "This song is only available for purchase or with an Xbox Music Pass at the request of the copyright holder.",
+ "C101A7D5": "Sorry, we can't play or download because we can't check usage rights at the moment. Please try again soon!",
+ "C101A7D8": "You've exceeded the number of videos you can stream at the same time. To watch the current video, stop one of your other streams and then start this one again.",
+ "C101A7DA": "You've exceeded the number of videos you're allowed to stream at the same time. To watch the current video, stop one of your other streams, and then start this one again.",
+ "C101A7DB": "You've exceeded the number of songs you're allowed to stream at the same time. To listen to the current song, stop one of your other streams, and then start this one again.",
+ "C101A7DC": "This song can't be streamed at the request of the copyright holder, but you can still download it to listen.",
+ "C101A7E1": "Sorry, you've used up the number of simultaneous streams for this video. Your video will stop.",
+ "C101A7E2": "Sorry, you've used up the number of simultaneous streams for this song. Your song will stop.",
+ "C101A9C5": "Can't sign in. Please try again later.",
+ "C101A9C6": "Can't sign in. Please try again later.",
+ "C101A9C7": "Can't sign in. Please try again later.",
+ "C101A9C8": "Can't sign in. Please try again later.",
+ "C101A9C9": "Sorry, you can't download from Xbox Music here because you're already downloading on the maximum devices allowed. To change the devices for your account, go to Settings, Account, Xbox Devices.",
+ "C101A9CA": "Can't stream this song, possibly because you're already streaming from another location. Try again later.",
+ "C101A9CB": "Sorry, can't connect to Xbox services. Please try again later.",
+ "C101A9CC": "Can't complete your transaction. Please try again later.",
+ "C101A9CD": "Can't complete your transaction. Please try again later.",
+ "C101A9CE": "Can't connect to Xbox. Your account is in use somewhere else.",
+ "C101A9CF": "Can't complete your transaction. Please try again later.",
+ "C101A9D4": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D5": "Wait a few minutes, then go to Settings, Account, Purchase History to download your purchase. Sorry for the inconvenience!",
+ "C101A9D6": "This song is no longer available using Xbox Music Pass.",
+ "C101AB55": "You have reached the limit for the number of tracks you may play before logging in.",
+ "C101AB6A": "The license for this content has expired. Please delete the file and download it again from your collection.",
+ "C101ABB9": "Can't complete your transaction. Please try again later.",
+ "C101ABBA": "Can't download media usage rights. Please try again later.",
+ "C333000B": "Failed to acquire a license for the content. Make sure your device has all of the necessary certificates.",
+ "C33305DD": "Your parent has restricted your account.",
+ "C33307D2": "The content cannot be licensed in this country/region.",
+ "C33307D3": "To view this content you need to be in the region for your Xbox profile. If you've moved permanently, change your region at account.xbox.com.",
+ "C33307D5": "This rental has expired.",
+ "C33307D8": "The maximum download count has been reached.",
+ "C33307D9": "Please sign in.",
+ "C33307DA": "Unable to acquire usage rights for the content.",
+ "C3330835": "The maximum number of concurrent streams for this content has been reached.",
+ "C3330837": "Your account has reached the maximum number of simultaneous streams.",
+ "C3330838": "The maximum number of concurrent streams for this content has been reached.",
+ "C3340BBC": "To view this free content you need to be in the region for your Xbox profile. If you've moved permanently, change your region at account.xbox.com.",
+ "C33601F4": "We need to check rights for your device.",
+ "C3380000": "Try again in a while. We could not connect to our service just now.",
+ "C3380262": "Choose one you no longer want to use for downloads from the Store. On that device, launch the Video app, go to Settings > Download devices, and remove that device. Then you'll be able to download on this device.",
+ "C3380263": "Choose one you no longer want to use for downloads from the Store. On that PC, launch the Video app, go to Settings > Download devices, and remove that PC. Then you'll be able to download on this PC.",
+ "C3380264": "Choose one you no longer want to use for downloads from the Store. On that phone, launch the Movies & TV app, go to Settings > Download devices, and remove that phone. Then you'll be able to download on this phone.",
+ "C3380265": "Choose one you no longer want to use for downloads from the Store. On that tablet, launch the Video app, go to Settings > Download devices, and remove that tablet. Then you'll be able to download on this tablet.",
+ "C3380266": "Choose one you no longer want to use for downloads from the Store. On that Xbox, launch the Movies & TV app, go to Settings > Download devices, and remove that Xbox. Then you'll be able to download on this Xbox.",
+ "C338026C": "On your other device, launch the Video app, go to Settings > Download devices, and remove that device.",
+ "C338026D": "You can remove only one device per month from the devices you use for Store downloads.",
+ "C338026E": "To download using your account, this device must be removed from another person's list of devices used for Store downloads. Have someone else sign in, then have them remove this device in Settings > Download devices.",
+ "IDS_APP2_PAGE_TITLE_PRIMARY": "{0} - {1}",
+ "IDS_APP2_PAGE_TITLE_PRIMARY_SECONDARY": "{0} - {1} - {2}",
+ "IDS_DETAILS_INFO_SEPERATOR": ", ",
+ "IDS_DETAILS_SLASH_SEPERATOR": " / ",
+ "IDS_EMPTY_SYMBOL": "--",
+ "IDS_FILTER_IN": "{0}",
+ "IDS_MANIFEST_TEST_APP_NAME": "Xbox",
+ "IDS_MANIFEST_TEST_APP_SHORT_NAME": "Xbox",
+ "IDS_MUSIC_SMARTDJ_PIVOT": "smart dj",
+ "IDS_MUSIC_SMARTDJ_PIVOT_TC": "Smart DJ",
+ "IDS_SETTINGS_ABOUT_SUPPORT_WEB_LINK": "http://support.xbox.com",
+ "IDS_SETTINGS_IMPRINT_LEGAL_LINK_TITLE": "Impressum",
+ "IDS_SNAPPED_MUSIC_GO_FULLSCREEN_TITLE": "Xbox Music",
+ "IDS_SNAPPED_VIDEO_GO_FULLSCREEN_TITLE": "Xbox Video",
+ "IDS_TITLE_SUBTITLE": "{0} ({1})",
+ "IDS_WILD_CARD_SYMBOL": "*",
+ "IDS_XBOX_MUSIC2_APP_TITLE": "Xbox Music",
+ "IDS_XBOX_VIDEO2_APP_TITLE": "Xbox Video",
+ "213": "MDRCD_%s.xml",
+ "256": "%1!02d! %2",
+ "257": "%1!02d! %2 (disc %3!d!)",
+ "27": "Playlists",
+ "30": "Xbox Temporary Music",
+ "327": "Xbox Music",
+ "33": "%1 (%2)"
+ },
+ "MicrosoftAdvertising": {
+ "ExceptionMessages": {
+ "AdGameComponentAlreadyInitialized": "AdGameComponent has already been initialized.",
+ "AdGameComponentHasNotBeenInitialized": "AdGameComponent has not been initialized.",
+ "AdManagerNotInitialized": "AdManager has not been initialized.",
+ "AdMangerAlreadyInitialized": "AdManager has already been initialized with a different ApplicationId.",
+ "AdUnitIdAlreadySet": "AdUnitId has already been set.",
+ "AllActionsMalformed": "All found actions were malformed.",
+ "ApplicationIdIsRequired": "applicationId is required.",
+ "AssetNodeIsSingleEntry": "Asset node is a single entry.",
+ "AutoRefreshStateAlreadySet": "Refresh state has already been set.",
+ "BannerInformationNotFound": "Banner information is not found.",
+ "CapabilitiesMissing": "Required capabilities are missing from manifest (%s): %s.",
+ "ClickToRichUrlWithoutReferralNotWellFormed": "Click to rich media url without referral is not well formed: {0}.",
+ "ClickToRichUrlWithReferralNotWellFormed": "Click to rich media url with referral is not well formed: {0}.",
+ "CouldNotFindProperty": "Could not find property: %s.",
+ "DecodingEscapedCharactersFailed": "Decoding escaped characters failed, more output characters than expected.",
+ "DidNotParseToEnd": "Did not parse until the end.",
+ "ExtractedPropertyNotAString": "Extracted property not of string type: {0}.",
+ "FontDoesNotSupportCharacter": "Font does not support character: {0}.",
+ "GeoDataNotAvailable": "No latitude and longitude data available.",
+ "HttpRequestFailedWithStatusCode": "HTTP request failed with status code: %d.",
+ "HttpResponseContainedNoContent": "Server response contained no content.",
+ "IncompleteInit": "ApplicationId and AdUnitId need to be set before using this control.",
+ "InternalError": "Internal error encountered.",
+ "InvalidAction": "Invalid action param: {0}.",
+ "InvalidDataFormat": "Invalid data format: %s.",
+ "InvalidJsonResponse": "Invalid JSON response: %s.",
+ "InvalidLocation": "The Location value is out of range.",
+ "InvalidParameterMissingItemSeparator": "Invalid Parameter, missing item separator.",
+ "InvalidRefresh": "Refresh cannot be used when auto refresh is enabled.",
+ "InvalidSize": "The rectangle dimensions do not meet the minimum size requirements ({0}x{1}).",
+ "JsonDoesntStartWithObjectOrArray": "Server JSON response does not start with object/array.",
+ "JsonIntegerParseOverflow": "Number being parsed is too big: {0}.",
+ "JsonNodeIsNotADictionary": "Json node is not a dictionary.",
+ "JsonResponseTypeInvalid": "Invalid JSON response type.",
+ "JsonStringValueNotWellFormed": "Json string value not well formed.",
+ "LoadContentNotCalled": "LoadContent has not been called before Update/Draw.",
+ "NonPremiumWithNoApplicationId": "Non-premium ads require the manager to be created with a non-null, non-empty applicationID.",
+ "ObjectShouldHaveNoElements": "Object should have no elements yet, but it does.",
+ "ParameterIsLessThanPermittedLength": "Parameter is less than permitted length: {0} < {1}.",
+ "ParameterNullOrEmpty": "Parameter is null or empty.",
+ "ParseStackNotEmpty": "Parsing stack not empty, some nodes not parsed completely.",
+ "ParseStringNotANumber": "Not a valid number to be parsed.",
+ "RectangleHeightNotSufficient": "Rectangle height not sufficient for a single line of text. Height should be at least: {0}.",
+ "RefreshWhileEngaged": "Manual refresh not permitted while ad is engaged.",
+ "RefreshWhileRequestInProgress": "Refresh was triggered but another request is already in progress.",
+ "RequestDataHasNullDataItem": "httpRequestData or its URL is null.",
+ "RichMediaInfoNotFound": "Rich media information not found.",
+ "StringContainsInvalidEscapeSequence": "String contains invalid escape sequences.",
+ "TextAdTitleNotFound": "Mandatory title for text ad not found.",
+ "TooManyImpressionUrls": "Number of impression entries exceeds the limit: {0}.",
+ "UnableToFitText": "Unable to fit text in the given space.",
+ "UnicodeCharacterTruncated": "Unicode character is truncated.",
+ "UnknownAdType": "Unknown ad type: {0}.",
+ "UnknownJsonToken": "Unknown token encountered: {0}.",
+ "UnknownRichMediaMimeType": "Unknown rich media mime type recieved: {0}."
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/resources/generic.json b/packages/microsoft.zunevideo/resources/generic.json
new file mode 100644
index 00000000..572c5100
--- /dev/null
+++ b/packages/microsoft.zunevideo/resources/generic.json
@@ -0,0 +1,527 @@
+{
+ "Files": {
+ "animations": {
+ "animations.css": "animations\\animations.css",
+ "HubStripAnimations.js": "animations\\HubStripAnimations.js",
+ "ShellAnimations.css": "animations\\ShellAnimations.css",
+ "SocialAnimations.js": "animations\\SocialAnimations.js"
+ },
+ "Classic": {
+ "DelayedStageThreeStartup.html": "Classic\\DelayedStageThreeStartup.html",
+ "Main.html": "Classic\\Main.html"
+ },
+ "Components": {
+ "Accounts": {
+ "AcceptTermsOfService.js": "Components\\Accounts\\AcceptTermsOfService.js",
+ "AccountProvisioningDialog.html": "Components\\Accounts\\AccountProvisioningDialog.html",
+ "AccountProvisioningDialog.js": "Components\\Accounts\\AccountProvisioningDialog.js"
+ },
+ "Dashboard": {
+ "DashboardViewModel.js": "Components\\Dashboard\\DashboardViewModel.js"
+ },
+ "Immersive": {
+ "Shared": {
+ "BaseImmersiveOverviewSummary.js": "Components\\Immersive\\Shared\\BaseImmersiveOverviewSummary.js",
+ "BaseImmersiveSummary.js": "Components\\Immersive\\Shared\\BaseImmersiveSummary.js",
+ "MoreGalleryControl.html": "Components\\Immersive\\Shared\\MoreGalleryControl.html",
+ "MoreGalleryControl.js": "Components\\Immersive\\Shared\\MoreGalleryControl.js",
+ "RelatedGridItems.html": "Components\\Immersive\\Shared\\RelatedGridItems.html",
+ "RelatedGridItems.js": "Components\\Immersive\\Shared\\RelatedGridItems.js",
+ "RelatedItems.html": "Components\\Immersive\\Shared\\RelatedItems.html",
+ "RelatedItems.js": "Components\\Immersive\\Shared\\RelatedItems.js"
+ },
+ "Video": {
+ "CastAndCrew.js": "Components\\Immersive\\Video\\CastAndCrew.js",
+ "CastAndCrewMore.html": "Components\\Immersive\\Video\\CastAndCrewMore.html",
+ "CriticReviewMore.html": "Components\\Immersive\\Video\\CriticReviewMore.html",
+ "Episodes.js": "Components\\Immersive\\Video\\Episodes.js",
+ "EpisodesMore.html": "Components\\Immersive\\Video\\EpisodesMore.html",
+ "Extras.js": "Components\\Immersive\\Video\\Extras.js",
+ "ExtrasMore.html": "Components\\Immersive\\Video\\ExtrasMore.html",
+ "MoreVideoOverview.html": "Components\\Immersive\\Video\\MoreVideoOverview.html",
+ "MovieHero.html": "Components\\Immersive\\Video\\MovieHero.html",
+ "MovieHero.js": "Components\\Immersive\\Video\\MovieHero.js",
+ "MovieImmersiveTemplates.html": "Components\\Immersive\\Video\\MovieImmersiveTemplates.html",
+ "MovieOverview.js": "Components\\Immersive\\Video\\MovieOverview.js",
+ "TVHero.html": "Components\\Immersive\\Video\\TVHero.html",
+ "TVHero.js": "Components\\Immersive\\Video\\TVHero.js",
+ "TVImmersiveTemplates.html": "Components\\Immersive\\Video\\TVImmersiveTemplates.html",
+ "TVOverview.js": "Components\\Immersive\\Video\\TVOverview.js",
+ "VideoHero.js": "Components\\Immersive\\Video\\VideoHero.js"
+ },
+ "Immersive.html": "Components\\Immersive\\Immersive.html",
+ "Immersive.js": "Components\\Immersive\\Immersive.js",
+ "ImmersiveNavStub.html": "Components\\Immersive\\ImmersiveNavStub.html"
+ },
+ "ImmersiveDetails": {
+ "InformationArchitecture.js": "Components\\ImmersiveDetails\\InformationArchitecture.js",
+ "SnappedDetails.html": "Components\\ImmersiveDetails\\SnappedDetails.html",
+ "SnappedDetails.js": "Components\\ImmersiveDetails\\SnappedDetails.js",
+ "SnappedMovieDetails.html": "Components\\ImmersiveDetails\\SnappedMovieDetails.html",
+ "SnappedMovieDetails.js": "Components\\ImmersiveDetails\\SnappedMovieDetails.js",
+ "SnappedTvEpisodeDetails.html": "Components\\ImmersiveDetails\\SnappedTvEpisodeDetails.html",
+ "SnappedTvEpisodeDetails.js": "Components\\ImmersiveDetails\\SnappedTvEpisodeDetails.js"
+ },
+ "InlineDetails": {
+ "ActionButtonsControl.html": "Components\\InlineDetails\\ActionButtonsControl.html",
+ "BaseInlineDetails.js": "Components\\InlineDetails\\BaseInlineDetails.js",
+ "MusicAlbumInlineDetails.html": "Components\\InlineDetails\\MusicAlbumInlineDetails.html",
+ "MusicAlbumInlineDetails.js": "Components\\InlineDetails\\MusicAlbumInlineDetails.js",
+ "MusicArtistInlineDetails.html": "Components\\InlineDetails\\MusicArtistInlineDetails.html",
+ "MusicArtistInlineDetails.js": "Components\\InlineDetails\\MusicArtistInlineDetails.js",
+ "MusicPlaylistInlineDetails.html": "Components\\InlineDetails\\MusicPlaylistInlineDetails.html",
+ "MusicPlaylistInlineDetails.js": "Components\\InlineDetails\\MusicPlaylistInlineDetails.js",
+ "TvEpisodeInlineDetails.html": "Components\\InlineDetails\\TvEpisodeInlineDetails.html",
+ "TvEpisodeInlineDetails.js": "Components\\InlineDetails\\TvEpisodeInlineDetails.js",
+ "TvSeriesInlineDetails.html": "Components\\InlineDetails\\TvSeriesInlineDetails.html",
+ "TvSeriesInlineDetails.js": "Components\\InlineDetails\\TvSeriesInlineDetails.js",
+ "VideoInlineDetailsDemo.html": "Components\\InlineDetails\\VideoInlineDetailsDemo.html",
+ "VideoInlineDetailsDemo.js": "Components\\InlineDetails\\VideoInlineDetailsDemo.js"
+ },
+ "Music": {
+ "Music.html": "Components\\Music\\Music.html",
+ "MusicCollection.js": "Components\\Music\\MusicCollection.js",
+ "MusicPageHost.html": "Components\\Music\\MusicPageHost.html",
+ "MusicPages.js": "Components\\Music\\MusicPages.js",
+ "MusicPagesVertical.html": "Components\\Music\\MusicPagesVertical.html",
+ "MusicPanels.html": "Components\\Music\\MusicPanels.html",
+ "MusicSharedTemplatesControls.js": "Components\\Music\\MusicSharedTemplatesControls.js"
+ },
+ "Playback": {
+ "Controls": {
+ "PlaybackControl.css": "Components\\Playback\\Controls\\PlaybackControl.css",
+ "PlaybackControl.html": "Components\\Playback\\Controls\\PlaybackControl.html"
+ },
+ "Netstats": {
+ "VideoNetstats.js": "Components\\Playback\\Netstats\\VideoNetstats.js"
+ },
+ "Playlist": {
+ "NewPlaylistOverlay.html": "Components\\Playback\\Playlist\\NewPlaylistOverlay.html",
+ "NewPlaylistOverlay.js": "Components\\Playback\\Playlist\\NewPlaylistOverlay.js"
+ },
+ "IndivWorker.js": "Components\\Playback\\IndivWorker.js",
+ "VideoScrubber.js": "Components\\Playback\\VideoScrubber.js"
+ },
+ "Search": {
+ "SearchSharedTemplates.html": "Components\\Search\\SearchSharedTemplates.html",
+ "SearchView.js": "Components\\Search\\SearchView.js",
+ "VideoSearchView.js": "Components\\Search\\VideoSearchView.js"
+ },
+ "Settings": {
+ "Settings.js": "Components\\Settings\\Settings.js",
+ "SettingsAbout.html": "Components\\Settings\\SettingsAbout.html",
+ "SettingsAccount.html": "Components\\Settings\\SettingsAccount.html",
+ "SettingsCaptions.html": "Components\\Settings\\SettingsCaptions.html",
+ "SettingsFeedback.html": "Components\\Settings\\SettingsFeedback.html",
+ "SettingsPreferences.html": "Components\\Settings\\SettingsPreferences.html"
+ },
+ "shell": {
+ "AdControl.html": "Components\\shell\\AdControl.html",
+ "AdControl.js": "Components\\shell\\AdControl.js",
+ "appNotification.html": "Components\\shell\\appNotification.html",
+ "BackButtonService.js": "Components\\shell\\BackButtonService.js",
+ "ContentNotificationList.html": "Components\\shell\\ContentNotificationList.html",
+ "DeepLinkActions.js": "Components\\shell\\DeepLinkActions.js",
+ "DragDataService.js": "Components\\shell\\DragDataService.js",
+ "FrontHubStrip.html": "Components\\shell\\FrontHubStrip.html",
+ "FrontHubStrip.js": "Components\\shell\\FrontHubStrip.js",
+ "GalleryHubStrip.html": "Components\\shell\\GalleryHubStrip.html",
+ "GalleryHubStrip.js": "Components\\shell\\GalleryHubStrip.js",
+ "ListNotification.js": "Components\\shell\\ListNotification.js",
+ "PrimaryNavigationButton.js": "Components\\shell\\PrimaryNavigationButton.js",
+ "ShellKeyboardShortcuts.js": "Components\\shell\\ShellKeyboardShortcuts.js",
+ "SnappedMode.html": "Components\\shell\\SnappedMode.html",
+ "SnappedMode.js": "Components\\shell\\SnappedMode.js"
+ },
+ "Video": {
+ "AppbarActions.js": "Components\\Video\\AppbarActions.js",
+ "AppServices.js": "Components\\Video\\AppServices.js",
+ "CriticReviewControls.js": "Components\\Video\\CriticReviewControls.js",
+ "DemoDashboardViewModel.js": "Components\\Video\\DemoDashboardViewModel.js",
+ "EmptyHome.html": "Components\\Video\\EmptyHome.html",
+ "FeaturedMoviesView.html": "Components\\Video\\FeaturedMoviesView.html",
+ "FeaturedTvView.html": "Components\\Video\\FeaturedTvView.html",
+ "HubDashboardViewModel.js": "Components\\Video\\HubDashboardViewModel.js",
+ "InteractiveTVHelper.js": "Components\\Video\\InteractiveTVHelper.js",
+ "MovieDashboardViewModel.js": "Components\\Video\\MovieDashboardViewModel.js",
+ "NewMoviesView.html": "Components\\Video\\NewMoviesView.html",
+ "NewTvView.html": "Components\\Video\\NewTvView.html",
+ "PreviewBrowse.html": "Components\\Video\\PreviewBrowse.html",
+ "PreviewBrowse.js": "Components\\Video\\PreviewBrowse.js",
+ "PurchaseVideo.js": "Components\\Video\\PurchaseVideo.js",
+ "RentalExpirationService.js": "Components\\Video\\RentalExpirationService.js",
+ "TransferNotificationHandler.js": "Components\\Video\\TransferNotificationHandler.js",
+ "TvDashboardViewModel.js": "Components\\Video\\TvDashboardViewModel.js",
+ "TvSeriesHeaderControl.html": "Components\\Video\\TvSeriesHeaderControl.html",
+ "TvSeriesHeaderControl.js": "Components\\Video\\TvSeriesHeaderControl.js",
+ "VideoCloudCollectionService.js": "Components\\Video\\VideoCloudCollectionService.js",
+ "VideoCollection.html": "Components\\Video\\VideoCollection.html",
+ "VideoCollection.js": "Components\\Video\\VideoCollection.js",
+ "VideoCollectionPanels.html": "Components\\Video\\VideoCollectionPanels.html",
+ "VideoCollectionTemplates.html": "Components\\Video\\VideoCollectionTemplates.html",
+ "VideoDashboardViewModel.js": "Components\\Video\\VideoDashboardViewModel.js",
+ "VideoFeatures.js": "Components\\Video\\VideoFeatures.js",
+ "VideoFullScreenNowPlaying.html": "Components\\Video\\VideoFullScreenNowPlaying.html",
+ "VideoFullScreenNowPlaying.js": "Components\\Video\\VideoFullScreenNowPlaying.js",
+ "VideoIA.js": "Components\\Video\\VideoIA.js",
+ "VideoMarketplaceTemplates.html": "Components\\Video\\VideoMarketplaceTemplates.html",
+ "VideoPanels.html": "Components\\Video\\VideoPanels.html",
+ "VideoSearchTemplates.html": "Components\\Video\\VideoSearchTemplates.html",
+ "VideoSharedTemplatesControls.js": "Components\\Video\\VideoSharedTemplatesControls.js",
+ "VideoSpotlightView1.html": "Components\\Video\\VideoSpotlightView1.html",
+ "VideoStartupIA.js": "Components\\Video\\VideoStartupIA.js",
+ "VideoStartupTemplates.html": "Components\\Video\\VideoStartupTemplates.html"
+ },
+ "Video_Win": {
+ "EpisodeDetails.html": "Components\\Video_Win\\EpisodeDetails.html",
+ "MovieDetails.html": "Components\\Video_Win\\MovieDetails.html",
+ "MoviesStore.html": "Components\\Video_Win\\MoviesStore.html",
+ "SearchResultsPage.html": "Components\\Video_Win\\SearchResultsPage.html",
+ "TvDetails.html": "Components\\Video_Win\\TvDetails.html",
+ "TvStore.html": "Components\\Video_Win\\TvStore.html",
+ "VideoCollection.html": "Components\\Video_Win\\VideoCollection.html",
+ "VideoCollectionDelayedScripts.html": "Components\\Video_Win\\VideoCollectionDelayedScripts.html",
+ "VideoMarketplacePageTemplate.html": "Components\\Video_Win\\VideoMarketplacePageTemplate.html"
+ },
+ "BaseTransferNotificationHandler.js": "Components\\BaseTransferNotificationHandler.js",
+ "Marketplace.html": "Components\\Marketplace.html",
+ "Marketplace.js": "Components\\Marketplace.js"
+ },
+ "controls": {
+ "AppBar": {
+ "BottomAppBar.html": "controls\\AppBar\\BottomAppBar.html",
+ "BottomAppBar.js": "controls\\AppBar\\BottomAppBar.js",
+ "BottomProgressBar.html": "controls\\AppBar\\BottomProgressBar.html",
+ "BottomProgressBar.js": "controls\\AppBar\\BottomProgressBar.js",
+ "RemoveOverlay.html": "controls\\AppBar\\RemoveOverlay.html",
+ "RemoveOverlay.js": "controls\\AppBar\\RemoveOverlay.js"
+ },
+ "Music": {
+ "ArtistImageCollage.js": "controls\\Music\\ArtistImageCollage.js",
+ "PlaylistImageCollage.js": "controls\\Music\\PlaylistImageCollage.js"
+ },
+ "NowPlaying": {
+ "HomeNowPlayingTile.html": "controls\\NowPlaying\\HomeNowPlayingTile.html",
+ "HomeNowPlayingTile.js": "controls\\NowPlaying\\HomeNowPlayingTile.js",
+ "MusicVisualization.html": "controls\\NowPlaying\\MusicVisualization.html",
+ "MusicVisualization.js": "controls\\NowPlaying\\MusicVisualization.js",
+ "NowPlaying.html": "controls\\NowPlaying\\NowPlaying.html",
+ "NowPlaying.js": "controls\\NowPlaying\\NowPlaying.js",
+ "NowPlayingMetadata.html": "controls\\NowPlaying\\NowPlayingMetadata.html",
+ "NowPlayingMetadata.js": "controls\\NowPlaying\\NowPlayingMetadata.js",
+ "NowPlayingOverlays.html": "controls\\NowPlaying\\NowPlayingOverlays.html",
+ "NowPlayingPlaylist.html": "controls\\NowPlaying\\NowPlayingPlaylist.html",
+ "NowPlayingPlaylist.js": "controls\\NowPlaying\\NowPlayingPlaylist.js",
+ "NowPlayingTransportControls.html": "controls\\NowPlaying\\NowPlayingTransportControls.html",
+ "NowPlayingTransportControls.js": "controls\\NowPlaying\\NowPlayingTransportControls.js",
+ "SnappedNowPlaying.html": "controls\\NowPlaying\\SnappedNowPlaying.html",
+ "SnappedNowPlaying.js": "controls\\NowPlaying\\SnappedNowPlaying.js",
+ "SnappedNowPlayingMetadata.html": "controls\\NowPlaying\\SnappedNowPlayingMetadata.html",
+ "SnappedNowPlayingMetadata.js": "controls\\NowPlaying\\SnappedNowPlayingMetadata.js",
+ "SnappedNowPlayingPlaylist.js": "controls\\NowPlaying\\SnappedNowPlayingPlaylist.js",
+ "SnappedNowPlayingPlaylistFlipView.js": "controls\\NowPlaying\\SnappedNowPlayingPlaylistFlipView.js"
+ },
+ "TransportControls": {
+ "SeekBar.html": "controls\\TransportControls\\SeekBar.html",
+ "SeekBar.js": "controls\\TransportControls\\SeekBar.js",
+ "TimelineEvent.html": "controls\\TransportControls\\TimelineEvent.html",
+ "TimelineEvent.js": "controls\\TransportControls\\TimelineEvent.js",
+ "TransportControls.html": "controls\\TransportControls\\TransportControls.html",
+ "VideoScrub.html": "controls\\TransportControls\\VideoScrub.html",
+ "VideoScrub.js": "controls\\TransportControls\\VideoScrub.js",
+ "VolumeBar.html": "controls\\TransportControls\\VolumeBar.html",
+ "VolumeBar.js": "controls\\TransportControls\\VolumeBar.js"
+ },
+ "Video": {
+ "ChooseDownloadQuality.html": "controls\\Video\\ChooseDownloadQuality.html",
+ "RentalOptionsDialog.html": "controls\\Video\\RentalOptionsDialog.html",
+ "RentalOptionsDialog.js": "controls\\Video\\RentalOptionsDialog.js",
+ "SeasonModifier.html": "controls\\Video\\SeasonModifier.html",
+ "SeasonModifier.js": "controls\\Video\\SeasonModifier.js",
+ "TvEpisodeDownloadStatus.js": "controls\\Video\\TvEpisodeDownloadStatus.js",
+ "VideoDownloadItem.html": "controls\\Video\\VideoDownloadItem.html",
+ "VideoDownloadItem.js": "controls\\Video\\VideoDownloadItem.js",
+ "VideoDownloadManager.html": "controls\\Video\\VideoDownloadManager.html",
+ "VideoNowPlayingOverlays.html": "controls\\Video\\VideoNowPlayingOverlays.html",
+ "VideoNowPlayingOverlays.js": "controls\\Video\\VideoNowPlayingOverlays.js",
+ "VideoPostRoll.html": "controls\\Video\\VideoPostRoll.html",
+ "VideoPostRoll.js": "controls\\Video\\VideoPostRoll.js",
+ "WatchProgress.html": "controls\\Video\\WatchProgress.html",
+ "WatchProgress.js": "controls\\Video\\WatchProgress.js"
+ },
+ "Video_Win": {
+ "AudioTrackPickerControl.html": "controls\\Video_Win\\AudioTrackPickerControl.html",
+ "AudioTrackPickerControl.js": "controls\\Video_Win\\AudioTrackPickerControl.js",
+ "ClosedCaptionPickerControl.html": "controls\\Video_Win\\ClosedCaptionPickerControl.html",
+ "ClosedCaptionPickerControl.js": "controls\\Video_Win\\ClosedCaptionPickerControl.js",
+ "DeviceLimitError.html": "controls\\Video_Win\\DeviceLimitError.html",
+ "EpisodeDetails.js": "controls\\Video_Win\\EpisodeDetails.js",
+ "LanguagePicker.html": "controls\\Video_Win\\LanguagePicker.html",
+ "VideoWinNowPlayingOverlays.html": "controls\\Video_Win\\VideoWinNowPlayingOverlays.html"
+ },
+ "actionList.html": "controls\\actionList.html",
+ "ArcProgress.html": "controls\\ArcProgress.html",
+ "ArcProgress.js": "controls\\ArcProgress.js",
+ "controls.css": "controls\\controls.css",
+ "Dashboard.html": "controls\\Dashboard.html",
+ "Dashboard.js": "controls\\Dashboard.js",
+ "DashboardPanel.html": "controls\\DashboardPanel.html",
+ "Dialog.html": "controls\\Dialog.html",
+ "EditBox.html": "controls\\EditBox.html",
+ "EditBox.js": "controls\\EditBox.js",
+ "ErrorDialog.html": "controls\\ErrorDialog.html",
+ "FailedPanel.html": "controls\\FailedPanel.html",
+ "FailedPanel.js": "controls\\FailedPanel.js",
+ "FeaturedContent.js": "controls\\FeaturedContent.js",
+ "FlipView.html": "controls\\FlipView.html",
+ "FlipView.js": "controls\\FlipView.js",
+ "Flyout.html": "controls\\Flyout.html",
+ "Flyout.js": "controls\\Flyout.js",
+ "GalleryControl.html": "controls\\GalleryControl.html",
+ "GalleryThumbnail.js": "controls\\GalleryThumbnail.js",
+ "Hub.html": "controls\\Hub.html",
+ "Hub.js": "controls\\Hub.js",
+ "HubStrip.html": "controls\\HubStrip.html",
+ "HubStrip.js": "controls\\HubStrip.js",
+ "iconbutton.html": "controls\\iconbutton.html",
+ "ImageCollage.html": "controls\\ImageCollage.html",
+ "ImageCollage.js": "controls\\ImageCollage.js",
+ "ImmersiveLayout.html": "controls\\ImmersiveLayout.html",
+ "ImmersiveLayout.js": "controls\\ImmersiveLayout.js",
+ "LibraryFeaturedContent.html": "controls\\LibraryFeaturedContent.html",
+ "LibraryFeaturedContent.js": "controls\\LibraryFeaturedContent.js",
+ "Link.html": "controls\\Link.html",
+ "LoadingControl.js": "controls\\LoadingControl.js",
+ "ManageFoldersPage.html": "controls\\ManageFoldersPage.html",
+ "MediaImageCollage.js": "controls\\MediaImageCollage.js",
+ "MediaItemThumbnail.js": "controls\\MediaItemThumbnail.js",
+ "MessageBox.html": "controls\\MessageBox.html",
+ "MessageBox.js": "controls\\MessageBox.js",
+ "MessageLinkBox.html": "controls\\MessageLinkBox.html",
+ "MessageLinkBox.js": "controls\\MessageLinkBox.js",
+ "Modifier.html": "controls\\Modifier.html",
+ "ModifierGalleryPage.html": "controls\\ModifierGalleryPage.html",
+ "ModifierGalleryPage.js": "controls\\ModifierGalleryPage.js",
+ "Music8Dashboard.html": "controls\\Music8Dashboard.html",
+ "Overlay.html": "controls\\Overlay.html",
+ "PivotControls.html": "controls\\PivotControls.html",
+ "PleaseResizeDialog.js": "controls\\PleaseResizeDialog.js",
+ "PopOver.html": "controls\\PopOver.html",
+ "SearchFlyout.html": "controls\\SearchFlyout.html",
+ "SearchFlyout.js": "controls\\SearchFlyout.js",
+ "ShowMore.html": "controls\\ShowMore.html",
+ "SignInControl.html": "controls\\SignInControl.html",
+ "SignInControl.js": "controls\\SignInControl.js",
+ "StarRatingControl.html": "controls\\StarRatingControl.html",
+ "templateSelector.js": "controls\\templateSelector.js",
+ "thumbnailButton.html": "controls\\thumbnailButton.html",
+ "thumbnailButton.js": "controls\\thumbnailButton.js",
+ "ToggleModifier.html": "controls\\ToggleModifier.html",
+ "ToggleModifier.js": "controls\\ToggleModifier.js",
+ "UpgradeTile.html": "controls\\UpgradeTile.html",
+ "UpgradeTile.js": "controls\\UpgradeTile.js",
+ "UserFeedbackDialog.html": "controls\\UserFeedbackDialog.html",
+ "VideoAd.html": "controls\\VideoAd.html",
+ "VideoAd.js": "controls\\VideoAd.js",
+ "WebHost.html": "controls\\WebHost.html",
+ "WebHost.js": "controls\\WebHost.js",
+ "WebHostDialog.html": "controls\\WebHostDialog.html",
+ "WebHostDialog.js": "controls\\WebHostDialog.js",
+ "WebHostMessage.js": "controls\\WebHostMessage.js"
+ },
+ "Fonts": {
+ "segxmvr.woff": "Fonts\\segxmvr.woff",
+ "segxsym.woff": "Fonts\\segxsym.woff"
+ },
+ "Framework": {
+ "data": {
+ "ObservableArrayVirtualListAdapter.js": "Framework\\data\\ObservableArrayVirtualListAdapter.js",
+ "xboxLive.js": "Framework\\data\\xboxLive.js",
+ "xhr.js": "Framework\\data\\xhr.js"
+ },
+ "abTestingUtilities.js": "Framework\\abTestingUtilities.js",
+ "abTests.js": "Framework\\abTests.js",
+ "CoreFX_TSHelpers.js": "Framework\\CoreFX_TSHelpers.js",
+ "DashboardRefresherService.js": "Framework\\DashboardRefresherService.js",
+ "DeviceGroupService.js": "Framework\\DeviceGroupService.js",
+ "featureEnablement.js": "Framework\\featureEnablement.js",
+ "fileActivationHandler.js": "Framework\\fileActivationHandler.js",
+ "IAService.js": "Framework\\IAService.js",
+ "IdVision.js": "Framework\\IdVision.js",
+ "launchAppAction.js": "Framework\\launchAppAction.js",
+ "navigation.js": "Framework\\navigation.js",
+ "PlaybackErrorDisplayService.js": "Framework\\PlaybackErrorDisplayService.js",
+ "ProgressNotificationService.js": "Framework\\ProgressNotificationService.js",
+ "searchaction.js": "Framework\\searchaction.js",
+ "shiftDashboardAction.js": "Framework\\shiftDashboardAction.js",
+ "videoServiceIdentifiers.js": "Framework\\videoServiceIdentifiers.js",
+ "VideoTileManager.js": "Framework\\VideoTileManager.js"
+ },
+ "Images": {
+ "GenericIcons": {
+ "actor_placeholder.png": "Images\\GenericIcons\\actor_placeholder.png",
+ "cast_placeholder.png": "Images\\GenericIcons\\cast_placeholder.png",
+ "ico_74x_GenericVideo_Large.png": "Images\\GenericIcons\\ico_74x_GenericVideo_Large.scale-100.png",
+ "ico_74x_GenericVideo_LargeMovie.png": "Images\\GenericIcons\\ico_74x_GenericVideo_LargeMovie.scale-100.png",
+ "ico_74x_GenericVideo_Medium.png": "Images\\GenericIcons\\ico_74x_GenericVideo_Medium.scale-100.png",
+ "ico_74x_GenericVideo_Small.png": "Images\\GenericIcons\\ico_74x_GenericVideo_Small.scale-100.png",
+ "ico_GenericVideo_L3_Hero.png": "Images\\GenericIcons\\ico_GenericVideo_L3_Hero.scale-100.png",
+ "ico_GenericVideo_Wide.png": "Images\\GenericIcons\\ico_GenericVideo_Wide.scale-100.png"
+ },
+ "ListStripes": {
+ "ListStripesDark.png": "Images\\ListStripes\\ListStripesDark.scale-100.png"
+ },
+ "LoadingCardTemplateBg": {
+ "LoadingCardTemplateBg_Video.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_Video.scale-100.png",
+ "LoadingCardTemplateBg_VideoOther.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_VideoOther.scale-100.png",
+ "LoadingCardTemplateBg_VideoOtherRTL.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_VideoOtherRTL.scale-100.png",
+ "LoadingCardTemplateBg_VideoRTL.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_VideoRTL.scale-100.png",
+ "LoadingCardTemplateBg_VideoSquare.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_VideoSquare.scale-100.png",
+ "LoadingCardTemplateBg_VideoSquareRTL.png": "Images\\LoadingCardTemplateBg\\LoadingCardTemplateBg_VideoSquareRTL.scale-100.png"
+ },
+ "NowPlaying": {
+ "now_playing_mask.png": "Images\\NowPlaying\\now_playing_mask.png"
+ },
+ "ThirdParty": {
+ "ico_RottenTomatoes_CertifiedFresh.png": "Images\\ThirdParty\\ico_RottenTomatoes_CertifiedFresh.png",
+ "ico_RottenTomatoes_Fresh.png": "Images\\ThirdParty\\ico_RottenTomatoes_Fresh.png",
+ "ico_RottenTomatoes_Rotten.png": "Images\\ThirdParty\\ico_RottenTomatoes_Rotten.png"
+ },
+ "Tiles": {
+ "VideoIcon.png": "Images\\Tiles\\VideoIcon.png",
+ "Video_Movie_Resume_2x2.png": "Images\\Tiles\\Video_Movie_Resume_2x2.scale-100.png",
+ "Video_Tv_Resume_2x2.png": "Images\\Tiles\\Video_Tv_Resume_2x2.scale-100.png",
+ "XBL_VIDEO_150x150_A.png": "Images\\Tiles\\XBL_VIDEO_150x150_A.scale-100.png",
+ "XBL_VIDEO_30x30_A.png": "Images\\Tiles\\XBL_VIDEO_30x30_A.scale-100.png",
+ "XBL_VIDEO_310x150_C.png": "Images\\Tiles\\XBL_VIDEO_310x150_C.scale-100.png",
+ "XBL_VIDEO_310x310_A.png": "Images\\Tiles\\XBL_VIDEO_310x310_A.scale-100.png",
+ "XBL_VIDEO_50x50_A.png": "Images\\Tiles\\XBL_VIDEO_50x50_A.png",
+ "XBL_VIDEO_620x300_A.png": "Images\\Tiles\\XBL_VIDEO_620x300_A.scale-100.png",
+ "XBL_VIDEO_70x70_A.png": "Images\\Tiles\\XBL_VIDEO_70x70_A.scale-100.png"
+ },
+ "TransportControls": {
+ "leaf_default.png": "Images\\TransportControls\\leaf_default.png",
+ "leaf_touch.png": "Images\\TransportControls\\leaf_touch.png"
+ },
+ "VideoRatings": {
+ "video_poland_ratings_12.png": "Images\\VideoRatings\\video_poland_ratings_12.scale-100.png",
+ "video_poland_ratings_16.png": "Images\\VideoRatings\\video_poland_ratings_16.scale-100.png",
+ "video_poland_ratings_18.png": "Images\\VideoRatings\\video_poland_ratings_18.scale-100.png",
+ "video_poland_ratings_7.png": "Images\\VideoRatings\\video_poland_ratings_7.scale-100.png",
+ "video_poland_ratings_no_restriction.png": "Images\\VideoRatings\\video_poland_ratings_no_restriction.scale-100.png"
+ },
+ "WebDialogResize": {
+ "RotateResizeIcon.png": "Images\\WebDialogResize\\RotateResizeIcon.scale-100.png"
+ },
+ "AppBar_gradient.png": "Images\\AppBar_gradient.png",
+ "img_not_found.png": "Images\\img_not_found.png",
+ "immersive_details_background_gradient.png": "Images\\immersive_details_background_gradient.png",
+ "immersive_details_viewMore_background_gradient.png": "Images\\immersive_details_viewMore_background_gradient.png",
+ "link_asset.png": "Images\\link_asset.png",
+ "loading_image.png": "Images\\loading_image.png",
+ "notification_retry_ring_dark.png": "Images\\notification_retry_ring_dark.png",
+ "notification_retry_ring_light.png": "Images\\notification_retry_ring_light.png",
+ "notification_retry_spinner_dark.png": "Images\\notification_retry_spinner_dark.png",
+ "notification_retry_spinner_light.png": "Images\\notification_retry_spinner_light.png",
+ "squareLoading.png": "Images\\squareLoading.png",
+ "standard_card_square_art_overlay.png": "Images\\standard_card_square_art_overlay.png",
+ "streaming_dark.png": "Images\\streaming_dark.png",
+ "streaming_light.png": "Images\\streaming_light.png",
+ "transparent.png": "Images\\transparent.png",
+ "x8_300x250_ad_error.png": "Images\\x8_300x250_ad_error.png",
+ "x8_300x600_ad_error.png": "Images\\x8_300x600_ad_error.png"
+ },
+ "MSAdvertisingJS": {
+ "ads": {
+ "ad.js": "MSAdvertisingJS\\ads\\ad.js",
+ "bootstrap.html": "MSAdvertisingJS\\ads\\bootstrap.html",
+ "bootstrap.js": "MSAdvertisingJS\\ads\\bootstrap.js",
+ "ormma.js": "MSAdvertisingJS\\ads\\ormma.js",
+ "VASTAd.js": "MSAdvertisingJS\\ads\\VASTAd.js"
+ }
+ },
+ "Styles": {
+ "Animations.css": "Styles\\Animations.css",
+ "App.css": "Styles\\App.css",
+ "ClosedCaption.css": "Styles\\ClosedCaption.css",
+ "DefaultStyles.css": "Styles\\DefaultStyles.css",
+ "Images.css": "Styles\\Images.css",
+ "NowPlaying.css": "Styles\\NowPlaying.css",
+ "Settings.css": "Styles\\Settings.css",
+ "Shell.css": "Styles\\Shell.css",
+ "TransportControls.css": "Styles\\TransportControls.css",
+ "ui-overrides.css": "Styles\\ui-overrides.css"
+ },
+ "ViewModels": {
+ "Home": {
+ "FeaturedViewModel.js": "ViewModels\\Home\\FeaturedViewModel.js",
+ "SpotlightViewModel.js": "ViewModels\\Home\\SpotlightViewModel.js"
+ },
+ "Immersive": {
+ "ImmersiveViewModels.js": "ViewModels\\Immersive\\ImmersiveViewModels.js"
+ },
+ "Music": {
+ "MusicHubCollectionPanel.js": "ViewModels\\Music\\MusicHubCollectionPanel.js"
+ },
+ "Search": {
+ "NewSearchViewModel.js": "ViewModels\\Search\\NewSearchViewModel.js",
+ "SearchContractViewModel.js": "ViewModels\\Search\\SearchContractViewModel.js",
+ "SearchViewModel.js": "ViewModels\\Search\\SearchViewModel.js",
+ "VideoSearchTemplates1.js": "ViewModels\\Search\\VideoSearchTemplates1.js",
+ "VideoSearchViewModel.js": "ViewModels\\Search\\VideoSearchViewModel.js"
+ },
+ "Video": {
+ "MovieImmersiveViewModel.js": "ViewModels\\Video\\MovieImmersiveViewModel.js",
+ "TvImmersiveViewModel.js": "ViewModels\\Video\\TvImmersiveViewModel.js",
+ "VideoCollectionTemplates.js": "ViewModels\\Video\\VideoCollectionTemplates.js",
+ "VideoCollectionViewModel.js": "ViewModels\\Video\\VideoCollectionViewModel.js",
+ "VideoHubCollectionPanel.js": "ViewModels\\Video\\VideoHubCollectionPanel.js",
+ "VideoMarketplaceTemplates.js": "ViewModels\\Video\\VideoMarketplaceTemplates.js",
+ "VideoMarketplaceViewModel.js": "ViewModels\\Video\\VideoMarketplaceViewModel.js",
+ "VideoSpotlight.js": "ViewModels\\Video\\VideoSpotlight.js"
+ },
+ "Video_Win": {
+ "EpisodeDetailsViewModel.js": "ViewModels\\Video_Win\\EpisodeDetailsViewModel.js"
+ },
+ "Command.js": "ViewModels\\Command.js"
+ },
+ "AppxManifest.xml": "AppxManifest.xml",
+ "config.json": "config.json",
+ "delayedStageFourStartup.html": "delayedStageFourStartup.html",
+ "delayedStageThreeStartup.html": "delayedStageThreeStartup.html",
+ "EntCommon.dll": "EntCommon.dll",
+ "EntPlat.dll": "EntPlat.dll",
+ "EntSyncFx.dll": "EntSyncFx.dll",
+ "fileActivationStartup.html": "fileActivationStartup.html",
+ "gnsdk_fp.dll": "gnsdk_fp.dll",
+ "group_1_merged.js": "group_1_merged.js",
+ "group_2_merged.js": "group_2_merged.js",
+ "launchToCollectionStartup.html": "launchToCollectionStartup.html",
+ "LiveIdChange.js": "LiveIdChange.js",
+ "main.html": "main.html",
+ "main.js": "main.js",
+ "main_merged.js": "main_merged.js",
+ "Microsoft.Entertainment.Instrumentation.Providers.dll": "Microsoft.Entertainment.Instrumentation.Providers.dll",
+ "Microsoft.Entertainment.winmd": "Microsoft.Entertainment.winmd",
+ "Microsoft.Media.AdaptiveStreaming.dll": "Microsoft.Media.AdaptiveStreaming.dll",
+ "Microsoft.Media.AdaptiveStreaming.winmd": "Microsoft.Media.AdaptiveStreaming.winmd",
+ "Microsoft.PerfTrack.dll": "Microsoft.PerfTrack.dll",
+ "Microsoft.PerfTrack.winmd": "Microsoft.PerfTrack.winmd",
+ "MicrosoftAdvertising.dll": "MicrosoftAdvertising.dll",
+ "MicrosoftAdvertising.winmd": "MicrosoftAdvertising.winmd",
+ "MovieDetails_merged.js": "MovieDetails_merged.js",
+ "MoviesStore_merged.js": "MoviesStore_merged.js",
+ "msapp-error.html": "msapp-error.html",
+ "msapp-error.js": "msapp-error.js",
+ "NowPlaying_merged.js": "NowPlaying_merged.js",
+ "SearchResultsPage_merged.js": "SearchResultsPage_merged.js",
+ "TvDetails_merged.js": "TvDetails_merged.js",
+ "TvStore_merged.js": "TvStore_merged.js",
+ "updateapp.html": "updateapp.html",
+ "UpdateApp.js": "UpdateApp.js",
+ "Version.json": "Version.json",
+ "VideoCollection_merged.js": "VideoCollection_merged.js",
+ "VideoMarketplacePageTemplate_merged.js": "VideoMarketplacePageTemplate_merged.js",
+ "WarmupCode.js": "WarmupCode.js"
+ }
+}
\ No newline at end of file
diff --git a/packages/microsoft.zunevideo/updateapp.html b/packages/microsoft.zunevideo/updateapp.html
new file mode 100644
index 00000000..ae2dc074
--- /dev/null
+++ b/packages/microsoft.zunevideo/updateapp.html
@@ -0,0 +1,25 @@
+
+
+
+
+ IWX Entertainment Client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/wankerr.desktop/index.html b/packages/wankerr.desktop/index.html
index 3fd3545e..88da6e6d 100644
--- a/packages/wankerr.desktop/index.html
+++ b/packages/wankerr.desktop/index.html
@@ -53,38 +53,14 @@ Start
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -98,15 +74,22 @@ Start
-
@@ -117,9 +100,9 @@
Start
@@ -146,7 +129,7 @@ What's this?
within a web browser, but I aim to make each app as usable
as possible.
If you wanna see more about the project, you can find
+ href="https://github.com/WamWooWam/WinJSGraveyard">find
it on GitHub, or take a look at my
blog which digs deeper into the nitty gritty details
of the project as a whole.
@@ -159,9 +142,9 @@
What's this?
@@ -180,26 +163,26 @@ What's this?
diff --git a/packages/wankerr.desktop/src/Desktop/Package.ts b/packages/wankerr.desktop/src/Desktop/Package.ts
index 3131835e..0c0f9051 100644
--- a/packages/wankerr.desktop/src/Desktop/Package.ts
+++ b/packages/wankerr.desktop/src/Desktop/Package.ts
@@ -172,14 +172,14 @@ export class PackageReader {
var showName = element.getAttribute("ShowName");
if (showName === "allLogos") {
- defaultTile.showNameOnTiles.push("square150x150Logo");
- defaultTile.showNameOnTiles.push("wide310x150Logo");
+ defaultTile.showNameOnTiles.push("square150x150");
+ defaultTile.showNameOnTiles.push("wide310x150");
}
else if (showName == "logoOnly") {
- defaultTile.showNameOnTiles.push("square150x150Logo");
+ defaultTile.showNameOnTiles.push("square150x150");
}
else if (showName == "wideLogoOnly") {
- defaultTile.showNameOnTiles.push("wide310x150Logo");
+ defaultTile.showNameOnTiles.push("wide310x150");
}
}
else {
@@ -188,7 +188,8 @@ export class PackageReader {
defaultTile.square310x310Logo = this.fixupUrl(element.getAttribute("Square310x310Logo"));
for (const showOnElement of element.querySelectorAll("ShowOn")) {
- defaultTile.showNameOnTiles.push(showOnElement.getAttribute("Tile"));
+ let tile = showOnElement.getAttribute("Tile");
+ defaultTile.showNameOnTiles.push(tile.substr(0, tile.length - 4));
}
}
diff --git a/packages/wankerr.desktop/src/Desktop/Start.ts b/packages/wankerr.desktop/src/Desktop/Start.ts
index 2981ed8c..87ad9586 100644
--- a/packages/wankerr.desktop/src/Desktop/Start.ts
+++ b/packages/wankerr.desktop/src/Desktop/Start.ts
@@ -7,6 +7,7 @@ import { Package, PackageIdentity, PackageProperties } from "./Package";
import { Application, ApplicationVisualElements, ApplicationSplashScreen } from "./Application";
import { uuidv4 } from "winrt-node/util";
import { PackageRegistry } from "./PackageRegistry";
+import { TileGroup } from "./TileGroup";
export class Start {
private static _start: Start;
@@ -19,7 +20,7 @@ export class Start {
private showAllElement: HTMLElement;
private hideAllElement: HTMLElement;
- private tiles: Array;
+ private tileGroups: TileGroup[];
private _testPackage: Package;
constructor() {
@@ -30,19 +31,23 @@ export class Start {
this.tilesElement = document.querySelector(".start-tiles");
this.showAllElement = document.querySelector(".start-show-all-button");
this.hideAllElement = document.querySelector(".start-hide-all-button");
- this.tiles = [];
+ this.tileGroups = [];
if (this.showAllElement && this.hideAllElement) {
this.showAllElement.addEventListener("click", this.showAllApps.bind(this));
this.hideAllElement.addEventListener("click", this.hideAllApps.bind(this));
}
- let tileElements = this.tilesElement.querySelectorAll(".tile-container");
- for (let i = 0; i < tileElements.length; i++) {
- let tile = tileElements.item(i);
- this.tiles.push(new Tile(tile));
+ let tileGroupElements = this.tilesElement.querySelectorAll(".start-tile-group");
+ for (let i = 0; i < tileGroupElements.length; i++) {
+ let tileGroupElement = tileGroupElements.item(i);
+ let tileGroup = new TileGroup(tileGroupElement);
+ this.tileGroups.push(tileGroup);
}
+ window.addEventListener("resize", this.layout.bind(this));
+ this.layout();
+
let charms = CharmsBar.getInstance();
}
@@ -122,6 +127,13 @@ export class Start {
tileContainer.insertBefore(tile.rootElement, tile.postElement);
}
+ layout() {
+ for (let i = 0; i < this.tileGroups.length; i++) {
+ const tileGroup = this.tileGroups[i];
+ tileGroup.layout();
+ }
+ }
+
hide() {
this.startElement.classList.add("invisible");
}
diff --git a/packages/wankerr.desktop/src/Desktop/Tile.ts b/packages/wankerr.desktop/src/Desktop/Tile.ts
index 9fe06edc..3d265f93 100644
--- a/packages/wankerr.desktop/src/Desktop/Tile.ts
+++ b/packages/wankerr.desktop/src/Desktop/Tile.ts
@@ -10,10 +10,10 @@ import "./splash-screen.css"
import { PackageRegistry } from "./PackageRegistry";
export enum TileSize {
- square70x70Logo,
- square150x150Logo,
- wide310x150Logo,
- square310x310Logo
+ square70x70,
+ square150x150,
+ wide310x150,
+ square310x310
}
export class Tile {
@@ -26,7 +26,6 @@ export class Tile {
private wasClicked: boolean;
private tileStyle: string;
- private tileSize: TileSize;
private tileSizeString: string;
private tileContainerElement: HTMLDivElement;
private tileContainerPostElement: HTMLDivElement;
@@ -35,16 +34,20 @@ export class Tile {
private showTextSizes: Array
tileGroup: HTMLElement;
+ tileSize: TileSize;
tileBack: HTMLDivElement;
tileFront: HTMLDivElement;
splash: HTMLDivElement;
+
+ // A fence tile is a tile that appears at the start of a 4x4 block of smaller tiles.
+ isFence: boolean;
constructor(tileContainerElement: HTMLDivElement) {
this.tileGroup = tileContainerElement.closest(".start-tile-group");
this.tileContainerElement = tileContainerElement;
this.tileStyle = tileContainerElement.style.cssText;
this.tileContainerPostElement = tileContainerElement.nextElementSibling;
- this.tileSizeString = tileContainerElement.dataset.tileSize ?? "square150x150Logo";
+ this.tileSizeString = tileContainerElement.dataset.tileSize ?? "square150x150";
this.tileSize = TileSize[this.tileSizeString];
this.tileVisuals = []
@@ -104,15 +107,15 @@ export class Tile {
let tileImageUrl = this.app.visualElements.square150x150Logo;
- if (this.tileSize === TileSize.wide310x150Logo && this.app.visualElements.defaultTile.wide310x150Logo) {
+ if (this.tileSize === TileSize.wide310x150 && this.app.visualElements.defaultTile.wide310x150Logo) {
tileImageUrl = this.app.visualElements.defaultTile.wide310x150Logo;
}
- if (this.tileSize === TileSize.square70x70Logo && this.app.visualElements.defaultTile.square70x70Logo) {
+ if (this.tileSize === TileSize.square70x70 && this.app.visualElements.defaultTile.square70x70Logo) {
tileImageUrl = this.app.visualElements.defaultTile.square70x70Logo;
}
- if (this.tileSize === TileSize.square310x310Logo && this.app.visualElements.defaultTile.square310x310Logo) {
+ if (this.tileSize === TileSize.square310x310 && this.app.visualElements.defaultTile.square310x310Logo) {
tileImageUrl = this.app.visualElements.defaultTile.square310x310Logo;
}
@@ -123,7 +126,7 @@ export class Tile {
tileVisualImageContainer.appendChild(tileVisualImage);
tileDefaultVisual.appendChild(tileVisualImageContainer);
- if (this.tileSize != TileSize.square70x70Logo && this.showTextSizes.includes(this.tileSize)) {
+ if (this.tileSize != TileSize.square70x70 && this.showTextSizes.includes(this.tileSize)) {
let tileVisualText = document.createElement("p");
tileVisualText.innerText = this.app.visualElements.displayName;
tileVisualText.classList.add("tile-front-text");
diff --git a/packages/wankerr.desktop/src/Desktop/TileGroup.ts b/packages/wankerr.desktop/src/Desktop/TileGroup.ts
new file mode 100644
index 00000000..73107e2b
--- /dev/null
+++ b/packages/wankerr.desktop/src/Desktop/TileGroup.ts
@@ -0,0 +1,101 @@
+import { Tile, TileSize } from "./Tile";
+
+
+export class TileGroup {
+
+ private startTilesElement: HTMLDivElement;
+ private rootElement: HTMLDivElement;
+ private tilesElement: HTMLDivElement;
+ private headerText: HTMLDivElement;
+ private tiles: Tile[];
+
+ get title(): string {
+ return this.headerText.innerText;
+ }
+
+ set title(value: string) {
+ this.headerText.innerText = value;
+ }
+
+ constructor(tileGroupElement: HTMLDivElement) {
+ this.rootElement = tileGroupElement;
+ this.startTilesElement = this.rootElement.parentElement;
+ this.headerText = tileGroupElement.querySelector(".tile-group-header-text");
+ this.tilesElement = tileGroupElement.querySelector(".tile-group-tiles");
+ this.tiles = [];
+
+ var tileElements = this.rootElement.querySelectorAll(".tile-container");
+ for (let i = 0; i < tileElements.length; i++) {
+ const tileElement = tileElements[i];
+ this.tiles.push(new Tile(tileElement));
+ }
+ }
+
+ tileSizeToWidth(size: TileSize): number {
+ switch (size) {
+ case TileSize.square70x70:
+ return 1;
+ case TileSize.square150x150:
+ return 2;
+ case TileSize.wide310x150:
+ case TileSize.square310x310:
+ return 4;
+ }
+ }
+
+ tileSizeToHeight(size: TileSize): number {
+ switch (size) {
+ case TileSize.square70x70:
+ return 1;
+ case TileSize.square150x150:
+ case TileSize.wide310x150:
+ return 2;
+ case TileSize.square310x310:
+ return 4;
+ }
+ }
+
+ layout() {
+ let availableHeight = this.startTilesElement.offsetHeight - this.headerText.offsetHeight;
+ let maxRows = Math.floor(availableHeight / 64) - 1;
+
+ console.log(`available height: ${availableHeight}, maxRows: ${maxRows}`);
+
+ let row = 0;
+ let column = 0;
+ let baseColumn = 0;
+ this.tilesElement.style.gridTemplateRows = "60px ".repeat(maxRows);
+
+ let lastWidth = 0;
+ let lastHeight = 0;
+
+ for (const tile of this.tiles) {
+ if (tile.isFence && tile.tileSize == TileSize.square70x70) {
+
+ }
+
+ let tileWidth = this.tileSizeToWidth(tile.tileSize);
+ let tileHeight = this.tileSizeToHeight(tile.tileSize);
+
+ column += Math.max(lastWidth, tileWidth); // thanks sharpy <3
+
+ if ((column - baseColumn) >= 4) {
+ if ((row + Math.max(lastHeight, tileHeight) + 1) >= maxRows) {
+ row = 0;
+ baseColumn += 4;
+ }
+ else {
+ row += lastHeight;
+ }
+
+ column = baseColumn;
+ }
+
+ tile.rootElement.style.gridRowStart = (row + 1).toString();
+ tile.rootElement.style.gridColumnStart = (column + 1).toString();
+
+ lastWidth = tileWidth;
+ lastHeight = tileHeight;
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/wankerr.desktop/src/Desktop/start.css b/packages/wankerr.desktop/src/Desktop/start.css
index 74ea77bd..ef6dc38a 100644
--- a/packages/wankerr.desktop/src/Desktop/start.css
+++ b/packages/wankerr.desktop/src/Desktop/start.css
@@ -94,8 +94,10 @@
.start-tiles {
padding-left: 118px;
+ height: 100%;
display: flex;
overflow-x: auto;
+ align-items: center;
-webkit-overflow-scrolling: touch;
}
@@ -113,13 +115,12 @@
.start-tile-group {
display: flex;
flex-direction: column;
- height: 100%;
margin-right: 56px;
}
.tile-group-header {
height: 35px;
- margin: 8px 0;
+ padding: 8px 0;
font-size: 22px;
font-weight: 100;
}
@@ -133,7 +134,7 @@
grid-column-gap: 4px;
grid-auto-columns: 60px;
grid-row-gap: 4px;
- grid-template-rows: repeat(auto-fit, 60px);
+ grid-template-rows: repeat(auto-fill, 60px);
flex: 1;
}
diff --git a/packages/wankerr.desktop/src/Desktop/tile.css b/packages/wankerr.desktop/src/Desktop/tile.css
index 61f52307..8c96a357 100644
--- a/packages/wankerr.desktop/src/Desktop/tile.css
+++ b/packages/wankerr.desktop/src/Desktop/tile.css
@@ -20,11 +20,11 @@
height: 100%;
}
-.tile-container.wide310x150Logo {
+.tile-container.wide310x150 {
grid-column-end: span 4;
}
-.tile-container.square310x310Logo {
+.tile-container.square310x310 {
grid-row-end: span 4;
grid-column-end: span 4;
}
@@ -36,7 +36,7 @@
transform-style: preserve-3d;
}
-.tile-container.square70x70Logo {
+.tile-container.square70x70 {
grid-row-end: span 1;
grid-column-end: span 1;
}
@@ -80,11 +80,11 @@
max-height: 120px;
}
-.tile-front-image.square70x70Logo {
+.tile-front-image.square70x70 {
max-height: 50px;
}
-.tile-front-image.square310x310Logo {
+.tile-front-image.square310x310 {
max-height: 246px;
}
diff --git a/packages/wankerr.desktop/tsconfig.json b/packages/wankerr.desktop/tsconfig.json
new file mode 100644
index 00000000..04efe95f
--- /dev/null
+++ b/packages/wankerr.desktop/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compileOnSave": true,
+ "compilerOptions": {
+ "experimentalDecorators": true,
+ "noImplicitAny": false,
+ "sourceMap": true,
+ "lib": [ "ES2020", "DOM", "DOM.Iterable" ],
+ "target": "ES6",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "outDir": "./dist"
+ }
+}
\ No newline at end of file
diff --git a/tools/StaticDumper/StaticDumper/MainPage.xaml.cs b/tools/StaticDumper/StaticDumper/MainPage.xaml.cs
index 8929dc1c..e7ef6b3b 100644
--- a/tools/StaticDumper/StaticDumper/MainPage.xaml.cs
+++ b/tools/StaticDumper/StaticDumper/MainPage.xaml.cs
@@ -35,10 +35,10 @@ public MainPage()
private async void Page_Loaded(object ass, RoutedEventArgs fuck)
{
- var file = await ApplicationData.Current.TemporaryFolder.CreateFileAsync($"Microsoft.Entertainment.ts", CreationCollisionOption.ReplaceExisting);
+ var file = await ApplicationData.Current.TemporaryFolder.CreateFileAsync($"LibWrap.ts", CreationCollisionOption.ReplaceExisting);
var writer = new StreamWriter(await file.OpenStreamForWriteAsync());
- var asm = typeof(Microsoft.Entertainment.ApplicationLifetimeManager).Assembly;
+ var asm = typeof(LibWrap.WrSkyLib).Assembly;
var dumper = new Dumper(asm, writer) { GetPropertyValues = true };
await Task.Run(() => dumper.Dump());
diff --git a/tsconfig.json b/tsconfig.json
index 04efe95f..4b76befe 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,13 +1,17 @@
{
"compileOnSave": true,
"compilerOptions": {
+ "module": "commonjs",
"experimentalDecorators": true,
"noImplicitAny": false,
"sourceMap": true,
- "lib": [ "ES2020", "DOM", "DOM.Iterable" ],
+ "lib": [ "ES2020", "DOM" ],
"target": "ES6",
"moduleResolution": "node",
"resolveJsonModule": true,
"outDir": "./dist"
- }
+ },
+ "include": [
+ "./index.ts"
+ ]
}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 407441ef..697ba567 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,7 +2,7 @@
# yarn lockfile v1
-"@electron/get@^1.0.1":
+"@electron/get@^1.0.1", "@electron/get@^1.6.0":
version "1.12.2"
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.12.2.tgz#6442066afb99be08cefb9a281e4b4692b33764f3"
integrity sha512-vAuHUbfvBQpYTJ5wB7uVIDq5c/Ry0fiTBMs7lnEYAo/qXXppIVcWdfBr57u6eRnKdVso7KSiH6p/LbQAG6Izrg==
@@ -30,21 +30,109 @@
dependencies:
defer-to-connect "^1.0.1"
+"@types/glob@^7.1.1":
+ version "7.1.3"
+ resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183"
+ integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==
+ dependencies:
+ "@types/minimatch" "*"
+ "@types/node" "*"
+
+"@types/minimatch@*":
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
+ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
+
+"@types/node@*":
+ version "14.0.27"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.27.tgz#a151873af5a5e851b51b3b065c9e63390a9e0eb1"
+ integrity sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==
+
"@types/node@^12.0.12":
version "12.12.47"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.47.tgz#5007b8866a2f9150de82335ca7e24dd1d59bdfb5"
integrity sha512-yzBInQFhdY8kaZmqoL2+3U5dSTMrKaYcb561VU+lDzAYvqt+2lojvBEy+hmpSNuXnPTx7m9+04CzWYOUqWME2A==
+"@types/yauzl@^2.9.1":
+ version "2.9.1"
+ resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.1.tgz#d10f69f9f522eef3cf98e30afb684a1e1ec923af"
+ integrity sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==
+ dependencies:
+ "@types/node" "*"
+
+asar@^3.0.0:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/asar/-/asar-3.0.3.tgz#1fef03c2d6d2de0cbad138788e4f7ae03b129c7b"
+ integrity sha512-k7zd+KoR+n8pl71PvgElcoKHrVNiSXtw7odKbyNpmgKe7EGRF9Pnu3uLOukD37EvavKwVFxOUpqXTIZC5B5Pmw==
+ dependencies:
+ chromium-pickle-js "^0.2.0"
+ commander "^5.0.0"
+ glob "^7.1.6"
+ minimatch "^3.0.4"
+ optionalDependencies:
+ "@types/glob" "^7.1.1"
+
+at-least-node@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2"
+ integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==
+
+author-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/author-regex/-/author-regex-1.0.0.tgz#d08885be6b9bbf9439fe087c76287245f0a81450"
+ integrity sha1-0IiFvmubv5Q5/gh8dihyRfCoFFA=
+
+balanced-match@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
+ integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
+
+base64-js@^1.2.3:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
+ integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==
+
+bluebird@^3.1.1, bluebird@^3.5.0:
+ version "3.7.2"
+ resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
+ integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
+
boolean@^3.0.0, boolean@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.0.1.tgz#35ecf2b4a2ee191b0b44986f14eb5f052a5cbb4f"
integrity sha512-HRZPIjPcbwAVQvOTxR4YE3o8Xs98NqbbL1iEZDCz7CL8ql0Lt5iOyJFxfnAB0oFs8Oh02F/lLlg30Mexv46LjA==
+brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+buffer-alloc-unsafe@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0"
+ integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==
+
+buffer-alloc@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec"
+ integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==
+ dependencies:
+ buffer-alloc-unsafe "^1.1.0"
+ buffer-fill "^1.0.0"
+
buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=
+buffer-fill@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c"
+ integrity sha1-+PeLdniYiO858gXNY39o5wISKyw=
+
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
@@ -63,6 +151,16 @@ cacheable-request@^6.0.0:
normalize-url "^4.1.0"
responselike "^1.0.2"
+camelcase@^5.0.0:
+ version "5.3.1"
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
+ integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
+
+chromium-pickle-js@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz#04a106672c18b085ab774d983dfa3ea138f22205"
+ integrity sha1-BKEGZywYsIWrd02YPfo+oTjyIgU=
+
clone-response@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
@@ -70,6 +168,21 @@ clone-response@^1.0.2:
dependencies:
mimic-response "^1.0.0"
+commander@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
+ integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==
+
+compare-version@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/compare-version/-/compare-version-0.1.2.tgz#0162ec2d9351f5ddd59a9202cba935366a725080"
+ integrity sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA=
+
+concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
+
concat-stream@^1.6.2:
version "1.6.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
@@ -98,20 +211,32 @@ core-util-is@~1.0.0:
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
-debug@^2.6.9:
+debug@^2.2.0, debug@^2.6.8, debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
dependencies:
ms "2.0.0"
-debug@^4.1.0, debug@^4.1.1:
+debug@^3.1.0:
+ version "3.2.6"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
+ integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
+ dependencies:
+ ms "^2.1.1"
+
+debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
dependencies:
ms "^2.1.1"
+decamelize@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
+ integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
+
decompress-response@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
@@ -149,10 +274,53 @@ duplexer3@^0.1.4:
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
-electron@^8.2.5:
- version "8.3.4"
- resolved "https://registry.yarnpkg.com/electron/-/electron-8.3.4.tgz#d9c5441f34462a022480f3ebe2cf39ea5dd37b96"
- integrity sha512-aSYXBV0PxYHmXhjGFpR0x38zbO7UTDex2JrT5tcqJpUZTY+sKdfo9PA1TpiyrHNjA5+Q8UseRUsydRedOTeZQA==
+electron-notarize@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-1.0.0.tgz#bc925b1ccc3f79e58e029e8c4706572b01a9fd8f"
+ integrity sha512-dsib1IAquMn0onCrNMJ6gtEIZn/azG8hZMCYOuZIMVMUeRMgBYHK1s5TK9P8xAcrAjh/2aN5WYHzgVSWX314og==
+ dependencies:
+ debug "^4.1.1"
+ fs-extra "^9.0.1"
+
+electron-osx-sign@^0.4.11:
+ version "0.4.17"
+ resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.17.tgz#2727ca0c79e1e4e5ccd3861fb3da9c3c913b006c"
+ integrity sha512-wUJPmZJQCs1zgdlQgeIpRcvrf7M5/COQaOV68Va1J/SgmWx5KL2otgg+fAae7luw6qz9R8Gvu/Qpe9tAOu/3xQ==
+ dependencies:
+ bluebird "^3.5.0"
+ compare-version "^0.1.2"
+ debug "^2.6.8"
+ isbinaryfile "^3.0.2"
+ minimist "^1.2.0"
+ plist "^3.0.1"
+
+electron-packager@^15.0.0:
+ version "15.0.0"
+ resolved "https://registry.yarnpkg.com/electron-packager/-/electron-packager-15.0.0.tgz#40eb28a273a1251da9e089f6fde4222e72f6eedd"
+ integrity sha512-J0yQP7/fKPkjxo9Yz5+vsQVig0dBbSXW8LQYA1pvNMvi+bL00hfI2SAyORP6EU7XaeiXGUIBSG2Px01EkKfGCw==
+ dependencies:
+ "@electron/get" "^1.6.0"
+ asar "^3.0.0"
+ debug "^4.0.1"
+ electron-notarize "^1.0.0"
+ electron-osx-sign "^0.4.11"
+ extract-zip "^2.0.0"
+ filenamify "^4.1.0"
+ fs-extra "^9.0.0"
+ galactus "^0.2.1"
+ get-package-info "^1.0.0"
+ junk "^3.1.0"
+ parse-author "^2.0.0"
+ plist "^3.0.0"
+ rcedit "^2.0.0"
+ resolve "^1.1.6"
+ semver "^7.1.3"
+ yargs-parser "^18.0.0"
+
+electron@^9.1.0:
+ version "9.2.0"
+ resolved "https://registry.yarnpkg.com/electron/-/electron-9.2.0.tgz#d9fc8c8c9e5109669c366bd7b9ba83b06095d7a4"
+ integrity sha512-4ecZ3rcGg//Gk4fAK3Jo61T+uh36JhU6HHR/PTujQqQiBw1g4tNPd4R2hGGth2d+7FkRIs5GdRNef7h64fQEMw==
dependencies:
"@electron/get" "^1.0.1"
"@types/node" "^12.0.12"
@@ -175,11 +343,23 @@ env-paths@^2.2.0:
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43"
integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==
+error-ex@^1.2.0:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
+ integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
+ dependencies:
+ is-arrayish "^0.2.1"
+
es6-error@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==
+escape-string-regexp@^1.0.2:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
+ integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
+
escape-string-regexp@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
@@ -195,6 +375,17 @@ extract-zip@^1.0.3:
mkdirp "^0.5.4"
yauzl "^2.10.0"
+extract-zip@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a"
+ integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==
+ dependencies:
+ debug "^4.1.1"
+ get-stream "^5.1.0"
+ yauzl "^2.10.0"
+ optionalDependencies:
+ "@types/yauzl" "^2.9.1"
+
fd-slicer@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e"
@@ -202,6 +393,53 @@ fd-slicer@~1.1.0:
dependencies:
pend "~1.2.0"
+filename-reserved-regex@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz#abf73dfab735d045440abfea2d91f389ebbfa229"
+ integrity sha1-q/c9+rc10EVECr/qLZHzieu/oik=
+
+filenamify@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/filenamify/-/filenamify-4.1.0.tgz#54d110810ae74eebfe115c1b995bd07e03cf2184"
+ integrity sha512-KQV/uJDI9VQgN7sHH1Zbk6+42cD6mnQ2HONzkXUfPJ+K2FC8GZ1dpewbbHw0Sz8Tf5k3EVdHVayM4DoAwWlmtg==
+ dependencies:
+ filename-reserved-regex "^2.0.0"
+ strip-outer "^1.0.1"
+ trim-repeated "^1.0.0"
+
+find-up@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
+ integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c=
+ dependencies:
+ locate-path "^2.0.0"
+
+flora-colossus@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/flora-colossus/-/flora-colossus-1.0.1.tgz#aba198425a8185341e64f9d2a6a96fd9a3cbdb93"
+ integrity sha512-d+9na7t9FyH8gBJoNDSi28mE4NgQVGGvxQ4aHtFRetjyh5SXjuus+V5EZaxFmFdXVemSOrx0lsgEl/ZMjnOWJA==
+ dependencies:
+ debug "^4.1.1"
+ fs-extra "^7.0.0"
+
+fs-extra@^4.0.0:
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
+ integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==
+ dependencies:
+ graceful-fs "^4.1.2"
+ jsonfile "^4.0.0"
+ universalify "^0.1.0"
+
+fs-extra@^7.0.0:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
+ integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
+ dependencies:
+ graceful-fs "^4.1.2"
+ jsonfile "^4.0.0"
+ universalify "^0.1.0"
+
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
@@ -211,6 +449,40 @@ fs-extra@^8.1.0:
jsonfile "^4.0.0"
universalify "^0.1.0"
+fs-extra@^9.0.0, fs-extra@^9.0.1:
+ version "9.0.1"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
+ integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==
+ dependencies:
+ at-least-node "^1.0.0"
+ graceful-fs "^4.2.0"
+ jsonfile "^6.0.1"
+ universalify "^1.0.0"
+
+fs.realpath@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
+ integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
+
+galactus@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/galactus/-/galactus-0.2.1.tgz#cbed2d20a40c1f5679a35908e2b9415733e78db9"
+ integrity sha1-y+0tIKQMH1Z5o1kI4rlBVzPnjbk=
+ dependencies:
+ debug "^3.1.0"
+ flora-colossus "^1.0.0"
+ fs-extra "^4.0.0"
+
+get-package-info@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/get-package-info/-/get-package-info-1.0.0.tgz#6432796563e28113cd9474dbbd00052985a4999c"
+ integrity sha1-ZDJ5ZWPigRPNlHTbvQAFKYWkmZw=
+ dependencies:
+ bluebird "^3.1.1"
+ debug "^2.2.0"
+ lodash.get "^4.0.0"
+ read-pkg-up "^2.0.0"
+
get-stream@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
@@ -225,6 +497,18 @@ get-stream@^5.1.0:
dependencies:
pump "^3.0.0"
+glob@^7.1.6:
+ version "7.1.6"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
+ integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
global-agent@^2.0.2:
version "2.1.12"
resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-2.1.12.tgz#e4ae3812b731a9e81cbf825f9377ef450a8e4195"
@@ -272,17 +556,30 @@ got@^9.6.0:
to-readable-stream "^1.0.0"
url-parse-lax "^3.0.0"
-graceful-fs@^4.1.6, graceful-fs@^4.2.0:
+graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.4"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==
+hosted-git-info@^2.1.4:
+ version "2.8.8"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488"
+ integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==
+
http-cache-semantics@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
-inherits@^2.0.3, inherits@~2.0.3:
+inflight@^1.0.4:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
+ integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
+ dependencies:
+ once "^1.3.0"
+ wrappy "1"
+
+inherits@2, inherits@^2.0.3, inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
@@ -292,6 +589,11 @@ ini@^1.3.4:
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
+is-arrayish@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
+ integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
+
is-buffer@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
@@ -302,6 +604,13 @@ isarray@~1.0.0:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
+isbinaryfile@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80"
+ integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==
+ dependencies:
+ buffer-alloc "^1.2.0"
+
json-buffer@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
@@ -319,6 +628,20 @@ jsonfile@^4.0.0:
optionalDependencies:
graceful-fs "^4.1.6"
+jsonfile@^6.0.1:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.0.1.tgz#98966cba214378c8c84b82e085907b40bf614179"
+ integrity sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==
+ dependencies:
+ universalify "^1.0.0"
+ optionalDependencies:
+ graceful-fs "^4.1.6"
+
+junk@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/junk/-/junk-3.1.0.tgz#31499098d902b7e98c5d9b9c80f43457a88abfa1"
+ integrity sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==
+
keyv@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
@@ -333,6 +656,29 @@ kind-of@^3.0.2:
dependencies:
is-buffer "^1.1.5"
+load-json-file@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
+ integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=
+ dependencies:
+ graceful-fs "^4.1.2"
+ parse-json "^2.2.0"
+ pify "^2.0.0"
+ strip-bom "^3.0.0"
+
+locate-path@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
+ integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=
+ dependencies:
+ p-locate "^2.0.0"
+ path-exists "^3.0.0"
+
+lodash.get@^4.0.0:
+ version "4.4.2"
+ resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
+ integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=
+
lodash@^4.17.10:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
@@ -360,7 +706,14 @@ mimic-response@^1.0.0, mimic-response@^1.0.1:
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
-minimist@^1.2.5:
+minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
+ dependencies:
+ brace-expansion "^1.1.7"
+
+minimist@^1.2.0, minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
@@ -382,6 +735,21 @@ ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
+node-fetch@^2.6.0:
+ version "2.6.0"
+ resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
+ integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
+
+normalize-package-data@^2.3.2:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
+ integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==
+ dependencies:
+ hosted-git-info "^2.1.4"
+ resolve "^1.10.0"
+ semver "2 || 3 || 4 || 5"
+ validate-npm-package-license "^3.0.1"
+
normalize-url@^4.1.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129"
@@ -400,7 +768,7 @@ object-keys@^1.0.12:
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
-once@^1.3.1, once@^1.4.0:
+once@^1.3.0, once@^1.3.1, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
@@ -412,16 +780,85 @@ p-cancelable@^1.0.0:
resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc"
integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==
+p-limit@^1.1.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
+ integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==
+ dependencies:
+ p-try "^1.0.0"
+
+p-locate@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
+ integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=
+ dependencies:
+ p-limit "^1.1.0"
+
+p-try@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
+ integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=
+
+parse-author@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/parse-author/-/parse-author-2.0.0.tgz#d3460bf1ddd0dfaeed42da754242e65fb684a81f"
+ integrity sha1-00YL8d3Q367tQtp1QkLmX7aEqB8=
+ dependencies:
+ author-regex "^1.0.0"
+
+parse-json@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
+ integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=
+ dependencies:
+ error-ex "^1.2.0"
+
+path-exists@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
+ integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
+
+path-is-absolute@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
+ integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
+
+path-parse@^1.0.6:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
+ integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
+
+path-type@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
+ integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=
+ dependencies:
+ pify "^2.0.0"
+
pend@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA=
+pify@^2.0.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
+ integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
+
pify@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
+plist@^3.0.0, plist@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c"
+ integrity sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==
+ dependencies:
+ base64-js "^1.2.3"
+ xmlbuilder "^9.0.7"
+ xmldom "0.1.x"
+
prepend-http@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
@@ -450,6 +887,28 @@ pump@^3.0.0:
end-of-stream "^1.1.0"
once "^1.3.1"
+rcedit@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/rcedit/-/rcedit-2.2.0.tgz#3bfe71248749fa821fef26eda3d35f4e0ee47afc"
+ integrity sha512-dhFtYmQS+V8qQIANyX6zDK+sO50ayDePKApi46ZPK8I6QeyyTDD6LManMa7a3p3c9mLM4zi9QBP41pfhQ9p7Sg==
+
+read-pkg-up@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be"
+ integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=
+ dependencies:
+ find-up "^2.0.0"
+ read-pkg "^2.0.0"
+
+read-pkg@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8"
+ integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=
+ dependencies:
+ load-json-file "^2.0.0"
+ normalize-package-data "^2.3.2"
+ path-type "^2.0.0"
+
readable-stream@^2.2.2:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
@@ -468,6 +927,13 @@ rename-keys@^1.1.2:
resolved "https://registry.yarnpkg.com/rename-keys/-/rename-keys-1.2.0.tgz#be602fb0b750476b513ebe85ba4465d03254f0a3"
integrity sha512-U7XpAktpbSgHTRSNRrjKSrjYkZKuhUukfoBlXWXUExCAqhzh1TU3BDRAfJmarcl5voKS+pbKU9MvyLWKZ4UEEg==
+resolve@^1.1.6, resolve@^1.10.0:
+ version "1.17.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
+ integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
+ dependencies:
+ path-parse "^1.0.6"
+
responselike@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
@@ -504,7 +970,12 @@ semver-compare@^1.0.0:
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
-semver@^7.3.2:
+"semver@2 || 3 || 4 || 5":
+ version "5.7.1"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
+ integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
+
+semver@^7.1.3, semver@^7.3.2:
version "7.3.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==
@@ -516,6 +987,32 @@ serialize-error@^7.0.1:
dependencies:
type-fest "^0.13.1"
+spdx-correct@^3.0.0:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9"
+ integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==
+ dependencies:
+ spdx-expression-parse "^3.0.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-exceptions@^2.1.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d"
+ integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==
+
+spdx-expression-parse@^3.0.0:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679"
+ integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==
+ dependencies:
+ spdx-exceptions "^2.1.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-license-ids@^3.0.0:
+ version "3.0.5"
+ resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654"
+ integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==
+
sprintf-js@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673"
@@ -528,6 +1025,18 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
+strip-bom@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
+ integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
+
+strip-outer@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/strip-outer/-/strip-outer-1.0.1.tgz#b2fd2abf6604b9d1e6013057195df836b8a9d631"
+ integrity sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==
+ dependencies:
+ escape-string-regexp "^1.0.2"
+
sumchecker@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-3.0.1.tgz#6377e996795abb0b6d348e9b3e1dfb24345a8e42"
@@ -540,6 +1049,13 @@ to-readable-stream@^1.0.0:
resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771"
integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==
+trim-repeated@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/trim-repeated/-/trim-repeated-1.0.0.tgz#e3646a2ea4e891312bf7eace6cfb05380bc01c21"
+ integrity sha1-42RqLqTokTEr9+rObPsFOAvAHCE=
+ dependencies:
+ escape-string-regexp "^1.0.2"
+
truncate-utf8-bytes@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz#405923909592d56f78a5818434b0b78489ca5f2b"
@@ -572,6 +1088,11 @@ universalify@^0.1.0:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
+universalify@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"
+ integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==
+
url-parse-lax@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
@@ -589,11 +1110,37 @@ util-deprecate@~1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
+validate-npm-package-license@^3.0.1:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
+ integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==
+ dependencies:
+ spdx-correct "^3.0.0"
+ spdx-expression-parse "^3.0.0"
+
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
+xmlbuilder@^9.0.7:
+ version "9.0.7"
+ resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
+ integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=
+
+xmldom@0.1.x:
+ version "0.1.31"
+ resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.31.tgz#b76c9a1bd9f0a9737e5a72dc37231cf38375e2ff"
+ integrity sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==
+
+yargs-parser@^18.0.0:
+ version "18.1.3"
+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"
+ integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
+ dependencies:
+ camelcase "^5.0.0"
+ decamelize "^1.2.0"
+
yauzl@^2.10.0:
version "2.10.0"
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"