From 7886e3b360ff954423203c7bf9fb6b1ffba0d19c Mon Sep 17 00:00:00 2001 From: Preston Date: Thu, 4 Jun 2020 22:09:54 -0400 Subject: [PATCH 1/3] Update Dependencies --- package-lock.json | 24 +++++++++++------------- package.json | 6 +++--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index f96b0da5..0660f6f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17807,8 +17807,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "resolved": "", "dev": true }, "schema-utils": { @@ -19349,9 +19348,9 @@ } }, "typescript": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", - "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", + "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", "dev": true }, "underscore": { @@ -20409,8 +20408,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "resolved": "", "dev": true }, "string-width": { @@ -21175,9 +21173,9 @@ } }, "ytdl-core": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ytdl-core/-/ytdl-core-3.1.0.tgz", - "integrity": "sha512-3dDIugHLusJ5vXnII4bYrSWLwKPVxPL+nvVl2YS7Jgi0ui6I9RBODKXSu6Xttysvc0HN60QOcDeDFTKmUs92Bg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/ytdl-core/-/ytdl-core-3.1.1.tgz", + "integrity": "sha512-sHw8Vz56Bs7LRKhJARW8j2JREndHFBuEdnYKgjx4RHwh1t75TsdZ5/SRpz9TLkNm2M5S8gVwvWm7AD1blhjb0g==", "requires": { "html-entities": "^1.3.1", "m3u8stream": "^0.7.1", @@ -21194,9 +21192,9 @@ } }, "ytsr": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/ytsr/-/ytsr-0.1.14.tgz", - "integrity": "sha512-YlLIDRPVUBOXnBjW6RytxpzC8g5ieqwjzcdrmmgdvTmVD/iisvNBPO5LhqB7R0kbuNHjFW6FBYpCTvCF1gCrHA==", + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ytsr/-/ytsr-0.1.15.tgz", + "integrity": "sha512-oOzklBMlRn4SVODMPG/McgX78R5pVBio32TPAoZtP2LBGo/glIbf+QqH8FXbkzIc03Qzp4tsEtQAHOJzg1noFg==", "requires": { "html-entities": "^1.1.3" } diff --git a/package.json b/package.json index 52a30a87..eb925209 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,9 @@ "youtube-comments-task": "^1.3.15", "youtube-suggest": "^1.1.0", "yt-xml2vtt": "^1.0.1", - "ytdl-core": "^3.1.0", + "ytdl-core": "^3.1.1", "ytpl": "^0.1.21", - "ytsr": "^0.1.14" + "ytsr": "^0.1.15" }, "description": "A private YouTube client", "devDependencies": { @@ -84,7 +84,7 @@ "sass-loader": "^8.0.2", "style-loader": "^1.2.1", "tree-kill": "1.2.2", - "typescript": "^3.9.3", + "typescript": "^3.9.5", "url-loader": "^4.1.0", "vue-devtools": "^5.1.3", "vue-eslint-parser": "^7.1.0", From 650cc4c0ba3057fa9ce19c5702c2fc2f4187d1f4 Mon Sep 17 00:00:00 2001 From: Preston Date: Thu, 4 Jun 2020 22:44:58 -0400 Subject: [PATCH 2/3] Check for more live stream qualities. --- src/renderer/views/Watch/Watch.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 6b930661..361be657 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -232,14 +232,29 @@ export default Vue.extend({ if (typeof (format.mimeType) !== 'undefined') { return format.mimeType.includes('video/ts') } + + return format.itag === 300 || format.itag === 301 }).map((format) => { + let qualityLabel + + if (format.itag === 300) { + qualityLabel = '720p' + } else if (format.itag === 301) { + qualityLabel = '1080p' + } else { + qualityLabel = format.qualityLabel + } return { url: format.url, type: 'application/x-mpegURL', label: 'Dash', - qualityLabel: format.qualityLabel + qualityLabel: qualityLabel } - }).reverse() + }).sort((a, b) => { + const qualityA = parseInt(a.qualityLabel.replace('p', '')) + const qualityB = parseInt(b.qualityLabel.replace('p', '')) + return qualityA - qualityB + }) this.activeSourceList = this.videoSourceList } else { From e155b65c086848f904bc940c1594c3b951558c6a Mon Sep 17 00:00:00 2001 From: Preston Date: Fri, 5 Jun 2020 23:15:44 -0400 Subject: [PATCH 3/3] Add ft-icon-button component --- .../ft-icon-button/ft-icon-button.css | 113 ++++++++++++++++++ .../ft-icon-button/ft-icon-button.js | 54 +++++++++ .../ft-icon-button/ft-icon-button.vue | 35 ++++++ .../watch-video-info/watch-video-info.css | 19 +-- .../watch-video-info/watch-video-info.js | 4 +- .../watch-video-info/watch-video-info.vue | 28 +++-- src/renderer/themes.css | 32 +++++ 7 files changed, 255 insertions(+), 30 deletions(-) create mode 100644 src/renderer/components/ft-icon-button/ft-icon-button.css create mode 100644 src/renderer/components/ft-icon-button/ft-icon-button.js create mode 100644 src/renderer/components/ft-icon-button/ft-icon-button.vue diff --git a/src/renderer/components/ft-icon-button/ft-icon-button.css b/src/renderer/components/ft-icon-button/ft-icon-button.css new file mode 100644 index 00000000..1dd1eadf --- /dev/null +++ b/src/renderer/components/ft-icon-button/ft-icon-button.css @@ -0,0 +1,113 @@ +.ftIconButton { + display: flex; + flex-flow: row wrap; + justify-content: space-evenly; + position: relative; +} + +.iconButton { + width: 1em; + height: 1em; + padding: 10px; + font-size: 20px; + border-radius: 50%; + box-shadow: 0 1px 2px rgba(0,0,0,.5); + cursor: pointer; + -moz-transition: background 0.2s ease-out; + -o-transition: background 0.2s ease-out; + transition: background 0.2s ease-out; +} + +.iconButton:hover { + -moz-transition: background 0.2s ease-in; + -o-transition: background 0.2s ease-in; + transition: background 0.2s ease-in; +} + +.base { + background-color: var(--card-bg-color); + color: var(--primary-text-color); +} + +.base:hover { + background-color: var(--side-nav-hover-color); +} + +.base:active { + background-color: var(--side-nav-active-color); +} + +.primary { + background-color: var(--primary-color); + color: var(--text-with-main-color); +} + +.primary:hover { + background-color: var(--primary-color-hover); +} + +.primary:active { + background-color: var(--primary-color-active); +} + +.secondary { + background-color: var(--accent-color); + color: var(--text-with-accent-color); +} + +.secondary:hover { + background-color: var(--accent-color-hover); +} + +.secondary:active { + background-color: var(--accent-color-active); +} + +.iconDropdown { + position: absolute; + text-align: center; + list-style-type: none; + z-index: 100; + margin-top: 45px; + font-size: 12px; + box-shadow: 0 1px 2px rgba(0,0,0,.5); + background-color: var(--card-bg-color); + color: var(--secondary-text-color); +} + +.iconDropdown p { + padding: 10px; + margin: 0; + white-space: nowrap; + cursor: pointer; + -moz-transition: background 0.2s ease-out; + -o-transition: background 0.2s ease-out; + transition: background 0.2s ease-out; +} + +.iconDropdown p:hover { + background-color: var(--side-nav-hover-color); + -moz-transition: background 0.2s ease-in; + -o-transition: background 0.2s ease-in; + transition: background 0.2s ease-in; +} + +.iconDropdown p:active { + background-color: var(--side-nav-active-color); + -moz-transition: background 0.1s ease-in; + -o-transition: background 0.1s ease-in; + transition: background 0.1s ease-in; +} + +.iconDropdown p a { + text-decoration: none; + color: inherit; +} + +.left { + right: 100%; +} + +.right { + left: 100%; +} diff --git a/src/renderer/components/ft-icon-button/ft-icon-button.js b/src/renderer/components/ft-icon-button/ft-icon-button.js new file mode 100644 index 00000000..8fe06aca --- /dev/null +++ b/src/renderer/components/ft-icon-button/ft-icon-button.js @@ -0,0 +1,54 @@ +import Vue from 'vue' + +export default Vue.extend({ + name: 'FtIconButton', + props: { + title: { + type: String, + default: '' + }, + icon: { + type: String, + default: 'ellipsis-v' + }, + theme: { + type: String, + default: 'base' + }, + dropdownPosition: { + type: String, + default: 'center' + }, + dropdownNames: { + type: Array, + default: () => { return [] } + }, + dropdownValues: { + type: Array, + default: () => { return [] } + } + }, + data: function () { + return { + showDropdown: false + } + }, + methods: { + toggleDropdown: function () { + this.showDropdown = !this.showDropdown + }, + + handleIconClick: function () { + if (this.dropdownNames.length > 0 && this.dropdownValues.length > 0) { + this.toggleDropdown() + } else { + this.$emit('click') + } + }, + + handleDropdownClick: function (index) { + this.toggleDropdown() + this.$emit('click', this.dropdownValues[index]) + } + } +}) diff --git a/src/renderer/components/ft-icon-button/ft-icon-button.vue b/src/renderer/components/ft-icon-button/ft-icon-button.vue new file mode 100644 index 00000000..a0432bf4 --- /dev/null +++ b/src/renderer/components/ft-icon-button/ft-icon-button.vue @@ -0,0 +1,35 @@ + + +